From 902603b97b40fb29da95707b75cadaa8e8032d8c Mon Sep 17 00:00:00 2001 From: Ryan Ghods Date: Thu, 30 Oct 2025 16:08:31 -0700 Subject: [PATCH 1/4] feat: default unitsToFill to 1 for both listings and offers MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Changes the SDK to always default `unitsToFill` to "1" for both listings and offers, providing consistent behavior across order types. Previously: - Listings: defaulted to remaining_quantity (API-side) - Offers: defaulted to 1 (API-side) - SDK sent undefined when not specified Now: - SDK always sends "1" when unitsToFill is not specified - Consistent default behavior for both listings and offers - Cleaner implementation with default parameters in utility functions Changes: - Updated JSDoc comments to reflect new behavior - Modified fulfillment.ts to default to "1" instead of undefined - Refactored getFulfillListingPayload and getFulfillOfferPayload to use default parameters and always include units_to_fill - Updated tests to verify new default behavior - Bumped version to 8.0.5 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude --- package-lock.json | 16 ++-------------- package.json | 2 +- src/api/api.ts | 2 +- src/orders/utils.ts | 20 ++++++-------------- src/sdk.ts | 2 +- src/sdk/fulfillment.ts | 6 +++--- test/sdk/fulfillmentManager.spec.ts | 18 +++++++++--------- 7 files changed, 23 insertions(+), 43 deletions(-) diff --git a/package-lock.json b/package-lock.json index 25122f084..d65af4163 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,12 +1,12 @@ { "name": "opensea-js", - "version": "8.0.3", + "version": "8.0.4", "lockfileVersion": 3, "requires": true, "packages": { "": { "name": "opensea-js", - "version": "8.0.3", + "version": "8.0.4", "hasInstallScript": true, "license": "MIT", "dependencies": { @@ -101,7 +101,6 @@ "resolved": "https://registry.npmjs.org/@babel/core/-/core-7.24.3.tgz", "integrity": "sha512-5FcvN1JHw2sHJChotgx8Ek0lyuh4kCKelgMTTqhYJJtloNvUfpAFMeNQUtdlIaktwrSV9LtCdqwk48wL2wBacQ==", "dev": true, - "peer": true, "dependencies": { "@ampproject/remapping": "^2.2.0", "@babel/code-frame": "^7.24.2", @@ -1141,7 +1140,6 @@ "integrity": "sha512-puiYfGeg5Ydop8eusb/Hy1k7QmOU6X3nvsqCgzrB2K4qMavK//21+PzNE8qeECgNOIoertJPUC1SpegHDI515A==", "dev": true, "license": "BSD-2-Clause", - "peer": true, "dependencies": { "@typescript-eslint/scope-manager": "7.17.0", "@typescript-eslint/types": "7.17.0", @@ -1547,7 +1545,6 @@ "resolved": "https://registry.npmjs.org/acorn/-/acorn-8.11.3.tgz", "integrity": "sha512-Y9rRfJG5jcKOE0CLisYbojUjIrIEE7AGMzA/Sm4BslANhbS+cDMpgBdcPT91oJ7OuJ9hYJBx59RjbhxVnrF8Xg==", "dev": true, - "peer": true, "bin": { "acorn": "bin/acorn" }, @@ -1956,7 +1953,6 @@ "url": "https://github.com/sponsors/ai" } ], - "peer": true, "dependencies": { "caniuse-lite": "^1.0.30001587", "electron-to-chromium": "^1.4.668", @@ -2982,7 +2978,6 @@ "integrity": "sha512-ypowyDxpVSYpkXr9WPv2PAZCtNip1Mv5KTW0SCurXv/9iOpcrH9PaqUElksqEB6pChqHGDRCFTyrZlGhnLNGiA==", "dev": true, "license": "MIT", - "peer": true, "dependencies": { "@eslint-community/eslint-utils": "^4.2.0", "@eslint-community/regexpp": "^4.6.1", @@ -3038,7 +3033,6 @@ "resolved": "https://registry.npmjs.org/eslint-config-prettier/-/eslint-config-prettier-9.1.0.tgz", "integrity": "sha512-NSWl5BFQWEPi1j4TjVNItzYV7dZXZ+wP6I6ZhrBGpChQhZRUaElihE9uRRkcbRnNb76UMKDF3r+WTmNcGPKsqw==", "dev": true, - "peer": true, "bin": { "eslint-config-prettier": "bin/cli.js" }, @@ -3134,7 +3128,6 @@ "integrity": "sha512-whOE1HFo/qJDyX4SnXzP4N6zOWn79WhnCUY/iDR0mPfQZO8wcYE4JClzI2oZrhBnnMUCBCHZhO6VQyoBU95mZA==", "dev": true, "license": "MIT", - "peer": true, "dependencies": { "@rtsao/scc": "^1.1.0", "array-includes": "^3.1.9", @@ -6307,7 +6300,6 @@ "integrity": "sha512-I7AIg5boAr5R0FFtJ6rCfD+LFsWHp81dolrFD8S79U9tb8Az2nGrJncnMSnys+bpQJfRUzqs9hnA81OAA3hCuQ==", "dev": true, "license": "MIT", - "peer": true, "bin": { "prettier": "bin/prettier.cjs" }, @@ -7496,7 +7488,6 @@ "integrity": "sha512-M7BAV6Rlcy5u+m6oPhAPFgJTzAioX/6B0DxyvDlo9l8+T3nLKbrczg2WLUyzd45L8RqfUMyGPzekbMvX2Ldkwg==", "dev": true, "license": "MIT", - "peer": true, "engines": { "node": ">=12" }, @@ -7709,7 +7700,6 @@ "resolved": "https://registry.npmjs.org/typechain/-/typechain-8.3.2.tgz", "integrity": "sha512-x/sQYr5w9K7yv3es7jo4KTX05CLxOf7TRWwoHlrjRh8H82G64g+k7VuWPJlgMo6qrjfCulOdfBjiaDtmhFYD/Q==", "dev": true, - "peer": true, "dependencies": { "@types/prettier": "^2.1.1", "debug": "^4.3.1", @@ -7910,7 +7900,6 @@ "resolved": "https://registry.npmjs.org/typedoc/-/typedoc-0.25.13.tgz", "integrity": "sha512-pQqiwiJ+Z4pigfOnnysObszLiU3mVLWAExSPf+Mu06G/qsc3wzbuM56SZQvONhHLncLUhYzOVkjFFpFfL5AzhQ==", "dev": true, - "peer": true, "dependencies": { "lunr": "^2.3.9", "marked": "^4.3.0", @@ -7942,7 +7931,6 @@ "resolved": "https://registry.npmjs.org/typescript/-/typescript-5.4.5.tgz", "integrity": "sha512-vcI4UpRgg81oIRUFwR0WSIHKt11nJ7SAVlYNIu+QpqeyXP+gpQJy/Z4+F0aGxSE4MqwjyXvW/TzgkLAx2AGHwQ==", "dev": true, - "peer": true, "bin": { "tsc": "bin/tsc", "tsserver": "bin/tsserver" diff --git a/package.json b/package.json index 635c47a3f..e7d56730b 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "opensea-js", - "version": "8.0.4", + "version": "8.0.5", "description": "TypeScript SDK for the OpenSea marketplace helps developers build new experiences using NFTs and our marketplace data", "license": "MIT", "author": "OpenSea Developers", diff --git a/src/api/api.ts b/src/api/api.ts index 18f83f084..ba3b535da 100644 --- a/src/api/api.ts +++ b/src/api/api.ts @@ -259,7 +259,7 @@ export class OpenSeaAPI { * @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. For listings, defaults to remaining quantity. For offers, defaults to 1. + * @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. * @returns The {@link FulfillmentDataResponse} */ diff --git a/src/orders/utils.ts b/src/orders/utils.ts index e80fdaf93..609cb406c 100644 --- a/src/orders/utils.ts +++ b/src/orders/utils.ts @@ -75,7 +75,7 @@ export const getFulfillListingPayload = ( chain: Chain, assetContractAddress?: string, tokenId?: string, - unitsToFill?: string, + unitsToFill: string = "1", recipientAddress?: string, ) => { const payload: { @@ -91,7 +91,7 @@ export const getFulfillListingPayload = ( asset_contract_address: string; token_id: string; }; - units_to_fill?: string; + units_to_fill: string; recipient?: string; } = { listing: { @@ -102,6 +102,7 @@ export const getFulfillListingPayload = ( fulfiller: { address: fulfillerAddress, }, + units_to_fill: unitsToFill, }; // Add consideration for criteria listings if needed @@ -112,11 +113,6 @@ export const getFulfillListingPayload = ( }; } - // Add optional units_to_fill - if (unitsToFill !== undefined) { - payload.units_to_fill = unitsToFill; - } - // Add optional recipient for listings if (recipientAddress) { payload.recipient = recipientAddress; @@ -132,7 +128,7 @@ export const getFulfillOfferPayload = ( chain: Chain, assetContractAddress?: string, tokenId?: string, - unitsToFill?: string, + unitsToFill: string = "1", ) => { const payload: { offer: { @@ -147,7 +143,7 @@ export const getFulfillOfferPayload = ( asset_contract_address: string; token_id: string; }; - units_to_fill?: string; + units_to_fill: string; } = { offer: { hash: order_hash, @@ -157,6 +153,7 @@ export const getFulfillOfferPayload = ( fulfiller: { address: fulfillerAddress, }, + units_to_fill: unitsToFill, }; // Add consideration for criteria offers (e.g., collection offers) @@ -167,11 +164,6 @@ export const getFulfillOfferPayload = ( }; } - // Add optional units_to_fill for offers - if (unitsToFill !== undefined) { - payload.units_to_fill = unitsToFill; - } - return payload; }; diff --git a/src/sdk.ts b/src/sdk.ts index ba72b9fa7..70319289d 100644 --- a/src/sdk.ts +++ b/src/sdk.ts @@ -484,7 +484,7 @@ export class OpenSeaSDK { * @param options.accountAddress Address of the wallet taking the offer. * @param options.assetContractAddress Optional address of the NFT contract for criteria offers (e.g., collection offers). Required when fulfilling collection offers. * @param options.tokenId Optional token ID for criteria offers (e.g., collection offers). Required when fulfilling collection offers. - * @param options.unitsToFill Optional number of units to fill. For listings, defaults to remaining quantity. For offers, defaults to 1. + * @param options.unitsToFill Optional number of units to fill. Defaults to 1 for both listings and offers. * @param options.recipientAddress Optional recipient address for the NFT when fulfilling a listing. Not applicable for offers. * @param options.overrides Transaction overrides, ignored if not set. * @returns Transaction hash of the order. diff --git a/src/sdk/fulfillment.ts b/src/sdk/fulfillment.ts index bf279d3fe..c51e51d8b 100644 --- a/src/sdk/fulfillment.ts +++ b/src/sdk/fulfillment.ts @@ -95,7 +95,7 @@ export class FulfillmentManager { * @param options.accountAddress Address of the wallet taking the offer. * @param options.assetContractAddress Optional address of the NFT contract for criteria offers (e.g., collection offers). Required when fulfilling collection offers. * @param options.tokenId Optional token ID for criteria offers (e.g., collection offers). Required when fulfilling collection offers. - * @param options.unitsToFill Optional number of units to fill. For listings, defaults to remaining quantity. For offers, defaults to 1. + * @param options.unitsToFill Optional number of units to fill. Defaults to 1 for both listings and offers. * @param options.recipientAddress Optional recipient address for the NFT when fulfilling a listing. Not applicable for offers. * @param options.overrides Transaction overrides, ignored if not set. * @returns Transaction hash of the order. @@ -152,9 +152,9 @@ export class FulfillmentManager { throw new Error("Order hash is required to fulfill an order"); } - // Convert unitsToFill to string if provided + // Convert unitsToFill to string, defaulting to "1" if not provided const unitsToFillStr = - unitsToFill !== undefined ? unitsToFill.toString() : undefined; + unitsToFill !== undefined ? unitsToFill.toString() : "1"; const fulfillmentData = await this.context.api.generateFulfillmentData( accountAddress, diff --git a/test/sdk/fulfillmentManager.spec.ts b/test/sdk/fulfillmentManager.spec.ts index 801c606e6..48b83fa50 100644 --- a/test/sdk/fulfillmentManager.spec.ts +++ b/test/sdk/fulfillmentManager.spec.ts @@ -311,40 +311,40 @@ suite("SDK: FulfillmentManager", () => { }); suite("fulfillOrder with remaining_quantity", () => { - test("uses remaining_quantity from Listing when unitsToFill not specified", async () => { + test("defaults to 1 when unitsToFill not specified for Listing", async () => { await fulfillmentManager.fulfillOrder({ order: mockListing, accountAddress: "0xBuyer", }); - // API defaults unitsToFill to remaining_quantity for listings + // SDK defaults unitsToFill to "1" for both listings and offers expect(mockSigner.sendTransaction.calledOnce).to.be.true; const apiCall = mockAPI.generateFulfillmentData.firstCall.args; - expect(apiCall[6]).to.be.undefined; // unitsToFill not specified + expect(apiCall[6]).to.equal("1"); // unitsToFill defaults to "1" }); - test("uses remaining_quantity from partially filled Listing", async () => { + test("defaults to 1 when unitsToFill not specified for partially filled Listing", async () => { await fulfillmentManager.fulfillOrder({ order: mockListingPartiallyFilled, accountAddress: "0xBuyer", }); - // API defaults unitsToFill to remaining_quantity for listings + // SDK defaults unitsToFill to "1" for both listings and offers expect(mockSigner.sendTransaction.calledOnce).to.be.true; const apiCall = mockAPI.generateFulfillmentData.firstCall.args; - expect(apiCall[6]).to.be.undefined; // unitsToFill not specified + expect(apiCall[6]).to.equal("1"); // unitsToFill defaults to "1" }); - test("uses remainingQuantity from OrderV2 when unitsToFill not specified", async () => { + test("defaults to 1 when unitsToFill not specified for OrderV2", async () => { await fulfillmentManager.fulfillOrder({ order: mockOrderV2, accountAddress: "0xBuyer", }); - // API defaults unitsToFill to remaining_quantity for listings + // SDK defaults unitsToFill to "1" for both listings and offers expect(mockSigner.sendTransaction.calledOnce).to.be.true; const apiCall = mockAPI.generateFulfillmentData.firstCall.args; - expect(apiCall[6]).to.be.undefined; // unitsToFill not specified + expect(apiCall[6]).to.equal("1"); // unitsToFill defaults to "1" }); test("passes unitsToFill when specified", async () => { From 69575048b0c709ecab07c6fc7bc55e1a4c62f0fd Mon Sep 17 00:00:00 2001 From: Ryan Ghods Date: Thu, 30 Oct 2025 16:11:45 -0700 Subject: [PATCH 2/4] test: update utils tests to expect units_to_fill default MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Update test expectations to include units_to_fill: "1" in the expected payloads, reflecting the new default behavior. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude --- test/orders/utils.spec.ts | 2 ++ 1 file changed, 2 insertions(+) diff --git a/test/orders/utils.spec.ts b/test/orders/utils.spec.ts index 620f33c74..c11dcb7d8 100644 --- a/test/orders/utils.spec.ts +++ b/test/orders/utils.spec.ts @@ -233,6 +233,7 @@ suite("Orders: utils", () => { fulfiller: { address: "0xFulfiller", }, + units_to_fill: "1", }); expect(result.consideration).to.be.undefined; }); @@ -297,6 +298,7 @@ suite("Orders: utils", () => { fulfiller: { address: "0xFulfiller", }, + units_to_fill: "1", }); expect(result.consideration).to.be.undefined; }); From 2d05cc8811be6ec8121e755965ca95be9690e85c Mon Sep 17 00:00:00 2001 From: Ryan Ghods Date: Thu, 30 Oct 2025 16:13:36 -0700 Subject: [PATCH 3/4] feat: add includePrivateListings parameter to getBestListing MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Add support for include_private_listings query parameter to getBestListing API method. This allows the integration test to fetch private listings when needed, fixing the "No listings found" error. Changes: - Added includePrivateListings optional parameter to getBestListing in ListingsAPI and OpenSeaAPI - Updated integration test to use include_private_listings=true - Updated JSDoc documentation 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude --- src/api/api.ts | 8 +++++++- src/api/listings.ts | 7 +++++++ test/integration/fulfillBestListing.spec.ts | 2 +- 3 files changed, 15 insertions(+), 2 deletions(-) diff --git a/src/api/api.ts b/src/api/api.ts index ba3b535da..be8dba665 100644 --- a/src/api/api.ts +++ b/src/api/api.ts @@ -227,13 +227,19 @@ export class OpenSeaAPI { * 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. */ public async getBestListing( collectionSlug: string, tokenId: string | number, + includePrivateListings?: boolean, ): Promise { - return this.listingsAPI.getBestListing(collectionSlug, tokenId); + return this.listingsAPI.getBestListing( + collectionSlug, + tokenId, + includePrivateListings, + ); } /** diff --git a/src/api/listings.ts b/src/api/listings.ts index 32a97f276..409d675d5 100644 --- a/src/api/listings.ts +++ b/src/api/listings.ts @@ -38,13 +38,20 @@ export class ListingsAPI { /** * 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) */ async getBestListing( collectionSlug: string, tokenId: string | number, + includePrivateListings?: boolean, ): Promise { const response = await this.fetcher.get( getBestListingAPIPath(collectionSlug, tokenId), + includePrivateListings !== undefined + ? { include_private_listings: includePrivateListings } + : undefined, ); return response; } diff --git a/test/integration/fulfillBestListing.spec.ts b/test/integration/fulfillBestListing.spec.ts index 0e391b718..b65b3a223 100644 --- a/test/integration/fulfillBestListing.spec.ts +++ b/test/integration/fulfillBestListing.spec.ts @@ -38,7 +38,7 @@ suite("SDK: fulfill best listing", () => { expect(nft.collection).to.be.a("string"); const slug = nft.collection; - const listing = await sdkClient.api.getBestListing(slug, tokenId); + const listing = await sdkClient.api.getBestListing(slug, tokenId, true); expect(listing).to.exist; expect(listing.chain).to.equal(chain); expect(listing.order_hash).to.be.a("string"); From fb856ecd40ad8ecdfe4d55ed0faf196b18e78062 Mon Sep 17 00:00:00 2001 From: Ryan Ghods Date: Thu, 30 Oct 2025 16:16:16 -0700 Subject: [PATCH 4/4] feat: add includePrivateListings to getAllListings, getBestListings, and getNFTListings MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Add support for include_private_listings query parameter to listing endpoints to match backend API changes. Changes: - Added includePrivateListings parameter to getAllListings, getBestListings, and getNFTListings in ListingsAPI - Updated corresponding public API methods in OpenSeaAPI - Updated JSDoc documentation for all affected methods - All tests passing Aligns SDK with backend PR that adds include_private_listings support to: - GET /api/v2/listings/collection/{slug}/best - GET /api/v2/listings/collection/{slug}/nfts/{tokenId}/best - GET /api/v2/listings/collection/{slug}/all - GET /api/v2/chain/{chain}/protocol/{protocol}/orders 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude --- src/api/api.ts | 21 +++++++++++++++++++-- src/api/listings.ts | 40 ++++++++++++++++++++++++++++++++++------ 2 files changed, 53 insertions(+), 8 deletions(-) diff --git a/src/api/api.ts b/src/api/api.ts index be8dba665..d292158c9 100644 --- a/src/api/api.ts +++ b/src/api/api.ts @@ -169,14 +169,21 @@ export class OpenSeaAPI { * @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. */ public async getAllListings( collectionSlug: string, limit?: number, next?: string, + includePrivateListings?: boolean, ): Promise { - return this.listingsAPI.getAllListings(collectionSlug, limit, next); + return this.listingsAPI.getAllListings( + collectionSlug, + limit, + next, + includePrivateListings, + ); } /** @@ -247,14 +254,21 @@ export class OpenSeaAPI { * @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. */ public async getBestListings( collectionSlug: string, limit?: number, next?: string, + includePrivateListings?: boolean, ): Promise { - return this.listingsAPI.getBestListings(collectionSlug, limit, next); + return this.listingsAPI.getBestListings( + collectionSlug, + limit, + next, + includePrivateListings, + ); } /** @@ -648,6 +662,7 @@ export class OpenSeaAPI { * @param limit The number of listings to return. Must be between 1 and 100. * @param next The cursor for the next page of results. This is returned from a previous request. * @param chain The chain where the NFT is located. Defaults to the chain set in the constructor. + * @param includePrivateListings Whether to include private listings (default: false) * @returns The {@link GetListingsResponse} returned by the API. */ public async getNFTListings( @@ -656,6 +671,7 @@ export class OpenSeaAPI { limit?: number, next?: string, chain: Chain = this.chain, + includePrivateListings?: boolean, ): Promise { return this.listingsAPI.getNFTListings( assetContractAddress, @@ -663,6 +679,7 @@ export class OpenSeaAPI { limit, next, chain, + includePrivateListings, ); } diff --git a/src/api/listings.ts b/src/api/listings.ts index 409d675d5..c41e27f2c 100644 --- a/src/api/listings.ts +++ b/src/api/listings.ts @@ -20,17 +20,25 @@ export class ListingsAPI { /** * 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) */ async getAllListings( collectionSlug: string, limit?: number, next?: string, + includePrivateListings?: boolean, ): Promise { const response = await this.fetcher.get( getAllListingsAPIPath(collectionSlug), { limit, next, + ...(includePrivateListings !== undefined && { + include_private_listings: includePrivateListings, + }), }, ); return response; @@ -58,17 +66,25 @@ export class ListingsAPI { /** * 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) */ async getBestListings( collectionSlug: string, limit?: number, next?: string, + includePrivateListings?: boolean, ): Promise { const response = await this.fetcher.get( getBestListingsAPIPath(collectionSlug), { limit, next, + ...(includePrivateListings !== undefined && { + include_private_listings: includePrivateListings, + }), }, ); return response; @@ -76,6 +92,12 @@ export class ListingsAPI { /** * 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) */ async getNFTListings( assetContractAddress: string, @@ -83,15 +105,21 @@ export class ListingsAPI { limit?: number, next?: string, chain: Chain = this.chain, + includePrivateListings?: boolean, ): Promise { const response = await this.fetcher.get( getOrdersAPIPath(chain, "seaport", OrderSide.LISTING), - serializeOrdersQueryOptions({ - assetContractAddress, - tokenIds: [tokenId], - limit, - next, - }), + { + ...serializeOrdersQueryOptions({ + assetContractAddress, + tokenIds: [tokenId], + limit, + next, + }), + ...(includePrivateListings !== undefined && { + include_private_listings: includePrivateListings, + }), + }, ); return response; }