Fee Granting
Demonstrating Fee Allowance
import { AAClient } from "@burnt-labs/signers";
// These are used in the following code examples.
import { MsgGrantAllowance } from "cosmjs-types/cosmos/feegrant/v1beta1/tx";
import { BasicAllowance } from "cosmjs-types/cosmos/feegrant/v1beta1/feegrant";
export async function buildClient(
key: string
): Promise<[AAClient, AccountData]> {
const signer: OfflineDirectSigner = await DirectSecp256k1Wallet.fromKey(
fromHex(key),
burntChainInfo.bech32Config.bech32PrefixAccAddr
);
const [accountData] = await signer.getAccounts();
const client = await AAClient.connectWithSigner(
// This can be any RPC endpoint.
"https://rpc.xion-testnet-2.burnt.com:443",
signer
);
return [client, accountData];
}
const [fundingAccountClient, fundingAccount] = await buildClient("<private_key_of_funding_account>");
const [recipientAccountClient, recipientAccount] = await buildClient("<private_key_of_recipient_account>");
Last updated
Was this helpful?