TON Core
Send a complete SDK parameter array with an existing WalletContractV4 signer.
Use @ton/ton with an application-controlled wallet. Configure a TonClient for the intended network and open WalletContractV4 using your existing signer's public key. Derive keys with @ton/crypto or your trusted signer setup; do not embed private material in example source.
The function below accepts the opened wallet, its existing signing key, and SDK get*TxParams messages built for that wallet. This Wallet V4 recipe supports one to four messages.
import { SendMode, internal, type WalletContractV4 } from "@ton/ton";
import type { OpenedContract, SenderArguments } from "@ton/core";
async function sendBuiltTransactions(
wallet: OpenedContract<WalletContractV4>,
secretKey: Buffer,
txParams: SenderArguments[],
) {
if (txParams.length < 1 || txParams.length > 4) {
throw new Error("Wallet V4 requires one to four complete messages");
}
await wallet.sendTransfer({
seqno: await wallet.getSeqno(),
secretKey,
timeout: Math.floor(Date.now() / 1000) + 300,
sendMode: SendMode.PAY_GAS_SEPARATELY,
messages: txParams.map((params) => internal(params)),
});
}Use the official wallet example for initialization. Match the builder's sender to this wallet, preserve all messages, and coordinate wallet seqnos when concurrent requests share a signer. sendTransfer() does not return a completed product operation or a universal transaction hash; obtain the outgoing transaction through wallet/RPC lookup and use the product's result instructions.
Omniston hex message/state-init data needs its own adapter before a low-level wallet call; see TON wallet integration.
Last updated