Crates.io | cw721-marketplace-single-collection |
lib.rs | cw721-marketplace-single-collection |
version | 0.1.7 |
source | src |
created_at | 2024-05-17 17:12:33.674704 |
updated_at | 2024-09-12 19:11:32.503491 |
description | A marketplace for swapping cw721 NFTs of a single collection contract |
homepage | |
repository | |
max_upload_size | |
id | 1243505 |
size | 231,454 |
Permits the listing and offering on an NFT collection.
Name | Type | Description |
---|---|---|
admin | String(Address) | Address allowed to do privileged messages |
denom | String | Token denom for native token listings |
cw721 | String(Address) | NFT Collection 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 |
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) | NFT Collection allowed in the marketplace |
fee_percentage | u64 | Percentage fee cut, ie: 1 = 1% |
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 |
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 |
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 |
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 |
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 |
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 |
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) | NFT Collection 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 |
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