@imtbl/sdk 0.28.5-alpha.1 → 0.28.5-alpha.3

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.
@@ -1,1600 +0,0 @@
1
- /// <reference types="node" />
2
- declare enum Environment {
3
- PRODUCTION = "production",
4
- SANDBOX = "sandbox"
5
- }
6
- declare class ImmutableConfiguration {
7
- readonly environment: Environment;
8
- readonly rateLimitingKey?: string;
9
- readonly apiKey?: string;
10
- readonly clientAppId?: string;
11
- constructor(options: {
12
- environment: Environment;
13
- rateLimitingKey?: string;
14
- apiKey?: string;
15
- clientAppId?: string;
16
- });
17
- }
18
- interface ModuleConfiguration<T> {
19
- baseConfig: ImmutableConfiguration;
20
- overrides?: T;
21
- }
22
-
23
- declare type Bytes = ArrayLike<number>;
24
- declare type BytesLike = Bytes | string;
25
- interface Hexable {
26
- toHexString(): string;
27
- }
28
-
29
- declare type BigNumberish = BigNumber | Bytes | bigint | string | number;
30
- declare class BigNumber implements Hexable {
31
- readonly _hex: string;
32
- readonly _isBigNumber: boolean;
33
- constructor(constructorGuard: any, hex: string);
34
- fromTwos(value: number): BigNumber;
35
- toTwos(value: number): BigNumber;
36
- abs(): BigNumber;
37
- add(other: BigNumberish): BigNumber;
38
- sub(other: BigNumberish): BigNumber;
39
- div(other: BigNumberish): BigNumber;
40
- mul(other: BigNumberish): BigNumber;
41
- mod(other: BigNumberish): BigNumber;
42
- pow(other: BigNumberish): BigNumber;
43
- and(other: BigNumberish): BigNumber;
44
- or(other: BigNumberish): BigNumber;
45
- xor(other: BigNumberish): BigNumber;
46
- mask(value: number): BigNumber;
47
- shl(value: number): BigNumber;
48
- shr(value: number): BigNumber;
49
- eq(other: BigNumberish): boolean;
50
- lt(other: BigNumberish): boolean;
51
- lte(other: BigNumberish): boolean;
52
- gt(other: BigNumberish): boolean;
53
- gte(other: BigNumberish): boolean;
54
- isNegative(): boolean;
55
- isZero(): boolean;
56
- toNumber(): number;
57
- toBigInt(): bigint;
58
- toString(): string;
59
- toHexString(): string;
60
- toJSON(key?: string): any;
61
- static from(value: any): BigNumber;
62
- static isBigNumber(value: any): value is BigNumber;
63
- }
64
-
65
- declare type Deferrable<T> = {
66
- [K in keyof T]: T[K] | Promise<T[K]>;
67
- };
68
- declare class Description<T = any> {
69
- constructor(info: {
70
- [K in keyof T]: T[K];
71
- });
72
- }
73
-
74
- declare type Network = {
75
- name: string;
76
- chainId: number;
77
- ensAddress?: string;
78
- _defaultProvider?: (providers: any, options?: any) => any;
79
- };
80
- declare type Networkish = Network | string | number;
81
-
82
- declare type AccessList = Array<{
83
- address: string;
84
- storageKeys: Array<string>;
85
- }>;
86
- declare type AccessListish = AccessList | Array<[string, Array<string>]> | Record<string, Array<string>>;
87
- interface Transaction {
88
- hash?: string;
89
- to?: string;
90
- from?: string;
91
- nonce: number;
92
- gasLimit: BigNumber;
93
- gasPrice?: BigNumber;
94
- data: string;
95
- value: BigNumber;
96
- chainId: number;
97
- r?: string;
98
- s?: string;
99
- v?: number;
100
- type?: number | null;
101
- accessList?: AccessList;
102
- maxPriorityFeePerGas?: BigNumber;
103
- maxFeePerGas?: BigNumber;
104
- }
105
-
106
- declare type ConnectionInfo = {
107
- url: string;
108
- headers?: {
109
- [key: string]: string | number;
110
- };
111
- user?: string;
112
- password?: string;
113
- allowInsecureAuthentication?: boolean;
114
- allowGzip?: boolean;
115
- throttleLimit?: number;
116
- throttleSlotInterval?: number;
117
- throttleCallback?: (attempt: number, url: string) => Promise<boolean>;
118
- skipFetchSetup?: boolean;
119
- fetchOptions?: Record<string, string>;
120
- errorPassThrough?: boolean;
121
- timeout?: number;
122
- };
123
- interface OnceBlockable {
124
- once(eventName: "block", handler: () => void): void;
125
- }
126
-
127
- declare type TransactionRequest = {
128
- to?: string;
129
- from?: string;
130
- nonce?: BigNumberish;
131
- gasLimit?: BigNumberish;
132
- gasPrice?: BigNumberish;
133
- data?: BytesLike;
134
- value?: BigNumberish;
135
- chainId?: number;
136
- type?: number;
137
- accessList?: AccessListish;
138
- maxPriorityFeePerGas?: BigNumberish;
139
- maxFeePerGas?: BigNumberish;
140
- customData?: Record<string, any>;
141
- ccipReadEnabled?: boolean;
142
- };
143
- interface TransactionResponse extends Transaction {
144
- hash: string;
145
- blockNumber?: number;
146
- blockHash?: string;
147
- timestamp?: number;
148
- confirmations: number;
149
- from: string;
150
- raw?: string;
151
- wait: (confirmations?: number) => Promise<TransactionReceipt>;
152
- }
153
- declare type BlockTag = string | number;
154
- interface _Block {
155
- hash: string;
156
- parentHash: string;
157
- number: number;
158
- timestamp: number;
159
- nonce: string;
160
- difficulty: number;
161
- _difficulty: BigNumber;
162
- gasLimit: BigNumber;
163
- gasUsed: BigNumber;
164
- miner: string;
165
- extraData: string;
166
- baseFeePerGas?: null | BigNumber;
167
- }
168
- interface Block extends _Block {
169
- transactions: Array<string>;
170
- }
171
- interface BlockWithTransactions extends _Block {
172
- transactions: Array<TransactionResponse>;
173
- }
174
- interface Log {
175
- blockNumber: number;
176
- blockHash: string;
177
- transactionIndex: number;
178
- removed: boolean;
179
- address: string;
180
- data: string;
181
- topics: Array<string>;
182
- transactionHash: string;
183
- logIndex: number;
184
- }
185
- interface TransactionReceipt {
186
- to: string;
187
- from: string;
188
- contractAddress: string;
189
- transactionIndex: number;
190
- root?: string;
191
- gasUsed: BigNumber;
192
- logsBloom: string;
193
- blockHash: string;
194
- transactionHash: string;
195
- logs: Array<Log>;
196
- blockNumber: number;
197
- confirmations: number;
198
- cumulativeGasUsed: BigNumber;
199
- effectiveGasPrice: BigNumber;
200
- byzantium: boolean;
201
- type: number;
202
- status?: number;
203
- }
204
- interface FeeData {
205
- lastBaseFeePerGas: null | BigNumber;
206
- maxFeePerGas: null | BigNumber;
207
- maxPriorityFeePerGas: null | BigNumber;
208
- gasPrice: null | BigNumber;
209
- }
210
- interface EventFilter {
211
- address?: string;
212
- topics?: Array<string | Array<string> | null>;
213
- }
214
- interface Filter extends EventFilter {
215
- fromBlock?: BlockTag;
216
- toBlock?: BlockTag;
217
- }
218
- interface FilterByBlockHash extends EventFilter {
219
- blockHash?: string;
220
- }
221
- declare abstract class ForkEvent extends Description {
222
- readonly expiry: number;
223
- readonly _isForkEvent?: boolean;
224
- static isForkEvent(value: any): value is ForkEvent;
225
- }
226
- declare type EventType = string | Array<string | Array<string>> | EventFilter | ForkEvent;
227
- declare type Listener = (...args: Array<any>) => void;
228
- declare abstract class Provider implements OnceBlockable {
229
- abstract getNetwork(): Promise<Network>;
230
- abstract getBlockNumber(): Promise<number>;
231
- abstract getGasPrice(): Promise<BigNumber>;
232
- getFeeData(): Promise<FeeData>;
233
- abstract getBalance(addressOrName: string | Promise<string>, blockTag?: BlockTag | Promise<BlockTag>): Promise<BigNumber>;
234
- abstract getTransactionCount(addressOrName: string | Promise<string>, blockTag?: BlockTag | Promise<BlockTag>): Promise<number>;
235
- abstract getCode(addressOrName: string | Promise<string>, blockTag?: BlockTag | Promise<BlockTag>): Promise<string>;
236
- abstract getStorageAt(addressOrName: string | Promise<string>, position: BigNumberish | Promise<BigNumberish>, blockTag?: BlockTag | Promise<BlockTag>): Promise<string>;
237
- abstract sendTransaction(signedTransaction: string | Promise<string>): Promise<TransactionResponse>;
238
- abstract call(transaction: Deferrable<TransactionRequest>, blockTag?: BlockTag | Promise<BlockTag>): Promise<string>;
239
- abstract estimateGas(transaction: Deferrable<TransactionRequest>): Promise<BigNumber>;
240
- abstract getBlock(blockHashOrBlockTag: BlockTag | string | Promise<BlockTag | string>): Promise<Block>;
241
- abstract getBlockWithTransactions(blockHashOrBlockTag: BlockTag | string | Promise<BlockTag | string>): Promise<BlockWithTransactions>;
242
- abstract getTransaction(transactionHash: string): Promise<TransactionResponse>;
243
- abstract getTransactionReceipt(transactionHash: string): Promise<TransactionReceipt>;
244
- abstract getLogs(filter: Filter): Promise<Array<Log>>;
245
- abstract resolveName(name: string | Promise<string>): Promise<null | string>;
246
- abstract lookupAddress(address: string | Promise<string>): Promise<null | string>;
247
- abstract on(eventName: EventType, listener: Listener): Provider;
248
- abstract once(eventName: EventType, listener: Listener): Provider;
249
- abstract emit(eventName: EventType, ...args: Array<any>): boolean;
250
- abstract listenerCount(eventName?: EventType): number;
251
- abstract listeners(eventName?: EventType): Array<Listener>;
252
- abstract off(eventName: EventType, listener?: Listener): Provider;
253
- abstract removeAllListeners(eventName?: EventType): Provider;
254
- addListener(eventName: EventType, listener: Listener): Provider;
255
- removeListener(eventName: EventType, listener: Listener): Provider;
256
- abstract waitForTransaction(transactionHash: string, confirmations?: number, timeout?: number): Promise<TransactionReceipt>;
257
- readonly _isProvider: boolean;
258
- constructor();
259
- static isProvider(value: any): value is Provider;
260
- }
261
-
262
- interface TypedDataDomain {
263
- name?: string;
264
- version?: string;
265
- chainId?: BigNumberish;
266
- verifyingContract?: string;
267
- salt?: BytesLike;
268
- }
269
- interface TypedDataField {
270
- name: string;
271
- type: string;
272
- }
273
- interface TypedDataSigner {
274
- _signTypedData(domain: TypedDataDomain, types: Record<string, Array<TypedDataField>>, value: Record<string, any>): Promise<string>;
275
- }
276
- declare abstract class Signer {
277
- readonly provider?: Provider;
278
- abstract getAddress(): Promise<string>;
279
- abstract signMessage(message: Bytes | string): Promise<string>;
280
- abstract signTransaction(transaction: Deferrable<TransactionRequest>): Promise<string>;
281
- abstract connect(provider: Provider): Signer;
282
- readonly _isSigner: boolean;
283
- constructor();
284
- getBalance(blockTag?: BlockTag): Promise<BigNumber>;
285
- getTransactionCount(blockTag?: BlockTag): Promise<number>;
286
- estimateGas(transaction: Deferrable<TransactionRequest>): Promise<BigNumber>;
287
- call(transaction: Deferrable<TransactionRequest>, blockTag?: BlockTag): Promise<string>;
288
- sendTransaction(transaction: Deferrable<TransactionRequest>): Promise<TransactionResponse>;
289
- getChainId(): Promise<number>;
290
- getGasPrice(): Promise<BigNumber>;
291
- getFeeData(): Promise<FeeData>;
292
- resolveName(name: string): Promise<string>;
293
- checkTransaction(transaction: Deferrable<TransactionRequest>): Deferrable<TransactionRequest>;
294
- populateTransaction(transaction: Deferrable<TransactionRequest>): Promise<TransactionRequest>;
295
- _checkProvider(operation?: string): void;
296
- static isSigner(value: any): value is Signer;
297
- }
298
-
299
- interface PopulatedTransaction {
300
- to?: string;
301
- from?: string;
302
- nonce?: number;
303
- gasLimit?: BigNumber;
304
- gasPrice?: BigNumber;
305
- data?: string;
306
- value?: BigNumber;
307
- chainId?: number;
308
- type?: number;
309
- accessList?: AccessList;
310
- maxFeePerGas?: BigNumber;
311
- maxPriorityFeePerGas?: BigNumber;
312
- customData?: Record<string, any>;
313
- ccipReadEnabled?: boolean;
314
- }
315
-
316
- declare type FormatFunc = (value: any) => any;
317
- declare type FormatFuncs = {
318
- [key: string]: FormatFunc;
319
- };
320
- declare type Formats = {
321
- transaction: FormatFuncs;
322
- transactionRequest: FormatFuncs;
323
- receipt: FormatFuncs;
324
- receiptLog: FormatFuncs;
325
- block: FormatFuncs;
326
- blockWithTransactions: FormatFuncs;
327
- filter: FormatFuncs;
328
- filterLog: FormatFuncs;
329
- };
330
- declare class Formatter {
331
- readonly formats: Formats;
332
- constructor();
333
- getDefaultFormats(): Formats;
334
- accessList(accessList: Array<any>): AccessList;
335
- number(number: any): number;
336
- type(number: any): number;
337
- bigNumber(value: any): BigNumber;
338
- boolean(value: any): boolean;
339
- hex(value: any, strict?: boolean): string;
340
- data(value: any, strict?: boolean): string;
341
- address(value: any): string;
342
- callAddress(value: any): string;
343
- contractAddress(value: any): string;
344
- blockTag(blockTag: any): string;
345
- hash(value: any, strict?: boolean): string;
346
- difficulty(value: any): number;
347
- uint256(value: any): string;
348
- _block(value: any, format: any): Block;
349
- block(value: any): Block;
350
- blockWithTransactions(value: any): Block;
351
- transactionRequest(value: any): any;
352
- transactionResponse(transaction: any): TransactionResponse;
353
- transaction(value: any): any;
354
- receiptLog(value: any): any;
355
- receipt(value: any): TransactionReceipt;
356
- topics(value: any): any;
357
- filter(value: any): any;
358
- filterLog(value: any): any;
359
- static check(format: {
360
- [name: string]: FormatFunc;
361
- }, object: any): any;
362
- static allowNull(format: FormatFunc, nullValue?: any): FormatFunc;
363
- static allowFalsish(format: FormatFunc, replaceValue: any): FormatFunc;
364
- static arrayOf(format: FormatFunc): FormatFunc;
365
- }
366
-
367
- declare class Event {
368
- readonly listener: Listener;
369
- readonly once: boolean;
370
- readonly tag: string;
371
- _lastBlockNumber: number;
372
- _inflight: boolean;
373
- constructor(tag: string, listener: Listener, once: boolean);
374
- get event(): EventType;
375
- get type(): string;
376
- get hash(): string;
377
- get filter(): Filter;
378
- pollable(): boolean;
379
- }
380
- interface EnsResolver {
381
- readonly name: string;
382
- readonly address: string;
383
- getAddress(coinType?: 60): Promise<null | string>;
384
- getContentHash(): Promise<null | string>;
385
- getText(key: string): Promise<null | string>;
386
- }
387
- interface EnsProvider {
388
- resolveName(name: string): Promise<null | string>;
389
- lookupAddress(address: string): Promise<null | string>;
390
- getResolver(name: string): Promise<null | EnsResolver>;
391
- }
392
- interface Avatar {
393
- url: string;
394
- linkage: Array<{
395
- type: string;
396
- content: string;
397
- }>;
398
- }
399
- declare class Resolver$1 implements EnsResolver {
400
- readonly provider: BaseProvider;
401
- readonly name: string;
402
- readonly address: string;
403
- readonly _resolvedAddress: null | string;
404
- _supportsEip2544: null | Promise<boolean>;
405
- constructor(provider: BaseProvider, address: string, name: string, resolvedAddress?: string);
406
- supportsWildcard(): Promise<boolean>;
407
- _fetch(selector: string, parameters?: string): Promise<null | string>;
408
- _fetchBytes(selector: string, parameters?: string): Promise<null | string>;
409
- _getAddress(coinType: number, hexBytes: string): string;
410
- getAddress(coinType?: number): Promise<string>;
411
- getAvatar(): Promise<null | Avatar>;
412
- getContentHash(): Promise<string>;
413
- getText(key: string): Promise<string>;
414
- }
415
- declare class BaseProvider extends Provider implements EnsProvider {
416
- _networkPromise: Promise<Network>;
417
- _network: Network;
418
- _events: Array<Event>;
419
- formatter: Formatter;
420
- _emitted: {
421
- [eventName: string]: number | "pending";
422
- };
423
- _pollingInterval: number;
424
- _poller: NodeJS.Timer;
425
- _bootstrapPoll: NodeJS.Timer;
426
- _lastBlockNumber: number;
427
- _maxFilterBlockRange: number;
428
- _fastBlockNumber: number;
429
- _fastBlockNumberPromise: Promise<number>;
430
- _fastQueryDate: number;
431
- _maxInternalBlockNumber: number;
432
- _internalBlockNumber: Promise<{
433
- blockNumber: number;
434
- reqTime: number;
435
- respTime: number;
436
- }>;
437
- readonly anyNetwork: boolean;
438
- disableCcipRead: boolean;
439
- /**
440
- * ready
441
- *
442
- * A Promise<Network> that resolves only once the provider is ready.
443
- *
444
- * Sub-classes that call the super with a network without a chainId
445
- * MUST set this. Standard named networks have a known chainId.
446
- *
447
- */
448
- constructor(network: Networkish | Promise<Network>);
449
- _ready(): Promise<Network>;
450
- get ready(): Promise<Network>;
451
- static getFormatter(): Formatter;
452
- static getNetwork(network: Networkish): Network;
453
- ccipReadFetch(tx: Transaction, calldata: string, urls: Array<string>): Promise<null | string>;
454
- _getInternalBlockNumber(maxAge: number): Promise<number>;
455
- poll(): Promise<void>;
456
- resetEventsBlock(blockNumber: number): void;
457
- get network(): Network;
458
- detectNetwork(): Promise<Network>;
459
- getNetwork(): Promise<Network>;
460
- get blockNumber(): number;
461
- get polling(): boolean;
462
- set polling(value: boolean);
463
- get pollingInterval(): number;
464
- set pollingInterval(value: number);
465
- _getFastBlockNumber(): Promise<number>;
466
- _setFastBlockNumber(blockNumber: number): void;
467
- waitForTransaction(transactionHash: string, confirmations?: number, timeout?: number): Promise<TransactionReceipt>;
468
- _waitForTransaction(transactionHash: string, confirmations: number, timeout: number, replaceable: {
469
- data: string;
470
- from: string;
471
- nonce: number;
472
- to: string;
473
- value: BigNumber;
474
- startBlock: number;
475
- }): Promise<TransactionReceipt>;
476
- getBlockNumber(): Promise<number>;
477
- getGasPrice(): Promise<BigNumber>;
478
- getBalance(addressOrName: string | Promise<string>, blockTag?: BlockTag | Promise<BlockTag>): Promise<BigNumber>;
479
- getTransactionCount(addressOrName: string | Promise<string>, blockTag?: BlockTag | Promise<BlockTag>): Promise<number>;
480
- getCode(addressOrName: string | Promise<string>, blockTag?: BlockTag | Promise<BlockTag>): Promise<string>;
481
- getStorageAt(addressOrName: string | Promise<string>, position: BigNumberish | Promise<BigNumberish>, blockTag?: BlockTag | Promise<BlockTag>): Promise<string>;
482
- _wrapTransaction(tx: Transaction, hash?: string, startBlock?: number): TransactionResponse;
483
- sendTransaction(signedTransaction: string | Promise<string>): Promise<TransactionResponse>;
484
- _getTransactionRequest(transaction: Deferrable<TransactionRequest>): Promise<Transaction>;
485
- _getFilter(filter: Filter | FilterByBlockHash | Promise<Filter | FilterByBlockHash>): Promise<Filter | FilterByBlockHash>;
486
- _call(transaction: TransactionRequest, blockTag: BlockTag, attempt: number): Promise<string>;
487
- call(transaction: Deferrable<TransactionRequest>, blockTag?: BlockTag | Promise<BlockTag>): Promise<string>;
488
- estimateGas(transaction: Deferrable<TransactionRequest>): Promise<BigNumber>;
489
- _getAddress(addressOrName: string | Promise<string>): Promise<string>;
490
- _getBlock(blockHashOrBlockTag: BlockTag | string | Promise<BlockTag | string>, includeTransactions?: boolean): Promise<Block | BlockWithTransactions>;
491
- getBlock(blockHashOrBlockTag: BlockTag | string | Promise<BlockTag | string>): Promise<Block>;
492
- getBlockWithTransactions(blockHashOrBlockTag: BlockTag | string | Promise<BlockTag | string>): Promise<BlockWithTransactions>;
493
- getTransaction(transactionHash: string | Promise<string>): Promise<TransactionResponse>;
494
- getTransactionReceipt(transactionHash: string | Promise<string>): Promise<TransactionReceipt>;
495
- getLogs(filter: Filter | FilterByBlockHash | Promise<Filter | FilterByBlockHash>): Promise<Array<Log>>;
496
- getEtherPrice(): Promise<number>;
497
- _getBlockTag(blockTag: BlockTag | Promise<BlockTag>): Promise<BlockTag>;
498
- getResolver(name: string): Promise<null | Resolver$1>;
499
- _getResolver(name: string, operation?: string): Promise<string>;
500
- resolveName(name: string | Promise<string>): Promise<null | string>;
501
- lookupAddress(address: string | Promise<string>): Promise<null | string>;
502
- getAvatar(nameOrAddress: string): Promise<null | string>;
503
- perform(method: string, params: any): Promise<any>;
504
- _startEvent(event: Event): void;
505
- _stopEvent(event: Event): void;
506
- _addEventListener(eventName: EventType, listener: Listener, once: boolean): this;
507
- on(eventName: EventType, listener: Listener): this;
508
- once(eventName: EventType, listener: Listener): this;
509
- emit(eventName: EventType, ...args: Array<any>): boolean;
510
- listenerCount(eventName?: EventType): number;
511
- listeners(eventName?: EventType): Array<Listener>;
512
- off(eventName: EventType, listener?: Listener): this;
513
- removeAllListeners(eventName?: EventType): this;
514
- }
515
-
516
- declare class JsonRpcSigner extends Signer implements TypedDataSigner {
517
- readonly provider: JsonRpcProvider;
518
- _index: number;
519
- _address: string;
520
- constructor(constructorGuard: any, provider: JsonRpcProvider, addressOrIndex?: string | number);
521
- connect(provider: Provider): JsonRpcSigner;
522
- connectUnchecked(): JsonRpcSigner;
523
- getAddress(): Promise<string>;
524
- sendUncheckedTransaction(transaction: Deferrable<TransactionRequest>): Promise<string>;
525
- signTransaction(transaction: Deferrable<TransactionRequest>): Promise<string>;
526
- sendTransaction(transaction: Deferrable<TransactionRequest>): Promise<TransactionResponse>;
527
- signMessage(message: Bytes | string): Promise<string>;
528
- _legacySignMessage(message: Bytes | string): Promise<string>;
529
- _signTypedData(domain: TypedDataDomain, types: Record<string, Array<TypedDataField>>, value: Record<string, any>): Promise<string>;
530
- unlock(password: string): Promise<boolean>;
531
- }
532
- declare class UncheckedJsonRpcSigner extends JsonRpcSigner {
533
- sendTransaction(transaction: Deferrable<TransactionRequest>): Promise<TransactionResponse>;
534
- }
535
- declare class JsonRpcProvider extends BaseProvider {
536
- readonly connection: ConnectionInfo;
537
- _pendingFilter: Promise<number>;
538
- _nextId: number;
539
- _eventLoopCache: Record<string, Promise<any>>;
540
- get _cache(): Record<string, Promise<any>>;
541
- constructor(url?: ConnectionInfo | string, network?: Networkish);
542
- static defaultUrl(): string;
543
- detectNetwork(): Promise<Network>;
544
- _uncachedDetectNetwork(): Promise<Network>;
545
- getSigner(addressOrIndex?: string | number): JsonRpcSigner;
546
- getUncheckedSigner(addressOrIndex?: string | number): UncheckedJsonRpcSigner;
547
- listAccounts(): Promise<Array<string>>;
548
- send(method: string, params: Array<any>): Promise<any>;
549
- prepareRequest(method: string, params: any): [string, Array<any>];
550
- perform(method: string, params: any): Promise<any>;
551
- _startEvent(event: Event): void;
552
- _startPending(): void;
553
- _stopEvent(event: Event): void;
554
- static hexlifyTransaction(transaction: TransactionRequest, allowExtra?: {
555
- [key: string]: boolean;
556
- }): {
557
- [key: string]: string | AccessList;
558
- };
559
- }
560
-
561
- declare type ExternalProvider = {
562
- isMetaMask?: boolean;
563
- isStatus?: boolean;
564
- host?: string;
565
- path?: string;
566
- sendAsync?: (request: {
567
- method: string;
568
- params?: Array<any>;
569
- }, callback: (error: any, response: any) => void) => void;
570
- send?: (request: {
571
- method: string;
572
- params?: Array<any>;
573
- }, callback: (error: any, response: any) => void) => void;
574
- request?: (request: {
575
- method: string;
576
- params?: Array<any>;
577
- }) => Promise<any>;
578
- };
579
- declare type JsonRpcFetchFunc = (method: string, params?: Array<any>) => Promise<any>;
580
- declare class Web3Provider extends JsonRpcProvider {
581
- readonly provider: ExternalProvider;
582
- readonly jsonRpcFetchFunc: JsonRpcFetchFunc;
583
- constructor(provider: ExternalProvider | JsonRpcFetchFunc, network?: Networkish);
584
- send(method: string, params: Array<any>): Promise<any>;
585
- }
586
-
587
- interface OrderbookOverrides {
588
- provider?: JsonRpcProvider | Web3Provider;
589
- seaportContractAddress?: string;
590
- zoneContractAddress?: string;
591
- chainName?: string;
592
- apiEndpoint?: string;
593
- }
594
- interface OrderbookModuleConfiguration {
595
- seaportContractAddress: string;
596
- zoneContractAddress: string;
597
- apiEndpoint: string;
598
- chainName: string;
599
- provider: JsonRpcProvider | Web3Provider;
600
- }
601
-
602
- type ApiRequestOptions = {
603
- readonly method: 'GET' | 'PUT' | 'POST' | 'DELETE' | 'OPTIONS' | 'HEAD' | 'PATCH';
604
- readonly url: string;
605
- readonly path?: Record<string, any>;
606
- readonly cookies?: Record<string, any>;
607
- readonly headers?: Record<string, any>;
608
- readonly query?: Record<string, any>;
609
- readonly formData?: Record<string, any>;
610
- readonly body?: any;
611
- readonly mediaType?: string;
612
- readonly responseHeader?: string;
613
- readonly errors?: Record<number, string>;
614
- };
615
-
616
- interface OnCancel {
617
- readonly isResolved: boolean;
618
- readonly isRejected: boolean;
619
- readonly isCancelled: boolean;
620
- (cancelHandler: () => void): void;
621
- }
622
- declare class CancelablePromise<T> implements Promise<T> {
623
- readonly [Symbol.toStringTag]: string;
624
- private _isResolved;
625
- private _isRejected;
626
- private _isCancelled;
627
- private readonly _cancelHandlers;
628
- private readonly _promise;
629
- private _resolve?;
630
- private _reject?;
631
- constructor(executor: (resolve: (value: T | PromiseLike<T>) => void, reject: (reason?: any) => void, onCancel: OnCancel) => void);
632
- then<TResult1 = T, TResult2 = never>(onFulfilled?: ((value: T) => TResult1 | PromiseLike<TResult1>) | null, onRejected?: ((reason: any) => TResult2 | PromiseLike<TResult2>) | null): Promise<TResult1 | TResult2>;
633
- catch<TResult = never>(onRejected?: ((reason: any) => TResult | PromiseLike<TResult>) | null): Promise<T | TResult>;
634
- finally(onFinally?: (() => void) | null): Promise<T>;
635
- cancel(): void;
636
- get isCancelled(): boolean;
637
- }
638
-
639
- type Resolver<T> = (options: ApiRequestOptions) => Promise<T>;
640
- type Headers = Record<string, string>;
641
- type OpenAPIConfig = {
642
- BASE: string;
643
- VERSION: string;
644
- WITH_CREDENTIALS: boolean;
645
- CREDENTIALS: 'include' | 'omit' | 'same-origin';
646
- TOKEN?: string | Resolver<string>;
647
- USERNAME?: string | Resolver<string>;
648
- PASSWORD?: string | Resolver<string>;
649
- HEADERS?: Headers | Resolver<Headers>;
650
- ENCODE_PATH?: (path: string) => string;
651
- };
652
-
653
- declare abstract class BaseHttpRequest {
654
- readonly config: OpenAPIConfig;
655
- constructor(config: OpenAPIConfig);
656
- abstract request<T>(options: ApiRequestOptions): CancelablePromise<T>;
657
- }
658
-
659
- type CancelOrdersRequestBody = {
660
- /**
661
- * Address of the user initiating the cancel request
662
- */
663
- account_address: string;
664
- /**
665
- * List of order ids proposed for cancellation
666
- */
667
- orders: Array<string>;
668
- /**
669
- * Signature generated by the user for the specific cancellation request
670
- */
671
- signature: string;
672
- };
673
-
674
- type FailedOrderCancellation = {
675
- /**
676
- * ID of the order which failed to be cancelled
677
- */
678
- order: string;
679
- /**
680
- * Reason code indicating why the order failed to be cancelled
681
- */
682
- reason_code: FailedOrderCancellation.reason_code;
683
- };
684
- declare namespace FailedOrderCancellation {
685
- /**
686
- * Reason code indicating why the order failed to be cancelled
687
- */
688
- enum reason_code {
689
- FILLED = "FILLED"
690
- }
691
- }
692
-
693
- type CancelOrdersResultData = {
694
- /**
695
- * Orders which were successfully cancelled
696
- */
697
- successful_cancellations: Array<string>;
698
- /**
699
- * Orders which are marked for cancellation but the cancellation cannot be guaranteed
700
- */
701
- pending_cancellations: Array<string>;
702
- /**
703
- * Orders which failed to be cancelled
704
- */
705
- failed_cancellations: Array<FailedOrderCancellation>;
706
- };
707
-
708
- type CancelOrdersResult = {
709
- result: CancelOrdersResultData;
710
- };
711
-
712
- /**
713
- * The name of chain
714
- */
715
- type ChainName = string;
716
-
717
- type Fee$1 = {
718
- /**
719
- * Fee payable to recipient upon settlement
720
- */
721
- amount: string;
722
- /**
723
- * Fee type
724
- */
725
- fee_type: Fee$1.fee_type;
726
- /**
727
- * Wallet address of fee recipient
728
- */
729
- recipient: string;
730
- };
731
- declare namespace Fee$1 {
732
- /**
733
- * Fee type
734
- */
735
- enum fee_type {
736
- ROYALTY = "ROYALTY",
737
- MAKER_ECOSYSTEM = "MAKER_ECOSYSTEM",
738
- TAKER_ECOSYSTEM = "TAKER_ECOSYSTEM",
739
- PROTOCOL = "PROTOCOL"
740
- }
741
- }
742
-
743
- type ERC20Item$1 = {
744
- /**
745
- * Token type user is offering, which in this case is ERC20
746
- */
747
- item_type: 'ERC20';
748
- /**
749
- * Address of ERC20 token
750
- */
751
- contract_address: string;
752
- /**
753
- * A string representing the starting 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).
754
- */
755
- start_amount: string;
756
- };
757
-
758
- type ERC721Item$1 = {
759
- /**
760
- * Token type user is offering, which in this case is ERC721
761
- */
762
- item_type: 'ERC721';
763
- /**
764
- * Address of ERC721 token
765
- */
766
- contract_address: string;
767
- /**
768
- * ID of ERC721 token
769
- */
770
- token_id: string;
771
- };
772
-
773
- type NativeItem$1 = {
774
- /**
775
- * Token type user is offering, which in this case is the native IMX token
776
- */
777
- item_type: 'NATIVE';
778
- /**
779
- * A string representing the starting 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).
780
- */
781
- start_amount: string;
782
- };
783
-
784
- type Item = (NativeItem$1 | ERC20Item$1 | ERC721Item$1);
785
-
786
- type ProtocolData = {
787
- /**
788
- * The Order type
789
- */
790
- order_type: ProtocolData.order_type;
791
- /**
792
- * Immutable zone address
793
- */
794
- zone_address: string;
795
- /**
796
- * big.Int or uint256 string for order counter
797
- */
798
- counter: string;
799
- /**
800
- * Immutable Seaport contract address
801
- */
802
- seaport_address: string;
803
- /**
804
- * Immutable Seaport contract version
805
- */
806
- seaport_version: string;
807
- };
808
- declare namespace ProtocolData {
809
- /**
810
- * The Order type
811
- */
812
- enum order_type {
813
- FULL_RESTRICTED = "FULL_RESTRICTED"
814
- }
815
- }
816
-
817
- type CreateListingRequestBody = {
818
- account_address: string;
819
- order_hash: string;
820
- /**
821
- * Buy item for listing should either be NATIVE or ERC20 item
822
- */
823
- buy: Array<Item>;
824
- /**
825
- * 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.
826
- */
827
- fees: Array<Fee$1>;
828
- /**
829
- * Time after which the Order is considered expired
830
- */
831
- end_at: string;
832
- protocol_data: ProtocolData;
833
- /**
834
- * A random value added to the create Order request
835
- */
836
- salt: string;
837
- /**
838
- * Sell item for listing should be an ERC721 item
839
- */
840
- sell: Array<Item>;
841
- /**
842
- * Digital signature generated by the user for the specific Order
843
- */
844
- signature: string;
845
- /**
846
- * Time after which Order is considered active
847
- */
848
- start_at: string;
849
- };
850
-
851
- /**
852
- * The chain details
853
- */
854
- type Chain = {
855
- /**
856
- * The id of chain
857
- */
858
- id: string;
859
- /**
860
- * The name of chain
861
- */
862
- name: string;
863
- };
864
-
865
- type ActiveOrderStatus = {
866
- /**
867
- * The order status that indicates an order can be fulfilled.
868
- */
869
- name: 'ACTIVE';
870
- };
871
-
872
- type CancelledOrderStatus = {
873
- /**
874
- * The order status indicating a order is has been cancelled or about to be cancelled.
875
- */
876
- name: 'CANCELLED';
877
- /**
878
- * Whether the cancellation of the order is pending
879
- */
880
- pending: boolean;
881
- /**
882
- * Whether the cancellation was done on-chain or off-chain
883
- */
884
- cancellation_type: CancelledOrderStatus.cancellation_type;
885
- };
886
- declare namespace CancelledOrderStatus {
887
- /**
888
- * Whether the cancellation was done on-chain or off-chain
889
- */
890
- enum cancellation_type {
891
- ON_CHAIN = "ON_CHAIN",
892
- OFF_CHAIN = "OFF_CHAIN"
893
- }
894
- }
895
-
896
- type ExpiredOrderStatus = {
897
- /**
898
- * A terminal order status indicating that an order cannot be fulfilled due to expiry.
899
- */
900
- name: 'EXPIRED';
901
- };
902
-
903
- type FilledOrderStatus = {
904
- /**
905
- * A terminal order status indicating that an order has been fulfilled.
906
- */
907
- name: 'FILLED';
908
- };
909
-
910
- type InactiveOrderStatus = {
911
- /**
912
- * The order status that indicates an order cannot be fulfilled.
913
- */
914
- name: 'INACTIVE';
915
- /**
916
- * Whether the order offerer has sufficient approvals
917
- */
918
- sufficient_approvals: boolean;
919
- /**
920
- * Whether the order offerer still has sufficient balance to complete the order
921
- */
922
- sufficient_balances: boolean;
923
- };
924
-
925
- type PendingOrderStatus = {
926
- /**
927
- * The order status that indicates the order is yet to be active due to various reasons.
928
- */
929
- name: 'PENDING';
930
- /**
931
- * Whether the order has been evaluated after its creation
932
- */
933
- evaluated: boolean;
934
- /**
935
- * Whether the order has reached its specified start time
936
- */
937
- started: boolean;
938
- };
939
-
940
- /**
941
- * The Order status
942
- */
943
- type OrderStatus = (CancelledOrderStatus | PendingOrderStatus | ActiveOrderStatus | InactiveOrderStatus | FilledOrderStatus | ExpiredOrderStatus);
944
-
945
- type Order$1 = {
946
- account_address: string;
947
- buy: Array<Item>;
948
- fees: Array<Fee$1>;
949
- chain: Chain;
950
- /**
951
- * Time the Order is created
952
- */
953
- created_at: string;
954
- /**
955
- * Time after which the Order is considered expired
956
- */
957
- end_at: string;
958
- /**
959
- * Global Order identifier
960
- */
961
- id: string;
962
- protocol_data: ProtocolData;
963
- /**
964
- * A random value added to the create Order request
965
- */
966
- salt: string;
967
- sell: Array<Item>;
968
- /**
969
- * Digital signature generated by the user for the specific Order
970
- */
971
- signature: string;
972
- /**
973
- * Time after which Order is considered active
974
- */
975
- start_at: string;
976
- status: OrderStatus;
977
- /**
978
- * Time the Order is last updated
979
- */
980
- updated_at: string;
981
- };
982
-
983
- type FulfillableOrder = {
984
- extra_data: string;
985
- order: Order$1;
986
- };
987
-
988
- type FulfillmentDataRequest = {
989
- order_id: string;
990
- fees: Array<Fee$1>;
991
- };
992
-
993
- type ListingResult$1 = {
994
- result: Order$1;
995
- };
996
-
997
- /**
998
- * Pagination properties
999
- */
1000
- type Page$1 = {
1001
- /**
1002
- * First item as an encoded string
1003
- */
1004
- previous_cursor: string | null;
1005
- /**
1006
- * Last item as an encoded string
1007
- */
1008
- next_cursor: string | null;
1009
- };
1010
-
1011
- type ListListingsResult$1 = {
1012
- page: Page$1;
1013
- result: Array<Order$1>;
1014
- };
1015
-
1016
- /**
1017
- * The metadata related to the transaction in which the activity occurred
1018
- */
1019
- type TradeBlockchainMetadata = {
1020
- /**
1021
- * The transaction hash of the trade
1022
- */
1023
- transaction_hash: string;
1024
- /**
1025
- * EVM block number (uint64 as string)
1026
- */
1027
- block_number: string;
1028
- /**
1029
- * Transaction index in a block (uint32 as string)
1030
- */
1031
- transaction_index: string;
1032
- /**
1033
- * The log index of the fulfillment event in a block (uint32 as string)
1034
- */
1035
- log_index: string;
1036
- };
1037
-
1038
- type Trade$1 = {
1039
- buy: Array<Item>;
1040
- buyer_address: string;
1041
- buyer_fees: Array<Fee$1>;
1042
- chain: Chain;
1043
- order_id: string;
1044
- blockchain_metadata: TradeBlockchainMetadata;
1045
- /**
1046
- * Time the on-chain trade event is indexed by the order book system
1047
- */
1048
- indexed_at: string;
1049
- /**
1050
- * Global Trade identifier
1051
- */
1052
- id: string;
1053
- sell: Array<Item>;
1054
- seller_address: string;
1055
- maker_address: string;
1056
- taker_address: string;
1057
- };
1058
-
1059
- type ListTradeResult = {
1060
- page: Page$1;
1061
- result: Array<Trade$1>;
1062
- };
1063
-
1064
- /**
1065
- * The Order status
1066
- */
1067
- declare enum OrderStatusName {
1068
- PENDING = "PENDING",
1069
- ACTIVE = "ACTIVE",
1070
- INACTIVE = "INACTIVE",
1071
- FILLED = "FILLED",
1072
- EXPIRED = "EXPIRED",
1073
- CANCELLED = "CANCELLED"
1074
- }
1075
-
1076
- /**
1077
- * Encoded page cursor to retrieve previous or next page. Use the value returned in the response.
1078
- */
1079
- type PageCursor = string;
1080
-
1081
- /**
1082
- * Maximum number of items to return
1083
- */
1084
- type PageSize = number;
1085
-
1086
- type TradeResult$1 = {
1087
- result: Trade$1;
1088
- };
1089
-
1090
- type UnfulfillableOrder$1 = {
1091
- /**
1092
- * OrderID for the requested but unfulfillable order
1093
- */
1094
- order_id: string;
1095
- /**
1096
- * Nullable string containing error reason if the signing is unsuccessful for the order
1097
- */
1098
- reason: string;
1099
- };
1100
-
1101
- declare class OrdersService {
1102
- readonly httpRequest: BaseHttpRequest;
1103
- constructor(httpRequest: BaseHttpRequest);
1104
- /**
1105
- * Cancel one or more orders
1106
- * Cancel one or more orders
1107
- * @returns CancelOrdersResult Orders cancellation response.
1108
- * @throws ApiError
1109
- */
1110
- cancelOrders({ chainName, requestBody, }: {
1111
- chainName: ChainName;
1112
- requestBody: CancelOrdersRequestBody;
1113
- }): CancelablePromise<CancelOrdersResult>;
1114
- /**
1115
- * List all listings
1116
- * List all listings
1117
- * @returns ListListingsResult OK response.
1118
- * @throws ApiError
1119
- */
1120
- listListings({ chainName, status, sellItemContractAddress, buyItemContractAddress, sellItemTokenId, fromUpdatedAt, pageSize, sortBy, sortDirection, pageCursor, }: {
1121
- chainName: ChainName;
1122
- /**
1123
- * Order status to filter by
1124
- */
1125
- status?: OrderStatusName;
1126
- /**
1127
- * Sell item contract address to filter by
1128
- */
1129
- sellItemContractAddress?: string;
1130
- /**
1131
- * Buy item contract address to filter by
1132
- */
1133
- buyItemContractAddress?: string;
1134
- /**
1135
- * Sell item token identifier to filter by
1136
- */
1137
- sellItemTokenId?: string;
1138
- /**
1139
- * From updated at including given date
1140
- */
1141
- fromUpdatedAt?: string;
1142
- /**
1143
- * Maximum number of orders to return per page
1144
- */
1145
- pageSize?: PageSize;
1146
- /**
1147
- * Order field to sort by
1148
- */
1149
- sortBy?: 'created_at' | 'updated_at' | 'buy_item_amount';
1150
- /**
1151
- * Ascending or descending direction for sort
1152
- */
1153
- sortDirection?: 'asc' | 'desc';
1154
- /**
1155
- * Page cursor to retrieve previous or next page. Use the value returned in the response.
1156
- */
1157
- pageCursor?: PageCursor;
1158
- }): CancelablePromise<ListListingsResult$1>;
1159
- /**
1160
- * Create a listing
1161
- * Create a listing
1162
- * @returns ListingResult Created response.
1163
- * @throws ApiError
1164
- */
1165
- createListing({ chainName, requestBody, }: {
1166
- chainName: ChainName;
1167
- requestBody: CreateListingRequestBody;
1168
- }): CancelablePromise<ListingResult$1>;
1169
- /**
1170
- * Get a single listing by ID
1171
- * Get a single listing by ID
1172
- * @returns ListingResult OK response.
1173
- * @throws ApiError
1174
- */
1175
- getListing({ chainName, listingId, }: {
1176
- chainName: ChainName;
1177
- /**
1178
- * Global Order identifier
1179
- */
1180
- listingId: string;
1181
- }): CancelablePromise<ListingResult$1>;
1182
- /**
1183
- * Retrieve fulfillment data for orders
1184
- * Retrieve signed fulfillment data based on the list of order IDs and corresponding fees.
1185
- * @returns any Successful response
1186
- * @throws ApiError
1187
- */
1188
- fulfillmentData({ chainName, requestBody, }: {
1189
- chainName: ChainName;
1190
- requestBody: Array<FulfillmentDataRequest>;
1191
- }): CancelablePromise<{
1192
- result: {
1193
- fulfillable_orders: Array<FulfillableOrder>;
1194
- unfulfillable_orders: Array<UnfulfillableOrder$1>;
1195
- };
1196
- }>;
1197
- /**
1198
- * List all trades
1199
- * List all trades
1200
- * @returns ListTradeResult OK response.
1201
- * @throws ApiError
1202
- */
1203
- listTrades({ chainName, accountAddress, fromIndexedAt, pageSize, sortBy, sortDirection, pageCursor, }: {
1204
- chainName: ChainName;
1205
- accountAddress?: string;
1206
- /**
1207
- * From indexed at including given date
1208
- */
1209
- fromIndexedAt?: string;
1210
- /**
1211
- * Maximum number of trades to return per page
1212
- */
1213
- pageSize?: PageSize;
1214
- /**
1215
- * Trade field to sort by
1216
- */
1217
- sortBy?: 'indexed_at';
1218
- /**
1219
- * Ascending or descending direction for sort
1220
- */
1221
- sortDirection?: 'asc' | 'desc';
1222
- /**
1223
- * Page cursor to retrieve previous or next page. Use the value returned in the response.
1224
- */
1225
- pageCursor?: PageCursor;
1226
- }): CancelablePromise<ListTradeResult>;
1227
- /**
1228
- * Get a single trade by ID
1229
- * Get a single trade by ID
1230
- * @returns TradeResult OK response.
1231
- * @throws ApiError
1232
- */
1233
- getTrade({ chainName, tradeId, }: {
1234
- chainName: ChainName;
1235
- /**
1236
- * Global Trade identifier
1237
- */
1238
- tradeId: string;
1239
- }): CancelablePromise<TradeResult$1>;
1240
- }
1241
-
1242
- declare enum OrderType {
1243
- FULL_OPEN = 0,
1244
- PARTIAL_OPEN = 1,
1245
- FULL_RESTRICTED = 2,
1246
- PARTIAL_RESTRICTED = 3
1247
- }
1248
- declare enum ItemType {
1249
- NATIVE = 0,
1250
- ERC20 = 1,
1251
- ERC721 = 2,
1252
- ERC1155 = 3,
1253
- ERC721_WITH_CRITERIA = 4,
1254
- ERC1155_WITH_CRITERIA = 5
1255
- }
1256
-
1257
- type OfferItem = {
1258
- itemType: ItemType;
1259
- token: string;
1260
- identifierOrCriteria: string;
1261
- startAmount: string;
1262
- endAmount: string;
1263
- };
1264
- type ConsiderationItem = {
1265
- itemType: ItemType;
1266
- token: string;
1267
- identifierOrCriteria: string;
1268
- startAmount: string;
1269
- endAmount: string;
1270
- recipient: string;
1271
- };
1272
- type OrderParameters = {
1273
- offerer: string;
1274
- zone: string;
1275
- orderType: OrderType;
1276
- startTime: BigNumberish;
1277
- endTime: BigNumberish;
1278
- zoneHash: string;
1279
- salt: string;
1280
- offer: OfferItem[];
1281
- consideration: ConsiderationItem[];
1282
- totalOriginalConsiderationItems: BigNumberish;
1283
- conduitKey: string;
1284
- };
1285
- type OrderComponents = OrderParameters & {
1286
- counter: BigNumberish;
1287
- };
1288
-
1289
- interface ERC721Item {
1290
- type: 'ERC721';
1291
- contractAddress: string;
1292
- tokenId: string;
1293
- }
1294
- interface ERC20Item {
1295
- type: 'ERC20';
1296
- contractAddress: string;
1297
- amount: string;
1298
- }
1299
- interface NativeItem {
1300
- type: 'NATIVE';
1301
- amount: string;
1302
- }
1303
- interface RoyaltyInfo {
1304
- recipient: string;
1305
- amountRequired: string;
1306
- }
1307
- interface PrepareListingParams {
1308
- makerAddress: string;
1309
- sell: ERC721Item;
1310
- buy: ERC20Item | NativeItem;
1311
- orderExpiry?: Date;
1312
- }
1313
- interface PrepareListingResponse {
1314
- actions: Action[];
1315
- orderComponents: OrderComponents;
1316
- orderHash: string;
1317
- }
1318
- interface PrepareCancelOrdersResponse {
1319
- signableAction: SignableAction;
1320
- }
1321
- interface CreateListingParams {
1322
- orderComponents: OrderComponents;
1323
- orderHash: string;
1324
- orderSignature: string;
1325
- makerFees: FeeValue[];
1326
- }
1327
- type ListListingsParams = Omit<Parameters<typeof OrdersService.prototype.listListings>[0], 'chainName'>;
1328
- type ListTradesParams = Omit<Parameters<typeof OrdersService.prototype.listTrades>[0], 'chainName'>;
1329
- declare enum FeeType {
1330
- MAKER_ECOSYSTEM = "MAKER_ECOSYSTEM",
1331
- TAKER_ECOSYSTEM = "TAKER_ECOSYSTEM",
1332
- PROTOCOL = "PROTOCOL",
1333
- ROYALTY = "ROYALTY"
1334
- }
1335
- interface FeeValue {
1336
- recipient: string;
1337
- amount: string;
1338
- }
1339
- interface Fee extends FeeValue {
1340
- type: FeeType;
1341
- }
1342
- declare enum TransactionPurpose {
1343
- APPROVAL = "APPROVAL",
1344
- FULFILL_ORDER = "FULFILL_ORDER",
1345
- CANCEL = "CANCEL"
1346
- }
1347
- declare enum SignablePurpose {
1348
- CREATE_LISTING = "CREATE_LISTING",
1349
- OFF_CHAIN_CANCELLATION = "OFF_CHAIN_CANCELLATION"
1350
- }
1351
- declare enum ActionType {
1352
- TRANSACTION = "TRANSACTION",
1353
- SIGNABLE = "SIGNABLE"
1354
- }
1355
- type TransactionBuilder = () => Promise<PopulatedTransaction>;
1356
- interface TransactionAction {
1357
- type: ActionType.TRANSACTION;
1358
- purpose: TransactionPurpose;
1359
- buildTransaction: TransactionBuilder;
1360
- }
1361
- interface SignableAction {
1362
- type: ActionType.SIGNABLE;
1363
- purpose: SignablePurpose;
1364
- message: {
1365
- domain: TypedDataDomain;
1366
- types: Record<string, TypedDataField[]>;
1367
- value: Record<string, any>;
1368
- };
1369
- }
1370
- type Action = TransactionAction | SignableAction;
1371
- interface FulfillmentListing {
1372
- listingId: string;
1373
- takerFees: Array<FeeValue>;
1374
- }
1375
- type FulfillBulkOrdersResponse = FulfillBulkOrdersInsufficientBalanceResponse | FulfillBulkOrdersSufficientBalanceResponse;
1376
- interface FulfillBulkOrdersSufficientBalanceResponse {
1377
- sufficientBalance: true;
1378
- actions: Action[];
1379
- expiration: string;
1380
- fulfillableOrders: Order[];
1381
- unfulfillableOrders: UnfulfillableOrder[];
1382
- }
1383
- interface FulfillBulkOrdersInsufficientBalanceResponse {
1384
- sufficientBalance: false;
1385
- fulfillableOrders: Order[];
1386
- unfulfillableOrders: UnfulfillableOrder[];
1387
- }
1388
- interface UnfulfillableOrder {
1389
- orderId: string;
1390
- reason: string;
1391
- }
1392
- interface FulfillOrderResponse {
1393
- actions: Action[];
1394
- /**
1395
- * User MUST submit the fulfillment transaction before the expiration
1396
- * Submitting after the expiration will result in a on chain revert
1397
- */
1398
- expiration: string;
1399
- order: Order;
1400
- }
1401
- interface CancelOrdersOnChainResponse {
1402
- cancellationAction: TransactionAction;
1403
- }
1404
- interface Order {
1405
- id: string;
1406
- accountAddress: string;
1407
- buy: (ERC20Item | NativeItem)[];
1408
- sell: ERC721Item[];
1409
- fees: Fee[];
1410
- chain: {
1411
- id: string;
1412
- name: string;
1413
- };
1414
- createdAt: string;
1415
- updatedAt: string;
1416
- /**
1417
- * Time after which the Order is considered active
1418
- */
1419
- startAt: string;
1420
- /**
1421
- * Time after which the Order is expired
1422
- */
1423
- endAt: string;
1424
- protocolData: {
1425
- orderType: 'FULL_RESTRICTED';
1426
- zoneAddress: string;
1427
- counter: string;
1428
- seaportAddress: string;
1429
- seaportVersion: string;
1430
- };
1431
- salt: string;
1432
- signature: string;
1433
- status: OrderStatus;
1434
- }
1435
- interface ListingResult {
1436
- result: Order;
1437
- }
1438
- interface ListListingsResult {
1439
- page: Page;
1440
- result: Order[];
1441
- }
1442
- interface Page {
1443
- /**
1444
- * First item as an encoded string
1445
- */
1446
- previousCursor: string | null;
1447
- /**
1448
- * Last item as an encoded string
1449
- */
1450
- nextCursor: string | null;
1451
- }
1452
- interface Trade {
1453
- id: string;
1454
- orderId: string;
1455
- chain: {
1456
- id: string;
1457
- name: string;
1458
- };
1459
- buy: (ERC20Item | NativeItem)[];
1460
- sell: ERC721Item[];
1461
- buyerFees: Fee[];
1462
- sellerAddress: string;
1463
- buyerAddress: string;
1464
- makerAddress: string;
1465
- takerAddress: string;
1466
- /**
1467
- * Time the on-chain event was indexed by the Immutable order book service
1468
- */
1469
- indexedAt: string;
1470
- blockchainMetadata: {
1471
- /**
1472
- * The transaction hash of the trade
1473
- */
1474
- transactionHash: string;
1475
- /**
1476
- * EVM block number (uint64 as string)
1477
- */
1478
- blockNumber: string;
1479
- /**
1480
- * Transaction index in a block (uint32 as string)
1481
- */
1482
- transactionIndex: string;
1483
- /**
1484
- * The log index of the fulfillment event in a block (uint32 as string)
1485
- */
1486
- logIndex: string;
1487
- };
1488
- }
1489
- interface TradeResult {
1490
- result: Trade;
1491
- }
1492
- interface ListTradesResult {
1493
- page: Page;
1494
- result: Trade[];
1495
- }
1496
-
1497
- /**
1498
- * zkEVM orderbook SDK
1499
- * @constructor
1500
- * @param {OrderbookModuleConfiguration} config - Configuration for Immutable services.
1501
- */
1502
- declare class Orderbook {
1503
- private apiClient;
1504
- private seaport;
1505
- private orderbookConfig;
1506
- constructor(config: ModuleConfiguration<OrderbookOverrides>);
1507
- /**
1508
- * Return the configuration for the orderbook module.
1509
- * @return {OrderbookModuleConfiguration} The configuration for the orderbook module.
1510
- */
1511
- config(): OrderbookModuleConfiguration;
1512
- /**
1513
- * Get an order by ID
1514
- * @param {string} listingId - The listingId to find.
1515
- * @return {ListingResult} The returned order result.
1516
- */
1517
- getListing(listingId: string): Promise<ListingResult>;
1518
- /**
1519
- * Get a trade by ID
1520
- * @param {string} tradeId - The tradeId to find.
1521
- * @return {TradeResult} The returned order result.
1522
- */
1523
- getTrade(tradeId: string): Promise<TradeResult>;
1524
- /**
1525
- * List orders. This method is used to get a list of orders filtered by conditions specified
1526
- * in the params object.
1527
- * @param {ListListingsParams} listOrderParams - Filtering, ordering and page parameters.
1528
- * @return {ListListingsResult} The paged orders.
1529
- */
1530
- listListings(listOrderParams: ListListingsParams): Promise<ListListingsResult>;
1531
- /**
1532
- * List trades. This method is used to get a list of trades filtered by conditions specified
1533
- * in the params object
1534
- * @param {ListTradesParams} listTradesParams - Filtering, ordering and page parameters.
1535
- * @return {ListTradesResult} The paged trades.
1536
- */
1537
- listTrades(listTradesParams: ListTradesParams): Promise<ListTradesResult>;
1538
- /**
1539
- * Get required transactions and messages for signing prior to creating a listing
1540
- * through the createListing method
1541
- * @param {PrepareListingParams} prepareListingParams - Details about the listing to be created.
1542
- * @return {PrepareListingResponse} PrepareListingResponse includes
1543
- * the unsigned approval transaction, the typed order message for signing and
1544
- * the order components that can be submitted to `createListing` with a signature.
1545
- */
1546
- prepareListing({ makerAddress, sell, buy, orderExpiry, }: PrepareListingParams): Promise<PrepareListingResponse>;
1547
- /**
1548
- * Create an order
1549
- * @param {CreateListingParams} createListingParams - create an order with the given params.
1550
- * @return {ListingResult} The result of the order created in the Immutable services.
1551
- */
1552
- createListing(createListingParams: CreateListingParams): Promise<ListingResult>;
1553
- /**
1554
- * Get unsigned transactions that can be submitted to fulfil an open order. If the approval
1555
- * transaction exists it must be signed and submitted to the chain before the fulfilment
1556
- * transaction can be submitted or it will be reverted.
1557
- * @param {string} listingId - The listingId to fulfil.
1558
- * @param {string} fulfillerAddress - The address of the account fulfilling the order.
1559
- * @return {FulfillOrderResponse} Approval and fulfilment transactions.
1560
- */
1561
- fulfillOrder(listingId: string, takerAddress: string, takerFees: FeeValue[]): Promise<FulfillOrderResponse>;
1562
- fulfillBulkOrders(listings: Array<FulfillmentListing>, takerAddress: string): Promise<FulfillBulkOrdersResponse>;
1563
- /**
1564
- * Cancelling orders is a gasless alternative to on-chain cancellation exposed with
1565
- * `cancelOrdersOnChain`. For the orderbook to authenticate the cancellation, the creator
1566
- * of the orders must sign an EIP712 message containing the orderIds
1567
- * @param {string} orderIds - The orderIds to attempt to cancel.
1568
- * @return {PrepareCancelOrdersResponse} The signable action to cancel the orders.
1569
- */
1570
- prepareOrderCancellations(orderIds: string[]): Promise<PrepareCancelOrdersResponse>;
1571
- /**
1572
- * Cancelling orders is a gasless alternative to on-chain cancellation exposed with
1573
- * `cancelOrdersOnChain`. Orders cancelled this way cannot be fulfilled and will be removed
1574
- * from the orderbook. If there is pending fulfillment data outstanding for the order, its
1575
- * cancellation will be pending until the fulfillment window has passed.
1576
- * `prepareOffchainOrderCancellations` can be used to get the signable action that is signed
1577
- * to get the signature required for this call.
1578
- * @param {string[]} orderIds - The orderIds to attempt to cancel.
1579
- * @param {string} accountAddress - The address of the account cancelling the orders.
1580
- * @param {string} accountAddress - The address of the account cancelling the orders.
1581
- * @return {CancelOrdersResult} The result of the off-chain cancellation request
1582
- */
1583
- cancelOrders(orderIds: string[], accountAddress: string, signature: string): Promise<CancelOrdersResult>;
1584
- /**
1585
- * Get an unsigned order cancellation transaction. Orders can only be cancelled by
1586
- * the account that created them. All of the orders must be from the same seaport contract.
1587
- * If trying to cancel orders from multiple seaport contracts, group the orderIds by seaport
1588
- * contract and call this method for each group.
1589
- * @param {string[]} orderIds - The orderIds to cancel.
1590
- * @param {string} accountAddress - The address of the account cancelling the order.
1591
- * @return {CancelOrdersOnChainResponse} The unsigned cancel order action
1592
- */
1593
- cancelOrdersOnChain(orderIds: string[], accountAddress: string): Promise<CancelOrdersOnChainResponse>;
1594
- }
1595
-
1596
- declare const constants: {
1597
- estimatedFulfillmentGasGwei: number;
1598
- };
1599
-
1600
- export { Action, ActionType, CancelOrdersOnChainResponse, CreateListingParams, ERC20Item, ERC721Item, Fee, FeeType, FeeValue, FulfillBulkOrdersInsufficientBalanceResponse, FulfillBulkOrdersResponse, FulfillBulkOrdersSufficientBalanceResponse, FulfillOrderResponse, FulfillmentListing, ListListingsParams, ListListingsResult, ListTradesParams, ListTradesResult, ListingResult, NativeItem, Order, OrderStatusName, Orderbook, Page, PrepareCancelOrdersResponse, PrepareListingParams, PrepareListingResponse, RoyaltyInfo, SignableAction, SignablePurpose, Trade, TradeResult, TransactionAction, TransactionBuilder, TransactionPurpose, UnfulfillableOrder, constants };