feat: generate nft protobuf (#9747)

<!--
The default pull request template is for types feat, fix, or refactor.
For other templates, add one of the following parameters to the url:
- template=docs.md
- template=other.md
-->

## Description

Generate nft protobuf, refer #9826.

<!-- Add a description of the changes that this PR introduces and the files that
are the most critical to review. -->

---

### Author Checklist

*All items are required. Please add a note to the item if the item is not applicable and
please add links to any relevant follow up issues.*

I have...

- [ ] included the correct [type prefix](https://github.com/commitizen/conventional-commit-types/blob/v3.0.0/index.json) in the PR title
- [ ] added `!` to the type prefix if API or client breaking change
- [ ] targeted the correct branch (see [PR Targeting](https://github.com/cosmos/cosmos-sdk/blob/master/CONTRIBUTING.md#pr-targeting))
- [ ] provided a link to the relevant issue or specification
- [ ] followed the guidelines for [building modules](https://github.com/cosmos/cosmos-sdk/blob/master/docs/building-modules)
- [ ] included the necessary unit and integration [tests](https://github.com/cosmos/cosmos-sdk/blob/master/CONTRIBUTING.md#testing)
- [ ] added a changelog entry to `CHANGELOG.md`
- [ ] included comments for [documenting Go code](https://blog.golang.org/godoc)
- [ ] updated the relevant documentation or specification
- [ ] reviewed "Files changed" and left comments if necessary
- [ ] confirmed all CI checks have passed

### Reviewers Checklist

*All items are required. Please add a note if the item is not applicable and please add
your handle next to the items reviewed if you only reviewed selected items.*

I have...

- [ ] confirmed the correct [type prefix](https://github.com/commitizen/conventional-commit-types/blob/v3.0.0/index.json) in the PR title
- [ ] confirmed `!` in the type prefix if API or client breaking change
- [ ] confirmed all author checklist items have been addressed 
- [ ] reviewed state machine logic
- [ ] reviewed API design and naming
- [ ] reviewed documentation is accurate
- [ ] reviewed tests and test coverage
- [ ] manually tested (if applicable)
This commit is contained in:
Zhiqiang Zhang
2021-08-31 11:10:44 +00:00
committed by GitHub
parent 2c31451a55
commit 6bddcd54bb
12 changed files with 8076 additions and 0 deletions
+509
View File
@@ -482,6 +482,43 @@
- [Query](#cosmos.mint.v1beta1.Query)
- [cosmos/nft/v1beta1/event.proto](#cosmos/nft/v1beta1/event.proto)
- [EventBurn](#cosmos.nft.v1beta1.EventBurn)
- [EventMint](#cosmos.nft.v1beta1.EventMint)
- [EventSend](#cosmos.nft.v1beta1.EventSend)
- [cosmos/nft/v1beta1/nft.proto](#cosmos/nft/v1beta1/nft.proto)
- [Class](#cosmos.nft.v1beta1.Class)
- [NFT](#cosmos.nft.v1beta1.NFT)
- [cosmos/nft/v1beta1/genesis.proto](#cosmos/nft/v1beta1/genesis.proto)
- [Entry](#cosmos.nft.v1beta1.Entry)
- [GenesisState](#cosmos.nft.v1beta1.GenesisState)
- [cosmos/nft/v1beta1/query.proto](#cosmos/nft/v1beta1/query.proto)
- [QueryBalanceRequest](#cosmos.nft.v1beta1.QueryBalanceRequest)
- [QueryBalanceResponse](#cosmos.nft.v1beta1.QueryBalanceResponse)
- [QueryClassRequest](#cosmos.nft.v1beta1.QueryClassRequest)
- [QueryClassResponse](#cosmos.nft.v1beta1.QueryClassResponse)
- [QueryClassesRequest](#cosmos.nft.v1beta1.QueryClassesRequest)
- [QueryClassesResponse](#cosmos.nft.v1beta1.QueryClassesResponse)
- [QueryNFTRequest](#cosmos.nft.v1beta1.QueryNFTRequest)
- [QueryNFTResponse](#cosmos.nft.v1beta1.QueryNFTResponse)
- [QueryNFTsOfClassRequest](#cosmos.nft.v1beta1.QueryNFTsOfClassRequest)
- [QueryNFTsOfClassResponse](#cosmos.nft.v1beta1.QueryNFTsOfClassResponse)
- [QueryOwnerRequest](#cosmos.nft.v1beta1.QueryOwnerRequest)
- [QueryOwnerResponse](#cosmos.nft.v1beta1.QueryOwnerResponse)
- [QuerySupplyRequest](#cosmos.nft.v1beta1.QuerySupplyRequest)
- [QuerySupplyResponse](#cosmos.nft.v1beta1.QuerySupplyResponse)
- [Query](#cosmos.nft.v1beta1.Query)
- [cosmos/nft/v1beta1/tx.proto](#cosmos/nft/v1beta1/tx.proto)
- [MsgSend](#cosmos.nft.v1beta1.MsgSend)
- [MsgSendResponse](#cosmos.nft.v1beta1.MsgSendResponse)
- [Msg](#cosmos.nft.v1beta1.Msg)
- [cosmos/params/v1beta1/params.proto](#cosmos/params/v1beta1/params.proto)
- [ParamChange](#cosmos.params.v1beta1.ParamChange)
- [ParameterChangeProposal](#cosmos.params.v1beta1.ParameterChangeProposal)
@@ -6970,6 +7007,478 @@ Query provides defines the gRPC querier service.
<a name="cosmos/nft/v1beta1/event.proto"></a>
<p align="right"><a href="#top">Top</a></p>
## cosmos/nft/v1beta1/event.proto
<a name="cosmos.nft.v1beta1.EventBurn"></a>
### EventBurn
EventBurn is emitted on Burn
| Field | Type | Label | Description |
| ----- | ---- | ----- | ----------- |
| `class_id` | [string](#string) | | |
| `id` | [string](#string) | | |
| `owner` | [string](#string) | | |
<a name="cosmos.nft.v1beta1.EventMint"></a>
### EventMint
EventMint is emitted on Mint
| Field | Type | Label | Description |
| ----- | ---- | ----- | ----------- |
| `class_id` | [string](#string) | | |
| `id` | [string](#string) | | |
| `owner` | [string](#string) | | |
<a name="cosmos.nft.v1beta1.EventSend"></a>
### EventSend
EventSend is emitted on Msg/Send
| Field | Type | Label | Description |
| ----- | ---- | ----- | ----------- |
| `class_id` | [string](#string) | | |
| `id` | [string](#string) | | |
| `sender` | [string](#string) | | |
| `receiver` | [string](#string) | | |
<!-- end messages -->
<!-- end enums -->
<!-- end HasExtensions -->
<!-- end services -->
<a name="cosmos/nft/v1beta1/nft.proto"></a>
<p align="right"><a href="#top">Top</a></p>
## cosmos/nft/v1beta1/nft.proto
<a name="cosmos.nft.v1beta1.Class"></a>
### Class
Class defines the class of the nft type.
| Field | Type | Label | Description |
| ----- | ---- | ----- | ----------- |
| `id` | [string](#string) | | |
| `name` | [string](#string) | | |
| `symbol` | [string](#string) | | |
| `description` | [string](#string) | | |
| `uri` | [string](#string) | | |
<a name="cosmos.nft.v1beta1.NFT"></a>
### NFT
NFT defines the nft.
| Field | Type | Label | Description |
| ----- | ---- | ----- | ----------- |
| `class_id` | [string](#string) | | |
| `id` | [string](#string) | | |
| `uri` | [string](#string) | | |
| `data` | [google.protobuf.Any](#google.protobuf.Any) | | |
<!-- end messages -->
<!-- end enums -->
<!-- end HasExtensions -->
<!-- end services -->
<a name="cosmos/nft/v1beta1/genesis.proto"></a>
<p align="right"><a href="#top">Top</a></p>
## cosmos/nft/v1beta1/genesis.proto
<a name="cosmos.nft.v1beta1.Entry"></a>
### Entry
Entry Defines all nft owned by a person
| Field | Type | Label | Description |
| ----- | ---- | ----- | ----------- |
| `owner` | [string](#string) | | |
| `nfts` | [NFT](#cosmos.nft.v1beta1.NFT) | repeated | |
<a name="cosmos.nft.v1beta1.GenesisState"></a>
### GenesisState
GenesisState defines the nft module's genesis state.
| Field | Type | Label | Description |
| ----- | ---- | ----- | ----------- |
| `classes` | [Class](#cosmos.nft.v1beta1.Class) | repeated | class defines the class of the nft type. |
| `entries` | [Entry](#cosmos.nft.v1beta1.Entry) | repeated | |
<!-- end messages -->
<!-- end enums -->
<!-- end HasExtensions -->
<!-- end services -->
<a name="cosmos/nft/v1beta1/query.proto"></a>
<p align="right"><a href="#top">Top</a></p>
## cosmos/nft/v1beta1/query.proto
<a name="cosmos.nft.v1beta1.QueryBalanceRequest"></a>
### QueryBalanceRequest
QueryBalanceRequest is the request type for the Query/Balance RPC method
| Field | Type | Label | Description |
| ----- | ---- | ----- | ----------- |
| `class_id` | [string](#string) | | |
| `owner` | [string](#string) | | |
<a name="cosmos.nft.v1beta1.QueryBalanceResponse"></a>
### QueryBalanceResponse
QueryBalanceResponse is the response type for the Query/Balance RPC method
| Field | Type | Label | Description |
| ----- | ---- | ----- | ----------- |
| `amount` | [uint64](#uint64) | | |
<a name="cosmos.nft.v1beta1.QueryClassRequest"></a>
### QueryClassRequest
QueryClassRequest is the request type for the Query/Class RPC method
| Field | Type | Label | Description |
| ----- | ---- | ----- | ----------- |
| `class_id` | [string](#string) | | |
<a name="cosmos.nft.v1beta1.QueryClassResponse"></a>
### QueryClassResponse
QueryClassResponse is the response type for the Query/Class RPC method
| Field | Type | Label | Description |
| ----- | ---- | ----- | ----------- |
| `class` | [Class](#cosmos.nft.v1beta1.Class) | | |
<a name="cosmos.nft.v1beta1.QueryClassesRequest"></a>
### QueryClassesRequest
QueryClassesRequest is the request type for the Query/Classes RPC method
| Field | Type | Label | Description |
| ----- | ---- | ----- | ----------- |
| `pagination` | [cosmos.base.query.v1beta1.PageRequest](#cosmos.base.query.v1beta1.PageRequest) | | pagination defines an optional pagination for the request. |
<a name="cosmos.nft.v1beta1.QueryClassesResponse"></a>
### QueryClassesResponse
QueryClassesResponse is the response type for the Query/Classes RPC method
| Field | Type | Label | Description |
| ----- | ---- | ----- | ----------- |
| `classes` | [Class](#cosmos.nft.v1beta1.Class) | repeated | |
| `pagination` | [cosmos.base.query.v1beta1.PageResponse](#cosmos.base.query.v1beta1.PageResponse) | | |
<a name="cosmos.nft.v1beta1.QueryNFTRequest"></a>
### QueryNFTRequest
QueryNFTRequest is the request type for the Query/NFT RPC method
| Field | Type | Label | Description |
| ----- | ---- | ----- | ----------- |
| `class_id` | [string](#string) | | |
| `id` | [string](#string) | | |
<a name="cosmos.nft.v1beta1.QueryNFTResponse"></a>
### QueryNFTResponse
QueryNFTResponse is the response type for the Query/NFT RPC method
| Field | Type | Label | Description |
| ----- | ---- | ----- | ----------- |
| `nft` | [NFT](#cosmos.nft.v1beta1.NFT) | | |
<a name="cosmos.nft.v1beta1.QueryNFTsOfClassRequest"></a>
### QueryNFTsOfClassRequest
QueryNFTsOfClassRequest is the request type for the Query/NFTsOfClass RPC method
| Field | Type | Label | Description |
| ----- | ---- | ----- | ----------- |
| `class_id` | [string](#string) | | |
| `owner` | [string](#string) | | |
| `pagination` | [cosmos.base.query.v1beta1.PageRequest](#cosmos.base.query.v1beta1.PageRequest) | | |
<a name="cosmos.nft.v1beta1.QueryNFTsOfClassResponse"></a>
### QueryNFTsOfClassResponse
QueryNFTsOfClassResponse is the response type for the Query/NFTsOfClass and Query/NFTsOfClassByOwner RPC methods
| Field | Type | Label | Description |
| ----- | ---- | ----- | ----------- |
| `nfts` | [NFT](#cosmos.nft.v1beta1.NFT) | repeated | |
| `pagination` | [cosmos.base.query.v1beta1.PageResponse](#cosmos.base.query.v1beta1.PageResponse) | | |
<a name="cosmos.nft.v1beta1.QueryOwnerRequest"></a>
### QueryOwnerRequest
QueryOwnerRequest is the request type for the Query/Owner RPC method
| Field | Type | Label | Description |
| ----- | ---- | ----- | ----------- |
| `class_id` | [string](#string) | | |
| `id` | [string](#string) | | |
<a name="cosmos.nft.v1beta1.QueryOwnerResponse"></a>
### QueryOwnerResponse
QueryOwnerResponse is the response type for the Query/Owner RPC method
| Field | Type | Label | Description |
| ----- | ---- | ----- | ----------- |
| `owner` | [string](#string) | | |
<a name="cosmos.nft.v1beta1.QuerySupplyRequest"></a>
### QuerySupplyRequest
QuerySupplyRequest is the request type for the Query/Supply RPC method
| Field | Type | Label | Description |
| ----- | ---- | ----- | ----------- |
| `class_id` | [string](#string) | | |
<a name="cosmos.nft.v1beta1.QuerySupplyResponse"></a>
### QuerySupplyResponse
QuerySupplyResponse is the response type for the Query/Supply RPC method
| Field | Type | Label | Description |
| ----- | ---- | ----- | ----------- |
| `amount` | [uint64](#uint64) | | |
<!-- end messages -->
<!-- end enums -->
<!-- end HasExtensions -->
<a name="cosmos.nft.v1beta1.Query"></a>
### Query
Query defines the gRPC querier service.
| Method Name | Request Type | Response Type | Description | HTTP Verb | Endpoint |
| ----------- | ------------ | ------------- | ------------| ------- | -------- |
| `Balance` | [QueryBalanceRequest](#cosmos.nft.v1beta1.QueryBalanceRequest) | [QueryBalanceResponse](#cosmos.nft.v1beta1.QueryBalanceResponse) | Balance queries the number of NFTs of a given class owned by the owner, same as balanceOf in ERC721 | GET|/cosmos/nft/v1beta1/balance/{class_id}/{owner}|
| `Owner` | [QueryOwnerRequest](#cosmos.nft.v1beta1.QueryOwnerRequest) | [QueryOwnerResponse](#cosmos.nft.v1beta1.QueryOwnerResponse) | Owner queries the owner of the NFT based on its class and id, same as ownerOf in ERC721 | GET|/cosmos/nft/v1beta1/owner/{class_id}/{id}|
| `Supply` | [QuerySupplyRequest](#cosmos.nft.v1beta1.QuerySupplyRequest) | [QuerySupplyResponse](#cosmos.nft.v1beta1.QuerySupplyResponse) | Supply queries the number of nft based on the class, same as totalSupply of ERC721 | GET|/cosmos/nft/v1beta1/supply/{class_id}|
| `NFTsOfClass` | [QueryNFTsOfClassRequest](#cosmos.nft.v1beta1.QueryNFTsOfClassRequest) | [QueryNFTsOfClassResponse](#cosmos.nft.v1beta1.QueryNFTsOfClassResponse) | NFTsOfClass queries all NFTs of a given class or optional owner, similar to tokenByIndex in ERC721Enumerable | GET|/cosmos/nft/v1beta1/nfts/{class_id}|
| `NFT` | [QueryNFTRequest](#cosmos.nft.v1beta1.QueryNFTRequest) | [QueryNFTResponse](#cosmos.nft.v1beta1.QueryNFTResponse) | NFT queries an NFT based on its class and id. | GET|/cosmos/nft/v1beta1/nfts/{class_id}/{id}|
| `Class` | [QueryClassRequest](#cosmos.nft.v1beta1.QueryClassRequest) | [QueryClassResponse](#cosmos.nft.v1beta1.QueryClassResponse) | Class queries an NFT class based on its id | GET|/cosmos/nft/v1beta1/classes/{class_id}|
| `Classes` | [QueryClassesRequest](#cosmos.nft.v1beta1.QueryClassesRequest) | [QueryClassesResponse](#cosmos.nft.v1beta1.QueryClassesResponse) | Classes queries all NFT classes | GET|/cosmos/nft/v1beta1/classes|
<!-- end services -->
<a name="cosmos/nft/v1beta1/tx.proto"></a>
<p align="right"><a href="#top">Top</a></p>
## cosmos/nft/v1beta1/tx.proto
<a name="cosmos.nft.v1beta1.MsgSend"></a>
### MsgSend
MsgSend represents a message to send a nft from one account to another account.
| Field | Type | Label | Description |
| ----- | ---- | ----- | ----------- |
| `class_id` | [string](#string) | | |
| `id` | [string](#string) | | |
| `sender` | [string](#string) | | |
| `receiver` | [string](#string) | | |
<a name="cosmos.nft.v1beta1.MsgSendResponse"></a>
### MsgSendResponse
MsgSendResponse defines the Msg/Send response type.
<!-- end messages -->
<!-- end enums -->
<!-- end HasExtensions -->
<a name="cosmos.nft.v1beta1.Msg"></a>
### Msg
Msg defines the nft Msg service.
| Method Name | Request Type | Response Type | Description | HTTP Verb | Endpoint |
| ----------- | ------------ | ------------- | ------------| ------- | -------- |
| `Send` | [MsgSend](#cosmos.nft.v1beta1.MsgSend) | [MsgSendResponse](#cosmos.nft.v1beta1.MsgSendResponse) | Send defines a method to send a nft from one account to another account. | |
<!-- end services -->
<a name="cosmos/params/v1beta1/params.proto"></a>
<p align="right"><a href="#top">Top</a></p>