feat: support abi & api#5641
Conversation
🦋 Changeset detectedLatest commit: 5e001b6 The changes in this PR will be included in the next version bump. This PR includes changesets to release 1 package
Not sure what this means? Click here to learn what changesets are. Click here if you're a maintainer who wants to add another changeset to this PR |
bf5d385 to
4b14711
Compare
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
Greptile SummaryThis PR wires up the contract ABI and API layer for Prime V2 (PrimeLeaderboard + PrimeV2 contracts) and the new Prime Leaderboard backend endpoints, replacing the placeholder data in
Confidence Score: 4/5Safe to merge into the feature branch for continued development, but the The
Important Files Changed
Reviews (2): Last reviewed commit: "fix: review comments" | Re-trigger Greptile |
| queryKey: [ | ||
| FunctionKey.GET_PRIME_USER_PENDING_REWARDS, | ||
| { chainId, accountAddress: accountAddress as Address }, | ||
| ], |
There was a problem hiding this comment.
Unsafe
as Address cast embeds undefined into the query key
accountAddress is Address | undefined, but the cast to Address makes the query key's TypeScript type claim it is always a valid address. When the hook is disabled (because accountAddress is undefined), the key is { ..., accountAddress: undefined } even though the type says Address. This can cause silent cache-key mismatches if downstream code ever inspects or matches these keys. The same pattern appears in useGetPrimeUserCycleRewards.ts. A safe fallback avoids the assertion entirely.
| queryKey: [ | |
| FunctionKey.GET_PRIME_USER_PENDING_REWARDS, | |
| { chainId, accountAddress: accountAddress as Address }, | |
| ], | |
| queryKey: [ | |
| FunctionKey.GET_PRIME_USER_PENDING_REWARDS, | |
| { chainId, accountAddress: accountAddress ?? ('' as Address) }, | |
| ], |
| return useQuery({ | ||
| queryKey: [ | ||
| FunctionKey.GET_PRIME_USER_CYCLE_REWARDS, | ||
| { chainId, cycleIndex, accountAddress: accountAddress as Address }, |
There was a problem hiding this comment.
Same unsafe
as Address cast in query key
accountAddress can be undefined here too (it is typed Address | undefined in the hook input), yet it is cast to Address in the query key. When the hook is disabled, the serialised key silently contains undefined while the type asserts Address.
| { chainId, cycleIndex, accountAddress: accountAddress as Address }, | |
| { chainId, cycleIndex, accountAddress: accountAddress ?? ('' as Address) }, |
9bfb2b4 to
b2440a8
Compare
4b14711 to
c4b0ea7
Compare
0f43b3e to
d5bc95e
Compare
4d8d786 to
c9e1cdc
Compare
Jira ticket(s)
VPD-1337
Changes