diff --git a/docs/cli-client/nft.md b/docs/cli-client/nft.md index e4cc49939..f63876d78 100644 --- a/docs/cli-client/nft.md +++ b/docs/cli-client/nft.md @@ -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 @@ -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 | @@ -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 @@ -127,25 +127,31 @@ plugchaind q nft supply [class-id] --owner= [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 @@ -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] ``` \ No newline at end of file diff --git a/docs/zh/cli-client/nft.md b/docs/zh/cli-client/nft.md index 670b3cac6..9acac6163 100644 --- a/docs/zh/cli-client/nft.md +++ b/docs/zh/cli-client/nft.md @@ -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` 参数,来查看功能的描述和参数的含义 @@ -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 | 资产元数据 | 无 | @@ -116,7 +117,7 @@ plugchaind tx nft burn-nft [class-id] [nft-id] [flags] ## supply -根据 Class ID查询资产总量;接受可选的 --owner 参数。 +根据 class-id 查询资产总量;接受可选的 --owner 参数。 ```bash @@ -126,25 +127,32 @@ plugchaind q nft supply [class-id] --owner= [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 @@ -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] -``` diff --git a/x/nft/client/cli/query.go b/x/nft/client/cli/query.go index 4818b9b0b..076b86a98 100644 --- a/x/nft/client/cli/query.go +++ b/x/nft/client/cli/query.go @@ -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 ", version.AppName), Args: cobra.ExactArgs(1), RunE: func(cmd *cobra.Command, args []string) error { @@ -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 { @@ -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 ", version.AppName), Args: cobra.ExactArgs(2), RunE: func(cmd *cobra.Command, args []string) error { @@ -182,10 +182,16 @@ $ %s query %s nfts --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 ", 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 --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 { @@ -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
", version.AppName), Args: cobra.ExactArgs(2), RunE: func(cmd *cobra.Command, args []string) error { diff --git a/x/token/client/cli/query.go b/x/token/client/cli/query.go index 31ff81724..ba971d6ed 100644 --- a/x/token/client/cli/query.go +++ b/x/token/client/cli/query.go @@ -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 ", version.AppName), Args: cobra.ExactArgs(1), RunE: func(cmd *cobra.Command, args []string) error { @@ -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 { @@ -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 ", version.AppName), RunE: func(cmd *cobra.Command, args []string) error { clientCtx, err := client.GetClientQueryContext(cmd) @@ -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 ", version.AppName), RunE: func(cmd *cobra.Command, args []string) error { diff --git a/x/token/client/cli/tx.go b/x/token/client/cli/tx.go index 154d178e4..01179c2ad 100644 --- a/x/token/client/cli/tx.go +++ b/x/token/client/cli/tx.go @@ -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\" "+ @@ -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 "+ "--amount= "+ @@ -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 "+ "--name=\"Cat Token\" "+ @@ -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 "+ "--amount= "+ @@ -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 "+ "--to="+