Calls
acceptOffer
Accepts an offer on a token Caller must be token owner
Namespace
Copy api.tx.marketplace.acceptOffer
Type
Copy function acceptOffer (
offer_id : u64
)
auctionNft
Auction a bundle of tokens on the open market to the highest bidder
Tokens must be from the same collection
Tokens with individual royalties schedules cannot be sold in bundles
Caller must be the token owner
payment_asset
fungible asset Id to receive payment with
reserve_price
winning bid must be over this threshold
duration
length of the auction (in blocks), uses default duration if unspecified
Namespace
Copy api.tx.marketplace.auctionNft
Type
Copy function auctionNft (
collection_id : u32 ,
serial_numbers : Vec < u32 > ,
payment_asset : u32 ,
reserve_price : u128 ,
duration : Option < u32 > ,
marketplace_id : Option < u32 >
)
bid
Place a bid on an open auction
amount
to bid (in the seller's requested payment asset)
Namespace
Copy api.tx.marketplace.bid
Type
Copy function bid (
listing_id : u128 ,
amount : u128
)
buy
Buy a token listing for its specified price
Namespace
Copy api.tx.marketplace.buy
Type
Copy function buy (
listing_id : u128
)
cancelOffer
Cancels an offer on a token Caller must be the offer buyer
Namespace
Copy api.tx.marketplace.cancelOffer
Type
Copy function cancelOffer (
offer_id : u64
)
cancelSale
Close a sale or auction returning tokens Requires no successful bids have been made for an auction. Caller must be the listed seller
Namespace
Copy api.tx.marketplace.cancelSale
Type
Copy function cancelSale (
listing_id : u128
)
makeSimpleOffer
Create an offer on a token Locks funds until offer is accepted, rejected or cancelled An offer can't be made on a token currently in an auction (This follows the behaviour of Opensea and forces the buyer to bid rather than create an offer)
Namespace
Copy api.tx.marketplace.makeSimpleOffer
Type
Copy function makeSimpleOffer (
token_id : (u32 , u32) ,
amount : u128 ,
asset_id : u32 ,
marketplace_id : Option < u32 >
)
registerMarketplace
Flag an account as a marketplace
marketplace_account
- if specified, this account will be registered entitlement
- Permill, percentage of sales to go to the marketplace If no marketplace is specified the caller will be registered
Namespace
Copy api.tx.marketplace.registerMarketplace
Type
Copy function registerMarketplace (
marketplace_account : Option < SeedPrimitivesSignatureAccountId20 > ,
entitlement : Permill
)
sellNft
Sell a bundle of tokens at a fixed price
Tokens must be from the same collection
Tokens with individual royalties schedules cannot be sold with this method
buyer
optionally, the account to receive the NFT. If unspecified, then any account may purchase asset_id
fungible asset Id to receive as payment for the NFT fixed_price
ask price duration
listing duration time in blocks from now Caller must be the token owner
Namespace
Copy api.tx.marketplace.sellNft
Type
Copy function sellNft (
collection_id : u32 ,
serial_numbers : Vec < u32 > ,
buyer : Option < SeedPrimitivesSignatureAccountId20 > ,
payment_asset : u32 ,
fixed_price : u128 ,
duration : Option < u32 > ,
marketplace_id : Option < u32 >
)
setFeeTo
Set the FeeTo
account This operation requires root access
Namespace
Copy api.tx.marketplace.setFeeTo
Type
Copy function setFeeTo (
fee_to : Option < SeedPrimitivesSignatureAccountId20 >
)
updateFixedPrice
Update fixed price for a single token sale
listing_id
id of the fixed price listing new_price
new fixed price Caller must be the token owner
Namespace
Copy api.tx.marketplace.updateFixedPrice
Type
Copy function updateFixedPrice (
listing_id : u128 ,
new_price : u128
)
Storage
feeTo
The pallet id for the tx fee pot
Namespace
Copy api.query.marketplace.feeTo
Type
Copy function feeTo (
) : Option < SeedPrimitivesSignatureAccountId20 >
listingEndSchedule
Block numbers where listings will close. Value is true
if at block number listing_id
is scheduled to close.
Namespace
Copy api.query.marketplace.listingEndSchedule
Type
Copy function listingEndSchedule (
u32 ,
u128
) : Option < bool >
listings
NFT sale/auction listings keyed by listing id
Namespace
Copy api.query.marketplace.listings
Type
Copy function listings (
u128
) : Option < PalletMarketplaceListing >
listingWinningBid
Winning bids on open listings.
Namespace
Copy api.query.marketplace.listingWinningBid
Type
Copy function listingWinningBid (
u128
) : Option <(SeedPrimitivesSignatureAccountId20 , u128)>
nextListingId
The next available listing Id
Namespace
Copy api.query.marketplace.nextListingId
Type
Copy function nextListingId (
) : u128
nextMarketplaceId
The next available marketplace id
Namespace
Copy api.query.marketplace.nextMarketplaceId
Type
Copy function nextMarketplaceId (
) : u32
nextOfferId
The next available offer_id
Namespace
Copy api.query.marketplace.nextOfferId
Type
Copy function nextOfferId (
) : u64
offers
Map from offer_id to the information related to the offer
Namespace
Copy api.query.marketplace.offers
Type
Copy function offers (
u64
) : Option < PalletMarketplaceOfferType >
openCollectionListings
Map from collection to any open listings
Namespace
Copy api.query.marketplace.openCollectionListings
Type
Copy function openCollectionListings (
u32 ,
u128
) : Option < bool >
registeredMarketplaces
Map from marketplace account_id to royalties schedule
Namespace
Copy api.query.marketplace.registeredMarketplaces
Type
Copy function registeredMarketplaces (
u32
) : Option < PalletMarketplaceMarketplace >
tokenOffers
Maps from token_id to a vector of offer_ids on that token
Namespace
Copy api.query.marketplace.tokenOffers
Type
Copy function tokenOffers (
(u32 , u32)
) : Option < Vec < u64 >>
Events
AuctionClose
An auction has closed without selling
Namespace
Copy api.events.marketplace.AuctionClose
Type
Copy type AuctionClose = {
collection_id : u32 ,
listing_id : u128 ,
reason : PalletMarketplaceAuctionClosureReason
}
AuctionOpen
An auction has opened
Namespace
Copy api.events.marketplace.AuctionOpen
Type
Copy type AuctionOpen = {
collection_id : u32 ,
serial_numbers : Vec < u32 > ,
payment_asset : u32 ,
reserve_price : u128 ,
listing_id : u128 ,
marketplace_id : Option < u32 > ,
seller : SeedPrimitivesSignatureAccountId20
}
AuctionSold
An auction has sold
Namespace
Copy api.events.marketplace.AuctionSold
Type
Copy type AuctionSold = {
collection_id : u32 ,
listing_id : u128 ,
payment_asset : u32 ,
hammer_price : u128 ,
winner : SeedPrimitivesSignatureAccountId20
}
Bid
A new highest bid was placed
Namespace
Copy api.events.marketplace.Bid
Type
Copy type Bid = {
collection_id : u32 ,
serial_numbers : Vec < u32 > ,
listing_id : u128 ,
amount : u128 ,
bidder : SeedPrimitivesSignatureAccountId20
}
FeeToSet
The network fee receiver address has been updated
Namespace
Copy api.events.marketplace.FeeToSet
Type
Copy type FeeToSet = {
account : Option < SeedPrimitivesSignatureAccountId20 >
}
FixedPriceSaleClose
A fixed price sale has closed without selling
Namespace
Copy api.events.marketplace.FixedPriceSaleClose
Type
Copy type FixedPriceSaleClose = {
collection_id : u32 ,
serial_numbers : Vec < u32 > ,
listing_id : u128 ,
reason : PalletMarketplaceFixedPriceClosureReason
}
FixedPriceSaleComplete
A fixed price sale has completed
Namespace
Copy api.events.marketplace.FixedPriceSaleComplete
Type
Copy type FixedPriceSaleComplete = {
collection_id : u32 ,
serial_numbers : Vec < u32 > ,
listing_id : u128 ,
price : u128 ,
payment_asset : u32 ,
buyer : SeedPrimitivesSignatureAccountId20 ,
seller : SeedPrimitivesSignatureAccountId20
}
FixedPriceSaleList
A fixed price sale has been listed
Namespace
Copy api.events.marketplace.FixedPriceSaleList
Type
Copy type FixedPriceSaleList = {
collection_id : u32 ,
serial_numbers : Vec < u32 > ,
listing_id : u128 ,
marketplace_id : Option < u32 > ,
price : u128 ,
payment_asset : u32 ,
seller : SeedPrimitivesSignatureAccountId20
}
FixedPriceSalePriceUpdate
A fixed price sale has had its price updated
Namespace
Copy api.events.marketplace.FixedPriceSalePriceUpdate
Type
Copy type FixedPriceSalePriceUpdate = {
collection_id : u32 ,
serial_numbers : Vec < u32 > ,
listing_id : u128 ,
new_price : u128
}
MarketplaceRegister
An account has been registered as a marketplace
Namespace
Copy api.events.marketplace.MarketplaceRegister
Type
Copy type MarketplaceRegister = {
account : SeedPrimitivesSignatureAccountId20 ,
entitlement : Permill ,
marketplace_id : u32
}
Offer
An offer has been made on an NFT
Namespace
Copy api.events.marketplace.Offer
Type
Copy type Offer = {
offer_id : u64 ,
amount : u128 ,
asset_id : u32 ,
marketplace_id : Option < u32 > ,
buyer : SeedPrimitivesSignatureAccountId20
}
OfferAccept
An offer has been accepted
Namespace
Copy api.events.marketplace.OfferAccept
Type
Copy type OfferAccept = {
offer_id : u64 ,
token_id : (u32 , u32) ,
amount : u128 ,
asset_id : u32
}
OfferCancel
An offer has been cancelled
Namespace
Copy api.events.marketplace.OfferCancel
Type
Copy type OfferCancel = {
offer_id : u64 ,
token_id : (u32 , u32)
}
Errors
BidTooLow
Auction bid was lower than reserve or current highest bid
Namespace
Copy api.errors.marketplace.BidTooLow
InvalidMetadataPath
The metadata path is invalid (non-utf8 or empty)
Namespace
Copy api.errors.marketplace.InvalidMetadataPath
InvalidOffer
No offer exists for the given OfferId
Namespace
Copy api.errors.marketplace.InvalidOffer
IsTokenOwner
The caller owns the token and can't make an offer
Namespace
Copy api.errors.marketplace.IsTokenOwner
MarketplaceNotRegistered
The account_id hasn't been registered as a marketplace
Namespace
Copy api.errors.marketplace.MarketplaceNotRegistered
MaxOffersReached
The maximum number of offers on this token has been reached
Namespace
Copy api.errors.marketplace.MaxOffersReached
MixedBundleSale
Selling tokens from different collection is not allowed
Namespace
Copy api.errors.marketplace.MixedBundleSale
NoAvailableIds
No more Ids are available, they've been exhausted
Namespace
Copy api.errors.marketplace.NoAvailableIds
NoCollectionFound
The collection does not exist
Namespace
Copy api.errors.marketplace.NoCollectionFound
NotBuyer
The caller is not the specified buyer
Namespace
Copy api.errors.marketplace.NotBuyer
NotCollectionOwner
Origin is not the collection owner and is not permitted to perform the operation
Namespace
Copy api.errors.marketplace.NotCollectionOwner
NotForAuction
The token is not listed for auction sale
Namespace
Copy api.errors.marketplace.NotForAuction
NotForFixedPriceSale
The token is not listed for fixed price sale
Namespace
Copy api.errors.marketplace.NotForFixedPriceSale
NoToken
The token does not exist
Namespace
Copy api.errors.marketplace.NoToken
NotSeller
The caller is not the seller of the NFT
Namespace
Copy api.errors.marketplace.NotSeller
NotTokenOwner
Origin does not own the NFT
Namespace
Copy api.errors.marketplace.NotTokenOwner
RoyaltiesInvalid
Total royalties would exceed 100% of sale or an empty vec is supplied
Namespace
Copy api.errors.marketplace.RoyaltiesInvalid
TokenLocked
Cannot operate on a listed NFT
Namespace
Copy api.errors.marketplace.TokenLocked
TokenNotListed
The token is not listed for sale
Namespace
Copy api.errors.marketplace.TokenNotListed
TokenOnAuction
Cannot make an offer on a token up for auction
Namespace
Copy api.errors.marketplace.TokenOnAuction
ZeroOffer
Offer amount needs to be greater than 0
Namespace
Copy api.errors.marketplace.ZeroOffer
Constants
defaultFeeTo
The default account which collects network fees from marketplace sales
Namespace
Copy api.consts.marketplace.defaultFeeTo
Type
Copy type defaultFeeTo = Option < FrameSupportPalletId >
defaultListingDuration
Default auction / sale length in blocks
Namespace
Copy api.consts.marketplace.defaultListingDuration
Type
Copy type defaultListingDuration = u32
palletId
This pallet's Id, used for deriving a sovereign account ID
Namespace
Copy api.consts.marketplace.palletId
Type
Copy type palletId = FrameSupportPalletId