Marketplace
Calls
acceptOffer
Accepts an offer on a token Caller must be token owner
Namespace
api.tx.marketplace.acceptOfferType
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_assetfungible asset Id to receive payment withreserve_pricewinning bid must be over this thresholddurationlength of the auction (in blocks), uses default duration if unspecified
Namespace
api.tx.marketplace.auctionNftType
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
amountto bid (in the seller's requested payment asset)
Namespace
api.tx.marketplace.bidType
function bid(
listing_id: u128,
amount: u128
)buy
Buy a token listing for its specified price
Namespace
api.tx.marketplace.buyType
function buy(
listing_id: u128
)cancelOffer
Cancels an offer on a token Caller must be the offer buyer
Namespace
api.tx.marketplace.cancelOfferType
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
api.tx.marketplace.cancelSaleType
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
api.tx.marketplace.makeSimpleOfferType
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
api.tx.marketplace.registerMarketplaceType
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
api.tx.marketplace.sellNftType
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
api.tx.marketplace.setFeeToType
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
api.tx.marketplace.updateFixedPriceType
function updateFixedPrice(
listing_id: u128,
new_price: u128
)Storage
feeTo
The pallet id for the tx fee pot
Namespace
api.query.marketplace.feeToType
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
api.query.marketplace.listingEndScheduleType
function listingEndSchedule(
u32,
u128
): Option<bool>listings
NFT sale/auction listings keyed by listing id
Namespace
api.query.marketplace.listingsType
function listings(
u128
): Option<PalletMarketplaceListing>listingWinningBid
Winning bids on open listings.
Namespace
api.query.marketplace.listingWinningBidType
function listingWinningBid(
u128
): Option<(SeedPrimitivesSignatureAccountId20,u128)>nextListingId
The next available listing Id
Namespace
api.query.marketplace.nextListingIdType
function nextListingId(
): u128nextMarketplaceId
The next available marketplace id
Namespace
api.query.marketplace.nextMarketplaceIdType
function nextMarketplaceId(
): u32nextOfferId
The next available offer_id
Namespace
api.query.marketplace.nextOfferIdType
function nextOfferId(
): u64offers
Map from offer_id to the information related to the offer
Namespace
api.query.marketplace.offersType
function offers(
u64
): Option<PalletMarketplaceOfferType>openCollectionListings
Map from collection to any open listings
Namespace
api.query.marketplace.openCollectionListingsType
function openCollectionListings(
u32,
u128
): Option<bool>registeredMarketplaces
Map from marketplace account_id to royalties schedule
Namespace
api.query.marketplace.registeredMarketplacesType
function registeredMarketplaces(
u32
): Option<PalletMarketplaceMarketplace>tokenOffers
Maps from token_id to a vector of offer_ids on that token
Namespace
api.query.marketplace.tokenOffersType
function tokenOffers(
(u32,u32)
): Option<Vec<u64>>Events
AuctionClose
An auction has closed without selling
Namespace
api.events.marketplace.AuctionCloseType
type AuctionClose = {
collection_id: u32,
listing_id: u128,
reason: PalletMarketplaceAuctionClosureReason
}AuctionOpen
An auction has opened
Namespace
api.events.marketplace.AuctionOpenType
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
api.events.marketplace.AuctionSoldType
type AuctionSold = {
collection_id: u32,
listing_id: u128,
payment_asset: u32,
hammer_price: u128,
winner: SeedPrimitivesSignatureAccountId20
}Bid
A new highest bid was placed
Namespace
api.events.marketplace.BidType
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
api.events.marketplace.FeeToSetType
type FeeToSet = {
account: Option<SeedPrimitivesSignatureAccountId20>
}FixedPriceSaleClose
A fixed price sale has closed without selling
Namespace
api.events.marketplace.FixedPriceSaleCloseType
type FixedPriceSaleClose = {
collection_id: u32,
serial_numbers: Vec<u32>,
listing_id: u128,
reason: PalletMarketplaceFixedPriceClosureReason
}FixedPriceSaleComplete
A fixed price sale has completed
Namespace
api.events.marketplace.FixedPriceSaleCompleteType
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
api.events.marketplace.FixedPriceSaleListType
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
api.events.marketplace.FixedPriceSalePriceUpdateType
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
api.events.marketplace.MarketplaceRegisterType
type MarketplaceRegister = {
account: SeedPrimitivesSignatureAccountId20,
entitlement: Permill,
marketplace_id: u32
}Offer
An offer has been made on an NFT
Namespace
api.events.marketplace.OfferType
type Offer = {
offer_id: u64,
amount: u128,
asset_id: u32,
marketplace_id: Option<u32>,
buyer: SeedPrimitivesSignatureAccountId20
}OfferAccept
An offer has been accepted
Namespace
api.events.marketplace.OfferAcceptType
type OfferAccept = {
offer_id: u64,
token_id: (u32,u32),
amount: u128,
asset_id: u32
}OfferCancel
An offer has been cancelled
Namespace
api.events.marketplace.OfferCancelType
type OfferCancel = {
offer_id: u64,
token_id: (u32,u32)
}Errors
BidTooLow
Auction bid was lower than reserve or current highest bid
Namespace
api.errors.marketplace.BidTooLowInvalidMetadataPath
The metadata path is invalid (non-utf8 or empty)
Namespace
api.errors.marketplace.InvalidMetadataPathInvalidOffer
No offer exists for the given OfferId
Namespace
api.errors.marketplace.InvalidOfferIsTokenOwner
The caller owns the token and can't make an offer
Namespace
api.errors.marketplace.IsTokenOwnerMarketplaceNotRegistered
The account_id hasn't been registered as a marketplace
Namespace
api.errors.marketplace.MarketplaceNotRegisteredMaxOffersReached
The maximum number of offers on this token has been reached
Namespace
api.errors.marketplace.MaxOffersReachedMixedBundleSale
Selling tokens from different collection is not allowed
Namespace
api.errors.marketplace.MixedBundleSaleNoAvailableIds
No more Ids are available, they've been exhausted
Namespace
api.errors.marketplace.NoAvailableIdsNoCollectionFound
The collection does not exist
Namespace
api.errors.marketplace.NoCollectionFoundNotBuyer
The caller is not the specified buyer
Namespace
api.errors.marketplace.NotBuyerNotCollectionOwner
Origin is not the collection owner and is not permitted to perform the operation
Namespace
api.errors.marketplace.NotCollectionOwnerNotForAuction
The token is not listed for auction sale
Namespace
api.errors.marketplace.NotForAuctionNotForFixedPriceSale
The token is not listed for fixed price sale
Namespace
api.errors.marketplace.NotForFixedPriceSaleNoToken
The token does not exist
Namespace
api.errors.marketplace.NoTokenNotSeller
The caller is not the seller of the NFT
Namespace
api.errors.marketplace.NotSellerNotTokenOwner
Origin does not own the NFT
Namespace
api.errors.marketplace.NotTokenOwnerRoyaltiesInvalid
Total royalties would exceed 100% of sale or an empty vec is supplied
Namespace
api.errors.marketplace.RoyaltiesInvalidTokenLocked
Cannot operate on a listed NFT
Namespace
api.errors.marketplace.TokenLockedTokenNotListed
The token is not listed for sale
Namespace
api.errors.marketplace.TokenNotListedTokenOnAuction
Cannot make an offer on a token up for auction
Namespace
api.errors.marketplace.TokenOnAuctionZeroOffer
Offer amount needs to be greater than 0
Namespace
api.errors.marketplace.ZeroOfferConstants
defaultFeeTo
The default account which collects network fees from marketplace sales
Namespace
api.consts.marketplace.defaultFeeToType
type defaultFeeTo = Option<FrameSupportPalletId>defaultListingDuration
Default auction / sale length in blocks
Namespace
api.consts.marketplace.defaultListingDurationType
type defaultListingDuration = u32palletId
This pallet's Id, used for deriving a sovereign account ID
Namespace
api.consts.marketplace.palletIdType
type palletId = FrameSupportPalletId