UNPKG

opensea-js

Version:

TypeScript SDK for the OpenSea marketplace helps developers build new experiences using NFTs and our marketplace data

47 lines (46 loc) 1.9 kB
import { BuildOfferResponse, GetBestOfferResponse, GetOffersResponse, CollectionOffer } from "./types"; import { ProtocolData } from "../orders/types"; import { Chain } from "../types"; import { Fetcher } from "./fetcher"; /** * Offer-related API operations */ export declare class OffersAPI { private fetcher; private chain; constructor(fetcher: Fetcher, chain: Chain); /** * Gets all offers for a given collection. */ getAllOffers(collectionSlug: string, limit?: number, next?: string): Promise<GetOffersResponse>; /** * Gets trait offers for a given collection. */ getTraitOffers(collectionSlug: string, type: string, value: string, limit?: number, next?: string, floatValue?: number, intValue?: number): Promise<GetOffersResponse>; /** * Gets the best offer for a given token. */ getBestOffer(collectionSlug: string, tokenId: string | number): Promise<GetBestOfferResponse>; /** * Build a OpenSea collection offer. */ buildOffer(offererAddress: string, quantity: number, collectionSlug: string, offerProtectionEnabled?: boolean, traitType?: string, traitValue?: string, traits?: Array<{ type: string; value: string; }>): Promise<BuildOfferResponse>; /** * Get a list of collection offers for a given slug. */ getCollectionOffers(slug: string, limit?: number, next?: string): Promise<GetOffersResponse>; /** * Post a collection offer to OpenSea. */ postCollectionOffer(order: ProtocolData, slug: string, traitType?: string, traitValue?: string, traits?: Array<{ type: string; value: string; }>): Promise<CollectionOffer | null>; /** * Gets all active offers for a specific NFT. */ getNFTOffers(assetContractAddress: string, tokenId: string, limit?: number, next?: string, chain?: Chain): Promise<GetOffersResponse>; }