CW20 Token #
Transaction #
Transfer #
Transfer token from the sender user to the recipient.
{
"transfer": {
"recipient": "<HumanAddr>",
"amount": 123123,
}
}
Burn #
Burn tokens from total supply.
{
"burn": {
"amount": 123123
}
}
Send #
Work same as transfer but it sends token to contract, not user address.
And, it triggers given message in msg
. The given message should be executable on recipient contract.
msg
is base64-endcoded JSON string.
{
"send": {
"contract": "<HumanAddr>",
"amount": 123123,
"msg": "1234erwfaffaesfaef="
}
}
Mint #
It produces token and transfer to given recipient.
{
"mint": {
"recipient": "<HumanAddr>",
"amount": 123123
}
}
Increase/Decrease allowance #
It increases / decreases allowance of withdrawable token from the executor.
After execution, user token can be transferred by spender’s contract method execution, not only transfer
.
And it expires on the given time point.
{
"increase_allowance": {
"spender": "<HumanAddr>",
"amount": 123123,
"expires": {
"at_height": 123123,
// or
"at_time": 123123,
// or
"never": {}
}
}
}
{
"decrease_allowance": {
"spender": "<HumanAddr>",
"amount": 123123,
"expires": {
"at_height": 123123,
// or
"at_time": 123123,
// or
"never": {}
}
}
}
Transfer from / send from #
It transfers token from owner to recipient, which not owner nor recipeint are not the contract executor.
Before execution, the allowance should be increased.
{
"transfer_from": {
"owner": "<HumanAddr>",
"recipient": "<HumanAddr>",
"amount": 123123,
}
}
{
"send_from": {
"owner": "<HumanAddr>",
"recipient": "<HumanAddr>",
"amount": 123123,
"msg": "<base64_encoded_json_message>"
}
}
Burn from #
Burns token from token supply, whose owner is not same as the contract executor.
{
"burn_from": {
"owner": "<HumanAddr>",
"amount": 123123
}
}
Query #
Get balance #
Check the balance of the given address
{
"balance": {
"address": "<HumanAddr>"
}
}
Token info #
Check metadata of the contract.
It check:
- Name
- Decimals
- Total supply
- Other useful information
{
"token_info": {}
}
Get minter #
{
"minter": {}
}
Get allowance #
Get allowance list of the given owner & spender.
{
"allowance": {
"owner": "<HumanAddr>",
"spender": "<HumanAddr>"
}
}
Get all allowance #
Get list of all allowance of the token.
{
"all_allowances": {
"owner": "<HumanAddr>",
"start_after": "<HumanAddr>", // optional
"limit": 1 // optional
}
}
Accounts list that have the token #
Get all accounts list of the token holder.
{
"all_accounts": {
"start_after": "<HumanAddr>", // optional
"limit": 1 // optional
}
}