@opensea/sdk 9.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +7 -0
- package/README.md +70 -0
- package/lib/api/accounts.d.ts +27 -0
- package/lib/api/accounts.js +46 -0
- package/lib/api/accounts.js.map +1 -0
- package/lib/api/api.d.ts +489 -0
- package/lib/api/api.js +754 -0
- package/lib/api/api.js.map +1 -0
- package/lib/api/apiPaths.d.ts +46 -0
- package/lib/api/apiPaths.js +176 -0
- package/lib/api/apiPaths.js.map +1 -0
- package/lib/api/chains.d.ts +13 -0
- package/lib/api/chains.js +22 -0
- package/lib/api/chains.js.map +1 -0
- package/lib/api/collections.d.ts +34 -0
- package/lib/api/collections.js +80 -0
- package/lib/api/collections.js.map +1 -0
- package/lib/api/drops.d.ts +21 -0
- package/lib/api/drops.js +39 -0
- package/lib/api/drops.js.map +1 -0
- package/lib/api/events.d.ts +26 -0
- package/lib/api/events.js +43 -0
- package/lib/api/events.js.map +1 -0
- package/lib/api/fetcher.d.ts +24 -0
- package/lib/api/fetcher.js +3 -0
- package/lib/api/fetcher.js.map +1 -0
- package/lib/api/index.d.ts +2 -0
- package/lib/api/index.js +19 -0
- package/lib/api/index.js.map +1 -0
- package/lib/api/listings.d.ts +44 -0
- package/lib/api/listings.js +88 -0
- package/lib/api/listings.js.map +1 -0
- package/lib/api/nfts.d.ts +39 -0
- package/lib/api/nfts.js +79 -0
- package/lib/api/nfts.js.map +1 -0
- package/lib/api/offers.d.ts +54 -0
- package/lib/api/offers.js +124 -0
- package/lib/api/offers.js.map +1 -0
- package/lib/api/orders.d.ts +50 -0
- package/lib/api/orders.js +153 -0
- package/lib/api/orders.js.map +1 -0
- package/lib/api/search.d.ts +13 -0
- package/lib/api/search.js +22 -0
- package/lib/api/search.js.map +1 -0
- package/lib/api/tokens.d.ts +25 -0
- package/lib/api/tokens.js +43 -0
- package/lib/api/tokens.js.map +1 -0
- package/lib/api/types.d.ts +1113 -0
- package/lib/api/types.js +65 -0
- package/lib/api/types.js.map +1 -0
- package/lib/constants.d.ts +22 -0
- package/lib/constants.js +52 -0
- package/lib/constants.js.map +1 -0
- package/lib/index.d.ts +18 -0
- package/lib/index.js +24 -0
- package/lib/index.js.map +1 -0
- package/lib/orders/privateListings.d.ts +12 -0
- package/lib/orders/privateListings.js +130 -0
- package/lib/orders/privateListings.js.map +1 -0
- package/lib/orders/types.d.ts +160 -0
- package/lib/orders/types.js +10 -0
- package/lib/orders/types.js.map +1 -0
- package/lib/orders/utils.d.ts +89 -0
- package/lib/orders/utils.js +177 -0
- package/lib/orders/utils.js.map +1 -0
- package/lib/sdk/assets.d.ts +104 -0
- package/lib/sdk/assets.js +398 -0
- package/lib/sdk/assets.js.map +1 -0
- package/lib/sdk/cancellation.d.ts +97 -0
- package/lib/sdk/cancellation.js +235 -0
- package/lib/sdk/cancellation.js.map +1 -0
- package/lib/sdk/context.d.ts +28 -0
- package/lib/sdk/context.js +3 -0
- package/lib/sdk/context.js.map +1 -0
- package/lib/sdk/fulfillment.d.ts +153 -0
- package/lib/sdk/fulfillment.js +298 -0
- package/lib/sdk/fulfillment.js.map +1 -0
- package/lib/sdk/orders.d.ts +253 -0
- package/lib/sdk/orders.js +679 -0
- package/lib/sdk/orders.js.map +1 -0
- package/lib/sdk/tokens.d.ts +31 -0
- package/lib/sdk/tokens.js +65 -0
- package/lib/sdk/tokens.js.map +1 -0
- package/lib/sdk.d.ts +560 -0
- package/lib/sdk.js +693 -0
- package/lib/sdk.js.map +1 -0
- package/lib/src/api/accounts.d.ts +18 -0
- package/lib/src/api/accounts.js +30 -0
- package/lib/src/api/accounts.js.map +1 -0
- package/lib/src/api/api.d.ts +429 -0
- package/lib/src/api/api.js +652 -0
- package/lib/src/api/api.js.map +1 -0
- package/lib/src/api/apiPaths.d.ts +37 -0
- package/lib/src/api/apiPaths.js +140 -0
- package/lib/src/api/apiPaths.js.map +1 -0
- package/lib/src/api/collections.d.ts +26 -0
- package/lib/src/api/collections.js +57 -0
- package/lib/src/api/collections.js.map +1 -0
- package/lib/src/api/events.d.ts +26 -0
- package/lib/src/api/events.js +42 -0
- package/lib/src/api/events.js.map +1 -0
- package/lib/src/api/fetcher.d.ts +24 -0
- package/lib/src/api/fetcher.js +3 -0
- package/lib/src/api/fetcher.js.map +1 -0
- package/lib/src/api/index.d.ts +2 -0
- package/lib/src/api/index.js +19 -0
- package/lib/src/api/index.js.map +1 -0
- package/lib/src/api/listings.d.ts +44 -0
- package/lib/src/api/listings.js +86 -0
- package/lib/src/api/listings.js.map +1 -0
- package/lib/src/api/nfts.d.ts +35 -0
- package/lib/src/api/nfts.js +66 -0
- package/lib/src/api/nfts.js.map +1 -0
- package/lib/src/api/offers.d.ts +54 -0
- package/lib/src/api/offers.js +122 -0
- package/lib/src/api/offers.js.map +1 -0
- package/lib/src/api/orders.d.ts +50 -0
- package/lib/src/api/orders.js +151 -0
- package/lib/src/api/orders.js.map +1 -0
- package/lib/src/api/search.d.ts +13 -0
- package/lib/src/api/search.js +21 -0
- package/lib/src/api/search.js.map +1 -0
- package/lib/src/api/tokens.d.ts +25 -0
- package/lib/src/api/tokens.js +42 -0
- package/lib/src/api/tokens.js.map +1 -0
- package/lib/src/api/types.d.ts +840 -0
- package/lib/src/api/types.js +65 -0
- package/lib/src/api/types.js.map +1 -0
- package/lib/src/constants.d.ts +22 -0
- package/lib/src/constants.js +52 -0
- package/lib/src/constants.js.map +1 -0
- package/lib/src/index.d.ts +18 -0
- package/lib/src/index.js +24 -0
- package/lib/src/index.js.map +1 -0
- package/lib/src/orders/privateListings.d.ts +12 -0
- package/lib/src/orders/privateListings.js +130 -0
- package/lib/src/orders/privateListings.js.map +1 -0
- package/lib/src/orders/types.d.ts +160 -0
- package/lib/src/orders/types.js +10 -0
- package/lib/src/orders/types.js.map +1 -0
- package/lib/src/orders/utils.d.ts +89 -0
- package/lib/src/orders/utils.js +177 -0
- package/lib/src/orders/utils.js.map +1 -0
- package/lib/src/sdk/assets.d.ts +104 -0
- package/lib/src/sdk/assets.js +397 -0
- package/lib/src/sdk/assets.js.map +1 -0
- package/lib/src/sdk/cancellation.d.ts +97 -0
- package/lib/src/sdk/cancellation.js +234 -0
- package/lib/src/sdk/cancellation.js.map +1 -0
- package/lib/src/sdk/context.d.ts +28 -0
- package/lib/src/sdk/context.js +3 -0
- package/lib/src/sdk/context.js.map +1 -0
- package/lib/src/sdk/fulfillment.d.ts +153 -0
- package/lib/src/sdk/fulfillment.js +296 -0
- package/lib/src/sdk/fulfillment.js.map +1 -0
- package/lib/src/sdk/orders.d.ts +253 -0
- package/lib/src/sdk/orders.js +677 -0
- package/lib/src/sdk/orders.js.map +1 -0
- package/lib/src/sdk/tokens.d.ts +31 -0
- package/lib/src/sdk/tokens.js +64 -0
- package/lib/src/sdk/tokens.js.map +1 -0
- package/lib/src/sdk.d.ts +560 -0
- package/lib/src/sdk.js +675 -0
- package/lib/src/sdk.js.map +1 -0
- package/lib/src/typechain/contracts/ERC1155.d.ts +236 -0
- package/lib/src/typechain/contracts/ERC1155.js +3 -0
- package/lib/src/typechain/contracts/ERC1155.js.map +1 -0
- package/lib/src/typechain/contracts/ERC20.d.ts +141 -0
- package/lib/src/typechain/contracts/ERC20.js +3 -0
- package/lib/src/typechain/contracts/ERC20.js.map +1 -0
- package/lib/src/typechain/contracts/ERC721.d.ts +213 -0
- package/lib/src/typechain/contracts/ERC721.js +3 -0
- package/lib/src/typechain/contracts/ERC721.js.map +1 -0
- package/lib/src/typechain/contracts/Multicall3.d.ts +57 -0
- package/lib/src/typechain/contracts/Multicall3.js +3 -0
- package/lib/src/typechain/contracts/Multicall3.js.map +1 -0
- package/lib/src/typechain/contracts/TransferHelper.d.ts +55 -0
- package/lib/src/typechain/contracts/TransferHelper.js +3 -0
- package/lib/src/typechain/contracts/TransferHelper.js.map +1 -0
- package/lib/src/typechain/contracts/common.d.ts +50 -0
- package/lib/src/typechain/contracts/common.js +3 -0
- package/lib/src/typechain/contracts/common.js.map +1 -0
- package/lib/src/typechain/contracts/factories/ERC1155__factory.d.ts +250 -0
- package/lib/src/typechain/contracts/factories/ERC1155__factory.js +332 -0
- package/lib/src/typechain/contracts/factories/ERC1155__factory.js.map +1 -0
- package/lib/src/typechain/contracts/factories/ERC20__factory.d.ts +174 -0
- package/lib/src/typechain/contracts/factories/ERC20__factory.js +240 -0
- package/lib/src/typechain/contracts/factories/ERC20__factory.js.map +1 -0
- package/lib/src/typechain/contracts/factories/ERC721__factory.d.ts +268 -0
- package/lib/src/typechain/contracts/factories/ERC721__factory.js +351 -0
- package/lib/src/typechain/contracts/factories/ERC721__factory.js.map +1 -0
- package/lib/src/typechain/contracts/factories/Multicall3__factory.d.ts +43 -0
- package/lib/src/typechain/contracts/factories/Multicall3__factory.js +68 -0
- package/lib/src/typechain/contracts/factories/Multicall3__factory.js.map +1 -0
- package/lib/src/typechain/contracts/factories/TransferHelper__factory.d.ts +46 -0
- package/lib/src/typechain/contracts/factories/TransferHelper__factory.js +71 -0
- package/lib/src/typechain/contracts/factories/TransferHelper__factory.js.map +1 -0
- package/lib/src/typechain/contracts/factories/index.d.ts +5 -0
- package/lib/src/typechain/contracts/factories/index.js +17 -0
- package/lib/src/typechain/contracts/factories/index.js.map +1 -0
- package/lib/src/typechain/contracts/index.d.ts +11 -0
- package/lib/src/typechain/contracts/index.js +48 -0
- package/lib/src/typechain/contracts/index.js.map +1 -0
- package/lib/src/types.d.ts +387 -0
- package/lib/src/types.js +127 -0
- package/lib/src/types.js.map +1 -0
- package/lib/src/utils/chain.d.ts +60 -0
- package/lib/src/utils/chain.js +248 -0
- package/lib/src/utils/chain.js.map +1 -0
- package/lib/src/utils/converters.d.ts +37 -0
- package/lib/src/utils/converters.js +137 -0
- package/lib/src/utils/converters.js.map +1 -0
- package/lib/src/utils/dateHelper.d.ts +38 -0
- package/lib/src/utils/dateHelper.js +52 -0
- package/lib/src/utils/dateHelper.js.map +1 -0
- package/lib/src/utils/fees.d.ts +13 -0
- package/lib/src/utils/fees.js +29 -0
- package/lib/src/utils/fees.js.map +1 -0
- package/lib/src/utils/index.d.ts +2 -0
- package/lib/src/utils/index.js +19 -0
- package/lib/src/utils/index.js.map +1 -0
- package/lib/src/utils/protocol.d.ts +75 -0
- package/lib/src/utils/protocol.js +161 -0
- package/lib/src/utils/protocol.js.map +1 -0
- package/lib/src/utils/rateLimit.d.ts +34 -0
- package/lib/src/utils/rateLimit.js +97 -0
- package/lib/src/utils/rateLimit.js.map +1 -0
- package/lib/src/utils/stringHelper.d.ts +18 -0
- package/lib/src/utils/stringHelper.js +24 -0
- package/lib/src/utils/stringHelper.js.map +1 -0
- package/lib/src/utils/utils.d.ts +18 -0
- package/lib/src/utils/utils.js +45 -0
- package/lib/src/utils/utils.js.map +1 -0
- package/lib/typechain/contracts/ERC1155.d.ts +236 -0
- package/lib/typechain/contracts/ERC1155.js +3 -0
- package/lib/typechain/contracts/ERC1155.js.map +1 -0
- package/lib/typechain/contracts/ERC20.d.ts +141 -0
- package/lib/typechain/contracts/ERC20.js +3 -0
- package/lib/typechain/contracts/ERC20.js.map +1 -0
- package/lib/typechain/contracts/ERC721.d.ts +213 -0
- package/lib/typechain/contracts/ERC721.js +3 -0
- package/lib/typechain/contracts/ERC721.js.map +1 -0
- package/lib/typechain/contracts/Multicall3.d.ts +57 -0
- package/lib/typechain/contracts/Multicall3.js +3 -0
- package/lib/typechain/contracts/Multicall3.js.map +1 -0
- package/lib/typechain/contracts/TransferHelper.d.ts +55 -0
- package/lib/typechain/contracts/TransferHelper.js +3 -0
- package/lib/typechain/contracts/TransferHelper.js.map +1 -0
- package/lib/typechain/contracts/common.d.ts +50 -0
- package/lib/typechain/contracts/common.js +3 -0
- package/lib/typechain/contracts/common.js.map +1 -0
- package/lib/typechain/contracts/factories/ERC1155__factory.d.ts +250 -0
- package/lib/typechain/contracts/factories/ERC1155__factory.js +332 -0
- package/lib/typechain/contracts/factories/ERC1155__factory.js.map +1 -0
- package/lib/typechain/contracts/factories/ERC20__factory.d.ts +174 -0
- package/lib/typechain/contracts/factories/ERC20__factory.js +240 -0
- package/lib/typechain/contracts/factories/ERC20__factory.js.map +1 -0
- package/lib/typechain/contracts/factories/ERC721__factory.d.ts +268 -0
- package/lib/typechain/contracts/factories/ERC721__factory.js +351 -0
- package/lib/typechain/contracts/factories/ERC721__factory.js.map +1 -0
- package/lib/typechain/contracts/factories/Multicall3__factory.d.ts +43 -0
- package/lib/typechain/contracts/factories/Multicall3__factory.js +68 -0
- package/lib/typechain/contracts/factories/Multicall3__factory.js.map +1 -0
- package/lib/typechain/contracts/factories/TransferHelper__factory.d.ts +46 -0
- package/lib/typechain/contracts/factories/TransferHelper__factory.js +71 -0
- package/lib/typechain/contracts/factories/TransferHelper__factory.js.map +1 -0
- package/lib/typechain/contracts/factories/index.d.ts +5 -0
- package/lib/typechain/contracts/factories/index.js +17 -0
- package/lib/typechain/contracts/factories/index.js.map +1 -0
- package/lib/typechain/contracts/index.d.ts +11 -0
- package/lib/typechain/contracts/index.js +48 -0
- package/lib/typechain/contracts/index.js.map +1 -0
- package/lib/types.d.ts +389 -0
- package/lib/types.js +129 -0
- package/lib/types.js.map +1 -0
- package/lib/utils/chain.d.ts +64 -0
- package/lib/utils/chain.js +211 -0
- package/lib/utils/chain.js.map +1 -0
- package/lib/utils/chainIds.generated.d.ts +7 -0
- package/lib/utils/chainIds.generated.js +37 -0
- package/lib/utils/chainIds.generated.js.map +1 -0
- package/lib/utils/converters.d.ts +37 -0
- package/lib/utils/converters.js +137 -0
- package/lib/utils/converters.js.map +1 -0
- package/lib/utils/dateHelper.d.ts +38 -0
- package/lib/utils/dateHelper.js +52 -0
- package/lib/utils/dateHelper.js.map +1 -0
- package/lib/utils/fees.d.ts +13 -0
- package/lib/utils/fees.js +29 -0
- package/lib/utils/fees.js.map +1 -0
- package/lib/utils/index.d.ts +2 -0
- package/lib/utils/index.js +19 -0
- package/lib/utils/index.js.map +1 -0
- package/lib/utils/protocol.d.ts +75 -0
- package/lib/utils/protocol.js +161 -0
- package/lib/utils/protocol.js.map +1 -0
- package/lib/utils/rateLimit.d.ts +34 -0
- package/lib/utils/rateLimit.js +97 -0
- package/lib/utils/rateLimit.js.map +1 -0
- package/lib/utils/stringHelper.d.ts +18 -0
- package/lib/utils/stringHelper.js +24 -0
- package/lib/utils/stringHelper.js.map +1 -0
- package/lib/utils/utils.d.ts +18 -0
- package/lib/utils/utils.js +45 -0
- package/lib/utils/utils.js.map +1 -0
- package/package.json +72 -0
- package/src/abi/ERC1155.json +314 -0
- package/src/abi/ERC20.json +222 -0
- package/src/abi/ERC721.json +333 -0
- package/src/abi/Multicall3.json +50 -0
- package/src/abi/TransferHelper.json +53 -0
- package/src/api/accounts.ts +69 -0
- package/src/api/api.ts +1152 -0
- package/src/api/apiPaths.ts +208 -0
- package/src/api/chains.ts +18 -0
- package/src/api/collections.ts +120 -0
- package/src/api/drops.ts +49 -0
- package/src/api/events.ts +71 -0
- package/src/api/fetcher.ts +31 -0
- package/src/api/index.ts +2 -0
- package/src/api/listings.ts +126 -0
- package/src/api/nfts.ts +144 -0
- package/src/api/offers.ts +242 -0
- package/src/api/orders.ts +283 -0
- package/src/api/search.ts +21 -0
- package/src/api/tokens.ts +67 -0
- package/src/api/types.ts +1210 -0
- package/src/constants.ts +90 -0
- package/src/index.ts +22 -0
- package/src/orders/privateListings.ts +173 -0
- package/src/orders/types.ts +191 -0
- package/src/orders/utils.ts +253 -0
- package/src/sdk/assets.ts +591 -0
- package/src/sdk/cancellation.ts +346 -0
- package/src/sdk/context.ts +33 -0
- package/src/sdk/fulfillment.ts +478 -0
- package/src/sdk/orders.ts +1149 -0
- package/src/sdk/tokens.ts +95 -0
- package/src/sdk.ts +1051 -0
- package/src/typechain/contracts/ERC1155.ts +440 -0
- package/src/typechain/contracts/ERC20.ts +286 -0
- package/src/typechain/contracts/ERC721.ts +412 -0
- package/src/typechain/contracts/Multicall3.ts +117 -0
- package/src/typechain/contracts/TransferHelper.ts +122 -0
- package/src/typechain/contracts/common.ts +131 -0
- package/src/typechain/contracts/factories/ERC1155__factory.ts +331 -0
- package/src/typechain/contracts/factories/ERC20__factory.ts +239 -0
- package/src/typechain/contracts/factories/ERC721__factory.ts +350 -0
- package/src/typechain/contracts/factories/Multicall3__factory.ts +67 -0
- package/src/typechain/contracts/factories/TransferHelper__factory.ts +76 -0
- package/src/typechain/contracts/factories/index.ts +8 -0
- package/src/typechain/contracts/index.ts +14 -0
- package/src/types.ts +413 -0
- package/src/utils/chain.ts +224 -0
- package/src/utils/chainIds.generated.ts +34 -0
- package/src/utils/converters.ts +145 -0
- package/src/utils/dateHelper.ts +48 -0
- package/src/utils/fees.ts +31 -0
- package/src/utils/index.ts +2 -0
- package/src/utils/protocol.ts +185 -0
- package/src/utils/rateLimit.ts +147 -0
- package/src/utils/stringHelper.ts +25 -0
- package/src/utils/utils.ts +36 -0
|
@@ -0,0 +1,65 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.OrderEventType = exports.AssetEventType = exports.TraitDisplayType = exports.OrderStatus = exports.CollectionOrderByOption = void 0;
|
|
4
|
+
var CollectionOrderByOption;
|
|
5
|
+
(function (CollectionOrderByOption) {
|
|
6
|
+
CollectionOrderByOption["CREATED_DATE"] = "created_date";
|
|
7
|
+
CollectionOrderByOption["ONE_DAY_CHANGE"] = "one_day_change";
|
|
8
|
+
CollectionOrderByOption["SEVEN_DAY_VOLUME"] = "seven_day_volume";
|
|
9
|
+
CollectionOrderByOption["SEVEN_DAY_CHANGE"] = "seven_day_change";
|
|
10
|
+
CollectionOrderByOption["NUM_OWNERS"] = "num_owners";
|
|
11
|
+
CollectionOrderByOption["MARKET_CAP"] = "market_cap";
|
|
12
|
+
})(CollectionOrderByOption || (exports.CollectionOrderByOption = CollectionOrderByOption = {}));
|
|
13
|
+
/**
|
|
14
|
+
* Order status enum.
|
|
15
|
+
* @category API Models
|
|
16
|
+
*/
|
|
17
|
+
var OrderStatus;
|
|
18
|
+
(function (OrderStatus) {
|
|
19
|
+
OrderStatus["ACTIVE"] = "ACTIVE";
|
|
20
|
+
OrderStatus["INACTIVE"] = "INACTIVE";
|
|
21
|
+
OrderStatus["FULFILLED"] = "FULFILLED";
|
|
22
|
+
OrderStatus["EXPIRED"] = "EXPIRED";
|
|
23
|
+
OrderStatus["CANCELLED"] = "CANCELLED";
|
|
24
|
+
})(OrderStatus || (exports.OrderStatus = OrderStatus = {}));
|
|
25
|
+
/**
|
|
26
|
+
* Trait display type returned by OpenSea API.
|
|
27
|
+
* @category API Models
|
|
28
|
+
*/
|
|
29
|
+
var TraitDisplayType;
|
|
30
|
+
(function (TraitDisplayType) {
|
|
31
|
+
TraitDisplayType["NUMBER"] = "number";
|
|
32
|
+
TraitDisplayType["BOOST_PERCENTAGE"] = "boost_percentage";
|
|
33
|
+
TraitDisplayType["BOOST_NUMBER"] = "boost_number";
|
|
34
|
+
TraitDisplayType["AUTHOR"] = "author";
|
|
35
|
+
TraitDisplayType["DATE"] = "date";
|
|
36
|
+
/** "None" is used for string traits */
|
|
37
|
+
TraitDisplayType["NONE"] = "None";
|
|
38
|
+
})(TraitDisplayType || (exports.TraitDisplayType = TraitDisplayType = {}));
|
|
39
|
+
/**
|
|
40
|
+
* Asset event type returned by OpenSea API.
|
|
41
|
+
* @category API Models
|
|
42
|
+
*/
|
|
43
|
+
var AssetEventType;
|
|
44
|
+
(function (AssetEventType) {
|
|
45
|
+
AssetEventType["SALE"] = "sale";
|
|
46
|
+
AssetEventType["TRANSFER"] = "transfer";
|
|
47
|
+
AssetEventType["MINT"] = "mint";
|
|
48
|
+
AssetEventType["LISTING"] = "listing";
|
|
49
|
+
AssetEventType["ORDER"] = "order";
|
|
50
|
+
AssetEventType["OFFER"] = "offer";
|
|
51
|
+
AssetEventType["TRAIT_OFFER"] = "trait_offer";
|
|
52
|
+
AssetEventType["COLLECTION_OFFER"] = "collection_offer";
|
|
53
|
+
})(AssetEventType || (exports.AssetEventType = AssetEventType = {}));
|
|
54
|
+
/**
|
|
55
|
+
* Order type for order events.
|
|
56
|
+
* @category API Models
|
|
57
|
+
*/
|
|
58
|
+
var OrderEventType;
|
|
59
|
+
(function (OrderEventType) {
|
|
60
|
+
OrderEventType["LISTING"] = "listing";
|
|
61
|
+
OrderEventType["ITEM_OFFER"] = "item_offer";
|
|
62
|
+
OrderEventType["COLLECTION_OFFER"] = "collection_offer";
|
|
63
|
+
OrderEventType["TRAIT_OFFER"] = "trait_offer";
|
|
64
|
+
})(OrderEventType || (exports.OrderEventType = OrderEventType = {}));
|
|
65
|
+
//# sourceMappingURL=types.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"types.js","sourceRoot":"","sources":["../../../src/api/types.ts"],"names":[],"mappings":";;;AAmHA,IAAY,uBAOX;AAPD,WAAY,uBAAuB;IACjC,wDAA6B,CAAA;IAC7B,4DAAiC,CAAA;IACjC,gEAAqC,CAAA;IACrC,gEAAqC,CAAA;IACrC,oDAAyB,CAAA;IACzB,oDAAyB,CAAA;AAC3B,CAAC,EAPW,uBAAuB,uCAAvB,uBAAuB,QAOlC;AAED;;;GAGG;AACH,IAAY,WAMX;AAND,WAAY,WAAW;IACrB,gCAAiB,CAAA;IACjB,oCAAqB,CAAA;IACrB,sCAAuB,CAAA;IACvB,kCAAmB,CAAA;IACnB,sCAAuB,CAAA;AACzB,CAAC,EANW,WAAW,2BAAX,WAAW,QAMtB;AA4ND;;;GAGG;AACH,IAAY,gBAQX;AARD,WAAY,gBAAgB;IAC1B,qCAAiB,CAAA;IACjB,yDAAqC,CAAA;IACrC,iDAA6B,CAAA;IAC7B,qCAAiB,CAAA;IACjB,iCAAa,CAAA;IACb,uCAAuC;IACvC,iCAAa,CAAA;AACf,CAAC,EARW,gBAAgB,gCAAhB,gBAAgB,QAQ3B;AAED;;;GAGG;AACH,IAAY,cASX;AATD,WAAY,cAAc;IACxB,+BAAa,CAAA;IACb,uCAAqB,CAAA;IACrB,+BAAa,CAAA;IACb,qCAAmB,CAAA;IACnB,iCAAe,CAAA;IACf,iCAAe,CAAA;IACf,6CAA2B,CAAA;IAC3B,uDAAqC,CAAA;AACvC,CAAC,EATW,cAAc,8BAAd,cAAc,QASzB;AAED;;;GAGG;AACH,IAAY,cAKX;AALD,WAAY,cAAc;IACxB,qCAAmB,CAAA;IACnB,2CAAyB,CAAA;IACzB,uDAAqC,CAAA;IACrC,6CAA2B,CAAA;AAC7B,CAAC,EALW,cAAc,8BAAd,cAAc,QAKzB"}
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import { FixedNumber } from "ethers";
|
|
2
|
+
export declare const FIXED_NUMBER_100: FixedNumber;
|
|
3
|
+
export declare const INVERSE_BASIS_POINT = 10000n;
|
|
4
|
+
export declare const API_BASE_MAINNET = "https://api.opensea.io";
|
|
5
|
+
export declare const OPENSEA_FEE_RECIPIENT = "0x0000a26b00c1f0df003000390027140000faa719";
|
|
6
|
+
export declare const OPENSEA_CONDUIT_KEY = "0x0000007b02230091a7ed01230072f7006a004d60a8d4e71d599b8104250f0000";
|
|
7
|
+
export declare const OPENSEA_CONDUIT_ADDRESS = "0x1e0049783f008a0085193e00003d00cd54003c71";
|
|
8
|
+
export declare const OPENSEA_CONDUIT_KEY_2 = "0x61159fefdfada89302ed55f8b9e89e2d67d8258712b3a3f89aa88525877f1d5e";
|
|
9
|
+
export declare const OPENSEA_CONDUIT_ADDRESS_2 = "0x963f00d3ff000064ffcba824b800c0000000c300";
|
|
10
|
+
export declare const OPENSEA_SIGNED_ZONE_V2 = "0x000056f7000000ece9003ca63978907a00ffd100";
|
|
11
|
+
export declare const ALTERNATE_CONDUIT_ADDRESS = "0x00000000001566479594a2e05532d81afa09bc52";
|
|
12
|
+
export declare const ALTERNATE_CONDUIT_KEY = "0x86d26897267711ea4b173c8c124a0a73612001da35562f1ee3b26929b6575e89";
|
|
13
|
+
export declare const ALTERNATE_SEAPORT_V1_6_ADDRESS = "0x00000000006687982678b03100B9bDC8be440814";
|
|
14
|
+
export declare const ALTERNATE_SIGNED_ZONE_V2_ADDRESS = "0xdfe0000000005ce3008800300037e4c803ed08c7";
|
|
15
|
+
export declare const GUNZILLA_FEE_RECIPIENT = "0xd9f68d28e451a83affdb7c71cc2c20552555b07f";
|
|
16
|
+
export declare const SOMNIA_FEE_RECIPIENT = "0xdfe1593dca6ad8a20eeb418643e48577c1626f7c";
|
|
17
|
+
export declare const ALTERNATE_FEE_RECIPIENT = "0x07d3a100c3880830dd43fe5c938b5144721ce9d6";
|
|
18
|
+
export declare const WPOL_ADDRESS = "0x0d500B1d8E8eF31E21C99d1Db9A6444d3ADf1270";
|
|
19
|
+
export declare const MULTICALL3_ADDRESS = "0xcA11bde05977b3631167028862bE2a173976CA11";
|
|
20
|
+
export declare const TRANSFER_HELPER_ADDRESS = "0x0000000000c2d145a2526bd8c716263bfebe1a72";
|
|
21
|
+
export declare const SHARED_STOREFRONT_ADDRESSES: Set<string>;
|
|
22
|
+
export declare const SHARED_STOREFRONT_LAZY_MINT_ADAPTER_CROSS_CHAIN_ADDRESS = "0xa604060890923ff400e8c6f5290461a83aedacec";
|
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.SHARED_STOREFRONT_LAZY_MINT_ADAPTER_CROSS_CHAIN_ADDRESS = exports.SHARED_STOREFRONT_ADDRESSES = exports.TRANSFER_HELPER_ADDRESS = exports.MULTICALL3_ADDRESS = exports.WPOL_ADDRESS = exports.ALTERNATE_FEE_RECIPIENT = exports.SOMNIA_FEE_RECIPIENT = exports.GUNZILLA_FEE_RECIPIENT = exports.ALTERNATE_SIGNED_ZONE_V2_ADDRESS = exports.ALTERNATE_SEAPORT_V1_6_ADDRESS = exports.ALTERNATE_CONDUIT_KEY = exports.ALTERNATE_CONDUIT_ADDRESS = exports.OPENSEA_SIGNED_ZONE_V2 = exports.OPENSEA_CONDUIT_ADDRESS_2 = exports.OPENSEA_CONDUIT_KEY_2 = exports.OPENSEA_CONDUIT_ADDRESS = exports.OPENSEA_CONDUIT_KEY = exports.OPENSEA_FEE_RECIPIENT = exports.API_BASE_MAINNET = exports.INVERSE_BASIS_POINT = exports.FIXED_NUMBER_100 = void 0;
|
|
4
|
+
const ethers_1 = require("ethers");
|
|
5
|
+
// =============================================================================
|
|
6
|
+
// Math & Calculation Constants
|
|
7
|
+
// =============================================================================
|
|
8
|
+
exports.FIXED_NUMBER_100 = ethers_1.FixedNumber.fromValue(100);
|
|
9
|
+
exports.INVERSE_BASIS_POINT = 10000n; // 100 basis points per 1%
|
|
10
|
+
// =============================================================================
|
|
11
|
+
// API Configuration
|
|
12
|
+
// =============================================================================
|
|
13
|
+
exports.API_BASE_MAINNET = "https://api.opensea.io";
|
|
14
|
+
// =============================================================================
|
|
15
|
+
// OpenSea Protocol Addresses
|
|
16
|
+
// =============================================================================
|
|
17
|
+
exports.OPENSEA_FEE_RECIPIENT = "0x0000a26b00c1f0df003000390027140000faa719";
|
|
18
|
+
exports.OPENSEA_CONDUIT_KEY = "0x0000007b02230091a7ed01230072f7006a004d60a8d4e71d599b8104250f0000";
|
|
19
|
+
exports.OPENSEA_CONDUIT_ADDRESS = "0x1e0049783f008a0085193e00003d00cd54003c71";
|
|
20
|
+
exports.OPENSEA_CONDUIT_KEY_2 = "0x61159fefdfada89302ed55f8b9e89e2d67d8258712b3a3f89aa88525877f1d5e";
|
|
21
|
+
exports.OPENSEA_CONDUIT_ADDRESS_2 = "0x963f00d3ff000064ffcba824b800c0000000c300";
|
|
22
|
+
exports.OPENSEA_SIGNED_ZONE_V2 = "0x000056f7000000ece9003ca63978907a00ffd100";
|
|
23
|
+
// =============================================================================
|
|
24
|
+
// Alternate Protocol Constants (shared by Gunzilla, Somnia, etc.)
|
|
25
|
+
// =============================================================================
|
|
26
|
+
exports.ALTERNATE_CONDUIT_ADDRESS = "0x00000000001566479594a2e05532d81afa09bc52";
|
|
27
|
+
exports.ALTERNATE_CONDUIT_KEY = "0x86d26897267711ea4b173c8c124a0a73612001da35562f1ee3b26929b6575e89";
|
|
28
|
+
exports.ALTERNATE_SEAPORT_V1_6_ADDRESS = "0x00000000006687982678b03100B9bDC8be440814";
|
|
29
|
+
exports.ALTERNATE_SIGNED_ZONE_V2_ADDRESS = "0xdfe0000000005ce3008800300037e4c803ed08c7";
|
|
30
|
+
// =============================================================================
|
|
31
|
+
// Chain-Specific Fee Recipients
|
|
32
|
+
// =============================================================================
|
|
33
|
+
exports.GUNZILLA_FEE_RECIPIENT = "0xd9f68d28e451a83affdb7c71cc2c20552555b07f";
|
|
34
|
+
exports.SOMNIA_FEE_RECIPIENT = "0xdfe1593dca6ad8a20eeb418643e48577c1626f7c";
|
|
35
|
+
exports.ALTERNATE_FEE_RECIPIENT = "0x07d3a100c3880830dd43fe5c938b5144721ce9d6";
|
|
36
|
+
// =============================================================================
|
|
37
|
+
// Token & Helper Addresses
|
|
38
|
+
// =============================================================================
|
|
39
|
+
exports.WPOL_ADDRESS = "0x0d500B1d8E8eF31E21C99d1Db9A6444d3ADf1270";
|
|
40
|
+
exports.MULTICALL3_ADDRESS = "0xcA11bde05977b3631167028862bE2a173976CA11";
|
|
41
|
+
exports.TRANSFER_HELPER_ADDRESS = "0x0000000000c2d145a2526bd8c716263bfebe1a72";
|
|
42
|
+
// =============================================================================
|
|
43
|
+
// Shared Storefront Addresses
|
|
44
|
+
// =============================================================================
|
|
45
|
+
const SHARED_STOREFRONT_ADDRESS_MAINNET = "0x495f947276749ce646f68ac8c248420045cb7b5e";
|
|
46
|
+
const SHARED_STOREFRONT_ADDRESS_POLYGON = "0x2953399124f0cbb46d2cbacd8a89cf0599974963";
|
|
47
|
+
exports.SHARED_STOREFRONT_ADDRESSES = new Set([
|
|
48
|
+
SHARED_STOREFRONT_ADDRESS_MAINNET,
|
|
49
|
+
SHARED_STOREFRONT_ADDRESS_POLYGON,
|
|
50
|
+
]);
|
|
51
|
+
exports.SHARED_STOREFRONT_LAZY_MINT_ADAPTER_CROSS_CHAIN_ADDRESS = "0xa604060890923ff400e8c6f5290461a83aedacec";
|
|
52
|
+
//# sourceMappingURL=constants.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"constants.js","sourceRoot":"","sources":["../../src/constants.ts"],"names":[],"mappings":";;;AAAA,mCAAoC;AAEpC,gFAAgF;AAChF,+BAA+B;AAC/B,gFAAgF;AAEnE,QAAA,gBAAgB,GAAG,oBAAW,CAAC,SAAS,CAAC,GAAG,CAAC,CAAA;AAC7C,QAAA,mBAAmB,GAAG,MAAO,CAAA,CAAC,0BAA0B;AAErE,gFAAgF;AAChF,oBAAoB;AACpB,gFAAgF;AAEnE,QAAA,gBAAgB,GAAG,wBAAwB,CAAA;AAExD,gFAAgF;AAChF,6BAA6B;AAC7B,gFAAgF;AAEnE,QAAA,qBAAqB,GAChC,4CAA4C,CAAA;AAEjC,QAAA,mBAAmB,GAC9B,oEAAoE,CAAA;AAEzD,QAAA,uBAAuB,GAClC,4CAA4C,CAAA;AAEjC,QAAA,qBAAqB,GAChC,oEAAoE,CAAA;AAEzD,QAAA,yBAAyB,GACpC,4CAA4C,CAAA;AAEjC,QAAA,sBAAsB,GACjC,4CAA4C,CAAA;AAE9C,gFAAgF;AAChF,kEAAkE;AAClE,gFAAgF;AAEnE,QAAA,yBAAyB,GACpC,4CAA4C,CAAA;AAEjC,QAAA,qBAAqB,GAChC,oEAAoE,CAAA;AAEzD,QAAA,8BAA8B,GACzC,4CAA4C,CAAA;AAEjC,QAAA,gCAAgC,GAC3C,4CAA4C,CAAA;AAE9C,gFAAgF;AAChF,gCAAgC;AAChC,gFAAgF;AAEnE,QAAA,sBAAsB,GACjC,4CAA4C,CAAA;AAEjC,QAAA,oBAAoB,GAAG,4CAA4C,CAAA;AAEnE,QAAA,uBAAuB,GAClC,4CAA4C,CAAA;AAE9C,gFAAgF;AAChF,2BAA2B;AAC3B,gFAAgF;AAEnE,QAAA,YAAY,GAAG,4CAA4C,CAAA;AAE3D,QAAA,kBAAkB,GAAG,4CAA4C,CAAA;AAEjE,QAAA,uBAAuB,GAClC,4CAA4C,CAAA;AAE9C,gFAAgF;AAChF,8BAA8B;AAC9B,gFAAgF;AAEhF,MAAM,iCAAiC,GACrC,4CAA4C,CAAA;AAC9C,MAAM,iCAAiC,GACrC,4CAA4C,CAAA;AACjC,QAAA,2BAA2B,GAAG,IAAI,GAAG,CAAC;IACjD,iCAAiC;IACjC,iCAAiC;CAClC,CAAC,CAAA;AACW,QAAA,uDAAuD,GAClE,4CAA4C,CAAA"}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import { OpenSeaSDK } from "./sdk";
|
|
2
|
+
export * from "./api/types";
|
|
3
|
+
export * from "./orders/types";
|
|
4
|
+
export * from "./types";
|
|
5
|
+
export * from "./utils";
|
|
6
|
+
/**
|
|
7
|
+
* @example
|
|
8
|
+
* // Example Setup
|
|
9
|
+
* ```ts
|
|
10
|
+
* import { ethers } from 'ethers'
|
|
11
|
+
* import { OpenSeaSDK, Chain } from 'opensea-js'
|
|
12
|
+
* const provider = new ethers.JsonRpcProvider('https://mainnet.infura.io')
|
|
13
|
+
* const client = new OpenSeaSDK(provider, {
|
|
14
|
+
* chain: Chain.Mainnet
|
|
15
|
+
* })
|
|
16
|
+
* ```
|
|
17
|
+
*/
|
|
18
|
+
export { OpenSeaSDK, };
|
package/lib/src/index.js
ADDED
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
9
|
+
}) : (function(o, m, k, k2) {
|
|
10
|
+
if (k2 === undefined) k2 = k;
|
|
11
|
+
o[k2] = m[k];
|
|
12
|
+
}));
|
|
13
|
+
var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
14
|
+
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
15
|
+
};
|
|
16
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
|
+
exports.OpenSeaSDK = void 0;
|
|
18
|
+
const sdk_1 = require("./sdk");
|
|
19
|
+
Object.defineProperty(exports, "OpenSeaSDK", { enumerable: true, get: function () { return sdk_1.OpenSeaSDK; } });
|
|
20
|
+
__exportStar(require("./api/types"), exports);
|
|
21
|
+
__exportStar(require("./orders/types"), exports);
|
|
22
|
+
__exportStar(require("./types"), exports);
|
|
23
|
+
__exportStar(require("./utils"), exports);
|
|
24
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;AAAA,+BAAkC;AAoBhC,2FApBO,gBAAU,OAoBP;AAlBZ,8CAA2B;AAC3B,iDAA8B;AAC9B,0CAAuB;AACvB,0CAAuB"}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import type { ConsiderationInputItem, CreateInputItem, MatchOrdersFulfillment, Order, OrderWithCounter } from "@opensea/seaport-js/lib/types";
|
|
2
|
+
/**
|
|
3
|
+
* Compute the native currency (ETH) value required to fulfill a private listing.
|
|
4
|
+
* Sums all native currency consideration items not going to the taker.
|
|
5
|
+
* @param order The private listing order
|
|
6
|
+
* @param takerAddress The address of the private listing recipient
|
|
7
|
+
* @returns The total native currency value as a bigint
|
|
8
|
+
*/
|
|
9
|
+
export declare const computePrivateListingValue: (order: OrderWithCounter, takerAddress: string) => bigint;
|
|
10
|
+
export declare const getPrivateListingConsiderations: (offer: CreateInputItem[], privateSaleRecipient: string) => ConsiderationInputItem[];
|
|
11
|
+
export declare const constructPrivateListingCounterOrder: (order: OrderWithCounter, privateSaleRecipient: string) => Order;
|
|
12
|
+
export declare const getPrivateListingFulfillments: (privateListingOrder: OrderWithCounter) => MatchOrdersFulfillment[];
|
|
@@ -0,0 +1,130 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.getPrivateListingFulfillments = exports.constructPrivateListingCounterOrder = exports.getPrivateListingConsiderations = exports.computePrivateListingValue = void 0;
|
|
4
|
+
const constants_1 = require("@opensea/seaport-js/lib/constants");
|
|
5
|
+
const item_1 = require("@opensea/seaport-js/lib/utils/item");
|
|
6
|
+
const order_1 = require("@opensea/seaport-js/lib/utils/order");
|
|
7
|
+
const ethers_1 = require("ethers");
|
|
8
|
+
/**
|
|
9
|
+
* Compute the native currency (ETH) value required to fulfill a private listing.
|
|
10
|
+
* Sums all native currency consideration items not going to the taker.
|
|
11
|
+
* @param order The private listing order
|
|
12
|
+
* @param takerAddress The address of the private listing recipient
|
|
13
|
+
* @returns The total native currency value as a bigint
|
|
14
|
+
*/
|
|
15
|
+
const computePrivateListingValue = (order, takerAddress) => {
|
|
16
|
+
return order.parameters.consideration
|
|
17
|
+
.filter(item => item.recipient.toLowerCase() !== takerAddress.toLowerCase() &&
|
|
18
|
+
item.token.toLowerCase() === ethers_1.ZeroAddress.toLowerCase() &&
|
|
19
|
+
item.itemType === constants_1.ItemType.NATIVE)
|
|
20
|
+
.reduce((sum, item) => sum + BigInt(item.startAmount), 0n);
|
|
21
|
+
};
|
|
22
|
+
exports.computePrivateListingValue = computePrivateListingValue;
|
|
23
|
+
const getPrivateListingConsiderations = (offer, privateSaleRecipient) => {
|
|
24
|
+
return offer.map(item => {
|
|
25
|
+
return { ...item, recipient: privateSaleRecipient };
|
|
26
|
+
});
|
|
27
|
+
};
|
|
28
|
+
exports.getPrivateListingConsiderations = getPrivateListingConsiderations;
|
|
29
|
+
const constructPrivateListingCounterOrder = (order, privateSaleRecipient) => {
|
|
30
|
+
// Counter order offers up all the items in the private listing consideration
|
|
31
|
+
// besides the items that are going to the private listing recipient
|
|
32
|
+
const paymentItems = order.parameters.consideration.filter(item => item.recipient.toLowerCase() !== privateSaleRecipient.toLowerCase());
|
|
33
|
+
// Only validate payment items if there are any (zero-payment private listings are valid)
|
|
34
|
+
if (paymentItems.length > 0) {
|
|
35
|
+
if (!paymentItems.every(item => (0, item_1.isCurrencyItem)(item))) {
|
|
36
|
+
throw new Error("The consideration for the private listing did not contain only currency items");
|
|
37
|
+
}
|
|
38
|
+
if (!paymentItems.every(item => item.itemType === paymentItems[0].itemType)) {
|
|
39
|
+
throw new Error("Not all currency items were the same for private order");
|
|
40
|
+
}
|
|
41
|
+
}
|
|
42
|
+
const { aggregatedStartAmount, aggregatedEndAmount } = paymentItems.reduce(({ aggregatedStartAmount, aggregatedEndAmount }, item) => ({
|
|
43
|
+
aggregatedStartAmount: aggregatedStartAmount + BigInt(item.startAmount),
|
|
44
|
+
aggregatedEndAmount: aggregatedEndAmount + BigInt(item.endAmount),
|
|
45
|
+
}), {
|
|
46
|
+
aggregatedStartAmount: 0n,
|
|
47
|
+
aggregatedEndAmount: 0n,
|
|
48
|
+
});
|
|
49
|
+
const counterOrder = {
|
|
50
|
+
parameters: {
|
|
51
|
+
...order.parameters,
|
|
52
|
+
offerer: privateSaleRecipient,
|
|
53
|
+
// Empty offer for zero-payment private listings, single aggregated item otherwise
|
|
54
|
+
offer: paymentItems.length > 0
|
|
55
|
+
? [
|
|
56
|
+
{
|
|
57
|
+
itemType: paymentItems[0].itemType,
|
|
58
|
+
token: paymentItems[0].token,
|
|
59
|
+
identifierOrCriteria: paymentItems[0].identifierOrCriteria,
|
|
60
|
+
startAmount: aggregatedStartAmount.toString(),
|
|
61
|
+
endAmount: aggregatedEndAmount.toString(),
|
|
62
|
+
},
|
|
63
|
+
]
|
|
64
|
+
: [],
|
|
65
|
+
// The consideration here is empty as the original private listing order supplies
|
|
66
|
+
// the taker address to receive the desired items.
|
|
67
|
+
consideration: [],
|
|
68
|
+
salt: (0, order_1.generateRandomSalt)(),
|
|
69
|
+
totalOriginalConsiderationItems: 0,
|
|
70
|
+
},
|
|
71
|
+
signature: "0x",
|
|
72
|
+
};
|
|
73
|
+
return counterOrder;
|
|
74
|
+
};
|
|
75
|
+
exports.constructPrivateListingCounterOrder = constructPrivateListingCounterOrder;
|
|
76
|
+
const getPrivateListingFulfillments = (privateListingOrder) => {
|
|
77
|
+
const nftRelatedFulfillments = [];
|
|
78
|
+
// For the original order, we need to match everything offered with every consideration item
|
|
79
|
+
// on the original order that's set to go to the private listing recipient
|
|
80
|
+
privateListingOrder.parameters.offer.forEach((offerItem, offerIndex) => {
|
|
81
|
+
const considerationIndex = privateListingOrder.parameters.consideration.findIndex(considerationItem => considerationItem.itemType === offerItem.itemType &&
|
|
82
|
+
considerationItem.token === offerItem.token &&
|
|
83
|
+
considerationItem.identifierOrCriteria ===
|
|
84
|
+
offerItem.identifierOrCriteria);
|
|
85
|
+
if (considerationIndex === -1) {
|
|
86
|
+
throw new Error("Could not find matching offer item in the consideration for private listing");
|
|
87
|
+
}
|
|
88
|
+
nftRelatedFulfillments.push({
|
|
89
|
+
offerComponents: [
|
|
90
|
+
{
|
|
91
|
+
orderIndex: 0,
|
|
92
|
+
itemIndex: offerIndex,
|
|
93
|
+
},
|
|
94
|
+
],
|
|
95
|
+
considerationComponents: [
|
|
96
|
+
{
|
|
97
|
+
orderIndex: 0,
|
|
98
|
+
itemIndex: considerationIndex,
|
|
99
|
+
},
|
|
100
|
+
],
|
|
101
|
+
});
|
|
102
|
+
});
|
|
103
|
+
const currencyRelatedFulfillments = [];
|
|
104
|
+
// For the original order, we need to match everything offered with every consideration item
|
|
105
|
+
// on the original order that's set to go to the private listing recipient
|
|
106
|
+
privateListingOrder.parameters.consideration.forEach((considerationItem, considerationIndex) => {
|
|
107
|
+
if (!(0, item_1.isCurrencyItem)(considerationItem)) {
|
|
108
|
+
return;
|
|
109
|
+
}
|
|
110
|
+
// We always match the offer item (index 0) of the counter order (index 1)
|
|
111
|
+
// with all of the payment items on the private listing
|
|
112
|
+
currencyRelatedFulfillments.push({
|
|
113
|
+
offerComponents: [
|
|
114
|
+
{
|
|
115
|
+
orderIndex: 1,
|
|
116
|
+
itemIndex: 0,
|
|
117
|
+
},
|
|
118
|
+
],
|
|
119
|
+
considerationComponents: [
|
|
120
|
+
{
|
|
121
|
+
orderIndex: 0,
|
|
122
|
+
itemIndex: considerationIndex,
|
|
123
|
+
},
|
|
124
|
+
],
|
|
125
|
+
});
|
|
126
|
+
});
|
|
127
|
+
return [...nftRelatedFulfillments, ...currencyRelatedFulfillments];
|
|
128
|
+
};
|
|
129
|
+
exports.getPrivateListingFulfillments = getPrivateListingFulfillments;
|
|
130
|
+
//# sourceMappingURL=privateListings.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"privateListings.js","sourceRoot":"","sources":["../../../src/orders/privateListings.ts"],"names":[],"mappings":";;;AAAA,iEAA4D;AAQ5D,6DAAmE;AACnE,+DAAwE;AACxE,mCAAoC;AAEpC;;;;;;GAMG;AACI,MAAM,0BAA0B,GAAG,CACxC,KAAuB,EACvB,YAAoB,EACZ,EAAE;IACV,OAAO,KAAK,CAAC,UAAU,CAAC,aAAa;SAClC,MAAM,CACL,IAAI,CAAC,EAAE,CACL,IAAI,CAAC,SAAS,CAAC,WAAW,EAAE,KAAK,YAAY,CAAC,WAAW,EAAE;QAC3D,IAAI,CAAC,KAAK,CAAC,WAAW,EAAE,KAAK,oBAAW,CAAC,WAAW,EAAE;QACtD,IAAI,CAAC,QAAQ,KAAK,oBAAQ,CAAC,MAAM,CACpC;SACA,MAAM,CAAC,CAAC,GAAG,EAAE,IAAI,EAAE,EAAE,CAAC,GAAG,GAAG,MAAM,CAAC,IAAI,CAAC,WAAW,CAAC,EAAE,EAAE,CAAC,CAAA;AAC9D,CAAC,CAAA;AAZY,QAAA,0BAA0B,8BAYtC;AAEM,MAAM,+BAA+B,GAAG,CAC7C,KAAwB,EACxB,oBAA4B,EACF,EAAE;IAC5B,OAAO,KAAK,CAAC,GAAG,CAAC,IAAI,CAAC,EAAE;QACtB,OAAO,EAAE,GAAG,IAAI,EAAE,SAAS,EAAE,oBAAoB,EAAE,CAAA;IACrD,CAAC,CAAC,CAAA;AACJ,CAAC,CAAA;AAPY,QAAA,+BAA+B,mCAO3C;AAEM,MAAM,mCAAmC,GAAG,CACjD,KAAuB,EACvB,oBAA4B,EACrB,EAAE;IACT,6EAA6E;IAC7E,oEAAoE;IACpE,MAAM,YAAY,GAAG,KAAK,CAAC,UAAU,CAAC,aAAa,CAAC,MAAM,CACxD,IAAI,CAAC,EAAE,CAAC,IAAI,CAAC,SAAS,CAAC,WAAW,EAAE,KAAK,oBAAoB,CAAC,WAAW,EAAE,CAC5E,CAAA;IAED,yFAAyF;IACzF,IAAI,YAAY,CAAC,MAAM,GAAG,CAAC,EAAE,CAAC;QAC5B,IAAI,CAAC,YAAY,CAAC,KAAK,CAAC,IAAI,CAAC,EAAE,CAAC,IAAA,qBAAc,EAAC,IAAI,CAAC,CAAC,EAAE,CAAC;YACtD,MAAM,IAAI,KAAK,CACb,+EAA+E,CAChF,CAAA;QACH,CAAC;QACD,IACE,CAAC,YAAY,CAAC,KAAK,CAAC,IAAI,CAAC,EAAE,CAAC,IAAI,CAAC,QAAQ,KAAK,YAAY,CAAC,CAAC,CAAC,CAAC,QAAQ,CAAC,EACvE,CAAC;YACD,MAAM,IAAI,KAAK,CAAC,wDAAwD,CAAC,CAAA;QAC3E,CAAC;IACH,CAAC;IAED,MAAM,EAAE,qBAAqB,EAAE,mBAAmB,EAAE,GAAG,YAAY,CAAC,MAAM,CACxE,CAAC,EAAE,qBAAqB,EAAE,mBAAmB,EAAE,EAAE,IAAI,EAAE,EAAE,CAAC,CAAC;QACzD,qBAAqB,EAAE,qBAAqB,GAAG,MAAM,CAAC,IAAI,CAAC,WAAW,CAAC;QACvE,mBAAmB,EAAE,mBAAmB,GAAG,MAAM,CAAC,IAAI,CAAC,SAAS,CAAC;KAClE,CAAC,EACF;QACE,qBAAqB,EAAE,EAAE;QACzB,mBAAmB,EAAE,EAAE;KACxB,CACF,CAAA;IAED,MAAM,YAAY,GAAU;QAC1B,UAAU,EAAE;YACV,GAAG,KAAK,CAAC,UAAU;YACnB,OAAO,EAAE,oBAAoB;YAC7B,kFAAkF;YAClF,KAAK,EACH,YAAY,CAAC,MAAM,GAAG,CAAC;gBACrB,CAAC,CAAC;oBACE;wBACE,QAAQ,EAAE,YAAY,CAAC,CAAC,CAAC,CAAC,QAAQ;wBAClC,KAAK,EAAE,YAAY,CAAC,CAAC,CAAC,CAAC,KAAK;wBAC5B,oBAAoB,EAAE,YAAY,CAAC,CAAC,CAAC,CAAC,oBAAoB;wBAC1D,WAAW,EAAE,qBAAqB,CAAC,QAAQ,EAAE;wBAC7C,SAAS,EAAE,mBAAmB,CAAC,QAAQ,EAAE;qBAC1C;iBACF;gBACH,CAAC,CAAC,EAAE;YACR,iFAAiF;YACjF,kDAAkD;YAClD,aAAa,EAAE,EAAE;YACjB,IAAI,EAAE,IAAA,0BAAkB,GAAE;YAC1B,+BAA+B,EAAE,CAAC;SACnC;QACD,SAAS,EAAE,IAAI;KAChB,CAAA;IAED,OAAO,YAAY,CAAA;AACrB,CAAC,CAAA;AA9DY,QAAA,mCAAmC,uCA8D/C;AAEM,MAAM,6BAA6B,GAAG,CAC3C,mBAAqC,EACX,EAAE;IAC5B,MAAM,sBAAsB,GAA6B,EAAE,CAAA;IAE3D,4FAA4F;IAC5F,0EAA0E;IAC1E,mBAAmB,CAAC,UAAU,CAAC,KAAK,CAAC,OAAO,CAAC,CAAC,SAAS,EAAE,UAAU,EAAE,EAAE;QACrE,MAAM,kBAAkB,GACtB,mBAAmB,CAAC,UAAU,CAAC,aAAa,CAAC,SAAS,CACpD,iBAAiB,CAAC,EAAE,CAClB,iBAAiB,CAAC,QAAQ,KAAK,SAAS,CAAC,QAAQ;YACjD,iBAAiB,CAAC,KAAK,KAAK,SAAS,CAAC,KAAK;YAC3C,iBAAiB,CAAC,oBAAoB;gBACpC,SAAS,CAAC,oBAAoB,CACnC,CAAA;QACH,IAAI,kBAAkB,KAAK,CAAC,CAAC,EAAE,CAAC;YAC9B,MAAM,IAAI,KAAK,CACb,6EAA6E,CAC9E,CAAA;QACH,CAAC;QACD,sBAAsB,CAAC,IAAI,CAAC;YAC1B,eAAe,EAAE;gBACf;oBACE,UAAU,EAAE,CAAC;oBACb,SAAS,EAAE,UAAU;iBACtB;aACF;YACD,uBAAuB,EAAE;gBACvB;oBACE,UAAU,EAAE,CAAC;oBACb,SAAS,EAAE,kBAAkB;iBAC9B;aACF;SACF,CAAC,CAAA;IACJ,CAAC,CAAC,CAAA;IAEF,MAAM,2BAA2B,GAA6B,EAAE,CAAA;IAEhE,4FAA4F;IAC5F,0EAA0E;IAC1E,mBAAmB,CAAC,UAAU,CAAC,aAAa,CAAC,OAAO,CAClD,CAAC,iBAAiB,EAAE,kBAAkB,EAAE,EAAE;QACxC,IAAI,CAAC,IAAA,qBAAc,EAAC,iBAAiB,CAAC,EAAE,CAAC;YACvC,OAAM;QACR,CAAC;QACD,0EAA0E;QAC1E,uDAAuD;QACvD,2BAA2B,CAAC,IAAI,CAAC;YAC/B,eAAe,EAAE;gBACf;oBACE,UAAU,EAAE,CAAC;oBACb,SAAS,EAAE,CAAC;iBACb;aACF;YACD,uBAAuB,EAAE;gBACvB;oBACE,UAAU,EAAE,CAAC;oBACb,SAAS,EAAE,kBAAkB;iBAC9B;aACF;SACF,CAAC,CAAA;IACJ,CAAC,CACF,CAAA;IAED,OAAO,CAAC,GAAG,sBAAsB,EAAE,GAAG,2BAA2B,CAAC,CAAA;AACpE,CAAC,CAAA;AAlEY,QAAA,6BAA6B,iCAkEzC"}
|
|
@@ -0,0 +1,160 @@
|
|
|
1
|
+
import type { BasicOrderParametersStruct } from "@opensea/seaport-js/lib/typechain-types/seaport/contracts/Seaport";
|
|
2
|
+
import type { AdvancedOrder, OrderWithCounter } from "@opensea/seaport-js/lib/types";
|
|
3
|
+
import type { Listing, Offer } from "../api/types";
|
|
4
|
+
import type { OpenSeaAccount, OrderSide } from "../types";
|
|
5
|
+
type OrderProtocolToProtocolData = {
|
|
6
|
+
seaport: OrderWithCounter;
|
|
7
|
+
};
|
|
8
|
+
export type OrderProtocol = keyof OrderProtocolToProtocolData;
|
|
9
|
+
export type ProtocolData = OrderProtocolToProtocolData[keyof OrderProtocolToProtocolData];
|
|
10
|
+
export declare enum OrderType {
|
|
11
|
+
BASIC = "basic",
|
|
12
|
+
ENGLISH = "english",
|
|
13
|
+
CRITERIA = "criteria"
|
|
14
|
+
}
|
|
15
|
+
type OrderFee = {
|
|
16
|
+
account: OpenSeaAccount;
|
|
17
|
+
basisPoints: string;
|
|
18
|
+
};
|
|
19
|
+
/**
|
|
20
|
+
* The latest OpenSea Order schema.
|
|
21
|
+
*/
|
|
22
|
+
export type OrderV2 = {
|
|
23
|
+
/** The date the order was created. */
|
|
24
|
+
createdDate: string;
|
|
25
|
+
/** The date the order was closed. */
|
|
26
|
+
closingDate: string | null;
|
|
27
|
+
/** The date the order was listed. Order can be created before the listing time. */
|
|
28
|
+
listingTime: number;
|
|
29
|
+
/** The date the order expires. */
|
|
30
|
+
expirationTime: number;
|
|
31
|
+
/** The hash of the order. */
|
|
32
|
+
orderHash: string | null;
|
|
33
|
+
/** The account that created the order. */
|
|
34
|
+
maker: OpenSeaAccount;
|
|
35
|
+
/** The account that filled the order. */
|
|
36
|
+
taker: OpenSeaAccount | null;
|
|
37
|
+
/** The protocol data for the order. Only 'seaport' is currently supported. */
|
|
38
|
+
protocolData: ProtocolData;
|
|
39
|
+
/** The contract address of the protocol. */
|
|
40
|
+
protocolAddress: string;
|
|
41
|
+
/** The current price of the order. */
|
|
42
|
+
currentPrice: bigint;
|
|
43
|
+
/** The maker fees for the order. */
|
|
44
|
+
makerFees: OrderFee[];
|
|
45
|
+
/** The taker fees for the order. */
|
|
46
|
+
takerFees: OrderFee[];
|
|
47
|
+
/** The side of the order. Listing/Offer */
|
|
48
|
+
side: OrderSide;
|
|
49
|
+
/** The type of the order. Basic/English/Criteria */
|
|
50
|
+
orderType: OrderType;
|
|
51
|
+
/** Whether or not the maker has cancelled the order. */
|
|
52
|
+
cancelled: boolean;
|
|
53
|
+
/** Whether or not the order is finalized. */
|
|
54
|
+
finalized: boolean;
|
|
55
|
+
/** Whether or not the order is marked invalid and therefore not fillable. */
|
|
56
|
+
markedInvalid: boolean;
|
|
57
|
+
/** The signature the order is signed with. */
|
|
58
|
+
clientSignature: string | null;
|
|
59
|
+
/** Amount of items left in the order which can be taken. */
|
|
60
|
+
remainingQuantity: number;
|
|
61
|
+
};
|
|
62
|
+
export type FulfillmentDataResponse = {
|
|
63
|
+
protocol: string;
|
|
64
|
+
fulfillment_data: FulfillmentData;
|
|
65
|
+
};
|
|
66
|
+
type FulfillmentData = {
|
|
67
|
+
transaction: Transaction;
|
|
68
|
+
orders: ProtocolData[];
|
|
69
|
+
};
|
|
70
|
+
type Transaction = {
|
|
71
|
+
function: string;
|
|
72
|
+
chain: number;
|
|
73
|
+
to: string;
|
|
74
|
+
value: string;
|
|
75
|
+
input_data: {
|
|
76
|
+
advancedOrder: AdvancedOrder;
|
|
77
|
+
criteriaResolvers?: unknown[];
|
|
78
|
+
fulfillerConduitKey?: string;
|
|
79
|
+
recipient: string;
|
|
80
|
+
} | {
|
|
81
|
+
basicOrderParameters: BasicOrderParametersStruct;
|
|
82
|
+
} | {
|
|
83
|
+
order: OrderWithCounter;
|
|
84
|
+
fulfillerConduitKey?: string;
|
|
85
|
+
recipient: string;
|
|
86
|
+
} | {
|
|
87
|
+
orders: OrderWithCounter[] | AdvancedOrder[] | BasicOrderParametersStruct[];
|
|
88
|
+
};
|
|
89
|
+
};
|
|
90
|
+
type OpenOrderOrderingOption = "created_date" | "eth_price";
|
|
91
|
+
type OrderByDirection = "asc" | "desc";
|
|
92
|
+
export type OrderAPIOptions = {
|
|
93
|
+
protocol?: OrderProtocol;
|
|
94
|
+
protocolAddress?: string;
|
|
95
|
+
side: OrderSide;
|
|
96
|
+
};
|
|
97
|
+
export type OrdersQueryOptions = OrderAPIOptions & {
|
|
98
|
+
limit?: number;
|
|
99
|
+
cursor?: string;
|
|
100
|
+
next?: string;
|
|
101
|
+
paymentTokenAddress?: string;
|
|
102
|
+
maker?: string;
|
|
103
|
+
taker?: string;
|
|
104
|
+
owner?: string;
|
|
105
|
+
listedAfter?: number | string;
|
|
106
|
+
listedBefore?: number | string;
|
|
107
|
+
tokenId?: string;
|
|
108
|
+
tokenIds?: string[];
|
|
109
|
+
assetContractAddress?: string;
|
|
110
|
+
orderBy?: OpenOrderOrderingOption;
|
|
111
|
+
orderDirection?: OrderByDirection;
|
|
112
|
+
onlyEnglish?: boolean;
|
|
113
|
+
};
|
|
114
|
+
export type SerializedOrderV2 = {
|
|
115
|
+
created_date: string;
|
|
116
|
+
closing_date: string | null;
|
|
117
|
+
listing_time: number;
|
|
118
|
+
expiration_time: number;
|
|
119
|
+
order_hash: string | null;
|
|
120
|
+
maker: unknown;
|
|
121
|
+
taker: unknown | null;
|
|
122
|
+
protocol_data: ProtocolData;
|
|
123
|
+
protocol_address: string;
|
|
124
|
+
current_price: string;
|
|
125
|
+
maker_fees: {
|
|
126
|
+
account: unknown;
|
|
127
|
+
basis_points: string;
|
|
128
|
+
}[];
|
|
129
|
+
taker_fees: {
|
|
130
|
+
account: unknown;
|
|
131
|
+
basis_points: string;
|
|
132
|
+
}[];
|
|
133
|
+
side: OrderSide;
|
|
134
|
+
order_type: OrderType;
|
|
135
|
+
cancelled: boolean;
|
|
136
|
+
finalized: boolean;
|
|
137
|
+
marked_invalid: boolean;
|
|
138
|
+
client_signature: string | null;
|
|
139
|
+
remaining_quantity: number;
|
|
140
|
+
};
|
|
141
|
+
export type QueryCursors = {
|
|
142
|
+
next: string | null;
|
|
143
|
+
previous: string | null;
|
|
144
|
+
};
|
|
145
|
+
export type OrdersQueryResponse = QueryCursors & {
|
|
146
|
+
orders: SerializedOrderV2[];
|
|
147
|
+
};
|
|
148
|
+
/** @deprecated Use ListingPostQueryResponse or OfferPostQueryResponse instead. */
|
|
149
|
+
export type OrdersPostQueryResponse = {
|
|
150
|
+
order: SerializedOrderV2;
|
|
151
|
+
};
|
|
152
|
+
export type ListingPostQueryResponse = {
|
|
153
|
+
order: SerializedOrderV2;
|
|
154
|
+
listing: Listing;
|
|
155
|
+
};
|
|
156
|
+
export type OfferPostQueryResponse = {
|
|
157
|
+
order: SerializedOrderV2;
|
|
158
|
+
offer: Offer;
|
|
159
|
+
};
|
|
160
|
+
export {};
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.OrderType = void 0;
|
|
4
|
+
var OrderType;
|
|
5
|
+
(function (OrderType) {
|
|
6
|
+
OrderType["BASIC"] = "basic";
|
|
7
|
+
OrderType["ENGLISH"] = "english";
|
|
8
|
+
OrderType["CRITERIA"] = "criteria";
|
|
9
|
+
})(OrderType || (exports.OrderType = OrderType = {}));
|
|
10
|
+
//# sourceMappingURL=types.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"types.js","sourceRoot":"","sources":["../../../src/orders/types.ts"],"names":[],"mappings":";;;AAgBA,IAAY,SAIX;AAJD,WAAY,SAAS;IACnB,4BAAe,CAAA;IACf,gCAAmB,CAAA;IACnB,kCAAqB,CAAA;AACvB,CAAC,EAJW,SAAS,yBAAT,SAAS,QAIpB"}
|
|
@@ -0,0 +1,89 @@
|
|
|
1
|
+
import { type Chain, OrderSide } from "../types";
|
|
2
|
+
import type { OrdersQueryOptions, OrderV2, ProtocolData, SerializedOrderV2 } from "./types";
|
|
3
|
+
export declare const DEFAULT_SEAPORT_CONTRACT_ADDRESS = "0x0000000000000068F116a894984e2DB1123eB395";
|
|
4
|
+
export declare const getPostCollectionOfferPayload: (collectionSlug: string, protocol_data: ProtocolData, chain: Chain, traitType?: string, traitValue?: string, traits?: Array<{
|
|
5
|
+
type: string;
|
|
6
|
+
value: string;
|
|
7
|
+
}>, numericTraits?: Array<{
|
|
8
|
+
type: string;
|
|
9
|
+
min?: number;
|
|
10
|
+
max?: number;
|
|
11
|
+
}>) => {
|
|
12
|
+
criteria: {
|
|
13
|
+
collection: {
|
|
14
|
+
slug: string;
|
|
15
|
+
};
|
|
16
|
+
};
|
|
17
|
+
protocol_data: import("@opensea/seaport-js/lib/types").OrderWithCounter;
|
|
18
|
+
protocol_address: string;
|
|
19
|
+
};
|
|
20
|
+
export declare const getBuildCollectionOfferPayload: (offererAddress: string, quantity: number, collectionSlug: string, offerProtectionEnabled: boolean, chain: Chain, traitType?: string, traitValue?: string, traits?: Array<{
|
|
21
|
+
type: string;
|
|
22
|
+
value: string;
|
|
23
|
+
}>, numericTraits?: Array<{
|
|
24
|
+
type: string;
|
|
25
|
+
min?: number;
|
|
26
|
+
max?: number;
|
|
27
|
+
}>) => {
|
|
28
|
+
offerer: string;
|
|
29
|
+
quantity: number;
|
|
30
|
+
criteria: {
|
|
31
|
+
collection: {
|
|
32
|
+
slug: string;
|
|
33
|
+
};
|
|
34
|
+
};
|
|
35
|
+
protocol_address: string;
|
|
36
|
+
offer_protection_enabled: boolean;
|
|
37
|
+
};
|
|
38
|
+
export declare const getFulfillmentDataPath: (side: OrderSide) => string;
|
|
39
|
+
export declare const getFulfillListingPayload: (fulfillerAddress: string, order_hash: string, protocolAddress: string, chain: Chain, assetContractAddress?: string, tokenId?: string, unitsToFill?: string, recipientAddress?: string, includeOptionalCreatorFees?: boolean) => {
|
|
40
|
+
listing: {
|
|
41
|
+
hash: string;
|
|
42
|
+
chain: Chain;
|
|
43
|
+
protocol_address: string;
|
|
44
|
+
};
|
|
45
|
+
fulfiller: {
|
|
46
|
+
address: string;
|
|
47
|
+
};
|
|
48
|
+
consideration?: {
|
|
49
|
+
asset_contract_address: string;
|
|
50
|
+
token_id: string;
|
|
51
|
+
};
|
|
52
|
+
units_to_fill: string;
|
|
53
|
+
recipient?: string;
|
|
54
|
+
include_optional_creator_fees: boolean;
|
|
55
|
+
};
|
|
56
|
+
export declare const getFulfillOfferPayload: (fulfillerAddress: string, order_hash: string, protocolAddress: string, chain: Chain, assetContractAddress?: string, tokenId?: string, unitsToFill?: string, includeOptionalCreatorFees?: boolean) => {
|
|
57
|
+
offer: {
|
|
58
|
+
hash: string;
|
|
59
|
+
chain: Chain;
|
|
60
|
+
protocol_address: string;
|
|
61
|
+
};
|
|
62
|
+
fulfiller: {
|
|
63
|
+
address: string;
|
|
64
|
+
};
|
|
65
|
+
consideration?: {
|
|
66
|
+
asset_contract_address: string;
|
|
67
|
+
token_id: string;
|
|
68
|
+
};
|
|
69
|
+
units_to_fill: string;
|
|
70
|
+
include_optional_creator_fees: boolean;
|
|
71
|
+
};
|
|
72
|
+
type OrdersQueryPathOptions = "protocol" | "side";
|
|
73
|
+
export declare const serializeOrdersQueryOptions: (options: Omit<OrdersQueryOptions, OrdersQueryPathOptions>) => {
|
|
74
|
+
limit: number | undefined;
|
|
75
|
+
cursor: string | undefined;
|
|
76
|
+
payment_token_address: string | undefined;
|
|
77
|
+
maker: string | undefined;
|
|
78
|
+
taker: string | undefined;
|
|
79
|
+
owner: string | undefined;
|
|
80
|
+
listed_after: string | number | undefined;
|
|
81
|
+
listed_before: string | number | undefined;
|
|
82
|
+
token_ids: string[] | undefined;
|
|
83
|
+
asset_contract_address: string | undefined;
|
|
84
|
+
order_by: ("created_date" | "eth_price") | undefined;
|
|
85
|
+
order_direction: ("asc" | "desc") | undefined;
|
|
86
|
+
only_english: boolean | undefined;
|
|
87
|
+
};
|
|
88
|
+
export declare const deserializeOrder: (order: SerializedOrderV2) => OrderV2;
|
|
89
|
+
export {};
|