Layer 231
method
wallet.sendTransfer#d9e5d9e2 flags:# data_normal:bytes data_gasless:flags.0?bytes user_id:InputUser random_id:long = Updates;

Parameters

Name Type Description
DataNormal bytes Signed external message Bo C performing the transfer with fees paid in TON, built and signed on-device with the wallet's private key
DataGasless flags.0?bytes Optional signed Bo C for a gasless transfer whose fees are covered through the relayer (see wallet. get Gasless Info)
UserId InputUser Telegram user receiving the TON; resolve their address with wallet. get User Addresses to build the message
RandomId long Unique random ID generated by the client to prevent sending the same transfer twice

Returns

Updates

Gogram Example

user, _ := client.GetSendableUser("durov")
addrs, err := client.WalletGetUserAddresses(false, []tg.InputUser{user}, nil)
if err != nil || len(addrs.Addresses) == 0 {
	log.Fatal("recipient has no wallet: ", err)
}
to := addrs.Addresses[0].Address
// signedTransferBoc: an external message BoC transferring TON to `to`, built and signed
// on-device with your wallet's private key (e.g. with tonutils-go). The key never leaves the device.
// For a gasless transfer also pass a second BoC paying the relayer from wallet.getGaslessInfo.
updates, err := client.WalletSendTransfer(signedTransferBoc, nil, user, rand.Int63())
if err != nil {
	log.Fatal(err)
}
fmt.Printf("transfer to %s submitted: %T\n", to, updates)
// The result carries tg.UpdateSentWalletTransaction with the message hash.