Options
All
  • Public
  • Public/Protected
  • All
Menu

Namespace Marketplace

Index

Type aliases

AccountListType: MarketplaceConfigAction.Noop | MarketplaceConfigAction.Remove | { set: string[] }
CommissionFeeType: MarketplaceConfigAction.Noop | MarketplaceConfigAction.Remove | Marketplace.SetFeeType
ListingFeeType: MarketplaceConfigAction.Noop | MarketplaceConfigAction.Remove | Marketplace.SetFeeType
MarketplaceDataType: { accountList: string[] | undefined; commissionFee: Marketplace.IFeeType | undefined; kind: string; listingFee: Marketplace.IFeeType | undefined; offchainData: string | undefined; owner: string }

Type declaration

OffchainDataType: MarketplaceConfigAction.Noop | MarketplaceConfigAction.Remove | { set: string }
SetFeeType: { set: RequireOnlyOne<Marketplace.IFeeType> }

Type declaration

Functions

  • buyNft(nft_id: number, keyring: IKeyringPair, waitUntil: WaitUntil): Promise<Events.NFTSoldEvent>
  • name

    buyNft

    summary

    Buys an NFT on a marketplace.

    Parameters

    • nft_id: number

      NFT Id of the NFT for sale.

    • keyring: IKeyringPair

      Account that will sign the transaction.

    • waitUntil: WaitUntil

      Execution trigger that can be set either to BlockInclusion or BlockFinalization.

    Returns Promise<Events.NFTSoldEvent>

    NFTSoldEvent Blockchain event.

  • buyNftTx(nft_id: number): Promise<`0x${string}`>
  • name

    buyNftTx

    summary

    Creates an unsigned unsubmitted Buy-NFT Transaction Hash.

    Parameters

    • nft_id: number

      NFT Id of the NFT for sale.

    Returns Promise<`0x${string}`>

    Unsigned unsubmitted Buy-NFT Transaction Hash. The Hash is only valid for 5 minutes.

  • name

    createMarketplace

    summary

    Creates a Marketplace on the chain.

    Parameters

    • kind: MarketplaceKind

      Kind of marketplace : It must be public or private.

    • keyring: IKeyringPair

      Account that will sign the transaction.

    • waitUntil: WaitUntil

      Execution trigger that can be set either to BlockInclusion or BlockFinalization.

    Returns Promise<Events.MarketplaceCreatedEvent>

    MarketplaceCreatedEvent Blockchain event.

  • createMarketplaceTx(kind: MarketplaceKind): Promise<`0x${string}`>
  • name

    createMarketplaceTx

    summary

    Creates an unsigned unsubmitted Create-Marketplace Transaction Hash.

    Parameters

    • kind: MarketplaceKind

      Kind of marketplace : It must be public or private.

    Returns Promise<`0x${string}`>

    Unsigned unsubmitted Create-Marketplace Transaction Hash. The Hash is only valid for 5 minutes.

  • getMarketplaceAccountSizeLimit(): Promise<number>
  • name

    getMarketplaceAccountSizeLimit

    summary

    The maximum number of accounts that can be stored inside the account list.

    Returns Promise<number>

    Number.

  • name

    getMarketplaceData

    summary

    Provides the data related to a marketplace.

    Parameters

    • marketplaceId: number

      The Markeplace id.

    Returns Promise<null | Marketplace.MarketplaceDataType>

    A JSON object with the marketplace data. ex:{owner, kind, accountList, (...)}

  • getMarketplaceMintFee(): Promise<BN>
  • name

    getMarketplaceMintFee

    summary

    Fee to mint a Marketplace. (extra fee on top of the tx fees).

    Returns Promise<BN>

    Marketplace mint fee.

  • getMarketplaceOffchainDataLimit(): Promise<number>
  • name

    getMarketplaceOffchainDataLimit

    summary

    Provides the maximum offchain data length.

    Returns Promise<number>

    Number.

  • getNextMarketplaceId(): Promise<number>
  • listNft(nft_id: number, marketplace_id: number, price: number | BN, keyring: IKeyringPair, waitUntil: WaitUntil): Promise<Events.NFTListedEvent>
  • name

    listNft

    summary

    Lists an NFT on a marketplace.

    Parameters

    • nft_id: number

      NFT Id of the NFT to be listed for sale.

    • marketplace_id: number

      Marketplace Id of the marketplace to list the NFT on.

    • price: number | BN

      Price of the NFT.

    • keyring: IKeyringPair

      Account that will sign the transaction.

    • waitUntil: WaitUntil

      Execution trigger that can be set either to BlockInclusion or BlockFinalization.

    Returns Promise<Events.NFTListedEvent>

    NFTListedEvent Blockchain event.

  • listNftTx(nft_id: number, marketplace_id: number, price: number | BN): Promise<`0x${string}`>
  • name

    listNftTx

    summary

    Creates an unsigned unsubmitted List-NFT Transaction Hash.

    Parameters

    • nft_id: number

      NFT Id of the NFT to be listed for sale.

    • marketplace_id: number

      Marketplace Id of the marketplace to list the NFT on.

    • price: number | BN

      Price of the NFT.

    Returns Promise<`0x${string}`>

    Unsigned unsubmitted List-NFT Transaction Hash. The Hash is only valid for 5 minutes.

  • name

    setMarketplaceConfiguration

    summary

    Set or Remove (Noop for No Operation) the marketplace parameters configuration : Commission fee, listing fee, the account list or any offchain datas.

    Each of the parameters of the marketplace, need one of the following type: Noop is set by default for each of the parameters. Noop : No Operation, nothing change. Removed : Current datas will be deleted. Set : Un object that update parameter value: Commission Fee and Listing Fee require a data type (flat or percentage) under format : { [MarketplaceConfigAction.Set]: { setFeeType: number || BN}} AccountList require an array of string: { [MarketplaceConfigAction.Set]: string[]} OffChainData require a string: { [MarketplaceConfigAction.Set]: string}

    Parameters

    • id: number

      Marketplace Id of the marketplace to update.

    • commissionFee: Marketplace.CommissionFeeType = MarketplaceConfigAction.Noop

      Commission when an NFT is sold on the marketplace : it can be set as flat (number) or as percentage. ex: { [MarketplaceConfigAction.Set]: { percentage: 10 } }

    • listingFee: Marketplace.ListingFeeType = MarketplaceConfigAction.Noop

      Fee when an NFT is added for sale to marketplace : it can be set as flat (number) or as percentage. ex: { [MarketplaceConfigAction.Set]: { flat: 5 } }

    • accountList: Marketplace.AccountListType = MarketplaceConfigAction.Noop

      A list of accounts : if the marketplace kind is private, it allows these accounts to sell NFT. If the marketplace kind is public, it bans these accounts from selling NFT.

    • offchainData: Marketplace.OffchainDataType = MarketplaceConfigAction.Noop

      Off-chain related marketplace metadata. Can be an IPFS Hash, an URL or plain text.

    • keyring: IKeyringPair

      Account that will sign the transaction.

    • waitUntil: WaitUntil

      Execution trigger that can be set either to BlockInclusion or BlockFinalization.

    Returns Promise<Events.MarketplaceConfigSetEvent>

    MarketplaceConfigSetEvent Blockchain event.

  • name

    setMarketplaceConfigurationTx

    summary

    Creates an unsigned unsubmitted Set-Marketplace-Configuration Transaction Hash.

    Each of the parameters of the marketplace, need one of the following type: Noop is set by default for each of the parameters. Noop : No Operation, nothing change. Removed : Current datas will be deleted. Set : Un object that update parameter value: Commission Fee and Listing Fee require a data type (flat or percentage) under format : { [MarketplaceConfigAction.Set]: { setFeeType: number || BN}} AccountList require an array of string: { [MarketplaceConfigAction.Set]: string[]} OffChainData require a string: { [MarketplaceConfigAction.Set]: string}

    Parameters

    • id: number

      Marketplace Id of the marketplace to update.

    • commissionFee: Marketplace.CommissionFeeType = MarketplaceConfigAction.Noop

      Commission when an NFT is sold on the marketplace : it can be set as flat (number) or as percentage. ex: { [MarketplaceConfigAction.Set]: { percentage: 10 } }

    • listingFee: Marketplace.ListingFeeType = MarketplaceConfigAction.Noop

      Fee when an NFT is added for sale to marketplace : it can be set as flat (number) or as percentage. ex: { [MarketplaceConfigAction.Set]: { flat: 5 } }

    • accountList: Marketplace.AccountListType = MarketplaceConfigAction.Noop

      A list of accounts : if the marketplace kind is private, it allows these accounts to sell NFT. If the marketplace kind is public, it bans these accounts from selling NFT.

    • offchainData: Marketplace.OffchainDataType = MarketplaceConfigAction.Noop

      Off-chain related marketplace metadata. Can be an IPFS Hash, an URL or plain text.

    Returns Promise<`0x${string}`>

    MarketplaceConfigSetEvent Blockchain event.

  • name

    setMarketplaceKind

    summary

    Set the new marketplace kind on the chain.

    Parameters

    • id: number
    • kind: MarketplaceKind

      Kind of marketplace : It must be public or private.

    • keyring: IKeyringPair

      Account that will sign the transaction.

    • waitUntil: WaitUntil

      Execution trigger that can be set either to BlockInclusion or BlockFinalization.

    Returns Promise<Events.MarketplaceKindSetEvent>

    MarketplaceKindSetEvent Blockchain event.

  • setMarketplaceKindTx(id: number, kind: MarketplaceKind): Promise<`0x${string}`>
  • name

    setMarketplaceKindTx

    summary

    Creates an unsigned unsubmitted Set-Marketplace-Kind Transaction Hash.

    Parameters

    • id: number
    • kind: MarketplaceKind

      Kind of marketplace : It must be public or private.

    Returns Promise<`0x${string}`>

    Unsigned unsubmitted Set-Marketplace-Kind Transaction Hash. The Hash is only valid for 5 minutes.

  • name

    setMarketplaceMintFee

    summary

    Set the new marketplace minting fee on the chain.

    Parameters

    • fee: number | BN

      Fee to mint a marketplace.

    • keyring: IKeyringPair

      Account that will sign the transaction.

    • waitUntil: WaitUntil

      Execution trigger that can be set either to BlockInclusion or BlockFinalization.

    Returns Promise<Events.MarketplaceMintFeeSetEvent>

    NFTSoldEvent Blockchain event.

  • setMarketplaceMintFeeTx(fee: number | BN): Promise<`0x${string}`>
  • name

    setMarketplaceMintFeeTx

    summary

    Creates an unsigned unsubmitted Set-Marketplace-Mint-Fee Transaction Hash.

    Parameters

    • fee: number | BN

      Fee to mint a marketplace.

    Returns Promise<`0x${string}`>

    Unsigned unsubmitted Set-Marketplace-Mint-Fee Transaction Hash. The Hash is only valid for 5 minutes.

  • name

    setMarketplaceOwner

    summary

    Set the new marketplace owner on the chain.

    Parameters

    • id: number

      Marketplace Id of the marketplace to be transferred.

    • recipient: string

      Adress of the new marketplace owner.

    • keyring: IKeyringPair

      Account that will sign the transaction.

    • waitUntil: WaitUntil

      Execution trigger that can be set either to BlockInclusion or BlockFinalization.

    Returns Promise<Events.MarketplaceOwnerSetEvent>

    MarketplaceOwnerSetEvent Blockchain event.

  • setMarketplaceOwnerTx(id: number, recipient: string): Promise<`0x${string}`>
  • name

    setMarketplaceOwnerTx

    summary

    Creates an unsigned unsubmitted Set-Marketplace-Owner Transaction Hash.

    Parameters

    • id: number

      Marketplace Id of the marketplace to be transferred.

    • recipient: string

      Adress of the new marketplace owner.

    Returns Promise<`0x${string}`>

    Unsigned unsubmitted Set-Marketplace-Owner Transaction Hash. The Hash is only valid for 5 minutes.

  • name

    unlistNft

    summary

    Unlists an NFT from a marketplace.

    Parameters

    • nft_id: number

      NFT Id of the NFT to be unlisted from sale.

    • keyring: IKeyringPair

      Account that will sign the transaction.

    • waitUntil: WaitUntil

      Execution trigger that can be set either to BlockInclusion or BlockFinalization.

    Returns Promise<Events.NFTUnlistedEvent>

    NFTUnlistedEvent Blockchain event.

  • unlistNftTx(nft_id: number): Promise<`0x${string}`>
  • name

    unlistNftTx

    summary

    Creates an unsigned unsubmitted Unlist-NFT Transaction Hash.

    Parameters

    • nft_id: number

      NFT Id of the NFT to be unlisted from sale.

    Returns Promise<`0x${string}`>

    Unsigned unsubmitted Unlist-NFT Transaction Hash. The Hash is only valid for 5 minutes.

Generated using TypeDoc