@imtbl/sdk 0.1.9-alpha.2 → 0.1.9-alpha.4

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,1096 +0,0 @@
1
- import { utils, Contract, ethers, BigNumber as BigNumber$1 } from 'ethers';
2
- import { Web3Provider } from '@ethersproject/providers';
3
- import $7v2Z6$metamaskdetectprovider from '@metamask/detect-provider';
4
- import { BigNumber, utils as utils$1 } from 'ethers/lib/ethers';
5
- import { BridgeConfiguration, ETH_MAINNET_TO_ZKEVM_MAINNET, ETH_SEPOLIA_TO_ZKEVM_DEVNET, TokenBridge } from '@imtbl/bridge-sdk';
6
- import { Exchange, ExchangeConfiguration } from '@imtbl/dex-sdk';
7
- import $7v2Z6$axios from 'axios';
8
-
9
- var Environment;
10
- (function (Environment) {
11
- Environment["PRODUCTION"] = "production";
12
- Environment["SANDBOX"] = "sandbox";
13
- })(Environment || (Environment = {}));
14
- class ImmutableConfiguration {
15
- environment;
16
- apiKey;
17
- constructor(options) {
18
- this.environment = options.environment;
19
- this.apiKey = options.apiKey;
20
- }
21
- }
22
-
23
- function $parcel$interopDefault(a) {
24
- return a && a.__esModule ? a.default : a;
25
- }
26
- /* eslint-disable class-methods-use-this */
27
- const $762782b6c862d954$export$db5daa1b5156ccfe = [
28
- {
29
- constant: true,
30
- inputs: [],
31
- name: "name",
32
- outputs: [
33
- {
34
- name: "",
35
- type: "string"
36
- }
37
- ],
38
- payable: false,
39
- type: "function"
40
- },
41
- {
42
- constant: true,
43
- inputs: [],
44
- name: "decimals",
45
- outputs: [
46
- {
47
- name: "",
48
- type: "uint8"
49
- }
50
- ],
51
- payable: false,
52
- type: "function"
53
- },
54
- {
55
- constant: true,
56
- inputs: [
57
- {
58
- name: "_owner",
59
- type: "address"
60
- }
61
- ],
62
- name: "balanceOf",
63
- outputs: [
64
- {
65
- name: "balance",
66
- type: "uint256"
67
- }
68
- ],
69
- payable: false,
70
- type: "function"
71
- },
72
- {
73
- constant: true,
74
- inputs: [],
75
- name: "symbol",
76
- outputs: [
77
- {
78
- name: "",
79
- type: "string"
80
- }
81
- ],
82
- payable: false,
83
- type: "function"
84
- }
85
- ];
86
-
87
-
88
- /**
89
- * Enum representing the supported chains with their corresponding IDs.
90
- */ var $baec09ddc3013323$export$c06e1e7429de6283;
91
- (function(ChainId) {
92
- ChainId[ChainId["ETHEREUM"] = 1] = "ETHEREUM";
93
- ChainId[ChainId["IMTBL_ZKEVM_TESTNET"] = 13372] = "IMTBL_ZKEVM_TESTNET";
94
- ChainId[ChainId["SEPOLIA"] = 11155111] = "SEPOLIA";
95
- ChainId[ChainId["IMTBL_ZKEVM_DEVNET"] = 13383] = "IMTBL_ZKEVM_DEVNET";
96
- })($baec09ddc3013323$export$c06e1e7429de6283 || ($baec09ddc3013323$export$c06e1e7429de6283 = {}));
97
-
98
-
99
-
100
- const $bc2bfebf768286d3$export$6a2ba3c3bd042990 = {
101
- baseConfig: {
102
- environment: (Environment).SANDBOX
103
- }
104
- };
105
-
106
-
107
-
108
-
109
- var $de275b98d2b651c3$export$788b1fd17f3dad84;
110
- (function(GasEstimateType) {
111
- GasEstimateType["BRIDGE_TO_L2"] = "BRIDGE_TO_L2";
112
- GasEstimateType["SWAP"] = "SWAP";
113
- })($de275b98d2b651c3$export$788b1fd17f3dad84 || ($de275b98d2b651c3$export$788b1fd17f3dad84 = {}));
114
-
115
-
116
-
117
-
118
-
119
-
120
- const $d85ad1457a3f1a83$export$161d4a74df65fc08 = {
121
- [(Environment).SANDBOX]: "https://checkout-api.dev.immutable.com",
122
- [(Environment).PRODUCTION]: "https://checkout-api.sandbox.immutable.com"
123
- };
124
- const $d85ad1457a3f1a83$export$720c0def10d6df2d = {
125
- [($baec09ddc3013323$export$c06e1e7429de6283).ETHEREUM]: "/v1/rpc/eth-mainnet",
126
- [($baec09ddc3013323$export$c06e1e7429de6283).SEPOLIA]: "/v1/rpc/eth-sepolia"
127
- };
128
-
129
-
130
- const $a47e48dd2c04791b$export$345c852d0dc8f1df = new Map([
131
- [
132
- ($baec09ddc3013323$export$c06e1e7429de6283).ETHEREUM,
133
- `${($d85ad1457a3f1a83$export$161d4a74df65fc08)[(Environment).PRODUCTION]}${($d85ad1457a3f1a83$export$720c0def10d6df2d)[($baec09ddc3013323$export$c06e1e7429de6283).ETHEREUM]}`
134
- ],
135
- [
136
- ($baec09ddc3013323$export$c06e1e7429de6283).IMTBL_ZKEVM_TESTNET,
137
- "https://zkevm-rpc.sandbox.x.immutable.com"
138
- ],
139
- [
140
- ($baec09ddc3013323$export$c06e1e7429de6283).SEPOLIA,
141
- `${($d85ad1457a3f1a83$export$161d4a74df65fc08)[(Environment).PRODUCTION]}${($d85ad1457a3f1a83$export$720c0def10d6df2d)[($baec09ddc3013323$export$c06e1e7429de6283).SEPOLIA]}`
142
- ],
143
- [
144
- ($baec09ddc3013323$export$c06e1e7429de6283).IMTBL_ZKEVM_DEVNET,
145
- "https://zkevm-rpc.dev.x.immutable.com"
146
- ]
147
- ]);
148
- const $a47e48dd2c04791b$export$6f24f3cef7d501c4 = new Map([
149
- [
150
- ($baec09ddc3013323$export$c06e1e7429de6283).ETHEREUM,
151
- {
152
- chainIdHex: "0x1",
153
- chainName: "Ethereum",
154
- rpcUrls: [
155
- $a47e48dd2c04791b$export$345c852d0dc8f1df.get(($baec09ddc3013323$export$c06e1e7429de6283).ETHEREUM)
156
- ],
157
- nativeCurrency: {
158
- name: "Ethereum",
159
- symbol: "ETH",
160
- decimals: 18
161
- },
162
- blockExplorerUrls: [
163
- "https://etherscan.io/"
164
- ]
165
- }
166
- ],
167
- [
168
- ($baec09ddc3013323$export$c06e1e7429de6283).IMTBL_ZKEVM_TESTNET,
169
- {
170
- chainIdHex: "0x343C",
171
- chainName: "Immutable zkEVM Testnet",
172
- rpcUrls: [
173
- $a47e48dd2c04791b$export$345c852d0dc8f1df.get(($baec09ddc3013323$export$c06e1e7429de6283).IMTBL_ZKEVM_TESTNET)
174
- ],
175
- nativeCurrency: {
176
- name: "IMX",
177
- symbol: "IMX",
178
- decimals: 18
179
- }
180
- }
181
- ]
182
- ]);
183
- const $a47e48dd2c04791b$export$3e81fc0987227f10 = new Map([
184
- [
185
- ($baec09ddc3013323$export$c06e1e7429de6283).SEPOLIA,
186
- {
187
- chainIdHex: "0xaa36a7",
188
- chainName: "Sepolia",
189
- rpcUrls: [
190
- $a47e48dd2c04791b$export$345c852d0dc8f1df.get(($baec09ddc3013323$export$c06e1e7429de6283).SEPOLIA)
191
- ],
192
- nativeCurrency: {
193
- name: "Sep Eth",
194
- symbol: "ETH",
195
- decimals: 18
196
- },
197
- blockExplorerUrls: [
198
- "https://sepolia.etherscan.io/"
199
- ]
200
- }
201
- ],
202
- [
203
- ($baec09ddc3013323$export$c06e1e7429de6283).IMTBL_ZKEVM_DEVNET,
204
- {
205
- chainIdHex: "0x3447",
206
- chainName: "Immutable zkEVM Devnet",
207
- rpcUrls: [
208
- $a47e48dd2c04791b$export$345c852d0dc8f1df.get(($baec09ddc3013323$export$c06e1e7429de6283).IMTBL_ZKEVM_DEVNET)
209
- ],
210
- nativeCurrency: {
211
- name: "IMX",
212
- symbol: "IMX",
213
- decimals: 18
214
- }
215
- }
216
- ]
217
- ]);
218
- var $a47e48dd2c04791b$export$1f05a55fe0680cc7;
219
- (function(NetworkFilterTypes) {
220
- NetworkFilterTypes["ALL"] = "all";
221
- })($a47e48dd2c04791b$export$1f05a55fe0680cc7 || ($a47e48dd2c04791b$export$1f05a55fe0680cc7 = {}));
222
-
223
-
224
-
225
-
226
- var $08d5ddc39acd6833$export$fd9b17d87f4121d2;
227
- (function(TokenFilterTypes) {
228
- TokenFilterTypes["SWAP"] = "swap";
229
- TokenFilterTypes["BRIDGE"] = "bridge";
230
- TokenFilterTypes["ALL"] = "all";
231
- })($08d5ddc39acd6833$export$fd9b17d87f4121d2 || ($08d5ddc39acd6833$export$fd9b17d87f4121d2 = {}));
232
-
233
-
234
- /**
235
- * Interface representing token information.
236
- * @property {string} name - The token name.
237
- * @property {string} symbol - The token symbol.
238
- * @property {number} decimals - The token decimals.
239
- * @property {string} [address] - The token contract address.
240
- * @property {string} [icon] - The token icon URL/data:image.
241
- */
242
-
243
-
244
-
245
- var $4f91c5f280efe242$export$35b06f0d33f57e26;
246
- (function(WalletAction) {
247
- WalletAction["CHECK_CONNECTION"] = "eth_accounts";
248
- WalletAction["CONNECT"] = "eth_requestAccounts";
249
- WalletAction["ADD_NETWORK"] = "wallet_addEthereumChain";
250
- WalletAction["SWITCH_NETWORK"] = "wallet_switchEthereumChain";
251
- WalletAction["GET_CHAINID"] = "eth_chainId";
252
- })($4f91c5f280efe242$export$35b06f0d33f57e26 || ($4f91c5f280efe242$export$35b06f0d33f57e26 = {}));
253
- var $4f91c5f280efe242$export$a75605c67ea83a5a;
254
- (function(WalletFilterTypes) {
255
- WalletFilterTypes["ALL"] = "all";
256
- WalletFilterTypes["DESKTOP"] = "desktop";
257
- WalletFilterTypes["MOBILE"] = "mobile";
258
- })($4f91c5f280efe242$export$a75605c67ea83a5a || ($4f91c5f280efe242$export$a75605c67ea83a5a = {}));
259
-
260
-
261
- var $e768639828688ca3$export$2d7a51a18d87e21d;
262
- (function(WalletProviderName) {
263
- WalletProviderName["METAMASK"] = "metamask";
264
- })($e768639828688ca3$export$2d7a51a18d87e21d || ($e768639828688ca3$export$2d7a51a18d87e21d = {}));
265
- const $e768639828688ca3$export$44dde05038008549 = {
266
- allowMistmatchedChainId: false,
267
- allowUnsupportedProvider: false
268
- };
269
-
270
-
271
-
272
-
273
-
274
- /**
275
- * The different types of errors that can be returned by the checkout process.
276
- */ var $a8bc256d81a5e2c1$export$e3dc0620abde7f5a;
277
- (function(CheckoutErrorType) {
278
- CheckoutErrorType["WEB3_PROVIDER_ERROR"] = "WEB3_PROVIDER_ERROR";
279
- CheckoutErrorType["PROVIDER_ERROR"] = "PROVIDER_ERROR";
280
- CheckoutErrorType["DEFAULT_PROVIDER_ERROR"] = "DEFAULT_PROVIDER_ERROR";
281
- CheckoutErrorType["CONNECT_PROVIDER_ERROR"] = "CONNECT_PROVIDER_ERROR";
282
- CheckoutErrorType["GET_BALANCE_ERROR"] = "GET_BALANCE_ERROR";
283
- CheckoutErrorType["GET_ERC20_BALANCE_ERROR"] = "GET_ERC20_BALANCE_ERROR";
284
- CheckoutErrorType["GET_NETWORK_INFO_ERROR"] = "GET_NETWORK_INFO_ERROR";
285
- CheckoutErrorType["METAMASK_PROVIDER_ERROR"] = "METAMASK_PROVIDER_ERROR";
286
- CheckoutErrorType["CHAIN_NOT_SUPPORTED_ERROR"] = "CHAIN_NOT_SUPPORTED_ERROR";
287
- CheckoutErrorType["PROVIDER_REQUEST_MISSING_ERROR"] = "PROVIDER_REQUEST_MISSING_ERROR";
288
- CheckoutErrorType["PROVIDER_REQUEST_FAILED_ERROR"] = "PROVIDER_REQUEST_FAILED_ERROR";
289
- CheckoutErrorType["USER_REJECTED_REQUEST_ERROR"] = "USER_REJECTED_REQUEST_ERROR";
290
- CheckoutErrorType["TRANSACTION_FAILED"] = "TRANSACTION_FAILED";
291
- CheckoutErrorType["INSUFFICIENT_FUNDS"] = "INSUFFICIENT_FUNDS";
292
- CheckoutErrorType["UNPREDICTABLE_GAS_LIMIT"] = "UNPREDICTABLE_GAS_LIMIT";
293
- CheckoutErrorType["INVALID_GAS_ESTIMATE_TYPE"] = "INVALID_GAS_ESTIMATE_TYPE";
294
- })($a8bc256d81a5e2c1$export$e3dc0620abde7f5a || ($a8bc256d81a5e2c1$export$e3dc0620abde7f5a = {}));
295
- class $a8bc256d81a5e2c1$export$b722478a3cbfa3bc extends Error {
296
- message;
297
- type;
298
- data;
299
- constructor(message, type, data){
300
- super(message);
301
- this.message = message;
302
- this.type = type;
303
- this.data = data;
304
- }
305
- }
306
- var $a8bc256d81a5e2c1$export$a22d4e0719ee6def;
307
- (function(CheckoutInternalErrorType) {
308
- CheckoutInternalErrorType["REJECTED_SWITCH_AFTER_ADDING_NETWORK"] = "REJECTED_SWITCH_AFTER_ADDING_NETWORK";
309
- })($a8bc256d81a5e2c1$export$a22d4e0719ee6def || ($a8bc256d81a5e2c1$export$a22d4e0719ee6def = {}));
310
- const $a8bc256d81a5e2c1$export$bacc563de539c6c3 = async (fn, customError)=>{
311
- try {
312
- return await fn();
313
- } catch (error) {
314
- const cause = `${error.message}` || "UnknownError";
315
- const errorMessage = customError.message ? `[${customError.type}]:${customError.message}. Cause:${cause}` : `[${customError.type}] Cause:${cause}`;
316
- if (error instanceof $a8bc256d81a5e2c1$export$b722478a3cbfa3bc) throw new $a8bc256d81a5e2c1$export$b722478a3cbfa3bc(errorMessage, customError.type, {
317
- ...customError.data,
318
- innerErrorType: error.type,
319
- ...error.data
320
- });
321
- throw new $a8bc256d81a5e2c1$export$b722478a3cbfa3bc(errorMessage, customError.type, {
322
- ...customError.data
323
- });
324
- }
325
- };
326
-
327
-
328
-
329
-
330
- /* eslint-disable @typescript-eslint/no-explicit-any */
331
-
332
-
333
- // this function needs to be in a separate file to prevent circular dependencies with ./network
334
-
335
-
336
- async function $a1555a1d2c8d059b$export$c3ba3e93a9fee972(web3Provider) {
337
- if (!web3Provider.provider.request) throw new ($a8bc256d81a5e2c1$export$b722478a3cbfa3bc)("Parsed provider is not a valid Web3Provider", ($a8bc256d81a5e2c1$export$e3dc0620abde7f5a).WEB3_PROVIDER_ERROR);
338
- const chainId = await web3Provider.provider.request({
339
- method: ($4f91c5f280efe242$export$35b06f0d33f57e26).GET_CHAINID,
340
- params: []
341
- });
342
- return parseInt(chainId, 16);
343
- }
344
-
345
-
346
- const $de192de6ef100f9f$var$UNRECOGNISED_CHAIN_ERROR_CODE = 4902; // error code (MetaMask)
347
- // these functions should not be exported. These functions should be used as part of an exported function e.g switchWalletNetwork() above.
348
- // make sure to check if(provider.provider?.request) in the exported function and throw an error
349
- // eslint-disable-next-line consistent-return
350
- async function $de192de6ef100f9f$var$switchNetworkInWallet(networkMap, web3Provider, chainId) {
351
- if (web3Provider.provider?.request) return await web3Provider.provider.request({
352
- method: ($4f91c5f280efe242$export$35b06f0d33f57e26).SWITCH_NETWORK,
353
- params: [
354
- {
355
- chainId: networkMap.get(chainId)?.chainIdHex
356
- }
357
- ]
358
- });
359
- }
360
- // TODO: Should these functions always return something?
361
- // eslint-disable-next-line consistent-return
362
- async function $de192de6ef100f9f$var$addNetworkToWallet(networkMap, web3Provider, chainId) {
363
- if (web3Provider.provider?.request) {
364
- const networkDetails = networkMap.get(chainId);
365
- const addNetwork = {
366
- chainId: networkDetails?.chainIdHex,
367
- chainName: networkDetails?.chainName,
368
- rpcUrls: networkDetails?.rpcUrls,
369
- nativeCurrency: networkDetails?.nativeCurrency,
370
- blockExplorerUrls: networkDetails?.blockExplorerUrls
371
- };
372
- return await web3Provider.provider.request({
373
- method: ($4f91c5f280efe242$export$35b06f0d33f57e26).ADD_NETWORK,
374
- params: [
375
- addNetwork
376
- ]
377
- });
378
- }
379
- }
380
- async function $de192de6ef100f9f$export$3043f6442a9ef563(config, { type: type = ($a47e48dd2c04791b$export$1f05a55fe0680cc7).ALL , exclude: exclude }) {
381
- const { networkMap: networkMap } = config;
382
- const allowedNetworkConfig = await config.remoteConfigFetcher.get("allowedNetworks");
383
- const list = allowedNetworkConfig.filter((network)=>{
384
- const allowAllTokens = type === ($a47e48dd2c04791b$export$1f05a55fe0680cc7).ALL;
385
- const networkNotExcluded = !(exclude || []).map((exc)=>exc.chainId).includes(network.chainId);
386
- return allowAllTokens && networkNotExcluded;
387
- });
388
- const allowedNetworks = [];
389
- list.forEach((element)=>{
390
- const newNetwork = networkMap.get(element.chainId);
391
- if (newNetwork) allowedNetworks.push({
392
- name: newNetwork.chainName,
393
- chainId: parseInt(newNetwork.chainIdHex, 16),
394
- nativeCurrency: newNetwork.nativeCurrency,
395
- isSupported: true
396
- });
397
- });
398
- return {
399
- networks: allowedNetworks
400
- };
401
- }
402
- async function $de192de6ef100f9f$export$79f13b4cfaaf0d09(config, web3Provider) {
403
- const { networkMap: networkMap } = config;
404
- return ($a8bc256d81a5e2c1$export$bacc563de539c6c3)(async ()=>{
405
- try {
406
- const network = await web3Provider.getNetwork();
407
- if (Array.from(networkMap.keys()).includes(network.chainId)) {
408
- const chainIdNetworkInfo = networkMap.get(network.chainId);
409
- return {
410
- name: chainIdNetworkInfo.chainName,
411
- chainId: parseInt(chainIdNetworkInfo.chainIdHex, 16),
412
- nativeCurrency: chainIdNetworkInfo.nativeCurrency,
413
- isSupported: true
414
- };
415
- }
416
- return {
417
- chainId: network.chainId,
418
- name: network.name,
419
- isSupported: false
420
- };
421
- } catch (err) {
422
- const chainId = await ($a1555a1d2c8d059b$export$c3ba3e93a9fee972)(web3Provider);
423
- const isSupported = Array.from(networkMap.keys()).includes(chainId);
424
- return {
425
- chainId: chainId,
426
- isSupported: isSupported
427
- };
428
- }
429
- }, {
430
- type: ($a8bc256d81a5e2c1$export$e3dc0620abde7f5a).GET_NETWORK_INFO_ERROR
431
- });
432
- }
433
- async function $de192de6ef100f9f$export$b827d9418aeb5dbd(config, web3Provider, chainId) {
434
- const { networkMap: networkMap } = config;
435
- const allowedNetworks = await $de192de6ef100f9f$export$3043f6442a9ef563(config, {
436
- type: ($a47e48dd2c04791b$export$1f05a55fe0680cc7).ALL
437
- });
438
- if (!allowedNetworks.networks.some((network)=>network.chainId === chainId)) throw new ($a8bc256d81a5e2c1$export$b722478a3cbfa3bc)(`Chain:${chainId} is not a supported chain`, ($a8bc256d81a5e2c1$export$e3dc0620abde7f5a).CHAIN_NOT_SUPPORTED_ERROR);
439
- // WT-1146 - Refer to the README in this folder for explantion on the switch network flow
440
- try {
441
- await $de192de6ef100f9f$var$switchNetworkInWallet(networkMap, web3Provider, chainId);
442
- } catch (err) {
443
- if (err.code === $de192de6ef100f9f$var$UNRECOGNISED_CHAIN_ERROR_CODE) try {
444
- await $de192de6ef100f9f$var$addNetworkToWallet(networkMap, web3Provider, chainId);
445
- // eslint-disable-next-line @typescript-eslint/no-shadow
446
- } catch (err) {
447
- throw new ($a8bc256d81a5e2c1$export$b722478a3cbfa3bc)("User cancelled add network request", ($a8bc256d81a5e2c1$export$e3dc0620abde7f5a).USER_REJECTED_REQUEST_ERROR);
448
- }
449
- else throw new ($a8bc256d81a5e2c1$export$b722478a3cbfa3bc)("User cancelled switch network request", ($a8bc256d81a5e2c1$export$e3dc0620abde7f5a).USER_REJECTED_REQUEST_ERROR);
450
- }
451
- const newProvider = new (Web3Provider)(web3Provider.provider);
452
- const newProviderNetwork = await newProvider.getNetwork();
453
- if (newProviderNetwork.chainId !== chainId) throw new ($a8bc256d81a5e2c1$export$b722478a3cbfa3bc)("User cancelled switch network request", ($a8bc256d81a5e2c1$export$e3dc0620abde7f5a).USER_REJECTED_REQUEST_ERROR);
454
- const networkInfo = await $de192de6ef100f9f$export$79f13b4cfaaf0d09(config, newProvider);
455
- return {
456
- network: networkInfo,
457
- provider: newProvider
458
- };
459
- }
460
-
461
-
462
-
463
-
464
-
465
- var $cda6003506e4182e$exports = {};
466
- $cda6003506e4182e$exports = JSON.parse("[{\"chainId\":13383,\"name\":\"IMX\",\"symbol\":\"IMX\",\"decimals\":18,\"icon\":\"data:image/svg+xml,%3C%3Fxml version='1.0' encoding='utf-8'%3F%3E%3Csvg version='1.1' id='Layer_1' xmlns='http://www.w3.org/2000/svg' xmlns:xlink='http://www.w3.org/1999/xlink' x='0px' y='0px' viewBox='0 0 139 113' style='enable-background:new 0 0 139 113;' xml:space='preserve'%3E%3Cstyle type='text/css'%3E .st0%7Bclip-path:url(%23SVGID_00000053504646934646330740000009134454895836103350_);%7D .st1%7Bfill:%2317B5CB;%7D%0A%3C/style%3E%3Cg%3E%3Cdefs%3E%3Crect id='SVGID_1_' width='139' height='113'/%3E%3C/defs%3E%3CclipPath id='SVGID_00000035518931339590433170000002358037249938198420_'%3E%3Cuse xlink:href='%23SVGID_1_' style='overflow:visible;'/%3E%3C/clipPath%3E%3Cg style='clip-path:url(%23SVGID_00000035518931339590433170000002358037249938198420_);'%3E%3Cpath class='st1' d='M124.1,0h14.6L79.5,67.6c-1.5,1.7-1.6,4.3-0.1,6.1l34.1,39.7H98.3L66.8,76.6l-1.6-2c-1.5-1.7-1.4-4.4,0.1-6.1 L124.1,0z'/%3E%3Cpath class='st1' d='M91.2,73.7c-1-1.1-1.3-2.7-1-4.1c0.3-0.8,0.8-1.6,1.4-2.2l3.9-4.3l43.5,50.3h-13.8 C125.2,113.4,99.7,83.6,91.2,73.7z'/%3E%3Cpath class='st1' d='M15.2,113.4H0l46.6-53.9c1.5-1.7,1.5-4.3,0-6L0.4,0H15l46.5,53.9c1.2,1.6,1.4,3.9,0.1,5.4 C49.4,73.4,15.2,113.4,15.2,113.4z'/%3E%3Cpath class='st1' d='M40.6,0h-14l43.1,49.9c0,0,0.1-0.1,4.9-5.8c1.3-1.5,1.6-3.4,0.1-4.9C65.7,30,40.6,0,40.6,0z'/%3E%3Cpath class='st1' d='M82.6,34.8L112.5,0H98.3L82.7,18.2l-4.5,5.3c-1.5,1.7-1.6,4.3-0.1,6.1C79.2,30.9,82.6,34.8,82.6,34.8z'/%3E%3Cpath class='st1' d='M56.6,78.6l-29.9,34.8h14.1l15.6-18.2l4.5-5.3c1.5-1.7,1.6-4.3,0.1-6.1C59.9,82.5,56.6,78.6,56.6,78.6z'/%3E%3C/g%3E%3C/g%3E%3C/svg%3E%0A\",\"tokenFeatures\":[\"swap\",\"bridge\"]},{\"chainId\":13383,\"name\":\"FUN token\",\"address\":\"0xFEa9FF93DC0C6DC73F8Be009Fe7a22Bb9dcE8A2d\",\"symbol\":\"FUN\",\"decimals\":18,\"icon\":\"data:image/svg+xml,%3C%3Fxml version='1.0' encoding='UTF-8'%3F%3E%3C!DOCTYPE svg PUBLIC '-//W3C//DTD SVG 1.1//EN' 'http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd'%3E%3Csvg xmlns='http://www.w3.org/2000/svg' xml:space='preserve' width='100%25' height='100%25' version='1.1' shape-rendering='geometricPrecision' text-rendering='geometricPrecision' image-rendering='optimizeQuality' fill-rule='evenodd' clip-rule='evenodd'%0AviewBox='0 0 784.37 1277.39' xmlns:xlink='http://www.w3.org/1999/xlink' xmlns:xodm='http://www.corel.com/coreldraw/odm/2003'%3E%3Cg id='Layer_x0020_1'%3E%3Cmetadata id='CorelCorpID_0Corel-Layer'/%3E%3Cg id='_1421394342400'%3E%3Cg%3E%3Cpolygon fill='%23343434' fill-rule='nonzero' points='392.07,0 383.5,29.11 383.5,873.74 392.07,882.29 784.13,650.54 '/%3E%3Cpolygon fill='%238C8C8C' fill-rule='nonzero' points='392.07,0 -0,650.54 392.07,882.29 392.07,472.33 '/%3E%3Cpolygon fill='%233C3C3B' fill-rule='nonzero' points='392.07,956.52 387.24,962.41 387.24,1263.28 392.07,1277.38 784.37,724.89 '/%3E%3Cpolygon fill='%238C8C8C' fill-rule='nonzero' points='392.07,1277.38 392.07,956.52 -0,724.89 '/%3E%3Cpolygon fill='%23141414' fill-rule='nonzero' points='392.07,882.29 784.13,650.54 392.07,472.33 '/%3E%3Cpolygon fill='%23393939' fill-rule='nonzero' points='0,650.54 392.07,882.29 392.07,472.33 '/%3E%3C/g%3E%3C/g%3E%3C/g%3E%3C/svg%3E%0A\",\"tokenFeatures\":[\"swap\",\"bridge\"]},{\"chainId\":13383,\"name\":\"USDC\",\"address\":\"0x5893A5c7bc615Dfd36D7383366d00FFFca5f7178\",\"symbol\":\"USDC\",\"decimals\":18,\"icon\":\"data:image/svg+xml,%3C%3Fxml version='1.0' encoding='UTF-8'%3F%3E%3C!DOCTYPE svg PUBLIC '-//W3C//DTD SVG 1.1//EN' 'http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd'%3E%3Csvg xmlns='http://www.w3.org/2000/svg' xml:space='preserve' width='100%25' height='100%25' version='1.1' shape-rendering='geometricPrecision' text-rendering='geometricPrecision' image-rendering='optimizeQuality' fill-rule='evenodd' clip-rule='evenodd'%0AviewBox='0 0 784.37 1277.39' xmlns:xlink='http://www.w3.org/1999/xlink' xmlns:xodm='http://www.corel.com/coreldraw/odm/2003'%3E%3Cg id='Layer_x0020_1'%3E%3Cmetadata id='CorelCorpID_0Corel-Layer'/%3E%3Cg id='_1421394342400'%3E%3Cg%3E%3Cpolygon fill='%23343434' fill-rule='nonzero' points='392.07,0 383.5,29.11 383.5,873.74 392.07,882.29 784.13,650.54 '/%3E%3Cpolygon fill='%238C8C8C' fill-rule='nonzero' points='392.07,0 -0,650.54 392.07,882.29 392.07,472.33 '/%3E%3Cpolygon fill='%233C3C3B' fill-rule='nonzero' points='392.07,956.52 387.24,962.41 387.24,1263.28 392.07,1277.38 784.37,724.89 '/%3E%3Cpolygon fill='%238C8C8C' fill-rule='nonzero' points='392.07,1277.38 392.07,956.52 -0,724.89 '/%3E%3Cpolygon fill='%23141414' fill-rule='nonzero' points='392.07,882.29 784.13,650.54 392.07,472.33 '/%3E%3Cpolygon fill='%23393939' fill-rule='nonzero' points='0,650.54 392.07,882.29 392.07,472.33 '/%3E%3C/g%3E%3C/g%3E%3C/g%3E%3C/svg%3E%0A\",\"tokenFeatures\":[\"swap\",\"bridge\"]},{\"chainId\":13383,\"name\":\"WETH\",\"address\":\"0xD6d9321DCC42377C1fa8cFec665182c463b2392C\",\"symbol\":\"WETH\",\"decimals\":18,\"icon\":\"data:image/svg+xml,%3C%3Fxml version='1.0' encoding='UTF-8'%3F%3E%3C!DOCTYPE svg PUBLIC '-//W3C//DTD SVG 1.1//EN' 'http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd'%3E%3Csvg xmlns='http://www.w3.org/2000/svg' xml:space='preserve' width='100%25' height='100%25' version='1.1' shape-rendering='geometricPrecision' text-rendering='geometricPrecision' image-rendering='optimizeQuality' fill-rule='evenodd' clip-rule='evenodd'%0AviewBox='0 0 784.37 1277.39' xmlns:xlink='http://www.w3.org/1999/xlink' xmlns:xodm='http://www.corel.com/coreldraw/odm/2003'%3E%3Cg id='Layer_x0020_1'%3E%3Cmetadata id='CorelCorpID_0Corel-Layer'/%3E%3Cg id='_1421394342400'%3E%3Cg%3E%3Cpolygon fill='%23343434' fill-rule='nonzero' points='392.07,0 383.5,29.11 383.5,873.74 392.07,882.29 784.13,650.54 '/%3E%3Cpolygon fill='%238C8C8C' fill-rule='nonzero' points='392.07,0 -0,650.54 392.07,882.29 392.07,472.33 '/%3E%3Cpolygon fill='%233C3C3B' fill-rule='nonzero' points='392.07,956.52 387.24,962.41 387.24,1263.28 392.07,1277.38 784.37,724.89 '/%3E%3Cpolygon fill='%238C8C8C' fill-rule='nonzero' points='392.07,1277.38 392.07,956.52 -0,724.89 '/%3E%3Cpolygon fill='%23141414' fill-rule='nonzero' points='392.07,882.29 784.13,650.54 392.07,472.33 '/%3E%3Cpolygon fill='%23393939' fill-rule='nonzero' points='0,650.54 392.07,882.29 392.07,472.33 '/%3E%3C/g%3E%3C/g%3E%3C/g%3E%3C/svg%3E%0A\",\"tokenFeatures\":[\"swap\",\"bridge\"]},{\"chainId\":1,\"name\":\"Ethereum\",\"symbol\":\"ETH\",\"decimals\":18,\"icon\":\"data:image/svg+xml,%3C%3Fxml version='1.0' encoding='UTF-8'%3F%3E%3C!DOCTYPE svg PUBLIC '-//W3C//DTD SVG 1.1//EN' 'http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd'%3E%3Csvg xmlns='http://www.w3.org/2000/svg' xml:space='preserve' width='100%25' height='100%25' version='1.1' shape-rendering='geometricPrecision' text-rendering='geometricPrecision' image-rendering='optimizeQuality' fill-rule='evenodd' clip-rule='evenodd'%0AviewBox='0 0 784.37 1277.39' xmlns:xlink='http://www.w3.org/1999/xlink' xmlns:xodm='http://www.corel.com/coreldraw/odm/2003'%3E%3Cg id='Layer_x0020_1'%3E%3Cmetadata id='CorelCorpID_0Corel-Layer'/%3E%3Cg id='_1421394342400'%3E%3Cg%3E%3Cpolygon fill='%23343434' fill-rule='nonzero' points='392.07,0 383.5,29.11 383.5,873.74 392.07,882.29 784.13,650.54 '/%3E%3Cpolygon fill='%238C8C8C' fill-rule='nonzero' points='392.07,0 -0,650.54 392.07,882.29 392.07,472.33 '/%3E%3Cpolygon fill='%233C3C3B' fill-rule='nonzero' points='392.07,956.52 387.24,962.41 387.24,1263.28 392.07,1277.38 784.37,724.89 '/%3E%3Cpolygon fill='%238C8C8C' fill-rule='nonzero' points='392.07,1277.38 392.07,956.52 -0,724.89 '/%3E%3Cpolygon fill='%23141414' fill-rule='nonzero' points='392.07,882.29 784.13,650.54 392.07,472.33 '/%3E%3Cpolygon fill='%23393939' fill-rule='nonzero' points='0,650.54 392.07,882.29 392.07,472.33 '/%3E%3C/g%3E%3C/g%3E%3C/g%3E%3C/svg%3E%0A\",\"tokenFeatures\":[\"swap\",\"bridge\"]},{\"address\":\"0xF57e7e7C23978C3cAEC3C3548E3D615c346e79fF\",\"chainId\":1,\"name\":\"Immutable X\",\"symbol\":\"IMX\",\"decimals\":18,\"icon\":\"data:image/svg+xml,%3C%3Fxml version='1.0' encoding='utf-8'%3F%3E%3Csvg version='1.1' id='Layer_1' xmlns='http://www.w3.org/2000/svg' xmlns:xlink='http://www.w3.org/1999/xlink' x='0px' y='0px' viewBox='0 0 139 113' style='enable-background:new 0 0 139 113;' xml:space='preserve'%3E%3Cstyle type='text/css'%3E .st0%7Bclip-path:url(%23SVGID_00000053504646934646330740000009134454895836103350_);%7D .st1%7Bfill:%2317B5CB;%7D%0A%3C/style%3E%3Cg%3E%3Cdefs%3E%3Crect id='SVGID_1_' width='139' height='113'/%3E%3C/defs%3E%3CclipPath id='SVGID_00000035518931339590433170000002358037249938198420_'%3E%3Cuse xlink:href='%23SVGID_1_' style='overflow:visible;'/%3E%3C/clipPath%3E%3Cg style='clip-path:url(%23SVGID_00000035518931339590433170000002358037249938198420_);'%3E%3Cpath class='st1' d='M124.1,0h14.6L79.5,67.6c-1.5,1.7-1.6,4.3-0.1,6.1l34.1,39.7H98.3L66.8,76.6l-1.6-2c-1.5-1.7-1.4-4.4,0.1-6.1 L124.1,0z'/%3E%3Cpath class='st1' d='M91.2,73.7c-1-1.1-1.3-2.7-1-4.1c0.3-0.8,0.8-1.6,1.4-2.2l3.9-4.3l43.5,50.3h-13.8 C125.2,113.4,99.7,83.6,91.2,73.7z'/%3E%3Cpath class='st1' d='M15.2,113.4H0l46.6-53.9c1.5-1.7,1.5-4.3,0-6L0.4,0H15l46.5,53.9c1.2,1.6,1.4,3.9,0.1,5.4 C49.4,73.4,15.2,113.4,15.2,113.4z'/%3E%3Cpath class='st1' d='M40.6,0h-14l43.1,49.9c0,0,0.1-0.1,4.9-5.8c1.3-1.5,1.6-3.4,0.1-4.9C65.7,30,40.6,0,40.6,0z'/%3E%3Cpath class='st1' d='M82.6,34.8L112.5,0H98.3L82.7,18.2l-4.5,5.3c-1.5,1.7-1.6,4.3-0.1,6.1C79.2,30.9,82.6,34.8,82.6,34.8z'/%3E%3Cpath class='st1' d='M56.6,78.6l-29.9,34.8h14.1l15.6-18.2l4.5-5.3c1.5-1.7,1.6-4.3,0.1-6.1C59.9,82.5,56.6,78.6,56.6,78.6z'/%3E%3C/g%3E%3C/g%3E%3C/svg%3E%0A\",\"tokenFeatures\":[\"swap\",\"bridge\"]},{\"chainId\":11155111,\"name\":\"Sep Eth\",\"symbol\":\"ETH\",\"decimals\":18,\"icon\":\"data:image/svg+xml,%3C%3Fxml version='1.0' encoding='UTF-8'%3F%3E%3C!DOCTYPE svg PUBLIC '-//W3C//DTD SVG 1.1//EN' 'http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd'%3E%3Csvg xmlns='http://www.w3.org/2000/svg' xml:space='preserve' width='100%25' height='100%25' version='1.1' shape-rendering='geometricPrecision' text-rendering='geometricPrecision' image-rendering='optimizeQuality' fill-rule='evenodd' clip-rule='evenodd'%0AviewBox='0 0 784.37 1277.39' xmlns:xlink='http://www.w3.org/1999/xlink' xmlns:xodm='http://www.corel.com/coreldraw/odm/2003'%3E%3Cg id='Layer_x0020_1'%3E%3Cmetadata id='CorelCorpID_0Corel-Layer'/%3E%3Cg id='_1421394342400'%3E%3Cg%3E%3Cpolygon fill='%23343434' fill-rule='nonzero' points='392.07,0 383.5,29.11 383.5,873.74 392.07,882.29 784.13,650.54 '/%3E%3Cpolygon fill='%238C8C8C' fill-rule='nonzero' points='392.07,0 -0,650.54 392.07,882.29 392.07,472.33 '/%3E%3Cpolygon fill='%233C3C3B' fill-rule='nonzero' points='392.07,956.52 387.24,962.41 387.24,1263.28 392.07,1277.38 784.37,724.89 '/%3E%3Cpolygon fill='%238C8C8C' fill-rule='nonzero' points='392.07,1277.38 392.07,956.52 -0,724.89 '/%3E%3Cpolygon fill='%23141414' fill-rule='nonzero' points='392.07,882.29 784.13,650.54 392.07,472.33 '/%3E%3Cpolygon fill='%23393939' fill-rule='nonzero' points='0,650.54 392.07,882.29 392.07,472.33 '/%3E%3C/g%3E%3C/g%3E%3C/g%3E%3C/svg%3E%0A\",\"tokenFeatures\":[\"swap\"]},{\"chainId\":11155111,\"name\":\"Immutable Test token\",\"address\":\"0xd1da7e9b2Ce1a4024DaD52b3D37F4c5c91a525C1\",\"symbol\":\"TEST\",\"decimals\":18,\"icon\":\"data:image/svg+xml,%3C%3Fxml version='1.0' encoding='utf-8'%3F%3E%3Csvg version='1.1' id='Layer_1' xmlns='http://www.w3.org/2000/svg' xmlns:xlink='http://www.w3.org/1999/xlink' x='0px' y='0px' viewBox='0 0 139 113' style='enable-background:new 0 0 139 113;' xml:space='preserve'%3E%3Cstyle type='text/css'%3E .st0%7Bclip-path:url(%23SVGID_00000053504646934646330740000009134454895836103350_);%7D .st1%7Bfill:%2317B5CB;%7D%0A%3C/style%3E%3Cg%3E%3Cdefs%3E%3Crect id='SVGID_1_' width='139' height='113'/%3E%3C/defs%3E%3CclipPath id='SVGID_00000035518931339590433170000002358037249938198420_'%3E%3Cuse xlink:href='%23SVGID_1_' style='overflow:visible;'/%3E%3C/clipPath%3E%3Cg style='clip-path:url(%23SVGID_00000035518931339590433170000002358037249938198420_);'%3E%3Cpath class='st1' d='M124.1,0h14.6L79.5,67.6c-1.5,1.7-1.6,4.3-0.1,6.1l34.1,39.7H98.3L66.8,76.6l-1.6-2c-1.5-1.7-1.4-4.4,0.1-6.1 L124.1,0z'/%3E%3Cpath class='st1' d='M91.2,73.7c-1-1.1-1.3-2.7-1-4.1c0.3-0.8,0.8-1.6,1.4-2.2l3.9-4.3l43.5,50.3h-13.8 C125.2,113.4,99.7,83.6,91.2,73.7z'/%3E%3Cpath class='st1' d='M15.2,113.4H0l46.6-53.9c1.5-1.7,1.5-4.3,0-6L0.4,0H15l46.5,53.9c1.2,1.6,1.4,3.9,0.1,5.4 C49.4,73.4,15.2,113.4,15.2,113.4z'/%3E%3Cpath class='st1' d='M40.6,0h-14l43.1,49.9c0,0,0.1-0.1,4.9-5.8c1.3-1.5,1.6-3.4,0.1-4.9C65.7,30,40.6,0,40.6,0z'/%3E%3Cpath class='st1' d='M82.6,34.8L112.5,0H98.3L82.7,18.2l-4.5,5.3c-1.5,1.7-1.6,4.3-0.1,6.1C79.2,30.9,82.6,34.8,82.6,34.8z'/%3E%3Cpath class='st1' d='M56.6,78.6l-29.9,34.8h14.1l15.6-18.2l4.5-5.3c1.5-1.7,1.6-4.3,0.1-6.1C59.9,82.5,56.6,78.6,56.6,78.6z'/%3E%3C/g%3E%3C/g%3E%3C/svg%3E%0A\",\"tokenFeatures\":[\"swap\",\"bridge\"]},{\"chainId\":11155111,\"name\":\"FUN token\",\"address\":\"0x741185AEFC3E539c1F42c1d6eeE8bFf1c89D70FE\",\"symbol\":\"FUN\",\"decimals\":18,\"icon\":\"data:image/svg+xml,%3C%3Fxml version='1.0' encoding='UTF-8'%3F%3E%3C!DOCTYPE svg PUBLIC '-//W3C//DTD SVG 1.1//EN' 'http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd'%3E%3Csvg xmlns='http://www.w3.org/2000/svg' xml:space='preserve' width='100%25' height='100%25' version='1.1' shape-rendering='geometricPrecision' text-rendering='geometricPrecision' image-rendering='optimizeQuality' fill-rule='evenodd' clip-rule='evenodd'%0AviewBox='0 0 784.37 1277.39' xmlns:xlink='http://www.w3.org/1999/xlink' xmlns:xodm='http://www.corel.com/coreldraw/odm/2003'%3E%3Cg id='Layer_x0020_1'%3E%3Cmetadata id='CorelCorpID_0Corel-Layer'/%3E%3Cg id='_1421394342400'%3E%3Cg%3E%3Cpolygon fill='%23343434' fill-rule='nonzero' points='392.07,0 383.5,29.11 383.5,873.74 392.07,882.29 784.13,650.54 '/%3E%3Cpolygon fill='%238C8C8C' fill-rule='nonzero' points='392.07,0 -0,650.54 392.07,882.29 392.07,472.33 '/%3E%3Cpolygon fill='%233C3C3B' fill-rule='nonzero' points='392.07,956.52 387.24,962.41 387.24,1263.28 392.07,1277.38 784.37,724.89 '/%3E%3Cpolygon fill='%238C8C8C' fill-rule='nonzero' points='392.07,1277.38 392.07,956.52 -0,724.89 '/%3E%3Cpolygon fill='%23141414' fill-rule='nonzero' points='392.07,882.29 784.13,650.54 392.07,472.33 '/%3E%3Cpolygon fill='%23393939' fill-rule='nonzero' points='0,650.54 392.07,882.29 392.07,472.33 '/%3E%3C/g%3E%3C/g%3E%3C/g%3E%3C/svg%3E%0A\",\"tokenFeatures\":[\"swap\",\"bridge\"]},{\"chainId\":11155111,\"name\":\"US Dollar Coin\",\"address\":\"0x1836E16b2036088490C2CFe4d11970Fc8e5884C4\",\"symbol\":\"USDC\",\"decimals\":18,\"icon\":\"data:image/svg+xml,%3C%3Fxml version='1.0' encoding='UTF-8'%3F%3E%3C!DOCTYPE svg PUBLIC '-//W3C//DTD SVG 1.1//EN' 'http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd'%3E%3Csvg xmlns='http://www.w3.org/2000/svg' xml:space='preserve' width='100%25' height='100%25' version='1.1' shape-rendering='geometricPrecision' text-rendering='geometricPrecision' image-rendering='optimizeQuality' fill-rule='evenodd' clip-rule='evenodd'%0AviewBox='0 0 784.37 1277.39' xmlns:xlink='http://www.w3.org/1999/xlink' xmlns:xodm='http://www.corel.com/coreldraw/odm/2003'%3E%3Cg id='Layer_x0020_1'%3E%3Cmetadata id='CorelCorpID_0Corel-Layer'/%3E%3Cg id='_1421394342400'%3E%3Cg%3E%3Cpolygon fill='%23343434' fill-rule='nonzero' points='392.07,0 383.5,29.11 383.5,873.74 392.07,882.29 784.13,650.54 '/%3E%3Cpolygon fill='%238C8C8C' fill-rule='nonzero' points='392.07,0 -0,650.54 392.07,882.29 392.07,472.33 '/%3E%3Cpolygon fill='%233C3C3B' fill-rule='nonzero' points='392.07,956.52 387.24,962.41 387.24,1263.28 392.07,1277.38 784.37,724.89 '/%3E%3Cpolygon fill='%238C8C8C' fill-rule='nonzero' points='392.07,1277.38 392.07,956.52 -0,724.89 '/%3E%3Cpolygon fill='%23141414' fill-rule='nonzero' points='392.07,882.29 784.13,650.54 392.07,472.33 '/%3E%3Cpolygon fill='%23393939' fill-rule='nonzero' points='0,650.54 392.07,882.29 392.07,472.33 '/%3E%3C/g%3E%3C/g%3E%3C/g%3E%3C/svg%3E%0A\",\"tokenFeatures\":[\"swap\",\"bridge\"]},{\"chainId\":13383,\"name\":\"DEX\",\"address\":\"0x8AC26EfCbf5D700b37A27aA00E6934e6904e7B8e\",\"symbol\":\"DEX\",\"decimals\":18,\"icon\":\"data:image/svg+xml,%3C%3Fxml version='1.0' encoding='UTF-8'%3F%3E%3C!DOCTYPE svg PUBLIC '-//W3C//DTD SVG 1.1//EN' 'http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd'%3E%3Csvg xmlns='http://www.w3.org/2000/svg' xml:space='preserve' width='100%25' height='100%25' version='1.1' shape-rendering='geometricPrecision' text-rendering='geometricPrecision' image-rendering='optimizeQuality' fill-rule='evenodd' clip-rule='evenodd'%0AviewBox='0 0 784.37 1277.39' xmlns:xlink='http://www.w3.org/1999/xlink' xmlns:xodm='http://www.corel.com/coreldraw/odm/2003'%3E%3Cg id='Layer_x0020_1'%3E%3Cmetadata id='CorelCorpID_0Corel-Layer'/%3E%3Cg id='_1421394342400'%3E%3Cg%3E%3Cpolygon fill='%23343434' fill-rule='nonzero' points='392.07,0 383.5,29.11 383.5,873.74 392.07,882.29 784.13,650.54 '/%3E%3Cpolygon fill='%238C8C8C' fill-rule='nonzero' points='392.07,0 -0,650.54 392.07,882.29 392.07,472.33 '/%3E%3Cpolygon fill='%233C3C3B' fill-rule='nonzero' points='392.07,956.52 387.24,962.41 387.24,1263.28 392.07,1277.38 784.37,724.89 '/%3E%3Cpolygon fill='%238C8C8C' fill-rule='nonzero' points='392.07,1277.38 392.07,956.52 -0,724.89 '/%3E%3Cpolygon fill='%23141414' fill-rule='nonzero' points='392.07,882.29 784.13,650.54 392.07,472.33 '/%3E%3Cpolygon fill='%23393939' fill-rule='nonzero' points='0,650.54 392.07,882.29 392.07,472.33 '/%3E%3C/g%3E%3C/g%3E%3C/g%3E%3C/svg%3E%0A\",\"tokenFeatures\":[\"swap\",\"bridge\"]},{\"chainId\":11155111,\"name\":\"DEX\",\"address\":\"0xaC953a0d7B67Fae17c87abf79f09D0f818AC66A2\",\"symbol\":\"DEX\",\"decimals\":18,\"icon\":\"data:image/svg+xml,%3C%3Fxml version='1.0' encoding='UTF-8'%3F%3E%3C!DOCTYPE svg PUBLIC '-//W3C//DTD SVG 1.1//EN' 'http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd'%3E%3Csvg xmlns='http://www.w3.org/2000/svg' xml:space='preserve' width='100%25' height='100%25' version='1.1' shape-rendering='geometricPrecision' text-rendering='geometricPrecision' image-rendering='optimizeQuality' fill-rule='evenodd' clip-rule='evenodd'%0AviewBox='0 0 784.37 1277.39' xmlns:xlink='http://www.w3.org/1999/xlink' xmlns:xodm='http://www.corel.com/coreldraw/odm/2003'%3E%3Cg id='Layer_x0020_1'%3E%3Cmetadata id='CorelCorpID_0Corel-Layer'/%3E%3Cg id='_1421394342400'%3E%3Cg%3E%3Cpolygon fill='%23343434' fill-rule='nonzero' points='392.07,0 383.5,29.11 383.5,873.74 392.07,882.29 784.13,650.54 '/%3E%3Cpolygon fill='%238C8C8C' fill-rule='nonzero' points='392.07,0 -0,650.54 392.07,882.29 392.07,472.33 '/%3E%3Cpolygon fill='%233C3C3B' fill-rule='nonzero' points='392.07,956.52 387.24,962.41 387.24,1263.28 392.07,1277.38 784.37,724.89 '/%3E%3Cpolygon fill='%238C8C8C' fill-rule='nonzero' points='392.07,1277.38 392.07,956.52 -0,724.89 '/%3E%3Cpolygon fill='%23141414' fill-rule='nonzero' points='392.07,882.29 784.13,650.54 392.07,472.33 '/%3E%3Cpolygon fill='%23393939' fill-rule='nonzero' points='0,650.54 392.07,882.29 392.07,472.33 '/%3E%3C/g%3E%3C/g%3E%3C/g%3E%3C/svg%3E%0A\",\"tokenFeatures\":[\"swap\",\"bridge\"]},{\"chainId\":1442,\"name\":\"WETH\",\"address\":\"0x4F062A3EAeC3730560aB89b5CE5aC0ab2C5517aE\",\"symbol\":\"WETH\",\"decimals\":18,\"icon\":\"data:image/svg+xml,%3C%3Fxml version='1.0' encoding='UTF-8'%3F%3E%3C!DOCTYPE svg PUBLIC '-//W3C//DTD SVG 1.1//EN' 'http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd'%3E%3Csvg xmlns='http://www.w3.org/2000/svg' xml:space='preserve' width='100%25' height='100%25' version='1.1' shape-rendering='geometricPrecision' text-rendering='geometricPrecision' image-rendering='optimizeQuality' fill-rule='evenodd' clip-rule='evenodd'%0AviewBox='0 0 784.37 1277.39' xmlns:xlink='http://www.w3.org/1999/xlink' xmlns:xodm='http://www.corel.com/coreldraw/odm/2003'%3E%3Cg id='Layer_x0020_1'%3E%3Cmetadata id='CorelCorpID_0Corel-Layer'/%3E%3Cg id='_1421394342400'%3E%3Cg%3E%3Cpolygon fill='%23343434' fill-rule='nonzero' points='392.07,0 383.5,29.11 383.5,873.74 392.07,882.29 784.13,650.54 '/%3E%3Cpolygon fill='%238C8C8C' fill-rule='nonzero' points='392.07,0 -0,650.54 392.07,882.29 392.07,472.33 '/%3E%3Cpolygon fill='%233C3C3B' fill-rule='nonzero' points='392.07,956.52 387.24,962.41 387.24,1263.28 392.07,1277.38 784.37,724.89 '/%3E%3Cpolygon fill='%238C8C8C' fill-rule='nonzero' points='392.07,1277.38 392.07,956.52 -0,724.89 '/%3E%3Cpolygon fill='%23141414' fill-rule='nonzero' points='392.07,882.29 784.13,650.54 392.07,472.33 '/%3E%3Cpolygon fill='%23393939' fill-rule='nonzero' points='0,650.54 392.07,882.29 392.07,472.33 '/%3E%3C/g%3E%3C/g%3E%3C/g%3E%3C/svg%3E%0A\",\"tokenFeatures\":[\"swap\",\"bridge\"]},{\"address\":\"0x72958b06abdF2701AcE6ceb3cE0B8B1CE11E0851\",\"chainId\":1442,\"name\":\"Immutable X\",\"symbol\":\"IMX\",\"decimals\":18,\"icon\":\"data:image/svg+xml,%3C%3Fxml version='1.0' encoding='utf-8'%3F%3E%3Csvg version='1.1' id='Layer_1' xmlns='http://www.w3.org/2000/svg' xmlns:xlink='http://www.w3.org/1999/xlink' x='0px' y='0px' viewBox='0 0 139 113' style='enable-background:new 0 0 139 113;' xml:space='preserve'%3E%3Cstyle type='text/css'%3E .st0%7Bclip-path:url(%23SVGID_00000053504646934646330740000009134454895836103350_);%7D .st1%7Bfill:%2317B5CB;%7D%0A%3C/style%3E%3Cg%3E%3Cdefs%3E%3Crect id='SVGID_1_' width='139' height='113'/%3E%3C/defs%3E%3CclipPath id='SVGID_00000035518931339590433170000002358037249938198420_'%3E%3Cuse xlink:href='%23SVGID_1_' style='overflow:visible;'/%3E%3C/clipPath%3E%3Cg style='clip-path:url(%23SVGID_00000035518931339590433170000002358037249938198420_);'%3E%3Cpath class='st1' d='M124.1,0h14.6L79.5,67.6c-1.5,1.7-1.6,4.3-0.1,6.1l34.1,39.7H98.3L66.8,76.6l-1.6-2c-1.5-1.7-1.4-4.4,0.1-6.1 L124.1,0z'/%3E%3Cpath class='st1' d='M91.2,73.7c-1-1.1-1.3-2.7-1-4.1c0.3-0.8,0.8-1.6,1.4-2.2l3.9-4.3l43.5,50.3h-13.8 C125.2,113.4,99.7,83.6,91.2,73.7z'/%3E%3Cpath class='st1' d='M15.2,113.4H0l46.6-53.9c1.5-1.7,1.5-4.3,0-6L0.4,0H15l46.5,53.9c1.2,1.6,1.4,3.9,0.1,5.4 C49.4,73.4,15.2,113.4,15.2,113.4z'/%3E%3Cpath class='st1' d='M40.6,0h-14l43.1,49.9c0,0,0.1-0.1,4.9-5.8c1.3-1.5,1.6-3.4,0.1-4.9C65.7,30,40.6,0,40.6,0z'/%3E%3Cpath class='st1' d='M82.6,34.8L112.5,0H98.3L82.7,18.2l-4.5,5.3c-1.5,1.7-1.6,4.3-0.1,6.1C79.2,30.9,82.6,34.8,82.6,34.8z'/%3E%3Cpath class='st1' d='M56.6,78.6l-29.9,34.8h14.1l15.6-18.2l4.5-5.3c1.5-1.7,1.6-4.3,0.1-6.1C59.9,82.5,56.6,78.6,56.6,78.6z'/%3E%3C/g%3E%3C/g%3E%3C/svg%3E%0A\",\"tokenFeatures\":[\"swap\",\"bridge\"]}]");
467
-
468
-
469
- const $efe60cea83bfc4e8$var$filterTokenList = ({ type: type , chainId: chainId , exclude: exclude })=>((/*@__PURE__*/$parcel$interopDefault($cda6003506e4182e$exports))).filter((token)=>{
470
- const skipChainIdCheck = !chainId;
471
- const chainIdMatches = token.chainId === chainId;
472
- const tokenNotExcluded = !exclude?.map((excludeToken)=>excludeToken.address).includes(token.address || "");
473
- const allowAllTokens = type === ($08d5ddc39acd6833$export$fd9b17d87f4121d2).ALL;
474
- const tokenAllowedForType = token.tokenFeatures.includes(type);
475
- return (skipChainIdCheck || chainIdMatches) && tokenNotExcluded && (allowAllTokens || tokenAllowedForType);
476
- });
477
- const $efe60cea83bfc4e8$export$473cec51305fdae8 = async ({ type: type = ($08d5ddc39acd6833$export$fd9b17d87f4121d2).ALL , chainId: chainId , exclude: exclude })=>{
478
- const filteredTokenList = $efe60cea83bfc4e8$var$filterTokenList({
479
- type: type,
480
- chainId: chainId,
481
- exclude: exclude
482
- }).map((token)=>({
483
- name: token.name,
484
- symbol: token.symbol,
485
- decimals: token.decimals,
486
- address: token.address,
487
- icon: token.icon
488
- }));
489
- return {
490
- tokens: filteredTokenList
491
- };
492
- };
493
-
494
-
495
-
496
-
497
- const $1564e43dde50bb61$export$df96cd8d56be0ab1 = async (config, web3Provider, walletAddress)=>await ($a8bc256d81a5e2c1$export$bacc563de539c6c3)(async ()=>{
498
- const networkInfo = await ($de192de6ef100f9f$export$79f13b4cfaaf0d09)(config, web3Provider);
499
- if (!networkInfo.isSupported) throw new ($a8bc256d81a5e2c1$export$b722478a3cbfa3bc)(`Chain:${networkInfo.chainId} is not a supported chain`, ($a8bc256d81a5e2c1$export$e3dc0620abde7f5a).CHAIN_NOT_SUPPORTED_ERROR, {
500
- chainName: networkInfo.name
501
- });
502
- const balance = await web3Provider.getBalance(walletAddress);
503
- return {
504
- balance: balance,
505
- formattedBalance: (utils).formatUnits(balance, networkInfo.nativeCurrency.decimals),
506
- token: networkInfo.nativeCurrency
507
- };
508
- }, {
509
- type: ($a8bc256d81a5e2c1$export$e3dc0620abde7f5a).GET_BALANCE_ERROR
510
- });
511
- async function $1564e43dde50bb61$export$60e0fe116a0e6ed0(web3Provider, walletAddress, contractAddress) {
512
- return await ($a8bc256d81a5e2c1$export$bacc563de539c6c3)(async ()=>{
513
- const contract = new (Contract)(contractAddress, JSON.stringify(($762782b6c862d954$export$db5daa1b5156ccfe)), web3Provider);
514
- const name = await contract.name();
515
- const symbol = await contract.symbol();
516
- const balance = await contract.balanceOf(walletAddress);
517
- const decimals = await contract.decimals();
518
- const formattedBalance = (utils).formatUnits(balance, decimals);
519
- return {
520
- balance: balance,
521
- formattedBalance: formattedBalance,
522
- token: {
523
- name: name,
524
- symbol: symbol,
525
- decimals: decimals,
526
- address: contractAddress
527
- }
528
- };
529
- }, {
530
- type: ($a8bc256d81a5e2c1$export$e3dc0620abde7f5a).GET_ERC20_BALANCE_ERROR
531
- });
532
- }
533
- const $1564e43dde50bb61$export$fee49741664a4d7e = async (config, web3Provider, walletAddress, chainId)=>{
534
- const tokenList = await ($efe60cea83bfc4e8$export$473cec51305fdae8)({
535
- type: ($08d5ddc39acd6833$export$fd9b17d87f4121d2).ALL,
536
- chainId: chainId
537
- });
538
- const allBalancePromises = [];
539
- allBalancePromises.push($1564e43dde50bb61$export$df96cd8d56be0ab1(config, web3Provider, walletAddress));
540
- tokenList.tokens.filter((token)=>token.address).forEach((token)=>allBalancePromises.push($1564e43dde50bb61$export$60e0fe116a0e6ed0(web3Provider, walletAddress, token.address ?? "")));
541
- const balanceResults = await Promise.allSettled(allBalancePromises);
542
- const getBalanceResults = balanceResults.filter((result)=>result.status === "fulfilled").map((fulfilledResult)=>fulfilledResult.value);
543
- return {
544
- balances: getBalanceResults
545
- };
546
- };
547
-
548
-
549
-
550
-
551
-
552
- /* eslint-disable @typescript-eslint/no-explicit-any */
553
-
554
- async function $c99672cf2294e839$export$2d040992269b4717(web3Provider) {
555
- if (!web3Provider?.provider?.request) throw new ($a8bc256d81a5e2c1$export$b722478a3cbfa3bc)("Check wallet connection request failed", ($a8bc256d81a5e2c1$export$e3dc0620abde7f5a).PROVIDER_REQUEST_FAILED_ERROR, {
556
- rpcMethod: ($4f91c5f280efe242$export$35b06f0d33f57e26).CHECK_CONNECTION
557
- });
558
- let accounts = [];
559
- try {
560
- accounts = await web3Provider.provider.request({
561
- method: (0, $4f91c5f280efe242$export$35b06f0d33f57e26).CHECK_CONNECTION,
562
- params: []
563
- });
564
- } catch (err) {
565
- throw new ($a8bc256d81a5e2c1$export$b722478a3cbfa3bc)("Check wallet connection request failed", ($a8bc256d81a5e2c1$export$e3dc0620abde7f5a).PROVIDER_REQUEST_FAILED_ERROR, {
566
- rpcMethod: ($4f91c5f280efe242$export$35b06f0d33f57e26).CHECK_CONNECTION
567
- });
568
- }
569
- // accounts[0] will have the active account if connected.
570
- return {
571
- isConnected: accounts && accounts.length > 0,
572
- walletAddress: accounts[0] ?? ""
573
- };
574
- }
575
- async function $c99672cf2294e839$export$43f7168eb392a88c(web3Provider) {
576
- await ($a8bc256d81a5e2c1$export$bacc563de539c6c3)(async ()=>{
577
- if (!web3Provider || !web3Provider?.provider?.request) throw new ($a8bc256d81a5e2c1$export$b722478a3cbfa3bc)("Incompatible provider", ($a8bc256d81a5e2c1$export$e3dc0620abde7f5a).PROVIDER_REQUEST_MISSING_ERROR, {
578
- details: "Attempting to connect with an incompatible provider"
579
- });
580
- // this makes the request to the wallet to connect i.e request eth accounts ('eth_requestAccounts')
581
- await web3Provider.provider.request({
582
- method: ($4f91c5f280efe242$export$35b06f0d33f57e26).CONNECT,
583
- params: []
584
- });
585
- }, {
586
- type: ($a8bc256d81a5e2c1$export$e3dc0620abde7f5a).USER_REJECTED_REQUEST_ERROR
587
- });
588
- return web3Provider;
589
- }
590
-
591
-
592
-
593
-
594
- /* eslint-disable @typescript-eslint/no-explicit-any */
595
-
596
-
597
-
598
- async function $5c763be0b0b81038$var$getMetaMaskProvider() {
599
- const provider = await ($a8bc256d81a5e2c1$export$bacc563de539c6c3)(async ()=>await ($7v2Z6$metamaskdetectprovider)(), {
600
- type: ($a8bc256d81a5e2c1$export$e3dc0620abde7f5a).METAMASK_PROVIDER_ERROR
601
- });
602
- if (!provider || !provider.request) throw new ($a8bc256d81a5e2c1$export$b722478a3cbfa3bc)("No MetaMask provider installed.", ($a8bc256d81a5e2c1$export$e3dc0620abde7f5a).METAMASK_PROVIDER_ERROR);
603
- return new (Web3Provider)(provider);
604
- }
605
- async function $5c763be0b0b81038$export$500fbc0cd14cdbaa(defaultProvider) {
606
- let web3Provider = null;
607
- switch(defaultProvider){
608
- case ($e768639828688ca3$export$2d7a51a18d87e21d).METAMASK:
609
- web3Provider = await $5c763be0b0b81038$var$getMetaMaskProvider();
610
- break;
611
- default:
612
- throw new ($a8bc256d81a5e2c1$export$b722478a3cbfa3bc)("Provider not supported", ($a8bc256d81a5e2c1$export$e3dc0620abde7f5a).DEFAULT_PROVIDER_ERROR);
613
- }
614
- return web3Provider;
615
- }
616
-
617
-
618
- // this function needs to be in a separate file to prevent circular dependencies with ./network
619
-
620
-
621
-
622
-
623
-
624
- function $bb88265fe45a0393$export$ebe4804963e71f98(web3Provider) {
625
- if (web3Provider && web3Provider instanceof (Web3Provider) && web3Provider.provider?.request) return true;
626
- return false;
627
- }
628
- async function $bb88265fe45a0393$export$9e1fd9cc88c637a0(config, web3Provider, validateProviderOptions) {
629
- return ($a8bc256d81a5e2c1$export$bacc563de539c6c3)(async ()=>{
630
- if (!$bb88265fe45a0393$export$ebe4804963e71f98(web3Provider)) throw new ($a8bc256d81a5e2c1$export$b722478a3cbfa3bc)("Parsed provider is not a valid Web3Provider", ($a8bc256d81a5e2c1$export$e3dc0620abde7f5a).WEB3_PROVIDER_ERROR);
631
- // this sets the default options and overrides them with any parsed options
632
- const options = {
633
- ...($e768639828688ca3$export$44dde05038008549),
634
- ...validateProviderOptions
635
- };
636
- const underlyingChainId = await ($a1555a1d2c8d059b$export$c3ba3e93a9fee972)(web3Provider);
637
- let web3ChainId = web3Provider.network?.chainId;
638
- try {
639
- web3ChainId = web3Provider.network?.chainId;
640
- if (!web3ChainId) web3ChainId = (await web3Provider.getNetwork()).chainId;
641
- } catch (err) {
642
- throw new ($a8bc256d81a5e2c1$export$b722478a3cbfa3bc)("Unable to detect the web3Provider network", ($a8bc256d81a5e2c1$export$e3dc0620abde7f5a).WEB3_PROVIDER_ERROR);
643
- }
644
- if (web3ChainId !== underlyingChainId && !options.allowMistmatchedChainId) throw new ($a8bc256d81a5e2c1$export$b722478a3cbfa3bc)("Your wallet has changed network, please switch to a supported network", ($a8bc256d81a5e2c1$export$e3dc0620abde7f5a).WEB3_PROVIDER_ERROR);
645
- const allowedNetworks = await ($de192de6ef100f9f$export$3043f6442a9ef563)(config, {
646
- type: ($a47e48dd2c04791b$export$1f05a55fe0680cc7).ALL
647
- });
648
- const isAllowed = allowedNetworks.networks.some((network)=>network.chainId === underlyingChainId);
649
- if (!isAllowed && !options.allowUnsupportedProvider) throw new ($a8bc256d81a5e2c1$export$b722478a3cbfa3bc)("Your wallet is connected to an unsupported network, please switch to a supported network", ($a8bc256d81a5e2c1$export$e3dc0620abde7f5a).WEB3_PROVIDER_ERROR);
650
- return web3Provider;
651
- }, {
652
- type: ($a8bc256d81a5e2c1$export$e3dc0620abde7f5a).WEB3_PROVIDER_ERROR
653
- });
654
- }
655
-
656
-
657
-
658
-
659
-
660
- var $6f3c55a615003cbf$exports = {};
661
- $6f3c55a615003cbf$exports = JSON.parse('[{"walletProvider":"metamask","icon":"some-icon-url","name":"MetaMask","description":"complete web3 wallet solution","platform":["desktop"]},{"walletProvider":"passport","icon":"pp-icon","name":"Passport","description":"Web3 with your email!","platform":["mobile","desktop"]},{"walletProvider":"gamestop","icon":"gme-icon","name":"GameStop","description":"Never stopping the game!","platform":["mobile"]}]');
662
-
663
-
664
- async function $5cdde2ffe6360fec$export$a822caa90d7eef09({ type: type = ($4f91c5f280efe242$export$a75605c67ea83a5a).ALL , exclude: exclude }) {
665
- // todo:For async API call, use the CheckoutError with errorType:API_CALL_ERROR?? or any other
666
- const filteredWalletsList = ((/*@__PURE__*/$parcel$interopDefault($6f3c55a615003cbf$exports))).filter((wallet)=>{
667
- const walletNotExcluded = !exclude?.map((excludeWallet)=>excludeWallet.walletProvider).includes(wallet.walletProvider);
668
- const allowAllWallets = type === ($4f91c5f280efe242$export$a75605c67ea83a5a).ALL;
669
- const walletsAllowedForType = wallet.platform.includes(type);
670
- return walletNotExcluded && (allowAllWallets || walletsAllowedForType);
671
- }).map((wallet)=>{
672
- const { platform: platform , ...walletInfo } = wallet;
673
- return walletInfo;
674
- });
675
- return {
676
- wallets: filteredWalletsList
677
- };
678
- }
679
-
680
-
681
-
682
-
683
-
684
-
685
-
686
- const $dbe95599a4661140$export$8e0e7ffc78696d30 = async (web3Provider, transaction)=>{
687
- try {
688
- const transactionResponse = await web3Provider.getSigner().sendTransaction(transaction);
689
- return {
690
- transactionResponse: transactionResponse
691
- };
692
- } catch (err) {
693
- if (err.code === (ethers).errors.INSUFFICIENT_FUNDS) throw new ($a8bc256d81a5e2c1$export$b722478a3cbfa3bc)(err.message, ($a8bc256d81a5e2c1$export$e3dc0620abde7f5a).INSUFFICIENT_FUNDS);
694
- if (err.code === (ethers).errors.ACTION_REJECTED) throw new ($a8bc256d81a5e2c1$export$b722478a3cbfa3bc)(err.message, ($a8bc256d81a5e2c1$export$e3dc0620abde7f5a).USER_REJECTED_REQUEST_ERROR);
695
- if (err.code === (ethers).errors.UNPREDICTABLE_GAS_LIMIT) throw new ($a8bc256d81a5e2c1$export$b722478a3cbfa3bc)(err.message, ($a8bc256d81a5e2c1$export$e3dc0620abde7f5a).UNPREDICTABLE_GAS_LIMIT);
696
- throw new ($a8bc256d81a5e2c1$export$b722478a3cbfa3bc)(err.message, ($a8bc256d81a5e2c1$export$e3dc0620abde7f5a).TRANSACTION_FAILED);
697
- }
698
- };
699
-
700
-
701
-
702
-
703
-
704
-
705
-
706
-
707
-
708
-
709
-
710
- const $570856c68db0bd36$var$GAS_LIMIT = 140000;
711
- async function $570856c68db0bd36$var$getTokenInfoByAddress(tokenAddress, chainId) {
712
- return (await $efe60cea83bfc4e8$export$473cec51305fdae8({
713
- type: ($08d5ddc39acd6833$export$fd9b17d87f4121d2).ALL,
714
- chainId: chainId
715
- })).tokens.find((token)=>(token.address || "NATIVE") === tokenAddress);
716
- }
717
- const $570856c68db0bd36$var$doesChainSupportEIP1559 = (feeData)=>!!feeData.maxFeePerGas && !!feeData.maxPriorityFeePerGas;
718
- const $570856c68db0bd36$var$getGasPriceInWei = (feeData)=>$570856c68db0bd36$var$doesChainSupportEIP1559(feeData) ? (BigNumber$1).from(feeData.maxFeePerGas).add((BigNumber$1).from(feeData.maxPriorityFeePerGas)) : feeData.gasPrice && (BigNumber$1).from(feeData.gasPrice);
719
- const $570856c68db0bd36$var$getGasEstimates = async (provider)=>{
720
- const txnGasLimitInWei = $570856c68db0bd36$var$GAS_LIMIT; // todo: fetch gasLimit from bridgeSDK when they add new fn
721
- const feeData = await provider.getFeeData();
722
- const gasPriceInWei = $570856c68db0bd36$var$getGasPriceInWei(feeData);
723
- if (!gasPriceInWei) return undefined;
724
- return gasPriceInWei.mul(txnGasLimitInWei);
725
- };
726
- async function $570856c68db0bd36$export$51010590edbe56a6(provider, chainId, isApproveTxnRequired, gasTokenAddress) {
727
- const token = await $570856c68db0bd36$var$getTokenInfoByAddress(gasTokenAddress || "NATIVE", chainId);
728
- let estimatedAmount = await $570856c68db0bd36$var$getGasEstimates(provider);
729
- if (!estimatedAmount) return {
730
- estimatedAmount: undefined,
731
- token: token
732
- };
733
- if (isApproveTxnRequired) estimatedAmount = estimatedAmount.add(estimatedAmount);
734
- const result = {
735
- estimatedAmount: estimatedAmount,
736
- token: token
737
- };
738
- return result;
739
- }
740
- async function $570856c68db0bd36$export$9e73e22953cebcfc(tokenBridge, tokenAddress, destinationChainId) {
741
- const bridgeFeeReq = {
742
- token: tokenAddress
743
- };
744
- const bridgeFeeResponse = await tokenBridge.getFee(bridgeFeeReq);
745
- const tokenInfo = await $570856c68db0bd36$var$getTokenInfoByAddress(tokenAddress, destinationChainId);
746
- return {
747
- bridgeFee: {
748
- estimatedAmount: bridgeFeeResponse.feeAmount,
749
- token: tokenInfo
750
- },
751
- bridgeable: bridgeFeeResponse.bridgeable
752
- };
753
- }
754
-
755
-
756
-
757
-
758
-
759
-
760
- async function $67fc622a2b913d5f$export$989eefe1274a439c(fromChainId, toChainId, readOnlyProviders, environment) {
761
- const rootChainProvider = readOnlyProviders.get(fromChainId);
762
- const childChainProvider = readOnlyProviders.get(toChainId);
763
- if (!rootChainProvider) throw new ($a8bc256d81a5e2c1$export$b722478a3cbfa3bc)(`Chain:${fromChainId} is not a supported chain`, ($a8bc256d81a5e2c1$export$e3dc0620abde7f5a).CHAIN_NOT_SUPPORTED_ERROR);
764
- if (!childChainProvider) throw new ($a8bc256d81a5e2c1$export$b722478a3cbfa3bc)(`Chain:${toChainId} is not a supported chain`, ($a8bc256d81a5e2c1$export$e3dc0620abde7f5a).CHAIN_NOT_SUPPORTED_ERROR);
765
- const bridgeConfig = new (BridgeConfiguration)({
766
- baseConfig: new (ImmutableConfiguration)({
767
- environment: environment
768
- }),
769
- bridgeInstance: environment === (Environment).PRODUCTION ? (ETH_MAINNET_TO_ZKEVM_MAINNET) : (ETH_SEPOLIA_TO_ZKEVM_DEVNET),
770
- rootProvider: rootChainProvider,
771
- childProvider: childChainProvider
772
- });
773
- return new (TokenBridge)(bridgeConfig);
774
- }
775
- async function $67fc622a2b913d5f$export$7cf6178417769841(chainId, config) {
776
- const dexConfig = await config.remoteConfigFetcher.get("dex");
777
- return new (Exchange)(new (ExchangeConfiguration)({
778
- chainId: chainId,
779
- baseConfig: new (ImmutableConfiguration)({
780
- environment: config.environment
781
- }),
782
- overrides: dexConfig?.overrides
783
- }));
784
- }
785
-
786
-
787
-
788
-
789
- const $2e7bf45a7c9a9570$var$DUMMY_WALLET_ADDRESS = "0x0000000000000000000000000000000000000000";
790
- const $2e7bf45a7c9a9570$var$DEFAULT_TOKEN_DECIMALS = 18;
791
- const $2e7bf45a7c9a9570$var$getL1ChainId = (environment)=>{
792
- if (environment === (Environment).PRODUCTION) return ($baec09ddc3013323$export$c06e1e7429de6283).SEPOLIA;
793
- return ($baec09ddc3013323$export$c06e1e7429de6283).SEPOLIA;
794
- };
795
- const $2e7bf45a7c9a9570$var$getL2ChainId = (environment)=>{
796
- if (environment === (Environment).PRODUCTION) return ($baec09ddc3013323$export$c06e1e7429de6283).IMTBL_ZKEVM_TESTNET;
797
- return ($baec09ddc3013323$export$c06e1e7429de6283).IMTBL_ZKEVM_DEVNET;
798
- };
799
- async function $2e7bf45a7c9a9570$var$bridgeToL2GasEstimator(readOnlyProviders, config, isSpendingCapApprovalRequired, tokenAddress) {
800
- const fromChainId = $2e7bf45a7c9a9570$var$getL1ChainId(config.environment);
801
- const toChainId = $2e7bf45a7c9a9570$var$getL2ChainId(config.environment);
802
- const gasEstimateTokensConfig = await config.remoteConfigFetcher.get("gasEstimateTokens");
803
- const { gasTokenAddress: gasTokenAddress , fromAddress: fromAddress } = gasEstimateTokensConfig[fromChainId.toString()].bridgeToL2Addresses;
804
- const provider = readOnlyProviders.get(fromChainId);
805
- try {
806
- const { estimatedAmount: estimatedAmount , token: token } = await (0, $570856c68db0bd36$export$51010590edbe56a6)(provider, fromChainId, isSpendingCapApprovalRequired, tokenAddress ?? gasTokenAddress);
807
- const tokenBridge = await $67fc622a2b913d5f$export$989eefe1274a439c(fromChainId, toChainId, readOnlyProviders, config.environment);
808
- const { bridgeFee: bridgeFee , bridgeable: bridgeable } = await (0, $570856c68db0bd36$export$9e73e22953cebcfc)(tokenBridge, fromAddress, toChainId);
809
- return {
810
- gasEstimateType: (0, $de275b98d2b651c3$export$788b1fd17f3dad84).BRIDGE_TO_L2,
811
- gasFee: {
812
- estimatedAmount: estimatedAmount,
813
- token: token
814
- },
815
- bridgeFee: {
816
- estimatedAmount: bridgeFee?.estimatedAmount,
817
- token: bridgeFee?.token
818
- },
819
- bridgeable: bridgeable
820
- };
821
- } catch {
822
- // In the case of an error, just return an empty gas & bridge fee estimate
823
- return {
824
- gasEstimateType: ($de275b98d2b651c3$export$788b1fd17f3dad84).BRIDGE_TO_L2,
825
- gasFee: {},
826
- bridgeFee: {},
827
- bridgeable: false
828
- };
829
- }
830
- }
831
- async function $2e7bf45a7c9a9570$var$swapGasEstimator(config) {
832
- const chainId = $2e7bf45a7c9a9570$var$getL2ChainId(config.environment);
833
- const gasEstimateTokensConfig = await config.remoteConfigFetcher.get("gasEstimateTokens");
834
- const { inAddress: inAddress , outAddress: outAddress } = gasEstimateTokensConfig[chainId].swapAddresses;
835
- try {
836
- const exchange = await $67fc622a2b913d5f$export$7cf6178417769841(chainId, config);
837
- // Create a fake transaction to get the gas from the quote
838
- const { info: info } = await exchange.getUnsignedSwapTxFromAmountIn($2e7bf45a7c9a9570$var$DUMMY_WALLET_ADDRESS, inAddress, outAddress, (0, BigNumber).from((0, utils$1).parseUnits("1", $2e7bf45a7c9a9570$var$DEFAULT_TOKEN_DECIMALS)));
839
- if (info.gasFeeEstimate === null) return {
840
- gasEstimateType: (0, $de275b98d2b651c3$export$788b1fd17f3dad84).SWAP,
841
- gasFee: {}
842
- };
843
- let estimatedAmount;
844
- if (info.gasFeeEstimate.amount) estimatedAmount = (0, BigNumber).from(info.gasFeeEstimate.amount);
845
- return {
846
- gasEstimateType: (0, $de275b98d2b651c3$export$788b1fd17f3dad84).SWAP,
847
- gasFee: {
848
- estimatedAmount: estimatedAmount,
849
- token: {
850
- address: info.gasFeeEstimate?.token.address,
851
- symbol: info.gasFeeEstimate?.token.symbol ?? "",
852
- name: info.gasFeeEstimate?.token.name ?? "",
853
- decimals: info.gasFeeEstimate?.token.decimals ?? $2e7bf45a7c9a9570$var$DEFAULT_TOKEN_DECIMALS
854
- }
855
- }
856
- };
857
- } catch {
858
- // In the case of an error, just return an empty gas fee estimate
859
- return {
860
- gasEstimateType: ($de275b98d2b651c3$export$788b1fd17f3dad84).SWAP,
861
- gasFee: {}
862
- };
863
- }
864
- }
865
- async function $2e7bf45a7c9a9570$export$942c8de7174809fc(params, readOnlyProviders, config) {
866
- switch(params.gasEstimateType){
867
- case ($de275b98d2b651c3$export$788b1fd17f3dad84).BRIDGE_TO_L2:
868
- return await $2e7bf45a7c9a9570$var$bridgeToL2GasEstimator(readOnlyProviders, config, params.isSpendingCapApprovalRequired, params.tokenAddress);
869
- case ($de275b98d2b651c3$export$788b1fd17f3dad84).SWAP:
870
- return await $2e7bf45a7c9a9570$var$swapGasEstimator(config);
871
- default:
872
- throw new ($a8bc256d81a5e2c1$export$b722478a3cbfa3bc)("Invalid type provided for gasEstimateType", ($a8bc256d81a5e2c1$export$e3dc0620abde7f5a).INVALID_GAS_ESTIMATE_TYPE);
873
- }
874
- }
875
-
876
-
877
-
878
-
879
-
880
-
881
-
882
-
883
-
884
-
885
- class $a492ee374ae7b613$export$d902b56530cd5f87 {
886
- cache;
887
- environment;
888
- constructor(params){
889
- this.environment = params.environment;
890
- }
891
- async load() {
892
- if (this.cache) return this.cache;
893
- let response;
894
- try {
895
- response = await (0, $7v2Z6$axios).get(`${(0, $d85ad1457a3f1a83$export$161d4a74df65fc08)[this.environment]}/v1/config`);
896
- } catch (error) {
897
- throw new Error(`Error fetching config: ${error.message}`);
898
- }
899
- if (response.status !== 200) throw new Error(`Error fetching config: ${response.status} ${response.statusText}`);
900
- this.cache = response.data;
901
- return this.cache;
902
- }
903
- async get(key) {
904
- const config = await this.load();
905
- if (config && key) return config[key];
906
- return config;
907
- }
908
- }
909
-
910
-
911
- class $4013c5c91bb535f6$export$6ad73ea7e1b6f37f extends Error {
912
- message;
913
- constructor(message){
914
- super(message);
915
- this.message = message;
916
- }
917
- }
918
- class $4013c5c91bb535f6$export$4823433c4a67bbc6 {
919
- environment;
920
- networkMap;
921
- remoteConfigFetcher;
922
- constructor(config){
923
- // validate input
924
- if (!Object.values((Environment)).includes(config.baseConfig.environment)) throw new $4013c5c91bb535f6$export$6ad73ea7e1b6f37f("Invalid checkout configuration of environment");
925
- this.environment = config.baseConfig.environment;
926
- this.networkMap = config.baseConfig.environment === (Environment).PRODUCTION ? ($a47e48dd2c04791b$export$6f24f3cef7d501c4) : ($a47e48dd2c04791b$export$3e81fc0987227f10);
927
- this.remoteConfigFetcher = new ($a492ee374ae7b613$export$d902b56530cd5f87)({
928
- environment: config.baseConfig.environment
929
- });
930
- }
931
- }
932
-
933
-
934
-
935
-
936
-
937
-
938
-
939
-
940
- async function $0e0060cb42e136d2$export$339cb2be73677b30(config, existingReadOnlyProviders) {
941
- if (config.environment === (Environment).PRODUCTION && existingReadOnlyProviders?.has(($baec09ddc3013323$export$c06e1e7429de6283).ETHEREUM) || config.environment === (Environment).SANDBOX && existingReadOnlyProviders?.has(($baec09ddc3013323$export$c06e1e7429de6283).SEPOLIA)) return existingReadOnlyProviders;
942
- const readOnlyProviders = new Map();
943
- const allowedNetworks = await $de192de6ef100f9f$export$3043f6442a9ef563(config, {
944
- type: ($a47e48dd2c04791b$export$1f05a55fe0680cc7).ALL
945
- });
946
- allowedNetworks.networks.forEach((networkInfo)=>{
947
- const rpcUrl = config.networkMap.get(networkInfo.chainId)?.rpcUrls[0];
948
- const provider = new (ethers).providers.JsonRpcProvider(rpcUrl);
949
- readOnlyProviders.set(networkInfo.chainId, provider);
950
- });
951
- return readOnlyProviders;
952
- }
953
-
954
-
955
- class $a8cb37a3fc8eb863$export$1f60ba4ec72508a0 {
956
- config;
957
- readOnlyProviders;
958
- constructor(config = ($bc2bfebf768286d3$export$6a2ba3c3bd042990)){
959
- this.config = new ($4013c5c91bb535f6$export$4823433c4a67bbc6)(config);
960
- this.readOnlyProviders = new Map();
961
- }
962
- /**
963
- * Create a provider object which can be used within the Checkout class methods.
964
- * @param {CreateProviderParams} params The data required to create a provider
965
- * @returns A new provider object
966
- * @throws {@link ErrorType}
967
- */ async createProvider(params) {
968
- const web3Provider = await $5c763be0b0b81038$export$500fbc0cd14cdbaa(params.walletProvider);
969
- return {
970
- provider: web3Provider
971
- };
972
- }
973
- /**
974
- * Check if a wallet is connected to the current application
975
- * without requesting permission from the wallet and hence triggering a connect popup.
976
- * @param {CheckConnectionParams} params - The necessary data required to verify a wallet connection status.
977
- * @returns Wallet connection status details.
978
- * @throws {@link ErrorType}
979
- */ async checkIsWalletConnected(params) {
980
- const web3Provider = await $bb88265fe45a0393$export$9e1fd9cc88c637a0(this.config, params.provider, {
981
- allowUnsupportedProvider: true
982
- });
983
- return $c99672cf2294e839$export$2d040992269b4717(web3Provider);
984
- }
985
- /**
986
- * Establish a connection with a wallet provider such as MetaMask and returns the provider object and the current network details.
987
- * @param {ConnectParams} params - The necessary data required to establish a connection with a wallet provider.
988
- * @returns Wallet provider and current network information.
989
- * @throws {@link ErrorType}
990
- */ async connect(params) {
991
- const web3Provider = await $bb88265fe45a0393$export$9e1fd9cc88c637a0(this.config, params.provider, {
992
- allowUnsupportedProvider: true
993
- });
994
- await $c99672cf2294e839$export$43f7168eb392a88c(web3Provider);
995
- const networkInfo = await $de192de6ef100f9f$export$79f13b4cfaaf0d09(this.config, web3Provider);
996
- return {
997
- provider: web3Provider,
998
- network: networkInfo
999
- };
1000
- }
1001
- /**
1002
- * Switch the currently connected wallet to a new network.
1003
- * @param {SwitchNetworkParams} params - The necessary data required to switch network.
1004
- * @returns The new network information.
1005
- * @throws {@link ErrorType}
1006
- */ async switchNetwork(params) {
1007
- const web3Provider = await $bb88265fe45a0393$export$9e1fd9cc88c637a0(this.config, params.provider, {
1008
- allowUnsupportedProvider: true,
1009
- allowMistmatchedChainId: true
1010
- });
1011
- const switchNetworkRes = await $de192de6ef100f9f$export$b827d9418aeb5dbd(this.config, web3Provider, params.chainId);
1012
- return switchNetworkRes;
1013
- }
1014
- /**
1015
- * Fetch the balance of the native token of the current connected network or,
1016
- * if a contract address is provided, it will return the balance of that ERC20 token. For example,
1017
- * if the wallet is connected to the Ethereum Mainnet then the function gets the wallet ETH L1 balance.
1018
- * @param {GetBalanceParams} params - The necessary data required to fetch the wallet balance.
1019
- * @returns Native token balance for the given wallet.
1020
- * @throws {@link ErrorType}
1021
- */ async getBalance(params) {
1022
- const web3Provider = await $bb88265fe45a0393$export$9e1fd9cc88c637a0(this.config, params.provider);
1023
- if (!params.contractAddress || params.contractAddress === "") return await $1564e43dde50bb61$export$df96cd8d56be0ab1(this.config, web3Provider, params.walletAddress);
1024
- return await $1564e43dde50bb61$export$60e0fe116a0e6ed0(web3Provider, params.walletAddress, params.contractAddress);
1025
- }
1026
- /**
1027
- * Fetch all available balances (ERC20 & Native) of the current connected network of the given wallet.
1028
- * It will loop through the list of allowed tokens and check for balance on each one.
1029
- * @param {GetAllBalancesParams} params - The necessary data required to fetch all the wallet balances.
1030
- * @returns List of tokens balance for the given wallet.
1031
- * @throws {@link ErrorType}
1032
- */ async getAllBalances(params) {
1033
- const web3Provider = await $bb88265fe45a0393$export$9e1fd9cc88c637a0(this.config, params.provider);
1034
- return $1564e43dde50bb61$export$fee49741664a4d7e(this.config, web3Provider, params.walletAddress, params.chainId);
1035
- }
1036
- /**
1037
- * Fetch the list of available networks that a wallet can add or/and switch to.
1038
- * @param {GetNetworkAllowListParams} params - The necessary data required to fetch the list of available networks.
1039
- * @returns List of networks.
1040
- * @throws {@link ErrorType}
1041
- */ async getNetworkAllowList(params) {
1042
- return await $de192de6ef100f9f$export$3043f6442a9ef563(this.config, params);
1043
- }
1044
- /**
1045
- * Get the list of tokens which are allowed to be used with the product.
1046
- * @param {GetTokenAllowListParams} params - The necessary data required to fetch the list of allowed tokens.
1047
- * @returns List of allowed tokens.
1048
- * @throws {@link ErrorType}
1049
- */ async getTokenAllowList(params) {
1050
- return await $efe60cea83bfc4e8$export$473cec51305fdae8(params);
1051
- }
1052
- /**
1053
- * Fetch the list of wallets which are available to connect with.
1054
- * @param {GetWalletAllowListParams} params - The necessary data required to fetch the list of allowed wallets.
1055
- * @returns List of allowed wallets.
1056
- * @throws {@link ErrorType}
1057
- */ async getWalletAllowList(params) {
1058
- return await $5cdde2ffe6360fec$export$a822caa90d7eef09(params);
1059
- }
1060
- /**
1061
- * Send a generic transaction to the provider.
1062
- * @param {SendTransactionParams} params - The necessary data required to send a transaction.
1063
- * @returns Transaction response.
1064
- * @throws {@link ErrorType}
1065
- * @remarks
1066
- * Further documenation can be found at [MetaMask | Sending Transactions](https://docs.metamask.io/guide/sending-transactions.html).
1067
- */ async sendTransaction(params) {
1068
- const web3Provider = await $bb88265fe45a0393$export$9e1fd9cc88c637a0(this.config, params.provider);
1069
- return await $dbe95599a4661140$export$8e0e7ffc78696d30(web3Provider, params.transaction);
1070
- }
1071
- /**
1072
- * Get network information about the currently selected network.
1073
- * @param {GetNetworkParams} params - The necessary data required to get the current network information.
1074
- * @returns Network details.
1075
- * @throws {@link ErrorType}
1076
- */ async getNetworkInfo(params) {
1077
- const web3Provider = await $bb88265fe45a0393$export$9e1fd9cc88c637a0(this.config, params.provider, {
1078
- allowUnsupportedProvider: true,
1079
- allowMistmatchedChainId: true
1080
- });
1081
- return await $de192de6ef100f9f$export$79f13b4cfaaf0d09(this.config, web3Provider);
1082
- }
1083
- static isWeb3Provider(web3Provider) {
1084
- return $bb88265fe45a0393$export$ebe4804963e71f98(web3Provider);
1085
- }
1086
- /**
1087
- * Estimates the gas to perform an action.
1088
- * @param {GasEstimateParams} params - The params required to calculate a gas estimate
1089
- * @returns The gas estimate for the given action.
1090
- */ async gasEstimate(params) {
1091
- this.readOnlyProviders = await ($0e0060cb42e136d2$export$339cb2be73677b30)(this.config, this.readOnlyProviders);
1092
- return await $2e7bf45a7c9a9570$export$942c8de7174809fc(params, this.readOnlyProviders, this.config);
1093
- }
1094
- }
1095
-
1096
- export { $d85ad1457a3f1a83$export$161d4a74df65fc08 as CHECKOUT_API_BASE_URL, $baec09ddc3013323$export$c06e1e7429de6283 as ChainId, $a8cb37a3fc8eb863$export$1f60ba4ec72508a0 as Checkout, $a8bc256d81a5e2c1$export$e3dc0620abde7f5a as CheckoutErrorType, $de275b98d2b651c3$export$788b1fd17f3dad84 as GasEstimateType, $a47e48dd2c04791b$export$1f05a55fe0680cc7 as NetworkFilterTypes, $a47e48dd2c04791b$export$345c852d0dc8f1df as RPC_URL_MAP, $08d5ddc39acd6833$export$fd9b17d87f4121d2 as TokenFilterTypes, $4f91c5f280efe242$export$a75605c67ea83a5a as WalletFilterTypes, $e768639828688ca3$export$2d7a51a18d87e21d as WalletProviderName };