@opensea/sdk 12.2.0 → 12.4.1

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/src/api/api.ts CHANGED
@@ -141,6 +141,7 @@ import {
141
141
  type TokenSwapActivityPaginatedResponse,
142
142
  type TokenTimeSeriesArgs,
143
143
  type TraitFilter,
144
+ type TraitFloorsResponse,
144
145
  type TransactionReceiptRequest,
145
146
  type TransactionReceiptResponse,
146
147
  type TransferRequest,
@@ -172,31 +173,46 @@ export class OpenSeaAPI {
172
173
 
173
174
  private apiKey: string | undefined
174
175
  private authToken: string | undefined
176
+ /** Transport for every instance request. See {@link OpenSeaAPIConfig.fetch}. */
177
+ private readonly fetchImpl: typeof globalThis.fetch
175
178
  private chain: Chain
176
179
 
177
- // Specialized API clients
178
- private ordersAPI: OrdersAPI
179
- private offersAPI: OffersAPI
180
- private listingsAPI: ListingsAPI
181
- private collectionsAPI: CollectionsAPI
182
- private nftsAPI: NFTsAPI
183
- private accountsAPI: AccountsAPI
184
- private eventsAPI: EventsAPI
185
- private searchAPI: SearchAPI
186
- private tokensAPI: TokensAPI
187
- private chainsAPI: ChainsAPI
188
- private dropsAPI: DropsAPI
189
- private transactionsAPI: TransactionsAPI
190
- private assetsAPI: AssetsAPI
180
+ /**
181
+ * Per-domain clients. Prefer these over the flat `getCollection` / `getTraits` style methods on
182
+ * this class, which are deprecated and will be removed in the next major.
183
+ *
184
+ * `search` is absent because `SearchAPI` holds a single method also called `search`, so the
185
+ * property and the existing `search()` method want the same name and only one can be added
186
+ * without a break. Call it as `api.search(args)`.
187
+ */
188
+ public readonly orders: OrdersAPI
189
+ public readonly offers: OffersAPI
190
+ public readonly listings: ListingsAPI
191
+ public readonly collections: CollectionsAPI
192
+ public readonly nfts: NFTsAPI
193
+ public readonly accounts: AccountsAPI
194
+ public readonly events: EventsAPI
195
+ public readonly tokens: TokensAPI
196
+ public readonly chains: ChainsAPI
197
+ public readonly drops: DropsAPI
198
+ public readonly transactions: TransactionsAPI
199
+ public readonly assets: AssetsAPI
191
200
  /** Wallet-authenticated scoped REST helpers. */
192
201
  public readonly walletAuth: WalletAuthAPI
193
202
 
203
+ /** See the note above: this one stays private, and `api.search(args)` is the call. */
204
+ private searchAPI: SearchAPI
205
+
194
206
  /**
195
207
  * Create an instance of the OpenSeaAPI
196
208
  * @param config OpenSeaAPIConfig for setting up the API, including an optional API key, Chain name, and base URL
197
209
  * @param logger Optional function for logging debug strings before and after requests are made. Defaults to no logging
198
210
  */
199
211
  constructor(config: OpenSeaAPIConfig, logger?: (arg: string) => void) {
212
+ // Read through globalThis rather than captured at construction, so a caller who swaps
213
+ // globalThis.fetch afterwards still takes effect.
214
+ this.fetchImpl =
215
+ config.fetch ?? ((url, init) => globalThis.fetch(url, init))
200
216
  this.apiKey = config.apiKey
201
217
  this.authToken = config.authToken
202
218
  this.chain = config.chain ?? Chain.Mainnet
@@ -218,19 +234,19 @@ export class OpenSeaAPI {
218
234
  }
219
235
 
220
236
  // Initialize specialized API clients
221
- this.ordersAPI = new OrdersAPI(fetcher, this.chain)
222
- this.offersAPI = new OffersAPI(fetcher, this.chain)
223
- this.listingsAPI = new ListingsAPI(fetcher)
224
- this.collectionsAPI = new CollectionsAPI(fetcher)
225
- this.nftsAPI = new NFTsAPI(fetcher, this.chain)
226
- this.accountsAPI = new AccountsAPI(fetcher, this.chain)
227
- this.eventsAPI = new EventsAPI(fetcher)
237
+ this.orders = new OrdersAPI(fetcher, this.chain)
238
+ this.offers = new OffersAPI(fetcher, this.chain)
239
+ this.listings = new ListingsAPI(fetcher)
240
+ this.collections = new CollectionsAPI(fetcher)
241
+ this.nfts = new NFTsAPI(fetcher, this.chain)
242
+ this.accounts = new AccountsAPI(fetcher, this.chain)
243
+ this.events = new EventsAPI(fetcher)
228
244
  this.searchAPI = new SearchAPI(fetcher)
229
- this.tokensAPI = new TokensAPI(fetcher)
230
- this.chainsAPI = new ChainsAPI(fetcher)
231
- this.dropsAPI = new DropsAPI(fetcher)
232
- this.transactionsAPI = new TransactionsAPI(fetcher)
233
- this.assetsAPI = new AssetsAPI(fetcher)
245
+ this.tokens = new TokensAPI(fetcher)
246
+ this.chains = new ChainsAPI(fetcher)
247
+ this.drops = new DropsAPI(fetcher)
248
+ this.transactions = new TransactionsAPI(fetcher)
249
+ this.assets = new AssetsAPI(fetcher)
234
250
  this.walletAuth = new WalletAuthAPI(fetcher)
235
251
  }
236
252
 
@@ -241,13 +257,14 @@ export class OpenSeaAPI {
241
257
  * @param chain The chain where the order is located. Defaults to the chain set in the constructor.
242
258
  * @returns The {@link GetOrderByHashResponse} returned by the API (can be Offer or Listing)
243
259
  * @throws An error if the order is not found
260
+ * @deprecated Use `api.orders.getOrderByHash()`. Removed in the next major.
244
261
  */
245
262
  public async getOrderByHash(
246
263
  orderHash: string,
247
264
  protocolAddress: string,
248
265
  chain: Chain = this.chain,
249
266
  ): Promise<GetOrderByHashResponse> {
250
- return this.ordersAPI.getOrderByHash(orderHash, protocolAddress, chain)
267
+ return this.orders.getOrderByHash(orderHash, protocolAddress, chain)
251
268
  }
252
269
 
253
270
  /**
@@ -256,13 +273,14 @@ export class OpenSeaAPI {
256
273
  * @param limit The number of offers to return. Must be between 1 and 100. Default: 100
257
274
  * @param next The cursor for the next page of results. This is returned from a previous request.
258
275
  * @returns The {@link GetOffersResponse} returned by the API.
276
+ * @deprecated Use `api.offers.getAllOffers()`. Removed in the next major.
259
277
  */
260
278
  public async getAllOffers(
261
279
  collectionSlug: string,
262
280
  limit?: number,
263
281
  next?: string,
264
282
  ): Promise<GetOffersResponse> {
265
- return this.offersAPI.getAllOffers(collectionSlug, limit, next)
283
+ return this.offers.getAllOffers(collectionSlug, limit, next)
266
284
  }
267
285
 
268
286
  /**
@@ -272,6 +290,7 @@ export class OpenSeaAPI {
272
290
  * @param next The cursor for the next page of results. This is returned from a previous request.
273
291
  * @param includePrivateListings Whether to include private listings (default: false)
274
292
  * @returns The {@link GetListingsResponse} returned by the API.
293
+ * @deprecated Use `api.listings.getAllListings()`. Removed in the next major.
275
294
  */
276
295
  public async getAllListings(
277
296
  collectionSlug: string,
@@ -279,7 +298,7 @@ export class OpenSeaAPI {
279
298
  next?: string,
280
299
  includePrivateListings?: boolean,
281
300
  ): Promise<GetListingsResponse> {
282
- return this.listingsAPI.getAllListings(
301
+ return this.listings.getAllListings(
283
302
  collectionSlug,
284
303
  limit,
285
304
  next,
@@ -297,6 +316,7 @@ export class OpenSeaAPI {
297
316
  * @param floatValue The value of the trait for decimal-based numeric traits.
298
317
  * @param intValue The value of the trait for integer-based numeric traits.
299
318
  * @returns The {@link GetOffersResponse} returned by the API.
319
+ * @deprecated Use `api.offers.getTraitOffers()`. Removed in the next major.
300
320
  */
301
321
  public async getTraitOffers(
302
322
  collectionSlug: string,
@@ -307,7 +327,7 @@ export class OpenSeaAPI {
307
327
  floatValue?: number,
308
328
  intValue?: number,
309
329
  ): Promise<GetOffersResponse> {
310
- return this.offersAPI.getTraitOffers(
330
+ return this.offers.getTraitOffers(
311
331
  collectionSlug,
312
332
  type,
313
333
  value,
@@ -323,12 +343,13 @@ export class OpenSeaAPI {
323
343
  * @param collectionSlug The slug of the collection.
324
344
  * @param tokenId The token identifier.
325
345
  * @returns The {@link GetBestOfferResponse} returned by the API.
346
+ * @deprecated Use `api.offers.getBestOffer()`. Removed in the next major.
326
347
  */
327
348
  public async getBestOffer(
328
349
  collectionSlug: string,
329
350
  tokenId: string | number,
330
351
  ): Promise<GetBestOfferResponse> {
331
- return this.offersAPI.getBestOffer(collectionSlug, tokenId)
352
+ return this.offers.getBestOffer(collectionSlug, tokenId)
332
353
  }
333
354
 
334
355
  /**
@@ -337,13 +358,14 @@ export class OpenSeaAPI {
337
358
  * @param tokenId The token identifier.
338
359
  * @param includePrivateListings Whether to include private listings (default: false)
339
360
  * @returns The {@link GetBestListingResponse} returned by the API.
361
+ * @deprecated Use `api.listings.getBestListing()`. Removed in the next major.
340
362
  */
341
363
  public async getBestListing(
342
364
  collectionSlug: string,
343
365
  tokenId: string | number,
344
366
  includePrivateListings?: boolean,
345
367
  ): Promise<GetBestListingResponse> {
346
- return this.listingsAPI.getBestListing(
368
+ return this.listings.getBestListing(
347
369
  collectionSlug,
348
370
  tokenId,
349
371
  includePrivateListings,
@@ -358,6 +380,7 @@ export class OpenSeaAPI {
358
380
  * @param includePrivateListings Whether to include private listings (default: false)
359
381
  * @param traits Optional {@link TraitFilter} array. Returns 400 if a single trait matches more than 1000 items.
360
382
  * @returns The {@link GetListingsResponse} returned by the API.
383
+ * @deprecated Use `api.listings.getBestListings()`. Removed in the next major.
361
384
  */
362
385
  public async getBestListings(
363
386
  collectionSlug: string,
@@ -366,7 +389,7 @@ export class OpenSeaAPI {
366
389
  includePrivateListings?: boolean,
367
390
  traits?: TraitFilter[],
368
391
  ): Promise<GetListingsResponse> {
369
- return this.listingsAPI.getBestListings(
392
+ return this.listings.getBestListings(
370
393
  collectionSlug,
371
394
  limit,
372
395
  next,
@@ -381,11 +404,12 @@ export class OpenSeaAPI {
381
404
  * All listings must be EVM (Seaport orders). Payment can be from any chain (EVM or SVM).
382
405
  * @param request The cross-chain fulfillment request containing listings, fulfiller, payment, and optional recipient
383
406
  * @returns The {@link CrossChainFulfillmentResponse} with ordered transactions to sign and submit
407
+ * @deprecated Use `api.listings.getCrossChainFulfillmentData()`. Removed in the next major.
384
408
  */
385
409
  public async getCrossChainFulfillmentData(
386
410
  request: CrossChainFulfillmentRequest,
387
411
  ): Promise<CrossChainFulfillmentResponse> {
388
- return this.listingsAPI.getCrossChainFulfillmentData(request)
412
+ return this.listings.getCrossChainFulfillmentData(request)
389
413
  }
390
414
 
391
415
  /**
@@ -400,6 +424,7 @@ export class OpenSeaAPI {
400
424
  * @param recipientAddress Optional recipient address for the NFT when fulfilling a listing. Not applicable for offers.
401
425
  * @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.
402
426
  * @returns The {@link FulfillmentDataResponse}
427
+ * @deprecated Use `api.orders.generateFulfillmentData()`. Removed in the next major.
403
428
  */
404
429
  public async generateFulfillmentData(
405
430
  fulfillerAddress: string,
@@ -412,7 +437,7 @@ export class OpenSeaAPI {
412
437
  recipientAddress?: string,
413
438
  includeOptionalCreatorFees: boolean = false,
414
439
  ): Promise<Camelize<FulfillmentDataResponse>> {
415
- return this.ordersAPI.generateFulfillmentData(
440
+ return this.orders.generateFulfillmentData(
416
441
  fulfillerAddress,
417
442
  orderHash,
418
443
  protocolAddress,
@@ -430,12 +455,13 @@ export class OpenSeaAPI {
430
455
  * @param order The order to post
431
456
  * @param protocolAddress The contract address of the seaport protocol
432
457
  * @returns The {@link Listing} posted to the API.
458
+ * @deprecated Use `api.orders.postListing()`. Removed in the next major.
433
459
  */
434
460
  public async postListing(
435
461
  order: ProtocolData,
436
462
  protocolAddress: string,
437
463
  ): Promise<Listing> {
438
- return this.ordersAPI.postListing(order, protocolAddress)
464
+ return this.orders.postListing(order, protocolAddress)
439
465
  }
440
466
 
441
467
  /**
@@ -443,12 +469,13 @@ export class OpenSeaAPI {
443
469
  * @param order The order to post
444
470
  * @param protocolAddress The contract address of the seaport protocol
445
471
  * @returns The {@link Offer} posted to the API.
472
+ * @deprecated Use `api.orders.postOffer()`. Removed in the next major.
446
473
  */
447
474
  public async postOffer(
448
475
  order: ProtocolData,
449
476
  protocolAddress: string,
450
477
  ): Promise<Offer> {
451
- return this.ordersAPI.postOffer(order, protocolAddress)
478
+ return this.orders.postOffer(order, protocolAddress)
452
479
  }
453
480
 
454
481
  /**
@@ -462,6 +489,7 @@ export class OpenSeaAPI {
462
489
  * @param traits If defined, an array of traits to create the multi-trait collection offer for.
463
490
  * @param numericTraits If defined, an array of numeric trait criteria with min/max ranges.
464
491
  * @returns The {@link BuildOfferResponse} returned by the API.
492
+ * @deprecated Use `api.offers.buildOffer()`. Removed in the next major.
465
493
  */
466
494
  public async buildOffer(
467
495
  offererAddress: string,
@@ -473,7 +501,7 @@ export class OpenSeaAPI {
473
501
  traits?: Array<{ type: string; value: string }>,
474
502
  numericTraits?: Array<{ type: string; min?: number; max?: number }>,
475
503
  ): Promise<BuildOfferResponse> {
476
- return this.offersAPI.buildOffer(
504
+ return this.offers.buildOffer(
477
505
  offererAddress,
478
506
  quantity,
479
507
  collectionSlug,
@@ -491,13 +519,14 @@ export class OpenSeaAPI {
491
519
  * @param limit Optional limit for number of results.
492
520
  * @param next Optional cursor for pagination.
493
521
  * @returns The {@link GetOffersResponse} returned by the API.
522
+ * @deprecated Use `api.offers.getCollectionOffers()`. Removed in the next major.
494
523
  */
495
524
  public async getCollectionOffers(
496
525
  slug: string,
497
526
  limit?: number,
498
527
  next?: string,
499
528
  ): Promise<GetOffersResponse> {
500
- return this.offersAPI.getCollectionOffers(slug, limit, next)
529
+ return this.offers.getCollectionOffers(slug, limit, next)
501
530
  }
502
531
 
503
532
  /**
@@ -509,6 +538,7 @@ export class OpenSeaAPI {
509
538
  * @param traits If defined, an array of traits to create the multi-trait collection offer for.
510
539
  * @param numericTraits If defined, an array of numeric trait criteria with min/max ranges.
511
540
  * @returns The {@link Offer} returned to the API.
541
+ * @deprecated Use `api.offers.postCollectionOffer()`. Removed in the next major.
512
542
  */
513
543
  public async postCollectionOffer(
514
544
  order: ProtocolData,
@@ -518,7 +548,7 @@ export class OpenSeaAPI {
518
548
  traits?: Array<{ type: string; value: string }>,
519
549
  numericTraits?: Array<{ type: string; min?: number; max?: number }>,
520
550
  ): Promise<CollectionOffer | null> {
521
- return this.offersAPI.postCollectionOffer(
551
+ return this.offers.postCollectionOffer(
522
552
  order,
523
553
  slug,
524
554
  traitType,
@@ -535,6 +565,7 @@ export class OpenSeaAPI {
535
565
  * @param next Cursor to retrieve the next page of NFTs
536
566
  * @param traits Optional {@link TraitFilter} array. Returns 400 if a single trait matches more than 1000 items.
537
567
  * @returns The {@link ListNFTsResponse} returned by the API.
568
+ * @deprecated Use `api.nfts.getNFTsByCollection()`. Removed in the next major.
538
569
  */
539
570
  public async getNFTsByCollection(
540
571
  slug: string,
@@ -542,7 +573,7 @@ export class OpenSeaAPI {
542
573
  next: string | undefined = undefined,
543
574
  traits: TraitFilter[] | undefined = undefined,
544
575
  ): Promise<ListNFTsResponse> {
545
- return this.nftsAPI.getNFTsByCollection(slug, limit, next, traits)
576
+ return this.nfts.getNFTsByCollection(slug, limit, next, traits)
546
577
  }
547
578
 
548
579
  /**
@@ -552,6 +583,7 @@ export class OpenSeaAPI {
552
583
  * @param next Cursor to retrieve the next page of NFTs.
553
584
  * @param chain The NFT's chain.
554
585
  * @returns The {@link ListNFTsResponse} returned by the API.
586
+ * @deprecated Use `api.nfts.getNFTsByContract()`. Removed in the next major.
555
587
  */
556
588
  public async getNFTsByContract(
557
589
  address: string,
@@ -559,7 +591,7 @@ export class OpenSeaAPI {
559
591
  next: string | undefined = undefined,
560
592
  chain: Chain = this.chain,
561
593
  ): Promise<ListNFTsResponse> {
562
- return this.nftsAPI.getNFTsByContract(address, limit, next, chain)
594
+ return this.nfts.getNFTsByContract(address, limit, next, chain)
563
595
  }
564
596
 
565
597
  /**
@@ -569,6 +601,7 @@ export class OpenSeaAPI {
569
601
  * @param next Cursor to retrieve the next page of NFTs
570
602
  * @param chain The chain to query. Defaults to the chain set in the constructor.
571
603
  * @returns The {@link ListNFTsResponse} returned by the API.
604
+ * @deprecated Use `api.nfts.getNFTsByAccount()`. Removed in the next major.
572
605
  */
573
606
  public async getNFTsByAccount(
574
607
  address: string,
@@ -576,7 +609,7 @@ export class OpenSeaAPI {
576
609
  next: string | undefined = undefined,
577
610
  chain = this.chain,
578
611
  ): Promise<ListNFTsResponse> {
579
- return this.nftsAPI.getNFTsByAccount(address, limit, next, chain)
612
+ return this.nfts.getNFTsByAccount(address, limit, next, chain)
580
613
  }
581
614
 
582
615
  /**
@@ -585,22 +618,24 @@ export class OpenSeaAPI {
585
618
  * @param identifier the identifier of the NFT (i.e. Token ID)
586
619
  * @param chain The NFT's chain.
587
620
  * @returns The {@link GetNFTResponse} returned by the API.
621
+ * @deprecated Use `api.nfts.getNFT()`. Removed in the next major.
588
622
  */
589
623
  public async getNFT(
590
624
  address: string,
591
625
  identifier: string,
592
626
  chain = this.chain,
593
627
  ): Promise<GetNFTResponse> {
594
- return this.nftsAPI.getNFT(address, identifier, chain)
628
+ return this.nfts.getNFT(address, identifier, chain)
595
629
  }
596
630
 
597
631
  /**
598
632
  * Fetch an OpenSea collection.
599
633
  * @param slug The slug (identifier) of the collection.
600
634
  * @returns The {@link OpenSeaCollection} returned by the API.
635
+ * @deprecated Use `api.collections.getCollection()`. Removed in the next major.
601
636
  */
602
637
  public async getCollection(slug: string): Promise<OpenSeaCollection> {
603
- return this.collectionsAPI.getCollection(slug)
638
+ return this.collections.getCollection(slug)
604
639
  }
605
640
 
606
641
  /**
@@ -612,6 +647,7 @@ export class OpenSeaAPI {
612
647
  * @param limit The limit of collections to return.
613
648
  * @param next The cursor for the next page of results. This is returned from a previous request.
614
649
  * @returns List of {@link OpenSeaCollection} returned by the API.
650
+ * @deprecated Use `api.collections.getCollections()`. Removed in the next major.
615
651
  */
616
652
  public async getCollections(
617
653
  orderBy: CollectionOrderByOption = CollectionOrderByOption.CREATED_DATE,
@@ -621,7 +657,7 @@ export class OpenSeaAPI {
621
657
  limit?: number,
622
658
  next?: string,
623
659
  ): Promise<GetCollectionsResponse> {
624
- return this.collectionsAPI.getCollections(
660
+ return this.collections.getCollections(
625
661
  orderBy,
626
662
  chain,
627
663
  creatorUsername,
@@ -635,11 +671,12 @@ export class OpenSeaAPI {
635
671
  * Fetch stats for an OpenSea collection.
636
672
  * @param slug The slug (identifier) of the collection.
637
673
  * @returns The {@link OpenSeaCollection} returned by the API.
674
+ * @deprecated Use `api.collections.getCollectionStats()`. Removed in the next major.
638
675
  */
639
676
  public async getCollectionStats(
640
677
  slug: string,
641
678
  ): Promise<OpenSeaCollectionStats> {
642
- return this.collectionsAPI.getCollectionStats(slug)
679
+ return this.collections.getCollectionStats(slug)
643
680
  }
644
681
 
645
682
  /**
@@ -647,21 +684,23 @@ export class OpenSeaAPI {
647
684
  * @param address The address of the payment token
648
685
  * @param chain The chain of the payment token
649
686
  * @returns The {@link OpenSeaPaymentToken} returned by the API.
687
+ * @deprecated Use `api.accounts.getPaymentToken()`. Removed in the next major.
650
688
  */
651
689
  public async getPaymentToken(
652
690
  address: string,
653
691
  chain = this.chain,
654
692
  ): Promise<OpenSeaPaymentToken> {
655
- return this.accountsAPI.getPaymentToken(address, chain)
693
+ return this.accounts.getPaymentToken(address, chain)
656
694
  }
657
695
 
658
696
  /**
659
697
  * Fetch account for an address.
660
698
  * @param address The address to fetch the account for
661
699
  * @returns The {@link OpenSeaAccount} returned by the API.
700
+ * @deprecated Use `api.accounts.getAccount()`. Removed in the next major.
662
701
  */
663
702
  public async getAccount(address: string): Promise<OpenSeaAccount> {
664
- return this.accountsAPI.getAccount(address)
703
+ return this.accounts.getAccount(address)
665
704
  }
666
705
 
667
706
  /**
@@ -670,13 +709,14 @@ export class OpenSeaAPI {
670
709
  * @param identifier The identifier of the NFT.
671
710
  * @param chain The chain where the NFT is located.
672
711
  * @returns The response from the API.
712
+ * @deprecated Use `api.nfts.refreshNFTMetadata()`. Removed in the next major.
673
713
  */
674
714
  public async refreshNFTMetadata(
675
715
  address: string,
676
716
  identifier: string,
677
717
  chain: Chain = this.chain,
678
718
  ): Promise<Record<string, unknown>> {
679
- return this.nftsAPI.refreshNFTMetadata(address, identifier, chain)
719
+ return this.nfts.refreshNFTMetadata(address, identifier, chain)
680
720
  }
681
721
 
682
722
  /**
@@ -692,6 +732,7 @@ export class OpenSeaAPI {
692
732
  * name, version, address, and chain. The struct to sign is `OrderHash` containing a
693
733
  * single bytes32 field.
694
734
  * @returns The response from the API.
735
+ * @deprecated Use `api.orders.offchainCancelOrder()`. Removed in the next major.
695
736
  */
696
737
  public async offchainCancelOrder(
697
738
  protocolAddress: string,
@@ -699,7 +740,7 @@ export class OpenSeaAPI {
699
740
  chain: Chain = this.chain,
700
741
  offererSignature?: string,
701
742
  ): Promise<CancelOrderResponse> {
702
- return this.ordersAPI.offchainCancelOrder(
743
+ return this.orders.offchainCancelOrder(
703
744
  protocolAddress,
704
745
  orderHash,
705
746
  chain,
@@ -709,6 +750,7 @@ export class OpenSeaAPI {
709
750
 
710
751
  /**
711
752
  * Get ordered actions to cancel an order onchain.
753
+ * @deprecated Use `api.orders.createCancelOrderActions()`. Removed in the next major.
712
754
  */
713
755
  public async createCancelOrderActions(
714
756
  protocolAddress: string,
@@ -716,7 +758,7 @@ export class OpenSeaAPI {
716
758
  request: CreateCancelOrderActionsRequest,
717
759
  chain: Chain = this.chain,
718
760
  ): Promise<CreateCancelOrderActionsResponse> {
719
- return this.ordersAPI.createCancelOrderActions(
761
+ return this.orders.createCancelOrderActions(
720
762
  protocolAddress,
721
763
  orderIdentifier,
722
764
  request,
@@ -728,9 +770,10 @@ export class OpenSeaAPI {
728
770
  * Gets a list of events based on query parameters.
729
771
  * @param args Query parameters for filtering events.
730
772
  * @returns The {@link GetEventsResponse} returned by the API.
773
+ * @deprecated Use `api.events.getEvents()`. Removed in the next major.
731
774
  */
732
775
  public async getEvents(args?: GetEventsArgs): Promise<GetEventsResponse> {
733
- return this.eventsAPI.getEvents(args)
776
+ return this.events.getEvents(args)
734
777
  }
735
778
 
736
779
  /**
@@ -738,12 +781,13 @@ export class OpenSeaAPI {
738
781
  * @param address The account address.
739
782
  * @param args Query parameters for filtering events.
740
783
  * @returns The {@link GetEventsResponse} returned by the API.
784
+ * @deprecated Use `api.events.getEventsByAccount()`. Removed in the next major.
741
785
  */
742
786
  public async getEventsByAccount(
743
787
  address: string,
744
788
  args?: GetEventsArgs,
745
789
  ): Promise<GetEventsResponse> {
746
- return this.eventsAPI.getEventsByAccount(address, args)
790
+ return this.events.getEventsByAccount(address, args)
747
791
  }
748
792
 
749
793
  /**
@@ -752,12 +796,13 @@ export class OpenSeaAPI {
752
796
  * @param collectionSlug The slug (identifier) of the collection.
753
797
  * @param args Query parameters; see {@link GetEventsByCollectionArgs}.
754
798
  * @returns The {@link GetEventsResponse} returned by the API.
799
+ * @deprecated Use `api.events.getEventsByCollection()`. Removed in the next major.
755
800
  */
756
801
  public async getEventsByCollection(
757
802
  collectionSlug: string,
758
803
  args?: GetEventsByCollectionArgs,
759
804
  ): Promise<GetEventsResponse> {
760
- return this.eventsAPI.getEventsByCollection(collectionSlug, args)
805
+ return this.events.getEventsByCollection(collectionSlug, args)
761
806
  }
762
807
 
763
808
  /**
@@ -767,6 +812,7 @@ export class OpenSeaAPI {
767
812
  * @param identifier The token identifier.
768
813
  * @param args Query parameters for filtering events.
769
814
  * @returns The {@link GetEventsResponse} returned by the API.
815
+ * @deprecated Use `api.events.getEventsByNFT()`. Removed in the next major.
770
816
  */
771
817
  public async getEventsByNFT(
772
818
  chain: Chain,
@@ -774,7 +820,7 @@ export class OpenSeaAPI {
774
820
  identifier: string,
775
821
  args?: GetEventsArgs,
776
822
  ): Promise<GetEventsResponse> {
777
- return this.eventsAPI.getEventsByNFT(chain, address, identifier, args)
823
+ return this.events.getEventsByNFT(chain, address, identifier, args)
778
824
  }
779
825
 
780
826
  /**
@@ -782,54 +828,76 @@ export class OpenSeaAPI {
782
828
  * @param address The contract address.
783
829
  * @param chain The chain where the contract is deployed. Defaults to the chain set in the constructor.
784
830
  * @returns The {@link GetContractResponse} returned by the API.
831
+ * @deprecated Use `api.nfts.getContract()`. Removed in the next major.
785
832
  */
786
833
  public async getContract(
787
834
  address: string,
788
835
  chain: Chain = this.chain,
789
836
  ): Promise<GetContractResponse> {
790
- return this.nftsAPI.getContract(address, chain)
837
+ return this.nfts.getContract(address, chain)
791
838
  }
792
839
 
793
840
  /**
794
841
  * Fetch all traits for a collection with their possible values and counts.
795
842
  * @param collectionSlug The slug (identifier) of the collection.
796
843
  * @returns The {@link GetTraitsResponse} returned by the API.
844
+ * @deprecated Use `api.collections.getTraits()`. Removed in the next major.
797
845
  */
798
846
  public async getTraits(collectionSlug: string): Promise<GetTraitsResponse> {
799
- return this.collectionsAPI.getTraits(collectionSlug)
847
+ return this.collections.getTraits(collectionSlug)
848
+ }
849
+
850
+ /**
851
+ * Fetch floor prices per trait value for a collection.
852
+ *
853
+ * Covers text traits with at least one active listing, ordered by trait type, then value, then
854
+ * price. Numeric traits are not enumerated here; use {@link getTraits} for their min/max range.
855
+ * Every floor is denominated on the collection's own chain, identified by `chain` plus each
856
+ * entry's `paymentTokenSymbol`.
857
+ * @param collectionSlug The slug (identifier) of the collection.
858
+ * @returns The {@link TraitFloorsResponse} returned by the API.
859
+ * @deprecated Use `api.collections.getCollectionTraitFloors()`. Removed in the next major.
860
+ */
861
+ public async getCollectionTraitFloors(
862
+ collectionSlug: string,
863
+ ): Promise<TraitFloorsResponse> {
864
+ return this.collections.getCollectionTraitFloors(collectionSlug)
800
865
  }
801
866
 
802
867
  /**
803
868
  * Gets a list of trending tokens.
804
869
  * @param args Optional query parameters for pagination.
805
870
  * @returns The {@link GetTrendingTokensResponse} returned by the API.
871
+ * @deprecated Use `api.tokens.getTrendingTokens()`. Removed in the next major.
806
872
  */
807
873
  public async getTrendingTokens(
808
874
  args?: GetTokensArgs,
809
875
  ): Promise<GetTrendingTokensResponse> {
810
- return this.tokensAPI.getTrendingTokens(args)
876
+ return this.tokens.getTrendingTokens(args)
811
877
  }
812
878
 
813
879
  /**
814
880
  * Gets a list of top tokens.
815
881
  * @param args Optional query parameters for pagination.
816
882
  * @returns The {@link GetTopTokensResponse} returned by the API.
883
+ * @deprecated Use `api.tokens.getTopTokens()`. Removed in the next major.
817
884
  */
818
885
  public async getTopTokens(
819
886
  args?: GetTokensArgs,
820
887
  ): Promise<GetTopTokensResponse> {
821
- return this.tokensAPI.getTopTokens(args)
888
+ return this.tokens.getTopTokens(args)
822
889
  }
823
890
 
824
891
  /**
825
892
  * Gets a swap quote for exchanging tokens.
826
893
  * @param args Query parameters for the swap quote including token addresses, amount, and chain.
827
894
  * @returns The {@link GetSwapQuoteResponse} returned by the API.
895
+ * @deprecated Use `api.tokens.getSwapQuote()`. Removed in the next major.
828
896
  */
829
897
  public async getSwapQuote(
830
898
  args: GetSwapQuoteArgs,
831
899
  ): Promise<GetSwapQuoteResponse> {
832
- return this.tokensAPI.getSwapQuote(args)
900
+ return this.tokens.getSwapQuote(args)
833
901
  }
834
902
 
835
903
  /**
@@ -837,12 +905,13 @@ export class OpenSeaAPI {
837
905
  * @param chain The chain the token is on.
838
906
  * @param address The token contract address.
839
907
  * @returns The {@link GetTokenResponse} returned by the API.
908
+ * @deprecated Use `api.tokens.getToken()`. Removed in the next major.
840
909
  */
841
910
  public async getToken(
842
911
  chain: string,
843
912
  address: string,
844
913
  ): Promise<GetTokenResponse> {
845
- return this.tokensAPI.getToken(chain, address)
914
+ return this.tokens.getToken(chain, address)
846
915
  }
847
916
 
848
917
  /**
@@ -850,20 +919,22 @@ export class OpenSeaAPI {
850
919
  * chains (e.g. ETH on Ethereum, Base, and Arbitrum share the "eth" group).
851
920
  * @param args Optional query parameters (`limit`, `cursor`).
852
921
  * @returns The {@link GetTokenGroupsResponse} returned by the API.
922
+ * @deprecated Use `api.tokens.getTokenGroups()`. Removed in the next major.
853
923
  */
854
924
  public async getTokenGroups(
855
925
  args?: GetTokenGroupsArgs,
856
926
  ): Promise<GetTokenGroupsResponse> {
857
- return this.tokensAPI.getTokenGroups(args)
927
+ return this.tokens.getTokenGroups(args)
858
928
  }
859
929
 
860
930
  /**
861
931
  * Gets a single token group by its slug (e.g. "eth").
862
932
  * @param slug The token group slug.
863
933
  * @returns The {@link GetTokenGroupResponse} returned by the API.
934
+ * @deprecated Use `api.tokens.getTokenGroup()`. Removed in the next major.
864
935
  */
865
936
  public async getTokenGroup(slug: string): Promise<GetTokenGroupResponse> {
866
- return this.tokensAPI.getTokenGroup(slug)
937
+ return this.tokens.getTokenGroup(slug)
867
938
  }
868
939
 
869
940
  /**
@@ -879,9 +950,10 @@ export class OpenSeaAPI {
879
950
  /**
880
951
  * Gets the list of supported blockchains and their capabilities.
881
952
  * @returns The {@link GetChainsResponse} returned by the API.
953
+ * @deprecated Use `api.chains.getChains()`. Removed in the next major.
882
954
  */
883
955
  public async getChains(): Promise<GetChainsResponse> {
884
- return this.chainsAPI.getChains()
956
+ return this.chains.getChains()
885
957
  }
886
958
 
887
959
  /**
@@ -889,12 +961,13 @@ export class OpenSeaAPI {
889
961
  * @param address The wallet address to fetch token balances for.
890
962
  * @param args Optional query parameters for filtering and pagination.
891
963
  * @returns The {@link GetAccountTokensResponse} returned by the API.
964
+ * @deprecated Use `api.accounts.getAccountTokens()`. Removed in the next major.
892
965
  */
893
966
  public async getAccountTokens(
894
967
  address: string,
895
968
  args?: GetAccountTokensArgs,
896
969
  ): Promise<GetAccountTokensResponse> {
897
- return this.accountsAPI.getAccountTokens(address, args)
970
+ return this.accounts.getAccountTokens(address, args)
898
971
  }
899
972
 
900
973
  /**
@@ -904,6 +977,7 @@ export class OpenSeaAPI {
904
977
  * @param chain The chain where the NFT is located. Defaults to the chain set in the constructor.
905
978
  * @param ignoreCachedItemUrls Whether to ignore cached item URLs and re-fetch from source.
906
979
  * @returns The {@link ValidateMetadataResponse} returned by the API.
980
+ * @deprecated Use `api.nfts.validateMetadata()`. Removed in the next major.
907
981
  */
908
982
  public async validateNFTMetadata(
909
983
  address: string,
@@ -911,7 +985,7 @@ export class OpenSeaAPI {
911
985
  chain: Chain = this.chain,
912
986
  ignoreCachedItemUrls?: boolean,
913
987
  ): Promise<ValidateMetadataResponse> {
914
- return this.nftsAPI.validateMetadata(
988
+ return this.nfts.validateMetadata(
915
989
  address,
916
990
  identifier,
917
991
  chain,
@@ -926,6 +1000,7 @@ export class OpenSeaAPI {
926
1000
  * @param limit The number of offers to return. Must be between 1 and 200.
927
1001
  * @param next The cursor for the next page of results.
928
1002
  * @returns The {@link GetOffersResponse} returned by the API.
1003
+ * @deprecated Use `api.offers.getOffersByNFT()`. Removed in the next major.
929
1004
  */
930
1005
  public async getOffersByNFT(
931
1006
  collectionSlug: string,
@@ -933,12 +1008,7 @@ export class OpenSeaAPI {
933
1008
  limit?: number,
934
1009
  next?: string,
935
1010
  ): Promise<GetOffersResponse> {
936
- return this.offersAPI.getOffersByNFT(
937
- collectionSlug,
938
- identifier,
939
- limit,
940
- next,
941
- )
1011
+ return this.offers.getOffersByNFT(collectionSlug, identifier, limit, next)
942
1012
  }
943
1013
 
944
1014
  /**
@@ -946,11 +1016,12 @@ export class OpenSeaAPI {
946
1016
  * cross-chain. Returns an ordered list of transactions to execute.
947
1017
  * @param request The sweep request containing buyer, collection, payment, and item caps.
948
1018
  * @returns The {@link SweepCollectionResponse} returned by the API.
1019
+ * @deprecated Use `api.listings.sweepCollection()`. Removed in the next major.
949
1020
  */
950
1021
  public async sweepCollection(
951
1022
  request: SweepCollectionRequest,
952
1023
  ): Promise<SweepCollectionResponse> {
953
- return this.listingsAPI.sweepCollection(request)
1024
+ return this.listings.sweepCollection(request)
954
1025
  }
955
1026
 
956
1027
  /**
@@ -958,11 +1029,12 @@ export class OpenSeaAPI {
958
1029
  * {@link OpenSeaAPI.getSwapQuote} — quote first, then execute.
959
1030
  * @param request The swap execution request.
960
1031
  * @returns The {@link SwapExecuteResponse} with transactions and a quote.
1032
+ * @deprecated Use `api.tokens.executeSwap()`. Removed in the next major.
961
1033
  */
962
1034
  public async executeSwap(
963
1035
  request: SwapExecuteRequest,
964
1036
  ): Promise<SwapExecuteResponse> {
965
- return this.tokensAPI.executeSwap(request)
1037
+ return this.tokens.executeSwap(request)
966
1038
  }
967
1039
 
968
1040
  /**
@@ -971,29 +1043,32 @@ export class OpenSeaAPI {
971
1043
  * fulfillments, and token swaps. Poll this endpoint to check completion status.
972
1044
  * @param request The transaction receipt request.
973
1045
  * @returns The {@link TransactionReceiptResponse} returned by the API.
1046
+ * @deprecated Use `api.transactions.getTransactionReceipt()`. Removed in the next major.
974
1047
  */
975
1048
  public async getTransactionReceipt(
976
1049
  request: TransactionReceiptRequest,
977
1050
  ): Promise<TransactionReceiptResponse> {
978
- return this.transactionsAPI.getTransactionReceipt(request)
1051
+ return this.transactions.getTransactionReceipt(request)
979
1052
  }
980
1053
 
981
1054
  /**
982
1055
  * Gets a list of drops (mints).
983
1056
  * @param args Optional query parameters for filtering and pagination.
984
1057
  * @returns The {@link GetDropsResponse} returned by the API.
1058
+ * @deprecated Use `api.drops.getDrops()`. Removed in the next major.
985
1059
  */
986
1060
  public async getDrops(args?: GetDropsArgs): Promise<GetDropsResponse> {
987
- return this.dropsAPI.getDrops(args)
1061
+ return this.drops.getDrops(args)
988
1062
  }
989
1063
 
990
1064
  /**
991
1065
  * Gets detailed drop information for a collection.
992
1066
  * @param slug The collection slug identifying the drop.
993
1067
  * @returns The {@link GetDropResponse} returned by the API.
1068
+ * @deprecated Use `api.drops.getDrop()`. Removed in the next major.
994
1069
  */
995
1070
  public async getDrop(slug: string): Promise<GetDropResponse> {
996
- return this.dropsAPI.getDrop(slug)
1071
+ return this.drops.getDrop(slug)
997
1072
  }
998
1073
 
999
1074
  /**
@@ -1001,12 +1076,13 @@ export class OpenSeaAPI {
1001
1076
  * @param slug The collection slug identifying the drop.
1002
1077
  * @param request The mint request containing minter address and quantity.
1003
1078
  * @returns The {@link DropMintResponse} with ready-to-sign transaction data.
1079
+ * @deprecated Use `api.drops.buildMintTransaction()`. Removed in the next major.
1004
1080
  */
1005
1081
  public async buildDropMintTransaction(
1006
1082
  slug: string,
1007
1083
  request: DropMintRequest,
1008
1084
  ): Promise<DropMintResponse> {
1009
- return this.dropsAPI.buildMintTransaction(slug, request)
1085
+ return this.drops.buildMintTransaction(slug, request)
1010
1086
  }
1011
1087
 
1012
1088
  /**
@@ -1017,45 +1093,49 @@ export class OpenSeaAPI {
1017
1093
  * @param slug The collection slug identifying the drop.
1018
1094
  * @param request The payer, minter, quantity, and source payment asset.
1019
1095
  * @returns Transactions to submit and the request used to poll their receipt.
1096
+ * @deprecated Use `api.drops.buildCrossChainMintTransactions()`. Removed in the next major.
1020
1097
  */
1021
1098
  public async buildCrossChainDropMintTransactions(
1022
1099
  slug: string,
1023
1100
  request: CrossChainDropMintRequest,
1024
1101
  ): Promise<CrossChainDropMintResponse> {
1025
- return this.dropsAPI.buildCrossChainMintTransactions(slug, request)
1102
+ return this.drops.buildCrossChainMintTransactions(slug, request)
1026
1103
  }
1027
1104
 
1028
1105
  /**
1029
1106
  * Gets trending collections sorted by sales activity.
1030
1107
  * @param args Optional query parameters for timeframe, chain, category, and pagination.
1031
1108
  * @returns The {@link GetCollectionsPaginatedResponse} returned by the API.
1109
+ * @deprecated Use `api.collections.getTrendingCollections()`. Removed in the next major.
1032
1110
  */
1033
1111
  public async getTrendingCollections(
1034
1112
  args?: GetTrendingCollectionsArgs,
1035
1113
  ): Promise<GetCollectionsPaginatedResponse> {
1036
- return this.collectionsAPI.getTrendingCollections(args)
1114
+ return this.collections.getTrendingCollections(args)
1037
1115
  }
1038
1116
 
1039
1117
  /**
1040
1118
  * Gets top collections ranked by various stats.
1041
1119
  * @param args Optional query parameters for sort_by, chain, category, and pagination.
1042
1120
  * @returns The {@link GetCollectionsPaginatedResponse} returned by the API.
1121
+ * @deprecated Use `api.collections.getTopCollections()`. Removed in the next major.
1043
1122
  */
1044
1123
  public async getTopCollections(
1045
1124
  args?: GetTopCollectionsArgs,
1046
1125
  ): Promise<GetCollectionsPaginatedResponse> {
1047
- return this.collectionsAPI.getTopCollections(args)
1126
+ return this.collections.getTopCollections(args)
1048
1127
  }
1049
1128
 
1050
1129
  /**
1051
1130
  * Resolve an ENS name, OpenSea username, or wallet address to canonical account info.
1052
1131
  * @param identifier An ENS name (e.g. vitalik.eth), OpenSea username, or wallet address.
1053
1132
  * @returns The {@link ResolveAccountResponse} returned by the API.
1133
+ * @deprecated Use `api.accounts.resolveAccount()`. Removed in the next major.
1054
1134
  */
1055
1135
  public async resolveAccount(
1056
1136
  identifier: string,
1057
1137
  ): Promise<ResolveAccountResponse> {
1058
- return this.accountsAPI.resolveAccount(identifier)
1138
+ return this.accounts.resolveAccount(identifier)
1059
1139
  }
1060
1140
 
1061
1141
  /**
@@ -1063,11 +1143,12 @@ export class OpenSeaAPI {
1063
1143
  * This is a public read and does not require wallet authentication.
1064
1144
  * @param addressOrUsername An ENS name, OpenSea username, or wallet address.
1065
1145
  * @returns The {@link AgentProfileRelationshipsResponse} returned by the API.
1146
+ * @deprecated Use `api.accounts.getAgentProfileRelationships()`. Removed in the next major.
1066
1147
  */
1067
1148
  public async getAgentProfileRelationships(
1068
1149
  addressOrUsername: string,
1069
1150
  ): Promise<AgentProfileRelationshipsResponse> {
1070
- return this.accountsAPI.getAgentProfileRelationships(addressOrUsername)
1151
+ return this.accounts.getAgentProfileRelationships(addressOrUsername)
1071
1152
  }
1072
1153
 
1073
1154
  /**
@@ -1078,13 +1159,14 @@ export class OpenSeaAPI {
1078
1159
  * @param identifier The token identifier.
1079
1160
  * @param chain The chain where the NFT is located. Defaults to the chain set in the constructor.
1080
1161
  * @returns The {@link OpenSeaCollection} returned by the API.
1162
+ * @deprecated Use `api.nfts.getNFTCollection()`. Removed in the next major.
1081
1163
  */
1082
1164
  public async getNFTCollection(
1083
1165
  address: string,
1084
1166
  identifier: string,
1085
1167
  chain: Chain = this.chain,
1086
1168
  ): Promise<OpenSeaCollection> {
1087
- return this.nftsAPI.getNFTCollection(address, identifier, chain)
1169
+ return this.nfts.getNFTCollection(address, identifier, chain)
1088
1170
  }
1089
1171
 
1090
1172
  /**
@@ -1094,24 +1176,26 @@ export class OpenSeaAPI {
1094
1176
  * @param tokenId The token identifier.
1095
1177
  * @param chain The chain where the NFT is located. Defaults to the chain set in the constructor.
1096
1178
  * @returns The {@link GetNFTMetadataResponse} returned by the API.
1179
+ * @deprecated Use `api.nfts.getNFTMetadata()`. Removed in the next major.
1097
1180
  */
1098
1181
  public async getNFTMetadata(
1099
1182
  address: string,
1100
1183
  tokenId: string,
1101
1184
  chain: Chain = this.chain,
1102
1185
  ): Promise<GetNFTMetadataResponse> {
1103
- return this.nftsAPI.getNFTMetadata(address, tokenId, chain)
1186
+ return this.nfts.getNFTMetadata(address, tokenId, chain)
1104
1187
  }
1105
1188
 
1106
1189
  /**
1107
1190
  * Fetch multiple tokens in a single request.
1108
1191
  * @param request Batch request listing chain + contract address pairs.
1109
1192
  * @returns The {@link TokenBatchResponse} with detailed token info.
1193
+ * @deprecated Use `api.tokens.getTokensBatch()`. Removed in the next major.
1110
1194
  */
1111
1195
  public async getTokensBatch(
1112
1196
  request: BatchTokensRequest,
1113
1197
  ): Promise<TokenBatchResponse> {
1114
- return this.tokensAPI.getTokensBatch(request)
1198
+ return this.tokens.getTokensBatch(request)
1115
1199
  }
1116
1200
 
1117
1201
  /**
@@ -1120,13 +1204,14 @@ export class OpenSeaAPI {
1120
1204
  * @param address Token contract address.
1121
1205
  * @param args Time-series window — `start_time` required, `end_time` defaults to now.
1122
1206
  * @returns The {@link PriceHistoryResponse} returned by the API.
1207
+ * @deprecated Use `api.tokens.getTokenPriceHistory()`. Removed in the next major.
1123
1208
  */
1124
1209
  public async getTokenPriceHistory(
1125
1210
  chain: Chain,
1126
1211
  address: string,
1127
1212
  args: TokenTimeSeriesArgs,
1128
1213
  ): Promise<PriceHistoryResponse> {
1129
- return this.tokensAPI.getTokenPriceHistory(chain, address, args)
1214
+ return this.tokens.getTokenPriceHistory(chain, address, args)
1130
1215
  }
1131
1216
 
1132
1217
  /**
@@ -1135,84 +1220,92 @@ export class OpenSeaAPI {
1135
1220
  * @param address Token contract address.
1136
1221
  * @param args Time-series window plus candle `bucketSize` (required).
1137
1222
  * @returns The {@link OhlcvResponse} returned by the API.
1223
+ * @deprecated Use `api.tokens.getTokenOhlcv()`. Removed in the next major.
1138
1224
  */
1139
1225
  public async getTokenOhlcv(
1140
1226
  chain: Chain,
1141
1227
  address: string,
1142
1228
  args: TokenTimeSeriesArgs & { bucketSize: string },
1143
1229
  ): Promise<OhlcvResponse> {
1144
- return this.tokensAPI.getTokenOhlcv(chain, address, args)
1230
+ return this.tokens.getTokenOhlcv(chain, address, args)
1145
1231
  }
1146
1232
 
1147
1233
  /**
1148
1234
  * Fetch recent swap activity for a token.
1235
+ * @deprecated Use `api.tokens.getTokenActivity()`. Removed in the next major.
1149
1236
  */
1150
1237
  public async getTokenActivity(
1151
1238
  chain: Chain,
1152
1239
  address: string,
1153
1240
  args?: TokenActivityArgs,
1154
1241
  ): Promise<TokenSwapActivityPaginatedResponse> {
1155
- return this.tokensAPI.getTokenActivity(chain, address, args)
1242
+ return this.tokens.getTokenActivity(chain, address, args)
1156
1243
  }
1157
1244
 
1158
1245
  /**
1159
1246
  * Fetch materialized trade count, USD volume, and average trade size for a
1160
1247
  * token across the requested windows.
1248
+ * @deprecated Use `api.tokens.getTokenActivityStats()`. Removed in the next major.
1161
1249
  */
1162
1250
  public async getTokenActivityStats(
1163
1251
  chain: Chain,
1164
1252
  address: string,
1165
1253
  args?: TokenActivityStatsArgs,
1166
1254
  ): Promise<TokenActivityStatsResponse> {
1167
- return this.tokensAPI.getTokenActivityStats(chain, address, args)
1255
+ return this.tokens.getTokenActivityStats(chain, address, args)
1168
1256
  }
1169
1257
 
1170
1258
  /**
1171
1259
  * Fetch paginated fungible token activity (transfers, swaps, wraps, and
1172
1260
  * unwraps) for an account across all chains.
1261
+ * @deprecated Use `api.tokens.getAccountTokenActivity()`. Removed in the next major.
1173
1262
  */
1174
1263
  public async getAccountTokenActivity(
1175
1264
  address: string,
1176
1265
  args?: GetAccountTokenActivityArgs,
1177
1266
  ): Promise<GetAccountTokenActivityResponse> {
1178
- return this.tokensAPI.getAccountTokenActivity(address, args)
1267
+ return this.tokens.getAccountTokenActivity(address, args)
1179
1268
  }
1180
1269
 
1181
1270
  /**
1182
1271
  * Fetch paginated holders for a token, including quantity held, USD value,
1183
1272
  * and aggregate distribution health (STRONG | HEALTHY | CONCERNING | BAD).
1273
+ * @deprecated Use `api.tokens.getTokenHolders()`. Removed in the next major.
1184
1274
  */
1185
1275
  public async getTokenHolders(
1186
1276
  chain: Chain,
1187
1277
  address: string,
1188
1278
  args?: TokenHoldersArgs,
1189
1279
  ): Promise<TokenHoldersResponse> {
1190
- return this.tokensAPI.getTokenHolders(chain, address, args)
1280
+ return this.tokens.getTokenHolders(chain, address, args)
1191
1281
  }
1192
1282
 
1193
1283
  /**
1194
1284
  * Fetch liquidity pools for a token (pool type, USD reserves, and
1195
1285
  * bonding-curve progress / graduation flag where applicable).
1286
+ * @deprecated Use `api.tokens.getTokenLiquidityPools()`. Removed in the next major.
1196
1287
  */
1197
1288
  public async getTokenLiquidityPools(
1198
1289
  chain: Chain,
1199
1290
  address: string,
1200
1291
  args?: TokenLiquidityPoolsArgs,
1201
1292
  ): Promise<TokenLiquidityPoolsResponse> {
1202
- return this.tokensAPI.getTokenLiquidityPools(chain, address, args)
1293
+ return this.tokens.getTokenLiquidityPools(chain, address, args)
1203
1294
  }
1204
1295
 
1205
1296
  /**
1206
1297
  * Fetch multiple NFTs in a single request.
1298
+ * @deprecated Use `api.nfts.getNFTsBatch()`. Removed in the next major.
1207
1299
  */
1208
1300
  public async getNFTsBatch(
1209
1301
  request: BatchNftsRequest,
1210
1302
  ): Promise<NftBatchResponse> {
1211
- return this.nftsAPI.getNFTsBatch(request)
1303
+ return this.nfts.getNFTsBatch(request)
1212
1304
  }
1213
1305
 
1214
1306
  /**
1215
1307
  * Fetch owners of an NFT.
1308
+ * @deprecated Use `api.nfts.getNFTOwners()`. Removed in the next major.
1216
1309
  */
1217
1310
  public async getNFTOwners(
1218
1311
  address: string,
@@ -1220,218 +1313,240 @@ export class OpenSeaAPI {
1220
1313
  chain: Chain = this.chain,
1221
1314
  args?: NFTOwnersArgs,
1222
1315
  ): Promise<OwnersPaginatedResponse> {
1223
- return this.nftsAPI.getNFTOwners(address, identifier, chain, args)
1316
+ return this.nfts.getNFTOwners(address, identifier, chain, args)
1224
1317
  }
1225
1318
 
1226
1319
  /**
1227
1320
  * Fetch analytics (historical sale points) for an NFT.
1321
+ * @deprecated Use `api.nfts.getNFTAnalytics()`. Removed in the next major.
1228
1322
  */
1229
1323
  public async getNFTAnalytics(
1230
1324
  address: string,
1231
1325
  identifier: string,
1232
1326
  chain: Chain = this.chain,
1233
1327
  ): Promise<NftAnalyticsResponse> {
1234
- return this.nftsAPI.getNFTAnalytics(address, identifier, chain)
1328
+ return this.nfts.getNFTAnalytics(address, identifier, chain)
1235
1329
  }
1236
1330
 
1237
1331
  /**
1238
1332
  * Fetch multiple collections in a single request by slug.
1333
+ * @deprecated Use `api.collections.getCollectionsBatch()`. Removed in the next major.
1239
1334
  */
1240
1335
  public async getCollectionsBatch(
1241
1336
  request: BatchCollectionsRequest,
1242
1337
  ): Promise<CollectionBatchResponse> {
1243
- return this.collectionsAPI.getCollectionsBatch(request)
1338
+ return this.collections.getCollectionsBatch(request)
1244
1339
  }
1245
1340
 
1246
1341
  /**
1247
1342
  * Fetch top offers for a collection grouped by price level.
1343
+ * @deprecated Use `api.collections.getCollectionOfferAggregates()`. Removed in the next major.
1248
1344
  */
1249
1345
  public async getCollectionOfferAggregates(
1250
1346
  slug: string,
1251
1347
  args?: PaginatedAnalyticsArgs,
1252
1348
  ): Promise<CollectionOfferAggregatesPaginatedResponse> {
1253
- return this.collectionsAPI.getCollectionOfferAggregates(slug, args)
1349
+ return this.collections.getCollectionOfferAggregates(slug, args)
1254
1350
  }
1255
1351
 
1256
1352
  /**
1257
1353
  * Fetch holders of a collection.
1354
+ * @deprecated Use `api.collections.getCollectionHolders()`. Removed in the next major.
1258
1355
  */
1259
1356
  public async getCollectionHolders(
1260
1357
  slug: string,
1261
1358
  args?: CollectionHoldersArgs,
1262
1359
  ): Promise<CollectionHoldersPaginatedResponse> {
1263
- return this.collectionsAPI.getCollectionHolders(slug, args)
1360
+ return this.collections.getCollectionHolders(slug, args)
1264
1361
  }
1265
1362
 
1266
1363
  /**
1267
1364
  * Fetch the floor-price history of a collection.
1365
+ * @deprecated Use `api.collections.getCollectionFloorPrices()`. Removed in the next major.
1268
1366
  */
1269
1367
  public async getCollectionFloorPrices(
1270
1368
  slug: string,
1271
1369
  args?: CollectionFloorPricesArgs,
1272
1370
  ): Promise<FloorPriceHistoryResponse> {
1273
- return this.collectionsAPI.getCollectionFloorPrices(slug, args)
1371
+ return this.collections.getCollectionFloorPrices(slug, args)
1274
1372
  }
1275
1373
 
1276
1374
  /**
1277
1375
  * Get ordered approval + sign actions to create one or more listings.
1376
+ * @deprecated Use `api.listings.createListingActions()`. Removed in the next major.
1278
1377
  */
1279
1378
  public async createListingActions(
1280
1379
  request: CreateListingActionsRequest,
1281
1380
  ): Promise<CreateListingActionsResponse> {
1282
- return this.listingsAPI.createListingActions(request)
1381
+ return this.listings.createListingActions(request)
1283
1382
  }
1284
1383
 
1285
1384
  /**
1286
1385
  * Get ordered actions to fulfill a listing.
1386
+ * @deprecated Use `api.listings.createListingFulfillmentActions()`. Removed in the next major.
1287
1387
  */
1288
1388
  public async createListingFulfillmentActions(
1289
1389
  request: CreateListingFulfillmentActionsRequest,
1290
1390
  ): Promise<CreateListingFulfillmentActionsResponse> {
1291
- return this.listingsAPI.createListingFulfillmentActions(request)
1391
+ return this.listings.createListingFulfillmentActions(request)
1292
1392
  }
1293
1393
 
1294
1394
  /**
1295
1395
  * Get ordered actions to create an offer.
1396
+ * @deprecated Use `api.offers.createOfferActions()`. Removed in the next major.
1296
1397
  */
1297
1398
  public async createOfferActions(
1298
1399
  request: CreateOfferActionsRequest,
1299
1400
  ): Promise<CreateOfferActionsResponse> {
1300
- return this.offersAPI.createOfferActions(request)
1401
+ return this.offers.createOfferActions(request)
1301
1402
  }
1302
1403
 
1303
1404
  /**
1304
1405
  * Get ordered actions to fulfill an offer.
1406
+ * @deprecated Use `api.offers.createOfferFulfillmentActions()`. Removed in the next major.
1305
1407
  */
1306
1408
  public async createOfferFulfillmentActions(
1307
1409
  request: CreateOfferFulfillmentActionsRequest,
1308
1410
  ): Promise<CreateOfferFulfillmentActionsResponse> {
1309
- return this.offersAPI.createOfferFulfillmentActions(request)
1411
+ return this.offers.createOfferFulfillmentActions(request)
1310
1412
  }
1311
1413
 
1312
1414
  /**
1313
1415
  * Build a deploy-contract transaction for a new drop.
1416
+ * @deprecated Use `api.drops.deployDropContract()`. Removed in the next major.
1314
1417
  */
1315
1418
  public async deployDropContract(
1316
1419
  request: DropDeployRequest,
1317
1420
  ): Promise<DropDeployResponse> {
1318
- return this.dropsAPI.deployDropContract(request)
1421
+ return this.drops.deployDropContract(request)
1319
1422
  }
1320
1423
 
1321
1424
  /**
1322
1425
  * Get the receipt of a previously submitted drop-deploy transaction.
1426
+ * @deprecated Use `api.drops.getDeployReceipt()`. Removed in the next major.
1323
1427
  */
1324
1428
  public async getDeployContractReceipt(
1325
1429
  chain: Chain,
1326
1430
  txHash: string,
1327
1431
  ): Promise<DropDeployReceiptResponse> {
1328
- return this.dropsAPI.getDeployReceipt(chain, txHash)
1432
+ return this.drops.getDeployReceipt(chain, txHash)
1329
1433
  }
1330
1434
 
1331
1435
  /**
1332
1436
  * Build transactions to transfer NFTs or tokens between wallets.
1437
+ * @deprecated Use `api.assets.transferAssets()`. Removed in the next major.
1333
1438
  */
1334
1439
  public async transferAssets(
1335
1440
  request: TransferRequest,
1336
1441
  ): Promise<TransferResponse> {
1337
- return this.assetsAPI.transferAssets(request)
1442
+ return this.assets.transferAssets(request)
1338
1443
  }
1339
1444
 
1340
1445
  /**
1341
1446
  * Get portfolio stats (net worth, P&L) for an account.
1447
+ * @deprecated Use `api.accounts.getPortfolioStats()`. Removed in the next major.
1342
1448
  */
1343
1449
  public async getPortfolioStats(
1344
1450
  address: string,
1345
1451
  args?: PortfolioArgs,
1346
1452
  ): Promise<PortfolioStatsResponse> {
1347
- return this.accountsAPI.getPortfolioStats(address, args)
1453
+ return this.accounts.getPortfolioStats(address, args)
1348
1454
  }
1349
1455
 
1350
1456
  /**
1351
1457
  * Get portfolio net-worth history for an account.
1458
+ * @deprecated Use `api.accounts.getPortfolioHistory()`. Removed in the next major.
1352
1459
  */
1353
1460
  public async getPortfolioHistory(
1354
1461
  address: string,
1355
1462
  args?: PortfolioArgs,
1356
1463
  ): Promise<PortfolioHistoryResponse> {
1357
- return this.accountsAPI.getPortfolioHistory(address, args)
1464
+ return this.accounts.getPortfolioHistory(address, args)
1358
1465
  }
1359
1466
 
1360
1467
  /**
1361
1468
  * Get offers received by an account.
1469
+ * @deprecated Use `api.accounts.getProfileOffersReceived()`. Removed in the next major.
1362
1470
  */
1363
1471
  public async getProfileOffersReceived(
1364
1472
  address: string,
1365
1473
  args?: ProfileOrdersArgs,
1366
1474
  ): Promise<ProfileOffersResponse> {
1367
- return this.accountsAPI.getProfileOffersReceived(address, args)
1475
+ return this.accounts.getProfileOffersReceived(address, args)
1368
1476
  }
1369
1477
 
1370
1478
  /**
1371
1479
  * Get active offers made by an account.
1480
+ * @deprecated Use `api.accounts.getProfileOffers()`. Removed in the next major.
1372
1481
  */
1373
1482
  public async getProfileOffers(
1374
1483
  address: string,
1375
1484
  args?: ProfileOrdersArgs,
1376
1485
  ): Promise<ProfileOffersResponse> {
1377
- return this.accountsAPI.getProfileOffers(address, args)
1486
+ return this.accounts.getProfileOffers(address, args)
1378
1487
  }
1379
1488
 
1380
1489
  /**
1381
1490
  * Get active listings for an account.
1491
+ * @deprecated Use `api.accounts.getProfileListings()`. Removed in the next major.
1382
1492
  */
1383
1493
  public async getProfileListings(
1384
1494
  address: string,
1385
1495
  args?: ProfileOrdersArgs,
1386
1496
  ): Promise<ProfileListingsResponse> {
1387
- return this.accountsAPI.getProfileListings(address, args)
1497
+ return this.accounts.getProfileListings(address, args)
1388
1498
  }
1389
1499
 
1390
1500
  /**
1391
1501
  * Get items favorited by an account.
1502
+ * @deprecated Use `api.accounts.getProfileFavorites()`. Removed in the next major.
1392
1503
  */
1393
1504
  public async getProfileFavorites(
1394
1505
  address: string,
1395
1506
  args?: ProfileFavoritesArgs,
1396
1507
  ): Promise<ProfileFavoritesResponse> {
1397
- return this.accountsAPI.getProfileFavorites(address, args)
1508
+ return this.accounts.getProfileFavorites(address, args)
1398
1509
  }
1399
1510
 
1400
1511
  /**
1401
1512
  * Get collections owned by an account.
1513
+ * @deprecated Use `api.accounts.getProfileCollections()`. Removed in the next major.
1402
1514
  */
1403
1515
  public async getProfileCollections(
1404
1516
  address: string,
1405
1517
  args?: ProfileCollectionsArgs,
1406
1518
  ): Promise<ProfileCollectionsResponse> {
1407
- return this.accountsAPI.getProfileCollections(address, args)
1519
+ return this.accounts.getProfileCollections(address, args)
1408
1520
  }
1409
1521
 
1410
1522
  /**
1411
1523
  * Get aggregated trading P&L (realized + unrealized) for an account.
1524
+ * @deprecated Use `api.accounts.getWalletPnl()`. Removed in the next major.
1412
1525
  */
1413
1526
  public async getWalletPnl(address: string): Promise<WalletPnlResponse> {
1414
- return this.accountsAPI.getWalletPnl(address)
1527
+ return this.accounts.getWalletPnl(address)
1415
1528
  }
1416
1529
 
1417
1530
  /**
1418
1531
  * Get closed (realized) trading positions for an account.
1532
+ * @deprecated Use `api.accounts.getWalletClosedPositions()`. Removed in the next major.
1419
1533
  */
1420
1534
  public async getWalletClosedPositions(
1421
1535
  address: string,
1422
1536
  args?: WalletClosedPositionsArgs,
1423
1537
  ): Promise<ClosedPositionsResponse> {
1424
- return this.accountsAPI.getWalletClosedPositions(address, args)
1538
+ return this.accounts.getWalletClosedPositions(address, args)
1425
1539
  }
1426
1540
 
1427
1541
  /**
1428
1542
  * Get the token transfers contributing to a wallet's position in a currency.
1543
+ * @deprecated Use `api.accounts.getWalletTokenTransfers()`. Removed in the next major.
1429
1544
  */
1430
1545
  public async getWalletTokenTransfers(
1431
1546
  address: string,
1432
1547
  args: WalletTokenTransfersArgs,
1433
1548
  ): Promise<PositionTokenTransfersResponse> {
1434
- return this.accountsAPI.getWalletTokenTransfers(address, args)
1549
+ return this.accounts.getWalletTokenTransfers(address, args)
1435
1550
  }
1436
1551
 
1437
1552
  /**
@@ -1603,7 +1718,11 @@ export class OpenSeaAPI {
1603
1718
  }
1604
1719
 
1605
1720
  try {
1606
- const response = await fetch(url, {
1721
+ // .call(globalThis, ...) rather than a plain call: a caller can pass native fetch
1722
+ // unbound (`fetch: globalThis.fetch`), and browsers throw "Illegal invocation" when it
1723
+ // runs with anything but the global as its receiver. A bound function or an arrow
1724
+ // ignores the thisArg, so this does not clobber a deliberately bound transport.
1725
+ const response = await this.fetchImpl.call(globalThis, url, {
1607
1726
  method,
1608
1727
  headers: mergedHeaders,
1609
1728
  body: body != null ? JSON.stringify(body) : undefined,