@opensea/sdk 10.3.1 → 10.4.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.
Files changed (48) hide show
  1. package/lib/api/api.d.ts +28 -41
  2. package/lib/api/api.js +35 -48
  3. package/lib/api/api.js.map +1 -1
  4. package/lib/api/apiPaths.d.ts +7 -2
  5. package/lib/api/apiPaths.js +25 -6
  6. package/lib/api/apiPaths.js.map +1 -1
  7. package/lib/api/listings.d.ts +9 -14
  8. package/lib/api/listings.js +12 -30
  9. package/lib/api/listings.js.map +1 -1
  10. package/lib/api/offers.d.ts +2 -2
  11. package/lib/api/offers.js +2 -9
  12. package/lib/api/offers.js.map +1 -1
  13. package/lib/api/orders.d.ts +4 -21
  14. package/lib/api/orders.js +15 -96
  15. package/lib/api/orders.js.map +1 -1
  16. package/lib/api/tokens.d.ts +6 -1
  17. package/lib/api/tokens.js +7 -0
  18. package/lib/api/tokens.js.map +1 -1
  19. package/lib/api/transactions.d.ts +16 -0
  20. package/lib/api/transactions.js +24 -0
  21. package/lib/api/transactions.js.map +1 -0
  22. package/lib/api/types.d.ts +32 -10
  23. package/lib/api/types.js.map +1 -1
  24. package/lib/orders/types.d.ts +0 -67
  25. package/lib/orders/types.js.map +1 -1
  26. package/lib/orders/utils.d.ts +1 -19
  27. package/lib/orders/utils.js +1 -62
  28. package/lib/orders/utils.js.map +1 -1
  29. package/lib/sdk/base.d.ts +6 -6
  30. package/lib/sdk/base.js +2 -2
  31. package/lib/sdk/orders.d.ts +13 -10
  32. package/lib/sdk/orders.js +6 -22
  33. package/lib/sdk/orders.js.map +1 -1
  34. package/lib/types.d.ts +0 -6
  35. package/package.json +2 -2
  36. package/src/api/api.ts +54 -86
  37. package/src/api/apiPaths.ts +26 -8
  38. package/src/api/listings.ts +19 -41
  39. package/src/api/offers.ts +8 -16
  40. package/src/api/orders.ts +40 -177
  41. package/src/api/tokens.ts +11 -0
  42. package/src/api/transactions.ts +28 -0
  43. package/src/api/types.ts +43 -15
  44. package/src/orders/types.ts +0 -74
  45. package/src/orders/utils.ts +2 -73
  46. package/src/sdk/base.ts +6 -6
  47. package/src/sdk/orders.ts +31 -32
  48. package/src/types.ts +0 -6
@@ -1,11 +1,9 @@
1
- import { serializeOrdersQueryOptions } from "../orders/utils"
2
- import { type Chain, OrderSide } from "../types"
3
1
  import {
4
2
  getAllListingsAPIPath,
5
3
  getBestListingAPIPath,
6
4
  getBestListingsAPIPath,
7
5
  getCrossChainFulfillmentDataPath,
8
- getOrdersAPIPath,
6
+ getSweepListingsPath,
9
7
  } from "./apiPaths"
10
8
  import type { Fetcher } from "./fetcher"
11
9
  import {
@@ -14,6 +12,8 @@ import {
14
12
  encodeTraitsParam,
15
13
  type GetBestListingResponse,
16
14
  type GetListingsResponse,
15
+ type SweepCollectionRequest,
16
+ type SweepCollectionResponse,
17
17
  type TraitFilter,
18
18
  } from "./types"
19
19
 
@@ -21,10 +21,7 @@ import {
21
21
  * Listing-related API operations
22
22
  */
23
23
  export class ListingsAPI {
24
- constructor(
25
- private fetcher: Fetcher,
26
- private chain: Chain,
27
- ) {}
24
+ constructor(private fetcher: Fetcher) {}
28
25
 
29
26
  /**
30
27
  * Gets all listings for a given collection.
@@ -97,40 +94,6 @@ export class ListingsAPI {
97
94
  return response
98
95
  }
99
96
 
100
- /**
101
- * Gets all active listings for a specific NFT.
102
- * @param assetContractAddress The NFT contract address
103
- * @param tokenId The token ID
104
- * @param limit The number of listings to return
105
- * @param next The cursor for pagination
106
- * @param chain The blockchain chain
107
- * @param includePrivateListings Whether to include private listings (default: false)
108
- */
109
- async getNFTListings(
110
- assetContractAddress: string,
111
- tokenId: string,
112
- limit?: number,
113
- next?: string,
114
- chain: Chain = this.chain,
115
- includePrivateListings?: boolean,
116
- ): Promise<GetListingsResponse> {
117
- const response = await this.fetcher.get<GetListingsResponse>(
118
- getOrdersAPIPath(chain, "seaport", OrderSide.LISTING),
119
- {
120
- ...serializeOrdersQueryOptions({
121
- assetContractAddress,
122
- tokenIds: [tokenId],
123
- limit,
124
- next,
125
- }),
126
- ...(includePrivateListings !== undefined && {
127
- include_private_listings: includePrivateListings,
128
- }),
129
- },
130
- )
131
- return response
132
- }
133
-
134
97
  /**
135
98
  * Get cross-chain fulfillment data for one or more listings.
136
99
  * Supports same-chain, cross-token, and cross-chain purchases.
@@ -144,4 +107,19 @@ export class ListingsAPI {
144
107
  request,
145
108
  )
146
109
  }
110
+
111
+ /**
112
+ * Bulk-buy items from a collection.
113
+ * If a requested item becomes unavailable, the system can automatically
114
+ * substitute it with the next cheapest listing from the same collection
115
+ * (enabled by default). Returns an ordered list of transactions to execute.
116
+ */
117
+ async sweepCollection(
118
+ request: SweepCollectionRequest,
119
+ ): Promise<SweepCollectionResponse> {
120
+ return this.fetcher.post<SweepCollectionResponse>(
121
+ getSweepListingsPath(),
122
+ request,
123
+ )
124
+ }
147
125
  }
package/src/api/offers.ts CHANGED
@@ -2,15 +2,14 @@ import type { ProtocolData } from "../orders/types"
2
2
  import {
3
3
  getBuildCollectionOfferPayload,
4
4
  getPostCollectionOfferPayload,
5
- serializeOrdersQueryOptions,
6
5
  } from "../orders/utils"
7
- import { type Chain, OrderSide } from "../types"
6
+ import type { Chain } from "../types"
8
7
  import {
9
8
  getAllOffersAPIPath,
10
9
  getBestOfferAPIPath,
11
10
  getBuildOfferPath,
12
11
  getCollectionOffersPath,
13
- getOrdersAPIPath,
12
+ getOffersByNFTPath,
14
13
  getPostCollectionOfferPath,
15
14
  getTraitOffersPath,
16
15
  } from "./apiPaths"
@@ -221,22 +220,15 @@ export class OffersAPI {
221
220
  /**
222
221
  * Gets all active offers for a specific NFT.
223
222
  */
224
- async getNFTOffers(
225
- assetContractAddress: string,
226
- tokenId: string,
223
+ async getOffersByNFT(
224
+ collectionSlug: string,
225
+ identifier: string | number,
227
226
  limit?: number,
228
227
  next?: string,
229
- chain: Chain = this.chain,
230
228
  ): Promise<GetOffersResponse> {
231
- const response = await this.fetcher.get<GetOffersResponse>(
232
- getOrdersAPIPath(chain, "seaport", OrderSide.OFFER),
233
- serializeOrdersQueryOptions({
234
- assetContractAddress,
235
- tokenIds: [tokenId],
236
- limit,
237
- next,
238
- }),
229
+ return this.fetcher.get<GetOffersResponse>(
230
+ getOffersByNFTPath(collectionSlug, identifier),
231
+ { limit, next },
239
232
  )
240
- return response
241
233
  }
242
234
  }
package/src/api/orders.ts CHANGED
@@ -1,32 +1,20 @@
1
- import type {
2
- FulfillmentDataResponse,
3
- ListingPostQueryResponse,
4
- OfferPostQueryResponse,
5
- OrderAPIOptions,
6
- OrdersPostQueryResponse,
7
- OrdersQueryOptions,
8
- OrdersQueryResponse,
9
- OrderV2,
10
- ProtocolData,
11
- } from "../orders/types"
1
+ import type { FulfillmentDataResponse, ProtocolData } from "../orders/types"
12
2
  import {
13
- deserializeOrder,
14
3
  getFulfillListingPayload,
15
4
  getFulfillmentDataPath,
16
5
  getFulfillOfferPayload,
17
- serializeOrdersQueryOptions,
18
6
  } from "../orders/utils"
19
7
  import { type Chain, OrderSide } from "../types"
20
8
  import {
21
9
  getCancelOrderPath,
22
10
  getOrderByHashPath,
23
- getOrdersAPIPath,
11
+ getPostListingPath,
12
+ getPostOfferPath,
24
13
  } from "./apiPaths"
25
14
  import type { Fetcher } from "./fetcher"
26
15
  import type {
27
16
  CancelOrderResponse,
28
17
  GetOrderByHashResponse,
29
- GetOrdersResponse,
30
18
  Listing,
31
19
  Offer,
32
20
  } from "./types"
@@ -40,44 +28,6 @@ export class OrdersAPI {
40
28
  private chain: Chain,
41
29
  ) {}
42
30
 
43
- /**
44
- * Gets an order from API based on query options.
45
- * @deprecated Use collection-based endpoints instead: getAllOffers, getAllListings, getBestOffer, getBestListing.
46
- */
47
- async getOrder({
48
- side,
49
- protocol = "seaport",
50
- orderDirection = "desc",
51
- orderBy = "created_date",
52
- ...restOptions
53
- }: Omit<OrdersQueryOptions, "limit">): Promise<OrderV2> {
54
- // Validate eth_price orderBy requires additional parameters
55
- if (orderBy === "eth_price") {
56
- const hasTokenId =
57
- (restOptions.tokenIds?.length ?? 0) > 0 ||
58
- restOptions.tokenId !== undefined
59
- if (!restOptions.assetContractAddress || !hasTokenId) {
60
- throw new Error(
61
- 'When using orderBy: "eth_price", you must provide both assetContractAddress and tokenIds (or tokenId) parameters',
62
- )
63
- }
64
- }
65
-
66
- const { orders } = await this.fetcher.get<OrdersQueryResponse>(
67
- getOrdersAPIPath(this.chain, protocol, side),
68
- serializeOrdersQueryOptions({
69
- limit: 1,
70
- orderBy,
71
- orderDirection,
72
- ...restOptions,
73
- }),
74
- )
75
- if (orders.length === 0) {
76
- throw new Error("Not found: no matching order found")
77
- }
78
- return deserializeOrder(orders[0])
79
- }
80
-
81
31
  /**
82
32
  * Gets a single order by its order hash.
83
33
  * Returns the raw API response which can be either an Offer or Listing.
@@ -93,47 +43,6 @@ export class OrdersAPI {
93
43
  return response.order
94
44
  }
95
45
 
96
- /**
97
- * Gets a list of orders from API based on query options.
98
- * @deprecated Use collection-based endpoints instead: getAllOffers, getAllListings, getBestOffer, getBestListing.
99
- */
100
- async getOrders({
101
- side,
102
- protocol = "seaport",
103
- orderDirection = "desc",
104
- orderBy = "created_date",
105
- pageSize = 20,
106
- ...restOptions
107
- }: Omit<OrdersQueryOptions, "limit"> & {
108
- pageSize?: number
109
- }): Promise<GetOrdersResponse> {
110
- // Validate eth_price orderBy requires additional parameters
111
- if (orderBy === "eth_price") {
112
- const hasTokenId =
113
- (restOptions.tokenIds?.length ?? 0) > 0 ||
114
- restOptions.tokenId !== undefined
115
- if (!restOptions.assetContractAddress || !hasTokenId) {
116
- throw new Error(
117
- 'When using orderBy: "eth_price", you must provide both assetContractAddress and tokenIds (or tokenId) parameters',
118
- )
119
- }
120
- }
121
-
122
- const response = await this.fetcher.get<OrdersQueryResponse>(
123
- getOrdersAPIPath(this.chain, protocol, side),
124
- serializeOrdersQueryOptions({
125
- limit: pageSize,
126
- orderBy,
127
- orderDirection,
128
- ...restOptions,
129
- }),
130
- )
131
- return {
132
- ...response,
133
- orders: response.orders.map(deserializeOrder),
134
- }
135
- }
136
-
137
46
  /**
138
47
  * Generate the data needed to fulfill a listing or an offer onchain.
139
48
  */
@@ -148,83 +57,37 @@ export class OrdersAPI {
148
57
  recipientAddress?: string,
149
58
  includeOptionalCreatorFees: boolean = false,
150
59
  ): Promise<FulfillmentDataResponse> {
151
- let payload: object | null = null
152
- if (side === OrderSide.LISTING) {
153
- payload = getFulfillListingPayload(
154
- fulfillerAddress,
155
- orderHash,
156
- protocolAddress,
157
- this.chain,
158
- assetContractAddress,
159
- tokenId,
160
- unitsToFill,
161
- recipientAddress,
162
- includeOptionalCreatorFees,
163
- )
164
- } else {
165
- payload = getFulfillOfferPayload(
166
- fulfillerAddress,
167
- orderHash,
168
- protocolAddress,
169
- this.chain,
170
- assetContractAddress,
171
- tokenId,
172
- unitsToFill,
173
- includeOptionalCreatorFees,
174
- )
175
- }
176
- const response = await this.fetcher.post<FulfillmentDataResponse>(
60
+ const payload =
61
+ side === OrderSide.LISTING
62
+ ? getFulfillListingPayload(
63
+ fulfillerAddress,
64
+ orderHash,
65
+ protocolAddress,
66
+ this.chain,
67
+ assetContractAddress,
68
+ tokenId,
69
+ unitsToFill,
70
+ recipientAddress,
71
+ includeOptionalCreatorFees,
72
+ )
73
+ : getFulfillOfferPayload(
74
+ fulfillerAddress,
75
+ orderHash,
76
+ protocolAddress,
77
+ this.chain,
78
+ assetContractAddress,
79
+ tokenId,
80
+ unitsToFill,
81
+ includeOptionalCreatorFees,
82
+ )
83
+ return this.fetcher.post<FulfillmentDataResponse>(
177
84
  getFulfillmentDataPath(side),
178
85
  payload,
179
86
  )
180
- return response
181
87
  }
182
88
 
183
89
  /**
184
- * Post an order to OpenSea.
185
- * @deprecated Use postListing or postOffer instead.
186
- */
187
- async postOrder(
188
- order: ProtocolData,
189
- apiOptions: OrderAPIOptions,
190
- ): Promise<OrderV2> {
191
- const { protocol = "seaport", side, protocolAddress } = apiOptions
192
-
193
- // Validate required fields
194
- if (!side) {
195
- throw new Error("apiOptions.side is required")
196
- }
197
- if (!protocolAddress) {
198
- throw new Error("apiOptions.protocolAddress is required")
199
- }
200
- if (!order) {
201
- throw new Error("order data is required")
202
- }
203
-
204
- // Validate protocol value
205
- if (protocol !== "seaport") {
206
- throw new Error("Currently only 'seaport' protocol is supported")
207
- }
208
-
209
- // Validate side value
210
- if (side !== "listing" && side !== "offer") {
211
- throw new Error("side must be either 'listing' or 'offer'")
212
- }
213
-
214
- // Validate protocolAddress format
215
- if (!/^0x[a-fA-F0-9]{40}$/.test(protocolAddress)) {
216
- throw new Error("Invalid protocol address format")
217
- }
218
-
219
- const response = await this.fetcher.post<OrdersPostQueryResponse>(
220
- getOrdersAPIPath(this.chain, protocol, side),
221
- { ...order, protocol_address: protocolAddress },
222
- )
223
- return deserializeOrder(response.order)
224
- }
225
-
226
- /**
227
- * Post a listing to OpenSea. Returns the new Listing response format.
90
+ * Post a listing to OpenSea.
228
91
  */
229
92
  async postListing(
230
93
  order: ProtocolData,
@@ -237,15 +100,17 @@ export class OrdersAPI {
237
100
  throw new Error("Invalid protocol address format")
238
101
  }
239
102
 
240
- const response = await this.fetcher.post<ListingPostQueryResponse>(
241
- getOrdersAPIPath(this.chain, "seaport", OrderSide.LISTING),
242
- { ...order, protocol_address: protocolAddress },
103
+ return this.fetcher.post<Listing>(
104
+ getPostListingPath(this.chain, "seaport"),
105
+ {
106
+ ...order,
107
+ protocol_address: protocolAddress,
108
+ },
243
109
  )
244
- return response.listing
245
110
  }
246
111
 
247
112
  /**
248
- * Post an offer to OpenSea. Returns the new Offer response format.
113
+ * Post an offer to OpenSea.
249
114
  */
250
115
  async postOffer(
251
116
  order: ProtocolData,
@@ -258,11 +123,10 @@ export class OrdersAPI {
258
123
  throw new Error("Invalid protocol address format")
259
124
  }
260
125
 
261
- const response = await this.fetcher.post<OfferPostQueryResponse>(
262
- getOrdersAPIPath(this.chain, "seaport", OrderSide.OFFER),
263
- { ...order, protocol_address: protocolAddress },
264
- )
265
- return response.offer
126
+ return this.fetcher.post<Offer>(getPostOfferPath(this.chain, "seaport"), {
127
+ ...order,
128
+ protocol_address: protocolAddress,
129
+ })
266
130
  }
267
131
 
268
132
  /**
@@ -274,10 +138,9 @@ export class OrdersAPI {
274
138
  chain: Chain = this.chain,
275
139
  offererSignature?: string,
276
140
  ): Promise<CancelOrderResponse> {
277
- const response = await this.fetcher.post<CancelOrderResponse>(
141
+ return this.fetcher.post<CancelOrderResponse>(
278
142
  getCancelOrderPath(chain, protocolAddress, orderHash),
279
143
  { offererSignature },
280
144
  )
281
- return response
282
145
  }
283
146
  }
package/src/api/tokens.ts CHANGED
@@ -1,4 +1,5 @@
1
1
  import {
2
+ getSwapExecutePath,
2
3
  getSwapQuotePath,
3
4
  getTokenGroupPath,
4
5
  getTokenGroupsPath,
@@ -17,6 +18,8 @@ import type {
17
18
  GetTokensArgs,
18
19
  GetTopTokensResponse,
19
20
  GetTrendingTokensResponse,
21
+ SwapExecuteRequest,
22
+ SwapExecuteResponse,
20
23
  } from "./types"
21
24
 
22
25
  /**
@@ -60,6 +63,14 @@ export class TokensAPI {
60
63
  return response
61
64
  }
62
65
 
66
+ /**
67
+ * Get executable transactions for a token swap.
68
+ * Supports same-chain and cross-chain swaps with multiple from/to assets.
69
+ */
70
+ async executeSwap(request: SwapExecuteRequest): Promise<SwapExecuteResponse> {
71
+ return this.fetcher.post<SwapExecuteResponse>(getSwapExecutePath(), request)
72
+ }
73
+
63
74
  /**
64
75
  * Gets details for a specific token.
65
76
  */
@@ -0,0 +1,28 @@
1
+ import { getTransactionReceiptPath } from "./apiPaths"
2
+ import type { Fetcher } from "./fetcher"
3
+ import type {
4
+ TransactionReceiptRequest,
5
+ TransactionReceiptResponse,
6
+ } from "./types"
7
+
8
+ /**
9
+ * Transaction-related API operations
10
+ */
11
+ export class TransactionsAPI {
12
+ constructor(private fetcher: Fetcher) {}
13
+
14
+ /**
15
+ * Get the receipt/status for a submitted transaction.
16
+ * Works for all transaction types: listing fulfillments, cross-chain buys,
17
+ * sweeps, offer fulfillments, and token swaps. Poll this endpoint to check
18
+ * completion status.
19
+ */
20
+ async getTransactionReceipt(
21
+ request: TransactionReceiptRequest,
22
+ ): Promise<TransactionReceiptResponse> {
23
+ return this.fetcher.post<TransactionReceiptResponse>(
24
+ getTransactionReceiptPath(),
25
+ request,
26
+ )
27
+ }
28
+ }
package/src/api/types.ts CHANGED
@@ -1,16 +1,17 @@
1
1
  import type {
2
+ SwapExecuteRequest as ApiSwapExecuteRequest,
3
+ SwapExecuteResponse as ApiSwapExecuteResponse,
4
+ SweepCollectionRequest as ApiSweepCollectionRequest,
5
+ SweepCollectionResponse as ApiSweepCollectionResponse,
6
+ TransactionReceiptRequest as ApiTransactionReceiptRequest,
7
+ TransactionReceiptResponse as ApiTransactionReceiptResponse,
2
8
  AssetMetadataResponse,
3
9
  InstantApiKeyResponse,
4
10
  TokenGroupPaginatedResponse,
5
11
  TokenGroupResponse,
6
12
  } from "@opensea/api-types"
7
13
  import type { ConsiderationItem } from "@opensea/seaport-js/lib/types"
8
- import type {
9
- OrderType,
10
- OrderV2,
11
- ProtocolData,
12
- QueryCursors,
13
- } from "../orders/types"
14
+ import type { OrderType, ProtocolData } from "../orders/types"
14
15
  import type { OpenSeaCollection } from "../types"
15
16
 
16
17
  /**
@@ -260,15 +261,6 @@ export type GetNFTResponse = {
260
261
  nft: NFT
261
262
  }
262
263
 
263
- /**
264
- * Response from OpenSea API for fetching Orders.
265
- * @category API Response Types
266
- */
267
- export type GetOrdersResponse = QueryCursors & {
268
- /** List of {@link OrderV2} */
269
- orders: OrderV2[]
270
- }
271
-
272
264
  /**
273
265
  * Base query cursors response from OpenSea API.
274
266
  * @category API Response Types
@@ -320,6 +312,42 @@ export type CancelOrderResponse = {
320
312
  last_signature_issued_valid_until: string | null
321
313
  }
322
314
 
315
+ /**
316
+ * Request body for sweeping (bulk-buying) items from a collection.
317
+ * @category API Query Args
318
+ */
319
+ export type SweepCollectionRequest = ApiSweepCollectionRequest
320
+
321
+ /**
322
+ * Response from sweeping a collection.
323
+ * @category API Response Types
324
+ */
325
+ export type SweepCollectionResponse = ApiSweepCollectionResponse
326
+
327
+ /**
328
+ * Request body for executing a token swap.
329
+ * @category API Query Args
330
+ */
331
+ export type SwapExecuteRequest = ApiSwapExecuteRequest
332
+
333
+ /**
334
+ * Response from executing a token swap.
335
+ * @category API Response Types
336
+ */
337
+ export type SwapExecuteResponse = ApiSwapExecuteResponse
338
+
339
+ /**
340
+ * Request body for fetching a transaction receipt.
341
+ * @category API Query Args
342
+ */
343
+ export type TransactionReceiptRequest = ApiTransactionReceiptRequest
344
+
345
+ /**
346
+ * Response from fetching a transaction receipt.
347
+ * @category API Response Types
348
+ */
349
+ export type TransactionReceiptResponse = ApiTransactionReceiptResponse
350
+
323
351
  /**
324
352
  * NFT type returned by OpenSea API.
325
353
  * @category API Models
@@ -3,7 +3,6 @@ import type {
3
3
  AdvancedOrder,
4
4
  OrderWithCounter,
5
5
  } from "@opensea/seaport-js/lib/types"
6
- import type { Listing, Offer } from "../api/types"
7
6
  import type { OpenSeaAccount, OrderSide } from "../types"
8
7
 
9
8
  // Protocol data
@@ -112,80 +111,7 @@ type Transaction = {
112
111
  }
113
112
 
114
113
  // API query types
115
- type OpenOrderOrderingOption = "created_date" | "eth_price"
116
- type OrderByDirection = "asc" | "desc"
117
-
118
- export type OrderAPIOptions = {
119
- protocol?: OrderProtocol
120
- protocolAddress?: string
121
- side: OrderSide
122
- }
123
-
124
- export type OrdersQueryOptions = OrderAPIOptions & {
125
- limit?: number
126
- cursor?: string
127
- next?: string
128
-
129
- paymentTokenAddress?: string
130
- maker?: string
131
- taker?: string
132
- owner?: string
133
- listedAfter?: number | string
134
- listedBefore?: number | string
135
- tokenId?: string
136
- tokenIds?: string[]
137
- assetContractAddress?: string
138
- orderBy?: OpenOrderOrderingOption
139
- orderDirection?: OrderByDirection
140
- onlyEnglish?: boolean
141
- }
142
-
143
- export type SerializedOrderV2 = {
144
- created_date: string
145
- closing_date: string | null
146
- listing_time: number
147
- expiration_time: number
148
- order_hash: string | null
149
- maker: unknown
150
- taker: unknown | null
151
- protocol_data: ProtocolData
152
- protocol_address: string
153
- current_price: string
154
- maker_fees: {
155
- account: unknown
156
- basis_points: string
157
- }[]
158
- taker_fees: {
159
- account: unknown
160
- basis_points: string
161
- }[]
162
- side: OrderSide
163
- order_type: OrderType
164
- cancelled: boolean
165
- finalized: boolean
166
- marked_invalid: boolean
167
- client_signature: string | null
168
- remaining_quantity: number
169
- }
170
-
171
114
  export type QueryCursors = {
172
115
  next: string | null
173
116
  previous: string | null
174
117
  }
175
-
176
- export type OrdersQueryResponse = QueryCursors & {
177
- orders: SerializedOrderV2[]
178
- }
179
-
180
- /** @deprecated Use ListingPostQueryResponse or OfferPostQueryResponse instead. */
181
- export type OrdersPostQueryResponse = { order: SerializedOrderV2 }
182
-
183
- export type ListingPostQueryResponse = {
184
- order: SerializedOrderV2
185
- listing: Listing
186
- }
187
-
188
- export type OfferPostQueryResponse = {
189
- order: SerializedOrderV2
190
- offer: Offer
191
- }