Search code examples
json-rpcethereum

invalid method parameters for eth_sendTransaction


I am trying to make a transaction ( c++ client via json-rpc ) - just set "from" and "to" as the rest is marked optional. Also tried to add value but I still get:

ErrorMessage{code=-32602, message=INVALID_PARAMS: Invalid method parameters (invalid name and/or type) recognised}

both are addresses owned by me ( returned via eth_accounts ) - any hint on how to overcome this are welcome This is the request I try:

{"jsonrpc":"2.0","method":"eth_sendTransaction","params":{"from":"0x3edba223fdd11309a7f277882e0bfaa287f2676b","to":"0x42ec4438503f690dcc2939047e1e8cf6b9218f95","value":1},"id":1}

Solution

  • params needs to be an array, try

    {"jsonrpc":"2.0","method":"eth_sendTransaction","params":[{"from":"0x3edba223fdd11309a7f277882e0bfaa287f2676b","to":"0x42ec4438503f690dcc2939047e1e8cf6b9218f95","value":1}],"id":1}