@imtbl/sdk 0.1.4-alpha → 0.1.6-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/checkout_sdk.d.ts +57 -3
- package/dist/checkout_sdk.js +22 -5
- package/dist/checkout_widgets.d.ts +907 -12
- package/dist/checkout_widgets.js +225 -142
- package/dist/immutablex_client.d.ts +9 -9
- package/dist/immutablex_client.js +34 -31
- package/dist/index.cjs +414 -166
- package/dist/index.d.ts +396 -23
- package/dist/index.js +417 -178
- package/dist/passport.d.ts +9 -9
- package/dist/passport.js +233 -202
- package/package.json +3 -3
|
@@ -1,4 +1,580 @@
|
|
|
1
1
|
/// <reference path="global.d.ts" />
|
|
2
|
+
/// <reference types="node" />
|
|
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 Network$1 = {
|
|
46
|
+
name: string;
|
|
47
|
+
chainId: number;
|
|
48
|
+
ensAddress?: string;
|
|
49
|
+
_defaultProvider?: (providers: any, options?: any) => any;
|
|
50
|
+
};
|
|
51
|
+
declare type Networkish = Network$1 | string | number;
|
|
52
|
+
|
|
53
|
+
declare type Deferrable<T> = {
|
|
54
|
+
[K in keyof T]: T[K] | Promise<T[K]>;
|
|
55
|
+
};
|
|
56
|
+
declare class Description<T = any> {
|
|
57
|
+
constructor(info: {
|
|
58
|
+
[K in keyof T]: T[K];
|
|
59
|
+
});
|
|
60
|
+
}
|
|
61
|
+
|
|
62
|
+
declare type AccessList = Array<{
|
|
63
|
+
address: string;
|
|
64
|
+
storageKeys: Array<string>;
|
|
65
|
+
}>;
|
|
66
|
+
declare type AccessListish = AccessList | Array<[string, Array<string>]> | Record<string, Array<string>>;
|
|
67
|
+
interface Transaction {
|
|
68
|
+
hash?: string;
|
|
69
|
+
to?: string;
|
|
70
|
+
from?: string;
|
|
71
|
+
nonce: number;
|
|
72
|
+
gasLimit: BigNumber;
|
|
73
|
+
gasPrice?: BigNumber;
|
|
74
|
+
data: string;
|
|
75
|
+
value: BigNumber;
|
|
76
|
+
chainId: number;
|
|
77
|
+
r?: string;
|
|
78
|
+
s?: string;
|
|
79
|
+
v?: number;
|
|
80
|
+
type?: number | null;
|
|
81
|
+
accessList?: AccessList;
|
|
82
|
+
maxPriorityFeePerGas?: BigNumber;
|
|
83
|
+
maxFeePerGas?: BigNumber;
|
|
84
|
+
}
|
|
85
|
+
|
|
86
|
+
declare type ConnectionInfo = {
|
|
87
|
+
url: string;
|
|
88
|
+
headers?: {
|
|
89
|
+
[key: string]: string | number;
|
|
90
|
+
};
|
|
91
|
+
user?: string;
|
|
92
|
+
password?: string;
|
|
93
|
+
allowInsecureAuthentication?: boolean;
|
|
94
|
+
allowGzip?: boolean;
|
|
95
|
+
throttleLimit?: number;
|
|
96
|
+
throttleSlotInterval?: number;
|
|
97
|
+
throttleCallback?: (attempt: number, url: string) => Promise<boolean>;
|
|
98
|
+
skipFetchSetup?: boolean;
|
|
99
|
+
fetchOptions?: Record<string, string>;
|
|
100
|
+
errorPassThrough?: boolean;
|
|
101
|
+
timeout?: number;
|
|
102
|
+
};
|
|
103
|
+
interface OnceBlockable {
|
|
104
|
+
once(eventName: "block", handler: () => void): void;
|
|
105
|
+
}
|
|
106
|
+
|
|
107
|
+
declare type TransactionRequest = {
|
|
108
|
+
to?: string;
|
|
109
|
+
from?: string;
|
|
110
|
+
nonce?: BigNumberish;
|
|
111
|
+
gasLimit?: BigNumberish;
|
|
112
|
+
gasPrice?: BigNumberish;
|
|
113
|
+
data?: BytesLike;
|
|
114
|
+
value?: BigNumberish;
|
|
115
|
+
chainId?: number;
|
|
116
|
+
type?: number;
|
|
117
|
+
accessList?: AccessListish;
|
|
118
|
+
maxPriorityFeePerGas?: BigNumberish;
|
|
119
|
+
maxFeePerGas?: BigNumberish;
|
|
120
|
+
customData?: Record<string, any>;
|
|
121
|
+
ccipReadEnabled?: boolean;
|
|
122
|
+
};
|
|
123
|
+
interface TransactionResponse extends Transaction {
|
|
124
|
+
hash: string;
|
|
125
|
+
blockNumber?: number;
|
|
126
|
+
blockHash?: string;
|
|
127
|
+
timestamp?: number;
|
|
128
|
+
confirmations: number;
|
|
129
|
+
from: string;
|
|
130
|
+
raw?: string;
|
|
131
|
+
wait: (confirmations?: number) => Promise<TransactionReceipt>;
|
|
132
|
+
}
|
|
133
|
+
declare type BlockTag = string | number;
|
|
134
|
+
interface _Block {
|
|
135
|
+
hash: string;
|
|
136
|
+
parentHash: string;
|
|
137
|
+
number: number;
|
|
138
|
+
timestamp: number;
|
|
139
|
+
nonce: string;
|
|
140
|
+
difficulty: number;
|
|
141
|
+
_difficulty: BigNumber;
|
|
142
|
+
gasLimit: BigNumber;
|
|
143
|
+
gasUsed: BigNumber;
|
|
144
|
+
miner: string;
|
|
145
|
+
extraData: string;
|
|
146
|
+
baseFeePerGas?: null | BigNumber;
|
|
147
|
+
}
|
|
148
|
+
interface Block extends _Block {
|
|
149
|
+
transactions: Array<string>;
|
|
150
|
+
}
|
|
151
|
+
interface BlockWithTransactions extends _Block {
|
|
152
|
+
transactions: Array<TransactionResponse>;
|
|
153
|
+
}
|
|
154
|
+
interface Log {
|
|
155
|
+
blockNumber: number;
|
|
156
|
+
blockHash: string;
|
|
157
|
+
transactionIndex: number;
|
|
158
|
+
removed: boolean;
|
|
159
|
+
address: string;
|
|
160
|
+
data: string;
|
|
161
|
+
topics: Array<string>;
|
|
162
|
+
transactionHash: string;
|
|
163
|
+
logIndex: number;
|
|
164
|
+
}
|
|
165
|
+
interface TransactionReceipt {
|
|
166
|
+
to: string;
|
|
167
|
+
from: string;
|
|
168
|
+
contractAddress: string;
|
|
169
|
+
transactionIndex: number;
|
|
170
|
+
root?: string;
|
|
171
|
+
gasUsed: BigNumber;
|
|
172
|
+
logsBloom: string;
|
|
173
|
+
blockHash: string;
|
|
174
|
+
transactionHash: string;
|
|
175
|
+
logs: Array<Log>;
|
|
176
|
+
blockNumber: number;
|
|
177
|
+
confirmations: number;
|
|
178
|
+
cumulativeGasUsed: BigNumber;
|
|
179
|
+
effectiveGasPrice: BigNumber;
|
|
180
|
+
byzantium: boolean;
|
|
181
|
+
type: number;
|
|
182
|
+
status?: number;
|
|
183
|
+
}
|
|
184
|
+
interface FeeData {
|
|
185
|
+
lastBaseFeePerGas: null | BigNumber;
|
|
186
|
+
maxFeePerGas: null | BigNumber;
|
|
187
|
+
maxPriorityFeePerGas: null | BigNumber;
|
|
188
|
+
gasPrice: null | BigNumber;
|
|
189
|
+
}
|
|
190
|
+
interface EventFilter {
|
|
191
|
+
address?: string;
|
|
192
|
+
topics?: Array<string | Array<string> | null>;
|
|
193
|
+
}
|
|
194
|
+
interface Filter extends EventFilter {
|
|
195
|
+
fromBlock?: BlockTag;
|
|
196
|
+
toBlock?: BlockTag;
|
|
197
|
+
}
|
|
198
|
+
interface FilterByBlockHash extends EventFilter {
|
|
199
|
+
blockHash?: string;
|
|
200
|
+
}
|
|
201
|
+
declare abstract class ForkEvent extends Description {
|
|
202
|
+
readonly expiry: number;
|
|
203
|
+
readonly _isForkEvent?: boolean;
|
|
204
|
+
static isForkEvent(value: any): value is ForkEvent;
|
|
205
|
+
}
|
|
206
|
+
declare type EventType = string | Array<string | Array<string>> | EventFilter | ForkEvent;
|
|
207
|
+
declare type Listener = (...args: Array<any>) => void;
|
|
208
|
+
declare abstract class Provider implements OnceBlockable {
|
|
209
|
+
abstract getNetwork(): Promise<Network$1>;
|
|
210
|
+
abstract getBlockNumber(): Promise<number>;
|
|
211
|
+
abstract getGasPrice(): Promise<BigNumber>;
|
|
212
|
+
getFeeData(): Promise<FeeData>;
|
|
213
|
+
abstract getBalance(addressOrName: string | Promise<string>, blockTag?: BlockTag | Promise<BlockTag>): Promise<BigNumber>;
|
|
214
|
+
abstract getTransactionCount(addressOrName: string | Promise<string>, blockTag?: BlockTag | Promise<BlockTag>): Promise<number>;
|
|
215
|
+
abstract getCode(addressOrName: string | Promise<string>, blockTag?: BlockTag | Promise<BlockTag>): Promise<string>;
|
|
216
|
+
abstract getStorageAt(addressOrName: string | Promise<string>, position: BigNumberish | Promise<BigNumberish>, blockTag?: BlockTag | Promise<BlockTag>): Promise<string>;
|
|
217
|
+
abstract sendTransaction(signedTransaction: string | Promise<string>): Promise<TransactionResponse>;
|
|
218
|
+
abstract call(transaction: Deferrable<TransactionRequest>, blockTag?: BlockTag | Promise<BlockTag>): Promise<string>;
|
|
219
|
+
abstract estimateGas(transaction: Deferrable<TransactionRequest>): Promise<BigNumber>;
|
|
220
|
+
abstract getBlock(blockHashOrBlockTag: BlockTag | string | Promise<BlockTag | string>): Promise<Block>;
|
|
221
|
+
abstract getBlockWithTransactions(blockHashOrBlockTag: BlockTag | string | Promise<BlockTag | string>): Promise<BlockWithTransactions>;
|
|
222
|
+
abstract getTransaction(transactionHash: string): Promise<TransactionResponse>;
|
|
223
|
+
abstract getTransactionReceipt(transactionHash: string): Promise<TransactionReceipt>;
|
|
224
|
+
abstract getLogs(filter: Filter): Promise<Array<Log>>;
|
|
225
|
+
abstract resolveName(name: string | Promise<string>): Promise<null | string>;
|
|
226
|
+
abstract lookupAddress(address: string | Promise<string>): Promise<null | string>;
|
|
227
|
+
abstract on(eventName: EventType, listener: Listener): Provider;
|
|
228
|
+
abstract once(eventName: EventType, listener: Listener): Provider;
|
|
229
|
+
abstract emit(eventName: EventType, ...args: Array<any>): boolean;
|
|
230
|
+
abstract listenerCount(eventName?: EventType): number;
|
|
231
|
+
abstract listeners(eventName?: EventType): Array<Listener>;
|
|
232
|
+
abstract off(eventName: EventType, listener?: Listener): Provider;
|
|
233
|
+
abstract removeAllListeners(eventName?: EventType): Provider;
|
|
234
|
+
addListener(eventName: EventType, listener: Listener): Provider;
|
|
235
|
+
removeListener(eventName: EventType, listener: Listener): Provider;
|
|
236
|
+
abstract waitForTransaction(transactionHash: string, confirmations?: number, timeout?: number): Promise<TransactionReceipt>;
|
|
237
|
+
readonly _isProvider: boolean;
|
|
238
|
+
constructor();
|
|
239
|
+
static isProvider(value: any): value is Provider;
|
|
240
|
+
}
|
|
241
|
+
|
|
242
|
+
declare type FormatFunc = (value: any) => any;
|
|
243
|
+
declare type FormatFuncs = {
|
|
244
|
+
[key: string]: FormatFunc;
|
|
245
|
+
};
|
|
246
|
+
declare type Formats = {
|
|
247
|
+
transaction: FormatFuncs;
|
|
248
|
+
transactionRequest: FormatFuncs;
|
|
249
|
+
receipt: FormatFuncs;
|
|
250
|
+
receiptLog: FormatFuncs;
|
|
251
|
+
block: FormatFuncs;
|
|
252
|
+
blockWithTransactions: FormatFuncs;
|
|
253
|
+
filter: FormatFuncs;
|
|
254
|
+
filterLog: FormatFuncs;
|
|
255
|
+
};
|
|
256
|
+
declare class Formatter {
|
|
257
|
+
readonly formats: Formats;
|
|
258
|
+
constructor();
|
|
259
|
+
getDefaultFormats(): Formats;
|
|
260
|
+
accessList(accessList: Array<any>): AccessList;
|
|
261
|
+
number(number: any): number;
|
|
262
|
+
type(number: any): number;
|
|
263
|
+
bigNumber(value: any): BigNumber;
|
|
264
|
+
boolean(value: any): boolean;
|
|
265
|
+
hex(value: any, strict?: boolean): string;
|
|
266
|
+
data(value: any, strict?: boolean): string;
|
|
267
|
+
address(value: any): string;
|
|
268
|
+
callAddress(value: any): string;
|
|
269
|
+
contractAddress(value: any): string;
|
|
270
|
+
blockTag(blockTag: any): string;
|
|
271
|
+
hash(value: any, strict?: boolean): string;
|
|
272
|
+
difficulty(value: any): number;
|
|
273
|
+
uint256(value: any): string;
|
|
274
|
+
_block(value: any, format: any): Block;
|
|
275
|
+
block(value: any): Block;
|
|
276
|
+
blockWithTransactions(value: any): Block;
|
|
277
|
+
transactionRequest(value: any): any;
|
|
278
|
+
transactionResponse(transaction: any): TransactionResponse;
|
|
279
|
+
transaction(value: any): any;
|
|
280
|
+
receiptLog(value: any): any;
|
|
281
|
+
receipt(value: any): TransactionReceipt;
|
|
282
|
+
topics(value: any): any;
|
|
283
|
+
filter(value: any): any;
|
|
284
|
+
filterLog(value: any): any;
|
|
285
|
+
static check(format: {
|
|
286
|
+
[name: string]: FormatFunc;
|
|
287
|
+
}, object: any): any;
|
|
288
|
+
static allowNull(format: FormatFunc, nullValue?: any): FormatFunc;
|
|
289
|
+
static allowFalsish(format: FormatFunc, replaceValue: any): FormatFunc;
|
|
290
|
+
static arrayOf(format: FormatFunc): FormatFunc;
|
|
291
|
+
}
|
|
292
|
+
|
|
293
|
+
declare class Event$1 {
|
|
294
|
+
readonly listener: Listener;
|
|
295
|
+
readonly once: boolean;
|
|
296
|
+
readonly tag: string;
|
|
297
|
+
_lastBlockNumber: number;
|
|
298
|
+
_inflight: boolean;
|
|
299
|
+
constructor(tag: string, listener: Listener, once: boolean);
|
|
300
|
+
get event(): EventType;
|
|
301
|
+
get type(): string;
|
|
302
|
+
get hash(): string;
|
|
303
|
+
get filter(): Filter;
|
|
304
|
+
pollable(): boolean;
|
|
305
|
+
}
|
|
306
|
+
interface EnsResolver {
|
|
307
|
+
readonly name: string;
|
|
308
|
+
readonly address: string;
|
|
309
|
+
getAddress(coinType?: 60): Promise<null | string>;
|
|
310
|
+
getContentHash(): Promise<null | string>;
|
|
311
|
+
getText(key: string): Promise<null | string>;
|
|
312
|
+
}
|
|
313
|
+
interface EnsProvider {
|
|
314
|
+
resolveName(name: string): Promise<null | string>;
|
|
315
|
+
lookupAddress(address: string): Promise<null | string>;
|
|
316
|
+
getResolver(name: string): Promise<null | EnsResolver>;
|
|
317
|
+
}
|
|
318
|
+
interface Avatar {
|
|
319
|
+
url: string;
|
|
320
|
+
linkage: Array<{
|
|
321
|
+
type: string;
|
|
322
|
+
content: string;
|
|
323
|
+
}>;
|
|
324
|
+
}
|
|
325
|
+
declare class Resolver implements EnsResolver {
|
|
326
|
+
readonly provider: BaseProvider;
|
|
327
|
+
readonly name: string;
|
|
328
|
+
readonly address: string;
|
|
329
|
+
readonly _resolvedAddress: null | string;
|
|
330
|
+
_supportsEip2544: null | Promise<boolean>;
|
|
331
|
+
constructor(provider: BaseProvider, address: string, name: string, resolvedAddress?: string);
|
|
332
|
+
supportsWildcard(): Promise<boolean>;
|
|
333
|
+
_fetch(selector: string, parameters?: string): Promise<null | string>;
|
|
334
|
+
_fetchBytes(selector: string, parameters?: string): Promise<null | string>;
|
|
335
|
+
_getAddress(coinType: number, hexBytes: string): string;
|
|
336
|
+
getAddress(coinType?: number): Promise<string>;
|
|
337
|
+
getAvatar(): Promise<null | Avatar>;
|
|
338
|
+
getContentHash(): Promise<string>;
|
|
339
|
+
getText(key: string): Promise<string>;
|
|
340
|
+
}
|
|
341
|
+
declare class BaseProvider extends Provider implements EnsProvider {
|
|
342
|
+
_networkPromise: Promise<Network$1>;
|
|
343
|
+
_network: Network$1;
|
|
344
|
+
_events: Array<Event$1>;
|
|
345
|
+
formatter: Formatter;
|
|
346
|
+
_emitted: {
|
|
347
|
+
[eventName: string]: number | "pending";
|
|
348
|
+
};
|
|
349
|
+
_pollingInterval: number;
|
|
350
|
+
_poller: NodeJS.Timer;
|
|
351
|
+
_bootstrapPoll: NodeJS.Timer;
|
|
352
|
+
_lastBlockNumber: number;
|
|
353
|
+
_maxFilterBlockRange: number;
|
|
354
|
+
_fastBlockNumber: number;
|
|
355
|
+
_fastBlockNumberPromise: Promise<number>;
|
|
356
|
+
_fastQueryDate: number;
|
|
357
|
+
_maxInternalBlockNumber: number;
|
|
358
|
+
_internalBlockNumber: Promise<{
|
|
359
|
+
blockNumber: number;
|
|
360
|
+
reqTime: number;
|
|
361
|
+
respTime: number;
|
|
362
|
+
}>;
|
|
363
|
+
readonly anyNetwork: boolean;
|
|
364
|
+
disableCcipRead: boolean;
|
|
365
|
+
/**
|
|
366
|
+
* ready
|
|
367
|
+
*
|
|
368
|
+
* A Promise<Network> that resolves only once the provider is ready.
|
|
369
|
+
*
|
|
370
|
+
* Sub-classes that call the super with a network without a chainId
|
|
371
|
+
* MUST set this. Standard named networks have a known chainId.
|
|
372
|
+
*
|
|
373
|
+
*/
|
|
374
|
+
constructor(network: Networkish | Promise<Network$1>);
|
|
375
|
+
_ready(): Promise<Network$1>;
|
|
376
|
+
get ready(): Promise<Network$1>;
|
|
377
|
+
static getFormatter(): Formatter;
|
|
378
|
+
static getNetwork(network: Networkish): Network$1;
|
|
379
|
+
ccipReadFetch(tx: Transaction, calldata: string, urls: Array<string>): Promise<null | string>;
|
|
380
|
+
_getInternalBlockNumber(maxAge: number): Promise<number>;
|
|
381
|
+
poll(): Promise<void>;
|
|
382
|
+
resetEventsBlock(blockNumber: number): void;
|
|
383
|
+
get network(): Network$1;
|
|
384
|
+
detectNetwork(): Promise<Network$1>;
|
|
385
|
+
getNetwork(): Promise<Network$1>;
|
|
386
|
+
get blockNumber(): number;
|
|
387
|
+
get polling(): boolean;
|
|
388
|
+
set polling(value: boolean);
|
|
389
|
+
get pollingInterval(): number;
|
|
390
|
+
set pollingInterval(value: number);
|
|
391
|
+
_getFastBlockNumber(): Promise<number>;
|
|
392
|
+
_setFastBlockNumber(blockNumber: number): void;
|
|
393
|
+
waitForTransaction(transactionHash: string, confirmations?: number, timeout?: number): Promise<TransactionReceipt>;
|
|
394
|
+
_waitForTransaction(transactionHash: string, confirmations: number, timeout: number, replaceable: {
|
|
395
|
+
data: string;
|
|
396
|
+
from: string;
|
|
397
|
+
nonce: number;
|
|
398
|
+
to: string;
|
|
399
|
+
value: BigNumber;
|
|
400
|
+
startBlock: number;
|
|
401
|
+
}): Promise<TransactionReceipt>;
|
|
402
|
+
getBlockNumber(): Promise<number>;
|
|
403
|
+
getGasPrice(): Promise<BigNumber>;
|
|
404
|
+
getBalance(addressOrName: string | Promise<string>, blockTag?: BlockTag | Promise<BlockTag>): Promise<BigNumber>;
|
|
405
|
+
getTransactionCount(addressOrName: string | Promise<string>, blockTag?: BlockTag | Promise<BlockTag>): Promise<number>;
|
|
406
|
+
getCode(addressOrName: string | Promise<string>, blockTag?: BlockTag | Promise<BlockTag>): Promise<string>;
|
|
407
|
+
getStorageAt(addressOrName: string | Promise<string>, position: BigNumberish | Promise<BigNumberish>, blockTag?: BlockTag | Promise<BlockTag>): Promise<string>;
|
|
408
|
+
_wrapTransaction(tx: Transaction, hash?: string, startBlock?: number): TransactionResponse;
|
|
409
|
+
sendTransaction(signedTransaction: string | Promise<string>): Promise<TransactionResponse>;
|
|
410
|
+
_getTransactionRequest(transaction: Deferrable<TransactionRequest>): Promise<Transaction>;
|
|
411
|
+
_getFilter(filter: Filter | FilterByBlockHash | Promise<Filter | FilterByBlockHash>): Promise<Filter | FilterByBlockHash>;
|
|
412
|
+
_call(transaction: TransactionRequest, blockTag: BlockTag, attempt: number): Promise<string>;
|
|
413
|
+
call(transaction: Deferrable<TransactionRequest>, blockTag?: BlockTag | Promise<BlockTag>): Promise<string>;
|
|
414
|
+
estimateGas(transaction: Deferrable<TransactionRequest>): Promise<BigNumber>;
|
|
415
|
+
_getAddress(addressOrName: string | Promise<string>): Promise<string>;
|
|
416
|
+
_getBlock(blockHashOrBlockTag: BlockTag | string | Promise<BlockTag | string>, includeTransactions?: boolean): Promise<Block | BlockWithTransactions>;
|
|
417
|
+
getBlock(blockHashOrBlockTag: BlockTag | string | Promise<BlockTag | string>): Promise<Block>;
|
|
418
|
+
getBlockWithTransactions(blockHashOrBlockTag: BlockTag | string | Promise<BlockTag | string>): Promise<BlockWithTransactions>;
|
|
419
|
+
getTransaction(transactionHash: string | Promise<string>): Promise<TransactionResponse>;
|
|
420
|
+
getTransactionReceipt(transactionHash: string | Promise<string>): Promise<TransactionReceipt>;
|
|
421
|
+
getLogs(filter: Filter | FilterByBlockHash | Promise<Filter | FilterByBlockHash>): Promise<Array<Log>>;
|
|
422
|
+
getEtherPrice(): Promise<number>;
|
|
423
|
+
_getBlockTag(blockTag: BlockTag | Promise<BlockTag>): Promise<BlockTag>;
|
|
424
|
+
getResolver(name: string): Promise<null | Resolver>;
|
|
425
|
+
_getResolver(name: string, operation?: string): Promise<string>;
|
|
426
|
+
resolveName(name: string | Promise<string>): Promise<null | string>;
|
|
427
|
+
lookupAddress(address: string | Promise<string>): Promise<null | string>;
|
|
428
|
+
getAvatar(nameOrAddress: string): Promise<null | string>;
|
|
429
|
+
perform(method: string, params: any): Promise<any>;
|
|
430
|
+
_startEvent(event: Event$1): void;
|
|
431
|
+
_stopEvent(event: Event$1): void;
|
|
432
|
+
_addEventListener(eventName: EventType, listener: Listener, once: boolean): this;
|
|
433
|
+
on(eventName: EventType, listener: Listener): this;
|
|
434
|
+
once(eventName: EventType, listener: Listener): this;
|
|
435
|
+
emit(eventName: EventType, ...args: Array<any>): boolean;
|
|
436
|
+
listenerCount(eventName?: EventType): number;
|
|
437
|
+
listeners(eventName?: EventType): Array<Listener>;
|
|
438
|
+
off(eventName: EventType, listener?: Listener): this;
|
|
439
|
+
removeAllListeners(eventName?: EventType): this;
|
|
440
|
+
}
|
|
441
|
+
|
|
442
|
+
interface TypedDataDomain {
|
|
443
|
+
name?: string;
|
|
444
|
+
version?: string;
|
|
445
|
+
chainId?: BigNumberish;
|
|
446
|
+
verifyingContract?: string;
|
|
447
|
+
salt?: BytesLike;
|
|
448
|
+
}
|
|
449
|
+
interface TypedDataField {
|
|
450
|
+
name: string;
|
|
451
|
+
type: string;
|
|
452
|
+
}
|
|
453
|
+
interface TypedDataSigner {
|
|
454
|
+
_signTypedData(domain: TypedDataDomain, types: Record<string, Array<TypedDataField>>, value: Record<string, any>): Promise<string>;
|
|
455
|
+
}
|
|
456
|
+
declare abstract class Signer {
|
|
457
|
+
readonly provider?: Provider;
|
|
458
|
+
abstract getAddress(): Promise<string>;
|
|
459
|
+
abstract signMessage(message: Bytes | string): Promise<string>;
|
|
460
|
+
abstract signTransaction(transaction: Deferrable<TransactionRequest>): Promise<string>;
|
|
461
|
+
abstract connect(provider: Provider): Signer;
|
|
462
|
+
readonly _isSigner: boolean;
|
|
463
|
+
constructor();
|
|
464
|
+
getBalance(blockTag?: BlockTag): Promise<BigNumber>;
|
|
465
|
+
getTransactionCount(blockTag?: BlockTag): Promise<number>;
|
|
466
|
+
estimateGas(transaction: Deferrable<TransactionRequest>): Promise<BigNumber>;
|
|
467
|
+
call(transaction: Deferrable<TransactionRequest>, blockTag?: BlockTag): Promise<string>;
|
|
468
|
+
sendTransaction(transaction: Deferrable<TransactionRequest>): Promise<TransactionResponse>;
|
|
469
|
+
getChainId(): Promise<number>;
|
|
470
|
+
getGasPrice(): Promise<BigNumber>;
|
|
471
|
+
getFeeData(): Promise<FeeData>;
|
|
472
|
+
resolveName(name: string): Promise<string>;
|
|
473
|
+
checkTransaction(transaction: Deferrable<TransactionRequest>): Deferrable<TransactionRequest>;
|
|
474
|
+
populateTransaction(transaction: Deferrable<TransactionRequest>): Promise<TransactionRequest>;
|
|
475
|
+
_checkProvider(operation?: string): void;
|
|
476
|
+
static isSigner(value: any): value is Signer;
|
|
477
|
+
}
|
|
478
|
+
|
|
479
|
+
declare class JsonRpcSigner extends Signer implements TypedDataSigner {
|
|
480
|
+
readonly provider: JsonRpcProvider;
|
|
481
|
+
_index: number;
|
|
482
|
+
_address: string;
|
|
483
|
+
constructor(constructorGuard: any, provider: JsonRpcProvider, addressOrIndex?: string | number);
|
|
484
|
+
connect(provider: Provider): JsonRpcSigner;
|
|
485
|
+
connectUnchecked(): JsonRpcSigner;
|
|
486
|
+
getAddress(): Promise<string>;
|
|
487
|
+
sendUncheckedTransaction(transaction: Deferrable<TransactionRequest>): Promise<string>;
|
|
488
|
+
signTransaction(transaction: Deferrable<TransactionRequest>): Promise<string>;
|
|
489
|
+
sendTransaction(transaction: Deferrable<TransactionRequest>): Promise<TransactionResponse>;
|
|
490
|
+
signMessage(message: Bytes | string): Promise<string>;
|
|
491
|
+
_legacySignMessage(message: Bytes | string): Promise<string>;
|
|
492
|
+
_signTypedData(domain: TypedDataDomain, types: Record<string, Array<TypedDataField>>, value: Record<string, any>): Promise<string>;
|
|
493
|
+
unlock(password: string): Promise<boolean>;
|
|
494
|
+
}
|
|
495
|
+
declare class UncheckedJsonRpcSigner extends JsonRpcSigner {
|
|
496
|
+
sendTransaction(transaction: Deferrable<TransactionRequest>): Promise<TransactionResponse>;
|
|
497
|
+
}
|
|
498
|
+
declare class JsonRpcProvider extends BaseProvider {
|
|
499
|
+
readonly connection: ConnectionInfo;
|
|
500
|
+
_pendingFilter: Promise<number>;
|
|
501
|
+
_nextId: number;
|
|
502
|
+
_eventLoopCache: Record<string, Promise<any>>;
|
|
503
|
+
get _cache(): Record<string, Promise<any>>;
|
|
504
|
+
constructor(url?: ConnectionInfo | string, network?: Networkish);
|
|
505
|
+
static defaultUrl(): string;
|
|
506
|
+
detectNetwork(): Promise<Network$1>;
|
|
507
|
+
_uncachedDetectNetwork(): Promise<Network$1>;
|
|
508
|
+
getSigner(addressOrIndex?: string | number): JsonRpcSigner;
|
|
509
|
+
getUncheckedSigner(addressOrIndex?: string | number): UncheckedJsonRpcSigner;
|
|
510
|
+
listAccounts(): Promise<Array<string>>;
|
|
511
|
+
send(method: string, params: Array<any>): Promise<any>;
|
|
512
|
+
prepareRequest(method: string, params: any): [string, Array<any>];
|
|
513
|
+
perform(method: string, params: any): Promise<any>;
|
|
514
|
+
_startEvent(event: Event$1): void;
|
|
515
|
+
_startPending(): void;
|
|
516
|
+
_stopEvent(event: Event$1): void;
|
|
517
|
+
static hexlifyTransaction(transaction: TransactionRequest, allowExtra?: {
|
|
518
|
+
[key: string]: boolean;
|
|
519
|
+
}): {
|
|
520
|
+
[key: string]: string | AccessList;
|
|
521
|
+
};
|
|
522
|
+
}
|
|
523
|
+
|
|
524
|
+
declare type ExternalProvider = {
|
|
525
|
+
isMetaMask?: boolean;
|
|
526
|
+
isStatus?: boolean;
|
|
527
|
+
host?: string;
|
|
528
|
+
path?: string;
|
|
529
|
+
sendAsync?: (request: {
|
|
530
|
+
method: string;
|
|
531
|
+
params?: Array<any>;
|
|
532
|
+
}, callback: (error: any, response: any) => void) => void;
|
|
533
|
+
send?: (request: {
|
|
534
|
+
method: string;
|
|
535
|
+
params?: Array<any>;
|
|
536
|
+
}, callback: (error: any, response: any) => void) => void;
|
|
537
|
+
request?: (request: {
|
|
538
|
+
method: string;
|
|
539
|
+
params?: Array<any>;
|
|
540
|
+
}) => Promise<any>;
|
|
541
|
+
};
|
|
542
|
+
declare type JsonRpcFetchFunc = (method: string, params?: Array<any>) => Promise<any>;
|
|
543
|
+
declare class Web3Provider extends JsonRpcProvider {
|
|
544
|
+
readonly provider: ExternalProvider;
|
|
545
|
+
readonly jsonRpcFetchFunc: JsonRpcFetchFunc;
|
|
546
|
+
constructor(provider: ExternalProvider | JsonRpcFetchFunc, network?: Networkish);
|
|
547
|
+
send(method: string, params: Array<any>): Promise<any>;
|
|
548
|
+
}
|
|
549
|
+
|
|
550
|
+
/**
|
|
551
|
+
* Interface representing token information.
|
|
552
|
+
* @property {string} name - The token name.
|
|
553
|
+
* @property {string} symbol - The token symbol.
|
|
554
|
+
* @property {number} decimals - The token decimals.
|
|
555
|
+
* @property {string} [address] - The token contract address.
|
|
556
|
+
* @property {string} [icon] - The token icon URL/data:image.
|
|
557
|
+
*/
|
|
558
|
+
interface TokenInfo {
|
|
559
|
+
name: string;
|
|
560
|
+
symbol: string;
|
|
561
|
+
decimals: number;
|
|
562
|
+
address?: string;
|
|
563
|
+
icon?: string;
|
|
564
|
+
}
|
|
565
|
+
/**
|
|
566
|
+
* Interface representing the information of a network.
|
|
567
|
+
* @property {string} name - The name of the network.
|
|
568
|
+
* @property {number} chainId - The ID of the network.
|
|
569
|
+
* @property {TokenInfo} nativeCurrency - The info of the network's native currency.
|
|
570
|
+
* @property {boolean} isSupported - Flag indicating if the network is supported by the application.
|
|
571
|
+
*/
|
|
572
|
+
interface NetworkInfo {
|
|
573
|
+
name: string;
|
|
574
|
+
chainId: number;
|
|
575
|
+
nativeCurrency: TokenInfo;
|
|
576
|
+
isSupported: boolean;
|
|
577
|
+
}
|
|
2
578
|
/**
|
|
3
579
|
* Enum representing the list of default supported providers.
|
|
4
580
|
*/
|
|
@@ -14315,144 +14891,463 @@ declare global {
|
|
|
14315
14891
|
}
|
|
14316
14892
|
}
|
|
14317
14893
|
|
|
14894
|
+
/**
|
|
14895
|
+
* Enum representing the events emitted by the widgets.
|
|
14896
|
+
*/
|
|
14318
14897
|
declare enum IMTBLWidgetEvents {
|
|
14319
14898
|
IMTBL_CONNECT_WIDGET_EVENT = "imtbl-connect-widget",
|
|
14320
14899
|
IMTBL_WALLET_WIDGET_EVENT = "imtbl-wallet-widget",
|
|
14321
14900
|
IMTBL_SWAP_WIDGET_EVENT = "imtbl-swap-widget",
|
|
14322
14901
|
IMTBL_BRIDGE_WIDGET_EVENT = "imtbl-bridge-widget",
|
|
14323
|
-
IMTBL_BUY_WIDGET_EVENT = "imtbl-buy-widget"
|
|
14902
|
+
IMTBL_BUY_WIDGET_EVENT = "imtbl-buy-widget",
|
|
14903
|
+
IMTBL_ONRAMP_WIDGET_EVENT = "imtbl-onramp-widget"
|
|
14324
14904
|
}
|
|
14905
|
+
/**
|
|
14906
|
+
* Enum representing possible Connect Widget event types.
|
|
14907
|
+
*/
|
|
14325
14908
|
declare enum ConnectEventType {
|
|
14326
14909
|
SUCCESS = "success",
|
|
14327
14910
|
FAILURE = "failure",
|
|
14328
14911
|
CLOSE_WIDGET = "close-widget"
|
|
14329
14912
|
}
|
|
14913
|
+
/**
|
|
14914
|
+
* Represents an event object emitted by the Connect Widget.
|
|
14915
|
+
* @property {BuyEventType} type - The type of the event.
|
|
14916
|
+
* @property {T} data - The data contained in the event.
|
|
14917
|
+
*/
|
|
14330
14918
|
type ConnectEvent<T> = {
|
|
14331
14919
|
type: ConnectEventType;
|
|
14332
14920
|
data: T;
|
|
14333
14921
|
};
|
|
14922
|
+
/**
|
|
14923
|
+
* Type representing a Connect Widget event with type SUCCESS.
|
|
14924
|
+
* @property {ConnectionProviders} providerPreference - The user's preferred connection provider.
|
|
14925
|
+
*/
|
|
14334
14926
|
type ConnectionSuccess = {
|
|
14335
14927
|
providerPreference: ConnectionProviders;
|
|
14336
14928
|
};
|
|
14929
|
+
/**
|
|
14930
|
+
* Type representing a Connect Widget event with type FAILURE.
|
|
14931
|
+
* @property {string} reason - A description of the reason for the failed connection attempt.
|
|
14932
|
+
*/
|
|
14337
14933
|
type ConnectionFailed = {
|
|
14338
14934
|
reason: string;
|
|
14339
14935
|
};
|
|
14936
|
+
/**
|
|
14937
|
+
* Enum representing possible Wallet Widget event types.
|
|
14938
|
+
*/
|
|
14340
14939
|
declare enum WalletEventType {
|
|
14341
14940
|
CLOSE_WIDGET = "close-widget",
|
|
14342
|
-
NETWORK_SWITCH = "network-switch"
|
|
14941
|
+
NETWORK_SWITCH = "network-switch",
|
|
14942
|
+
ADD_COINS = "add-coins",
|
|
14943
|
+
REQUEST_SWAP = "request-swap",
|
|
14944
|
+
REQUEST_BRIDGE = "request-bridge",
|
|
14945
|
+
REQUEST_ONRAMP = "request-onramp"
|
|
14343
14946
|
}
|
|
14947
|
+
/**
|
|
14948
|
+
* Type representing the data emitted by the network switch event.
|
|
14949
|
+
* @property {string} network - The name of the selected network.
|
|
14950
|
+
* @property {number} chainId - The chain ID of the selected network.
|
|
14951
|
+
*/
|
|
14344
14952
|
type WalletNetworkSwitchEvent = {
|
|
14345
14953
|
network: string;
|
|
14346
14954
|
chainId: number;
|
|
14347
14955
|
};
|
|
14956
|
+
type WalletAddCoinsEvent = {
|
|
14957
|
+
network?: NetworkInfo;
|
|
14958
|
+
token?: TokenInfo;
|
|
14959
|
+
tokenAmount?: string;
|
|
14960
|
+
};
|
|
14961
|
+
type WalletRequestSwapEvent = {
|
|
14962
|
+
fromTokenAddress: string;
|
|
14963
|
+
toTokenAddress: string;
|
|
14964
|
+
amount: string;
|
|
14965
|
+
};
|
|
14966
|
+
type WalletRequestBridgeEvent = {
|
|
14967
|
+
fromNetwork: string;
|
|
14968
|
+
tokenAddress: string;
|
|
14969
|
+
amount: string;
|
|
14970
|
+
};
|
|
14971
|
+
type WalletRequestOnrampEvent = {
|
|
14972
|
+
tokenAddress: string;
|
|
14973
|
+
amount: string;
|
|
14974
|
+
};
|
|
14975
|
+
/**
|
|
14976
|
+
* Represents an event object emitted by the Wallet Widget.
|
|
14977
|
+
* @property {WalletEventType} type - The type of the event.
|
|
14978
|
+
* @property {T} data - The data contained in the event.
|
|
14979
|
+
*/
|
|
14348
14980
|
type WalletEvent<T> = {
|
|
14349
14981
|
type: WalletEventType;
|
|
14350
14982
|
data: T;
|
|
14351
14983
|
};
|
|
14984
|
+
/**
|
|
14985
|
+
* Represents an event object emitted by the Swap Widget.
|
|
14986
|
+
* @property {SwapEventType} type - The type of the event.
|
|
14987
|
+
* @property {T} data - The data contained in the event.
|
|
14988
|
+
*/
|
|
14352
14989
|
type SwapEvent<T> = {
|
|
14353
14990
|
type: SwapEventType;
|
|
14354
14991
|
data: T;
|
|
14355
14992
|
};
|
|
14993
|
+
/**
|
|
14994
|
+
* Enum representing possible Swap Widget event types.
|
|
14995
|
+
*/
|
|
14356
14996
|
declare enum SwapEventType {
|
|
14357
14997
|
SUCCESS = "success",
|
|
14358
14998
|
FAILURE = "failure"
|
|
14359
14999
|
}
|
|
15000
|
+
/**
|
|
15001
|
+
* Type representing a Swap Widget with type SUCCESS.
|
|
15002
|
+
* @property {number} timestamp - The timestamp of the successful swap.
|
|
15003
|
+
*/
|
|
14360
15004
|
type SwapSuccess = {
|
|
14361
15005
|
timestamp: number;
|
|
14362
15006
|
};
|
|
15007
|
+
/**
|
|
15008
|
+
* Type representing a Swap Widget with type FAILURE.
|
|
15009
|
+
* @property {string} reason - The reason why the swap failed.
|
|
15010
|
+
* @property {number} timestamp - The timestamp of the failed swap.
|
|
15011
|
+
*/
|
|
14363
15012
|
type SwapFailed = {
|
|
14364
15013
|
reason: string;
|
|
14365
15014
|
timestamp: number;
|
|
14366
15015
|
};
|
|
15016
|
+
/**
|
|
15017
|
+
* Represents an event object emitted by the Bridge Widget.
|
|
15018
|
+
* @property {BridgeEventType} type - The type of the event.
|
|
15019
|
+
* @property {T} data - The data associated with the event.
|
|
15020
|
+
*/
|
|
14367
15021
|
type BridgeEvent<T> = {
|
|
14368
15022
|
type: BridgeEventType;
|
|
14369
15023
|
data: T;
|
|
14370
15024
|
};
|
|
15025
|
+
/**
|
|
15026
|
+
* Enum of possible Bridge Widget event types.
|
|
15027
|
+
*/
|
|
14371
15028
|
declare enum BridgeEventType {
|
|
14372
15029
|
CLOSE_WIDGET = "close-widget",
|
|
14373
15030
|
SUCCESS = "success",
|
|
14374
15031
|
FAILURE = "failure"
|
|
14375
15032
|
}
|
|
15033
|
+
/**
|
|
15034
|
+
* Type representing a Bridge Widget event with type SUCCESS
|
|
15035
|
+
* @property {number} timestamp - The UNIX timestamp (in milliseconds) when the event occurred.
|
|
15036
|
+
*/
|
|
14376
15037
|
type BridgeSuccess = {
|
|
14377
15038
|
timestamp: number;
|
|
14378
15039
|
};
|
|
15040
|
+
/**
|
|
15041
|
+
* Type representing a Bridge Widget event with type FAILURE
|
|
15042
|
+
* @property {string} reason - The reason for the failure.
|
|
15043
|
+
* @property {number} timestamp - The UNIX timestamp (in milliseconds) when the event occurred.
|
|
15044
|
+
*/
|
|
14379
15045
|
type BridgeFailed = {
|
|
14380
15046
|
reason: string;
|
|
14381
15047
|
timestamp: number;
|
|
14382
15048
|
};
|
|
15049
|
+
/**
|
|
15050
|
+
* Represents an event object emitted by the Buy Widget.
|
|
15051
|
+
* @property {BuyEventType} type - The type of the event.
|
|
15052
|
+
* @property {T} data - The data contained in the event.
|
|
15053
|
+
*/
|
|
14383
15054
|
type BuyEvent<T> = {
|
|
14384
15055
|
type: BuyEventType;
|
|
14385
15056
|
data: T;
|
|
14386
15057
|
};
|
|
15058
|
+
/**
|
|
15059
|
+
* Enum representing possible Buy Widget event types.
|
|
15060
|
+
*/
|
|
14387
15061
|
declare enum BuyEventType {
|
|
14388
15062
|
SUCCESS = "success",
|
|
14389
15063
|
FAILURE = "failure",
|
|
14390
15064
|
NOT_CONNECTED = "not_connected",
|
|
14391
15065
|
CLOSE = "close"
|
|
14392
15066
|
}
|
|
15067
|
+
/**
|
|
15068
|
+
* Type representing a Buy Widget event with type CLOSE.
|
|
15069
|
+
*/
|
|
14393
15070
|
type BuyClose = {};
|
|
15071
|
+
/**
|
|
15072
|
+
* Type representing a Buy Widget event with type NOT_CONNECTED.
|
|
15073
|
+
* @property {string} providerPreference - The preferred provider used for the connection within the Buy Widget.
|
|
15074
|
+
*/
|
|
14394
15075
|
type BuyNotConnected = {
|
|
14395
15076
|
providerPreference: string;
|
|
14396
15077
|
};
|
|
15078
|
+
/**
|
|
15079
|
+
* Type representing a Buy Widget event with type SUCCESS.
|
|
15080
|
+
* @property {number} timestamp - The timestamp of the successful buy.
|
|
15081
|
+
*/
|
|
14397
15082
|
type BuySuccess = {
|
|
14398
15083
|
timestamp: number;
|
|
14399
15084
|
};
|
|
15085
|
+
/**
|
|
15086
|
+
* Type representing a Buy Widget event with type FAILURE.
|
|
15087
|
+
* @property {string} reason - The reason why the buy failed.
|
|
15088
|
+
* @property {number} timestamp - The timestamp of the failed buy.
|
|
15089
|
+
*/
|
|
14400
15090
|
type BuyFailed = {
|
|
14401
15091
|
reason: string;
|
|
14402
15092
|
timestamp: number;
|
|
14403
15093
|
};
|
|
14404
|
-
|
|
15094
|
+
type OnRampEvent<T> = {
|
|
15095
|
+
type: OnRampEventType;
|
|
15096
|
+
data: T;
|
|
15097
|
+
};
|
|
15098
|
+
declare enum OnRampEventType {
|
|
15099
|
+
}
|
|
15100
|
+
/**
|
|
15101
|
+
* Props for the Connect Widget component
|
|
15102
|
+
* @property {string} providerPreference - The preferred wallet provider to connect to.
|
|
15103
|
+
* @property {string} theme - The theme to use.
|
|
15104
|
+
*/
|
|
15105
|
+
interface ImtblConnectProps extends React.DetailedHTMLProps<React.HTMLAttributes<HTMLElement>, HTMLElement> {
|
|
14405
15106
|
providerPreference: string;
|
|
14406
15107
|
theme: string;
|
|
14407
15108
|
}
|
|
14408
|
-
|
|
15109
|
+
/**
|
|
15110
|
+
* Props for the Wallet Widget component
|
|
15111
|
+
* @property {string} providerPreference - The preferred wallet provider to connect to.
|
|
15112
|
+
* @property {string} theme - The theme to use.
|
|
15113
|
+
*/
|
|
15114
|
+
interface ImtblWalletProps extends React.DetailedHTMLProps<React.HTMLAttributes<HTMLElement>, HTMLElement> {
|
|
14409
15115
|
providerPreference: string;
|
|
15116
|
+
isOnRampEnabled?: string;
|
|
15117
|
+
isSwapEnabled?: string;
|
|
15118
|
+
isBridgeEnabled?: string;
|
|
14410
15119
|
theme: string;
|
|
14411
15120
|
}
|
|
14412
|
-
|
|
15121
|
+
/**
|
|
15122
|
+
* Props for the Swap Widget component
|
|
15123
|
+
* @property {string} providerPreference - The preferred wallet provider to connect to.
|
|
15124
|
+
* @property {string} theme - The theme to use.
|
|
15125
|
+
* @property {string} amount - The amount to swap.
|
|
15126
|
+
* @property {string} fromContractAddress - The contract address of the source token.
|
|
15127
|
+
* @property {string} toContractAddress - The contract address of the destination token.
|
|
15128
|
+
*/
|
|
15129
|
+
interface ImtblSwapProps extends React.DetailedHTMLProps<React.HTMLAttributes<HTMLElement>, HTMLElement> {
|
|
14413
15130
|
providerPreference: string;
|
|
14414
15131
|
theme: string;
|
|
14415
15132
|
amount: string;
|
|
14416
15133
|
fromContractAddress: string;
|
|
14417
15134
|
toContractAddress: string;
|
|
14418
15135
|
}
|
|
14419
|
-
|
|
15136
|
+
/**
|
|
15137
|
+
* Props for the Bridge Widget component
|
|
15138
|
+
* @property {string} providerPreference - The preferred wallet provider to connect to.
|
|
15139
|
+
* @property {string} theme - The theme to use.
|
|
15140
|
+
* @property {string} fromContractAddress - The contract address of the source token.
|
|
15141
|
+
* @property {string} fromNetwork - The network of the source token.
|
|
15142
|
+
* @property {string} amount - The amount to bridge.
|
|
15143
|
+
*/
|
|
15144
|
+
interface ImtblBridgeProps extends React.DetailedHTMLProps<React.HTMLAttributes<HTMLElement>, HTMLElement> {
|
|
14420
15145
|
providerPreference: string;
|
|
14421
15146
|
theme: string;
|
|
14422
15147
|
fromContractAddress: string;
|
|
14423
15148
|
fromNetwork: string;
|
|
14424
15149
|
amount: string;
|
|
14425
15150
|
}
|
|
14426
|
-
|
|
15151
|
+
/**
|
|
15152
|
+
* Props for the Example Widget component
|
|
15153
|
+
* @property {string} providerPreference - The preferred wallet provider to connect to.
|
|
15154
|
+
* @property {string} theme - The theme to use.
|
|
15155
|
+
* @experimental
|
|
15156
|
+
*/
|
|
15157
|
+
interface ImtblExampleProps extends React.DetailedHTMLProps<React.HTMLAttributes<HTMLElement>, HTMLElement> {
|
|
14427
15158
|
providerPreference: string;
|
|
14428
15159
|
theme: string;
|
|
14429
15160
|
}
|
|
14430
|
-
|
|
15161
|
+
/**
|
|
15162
|
+
* Props for the Buy Widget component
|
|
15163
|
+
* @property {string} providerPreference - The preferred wallet provider to connect to.
|
|
15164
|
+
* @property {string} theme - The theme to use.
|
|
15165
|
+
* @property {string} orderId - The id of the order to buy.
|
|
15166
|
+
*/
|
|
15167
|
+
interface ImtblBuyProps extends React.DetailedHTMLProps<React.HTMLAttributes<HTMLElement>, HTMLElement> {
|
|
14431
15168
|
providerPreference: string;
|
|
14432
15169
|
theme: string;
|
|
14433
15170
|
orderId: string;
|
|
14434
15171
|
}
|
|
14435
|
-
|
|
15172
|
+
/**
|
|
15173
|
+
* Props for the TransitionExample Widget component
|
|
15174
|
+
* @property {string} providerPreference - The preferred wallet provider to connect to.
|
|
15175
|
+
* @property {string} theme - The theme to use.
|
|
15176
|
+
*/
|
|
15177
|
+
interface ImtblTransitionExampleProps extends React.DetailedHTMLProps<React.HTMLAttributes<HTMLElement>, HTMLElement> {
|
|
14436
15178
|
providerPreference: string;
|
|
14437
15179
|
theme: string;
|
|
14438
15180
|
}
|
|
14439
|
-
|
|
15181
|
+
/**
|
|
15182
|
+
* Props for the InnerWidgetExample Widget component
|
|
15183
|
+
* @property {string} providerPreference - The preferred wallet provider to connect to.
|
|
15184
|
+
* @property {string} theme - The theme to use.
|
|
15185
|
+
*/
|
|
15186
|
+
interface ImtblInnerWidgetExampleProps extends React.DetailedHTMLProps<React.HTMLAttributes<HTMLElement>, HTMLElement> {
|
|
14440
15187
|
providerPreference: string;
|
|
14441
15188
|
theme: string;
|
|
14442
15189
|
}
|
|
14443
|
-
|
|
15190
|
+
/**
|
|
15191
|
+
* Props for the OuterWidgetExample Widget component
|
|
15192
|
+
* @property {string} providerPreference - The preferred wallet provider to connect to.
|
|
15193
|
+
* @property {string} theme - The theme to use.
|
|
15194
|
+
*/
|
|
15195
|
+
interface ImtblOuterWidgetExampleProps extends React.DetailedHTMLProps<React.HTMLAttributes<HTMLElement>, HTMLElement> {
|
|
14444
15196
|
providerPreference: string;
|
|
14445
15197
|
theme: string;
|
|
14446
15198
|
}
|
|
15199
|
+
/**
|
|
15200
|
+
* Enum representing the networks supported by Checkout.
|
|
15201
|
+
*/
|
|
14447
15202
|
declare enum Network {
|
|
14448
15203
|
ETHEREUM = "Ethereum",
|
|
14449
15204
|
GOERLI = "Goerli",
|
|
14450
15205
|
POLYGON = "Polygon"
|
|
14451
15206
|
}
|
|
15207
|
+
/**
|
|
15208
|
+
* Enum representing the themes for the Checkout widgets.
|
|
15209
|
+
*/
|
|
14452
15210
|
declare enum WidgetTheme {
|
|
14453
15211
|
LIGHT = "light",
|
|
14454
15212
|
DARK = "dark",
|
|
14455
15213
|
CUSTOM = "custom"
|
|
14456
15214
|
}
|
|
15215
|
+
/**
|
|
15216
|
+
* Enum representing the default Web3 providers supported by the Checkout widgets.
|
|
15217
|
+
*/
|
|
15218
|
+
declare enum WidgetConnectionProviders {
|
|
15219
|
+
METAMASK = "metamask"
|
|
15220
|
+
}
|
|
15221
|
+
/**
|
|
15222
|
+
* Enum representing list of Checkout Widgets DOM tags.
|
|
15223
|
+
*/
|
|
15224
|
+
declare enum CheckoutWidgetTagNames {
|
|
15225
|
+
CONNECT = "imtbl-connect",
|
|
15226
|
+
WALLET = "imtbl-wallet",
|
|
15227
|
+
SWAP = "imtbl-swap",
|
|
15228
|
+
BUY = "imtbl-buy",
|
|
15229
|
+
BRIDGE = "imtbl-bridge",
|
|
15230
|
+
EXAMPLE = "imtbl-example"
|
|
15231
|
+
}
|
|
15232
|
+
/**
|
|
15233
|
+
* Represents the configuration options for the Checkout Widgets.
|
|
15234
|
+
* @property {WidgetTheme} theme - The theme of the Checkout Widget.
|
|
15235
|
+
*/
|
|
15236
|
+
type CheckoutWidgetsConfig = {
|
|
15237
|
+
theme?: WidgetTheme;
|
|
15238
|
+
};
|
|
15239
|
+
/**
|
|
15240
|
+
* Interface representing the props for the Bridge Widget component.
|
|
15241
|
+
* @property {WidgetConnectionProviders} providerPreference - The preferred provider for the Bridge Widget (default: {@link WidgetConnectionProviders.METAMASK}).
|
|
15242
|
+
* @property {string} fromContractAddress - The contract address to send tokens from.
|
|
15243
|
+
* @property {string} amount - The amount of tokens to send.
|
|
15244
|
+
* @property {Network} fromNetwork - The network to send tokens from.
|
|
15245
|
+
*/
|
|
15246
|
+
interface BridgeReactProps {
|
|
15247
|
+
providerPreference: WidgetConnectionProviders;
|
|
15248
|
+
fromContractAddress?: string;
|
|
15249
|
+
amount?: string;
|
|
15250
|
+
fromNetwork?: Network;
|
|
15251
|
+
}
|
|
15252
|
+
/**
|
|
15253
|
+
* A React functional component that renders the Checkout Bridge Widget.
|
|
15254
|
+
* @param {BridgeReactProps} props - The props for the Bridge Widget component.
|
|
15255
|
+
* @returns {JSX.Element} - The rendered Bridge Widget component.
|
|
15256
|
+
*/
|
|
15257
|
+
declare function BridgeReact(props: BridgeReactProps): JSX.Element;
|
|
15258
|
+
/**
|
|
15259
|
+
* Interface representing the props for the Buy Widget component.
|
|
15260
|
+
* @property {WidgetConnectionProviders} providerPreference - The preferred provider for the Buy Widget (default: {@link WidgetConnectionProviders.METAMASK}).
|
|
15261
|
+
* @property {string} orderId - The ID that identifies the open buy order associated to the assets to buy.
|
|
15262
|
+
*/
|
|
15263
|
+
interface BuyReactProps {
|
|
15264
|
+
providerPreference: WidgetConnectionProviders;
|
|
15265
|
+
orderId: string;
|
|
15266
|
+
}
|
|
15267
|
+
/**
|
|
15268
|
+
* A React functional component that renders the Checkout Buy Widget.
|
|
15269
|
+
* @param {BuyReactProps} props - The props for the Buy Widget component.
|
|
15270
|
+
* @returns {JSX.Element} - The rendered Buy Widget component.
|
|
15271
|
+
*/
|
|
15272
|
+
declare function BuyReact(props: BuyReactProps): JSX.Element;
|
|
15273
|
+
/**
|
|
15274
|
+
* Interface representing the props for the Connect Widget component.
|
|
15275
|
+
* @property {WidgetConnectionProviders} providerPreference - The preferred provider for the Connect Widget (default: {@link WidgetConnectionProviders.METAMASK}).
|
|
15276
|
+
*/
|
|
15277
|
+
interface ConnectReactProps {
|
|
15278
|
+
providerPreference?: WidgetConnectionProviders;
|
|
15279
|
+
}
|
|
15280
|
+
/**
|
|
15281
|
+
* A React functional component that renders the Checkout Connect Widget.
|
|
15282
|
+
* @param {ConnectReactProps} props - The props for the Connect Widget component.
|
|
15283
|
+
* @returns {JSX.Element} - The rendered Connect Widget component.
|
|
15284
|
+
*/
|
|
15285
|
+
declare function ConnectReact(props: ConnectReactProps): JSX.Element;
|
|
15286
|
+
/**
|
|
15287
|
+
* Interface representing the props for the Swap Widget component.
|
|
15288
|
+
* @property {WidgetConnectionProviders} providerPreference - The preferred provider for the Swap Widget (default: {@link WidgetConnectionProviders.METAMASK}).
|
|
15289
|
+
* @property {string} fromContractAddress - The contract address to swap tokens from.
|
|
15290
|
+
* @property {string} amount - The amount of tokens to send.
|
|
15291
|
+
* @property {Network} toContractAddress - The contract address to swap tokens to.
|
|
15292
|
+
*/
|
|
15293
|
+
interface SwapReactProps {
|
|
15294
|
+
providerPreference: WidgetConnectionProviders;
|
|
15295
|
+
fromContractAddress?: string;
|
|
15296
|
+
amount?: string;
|
|
15297
|
+
toContractAddress?: string;
|
|
15298
|
+
}
|
|
15299
|
+
/**
|
|
15300
|
+
* A React functional component that renders the Checkout Swap Widget.
|
|
15301
|
+
* @param {SwapReactProps} props - The props for the Swap Widget component.
|
|
15302
|
+
* @returns {JSX.Element} - The rendered Swap Widget component.
|
|
15303
|
+
*/
|
|
15304
|
+
declare function SwapReact(props: SwapReactProps): JSX.Element;
|
|
15305
|
+
/**
|
|
15306
|
+
* Interface representing the props for the Wallet Widget component.
|
|
15307
|
+
* @property {WidgetConnectionProviders} providerPreference - The preferred provider for the Wallet Widget (default: {@link WidgetConnectionProviders.METAMASK}).
|
|
15308
|
+
*/
|
|
15309
|
+
interface WalletReactProps {
|
|
15310
|
+
providerPreference?: WidgetConnectionProviders;
|
|
15311
|
+
isOnRampEnabled?: boolean;
|
|
15312
|
+
isSwapEnabled?: boolean;
|
|
15313
|
+
isBridgeEnabled?: boolean;
|
|
15314
|
+
}
|
|
15315
|
+
/**
|
|
15316
|
+
* A React functional component that renders the Checkout Wallet Widget.
|
|
15317
|
+
* @param {WalletReactProps} props - The props for the Wallet Widget component.
|
|
15318
|
+
* @returns {JSX.Element} - The rendered Wallet Widget component.
|
|
15319
|
+
*/
|
|
15320
|
+
declare function WalletReact(props: WalletReactProps): JSX.Element;
|
|
15321
|
+
/**
|
|
15322
|
+
* Interface representing the props for the Example Widget component.
|
|
15323
|
+
* @experimental
|
|
15324
|
+
*/
|
|
15325
|
+
interface ExampleReactProps {
|
|
15326
|
+
providerPreference: WidgetConnectionProviders;
|
|
15327
|
+
fromContractAddress?: string;
|
|
15328
|
+
amount?: string;
|
|
15329
|
+
fromNetwork?: Network;
|
|
15330
|
+
}
|
|
15331
|
+
/**
|
|
15332
|
+
* A React functional component that renders the Checkout Example Widget.
|
|
15333
|
+
* @experimental
|
|
15334
|
+
*/
|
|
15335
|
+
declare function ExampleReact(props: ExampleReactProps): JSX.Element;
|
|
15336
|
+
/**
|
|
15337
|
+
* CheckoutWidgets allows to inject the Checkout Widgets into your application.
|
|
15338
|
+
* @param {CheckoutWidgetsConfig|undefined} config - Checkout Widget global configurations.
|
|
15339
|
+
*/
|
|
15340
|
+
declare function CheckoutWidgets(config?: CheckoutWidgetsConfig): void;
|
|
15341
|
+
/**
|
|
15342
|
+
* UpdateConfig allows to update the configuration of an existing Checkout Widgets instance.
|
|
15343
|
+
* @param {CheckoutWidgetsConfig} config - new Checkout Widget global configurations.
|
|
15344
|
+
*/
|
|
15345
|
+
declare function UpdateConfig(config: CheckoutWidgetsConfig): void;
|
|
15346
|
+
/**
|
|
15347
|
+
* SetProvider allows to set the provider for an existing Checkout Widgets instance.
|
|
15348
|
+
* @param {CheckoutWidgetTagNames} tagName - target Checkout Widget widget.
|
|
15349
|
+
* @param {Web3Provider} provider - the provider to connect to the blockchain network.
|
|
15350
|
+
*/
|
|
15351
|
+
declare function SetProvider(tagName: CheckoutWidgetTagNames, provider: Web3Provider | null): void;
|
|
14457
15352
|
|
|
14458
|
-
export { BridgeEvent, BridgeEventType, BridgeFailed, BridgeSuccess, BuyClose, BuyEvent, BuyEventType, BuyFailed, BuyNotConnected, BuySuccess, ConnectEvent, ConnectEventType,
|
|
15353
|
+
export { BridgeEvent, BridgeEventType, BridgeFailed, BridgeReact, BridgeReactProps, BridgeSuccess, BuyClose, BuyEvent, BuyEventType, BuyFailed, BuyNotConnected, BuyReact, BuyReactProps, BuySuccess, CheckoutWidgetTagNames, CheckoutWidgets, CheckoutWidgetsConfig, ConnectEvent, ConnectEventType, ConnectReact, ConnectReactProps, ConnectionFailed, ConnectionSuccess, ExampleReact, ExampleReactProps, IMTBLWidgetEvents, ImtblBridgeProps, ImtblBuyProps, ImtblConnectProps, ImtblExampleProps, ImtblInnerWidgetExampleProps, ImtblOuterWidgetExampleProps, ImtblSwapProps, ImtblTransitionExampleProps, ImtblWalletProps, Network, OnRampEvent, OnRampEventType, SetProvider, SwapEvent, SwapEventType, SwapFailed, SwapReact, SwapReactProps, SwapSuccess, UpdateConfig, WalletAddCoinsEvent, WalletEvent, WalletEventType, WalletNetworkSwitchEvent, WalletReact, WalletReactProps, WalletRequestBridgeEvent, WalletRequestOnrampEvent, WalletRequestSwapEvent, WidgetConnectionProviders, WidgetTheme };
|