eth_sendRawTransaction

Sends a raw transaction to the Ethereum network.

Example

import { getRpcClient, eth_sendRawTransaction } from "thirdweb/rpc";
const rpcRequest = getRpcClient({ client, chain });
const transactionHash = await eth_sendRawTransaction(
rpcRequest,
"0x...",
);
function eth_sendRawTransaction(
request: EIP1193RequestFn<
[
{
Method: "web3_clientVersion";
Parameters?: undefined;
ReturnType: string;
},
{
Method: "web3_sha3";
Parameters: [data: `0x${string}`];
ReturnType: string;
},
{
Method: "net_listening";
Parameters?: undefined;
ReturnType: boolean;
},
{
Method: "net_peerCount";
Parameters?: undefined;
ReturnType: `0x${string}`;
},
{
Method: "net_version";
Parameters?: undefined;
ReturnType: `0x${string}`;
},
]
>,
signedTransaction: `0x${string}`,
): Promise<`0x${string}`>;

Parameters

The EIP1193 request function.

Type

let request: EIP1193RequestFn<
[
{
Method: "web3_clientVersion";
Parameters?: undefined;
ReturnType: string;
},
{
Method: "web3_sha3";
Parameters: [data: `0x${string}`];
ReturnType: string;
},
{
Method: "net_listening";
Parameters?: undefined;
ReturnType: boolean;
},
{
Method: "net_peerCount";
Parameters?: undefined;
ReturnType: `0x${string}`;
},
{
Method: "net_version";
Parameters?: undefined;
ReturnType: `0x${string}`;
},
]
>;

The signed transaction in hex format.

Type

let signedTransaction: `0x${string}`;

Returns

let returnType: Promise<`0x${string}`>;

A promise that resolves to the transaction hash.