MarketplaceV3DirectListings
Handles direct listings
class MarketplaceV3DirectListings< TContract extends DirectListingsLogic,> implements DetectableFeature {}
function constructor( contractWrapper: ContractWrapper<TContract>,
Check price per token for an approved currency
const listingId = 0;const currencyContractAddress = "0x1234";const price = await contract.directListings.currencyPriceForListing( listingId, currencyContractAddress,);
function currencyPriceForListing( listingId: BigNumberish, currencyContractAddress: string,): Promise<BigNumberish>;
Get all direct listings
const listings = await contract.directListings.getAll();
function getAll(
The Direct listing object array
Get all valid direct listings
A valid listing is where the listing is active, and the creator still owns & has approved Marketplace to transfer the listed NFTs.
const listings = await contract.directListings.getAllValid();
function getAllValid(
The Direct listing object array
Get a single direct listing
const listingId = 0;const listing = await contract.directListings.getListing(listingId);
function getListing( listingId: BigNumberish,
The Direct listing object
Get the total number of direct listings
const totalListings = await contract.directListings.getTotalCount();
function getTotalCount(): Promise<BigNumber>;
Check if a buyer is approved for a specific direct listing
const listingId = 0;const isBuyerApproved = await contract.directListings.isBuyerApprovedForListing( listingId, "{{wallet_address}}", );
function isBuyerApprovedForListing( listingId: BigNumberish, buyer: string,): Promise<boolean>;
Check if a currency is approved for a specific direct listing
const listingId = 0;const currencyContractAddress = "0x1234";const isApproved = await contract.directListings.isCurrencyApprovedForListing( listingId, currencyContractAddress, );
function isCurrencyApprovedForListing( listingId: BigNumberish, currency: string,): Promise<boolean>;
function approveBuyerForReservedListing( listingId: BigNumberish, buyer: string,): Promise<TResult>;
Preparable
You can also prepare the transaction without executing it by calling approveBuyerForReservedListing.prepare()
with same arguments. Learn more
function approveCurrencyForListing( listingId: BigNumberish, currencyContractAddress: string, pricePerTokenInCurrency: BigNumberish,): Promise<TResult>;
Preparable
You can also prepare the transaction without executing it by calling approveCurrencyForListing.prepare()
with same arguments. Learn more
function buyFromListing( listingId: BigNumberish, quantityDesired: BigNumberish, receiver: string,): Promise<TResult>;
Preparable
You can also prepare the transaction without executing it by calling buyFromListing.prepare()
with same arguments. Learn more
function cancelListing(listingId: BigNumberish): Promise<TResult>;
Preparable
You can also prepare the transaction without executing it by calling cancelListing.prepare()
with same arguments. Learn more
function createListing(listing: { assetContractAddress: string; currencyContractAddress?: string; endTimestamp?: number | Date; isReservedListing?: boolean; pricePerToken: string | number; quantity?: string | number | bigint | BigNumber; startTimestamp?: number | Date; tokenId: string | number | bigint | BigNumber;}): Promise<TResult>;
let listing: { assetContractAddress: string; currencyContractAddress?: string; endTimestamp?: number | Date; isReservedListing?: boolean; pricePerToken: string | number; quantity?: string | number | bigint | BigNumber; startTimestamp?: number | Date; tokenId: string | number | bigint | BigNumber;};
Preparable
You can also prepare the transaction without executing it by calling createListing.prepare()
with same arguments. Learn more
function createListingsBatch( listings: Array<{ assetContractAddress: string; currencyContractAddress?: string; endTimestamp?: number | Date; isReservedListing?: boolean; pricePerToken: string | number; quantity?: string | number | bigint | BigNumber; startTimestamp?: number | Date; tokenId: string | number | bigint | BigNumber; }>,): Promise<TResult>;
let listings: Array<{ assetContractAddress: string; currencyContractAddress?: string; endTimestamp?: number | Date; isReservedListing?: boolean; pricePerToken: string | number; quantity?: string | number | bigint | BigNumber; startTimestamp?: number | Date; tokenId: string | number | bigint | BigNumber;}>;
Preparable
You can also prepare the transaction without executing it by calling createListingsBatch.prepare()
with same arguments. Learn more
function revokeBuyerApprovalForReservedListing( listingId: BigNumberish, buyer: string,): Promise<TResult>;
Preparable
You can also prepare the transaction without executing it by calling revokeBuyerApprovalForReservedListing.prepare()
with same arguments. Learn more
function revokeCurrencyApprovalForListing( listingId: BigNumberish, currencyContractAddress: string,): Promise<TResult>;
Preparable
You can also prepare the transaction without executing it by calling revokeCurrencyApprovalForListing.prepare()
with same arguments. Learn more
function updateListing( listingId: BigNumberish, listing: { assetContractAddress: string; currencyContractAddress?: string; endTimestamp?: number | Date; isReservedListing?: boolean; pricePerToken: string | number; quantity?: string | number | bigint | BigNumber; startTimestamp?: number | Date; tokenId: string | number | bigint | BigNumber; },): Promise<TResult>;
let listing: { assetContractAddress: string; currencyContractAddress?: string; endTimestamp?: number | Date; isReservedListing?: boolean; pricePerToken: string | number; quantity?: string | number | bigint | BigNumber; startTimestamp?: number | Date; tokenId: string | number | bigint | BigNumber;};
Preparable
You can also prepare the transaction without executing it by calling updateListing.prepare()
with same arguments. Learn more
let featureName: "DirectListings";
let interceptor: ContractInterceptor<DirectListingsLogic>;