import type { FulfillmentDataResponse, ProtocolData } from "../orders/types"; import { Chain, type OpenSeaAccount, type OpenSeaAPIConfig, type OpenSeaCollection, type OpenSeaCollectionStats, type OpenSeaPaymentToken, type OrderSide, type RequestOptions } from "../types"; import { type Camelize } from "../utils/case"; import type { HttpMethod, PostOptions } from "./fetcher"; import { type AgentProfileRelationshipsResponse, type BatchCollectionsRequest, type BatchNftsRequest, type BatchTokensRequest, type BuildOfferResponse, type CancelOrderResponse, type ClosedPositionsResponse, type CollectionBatchResponse, type CollectionFloorPricesArgs, type CollectionHoldersArgs, type CollectionHoldersPaginatedResponse, type CollectionOffer, type CollectionOfferAggregatesPaginatedResponse, CollectionOrderByOption, type CreateListingActionsRequest, type CreateListingActionsResponse, type CrossChainDropMintRequest, type CrossChainDropMintResponse, type CrossChainFulfillmentRequest, type CrossChainFulfillmentResponse, type DropDeployReceiptResponse, type DropDeployRequest, type DropDeployResponse, type DropMintRequest, type DropMintResponse, type FloorPriceHistoryResponse, type GetAccountTokenActivityArgs, type GetAccountTokenActivityResponse, type GetAccountTokensArgs, type GetAccountTokensResponse, type GetBestListingResponse, type GetBestOfferResponse, type GetChainsResponse, type GetCollectionsPaginatedResponse, type GetCollectionsResponse, type GetContractResponse, type GetDropResponse, type GetDropsArgs, type GetDropsResponse, type GetEventsArgs, type GetEventsByCollectionArgs, type GetEventsResponse, type GetListingsResponse, type GetNFTMetadataResponse, type GetNFTResponse, type GetOffersResponse, type GetOrderByHashResponse, type GetSwapQuoteArgs, type GetSwapQuoteResponse, type GetTokenGroupResponse, type GetTokenGroupsArgs, type GetTokenGroupsResponse, type GetTokenResponse, type GetTokensArgs, type GetTopCollectionsArgs, type GetTopTokensResponse, type GetTraitsResponse, type GetTrendingCollectionsArgs, type GetTrendingTokensResponse, type Listing, type ListNFTsResponse, type NFTOwnersArgs, type NftAnalyticsResponse, type NftBatchResponse, type Offer, type OhlcvResponse, type OwnersPaginatedResponse, type PaginatedAnalyticsArgs, type PortfolioArgs, type PortfolioHistoryResponse, type PortfolioStatsResponse, type PositionTokenTransfersResponse, type PriceHistoryResponse, type ProfileCollectionsArgs, type ProfileCollectionsResponse, type ProfileFavoritesArgs, type ProfileFavoritesResponse, type ProfileListingsResponse, type ProfileOffersResponse, type ProfileOrdersArgs, type RequestInstantApiKeyResponse, type ResolveAccountResponse, type SearchArgs, type SearchResponse, type SwapExecuteRequest, type SwapExecuteResponse, type SweepCollectionRequest, type SweepCollectionResponse, type TokenActivityArgs, type TokenActivityStatsArgs, type TokenActivityStatsResponse, type TokenBatchResponse, type TokenHoldersArgs, type TokenHoldersResponse, type TokenLiquidityPoolsArgs, type TokenLiquidityPoolsResponse, type TokenSwapActivityPaginatedResponse, type TokenTimeSeriesArgs, type TraitFilter, type TransactionReceiptRequest, type TransactionReceiptResponse, type TransferRequest, type TransferResponse, type ValidateMetadataResponse, type WalletClosedPositionsArgs, type WalletPnlResponse, type WalletTokenTransfersArgs } from "./types"; import { WalletAuthAPI } from "./walletAuth"; /** * The API class for the OpenSea SDK. * @category Main Classes */ export declare class OpenSeaAPI { /** * Base url for the API */ readonly apiBaseUrl: string; /** * Default size to use for fetching orders */ pageSize: number; /** * Logger function to use when debugging */ logger: (arg: string) => void; private apiKey; private authToken; private chain; private ordersAPI; private offersAPI; private listingsAPI; private collectionsAPI; private nftsAPI; private accountsAPI; private eventsAPI; private searchAPI; private tokensAPI; private chainsAPI; private dropsAPI; private transactionsAPI; private assetsAPI; /** Wallet-authenticated scoped REST helpers. */ readonly walletAuth: WalletAuthAPI; /** * Create an instance of the OpenSeaAPI * @param config OpenSeaAPIConfig for setting up the API, including an optional API key, Chain name, and base URL * @param logger Optional function for logging debug strings before and after requests are made. Defaults to no logging */ constructor(config: OpenSeaAPIConfig, logger?: (arg: string) => void); /** * Gets a single order by its order hash. * @param orderHash The hash of the order to fetch * @param protocolAddress The address of the seaport contract * @param chain The chain where the order is located. Defaults to the chain set in the constructor. * @returns The {@link GetOrderByHashResponse} returned by the API (can be Offer or Listing) * @throws An error if the order is not found */ getOrderByHash(orderHash: string, protocolAddress: string, chain?: Chain): Promise; /** * Gets all offers for a given collection. * @param collectionSlug The slug of the collection. * @param limit The number of offers to return. Must be between 1 and 100. Default: 100 * @param next The cursor for the next page of results. This is returned from a previous request. * @returns The {@link GetOffersResponse} returned by the API. */ getAllOffers(collectionSlug: string, limit?: number, next?: string): Promise; /** * Gets all listings for a given collection. * @param collectionSlug The slug of the collection. * @param limit The number of listings to return. Must be between 1 and 100. Default: 100 * @param next The cursor for the next page of results. This is returned from a previous request. * @param includePrivateListings Whether to include private listings (default: false) * @returns The {@link GetListingsResponse} returned by the API. */ getAllListings(collectionSlug: string, limit?: number, next?: string, includePrivateListings?: boolean): Promise; /** * Gets trait offers for a given collection. * @param collectionSlug The slug of the collection. * @param type The name of the trait (e.g. 'Background'). * @param value The value of the trait (e.g. 'Red'). * @param limit The number of offers to return. Must be between 1 and 100. Default: 100 * @param next The cursor for the next page of results. This is returned from a previous request. * @param floatValue The value of the trait for decimal-based numeric traits. * @param intValue The value of the trait for integer-based numeric traits. * @returns The {@link GetOffersResponse} returned by the API. */ getTraitOffers(collectionSlug: string, type: string, value: string, limit?: number, next?: string, floatValue?: number, intValue?: number): Promise; /** * Gets the best offer for a given token. * @param collectionSlug The slug of the collection. * @param tokenId The token identifier. * @returns The {@link GetBestOfferResponse} returned by the API. */ getBestOffer(collectionSlug: string, tokenId: string | number): Promise; /** * Gets the best listing for a given token. * @param collectionSlug The slug of the collection. * @param tokenId The token identifier. * @param includePrivateListings Whether to include private listings (default: false) * @returns The {@link GetBestListingResponse} returned by the API. */ getBestListing(collectionSlug: string, tokenId: string | number, includePrivateListings?: boolean): Promise; /** * Gets the best listings for a given collection. * @param collectionSlug The slug of the collection. * @param limit The number of listings to return. Must be between 1 and 100. Default: 100 * @param next The cursor for the next page of results. This is returned from a previous request. * @param includePrivateListings Whether to include private listings (default: false) * @param traits Optional {@link TraitFilter} array. Returns 400 if a single trait matches more than 1000 items. * @returns The {@link GetListingsResponse} returned by the API. */ getBestListings(collectionSlug: string, limit?: number, next?: string, includePrivateListings?: boolean, traits?: TraitFilter[]): Promise; /** * Get cross-chain fulfillment data for one or more listings. * Supports same-chain, cross-token, and cross-chain purchases (up to 50 listings). * All listings must be EVM (Seaport orders). Payment can be from any chain (EVM or SVM). * @param request The cross-chain fulfillment request containing listings, fulfiller, payment, and optional recipient * @returns The {@link CrossChainFulfillmentResponse} with ordered transactions to sign and submit */ getCrossChainFulfillmentData(request: CrossChainFulfillmentRequest): Promise; /** * Generate the data needed to fulfill a listing or an offer onchain. * @param fulfillerAddress The wallet address which will be used to fulfill the order * @param orderHash The hash of the order to fulfill * @param protocolAddress The address of the seaport contract * @param side The side of the order (buy or sell) * @param assetContractAddress Optional address of the NFT contract for criteria offers (e.g., collection offers) * @param tokenId Optional token ID for criteria offers (e.g., collection offers) * @param unitsToFill Optional number of units to fill. Defaults to 1 for both listings and offers. * @param recipientAddress Optional recipient address for the NFT when fulfilling a listing. Not applicable for offers. * @param includeOptionalCreatorFees Whether to include optional creator fees in the fulfillment. If creator fees are already required, this is a no-op. Defaults to false. * @returns The {@link FulfillmentDataResponse} */ generateFulfillmentData(fulfillerAddress: string, orderHash: string, protocolAddress: string, side: OrderSide, assetContractAddress?: string, tokenId?: string, unitsToFill?: string, recipientAddress?: string, includeOptionalCreatorFees?: boolean): Promise>; /** * Post a listing to OpenSea. Returns the new v2 Listing response format. * @param order The order to post * @param protocolAddress The contract address of the seaport protocol * @returns The {@link Listing} posted to the API. */ postListing(order: ProtocolData, protocolAddress: string): Promise; /** * Post an offer to OpenSea. Returns the new v2 Offer response format. * @param order The order to post * @param protocolAddress The contract address of the seaport protocol * @returns The {@link Offer} posted to the API. */ postOffer(order: ProtocolData, protocolAddress: string): Promise; /** * Build a OpenSea collection offer. * @param offererAddress The wallet address which is creating the offer. * @param quantity The number of NFTs requested in the offer. * @param collectionSlug The slug (identifier) of the collection to build the offer for. * @param offerProtectionEnabled Build the offer on OpenSea's signed zone to provide offer protections from receiving an item which is disabled from trading. * @param traitType If defined, the trait name to create the collection offer for. * @param traitValue If defined, the trait value to create the collection offer for. * @param traits If defined, an array of traits to create the multi-trait collection offer for. * @param numericTraits If defined, an array of numeric trait criteria with min/max ranges. * @returns The {@link BuildOfferResponse} returned by the API. */ buildOffer(offererAddress: string, quantity: number, collectionSlug: string, offerProtectionEnabled?: boolean, traitType?: string, traitValue?: string, traits?: Array<{ type: string; value: string; }>, numericTraits?: Array<{ type: string; min?: number; max?: number; }>): Promise; /** * Get a list collection offers for a given slug. * @param slug The slug (identifier) of the collection to list offers for * @param limit Optional limit for number of results. * @param next Optional cursor for pagination. * @returns The {@link GetOffersResponse} returned by the API. */ getCollectionOffers(slug: string, limit?: number, next?: string): Promise; /** * Post a collection offer to OpenSea. * @param order The collection offer to post. * @param slug The slug (identifier) of the collection to post the offer for. * @param traitType If defined, the trait name to create the collection offer for. * @param traitValue If defined, the trait value to create the collection offer for. * @param traits If defined, an array of traits to create the multi-trait collection offer for. * @param numericTraits If defined, an array of numeric trait criteria with min/max ranges. * @returns The {@link Offer} returned to the API. */ postCollectionOffer(order: ProtocolData, slug: string, traitType?: string, traitValue?: string, traits?: Array<{ type: string; value: string; }>, numericTraits?: Array<{ type: string; min?: number; max?: number; }>): Promise; /** * Fetch multiple NFTs for a collection. * @param slug The slug (identifier) of the collection * @param limit The number of NFTs to retrieve. Must be greater than 0 and less than 51. * @param next Cursor to retrieve the next page of NFTs * @param traits Optional {@link TraitFilter} array. Returns 400 if a single trait matches more than 1000 items. * @returns The {@link ListNFTsResponse} returned by the API. */ getNFTsByCollection(slug: string, limit?: number | undefined, next?: string | undefined, traits?: TraitFilter[] | undefined): Promise; /** * Fetch multiple NFTs for a contract. * @param address The NFT's contract address. * @param limit The number of NFTs to retrieve. Must be greater than 0 and less than 51. * @param next Cursor to retrieve the next page of NFTs. * @param chain The NFT's chain. * @returns The {@link ListNFTsResponse} returned by the API. */ getNFTsByContract(address: string, limit?: number | undefined, next?: string | undefined, chain?: Chain): Promise; /** * Fetch NFTs owned by an account. * @param address The address of the account * @param limit The number of NFTs to retrieve. Must be greater than 0 and less than 51. * @param next Cursor to retrieve the next page of NFTs * @param chain The chain to query. Defaults to the chain set in the constructor. * @returns The {@link ListNFTsResponse} returned by the API. */ getNFTsByAccount(address: string, limit?: number | undefined, next?: string | undefined, chain?: Chain): Promise; /** * Fetch metadata, traits, ownership information, and rarity for a single NFT. * @param address The NFT's contract address. * @param identifier the identifier of the NFT (i.e. Token ID) * @param chain The NFT's chain. * @returns The {@link GetNFTResponse} returned by the API. */ getNFT(address: string, identifier: string, chain?: Chain): Promise; /** * Fetch an OpenSea collection. * @param slug The slug (identifier) of the collection. * @returns The {@link OpenSeaCollection} returned by the API. */ getCollection(slug: string): Promise; /** * Fetch a list of OpenSea collections. * @param orderBy The order to return the collections in. Default: CREATED_DATE * @param chain The chain to filter the collections on. Default: all chains * @param creatorUsername The creator's OpenSea username to filter the collections on. * @param includeHidden If hidden collections should be returned. Default: false * @param limit The limit of collections to return. * @param next The cursor for the next page of results. This is returned from a previous request. * @returns List of {@link OpenSeaCollection} returned by the API. */ getCollections(orderBy?: CollectionOrderByOption, chain?: Chain, creatorUsername?: string, includeHidden?: boolean, limit?: number, next?: string): Promise; /** * Fetch stats for an OpenSea collection. * @param slug The slug (identifier) of the collection. * @returns The {@link OpenSeaCollection} returned by the API. */ getCollectionStats(slug: string): Promise; /** * Fetch a payment token. * @param address The address of the payment token * @param chain The chain of the payment token * @returns The {@link OpenSeaPaymentToken} returned by the API. */ getPaymentToken(address: string, chain?: Chain): Promise; /** * Fetch account for an address. * @param address The address to fetch the account for * @returns The {@link OpenSeaAccount} returned by the API. */ getAccount(address: string): Promise; /** * Force refresh the metadata for an NFT. * @param address The address of the NFT's contract. * @param identifier The identifier of the NFT. * @param chain The chain where the NFT is located. * @returns The response from the API. */ refreshNFTMetadata(address: string, identifier: string, chain?: Chain): Promise>; /** * Offchain cancel an order, offer or listing, by its order hash when protected by the SignedZone. * Protocol and Chain are required to prevent hash collisions. * Please note cancellation is only assured if a fulfillment signature was not vended prior to cancellation. * @param protocolAddress The Seaport address for the order. * @param orderHash The order hash, or external identifier, of the order. * @param chain The chain where the order is located. * @param offererSignature An EIP-712 signature from the offerer of the order. * If this is not provided, the user associated with the API Key will be checked instead. * The signature must be a EIP-712 signature consisting of the order's Seaport contract's * name, version, address, and chain. The struct to sign is `OrderHash` containing a * single bytes32 field. * @returns The response from the API. */ offchainCancelOrder(protocolAddress: string, orderHash: string, chain?: Chain, offererSignature?: string): Promise; /** * Gets a list of events based on query parameters. * @param args Query parameters for filtering events. * @returns The {@link GetEventsResponse} returned by the API. */ getEvents(args?: GetEventsArgs): Promise; /** * Gets a list of events for a specific account. * @param address The account address. * @param args Query parameters for filtering events. * @returns The {@link GetEventsResponse} returned by the API. */ getEventsByAccount(address: string, args?: GetEventsArgs): Promise; /** * Gets a list of events for a specific collection. Pass `args.traits` to * filter server-side by item traits (multiple entries are AND-combined). * @param collectionSlug The slug (identifier) of the collection. * @param args Query parameters; see {@link GetEventsByCollectionArgs}. * @returns The {@link GetEventsResponse} returned by the API. */ getEventsByCollection(collectionSlug: string, args?: GetEventsByCollectionArgs): Promise; /** * Gets a list of events for a specific NFT. * @param chain The chain where the NFT is located. * @param address The contract address of the NFT. * @param identifier The token identifier. * @param args Query parameters for filtering events. * @returns The {@link GetEventsResponse} returned by the API. */ getEventsByNFT(chain: Chain, address: string, identifier: string, args?: GetEventsArgs): Promise; /** * Fetch smart contract information for a given chain and address. * @param address The contract address. * @param chain The chain where the contract is deployed. Defaults to the chain set in the constructor. * @returns The {@link GetContractResponse} returned by the API. */ getContract(address: string, chain?: Chain): Promise; /** * Fetch all traits for a collection with their possible values and counts. * @param collectionSlug The slug (identifier) of the collection. * @returns The {@link GetTraitsResponse} returned by the API. */ getTraits(collectionSlug: string): Promise; /** * Gets a list of trending tokens. * @param args Optional query parameters for pagination. * @returns The {@link GetTrendingTokensResponse} returned by the API. */ getTrendingTokens(args?: GetTokensArgs): Promise; /** * Gets a list of top tokens. * @param args Optional query parameters for pagination. * @returns The {@link GetTopTokensResponse} returned by the API. */ getTopTokens(args?: GetTokensArgs): Promise; /** * Gets a swap quote for exchanging tokens. * @param args Query parameters for the swap quote including token addresses, amount, and chain. * @returns The {@link GetSwapQuoteResponse} returned by the API. */ getSwapQuote(args: GetSwapQuoteArgs): Promise; /** * Gets details for a specific token. * @param chain The chain the token is on. * @param address The token contract address. * @returns The {@link GetTokenResponse} returned by the API. */ getToken(chain: string, address: string): Promise; /** * Gets a paginated list of token groups — equivalent currencies across * chains (e.g. ETH on Ethereum, Base, and Arbitrum share the "eth" group). * @param args Optional query parameters (`limit`, `cursor`). * @returns The {@link GetTokenGroupsResponse} returned by the API. */ getTokenGroups(args?: GetTokenGroupsArgs): Promise; /** * Gets a single token group by its slug (e.g. "eth"). * @param slug The token group slug. * @returns The {@link GetTokenGroupResponse} returned by the API. */ getTokenGroup(slug: string): Promise; /** * Search across collections, tokens, NFTs, and accounts. * Results are ranked by relevance. * @param args Query parameters including query text, optional chain/asset type filters, and limit. * @returns The {@link SearchResponse} returned by the API. */ search(args: SearchArgs): Promise; /** * Gets the list of supported blockchains and their capabilities. * @returns The {@link GetChainsResponse} returned by the API. */ getChains(): Promise; /** * Gets token balances for a given account. * @param address The wallet address to fetch token balances for. * @param args Optional query parameters for filtering and pagination. * @returns The {@link GetAccountTokensResponse} returned by the API. */ getAccountTokens(address: string, args?: GetAccountTokensArgs): Promise; /** * Validate NFT metadata by fetching and parsing it. * @param address The NFT contract address. * @param identifier The token identifier. * @param chain The chain where the NFT is located. Defaults to the chain set in the constructor. * @param ignoreCachedItemUrls Whether to ignore cached item URLs and re-fetch from source. * @returns The {@link ValidateMetadataResponse} returned by the API. */ validateNFTMetadata(address: string, identifier: string, chain?: Chain, ignoreCachedItemUrls?: boolean): Promise; /** * Gets all active offers for a specific NFT (not just the best offer). * @param collectionSlug The collection slug. * @param identifier The NFT token id. * @param limit The number of offers to return. Must be between 1 and 200. * @param next The cursor for the next page of results. * @returns The {@link GetOffersResponse} returned by the API. */ getOffersByNFT(collectionSlug: string, identifier: string | number, limit?: number, next?: string): Promise; /** * Bulk-buy items from a collection using any payment token, including * cross-chain. Returns an ordered list of transactions to execute. * @param request The sweep request containing buyer, collection, payment, and item caps. * @returns The {@link SweepCollectionResponse} returned by the API. */ sweepCollection(request: SweepCollectionRequest): Promise; /** * Get executable transactions for a token swap. Companion to * {@link OpenSeaAPI.getSwapQuote} — quote first, then execute. * @param request The swap execution request. * @returns The {@link SwapExecuteResponse} with transactions and a quote. */ executeSwap(request: SwapExecuteRequest): Promise; /** * Get the receipt/status for a submitted transaction. Works for all transaction * types: listing fulfillments, cross-chain buys and mints, sweeps, offer * fulfillments, and token swaps. Poll this endpoint to check completion status. * @param request The transaction receipt request. * @returns The {@link TransactionReceiptResponse} returned by the API. */ getTransactionReceipt(request: TransactionReceiptRequest): Promise; /** * Gets a list of drops (mints). * @param args Optional query parameters for filtering and pagination. * @returns The {@link GetDropsResponse} returned by the API. */ getDrops(args?: GetDropsArgs): Promise; /** * Gets detailed drop information for a collection. * @param slug The collection slug identifying the drop. * @returns The {@link GetDropResponse} returned by the API. */ getDrop(slug: string): Promise; /** * Builds a mint transaction for a drop. * @param slug The collection slug identifying the drop. * @param request The mint request containing minter address and quantity. * @returns The {@link DropMintResponse} with ready-to-sign transaction data. */ buildDropMintTransaction(slug: string, request: DropMintRequest): Promise; /** * Builds ordered transactions for paying on one chain and minting a drop on * another. Submit each transaction in order, then pass the returned * `receiptRequest` unchanged to {@link OpenSeaAPI.getTransactionReceipt} * until the status is terminal. * @param slug The collection slug identifying the drop. * @param request The payer, minter, quantity, and source payment asset. * @returns Transactions to submit and the request used to poll their receipt. */ buildCrossChainDropMintTransactions(slug: string, request: CrossChainDropMintRequest): Promise; /** * Gets trending collections sorted by sales activity. * @param args Optional query parameters for timeframe, chain, category, and pagination. * @returns The {@link GetCollectionsPaginatedResponse} returned by the API. */ getTrendingCollections(args?: GetTrendingCollectionsArgs): Promise; /** * Gets top collections ranked by various stats. * @param args Optional query parameters for sort_by, chain, category, and pagination. * @returns The {@link GetCollectionsPaginatedResponse} returned by the API. */ getTopCollections(args?: GetTopCollectionsArgs): Promise; /** * Resolve an ENS name, OpenSea username, or wallet address to canonical account info. * @param identifier An ENS name (e.g. vitalik.eth), OpenSea username, or wallet address. * @returns The {@link ResolveAccountResponse} returned by the API. */ resolveAccount(identifier: string): Promise; /** * Get the public agent ownership relationships for a profile. * This is a public read and does not require wallet authentication. * @param addressOrUsername An ENS name, OpenSea username, or wallet address. * @returns The {@link AgentProfileRelationshipsResponse} returned by the API. */ getAgentProfileRelationships(addressOrUsername: string): Promise; /** * Get the collection that an NFT belongs to. * Useful for multi-contract collections where the token ID disambiguates * which collection the NFT belongs to. * @param address The NFT contract address. * @param identifier The token identifier. * @param chain The chain where the NFT is located. Defaults to the chain set in the constructor. * @returns The {@link OpenSeaCollection} returned by the API. */ getNFTCollection(address: string, identifier: string, chain?: Chain): Promise; /** * Get detailed metadata for an NFT including name, description, image, traits, * and external links. * @param address The NFT contract address. * @param tokenId The token identifier. * @param chain The chain where the NFT is located. Defaults to the chain set in the constructor. * @returns The {@link GetNFTMetadataResponse} returned by the API. */ getNFTMetadata(address: string, tokenId: string, chain?: Chain): Promise; /** * Fetch multiple tokens in a single request. * @param request Batch request listing chain + contract address pairs. * @returns The {@link TokenBatchResponse} with detailed token info. */ getTokensBatch(request: BatchTokensRequest): Promise; /** * Fetch the price history of a token. * @param chain Chain the token lives on. * @param address Token contract address. * @param args Time-series window — `start_time` required, `end_time` defaults to now. * @returns The {@link PriceHistoryResponse} returned by the API. */ getTokenPriceHistory(chain: Chain, address: string, args: TokenTimeSeriesArgs): Promise; /** * Fetch OHLCV candles for a token. * @param chain Chain the token lives on. * @param address Token contract address. * @param args Time-series window plus candle `bucketSize` (required). * @returns The {@link OhlcvResponse} returned by the API. */ getTokenOhlcv(chain: Chain, address: string, args: TokenTimeSeriesArgs & { bucketSize: string; }): Promise; /** * Fetch recent swap activity for a token. */ getTokenActivity(chain: Chain, address: string, args?: TokenActivityArgs): Promise; /** * Fetch materialized trade count, USD volume, and average trade size for a * token across the requested windows. */ getTokenActivityStats(chain: Chain, address: string, args?: TokenActivityStatsArgs): Promise; /** * Fetch paginated fungible token activity (transfers, swaps, wraps, and * unwraps) for an account across all chains. */ getAccountTokenActivity(address: string, args?: GetAccountTokenActivityArgs): Promise; /** * Fetch paginated holders for a token, including quantity held, USD value, * and aggregate distribution health (STRONG | HEALTHY | CONCERNING | BAD). */ getTokenHolders(chain: Chain, address: string, args?: TokenHoldersArgs): Promise; /** * Fetch liquidity pools for a token (pool type, USD reserves, and * bonding-curve progress / graduation flag where applicable). */ getTokenLiquidityPools(chain: Chain, address: string, args?: TokenLiquidityPoolsArgs): Promise; /** * Fetch multiple NFTs in a single request. */ getNFTsBatch(request: BatchNftsRequest): Promise; /** * Fetch owners of an NFT. */ getNFTOwners(address: string, identifier: string, chain?: Chain, args?: NFTOwnersArgs): Promise; /** * Fetch analytics (historical sale points) for an NFT. */ getNFTAnalytics(address: string, identifier: string, chain?: Chain): Promise; /** * Fetch multiple collections in a single request by slug. */ getCollectionsBatch(request: BatchCollectionsRequest): Promise; /** * Fetch top offers for a collection grouped by price level. */ getCollectionOfferAggregates(slug: string, args?: PaginatedAnalyticsArgs): Promise; /** * Fetch holders of a collection. */ getCollectionHolders(slug: string, args?: CollectionHoldersArgs): Promise; /** * Fetch the floor-price history of a collection. */ getCollectionFloorPrices(slug: string, args?: CollectionFloorPricesArgs): Promise; /** * Get ordered approval + sign actions to create one or more listings. */ createListingActions(request: CreateListingActionsRequest): Promise; /** * Build a deploy-contract transaction for a new drop. */ deployDropContract(request: DropDeployRequest): Promise; /** * Get the receipt of a previously submitted drop-deploy transaction. */ getDeployContractReceipt(chain: Chain, txHash: string): Promise; /** * Build transactions to transfer NFTs or tokens between wallets. */ transferAssets(request: TransferRequest): Promise; /** * Get portfolio stats (net worth, P&L) for an account. */ getPortfolioStats(address: string, args?: PortfolioArgs): Promise; /** * Get portfolio net-worth history for an account. */ getPortfolioHistory(address: string, args?: PortfolioArgs): Promise; /** * Get offers received by an account. */ getProfileOffersReceived(address: string, args?: ProfileOrdersArgs): Promise; /** * Get active offers made by an account. */ getProfileOffers(address: string, args?: ProfileOrdersArgs): Promise; /** * Get active listings for an account. */ getProfileListings(address: string, args?: ProfileOrdersArgs): Promise; /** * Get items favorited by an account. */ getProfileFavorites(address: string, args?: ProfileFavoritesArgs): Promise; /** * Get collections owned by an account. */ getProfileCollections(address: string, args?: ProfileCollectionsArgs): Promise; /** * Get aggregated trading P&L (realized + unrealized) for an account. */ getWalletPnl(address: string): Promise; /** * Get closed (realized) trading positions for an account. */ getWalletClosedPositions(address: string, args?: WalletClosedPositionsArgs): Promise; /** * Get the token transfers contributing to a wallet's position in a currency. */ getWalletTokenTransfers(address: string, args: WalletTokenTransfersArgs): Promise; /** * Generic fetch method for any API endpoint with automatic rate limit retry * @param apiPath Path to URL endpoint under API * @param query URL query params. Will be used to create a URLSearchParams object. * @param options Request options like timeout and abort signal. * @returns @typeParam T The response from the API. */ get(apiPath: string, query?: object, options?: RequestOptions): Promise>; /** * Generic post method for any API endpoint with automatic rate limit retry * @param apiPath Path to URL endpoint under API * @param body Data to send. * @param headers Additional headers to send with the request. * @param options Request options. Includes the {@link PostOptions.snakeizeBody} * opt-out (defaults to `true`) for callers that need to emit * the body in exact wire shape (e.g. Seaport-shaped POSTs * whose inner keys are camelCase on the wire). * @returns @typeParam T The response from the API. */ post(apiPath: string, body?: object, headers?: object, options?: PostOptions): Promise>; /** Send a typed JSON request to a write endpoint. */ request(method: HttpMethod, apiPath: string, body?: object, headers?: object, options?: PostOptions): Promise>; /** * Camelize a response body unless the caller opted out via * {@link RequestOptions.camelizeResponse}, which endpoints keyed by data * rather than field names (e.g. traits) rely on to keep their keys intact. * * Shared by `get` and `request` so the option cannot silently do nothing on * one verb. */ private camelizeResponseBody; private objectToSearchParams; /** * Fetch from an API Endpoint, sending auth token in headers * @param url The URL to fetch * @param method HTTP method to use. * @param headers Additional headers to send with the request * @param body Optional JSON body to send. * @param options Request options like timeout and abort signal */ private _fetch; /** * Request a free-tier OpenSea API key without authentication. The returned * key is valid for 7 days and can be passed into the {@link OpenSeaAPI} or * {@link BaseOpenSeaSDK} constructors as `apiKey`. * * @example * ```ts * const { apiKey } = await OpenSeaAPI.requestInstantApiKey() * const api = new OpenSeaAPI({ apiKey }) * ``` * * @param apiBaseUrl Optional base URL override (defaults to mainnet). * @returns The {@link RequestInstantApiKeyResponse} containing the new key, * with response keys camelized to match SDK conventions. */ static requestInstantApiKey(apiBaseUrl?: string): Promise; /** * Maximum retry-after value in seconds (5 minutes). * Prevents excessively long waits from buggy or malicious servers. */ private static readonly MAX_RETRY_AFTER_SECONDS; /** * Parses the retry-after header from the response with robust error handling. * @param response The HTTP response object from the API * @returns The retry-after value in seconds (capped at 5 minutes), or undefined if not present or invalid */ private _parseRetryAfter; /** * Creates a rate limit error with status code and retry-after information. * This is async because it attempts to parse the response body. If the body * is malformed JSON, responseBody will be undefined (intentional — the error * itself is more important than the body). * @param response The HTTP response object from the API * @returns An enhanced Error object with statusCode, retryAfter and responseBody properties */ private _createRateLimitError; }