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

Add ERC721 & ERC1155 wallet_watchAsset support #1173

Merged
merged 20 commits into from
May 26, 2023
Merged

Conversation

adonesky1
Copy link
Contributor

@adonesky1 adonesky1 commented Apr 12, 2023

Controller side changes for V1 of MIP-1 (extend wallet_watchAsset to support ERC721 and ERC1155 tokens).

I am actively tracking the changes to the ERC20 wallet_watchAsset flow (here & here) and will match that pattern when it has been merged. Update: The refactor to match this pattern was done in this commit.

The end feature can be tested by running the this extension branch and this branch of the test dapp locally. The extension PR is using the latest preview builds from this PR. Preview builds are a bit broken now 😬 , but you can test using tarballs. Happy to help if you wish to do this!

Demo:
https://github.com/MetaMask/core/assets/34557516/62824cd8-2725-438f-8dc1-1ec23af4f889

@adonesky1
Copy link
Contributor Author

@metamaskbot publish-preview

@github-actions
Copy link
Contributor

Preview builds have been published. See these instructions for more information about preview builds.

Expand for full list of packages and versions.
{
  "@metamask/address-book-controller": "2.0.0-preview.17e3e5d",
  "@metamask/announcement-controller": "3.0.0-preview.17e3e5d",
  "@metamask/approval-controller": "2.0.0-preview.17e3e5d",
  "@metamask/assets-controllers": "5.1.0-preview.17e3e5d",
  "@metamask/base-controller": "2.0.0-preview.17e3e5d",
  "@metamask/composable-controller": "2.0.0-preview.17e3e5d",
  "@metamask/controller-utils": "3.1.0-preview.17e3e5d",
  "@metamask/ens-controller": "3.0.0-preview.17e3e5d",
  "@metamask/gas-fee-controller": "4.0.1-preview.17e3e5d",
  "@metamask/keyring-controller": "4.0.0-preview.17e3e5d",
  "@metamask/message-manager": "3.0.0-preview.17e3e5d",
  "@metamask/network-controller": "7.0.0-preview.17e3e5d",
  "@metamask/notification-controller": "2.0.0-preview.17e3e5d",
  "@metamask/permission-controller": "3.1.0-preview.17e3e5d",
  "@metamask/phishing-controller": "4.0.0-preview.17e3e5d",
  "@metamask/preferences-controller": "3.0.0-preview.17e3e5d",
  "@metamask/rate-limit-controller": "2.0.0-preview.17e3e5d",
  "@metamask/subject-metadata-controller": "2.0.0-preview.17e3e5d",
  "@metamask/transaction-controller": "4.0.1-preview.17e3e5d"
}

@adonesky1
Copy link
Contributor Author

@metamaskbot publish-preview

@github-actions
Copy link
Contributor

Preview builds have been published. See these instructions for more information about preview builds.

Expand for full list of packages and versions.
{
  "@metamask/address-book-controller": "2.0.0-preview.d912178",
  "@metamask/announcement-controller": "3.0.0-preview.d912178",
  "@metamask/approval-controller": "2.0.0-preview.d912178",
  "@metamask/assets-controllers": "5.1.0-preview.d912178",
  "@metamask/base-controller": "2.0.0-preview.d912178",
  "@metamask/composable-controller": "2.0.0-preview.d912178",
  "@metamask/controller-utils": "3.1.0-preview.d912178",
  "@metamask/ens-controller": "3.0.0-preview.d912178",
  "@metamask/gas-fee-controller": "4.0.1-preview.d912178",
  "@metamask/keyring-controller": "4.0.0-preview.d912178",
  "@metamask/message-manager": "3.0.0-preview.d912178",
  "@metamask/network-controller": "7.0.0-preview.d912178",
  "@metamask/notification-controller": "2.0.0-preview.d912178",
  "@metamask/permission-controller": "3.1.0-preview.d912178",
  "@metamask/phishing-controller": "4.0.0-preview.d912178",
  "@metamask/preferences-controller": "3.0.0-preview.d912178",
  "@metamask/rate-limit-controller": "2.0.0-preview.d912178",
  "@metamask/subject-metadata-controller": "2.0.0-preview.d912178",
  "@metamask/transaction-controller": "4.0.1-preview.d912178"
}

@adonesky1
Copy link
Contributor Author

@metamaskbot publish-preview

@github-actions
Copy link
Contributor

Preview builds have been published. See these instructions for more information about preview builds.

Expand for full list of packages and versions.
{
  "@metamask/address-book-controller": "2.0.0-preview.7e9895d",
  "@metamask/announcement-controller": "3.0.0-preview.7e9895d",
  "@metamask/approval-controller": "2.0.0-preview.7e9895d",
  "@metamask/assets-controllers": "5.1.0-preview.7e9895d",
  "@metamask/base-controller": "2.0.0-preview.7e9895d",
  "@metamask/composable-controller": "2.0.0-preview.7e9895d",
  "@metamask/controller-utils": "3.1.0-preview.7e9895d",
  "@metamask/ens-controller": "3.0.0-preview.7e9895d",
  "@metamask/gas-fee-controller": "4.0.1-preview.7e9895d",
  "@metamask/keyring-controller": "4.0.0-preview.7e9895d",
  "@metamask/message-manager": "3.0.0-preview.7e9895d",
  "@metamask/network-controller": "7.0.0-preview.7e9895d",
  "@metamask/notification-controller": "2.0.0-preview.7e9895d",
  "@metamask/permission-controller": "3.1.0-preview.7e9895d",
  "@metamask/phishing-controller": "4.0.0-preview.7e9895d",
  "@metamask/preferences-controller": "3.0.0-preview.7e9895d",
  "@metamask/rate-limit-controller": "2.0.0-preview.7e9895d",
  "@metamask/subject-metadata-controller": "2.0.0-preview.7e9895d",
  "@metamask/transaction-controller": "4.0.1-preview.7e9895d"
}

@adonesky1
Copy link
Contributor Author

@metamaskbot publish-preview

@github-actions
Copy link
Contributor

Preview builds have been published. See these instructions for more information about preview builds.

Expand for full list of packages and versions.
{
  "@metamask/address-book-controller": "2.0.0-preview.ff1fe78",
  "@metamask/announcement-controller": "3.0.0-preview.ff1fe78",
  "@metamask/approval-controller": "2.0.0-preview.ff1fe78",
  "@metamask/assets-controllers": "5.1.0-preview.ff1fe78",
  "@metamask/base-controller": "2.0.0-preview.ff1fe78",
  "@metamask/composable-controller": "2.0.0-preview.ff1fe78",
  "@metamask/controller-utils": "3.1.0-preview.ff1fe78",
  "@metamask/ens-controller": "3.0.0-preview.ff1fe78",
  "@metamask/gas-fee-controller": "4.0.1-preview.ff1fe78",
  "@metamask/keyring-controller": "4.0.0-preview.ff1fe78",
  "@metamask/message-manager": "3.0.0-preview.ff1fe78",
  "@metamask/network-controller": "7.0.0-preview.ff1fe78",
  "@metamask/notification-controller": "2.0.0-preview.ff1fe78",
  "@metamask/permission-controller": "3.1.0-preview.ff1fe78",
  "@metamask/phishing-controller": "4.0.0-preview.ff1fe78",
  "@metamask/preferences-controller": "3.0.0-preview.ff1fe78",
  "@metamask/rate-limit-controller": "2.0.0-preview.ff1fe78",
  "@metamask/subject-metadata-controller": "2.0.0-preview.ff1fe78",
  "@metamask/transaction-controller": "4.0.1-preview.ff1fe78"
}

@adonesky1
Copy link
Contributor Author

@metamaskbot publish-preview

@github-actions
Copy link
Contributor

Preview builds have been published. See these instructions for more information about preview builds.

Expand for full list of packages and versions.
{
  "@metamask/address-book-controller": "2.0.0-preview.1c4a59b",
  "@metamask/announcement-controller": "3.0.0-preview.1c4a59b",
  "@metamask/approval-controller": "2.1.0-preview.1c4a59b",
  "@metamask/assets-controllers": "6.0.0-preview.1c4a59b",
  "@metamask/base-controller": "2.0.0-preview.1c4a59b",
  "@metamask/composable-controller": "2.0.0-preview.1c4a59b",
  "@metamask/controller-utils": "3.3.0-preview.1c4a59b",
  "@metamask/ens-controller": "3.0.0-preview.1c4a59b",
  "@metamask/gas-fee-controller": "4.0.1-preview.1c4a59b",
  "@metamask/keyring-controller": "4.0.0-preview.1c4a59b",
  "@metamask/message-manager": "3.1.0-preview.1c4a59b",
  "@metamask/network-controller": "7.0.0-preview.1c4a59b",
  "@metamask/notification-controller": "2.0.0-preview.1c4a59b",
  "@metamask/permission-controller": "3.1.0-preview.1c4a59b",
  "@metamask/phishing-controller": "4.0.0-preview.1c4a59b",
  "@metamask/preferences-controller": "3.0.0-preview.1c4a59b",
  "@metamask/rate-limit-controller": "2.0.0-preview.1c4a59b",
  "@metamask/transaction-controller": "4.0.1-preview.1c4a59b"
}

@adonesky1 adonesky1 force-pushed the wallet_watchNFT-spike branch 2 times, most recently from cacb82e to 3cff8ed Compare April 26, 2023 16:18
@adonesky1
Copy link
Contributor Author

@metamaskbot publish-preview

@github-actions
Copy link
Contributor

Preview builds have been published. See these instructions for more information about preview builds.

Expand for full list of packages and versions.
{
  "@metamask/address-book-controller": "2.0.0-preview.3cff8ed",
  "@metamask/announcement-controller": "3.0.0-preview.3cff8ed",
  "@metamask/approval-controller": "2.1.1-preview.3cff8ed",
  "@metamask/assets-controllers": "7.0.0-preview.3cff8ed",
  "@metamask/base-controller": "2.0.0-preview.3cff8ed",
  "@metamask/composable-controller": "2.0.0-preview.3cff8ed",
  "@metamask/controller-utils": "3.4.0-preview.3cff8ed",
  "@metamask/ens-controller": "3.1.0-preview.3cff8ed",
  "@metamask/gas-fee-controller": "5.0.0-preview.3cff8ed",
  "@metamask/keyring-controller": "4.0.0-preview.3cff8ed",
  "@metamask/message-manager": "3.1.1-preview.3cff8ed",
  "@metamask/network-controller": "8.0.0-preview.3cff8ed",
  "@metamask/notification-controller": "2.0.0-preview.3cff8ed",
  "@metamask/permission-controller": "3.2.0-preview.3cff8ed",
  "@metamask/phishing-controller": "4.0.0-preview.3cff8ed",
  "@metamask/preferences-controller": "3.0.0-preview.3cff8ed",
  "@metamask/rate-limit-controller": "2.0.1-preview.3cff8ed",
  "@metamask/transaction-controller": "5.0.0-preview.3cff8ed"
}

@adonesky1
Copy link
Contributor Author

@metamaskbot publish-preview

@github-actions
Copy link
Contributor

Preview builds have been published. See these instructions for more information about preview builds.

Expand for full list of packages and versions.
{
  "@metamask/address-book-controller": "2.0.0-preview.65f3bc7",
  "@metamask/announcement-controller": "3.0.0-preview.65f3bc7",
  "@metamask/approval-controller": "2.1.1-preview.65f3bc7",
  "@metamask/assets-controllers": "7.0.0-preview.65f3bc7",
  "@metamask/base-controller": "2.0.0-preview.65f3bc7",
  "@metamask/composable-controller": "2.0.0-preview.65f3bc7",
  "@metamask/controller-utils": "3.4.0-preview.65f3bc7",
  "@metamask/ens-controller": "3.1.0-preview.65f3bc7",
  "@metamask/gas-fee-controller": "5.0.0-preview.65f3bc7",
  "@metamask/keyring-controller": "4.0.0-preview.65f3bc7",
  "@metamask/message-manager": "5.0.0-preview.65f3bc7",
  "@metamask/network-controller": "8.0.0-preview.65f3bc7",
  "@metamask/notification-controller": "2.0.0-preview.65f3bc7",
  "@metamask/permission-controller": "3.2.0-preview.65f3bc7",
  "@metamask/phishing-controller": "4.0.0-preview.65f3bc7",
  "@metamask/preferences-controller": "3.0.0-preview.65f3bc7",
  "@metamask/rate-limit-controller": "2.0.1-preview.65f3bc7",
  "@metamask/signature-controller": "2.0.0-preview.65f3bc7",
  "@metamask/transaction-controller": "5.0.0-preview.65f3bc7"
}

@adonesky1 adonesky1 force-pushed the wallet_watchNFT-spike branch 2 times, most recently from 0976576 to 74b511e Compare May 15, 2023 21:35
@adonesky1
Copy link
Contributor Author

@metamaskbot publish-preview

@github-actions
Copy link
Contributor

Preview builds have been published. See these instructions for more information about preview builds.

Expand for full list of packages and versions.
{
  "@metamask/address-book-controller": "2.0.0-preview.74b511e",
  "@metamask/announcement-controller": "3.0.0-preview.74b511e",
  "@metamask/approval-controller": "2.1.1-preview.74b511e",
  "@metamask/assets-controllers": "7.0.0-preview.74b511e",
  "@metamask/base-controller": "2.0.0-preview.74b511e",
  "@metamask/composable-controller": "2.0.0-preview.74b511e",
  "@metamask/controller-utils": "3.4.0-preview.74b511e",
  "@metamask/ens-controller": "3.1.0-preview.74b511e",
  "@metamask/gas-fee-controller": "5.0.0-preview.74b511e",
  "@metamask/keyring-controller": "4.0.0-preview.74b511e",
  "@metamask/message-manager": "5.0.0-preview.74b511e",
  "@metamask/network-controller": "8.0.0-preview.74b511e",
  "@metamask/notification-controller": "2.0.0-preview.74b511e",
  "@metamask/permission-controller": "3.2.0-preview.74b511e",
  "@metamask/phishing-controller": "4.0.0-preview.74b511e",
  "@metamask/preferences-controller": "3.0.0-preview.74b511e",
  "@metamask/rate-limit-controller": "2.0.1-preview.74b511e",
  "@metamask/signature-controller": "2.0.0-preview.74b511e",
  "@metamask/transaction-controller": "5.0.0-preview.74b511e"
}

@adonesky1
Copy link
Contributor Author

@metamaskbot publish-preview

@github-actions
Copy link
Contributor

Preview builds have been published. See these instructions for more information about preview builds.

Expand for full list of packages and versions.
{
  "@metamask/address-book-controller": "2.0.0-preview.5809559",
  "@metamask/announcement-controller": "3.0.0-preview.5809559",
  "@metamask/approval-controller": "2.1.1-preview.5809559",
  "@metamask/assets-controllers": "7.0.0-preview.5809559",
  "@metamask/base-controller": "2.0.0-preview.5809559",
  "@metamask/composable-controller": "2.0.0-preview.5809559",
  "@metamask/controller-utils": "3.4.0-preview.5809559",
  "@metamask/ens-controller": "3.1.0-preview.5809559",
  "@metamask/gas-fee-controller": "5.0.0-preview.5809559",
  "@metamask/keyring-controller": "4.0.0-preview.5809559",
  "@metamask/message-manager": "5.0.0-preview.5809559",
  "@metamask/network-controller": "8.0.0-preview.5809559",
  "@metamask/notification-controller": "2.0.0-preview.5809559",
  "@metamask/permission-controller": "3.2.0-preview.5809559",
  "@metamask/phishing-controller": "4.0.0-preview.5809559",
  "@metamask/preferences-controller": "3.0.0-preview.5809559",
  "@metamask/rate-limit-controller": "2.0.1-preview.5809559",
  "@metamask/signature-controller": "2.0.0-preview.5809559",
  "@metamask/transaction-controller": "5.0.0-preview.5809559"
}

@adonesky1
Copy link
Contributor Author

@metamaskbot publish-preview

@github-actions
Copy link
Contributor

Preview builds have been published. See these instructions for more information about preview builds.

Expand for full list of packages and versions.
{
  "@metamask/address-book-controller": "2.0.0-preview.16c7759",
  "@metamask/announcement-controller": "3.0.0-preview.16c7759",
  "@metamask/approval-controller": "2.1.1-preview.16c7759",
  "@metamask/assets-controllers": "7.0.0-preview.16c7759",
  "@metamask/base-controller": "2.0.0-preview.16c7759",
  "@metamask/composable-controller": "2.0.0-preview.16c7759",
  "@metamask/controller-utils": "3.4.0-preview.16c7759",
  "@metamask/ens-controller": "3.1.0-preview.16c7759",
  "@metamask/gas-fee-controller": "5.0.0-preview.16c7759",
  "@metamask/keyring-controller": "4.0.0-preview.16c7759",
  "@metamask/message-manager": "5.0.0-preview.16c7759",
  "@metamask/network-controller": "8.0.0-preview.16c7759",
  "@metamask/notification-controller": "2.0.0-preview.16c7759",
  "@metamask/permission-controller": "3.2.0-preview.16c7759",
  "@metamask/phishing-controller": "4.0.0-preview.16c7759",
  "@metamask/preferences-controller": "3.0.0-preview.16c7759",
  "@metamask/rate-limit-controller": "2.0.1-preview.16c7759",
  "@metamask/signature-controller": "2.0.0-preview.16c7759",
  "@metamask/transaction-controller": "5.0.0-preview.16c7759"
}

@adonesky1 adonesky1 marked this pull request as ready for review May 25, 2023 17:08
@adonesky1
Copy link
Contributor Author

@metamaskbot publish-preview

@github-actions
Copy link
Contributor

Preview builds have been published. See these instructions for more information about preview builds.

Expand for full list of packages and versions.
{
  "@metamask/address-book-controller": "2.0.0-preview.a11a2de",
  "@metamask/announcement-controller": "3.0.0-preview.a11a2de",
  "@metamask/approval-controller": "2.1.1-preview.a11a2de",
  "@metamask/assets-controllers": "7.0.0-preview.a11a2de",
  "@metamask/base-controller": "2.0.0-preview.a11a2de",
  "@metamask/composable-controller": "2.0.0-preview.a11a2de",
  "@metamask/controller-utils": "3.4.0-preview.a11a2de",
  "@metamask/ens-controller": "3.1.0-preview.a11a2de",
  "@metamask/gas-fee-controller": "5.0.0-preview.a11a2de",
  "@metamask/keyring-controller": "4.0.0-preview.a11a2de",
  "@metamask/message-manager": "5.0.0-preview.a11a2de",
  "@metamask/network-controller": "8.0.0-preview.a11a2de",
  "@metamask/notification-controller": "2.0.0-preview.a11a2de",
  "@metamask/permission-controller": "3.2.0-preview.a11a2de",
  "@metamask/phishing-controller": "4.0.0-preview.a11a2de",
  "@metamask/preferences-controller": "3.0.0-preview.a11a2de",
  "@metamask/rate-limit-controller": "2.0.1-preview.a11a2de",
  "@metamask/signature-controller": "2.0.0-preview.a11a2de",
  "@metamask/transaction-controller": "5.0.0-preview.a11a2de"
}

@adonesky1 adonesky1 merged commit 84d6c62 into main May 26, 2023
@adonesky1 adonesky1 deleted the wallet_watchNFT-spike branch May 26, 2023 21:07
brad-decker pushed a commit to dragana8/core that referenced this pull request Jun 1, 2023
MajorLift pushed a commit that referenced this pull request Oct 11, 2023
MajorLift pushed a commit that referenced this pull request Oct 11, 2023
@MajorLift MajorLift mentioned this pull request May 31, 2024
3 tasks
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.

3 participants