Skip to content

Commit

Permalink
refactor: types
Browse files Browse the repository at this point in the history
  • Loading branch information
tmm committed Feb 8, 2024
1 parent bdf74cc commit 029082f
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 11 deletions.
15 changes: 4 additions & 11 deletions src/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -17,20 +17,13 @@ import {
type FrameButton,
type FrameMetaTagPropertyName,
type FrameVersion,
type TrustedData,
type UntrustedData,
} from './types.js'

type FrameContext = Context & {
trustedData?: { messageBytes: string }
untrustedData?: {
fid: number
url: string
messageHash: string
timestamp: number
network: number
buttonIndex?: 1 | 2 | 3 | 4
castId: { fid: number; hash: string }
inputText?: string
}
trustedData?: TrustedData
untrustedData?: UntrustedData
}

type FrameReturnType = {
Expand Down
15 changes: 15 additions & 0 deletions src/types.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,20 @@
// TODO: TSDoc

export type TrustedData = {
messageBytes: string
}

export type UntrustedData = {
buttonIndex?: FrameButton['index'] | undefined
castId: { fid: number; hash: string }
fid: number
inputText?: string
messageHash: string
network: number
timestamp: number
url: string
}

export type Frame = {
buttons?: readonly FrameButton[] | undefined
debug?: FrameDebug | undefined
Expand Down

0 comments on commit 029082f

Please sign in to comment.