GetAssetIssueList gRPC Method
参数
页面
整数
必填
正在加载...
上限
整数
正在加载...
退货
assetIssue
数组
正在加载...
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
整数
正在加载...
请求
1包 main23导入 (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"日志"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 端点 = "YOUR_ENDPOINT:50051"2021类型 auth 结构体 {22token string23}2425func (a *auth) GetRequestMetadata(ctx 上下文.上下文, uri ...字符串) (map[字符串]字符串, 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包 main23导入 (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"日志"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 端点 = "YOUR_ENDPOINT:50051"2021类型 auth 结构体 {22token string23}2425func (a *auth) GetRequestMetadata(ctx 上下文.上下文, uri ...字符串) (map[字符串]字符串, 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}