MetaMask / metamask-snaps-beta

Fork of MetaMask that supports plugins! Read the Wiki!
https://github.com/MetaMask/metamask-snaps-beta/wiki
MIT License
144 stars 57 forks source link

Successful transaction reported as failed by custom account #152

Closed xuhcc closed 2 years ago

xuhcc commented 4 years ago

Describe the bug

Here's the code:

wallet.registerAccountMessageHandler(async (originString, requestObject) => {
    switch (requestObject.method) {
        case 'eth_signTransaction':
            return true
        default:
            throw Error('Method not supported.')
    }
})

After returning from this account message handler, metamask throws an error:

background.js:1 Error in RPC response:
 Objectid: 3259821713
jsonrpc: "2.0"
error: code: -32603
message: "Error: [ethjs-rpc] rpc error with payload {"id":8015515134679,"jsonrpc":"2.0","params":["0x..."],"method":"eth_sendRawTransaction"} [object Object]"

Browser details (please complete the following information):

rekmarks commented 2 years ago

We will ship custom accounts using a completely different API at some point in the future. This repo will soon be archived, and I will close this issue for now.

Ref: https://docs.metamask.io/guide/snaps.html