diff --git a/src/index.tsx b/src/index.tsx index 9c4afba3..44d18047 100644 --- a/src/index.tsx +++ b/src/index.tsx @@ -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 = { diff --git a/src/types.ts b/src/types.ts index 9e0bb623..3f27db50 100644 --- a/src/types.ts +++ b/src/types.ts @@ -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