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"인코딩/16진수"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"로그"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"인코딩/16진수"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"로그"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}