TransferAsset gRPC Method
Parameters
from
string
REQUIRED
Loading...
toAddress
string
REQUIRED
Loading...
assetName
string
REQUIRED
Loading...
amount
integer
REQUIRED
Loading...
Returns
transaction
object
Loading...
raw_data
object
Loading...
ref_block_bytes
string
Loading...
ref_block_num
integer
Loading...
ref_block_hash
string
Loading...
expiration
integer
Loading...
auths
array
Loading...
data
string
Loading...
contract
array
Loading...
type
string
Loading...
parameter
object
Loading...
value
string
Loading...
type_url
string
Loading...
provider
string
Loading...
ContractName
string
Loading...
Permission_id
integer
Loading...
scripts
string
Loading...
timestamp
integer
Loading...
fee_limit
integer
Loading...
signature
array
Loading...
ret
array
Loading...
fee
integer
Loading...
ret
string
Loading...
contractRet
string
Loading...
assetIssueID
string
Loading...
withdraw_amount
integer
Loading...
unfreeze_amount
integer
Loading...
exchange_received_amount
integer
Loading...
exchange_inject_another_amount
integer
Loading...
exchange_withdraw_another_amount
integer
Loading...
exchange_id
integer
Loading...
shielded_transaction_fee
integer
Loading...
orderId
string
Loading...
orderDetails
array
Loading...
makerOrderId
string
Loading...
takerOrderId
string
Loading...
fillSellQuantity
integer
Loading...
fillBuyQuantity
integer
Loading...
withdraw_expire_amount
integer
Loading...
cancelUnfreezeV2Amount
object
Loading...
txid
string
Loading...
constant_result
array
Loading...
result
object
Loading...
result
boolean
Loading...
code
string
Loading...
message
string
Loading...
energy_used
integer
Loading...
logs
array
Loading...
address
string
Loading...
topics
array
Loading...
data
string
Loading...
internal_transactions
array
Loading...
hash
string
Loading...
caller_address
string
Loading...
transferTo_address
string
Loading...
callValueInfo
array
Loading...
callValue
integer
Loading...
tokenId
string
Loading...
note
string
Loading...
rejected
boolean
Loading...
extra
string
Loading...
energy_penalty
integer
Loading...
Request
1package main23import (4"context"5"crypto/tls"6"fmt"7"encoding/json"89"github.com/fbsobreira/gotron-sdk/pkg/client"10"google.golang.org/grpc"11"google.golang.org/grpc/credentials"12)131415// Quicknode endpoints consist of two crucial components: the endpoint name and the corresponding token16// For eg: QN Endpoint: https://docs-demo.tron-mainnet.quiknode.pro/abcde12345678917// endpoint will be: docs-demo.tron-mainnet.quiknode.pro:50051 {50051 is the port number for Tron gRPC}18// token will be : abcde1234567891920var token = "YOUR_TOKEN"21var endpoint = "YOUR_ENDPOINT:50051"222324type auth struct {25token string26}2728func (a *auth) GetRequestMetadata(ctx context.Context, uri ...string) (map[string]string, error) {29return map[string]string{30"x-token": a.token,31}, nil32}3334func (a *auth) RequireTransportSecurity() bool {35return false36}3738func main() {39opts := []grpc.DialOption{40grpc.WithTransportCredentials(credentials.NewTLS(&tls.Config{})),41grpc.WithPerRPCCredentials(&auth{token}),42}43conn := client.NewGrpcClient(endpoint)44if err := conn.Start(opts...); err != nil {45panic(err)46}47defer conn.Conn.Close()4849fromAddress := "YOUR_ADDRESS"50toAddress := "RECIPIENT_ADDRESS"51assetName := "YOUR_ASSET_NAME"52amount := int64(1000000)5354response, err := conn.TransferAsset(55fromAddress,56toAddress,57assetName,58amount,59)60if err != nil {61fmt.Printf("Error calling TransferAsset: %v\n", err)62return63}6465fmt.Println("TransferAsset Response:")66jsonData, err := json.MarshalIndent(response, "", " ")67if err != nil {68fmt.Printf("Error marshaling to JSON: %v\n", err)69return70}7172fmt.Println(string(jsonData))7374}
1package main23import (4"context"5"crypto/tls"6"fmt"7"encoding/json"89"github.com/fbsobreira/gotron-sdk/pkg/client"10"google.golang.org/grpc"11"google.golang.org/grpc/credentials"12)131415// Quicknode endpoints consist of two crucial components: the endpoint name and the corresponding token16// For eg: QN Endpoint: https://docs-demo.tron-mainnet.quiknode.pro/abcde12345678917// endpoint will be: docs-demo.tron-mainnet.quiknode.pro:50051 {50051 is the port number for Tron gRPC}18// token will be : abcde1234567891920var token = "YOUR_TOKEN"21var endpoint = "YOUR_ENDPOINT:50051"222324type auth struct {25token string26}2728func (a *auth) GetRequestMetadata(ctx context.Context, uri ...string) (map[string]string, error) {29return map[string]string{30"x-token": a.token,31}, nil32}3334func (a *auth) RequireTransportSecurity() bool {35return false36}3738func main() {39opts := []grpc.DialOption{40grpc.WithTransportCredentials(credentials.NewTLS(&tls.Config{})),41grpc.WithPerRPCCredentials(&auth{token}),42}43conn := client.NewGrpcClient(endpoint)44if err := conn.Start(opts...); err != nil {45panic(err)46}47defer conn.Conn.Close()4849fromAddress := "YOUR_ADDRESS"50toAddress := "RECIPIENT_ADDRESS"51assetName := "YOUR_ASSET_NAME"52amount := int64(1000000)5354response, err := conn.TransferAsset(55fromAddress,56toAddress,57assetName,58amount,59)60if err != nil {61fmt.Printf("Error calling TransferAsset: %v\n", err)62return63}6465fmt.Println("TransferAsset Response:")66jsonData, err := json.MarshalIndent(response, "", " ")67if err != nil {68fmt.Printf("Error marshaling to JSON: %v\n", err)69return70}7172fmt.Println(string(jsonData))7374}
Don't have an account yet?
Create your Quicknode endpoint in seconds and start building
Get started for free