@imtbl/sdk 1.43.3 → 1.43.4
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/dist/Passport.d-011d5035.d.ts +224 -0
- package/dist/blockchain-data.d-1634b683.d.ts +3406 -0
- package/dist/blockchain_data-d989298c.js +1 -0
- package/dist/blockchain_data.d-d538f8d4.d.ts +4543 -0
- package/dist/blockchain_data.d.ts +3 -7950
- package/dist/blockchain_data.js +1 -6058
- package/dist/browser/checkout/sdk.js +4 -4
- package/dist/checkout-68675dd1.js +16 -0
- package/dist/checkout.d-ae9ca847.d.ts +3392 -0
- package/dist/checkout.d.ts +7 -16882
- package/dist/checkout.js +1 -37189
- package/dist/config-53a9a4ca.js +1 -0
- package/dist/config.d-65420620.d.ts +18 -0
- package/dist/config.d.ts +1 -30
- package/dist/config.js +1 -394
- package/dist/event-types.d-42520276.d.ts +332 -0
- package/dist/imxProvider.d-cac9e315.d.ts +12538 -0
- package/dist/index-14aad537.js +1 -0
- package/dist/index-3951cdf0.js +1 -0
- package/dist/index-3f40d7f6.js +1 -0
- package/dist/index-58a79c29.js +1 -0
- package/dist/index-96599707.js +1 -0
- package/dist/index-e7002486.js +1 -0
- package/dist/index.browser.js +4 -4
- package/dist/index.cjs +7 -7
- package/dist/index.d-c4a4c17d.d.ts +277 -0
- package/dist/index.d-f0845744.d.ts +30 -0
- package/dist/index.d-f1471830.d.ts +376 -0
- package/dist/index.d.ts +18 -32627
- package/dist/index.js +1 -64124
- package/dist/json-rpc-provider.d-5c038bd9.d.ts +249 -0
- package/dist/minting_backend-04aef147.js +1 -0
- package/dist/minting_backend.d-4754ffee.d.ts +104 -0
- package/dist/minting_backend.d.ts +5 -3535
- package/dist/minting_backend.js +1 -6756
- package/dist/orderbook-e71036df.js +1 -0
- package/dist/orderbook.d-77162c6c.d.ts +1257 -0
- package/dist/orderbook.d.ts +5 -1713
- package/dist/orderbook.js +1 -2479
- package/dist/passport-0f45e532.js +1 -0
- package/dist/passport.d-d3f44798.d.ts +67 -0
- package/dist/passport.d.ts +6 -13703
- package/dist/passport.js +1 -23137
- package/dist/transfer.d-87728423.d.ts +898 -0
- package/dist/webhook-a16541bb.js +1 -0
- package/dist/webhook.d-4c3cb340.d.ts +75 -0
- package/dist/webhook.d.ts +4 -1265
- package/dist/webhook.js +1 -488
- package/dist/x-a5b39578.js +1 -0
- package/dist/x.d-1b51f0c3.d.ts +4879 -0
- package/dist/x.d.ts +6 -18663
- package/dist/x.js +1 -19242
- package/package.json +1 -1
|
@@ -0,0 +1,1257 @@
|
|
|
1
|
+
import { M as ModuleConfiguration } from './index.d-f0845744.js';
|
|
2
|
+
import { J as JsonRpcProvider } from './json-rpc-provider.d-5c038bd9.js';
|
|
3
|
+
import { P as PopulatedTransaction } from './index.d-f1471830.js';
|
|
4
|
+
import { m as TypedDataDomain, n as TypedDataField } from './index.d-c4a4c17d.js';
|
|
5
|
+
|
|
6
|
+
interface OrderbookOverrides {
|
|
7
|
+
jsonRpcProviderUrl?: string;
|
|
8
|
+
seaportContractAddress?: string;
|
|
9
|
+
zoneContractAddress?: string;
|
|
10
|
+
chainName?: string;
|
|
11
|
+
apiEndpoint?: string;
|
|
12
|
+
}
|
|
13
|
+
interface OrderbookModuleConfiguration {
|
|
14
|
+
seaportContractAddress: string;
|
|
15
|
+
zoneContractAddress: string;
|
|
16
|
+
apiEndpoint: string;
|
|
17
|
+
chainName: string;
|
|
18
|
+
provider: JsonRpcProvider;
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
type ApiRequestOptions = {
|
|
22
|
+
readonly method: 'GET' | 'PUT' | 'POST' | 'DELETE' | 'OPTIONS' | 'HEAD' | 'PATCH';
|
|
23
|
+
readonly url: string;
|
|
24
|
+
readonly path?: Record<string, any>;
|
|
25
|
+
readonly cookies?: Record<string, any>;
|
|
26
|
+
readonly headers?: Record<string, any>;
|
|
27
|
+
readonly query?: Record<string, any>;
|
|
28
|
+
readonly formData?: Record<string, any>;
|
|
29
|
+
readonly body?: any;
|
|
30
|
+
readonly mediaType?: string;
|
|
31
|
+
readonly responseHeader?: string;
|
|
32
|
+
readonly errors?: Record<number, string>;
|
|
33
|
+
};
|
|
34
|
+
|
|
35
|
+
interface OnCancel {
|
|
36
|
+
readonly isResolved: boolean;
|
|
37
|
+
readonly isRejected: boolean;
|
|
38
|
+
readonly isCancelled: boolean;
|
|
39
|
+
(cancelHandler: () => void): void;
|
|
40
|
+
}
|
|
41
|
+
declare class CancelablePromise<T> implements Promise<T> {
|
|
42
|
+
readonly [Symbol.toStringTag]: string;
|
|
43
|
+
private _isResolved;
|
|
44
|
+
private _isRejected;
|
|
45
|
+
private _isCancelled;
|
|
46
|
+
private readonly _cancelHandlers;
|
|
47
|
+
private readonly _promise;
|
|
48
|
+
private _resolve?;
|
|
49
|
+
private _reject?;
|
|
50
|
+
constructor(executor: (resolve: (value: T | PromiseLike<T>) => void, reject: (reason?: any) => void, onCancel: OnCancel) => void);
|
|
51
|
+
then<TResult1 = T, TResult2 = never>(onFulfilled?: ((value: T) => TResult1 | PromiseLike<TResult1>) | null, onRejected?: ((reason: any) => TResult2 | PromiseLike<TResult2>) | null): Promise<TResult1 | TResult2>;
|
|
52
|
+
catch<TResult = never>(onRejected?: ((reason: any) => TResult | PromiseLike<TResult>) | null): Promise<T | TResult>;
|
|
53
|
+
finally(onFinally?: (() => void) | null): Promise<T>;
|
|
54
|
+
cancel(): void;
|
|
55
|
+
get isCancelled(): boolean;
|
|
56
|
+
}
|
|
57
|
+
|
|
58
|
+
type Resolver<T> = (options: ApiRequestOptions) => Promise<T>;
|
|
59
|
+
type Headers = Record<string, string>;
|
|
60
|
+
type OpenAPIConfig = {
|
|
61
|
+
BASE: string;
|
|
62
|
+
VERSION: string;
|
|
63
|
+
WITH_CREDENTIALS: boolean;
|
|
64
|
+
CREDENTIALS: 'include' | 'omit' | 'same-origin';
|
|
65
|
+
TOKEN?: string | Resolver<string>;
|
|
66
|
+
USERNAME?: string | Resolver<string>;
|
|
67
|
+
PASSWORD?: string | Resolver<string>;
|
|
68
|
+
HEADERS?: Headers | Resolver<Headers>;
|
|
69
|
+
ENCODE_PATH?: (path: string) => string;
|
|
70
|
+
};
|
|
71
|
+
|
|
72
|
+
declare abstract class BaseHttpRequest {
|
|
73
|
+
readonly config: OpenAPIConfig;
|
|
74
|
+
constructor(config: OpenAPIConfig);
|
|
75
|
+
abstract request<T>(options: ApiRequestOptions): CancelablePromise<T>;
|
|
76
|
+
}
|
|
77
|
+
|
|
78
|
+
type CancelOrdersRequestBody = {
|
|
79
|
+
/**
|
|
80
|
+
* Address of the user initiating the cancel request
|
|
81
|
+
*/
|
|
82
|
+
account_address: string;
|
|
83
|
+
/**
|
|
84
|
+
* List of order ids proposed for cancellation
|
|
85
|
+
*/
|
|
86
|
+
orders: Array<string>;
|
|
87
|
+
/**
|
|
88
|
+
* Signature generated by the user for the specific cancellation request
|
|
89
|
+
*/
|
|
90
|
+
signature: string;
|
|
91
|
+
};
|
|
92
|
+
|
|
93
|
+
type FailedOrderCancellation = {
|
|
94
|
+
/**
|
|
95
|
+
* ID of the order which failed to be cancelled
|
|
96
|
+
*/
|
|
97
|
+
order: string;
|
|
98
|
+
/**
|
|
99
|
+
* Reason code indicating why the order failed to be cancelled
|
|
100
|
+
*/
|
|
101
|
+
reason_code: FailedOrderCancellation.reason_code;
|
|
102
|
+
};
|
|
103
|
+
declare namespace FailedOrderCancellation {
|
|
104
|
+
/**
|
|
105
|
+
* Reason code indicating why the order failed to be cancelled
|
|
106
|
+
*/
|
|
107
|
+
enum reason_code {
|
|
108
|
+
FILLED = "FILLED"
|
|
109
|
+
}
|
|
110
|
+
}
|
|
111
|
+
|
|
112
|
+
type CancelOrdersResultData = {
|
|
113
|
+
/**
|
|
114
|
+
* Orders which were successfully cancelled
|
|
115
|
+
*/
|
|
116
|
+
successful_cancellations: Array<string>;
|
|
117
|
+
/**
|
|
118
|
+
* Orders which are marked for cancellation but the cancellation cannot be guaranteed
|
|
119
|
+
*/
|
|
120
|
+
pending_cancellations: Array<string>;
|
|
121
|
+
/**
|
|
122
|
+
* Orders which failed to be cancelled
|
|
123
|
+
*/
|
|
124
|
+
failed_cancellations: Array<FailedOrderCancellation>;
|
|
125
|
+
};
|
|
126
|
+
|
|
127
|
+
type CancelOrdersResult = {
|
|
128
|
+
result: CancelOrdersResultData;
|
|
129
|
+
};
|
|
130
|
+
|
|
131
|
+
/**
|
|
132
|
+
* The name of chain
|
|
133
|
+
*/
|
|
134
|
+
type ChainName = string;
|
|
135
|
+
|
|
136
|
+
type Fee$1 = {
|
|
137
|
+
/**
|
|
138
|
+
* Fee payable to recipient upon settlement
|
|
139
|
+
*/
|
|
140
|
+
amount: string;
|
|
141
|
+
/**
|
|
142
|
+
* Fee type
|
|
143
|
+
*/
|
|
144
|
+
type: Fee$1.type;
|
|
145
|
+
/**
|
|
146
|
+
* Wallet address of fee recipient
|
|
147
|
+
*/
|
|
148
|
+
recipient_address: string;
|
|
149
|
+
};
|
|
150
|
+
declare namespace Fee$1 {
|
|
151
|
+
/**
|
|
152
|
+
* Fee type
|
|
153
|
+
*/
|
|
154
|
+
enum type {
|
|
155
|
+
ROYALTY = "ROYALTY",
|
|
156
|
+
MAKER_ECOSYSTEM = "MAKER_ECOSYSTEM",
|
|
157
|
+
TAKER_ECOSYSTEM = "TAKER_ECOSYSTEM",
|
|
158
|
+
PROTOCOL = "PROTOCOL"
|
|
159
|
+
}
|
|
160
|
+
}
|
|
161
|
+
|
|
162
|
+
type ERC1155Item$1 = {
|
|
163
|
+
/**
|
|
164
|
+
* Token type user is offering, which in this case is ERC1155
|
|
165
|
+
*/
|
|
166
|
+
type: 'ERC1155';
|
|
167
|
+
/**
|
|
168
|
+
* Address of ERC1155 token
|
|
169
|
+
*/
|
|
170
|
+
contract_address: string;
|
|
171
|
+
/**
|
|
172
|
+
* ID of ERC1155 token
|
|
173
|
+
*/
|
|
174
|
+
token_id: string;
|
|
175
|
+
/**
|
|
176
|
+
* A string representing the price at which the user is willing to sell the token. This value is provided in the smallest unit of the token (e.g., wei for Ethereum).
|
|
177
|
+
*/
|
|
178
|
+
amount: string;
|
|
179
|
+
};
|
|
180
|
+
|
|
181
|
+
type ERC20Item$1 = {
|
|
182
|
+
/**
|
|
183
|
+
* Token type user is offering, which in this case is ERC20
|
|
184
|
+
*/
|
|
185
|
+
type: 'ERC20';
|
|
186
|
+
/**
|
|
187
|
+
* Address of ERC20 token
|
|
188
|
+
*/
|
|
189
|
+
contract_address: string;
|
|
190
|
+
/**
|
|
191
|
+
* A string representing the price at which the user is willing to sell the token. This value is provided in the smallest unit of the token (e.g., wei for Ethereum).
|
|
192
|
+
*/
|
|
193
|
+
amount: string;
|
|
194
|
+
};
|
|
195
|
+
|
|
196
|
+
type ERC721Item$1 = {
|
|
197
|
+
/**
|
|
198
|
+
* Token type user is offering, which in this case is ERC721
|
|
199
|
+
*/
|
|
200
|
+
type: 'ERC721';
|
|
201
|
+
/**
|
|
202
|
+
* Address of ERC721 token
|
|
203
|
+
*/
|
|
204
|
+
contract_address: string;
|
|
205
|
+
/**
|
|
206
|
+
* ID of ERC721 token
|
|
207
|
+
*/
|
|
208
|
+
token_id: string;
|
|
209
|
+
};
|
|
210
|
+
|
|
211
|
+
type NativeItem$1 = {
|
|
212
|
+
/**
|
|
213
|
+
* Token type user is offering, which in this case is the native IMX token
|
|
214
|
+
*/
|
|
215
|
+
type: 'NATIVE';
|
|
216
|
+
/**
|
|
217
|
+
* A string representing the price at which the user is willing to sell the token. This value is provided in the smallest unit of the token (e.g., wei for Ethereum).
|
|
218
|
+
*/
|
|
219
|
+
amount: string;
|
|
220
|
+
};
|
|
221
|
+
|
|
222
|
+
type Item = (NativeItem$1 | ERC20Item$1 | ERC721Item$1 | ERC1155Item$1);
|
|
223
|
+
|
|
224
|
+
type ProtocolData = {
|
|
225
|
+
/**
|
|
226
|
+
* Seaport order type. Orders containing ERC721 tokens will need to pass in the order type as FULL_RESTRICTED while orders with ERC1155 tokens will need to pass in the order_type as PARTIAL_RESTRICTED
|
|
227
|
+
*/
|
|
228
|
+
order_type: ProtocolData.order_type;
|
|
229
|
+
/**
|
|
230
|
+
* big.Int or uint256 string for order counter
|
|
231
|
+
*/
|
|
232
|
+
counter: string;
|
|
233
|
+
/**
|
|
234
|
+
* Immutable zone address
|
|
235
|
+
*/
|
|
236
|
+
zone_address: string;
|
|
237
|
+
/**
|
|
238
|
+
* Immutable Seaport contract address
|
|
239
|
+
*/
|
|
240
|
+
seaport_address: string;
|
|
241
|
+
/**
|
|
242
|
+
* Immutable Seaport contract version
|
|
243
|
+
*/
|
|
244
|
+
seaport_version: string;
|
|
245
|
+
};
|
|
246
|
+
declare namespace ProtocolData {
|
|
247
|
+
/**
|
|
248
|
+
* Seaport order type. Orders containing ERC721 tokens will need to pass in the order type as FULL_RESTRICTED while orders with ERC1155 tokens will need to pass in the order_type as PARTIAL_RESTRICTED
|
|
249
|
+
*/
|
|
250
|
+
enum order_type {
|
|
251
|
+
FULL_RESTRICTED = "FULL_RESTRICTED",
|
|
252
|
+
PARTIAL_RESTRICTED = "PARTIAL_RESTRICTED"
|
|
253
|
+
}
|
|
254
|
+
}
|
|
255
|
+
|
|
256
|
+
type CreateListingRequestBody = {
|
|
257
|
+
account_address: string;
|
|
258
|
+
order_hash: string;
|
|
259
|
+
/**
|
|
260
|
+
* Buy item for listing should either be NATIVE or ERC20 item
|
|
261
|
+
*/
|
|
262
|
+
buy: Array<Item>;
|
|
263
|
+
/**
|
|
264
|
+
* Buy fees should only include maker marketplace fees and should be no more than two entries as more entires will incur more gas. It is best practice to have this as few as possible.
|
|
265
|
+
*/
|
|
266
|
+
fees: Array<Fee$1>;
|
|
267
|
+
/**
|
|
268
|
+
* Time after which the Order is considered expired
|
|
269
|
+
*/
|
|
270
|
+
end_at: string;
|
|
271
|
+
protocol_data: ProtocolData;
|
|
272
|
+
/**
|
|
273
|
+
* A random value added to the create Order request
|
|
274
|
+
*/
|
|
275
|
+
salt: string;
|
|
276
|
+
/**
|
|
277
|
+
* Sell item for listing should be an ERC721 item
|
|
278
|
+
*/
|
|
279
|
+
sell: Array<Item>;
|
|
280
|
+
/**
|
|
281
|
+
* Digital signature generated by the user for the specific Order
|
|
282
|
+
*/
|
|
283
|
+
signature: string;
|
|
284
|
+
/**
|
|
285
|
+
* Time after which Order is considered active
|
|
286
|
+
*/
|
|
287
|
+
start_at: string;
|
|
288
|
+
};
|
|
289
|
+
|
|
290
|
+
/**
|
|
291
|
+
* The chain details
|
|
292
|
+
*/
|
|
293
|
+
type Chain = {
|
|
294
|
+
/**
|
|
295
|
+
* The id of chain
|
|
296
|
+
*/
|
|
297
|
+
id: string;
|
|
298
|
+
/**
|
|
299
|
+
* The name of chain
|
|
300
|
+
*/
|
|
301
|
+
name: string;
|
|
302
|
+
};
|
|
303
|
+
|
|
304
|
+
/**
|
|
305
|
+
* The ratio of the order that has been filled, an order that has been fully filled will have the same numerator and denominator values.
|
|
306
|
+
*/
|
|
307
|
+
type FillStatus = {
|
|
308
|
+
/**
|
|
309
|
+
* The numerator of the fill status
|
|
310
|
+
*/
|
|
311
|
+
numerator: string;
|
|
312
|
+
/**
|
|
313
|
+
* The denominator of the fill status
|
|
314
|
+
*/
|
|
315
|
+
denominator: string;
|
|
316
|
+
};
|
|
317
|
+
|
|
318
|
+
type ActiveOrderStatus = {
|
|
319
|
+
/**
|
|
320
|
+
* The order status that indicates an order can be fulfilled.
|
|
321
|
+
*/
|
|
322
|
+
name: 'ACTIVE';
|
|
323
|
+
};
|
|
324
|
+
|
|
325
|
+
type CancelledOrderStatus = {
|
|
326
|
+
/**
|
|
327
|
+
* The order status indicating a order is has been cancelled or about to be cancelled.
|
|
328
|
+
*/
|
|
329
|
+
name: 'CANCELLED';
|
|
330
|
+
/**
|
|
331
|
+
* Whether the cancellation of the order is pending
|
|
332
|
+
*/
|
|
333
|
+
pending: boolean;
|
|
334
|
+
/**
|
|
335
|
+
* Whether the cancellation was done on-chain or off-chain or as a result of an underfunded account
|
|
336
|
+
*/
|
|
337
|
+
cancellation_type: CancelledOrderStatus.cancellation_type;
|
|
338
|
+
};
|
|
339
|
+
declare namespace CancelledOrderStatus {
|
|
340
|
+
/**
|
|
341
|
+
* Whether the cancellation was done on-chain or off-chain or as a result of an underfunded account
|
|
342
|
+
*/
|
|
343
|
+
enum cancellation_type {
|
|
344
|
+
ON_CHAIN = "ON_CHAIN",
|
|
345
|
+
OFF_CHAIN = "OFF_CHAIN",
|
|
346
|
+
UNDERFUNDED = "UNDERFUNDED"
|
|
347
|
+
}
|
|
348
|
+
}
|
|
349
|
+
|
|
350
|
+
type ExpiredOrderStatus = {
|
|
351
|
+
/**
|
|
352
|
+
* A terminal order status indicating that an order cannot be fulfilled due to expiry.
|
|
353
|
+
*/
|
|
354
|
+
name: 'EXPIRED';
|
|
355
|
+
};
|
|
356
|
+
|
|
357
|
+
type FilledOrderStatus = {
|
|
358
|
+
/**
|
|
359
|
+
* A terminal order status indicating that an order has been fulfilled.
|
|
360
|
+
*/
|
|
361
|
+
name: 'FILLED';
|
|
362
|
+
};
|
|
363
|
+
|
|
364
|
+
type InactiveOrderStatus = {
|
|
365
|
+
/**
|
|
366
|
+
* The order status that indicates an order cannot be fulfilled.
|
|
367
|
+
*/
|
|
368
|
+
name: 'INACTIVE';
|
|
369
|
+
/**
|
|
370
|
+
* Whether the order offerer has sufficient approvals
|
|
371
|
+
*/
|
|
372
|
+
sufficient_approvals: boolean;
|
|
373
|
+
/**
|
|
374
|
+
* Whether the order offerer still has sufficient balance to complete the order
|
|
375
|
+
*/
|
|
376
|
+
sufficient_balances: boolean;
|
|
377
|
+
};
|
|
378
|
+
|
|
379
|
+
type PendingOrderStatus = {
|
|
380
|
+
/**
|
|
381
|
+
* The order status that indicates the order is yet to be active due to various reasons.
|
|
382
|
+
*/
|
|
383
|
+
name: 'PENDING';
|
|
384
|
+
/**
|
|
385
|
+
* Whether the order has been evaluated after its creation
|
|
386
|
+
*/
|
|
387
|
+
evaluated: boolean;
|
|
388
|
+
/**
|
|
389
|
+
* Whether the order has reached its specified start time
|
|
390
|
+
*/
|
|
391
|
+
started: boolean;
|
|
392
|
+
};
|
|
393
|
+
|
|
394
|
+
/**
|
|
395
|
+
* The Order status
|
|
396
|
+
*/
|
|
397
|
+
type OrderStatus = (CancelledOrderStatus | PendingOrderStatus | ActiveOrderStatus | InactiveOrderStatus | FilledOrderStatus | ExpiredOrderStatus);
|
|
398
|
+
|
|
399
|
+
type Order$1 = {
|
|
400
|
+
account_address: string;
|
|
401
|
+
buy: Array<Item>;
|
|
402
|
+
fees: Array<Fee$1>;
|
|
403
|
+
chain: Chain;
|
|
404
|
+
/**
|
|
405
|
+
* Time the Order is created
|
|
406
|
+
*/
|
|
407
|
+
created_at: string;
|
|
408
|
+
/**
|
|
409
|
+
* Time after which the Order is considered expired
|
|
410
|
+
*/
|
|
411
|
+
end_at: string;
|
|
412
|
+
/**
|
|
413
|
+
* Global Order identifier
|
|
414
|
+
*/
|
|
415
|
+
id: string;
|
|
416
|
+
order_hash: string;
|
|
417
|
+
protocol_data: ProtocolData;
|
|
418
|
+
/**
|
|
419
|
+
* A random value added to the create Order request
|
|
420
|
+
*/
|
|
421
|
+
salt: string;
|
|
422
|
+
sell: Array<Item>;
|
|
423
|
+
/**
|
|
424
|
+
* Digital signature generated by the user for the specific Order
|
|
425
|
+
*/
|
|
426
|
+
signature: string;
|
|
427
|
+
/**
|
|
428
|
+
* Time after which Order is considered active
|
|
429
|
+
*/
|
|
430
|
+
start_at: string;
|
|
431
|
+
status: OrderStatus;
|
|
432
|
+
/**
|
|
433
|
+
* Order type
|
|
434
|
+
*/
|
|
435
|
+
type: Order$1.type;
|
|
436
|
+
/**
|
|
437
|
+
* Time the Order is last updated
|
|
438
|
+
*/
|
|
439
|
+
updated_at: string;
|
|
440
|
+
fill_status: FillStatus;
|
|
441
|
+
};
|
|
442
|
+
declare namespace Order$1 {
|
|
443
|
+
/**
|
|
444
|
+
* Order type
|
|
445
|
+
*/
|
|
446
|
+
enum type {
|
|
447
|
+
LISTING = "LISTING"
|
|
448
|
+
}
|
|
449
|
+
}
|
|
450
|
+
|
|
451
|
+
type FulfillableOrder = {
|
|
452
|
+
extra_data: string;
|
|
453
|
+
order: Order$1;
|
|
454
|
+
};
|
|
455
|
+
|
|
456
|
+
type FulfillmentDataRequest = {
|
|
457
|
+
order_id: string;
|
|
458
|
+
/**
|
|
459
|
+
* Address of the intended account fulfilling the order
|
|
460
|
+
*/
|
|
461
|
+
taker_address: string;
|
|
462
|
+
fees: Array<Fee$1>;
|
|
463
|
+
};
|
|
464
|
+
|
|
465
|
+
type ListingResult$1 = {
|
|
466
|
+
result: Order$1;
|
|
467
|
+
};
|
|
468
|
+
|
|
469
|
+
/**
|
|
470
|
+
* Pagination properties
|
|
471
|
+
*/
|
|
472
|
+
type Page$1 = {
|
|
473
|
+
/**
|
|
474
|
+
* First item as an encoded string
|
|
475
|
+
*/
|
|
476
|
+
previous_cursor: string | null;
|
|
477
|
+
/**
|
|
478
|
+
* Last item as an encoded string
|
|
479
|
+
*/
|
|
480
|
+
next_cursor: string | null;
|
|
481
|
+
};
|
|
482
|
+
|
|
483
|
+
type ListListingsResult$1 = {
|
|
484
|
+
page: Page$1;
|
|
485
|
+
result: Array<Order$1>;
|
|
486
|
+
};
|
|
487
|
+
|
|
488
|
+
/**
|
|
489
|
+
* The metadata related to the transaction in which the activity occurred
|
|
490
|
+
*/
|
|
491
|
+
type TradeBlockchainMetadata = {
|
|
492
|
+
/**
|
|
493
|
+
* The transaction hash of the trade
|
|
494
|
+
*/
|
|
495
|
+
transaction_hash: string;
|
|
496
|
+
/**
|
|
497
|
+
* EVM block number (uint64 as string)
|
|
498
|
+
*/
|
|
499
|
+
block_number: string;
|
|
500
|
+
/**
|
|
501
|
+
* Transaction index in a block (uint32 as string)
|
|
502
|
+
*/
|
|
503
|
+
transaction_index: string;
|
|
504
|
+
/**
|
|
505
|
+
* The log index of the fulfillment event in a block (uint32 as string)
|
|
506
|
+
*/
|
|
507
|
+
log_index: string;
|
|
508
|
+
};
|
|
509
|
+
|
|
510
|
+
type Trade$1 = {
|
|
511
|
+
buy: Array<Item>;
|
|
512
|
+
buyer_address: string;
|
|
513
|
+
buyer_fees: Array<Fee$1>;
|
|
514
|
+
chain: Chain;
|
|
515
|
+
order_id: string;
|
|
516
|
+
blockchain_metadata: TradeBlockchainMetadata;
|
|
517
|
+
/**
|
|
518
|
+
* Time the on-chain trade event is indexed by the order book system
|
|
519
|
+
*/
|
|
520
|
+
indexed_at: string;
|
|
521
|
+
/**
|
|
522
|
+
* Global Trade identifier
|
|
523
|
+
*/
|
|
524
|
+
id: string;
|
|
525
|
+
sell: Array<Item>;
|
|
526
|
+
seller_address: string;
|
|
527
|
+
maker_address: string;
|
|
528
|
+
taker_address: string;
|
|
529
|
+
};
|
|
530
|
+
|
|
531
|
+
type ListTradeResult = {
|
|
532
|
+
page: Page$1;
|
|
533
|
+
result: Array<Trade$1>;
|
|
534
|
+
};
|
|
535
|
+
|
|
536
|
+
/**
|
|
537
|
+
* The Order status
|
|
538
|
+
*/
|
|
539
|
+
declare enum OrderStatusName {
|
|
540
|
+
PENDING = "PENDING",
|
|
541
|
+
ACTIVE = "ACTIVE",
|
|
542
|
+
INACTIVE = "INACTIVE",
|
|
543
|
+
FILLED = "FILLED",
|
|
544
|
+
EXPIRED = "EXPIRED",
|
|
545
|
+
CANCELLED = "CANCELLED"
|
|
546
|
+
}
|
|
547
|
+
|
|
548
|
+
/**
|
|
549
|
+
* Encoded page cursor to retrieve previous or next page. Use the value returned in the response.
|
|
550
|
+
*/
|
|
551
|
+
type PageCursor = string;
|
|
552
|
+
|
|
553
|
+
/**
|
|
554
|
+
* Maximum number of items to return
|
|
555
|
+
*/
|
|
556
|
+
type PageSize = number;
|
|
557
|
+
|
|
558
|
+
type TradeResult$1 = {
|
|
559
|
+
result: Trade$1;
|
|
560
|
+
};
|
|
561
|
+
|
|
562
|
+
type UnfulfillableOrder$1 = {
|
|
563
|
+
/**
|
|
564
|
+
* OrderID for the requested but unfulfillable order
|
|
565
|
+
*/
|
|
566
|
+
order_id: string;
|
|
567
|
+
/**
|
|
568
|
+
* Nullable string containing error reason if the signing is unsuccessful for the order
|
|
569
|
+
*/
|
|
570
|
+
reason: string;
|
|
571
|
+
};
|
|
572
|
+
|
|
573
|
+
declare class OrdersService {
|
|
574
|
+
readonly httpRequest: BaseHttpRequest;
|
|
575
|
+
constructor(httpRequest: BaseHttpRequest);
|
|
576
|
+
/**
|
|
577
|
+
* Cancel one or more orders
|
|
578
|
+
* Cancel one or more orders
|
|
579
|
+
* @returns CancelOrdersResult Orders cancellation response.
|
|
580
|
+
* @throws ApiError
|
|
581
|
+
*/
|
|
582
|
+
cancelOrders({ chainName, requestBody, }: {
|
|
583
|
+
chainName: ChainName;
|
|
584
|
+
requestBody: CancelOrdersRequestBody;
|
|
585
|
+
}): CancelablePromise<CancelOrdersResult>;
|
|
586
|
+
/**
|
|
587
|
+
* List all listings
|
|
588
|
+
* List all listings
|
|
589
|
+
* @returns ListListingsResult OK response.
|
|
590
|
+
* @throws ApiError
|
|
591
|
+
*/
|
|
592
|
+
listListings({ chainName, status, sellItemContractAddress, buyItemType, buyItemContractAddress, accountAddress, sellItemMetadataId, sellItemTokenId, fromUpdatedAt, pageSize, sortBy, sortDirection, pageCursor, }: {
|
|
593
|
+
chainName: ChainName;
|
|
594
|
+
/**
|
|
595
|
+
* Order status to filter by
|
|
596
|
+
*/
|
|
597
|
+
status?: OrderStatusName;
|
|
598
|
+
/**
|
|
599
|
+
* Sell item contract address to filter by
|
|
600
|
+
*/
|
|
601
|
+
sellItemContractAddress?: string;
|
|
602
|
+
/**
|
|
603
|
+
* Buy item type to filter by
|
|
604
|
+
*/
|
|
605
|
+
buyItemType?: 'NATIVE' | 'ERC20';
|
|
606
|
+
/**
|
|
607
|
+
* Buy item contract address to filter by
|
|
608
|
+
*/
|
|
609
|
+
buyItemContractAddress?: string;
|
|
610
|
+
/**
|
|
611
|
+
* The account address of the user who created the listing
|
|
612
|
+
*/
|
|
613
|
+
accountAddress?: string;
|
|
614
|
+
/**
|
|
615
|
+
* The metadata_id of the sell item
|
|
616
|
+
*/
|
|
617
|
+
sellItemMetadataId?: string;
|
|
618
|
+
/**
|
|
619
|
+
* Sell item token identifier to filter by
|
|
620
|
+
*/
|
|
621
|
+
sellItemTokenId?: string;
|
|
622
|
+
/**
|
|
623
|
+
* From updated at including given date
|
|
624
|
+
*/
|
|
625
|
+
fromUpdatedAt?: string;
|
|
626
|
+
/**
|
|
627
|
+
* Maximum number of orders to return per page
|
|
628
|
+
*/
|
|
629
|
+
pageSize?: PageSize;
|
|
630
|
+
/**
|
|
631
|
+
* Order field to sort by. `buy_item_amount` sorts by per token price, for example if 5 ERC-1155s are on sale for 10eth, it’s sorted as 2eth for `buy_item_amount`.
|
|
632
|
+
*/
|
|
633
|
+
sortBy?: 'created_at' | 'updated_at' | 'buy_item_amount';
|
|
634
|
+
/**
|
|
635
|
+
* Ascending or descending direction for sort
|
|
636
|
+
*/
|
|
637
|
+
sortDirection?: 'asc' | 'desc';
|
|
638
|
+
/**
|
|
639
|
+
* Page cursor to retrieve previous or next page. Use the value returned in the response.
|
|
640
|
+
*/
|
|
641
|
+
pageCursor?: PageCursor;
|
|
642
|
+
}): CancelablePromise<ListListingsResult$1>;
|
|
643
|
+
/**
|
|
644
|
+
* Create a listing
|
|
645
|
+
* Create a listing
|
|
646
|
+
* @returns ListingResult Created response.
|
|
647
|
+
* @throws ApiError
|
|
648
|
+
*/
|
|
649
|
+
createListing({ chainName, requestBody, }: {
|
|
650
|
+
chainName: ChainName;
|
|
651
|
+
requestBody: CreateListingRequestBody;
|
|
652
|
+
}): CancelablePromise<ListingResult$1>;
|
|
653
|
+
/**
|
|
654
|
+
* Get a single listing by ID
|
|
655
|
+
* Get a single listing by ID
|
|
656
|
+
* @returns ListingResult OK response.
|
|
657
|
+
* @throws ApiError
|
|
658
|
+
*/
|
|
659
|
+
getListing({ chainName, listingId, }: {
|
|
660
|
+
chainName: ChainName;
|
|
661
|
+
/**
|
|
662
|
+
* Global Order identifier
|
|
663
|
+
*/
|
|
664
|
+
listingId: string;
|
|
665
|
+
}): CancelablePromise<ListingResult$1>;
|
|
666
|
+
/**
|
|
667
|
+
* Retrieve fulfillment data for orders
|
|
668
|
+
* Retrieve signed fulfillment data based on the list of order IDs and corresponding fees.
|
|
669
|
+
* @returns any Successful response
|
|
670
|
+
* @throws ApiError
|
|
671
|
+
*/
|
|
672
|
+
fulfillmentData({ chainName, requestBody, }: {
|
|
673
|
+
chainName: ChainName;
|
|
674
|
+
requestBody: Array<FulfillmentDataRequest>;
|
|
675
|
+
}): CancelablePromise<{
|
|
676
|
+
result: {
|
|
677
|
+
fulfillable_orders: Array<FulfillableOrder>;
|
|
678
|
+
unfulfillable_orders: Array<UnfulfillableOrder$1>;
|
|
679
|
+
};
|
|
680
|
+
}>;
|
|
681
|
+
/**
|
|
682
|
+
* List all trades
|
|
683
|
+
* List all trades
|
|
684
|
+
* @returns ListTradeResult OK response.
|
|
685
|
+
* @throws ApiError
|
|
686
|
+
*/
|
|
687
|
+
listTrades({ chainName, accountAddress, sellItemContractAddress, fromIndexedAt, pageSize, sortBy, sortDirection, pageCursor, }: {
|
|
688
|
+
chainName: ChainName;
|
|
689
|
+
accountAddress?: string;
|
|
690
|
+
sellItemContractAddress?: string;
|
|
691
|
+
/**
|
|
692
|
+
* From indexed at including given date
|
|
693
|
+
*/
|
|
694
|
+
fromIndexedAt?: string;
|
|
695
|
+
/**
|
|
696
|
+
* Maximum number of trades to return per page
|
|
697
|
+
*/
|
|
698
|
+
pageSize?: PageSize;
|
|
699
|
+
/**
|
|
700
|
+
* Trade field to sort by
|
|
701
|
+
*/
|
|
702
|
+
sortBy?: 'indexed_at';
|
|
703
|
+
/**
|
|
704
|
+
* Ascending or descending direction for sort
|
|
705
|
+
*/
|
|
706
|
+
sortDirection?: 'asc' | 'desc';
|
|
707
|
+
/**
|
|
708
|
+
* Page cursor to retrieve previous or next page. Use the value returned in the response.
|
|
709
|
+
*/
|
|
710
|
+
pageCursor?: PageCursor;
|
|
711
|
+
}): CancelablePromise<ListTradeResult>;
|
|
712
|
+
/**
|
|
713
|
+
* Get a single trade by ID
|
|
714
|
+
* Get a single trade by ID
|
|
715
|
+
* @returns TradeResult OK response.
|
|
716
|
+
* @throws ApiError
|
|
717
|
+
*/
|
|
718
|
+
getTrade({ chainName, tradeId, }: {
|
|
719
|
+
chainName: ChainName;
|
|
720
|
+
/**
|
|
721
|
+
* Global Trade identifier
|
|
722
|
+
*/
|
|
723
|
+
tradeId: string;
|
|
724
|
+
}): CancelablePromise<TradeResult$1>;
|
|
725
|
+
}
|
|
726
|
+
|
|
727
|
+
/**
|
|
728
|
+
* Any type that can be used where a numeric value is needed.
|
|
729
|
+
*/
|
|
730
|
+
type Numeric = number | bigint;
|
|
731
|
+
/**
|
|
732
|
+
* Any type that can be used where a big number is needed.
|
|
733
|
+
*/
|
|
734
|
+
type BigNumberish = string | Numeric;
|
|
735
|
+
|
|
736
|
+
declare enum OrderType {
|
|
737
|
+
FULL_OPEN = 0,// No partial fills, anyone can execute
|
|
738
|
+
PARTIAL_OPEN = 1,// Partial fills supported, anyone can execute
|
|
739
|
+
FULL_RESTRICTED = 2,// No partial fills, only offerer or zone can execute
|
|
740
|
+
PARTIAL_RESTRICTED = 3
|
|
741
|
+
}
|
|
742
|
+
declare enum ItemType {
|
|
743
|
+
NATIVE = 0,
|
|
744
|
+
ERC20 = 1,
|
|
745
|
+
ERC721 = 2,
|
|
746
|
+
ERC1155 = 3,
|
|
747
|
+
ERC721_WITH_CRITERIA = 4,
|
|
748
|
+
ERC1155_WITH_CRITERIA = 5
|
|
749
|
+
}
|
|
750
|
+
|
|
751
|
+
type OfferItem = {
|
|
752
|
+
itemType: ItemType;
|
|
753
|
+
token: string;
|
|
754
|
+
identifierOrCriteria: string;
|
|
755
|
+
startAmount: string;
|
|
756
|
+
endAmount: string;
|
|
757
|
+
};
|
|
758
|
+
type ConsiderationItem = {
|
|
759
|
+
itemType: ItemType;
|
|
760
|
+
token: string;
|
|
761
|
+
identifierOrCriteria: string;
|
|
762
|
+
startAmount: string;
|
|
763
|
+
endAmount: string;
|
|
764
|
+
recipient: string;
|
|
765
|
+
};
|
|
766
|
+
type OrderParameters = {
|
|
767
|
+
offerer: string;
|
|
768
|
+
zone: string;
|
|
769
|
+
orderType: OrderType;
|
|
770
|
+
startTime: BigNumberish;
|
|
771
|
+
endTime: BigNumberish;
|
|
772
|
+
zoneHash: string;
|
|
773
|
+
salt: string;
|
|
774
|
+
offer: OfferItem[];
|
|
775
|
+
consideration: ConsiderationItem[];
|
|
776
|
+
totalOriginalConsiderationItems: BigNumberish;
|
|
777
|
+
conduitKey: string;
|
|
778
|
+
};
|
|
779
|
+
type OrderComponents = OrderParameters & {
|
|
780
|
+
counter: BigNumberish;
|
|
781
|
+
};
|
|
782
|
+
|
|
783
|
+
interface ERC1155Item {
|
|
784
|
+
type: 'ERC1155';
|
|
785
|
+
contractAddress: string;
|
|
786
|
+
tokenId: string;
|
|
787
|
+
amount: string;
|
|
788
|
+
}
|
|
789
|
+
interface ERC721Item {
|
|
790
|
+
type: 'ERC721';
|
|
791
|
+
contractAddress: string;
|
|
792
|
+
tokenId: string;
|
|
793
|
+
}
|
|
794
|
+
interface ERC20Item {
|
|
795
|
+
type: 'ERC20';
|
|
796
|
+
contractAddress: string;
|
|
797
|
+
amount: string;
|
|
798
|
+
}
|
|
799
|
+
interface NativeItem {
|
|
800
|
+
type: 'NATIVE';
|
|
801
|
+
amount: string;
|
|
802
|
+
}
|
|
803
|
+
interface RoyaltyInfo {
|
|
804
|
+
recipient: string;
|
|
805
|
+
amountRequired: string;
|
|
806
|
+
}
|
|
807
|
+
interface PrepareListingParams {
|
|
808
|
+
makerAddress: string;
|
|
809
|
+
sell: ERC721Item | ERC1155Item;
|
|
810
|
+
buy: ERC20Item | NativeItem;
|
|
811
|
+
orderExpiry?: Date;
|
|
812
|
+
}
|
|
813
|
+
interface PrepareListingResponse {
|
|
814
|
+
actions: Action[];
|
|
815
|
+
orderComponents: OrderComponents;
|
|
816
|
+
orderHash: string;
|
|
817
|
+
}
|
|
818
|
+
interface PrepareBulkListingsParams {
|
|
819
|
+
makerAddress: string;
|
|
820
|
+
listingParams: {
|
|
821
|
+
sell: ERC721Item | ERC1155Item;
|
|
822
|
+
buy: ERC20Item | NativeItem;
|
|
823
|
+
makerFees: FeeValue[];
|
|
824
|
+
orderExpiry?: Date;
|
|
825
|
+
}[];
|
|
826
|
+
}
|
|
827
|
+
interface PrepareBulkListingsResponse {
|
|
828
|
+
actions: Action[];
|
|
829
|
+
completeListings: (signature: string) => Promise<BulkListingsResult>;
|
|
830
|
+
}
|
|
831
|
+
interface PrepareBulkSeaportOrders {
|
|
832
|
+
actions: Action[];
|
|
833
|
+
preparedListings: {
|
|
834
|
+
orderComponents: OrderComponents;
|
|
835
|
+
orderHash: string;
|
|
836
|
+
}[];
|
|
837
|
+
}
|
|
838
|
+
interface PrepareCancelOrdersResponse {
|
|
839
|
+
signableAction: SignableAction;
|
|
840
|
+
}
|
|
841
|
+
interface CreateListingParams {
|
|
842
|
+
orderComponents: OrderComponents;
|
|
843
|
+
orderHash: string;
|
|
844
|
+
orderSignature: string;
|
|
845
|
+
makerFees: FeeValue[];
|
|
846
|
+
}
|
|
847
|
+
type ListListingsParams = Omit<Parameters<typeof OrdersService.prototype.listListings>[0], 'chainName'>;
|
|
848
|
+
type ListTradesParams = Omit<Parameters<typeof OrdersService.prototype.listTrades>[0], 'chainName'>;
|
|
849
|
+
declare enum FeeType {
|
|
850
|
+
MAKER_ECOSYSTEM = "MAKER_ECOSYSTEM",
|
|
851
|
+
TAKER_ECOSYSTEM = "TAKER_ECOSYSTEM",
|
|
852
|
+
PROTOCOL = "PROTOCOL",
|
|
853
|
+
ROYALTY = "ROYALTY"
|
|
854
|
+
}
|
|
855
|
+
interface FeeValue {
|
|
856
|
+
recipientAddress: string;
|
|
857
|
+
amount: string;
|
|
858
|
+
}
|
|
859
|
+
interface Fee extends FeeValue {
|
|
860
|
+
type: FeeType;
|
|
861
|
+
}
|
|
862
|
+
declare enum TransactionPurpose {
|
|
863
|
+
APPROVAL = "APPROVAL",
|
|
864
|
+
FULFILL_ORDER = "FULFILL_ORDER",
|
|
865
|
+
CANCEL = "CANCEL"
|
|
866
|
+
}
|
|
867
|
+
declare enum SignablePurpose {
|
|
868
|
+
CREATE_LISTING = "CREATE_LISTING",
|
|
869
|
+
OFF_CHAIN_CANCELLATION = "OFF_CHAIN_CANCELLATION"
|
|
870
|
+
}
|
|
871
|
+
declare enum ActionType {
|
|
872
|
+
TRANSACTION = "TRANSACTION",
|
|
873
|
+
SIGNABLE = "SIGNABLE"
|
|
874
|
+
}
|
|
875
|
+
type TransactionBuilder = () => Promise<PopulatedTransaction>;
|
|
876
|
+
interface TransactionAction {
|
|
877
|
+
type: ActionType.TRANSACTION;
|
|
878
|
+
purpose: TransactionPurpose;
|
|
879
|
+
buildTransaction: TransactionBuilder;
|
|
880
|
+
}
|
|
881
|
+
interface SignableAction {
|
|
882
|
+
type: ActionType.SIGNABLE;
|
|
883
|
+
purpose: SignablePurpose;
|
|
884
|
+
message: {
|
|
885
|
+
domain: TypedDataDomain;
|
|
886
|
+
types: Record<string, TypedDataField[]>;
|
|
887
|
+
value: Record<string, any>;
|
|
888
|
+
};
|
|
889
|
+
}
|
|
890
|
+
type Action = TransactionAction | SignableAction;
|
|
891
|
+
interface FulfillmentListing {
|
|
892
|
+
listingId: string;
|
|
893
|
+
takerFees: Array<FeeValue>;
|
|
894
|
+
amountToFill?: string;
|
|
895
|
+
}
|
|
896
|
+
type FulfillBulkOrdersResponse = FulfillBulkOrdersInsufficientBalanceResponse | FulfillBulkOrdersSufficientBalanceResponse;
|
|
897
|
+
interface FulfillBulkOrdersSufficientBalanceResponse {
|
|
898
|
+
sufficientBalance: true;
|
|
899
|
+
actions: Action[];
|
|
900
|
+
expiration: string;
|
|
901
|
+
fulfillableOrders: Order[];
|
|
902
|
+
unfulfillableOrders: UnfulfillableOrder[];
|
|
903
|
+
}
|
|
904
|
+
interface FulfillBulkOrdersInsufficientBalanceResponse {
|
|
905
|
+
sufficientBalance: false;
|
|
906
|
+
fulfillableOrders: Order[];
|
|
907
|
+
unfulfillableOrders: UnfulfillableOrder[];
|
|
908
|
+
}
|
|
909
|
+
interface UnfulfillableOrder {
|
|
910
|
+
orderId: string;
|
|
911
|
+
reason: string;
|
|
912
|
+
}
|
|
913
|
+
interface FulfillOrderResponse {
|
|
914
|
+
actions: Action[];
|
|
915
|
+
/**
|
|
916
|
+
* User MUST submit the fulfillment transaction before the expiration
|
|
917
|
+
* Submitting after the expiration will result in a on chain revert
|
|
918
|
+
*/
|
|
919
|
+
expiration: string;
|
|
920
|
+
order: Order;
|
|
921
|
+
}
|
|
922
|
+
interface CancelOrdersOnChainResponse {
|
|
923
|
+
cancellationAction: TransactionAction;
|
|
924
|
+
}
|
|
925
|
+
interface Order {
|
|
926
|
+
id: string;
|
|
927
|
+
type: 'LISTING';
|
|
928
|
+
accountAddress: string;
|
|
929
|
+
buy: (ERC20Item | NativeItem)[];
|
|
930
|
+
sell: (ERC721Item | ERC1155Item)[];
|
|
931
|
+
fees: Fee[];
|
|
932
|
+
chain: {
|
|
933
|
+
id: string;
|
|
934
|
+
name: string;
|
|
935
|
+
};
|
|
936
|
+
createdAt: string;
|
|
937
|
+
updatedAt: string;
|
|
938
|
+
fillStatus: {
|
|
939
|
+
numerator: string;
|
|
940
|
+
denominator: string;
|
|
941
|
+
};
|
|
942
|
+
/**
|
|
943
|
+
* Time after which the Order is considered active
|
|
944
|
+
*/
|
|
945
|
+
startAt: string;
|
|
946
|
+
/**
|
|
947
|
+
* Time after which the Order is expired
|
|
948
|
+
*/
|
|
949
|
+
endAt: string;
|
|
950
|
+
orderHash: string;
|
|
951
|
+
protocolData: {
|
|
952
|
+
orderType: 'FULL_RESTRICTED' | 'PARTIAL_RESTRICTED';
|
|
953
|
+
zoneAddress: string;
|
|
954
|
+
counter: string;
|
|
955
|
+
seaportAddress: string;
|
|
956
|
+
seaportVersion: string;
|
|
957
|
+
};
|
|
958
|
+
salt: string;
|
|
959
|
+
signature: string;
|
|
960
|
+
status: OrderStatus;
|
|
961
|
+
}
|
|
962
|
+
interface ListingResult {
|
|
963
|
+
result: Order;
|
|
964
|
+
}
|
|
965
|
+
interface BulkListingsResult {
|
|
966
|
+
result: {
|
|
967
|
+
success: boolean;
|
|
968
|
+
orderHash: string;
|
|
969
|
+
order?: Order;
|
|
970
|
+
}[];
|
|
971
|
+
}
|
|
972
|
+
interface ListListingsResult {
|
|
973
|
+
page: Page;
|
|
974
|
+
result: Order[];
|
|
975
|
+
}
|
|
976
|
+
interface Page {
|
|
977
|
+
/**
|
|
978
|
+
* First item as an encoded string
|
|
979
|
+
*/
|
|
980
|
+
previousCursor: string | null;
|
|
981
|
+
/**
|
|
982
|
+
* Last item as an encoded string
|
|
983
|
+
*/
|
|
984
|
+
nextCursor: string | null;
|
|
985
|
+
}
|
|
986
|
+
interface Trade {
|
|
987
|
+
id: string;
|
|
988
|
+
orderId: string;
|
|
989
|
+
chain: {
|
|
990
|
+
id: string;
|
|
991
|
+
name: string;
|
|
992
|
+
};
|
|
993
|
+
buy: (ERC20Item | NativeItem)[];
|
|
994
|
+
sell: (ERC721Item | ERC1155Item)[];
|
|
995
|
+
buyerFees: Fee[];
|
|
996
|
+
sellerAddress: string;
|
|
997
|
+
buyerAddress: string;
|
|
998
|
+
makerAddress: string;
|
|
999
|
+
takerAddress: string;
|
|
1000
|
+
/**
|
|
1001
|
+
* Time the on-chain event was indexed by the Immutable order book service
|
|
1002
|
+
*/
|
|
1003
|
+
indexedAt: string;
|
|
1004
|
+
blockchainMetadata: {
|
|
1005
|
+
/**
|
|
1006
|
+
* The transaction hash of the trade
|
|
1007
|
+
*/
|
|
1008
|
+
transactionHash: string;
|
|
1009
|
+
/**
|
|
1010
|
+
* EVM block number (uint64 as string)
|
|
1011
|
+
*/
|
|
1012
|
+
blockNumber: string;
|
|
1013
|
+
/**
|
|
1014
|
+
* Transaction index in a block (uint32 as string)
|
|
1015
|
+
*/
|
|
1016
|
+
transactionIndex: string;
|
|
1017
|
+
/**
|
|
1018
|
+
* The log index of the fulfillment event in a block (uint32 as string)
|
|
1019
|
+
*/
|
|
1020
|
+
logIndex: string;
|
|
1021
|
+
};
|
|
1022
|
+
}
|
|
1023
|
+
interface TradeResult {
|
|
1024
|
+
result: Trade;
|
|
1025
|
+
}
|
|
1026
|
+
interface ListTradesResult {
|
|
1027
|
+
page: Page;
|
|
1028
|
+
result: Trade[];
|
|
1029
|
+
}
|
|
1030
|
+
|
|
1031
|
+
/**
|
|
1032
|
+
* zkEVM orderbook SDK
|
|
1033
|
+
* @constructor
|
|
1034
|
+
* @param {OrderbookModuleConfiguration} config - Configuration for Immutable services.
|
|
1035
|
+
*/
|
|
1036
|
+
declare class Orderbook {
|
|
1037
|
+
private apiClient;
|
|
1038
|
+
private seaport;
|
|
1039
|
+
private orderbookConfig;
|
|
1040
|
+
constructor(config: ModuleConfiguration<OrderbookOverrides>);
|
|
1041
|
+
/**
|
|
1042
|
+
* Return the configuration for the orderbook module.
|
|
1043
|
+
* @return {OrderbookModuleConfiguration} The configuration for the orderbook module.
|
|
1044
|
+
*/
|
|
1045
|
+
config(): OrderbookModuleConfiguration;
|
|
1046
|
+
/**
|
|
1047
|
+
* Get an order by ID
|
|
1048
|
+
* @param {string} listingId - The listingId to find.
|
|
1049
|
+
* @return {ListingResult} The returned order result.
|
|
1050
|
+
*/
|
|
1051
|
+
getListing(listingId: string): Promise<ListingResult>;
|
|
1052
|
+
/**
|
|
1053
|
+
* Get a trade by ID
|
|
1054
|
+
* @param {string} tradeId - The tradeId to find.
|
|
1055
|
+
* @return {TradeResult} The returned order result.
|
|
1056
|
+
*/
|
|
1057
|
+
getTrade(tradeId: string): Promise<TradeResult>;
|
|
1058
|
+
/**
|
|
1059
|
+
* List orders. This method is used to get a list of orders filtered by conditions specified
|
|
1060
|
+
* in the params object.
|
|
1061
|
+
* @param {ListListingsParams} listOrderParams - Filtering, ordering and page parameters.
|
|
1062
|
+
* @return {ListListingsResult} The paged orders.
|
|
1063
|
+
*/
|
|
1064
|
+
listListings(listOrderParams: ListListingsParams): Promise<ListListingsResult>;
|
|
1065
|
+
/**
|
|
1066
|
+
* List trades. This method is used to get a list of trades filtered by conditions specified
|
|
1067
|
+
* in the params object
|
|
1068
|
+
* @param {ListTradesParams} listTradesParams - Filtering, ordering and page parameters.
|
|
1069
|
+
* @return {ListTradesResult} The paged trades.
|
|
1070
|
+
*/
|
|
1071
|
+
listTrades(listTradesParams: ListTradesParams): Promise<ListTradesResult>;
|
|
1072
|
+
/**
|
|
1073
|
+
* Get required transactions and messages for signing to facilitate creating bulk listings.
|
|
1074
|
+
* Once the transactions are submitted and the message signed, call the completeListings method
|
|
1075
|
+
* provided in the return type with the signature. This method supports up to 20 listing creations
|
|
1076
|
+
* at a time. It can also be used for individual listings to simplify integration code paths.
|
|
1077
|
+
* @param {PrepareBulkListingsParams} prepareBulkListingsParams - Details about the listings
|
|
1078
|
+
* to be created.
|
|
1079
|
+
* @return {PrepareBulkListingsResponse} PrepareListingResponse includes
|
|
1080
|
+
* any unsigned approval transactions, the typed bulk order message for signing and
|
|
1081
|
+
* the createListings method that can be called with the signature to create the listings.
|
|
1082
|
+
*/
|
|
1083
|
+
prepareBulkListings({ makerAddress, listingParams, }: PrepareBulkListingsParams): Promise<PrepareBulkListingsResponse>;
|
|
1084
|
+
/**
|
|
1085
|
+
* Get required transactions and messages for signing prior to creating a listing
|
|
1086
|
+
* through the createListing method
|
|
1087
|
+
* @param {PrepareListingParams} prepareListingParams - Details about the listing to be created.
|
|
1088
|
+
* @return {PrepareListingResponse} PrepareListingResponse includes
|
|
1089
|
+
* the unsigned approval transaction, the typed order message for signing and
|
|
1090
|
+
* the order components that can be submitted to `createListing` with a signature.
|
|
1091
|
+
*/
|
|
1092
|
+
prepareListing({ makerAddress, sell, buy, orderExpiry, }: PrepareListingParams): Promise<PrepareListingResponse>;
|
|
1093
|
+
/**
|
|
1094
|
+
* Create an order
|
|
1095
|
+
* @param {CreateListingParams} createListingParams - create an order with the given params.
|
|
1096
|
+
* @return {ListingResult} The result of the order created in the Immutable services.
|
|
1097
|
+
*/
|
|
1098
|
+
createListing(createListingParams: CreateListingParams): Promise<ListingResult>;
|
|
1099
|
+
/**
|
|
1100
|
+
* Get unsigned transactions that can be submitted to fulfil an open order. If the approval
|
|
1101
|
+
* transaction exists it must be signed and submitted to the chain before the fulfilment
|
|
1102
|
+
* transaction can be submitted or it will be reverted.
|
|
1103
|
+
* @param {string} listingId - The listingId to fulfil.
|
|
1104
|
+
* @param {string} takerAddress - The address of the account fulfilling the order.
|
|
1105
|
+
* @param {FeeValue[]} takerFees - Taker ecosystem fees to be paid.
|
|
1106
|
+
* @param {string} amountToFill - Amount of the order to fill, defaults to sell item amount.
|
|
1107
|
+
* Only applies to ERC1155 orders
|
|
1108
|
+
* @return {FulfillOrderResponse} Approval and fulfilment transactions.
|
|
1109
|
+
*/
|
|
1110
|
+
fulfillOrder(listingId: string, takerAddress: string, takerFees: FeeValue[], amountToFill?: string): Promise<FulfillOrderResponse>;
|
|
1111
|
+
/**
|
|
1112
|
+
* Get unsigned transactions that can be submitted to fulfil multiple open orders. If approval
|
|
1113
|
+
* transactions exist, they must be signed and submitted to the chain before the fulfilment
|
|
1114
|
+
* transaction can be submitted or it will be reverted.
|
|
1115
|
+
* @param {Array<FulfillmentListing>} listings - The details of the listings to fulfil, amounts
|
|
1116
|
+
* to fill and taker ecosystem fees to be paid.
|
|
1117
|
+
* @param {string} takerAddress - The address of the account fulfilling the order.
|
|
1118
|
+
* @return {FulfillBulkOrdersResponse} Approval and fulfilment transactions.
|
|
1119
|
+
*/
|
|
1120
|
+
fulfillBulkOrders(listings: Array<FulfillmentListing>, takerAddress: string): Promise<FulfillBulkOrdersResponse>;
|
|
1121
|
+
/**
|
|
1122
|
+
* Cancelling orders is a gasless alternative to on-chain cancellation exposed with
|
|
1123
|
+
* `cancelOrdersOnChain`. For the orderbook to authenticate the cancellation, the creator
|
|
1124
|
+
* of the orders must sign an EIP712 message containing the orderIds
|
|
1125
|
+
* @param {string} orderIds - The orderIds to attempt to cancel.
|
|
1126
|
+
* @return {PrepareCancelOrdersResponse} The signable action to cancel the orders.
|
|
1127
|
+
*/
|
|
1128
|
+
prepareOrderCancellations(orderIds: string[]): Promise<PrepareCancelOrdersResponse>;
|
|
1129
|
+
/**
|
|
1130
|
+
* Cancelling orders is a gasless alternative to on-chain cancellation exposed with
|
|
1131
|
+
* `cancelOrdersOnChain`. Orders cancelled this way cannot be fulfilled and will be removed
|
|
1132
|
+
* from the orderbook. If there is pending fulfillment data outstanding for the order, its
|
|
1133
|
+
* cancellation will be pending until the fulfillment window has passed.
|
|
1134
|
+
* `prepareOffchainOrderCancellations` can be used to get the signable action that is signed
|
|
1135
|
+
* to get the signature required for this call.
|
|
1136
|
+
* @param {string[]} orderIds - The orderIds to attempt to cancel.
|
|
1137
|
+
* @param {string} accountAddress - The address of the account cancelling the orders.
|
|
1138
|
+
* @param {string} accountAddress - The address of the account cancelling the orders.
|
|
1139
|
+
* @return {CancelOrdersResult} The result of the off-chain cancellation request
|
|
1140
|
+
*/
|
|
1141
|
+
cancelOrders(orderIds: string[], accountAddress: string, signature: string): Promise<CancelOrdersResult>;
|
|
1142
|
+
/**
|
|
1143
|
+
* Get an unsigned order cancellation transaction. Orders can only be cancelled by
|
|
1144
|
+
* the account that created them. All of the orders must be from the same seaport contract.
|
|
1145
|
+
* If trying to cancel orders from multiple seaport contracts, group the orderIds by seaport
|
|
1146
|
+
* contract and call this method for each group.
|
|
1147
|
+
* @param {string[]} orderIds - The orderIds to cancel.
|
|
1148
|
+
* @param {string} accountAddress - The address of the account cancelling the order.
|
|
1149
|
+
* @return {CancelOrdersOnChainResponse} The unsigned cancel order action
|
|
1150
|
+
*/
|
|
1151
|
+
cancelOrdersOnChain(orderIds: string[], accountAddress: string): Promise<CancelOrdersOnChainResponse>;
|
|
1152
|
+
}
|
|
1153
|
+
|
|
1154
|
+
declare const constants: {
|
|
1155
|
+
estimatedFulfillmentGasGwei: number;
|
|
1156
|
+
};
|
|
1157
|
+
|
|
1158
|
+
type orderbook_d_Action = Action;
|
|
1159
|
+
type orderbook_d_ActionType = ActionType;
|
|
1160
|
+
declare const orderbook_d_ActionType: typeof ActionType;
|
|
1161
|
+
type orderbook_d_BulkListingsResult = BulkListingsResult;
|
|
1162
|
+
type orderbook_d_CancelOrdersOnChainResponse = CancelOrdersOnChainResponse;
|
|
1163
|
+
type orderbook_d_CreateListingParams = CreateListingParams;
|
|
1164
|
+
type orderbook_d_ERC1155Item = ERC1155Item;
|
|
1165
|
+
type orderbook_d_ERC20Item = ERC20Item;
|
|
1166
|
+
type orderbook_d_ERC721Item = ERC721Item;
|
|
1167
|
+
type orderbook_d_Fee = Fee;
|
|
1168
|
+
type orderbook_d_FeeType = FeeType;
|
|
1169
|
+
declare const orderbook_d_FeeType: typeof FeeType;
|
|
1170
|
+
type orderbook_d_FeeValue = FeeValue;
|
|
1171
|
+
type orderbook_d_FulfillBulkOrdersInsufficientBalanceResponse = FulfillBulkOrdersInsufficientBalanceResponse;
|
|
1172
|
+
type orderbook_d_FulfillBulkOrdersResponse = FulfillBulkOrdersResponse;
|
|
1173
|
+
type orderbook_d_FulfillBulkOrdersSufficientBalanceResponse = FulfillBulkOrdersSufficientBalanceResponse;
|
|
1174
|
+
type orderbook_d_FulfillOrderResponse = FulfillOrderResponse;
|
|
1175
|
+
type orderbook_d_FulfillmentListing = FulfillmentListing;
|
|
1176
|
+
type orderbook_d_ListListingsParams = ListListingsParams;
|
|
1177
|
+
type orderbook_d_ListListingsResult = ListListingsResult;
|
|
1178
|
+
type orderbook_d_ListTradesParams = ListTradesParams;
|
|
1179
|
+
type orderbook_d_ListTradesResult = ListTradesResult;
|
|
1180
|
+
type orderbook_d_ListingResult = ListingResult;
|
|
1181
|
+
type orderbook_d_NativeItem = NativeItem;
|
|
1182
|
+
type orderbook_d_Order = Order;
|
|
1183
|
+
type orderbook_d_OrderStatusName = OrderStatusName;
|
|
1184
|
+
declare const orderbook_d_OrderStatusName: typeof OrderStatusName;
|
|
1185
|
+
type orderbook_d_Orderbook = Orderbook;
|
|
1186
|
+
declare const orderbook_d_Orderbook: typeof Orderbook;
|
|
1187
|
+
type orderbook_d_OrderbookModuleConfiguration = OrderbookModuleConfiguration;
|
|
1188
|
+
type orderbook_d_OrderbookOverrides = OrderbookOverrides;
|
|
1189
|
+
type orderbook_d_Page = Page;
|
|
1190
|
+
type orderbook_d_PrepareBulkListingsParams = PrepareBulkListingsParams;
|
|
1191
|
+
type orderbook_d_PrepareBulkListingsResponse = PrepareBulkListingsResponse;
|
|
1192
|
+
type orderbook_d_PrepareBulkSeaportOrders = PrepareBulkSeaportOrders;
|
|
1193
|
+
type orderbook_d_PrepareCancelOrdersResponse = PrepareCancelOrdersResponse;
|
|
1194
|
+
type orderbook_d_PrepareListingParams = PrepareListingParams;
|
|
1195
|
+
type orderbook_d_PrepareListingResponse = PrepareListingResponse;
|
|
1196
|
+
type orderbook_d_RoyaltyInfo = RoyaltyInfo;
|
|
1197
|
+
type orderbook_d_SignableAction = SignableAction;
|
|
1198
|
+
type orderbook_d_SignablePurpose = SignablePurpose;
|
|
1199
|
+
declare const orderbook_d_SignablePurpose: typeof SignablePurpose;
|
|
1200
|
+
type orderbook_d_Trade = Trade;
|
|
1201
|
+
type orderbook_d_TradeResult = TradeResult;
|
|
1202
|
+
type orderbook_d_TransactionAction = TransactionAction;
|
|
1203
|
+
type orderbook_d_TransactionBuilder = TransactionBuilder;
|
|
1204
|
+
type orderbook_d_TransactionPurpose = TransactionPurpose;
|
|
1205
|
+
declare const orderbook_d_TransactionPurpose: typeof TransactionPurpose;
|
|
1206
|
+
type orderbook_d_UnfulfillableOrder = UnfulfillableOrder;
|
|
1207
|
+
declare const orderbook_d_constants: typeof constants;
|
|
1208
|
+
declare namespace orderbook_d {
|
|
1209
|
+
export {
|
|
1210
|
+
orderbook_d_Action as Action,
|
|
1211
|
+
orderbook_d_ActionType as ActionType,
|
|
1212
|
+
orderbook_d_BulkListingsResult as BulkListingsResult,
|
|
1213
|
+
orderbook_d_CancelOrdersOnChainResponse as CancelOrdersOnChainResponse,
|
|
1214
|
+
orderbook_d_CreateListingParams as CreateListingParams,
|
|
1215
|
+
orderbook_d_ERC1155Item as ERC1155Item,
|
|
1216
|
+
orderbook_d_ERC20Item as ERC20Item,
|
|
1217
|
+
orderbook_d_ERC721Item as ERC721Item,
|
|
1218
|
+
orderbook_d_Fee as Fee,
|
|
1219
|
+
orderbook_d_FeeType as FeeType,
|
|
1220
|
+
orderbook_d_FeeValue as FeeValue,
|
|
1221
|
+
orderbook_d_FulfillBulkOrdersInsufficientBalanceResponse as FulfillBulkOrdersInsufficientBalanceResponse,
|
|
1222
|
+
orderbook_d_FulfillBulkOrdersResponse as FulfillBulkOrdersResponse,
|
|
1223
|
+
orderbook_d_FulfillBulkOrdersSufficientBalanceResponse as FulfillBulkOrdersSufficientBalanceResponse,
|
|
1224
|
+
orderbook_d_FulfillOrderResponse as FulfillOrderResponse,
|
|
1225
|
+
orderbook_d_FulfillmentListing as FulfillmentListing,
|
|
1226
|
+
orderbook_d_ListListingsParams as ListListingsParams,
|
|
1227
|
+
orderbook_d_ListListingsResult as ListListingsResult,
|
|
1228
|
+
orderbook_d_ListTradesParams as ListTradesParams,
|
|
1229
|
+
orderbook_d_ListTradesResult as ListTradesResult,
|
|
1230
|
+
orderbook_d_ListingResult as ListingResult,
|
|
1231
|
+
orderbook_d_NativeItem as NativeItem,
|
|
1232
|
+
orderbook_d_Order as Order,
|
|
1233
|
+
orderbook_d_OrderStatusName as OrderStatusName,
|
|
1234
|
+
orderbook_d_Orderbook as Orderbook,
|
|
1235
|
+
orderbook_d_OrderbookModuleConfiguration as OrderbookModuleConfiguration,
|
|
1236
|
+
orderbook_d_OrderbookOverrides as OrderbookOverrides,
|
|
1237
|
+
orderbook_d_Page as Page,
|
|
1238
|
+
orderbook_d_PrepareBulkListingsParams as PrepareBulkListingsParams,
|
|
1239
|
+
orderbook_d_PrepareBulkListingsResponse as PrepareBulkListingsResponse,
|
|
1240
|
+
orderbook_d_PrepareBulkSeaportOrders as PrepareBulkSeaportOrders,
|
|
1241
|
+
orderbook_d_PrepareCancelOrdersResponse as PrepareCancelOrdersResponse,
|
|
1242
|
+
orderbook_d_PrepareListingParams as PrepareListingParams,
|
|
1243
|
+
orderbook_d_PrepareListingResponse as PrepareListingResponse,
|
|
1244
|
+
orderbook_d_RoyaltyInfo as RoyaltyInfo,
|
|
1245
|
+
orderbook_d_SignableAction as SignableAction,
|
|
1246
|
+
orderbook_d_SignablePurpose as SignablePurpose,
|
|
1247
|
+
orderbook_d_Trade as Trade,
|
|
1248
|
+
orderbook_d_TradeResult as TradeResult,
|
|
1249
|
+
orderbook_d_TransactionAction as TransactionAction,
|
|
1250
|
+
orderbook_d_TransactionBuilder as TransactionBuilder,
|
|
1251
|
+
orderbook_d_TransactionPurpose as TransactionPurpose,
|
|
1252
|
+
orderbook_d_UnfulfillableOrder as UnfulfillableOrder,
|
|
1253
|
+
orderbook_d_constants as constants,
|
|
1254
|
+
};
|
|
1255
|
+
}
|
|
1256
|
+
|
|
1257
|
+
export { ActionType as A, BulkListingsResult as B, CreateListingParams as C, ListListingsResult as D, ERC1155Item as E, FeeType as F, Page as G, Trade as H, TradeResult as I, ListTradesResult as J, OrderStatusName as K, ListListingsParams as L, NativeItem as N, Orderbook as O, PrepareListingParams as P, RoyaltyInfo as R, SignablePurpose as S, TransactionPurpose as T, UnfulfillableOrder as U, OrderbookModuleConfiguration as a, OrderbookOverrides as b, constants as c, ERC721Item as d, ERC20Item as e, PrepareListingResponse as f, PrepareBulkListingsParams as g, PrepareBulkListingsResponse as h, PrepareBulkSeaportOrders as i, PrepareCancelOrdersResponse as j, ListTradesParams as k, FeeValue as l, Fee as m, TransactionBuilder as n, orderbook_d as o, TransactionAction as p, SignableAction as q, Action as r, FulfillmentListing as s, FulfillBulkOrdersResponse as t, FulfillBulkOrdersSufficientBalanceResponse as u, FulfillBulkOrdersInsufficientBalanceResponse as v, FulfillOrderResponse as w, CancelOrdersOnChainResponse as x, Order as y, ListingResult as z };
|