Coinbase Wallet SDK
eth_sendTransaction
Create and send a new transaction or message call
Defined in the Ethereum JSON-RPC Specification
Creates new message call transaction or a contract creation, if the data field contains code. This method submits the transaction to the network and returns the transaction hash once it’s been accepted by the network.
Parameters
The transaction object to send.
Returns
The transaction hash (32 bytes) as a hexadecimal string.
Error Handling
Code | Message | Description |
---|---|---|
4001 | User rejected the request | User denied the transaction request |
4100 | Requested method not supported | The method is not supported by the wallet |
4200 | Wallet not connected | No wallet connection available |
-32602 | Invalid params | Invalid transaction parameters |
-32000 | Insufficient funds | Account doesn’t have enough balance |
Make sure to validate transaction parameters before sending, especially the to
address and value
to prevent loss of funds.