Methods

  • Accept a custom offer

    Parameters

    Returns Promise<IPlainTransactionObject>

    The interaction object of the smart contract

  • Bid on an auction

    Parameters

    • auctionID: number

      The auction ID

    • collection: string

      The NFT Collection

    • nonce: number

      The NFT nonce

    • payment: Payment

      The payment object

    • sender: WithSenderAndNonce

    Returns Promise<IPlainTransactionObject>

    The interaction object of the smart contract

  • Parameters

    • options: {
          auctionID: number;
          collection?: string;
          decimals?: number;
          isBid?: boolean;
          isBigUintPayment?: boolean;
          market?: string;
          nonce?: number;
          paymentAmount?: string;
          quantity?: number;
          sender: WithSenderAndNonce;
          token?: string;
          withCheck?: boolean;
      }

      An object containing the necessary parameters to buy an auction.

      • auctionID: number

        The unique identifier of the auction.

      • Optionalcollection?: string

        The collection the auctioned token belongs to (optional).

      • Optionaldecimals?: number
      • OptionalisBid?: boolean
      • OptionalisBigUintPayment?: boolean

        Whether the payment amount is a big integer (default is false).

      • Optionalmarket?: string
      • Optionalnonce?: number

        The nonce of the auctioned token (optional).

      • OptionalpaymentAmount?: string

        The payment amount for the auction (optional).

      • Optionalquantity?: number

        The quantity of tokens to buy (default is 1).

      • sender: WithSenderAndNonce
      • Optionaltoken?: string

        The payment token (default is 'EGLD').

      • OptionalwithCheck?: boolean

        Whether to check the auction information (default is true).

    Returns Promise<IPlainTransactionObject>

    The resulting interaction with the specified chainID and gas limit.

    This function allows a user to buy an auction by its auctionID. It takes an object with the following properties:

    • auctionID (number): The unique identifier of the auction.
    • collection (string, optional): The collection the auctioned token belongs to.
    • nonce (number, optional): The nonce of the auctioned token.
    • quantity (number, optional): The quantity of tokens to buy (default is 1).
    • token (string, optional): The payment token (default is 'EGLD').
    • paymentAmount (number, optional): The payment amount for the auction.
    • withCheck (boolean, optional): Whether to check the auction information (default is true).
    • isBigUintPayment (boolean, optional): Whether the payment amount is a big integer (default is false).

    The function first checks if the auction exists and if its type is NFT or SftOnePerPayment. If not, an error is thrown. Then, it calculates the payment amount and calls the buy method on the smart contract with the provided parameters. Finally, the function returns the resulting interaction with the specified chainID and gas limit.

    buyAuctionById

  • Parameters

    Returns Promise<IPlainTransactionObject>

    The resulting interaction with the specified chainID and gas limit.

    This function takes an array of ChangeListing objects and constructs Struct instances using the provided information. Each ChangeListing object should have the following properties:

    • paymentToken (string): The identifier of the payment token type.
    • price (BigInt): The new price for the listing.
    • auctionID (number): The unique identifier of the auction.
    • deadline (number): The deadline (in Unix time) for the listing.

    The function then calls the changeListing method on the smart contract and returns the resulting interaction with the specified chainID and gas limit.

    changeListing

  • Decline a custom offer

    Parameters

    Returns Promise<IPlainTransactionObject>

    The interaction object of the smart contract

  • Parameters

    • auctionID: number

      The unique identifier of the auction.

    • sender: WithSenderAndNonce
    • market: string = 'xoxno'

    Returns Promise<IPlainTransactionObject>

    The resulting interaction with the specified chainID and gas limit.

    This function allows ending an auction by its auctionID. It takes the following parameter:

    • auctionID (number): The unique identifier of the auction.

    The function calls the endAuction method on the smart contract with the provided auctionID. Finally, it returns the resulting interaction with the specified chainID and gas limit.

    endAuction

  • Retrieves the list of accepted payment tokens.

    Returns Promise<string[]>

    A list of accepted payment tokens.

  • Gets the active unique auction IDs of collection.

    Parameters

    • collection: string

      The collection identifier for which one wants to get the active unique auction IDs.

    Returns Promise<number[]>

    The active unique auction IDs of collection.

  • Returns the auction struct for the given id.

    Parameters

    • auctionID: number

      The id of the auction for which to return the data.

    Returns Promise<null | Auction>

    An object containing the auction data for the given id. If the auction id is invalid, the return value will be null.

  • Gets the on sale NFT count of the collection.

    Parameters

    • collection: string

      The collection identifier for which one wants to get the on sale NFT count.

    Returns Promise<number>

    The on sale NFT count of the collection.

  • Gets the number of collections listed.

    Returns Promise<number>

    The number of collections listed.

  • Returns the global offer data for the offer with the given id.

    Parameters

    • global_offer_id: number

      The id of the global offer for which to return the data.

    Returns Promise<GlobalOfferDoc>

    An object containing the global offer data for the offer with the given id. If the global offer id is invalid, the return value will be null.

  • This function returns a list of IDs of global offers.

    Returns Promise<number[]>

    a list of IDs of global offers.

  • Gets the number of global offers.

    Returns Promise<number>

    The number of global offers.

  • Gets the number of listings.

    Returns Promise<number>

    The number of listings.

  • Gets the percentage of each transaction that will be paid to the marketplace.

    Returns Promise<number>

    The percentage of each transaction that will be paid to the marketplace.

  • Gets the number of custom offers.

    Returns Promise<number>

    The number of custom offers.

  • Gets the balance of a user in a token of a specific pool.

    Parameters

    • address: string

      The address of the user.

    • token: string

      The token address.

    • nonce: number

      The nonce of the pool.

    Returns Promise<number>

    The balance of the user in the token of the pool.

  • Checks whether a collection is listed with at least 1 NFT.

    Parameters

    • collection: string

      name of the collection

    Returns Promise<boolean>

    true if the collection is listed, false otherwise

  • Withdraw auctions from the smart contract.

    Parameters

    • auctionIDs: {
          auctionIDs: number[];
          market?: string;
          sender: WithSenderAndNonce;
          signature?: string;
      }

      The IDs of the auctions to withdraw from

    Returns Promise<IPlainTransactionObject[]>

    The interaction object of the smart contract

  • Withdraws a custom offer

    Parameters

    Returns Promise<IPlainTransactionObject>

    The interaction object of the smart contract

  • Withdraw global offer from the smart contract.

    Parameters

    Returns Promise<IPlainTransactionObject>

    The interaction object of the smart contract