# Via TON Core

Ton package uses the `sendTransfer` method to send a transaction to the blockchain. An example of the usage is on their [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) => `your mnemonic word ${i + 1}`
); // replace with your mnemonic
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());

// swap 1 TON for a STON but not less than 0.1 STON
const txArgs = {
  offerAmount: toNano("1"),
  askJettonAddress: "EQA2kCVNwVsil2EM2mB0SkXytxCqQjS4mttjDpnXmwG9T6bO",
  minAskAmount: toNano("0.1"),
  proxyTon: new pTON.v1(),
  userWalletAddress: wallet.address.toString(),
};

// you can instantly send the transaction using the router method with send suffix
await dex.sendSwapTonToJetton(contract.sender(keyPair.secretKey), txArgs);

// or you can get the transaction parameters
const txParams = await dex.getSwapTonToJettonTxParams(txArgs);

// and send it manually later
await contract.sendTransfer({
  seqno: await contract.getSeqno(),
  secretKey: keyPair.secretKey,
  messages: [internal(txParams)],
});
```


---

# 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.ston.fi/developer-section/common/transaction-sending/toncore.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.
