> 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/toncore.md).

# Vía TON Core

El paquete Ton usa el `sendTransfer` método para enviar una transacción a la cadena de bloques. Un ejemplo de uso está en su [README](https://github.com/ton-org/ton/blob/master/README.md?plain=1#L56-L64).

```ts
import { TonClient, WalletContractV4, internal, toNano } from "@ton/ton";
import { mnemonicToPrivateKey } from "@ton/crypto";
import { DEX, pTON } from "@ston-fi/sdk";

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

const mnemonics = Array.from(
  { length: 24 },
  (_, i) => `tu palabra mnemónica ${i + 1}`
); // reemplaza con tu mnemónico
const keyPair = await mnemonicToPrivateKey(mnemonics);

const workchain = 0;
const wallet = WalletContractV4.create({
  workchain,
  publicKey: keyPair.publicKey,
});
const contract = client.open(wallet);

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

// intercambia 1 TON por un STON, pero no menos de 0.1 STON
const txArgs = {
  offerAmount: toNano("1"),
  askJettonAddress: "EQA2kCVNwVsil2EM2mB0SkXytxCqQjS4mttjDpnXmwG9T6bO",
  minAskAmount: toNano("0.1"),
  proxyTon: new pTON.v1(),
  userWalletAddress: wallet.address.toString(),
};

// puedes enviar instantáneamente la transacción usando el método del router con el sufijo send
await dex.sendSwapTonToJetton(contract.sender(keyPair.secretKey), txArgs);

// o puedes obtener los parámetros de la transacción
const txParams = await dex.getSwapTonToJettonTxParams(txArgs);

// y enviarla manualmente después
await contract.sendTransfer({
  seqno: await contract.getSeqno(),
  secretKey: keyPair.secretKey,
  messages: [internal(txParams)],
});
```


---

# 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, and the optional `goal` query parameter:

```
GET https://docs.ston.fi/es/seccion-para-desarrolladores/common/transaction-sending/toncore.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

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.
