Skip to content
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

SIP-29: Snap Assets API #154

Merged
merged 21 commits into from
Jan 22, 2025
Merged

SIP-29: Snap Assets API #154

merged 21 commits into from
Jan 22, 2025

Conversation

danroc
Copy link
Contributor

@danroc danroc commented Dec 5, 2024

This SIP aims to define a new API that can be exposed by Snaps to allow clients to retrieve asset information in a chain-agnostic way.

SIPS/sip-29.md Outdated Show resolved Hide resolved
SIPS/sip-29.md Outdated Show resolved Hide resolved
@GuillaumeRx GuillaumeRx mentioned this pull request Dec 5, 2024
GuillaumeRx and others added 2 commits December 6, 2024 17:24
* add handlers and permission definition

* update to use `snaps-sdk`

* snap -> Snap

* Add CAIP-19 ID reference in description and rename token to asset

* Add chains caveat

* fix typo

* allow batching

* add fungible reference to asset description

* add appendix for fungible assets

* fix typos

* update rates handler to support batching

* unify

* rename `AssetUnit` to `FungibleAssetUnit`
SIPS/sip-29.md Outdated Show resolved Hide resolved
SIPS/sip-29.md Outdated Show resolved Hide resolved
SIPS/sip-29.md Show resolved Hide resolved
It should be closer to the terminology used by the Token API.
SIPS/sip-29.md Outdated Show resolved Hide resolved
SIPS/sip-29.md Outdated Show resolved Hide resolved
SIPS/sip-29.md Outdated Show resolved Hide resolved
SIPS/sip-29.md Outdated Show resolved Hide resolved
SIPS/sip-29.md Outdated Show resolved Hide resolved
SIPS/sip-29.md Show resolved Hide resolved
SIPS/sip-29.md Outdated Show resolved Hide resolved
SIPS/sip-29.md Outdated Show resolved Hide resolved
SIPS/sip-29.md Outdated Show resolved Hide resolved
SIPS/sip-29.md Outdated Show resolved Hide resolved
SIPS/sip-29.md Outdated Show resolved Hide resolved
danroc and others added 5 commits January 13, 2025 10:22
Co-authored-by: Charly Chevalier <[email protected]>
Co-authored-by: Charly Chevalier <[email protected]>
Co-authored-by: Charly Chevalier <[email protected]>
Co-authored-by: Charly Chevalier <[email protected]>
Co-authored-by: Charly Chevalier <[email protected]>
SIPS/sip-29.md Outdated Show resolved Hide resolved
SIPS/sip-29.md Outdated Show resolved Hide resolved
SIPS/sip-29.md Outdated Show resolved Hide resolved
SIPS/sip-29.md Outdated Show resolved Hide resolved
SIPS/sip-29.md Show resolved Hide resolved
SIPS/sip-29.md Show resolved Hide resolved
SIPS/sip-29.md Outdated Show resolved Hide resolved
SIPS/sip-29.md Outdated Show resolved Hide resolved
SIPS/sip-29.md Outdated Show resolved Hide resolved
SIPS/sip-29.md Outdated Show resolved Hide resolved
danroc and others added 4 commits January 20, 2025 13:30
Co-authored-by: Maarten Zuidhoorn <[email protected]>
- Update the handler names to be pluralised
- Describe `Caip19AssetType`
- Add some text about how the rates are represented
SIPS/sip-29.md Outdated Show resolved Hide resolved
@danroc danroc marked this pull request as ready for review January 21, 2025 16:20
@danroc danroc requested review from Montoya and a team as code owners January 21, 2025 16:20
- Allow data URI and URL for token icons
- Make conversion rate expiration time optional
- Add note about asset filtering if out of scope
- Remove native key from asset description
- Typo fixes
SIPS/sip-29.md Outdated Show resolved Hide resolved
SIPS/sip-29.md Outdated Show resolved Hide resolved
SIPS/sip-29.md Outdated Show resolved Hide resolved
@FrederikBolding FrederikBolding merged commit 6397726 into main Jan 22, 2025
3 checks passed
@FrederikBolding FrederikBolding deleted the dr/assets branch January 22, 2025 10:29
github-merge-queue bot pushed a commit to MetaMask/accounts that referenced this pull request Jan 23, 2025
…vents + re-publish (#154)

Now that the `SnapKeyring` uses a `Messenger` to interact with some
controllers (`SnapController` only for now). We can re-use this
messenger to forward new events coming out from the Snap.

Those events will be mainly consumed by the new
`Multichain*Controller`(s). This allows to use a "pub/sub pattern"
rather than relying on polling information out from the Snap.

All those information can still be fetched explicitly from the Snap:
- `accountBalancesUpdated` -> `Keyring.getAccountBalances`
- `accountTransactionsUpdated` -> `Keyring.listAccountTransactions`
- `accountAssetListUpdated` -> `OnAssetLookup` (through
[SIP-29](MetaMask/SIPs#154), once available)
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.

8 participants