Skip to content

feat: add asset selector#14958

Merged
hmalik88 merged 86 commits into
mainfrom
hm/add-asset-selector
May 7, 2025
Merged

feat: add asset selector#14958
hmalik88 merged 86 commits into
mainfrom
hm/add-asset-selector

Conversation

@hmalik88

@hmalik88 hmalik88 commented Apr 29, 2025

Copy link
Copy Markdown
Contributor

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
@github-actions

Copy link
Copy Markdown
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-deprecated DEPRECATED: please use "team-core-platform" instead (or "team-new-networks" for Solana snap issues) label Apr 29, 2025
Comment thread app/core/Multichain/constants.ts Outdated
Comment thread app/components/Snaps/SnapUIAssetSelector/SnapUIAssetSelector.tsx Outdated
Comment thread locales/languages/en.json Outdated
Comment thread app/components/Snaps/SnapUIAssetSelector/SnapUIAssetSelector.tsx Outdated
Comment thread app/components/Snaps/SnapUIAssetSelector/SnapUIAssetSelector.tsx Outdated
Comment thread app/components/Snaps/SnapUIAssetSelector/SnapUIAssetSelector.tsx
FrederikBolding
FrederikBolding previously approved these changes May 7, 2025

@FrederikBolding FrederikBolding left a comment

Copy link
Copy Markdown
Member

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
Comment thread app/components/Snaps/SnapUISelector/SnapUISelector.tsx Outdated

@FrederikBolding FrederikBolding left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

See latest comment

@sonarqubecloud

sonarqubecloud Bot commented May 7, 2025

Copy link
Copy Markdown

@GuillaumeRx GuillaumeRx left a comment

Copy link
Copy Markdown
Contributor

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 QA Needed Apply this label when your PR does not need any QA effort. no-changelog 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-deprecated DEPRECATED: please use "team-core-platform" instead (or "team-new-networks" for Solana snap issues)

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Port AssetSelector component on mobile

4 participants