@imtbl/sdk 0.1.9-alpha.2 → 0.1.9-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.
package/dist/index.cjs CHANGED
@@ -14,11 +14,6 @@ var seaportJs = require('@opensea/seaport-js');
14
14
  var units = require('@ethersproject/units');
15
15
  var bignumber = require('@ethersproject/bignumber');
16
16
  var detectEthereumProvider = require('@metamask/detect-provider');
17
- var ethers$1 = require('ethers/lib/ethers');
18
- var bridgeSdk = require('@imtbl/bridge-sdk');
19
- var dexSdk = require('@imtbl/dex-sdk');
20
- var jsxRuntime = require('react/jsx-runtime');
21
- var react = require('react');
22
17
 
23
18
  function _interopNamespaceDefault(e) {
24
19
  var n = Object.create(null);
@@ -68,7 +63,7 @@ class ImmutableConfiguration {
68
63
  */
69
64
  // Some imports not used depending on template conditions
70
65
  // @ts-ignore
71
- const BASE_PATH$1 = "https://indexer-mr.dev.imtbl.com".replace(/\/+$/, "");
66
+ const BASE_PATH$1 = "https://indexer-mr.sandbox.imtbl.com".replace(/\/+$/, "");
72
67
  /**
73
68
  *
74
69
  * @export
@@ -10768,1336 +10763,6 @@ class ProviderConfiguration {
10768
10763
  }
10769
10764
  }
10770
10765
 
10771
- function $parcel$interopDefault(a) {
10772
- return a && a.__esModule ? a.default : a;
10773
- }
10774
- /* eslint-disable class-methods-use-this */
10775
- const $762782b6c862d954$export$db5daa1b5156ccfe = [
10776
- {
10777
- constant: true,
10778
- inputs: [],
10779
- name: "name",
10780
- outputs: [
10781
- {
10782
- name: "",
10783
- type: "string"
10784
- }
10785
- ],
10786
- payable: false,
10787
- type: "function"
10788
- },
10789
- {
10790
- constant: true,
10791
- inputs: [],
10792
- name: "decimals",
10793
- outputs: [
10794
- {
10795
- name: "",
10796
- type: "uint8"
10797
- }
10798
- ],
10799
- payable: false,
10800
- type: "function"
10801
- },
10802
- {
10803
- constant: true,
10804
- inputs: [
10805
- {
10806
- name: "_owner",
10807
- type: "address"
10808
- }
10809
- ],
10810
- name: "balanceOf",
10811
- outputs: [
10812
- {
10813
- name: "balance",
10814
- type: "uint256"
10815
- }
10816
- ],
10817
- payable: false,
10818
- type: "function"
10819
- },
10820
- {
10821
- constant: true,
10822
- inputs: [],
10823
- name: "symbol",
10824
- outputs: [
10825
- {
10826
- name: "",
10827
- type: "string"
10828
- }
10829
- ],
10830
- payable: false,
10831
- type: "function"
10832
- }
10833
- ];
10834
-
10835
-
10836
- /**
10837
- * Enum representing the supported chains with their corresponding IDs.
10838
- */ exports.ChainId = void 0;
10839
- (function(ChainId) {
10840
- ChainId[ChainId["ETHEREUM"] = 1] = "ETHEREUM";
10841
- ChainId[ChainId["IMTBL_ZKEVM_TESTNET"] = 13372] = "IMTBL_ZKEVM_TESTNET";
10842
- ChainId[ChainId["SEPOLIA"] = 11155111] = "SEPOLIA";
10843
- ChainId[ChainId["IMTBL_ZKEVM_DEVNET"] = 13383] = "IMTBL_ZKEVM_DEVNET";
10844
- })(exports.ChainId || (exports.ChainId = {}));
10845
-
10846
-
10847
-
10848
- const $bc2bfebf768286d3$export$6a2ba3c3bd042990 = {
10849
- baseConfig: {
10850
- environment: (exports.Environment).SANDBOX
10851
- }
10852
- };
10853
-
10854
-
10855
-
10856
-
10857
- exports.GasEstimateType = void 0;
10858
- (function(GasEstimateType) {
10859
- GasEstimateType["BRIDGE_TO_L2"] = "BRIDGE_TO_L2";
10860
- GasEstimateType["SWAP"] = "SWAP";
10861
- })(exports.GasEstimateType || (exports.GasEstimateType = {}));
10862
-
10863
-
10864
-
10865
-
10866
-
10867
-
10868
- const $d85ad1457a3f1a83$export$161d4a74df65fc08 = {
10869
- [(exports.Environment).SANDBOX]: "https://checkout-api.dev.immutable.com",
10870
- [(exports.Environment).PRODUCTION]: "https://checkout-api.sandbox.immutable.com"
10871
- };
10872
- const $d85ad1457a3f1a83$export$720c0def10d6df2d = {
10873
- [(exports.ChainId).ETHEREUM]: "/v1/rpc/eth-mainnet",
10874
- [(exports.ChainId).SEPOLIA]: "/v1/rpc/eth-sepolia"
10875
- };
10876
-
10877
-
10878
- const $a47e48dd2c04791b$export$345c852d0dc8f1df = new Map([
10879
- [
10880
- (exports.ChainId).ETHEREUM,
10881
- `${($d85ad1457a3f1a83$export$161d4a74df65fc08)[(exports.Environment).PRODUCTION]}${($d85ad1457a3f1a83$export$720c0def10d6df2d)[(exports.ChainId).ETHEREUM]}`
10882
- ],
10883
- [
10884
- (exports.ChainId).IMTBL_ZKEVM_TESTNET,
10885
- "https://zkevm-rpc.sandbox.x.immutable.com"
10886
- ],
10887
- [
10888
- (exports.ChainId).SEPOLIA,
10889
- `${($d85ad1457a3f1a83$export$161d4a74df65fc08)[(exports.Environment).PRODUCTION]}${($d85ad1457a3f1a83$export$720c0def10d6df2d)[(exports.ChainId).SEPOLIA]}`
10890
- ],
10891
- [
10892
- (exports.ChainId).IMTBL_ZKEVM_DEVNET,
10893
- "https://zkevm-rpc.dev.x.immutable.com"
10894
- ]
10895
- ]);
10896
- const $a47e48dd2c04791b$export$6f24f3cef7d501c4 = new Map([
10897
- [
10898
- (exports.ChainId).ETHEREUM,
10899
- {
10900
- chainIdHex: "0x1",
10901
- chainName: "Ethereum",
10902
- rpcUrls: [
10903
- $a47e48dd2c04791b$export$345c852d0dc8f1df.get((exports.ChainId).ETHEREUM)
10904
- ],
10905
- nativeCurrency: {
10906
- name: "Ethereum",
10907
- symbol: "ETH",
10908
- decimals: 18
10909
- },
10910
- blockExplorerUrls: [
10911
- "https://etherscan.io/"
10912
- ]
10913
- }
10914
- ],
10915
- [
10916
- (exports.ChainId).IMTBL_ZKEVM_TESTNET,
10917
- {
10918
- chainIdHex: "0x343C",
10919
- chainName: "Immutable zkEVM Testnet",
10920
- rpcUrls: [
10921
- $a47e48dd2c04791b$export$345c852d0dc8f1df.get((exports.ChainId).IMTBL_ZKEVM_TESTNET)
10922
- ],
10923
- nativeCurrency: {
10924
- name: "IMX",
10925
- symbol: "IMX",
10926
- decimals: 18
10927
- }
10928
- }
10929
- ]
10930
- ]);
10931
- const $a47e48dd2c04791b$export$3e81fc0987227f10 = new Map([
10932
- [
10933
- (exports.ChainId).SEPOLIA,
10934
- {
10935
- chainIdHex: "0xaa36a7",
10936
- chainName: "Sepolia",
10937
- rpcUrls: [
10938
- $a47e48dd2c04791b$export$345c852d0dc8f1df.get((exports.ChainId).SEPOLIA)
10939
- ],
10940
- nativeCurrency: {
10941
- name: "Sep Eth",
10942
- symbol: "ETH",
10943
- decimals: 18
10944
- },
10945
- blockExplorerUrls: [
10946
- "https://sepolia.etherscan.io/"
10947
- ]
10948
- }
10949
- ],
10950
- [
10951
- (exports.ChainId).IMTBL_ZKEVM_DEVNET,
10952
- {
10953
- chainIdHex: "0x3447",
10954
- chainName: "Immutable zkEVM Devnet",
10955
- rpcUrls: [
10956
- $a47e48dd2c04791b$export$345c852d0dc8f1df.get((exports.ChainId).IMTBL_ZKEVM_DEVNET)
10957
- ],
10958
- nativeCurrency: {
10959
- name: "IMX",
10960
- symbol: "IMX",
10961
- decimals: 18
10962
- }
10963
- }
10964
- ]
10965
- ]);
10966
- exports.NetworkFilterTypes = void 0;
10967
- (function(NetworkFilterTypes) {
10968
- NetworkFilterTypes["ALL"] = "all";
10969
- })(exports.NetworkFilterTypes || (exports.NetworkFilterTypes = {}));
10970
-
10971
-
10972
-
10973
-
10974
- exports.TokenFilterTypes = void 0;
10975
- (function(TokenFilterTypes) {
10976
- TokenFilterTypes["SWAP"] = "swap";
10977
- TokenFilterTypes["BRIDGE"] = "bridge";
10978
- TokenFilterTypes["ALL"] = "all";
10979
- })(exports.TokenFilterTypes || (exports.TokenFilterTypes = {}));
10980
-
10981
-
10982
- /**
10983
- * Interface representing token information.
10984
- * @property {string} name - The token name.
10985
- * @property {string} symbol - The token symbol.
10986
- * @property {number} decimals - The token decimals.
10987
- * @property {string} [address] - The token contract address.
10988
- * @property {string} [icon] - The token icon URL/data:image.
10989
- */
10990
-
10991
-
10992
-
10993
- var $4f91c5f280efe242$export$35b06f0d33f57e26;
10994
- (function(WalletAction) {
10995
- WalletAction["CHECK_CONNECTION"] = "eth_accounts";
10996
- WalletAction["CONNECT"] = "eth_requestAccounts";
10997
- WalletAction["ADD_NETWORK"] = "wallet_addEthereumChain";
10998
- WalletAction["SWITCH_NETWORK"] = "wallet_switchEthereumChain";
10999
- WalletAction["GET_CHAINID"] = "eth_chainId";
11000
- })($4f91c5f280efe242$export$35b06f0d33f57e26 || ($4f91c5f280efe242$export$35b06f0d33f57e26 = {}));
11001
- exports.WalletFilterTypes = void 0;
11002
- (function(WalletFilterTypes) {
11003
- WalletFilterTypes["ALL"] = "all";
11004
- WalletFilterTypes["DESKTOP"] = "desktop";
11005
- WalletFilterTypes["MOBILE"] = "mobile";
11006
- })(exports.WalletFilterTypes || (exports.WalletFilterTypes = {}));
11007
-
11008
-
11009
- exports.WalletProviderName = void 0;
11010
- (function(WalletProviderName) {
11011
- WalletProviderName["METAMASK"] = "metamask";
11012
- })(exports.WalletProviderName || (exports.WalletProviderName = {}));
11013
- const $e768639828688ca3$export$44dde05038008549 = {
11014
- allowMistmatchedChainId: false,
11015
- allowUnsupportedProvider: false
11016
- };
11017
-
11018
-
11019
-
11020
-
11021
-
11022
- /**
11023
- * The different types of errors that can be returned by the checkout process.
11024
- */ exports.CheckoutErrorType = void 0;
11025
- (function(CheckoutErrorType) {
11026
- CheckoutErrorType["WEB3_PROVIDER_ERROR"] = "WEB3_PROVIDER_ERROR";
11027
- CheckoutErrorType["PROVIDER_ERROR"] = "PROVIDER_ERROR";
11028
- CheckoutErrorType["DEFAULT_PROVIDER_ERROR"] = "DEFAULT_PROVIDER_ERROR";
11029
- CheckoutErrorType["CONNECT_PROVIDER_ERROR"] = "CONNECT_PROVIDER_ERROR";
11030
- CheckoutErrorType["GET_BALANCE_ERROR"] = "GET_BALANCE_ERROR";
11031
- CheckoutErrorType["GET_ERC20_BALANCE_ERROR"] = "GET_ERC20_BALANCE_ERROR";
11032
- CheckoutErrorType["GET_NETWORK_INFO_ERROR"] = "GET_NETWORK_INFO_ERROR";
11033
- CheckoutErrorType["METAMASK_PROVIDER_ERROR"] = "METAMASK_PROVIDER_ERROR";
11034
- CheckoutErrorType["CHAIN_NOT_SUPPORTED_ERROR"] = "CHAIN_NOT_SUPPORTED_ERROR";
11035
- CheckoutErrorType["PROVIDER_REQUEST_MISSING_ERROR"] = "PROVIDER_REQUEST_MISSING_ERROR";
11036
- CheckoutErrorType["PROVIDER_REQUEST_FAILED_ERROR"] = "PROVIDER_REQUEST_FAILED_ERROR";
11037
- CheckoutErrorType["USER_REJECTED_REQUEST_ERROR"] = "USER_REJECTED_REQUEST_ERROR";
11038
- CheckoutErrorType["TRANSACTION_FAILED"] = "TRANSACTION_FAILED";
11039
- CheckoutErrorType["INSUFFICIENT_FUNDS"] = "INSUFFICIENT_FUNDS";
11040
- CheckoutErrorType["UNPREDICTABLE_GAS_LIMIT"] = "UNPREDICTABLE_GAS_LIMIT";
11041
- CheckoutErrorType["INVALID_GAS_ESTIMATE_TYPE"] = "INVALID_GAS_ESTIMATE_TYPE";
11042
- })(exports.CheckoutErrorType || (exports.CheckoutErrorType = {}));
11043
- class $a8bc256d81a5e2c1$export$b722478a3cbfa3bc extends Error {
11044
- message;
11045
- type;
11046
- data;
11047
- constructor(message, type, data){
11048
- super(message);
11049
- this.message = message;
11050
- this.type = type;
11051
- this.data = data;
11052
- }
11053
- }
11054
- var $a8bc256d81a5e2c1$export$a22d4e0719ee6def;
11055
- (function(CheckoutInternalErrorType) {
11056
- CheckoutInternalErrorType["REJECTED_SWITCH_AFTER_ADDING_NETWORK"] = "REJECTED_SWITCH_AFTER_ADDING_NETWORK";
11057
- })($a8bc256d81a5e2c1$export$a22d4e0719ee6def || ($a8bc256d81a5e2c1$export$a22d4e0719ee6def = {}));
11058
- const $a8bc256d81a5e2c1$export$bacc563de539c6c3 = async (fn, customError)=>{
11059
- try {
11060
- return await fn();
11061
- } catch (error) {
11062
- const cause = `${error.message}` || "UnknownError";
11063
- const errorMessage = customError.message ? `[${customError.type}]:${customError.message}. Cause:${cause}` : `[${customError.type}] Cause:${cause}`;
11064
- if (error instanceof $a8bc256d81a5e2c1$export$b722478a3cbfa3bc) throw new $a8bc256d81a5e2c1$export$b722478a3cbfa3bc(errorMessage, customError.type, {
11065
- ...customError.data,
11066
- innerErrorType: error.type,
11067
- ...error.data
11068
- });
11069
- throw new $a8bc256d81a5e2c1$export$b722478a3cbfa3bc(errorMessage, customError.type, {
11070
- ...customError.data
11071
- });
11072
- }
11073
- };
11074
-
11075
-
11076
-
11077
-
11078
- /* eslint-disable @typescript-eslint/no-explicit-any */
11079
-
11080
-
11081
- // this function needs to be in a separate file to prevent circular dependencies with ./network
11082
-
11083
-
11084
- async function $a1555a1d2c8d059b$export$c3ba3e93a9fee972(web3Provider) {
11085
- if (!web3Provider.provider.request) throw new ($a8bc256d81a5e2c1$export$b722478a3cbfa3bc)("Parsed provider is not a valid Web3Provider", (exports.CheckoutErrorType).WEB3_PROVIDER_ERROR);
11086
- const chainId = await web3Provider.provider.request({
11087
- method: ($4f91c5f280efe242$export$35b06f0d33f57e26).GET_CHAINID,
11088
- params: []
11089
- });
11090
- return parseInt(chainId, 16);
11091
- }
11092
-
11093
-
11094
- const $de192de6ef100f9f$var$UNRECOGNISED_CHAIN_ERROR_CODE = 4902; // error code (MetaMask)
11095
- // these functions should not be exported. These functions should be used as part of an exported function e.g switchWalletNetwork() above.
11096
- // make sure to check if(provider.provider?.request) in the exported function and throw an error
11097
- // eslint-disable-next-line consistent-return
11098
- async function $de192de6ef100f9f$var$switchNetworkInWallet(networkMap, web3Provider, chainId) {
11099
- if (web3Provider.provider?.request) return await web3Provider.provider.request({
11100
- method: ($4f91c5f280efe242$export$35b06f0d33f57e26).SWITCH_NETWORK,
11101
- params: [
11102
- {
11103
- chainId: networkMap.get(chainId)?.chainIdHex
11104
- }
11105
- ]
11106
- });
11107
- }
11108
- // TODO: Should these functions always return something?
11109
- // eslint-disable-next-line consistent-return
11110
- async function $de192de6ef100f9f$var$addNetworkToWallet(networkMap, web3Provider, chainId) {
11111
- if (web3Provider.provider?.request) {
11112
- const networkDetails = networkMap.get(chainId);
11113
- const addNetwork = {
11114
- chainId: networkDetails?.chainIdHex,
11115
- chainName: networkDetails?.chainName,
11116
- rpcUrls: networkDetails?.rpcUrls,
11117
- nativeCurrency: networkDetails?.nativeCurrency,
11118
- blockExplorerUrls: networkDetails?.blockExplorerUrls
11119
- };
11120
- return await web3Provider.provider.request({
11121
- method: ($4f91c5f280efe242$export$35b06f0d33f57e26).ADD_NETWORK,
11122
- params: [
11123
- addNetwork
11124
- ]
11125
- });
11126
- }
11127
- }
11128
- async function $de192de6ef100f9f$export$3043f6442a9ef563(config, { type: type = (exports.NetworkFilterTypes).ALL , exclude: exclude }) {
11129
- const { networkMap: networkMap } = config;
11130
- const allowedNetworkConfig = await config.remoteConfigFetcher.get("allowedNetworks");
11131
- const list = allowedNetworkConfig.filter((network)=>{
11132
- const allowAllTokens = type === (exports.NetworkFilterTypes).ALL;
11133
- const networkNotExcluded = !(exclude || []).map((exc)=>exc.chainId).includes(network.chainId);
11134
- return allowAllTokens && networkNotExcluded;
11135
- });
11136
- const allowedNetworks = [];
11137
- list.forEach((element)=>{
11138
- const newNetwork = networkMap.get(element.chainId);
11139
- if (newNetwork) allowedNetworks.push({
11140
- name: newNetwork.chainName,
11141
- chainId: parseInt(newNetwork.chainIdHex, 16),
11142
- nativeCurrency: newNetwork.nativeCurrency,
11143
- isSupported: true
11144
- });
11145
- });
11146
- return {
11147
- networks: allowedNetworks
11148
- };
11149
- }
11150
- async function $de192de6ef100f9f$export$79f13b4cfaaf0d09(config, web3Provider) {
11151
- const { networkMap: networkMap } = config;
11152
- return ($a8bc256d81a5e2c1$export$bacc563de539c6c3)(async ()=>{
11153
- try {
11154
- const network = await web3Provider.getNetwork();
11155
- if (Array.from(networkMap.keys()).includes(network.chainId)) {
11156
- const chainIdNetworkInfo = networkMap.get(network.chainId);
11157
- return {
11158
- name: chainIdNetworkInfo.chainName,
11159
- chainId: parseInt(chainIdNetworkInfo.chainIdHex, 16),
11160
- nativeCurrency: chainIdNetworkInfo.nativeCurrency,
11161
- isSupported: true
11162
- };
11163
- }
11164
- return {
11165
- chainId: network.chainId,
11166
- name: network.name,
11167
- isSupported: false
11168
- };
11169
- } catch (err) {
11170
- const chainId = await ($a1555a1d2c8d059b$export$c3ba3e93a9fee972)(web3Provider);
11171
- const isSupported = Array.from(networkMap.keys()).includes(chainId);
11172
- return {
11173
- chainId: chainId,
11174
- isSupported: isSupported
11175
- };
11176
- }
11177
- }, {
11178
- type: (exports.CheckoutErrorType).GET_NETWORK_INFO_ERROR
11179
- });
11180
- }
11181
- async function $de192de6ef100f9f$export$b827d9418aeb5dbd(config, web3Provider, chainId) {
11182
- const { networkMap: networkMap } = config;
11183
- const allowedNetworks = await $de192de6ef100f9f$export$3043f6442a9ef563(config, {
11184
- type: (exports.NetworkFilterTypes).ALL
11185
- });
11186
- if (!allowedNetworks.networks.some((network)=>network.chainId === chainId)) throw new ($a8bc256d81a5e2c1$export$b722478a3cbfa3bc)(`Chain:${chainId} is not a supported chain`, (exports.CheckoutErrorType).CHAIN_NOT_SUPPORTED_ERROR);
11187
- // WT-1146 - Refer to the README in this folder for explantion on the switch network flow
11188
- try {
11189
- await $de192de6ef100f9f$var$switchNetworkInWallet(networkMap, web3Provider, chainId);
11190
- } catch (err) {
11191
- if (err.code === $de192de6ef100f9f$var$UNRECOGNISED_CHAIN_ERROR_CODE) try {
11192
- await $de192de6ef100f9f$var$addNetworkToWallet(networkMap, web3Provider, chainId);
11193
- // eslint-disable-next-line @typescript-eslint/no-shadow
11194
- } catch (err) {
11195
- throw new ($a8bc256d81a5e2c1$export$b722478a3cbfa3bc)("User cancelled add network request", (exports.CheckoutErrorType).USER_REJECTED_REQUEST_ERROR);
11196
- }
11197
- else throw new ($a8bc256d81a5e2c1$export$b722478a3cbfa3bc)("User cancelled switch network request", (exports.CheckoutErrorType).USER_REJECTED_REQUEST_ERROR);
11198
- }
11199
- const newProvider = new (providers.Web3Provider)(web3Provider.provider);
11200
- const newProviderNetwork = await newProvider.getNetwork();
11201
- if (newProviderNetwork.chainId !== chainId) throw new ($a8bc256d81a5e2c1$export$b722478a3cbfa3bc)("User cancelled switch network request", (exports.CheckoutErrorType).USER_REJECTED_REQUEST_ERROR);
11202
- const networkInfo = await $de192de6ef100f9f$export$79f13b4cfaaf0d09(config, newProvider);
11203
- return {
11204
- network: networkInfo,
11205
- provider: newProvider
11206
- };
11207
- }
11208
-
11209
-
11210
-
11211
-
11212
-
11213
- var $cda6003506e4182e$exports = {};
11214
- $cda6003506e4182e$exports = JSON.parse("[{\"chainId\":13383,\"name\":\"IMX\",\"symbol\":\"IMX\",\"decimals\":18,\"icon\":\"data:image/svg+xml,%3C%3Fxml version='1.0' encoding='utf-8'%3F%3E%3Csvg version='1.1' id='Layer_1' xmlns='http://www.w3.org/2000/svg' xmlns:xlink='http://www.w3.org/1999/xlink' x='0px' y='0px' viewBox='0 0 139 113' style='enable-background:new 0 0 139 113;' xml:space='preserve'%3E%3Cstyle type='text/css'%3E .st0%7Bclip-path:url(%23SVGID_00000053504646934646330740000009134454895836103350_);%7D .st1%7Bfill:%2317B5CB;%7D%0A%3C/style%3E%3Cg%3E%3Cdefs%3E%3Crect id='SVGID_1_' width='139' height='113'/%3E%3C/defs%3E%3CclipPath id='SVGID_00000035518931339590433170000002358037249938198420_'%3E%3Cuse xlink:href='%23SVGID_1_' style='overflow:visible;'/%3E%3C/clipPath%3E%3Cg style='clip-path:url(%23SVGID_00000035518931339590433170000002358037249938198420_);'%3E%3Cpath class='st1' d='M124.1,0h14.6L79.5,67.6c-1.5,1.7-1.6,4.3-0.1,6.1l34.1,39.7H98.3L66.8,76.6l-1.6-2c-1.5-1.7-1.4-4.4,0.1-6.1 L124.1,0z'/%3E%3Cpath class='st1' d='M91.2,73.7c-1-1.1-1.3-2.7-1-4.1c0.3-0.8,0.8-1.6,1.4-2.2l3.9-4.3l43.5,50.3h-13.8 C125.2,113.4,99.7,83.6,91.2,73.7z'/%3E%3Cpath class='st1' d='M15.2,113.4H0l46.6-53.9c1.5-1.7,1.5-4.3,0-6L0.4,0H15l46.5,53.9c1.2,1.6,1.4,3.9,0.1,5.4 C49.4,73.4,15.2,113.4,15.2,113.4z'/%3E%3Cpath class='st1' d='M40.6,0h-14l43.1,49.9c0,0,0.1-0.1,4.9-5.8c1.3-1.5,1.6-3.4,0.1-4.9C65.7,30,40.6,0,40.6,0z'/%3E%3Cpath class='st1' d='M82.6,34.8L112.5,0H98.3L82.7,18.2l-4.5,5.3c-1.5,1.7-1.6,4.3-0.1,6.1C79.2,30.9,82.6,34.8,82.6,34.8z'/%3E%3Cpath class='st1' d='M56.6,78.6l-29.9,34.8h14.1l15.6-18.2l4.5-5.3c1.5-1.7,1.6-4.3,0.1-6.1C59.9,82.5,56.6,78.6,56.6,78.6z'/%3E%3C/g%3E%3C/g%3E%3C/svg%3E%0A\",\"tokenFeatures\":[\"swap\",\"bridge\"]},{\"chainId\":13383,\"name\":\"FUN token\",\"address\":\"0xFEa9FF93DC0C6DC73F8Be009Fe7a22Bb9dcE8A2d\",\"symbol\":\"FUN\",\"decimals\":18,\"icon\":\"data:image/svg+xml,%3C%3Fxml version='1.0' encoding='UTF-8'%3F%3E%3C!DOCTYPE svg PUBLIC '-//W3C//DTD SVG 1.1//EN' 'http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd'%3E%3Csvg xmlns='http://www.w3.org/2000/svg' xml:space='preserve' width='100%25' height='100%25' version='1.1' shape-rendering='geometricPrecision' text-rendering='geometricPrecision' image-rendering='optimizeQuality' fill-rule='evenodd' clip-rule='evenodd'%0AviewBox='0 0 784.37 1277.39' xmlns:xlink='http://www.w3.org/1999/xlink' xmlns:xodm='http://www.corel.com/coreldraw/odm/2003'%3E%3Cg id='Layer_x0020_1'%3E%3Cmetadata id='CorelCorpID_0Corel-Layer'/%3E%3Cg id='_1421394342400'%3E%3Cg%3E%3Cpolygon fill='%23343434' fill-rule='nonzero' points='392.07,0 383.5,29.11 383.5,873.74 392.07,882.29 784.13,650.54 '/%3E%3Cpolygon fill='%238C8C8C' fill-rule='nonzero' points='392.07,0 -0,650.54 392.07,882.29 392.07,472.33 '/%3E%3Cpolygon fill='%233C3C3B' fill-rule='nonzero' points='392.07,956.52 387.24,962.41 387.24,1263.28 392.07,1277.38 784.37,724.89 '/%3E%3Cpolygon fill='%238C8C8C' fill-rule='nonzero' points='392.07,1277.38 392.07,956.52 -0,724.89 '/%3E%3Cpolygon fill='%23141414' fill-rule='nonzero' points='392.07,882.29 784.13,650.54 392.07,472.33 '/%3E%3Cpolygon fill='%23393939' fill-rule='nonzero' points='0,650.54 392.07,882.29 392.07,472.33 '/%3E%3C/g%3E%3C/g%3E%3C/g%3E%3C/svg%3E%0A\",\"tokenFeatures\":[\"swap\",\"bridge\"]},{\"chainId\":13383,\"name\":\"USDC\",\"address\":\"0x5893A5c7bc615Dfd36D7383366d00FFFca5f7178\",\"symbol\":\"USDC\",\"decimals\":18,\"icon\":\"data:image/svg+xml,%3C%3Fxml version='1.0' encoding='UTF-8'%3F%3E%3C!DOCTYPE svg PUBLIC '-//W3C//DTD SVG 1.1//EN' 'http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd'%3E%3Csvg xmlns='http://www.w3.org/2000/svg' xml:space='preserve' width='100%25' height='100%25' version='1.1' shape-rendering='geometricPrecision' text-rendering='geometricPrecision' image-rendering='optimizeQuality' fill-rule='evenodd' clip-rule='evenodd'%0AviewBox='0 0 784.37 1277.39' xmlns:xlink='http://www.w3.org/1999/xlink' xmlns:xodm='http://www.corel.com/coreldraw/odm/2003'%3E%3Cg id='Layer_x0020_1'%3E%3Cmetadata id='CorelCorpID_0Corel-Layer'/%3E%3Cg id='_1421394342400'%3E%3Cg%3E%3Cpolygon fill='%23343434' fill-rule='nonzero' points='392.07,0 383.5,29.11 383.5,873.74 392.07,882.29 784.13,650.54 '/%3E%3Cpolygon fill='%238C8C8C' fill-rule='nonzero' points='392.07,0 -0,650.54 392.07,882.29 392.07,472.33 '/%3E%3Cpolygon fill='%233C3C3B' fill-rule='nonzero' points='392.07,956.52 387.24,962.41 387.24,1263.28 392.07,1277.38 784.37,724.89 '/%3E%3Cpolygon fill='%238C8C8C' fill-rule='nonzero' points='392.07,1277.38 392.07,956.52 -0,724.89 '/%3E%3Cpolygon fill='%23141414' fill-rule='nonzero' points='392.07,882.29 784.13,650.54 392.07,472.33 '/%3E%3Cpolygon fill='%23393939' fill-rule='nonzero' points='0,650.54 392.07,882.29 392.07,472.33 '/%3E%3C/g%3E%3C/g%3E%3C/g%3E%3C/svg%3E%0A\",\"tokenFeatures\":[\"swap\",\"bridge\"]},{\"chainId\":13383,\"name\":\"WETH\",\"address\":\"0xD6d9321DCC42377C1fa8cFec665182c463b2392C\",\"symbol\":\"WETH\",\"decimals\":18,\"icon\":\"data:image/svg+xml,%3C%3Fxml version='1.0' encoding='UTF-8'%3F%3E%3C!DOCTYPE svg PUBLIC '-//W3C//DTD SVG 1.1//EN' 'http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd'%3E%3Csvg xmlns='http://www.w3.org/2000/svg' xml:space='preserve' width='100%25' height='100%25' version='1.1' shape-rendering='geometricPrecision' text-rendering='geometricPrecision' image-rendering='optimizeQuality' fill-rule='evenodd' clip-rule='evenodd'%0AviewBox='0 0 784.37 1277.39' xmlns:xlink='http://www.w3.org/1999/xlink' xmlns:xodm='http://www.corel.com/coreldraw/odm/2003'%3E%3Cg id='Layer_x0020_1'%3E%3Cmetadata id='CorelCorpID_0Corel-Layer'/%3E%3Cg id='_1421394342400'%3E%3Cg%3E%3Cpolygon fill='%23343434' fill-rule='nonzero' points='392.07,0 383.5,29.11 383.5,873.74 392.07,882.29 784.13,650.54 '/%3E%3Cpolygon fill='%238C8C8C' fill-rule='nonzero' points='392.07,0 -0,650.54 392.07,882.29 392.07,472.33 '/%3E%3Cpolygon fill='%233C3C3B' fill-rule='nonzero' points='392.07,956.52 387.24,962.41 387.24,1263.28 392.07,1277.38 784.37,724.89 '/%3E%3Cpolygon fill='%238C8C8C' fill-rule='nonzero' points='392.07,1277.38 392.07,956.52 -0,724.89 '/%3E%3Cpolygon fill='%23141414' fill-rule='nonzero' points='392.07,882.29 784.13,650.54 392.07,472.33 '/%3E%3Cpolygon fill='%23393939' fill-rule='nonzero' points='0,650.54 392.07,882.29 392.07,472.33 '/%3E%3C/g%3E%3C/g%3E%3C/g%3E%3C/svg%3E%0A\",\"tokenFeatures\":[\"swap\",\"bridge\"]},{\"chainId\":1,\"name\":\"Ethereum\",\"symbol\":\"ETH\",\"decimals\":18,\"icon\":\"data:image/svg+xml,%3C%3Fxml version='1.0' encoding='UTF-8'%3F%3E%3C!DOCTYPE svg PUBLIC '-//W3C//DTD SVG 1.1//EN' 'http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd'%3E%3Csvg xmlns='http://www.w3.org/2000/svg' xml:space='preserve' width='100%25' height='100%25' version='1.1' shape-rendering='geometricPrecision' text-rendering='geometricPrecision' image-rendering='optimizeQuality' fill-rule='evenodd' clip-rule='evenodd'%0AviewBox='0 0 784.37 1277.39' xmlns:xlink='http://www.w3.org/1999/xlink' xmlns:xodm='http://www.corel.com/coreldraw/odm/2003'%3E%3Cg id='Layer_x0020_1'%3E%3Cmetadata id='CorelCorpID_0Corel-Layer'/%3E%3Cg id='_1421394342400'%3E%3Cg%3E%3Cpolygon fill='%23343434' fill-rule='nonzero' points='392.07,0 383.5,29.11 383.5,873.74 392.07,882.29 784.13,650.54 '/%3E%3Cpolygon fill='%238C8C8C' fill-rule='nonzero' points='392.07,0 -0,650.54 392.07,882.29 392.07,472.33 '/%3E%3Cpolygon fill='%233C3C3B' fill-rule='nonzero' points='392.07,956.52 387.24,962.41 387.24,1263.28 392.07,1277.38 784.37,724.89 '/%3E%3Cpolygon fill='%238C8C8C' fill-rule='nonzero' points='392.07,1277.38 392.07,956.52 -0,724.89 '/%3E%3Cpolygon fill='%23141414' fill-rule='nonzero' points='392.07,882.29 784.13,650.54 392.07,472.33 '/%3E%3Cpolygon fill='%23393939' fill-rule='nonzero' points='0,650.54 392.07,882.29 392.07,472.33 '/%3E%3C/g%3E%3C/g%3E%3C/g%3E%3C/svg%3E%0A\",\"tokenFeatures\":[\"swap\",\"bridge\"]},{\"address\":\"0xF57e7e7C23978C3cAEC3C3548E3D615c346e79fF\",\"chainId\":1,\"name\":\"Immutable X\",\"symbol\":\"IMX\",\"decimals\":18,\"icon\":\"data:image/svg+xml,%3C%3Fxml version='1.0' encoding='utf-8'%3F%3E%3Csvg version='1.1' id='Layer_1' xmlns='http://www.w3.org/2000/svg' xmlns:xlink='http://www.w3.org/1999/xlink' x='0px' y='0px' viewBox='0 0 139 113' style='enable-background:new 0 0 139 113;' xml:space='preserve'%3E%3Cstyle type='text/css'%3E .st0%7Bclip-path:url(%23SVGID_00000053504646934646330740000009134454895836103350_);%7D .st1%7Bfill:%2317B5CB;%7D%0A%3C/style%3E%3Cg%3E%3Cdefs%3E%3Crect id='SVGID_1_' width='139' height='113'/%3E%3C/defs%3E%3CclipPath id='SVGID_00000035518931339590433170000002358037249938198420_'%3E%3Cuse xlink:href='%23SVGID_1_' style='overflow:visible;'/%3E%3C/clipPath%3E%3Cg style='clip-path:url(%23SVGID_00000035518931339590433170000002358037249938198420_);'%3E%3Cpath class='st1' d='M124.1,0h14.6L79.5,67.6c-1.5,1.7-1.6,4.3-0.1,6.1l34.1,39.7H98.3L66.8,76.6l-1.6-2c-1.5-1.7-1.4-4.4,0.1-6.1 L124.1,0z'/%3E%3Cpath class='st1' d='M91.2,73.7c-1-1.1-1.3-2.7-1-4.1c0.3-0.8,0.8-1.6,1.4-2.2l3.9-4.3l43.5,50.3h-13.8 C125.2,113.4,99.7,83.6,91.2,73.7z'/%3E%3Cpath class='st1' d='M15.2,113.4H0l46.6-53.9c1.5-1.7,1.5-4.3,0-6L0.4,0H15l46.5,53.9c1.2,1.6,1.4,3.9,0.1,5.4 C49.4,73.4,15.2,113.4,15.2,113.4z'/%3E%3Cpath class='st1' d='M40.6,0h-14l43.1,49.9c0,0,0.1-0.1,4.9-5.8c1.3-1.5,1.6-3.4,0.1-4.9C65.7,30,40.6,0,40.6,0z'/%3E%3Cpath class='st1' d='M82.6,34.8L112.5,0H98.3L82.7,18.2l-4.5,5.3c-1.5,1.7-1.6,4.3-0.1,6.1C79.2,30.9,82.6,34.8,82.6,34.8z'/%3E%3Cpath class='st1' d='M56.6,78.6l-29.9,34.8h14.1l15.6-18.2l4.5-5.3c1.5-1.7,1.6-4.3,0.1-6.1C59.9,82.5,56.6,78.6,56.6,78.6z'/%3E%3C/g%3E%3C/g%3E%3C/svg%3E%0A\",\"tokenFeatures\":[\"swap\",\"bridge\"]},{\"chainId\":11155111,\"name\":\"Sep Eth\",\"symbol\":\"ETH\",\"decimals\":18,\"icon\":\"data:image/svg+xml,%3C%3Fxml version='1.0' encoding='UTF-8'%3F%3E%3C!DOCTYPE svg PUBLIC '-//W3C//DTD SVG 1.1//EN' 'http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd'%3E%3Csvg xmlns='http://www.w3.org/2000/svg' xml:space='preserve' width='100%25' height='100%25' version='1.1' shape-rendering='geometricPrecision' text-rendering='geometricPrecision' image-rendering='optimizeQuality' fill-rule='evenodd' clip-rule='evenodd'%0AviewBox='0 0 784.37 1277.39' xmlns:xlink='http://www.w3.org/1999/xlink' xmlns:xodm='http://www.corel.com/coreldraw/odm/2003'%3E%3Cg id='Layer_x0020_1'%3E%3Cmetadata id='CorelCorpID_0Corel-Layer'/%3E%3Cg id='_1421394342400'%3E%3Cg%3E%3Cpolygon fill='%23343434' fill-rule='nonzero' points='392.07,0 383.5,29.11 383.5,873.74 392.07,882.29 784.13,650.54 '/%3E%3Cpolygon fill='%238C8C8C' fill-rule='nonzero' points='392.07,0 -0,650.54 392.07,882.29 392.07,472.33 '/%3E%3Cpolygon fill='%233C3C3B' fill-rule='nonzero' points='392.07,956.52 387.24,962.41 387.24,1263.28 392.07,1277.38 784.37,724.89 '/%3E%3Cpolygon fill='%238C8C8C' fill-rule='nonzero' points='392.07,1277.38 392.07,956.52 -0,724.89 '/%3E%3Cpolygon fill='%23141414' fill-rule='nonzero' points='392.07,882.29 784.13,650.54 392.07,472.33 '/%3E%3Cpolygon fill='%23393939' fill-rule='nonzero' points='0,650.54 392.07,882.29 392.07,472.33 '/%3E%3C/g%3E%3C/g%3E%3C/g%3E%3C/svg%3E%0A\",\"tokenFeatures\":[\"swap\"]},{\"chainId\":11155111,\"name\":\"Immutable Test token\",\"address\":\"0xd1da7e9b2Ce1a4024DaD52b3D37F4c5c91a525C1\",\"symbol\":\"TEST\",\"decimals\":18,\"icon\":\"data:image/svg+xml,%3C%3Fxml version='1.0' encoding='utf-8'%3F%3E%3Csvg version='1.1' id='Layer_1' xmlns='http://www.w3.org/2000/svg' xmlns:xlink='http://www.w3.org/1999/xlink' x='0px' y='0px' viewBox='0 0 139 113' style='enable-background:new 0 0 139 113;' xml:space='preserve'%3E%3Cstyle type='text/css'%3E .st0%7Bclip-path:url(%23SVGID_00000053504646934646330740000009134454895836103350_);%7D .st1%7Bfill:%2317B5CB;%7D%0A%3C/style%3E%3Cg%3E%3Cdefs%3E%3Crect id='SVGID_1_' width='139' height='113'/%3E%3C/defs%3E%3CclipPath id='SVGID_00000035518931339590433170000002358037249938198420_'%3E%3Cuse xlink:href='%23SVGID_1_' style='overflow:visible;'/%3E%3C/clipPath%3E%3Cg style='clip-path:url(%23SVGID_00000035518931339590433170000002358037249938198420_);'%3E%3Cpath class='st1' d='M124.1,0h14.6L79.5,67.6c-1.5,1.7-1.6,4.3-0.1,6.1l34.1,39.7H98.3L66.8,76.6l-1.6-2c-1.5-1.7-1.4-4.4,0.1-6.1 L124.1,0z'/%3E%3Cpath class='st1' d='M91.2,73.7c-1-1.1-1.3-2.7-1-4.1c0.3-0.8,0.8-1.6,1.4-2.2l3.9-4.3l43.5,50.3h-13.8 C125.2,113.4,99.7,83.6,91.2,73.7z'/%3E%3Cpath class='st1' d='M15.2,113.4H0l46.6-53.9c1.5-1.7,1.5-4.3,0-6L0.4,0H15l46.5,53.9c1.2,1.6,1.4,3.9,0.1,5.4 C49.4,73.4,15.2,113.4,15.2,113.4z'/%3E%3Cpath class='st1' d='M40.6,0h-14l43.1,49.9c0,0,0.1-0.1,4.9-5.8c1.3-1.5,1.6-3.4,0.1-4.9C65.7,30,40.6,0,40.6,0z'/%3E%3Cpath class='st1' d='M82.6,34.8L112.5,0H98.3L82.7,18.2l-4.5,5.3c-1.5,1.7-1.6,4.3-0.1,6.1C79.2,30.9,82.6,34.8,82.6,34.8z'/%3E%3Cpath class='st1' d='M56.6,78.6l-29.9,34.8h14.1l15.6-18.2l4.5-5.3c1.5-1.7,1.6-4.3,0.1-6.1C59.9,82.5,56.6,78.6,56.6,78.6z'/%3E%3C/g%3E%3C/g%3E%3C/svg%3E%0A\",\"tokenFeatures\":[\"swap\",\"bridge\"]},{\"chainId\":11155111,\"name\":\"FUN token\",\"address\":\"0x741185AEFC3E539c1F42c1d6eeE8bFf1c89D70FE\",\"symbol\":\"FUN\",\"decimals\":18,\"icon\":\"data:image/svg+xml,%3C%3Fxml version='1.0' encoding='UTF-8'%3F%3E%3C!DOCTYPE svg PUBLIC '-//W3C//DTD SVG 1.1//EN' 'http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd'%3E%3Csvg xmlns='http://www.w3.org/2000/svg' xml:space='preserve' width='100%25' height='100%25' version='1.1' shape-rendering='geometricPrecision' text-rendering='geometricPrecision' image-rendering='optimizeQuality' fill-rule='evenodd' clip-rule='evenodd'%0AviewBox='0 0 784.37 1277.39' xmlns:xlink='http://www.w3.org/1999/xlink' xmlns:xodm='http://www.corel.com/coreldraw/odm/2003'%3E%3Cg id='Layer_x0020_1'%3E%3Cmetadata id='CorelCorpID_0Corel-Layer'/%3E%3Cg id='_1421394342400'%3E%3Cg%3E%3Cpolygon fill='%23343434' fill-rule='nonzero' points='392.07,0 383.5,29.11 383.5,873.74 392.07,882.29 784.13,650.54 '/%3E%3Cpolygon fill='%238C8C8C' fill-rule='nonzero' points='392.07,0 -0,650.54 392.07,882.29 392.07,472.33 '/%3E%3Cpolygon fill='%233C3C3B' fill-rule='nonzero' points='392.07,956.52 387.24,962.41 387.24,1263.28 392.07,1277.38 784.37,724.89 '/%3E%3Cpolygon fill='%238C8C8C' fill-rule='nonzero' points='392.07,1277.38 392.07,956.52 -0,724.89 '/%3E%3Cpolygon fill='%23141414' fill-rule='nonzero' points='392.07,882.29 784.13,650.54 392.07,472.33 '/%3E%3Cpolygon fill='%23393939' fill-rule='nonzero' points='0,650.54 392.07,882.29 392.07,472.33 '/%3E%3C/g%3E%3C/g%3E%3C/g%3E%3C/svg%3E%0A\",\"tokenFeatures\":[\"swap\",\"bridge\"]},{\"chainId\":11155111,\"name\":\"US Dollar Coin\",\"address\":\"0x1836E16b2036088490C2CFe4d11970Fc8e5884C4\",\"symbol\":\"USDC\",\"decimals\":18,\"icon\":\"data:image/svg+xml,%3C%3Fxml version='1.0' encoding='UTF-8'%3F%3E%3C!DOCTYPE svg PUBLIC '-//W3C//DTD SVG 1.1//EN' 'http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd'%3E%3Csvg xmlns='http://www.w3.org/2000/svg' xml:space='preserve' width='100%25' height='100%25' version='1.1' shape-rendering='geometricPrecision' text-rendering='geometricPrecision' image-rendering='optimizeQuality' fill-rule='evenodd' clip-rule='evenodd'%0AviewBox='0 0 784.37 1277.39' xmlns:xlink='http://www.w3.org/1999/xlink' xmlns:xodm='http://www.corel.com/coreldraw/odm/2003'%3E%3Cg id='Layer_x0020_1'%3E%3Cmetadata id='CorelCorpID_0Corel-Layer'/%3E%3Cg id='_1421394342400'%3E%3Cg%3E%3Cpolygon fill='%23343434' fill-rule='nonzero' points='392.07,0 383.5,29.11 383.5,873.74 392.07,882.29 784.13,650.54 '/%3E%3Cpolygon fill='%238C8C8C' fill-rule='nonzero' points='392.07,0 -0,650.54 392.07,882.29 392.07,472.33 '/%3E%3Cpolygon fill='%233C3C3B' fill-rule='nonzero' points='392.07,956.52 387.24,962.41 387.24,1263.28 392.07,1277.38 784.37,724.89 '/%3E%3Cpolygon fill='%238C8C8C' fill-rule='nonzero' points='392.07,1277.38 392.07,956.52 -0,724.89 '/%3E%3Cpolygon fill='%23141414' fill-rule='nonzero' points='392.07,882.29 784.13,650.54 392.07,472.33 '/%3E%3Cpolygon fill='%23393939' fill-rule='nonzero' points='0,650.54 392.07,882.29 392.07,472.33 '/%3E%3C/g%3E%3C/g%3E%3C/g%3E%3C/svg%3E%0A\",\"tokenFeatures\":[\"swap\",\"bridge\"]},{\"chainId\":13383,\"name\":\"DEX\",\"address\":\"0x8AC26EfCbf5D700b37A27aA00E6934e6904e7B8e\",\"symbol\":\"DEX\",\"decimals\":18,\"icon\":\"data:image/svg+xml,%3C%3Fxml version='1.0' encoding='UTF-8'%3F%3E%3C!DOCTYPE svg PUBLIC '-//W3C//DTD SVG 1.1//EN' 'http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd'%3E%3Csvg xmlns='http://www.w3.org/2000/svg' xml:space='preserve' width='100%25' height='100%25' version='1.1' shape-rendering='geometricPrecision' text-rendering='geometricPrecision' image-rendering='optimizeQuality' fill-rule='evenodd' clip-rule='evenodd'%0AviewBox='0 0 784.37 1277.39' xmlns:xlink='http://www.w3.org/1999/xlink' xmlns:xodm='http://www.corel.com/coreldraw/odm/2003'%3E%3Cg id='Layer_x0020_1'%3E%3Cmetadata id='CorelCorpID_0Corel-Layer'/%3E%3Cg id='_1421394342400'%3E%3Cg%3E%3Cpolygon fill='%23343434' fill-rule='nonzero' points='392.07,0 383.5,29.11 383.5,873.74 392.07,882.29 784.13,650.54 '/%3E%3Cpolygon fill='%238C8C8C' fill-rule='nonzero' points='392.07,0 -0,650.54 392.07,882.29 392.07,472.33 '/%3E%3Cpolygon fill='%233C3C3B' fill-rule='nonzero' points='392.07,956.52 387.24,962.41 387.24,1263.28 392.07,1277.38 784.37,724.89 '/%3E%3Cpolygon fill='%238C8C8C' fill-rule='nonzero' points='392.07,1277.38 392.07,956.52 -0,724.89 '/%3E%3Cpolygon fill='%23141414' fill-rule='nonzero' points='392.07,882.29 784.13,650.54 392.07,472.33 '/%3E%3Cpolygon fill='%23393939' fill-rule='nonzero' points='0,650.54 392.07,882.29 392.07,472.33 '/%3E%3C/g%3E%3C/g%3E%3C/g%3E%3C/svg%3E%0A\",\"tokenFeatures\":[\"swap\",\"bridge\"]},{\"chainId\":11155111,\"name\":\"DEX\",\"address\":\"0xaC953a0d7B67Fae17c87abf79f09D0f818AC66A2\",\"symbol\":\"DEX\",\"decimals\":18,\"icon\":\"data:image/svg+xml,%3C%3Fxml version='1.0' encoding='UTF-8'%3F%3E%3C!DOCTYPE svg PUBLIC '-//W3C//DTD SVG 1.1//EN' 'http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd'%3E%3Csvg xmlns='http://www.w3.org/2000/svg' xml:space='preserve' width='100%25' height='100%25' version='1.1' shape-rendering='geometricPrecision' text-rendering='geometricPrecision' image-rendering='optimizeQuality' fill-rule='evenodd' clip-rule='evenodd'%0AviewBox='0 0 784.37 1277.39' xmlns:xlink='http://www.w3.org/1999/xlink' xmlns:xodm='http://www.corel.com/coreldraw/odm/2003'%3E%3Cg id='Layer_x0020_1'%3E%3Cmetadata id='CorelCorpID_0Corel-Layer'/%3E%3Cg id='_1421394342400'%3E%3Cg%3E%3Cpolygon fill='%23343434' fill-rule='nonzero' points='392.07,0 383.5,29.11 383.5,873.74 392.07,882.29 784.13,650.54 '/%3E%3Cpolygon fill='%238C8C8C' fill-rule='nonzero' points='392.07,0 -0,650.54 392.07,882.29 392.07,472.33 '/%3E%3Cpolygon fill='%233C3C3B' fill-rule='nonzero' points='392.07,956.52 387.24,962.41 387.24,1263.28 392.07,1277.38 784.37,724.89 '/%3E%3Cpolygon fill='%238C8C8C' fill-rule='nonzero' points='392.07,1277.38 392.07,956.52 -0,724.89 '/%3E%3Cpolygon fill='%23141414' fill-rule='nonzero' points='392.07,882.29 784.13,650.54 392.07,472.33 '/%3E%3Cpolygon fill='%23393939' fill-rule='nonzero' points='0,650.54 392.07,882.29 392.07,472.33 '/%3E%3C/g%3E%3C/g%3E%3C/g%3E%3C/svg%3E%0A\",\"tokenFeatures\":[\"swap\",\"bridge\"]},{\"chainId\":1442,\"name\":\"WETH\",\"address\":\"0x4F062A3EAeC3730560aB89b5CE5aC0ab2C5517aE\",\"symbol\":\"WETH\",\"decimals\":18,\"icon\":\"data:image/svg+xml,%3C%3Fxml version='1.0' encoding='UTF-8'%3F%3E%3C!DOCTYPE svg PUBLIC '-//W3C//DTD SVG 1.1//EN' 'http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd'%3E%3Csvg xmlns='http://www.w3.org/2000/svg' xml:space='preserve' width='100%25' height='100%25' version='1.1' shape-rendering='geometricPrecision' text-rendering='geometricPrecision' image-rendering='optimizeQuality' fill-rule='evenodd' clip-rule='evenodd'%0AviewBox='0 0 784.37 1277.39' xmlns:xlink='http://www.w3.org/1999/xlink' xmlns:xodm='http://www.corel.com/coreldraw/odm/2003'%3E%3Cg id='Layer_x0020_1'%3E%3Cmetadata id='CorelCorpID_0Corel-Layer'/%3E%3Cg id='_1421394342400'%3E%3Cg%3E%3Cpolygon fill='%23343434' fill-rule='nonzero' points='392.07,0 383.5,29.11 383.5,873.74 392.07,882.29 784.13,650.54 '/%3E%3Cpolygon fill='%238C8C8C' fill-rule='nonzero' points='392.07,0 -0,650.54 392.07,882.29 392.07,472.33 '/%3E%3Cpolygon fill='%233C3C3B' fill-rule='nonzero' points='392.07,956.52 387.24,962.41 387.24,1263.28 392.07,1277.38 784.37,724.89 '/%3E%3Cpolygon fill='%238C8C8C' fill-rule='nonzero' points='392.07,1277.38 392.07,956.52 -0,724.89 '/%3E%3Cpolygon fill='%23141414' fill-rule='nonzero' points='392.07,882.29 784.13,650.54 392.07,472.33 '/%3E%3Cpolygon fill='%23393939' fill-rule='nonzero' points='0,650.54 392.07,882.29 392.07,472.33 '/%3E%3C/g%3E%3C/g%3E%3C/g%3E%3C/svg%3E%0A\",\"tokenFeatures\":[\"swap\",\"bridge\"]},{\"address\":\"0x72958b06abdF2701AcE6ceb3cE0B8B1CE11E0851\",\"chainId\":1442,\"name\":\"Immutable X\",\"symbol\":\"IMX\",\"decimals\":18,\"icon\":\"data:image/svg+xml,%3C%3Fxml version='1.0' encoding='utf-8'%3F%3E%3Csvg version='1.1' id='Layer_1' xmlns='http://www.w3.org/2000/svg' xmlns:xlink='http://www.w3.org/1999/xlink' x='0px' y='0px' viewBox='0 0 139 113' style='enable-background:new 0 0 139 113;' xml:space='preserve'%3E%3Cstyle type='text/css'%3E .st0%7Bclip-path:url(%23SVGID_00000053504646934646330740000009134454895836103350_);%7D .st1%7Bfill:%2317B5CB;%7D%0A%3C/style%3E%3Cg%3E%3Cdefs%3E%3Crect id='SVGID_1_' width='139' height='113'/%3E%3C/defs%3E%3CclipPath id='SVGID_00000035518931339590433170000002358037249938198420_'%3E%3Cuse xlink:href='%23SVGID_1_' style='overflow:visible;'/%3E%3C/clipPath%3E%3Cg style='clip-path:url(%23SVGID_00000035518931339590433170000002358037249938198420_);'%3E%3Cpath class='st1' d='M124.1,0h14.6L79.5,67.6c-1.5,1.7-1.6,4.3-0.1,6.1l34.1,39.7H98.3L66.8,76.6l-1.6-2c-1.5-1.7-1.4-4.4,0.1-6.1 L124.1,0z'/%3E%3Cpath class='st1' d='M91.2,73.7c-1-1.1-1.3-2.7-1-4.1c0.3-0.8,0.8-1.6,1.4-2.2l3.9-4.3l43.5,50.3h-13.8 C125.2,113.4,99.7,83.6,91.2,73.7z'/%3E%3Cpath class='st1' d='M15.2,113.4H0l46.6-53.9c1.5-1.7,1.5-4.3,0-6L0.4,0H15l46.5,53.9c1.2,1.6,1.4,3.9,0.1,5.4 C49.4,73.4,15.2,113.4,15.2,113.4z'/%3E%3Cpath class='st1' d='M40.6,0h-14l43.1,49.9c0,0,0.1-0.1,4.9-5.8c1.3-1.5,1.6-3.4,0.1-4.9C65.7,30,40.6,0,40.6,0z'/%3E%3Cpath class='st1' d='M82.6,34.8L112.5,0H98.3L82.7,18.2l-4.5,5.3c-1.5,1.7-1.6,4.3-0.1,6.1C79.2,30.9,82.6,34.8,82.6,34.8z'/%3E%3Cpath class='st1' d='M56.6,78.6l-29.9,34.8h14.1l15.6-18.2l4.5-5.3c1.5-1.7,1.6-4.3,0.1-6.1C59.9,82.5,56.6,78.6,56.6,78.6z'/%3E%3C/g%3E%3C/g%3E%3C/svg%3E%0A\",\"tokenFeatures\":[\"swap\",\"bridge\"]}]");
11215
-
11216
-
11217
- const $efe60cea83bfc4e8$var$filterTokenList = ({ type: type , chainId: chainId , exclude: exclude })=>((/*@__PURE__*/$parcel$interopDefault($cda6003506e4182e$exports))).filter((token)=>{
11218
- const skipChainIdCheck = !chainId;
11219
- const chainIdMatches = token.chainId === chainId;
11220
- const tokenNotExcluded = !exclude?.map((excludeToken)=>excludeToken.address).includes(token.address || "");
11221
- const allowAllTokens = type === (exports.TokenFilterTypes).ALL;
11222
- const tokenAllowedForType = token.tokenFeatures.includes(type);
11223
- return (skipChainIdCheck || chainIdMatches) && tokenNotExcluded && (allowAllTokens || tokenAllowedForType);
11224
- });
11225
- const $efe60cea83bfc4e8$export$473cec51305fdae8 = async ({ type: type = (exports.TokenFilterTypes).ALL , chainId: chainId , exclude: exclude })=>{
11226
- const filteredTokenList = $efe60cea83bfc4e8$var$filterTokenList({
11227
- type: type,
11228
- chainId: chainId,
11229
- exclude: exclude
11230
- }).map((token)=>({
11231
- name: token.name,
11232
- symbol: token.symbol,
11233
- decimals: token.decimals,
11234
- address: token.address,
11235
- icon: token.icon
11236
- }));
11237
- return {
11238
- tokens: filteredTokenList
11239
- };
11240
- };
11241
-
11242
-
11243
-
11244
-
11245
- const $1564e43dde50bb61$export$df96cd8d56be0ab1 = async (config, web3Provider, walletAddress)=>await ($a8bc256d81a5e2c1$export$bacc563de539c6c3)(async ()=>{
11246
- const networkInfo = await ($de192de6ef100f9f$export$79f13b4cfaaf0d09)(config, web3Provider);
11247
- if (!networkInfo.isSupported) throw new ($a8bc256d81a5e2c1$export$b722478a3cbfa3bc)(`Chain:${networkInfo.chainId} is not a supported chain`, (exports.CheckoutErrorType).CHAIN_NOT_SUPPORTED_ERROR, {
11248
- chainName: networkInfo.name
11249
- });
11250
- const balance = await web3Provider.getBalance(walletAddress);
11251
- return {
11252
- balance: balance,
11253
- formattedBalance: (ethers.utils).formatUnits(balance, networkInfo.nativeCurrency.decimals),
11254
- token: networkInfo.nativeCurrency
11255
- };
11256
- }, {
11257
- type: (exports.CheckoutErrorType).GET_BALANCE_ERROR
11258
- });
11259
- async function $1564e43dde50bb61$export$60e0fe116a0e6ed0(web3Provider, walletAddress, contractAddress) {
11260
- return await ($a8bc256d81a5e2c1$export$bacc563de539c6c3)(async ()=>{
11261
- const contract = new (ethers.Contract)(contractAddress, JSON.stringify(($762782b6c862d954$export$db5daa1b5156ccfe)), web3Provider);
11262
- const name = await contract.name();
11263
- const symbol = await contract.symbol();
11264
- const balance = await contract.balanceOf(walletAddress);
11265
- const decimals = await contract.decimals();
11266
- const formattedBalance = (ethers.utils).formatUnits(balance, decimals);
11267
- return {
11268
- balance: balance,
11269
- formattedBalance: formattedBalance,
11270
- token: {
11271
- name: name,
11272
- symbol: symbol,
11273
- decimals: decimals,
11274
- address: contractAddress
11275
- }
11276
- };
11277
- }, {
11278
- type: (exports.CheckoutErrorType).GET_ERC20_BALANCE_ERROR
11279
- });
11280
- }
11281
- const $1564e43dde50bb61$export$fee49741664a4d7e = async (config, web3Provider, walletAddress, chainId)=>{
11282
- const tokenList = await ($efe60cea83bfc4e8$export$473cec51305fdae8)({
11283
- type: (exports.TokenFilterTypes).ALL,
11284
- chainId: chainId
11285
- });
11286
- const allBalancePromises = [];
11287
- allBalancePromises.push($1564e43dde50bb61$export$df96cd8d56be0ab1(config, web3Provider, walletAddress));
11288
- tokenList.tokens.filter((token)=>token.address).forEach((token)=>allBalancePromises.push($1564e43dde50bb61$export$60e0fe116a0e6ed0(web3Provider, walletAddress, token.address ?? "")));
11289
- const balanceResults = await Promise.allSettled(allBalancePromises);
11290
- const getBalanceResults = balanceResults.filter((result)=>result.status === "fulfilled").map((fulfilledResult)=>fulfilledResult.value);
11291
- return {
11292
- balances: getBalanceResults
11293
- };
11294
- };
11295
-
11296
-
11297
-
11298
-
11299
-
11300
- /* eslint-disable @typescript-eslint/no-explicit-any */
11301
-
11302
- async function $c99672cf2294e839$export$2d040992269b4717(web3Provider) {
11303
- if (!web3Provider?.provider?.request) throw new ($a8bc256d81a5e2c1$export$b722478a3cbfa3bc)("Check wallet connection request failed", (exports.CheckoutErrorType).PROVIDER_REQUEST_FAILED_ERROR, {
11304
- rpcMethod: ($4f91c5f280efe242$export$35b06f0d33f57e26).CHECK_CONNECTION
11305
- });
11306
- let accounts = [];
11307
- try {
11308
- accounts = await web3Provider.provider.request({
11309
- method: (0, $4f91c5f280efe242$export$35b06f0d33f57e26).CHECK_CONNECTION,
11310
- params: []
11311
- });
11312
- } catch (err) {
11313
- throw new ($a8bc256d81a5e2c1$export$b722478a3cbfa3bc)("Check wallet connection request failed", (exports.CheckoutErrorType).PROVIDER_REQUEST_FAILED_ERROR, {
11314
- rpcMethod: ($4f91c5f280efe242$export$35b06f0d33f57e26).CHECK_CONNECTION
11315
- });
11316
- }
11317
- // accounts[0] will have the active account if connected.
11318
- return {
11319
- isConnected: accounts && accounts.length > 0,
11320
- walletAddress: accounts[0] ?? ""
11321
- };
11322
- }
11323
- async function $c99672cf2294e839$export$43f7168eb392a88c(web3Provider) {
11324
- await ($a8bc256d81a5e2c1$export$bacc563de539c6c3)(async ()=>{
11325
- if (!web3Provider || !web3Provider?.provider?.request) throw new ($a8bc256d81a5e2c1$export$b722478a3cbfa3bc)("Incompatible provider", (exports.CheckoutErrorType).PROVIDER_REQUEST_MISSING_ERROR, {
11326
- details: "Attempting to connect with an incompatible provider"
11327
- });
11328
- // this makes the request to the wallet to connect i.e request eth accounts ('eth_requestAccounts')
11329
- await web3Provider.provider.request({
11330
- method: ($4f91c5f280efe242$export$35b06f0d33f57e26).CONNECT,
11331
- params: []
11332
- });
11333
- }, {
11334
- type: (exports.CheckoutErrorType).USER_REJECTED_REQUEST_ERROR
11335
- });
11336
- return web3Provider;
11337
- }
11338
-
11339
-
11340
-
11341
-
11342
- /* eslint-disable @typescript-eslint/no-explicit-any */
11343
-
11344
-
11345
-
11346
- async function $5c763be0b0b81038$var$getMetaMaskProvider() {
11347
- const provider = await ($a8bc256d81a5e2c1$export$bacc563de539c6c3)(async ()=>await (detectEthereumProvider)(), {
11348
- type: (exports.CheckoutErrorType).METAMASK_PROVIDER_ERROR
11349
- });
11350
- if (!provider || !provider.request) throw new ($a8bc256d81a5e2c1$export$b722478a3cbfa3bc)("No MetaMask provider installed.", (exports.CheckoutErrorType).METAMASK_PROVIDER_ERROR);
11351
- return new (providers.Web3Provider)(provider);
11352
- }
11353
- async function $5c763be0b0b81038$export$500fbc0cd14cdbaa(defaultProvider) {
11354
- let web3Provider = null;
11355
- switch(defaultProvider){
11356
- case (exports.WalletProviderName).METAMASK:
11357
- web3Provider = await $5c763be0b0b81038$var$getMetaMaskProvider();
11358
- break;
11359
- default:
11360
- throw new ($a8bc256d81a5e2c1$export$b722478a3cbfa3bc)("Provider not supported", (exports.CheckoutErrorType).DEFAULT_PROVIDER_ERROR);
11361
- }
11362
- return web3Provider;
11363
- }
11364
-
11365
-
11366
- // this function needs to be in a separate file to prevent circular dependencies with ./network
11367
-
11368
-
11369
-
11370
-
11371
-
11372
- function $bb88265fe45a0393$export$ebe4804963e71f98(web3Provider) {
11373
- if (web3Provider && web3Provider instanceof (providers.Web3Provider) && web3Provider.provider?.request) return true;
11374
- return false;
11375
- }
11376
- async function $bb88265fe45a0393$export$9e1fd9cc88c637a0(config, web3Provider, validateProviderOptions) {
11377
- return ($a8bc256d81a5e2c1$export$bacc563de539c6c3)(async ()=>{
11378
- if (!$bb88265fe45a0393$export$ebe4804963e71f98(web3Provider)) throw new ($a8bc256d81a5e2c1$export$b722478a3cbfa3bc)("Parsed provider is not a valid Web3Provider", (exports.CheckoutErrorType).WEB3_PROVIDER_ERROR);
11379
- // this sets the default options and overrides them with any parsed options
11380
- const options = {
11381
- ...($e768639828688ca3$export$44dde05038008549),
11382
- ...validateProviderOptions
11383
- };
11384
- const underlyingChainId = await ($a1555a1d2c8d059b$export$c3ba3e93a9fee972)(web3Provider);
11385
- let web3ChainId = web3Provider.network?.chainId;
11386
- try {
11387
- web3ChainId = web3Provider.network?.chainId;
11388
- if (!web3ChainId) web3ChainId = (await web3Provider.getNetwork()).chainId;
11389
- } catch (err) {
11390
- throw new ($a8bc256d81a5e2c1$export$b722478a3cbfa3bc)("Unable to detect the web3Provider network", (exports.CheckoutErrorType).WEB3_PROVIDER_ERROR);
11391
- }
11392
- if (web3ChainId !== underlyingChainId && !options.allowMistmatchedChainId) throw new ($a8bc256d81a5e2c1$export$b722478a3cbfa3bc)("Your wallet has changed network, please switch to a supported network", (exports.CheckoutErrorType).WEB3_PROVIDER_ERROR);
11393
- const allowedNetworks = await ($de192de6ef100f9f$export$3043f6442a9ef563)(config, {
11394
- type: (exports.NetworkFilterTypes).ALL
11395
- });
11396
- const isAllowed = allowedNetworks.networks.some((network)=>network.chainId === underlyingChainId);
11397
- if (!isAllowed && !options.allowUnsupportedProvider) throw new ($a8bc256d81a5e2c1$export$b722478a3cbfa3bc)("Your wallet is connected to an unsupported network, please switch to a supported network", (exports.CheckoutErrorType).WEB3_PROVIDER_ERROR);
11398
- return web3Provider;
11399
- }, {
11400
- type: (exports.CheckoutErrorType).WEB3_PROVIDER_ERROR
11401
- });
11402
- }
11403
-
11404
-
11405
-
11406
-
11407
-
11408
- var $6f3c55a615003cbf$exports = {};
11409
- $6f3c55a615003cbf$exports = JSON.parse('[{"walletProvider":"metamask","icon":"some-icon-url","name":"MetaMask","description":"complete web3 wallet solution","platform":["desktop"]},{"walletProvider":"passport","icon":"pp-icon","name":"Passport","description":"Web3 with your email!","platform":["mobile","desktop"]},{"walletProvider":"gamestop","icon":"gme-icon","name":"GameStop","description":"Never stopping the game!","platform":["mobile"]}]');
11410
-
11411
-
11412
- async function $5cdde2ffe6360fec$export$a822caa90d7eef09({ type: type = (exports.WalletFilterTypes).ALL , exclude: exclude }) {
11413
- // todo:For async API call, use the CheckoutError with errorType:API_CALL_ERROR?? or any other
11414
- const filteredWalletsList = ((/*@__PURE__*/$parcel$interopDefault($6f3c55a615003cbf$exports))).filter((wallet)=>{
11415
- const walletNotExcluded = !exclude?.map((excludeWallet)=>excludeWallet.walletProvider).includes(wallet.walletProvider);
11416
- const allowAllWallets = type === (exports.WalletFilterTypes).ALL;
11417
- const walletsAllowedForType = wallet.platform.includes(type);
11418
- return walletNotExcluded && (allowAllWallets || walletsAllowedForType);
11419
- }).map((wallet)=>{
11420
- const { platform: platform , ...walletInfo } = wallet;
11421
- return walletInfo;
11422
- });
11423
- return {
11424
- wallets: filteredWalletsList
11425
- };
11426
- }
11427
-
11428
-
11429
-
11430
-
11431
-
11432
-
11433
-
11434
- const $dbe95599a4661140$export$8e0e7ffc78696d30 = async (web3Provider, transaction)=>{
11435
- try {
11436
- const transactionResponse = await web3Provider.getSigner().sendTransaction(transaction);
11437
- return {
11438
- transactionResponse: transactionResponse
11439
- };
11440
- } catch (err) {
11441
- if (err.code === (ethers.ethers).errors.INSUFFICIENT_FUNDS) throw new ($a8bc256d81a5e2c1$export$b722478a3cbfa3bc)(err.message, (exports.CheckoutErrorType).INSUFFICIENT_FUNDS);
11442
- if (err.code === (ethers.ethers).errors.ACTION_REJECTED) throw new ($a8bc256d81a5e2c1$export$b722478a3cbfa3bc)(err.message, (exports.CheckoutErrorType).USER_REJECTED_REQUEST_ERROR);
11443
- if (err.code === (ethers.ethers).errors.UNPREDICTABLE_GAS_LIMIT) throw new ($a8bc256d81a5e2c1$export$b722478a3cbfa3bc)(err.message, (exports.CheckoutErrorType).UNPREDICTABLE_GAS_LIMIT);
11444
- throw new ($a8bc256d81a5e2c1$export$b722478a3cbfa3bc)(err.message, (exports.CheckoutErrorType).TRANSACTION_FAILED);
11445
- }
11446
- };
11447
-
11448
-
11449
-
11450
-
11451
-
11452
-
11453
-
11454
-
11455
-
11456
-
11457
-
11458
- const $570856c68db0bd36$var$GAS_LIMIT = 140000;
11459
- async function $570856c68db0bd36$var$getTokenInfoByAddress(tokenAddress, chainId) {
11460
- return (await $efe60cea83bfc4e8$export$473cec51305fdae8({
11461
- type: (exports.TokenFilterTypes).ALL,
11462
- chainId: chainId
11463
- })).tokens.find((token)=>(token.address || "NATIVE") === tokenAddress);
11464
- }
11465
- const $570856c68db0bd36$var$doesChainSupportEIP1559 = (feeData)=>!!feeData.maxFeePerGas && !!feeData.maxPriorityFeePerGas;
11466
- const $570856c68db0bd36$var$getGasPriceInWei = (feeData)=>$570856c68db0bd36$var$doesChainSupportEIP1559(feeData) ? (ethers.BigNumber).from(feeData.maxFeePerGas).add((ethers.BigNumber).from(feeData.maxPriorityFeePerGas)) : feeData.gasPrice && (ethers.BigNumber).from(feeData.gasPrice);
11467
- const $570856c68db0bd36$var$getGasEstimates = async (provider)=>{
11468
- const txnGasLimitInWei = $570856c68db0bd36$var$GAS_LIMIT; // todo: fetch gasLimit from bridgeSDK when they add new fn
11469
- const feeData = await provider.getFeeData();
11470
- const gasPriceInWei = $570856c68db0bd36$var$getGasPriceInWei(feeData);
11471
- if (!gasPriceInWei) return undefined;
11472
- return gasPriceInWei.mul(txnGasLimitInWei);
11473
- };
11474
- async function $570856c68db0bd36$export$51010590edbe56a6(provider, chainId, isApproveTxnRequired, gasTokenAddress) {
11475
- const token = await $570856c68db0bd36$var$getTokenInfoByAddress(gasTokenAddress || "NATIVE", chainId);
11476
- let estimatedAmount = await $570856c68db0bd36$var$getGasEstimates(provider);
11477
- if (!estimatedAmount) return {
11478
- estimatedAmount: undefined,
11479
- token: token
11480
- };
11481
- if (isApproveTxnRequired) estimatedAmount = estimatedAmount.add(estimatedAmount);
11482
- const result = {
11483
- estimatedAmount: estimatedAmount,
11484
- token: token
11485
- };
11486
- return result;
11487
- }
11488
- async function $570856c68db0bd36$export$9e73e22953cebcfc(tokenBridge, tokenAddress, destinationChainId) {
11489
- const bridgeFeeReq = {
11490
- token: tokenAddress
11491
- };
11492
- const bridgeFeeResponse = await tokenBridge.getFee(bridgeFeeReq);
11493
- const tokenInfo = await $570856c68db0bd36$var$getTokenInfoByAddress(tokenAddress, destinationChainId);
11494
- return {
11495
- bridgeFee: {
11496
- estimatedAmount: bridgeFeeResponse.feeAmount,
11497
- token: tokenInfo
11498
- },
11499
- bridgeable: bridgeFeeResponse.bridgeable
11500
- };
11501
- }
11502
-
11503
-
11504
-
11505
-
11506
-
11507
-
11508
- async function $67fc622a2b913d5f$export$989eefe1274a439c(fromChainId, toChainId, readOnlyProviders, environment) {
11509
- const rootChainProvider = readOnlyProviders.get(fromChainId);
11510
- const childChainProvider = readOnlyProviders.get(toChainId);
11511
- if (!rootChainProvider) throw new ($a8bc256d81a5e2c1$export$b722478a3cbfa3bc)(`Chain:${fromChainId} is not a supported chain`, (exports.CheckoutErrorType).CHAIN_NOT_SUPPORTED_ERROR);
11512
- if (!childChainProvider) throw new ($a8bc256d81a5e2c1$export$b722478a3cbfa3bc)(`Chain:${toChainId} is not a supported chain`, (exports.CheckoutErrorType).CHAIN_NOT_SUPPORTED_ERROR);
11513
- const bridgeConfig = new (bridgeSdk.BridgeConfiguration)({
11514
- baseConfig: new (ImmutableConfiguration)({
11515
- environment: environment
11516
- }),
11517
- bridgeInstance: environment === (exports.Environment).PRODUCTION ? (bridgeSdk.ETH_MAINNET_TO_ZKEVM_MAINNET) : (bridgeSdk.ETH_SEPOLIA_TO_ZKEVM_DEVNET),
11518
- rootProvider: rootChainProvider,
11519
- childProvider: childChainProvider
11520
- });
11521
- return new (bridgeSdk.TokenBridge)(bridgeConfig);
11522
- }
11523
- async function $67fc622a2b913d5f$export$7cf6178417769841(chainId, config) {
11524
- const dexConfig = await config.remoteConfigFetcher.get("dex");
11525
- return new (dexSdk.Exchange)(new (dexSdk.ExchangeConfiguration)({
11526
- chainId: chainId,
11527
- baseConfig: new (ImmutableConfiguration)({
11528
- environment: config.environment
11529
- }),
11530
- overrides: dexConfig?.overrides
11531
- }));
11532
- }
11533
-
11534
-
11535
-
11536
-
11537
- const $2e7bf45a7c9a9570$var$DUMMY_WALLET_ADDRESS = "0x0000000000000000000000000000000000000000";
11538
- const $2e7bf45a7c9a9570$var$DEFAULT_TOKEN_DECIMALS = 18;
11539
- const $2e7bf45a7c9a9570$var$getL1ChainId = (environment)=>{
11540
- if (environment === (exports.Environment).PRODUCTION) return (exports.ChainId).SEPOLIA;
11541
- return (exports.ChainId).SEPOLIA;
11542
- };
11543
- const $2e7bf45a7c9a9570$var$getL2ChainId = (environment)=>{
11544
- if (environment === (exports.Environment).PRODUCTION) return (exports.ChainId).IMTBL_ZKEVM_TESTNET;
11545
- return (exports.ChainId).IMTBL_ZKEVM_DEVNET;
11546
- };
11547
- async function $2e7bf45a7c9a9570$var$bridgeToL2GasEstimator(readOnlyProviders, config, isSpendingCapApprovalRequired, tokenAddress) {
11548
- const fromChainId = $2e7bf45a7c9a9570$var$getL1ChainId(config.environment);
11549
- const toChainId = $2e7bf45a7c9a9570$var$getL2ChainId(config.environment);
11550
- const gasEstimateTokensConfig = await config.remoteConfigFetcher.get("gasEstimateTokens");
11551
- const { gasTokenAddress: gasTokenAddress , fromAddress: fromAddress } = gasEstimateTokensConfig[fromChainId.toString()].bridgeToL2Addresses;
11552
- const provider = readOnlyProviders.get(fromChainId);
11553
- try {
11554
- const { estimatedAmount: estimatedAmount , token: token } = await (0, $570856c68db0bd36$export$51010590edbe56a6)(provider, fromChainId, isSpendingCapApprovalRequired, tokenAddress ?? gasTokenAddress);
11555
- const tokenBridge = await $67fc622a2b913d5f$export$989eefe1274a439c(fromChainId, toChainId, readOnlyProviders, config.environment);
11556
- const { bridgeFee: bridgeFee , bridgeable: bridgeable } = await (0, $570856c68db0bd36$export$9e73e22953cebcfc)(tokenBridge, fromAddress, toChainId);
11557
- return {
11558
- gasEstimateType: (0, exports.GasEstimateType).BRIDGE_TO_L2,
11559
- gasFee: {
11560
- estimatedAmount: estimatedAmount,
11561
- token: token
11562
- },
11563
- bridgeFee: {
11564
- estimatedAmount: bridgeFee?.estimatedAmount,
11565
- token: bridgeFee?.token
11566
- },
11567
- bridgeable: bridgeable
11568
- };
11569
- } catch {
11570
- // In the case of an error, just return an empty gas & bridge fee estimate
11571
- return {
11572
- gasEstimateType: (exports.GasEstimateType).BRIDGE_TO_L2,
11573
- gasFee: {},
11574
- bridgeFee: {},
11575
- bridgeable: false
11576
- };
11577
- }
11578
- }
11579
- async function $2e7bf45a7c9a9570$var$swapGasEstimator(config) {
11580
- const chainId = $2e7bf45a7c9a9570$var$getL2ChainId(config.environment);
11581
- const gasEstimateTokensConfig = await config.remoteConfigFetcher.get("gasEstimateTokens");
11582
- const { inAddress: inAddress , outAddress: outAddress } = gasEstimateTokensConfig[chainId].swapAddresses;
11583
- try {
11584
- const exchange = await $67fc622a2b913d5f$export$7cf6178417769841(chainId, config);
11585
- // Create a fake transaction to get the gas from the quote
11586
- const { info: info } = await exchange.getUnsignedSwapTxFromAmountIn($2e7bf45a7c9a9570$var$DUMMY_WALLET_ADDRESS, inAddress, outAddress, (0, ethers$1.BigNumber).from((0, ethers$1.utils).parseUnits("1", $2e7bf45a7c9a9570$var$DEFAULT_TOKEN_DECIMALS)));
11587
- if (info.gasFeeEstimate === null) return {
11588
- gasEstimateType: (0, exports.GasEstimateType).SWAP,
11589
- gasFee: {}
11590
- };
11591
- let estimatedAmount;
11592
- if (info.gasFeeEstimate.amount) estimatedAmount = (0, ethers$1.BigNumber).from(info.gasFeeEstimate.amount);
11593
- return {
11594
- gasEstimateType: (0, exports.GasEstimateType).SWAP,
11595
- gasFee: {
11596
- estimatedAmount: estimatedAmount,
11597
- token: {
11598
- address: info.gasFeeEstimate?.token.address,
11599
- symbol: info.gasFeeEstimate?.token.symbol ?? "",
11600
- name: info.gasFeeEstimate?.token.name ?? "",
11601
- decimals: info.gasFeeEstimate?.token.decimals ?? $2e7bf45a7c9a9570$var$DEFAULT_TOKEN_DECIMALS
11602
- }
11603
- }
11604
- };
11605
- } catch {
11606
- // In the case of an error, just return an empty gas fee estimate
11607
- return {
11608
- gasEstimateType: (exports.GasEstimateType).SWAP,
11609
- gasFee: {}
11610
- };
11611
- }
11612
- }
11613
- async function $2e7bf45a7c9a9570$export$942c8de7174809fc(params, readOnlyProviders, config) {
11614
- switch(params.gasEstimateType){
11615
- case (exports.GasEstimateType).BRIDGE_TO_L2:
11616
- return await $2e7bf45a7c9a9570$var$bridgeToL2GasEstimator(readOnlyProviders, config, params.isSpendingCapApprovalRequired, params.tokenAddress);
11617
- case (exports.GasEstimateType).SWAP:
11618
- return await $2e7bf45a7c9a9570$var$swapGasEstimator(config);
11619
- default:
11620
- throw new ($a8bc256d81a5e2c1$export$b722478a3cbfa3bc)("Invalid type provided for gasEstimateType", (exports.CheckoutErrorType).INVALID_GAS_ESTIMATE_TYPE);
11621
- }
11622
- }
11623
-
11624
-
11625
-
11626
-
11627
-
11628
-
11629
-
11630
-
11631
-
11632
-
11633
- class $a492ee374ae7b613$export$d902b56530cd5f87 {
11634
- cache;
11635
- environment;
11636
- constructor(params){
11637
- this.environment = params.environment;
11638
- }
11639
- async load() {
11640
- if (this.cache) return this.cache;
11641
- let response;
11642
- try {
11643
- response = await (0, globalAxios$1).get(`${(0, $d85ad1457a3f1a83$export$161d4a74df65fc08)[this.environment]}/v1/config`);
11644
- } catch (error) {
11645
- throw new Error(`Error fetching config: ${error.message}`);
11646
- }
11647
- if (response.status !== 200) throw new Error(`Error fetching config: ${response.status} ${response.statusText}`);
11648
- this.cache = response.data;
11649
- return this.cache;
11650
- }
11651
- async get(key) {
11652
- const config = await this.load();
11653
- if (config && key) return config[key];
11654
- return config;
11655
- }
11656
- }
11657
-
11658
-
11659
- class $4013c5c91bb535f6$export$6ad73ea7e1b6f37f extends Error {
11660
- message;
11661
- constructor(message){
11662
- super(message);
11663
- this.message = message;
11664
- }
11665
- }
11666
- class $4013c5c91bb535f6$export$4823433c4a67bbc6 {
11667
- environment;
11668
- networkMap;
11669
- remoteConfigFetcher;
11670
- constructor(config){
11671
- // validate input
11672
- if (!Object.values((exports.Environment)).includes(config.baseConfig.environment)) throw new $4013c5c91bb535f6$export$6ad73ea7e1b6f37f("Invalid checkout configuration of environment");
11673
- this.environment = config.baseConfig.environment;
11674
- this.networkMap = config.baseConfig.environment === (exports.Environment).PRODUCTION ? ($a47e48dd2c04791b$export$6f24f3cef7d501c4) : ($a47e48dd2c04791b$export$3e81fc0987227f10);
11675
- this.remoteConfigFetcher = new ($a492ee374ae7b613$export$d902b56530cd5f87)({
11676
- environment: config.baseConfig.environment
11677
- });
11678
- }
11679
- }
11680
-
11681
-
11682
-
11683
-
11684
-
11685
-
11686
-
11687
-
11688
- async function $0e0060cb42e136d2$export$339cb2be73677b30(config, existingReadOnlyProviders) {
11689
- if (config.environment === (exports.Environment).PRODUCTION && existingReadOnlyProviders?.has((exports.ChainId).ETHEREUM) || config.environment === (exports.Environment).SANDBOX && existingReadOnlyProviders?.has((exports.ChainId).SEPOLIA)) return existingReadOnlyProviders;
11690
- const readOnlyProviders = new Map();
11691
- const allowedNetworks = await $de192de6ef100f9f$export$3043f6442a9ef563(config, {
11692
- type: (exports.NetworkFilterTypes).ALL
11693
- });
11694
- allowedNetworks.networks.forEach((networkInfo)=>{
11695
- const rpcUrl = config.networkMap.get(networkInfo.chainId)?.rpcUrls[0];
11696
- const provider = new (ethers.ethers).providers.JsonRpcProvider(rpcUrl);
11697
- readOnlyProviders.set(networkInfo.chainId, provider);
11698
- });
11699
- return readOnlyProviders;
11700
- }
11701
-
11702
-
11703
- class $a8cb37a3fc8eb863$export$1f60ba4ec72508a0 {
11704
- config;
11705
- readOnlyProviders;
11706
- constructor(config = ($bc2bfebf768286d3$export$6a2ba3c3bd042990)){
11707
- this.config = new ($4013c5c91bb535f6$export$4823433c4a67bbc6)(config);
11708
- this.readOnlyProviders = new Map();
11709
- }
11710
- /**
11711
- * Create a provider object which can be used within the Checkout class methods.
11712
- * @param {CreateProviderParams} params The data required to create a provider
11713
- * @returns A new provider object
11714
- * @throws {@link ErrorType}
11715
- */ async createProvider(params) {
11716
- const web3Provider = await $5c763be0b0b81038$export$500fbc0cd14cdbaa(params.walletProvider);
11717
- return {
11718
- provider: web3Provider
11719
- };
11720
- }
11721
- /**
11722
- * Check if a wallet is connected to the current application
11723
- * without requesting permission from the wallet and hence triggering a connect popup.
11724
- * @param {CheckConnectionParams} params - The necessary data required to verify a wallet connection status.
11725
- * @returns Wallet connection status details.
11726
- * @throws {@link ErrorType}
11727
- */ async checkIsWalletConnected(params) {
11728
- const web3Provider = await $bb88265fe45a0393$export$9e1fd9cc88c637a0(this.config, params.provider, {
11729
- allowUnsupportedProvider: true
11730
- });
11731
- return $c99672cf2294e839$export$2d040992269b4717(web3Provider);
11732
- }
11733
- /**
11734
- * Establish a connection with a wallet provider such as MetaMask and returns the provider object and the current network details.
11735
- * @param {ConnectParams} params - The necessary data required to establish a connection with a wallet provider.
11736
- * @returns Wallet provider and current network information.
11737
- * @throws {@link ErrorType}
11738
- */ async connect(params) {
11739
- const web3Provider = await $bb88265fe45a0393$export$9e1fd9cc88c637a0(this.config, params.provider, {
11740
- allowUnsupportedProvider: true
11741
- });
11742
- await $c99672cf2294e839$export$43f7168eb392a88c(web3Provider);
11743
- const networkInfo = await $de192de6ef100f9f$export$79f13b4cfaaf0d09(this.config, web3Provider);
11744
- return {
11745
- provider: web3Provider,
11746
- network: networkInfo
11747
- };
11748
- }
11749
- /**
11750
- * Switch the currently connected wallet to a new network.
11751
- * @param {SwitchNetworkParams} params - The necessary data required to switch network.
11752
- * @returns The new network information.
11753
- * @throws {@link ErrorType}
11754
- */ async switchNetwork(params) {
11755
- const web3Provider = await $bb88265fe45a0393$export$9e1fd9cc88c637a0(this.config, params.provider, {
11756
- allowUnsupportedProvider: true,
11757
- allowMistmatchedChainId: true
11758
- });
11759
- const switchNetworkRes = await $de192de6ef100f9f$export$b827d9418aeb5dbd(this.config, web3Provider, params.chainId);
11760
- return switchNetworkRes;
11761
- }
11762
- /**
11763
- * Fetch the balance of the native token of the current connected network or,
11764
- * if a contract address is provided, it will return the balance of that ERC20 token. For example,
11765
- * if the wallet is connected to the Ethereum Mainnet then the function gets the wallet ETH L1 balance.
11766
- * @param {GetBalanceParams} params - The necessary data required to fetch the wallet balance.
11767
- * @returns Native token balance for the given wallet.
11768
- * @throws {@link ErrorType}
11769
- */ async getBalance(params) {
11770
- const web3Provider = await $bb88265fe45a0393$export$9e1fd9cc88c637a0(this.config, params.provider);
11771
- if (!params.contractAddress || params.contractAddress === "") return await $1564e43dde50bb61$export$df96cd8d56be0ab1(this.config, web3Provider, params.walletAddress);
11772
- return await $1564e43dde50bb61$export$60e0fe116a0e6ed0(web3Provider, params.walletAddress, params.contractAddress);
11773
- }
11774
- /**
11775
- * Fetch all available balances (ERC20 & Native) of the current connected network of the given wallet.
11776
- * It will loop through the list of allowed tokens and check for balance on each one.
11777
- * @param {GetAllBalancesParams} params - The necessary data required to fetch all the wallet balances.
11778
- * @returns List of tokens balance for the given wallet.
11779
- * @throws {@link ErrorType}
11780
- */ async getAllBalances(params) {
11781
- const web3Provider = await $bb88265fe45a0393$export$9e1fd9cc88c637a0(this.config, params.provider);
11782
- return $1564e43dde50bb61$export$fee49741664a4d7e(this.config, web3Provider, params.walletAddress, params.chainId);
11783
- }
11784
- /**
11785
- * Fetch the list of available networks that a wallet can add or/and switch to.
11786
- * @param {GetNetworkAllowListParams} params - The necessary data required to fetch the list of available networks.
11787
- * @returns List of networks.
11788
- * @throws {@link ErrorType}
11789
- */ async getNetworkAllowList(params) {
11790
- return await $de192de6ef100f9f$export$3043f6442a9ef563(this.config, params);
11791
- }
11792
- /**
11793
- * Get the list of tokens which are allowed to be used with the product.
11794
- * @param {GetTokenAllowListParams} params - The necessary data required to fetch the list of allowed tokens.
11795
- * @returns List of allowed tokens.
11796
- * @throws {@link ErrorType}
11797
- */ async getTokenAllowList(params) {
11798
- return await $efe60cea83bfc4e8$export$473cec51305fdae8(params);
11799
- }
11800
- /**
11801
- * Fetch the list of wallets which are available to connect with.
11802
- * @param {GetWalletAllowListParams} params - The necessary data required to fetch the list of allowed wallets.
11803
- * @returns List of allowed wallets.
11804
- * @throws {@link ErrorType}
11805
- */ async getWalletAllowList(params) {
11806
- return await $5cdde2ffe6360fec$export$a822caa90d7eef09(params);
11807
- }
11808
- /**
11809
- * Send a generic transaction to the provider.
11810
- * @param {SendTransactionParams} params - The necessary data required to send a transaction.
11811
- * @returns Transaction response.
11812
- * @throws {@link ErrorType}
11813
- * @remarks
11814
- * Further documenation can be found at [MetaMask | Sending Transactions](https://docs.metamask.io/guide/sending-transactions.html).
11815
- */ async sendTransaction(params) {
11816
- const web3Provider = await $bb88265fe45a0393$export$9e1fd9cc88c637a0(this.config, params.provider);
11817
- return await $dbe95599a4661140$export$8e0e7ffc78696d30(web3Provider, params.transaction);
11818
- }
11819
- /**
11820
- * Get network information about the currently selected network.
11821
- * @param {GetNetworkParams} params - The necessary data required to get the current network information.
11822
- * @returns Network details.
11823
- * @throws {@link ErrorType}
11824
- */ async getNetworkInfo(params) {
11825
- const web3Provider = await $bb88265fe45a0393$export$9e1fd9cc88c637a0(this.config, params.provider, {
11826
- allowUnsupportedProvider: true,
11827
- allowMistmatchedChainId: true
11828
- });
11829
- return await $de192de6ef100f9f$export$79f13b4cfaaf0d09(this.config, web3Provider);
11830
- }
11831
- static isWeb3Provider(web3Provider) {
11832
- return $bb88265fe45a0393$export$ebe4804963e71f98(web3Provider);
11833
- }
11834
- /**
11835
- * Estimates the gas to perform an action.
11836
- * @param {GasEstimateParams} params - The params required to calculate a gas estimate
11837
- * @returns The gas estimate for the given action.
11838
- */ async gasEstimate(params) {
11839
- this.readOnlyProviders = await ($0e0060cb42e136d2$export$339cb2be73677b30)(this.config, this.readOnlyProviders);
11840
- return await $2e7bf45a7c9a9570$export$942c8de7174809fc(params, this.readOnlyProviders, this.config);
11841
- }
11842
- }
11843
-
11844
- function $parcel$export(e, n, v, s) {
11845
- Object.defineProperty(e, n, {get: v, set: s, enumerable: true, configurable: true});
11846
- }
11847
- // Definitions | Events
11848
- var $207ed853f11d19d5$exports = {};
11849
-
11850
- $parcel$export($207ed853f11d19d5$exports, "IMTBLWidgetEvents", () => exports.IMTBLWidgetEvents);
11851
- exports.IMTBLWidgetEvents = void 0;
11852
- (function(IMTBLWidgetEvents) {
11853
- IMTBLWidgetEvents["IMTBL_CONNECT_WIDGET_EVENT"] = "imtbl-connect-widget";
11854
- IMTBLWidgetEvents["IMTBL_WALLET_WIDGET_EVENT"] = "imtbl-wallet-widget";
11855
- IMTBLWidgetEvents["IMTBL_SWAP_WIDGET_EVENT"] = "imtbl-swap-widget";
11856
- IMTBLWidgetEvents["IMTBL_BRIDGE_WIDGET_EVENT"] = "imtbl-bridge-widget";
11857
- })(exports.IMTBLWidgetEvents || (exports.IMTBLWidgetEvents = {}));
11858
-
11859
-
11860
- var $a85ecdbd885c58ad$exports = {};
11861
-
11862
- $parcel$export($a85ecdbd885c58ad$exports, "ConnectEventType", () => exports.ConnectEventType);
11863
- exports.ConnectEventType = void 0;
11864
- (function(ConnectEventType) {
11865
- ConnectEventType["CLOSE_WIDGET"] = "close-widget";
11866
- ConnectEventType["SUCCESS"] = "success";
11867
- ConnectEventType["FAILURE"] = "failure";
11868
- })(exports.ConnectEventType || (exports.ConnectEventType = {}));
11869
-
11870
-
11871
- var $77b6aac5c353d4a9$exports = {};
11872
-
11873
- $parcel$export($77b6aac5c353d4a9$exports, "WalletEventType", () => exports.WalletEventType);
11874
- exports.WalletEventType = void 0;
11875
- (function(WalletEventType) {
11876
- WalletEventType["CLOSE_WIDGET"] = "close-widget";
11877
- WalletEventType["NETWORK_SWITCH"] = "network-switch";
11878
- WalletEventType["DISCONNECT_WALLET"] = "disconnect-wallet";
11879
- })(exports.WalletEventType || (exports.WalletEventType = {}));
11880
-
11881
-
11882
- var $53d219e7f6bf0cd6$exports = {};
11883
-
11884
- $parcel$export($53d219e7f6bf0cd6$exports, "SwapEventType", () => exports.SwapEventType);
11885
- /**
11886
- * Enum representing possible Swap Widget event types.
11887
- */ exports.SwapEventType = void 0;
11888
- (function(SwapEventType) {
11889
- SwapEventType["CLOSE_WIDGET"] = "close-widget";
11890
- SwapEventType["SUCCESS"] = "success";
11891
- SwapEventType["FAILURE"] = "failure";
11892
- SwapEventType["REJECTED"] = "rejected";
11893
- })(exports.SwapEventType || (exports.SwapEventType = {}));
11894
-
11895
-
11896
- var $15cc9e120aa6f3bf$exports = {};
11897
-
11898
- $parcel$export($15cc9e120aa6f3bf$exports, "BridgeEventType", () => exports.BridgeEventType);
11899
- /**
11900
- * Enum of possible Bridge Widget event types.
11901
- */ exports.BridgeEventType = void 0;
11902
- (function(BridgeEventType) {
11903
- BridgeEventType["CLOSE_WIDGET"] = "close-widget";
11904
- BridgeEventType["SUCCESS"] = "success";
11905
- BridgeEventType["FAILURE"] = "failure";
11906
- })(exports.BridgeEventType || (exports.BridgeEventType = {}));
11907
-
11908
-
11909
- var $ad06b030b1a3ba34$exports = {};
11910
-
11911
- $parcel$export($ad06b030b1a3ba34$exports, "OrchestrationEventType", () => exports.OrchestrationEventType);
11912
- exports.OrchestrationEventType = void 0;
11913
- (function(OrchestrationEventType) {
11914
- OrchestrationEventType["REQUEST_CONNECT"] = "request-connect";
11915
- OrchestrationEventType["REQUEST_WALLET"] = "request-wallet";
11916
- OrchestrationEventType["REQUEST_SWAP"] = "request-swap";
11917
- OrchestrationEventType["REQUEST_BRIDGE"] = "request-bridge";
11918
- OrchestrationEventType["REQUEST_ONRAMP"] = "request-onramp";
11919
- })(exports.OrchestrationEventType || (exports.OrchestrationEventType = {}));
11920
- /* eslint-disable @typescript-eslint/naming-convention */
11921
-
11922
- var $045213b18e9f1f94$exports = {};
11923
-
11924
- $parcel$export($045213b18e9f1f94$exports, "Network", () => exports.Network);
11925
- $parcel$export($045213b18e9f1f94$exports, "WidgetTheme", () => exports.WidgetTheme);
11926
- $parcel$export($045213b18e9f1f94$exports, "CheckoutWidgetTagNames", () => exports.CheckoutWidgetTagNames);
11927
- /**
11928
- * Enum representing the networks supported by Checkout.
11929
- */ exports.Network = void 0;
11930
- (function(Network) {
11931
- Network["ETHEREUM"] = "Ethereum";
11932
- Network["SEPOLIA"] = "Sepolia";
11933
- Network["IMTBL_ZKEVM_TESTNET"] = "Immutable zkEVM Testnet";
11934
- Network["IMTBL_ZKEVM_DEVNET"] = "Immutable zkEVM Devnet";
11935
- })(exports.Network || (exports.Network = {}));
11936
- exports.WidgetTheme = void 0;
11937
- (function(WidgetTheme) {
11938
- WidgetTheme["LIGHT"] = "light";
11939
- WidgetTheme["DARK"] = "dark";
11940
- WidgetTheme["CUSTOM"] = "custom";
11941
- })(exports.WidgetTheme || (exports.WidgetTheme = {}));
11942
- exports.CheckoutWidgetTagNames = void 0;
11943
- (function(CheckoutWidgetTagNames) {
11944
- CheckoutWidgetTagNames["CONNECT"] = "imtbl-connect";
11945
- CheckoutWidgetTagNames["WALLET"] = "imtbl-wallet";
11946
- CheckoutWidgetTagNames["SWAP"] = "imtbl-swap";
11947
- CheckoutWidgetTagNames["BRIDGE"] = "imtbl-bridge";
11948
- })(exports.CheckoutWidgetTagNames || (exports.CheckoutWidgetTagNames = {}));
11949
-
11950
-
11951
- var $1f969328e5988c99$exports = {};
11952
-
11953
- $parcel$export($1f969328e5988c99$exports, "BridgeReact", () => $1f969328e5988c99$export$30f61ebf204c69f6);
11954
-
11955
-
11956
- function $77ec335383336bdd$export$931068bc678f0d73(tagName, provider) {
11957
- if (!provider) {
11958
- // eslint-disable-next-line no-console
11959
- console.error("no provider parsed");
11960
- return;
11961
- }
11962
- let attempts = 0;
11963
- const maxAttempts = 10;
11964
- let timer;
11965
- const attemptToSetProvider = ()=>{
11966
- try {
11967
- const elements = document.getElementsByTagName(tagName);
11968
- const widget = elements[0];
11969
- widget.setProvider(provider);
11970
- window.clearInterval(timer);
11971
- } catch (err) {
11972
- attempts++;
11973
- if (attempts >= maxAttempts) {
11974
- window.clearInterval(timer);
11975
- // eslint-disable-next-line no-console
11976
- console.error("failed to set the provider");
11977
- }
11978
- }
11979
- };
11980
- timer = window.setInterval(attemptToSetProvider, 10);
11981
- attemptToSetProvider();
11982
- }
11983
-
11984
-
11985
-
11986
- function $1f969328e5988c99$export$30f61ebf204c69f6(props) {
11987
- const { walletProvider: walletProvider , fromContractAddress: fromContractAddress , amount: amount , provider: provider } = props;
11988
- (react.useEffect)(()=>{
11989
- if (provider) ($77ec335383336bdd$export$931068bc678f0d73)((exports.CheckoutWidgetTagNames).BRIDGE, provider);
11990
- }, [
11991
- provider
11992
- ]);
11993
- const config = window.ImtblCheckoutWidgetConfig;
11994
- return /*#__PURE__*/ (jsxRuntime.jsx)("imtbl-bridge", {
11995
- widgetConfig: config,
11996
- walletProvider: walletProvider,
11997
- fromContractAddress: fromContractAddress ?? "",
11998
- amount: amount ?? ""
11999
- });
12000
- }
12001
-
12002
-
12003
- var $f2083cd30e2f5c56$exports = {};
12004
-
12005
- $parcel$export($f2083cd30e2f5c56$exports, "ConnectReact", () => $f2083cd30e2f5c56$export$49d62957f420a1e2);
12006
-
12007
-
12008
- function $f2083cd30e2f5c56$export$49d62957f420a1e2() {
12009
- const config = window.ImtblCheckoutWidgetConfig;
12010
- return /*#__PURE__*/ (jsxRuntime.jsx)("imtbl-connect", {
12011
- widgetConfig: config
12012
- });
12013
- }
12014
-
12015
-
12016
- var $a4fbb8e3a6aeff58$exports = {};
12017
-
12018
- $parcel$export($a4fbb8e3a6aeff58$exports, "SwapReact", () => $a4fbb8e3a6aeff58$export$971e031379577f4);
12019
- /* eslint-disable max-len */
12020
-
12021
-
12022
-
12023
- function $a4fbb8e3a6aeff58$export$971e031379577f4(props) {
12024
- const { walletProvider: walletProvider , fromContractAddress: fromContractAddress , amount: amount , toContractAddress: toContractAddress , provider: provider } = props;
12025
- (react.useEffect)(()=>{
12026
- if (provider) ($77ec335383336bdd$export$931068bc678f0d73)((exports.CheckoutWidgetTagNames).SWAP, provider);
12027
- }, [
12028
- provider
12029
- ]);
12030
- const config = window.ImtblCheckoutWidgetConfig;
12031
- return /*#__PURE__*/ (jsxRuntime.jsx)("imtbl-swap", {
12032
- widgetConfig: config,
12033
- walletProvider: walletProvider,
12034
- fromContractAddress: fromContractAddress ?? "",
12035
- toContractAddress: toContractAddress ?? "",
12036
- amount: amount ?? ""
12037
- });
12038
- }
12039
-
12040
-
12041
- var $89d55ace0f8f1c07$exports = {};
12042
-
12043
- $parcel$export($89d55ace0f8f1c07$exports, "WalletReact", () => $89d55ace0f8f1c07$export$ceaac94f34dba154);
12044
-
12045
-
12046
-
12047
-
12048
- function $89d55ace0f8f1c07$export$ceaac94f34dba154(props) {
12049
- const { walletProvider: walletProvider , provider: provider } = props;
12050
- (react.useEffect)(()=>{
12051
- if (provider) ($77ec335383336bdd$export$931068bc678f0d73)((exports.CheckoutWidgetTagNames).WALLET, provider);
12052
- }, [
12053
- provider
12054
- ]);
12055
- const config = window.ImtblCheckoutWidgetConfig;
12056
- return /*#__PURE__*/ (jsxRuntime.jsx)("imtbl-wallet", {
12057
- widgetConfig: config,
12058
- walletProvider: walletProvider
12059
- });
12060
- }
12061
-
12062
-
12063
- var $430e3eda76fa4d5f$exports = {};
12064
-
12065
- $parcel$export($430e3eda76fa4d5f$exports, "DEFAULT_CHECKOUT_VERSION", () => $430e3eda76fa4d5f$export$391f2d917401f2bb);
12066
- $parcel$export($430e3eda76fa4d5f$exports, "validateAndBuildVersion", () => $430e3eda76fa4d5f$export$46b1ae20f762ad4c);
12067
- $parcel$export($430e3eda76fa4d5f$exports, "CheckoutWidgets", () => $430e3eda76fa4d5f$export$af210a0808087845);
12068
- $parcel$export($430e3eda76fa4d5f$exports, "UpdateConfig", () => $430e3eda76fa4d5f$export$bf1548ba7e61c17f);
12069
- const $430e3eda76fa4d5f$export$391f2d917401f2bb = "0.1.9-alpha";
12070
- function $430e3eda76fa4d5f$export$46b1ae20f762ad4c(version) {
12071
- if (!version || version?.major === undefined || version.major < 0) return $430e3eda76fa4d5f$export$391f2d917401f2bb;
12072
- if (version.major === 0 && version.minor === 0 && version.patch === 0) return $430e3eda76fa4d5f$export$391f2d917401f2bb;
12073
- let validatedVersion = $430e3eda76fa4d5f$export$391f2d917401f2bb;
12074
- if (!Number.isNaN(version.major) && version.major >= 0) validatedVersion = version.major.toString();
12075
- if (version.minor !== undefined && !Number.isNaN(version.minor) && version.minor >= 0) validatedVersion += `.${version.minor.toString()}`;
12076
- if (version.patch !== undefined && !Number.isNaN(version.patch) && version.patch >= 0) {
12077
- if (version.minor === undefined) validatedVersion += `.0.${version.patch.toString()}`;
12078
- else validatedVersion += `.${version.patch.toString()}`;
12079
- }
12080
- // TODO: at the moment all of the releases that include
12081
- // the checkout widgets script have '-alpha' appended
12082
- // Change this when we go to testnet. ticket WT-1432
12083
- validatedVersion += "-alpha";
12084
- if (version.build !== undefined) validatedVersion += `.${version.build}`;
12085
- return validatedVersion;
12086
- }
12087
- function $430e3eda76fa4d5f$export$af210a0808087845(config) {
12088
- const checkoutWidgetJS = document.createElement("script");
12089
- const validVersion = $430e3eda76fa4d5f$export$46b1ae20f762ad4c(config?.version);
12090
- {
12091
- const cdnUrl = `https://cdn.jsdelivr.net/npm/@imtbl/sdk@${validVersion}/dist/browser/checkout.js`;
12092
- checkoutWidgetJS.setAttribute("src", cdnUrl);
12093
- }
12094
- document.head.appendChild(checkoutWidgetJS);
12095
- window.ImtblCheckoutWidgetConfig = JSON.stringify(config);
12096
- }
12097
- function $430e3eda76fa4d5f$export$bf1548ba7e61c17f(config) {
12098
- window.ImtblCheckoutWidgetConfig = JSON.stringify(config);
12099
- }
12100
-
12101
10766
  /* Autogenerated file. Do not edit manually. */
12102
10767
  /* tslint:disable */
12103
10768
  /* eslint-disable */
@@ -13638,12 +12303,6 @@ Object.defineProperty(exports, 'imxClientGenerateLegacyStarkPrivateKey', {
13638
12303
  });
13639
12304
  exports.APIError = APIError;
13640
12305
  exports.BlockchainData = BlockchainData;
13641
- exports.BridgeReact = $1f969328e5988c99$export$30f61ebf204c69f6;
13642
- exports.CHECKOUT_API_BASE_URL = $d85ad1457a3f1a83$export$161d4a74df65fc08;
13643
- exports.Checkout = $a8cb37a3fc8eb863$export$1f60ba4ec72508a0;
13644
- exports.CheckoutWidgets = $430e3eda76fa4d5f$export$af210a0808087845;
13645
- exports.ConnectReact = $f2083cd30e2f5c56$export$49d62957f420a1e2;
13646
- exports.DEFAULT_CHECKOUT_VERSION = $430e3eda76fa4d5f$export$391f2d917401f2bb;
13647
12306
  exports.ERC20 = ERC20;
13648
12307
  exports.ERC721PermissionedMintable = ERC721PermissionedMintable;
13649
12308
  exports.GenericIMXProvider = GenericIMXProvider;
@@ -13654,9 +12313,4 @@ exports.Orderbook = Orderbook;
13654
12313
  exports.Passport = Passport;
13655
12314
  exports.PassportError = PassportError;
13656
12315
  exports.ProviderConfiguration = ProviderConfiguration;
13657
- exports.RPC_URL_MAP = $a47e48dd2c04791b$export$345c852d0dc8f1df;
13658
- exports.SwapReact = $a4fbb8e3a6aeff58$export$971e031379577f4;
13659
- exports.UpdateConfig = $430e3eda76fa4d5f$export$bf1548ba7e61c17f;
13660
- exports.WalletReact = $89d55ace0f8f1c07$export$ceaac94f34dba154;
13661
12316
  exports.module = module$1;
13662
- exports.validateAndBuildVersion = $430e3eda76fa4d5f$export$46b1ae20f762ad4c;