GetAssetIssueByName gRPC Method
參數
名稱
字串
必填
載入中...
退貨
id
字串
載入中...
owner_address
字串
載入中...
名稱
字串
載入中...
abbr
字串
載入中...
total_supply
整數
載入中...
frozen_supply
陣列
載入中...
frozen_amount
整數
載入中...
frozen_days
整數
載入中...
trx_num
整數
載入中...
precision
整數
載入中...
num
整數
載入中...
start_time
整數
載入中...
end_time
整數
載入中...
order
整數
載入中...
vote_score
整數
載入中...
說明
字串
載入中...
url
字串
載入中...
free_asset_net_limit
整數
載入中...
public_free_asset_net_limit
整數
載入中...
public_free_asset_net_usage
整數
載入中...
public_latest_free_net_time
整數
載入中...
請求
1package main23import (4"context"5"crypto/tls"6"encoding/hex"7"encoding/json"8"fmt"9"github.com/fbsobreira/gotron-sdk/pkg/client"10"google.golang.org/grpc"11"google.golang.org/grpc/credentials"12"log"13)1415// 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"2223type auth struct {24token string25}2627func (a *auth) GetRequestMetadata(ctx context.Context, uri ...string) (map[string]string, error) {28return map[string]string{29"x-token": a.token,30}, nil31}3233func (a *auth) RequireTransportSecurity() bool {34return false35}3637func main() {3839opts := []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()4849name := "62747474657374"50nameBytes, _ := hex.DecodeString(name)51fmt.Printf("Looking up token: %s (hex: %s)\n", string(nameBytes), name)52assetInfo, err := conn.GetAssetIssueByName(name)53if err != nil {54log.Fatal(err)55}56fmt.Println("Asset Issue information for token name:")57fmt.Printf("Token name (hex): %s\n", name)58resultJSON, err := json.MarshalIndent(assetInfo, "", " ")59if err != nil {60log.Fatal("Error marshaling asset information to JSON:", err)61}62fmt.Println("\nComplete asset issue information (JSON):")63fmt.Println(string(resultJSON))64}
1package main23import (4"context"5"crypto/tls"6"encoding/hex"7"encoding/json"8"fmt"9"github.com/fbsobreira/gotron-sdk/pkg/client"10"google.golang.org/grpc"11"google.golang.org/grpc/credentials"12"log"13)1415// 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"2223type auth struct {24token string25}2627func (a *auth) GetRequestMetadata(ctx context.Context, uri ...string) (map[string]string, error) {28return map[string]string{29"x-token": a.token,30}, nil31}3233func (a *auth) RequireTransportSecurity() bool {34return false35}3637func main() {3839opts := []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()4849name := "62747474657374"50nameBytes, _ := hex.DecodeString(name)51fmt.Printf("Looking up token: %s (hex: %s)\n", string(nameBytes), name)52assetInfo, err := conn.GetAssetIssueByName(name)53if err != nil {54log.Fatal(err)55}56fmt.Println("Asset Issue information for token name:")57fmt.Printf("Token name (hex): %s\n", name)58resultJSON, err := json.MarshalIndent(assetInfo, "", " ")59if err != nil {60log.Fatal("Error marshaling asset information to JSON:", err)61}62fmt.Println("\nComplete asset issue information (JSON):")63fmt.Println(string(resultJSON))64}