From 161f22995f2755f7a2f4ab4e9c09f461a940c47f Mon Sep 17 00:00:00 2001 From: dreamer Date: Wed, 15 May 2024 10:01:53 +0800 Subject: [PATCH 1/2] update token command docs --- docs/cli-client/token.md | 90 +++++++++++++++++++++++++++++++++------- 1 file changed, 74 insertions(+), 16 deletions(-) diff --git a/docs/cli-client/token.md b/docs/cli-client/token.md index 8ac574be4..e3d556511 100644 --- a/docs/cli-client/token.md +++ b/docs/cli-client/token.md @@ -4,19 +4,22 @@ Token module allows you to manage assets on IRIS Hub ## Available Commands -| Name | Description | -|--------------------------------------------|--------------------------------------------| -| [issue](#iris-tx-token-issue) | Issue a new token | -| [edit](#iris-tx-token-edit) | Edit an existing token | -| [transfer](#iris-tx-token-transfer) | Transfer the ownership of a token | -| [mint](#iris-tx-token-mint) | Mint tokens to a specified address | -| [burn](#iris-tx-token-burn) | Burn some tokens | -| [swap-fee](#iris-tx-token-swap-fee) | Swap one token with another token | -| [token](#iris-query-token-token) | Query a token by symbol | -| [tokens](#iris-query-token-tokens) | Query tokens by owner | -| [fee](#iris-query-token-fee) | Query the token related fees | -| [params](#iris-query-token-params) | Query the token related params | -| [total-burn](#iris-query-token-total-burn) | Query the total amount of all burn tokens. | +| Name | Description | +| ------------------------------------------------- | ----------------------------------------------------- | +| [issue](#iris-tx-token-issue) | Issue a new token | +| [edit](#iris-tx-token-edit) | Edit an existing token | +| [transfer](#iris-tx-token-transfer) | Transfer the ownership of a token | +| [mint](#iris-tx-token-mint) | Mint tokens to a specified address | +| [burn](#iris-tx-token-burn) | Burn some tokens | +| [swap-fee](#iris-tx-token-swap-fee) | Swap one token with another token | +| [swap-from-erc20](#iris-tx-token-swap-from-erc20) | Swap native token from the corresponding ERC20 at 1:1 | +| [swap-to-erc20](#iris-tx-token-swap-to-erc20) | Swap native token to the corresponding ERC20 at 1:1 | +| [token](#iris-query-token-token) | Query a token by symbol | +| [tokens](#iris-query-token-tokens) | Query tokens by owner | +| [fee](#iris-query-token-fee) | Query the token related fees | +| [params](#iris-query-token-params) | Query the token related params | +| [total-burn](#iris-query-token-total-burn) | Query the total amount of all burn tokens | +| [balances](#iris-query-token-balances) | Query all the balances of an owner in special denom | ## iris tx token issue @@ -130,11 +133,12 @@ Swap one token with another token. For example, this feature can be used to exch ```bash iris tx token swap-fee [fee_paid] --to [reciever] ``` + **Flags:** -| Name | Type | Required | Default | Description | -| -------- | ------ |----------| ------- |-------------------------------------------| -| --to | string | Yes | | Address to which the token will be swaped | +| Name | Type | Required | Default | Description | +| ---- | ------ | -------- | ------- | ----------------------------------------- | +| --to | string | Yes | | Address to which the token will be swaped | ### Mint Token @@ -162,6 +166,46 @@ iris tx token burn [symbol] [flags] iris tx token burn --amount= --from= --chain-id= --fees= ``` +## iris tx token swap-from-erc20 + +Swap native token from the corresponding ERC20 at 1:1 + +```bash +iris tx token swap-from-erc20 [wanted_amount] [flags] +``` + +**Flags:** + +| Name | Type | Required | Default | Description | +| ---- | ------ | -------- | ------- | ------------------------------------------------ | +| --to | string | false | "" | Eth address to which the token is to be received | + +### Swap native token from erc20 + +```bash +iris tx token burn --amount= --from= --chain-id= --fees= +``` + +## iris tx token swap-to-erc20 + +Swap native token to the corresponding ERC20 at 1:1 + +```bash +iris tx token swap-to-erc20 [paid_amount] [flags] +``` + +**Flags:** + +| Name | Type | Required | Default | Description | +| ---- | ------ | -------- | ------- | ------------------------------------------------ | +| --to | string | false | "" | Eth address to which the token is to be received | + +### Swap native token to erc20 + +```bash +iris tx token burn --amount= --from= --chain-id= --fees= +``` + ## iris query token token Query a token by symbol @@ -237,3 +281,17 @@ iris query token total-burn [flags] ```bash iris query token total-burn ``` + +## iris query token balances + +Query all the balances of an owner in special denom + +```bash +iris query token balances [addr] [denom] [flags] +``` + +### Query all the balances of an owner in special denom + +```bash +iris query token balances +``` From 265ad764f2b52521e050ed80c500bdc3c3ee47e4 Mon Sep 17 00:00:00 2001 From: dreamer Date: Wed, 15 May 2024 11:16:40 +0800 Subject: [PATCH 2/2] apply comments from github --- docs/cli-client/token.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/docs/cli-client/token.md b/docs/cli-client/token.md index e3d556511..fbef43e1c 100644 --- a/docs/cli-client/token.md +++ b/docs/cli-client/token.md @@ -183,7 +183,7 @@ iris tx token swap-from-erc20 [wanted_amount] [flags] ### Swap native token from erc20 ```bash -iris tx token burn --amount= --from= --chain-id= --fees= +iris tx token swap-from-erc20 --to= --from= --chain-id= --fees= ``` ## iris tx token swap-to-erc20 @@ -203,7 +203,7 @@ iris tx token swap-to-erc20 [paid_amount] [flags] ### Swap native token to erc20 ```bash -iris tx token burn --amount= --from= --chain-id= --fees= +iris tx token swap-to-erc20 --to= --from= --chain-id= --fees= ``` ## iris query token token