Skip to content

Latest commit

 

History

History
62 lines (43 loc) · 1.58 KB

eth_sendrawtransaction.md

File metadata and controls

62 lines (43 loc) · 1.58 KB

eth_sendRawTransaction

How to use it

{% tabs %} {% tab title="TypeScript/JavaScript" %} {% code overflow="wrap" lineNumbers="true" %}

// yarn add @tatumio/tatum

import { TatumSDK, Fantom, Network } from '@tatumio/tatum'
  
const tatum = await TatumSDK.init<Fantom>({ network: Network.FANTOM })

const gasPrice = await tatum.rpc.sendRawTransaction('0x0000.......')

await tatum.destroy() // Destroy Tatum SDK - needed for stopping background jobs

{% endcode %} {% endtab %} {% endtabs %}

Overview

The eth_sendRawTransaction RPC method is used to send a signed and serialized transaction to the network. This method is particularly useful when you want to have full control over the signing process, e.g., when using hardware wallets, cold storage, or custom signing libraries. It can be utilized in various use cases, such as transferring Ether, interacting with smart contracts, or deploying new contracts.

Parameters

The method accepts a single parameter:

  • data: The signed and serialized transaction data as a hexadecimal string.

Return Value

The method returns a single value:

  • transactionHash: The hash of the submitted transaction as a hexadecimal string, e.g., "0x9fc76417374aa880d4449a1f7f31ec597f00b1f6f3dd2d66f4c9c6c445836d8b".

-RPC Request Example

{
  "id": 1,
  "jsonrpc": "2.0",
  "method": "eth_sendRawTransaction",
  "params": [
    "0xf86d8201...94a7bc"
  ]
}

JSON-RPC Response Example

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

\