Learn how to create wallets, manage balances, and perform credit/debit operations using the Cones of Dunshires RPG example
fctl login
command.fctl wallet create
command to create a wallet named eryldor
.
main
. You can use it to store and manage assets without creating additional balances. Here, you’ll use the main
balance to store and manage the coins and experience points of Eryldor.season-2024
balanceseason-2024
to store the badges of Eryldor. This balance will expire at the end of the tournament season 2024. Here it will expire on January 1st, 2025.
eryldor
wallet. You’ll see the main
balance and the season-2024
balance as shown in the screenshot below.
fctl wallets credit
command to credit Eryldor’s wallet with these assets.
When you credit a wallet, you must specify where does the funds come from. Here, you’ll specify that the funds come from the account world
. world
is a special account that represents the external world, and is used to introduce or remove assets from the system.
Note that you didn’t specify a balance. When you don’t specify a balance, the main
balance is used by default as it is the primary balance of the wallet.
Add the coins
world
, you’ll get an INSUFFICIENT_FUND
error. This is because you can only credit a wallet with assets coming from either the external world or another wallet.main
balance contains 10 COIN and 150 XP, as shown in the screenshot below.
fctl wallets debit
command to debit Eryldor’s wallet with 5 COIN.
world
. world
being a special account that represents the external world, it can also be used to remove assets from the system.
main
balance contains 5 COIN and 150 XP, as shown in the screenshot below.
fctl wallets credit
command to credit Eryldor’s wallet with a badge. It’s a special asset that you’ll represent with the BADGE
currency. The process is the same as for the coins and experience points, with the difference that you’ll specify the season-2024
balance.
season-2024
balance contains 1 BADGE, as shown in the screenshot below.