Layer 231
WalletSendTransfer
Send TON from the user's built-in wallet to another Telegram user. Resolve the recipient's address with wallet. get User Addresses first, then build and sign the transfer on-device: data_normal is the signed external message Bo C (fees paid in TON), and data_gasless is an optional relayer-paid variant when gasless transfers are available (see wallet. get Gasless Info). The returned Updates contain update Sent Wallet Transaction with the message hash for wallet. get Transactions By Msg Hash.
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
UpdatesGogram 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.