> 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/es/seccion-para-desarrolladores/common/transaction-sending/tonconnect.md).

# Vía TON Connect

El paquete TON Connect usa el `sendTransaction` método para enviar una transacción a la cadena de bloques. Un ejemplo de uso está disponible en la [documentación de TON Connect](https://docs.ton.org/develop/dapps/ton-connect/message-builders).

```tsx
import React from "react";
import { TonClient, toNano } from "@ton/ton";
import { DEX, pTON } from "@ston-fi/sdk";
import { useTonConnectUI, useTonAddress } from "@tonconnect/ui-react";

const client = new TonClient({
  endpoint: "https://toncenter.com/api/v2/jsonRPC",
});

const dex = client.open(new DEX.v1.Router());

export const Example = () => {
  const wallet = useTonAddress();
  const [tonConnectUI] = useTonConnectUI();

  return (
    <button
      onClick={async () => {
        const txParams = await dex.getSwapTonToJettonTxParams({
          offerAmount: toNano("1"), // intercambiar 1 TON
          askJettonAddress: "EQA2kCVNwVsil2EM2mB0SkXytxCqQjS4mttjDpnXmwG9T6bO", // para un STON
          minAskAmount: toNano("0.1"), // pero no menos de 0.1 STON
          proxyTon: new pTON.v1(),
          userWalletAddress: wallet,
        });

        await tonConnectUI.sendTransaction({
          validUntil: Date.now() + 1000000,
          messages: [
            {
              address: txParams.to.toString(),
              amount: txParams.value.toString(),
              payload: txParams.body?.toBoc().toString("base64"),
            },
          ],
        });
      }}
    >
      Intercambiar 1 TON por STON
    </button>
  );
};
```


---

# 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 dynamically by asking a question.

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

```
GET https://docs.ston.fi/es/seccion-para-desarrolladores/common/transaction-sending/tonconnect.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.
