JSON RPC Signer fails on erc20_contract.transfer #1667
-
I'm using a JSON RPC Signer to do contract calls to my erc20 token contract. It works fine locally but when I tested it on rinkeby it fails with an: index.js:202 Uncaught (in promise) Error: processing response error (body="{"jsonrpc":"2.0","id":47,"error":{"code":-32601,"message":"The method eth_sendTransaction does not exist/is not available"}}", error={"code":-32601}, requestBody="{"method":"eth_sendTransaction","params":[{"gas":"0x8a0d","from":"0xd5429b90c893be82cdb25678067286d65fad1412","to":"0x2f3141791367181b206fa53c6e4b5b419c7176a5","data":"0xa9059cbb00000000000000000000000048635bed4ec31edd06b0ed6074f47a546d3e543a0000000000000000000000000000000000000000000000000000000000000015"}],"id":47,"jsonrpc":"2.0"}", requestMethod="POST", url="https://rinkeby.infura.io/v3/{just my project id}", code=SERVER_ERROR, version=web/5.3.0) Here's the code that I used. `
` |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 3 replies
-
You can only do the following if you are using a node that contains your private key. Supported backends could be using geth/parity containing accounts as well as exposed over RPC API, metamask or ganache / hardhat network.
But from your error it appears that you're using infura. And infura doesn't support having remote accounts (private key on the node). So So do you have private key to |
Beta Was this translation helpful? Give feedback.
You can only do the following if you are using a node that contains your private key. Supported backends could be using geth/parity containing accounts as well as exposed over RPC API, metamask or ganache / hardhat network.
But from your error it appears that you're using infura. And infura doesn't support having remote accounts (private key on the node). So
jsonRpcProvider.getSigner(signerAddress)
won't immediately error but when you go ahead and use it (when you are doingcontract.writeMethod
), it would fail.So do you have private key to
signe…