> For the complete documentation index, see [llms.txt](https://docs.ston.fi/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.ston.fi/developer-section/common/transaction-sending/tonweb.md).

# TonWeb

Use TonWeb Wallet V4R2 to submit a complete array of built SDK messages.

Use this recipe with an existing TonWeb `v4R2` wallet and signing key. Configure the provider for the network used by the builder, initialize the wallet with your signer's public key, and build parameters for that wallet address. The example consumes DEX/Farm `get*TxParams` output rather than constructing a DEX swap.

```js
import TonWeb from "tonweb";
import { beginCell, storeStateInit } from "@ton/core";

async function sendBuiltTransactions(wallet, secretKey, txParams) {
  if (txParams.length < 1 || txParams.length > 4) {
    throw new Error("This Wallet V4R2 recipe requires one to four messages");
  }
  return wallet.methods
    .transfers({
      secretKey,
      seqno: (await wallet.methods.seqno().call()) ?? 0,
      messages: txParams.map((params) => ({
        toAddress: params.to.toString(),
        amount: new TonWeb.utils.BN(params.value.toString()),
        payload: params.body
          ? TonWeb.boc.Cell.oneFromBoc(new Uint8Array(params.body.toBoc()))
          : undefined,
        stateInit: params.init
          ? TonWeb.boc.Cell.oneFromBoc(new Uint8Array(
              beginCell().store(storeStateInit(params.init)).endCell().toBoc(),
            ))
          : undefined,
        sendMode: 1,
      })),
      expireAt: Math.floor(Date.now() / 1000) + 300,
    })
    .send();
}
```

TonWeb's [`transfers` implementation](https://github.com/toncenter/tonweb/blob/master/src/contract/wallet/WalletContract.js) accepts the full message array for this wallet. Do not replace it with a one-message `transfer()` and discard deposit legs. Other wallet versions/capacities require the corresponding implementation; do not split a coupled operation automatically.

See the [TonWeb README](https://github.com/toncenter/tonweb) for provider/wallet initialization. Obtain a transaction identifier from wallet/RPC lookup and follow the product's result instructions; successful broadcast alone is not completion. Omniston's hex payload and optional state init require its [TON adapter](/developer-section/omniston/sdk/ton.md) rather than this DEX/Farm parameter conversion.


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

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

Perform an HTTP GET request on the following URL with the `ask` and `goal` query parameters:

```
GET https://docs.ston.fi/developer-section/common/transaction-sending/tonweb.md?ask=<question>&goal=<user_goal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is what the user is ultimately trying to achieve, the reason they need the answer. Sharing it helps GitBook give you a better, more relevant answer. A goal is most helpful when it describes the outcome the user wants rather than restating the question. For example, with `ask=how do I create an API token`, a goal like `automate deployments from our CI pipeline` lets GitBook tailor the answer to that use case.

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.
