A cheqd-node
instance can be controlled and configured using the cheqd Cosmos CLI.
This document contains the Fee Abstraction commands for paying for transactions using governance-approved alternative tokens, e.g., a stablecoin such as USDC. The Fee Abstraction module routes requests for supported IBC denominations to Osmosis DEX, and uses existing liquidity pools (e.g., the CHEQ/USDC pool) to convert the tokens on the fly. The underlying transaction on cheqd network is always funded in CHEQ tokens.
Various commands are available for declaring fees in transactions, along with querying and configuring allowed denominations through governance proposals.
Fees for transactions cannot be denominated in arbitrary alternative tokens, when attempting to pay for transactions with non-CHEQ tokens. Supported IBC denominations must be approved using decentralised governance.
The equivalent IBC denomination amount is required to pay for transactions. Ensure this amount is available in the equivalent Osmosis account related to the cheqd account/key provided in the transaction.
You can find out if you've got sufficient balance in supported IBC denominations using the following methods:
- Through Leap Wallet
- Ensure you have added the cheqd wallet you want to use for transactions to a supported desktop/mobile wallet. The recommended wallet app is Leap Wallet. If you previously used Keplr Wallet, we recommend migrating from Keplr Wallet to Leap Wallet as it has better support for looking up real-time gas prices.
- Once you've added the cheqd wallet account to Leap Wallet, use the network switcher to switch to Osmosis. This will allow you to see the balances you have on Osmosis chain, including native OSMO as well as any IBC denominations such as USDC.
- Converting your cheqd address to Osmosis using CLI
- TASOS: We should probably add this under the key management and link to it from here.
- Once you have obtained your Osmosis address, you can look up its balance using the Osmosis CLI or through a block explorer like Mintscan.
If you do not have sufficient balances in supported IBC denominations on Osmosis, you need to top-up the specific token you want in your Osmosis account
- If you already have USDC (regardless of which chain it is on), use Noble Express Transfer to transfer it as Cosmos-native Noble USDC into Osmosis.
- Acquire USDC on Osmosis by swapping existing tokens to USDC.
As tokens supported for fee abstraction can only be allowlisted by governance, use the following command to find out which IBC denominations are supported:
cheqd-noded query feeabs all-host-chain-config --node <url>
--node
: IP address or URL of node to send the request to--output json
(optional): Provides the output in JSON format
$ cheqd-noded query feeabs all-host-chain-config --node https://rpc.cheqd.network:443
all_host_chain_config:
- ibc_denom: ibc/498A0751C798A0D9A389AA3691123DADA57DAA4FE165D5C75894505B876BA6E4
osmosis_pool_token_denom_in: ibc/498A0751C798A0D9A389AA3691123DADA57DAA4FE165D5C75894505B876BA6E4
pool_id: 1273
status: 0
- The
ibc_denom
is the IBC denomination of the supported asset on Osmsosis (not the IBC denomination of the asset on cheqd). - If the
status
is0
, the IBC denomination is allowed for transactions. If thestatus
is1
, the IBC denomination is not allowed for transactions. Also, if the IBC denomination is not included in the response, it is not allowed for transactions.
You can also query allowed IBC denominations using the REST API, which can be useful for applications that do not use the node CLI. You can fetch this by initiating a GET request to:
- Mainnet:
https://api.cheqd.net/fee-abstraction/feeabs/v1/all-host-chain-config
- Testnet:
https://api.cheqd.network/fee-abstraction/feeabs/v1/all-host-chain-config
{
"all_host_chain_config": [
{
"ibc_denom": "ibc/498A0751C798A0D9A389AA3691123DADA57DAA4FE165D5C75894505B876BA6E4",
"osmosis_pool_token_denom_in": "ibc/498A0751C798A0D9A389AA3691123DADA57DAA4FE165D5C75894505B876BA6E4",
"pool_id": "1273",
"status": 0
}
]
}
You can also query allowed IBC denominations for a specific IBC denomination using the REST API. You can fetch this by initiating a GET request to:
- Mainnet:
https://api.cheqd.net/fee-abstraction/feeabs/v1/host-chain-config/<ibc_denom>
- Testnet:
https://api.cheqd.network/fee-abstraction/feeabs/v1/host-chain-config/<ibc_denom>
{
"host_chain_config": {
"ibc_denom": "ibc/498A0751C798A0D9A389AA3691123DADA57DAA4FE165D5C75894505B876BA6E4",
"osmosis_pool_token_denom_in": "ibc/498A0751C798A0D9A389AA3691123DADA57DAA4FE165D5C75894505B876BA6E4",
"pool_id": "1273",
"status": 0
}
}
Refer to the Querying real-time gas prices via CLI section in the cheqd-cli-token-transactions.md document.
Note: The real-time gas prices are used to calculate the fees for transactions. Denominations for fees are specified in the chain-native denomination, which is
ncheq
. You'll need to convert the gas price amount to the desired IBC denomination, as described within the next section.
cheqd-noded query feeabs osmo-arithmetic-twap <ibc_denom> --node <url>
ibc_denom
: The IBC denomination to convert the gas price to--node
: IP address or URL of node to send the request to--output json
(optional): Provides the output in JSON format
$ cheqd-noded query feeabs osmo-arithmetic-twap ibc/498A0751C798A0D9A389AA3691123DADA57DAA4FE165D5C75894505B876BA6E4 --node https://rpc.cheqd.network:443
osmo_arithmetic_twap: "34874.714483483365588155"
If the desired IBC denomination is not configured, the response will error out with a message indicating that the IBC denomination is not allowed for transactions.
cheqd-noded tx bank <from_key_or_address> <to_address> <amount> --gas <gas> --gas-prices <gas_prices> --fees <fees> --node <url>
from_key_or_address
: The key or address of the sender. If the key is used, the key must be unlocked in the keyring.to_address
: The address of the recipientamount
: The amount to send, in the format1000ncheq
. The amount must be in the chain-native denomination, which isncheq
gas
: The amount of gas to use orauto
to calculate the gas automaticallygas_prices
: The gas prices to use, in the format5000ncheq
or0.00000016ibc/498A0751C798A0D9A389AA3691123DADA57DAA4FE165D5C75894505B876BA6E4
fees
: The fees to pay, in the format1000000000ncheq
or0.032ibc/498A0751C798A0D9A389AA3691123DADA57DAA4FE165D5C75894505B876BA6E4
--node
: IP address or URL of node to send the request to
Note: Use either
--gas
and--gas-prices
or--fees
to declare fees in transactions. If--fees
is used, the--gas
and--gas-prices
flags are ignored.
$ cheqd-noded tx bank key1 cheqd1rnr5jrt4exl0samwj0yegv99jeskl0hsxmcz96 1000000000ncheq --gas auto --gas-prices 0.00000016ibc/498A0751C798A0D9A389AA3691123DADA57DAA4FE165D5C75894505B876BA6E4 --node https://rpc.cheqd.network:443
{"height":"0","txhash":"<tx_hash>","codespace":"","code":0,"data":"","raw_log":"[]","logs":[],"info":"","gas_wanted":"0","gas_used":"0","tx":null,"timestamp":"","events":[]}
$ cheqd-noded tx bank key1 cheqd1rnr5jrt4exl0samwj0yegv99jeskl0hsxmcz96 1000000000ncheq --fees 0.032ibc/498A0751C798A0D9A389AA3691123DADA57DAA4FE165D5C75894505B876BA6E4 --node https://rpc.cheqd.network:443 -y
{"height":"0","txhash":"<tx_hash>","codespace":"","code":0,"data":"","raw_log":"[]","logs":[],"info":"","gas_wanted":"0","gas_used":"0","tx":null,"timestamp":"","events":[]}
Note: Use with the
-y
flag to skip the confirmation prompt. Any fees declared in transactions are deducted from the sender's account by first converting the fees to the chain-native denomination, which isncheq
. Use with any compatible transaction type declared in thetx
command.
$ cheqd-noded tx cheqd create-did did-document.json --fees 1.6ibc/498A0751C798A0D9A389AA3691123DADA57DAA4FE165D5C75894505B876BA6E4 --node https://rpc.cheqd.network:443 -y
{"height":"0","txhash":"<tx_hash>","codespace":"","code":0,"data":"","raw_log":"[]","logs":[],"info":"","gas_wanted":"0","gas_used":"0","tx":null,"timestamp":"","events":[]}
Identity transactions require fees to be declared using the --fees
flag. The fees are deducted from the sender's account by first converting the fees to the chain-native denomination, which is ncheq
.
Similarly, declare fees for DID-Linked Resource transactions using the --fees
flag.
$ cheqd-noded tx resource create resource-payload.json data.json --fees 0.08ibc/498A0751C798A0D9A389AA3691123DADA57DAA4FE165D5C75894505B876BA6E4 --node https://rpc.cheqd.network:443 -y
{"height":"0","txhash":"<tx_hash>","codespace":"","code":0,"data":"","raw_log":"[]","logs":[],"info":"","gas_wanted":"0","gas_used":"0","tx":null,"timestamp":"","events":[]}
cheqd-noded tx gov submit-legacy-proposal add-hostzone-config <proposal-file> --from <key> --node <url>
proposal-file
: The JSON file containing the proposal detailskey
: The key of the proposer to submit the proposal on behalf of--node
: IP address or URL of node to send the request to
$ cheqd-noded tx gov submit-legacy-proposal add-hostzone-config proposal.json --from key1 --gas auto --gas-prices 5000ncheq --node https://rpc.cheqd.network:443
{"height":"0","txhash":"<tx_hash>","codespace":"","code":0,"data":"","raw_log":"[]","logs":[],"info":"","gas_wanted":"0","gas_used":"0","tx":null,"timestamp":"","events":[]}
{
"title": "Add $USDC IBC denomination to Host Zone",
"description": "Add $USDC IBC denomination to the Host Zone configuration",
"host_chain_fee_abs_config": {
"ibc_denom": "ibc/498A0751C798A0D9A389AA3691123DADA57DAA4FE165D5C75894505B876BA6E4",
"osmosis_pool_token_denom_in": "ibc/498A0751C798A0D9A389AA3691123DADA57DAA4FE165D5C75894505B876BA6E4",
"pool_id": "1273",
"status": 0
},
"deposit": "100000000000ncheq"
}
Note: Use with the
add-hostzone-config
proposal type to allow an IBC denomination for transactions. The proposal must be submitted by a proposer with the required deposit amount in the chain-native denomination, which isncheq
. The proposal details are specified in the JSON file. Fees can be declared using either the--gas
and--gas-prices
flags or the--fees
flag.
ibc/498A0751C798A0D9A389AA3691123DADA57DAA4FE165D5C75894505B876BA6E4
: The $USDC IBC denomination for the Osmosis chainibc/92AE2F53284505223A1BB80D132F859A00E190C6A738772F0B3EF65E20BA484F
: The $EURe IBC denomination for the Osmosis chainibc/7A08C6F11EF0F59EB841B9F788A87EC9F2361C7D9703157EC13D940DC53031FA
: The $CHEQ IBC denomination for the Osmosis chain