eth_sendTransaction
Defined in EIP-1474
Creates, signs, and sends a new transaction to the network.
Parameters
Array<TransactionConfig>
An array containing a single transaction object with the following fields:
Field | Type | Description |
---|---|---|
from | string | The address the transaction is sent from |
to | string | (Optional) The address the transaction is directed to |
gas | string | (Optional) Integer of the gas provided for the transaction |
gasPrice | string | (Optional) Integer of the gas price in wei |
value | string | (Optional) Integer of the value sent with this transaction |
data | string | (Optional) Hash of the method signature and encoded parameters |
nonce | string | (Optional) Integer of a nonce used to prevent transaction replay |
maxFeePerGas | string | (Optional) The maximum fee per gas for EIP-1559 transactions |
maxPriorityFeePerGas | string | (Optional) The maximum priority fee per gas for EIP-1559 transactions |
Returns
string
A transaction hash.
Errors
Code | Message |
---|---|
4001 | User denied transaction signature |
4100 | Requested method not supported |
4200 | Wallet not connected |