{% tabs %} {% tab title="TypeScript/JavaScript" %} {% code overflow="wrap" lineNumbers="true" %}
// yarn add @tatumio/tatum
import { TatumSDK, EthereumClassic, Network } from '@tatumio/tatum'
const tatum = await TatumSDK.init<EthereumClassic>({network: Network.ETHEREUM_CLASSIC})
const gasPrice = await tatum.rpc.sendRawTransaction('0x0000.......')
await tatum.destroy() // Destroy Tatum SDK - needed for stopping background jobs
{% endcode %} {% endtab %} {% endtabs %}
The eth_sendRawTransaction
RPC method is used to send a signed and serialized Flare 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 EthereumClassic, interacting with smart contracts, or deploying new contracts.
The method accepts a single parameter:
data
: The signed and serialized transaction data as a hexadecimal string.
The method returns a single value:
transactionHash
: The hash of the submitted transaction as a hexadecimal string, e.g.,"0x9fc76417374aa880d4449a1f7f31ec597f00b1f6f3dd2d66f4c9c6c445836d8b"
.
{
"id": 1,
"jsonrpc": "2.0",
"method": "eth_sendRawTransaction",
"params": [
"0xf86d8201...94a7bc"
]
}
{
"id": 1,
"jsonrpc": "2.0",
"result": "0x9fc76417374aa880d4449a1f7f31ec597f00b1f6f3dd2d66f4c9c6c445836d8b"
}
\