Documentation Index
Fetch the complete documentation index at: https://companyname-a7d5b98e-vanity-edits.mintlify.app/llms.txt
Use this file to discover all available pages before exploring further.
Create transactions to send Toncoin, Jettons, and NFTs, or generate previews for users.
Creating a transaction
Before sending any transaction to the blockchain, initialize it for the appropriate asset: Toncoin, Jetton, or NFT.
Toncoin
// Transaction for 1 Toncoin
let amountFormatter = TONTokenAmountFormatter()
// Provide the user's input here
guard let amount = amountFormatter.amount(from: "1") else {
return
}
let message = TONTransferMessage(
// TON wallet address
toAddress: address,
amount: amount,
)
let transaction = try await wallet.transferTONTransaction(message: message)
Jettons
// Transaction for 1 Jetton of some kind (e.g., USDT)
let amountFormatter = TONTokenAmountFormatter()
amountFormatter.nanoUnitDecimalsNumber = 6
// Provide the user's input here
guard let amount = amountFormatter.amount(from: "1") else {
return
}
let parameters = TONJettonTransferParams(
// TON wallet address
toAddress: address,
// Address of a Jetton minter contract
jettonAddress: jettonAddress,
amount: amount,
)
let transaction = try await wallet.transferJettonTransaction(parameters: parameters)
NFTs
let parameters = TONNFTTransferParamsHuman(
// TON wallet address
toAddress: address,
// Address of an NFT item contract
nftAddress: nft.address,
)
let transaction = try await wallet.transferNFTTransaction(parameters: parameters)
Transaction Preview
Once a transaction object is created, present a preview to the user before sending it.
let preview = try await wallet.preview(transaction: transaction)
Sending a transaction
try await wallet.send(transaction: transaction)
Next steps
Receiving information
Get wallet information, Jettons, and NFTs
Manage wallets
Create and manage TON wallets