feat: support abi & api#5641
Conversation
🦋 Changeset detectedLatest commit: d90cf4f 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 Prime V2 contract ABIs and REST API endpoints to replace the placeholder data throughout the Prime Leaderboard feature. It introduces
Confidence Score: 5/5The change is largely additive with no removal of existing functionality; V2 contract routing is correctly gated by feature flags and callOrThrow guards. All identified concerns are non-blocking: the primeAbi used for V2 claim encoding is functionally identical for claimInterest, the hardcoded-average fallback of 1 XVS only affects markets not yet in the constants map (none exist on current deployments), and the market-address selection in useGetPrimeUserRewards is a display concern depending on protocol behavior. appendPrimeSimulationDistributions/index.ts and useGetPrimeUserRewards/index.ts warrant a second look before new V2 markets are added. Important Files Changed
Reviews (6): Last reviewed commit: "feat: test for endcycle" | 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
|
@greptile review again |
|
@greptile review again |
| export const VENUS_PRIME_DOC_URL = `${VENUS_DOC_URL}/whats-new/prime-yield`; | ||
| // TODO: update to the actual protection mode doc page once available | ||
| export const VENUS_PROTECTION_MODE_DOC_URL = `${VENUS_DOC_URL}/risk/protection-mode`; | ||
| // TODO: set the BscScan URL for verifying Prime ranks on-chain |
There was a problem hiding this comment.
Broken placeholder URL shipped to users
PRIME_RANK_VERIFICATION_BSC_SCAN_URL is set to '#' and is rendered in RankTable as <a href="#" target="_blank" rel="noopener noreferrer">. Because of target="_blank", clicking this link opens about:blank# in a new tab rather than any useful page. Any user who clicks the wallet-column tooltip to verify their on-chain rank will see a blank browser tab.
|
@greptile review again |
|
@greptile review again |
Jira ticket(s)
VPD-1337
Changes