Parameters
hash
string
Loading...
is_evm_hash
boolean
Loading...
Returns
s
string
Loading...
errmsg
string
Loading...
data
object
Loading...
id
string
Loading...
block_number
string
Loading...
block_timestamp
string
Loading...
hash
string
Loading...
code
integer
Loading...
data
string
Loading...
info
string
Loading...
gas_wanted
string
Loading...
gas_used
string
Loading...
gas_fee
object
Loading...
amount
array
Loading...
denom
string
Loading...
amount
string
Loading...
gas_limit
string
Loading...
payer
string
Loading...
granter
string
Loading...
codespace
string
Loading...
events
array
Loading...
type
string
Loading...
attributes
object
Loading...
tx_type
string
Loading...
messages
string
Loading...
signatures
array
Loading...
pubkey
string
Loading...
address
string
Loading...
sequence
string
Loading...
signature
string
Loading...
memo
string
Loading...
tx_number
string
Loading...
block_unix_timestamp
string
Loading...
error_log
string
Loading...
logs
string
Loading...
claim_ids
array
Loading...
Request
1package main23import (4"context"5"crypto/tls"6"fmt"7"log"8"time"910"google.golang.org/grpc"11"google.golang.org/grpc/credentials"12"google.golang.org/grpc/metadata"13"google.golang.org/protobuf/encoding/protojson"1415pb "injective-indexer-grpc/pb/explorer"16)1718const grpcEndpoint = "YOUR_ENDPOINT_NAME.injective-mainnet.quiknode.pro:443"19const authToken = "YOUR_TOKEN"2021func main() {22creds := credentials.NewTLS(&tls.Config{MinVersion: tls.VersionTLS12})23conn, err := grpc.Dial(grpcEndpoint, grpc.WithTransportCredentials(creds))24if err != nil {25log.Fatal(err)26}27defer conn.Close()2829ctx, cancel := context.WithTimeout(context.Background(), 20*time.Second)30defer cancel()31ctx = metadata.AppendToOutgoingContext(ctx, "x-token", authToken)3233client := pb.NewInjectiveExplorerRPCClient(conn)34request := &pb.GetTxByTxHashRequest{}35requestJSON := `{"hash":"0xc3a1047501d009e6b1b05f82cc121e94bba8104f3f2b2a19195658df55317c20"}`36if err := protojson.Unmarshal([]byte(requestJSON), request); err != nil {37log.Fatal(err)38}3940response, err := client.GetTxByTxHash(ctx, request)41if err != nil {42log.Fatal(err)43}4445data, err := protojson.MarshalOptions{UseProtoNames: true, Indent: " "}.Marshal(response)46if err != nil {47log.Fatal(err)48}49data = append(data, '\n')50fmt.Print(string(data))51}52
1package main23import (4"context"5"crypto/tls"6"fmt"7"log"8"time"910"google.golang.org/grpc"11"google.golang.org/grpc/credentials"12"google.golang.org/grpc/metadata"13"google.golang.org/protobuf/encoding/protojson"1415pb "injective-indexer-grpc/pb/explorer"16)1718const grpcEndpoint = "YOUR_ENDPOINT_NAME.injective-mainnet.quiknode.pro:443"19const authToken = "YOUR_TOKEN"2021func main() {22creds := credentials.NewTLS(&tls.Config{MinVersion: tls.VersionTLS12})23conn, err := grpc.Dial(grpcEndpoint, grpc.WithTransportCredentials(creds))24if err != nil {25log.Fatal(err)26}27defer conn.Close()2829ctx, cancel := context.WithTimeout(context.Background(), 20*time.Second)30defer cancel()31ctx = metadata.AppendToOutgoingContext(ctx, "x-token", authToken)3233client := pb.NewInjectiveExplorerRPCClient(conn)34request := &pb.GetTxByTxHashRequest{}35requestJSON := `{"hash":"0xc3a1047501d009e6b1b05f82cc121e94bba8104f3f2b2a19195658df55317c20"}`36if err := protojson.Unmarshal([]byte(requestJSON), request); err != nil {37log.Fatal(err)38}3940response, err := client.GetTxByTxHash(ctx, request)41if err != nil {42log.Fatal(err)43}4445data, err := protojson.MarshalOptions{UseProtoNames: true, Indent: " "}.Marshal(response)46if err != nil {47log.Fatal(err)48}49data = append(data, '\n')50fmt.Print(string(data))51}52
1const grpc = require('@grpc/grpc-js')2const protoLoader = require('@grpc/proto-loader')3const path = require('path')45const GRPC_ENDPOINT = 'YOUR_ENDPOINT_NAME.injective-mainnet.quiknode.pro:443'6const AUTH_TOKEN = 'YOUR_TOKEN'78const definition = protoLoader.loadSync(9path.join(__dirname, 'proto/explorer/injective_explorer_rpc.proto'),10{11keepCase: true,12longs: String,13enums: String,14bytes: String,15defaults: true,16oneofs: true,17}18)1920const proto = grpc.loadPackageDefinition(definition).injective_explorer_rpc21const client = new proto.InjectiveExplorerRPC(22GRPC_ENDPOINT,23grpc.credentials.createSsl()24)2526const metadata = new grpc.Metadata()27metadata.add('x-token', AUTH_TOKEN)2829const request = {30hash: '0xc3a1047501d009e6b1b05f82cc121e94bba8104f3f2b2a19195658df55317c20',31}3233client.GetTxByTxHash(34request,35metadata,36{ deadline: Date.now() + 20000 },37(error, response) => {38if (error) {39console.error(error)40process.exitCode = 141return42}4344console.log(JSON.stringify(response, null, 2))45client.close()46}47)48
1const grpc = require('@grpc/grpc-js')2const protoLoader = require('@grpc/proto-loader')3const path = require('path')45const GRPC_ENDPOINT = 'YOUR_ENDPOINT_NAME.injective-mainnet.quiknode.pro:443'6const AUTH_TOKEN = 'YOUR_TOKEN'78const definition = protoLoader.loadSync(9path.join(__dirname, 'proto/explorer/injective_explorer_rpc.proto'),10{11keepCase: true,12longs: String,13enums: String,14bytes: String,15defaults: true,16oneofs: true,17}18)1920const proto = grpc.loadPackageDefinition(definition).injective_explorer_rpc21const client = new proto.InjectiveExplorerRPC(22GRPC_ENDPOINT,23grpc.credentials.createSsl()24)2526const metadata = new grpc.Metadata()27metadata.add('x-token', AUTH_TOKEN)2829const request = {30hash: '0xc3a1047501d009e6b1b05f82cc121e94bba8104f3f2b2a19195658df55317c20',31}3233client.GetTxByTxHash(34request,35metadata,36{ deadline: Date.now() + 20000 },37(error, response) => {38if (error) {39console.error(error)40process.exitCode = 141return42}4344console.log(JSON.stringify(response, null, 2))45client.close()46}47)48
1import json2import grpc3from google.protobuf.json_format import MessageToJson, ParseDict4from explorer import injective_explorer_rpc_pb25from explorer import injective_explorer_rpc_pb2_grpc67GRPC_ENDPOINT = "YOUR_ENDPOINT_NAME.injective-mainnet.quiknode.pro:443"8AUTH_TOKEN = "YOUR_TOKEN"910channel = grpc.secure_channel(GRPC_ENDPOINT, grpc.ssl_channel_credentials())11client = injective_explorer_rpc_pb2_grpc.InjectiveExplorerRPCStub(channel)12metadata = (("x-token", AUTH_TOKEN),)1314request_data = {15"hash": "0xc3a1047501d009e6b1b05f82cc121e94bba8104f3f2b2a19195658df55317c20"16}17request = ParseDict(request_data, injective_explorer_rpc_pb2.GetTxByTxHashRequest())1819try:20response = client.GetTxByTxHash(request, metadata=metadata, timeout=20)21print(MessageToJson(response, preserving_proto_field_name=True, indent=2))22except grpc.RpcError as error:23print(f"gRPC error {error.code().name}: {error.details()}")24raise25finally:26channel.close()27
1import json2import grpc3from google.protobuf.json_format import MessageToJson, ParseDict4from explorer import injective_explorer_rpc_pb25from explorer import injective_explorer_rpc_pb2_grpc67GRPC_ENDPOINT = "YOUR_ENDPOINT_NAME.injective-mainnet.quiknode.pro:443"8AUTH_TOKEN = "YOUR_TOKEN"910channel = grpc.secure_channel(GRPC_ENDPOINT, grpc.ssl_channel_credentials())11client = injective_explorer_rpc_pb2_grpc.InjectiveExplorerRPCStub(channel)12metadata = (("x-token", AUTH_TOKEN),)1314request_data = {15"hash": "0xc3a1047501d009e6b1b05f82cc121e94bba8104f3f2b2a19195658df55317c20"16}17request = ParseDict(request_data, injective_explorer_rpc_pb2.GetTxByTxHashRequest())1819try:20response = client.GetTxByTxHash(request, metadata=metadata, timeout=20)21print(MessageToJson(response, preserving_proto_field_name=True, indent=2))22except grpc.RpcError as error:23print(f"gRPC error {error.code().name}: {error.details()}")24raise25finally:26channel.close()27
Don't have an account yet?
Create your Quicknode endpoint in seconds and start building
Get started for free