@imtbl/sdk 0.0.1-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.
- package/dist/base.d.ts +18 -0
- package/dist/base.js +15 -0
- package/dist/browser/checkout.js +2 -0
- package/dist/checkout_sdk.d.ts +673 -0
- package/dist/checkout_sdk.js +471 -0
- package/dist/checkout_widgets.d.ts +14444 -0
- package/dist/checkout_widgets.js +185 -0
- package/dist/index.cjs +2576 -0
- package/dist/index.d.ts +23898 -0
- package/dist/index.js +2547 -0
- package/dist/passport.d.ts +736 -0
- package/dist/passport.js +910 -0
- package/dist/provider.d.ts +962 -0
- package/dist/provider.js +1139 -0
- package/dist/starkex.d.ts +8421 -0
- package/dist/starkex.js +10 -0
- package/package.json +97 -0
|
@@ -0,0 +1,736 @@
|
|
|
1
|
+
declare enum PassportErrorType {
|
|
2
|
+
AUTHENTICATION_ERROR = "AUTHENTICATION_ERROR",
|
|
3
|
+
INVALID_CONFIGURATION = "INVALID_CONFIGURATION",
|
|
4
|
+
WALLET_CONNECTION_ERROR = "WALLET_CONNECTION_ERROR",
|
|
5
|
+
NOT_LOGGED_IN_ERROR = "NOT_LOGGED_IN_ERROR",
|
|
6
|
+
REFRESH_TOKEN_ERROR = "REFRESH_TOKEN_ERROR",
|
|
7
|
+
USER_REGISTRATION_ERROR = "USER_REGISTRATION_ERROR",
|
|
8
|
+
LOGOUT_ERROR = "LOGOUT_ERROR",
|
|
9
|
+
TRANSFER_ERROR = "TRANSFER_ERROR",
|
|
10
|
+
CREATE_ORDER_ERROR = "CREATE_ORDER_ERROR",
|
|
11
|
+
CANCEL_ORDER_ERROR = "CANCEL_ORDER_ERROR",
|
|
12
|
+
EXCHANGE_TRANSFER_ERROR = "EXCHANGE_TRANSFER_ERROR",
|
|
13
|
+
CREATE_TRADE_ERROR = "CREATE_TRADE_ERROR",
|
|
14
|
+
OPERATION_NOT_SUPPORTED_ERROR = "OPERATION_NOT_SUPPORTED_ERROR"
|
|
15
|
+
}
|
|
16
|
+
declare class PassportError extends Error {
|
|
17
|
+
type: PassportErrorType;
|
|
18
|
+
constructor(message: string, type: PassportErrorType);
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
declare type Bytes = ArrayLike<number>;
|
|
22
|
+
interface Hexable {
|
|
23
|
+
toHexString(): string;
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
declare type BigNumberish = BigNumber | Bytes | bigint | string | number;
|
|
27
|
+
declare class BigNumber implements Hexable {
|
|
28
|
+
readonly _hex: string;
|
|
29
|
+
readonly _isBigNumber: boolean;
|
|
30
|
+
constructor(constructorGuard: any, hex: string);
|
|
31
|
+
fromTwos(value: number): BigNumber;
|
|
32
|
+
toTwos(value: number): BigNumber;
|
|
33
|
+
abs(): BigNumber;
|
|
34
|
+
add(other: BigNumberish): BigNumber;
|
|
35
|
+
sub(other: BigNumberish): BigNumber;
|
|
36
|
+
div(other: BigNumberish): BigNumber;
|
|
37
|
+
mul(other: BigNumberish): BigNumber;
|
|
38
|
+
mod(other: BigNumberish): BigNumber;
|
|
39
|
+
pow(other: BigNumberish): BigNumber;
|
|
40
|
+
and(other: BigNumberish): BigNumber;
|
|
41
|
+
or(other: BigNumberish): BigNumber;
|
|
42
|
+
xor(other: BigNumberish): BigNumber;
|
|
43
|
+
mask(value: number): BigNumber;
|
|
44
|
+
shl(value: number): BigNumber;
|
|
45
|
+
shr(value: number): BigNumber;
|
|
46
|
+
eq(other: BigNumberish): boolean;
|
|
47
|
+
lt(other: BigNumberish): boolean;
|
|
48
|
+
lte(other: BigNumberish): boolean;
|
|
49
|
+
gt(other: BigNumberish): boolean;
|
|
50
|
+
gte(other: BigNumberish): boolean;
|
|
51
|
+
isNegative(): boolean;
|
|
52
|
+
isZero(): boolean;
|
|
53
|
+
toNumber(): number;
|
|
54
|
+
toBigInt(): bigint;
|
|
55
|
+
toString(): string;
|
|
56
|
+
toHexString(): string;
|
|
57
|
+
toJSON(key?: string): any;
|
|
58
|
+
static from(value: any): BigNumber;
|
|
59
|
+
static isBigNumber(value: any): value is BigNumber;
|
|
60
|
+
}
|
|
61
|
+
|
|
62
|
+
declare type AccessList = Array<{
|
|
63
|
+
address: string;
|
|
64
|
+
storageKeys: Array<string>;
|
|
65
|
+
}>;
|
|
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 TransactionResponse extends Transaction {
|
|
86
|
+
hash: string;
|
|
87
|
+
blockNumber?: number;
|
|
88
|
+
blockHash?: string;
|
|
89
|
+
timestamp?: number;
|
|
90
|
+
confirmations: number;
|
|
91
|
+
from: string;
|
|
92
|
+
raw?: string;
|
|
93
|
+
wait: (confirmations?: number) => Promise<TransactionReceipt>;
|
|
94
|
+
}
|
|
95
|
+
interface Log {
|
|
96
|
+
blockNumber: number;
|
|
97
|
+
blockHash: string;
|
|
98
|
+
transactionIndex: number;
|
|
99
|
+
removed: boolean;
|
|
100
|
+
address: string;
|
|
101
|
+
data: string;
|
|
102
|
+
topics: Array<string>;
|
|
103
|
+
transactionHash: string;
|
|
104
|
+
logIndex: number;
|
|
105
|
+
}
|
|
106
|
+
interface TransactionReceipt {
|
|
107
|
+
to: string;
|
|
108
|
+
from: string;
|
|
109
|
+
contractAddress: string;
|
|
110
|
+
transactionIndex: number;
|
|
111
|
+
root?: string;
|
|
112
|
+
gasUsed: BigNumber;
|
|
113
|
+
logsBloom: string;
|
|
114
|
+
blockHash: string;
|
|
115
|
+
transactionHash: string;
|
|
116
|
+
logs: Array<Log>;
|
|
117
|
+
blockNumber: number;
|
|
118
|
+
confirmations: number;
|
|
119
|
+
cumulativeGasUsed: BigNumber;
|
|
120
|
+
effectiveGasPrice: BigNumber;
|
|
121
|
+
byzantium: boolean;
|
|
122
|
+
type: number;
|
|
123
|
+
status?: number;
|
|
124
|
+
}
|
|
125
|
+
|
|
126
|
+
/**
|
|
127
|
+
* An ERC20 token
|
|
128
|
+
*/
|
|
129
|
+
interface ERC20Token {
|
|
130
|
+
type: 'ERC20';
|
|
131
|
+
tokenAddress: string;
|
|
132
|
+
}
|
|
133
|
+
/**
|
|
134
|
+
* An ERC721 token
|
|
135
|
+
*/
|
|
136
|
+
interface ERC721Token {
|
|
137
|
+
type: 'ERC721';
|
|
138
|
+
tokenId: string;
|
|
139
|
+
tokenAddress: string;
|
|
140
|
+
}
|
|
141
|
+
/**
|
|
142
|
+
* An ETH token
|
|
143
|
+
*/
|
|
144
|
+
interface ETHToken {
|
|
145
|
+
type: 'ETH';
|
|
146
|
+
}
|
|
147
|
+
/**
|
|
148
|
+
* An amount of ETH token of unit Wei
|
|
149
|
+
*/
|
|
150
|
+
interface ETHAmount extends ETHToken {
|
|
151
|
+
/**
|
|
152
|
+
* An amount in unit Wei
|
|
153
|
+
*/
|
|
154
|
+
amount: string;
|
|
155
|
+
}
|
|
156
|
+
/**
|
|
157
|
+
* The token details and amount of ERC20 token units
|
|
158
|
+
*/
|
|
159
|
+
interface ERC20Amount extends ERC20Token {
|
|
160
|
+
/**
|
|
161
|
+
* An amount in units for the given ERC20 token
|
|
162
|
+
*/
|
|
163
|
+
amount: string;
|
|
164
|
+
}
|
|
165
|
+
/**
|
|
166
|
+
* Union type that represents all token types
|
|
167
|
+
*/
|
|
168
|
+
declare type AnyToken = ETHToken | ERC721Token | ERC20Token;
|
|
169
|
+
/**
|
|
170
|
+
* Union type that represents all token type amounts
|
|
171
|
+
*/
|
|
172
|
+
declare type TokenAmount = ETHAmount | ERC20Amount | ERC721Token;
|
|
173
|
+
/**
|
|
174
|
+
* Union type that represents exchange token type amounts
|
|
175
|
+
*/
|
|
176
|
+
declare type ExchangeTokenAmount = ETHAmount | ERC20Amount;
|
|
177
|
+
|
|
178
|
+
/**
|
|
179
|
+
* Immutable X API
|
|
180
|
+
* No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
|
|
181
|
+
*
|
|
182
|
+
* The version of the OpenAPI document: 3.0
|
|
183
|
+
* Contact: support@immutable.com
|
|
184
|
+
*
|
|
185
|
+
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
|
|
186
|
+
* https://openapi-generator.tech
|
|
187
|
+
* Do not edit the class manually.
|
|
188
|
+
*/
|
|
189
|
+
/**
|
|
190
|
+
*
|
|
191
|
+
* @export
|
|
192
|
+
* @interface CancelOrderResponse
|
|
193
|
+
*/
|
|
194
|
+
interface CancelOrderResponse {
|
|
195
|
+
/**
|
|
196
|
+
* ID of the cancelled order
|
|
197
|
+
* @type {number}
|
|
198
|
+
* @memberof CancelOrderResponse
|
|
199
|
+
*/
|
|
200
|
+
'order_id': number;
|
|
201
|
+
/**
|
|
202
|
+
* New status of the order
|
|
203
|
+
* @type {string}
|
|
204
|
+
* @memberof CancelOrderResponse
|
|
205
|
+
*/
|
|
206
|
+
'status': string;
|
|
207
|
+
}
|
|
208
|
+
|
|
209
|
+
/**
|
|
210
|
+
* Immutable X API
|
|
211
|
+
* No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
|
|
212
|
+
*
|
|
213
|
+
* The version of the OpenAPI document: 3.0
|
|
214
|
+
* Contact: support@immutable.com
|
|
215
|
+
*
|
|
216
|
+
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
|
|
217
|
+
* https://openapi-generator.tech
|
|
218
|
+
* Do not edit the class manually.
|
|
219
|
+
*/
|
|
220
|
+
/**
|
|
221
|
+
*
|
|
222
|
+
* @export
|
|
223
|
+
* @interface FeeEntry
|
|
224
|
+
*/
|
|
225
|
+
interface FeeEntry {
|
|
226
|
+
/**
|
|
227
|
+
*
|
|
228
|
+
* @type {string}
|
|
229
|
+
* @memberof FeeEntry
|
|
230
|
+
*/
|
|
231
|
+
'address'?: string;
|
|
232
|
+
/**
|
|
233
|
+
*
|
|
234
|
+
* @type {number}
|
|
235
|
+
* @memberof FeeEntry
|
|
236
|
+
*/
|
|
237
|
+
'fee_percentage'?: number;
|
|
238
|
+
}
|
|
239
|
+
|
|
240
|
+
/**
|
|
241
|
+
* Immutable X API
|
|
242
|
+
* No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
|
|
243
|
+
*
|
|
244
|
+
* The version of the OpenAPI document: 3.0
|
|
245
|
+
* Contact: support@immutable.com
|
|
246
|
+
*
|
|
247
|
+
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
|
|
248
|
+
* https://openapi-generator.tech
|
|
249
|
+
* Do not edit the class manually.
|
|
250
|
+
*/
|
|
251
|
+
/**
|
|
252
|
+
*
|
|
253
|
+
* @export
|
|
254
|
+
* @interface CreateOrderResponse
|
|
255
|
+
*/
|
|
256
|
+
interface CreateOrderResponse {
|
|
257
|
+
/**
|
|
258
|
+
* ID of the created order
|
|
259
|
+
* @type {number}
|
|
260
|
+
* @memberof CreateOrderResponse
|
|
261
|
+
*/
|
|
262
|
+
'order_id': number;
|
|
263
|
+
/**
|
|
264
|
+
* Request ID as a reference for an asynchronous order creation request
|
|
265
|
+
* @type {string}
|
|
266
|
+
* @memberof CreateOrderResponse
|
|
267
|
+
*/
|
|
268
|
+
'request_id'?: string;
|
|
269
|
+
/**
|
|
270
|
+
* Status of the created order
|
|
271
|
+
* @type {string}
|
|
272
|
+
* @memberof CreateOrderResponse
|
|
273
|
+
*/
|
|
274
|
+
'status': string;
|
|
275
|
+
/**
|
|
276
|
+
* Timestamp of the created order
|
|
277
|
+
* @type {number}
|
|
278
|
+
* @memberof CreateOrderResponse
|
|
279
|
+
*/
|
|
280
|
+
'time': number;
|
|
281
|
+
}
|
|
282
|
+
|
|
283
|
+
/**
|
|
284
|
+
* Immutable X API
|
|
285
|
+
* No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
|
|
286
|
+
*
|
|
287
|
+
* The version of the OpenAPI document: 3.0
|
|
288
|
+
* Contact: support@immutable.com
|
|
289
|
+
*
|
|
290
|
+
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
|
|
291
|
+
* https://openapi-generator.tech
|
|
292
|
+
* Do not edit the class manually.
|
|
293
|
+
*/
|
|
294
|
+
/**
|
|
295
|
+
*
|
|
296
|
+
* @export
|
|
297
|
+
* @interface CreateTradeResponse
|
|
298
|
+
*/
|
|
299
|
+
interface CreateTradeResponse {
|
|
300
|
+
/**
|
|
301
|
+
* Request ID as a reference for an asynchronous trade creation request
|
|
302
|
+
* @type {string}
|
|
303
|
+
* @memberof CreateTradeResponse
|
|
304
|
+
*/
|
|
305
|
+
'request_id'?: string;
|
|
306
|
+
/**
|
|
307
|
+
* Current status of trade
|
|
308
|
+
* @type {string}
|
|
309
|
+
* @memberof CreateTradeResponse
|
|
310
|
+
*/
|
|
311
|
+
'status': string;
|
|
312
|
+
/**
|
|
313
|
+
* ID of trade within Immutable X
|
|
314
|
+
* @type {number}
|
|
315
|
+
* @memberof CreateTradeResponse
|
|
316
|
+
*/
|
|
317
|
+
'trade_id': number;
|
|
318
|
+
}
|
|
319
|
+
|
|
320
|
+
/**
|
|
321
|
+
* Immutable X API
|
|
322
|
+
* No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
|
|
323
|
+
*
|
|
324
|
+
* The version of the OpenAPI document: 3.0
|
|
325
|
+
* Contact: support@immutable.com
|
|
326
|
+
*
|
|
327
|
+
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
|
|
328
|
+
* https://openapi-generator.tech
|
|
329
|
+
* Do not edit the class manually.
|
|
330
|
+
*/
|
|
331
|
+
/**
|
|
332
|
+
*
|
|
333
|
+
* @export
|
|
334
|
+
* @interface CreateTransferResponse
|
|
335
|
+
*/
|
|
336
|
+
interface CreateTransferResponse {
|
|
337
|
+
/**
|
|
338
|
+
* List of transfer IDs
|
|
339
|
+
* @type {Array<number>}
|
|
340
|
+
* @memberof CreateTransferResponse
|
|
341
|
+
*/
|
|
342
|
+
'transfer_ids': Array<number>;
|
|
343
|
+
}
|
|
344
|
+
|
|
345
|
+
/**
|
|
346
|
+
* Immutable X API
|
|
347
|
+
* No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
|
|
348
|
+
*
|
|
349
|
+
* The version of the OpenAPI document: 3.0
|
|
350
|
+
* Contact: support@immutable.com
|
|
351
|
+
*
|
|
352
|
+
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
|
|
353
|
+
* https://openapi-generator.tech
|
|
354
|
+
* Do not edit the class manually.
|
|
355
|
+
*/
|
|
356
|
+
/**
|
|
357
|
+
*
|
|
358
|
+
* @export
|
|
359
|
+
* @interface CreateTransferResponseV1
|
|
360
|
+
*/
|
|
361
|
+
interface CreateTransferResponseV1 {
|
|
362
|
+
/**
|
|
363
|
+
* [deprecated] Sent signature
|
|
364
|
+
* @type {string}
|
|
365
|
+
* @memberof CreateTransferResponseV1
|
|
366
|
+
*/
|
|
367
|
+
'sent_signature': string;
|
|
368
|
+
/**
|
|
369
|
+
* [deprecated] The status of transfer
|
|
370
|
+
* @type {string}
|
|
371
|
+
* @memberof CreateTransferResponseV1
|
|
372
|
+
*/
|
|
373
|
+
'status': string;
|
|
374
|
+
/**
|
|
375
|
+
* [deprecated] Time of the transfer
|
|
376
|
+
* @type {number}
|
|
377
|
+
* @memberof CreateTransferResponseV1
|
|
378
|
+
*/
|
|
379
|
+
'time': number;
|
|
380
|
+
/**
|
|
381
|
+
* ID of the transfer
|
|
382
|
+
* @type {number}
|
|
383
|
+
* @memberof CreateTransferResponseV1
|
|
384
|
+
*/
|
|
385
|
+
'transfer_id': number;
|
|
386
|
+
}
|
|
387
|
+
|
|
388
|
+
/**
|
|
389
|
+
* Immutable X API
|
|
390
|
+
* No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
|
|
391
|
+
*
|
|
392
|
+
* The version of the OpenAPI document: 3.0
|
|
393
|
+
* Contact: support@immutable.com
|
|
394
|
+
*
|
|
395
|
+
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
|
|
396
|
+
* https://openapi-generator.tech
|
|
397
|
+
* Do not edit the class manually.
|
|
398
|
+
*/
|
|
399
|
+
/**
|
|
400
|
+
*
|
|
401
|
+
* @export
|
|
402
|
+
* @interface CreateWithdrawalResponse
|
|
403
|
+
*/
|
|
404
|
+
interface CreateWithdrawalResponse {
|
|
405
|
+
/**
|
|
406
|
+
* Status of the withdrawal
|
|
407
|
+
* @type {string}
|
|
408
|
+
* @memberof CreateWithdrawalResponse
|
|
409
|
+
*/
|
|
410
|
+
'status': string;
|
|
411
|
+
/**
|
|
412
|
+
* Time of the withdrawal
|
|
413
|
+
* @type {number}
|
|
414
|
+
* @memberof CreateWithdrawalResponse
|
|
415
|
+
*/
|
|
416
|
+
'time': number;
|
|
417
|
+
/**
|
|
418
|
+
* ID of the withdrawal
|
|
419
|
+
* @type {number}
|
|
420
|
+
* @memberof CreateWithdrawalResponse
|
|
421
|
+
*/
|
|
422
|
+
'withdrawal_id': number;
|
|
423
|
+
}
|
|
424
|
+
|
|
425
|
+
/**
|
|
426
|
+
* Immutable X API
|
|
427
|
+
* No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
|
|
428
|
+
*
|
|
429
|
+
* The version of the OpenAPI document: 3.0
|
|
430
|
+
* Contact: support@immutable.com
|
|
431
|
+
*
|
|
432
|
+
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
|
|
433
|
+
* https://openapi-generator.tech
|
|
434
|
+
* Do not edit the class manually.
|
|
435
|
+
*/
|
|
436
|
+
/**
|
|
437
|
+
*
|
|
438
|
+
* @export
|
|
439
|
+
* @interface GetSignableCancelOrderRequest
|
|
440
|
+
*/
|
|
441
|
+
interface GetSignableCancelOrderRequest {
|
|
442
|
+
/**
|
|
443
|
+
* ID of the order to be cancelled
|
|
444
|
+
* @type {number}
|
|
445
|
+
* @memberof GetSignableCancelOrderRequest
|
|
446
|
+
*/
|
|
447
|
+
'order_id': number;
|
|
448
|
+
}
|
|
449
|
+
|
|
450
|
+
/**
|
|
451
|
+
* Immutable X API
|
|
452
|
+
* No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
|
|
453
|
+
*
|
|
454
|
+
* The version of the OpenAPI document: 3.0
|
|
455
|
+
* Contact: support@immutable.com
|
|
456
|
+
*
|
|
457
|
+
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
|
|
458
|
+
* https://openapi-generator.tech
|
|
459
|
+
* Do not edit the class manually.
|
|
460
|
+
*/
|
|
461
|
+
|
|
462
|
+
/**
|
|
463
|
+
*
|
|
464
|
+
* @export
|
|
465
|
+
* @interface GetSignableTradeRequest
|
|
466
|
+
*/
|
|
467
|
+
interface GetSignableTradeRequest {
|
|
468
|
+
/**
|
|
469
|
+
* ExpirationTimestamp in Unix time. Note: will be rounded down to the nearest hour
|
|
470
|
+
* @type {number}
|
|
471
|
+
* @memberof GetSignableTradeRequest
|
|
472
|
+
*/
|
|
473
|
+
'expiration_timestamp'?: number;
|
|
474
|
+
/**
|
|
475
|
+
* Inclusion of either maker or taker fees
|
|
476
|
+
* @type {Array<FeeEntry>}
|
|
477
|
+
* @memberof GetSignableTradeRequest
|
|
478
|
+
*/
|
|
479
|
+
'fees'?: Array<FeeEntry>;
|
|
480
|
+
/**
|
|
481
|
+
* The ID of the maker order involved
|
|
482
|
+
* @type {number}
|
|
483
|
+
* @memberof GetSignableTradeRequest
|
|
484
|
+
*/
|
|
485
|
+
'order_id': number;
|
|
486
|
+
/**
|
|
487
|
+
* Ethereum address of the submitting user
|
|
488
|
+
* @type {string}
|
|
489
|
+
* @memberof GetSignableTradeRequest
|
|
490
|
+
*/
|
|
491
|
+
'user': string;
|
|
492
|
+
}
|
|
493
|
+
|
|
494
|
+
/**
|
|
495
|
+
* Immutable X API
|
|
496
|
+
* No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
|
|
497
|
+
*
|
|
498
|
+
* The version of the OpenAPI document: 3.0
|
|
499
|
+
* Contact: support@immutable.com
|
|
500
|
+
*
|
|
501
|
+
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
|
|
502
|
+
* https://openapi-generator.tech
|
|
503
|
+
* Do not edit the class manually.
|
|
504
|
+
*/
|
|
505
|
+
/**
|
|
506
|
+
*
|
|
507
|
+
* @export
|
|
508
|
+
* @interface RegisterUserResponse
|
|
509
|
+
*/
|
|
510
|
+
interface RegisterUserResponse {
|
|
511
|
+
/**
|
|
512
|
+
* Immutable signature authorising registration
|
|
513
|
+
* @type {string}
|
|
514
|
+
* @memberof RegisterUserResponse
|
|
515
|
+
*/
|
|
516
|
+
'tx_hash': string;
|
|
517
|
+
}
|
|
518
|
+
|
|
519
|
+
/**
|
|
520
|
+
* Parameter required to create an Order
|
|
521
|
+
*/
|
|
522
|
+
interface UnsignedOrderRequest {
|
|
523
|
+
/**
|
|
524
|
+
* The amount of tokens that will be bought for this order
|
|
525
|
+
*/
|
|
526
|
+
buy: TokenAmount;
|
|
527
|
+
/**
|
|
528
|
+
* The amount of tokens that will be sold for this order
|
|
529
|
+
*/
|
|
530
|
+
sell: TokenAmount;
|
|
531
|
+
/**
|
|
532
|
+
* ExpirationTimestamp in Unix time. Note: will be rounded down to the nearest hour
|
|
533
|
+
*/
|
|
534
|
+
expiration_timestamp?: number;
|
|
535
|
+
/**
|
|
536
|
+
* Inclusion of either maker or taker fees
|
|
537
|
+
*/
|
|
538
|
+
fees?: Array<FeeEntry>;
|
|
539
|
+
}
|
|
540
|
+
/**
|
|
541
|
+
* Parameter required to create a Transfer
|
|
542
|
+
*/
|
|
543
|
+
declare type UnsignedTransferRequest = TokenAmount & {
|
|
544
|
+
/**
|
|
545
|
+
* Ethereum address of the receiving user
|
|
546
|
+
*/
|
|
547
|
+
receiver: string;
|
|
548
|
+
};
|
|
549
|
+
/**
|
|
550
|
+
* Parameter required to create a Transfer
|
|
551
|
+
*/
|
|
552
|
+
declare type UnsignedExchangeTransferRequest = ExchangeTokenAmount & {
|
|
553
|
+
/**
|
|
554
|
+
* Ethereum address of the receiving user
|
|
555
|
+
*/
|
|
556
|
+
receiver: string;
|
|
557
|
+
/**
|
|
558
|
+
* Exchange transaction ID
|
|
559
|
+
*/
|
|
560
|
+
transactionID: string;
|
|
561
|
+
};
|
|
562
|
+
|
|
563
|
+
/**
|
|
564
|
+
* Parameter required to create a batchNftTransfer
|
|
565
|
+
*/
|
|
566
|
+
interface NftTransferDetails {
|
|
567
|
+
/**
|
|
568
|
+
* Ethereum address of the receiving user
|
|
569
|
+
*/
|
|
570
|
+
receiver: string;
|
|
571
|
+
/**
|
|
572
|
+
* The token ID
|
|
573
|
+
*/
|
|
574
|
+
tokenId: string;
|
|
575
|
+
/**
|
|
576
|
+
* The token contract address
|
|
577
|
+
*/
|
|
578
|
+
tokenAddress: string;
|
|
579
|
+
}
|
|
580
|
+
|
|
581
|
+
interface IMXProvider {
|
|
582
|
+
/**
|
|
583
|
+
* Get the Signer address
|
|
584
|
+
*
|
|
585
|
+
* @return {Promise<string>} Returns a promise that resolves with the signer's address
|
|
586
|
+
*/
|
|
587
|
+
getAddress(): Promise<string>;
|
|
588
|
+
/**
|
|
589
|
+
* Register a User to Immutable X if they are not already registered
|
|
590
|
+
*
|
|
591
|
+
* @return {Promise<RegisterUserResponse>} Returns a promise that resolves with the user registration response
|
|
592
|
+
*/
|
|
593
|
+
registerOffchain(): Promise<RegisterUserResponse>;
|
|
594
|
+
/**
|
|
595
|
+
* Checks if a User is registered on-chain
|
|
596
|
+
*
|
|
597
|
+
* @return {Promise<boolean>} Returns a promise that resolves with true if the User is registered, false otherwise
|
|
598
|
+
*/
|
|
599
|
+
isRegisteredOnchain(): Promise<boolean>;
|
|
600
|
+
/**
|
|
601
|
+
* Create an Order
|
|
602
|
+
*
|
|
603
|
+
* @param {UnsignedOrderRequest} request The unsigned order request to create an order
|
|
604
|
+
* @return {Promise<CreateOrderResponse>} Returns a promise that resolves with the created Order
|
|
605
|
+
*/
|
|
606
|
+
createOrder(request: UnsignedOrderRequest): Promise<CreateOrderResponse>;
|
|
607
|
+
/**
|
|
608
|
+
* Cancel an Order
|
|
609
|
+
*
|
|
610
|
+
* @param {GetSignableCancelOrderRequest} request The signable cancel order request
|
|
611
|
+
* @return {Promise<CancelOrderResponse>} Returns a promise that resolves with the cancelled Order
|
|
612
|
+
*/
|
|
613
|
+
cancelOrder(request: GetSignableCancelOrderRequest): Promise<CancelOrderResponse>;
|
|
614
|
+
/**
|
|
615
|
+
* Create a Trade
|
|
616
|
+
*
|
|
617
|
+
* @param {GetSignableTradeRequest} request The signable trade request
|
|
618
|
+
* @return {Promise<CreateTradeResponse>} Returns a promise that resolves with the created Trade
|
|
619
|
+
*/
|
|
620
|
+
createTrade(request: GetSignableTradeRequest): Promise<CreateTradeResponse>;
|
|
621
|
+
/**
|
|
622
|
+
* Create a new Transfer request
|
|
623
|
+
*
|
|
624
|
+
* @param {UnsignedTransferRequest} request The unsigned transfer request
|
|
625
|
+
* @return {Promise<CreateTransferResponseV1>} Returns a promise that resolves with the created Transfer
|
|
626
|
+
*/
|
|
627
|
+
transfer(request: UnsignedTransferRequest): Promise<CreateTransferResponseV1>;
|
|
628
|
+
/**
|
|
629
|
+
* Create a batch of NFT transfer requests
|
|
630
|
+
*
|
|
631
|
+
* @param {Array<NftTransferDetails>} request An array of NFT transfer details
|
|
632
|
+
* @return {Promise<CreateTransferResponse>} Resolves a promise that resolves with the list of Transfer IDs
|
|
633
|
+
*/
|
|
634
|
+
batchNftTransfer(request: Array<NftTransferDetails>): Promise<CreateTransferResponse>;
|
|
635
|
+
/**
|
|
636
|
+
* Create a new Exchange transaction
|
|
637
|
+
*
|
|
638
|
+
* @param {UnsignedExchangeTransferRequest} request The unsigned exchange transfer request
|
|
639
|
+
* @return {Promise<CreateTransferResponseV1>} Returns a promise that resolves with the created Exchange Transaction
|
|
640
|
+
*/
|
|
641
|
+
exchangeTransfer(request: UnsignedExchangeTransferRequest): Promise<CreateTransferResponseV1>;
|
|
642
|
+
/**
|
|
643
|
+
* Deposit either ETH, ERC20 or ERC721 tokens
|
|
644
|
+
*
|
|
645
|
+
* @param {TokenAmount} request The token type amount in its corresponding unit
|
|
646
|
+
* @return {Promise<TransactionResponse>} Returns a promise that resolves with the transaction
|
|
647
|
+
*/
|
|
648
|
+
deposit(deposit: TokenAmount): Promise<TransactionResponse>;
|
|
649
|
+
/**
|
|
650
|
+
* Create a Withdrawal
|
|
651
|
+
*
|
|
652
|
+
* @param {TokenAmount} request The token type amount in its corresponding unit
|
|
653
|
+
* @return {Promise<CreateWithdrawalResponse>} Returns a promise that resolves with the created Withdrawal
|
|
654
|
+
*/
|
|
655
|
+
prepareWithdrawal(request: TokenAmount): Promise<CreateWithdrawalResponse>;
|
|
656
|
+
/**
|
|
657
|
+
* Completes a Withdrawal
|
|
658
|
+
*
|
|
659
|
+
* @param {string} starkPublicKey The stark public key
|
|
660
|
+
* @param {AnyToken} token The token to withdraw
|
|
661
|
+
* @return {Promise<TransactionResponse>} Returns a promise that resolves with the transaction
|
|
662
|
+
*/
|
|
663
|
+
completeWithdrawal(starkPublicKey: string, token: AnyToken): Promise<TransactionResponse>;
|
|
664
|
+
}
|
|
665
|
+
|
|
666
|
+
declare enum Environment {
|
|
667
|
+
PRODUCTION = "production",
|
|
668
|
+
SANDBOX = "sandbox"
|
|
669
|
+
}
|
|
670
|
+
declare class ImmutableConfiguration {
|
|
671
|
+
readonly environment: Environment;
|
|
672
|
+
readonly apiKey?: string;
|
|
673
|
+
constructor(options: {
|
|
674
|
+
environment: Environment;
|
|
675
|
+
apiKey?: string;
|
|
676
|
+
});
|
|
677
|
+
}
|
|
678
|
+
interface ModuleConfiguration<T> {
|
|
679
|
+
baseConfig: ImmutableConfiguration;
|
|
680
|
+
overrides?: T;
|
|
681
|
+
}
|
|
682
|
+
|
|
683
|
+
type UserProfile = {
|
|
684
|
+
email?: string;
|
|
685
|
+
nickname?: string;
|
|
686
|
+
sub: string;
|
|
687
|
+
};
|
|
688
|
+
declare enum Networks {
|
|
689
|
+
PRODUCTION = "mainnet",
|
|
690
|
+
SANDBOX = "goerli"
|
|
691
|
+
}
|
|
692
|
+
interface OidcConfiguration {
|
|
693
|
+
clientId: string;
|
|
694
|
+
logoutRedirectUri: string;
|
|
695
|
+
redirectUri: string;
|
|
696
|
+
scope?: string;
|
|
697
|
+
audience?: string;
|
|
698
|
+
}
|
|
699
|
+
interface PassportOverrides {
|
|
700
|
+
network: Networks;
|
|
701
|
+
authenticationDomain: string;
|
|
702
|
+
magicPublishableApiKey: string;
|
|
703
|
+
magicProviderId: string;
|
|
704
|
+
passportDomain: string;
|
|
705
|
+
imxApiBasePath: string;
|
|
706
|
+
}
|
|
707
|
+
interface PassportModuleConfiguration extends ModuleConfiguration<PassportOverrides>, OidcConfiguration {
|
|
708
|
+
}
|
|
709
|
+
|
|
710
|
+
declare class Passport {
|
|
711
|
+
private authManager;
|
|
712
|
+
private magicAdapter;
|
|
713
|
+
private readonly config;
|
|
714
|
+
constructor(passportModuleConfiguration: PassportModuleConfiguration);
|
|
715
|
+
connectImx(): Promise<IMXProvider>;
|
|
716
|
+
loginCallback(): Promise<void>;
|
|
717
|
+
logout(): Promise<void>;
|
|
718
|
+
getUserInfo(): Promise<UserProfile>;
|
|
719
|
+
getIdToken(): Promise<string | undefined>;
|
|
720
|
+
getAccessToken(): Promise<string>;
|
|
721
|
+
private registerUser;
|
|
722
|
+
}
|
|
723
|
+
|
|
724
|
+
declare class PassportConfiguration {
|
|
725
|
+
readonly network: Networks;
|
|
726
|
+
readonly authenticationDomain: string;
|
|
727
|
+
readonly passportDomain: string;
|
|
728
|
+
readonly magicPublishableApiKey: string;
|
|
729
|
+
readonly magicProviderId: string;
|
|
730
|
+
readonly imxApiBasePath: string;
|
|
731
|
+
readonly oidcConfiguration: OidcConfiguration;
|
|
732
|
+
readonly baseConfig: ImmutableConfiguration;
|
|
733
|
+
constructor({ baseConfig, overrides, ...oidcConfiguration }: PassportModuleConfiguration);
|
|
734
|
+
}
|
|
735
|
+
|
|
736
|
+
export { Passport, PassportConfiguration, PassportError };
|