Skip to content

fix(client-utils): native assetId via slip44 lookup - #9701

Merged
n3ps merged 1 commit into
mainfrom
n3ps/client-utils-slip44
Jul 29, 2026
Merged

fix(client-utils): native assetId via slip44 lookup#9701
n3ps merged 1 commit into
mainfrom
n3ps/client-utils-slip44

Conversation

@n3ps

@n3ps n3ps commented Jul 29, 2026

Copy link
Copy Markdown
Contributor

Explanation

After #9671 removed the hardcoded nativeAssetsByCaipChainId list, clients are left to resolve native tokens for certain activity types where the API has not provided metadata.

This PR restores native assetIds using the @metamask/slip44 package.

References

Checklist

  • I've updated the test suite for new or updated code as appropriate
  • I've updated documentation (JSDoc, Markdown, etc.) for new or updated code as appropriate
  • I've communicated my changes to consumers by updating changelogs for packages I've changed
  • I've introduced breaking changes in this PR and have prepared draft pull requests for clients and consumer packages to resolve them

Made with Cursor

@n3ps
n3ps marked this pull request as ready for review July 29, 2026 21:13
@n3ps
n3ps requested review from a team as code owners July 29, 2026 21:13
@n3ps
n3ps temporarily deployed to default-branch July 29, 2026 21:13 — with GitHub Actions Inactive
n3ps added a commit that referenced this pull request Jul 29, 2026
Use ^4.3.0 to match network-enablement-controller monorepo constraint.
Document the new dependency and link Unreleased entries to #9701.

Co-authored-by: Cursor <cursoragent@cursor.com>
direction: 'out',
symbol: 'MATIC',
assetType: 'native',
assetId: 'eip155:137/slip44:966',

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

assetId for native tokens

direction: 'in',
symbol: 'ETH',
assetType: 'native',
assetId: 'eip155:59144/slip44:60',

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

assetId for native tokens

@n3ps
n3ps enabled auto-merge July 29, 2026 21:21
After #9671 removed the hardcoded nativeAssetsByCaipChainId registry, native
activity rows lost slip44 assetId when a symbol was already present in the
payload. Restore symbol-driven lookup via @metamask/slip44 without reintroducing
chain-to-symbol tables or inventing metadata.

- Resolve native token and fee assetId from transfer/group symbol when available
- Build a module-level slip44 symbol map for O(1) lookups (POL aliases MATIC)
- formatAddressToAssetId still returns undefined for native sentinel addresses
@n3ps
n3ps force-pushed the n3ps/client-utils-slip44 branch from 5d967c8 to f6ded61 Compare July 29, 2026 21:24
@n3ps n3ps changed the title fix(client-utils): restore native assetId via slip44 symbol lookup fix(client-utils): restore native assetId via slip44 lookup Jul 29, 2026
@n3ps n3ps changed the title fix(client-utils): restore native assetId via slip44 lookup fix(client-utils): native assetId via slip44 lookup Jul 29, 2026
@n3ps
n3ps added this pull request to the merge queue Jul 29, 2026
Merged via the queue into main with commit 464b6a9 Jul 29, 2026
46 checks passed
@n3ps
n3ps deleted the n3ps/client-utils-slip44 branch July 29, 2026 21:49
This was referenced Jul 29, 2026
pull Bot pushed a commit to Reality2byte/core that referenced this pull request Jul 30, 2026
## Explanation

Releases `@metamask/client-utils@1.5.0`.

Restores native `assetId` on activity tokens and network fees when
available.

## References

- Follow-up release for
[MetaMask#9701](MetaMask#9701)
- Replaces closed [MetaMask#9703](MetaMask#9703)
(auto-closed after 3hr inactivity window)

## Checklist

- [ ] I've updated the test suite for new or updated code as appropriate
- [x] I've updated documentation (JSDoc, Markdown, etc.) for new or
updated code as appropriate
- [x] I've communicated my changes to consumers by [updating changelogs
for packages I've
changed](https://github.com/MetaMask/core/tree/main/docs/processes/updating-changelogs.md)
- [ ] I've introduced [breaking
changes](https://github.com/MetaMask/core/processes/breaking-changes.md)
in this PR and have prepared draft pull requests for clients and
consumer packages to resolve them

Made with [Cursor](https://cursor.com)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants