@opensea/sdk 14.2.0 → 14.3.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md CHANGED
@@ -108,7 +108,9 @@ the namespaced method of the same name, except four that were renamed; see the
108
108
 
109
109
  ### Optional discovery data
110
110
 
111
- Existing methods accept opt-in data without changing their defaults. `api.collections.getCollectionOfferAggregates(slug, { includeDepth: true })` adds capped two-sided depth. `api.accounts.getAccount(address, { include: ["wallets"] })` expands public registered wallets.
111
+ Existing methods accept opt-in data without changing their defaults. `api.collections.getCollectionStats(slug, { volumeTimeframe: "seven_days" })` adds volume history; `api.collections.getCollectionOfferAggregates(slug, { includeDepth: true })` adds capped two-sided depth. `api.nfts.getNFTsByGroup(group, { includeCatalog: true })` requests optional catalog identities. The response omits them before unrestricted public launch or when no identity is available; this option does not bypass lab gating. `api.accounts.getAccount(address, { include: ["wallets"] })` expands public registered wallets.
112
+
113
+ Volume history is oldest first. Each bucket has a numeric Unix-seconds `time`, decimal-string `usd`, and `native` currency amount. Missing buckets are omitted, and the current bucket can be incomplete.
112
114
 
113
115
  `api.nfts.getNFTsByCollection` keeps its first five positional arguments and accepts listing, price, rarity, numeric-trait and ordering filters as a sixth argument. See [the collection NFT parameters](developerDocs/api-reference.md#get-nfts-by-collection). Keep filters and ordering unchanged across cursor pages.
114
116
 
@@ -1,6 +1,6 @@
1
1
  import type { Chain, OpenSeaCollection, OpenSeaCollectionStats } from "../types";
2
2
  import type { Fetcher } from "./fetcher";
3
- import { type BatchCollectionsRequest, type CollectionBatchResponse, type CollectionFloorPricesArgs, type CollectionHoldersArgs, type CollectionHoldersPaginatedResponse, type CollectionOfferAggregatesArgs, type CollectionOfferAggregatesPaginatedResponse, CollectionOrderByOption, type CollectionPfpProfilesResponse, type CreatorFeeEnforcementStatusResponse, type FloorPriceHistoryResponse, type GetCollectionPfpProfilesArgs, type GetCollectionsPaginatedResponse, type GetCollectionsResponse, type GetTopCollectionsArgs, type GetTopPfpCollectionsArgs, type GetTraitsResponse, type GetTrendingCollectionsArgs, type TopPfpCollectionsResponse, type TraitFloorsResponse } from "./types";
3
+ import { type BatchCollectionsRequest, type CollectionBatchResponse, type CollectionFloorPricesArgs, type CollectionHoldersArgs, type CollectionHoldersPaginatedResponse, type CollectionOfferAggregatesArgs, type CollectionOfferAggregatesPaginatedResponse, CollectionOrderByOption, type CollectionPfpProfilesResponse, type CollectionStatsArgs, type CreatorFeeEnforcementStatusResponse, type FloorPriceHistoryResponse, type GetCollectionPfpProfilesArgs, type GetCollectionsPaginatedResponse, type GetCollectionsResponse, type GetTopCollectionsArgs, type GetTopPfpCollectionsArgs, type GetTraitsResponse, type GetTrendingCollectionsArgs, type TopPfpCollectionsResponse, type TraitFloorsResponse } from "./types";
4
4
  /**
5
5
  * Collection-related API operations
6
6
  */
@@ -27,7 +27,7 @@ export declare class CollectionsAPI {
27
27
  /**
28
28
  * Fetch stats for an OpenSea collection.
29
29
  */
30
- getCollectionStats(slug: string): Promise<OpenSeaCollectionStats>;
30
+ getCollectionStats(slug: string, args?: CollectionStatsArgs): Promise<OpenSeaCollectionStats>;
31
31
  /**
32
32
  * Fetch all traits for a collection with their possible values and counts.
33
33
  *
@@ -47,9 +47,9 @@ class CollectionsAPI {
47
47
  /**
48
48
  * Fetch stats for an OpenSea collection.
49
49
  */
50
- async getCollectionStats(slug) {
50
+ async getCollectionStats(slug, args) {
51
51
  const path = (0, apiPaths_1.getCollectionStatsPath)(slug);
52
- const response = await this.fetcher.get(path);
52
+ const response = await this.fetcher.get(path, args);
53
53
  return response;
54
54
  }
55
55
  /**
@@ -1 +1 @@
1
- {"version":3,"file":"collections.js","sourceRoot":"","sources":["../../src/api/collections.ts"],"names":[],"mappings":";;;AACA,yCAemB;AAEnB,mCAuBgB;AAEhB;;GAEG;AACH;IACsB,OAAO;IAA3B,YAAoB,OAAgB;uBAAhB,OAAO;IAAY,CAAC;IAExC;;OAEG;IACH,KAAK,CAAC,aAAa,CAA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CAAC,OAAO,CAAC,GAAG,CACrB,IAAA,uCAA4B,EAAC,IAAI,CAAC,CACnC,CAAA;IACH,CAAC;IAED;;;OAGG;IACH,KAAK,CAAC,wBAAwB,CAC5B,IAAY,EACZ,IAAmC;QAEnC,OAAO,IAAI,CAAC,OAAO,CAAC,GAAG,CACrB,IAAA,uCAA4B,EAAC,IAAI,CAAC,EAClC,IAAI,CACL,CAAA;IACH,CAAC;IAED;;;;OAIG;IACH,KAAK,CAAC,oBAAoB,CACxB,IAA8B;QAE9B,MAAM,EAAE,KAAK,EAAE,MAAM,EAAE,GAAG,KAAK,EAAE,GAAG,IAEnC,CAAA;QACD,OAAO,IAAI,CAAC,OAAO,CAAC,GAAG,CACrB,IAAA,mCAAwB,GAAE,EAC1B,KAAK,CACN,CAAA;IACH,CAAC;CACF"}
1
+ {"version":3,"file":"collections.js","sourceRoot":"","sources":["../../src/api/collections.ts"],"names":[],"mappings":";;;AACA,yCAemB;AAEnB,mCAwBgB;AAEhB;;GAEG;AACH;IACsB,OAAO;IAA3B,YAAoB,OAAgB;uBAAhB,OAAO;IAAY,CAAC;IAExC;;OAEG;IACH,KAAK,CAAC,aAAa,CAAC,IAAY;QAC9B,MAAM,IAAI,GAAG,IAAA,4BAAiB,EAAC,IAAI,CAAC,CAAA;QACpC,OAAO,IAAI,CAAC,OAAO,CAAC,GAAG,CAAwB,IAAI,CAAC,CAAA;IACtD,CAAC;IAED;;;;;;;OAOG;IACH,KAAK,CAAC,wBAAwB,CAAC,IAAY;QACzC,OAAO,IAAI,CAAC,OAAO,CAAC,GAAG,CACrB,IAAA,uCAA4B,EAAC,IAAI,CAAC,CACnC,CAAA;IACH,CAAC;IAED;;OAEG;IACH,KAAK,CAAC,cAAc,CAClB,OAAO,GAA4B,+BAAuB,CAAC,YAAY,EACvE,KAAa,EACb,eAAwB,EACxB,aAAa,GAAY,KAAK,EAC9B,KAAc,EACd,IAAa;QAEb,MAAM,IAAI,GAAG,IAAA,6BAAkB,GAAE,CAA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K,CACN,CAAA;IACH,CAAC;CACF"}
@@ -1246,6 +1246,8 @@ export type NFTGroupSortBy = "price" | "top_offer" | "last_sale" | "last_sale_da
1246
1246
  * @category API Query Args
1247
1247
  */
1248
1248
  export interface GetNFTsByGroupArgs extends NFTGroupFacetFilters {
1249
+ /** Request optional catalog identities; omitted before unrestricted public launch. */
1250
+ includeCatalog?: OperationQueryParams<"list_nfts_by_group">["include_catalog"];
1249
1251
  /** Restrict results to these collections in the group (max 10). Defaults to the whole group. */
1250
1252
  collectionSlugs?: string[];
1251
1253
  /** Full-text match on NFT name, up to 100 characters. */
@@ -1447,6 +1449,8 @@ export type GetSignalResponse = Camelize<SignalResponse>;
1447
1449
  export type ListSignalsResponse = Camelize<SignalsResponse>;
1448
1450
  /** Indexed filters for collection NFTs. Numeric traits is a JSON array of traitType/min/max ranges. */
1449
1451
  export type CollectionNFTFilters = Camelize<Pick<OperationQueryParams<"get_nfts_by_collection">, "is_listed" | "price_min" | "price_max" | "rarity_min" | "rarity_max" | "sort_by" | "sort_direction" | "numeric_traits">>;
1452
+ /** Optional volume buckets: numeric Unix seconds and decimal-string USD values. */
1453
+ export type CollectionStatsArgs = Camelize<OperationQueryParams<"get_collection_stats">>;
1450
1454
  /** Optional capped two-sided collection depth. */
1451
1455
  export type CollectionOfferAggregatesArgs = PaginatedAnalyticsArgs & Camelize<Pick<OperationQueryParams<"get_collection_offer_aggregates">, "include_depth">>;
1452
1456
  /** Public account expansion; private registered wallets remain excluded. */
package/lib/sdk/base.d.ts CHANGED
@@ -297,6 +297,15 @@ export declare class BaseOpenSeaSDK {
297
297
  programId: string;
298
298
  }[];
299
299
  lastValidBlockHeight?: number | null | undefined;
300
+ marketplaceFeeTransfer?: {
301
+ decimals: number;
302
+ nativeToken: boolean;
303
+ rawAmount: string;
304
+ recipient: string;
305
+ recipientOwner?: string | null | undefined;
306
+ settlement: "separate_transfer" | "unknown";
307
+ tokenAddress: string;
308
+ } | null | undefined;
300
309
  requiresJitoBundle: boolean;
301
310
  serializedTransaction?: string | null | undefined;
302
311
  transactionConfig?: {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@opensea/sdk",
3
- "version": "14.2.0",
3
+ "version": "14.3.0",
4
4
  "description": "TypeScript SDK for the OpenSea marketplace helps developers build new experiences using NFTs, tokens, and our marketplace data",
5
5
  "license": "MIT",
6
6
  "author": "OpenSea Developers",
@@ -47,7 +47,7 @@
47
47
  "types": "lib/index.d.ts",
48
48
  "dependencies": {
49
49
  "@noble/hashes": "^2.0.1",
50
- "@opensea/api-types": "^0.20.1",
50
+ "@opensea/api-types": "^0.20.2",
51
51
  "@opensea/seaport-js": "^4.2.0",
52
52
  "ethers": "^6.16.0"
53
53
  },
@@ -26,6 +26,7 @@ import {
26
26
  type CollectionOfferAggregatesPaginatedResponse,
27
27
  CollectionOrderByOption,
28
28
  type CollectionPfpProfilesResponse,
29
+ type CollectionStatsArgs,
29
30
  type CreatorFeeEnforcementStatusResponse,
30
31
  type FloorPriceHistoryResponse,
31
32
  type GetCollectionPfpProfilesArgs,
@@ -95,9 +96,12 @@ export class CollectionsAPI {
95
96
  /**
96
97
  * Fetch stats for an OpenSea collection.
97
98
  */
98
- async getCollectionStats(slug: string): Promise<OpenSeaCollectionStats> {
99
+ async getCollectionStats(
100
+ slug: string,
101
+ args?: CollectionStatsArgs,
102
+ ): Promise<OpenSeaCollectionStats> {
99
103
  const path = getCollectionStatsPath(slug)
100
- const response = await this.fetcher.get<OpenSeaCollectionStats>(path)
104
+ const response = await this.fetcher.get<OpenSeaCollectionStats>(path, args)
101
105
  return response as OpenSeaCollectionStats
102
106
  }
103
107
 
package/src/api/types.ts CHANGED
@@ -1582,6 +1582,8 @@ export type NFTGroupSortBy =
1582
1582
  * @category API Query Args
1583
1583
  */
1584
1584
  export interface GetNFTsByGroupArgs extends NFTGroupFacetFilters {
1585
+ /** Request optional catalog identities; omitted before unrestricted public launch. */
1586
+ includeCatalog?: OperationQueryParams<"list_nfts_by_group">["include_catalog"]
1585
1587
  /** Restrict results to these collections in the group (max 10). Defaults to the whole group. */
1586
1588
  collectionSlugs?: string[]
1587
1589
  /** Full-text match on NFT name, up to 100 characters. */
@@ -1827,6 +1829,10 @@ export type CollectionNFTFilters = Camelize<
1827
1829
  | "numeric_traits"
1828
1830
  >
1829
1831
  >
1832
+ /** Optional volume buckets: numeric Unix seconds and decimal-string USD values. */
1833
+ export type CollectionStatsArgs = Camelize<
1834
+ OperationQueryParams<"get_collection_stats">
1835
+ >
1830
1836
  /** Optional capped two-sided collection depth. */
1831
1837
  export type CollectionOfferAggregatesArgs = PaginatedAnalyticsArgs &
1832
1838
  Camelize<