Get the contract URI of the marketplace contract
Note: No parameter is needed for this method
Property Type Description Promise string The contract URI of the marketplace contract
TypeScript
const contractURI = await marketplaceSdk.getContractURI()
// Example contractURI: www.google.com
Get the marketplace contraction configuration information, including whether the contract fee is adjustable and whether the white list of lister addresses, nft and payment token addresses are enabled.
Note: No parameter is needed for this method
Field Type Description adjustableFee boolean This indicates whether the contract fee information could be modified by admin listerWhitelist boolean This indicates whether there should be a whitelist of lister wallet addresses when creating sale or auction in marketplace contract nftWhitelist boolean This indicates whether there should be a whitelist of nft addresses for sales or auctions paymentWhitelist boolean This indicates whether there should be a whitelist of payment addresses for sales or auctions
TypeScript
// adjustableFee: boolean flag that indicates whether contract fee can be modified
// listerWhitelist: boolean flag that indicates whether whitelist of lister is enabled
// nftWhitelist: boolean flag that indicates whether whitelist of nft is enabled
// paymentWhitelist: boolean flag that indicates whether whitelist of payment token is enabled
const {
adjustableFee,
listerWhitelist,
nftWhitelist,
paymentWhitelist
} = await marketplaceSdk.getContractOptions()
// Example:
// adjustableFee: true
// listerWhitelist: false
// nftWhitelist: false
// paymentWhitelist: false
Get the number of total auctions that have been created in the marketplace contract
Note: No parameter is needed for this method
Property Type Description Promise number Number of auctions stored inside the marketplace contract
TypeScript
const totalAuctions = await marketplaceSdk.getTotalAuctions()
// Example totalAuctions: {"type":"BigNumber","hex":"0x1"}
Get the number of total sales that have been created in the marketplace contract
Note: No parameter is needed for this method
Property Type Description Promise number Number of sales stored inside the marketplace contract
TypeScript
const totalSales = await marketplaceSdk.getTotalSales()
// Example totalSales: {"type":"BigNumber","hex":"0x1"}
Determine whether the payment token is on the payment token whitelist of marketplace contract if payment whitelist is enabled for the marketplace contract.
Argument Type Description paymentTokenAddress string Any crypto token addresses
Property Type Description Promise boolean Boolean value that indicates whether the provided paymentTokenAddress
is on the payment whitelist of the marketplace contract
TypeScript
const USDT = "0xdAC17F958D2ee523a2206206994597C13D831ec7"
const onPaymentlist = await marketplaceSdk.getPaymentWhitelist(USDT)
// Example onPaymentlist: true
Determine whether the nft contract address is on the nft whitelist of marketplace contract if nft whitelist is enabled for the marketplace contract
Argument Type Description nftAddress string Any nft contract addreses
Property Type Description Promise boolean Boolean value that indicates whether the provided nftAddress
is on the nft whitelist of the marketplace contract
TypeScript
const nftAddress = "0xb7F7F6C52F2e2fdb1963Eab30438024864c313F6"
const onNftList = await marketplaceSdk.getNftWhitelist(nftAddress)
// Example onNftList: true
Get the basic sale information from the marketplace contract given the saleId.
Argument Type Description saleId string The id of the sale in the marketplace contract
Field Type Description seller string The creator address of the sale contractAddress string The nft contract address tokenId BigNumber The nftId of the nft under the contractAddress
startTime BigNumber The unix timestamp of the start time of the sale endTime BigNumber The unix timestamp of the end time of the sale paymentToken string The address of the crypto token address that could be used to purchase nft on the sale price BigNumber The price of the nft tokenType TokenType An enum with either 0 or 1 as the value. 0 represents ERC721, while 1 represents ERC1155 contractAddress amount BigNumber The total amount of the nft on the sale purchasedAmount BigNumber The amount of the nft has been purchased reclaimed boolean Boolean value that indicates whether the sale has been ended
TypeScript
const sale = await marketplaceSdk.getSale("1")
// Example Sale:
// {
// seller: "0xf39Fd6e51aad88F6F4ce6aB8827279cffFb92266",
// contractAddress: "0xD99984e1D6AcB5471681ba4E070F19a9c29B7844",
// tokenId: {"type":"BigNumber","hex":"0x1"},
// startTime: {"type":"BigNumber","hex":"0x641a362a"},
// endTime: {"type":"BigNumber","hex":"0x644314aa"},
// paymentToken: "0xac17f958d2ee523a2206206994597c13d831ec7",
// price: {"type":"BigNumber","hex":"0x6"}
// tokenType: 1
// amount: {"type":"BigNumber","hex":"0xa"}
// purchasedAmount: {"type":"BigNumber","hex":"0x0"}
// reclaimed: false
// }
Get the basic auction information from the marketplace contract given the auctionId
.
Argument Type Description auctionId string The id of auction in the marketplace contract
Field Type Description seller string The creator address of the sale contractAddress string The nft contract address tokenId BigNumber The nftId of the nft under the contractAddress
startTime BigNumber The unix timestamp of the start time of the sale endTime BigNumber The unix timestamp of the end time of the sale paymentToken string The address of the crypto token address that could be used to purchase nft on the sale minimumPrice BigNumber The minimum price bidders can bid on the auction maximumPrice BigNumber The maximum price bidders can bid on the auction tokenType TokenType An enum with either 0 or 1 as the value. 0 represents ERC721, while 1 represents ERC1155 contractAddress amount string The amount of nft to be sold.
TypeScript
const auction = await marketplaceSd.getAuction('1')
// Example auction:
// {
// seller: "0xf39Fd6e51aad88F6F4ce6aB8827279cffFb92266",
// contractAddress: "0xD99984e1D6AcB5471681ba4E070F19a9c29B7844",
// tokenId: {"type":"BigNumber","hex":"0x1"},
// startTime: {"type":"BigNumber","hex":"0x641a362a"},
// endTime: {"type":"BigNumber","hex":"0x644314aa"},
// paymentToken: "0xac17f958d2ee523a2206206994597c13d831ec7",
// minimumPrice: {"type":"BigNumber","hex":"0x1"},
// maximumPrice: {"type":"BigNumber","hex":"0x64"},
// tokenType: 1
// amount: {"type":"BigNumber","hex":"0x2"}
// }
Get the top bid information from the marketplace contract given the auctionId
Argument Type Description auctionId string the id of the auction in the marketplace contract
Field Type Description auctionId BigNumber The id of the auction price BigNumber The price of the nft on auction bidder string The wallet address of the bidder
TypeScript
const {
auctionId,
price,
bidder
} = await marketplaceSdk.getTopBid("1")
// Example:
// auctionId: {"type":"BigNumber","hex":"0x1"}
// price: {"type":"BigNumber","hex":"0x1"}
// bidder: "0x70997970C51812dc3A010C7d01b50e0d17dc79C8"
Get the listing fee amount of the marketplace contract
Note: No parameter is needed for this method
Property Type Description Promise BigNumber The listing fee of the marketplace contract
TypeScript
const listingFee = await marketplaceSdk.getListingFee()
// Example listingFee:
// {"type":"BigNumber","hex":"0x1"}
Get the listing fee token address of the marketplace contract
Note: No parameter is needed for this method
Property Type Description Promise string The token address of the listing fee token
TypeScript
const listingToken = await marketplaceSdk.getListingFeeToken()
// Example listingToken: "0xdac17f958d2ee523a2206206994597c13d831ec7"
Get the fulfillmentFeeBPS
of the marketplace contract
Note: No parameter is needed for this method
Property Type Description Promise BigNumber The parameter to calculate the fulfillment fee of the marketplace contract
TypeScript
const fulfillmentFeeBPS = await marketplaceSdk.getFulfillmentFeeBPS()
// Example fulfillmentFeeBPS: {"type":"BigNumber","hex":"0xa"}
Get the feeReceiver
of the marketplace contract
Note: No parameter is needed for this method
Property Type Description Promise string The wallet address of the feeReceiver
of the marketplace contract
TypeScript
const feeReceiver = await marketplaceSdk.getFeeReceiver()
// Example feeReceiver: "0x3C44CdDdB6a900fa2b585dd299e03d12FA4293BC"
Get the list of recent sales and auctions from the marketplace contract
Note: No parameter is needed for this method
Field Type Description logs (Sale | Auction)[] List of sale and auction objects
Field Type Description blockNumber number The block number where the sale event happens saleEvent string An enum value of 0 (SaleCreated
), 1 (SaleModified
), 2 (SaleCancelled
), 3 (SalePurchased
), 4 (SaleReclaimed
) saleId string The id of the sale seller string The creator of the sale contractAddress string The nft contract address of the sale tokenId string The nftId of the nft startTime string The Unix timestamp of startTime of the sale endTime string The Unix timestamp of endTime of the sale paymentToken string The address of the crypto token that could be used to purchase the nft on sale price string The price of the nft in terms of the paymentToken tokenType string An enum value of 0 (ERC721
), 1 (ERC1155
) which represents the type of nft on the sale amount string The total amount of the nft on the sale purchasedAmount string The purchased amount of nft on the sale purchasedInTransaction string | null The amount that was bought in the transaction reclaimed boolean Boolean value that indicates whether the sale has been cancelled
Field Type Description blockNumber number The block number where the auction event happens auctionEvent string An enum value of 0(AuctionCreated)
, 1(AuctionModified)
, 2(AuctionCancelled)
, 3(AuctionBid)
, 4(AuctionFulfilled)
auctionId string The id of the auction seller string The creator of the auction contractAddress string The nft contract address of the auction tokenId string The nftId of the nft under the contractAddress
startTime string The Unix timestamp of the start time of the auction endTime string The Unix timestamp of the end time of the auction paymentToken string The address of the crypto token that could be used to purchase the nft minimumPrice string The minimum price the bidder can bid on the auction maximumPrice string The maximum price the bidder can bid on the auction tokenType string An enum value of 0(ERC721
), 1(ERC1155
) which represents the type of nft on the auction amount string The total amount of the nft on the auction fulfilled boolean Boolean value that indicates whether the nft on the auction is claimed Bid BidObject The information of the top bid
Field Type Description blockNumber number The block number where the top bid of the auction happens price string The bid price from the bidder bidder string The wallet address of the bidder of the auction
TypeScript
const auctionsAndSales = await marketplaceSdk.getAuctionsAndSales()
// Example auctionsAndSales:
// [
// {
// blockNumber: 3206550,
// saleEvent: 0,
// SaleId: '1'
// seller: "0xf39Fd6e51aad88F6F4ce6aB8827279cffFb92266",
// contractAddress: "0x57f1887a8BF19b14fC0dF6Fd9B2acc9Af147eA85",
// tokenId: "1",
// startTime: "1678908456",
// endTime: "1678909456",
// paymentToken: "0x0000000000000000000000000000000000000000",
// price: "2",
// tokenType: 0,
// amount: 1,
// purchasedAmount: 0,
// purchasedInTransaction: 0,
// reclaimed: false
// },
// {
// blockNumber: 3206550,
// auctionEvent: 0,
// auctionId: '1',
// seller: "0xf39Fd6e51aad88F6F4ce6aB8827279cffFb92266"
// contractAddress: "0x57f1887a8BF19b14fC0dF6Fd9B2acc9Af147eA85",
// tokenId: "2",
// startTime: "1678908456",
// endTime: "0x0000000000000000000000000000000000000000",
// paymentToken: "0x0000000000000000000000000000000000000000",
// minimumPrice: "1",
// maximumPrice: "100",
// tokenType: 0,
// amount: 1,
// fulfilled: false,
// bidCount: 2,
// bid:
// {
// blockNumber: 3206561,
// price: "3",
// bidder: "0x90F79bf6EB2c4f870365E785982E1f101E93b906"
// }
// }
//]
Get all of the sales and auctions from the marketplace contract
Note: No parameter is needed for this method
Field Type Description logs (Sale | Auction)[] List of sale and auction objects
Field Type Description blockNumber number The block number where the sale event happens saleEvent string An enum value of 0(SaleCreated)
, 1 (SaleModified)
, 2(SaleCancelled)
, 3(SalePurchased)
, 4(SaleReclaimed)
saleId string The id of the sale seller string The creator of the sale contractAddress string The nft contract address of the sale tokenId string The nftId of the nft startTime string The Unix timestamp of startTime of the sale endTime string The Unix timestamp of endTime of the sale paymentToken string The address of the crypto token that could be used to purchase the nft on sale price string The price of the nft in terms of the paymentToken tokenType string An enum value of 0(ERC721
), 1(ERC1155
) which represents the type of nft on the sale amount string The total amount of the nft on the sale purchasedAmount string The purchased amount of nft on the sale purchasedInTransaction string | null The amount that was bought in the transaction reclaimed boolean Boolean value that indicates whether the sale has been cancelled
Field Type blockNumber number The block number where the sale event happens auctionEvent string An enum value of 0(AuctionCreated)
, 1(AuctionModified)
, 2(AuctionCancelled)
, 3(AuctionBid)
, 4(AuctionFulfilled)
auctionId string The id of the auction seller string The address of auction creator contractAddress string The nft contract address tokenId string The nftId under the nft contract address startTime string The Unix timestamp of the start time of the auction endTime string The Unix timestamp of the end time of the auction paymentToken string The address of the crypto token that could be used to purchase the nft minimumPrice string The minimum price the bidder can bid on the auction maximumPrice string The maximum price the bidder can bid on the auction tokenType string An enum value of 0(ERC721
), 1(ERC1155
) which represents the type of nft on the auction amount string The total amount of nft to be sold on the sale fulfilled boolean Boolean value that indicates whether the nft on the auction is claimed Bid BidObject The information of the top bid
Field Type Description blockNumber number The block number where the top bid of the auction happens price string The bid price from the bidder bidder string The wallet address of the bidder of the auction
TypeScript
const allSalesAndAuctions = await marketplaceSdk.getAllEvents()
// Example allSalesAndAuctions:
// [
// {
// blockNumber: 3206550,
// saleEvent: 0,
// SaleId: '1'
// seller: "0xf39Fd6e51aad88F6F4ce6aB8827279cffFb92266",
// contractAddress: "0x57f1887a8BF19b14fC0dF6Fd9B2acc9Af147eA85",
// tokenId: "1",
// startTime: "1678908456",
// endTime: "1678909456",
// paymentToken: "0x0000000000000000000000000000000000000000",
// price: "2",
// tokenType: 0,
// amount: 1,
// purchasedAmount: 0,
// purchasedInTransaction: 0,
// reclaimed: false
// },
// {
// blockNumber: 3206550,
// auctionEvent: 0,
// auctionId: '1',
// seller: "0xf39Fd6e51aad88F6F4ce6aB8827279cffFb92266"
// contractAddress: "0x57f1887a8BF19b14fC0dF6Fd9B2acc9Af147eA85",
// tokenId: "2",
// startTime: "1678908456",
// endTime: "0x0000000000000000000000000000000000000000",
// paymentToken: "0x0000000000000000000000000000000000000000",
// minimumPrice: "1",
// maximumPrice: "100",
// tokenType: 0,
// amount: 1,
// fulfilled: false,
// bidCount: 2,
// bid:
// {
// blockNumber: 3206561,
// price: "3",
// bidder: "0x90F79bf6EB2c4f870365E785982E1f101E93b906"
// }
// }
//]
Get all of the sales from the marketplace contract
Note: No parameter is needed for this method
Field Type Description logs Sale[] List of sales
Field Type Description blockNumber number The block number where the sale event happened saleEvent string An enum value of 0(SaleCreated)
, 1 (SaleModified)
, 2(SaleCancelled)
, 3(SalePurchased)
, 4(SaleReclaimed)
saleId string The Id of the sale seller string The address of the sale creator contractAddress string The nft contract address of the sale tokenId string The nftId of the nft startTime string The Unix timestamp of startTime of the sale endTime string The Unix timestamp of endTime of the sale paymentToken string The address of the crypto token that could be used to purchase the nft on sale price string The price of the nft in terms of the paymentToken tokenType string An enum value of 0(ERC721
), 1(ERC1155
) which represents the type of nft on the sale amount string The total amount of the nft on the sale purchasedAmount string The purchased amount of nft on the sale purchasedInTransaction string | null The amount that was bought in the transaction reclaimed boolean Boolean value that indicates whether the sale has been cancelled
TypeScript
const allSales = await marketplaceSdk.getAllSales()
// Example allSales:
// [
// {
// blockNumber: 3206550,
// saleEvent: 0,
// SaleId: '1'
// seller: "0xf39Fd6e51aad88F6F4ce6aB8827279cffFb92266",
// contractAddress: "0x57f1887a8BF19b14fC0dF6Fd9B2acc9Af147eA85",
// tokenId: "1",
// startTime: "1678908456",
// endTime: "1678909456",
// paymentToken: "0x0000000000000000000000000000000000000000",
// price: "2",
// tokenType: 0,
// amount: 1,
// purchasedAmount: 0,
// purchasedInTransaction: 0,
// reclaimed: false
// }
//]
Get all of the auctions from the marketplace contract
Note: No parameter is needed for this method
Field Type Description logs Auction[] List of auctions
Field Type Description blockNumber number The block number where the auction event happens auctionEvent string An enum value of 0(AuctionCreated)
, 1(AuctionModified)
, 2(AuctionCancelled)
, 3(AuctionBid)
, 4(AuctionFulfilled)
auctionId string The id of the auction seller string The creator of the auction contractAddress string The nft contract address of the auction tokenId string The nftId of the nft under the contractAddress
startTime string The Unix timestamp of startTime of the sale endTime string The Unix timestamp of endTime of the sale paymentToken string The address of the crypto token that could be used to purchase the nft on sale minimumPrice string The minimum price the bidder can bid on the auction maximumPrice string The maximum price the bidder can bid on the auction tokenType string An enum value of 0(ERC721
), 1(ERC1155
) which represents the type of the nft on auction amount string The total amount of the nft on the auction fulfilled boolean Boolean value that indicates whether the nft on the auction is claimed Bid BidObject The information of the top bid
Field Type Description blockNumber number The block number where the top bid of the auction happens price string The bid price from the bidder bidder string The wallet address of the bidder of the auctio
TypeScript
const allAuctions = await marketplaceSdk.getAllAuctions();
// Example allAuctions:
//[
// {
// blockNumber: 3206550,
// auctionEvent: 0,
// auctionId: '1',
// seller: "0xf39Fd6e51aad88F6F4ce6aB8827279cffFb92266"
// contractAddress: "0x57f1887a8BF19b14fC0dF6Fd9B2acc9Af147eA85",
// tokenId: "2",
// startTime: "1678908456",
// endTime: "0x0000000000000000000000000000000000000000",
// paymentToken: "0x0000000000000000000000000000000000000000",
// minimumPrice: "1",
// maximumPrice: "100",
// tokenType: 0,
// amount: 1,
// fulfilled: false,
// bidCount: 2,
// bid:
// {
// blockNumber: 3206561,
// price: "3",
// bidder: "0x90F79bf6EB2c4f870365E785982E1f101E93b906"
// }
// }
//]
Get the list of the single sale from the marketplace contract given the saleId
Argument Type Description saleId string The Id of the sale
Field Type Description logs Sale[] List that contains the single sale specified by saleId
Field Type Description blockNumber number The block number where the sale event happens saleEvent string An enum value of 0(SaleCreated)
, 1 (SaleModified)
, 2(SaleCancelled)
, 3(SalePurchased)
, 4(SaleReclaimed)
saleId string The id of the sale seller string The creator of the sale contractAddress string The nft contract address tokenId string The nftId under the nft contract address startTime string The Unix timestamp of the start time of the sale endTime string The Unix timestamp of endTime of the sale paymentToken string The address of the crypto token that could be used to purchase the nft on sale price string The price of the nft in terms of paymentToken
tokenType string An enum value of 0(ERC721
), 1(ERC1155
) which represents the type of nft on the sale amount string The total amount of the nft on the sale purchasedAmount string The purchased amount of nft on the sale purchasedInTransaction string | null The amount that was bought in the transaction reclaimed boolean Boolean value that indicates whether the sale has been cancelled
TypeScript
const [singleSale] = await marketplaceSdk.getSingleSale("1")
// Example singleSale:
// {
// blockNumber: 3206550,
// auctionEvent: 0,
// auctionId: '1',
// seller: "0xf39Fd6e51aad88F6F4ce6aB8827279cffFb92266"
// contractAddress: "0x57f1887a8BF19b14fC0dF6Fd9B2acc9Af147eA85",
// tokenId: "2",
// startTime: "1678908456",
// endTime: "0x0000000000000000000000000000000000000000",
// paymentToken: "0x0000000000000000000000000000000000000000",
// minimumPrice: "1",
// maximumPrice: "100",
// tokenType: 0,
// amount: 1,
// fulfilled: false,
// bidCount: 2,
// bid:
// {
// blockNumber: 3206561,
// price: "3",
// bidder: "0x90F79bf6EB2c4f870365E785982E1f101E93b906"
// }
// }
Get the list of the single auction from the marketplace contract given the auctionId
Argument Type Description auctionId string The id of the auction
Field Type Description logs Auction[] List that contains the single auction specified by auctionId
Field Type Description blockNumber number The block number where the auction event happens auctionEvent string An enum value of 0(AuctionCreated)
, 1(AuctionModified)
, 2(AuctionCancelled)
, 3(AuctionBid)
, 4(AuctionFulfilled)
auctionId string The id of the auction seller string The creator of the auction contractAddress string The nft contract address of the auction tokenId string The nftId of the nft under the contractAddress
startTime string The Unix timestamp of startTime of the sale endTime string The Unix timestamp of endTime of the sale paymentToken string The address of the crypto token that could be used to purchase the nft on sale minimumPrice string The minimum price the bidder can bid on the auction maximumPrice string The maximum price the bidder can bid on the auction tokenType string An enum value of 0(ERC721
), 1(ERC1155
) which represents the type of the nft on auction amount string The total amount of the nft on the auction fulfilled boolean Boolean value that indicates whether the nft on the auction is claimed Bid BidObject The information of the top bid
Field Type Description blockNumber number Boolean value that indicates whether the nft on the auction is claimed price string The bid price from the bidder bidder string The wallet address of the bidder of the auction
TypeScript
const [singleAuction] = await marketplaceSdk.getSingleAuction("1")
// Example singleAuction:
// {
// blockNumber: 3206550,
// saleEvent: 0,
// SaleId: '1'
// seller: "0xf39Fd6e51aad88F6F4ce6aB8827279cffFb92266",
// contractAddress: "0x57f1887a8BF19b14fC0dF6Fd9B2acc9Af147eA85",
// tokenId: "1",
// startTime: "1678908456",
// endTime: "1678909456",
// paymentToken: "0x0000000000000000000000000000000000000000",
// price: "2",
// tokenType: 0,
// amount: 1,
// purchasedAmount: 0,
// purchasedInTransaction: 0
// }