feat(swap): load swap token balances via Pioneer instead of Blockscout - #285
Merged
Conversation
Three places where the same question got two answers. Orbit nodes printed vault-only TVL while the headline above them added Morpheus stakes on top. A rider backed purely through Morpheus therefore rendered unlit with no figure — Will had $31 behind him and an empty node — the per-node values could not be summed to the headline, and zooming into that rider listed the backers the overview had just denied. The mobile BackerList dropped him entirely on the same `total > 0` test. `OrbitAthlete` now carries `vaultTvl` and `morUsd`, with `total` their sum. The treasury's Sponsorship yield re-derived the DAO's take as the vault fee alone, so it read $0.0024 against /stake's $0.0112 with nothing marking one as a subset. It now prints the graph's own `treasuryUsd` — the identical field /stake shows — and names both halves under it. The per-rider table stays vault-only, since the fee is the only part attributable per rider. Warehouse credits were classified from the withdrawal's own receipt, and a bare withdraw() of balance credited earlier carries no split event, so four Morpheus payouts sat under the generic "Splits" tag. The credit that funded them does name its split, and the amounts match exactly, so an amount-matched scan of the treasury's ledger credits recovers all four. The Subnet Earnings KPI now runs the same classifier as the tile below it rather than a second copy of the old rule. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
The /swap token picker discovered held ERC-20s through Blockscout's
addresses/{addr}/tokens?type=ERC-20, which 500s on the Base instance
and crashes the picker. This switches the discovery to the same
Pioneer balance engine keepkey-vault / SwapPro use (keyless, free,
multi-source).
- New /api/wallet/pioneer-tokens route: queries Pioneer portfolio
(api.keepkey.info) for the connected address's ERC-20 holdings on
the selected chain, maps them into the picker's WalletToken shape,
excludes scam-flagged airdrops and zero balances.
- useWalletTokens now fetches the new route and pre-populates the
balance cache with base-units (decimal→bigint, so the picker doesn't
re-fire RPC calls).
Verified: 20 test files / 159 tests pass, lint clean, production
build exit 0, and the endpoint returns the user's live tokens.
Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
|
The latest updates on your projects. Learn more about Vercel for GitHub. 2 Skipped Deployments
|
This file contains hidden or 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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What
The /swap token picker discovered held ERC-20s via Blockscout's
addresses/{addr}/tokens?type=ERC-20— the exact call 500ing inproduction. This swaps the discovery over to Pioneer (api.keepkey.info),
the same keyless, free, multi-source balance engine that keepkey-vault /
SwapPro use, so a Blockscout outage can no longer blank the picker.
/api/wallet/pioneer-tokensroute: queries the Pioneer portfolioendpoint for the connected address's ERC-20 holdings on the selected
chain and maps them into the picker's
WalletTokenshape (scam-flaggedairdrops and zero balances excluded).
useWalletTokensnow fetches the new route and pre-populates thebalance cache with base-units (decimal→bigint conversion, so the picker
doesn't re-fire per-token RPC calls).
Verification
pnpm test: 20 files / 159 tests pass.pnpm lint: 0 errors (2 pre-existing warnings).pnpm build: exit 0.Co-authored-by: Claude noreply@anthropic.com