Learn how to use the Kwil CLI to approve and deposit funds, get your balance, and other account metadata
fundsubcommand is used to manage payment functionality for Kwil. The command supports the following functionalities:
- Get-Account: Reading account data, such as funds spent vs unspent, and account nonces.
- Approve: Approving tokens to be deposited to smart contracts.
- Deposit: Depositing tokens to smart contracts.
- Balances: Reading token balances and allowances.
get-accountsubcommand is used to retrieve your active account state from the Kwil network. This command will return an addresses unspent balance, spent balance, and current account nonce.
get-accountretrieves information for your configured wallet. You can optionally pass the
-a) flag to get the information for any address on the network.
kwil-cli fund get-account --address=0x37Fc1953e4A26007E6Df52f06B5897a998F51f5D
balancessubcommand is used to retrieve your token balance and approved amounts. While the
get-accountcommand retrieves your addresses active state from the Kwil network, the
balancescommand retrieves your addresses's information from the chain on which your funds were deposited from.
Similar to the
balancescommand has an options
--addressflag to specify addresses other than the one you have configured
kwil-cli fund balances --address=0x37Fc1953e4A26007E6Df52f06B5897a998F51f5D
approvesubcommand is used to approve tokens to be spent by the deposit smart contract. For example, if you deposit funds from Ethereum, then this command is used to call the ERC-20 approve method. It automatically selects the token and deposit contract used by the Kwil network you are using.
approvecommand takes one argument, which is the amount of tokens you want to approve.
kwil-cli fund approve 100
depositsubcommand is used to deposit funds into a deposit smart contract. The CLI automatically detects the proper token and deposit contract address to use for the Kwil network you are using.
depositcommand takes one argument, which is the amount of tokens to deposit.
kwil-cli fund deposit 100