Skip to content

Commit

Permalink
wip: api
Browse files Browse the repository at this point in the history
  • Loading branch information
Complexlity committed Aug 8, 2024
1 parent 34cef05 commit 660f4bf
Showing 1 changed file with 52 additions and 0 deletions.
52 changes: 52 additions & 0 deletions src/playground.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,52 @@
const uniFarcasterSdk: any = {}

const sdk = new uniFarcasterSdk({
neynarApiKey: "string",
airstackApiKey: "string",

})

const user: User = sdk.getUserByFid(11244, 213144)
const user2: User = sdk.getUserByUsername("complexlity", 213144)
const cast: Cast = sdk.getCastByHash('0xa0bc828', 213144)
const cast2: Cast = sdk.getCastByUrl('https://warpcast.com/0xa38dj', 213144)




type User = {
fid: number;
ethAddresses: string[];
solAddresses: string[];
username: string;
displayName: string;
bio: string;
pfpUrl: string;
followerCount: number;
followingCount: number;
powerBadge: boolean;
viewerContext: {
following: boolean;
followedBy: boolean;
};
};

type Cast = {
author: User,
userReactions: {
likes: number;
recasts: number;
},
viewerContext: {
liked: boolean;
recasted: boolean;
}
};



//Optional: Expose neynar and airstack for direct query when extra infor needed
const endpoint = "/user?limit=2"
const query = `SOME_GRAPHQL_QUERY`
sdk.neynar(endpoint)
sdk.airstack(query)

0 comments on commit 660f4bf

Please sign in to comment.