@imtbl/sdk 0.0.1-alpha.2 → 0.0.1-alpha.3

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.
@@ -554,11 +554,21 @@ interface TokenInfo {
554
554
  icon?: string;
555
555
  }
556
556
  interface GetTokenAllowListParams {
557
+ type: TokenFilterTypes;
557
558
  chainId: ChainId;
559
+ exclude?: TokenFilter[];
558
560
  }
559
561
  interface GetTokenAllowListResult {
560
562
  tokens: TokenInfo[];
561
563
  }
564
+ declare enum TokenFilterTypes {
565
+ SWAP = "swap",
566
+ BRIDGE = "bridge",
567
+ ALL = "all"
568
+ }
569
+ interface TokenFilter {
570
+ address: string;
571
+ }
562
572
  declare enum ChainId {
563
573
  ETHEREUM = 1,
564
574
  GOERLI = 5,
@@ -568,6 +578,7 @@ interface NetworkInfo {
568
578
  name: string;
569
579
  chainId: number;
570
580
  nativeCurrency: TokenInfo;
581
+ isSupported: boolean;
571
582
  }
572
583
  interface SwitchNetworkParams {
573
584
  provider: Web3Provider;
@@ -576,6 +587,22 @@ interface SwitchNetworkParams {
576
587
  interface SwitchNetworkResult {
577
588
  network: NetworkInfo;
578
589
  }
590
+ interface GetNetworkParams {
591
+ provider: Web3Provider;
592
+ }
593
+ declare enum NetworkFilterTypes {
594
+ ALL = "all"
595
+ }
596
+ interface NetworkFilter {
597
+ chainId: ChainId;
598
+ }
599
+ interface GetNetworkAllowListParams {
600
+ type: NetworkFilterTypes;
601
+ exclude?: NetworkFilter[];
602
+ }
603
+ interface GetNetworkAllowListResult {
604
+ networks: NetworkInfo[];
605
+ }
579
606
  interface GetBalanceParams {
580
607
  provider: Web3Provider;
581
608
  walletAddress: string;
@@ -628,14 +655,38 @@ interface Transaction {
628
655
  data: string;
629
656
  chainId: number;
630
657
  }
658
+ declare enum WalletFilterTypes {
659
+ ALL = "all",
660
+ DESKTOP = "desktop",
661
+ MOBILE = "mobile"
662
+ }
663
+ interface WalletFilter {
664
+ connectionProvider: ConnectionProviders;
665
+ }
666
+ interface GetWalletAllowListParams {
667
+ type: WalletFilterTypes;
668
+ exclude?: WalletFilter[];
669
+ }
670
+ interface WalletInfo {
671
+ connectionProvider: ConnectionProviders;
672
+ name: string;
673
+ description: string;
674
+ icon: string;
675
+ }
676
+ interface GetWalletAllowListResult {
677
+ wallets: WalletInfo[];
678
+ }
631
679
  declare class Checkout {
632
680
  checkIsWalletConnected(params: CheckConnectionParams): Promise<CheckConnectionResult>;
633
681
  connect(params: ConnectParams): Promise<ConnectResult>;
634
682
  switchNetwork(params: SwitchNetworkParams): Promise<SwitchNetworkResult>;
635
683
  getBalance(params: GetBalanceParams): Promise<GetBalanceResult>;
636
684
  getAllBalances(params: GetAllBalancesParams): Promise<GetAllBalancesResult>;
637
- getTokenAllowList(params: GetTokenAllowListParams): GetTokenAllowListResult;
685
+ getNetworkAllowList(params: GetNetworkAllowListParams): Promise<GetNetworkAllowListResult>;
686
+ getTokenAllowList(params: GetTokenAllowListParams): Promise<GetTokenAllowListResult>;
687
+ getWalletsAllowList(params: GetWalletAllowListParams): Promise<GetWalletAllowListResult>;
638
688
  sendTransaction(params: SendTransactionParams): Promise<SendTransactionResult>;
689
+ getNetworkInfo(params: GetNetworkParams): Promise<NetworkInfo>;
639
690
  }
640
691
 
641
- export { ChainId, CheckConnectionParams, CheckConnectionResult, Checkout, ConnectParams, ConnectResult, ConnectionProviders, GetAllBalancesParams, GetAllBalancesResult, GetBalanceParams, GetBalanceResult, GetTokenAllowListParams, GetTokenAllowListResult, NetworkInfo, SendTransactionParams, SendTransactionResult, SwitchNetworkParams, SwitchNetworkResult, TokenInfo };
692
+ export { ChainId, CheckConnectionParams, CheckConnectionResult, Checkout, ConnectParams, ConnectResult, ConnectionProviders, GetAllBalancesParams, GetAllBalancesResult, GetBalanceParams, GetBalanceResult, GetNetworkAllowListParams, GetNetworkAllowListResult, GetTokenAllowListParams, GetTokenAllowListResult, GetWalletAllowListParams, GetWalletAllowListResult, NetworkFilter, NetworkFilterTypes, NetworkInfo, SendTransactionParams, SendTransactionResult, SwitchNetworkParams, SwitchNetworkResult, TokenFilter, TokenFilterTypes, TokenInfo, WalletFilter, WalletFilterTypes, WalletInfo };
@@ -2,6 +2,10 @@ import { utils, Contract } from 'ethers';
2
2
  import $7v2Z6$metamaskdetectprovider from '@metamask/detect-provider';
3
3
  import { Web3Provider } from '@ethersproject/providers';
4
4
 
5
+ function $parcel$interopDefault(a) {
6
+ return a && a.__esModule ? a.default : a;
7
+ }
8
+
5
9
  const $762782b6c862d954$export$db5daa1b5156ccfe = [
6
10
  {
7
11
  constant: true,
@@ -122,8 +126,18 @@ const $a47e48dd2c04791b$export$f61f4aaec62f6be9 = {
122
126
  ]
123
127
  }
124
128
  };
129
+ let $a47e48dd2c04791b$export$1f05a55fe0680cc7;
130
+ (function(NetworkFilterTypes) {
131
+ NetworkFilterTypes["ALL"] = "all";
132
+ })($a47e48dd2c04791b$export$1f05a55fe0680cc7 || ($a47e48dd2c04791b$export$1f05a55fe0680cc7 = {}));
125
133
 
126
134
 
135
+ let $08d5ddc39acd6833$export$fd9b17d87f4121d2;
136
+ (function(TokenFilterTypes) {
137
+ TokenFilterTypes["SWAP"] = "swap";
138
+ TokenFilterTypes["BRIDGE"] = "bridge";
139
+ TokenFilterTypes["ALL"] = "all";
140
+ })($08d5ddc39acd6833$export$fd9b17d87f4121d2 || ($08d5ddc39acd6833$export$fd9b17d87f4121d2 = {}));
127
141
 
128
142
 
129
143
 
@@ -134,24 +148,45 @@ const $4f91c5f280efe242$export$a130407f3423b97d = {
134
148
  ADD_NETWORK: "wallet_addEthereumChain",
135
149
  SWITCH_NETWORK: "wallet_switchEthereumChain"
136
150
  };
151
+ let $4f91c5f280efe242$export$a75605c67ea83a5a;
152
+ (function(WalletFilterTypes) {
153
+ WalletFilterTypes["ALL"] = "all";
154
+ WalletFilterTypes["DESKTOP"] = "desktop";
155
+ WalletFilterTypes["MOBILE"] = "mobile";
156
+ })($4f91c5f280efe242$export$a75605c67ea83a5a || ($4f91c5f280efe242$export$a75605c67ea83a5a = {}));
137
157
 
138
158
 
139
159
 
140
160
 
141
161
  let $a8bc256d81a5e2c1$export$e3dc0620abde7f5a;
142
162
  (function(CheckoutErrorType) {
163
+ CheckoutErrorType["PROVIDER_PREFERENCE_ERROR"] = "PROVIDER_PREFERENCE_ERROR";
143
164
  CheckoutErrorType["CONNECT_PROVIDER_ERROR"] = "CONNECT_PROVIDER_ERROR";
144
165
  CheckoutErrorType["GET_BALANCE_ERROR"] = "GET_BALANCE_ERROR";
145
166
  CheckoutErrorType["GET_ERC20_BALANCE_ERROR"] = "GET_ERC20_BALANCE_ERROR";
167
+ CheckoutErrorType["GET_NETWORK_INFO_ERROR"] = "GET_NETWORK_INFO_ERROR";
146
168
  CheckoutErrorType["METAMASK_PROVIDER_ERROR"] = "METAMASK_PROVIDER_ERROR";
147
169
  CheckoutErrorType["CHAIN_NOT_SUPPORTED_ERROR"] = "CHAIN_NOT_SUPPORTED_ERROR";
148
170
  CheckoutErrorType["PROVIDER_REQUEST_MISSING_ERROR"] = "PROVIDER_REQUEST_MISSING_ERROR";
171
+ CheckoutErrorType["PROVIDER_REQUEST_FAILED_ERROR"] = "PROVIDER_REQUEST_FAILED_ERROR";
149
172
  CheckoutErrorType["USER_REJECTED_REQUEST_ERROR"] = "USER_REJECTED_REQUEST_ERROR";
150
173
  CheckoutErrorType["TRANSACTION_ERROR"] = "TRANSACTION_ERROR";
151
174
  })($a8bc256d81a5e2c1$export$e3dc0620abde7f5a || ($a8bc256d81a5e2c1$export$e3dc0620abde7f5a = {}));
152
175
  class $a8bc256d81a5e2c1$export$b722478a3cbfa3bc extends Error {
153
- constructor(message, type){
176
+ constructor(message, type, data){
154
177
  super(message);
178
+ this.message = message;
179
+ this.type = type;
180
+ this.data = data;
181
+ }
182
+ }
183
+ let $a8bc256d81a5e2c1$export$a22d4e0719ee6def;
184
+ (function(CheckoutInternalErrorType) {
185
+ CheckoutInternalErrorType["REJECTED_SWITCH_AFTER_ADDING_NETWORK"] = "REJECTED_SWITCH_AFTER_ADDING_NETWORK";
186
+ })($a8bc256d81a5e2c1$export$a22d4e0719ee6def || ($a8bc256d81a5e2c1$export$a22d4e0719ee6def = {}));
187
+ class $a8bc256d81a5e2c1$export$620a0d5f1b58ea1d extends Error {
188
+ constructor(type){
189
+ super("Checkout internal error");
155
190
  this.type = type;
156
191
  }
157
192
  }
@@ -159,44 +194,67 @@ const $a8bc256d81a5e2c1$export$bacc563de539c6c3 = async (fn, customError)=>{
159
194
  try {
160
195
  return await fn();
161
196
  } catch (error) {
162
- const errorMessage = customError.message || `${error.message}` || "UnknownError";
163
- throw new $a8bc256d81a5e2c1$export$b722478a3cbfa3bc(errorMessage, customError.type);
197
+ const cause = `${error.message}` || "UnknownError";
198
+ const errorMessage = customError.message ? `[${customError.type}]:${customError.message}. Cause:${cause}` : `[${customError.type}] Cause:${cause}`;
199
+ if (error instanceof $a8bc256d81a5e2c1$export$b722478a3cbfa3bc) throw new $a8bc256d81a5e2c1$export$b722478a3cbfa3bc(errorMessage, customError.type, {
200
+ ...customError.data,
201
+ innerErrorType: error.type,
202
+ ...error.data
203
+ });
204
+ throw new $a8bc256d81a5e2c1$export$b722478a3cbfa3bc(errorMessage, customError.type, {
205
+ ...customError.data
206
+ });
164
207
  }
165
208
  };
166
209
 
167
210
 
168
211
 
169
212
 
213
+ /* eslint-disable @typescript-eslint/no-explicit-any */
170
214
 
215
+ var $497c134ecbc8a50f$exports = {};
216
+ $497c134ecbc8a50f$exports = JSON.parse('[{"chainId":1},{"chainId":5},{"chainId":137}]');
171
217
 
172
218
 
219
+ const $de192de6ef100f9f$var$UNRECOGNISED_CHAIN_ERROR_CODE = 4902; // error code (MetaMask)
173
220
  async function $de192de6ef100f9f$export$79f13b4cfaaf0d09(provider) {
174
- const network = await provider.getNetwork();
175
- if (!Object.values(($a47e48dd2c04791b$export$c06e1e7429de6283)).includes(network.chainId)) // return empty details
176
- return {};
177
- const chainIdNetworkInfo = ($a47e48dd2c04791b$export$f61f4aaec62f6be9)[network.chainId];
178
- const networkInfo = {
179
- name: chainIdNetworkInfo.chainName,
180
- chainId: parseInt(chainIdNetworkInfo.chainIdHex, 16),
181
- nativeCurrency: chainIdNetworkInfo.nativeCurrency
182
- };
183
- return networkInfo;
221
+ return ($a8bc256d81a5e2c1$export$bacc563de539c6c3)(async ()=>{
222
+ const network = await provider.getNetwork();
223
+ if (!Object.values(($a47e48dd2c04791b$export$c06e1e7429de6283)).includes(network.chainId)) // return empty details
224
+ return {
225
+ chainId: network.chainId,
226
+ name: network.name,
227
+ isSupported: false
228
+ };
229
+ const chainIdNetworkInfo = ($a47e48dd2c04791b$export$f61f4aaec62f6be9)[network.chainId];
230
+ return {
231
+ name: chainIdNetworkInfo.chainName,
232
+ chainId: parseInt(chainIdNetworkInfo.chainIdHex, 16),
233
+ nativeCurrency: chainIdNetworkInfo.nativeCurrency,
234
+ isSupported: true
235
+ };
236
+ }, {
237
+ type: ($a8bc256d81a5e2c1$export$e3dc0620abde7f5a).GET_NETWORK_INFO_ERROR
238
+ });
184
239
  }
185
240
  async function $de192de6ef100f9f$export$b827d9418aeb5dbd(provider, chainId) {
186
- if (!Object.values(($a47e48dd2c04791b$export$c06e1e7429de6283)).includes(chainId)) throw new ($a8bc256d81a5e2c1$export$b722478a3cbfa3bc)(`${chainId} is not a supported chain`, ($a8bc256d81a5e2c1$export$e3dc0620abde7f5a).CHAIN_NOT_SUPPORTED_ERROR);
187
- if (!provider.provider?.request) throw new ($a8bc256d81a5e2c1$export$b722478a3cbfa3bc)("provider object is missing request function", ($a8bc256d81a5e2c1$export$e3dc0620abde7f5a).PROVIDER_REQUEST_MISSING_ERROR);
241
+ 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);
242
+ if (!provider || !provider.provider?.request) throw new ($a8bc256d81a5e2c1$export$b722478a3cbfa3bc)("Incompatible provider", ($a8bc256d81a5e2c1$export$e3dc0620abde7f5a).PROVIDER_REQUEST_MISSING_ERROR, {
243
+ details: `Unsupported provider`
244
+ });
188
245
  // WT-1146 - Refer to the README in this folder for explantion on the switch network flow
189
246
  try {
190
247
  await $de192de6ef100f9f$var$switchNetworkInWallet(provider, chainId);
191
- // eslint-disable-next-line @typescript-eslint/no-explicit-any
192
248
  } catch (err) {
193
- if (err.message.includes("Unrecognized chain ID")) try {
249
+ if (err.code === $de192de6ef100f9f$var$UNRECOGNISED_CHAIN_ERROR_CODE) try {
194
250
  await $de192de6ef100f9f$var$addNetworkToWallet(provider, chainId);
195
- // eslint-disable-next-line @typescript-eslint/no-explicit-any
251
+ if ((await provider.getNetwork()).chainId !== chainId) // user didn't actually switch
252
+ throw new (0, $a8bc256d81a5e2c1$export$620a0d5f1b58ea1d)((0, $a8bc256d81a5e2c1$export$a22d4e0719ee6def).REJECTED_SWITCH_AFTER_ADDING_NETWORK);
196
253
  } catch (err) {
197
- throw new ($a8bc256d81a5e2c1$export$b722478a3cbfa3bc)("user cancelled the add network request", ($a8bc256d81a5e2c1$export$e3dc0620abde7f5a).USER_REJECTED_REQUEST_ERROR);
254
+ if (err?.type === ($a8bc256d81a5e2c1$export$a22d4e0719ee6def).REJECTED_SWITCH_AFTER_ADDING_NETWORK) throw new ($a8bc256d81a5e2c1$export$b722478a3cbfa3bc)("User cancelled switch network request", ($a8bc256d81a5e2c1$export$e3dc0620abde7f5a).USER_REJECTED_REQUEST_ERROR);
255
+ throw new ($a8bc256d81a5e2c1$export$b722478a3cbfa3bc)("User cancelled add network request", ($a8bc256d81a5e2c1$export$e3dc0620abde7f5a).USER_REJECTED_REQUEST_ERROR);
198
256
  }
199
- else throw new ($a8bc256d81a5e2c1$export$b722478a3cbfa3bc)("user cancelled the switch network request", ($a8bc256d81a5e2c1$export$e3dc0620abde7f5a).USER_REJECTED_REQUEST_ERROR);
257
+ else throw new ($a8bc256d81a5e2c1$export$b722478a3cbfa3bc)("User cancelled switch network request", ($a8bc256d81a5e2c1$export$e3dc0620abde7f5a).USER_REJECTED_REQUEST_ERROR);
200
258
  }
201
259
  // we can assume that if the above succeeds then user has successfully
202
260
  // switched to the network specified
@@ -209,6 +267,26 @@ async function $de192de6ef100f9f$export$b827d9418aeb5dbd(provider, chainId) {
209
267
  }
210
268
  };
211
269
  }
270
+ async function $de192de6ef100f9f$export$3043f6442a9ef563({ type: type = ($a47e48dd2c04791b$export$1f05a55fe0680cc7).ALL , exclude: exclude }) {
271
+ const list = ((/*@__PURE__*/$parcel$interopDefault($497c134ecbc8a50f$exports))).filter((network)=>{
272
+ const allowAllTokens = type === ($a47e48dd2c04791b$export$1f05a55fe0680cc7).ALL;
273
+ const networkNotExcluded = !(exclude || []).map((exc)=>exc.chainId).includes(network.chainId);
274
+ return allowAllTokens && networkNotExcluded;
275
+ });
276
+ const allowedNetworks = [];
277
+ list.forEach((element)=>{
278
+ const newNetwork = ($a47e48dd2c04791b$export$f61f4aaec62f6be9)[element.chainId];
279
+ allowedNetworks.push({
280
+ name: newNetwork.chainName,
281
+ chainId: parseInt(newNetwork.chainIdHex, 16),
282
+ nativeCurrency: newNetwork.nativeCurrency,
283
+ isSupported: true
284
+ });
285
+ });
286
+ return {
287
+ networks: allowedNetworks
288
+ };
289
+ }
212
290
  // these functions should not be exported. These functions should be used as part of an exported function e.g switchWalletNetwork() above.
213
291
  // make sure to check if(provider.provider?.request) in the exported function and throw an error
214
292
  async function $de192de6ef100f9f$var$switchNetworkInWallet(provider, chainId) {
@@ -243,67 +321,24 @@ async function $de192de6ef100f9f$var$addNetworkToWallet(provider, chainId) {
243
321
 
244
322
 
245
323
 
246
- let $efe60cea83bfc4e8$export$f04a61298a47a40f;
247
- (function(Icon) {
248
- Icon["ETH"] = "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";
249
- Icon["MATIC"] = "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";
250
- Icon["IMX"] = "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";
251
- })($efe60cea83bfc4e8$export$f04a61298a47a40f || ($efe60cea83bfc4e8$export$f04a61298a47a40f = {}));
252
- const $efe60cea83bfc4e8$export$3dbcce43073f40c7 = [
253
- {
254
- name: "Ethereum",
255
- symbol: "ETH",
256
- decimals: 18,
257
- 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"
258
- },
259
- {
260
- name: "Matic",
261
- symbol: "MATIC",
262
- address: "0x7D1AfA7B718fb893dB30A3aBc0Cfc608AaCfeBB0",
263
- decimals: 18,
264
- 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"
265
- },
266
- {
267
- name: "Immutable X",
268
- symbol: "IMX",
269
- address: "0xF57e7e7C23978C3cAEC3C3548E3D615c346e79fF",
270
- decimals: 18,
271
- 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"
272
- }
273
- ];
274
- const $efe60cea83bfc4e8$var$goerliTokensList = [
275
- {
276
- name: "Ethereum",
277
- symbol: "ETH",
278
- decimals: 18,
279
- 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"
280
- },
281
- {
282
- name: "Immutable X",
283
- symbol: "IMX",
284
- address: "0x1facdd0165489f373255a90304650e15481b2c85",
285
- decimals: 18,
286
- 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"
287
- }
288
- ];
289
- const $efe60cea83bfc4e8$var$polygonTokensList = [];
290
- const $efe60cea83bfc4e8$export$473cec51305fdae8 = (chainId)=>{
291
- let tokenList = [];
292
- switch(chainId){
293
- case ($a47e48dd2c04791b$export$c06e1e7429de6283).ETHEREUM:
294
- tokenList = $efe60cea83bfc4e8$export$3dbcce43073f40c7;
295
- break;
296
- case ($a47e48dd2c04791b$export$c06e1e7429de6283).GOERLI:
297
- tokenList = $efe60cea83bfc4e8$var$goerliTokensList;
298
- break;
299
- case ($a47e48dd2c04791b$export$c06e1e7429de6283).POLYGON:
300
- tokenList = $efe60cea83bfc4e8$var$polygonTokensList;
301
- break;
302
- default:
303
- tokenList = $efe60cea83bfc4e8$export$3dbcce43073f40c7;
304
- }
324
+ var $cda6003506e4182e$exports = {};
325
+ $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\"]}]");
326
+
327
+
328
+ const $efe60cea83bfc4e8$export$473cec51305fdae8 = async function({ type: type = ($08d5ddc39acd6833$export$fd9b17d87f4121d2).ALL , chainId: chainId , exclude: exclude }) {
329
+ // todo:For API call, use the CheckoutError with errorType:API_CALL_ERROR?? or any other
330
+ const filteredTokenList = ((/*@__PURE__*/$parcel$interopDefault($cda6003506e4182e$exports))).filter((token)=>{
331
+ const chainIdMatches = token.chainId == chainId;
332
+ const tokenNotExcluded = !exclude?.map((excludeToken)=>excludeToken.address).includes(token.address || "");
333
+ const allowAllTokens = type === ($08d5ddc39acd6833$export$fd9b17d87f4121d2).ALL;
334
+ const tokenAllowedForType = token.tokenFeatures.includes(type);
335
+ return chainIdMatches && tokenNotExcluded && (allowAllTokens || tokenAllowedForType);
336
+ }).map((token)=>{
337
+ const { chainId: chainId , tokenFeatures: tokenFeatures , ...tokenInfo } = token;
338
+ return tokenInfo;
339
+ });
305
340
  return {
306
- tokens: tokenList
341
+ tokens: filteredTokenList
307
342
  };
308
343
  };
309
344
 
@@ -313,6 +348,9 @@ const $efe60cea83bfc4e8$export$473cec51305fdae8 = (chainId)=>{
313
348
  const $1564e43dde50bb61$export$df96cd8d56be0ab1 = async (provider, walletAddress)=>{
314
349
  return await ($a8bc256d81a5e2c1$export$bacc563de539c6c3)(async ()=>{
315
350
  const networkInfo = await ($de192de6ef100f9f$export$79f13b4cfaaf0d09)(provider);
351
+ if (!networkInfo.isSupported) throw new ($a8bc256d81a5e2c1$export$b722478a3cbfa3bc)(`Chain:${networkInfo.chainId} is not a supported chain`, ($a8bc256d81a5e2c1$export$e3dc0620abde7f5a).CHAIN_NOT_SUPPORTED_ERROR, {
352
+ chainName: networkInfo.name
353
+ });
316
354
  const balance = await provider.getBalance(walletAddress);
317
355
  return {
318
356
  balance: balance,
@@ -348,7 +386,10 @@ async function $1564e43dde50bb61$export$60e0fe116a0e6ed0(provider, walletAddress
348
386
  const $1564e43dde50bb61$export$fee49741664a4d7e = async (provider, walletAddress, chainId)=>{
349
387
  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);
350
388
  if (!provider.provider?.request) throw new ($a8bc256d81a5e2c1$export$b722478a3cbfa3bc)("provider object is missing request function", ($a8bc256d81a5e2c1$export$e3dc0620abde7f5a).PROVIDER_REQUEST_MISSING_ERROR);
351
- const tokenList = ($efe60cea83bfc4e8$export$473cec51305fdae8)(chainId);
389
+ const tokenList = await ($efe60cea83bfc4e8$export$473cec51305fdae8)({
390
+ type: ($08d5ddc39acd6833$export$fd9b17d87f4121d2).ALL,
391
+ chainId: chainId
392
+ });
352
393
  const allBalancePromises = [];
353
394
  allBalancePromises.push($1564e43dde50bb61$export$df96cd8d56be0ab1(provider, walletAddress));
354
395
  tokenList.tokens.filter((token)=>token.address).forEach((token)=>allBalancePromises.push($1564e43dde50bb61$export$60e0fe116a0e6ed0(provider, walletAddress, token.address ?? "")));
@@ -369,11 +410,20 @@ const $1564e43dde50bb61$export$fee49741664a4d7e = async (provider, walletAddress
369
410
 
370
411
  async function $c99672cf2294e839$export$2d040992269b4717(providerPreference) {
371
412
  const provider = await $c99672cf2294e839$var$getWalletProviderForPreference(providerPreference);
372
- if (!provider.provider?.request) throw new ($a8bc256d81a5e2c1$export$b722478a3cbfa3bc)("Incompatible provider", ($a8bc256d81a5e2c1$export$e3dc0620abde7f5a).PROVIDER_REQUEST_MISSING_ERROR);
373
- const accounts = await provider.provider.request({
374
- method: ($4f91c5f280efe242$export$a130407f3423b97d).CHECK_CONNECTION,
375
- params: []
413
+ if (!provider.provider?.request) throw new ($a8bc256d81a5e2c1$export$b722478a3cbfa3bc)("Incompatible provider", ($a8bc256d81a5e2c1$export$e3dc0620abde7f5a).PROVIDER_REQUEST_MISSING_ERROR, {
414
+ details: `Unsupported provider for ${providerPreference}`
376
415
  });
416
+ let accounts = [];
417
+ try {
418
+ accounts = await provider.provider.request({
419
+ method: (0, $4f91c5f280efe242$export$a130407f3423b97d).CHECK_CONNECTION,
420
+ params: []
421
+ });
422
+ } catch (err) {
423
+ throw new ($a8bc256d81a5e2c1$export$b722478a3cbfa3bc)(`Check wallet connection request failed`, ($a8bc256d81a5e2c1$export$e3dc0620abde7f5a).PROVIDER_REQUEST_FAILED_ERROR, {
424
+ rpcMethod: ($4f91c5f280efe242$export$a130407f3423b97d).CHECK_CONNECTION
425
+ });
426
+ }
377
427
  // accounts[0] will have the active account if connected.
378
428
  return {
379
429
  isConnected: accounts && accounts.length > 0,
@@ -383,7 +433,9 @@ async function $c99672cf2294e839$export$2d040992269b4717(providerPreference) {
383
433
  async function $c99672cf2294e839$export$fba2f6c3656e07c1(params) {
384
434
  const web3Provider = await $c99672cf2294e839$var$getWalletProviderForPreference(params.providerPreference);
385
435
  await ($a8bc256d81a5e2c1$export$bacc563de539c6c3)(async ()=>{
386
- if (!web3Provider || !web3Provider?.provider?.request) throw new ($a8bc256d81a5e2c1$export$b722478a3cbfa3bc)("No MetaMask provider installed.", ($a8bc256d81a5e2c1$export$e3dc0620abde7f5a).METAMASK_PROVIDER_ERROR);
436
+ if (!web3Provider || !web3Provider?.provider?.request) throw new ($a8bc256d81a5e2c1$export$b722478a3cbfa3bc)("Incompatible provider", ($a8bc256d81a5e2c1$export$e3dc0620abde7f5a).PROVIDER_REQUEST_MISSING_ERROR, {
437
+ details: `Unsupported provider for ${params.providerPreference}`
438
+ });
387
439
  // this makes the request to the wallet to connect i.e request eth accounts ('eth_requestAccounts')
388
440
  await web3Provider.provider.request({
389
441
  method: ($4f91c5f280efe242$export$a130407f3423b97d).CONNECT,
@@ -401,7 +453,7 @@ async function $c99672cf2294e839$var$getWalletProviderForPreference(providerPref
401
453
  web3Provider = await $c99672cf2294e839$var$getMetaMaskProvider();
402
454
  break;
403
455
  default:
404
- throw new ($a8bc256d81a5e2c1$export$b722478a3cbfa3bc)("Provider preference was not detected", ($a8bc256d81a5e2c1$export$e3dc0620abde7f5a).CONNECT_PROVIDER_ERROR);
456
+ throw new ($a8bc256d81a5e2c1$export$b722478a3cbfa3bc)("Provider preference is not supported", ($a8bc256d81a5e2c1$export$e3dc0620abde7f5a).PROVIDER_PREFERENCE_ERROR);
405
457
  }
406
458
  return web3Provider;
407
459
  }
@@ -419,6 +471,30 @@ async function $c99672cf2294e839$var$getMetaMaskProvider() {
419
471
 
420
472
 
421
473
 
474
+ var $6f3c55a615003cbf$exports = {};
475
+ $6f3c55a615003cbf$exports = JSON.parse('[{"connectionProvider":"metamask","icon":"some-icon-url","name":"MetaMask","description":"complete web3 wallet solution","platform":["mobile","desktop"]},{"connectionProvider":"passport","icon":"pp-icon","name":"Passport","description":"Web3 with your email!","platform":["mobile"]},{"connectionProvider":"gamestop","icon":"gme-icon","name":"GameStop","description":"Never stopping the game!","platform":["desktop"]}]');
476
+
477
+
478
+ async function $5cdde2ffe6360fec$export$a822caa90d7eef09({ type: type = ($4f91c5f280efe242$export$a75605c67ea83a5a).ALL , exclude: exclude }) {
479
+ // todo:For async API call, use the CheckoutError with errorType:API_CALL_ERROR?? or any other
480
+ const filteredWalletsList = ((/*@__PURE__*/$parcel$interopDefault($6f3c55a615003cbf$exports))).filter((wallet)=>{
481
+ const walletNotExcluded = !exclude?.map((excludeWallet)=>excludeWallet.connectionProvider).includes(wallet.connectionProvider);
482
+ const allowAllWallets = type === ($4f91c5f280efe242$export$a75605c67ea83a5a).ALL;
483
+ const walletsAllowedForType = wallet.platform.includes(type);
484
+ return walletNotExcluded && (allowAllWallets || walletsAllowedForType);
485
+ }).map((wallet)=>{
486
+ const { platform: platform , ...walletInfo } = wallet;
487
+ return walletInfo;
488
+ });
489
+ return {
490
+ wallets: filteredWalletsList
491
+ };
492
+ }
493
+
494
+
495
+
496
+
497
+
422
498
 
423
499
  const $dbe95599a4661140$export$8e0e7ffc78696d30 = async (params)=>{
424
500
  const { provider: provider , transaction: transaction } = params;
@@ -441,14 +517,14 @@ class $a8cb37a3fc8eb863$export$1f60ba4ec72508a0 {
441
517
  }
442
518
  async connect(params) {
443
519
  const provider = await $c99672cf2294e839$export$fba2f6c3656e07c1(params);
444
- const network = await ($de192de6ef100f9f$export$79f13b4cfaaf0d09)(provider);
520
+ const networkInfo = await $de192de6ef100f9f$export$79f13b4cfaaf0d09(provider);
445
521
  return {
446
522
  provider: provider,
447
- network: network
523
+ network: networkInfo
448
524
  };
449
525
  }
450
526
  async switchNetwork(params) {
451
- return await ($de192de6ef100f9f$export$b827d9418aeb5dbd)(params.provider, params.chainId);
527
+ return await $de192de6ef100f9f$export$b827d9418aeb5dbd(params.provider, params.chainId);
452
528
  }
453
529
  async getBalance(params) {
454
530
  if (!params.contractAddress || params.contractAddress === "") return await $1564e43dde50bb61$export$df96cd8d56be0ab1(params.provider, params.walletAddress);
@@ -457,12 +533,21 @@ class $a8cb37a3fc8eb863$export$1f60ba4ec72508a0 {
457
533
  async getAllBalances(params) {
458
534
  return $1564e43dde50bb61$export$fee49741664a4d7e(params.provider, params.walletAddress, params.chainId);
459
535
  }
460
- getTokenAllowList(params) {
461
- return $efe60cea83bfc4e8$export$473cec51305fdae8(params.chainId);
536
+ async getNetworkAllowList(params) {
537
+ return await $de192de6ef100f9f$export$3043f6442a9ef563(params);
538
+ }
539
+ async getTokenAllowList(params) {
540
+ return await $efe60cea83bfc4e8$export$473cec51305fdae8(params);
541
+ }
542
+ async getWalletsAllowList(params) {
543
+ return await $5cdde2ffe6360fec$export$a822caa90d7eef09(params);
462
544
  }
463
545
  async sendTransaction(params) {
464
546
  return await $dbe95599a4661140$export$8e0e7ffc78696d30(params);
465
547
  }
548
+ async getNetworkInfo(params) {
549
+ return await $de192de6ef100f9f$export$79f13b4cfaaf0d09(params.provider);
550
+ }
466
551
  }
467
552
 
468
- export { $a47e48dd2c04791b$export$c06e1e7429de6283 as ChainId, $a8cb37a3fc8eb863$export$1f60ba4ec72508a0 as Checkout, $d176a05e966364ba$export$3bfad4d03ada24c4 as ConnectionProviders };
553
+ export { $a47e48dd2c04791b$export$c06e1e7429de6283 as ChainId, $a8cb37a3fc8eb863$export$1f60ba4ec72508a0 as Checkout, $d176a05e966364ba$export$3bfad4d03ada24c4 as ConnectionProviders, $a47e48dd2c04791b$export$1f05a55fe0680cc7 as NetworkFilterTypes, $08d5ddc39acd6833$export$fd9b17d87f4121d2 as TokenFilterTypes, $4f91c5f280efe242$export$a75605c67ea83a5a as WalletFilterTypes };
@@ -12369,7 +12369,9 @@ declare namespace React {
12369
12369
  interface DOMAttributes<T> {
12370
12370
  children?: ReactNode | undefined;
12371
12371
  dangerouslySetInnerHTML?: {
12372
- __html: string;
12372
+ // Should be InnerHTML['innerHTML'].
12373
+ // But unfortunately we're mixing renderer-specific type declarations.
12374
+ __html: string | TrustedHTML;
12373
12375
  } | undefined;
12374
12376
 
12375
12377
  // Clipboard Events
@@ -14319,7 +14321,8 @@ declare enum IMTBLWidgetEvents {
14319
14321
  }
14320
14322
  declare enum ConnectEventType {
14321
14323
  SUCCESS = "success",
14322
- FAILURE = "failure"
14324
+ FAILURE = "failure",
14325
+ CLOSE_WIDGET = "close-widget"
14323
14326
  }
14324
14327
  type ConnectEvent<T> = {
14325
14328
  type: ConnectEventType;
@@ -14327,11 +14330,9 @@ type ConnectEvent<T> = {
14327
14330
  };
14328
14331
  type ConnectionSuccess = {
14329
14332
  providerPreference: ConnectionProviders;
14330
- timestamp: number;
14331
14333
  };
14332
14334
  type ConnectionFailed = {
14333
14335
  reason: string;
14334
- timestamp: number;
14335
14336
  };
14336
14337
  declare enum WalletEventType {
14337
14338
  CLOSE_WIDGET = "close-widget",
@@ -14428,6 +14429,10 @@ interface ImtblBuyProps extends undefined<undefined<HTMLElement>, HTMLElement> {
14428
14429
  theme: string;
14429
14430
  orderId: string;
14430
14431
  }
14432
+ interface ImtblTransitionExampleProps extends undefined<undefined<HTMLElement>, HTMLElement> {
14433
+ providerPreference: string;
14434
+ theme: string;
14435
+ }
14431
14436
  declare enum Network {
14432
14437
  ETHEREUM = "Ethereum",
14433
14438
  GOERLI = "Goerli",
@@ -14439,4 +14444,4 @@ declare enum WidgetTheme {
14439
14444
  CUSTOM = "custom"
14440
14445
  }
14441
14446
 
14442
- export { BridgeEvent, BridgeEventType, BridgeFailed, BridgeSuccess, BuyClose, BuyEvent, BuyEventType, BuyFailed, BuyNotConnected, BuySuccess, ConnectEvent, ConnectEventType, ConnectionFailed, ConnectionProviders, ConnectionSuccess, IMTBLWidgetEvents, ImtblBridgeProps, ImtblBuyProps, ImtblConnectProps, ImtblExampleProps, ImtblSwapProps, ImtblWalletProps, Network, SwapEvent, SwapEventType, SwapFailed, SwapSuccess, WalletEvent, WalletEventType, WalletNetworkSwitchEvent, WidgetTheme };
14447
+ export { BridgeEvent, BridgeEventType, BridgeFailed, BridgeSuccess, BuyClose, BuyEvent, BuyEventType, BuyFailed, BuyNotConnected, BuySuccess, ConnectEvent, ConnectEventType, ConnectionFailed, ConnectionProviders, ConnectionSuccess, IMTBLWidgetEvents, ImtblBridgeProps, ImtblBuyProps, ImtblConnectProps, ImtblExampleProps, ImtblSwapProps, ImtblTransitionExampleProps, ImtblWalletProps, Network, SwapEvent, SwapEventType, SwapFailed, SwapSuccess, WalletEvent, WalletEventType, WalletNetworkSwitchEvent, WidgetTheme };