GetTransactionSignWeight gRPC Method
Parameters
raw_data
object
Loading...
ref_block_bytes
string
Loading...
ref_block_num
integer
Loading...
ref_block_hash
string
Loading...
expiration
integer
Loading...
auths
array
Loading...
data
string
Loading...
contract
array
Loading...
type
string
Loading...
parameter
object
Loading...
value
string
Loading...
type_url
string
Loading...
provider
string
Loading...
ContractName
string
Loading...
Permission_id
integer
Loading...
scripts
string
Loading...
timestamp
integer
Loading...
fee_limit
integer
Loading...
signature
array
Loading...
ret
array
Loading...
fee
integer
Loading...
ret
string
Loading...
contractRet
string
Loading...
assetIssueID
string
Loading...
withdraw_amount
integer
Loading...
unfreeze_amount
integer
Loading...
exchange_id
integer
Loading...
orderId
string
Loading...
orderDetails
array
Loading...
withdraw_expire_amount
integer
Loading...
Returns
permission
object
Loading...
type
string
Loading...
id
integer
Loading...
permission_name
string
Loading...
threshold
integer
Loading...
parent_id
integer
Loading...
operations
string
Loading...
keys
array
Loading...
address
string
Loading...
weight
integer
Loading...
approved_list
array
Loading...
current_weight
integer
Loading...
result
object
Loading...
code
string
Loading...
message
string
Loading...
transaction
object
Loading...
transaction
object
Loading...
raw_data
object
Loading...
ref_block_bytes
string
Loading...
ref_block_num
integer
Loading...
ref_block_hash
string
Loading...
expiration
integer
Loading...
auths
array
Loading...
data
string
Loading...
contract
array
Loading...
scripts
string
Loading...
timestamp
integer
Loading...
fee_limit
integer
Loading...
signature
array
Loading...
ret
array
Loading...
txid
string
Loading...
constant_result
array
Loading...
result
object
Loading...
result
boolean
Loading...
code
string
Loading...
message
string
Loading...
energy_used
integer
Loading...
logs
array
Loading...
address
string
Loading...
topics
array
Loading...
data
string
Loading...
internal_transactions
array
Loading...
hash
string
Loading...
caller_address
string
Loading...
transferTo_address
string
Loading...
callValueInfo
array
Loading...
callValue
integer
Loading...
tokenId
string
Loading...
note
string
Loading...
rejected
boolean
Loading...
extra
string
Loading...
energy_penalty
integer
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() {36// Setup connection options37opts := []grpc.DialOption{38grpc.WithTransportCredentials(credentials.NewTLS(&tls.Config{})),39grpc.WithPerRPCCredentials(&auth{token}),40}4142// Create and start gRPC client43conn := client.NewGrpcClient(endpoint)44if err := conn.Start(opts...); err != nil {45panic(err)46}47defer conn.Conn.Close()4849// Specify transaction ID to query50txID := "675d304be4dbc5b68554ecc60a2aebac137209910e82fa9ee1210ecccbe79bde"5152// First get the transaction using GetTransactionByID53fmt.Println("Getting transaction with ID:", txID)54tx, err := conn.GetTransactionByID(txID)55if err != nil {56fmt.Printf("Error fetching transaction: %v\n", err)57return58}5960// Call GetTransactionSignWeight with the transaction61fmt.Println("Getting transaction sign weight:")62signWeight, err := conn.GetTransactionSignWeight(tx)63if err != nil {64fmt.Printf("Error fetching transaction sign weight: %v\n", err)65return66}6768// Print the transaction sign weight response as JSON69signWeightJSON, err := json.MarshalIndent(signWeight, "", " ")70if err != nil {71fmt.Printf("Error marshaling to JSON: %v\n", err)72return73}7475// Print the JSON76fmt.Println(string(signWeightJSON))77}
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() {36// Setup connection options37opts := []grpc.DialOption{38grpc.WithTransportCredentials(credentials.NewTLS(&tls.Config{})),39grpc.WithPerRPCCredentials(&auth{token}),40}4142// Create and start gRPC client43conn := client.NewGrpcClient(endpoint)44if err := conn.Start(opts...); err != nil {45panic(err)46}47defer conn.Conn.Close()4849// Specify transaction ID to query50txID := "675d304be4dbc5b68554ecc60a2aebac137209910e82fa9ee1210ecccbe79bde"5152// First get the transaction using GetTransactionByID53fmt.Println("Getting transaction with ID:", txID)54tx, err := conn.GetTransactionByID(txID)55if err != nil {56fmt.Printf("Error fetching transaction: %v\n", err)57return58}5960// Call GetTransactionSignWeight with the transaction61fmt.Println("Getting transaction sign weight:")62signWeight, err := conn.GetTransactionSignWeight(tx)63if err != nil {64fmt.Printf("Error fetching transaction sign weight: %v\n", err)65return66}6768// Print the transaction sign weight response as JSON69signWeightJSON, err := json.MarshalIndent(signWeight, "", " ")70if err != nil {71fmt.Printf("Error marshaling to JSON: %v\n", err)72return73}7475// Print the JSON76fmt.Println(string(signWeightJSON))77}
Don't have an account yet?
Create your Quicknode endpoint in seconds and start building
Get started for free