-
Notifications
You must be signed in to change notification settings - Fork 5.1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
refactor: support non-evm tokens in asset-picker #30313
Conversation
05048d3
to
f128290
Compare
f128290
to
e83df81
Compare
ui/components/multichain/asset-picker-amount/asset-picker-modal/asset-picker-modal.tsx
Outdated
Show resolved
Hide resolved
Builds ready [e1c1d5c]
Page Load Metrics (1719 ± 68 ms)
Bundle size diffs [🚨 Warning! Bundle size has increased!]
|
Builds ready [da1c4e5]
Page Load Metrics (1824 ± 71 ms)
Bundle size diffs [🚨 Warning! Bundle size has increased!]
|
ui/components/multichain/asset-picker-amount/asset-picker-modal/asset-picker-modal-network.tsx
Show resolved
Hide resolved
ui/components/multichain/asset-picker-amount/asset-picker-modal/asset-picker-modal.tsx
Show resolved
Hide resolved
ui/components/multichain/asset-picker-amount/asset-picker-modal/asset-picker-modal.tsx
Show resolved
Hide resolved
Builds ready [da3158b]
Page Load Metrics (1487 ± 50 ms)
Bundle size diffs [🚨 Warning! Bundle size has increased!]
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pulled down and tested these:
- [flask] When navigating to swaps, I see SPL tokens to choose from to create my swap pair
- [flask] When navigating to bridge, I see SPL tokens to choose from to create my bridge pair
- Swap/Bridge flows work as expected on evm
balance: balancesByAssetId[caipAssetId]?.amount ?? '0', | ||
decimals: assetMetadataById[caipAssetId]?.units[0]?.decimals, | ||
image: assetMetadataById[caipAssetId]?.iconUrl ?? '', | ||
type: type === 'token' ? AssetType.token : AssetType.native, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Do we have a constant for token
?
ui/components/multichain/asset-picker-amount/asset-picker/asset-picker.tsx
Show resolved
Hide resolved
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Approving with a bunch of nits I hope we can potentially address.
Description
The main goal of this PR is to enable displaying non-evm tokens and their balances in the AssetPicker. The general approach is to find instances in which components and hooks read evm-specific data and replace them with multichain equivalents
In addition to that, this enables networks that use CAIP chainIds to be selectable in the asset-picker
Changes
Related issues
Fixes:
Manual testing steps
BRIDGE_USE_DEV_APIS=1
in .metamaskrcScreenshots/Recordings
Before
After
Screen.Recording.2025-02-25.at.11.42.25.AM.mov
Pre-merge author checklist
Pre-merge reviewer checklist