Send and Receive NAM tokens
In Namada, tokens are implemented as accounts with the Token Validity Predicate (opens in a new tab). The validity predicate (VP) checks, in particular, that the total supply (of the token) is preserved in any transaction that uses this token. Your wallet will be pre-loaded with some token addresses that are initialized in the genesis block.
Initialize an established account
If you already have a key in your wallet, you can skip this step. Otherwise, generate a new keypair now.
Then, send a transaction to initialize your new established account and save its address with the alias establishment
. The keysha
public key will be written into the account's storage for authorizing future transactions. We also sign this transaction with keysha
.
Note the use of the placeholder keysha
for the key parameter. This is a completely configurable parameter, and should just refer to the alias of the key signing the transaction (that has a positive nam balance).
namada client init-account \
--alias establishment \
--public-keys keysha \
--signing-keys keysha \
--threshold 1
Once this transaction has been applied, the client will automatically see the new address created by the transaction and add it to your wallet with the chosen alias establishment
.
This command uses the prebuilt User Validity Predicate (opens in a new tab).
Send a Payment
To submit a regular token transfer from your account to the validator-1
address:
namada client transfer \
--source establishment \
--target validator-1 \
--token NAM \
--amount 10 \
--signing-keys keysha
This command will attempt to find and use the key of the source address to sign the transaction.
See your balance
To query token balances for a specific token and/or owner:
namada client balance --token NAM --owner my-new-acc
For any client command that submits a transaction (init-account
, transfer
, tx
, update
and PoS transactions),
you can use the --dry-run-wrapper
flag to simulate the transaction being applied in the block and see what would be the result.
See every known addresses' balance
You can see the token's addresses known by the client when you query all tokens balances:
namada client balance