@imtbl/sdk 0.1.4-alpha → 0.1.5-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.
@@ -1,4 +1,552 @@
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
+
2
550
  /**
3
551
  * Enum representing the list of default supported providers.
4
552
  */
@@ -14454,5 +15002,56 @@ declare enum WidgetTheme {
14454
15002
  DARK = "dark",
14455
15003
  CUSTOM = "custom"
14456
15004
  }
15005
+ declare enum WidgetConnectionProviders {
15006
+ METAMASK = "metamask"
15007
+ }
15008
+ declare enum CheckoutWidgetTagNames {
15009
+ CONNECT = "imtbl-connect",
15010
+ WALLET = "imtbl-wallet",
15011
+ SWAP = "imtbl-swap",
15012
+ BUY = "imtbl-buy",
15013
+ BRIDGE = "imtbl-bridge",
15014
+ EXAMPLe = "imtbl-example"
15015
+ }
15016
+ type CheckoutWidgetsConfig = {
15017
+ theme?: WidgetTheme;
15018
+ };
15019
+ interface BridgeReactProps {
15020
+ providerPreference: WidgetConnectionProviders;
15021
+ fromContractAddress?: string;
15022
+ amount?: string;
15023
+ fromNetwork?: Network;
15024
+ }
15025
+ declare function BridgeReact(props: BridgeReactProps): JSX.Element;
15026
+ interface BuyReactProps {
15027
+ providerPreference: WidgetConnectionProviders;
15028
+ orderId: string;
15029
+ }
15030
+ declare function BuyReact(props: BuyReactProps): JSX.Element;
15031
+ declare function CheckoutWidgets(config?: CheckoutWidgetsConfig): void;
15032
+ declare function UpdateConfig(config: CheckoutWidgetsConfig): void;
15033
+ declare function SetProvider(tagName: CheckoutWidgetTagNames, provider: Web3Provider | null): void;
15034
+ interface ConnectReactProps {
15035
+ providerPreference?: WidgetConnectionProviders;
15036
+ }
15037
+ declare function ConnectReact(props: ConnectReactProps): JSX.Element;
15038
+ interface SwapReactProps {
15039
+ providerPreference: WidgetConnectionProviders;
15040
+ fromContractAddress?: string;
15041
+ amount?: string;
15042
+ toContractAddress?: string;
15043
+ }
15044
+ declare function SwapReact(props: SwapReactProps): JSX.Element;
15045
+ interface WalletReactProps {
15046
+ providerPreference?: WidgetConnectionProviders;
15047
+ }
15048
+ declare function WalletReact(props: WalletReactProps): JSX.Element;
15049
+ interface ExampleReactProps {
15050
+ providerPreference: WidgetConnectionProviders;
15051
+ fromContractAddress?: string;
15052
+ amount?: string;
15053
+ fromNetwork?: Network;
15054
+ }
15055
+ declare function ExampleReact(props: ExampleReactProps): JSX.Element;
14457
15056
 
14458
- export { BridgeEvent, BridgeEventType, BridgeFailed, BridgeSuccess, BuyClose, BuyEvent, BuyEventType, BuyFailed, BuyNotConnected, BuySuccess, ConnectEvent, ConnectEventType, ConnectionFailed, ConnectionProviders, ConnectionSuccess, IMTBLWidgetEvents, ImtblBridgeProps, ImtblBuyProps, ImtblConnectProps, ImtblExampleProps, ImtblInnerWidgetExampleProps, ImtblOuterWidgetExampleProps, ImtblSwapProps, ImtblTransitionExampleProps, ImtblWalletProps, Network, SwapEvent, SwapEventType, SwapFailed, SwapSuccess, WalletEvent, WalletEventType, WalletNetworkSwitchEvent, WidgetTheme };
15057
+ 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, SetProvider, SwapEvent, SwapEventType, SwapFailed, SwapReact, SwapReactProps, SwapSuccess, UpdateConfig, WalletEvent, WalletEventType, WalletNetworkSwitchEvent, WalletReact, WalletReactProps, WidgetConnectionProviders, WidgetTheme };