Skip to content

Commit

Permalink
feat: support verified_addresses from neynar
Browse files Browse the repository at this point in the history
  • Loading branch information
cnasc committed Feb 23, 2024
1 parent acadeaa commit 5b3da32
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 0 deletions.
4 changes: 4 additions & 0 deletions src/frame/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,10 @@ export interface FrameValidationData {
fid: number; // Viewer Farcaster ID
custody_address: string; // Viewer custody address
verified_accounts: string[]; // Viewer account addresses
verified_addresses?: {
verified_eth_accounts?: string[];
verified_sol_accounts?: string[];
};
};
liked: boolean; // Indicates if the viewer clicking the frame liked the cast
raw: NeynarFrameValidationInternalModel;
Expand Down
5 changes: 5 additions & 0 deletions src/utils/neynar/frame/neynarFrameModels.ts
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,11 @@ export function convertToNeynarResponseModel(data: any): FrameValidationData | u
fid: interactor?.fid,
custody_address: interactor?.custody_address,
verified_accounts: interactor?.verifications,
verified_addresses: {
// TODO: update types, ideally pulling from Neynar automatically
verified_eth_accounts: (interactor as any)?.verified_addresses?.eth_addresses,
verified_sol_accounts: (interactor as any)?.verified_addresses?.sol_addresses,
},
},
liked: cast?.viewer_context?.liked,
raw: neynarResponse,
Expand Down

0 comments on commit 5b3da32

Please sign in to comment.