snaps icon indicating copy to clipboard operation
snaps copied to clipboard

Error for invoke-snap example

Open huweihong opened this issue 1 year ago • 1 comments

I installed two snaps in https://github.com/MetaMask/snaps/tree/main/packages/examples/packages/invoke-snap and using the following code to revoke @metamask/consumer-signer-example-snap, but there is the same error as https://github.com/MetaMask/snaps/issues/2340 :

 await window.ethereum.request({
    method: 'wallet_requestSnaps',
    params: {
      'npm:@metamask/consumer-signer-example-snap': {},
    },
  });

  const response = await window.ethereum.request({
    method: 'wallet_invokeSnap',
    params: {
      snapId: 'npm:@metamask/consumer-signer-example-snap',
      request: {
        method: 'signMessage',
        params: { message: 'test' },
      },
    },
  });
image

huweihong avatar Apr 26 '24 11:04 huweihong

Both Snaps need to be installed into your MetaMask Flask and then one Snap needs to call wallet_requestSnaps to the other Snap to get permission to communicate with it.

Montoya avatar Apr 26 '24 17:04 Montoya