Open huweihong opened 2 months ago
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' }, }, }, });
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.
wallet_requestSnaps
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 :