Skip to content
LogoLogo

sendRawTransactionSync

Sends a signed transaction to the network, and waits for the transaction to be included in a block.

Usage

import { ,  } from './config'
 
const  = await .prepareTransactionRequest({
  ,
  : '0x70997970c51812dc3a010c7d01b50e0d17dc79c8',
  : 1000000000000000000n
})
 
const  = await .signTransaction()
 
const  = await .sendRawTransactionSync({  }) 

Returns

TransactionReceipt

The Transaction receipt.

Parameters

serializedTransaction

  • Type: Hex

The signed serialized transaction.

const  = await .sendRawTransaction({
  : '0x02f850018203118080825208808080c080a04012522854168b27e5dc3d5839bab5e6b39e1a0ffd343901ce1622e3d64b48f1a04e00902ae0502c4728cbf12156290df99c3ed7de85b1dbfe20b5c36931733a33'
})

throwOnReceiptRevert (optional)

  • Type: boolean

Whether to throw an error if the transaction was detected as reverted.

const  = await .sendRawTransactionSync({
  : '0x02f850018203118080825208808080c080a04012522854168b27e5dc3d5839bab5e6b39e1a0ffd343901ce1622e3d64b48f1a04e00902ae0502c4728cbf12156290df99c3ed7de85b1dbfe20b5c36931733a33',
  : true
})

timeout (optional)

  • Type: number

Timeout for the transaction to be included in a block.

const  = await .sendRawTransactionSync({
  : '0x02f850018203118080825208808080c080a04012522854168b27e5dc3d5839bab5e6b39e1a0ffd343901ce1622e3d64b48f1a04e00902ae0502c4728cbf12156290df99c3ed7de85b1dbfe20b5c36931733a33',
  : 20_000
})