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

DRAFT: SIP-26 Integration #29887

Draft
wants to merge 35 commits into
base: jl/caip-multichain-migrate-core
Choose a base branch
from
Draft

DRAFT: SIP-26 Integration #29887

wants to merge 35 commits into from

Conversation

jiexi
Copy link
Contributor

@jiexi jiexi commented Jan 23, 2025

Open in GitHub Codespaces

Steps to get manual testing environment setup:

  • start a flask build of this branch yarn start:flask
  • go to settings -> experimental
  • toggle on Enable "Add a new Bitcoin account (Beta)"
  • go to the accounts drop down at the top of the wallet, and click add an account
  • you should see an option to add a bitcoin account now. Add a bitcoin account
  • Go to https://metamask.github.io/test-dapp-multichain/latest/ (or any website)
  • Execute the following code in the dev console
const extensionPort = chrome.runtime.connect(YOUR_EXTENSION_ID)
extensionPort.onMessage.addListener((msg) => {
    console.log(msg.data)
})


extensionPort.postMessage({
    type: 'caip-x',
    data: {
        "jsonrpc": "2.0",
        method: 'wallet_createSession',
        params: {
            requiredScopes: {},
            optionalScopes: {
                'bip122:000000000019d6689c085ae165831e93': {
                    methods: ['sendBitcoin'],
                    notifications: [],
                    accounts: []
                }
            },
        },
    }
})

extensionPort.postMessage({
    type: 'caip-x',
    data: {
        "jsonrpc": "2.0",
        method: 'wallet_invokeMethod',
  "params": {
    "scope": "bip122:000000000019d6689c085ae165831e93",
    "request": {
      "method": "sendBitcoin",
      "params": {
        recipients: {
          address: '0.1',
        },
        replaceable: true,
      }
    }
}}})

Related issues

Ticket: https://github.com/orgs/MetaMask/projects/146/views/6?pane=issue&itemId=94617458&issue=MetaMask%7CMetaMask-planning%7C3989
Upstream Extension: #27782
Core: MetaMask/core#5191

Manual testing steps

  1. Go to this page...

Screenshots/Recordings

Before

After

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.

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 INVALID-PR-TEMPLATE PR's body doesn't match template label Jan 24, 2025
Copy link

socket-security bot commented Feb 3, 2025

New, updated, and removed dependencies detected. Learn more about Socket for GitHub ↗︎

Package New capabilities Transitives Size Publisher
npm/@metamask-previews/[email protected] None 0 562 kB mcmire, metamaskbot
npm/@metamask/[email protected] 🔁 npm/@metamask/[email protected] None 0 949 kB metamaskbot

🚮 Removed packages: npm/@metamask/[email protected]

View full report↗︎

@jiexi
Copy link
Contributor Author

jiexi commented Feb 5, 2025

@metamaskbot update-policies

@metamaskbot
Copy link
Collaborator

Policies updated.
👀 Please review the diff for suspicious new powers.

🧠 Learn how: https://lavamoat.github.io/guides/policy-diff/#what-to-look-for-when-reviewing-a-policy-diff

Copy link

socket-security bot commented Feb 11, 2025

🚨 Potential security issues detected. Learn more about Socket for GitHub ↗︎

To accept the risk, merge this PR and you will not be notified again.

Alert Package NoteSourceCI
Network access npm/@metamask/[email protected] 🚫
Network access npm/@metamask/[email protected] 🚫
Network access npm/@metamask/[email protected] 🚫

View full report↗︎

Next steps

What is network access?

This module accesses the network.

Packages should remove all network access that is functionally unnecessary. Consumers should audit network access to ensure legitimate use.

Take a deeper look at the dependency

Take a moment to review the security alert above. Review the linked package source code to understand the potential risk. Ensure the package is not malicious before proceeding. If you're unsure how to proceed, reach out to your security team or ask the Socket team for help at support [AT] socket [DOT] dev.

Remove the package

If you happen to install a dependency that Socket reports as Known Malware you should immediately remove it and select a different dependency. For other alert types, you may may wish to investigate alternative packages or consider if there are other ways to mitigate the specific risk posed by the dependency.

Mark a package as acceptable risk

To ignore an alert, reply with a comment starting with @SocketSecurity ignore followed by a space separated list of ecosystem/package-name@version specifiers. e.g. @SocketSecurity ignore npm/[email protected] or ignore all packages with @SocketSecurity ignore-all

@jiexi
Copy link
Contributor Author

jiexi commented Feb 11, 2025

@metamaskbot update-policies

@metamaskbot
Copy link
Collaborator

Policies updated.
👀 Please review the diff for suspicious new powers.

🧠 Learn how: https://lavamoat.github.io/guides/policy-diff/#what-to-look-for-when-reviewing-a-policy-diff

@metamaskbot
Copy link
Collaborator

❌ API Spec Test Failed. View the report here.

@metamaskbot
Copy link
Collaborator

❌ Multichain API Spec Test Failed. View the report here.

@metamaskbot
Copy link
Collaborator

❌ API Spec Test Failed. View the report here.

@metamaskbot
Copy link
Collaborator

❌ Multichain API Spec Test Failed. View the report here.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
INVALID-PR-TEMPLATE PR's body doesn't match template team-wallet-api-platform
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants