-
Notifications
You must be signed in to change notification settings - Fork 97
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(tokens): Use new token metadata source/schema and fetch from blo…
…ckchain-api (#4210) ### Description For ACT-909. Updates the wallet to fetch the new format of token metadata from the new REST endpoint on blockchain-api and user balances for all available chains (if multi-chain balances are enabled via statsig). As soon as the new blockchain-api REST endpoint is updated to return non-Celo token metadata, multi-chain balances should work out-of-the-box in-app. In short, there are two functional changes in this PR: * Token balances are fetched for all supported chains, provided an override has been set in Statsig for the `fetch_multi_chain_balances` feature gate. * We no longer fetch token metadata directly from Firebase, but instead the new blockchain-api endpoint. * Internal (Redux) state has been updated to reflect the schema changes in the token metadata. The second bullet above required some rejiggering of types throughout the repo, and a lot of mechanical changes to tests throughout the app. Existing places in code that depend on a token's address being available have been updated to use the "new" (but identical to the "old") `WithAddress` suffixed types. New code which supports multi-chain features should begin using the types that make address optional. Currently, there are no places in code that take advantage of this new format; we'll need to add a selector that returns the "new format" data from Redux, typed correctly. Note that this change requires a migration; I have specifically opted _not_ to muck about with trying to migrate stored token information in Redux (re: the trouble caused by attempting to do so with transfers), and instead opted to wipe the stored token info. This means that users will need to refresh their balances upon updating. ### Test plan Unit and manual tested. ### Related issues - Fixes ACT-909. ### Backwards compatibility Yes. --------- Co-authored-by: Charlie Andrews-Jubelt <[email protected]>
- Loading branch information
Showing
43 changed files
with
646 additions
and
199 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
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
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
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
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
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
Oops, something went wrong.