Skip to main content

Sign Transaction

Sign a transaction that can be submitted to the network later.

Request Parameters

Params[0]

ParameterTypeRequiredDescription
fromStringYesThe address the transaction is sent from. (20 Bytes)
toStringYes (optional when creating new contract)The address the transaction is directed to. (20 Bytes)
gasStringNo (default: 90000)Integer of the gas provided for the transaction execution. It will return unused gas.
gasPriceStringNoThe gas price the sender is willing to pay to miners in wei.
valueIntegerNoInteger of the value sent with this transaction, in Wei.
dataStringNoThe compiled code of a contract OR the hash of the invoked method signature and encoded parameters.
nonceIntegerNoInteger of a nonce. This allows to overwrite your own pending transactions that use the same nonce.

Response Parameters

ParameterTypeDescription
DATAStringThe RLP-encoded transaction object signed by the specified account.

Request Example

await window.ethereum.request({
method: "eth_signTransaction",
params: [
{
from: "0xb60e8dd61c5d32be8058bb8eb970870f07233155",
to: "0xd46e8dd67c5d32be8058bb8eb970870f07244567",
gas: "0x76c0",
gasPrice: "0x9184e72a000",
value: "0x9184e72a",
data: "0xd46e8dd67c5d32be8d46e8dd67c5d32be8058bb8eb970870f072445675058bb8eb970870f072445675",
},
],
});

Response Example

"0xa3f20717a250c2b0b729b7e5becbff67fdaef7e0699da4de7ca5895b02a170a12d887fd3b17bfdce3481f10bea41f45ba9f709d39ce8325427b57afcfc994cee1b"