Account & credits
Manage your account, such as purchasing credits or viewing balance information.
recall account
Interaction with the Recall network requires an account (ECDSA, secp256k1). As with any blockchain
system, an account can be created at will, transfer funds, and send transactions. A transaction can
be a deposit
, withdrawal
, or (intra-subnet) transfer
.
The account
command allows you to execute various subcommands:
create
: Create a new account with a private key.credit <subcommand>
: Manage credits for your account and sponsoring storage for contracts.info
: Get account information (address, sequence, balance).deposit
: Deposit funds into a subnet from its parent.withdraw
: Withdraw funds from a subnet to its parent.sponsor
: Set or unset an account's default credit sponsor for gas fees.transfer
: Transfer funds to another account in a subnet.
Create an account
Create a new account from a random seed.
This command logs a JSON object to stdout with three properties: the private key, EVM public key, and its corresponding Wasm compatible address.
Examples:
Create a new private key:
Optionally, pipe its output into a file to store the keys:
Credit
Manage credits for your account and sponsoring storage for contracts.
Buy credit
Buy credits for an account.
Positionals | Description |
---|---|
<AMOUNT> | The amount of credits to purchase using the subnet's native coin. |
Flag | Required? | Description |
---|---|---|
-p, --private-key | Yes | Wallet private key (ECDSA, secp256k1) for signing transactions. |
--to <TO> | No | The recipient account address (if not present, defaults to the signer's address). |
-b, --broadcast-mode | No | Broadcast mode for the transaction: commit , sync , or async (default: commit ). |
--gas-limit | No | Gas limit for the transaction. |
--gas-fee-cap | No | Maximum gas fee for the transaction in attoFIL (1FIL = 10**18 attoFIL). |
--gas-premium | No | Gas premium for the transaction in attoFIL (1FIL = 10**18 attoFIL). |
--sequence | No | Sequence (i.e., nonce) for the transaction. |
You'll see three values in the data
field of the response:
credit_free
: The number of credits available to spend—equivalent to the amount of credits purchased and not yet committed to storing data.credit_committed
: The number of credits committed to storing data.last_debit_epoch
: The epoch (block height) at which the account last had credits debited.
Examples:
Buy credit with 1 native coins (displayed with units).
Approve credit
Approve a credit amount for a bucket.
Flag | Required? | Description |
---|---|---|
-p, --private-key | Yes | Wallet private key (ECDSA, secp256k1) for signing transactions. |
--to <TO> | Yes | The receiver account address. |
--credit-limit <LIMIT> | No | Credit approval limit. If specified, the approval becomes invalid once the used credits reach the specified limit |
--gas-fee-limit <LIMIT> | No | Gas fee limit. If specified, the approval becomes invalid once the used gas fees reach the specified limit |
--ttl <TTL> | No | Credit approval time-to-live epochs. If specified, the approval becomes invalid after this duration |
Examples:
Approve a receiver to use credits for any buckets created by the approver (i.e., the account making the approval).
Or, approve a receiver to use credits with a TTL, credit limit, and gas fee limit.
Revoke credit
Revoke a credit amount for a bucket.
Flag | Required? | Description |
---|---|---|
-p, --private-key | Yes | Wallet private key (ECDSA, secp256k1) for signing transactions. |
--to <TO> | Yes | The receiver account address. |
Examples:
Revoke a receiver's approval, disabling credit usage.
Get credit stats
Get the credit stats for a subnet.
This is more of a subnet-wide view, as opposed to an account-specific view. It's helpful because it shows the total number of credits sold and committed, number of accounts that have bought credits, and the credit debit rate.
Flag | Required? | Description |
---|---|---|
--height | No | Query at a specific block height (default: committed ). |
Examples:
Get account info
Get account information, such as its address, nonce, token balance, credit balance, and approvals.
This commands logs a JSON object to stdout: its public key, addresses, current sequence (nonce), current subnet balance, and its balance on the parent subnet.
Flag | Required? | Description |
---|---|---|
-p, --private-key | Yes, if no address | Wallet private key (ECDSA, secp256k1) for signing transactions. |
-a, --address | Yes, if no private-key | Account address; the signer's address is used if no address is given. |
--height | No | Query at a specific block height (default: committed ). |
--evm-rpc-url | No | The Ethereum API RPC HTTP endpoint. |
--evm-rpc-timeout | No | Timeout for calls to the Ethereum API (default: 60 seconds ). |
--evm-rpc-auth-token | No | Bearer token for any Authorization header. |
--evm-gateway | No | The gateway contract address. |
--evm-registry | No | The registry contract address. |
--evm-supply-source | No | The supply source contract address. |
Examples:
Get account info for a specific address:
Deposit funds
Deposit funds into a subnet from its parent.
Think of the deposit
command as transferring funds from a parent to a child subnet. If you want to
build on Recall, you start by moving funds from the parent L1 (rootnet) to the Recall subnet. This
goes through a smart contract (i.e., the gateway contract) call that locks the funds in a smart
contract on the parent, later minting them to the address on the subnet (i.e., a bridging flow).
Positionals | Description |
---|---|
<AMOUNT> | The amount to transfer. |
Optionally, you can pass the --to
flag to deposit funds from the parent to a specific address on
the child. If you don't specify anything, the funds will be deposited to the address corresponding
to the provided private key. Note that the global --network
flag (defaults to testnet
) will set
all of the --evm-...
presets for you, but you can override them with your own values, if needed.
Flag | Required? | Description |
---|---|---|
-p, --private-key | Yes | Wallet private key (ECDSA, secp256k1) for signing transactions. |
--to <TO> | No | The recipient account address (if not present, defaults to the signer's address). |
--evm-rpc-url | No | The Ethereum API RPC HTTP endpoint. |
--evm-rpc-timeout | No | Timeout for calls to the Ethereum API (default: 60 seconds ). |
--evm-rpc-auth-token | No | Bearer token for any Authorization header. |
--evm-gateway | No | The gateway contract address. |
--evm-registry | No | The registry contract address. |
Examples:
Deposit funds to the signer's address:
Deposit funds to another address:
Withdraw funds
Withdraw funds from a subnet to its parent.
The withdraw
command is the opposite of a deposit
. It moves funds from a subnet to its parent,
which happens through a smart contract call that unlocks the funds in the smart contract on the
parent. Note that the global --network
flag (defaults to testnet
) will set all of the
--evm-...
presets for you, but you can override them with your own values, if needed.
Positionals | Description |
---|---|
<AMOUNT> | The amount to transfer. |
Similarly, you can pass the --to
flag to withdraw subnet funds to a specific address on the
parent, but if you don't, the funds will be withdrawn to the address corresponding to the provided
private key.
Flag | Required? | Description |
---|---|---|
-p, --private-key | Yes | Wallet private key (ECDSA, secp256k1) for signing transactions. |
--to <TO> | No | The recipient account address (if not present, defaults to the signer's address). |
--evm-rpc-url | No | The Ethereum API RPC HTTP endpoint. |
--evm-rpc-timeout | No | Timeout for calls to the Ethereum API (default: 60 seconds ). |
--evm-rpc-auth-token | No | Bearer token for any Authorization header. |
--evm-gateway | No | The gateway contract address. |
--evm-registry | No | The registry contract address. |
Examples:
Withdraw funds to the signer's address:
Withdraw funds to another address:
Sponsor
Set or unset an account's default credit sponsor for gas fees. This assumes the sponsor has approved your account via a credit approval.
Subcommand | Description |
---|---|
set | Set an account's default credit sponsor for gas fees. |
unset | Unset an account's default credit sponsor for gas fees. |
In each command, it takes the following positionals:
Positionals | Description |
---|---|
<SPONSOR> | Credit sponsor address. |
Examples:
Both of these examples presume the account 0x15d34aaf54267db7d7c367839aaf71a00a2c6a65
has executed
a credit approval for your account.
Set an account's default credit sponsor for gas fees.
Unset an account's default credit sponsor for gas fees.
Transfer funds
Transfer funds to another account within a subnet.
Positionals | Description |
---|---|
<AMOUNT> | The amount to transfer. |
The --to
flag is the destination address within the subnet that you want to send funds to. Note
that the global --network
flag (defaults to testnet
) will set all of the --evm-...
presets for
you, but you can override them with your own values, if needed. This transaction happens fully
within the subnet (and does not interact with the rootnet).
Flag | Required? | Description |
---|---|---|
-p, --private-key | Yes | Wallet private key (ECDSA, secp256k1) for signing transactions. |
--to <TO> | Yes | The recipient account address. |
--evm-rpc-url | No | The Ethereum API RPC HTTP endpoint. |
--evm-rpc-timeout | No | Timeout for calls to the Ethereum API (default: 60 seconds ). |
--evm-rpc-auth-token | No | Bearer token for any Authorization header. |
--evm-gateway | No | The gateway contract address. |
--evm-registry | No | The registry contract address. |
Examples:
Transfer funds to another address:
When you transfer
funds from an account that already exists on the subnet to an account that
doesn't exist, the recipient will effectively be created. Thus, it's much faster (a couple of
seconds) than a deposit
or withdraw
, which require a two-step process that eventually settles on
the rootnet.