GetAssetIssueByName gRPC Method
パラメータ
名前
文字列
必須
読み込み中...
返品
id
文字列
読み込み中...
owner_address
文字列
読み込み中...
名前
文字列
読み込み中...
abbr
文字列
読み込み中...
total_supply
整数
読み込み中...
frozen_supply
配列
読み込み中...
frozen_amount
整数
読み込み中...
frozen_days
整数
読み込み中...
trx_num
整数
読み込み中...
precision
整数
読み込み中...
num
整数
読み込み中...
開始時刻
整数
読み込み中...
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
整数
読み込み中...
リクエスト
1パッケージ main23import (4「文脈」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}
1パッケージ main23import (4「文脈」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}