Skip to main content

GetAssetIssueList gRPC Method

Loading...

Updated on
May 13, 2025

GetAssetIssueList gRPC Method

Parameters

page
integer
REQUIRED
Loading...
limit
integer
Loading...

Returns

assetIssue
array
Loading...
id
string
Loading...
owner_address
string
Loading...
name
string
Loading...
abbr
string
Loading...
total_supply
integer
Loading...
frozen_supply
array
Loading...
frozen_amount
integer
Loading...
frozen_days
integer
Loading...
trx_num
integer
Loading...
precision
integer
Loading...
num
integer
Loading...
start_time
integer
Loading...
end_time
integer
Loading...
order
integer
Loading...
vote_score
integer
Loading...
description
string
Loading...
url
string
Loading...
free_asset_net_limit
integer
Loading...
public_free_asset_net_limit
integer
Loading...
public_free_asset_net_usage
integer
Loading...
public_latest_free_net_time
integer
Loading...
Request
1
package main
2
3
import (
4
"context"
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
)
12
13
// Quicknode endpoints consist of two crucial components: the endpoint name and the corresponding token
14
// For eg: QN Endpoint: https://docs-demo.tron-mainnet.quiknode.pro/abcde123456789
15
// endpoint will be: docs-demo.tron-mainnet.quiknode.pro:50051 {50051 is the port number for Tron gRPC}
16
// token will be : abcde123456789
17
18
var token = "YOUR_TOKEN"
19
var endpoint = "YOUR_ENDPOINT:50051"
20
21
type auth struct {
22
token string
23
}
24
25
func (a *auth) GetRequestMetadata(ctx context.Context, uri ...string) (map[string]string, error) {
26
return map[string]string{
27
"x-token": a.token,
28
}, nil
29
}
30
31
func (a *auth) RequireTransportSecurity() bool {
32
return false
33
}
34
35
func main() {
36
37
opts := []grpc.DialOption{
38
grpc.WithTransportCredentials(credentials.NewTLS(&tls.Config{})),
39
grpc.WithPerRPCCredentials(&auth{token}),
40
}
41
conn := client.NewGrpcClient(endpoint)
42
if err := conn.Start(opts...); err != nil {
43
panic(err)
44
}
45
defer conn.Conn.Close()
46
47
fmt.Println("Fetching complete list of TRC10 tokens...")
48
49
page := int64(-1) // Use -1 to get all tokens
50
51
assetList, err := conn.GetAssetIssueList(page)
52
53
if err != nil {
54
log.Fatalf("Error getting asset issue list: %v", err)
55
}
56
57
totalTokens := len(assetList.AssetIssue)
58
fmt.Printf("\nTotal TRC10 tokens found: %d\n", totalTokens)
59
60
// Display the first few tokens as an example
61
fmt.Println("\nSample of first 5 tokens:")
62
displayCount := 5
63
if totalTokens < displayCount {
64
displayCount = totalTokens
65
}
66
67
for i := 0; i < displayCount; i++ {
68
token := assetList.AssetIssue[i]
69
fmt.Printf("\n%d. ID: %s\n", i+1, token.Id)
70
fmt.Printf(" Name: %s\n", string(token.Name))
71
fmt.Printf(" Symbol: %s\n", string(token.Abbr))
72
fmt.Printf(" Decimals: %d\n", token.Precision)
73
fmt.Printf(" Total Supply: %d\n", token.TotalSupply)
74
}
75
}
Don't have an account yet?
Create your Quicknode endpoint in seconds and start building
Get started for free