Using grant allowances to execute transactions
As one of the primary use case of the Fee Grant module is to help with onboarding new users, this section of the guide will show how to allow users to execute transactions using the allowance granted to them.
Query a grant allowance
Now that an allowance has been assigned to an account address, you should be able to verify the details of that grant. The returned information will include the granter's address, the allowance amount, and any other conditions set by the granter, such as the expiration date of the allowance.
The following command using secretcli will give the details of a grant allowance:
Results:
This can also be achieved via the following API endpoint where api_endpoint is an API endpoint connected to one of the Archway networks (Testnet or Mainnet). granter is the address that granted the allowance and grantee is the address that received the allowance:
Results:
Basic Keplr example
The following example will allow a user to unwrap sSCRT into SCRT using a feegrant on mainnet.
Prerequisites
Before moving forward, ensure that you have completed the following prerequisites:
Execute transaction
Set the fee granter and contract addresses.
Define the transaction details which includes the message to the contract (
MsgExecuteContract)
and sign and broadcast the transaction.
Last updated