Skip to content

feat: add asset selector #14958

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

Merged
merged 86 commits into from
May 7, 2025
Merged

feat: add asset selector #14958

merged 86 commits into from
May 7, 2025

Conversation

hmalik88
Copy link
Contributor

@hmalik88 hmalik88 commented Apr 29, 2025

Description

Write a short description of the changes included in this pull request, also include relevant motivation and context. Have in mind the following questions:

  1. What is the reason for the change? Porting over AssetSelector from extension.

Related issues

Fixes: MetaMask/snaps#3285

Manual testing steps

  1. Pull down the branch and build
  2. Edit the send-flow snap (and test-snaps) with the following snippet:
            <Box direction="vertical">
              <Field label="Asset">
                <AssetSelector
                  name="asset1"
                  addresses={[
                    'solana:5eykt4UsFv8P8NJdTREpY1vzqKqZKvdp:4puok8BCAGTbEEX4qgtxYkjk4yNi7xmnf4R8kq68xyPn',
                  ]}
                />
              </Field>
              <Box direction="horizontal">
                <Field label="Asset">
                  <AssetSelector
                    name="asset"
                    addresses={[
                      'solana:5eykt4UsFv8P8NJdTREpY1vzqKqZKvdp:4puok8BCAGTbEEX4qgtxYkjk4yNi7xmnf4R8kq68xyPn',
                    ]}
                  />
                </Field>
                <Field label="Send amount">
                  <Input
                    name="amount"
                    type="number"
                    placeholder="Enter amount to send"
                  />
                </Field>
              </Box>
            </Box>
  1. Run test-snaps locally
  2. Navigate to the locally ran test-snaps in the simulator
  3. Observe the results.

Screenshots/Recordings

After

Recording:

Screen.Recording.2025-05-05.at.5.45.11.PM.mov

Disabled State

Screenshot 2025-05-05 at 9 12 44 PM

Error State

Screenshot 2025-05-05 at 9 11 48 PM

Pre-merge author checklist

Pre-merge reviewer checklist

  • I've manually tested the PR (e.g. pull and build branch, run the app, test code being changed).
  • I confirm that this PR addresses all acceptance criteria described in the ticket it closes and includes the necessary testing evidence such as recordings and or screenshots.

hmalik88 added 27 commits April 25, 2025 10:04
Copy link
Contributor

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.

@metamaskbot metamaskbot added the team-snaps-platform Snaps Platform team label Apr 29, 2025
FrederikBolding
FrederikBolding previously approved these changes May 7, 2025
Copy link
Member

@FrederikBolding FrederikBolding left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM - please wait for @GuillaumeRx to sign off too

@FrederikBolding FrederikBolding removed the request for review from a team May 7, 2025 14:55
Copy link
Member

@FrederikBolding FrederikBolding left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

See latest comment

Copy link

@GuillaumeRx GuillaumeRx left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code LGTM

@hmalik88 hmalik88 added this pull request to the merge queue May 7, 2025
Merged via the queue into main with commit 0662d38 May 7, 2025
40 checks passed
@hmalik88 hmalik88 deleted the hm/add-asset-selector branch May 7, 2025 17:06
@github-actions github-actions bot locked and limited conversation to collaborators May 7, 2025
@metamaskbot metamaskbot added the release-7.47.0 Issue or pull request that will be included in release 7.47.0 label May 7, 2025
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
No E2E Smoke Needed If the PR does not need E2E smoke test run No QA Needed Apply this label when your PR does not need any QA effort. no-changelog Indicates no external facing user changes, therefore no changelog documentation needed release-7.47.0 Issue or pull request that will be included in release 7.47.0 team-snaps-platform Snaps Platform team
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Port AssetSelector component on mobile
4 participants