GetTransactionInfoByID gRPC Method
Parameters
id
string
REQUIRED
Loading...
Returns
id
string
Loading...
fee
integer
Loading...
blockNumber
integer
Loading...
blockTimeStamp
integer
Loading...
contractResult
array
Loading...
contract_address
string
Loading...
receipt
object
Loading...
energy_usage
integer
Loading...
energy_fee
integer
Loading...
origin_energy_usage
integer
Loading...
energy_usage_total
integer
Loading...
net_usage
integer
Loading...
net_fee
integer
Loading...
result
string
Loading...
energy_penalty_total
integer
Loading...
log
array
Loading...
address
string
Loading...
topics
array
Loading...
data
string
Loading...
result
string
Loading...
resMessage
string
Loading...
assetIssueID
string
Loading...
withdraw_amount
integer
Loading...
unfreeze_amount
integer
Loading...
internal_transactions
array
Loading...
hash
string
Loading...
caller_address
string
Loading...
transferTo_address
string
Loading...
callValueInfo
array
Loading...
note
string
Loading...
rejected
boolean
Loading...
extra
string
Loading...
exchange_id
integer
Loading...
orderId
string
Loading...
orderDetails
array
Loading...
makerOrderId
string
Loading...
takerOrderId
string
Loading...
fillSellQuantity
integer
Loading...
fillBuyQuantity
integer
Loading...
packingFee
integer
Loading...
withdraw_expire_amount
integer
Loading...
cancelUnfreezeV2Amount
object
Loading...
Request
1package main23import (4"context"5"crypto/tls"6"encoding/json"7"fmt"8"github.com/fbsobreira/gotron-sdk/pkg/client"9"google.golang.org/grpc"10"google.golang.org/grpc/credentials"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}4142conn := client.NewGrpcClient(endpoint)43if err := conn.Start(opts...); err != nil {44panic(err)45}46defer conn.Conn.Close()4748txID := "675d304be4dbc5b68554ecc60a2aebac137209910e82fa9ee1210ecccbe79bde"4950fmt.Println("Getting transaction info with ID:", txID)51txInfo, err := conn.GetTransactionInfoByID(txID)52if err != nil {53fmt.Printf("Error fetching transaction info: %v\n", err)54return55}5657txInfoJSON, err := json.MarshalIndent(txInfo, "", " ")58if err != nil {59fmt.Printf("Error marshaling to JSON: %v\n", err)60return61}6263fmt.Println(string(txInfoJSON))64}
1package main23import (4"context"5"crypto/tls"6"encoding/json"7"fmt"8"github.com/fbsobreira/gotron-sdk/pkg/client"9"google.golang.org/grpc"10"google.golang.org/grpc/credentials"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}4142conn := client.NewGrpcClient(endpoint)43if err := conn.Start(opts...); err != nil {44panic(err)45}46defer conn.Conn.Close()4748txID := "675d304be4dbc5b68554ecc60a2aebac137209910e82fa9ee1210ecccbe79bde"4950fmt.Println("Getting transaction info with ID:", txID)51txInfo, err := conn.GetTransactionInfoByID(txID)52if err != nil {53fmt.Printf("Error fetching transaction info: %v\n", err)54return55}5657txInfoJSON, err := json.MarshalIndent(txInfo, "", " ")58if err != nil {59fmt.Printf("Error marshaling to JSON: %v\n", err)60return61}6263fmt.Println(string(txInfoJSON))64}
Don't have an account yet?
Create your Quicknode endpoint in seconds and start building
Get started for free