Sending a Transaction with a Fee Grant
Set thegranter field on the StdFee object:
MsgGrantAllowance).
Documentation Index
Fetch the complete documentation index at: /llms.txt
Use this file to discover all available pages before exploring further.
Using the fee grant module to let one account pay fees for another
granter field on the StdFee object:
import { coins } from "@cosmjs/proto-signing";
const fee = {
amount: coins(5000, "uatom"),
gas: "200000",
granter: "cosmos1granter...",
};
const result = await client.signAndBroadcast(granteeAddress, messages, fee);
MsgGrantAllowance).
import {
QueryClient,
setupFeegrantExtension,
} from "@cosmjs/stargate";
import { connectComet } from "@cosmjs/tendermint-rpc";
const cometClient = await connectComet("https://rpc.my-chain.network");
const queryClient = QueryClient.withExtensions(
cometClient,
setupFeegrantExtension,
);
const allowance = await queryClient.feegrant.allowance(
"cosmos1granter...",
"cosmos1grantee...",
);
const allAllowances = await queryClient.feegrant.allowances(
"cosmos1grantee...",
);
Was this page helpful?