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

Implemented the whitelisting for the entire class #672

Merged
merged 10 commits into from
Oct 17, 2023
Merged
Show file tree
Hide file tree
Changes from 8 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
125 changes: 125 additions & 0 deletions docs/api.md
Original file line number Diff line number Diff line change
Expand Up @@ -70,14 +70,17 @@
- [Msg](#coreum.asset.ft.v1.Msg)

- [coreum/asset/nft/v1/event.proto](#coreum/asset/nft/v1/event.proto)
- [EventAddedToClassWhitelist](#coreum.asset.nft.v1.EventAddedToClassWhitelist)
- [EventAddedToWhitelist](#coreum.asset.nft.v1.EventAddedToWhitelist)
- [EventClassIssued](#coreum.asset.nft.v1.EventClassIssued)
- [EventFrozen](#coreum.asset.nft.v1.EventFrozen)
- [EventRemovedFromClassWhitelist](#coreum.asset.nft.v1.EventRemovedFromClassWhitelist)
- [EventRemovedFromWhitelist](#coreum.asset.nft.v1.EventRemovedFromWhitelist)
- [EventUnfrozen](#coreum.asset.nft.v1.EventUnfrozen)

- [coreum/asset/nft/v1/genesis.proto](#coreum/asset/nft/v1/genesis.proto)
- [BurntNFT](#coreum.asset.nft.v1.BurntNFT)
- [ClassWhitelistedAccounts](#coreum.asset.nft.v1.ClassWhitelistedAccounts)
- [FrozenNFT](#coreum.asset.nft.v1.FrozenNFT)
- [GenesisState](#coreum.asset.nft.v1.GenesisState)
- [WhitelistedNFTAccounts](#coreum.asset.nft.v1.WhitelistedNFTAccounts)
Expand All @@ -98,6 +101,8 @@
- [QueryBurntNFTsInClassResponse](#coreum.asset.nft.v1.QueryBurntNFTsInClassResponse)
- [QueryClassRequest](#coreum.asset.nft.v1.QueryClassRequest)
- [QueryClassResponse](#coreum.asset.nft.v1.QueryClassResponse)
- [QueryClassWhitelistedAccountsRequest](#coreum.asset.nft.v1.QueryClassWhitelistedAccountsRequest)
- [QueryClassWhitelistedAccountsResponse](#coreum.asset.nft.v1.QueryClassWhitelistedAccountsResponse)
- [QueryClassesRequest](#coreum.asset.nft.v1.QueryClassesRequest)
- [QueryClassesResponse](#coreum.asset.nft.v1.QueryClassesResponse)
- [QueryFrozenRequest](#coreum.asset.nft.v1.QueryFrozenRequest)
Expand All @@ -113,11 +118,13 @@

- [coreum/asset/nft/v1/tx.proto](#coreum/asset/nft/v1/tx.proto)
- [EmptyResponse](#coreum.asset.nft.v1.EmptyResponse)
- [MsgAddToClassWhitelist](#coreum.asset.nft.v1.MsgAddToClassWhitelist)
- [MsgAddToWhitelist](#coreum.asset.nft.v1.MsgAddToWhitelist)
- [MsgBurn](#coreum.asset.nft.v1.MsgBurn)
- [MsgFreeze](#coreum.asset.nft.v1.MsgFreeze)
- [MsgIssueClass](#coreum.asset.nft.v1.MsgIssueClass)
- [MsgMint](#coreum.asset.nft.v1.MsgMint)
- [MsgRemoveFromClassWhitelist](#coreum.asset.nft.v1.MsgRemoveFromClassWhitelist)
- [MsgRemoveFromWhitelist](#coreum.asset.nft.v1.MsgRemoveFromWhitelist)
- [MsgUnfreeze](#coreum.asset.nft.v1.MsgUnfreeze)
- [MsgUpdateParams](#coreum.asset.nft.v1.MsgUpdateParams)
Expand Down Expand Up @@ -1224,6 +1231,22 @@ Msg defines the Msg service.



<a name="coreum.asset.nft.v1.EventAddedToClassWhitelist"></a>

### EventAddedToClassWhitelist



| Field | Type | Label | Description |
| ----- | ---- | ----- | ----------- |
| `class_id` | [string](#string) | | |
| `account` | [string](#string) | | |






<a name="coreum.asset.nft.v1.EventAddedToWhitelist"></a>

### EventAddedToWhitelist
Expand Down Expand Up @@ -1281,6 +1304,22 @@ EventClassIssued is emitted on MsgIssueClass.



<a name="coreum.asset.nft.v1.EventRemovedFromClassWhitelist"></a>

### EventRemovedFromClassWhitelist



| Field | Type | Label | Description |
| ----- | ---- | ----- | ----------- |
| `class_id` | [string](#string) | | |
| `account` | [string](#string) | | |






<a name="coreum.asset.nft.v1.EventRemovedFromWhitelist"></a>

### EventRemovedFromWhitelist
Expand Down Expand Up @@ -1347,6 +1386,22 @@ EventClassIssued is emitted on MsgIssueClass.



<a name="coreum.asset.nft.v1.ClassWhitelistedAccounts"></a>

### ClassWhitelistedAccounts



| Field | Type | Label | Description |
| ----- | ---- | ----- | ----------- |
| `classID` | [string](#string) | | |
| `accounts` | [string](#string) | repeated | |






<a name="coreum.asset.nft.v1.FrozenNFT"></a>

### FrozenNFT
Expand Down Expand Up @@ -1376,6 +1431,7 @@ GenesisState defines the nftasset module's genesis state.
| `frozen_nfts` | [FrozenNFT](#coreum.asset.nft.v1.FrozenNFT) | repeated | |
| `whitelisted_nft_accounts` | [WhitelistedNFTAccounts](#coreum.asset.nft.v1.WhitelistedNFTAccounts) | repeated | |
| `burnt_nfts` | [BurntNFT](#coreum.asset.nft.v1.BurntNFT) | repeated | |
| `class_whitelisted_accounts` | [ClassWhitelistedAccounts](#coreum.asset.nft.v1.ClassWhitelistedAccounts) | repeated | |



Expand Down Expand Up @@ -1611,6 +1667,38 @@ QueryClassResponse is response type for the Query/Class RPC method.



<a name="coreum.asset.nft.v1.QueryClassWhitelistedAccountsRequest"></a>

### QueryClassWhitelistedAccountsRequest



| Field | Type | Label | Description |
| ----- | ---- | ----- | ----------- |
| `pagination` | [cosmos.base.query.v1beta1.PageRequest](#cosmos.base.query.v1beta1.PageRequest) | | pagination defines an optional pagination for the request. |
| `class_id` | [string](#string) | | |






<a name="coreum.asset.nft.v1.QueryClassWhitelistedAccountsResponse"></a>

### QueryClassWhitelistedAccountsResponse



| Field | Type | Label | Description |
| ----- | ---- | ----- | ----------- |
| `pagination` | [cosmos.base.query.v1beta1.PageResponse](#cosmos.base.query.v1beta1.PageResponse) | | pagination defines the pagination in the response. |
| `accounts` | [string](#string) | repeated | |






<a name="coreum.asset.nft.v1.QueryClassesRequest"></a>

### QueryClassesRequest
Expand Down Expand Up @@ -1783,6 +1871,7 @@ Query defines the gRPC querier service.
| `Frozen` | [QueryFrozenRequest](#coreum.asset.nft.v1.QueryFrozenRequest) | [QueryFrozenResponse](#coreum.asset.nft.v1.QueryFrozenResponse) | Frozen queries to check if an NFT is frozen or not. | GET|/coreum/asset/nft/v1/classes/{class_id}/nfts/{id}/frozen|
| `Whitelisted` | [QueryWhitelistedRequest](#coreum.asset.nft.v1.QueryWhitelistedRequest) | [QueryWhitelistedResponse](#coreum.asset.nft.v1.QueryWhitelistedResponse) | Whitelisted queries to check if an account is whitelited to hold an NFT or not. | GET|/coreum/asset/nft/v1/classes/{class_id}/nfts/{id}/whitelisted/{account}|
| `WhitelistedAccountsForNFT` | [QueryWhitelistedAccountsForNFTRequest](#coreum.asset.nft.v1.QueryWhitelistedAccountsForNFTRequest) | [QueryWhitelistedAccountsForNFTResponse](#coreum.asset.nft.v1.QueryWhitelistedAccountsForNFTResponse) | WhitelistedAccountsForNFT returns the list of accounts which are whitelisted to hold this NFT. | GET|/coreum/asset/nft/v1/classes/{class_id}/nfts/{id}/whitelisted|
| `ClassWhitelistedAccounts` | [QueryClassWhitelistedAccountsRequest](#coreum.asset.nft.v1.QueryClassWhitelistedAccountsRequest) | [QueryClassWhitelistedAccountsResponse](#coreum.asset.nft.v1.QueryClassWhitelistedAccountsResponse) | ClassWhitelistedAccounts returns the list of accounts which are whitelisted to hold NFTs in this class. | GET|/coreum/asset/nft/v1/classes/{class_id}/whitelisted|
| `BurntNFT` | [QueryBurntNFTRequest](#coreum.asset.nft.v1.QueryBurntNFTRequest) | [QueryBurntNFTResponse](#coreum.asset.nft.v1.QueryBurntNFTResponse) | BurntNFTsInClass checks if an nft if is in burnt NFTs list. | GET|/coreum/asset/nft/v1/classes/{class_id}/burnt/{nft_id}|
| `BurntNFTsInClass` | [QueryBurntNFTsInClassRequest](#coreum.asset.nft.v1.QueryBurntNFTsInClassRequest) | [QueryBurntNFTsInClassResponse](#coreum.asset.nft.v1.QueryBurntNFTsInClassResponse) | BurntNFTsInClass returns the list of burnt nfts in a class. | GET|/coreum/asset/nft/v1/classes/{class_id}/burnt|

Expand All @@ -1807,6 +1896,23 @@ Query defines the gRPC querier service.



<a name="coreum.asset.nft.v1.MsgAddToClassWhitelist"></a>

### MsgAddToClassWhitelist



| Field | Type | Label | Description |
| ----- | ---- | ----- | ----------- |
| `sender` | [string](#string) | | |
| `class_id` | [string](#string) | | |
| `account` | [string](#string) | | |






<a name="coreum.asset.nft.v1.MsgAddToWhitelist"></a>

### MsgAddToWhitelist
Expand Down Expand Up @@ -1903,6 +2009,23 @@ MsgMint defines message for the Mint method.



<a name="coreum.asset.nft.v1.MsgRemoveFromClassWhitelist"></a>

### MsgRemoveFromClassWhitelist



| Field | Type | Label | Description |
| ----- | ---- | ----- | ----------- |
| `sender` | [string](#string) | | |
| `class_id` | [string](#string) | | |
| `account` | [string](#string) | | |






<a name="coreum.asset.nft.v1.MsgRemoveFromWhitelist"></a>

### MsgRemoveFromWhitelist
Expand Down Expand Up @@ -1974,6 +2097,8 @@ Msg defines the Msg service.
| `Unfreeze` | [MsgUnfreeze](#coreum.asset.nft.v1.MsgUnfreeze) | [EmptyResponse](#coreum.asset.nft.v1.EmptyResponse) | Unfreeze removes the freeze effect already put on an NFT | |
| `AddToWhitelist` | [MsgAddToWhitelist](#coreum.asset.nft.v1.MsgAddToWhitelist) | [EmptyResponse](#coreum.asset.nft.v1.EmptyResponse) | AddToWhitelist sets the account as whitelisted to hold the NFT | |
| `RemoveFromWhitelist` | [MsgRemoveFromWhitelist](#coreum.asset.nft.v1.MsgRemoveFromWhitelist) | [EmptyResponse](#coreum.asset.nft.v1.EmptyResponse) | RemoveFromWhitelist removes an account from whitelisted list of the NFT | |
| `AddToClassWhitelist` | [MsgAddToClassWhitelist](#coreum.asset.nft.v1.MsgAddToClassWhitelist) | [EmptyResponse](#coreum.asset.nft.v1.EmptyResponse) | AddToClassWhitelist adds account as whitelist for all the NFTs in the class NOTE: class whitelist does not affect the individual nft whitelisting. | |
| `RemoveFromClassWhitelist` | [MsgRemoveFromClassWhitelist](#coreum.asset.nft.v1.MsgRemoveFromClassWhitelist) | [EmptyResponse](#coreum.asset.nft.v1.EmptyResponse) | RemoveFromClassWhitelist removes account as whitelist for the entire class NOTE: class whitelist does not affect the individual nft whitelisting. ie. if specific whitelist is granted for an NFT, that whitelist will still be valid, ater we add and remove it from the class whitelist. | |
| `UpdateParams` | [MsgUpdateParams](#coreum.asset.nft.v1.MsgUpdateParams) | [EmptyResponse](#coreum.asset.nft.v1.EmptyResponse) | UpdateParams is a governance operation that sets the parameters of the module. NOTE: all parameters must be provided. | |

<!-- end services -->
Expand Down
84 changes: 84 additions & 0 deletions docs/static/openapi.json
Original file line number Diff line number Diff line change
Expand Up @@ -752,6 +752,75 @@
]
}
},
"/coreum/asset/nft/v1/classes/{class_id}/whitelisted": {
"get": {
"operationId": "GithubComCoreumFoundationCoreumV3XAssetNftTypesClassWhitelistedAccounts",
"parameters": [
{
"name": "class_id",
"in": "path",
"required": true,
"type": "string"
},
{
"name": "pagination.key",
"description": "key is a value returned in PageResponse.next_key to begin\nquerying the next page most efficiently. Only one of offset or key\nshould be set.",
"in": "query",
"required": false,
"type": "string",
"format": "byte"
},
{
"name": "pagination.offset",
"description": "offset is a numeric offset that can be used when key is unavailable.\nIt is less efficient than using key. Only one of offset or key should\nbe set.",
"in": "query",
"required": false,
"type": "string",
"format": "uint64"
},
{
"name": "pagination.limit",
"description": "limit is the total number of results to be returned in the result page.\nIf left empty it will default to a value to be set by each app.",
"in": "query",
"required": false,
"type": "string",
"format": "uint64"
},
{
"name": "pagination.count_total",
"description": "count_total is set to true to indicate that the result set should include\na count of the total number of items available for pagination in UIs.\ncount_total is only respected when offset is used. It is ignored when key\nis set.",
"in": "query",
"required": false,
"type": "boolean"
},
{
"name": "pagination.reverse",
"description": "reverse is set to true if results are to be returned in the descending order.\n\nSince: cosmos-sdk 0.43",
"in": "query",
"required": false,
"type": "boolean"
}
],
"responses": {
"200": {
"description": "A successful response.",
"schema": {
"$ref": "#/definitions/coreum.asset.nft.v1.QueryClassWhitelistedAccountsResponse"
}
},
"default": {
"description": "An unexpected error response.",
"schema": {
"$ref": "#/definitions/google.rpc.Status"
}
}
},
"summary": "ClassWhitelistedAccounts returns the list of accounts which are whitelisted to hold NFTs in this class.",
"tags": [
"Query"
]
}
},
"/coreum/asset/nft/v1/classes/{id}": {
"get": {
"operationId": "GithubComCoreumFoundationCoreumV3XAssetNftTypesClass",
Expand Down Expand Up @@ -7152,6 +7221,21 @@
},
"description": "QueryClassResponse is response type for the Query/Class RPC method."
},
"coreum.asset.nft.v1.QueryClassWhitelistedAccountsResponse": {
"type": "object",
"properties": {
"pagination": {
"$ref": "#/definitions/cosmos.base.query.v1beta1.PageResponse",
"description": "pagination defines the pagination in the response."
},
"accounts": {
"type": "array",
"items": {
"type": "string"
}
}
}
},
"coreum.asset.nft.v1.QueryClassesResponse": {
"type": "object",
"properties": {
Expand Down
Loading
Loading