Skip to content

sendRawTransaction

Sends a signed transaction to the network. Can be used with both Public Clients and Wallet Clients

Usage

import { account, walletClient } from './config'
 
const request = await walletClient.prepareTransactionRequest({
  account,
  to: '0x70997970c51812dc3a010c7d01b50e0d17dc79c8',
  value: 1000000000000000000n
})
 
const signature = await walletClient.signTransaction(request)
 
const hash = await walletClient.sendRawTransaction({ serializedTransaction: signature })