CW20 Token
Transaction
Transfer
Transfer tokens from a transaction executor to recipient
.
{
"transfer": {
"recipient": "<Addr>",
"amount": "123123",
}
}
Burn
Reduce tokens from the balance of a transaction executor.
{
"burn": {
"amount": "123123"
}
}
Send
Work same as transfer
but it sends tokens to contract
, not an user address.
When processing a transaction, it triggers the given message in msg
. The given message should be executable on its recipient contract
.msg
is base64-encoded JSON string.
{
"send": {
"contract": "<Addr>",
"amount": "123123",
"msg": "1234erwfaffaesfaef="
}
}
Mint
Issue amount
of tokens and transfer them to the given recipient
.
{
"mint": {
"recipient": "<Addr>",
"amount": "123123"
}
}
Increase/Decrease Allowance
Increases/Decreases the allowance for spender
to handle specific amount
of token.
After execution, the token can be transferred by executing a transaction from spender
. Its transferability expires on the given time point.
{
"increase_allowance": {
"spender": "<Addr>",
"amount": "123123",
"expires": {
"at_height": 123123,
// or
"at_time": 123123,
// or
"never": {}
}
}
}
{
"decrease_allowance": {
"spender": "<Addr>",
"amount": "123123",
"expires": {
"at_height": 123123,
// or
"at_time": 123123,
// or
"never": {}
}
}
}
Transfer from/Send from
Transfers amount
of token from owner
to recipient
. The allowance should be increased before execution.
{
"transfer_from": {
"owner": "<Addr>",
"recipient": "<Addr>",
"amount": "123123",
}
}
{
"send_from": {
"owner": "<Addr>",
"recipient": "<Addr>",
"amount": "123123",
"msg": "<base64_encoded_json_message>"
}
}
Burn from
Burn a specific amount
of token from owner
’s balance.
{
"burn_from": {
"owner": "<Addr>",
"amount": "123123"
}
}
Query
Get Balance
Check the token balance
of the given address
{
"balance": {
"address": "<Addr>"
}
}
Token Info
Check metadata of the contract.
It checks:
- Name
- Decimals
- Total supply
- Other useful information
{
"token_info": {}
}
Minter
{
"minter": {}
}
Allowance
Get the allowance list of the given owner
and spender
.
{
"allowance": {
"owner": "<Addr>",
"spender": "<Addr>"
}
}
All Allowances
Get the list of all allowances of the token that owner
received and not expired.
{
"all_allowances": {
"owner": "<Addr>",
"start_after": "<Addr>", // optional
"limit": 1 // optional
}
}
All Accounts
Get all account list of the token holder.
{
"all_accounts": {
"start_after": "<Addr>", // optional
"limit": 1 // optional
}
}