BlockPI Network
Search
K
Comment on page

klay_sendTransaction

Constructs a transaction with given parameters, signs the transaction with a sender's private key and propagates the transaction to Klaytn network.

Parameters

The required parameters depend on the transaction type. Check the proper parameters in Klaytn Docs.

Return Value

Type
Description
32-byte DATA
The transaction hash

Example

params: [{
"from": "0xb60e8dd61c5d32be8058bb8eb970870f07233155",
"to": "0xd46e8dd67c5d32be8058bb8eb970870f07244567",
"gas": "0x76c0",
"gasPrice": "0x5d21dba00",
"value": "0x9184e72a",
"data": "0xd46e8dd67c5d32be8d46e8dd67c5d32be8058bb8eb970870f072445675058bb8eb970870f072445675"
}]
// Request
curl -H "Content-Type: application/json" --data '{"jsonrpc":"2.0","method":"klay_sendTransaction","params":[{see above}],"id":1}' http://klaytn.blockpi.network/v1/rpc/your-api-key
// Result
{
"jsonrpc": "2.0","id":1,
"result": "0xe670ec64341771606e55d6b4ca35a1a6b75ee3d5145a99d05921026d1527331"
}