0xWeb
  • 0xWeb
  • πŸ’»Installation
  • πŸ—ƒοΈBlockchains
  • πŸ“¦Package Manager
    • πŸ“‚Folder structure
    • πŸš€Dequanto dependency
    • πŸŽ†Installing contracts
    • πŸ”’Versioning
  • πŸ”Wallet
    • πŸ”‘Keys notice
    • πŸ™‚Accounts
  • πŸ’»CLI
    • Commands Overview
  • πŸ—„οΈGnosis Safe
    • πŸ™†β€β™‚οΈZero Trust Wallet
  • πŸš€Dequanto
    • ℹ️Info
    • πŸ•ΈοΈRPC Client Pool
    • πŸ—οΈTx Builder
    • πŸ“€Tx Writer
    • ⛓️Blockchain Explorers
    • πŸͺ™Token Services
    • πŸ—ƒοΈIndexer
    • ✨Utilities
  • ⛑️Hardhat
    • ℹ️Info
    • ⬇️Installation
    • 🧩Compile
    • πŸ’«Deploy
  • 0️Openzeppelin
    • Openzeppelin contracts
Powered by GitBook
On this page
  1. Dequanto

Tx Builder

PreviousRPC Client PoolNextTx Writer

Last updated 3 years ago

You won't need to use this class directly. In 0xWeb generated classes TxDataBuilder and TxWriter are used under the hood to send transactions.

Prepares the πŸ”— to be submitted to the chain.

import { TxDataBuilder } from '@dequanto/txs/TxDataBulder'

let builder = new TxDataBuilder(client, account?)
let txData = builder
    // demo with types
    .setInputDataWithTypes(types: any[], paramaters: any[])
    .setInputDataWithABI(fnAbi: string | AbiItem, ...params)
    .setValue(wei: bigint)
    .setNonce(nonceConfig?: TNonceConfig)
    .setGas(gasConfig?: TGasConfig)
    .signToString(privateKey: string);

    
type TNonceConfig {
    // sets the nonce of the first tx in pending state
    overriding?: boolean
    // set the nonce of the N-th tx in pending state
    noncePending?: number
    // custom nonce value
    nonce?: number
}
type TGasConfig {
    price?: bigint
    priceRatio?: number
    gasLimitRatio?: number
    gasLimit?: string | number
    gasEstimation?: boolean
    from?: TAddress
    type?: 1 | 2
}
πŸš€
πŸ—οΈ
Tx Data