-
Notifications
You must be signed in to change notification settings - Fork 5.2k
feat: Add CreateSnapAccount component #30611
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: Add CreateSnapAccount component #30611
Conversation
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. |
49decfb
to
260e856
Compare
260e856
to
a426a97
Compare
ui/components/multichain/account-list-menu/account-list-menu.tsx
Outdated
Show resolved
Hide resolved
3547c2d
to
d1a54d6
Compare
26304f7
to
023d0a2
Compare
023d0a2
to
f829b9b
Compare
Builds ready [f829b9b]
Page Load Metrics (3930 ± 1925 ms)
Bundle size diffs
|
ui/components/multichain/account-list-menu/account-list-menu.tsx
Outdated
Show resolved
Hide resolved
ui/components/multichain/account-list-menu/account-list-menu.tsx
Outdated
Show resolved
Hide resolved
ui/components/multichain/create-snap-account/create-snap-account.tsx
Outdated
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.
Everything works, albeit a bit slow-ish on my machine. Found a usability issue:
If you set a custom name, then change the SRP the account should be associated with, the name field gets cleared out. That would be frustrating for users, so we should store that name in component state and restore it once the user comes back from choosing SRP.
Screen.Recording.2025-03-18.at.9.15.56.AM.mov
4e28ca1
to
1edcdd4
Compare
Builds ready [1edcdd4]
Page Load Metrics (4502 ± 2036 ms)
Bundle size diffs
|
Thanks for pointing this out @darkwing ! I really appreciate you taking the time to investigate this. This issue actually applies to the EVM account flow as well, so it might be better to address it in a separate PR. Additionally, this is something that’s about to change soon anyway. The reason there’s no easy fix right now is that the name is stored in the Happy to discuss further if you have thoughts on this! |
switch (mode) { | ||
case ACTION_MODES.ADD_BITCOIN: | ||
return { | ||
clientType: WalletClientType.Bitcoin, | ||
chainId: MultichainNetworks.BITCOIN, | ||
}; | ||
case ACTION_MODES.ADD_BITCOIN_TESTNET: | ||
return { | ||
clientType: WalletClientType.Bitcoin, | ||
chainId: MultichainNetworks.BITCOIN_TESTNET, | ||
}; | ||
case ACTION_MODES.ADD_SOLANA: | ||
return { | ||
clientType: WalletClientType.Solana, | ||
chainId: MultichainNetworks.SOLANA, | ||
}; | ||
default: | ||
return { | ||
clientType: null, | ||
chainId: null, | ||
}; | ||
} | ||
}; |
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 would move this somewhere else as a config that you import, not to interfere with UI stuff
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.
Sounds good, I've changed it to map object and moved it the top of the file, so it will be easier to read
ui/components/multichain/create-snap-account/create-snap-account.test.tsx
Show resolved
Hide resolved
f96b132
to
e4c1709
Compare
Builds ready [e4c1709]
Page Load Metrics (2144 ± 228 ms)
Bundle size diffs
|
Description
This PR introduces a new form for built-in Snap account creation (currently limited to Solana), allowing users to select the SRP. It also standardizes the account creation UX across EVM and Solana networks.
Related issues
Jira ticket: https://consensyssoftware.atlassian.net/browse/MMMULTISRP-19
Design: Figma
SIP-30 doc: https://github.com/MetaMask/SIPs/blob/207518f3ea50fe536ac0e58264481d7679c46824/SIPS/sip-30.md#creating-accounts
Manual testing steps
With one SRP:
New form should be visible with an option to set Solana account name.
With more than one SRP:
New form should be visible with an option to select SRP and name.
Screenshots/Recordings
Before
After
Pre-merge author checklist
Pre-merge reviewer checklist