Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

modification of cli desc #22

Merged
merged 3 commits into from
Mar 2, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
34 changes: 16 additions & 18 deletions docs/cli-client/nft.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,10 +14,10 @@
| [burn-nft](#burn-nft) | Destroy Assets |
| [supply](#supply) | Query supply |
| [owner](#owner) | Query by owner |
| [collection](#collection) | Query collection |
| [nft](#nft) | Query specified nft |
| [nfts](#nfts) | Query nfts |
| [class](#class) | Query class |
| [classes](#classes) | Query classes |
| [nft](#nft) | Query specified nft |

:::tip
The above commands can use the `-h` parameter to view the description of the function and the meaning of the parameters
Expand All @@ -42,12 +42,12 @@ The above `issue-class`,`issue-nft`,`edit-nft`,`transfer-class`,`transfer-nft`,`
参数规则:
| 名称 | 类型 | 描述 | 规则 |
| ----------------- | ----------- | ---- | ---- |
| class-id | string | assets class ID | only accepts alphanumeric characters, and begin with an english letter. length [3,64] |
| class-id | string | assets class-id | [a-zA-Z][a-zA-Z0-9/:-]{2,100} |
| class-name | string | assets class name | none |
| class-symbol | string | assets class symbol | none |
| mint-restricted | bool | MintRestricted is true means that only Class owners can issue NFTs under this category, false means anyone can | none |
| edit-restricted | bool | EditRestricted is true means that no one in this category can Edit the NFT, false means that only the owner of this NFT can Edit | none |
| nft-id | string | nft ID | only accepts alphanumeric characters, and begin with an english letter. length [3,64] |
| nft-id | string | nft ID | [a-zA-Z][a-zA-Z0-9/:-]{2,100} |
| nft-name | string | nft name | none |
| nft-uri | string | The URI pointing to a JSON object that contains subsequent nftData information off-chain | The maximum length is 256 bytes, starting with `http://`,`https://` |
| nft-data | string | NFT specifications defined under this category | none |
Expand Down Expand Up @@ -117,7 +117,7 @@ plugchaind tx nft burn-nft [class-id] [nft-id] [flags]

## supply

Query the total amount of assets based on Class ID; accept the optional --owner parameter.
Query the total amount of assets based on class-id; accept the optional --owner parameter.


```bash
Expand All @@ -127,25 +127,31 @@ plugchaind q nft supply [class-id] --owner=<myAddress> [flags]

## owner

Query all assets owned by an account; you can specify the Class ID parameter.
Query all assets owned by an account; you can specify the class-id parameter.


```bash
plugchaind query nft owner [address] [class-id] [flags]
```
## nft

Query specific assets based on class-id and ID.

## collection
```bash
plugchaind q nft nft [class-id] [nft-id] [flags]
```
## nfts

Query all assets based on Class ID.
Query all assets based on class-id.accept the optional --owner parameter.


```bash
plugchaind q nft collection [class-id] [flags]
plugchaind q nft nfts [class-id] [flags]
```

## class

Query asset category information based on Class ID.
Query asset category information based on class-id.


```bash
Expand All @@ -158,12 +164,4 @@ Query all asset class information that has been issued.

```bash
plugchaind q nft classes [flags]
```

## nft

Query specific assets based on Class ID and ID.

```bash
plugchaind q nft nft [class-id] [nft-id] [flags]
```
36 changes: 18 additions & 18 deletions docs/zh/cli-client/nft.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,10 +14,10 @@
| [burn-nft](#burn-nft) | 销毁资产 |
| [supply](#supply) | 查询supply |
| [owner](#owner) | 通过owner查询 |
| [collection](#collection) | 查询collection |
| [nft](#nft) | 查询指定nft |
| [nfts](#nfts) | 查询nfts |
| [class](#class) | 查询class |
| [classes](#classes) | 查询classes |
| [nft](#nft) | 查询指定nft |

:::tip
以上命令都可以使用 `-h` 参数,来查看功能的描述和参数的含义
Expand All @@ -42,12 +42,13 @@
参数规则:
| 名称 | 类型 | 描述 | 规则 |
| ----------------- | ----------- | ---- | ---- |
| class-id | string | 资产类别序号 | 只接受字母数字字符,并以英文字母开头的,长度 3~64 的字符串 |
| class-id | string | 资产类别序号 | [a-zA-Z][a-zA-Z0-9/:-]{2,100} |
| nft-id | string | 资产序号 | [a-zA-Z][a-zA-Z0-9/:-]{2,100} |
| class-name | string | 资产类别名称 | 无 |
| class-symbol | string | 资产类别缩写 | 无 |
| mint-restricted | bool | true 表示只有类别拥有者才可以在此类别下创建资产,false 表示任何人都可以| 无 |
| edit-restricted | bool | 为 true 表示此类别中没有人可以编辑 NFT,false 表示只有此 NFT 的所有者可以编辑 | 无 |
| nft-id | string | 资产序号 | 只接受字母数字字符,并以英文字母开头的,长度 3~64 的字符串 |

| nft-name | string | 资产名称 | 无 |
| nft-uri | string | 资产链外信息的 JSON 对象的 URI | 最大长度256字节,以`http://`,`https://`开头 |
| nft-data | string | 资产元数据 | 无 |
Expand Down Expand Up @@ -116,7 +117,7 @@ plugchaind tx nft burn-nft [class-id] [nft-id] [flags]

## supply

根据 Class ID查询资产总量;接受可选的 --owner 参数。
根据 class-id 查询资产总量;接受可选的 --owner 参数。


```bash
Expand All @@ -126,25 +127,32 @@ plugchaind q nft supply [class-id] --owner=<myAddress> [flags]

## owner

查询某一账户所拥有的全部资产;可以指定 Class ID参数
查询某一账户所拥有的全部资产;可以指定 class-id 参数


```bash
plugchaind query nft owner [address] [class-id] [flags]
```

## collection
## nft

根据 class-id 以及 ID 查询具体资产。

```bash
plugchaind q nft nft [class-id] [nft-id] [flags]
```

根据 Class ID查询所有资产。
## nfts

根据 class-id 查询所有资产。接受可选的 --owner 参数。

```bash
plugchaind q nft collection [class-id] [flags]
plugchaind q nft nfts [class-id] [flags]
```

## class

根据 Class ID查询资产类别信息
根据 class-id 查询资产类别信息


```bash
Expand All @@ -158,11 +166,3 @@ plugchaind q nft class [class-id] [flags]
```bash
plugchaind q nft classes [flags]
```

## nft

根据 Class ID以及 ID 查询具体资产。

```bash
plugchaind q nft nft [class-id] [nft-id] [flags]
```
22 changes: 14 additions & 8 deletions x/nft/client/cli/query.go
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ func GetQueryCmd(queryRoute string) *cobra.Command {
func GetQueryClassCmd() *cobra.Command {
cmd := &cobra.Command{
Use: "class [class-id]",
Long: "Query the class by the specified class id.",
Short: "Query the class by the specified class id.",
Example: fmt.Sprintf("$ %s q nft class <class-id>", version.AppName),
Args: cobra.ExactArgs(1),
RunE: func(cmd *cobra.Command, args []string) error {
Expand All @@ -67,7 +67,7 @@ func GetQueryClassCmd() *cobra.Command {
func GetQueryClassesCmd() *cobra.Command {
cmd := &cobra.Command{
Use: "classes",
Long: "Query all denominations of all collections of NFTs.",
Short: "Query all denominations of all collections of NFTs.",
Example: fmt.Sprintf("$ %s q nft classes", version.AppName),
Args: cobra.NoArgs,
RunE: func(cmd *cobra.Command, args []string) error {
Expand Down Expand Up @@ -95,7 +95,7 @@ func GetQueryClassesCmd() *cobra.Command {
func GetQueryNFTCmd() *cobra.Command {
cmd := &cobra.Command{
Use: "nft [class-id] [nft-id]",
Long: "Query a single NFT from a collection",
Short: "Query a single NFT from a collection",
Example: fmt.Sprintf("$ %s q nft nft <class-id> <nft-id>", version.AppName),
Args: cobra.ExactArgs(2),
RunE: func(cmd *cobra.Command, args []string) error {
Expand Down Expand Up @@ -182,10 +182,16 @@ $ %s query %s nfts <class-id> --owner=<owner>

func GetQuerySupplyCmd() *cobra.Command {
cmd := &cobra.Command{
Use: "supply [classID]",
Long: "total supply of a collection or owner of NFTs",
Example: fmt.Sprintf("$ %s q nft supply <class-id>", version.AppName),
Args: cobra.ExactArgs(1),
Use: "supply [class-id]",
Short: "total supply of a collection or owner of NFTs",
Long: strings.TrimSpace(
fmt.Sprintf(`Total supply of a collection or owner of NFTs. If owner
is set, all nfts that belong to the owner are filtered out.
Examples:
$ %s query %s supply <class-id> --owner=<owner>
`, version.AppName, types.ModuleName),
),
Args: cobra.ExactArgs(1),
RunE: func(cmd *cobra.Command, args []string) error {
clientCtx, err := client.GetClientTxContext(cmd)
if err != nil {
Expand All @@ -210,7 +216,7 @@ func GetQuerySupplyCmd() *cobra.Command {
func GetQueryOwnerCmd() *cobra.Command {
cmd := &cobra.Command{
Use: "owner [address] [class-id]",
Long: "Get the NFTs owned by an account addr.",
Short: "Get the NFTs owned by an account addr.",
Example: fmt.Sprintf("$ %s q nft owner <address> <class-id>", version.AppName),
Args: cobra.ExactArgs(2),
RunE: func(cmd *cobra.Command, args []string) error {
Expand Down
8 changes: 4 additions & 4 deletions x/token/client/cli/query.go
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ func GetQueryCmd(queryRoute string) *cobra.Command {
func GetCmdQueryToken() *cobra.Command {
cmd := &cobra.Command{
Use: "info [denom]",
Long: "Query a token detail by symbol or min unit.",
Short: "Query a token detail by symbol or min unit.",
Example: fmt.Sprintf("$ %s query token info <denom>", version.AppName),
Args: cobra.ExactArgs(1),
RunE: func(cmd *cobra.Command, args []string) error {
Expand Down Expand Up @@ -70,7 +70,7 @@ func GetCmdQueryToken() *cobra.Command {
func GetCmdQueryParams() *cobra.Command {
cmd := &cobra.Command{
Use: "params",
Long: "Query values set as token parameters",
Short: "Query values set as token parameters",
Example: fmt.Sprintf("$ %s q token params", version.AppName),
Args: cobra.NoArgs,
RunE: func(cmd *cobra.Command, args []string) error {
Expand All @@ -94,7 +94,7 @@ func GetCmdQueryParams() *cobra.Command {
func GetCmdQueryTokens() *cobra.Command {
cmd := &cobra.Command{
Use: "tokens [owner]",
Long: "Query tokens by the owner",
Short: "Query tokens by the owner",
Example: fmt.Sprintf("$ %s q token tokens <owner>", version.AppName),
RunE: func(cmd *cobra.Command, args []string) error {
clientCtx, err := client.GetClientQueryContext(cmd)
Expand Down Expand Up @@ -143,7 +143,7 @@ func GetCmdQueryTokens() *cobra.Command {
func GetCmdQueryTokenFee() *cobra.Command {
cmd := &cobra.Command{
Use: "fee [symbol]",
Long: "Query the token related fees",
Short: "Query the token related fees",
Args: cobra.ExactArgs(1),
Example: fmt.Sprintf("$ %s q token fee <symbol>", version.AppName),
RunE: func(cmd *cobra.Command, args []string) error {
Expand Down
20 changes: 10 additions & 10 deletions x/token/client/cli/tx.go
Original file line number Diff line number Diff line change
Expand Up @@ -36,8 +36,8 @@ func GetTxCmd() *cobra.Command {
// GetCmdIssueToken implements the issue token command
func GetCmdIssueToken() *cobra.Command {
cmd := &cobra.Command{
Use: "issue",
Long: "Issue a new token.",
Use: "issue",
Short: "Issue a new token.",
Example: fmt.Sprintf(
"$ %s tx token issue "+
"--name=\"Kitty Token\" "+
Expand Down Expand Up @@ -118,8 +118,8 @@ func GetCmdIssueToken() *cobra.Command {
}
func GetCmdMintToken() *cobra.Command {
cmd := &cobra.Command{
Use: "mint [symbol]",
Long: "Mint tokens to a specified address.",
Use: "mint [symbol]",
Short: "Mint tokens to a specified address.",
Example: fmt.Sprintf(
"$ %s tx token mint <symbol> "+
"--amount=<amount> "+
Expand Down Expand Up @@ -177,8 +177,8 @@ func GetCmdMintToken() *cobra.Command {
// GetCmdEditToken implements the edit token command
func GetCmdEditToken() *cobra.Command {
cmd := &cobra.Command{
Use: "edit [symbol]",
Long: "Edit an existing token.",
Use: "edit [symbol]",
Short: "Edit an existing token.",
Example: fmt.Sprintf(
"$ %s tx token edit <symbol> "+
"--name=\"Cat Token\" "+
Expand Down Expand Up @@ -223,8 +223,8 @@ func GetCmdEditToken() *cobra.Command {

func GetCmdBurnToken() *cobra.Command {
cmd := &cobra.Command{
Use: "burn [symbol]",
Long: "Burn tokens.",
Use: "burn [symbol]",
Short: "Burn tokens.",
Example: fmt.Sprintf(
"$ %s tx token burn <symbol> "+
"--amount=<amount> "+
Expand Down Expand Up @@ -278,8 +278,8 @@ func GetCmdBurnToken() *cobra.Command {

func GetCmdTransferOwnerToken() *cobra.Command {
cmd := &cobra.Command{
Use: "transfer",
Long: "transfer owner for token.",
Use: "transfer",
Short: "transfer owner for token.",
Example: fmt.Sprintf(
"$ %s tx token transfer <symbol>"+
"--to=<new-owner-address>"+
Expand Down