eth_sendTransaction
Creates a new wallet confirmation to make an Ethereum transaction from the user's account. This method requires that the user has granted permission to interact with their account first, so make sure to call eth_requestAccounts (recommended) or wallet_requestPermissions first.
Parameters
Transaction(object)requiredThe transaction object to sign and send.
Returns
The transaction hash of the sent transaction.
Errors
| Code | Description |
|---|---|
4100 | The requested account and/or method has not been authorized by the user. |
Example request
await provider.request({
method: "eth_sendTransaction",
params: [
{
"to": "0x4B0897b0513FdBeEc7C469D9aF4fA6C0752aBea7",
"from": "0xDeaDbeefdEAdbeefdEadbEEFdeadbeefDEADbEEF",
"gas": "0x76c0",
"value": "0x8ac7230489e80000",
"data": "0x",
"gasPrice": "0x4a817c800"
}
]
});
Example response
{
"id": 1,
"jsonrpc": "2.0",
"result": "0x4e306b5a5a37532e1734503f7d2427a86f2c992fbe471f5be403b9f734e667c8"
}