| Crates.io | cw721-marketplace-permissioned |
| lib.rs | cw721-marketplace-permissioned |
| version | 0.1.7 |
| created_at | 2024-05-17 17:04:31.180095+00 |
| updated_at | 2024-09-12 19:10:27.570434+00 |
| description | A permissioned marketplace for swapping any cw721 NFTs available on the host network from any collection contract added by the contract admin to the permissioned list of NFT contracts |
| homepage | |
| repository | |
| max_upload_size | |
| id | 1243499 |
| size | 240,995 |
Permits the listing and offering on NFTs. This contract supports multiple NFT collections in a permissioned manner, allowing admin decision on which collections are allowed on the marketplace.
| Name | Type | Description |
|---|---|---|
| admin | String(Address) | Address allowed to do privileged messages |
| denom | String | Token denom for native token listings |
| cw721 | String(Address) Array | NFT Collections allowed in the marketplace |
| fee_percentage | u64 | Percentage fee cut, ie: 1 = 1% |
Create an offer or a sale for a specific NFT. Each type of listing has specific caveats that must be followed to meet the original design's user experience.
| Name | Type | Description |
|---|---|---|
| id | String | Created ID for the listing, cannot be a currently existing ID |
| cw721 | String(Address) | NFT contract, must be supported by the marketplace |
| payment_token | String(Address) | Optional cs20 address, defaults to aarch if empty |
| token_id | String | Nft token id |
| expires | Expiration | When the listing will expire |
| price | String(Uint128) | When a sale its the requested amount, when its an offer its the offered amount |
| swap_type | SwapType | The type of listing |
Finalize the listing. Permission to do this varies depending the listing type.
| Name | Type | Description |
|---|---|---|
| id | String | Listing ID |
Cancels the listing, can only be triggered by listing creator.
| Name | Type | Description |
|---|---|---|
| id | String | Listing ID |
Update the listing, can only be triggered by listing creator.
| Name | Type | Description |
|---|---|---|
| id | String | Listing ID |
| expires | Expiration | When the listing will expire |
| price | String(Uint128) | When a sale its the requested amount, when its an offer its the offered amount |
Updates the contract config set at instantiation.
| Name | Type | Description |
|---|---|---|
| admin | String(Address) | Address allowed to do privileged messages |
| denom | String | Token denom for native token listings |
| cw721 | String(Address) Array | NFT Collections allowed in the marketplace |
| fee_percentage | u64 | Percentage fee cut, ie: 1 = 1% |
Add an allowed NFT contract to be offered in the marketplace
| Name | Type | Description |
|---|---|---|
| cw721 | String(Address) | NFT collection to add |
Remove an allowed NFT contract from the marketplace
| Name | Type | Description |
|---|---|---|
| cw721 | String(Address) | NFT collection to withdraw |
Withdraw tokens earned by the contract through sale fees
| Name | Type | Description |
|---|---|---|
| amount | String(Number) | Amount to withdraw |
| denom | String | Native coin denom |
| payment_token | Optional String(Address) | Optional cw20 address to withdraw from |
Get all pending swaps
| Name | Type | Description |
|---|---|---|
| start_after | Optional String | Limit which ID to start after |
| limit | Optional number | Limit how many swaps to return |
Returns ListResponse
Count total listings, supports counting a specific type of listing, returns a number
| Name | Type | Description |
|---|---|---|
| swap_type | Optional SwapType | Swap type filter |
Returns a number representing total swaps
| Name | Type | Description |
|---|---|---|
| page | Optional number | Pagination |
| limit | Optional number | Limit how many results |
Returns a list of PageResult
| Name | Type | Description |
|---|---|---|
| page | Optional number | Pagination |
| limit | Optional number | Limit how many results |
Returns a list of PageResult
| Name | Type | Description |
|---|---|---|
| token_id | String | NFT ID |
| swap_type | Optional SwapType | Swap type filter |
| cw721 | Optional String(Address) | NFT collection filter |
| page | Optional number | Pagination |
| limit | Optional number | Limit how many results |
Returns a list of PageResult
| Name | Type | Description |
|---|---|---|
| address | String(Address) | Swaps created by a specific address |
| swap_type | Optional SwapType | Swap type filter |
| cw721 | Optional String(Address) | NFT collection filter |
| page | Optional number | Pagination |
| limit | Optional number | Limit how many results |
Returns a list of PageResult
| Name | Type | Description |
|---|---|---|
| min | Optional String(number) | Minimum price to return |
| max | Optional String(number) | Maximum price to return |
| swap_type | Optional SwapType | Swap type filter |
| cw721 | Optional String(Address) | NFT collection filter |
| page | Optional number | Pagination |
| limit | Optional number | Limit how many results |
Returns a list of PageResult
| Name | Type | Description |
|---|---|---|
| payment_token | Optional String(Address) | Filter by CW20 token |
| swap_type | Optional SwapType | Swap type filter |
| cw721 | Optional String(Address) | NFT collection filter |
| page | Optional number | Pagination |
| limit | Optional number | Limit how many results |
Returns a list of PageResult
| Name | Type | Description |
|---|---|---|
| cw20 | bool | Filter payment type |
| swap_type | Optional SwapType | Swap type filter |
| cw721 | Optional String(Address) | NFT collection filter |
| page | Optional number | Pagination |
| limit | Optional number | Limit how many results |
Returns a list of PageResult
Return the details of the specified listing
| Name | Type | Description |
|---|---|---|
| id | String | Listing ID |
| Name | Type | Description |
|---|---|---|
| creator | String(Address) | Listing creator |
| contract | String(Address) | NFT Collection |
| payment_token | Optional String(Address) | Cw20 token if applicable |
| token_id | String | NFT ID |
| expires | Expiration | Listing expiration date |
| price | String(Number) | Amount offered or requested |
| swap_types | SwapType | Listing type |
Query the contract's config, returns:
| Name | Type | Description |
|---|---|---|
| admin | String(Address) | Address allowed to do privileged messages |
| denom | String | Token denom for native token listings |
| cw721 | String(Address) Array | NFT Collections allowed in the marketplace |
| fee_percentage | u64 | Percentage fee cut, ie: 1 = 1% |
| Name | Type | Description |
|---|---|---|
| swaps | Array of CW721Swap | Query result |
| page | number | Current page |
| total | number | Total items present in contract |
| Name | Type | Description |
|---|---|---|
| swaps | String array | List of swap IDs |
| Name | Type | Description |
|---|---|---|
| id | String | Listing ID |
| creator | String(Address) | Creator address |
| nft_contract | String(Address) | NFT collection |
| payment_token | Optional String(Address) | CW20 contract |
| token_id | String | NFT ID |
| expires | Expiration | Listing expiration date |
| price | String(Number) | Requested or offered amount |
| swap_type | SwapType | Listing type |
When something can expire, the contents can be one of three. Source
Will expire when given height is greater or equal than the current block height
{
"at_height": 10
}
Will expire when given time is greater or equal than the current block height
{
"at_time": "epoch number"
}
Will never expire
"never"
Represents the type of transaction going through, can be one of Offer which is an offer to someone's NFT and Sale
which is a listing to sell an owned NFT