-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
34cef05
commit 464efaa
Showing
1 changed file
with
47 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,47 @@ | ||
const uniFarcasterSdk: any = {}; | ||
|
||
const sdk = new uniFarcasterSdk({ | ||
hubUrl: "string | hasDefaultValue", | ||
neynarApiKey: "string | undefined", | ||
airstackApiKey: "string | undefined", | ||
}); | ||
|
||
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); |