@imtbl/sdk 0.1.6-alpha → 0.1.7-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.
@@ -2,6 +2,12 @@ import { utils, Contract } from 'ethers';
2
2
  import $7v2Z6$metamaskdetectprovider from '@metamask/detect-provider';
3
3
  import { Web3Provider } from '@ethersproject/providers';
4
4
 
5
+ var Environment;
6
+ (function (Environment) {
7
+ Environment["PRODUCTION"] = "production";
8
+ Environment["SANDBOX"] = "sandbox";
9
+ })(Environment || (Environment = {}));
10
+
5
11
  function $parcel$interopDefault(a) {
6
12
  return a && a.__esModule ? a.default : a;
7
13
  }
@@ -67,6 +73,14 @@ const $762782b6c862d954$export$db5daa1b5156ccfe = [
67
73
  ];
68
74
 
69
75
 
76
+
77
+ const $bc2bfebf768286d3$export$6a2ba3c3bd042990 = {
78
+ baseConfig: {
79
+ environment: (Environment).SANDBOX
80
+ }
81
+ };
82
+
83
+
70
84
  let $d176a05e966364ba$export$3bfad4d03ada24c4;
71
85
  (function(ConnectionProviders) {
72
86
  ConnectionProviders["METAMASK"] = "metamask";
@@ -76,62 +90,126 @@ let $d176a05e966364ba$export$3bfad4d03ada24c4;
76
90
  let $a47e48dd2c04791b$export$c06e1e7429de6283;
77
91
  (function(ChainId) {
78
92
  ChainId[ChainId["ETHEREUM"] = 1] = "ETHEREUM";
79
- ChainId[ChainId["GOERLI"] = 5] = "GOERLI";
80
- ChainId[ChainId["POLYGON"] = 137] = "POLYGON";
93
+ ChainId[ChainId["SEPOLIA"] = 11155111] = "SEPOLIA";
94
+ ChainId[ChainId["IMTBL_ZKEVM_DEVNET"] = 13373] = "IMTBL_ZKEVM_DEVNET";
95
+ ChainId[ChainId["IMTBL_ZKEVM_TESTNET"] = 13372] = "IMTBL_ZKEVM_TESTNET";
96
+ ChainId[ChainId["POLYGON_ZKEVM_TESTNET"] = 1442] = "POLYGON_ZKEVM_TESTNET";
97
+ ChainId[ChainId["POLYGON_ZKEVM"] = 137] = "POLYGON_ZKEVM";
81
98
  })($a47e48dd2c04791b$export$c06e1e7429de6283 || ($a47e48dd2c04791b$export$c06e1e7429de6283 = {}));
82
- const $a47e48dd2c04791b$export$f61f4aaec62f6be9 = {
83
- [$a47e48dd2c04791b$export$c06e1e7429de6283.ETHEREUM]: {
84
- chainIdHex: "0x1",
85
- chainName: "Ethereum",
86
- rpcUrls: [
87
- "https://mainnet.infura.io/v3/"
88
- ],
89
- nativeCurrency: {
90
- name: "Ethereum",
91
- symbol: "ETH",
92
- decimals: 18
93
- },
94
- blockExplorerUrls: [
95
- "https://etherscan.io/"
96
- ]
97
- },
98
- [$a47e48dd2c04791b$export$c06e1e7429de6283.GOERLI]: {
99
- chainIdHex: "0x5",
100
- chainName: "Goerli",
101
- rpcUrls: [
102
- "https://goerli.infura.io/v3/"
103
- ],
104
- nativeCurrency: {
105
- name: "Goerli Eth",
106
- symbol: "ETH",
107
- decimals: 18
108
- },
109
- blockExplorerUrls: [
110
- "https://goerli.etherscan.io/"
111
- ]
112
- },
113
- [$a47e48dd2c04791b$export$c06e1e7429de6283.POLYGON]: {
114
- chainIdHex: "0x89",
115
- chainName: "Polygon",
116
- rpcUrls: [
117
- "https://polygon-rpc.com"
118
- ],
119
- nativeCurrency: {
120
- name: "MATIC",
121
- symbol: "MATIC",
122
- decimals: 18
123
- },
124
- blockExplorerUrls: [
125
- "https://polygonscan.com/"
126
- ]
127
- }
128
- };
99
+ const $a47e48dd2c04791b$export$6f24f3cef7d501c4 = new Map([
100
+ [
101
+ $a47e48dd2c04791b$export$c06e1e7429de6283.ETHEREUM,
102
+ {
103
+ chainIdHex: "0x1",
104
+ chainName: "Ethereum",
105
+ rpcUrls: [
106
+ "https://mainnet.infura.io/v3/"
107
+ ],
108
+ nativeCurrency: {
109
+ name: "Ethereum",
110
+ symbol: "ETH",
111
+ decimals: 18
112
+ },
113
+ blockExplorerUrls: [
114
+ "https://etherscan.io/"
115
+ ]
116
+ }
117
+ ],
118
+ [
119
+ $a47e48dd2c04791b$export$c06e1e7429de6283.IMTBL_ZKEVM_TESTNET,
120
+ {
121
+ chainIdHex: "0x343C",
122
+ chainName: "Immutable zkEVM Testnet",
123
+ rpcUrls: [
124
+ "https://zkevm-rpc.sandbox.x.immutable.com"
125
+ ],
126
+ nativeCurrency: {
127
+ name: "IMX",
128
+ symbol: "IMX",
129
+ decimals: 18
130
+ }
131
+ }
132
+ ],
133
+ [
134
+ $a47e48dd2c04791b$export$c06e1e7429de6283.POLYGON_ZKEVM,
135
+ {
136
+ chainIdHex: "0x89",
137
+ chainName: "Polygon zkEVM",
138
+ rpcUrls: [
139
+ "https://polygon-rpc.com"
140
+ ],
141
+ nativeCurrency: {
142
+ name: "MATIC",
143
+ symbol: "MATIC",
144
+ decimals: 18
145
+ },
146
+ blockExplorerUrls: [
147
+ "https://polygonscan.com/"
148
+ ]
149
+ }
150
+ ]
151
+ ]);
152
+ const $a47e48dd2c04791b$export$3e81fc0987227f10 = new Map([
153
+ [
154
+ $a47e48dd2c04791b$export$c06e1e7429de6283.SEPOLIA,
155
+ {
156
+ chainIdHex: "0xaa36a7",
157
+ chainName: "Sepolia",
158
+ rpcUrls: [
159
+ "https://sepolia.infura.io/v3/"
160
+ ],
161
+ nativeCurrency: {
162
+ name: "Sep Eth",
163
+ symbol: "ETH",
164
+ decimals: 18
165
+ },
166
+ blockExplorerUrls: [
167
+ "https://sepolia.etherscan.io/"
168
+ ]
169
+ }
170
+ ],
171
+ [
172
+ $a47e48dd2c04791b$export$c06e1e7429de6283.IMTBL_ZKEVM_DEVNET,
173
+ {
174
+ chainIdHex: "0x343D",
175
+ chainName: "Immutable zkEVM Devnet",
176
+ rpcUrls: [
177
+ "https://zkevm-rpc.dev.x.immutable.com/"
178
+ ],
179
+ nativeCurrency: {
180
+ name: "IMX",
181
+ symbol: "IMX",
182
+ decimals: 18
183
+ }
184
+ }
185
+ ],
186
+ [
187
+ $a47e48dd2c04791b$export$c06e1e7429de6283.POLYGON_ZKEVM_TESTNET,
188
+ {
189
+ chainIdHex: "0x5A2",
190
+ chainName: "Polygon zkEVM Testnet",
191
+ rpcUrls: [
192
+ "https://rpc.public.zkevm-test.net"
193
+ ],
194
+ nativeCurrency: {
195
+ name: "MATIC",
196
+ symbol: "MATIC",
197
+ decimals: 18
198
+ },
199
+ blockExplorerUrls: [
200
+ "https://testnet-zkevm.polygonscan.com"
201
+ ]
202
+ }
203
+ ]
204
+ ]);
129
205
  let $a47e48dd2c04791b$export$1f05a55fe0680cc7;
130
206
  (function(NetworkFilterTypes) {
131
207
  NetworkFilterTypes["ALL"] = "all";
132
208
  })($a47e48dd2c04791b$export$1f05a55fe0680cc7 || ($a47e48dd2c04791b$export$1f05a55fe0680cc7 = {}));
133
209
 
134
210
 
211
+ // TODO: fix circular dependency
212
+ // eslint-disable-next-line import/no-cycle
135
213
  let $08d5ddc39acd6833$export$fd9b17d87f4121d2;
136
214
  (function(TokenFilterTypes) {
137
215
  TokenFilterTypes["SWAP"] = "swap";
@@ -142,12 +220,15 @@ let $08d5ddc39acd6833$export$fd9b17d87f4121d2;
142
220
 
143
221
 
144
222
 
145
- const $4f91c5f280efe242$export$a130407f3423b97d = {
146
- CHECK_CONNECTION: "eth_accounts",
147
- CONNECT: "eth_requestAccounts",
148
- ADD_NETWORK: "wallet_addEthereumChain",
149
- SWITCH_NETWORK: "wallet_switchEthereumChain"
150
- };
223
+ // TODO: fix circular dependency
224
+ // eslint-disable-next-line import/no-cycle
225
+ let $4f91c5f280efe242$export$35b06f0d33f57e26;
226
+ (function(WalletAction) {
227
+ WalletAction["CHECK_CONNECTION"] = "eth_accounts";
228
+ WalletAction["CONNECT"] = "eth_requestAccounts";
229
+ WalletAction["ADD_NETWORK"] = "wallet_addEthereumChain";
230
+ WalletAction["SWITCH_NETWORK"] = "wallet_switchEthereumChain";
231
+ })($4f91c5f280efe242$export$35b06f0d33f57e26 || ($4f91c5f280efe242$export$35b06f0d33f57e26 = {}));
151
232
  let $4f91c5f280efe242$export$a75605c67ea83a5a;
152
233
  (function(WalletFilterTypes) {
153
234
  WalletFilterTypes["ALL"] = "all";
@@ -156,12 +237,6 @@ let $4f91c5f280efe242$export$a75605c67ea83a5a;
156
237
  })($4f91c5f280efe242$export$a75605c67ea83a5a || ($4f91c5f280efe242$export$a75605c67ea83a5a = {}));
157
238
 
158
239
 
159
- let $090d3502d165f17d$export$c5ab8fbcabac8c11;
160
- (function(SupportedFiatCurrencies) {
161
- SupportedFiatCurrencies["USD"] = "USD";
162
- })($090d3502d165f17d$export$c5ab8fbcabac8c11 || ($090d3502d165f17d$export$c5ab8fbcabac8c11 = {}));
163
-
164
-
165
240
 
166
241
 
167
242
  /**
@@ -179,9 +254,6 @@ let $090d3502d165f17d$export$c5ab8fbcabac8c11;
179
254
  CheckoutErrorType["PROVIDER_REQUEST_FAILED_ERROR"] = "PROVIDER_REQUEST_FAILED_ERROR";
180
255
  CheckoutErrorType["USER_REJECTED_REQUEST_ERROR"] = "USER_REJECTED_REQUEST_ERROR";
181
256
  CheckoutErrorType["TRANSACTION_ERROR"] = "TRANSACTION_ERROR";
182
- CheckoutErrorType["FIAT_CONVERSION_ERROR"] = "FIAT_CONVERSION_ERROR";
183
- CheckoutErrorType["TOKEN_NOT_SUPPORTED_ERROR"] = "TOKEN_NOT_SUPPORTED_ERROR";
184
- CheckoutErrorType["FIAT_CURRENCY_NOT_SUPPORTED_ERROR"] = "FIAT_CURRENCY_NOT_SUPPORTED_ERROR";
185
257
  })($a8bc256d81a5e2c1$export$e3dc0620abde7f5a || ($a8bc256d81a5e2c1$export$e3dc0620abde7f5a = {}));
186
258
  class $a8bc256d81a5e2c1$export$b722478a3cbfa3bc extends Error {
187
259
  constructor(message, type, data){
@@ -221,6 +293,24 @@ const $a8bc256d81a5e2c1$export$bacc563de539c6c3 = async (fn, customError)=>{
221
293
 
222
294
 
223
295
 
296
+ async function $c99672cf2294e839$var$getMetaMaskProvider() {
297
+ const provider = await ($a8bc256d81a5e2c1$export$bacc563de539c6c3)(async ()=>await ($7v2Z6$metamaskdetectprovider)(), {
298
+ type: ($a8bc256d81a5e2c1$export$e3dc0620abde7f5a).METAMASK_PROVIDER_ERROR
299
+ });
300
+ if (!provider || !provider.request) throw new ($a8bc256d81a5e2c1$export$b722478a3cbfa3bc)("No MetaMask provider installed.", ($a8bc256d81a5e2c1$export$e3dc0620abde7f5a).METAMASK_PROVIDER_ERROR);
301
+ return new (Web3Provider)(provider);
302
+ }
303
+ async function $c99672cf2294e839$var$getWalletProviderForPreference(providerPreference) {
304
+ let web3Provider = null;
305
+ switch(providerPreference){
306
+ case ($d176a05e966364ba$export$3bfad4d03ada24c4).METAMASK:
307
+ web3Provider = await $c99672cf2294e839$var$getMetaMaskProvider();
308
+ break;
309
+ default:
310
+ throw new ($a8bc256d81a5e2c1$export$b722478a3cbfa3bc)("Provider preference is not supported", ($a8bc256d81a5e2c1$export$e3dc0620abde7f5a).PROVIDER_PREFERENCE_ERROR);
311
+ }
312
+ return web3Provider;
313
+ }
224
314
  async function $c99672cf2294e839$export$2d040992269b4717(providerPreference) {
225
315
  const provider = await $c99672cf2294e839$var$getWalletProviderForPreference(providerPreference);
226
316
  if (!provider.provider?.request) throw new ($a8bc256d81a5e2c1$export$b722478a3cbfa3bc)("Incompatible provider", ($a8bc256d81a5e2c1$export$e3dc0620abde7f5a).PROVIDER_REQUEST_MISSING_ERROR, {
@@ -229,12 +319,12 @@ async function $c99672cf2294e839$export$2d040992269b4717(providerPreference) {
229
319
  let accounts = [];
230
320
  try {
231
321
  accounts = await provider.provider.request({
232
- method: (0, $4f91c5f280efe242$export$a130407f3423b97d).CHECK_CONNECTION,
322
+ method: (0, $4f91c5f280efe242$export$35b06f0d33f57e26).CHECK_CONNECTION,
233
323
  params: []
234
324
  });
235
325
  } catch (err) {
236
- throw new ($a8bc256d81a5e2c1$export$b722478a3cbfa3bc)(`Check wallet connection request failed`, ($a8bc256d81a5e2c1$export$e3dc0620abde7f5a).PROVIDER_REQUEST_FAILED_ERROR, {
237
- rpcMethod: ($4f91c5f280efe242$export$a130407f3423b97d).CHECK_CONNECTION
326
+ throw new ($a8bc256d81a5e2c1$export$b722478a3cbfa3bc)("Check wallet connection request failed", ($a8bc256d81a5e2c1$export$e3dc0620abde7f5a).PROVIDER_REQUEST_FAILED_ERROR, {
327
+ rpcMethod: ($4f91c5f280efe242$export$35b06f0d33f57e26).CHECK_CONNECTION
238
328
  });
239
329
  }
240
330
  // accounts[0] will have the active account if connected.
@@ -251,7 +341,7 @@ async function $c99672cf2294e839$export$fba2f6c3656e07c1(params) {
251
341
  });
252
342
  // this makes the request to the wallet to connect i.e request eth accounts ('eth_requestAccounts')
253
343
  await web3Provider.provider.request({
254
- method: ($4f91c5f280efe242$export$a130407f3423b97d).CONNECT,
344
+ method: ($4f91c5f280efe242$export$35b06f0d33f57e26).CONNECT,
255
345
  params: []
256
346
  });
257
347
  }, {
@@ -259,43 +349,57 @@ async function $c99672cf2294e839$export$fba2f6c3656e07c1(params) {
259
349
  });
260
350
  return web3Provider;
261
351
  }
262
- async function $c99672cf2294e839$var$getWalletProviderForPreference(providerPreference) {
263
- let web3Provider = null;
264
- switch(providerPreference){
265
- case ($d176a05e966364ba$export$3bfad4d03ada24c4).METAMASK:
266
- web3Provider = await $c99672cf2294e839$var$getMetaMaskProvider();
267
- break;
268
- default:
269
- throw new ($a8bc256d81a5e2c1$export$b722478a3cbfa3bc)("Provider preference is not supported", ($a8bc256d81a5e2c1$export$e3dc0620abde7f5a).PROVIDER_PREFERENCE_ERROR);
270
- }
271
- return web3Provider;
272
- }
273
- async function $c99672cf2294e839$var$getMetaMaskProvider() {
274
- const provider = await ($a8bc256d81a5e2c1$export$bacc563de539c6c3)(async ()=>{
275
- return await ($7v2Z6$metamaskdetectprovider)();
276
- }, {
277
- type: ($a8bc256d81a5e2c1$export$e3dc0620abde7f5a).METAMASK_PROVIDER_ERROR
278
- });
279
- if (!provider || !provider.request) throw new ($a8bc256d81a5e2c1$export$b722478a3cbfa3bc)("No MetaMask provider installed.", ($a8bc256d81a5e2c1$export$e3dc0620abde7f5a).METAMASK_PROVIDER_ERROR);
280
- return new (Web3Provider)(provider);
281
- }
282
352
 
283
353
 
284
354
  var $497c134ecbc8a50f$exports = {};
285
- $497c134ecbc8a50f$exports = JSON.parse('[{"chainId":1},{"chainId":137}]');
355
+ $497c134ecbc8a50f$exports = JSON.parse('[{"chainId":1},{"chainId":11155111},{"chainId":13372},{"chainId":13373},{"chainId":1442},{"chainId":137}]');
286
356
 
287
357
 
288
358
  const $de192de6ef100f9f$var$UNRECOGNISED_CHAIN_ERROR_CODE = 4902; // error code (MetaMask)
289
- async function $de192de6ef100f9f$export$79f13b4cfaaf0d09(provider) {
359
+ // these functions should not be exported. These functions should be used as part of an exported function e.g switchWalletNetwork() above.
360
+ // make sure to check if(provider.provider?.request) in the exported function and throw an error
361
+ // eslint-disable-next-line consistent-return
362
+ async function $de192de6ef100f9f$var$switchNetworkInWallet(networkMap, provider, chainId) {
363
+ if (provider.provider?.request) return await provider.provider.request({
364
+ method: ($4f91c5f280efe242$export$35b06f0d33f57e26).SWITCH_NETWORK,
365
+ params: [
366
+ {
367
+ chainId: networkMap.get(chainId)?.chainIdHex
368
+ }
369
+ ]
370
+ });
371
+ }
372
+ // TODO: Should these functions always return something?
373
+ // eslint-disable-next-line consistent-return
374
+ async function $de192de6ef100f9f$var$addNetworkToWallet(networkMap, provider, chainId) {
375
+ if (provider.provider?.request) {
376
+ const networkDetails = networkMap.get(chainId);
377
+ const addNetwork = {
378
+ chainId: networkDetails?.chainIdHex,
379
+ chainName: networkDetails?.chainName,
380
+ rpcUrls: networkDetails?.rpcUrls,
381
+ nativeCurrency: networkDetails?.nativeCurrency,
382
+ blockExplorerUrls: networkDetails?.blockExplorerUrls
383
+ };
384
+ return await provider.provider.request({
385
+ method: ($4f91c5f280efe242$export$35b06f0d33f57e26).ADD_NETWORK,
386
+ params: [
387
+ addNetwork
388
+ ]
389
+ });
390
+ }
391
+ }
392
+ async function $de192de6ef100f9f$export$79f13b4cfaaf0d09(config, provider) {
393
+ const { networkMap: networkMap } = config;
290
394
  return ($a8bc256d81a5e2c1$export$bacc563de539c6c3)(async ()=>{
291
395
  const network = await provider.getNetwork();
292
- if (!Object.values(($a47e48dd2c04791b$export$c06e1e7429de6283)).includes(network.chainId)) // return empty details
396
+ if (!Array.from(networkMap.keys()).includes(network.chainId)) // return empty details
293
397
  return {
294
398
  chainId: network.chainId,
295
399
  name: network.name,
296
400
  isSupported: false
297
401
  };
298
- const chainIdNetworkInfo = ($a47e48dd2c04791b$export$f61f4aaec62f6be9)[network.chainId];
402
+ const chainIdNetworkInfo = networkMap.get(network.chainId);
299
403
  return {
300
404
  name: chainIdNetworkInfo.chainName,
301
405
  chainId: parseInt(chainIdNetworkInfo.chainIdHex, 16),
@@ -306,18 +410,20 @@ async function $de192de6ef100f9f$export$79f13b4cfaaf0d09(provider) {
306
410
  type: ($a8bc256d81a5e2c1$export$e3dc0620abde7f5a).GET_NETWORK_INFO_ERROR
307
411
  });
308
412
  }
309
- async function $de192de6ef100f9f$export$b827d9418aeb5dbd(providerPreference, provider, chainId) {
413
+ async function $de192de6ef100f9f$export$b827d9418aeb5dbd(config, providerPreference, provider, chainId) {
310
414
  let currentProvider = provider;
415
+ const { networkMap: networkMap } = config;
311
416
  if (!Object.values(($a47e48dd2c04791b$export$c06e1e7429de6283)).includes(chainId)) throw new ($a8bc256d81a5e2c1$export$b722478a3cbfa3bc)(`Chain:${chainId} is not a supported chain`, ($a8bc256d81a5e2c1$export$e3dc0620abde7f5a).CHAIN_NOT_SUPPORTED_ERROR);
312
417
  if (!currentProvider || !currentProvider.provider?.request) throw new ($a8bc256d81a5e2c1$export$b722478a3cbfa3bc)("Incompatible provider", ($a8bc256d81a5e2c1$export$e3dc0620abde7f5a).PROVIDER_REQUEST_MISSING_ERROR, {
313
- details: `Unsupported provider`
418
+ details: "Unsupported provider"
314
419
  });
315
420
  // WT-1146 - Refer to the README in this folder for explantion on the switch network flow
316
421
  try {
317
- await $de192de6ef100f9f$var$switchNetworkInWallet(currentProvider, chainId);
422
+ await $de192de6ef100f9f$var$switchNetworkInWallet(networkMap, currentProvider, chainId);
318
423
  } catch (err) {
319
424
  if (err.code === $de192de6ef100f9f$var$UNRECOGNISED_CHAIN_ERROR_CODE) try {
320
- await $de192de6ef100f9f$var$addNetworkToWallet(currentProvider, chainId);
425
+ await $de192de6ef100f9f$var$addNetworkToWallet(networkMap, currentProvider, chainId);
426
+ // eslint-disable-next-line @typescript-eslint/no-shadow
321
427
  } catch (err) {
322
428
  throw new ($a8bc256d81a5e2c1$export$b722478a3cbfa3bc)("User cancelled add network request", ($a8bc256d81a5e2c1$export$e3dc0620abde7f5a).USER_REJECTED_REQUEST_ERROR);
323
429
  }
@@ -330,17 +436,18 @@ async function $de192de6ef100f9f$export$b827d9418aeb5dbd(providerPreference, pro
330
436
  throw new ($a8bc256d81a5e2c1$export$b722478a3cbfa3bc)("User cancelled switch network request", ($a8bc256d81a5e2c1$export$e3dc0620abde7f5a).USER_REJECTED_REQUEST_ERROR);
331
437
  // we can assume that if the above succeeds then user has successfully
332
438
  // switched to the network specified
333
- const newNetwork = ($a47e48dd2c04791b$export$f61f4aaec62f6be9)[chainId];
439
+ const newNetwork = networkMap.get(chainId);
334
440
  return {
335
441
  network: {
336
- name: newNetwork.chainName,
337
- chainId: parseInt(newNetwork.chainIdHex, 16),
338
- nativeCurrency: newNetwork.nativeCurrency
442
+ name: newNetwork?.chainName,
443
+ chainId: parseInt(newNetwork?.chainIdHex ?? "", 16),
444
+ nativeCurrency: newNetwork?.nativeCurrency
339
445
  },
340
446
  provider: currentProvider
341
447
  };
342
448
  }
343
- async function $de192de6ef100f9f$export$3043f6442a9ef563({ type: type = ($a47e48dd2c04791b$export$1f05a55fe0680cc7).ALL , exclude: exclude }) {
449
+ async function $de192de6ef100f9f$export$3043f6442a9ef563(config, { type: type = ($a47e48dd2c04791b$export$1f05a55fe0680cc7).ALL , exclude: exclude }) {
450
+ const { networkMap: networkMap } = config;
344
451
  const list = ((/*@__PURE__*/$parcel$interopDefault($497c134ecbc8a50f$exports))).filter((network)=>{
345
452
  const allowAllTokens = type === ($a47e48dd2c04791b$export$1f05a55fe0680cc7).ALL;
346
453
  const networkNotExcluded = !(exclude || []).map((exc)=>exc.chainId).includes(network.chainId);
@@ -348,8 +455,8 @@ async function $de192de6ef100f9f$export$3043f6442a9ef563({ type: type = ($a47e48
348
455
  });
349
456
  const allowedNetworks = [];
350
457
  list.forEach((element)=>{
351
- const newNetwork = ($a47e48dd2c04791b$export$f61f4aaec62f6be9)[element.chainId];
352
- allowedNetworks.push({
458
+ const newNetwork = networkMap.get(element.chainId);
459
+ if (newNetwork) allowedNetworks.push({
353
460
  name: newNetwork.chainName,
354
461
  chainId: parseInt(newNetwork.chainIdHex, 16),
355
462
  nativeCurrency: newNetwork.nativeCurrency,
@@ -360,64 +467,35 @@ async function $de192de6ef100f9f$export$3043f6442a9ef563({ type: type = ($a47e48
360
467
  networks: allowedNetworks
361
468
  };
362
469
  }
363
- // these functions should not be exported. These functions should be used as part of an exported function e.g switchWalletNetwork() above.
364
- // make sure to check if(provider.provider?.request) in the exported function and throw an error
365
- async function $de192de6ef100f9f$var$switchNetworkInWallet(provider, chainId) {
366
- if (provider.provider?.request) return await provider.provider.request({
367
- method: ($4f91c5f280efe242$export$a130407f3423b97d).SWITCH_NETWORK,
368
- params: [
369
- {
370
- chainId: ($a47e48dd2c04791b$export$f61f4aaec62f6be9)[chainId].chainIdHex
371
- }
372
- ]
373
- });
374
- }
375
- async function $de192de6ef100f9f$var$addNetworkToWallet(provider, chainId) {
376
- if (provider.provider?.request) {
377
- const addNetwork = {
378
- chainId: ($a47e48dd2c04791b$export$f61f4aaec62f6be9)[chainId].chainIdHex,
379
- chainName: ($a47e48dd2c04791b$export$f61f4aaec62f6be9)[chainId].chainName,
380
- rpcUrls: ($a47e48dd2c04791b$export$f61f4aaec62f6be9)[chainId].rpcUrls,
381
- nativeCurrency: ($a47e48dd2c04791b$export$f61f4aaec62f6be9)[chainId].nativeCurrency,
382
- blockExplorerUrls: ($a47e48dd2c04791b$export$f61f4aaec62f6be9)[chainId].blockExplorerUrls
383
- };
384
- return await provider.provider.request({
385
- method: ($4f91c5f280efe242$export$a130407f3423b97d).ADD_NETWORK,
386
- params: [
387
- addNetwork
388
- ]
389
- });
390
- }
391
- }
392
470
 
393
471
 
394
472
 
395
473
 
396
474
 
397
475
  var $cda6003506e4182e$exports = {};
398
- $cda6003506e4182e$exports = JSON.parse("[{\"address\":\"0x7D1AfA7B718fb893dB30A3aBc0Cfc608AaCfeBB0\",\"chainId\":137,\"name\":\"Matic\",\"symbol\":\"MATIC\",\"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 38.4 33.5' style='enable-background:new 0 0 38.4 33.5;' xml:space='preserve'%3E%3Cstyle type='text/css'%3E .st0%7Bfill:%238247E5;%7D%0A%3C/style%3E%3Cg%3E%3Cpath class='st0' d='M29,10.2c-0.7-0.4-1.6-0.4-2.4,0L21,13.5l-3.8,2.1l-5.5,3.3c-0.7,0.4-1.6,0.4-2.4,0L5,16.3 c-0.7-0.4-1.2-1.2-1.2-2.1v-5c0-0.8,0.4-1.6,1.2-2.1l4.3-2.5c0.7-0.4,1.6-0.4,2.4,0L16,7.2c0.7,0.4,1.2,1.2,1.2,2.1v3.3l3.8-2.2V7 c0-0.8-0.4-1.6-1.2-2.1l-8-4.7c-0.7-0.4-1.6-0.4-2.4,0L1.2,5C0.4,5.4,0,6.2,0,7v9.4c0,0.8,0.4,1.6,1.2,2.1l8.1,4.7 c0.7,0.4,1.6,0.4,2.4,0l5.5-3.2l3.8-2.2l5.5-3.2c0.7-0.4,1.6-0.4,2.4,0l4.3,2.5c0.7,0.4,1.2,1.2,1.2,2.1v5c0,0.8-0.4,1.6-1.2,2.1 L29,28.8c-0.7,0.4-1.6,0.4-2.4,0l-4.3-2.5c-0.7-0.4-1.2-1.2-1.2-2.1V21l-3.8,2.2v3.3c0,0.8,0.4,1.6,1.2,2.1l8.1,4.7 c0.7,0.4,1.6,0.4,2.4,0l8.1-4.7c0.7-0.4,1.2-1.2,1.2-2.1V17c0-0.8-0.4-1.6-1.2-2.1L29,10.2z'/%3E%3C/g%3E%3C/svg%3E%0A\",\"tokenFeatures\":[\"swap\",\"bridge\"]},{\"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\",\"chainId\":1,\"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\"]},{\"address\":\"0x7D1AfA7B718fb893dB30A3aBc0Cfc608AaCfeBB0\",\"chainId\":1,\"name\":\"Matic\",\"symbol\":\"MATIC\",\"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 38.4 33.5' style='enable-background:new 0 0 38.4 33.5;' xml:space='preserve'%3E%3Cstyle type='text/css'%3E .st0%7Bfill:%238247E5;%7D%0A%3C/style%3E%3Cg%3E%3Cpath class='st0' d='M29,10.2c-0.7-0.4-1.6-0.4-2.4,0L21,13.5l-3.8,2.1l-5.5,3.3c-0.7,0.4-1.6,0.4-2.4,0L5,16.3 c-0.7-0.4-1.2-1.2-1.2-2.1v-5c0-0.8,0.4-1.6,1.2-2.1l4.3-2.5c0.7-0.4,1.6-0.4,2.4,0L16,7.2c0.7,0.4,1.2,1.2,1.2,2.1v3.3l3.8-2.2V7 c0-0.8-0.4-1.6-1.2-2.1l-8-4.7c-0.7-0.4-1.6-0.4-2.4,0L1.2,5C0.4,5.4,0,6.2,0,7v9.4c0,0.8,0.4,1.6,1.2,2.1l8.1,4.7 c0.7,0.4,1.6,0.4,2.4,0l5.5-3.2l3.8-2.2l5.5-3.2c0.7-0.4,1.6-0.4,2.4,0l4.3,2.5c0.7,0.4,1.2,1.2,1.2,2.1v5c0,0.8-0.4,1.6-1.2,2.1 L29,28.8c-0.7,0.4-1.6,0.4-2.4,0l-4.3-2.5c-0.7-0.4-1.2-1.2-1.2-2.1V21l-3.8,2.2v3.3c0,0.8,0.4,1.6,1.2,2.1l8.1,4.7 c0.7,0.4,1.6,0.4,2.4,0l8.1-4.7c0.7-0.4,1.2-1.2,1.2-2.1V17c0-0.8-0.4-1.6-1.2-2.1L29,10.2z'/%3E%3C/g%3E%3C/svg%3E%0A\",\"tokenFeatures\":[\"swap\",\"bridge\"]},{\"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\",\"chainId\":5,\"tokenFeatures\":[\"swap\",\"bridge\"]},{\"address\":\"0x1facdd0165489f373255a90304650e15481b2c85\",\"chainId\":5,\"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\"]},{\"address\":\"0x123456789\",\"chainId\":5,\"name\":\"Swap Coin\",\"symbol\":\"SWC\",\"decimals\":18,\"tokenFeatures\":[\"swap\",\"fakeFeature\"]},{\"address\":\"0x123456789\",\"chainId\":5,\"name\":\"Bridge Coin\",\"symbol\":\"BDC\",\"decimals\":18,\"tokenFeatures\":[\"bridge\",\"fakeFeature\"]}]");
476
+ $cda6003506e4182e$exports = JSON.parse("[{\"chainId\":13373,\"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\":13373,\"name\":\"FUN token\",\"address\":\"0xd8f1D29a1572FbCeF0B0C9541E50637Ad8804F21\",\"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\":13373,\"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\":13373,\"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\",\"bridge\"]},{\"chainId\":11155111,\"name\":\"Immutable Test token\",\"address\":\"0x40cAdc2BC5d25B9c669B8E09c68eCcb9B80873f7\",\"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\":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\"]}]");
399
477
 
400
478
 
401
- const $efe60cea83bfc4e8$var$filterTokenList = function({ type: type , chainId: chainId , exclude: exclude }) {
402
- return ((/*@__PURE__*/$parcel$interopDefault($cda6003506e4182e$exports))).filter((token)=>{
479
+ const $efe60cea83bfc4e8$var$filterTokenList = ({ type: type , chainId: chainId , exclude: exclude })=>((/*@__PURE__*/$parcel$interopDefault($cda6003506e4182e$exports))).filter((token)=>{
403
480
  const skipChainIdCheck = !chainId;
404
- const chainIdMatches = token.chainId == chainId;
481
+ const chainIdMatches = token.chainId === chainId;
405
482
  const tokenNotExcluded = !exclude?.map((excludeToken)=>excludeToken.address).includes(token.address || "");
406
483
  const allowAllTokens = type === ($08d5ddc39acd6833$export$fd9b17d87f4121d2).ALL;
407
484
  const tokenAllowedForType = token.tokenFeatures.includes(type);
408
485
  return (skipChainIdCheck || chainIdMatches) && tokenNotExcluded && (allowAllTokens || tokenAllowedForType);
409
486
  });
410
- };
411
- const $efe60cea83bfc4e8$export$473cec51305fdae8 = async function({ type: type = ($08d5ddc39acd6833$export$fd9b17d87f4121d2).ALL , chainId: chainId , exclude: exclude }) {
412
- // todo:For API call, use the CheckoutError with errorType:API_CALL_ERROR?? or any other
487
+ const $efe60cea83bfc4e8$export$473cec51305fdae8 = async ({ type: type = ($08d5ddc39acd6833$export$fd9b17d87f4121d2).ALL , chainId: chainId , exclude: exclude })=>{
413
488
  const filteredTokenList = $efe60cea83bfc4e8$var$filterTokenList({
414
489
  type: type,
415
490
  chainId: chainId,
416
491
  exclude: exclude
417
- }).map((token)=>{
418
- const { chainId: chainId , tokenFeatures: tokenFeatures , ...tokenInfo } = token;
419
- return tokenInfo;
420
- });
492
+ }).map((token)=>({
493
+ name: token.name,
494
+ symbol: token.symbol,
495
+ decimals: token.decimals,
496
+ address: token.address,
497
+ icon: token.icon
498
+ }));
421
499
  return {
422
500
  tokens: filteredTokenList
423
501
  };
@@ -426,9 +504,8 @@ const $efe60cea83bfc4e8$export$473cec51305fdae8 = async function({ type: type =
426
504
 
427
505
 
428
506
 
429
- const $1564e43dde50bb61$export$df96cd8d56be0ab1 = async (provider, walletAddress)=>{
430
- return await ($a8bc256d81a5e2c1$export$bacc563de539c6c3)(async ()=>{
431
- const networkInfo = await ($de192de6ef100f9f$export$79f13b4cfaaf0d09)(provider);
507
+ const $1564e43dde50bb61$export$df96cd8d56be0ab1 = async (config, provider, walletAddress)=>await ($a8bc256d81a5e2c1$export$bacc563de539c6c3)(async ()=>{
508
+ const networkInfo = await ($de192de6ef100f9f$export$79f13b4cfaaf0d09)(config, provider);
432
509
  if (!networkInfo.isSupported) throw new ($a8bc256d81a5e2c1$export$b722478a3cbfa3bc)(`Chain:${networkInfo.chainId} is not a supported chain`, ($a8bc256d81a5e2c1$export$e3dc0620abde7f5a).CHAIN_NOT_SUPPORTED_ERROR, {
433
510
  chainName: networkInfo.name
434
511
  });
@@ -441,7 +518,6 @@ const $1564e43dde50bb61$export$df96cd8d56be0ab1 = async (provider, walletAddress
441
518
  }, {
442
519
  type: ($a8bc256d81a5e2c1$export$e3dc0620abde7f5a).GET_BALANCE_ERROR
443
520
  });
444
- };
445
521
  async function $1564e43dde50bb61$export$60e0fe116a0e6ed0(provider, walletAddress, contractAddress) {
446
522
  return await ($a8bc256d81a5e2c1$export$bacc563de539c6c3)(async ()=>{
447
523
  const contract = new (Contract)(contractAddress, JSON.stringify(($762782b6c862d954$export$db5daa1b5156ccfe)), provider);
@@ -464,7 +540,7 @@ async function $1564e43dde50bb61$export$60e0fe116a0e6ed0(provider, walletAddress
464
540
  type: ($a8bc256d81a5e2c1$export$e3dc0620abde7f5a).GET_ERC20_BALANCE_ERROR
465
541
  });
466
542
  }
467
- const $1564e43dde50bb61$export$fee49741664a4d7e = async (provider, walletAddress, chainId)=>{
543
+ const $1564e43dde50bb61$export$fee49741664a4d7e = async (config, provider, walletAddress, chainId)=>{
468
544
  if (!Object.values(($a47e48dd2c04791b$export$c06e1e7429de6283)).includes(chainId)) throw new ($a8bc256d81a5e2c1$export$b722478a3cbfa3bc)(`ChainId ${chainId} is not supported`, ($a8bc256d81a5e2c1$export$e3dc0620abde7f5a).CHAIN_NOT_SUPPORTED_ERROR);
469
545
  if (!provider.provider?.request) throw new ($a8bc256d81a5e2c1$export$b722478a3cbfa3bc)("provider object is missing request function", ($a8bc256d81a5e2c1$export$e3dc0620abde7f5a).PROVIDER_REQUEST_MISSING_ERROR);
470
546
  const tokenList = await ($efe60cea83bfc4e8$export$473cec51305fdae8)({
@@ -472,7 +548,7 @@ const $1564e43dde50bb61$export$fee49741664a4d7e = async (provider, walletAddress
472
548
  chainId: chainId
473
549
  });
474
550
  const allBalancePromises = [];
475
- allBalancePromises.push($1564e43dde50bb61$export$df96cd8d56be0ab1(provider, walletAddress));
551
+ allBalancePromises.push($1564e43dde50bb61$export$df96cd8d56be0ab1(config, provider, walletAddress));
476
552
  tokenList.tokens.filter((token)=>token.address).forEach((token)=>allBalancePromises.push($1564e43dde50bb61$export$60e0fe116a0e6ed0(provider, walletAddress, token.address ?? "")));
477
553
  const balanceResults = await Promise.allSettled(allBalancePromises);
478
554
  const getBalanceResults = balanceResults.filter((result)=>result.status === "fulfilled").map((fulfilledResult)=>fulfilledResult.value);
@@ -530,13 +606,39 @@ const $dbe95599a4661140$export$8e0e7ffc78696d30 = async (params)=>{
530
606
 
531
607
 
532
608
 
609
+
610
+
611
+
612
+ class $4013c5c91bb535f6$export$47a4ed4a38b9eecf extends Error {
613
+ constructor(message){
614
+ super(message);
615
+ this.message = message;
616
+ }
617
+ }
618
+ class $4013c5c91bb535f6$export$4823433c4a67bbc6 {
619
+ constructor(config){
620
+ // validate input
621
+ if (!Object.values((Environment)).includes(config.baseConfig.environment)) throw new $4013c5c91bb535f6$export$47a4ed4a38b9eecf("Invalid checkout configuration of environment");
622
+ this.environment = config.baseConfig.environment;
623
+ this.networkMap = config.baseConfig.environment === (Environment).PRODUCTION ? ($a47e48dd2c04791b$export$6f24f3cef7d501c4) : ($a47e48dd2c04791b$export$3e81fc0987227f10);
624
+ }
625
+ }
626
+
627
+
628
+
629
+
533
630
  class $a8cb37a3fc8eb863$export$1f60ba4ec72508a0 {
631
+ constructor(config = ($bc2bfebf768286d3$export$6a2ba3c3bd042990)){
632
+ this.config = new ($4013c5c91bb535f6$export$4823433c4a67bbc6)(config);
633
+ }
534
634
  /**
535
- * Check if a wallet is connected to the current application without requesting permission from the wallet and hence triggering a connect popup.
635
+ * Check if a wallet is connected to the current application
636
+ * without requesting permission from the wallet and hence triggering a connect popup.
536
637
  * @param {CheckConnectionParams} params - The necessary data required to verify a wallet connection status.
537
638
  * @returns Wallet connection status details.
538
639
  * @throws {@link ErrorType}
539
- */ async checkIsWalletConnected(params) {
640
+ */ // eslint-disable-next-line class-methods-use-this
641
+ async checkIsWalletConnected(params) {
540
642
  return $c99672cf2294e839$export$2d040992269b4717(params.providerPreference);
541
643
  }
542
644
  /**
@@ -547,7 +649,7 @@ class $a8cb37a3fc8eb863$export$1f60ba4ec72508a0 {
547
649
  */ async connect(params) {
548
650
  this.providerPreference = params.providerPreference;
549
651
  const provider = await $c99672cf2294e839$export$fba2f6c3656e07c1(params);
550
- const networkInfo = await $de192de6ef100f9f$export$79f13b4cfaaf0d09(provider);
652
+ const networkInfo = await $de192de6ef100f9f$export$79f13b4cfaaf0d09(this.config, provider);
551
653
  return {
552
654
  provider: provider,
553
655
  network: networkInfo
@@ -559,25 +661,28 @@ class $a8cb37a3fc8eb863$export$1f60ba4ec72508a0 {
559
661
  * @returns The new network information.
560
662
  * @throws {@link ErrorType}
561
663
  */ async switchNetwork(params) {
562
- if (!this.providerPreference) throw new ($a8bc256d81a5e2c1$export$b722478a3cbfa3bc)(`connect should be called before switchNetwork to set the provider preference`, ($a8bc256d81a5e2c1$export$e3dc0620abde7f5a).PROVIDER_PREFERENCE_ERROR);
563
- return await $de192de6ef100f9f$export$b827d9418aeb5dbd(this.providerPreference, params.provider, params.chainId);
664
+ if (!this.providerPreference) throw new ($a8bc256d81a5e2c1$export$b722478a3cbfa3bc)("connect should be called before switchNetwork to set the provider preference", ($a8bc256d81a5e2c1$export$e3dc0620abde7f5a).PROVIDER_PREFERENCE_ERROR);
665
+ return await $de192de6ef100f9f$export$b827d9418aeb5dbd(this.config, this.providerPreference, params.provider, params.chainId);
564
666
  }
565
667
  /**
566
- * Fetch the balance of the native token of the current connected network or, if a contract address is provided, it will return the balance of that ERC20 token. For example, if the wallet is connected to the Ethereum Mainnet then the function gets the wallet ETH L1 balance.
668
+ * Fetch the balance of the native token of the current connected network or,
669
+ * if a contract address is provided, it will return the balance of that ERC20 token. For example,
670
+ * if the wallet is connected to the Ethereum Mainnet then the function gets the wallet ETH L1 balance.
567
671
  * @param {GetBalanceParams} params - The necessary data required to fetch the wallet balance.
568
672
  * @returns Native token balance for the given wallet.
569
673
  * @throws {@link ErrorType}
570
674
  */ async getBalance(params) {
571
- if (!params.contractAddress || params.contractAddress === "") return await $1564e43dde50bb61$export$df96cd8d56be0ab1(params.provider, params.walletAddress);
675
+ if (!params.contractAddress || params.contractAddress === "") return await $1564e43dde50bb61$export$df96cd8d56be0ab1(this.config, params.provider, params.walletAddress);
572
676
  return await $1564e43dde50bb61$export$60e0fe116a0e6ed0(params.provider, params.walletAddress, params.contractAddress);
573
677
  }
574
678
  /**
575
- * Fetch all available balances (ERC20 & Native) of the current connected network of the given wallet. It will loop through the list of allowed tokens and check for balance on each one.
679
+ * Fetch all available balances (ERC20 & Native) of the current connected network of the given wallet.
680
+ * It will loop through the list of allowed tokens and check for balance on each one.
576
681
  * @param {GetAllBalancesParams} params - The necessary data required to fetch all the wallet balances.
577
682
  * @returns List of tokens balance for the given wallet.
578
683
  * @throws {@link ErrorType}
579
684
  */ async getAllBalances(params) {
580
- return $1564e43dde50bb61$export$fee49741664a4d7e(params.provider, params.walletAddress, params.chainId);
685
+ return $1564e43dde50bb61$export$fee49741664a4d7e(this.config, params.provider, params.walletAddress, params.chainId);
581
686
  }
582
687
  /**
583
688
  * Fetch the list of available networks that a wallet can add or/and switch to.
@@ -585,14 +690,15 @@ class $a8cb37a3fc8eb863$export$1f60ba4ec72508a0 {
585
690
  * @returns List of networks.
586
691
  * @throws {@link ErrorType}
587
692
  */ async getNetworkAllowList(params) {
588
- return await $de192de6ef100f9f$export$3043f6442a9ef563(params);
693
+ return await $de192de6ef100f9f$export$3043f6442a9ef563(this.config, params);
589
694
  }
590
695
  /**
591
696
  * Get the list of tokens which are allowed to be used with the product.
592
697
  * @param {GetTokenAllowListParams} params - The necessary data required to fetch the list of allowed tokens.
593
698
  * @returns List of allowed tokens.
594
699
  * @throws {@link ErrorType}
595
- */ async getTokenAllowList(params) {
700
+ */ // eslint-disable-next-line class-methods-use-this
701
+ async getTokenAllowList(params) {
596
702
  return await $efe60cea83bfc4e8$export$473cec51305fdae8(params);
597
703
  }
598
704
  /**
@@ -600,7 +706,8 @@ class $a8cb37a3fc8eb863$export$1f60ba4ec72508a0 {
600
706
  * @param {GetWalletAllowListParams} params - The necessary data required to fetch the list of allowed wallets.
601
707
  * @returns List of allowed wallets.
602
708
  * @throws {@link ErrorType}
603
- */ async getWalletAllowList(params) {
709
+ */ // eslint-disable-next-line class-methods-use-this
710
+ async getWalletAllowList(params) {
604
711
  return await $5cdde2ffe6360fec$export$a822caa90d7eef09(params);
605
712
  }
606
713
  /**
@@ -610,7 +717,8 @@ class $a8cb37a3fc8eb863$export$1f60ba4ec72508a0 {
610
717
  * @throws {@link ErrorType}
611
718
  * @remarks
612
719
  * Further documenation can be found at [MetaMask | Sending Transactions](https://docs.metamask.io/guide/sending-transactions.html).
613
- */ async sendTransaction(params) {
720
+ */ // eslint-disable-next-line class-methods-use-this
721
+ async sendTransaction(params) {
614
722
  return await $dbe95599a4661140$export$8e0e7ffc78696d30(params);
615
723
  }
616
724
  /**
@@ -619,8 +727,8 @@ class $a8cb37a3fc8eb863$export$1f60ba4ec72508a0 {
619
727
  * @returns Network details.
620
728
  * @throws {@link ErrorType}
621
729
  */ async getNetworkInfo(params) {
622
- return await $de192de6ef100f9f$export$79f13b4cfaaf0d09(params.provider);
730
+ return await $de192de6ef100f9f$export$79f13b4cfaaf0d09(this.config, params.provider);
623
731
  }
624
732
  }
625
733
 
626
- export { $a47e48dd2c04791b$export$c06e1e7429de6283 as ChainId, $a8cb37a3fc8eb863$export$1f60ba4ec72508a0 as Checkout, $a8bc256d81a5e2c1$export$e3dc0620abde7f5a as CheckoutErrorType, $d176a05e966364ba$export$3bfad4d03ada24c4 as ConnectionProviders, $a47e48dd2c04791b$export$1f05a55fe0680cc7 as NetworkFilterTypes, $090d3502d165f17d$export$c5ab8fbcabac8c11 as SupportedFiatCurrencies, $08d5ddc39acd6833$export$fd9b17d87f4121d2 as TokenFilterTypes, $4f91c5f280efe242$export$a75605c67ea83a5a as WalletFilterTypes };
734
+ export { $a47e48dd2c04791b$export$c06e1e7429de6283 as ChainId, $a8cb37a3fc8eb863$export$1f60ba4ec72508a0 as Checkout, $a8bc256d81a5e2c1$export$e3dc0620abde7f5a as CheckoutErrorType, $d176a05e966364ba$export$3bfad4d03ada24c4 as ConnectionProviders, $a47e48dd2c04791b$export$1f05a55fe0680cc7 as NetworkFilterTypes, $08d5ddc39acd6833$export$fd9b17d87f4121d2 as TokenFilterTypes, $4f91c5f280efe242$export$a75605c67ea83a5a as WalletFilterTypes };