Skip to content

Mana

Checking the amount of Resource Credits, also known as Mana, is critical when maintaining Koinos blockchain operations. Your Mana determines whether or not you have the ability to perform transactions on the chain.

Below you can find examples of how to check your current Mana using a variety of supported tools.

You can use the CLI command account_rc to check an account's Mana. The account_rc will query the blockchain and report your currently available Mana.

When your wallet is already opened, the command is as follows:

account_rc
10535.49462399 rc

It also works to specify an address.

The command:

account_rc 1EPZaqve43k9Jq5mNeT2ydCjUiytTTU4U
10535.49462399 rc

You can set how much mana to use with the rclimit command. The command can be used to set an absolute limit or a relative limit.

🔓 > help rclimit
Set or show the current rc limit. Give no limit to see current value. Give limit as either mana or a percent (i.e. 80%).
Usage: rclimit [limit:string]

You can set a relative limit by passing a percentage.

rclimit 20%
Set rc limit to 20%

You can set an absolute value by passing a number.

rclimit 10
Set rc limit to 10

You can retrieve an account's current mana with the getAccountRc function:

const provider = new Provider("https://api.koinos.io");
const accountRc = await provider.getAccountRc("1CKtxyeatx6BsGjB4GXNoT4vEdRRka7WdJ");
console.log(accountRc);

You can retrieve an account's current mana using the path v1/account/{account}/mana.

curl -X 'GET' \
'https://api.koinos.pro/v1/account/1NsQbH5AhQXgtSNg1ejpFqTi2hmCWz1eQS/mana' \
-H 'accept: application/json' \
-H 'X-API-KEY: WNfKg6ITYc9mWViySEvLiODZp6iti1A5'
{
  "value": "1501.13019176"
}

An account's maximum mana is simply their KOIN balance. You can retrieve their KOIN balance using the path v1/account/{account}/{contract_id}. The contract ID can be the contract address, the system name, a nickname, or a KAP domain. In this example, we will use the system contract name,koin` for the KOIN contract.

curl -X 'GET' \
'https://api.koinos.pro/v1/account/1NsQbH5AhQXgtSNg1ejpFqTi2hmCWz1eQS/balance/koin' \
-H 'accept: application/json' \
-H 'X-API-KEY: WNfKg6ITYc9mWViySEvLiODZp6iti1A5'
{
  "value": "2911.78051025"
}

In this scenario, the account has ~1501/2911 Mana (~51.5%).