Parameters
grantee_address
string
The Injective address that receives permission to use the fee grant.
Returns
granter_address
string
The Injective address that created the fee grant.
grantee_address
string
The Injective address authorized to use the fee grant.
tx_hash
string
The hash of the transaction that created or refreshed the fee grant.
expiration
string
The fee-grant expiration time expressed in Unix milliseconds.
spend_limit
object
The maximum coin amount that may be spent through the fee grant.
denom
string
The denomination that identifies the transferred or fee coin.
amount
string
The coin amount represented as a decimal string in base denomination units.
allowed_messages
array
The protobuf message type URLs that the fee grant permits.
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/exchange"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.NewInjectiveExchangeRPCClient(conn)34// WARNING: This method can change Mainnet state. The sample values are intentionally invalid.35request := &pb.PrepareFeeGrantRequest{}36requestJSON := `{"grantee_address":"inj13rqjnfdlwqqkgfszzmdd7fjl8qwguf0n95jcpp"}`37if err := protojson.Unmarshal([]byte(requestJSON), request); err != nil {38log.Fatal(err)39}4041response, err := client.PrepareFeeGrant(ctx, request)42if err != nil {43log.Fatal(err)44}4546data, err := protojson.MarshalOptions{UseProtoNames: true, Indent: " "}.Marshal(response)47if err != nil {48log.Fatal(err)49}50data = append(data, '\n')51fmt.Print(string(data))52}53
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/exchange"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.NewInjectiveExchangeRPCClient(conn)34// WARNING: This method can change Mainnet state. The sample values are intentionally invalid.35request := &pb.PrepareFeeGrantRequest{}36requestJSON := `{"grantee_address":"inj13rqjnfdlwqqkgfszzmdd7fjl8qwguf0n95jcpp"}`37if err := protojson.Unmarshal([]byte(requestJSON), request); err != nil {38log.Fatal(err)39}4041response, err := client.PrepareFeeGrant(ctx, request)42if err != nil {43log.Fatal(err)44}4546data, err := protojson.MarshalOptions{UseProtoNames: true, Indent: " "}.Marshal(response)47if err != nil {48log.Fatal(err)49}50data = append(data, '\n')51fmt.Print(string(data))52}53
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/exchange/injective_exchange_rpc.proto'),10{11keepCase: true,12longs: String,13enums: String,14bytes: String,15defaults: true,16oneofs: true,17}18)1920const proto = grpc.loadPackageDefinition(definition).injective_exchange_rpc21const client = new proto.InjectiveExchangeRPC(22GRPC_ENDPOINT,23grpc.credentials.createSsl()24)2526const metadata = new grpc.Metadata()27metadata.add('x-token', AUTH_TOKEN)2829// WARNING: This method can change Mainnet state. The sample values are intentionally invalid.30const request = {31grantee_address: 'inj13rqjnfdlwqqkgfszzmdd7fjl8qwguf0n95jcpp',32}3334client.PrepareFeeGrant(35request,36metadata,37{ deadline: Date.now() + 20000 },38(error, response) => {39if (error) {40console.error(error)41process.exitCode = 142return43}4445console.log(JSON.stringify(response, null, 2))46client.close()47}48)49
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/exchange/injective_exchange_rpc.proto'),10{11keepCase: true,12longs: String,13enums: String,14bytes: String,15defaults: true,16oneofs: true,17}18)1920const proto = grpc.loadPackageDefinition(definition).injective_exchange_rpc21const client = new proto.InjectiveExchangeRPC(22GRPC_ENDPOINT,23grpc.credentials.createSsl()24)2526const metadata = new grpc.Metadata()27metadata.add('x-token', AUTH_TOKEN)2829// WARNING: This method can change Mainnet state. The sample values are intentionally invalid.30const request = {31grantee_address: 'inj13rqjnfdlwqqkgfszzmdd7fjl8qwguf0n95jcpp',32}3334client.PrepareFeeGrant(35request,36metadata,37{ deadline: Date.now() + 20000 },38(error, response) => {39if (error) {40console.error(error)41process.exitCode = 142return43}4445console.log(JSON.stringify(response, null, 2))46client.close()47}48)49
1import json2import grpc3from google.protobuf.json_format import MessageToJson, ParseDict4from exchange import injective_exchange_rpc_pb25from exchange import injective_exchange_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_exchange_rpc_pb2_grpc.InjectiveExchangeRPCStub(channel)12metadata = (("x-token", AUTH_TOKEN),)1314# WARNING: This method can change Mainnet state. The sample values are intentionally invalid.15request_data = {16"grantee_address": "inj13rqjnfdlwqqkgfszzmdd7fjl8qwguf0n95jcpp"17}18request = ParseDict(request_data, injective_exchange_rpc_pb2.PrepareFeeGrantRequest())1920try:21response = client.PrepareFeeGrant(request, metadata=metadata, timeout=20)22print(MessageToJson(response, preserving_proto_field_name=True, indent=2))23except grpc.RpcError as error:24print(f"gRPC error {error.code().name}: {error.details()}")25raise26finally:27channel.close()28
1import json2import grpc3from google.protobuf.json_format import MessageToJson, ParseDict4from exchange import injective_exchange_rpc_pb25from exchange import injective_exchange_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_exchange_rpc_pb2_grpc.InjectiveExchangeRPCStub(channel)12metadata = (("x-token", AUTH_TOKEN),)1314# WARNING: This method can change Mainnet state. The sample values are intentionally invalid.15request_data = {16"grantee_address": "inj13rqjnfdlwqqkgfszzmdd7fjl8qwguf0n95jcpp"17}18request = ParseDict(request_data, injective_exchange_rpc_pb2.PrepareFeeGrantRequest())1920try:21response = client.PrepareFeeGrant(request, metadata=metadata, timeout=20)22print(MessageToJson(response, preserving_proto_field_name=True, indent=2))23except grpc.RpcError as error:24print(f"gRPC error {error.code().name}: {error.details()}")25raise26finally:27channel.close()28
Don't have an account yet?
Create your Quicknode endpoint in seconds and start building
Get started for free