8
"github.com/fbsobreira/gotron-sdk/pkg/client"9
"google.golang.org/grpc"10
"google.golang.org/grpc/credentials"18
var token = "YOUR_TOKEN"19
var endpoint = "YOUR_ENDPOINT:50051"25
func (a *auth) GetRequestMetadata(ctx context.Context, uri ...string) (map[string]string, error) {26
return map[string]string{31
func (a *auth) RequireTransportSecurity() bool {37
opts := []grpc.DialOption{38
grpc.WithTransportCredentials(credentials.NewTLS(&tls.Config{})),39
grpc.WithPerRPCCredentials(&auth{token}),42
conn := client.NewGrpcClient(endpoint)43
if err := conn.Start(opts...); err != nil {46
defer conn.Conn.Close()48
txID := "675d304be4dbc5b68554ecc60a2aebac137209910e82fa9ee1210ecccbe79bde"50
fmt.Println("Getting transaction info with ID:", txID)51
txInfo, err := conn.GetTransactionInfoByID(txID)53
fmt.Printf("Error fetching transaction info: %v\n", err)57
txInfoJSON, err := json.MarshalIndent(txInfo, "", " ")59
fmt.Printf("Error marshaling to JSON: %v\n", err)63
fmt.Println(string(txInfoJSON))
8
"github.com/fbsobreira/gotron-sdk/pkg/client"9
"google.golang.org/grpc"10
"google.golang.org/grpc/credentials"18
var token = "YOUR_TOKEN"19
var endpoint = "YOUR_ENDPOINT:50051"25
func (a *auth) GetRequestMetadata(ctx context.Context, uri ...string) (map[string]string, error) {26
return map[string]string{31
func (a *auth) RequireTransportSecurity() bool {37
opts := []grpc.DialOption{38
grpc.WithTransportCredentials(credentials.NewTLS(&tls.Config{})),39
grpc.WithPerRPCCredentials(&auth{token}),42
conn := client.NewGrpcClient(endpoint)43
if err := conn.Start(opts...); err != nil {46
defer conn.Conn.Close()48
txID := "675d304be4dbc5b68554ecc60a2aebac137209910e82fa9ee1210ecccbe79bde"50
fmt.Println("Getting transaction info with ID:", txID)51
txInfo, err := conn.GetTransactionInfoByID(txID)53
fmt.Printf("Error fetching transaction info: %v\n", err)57
txInfoJSON, err := json.MarshalIndent(txInfo, "", " ")59
fmt.Printf("Error marshaling to JSON: %v\n", err)63
fmt.Println(string(txInfoJSON))