Repository navigation
fix: replace debank total balance with backend portfolio summary - #12501
Merged
Merged
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub. |
swkatmask
marked this pull request as ready for review
October 19, 2026 03:15
1 task done
- Use fetchCachedJSON to match the replaced DeBank call, so the ENS panel no longer refetches on every mount/focus. - Throw on a missing or non-numeric total instead of crashing on undefined or rendering "$NaN". - Reuse FireflyFarcasterAPI.Response for the envelope type. - Export getWalletPortfolioTotalValue from the package entry and import it via @masknet/web3-providers in the hook. Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
This branch was previously deployed
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.
Description
The DeBank API key behind
debank-proxy.r2d2.tois about to be rotated (usage spike / key leak). This removes the last/v1/user/total_balancecall from the extension and moves the ENS panel's total balance to the Firefly backend summary:Firefly/Portfolio.tsprovider:GET https://api.firefly.land/v1/wallet/portfolio/summary?address=(address lowercased to hit the same server cache), unwrapped viaresolveFireflyResponseData.useUserTotalBalancenow calls it (query key renamed so stale caches are not reused).DeBankFungibleToken.getTotalBalanceand the orphanedUserTotalBalancetype.The total now includes Hyperliquid and Polymarket positions, so the displayed value can differ from the old DeBank figure by design. DeBank's other endpoints used by the extension (
all_token_list, history, gas) are untouched and still go through the proxy.Same change as DimensionDev/firefly-social#11024.
Closes # (NO_ISSUE)
Type of change
Previews
No visual change — same panel, same formatting, new data source.
Checklist
console.logsIf this PR depends on external APIs:
api.firefly.landis already insecurity/content-security-policy.jsonconnect-srcand already serves extension requests (used byFirefly/WalletHistory.tsandFirefly/RedPacket.ts).fetchJSONhelper as the DeBank call it replaces; the request path is unchanged.