# Tx Builder

> 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 [Tx Data](https://github.com/0xweb-org/dequanto/blob/master/src/txs/TxDataBuilder.ts)🔗 to be submitted to the chain.&#x20;

```typescript
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
}
```


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.0xweb.org/dequanto/tx-builder.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
