Links

eth_sendRawTransaction

Creates new message call transaction or a contract creation for signed transactions.

Parameters

Params - a string array containing (required):
  • DATA(hex string, required) - the signed transaction data.
params: ["0xd46e8dd67c5d32be8d46e8dd67c5d32be8058bb8eb970870f072445675058bb8eb970870f072445675"]

Returns

DATA(hex string), 32 Bytes - the transaction hash, or the zero hash if the transaction is not yet available.
Use eth_getTransactionReceipt to get the contract address, after the transaction was mined, when you created a contract.

Example

Request

curl
TypeScript
curl https://api.blockvision.org/v1/<api key> \
-X POST \
-H "Content-Type: application/json" \
-d '{
"jsonrpc": "2.0",
"method": "eth_protocolVersion",
"params": [],
"id": 42
}'
import { BlockVisionProvider, BvNetwork } from 'blockvision.js'
// Optional parameters, but default to eth-mainnet and default api-key.
const bv = new BlockVisionProvider(BvNetwork.OPT_MAINNET)
// Access standard Ethers.js JSON-RPC node request
bv.sendTransaction('0xf86b01808502540be40094c02aaa39b223fe8d0a0e5c4f27ead9083c756cc28502540be40084d0e30db026a0842cb79da231900fc67956ef9e3ff67b1e92d0341028df7c416848cf29b8b16aa03472844fb28ad3ebd4de8bd625b1a152e7fc75495c6d0feb8c205471f4774c76').then(console.log)

Result

{
"id": 1,
"jsonrpc": "2.0",
"result": "0xe670ec64341771606e55d6b4ca35a1a6b75ee3d5145a99d05921026d1527331"
}