collection()

Retrieve listings, counts or stats for a Collection

For a given Collection or Collections, get market Listings, ListingsCounts when setting countsOnly: true, or ListingsStats when settings both countsOnly & collectionStats: true. Optional filters: status, lastUpdatedAt.

Parameters

export type ListingCollectionProps = {
    status?: ListingStatus;
    collectionId?: string;
    collectionIds?: string[];
    countsOnly?: boolean; 
    collectionStats?: boolean;
    lastUpdatedAt?: number;
}

Examples

const listings = await assetlayer.listings.collection({
    status: 'active',
    collectionId: 'collectionId'
});
const listingsCounts = await assetlayer.listings.collection({
    status: 'active',
    collectionId: 'collectionId',
    countsOnly: true
});
const listingsStats = await assetlayer.listings.collection({
    status: 'active',
    collectionId: 'collectionId',
    countsOnly: true,
    collectionStats: true
});

Return Types

type ReturnType = Listing[] | ListingsCounts | ListingsStats;
Listing

Alternatives

getCollectionListings()getCollectionsListings()getCollectionListingsCounts()getCollectionsListingsCounts()getCollectionListingsStats()getCollectionsListingsStats()

Last updated