opensea-js 6.1.7 → 6.1.9

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
@@ -20,13 +20,11 @@ A JavaScript library for crypto-native e-commerce: buying, selling, and bidding
20
20
  - [Fetching Assets](#fetching-assets)
21
21
  - [Checking Balances and Ownerships](#checking-balances-and-ownerships)
22
22
  - [Making Offers](#making-offers)
23
- - [Bidding on ENS Short Name Auctions](#bidding-on-ens-short-name-auctions)
24
23
  - [Offer Limits](#offer-limits)
25
24
  - [Making Listings / Selling Items](#making-listings--selling-items)
26
25
  - [Fetching Orders](#fetching-orders)
27
26
  - [Buying Items](#buying-items)
28
27
  - [Accepting Offers](#accepting-offers)
29
- - [Transferring Items or Coins (Gifting)](#transferring-items-or-coins-gifting)
30
28
  - [Advanced](#advanced)
31
29
  - [Scheduling Future Listings](#scheduling-future-listings)
32
30
  - [Purchasing Items for Other Users](#purchasing-items-for-other-users)
@@ -43,7 +41,7 @@ A JavaScript library for crypto-native e-commerce: buying, selling, and bidding
43
41
 
44
42
  This is the JavaScript SDK for [OpenSea](https://opensea.io), the largest marketplace for NFTs.
45
43
 
46
- It allows developers to access the official orderbook, filter it, create buy orders (**offers**), create sell orders (**auctions**), and complete trades programmatically.
44
+ It allows developers to access the official orderbook, filter it, create buy orders (**offers**), create sell orders (**listings**), and complete trades programmatically.
47
45
 
48
46
  Get started by [requesting an API key](https://docs.opensea.io/reference/api-keys) and instantiating your own OpenSea SDK instance. Then you can create orders off-chain or fulfill orders on-chain, and listen to events (like `ApproveAllAssets` or `WrapEth`) in the process.
49
47
 
@@ -51,7 +49,7 @@ Happy seafaring! ⛵️
51
49
 
52
50
  ## Installation
53
51
 
54
- Switching to Node.js version 16 is required for SDK Version 3.0+ and to make sure common crypto dependencies work. Execute `nvm use`, if you have Node Version Manager.
52
+ Node.js version 16 is the minimum required for the SDK. Execute `nvm use`, if you have Node Version Manager.
55
53
 
56
54
  Then, in your project, run:
57
55
 
@@ -169,37 +167,6 @@ const offer = await openseaSDK.createBuyOrder({
169
167
 
170
168
  When you make an offer on an item owned by an OpenSea user, **that user will automatically get an email notifying them with the offer amount**, if it's above their desired threshold.
171
169
 
172
- #### Bidding on ENS Short Name Auctions
173
-
174
- The Ethereum Name Service (ENS) is auctioning short (3-6 character) names that can be used for labeling wallet addresses and more. Learn more on the [ENS FAQ](https://opensea.io/ens).
175
-
176
- To bid, you must use the ENS Short Name schema:
177
-
178
- ```typescript
179
- const {
180
- tokenId,
181
- // Token address should be `0xfac7bea255a6990f749363002136af6556b31e04` on mainnet
182
- tokenAddress,
183
- // Name must have `.eth` at the end and correspond with the tokenId
184
- name
185
- } = ENS_ASSET // You can get an ENS asset from `openseaSDK.api.getAsset(...)`
186
-
187
- const offer = await openseaSDK.createBuyOrder({
188
- asset: {
189
- tokenId,
190
- tokenAddress,
191
- name,
192
- // Only needed for the short-name auction, not ENS names
193
- // that have been sold once already:
194
- tokenStandard: "ENSShortNameAuction"
195
- },
196
- // Your wallet address (the bidder's address):
197
- accountAddress: "0x1234..."
198
- // Value of the offer, in wrapped ETH:
199
- startAmount: 1.2,
200
- })
201
- ```
202
-
203
170
  #### Offer Limits
204
171
 
205
172
  Note: The total value of buy orders must not exceed 1000 x wallet balance.
@@ -234,7 +201,7 @@ See [Listening to Events](#listening-to-events) to respond to the setup transact
234
201
 
235
202
  English Auctions are auctions that start at a small amount (we recommend even doing 0!) and increase with every bid. At expiration time, the item sells to the highest bidder.
236
203
 
237
- To create an English Auction, create a listing that waits for the highest bid by setting `waitForHighestBid` to `true`:
204
+ To create an English Auction set `englishAuction` to `true`:
238
205
 
239
206
  ```typescript
240
207
  // Create an auction to receive Wrapped Ether (WETH). See note below.
@@ -242,7 +209,7 @@ const paymentTokenAddress = "0xc02aaa39b223fe8d0a0e5c4f27ead9083c756cc2";
242
209
 
243
210
  const startAmount = 0; // The minimum amount to sell for, in normal units (e.g. ETH)
244
211
 
245
- const auction = await openseaSDK.createSellOrder({
212
+ const order = await openseaSDK.createSellOrder({
246
213
  asset: {
247
214
  tokenId,
248
215
  tokenAddress,
@@ -251,7 +218,7 @@ const auction = await openseaSDK.createSellOrder({
251
218
  startAmount,
252
219
  expirationTime,
253
220
  paymentTokenAddress,
254
- waitForHighestBid: true,
221
+ englishAuction: true,
255
222
  });
256
223
  ```
257
224
 
@@ -289,14 +256,12 @@ The available API filters for the orders endpoint is documented in the `OrdersQu
289
256
  ```TypeScript
290
257
  /**
291
258
  * Attrs used by orderbook to make queries easier
292
- * More to come soon!
293
259
  */
294
260
  side: "bid" | "ask", // "bid" for buy orders, "ask" for sell orders
295
261
  protocol?: "seaport"; // Protocol of the order (more options may be added in future)
296
262
  maker?: string, // Address of the order's creator
297
263
  taker?: string, // The null address if anyone is allowed to take the order
298
264
  owner?: string, // Address of owner of the order's item
299
- sale_kind?: SaleKind, // 0 for fixed-price, 1 for Dutch auctions
300
265
  assetContractAddress?: string, // Contract address for order's item
301
266
  paymentTokenAddress?: string; // Contract address for order's payment token
302
267
  tokenId?: number | string,
@@ -338,57 +303,6 @@ await openseaSDK.fulfillOrder({ order, accountAddress })
338
303
 
339
304
  If the order is a buy order (`order.side === "bid"`), then the taker is the _owner_ and this will prompt the owner to exchange their item(s) for whatever is being offered in return. See [Listening to Events](#listening-to-events) below to respond to the setup transactions that occur the first time a user accepts a bid.
340
305
 
341
- ### Transferring Items or Coins (Gifting)
342
-
343
- A handy feature in OpenSea.js is the ability to transfer any supported asset (fungible or non-fungible tokens) in one line of JavaScript.
344
-
345
- To transfer an ERC-721 asset or an ERC-1155 asset, it's just one call:
346
-
347
- ```typescript
348
- const transactionHash = await openseaSDK.transfer({
349
- asset: { tokenId, tokenAddress },
350
- fromAddress, // Must own the asset
351
- toAddress,
352
- });
353
- ```
354
-
355
- For fungible ERC-1155 assets, you can set `tokenStandard` to "ERC1155" and pass a `quantity` in to transfer multiple at once:
356
-
357
- ```typescript
358
- const transactionHash = await openseaSDK.transfer({
359
- asset: {
360
- tokenId,
361
- tokenAddress,
362
- tokenStandard: "ERC1155",
363
- },
364
- fromAddress, // Must own the asset
365
- toAddress,
366
- quantity: 2,
367
- });
368
- ```
369
-
370
- To transfer fungible assets without token IDs, like ERC20 tokens, you can pass in an `OpenSeaFungibleToken` as the `asset`, set `tokenStandard` to "ERC20", and include `quantity` in base units (e.g. wei) to indicate how many.
371
-
372
- Example for transferring 2 DAI ($2) to another address:
373
-
374
- ```typescript
375
- const paymentToken = (await openseaSDK.api.getPaymentTokens({ symbol: "DAI" }))
376
- .tokens[0];
377
- const quantity = ethers.utils.parseUnits("2", paymentToken.decimals);
378
- const transactionHash = await openseaSDK.transfer({
379
- asset: {
380
- tokenId: null,
381
- tokenAddress: paymentToken.address,
382
- tokenStandard: "ERC20",
383
- },
384
- fromAddress, // Must own the tokens
385
- toAddress,
386
- quantity,
387
- });
388
- ```
389
-
390
- For more information, check out the [documentation](https://projectopensea.github.io/opensea-js/).
391
-
392
306
  ## Advanced
393
307
 
394
308
  Interested in purchasing for users server-side or with a bot, scheduling future orders, or making bids in different ERC-20 tokens? OpenSea.js can help with that.
@@ -398,7 +312,7 @@ Interested in purchasing for users server-side or with a bot, scheduling future
398
312
  You can create sell orders that aren't fulfillable until a future date. Just pass in a `listingTime` (a UTC timestamp in seconds) to your SDK instance:
399
313
 
400
314
  ```typescript
401
- const auction = await openseaSDK.createSellOrder({
315
+ const order = await openseaSDK.createSellOrder({
402
316
  tokenAddress,
403
317
  tokenId,
404
318
  accountAddress,
@@ -454,14 +368,9 @@ const order = await openseaSDK.api.getOrders({
454
368
  });
455
369
  ```
456
370
 
457
- **Fun note:** soon, all ERC-20 tokens will be allowed! This will mean you can create crazy offers on crypto collectibles **using your own ERC-20 token**. However, opensea.io will only display offers and auctions in ERC-20 tokens that it knows about, optimizing the user experience of order takers. Orders made with the following tokens will be shown on OpenSea:
458
-
459
- - MANA, Decentraland's currency: https://etherscan.io/token/0x0f5d2fb29fb7d3cfee444a200298f468908cc942
460
- - DAI, Maker's stablecoin, pegged to $1 USD: https://etherscan.io/token/0x89d24a6b4ccb1b6faa2625fe562bdd9a23260359
461
-
462
371
  ### Private Auctions
463
372
 
464
- Now you can make auctions and listings that can only be fulfilled by an address or email of your choosing. This allows you to negotiate a price in some channel and sell for your chosen price on OpenSea, **without having to trust that the counterparty will abide by your terms!**
373
+ You can make offers and listings that can only be fulfilled by an address or email of your choosing. This allows you to negotiate a price in some channel and sell for your chosen price on OpenSea, **without having to trust that the counterparty will abide by your terms!**
465
374
 
466
375
  Here's an example of listing a Decentraland parcel for 10 ETH with a specific buyer address allowed to take it. No more needing to worry about whether they'll give you enough back!
467
376
 
@@ -483,80 +392,40 @@ const listing = await openseaSDK.createSellOrder({
483
392
 
484
393
  Events are fired whenever transactions or orders are being created, and when transactions return receipts from recently mined blocks on the Ethereum blockchain.
485
394
 
486
- Our recommendation is that you "forward" OpenSea events to your own store or state management system. Here's an example of doing that with a Redux action:
395
+ Our recommendation is that you "forward" OpenSea events to your own store or state management system. Here are examples of listening to the events:
487
396
 
488
397
  ```typescript
489
398
  import { openSeaSDK, EventType } from 'opensea-js'
490
- import * as ActionTypes from './index'
491
-
492
- // ...
493
399
 
494
400
  handleSDKEvents() {
495
- return async function(dispatch, getState) {
496
401
  openSeaSDK.addListener(EventType.TransactionCreated, ({ transactionHash, event }) => {
497
- console.info({ transactionHash, event })
498
- dispatch({ type: ActionTypes.SET_PENDING_TRANSACTION_HASH, hash: transactionHash })
402
+ console.info('Transaction created: ', { transactionHash, event })
499
403
  })
500
404
  openSeaSDK.addListener(EventType.TransactionConfirmed, ({ transactionHash, event }) => {
501
- console.info({ transactionHash, event })
502
- // Only reset your exchange UI if we're finishing an order fulfillment or cancellation
503
- if (event == EventType.MatchOrders || event == EventType.CancelOrder) {
504
- dispatch({ type: ActionTypes.RESET_EXCHANGE })
505
- }
405
+ console.info('Transaction confirmed: ',{ transactionHash, event })
506
406
  })
507
407
  openSeaSDK.addListener(EventType.TransactionDenied, ({ transactionHash, event }) => {
508
- console.info({ transactionHash, event })
509
- dispatch({ type: ActionTypes.RESET_EXCHANGE })
408
+ console.info('Transaction denied: ',{ transactionHash, event })
510
409
  })
511
410
  openSeaSDK.addListener(EventType.TransactionFailed, ({ transactionHash, event }) => {
512
- console.info({ transactionHash, event })
513
- dispatch({ type: ActionTypes.RESET_EXCHANGE })
514
- })
515
- openSeaSDK.addListener(EventType.InitializeAccount, ({ accountAddress }) => {
516
- console.info({ accountAddress })
517
- dispatch({ type: ActionTypes.INITIALIZE_PROXY })
411
+ console.info('Transaction failed: ',{ transactionHash, event })
518
412
  })
519
413
  openSeaSDK.addListener(EventType.WrapEth, ({ accountAddress, amount }) => {
520
- console.info({ accountAddress, amount })
521
- dispatch({ type: ActionTypes.WRAP_ETH })
414
+ console.info('Wrap ETH: ',{ accountAddress, amount })
522
415
  })
523
416
  openSeaSDK.addListener(EventType.UnwrapWeth, ({ accountAddress, amount }) => {
524
- console.info({ accountAddress, amount })
525
- dispatch({ type: ActionTypes.UNWRAP_WETH })
526
- })
527
- openSeaSDK.addListener(EventType.ApproveCurrency, ({ accountAddress, tokenAddress }) => {
528
- console.info({ accountAddress, tokenAddress })
529
- dispatch({ type: ActionTypes.APPROVE_WETH })
530
- })
531
- openSeaSDK.addListener(EventType.ApproveAllAssets, ({ accountAddress, tokenAddress }) => {
532
- console.info({ accountAddress, tokenAddress })
533
- dispatch({ type: ActionTypes.APPROVE_ALL_ASSETS })
534
- })
535
- openSeaSDK.addListener(EventType.ApproveAsset, ({ accountAddress, tokenAddress, tokenId }) => {
536
- console.info({ accountAddress, tokenAddress, tokenId })
537
- dispatch({ type: ActionTypes.APPROVE_ASSET })
538
- })
539
- openSeaSDK.addListener(EventType.CreateOrder, ({ order, accountAddress }) => {
540
- console.info({ order, accountAddress })
541
- dispatch({ type: ActionTypes.CREATE_ORDER })
542
- })
543
- openSeaSDK.addListener(EventType.OrderDenied, ({ order, accountAddress }) => {
544
- console.info({ order, accountAddress })
545
- dispatch({ type: ActionTypes.RESET_EXCHANGE })
417
+ console.info('Unwrap ETH: ',{ accountAddress, amount })
546
418
  })
547
419
  openSeaSDK.addListener(EventType.MatchOrders, ({ buy, sell, accountAddress }) => {
548
- console.info({ buy, sell, accountAddress })
549
- dispatch({ type: ActionTypes.FULFILL_ORDER })
420
+ console.info('Match orders: ', { buy, sell, accountAddress })
550
421
  })
551
422
  openSeaSDK.addListener(EventType.CancelOrder, ({ order, accountAddress }) => {
552
- console.info({ order, accountAddress })
553
- dispatch({ type: ActionTypes.CANCEL_ORDER })
423
+ console.info('Cancel order: ', { order, accountAddress })
554
424
  })
555
- }
556
425
  }
557
426
  ```
558
427
 
559
- To remove all listeners and start over, just call `openseaSDK.removeAllListeners()`.
428
+ To remove all listeners call `openseaSDK.removeAllListeners()`.
560
429
 
561
430
  ## Learning More
562
431
 
package/lib/api/api.d.ts CHANGED
@@ -143,6 +143,16 @@ export declare class OpenSeaAPI {
143
143
  * @returns The {@link ListNFTsResponse} returned by the API.
144
144
  */
145
145
  getNFTsByContract(chain: Chain, address: string, limit?: number | undefined, next?: string | undefined, retries?: number): Promise<ListNFTsResponse>;
146
+ /**
147
+ * Fetch NFTs owned by an account.
148
+ * @param address The address of the account
149
+ * @param limit The number of NFTs to retrieve. Must be greater than 0 and less than 51.
150
+ * @param next Cursor to retrieve the next page of NFTs
151
+ * @param retries Number of times to retry if the service is unavailable for any reason.
152
+ * @param chain The chain to query. Defaults to the chain set in the constructor.
153
+ * @returns The {@link ListNFTsResponse} returned by the API.
154
+ */
155
+ getNFTsByAccount(address: string, limit?: number | undefined, next?: string | undefined, retries?: number, chain?: Chain): Promise<ListNFTsResponse>;
146
156
  /**
147
157
  * Fetch metadata, traits, ownership information, and rarity for a single NFT.
148
158
  * @param chain The NFT's chain.
package/lib/api/api.js CHANGED
@@ -282,6 +282,32 @@ class OpenSeaAPI {
282
282
  return response;
283
283
  });
284
284
  }
285
+ /**
286
+ * Fetch NFTs owned by an account.
287
+ * @param address The address of the account
288
+ * @param limit The number of NFTs to retrieve. Must be greater than 0 and less than 51.
289
+ * @param next Cursor to retrieve the next page of NFTs
290
+ * @param retries Number of times to retry if the service is unavailable for any reason.
291
+ * @param chain The chain to query. Defaults to the chain set in the constructor.
292
+ * @returns The {@link ListNFTsResponse} returned by the API.
293
+ */
294
+ getNFTsByAccount(address, limit = undefined, next = undefined, retries = 1, chain = this.chain) {
295
+ return __awaiter(this, void 0, void 0, function* () {
296
+ let response;
297
+ try {
298
+ response = yield this.get((0, utils_1.getListNFTsByAccountPath)(chain, address), {
299
+ limit,
300
+ next,
301
+ });
302
+ }
303
+ catch (error) {
304
+ _throwOrContinue(error, retries);
305
+ yield (0, utils_2.delay)(1000);
306
+ return this.getNFTsByAccount(address, limit, next, retries - 1, chain);
307
+ }
308
+ return response;
309
+ });
310
+ }
285
311
  /**
286
312
  * Fetch metadata, traits, ownership information, and rarity for a single NFT.
287
313
  * @param chain The NFT's chain.
@@ -1 +1 @@
1
- {"version":3,"file":"api.js","sourceRoot":"","sources":["../../src/api/api.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;AAAA,mCAAgC;AAahC,4CAA+E;AAW/E,2CAiByB;AACzB,oCASkB;AAClB,0CAOwB;AAExB;;;GAGG;AACH,MAAa,UAAU;IAkBrB;;;;OAIG;IACH,YAAY,MAAwB,EAAE,MAA8B;;QAlBpE;;WAEG;QACI,aAAQ,GAAG,EAAE,CAAC;QAQb,eAAU,GAAG,IAAI,CAAC;QAQxB,IAAI,CAAC,MAAM,GAAG,MAAM,CAAC,MAAM,CAAC;QAC5B,IAAI,CAAC,KAAK,GAAG,MAAA,MAAM,CAAC,KAAK,mCAAI,aAAK,CAAC,OAAO,CAAC;QAE3C,IAAI,CAAC,UAAU,GAAG,IAAA,mBAAW,EAAC,IAAI,CAAC,KAAK,CAAC;YACvC,CAAC,CAAC,4BAAgB;YAClB,CAAC,CAAC,4BAAgB,CAAC;QAErB,gCAAgC;QAChC,IAAI,CAAC,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AAC,EAAE,GAAG,CAAC,KAAK,CACvE,CAAC;YAEF,OAAO,MAAM,eAAM,CAAC,KAAK,CAAC,SAAS,CACjC,GAAG,EACH,IAAI,CAAC,CAAC,CAAC,IAAI,CAAC,SAAS,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC,SAAS,CACxC,CAAC;QACJ,CAAC;KAAA;CACF;AAroBD,gCAqoBC;AAED,SAAS,gBAAgB,CAAC,KAAc,EAAE,OAAe;IACvD,MAAM,aAAa,GACjB,KAAK,YAAY,KAAK;QACtB,CAAC,CAAC,KAAK,CAAC,OAAO;QACf,CAAC,KAAK,CAAC,OAAO,CAAC,QAAQ,CAAC,KAAK,CAAC,IAAI,KAAK,CAAC,OAAO,CAAC,QAAQ,CAAC,KAAK,CAAC,CAAC,CAAC;IAEnE,IAAI,OAAO,IAAI,CAAC,IAAI,CAAC,aAAa,EAAE;QAClC,MAAM,KAAK,CAAC;KACb;AACH,CAAC"}
@@ -1,6 +1,6 @@
1
1
  import { ConsiderationItem } from "@opensea/seaport-js/lib/types";
2
- import { OpenSeaAsset, OpenSeaAssetBundle, OpenSeaCollection, OpenSeaFungibleToken } from "src/types";
3
2
  import { OrderV2, ProtocolData, QueryCursors } from "../orders/types";
3
+ import { OpenSeaAsset, OpenSeaAssetBundle, OpenSeaCollection, OpenSeaFungibleToken } from "../types";
4
4
  /**
5
5
  * Response from OpenSea API for building an offer.
6
6
  * @category API Response Types
package/lib/bundle.js CHANGED
@@ -283,6 +283,32 @@ class OpenSeaAPI {
283
283
  return response;
284
284
  });
285
285
  }
286
+ /**
287
+ * Fetch NFTs owned by an account.
288
+ * @param address The address of the account
289
+ * @param limit The number of NFTs to retrieve. Must be greater than 0 and less than 51.
290
+ * @param next Cursor to retrieve the next page of NFTs
291
+ * @param retries Number of times to retry if the service is unavailable for any reason.
292
+ * @param chain The chain to query. Defaults to the chain set in the constructor.
293
+ * @returns The {@link ListNFTsResponse} returned by the API.
294
+ */
295
+ getNFTsByAccount(address, limit = undefined, next = undefined, retries = 1, chain = this.chain) {
296
+ return __awaiter(this, void 0, void 0, function* () {
297
+ let response;
298
+ try {
299
+ response = yield this.get((0, utils_1.getListNFTsByAccountPath)(chain, address), {
300
+ limit,
301
+ next,
302
+ });
303
+ }
304
+ catch (error) {
305
+ _throwOrContinue(error, retries);
306
+ yield (0, utils_2.delay)(1000);
307
+ return this.getNFTsByAccount(address, limit, next, retries - 1, chain);
308
+ }
309
+ return response;
310
+ });
311
+ }
286
312
  /**
287
313
  * Fetch metadata, traits, ownership information, and rarity for a single NFT.
288
314
  * @param chain The NFT's chain.
@@ -509,7 +535,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
509
535
  },{}],4:[function(require,module,exports){
510
536
  "use strict";
511
537
  Object.defineProperty(exports, "__esModule", { value: true });
512
- exports.SHARED_STOREFRONT_LAZY_MINT_ADAPTER_CROSS_CHAIN_ADDRESS = exports.SHARED_STOREFRONT_ADDRESSES = exports.SHARED_STOREFRONT_ADDRESS_GOERLI = exports.SHARED_STOREFRONT_ADDRESS_MAINNET = exports.DEFAULT_ZONE = exports.API_V1_PATH = exports.API_BASE_TESTNET = exports.API_BASE_MAINNET = exports.MAX_EXPIRATION_MONTHS = exports.INVERSE_BASIS_POINT = void 0;
538
+ exports.SHARED_STOREFRONT_LAZY_MINT_ADAPTER_CROSS_CHAIN_ADDRESS = exports.SHARED_STOREFRONT_ADDRESSES = exports.SHARED_STOREFRONT_ADDRESS_GOERLI = exports.SHARED_STOREFRONT_ADDRESS_MAINNET = exports.ENGLISH_AUCTION_ZONE = exports.DEFAULT_ZONE = exports.API_V1_PATH = exports.API_BASE_TESTNET = exports.API_BASE_MAINNET = exports.MAX_EXPIRATION_MONTHS = exports.INVERSE_BASIS_POINT = void 0;
513
539
  const ethers_1 = require("ethers");
514
540
  exports.INVERSE_BASIS_POINT = 10000; // 100 basis points per 1%
515
541
  exports.MAX_EXPIRATION_MONTHS = 1;
@@ -517,6 +543,7 @@ exports.API_BASE_MAINNET = "https://api.opensea.io";
517
543
  exports.API_BASE_TESTNET = "https://testnets-api.opensea.io";
518
544
  exports.API_V1_PATH = `/api/v1`;
519
545
  exports.DEFAULT_ZONE = ethers_1.ethers.constants.AddressZero;
546
+ exports.ENGLISH_AUCTION_ZONE = "0x110b2b128a9ed1be5ef3232d8e4e41640df5c2cd";
520
547
  // Ignore eslint no-unused-modules for below to keep backward compatibility
521
548
  // in case a downstream user was already using these imports directly.
522
549
  // These can be made non-exported in next major-versioned release.
@@ -669,7 +696,7 @@ exports.getPrivateListingFulfillments = getPrivateListingFulfillments;
669
696
  },{"@opensea/seaport-js/lib/utils/item":171,"@opensea/seaport-js/lib/utils/order":173,"ethers":236}],7:[function(require,module,exports){
670
697
  "use strict";
671
698
  Object.defineProperty(exports, "__esModule", { value: true });
672
- exports.deserializeOrder = exports.serializeOrdersQueryOptions = exports.getFulfillOfferPayload = exports.getFulfillListingPayload = exports.getFulfillmentDataPath = exports.getBuildCollectionOfferPayload = exports.getPostCollectionOfferPayload = exports.getRefreshMetadataPath = exports.getNFTPath = exports.getListNFTsByContractPath = exports.getListNFTsByCollectionPath = exports.getCollectionOffersPath = exports.getPostCollectionOfferPath = exports.getBuildOfferPath = exports.getCollectionPath = exports.getOrdersAPIPath = exports.DEFAULT_SEAPORT_CONTRACT_ADDRESS = void 0;
699
+ exports.deserializeOrder = exports.serializeOrdersQueryOptions = exports.getFulfillOfferPayload = exports.getFulfillListingPayload = exports.getFulfillmentDataPath = exports.getBuildCollectionOfferPayload = exports.getPostCollectionOfferPayload = exports.getRefreshMetadataPath = exports.getNFTPath = exports.getListNFTsByAccountPath = exports.getListNFTsByContractPath = exports.getListNFTsByCollectionPath = exports.getCollectionOffersPath = exports.getPostCollectionOfferPath = exports.getBuildOfferPath = exports.getCollectionPath = exports.getOrdersAPIPath = exports.DEFAULT_SEAPORT_CONTRACT_ADDRESS = void 0;
673
700
  const constants_1 = require("@opensea/seaport-js/lib/constants");
674
701
  const ethers_1 = require("ethers");
675
702
  const utils_1 = require("../utils");
@@ -703,6 +730,10 @@ const getListNFTsByContractPath = (chain, address) => {
703
730
  return `/v2/chain/${chain}/contract/${address}/nfts`;
704
731
  };
705
732
  exports.getListNFTsByContractPath = getListNFTsByContractPath;
733
+ const getListNFTsByAccountPath = (chain, address) => {
734
+ return `/v2/chain/${chain}/account/${address}/nfts`;
735
+ };
736
+ exports.getListNFTsByAccountPath = getListNFTsByAccountPath;
706
737
  const getNFTPath = (chain, address, identifier) => {
707
738
  return `/v2/chain/${chain}/contract/${address}/nfts/${identifier}`;
708
739
  };
@@ -1079,6 +1110,7 @@ class OpenSeaSDK {
1079
1110
  * @param options.expirationTime Expiration time for the order, in UTC seconds.
1080
1111
  * @param options.paymentTokenAddress ERC20 address for the payment token in the order. If unspecified, defaults to ETH
1081
1112
  * @param options.buyerAddress Optional address that's allowed to purchase this item. If specified, no other address will be able to take the order, unless its value is the null address.
1113
+ * @param options.englishAuction If true, the order will be listed as an English auction.
1082
1114
  * @returns The {@link OrderV2} that was created.
1083
1115
  *
1084
1116
  * @throws Error if the asset does not contain a token id.
@@ -1086,7 +1118,7 @@ class OpenSeaSDK {
1086
1118
  * @throws Error if the startAmount is not greater than 0.
1087
1119
  * @throws Error if paymentTokenAddress is not WETH on anything other than Ethereum mainnet.
1088
1120
  */
1089
- createSellOrder({ asset, accountAddress, startAmount, endAmount, quantity = 1, domain, salt, listingTime, expirationTime, paymentTokenAddress = ethers_1.ethers.constants.AddressZero, buyerAddress, }) {
1121
+ createSellOrder({ asset, accountAddress, startAmount, endAmount, quantity = 1, domain, salt, listingTime, expirationTime, paymentTokenAddress = ethers_1.ethers.constants.AddressZero, buyerAddress, englishAuction, }) {
1090
1122
  var _a;
1091
1123
  return __awaiter(this, void 0, void 0, function* () {
1092
1124
  yield this._requireAccountIsAvailable(accountAddress);
@@ -1095,6 +1127,9 @@ class OpenSeaSDK {
1095
1127
  }
1096
1128
  const { nft } = yield this.api.getNFT(this.chain, asset.tokenAddress, asset.tokenId);
1097
1129
  const offerAssetItems = this.getNFTItems([nft], [ethers_1.BigNumber.from(quantity !== null && quantity !== void 0 ? quantity : 1)]);
1130
+ if (englishAuction && paymentTokenAddress == ethers_1.ethers.constants.AddressZero) {
1131
+ throw new Error(`English auctions must use wrapped ETH or an ERC-20 token.`);
1132
+ }
1098
1133
  const { basePrice, endPrice } = yield this._getPriceParameters(types_1.OrderSide.Sell, paymentTokenAddress, expirationTime !== null && expirationTime !== void 0 ? expirationTime : (0, utils_3.getMaxOrderExpirationTimestamp)(), startAmount, endAmount !== null && endAmount !== void 0 ? endAmount : undefined);
1099
1134
  const collection = yield this.api.getCollection(nft.collection);
1100
1135
  const { sellerFee, openseaSellerFees, collectionSellerFees } = yield this.getFees({
@@ -1116,11 +1151,11 @@ class OpenSeaSDK {
1116
1151
  consideration: considerationFeeItems,
1117
1152
  startTime: listingTime === null || listingTime === void 0 ? void 0 : listingTime.toString(),
1118
1153
  endTime: (_a = expirationTime === null || expirationTime === void 0 ? void 0 : expirationTime.toString()) !== null && _a !== void 0 ? _a : (0, utils_3.getMaxOrderExpirationTimestamp)().toString(),
1119
- zone: constants_2.DEFAULT_ZONE,
1154
+ zone: englishAuction ? constants_2.ENGLISH_AUCTION_ZONE : constants_2.DEFAULT_ZONE,
1120
1155
  domain,
1121
1156
  salt: ethers_1.BigNumber.from(salt !== null && salt !== void 0 ? salt : 0).toString(),
1122
- restrictedByZone: false,
1123
- allowPartialFills: true,
1157
+ restrictedByZone: englishAuction ? true : false,
1158
+ allowPartialFills: englishAuction ? false : true,
1124
1159
  }, accountAddress);
1125
1160
  const order = yield executeAllActions();
1126
1161
  return this.api.postOrder(order, {
@@ -1235,9 +1270,9 @@ class OpenSeaSDK {
1235
1270
  const result = yield this.api.generateFulfillmentData(accountAddress, order.orderHash, order.protocolAddress, order.side);
1236
1271
  // If the order is using offer protection, the extraData
1237
1272
  // must be included with the order to successfully fulfill.
1238
- const fulfillmentOrder = result.fulfillment_data.transaction.input_data.orders[0];
1239
- if ("extraData" in fulfillmentOrder) {
1240
- extraData = fulfillmentOrder.extraData;
1273
+ const inputData = result.fulfillment_data.transaction.input_data;
1274
+ if ("orders" in inputData && "extraData" in inputData.orders[0]) {
1275
+ extraData = inputData.orders[0].extraData;
1241
1276
  }
1242
1277
  const signature = result.fulfillment_data.orders[0].signature;
1243
1278
  order.clientSignature = signature;
@@ -1446,10 +1481,8 @@ class OpenSeaSDK {
1446
1481
  * @param expirationTime When the auction expires, or 0 if never.
1447
1482
  * @param startAmount The base value for the order, in the token's main units (e.g. ETH instead of wei)
1448
1483
  * @param endAmount The end value for the order, in the token's main units (e.g. ETH instead of wei). If unspecified, the order's `extra` attribute will be 0
1449
- * @param waitingForBestCounterOrder
1450
- * @param englishAuctionReservePrice
1451
1484
  */
1452
- _getPriceParameters(orderSide, tokenAddress, expirationTime, startAmount, endAmount, waitingForBestCounterOrder = false, englishAuctionReservePrice) {
1485
+ _getPriceParameters(orderSide, tokenAddress, expirationTime, startAmount, endAmount) {
1453
1486
  var _a;
1454
1487
  return __awaiter(this, void 0, void 0, function* () {
1455
1488
  const isEther = tokenAddress === ethers_1.ethers.constants.AddressZero;
@@ -1471,9 +1504,6 @@ class OpenSeaSDK {
1471
1504
  const basePrice = startAmountWei;
1472
1505
  const endPrice = endAmountWei;
1473
1506
  const extra = priceDiffWei;
1474
- const reservePrice = englishAuctionReservePrice
1475
- ? ethers_1.ethers.utils.parseUnits(startAmount.toString(), decimals)
1476
- : undefined;
1477
1507
  // Validation
1478
1508
  if (startAmount == null || startAmountWei.lt(0)) {
1479
1509
  throw new Error(`Starting price must be a number >= 0`);
@@ -1493,9 +1523,6 @@ class OpenSeaSDK {
1493
1523
  throw new Error(`No ERC-20 token found for ${tokenAddress}, only WETH is currently supported for chains other than Mainnet Ethereum`);
1494
1524
  }
1495
1525
  }
1496
- if (isEther && waitingForBestCounterOrder) {
1497
- throw new Error(`English auctions must use wrapped ETH or an ERC-20 token.`);
1498
- }
1499
1526
  if (isEther && orderSide === types_1.OrderSide.Buy) {
1500
1527
  throw new Error(`Offers must use wrapped ETH or an ERC-20 token.`);
1501
1528
  }
@@ -1505,14 +1532,7 @@ class OpenSeaSDK {
1505
1532
  if (priceDiffWei.gt(0) && ethers_1.BigNumber.from(expirationTime).isZero()) {
1506
1533
  throw new Error("Expiration time must be set if order will change in price.");
1507
1534
  }
1508
- const reservePriceIsDefinedAndNonZero = reservePrice && !reservePrice.isZero();
1509
- if (reservePriceIsDefinedAndNonZero && !waitingForBestCounterOrder) {
1510
- throw new Error("Reserve prices may only be set on English auctions.");
1511
- }
1512
- if (reservePriceIsDefinedAndNonZero && (reservePrice === null || reservePrice === void 0 ? void 0 : reservePrice.lt(startAmountWei))) {
1513
- throw new Error("Reserve price must be greater than or equal to the start amount.");
1514
- }
1515
- return { basePrice, extra, paymentToken, reservePrice, endPrice };
1535
+ return { basePrice, extra, paymentToken, endPrice };
1516
1536
  });
1517
1537
  }
1518
1538
  _dispatch(event, data) {
@@ -2510,7 +2530,7 @@ Object.defineProperty(exports, "ERC721__factory", { enumerable: true, get: funct
2510
2530
  },{"./factories":12,"./factories/ERC1155__factory":9,"./factories/ERC20__factory":10,"./factories/ERC721__factory":11}],14:[function(require,module,exports){
2511
2531
  "use strict";
2512
2532
  Object.defineProperty(exports, "__esModule", { value: true });
2513
- exports.HowToCall = exports.SafelistStatus = exports.TokenStandard = exports.AssetContractType = exports.SaleKind = exports.FeeMethod = exports.OrderSide = exports.Chain = exports.EventType = void 0;
2533
+ exports.SafelistStatus = exports.TokenStandard = exports.AssetContractType = exports.FeeMethod = exports.OrderSide = exports.Chain = exports.EventType = void 0;
2514
2534
  /**
2515
2535
  * Events emitted by the SDK which can be used by frontends applications
2516
2536
  * to update state or show useful messages to users.
@@ -2543,7 +2563,6 @@ var EventType;
2543
2563
  * Emitted when the {@link OpenSeaSDK.unwrapWeth} method is called.
2544
2564
  */
2545
2565
  EventType["UnwrapWeth"] = "UnwrapWeth";
2546
- // Basic actions: matching orders, creating orders, and cancelling orders
2547
2566
  /**
2548
2567
  * Emitted when fulfilling a public or private order.
2549
2568
  */
@@ -2628,14 +2647,6 @@ var FeeMethod;
2628
2647
  FeeMethod[FeeMethod["ProtocolFee"] = 0] = "ProtocolFee";
2629
2648
  FeeMethod[FeeMethod["SplitFee"] = 1] = "SplitFee";
2630
2649
  })(FeeMethod || (exports.FeeMethod = FeeMethod = {}));
2631
- /**
2632
- * Type of sale.
2633
- */
2634
- var SaleKind;
2635
- (function (SaleKind) {
2636
- SaleKind[SaleKind["FixedPrice"] = 0] = "FixedPrice";
2637
- SaleKind[SaleKind["DutchAuction"] = 1] = "DutchAuction";
2638
- })(SaleKind || (exports.SaleKind = SaleKind = {}));
2639
2650
  /**
2640
2651
  * Types of asset contracts
2641
2652
  * Given by the asset_contract_type in the OpenSea API
@@ -2697,13 +2708,6 @@ var AssetEventType;
2697
2708
  AssetEventType["Custom"] = "custom";
2698
2709
  AssetEventType["Payout"] = "payout";
2699
2710
  })(AssetEventType || (AssetEventType = {}));
2700
- var HowToCall;
2701
- (function (HowToCall) {
2702
- HowToCall[HowToCall["Call"] = 0] = "Call";
2703
- HowToCall[HowToCall["DelegateCall"] = 1] = "DelegateCall";
2704
- HowToCall[HowToCall["StaticCall"] = 2] = "StaticCall";
2705
- HowToCall[HowToCall["Create"] = 3] = "Create";
2706
- })(HowToCall || (exports.HowToCall = HowToCall = {}));
2707
2711
 
2708
2712
  },{}],15:[function(require,module,exports){
2709
2713
  "use strict";
@@ -3010,6 +3014,8 @@ const getWETHAddress = (chain) => {
3010
3014
  return "0xc02aaa39b223fe8d0a0e5c4f27ead9083c756cc2";
3011
3015
  case types_1.Chain.Polygon:
3012
3016
  return "0x7ceB23fD6bC0adD59E62ac25578270cFf1b9f619";
3017
+ case types_1.Chain.Mumbai:
3018
+ return "0xa6fa4fb5f76172d178d61b04b0ecd319c5d1c0aa";
3013
3019
  case types_1.Chain.Goerli:
3014
3020
  return "0xb4fbf271143f4fbf7b91a5ded31805e42b2208d6";
3015
3021
  case types_1.Chain.Sepolia:
@@ -4,6 +4,7 @@ export declare const API_BASE_MAINNET = "https://api.opensea.io";
4
4
  export declare const API_BASE_TESTNET = "https://testnets-api.opensea.io";
5
5
  export declare const API_V1_PATH = "/api/v1";
6
6
  export declare const DEFAULT_ZONE = "0x0000000000000000000000000000000000000000";
7
+ export declare const ENGLISH_AUCTION_ZONE = "0x110b2b128a9ed1be5ef3232d8e4e41640df5c2cd";
7
8
  export declare const SHARED_STOREFRONT_ADDRESS_MAINNET = "0x495f947276749ce646f68ac8c248420045cb7b5e";
8
9
  export declare const SHARED_STOREFRONT_ADDRESS_GOERLI = "0x804159144aefb1dc17b171afcefa5b33746c722f";
9
10
  export declare const SHARED_STOREFRONT_ADDRESSES: string[];
package/lib/constants.js CHANGED
@@ -1,6 +1,6 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.SHARED_STOREFRONT_LAZY_MINT_ADAPTER_CROSS_CHAIN_ADDRESS = exports.SHARED_STOREFRONT_ADDRESSES = exports.SHARED_STOREFRONT_ADDRESS_GOERLI = exports.SHARED_STOREFRONT_ADDRESS_MAINNET = exports.DEFAULT_ZONE = exports.API_V1_PATH = exports.API_BASE_TESTNET = exports.API_BASE_MAINNET = exports.MAX_EXPIRATION_MONTHS = exports.INVERSE_BASIS_POINT = void 0;
3
+ exports.SHARED_STOREFRONT_LAZY_MINT_ADAPTER_CROSS_CHAIN_ADDRESS = exports.SHARED_STOREFRONT_ADDRESSES = exports.SHARED_STOREFRONT_ADDRESS_GOERLI = exports.SHARED_STOREFRONT_ADDRESS_MAINNET = exports.ENGLISH_AUCTION_ZONE = exports.DEFAULT_ZONE = exports.API_V1_PATH = exports.API_BASE_TESTNET = exports.API_BASE_MAINNET = exports.MAX_EXPIRATION_MONTHS = exports.INVERSE_BASIS_POINT = void 0;
4
4
  const ethers_1 = require("ethers");
5
5
  exports.INVERSE_BASIS_POINT = 10000; // 100 basis points per 1%
6
6
  exports.MAX_EXPIRATION_MONTHS = 1;
@@ -8,6 +8,7 @@ exports.API_BASE_MAINNET = "https://api.opensea.io";
8
8
  exports.API_BASE_TESTNET = "https://testnets-api.opensea.io";
9
9
  exports.API_V1_PATH = `/api/v1`;
10
10
  exports.DEFAULT_ZONE = ethers_1.ethers.constants.AddressZero;
11
+ exports.ENGLISH_AUCTION_ZONE = "0x110b2b128a9ed1be5ef3232d8e4e41640df5c2cd";
11
12
  // Ignore eslint no-unused-modules for below to keep backward compatibility
12
13
  // in case a downstream user was already using these imports directly.
13
14
  // These can be made non-exported in next major-versioned release.