GetAssetIssueList gRPC Method
パラメータ
ページ
整数
必須
読み込み中...
上限
整数
読み込み中...
返品
assetIssue
配列
読み込み中...
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"fmt"7"github.com/fbsobreira/gotron-sdk/pkg/client"8"google.golang.org/grpc"9"google.golang.org/grpc/credentials"10「log」11)1213// Quicknode endpoints consist of two crucial components: the endpoint name and the corresponding token14// For eg: QN Endpoint: https://docs-demo.tron-mainnet.quiknode.pro/abcde12345678915// endpoint will be: docs-demo.tron-mainnet.quiknode.pro:50051 {50051 is the port number for Tron gRPC}16// token will be : abcde1234567891718var token = "YOUR_TOKEN"19var endpoint = "YOUR_ENDPOINT:50051"2021type auth struct {22token string23}2425func (a *auth) GetRequestMetadata(ctx context.Context, uri ...string) (map[string]string, error) {26return map[string]string{27"x-token": a.token,28}, nil29}3031func (a *auth) RequireTransportSecurity() bool {32return false33}3435func main() {3637opts := []grpc.DialOption{38grpc.WithTransportCredentials(credentials.NewTLS(&tls.Config{})),39grpc.WithPerRPCCredentials(&auth{token}),40}41conn := client.NewGrpcClient(endpoint)42if err := conn.Start(opts...); err != nil {43panic(err)44}45defer conn.Conn.Close()4647fmt.Println("Fetching complete list of TRC10 tokens...")4849page := int64(-1) // Use -1 to get all tokens5051assetList, err := conn.GetAssetIssueList(page)5253if err != nil {54log.Fatalf("Error getting asset issue list: %v", err)55}5657totalTokens := len(assetList.AssetIssue)58fmt.Printf("\nTotal TRC10 tokens found: %d\n", totalTokens)5960// Display the first few tokens as an example61fmt.Println("\nSample of first 5 tokens:")62displayCount := 563if totalTokens < displayCount {64displayCount = totalTokens65}6667for i := 0; i < displayCount; i++ {68token := assetList.AssetIssue[i]69fmt.Printf("\n%d. ID: %s\n", i+1, token.Id)70fmt.Printf(" Name: %s\n", string(token.Name))71fmt.Printf(" Symbol: %s\n", string(token.Abbr))72fmt.Printf(" Decimals: %d\n", token.Precision)73fmt.Printf(" Total Supply: %d\n", token.TotalSupply)74}75}
1パッケージ main23import (4「文脈」5"crypto/tls"6"fmt"7"github.com/fbsobreira/gotron-sdk/pkg/client"8"google.golang.org/grpc"9"google.golang.org/grpc/credentials"10「log」11)1213// Quicknode endpoints consist of two crucial components: the endpoint name and the corresponding token14// For eg: QN Endpoint: https://docs-demo.tron-mainnet.quiknode.pro/abcde12345678915// endpoint will be: docs-demo.tron-mainnet.quiknode.pro:50051 {50051 is the port number for Tron gRPC}16// token will be : abcde1234567891718var token = "YOUR_TOKEN"19var endpoint = "YOUR_ENDPOINT:50051"2021type auth struct {22token string23}2425func (a *auth) GetRequestMetadata(ctx context.Context, uri ...string) (map[string]string, error) {26return map[string]string{27"x-token": a.token,28}, nil29}3031func (a *auth) RequireTransportSecurity() bool {32return false33}3435func main() {3637opts := []grpc.DialOption{38grpc.WithTransportCredentials(credentials.NewTLS(&tls.Config{})),39grpc.WithPerRPCCredentials(&auth{token}),40}41conn := client.NewGrpcClient(endpoint)42if err := conn.Start(opts...); err != nil {43panic(err)44}45defer conn.Conn.Close()4647fmt.Println("Fetching complete list of TRC10 tokens...")4849page := int64(-1) // Use -1 to get all tokens5051assetList, err := conn.GetAssetIssueList(page)5253if err != nil {54log.Fatalf("Error getting asset issue list: %v", err)55}5657totalTokens := len(assetList.AssetIssue)58fmt.Printf("\nTotal TRC10 tokens found: %d\n", totalTokens)5960// Display the first few tokens as an example61fmt.Println("\nSample of first 5 tokens:")62displayCount := 563if totalTokens < displayCount {64displayCount = totalTokens65}6667for i := 0; i < displayCount; i++ {68token := assetList.AssetIssue[i]69fmt.Printf("\n%d. ID: %s\n", i+1, token.Id)70fmt.Printf(" Name: %s\n", string(token.Name))71fmt.Printf(" Symbol: %s\n", string(token.Abbr))72fmt.Printf(" Decimals: %d\n", token.Precision)73fmt.Printf(" Total Supply: %d\n", token.TotalSupply)74}75}