-
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
feat: AssetList
SPL token support
#30345
Conversation
- Add `MultichainAssetsController` to the controller init list - Fix issues with `MultichainBalanceController` - Fix issues with `MultichainTransactionsController` - Revert type changes
CLA Signature Action: All authors have signed the CLA. You may need to manually re-run the blocking PR check if it doesn't pass in a few minutes. |
// fallback value (is this valid?) | ||
return ( | ||
<Text | ||
variant={TextVariant.bodySmMedium} | ||
color={TextColor.textAlternative} | ||
data-testid="multichain-token-list-item-token-name" | ||
ellipsis | ||
> | ||
{networkTitleOverrides(t as TranslateFunction, token)} | ||
</Text> | ||
); |
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.
I don't think that we should show the network name in the case that percent change doesn't exist. Seems like an irrelevant fallback, and I'm not sure why it existed in the first place.
@@ -36,18 +38,18 @@ function TokenList({ onTokenClick }: TokenListProps) { | |||
chainIds: chainIdsToPoll as Hex[], | |||
}); | |||
|
|||
const nonEvmNativeToken = useNativeTokenBalance(); | |||
const multichainAssets = useMultiChainAssets(); |
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.
I think this hook can be a selector. Will update.
const filteredAssets: TokenWithFiatAmount[] = filterAssets(balances, [ | ||
{ | ||
key: 'chainId', | ||
opts: isEvm ? networkFilter : { [nonEvmNativeToken.chainId]: true }, | ||
opts: isEvm ? networkFilter : { [MultichainNetworks.SOLANA]: true }, |
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.
Have the controller updates been integrated on extension? Once they are, we can rely on the result of currentNetwork.chainId
rather than this hard coded string.
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.
updated here 21abbb2
export const SOLANA_WALLET_SNAP_ID: SnapId = | ||
'local:http://localhost:8080' as SnapId; |
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.
TODO: Remove and make this into an .env var
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.
How is the Asset list sorted? I think it needs to be sorted by the highest currency value? wdyt?
Rebased to here: #30389 Default sort should be by declining fiat value. Alternatively, user's should be able to sort by descending alphabetical order as well. Will keep an eye on this to make sure it gets in the final feature |
closing in favor of: #30389 |
🚧
Description
Integrate SPL tokens into token list. Testing this branch will be easier if you already have a pre-funded Solana account.
Related issues
Solana Effort
Manual testing steps
git clone [email protected]:MetaMask/snap-solana-wallet.git
In separate terminal, for extension:
yarn && yarn start:flask
oryarn && yarn webpack --watch --type flask
Settings -> Experimental -> toggle Enable "Add a new Solana account (Beta)"
Add the Solana Account (you may need to refresh extension)
You should see Solana tokens populating the token list!
Sort controls should be functional
Screenshots/Recordings
Screen.Recording.2025-02-14.at.3.33.58.PM.mov
Pre-merge author checklist
Pre-merge reviewer checklist