@imtbl/sdk 0.1.2 → 0.1.4-alpha

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.
@@ -0,0 +1,962 @@
1
+ import { ProviderConfiguration as ProviderConfiguration$1 } from 'config';
2
+
3
+ declare type Bytes = ArrayLike<number>;
4
+ declare type BytesLike = Bytes | string;
5
+ interface Hexable {
6
+ toHexString(): string;
7
+ }
8
+
9
+ declare type BigNumberish = BigNumber | Bytes | bigint | string | number;
10
+ declare class BigNumber implements Hexable {
11
+ readonly _hex: string;
12
+ readonly _isBigNumber: boolean;
13
+ constructor(constructorGuard: any, hex: string);
14
+ fromTwos(value: number): BigNumber;
15
+ toTwos(value: number): BigNumber;
16
+ abs(): BigNumber;
17
+ add(other: BigNumberish): BigNumber;
18
+ sub(other: BigNumberish): BigNumber;
19
+ div(other: BigNumberish): BigNumber;
20
+ mul(other: BigNumberish): BigNumber;
21
+ mod(other: BigNumberish): BigNumber;
22
+ pow(other: BigNumberish): BigNumber;
23
+ and(other: BigNumberish): BigNumber;
24
+ or(other: BigNumberish): BigNumber;
25
+ xor(other: BigNumberish): BigNumber;
26
+ mask(value: number): BigNumber;
27
+ shl(value: number): BigNumber;
28
+ shr(value: number): BigNumber;
29
+ eq(other: BigNumberish): boolean;
30
+ lt(other: BigNumberish): boolean;
31
+ lte(other: BigNumberish): boolean;
32
+ gt(other: BigNumberish): boolean;
33
+ gte(other: BigNumberish): boolean;
34
+ isNegative(): boolean;
35
+ isZero(): boolean;
36
+ toNumber(): number;
37
+ toBigInt(): bigint;
38
+ toString(): string;
39
+ toHexString(): string;
40
+ toJSON(key?: string): any;
41
+ static from(value: any): BigNumber;
42
+ static isBigNumber(value: any): value is BigNumber;
43
+ }
44
+
45
+ declare type Deferrable<T> = {
46
+ [K in keyof T]: T[K] | Promise<T[K]>;
47
+ };
48
+ declare class Description<T = any> {
49
+ constructor(info: {
50
+ [K in keyof T]: T[K];
51
+ });
52
+ }
53
+
54
+ declare type Network = {
55
+ name: string;
56
+ chainId: number;
57
+ ensAddress?: string;
58
+ _defaultProvider?: (providers: any, options?: any) => any;
59
+ };
60
+
61
+ declare type AccessList = Array<{
62
+ address: string;
63
+ storageKeys: Array<string>;
64
+ }>;
65
+ declare type AccessListish = AccessList | Array<[string, Array<string>]> | Record<string, Array<string>>;
66
+ interface Transaction {
67
+ hash?: string;
68
+ to?: string;
69
+ from?: string;
70
+ nonce: number;
71
+ gasLimit: BigNumber;
72
+ gasPrice?: BigNumber;
73
+ data: string;
74
+ value: BigNumber;
75
+ chainId: number;
76
+ r?: string;
77
+ s?: string;
78
+ v?: number;
79
+ type?: number | null;
80
+ accessList?: AccessList;
81
+ maxPriorityFeePerGas?: BigNumber;
82
+ maxFeePerGas?: BigNumber;
83
+ }
84
+
85
+ interface OnceBlockable {
86
+ once(eventName: "block", handler: () => void): void;
87
+ }
88
+
89
+ declare type TransactionRequest = {
90
+ to?: string;
91
+ from?: string;
92
+ nonce?: BigNumberish;
93
+ gasLimit?: BigNumberish;
94
+ gasPrice?: BigNumberish;
95
+ data?: BytesLike;
96
+ value?: BigNumberish;
97
+ chainId?: number;
98
+ type?: number;
99
+ accessList?: AccessListish;
100
+ maxPriorityFeePerGas?: BigNumberish;
101
+ maxFeePerGas?: BigNumberish;
102
+ customData?: Record<string, any>;
103
+ ccipReadEnabled?: boolean;
104
+ };
105
+ interface TransactionResponse extends Transaction {
106
+ hash: string;
107
+ blockNumber?: number;
108
+ blockHash?: string;
109
+ timestamp?: number;
110
+ confirmations: number;
111
+ from: string;
112
+ raw?: string;
113
+ wait: (confirmations?: number) => Promise<TransactionReceipt>;
114
+ }
115
+ declare type BlockTag = string | number;
116
+ interface _Block {
117
+ hash: string;
118
+ parentHash: string;
119
+ number: number;
120
+ timestamp: number;
121
+ nonce: string;
122
+ difficulty: number;
123
+ _difficulty: BigNumber;
124
+ gasLimit: BigNumber;
125
+ gasUsed: BigNumber;
126
+ miner: string;
127
+ extraData: string;
128
+ baseFeePerGas?: null | BigNumber;
129
+ }
130
+ interface Block extends _Block {
131
+ transactions: Array<string>;
132
+ }
133
+ interface BlockWithTransactions extends _Block {
134
+ transactions: Array<TransactionResponse>;
135
+ }
136
+ interface Log {
137
+ blockNumber: number;
138
+ blockHash: string;
139
+ transactionIndex: number;
140
+ removed: boolean;
141
+ address: string;
142
+ data: string;
143
+ topics: Array<string>;
144
+ transactionHash: string;
145
+ logIndex: number;
146
+ }
147
+ interface TransactionReceipt {
148
+ to: string;
149
+ from: string;
150
+ contractAddress: string;
151
+ transactionIndex: number;
152
+ root?: string;
153
+ gasUsed: BigNumber;
154
+ logsBloom: string;
155
+ blockHash: string;
156
+ transactionHash: string;
157
+ logs: Array<Log>;
158
+ blockNumber: number;
159
+ confirmations: number;
160
+ cumulativeGasUsed: BigNumber;
161
+ effectiveGasPrice: BigNumber;
162
+ byzantium: boolean;
163
+ type: number;
164
+ status?: number;
165
+ }
166
+ interface FeeData {
167
+ lastBaseFeePerGas: null | BigNumber;
168
+ maxFeePerGas: null | BigNumber;
169
+ maxPriorityFeePerGas: null | BigNumber;
170
+ gasPrice: null | BigNumber;
171
+ }
172
+ interface EventFilter {
173
+ address?: string;
174
+ topics?: Array<string | Array<string> | null>;
175
+ }
176
+ interface Filter extends EventFilter {
177
+ fromBlock?: BlockTag;
178
+ toBlock?: BlockTag;
179
+ }
180
+ declare abstract class ForkEvent extends Description {
181
+ readonly expiry: number;
182
+ readonly _isForkEvent?: boolean;
183
+ static isForkEvent(value: any): value is ForkEvent;
184
+ }
185
+ declare type EventType = string | Array<string | Array<string>> | EventFilter | ForkEvent;
186
+ declare type Listener = (...args: Array<any>) => void;
187
+ declare abstract class Provider implements OnceBlockable {
188
+ abstract getNetwork(): Promise<Network>;
189
+ abstract getBlockNumber(): Promise<number>;
190
+ abstract getGasPrice(): Promise<BigNumber>;
191
+ getFeeData(): Promise<FeeData>;
192
+ abstract getBalance(addressOrName: string | Promise<string>, blockTag?: BlockTag | Promise<BlockTag>): Promise<BigNumber>;
193
+ abstract getTransactionCount(addressOrName: string | Promise<string>, blockTag?: BlockTag | Promise<BlockTag>): Promise<number>;
194
+ abstract getCode(addressOrName: string | Promise<string>, blockTag?: BlockTag | Promise<BlockTag>): Promise<string>;
195
+ abstract getStorageAt(addressOrName: string | Promise<string>, position: BigNumberish | Promise<BigNumberish>, blockTag?: BlockTag | Promise<BlockTag>): Promise<string>;
196
+ abstract sendTransaction(signedTransaction: string | Promise<string>): Promise<TransactionResponse>;
197
+ abstract call(transaction: Deferrable<TransactionRequest>, blockTag?: BlockTag | Promise<BlockTag>): Promise<string>;
198
+ abstract estimateGas(transaction: Deferrable<TransactionRequest>): Promise<BigNumber>;
199
+ abstract getBlock(blockHashOrBlockTag: BlockTag | string | Promise<BlockTag | string>): Promise<Block>;
200
+ abstract getBlockWithTransactions(blockHashOrBlockTag: BlockTag | string | Promise<BlockTag | string>): Promise<BlockWithTransactions>;
201
+ abstract getTransaction(transactionHash: string): Promise<TransactionResponse>;
202
+ abstract getTransactionReceipt(transactionHash: string): Promise<TransactionReceipt>;
203
+ abstract getLogs(filter: Filter): Promise<Array<Log>>;
204
+ abstract resolveName(name: string | Promise<string>): Promise<null | string>;
205
+ abstract lookupAddress(address: string | Promise<string>): Promise<null | string>;
206
+ abstract on(eventName: EventType, listener: Listener): Provider;
207
+ abstract once(eventName: EventType, listener: Listener): Provider;
208
+ abstract emit(eventName: EventType, ...args: Array<any>): boolean;
209
+ abstract listenerCount(eventName?: EventType): number;
210
+ abstract listeners(eventName?: EventType): Array<Listener>;
211
+ abstract off(eventName: EventType, listener?: Listener): Provider;
212
+ abstract removeAllListeners(eventName?: EventType): Provider;
213
+ addListener(eventName: EventType, listener: Listener): Provider;
214
+ removeListener(eventName: EventType, listener: Listener): Provider;
215
+ abstract waitForTransaction(transactionHash: string, confirmations?: number, timeout?: number): Promise<TransactionReceipt>;
216
+ readonly _isProvider: boolean;
217
+ constructor();
218
+ static isProvider(value: any): value is Provider;
219
+ }
220
+
221
+ declare abstract class Signer {
222
+ readonly provider?: Provider;
223
+ abstract getAddress(): Promise<string>;
224
+ abstract signMessage(message: Bytes | string): Promise<string>;
225
+ abstract signTransaction(transaction: Deferrable<TransactionRequest>): Promise<string>;
226
+ abstract connect(provider: Provider): Signer;
227
+ readonly _isSigner: boolean;
228
+ constructor();
229
+ getBalance(blockTag?: BlockTag): Promise<BigNumber>;
230
+ getTransactionCount(blockTag?: BlockTag): Promise<number>;
231
+ estimateGas(transaction: Deferrable<TransactionRequest>): Promise<BigNumber>;
232
+ call(transaction: Deferrable<TransactionRequest>, blockTag?: BlockTag): Promise<string>;
233
+ sendTransaction(transaction: Deferrable<TransactionRequest>): Promise<TransactionResponse>;
234
+ getChainId(): Promise<number>;
235
+ getGasPrice(): Promise<BigNumber>;
236
+ getFeeData(): Promise<FeeData>;
237
+ resolveName(name: string): Promise<string>;
238
+ checkTransaction(transaction: Deferrable<TransactionRequest>): Deferrable<TransactionRequest>;
239
+ populateTransaction(transaction: Deferrable<TransactionRequest>): Promise<TransactionRequest>;
240
+ _checkProvider(operation?: string): void;
241
+ static isSigner(value: any): value is Signer;
242
+ }
243
+
244
+ /**
245
+ * An abstraction of a Stark account, which can be used to sign messages and transactions on StarkEx to execute state changing operations
246
+ */
247
+ interface StarkSigner {
248
+ /**
249
+ * Signs the prefixed-message
250
+ * @params message - this must be a UTF8-message
251
+ * @example "0x1234"
252
+ * @returns the signed prefixed-message
253
+ */
254
+ signMessage(message: string): Promise<string>;
255
+ /**
256
+ * Get the Signer address
257
+ * @returns the Signer's checksum address
258
+ */
259
+ getAddress(): string | Promise<string>;
260
+ }
261
+
262
+ /**
263
+ * An ERC20 token
264
+ */
265
+ interface ERC20Token {
266
+ type: 'ERC20';
267
+ tokenAddress: string;
268
+ }
269
+ /**
270
+ * An ERC721 token
271
+ */
272
+ interface ERC721Token {
273
+ type: 'ERC721';
274
+ tokenId: string;
275
+ tokenAddress: string;
276
+ }
277
+ /**
278
+ * An ETH token
279
+ */
280
+ interface ETHToken {
281
+ type: 'ETH';
282
+ }
283
+ /**
284
+ * An amount of ETH token of unit Wei
285
+ */
286
+ interface ETHAmount extends ETHToken {
287
+ /**
288
+ * An amount in unit Wei
289
+ */
290
+ amount: string;
291
+ }
292
+ /**
293
+ * The token details and amount of ERC20 token units
294
+ */
295
+ interface ERC20Amount extends ERC20Token {
296
+ /**
297
+ * An amount in units for the given ERC20 token
298
+ */
299
+ amount: string;
300
+ }
301
+ /**
302
+ * Union type that represents all token types
303
+ */
304
+ declare type AnyToken = ETHToken | ERC721Token | ERC20Token;
305
+ /**
306
+ * Union type that represents all token type amounts
307
+ */
308
+ declare type TokenAmount = ETHAmount | ERC20Amount | ERC721Token;
309
+ /**
310
+ * Union type that represents exchange token type amounts
311
+ */
312
+ declare type ExchangeTokenAmount = ETHAmount | ERC20Amount;
313
+
314
+ /**
315
+ * Immutable X API
316
+ * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
317
+ *
318
+ * The version of the OpenAPI document: 3.0
319
+ * Contact: support@immutable.com
320
+ *
321
+ * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
322
+ * https://openapi-generator.tech
323
+ * Do not edit the class manually.
324
+ */
325
+ interface ConfigurationParameters {
326
+ apiKey?: string | Promise<string> | ((name: string) => string) | ((name: string) => Promise<string>);
327
+ username?: string;
328
+ password?: string;
329
+ accessToken?: string | Promise<string> | ((name?: string, scopes?: string[]) => string) | ((name?: string, scopes?: string[]) => Promise<string>);
330
+ basePath?: string;
331
+ baseOptions?: any;
332
+ formDataCtor?: new () => any;
333
+ }
334
+ declare class Configuration {
335
+ /**
336
+ * parameter for apiKey security
337
+ * @param name security name
338
+ * @memberof Configuration
339
+ */
340
+ apiKey?: string | Promise<string> | ((name: string) => string) | ((name: string) => Promise<string>);
341
+ /**
342
+ * parameter for basic security
343
+ *
344
+ * @type {string}
345
+ * @memberof Configuration
346
+ */
347
+ username?: string;
348
+ /**
349
+ * parameter for basic security
350
+ *
351
+ * @type {string}
352
+ * @memberof Configuration
353
+ */
354
+ password?: string;
355
+ /**
356
+ * parameter for oauth2 security
357
+ * @param name security name
358
+ * @param scopes oauth2 scope
359
+ * @memberof Configuration
360
+ */
361
+ accessToken?: string | Promise<string> | ((name?: string, scopes?: string[]) => string) | ((name?: string, scopes?: string[]) => Promise<string>);
362
+ /**
363
+ * override base path
364
+ *
365
+ * @type {string}
366
+ * @memberof Configuration
367
+ */
368
+ basePath?: string;
369
+ /**
370
+ * base options for axios calls
371
+ *
372
+ * @type {any}
373
+ * @memberof Configuration
374
+ */
375
+ baseOptions?: any;
376
+ /**
377
+ * The FormData constructor that will be used to create multipart form data
378
+ * requests. You can inject this here so that execution environments that
379
+ * do not support the FormData class can still run the generated client.
380
+ *
381
+ * @type {new () => FormData}
382
+ */
383
+ formDataCtor?: new () => any;
384
+ constructor(param?: ConfigurationParameters);
385
+ /**
386
+ * Check if the given MIME is a JSON MIME.
387
+ * JSON MIME examples:
388
+ * application/json
389
+ * application/json; charset=UTF8
390
+ * APPLICATION/JSON
391
+ * application/vnd.company+json
392
+ * @param mime - MIME (Multipurpose Internet Mail Extensions)
393
+ * @return True if the given MIME is JSON, false otherwise.
394
+ */
395
+ isJsonMime(mime: string): boolean;
396
+ }
397
+
398
+ /**
399
+ * Immutable X API
400
+ * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
401
+ *
402
+ * The version of the OpenAPI document: 3.0
403
+ * Contact: support@immutable.com
404
+ *
405
+ * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
406
+ * https://openapi-generator.tech
407
+ * Do not edit the class manually.
408
+ */
409
+ /**
410
+ *
411
+ * @export
412
+ * @interface CancelOrderResponse
413
+ */
414
+ interface CancelOrderResponse {
415
+ /**
416
+ * ID of the cancelled order
417
+ * @type {number}
418
+ * @memberof CancelOrderResponse
419
+ */
420
+ 'order_id': number;
421
+ /**
422
+ * New status of the order
423
+ * @type {string}
424
+ * @memberof CancelOrderResponse
425
+ */
426
+ 'status': string;
427
+ }
428
+
429
+ /**
430
+ * Immutable X API
431
+ * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
432
+ *
433
+ * The version of the OpenAPI document: 3.0
434
+ * Contact: support@immutable.com
435
+ *
436
+ * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
437
+ * https://openapi-generator.tech
438
+ * Do not edit the class manually.
439
+ */
440
+ /**
441
+ *
442
+ * @export
443
+ * @interface FeeEntry
444
+ */
445
+ interface FeeEntry {
446
+ /**
447
+ *
448
+ * @type {string}
449
+ * @memberof FeeEntry
450
+ */
451
+ 'address'?: string;
452
+ /**
453
+ *
454
+ * @type {number}
455
+ * @memberof FeeEntry
456
+ */
457
+ 'fee_percentage'?: number;
458
+ }
459
+
460
+ /**
461
+ * Immutable X API
462
+ * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
463
+ *
464
+ * The version of the OpenAPI document: 3.0
465
+ * Contact: support@immutable.com
466
+ *
467
+ * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
468
+ * https://openapi-generator.tech
469
+ * Do not edit the class manually.
470
+ */
471
+ /**
472
+ *
473
+ * @export
474
+ * @interface CreateOrderResponse
475
+ */
476
+ interface CreateOrderResponse {
477
+ /**
478
+ * ID of the created order
479
+ * @type {number}
480
+ * @memberof CreateOrderResponse
481
+ */
482
+ 'order_id': number;
483
+ /**
484
+ * Request ID as a reference for an asynchronous order creation request
485
+ * @type {string}
486
+ * @memberof CreateOrderResponse
487
+ */
488
+ 'request_id'?: string;
489
+ /**
490
+ * Status of the created order
491
+ * @type {string}
492
+ * @memberof CreateOrderResponse
493
+ */
494
+ 'status': string;
495
+ /**
496
+ * Timestamp of the created order
497
+ * @type {number}
498
+ * @memberof CreateOrderResponse
499
+ */
500
+ 'time': number;
501
+ }
502
+
503
+ /**
504
+ * Immutable X API
505
+ * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
506
+ *
507
+ * The version of the OpenAPI document: 3.0
508
+ * Contact: support@immutable.com
509
+ *
510
+ * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
511
+ * https://openapi-generator.tech
512
+ * Do not edit the class manually.
513
+ */
514
+ /**
515
+ *
516
+ * @export
517
+ * @interface CreateTradeResponse
518
+ */
519
+ interface CreateTradeResponse {
520
+ /**
521
+ * Request ID as a reference for an asynchronous trade creation request
522
+ * @type {string}
523
+ * @memberof CreateTradeResponse
524
+ */
525
+ 'request_id'?: string;
526
+ /**
527
+ * Current status of trade
528
+ * @type {string}
529
+ * @memberof CreateTradeResponse
530
+ */
531
+ 'status': string;
532
+ /**
533
+ * ID of trade within Immutable X
534
+ * @type {number}
535
+ * @memberof CreateTradeResponse
536
+ */
537
+ 'trade_id': number;
538
+ }
539
+
540
+ /**
541
+ * Immutable X API
542
+ * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
543
+ *
544
+ * The version of the OpenAPI document: 3.0
545
+ * Contact: support@immutable.com
546
+ *
547
+ * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
548
+ * https://openapi-generator.tech
549
+ * Do not edit the class manually.
550
+ */
551
+ /**
552
+ *
553
+ * @export
554
+ * @interface CreateTransferResponse
555
+ */
556
+ interface CreateTransferResponse {
557
+ /**
558
+ * List of transfer IDs
559
+ * @type {Array<number>}
560
+ * @memberof CreateTransferResponse
561
+ */
562
+ 'transfer_ids': Array<number>;
563
+ }
564
+
565
+ /**
566
+ * Immutable X API
567
+ * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
568
+ *
569
+ * The version of the OpenAPI document: 3.0
570
+ * Contact: support@immutable.com
571
+ *
572
+ * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
573
+ * https://openapi-generator.tech
574
+ * Do not edit the class manually.
575
+ */
576
+ /**
577
+ *
578
+ * @export
579
+ * @interface CreateTransferResponseV1
580
+ */
581
+ interface CreateTransferResponseV1 {
582
+ /**
583
+ * [deprecated] Sent signature
584
+ * @type {string}
585
+ * @memberof CreateTransferResponseV1
586
+ */
587
+ 'sent_signature': string;
588
+ /**
589
+ * [deprecated] The status of transfer
590
+ * @type {string}
591
+ * @memberof CreateTransferResponseV1
592
+ */
593
+ 'status': string;
594
+ /**
595
+ * [deprecated] Time of the transfer
596
+ * @type {number}
597
+ * @memberof CreateTransferResponseV1
598
+ */
599
+ 'time': number;
600
+ /**
601
+ * ID of the transfer
602
+ * @type {number}
603
+ * @memberof CreateTransferResponseV1
604
+ */
605
+ 'transfer_id': number;
606
+ }
607
+
608
+ /**
609
+ * Immutable X API
610
+ * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
611
+ *
612
+ * The version of the OpenAPI document: 3.0
613
+ * Contact: support@immutable.com
614
+ *
615
+ * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
616
+ * https://openapi-generator.tech
617
+ * Do not edit the class manually.
618
+ */
619
+ /**
620
+ *
621
+ * @export
622
+ * @interface CreateWithdrawalResponse
623
+ */
624
+ interface CreateWithdrawalResponse {
625
+ /**
626
+ * Status of the withdrawal
627
+ * @type {string}
628
+ * @memberof CreateWithdrawalResponse
629
+ */
630
+ 'status': string;
631
+ /**
632
+ * Time of the withdrawal
633
+ * @type {number}
634
+ * @memberof CreateWithdrawalResponse
635
+ */
636
+ 'time': number;
637
+ /**
638
+ * ID of the withdrawal
639
+ * @type {number}
640
+ * @memberof CreateWithdrawalResponse
641
+ */
642
+ 'withdrawal_id': number;
643
+ }
644
+
645
+ /**
646
+ * Immutable X API
647
+ * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
648
+ *
649
+ * The version of the OpenAPI document: 3.0
650
+ * Contact: support@immutable.com
651
+ *
652
+ * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
653
+ * https://openapi-generator.tech
654
+ * Do not edit the class manually.
655
+ */
656
+ /**
657
+ *
658
+ * @export
659
+ * @interface GetSignableCancelOrderRequest
660
+ */
661
+ interface GetSignableCancelOrderRequest {
662
+ /**
663
+ * ID of the order to be cancelled
664
+ * @type {number}
665
+ * @memberof GetSignableCancelOrderRequest
666
+ */
667
+ 'order_id': number;
668
+ }
669
+
670
+ /**
671
+ * Immutable X API
672
+ * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
673
+ *
674
+ * The version of the OpenAPI document: 3.0
675
+ * Contact: support@immutable.com
676
+ *
677
+ * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
678
+ * https://openapi-generator.tech
679
+ * Do not edit the class manually.
680
+ */
681
+
682
+ /**
683
+ *
684
+ * @export
685
+ * @interface GetSignableTradeRequest
686
+ */
687
+ interface GetSignableTradeRequest {
688
+ /**
689
+ * ExpirationTimestamp in Unix time. Note: will be rounded down to the nearest hour
690
+ * @type {number}
691
+ * @memberof GetSignableTradeRequest
692
+ */
693
+ 'expiration_timestamp'?: number;
694
+ /**
695
+ * Inclusion of either maker or taker fees
696
+ * @type {Array<FeeEntry>}
697
+ * @memberof GetSignableTradeRequest
698
+ */
699
+ 'fees'?: Array<FeeEntry>;
700
+ /**
701
+ * The ID of the maker order involved
702
+ * @type {number}
703
+ * @memberof GetSignableTradeRequest
704
+ */
705
+ 'order_id': number;
706
+ /**
707
+ * Ethereum address of the submitting user
708
+ * @type {string}
709
+ * @memberof GetSignableTradeRequest
710
+ */
711
+ 'user': string;
712
+ }
713
+
714
+ /**
715
+ * Immutable X API
716
+ * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
717
+ *
718
+ * The version of the OpenAPI document: 3.0
719
+ * Contact: support@immutable.com
720
+ *
721
+ * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
722
+ * https://openapi-generator.tech
723
+ * Do not edit the class manually.
724
+ */
725
+ /**
726
+ *
727
+ * @export
728
+ * @interface RegisterUserResponse
729
+ */
730
+ interface RegisterUserResponse {
731
+ /**
732
+ * Immutable signature authorising registration
733
+ * @type {string}
734
+ * @memberof RegisterUserResponse
735
+ */
736
+ 'tx_hash': string;
737
+ }
738
+
739
+ /**
740
+ * Parameter required to create an Order
741
+ */
742
+ interface UnsignedOrderRequest {
743
+ /**
744
+ * The amount of tokens that will be bought for this order
745
+ */
746
+ buy: TokenAmount;
747
+ /**
748
+ * The amount of tokens that will be sold for this order
749
+ */
750
+ sell: TokenAmount;
751
+ /**
752
+ * ExpirationTimestamp in Unix time. Note: will be rounded down to the nearest hour
753
+ */
754
+ expiration_timestamp?: number;
755
+ /**
756
+ * Inclusion of either maker or taker fees
757
+ */
758
+ fees?: Array<FeeEntry>;
759
+ }
760
+ /**
761
+ * Parameter required to create a Transfer
762
+ */
763
+ declare type UnsignedTransferRequest = TokenAmount & {
764
+ /**
765
+ * Ethereum address of the receiving user
766
+ */
767
+ receiver: string;
768
+ };
769
+ /**
770
+ * Parameter required to create a Transfer
771
+ */
772
+ declare type UnsignedExchangeTransferRequest = ExchangeTokenAmount & {
773
+ /**
774
+ * Ethereum address of the receiving user
775
+ */
776
+ receiver: string;
777
+ /**
778
+ * Exchange transaction ID
779
+ */
780
+ transactionID: string;
781
+ };
782
+
783
+ /**
784
+ * Parameter required to create a batchNftTransfer
785
+ */
786
+ interface NftTransferDetails {
787
+ /**
788
+ * Ethereum address of the receiving user
789
+ */
790
+ receiver: string;
791
+ /**
792
+ * The token ID
793
+ */
794
+ tokenId: string;
795
+ /**
796
+ * The token contract address
797
+ */
798
+ tokenAddress: string;
799
+ }
800
+
801
+ /**
802
+ * The configuration for the Ethereum network
803
+ */
804
+ interface EthConfiguration {
805
+ coreContractAddress: string;
806
+ registrationContractAddress: string;
807
+ chainID: number;
808
+ }
809
+ /**
810
+ * The configuration for the ImmutableX client
811
+ */
812
+ interface ImmutableXConfiguration {
813
+ /**
814
+ * The configuration for the API client
815
+ */
816
+ apiConfiguration: Configuration;
817
+ /**
818
+ * The configuration for the Ethereum network
819
+ */
820
+ ethConfiguration: EthConfiguration;
821
+ }
822
+
823
+ interface IMXProvider {
824
+ /**
825
+ * Get the Signer address
826
+ *
827
+ * @return {Promise<string>} Returns a promise that resolves with the signer's address
828
+ */
829
+ getAddress(): Promise<string>;
830
+ /**
831
+ * Register a User to Immutable X if they are not already registered
832
+ *
833
+ * @return {Promise<RegisterUserResponse>} Returns a promise that resolves with the user registration response
834
+ */
835
+ registerOffchain(): Promise<RegisterUserResponse>;
836
+ /**
837
+ * Checks if a User is registered on-chain
838
+ *
839
+ * @return {Promise<boolean>} Returns a promise that resolves with true if the User is registered, false otherwise
840
+ */
841
+ isRegisteredOnchain(): Promise<boolean>;
842
+ /**
843
+ * Create an Order
844
+ *
845
+ * @param {UnsignedOrderRequest} request The unsigned order request to create an order
846
+ * @return {Promise<CreateOrderResponse>} Returns a promise that resolves with the created Order
847
+ */
848
+ createOrder(request: UnsignedOrderRequest): Promise<CreateOrderResponse>;
849
+ /**
850
+ * Cancel an Order
851
+ *
852
+ * @param {GetSignableCancelOrderRequest} request The signable cancel order request
853
+ * @return {Promise<CancelOrderResponse>} Returns a promise that resolves with the cancelled Order
854
+ */
855
+ cancelOrder(request: GetSignableCancelOrderRequest): Promise<CancelOrderResponse>;
856
+ /**
857
+ * Create a Trade
858
+ *
859
+ * @param {GetSignableTradeRequest} request The signable trade request
860
+ * @return {Promise<CreateTradeResponse>} Returns a promise that resolves with the created Trade
861
+ */
862
+ createTrade(request: GetSignableTradeRequest): Promise<CreateTradeResponse>;
863
+ /**
864
+ * Create a new Transfer request
865
+ *
866
+ * @param {UnsignedTransferRequest} request The unsigned transfer request
867
+ * @return {Promise<CreateTransferResponseV1>} Returns a promise that resolves with the created Transfer
868
+ */
869
+ transfer(request: UnsignedTransferRequest): Promise<CreateTransferResponseV1>;
870
+ /**
871
+ * Create a batch of NFT transfer requests
872
+ *
873
+ * @param {Array<NftTransferDetails>} request An array of NFT transfer details
874
+ * @return {Promise<CreateTransferResponse>} Resolves a promise that resolves with the list of Transfer IDs
875
+ */
876
+ batchNftTransfer(request: Array<NftTransferDetails>): Promise<CreateTransferResponse>;
877
+ /**
878
+ * Create a new Exchange transaction
879
+ *
880
+ * @param {UnsignedExchangeTransferRequest} request The unsigned exchange transfer request
881
+ * @return {Promise<CreateTransferResponseV1>} Returns a promise that resolves with the created Exchange Transaction
882
+ */
883
+ exchangeTransfer(request: UnsignedExchangeTransferRequest): Promise<CreateTransferResponseV1>;
884
+ /**
885
+ * Deposit either ETH, ERC20 or ERC721 tokens
886
+ *
887
+ * @param {TokenAmount} request The token type amount in its corresponding unit
888
+ * @return {Promise<TransactionResponse>} Returns a promise that resolves with the transaction
889
+ */
890
+ deposit(deposit: TokenAmount): Promise<TransactionResponse>;
891
+ /**
892
+ * Create a Withdrawal
893
+ *
894
+ * @param {TokenAmount} request The token type amount in its corresponding unit
895
+ * @return {Promise<CreateWithdrawalResponse>} Returns a promise that resolves with the created Withdrawal
896
+ */
897
+ prepareWithdrawal(request: TokenAmount): Promise<CreateWithdrawalResponse>;
898
+ /**
899
+ * Completes a Withdrawal
900
+ *
901
+ * @param {string} starkPublicKey The stark public key
902
+ * @param {AnyToken} token The token to withdraw
903
+ * @return {Promise<TransactionResponse>} Returns a promise that resolves with the transaction
904
+ */
905
+ completeWithdrawal(starkPublicKey: string, token: AnyToken): Promise<TransactionResponse>;
906
+ }
907
+
908
+ declare class GenericIMXProvider implements IMXProvider {
909
+ private readonly config;
910
+ private readonly signers;
911
+ constructor(config: ProviderConfiguration$1, ethSigner: Signer, starkSigner: StarkSigner);
912
+ getAddress(): Promise<string>;
913
+ registerOffchain(): Promise<RegisterUserResponse>;
914
+ batchNftTransfer(request: Array<NftTransferDetails>): Promise<CreateTransferResponse>;
915
+ cancelOrder(request: GetSignableCancelOrderRequest): Promise<CancelOrderResponse>;
916
+ completeWithdrawal(starkPublicKey: string, token: AnyToken): Promise<TransactionResponse>;
917
+ createOrder(request: UnsignedOrderRequest): Promise<CreateOrderResponse>;
918
+ createTrade(request: GetSignableTradeRequest): Promise<CreateTradeResponse>;
919
+ deposit(tokenAmount: TokenAmount): Promise<TransactionResponse>;
920
+ exchangeTransfer(request: UnsignedExchangeTransferRequest): Promise<CreateTransferResponseV1>;
921
+ isRegisteredOnchain(): Promise<boolean>;
922
+ prepareWithdrawal(request: TokenAmount): Promise<CreateWithdrawalResponse>;
923
+ transfer(request: UnsignedTransferRequest): Promise<CreateTransferResponseV1>;
924
+ }
925
+
926
+ declare class MetaMaskIMXProvider extends GenericIMXProvider {
927
+ private static imxSigner;
928
+ constructor(config: ProviderConfiguration$1, ethSigner: Signer, starkSigner: StarkSigner);
929
+ static connect(config: ProviderConfiguration$1): Promise<MetaMaskIMXProvider>;
930
+ static disconnect(): Promise<void>;
931
+ static signMessage(message: string): Promise<string>;
932
+ }
933
+
934
+ declare enum Environment {
935
+ PRODUCTION = "production",
936
+ SANDBOX = "sandbox"
937
+ }
938
+ declare class ImmutableConfiguration {
939
+ readonly environment: Environment;
940
+ readonly apiKey?: string;
941
+ constructor(options: {
942
+ environment: Environment;
943
+ apiKey?: string;
944
+ });
945
+ }
946
+ interface ModuleConfiguration<T> {
947
+ baseConfig: ImmutableConfiguration;
948
+ overrides?: T;
949
+ }
950
+
951
+ interface ProviderOverrides {
952
+ immutableXConfig: ImmutableXConfiguration;
953
+ }
954
+ interface ProviderModuleConfiguration extends ModuleConfiguration<ProviderOverrides> {
955
+ }
956
+ declare class ProviderConfiguration {
957
+ readonly immutableXConfig: ImmutableXConfiguration;
958
+ readonly baseConfig: ImmutableConfiguration;
959
+ constructor({ baseConfig, overrides }: ProviderModuleConfiguration);
960
+ }
961
+
962
+ export { GenericIMXProvider, IMXProvider, MetaMaskIMXProvider, ProviderConfiguration };