opensea-js
Version:
TypeScript SDK for the OpenSea marketplace helps developers build new experiences using NFTs and our marketplace data
45 lines (44 loc) • 2.14 kB
TypeScript
import { GetBestListingResponse, GetListingsResponse } from "./types";
import { Chain } from "../types";
import { Fetcher } from "./fetcher";
/**
* Listing-related API operations
*/
export declare class ListingsAPI {
private fetcher;
private chain;
constructor(fetcher: Fetcher, chain: Chain);
/**
* Gets all listings for a given collection.
* @param collectionSlug The collection slug
* @param limit The number of listings to return
* @param next The cursor for pagination
* @param includePrivateListings Whether to include private listings (default: false)
*/
getAllListings(collectionSlug: string, limit?: number, next?: string, includePrivateListings?: boolean): Promise<GetListingsResponse>;
/**
* Gets the best listing for a given token.
* @param collectionSlug The collection slug
* @param tokenId The token ID
* @param includePrivateListings Whether to include private listings (default: false)
*/
getBestListing(collectionSlug: string, tokenId: string | number, includePrivateListings?: boolean): Promise<GetBestListingResponse>;
/**
* Gets the best listings for a given collection.
* @param collectionSlug The collection slug
* @param limit The number of listings to return
* @param next The cursor for pagination
* @param includePrivateListings Whether to include private listings (default: false)
*/
getBestListings(collectionSlug: string, limit?: number, next?: string, includePrivateListings?: boolean): Promise<GetListingsResponse>;
/**
* Gets all active listings for a specific NFT.
* @param assetContractAddress The NFT contract address
* @param tokenId The token ID
* @param limit The number of listings to return
* @param next The cursor for pagination
* @param chain The blockchain chain
* @param includePrivateListings Whether to include private listings (default: false)
*/
getNFTListings(assetContractAddress: string, tokenId: string, limit?: number, next?: string, chain?: Chain, includePrivateListings?: boolean): Promise<GetListingsResponse>;
}