@imtbl/sdk 0.4.3 → 0.4.4-alpha.1
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/blockchain_data.d.ts +1971 -0
- package/dist/blockchain_data.js +2528 -0
- package/dist/browser/checkout.js +2 -0
- package/dist/checkout_sdk.d.ts +1188 -0
- package/dist/checkout_sdk.js +16511 -0
- package/dist/checkout_widgets.d.ts +15382 -0
- package/dist/checkout_widgets.js +276 -0
- package/dist/erc20.d.ts +296 -0
- package/dist/erc20.js +371 -0
- package/dist/erc721_permissioned_mintable.d.ts +486 -0
- package/dist/erc721_permissioned_mintable.js +1364 -0
- package/dist/immutablex_client.js +1 -1
- package/dist/index.browser.js +61 -8
- package/dist/index.browser.js.map +1 -1
- package/dist/index.cjs +28618 -6887
- package/dist/index.d.ts +25293 -6786
- package/dist/index.js +28587 -6851
- package/dist/orderbook.d.ts +252 -0
- package/dist/orderbook.js +1983 -0
- package/dist/passport.d.ts +1 -0
- package/dist/passport.js +5 -4
- package/package.json +25 -1
|
@@ -0,0 +1,1188 @@
|
|
|
1
|
+
/// <reference types="node" />
|
|
2
|
+
import { ExchangeContracts } from 'config';
|
|
3
|
+
|
|
4
|
+
declare type Bytes = ArrayLike<number>;
|
|
5
|
+
declare type BytesLike = Bytes | string;
|
|
6
|
+
interface Hexable {
|
|
7
|
+
toHexString(): string;
|
|
8
|
+
}
|
|
9
|
+
|
|
10
|
+
declare type BigNumberish = BigNumber | Bytes | bigint | string | number;
|
|
11
|
+
declare class BigNumber implements Hexable {
|
|
12
|
+
readonly _hex: string;
|
|
13
|
+
readonly _isBigNumber: boolean;
|
|
14
|
+
constructor(constructorGuard: any, hex: string);
|
|
15
|
+
fromTwos(value: number): BigNumber;
|
|
16
|
+
toTwos(value: number): BigNumber;
|
|
17
|
+
abs(): BigNumber;
|
|
18
|
+
add(other: BigNumberish): BigNumber;
|
|
19
|
+
sub(other: BigNumberish): BigNumber;
|
|
20
|
+
div(other: BigNumberish): BigNumber;
|
|
21
|
+
mul(other: BigNumberish): BigNumber;
|
|
22
|
+
mod(other: BigNumberish): BigNumber;
|
|
23
|
+
pow(other: BigNumberish): BigNumber;
|
|
24
|
+
and(other: BigNumberish): BigNumber;
|
|
25
|
+
or(other: BigNumberish): BigNumber;
|
|
26
|
+
xor(other: BigNumberish): BigNumber;
|
|
27
|
+
mask(value: number): BigNumber;
|
|
28
|
+
shl(value: number): BigNumber;
|
|
29
|
+
shr(value: number): BigNumber;
|
|
30
|
+
eq(other: BigNumberish): boolean;
|
|
31
|
+
lt(other: BigNumberish): boolean;
|
|
32
|
+
lte(other: BigNumberish): boolean;
|
|
33
|
+
gt(other: BigNumberish): boolean;
|
|
34
|
+
gte(other: BigNumberish): boolean;
|
|
35
|
+
isNegative(): boolean;
|
|
36
|
+
isZero(): boolean;
|
|
37
|
+
toNumber(): number;
|
|
38
|
+
toBigInt(): bigint;
|
|
39
|
+
toString(): string;
|
|
40
|
+
toHexString(): string;
|
|
41
|
+
toJSON(key?: string): any;
|
|
42
|
+
static from(value: any): BigNumber;
|
|
43
|
+
static isBigNumber(value: any): value is BigNumber;
|
|
44
|
+
}
|
|
45
|
+
|
|
46
|
+
declare type Deferrable<T> = {
|
|
47
|
+
[K in keyof T]: T[K] | Promise<T[K]>;
|
|
48
|
+
};
|
|
49
|
+
declare class Description<T = any> {
|
|
50
|
+
constructor(info: {
|
|
51
|
+
[K in keyof T]: T[K];
|
|
52
|
+
});
|
|
53
|
+
}
|
|
54
|
+
|
|
55
|
+
declare type Network = {
|
|
56
|
+
name: string;
|
|
57
|
+
chainId: number;
|
|
58
|
+
ensAddress?: string;
|
|
59
|
+
_defaultProvider?: (providers: any, options?: any) => any;
|
|
60
|
+
};
|
|
61
|
+
declare type Networkish = Network | string | number;
|
|
62
|
+
|
|
63
|
+
declare type AccessList = Array<{
|
|
64
|
+
address: string;
|
|
65
|
+
storageKeys: Array<string>;
|
|
66
|
+
}>;
|
|
67
|
+
declare type AccessListish = AccessList | Array<[string, Array<string>]> | Record<string, Array<string>>;
|
|
68
|
+
interface Transaction {
|
|
69
|
+
hash?: string;
|
|
70
|
+
to?: string;
|
|
71
|
+
from?: string;
|
|
72
|
+
nonce: number;
|
|
73
|
+
gasLimit: BigNumber;
|
|
74
|
+
gasPrice?: BigNumber;
|
|
75
|
+
data: string;
|
|
76
|
+
value: BigNumber;
|
|
77
|
+
chainId: number;
|
|
78
|
+
r?: string;
|
|
79
|
+
s?: string;
|
|
80
|
+
v?: number;
|
|
81
|
+
type?: number | null;
|
|
82
|
+
accessList?: AccessList;
|
|
83
|
+
maxPriorityFeePerGas?: BigNumber;
|
|
84
|
+
maxFeePerGas?: BigNumber;
|
|
85
|
+
}
|
|
86
|
+
|
|
87
|
+
declare type ConnectionInfo = {
|
|
88
|
+
url: string;
|
|
89
|
+
headers?: {
|
|
90
|
+
[key: string]: string | number;
|
|
91
|
+
};
|
|
92
|
+
user?: string;
|
|
93
|
+
password?: string;
|
|
94
|
+
allowInsecureAuthentication?: boolean;
|
|
95
|
+
allowGzip?: boolean;
|
|
96
|
+
throttleLimit?: number;
|
|
97
|
+
throttleSlotInterval?: number;
|
|
98
|
+
throttleCallback?: (attempt: number, url: string) => Promise<boolean>;
|
|
99
|
+
skipFetchSetup?: boolean;
|
|
100
|
+
fetchOptions?: Record<string, string>;
|
|
101
|
+
errorPassThrough?: boolean;
|
|
102
|
+
timeout?: number;
|
|
103
|
+
};
|
|
104
|
+
interface OnceBlockable {
|
|
105
|
+
once(eventName: "block", handler: () => void): void;
|
|
106
|
+
}
|
|
107
|
+
|
|
108
|
+
declare type TransactionRequest = {
|
|
109
|
+
to?: string;
|
|
110
|
+
from?: string;
|
|
111
|
+
nonce?: BigNumberish;
|
|
112
|
+
gasLimit?: BigNumberish;
|
|
113
|
+
gasPrice?: BigNumberish;
|
|
114
|
+
data?: BytesLike;
|
|
115
|
+
value?: BigNumberish;
|
|
116
|
+
chainId?: number;
|
|
117
|
+
type?: number;
|
|
118
|
+
accessList?: AccessListish;
|
|
119
|
+
maxPriorityFeePerGas?: BigNumberish;
|
|
120
|
+
maxFeePerGas?: BigNumberish;
|
|
121
|
+
customData?: Record<string, any>;
|
|
122
|
+
ccipReadEnabled?: boolean;
|
|
123
|
+
};
|
|
124
|
+
interface TransactionResponse extends Transaction {
|
|
125
|
+
hash: string;
|
|
126
|
+
blockNumber?: number;
|
|
127
|
+
blockHash?: string;
|
|
128
|
+
timestamp?: number;
|
|
129
|
+
confirmations: number;
|
|
130
|
+
from: string;
|
|
131
|
+
raw?: string;
|
|
132
|
+
wait: (confirmations?: number) => Promise<TransactionReceipt>;
|
|
133
|
+
}
|
|
134
|
+
declare type BlockTag = string | number;
|
|
135
|
+
interface _Block {
|
|
136
|
+
hash: string;
|
|
137
|
+
parentHash: string;
|
|
138
|
+
number: number;
|
|
139
|
+
timestamp: number;
|
|
140
|
+
nonce: string;
|
|
141
|
+
difficulty: number;
|
|
142
|
+
_difficulty: BigNumber;
|
|
143
|
+
gasLimit: BigNumber;
|
|
144
|
+
gasUsed: BigNumber;
|
|
145
|
+
miner: string;
|
|
146
|
+
extraData: string;
|
|
147
|
+
baseFeePerGas?: null | BigNumber;
|
|
148
|
+
}
|
|
149
|
+
interface Block extends _Block {
|
|
150
|
+
transactions: Array<string>;
|
|
151
|
+
}
|
|
152
|
+
interface BlockWithTransactions extends _Block {
|
|
153
|
+
transactions: Array<TransactionResponse>;
|
|
154
|
+
}
|
|
155
|
+
interface Log {
|
|
156
|
+
blockNumber: number;
|
|
157
|
+
blockHash: string;
|
|
158
|
+
transactionIndex: number;
|
|
159
|
+
removed: boolean;
|
|
160
|
+
address: string;
|
|
161
|
+
data: string;
|
|
162
|
+
topics: Array<string>;
|
|
163
|
+
transactionHash: string;
|
|
164
|
+
logIndex: number;
|
|
165
|
+
}
|
|
166
|
+
interface TransactionReceipt {
|
|
167
|
+
to: string;
|
|
168
|
+
from: string;
|
|
169
|
+
contractAddress: string;
|
|
170
|
+
transactionIndex: number;
|
|
171
|
+
root?: string;
|
|
172
|
+
gasUsed: BigNumber;
|
|
173
|
+
logsBloom: string;
|
|
174
|
+
blockHash: string;
|
|
175
|
+
transactionHash: string;
|
|
176
|
+
logs: Array<Log>;
|
|
177
|
+
blockNumber: number;
|
|
178
|
+
confirmations: number;
|
|
179
|
+
cumulativeGasUsed: BigNumber;
|
|
180
|
+
effectiveGasPrice: BigNumber;
|
|
181
|
+
byzantium: boolean;
|
|
182
|
+
type: number;
|
|
183
|
+
status?: number;
|
|
184
|
+
}
|
|
185
|
+
interface FeeData {
|
|
186
|
+
lastBaseFeePerGas: null | BigNumber;
|
|
187
|
+
maxFeePerGas: null | BigNumber;
|
|
188
|
+
maxPriorityFeePerGas: null | BigNumber;
|
|
189
|
+
gasPrice: null | BigNumber;
|
|
190
|
+
}
|
|
191
|
+
interface EventFilter {
|
|
192
|
+
address?: string;
|
|
193
|
+
topics?: Array<string | Array<string> | null>;
|
|
194
|
+
}
|
|
195
|
+
interface Filter extends EventFilter {
|
|
196
|
+
fromBlock?: BlockTag;
|
|
197
|
+
toBlock?: BlockTag;
|
|
198
|
+
}
|
|
199
|
+
interface FilterByBlockHash extends EventFilter {
|
|
200
|
+
blockHash?: string;
|
|
201
|
+
}
|
|
202
|
+
declare abstract class ForkEvent extends Description {
|
|
203
|
+
readonly expiry: number;
|
|
204
|
+
readonly _isForkEvent?: boolean;
|
|
205
|
+
static isForkEvent(value: any): value is ForkEvent;
|
|
206
|
+
}
|
|
207
|
+
declare type EventType = string | Array<string | Array<string>> | EventFilter | ForkEvent;
|
|
208
|
+
declare type Listener = (...args: Array<any>) => void;
|
|
209
|
+
declare abstract class Provider implements OnceBlockable {
|
|
210
|
+
abstract getNetwork(): Promise<Network>;
|
|
211
|
+
abstract getBlockNumber(): Promise<number>;
|
|
212
|
+
abstract getGasPrice(): Promise<BigNumber>;
|
|
213
|
+
getFeeData(): Promise<FeeData>;
|
|
214
|
+
abstract getBalance(addressOrName: string | Promise<string>, blockTag?: BlockTag | Promise<BlockTag>): Promise<BigNumber>;
|
|
215
|
+
abstract getTransactionCount(addressOrName: string | Promise<string>, blockTag?: BlockTag | Promise<BlockTag>): Promise<number>;
|
|
216
|
+
abstract getCode(addressOrName: string | Promise<string>, blockTag?: BlockTag | Promise<BlockTag>): Promise<string>;
|
|
217
|
+
abstract getStorageAt(addressOrName: string | Promise<string>, position: BigNumberish | Promise<BigNumberish>, blockTag?: BlockTag | Promise<BlockTag>): Promise<string>;
|
|
218
|
+
abstract sendTransaction(signedTransaction: string | Promise<string>): Promise<TransactionResponse>;
|
|
219
|
+
abstract call(transaction: Deferrable<TransactionRequest>, blockTag?: BlockTag | Promise<BlockTag>): Promise<string>;
|
|
220
|
+
abstract estimateGas(transaction: Deferrable<TransactionRequest>): Promise<BigNumber>;
|
|
221
|
+
abstract getBlock(blockHashOrBlockTag: BlockTag | string | Promise<BlockTag | string>): Promise<Block>;
|
|
222
|
+
abstract getBlockWithTransactions(blockHashOrBlockTag: BlockTag | string | Promise<BlockTag | string>): Promise<BlockWithTransactions>;
|
|
223
|
+
abstract getTransaction(transactionHash: string): Promise<TransactionResponse>;
|
|
224
|
+
abstract getTransactionReceipt(transactionHash: string): Promise<TransactionReceipt>;
|
|
225
|
+
abstract getLogs(filter: Filter): Promise<Array<Log>>;
|
|
226
|
+
abstract resolveName(name: string | Promise<string>): Promise<null | string>;
|
|
227
|
+
abstract lookupAddress(address: string | Promise<string>): Promise<null | string>;
|
|
228
|
+
abstract on(eventName: EventType, listener: Listener): Provider;
|
|
229
|
+
abstract once(eventName: EventType, listener: Listener): Provider;
|
|
230
|
+
abstract emit(eventName: EventType, ...args: Array<any>): boolean;
|
|
231
|
+
abstract listenerCount(eventName?: EventType): number;
|
|
232
|
+
abstract listeners(eventName?: EventType): Array<Listener>;
|
|
233
|
+
abstract off(eventName: EventType, listener?: Listener): Provider;
|
|
234
|
+
abstract removeAllListeners(eventName?: EventType): Provider;
|
|
235
|
+
addListener(eventName: EventType, listener: Listener): Provider;
|
|
236
|
+
removeListener(eventName: EventType, listener: Listener): Provider;
|
|
237
|
+
abstract waitForTransaction(transactionHash: string, confirmations?: number, timeout?: number): Promise<TransactionReceipt>;
|
|
238
|
+
readonly _isProvider: boolean;
|
|
239
|
+
constructor();
|
|
240
|
+
static isProvider(value: any): value is Provider;
|
|
241
|
+
}
|
|
242
|
+
|
|
243
|
+
interface TypedDataDomain {
|
|
244
|
+
name?: string;
|
|
245
|
+
version?: string;
|
|
246
|
+
chainId?: BigNumberish;
|
|
247
|
+
verifyingContract?: string;
|
|
248
|
+
salt?: BytesLike;
|
|
249
|
+
}
|
|
250
|
+
interface TypedDataField {
|
|
251
|
+
name: string;
|
|
252
|
+
type: string;
|
|
253
|
+
}
|
|
254
|
+
interface TypedDataSigner {
|
|
255
|
+
_signTypedData(domain: TypedDataDomain, types: Record<string, Array<TypedDataField>>, value: Record<string, any>): Promise<string>;
|
|
256
|
+
}
|
|
257
|
+
declare abstract class Signer {
|
|
258
|
+
readonly provider?: Provider;
|
|
259
|
+
abstract getAddress(): Promise<string>;
|
|
260
|
+
abstract signMessage(message: Bytes | string): Promise<string>;
|
|
261
|
+
abstract signTransaction(transaction: Deferrable<TransactionRequest>): Promise<string>;
|
|
262
|
+
abstract connect(provider: Provider): Signer;
|
|
263
|
+
readonly _isSigner: boolean;
|
|
264
|
+
constructor();
|
|
265
|
+
getBalance(blockTag?: BlockTag): Promise<BigNumber>;
|
|
266
|
+
getTransactionCount(blockTag?: BlockTag): Promise<number>;
|
|
267
|
+
estimateGas(transaction: Deferrable<TransactionRequest>): Promise<BigNumber>;
|
|
268
|
+
call(transaction: Deferrable<TransactionRequest>, blockTag?: BlockTag): Promise<string>;
|
|
269
|
+
sendTransaction(transaction: Deferrable<TransactionRequest>): Promise<TransactionResponse>;
|
|
270
|
+
getChainId(): Promise<number>;
|
|
271
|
+
getGasPrice(): Promise<BigNumber>;
|
|
272
|
+
getFeeData(): Promise<FeeData>;
|
|
273
|
+
resolveName(name: string): Promise<string>;
|
|
274
|
+
checkTransaction(transaction: Deferrable<TransactionRequest>): Deferrable<TransactionRequest>;
|
|
275
|
+
populateTransaction(transaction: Deferrable<TransactionRequest>): Promise<TransactionRequest>;
|
|
276
|
+
_checkProvider(operation?: string): void;
|
|
277
|
+
static isSigner(value: any): value is Signer;
|
|
278
|
+
}
|
|
279
|
+
|
|
280
|
+
declare type FormatFunc = (value: any) => any;
|
|
281
|
+
declare type FormatFuncs = {
|
|
282
|
+
[key: string]: FormatFunc;
|
|
283
|
+
};
|
|
284
|
+
declare type Formats = {
|
|
285
|
+
transaction: FormatFuncs;
|
|
286
|
+
transactionRequest: FormatFuncs;
|
|
287
|
+
receipt: FormatFuncs;
|
|
288
|
+
receiptLog: FormatFuncs;
|
|
289
|
+
block: FormatFuncs;
|
|
290
|
+
blockWithTransactions: FormatFuncs;
|
|
291
|
+
filter: FormatFuncs;
|
|
292
|
+
filterLog: FormatFuncs;
|
|
293
|
+
};
|
|
294
|
+
declare class Formatter {
|
|
295
|
+
readonly formats: Formats;
|
|
296
|
+
constructor();
|
|
297
|
+
getDefaultFormats(): Formats;
|
|
298
|
+
accessList(accessList: Array<any>): AccessList;
|
|
299
|
+
number(number: any): number;
|
|
300
|
+
type(number: any): number;
|
|
301
|
+
bigNumber(value: any): BigNumber;
|
|
302
|
+
boolean(value: any): boolean;
|
|
303
|
+
hex(value: any, strict?: boolean): string;
|
|
304
|
+
data(value: any, strict?: boolean): string;
|
|
305
|
+
address(value: any): string;
|
|
306
|
+
callAddress(value: any): string;
|
|
307
|
+
contractAddress(value: any): string;
|
|
308
|
+
blockTag(blockTag: any): string;
|
|
309
|
+
hash(value: any, strict?: boolean): string;
|
|
310
|
+
difficulty(value: any): number;
|
|
311
|
+
uint256(value: any): string;
|
|
312
|
+
_block(value: any, format: any): Block;
|
|
313
|
+
block(value: any): Block;
|
|
314
|
+
blockWithTransactions(value: any): Block;
|
|
315
|
+
transactionRequest(value: any): any;
|
|
316
|
+
transactionResponse(transaction: any): TransactionResponse;
|
|
317
|
+
transaction(value: any): any;
|
|
318
|
+
receiptLog(value: any): any;
|
|
319
|
+
receipt(value: any): TransactionReceipt;
|
|
320
|
+
topics(value: any): any;
|
|
321
|
+
filter(value: any): any;
|
|
322
|
+
filterLog(value: any): any;
|
|
323
|
+
static check(format: {
|
|
324
|
+
[name: string]: FormatFunc;
|
|
325
|
+
}, object: any): any;
|
|
326
|
+
static allowNull(format: FormatFunc, nullValue?: any): FormatFunc;
|
|
327
|
+
static allowFalsish(format: FormatFunc, replaceValue: any): FormatFunc;
|
|
328
|
+
static arrayOf(format: FormatFunc): FormatFunc;
|
|
329
|
+
}
|
|
330
|
+
|
|
331
|
+
declare class Event {
|
|
332
|
+
readonly listener: Listener;
|
|
333
|
+
readonly once: boolean;
|
|
334
|
+
readonly tag: string;
|
|
335
|
+
_lastBlockNumber: number;
|
|
336
|
+
_inflight: boolean;
|
|
337
|
+
constructor(tag: string, listener: Listener, once: boolean);
|
|
338
|
+
get event(): EventType;
|
|
339
|
+
get type(): string;
|
|
340
|
+
get hash(): string;
|
|
341
|
+
get filter(): Filter;
|
|
342
|
+
pollable(): boolean;
|
|
343
|
+
}
|
|
344
|
+
interface EnsResolver {
|
|
345
|
+
readonly name: string;
|
|
346
|
+
readonly address: string;
|
|
347
|
+
getAddress(coinType?: 60): Promise<null | string>;
|
|
348
|
+
getContentHash(): Promise<null | string>;
|
|
349
|
+
getText(key: string): Promise<null | string>;
|
|
350
|
+
}
|
|
351
|
+
interface EnsProvider {
|
|
352
|
+
resolveName(name: string): Promise<null | string>;
|
|
353
|
+
lookupAddress(address: string): Promise<null | string>;
|
|
354
|
+
getResolver(name: string): Promise<null | EnsResolver>;
|
|
355
|
+
}
|
|
356
|
+
interface Avatar {
|
|
357
|
+
url: string;
|
|
358
|
+
linkage: Array<{
|
|
359
|
+
type: string;
|
|
360
|
+
content: string;
|
|
361
|
+
}>;
|
|
362
|
+
}
|
|
363
|
+
declare class Resolver implements EnsResolver {
|
|
364
|
+
readonly provider: BaseProvider;
|
|
365
|
+
readonly name: string;
|
|
366
|
+
readonly address: string;
|
|
367
|
+
readonly _resolvedAddress: null | string;
|
|
368
|
+
_supportsEip2544: null | Promise<boolean>;
|
|
369
|
+
constructor(provider: BaseProvider, address: string, name: string, resolvedAddress?: string);
|
|
370
|
+
supportsWildcard(): Promise<boolean>;
|
|
371
|
+
_fetch(selector: string, parameters?: string): Promise<null | string>;
|
|
372
|
+
_fetchBytes(selector: string, parameters?: string): Promise<null | string>;
|
|
373
|
+
_getAddress(coinType: number, hexBytes: string): string;
|
|
374
|
+
getAddress(coinType?: number): Promise<string>;
|
|
375
|
+
getAvatar(): Promise<null | Avatar>;
|
|
376
|
+
getContentHash(): Promise<string>;
|
|
377
|
+
getText(key: string): Promise<string>;
|
|
378
|
+
}
|
|
379
|
+
declare class BaseProvider extends Provider implements EnsProvider {
|
|
380
|
+
_networkPromise: Promise<Network>;
|
|
381
|
+
_network: Network;
|
|
382
|
+
_events: Array<Event>;
|
|
383
|
+
formatter: Formatter;
|
|
384
|
+
_emitted: {
|
|
385
|
+
[eventName: string]: number | "pending";
|
|
386
|
+
};
|
|
387
|
+
_pollingInterval: number;
|
|
388
|
+
_poller: NodeJS.Timer;
|
|
389
|
+
_bootstrapPoll: NodeJS.Timer;
|
|
390
|
+
_lastBlockNumber: number;
|
|
391
|
+
_maxFilterBlockRange: number;
|
|
392
|
+
_fastBlockNumber: number;
|
|
393
|
+
_fastBlockNumberPromise: Promise<number>;
|
|
394
|
+
_fastQueryDate: number;
|
|
395
|
+
_maxInternalBlockNumber: number;
|
|
396
|
+
_internalBlockNumber: Promise<{
|
|
397
|
+
blockNumber: number;
|
|
398
|
+
reqTime: number;
|
|
399
|
+
respTime: number;
|
|
400
|
+
}>;
|
|
401
|
+
readonly anyNetwork: boolean;
|
|
402
|
+
disableCcipRead: boolean;
|
|
403
|
+
/**
|
|
404
|
+
* ready
|
|
405
|
+
*
|
|
406
|
+
* A Promise<Network> that resolves only once the provider is ready.
|
|
407
|
+
*
|
|
408
|
+
* Sub-classes that call the super with a network without a chainId
|
|
409
|
+
* MUST set this. Standard named networks have a known chainId.
|
|
410
|
+
*
|
|
411
|
+
*/
|
|
412
|
+
constructor(network: Networkish | Promise<Network>);
|
|
413
|
+
_ready(): Promise<Network>;
|
|
414
|
+
get ready(): Promise<Network>;
|
|
415
|
+
static getFormatter(): Formatter;
|
|
416
|
+
static getNetwork(network: Networkish): Network;
|
|
417
|
+
ccipReadFetch(tx: Transaction, calldata: string, urls: Array<string>): Promise<null | string>;
|
|
418
|
+
_getInternalBlockNumber(maxAge: number): Promise<number>;
|
|
419
|
+
poll(): Promise<void>;
|
|
420
|
+
resetEventsBlock(blockNumber: number): void;
|
|
421
|
+
get network(): Network;
|
|
422
|
+
detectNetwork(): Promise<Network>;
|
|
423
|
+
getNetwork(): Promise<Network>;
|
|
424
|
+
get blockNumber(): number;
|
|
425
|
+
get polling(): boolean;
|
|
426
|
+
set polling(value: boolean);
|
|
427
|
+
get pollingInterval(): number;
|
|
428
|
+
set pollingInterval(value: number);
|
|
429
|
+
_getFastBlockNumber(): Promise<number>;
|
|
430
|
+
_setFastBlockNumber(blockNumber: number): void;
|
|
431
|
+
waitForTransaction(transactionHash: string, confirmations?: number, timeout?: number): Promise<TransactionReceipt>;
|
|
432
|
+
_waitForTransaction(transactionHash: string, confirmations: number, timeout: number, replaceable: {
|
|
433
|
+
data: string;
|
|
434
|
+
from: string;
|
|
435
|
+
nonce: number;
|
|
436
|
+
to: string;
|
|
437
|
+
value: BigNumber;
|
|
438
|
+
startBlock: number;
|
|
439
|
+
}): Promise<TransactionReceipt>;
|
|
440
|
+
getBlockNumber(): Promise<number>;
|
|
441
|
+
getGasPrice(): Promise<BigNumber>;
|
|
442
|
+
getBalance(addressOrName: string | Promise<string>, blockTag?: BlockTag | Promise<BlockTag>): Promise<BigNumber>;
|
|
443
|
+
getTransactionCount(addressOrName: string | Promise<string>, blockTag?: BlockTag | Promise<BlockTag>): Promise<number>;
|
|
444
|
+
getCode(addressOrName: string | Promise<string>, blockTag?: BlockTag | Promise<BlockTag>): Promise<string>;
|
|
445
|
+
getStorageAt(addressOrName: string | Promise<string>, position: BigNumberish | Promise<BigNumberish>, blockTag?: BlockTag | Promise<BlockTag>): Promise<string>;
|
|
446
|
+
_wrapTransaction(tx: Transaction, hash?: string, startBlock?: number): TransactionResponse;
|
|
447
|
+
sendTransaction(signedTransaction: string | Promise<string>): Promise<TransactionResponse>;
|
|
448
|
+
_getTransactionRequest(transaction: Deferrable<TransactionRequest>): Promise<Transaction>;
|
|
449
|
+
_getFilter(filter: Filter | FilterByBlockHash | Promise<Filter | FilterByBlockHash>): Promise<Filter | FilterByBlockHash>;
|
|
450
|
+
_call(transaction: TransactionRequest, blockTag: BlockTag, attempt: number): Promise<string>;
|
|
451
|
+
call(transaction: Deferrable<TransactionRequest>, blockTag?: BlockTag | Promise<BlockTag>): Promise<string>;
|
|
452
|
+
estimateGas(transaction: Deferrable<TransactionRequest>): Promise<BigNumber>;
|
|
453
|
+
_getAddress(addressOrName: string | Promise<string>): Promise<string>;
|
|
454
|
+
_getBlock(blockHashOrBlockTag: BlockTag | string | Promise<BlockTag | string>, includeTransactions?: boolean): Promise<Block | BlockWithTransactions>;
|
|
455
|
+
getBlock(blockHashOrBlockTag: BlockTag | string | Promise<BlockTag | string>): Promise<Block>;
|
|
456
|
+
getBlockWithTransactions(blockHashOrBlockTag: BlockTag | string | Promise<BlockTag | string>): Promise<BlockWithTransactions>;
|
|
457
|
+
getTransaction(transactionHash: string | Promise<string>): Promise<TransactionResponse>;
|
|
458
|
+
getTransactionReceipt(transactionHash: string | Promise<string>): Promise<TransactionReceipt>;
|
|
459
|
+
getLogs(filter: Filter | FilterByBlockHash | Promise<Filter | FilterByBlockHash>): Promise<Array<Log>>;
|
|
460
|
+
getEtherPrice(): Promise<number>;
|
|
461
|
+
_getBlockTag(blockTag: BlockTag | Promise<BlockTag>): Promise<BlockTag>;
|
|
462
|
+
getResolver(name: string): Promise<null | Resolver>;
|
|
463
|
+
_getResolver(name: string, operation?: string): Promise<string>;
|
|
464
|
+
resolveName(name: string | Promise<string>): Promise<null | string>;
|
|
465
|
+
lookupAddress(address: string | Promise<string>): Promise<null | string>;
|
|
466
|
+
getAvatar(nameOrAddress: string): Promise<null | string>;
|
|
467
|
+
perform(method: string, params: any): Promise<any>;
|
|
468
|
+
_startEvent(event: Event): void;
|
|
469
|
+
_stopEvent(event: Event): void;
|
|
470
|
+
_addEventListener(eventName: EventType, listener: Listener, once: boolean): this;
|
|
471
|
+
on(eventName: EventType, listener: Listener): this;
|
|
472
|
+
once(eventName: EventType, listener: Listener): this;
|
|
473
|
+
emit(eventName: EventType, ...args: Array<any>): boolean;
|
|
474
|
+
listenerCount(eventName?: EventType): number;
|
|
475
|
+
listeners(eventName?: EventType): Array<Listener>;
|
|
476
|
+
off(eventName: EventType, listener?: Listener): this;
|
|
477
|
+
removeAllListeners(eventName?: EventType): this;
|
|
478
|
+
}
|
|
479
|
+
|
|
480
|
+
declare class JsonRpcSigner extends Signer implements TypedDataSigner {
|
|
481
|
+
readonly provider: JsonRpcProvider;
|
|
482
|
+
_index: number;
|
|
483
|
+
_address: string;
|
|
484
|
+
constructor(constructorGuard: any, provider: JsonRpcProvider, addressOrIndex?: string | number);
|
|
485
|
+
connect(provider: Provider): JsonRpcSigner;
|
|
486
|
+
connectUnchecked(): JsonRpcSigner;
|
|
487
|
+
getAddress(): Promise<string>;
|
|
488
|
+
sendUncheckedTransaction(transaction: Deferrable<TransactionRequest>): Promise<string>;
|
|
489
|
+
signTransaction(transaction: Deferrable<TransactionRequest>): Promise<string>;
|
|
490
|
+
sendTransaction(transaction: Deferrable<TransactionRequest>): Promise<TransactionResponse>;
|
|
491
|
+
signMessage(message: Bytes | string): Promise<string>;
|
|
492
|
+
_legacySignMessage(message: Bytes | string): Promise<string>;
|
|
493
|
+
_signTypedData(domain: TypedDataDomain, types: Record<string, Array<TypedDataField>>, value: Record<string, any>): Promise<string>;
|
|
494
|
+
unlock(password: string): Promise<boolean>;
|
|
495
|
+
}
|
|
496
|
+
declare class UncheckedJsonRpcSigner extends JsonRpcSigner {
|
|
497
|
+
sendTransaction(transaction: Deferrable<TransactionRequest>): Promise<TransactionResponse>;
|
|
498
|
+
}
|
|
499
|
+
declare class JsonRpcProvider extends BaseProvider {
|
|
500
|
+
readonly connection: ConnectionInfo;
|
|
501
|
+
_pendingFilter: Promise<number>;
|
|
502
|
+
_nextId: number;
|
|
503
|
+
_eventLoopCache: Record<string, Promise<any>>;
|
|
504
|
+
get _cache(): Record<string, Promise<any>>;
|
|
505
|
+
constructor(url?: ConnectionInfo | string, network?: Networkish);
|
|
506
|
+
static defaultUrl(): string;
|
|
507
|
+
detectNetwork(): Promise<Network>;
|
|
508
|
+
_uncachedDetectNetwork(): Promise<Network>;
|
|
509
|
+
getSigner(addressOrIndex?: string | number): JsonRpcSigner;
|
|
510
|
+
getUncheckedSigner(addressOrIndex?: string | number): UncheckedJsonRpcSigner;
|
|
511
|
+
listAccounts(): Promise<Array<string>>;
|
|
512
|
+
send(method: string, params: Array<any>): Promise<any>;
|
|
513
|
+
prepareRequest(method: string, params: any): [string, Array<any>];
|
|
514
|
+
perform(method: string, params: any): Promise<any>;
|
|
515
|
+
_startEvent(event: Event): void;
|
|
516
|
+
_startPending(): void;
|
|
517
|
+
_stopEvent(event: Event): void;
|
|
518
|
+
static hexlifyTransaction(transaction: TransactionRequest, allowExtra?: {
|
|
519
|
+
[key: string]: boolean;
|
|
520
|
+
}): {
|
|
521
|
+
[key: string]: string | AccessList;
|
|
522
|
+
};
|
|
523
|
+
}
|
|
524
|
+
|
|
525
|
+
declare type ExternalProvider = {
|
|
526
|
+
isMetaMask?: boolean;
|
|
527
|
+
isStatus?: boolean;
|
|
528
|
+
host?: string;
|
|
529
|
+
path?: string;
|
|
530
|
+
sendAsync?: (request: {
|
|
531
|
+
method: string;
|
|
532
|
+
params?: Array<any>;
|
|
533
|
+
}, callback: (error: any, response: any) => void) => void;
|
|
534
|
+
send?: (request: {
|
|
535
|
+
method: string;
|
|
536
|
+
params?: Array<any>;
|
|
537
|
+
}, callback: (error: any, response: any) => void) => void;
|
|
538
|
+
request?: (request: {
|
|
539
|
+
method: string;
|
|
540
|
+
params?: Array<any>;
|
|
541
|
+
}) => Promise<any>;
|
|
542
|
+
};
|
|
543
|
+
declare type JsonRpcFetchFunc = (method: string, params?: Array<any>) => Promise<any>;
|
|
544
|
+
declare class Web3Provider extends JsonRpcProvider {
|
|
545
|
+
readonly provider: ExternalProvider;
|
|
546
|
+
readonly jsonRpcFetchFunc: JsonRpcFetchFunc;
|
|
547
|
+
constructor(provider: ExternalProvider | JsonRpcFetchFunc, network?: Networkish);
|
|
548
|
+
send(method: string, params: Array<any>): Promise<any>;
|
|
549
|
+
}
|
|
550
|
+
|
|
551
|
+
declare enum Environment {
|
|
552
|
+
PRODUCTION = "production",
|
|
553
|
+
SANDBOX = "sandbox"
|
|
554
|
+
}
|
|
555
|
+
declare class ImmutableConfiguration {
|
|
556
|
+
readonly environment: Environment;
|
|
557
|
+
readonly apiKey?: string;
|
|
558
|
+
constructor(options: {
|
|
559
|
+
environment: Environment;
|
|
560
|
+
apiKey?: string;
|
|
561
|
+
});
|
|
562
|
+
}
|
|
563
|
+
interface ModuleConfiguration<T> {
|
|
564
|
+
baseConfig: ImmutableConfiguration;
|
|
565
|
+
overrides?: T;
|
|
566
|
+
}
|
|
567
|
+
|
|
568
|
+
/**
|
|
569
|
+
* Interface representing a token
|
|
570
|
+
* @property {number} chainId - The chain ID
|
|
571
|
+
* @property {string} address - The token address
|
|
572
|
+
* @property {number} decimals - The token decimals
|
|
573
|
+
* @property {string | undefined} symbol - The token symbol or undefined if it is not available
|
|
574
|
+
* @property {string | undefined} name - The token name or undefined if it is not available
|
|
575
|
+
*/
|
|
576
|
+
type TokenInfo$1 = {
|
|
577
|
+
chainId: number;
|
|
578
|
+
address: string;
|
|
579
|
+
decimals: number;
|
|
580
|
+
symbol?: string;
|
|
581
|
+
name?: string;
|
|
582
|
+
};
|
|
583
|
+
interface ExchangeOverrides {
|
|
584
|
+
rpcURL: string;
|
|
585
|
+
exchangeContracts: ExchangeContracts;
|
|
586
|
+
commonRoutingTokens: TokenInfo$1[];
|
|
587
|
+
nativeToken: TokenInfo$1;
|
|
588
|
+
}
|
|
589
|
+
|
|
590
|
+
/**
|
|
591
|
+
* @typedef {string} Address - Represents an Ethereum address.
|
|
592
|
+
*/
|
|
593
|
+
type Address = string;
|
|
594
|
+
/**
|
|
595
|
+
* @typedef {Address | 'NATIVE'} FungibleToken - Represents a fungible token, either an ERC20 token address or the native token.
|
|
596
|
+
*/
|
|
597
|
+
type FungibleToken = Address | 'NATIVE';
|
|
598
|
+
|
|
599
|
+
/**
|
|
600
|
+
* Enum representing different chain IDs.
|
|
601
|
+
* @enum {number}
|
|
602
|
+
* @property {number} IMTBL_ZKEVM_MAINNET - The chain ID for IMTBL ZKEVM Mainnet.
|
|
603
|
+
* @property {number} IMTBL_ZKEVM_TESTNET - The chain ID for IMTBL ZKEVM Testnet.
|
|
604
|
+
* @property {number} IMTBL_ZKEVM_DEVNET - The chain ID for IMTBL ZKEVM Devnet.
|
|
605
|
+
* @property {number} ETHEREUM - The chain ID for Ethereum.
|
|
606
|
+
* @property {number} SEPOLIA - The chain ID for Sepolia.
|
|
607
|
+
*/
|
|
608
|
+
declare enum ChainId {
|
|
609
|
+
IMTBL_ZKEVM_MAINNET = 13371,
|
|
610
|
+
IMTBL_ZKEVM_TESTNET = 13372,
|
|
611
|
+
IMTBL_ZKEVM_DEVNET = 13433,
|
|
612
|
+
ETHEREUM = 1,
|
|
613
|
+
SEPOLIA = 11155111
|
|
614
|
+
}
|
|
615
|
+
/**
|
|
616
|
+
* Enum representing different chain names.
|
|
617
|
+
* @enum {number}
|
|
618
|
+
* @property {number} IMTBL_ZKEVM_MAINNET - The chain name for IMTBL ZKEVM Mainnet.
|
|
619
|
+
* @property {number} IMTBL_ZKEVM_TESTNET - The chain name for IMTBL ZKEVM Testnet.
|
|
620
|
+
* @property {number} IMTBL_ZKEVM_DEVNET - The chain name for IMTBL ZKEVM Devnet.
|
|
621
|
+
* @property {number} ETHEREUM - The chain name for Ethereum.
|
|
622
|
+
* @property {number} SEPOLIA - The chain name for Sepolia.
|
|
623
|
+
*/
|
|
624
|
+
declare enum ChainName {
|
|
625
|
+
ETHEREUM = "Ethereum",
|
|
626
|
+
SEPOLIA = "Sepolia",
|
|
627
|
+
IMTBL_ZKEVM_TESTNET = "Immutable zkEVM Test",
|
|
628
|
+
IMTBL_ZKEVM_DEVNET = "Immutable zkEVM Dev",
|
|
629
|
+
IMTBL_ZKEVM_MAINNET = "Immutable zkEVM"
|
|
630
|
+
}
|
|
631
|
+
/**
|
|
632
|
+
* Represents information about a token.
|
|
633
|
+
* @interface TokenInfo
|
|
634
|
+
* @property {string} name - The name of the token.
|
|
635
|
+
* @property {string} symbol - The symbol of the token.
|
|
636
|
+
* @property {number} decimals - The number of decimal places the token supports.
|
|
637
|
+
* @property {string | undefined} [address] - The address of the token.
|
|
638
|
+
* @property {string | undefined} [icon] - The URL of the token's icon.
|
|
639
|
+
*/
|
|
640
|
+
interface TokenInfo {
|
|
641
|
+
name: string;
|
|
642
|
+
symbol: string;
|
|
643
|
+
decimals: number;
|
|
644
|
+
address?: string;
|
|
645
|
+
icon?: string;
|
|
646
|
+
}
|
|
647
|
+
/**
|
|
648
|
+
* Interface representing the parameters for {@link Checkout.getBalance}.
|
|
649
|
+
* @property {Web3Provider} provider - The provider used to get the balance.
|
|
650
|
+
* @property {string} walletAddress - The wallet address.
|
|
651
|
+
* @property {string | undefined} contractAddress - The contract address of the token.
|
|
652
|
+
*/
|
|
653
|
+
interface GetBalanceParams {
|
|
654
|
+
provider: Web3Provider;
|
|
655
|
+
walletAddress: string;
|
|
656
|
+
contractAddress?: string;
|
|
657
|
+
}
|
|
658
|
+
/**
|
|
659
|
+
* Interface representing the result of {@link Checkout.getBalance}.
|
|
660
|
+
* @property {BigNumber} balance - The balance of the wallet for the token.
|
|
661
|
+
* @property {string} formattedBalance - The formatted balance of the wallet for the token.
|
|
662
|
+
* @property {TokenInfo} token - The token information.
|
|
663
|
+
*/
|
|
664
|
+
interface GetBalanceResult {
|
|
665
|
+
balance: BigNumber;
|
|
666
|
+
formattedBalance: string;
|
|
667
|
+
token: TokenInfo;
|
|
668
|
+
}
|
|
669
|
+
/**
|
|
670
|
+
* Interface representing the parameters for {@link Checkout.getAllBalances}.
|
|
671
|
+
* @property {Web3Provider} provider - The provider used to get the balances.
|
|
672
|
+
* @property {string} walletAddress - The wallet address.
|
|
673
|
+
* @property {ChainId} chainId - The ID of the network.
|
|
674
|
+
*/
|
|
675
|
+
interface GetAllBalancesParams {
|
|
676
|
+
provider: Web3Provider;
|
|
677
|
+
walletAddress: string;
|
|
678
|
+
chainId: ChainId;
|
|
679
|
+
}
|
|
680
|
+
/**
|
|
681
|
+
* Interface representing the result of {@link Checkout.getAllBalances}.
|
|
682
|
+
* @property {GetBalanceResult[]} balances - The array of balances of the wallet for every token.
|
|
683
|
+
*/
|
|
684
|
+
interface GetAllBalancesResult {
|
|
685
|
+
balances: GetBalanceResult[];
|
|
686
|
+
}
|
|
687
|
+
interface CheckoutOverrides {
|
|
688
|
+
}
|
|
689
|
+
interface CheckoutModuleConfiguration extends ModuleConfiguration<CheckoutOverrides> {
|
|
690
|
+
}
|
|
691
|
+
/**
|
|
692
|
+
* A type representing various remotely defined configurations which are
|
|
693
|
+
* accessible via the Checkout config and configured based on the Environment.
|
|
694
|
+
* @property {DexConfig} dex - The config used for the DEX.
|
|
695
|
+
* @property {AllowedNetworkConfig[]} allowedNetworks - An array representing the allowed networks.
|
|
696
|
+
* @property {GasEstimateTokenConfig | undefined} gasEstimateTokens - The config for the tokens used to estimate gas.
|
|
697
|
+
*/
|
|
698
|
+
type RemoteConfiguration = {
|
|
699
|
+
dex: DexConfig;
|
|
700
|
+
allowedNetworks: AllowedNetworkConfig[];
|
|
701
|
+
gasEstimateTokens?: GasEstimateTokenConfig;
|
|
702
|
+
};
|
|
703
|
+
/**
|
|
704
|
+
* A type representing the configuration for the DEX.
|
|
705
|
+
* @property {ExchangeOverrides | undefined} overrides - The DEX overrides.
|
|
706
|
+
* @property {TokenInfo[] | undefined} tokens - An array of tokens compatible with the DEX.
|
|
707
|
+
*/
|
|
708
|
+
type DexConfig = {
|
|
709
|
+
overrides?: ExchangeOverrides;
|
|
710
|
+
tokens?: TokenInfo[];
|
|
711
|
+
};
|
|
712
|
+
/**
|
|
713
|
+
* A type representing an allowed network.
|
|
714
|
+
* @property {number} chainId - The network chain id.
|
|
715
|
+
*/
|
|
716
|
+
type AllowedNetworkConfig = {
|
|
717
|
+
chainId: number;
|
|
718
|
+
};
|
|
719
|
+
/**
|
|
720
|
+
* A type representing the required information to estimate gas for a transaction.
|
|
721
|
+
* @type {{ [key: string]: { bridgeToL2Addresses?: GasEstimateBridgeToL2TokenConfig, swapAddresses?: GasEstimateSwapTokenConfig } }}
|
|
722
|
+
* - A map of addresses for estimating gas keyed by the network chain id.
|
|
723
|
+
* @property {GasEstimateBridgeToL2TokenConfig | undefined} bridgeToL2Addresses
|
|
724
|
+
* - The type representing the addresses for a bridge to layer 2 gas estimate.
|
|
725
|
+
* @property {GasEstimateSwapTokenConfig | undefined} swapAddresses - The type representing the addresses for a swap gas estimate
|
|
726
|
+
*/
|
|
727
|
+
type GasEstimateTokenConfig = {
|
|
728
|
+
[key: string]: {
|
|
729
|
+
bridgeToL2Addresses?: GasEstimateBridgeToL2TokenConfig;
|
|
730
|
+
swapAddresses?: GasEstimateSwapTokenConfig;
|
|
731
|
+
};
|
|
732
|
+
};
|
|
733
|
+
/**
|
|
734
|
+
* A type representing the config for a bridge to layer 2 gas estimate.
|
|
735
|
+
* @property {string | 'NATIVE'} gasTokenAddress - The address of the gas token.
|
|
736
|
+
* @property {string} fromAddress - The address of the token being bridged.
|
|
737
|
+
*/
|
|
738
|
+
type GasEstimateBridgeToL2TokenConfig = {
|
|
739
|
+
gasTokenAddress: string | 'NATIVE';
|
|
740
|
+
fromAddress: string;
|
|
741
|
+
};
|
|
742
|
+
/**
|
|
743
|
+
* A type representing the config for a swap gas estimate.
|
|
744
|
+
* @property {string} inAddress - The in token address.
|
|
745
|
+
* @property {string} outAddress - The out token address.
|
|
746
|
+
*/
|
|
747
|
+
type GasEstimateSwapTokenConfig = {
|
|
748
|
+
inAddress: string;
|
|
749
|
+
outAddress: string;
|
|
750
|
+
};
|
|
751
|
+
/**
|
|
752
|
+
* Represents information about a network.
|
|
753
|
+
* @interface NetworkInfo
|
|
754
|
+
* @property {string} name - The name of the network.
|
|
755
|
+
* @property {number} chainId - The chain ID of the network.
|
|
756
|
+
* @property {TokenInfo} nativeCurrency - Information about the native currency of the network.
|
|
757
|
+
* @property {boolean} isSupported - Indicates whether the network is supported.
|
|
758
|
+
*/
|
|
759
|
+
interface NetworkInfo {
|
|
760
|
+
name: string;
|
|
761
|
+
chainId: number;
|
|
762
|
+
nativeCurrency: TokenInfo;
|
|
763
|
+
isSupported: boolean;
|
|
764
|
+
}
|
|
765
|
+
/**
|
|
766
|
+
* Interface representing the params of {@link Checkout.connect}.
|
|
767
|
+
* @property {Web3Provider} provider - The provider used to connect to the network.
|
|
768
|
+
*/
|
|
769
|
+
interface ConnectParams {
|
|
770
|
+
provider: Web3Provider;
|
|
771
|
+
}
|
|
772
|
+
/**
|
|
773
|
+
* Interface representing the result of {@link Checkout.connect}.
|
|
774
|
+
* @property {Web3Provider} provider - The provider used to connect to the network.
|
|
775
|
+
* @property {NetworkInfo} network - Information about the connected network.
|
|
776
|
+
*/
|
|
777
|
+
interface ConnectResult {
|
|
778
|
+
provider: Web3Provider;
|
|
779
|
+
network: NetworkInfo;
|
|
780
|
+
}
|
|
781
|
+
/**
|
|
782
|
+
* Interface representing the params of {@link Checkout.checkIsWalletConnected}.
|
|
783
|
+
* @property {Web3Provider} provider - The provider used to connect to the network.
|
|
784
|
+
*/
|
|
785
|
+
interface CheckConnectionParams {
|
|
786
|
+
provider: Web3Provider;
|
|
787
|
+
}
|
|
788
|
+
/**
|
|
789
|
+
* Interface representing the result of {@link Checkout.checkIsWalletConnected}.
|
|
790
|
+
* @property {boolean} isConnected - A boolean indicating the connection status of th Web3 provider.
|
|
791
|
+
* @property {string} walletAddress - The wallet address used to check the connection.
|
|
792
|
+
*/
|
|
793
|
+
interface CheckConnectionResult {
|
|
794
|
+
isConnected: boolean;
|
|
795
|
+
walletAddress: string;
|
|
796
|
+
}
|
|
797
|
+
/**
|
|
798
|
+
* An enum representing the type of gas estimate.
|
|
799
|
+
* @enum {string}
|
|
800
|
+
* @property {string} BRIDGE_TO_L2 - The gas estimate type for a bridge to L2 transaction.
|
|
801
|
+
* @property {string} SWAP - The gas estimate type for a swap transaction.
|
|
802
|
+
*/
|
|
803
|
+
declare enum GasEstimateType {
|
|
804
|
+
BRIDGE_TO_L2 = "BRIDGE_TO_L2",
|
|
805
|
+
SWAP = "SWAP"
|
|
806
|
+
}
|
|
807
|
+
/**
|
|
808
|
+
* Represents the parameters for estimating gas usage, which can be either
|
|
809
|
+
* GasEstimateBridgeToL2Params or GasEstimateSwapParams {@link Checkout.gasEstimate}.
|
|
810
|
+
* @typedef {GasEstimateBridgeToL2Params | GasEstimateSwapParams} GasEstimateParams
|
|
811
|
+
*/
|
|
812
|
+
type GasEstimateParams = GasEstimateBridgeToL2Params | GasEstimateSwapParams;
|
|
813
|
+
/**
|
|
814
|
+
* An interface representing the parameters for estimating gas for a bridge to L2 transaction {@link Checkout.gasEstimate}.
|
|
815
|
+
* @param {GasEstimateType.BRIDGE_TO_L2} gasEstimateType - The type of gas estimate.
|
|
816
|
+
* @param {boolean} isSpendingCapApprovalRequired - Whether or not spending cap approval is required.
|
|
817
|
+
* @param {FungibleToken | undefined} tokenAddress - The address of the fungible token to use in the transaction.
|
|
818
|
+
*/
|
|
819
|
+
interface GasEstimateBridgeToL2Params {
|
|
820
|
+
gasEstimateType: GasEstimateType.BRIDGE_TO_L2;
|
|
821
|
+
isSpendingCapApprovalRequired: boolean;
|
|
822
|
+
tokenAddress?: FungibleToken;
|
|
823
|
+
}
|
|
824
|
+
/**
|
|
825
|
+
* An interface representing the parameters for a gas estimate swap {@link Checkout.gasEstimate}.
|
|
826
|
+
* @interface
|
|
827
|
+
* @property {GasEstimateType.SWAP} gasEstimateType - The type of gas estimate, which is always "swap".
|
|
828
|
+
*/
|
|
829
|
+
interface GasEstimateSwapParams {
|
|
830
|
+
gasEstimateType: GasEstimateType.SWAP;
|
|
831
|
+
}
|
|
832
|
+
/**
|
|
833
|
+
* An interface representing the result of a gas estimate for a swap transaction {@link Checkout.gasEstimate}.
|
|
834
|
+
* @interface GasEstimateSwapResult
|
|
835
|
+
* @property {GasEstimateType.SWAP} gasEstimateType - The type of gas estimate, which is always "SWAP".
|
|
836
|
+
* @property {TokenAmountEstimate} gasFee - The estimated gas fee for the swap transaction.
|
|
837
|
+
*/
|
|
838
|
+
interface GasEstimateSwapResult {
|
|
839
|
+
gasEstimateType: GasEstimateType.SWAP;
|
|
840
|
+
gasFee: TokenAmountEstimate;
|
|
841
|
+
}
|
|
842
|
+
/**
|
|
843
|
+
* An interface representing the result of a gas estimate for a bridge to L2 transaction {@link Checkout.gasEstimate}.
|
|
844
|
+
* @interface GasEstimateBridgeToL2Result
|
|
845
|
+
* @property {GasEstimateType.BRIDGE_TO_L2} gasEstimateType - The type of gas estimate.
|
|
846
|
+
* @property {TokenAmountEstimate} gasFee - The estimated gas fee for the transaction.
|
|
847
|
+
* @property {TokenAmountEstimate} bridgeFee - The estimated bridge fee for the transaction.
|
|
848
|
+
* @property {boolean} bridgeable - A boolean indicating whether the transaction is bridgeable.
|
|
849
|
+
*/
|
|
850
|
+
interface GasEstimateBridgeToL2Result {
|
|
851
|
+
gasEstimateType: GasEstimateType.BRIDGE_TO_L2;
|
|
852
|
+
gasFee: TokenAmountEstimate;
|
|
853
|
+
bridgeFee: TokenAmountEstimate;
|
|
854
|
+
bridgeable: boolean;
|
|
855
|
+
}
|
|
856
|
+
interface TokenAmountEstimate {
|
|
857
|
+
estimatedAmount?: BigNumber;
|
|
858
|
+
token?: TokenInfo;
|
|
859
|
+
}
|
|
860
|
+
/**
|
|
861
|
+
* Interface representing the parameters for {@link Checkout.switchNetwork}.
|
|
862
|
+
* @property {Web3Provider} provider - The provider to connect to the network.
|
|
863
|
+
* @property {ChainId} chainId - The ID of the network to switch to.
|
|
864
|
+
*/
|
|
865
|
+
interface SwitchNetworkParams {
|
|
866
|
+
provider: Web3Provider;
|
|
867
|
+
chainId: ChainId;
|
|
868
|
+
}
|
|
869
|
+
/**
|
|
870
|
+
* Represents the result of switching the network in a Web3 application {@link Checkout.switchNetwork}.
|
|
871
|
+
* @interface SwitchNetworkResult
|
|
872
|
+
* @property {NetworkInfo} network - The information about the switched network.
|
|
873
|
+
* @property {Web3Provider} provider - The Web3 provider for the switched network.
|
|
874
|
+
*/
|
|
875
|
+
interface SwitchNetworkResult {
|
|
876
|
+
network: NetworkInfo;
|
|
877
|
+
provider: Web3Provider;
|
|
878
|
+
}
|
|
879
|
+
/**
|
|
880
|
+
* * Interface representing the parameters for {@link Checkout.getNetworkInfo}.
|
|
881
|
+
* @property {Web3Provider} provider - The provider to connect to the network.
|
|
882
|
+
*/
|
|
883
|
+
interface GetNetworkParams {
|
|
884
|
+
provider: Web3Provider;
|
|
885
|
+
}
|
|
886
|
+
/**
|
|
887
|
+
* * Interface representing the parameters for {@link Checkout.getNetworkAllowList}.
|
|
888
|
+
* @property {NetworkFilterTypes} type - The type of allow list filter to apply.
|
|
889
|
+
* @property {NetworkFilter[]} [exclude] - The list of networks to exclude from the allow list.
|
|
890
|
+
*/
|
|
891
|
+
interface GetNetworkAllowListParams {
|
|
892
|
+
type: NetworkFilterTypes;
|
|
893
|
+
exclude?: NetworkFilter[];
|
|
894
|
+
}
|
|
895
|
+
/**
|
|
896
|
+
* Interface representing the result of {@link Checkout.getNetworkAllowList}.
|
|
897
|
+
* @property {NetworkInfo[]} networks - The list of allowed networks.
|
|
898
|
+
*/
|
|
899
|
+
interface GetNetworkAllowListResult {
|
|
900
|
+
networks: NetworkInfo[];
|
|
901
|
+
}
|
|
902
|
+
/**
|
|
903
|
+
* Enum representing the types of filters that can be applied to get the allow list of networks.
|
|
904
|
+
*/
|
|
905
|
+
declare enum NetworkFilterTypes {
|
|
906
|
+
ALL = "all"
|
|
907
|
+
}
|
|
908
|
+
/**
|
|
909
|
+
* Interface representing a filter for filtering a specific network.
|
|
910
|
+
* @property {ChainId} chainId - The ID of the network to allow or disallow.
|
|
911
|
+
*/
|
|
912
|
+
interface NetworkFilter {
|
|
913
|
+
chainId: ChainId;
|
|
914
|
+
}
|
|
915
|
+
/**
|
|
916
|
+
* Interface representing the parameters for {@link Checkout.getTokenAllowList}.
|
|
917
|
+
* @property {TokenFilterTypes} type - The type of token to retrieve.
|
|
918
|
+
* @property {ChainId} chainId - The ID of the blockchain network.
|
|
919
|
+
* @property {TokenFilter[]} [exclude] - The tokens to exclude from the list.
|
|
920
|
+
*/
|
|
921
|
+
interface GetTokenAllowListParams {
|
|
922
|
+
type: TokenFilterTypes;
|
|
923
|
+
chainId: ChainId;
|
|
924
|
+
exclude?: TokenFilter[];
|
|
925
|
+
}
|
|
926
|
+
/**
|
|
927
|
+
* Interface representing the result of {@link Checkout.getTokenAllowList}.
|
|
928
|
+
* @property {TokenInfo[]} tokens - The list of tokens allowed for the specified params.
|
|
929
|
+
*/
|
|
930
|
+
interface GetTokenAllowListResult {
|
|
931
|
+
tokens: TokenInfo[];
|
|
932
|
+
}
|
|
933
|
+
/**
|
|
934
|
+
* Enum representing the types of token filters available.
|
|
935
|
+
*/
|
|
936
|
+
declare enum TokenFilterTypes {
|
|
937
|
+
ALL = "all",
|
|
938
|
+
SWAP = "swap",
|
|
939
|
+
BRIDGE = "bridge"
|
|
940
|
+
}
|
|
941
|
+
/**
|
|
942
|
+
* Interface representing a token filter that can be used to exclude certain tokens.
|
|
943
|
+
* @property {string} address - The token contract address.
|
|
944
|
+
*/
|
|
945
|
+
interface TokenFilter {
|
|
946
|
+
address: string;
|
|
947
|
+
}
|
|
948
|
+
/**
|
|
949
|
+
* Interface representing the parameters for {@link Checkout.sendTransaction}.
|
|
950
|
+
* @property {Web3Provider} provider - The provider to connect to the network.
|
|
951
|
+
* @property {TransactionRequest} transaction - The transaction to send.
|
|
952
|
+
*/
|
|
953
|
+
interface SendTransactionParams {
|
|
954
|
+
provider: Web3Provider;
|
|
955
|
+
transaction: TransactionRequest;
|
|
956
|
+
}
|
|
957
|
+
/**
|
|
958
|
+
* Interface representing the result of {@link Checkout.sendTransaction}.
|
|
959
|
+
* @property {TransactionResponse} transactionResponse - The response of the transaction.
|
|
960
|
+
*/
|
|
961
|
+
interface SendTransactionResult {
|
|
962
|
+
transactionResponse: TransactionResponse;
|
|
963
|
+
}
|
|
964
|
+
/**
|
|
965
|
+
* Enum representing the names of different wallet providers.
|
|
966
|
+
*/
|
|
967
|
+
declare enum WalletProviderName {
|
|
968
|
+
METAMASK = "metamask"
|
|
969
|
+
}
|
|
970
|
+
/**
|
|
971
|
+
* Interface for the parameters required to create a wallet provider {@link Checkout.createProvider}.
|
|
972
|
+
* @interface CreateProviderParams
|
|
973
|
+
* @property {WalletProviderName} walletProvider - The name of the wallet provider.
|
|
974
|
+
*/
|
|
975
|
+
interface CreateProviderParams {
|
|
976
|
+
walletProvider: WalletProviderName;
|
|
977
|
+
}
|
|
978
|
+
/**
|
|
979
|
+
* Represents the result of creating a Web3 provider {@link Checkout.createProvider}.
|
|
980
|
+
* @property {Web3Provider} provider - The created Web3 provider.
|
|
981
|
+
* @property {WalletProviderName} providerName - The name of the wallet provider.
|
|
982
|
+
*/
|
|
983
|
+
type CreateProviderResult = {
|
|
984
|
+
provider: Web3Provider;
|
|
985
|
+
walletProviderName: WalletProviderName;
|
|
986
|
+
};
|
|
987
|
+
/**
|
|
988
|
+
* Interface representing a wallet filter to be used in {@link GetWalletAllowListParams}.
|
|
989
|
+
* @property {WalletProviderName} connectionProvider - The connection provider to filter wallets by.
|
|
990
|
+
*/
|
|
991
|
+
interface WalletFilter {
|
|
992
|
+
walletProvider: WalletProviderName;
|
|
993
|
+
}
|
|
994
|
+
/**
|
|
995
|
+
* Interface representing the parameters for {@link Checkout.getWalletAllowList}.
|
|
996
|
+
* @property {WalletFilterTypes} type - The type of wallets to filter by.
|
|
997
|
+
* @property {WalletFilter[]} [exclude] - An optional list of wallet filters to exclude from the allowed wallets list.
|
|
998
|
+
*/
|
|
999
|
+
interface GetWalletAllowListParams {
|
|
1000
|
+
type: WalletFilterTypes;
|
|
1001
|
+
exclude?: WalletFilter[];
|
|
1002
|
+
}
|
|
1003
|
+
/**
|
|
1004
|
+
* Interface representing information about a wallet used in {@link GetWalletAllowListResult}.
|
|
1005
|
+
* @property {WalletProviderName} walletProvider - The connection provider for the wallet.
|
|
1006
|
+
* @property {string} name - The name of the wallet.
|
|
1007
|
+
* @property {string | undefined} description - A description of the wallet.
|
|
1008
|
+
* @property {string | undefined} icon - The URL/data:image of an icon for the wallet.
|
|
1009
|
+
*/
|
|
1010
|
+
interface WalletInfo {
|
|
1011
|
+
walletProvider: WalletProviderName;
|
|
1012
|
+
name: string;
|
|
1013
|
+
description?: string;
|
|
1014
|
+
icon?: string;
|
|
1015
|
+
}
|
|
1016
|
+
/**
|
|
1017
|
+
* Interface representing the result of {@link Checkout.getWalletAllowList}.
|
|
1018
|
+
* @property {WalletInfo[]} wallets - A list of {@link WalletInfo} objects representing the allowed wallets.
|
|
1019
|
+
*/
|
|
1020
|
+
interface GetWalletAllowListResult {
|
|
1021
|
+
wallets: WalletInfo[];
|
|
1022
|
+
}
|
|
1023
|
+
/**
|
|
1024
|
+
* Enum representing the platform filters used in {@link GetWalletAllowListParams}.
|
|
1025
|
+
*/
|
|
1026
|
+
declare enum WalletFilterTypes {
|
|
1027
|
+
ALL = "all"
|
|
1028
|
+
}
|
|
1029
|
+
/**
|
|
1030
|
+
* Base URL for the checkout API based on the environment.
|
|
1031
|
+
* @property {string} DEVELOPMENT - The base URL for the development environment.
|
|
1032
|
+
* @property {string} SANDBOX - The base URL for the sandbox environment.
|
|
1033
|
+
* @property {string} PRODUCTION - The base URL for the production environment.
|
|
1034
|
+
*/
|
|
1035
|
+
declare const CHECKOUT_API_BASE_URL: {
|
|
1036
|
+
[x: string]: string;
|
|
1037
|
+
sandbox: string;
|
|
1038
|
+
production: string;
|
|
1039
|
+
};
|
|
1040
|
+
type NetworkDetails = {
|
|
1041
|
+
chainIdHex: string;
|
|
1042
|
+
chainName: string;
|
|
1043
|
+
rpcUrls: string[];
|
|
1044
|
+
nativeCurrency: TokenInfo;
|
|
1045
|
+
blockExplorerUrls?: string[];
|
|
1046
|
+
};
|
|
1047
|
+
type NetworkMap = Map<ChainId, NetworkDetails>;
|
|
1048
|
+
/**
|
|
1049
|
+
* Enum representing different types of errors that can occur during the checkout process.
|
|
1050
|
+
*/
|
|
1051
|
+
declare enum CheckoutErrorType {
|
|
1052
|
+
WEB3_PROVIDER_ERROR = "WEB3_PROVIDER_ERROR",
|
|
1053
|
+
PROVIDER_ERROR = "PROVIDER_ERROR",
|
|
1054
|
+
DEFAULT_PROVIDER_ERROR = "DEFAULT_PROVIDER_ERROR",
|
|
1055
|
+
CONNECT_PROVIDER_ERROR = "CONNECT_PROVIDER_ERROR",
|
|
1056
|
+
GET_BALANCE_ERROR = "GET_BALANCE_ERROR",
|
|
1057
|
+
GET_ERC20_BALANCE_ERROR = "GET_ERC20_BALANCE_ERROR",
|
|
1058
|
+
GET_NETWORK_INFO_ERROR = "GET_NETWORK_INFO_ERROR",
|
|
1059
|
+
METAMASK_PROVIDER_ERROR = "METAMASK_PROVIDER_ERROR",
|
|
1060
|
+
CHAIN_NOT_SUPPORTED_ERROR = "CHAIN_NOT_SUPPORTED_ERROR",
|
|
1061
|
+
PROVIDER_REQUEST_MISSING_ERROR = "PROVIDER_REQUEST_MISSING_ERROR",
|
|
1062
|
+
PROVIDER_REQUEST_FAILED_ERROR = "PROVIDER_REQUEST_FAILED_ERROR",
|
|
1063
|
+
USER_REJECTED_REQUEST_ERROR = "USER_REJECTED_REQUEST_ERROR",
|
|
1064
|
+
TRANSACTION_FAILED = "TRANSACTION_FAILED",
|
|
1065
|
+
INSUFFICIENT_FUNDS = "INSUFFICIENT_FUNDS",
|
|
1066
|
+
UNPREDICTABLE_GAS_LIMIT = "UNPREDICTABLE_GAS_LIMIT",
|
|
1067
|
+
INVALID_GAS_ESTIMATE_TYPE = "INVALID_GAS_ESTIMATE_TYPE"
|
|
1068
|
+
}
|
|
1069
|
+
/**
|
|
1070
|
+
* Represents an error object with a specific type, optional message, and optional data.
|
|
1071
|
+
* @property {CheckoutErrorType} type - The type of the error.
|
|
1072
|
+
* @property {string | undefined} [message] - The error message.
|
|
1073
|
+
* @property {Object.<string, string> | undefined} [data] - Additional data associated with the error.
|
|
1074
|
+
*/
|
|
1075
|
+
type ErrorType = {
|
|
1076
|
+
type: CheckoutErrorType;
|
|
1077
|
+
message?: string;
|
|
1078
|
+
data?: {
|
|
1079
|
+
[key: string]: string;
|
|
1080
|
+
};
|
|
1081
|
+
};
|
|
1082
|
+
type RemoteConfigParams = {
|
|
1083
|
+
isDevelopment: boolean;
|
|
1084
|
+
isProduction: boolean;
|
|
1085
|
+
};
|
|
1086
|
+
declare class RemoteConfigFetcher {
|
|
1087
|
+
constructor(params: RemoteConfigParams);
|
|
1088
|
+
getConfig(key?: keyof RemoteConfiguration): Promise<RemoteConfiguration | RemoteConfiguration[keyof RemoteConfiguration] | undefined>;
|
|
1089
|
+
getTokens(chainId: ChainId): Promise<TokenInfo[]>;
|
|
1090
|
+
}
|
|
1091
|
+
declare class CheckoutConfiguration {
|
|
1092
|
+
readonly isDevelopment: boolean;
|
|
1093
|
+
readonly isLocal: boolean;
|
|
1094
|
+
readonly isProduction: boolean;
|
|
1095
|
+
readonly remote: RemoteConfigFetcher;
|
|
1096
|
+
readonly environment: Environment;
|
|
1097
|
+
readonly networkMap: NetworkMap;
|
|
1098
|
+
constructor(config: CheckoutModuleConfiguration);
|
|
1099
|
+
}
|
|
1100
|
+
declare class Checkout {
|
|
1101
|
+
readonly config: CheckoutConfiguration;
|
|
1102
|
+
/**
|
|
1103
|
+
* Constructs a new instance of the CheckoutModule class.
|
|
1104
|
+
* @param {CheckoutModuleConfiguration} [config=SANDBOX_CONFIGURATION] - The configuration object for the CheckoutModule.
|
|
1105
|
+
*/
|
|
1106
|
+
constructor(config?: CheckoutModuleConfiguration);
|
|
1107
|
+
/**
|
|
1108
|
+
* Creates a provider using the given parameters.
|
|
1109
|
+
* @param {CreateProviderParams} params - The parameters for creating the provider.
|
|
1110
|
+
* @returns {Promise<CreateProviderResult>} A promise that resolves to the created provider.
|
|
1111
|
+
*/
|
|
1112
|
+
createProvider(params: CreateProviderParams): Promise<CreateProviderResult>;
|
|
1113
|
+
/**
|
|
1114
|
+
* Checks if a wallet is connected to the specified provider.
|
|
1115
|
+
* @param {CheckConnectionParams} params - The parameters for checking the wallet connection.
|
|
1116
|
+
* @returns {Promise<CheckConnectionResult>} - A promise that resolves to the result of the check.
|
|
1117
|
+
*/
|
|
1118
|
+
checkIsWalletConnected(params: CheckConnectionParams): Promise<CheckConnectionResult>;
|
|
1119
|
+
/**
|
|
1120
|
+
* Connects to a blockchain network using the specified provider.
|
|
1121
|
+
* @param {ConnectParams} params - The parameters for connecting to the network.
|
|
1122
|
+
* @returns {Promise<ConnectResult>} A promise that resolves to an object containing the provider and network information.
|
|
1123
|
+
* @throws {Error} If the provider is not valid or if there is an error connecting to the network.
|
|
1124
|
+
*/
|
|
1125
|
+
connect(params: ConnectParams): Promise<ConnectResult>;
|
|
1126
|
+
/**
|
|
1127
|
+
* Switches the network for the current wallet provider.
|
|
1128
|
+
* @param {SwitchNetworkParams} params - The parameters for switching the network.
|
|
1129
|
+
* @returns {Promise<SwitchNetworkResult>} - A promise that resolves to the result of switching the network.
|
|
1130
|
+
*/
|
|
1131
|
+
switchNetwork(params: SwitchNetworkParams): Promise<SwitchNetworkResult>;
|
|
1132
|
+
/**
|
|
1133
|
+
* Retrieves the balance of a wallet address.
|
|
1134
|
+
* @param {GetBalanceParams} params - The parameters for retrieving the balance.
|
|
1135
|
+
* @returns {Promise<GetBalanceResult>} - A promise that resolves to the balance result.
|
|
1136
|
+
*/
|
|
1137
|
+
getBalance(params: GetBalanceParams): Promise<GetBalanceResult>;
|
|
1138
|
+
/**
|
|
1139
|
+
* Retrieves the balances of all tokens for a given wallet address on a specific chain.
|
|
1140
|
+
* @param {GetAllBalancesParams} params - The parameters for retrieving the balances.
|
|
1141
|
+
* @returns {Promise<GetAllBalancesResult>} - A promise that resolves to the result of retrieving the balances.
|
|
1142
|
+
*/
|
|
1143
|
+
getAllBalances(params: GetAllBalancesParams): Promise<GetAllBalancesResult>;
|
|
1144
|
+
/**
|
|
1145
|
+
* Retrieves the supported networks based on the provided parameters.
|
|
1146
|
+
* @param {GetNetworkAllowListParams} params - The parameters for retrieving the network allow list.
|
|
1147
|
+
* @returns {Promise<GetNetworkAllowListResult>} - A promise that resolves to the network allow list result.
|
|
1148
|
+
*/
|
|
1149
|
+
getNetworkAllowList(params: GetNetworkAllowListParams): Promise<GetNetworkAllowListResult>;
|
|
1150
|
+
/**
|
|
1151
|
+
* Retrieves the supported tokens based on the provided parameters.
|
|
1152
|
+
* @param {GetTokenAllowListParams} params - The parameters for retrieving the token allow list.
|
|
1153
|
+
* @returns {Promise<GetTokenAllowListResult>} - A promise that resolves to the token allow list result.
|
|
1154
|
+
*/
|
|
1155
|
+
getTokenAllowList(params: GetTokenAllowListParams): Promise<GetTokenAllowListResult>;
|
|
1156
|
+
/**
|
|
1157
|
+
* Retrieves the default supported wallets based on the provided parameters.
|
|
1158
|
+
* @param {GetWalletAllowListParams} params - The parameters for retrieving the wallet allow list.
|
|
1159
|
+
* @returns {Promise<GetWalletAllowListResult>} - A promise that resolves to the wallet allow list result.
|
|
1160
|
+
*/
|
|
1161
|
+
getWalletAllowList(params: GetWalletAllowListParams): Promise<GetWalletAllowListResult>;
|
|
1162
|
+
/**
|
|
1163
|
+
* Sends a transaction using the specified provider and transaction parameters.
|
|
1164
|
+
* @param {SendTransactionParams} params - The parameters for sending the transaction.
|
|
1165
|
+
* @returns {Promise<SendTransactionResult>} A promise that resolves to the result of the transaction.
|
|
1166
|
+
*/
|
|
1167
|
+
sendTransaction(params: SendTransactionParams): Promise<SendTransactionResult>;
|
|
1168
|
+
/**
|
|
1169
|
+
* Retrieves network information using the specified provider.
|
|
1170
|
+
* @param {GetNetworkParams} params - The parameters for retrieving network information.
|
|
1171
|
+
* @returns {Promise<NetworkInfo>} A promise that resolves to the network information.
|
|
1172
|
+
*/
|
|
1173
|
+
getNetworkInfo(params: GetNetworkParams): Promise<NetworkInfo>;
|
|
1174
|
+
/**
|
|
1175
|
+
* Checks if the given object is a Web3 provider.
|
|
1176
|
+
* @param {Web3Provider} web3Provider - The object to check.
|
|
1177
|
+
* @returns {boolean} - True if the object is a Web3 provider, false otherwise.
|
|
1178
|
+
*/
|
|
1179
|
+
static isWeb3Provider(web3Provider: Web3Provider): boolean;
|
|
1180
|
+
/**
|
|
1181
|
+
* Estimates the gas required for a swap or bridge transaction.
|
|
1182
|
+
* @param {GasEstimateParams} params - The parameters for the gas estimation.
|
|
1183
|
+
* @returns {Promise<GasEstimateSwapResult | GasEstimateBridgeToL2Result>} - A promise that resolves to the gas estimation result.
|
|
1184
|
+
*/
|
|
1185
|
+
gasEstimate(params: GasEstimateParams): Promise<GasEstimateSwapResult | GasEstimateBridgeToL2Result>;
|
|
1186
|
+
}
|
|
1187
|
+
|
|
1188
|
+
export { AllowedNetworkConfig, CHECKOUT_API_BASE_URL, ChainId, ChainName, CheckConnectionParams, CheckConnectionResult, Checkout, CheckoutErrorType, CheckoutModuleConfiguration, ConnectParams, ConnectResult, DexConfig, ErrorType, GasEstimateBridgeToL2Result, GasEstimateParams, GasEstimateSwapResult, GasEstimateTokenConfig, GasEstimateType, GetAllBalancesParams, GetAllBalancesResult, GetBalanceParams, GetBalanceResult, GetNetworkAllowListParams, GetNetworkAllowListResult, GetNetworkParams, GetTokenAllowListParams, GetTokenAllowListResult, GetWalletAllowListParams, GetWalletAllowListResult, NetworkFilter, NetworkFilterTypes, NetworkInfo, RemoteConfiguration, SendTransactionParams, SendTransactionResult, SwitchNetworkParams, SwitchNetworkResult, TokenFilter, TokenFilterTypes, TokenInfo, WalletFilter, WalletFilterTypes, WalletInfo, WalletProviderName };
|