From d2bc2260a5e441a19c22b5fe14f3d6b92ff42b50 Mon Sep 17 00:00:00 2001 From: "d.usov" Date: Mon, 5 Oct 2020 22:55:52 +0300 Subject: [PATCH 1/3] updates --- .../pages/Dashboard/DashboardView.js | 2 +- .../WalletInformationTable/index.tsx | 33 ++++++++++--------- 2 files changed, 19 insertions(+), 16 deletions(-) diff --git a/src/components/pages/Dashboard/DashboardView.js b/src/components/pages/Dashboard/DashboardView.js index 51a5883..4ffe93f 100644 --- a/src/components/pages/Dashboard/DashboardView.js +++ b/src/components/pages/Dashboard/DashboardView.js @@ -159,7 +159,7 @@ const DashboardView = ({ {walletBalanceData && (
-

Assets quantity

+

Assets

{Object.values(walletBalanceData.assets).length || '0'}

diff --git a/src/components/pages/Wallet/components/WalletInformationTable/index.tsx b/src/components/pages/Wallet/components/WalletInformationTable/index.tsx index fd7db30..53be4ed 100644 --- a/src/components/pages/Wallet/components/WalletInformationTable/index.tsx +++ b/src/components/pages/Wallet/components/WalletInformationTable/index.tsx @@ -64,7 +64,6 @@ const WalletInformationTableItem = ({ name, value }: any) => { const WalletInformationTable = (props: any) => { const { walletBalance, - ergPrice, dispatchGetWalletBalance, dispatchGetErgPrice, dispatchGetWalletAddresses, @@ -95,16 +94,20 @@ const WalletInformationTable = (props: any) => { })); }, []); - const getAssets = useCallback((assets) => { - if (Object.values(assets).length === 0) { - return 0; - } + // const getAssets = useCallback((assets) => { + // if (Object.values(assets).length === 0) { + // return 0; + // } - return assets.map(({ tokenId, amount }: any) => ({ - name: {tokenId}, - value: {amount}, - })); - }, []); + // if (Array.isArray(assets) && assets.length !== 0) { + // return assets.map(({ tokenId, amount }: any) => ({ + // name: {tokenId}, + // value: {amount}, + // })); + // } + + // return 0; + // }, []); useEffect(() => { getValues(); @@ -124,16 +127,16 @@ const WalletInformationTable = (props: any) => { // ? `$ ${(walletBalance.balance / constants.nanoErgInErg) * ergPrice}` // : 'Loading...', // }, - { - name: 'Assets', - value: walletBalance ? getAssets(walletBalance.assets) : `Loading...`, - }, + // { + // name: 'Assets', + // value: walletBalance ? getAssets(walletBalance.assets) : `Loading...`, + // }, { name: 'Addresses', value: walletAddresses ? getAddreses(walletAddresses) : `Loading...`, }, ], - [walletBalance, ergPrice, getAssets, walletAddresses, getAddreses], + [walletBalance, walletAddresses, getAddreses], ); const updateValues = useCallback(() => { From 87dcff0f65448d225b57044888bac50289702357 Mon Sep 17 00:00:00 2001 From: "d.usov" Date: Mon, 19 Oct 2020 22:25:23 +0300 Subject: [PATCH 2/3] updates --- build/asset-manifest.json | 8 ++--- build/index.html | 2 +- ...ifest.cfa8d209094ed4bb302117b55adf437d.js} | 8 ++--- build/service-worker.js | 2 +- build/static/js/main.0818b132.chunk.js.map | 1 - ...18b132.chunk.js => main.1a9ab5b0.chunk.js} | 4 +-- build/static/js/main.1a9ab5b0.chunk.js.map | 1 + src/components/Header/HeaderView.js | 15 ++++++---- .../Header/WalletInitModal/index.js | 3 ++ .../Header/WalletStatusModal/index.js | 3 ++ src/components/Header/utils.js | 4 +++ .../WalletInformationTable/index.tsx | 30 ++++++++----------- 12 files changed, 45 insertions(+), 36 deletions(-) rename build/{precache-manifest.5a56762cd3298f2b85b771747b1147ae.js => precache-manifest.cfa8d209094ed4bb302117b55adf437d.js} (92%) delete mode 100644 build/static/js/main.0818b132.chunk.js.map rename build/static/js/{main.0818b132.chunk.js => main.1a9ab5b0.chunk.js} (56%) create mode 100644 build/static/js/main.1a9ab5b0.chunk.js.map create mode 100644 src/components/Header/utils.js diff --git a/build/asset-manifest.json b/build/asset-manifest.json index acdecea..4e1b08e 100644 --- a/build/asset-manifest.json +++ b/build/asset-manifest.json @@ -1,15 +1,15 @@ { "files": { "main.css": "/static/css/main.4948ef80.chunk.css", - "main.js": "/static/js/main.0818b132.chunk.js", - "main.js.map": "/static/js/main.0818b132.chunk.js.map", + "main.js": "/static/js/main.1a9ab5b0.chunk.js", + "main.js.map": "/static/js/main.1a9ab5b0.chunk.js.map", "runtime-main.js": "/static/js/runtime-main.219240e0.js", "runtime-main.js.map": "/static/js/runtime-main.219240e0.js.map", "static/css/2.9338f6a1.chunk.css": "/static/css/2.9338f6a1.chunk.css", "static/js/2.9ae5727a.chunk.js": "/static/js/2.9ae5727a.chunk.js", "static/js/2.9ae5727a.chunk.js.map": "/static/js/2.9ae5727a.chunk.js.map", "index.html": "/index.html", - "precache-manifest.5a56762cd3298f2b85b771747b1147ae.js": "/precache-manifest.5a56762cd3298f2b85b771747b1147ae.js", + "precache-manifest.cfa8d209094ed4bb302117b55adf437d.js": "/precache-manifest.cfa8d209094ed4bb302117b55adf437d.js", "service-worker.js": "/service-worker.js", "static/css/2.9338f6a1.chunk.css.map": "/static/css/2.9338f6a1.chunk.css.map", "static/css/main.4948ef80.chunk.css.map": "/static/css/main.4948ef80.chunk.css.map", @@ -25,6 +25,6 @@ "static/css/2.9338f6a1.chunk.css", "static/js/2.9ae5727a.chunk.js", "static/css/main.4948ef80.chunk.css", - "static/js/main.0818b132.chunk.js" + "static/js/main.1a9ab5b0.chunk.js" ] } \ No newline at end of file diff --git a/build/index.html b/build/index.html index 86aaaaf..9e6809e 100644 --- a/build/index.html +++ b/build/index.html @@ -1 +1 @@ -Ergo node interface
\ No newline at end of file +Ergo node interface
\ No newline at end of file diff --git a/build/precache-manifest.5a56762cd3298f2b85b771747b1147ae.js b/build/precache-manifest.cfa8d209094ed4bb302117b55adf437d.js similarity index 92% rename from build/precache-manifest.5a56762cd3298f2b85b771747b1147ae.js rename to build/precache-manifest.cfa8d209094ed4bb302117b55adf437d.js index e62d14e..102f014 100644 --- a/build/precache-manifest.5a56762cd3298f2b85b771747b1147ae.js +++ b/build/precache-manifest.cfa8d209094ed4bb302117b55adf437d.js @@ -1,6 +1,6 @@ self.__precacheManifest = (self.__precacheManifest || []).concat([ { - "revision": "b09b2dac2c19e02a982f6e112b906b19", + "revision": "3b09cbb65deb48647bf70814bb5762dc", "url": "/index.html" }, { @@ -8,7 +8,7 @@ self.__precacheManifest = (self.__precacheManifest || []).concat([ "url": "/static/css/2.9338f6a1.chunk.css" }, { - "revision": "36a45daef8a61848b2b4", + "revision": "28aa8f73cc73b004cd58", "url": "/static/css/main.4948ef80.chunk.css" }, { @@ -16,8 +16,8 @@ self.__precacheManifest = (self.__precacheManifest || []).concat([ "url": "/static/js/2.9ae5727a.chunk.js" }, { - "revision": "36a45daef8a61848b2b4", - "url": "/static/js/main.0818b132.chunk.js" + "revision": "28aa8f73cc73b004cd58", + "url": "/static/js/main.1a9ab5b0.chunk.js" }, { "revision": "ce813ebd69754efed759", diff --git a/build/service-worker.js b/build/service-worker.js index 0a00286..ab11c6c 100644 --- a/build/service-worker.js +++ b/build/service-worker.js @@ -14,7 +14,7 @@ importScripts("https://storage.googleapis.com/workbox-cdn/releases/4.3.1/workbox-sw.js"); importScripts( - "/precache-manifest.5a56762cd3298f2b85b771747b1147ae.js" + "/precache-manifest.cfa8d209094ed4bb302117b55adf437d.js" ); self.addEventListener('message', (event) => { diff --git a/build/static/js/main.0818b132.chunk.js.map b/build/static/js/main.0818b132.chunk.js.map deleted file mode 100644 index 47a4d1c..0000000 --- a/build/static/js/main.0818b132.chunk.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"sources":["utils/constants.js","components/common/MenuList/index.js","store/selectors/app.js","store/selectors/wallet.js","store/slices/walletSlice.js","store/actions/walletActions.js","store/slices/appSlice.js","store/actions/appActions.js","utils/environment.js","api/api.js","utils/toast/index.js","components/Header/ApiKeyModal/ApiKeyModalView.js","components/Header/ApiKeyModal/index.js","components/Header/ApiKeyModal/ApiKeyModalContainer.js","components/Header/WalletStatusModal/index.js","components/common/CopyToClipboard/index.js","components/elements/WalletInitializeForm/index.js","components/elements/RestoreWalletForm/index.js","components/Header/WalletInitModal/index.js","components/Header/HeaderView.js","components/Header/index.js","components/Header/HeaderContainer.js","components/layout/index.js","components/pages/Dashboard/InfoCard/index.js","components/pages/Dashboard/SynchCard/index.js","components/pages/Dashboard/WalletSyncCard/index.js","components/common/ErgoLoader/index.js","components/pages/Dashboard/DashboardView.js","hooks/usePrevious.js","components/pages/Dashboard/DashboardContainer.js","components/pages/Dashboard/index.js","hooks/usePortal.ts","hooks/useBodyScroll.ts","hooks/useCurrentState.ts","components/common/Text/Text.tsx","utils/withDefaults.ts","components/common/CssTransition/CssTransition.tsx","components/common/Backdrop/Backdrop.tsx","components/common/InfoModal/modal-context.ts","assets/images/icons/close.svg","assets/images/icons/copy.icon.svg","assets/images/icons/remove.svg","components/common/icons/icons.tsx","components/common/icons/CloseIcon.tsx","components/common/InfoModal/InfoModal.tsx","components/pages/Wallet/components/PaymentSendForm/index.tsx","assets/images/icons/redo-arrow-symbol.svg","components/common/icons/RedoIcon.tsx","components/pages/Wallet/components/WalletInformationTable/index.tsx","components/pages/Wallet/index.js","router/router.js","store/reducers/rootReducer.js","store/middlewares/walletMiddleware.js","App.js","store/index.js","index.js","components/common/Backdrop/Backdrop.module.scss","assets/images/logotype_white.svg"],"names":["localRouteList","dashboard","href","icon","faChartLine","title","wallet","faExchangeAlt","externalRouteList","swaggerInterface","constants","faBook","explorer","faWpexplorer","website","faGlobe","withRouter","pathname","location","className","Object","values","map","index","key","clsx","active","to","rel","target","apiKeySelector","createSelector","state","app","apiKey","walletSelector","isWalletUnlockedSelector","isWalletUnlocked","isWalletInitializedSelector","isWalletInitialized","walletStatusDataSelector","walletStatusData","walletBalanceDataSelector","walletBalanceData","walletAddressesSelector","walletAddresses","ergPriceSelector","ergPrice","createSlice","name","initialState","reducers","setIsWalletUnlocked","payload","setIsWalletInitialized","setWalletStatusData","setWalletBalanceData","setErgPrice","setWalletAddresses","checkWalletStatus","createAction","getWalletBalance","getErgPrice","getWalletAddresses","walletSlice","actions","setApiKey","action","appSlice","nodeApiLink","oracleApiLink","NetworkError","status","message","data","statusText","this","prototype","create","Error","nodeApi","axios","baseURL","environment","timeout","crossDomain","headers","interceptors","response","use","Promise","resolve","error","reject","toastStates","success","text","options","toast","position","autoClose","hideProgressBar","closeOnClick","pauseOnHover","draggable","bodyClassName","progressClassName","info","ApiKeyModalView","showModal","handleHide","submitForm","handleShow","type","onClick","renderButton","Modal","show","onHide","centered","initialValues","onSubmit","Header","closeButton","Title","Body","placeholder","Footer","ApiKeyModalContainer","connect","dispatch","dispatchSetApiKey","appActions","memo","props","useState","setShowModal","get","api_key","then","trim","customToast","catch","WalletStatusForm","setState","walletUnlock","pass","post","walletLock","submitWalletUnlockForm","setSubmitting","resetForm","setStatus","dispatchSetIsWalletUnlocked","err","errMessage","detail","submitWalletLockForm","confirm","aria-labelledby","isSubmitting","id","htmlFor","disabled","Component","isWalletUnlock","walletActions","CopyToClipboard","startTimer","timerId","setTimeout","showTooltip","onCopy","e","preventDefault","copy","children","handleOnTooltipClose","myRef","React","createRef","clearTimeout","ref","Overlay","current","placement","Tooltip","PureComponent","initialFormValues","walletPassword","mnemonicPass","WalletInitializeForm","isShowMnemonic","walletInit","a","handleSubmit","result","msg","mnemonic","role","aria-hidden","walletRestore","String","required","WalletInitModal","dispatchCheckWalletStatus","size","RestoreWalletForm","isApiKeySetted","Navbar","expand","Brand","src","logo","alt","ApiKeyModal","WalletStatusModal","renderWalletForms","HeaderContainer","useEffect","Layout","InfoCard","color","SynchCard","renderActiveSynchronization","faSync","spin","renderCompleteSynchronization","faCheck","renderSynchronizationState","complete","getSynchronizationState","fullHeight","headersHeight","nextProps","nodeInfo","currentSynchState","WalletSyncCard","walletHeight","LoaderLogo","xmlns","width","height","viewBox","fill","d","fillRule","clipRule","DashboardView","faExclamationTriangle","peersCount","bestHeaderId","launchTime","appVersion","isMining","format","Date","getWalletStatus","isUnlocked","balance","Number","toFixed","assets","length","usePrevious","value","useRef","dispatchGetWalletBalance","dispatchGetErgPrice","setNodeInfo","setError","setTimerId","setNodeCurrentState","useCallback","setTimer","newTimerId","setInterval","prevError","clearInterval","DashboardContainer","useSSR","browser","setBrowser","Boolean","window","document","createElement","isBrowser","isServer","el","setAttribute","usePortal","selectId","Math","random","toString","slice","isUsingBrowser","elSnapshot","setElSnapshot","hasElement","querySelector","body","appendChild","defaultOptions","scrollLayer","elementStack","Map","touchHandler","event","touches","useBodyScroll","elementRef","t","elRef","hidden","setHidden","safeOptions","isIosWithCustom","navigator","test","platform","lastOverflow","style","overflow","has","addEventListener","passive","set","last","removeEventListener","store","delete","useCurrentState","val","Text","variant","component","dangerouslySetInnerHTML","currentVariant","cn","colored","withDefaults","defaultProps","visible","enterTime","leaveTime","clearTime","classes","setClasses","renderable","setRenderable","statusClassName","time","timer","clearClassesTimer","isValidElement","cloneElement","setIsContentMouseDown","IsContentMouseDownRef","childrenClickHandler","stopPropagation","CssTransition","styles","backdrop","onMouseUp","layer","content","onMouseDown","ModalContext","createContext","_extends","assign","i","arguments","source","hasOwnProperty","call","apply","_objectWithoutProperties","excluded","sourceKeys","keys","indexOf","_objectWithoutPropertiesLoose","getOwnPropertySymbols","sourceSymbolKeys","propertyIsEnumerable","_ref","svgRef","ForwardRef","forwardRef","makeIcon","Icon","focusable","RemoveIcon","removeIcon","CloseIcon","closeImage","InfoModal","description","primaryButtonContent","secondaryButtonContent","disableBackdropClick","onClose","onOpen","onPrimaryHandler","onSecondaryHandler","open","portal","setBodyHidden","setVisible","visibleRef","closeModal","undefined","modalConfig","useMemo","close","createPortal","Provider","xl","sm","wrapClassName","PaymentSendForm","transactionId","setTransactionId","isSendedModalOpen","setIsSendedModalOpen","paymentSend","recipientAddress","amount","address","parseFloat","sendForm","validateForm","errors","validate","render","submitting","pristine","form","input","meta","touched","restart","_ref7","_ref8","_ref9","_ref10","_ref11","_ref12","_ref13","_ref14","_ref15","_ref16","_ref17","x","y","enableBackground","xmlSpace","RedoIcon","redoImage","WalletInformationTableItem","resultTitle","resultContent","isOpen","setIsOpen","Array","isArray","item","prev","walletBalance","dispatchGetWalletAddresses","getValues","getAddreses","addresses","getAssets","tokenId","updateValues","Wallet","renderState","unlocked","renderWalletUnlockedState","locked","renderWalletLockedState","initialized","renderInitializedState","Router","basename","exact","path","Dashboard","combineReducers","reducer","next","getState","walletData","isInitialized","configure","configureStore","rootReducer","middleware","getDefaultMiddleware","walletMiddleware","App","ReactDOM","getElementById","module","exports"],"mappings":"mcAAe,EACK,WADL,EAEJ,2BAFI,EAGH,oCAHG,EAIC,ICIVA,EAAiB,CACrBC,UAAW,CACTC,KAAM,IACNC,KAAM,kBAAC,IAAD,CAAiBA,KAAMC,MAC7BC,MAAO,aAETC,OAAQ,CACNJ,KAAM,UACNC,KAAM,kBAAC,IAAD,CAAiBA,KAAMI,MAC7BF,MAAO,WAILG,EAAoB,CACxBC,iBAAkB,CAChBP,KAAMQ,EACNP,KAAM,kBAAC,IAAD,CAAiBA,KAAMQ,MAC7BN,MAAO,WAETO,SAAU,CACRV,KAAMQ,EACNP,KAAM,kBAAC,IAAD,CAAiBA,KAAMU,MAC7BR,MAAO,YAETS,QAAS,CACPZ,KAAMQ,EACNP,KAAM,kBAAC,IAAD,CAAiBA,KAAMY,MAC7BV,MAAO,YA6CIW,eAzCE,SAAC,GAAgC,IAAlBC,EAAiB,EAA7BC,SAAYD,SAC9B,OACE,6BACE,uBAAGE,UAAU,gBAAb,QACA,wBAAIA,UAAU,SACd,yBAAKA,UAAU,+BACZC,OAAOC,OAAOrB,GAAgBsB,KAAI,WAAwBC,GAAxB,IAAGrB,EAAH,EAAGA,KAAMC,EAAT,EAASA,KAAME,EAAf,EAAeA,MAAf,OACjC,kBAAC,IAAD,CACEmB,IAAKnB,EACLc,UAAWM,YAAK,yCAA0C,CACxD,uBAAwBvB,IAASe,EACjCS,OAAQxB,IAASe,EACjB,eAA0B,IAAVM,IAElBI,GAAIzB,GAEHC,EATH,IASUE,OAId,uBAAGc,UAAU,gBAAb,kBACA,wBAAIA,UAAU,SACd,yBAAKA,UAAU,+BACZC,OAAOC,OAAOb,GAAmBc,KAAI,WAAwBC,GAAxB,IAAGrB,EAAH,EAAGA,KAAMC,EAAT,EAASA,KAAME,EAAf,EAAeA,MAAf,OACpC,uBACEmB,IAAKnB,EACLc,UAAWM,YAAK,yC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AmBkD,KACpCjC,EACGyD,IAAI,oBAAqB,CACxBnD,QAAS,CACPoD,QAASxG,KAGZyG,MAAK,YAAgC,IAAvB9F,EAAsB,EAA5B6B,KACPwD,EAASoC,EAAc5G,mBAAmBb,OAE3CiG,OAAM,eAObgW,EAAK3a,M,qBC5DP+B,IAAMgZ,YACN,IAAMvK,GCNUwK,YAAe,CAC3BN,QAASO,GACTC,WAAW,GAAD,oBAAMC,eAAN,CAA8BC,ODc7BC,GARH,WACV,OACE,kBAAC,IAAD,CAAU7K,MAAOA,IACf,kBAAC,GAAD,QEZN8K,IAASpE,OAAO,kBAAC,GAAD,MAASxJ,SAAS6N,eAAe,U,mBCHjDC,EAAOC,QAAU,CAAC,SAAW,2BAA2B,QAAU,0BAA0B,MAAQ,0B,mBCDpGD,EAAOC,QAAU,IAA0B,6C","file":"static/js/main.0818b132.chunk.js","sourcesContent":["export default {\n swaggerInterface: '/swagger',\n website: 'https://ergoplatform.org',\n explorer: 'https://explorer.ergoplatform.com',\n nanoErgInErg: 1000000000,\n};\n","import React from 'react';\nimport { FontAwesomeIcon } from '@fortawesome/react-fontawesome';\nimport { faChartLine, faExchangeAlt, faGlobe, faBook } from '@fortawesome/free-solid-svg-icons';\nimport clsx from 'clsx';\nimport { faWpexplorer } from '@fortawesome/free-brands-svg-icons';\nimport { withRouter, Link } from 'react-router-dom';\nimport constants from '../../../utils/constants';\n\nconst localRouteList = {\n dashboard: {\n href: '/',\n icon: ,\n title: 'Dashboard',\n },\n wallet: {\n href: '/wallet',\n icon: ,\n title: 'Wallet',\n },\n};\n\nconst externalRouteList = {\n swaggerInterface: {\n href: constants.swaggerInterface,\n icon: ,\n title: 'Swagger',\n },\n explorer: {\n href: constants.explorer,\n icon: ,\n title: 'Explorer',\n },\n website: {\n href: constants.website,\n icon: ,\n title: 'Website',\n },\n};\n\nconst MenuList = ({ location: { pathname } }) => {\n return (\n
\n

Menu

\n
\n
\n {Object.values(localRouteList).map(({ href, icon, title }, index) => (\n \n {icon} {title}\n \n ))}\n
\n

External links

\n
\n
\n {Object.values(externalRouteList).map(({ href, icon, title }, index) => (\n \n {icon} {title}\n \n ))}\n
\n
\n );\n};\n\nexport default withRouter(MenuList);\n","import { createSelector } from 'redux-starter-kit';\n\nexport const appSelector = (state) => state.app;\n\nexport const apiKeySelector = createSelector(appSelector, (app) => app.apiKey);\n","import { createSelector } from 'redux-starter-kit';\n\nexport const walletSelector = (state) => state.wallet;\n\nexport const isWalletUnlockedSelector = createSelector(\n walletSelector,\n (wallet) => wallet.isWalletUnlocked,\n);\n\nexport const isWalletInitializedSelector = createSelector(\n walletSelector,\n (wallet) => wallet.isWalletInitialized,\n);\n\nexport const walletStatusDataSelector = createSelector(\n walletSelector,\n (wallet) => wallet.walletStatusData,\n);\n\nexport const walletBalanceDataSelector = createSelector(\n walletSelector,\n (wallet) => wallet.walletBalanceData,\n);\n\nexport const walletAddressesSelector = createSelector(\n walletSelector,\n (wallet) => wallet.walletAddresses,\n);\n\nexport const ergPriceSelector = createSelector(walletSelector, (wallet) => wallet.ergPrice);\n","import { createSlice } from 'redux-starter-kit';\n\nconst initialState = {\n isWalletUnlocked: null,\n isWalletInitialized: null,\n walletStatusData: null,\n walletBalanceData: null,\n ergPrice: null,\n walletAddresses: null,\n};\n\nexport default createSlice({\n name: 'walletSlice',\n initialState,\n reducers: {\n setIsWalletUnlocked: (state, { payload }) => {\n state.isWalletUnlocked = payload;\n },\n setIsWalletInitialized: (state, { payload }) => {\n state.isWalletInitialized = payload;\n },\n setWalletStatusData: (state, { payload }) => {\n state.walletStatusData = payload;\n },\n setWalletBalanceData: (state, { payload }) => {\n state.walletBalanceData = payload;\n },\n setErgPrice: (state, { payload }) => {\n state.ergPrice = payload;\n },\n setWalletAddresses: (state, { payload }) => {\n state.walletAddresses = payload;\n },\n },\n});\n","import { createAction } from 'redux-starter-kit';\nimport walletSlice from '../slices/walletSlice';\n\nconst checkWalletStatus = createAction('checkWalletStatus');\nconst getWalletBalance = createAction('getWalletBalance');\nconst getErgPrice = createAction('getErgPrice');\nconst getWalletAddresses = createAction('getWalletAddresses');\n\nexport default {\n ...walletSlice.actions,\n checkWalletStatus,\n getWalletBalance,\n getErgPrice,\n getWalletAddresses,\n};\n","import { createSlice } from 'redux-starter-kit';\n\nconst initialState = {\n apiKey: '',\n};\n\nexport default createSlice({\n name: 'appSlice',\n initialState,\n reducers: {\n setApiKey: (state, action) => {\n state.apiKey = action.payload;\n },\n },\n});\n","import appSlice from '../slices/appSlice';\n\nexport default {\n ...appSlice.actions,\n};\n","const appConfig = () => {\n return {\n nodeApiLink: '/',\n oracleApiLink: 'https://erg-usd-ergo-oracle.emurgo.io',\n };\n};\n\nexport default {\n ...appConfig(),\n};\n","import axios from 'axios';\nimport environment from '../utils/environment';\n\nfunction NetworkError({ status, message, data, statusText }) {\n this.name = 'NetworkError';\n this.message = message || statusText;\n this.status = status;\n this.data = data;\n}\n\nNetworkError.prototype = Object.create(Error.prototype);\n\nconst nodeApi = axios.create({\n baseURL: environment.nodeApiLink,\n timeout: 1000 * 10,\n crossDomain: true,\n headers: {\n 'Content-Type': 'application/json',\n },\n});\n\nnodeApi.interceptors.response.use(\n (response) => Promise.resolve(response),\n (error) => Promise.reject(new NetworkError(error.response || error)),\n);\n\nexport default nodeApi;\n","import { toast } from 'react-toastify';\nimport './index.scss';\n\nconst toastStates = {\n success: (text, options) =>\n toast.success(text, {\n position: 'top-right',\n autoClose: 5000,\n hideProgressBar: false,\n closeOnClick: true,\n pauseOnHover: true,\n draggable: true,\n className: 'n-toast n-toast--success',\n bodyClassName: 'n-toast__body',\n progressClassName: 'n-toast__progress--success',\n ...options,\n }),\n error: (text, options) =>\n toast.error(text, {\n position: 'top-right',\n autoClose: 5000,\n hideProgressBar: false,\n closeOnClick: true,\n pauseOnHover: true,\n draggable: true,\n className: 'n-toast n-toast--error',\n bodyClassName: 'n-toast__body',\n progressClassName: 'n-toast__progress--error',\n ...options,\n }),\n info: toast.info,\n};\n\nexport default (state, text, options) =>\n toastStates[state] ? toastStates[state](text, options) : new Error(`Bad toast state`);\n","import React from 'react';\nimport { Modal } from 'react-bootstrap';\nimport { Formik, Form, Field } from 'formik';\n\nconst renderButton = (apiKey, handleShow) => {\n if (apiKey === '') {\n return (\n \n );\n }\n\n return (\n \n );\n};\n\nconst ApiKeyModalView = ({ showModal, handleHide, submitForm, apiKey, handleShow }) => {\n return (\n
\n {renderButton(apiKey, handleShow)}\n handleHide()} centered>\n \n {() => (\n
\n \n Authorization\n \n \n

Set API key to access Node requests

\n
\n \n
\n
\n\n \n \n \n \n
\n )}\n
\n
\n
\n );\n};\n\nexport default ApiKeyModalView;\n","import ApiKeyModalContainer from './ApiKeyModalContainer';\n\nexport default ApiKeyModalContainer;\n","import React, { memo, useState } from 'react';\nimport { connect } from 'react-redux';\nimport { apiKeySelector } from '../../../store/selectors/app';\nimport appActions from '../../../store/actions/appActions';\nimport nodeApi from '../../../api/api';\nimport customToast from '../../../utils/toast';\nimport ApiKeyModalView from './ApiKeyModalView';\n\nconst mapStateToProps = (state) => ({\n apiKey: apiKeySelector(state),\n});\n\nconst mapDispatchToProps = (dispatch) => ({\n dispatchSetApiKey: (apiKey) => dispatch(appActions.setApiKey(apiKey)),\n});\n\nconst ApiKeyModalContainer = (props) => {\n const { dispatchSetApiKey, apiKey } = props;\n\n const [showModal, setShowModal] = useState(false);\n\n const handleShow = () => {\n setShowModal(true);\n };\n\n const handleHide = () => {\n setShowModal(false);\n };\n\n const submitForm = (values) => {\n // Check API key for random get method\n nodeApi\n .get('/wallet/status', {\n headers: {\n api_key: values.apiKey,\n },\n })\n .then(() => {\n dispatchSetApiKey(values.apiKey.trim());\n customToast('success', 'API key is set successfully');\n handleHide();\n })\n .catch(() => {\n customToast('error', 'Bad API key');\n });\n };\n\n return (\n \n );\n};\n\nexport default connect(mapStateToProps, mapDispatchToProps)(memo(ApiKeyModalContainer));\n","import React, { Component, memo } from 'react';\nimport Modal from 'react-bootstrap/Modal';\nimport { Formik, Field, Form } from 'formik';\nimport { connect } from 'react-redux';\nimport { isWalletUnlockedSelector } from '../../../store/selectors/wallet';\nimport walletActions from '../../../store/actions/walletActions';\nimport { apiKeySelector } from '../../../store/selectors/app';\nimport customToast from '../../../utils/toast';\nimport nodeApi from '../../../api/api';\n\nconst mapStateToProps = (state) => ({\n isWalletUnlocked: isWalletUnlockedSelector(state),\n apiKey: apiKeySelector(state),\n});\n\nconst mapDispatchToProps = (dispatch) => ({\n dispatchSetIsWalletUnlocked: (isWalletUnlock) =>\n dispatch(walletActions.setIsWalletUnlocked(isWalletUnlock)),\n});\n\nclass WalletStatusForm extends Component {\n state = {\n showModal: false,\n };\n\n handleShow = () => {\n this.setState({ showModal: true });\n };\n\n handleHide = () => {\n this.setState({ showModal: false });\n };\n\n walletUnlock = (pass) =>\n nodeApi.post(\n '/wallet/unlock',\n { pass },\n {\n headers: {\n api_key: this.props.apiKey,\n },\n },\n );\n\n walletLock = () =>\n nodeApi.get('/wallet/lock', {\n headers: {\n api_key: this.props.apiKey,\n },\n });\n\n submitWalletUnlockForm = ({ pass }, { setSubmitting, resetForm, setStatus }) => {\n setStatus({ status: 'submitting' });\n this.walletUnlock(pass)\n .then(() => {\n resetForm({ pass: '' });\n customToast('success', 'Your wallet is unlocked successfully');\n this.props.dispatchSetIsWalletUnlocked(true);\n this.handleHide();\n })\n .catch((err) => {\n const errMessage = err.data ? err.data.detail : err.message;\n customToast('error', errMessage);\n setSubmitting(false);\n });\n };\n\n submitWalletLockForm = () => {\n // eslint-disable-next-line\n if (confirm('Are you sure want to lock wallet?')) {\n this.walletLock()\n .then(() => {\n customToast('success', 'Your wallet is locked successfully');\n this.props.dispatchSetIsWalletUnlocked(false);\n })\n .catch((err) => {\n const errMessage = err.data ? err.data.detail : err.message;\n customToast('error', errMessage);\n });\n }\n };\n\n renderButton = () => {\n if (!this.props.isWalletUnlocked) {\n return (\n \n );\n }\n\n return (\n \n );\n };\n\n render() {\n return (\n
\n {this.renderButton()}\n this.handleHide()}\n centered\n aria-labelledby=\"example-custom-modal-styling-title\"\n >\n \n {({ isSubmitting }) => (\n
\n \n \n Unlock wallet form\n \n \n \n
\n \n \n \n * If you have it or leave field empty\n \n
\n
\n\n \n \n Close\n \n \n \n
\n )}\n
\n \n
\n );\n }\n}\nexport default connect(mapStateToProps, mapDispatchToProps)(memo(WalletStatusForm));\n","import React from 'react';\nimport copy from 'clipboard-copy';\nimport { Overlay, Tooltip } from 'react-bootstrap';\n\nclass CopyToClipboard extends React.PureComponent {\n constructor(props) {\n super(props);\n\n this.myRef = React.createRef();\n this.state = { showTooltip: false };\n }\n\n componentWillUnmount() {\n clearTimeout(this.state.timerId);\n }\n\n startTimer = () => {\n const timerId = setTimeout(() => this.setState({ showTooltip: false }), 1500);\n this.setState({ timerId });\n };\n\n onCopy = (e) => {\n e.preventDefault();\n copy(this.props.children);\n this.setState({ showTooltip: true });\n this.startTimer();\n };\n\n handleOnTooltipClose = () => {\n this.setState({ showTooltip: false });\n };\n\n render() {\n return (\n <>\n \n {this.props.children}\n \n \n Copied!\n \n \n );\n }\n}\n\nexport default CopyToClipboard;\n","import React, { Component, memo } from 'react';\nimport { Formik, Field, Form } from 'formik';\nimport nodeApi from '../../../api/api';\nimport CopyToClipboard from '../../common/CopyToClipboard';\nimport customToast from '../../../utils/toast';\n\nconst initialFormValues = {\n walletPassword: '',\n mnemonicPass: '',\n};\n\nclass WalletInitializeForm extends Component {\n state = { isShowMnemonic: false };\n\n walletInit = async ({ walletPassword, mnemonicPass }) => {\n const { data } = await nodeApi.post(\n '/wallet/init',\n { pass: walletPassword, mnemonicPass },\n {\n headers: {\n api_key: this.props.apiKey,\n },\n },\n );\n\n return data;\n };\n\n handleSubmit = (values, { setSubmitting, resetForm, setStatus }) => {\n setStatus({ status: 'submitting' });\n this.walletInit(values)\n .then((result) => {\n resetForm(initialFormValues);\n setStatus({\n state: 'success',\n msg: (\n <>\n Your wallet successfully initialized. Please, save your mnemonic -{' '}\n {result.mnemonic}\n \n ),\n });\n this.setState({ isShowMnemonic: true });\n })\n .catch((err) => {\n const errMessage = err.data ? err.data.detail : err.message;\n customToast('error', errMessage);\n setSubmitting(false);\n });\n };\n\n render() {\n return (\n
\n

Initialize wallet

\n \n {({ status, isSubmitting }) => (\n
\n {status && status.state === 'error' && (\n
\n {status.msg}\n
\n )}\n {status && status.state === 'success' && this.state.isShowMnemonic && (\n
\n this.setState({ isShowMnemonic: false })}\n >\n ×\n \n {status.msg}\n
\n )}\n
\n \n \n
\n
\n \n \n
\n \n
\n )}\n
\n
\n );\n }\n}\n\nexport default memo(WalletInitializeForm);\n","import React, { Component, memo } from 'react';\nimport { Formik, Field, Form } from 'formik';\nimport nodeApi from '../../../api/api';\nimport customToast from '../../../utils/toast';\n\nconst initialFormValues = {\n walletPassword: '',\n mnemonicPass: '',\n mnemonic: '',\n};\n\nclass WalletInitializeForm extends Component {\n walletRestore = async ({ walletPassword, mnemonicPass = '', mnemonic = '' }) => {\n if (!mnemonic || !String(mnemonic).trim()) {\n throw Error('Need to set mnemonic');\n }\n\n return nodeApi.post(\n '/wallet/restore',\n { pass: walletPassword, mnemonicPass, mnemonic },\n {\n headers: {\n api_key: this.props.apiKey,\n },\n },\n );\n };\n\n handleSubmit = (values, { setSubmitting, resetForm, setStatus }) => {\n setStatus({ status: 'submitting' });\n this.walletRestore(values)\n .then(() => {\n resetForm(initialFormValues);\n customToast('success', 'Your wallet successfully re-stored');\n })\n .catch((err) => {\n const errMessage = err.data ? err.data.detail : err.message;\n customToast('error', errMessage);\n setSubmitting(false);\n });\n };\n\n render() {\n return (\n
\n

Re-store wallet

\n \n {({ status, isSubmitting }) => (\n
\n {status && status.state === 'error' && (\n
\n {status.msg}\n
\n )}\n {status && status.state === 'success' && (\n
{status.msg}
\n )}\n
\n \n \n
\n
\n \n \n
\n
\n \n \n
\n \n
\n )}\n
\n
\n );\n }\n}\n\nexport default memo(WalletInitializeForm);\n","import React, { Component, memo } from 'react';\nimport Modal from 'react-bootstrap/Modal';\nimport { connect } from 'react-redux';\nimport { apiKeySelector } from '../../../store/selectors/app';\nimport appActions from '../../../store/actions/appActions';\nimport WalletInitializeForm from '../../elements/WalletInitializeForm';\nimport RestoreWalletForm from '../../elements/RestoreWalletForm';\nimport walletActions from '../../../store/actions/walletActions';\n\nconst mapStateToProps = (state) => ({\n apiKey: apiKeySelector(state),\n});\n\nconst mapDispatchToProps = (dispatch) => ({\n dispatchCheckWalletStatus: () => dispatch(walletActions.checkWalletStatus()),\n dispatchSetApiKey: (apiKey) => dispatch(appActions.setApiKey(apiKey)),\n});\n\nclass WalletInitModal extends Component {\n state = {\n showModal: false,\n };\n\n handleShow = () => {\n this.setState({ showModal: true });\n };\n\n handleHide = () => {\n this.props.dispatchCheckWalletStatus();\n this.setState({ showModal: false });\n };\n\n renderButton = () => {\n return (\n \n );\n };\n\n render() {\n const { apiKey } = this.props;\n\n return (\n
\n {this.renderButton()}\n this.handleHide()} centered size=\"lg\">\n \n Wallet initialization\n \n \n
\n \n
\n
\n \n
\n
\n \n \n \n
\n
\n );\n }\n}\nexport default connect(mapStateToProps, mapDispatchToProps)(memo(WalletInitModal));\n","import React, { memo } from 'react';\nimport { Navbar } from 'react-bootstrap';\nimport { Link } from 'react-router-dom';\nimport ApiKeyModal from './ApiKeyModal';\nimport WalletStatusModal from './WalletStatusModal';\nimport WalletInitModal from './WalletInitModal';\nimport logo from '../../assets/images/logotype_white.svg';\n\nconst renderWalletForms = (isWalletInitialized) => {\n if (isWalletInitialized === null) {\n return <>;\n }\n\n if (isWalletInitialized) {\n return (\n
\n \n
\n );\n }\n\n return (\n
\n \n
\n );\n};\n\nconst HeaderView = ({ isApiKeySetted, isWalletInitialized }) => {\n return (\n \n \n \n \"logotype\"\n \n \n
\n \n
\n {isApiKeySetted && renderWalletForms(isWalletInitialized)}\n
\n );\n};\n\nexport default memo(HeaderView);\n","import HeaderContainer from './HeaderContainer';\n\nexport default HeaderContainer;\n","import React, { memo, useEffect } from 'react';\nimport { connect } from 'react-redux';\nimport { apiKeySelector } from '../../store/selectors/app';\nimport { isWalletInitializedSelector } from '../../store/selectors/wallet';\nimport walletActions from '../../store/actions/walletActions';\nimport HeaderView from './HeaderView';\n\nconst mapStateToProps = (state) => ({\n apiKey: apiKeySelector(state),\n isWalletInitialized: isWalletInitializedSelector(state),\n});\n\nconst mapDispatchToProps = (dispatch) => ({\n dispatchCheckWalletStatus: () => dispatch(walletActions.checkWalletStatus()),\n});\n\nconst HeaderContainer = (props) => {\n const { apiKey, dispatchCheckWalletStatus, isWalletInitialized } = props;\n\n useEffect(() => {\n if (apiKey !== '') {\n dispatchCheckWalletStatus();\n }\n }, [apiKey, dispatchCheckWalletStatus]);\n\n const isApiKeySetted = apiKey !== '';\n\n return ;\n};\n\nexport default connect(mapStateToProps, mapDispatchToProps)(memo(HeaderContainer));\n","import React from 'react';\nimport { withRouter } from 'react-router-dom';\nimport MenuList from '../common/MenuList';\nimport './index.scss';\nimport Header from '../Header';\n\nexport const Layout = withRouter((props) => {\n return (\n
\n
\n
\n \n
\n
\n
{props.children}
\n
\n
\n );\n});\n","import React from 'react';\nimport clsx from 'clsx';\nimport './index.scss';\n\nconst InfoCard = ({ color, children, className }) => {\n return (\n \n {children}\n
\n );\n};\n\nexport default InfoCard;\n","import React, { Component } from 'react';\nimport { FontAwesomeIcon } from '@fortawesome/react-fontawesome';\nimport { faSync, faCheck } from '@fortawesome/free-solid-svg-icons';\nimport InfoCard from '../InfoCard';\n\nexport default class SynchCard extends Component {\n shouldComponentUpdate(nextProps) {\n if (\n this.getSynchronizationState(nextProps) !== this.getSynchronizationState(this.props.nodeInfo)\n ) {\n return true;\n }\n\n return false;\n }\n\n renderActiveSynchronization = () => (\n <>\n

Synchronization state

\n

\n Active synchronization\n

\n \n );\n\n renderCompleteSynchronization = () => (\n <>\n

Synchronization state

\n

\n Node is synced\n

\n \n );\n\n renderSynchronizationState = (state) =>\n ({\n active: this.renderActiveSynchronization,\n complete: this.renderCompleteSynchronization,\n }[state]);\n\n getSynchronizationState = ({ fullHeight, headersHeight }) => {\n if (fullHeight !== null && headersHeight !== null && fullHeight === headersHeight) {\n return 'complete';\n }\n\n return 'active';\n };\n\n render() {\n const currentSynchState = this.getSynchronizationState(this.props.nodeInfo);\n return (\n \n {this.renderSynchronizationState(currentSynchState)()}\n \n );\n }\n}\n","import React, { Component } from 'react';\nimport { FontAwesomeIcon } from '@fortawesome/react-fontawesome';\nimport { faSync, faCheck } from '@fortawesome/free-solid-svg-icons';\nimport InfoCard from '../InfoCard';\n\nexport default class WalletSyncCard extends Component {\n renderActiveSynchronization = () => (\n <>\n

Synchronization state

\n

\n Active synchronization\n

\n \n );\n\n renderCompleteSynchronization = () => (\n <>\n

Synchronization state

\n

\n Wallet is synced\n

\n \n );\n\n renderSynchronizationState = (state) =>\n ({\n active: this.renderActiveSynchronization,\n complete: this.renderCompleteSynchronization,\n }[state]);\n\n getSynchronizationState = (walletStatusData, headersHeight) => {\n if (\n walletStatusData.walletHeight !== null &&\n headersHeight !== null &&\n walletStatusData.walletHeight === headersHeight\n ) {\n return 'complete';\n }\n\n return 'active';\n };\n\n render() {\n const { walletStatusData, headersHeight } = this.props;\n const currentSynchState = this.getSynchronizationState(walletStatusData, headersHeight);\n return (\n \n {this.renderSynchronizationState(currentSynchState)()}\n \n );\n }\n}\n","import React from 'react';\nimport './index.scss';\n\nconst LoaderLogo = () => {\n return (\n
\n \n \n \n \n
\n );\n};\n\nexport default LoaderLogo;\n","import React from 'react';\nimport { faExclamationTriangle } from '@fortawesome/free-solid-svg-icons';\nimport { FontAwesomeIcon } from '@fortawesome/react-fontawesome';\nimport { format } from 'date-fns';\nimport constants from 'utils/constants';\nimport InfoCard from './InfoCard';\nimport SynchCard from './SynchCard';\nimport WalletSyncCard from './WalletSyncCard';\nimport LoaderLogo from '../../common/ErgoLoader/index';\n\nconst getWalletStatus = (isWalletInitialized) => {\n if (!isWalletInitialized) {\n return 'Not initialized';\n }\n\n return 'Initialized';\n};\n\nconst DashboardView = ({\n error,\n nodeInfo,\n isWalletInitialized,\n walletStatusData,\n walletBalanceData,\n ergPrice,\n}) => {\n if (error !== null) {\n return (\n <>\n
\n

\n \n  \n {error}\n

\n
\n \n );\n }\n\n if (nodeInfo === null) {\n return (\n <>\n
\n \n
\n \n );\n }\n\n const { peersCount, bestHeaderId, launchTime, fullHeight, appVersion, isMining } = nodeInfo;\n\n return (\n <>\n
\n

Node Information

\n
\n
\n \n

Version

\n

{appVersion}

\n
\n
\n
\n \n
\n
\n \n

Started at

\n

\n {format(new Date(launchTime), 'MM-dd-yyyy HH:mm:ss')}\n

\n
\n
\n {fullHeight === null ? null : (\n
\n \n

Current height

\n

{fullHeight}

\n
\n
\n )}\n {bestHeaderId === null ? null : (\n
\n \n

Best block id

\n

{bestHeaderId}

\n
\n
\n )}\n
\n \n

Mining enabled

\n

{isMining ? 'Yes' : 'No'}

\n
\n
\n
\n \n

Peers connected

\n

{peersCount}

\n
\n
\n
\n
\n {ergPrice && (\n
\n

ERG Information

\n
\n
\n \n

\n ERG price in $
\n (based on oracle pool data)\n

\n

{ergPrice}

\n
\n
\n
\n
\n )}\n {walletStatusData && (\n
\n

Wallet Information

\n
\n
\n \n

Initialization state

\n

{getWalletStatus(isWalletInitialized)}

\n
\n
\n
\n \n

Lock state

\n

\n {walletStatusData.isUnlocked ? 'Unlocked' : 'Locked'}\n

\n
\n
\n
\n \n
\n {walletBalanceData && (\n
\n \n

Balance

\n

\n {walletBalanceData.balance / constants.nanoErgInErg} ERG{' '}\n {ergPrice &&\n `~ $${Number(\n ergPrice * (walletBalanceData.balance / constants.nanoErgInErg),\n ).toFixed(2)}`}\n

\n
\n
\n )}\n {walletBalanceData && (\n
\n \n

Assets quantity

\n

\n {Object.values(walletBalanceData.assets).length || '0'}\n

\n
\n
\n )}\n
\n
\n )}\n \n );\n};\n\nexport default DashboardView;\n","import { useEffect, useRef } from 'react';\n\nfunction usePrevious(value) {\n // The ref object is a generic container whose current property is mutable ...\n // ... and can hold any value, similar to an instance property on a class\n const ref = useRef();\n\n // Store current value in ref\n useEffect(() => {\n ref.current = value;\n }, [value]); // Only re-run if value changes\n\n // Return previous value (happens before update in useEffect above)\n return ref.current;\n}\n\nexport default usePrevious;\n","import React, { useState, useEffect, useCallback, memo } from 'react';\nimport { connect } from 'react-redux';\nimport nodeApi from '../../../api/api';\nimport DashboardView from './DashboardView';\nimport {\n isWalletInitializedSelector,\n isWalletUnlockedSelector,\n walletStatusDataSelector,\n walletBalanceDataSelector,\n ergPriceSelector,\n} from '../../../store/selectors/wallet';\nimport { apiKeySelector } from '../../../store/selectors/app';\nimport usePrevious from '../../../hooks/usePrevious';\nimport walletActions from '../../../store/actions/walletActions';\n\nconst mapStateToProps = (state) => ({\n apiKey: apiKeySelector(state),\n isWalletInitialized: isWalletInitializedSelector(state),\n isWalletUnlocked: isWalletUnlockedSelector(state),\n walletStatusData: walletStatusDataSelector(state),\n walletBalanceData: walletBalanceDataSelector(state),\n ergPrice: ergPriceSelector(state),\n});\n\nconst mapDispatchToProps = (dispatch) => ({\n dispatchCheckWalletStatus: () => dispatch(walletActions.checkWalletStatus()),\n dispatchGetWalletBalance: () => dispatch(walletActions.getWalletBalance()),\n dispatchGetErgPrice: () => dispatch(walletActions.getErgPrice()),\n});\n\nconst DashboardContainer = (props) => {\n const {\n isWalletInitialized,\n isWalletUnlocked,\n apiKey,\n dispatchCheckWalletStatus,\n dispatchGetWalletBalance,\n dispatchGetErgPrice,\n walletStatusData,\n walletBalanceData,\n ergPrice,\n } = props;\n\n const [nodeInfo, setNodeInfo] = useState(null);\n const [error, setError] = useState(null);\n const [timerId, setTimerId] = useState(null);\n\n const getNodeCurrentState = () => nodeApi.get('/info');\n\n const setNodeCurrentState = useCallback(async () => {\n try {\n const { data } = await getNodeCurrentState();\n\n setNodeInfo(data);\n setError(null);\n } catch {\n setError('Node connection is lost.');\n }\n }, []);\n\n const setTimer = useCallback(() => {\n const newTimerId = setInterval(() => {\n setNodeCurrentState();\n dispatchGetErgPrice();\n\n if (apiKey) {\n dispatchCheckWalletStatus();\n dispatchGetWalletBalance();\n }\n }, 2000);\n\n setTimerId(newTimerId);\n }, [\n apiKey,\n dispatchCheckWalletStatus,\n dispatchGetErgPrice,\n dispatchGetWalletBalance,\n setNodeCurrentState,\n ]);\n\n const prevError = usePrevious(error);\n useEffect(() => {\n if (prevError && prevError !== error) {\n dispatchCheckWalletStatus();\n dispatchGetWalletBalance();\n dispatchGetErgPrice();\n }\n }, [dispatchCheckWalletStatus, dispatchGetErgPrice, dispatchGetWalletBalance, error, prevError]);\n\n useEffect(() => {\n setNodeCurrentState();\n dispatchGetErgPrice();\n\n if (apiKey) {\n dispatchCheckWalletStatus();\n dispatchGetWalletBalance();\n }\n\n setTimer();\n // eslint-disable-next-line\n }, [apiKey]);\n\n useEffect(\n () => () => {\n clearInterval(timerId);\n },\n [timerId, apiKey],\n );\n\n return (\n \n );\n};\n\nexport default connect(mapStateToProps, mapDispatchToProps)(memo(DashboardContainer));\n","import DashboardContainer from './DashboardContainer';\nimport './index.scss';\n\nexport default DashboardContainer;\n","import { useEffect, useState } from 'react';\n\nconst isBrowser = (): boolean => {\n return Boolean(typeof window !== 'undefined' && window.document && window.document.createElement);\n};\n\ntype SSRState = {\n isBrowser: boolean;\n isServer: boolean;\n};\n\nconst useSSR = (): SSRState => {\n const [browser, setBrowser] = useState(false);\n useEffect(() => {\n setBrowser(isBrowser());\n }, []);\n\n return {\n isBrowser: browser,\n isServer: !browser,\n };\n};\n\nconst createElement = (id: string): HTMLElement => {\n const el = document.createElement('div');\n el.setAttribute('id', id);\n return el;\n};\n\nconst usePortal = (\n selectId: string = Math.random().toString(32).slice(2, 10),\n): HTMLElement | null => {\n const id = `id-${selectId}`;\n const isUsingBrowser = useSSR().isBrowser;\n const [elSnapshot, setElSnapshot] = useState(\n isUsingBrowser ? createElement(id) : null,\n );\n\n useEffect(() => {\n const hasElement = document.querySelector(`#${id}`);\n const el = hasElement || createElement(id);\n\n if (!hasElement) {\n document.body.appendChild(el);\n }\n setElSnapshot(el);\n }, []);\n\n return elSnapshot;\n};\n\nexport default usePortal;\n","import { Dispatch, RefObject, SetStateAction, useEffect, useRef, useState } from 'react';\n/* eslint-disable */\nexport type ElementStackItem = {\n last: string;\n};\n\nexport type BodyScrollOptions = {\n scrollLayer: boolean;\n};\n\nconst defaultOptions: BodyScrollOptions = {\n scrollLayer: false,\n};\n\nconst elementStack = new Map();\n\nconst isIos = () => {\n /* istanbul ignore next */\n if (typeof window === 'undefined' || !window.navigator) return false;\n return /iP(ad|hone|od)/.test(window.navigator.platform);\n};\n\nconst touchHandler = (event: TouchEvent): boolean => {\n if (event.touches && event.touches.length > 1) return true;\n event.preventDefault();\n return false;\n};\n\nconst useBodyScroll = (\n elementRef?: RefObject | null,\n options?: BodyScrollOptions\n): [boolean, Dispatch>] => {\n if (typeof document === 'undefined')\n return [false, (t: SetStateAction) => t];\n const elRef = elementRef || useRef(document.body);\n const [hidden, setHidden] = useState(false);\n const safeOptions = {\n ...defaultOptions,\n ...(options || {}),\n };\n\n // don't prevent touch event when layer contain scroll\n const isIosWithCustom = () => {\n if (safeOptions.scrollLayer) return false;\n return isIos();\n };\n\n useEffect(() => {\n if (!elRef || !elRef.current) return;\n const lastOverflow = elRef.current.style.overflow;\n if (hidden) {\n if (elementStack.has(elRef.current)) return;\n if (!isIosWithCustom()) {\n elRef.current.style.overflow = 'hidden';\n } else {\n document.addEventListener('touchmove', touchHandler, {\n passive: false,\n });\n }\n elementStack.set(elRef.current, {\n last: lastOverflow,\n });\n return;\n }\n\n // reset element overflow\n if (!elementStack.has(elRef.current)) return;\n if (!isIosWithCustom()) {\n const store = elementStack.get(elRef.current) as ElementStackItem;\n elRef.current.style.overflow = store.last;\n } else {\n document.removeEventListener('touchmove', touchHandler);\n }\n elementStack.delete(elRef.current);\n }, [hidden, elRef]);\n\n return [hidden, setHidden];\n};\n\nexport default useBodyScroll;\n\n/* eslint-disable */\n","import { Dispatch, MutableRefObject, SetStateAction, useEffect, useRef, useState } from 'react';\n\nexport type CurrentStateType = [S, Dispatch>, MutableRefObject];\n\n// Добавляет ref, по которому текущее значение стейта можно получить\n// сразу вместо того чтобы ждать следующего рендера\nconst useCurrentState = (initialState: S | (() => S)): CurrentStateType => {\n const [state, setState] = useState(() => {\n return typeof initialState === 'function' ? (initialState as () => S)() : initialState;\n });\n const ref = useRef(initialState as S);\n\n useEffect(() => {\n ref.current = state;\n }, [state]);\n\n const setValue = (val: SetStateAction) => {\n const result = typeof val === 'function' ? (val as (prevState: S) => S)(ref.current) : val;\n ref.current = result;\n setState(result);\n };\n\n return [state, setValue, ref];\n};\n\nexport default useCurrentState;\n","import React, { ReactNode } from 'react';\nimport cn from 'classnames';\n\ntype TextVariant =\n | 'h1'\n | 'h2'\n | 'h3'\n | 'h4'\n | 'h5'\n | 'h6'\n | 'subtitle1'\n | 'subtitle2'\n | 'body-text1'\n | 'body-text2'\n | 'small-text1'\n | 'small-text2'\n | 'small-text3';\n\nexport type TextColor =\n | 'brandOrange'\n | 'purple'\n | 'black'\n | 'spaceGray'\n | 'gray5'\n | 'gray4'\n | 'gray3'\n | 'gray2'\n | 'gray1'\n | 'white'\n | 'orange'\n | 'red'\n | 'green'\n | 'blue'\n | 'blueHover'\n | 'brandOrangeHover'\n | 'brandOrangeActive'\n | 'purpleHover'\n | 'purpleActive';\n\nexport type TextComponent = 'span' | 'p' | 'div' | 'h1' | 'label' | 'h2' | 'h3';\n\ninterface IText {\n children?: ReactNode;\n variant?: TextVariant;\n xl?: TextVariant;\n lg?: TextVariant;\n md?: TextVariant;\n sm?: TextVariant;\n component?: TextComponent;\n color?: TextColor;\n className?: string;\n dangerouslySetInnerHTML?: any;\n htmlFor?: string;\n}\n\nconst Text = ({\n children,\n variant,\n component,\n color,\n className,\n dangerouslySetInnerHTML,\n ...props\n}: IText) => {\n const currentVariant = variant;\n\n const Component = component || 'p';\n\n if (dangerouslySetInnerHTML) {\n return (\n <>\n \n\n \n \n );\n }\n\n return (\n \n {children}\n \n \n );\n};\n\nexport default Text;\n","import React from 'react';\n\n// Прокидывает default параметры в компонент\nconst withDefaults = (component: React.ComponentType

, defaultProps: DP) => {\n type Props = Partial & Omit;\n // eslint-disable-next-line\n component.defaultProps = defaultProps;\n return component as React.ComponentType;\n};\n\nexport default withDefaults;\n","import React, { useEffect, useState } from 'react';\nimport withDefaults from 'utils/withDefaults';\n\ninterface Props {\n visible?: boolean;\n enterTime?: number;\n leaveTime?: number;\n clearTime?: number;\n className?: string;\n name?: string;\n}\n\nconst defaultProps = {\n visible: false,\n enterTime: 60,\n leaveTime: 60,\n clearTime: 60,\n className: '',\n name: 'transition',\n};\n\nexport type CSSTransitionProps = Props & typeof defaultProps;\n\nconst CSSTransition: React.FC> = ({\n children,\n className,\n visible,\n enterTime,\n leaveTime,\n clearTime,\n name,\n ...props\n}) => {\n const [classes, setClasses] = useState('');\n const [renderable, setRenderable] = useState(visible);\n\n useEffect(() => {\n const statusClassName = visible ? 'enter' : 'leave';\n const time = visible ? enterTime : leaveTime;\n if (visible && !renderable) {\n setRenderable(true);\n }\n\n setClasses(`${name}-${statusClassName}`);\n\n // set class to active\n const timer = setTimeout(() => {\n setClasses(`${name}-${statusClassName} ${name}-${statusClassName}-active`);\n clearTimeout(timer);\n }, time);\n\n // remove classess when animation over\n const clearClassesTimer = setTimeout(() => {\n if (!visible) {\n setClasses('');\n setRenderable(false);\n }\n clearTimeout(clearClassesTimer);\n }, time + clearTime);\n\n return () => {\n clearTimeout(timer);\n clearTimeout(clearClassesTimer);\n };\n }, [visible, renderable]);\n if (!React.isValidElement(children) || !renderable) return null;\n\n return React.cloneElement(children, {\n ...props,\n className: `${children.props.className} ${className} ${classes}`,\n });\n};\n\nexport default withDefaults(CSSTransition, defaultProps);\n","import React, { MouseEvent, useCallback, ReactElement } from 'react';\nimport withDefaults from 'utils/withDefaults';\nimport useCurrentState from 'hooks/useCurrentState';\nimport cn from 'classnames';\nimport CssTransition from '../CssTransition/CssTransition';\nimport styles from './Backdrop.module.scss';\n\ninterface Props {\n onClick?: (event: MouseEvent) => void;\n visible?: boolean;\n children?: ReactElement;\n className?: string;\n}\n\nconst defaultProps = {\n onClick: () => {},\n visible: false,\n};\n\nexport type BackdropProps = Props & typeof defaultProps;\n\nconst Backdrop: React.FC> = React.memo(\n ({ children, onClick, visible, className }: BackdropProps) => {\n const [, setIsContentMouseDown, IsContentMouseDownRef] = useCurrentState(false);\n const clickHandler = (event: MouseEvent) => {\n if (IsContentMouseDownRef.current) return;\n if (onClick) {\n onClick(event);\n }\n };\n const childrenClickHandler = useCallback((event: MouseEvent) => {\n event.stopPropagation();\n }, []);\n const mouseUpHandler = () => {\n if (!IsContentMouseDownRef.current) return;\n const timer = setTimeout(() => {\n setIsContentMouseDown(false);\n clearTimeout(timer);\n }, 0);\n };\n\n return (\n \n

\n
\n setIsContentMouseDown(true)}\n >\n {children}\n
\n
\n \n );\n },\n);\n\nexport default withDefaults(Backdrop, defaultProps);\n","import React from 'react';\n\nexport interface ModalConfig {\n close?: () => void;\n}\n\nconst defaultContext = {};\n\nexport const ModalContext = React.createContext(defaultContext);\n\nexport const useModalContext = (): ModalConfig => React.useContext(ModalContext);\n","function _extends() { _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }\n\nfunction _objectWithoutProperties(source, excluded) { if (source == null) return {}; var target = _objectWithoutPropertiesLoose(source, excluded); var key, i; if (Object.getOwnPropertySymbols) { var sourceSymbolKeys = Object.getOwnPropertySymbols(source); for (i = 0; i < sourceSymbolKeys.length; i++) { key = sourceSymbolKeys[i]; if (excluded.indexOf(key) >= 0) continue; if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue; target[key] = source[key]; } } return target; }\n\nfunction _objectWithoutPropertiesLoose(source, excluded) { if (source == null) return {}; var target = {}; var sourceKeys = Object.keys(source); var key, i; for (i = 0; i < sourceKeys.length; i++) { key = sourceKeys[i]; if (excluded.indexOf(key) >= 0) continue; target[key] = source[key]; } return target; }\n\nimport React from \"react\";\n\nvar _ref2 = /*#__PURE__*/React.createElement(\"path\", {\n d: \"M10.7951 9.30799C10.3844 8.89734 9.71865 8.89734 9.30799 9.30799C8.89734 9.71865 8.89734 10.3844 9.30799 10.7951L14.5129 16L9.30799 21.2049C8.89734 21.6156 8.89734 22.2814 9.30799 22.692C9.71865 23.1027 10.3844 23.1027 10.7951 22.692L16 17.4871L21.2049 22.692C21.6156 23.1027 22.2814 23.1027 22.692 22.692C23.1027 22.2814 23.1027 21.6156 22.692 21.2049L17.4871 16L22.692 10.7951C23.1027 10.3844 23.1027 9.71865 22.692 9.30799C22.2814 8.89734 21.6156 8.89734 21.2049 9.30799L16 14.5129L10.7951 9.30799Z\",\n fill: \"#76767A\"\n});\n\nvar SvgClose = function SvgClose(_ref) {\n var svgRef = _ref.svgRef,\n title = _ref.title,\n props = _objectWithoutProperties(_ref, [\"svgRef\", \"title\"]);\n\n return /*#__PURE__*/React.createElement(\"svg\", _extends({\n width: 32,\n height: 32,\n viewBox: \"0 0 32 32\",\n fill: \"none\",\n ref: svgRef\n }, props), title ? /*#__PURE__*/React.createElement(\"title\", null, title) : null, _ref2);\n};\n\nvar ForwardRef = /*#__PURE__*/React.forwardRef(function (props, ref) {\n return /*#__PURE__*/React.createElement(SvgClose, _extends({\n svgRef: ref\n }, props));\n});\nexport default __webpack_public_path__ + \"static/media/close.feae5a5c.svg\";\nexport { ForwardRef as ReactComponent };","function _extends() { _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }\n\nfunction _objectWithoutProperties(source, excluded) { if (source == null) return {}; var target = _objectWithoutPropertiesLoose(source, excluded); var key, i; if (Object.getOwnPropertySymbols) { var sourceSymbolKeys = Object.getOwnPropertySymbols(source); for (i = 0; i < sourceSymbolKeys.length; i++) { key = sourceSymbolKeys[i]; if (excluded.indexOf(key) >= 0) continue; if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue; target[key] = source[key]; } } return target; }\n\nfunction _objectWithoutPropertiesLoose(source, excluded) { if (source == null) return {}; var target = {}; var sourceKeys = Object.keys(source); var key, i; for (i = 0; i < sourceKeys.length; i++) { key = sourceKeys[i]; if (excluded.indexOf(key) >= 0) continue; target[key] = source[key]; } return target; }\n\nimport React from \"react\";\n\nvar _ref2 = /*#__PURE__*/React.createElement(\"path\", {\n d: \"M10.6668 0.666748H2.66683C1.9335 0.666748 1.3335 1.26675 1.3335 2.00008V11.3334H2.66683V2.00008H10.6668V0.666748ZM10.0002 3.33341L14.0002 7.33341V14.0001C14.0002 14.7334 13.4002 15.3334 12.6668 15.3334H5.32683C4.5935 15.3334 4.00016 14.7334 4.00016 14.0001L4.00683 4.66675C4.00683 3.93341 4.60016 3.33341 5.3335 3.33341H10.0002ZM9.3335 8.00008H13.0002L9.3335 4.33341V8.00008Z\",\n fill: \"#0078FF\"\n});\n\nvar SvgCopyicon = function SvgCopyicon(_ref) {\n var svgRef = _ref.svgRef,\n title = _ref.title,\n props = _objectWithoutProperties(_ref, [\"svgRef\", \"title\"]);\n\n return /*#__PURE__*/React.createElement(\"svg\", _extends({\n width: 16,\n height: 16,\n viewBox: \"0 0 16 16\",\n fill: \"none\",\n ref: svgRef\n }, props), title ? /*#__PURE__*/React.createElement(\"title\", null, title) : null, _ref2);\n};\n\nvar ForwardRef = /*#__PURE__*/React.forwardRef(function (props, ref) {\n return /*#__PURE__*/React.createElement(SvgCopyicon, _extends({\n svgRef: ref\n }, props));\n});\nexport default __webpack_public_path__ + \"static/media/copy.icon.835ebda7.svg\";\nexport { ForwardRef as ReactComponent };","function _extends() { _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }\n\nfunction _objectWithoutProperties(source, excluded) { if (source == null) return {}; var target = _objectWithoutPropertiesLoose(source, excluded); var key, i; if (Object.getOwnPropertySymbols) { var sourceSymbolKeys = Object.getOwnPropertySymbols(source); for (i = 0; i < sourceSymbolKeys.length; i++) { key = sourceSymbolKeys[i]; if (excluded.indexOf(key) >= 0) continue; if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue; target[key] = source[key]; } } return target; }\n\nfunction _objectWithoutPropertiesLoose(source, excluded) { if (source == null) return {}; var target = {}; var sourceKeys = Object.keys(source); var key, i; for (i = 0; i < sourceKeys.length; i++) { key = sourceKeys[i]; if (excluded.indexOf(key) >= 0) continue; target[key] = source[key]; } return target; }\n\nimport React from \"react\";\n\nvar _ref2 = /*#__PURE__*/React.createElement(\"path\", {\n d: \"M13.3332 7.99992C13.3332 8.36811 13.0347 8.66659 12.6665 8.66659H3.33317C2.96498 8.66659 2.6665 8.36811 2.6665 7.99992C2.6665 7.63173 2.96498 7.33325 3.33317 7.33325H12.6665C13.0347 7.33325 13.3332 7.63173 13.3332 7.99992Z\",\n fill: \"#0078FF\"\n});\n\nvar SvgRemove = function SvgRemove(_ref) {\n var svgRef = _ref.svgRef,\n title = _ref.title,\n props = _objectWithoutProperties(_ref, [\"svgRef\", \"title\"]);\n\n return /*#__PURE__*/React.createElement(\"svg\", _extends({\n width: 16,\n height: 16,\n viewBox: \"0 0 16 16\",\n fill: \"none\",\n ref: svgRef\n }, props), title ? /*#__PURE__*/React.createElement(\"title\", null, title) : null, _ref2);\n};\n\nvar ForwardRef = /*#__PURE__*/React.forwardRef(function (props, ref) {\n return /*#__PURE__*/React.createElement(SvgRemove, _extends({\n svgRef: ref\n }, props));\n});\nexport default __webpack_public_path__ + \"static/media/remove.94c0849a.svg\";\nexport { ForwardRef as ReactComponent };","import React from 'react';\n\nimport { ReactComponent as copyIcon } from '../../../assets/images/icons/copy.icon.svg';\nimport { ReactComponent as removeIcon } from '../../../assets/images/icons/remove.svg';\n\nexport interface IconProps {\n className?: string;\n}\n\nexport const makeIcon = (Icon: any, className?: string) => {\n return ;\n};\n\nexport const CopyIcon = ({ className }: IconProps) => {\n return makeIcon(copyIcon, className);\n};\n\nexport const RemoveIcon = ({ className }: IconProps) => {\n return makeIcon(removeIcon, className);\n};\n","import { ReactComponent as closeImage } from 'assets/images/icons/close.svg';\nimport { makeIcon, IconProps } from './icons';\n\nexport const CloseIcon = ({ className }: IconProps) => {\n return makeIcon(closeImage, className);\n};\n","import React, { useEffect, useMemo, useCallback } from 'react';\nimport { createPortal } from 'react-dom';\nimport usePortal from 'hooks/usePortal';\nimport useBodyScroll from 'hooks/useBodyScroll';\nimport useCurrentState from 'hooks/useCurrentState';\nimport Text from 'components/common/Text/Text';\nimport Backdrop from '../Backdrop/Backdrop';\nimport { ModalConfig, ModalContext } from './modal-context';\nimport CssTransition from '../CssTransition/CssTransition';\nimport { CloseIcon } from '../icons/CloseIcon';\n\ninterface Props {\n title?: React.ReactNode;\n description?: React.ReactNode;\n primaryButtonContent: React.ReactNode;\n secondaryButtonContent: React.ReactNode;\n disableBackdropClick?: boolean;\n onClose?: () => void;\n onOpen?: () => void;\n onPrimaryHandler?: () => void;\n onSecondaryHandler?: () => void;\n open?: boolean;\n width?: string;\n wrapClassName?: string;\n}\n\nconst defaultProps = {\n width: '26rem',\n wrapClassName: '',\n disableBackdropClick: false,\n};\n\ntype NativeAttrs = Omit, keyof Props>;\nexport type ModalProps = Props & typeof defaultProps & NativeAttrs;\n\nconst InfoModal: React.FC> = ({\n title,\n description,\n primaryButtonContent,\n secondaryButtonContent,\n disableBackdropClick,\n onClose,\n onOpen,\n onPrimaryHandler,\n onSecondaryHandler,\n open,\n}) => {\n const portal = usePortal('modal');\n const [, setBodyHidden] = useBodyScroll(null, { scrollLayer: true });\n const [visible, setVisible, visibleRef] = useCurrentState(false);\n\n const closeModal = useCallback(() => {\n if (onClose) {\n onClose();\n }\n setVisible(false);\n setBodyHidden(false);\n }, [onClose, setVisible, setBodyHidden]);\n\n useEffect(() => {\n if (open === undefined) return;\n if (open && onOpen) {\n onOpen();\n }\n if (!open && visibleRef.current && onClose) {\n onClose();\n }\n\n setVisible(open);\n setBodyHidden(open);\n }, [open]);\n\n const closeFromBackdrop = () => {\n if (disableBackdropClick) return;\n closeModal();\n };\n\n const primaryButtonClickHandler = () => {\n if (onPrimaryHandler) {\n onPrimaryHandler();\n }\n if (onClose) {\n onClose();\n }\n };\n\n const secondaryButtonClickHandler = () => {\n if (onSecondaryHandler) {\n onSecondaryHandler();\n }\n if (onClose) {\n onClose();\n }\n };\n\n const modalConfig: ModalConfig = useMemo(\n () => ({\n close: closeModal,\n }),\n [closeModal],\n );\n\n if (!portal) return null;\n\n return createPortal(\n \n \n \n
\n
\n

{title}

\n \n {description}\n \n \n {primaryButtonContent}\n \n \n {secondaryButtonContent}\n \n
\n \n\n \n
\n
\n
\n
,\n portal,\n );\n};\n\ntype ModalComponent

= React.FC

;\ntype ComponentProps = Partial &\n Omit &\n NativeAttrs;\n\nInfoModal.defaultProps = defaultProps;\n\nexport default InfoModal as ModalComponent;\n","import React, { useState, useCallback } from 'react';\nimport { Form, Field } from 'react-final-form';\nimport InfoModal from 'components/common/InfoModal/InfoModal';\nimport cn from 'classnames';\nimport nodeApi from '../../../../../api/api';\nimport customToast from '../../../../../utils/toast';\nimport CopyToClipboard from '../../../../common/CopyToClipboard';\nimport constants from '../../../../../utils/constants';\n\ntype Errors = {\n recipientAddress?: string;\n amount?: string;\n};\n\nconst PaymentSendForm = ({ apiKey }: { apiKey: string }) => {\n const [transactionId, setTransactionId] = useState(null);\n const [isSendedModalOpen, setIsSendedModalOpen] = useState(false);\n\n const paymentSend = useCallback(\n ({ recipientAddress, amount }) =>\n nodeApi.post(\n '/wallet/payment/send',\n [\n {\n address: recipientAddress,\n value: Number((parseFloat(amount) * constants.nanoErgInErg).toFixed(1)),\n },\n ],\n {\n headers: {\n api_key: apiKey,\n },\n },\n ),\n [apiKey],\n );\n\n const resetForm = (form: any) => {\n form.restart();\n setIsSendedModalOpen(false);\n };\n\n const sendForm = useCallback(\n (values) => {\n if (values.recipientAddress.trim() === '' || !values.recipientAddress) {\n return;\n }\n\n paymentSend(values)\n .then(({ data }) => {\n setTransactionId(data);\n setIsSendedModalOpen(true);\n })\n .catch((err) => {\n const errMessage = err.data ? err.data.detail : err.message;\n customToast('error', errMessage);\n });\n },\n [paymentSend],\n );\n\n const validateForm = useCallback((values) => {\n const errors: Errors = {};\n if (!values.recipientAddress) {\n errors.recipientAddress = 'The field cannot be empty';\n }\n if (!values.amount || values.amount < 0.001) {\n errors.amount = 'Minimum 0.001 ERG';\n }\n return errors;\n }, []);\n\n return (\n

\n
\n

Payment send

\n (\n <>\n
\n
\n \n (\n <>\n \n
{meta.error}
\n \n )}\n />\n
\n
\n \n (\n <>\n \n
{meta.error}
\n \n )}\n />\n
\n \n
\n\n {\n setIsSendedModalOpen(false);\n }}\n title=\"Payment sent\"\n description={\n <>\n

\n Your payment has been sent successfully. The transaction ID is -{' '}\n {transactionId}\n

\n

\n \n Click Here To Go To The Explorer\n \n

\n \n }\n primaryButtonContent={OK}\n secondaryButtonContent=\"Send again\"\n onPrimaryHandler={() => resetForm(form)}\n />\n \n )}\n />\n
\n
\n );\n};\n\nexport default PaymentSendForm;\n","function _extends() { _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }\n\nfunction _objectWithoutProperties(source, excluded) { if (source == null) return {}; var target = _objectWithoutPropertiesLoose(source, excluded); var key, i; if (Object.getOwnPropertySymbols) { var sourceSymbolKeys = Object.getOwnPropertySymbols(source); for (i = 0; i < sourceSymbolKeys.length; i++) { key = sourceSymbolKeys[i]; if (excluded.indexOf(key) >= 0) continue; if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue; target[key] = source[key]; } } return target; }\n\nfunction _objectWithoutPropertiesLoose(source, excluded) { if (source == null) return {}; var target = {}; var sourceKeys = Object.keys(source); var key, i; for (i = 0; i < sourceKeys.length; i++) { key = sourceKeys[i]; if (excluded.indexOf(key) >= 0) continue; target[key] = source[key]; } return target; }\n\nimport React from \"react\";\n\nvar _ref2 = /*#__PURE__*/React.createElement(\"g\", null, /*#__PURE__*/React.createElement(\"path\", {\n d: \"M39.622,21.746l-6.749,6.75c-0.562,0.562-1.326,0.879-2.122,0.879s-1.56-0.316-2.121-0.879l-6.75-6.75 c-1.171-1.171-1.171-3.071,0-4.242c1.171-1.172,3.071-1.172,4.242,0l1.832,1.832C27.486,13.697,22.758,9.25,17,9.25 c-6.064,0-11,4.935-11,11c0,6.064,4.936,11,11,11c1.657,0,3,1.343,3,3s-1.343,3-3,3c-9.373,0-17-7.626-17-17s7.627-17,17-17 c8.936,0,16.266,6.933,16.936,15.698l1.442-1.444c1.172-1.172,3.072-1.172,4.242,0C40.792,18.674,40.792,20.574,39.622,21.746z\"\n}));\n\nvar _ref3 = /*#__PURE__*/React.createElement(\"g\", null);\n\nvar _ref4 = /*#__PURE__*/React.createElement(\"g\", null);\n\nvar _ref5 = /*#__PURE__*/React.createElement(\"g\", null);\n\nvar _ref6 = /*#__PURE__*/React.createElement(\"g\", null);\n\nvar _ref7 = /*#__PURE__*/React.createElement(\"g\", null);\n\nvar _ref8 = /*#__PURE__*/React.createElement(\"g\", null);\n\nvar _ref9 = /*#__PURE__*/React.createElement(\"g\", null);\n\nvar _ref10 = /*#__PURE__*/React.createElement(\"g\", null);\n\nvar _ref11 = /*#__PURE__*/React.createElement(\"g\", null);\n\nvar _ref12 = /*#__PURE__*/React.createElement(\"g\", null);\n\nvar _ref13 = /*#__PURE__*/React.createElement(\"g\", null);\n\nvar _ref14 = /*#__PURE__*/React.createElement(\"g\", null);\n\nvar _ref15 = /*#__PURE__*/React.createElement(\"g\", null);\n\nvar _ref16 = /*#__PURE__*/React.createElement(\"g\", null);\n\nvar _ref17 = /*#__PURE__*/React.createElement(\"g\", null);\n\nvar SvgRedoArrowSymbol = function SvgRedoArrowSymbol(_ref) {\n var svgRef = _ref.svgRef,\n title = _ref.title,\n props = _objectWithoutProperties(_ref, [\"svgRef\", \"title\"]);\n\n return /*#__PURE__*/React.createElement(\"svg\", _extends({\n id: \"Capa_1\",\n x: \"0px\",\n y: \"0px\",\n width: \"32px\",\n height: \"32px\",\n viewBox: \"0 0 40.499 40.5\",\n style: {\n enableBackground: \"new 0 0 40.499 40.5\"\n },\n xmlSpace: \"preserve\",\n ref: svgRef\n }, props), title ? /*#__PURE__*/React.createElement(\"title\", null, title) : null, _ref2, _ref3, _ref4, _ref5, _ref6, _ref7, _ref8, _ref9, _ref10, _ref11, _ref12, _ref13, _ref14, _ref15, _ref16, _ref17);\n};\n\nvar ForwardRef = /*#__PURE__*/React.forwardRef(function (props, ref) {\n return /*#__PURE__*/React.createElement(SvgRedoArrowSymbol, _extends({\n svgRef: ref\n }, props));\n});\nexport default __webpack_public_path__ + \"static/media/redo-arrow-symbol.e801de31.svg\";\nexport { ForwardRef as ReactComponent };","import { ReactComponent as redoImage } from 'assets/images/icons/redo-arrow-symbol.svg';\nimport { makeIcon, IconProps } from './icons';\n\nexport const RedoIcon = ({ className }: IconProps) => {\n return makeIcon(redoImage, className);\n};\n","import React, { useState, useEffect, useCallback, useMemo } from 'react';\nimport cn from 'classnames';\nimport './index.scss';\nimport { connect } from 'react-redux';\nimport { RedoIcon } from 'components/common/icons/RedoIcon';\nimport constants from 'utils/constants';\nimport { RemoveIcon } from '../../../../common/icons/icons';\nimport {\n walletBalanceDataSelector,\n ergPriceSelector,\n walletAddressesSelector,\n} from '../../../../../store/selectors/wallet';\nimport walletActions from '../../../../../store/actions/walletActions';\n\nconst WalletInformationTableItem = ({ name, value }: any) => {\n const [isOpen, setIsOpen] = useState(false);\n let resultTitle;\n let resultContent;\n\n if (Array.isArray(value)) {\n resultTitle = value.length;\n\n resultContent = (\n
\n {value.map((item) => (\n <>\n
\n {item.value || ''} {item.name || ''}\n
\n
\n \n ))}\n
\n );\n } else {\n resultTitle = value;\n resultContent = value;\n }\n\n return (\n
\n \n
{name}
\n \n
\n {isOpen &&
{resultContent}
}\n \n );\n};\n\nconst WalletInformationTable = (props: any) => {\n const {\n walletBalance,\n ergPrice,\n dispatchGetWalletBalance,\n dispatchGetErgPrice,\n dispatchGetWalletAddresses,\n walletAddresses,\n } = props;\n\n const getValues = useCallback(() => {\n dispatchGetWalletBalance();\n dispatchGetErgPrice();\n dispatchGetWalletAddresses();\n }, [dispatchGetWalletBalance, dispatchGetErgPrice, dispatchGetWalletAddresses]);\n\n const getAddreses = useCallback((addresses: String[]) => {\n if (addresses.length === 0) {\n return 0;\n }\n\n return addresses.map((item) => ({\n value: (\n \n {item}\n \n ),\n }));\n }, []);\n\n const getAssets = useCallback((assets) => {\n if (Object.values(assets).length === 0) {\n return 0;\n }\n\n return assets.map(({ tokenId, amount }: any) => ({\n name: {tokenId},\n value: {amount},\n }));\n }, []);\n\n useEffect(() => {\n getValues();\n }, [getValues]);\n\n const data = useMemo(\n () => [\n {\n name: 'Balance',\n value: walletBalance\n ? `${walletBalance.balance / constants.nanoErgInErg} ERG`\n : 'loading...',\n },\n // {\n // name: 'Balance in USD',\n // value: walletBalance\n // ? `$ ${(walletBalance.balance / constants.nanoErgInErg) * ergPrice}`\n // : 'Loading...',\n // },\n {\n name: 'Assets',\n value: walletBalance ? getAssets(walletBalance.assets) : `Loading...`,\n },\n {\n name: 'Addresses',\n value: walletAddresses ? getAddreses(walletAddresses) : `Loading...`,\n },\n ],\n [walletBalance, ergPrice, getAssets, walletAddresses, getAddreses],\n );\n\n const updateValues = useCallback(() => {\n getValues();\n }, [getValues]);\n\n return (\n
\n
\n

\n Wallet Information{' '}\n \n

\n
\n
\n {data.map(({ value, name }) => (\n \n ))}\n
\n
\n );\n};\n\nconst mapStateToProps = (state: any) => ({\n walletBalance: walletBalanceDataSelector(state),\n ergPrice: ergPriceSelector(state),\n walletAddresses: walletAddressesSelector(state),\n});\n\nconst mapDispatchToProps = (dispatch: any) => ({\n dispatchGetWalletBalance: () => dispatch(walletActions.getWalletBalance()),\n dispatchGetErgPrice: () => dispatch(walletActions.getErgPrice()),\n dispatchGetWalletAddresses: () => dispatch(walletActions.getWalletAddresses()),\n});\n\nexport default connect(mapStateToProps, mapDispatchToProps)(WalletInformationTable);\n","import React, { Component, memo } from 'react';\nimport { connect } from 'react-redux';\nimport PaymentSendForm from './components/PaymentSendForm/index';\nimport { apiKeySelector } from '../../../store/selectors/app';\nimport {\n isWalletInitializedSelector,\n isWalletUnlockedSelector,\n} from '../../../store/selectors/wallet';\nimport WalletInformationTable from './components/WalletInformationTable/index';\nimport './index.scss';\n\nconst mapStateToProps = (state) => ({\n apiKey: apiKeySelector(state),\n isWalletInitialized: isWalletInitializedSelector(state),\n isWalletUnlocked: isWalletUnlockedSelector(state),\n});\n\nclass Wallet extends Component {\n renderState = (state) =>\n ({\n unlocked: (apiKey) => this.renderWalletUnlockedState(apiKey),\n locked: () => this.renderWalletLockedState(),\n initialized: (apiKey) => this.renderInitializedState(apiKey),\n }[state]);\n\n renderWalletLockedState = () => (\n
\n

The wallet UI is locked. You need to unlock the wallet to access its UI.

\n
\n );\n\n renderInitializedState = () => (\n
\n

You need to initialize your wallet to access wallet UI.

\n
\n );\n\n renderWalletUnlockedState = (apiKey) => (\n
\n \n \n {/* \n */}\n
\n );\n\n render() {\n const { apiKey, isWalletUnlocked, isWalletInitialized } = this.props;\n\n if (apiKey === '') {\n return (\n
\n

To continue, please set your API key.

\n
\n );\n }\n\n if (!isWalletInitialized) {\n return this.renderState('initialized')(apiKey);\n }\n\n if (isWalletUnlocked) {\n return this.renderState('unlocked')(apiKey);\n }\n\n return this.renderState('locked')();\n }\n}\n\nexport default connect(mapStateToProps)(memo(Wallet));\n","import React from 'react';\nimport { BrowserRouter, Switch, Route } from 'react-router-dom';\nimport { Layout } from '../components/layout';\nimport Dashboard from '../components/pages/Dashboard';\nimport Wallet from '../components/pages/Wallet';\n\nconst Router = () => (\n \n \n \n \n \n \n \n \n);\n\nexport default Router;\n","import { combineReducers } from 'redux';\nimport appSlice from '../slices/appSlice';\nimport walletSlice from '../slices/walletSlice';\n\nexport default combineReducers({\n app: appSlice.reducer,\n wallet: walletSlice.reducer,\n});\n","// import Axios from 'axios';\nimport walletActions from '../actions/walletActions';\nimport nodeApi from '../../api/api';\nimport { apiKeySelector } from '../selectors/app';\n// import oracleApi from '../../api/oracleApi';\n\nexport default (store) => (next) => (action) => {\n const { dispatch, getState } = store;\n const apiKey = apiKeySelector(getState());\n\n switch (action.type) {\n case walletActions.checkWalletStatus.type:\n nodeApi\n .get('/wallet/status', {\n headers: {\n api_key: apiKey,\n },\n })\n .then(({ data: walletData }) => {\n dispatch(walletActions.setIsWalletUnlocked(walletData.isUnlocked));\n dispatch(walletActions.setIsWalletInitialized(walletData.isInitialized));\n dispatch(walletActions.setWalletStatusData(walletData));\n })\n .catch(() => {});\n\n break;\n\n case walletActions.getWalletBalance.type:\n nodeApi\n .get('/wallet/balances', {\n headers: {\n api_key: apiKey,\n },\n })\n .then(({ data: walletData }) => {\n dispatch(walletActions.setWalletBalanceData(walletData));\n })\n .catch(() => {});\n\n break;\n\n // case walletActions.getErgPrice.type:\n // oracleApi\n // .get('/frontendData', {\n // transformResponse: [...Axios.defaults.transformResponse, (data) => JSON.parse(data)],\n // })\n // .then(({ data }) => {\n // dispatch(walletActions.setErgPrice(data.latest_price));\n // })\n // .catch(() => {});\n\n // break;\n\n case walletActions.getWalletAddresses.type:\n nodeApi\n .get('/wallet/addresses', {\n headers: {\n api_key: apiKey,\n },\n })\n .then(({ data: walletAddresses }) => {\n dispatch(walletActions.setWalletAddresses(walletAddresses));\n })\n .catch(() => {});\n\n break;\n\n default:\n break;\n }\n next(action);\n};\n","import React from 'react';\nimport { toast } from 'react-toastify';\nimport { Provider } from 'react-redux';\nimport Router from './router/router';\nimport createStore from './store';\n\nimport 'bootstrap/dist/css/bootstrap.min.css';\nimport './assets/styles/index.scss';\nimport 'react-toastify/dist/ReactToastify.min.css';\n\ntoast.configure();\nconst store = createStore();\n\nconst App = () => {\n return (\n \n \n \n );\n};\n\nexport default App;\n","import { configureStore, getDefaultMiddleware } from 'redux-starter-kit';\nimport rootReducer from './reducers/rootReducer';\nimport walletMiddleware from './middlewares/walletMiddleware';\n\nexport default () => {\n const store = configureStore({\n reducer: rootReducer,\n middleware: [...getDefaultMiddleware(), walletMiddleware],\n });\n\n return store;\n};\n","import React from 'react';\nimport ReactDOM from 'react-dom';\nimport App from './App';\n\nReactDOM.render(, document.getElementById('root'));\n","// extracted by mini-css-extract-plugin\nmodule.exports = {\"backdrop\":\"Backdrop_backdrop__PmdBI\",\"content\":\"Backdrop_content__2Kmrw\",\"layer\":\"Backdrop_layer__3V2YH\"};","module.exports = __webpack_public_path__ + \"static/media/logotype_white.4dcfd639.svg\";"],"sourceRoot":""} \ No newline at end of file diff --git a/build/static/js/main.0818b132.chunk.js b/build/static/js/main.1a9ab5b0.chunk.js similarity index 56% rename from build/static/js/main.0818b132.chunk.js rename to build/static/js/main.1a9ab5b0.chunk.js index d6cc682..4fe6187 100644 --- a/build/static/js/main.0818b132.chunk.js +++ b/build/static/js/main.1a9ab5b0.chunk.js @@ -1,2 +1,2 @@ -(this["webpackJsonpergo-node-interface"]=this["webpackJsonpergo-node-interface"]||[]).push([[0],{102:function(e,t,a){e.exports=a(142)},113:function(e,t,a){},130:function(e,t,a){},134:function(e,t,a){},135:function(e,t,a){},136:function(e,t,a){},137:function(e,t,a){},138:function(e,t,a){},140:function(e,t,a){},142:function(e,t,a){"use strict";a.r(t);var n=a(0),r=a.n(n),l=a(10),c=a.n(l),o=a(47),s=a(15),i=a(39),u=a(7),m=a(20),d=a(25),p=a(48),f=a(89),b="/swagger",h="https://ergoplatform.org",E="https://explorer.ergoplatform.com",v=1e9,y={dashboard:{href:"/",icon:r.a.createElement(m.a,{icon:d.b}),title:"Dashboard"},wallet:{href:"/wallet",icon:r.a.createElement(m.a,{icon:d.d}),title:"Wallet"}},g={swaggerInterface:{href:b,icon:r.a.createElement(m.a,{icon:d.a}),title:"Swagger"},explorer:{href:E,icon:r.a.createElement(m.a,{icon:f.a}),title:"Explorer"},website:{href:h,icon:r.a.createElement(m.a,{icon:d.f}),title:"Website"}},w=Object(u.f)((function(e){var t=e.location.pathname;return r.a.createElement("div",null,r.a.createElement("p",{className:"h5 pl-3 pt-4"},"Menu"),r.a.createElement("hr",{className:"mb-0"}),r.a.createElement("div",{className:"list-group list-group-flush"},Object.values(y).map((function(e,a){var n=e.href,l=e.icon,c=e.title;return r.a.createElement(i.b,{key:c,className:Object(p.a)("list-group-item list-group-item-action",{"list-group-item-dark":n===t,active:n===t,"border-top-0":0===a}),to:n},l," ",c)}))),r.a.createElement("p",{className:"h5 pl-3 pt-4"},"External links"),r.a.createElement("hr",{className:"mb-0"}),r.a.createElement("div",{className:"list-group list-group-flush"},Object.values(g).map((function(e,t){var a=e.href,n=e.icon,l=e.title;return r.a.createElement("a",{key:l,className:Object(p.a)("list-group-item list-group-item-action",{"border-top-0":0===t}),href:a,rel:"noopener noreferrer",target:"_blank"},n," ",l)}))))})),N=(a(113),a(79)),O=Object(N.a)((function(e){return e.app}),(function(e){return e.apiKey})),j=function(e){return e.wallet},k=Object(N.a)(j,(function(e){return e.isWalletUnlocked})),S=Object(N.a)(j,(function(e){return e.isWalletInitialized})),_=Object(N.a)(j,(function(e){return e.walletStatusData})),C=Object(N.a)(j,(function(e){return e.walletBalanceData})),W=Object(N.a)(j,(function(e){return e.walletAddresses})),x=Object(N.a)(j,(function(e){return e.ergPrice})),I=a(23),P=a(19),A=Object(P.c)({name:"walletSlice",initialState:{isWalletUnlocked:null,isWalletInitialized:null,walletStatusData:null,walletBalanceData:null,ergPrice:null,walletAddresses:null},reducers:{setIsWalletUnlocked:function(e,t){var a=t.payload;e.isWalletUnlocked=a},setIsWalletInitialized:function(e,t){var a=t.payload;e.isWalletInitialized=a},setWalletStatusData:function(e,t){var a=t.payload;e.walletStatusData=a},setWalletBalanceData:function(e,t){var a=t.payload;e.walletBalanceData=a},setErgPrice:function(e,t){var a=t.payload;e.ergPrice=a},setWalletAddresses:function(e,t){var a=t.payload;e.walletAddresses=a}}}),B=Object(P.b)("checkWalletStatus"),z=Object(P.b)("getWalletBalance"),L=Object(P.b)("getErgPrice"),T=Object(P.b)("getWalletAddresses"),H=Object(I.a)({},A.actions,{checkWalletStatus:B,getWalletBalance:z,getErgPrice:L,getWalletAddresses:T}),F=a(151),M=a(5),K=Object(P.c)({name:"appSlice",initialState:{apiKey:""},reducers:{setApiKey:function(e,t){e.apiKey=t.payload}}}),U=Object(I.a)({},K.actions),R=a(91),D=a.n(R),G=Object(I.a)({},{nodeApiLink:"/",oracleApiLink:"https://erg-usd-ergo-oracle.emurgo.io"});function V(e){var t=e.status,a=e.message,n=e.data,r=e.statusText;this.name="NetworkError",this.message=a||r,this.status=t,this.data=n}V.prototype=Object.create(Error.prototype);var Y=D.a.create({baseURL:G.nodeApiLink,timeout:1e4,crossDomain:!0,headers:{"Content-Type":"application/json"}});Y.interceptors.response.use((function(e){return Promise.resolve(e)}),(function(e){return Promise.reject(new V(e.response||e))}));var Z=Y,q=(a(130),{success:function(e,t){return o.a.success(e,Object(I.a)({position:"top-right",autoClose:5e3,hideProgressBar:!1,closeOnClick:!0,pauseOnHover:!0,draggable:!0,className:"n-toast n-toast--success",bodyClassName:"n-toast__body",progressClassName:"n-toast__progress--success"},t))},error:function(e,t){return o.a.error(e,Object(I.a)({position:"top-right",autoClose:5e3,hideProgressBar:!1,closeOnClick:!0,pauseOnHover:!0,draggable:!0,className:"n-toast n-toast--error",bodyClassName:"n-toast__body",progressClassName:"n-toast__progress--error"},t))},info:o.a.info}),J=function(e,t,a){return q[e]?q[e](t,a):new Error("Bad toast state")},$=a(29),Q=a(9),X=function(e){var t=e.showModal,a=e.handleHide,n=e.submitForm,l=e.apiKey,c=e.handleShow;return r.a.createElement("div",null,function(e,t){return""===e?r.a.createElement("button",{type:"button",onClick:t,className:"btn btn-primary"},"Set API key"):r.a.createElement("button",{type:"button",onClick:t,className:"btn btn-outline-primary"},"Update API key")}(l,c),r.a.createElement($.a,{show:t,onHide:function(){return a()},centered:!0},r.a.createElement(Q.c,{initialValues:{apiKey:l},onSubmit:n},(function(){return r.a.createElement(Q.b,null,r.a.createElement($.a.Header,{closeButton:!0},r.a.createElement($.a.Title,null,"Authorization")),r.a.createElement($.a.Body,null,r.a.createElement("p",{className:"text"},"Set API key to access Node requests"),r.a.createElement("div",{className:"input-group"},r.a.createElement(Q.a,{type:"text",name:"apiKey",className:"form-control",placeholder:"Enter API key"}))),r.a.createElement($.a.Footer,null,r.a.createElement("button",{type:"button",className:"btn btn-outline-secondary",onClick:a},"Close"),r.a.createElement("button",{type:"submit",className:"btn btn-primary"},"Save changes")))}))))},ee=Object(s.b)((function(e){return{apiKey:O(e)}}),(function(e){return{dispatchSetApiKey:function(t){return e(U.setApiKey(t))}}}))(Object(n.memo)((function(e){var t=e.dispatchSetApiKey,a=e.apiKey,l=Object(n.useState)(!1),c=Object(M.a)(l,2),o=c[0],s=c[1],i=function(){s(!1)};return r.a.createElement(X,{showModal:o,apiKey:a,handleHide:i,submitForm:function(e){Z.get("/wallet/status",{headers:{api_key:e.apiKey}}).then((function(){t(e.apiKey.trim()),J("success","API key is set successfully"),i()})).catch((function(){J("error","Bad API key")}))},handleShow:function(){s(!0)}})}))),te=a(12),ae=a(13),ne=a(16),re=a(14),le=a(17),ce=function(e){function t(){var e,a;Object(te.a)(this,t);for(var n=arguments.length,l=new Array(n),c=0;c0&&void 0!==arguments[0]?arguments[0]:Math.random().toString(32).slice(2,10),t="id-".concat(e),a=Fe().isBrowser,r=Object(n.useState)(a?Me(t):null),l=Object(M.a)(r,2),c=l[0],o=l[1];return Object(n.useEffect)((function(){var e=document.querySelector("#".concat(t)),a=e||Me(t);e||document.body.appendChild(a),o(a)}),[]),c},Ue={scrollLayer:!1},Re=new Map,De=function(e){return!!(e.touches&&e.touches.length>1)||(e.preventDefault(),!1)},Ge=function(e,t){if("undefined"===typeof document)return[!1,function(e){return e}];var a=e||Object(n.useRef)(document.body),r=Object(n.useState)(!1),l=Object(M.a)(r,2),c=l[0],o=l[1],s=Object(I.a)({},Ue,{},t||{}),i=function(){return!s.scrollLayer&&(!("undefined"===typeof window||!window.navigator)&&/iP(ad|hone|od)/.test(window.navigator.platform))};return Object(n.useEffect)((function(){if(a&&a.current){var e=a.current.style.overflow;if(c){if(Re.has(a.current))return;return i()?document.addEventListener("touchmove",De,{passive:!1}):a.current.style.overflow="hidden",void Re.set(a.current,{last:e})}if(Re.has(a.current)){if(i())document.removeEventListener("touchmove",De);else{var t=Re.get(a.current);a.current.style.overflow=t.last}Re.delete(a.current)}}}),[c,a]),[c,o]},Ve=function(e){var t=Object(n.useState)((function(){return"function"===typeof e?e():e})),a=Object(M.a)(t,2),r=a[0],l=a[1],c=Object(n.useRef)(e);Object(n.useEffect)((function(){c.current=r}),[r]);return[r,function(e){var t="function"===typeof e?e(c.current):e;c.current=t,l(t)},c]},Ye=a(65),Ze=a(4),qe=a.n(Ze),Je=function(e){var t=e.children,a=e.variant,n=e.component,l=e.color,c=e.className,o=e.dangerouslySetInnerHTML,s=Object(Ye.a)(e,["children","variant","component","color","className","dangerouslySetInnerHTML"]),i=a,u=n||"p";return o?r.a.createElement(r.a.Fragment,null,r.a.createElement(u,Object.assign({className:qe()({colored:l},i,c),dangerouslySetInnerHTML:o},s)),r.a.createElement("style",null,"\n .colored {\n color: var(--".concat(l,");\n }\n "))):r.a.createElement(u,Object.assign({className:qe()({colored:l},i,c)},s),t,r.a.createElement("style",null,"\n .colored {\n color: var(--".concat(l,");\n }\n ")))},$e=function(e,t){return e.defaultProps=t,e},Qe=$e((function(e){var t=e.children,a=e.className,l=e.visible,c=e.enterTime,o=e.leaveTime,s=e.clearTime,i=e.name,u=Object(Ye.a)(e,["children","className","visible","enterTime","leaveTime","clearTime","name"]),m=Object(n.useState)(""),d=Object(M.a)(m,2),p=d[0],f=d[1],b=Object(n.useState)(l),h=Object(M.a)(b,2),E=h[0],v=h[1];return Object(n.useEffect)((function(){var e=l?"enter":"leave",t=l?c:o;l&&!E&&v(!0),f("".concat(i,"-").concat(e));var a=setTimeout((function(){f("".concat(i,"-").concat(e," ").concat(i,"-").concat(e,"-active")),clearTimeout(a)}),t),n=setTimeout((function(){l||(f(""),v(!1)),clearTimeout(n)}),t+s);return function(){clearTimeout(a),clearTimeout(n)}}),[l,E]),r.a.isValidElement(t)&&E?r.a.cloneElement(t,Object(I.a)({},u,{className:"".concat(t.props.className," ").concat(a," ").concat(p)})):null}),{visible:!1,enterTime:60,leaveTime:60,clearTime:60,className:"",name:"transition"}),Xe=a(67),et=a.n(Xe),tt=$e(r.a.memo((function(e){var t=e.children,a=e.onClick,l=e.visible,c=e.className,o=Ve(!1),s=Object(M.a)(o,3),i=s[1],u=s[2],m=Object(n.useCallback)((function(e){e.stopPropagation()}),[]);return r.a.createElement(Qe,{visible:l,clearTime:300},r.a.createElement("div",{className:et.a.backdrop,onClick:function(e){u.current||a&&a(e)},onMouseUp:function(){if(u.current)var e=setTimeout((function(){i(!1),clearTimeout(e)}),0)}},r.a.createElement("div",{className:et.a.layer}),r.a.createElement("div",{onClick:m,className:qe()(et.a.content,c),onMouseDown:function(){return i(!0)}},t)))})),{onClick:function(){},visible:!1}),at=r.a.createContext({});function nt(){return(nt=Object.assign||function(e){for(var t=1;t=0||(r[a]=e[a]);return r}(e,t);if(Object.getOwnPropertySymbols){var l=Object.getOwnPropertySymbols(e);for(n=0;n=0||Object.prototype.propertyIsEnumerable.call(e,a)&&(r[a]=e[a])}return r}var lt=r.a.createElement("path",{d:"M10.7951 9.30799C10.3844 8.89734 9.71865 8.89734 9.30799 9.30799C8.89734 9.71865 8.89734 10.3844 9.30799 10.7951L14.5129 16L9.30799 21.2049C8.89734 21.6156 8.89734 22.2814 9.30799 22.692C9.71865 23.1027 10.3844 23.1027 10.7951 22.692L16 17.4871L21.2049 22.692C21.6156 23.1027 22.2814 23.1027 22.692 22.692C23.1027 22.2814 23.1027 21.6156 22.692 21.2049L17.4871 16L22.692 10.7951C23.1027 10.3844 23.1027 9.71865 22.692 9.30799C22.2814 8.89734 21.6156 8.89734 21.2049 9.30799L16 14.5129L10.7951 9.30799Z",fill:"#76767A"}),ct=function(e){var t=e.svgRef,a=e.title,n=rt(e,["svgRef","title"]);return r.a.createElement("svg",nt({width:32,height:32,viewBox:"0 0 32 32",fill:"none",ref:t},n),a?r.a.createElement("title",null,a):null,lt)},ot=r.a.forwardRef((function(e,t){return r.a.createElement(ct,nt({svgRef:t},e))}));a.p;a.p;function st(){return(st=Object.assign||function(e){for(var t=1;t=0||(r[a]=e[a]);return r}(e,t);if(Object.getOwnPropertySymbols){var l=Object.getOwnPropertySymbols(e);for(n=0;n=0||Object.prototype.propertyIsEnumerable.call(e,a)&&(r[a]=e[a])}return r}var ut=r.a.createElement("path",{d:"M13.3332 7.99992C13.3332 8.36811 13.0347 8.66659 12.6665 8.66659H3.33317C2.96498 8.66659 2.6665 8.36811 2.6665 7.99992C2.6665 7.63173 2.96498 7.33325 3.33317 7.33325H12.6665C13.0347 7.33325 13.3332 7.63173 13.3332 7.99992Z",fill:"#0078FF"}),mt=function(e){var t=e.svgRef,a=e.title,n=it(e,["svgRef","title"]);return r.a.createElement("svg",st({width:16,height:16,viewBox:"0 0 16 16",fill:"none",ref:t},n),a?r.a.createElement("title",null,a):null,ut)},dt=r.a.forwardRef((function(e,t){return r.a.createElement(mt,st({svgRef:t},e))})),pt=(a.p,function(e,t){return r.a.createElement(e,{className:t,focusable:"false"})}),ft=function(e){var t=e.className;return pt(dt,t)},bt=function(e){var t=e.className;return pt(ot,t)},ht=function(e){var t=e.title,a=e.description,c=e.primaryButtonContent,o=e.secondaryButtonContent,s=e.disableBackdropClick,i=e.onClose,u=e.onOpen,m=e.onPrimaryHandler,d=e.onSecondaryHandler,p=e.open,f=Ke("modal"),b=Ge(null,{scrollLayer:!0}),h=Object(M.a)(b,2)[1],E=Ve(!1),v=Object(M.a)(E,3),y=v[0],g=v[1],w=v[2],N=Object(n.useCallback)((function(){i&&i(),g(!1),h(!1)}),[i,g,h]);Object(n.useEffect)((function(){void 0!==p&&(p&&u&&u(),!p&&w.current&&i&&i(),g(p),h(p))}),[p]);var O=Object(n.useMemo)((function(){return{close:N}}),[N]);return f?Object(l.createPortal)(r.a.createElement(at.Provider,{value:O},r.a.createElement(tt,{onClick:function(){s||N()},visible:y,className:"info-modal-backdrop"},r.a.createElement(Qe,{name:"wrapper",visible:y,clearTime:300},r.a.createElement("div",{className:"info-modal"},r.a.createElement("div",{className:"info-modal__content"},r.a.createElement("h3",{className:"mb-3"},t),r.a.createElement(Je,{xl:"body-text1",sm:"small-text1",className:"mb-40 mb-md-56 pr-40 pr-md-0"},a),r.a.createElement("button",{type:"button",className:"btn btn-primary px-4",onClick:function(){m&&m(),i&&i()}},c),r.a.createElement("button",{type:"button",className:"btn btn-outline-secondary px-4 ml-3",onClick:function(){d&&d(),i&&i()}},o)),r.a.createElement("button",{type:"button",className:"info-modal__button--close",onClick:N},r.a.createElement(bt,null)),r.a.createElement("style",null,"\n .wrapper-enter {\n opacity: 0;\n transform: translate3d(0px, -40px, 0px);\n }\n .wrapper-enter-active {\n opacity: 1;\n transform: translate3d(0px, 0px, 0px);\n }\n .wrapper-leave {\n opacity: 1;\n transform: translate3d(0px, 0px, 0px);\n }\n .wrapper-leave-active {\n opacity: 0;\n transform: translate3d(0px, -50px, 0px);\n }\n "))))),f):null};ht.defaultProps={width:"26rem",wrapClassName:"",disableBackdropClick:!1};var Et=ht,vt=function(e){var t=e.apiKey,a=Object(n.useState)(null),l=Object(M.a)(a,2),c=l[0],o=l[1],s=Object(n.useState)(!1),i=Object(M.a)(s,2),u=i[0],m=i[1],d=Object(n.useCallback)((function(e){var a=e.recipientAddress,n=e.amount;return Z.post("/wallet/payment/send",[{address:a,value:Number((parseFloat(n)*v).toFixed(1))}],{headers:{api_key:t}})}),[t]),p=Object(n.useCallback)((function(e){""!==e.recipientAddress.trim()&&e.recipientAddress&&d(e).then((function(e){var t=e.data;o(t),m(!0)})).catch((function(e){var t=e.data?e.data.detail:e.message;J("error",t)}))}),[d]),f=Object(n.useCallback)((function(e){var t={};return e.recipientAddress||(t.recipientAddress="The field cannot be empty"),(!e.amount||e.amount<.001)&&(t.amount="Minimum 0.001 ERG"),t}),[]);return r.a.createElement("div",{className:""},r.a.createElement("div",{className:"card bg-white p-4"},r.a.createElement("h2",{className:"h5 mb-3"},"Payment send"),r.a.createElement(He.b,{onSubmit:p,validate:f,render:function(e){var t=e.handleSubmit,a=e.submitting,n=e.pristine,l=e.form;return r.a.createElement(r.a.Fragment,null,r.a.createElement("form",{onSubmit:t},r.a.createElement("div",{className:"mb-3"},r.a.createElement("label",{htmlFor:"recipient-address"},"Recipient address"),r.a.createElement(He.a,{name:"recipientAddress",render:function(e){var t=e.input,a=e.meta;return r.a.createElement(r.a.Fragment,null,r.a.createElement("input",Object.assign({id:"recipient-address",className:qe()("form-control",{"is-invalid":a.touched&&a.error}),type:"text",placeholder:"Enter recipient address"},t)),r.a.createElement("div",{className:"invalid-feedback"},a.error))}})),r.a.createElement("div",{className:"mb-3"},r.a.createElement("label",{htmlFor:"amount"},"Amount"),r.a.createElement(He.a,{name:"amount",render:function(e){var t=e.input,a=e.meta;return r.a.createElement(r.a.Fragment,null,r.a.createElement("input",Object.assign({id:"amount",className:qe()("form-control",{"is-invalid":a.touched&&a.error}),type:"number",placeholder:"Minimum 0.001 ERG"},t)),r.a.createElement("div",{className:"invalid-feedback"},a.error))}})),r.a.createElement("button",{type:"submit",className:"btn btn-primary",disabled:a||n},"Send")),r.a.createElement(Et,{open:u,onClose:function(){m(!1)},title:"Payment sent",description:r.a.createElement(r.a.Fragment,null,r.a.createElement("p",null,"Your payment has been sent successfully. The transaction ID is -"," ",r.a.createElement(be,null,c)),r.a.createElement("p",null,r.a.createElement("a",{target:"_blank",rel:"noopener noreferrer",href:"https://explorer.ergoplatform.com/en/transactions/".concat(c)},"Click Here To Go To The Explorer"))),primaryButtonContent:r.a.createElement("span",{className:"pl-3 pr-3"},"OK"),secondaryButtonContent:"Send again",onPrimaryHandler:function(){return function(e){e.restart(),m(!1)}(l)}}))}})))};a(137);function yt(){return(yt=Object.assign||function(e){for(var t=1;t=0||(r[a]=e[a]);return r}(e,t);if(Object.getOwnPropertySymbols){var l=Object.getOwnPropertySymbols(e);for(n=0;n=0||Object.prototype.propertyIsEnumerable.call(e,a)&&(r[a]=e[a])}return r}var wt=r.a.createElement("g",null,r.a.createElement("path",{d:"M39.622,21.746l-6.749,6.75c-0.562,0.562-1.326,0.879-2.122,0.879s-1.56-0.316-2.121-0.879l-6.75-6.75 c-1.171-1.171-1.171-3.071,0-4.242c1.171-1.172,3.071-1.172,4.242,0l1.832,1.832C27.486,13.697,22.758,9.25,17,9.25 c-6.064,0-11,4.935-11,11c0,6.064,4.936,11,11,11c1.657,0,3,1.343,3,3s-1.343,3-3,3c-9.373,0-17-7.626-17-17s7.627-17,17-17 c8.936,0,16.266,6.933,16.936,15.698l1.442-1.444c1.172-1.172,3.072-1.172,4.242,0C40.792,18.674,40.792,20.574,39.622,21.746z"})),Nt=r.a.createElement("g",null),Ot=r.a.createElement("g",null),jt=r.a.createElement("g",null),kt=r.a.createElement("g",null),St=r.a.createElement("g",null),_t=r.a.createElement("g",null),Ct=r.a.createElement("g",null),Wt=r.a.createElement("g",null),xt=r.a.createElement("g",null),It=r.a.createElement("g",null),Pt=r.a.createElement("g",null),At=r.a.createElement("g",null),Bt=r.a.createElement("g",null),zt=r.a.createElement("g",null),Lt=r.a.createElement("g",null),Tt=function(e){var t=e.svgRef,a=e.title,n=gt(e,["svgRef","title"]);return r.a.createElement("svg",yt({id:"Capa_1",x:"0px",y:"0px",width:"32px",height:"32px",viewBox:"0 0 40.499 40.5",style:{enableBackground:"new 0 0 40.499 40.5"},xmlSpace:"preserve",ref:t},n),a?r.a.createElement("title",null,a):null,wt,Nt,Ot,jt,kt,St,_t,Ct,Wt,xt,It,Pt,At,Bt,zt,Lt)},Ht=r.a.forwardRef((function(e,t){return r.a.createElement(Tt,yt({svgRef:t},e))})),Ft=(a.p,function(e){var t=e.className;return pt(Ht,t)}),Mt=function(e){var t,a,l=e.name,c=e.value,o=Object(n.useState)(!1),s=Object(M.a)(o,2),i=s[0],u=s[1];return Array.isArray(c)?(t=c.length,a=r.a.createElement("div",null,c.map((function(e){return r.a.createElement(r.a.Fragment,null,r.a.createElement("div",null,e.value||""," ",e.name||""),r.a.createElement("br",null))})))):(t=c,a=c),r.a.createElement("div",{className:"wallet-table__item"},r.a.createElement("div",{className:qe()("wallet-table-item-header",{"wallet-table-item-header--opened":i})},r.a.createElement("div",{className:"wallet-table-item-header__title"},l),r.a.createElement("div",{className:"wallet-table-item-header__right-side"},!i&&r.a.createElement("div",{className:"wallet-table-item-header__opacity-paragraph"},t),r.a.createElement("a",{className:"wallet-table-item-header__link",onClick:function(){return u((function(e){return!e}))}},!i&&"More",i&&r.a.createElement(ft,null)))),i&&r.a.createElement("div",{className:"wallet-table-item-body"},a))},Kt=Object(s.b)((function(e){return{walletBalance:C(e),ergPrice:x(e),walletAddresses:W(e)}}),(function(e){return{dispatchGetWalletBalance:function(){return e(H.getWalletBalance())},dispatchGetErgPrice:function(){return e(H.getErgPrice())},dispatchGetWalletAddresses:function(){return e(H.getWalletAddresses())}}}))((function(e){var t=e.walletBalance,a=e.ergPrice,l=e.dispatchGetWalletBalance,c=e.dispatchGetErgPrice,o=e.dispatchGetWalletAddresses,s=e.walletAddresses,i=Object(n.useCallback)((function(){l(),c(),o()}),[l,c,o]),u=Object(n.useCallback)((function(e){return 0===e.length?0:e.map((function(e){return{value:r.a.createElement("a",{rel:"noopener noreferrer",target:"_blank",href:"https://explorer.ergoplatform.com/en/addresses/".concat(e)},e)}}))}),[]),m=Object(n.useCallback)((function(e){return 0===Object.values(e).length?0:e.map((function(e){var t=e.tokenId,a=e.amount;return{name:r.a.createElement("span",{className:"text-muted"},t),value:r.a.createElement("span",{className:"font-weight-bold"},a)}}))}),[]);Object(n.useEffect)((function(){i()}),[i]);var d=Object(n.useMemo)((function(){return[{name:"Balance",value:t?"".concat(t.balance/v," ERG"):"loading..."},{name:"Assets",value:t?m(t.assets):"Loading..."},{name:"Addresses",value:s?u(s):"Loading..."}]}),[t,a,m,s,u]),p=Object(n.useCallback)((function(){i()}),[i]);return r.a.createElement("div",{className:"wallet-table"},r.a.createElement("div",{className:"wallet-table__header"},r.a.createElement("h2",{className:"wallet-table__title"},"Wallet Information"," ",r.a.createElement("button",{type:"button",className:"wallet-table__icon-redo",onClick:p},r.a.createElement(Ft,null)))),r.a.createElement("div",{className:"wallet-table__body"},d.map((function(e){var t=e.value,a=e.name;return r.a.createElement(Mt,{key:a,name:a,value:t})}))))})),Ut=(a(138),function(e){function t(){var e,a;Object(te.a)(this,t);for(var n=arguments.length,l=new Array(n),c=0;c0&&void 0!==arguments[0]?arguments[0]:Math.random().toString(32).slice(2,10),t="id-".concat(e),a=Fe().isBrowser,r=Object(n.useState)(a?Me(t):null),l=Object(M.a)(r,2),c=l[0],o=l[1];return Object(n.useEffect)((function(){var e=document.querySelector("#".concat(t)),a=e||Me(t);e||document.body.appendChild(a),o(a)}),[]),c},Ue={scrollLayer:!1},Re=new Map,De=function(e){return!!(e.touches&&e.touches.length>1)||(e.preventDefault(),!1)},Ge=function(e,t){if("undefined"===typeof document)return[!1,function(e){return e}];var a=e||Object(n.useRef)(document.body),r=Object(n.useState)(!1),l=Object(M.a)(r,2),c=l[0],o=l[1],s=Object(I.a)({},Ue,{},t||{}),i=function(){return!s.scrollLayer&&(!("undefined"===typeof window||!window.navigator)&&/iP(ad|hone|od)/.test(window.navigator.platform))};return Object(n.useEffect)((function(){if(a&&a.current){var e=a.current.style.overflow;if(c){if(Re.has(a.current))return;return i()?document.addEventListener("touchmove",De,{passive:!1}):a.current.style.overflow="hidden",void Re.set(a.current,{last:e})}if(Re.has(a.current)){if(i())document.removeEventListener("touchmove",De);else{var t=Re.get(a.current);a.current.style.overflow=t.last}Re.delete(a.current)}}}),[c,a]),[c,o]},Ve=function(e){var t=Object(n.useState)((function(){return"function"===typeof e?e():e})),a=Object(M.a)(t,2),r=a[0],l=a[1],c=Object(n.useRef)(e);Object(n.useEffect)((function(){c.current=r}),[r]);return[r,function(e){var t="function"===typeof e?e(c.current):e;c.current=t,l(t)},c]},Ye=a(65),Ze=a(4),qe=a.n(Ze),Je=function(e){var t=e.children,a=e.variant,n=e.component,l=e.color,c=e.className,o=e.dangerouslySetInnerHTML,s=Object(Ye.a)(e,["children","variant","component","color","className","dangerouslySetInnerHTML"]),i=a,u=n||"p";return o?r.a.createElement(r.a.Fragment,null,r.a.createElement(u,Object.assign({className:qe()({colored:l},i,c),dangerouslySetInnerHTML:o},s)),r.a.createElement("style",null,"\n .colored {\n color: var(--".concat(l,");\n }\n "))):r.a.createElement(u,Object.assign({className:qe()({colored:l},i,c)},s),t,r.a.createElement("style",null,"\n .colored {\n color: var(--".concat(l,");\n }\n ")))},$e=function(e,t){return e.defaultProps=t,e},Qe=$e((function(e){var t=e.children,a=e.className,l=e.visible,c=e.enterTime,o=e.leaveTime,s=e.clearTime,i=e.name,u=Object(Ye.a)(e,["children","className","visible","enterTime","leaveTime","clearTime","name"]),m=Object(n.useState)(""),d=Object(M.a)(m,2),p=d[0],f=d[1],b=Object(n.useState)(l),h=Object(M.a)(b,2),E=h[0],v=h[1];return Object(n.useEffect)((function(){var e=l?"enter":"leave",t=l?c:o;l&&!E&&v(!0),f("".concat(i,"-").concat(e));var a=setTimeout((function(){f("".concat(i,"-").concat(e," ").concat(i,"-").concat(e,"-active")),clearTimeout(a)}),t),n=setTimeout((function(){l||(f(""),v(!1)),clearTimeout(n)}),t+s);return function(){clearTimeout(a),clearTimeout(n)}}),[l,E]),r.a.isValidElement(t)&&E?r.a.cloneElement(t,Object(I.a)({},u,{className:"".concat(t.props.className," ").concat(a," ").concat(p)})):null}),{visible:!1,enterTime:60,leaveTime:60,clearTime:60,className:"",name:"transition"}),Xe=a(67),et=a.n(Xe),tt=$e(r.a.memo((function(e){var t=e.children,a=e.onClick,l=e.visible,c=e.className,o=Ve(!1),s=Object(M.a)(o,3),i=s[1],u=s[2],m=Object(n.useCallback)((function(e){e.stopPropagation()}),[]);return r.a.createElement(Qe,{visible:l,clearTime:300},r.a.createElement("div",{className:et.a.backdrop,onClick:function(e){u.current||a&&a(e)},onMouseUp:function(){if(u.current)var e=setTimeout((function(){i(!1),clearTimeout(e)}),0)}},r.a.createElement("div",{className:et.a.layer}),r.a.createElement("div",{onClick:m,className:qe()(et.a.content,c),onMouseDown:function(){return i(!0)}},t)))})),{onClick:function(){},visible:!1}),at=r.a.createContext({});function nt(){return(nt=Object.assign||function(e){for(var t=1;t=0||(r[a]=e[a]);return r}(e,t);if(Object.getOwnPropertySymbols){var l=Object.getOwnPropertySymbols(e);for(n=0;n=0||Object.prototype.propertyIsEnumerable.call(e,a)&&(r[a]=e[a])}return r}var lt=r.a.createElement("path",{d:"M10.7951 9.30799C10.3844 8.89734 9.71865 8.89734 9.30799 9.30799C8.89734 9.71865 8.89734 10.3844 9.30799 10.7951L14.5129 16L9.30799 21.2049C8.89734 21.6156 8.89734 22.2814 9.30799 22.692C9.71865 23.1027 10.3844 23.1027 10.7951 22.692L16 17.4871L21.2049 22.692C21.6156 23.1027 22.2814 23.1027 22.692 22.692C23.1027 22.2814 23.1027 21.6156 22.692 21.2049L17.4871 16L22.692 10.7951C23.1027 10.3844 23.1027 9.71865 22.692 9.30799C22.2814 8.89734 21.6156 8.89734 21.2049 9.30799L16 14.5129L10.7951 9.30799Z",fill:"#76767A"}),ct=function(e){var t=e.svgRef,a=e.title,n=rt(e,["svgRef","title"]);return r.a.createElement("svg",nt({width:32,height:32,viewBox:"0 0 32 32",fill:"none",ref:t},n),a?r.a.createElement("title",null,a):null,lt)},ot=r.a.forwardRef((function(e,t){return r.a.createElement(ct,nt({svgRef:t},e))}));a.p;a.p;function st(){return(st=Object.assign||function(e){for(var t=1;t=0||(r[a]=e[a]);return r}(e,t);if(Object.getOwnPropertySymbols){var l=Object.getOwnPropertySymbols(e);for(n=0;n=0||Object.prototype.propertyIsEnumerable.call(e,a)&&(r[a]=e[a])}return r}var ut=r.a.createElement("path",{d:"M13.3332 7.99992C13.3332 8.36811 13.0347 8.66659 12.6665 8.66659H3.33317C2.96498 8.66659 2.6665 8.36811 2.6665 7.99992C2.6665 7.63173 2.96498 7.33325 3.33317 7.33325H12.6665C13.0347 7.33325 13.3332 7.63173 13.3332 7.99992Z",fill:"#0078FF"}),mt=function(e){var t=e.svgRef,a=e.title,n=it(e,["svgRef","title"]);return r.a.createElement("svg",st({width:16,height:16,viewBox:"0 0 16 16",fill:"none",ref:t},n),a?r.a.createElement("title",null,a):null,ut)},dt=r.a.forwardRef((function(e,t){return r.a.createElement(mt,st({svgRef:t},e))})),pt=(a.p,function(e,t){return r.a.createElement(e,{className:t,focusable:"false"})}),ft=function(e){var t=e.className;return pt(dt,t)},bt=function(e){var t=e.className;return pt(ot,t)},ht=function(e){var t=e.title,a=e.description,c=e.primaryButtonContent,o=e.secondaryButtonContent,s=e.disableBackdropClick,i=e.onClose,u=e.onOpen,m=e.onPrimaryHandler,d=e.onSecondaryHandler,p=e.open,f=Ke("modal"),b=Ge(null,{scrollLayer:!0}),h=Object(M.a)(b,2)[1],E=Ve(!1),v=Object(M.a)(E,3),y=v[0],g=v[1],w=v[2],N=Object(n.useCallback)((function(){i&&i(),g(!1),h(!1)}),[i,g,h]);Object(n.useEffect)((function(){void 0!==p&&(p&&u&&u(),!p&&w.current&&i&&i(),g(p),h(p))}),[p]);var O=Object(n.useMemo)((function(){return{close:N}}),[N]);return f?Object(l.createPortal)(r.a.createElement(at.Provider,{value:O},r.a.createElement(tt,{onClick:function(){s||N()},visible:y,className:"info-modal-backdrop"},r.a.createElement(Qe,{name:"wrapper",visible:y,clearTime:300},r.a.createElement("div",{className:"info-modal"},r.a.createElement("div",{className:"info-modal__content"},r.a.createElement("h3",{className:"mb-3"},t),r.a.createElement(Je,{xl:"body-text1",sm:"small-text1",className:"mb-40 mb-md-56 pr-40 pr-md-0"},a),r.a.createElement("button",{type:"button",className:"btn btn-primary px-4",onClick:function(){m&&m(),i&&i()}},c),r.a.createElement("button",{type:"button",className:"btn btn-outline-secondary px-4 ml-3",onClick:function(){d&&d(),i&&i()}},o)),r.a.createElement("button",{type:"button",className:"info-modal__button--close",onClick:N},r.a.createElement(bt,null)),r.a.createElement("style",null,"\n .wrapper-enter {\n opacity: 0;\n transform: translate3d(0px, -40px, 0px);\n }\n .wrapper-enter-active {\n opacity: 1;\n transform: translate3d(0px, 0px, 0px);\n }\n .wrapper-leave {\n opacity: 1;\n transform: translate3d(0px, 0px, 0px);\n }\n .wrapper-leave-active {\n opacity: 0;\n transform: translate3d(0px, -50px, 0px);\n }\n "))))),f):null};ht.defaultProps={width:"26rem",wrapClassName:"",disableBackdropClick:!1};var Et=ht,vt=function(e){var t=e.apiKey,a=Object(n.useState)(null),l=Object(M.a)(a,2),c=l[0],o=l[1],s=Object(n.useState)(!1),i=Object(M.a)(s,2),u=i[0],m=i[1],d=Object(n.useCallback)((function(e){var a=e.recipientAddress,n=e.amount;return Z.post("/wallet/payment/send",[{address:a,value:Number((parseFloat(n)*v).toFixed(1))}],{headers:{api_key:t}})}),[t]),p=Object(n.useCallback)((function(e){""!==e.recipientAddress.trim()&&e.recipientAddress&&d(e).then((function(e){var t=e.data;o(t),m(!0)})).catch((function(e){var t=e.data?e.data.detail:e.message;J("error",t)}))}),[d]),f=Object(n.useCallback)((function(e){var t={};return e.recipientAddress||(t.recipientAddress="The field cannot be empty"),(!e.amount||e.amount<.001)&&(t.amount="Minimum 0.001 ERG"),t}),[]);return r.a.createElement("div",{className:""},r.a.createElement("div",{className:"card bg-white p-4"},r.a.createElement("h2",{className:"h5 mb-3"},"Payment send"),r.a.createElement(He.b,{onSubmit:p,validate:f,render:function(e){var t=e.handleSubmit,a=e.submitting,n=e.pristine,l=e.form;return r.a.createElement(r.a.Fragment,null,r.a.createElement("form",{onSubmit:t},r.a.createElement("div",{className:"mb-3"},r.a.createElement("label",{htmlFor:"recipient-address"},"Recipient address"),r.a.createElement(He.a,{name:"recipientAddress",render:function(e){var t=e.input,a=e.meta;return r.a.createElement(r.a.Fragment,null,r.a.createElement("input",Object.assign({id:"recipient-address",className:qe()("form-control",{"is-invalid":a.touched&&a.error}),type:"text",placeholder:"Enter recipient address"},t)),r.a.createElement("div",{className:"invalid-feedback"},a.error))}})),r.a.createElement("div",{className:"mb-3"},r.a.createElement("label",{htmlFor:"amount"},"Amount"),r.a.createElement(He.a,{name:"amount",render:function(e){var t=e.input,a=e.meta;return r.a.createElement(r.a.Fragment,null,r.a.createElement("input",Object.assign({id:"amount",className:qe()("form-control",{"is-invalid":a.touched&&a.error}),type:"number",placeholder:"Minimum 0.001 ERG"},t)),r.a.createElement("div",{className:"invalid-feedback"},a.error))}})),r.a.createElement("button",{type:"submit",className:"btn btn-primary",disabled:a||n},"Send")),r.a.createElement(Et,{open:u,onClose:function(){m(!1)},title:"Payment sent",description:r.a.createElement(r.a.Fragment,null,r.a.createElement("p",null,"Your payment has been sent successfully. The transaction ID is -"," ",r.a.createElement(be,null,c)),r.a.createElement("p",null,r.a.createElement("a",{target:"_blank",rel:"noopener noreferrer",href:"https://explorer.ergoplatform.com/en/transactions/".concat(c)},"Click Here To Go To The Explorer"))),primaryButtonContent:r.a.createElement("span",{className:"pl-3 pr-3"},"OK"),secondaryButtonContent:"Send again",onPrimaryHandler:function(){return function(e){e.restart(),m(!1)}(l)}}))}})))};a(137);function yt(){return(yt=Object.assign||function(e){for(var t=1;t=0||(r[a]=e[a]);return r}(e,t);if(Object.getOwnPropertySymbols){var l=Object.getOwnPropertySymbols(e);for(n=0;n=0||Object.prototype.propertyIsEnumerable.call(e,a)&&(r[a]=e[a])}return r}var wt=r.a.createElement("g",null,r.a.createElement("path",{d:"M39.622,21.746l-6.749,6.75c-0.562,0.562-1.326,0.879-2.122,0.879s-1.56-0.316-2.121-0.879l-6.75-6.75 c-1.171-1.171-1.171-3.071,0-4.242c1.171-1.172,3.071-1.172,4.242,0l1.832,1.832C27.486,13.697,22.758,9.25,17,9.25 c-6.064,0-11,4.935-11,11c0,6.064,4.936,11,11,11c1.657,0,3,1.343,3,3s-1.343,3-3,3c-9.373,0-17-7.626-17-17s7.627-17,17-17 c8.936,0,16.266,6.933,16.936,15.698l1.442-1.444c1.172-1.172,3.072-1.172,4.242,0C40.792,18.674,40.792,20.574,39.622,21.746z"})),Nt=r.a.createElement("g",null),Ot=r.a.createElement("g",null),jt=r.a.createElement("g",null),kt=r.a.createElement("g",null),St=r.a.createElement("g",null),_t=r.a.createElement("g",null),Ct=r.a.createElement("g",null),Wt=r.a.createElement("g",null),xt=r.a.createElement("g",null),It=r.a.createElement("g",null),Pt=r.a.createElement("g",null),At=r.a.createElement("g",null),Bt=r.a.createElement("g",null),zt=r.a.createElement("g",null),Lt=r.a.createElement("g",null),Tt=function(e){var t=e.svgRef,a=e.title,n=gt(e,["svgRef","title"]);return r.a.createElement("svg",yt({id:"Capa_1",x:"0px",y:"0px",width:"32px",height:"32px",viewBox:"0 0 40.499 40.5",style:{enableBackground:"new 0 0 40.499 40.5"},xmlSpace:"preserve",ref:t},n),a?r.a.createElement("title",null,a):null,wt,Nt,Ot,jt,kt,St,_t,Ct,Wt,xt,It,Pt,At,Bt,zt,Lt)},Ht=r.a.forwardRef((function(e,t){return r.a.createElement(Tt,yt({svgRef:t},e))})),Ft=(a.p,function(e){var t=e.className;return pt(Ht,t)}),Mt=function(e){var t,a,l=e.name,c=e.value,o=Object(n.useState)(!1),s=Object(M.a)(o,2),i=s[0],u=s[1];return Array.isArray(c)?(t=c.length,a=r.a.createElement("div",null,c.map((function(e){return r.a.createElement(r.a.Fragment,null,r.a.createElement("div",null,e.value||""," ",e.name||""),r.a.createElement("br",null))})))):(t=c,a=c),r.a.createElement("div",{className:"wallet-table__item"},r.a.createElement("div",{className:qe()("wallet-table-item-header",{"wallet-table-item-header--opened":i})},r.a.createElement("div",{className:"wallet-table-item-header__title"},l),r.a.createElement("div",{className:"wallet-table-item-header__right-side"},!i&&r.a.createElement("div",{className:"wallet-table-item-header__opacity-paragraph"},t),r.a.createElement("a",{className:"wallet-table-item-header__link",onClick:function(){return u((function(e){return!e}))}},!i&&"More",i&&r.a.createElement(ft,null)))),i&&r.a.createElement("div",{className:"wallet-table-item-body"},a))},Kt=Object(s.b)((function(e){return{walletBalance:C(e),ergPrice:x(e),walletAddresses:W(e)}}),(function(e){return{dispatchGetWalletBalance:function(){return e(H.getWalletBalance())},dispatchGetErgPrice:function(){return e(H.getErgPrice())},dispatchGetWalletAddresses:function(){return e(H.getWalletAddresses())}}}))((function(e){var t=e.walletBalance,a=e.dispatchGetWalletBalance,l=e.dispatchGetErgPrice,c=e.dispatchGetWalletAddresses,o=e.walletAddresses,s=Object(n.useCallback)((function(){a(),l(),c()}),[a,l,c]),i=Object(n.useCallback)((function(e){return 0===e.length?0:e.map((function(e){return{value:r.a.createElement("a",{rel:"noopener noreferrer",target:"_blank",href:"https://explorer.ergoplatform.com/en/addresses/".concat(e)},e)}}))}),[]),u=Object(n.useCallback)((function(e){return 0===Object.values(e).length?0:Object.keys(e).map((function(t){return{name:r.a.createElement("span",{className:"text-muted"},t),value:r.a.createElement("span",{className:"font-weight-bold"},e[t])}}))}),[]);Object(n.useEffect)((function(){s()}),[s]);var m=Object(n.useMemo)((function(){return[{name:"Balance",value:t?"".concat(t.balance/v," ERG"):"loading..."},{name:"Assets",value:t?u(t.assets):"Loading..."},{name:"Addresses",value:o?i(o):"Loading..."}]}),[t,o,i]),d=Object(n.useCallback)((function(){s()}),[s]);return r.a.createElement("div",{className:"wallet-table"},r.a.createElement("div",{className:"wallet-table__header"},r.a.createElement("h2",{className:"wallet-table__title"},"Wallet Information"," ",r.a.createElement("button",{type:"button",className:"wallet-table__icon-redo",onClick:d},r.a.createElement(Ft,null)))),r.a.createElement("div",{className:"wallet-table__body"},m.map((function(e){var t=e.value,a=e.name;return r.a.createElement(Mt,{key:a,name:a,value:t})}))))})),Ut=(a(138),function(e){function t(){var e,a;Object(te.a)(this,t);for(var n=arguments.length,l=new Array(n),c=0;c,\n title: 'Dashboard',\n },\n wallet: {\n href: '/wallet',\n icon: ,\n title: 'Wallet',\n },\n};\n\nconst externalRouteList = {\n swaggerInterface: {\n href: constants.swaggerInterface,\n icon: ,\n title: 'Swagger',\n },\n explorer: {\n href: constants.explorer,\n icon: ,\n title: 'Explorer',\n },\n website: {\n href: constants.website,\n icon: ,\n title: 'Website',\n },\n};\n\nconst MenuList = ({ location: { pathname } }) => {\n return (\n
\n

Menu

\n
\n
\n {Object.values(localRouteList).map(({ href, icon, title }, index) => (\n \n {icon} {title}\n \n ))}\n
\n

External links

\n
\n
\n {Object.values(externalRouteList).map(({ href, icon, title }, index) => (\n \n {icon} {title}\n \n ))}\n
\n
\n );\n};\n\nexport default withRouter(MenuList);\n","import { createSelector } from 'redux-starter-kit';\n\nexport const appSelector = (state) => state.app;\n\nexport const apiKeySelector = createSelector(appSelector, (app) => app.apiKey);\n","import { createSelector } from 'redux-starter-kit';\n\nexport const walletSelector = (state) => state.wallet;\n\nexport const isWalletUnlockedSelector = createSelector(\n walletSelector,\n (wallet) => wallet.isWalletUnlocked,\n);\n\nexport const isWalletInitializedSelector = createSelector(\n walletSelector,\n (wallet) => wallet.isWalletInitialized,\n);\n\nexport const walletStatusDataSelector = createSelector(\n walletSelector,\n (wallet) => wallet.walletStatusData,\n);\n\nexport const walletBalanceDataSelector = createSelector(\n walletSelector,\n (wallet) => wallet.walletBalanceData,\n);\n\nexport const walletAddressesSelector = createSelector(\n walletSelector,\n (wallet) => wallet.walletAddresses,\n);\n\nexport const ergPriceSelector = createSelector(walletSelector, (wallet) => wallet.ergPrice);\n","import { createSlice } from 'redux-starter-kit';\n\nconst initialState = {\n isWalletUnlocked: null,\n isWalletInitialized: null,\n walletStatusData: null,\n walletBalanceData: null,\n ergPrice: null,\n walletAddresses: null,\n};\n\nexport default createSlice({\n name: 'walletSlice',\n initialState,\n reducers: {\n setIsWalletUnlocked: (state, { payload }) => {\n state.isWalletUnlocked = payload;\n },\n setIsWalletInitialized: (state, { payload }) => {\n state.isWalletInitialized = payload;\n },\n setWalletStatusData: (state, { payload }) => {\n state.walletStatusData = payload;\n },\n setWalletBalanceData: (state, { payload }) => {\n state.walletBalanceData = payload;\n },\n setErgPrice: (state, { payload }) => {\n state.ergPrice = payload;\n },\n setWalletAddresses: (state, { payload }) => {\n state.walletAddresses = payload;\n },\n },\n});\n","import { createAction } from 'redux-starter-kit';\nimport walletSlice from '../slices/walletSlice';\n\nconst checkWalletStatus = createAction('checkWalletStatus');\nconst getWalletBalance = createAction('getWalletBalance');\nconst getErgPrice = createAction('getErgPrice');\nconst getWalletAddresses = createAction('getWalletAddresses');\n\nexport default {\n ...walletSlice.actions,\n checkWalletStatus,\n getWalletBalance,\n getErgPrice,\n getWalletAddresses,\n};\n","import { createSlice } from 'redux-starter-kit';\n\nconst initialState = {\n apiKey: '',\n};\n\nexport default createSlice({\n name: 'appSlice',\n initialState,\n reducers: {\n setApiKey: (state, action) => {\n state.apiKey = action.payload;\n },\n },\n});\n","import appSlice from '../slices/appSlice';\n\nexport default {\n ...appSlice.actions,\n};\n","const appConfig = () => {\n return {\n nodeApiLink: '/',\n oracleApiLink: 'https://erg-usd-ergo-oracle.emurgo.io',\n };\n};\n\nexport default {\n ...appConfig(),\n};\n","import axios from 'axios';\nimport environment from '../utils/environment';\n\nfunction NetworkError({ status, message, data, statusText }) {\n this.name = 'NetworkError';\n this.message = message || statusText;\n this.status = status;\n this.data = data;\n}\n\nNetworkError.prototype = Object.create(Error.prototype);\n\nconst nodeApi = axios.create({\n baseURL: environment.nodeApiLink,\n timeout: 1000 * 10,\n crossDomain: true,\n headers: {\n 'Content-Type': 'application/json',\n },\n});\n\nnodeApi.interceptors.response.use(\n (response) => Promise.resolve(response),\n (error) => Promise.reject(new NetworkError(error.response || error)),\n);\n\nexport default nodeApi;\n","import { toast } from 'react-toastify';\nimport './index.scss';\n\nconst toastStates = {\n success: (text, options) =>\n toast.success(text, {\n position: 'top-right',\n autoClose: 5000,\n hideProgressBar: false,\n closeOnClick: true,\n pauseOnHover: true,\n draggable: true,\n className: 'n-toast n-toast--success',\n bodyClassName: 'n-toast__body',\n progressClassName: 'n-toast__progress--success',\n ...options,\n }),\n error: (text, options) =>\n toast.error(text, {\n position: 'top-right',\n autoClose: 5000,\n hideProgressBar: false,\n closeOnClick: true,\n pauseOnHover: true,\n draggable: true,\n className: 'n-toast n-toast--error',\n bodyClassName: 'n-toast__body',\n progressClassName: 'n-toast__progress--error',\n ...options,\n }),\n info: toast.info,\n};\n\nexport default (state, text, options) =>\n toastStates[state] ? toastStates[state](text, options) : new Error(`Bad toast state`);\n","import React from 'react';\nimport { Modal } from 'react-bootstrap';\nimport { Formik, Form, Field } from 'formik';\n\nconst renderButton = (apiKey, handleShow) => {\n if (apiKey === '') {\n return (\n \n );\n }\n\n return (\n \n );\n};\n\nconst ApiKeyModalView = ({ showModal, handleHide, submitForm, apiKey, handleShow }) => {\n return (\n
\n {renderButton(apiKey, handleShow)}\n handleHide()} centered>\n \n {() => (\n
\n \n Authorization\n \n \n

Set API key to access Node requests

\n
\n \n
\n
\n\n \n \n \n \n
\n )}\n
\n
\n
\n );\n};\n\nexport default ApiKeyModalView;\n","import ApiKeyModalContainer from './ApiKeyModalContainer';\n\nexport default ApiKeyModalContainer;\n","import React, { memo, useState } from 'react';\nimport { connect } from 'react-redux';\nimport { apiKeySelector } from '../../../store/selectors/app';\nimport appActions from '../../../store/actions/appActions';\nimport nodeApi from '../../../api/api';\nimport customToast from '../../../utils/toast';\nimport ApiKeyModalView from './ApiKeyModalView';\n\nconst mapStateToProps = (state) => ({\n apiKey: apiKeySelector(state),\n});\n\nconst mapDispatchToProps = (dispatch) => ({\n dispatchSetApiKey: (apiKey) => dispatch(appActions.setApiKey(apiKey)),\n});\n\nconst ApiKeyModalContainer = (props) => {\n const { dispatchSetApiKey, apiKey } = props;\n\n const [showModal, setShowModal] = useState(false);\n\n const handleShow = () => {\n setShowModal(true);\n };\n\n const handleHide = () => {\n setShowModal(false);\n };\n\n const submitForm = (values) => {\n // Check API key for random get method\n nodeApi\n .get('/wallet/status', {\n headers: {\n api_key: values.apiKey,\n },\n })\n .then(() => {\n dispatchSetApiKey(values.apiKey.trim());\n customToast('success', 'API key is set successfully');\n handleHide();\n })\n .catch(() => {\n customToast('error', 'Bad API key');\n });\n };\n\n return (\n \n );\n};\n\nexport default connect(mapStateToProps, mapDispatchToProps)(memo(ApiKeyModalContainer));\n","import React, { Component, memo } from 'react';\nimport Modal from 'react-bootstrap/Modal';\nimport { Formik, Field, Form } from 'formik';\nimport { connect } from 'react-redux';\nimport { isWalletUnlockedSelector } from '../../../store/selectors/wallet';\nimport walletActions from '../../../store/actions/walletActions';\nimport { apiKeySelector } from '../../../store/selectors/app';\nimport customToast from '../../../utils/toast';\nimport nodeApi from '../../../api/api';\n\nconst mapStateToProps = (state) => ({\n isWalletUnlocked: isWalletUnlockedSelector(state),\n apiKey: apiKeySelector(state),\n});\n\nconst mapDispatchToProps = (dispatch) => ({\n dispatchSetIsWalletUnlocked: (isWalletUnlock) =>\n dispatch(walletActions.setIsWalletUnlocked(isWalletUnlock)),\n});\n\nclass WalletStatusForm extends Component {\n state = {\n showModal: false,\n };\n\n handleShow = () => {\n this.setState({ showModal: true });\n };\n\n handleHide = () => {\n this.setState({ showModal: false });\n };\n\n walletUnlock = (pass) =>\n nodeApi.post(\n '/wallet/unlock',\n { pass },\n {\n headers: {\n api_key: this.props.apiKey,\n },\n },\n );\n\n walletLock = () =>\n nodeApi.get('/wallet/lock', {\n headers: {\n api_key: this.props.apiKey,\n },\n });\n\n submitWalletUnlockForm = ({ pass }, { setSubmitting, resetForm, setStatus }) => {\n setStatus({ status: 'submitting' });\n this.walletUnlock(pass)\n .then(() => {\n resetForm({ pass: '' });\n customToast('success', 'Your wallet is unlocked successfully');\n this.props.dispatchSetIsWalletUnlocked(true);\n this.handleHide();\n })\n .catch((err) => {\n const errMessage = err.data ? err.data.detail : err.message;\n customToast('error', errMessage);\n setSubmitting(false);\n });\n };\n\n submitWalletLockForm = () => {\n // eslint-disable-next-line\n if (confirm('Are you sure want to lock wallet?')) {\n this.walletLock()\n .then(() => {\n customToast('success', 'Your wallet is locked successfully');\n this.props.dispatchSetIsWalletUnlocked(false);\n })\n .catch((err) => {\n const errMessage = err.data ? err.data.detail : err.message;\n customToast('error', errMessage);\n });\n }\n };\n\n renderButton = () => {\n if (!this.props.isWalletUnlocked) {\n return (\n \n );\n }\n\n return (\n \n );\n };\n\n render() {\n return (\n
\n {this.renderButton()}\n this.handleHide()}\n centered\n aria-labelledby=\"example-custom-modal-styling-title\"\n >\n \n {({ isSubmitting }) => (\n
\n \n \n Unlock wallet form\n \n \n \n
\n \n \n \n * If you have it or leave field empty\n \n
\n
\n\n \n \n Close\n \n \n \n
\n )}\n
\n \n
\n );\n }\n}\nexport default connect(mapStateToProps, mapDispatchToProps)(memo(WalletStatusForm));\n","import React from 'react';\nimport copy from 'clipboard-copy';\nimport { Overlay, Tooltip } from 'react-bootstrap';\n\nclass CopyToClipboard extends React.PureComponent {\n constructor(props) {\n super(props);\n\n this.myRef = React.createRef();\n this.state = { showTooltip: false };\n }\n\n componentWillUnmount() {\n clearTimeout(this.state.timerId);\n }\n\n startTimer = () => {\n const timerId = setTimeout(() => this.setState({ showTooltip: false }), 1500);\n this.setState({ timerId });\n };\n\n onCopy = (e) => {\n e.preventDefault();\n copy(this.props.children);\n this.setState({ showTooltip: true });\n this.startTimer();\n };\n\n handleOnTooltipClose = () => {\n this.setState({ showTooltip: false });\n };\n\n render() {\n return (\n <>\n \n {this.props.children}\n \n \n Copied!\n \n \n );\n }\n}\n\nexport default CopyToClipboard;\n","import React, { Component, memo } from 'react';\nimport { Formik, Field, Form } from 'formik';\nimport nodeApi from '../../../api/api';\nimport CopyToClipboard from '../../common/CopyToClipboard';\nimport customToast from '../../../utils/toast';\n\nconst initialFormValues = {\n walletPassword: '',\n mnemonicPass: '',\n};\n\nclass WalletInitializeForm extends Component {\n state = { isShowMnemonic: false };\n\n walletInit = async ({ walletPassword, mnemonicPass }) => {\n const { data } = await nodeApi.post(\n '/wallet/init',\n { pass: walletPassword, mnemonicPass },\n {\n headers: {\n api_key: this.props.apiKey,\n },\n },\n );\n\n return data;\n };\n\n handleSubmit = (values, { setSubmitting, resetForm, setStatus }) => {\n setStatus({ status: 'submitting' });\n this.walletInit(values)\n .then((result) => {\n resetForm(initialFormValues);\n setStatus({\n state: 'success',\n msg: (\n <>\n Your wallet successfully initialized. Please, save your mnemonic -{' '}\n {result.mnemonic}\n \n ),\n });\n this.setState({ isShowMnemonic: true });\n })\n .catch((err) => {\n const errMessage = err.data ? err.data.detail : err.message;\n customToast('error', errMessage);\n setSubmitting(false);\n });\n };\n\n render() {\n return (\n
\n

Initialize wallet

\n \n {({ status, isSubmitting }) => (\n
\n {status && status.state === 'error' && (\n
\n {status.msg}\n
\n )}\n {status && status.state === 'success' && this.state.isShowMnemonic && (\n
\n this.setState({ isShowMnemonic: false })}\n >\n ×\n \n {status.msg}\n
\n )}\n
\n \n \n
\n
\n \n \n
\n \n
\n )}\n
\n
\n );\n }\n}\n\nexport default memo(WalletInitializeForm);\n","import React, { Component, memo } from 'react';\nimport { Formik, Field, Form } from 'formik';\nimport nodeApi from '../../../api/api';\nimport customToast from '../../../utils/toast';\n\nconst initialFormValues = {\n walletPassword: '',\n mnemonicPass: '',\n mnemonic: '',\n};\n\nclass WalletInitializeForm extends Component {\n walletRestore = async ({ walletPassword, mnemonicPass = '', mnemonic = '' }) => {\n if (!mnemonic || !String(mnemonic).trim()) {\n throw Error('Need to set mnemonic');\n }\n\n return nodeApi.post(\n '/wallet/restore',\n { pass: walletPassword, mnemonicPass, mnemonic },\n {\n headers: {\n api_key: this.props.apiKey,\n },\n },\n );\n };\n\n handleSubmit = (values, { setSubmitting, resetForm, setStatus }) => {\n setStatus({ status: 'submitting' });\n this.walletRestore(values)\n .then(() => {\n resetForm(initialFormValues);\n customToast('success', 'Your wallet successfully re-stored');\n })\n .catch((err) => {\n const errMessage = err.data ? err.data.detail : err.message;\n customToast('error', errMessage);\n setSubmitting(false);\n });\n };\n\n render() {\n return (\n
\n

Re-store wallet

\n \n {({ status, isSubmitting }) => (\n
\n {status && status.state === 'error' && (\n
\n {status.msg}\n
\n )}\n {status && status.state === 'success' && (\n
{status.msg}
\n )}\n
\n \n \n
\n
\n \n \n
\n
\n \n \n
\n \n
\n )}\n
\n
\n );\n }\n}\n\nexport default memo(WalletInitializeForm);\n","import React, { Component, memo } from 'react';\nimport Modal from 'react-bootstrap/Modal';\nimport { connect } from 'react-redux';\nimport { apiKeySelector } from '../../../store/selectors/app';\nimport appActions from '../../../store/actions/appActions';\nimport WalletInitializeForm from '../../elements/WalletInitializeForm';\nimport RestoreWalletForm from '../../elements/RestoreWalletForm';\nimport walletActions from '../../../store/actions/walletActions';\n\nconst mapStateToProps = (state) => ({\n apiKey: apiKeySelector(state),\n});\n\nconst mapDispatchToProps = (dispatch) => ({\n dispatchCheckWalletStatus: () => dispatch(walletActions.checkWalletStatus()),\n dispatchSetApiKey: (apiKey) => dispatch(appActions.setApiKey(apiKey)),\n});\n\nclass WalletInitModal extends Component {\n state = {\n showModal: false,\n };\n\n handleShow = () => {\n this.setState({ showModal: true });\n };\n\n handleHide = () => {\n this.props.dispatchCheckWalletStatus();\n this.setState({ showModal: false });\n };\n\n renderButton = () => {\n return (\n \n );\n };\n\n render() {\n const { apiKey } = this.props;\n\n return (\n
\n {this.renderButton()}\n this.handleHide()} centered size=\"lg\">\n \n Wallet initialization\n \n \n
\n \n
\n
\n \n
\n
\n \n \n \n
\n
\n );\n }\n}\nexport default connect(mapStateToProps, mapDispatchToProps)(memo(WalletInitModal));\n","import React, { memo } from 'react';\nimport { Navbar } from 'react-bootstrap';\nimport { Link } from 'react-router-dom';\nimport ApiKeyModal from './ApiKeyModal';\nimport WalletStatusModal from './WalletStatusModal';\nimport WalletInitModal from './WalletInitModal';\nimport logo from '../../assets/images/logotype_white.svg';\n\nconst renderWalletForms = (isWalletInitialized) => {\n if (isWalletInitialized === null) {\n return <>;\n }\n\n if (isWalletInitialized) {\n return (\n
\n \n
\n );\n }\n\n return (\n
\n \n
\n );\n};\n\nconst HeaderView = ({ isApiKeySetted, isWalletInitialized }) => {\n return (\n \n \n \n \"logotype\"\n \n \n
\n \n
\n {isApiKeySetted && renderWalletForms(isWalletInitialized)}\n
\n );\n};\n\nexport default memo(HeaderView);\n","import HeaderContainer from './HeaderContainer';\n\nexport default HeaderContainer;\n","import React, { memo, useEffect } from 'react';\nimport { connect } from 'react-redux';\nimport { apiKeySelector } from '../../store/selectors/app';\nimport { isWalletInitializedSelector } from '../../store/selectors/wallet';\nimport walletActions from '../../store/actions/walletActions';\nimport HeaderView from './HeaderView';\n\nconst mapStateToProps = (state) => ({\n apiKey: apiKeySelector(state),\n isWalletInitialized: isWalletInitializedSelector(state),\n});\n\nconst mapDispatchToProps = (dispatch) => ({\n dispatchCheckWalletStatus: () => dispatch(walletActions.checkWalletStatus()),\n});\n\nconst HeaderContainer = (props) => {\n const { apiKey, dispatchCheckWalletStatus, isWalletInitialized } = props;\n\n useEffect(() => {\n if (apiKey !== '') {\n dispatchCheckWalletStatus();\n }\n }, [apiKey, dispatchCheckWalletStatus]);\n\n const isApiKeySetted = apiKey !== '';\n\n return ;\n};\n\nexport default connect(mapStateToProps, mapDispatchToProps)(memo(HeaderContainer));\n","import React from 'react';\nimport { withRouter } from 'react-router-dom';\nimport MenuList from '../common/MenuList';\nimport './index.scss';\nimport Header from '../Header';\n\nexport const Layout = withRouter((props) => {\n return (\n
\n
\n
\n \n
\n
\n
{props.children}
\n
\n
\n );\n});\n","import React from 'react';\nimport clsx from 'clsx';\nimport './index.scss';\n\nconst InfoCard = ({ color, children, className }) => {\n return (\n \n {children}\n \n );\n};\n\nexport default InfoCard;\n","import React, { Component } from 'react';\nimport { FontAwesomeIcon } from '@fortawesome/react-fontawesome';\nimport { faSync, faCheck } from '@fortawesome/free-solid-svg-icons';\nimport InfoCard from '../InfoCard';\n\nexport default class SynchCard extends Component {\n shouldComponentUpdate(nextProps) {\n if (\n this.getSynchronizationState(nextProps) !== this.getSynchronizationState(this.props.nodeInfo)\n ) {\n return true;\n }\n\n return false;\n }\n\n renderActiveSynchronization = () => (\n <>\n

Synchronization state

\n

\n Active synchronization\n

\n \n );\n\n renderCompleteSynchronization = () => (\n <>\n

Synchronization state

\n

\n Node is synced\n

\n \n );\n\n renderSynchronizationState = (state) =>\n ({\n active: this.renderActiveSynchronization,\n complete: this.renderCompleteSynchronization,\n }[state]);\n\n getSynchronizationState = ({ fullHeight, headersHeight }) => {\n if (fullHeight !== null && headersHeight !== null && fullHeight === headersHeight) {\n return 'complete';\n }\n\n return 'active';\n };\n\n render() {\n const currentSynchState = this.getSynchronizationState(this.props.nodeInfo);\n return (\n \n {this.renderSynchronizationState(currentSynchState)()}\n \n );\n }\n}\n","import React, { Component } from 'react';\nimport { FontAwesomeIcon } from '@fortawesome/react-fontawesome';\nimport { faSync, faCheck } from '@fortawesome/free-solid-svg-icons';\nimport InfoCard from '../InfoCard';\n\nexport default class WalletSyncCard extends Component {\n renderActiveSynchronization = () => (\n <>\n

Synchronization state

\n

\n Active synchronization\n

\n \n );\n\n renderCompleteSynchronization = () => (\n <>\n

Synchronization state

\n

\n Wallet is synced\n

\n \n );\n\n renderSynchronizationState = (state) =>\n ({\n active: this.renderActiveSynchronization,\n complete: this.renderCompleteSynchronization,\n }[state]);\n\n getSynchronizationState = (walletStatusData, headersHeight) => {\n if (\n walletStatusData.walletHeight !== null &&\n headersHeight !== null &&\n walletStatusData.walletHeight === headersHeight\n ) {\n return 'complete';\n }\n\n return 'active';\n };\n\n render() {\n const { walletStatusData, headersHeight } = this.props;\n const currentSynchState = this.getSynchronizationState(walletStatusData, headersHeight);\n return (\n \n {this.renderSynchronizationState(currentSynchState)()}\n \n );\n }\n}\n","import React from 'react';\nimport './index.scss';\n\nconst LoaderLogo = () => {\n return (\n
\n \n \n \n \n
\n );\n};\n\nexport default LoaderLogo;\n","import React from 'react';\nimport { faExclamationTriangle } from '@fortawesome/free-solid-svg-icons';\nimport { FontAwesomeIcon } from '@fortawesome/react-fontawesome';\nimport { format } from 'date-fns';\nimport constants from 'utils/constants';\nimport InfoCard from './InfoCard';\nimport SynchCard from './SynchCard';\nimport WalletSyncCard from './WalletSyncCard';\nimport LoaderLogo from '../../common/ErgoLoader/index';\n\nconst getWalletStatus = (isWalletInitialized) => {\n if (!isWalletInitialized) {\n return 'Not initialized';\n }\n\n return 'Initialized';\n};\n\nconst DashboardView = ({\n error,\n nodeInfo,\n isWalletInitialized,\n walletStatusData,\n walletBalanceData,\n ergPrice,\n}) => {\n if (error !== null) {\n return (\n <>\n
\n

\n \n  \n {error}\n

\n
\n \n );\n }\n\n if (nodeInfo === null) {\n return (\n <>\n
\n \n
\n \n );\n }\n\n const { peersCount, bestHeaderId, launchTime, fullHeight, appVersion, isMining } = nodeInfo;\n\n return (\n <>\n
\n

Node Information

\n
\n
\n \n

Version

\n

{appVersion}

\n
\n
\n
\n \n
\n
\n \n

Started at

\n

\n {format(new Date(launchTime), 'MM-dd-yyyy HH:mm:ss')}\n

\n
\n
\n {fullHeight === null ? null : (\n
\n \n

Current height

\n

{fullHeight}

\n
\n
\n )}\n {bestHeaderId === null ? null : (\n
\n \n

Best block id

\n

{bestHeaderId}

\n
\n
\n )}\n
\n \n

Mining enabled

\n

{isMining ? 'Yes' : 'No'}

\n
\n
\n
\n \n

Peers connected

\n

{peersCount}

\n
\n
\n
\n
\n {ergPrice && (\n
\n

ERG Information

\n
\n
\n \n

\n ERG price in $
\n (based on oracle pool data)\n

\n

{ergPrice}

\n
\n
\n
\n
\n )}\n {walletStatusData && (\n
\n

Wallet Information

\n
\n
\n \n

Initialization state

\n

{getWalletStatus(isWalletInitialized)}

\n
\n
\n
\n \n

Lock state

\n

\n {walletStatusData.isUnlocked ? 'Unlocked' : 'Locked'}\n

\n
\n
\n
\n \n
\n {walletBalanceData && (\n
\n \n

Balance

\n

\n {walletBalanceData.balance / constants.nanoErgInErg} ERG{' '}\n {ergPrice &&\n `~ $${Number(\n ergPrice * (walletBalanceData.balance / constants.nanoErgInErg),\n ).toFixed(2)}`}\n

\n
\n
\n )}\n {walletBalanceData && (\n
\n \n

Assets

\n

\n {Object.values(walletBalanceData.assets).length || '0'}\n

\n
\n
\n )}\n
\n
\n )}\n \n );\n};\n\nexport default DashboardView;\n","import { useEffect, useRef } from 'react';\n\nfunction usePrevious(value) {\n // The ref object is a generic container whose current property is mutable ...\n // ... and can hold any value, similar to an instance property on a class\n const ref = useRef();\n\n // Store current value in ref\n useEffect(() => {\n ref.current = value;\n }, [value]); // Only re-run if value changes\n\n // Return previous value (happens before update in useEffect above)\n return ref.current;\n}\n\nexport default usePrevious;\n","import React, { useState, useEffect, useCallback, memo } from 'react';\nimport { connect } from 'react-redux';\nimport nodeApi from '../../../api/api';\nimport DashboardView from './DashboardView';\nimport {\n isWalletInitializedSelector,\n isWalletUnlockedSelector,\n walletStatusDataSelector,\n walletBalanceDataSelector,\n ergPriceSelector,\n} from '../../../store/selectors/wallet';\nimport { apiKeySelector } from '../../../store/selectors/app';\nimport usePrevious from '../../../hooks/usePrevious';\nimport walletActions from '../../../store/actions/walletActions';\n\nconst mapStateToProps = (state) => ({\n apiKey: apiKeySelector(state),\n isWalletInitialized: isWalletInitializedSelector(state),\n isWalletUnlocked: isWalletUnlockedSelector(state),\n walletStatusData: walletStatusDataSelector(state),\n walletBalanceData: walletBalanceDataSelector(state),\n ergPrice: ergPriceSelector(state),\n});\n\nconst mapDispatchToProps = (dispatch) => ({\n dispatchCheckWalletStatus: () => dispatch(walletActions.checkWalletStatus()),\n dispatchGetWalletBalance: () => dispatch(walletActions.getWalletBalance()),\n dispatchGetErgPrice: () => dispatch(walletActions.getErgPrice()),\n});\n\nconst DashboardContainer = (props) => {\n const {\n isWalletInitialized,\n isWalletUnlocked,\n apiKey,\n dispatchCheckWalletStatus,\n dispatchGetWalletBalance,\n dispatchGetErgPrice,\n walletStatusData,\n walletBalanceData,\n ergPrice,\n } = props;\n\n const [nodeInfo, setNodeInfo] = useState(null);\n const [error, setError] = useState(null);\n const [timerId, setTimerId] = useState(null);\n\n const getNodeCurrentState = () => nodeApi.get('/info');\n\n const setNodeCurrentState = useCallback(async () => {\n try {\n const { data } = await getNodeCurrentState();\n\n setNodeInfo(data);\n setError(null);\n } catch {\n setError('Node connection is lost.');\n }\n }, []);\n\n const setTimer = useCallback(() => {\n const newTimerId = setInterval(() => {\n setNodeCurrentState();\n dispatchGetErgPrice();\n\n if (apiKey) {\n dispatchCheckWalletStatus();\n dispatchGetWalletBalance();\n }\n }, 2000);\n\n setTimerId(newTimerId);\n }, [\n apiKey,\n dispatchCheckWalletStatus,\n dispatchGetErgPrice,\n dispatchGetWalletBalance,\n setNodeCurrentState,\n ]);\n\n const prevError = usePrevious(error);\n useEffect(() => {\n if (prevError && prevError !== error) {\n dispatchCheckWalletStatus();\n dispatchGetWalletBalance();\n dispatchGetErgPrice();\n }\n }, [dispatchCheckWalletStatus, dispatchGetErgPrice, dispatchGetWalletBalance, error, prevError]);\n\n useEffect(() => {\n setNodeCurrentState();\n dispatchGetErgPrice();\n\n if (apiKey) {\n dispatchCheckWalletStatus();\n dispatchGetWalletBalance();\n }\n\n setTimer();\n // eslint-disable-next-line\n }, [apiKey]);\n\n useEffect(\n () => () => {\n clearInterval(timerId);\n },\n [timerId, apiKey],\n );\n\n return (\n \n );\n};\n\nexport default connect(mapStateToProps, mapDispatchToProps)(memo(DashboardContainer));\n","import DashboardContainer from './DashboardContainer';\nimport './index.scss';\n\nexport default DashboardContainer;\n","import { useEffect, useState } from 'react';\n\nconst isBrowser = (): boolean => {\n return Boolean(typeof window !== 'undefined' && window.document && window.document.createElement);\n};\n\ntype SSRState = {\n isBrowser: boolean;\n isServer: boolean;\n};\n\nconst useSSR = (): SSRState => {\n const [browser, setBrowser] = useState(false);\n useEffect(() => {\n setBrowser(isBrowser());\n }, []);\n\n return {\n isBrowser: browser,\n isServer: !browser,\n };\n};\n\nconst createElement = (id: string): HTMLElement => {\n const el = document.createElement('div');\n el.setAttribute('id', id);\n return el;\n};\n\nconst usePortal = (\n selectId: string = Math.random().toString(32).slice(2, 10),\n): HTMLElement | null => {\n const id = `id-${selectId}`;\n const isUsingBrowser = useSSR().isBrowser;\n const [elSnapshot, setElSnapshot] = useState(\n isUsingBrowser ? createElement(id) : null,\n );\n\n useEffect(() => {\n const hasElement = document.querySelector(`#${id}`);\n const el = hasElement || createElement(id);\n\n if (!hasElement) {\n document.body.appendChild(el);\n }\n setElSnapshot(el);\n }, []);\n\n return elSnapshot;\n};\n\nexport default usePortal;\n","import { Dispatch, RefObject, SetStateAction, useEffect, useRef, useState } from 'react';\n/* eslint-disable */\nexport type ElementStackItem = {\n last: string;\n};\n\nexport type BodyScrollOptions = {\n scrollLayer: boolean;\n};\n\nconst defaultOptions: BodyScrollOptions = {\n scrollLayer: false,\n};\n\nconst elementStack = new Map();\n\nconst isIos = () => {\n /* istanbul ignore next */\n if (typeof window === 'undefined' || !window.navigator) return false;\n return /iP(ad|hone|od)/.test(window.navigator.platform);\n};\n\nconst touchHandler = (event: TouchEvent): boolean => {\n if (event.touches && event.touches.length > 1) return true;\n event.preventDefault();\n return false;\n};\n\nconst useBodyScroll = (\n elementRef?: RefObject | null,\n options?: BodyScrollOptions\n): [boolean, Dispatch>] => {\n if (typeof document === 'undefined')\n return [false, (t: SetStateAction) => t];\n const elRef = elementRef || useRef(document.body);\n const [hidden, setHidden] = useState(false);\n const safeOptions = {\n ...defaultOptions,\n ...(options || {}),\n };\n\n // don't prevent touch event when layer contain scroll\n const isIosWithCustom = () => {\n if (safeOptions.scrollLayer) return false;\n return isIos();\n };\n\n useEffect(() => {\n if (!elRef || !elRef.current) return;\n const lastOverflow = elRef.current.style.overflow;\n if (hidden) {\n if (elementStack.has(elRef.current)) return;\n if (!isIosWithCustom()) {\n elRef.current.style.overflow = 'hidden';\n } else {\n document.addEventListener('touchmove', touchHandler, {\n passive: false,\n });\n }\n elementStack.set(elRef.current, {\n last: lastOverflow,\n });\n return;\n }\n\n // reset element overflow\n if (!elementStack.has(elRef.current)) return;\n if (!isIosWithCustom()) {\n const store = elementStack.get(elRef.current) as ElementStackItem;\n elRef.current.style.overflow = store.last;\n } else {\n document.removeEventListener('touchmove', touchHandler);\n }\n elementStack.delete(elRef.current);\n }, [hidden, elRef]);\n\n return [hidden, setHidden];\n};\n\nexport default useBodyScroll;\n\n/* eslint-disable */\n","import { Dispatch, MutableRefObject, SetStateAction, useEffect, useRef, useState } from 'react';\n\nexport type CurrentStateType = [S, Dispatch>, MutableRefObject];\n\n// Добавляет ref, по которому текущее значение стейта можно получить\n// сразу вместо того чтобы ждать следующего рендера\nconst useCurrentState = (initialState: S | (() => S)): CurrentStateType => {\n const [state, setState] = useState(() => {\n return typeof initialState === 'function' ? (initialState as () => S)() : initialState;\n });\n const ref = useRef(initialState as S);\n\n useEffect(() => {\n ref.current = state;\n }, [state]);\n\n const setValue = (val: SetStateAction) => {\n const result = typeof val === 'function' ? (val as (prevState: S) => S)(ref.current) : val;\n ref.current = result;\n setState(result);\n };\n\n return [state, setValue, ref];\n};\n\nexport default useCurrentState;\n","import React, { ReactNode } from 'react';\nimport cn from 'classnames';\n\ntype TextVariant =\n | 'h1'\n | 'h2'\n | 'h3'\n | 'h4'\n | 'h5'\n | 'h6'\n | 'subtitle1'\n | 'subtitle2'\n | 'body-text1'\n | 'body-text2'\n | 'small-text1'\n | 'small-text2'\n | 'small-text3';\n\nexport type TextColor =\n | 'brandOrange'\n | 'purple'\n | 'black'\n | 'spaceGray'\n | 'gray5'\n | 'gray4'\n | 'gray3'\n | 'gray2'\n | 'gray1'\n | 'white'\n | 'orange'\n | 'red'\n | 'green'\n | 'blue'\n | 'blueHover'\n | 'brandOrangeHover'\n | 'brandOrangeActive'\n | 'purpleHover'\n | 'purpleActive';\n\nexport type TextComponent = 'span' | 'p' | 'div' | 'h1' | 'label' | 'h2' | 'h3';\n\ninterface IText {\n children?: ReactNode;\n variant?: TextVariant;\n xl?: TextVariant;\n lg?: TextVariant;\n md?: TextVariant;\n sm?: TextVariant;\n component?: TextComponent;\n color?: TextColor;\n className?: string;\n dangerouslySetInnerHTML?: any;\n htmlFor?: string;\n}\n\nconst Text = ({\n children,\n variant,\n component,\n color,\n className,\n dangerouslySetInnerHTML,\n ...props\n}: IText) => {\n const currentVariant = variant;\n\n const Component = component || 'p';\n\n if (dangerouslySetInnerHTML) {\n return (\n <>\n \n\n \n \n );\n }\n\n return (\n \n {children}\n \n \n );\n};\n\nexport default Text;\n","import React from 'react';\n\n// Прокидывает default параметры в компонент\nconst withDefaults = (component: React.ComponentType

, defaultProps: DP) => {\n type Props = Partial & Omit;\n // eslint-disable-next-line\n component.defaultProps = defaultProps;\n return component as React.ComponentType;\n};\n\nexport default withDefaults;\n","import React, { useEffect, useState } from 'react';\nimport withDefaults from 'utils/withDefaults';\n\ninterface Props {\n visible?: boolean;\n enterTime?: number;\n leaveTime?: number;\n clearTime?: number;\n className?: string;\n name?: string;\n}\n\nconst defaultProps = {\n visible: false,\n enterTime: 60,\n leaveTime: 60,\n clearTime: 60,\n className: '',\n name: 'transition',\n};\n\nexport type CSSTransitionProps = Props & typeof defaultProps;\n\nconst CSSTransition: React.FC> = ({\n children,\n className,\n visible,\n enterTime,\n leaveTime,\n clearTime,\n name,\n ...props\n}) => {\n const [classes, setClasses] = useState('');\n const [renderable, setRenderable] = useState(visible);\n\n useEffect(() => {\n const statusClassName = visible ? 'enter' : 'leave';\n const time = visible ? enterTime : leaveTime;\n if (visible && !renderable) {\n setRenderable(true);\n }\n\n setClasses(`${name}-${statusClassName}`);\n\n // set class to active\n const timer = setTimeout(() => {\n setClasses(`${name}-${statusClassName} ${name}-${statusClassName}-active`);\n clearTimeout(timer);\n }, time);\n\n // remove classess when animation over\n const clearClassesTimer = setTimeout(() => {\n if (!visible) {\n setClasses('');\n setRenderable(false);\n }\n clearTimeout(clearClassesTimer);\n }, time + clearTime);\n\n return () => {\n clearTimeout(timer);\n clearTimeout(clearClassesTimer);\n };\n }, [visible, renderable]);\n if (!React.isValidElement(children) || !renderable) return null;\n\n return React.cloneElement(children, {\n ...props,\n className: `${children.props.className} ${className} ${classes}`,\n });\n};\n\nexport default withDefaults(CSSTransition, defaultProps);\n","import React, { MouseEvent, useCallback, ReactElement } from 'react';\nimport withDefaults from 'utils/withDefaults';\nimport useCurrentState from 'hooks/useCurrentState';\nimport cn from 'classnames';\nimport CssTransition from '../CssTransition/CssTransition';\nimport styles from './Backdrop.module.scss';\n\ninterface Props {\n onClick?: (event: MouseEvent) => void;\n visible?: boolean;\n children?: ReactElement;\n className?: string;\n}\n\nconst defaultProps = {\n onClick: () => {},\n visible: false,\n};\n\nexport type BackdropProps = Props & typeof defaultProps;\n\nconst Backdrop: React.FC> = React.memo(\n ({ children, onClick, visible, className }: BackdropProps) => {\n const [, setIsContentMouseDown, IsContentMouseDownRef] = useCurrentState(false);\n const clickHandler = (event: MouseEvent) => {\n if (IsContentMouseDownRef.current) return;\n if (onClick) {\n onClick(event);\n }\n };\n const childrenClickHandler = useCallback((event: MouseEvent) => {\n event.stopPropagation();\n }, []);\n const mouseUpHandler = () => {\n if (!IsContentMouseDownRef.current) return;\n const timer = setTimeout(() => {\n setIsContentMouseDown(false);\n clearTimeout(timer);\n }, 0);\n };\n\n return (\n \n

\n
\n setIsContentMouseDown(true)}\n >\n {children}\n
\n
\n \n );\n },\n);\n\nexport default withDefaults(Backdrop, defaultProps);\n","import React from 'react';\n\nexport interface ModalConfig {\n close?: () => void;\n}\n\nconst defaultContext = {};\n\nexport const ModalContext = React.createContext(defaultContext);\n\nexport const useModalContext = (): ModalConfig => React.useContext(ModalContext);\n","function _extends() { _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }\n\nfunction _objectWithoutProperties(source, excluded) { if (source == null) return {}; var target = _objectWithoutPropertiesLoose(source, excluded); var key, i; if (Object.getOwnPropertySymbols) { var sourceSymbolKeys = Object.getOwnPropertySymbols(source); for (i = 0; i < sourceSymbolKeys.length; i++) { key = sourceSymbolKeys[i]; if (excluded.indexOf(key) >= 0) continue; if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue; target[key] = source[key]; } } return target; }\n\nfunction _objectWithoutPropertiesLoose(source, excluded) { if (source == null) return {}; var target = {}; var sourceKeys = Object.keys(source); var key, i; for (i = 0; i < sourceKeys.length; i++) { key = sourceKeys[i]; if (excluded.indexOf(key) >= 0) continue; target[key] = source[key]; } return target; }\n\nimport React from \"react\";\n\nvar _ref2 = /*#__PURE__*/React.createElement(\"path\", {\n d: \"M10.7951 9.30799C10.3844 8.89734 9.71865 8.89734 9.30799 9.30799C8.89734 9.71865 8.89734 10.3844 9.30799 10.7951L14.5129 16L9.30799 21.2049C8.89734 21.6156 8.89734 22.2814 9.30799 22.692C9.71865 23.1027 10.3844 23.1027 10.7951 22.692L16 17.4871L21.2049 22.692C21.6156 23.1027 22.2814 23.1027 22.692 22.692C23.1027 22.2814 23.1027 21.6156 22.692 21.2049L17.4871 16L22.692 10.7951C23.1027 10.3844 23.1027 9.71865 22.692 9.30799C22.2814 8.89734 21.6156 8.89734 21.2049 9.30799L16 14.5129L10.7951 9.30799Z\",\n fill: \"#76767A\"\n});\n\nvar SvgClose = function SvgClose(_ref) {\n var svgRef = _ref.svgRef,\n title = _ref.title,\n props = _objectWithoutProperties(_ref, [\"svgRef\", \"title\"]);\n\n return /*#__PURE__*/React.createElement(\"svg\", _extends({\n width: 32,\n height: 32,\n viewBox: \"0 0 32 32\",\n fill: \"none\",\n ref: svgRef\n }, props), title ? /*#__PURE__*/React.createElement(\"title\", null, title) : null, _ref2);\n};\n\nvar ForwardRef = /*#__PURE__*/React.forwardRef(function (props, ref) {\n return /*#__PURE__*/React.createElement(SvgClose, _extends({\n svgRef: ref\n }, props));\n});\nexport default __webpack_public_path__ + \"static/media/close.feae5a5c.svg\";\nexport { ForwardRef as ReactComponent };","function _extends() { _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }\n\nfunction _objectWithoutProperties(source, excluded) { if (source == null) return {}; var target = _objectWithoutPropertiesLoose(source, excluded); var key, i; if (Object.getOwnPropertySymbols) { var sourceSymbolKeys = Object.getOwnPropertySymbols(source); for (i = 0; i < sourceSymbolKeys.length; i++) { key = sourceSymbolKeys[i]; if (excluded.indexOf(key) >= 0) continue; if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue; target[key] = source[key]; } } return target; }\n\nfunction _objectWithoutPropertiesLoose(source, excluded) { if (source == null) return {}; var target = {}; var sourceKeys = Object.keys(source); var key, i; for (i = 0; i < sourceKeys.length; i++) { key = sourceKeys[i]; if (excluded.indexOf(key) >= 0) continue; target[key] = source[key]; } return target; }\n\nimport React from \"react\";\n\nvar _ref2 = /*#__PURE__*/React.createElement(\"path\", {\n d: \"M10.6668 0.666748H2.66683C1.9335 0.666748 1.3335 1.26675 1.3335 2.00008V11.3334H2.66683V2.00008H10.6668V0.666748ZM10.0002 3.33341L14.0002 7.33341V14.0001C14.0002 14.7334 13.4002 15.3334 12.6668 15.3334H5.32683C4.5935 15.3334 4.00016 14.7334 4.00016 14.0001L4.00683 4.66675C4.00683 3.93341 4.60016 3.33341 5.3335 3.33341H10.0002ZM9.3335 8.00008H13.0002L9.3335 4.33341V8.00008Z\",\n fill: \"#0078FF\"\n});\n\nvar SvgCopyicon = function SvgCopyicon(_ref) {\n var svgRef = _ref.svgRef,\n title = _ref.title,\n props = _objectWithoutProperties(_ref, [\"svgRef\", \"title\"]);\n\n return /*#__PURE__*/React.createElement(\"svg\", _extends({\n width: 16,\n height: 16,\n viewBox: \"0 0 16 16\",\n fill: \"none\",\n ref: svgRef\n }, props), title ? /*#__PURE__*/React.createElement(\"title\", null, title) : null, _ref2);\n};\n\nvar ForwardRef = /*#__PURE__*/React.forwardRef(function (props, ref) {\n return /*#__PURE__*/React.createElement(SvgCopyicon, _extends({\n svgRef: ref\n }, props));\n});\nexport default __webpack_public_path__ + \"static/media/copy.icon.835ebda7.svg\";\nexport { ForwardRef as ReactComponent };","function _extends() { _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }\n\nfunction _objectWithoutProperties(source, excluded) { if (source == null) return {}; var target = _objectWithoutPropertiesLoose(source, excluded); var key, i; if (Object.getOwnPropertySymbols) { var sourceSymbolKeys = Object.getOwnPropertySymbols(source); for (i = 0; i < sourceSymbolKeys.length; i++) { key = sourceSymbolKeys[i]; if (excluded.indexOf(key) >= 0) continue; if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue; target[key] = source[key]; } } return target; }\n\nfunction _objectWithoutPropertiesLoose(source, excluded) { if (source == null) return {}; var target = {}; var sourceKeys = Object.keys(source); var key, i; for (i = 0; i < sourceKeys.length; i++) { key = sourceKeys[i]; if (excluded.indexOf(key) >= 0) continue; target[key] = source[key]; } return target; }\n\nimport React from \"react\";\n\nvar _ref2 = /*#__PURE__*/React.createElement(\"path\", {\n d: \"M13.3332 7.99992C13.3332 8.36811 13.0347 8.66659 12.6665 8.66659H3.33317C2.96498 8.66659 2.6665 8.36811 2.6665 7.99992C2.6665 7.63173 2.96498 7.33325 3.33317 7.33325H12.6665C13.0347 7.33325 13.3332 7.63173 13.3332 7.99992Z\",\n fill: \"#0078FF\"\n});\n\nvar SvgRemove = function SvgRemove(_ref) {\n var svgRef = _ref.svgRef,\n title = _ref.title,\n props = _objectWithoutProperties(_ref, [\"svgRef\", \"title\"]);\n\n return /*#__PURE__*/React.createElement(\"svg\", _extends({\n width: 16,\n height: 16,\n viewBox: \"0 0 16 16\",\n fill: \"none\",\n ref: svgRef\n }, props), title ? /*#__PURE__*/React.createElement(\"title\", null, title) : null, _ref2);\n};\n\nvar ForwardRef = /*#__PURE__*/React.forwardRef(function (props, ref) {\n return /*#__PURE__*/React.createElement(SvgRemove, _extends({\n svgRef: ref\n }, props));\n});\nexport default __webpack_public_path__ + \"static/media/remove.94c0849a.svg\";\nexport { ForwardRef as ReactComponent };","import React from 'react';\n\nimport { ReactComponent as copyIcon } from '../../../assets/images/icons/copy.icon.svg';\nimport { ReactComponent as removeIcon } from '../../../assets/images/icons/remove.svg';\n\nexport interface IconProps {\n className?: string;\n}\n\nexport const makeIcon = (Icon: any, className?: string) => {\n return ;\n};\n\nexport const CopyIcon = ({ className }: IconProps) => {\n return makeIcon(copyIcon, className);\n};\n\nexport const RemoveIcon = ({ className }: IconProps) => {\n return makeIcon(removeIcon, className);\n};\n","import { ReactComponent as closeImage } from 'assets/images/icons/close.svg';\nimport { makeIcon, IconProps } from './icons';\n\nexport const CloseIcon = ({ className }: IconProps) => {\n return makeIcon(closeImage, className);\n};\n","import React, { useEffect, useMemo, useCallback } from 'react';\nimport { createPortal } from 'react-dom';\nimport usePortal from 'hooks/usePortal';\nimport useBodyScroll from 'hooks/useBodyScroll';\nimport useCurrentState from 'hooks/useCurrentState';\nimport Text from 'components/common/Text/Text';\nimport Backdrop from '../Backdrop/Backdrop';\nimport { ModalConfig, ModalContext } from './modal-context';\nimport CssTransition from '../CssTransition/CssTransition';\nimport { CloseIcon } from '../icons/CloseIcon';\n\ninterface Props {\n title?: React.ReactNode;\n description?: React.ReactNode;\n primaryButtonContent: React.ReactNode;\n secondaryButtonContent: React.ReactNode;\n disableBackdropClick?: boolean;\n onClose?: () => void;\n onOpen?: () => void;\n onPrimaryHandler?: () => void;\n onSecondaryHandler?: () => void;\n open?: boolean;\n width?: string;\n wrapClassName?: string;\n}\n\nconst defaultProps = {\n width: '26rem',\n wrapClassName: '',\n disableBackdropClick: false,\n};\n\ntype NativeAttrs = Omit, keyof Props>;\nexport type ModalProps = Props & typeof defaultProps & NativeAttrs;\n\nconst InfoModal: React.FC> = ({\n title,\n description,\n primaryButtonContent,\n secondaryButtonContent,\n disableBackdropClick,\n onClose,\n onOpen,\n onPrimaryHandler,\n onSecondaryHandler,\n open,\n}) => {\n const portal = usePortal('modal');\n const [, setBodyHidden] = useBodyScroll(null, { scrollLayer: true });\n const [visible, setVisible, visibleRef] = useCurrentState(false);\n\n const closeModal = useCallback(() => {\n if (onClose) {\n onClose();\n }\n setVisible(false);\n setBodyHidden(false);\n }, [onClose, setVisible, setBodyHidden]);\n\n useEffect(() => {\n if (open === undefined) return;\n if (open && onOpen) {\n onOpen();\n }\n if (!open && visibleRef.current && onClose) {\n onClose();\n }\n\n setVisible(open);\n setBodyHidden(open);\n }, [open]);\n\n const closeFromBackdrop = () => {\n if (disableBackdropClick) return;\n closeModal();\n };\n\n const primaryButtonClickHandler = () => {\n if (onPrimaryHandler) {\n onPrimaryHandler();\n }\n if (onClose) {\n onClose();\n }\n };\n\n const secondaryButtonClickHandler = () => {\n if (onSecondaryHandler) {\n onSecondaryHandler();\n }\n if (onClose) {\n onClose();\n }\n };\n\n const modalConfig: ModalConfig = useMemo(\n () => ({\n close: closeModal,\n }),\n [closeModal],\n );\n\n if (!portal) return null;\n\n return createPortal(\n \n \n \n
\n
\n

{title}

\n \n {description}\n \n \n {primaryButtonContent}\n \n \n {secondaryButtonContent}\n \n
\n \n\n \n
\n
\n
\n
,\n portal,\n );\n};\n\ntype ModalComponent

= React.FC

;\ntype ComponentProps = Partial &\n Omit &\n NativeAttrs;\n\nInfoModal.defaultProps = defaultProps;\n\nexport default InfoModal as ModalComponent;\n","import React, { useState, useCallback } from 'react';\nimport { Form, Field } from 'react-final-form';\nimport InfoModal from 'components/common/InfoModal/InfoModal';\nimport cn from 'classnames';\nimport nodeApi from '../../../../../api/api';\nimport customToast from '../../../../../utils/toast';\nimport CopyToClipboard from '../../../../common/CopyToClipboard';\nimport constants from '../../../../../utils/constants';\n\ntype Errors = {\n recipientAddress?: string;\n amount?: string;\n};\n\nconst PaymentSendForm = ({ apiKey }: { apiKey: string }) => {\n const [transactionId, setTransactionId] = useState(null);\n const [isSendedModalOpen, setIsSendedModalOpen] = useState(false);\n\n const paymentSend = useCallback(\n ({ recipientAddress, amount }) =>\n nodeApi.post(\n '/wallet/payment/send',\n [\n {\n address: recipientAddress,\n value: Number((parseFloat(amount) * constants.nanoErgInErg).toFixed(1)),\n },\n ],\n {\n headers: {\n api_key: apiKey,\n },\n },\n ),\n [apiKey],\n );\n\n const resetForm = (form: any) => {\n form.restart();\n setIsSendedModalOpen(false);\n };\n\n const sendForm = useCallback(\n (values) => {\n if (values.recipientAddress.trim() === '' || !values.recipientAddress) {\n return;\n }\n\n paymentSend(values)\n .then(({ data }) => {\n setTransactionId(data);\n setIsSendedModalOpen(true);\n })\n .catch((err) => {\n const errMessage = err.data ? err.data.detail : err.message;\n customToast('error', errMessage);\n });\n },\n [paymentSend],\n );\n\n const validateForm = useCallback((values) => {\n const errors: Errors = {};\n if (!values.recipientAddress) {\n errors.recipientAddress = 'The field cannot be empty';\n }\n if (!values.amount || values.amount < 0.001) {\n errors.amount = 'Minimum 0.001 ERG';\n }\n return errors;\n }, []);\n\n return (\n

\n
\n

Payment send

\n (\n <>\n
\n
\n \n (\n <>\n \n
{meta.error}
\n \n )}\n />\n
\n
\n \n (\n <>\n \n
{meta.error}
\n \n )}\n />\n
\n \n
\n\n {\n setIsSendedModalOpen(false);\n }}\n title=\"Payment sent\"\n description={\n <>\n

\n Your payment has been sent successfully. The transaction ID is -{' '}\n {transactionId}\n

\n

\n \n Click Here To Go To The Explorer\n \n

\n \n }\n primaryButtonContent={OK}\n secondaryButtonContent=\"Send again\"\n onPrimaryHandler={() => resetForm(form)}\n />\n \n )}\n />\n
\n
\n );\n};\n\nexport default PaymentSendForm;\n","function _extends() { _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }\n\nfunction _objectWithoutProperties(source, excluded) { if (source == null) return {}; var target = _objectWithoutPropertiesLoose(source, excluded); var key, i; if (Object.getOwnPropertySymbols) { var sourceSymbolKeys = Object.getOwnPropertySymbols(source); for (i = 0; i < sourceSymbolKeys.length; i++) { key = sourceSymbolKeys[i]; if (excluded.indexOf(key) >= 0) continue; if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue; target[key] = source[key]; } } return target; }\n\nfunction _objectWithoutPropertiesLoose(source, excluded) { if (source == null) return {}; var target = {}; var sourceKeys = Object.keys(source); var key, i; for (i = 0; i < sourceKeys.length; i++) { key = sourceKeys[i]; if (excluded.indexOf(key) >= 0) continue; target[key] = source[key]; } return target; }\n\nimport React from \"react\";\n\nvar _ref2 = /*#__PURE__*/React.createElement(\"g\", null, /*#__PURE__*/React.createElement(\"path\", {\n d: \"M39.622,21.746l-6.749,6.75c-0.562,0.562-1.326,0.879-2.122,0.879s-1.56-0.316-2.121-0.879l-6.75-6.75 c-1.171-1.171-1.171-3.071,0-4.242c1.171-1.172,3.071-1.172,4.242,0l1.832,1.832C27.486,13.697,22.758,9.25,17,9.25 c-6.064,0-11,4.935-11,11c0,6.064,4.936,11,11,11c1.657,0,3,1.343,3,3s-1.343,3-3,3c-9.373,0-17-7.626-17-17s7.627-17,17-17 c8.936,0,16.266,6.933,16.936,15.698l1.442-1.444c1.172-1.172,3.072-1.172,4.242,0C40.792,18.674,40.792,20.574,39.622,21.746z\"\n}));\n\nvar _ref3 = /*#__PURE__*/React.createElement(\"g\", null);\n\nvar _ref4 = /*#__PURE__*/React.createElement(\"g\", null);\n\nvar _ref5 = /*#__PURE__*/React.createElement(\"g\", null);\n\nvar _ref6 = /*#__PURE__*/React.createElement(\"g\", null);\n\nvar _ref7 = /*#__PURE__*/React.createElement(\"g\", null);\n\nvar _ref8 = /*#__PURE__*/React.createElement(\"g\", null);\n\nvar _ref9 = /*#__PURE__*/React.createElement(\"g\", null);\n\nvar _ref10 = /*#__PURE__*/React.createElement(\"g\", null);\n\nvar _ref11 = /*#__PURE__*/React.createElement(\"g\", null);\n\nvar _ref12 = /*#__PURE__*/React.createElement(\"g\", null);\n\nvar _ref13 = /*#__PURE__*/React.createElement(\"g\", null);\n\nvar _ref14 = /*#__PURE__*/React.createElement(\"g\", null);\n\nvar _ref15 = /*#__PURE__*/React.createElement(\"g\", null);\n\nvar _ref16 = /*#__PURE__*/React.createElement(\"g\", null);\n\nvar _ref17 = /*#__PURE__*/React.createElement(\"g\", null);\n\nvar SvgRedoArrowSymbol = function SvgRedoArrowSymbol(_ref) {\n var svgRef = _ref.svgRef,\n title = _ref.title,\n props = _objectWithoutProperties(_ref, [\"svgRef\", \"title\"]);\n\n return /*#__PURE__*/React.createElement(\"svg\", _extends({\n id: \"Capa_1\",\n x: \"0px\",\n y: \"0px\",\n width: \"32px\",\n height: \"32px\",\n viewBox: \"0 0 40.499 40.5\",\n style: {\n enableBackground: \"new 0 0 40.499 40.5\"\n },\n xmlSpace: \"preserve\",\n ref: svgRef\n }, props), title ? /*#__PURE__*/React.createElement(\"title\", null, title) : null, _ref2, _ref3, _ref4, _ref5, _ref6, _ref7, _ref8, _ref9, _ref10, _ref11, _ref12, _ref13, _ref14, _ref15, _ref16, _ref17);\n};\n\nvar ForwardRef = /*#__PURE__*/React.forwardRef(function (props, ref) {\n return /*#__PURE__*/React.createElement(SvgRedoArrowSymbol, _extends({\n svgRef: ref\n }, props));\n});\nexport default __webpack_public_path__ + \"static/media/redo-arrow-symbol.e801de31.svg\";\nexport { ForwardRef as ReactComponent };","import { ReactComponent as redoImage } from 'assets/images/icons/redo-arrow-symbol.svg';\nimport { makeIcon, IconProps } from './icons';\n\nexport const RedoIcon = ({ className }: IconProps) => {\n return makeIcon(redoImage, className);\n};\n","import React, { useState, useEffect, useCallback, useMemo } from 'react';\nimport cn from 'classnames';\nimport './index.scss';\nimport { connect } from 'react-redux';\nimport { RedoIcon } from 'components/common/icons/RedoIcon';\nimport constants from 'utils/constants';\nimport { RemoveIcon } from '../../../../common/icons/icons';\nimport {\n walletBalanceDataSelector,\n ergPriceSelector,\n walletAddressesSelector,\n} from '../../../../../store/selectors/wallet';\nimport walletActions from '../../../../../store/actions/walletActions';\n\nconst WalletInformationTableItem = ({ name, value }: any) => {\n const [isOpen, setIsOpen] = useState(false);\n let resultTitle;\n let resultContent;\n\n if (Array.isArray(value)) {\n resultTitle = value.length;\n\n resultContent = (\n
\n {value.map((item) => (\n <>\n
\n {item.value || ''} {item.name || ''}\n
\n
\n \n ))}\n
\n );\n } else {\n resultTitle = value;\n resultContent = value;\n }\n\n return (\n
\n \n
{name}
\n \n
\n {isOpen &&
{resultContent}
}\n \n );\n};\n\nconst WalletInformationTable = (props: any) => {\n const {\n walletBalance,\n dispatchGetWalletBalance,\n dispatchGetErgPrice,\n dispatchGetWalletAddresses,\n walletAddresses,\n } = props;\n\n const getValues = useCallback(() => {\n dispatchGetWalletBalance();\n dispatchGetErgPrice();\n dispatchGetWalletAddresses();\n }, [dispatchGetWalletBalance, dispatchGetErgPrice, dispatchGetWalletAddresses]);\n\n const getAddreses = useCallback((addresses: String[]) => {\n if (addresses.length === 0) {\n return 0;\n }\n\n return addresses.map((item) => ({\n value: (\n \n {item}\n \n ),\n }));\n }, []);\n\n const getAssets = useCallback((assets) => {\n if (Object.values(assets).length === 0) {\n return 0;\n }\n\n return Object.keys(assets).map((key: any) => ({\n name: {key},\n value: {assets[key]},\n }));\n }, []);\n\n useEffect(() => {\n getValues();\n }, [getValues]);\n\n const data = useMemo(\n () => [\n {\n name: 'Balance',\n value: walletBalance\n ? `${walletBalance.balance / constants.nanoErgInErg} ERG`\n : 'loading...',\n },\n // {\n // name: 'Balance in USD',\n // value: walletBalance\n // ? `$ ${(walletBalance.balance / constants.nanoErgInErg) * ergPrice}`\n // : 'Loading...',\n // },\n {\n name: 'Assets',\n value: walletBalance ? getAssets(walletBalance.assets) : `Loading...`,\n },\n {\n name: 'Addresses',\n value: walletAddresses ? getAddreses(walletAddresses) : `Loading...`,\n },\n ],\n [walletBalance, walletAddresses, getAddreses],\n );\n\n const updateValues = useCallback(() => {\n getValues();\n }, [getValues]);\n\n return (\n
\n
\n

\n Wallet Information{' '}\n \n

\n
\n
\n {data.map(({ value, name }) => (\n \n ))}\n
\n
\n );\n};\n\nconst mapStateToProps = (state: any) => ({\n walletBalance: walletBalanceDataSelector(state),\n ergPrice: ergPriceSelector(state),\n walletAddresses: walletAddressesSelector(state),\n});\n\nconst mapDispatchToProps = (dispatch: any) => ({\n dispatchGetWalletBalance: () => dispatch(walletActions.getWalletBalance()),\n dispatchGetErgPrice: () => dispatch(walletActions.getErgPrice()),\n dispatchGetWalletAddresses: () => dispatch(walletActions.getWalletAddresses()),\n});\n\nexport default connect(mapStateToProps, mapDispatchToProps)(WalletInformationTable);\n","import React, { Component, memo } from 'react';\nimport { connect } from 'react-redux';\nimport PaymentSendForm from './components/PaymentSendForm/index';\nimport { apiKeySelector } from '../../../store/selectors/app';\nimport {\n isWalletInitializedSelector,\n isWalletUnlockedSelector,\n} from '../../../store/selectors/wallet';\nimport WalletInformationTable from './components/WalletInformationTable/index';\nimport './index.scss';\n\nconst mapStateToProps = (state) => ({\n apiKey: apiKeySelector(state),\n isWalletInitialized: isWalletInitializedSelector(state),\n isWalletUnlocked: isWalletUnlockedSelector(state),\n});\n\nclass Wallet extends Component {\n renderState = (state) =>\n ({\n unlocked: (apiKey) => this.renderWalletUnlockedState(apiKey),\n locked: () => this.renderWalletLockedState(),\n initialized: (apiKey) => this.renderInitializedState(apiKey),\n }[state]);\n\n renderWalletLockedState = () => (\n
\n

The wallet UI is locked. You need to unlock the wallet to access its UI.

\n
\n );\n\n renderInitializedState = () => (\n
\n

You need to initialize your wallet to access wallet UI.

\n
\n );\n\n renderWalletUnlockedState = (apiKey) => (\n
\n \n \n {/* \n */}\n
\n );\n\n render() {\n const { apiKey, isWalletUnlocked, isWalletInitialized } = this.props;\n\n if (apiKey === '') {\n return (\n
\n

To continue, please set your API key.

\n
\n );\n }\n\n if (!isWalletInitialized) {\n return this.renderState('initialized')(apiKey);\n }\n\n if (isWalletUnlocked) {\n return this.renderState('unlocked')(apiKey);\n }\n\n return this.renderState('locked')();\n }\n}\n\nexport default connect(mapStateToProps)(memo(Wallet));\n","import React from 'react';\nimport { BrowserRouter, Switch, Route } from 'react-router-dom';\nimport { Layout } from '../components/layout';\nimport Dashboard from '../components/pages/Dashboard';\nimport Wallet from '../components/pages/Wallet';\n\nconst Router = () => (\n \n \n \n \n \n \n \n \n);\n\nexport default Router;\n","import { combineReducers } from 'redux';\nimport appSlice from '../slices/appSlice';\nimport walletSlice from '../slices/walletSlice';\n\nexport default combineReducers({\n app: appSlice.reducer,\n wallet: walletSlice.reducer,\n});\n","// import Axios from 'axios';\nimport walletActions from '../actions/walletActions';\nimport nodeApi from '../../api/api';\nimport { apiKeySelector } from '../selectors/app';\n// import oracleApi from '../../api/oracleApi';\n\nexport default (store) => (next) => (action) => {\n const { dispatch, getState } = store;\n const apiKey = apiKeySelector(getState());\n\n switch (action.type) {\n case walletActions.checkWalletStatus.type:\n nodeApi\n .get('/wallet/status', {\n headers: {\n api_key: apiKey,\n },\n })\n .then(({ data: walletData }) => {\n dispatch(walletActions.setIsWalletUnlocked(walletData.isUnlocked));\n dispatch(walletActions.setIsWalletInitialized(walletData.isInitialized));\n dispatch(walletActions.setWalletStatusData(walletData));\n })\n .catch(() => {});\n\n break;\n\n case walletActions.getWalletBalance.type:\n nodeApi\n .get('/wallet/balances', {\n headers: {\n api_key: apiKey,\n },\n })\n .then(({ data: walletData }) => {\n dispatch(walletActions.setWalletBalanceData(walletData));\n })\n .catch(() => {});\n\n break;\n\n // case walletActions.getErgPrice.type:\n // oracleApi\n // .get('/frontendData', {\n // transformResponse: [...Axios.defaults.transformResponse, (data) => JSON.parse(data)],\n // })\n // .then(({ data }) => {\n // dispatch(walletActions.setErgPrice(data.latest_price));\n // })\n // .catch(() => {});\n\n // break;\n\n case walletActions.getWalletAddresses.type:\n nodeApi\n .get('/wallet/addresses', {\n headers: {\n api_key: apiKey,\n },\n })\n .then(({ data: walletAddresses }) => {\n dispatch(walletActions.setWalletAddresses(walletAddresses));\n })\n .catch(() => {});\n\n break;\n\n default:\n break;\n }\n next(action);\n};\n","import React from 'react';\nimport { toast } from 'react-toastify';\nimport { Provider } from 'react-redux';\nimport Router from './router/router';\nimport createStore from './store';\n\nimport 'bootstrap/dist/css/bootstrap.min.css';\nimport './assets/styles/index.scss';\nimport 'react-toastify/dist/ReactToastify.min.css';\n\ntoast.configure();\nconst store = createStore();\n\nconst App = () => {\n return (\n \n \n \n );\n};\n\nexport default App;\n","import { configureStore, getDefaultMiddleware } from 'redux-starter-kit';\nimport rootReducer from './reducers/rootReducer';\nimport walletMiddleware from './middlewares/walletMiddleware';\n\nexport default () => {\n const store = configureStore({\n reducer: rootReducer,\n middleware: [...getDefaultMiddleware(), walletMiddleware],\n });\n\n return store;\n};\n","import React from 'react';\nimport ReactDOM from 'react-dom';\nimport App from './App';\n\nReactDOM.render(, document.getElementById('root'));\n","// extracted by mini-css-extract-plugin\nmodule.exports = {\"backdrop\":\"Backdrop_backdrop__PmdBI\",\"content\":\"Backdrop_content__2Kmrw\",\"layer\":\"Backdrop_layer__3V2YH\"};","module.exports = __webpack_public_path__ + \"static/media/logotype_white.4dcfd639.svg\";"],"sourceRoot":""} \ No newline at end of file diff --git a/src/components/Header/HeaderView.js b/src/components/Header/HeaderView.js index 85bd298..7557b72 100644 --- a/src/components/Header/HeaderView.js +++ b/src/components/Header/HeaderView.js @@ -1,32 +1,35 @@ -import React, { memo } from 'react'; +import React, { memo, useState } from 'react'; import { Navbar } from 'react-bootstrap'; import { Link } from 'react-router-dom'; import ApiKeyModal from './ApiKeyModal'; import WalletStatusModal from './WalletStatusModal'; import WalletInitModal from './WalletInitModal'; import logo from '../../assets/images/logotype_white.svg'; +import { MODAL_STATES } from './utils'; -const renderWalletForms = (isWalletInitialized) => { +const renderWalletForms = (isWalletInitialized, openedModal, setOpenedModal) => { if (isWalletInitialized === null) { return <>; } - if (isWalletInitialized) { + if (isWalletInitialized && openedModal !== MODAL_STATES.INIT) { return (
- +
); } return (
- +
); }; const HeaderView = ({ isApiKeySetted, isWalletInitialized }) => { + const [openedModal, setOpenedModal] = useState(null); + return ( @@ -37,7 +40,7 @@ const HeaderView = ({ isApiKeySetted, isWalletInitialized }) => {
- {isApiKeySetted && renderWalletForms(isWalletInitialized)} + {isApiKeySetted && renderWalletForms(isWalletInitialized, openedModal, setOpenedModal)}
); }; diff --git a/src/components/Header/WalletInitModal/index.js b/src/components/Header/WalletInitModal/index.js index dccbcec..221d710 100644 --- a/src/components/Header/WalletInitModal/index.js +++ b/src/components/Header/WalletInitModal/index.js @@ -6,6 +6,7 @@ import appActions from '../../../store/actions/appActions'; import WalletInitializeForm from '../../elements/WalletInitializeForm'; import RestoreWalletForm from '../../elements/RestoreWalletForm'; import walletActions from '../../../store/actions/walletActions'; +import { MODAL_STATES } from '../utils'; const mapStateToProps = (state) => ({ apiKey: apiKeySelector(state), @@ -22,10 +23,12 @@ class WalletInitModal extends Component { }; handleShow = () => { + this.props.onOpen(MODAL_STATES.INIT); this.setState({ showModal: true }); }; handleHide = () => { + this.props.onOpen(null); this.props.dispatchCheckWalletStatus(); this.setState({ showModal: false }); }; diff --git a/src/components/Header/WalletStatusModal/index.js b/src/components/Header/WalletStatusModal/index.js index c5a11a2..b9ca0ec 100644 --- a/src/components/Header/WalletStatusModal/index.js +++ b/src/components/Header/WalletStatusModal/index.js @@ -7,6 +7,7 @@ import walletActions from '../../../store/actions/walletActions'; import { apiKeySelector } from '../../../store/selectors/app'; import customToast from '../../../utils/toast'; import nodeApi from '../../../api/api'; +import { MODAL_STATES } from '../utils'; const mapStateToProps = (state) => ({ isWalletUnlocked: isWalletUnlockedSelector(state), @@ -24,10 +25,12 @@ class WalletStatusForm extends Component { }; handleShow = () => { + this.props.onOpen(MODAL_STATES.STATUS); this.setState({ showModal: true }); }; handleHide = () => { + this.props.onOpen(null); this.setState({ showModal: false }); }; diff --git a/src/components/Header/utils.js b/src/components/Header/utils.js new file mode 100644 index 0000000..cea2b33 --- /dev/null +++ b/src/components/Header/utils.js @@ -0,0 +1,4 @@ +export const MODAL_STATES = { + INIT: 'INIT', + STATUS: 'STATUS', +}; diff --git a/src/components/pages/Wallet/components/WalletInformationTable/index.tsx b/src/components/pages/Wallet/components/WalletInformationTable/index.tsx index 53be4ed..3461c8a 100644 --- a/src/components/pages/Wallet/components/WalletInformationTable/index.tsx +++ b/src/components/pages/Wallet/components/WalletInformationTable/index.tsx @@ -94,20 +94,16 @@ const WalletInformationTable = (props: any) => { })); }, []); - // const getAssets = useCallback((assets) => { - // if (Object.values(assets).length === 0) { - // return 0; - // } - - // if (Array.isArray(assets) && assets.length !== 0) { - // return assets.map(({ tokenId, amount }: any) => ({ - // name: {tokenId}, - // value: {amount}, - // })); - // } + const getAssets = useCallback((assets) => { + if (Object.values(assets).length === 0) { + return 0; + } - // return 0; - // }, []); + return Object.keys(assets).map((key: any) => ({ + name: {key}, + value: {assets[key]}, + })); + }, []); useEffect(() => { getValues(); @@ -127,10 +123,10 @@ const WalletInformationTable = (props: any) => { // ? `$ ${(walletBalance.balance / constants.nanoErgInErg) * ergPrice}` // : 'Loading...', // }, - // { - // name: 'Assets', - // value: walletBalance ? getAssets(walletBalance.assets) : `Loading...`, - // }, + { + name: 'Assets', + value: walletBalance ? getAssets(walletBalance.assets) : `Loading...`, + }, { name: 'Addresses', value: walletAddresses ? getAddreses(walletAddresses) : `Loading...`, From 47d14db60468db95d2758a2dd47e7239081e9506 Mon Sep 17 00:00:00 2001 From: "d.usov" Date: Tue, 20 Oct 2020 22:25:01 +0300 Subject: [PATCH 3/3] fix --- build/asset-manifest.json | 8 ++++---- build/index.html | 2 +- ...precache-manifest.570d2debbd0366e26bebc96337879ce4.js} | 8 ++++---- build/service-worker.js | 2 +- build/static/js/main.1a9ab5b0.chunk.js | 2 -- build/static/js/main.1a9ab5b0.chunk.js.map | 1 - build/static/js/main.1f01b859.chunk.js | 2 ++ build/static/js/main.1f01b859.chunk.js.map | 1 + 8 files changed, 13 insertions(+), 13 deletions(-) rename build/{precache-manifest.cfa8d209094ed4bb302117b55adf437d.js => precache-manifest.570d2debbd0366e26bebc96337879ce4.js} (92%) delete mode 100644 build/static/js/main.1a9ab5b0.chunk.js delete mode 100644 build/static/js/main.1a9ab5b0.chunk.js.map create mode 100644 build/static/js/main.1f01b859.chunk.js create mode 100644 build/static/js/main.1f01b859.chunk.js.map diff --git a/build/asset-manifest.json b/build/asset-manifest.json index 4e1b08e..1e41cca 100644 --- a/build/asset-manifest.json +++ b/build/asset-manifest.json @@ -1,15 +1,15 @@ { "files": { "main.css": "/static/css/main.4948ef80.chunk.css", - "main.js": "/static/js/main.1a9ab5b0.chunk.js", - "main.js.map": "/static/js/main.1a9ab5b0.chunk.js.map", + "main.js": "/static/js/main.1f01b859.chunk.js", + "main.js.map": "/static/js/main.1f01b859.chunk.js.map", "runtime-main.js": "/static/js/runtime-main.219240e0.js", "runtime-main.js.map": "/static/js/runtime-main.219240e0.js.map", "static/css/2.9338f6a1.chunk.css": "/static/css/2.9338f6a1.chunk.css", "static/js/2.9ae5727a.chunk.js": "/static/js/2.9ae5727a.chunk.js", "static/js/2.9ae5727a.chunk.js.map": "/static/js/2.9ae5727a.chunk.js.map", "index.html": "/index.html", - "precache-manifest.cfa8d209094ed4bb302117b55adf437d.js": "/precache-manifest.cfa8d209094ed4bb302117b55adf437d.js", + "precache-manifest.570d2debbd0366e26bebc96337879ce4.js": "/precache-manifest.570d2debbd0366e26bebc96337879ce4.js", "service-worker.js": "/service-worker.js", "static/css/2.9338f6a1.chunk.css.map": "/static/css/2.9338f6a1.chunk.css.map", "static/css/main.4948ef80.chunk.css.map": "/static/css/main.4948ef80.chunk.css.map", @@ -25,6 +25,6 @@ "static/css/2.9338f6a1.chunk.css", "static/js/2.9ae5727a.chunk.js", "static/css/main.4948ef80.chunk.css", - "static/js/main.1a9ab5b0.chunk.js" + "static/js/main.1f01b859.chunk.js" ] } \ No newline at end of file diff --git a/build/index.html b/build/index.html index 9e6809e..b251dd5 100644 --- a/build/index.html +++ b/build/index.html @@ -1 +1 @@ -Ergo node interface
\ No newline at end of file +Ergo node interface
\ No newline at end of file diff --git a/build/precache-manifest.cfa8d209094ed4bb302117b55adf437d.js b/build/precache-manifest.570d2debbd0366e26bebc96337879ce4.js similarity index 92% rename from build/precache-manifest.cfa8d209094ed4bb302117b55adf437d.js rename to build/precache-manifest.570d2debbd0366e26bebc96337879ce4.js index 102f014..d56da18 100644 --- a/build/precache-manifest.cfa8d209094ed4bb302117b55adf437d.js +++ b/build/precache-manifest.570d2debbd0366e26bebc96337879ce4.js @@ -1,6 +1,6 @@ self.__precacheManifest = (self.__precacheManifest || []).concat([ { - "revision": "3b09cbb65deb48647bf70814bb5762dc", + "revision": "f954ce704ca495f19e22d2d28840e9ea", "url": "/index.html" }, { @@ -8,7 +8,7 @@ self.__precacheManifest = (self.__precacheManifest || []).concat([ "url": "/static/css/2.9338f6a1.chunk.css" }, { - "revision": "28aa8f73cc73b004cd58", + "revision": "812274eca4cedaad8993", "url": "/static/css/main.4948ef80.chunk.css" }, { @@ -16,8 +16,8 @@ self.__precacheManifest = (self.__precacheManifest || []).concat([ "url": "/static/js/2.9ae5727a.chunk.js" }, { - "revision": "28aa8f73cc73b004cd58", - "url": "/static/js/main.1a9ab5b0.chunk.js" + "revision": "812274eca4cedaad8993", + "url": "/static/js/main.1f01b859.chunk.js" }, { "revision": "ce813ebd69754efed759", diff --git a/build/service-worker.js b/build/service-worker.js index ab11c6c..2e56c16 100644 --- a/build/service-worker.js +++ b/build/service-worker.js @@ -14,7 +14,7 @@ importScripts("https://storage.googleapis.com/workbox-cdn/releases/4.3.1/workbox-sw.js"); importScripts( - "/precache-manifest.cfa8d209094ed4bb302117b55adf437d.js" + "/precache-manifest.570d2debbd0366e26bebc96337879ce4.js" ); self.addEventListener('message', (event) => { diff --git a/build/static/js/main.1a9ab5b0.chunk.js b/build/static/js/main.1a9ab5b0.chunk.js deleted file mode 100644 index 4fe6187..0000000 --- a/build/static/js/main.1a9ab5b0.chunk.js +++ /dev/null @@ -1,2 +0,0 @@ -(this["webpackJsonpergo-node-interface"]=this["webpackJsonpergo-node-interface"]||[]).push([[0],{102:function(e,t,a){e.exports=a(142)},113:function(e,t,a){},130:function(e,t,a){},134:function(e,t,a){},135:function(e,t,a){},136:function(e,t,a){},137:function(e,t,a){},138:function(e,t,a){},140:function(e,t,a){},142:function(e,t,a){"use strict";a.r(t);var n=a(0),r=a.n(n),l=a(10),c=a.n(l),o=a(47),s=a(15),i=a(39),u=a(7),m=a(20),d=a(25),p=a(48),f=a(89),b="/swagger",h="https://ergoplatform.org",E="https://explorer.ergoplatform.com",v=1e9,y={dashboard:{href:"/",icon:r.a.createElement(m.a,{icon:d.b}),title:"Dashboard"},wallet:{href:"/wallet",icon:r.a.createElement(m.a,{icon:d.d}),title:"Wallet"}},g={swaggerInterface:{href:b,icon:r.a.createElement(m.a,{icon:d.a}),title:"Swagger"},explorer:{href:E,icon:r.a.createElement(m.a,{icon:f.a}),title:"Explorer"},website:{href:h,icon:r.a.createElement(m.a,{icon:d.f}),title:"Website"}},w=Object(u.f)((function(e){var t=e.location.pathname;return r.a.createElement("div",null,r.a.createElement("p",{className:"h5 pl-3 pt-4"},"Menu"),r.a.createElement("hr",{className:"mb-0"}),r.a.createElement("div",{className:"list-group list-group-flush"},Object.values(y).map((function(e,a){var n=e.href,l=e.icon,c=e.title;return r.a.createElement(i.b,{key:c,className:Object(p.a)("list-group-item list-group-item-action",{"list-group-item-dark":n===t,active:n===t,"border-top-0":0===a}),to:n},l," ",c)}))),r.a.createElement("p",{className:"h5 pl-3 pt-4"},"External links"),r.a.createElement("hr",{className:"mb-0"}),r.a.createElement("div",{className:"list-group list-group-flush"},Object.values(g).map((function(e,t){var a=e.href,n=e.icon,l=e.title;return r.a.createElement("a",{key:l,className:Object(p.a)("list-group-item list-group-item-action",{"border-top-0":0===t}),href:a,rel:"noopener noreferrer",target:"_blank"},n," ",l)}))))})),N=(a(113),a(79)),O=Object(N.a)((function(e){return e.app}),(function(e){return e.apiKey})),j=function(e){return e.wallet},k=Object(N.a)(j,(function(e){return e.isWalletUnlocked})),S=Object(N.a)(j,(function(e){return e.isWalletInitialized})),_=Object(N.a)(j,(function(e){return e.walletStatusData})),C=Object(N.a)(j,(function(e){return e.walletBalanceData})),W=Object(N.a)(j,(function(e){return e.walletAddresses})),x=Object(N.a)(j,(function(e){return e.ergPrice})),I=a(23),P=a(19),A=Object(P.c)({name:"walletSlice",initialState:{isWalletUnlocked:null,isWalletInitialized:null,walletStatusData:null,walletBalanceData:null,ergPrice:null,walletAddresses:null},reducers:{setIsWalletUnlocked:function(e,t){var a=t.payload;e.isWalletUnlocked=a},setIsWalletInitialized:function(e,t){var a=t.payload;e.isWalletInitialized=a},setWalletStatusData:function(e,t){var a=t.payload;e.walletStatusData=a},setWalletBalanceData:function(e,t){var a=t.payload;e.walletBalanceData=a},setErgPrice:function(e,t){var a=t.payload;e.ergPrice=a},setWalletAddresses:function(e,t){var a=t.payload;e.walletAddresses=a}}}),B=Object(P.b)("checkWalletStatus"),z=Object(P.b)("getWalletBalance"),L=Object(P.b)("getErgPrice"),T=Object(P.b)("getWalletAddresses"),H=Object(I.a)({},A.actions,{checkWalletStatus:B,getWalletBalance:z,getErgPrice:L,getWalletAddresses:T}),F=a(151),M=a(5),K=Object(P.c)({name:"appSlice",initialState:{apiKey:""},reducers:{setApiKey:function(e,t){e.apiKey=t.payload}}}),U=Object(I.a)({},K.actions),R=a(91),D=a.n(R),G=Object(I.a)({},{nodeApiLink:"/",oracleApiLink:"https://erg-usd-ergo-oracle.emurgo.io"});function V(e){var t=e.status,a=e.message,n=e.data,r=e.statusText;this.name="NetworkError",this.message=a||r,this.status=t,this.data=n}V.prototype=Object.create(Error.prototype);var Y=D.a.create({baseURL:G.nodeApiLink,timeout:1e4,crossDomain:!0,headers:{"Content-Type":"application/json"}});Y.interceptors.response.use((function(e){return Promise.resolve(e)}),(function(e){return Promise.reject(new V(e.response||e))}));var Z=Y,q=(a(130),{success:function(e,t){return o.a.success(e,Object(I.a)({position:"top-right",autoClose:5e3,hideProgressBar:!1,closeOnClick:!0,pauseOnHover:!0,draggable:!0,className:"n-toast n-toast--success",bodyClassName:"n-toast__body",progressClassName:"n-toast__progress--success"},t))},error:function(e,t){return o.a.error(e,Object(I.a)({position:"top-right",autoClose:5e3,hideProgressBar:!1,closeOnClick:!0,pauseOnHover:!0,draggable:!0,className:"n-toast n-toast--error",bodyClassName:"n-toast__body",progressClassName:"n-toast__progress--error"},t))},info:o.a.info}),J=function(e,t,a){return q[e]?q[e](t,a):new Error("Bad toast state")},$=a(29),Q=a(9),X=function(e){var t=e.showModal,a=e.handleHide,n=e.submitForm,l=e.apiKey,c=e.handleShow;return r.a.createElement("div",null,function(e,t){return""===e?r.a.createElement("button",{type:"button",onClick:t,className:"btn btn-primary"},"Set API key"):r.a.createElement("button",{type:"button",onClick:t,className:"btn btn-outline-primary"},"Update API key")}(l,c),r.a.createElement($.a,{show:t,onHide:function(){return a()},centered:!0},r.a.createElement(Q.c,{initialValues:{apiKey:l},onSubmit:n},(function(){return r.a.createElement(Q.b,null,r.a.createElement($.a.Header,{closeButton:!0},r.a.createElement($.a.Title,null,"Authorization")),r.a.createElement($.a.Body,null,r.a.createElement("p",{className:"text"},"Set API key to access Node requests"),r.a.createElement("div",{className:"input-group"},r.a.createElement(Q.a,{type:"text",name:"apiKey",className:"form-control",placeholder:"Enter API key"}))),r.a.createElement($.a.Footer,null,r.a.createElement("button",{type:"button",className:"btn btn-outline-secondary",onClick:a},"Close"),r.a.createElement("button",{type:"submit",className:"btn btn-primary"},"Save changes")))}))))},ee=Object(s.b)((function(e){return{apiKey:O(e)}}),(function(e){return{dispatchSetApiKey:function(t){return e(U.setApiKey(t))}}}))(Object(n.memo)((function(e){var t=e.dispatchSetApiKey,a=e.apiKey,l=Object(n.useState)(!1),c=Object(M.a)(l,2),o=c[0],s=c[1],i=function(){s(!1)};return r.a.createElement(X,{showModal:o,apiKey:a,handleHide:i,submitForm:function(e){Z.get("/wallet/status",{headers:{api_key:e.apiKey}}).then((function(){t(e.apiKey.trim()),J("success","API key is set successfully"),i()})).catch((function(){J("error","Bad API key")}))},handleShow:function(){s(!0)}})}))),te=a(12),ae=a(13),ne=a(16),re=a(14),le=a(17),ce=function(e){function t(){var e,a;Object(te.a)(this,t);for(var n=arguments.length,l=new Array(n),c=0;c0&&void 0!==arguments[0]?arguments[0]:Math.random().toString(32).slice(2,10),t="id-".concat(e),a=Fe().isBrowser,r=Object(n.useState)(a?Me(t):null),l=Object(M.a)(r,2),c=l[0],o=l[1];return Object(n.useEffect)((function(){var e=document.querySelector("#".concat(t)),a=e||Me(t);e||document.body.appendChild(a),o(a)}),[]),c},Ue={scrollLayer:!1},Re=new Map,De=function(e){return!!(e.touches&&e.touches.length>1)||(e.preventDefault(),!1)},Ge=function(e,t){if("undefined"===typeof document)return[!1,function(e){return e}];var a=e||Object(n.useRef)(document.body),r=Object(n.useState)(!1),l=Object(M.a)(r,2),c=l[0],o=l[1],s=Object(I.a)({},Ue,{},t||{}),i=function(){return!s.scrollLayer&&(!("undefined"===typeof window||!window.navigator)&&/iP(ad|hone|od)/.test(window.navigator.platform))};return Object(n.useEffect)((function(){if(a&&a.current){var e=a.current.style.overflow;if(c){if(Re.has(a.current))return;return i()?document.addEventListener("touchmove",De,{passive:!1}):a.current.style.overflow="hidden",void Re.set(a.current,{last:e})}if(Re.has(a.current)){if(i())document.removeEventListener("touchmove",De);else{var t=Re.get(a.current);a.current.style.overflow=t.last}Re.delete(a.current)}}}),[c,a]),[c,o]},Ve=function(e){var t=Object(n.useState)((function(){return"function"===typeof e?e():e})),a=Object(M.a)(t,2),r=a[0],l=a[1],c=Object(n.useRef)(e);Object(n.useEffect)((function(){c.current=r}),[r]);return[r,function(e){var t="function"===typeof e?e(c.current):e;c.current=t,l(t)},c]},Ye=a(65),Ze=a(4),qe=a.n(Ze),Je=function(e){var t=e.children,a=e.variant,n=e.component,l=e.color,c=e.className,o=e.dangerouslySetInnerHTML,s=Object(Ye.a)(e,["children","variant","component","color","className","dangerouslySetInnerHTML"]),i=a,u=n||"p";return o?r.a.createElement(r.a.Fragment,null,r.a.createElement(u,Object.assign({className:qe()({colored:l},i,c),dangerouslySetInnerHTML:o},s)),r.a.createElement("style",null,"\n .colored {\n color: var(--".concat(l,");\n }\n "))):r.a.createElement(u,Object.assign({className:qe()({colored:l},i,c)},s),t,r.a.createElement("style",null,"\n .colored {\n color: var(--".concat(l,");\n }\n ")))},$e=function(e,t){return e.defaultProps=t,e},Qe=$e((function(e){var t=e.children,a=e.className,l=e.visible,c=e.enterTime,o=e.leaveTime,s=e.clearTime,i=e.name,u=Object(Ye.a)(e,["children","className","visible","enterTime","leaveTime","clearTime","name"]),m=Object(n.useState)(""),d=Object(M.a)(m,2),p=d[0],f=d[1],b=Object(n.useState)(l),h=Object(M.a)(b,2),E=h[0],v=h[1];return Object(n.useEffect)((function(){var e=l?"enter":"leave",t=l?c:o;l&&!E&&v(!0),f("".concat(i,"-").concat(e));var a=setTimeout((function(){f("".concat(i,"-").concat(e," ").concat(i,"-").concat(e,"-active")),clearTimeout(a)}),t),n=setTimeout((function(){l||(f(""),v(!1)),clearTimeout(n)}),t+s);return function(){clearTimeout(a),clearTimeout(n)}}),[l,E]),r.a.isValidElement(t)&&E?r.a.cloneElement(t,Object(I.a)({},u,{className:"".concat(t.props.className," ").concat(a," ").concat(p)})):null}),{visible:!1,enterTime:60,leaveTime:60,clearTime:60,className:"",name:"transition"}),Xe=a(67),et=a.n(Xe),tt=$e(r.a.memo((function(e){var t=e.children,a=e.onClick,l=e.visible,c=e.className,o=Ve(!1),s=Object(M.a)(o,3),i=s[1],u=s[2],m=Object(n.useCallback)((function(e){e.stopPropagation()}),[]);return r.a.createElement(Qe,{visible:l,clearTime:300},r.a.createElement("div",{className:et.a.backdrop,onClick:function(e){u.current||a&&a(e)},onMouseUp:function(){if(u.current)var e=setTimeout((function(){i(!1),clearTimeout(e)}),0)}},r.a.createElement("div",{className:et.a.layer}),r.a.createElement("div",{onClick:m,className:qe()(et.a.content,c),onMouseDown:function(){return i(!0)}},t)))})),{onClick:function(){},visible:!1}),at=r.a.createContext({});function nt(){return(nt=Object.assign||function(e){for(var t=1;t=0||(r[a]=e[a]);return r}(e,t);if(Object.getOwnPropertySymbols){var l=Object.getOwnPropertySymbols(e);for(n=0;n=0||Object.prototype.propertyIsEnumerable.call(e,a)&&(r[a]=e[a])}return r}var lt=r.a.createElement("path",{d:"M10.7951 9.30799C10.3844 8.89734 9.71865 8.89734 9.30799 9.30799C8.89734 9.71865 8.89734 10.3844 9.30799 10.7951L14.5129 16L9.30799 21.2049C8.89734 21.6156 8.89734 22.2814 9.30799 22.692C9.71865 23.1027 10.3844 23.1027 10.7951 22.692L16 17.4871L21.2049 22.692C21.6156 23.1027 22.2814 23.1027 22.692 22.692C23.1027 22.2814 23.1027 21.6156 22.692 21.2049L17.4871 16L22.692 10.7951C23.1027 10.3844 23.1027 9.71865 22.692 9.30799C22.2814 8.89734 21.6156 8.89734 21.2049 9.30799L16 14.5129L10.7951 9.30799Z",fill:"#76767A"}),ct=function(e){var t=e.svgRef,a=e.title,n=rt(e,["svgRef","title"]);return r.a.createElement("svg",nt({width:32,height:32,viewBox:"0 0 32 32",fill:"none",ref:t},n),a?r.a.createElement("title",null,a):null,lt)},ot=r.a.forwardRef((function(e,t){return r.a.createElement(ct,nt({svgRef:t},e))}));a.p;a.p;function st(){return(st=Object.assign||function(e){for(var t=1;t=0||(r[a]=e[a]);return r}(e,t);if(Object.getOwnPropertySymbols){var l=Object.getOwnPropertySymbols(e);for(n=0;n=0||Object.prototype.propertyIsEnumerable.call(e,a)&&(r[a]=e[a])}return r}var ut=r.a.createElement("path",{d:"M13.3332 7.99992C13.3332 8.36811 13.0347 8.66659 12.6665 8.66659H3.33317C2.96498 8.66659 2.6665 8.36811 2.6665 7.99992C2.6665 7.63173 2.96498 7.33325 3.33317 7.33325H12.6665C13.0347 7.33325 13.3332 7.63173 13.3332 7.99992Z",fill:"#0078FF"}),mt=function(e){var t=e.svgRef,a=e.title,n=it(e,["svgRef","title"]);return r.a.createElement("svg",st({width:16,height:16,viewBox:"0 0 16 16",fill:"none",ref:t},n),a?r.a.createElement("title",null,a):null,ut)},dt=r.a.forwardRef((function(e,t){return r.a.createElement(mt,st({svgRef:t},e))})),pt=(a.p,function(e,t){return r.a.createElement(e,{className:t,focusable:"false"})}),ft=function(e){var t=e.className;return pt(dt,t)},bt=function(e){var t=e.className;return pt(ot,t)},ht=function(e){var t=e.title,a=e.description,c=e.primaryButtonContent,o=e.secondaryButtonContent,s=e.disableBackdropClick,i=e.onClose,u=e.onOpen,m=e.onPrimaryHandler,d=e.onSecondaryHandler,p=e.open,f=Ke("modal"),b=Ge(null,{scrollLayer:!0}),h=Object(M.a)(b,2)[1],E=Ve(!1),v=Object(M.a)(E,3),y=v[0],g=v[1],w=v[2],N=Object(n.useCallback)((function(){i&&i(),g(!1),h(!1)}),[i,g,h]);Object(n.useEffect)((function(){void 0!==p&&(p&&u&&u(),!p&&w.current&&i&&i(),g(p),h(p))}),[p]);var O=Object(n.useMemo)((function(){return{close:N}}),[N]);return f?Object(l.createPortal)(r.a.createElement(at.Provider,{value:O},r.a.createElement(tt,{onClick:function(){s||N()},visible:y,className:"info-modal-backdrop"},r.a.createElement(Qe,{name:"wrapper",visible:y,clearTime:300},r.a.createElement("div",{className:"info-modal"},r.a.createElement("div",{className:"info-modal__content"},r.a.createElement("h3",{className:"mb-3"},t),r.a.createElement(Je,{xl:"body-text1",sm:"small-text1",className:"mb-40 mb-md-56 pr-40 pr-md-0"},a),r.a.createElement("button",{type:"button",className:"btn btn-primary px-4",onClick:function(){m&&m(),i&&i()}},c),r.a.createElement("button",{type:"button",className:"btn btn-outline-secondary px-4 ml-3",onClick:function(){d&&d(),i&&i()}},o)),r.a.createElement("button",{type:"button",className:"info-modal__button--close",onClick:N},r.a.createElement(bt,null)),r.a.createElement("style",null,"\n .wrapper-enter {\n opacity: 0;\n transform: translate3d(0px, -40px, 0px);\n }\n .wrapper-enter-active {\n opacity: 1;\n transform: translate3d(0px, 0px, 0px);\n }\n .wrapper-leave {\n opacity: 1;\n transform: translate3d(0px, 0px, 0px);\n }\n .wrapper-leave-active {\n opacity: 0;\n transform: translate3d(0px, -50px, 0px);\n }\n "))))),f):null};ht.defaultProps={width:"26rem",wrapClassName:"",disableBackdropClick:!1};var Et=ht,vt=function(e){var t=e.apiKey,a=Object(n.useState)(null),l=Object(M.a)(a,2),c=l[0],o=l[1],s=Object(n.useState)(!1),i=Object(M.a)(s,2),u=i[0],m=i[1],d=Object(n.useCallback)((function(e){var a=e.recipientAddress,n=e.amount;return Z.post("/wallet/payment/send",[{address:a,value:Number((parseFloat(n)*v).toFixed(1))}],{headers:{api_key:t}})}),[t]),p=Object(n.useCallback)((function(e){""!==e.recipientAddress.trim()&&e.recipientAddress&&d(e).then((function(e){var t=e.data;o(t),m(!0)})).catch((function(e){var t=e.data?e.data.detail:e.message;J("error",t)}))}),[d]),f=Object(n.useCallback)((function(e){var t={};return e.recipientAddress||(t.recipientAddress="The field cannot be empty"),(!e.amount||e.amount<.001)&&(t.amount="Minimum 0.001 ERG"),t}),[]);return r.a.createElement("div",{className:""},r.a.createElement("div",{className:"card bg-white p-4"},r.a.createElement("h2",{className:"h5 mb-3"},"Payment send"),r.a.createElement(He.b,{onSubmit:p,validate:f,render:function(e){var t=e.handleSubmit,a=e.submitting,n=e.pristine,l=e.form;return r.a.createElement(r.a.Fragment,null,r.a.createElement("form",{onSubmit:t},r.a.createElement("div",{className:"mb-3"},r.a.createElement("label",{htmlFor:"recipient-address"},"Recipient address"),r.a.createElement(He.a,{name:"recipientAddress",render:function(e){var t=e.input,a=e.meta;return r.a.createElement(r.a.Fragment,null,r.a.createElement("input",Object.assign({id:"recipient-address",className:qe()("form-control",{"is-invalid":a.touched&&a.error}),type:"text",placeholder:"Enter recipient address"},t)),r.a.createElement("div",{className:"invalid-feedback"},a.error))}})),r.a.createElement("div",{className:"mb-3"},r.a.createElement("label",{htmlFor:"amount"},"Amount"),r.a.createElement(He.a,{name:"amount",render:function(e){var t=e.input,a=e.meta;return r.a.createElement(r.a.Fragment,null,r.a.createElement("input",Object.assign({id:"amount",className:qe()("form-control",{"is-invalid":a.touched&&a.error}),type:"number",placeholder:"Minimum 0.001 ERG"},t)),r.a.createElement("div",{className:"invalid-feedback"},a.error))}})),r.a.createElement("button",{type:"submit",className:"btn btn-primary",disabled:a||n},"Send")),r.a.createElement(Et,{open:u,onClose:function(){m(!1)},title:"Payment sent",description:r.a.createElement(r.a.Fragment,null,r.a.createElement("p",null,"Your payment has been sent successfully. The transaction ID is -"," ",r.a.createElement(be,null,c)),r.a.createElement("p",null,r.a.createElement("a",{target:"_blank",rel:"noopener noreferrer",href:"https://explorer.ergoplatform.com/en/transactions/".concat(c)},"Click Here To Go To The Explorer"))),primaryButtonContent:r.a.createElement("span",{className:"pl-3 pr-3"},"OK"),secondaryButtonContent:"Send again",onPrimaryHandler:function(){return function(e){e.restart(),m(!1)}(l)}}))}})))};a(137);function yt(){return(yt=Object.assign||function(e){for(var t=1;t=0||(r[a]=e[a]);return r}(e,t);if(Object.getOwnPropertySymbols){var l=Object.getOwnPropertySymbols(e);for(n=0;n=0||Object.prototype.propertyIsEnumerable.call(e,a)&&(r[a]=e[a])}return r}var wt=r.a.createElement("g",null,r.a.createElement("path",{d:"M39.622,21.746l-6.749,6.75c-0.562,0.562-1.326,0.879-2.122,0.879s-1.56-0.316-2.121-0.879l-6.75-6.75 c-1.171-1.171-1.171-3.071,0-4.242c1.171-1.172,3.071-1.172,4.242,0l1.832,1.832C27.486,13.697,22.758,9.25,17,9.25 c-6.064,0-11,4.935-11,11c0,6.064,4.936,11,11,11c1.657,0,3,1.343,3,3s-1.343,3-3,3c-9.373,0-17-7.626-17-17s7.627-17,17-17 c8.936,0,16.266,6.933,16.936,15.698l1.442-1.444c1.172-1.172,3.072-1.172,4.242,0C40.792,18.674,40.792,20.574,39.622,21.746z"})),Nt=r.a.createElement("g",null),Ot=r.a.createElement("g",null),jt=r.a.createElement("g",null),kt=r.a.createElement("g",null),St=r.a.createElement("g",null),_t=r.a.createElement("g",null),Ct=r.a.createElement("g",null),Wt=r.a.createElement("g",null),xt=r.a.createElement("g",null),It=r.a.createElement("g",null),Pt=r.a.createElement("g",null),At=r.a.createElement("g",null),Bt=r.a.createElement("g",null),zt=r.a.createElement("g",null),Lt=r.a.createElement("g",null),Tt=function(e){var t=e.svgRef,a=e.title,n=gt(e,["svgRef","title"]);return r.a.createElement("svg",yt({id:"Capa_1",x:"0px",y:"0px",width:"32px",height:"32px",viewBox:"0 0 40.499 40.5",style:{enableBackground:"new 0 0 40.499 40.5"},xmlSpace:"preserve",ref:t},n),a?r.a.createElement("title",null,a):null,wt,Nt,Ot,jt,kt,St,_t,Ct,Wt,xt,It,Pt,At,Bt,zt,Lt)},Ht=r.a.forwardRef((function(e,t){return r.a.createElement(Tt,yt({svgRef:t},e))})),Ft=(a.p,function(e){var t=e.className;return pt(Ht,t)}),Mt=function(e){var t,a,l=e.name,c=e.value,o=Object(n.useState)(!1),s=Object(M.a)(o,2),i=s[0],u=s[1];return Array.isArray(c)?(t=c.length,a=r.a.createElement("div",null,c.map((function(e){return r.a.createElement(r.a.Fragment,null,r.a.createElement("div",null,e.value||""," ",e.name||""),r.a.createElement("br",null))})))):(t=c,a=c),r.a.createElement("div",{className:"wallet-table__item"},r.a.createElement("div",{className:qe()("wallet-table-item-header",{"wallet-table-item-header--opened":i})},r.a.createElement("div",{className:"wallet-table-item-header__title"},l),r.a.createElement("div",{className:"wallet-table-item-header__right-side"},!i&&r.a.createElement("div",{className:"wallet-table-item-header__opacity-paragraph"},t),r.a.createElement("a",{className:"wallet-table-item-header__link",onClick:function(){return u((function(e){return!e}))}},!i&&"More",i&&r.a.createElement(ft,null)))),i&&r.a.createElement("div",{className:"wallet-table-item-body"},a))},Kt=Object(s.b)((function(e){return{walletBalance:C(e),ergPrice:x(e),walletAddresses:W(e)}}),(function(e){return{dispatchGetWalletBalance:function(){return e(H.getWalletBalance())},dispatchGetErgPrice:function(){return e(H.getErgPrice())},dispatchGetWalletAddresses:function(){return e(H.getWalletAddresses())}}}))((function(e){var t=e.walletBalance,a=e.dispatchGetWalletBalance,l=e.dispatchGetErgPrice,c=e.dispatchGetWalletAddresses,o=e.walletAddresses,s=Object(n.useCallback)((function(){a(),l(),c()}),[a,l,c]),i=Object(n.useCallback)((function(e){return 0===e.length?0:e.map((function(e){return{value:r.a.createElement("a",{rel:"noopener noreferrer",target:"_blank",href:"https://explorer.ergoplatform.com/en/addresses/".concat(e)},e)}}))}),[]),u=Object(n.useCallback)((function(e){return 0===Object.values(e).length?0:Object.keys(e).map((function(t){return{name:r.a.createElement("span",{className:"text-muted"},t),value:r.a.createElement("span",{className:"font-weight-bold"},e[t])}}))}),[]);Object(n.useEffect)((function(){s()}),[s]);var m=Object(n.useMemo)((function(){return[{name:"Balance",value:t?"".concat(t.balance/v," ERG"):"loading..."},{name:"Assets",value:t?u(t.assets):"Loading..."},{name:"Addresses",value:o?i(o):"Loading..."}]}),[t,o,i]),d=Object(n.useCallback)((function(){s()}),[s]);return r.a.createElement("div",{className:"wallet-table"},r.a.createElement("div",{className:"wallet-table__header"},r.a.createElement("h2",{className:"wallet-table__title"},"Wallet Information"," ",r.a.createElement("button",{type:"button",className:"wallet-table__icon-redo",onClick:d},r.a.createElement(Ft,null)))),r.a.createElement("div",{className:"wallet-table__body"},m.map((function(e){var t=e.value,a=e.name;return r.a.createElement(Mt,{key:a,name:a,value:t})}))))})),Ut=(a(138),function(e){function t(){var e,a;Object(te.a)(this,t);for(var n=arguments.length,l=new Array(n),c=0;c,\n title: 'Dashboard',\n },\n wallet: {\n href: '/wallet',\n icon: ,\n title: 'Wallet',\n },\n};\n\nconst externalRouteList = {\n swaggerInterface: {\n href: constants.swaggerInterface,\n icon: ,\n title: 'Swagger',\n },\n explorer: {\n href: constants.explorer,\n icon: ,\n title: 'Explorer',\n },\n website: {\n href: constants.website,\n icon: ,\n title: 'Website',\n },\n};\n\nconst MenuList = ({ location: { pathname } }) => {\n return (\n
\n

Menu

\n
\n
\n {Object.values(localRouteList).map(({ href, icon, title }, index) => (\n \n {icon} {title}\n \n ))}\n
\n

External links

\n
\n
\n {Object.values(externalRouteList).map(({ href, icon, title }, index) => (\n \n {icon} {title}\n \n ))}\n
\n
\n );\n};\n\nexport default withRouter(MenuList);\n","import { createSelector } from 'redux-starter-kit';\n\nexport const appSelector = (state) => state.app;\n\nexport const apiKeySelector = createSelector(appSelector, (app) => app.apiKey);\n","import { createSelector } from 'redux-starter-kit';\n\nexport const walletSelector = (state) => state.wallet;\n\nexport const isWalletUnlockedSelector = createSelector(\n walletSelector,\n (wallet) => wallet.isWalletUnlocked,\n);\n\nexport const isWalletInitializedSelector = createSelector(\n walletSelector,\n (wallet) => wallet.isWalletInitialized,\n);\n\nexport const walletStatusDataSelector = createSelector(\n walletSelector,\n (wallet) => wallet.walletStatusData,\n);\n\nexport const walletBalanceDataSelector = createSelector(\n walletSelector,\n (wallet) => wallet.walletBalanceData,\n);\n\nexport const walletAddressesSelector = createSelector(\n walletSelector,\n (wallet) => wallet.walletAddresses,\n);\n\nexport const ergPriceSelector = createSelector(walletSelector, (wallet) => wallet.ergPrice);\n","import { createSlice } from 'redux-starter-kit';\n\nconst initialState = {\n isWalletUnlocked: null,\n isWalletInitialized: null,\n walletStatusData: null,\n walletBalanceData: null,\n ergPrice: null,\n walletAddresses: null,\n};\n\nexport default createSlice({\n name: 'walletSlice',\n initialState,\n reducers: {\n setIsWalletUnlocked: (state, { payload }) => {\n state.isWalletUnlocked = payload;\n },\n setIsWalletInitialized: (state, { payload }) => {\n state.isWalletInitialized = payload;\n },\n setWalletStatusData: (state, { payload }) => {\n state.walletStatusData = payload;\n },\n setWalletBalanceData: (state, { payload }) => {\n state.walletBalanceData = payload;\n },\n setErgPrice: (state, { payload }) => {\n state.ergPrice = payload;\n },\n setWalletAddresses: (state, { payload }) => {\n state.walletAddresses = payload;\n },\n },\n});\n","import { createAction } from 'redux-starter-kit';\nimport walletSlice from '../slices/walletSlice';\n\nconst checkWalletStatus = createAction('checkWalletStatus');\nconst getWalletBalance = createAction('getWalletBalance');\nconst getErgPrice = createAction('getErgPrice');\nconst getWalletAddresses = createAction('getWalletAddresses');\n\nexport default {\n ...walletSlice.actions,\n checkWalletStatus,\n getWalletBalance,\n getErgPrice,\n getWalletAddresses,\n};\n","import { createSlice } from 'redux-starter-kit';\n\nconst initialState = {\n apiKey: '',\n};\n\nexport default createSlice({\n name: 'appSlice',\n initialState,\n reducers: {\n setApiKey: (state, action) => {\n state.apiKey = action.payload;\n },\n },\n});\n","import appSlice from '../slices/appSlice';\n\nexport default {\n ...appSlice.actions,\n};\n","const appConfig = () => {\n return {\n nodeApiLink: '/',\n oracleApiLink: 'https://erg-usd-ergo-oracle.emurgo.io',\n };\n};\n\nexport default {\n ...appConfig(),\n};\n","import axios from 'axios';\nimport environment from '../utils/environment';\n\nfunction NetworkError({ status, message, data, statusText }) {\n this.name = 'NetworkError';\n this.message = message || statusText;\n this.status = status;\n this.data = data;\n}\n\nNetworkError.prototype = Object.create(Error.prototype);\n\nconst nodeApi = axios.create({\n baseURL: environment.nodeApiLink,\n timeout: 1000 * 10,\n crossDomain: true,\n headers: {\n 'Content-Type': 'application/json',\n },\n});\n\nnodeApi.interceptors.response.use(\n (response) => Promise.resolve(response),\n (error) => Promise.reject(new NetworkError(error.response || error)),\n);\n\nexport default nodeApi;\n","import { toast } from 'react-toastify';\nimport './index.scss';\n\nconst toastStates = {\n success: (text, options) =>\n toast.success(text, {\n position: 'top-right',\n autoClose: 5000,\n hideProgressBar: false,\n closeOnClick: true,\n pauseOnHover: true,\n draggable: true,\n className: 'n-toast n-toast--success',\n bodyClassName: 'n-toast__body',\n progressClassName: 'n-toast__progress--success',\n ...options,\n }),\n error: (text, options) =>\n toast.error(text, {\n position: 'top-right',\n autoClose: 5000,\n hideProgressBar: false,\n closeOnClick: true,\n pauseOnHover: true,\n draggable: true,\n className: 'n-toast n-toast--error',\n bodyClassName: 'n-toast__body',\n progressClassName: 'n-toast__progress--error',\n ...options,\n }),\n info: toast.info,\n};\n\nexport default (state, text, options) =>\n toastStates[state] ? toastStates[state](text, options) : new Error(`Bad toast state`);\n","import React from 'react';\nimport { Modal } from 'react-bootstrap';\nimport { Formik, Form, Field } from 'formik';\n\nconst renderButton = (apiKey, handleShow) => {\n if (apiKey === '') {\n return (\n \n );\n }\n\n return (\n \n );\n};\n\nconst ApiKeyModalView = ({ showModal, handleHide, submitForm, apiKey, handleShow }) => {\n return (\n
\n {renderButton(apiKey, handleShow)}\n handleHide()} centered>\n \n {() => (\n
\n \n Authorization\n \n \n

Set API key to access Node requests

\n
\n \n
\n
\n\n \n \n \n \n
\n )}\n
\n
\n
\n );\n};\n\nexport default ApiKeyModalView;\n","import ApiKeyModalContainer from './ApiKeyModalContainer';\n\nexport default ApiKeyModalContainer;\n","import React, { memo, useState } from 'react';\nimport { connect } from 'react-redux';\nimport { apiKeySelector } from '../../../store/selectors/app';\nimport appActions from '../../../store/actions/appActions';\nimport nodeApi from '../../../api/api';\nimport customToast from '../../../utils/toast';\nimport ApiKeyModalView from './ApiKeyModalView';\n\nconst mapStateToProps = (state) => ({\n apiKey: apiKeySelector(state),\n});\n\nconst mapDispatchToProps = (dispatch) => ({\n dispatchSetApiKey: (apiKey) => dispatch(appActions.setApiKey(apiKey)),\n});\n\nconst ApiKeyModalContainer = (props) => {\n const { dispatchSetApiKey, apiKey } = props;\n\n const [showModal, setShowModal] = useState(false);\n\n const handleShow = () => {\n setShowModal(true);\n };\n\n const handleHide = () => {\n setShowModal(false);\n };\n\n const submitForm = (values) => {\n // Check API key for random get method\n nodeApi\n .get('/wallet/status', {\n headers: {\n api_key: values.apiKey,\n },\n })\n .then(() => {\n dispatchSetApiKey(values.apiKey.trim());\n customToast('success', 'API key is set successfully');\n handleHide();\n })\n .catch(() => {\n customToast('error', 'Bad API key');\n });\n };\n\n return (\n \n );\n};\n\nexport default connect(mapStateToProps, mapDispatchToProps)(memo(ApiKeyModalContainer));\n","import React, { Component, memo } from 'react';\nimport Modal from 'react-bootstrap/Modal';\nimport { Formik, Field, Form } from 'formik';\nimport { connect } from 'react-redux';\nimport { isWalletUnlockedSelector } from '../../../store/selectors/wallet';\nimport walletActions from '../../../store/actions/walletActions';\nimport { apiKeySelector } from '../../../store/selectors/app';\nimport customToast from '../../../utils/toast';\nimport nodeApi from '../../../api/api';\n\nconst mapStateToProps = (state) => ({\n isWalletUnlocked: isWalletUnlockedSelector(state),\n apiKey: apiKeySelector(state),\n});\n\nconst mapDispatchToProps = (dispatch) => ({\n dispatchSetIsWalletUnlocked: (isWalletUnlock) =>\n dispatch(walletActions.setIsWalletUnlocked(isWalletUnlock)),\n});\n\nclass WalletStatusForm extends Component {\n state = {\n showModal: false,\n };\n\n handleShow = () => {\n this.setState({ showModal: true });\n };\n\n handleHide = () => {\n this.setState({ showModal: false });\n };\n\n walletUnlock = (pass) =>\n nodeApi.post(\n '/wallet/unlock',\n { pass },\n {\n headers: {\n api_key: this.props.apiKey,\n },\n },\n );\n\n walletLock = () =>\n nodeApi.get('/wallet/lock', {\n headers: {\n api_key: this.props.apiKey,\n },\n });\n\n submitWalletUnlockForm = ({ pass }, { setSubmitting, resetForm, setStatus }) => {\n setStatus({ status: 'submitting' });\n this.walletUnlock(pass)\n .then(() => {\n resetForm({ pass: '' });\n customToast('success', 'Your wallet is unlocked successfully');\n this.props.dispatchSetIsWalletUnlocked(true);\n this.handleHide();\n })\n .catch((err) => {\n const errMessage = err.data ? err.data.detail : err.message;\n customToast('error', errMessage);\n setSubmitting(false);\n });\n };\n\n submitWalletLockForm = () => {\n // eslint-disable-next-line\n if (confirm('Are you sure want to lock wallet?')) {\n this.walletLock()\n .then(() => {\n customToast('success', 'Your wallet is locked successfully');\n this.props.dispatchSetIsWalletUnlocked(false);\n })\n .catch((err) => {\n const errMessage = err.data ? err.data.detail : err.message;\n customToast('error', errMessage);\n });\n }\n };\n\n renderButton = () => {\n if (!this.props.isWalletUnlocked) {\n return (\n \n );\n }\n\n return (\n \n );\n };\n\n render() {\n return (\n
\n {this.renderButton()}\n this.handleHide()}\n centered\n aria-labelledby=\"example-custom-modal-styling-title\"\n >\n \n {({ isSubmitting }) => (\n
\n \n \n Unlock wallet form\n \n \n \n
\n \n \n \n * If you have it or leave field empty\n \n
\n
\n\n \n \n Close\n \n \n \n
\n )}\n
\n \n
\n );\n }\n}\nexport default connect(mapStateToProps, mapDispatchToProps)(memo(WalletStatusForm));\n","import React from 'react';\nimport copy from 'clipboard-copy';\nimport { Overlay, Tooltip } from 'react-bootstrap';\n\nclass CopyToClipboard extends React.PureComponent {\n constructor(props) {\n super(props);\n\n this.myRef = React.createRef();\n this.state = { showTooltip: false };\n }\n\n componentWillUnmount() {\n clearTimeout(this.state.timerId);\n }\n\n startTimer = () => {\n const timerId = setTimeout(() => this.setState({ showTooltip: false }), 1500);\n this.setState({ timerId });\n };\n\n onCopy = (e) => {\n e.preventDefault();\n copy(this.props.children);\n this.setState({ showTooltip: true });\n this.startTimer();\n };\n\n handleOnTooltipClose = () => {\n this.setState({ showTooltip: false });\n };\n\n render() {\n return (\n <>\n \n {this.props.children}\n \n \n Copied!\n \n \n );\n }\n}\n\nexport default CopyToClipboard;\n","import React, { Component, memo } from 'react';\nimport { Formik, Field, Form } from 'formik';\nimport nodeApi from '../../../api/api';\nimport CopyToClipboard from '../../common/CopyToClipboard';\nimport customToast from '../../../utils/toast';\n\nconst initialFormValues = {\n walletPassword: '',\n mnemonicPass: '',\n};\n\nclass WalletInitializeForm extends Component {\n state = { isShowMnemonic: false };\n\n walletInit = async ({ walletPassword, mnemonicPass }) => {\n const { data } = await nodeApi.post(\n '/wallet/init',\n { pass: walletPassword, mnemonicPass },\n {\n headers: {\n api_key: this.props.apiKey,\n },\n },\n );\n\n return data;\n };\n\n handleSubmit = (values, { setSubmitting, resetForm, setStatus }) => {\n setStatus({ status: 'submitting' });\n this.walletInit(values)\n .then((result) => {\n resetForm(initialFormValues);\n setStatus({\n state: 'success',\n msg: (\n <>\n Your wallet successfully initialized. Please, save your mnemonic -{' '}\n {result.mnemonic}\n \n ),\n });\n this.setState({ isShowMnemonic: true });\n })\n .catch((err) => {\n const errMessage = err.data ? err.data.detail : err.message;\n customToast('error', errMessage);\n setSubmitting(false);\n });\n };\n\n render() {\n return (\n
\n

Initialize wallet

\n \n {({ status, isSubmitting }) => (\n
\n {status && status.state === 'error' && (\n
\n {status.msg}\n
\n )}\n {status && status.state === 'success' && this.state.isShowMnemonic && (\n
\n this.setState({ isShowMnemonic: false })}\n >\n ×\n \n {status.msg}\n
\n )}\n
\n \n \n
\n
\n \n \n
\n \n
\n )}\n
\n
\n );\n }\n}\n\nexport default memo(WalletInitializeForm);\n","import React, { Component, memo } from 'react';\nimport { Formik, Field, Form } from 'formik';\nimport nodeApi from '../../../api/api';\nimport customToast from '../../../utils/toast';\n\nconst initialFormValues = {\n walletPassword: '',\n mnemonicPass: '',\n mnemonic: '',\n};\n\nclass WalletInitializeForm extends Component {\n walletRestore = async ({ walletPassword, mnemonicPass = '', mnemonic = '' }) => {\n if (!mnemonic || !String(mnemonic).trim()) {\n throw Error('Need to set mnemonic');\n }\n\n return nodeApi.post(\n '/wallet/restore',\n { pass: walletPassword, mnemonicPass, mnemonic },\n {\n headers: {\n api_key: this.props.apiKey,\n },\n },\n );\n };\n\n handleSubmit = (values, { setSubmitting, resetForm, setStatus }) => {\n setStatus({ status: 'submitting' });\n this.walletRestore(values)\n .then(() => {\n resetForm(initialFormValues);\n customToast('success', 'Your wallet successfully re-stored');\n })\n .catch((err) => {\n const errMessage = err.data ? err.data.detail : err.message;\n customToast('error', errMessage);\n setSubmitting(false);\n });\n };\n\n render() {\n return (\n
\n

Re-store wallet

\n \n {({ status, isSubmitting }) => (\n
\n {status && status.state === 'error' && (\n
\n {status.msg}\n
\n )}\n {status && status.state === 'success' && (\n
{status.msg}
\n )}\n
\n \n \n
\n
\n \n \n
\n
\n \n \n
\n \n
\n )}\n
\n
\n );\n }\n}\n\nexport default memo(WalletInitializeForm);\n","import React, { Component, memo } from 'react';\nimport Modal from 'react-bootstrap/Modal';\nimport { connect } from 'react-redux';\nimport { apiKeySelector } from '../../../store/selectors/app';\nimport appActions from '../../../store/actions/appActions';\nimport WalletInitializeForm from '../../elements/WalletInitializeForm';\nimport RestoreWalletForm from '../../elements/RestoreWalletForm';\nimport walletActions from '../../../store/actions/walletActions';\n\nconst mapStateToProps = (state) => ({\n apiKey: apiKeySelector(state),\n});\n\nconst mapDispatchToProps = (dispatch) => ({\n dispatchCheckWalletStatus: () => dispatch(walletActions.checkWalletStatus()),\n dispatchSetApiKey: (apiKey) => dispatch(appActions.setApiKey(apiKey)),\n});\n\nclass WalletInitModal extends Component {\n state = {\n showModal: false,\n };\n\n handleShow = () => {\n this.setState({ showModal: true });\n };\n\n handleHide = () => {\n this.props.dispatchCheckWalletStatus();\n this.setState({ showModal: false });\n };\n\n renderButton = () => {\n return (\n \n );\n };\n\n render() {\n const { apiKey } = this.props;\n\n return (\n
\n {this.renderButton()}\n this.handleHide()} centered size=\"lg\">\n \n Wallet initialization\n \n \n
\n \n
\n
\n \n
\n
\n \n \n \n
\n
\n );\n }\n}\nexport default connect(mapStateToProps, mapDispatchToProps)(memo(WalletInitModal));\n","import React, { memo } from 'react';\nimport { Navbar } from 'react-bootstrap';\nimport { Link } from 'react-router-dom';\nimport ApiKeyModal from './ApiKeyModal';\nimport WalletStatusModal from './WalletStatusModal';\nimport WalletInitModal from './WalletInitModal';\nimport logo from '../../assets/images/logotype_white.svg';\n\nconst renderWalletForms = (isWalletInitialized) => {\n if (isWalletInitialized === null) {\n return <>;\n }\n\n if (isWalletInitialized) {\n return (\n
\n \n
\n );\n }\n\n return (\n
\n \n
\n );\n};\n\nconst HeaderView = ({ isApiKeySetted, isWalletInitialized }) => {\n return (\n \n \n \n \"logotype\"\n \n \n
\n \n
\n {isApiKeySetted && renderWalletForms(isWalletInitialized)}\n
\n );\n};\n\nexport default memo(HeaderView);\n","import HeaderContainer from './HeaderContainer';\n\nexport default HeaderContainer;\n","import React, { memo, useEffect } from 'react';\nimport { connect } from 'react-redux';\nimport { apiKeySelector } from '../../store/selectors/app';\nimport { isWalletInitializedSelector } from '../../store/selectors/wallet';\nimport walletActions from '../../store/actions/walletActions';\nimport HeaderView from './HeaderView';\n\nconst mapStateToProps = (state) => ({\n apiKey: apiKeySelector(state),\n isWalletInitialized: isWalletInitializedSelector(state),\n});\n\nconst mapDispatchToProps = (dispatch) => ({\n dispatchCheckWalletStatus: () => dispatch(walletActions.checkWalletStatus()),\n});\n\nconst HeaderContainer = (props) => {\n const { apiKey, dispatchCheckWalletStatus, isWalletInitialized } = props;\n\n useEffect(() => {\n if (apiKey !== '') {\n dispatchCheckWalletStatus();\n }\n }, [apiKey, dispatchCheckWalletStatus]);\n\n const isApiKeySetted = apiKey !== '';\n\n return ;\n};\n\nexport default connect(mapStateToProps, mapDispatchToProps)(memo(HeaderContainer));\n","import React from 'react';\nimport { withRouter } from 'react-router-dom';\nimport MenuList from '../common/MenuList';\nimport './index.scss';\nimport Header from '../Header';\n\nexport const Layout = withRouter((props) => {\n return (\n
\n
\n
\n \n
\n
\n
{props.children}
\n
\n
\n );\n});\n","import React from 'react';\nimport clsx from 'clsx';\nimport './index.scss';\n\nconst InfoCard = ({ color, children, className }) => {\n return (\n \n {children}\n \n );\n};\n\nexport default InfoCard;\n","import React, { Component } from 'react';\nimport { FontAwesomeIcon } from '@fortawesome/react-fontawesome';\nimport { faSync, faCheck } from '@fortawesome/free-solid-svg-icons';\nimport InfoCard from '../InfoCard';\n\nexport default class SynchCard extends Component {\n shouldComponentUpdate(nextProps) {\n if (\n this.getSynchronizationState(nextProps) !== this.getSynchronizationState(this.props.nodeInfo)\n ) {\n return true;\n }\n\n return false;\n }\n\n renderActiveSynchronization = () => (\n <>\n

Synchronization state

\n

\n Active synchronization\n

\n \n );\n\n renderCompleteSynchronization = () => (\n <>\n

Synchronization state

\n

\n Node is synced\n

\n \n );\n\n renderSynchronizationState = (state) =>\n ({\n active: this.renderActiveSynchronization,\n complete: this.renderCompleteSynchronization,\n }[state]);\n\n getSynchronizationState = ({ fullHeight, headersHeight }) => {\n if (fullHeight !== null && headersHeight !== null && fullHeight === headersHeight) {\n return 'complete';\n }\n\n return 'active';\n };\n\n render() {\n const currentSynchState = this.getSynchronizationState(this.props.nodeInfo);\n return (\n \n {this.renderSynchronizationState(currentSynchState)()}\n \n );\n }\n}\n","import React, { Component } from 'react';\nimport { FontAwesomeIcon } from '@fortawesome/react-fontawesome';\nimport { faSync, faCheck } from '@fortawesome/free-solid-svg-icons';\nimport InfoCard from '../InfoCard';\n\nexport default class WalletSyncCard extends Component {\n renderActiveSynchronization = () => (\n <>\n

Synchronization state

\n

\n Active synchronization\n

\n \n );\n\n renderCompleteSynchronization = () => (\n <>\n

Synchronization state

\n

\n Wallet is synced\n

\n \n );\n\n renderSynchronizationState = (state) =>\n ({\n active: this.renderActiveSynchronization,\n complete: this.renderCompleteSynchronization,\n }[state]);\n\n getSynchronizationState = (walletStatusData, headersHeight) => {\n if (\n walletStatusData.walletHeight !== null &&\n headersHeight !== null &&\n walletStatusData.walletHeight === headersHeight\n ) {\n return 'complete';\n }\n\n return 'active';\n };\n\n render() {\n const { walletStatusData, headersHeight } = this.props;\n const currentSynchState = this.getSynchronizationState(walletStatusData, headersHeight);\n return (\n \n {this.renderSynchronizationState(currentSynchState)()}\n \n );\n }\n}\n","import React from 'react';\nimport './index.scss';\n\nconst LoaderLogo = () => {\n return (\n
\n \n \n \n \n
\n );\n};\n\nexport default LoaderLogo;\n","import React from 'react';\nimport { faExclamationTriangle } from '@fortawesome/free-solid-svg-icons';\nimport { FontAwesomeIcon } from '@fortawesome/react-fontawesome';\nimport { format } from 'date-fns';\nimport constants from 'utils/constants';\nimport InfoCard from './InfoCard';\nimport SynchCard from './SynchCard';\nimport WalletSyncCard from './WalletSyncCard';\nimport LoaderLogo from '../../common/ErgoLoader/index';\n\nconst getWalletStatus = (isWalletInitialized) => {\n if (!isWalletInitialized) {\n return 'Not initialized';\n }\n\n return 'Initialized';\n};\n\nconst DashboardView = ({\n error,\n nodeInfo,\n isWalletInitialized,\n walletStatusData,\n walletBalanceData,\n ergPrice,\n}) => {\n if (error !== null) {\n return (\n <>\n
\n

\n \n  \n {error}\n

\n
\n \n );\n }\n\n if (nodeInfo === null) {\n return (\n <>\n
\n \n
\n \n );\n }\n\n const { peersCount, bestHeaderId, launchTime, fullHeight, appVersion, isMining } = nodeInfo;\n\n return (\n <>\n
\n

Node Information

\n
\n
\n \n

Version

\n

{appVersion}

\n
\n
\n
\n \n
\n
\n \n

Started at

\n

\n {format(new Date(launchTime), 'MM-dd-yyyy HH:mm:ss')}\n

\n
\n
\n {fullHeight === null ? null : (\n
\n \n

Current height

\n

{fullHeight}

\n
\n
\n )}\n {bestHeaderId === null ? null : (\n
\n \n

Best block id

\n

{bestHeaderId}

\n
\n
\n )}\n
\n \n

Mining enabled

\n

{isMining ? 'Yes' : 'No'}

\n
\n
\n
\n \n

Peers connected

\n

{peersCount}

\n
\n
\n
\n
\n {ergPrice && (\n
\n

ERG Information

\n
\n
\n \n

\n ERG price in $
\n (based on oracle pool data)\n

\n

{ergPrice}

\n
\n
\n
\n
\n )}\n {walletStatusData && (\n
\n

Wallet Information

\n
\n
\n \n

Initialization state

\n

{getWalletStatus(isWalletInitialized)}

\n
\n
\n
\n \n

Lock state

\n

\n {walletStatusData.isUnlocked ? 'Unlocked' : 'Locked'}\n

\n
\n
\n
\n \n
\n {walletBalanceData && (\n
\n \n

Balance

\n

\n {walletBalanceData.balance / constants.nanoErgInErg} ERG{' '}\n {ergPrice &&\n `~ $${Number(\n ergPrice * (walletBalanceData.balance / constants.nanoErgInErg),\n ).toFixed(2)}`}\n

\n
\n
\n )}\n {walletBalanceData && (\n
\n \n

Assets

\n

\n {Object.values(walletBalanceData.assets).length || '0'}\n

\n
\n
\n )}\n
\n
\n )}\n \n );\n};\n\nexport default DashboardView;\n","import { useEffect, useRef } from 'react';\n\nfunction usePrevious(value) {\n // The ref object is a generic container whose current property is mutable ...\n // ... and can hold any value, similar to an instance property on a class\n const ref = useRef();\n\n // Store current value in ref\n useEffect(() => {\n ref.current = value;\n }, [value]); // Only re-run if value changes\n\n // Return previous value (happens before update in useEffect above)\n return ref.current;\n}\n\nexport default usePrevious;\n","import React, { useState, useEffect, useCallback, memo } from 'react';\nimport { connect } from 'react-redux';\nimport nodeApi from '../../../api/api';\nimport DashboardView from './DashboardView';\nimport {\n isWalletInitializedSelector,\n isWalletUnlockedSelector,\n walletStatusDataSelector,\n walletBalanceDataSelector,\n ergPriceSelector,\n} from '../../../store/selectors/wallet';\nimport { apiKeySelector } from '../../../store/selectors/app';\nimport usePrevious from '../../../hooks/usePrevious';\nimport walletActions from '../../../store/actions/walletActions';\n\nconst mapStateToProps = (state) => ({\n apiKey: apiKeySelector(state),\n isWalletInitialized: isWalletInitializedSelector(state),\n isWalletUnlocked: isWalletUnlockedSelector(state),\n walletStatusData: walletStatusDataSelector(state),\n walletBalanceData: walletBalanceDataSelector(state),\n ergPrice: ergPriceSelector(state),\n});\n\nconst mapDispatchToProps = (dispatch) => ({\n dispatchCheckWalletStatus: () => dispatch(walletActions.checkWalletStatus()),\n dispatchGetWalletBalance: () => dispatch(walletActions.getWalletBalance()),\n dispatchGetErgPrice: () => dispatch(walletActions.getErgPrice()),\n});\n\nconst DashboardContainer = (props) => {\n const {\n isWalletInitialized,\n isWalletUnlocked,\n apiKey,\n dispatchCheckWalletStatus,\n dispatchGetWalletBalance,\n dispatchGetErgPrice,\n walletStatusData,\n walletBalanceData,\n ergPrice,\n } = props;\n\n const [nodeInfo, setNodeInfo] = useState(null);\n const [error, setError] = useState(null);\n const [timerId, setTimerId] = useState(null);\n\n const getNodeCurrentState = () => nodeApi.get('/info');\n\n const setNodeCurrentState = useCallback(async () => {\n try {\n const { data } = await getNodeCurrentState();\n\n setNodeInfo(data);\n setError(null);\n } catch {\n setError('Node connection is lost.');\n }\n }, []);\n\n const setTimer = useCallback(() => {\n const newTimerId = setInterval(() => {\n setNodeCurrentState();\n dispatchGetErgPrice();\n\n if (apiKey) {\n dispatchCheckWalletStatus();\n dispatchGetWalletBalance();\n }\n }, 2000);\n\n setTimerId(newTimerId);\n }, [\n apiKey,\n dispatchCheckWalletStatus,\n dispatchGetErgPrice,\n dispatchGetWalletBalance,\n setNodeCurrentState,\n ]);\n\n const prevError = usePrevious(error);\n useEffect(() => {\n if (prevError && prevError !== error) {\n dispatchCheckWalletStatus();\n dispatchGetWalletBalance();\n dispatchGetErgPrice();\n }\n }, [dispatchCheckWalletStatus, dispatchGetErgPrice, dispatchGetWalletBalance, error, prevError]);\n\n useEffect(() => {\n setNodeCurrentState();\n dispatchGetErgPrice();\n\n if (apiKey) {\n dispatchCheckWalletStatus();\n dispatchGetWalletBalance();\n }\n\n setTimer();\n // eslint-disable-next-line\n }, [apiKey]);\n\n useEffect(\n () => () => {\n clearInterval(timerId);\n },\n [timerId, apiKey],\n );\n\n return (\n \n );\n};\n\nexport default connect(mapStateToProps, mapDispatchToProps)(memo(DashboardContainer));\n","import DashboardContainer from './DashboardContainer';\nimport './index.scss';\n\nexport default DashboardContainer;\n","import { useEffect, useState } from 'react';\n\nconst isBrowser = (): boolean => {\n return Boolean(typeof window !== 'undefined' && window.document && window.document.createElement);\n};\n\ntype SSRState = {\n isBrowser: boolean;\n isServer: boolean;\n};\n\nconst useSSR = (): SSRState => {\n const [browser, setBrowser] = useState(false);\n useEffect(() => {\n setBrowser(isBrowser());\n }, []);\n\n return {\n isBrowser: browser,\n isServer: !browser,\n };\n};\n\nconst createElement = (id: string): HTMLElement => {\n const el = document.createElement('div');\n el.setAttribute('id', id);\n return el;\n};\n\nconst usePortal = (\n selectId: string = Math.random().toString(32).slice(2, 10),\n): HTMLElement | null => {\n const id = `id-${selectId}`;\n const isUsingBrowser = useSSR().isBrowser;\n const [elSnapshot, setElSnapshot] = useState(\n isUsingBrowser ? createElement(id) : null,\n );\n\n useEffect(() => {\n const hasElement = document.querySelector(`#${id}`);\n const el = hasElement || createElement(id);\n\n if (!hasElement) {\n document.body.appendChild(el);\n }\n setElSnapshot(el);\n }, []);\n\n return elSnapshot;\n};\n\nexport default usePortal;\n","import { Dispatch, RefObject, SetStateAction, useEffect, useRef, useState } from 'react';\n/* eslint-disable */\nexport type ElementStackItem = {\n last: string;\n};\n\nexport type BodyScrollOptions = {\n scrollLayer: boolean;\n};\n\nconst defaultOptions: BodyScrollOptions = {\n scrollLayer: false,\n};\n\nconst elementStack = new Map();\n\nconst isIos = () => {\n /* istanbul ignore next */\n if (typeof window === 'undefined' || !window.navigator) return false;\n return /iP(ad|hone|od)/.test(window.navigator.platform);\n};\n\nconst touchHandler = (event: TouchEvent): boolean => {\n if (event.touches && event.touches.length > 1) return true;\n event.preventDefault();\n return false;\n};\n\nconst useBodyScroll = (\n elementRef?: RefObject | null,\n options?: BodyScrollOptions\n): [boolean, Dispatch>] => {\n if (typeof document === 'undefined')\n return [false, (t: SetStateAction) => t];\n const elRef = elementRef || useRef(document.body);\n const [hidden, setHidden] = useState(false);\n const safeOptions = {\n ...defaultOptions,\n ...(options || {}),\n };\n\n // don't prevent touch event when layer contain scroll\n const isIosWithCustom = () => {\n if (safeOptions.scrollLayer) return false;\n return isIos();\n };\n\n useEffect(() => {\n if (!elRef || !elRef.current) return;\n const lastOverflow = elRef.current.style.overflow;\n if (hidden) {\n if (elementStack.has(elRef.current)) return;\n if (!isIosWithCustom()) {\n elRef.current.style.overflow = 'hidden';\n } else {\n document.addEventListener('touchmove', touchHandler, {\n passive: false,\n });\n }\n elementStack.set(elRef.current, {\n last: lastOverflow,\n });\n return;\n }\n\n // reset element overflow\n if (!elementStack.has(elRef.current)) return;\n if (!isIosWithCustom()) {\n const store = elementStack.get(elRef.current) as ElementStackItem;\n elRef.current.style.overflow = store.last;\n } else {\n document.removeEventListener('touchmove', touchHandler);\n }\n elementStack.delete(elRef.current);\n }, [hidden, elRef]);\n\n return [hidden, setHidden];\n};\n\nexport default useBodyScroll;\n\n/* eslint-disable */\n","import { Dispatch, MutableRefObject, SetStateAction, useEffect, useRef, useState } from 'react';\n\nexport type CurrentStateType = [S, Dispatch>, MutableRefObject];\n\n// Добавляет ref, по которому текущее значение стейта можно получить\n// сразу вместо того чтобы ждать следующего рендера\nconst useCurrentState = (initialState: S | (() => S)): CurrentStateType => {\n const [state, setState] = useState(() => {\n return typeof initialState === 'function' ? (initialState as () => S)() : initialState;\n });\n const ref = useRef(initialState as S);\n\n useEffect(() => {\n ref.current = state;\n }, [state]);\n\n const setValue = (val: SetStateAction) => {\n const result = typeof val === 'function' ? (val as (prevState: S) => S)(ref.current) : val;\n ref.current = result;\n setState(result);\n };\n\n return [state, setValue, ref];\n};\n\nexport default useCurrentState;\n","import React, { ReactNode } from 'react';\nimport cn from 'classnames';\n\ntype TextVariant =\n | 'h1'\n | 'h2'\n | 'h3'\n | 'h4'\n | 'h5'\n | 'h6'\n | 'subtitle1'\n | 'subtitle2'\n | 'body-text1'\n | 'body-text2'\n | 'small-text1'\n | 'small-text2'\n | 'small-text3';\n\nexport type TextColor =\n | 'brandOrange'\n | 'purple'\n | 'black'\n | 'spaceGray'\n | 'gray5'\n | 'gray4'\n | 'gray3'\n | 'gray2'\n | 'gray1'\n | 'white'\n | 'orange'\n | 'red'\n | 'green'\n | 'blue'\n | 'blueHover'\n | 'brandOrangeHover'\n | 'brandOrangeActive'\n | 'purpleHover'\n | 'purpleActive';\n\nexport type TextComponent = 'span' | 'p' | 'div' | 'h1' | 'label' | 'h2' | 'h3';\n\ninterface IText {\n children?: ReactNode;\n variant?: TextVariant;\n xl?: TextVariant;\n lg?: TextVariant;\n md?: TextVariant;\n sm?: TextVariant;\n component?: TextComponent;\n color?: TextColor;\n className?: string;\n dangerouslySetInnerHTML?: any;\n htmlFor?: string;\n}\n\nconst Text = ({\n children,\n variant,\n component,\n color,\n className,\n dangerouslySetInnerHTML,\n ...props\n}: IText) => {\n const currentVariant = variant;\n\n const Component = component || 'p';\n\n if (dangerouslySetInnerHTML) {\n return (\n <>\n \n\n \n \n );\n }\n\n return (\n \n {children}\n \n \n );\n};\n\nexport default Text;\n","import React from 'react';\n\n// Прокидывает default параметры в компонент\nconst withDefaults = (component: React.ComponentType

, defaultProps: DP) => {\n type Props = Partial & Omit;\n // eslint-disable-next-line\n component.defaultProps = defaultProps;\n return component as React.ComponentType;\n};\n\nexport default withDefaults;\n","import React, { useEffect, useState } from 'react';\nimport withDefaults from 'utils/withDefaults';\n\ninterface Props {\n visible?: boolean;\n enterTime?: number;\n leaveTime?: number;\n clearTime?: number;\n className?: string;\n name?: string;\n}\n\nconst defaultProps = {\n visible: false,\n enterTime: 60,\n leaveTime: 60,\n clearTime: 60,\n className: '',\n name: 'transition',\n};\n\nexport type CSSTransitionProps = Props & typeof defaultProps;\n\nconst CSSTransition: React.FC> = ({\n children,\n className,\n visible,\n enterTime,\n leaveTime,\n clearTime,\n name,\n ...props\n}) => {\n const [classes, setClasses] = useState('');\n const [renderable, setRenderable] = useState(visible);\n\n useEffect(() => {\n const statusClassName = visible ? 'enter' : 'leave';\n const time = visible ? enterTime : leaveTime;\n if (visible && !renderable) {\n setRenderable(true);\n }\n\n setClasses(`${name}-${statusClassName}`);\n\n // set class to active\n const timer = setTimeout(() => {\n setClasses(`${name}-${statusClassName} ${name}-${statusClassName}-active`);\n clearTimeout(timer);\n }, time);\n\n // remove classess when animation over\n const clearClassesTimer = setTimeout(() => {\n if (!visible) {\n setClasses('');\n setRenderable(false);\n }\n clearTimeout(clearClassesTimer);\n }, time + clearTime);\n\n return () => {\n clearTimeout(timer);\n clearTimeout(clearClassesTimer);\n };\n }, [visible, renderable]);\n if (!React.isValidElement(children) || !renderable) return null;\n\n return React.cloneElement(children, {\n ...props,\n className: `${children.props.className} ${className} ${classes}`,\n });\n};\n\nexport default withDefaults(CSSTransition, defaultProps);\n","import React, { MouseEvent, useCallback, ReactElement } from 'react';\nimport withDefaults from 'utils/withDefaults';\nimport useCurrentState from 'hooks/useCurrentState';\nimport cn from 'classnames';\nimport CssTransition from '../CssTransition/CssTransition';\nimport styles from './Backdrop.module.scss';\n\ninterface Props {\n onClick?: (event: MouseEvent) => void;\n visible?: boolean;\n children?: ReactElement;\n className?: string;\n}\n\nconst defaultProps = {\n onClick: () => {},\n visible: false,\n};\n\nexport type BackdropProps = Props & typeof defaultProps;\n\nconst Backdrop: React.FC> = React.memo(\n ({ children, onClick, visible, className }: BackdropProps) => {\n const [, setIsContentMouseDown, IsContentMouseDownRef] = useCurrentState(false);\n const clickHandler = (event: MouseEvent) => {\n if (IsContentMouseDownRef.current) return;\n if (onClick) {\n onClick(event);\n }\n };\n const childrenClickHandler = useCallback((event: MouseEvent) => {\n event.stopPropagation();\n }, []);\n const mouseUpHandler = () => {\n if (!IsContentMouseDownRef.current) return;\n const timer = setTimeout(() => {\n setIsContentMouseDown(false);\n clearTimeout(timer);\n }, 0);\n };\n\n return (\n \n

\n
\n setIsContentMouseDown(true)}\n >\n {children}\n
\n
\n \n );\n },\n);\n\nexport default withDefaults(Backdrop, defaultProps);\n","import React from 'react';\n\nexport interface ModalConfig {\n close?: () => void;\n}\n\nconst defaultContext = {};\n\nexport const ModalContext = React.createContext(defaultContext);\n\nexport const useModalContext = (): ModalConfig => React.useContext(ModalContext);\n","function _extends() { _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }\n\nfunction _objectWithoutProperties(source, excluded) { if (source == null) return {}; var target = _objectWithoutPropertiesLoose(source, excluded); var key, i; if (Object.getOwnPropertySymbols) { var sourceSymbolKeys = Object.getOwnPropertySymbols(source); for (i = 0; i < sourceSymbolKeys.length; i++) { key = sourceSymbolKeys[i]; if (excluded.indexOf(key) >= 0) continue; if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue; target[key] = source[key]; } } return target; }\n\nfunction _objectWithoutPropertiesLoose(source, excluded) { if (source == null) return {}; var target = {}; var sourceKeys = Object.keys(source); var key, i; for (i = 0; i < sourceKeys.length; i++) { key = sourceKeys[i]; if (excluded.indexOf(key) >= 0) continue; target[key] = source[key]; } return target; }\n\nimport React from \"react\";\n\nvar _ref2 = /*#__PURE__*/React.createElement(\"path\", {\n d: \"M10.7951 9.30799C10.3844 8.89734 9.71865 8.89734 9.30799 9.30799C8.89734 9.71865 8.89734 10.3844 9.30799 10.7951L14.5129 16L9.30799 21.2049C8.89734 21.6156 8.89734 22.2814 9.30799 22.692C9.71865 23.1027 10.3844 23.1027 10.7951 22.692L16 17.4871L21.2049 22.692C21.6156 23.1027 22.2814 23.1027 22.692 22.692C23.1027 22.2814 23.1027 21.6156 22.692 21.2049L17.4871 16L22.692 10.7951C23.1027 10.3844 23.1027 9.71865 22.692 9.30799C22.2814 8.89734 21.6156 8.89734 21.2049 9.30799L16 14.5129L10.7951 9.30799Z\",\n fill: \"#76767A\"\n});\n\nvar SvgClose = function SvgClose(_ref) {\n var svgRef = _ref.svgRef,\n title = _ref.title,\n props = _objectWithoutProperties(_ref, [\"svgRef\", \"title\"]);\n\n return /*#__PURE__*/React.createElement(\"svg\", _extends({\n width: 32,\n height: 32,\n viewBox: \"0 0 32 32\",\n fill: \"none\",\n ref: svgRef\n }, props), title ? /*#__PURE__*/React.createElement(\"title\", null, title) : null, _ref2);\n};\n\nvar ForwardRef = /*#__PURE__*/React.forwardRef(function (props, ref) {\n return /*#__PURE__*/React.createElement(SvgClose, _extends({\n svgRef: ref\n }, props));\n});\nexport default __webpack_public_path__ + \"static/media/close.feae5a5c.svg\";\nexport { ForwardRef as ReactComponent };","function _extends() { _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }\n\nfunction _objectWithoutProperties(source, excluded) { if (source == null) return {}; var target = _objectWithoutPropertiesLoose(source, excluded); var key, i; if (Object.getOwnPropertySymbols) { var sourceSymbolKeys = Object.getOwnPropertySymbols(source); for (i = 0; i < sourceSymbolKeys.length; i++) { key = sourceSymbolKeys[i]; if (excluded.indexOf(key) >= 0) continue; if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue; target[key] = source[key]; } } return target; }\n\nfunction _objectWithoutPropertiesLoose(source, excluded) { if (source == null) return {}; var target = {}; var sourceKeys = Object.keys(source); var key, i; for (i = 0; i < sourceKeys.length; i++) { key = sourceKeys[i]; if (excluded.indexOf(key) >= 0) continue; target[key] = source[key]; } return target; }\n\nimport React from \"react\";\n\nvar _ref2 = /*#__PURE__*/React.createElement(\"path\", {\n d: \"M10.6668 0.666748H2.66683C1.9335 0.666748 1.3335 1.26675 1.3335 2.00008V11.3334H2.66683V2.00008H10.6668V0.666748ZM10.0002 3.33341L14.0002 7.33341V14.0001C14.0002 14.7334 13.4002 15.3334 12.6668 15.3334H5.32683C4.5935 15.3334 4.00016 14.7334 4.00016 14.0001L4.00683 4.66675C4.00683 3.93341 4.60016 3.33341 5.3335 3.33341H10.0002ZM9.3335 8.00008H13.0002L9.3335 4.33341V8.00008Z\",\n fill: \"#0078FF\"\n});\n\nvar SvgCopyicon = function SvgCopyicon(_ref) {\n var svgRef = _ref.svgRef,\n title = _ref.title,\n props = _objectWithoutProperties(_ref, [\"svgRef\", \"title\"]);\n\n return /*#__PURE__*/React.createElement(\"svg\", _extends({\n width: 16,\n height: 16,\n viewBox: \"0 0 16 16\",\n fill: \"none\",\n ref: svgRef\n }, props), title ? /*#__PURE__*/React.createElement(\"title\", null, title) : null, _ref2);\n};\n\nvar ForwardRef = /*#__PURE__*/React.forwardRef(function (props, ref) {\n return /*#__PURE__*/React.createElement(SvgCopyicon, _extends({\n svgRef: ref\n }, props));\n});\nexport default __webpack_public_path__ + \"static/media/copy.icon.835ebda7.svg\";\nexport { ForwardRef as ReactComponent };","function _extends() { _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }\n\nfunction _objectWithoutProperties(source, excluded) { if (source == null) return {}; var target = _objectWithoutPropertiesLoose(source, excluded); var key, i; if (Object.getOwnPropertySymbols) { var sourceSymbolKeys = Object.getOwnPropertySymbols(source); for (i = 0; i < sourceSymbolKeys.length; i++) { key = sourceSymbolKeys[i]; if (excluded.indexOf(key) >= 0) continue; if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue; target[key] = source[key]; } } return target; }\n\nfunction _objectWithoutPropertiesLoose(source, excluded) { if (source == null) return {}; var target = {}; var sourceKeys = Object.keys(source); var key, i; for (i = 0; i < sourceKeys.length; i++) { key = sourceKeys[i]; if (excluded.indexOf(key) >= 0) continue; target[key] = source[key]; } return target; }\n\nimport React from \"react\";\n\nvar _ref2 = /*#__PURE__*/React.createElement(\"path\", {\n d: \"M13.3332 7.99992C13.3332 8.36811 13.0347 8.66659 12.6665 8.66659H3.33317C2.96498 8.66659 2.6665 8.36811 2.6665 7.99992C2.6665 7.63173 2.96498 7.33325 3.33317 7.33325H12.6665C13.0347 7.33325 13.3332 7.63173 13.3332 7.99992Z\",\n fill: \"#0078FF\"\n});\n\nvar SvgRemove = function SvgRemove(_ref) {\n var svgRef = _ref.svgRef,\n title = _ref.title,\n props = _objectWithoutProperties(_ref, [\"svgRef\", \"title\"]);\n\n return /*#__PURE__*/React.createElement(\"svg\", _extends({\n width: 16,\n height: 16,\n viewBox: \"0 0 16 16\",\n fill: \"none\",\n ref: svgRef\n }, props), title ? /*#__PURE__*/React.createElement(\"title\", null, title) : null, _ref2);\n};\n\nvar ForwardRef = /*#__PURE__*/React.forwardRef(function (props, ref) {\n return /*#__PURE__*/React.createElement(SvgRemove, _extends({\n svgRef: ref\n }, props));\n});\nexport default __webpack_public_path__ + \"static/media/remove.94c0849a.svg\";\nexport { ForwardRef as ReactComponent };","import React from 'react';\n\nimport { ReactComponent as copyIcon } from '../../../assets/images/icons/copy.icon.svg';\nimport { ReactComponent as removeIcon } from '../../../assets/images/icons/remove.svg';\n\nexport interface IconProps {\n className?: string;\n}\n\nexport const makeIcon = (Icon: any, className?: string) => {\n return ;\n};\n\nexport const CopyIcon = ({ className }: IconProps) => {\n return makeIcon(copyIcon, className);\n};\n\nexport const RemoveIcon = ({ className }: IconProps) => {\n return makeIcon(removeIcon, className);\n};\n","import { ReactComponent as closeImage } from 'assets/images/icons/close.svg';\nimport { makeIcon, IconProps } from './icons';\n\nexport const CloseIcon = ({ className }: IconProps) => {\n return makeIcon(closeImage, className);\n};\n","import React, { useEffect, useMemo, useCallback } from 'react';\nimport { createPortal } from 'react-dom';\nimport usePortal from 'hooks/usePortal';\nimport useBodyScroll from 'hooks/useBodyScroll';\nimport useCurrentState from 'hooks/useCurrentState';\nimport Text from 'components/common/Text/Text';\nimport Backdrop from '../Backdrop/Backdrop';\nimport { ModalConfig, ModalContext } from './modal-context';\nimport CssTransition from '../CssTransition/CssTransition';\nimport { CloseIcon } from '../icons/CloseIcon';\n\ninterface Props {\n title?: React.ReactNode;\n description?: React.ReactNode;\n primaryButtonContent: React.ReactNode;\n secondaryButtonContent: React.ReactNode;\n disableBackdropClick?: boolean;\n onClose?: () => void;\n onOpen?: () => void;\n onPrimaryHandler?: () => void;\n onSecondaryHandler?: () => void;\n open?: boolean;\n width?: string;\n wrapClassName?: string;\n}\n\nconst defaultProps = {\n width: '26rem',\n wrapClassName: '',\n disableBackdropClick: false,\n};\n\ntype NativeAttrs = Omit, keyof Props>;\nexport type ModalProps = Props & typeof defaultProps & NativeAttrs;\n\nconst InfoModal: React.FC> = ({\n title,\n description,\n primaryButtonContent,\n secondaryButtonContent,\n disableBackdropClick,\n onClose,\n onOpen,\n onPrimaryHandler,\n onSecondaryHandler,\n open,\n}) => {\n const portal = usePortal('modal');\n const [, setBodyHidden] = useBodyScroll(null, { scrollLayer: true });\n const [visible, setVisible, visibleRef] = useCurrentState(false);\n\n const closeModal = useCallback(() => {\n if (onClose) {\n onClose();\n }\n setVisible(false);\n setBodyHidden(false);\n }, [onClose, setVisible, setBodyHidden]);\n\n useEffect(() => {\n if (open === undefined) return;\n if (open && onOpen) {\n onOpen();\n }\n if (!open && visibleRef.current && onClose) {\n onClose();\n }\n\n setVisible(open);\n setBodyHidden(open);\n }, [open]);\n\n const closeFromBackdrop = () => {\n if (disableBackdropClick) return;\n closeModal();\n };\n\n const primaryButtonClickHandler = () => {\n if (onPrimaryHandler) {\n onPrimaryHandler();\n }\n if (onClose) {\n onClose();\n }\n };\n\n const secondaryButtonClickHandler = () => {\n if (onSecondaryHandler) {\n onSecondaryHandler();\n }\n if (onClose) {\n onClose();\n }\n };\n\n const modalConfig: ModalConfig = useMemo(\n () => ({\n close: closeModal,\n }),\n [closeModal],\n );\n\n if (!portal) return null;\n\n return createPortal(\n \n \n \n
\n
\n

{title}

\n \n {description}\n \n \n {primaryButtonContent}\n \n \n {secondaryButtonContent}\n \n
\n \n\n \n
\n
\n
\n
,\n portal,\n );\n};\n\ntype ModalComponent

= React.FC

;\ntype ComponentProps = Partial &\n Omit &\n NativeAttrs;\n\nInfoModal.defaultProps = defaultProps;\n\nexport default InfoModal as ModalComponent;\n","import React, { useState, useCallback } from 'react';\nimport { Form, Field } from 'react-final-form';\nimport InfoModal from 'components/common/InfoModal/InfoModal';\nimport cn from 'classnames';\nimport nodeApi from '../../../../../api/api';\nimport customToast from '../../../../../utils/toast';\nimport CopyToClipboard from '../../../../common/CopyToClipboard';\nimport constants from '../../../../../utils/constants';\n\ntype Errors = {\n recipientAddress?: string;\n amount?: string;\n};\n\nconst PaymentSendForm = ({ apiKey }: { apiKey: string }) => {\n const [transactionId, setTransactionId] = useState(null);\n const [isSendedModalOpen, setIsSendedModalOpen] = useState(false);\n\n const paymentSend = useCallback(\n ({ recipientAddress, amount }) =>\n nodeApi.post(\n '/wallet/payment/send',\n [\n {\n address: recipientAddress,\n value: Number((parseFloat(amount) * constants.nanoErgInErg).toFixed(1)),\n },\n ],\n {\n headers: {\n api_key: apiKey,\n },\n },\n ),\n [apiKey],\n );\n\n const resetForm = (form: any) => {\n form.restart();\n setIsSendedModalOpen(false);\n };\n\n const sendForm = useCallback(\n (values) => {\n if (values.recipientAddress.trim() === '' || !values.recipientAddress) {\n return;\n }\n\n paymentSend(values)\n .then(({ data }) => {\n setTransactionId(data);\n setIsSendedModalOpen(true);\n })\n .catch((err) => {\n const errMessage = err.data ? err.data.detail : err.message;\n customToast('error', errMessage);\n });\n },\n [paymentSend],\n );\n\n const validateForm = useCallback((values) => {\n const errors: Errors = {};\n if (!values.recipientAddress) {\n errors.recipientAddress = 'The field cannot be empty';\n }\n if (!values.amount || values.amount < 0.001) {\n errors.amount = 'Minimum 0.001 ERG';\n }\n return errors;\n }, []);\n\n return (\n

\n
\n

Payment send

\n (\n <>\n
\n
\n \n (\n <>\n \n
{meta.error}
\n \n )}\n />\n
\n
\n \n (\n <>\n \n
{meta.error}
\n \n )}\n />\n
\n \n
\n\n {\n setIsSendedModalOpen(false);\n }}\n title=\"Payment sent\"\n description={\n <>\n

\n Your payment has been sent successfully. The transaction ID is -{' '}\n {transactionId}\n

\n

\n \n Click Here To Go To The Explorer\n \n

\n \n }\n primaryButtonContent={OK}\n secondaryButtonContent=\"Send again\"\n onPrimaryHandler={() => resetForm(form)}\n />\n \n )}\n />\n
\n
\n );\n};\n\nexport default PaymentSendForm;\n","function _extends() { _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }\n\nfunction _objectWithoutProperties(source, excluded) { if (source == null) return {}; var target = _objectWithoutPropertiesLoose(source, excluded); var key, i; if (Object.getOwnPropertySymbols) { var sourceSymbolKeys = Object.getOwnPropertySymbols(source); for (i = 0; i < sourceSymbolKeys.length; i++) { key = sourceSymbolKeys[i]; if (excluded.indexOf(key) >= 0) continue; if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue; target[key] = source[key]; } } return target; }\n\nfunction _objectWithoutPropertiesLoose(source, excluded) { if (source == null) return {}; var target = {}; var sourceKeys = Object.keys(source); var key, i; for (i = 0; i < sourceKeys.length; i++) { key = sourceKeys[i]; if (excluded.indexOf(key) >= 0) continue; target[key] = source[key]; } return target; }\n\nimport React from \"react\";\n\nvar _ref2 = /*#__PURE__*/React.createElement(\"g\", null, /*#__PURE__*/React.createElement(\"path\", {\n d: \"M39.622,21.746l-6.749,6.75c-0.562,0.562-1.326,0.879-2.122,0.879s-1.56-0.316-2.121-0.879l-6.75-6.75 c-1.171-1.171-1.171-3.071,0-4.242c1.171-1.172,3.071-1.172,4.242,0l1.832,1.832C27.486,13.697,22.758,9.25,17,9.25 c-6.064,0-11,4.935-11,11c0,6.064,4.936,11,11,11c1.657,0,3,1.343,3,3s-1.343,3-3,3c-9.373,0-17-7.626-17-17s7.627-17,17-17 c8.936,0,16.266,6.933,16.936,15.698l1.442-1.444c1.172-1.172,3.072-1.172,4.242,0C40.792,18.674,40.792,20.574,39.622,21.746z\"\n}));\n\nvar _ref3 = /*#__PURE__*/React.createElement(\"g\", null);\n\nvar _ref4 = /*#__PURE__*/React.createElement(\"g\", null);\n\nvar _ref5 = /*#__PURE__*/React.createElement(\"g\", null);\n\nvar _ref6 = /*#__PURE__*/React.createElement(\"g\", null);\n\nvar _ref7 = /*#__PURE__*/React.createElement(\"g\", null);\n\nvar _ref8 = /*#__PURE__*/React.createElement(\"g\", null);\n\nvar _ref9 = /*#__PURE__*/React.createElement(\"g\", null);\n\nvar _ref10 = /*#__PURE__*/React.createElement(\"g\", null);\n\nvar _ref11 = /*#__PURE__*/React.createElement(\"g\", null);\n\nvar _ref12 = /*#__PURE__*/React.createElement(\"g\", null);\n\nvar _ref13 = /*#__PURE__*/React.createElement(\"g\", null);\n\nvar _ref14 = /*#__PURE__*/React.createElement(\"g\", null);\n\nvar _ref15 = /*#__PURE__*/React.createElement(\"g\", null);\n\nvar _ref16 = /*#__PURE__*/React.createElement(\"g\", null);\n\nvar _ref17 = /*#__PURE__*/React.createElement(\"g\", null);\n\nvar SvgRedoArrowSymbol = function SvgRedoArrowSymbol(_ref) {\n var svgRef = _ref.svgRef,\n title = _ref.title,\n props = _objectWithoutProperties(_ref, [\"svgRef\", \"title\"]);\n\n return /*#__PURE__*/React.createElement(\"svg\", _extends({\n id: \"Capa_1\",\n x: \"0px\",\n y: \"0px\",\n width: \"32px\",\n height: \"32px\",\n viewBox: \"0 0 40.499 40.5\",\n style: {\n enableBackground: \"new 0 0 40.499 40.5\"\n },\n xmlSpace: \"preserve\",\n ref: svgRef\n }, props), title ? /*#__PURE__*/React.createElement(\"title\", null, title) : null, _ref2, _ref3, _ref4, _ref5, _ref6, _ref7, _ref8, _ref9, _ref10, _ref11, _ref12, _ref13, _ref14, _ref15, _ref16, _ref17);\n};\n\nvar ForwardRef = /*#__PURE__*/React.forwardRef(function (props, ref) {\n return /*#__PURE__*/React.createElement(SvgRedoArrowSymbol, _extends({\n svgRef: ref\n }, props));\n});\nexport default __webpack_public_path__ + \"static/media/redo-arrow-symbol.e801de31.svg\";\nexport { ForwardRef as ReactComponent };","import { ReactComponent as redoImage } from 'assets/images/icons/redo-arrow-symbol.svg';\nimport { makeIcon, IconProps } from './icons';\n\nexport const RedoIcon = ({ className }: IconProps) => {\n return makeIcon(redoImage, className);\n};\n","import React, { useState, useEffect, useCallback, useMemo } from 'react';\nimport cn from 'classnames';\nimport './index.scss';\nimport { connect } from 'react-redux';\nimport { RedoIcon } from 'components/common/icons/RedoIcon';\nimport constants from 'utils/constants';\nimport { RemoveIcon } from '../../../../common/icons/icons';\nimport {\n walletBalanceDataSelector,\n ergPriceSelector,\n walletAddressesSelector,\n} from '../../../../../store/selectors/wallet';\nimport walletActions from '../../../../../store/actions/walletActions';\n\nconst WalletInformationTableItem = ({ name, value }: any) => {\n const [isOpen, setIsOpen] = useState(false);\n let resultTitle;\n let resultContent;\n\n if (Array.isArray(value)) {\n resultTitle = value.length;\n\n resultContent = (\n
\n {value.map((item) => (\n <>\n
\n {item.value || ''} {item.name || ''}\n
\n
\n \n ))}\n
\n );\n } else {\n resultTitle = value;\n resultContent = value;\n }\n\n return (\n
\n \n
{name}
\n \n
\n {isOpen &&
{resultContent}
}\n \n );\n};\n\nconst WalletInformationTable = (props: any) => {\n const {\n walletBalance,\n dispatchGetWalletBalance,\n dispatchGetErgPrice,\n dispatchGetWalletAddresses,\n walletAddresses,\n } = props;\n\n const getValues = useCallback(() => {\n dispatchGetWalletBalance();\n dispatchGetErgPrice();\n dispatchGetWalletAddresses();\n }, [dispatchGetWalletBalance, dispatchGetErgPrice, dispatchGetWalletAddresses]);\n\n const getAddreses = useCallback((addresses: String[]) => {\n if (addresses.length === 0) {\n return 0;\n }\n\n return addresses.map((item) => ({\n value: (\n \n {item}\n \n ),\n }));\n }, []);\n\n const getAssets = useCallback((assets) => {\n if (Object.values(assets).length === 0) {\n return 0;\n }\n\n return Object.keys(assets).map((key: any) => ({\n name: {key},\n value: {assets[key]},\n }));\n }, []);\n\n useEffect(() => {\n getValues();\n }, [getValues]);\n\n const data = useMemo(\n () => [\n {\n name: 'Balance',\n value: walletBalance\n ? `${walletBalance.balance / constants.nanoErgInErg} ERG`\n : 'loading...',\n },\n // {\n // name: 'Balance in USD',\n // value: walletBalance\n // ? `$ ${(walletBalance.balance / constants.nanoErgInErg) * ergPrice}`\n // : 'Loading...',\n // },\n {\n name: 'Assets',\n value: walletBalance ? getAssets(walletBalance.assets) : `Loading...`,\n },\n {\n name: 'Addresses',\n value: walletAddresses ? getAddreses(walletAddresses) : `Loading...`,\n },\n ],\n [walletBalance, walletAddresses, getAddreses],\n );\n\n const updateValues = useCallback(() => {\n getValues();\n }, [getValues]);\n\n return (\n
\n
\n

\n Wallet Information{' '}\n \n

\n
\n
\n {data.map(({ value, name }) => (\n \n ))}\n
\n
\n );\n};\n\nconst mapStateToProps = (state: any) => ({\n walletBalance: walletBalanceDataSelector(state),\n ergPrice: ergPriceSelector(state),\n walletAddresses: walletAddressesSelector(state),\n});\n\nconst mapDispatchToProps = (dispatch: any) => ({\n dispatchGetWalletBalance: () => dispatch(walletActions.getWalletBalance()),\n dispatchGetErgPrice: () => dispatch(walletActions.getErgPrice()),\n dispatchGetWalletAddresses: () => dispatch(walletActions.getWalletAddresses()),\n});\n\nexport default connect(mapStateToProps, mapDispatchToProps)(WalletInformationTable);\n","import React, { Component, memo } from 'react';\nimport { connect } from 'react-redux';\nimport PaymentSendForm from './components/PaymentSendForm/index';\nimport { apiKeySelector } from '../../../store/selectors/app';\nimport {\n isWalletInitializedSelector,\n isWalletUnlockedSelector,\n} from '../../../store/selectors/wallet';\nimport WalletInformationTable from './components/WalletInformationTable/index';\nimport './index.scss';\n\nconst mapStateToProps = (state) => ({\n apiKey: apiKeySelector(state),\n isWalletInitialized: isWalletInitializedSelector(state),\n isWalletUnlocked: isWalletUnlockedSelector(state),\n});\n\nclass Wallet extends Component {\n renderState = (state) =>\n ({\n unlocked: (apiKey) => this.renderWalletUnlockedState(apiKey),\n locked: () => this.renderWalletLockedState(),\n initialized: (apiKey) => this.renderInitializedState(apiKey),\n }[state]);\n\n renderWalletLockedState = () => (\n
\n

The wallet UI is locked. You need to unlock the wallet to access its UI.

\n
\n );\n\n renderInitializedState = () => (\n
\n

You need to initialize your wallet to access wallet UI.

\n
\n );\n\n renderWalletUnlockedState = (apiKey) => (\n
\n \n \n {/* \n */}\n
\n );\n\n render() {\n const { apiKey, isWalletUnlocked, isWalletInitialized } = this.props;\n\n if (apiKey === '') {\n return (\n
\n

To continue, please set your API key.

\n
\n );\n }\n\n if (!isWalletInitialized) {\n return this.renderState('initialized')(apiKey);\n }\n\n if (isWalletUnlocked) {\n return this.renderState('unlocked')(apiKey);\n }\n\n return this.renderState('locked')();\n }\n}\n\nexport default connect(mapStateToProps)(memo(Wallet));\n","import React from 'react';\nimport { BrowserRouter, Switch, Route } from 'react-router-dom';\nimport { Layout } from '../components/layout';\nimport Dashboard from '../components/pages/Dashboard';\nimport Wallet from '../components/pages/Wallet';\n\nconst Router = () => (\n \n \n \n \n \n \n \n \n);\n\nexport default Router;\n","import { combineReducers } from 'redux';\nimport appSlice from '../slices/appSlice';\nimport walletSlice from '../slices/walletSlice';\n\nexport default combineReducers({\n app: appSlice.reducer,\n wallet: walletSlice.reducer,\n});\n","// import Axios from 'axios';\nimport walletActions from '../actions/walletActions';\nimport nodeApi from '../../api/api';\nimport { apiKeySelector } from '../selectors/app';\n// import oracleApi from '../../api/oracleApi';\n\nexport default (store) => (next) => (action) => {\n const { dispatch, getState } = store;\n const apiKey = apiKeySelector(getState());\n\n switch (action.type) {\n case walletActions.checkWalletStatus.type:\n nodeApi\n .get('/wallet/status', {\n headers: {\n api_key: apiKey,\n },\n })\n .then(({ data: walletData }) => {\n dispatch(walletActions.setIsWalletUnlocked(walletData.isUnlocked));\n dispatch(walletActions.setIsWalletInitialized(walletData.isInitialized));\n dispatch(walletActions.setWalletStatusData(walletData));\n })\n .catch(() => {});\n\n break;\n\n case walletActions.getWalletBalance.type:\n nodeApi\n .get('/wallet/balances', {\n headers: {\n api_key: apiKey,\n },\n })\n .then(({ data: walletData }) => {\n dispatch(walletActions.setWalletBalanceData(walletData));\n })\n .catch(() => {});\n\n break;\n\n // case walletActions.getErgPrice.type:\n // oracleApi\n // .get('/frontendData', {\n // transformResponse: [...Axios.defaults.transformResponse, (data) => JSON.parse(data)],\n // })\n // .then(({ data }) => {\n // dispatch(walletActions.setErgPrice(data.latest_price));\n // })\n // .catch(() => {});\n\n // break;\n\n case walletActions.getWalletAddresses.type:\n nodeApi\n .get('/wallet/addresses', {\n headers: {\n api_key: apiKey,\n },\n })\n .then(({ data: walletAddresses }) => {\n dispatch(walletActions.setWalletAddresses(walletAddresses));\n })\n .catch(() => {});\n\n break;\n\n default:\n break;\n }\n next(action);\n};\n","import React from 'react';\nimport { toast } from 'react-toastify';\nimport { Provider } from 'react-redux';\nimport Router from './router/router';\nimport createStore from './store';\n\nimport 'bootstrap/dist/css/bootstrap.min.css';\nimport './assets/styles/index.scss';\nimport 'react-toastify/dist/ReactToastify.min.css';\n\ntoast.configure();\nconst store = createStore();\n\nconst App = () => {\n return (\n \n \n \n );\n};\n\nexport default App;\n","import { configureStore, getDefaultMiddleware } from 'redux-starter-kit';\nimport rootReducer from './reducers/rootReducer';\nimport walletMiddleware from './middlewares/walletMiddleware';\n\nexport default () => {\n const store = configureStore({\n reducer: rootReducer,\n middleware: [...getDefaultMiddleware(), walletMiddleware],\n });\n\n return store;\n};\n","import React from 'react';\nimport ReactDOM from 'react-dom';\nimport App from './App';\n\nReactDOM.render(, document.getElementById('root'));\n","// extracted by mini-css-extract-plugin\nmodule.exports = {\"backdrop\":\"Backdrop_backdrop__PmdBI\",\"content\":\"Backdrop_content__2Kmrw\",\"layer\":\"Backdrop_layer__3V2YH\"};","module.exports = __webpack_public_path__ + \"static/media/logotype_white.4dcfd639.svg\";"],"sourceRoot":""} \ No newline at end of file diff --git a/build/static/js/main.1f01b859.chunk.js b/build/static/js/main.1f01b859.chunk.js new file mode 100644 index 0000000..c27478b --- /dev/null +++ b/build/static/js/main.1f01b859.chunk.js @@ -0,0 +1,2 @@ +(this["webpackJsonpergo-node-interface"]=this["webpackJsonpergo-node-interface"]||[]).push([[0],{102:function(e,t,a){e.exports=a(142)},113:function(e,t,a){},130:function(e,t,a){},134:function(e,t,a){},135:function(e,t,a){},136:function(e,t,a){},137:function(e,t,a){},138:function(e,t,a){},140:function(e,t,a){},142:function(e,t,a){"use strict";a.r(t);var n=a(0),r=a.n(n),l=a(10),c=a.n(l),o=a(47),s=a(15),i=a(39),u=a(7),m=a(20),d=a(25),p=a(48),f=a(89),b="/swagger",h="https://ergoplatform.org",E="https://explorer.ergoplatform.com",v=1e9,y={dashboard:{href:"/",icon:r.a.createElement(m.a,{icon:d.b}),title:"Dashboard"},wallet:{href:"/wallet",icon:r.a.createElement(m.a,{icon:d.d}),title:"Wallet"}},g={swaggerInterface:{href:b,icon:r.a.createElement(m.a,{icon:d.a}),title:"Swagger"},explorer:{href:E,icon:r.a.createElement(m.a,{icon:f.a}),title:"Explorer"},website:{href:h,icon:r.a.createElement(m.a,{icon:d.f}),title:"Website"}},w=Object(u.f)((function(e){var t=e.location.pathname;return r.a.createElement("div",null,r.a.createElement("p",{className:"h5 pl-3 pt-4"},"Menu"),r.a.createElement("hr",{className:"mb-0"}),r.a.createElement("div",{className:"list-group list-group-flush"},Object.values(y).map((function(e,a){var n=e.href,l=e.icon,c=e.title;return r.a.createElement(i.b,{key:c,className:Object(p.a)("list-group-item list-group-item-action",{"list-group-item-dark":n===t,active:n===t,"border-top-0":0===a}),to:n},l," ",c)}))),r.a.createElement("p",{className:"h5 pl-3 pt-4"},"External links"),r.a.createElement("hr",{className:"mb-0"}),r.a.createElement("div",{className:"list-group list-group-flush"},Object.values(g).map((function(e,t){var a=e.href,n=e.icon,l=e.title;return r.a.createElement("a",{key:l,className:Object(p.a)("list-group-item list-group-item-action",{"border-top-0":0===t}),href:a,rel:"noopener noreferrer",target:"_blank"},n," ",l)}))))})),O=(a(113),a(79)),N=Object(O.a)((function(e){return e.app}),(function(e){return e.apiKey})),j=function(e){return e.wallet},k=Object(O.a)(j,(function(e){return e.isWalletUnlocked})),S=Object(O.a)(j,(function(e){return e.isWalletInitialized})),_=Object(O.a)(j,(function(e){return e.walletStatusData})),C=Object(O.a)(j,(function(e){return e.walletBalanceData})),W=Object(O.a)(j,(function(e){return e.walletAddresses})),x=Object(O.a)(j,(function(e){return e.ergPrice})),I=a(23),P=a(19),A=Object(P.c)({name:"walletSlice",initialState:{isWalletUnlocked:null,isWalletInitialized:null,walletStatusData:null,walletBalanceData:null,ergPrice:null,walletAddresses:null},reducers:{setIsWalletUnlocked:function(e,t){var a=t.payload;e.isWalletUnlocked=a},setIsWalletInitialized:function(e,t){var a=t.payload;e.isWalletInitialized=a},setWalletStatusData:function(e,t){var a=t.payload;e.walletStatusData=a},setWalletBalanceData:function(e,t){var a=t.payload;e.walletBalanceData=a},setErgPrice:function(e,t){var a=t.payload;e.ergPrice=a},setWalletAddresses:function(e,t){var a=t.payload;e.walletAddresses=a}}}),B=Object(P.b)("checkWalletStatus"),z=Object(P.b)("getWalletBalance"),L=Object(P.b)("getErgPrice"),T=Object(P.b)("getWalletAddresses"),H=Object(I.a)({},A.actions,{checkWalletStatus:B,getWalletBalance:z,getErgPrice:L,getWalletAddresses:T}),F=a(5),M=a(151),K=Object(P.c)({name:"appSlice",initialState:{apiKey:""},reducers:{setApiKey:function(e,t){e.apiKey=t.payload}}}),U=Object(I.a)({},K.actions),R=a(91),D=a.n(R),G=Object(I.a)({},{nodeApiLink:"/",oracleApiLink:"https://erg-usd-ergo-oracle.emurgo.io"});function V(e){var t=e.status,a=e.message,n=e.data,r=e.statusText;this.name="NetworkError",this.message=a||r,this.status=t,this.data=n}V.prototype=Object.create(Error.prototype);var Y=D.a.create({baseURL:G.nodeApiLink,timeout:1e4,crossDomain:!0,headers:{"Content-Type":"application/json"}});Y.interceptors.response.use((function(e){return Promise.resolve(e)}),(function(e){return Promise.reject(new V(e.response||e))}));var Z=Y,q=(a(130),{success:function(e,t){return o.a.success(e,Object(I.a)({position:"top-right",autoClose:5e3,hideProgressBar:!1,closeOnClick:!0,pauseOnHover:!0,draggable:!0,className:"n-toast n-toast--success",bodyClassName:"n-toast__body",progressClassName:"n-toast__progress--success"},t))},error:function(e,t){return o.a.error(e,Object(I.a)({position:"top-right",autoClose:5e3,hideProgressBar:!1,closeOnClick:!0,pauseOnHover:!0,draggable:!0,className:"n-toast n-toast--error",bodyClassName:"n-toast__body",progressClassName:"n-toast__progress--error"},t))},info:o.a.info}),J=function(e,t,a){return q[e]?q[e](t,a):new Error("Bad toast state")},$=a(29),Q=a(9),X=function(e){var t=e.showModal,a=e.handleHide,n=e.submitForm,l=e.apiKey,c=e.handleShow;return r.a.createElement("div",null,function(e,t){return""===e?r.a.createElement("button",{type:"button",onClick:t,className:"btn btn-primary"},"Set API key"):r.a.createElement("button",{type:"button",onClick:t,className:"btn btn-outline-primary"},"Update API key")}(l,c),r.a.createElement($.a,{show:t,onHide:function(){return a()},centered:!0},r.a.createElement(Q.c,{initialValues:{apiKey:l},onSubmit:n},(function(){return r.a.createElement(Q.b,null,r.a.createElement($.a.Header,{closeButton:!0},r.a.createElement($.a.Title,null,"Authorization")),r.a.createElement($.a.Body,null,r.a.createElement("p",{className:"text"},"Set API key to access Node requests"),r.a.createElement("div",{className:"input-group"},r.a.createElement(Q.a,{type:"text",name:"apiKey",className:"form-control",placeholder:"Enter API key"}))),r.a.createElement($.a.Footer,null,r.a.createElement("button",{type:"button",className:"btn btn-outline-secondary",onClick:a},"Close"),r.a.createElement("button",{type:"submit",className:"btn btn-primary"},"Save changes")))}))))},ee=Object(s.b)((function(e){return{apiKey:N(e)}}),(function(e){return{dispatchSetApiKey:function(t){return e(U.setApiKey(t))}}}))(Object(n.memo)((function(e){var t=e.dispatchSetApiKey,a=e.apiKey,l=Object(n.useState)(!1),c=Object(F.a)(l,2),o=c[0],s=c[1],i=function(){s(!1)};return r.a.createElement(X,{showModal:o,apiKey:a,handleHide:i,submitForm:function(e){Z.get("/wallet/status",{headers:{api_key:e.apiKey}}).then((function(){t(e.apiKey.trim()),J("success","API key is set successfully"),i()})).catch((function(){J("error","Bad API key")}))},handleShow:function(){s(!0)}})}))),te=a(12),ae=a(13),ne=a(16),re=a(14),le=a(17),ce="INIT",oe="STATUS",se=function(e){function t(){var e,a;Object(te.a)(this,t);for(var n=arguments.length,l=new Array(n),c=0;c0&&void 0!==arguments[0]?arguments[0]:Math.random().toString(32).slice(2,10),t="id-".concat(e),a=Ke().isBrowser,r=Object(n.useState)(a?Ue(t):null),l=Object(F.a)(r,2),c=l[0],o=l[1];return Object(n.useEffect)((function(){var e=document.querySelector("#".concat(t)),a=e||Ue(t);e||document.body.appendChild(a),o(a)}),[]),c},De={scrollLayer:!1},Ge=new Map,Ve=function(e){return!!(e.touches&&e.touches.length>1)||(e.preventDefault(),!1)},Ye=function(e,t){if("undefined"===typeof document)return[!1,function(e){return e}];var a=e||Object(n.useRef)(document.body),r=Object(n.useState)(!1),l=Object(F.a)(r,2),c=l[0],o=l[1],s=Object(I.a)({},De,{},t||{}),i=function(){return!s.scrollLayer&&(!("undefined"===typeof window||!window.navigator)&&/iP(ad|hone|od)/.test(window.navigator.platform))};return Object(n.useEffect)((function(){if(a&&a.current){var e=a.current.style.overflow;if(c){if(Ge.has(a.current))return;return i()?document.addEventListener("touchmove",Ve,{passive:!1}):a.current.style.overflow="hidden",void Ge.set(a.current,{last:e})}if(Ge.has(a.current)){if(i())document.removeEventListener("touchmove",Ve);else{var t=Ge.get(a.current);a.current.style.overflow=t.last}Ge.delete(a.current)}}}),[c,a]),[c,o]},Ze=function(e){var t=Object(n.useState)((function(){return"function"===typeof e?e():e})),a=Object(F.a)(t,2),r=a[0],l=a[1],c=Object(n.useRef)(e);Object(n.useEffect)((function(){c.current=r}),[r]);return[r,function(e){var t="function"===typeof e?e(c.current):e;c.current=t,l(t)},c]},qe=a(65),Je=a(4),$e=a.n(Je),Qe=function(e){var t=e.children,a=e.variant,n=e.component,l=e.color,c=e.className,o=e.dangerouslySetInnerHTML,s=Object(qe.a)(e,["children","variant","component","color","className","dangerouslySetInnerHTML"]),i=a,u=n||"p";return o?r.a.createElement(r.a.Fragment,null,r.a.createElement(u,Object.assign({className:$e()({colored:l},i,c),dangerouslySetInnerHTML:o},s)),r.a.createElement("style",null,"\n .colored {\n color: var(--".concat(l,");\n }\n "))):r.a.createElement(u,Object.assign({className:$e()({colored:l},i,c)},s),t,r.a.createElement("style",null,"\n .colored {\n color: var(--".concat(l,");\n }\n ")))},Xe=function(e,t){return e.defaultProps=t,e},et=Xe((function(e){var t=e.children,a=e.className,l=e.visible,c=e.enterTime,o=e.leaveTime,s=e.clearTime,i=e.name,u=Object(qe.a)(e,["children","className","visible","enterTime","leaveTime","clearTime","name"]),m=Object(n.useState)(""),d=Object(F.a)(m,2),p=d[0],f=d[1],b=Object(n.useState)(l),h=Object(F.a)(b,2),E=h[0],v=h[1];return Object(n.useEffect)((function(){var e=l?"enter":"leave",t=l?c:o;l&&!E&&v(!0),f("".concat(i,"-").concat(e));var a=setTimeout((function(){f("".concat(i,"-").concat(e," ").concat(i,"-").concat(e,"-active")),clearTimeout(a)}),t),n=setTimeout((function(){l||(f(""),v(!1)),clearTimeout(n)}),t+s);return function(){clearTimeout(a),clearTimeout(n)}}),[l,E]),r.a.isValidElement(t)&&E?r.a.cloneElement(t,Object(I.a)({},u,{className:"".concat(t.props.className," ").concat(a," ").concat(p)})):null}),{visible:!1,enterTime:60,leaveTime:60,clearTime:60,className:"",name:"transition"}),tt=a(67),at=a.n(tt),nt=Xe(r.a.memo((function(e){var t=e.children,a=e.onClick,l=e.visible,c=e.className,o=Ze(!1),s=Object(F.a)(o,3),i=s[1],u=s[2],m=Object(n.useCallback)((function(e){e.stopPropagation()}),[]);return r.a.createElement(et,{visible:l,clearTime:300},r.a.createElement("div",{className:at.a.backdrop,onClick:function(e){u.current||a&&a(e)},onMouseUp:function(){if(u.current)var e=setTimeout((function(){i(!1),clearTimeout(e)}),0)}},r.a.createElement("div",{className:at.a.layer}),r.a.createElement("div",{onClick:m,className:$e()(at.a.content,c),onMouseDown:function(){return i(!0)}},t)))})),{onClick:function(){},visible:!1}),rt=r.a.createContext({});function lt(){return(lt=Object.assign||function(e){for(var t=1;t=0||(r[a]=e[a]);return r}(e,t);if(Object.getOwnPropertySymbols){var l=Object.getOwnPropertySymbols(e);for(n=0;n=0||Object.prototype.propertyIsEnumerable.call(e,a)&&(r[a]=e[a])}return r}var ot=r.a.createElement("path",{d:"M10.7951 9.30799C10.3844 8.89734 9.71865 8.89734 9.30799 9.30799C8.89734 9.71865 8.89734 10.3844 9.30799 10.7951L14.5129 16L9.30799 21.2049C8.89734 21.6156 8.89734 22.2814 9.30799 22.692C9.71865 23.1027 10.3844 23.1027 10.7951 22.692L16 17.4871L21.2049 22.692C21.6156 23.1027 22.2814 23.1027 22.692 22.692C23.1027 22.2814 23.1027 21.6156 22.692 21.2049L17.4871 16L22.692 10.7951C23.1027 10.3844 23.1027 9.71865 22.692 9.30799C22.2814 8.89734 21.6156 8.89734 21.2049 9.30799L16 14.5129L10.7951 9.30799Z",fill:"#76767A"}),st=function(e){var t=e.svgRef,a=e.title,n=ct(e,["svgRef","title"]);return r.a.createElement("svg",lt({width:32,height:32,viewBox:"0 0 32 32",fill:"none",ref:t},n),a?r.a.createElement("title",null,a):null,ot)},it=r.a.forwardRef((function(e,t){return r.a.createElement(st,lt({svgRef:t},e))}));a.p;a.p;function ut(){return(ut=Object.assign||function(e){for(var t=1;t=0||(r[a]=e[a]);return r}(e,t);if(Object.getOwnPropertySymbols){var l=Object.getOwnPropertySymbols(e);for(n=0;n=0||Object.prototype.propertyIsEnumerable.call(e,a)&&(r[a]=e[a])}return r}var dt=r.a.createElement("path",{d:"M13.3332 7.99992C13.3332 8.36811 13.0347 8.66659 12.6665 8.66659H3.33317C2.96498 8.66659 2.6665 8.36811 2.6665 7.99992C2.6665 7.63173 2.96498 7.33325 3.33317 7.33325H12.6665C13.0347 7.33325 13.3332 7.63173 13.3332 7.99992Z",fill:"#0078FF"}),pt=function(e){var t=e.svgRef,a=e.title,n=mt(e,["svgRef","title"]);return r.a.createElement("svg",ut({width:16,height:16,viewBox:"0 0 16 16",fill:"none",ref:t},n),a?r.a.createElement("title",null,a):null,dt)},ft=r.a.forwardRef((function(e,t){return r.a.createElement(pt,ut({svgRef:t},e))})),bt=(a.p,function(e,t){return r.a.createElement(e,{className:t,focusable:"false"})}),ht=function(e){var t=e.className;return bt(ft,t)},Et=function(e){var t=e.className;return bt(it,t)},vt=function(e){var t=e.title,a=e.description,c=e.primaryButtonContent,o=e.secondaryButtonContent,s=e.disableBackdropClick,i=e.onClose,u=e.onOpen,m=e.onPrimaryHandler,d=e.onSecondaryHandler,p=e.open,f=Re("modal"),b=Ye(null,{scrollLayer:!0}),h=Object(F.a)(b,2)[1],E=Ze(!1),v=Object(F.a)(E,3),y=v[0],g=v[1],w=v[2],O=Object(n.useCallback)((function(){i&&i(),g(!1),h(!1)}),[i,g,h]);Object(n.useEffect)((function(){void 0!==p&&(p&&u&&u(),!p&&w.current&&i&&i(),g(p),h(p))}),[p]);var N=Object(n.useMemo)((function(){return{close:O}}),[O]);return f?Object(l.createPortal)(r.a.createElement(rt.Provider,{value:N},r.a.createElement(nt,{onClick:function(){s||O()},visible:y,className:"info-modal-backdrop"},r.a.createElement(et,{name:"wrapper",visible:y,clearTime:300},r.a.createElement("div",{className:"info-modal"},r.a.createElement("div",{className:"info-modal__content"},r.a.createElement("h3",{className:"mb-3"},t),r.a.createElement(Qe,{xl:"body-text1",sm:"small-text1",className:"mb-40 mb-md-56 pr-40 pr-md-0"},a),r.a.createElement("button",{type:"button",className:"btn btn-primary px-4",onClick:function(){m&&m(),i&&i()}},c),r.a.createElement("button",{type:"button",className:"btn btn-outline-secondary px-4 ml-3",onClick:function(){d&&d(),i&&i()}},o)),r.a.createElement("button",{type:"button",className:"info-modal__button--close",onClick:O},r.a.createElement(Et,null)),r.a.createElement("style",null,"\n .wrapper-enter {\n opacity: 0;\n transform: translate3d(0px, -40px, 0px);\n }\n .wrapper-enter-active {\n opacity: 1;\n transform: translate3d(0px, 0px, 0px);\n }\n .wrapper-leave {\n opacity: 1;\n transform: translate3d(0px, 0px, 0px);\n }\n .wrapper-leave-active {\n opacity: 0;\n transform: translate3d(0px, -50px, 0px);\n }\n "))))),f):null};vt.defaultProps={width:"26rem",wrapClassName:"",disableBackdropClick:!1};var yt=vt,gt=function(e){var t=e.apiKey,a=Object(n.useState)(null),l=Object(F.a)(a,2),c=l[0],o=l[1],s=Object(n.useState)(!1),i=Object(F.a)(s,2),u=i[0],m=i[1],d=Object(n.useCallback)((function(e){var a=e.recipientAddress,n=e.amount;return Z.post("/wallet/payment/send",[{address:a,value:Number((parseFloat(n)*v).toFixed(1))}],{headers:{api_key:t}})}),[t]),p=Object(n.useCallback)((function(e){""!==e.recipientAddress.trim()&&e.recipientAddress&&d(e).then((function(e){var t=e.data;o(t),m(!0)})).catch((function(e){var t=e.data?e.data.detail:e.message;J("error",t)}))}),[d]),f=Object(n.useCallback)((function(e){var t={};return e.recipientAddress||(t.recipientAddress="The field cannot be empty"),(!e.amount||e.amount<.001)&&(t.amount="Minimum 0.001 ERG"),t}),[]);return r.a.createElement("div",{className:""},r.a.createElement("div",{className:"card bg-white p-4"},r.a.createElement("h2",{className:"h5 mb-3"},"Payment send"),r.a.createElement(Me.b,{onSubmit:p,validate:f,render:function(e){var t=e.handleSubmit,a=e.submitting,n=e.pristine,l=e.form;return r.a.createElement(r.a.Fragment,null,r.a.createElement("form",{onSubmit:t},r.a.createElement("div",{className:"mb-3"},r.a.createElement("label",{htmlFor:"recipient-address"},"Recipient address"),r.a.createElement(Me.a,{name:"recipientAddress",render:function(e){var t=e.input,a=e.meta;return r.a.createElement(r.a.Fragment,null,r.a.createElement("input",Object.assign({id:"recipient-address",className:$e()("form-control",{"is-invalid":a.touched&&a.error}),type:"text",placeholder:"Enter recipient address"},t)),r.a.createElement("div",{className:"invalid-feedback"},a.error))}})),r.a.createElement("div",{className:"mb-3"},r.a.createElement("label",{htmlFor:"amount"},"Amount"),r.a.createElement(Me.a,{name:"amount",render:function(e){var t=e.input,a=e.meta;return r.a.createElement(r.a.Fragment,null,r.a.createElement("input",Object.assign({id:"amount",className:$e()("form-control",{"is-invalid":a.touched&&a.error}),type:"number",placeholder:"Minimum 0.001 ERG"},t)),r.a.createElement("div",{className:"invalid-feedback"},a.error))}})),r.a.createElement("button",{type:"submit",className:"btn btn-primary",disabled:a||n},"Send")),r.a.createElement(yt,{open:u,onClose:function(){m(!1)},title:"Payment sent",description:r.a.createElement(r.a.Fragment,null,r.a.createElement("p",null,"Your payment has been sent successfully. The transaction ID is -"," ",r.a.createElement(Ee,null,c)),r.a.createElement("p",null,r.a.createElement("a",{target:"_blank",rel:"noopener noreferrer",href:"https://explorer.ergoplatform.com/en/transactions/".concat(c)},"Click Here To Go To The Explorer"))),primaryButtonContent:r.a.createElement("span",{className:"pl-3 pr-3"},"OK"),secondaryButtonContent:"Send again",onPrimaryHandler:function(){return function(e){e.restart(),m(!1)}(l)}}))}})))};a(137);function wt(){return(wt=Object.assign||function(e){for(var t=1;t=0||(r[a]=e[a]);return r}(e,t);if(Object.getOwnPropertySymbols){var l=Object.getOwnPropertySymbols(e);for(n=0;n=0||Object.prototype.propertyIsEnumerable.call(e,a)&&(r[a]=e[a])}return r}var Nt=r.a.createElement("g",null,r.a.createElement("path",{d:"M39.622,21.746l-6.749,6.75c-0.562,0.562-1.326,0.879-2.122,0.879s-1.56-0.316-2.121-0.879l-6.75-6.75 c-1.171-1.171-1.171-3.071,0-4.242c1.171-1.172,3.071-1.172,4.242,0l1.832,1.832C27.486,13.697,22.758,9.25,17,9.25 c-6.064,0-11,4.935-11,11c0,6.064,4.936,11,11,11c1.657,0,3,1.343,3,3s-1.343,3-3,3c-9.373,0-17-7.626-17-17s7.627-17,17-17 c8.936,0,16.266,6.933,16.936,15.698l1.442-1.444c1.172-1.172,3.072-1.172,4.242,0C40.792,18.674,40.792,20.574,39.622,21.746z"})),jt=r.a.createElement("g",null),kt=r.a.createElement("g",null),St=r.a.createElement("g",null),_t=r.a.createElement("g",null),Ct=r.a.createElement("g",null),Wt=r.a.createElement("g",null),xt=r.a.createElement("g",null),It=r.a.createElement("g",null),Pt=r.a.createElement("g",null),At=r.a.createElement("g",null),Bt=r.a.createElement("g",null),zt=r.a.createElement("g",null),Lt=r.a.createElement("g",null),Tt=r.a.createElement("g",null),Ht=r.a.createElement("g",null),Ft=function(e){var t=e.svgRef,a=e.title,n=Ot(e,["svgRef","title"]);return r.a.createElement("svg",wt({id:"Capa_1",x:"0px",y:"0px",width:"32px",height:"32px",viewBox:"0 0 40.499 40.5",style:{enableBackground:"new 0 0 40.499 40.5"},xmlSpace:"preserve",ref:t},n),a?r.a.createElement("title",null,a):null,Nt,jt,kt,St,_t,Ct,Wt,xt,It,Pt,At,Bt,zt,Lt,Tt,Ht)},Mt=r.a.forwardRef((function(e,t){return r.a.createElement(Ft,wt({svgRef:t},e))})),Kt=(a.p,function(e){var t=e.className;return bt(Mt,t)}),Ut=function(e){var t,a,l=e.name,c=e.value,o=Object(n.useState)(!1),s=Object(F.a)(o,2),i=s[0],u=s[1];return Array.isArray(c)?(t=c.length,a=r.a.createElement("div",null,c.map((function(e){return r.a.createElement(r.a.Fragment,null,r.a.createElement("div",null,e.value||""," ",e.name||""),r.a.createElement("br",null))})))):(t=c,a=c),r.a.createElement("div",{className:"wallet-table__item"},r.a.createElement("div",{className:$e()("wallet-table-item-header",{"wallet-table-item-header--opened":i})},r.a.createElement("div",{className:"wallet-table-item-header__title"},l),r.a.createElement("div",{className:"wallet-table-item-header__right-side"},!i&&r.a.createElement("div",{className:"wallet-table-item-header__opacity-paragraph"},t),r.a.createElement("a",{className:"wallet-table-item-header__link",onClick:function(){return u((function(e){return!e}))}},!i&&"More",i&&r.a.createElement(ht,null)))),i&&r.a.createElement("div",{className:"wallet-table-item-body"},a))},Rt=Object(s.b)((function(e){return{walletBalance:C(e),ergPrice:x(e),walletAddresses:W(e)}}),(function(e){return{dispatchGetWalletBalance:function(){return e(H.getWalletBalance())},dispatchGetErgPrice:function(){return e(H.getErgPrice())},dispatchGetWalletAddresses:function(){return e(H.getWalletAddresses())}}}))((function(e){var t=e.walletBalance,a=e.dispatchGetWalletBalance,l=e.dispatchGetErgPrice,c=e.dispatchGetWalletAddresses,o=e.walletAddresses,s=Object(n.useCallback)((function(){a(),l(),c()}),[a,l,c]),i=Object(n.useCallback)((function(e){return 0===e.length?0:e.map((function(e){return{value:r.a.createElement("a",{rel:"noopener noreferrer",target:"_blank",href:"https://explorer.ergoplatform.com/en/addresses/".concat(e)},e)}}))}),[]),u=Object(n.useCallback)((function(e){return 0===Object.values(e).length?0:Object.keys(e).map((function(t){return{name:r.a.createElement("span",{className:"text-muted"},t),value:r.a.createElement("span",{className:"font-weight-bold"},e[t])}}))}),[]);Object(n.useEffect)((function(){s()}),[s]);var m=Object(n.useMemo)((function(){return[{name:"Balance",value:t?"".concat(t.balance/v," ERG"):"loading..."},{name:"Assets",value:t?u(t.assets):"Loading..."},{name:"Addresses",value:o?i(o):"Loading..."}]}),[t,o,i]),d=Object(n.useCallback)((function(){s()}),[s]);return r.a.createElement("div",{className:"wallet-table"},r.a.createElement("div",{className:"wallet-table__header"},r.a.createElement("h2",{className:"wallet-table__title"},"Wallet Information"," ",r.a.createElement("button",{type:"button",className:"wallet-table__icon-redo",onClick:d},r.a.createElement(Kt,null)))),r.a.createElement("div",{className:"wallet-table__body"},m.map((function(e){var t=e.value,a=e.name;return r.a.createElement(Ut,{key:a,name:a,value:t})}))))})),Dt=(a(138),function(e){function t(){var e,a;Object(te.a)(this,t);for(var n=arguments.length,l=new Array(n),c=0;c,\n title: 'Dashboard',\n },\n wallet: {\n href: '/wallet',\n icon: ,\n title: 'Wallet',\n },\n};\n\nconst externalRouteList = {\n swaggerInterface: {\n href: constants.swaggerInterface,\n icon: ,\n title: 'Swagger',\n },\n explorer: {\n href: constants.explorer,\n icon: ,\n title: 'Explorer',\n },\n website: {\n href: constants.website,\n icon: ,\n title: 'Website',\n },\n};\n\nconst MenuList = ({ location: { pathname } }) => {\n return (\n
\n

Menu

\n
\n
\n {Object.values(localRouteList).map(({ href, icon, title }, index) => (\n \n {icon} {title}\n \n ))}\n
\n

External links

\n
\n
\n {Object.values(externalRouteList).map(({ href, icon, title }, index) => (\n \n {icon} {title}\n \n ))}\n
\n
\n );\n};\n\nexport default withRouter(MenuList);\n","import { createSelector } from 'redux-starter-kit';\n\nexport const appSelector = (state) => state.app;\n\nexport const apiKeySelector = createSelector(appSelector, (app) => app.apiKey);\n","import { createSelector } from 'redux-starter-kit';\n\nexport const walletSelector = (state) => state.wallet;\n\nexport const isWalletUnlockedSelector = createSelector(\n walletSelector,\n (wallet) => wallet.isWalletUnlocked,\n);\n\nexport const isWalletInitializedSelector = createSelector(\n walletSelector,\n (wallet) => wallet.isWalletInitialized,\n);\n\nexport const walletStatusDataSelector = createSelector(\n walletSelector,\n (wallet) => wallet.walletStatusData,\n);\n\nexport const walletBalanceDataSelector = createSelector(\n walletSelector,\n (wallet) => wallet.walletBalanceData,\n);\n\nexport const walletAddressesSelector = createSelector(\n walletSelector,\n (wallet) => wallet.walletAddresses,\n);\n\nexport const ergPriceSelector = createSelector(walletSelector, (wallet) => wallet.ergPrice);\n","import { createSlice } from 'redux-starter-kit';\n\nconst initialState = {\n isWalletUnlocked: null,\n isWalletInitialized: null,\n walletStatusData: null,\n walletBalanceData: null,\n ergPrice: null,\n walletAddresses: null,\n};\n\nexport default createSlice({\n name: 'walletSlice',\n initialState,\n reducers: {\n setIsWalletUnlocked: (state, { payload }) => {\n state.isWalletUnlocked = payload;\n },\n setIsWalletInitialized: (state, { payload }) => {\n state.isWalletInitialized = payload;\n },\n setWalletStatusData: (state, { payload }) => {\n state.walletStatusData = payload;\n },\n setWalletBalanceData: (state, { payload }) => {\n state.walletBalanceData = payload;\n },\n setErgPrice: (state, { payload }) => {\n state.ergPrice = payload;\n },\n setWalletAddresses: (state, { payload }) => {\n state.walletAddresses = payload;\n },\n },\n});\n","import { createAction } from 'redux-starter-kit';\nimport walletSlice from '../slices/walletSlice';\n\nconst checkWalletStatus = createAction('checkWalletStatus');\nconst getWalletBalance = createAction('getWalletBalance');\nconst getErgPrice = createAction('getErgPrice');\nconst getWalletAddresses = createAction('getWalletAddresses');\n\nexport default {\n ...walletSlice.actions,\n checkWalletStatus,\n getWalletBalance,\n getErgPrice,\n getWalletAddresses,\n};\n","import { createSlice } from 'redux-starter-kit';\n\nconst initialState = {\n apiKey: '',\n};\n\nexport default createSlice({\n name: 'appSlice',\n initialState,\n reducers: {\n setApiKey: (state, action) => {\n state.apiKey = action.payload;\n },\n },\n});\n","import appSlice from '../slices/appSlice';\n\nexport default {\n ...appSlice.actions,\n};\n","const appConfig = () => {\n return {\n nodeApiLink: '/',\n oracleApiLink: 'https://erg-usd-ergo-oracle.emurgo.io',\n };\n};\n\nexport default {\n ...appConfig(),\n};\n","import axios from 'axios';\nimport environment from '../utils/environment';\n\nfunction NetworkError({ status, message, data, statusText }) {\n this.name = 'NetworkError';\n this.message = message || statusText;\n this.status = status;\n this.data = data;\n}\n\nNetworkError.prototype = Object.create(Error.prototype);\n\nconst nodeApi = axios.create({\n baseURL: environment.nodeApiLink,\n timeout: 1000 * 10,\n crossDomain: true,\n headers: {\n 'Content-Type': 'application/json',\n },\n});\n\nnodeApi.interceptors.response.use(\n (response) => Promise.resolve(response),\n (error) => Promise.reject(new NetworkError(error.response || error)),\n);\n\nexport default nodeApi;\n","import { toast } from 'react-toastify';\nimport './index.scss';\n\nconst toastStates = {\n success: (text, options) =>\n toast.success(text, {\n position: 'top-right',\n autoClose: 5000,\n hideProgressBar: false,\n closeOnClick: true,\n pauseOnHover: true,\n draggable: true,\n className: 'n-toast n-toast--success',\n bodyClassName: 'n-toast__body',\n progressClassName: 'n-toast__progress--success',\n ...options,\n }),\n error: (text, options) =>\n toast.error(text, {\n position: 'top-right',\n autoClose: 5000,\n hideProgressBar: false,\n closeOnClick: true,\n pauseOnHover: true,\n draggable: true,\n className: 'n-toast n-toast--error',\n bodyClassName: 'n-toast__body',\n progressClassName: 'n-toast__progress--error',\n ...options,\n }),\n info: toast.info,\n};\n\nexport default (state, text, options) =>\n toastStates[state] ? toastStates[state](text, options) : new Error(`Bad toast state`);\n","import React from 'react';\nimport { Modal } from 'react-bootstrap';\nimport { Formik, Form, Field } from 'formik';\n\nconst renderButton = (apiKey, handleShow) => {\n if (apiKey === '') {\n return (\n \n );\n }\n\n return (\n \n );\n};\n\nconst ApiKeyModalView = ({ showModal, handleHide, submitForm, apiKey, handleShow }) => {\n return (\n
\n {renderButton(apiKey, handleShow)}\n handleHide()} centered>\n \n {() => (\n
\n \n Authorization\n \n \n

Set API key to access Node requests

\n
\n \n
\n
\n\n \n \n \n \n
\n )}\n
\n
\n
\n );\n};\n\nexport default ApiKeyModalView;\n","import ApiKeyModalContainer from './ApiKeyModalContainer';\n\nexport default ApiKeyModalContainer;\n","import React, { memo, useState } from 'react';\nimport { connect } from 'react-redux';\nimport { apiKeySelector } from '../../../store/selectors/app';\nimport appActions from '../../../store/actions/appActions';\nimport nodeApi from '../../../api/api';\nimport customToast from '../../../utils/toast';\nimport ApiKeyModalView from './ApiKeyModalView';\n\nconst mapStateToProps = (state) => ({\n apiKey: apiKeySelector(state),\n});\n\nconst mapDispatchToProps = (dispatch) => ({\n dispatchSetApiKey: (apiKey) => dispatch(appActions.setApiKey(apiKey)),\n});\n\nconst ApiKeyModalContainer = (props) => {\n const { dispatchSetApiKey, apiKey } = props;\n\n const [showModal, setShowModal] = useState(false);\n\n const handleShow = () => {\n setShowModal(true);\n };\n\n const handleHide = () => {\n setShowModal(false);\n };\n\n const submitForm = (values) => {\n // Check API key for random get method\n nodeApi\n .get('/wallet/status', {\n headers: {\n api_key: values.apiKey,\n },\n })\n .then(() => {\n dispatchSetApiKey(values.apiKey.trim());\n customToast('success', 'API key is set successfully');\n handleHide();\n })\n .catch(() => {\n customToast('error', 'Bad API key');\n });\n };\n\n return (\n \n );\n};\n\nexport default connect(mapStateToProps, mapDispatchToProps)(memo(ApiKeyModalContainer));\n","export const MODAL_STATES = {\n INIT: 'INIT',\n STATUS: 'STATUS',\n};\n","import React, { Component, memo } from 'react';\nimport Modal from 'react-bootstrap/Modal';\nimport { Formik, Field, Form } from 'formik';\nimport { connect } from 'react-redux';\nimport { isWalletUnlockedSelector } from '../../../store/selectors/wallet';\nimport walletActions from '../../../store/actions/walletActions';\nimport { apiKeySelector } from '../../../store/selectors/app';\nimport customToast from '../../../utils/toast';\nimport nodeApi from '../../../api/api';\nimport { MODAL_STATES } from '../utils';\n\nconst mapStateToProps = (state) => ({\n isWalletUnlocked: isWalletUnlockedSelector(state),\n apiKey: apiKeySelector(state),\n});\n\nconst mapDispatchToProps = (dispatch) => ({\n dispatchSetIsWalletUnlocked: (isWalletUnlock) =>\n dispatch(walletActions.setIsWalletUnlocked(isWalletUnlock)),\n});\n\nclass WalletStatusForm extends Component {\n state = {\n showModal: false,\n };\n\n handleShow = () => {\n this.props.onOpen(MODAL_STATES.STATUS);\n this.setState({ showModal: true });\n };\n\n handleHide = () => {\n this.props.onOpen(null);\n this.setState({ showModal: false });\n };\n\n walletUnlock = (pass) =>\n nodeApi.post(\n '/wallet/unlock',\n { pass },\n {\n headers: {\n api_key: this.props.apiKey,\n },\n },\n );\n\n walletLock = () =>\n nodeApi.get('/wallet/lock', {\n headers: {\n api_key: this.props.apiKey,\n },\n });\n\n submitWalletUnlockForm = ({ pass }, { setSubmitting, resetForm, setStatus }) => {\n setStatus({ status: 'submitting' });\n this.walletUnlock(pass)\n .then(() => {\n resetForm({ pass: '' });\n customToast('success', 'Your wallet is unlocked successfully');\n this.props.dispatchSetIsWalletUnlocked(true);\n this.handleHide();\n })\n .catch((err) => {\n const errMessage = err.data ? err.data.detail : err.message;\n customToast('error', errMessage);\n setSubmitting(false);\n });\n };\n\n submitWalletLockForm = () => {\n // eslint-disable-next-line\n if (confirm('Are you sure want to lock wallet?')) {\n this.walletLock()\n .then(() => {\n customToast('success', 'Your wallet is locked successfully');\n this.props.dispatchSetIsWalletUnlocked(false);\n })\n .catch((err) => {\n const errMessage = err.data ? err.data.detail : err.message;\n customToast('error', errMessage);\n });\n }\n };\n\n renderButton = () => {\n if (!this.props.isWalletUnlocked) {\n return (\n \n );\n }\n\n return (\n \n );\n };\n\n render() {\n return (\n
\n {this.renderButton()}\n this.handleHide()}\n centered\n aria-labelledby=\"example-custom-modal-styling-title\"\n >\n \n {({ isSubmitting }) => (\n
\n \n \n Unlock wallet form\n \n \n \n
\n \n \n \n * If you have it or leave field empty\n \n
\n
\n\n \n \n Close\n \n \n \n
\n )}\n
\n \n
\n );\n }\n}\nexport default connect(mapStateToProps, mapDispatchToProps)(memo(WalletStatusForm));\n","import React from 'react';\nimport copy from 'clipboard-copy';\nimport { Overlay, Tooltip } from 'react-bootstrap';\n\nclass CopyToClipboard extends React.PureComponent {\n constructor(props) {\n super(props);\n\n this.myRef = React.createRef();\n this.state = { showTooltip: false };\n }\n\n componentWillUnmount() {\n clearTimeout(this.state.timerId);\n }\n\n startTimer = () => {\n const timerId = setTimeout(() => this.setState({ showTooltip: false }), 1500);\n this.setState({ timerId });\n };\n\n onCopy = (e) => {\n e.preventDefault();\n copy(this.props.children);\n this.setState({ showTooltip: true });\n this.startTimer();\n };\n\n handleOnTooltipClose = () => {\n this.setState({ showTooltip: false });\n };\n\n render() {\n return (\n <>\n \n {this.props.children}\n \n \n Copied!\n \n \n );\n }\n}\n\nexport default CopyToClipboard;\n","import React, { Component, memo } from 'react';\nimport { Formik, Field, Form } from 'formik';\nimport nodeApi from '../../../api/api';\nimport CopyToClipboard from '../../common/CopyToClipboard';\nimport customToast from '../../../utils/toast';\n\nconst initialFormValues = {\n walletPassword: '',\n mnemonicPass: '',\n};\n\nclass WalletInitializeForm extends Component {\n state = { isShowMnemonic: false };\n\n walletInit = async ({ walletPassword, mnemonicPass }) => {\n const { data } = await nodeApi.post(\n '/wallet/init',\n { pass: walletPassword, mnemonicPass },\n {\n headers: {\n api_key: this.props.apiKey,\n },\n },\n );\n\n return data;\n };\n\n handleSubmit = (values, { setSubmitting, resetForm, setStatus }) => {\n setStatus({ status: 'submitting' });\n this.walletInit(values)\n .then((result) => {\n resetForm(initialFormValues);\n setStatus({\n state: 'success',\n msg: (\n <>\n Your wallet successfully initialized. Please, save your mnemonic -{' '}\n {result.mnemonic}\n \n ),\n });\n this.setState({ isShowMnemonic: true });\n })\n .catch((err) => {\n const errMessage = err.data ? err.data.detail : err.message;\n customToast('error', errMessage);\n setSubmitting(false);\n });\n };\n\n render() {\n return (\n
\n

Initialize wallet

\n \n {({ status, isSubmitting }) => (\n
\n {status && status.state === 'error' && (\n
\n {status.msg}\n
\n )}\n {status && status.state === 'success' && this.state.isShowMnemonic && (\n
\n this.setState({ isShowMnemonic: false })}\n >\n ×\n \n {status.msg}\n
\n )}\n
\n \n \n
\n
\n \n \n
\n \n
\n )}\n
\n
\n );\n }\n}\n\nexport default memo(WalletInitializeForm);\n","import React, { Component, memo } from 'react';\nimport { Formik, Field, Form } from 'formik';\nimport nodeApi from '../../../api/api';\nimport customToast from '../../../utils/toast';\n\nconst initialFormValues = {\n walletPassword: '',\n mnemonicPass: '',\n mnemonic: '',\n};\n\nclass WalletInitializeForm extends Component {\n walletRestore = async ({ walletPassword, mnemonicPass = '', mnemonic = '' }) => {\n if (!mnemonic || !String(mnemonic).trim()) {\n throw Error('Need to set mnemonic');\n }\n\n return nodeApi.post(\n '/wallet/restore',\n { pass: walletPassword, mnemonicPass, mnemonic },\n {\n headers: {\n api_key: this.props.apiKey,\n },\n },\n );\n };\n\n handleSubmit = (values, { setSubmitting, resetForm, setStatus }) => {\n setStatus({ status: 'submitting' });\n this.walletRestore(values)\n .then(() => {\n resetForm(initialFormValues);\n customToast('success', 'Your wallet successfully re-stored');\n })\n .catch((err) => {\n const errMessage = err.data ? err.data.detail : err.message;\n customToast('error', errMessage);\n setSubmitting(false);\n });\n };\n\n render() {\n return (\n
\n

Re-store wallet

\n \n {({ status, isSubmitting }) => (\n
\n {status && status.state === 'error' && (\n
\n {status.msg}\n
\n )}\n {status && status.state === 'success' && (\n
{status.msg}
\n )}\n
\n \n \n
\n
\n \n \n
\n
\n \n \n
\n \n
\n )}\n
\n
\n );\n }\n}\n\nexport default memo(WalletInitializeForm);\n","import React, { Component, memo } from 'react';\nimport Modal from 'react-bootstrap/Modal';\nimport { connect } from 'react-redux';\nimport { apiKeySelector } from '../../../store/selectors/app';\nimport appActions from '../../../store/actions/appActions';\nimport WalletInitializeForm from '../../elements/WalletInitializeForm';\nimport RestoreWalletForm from '../../elements/RestoreWalletForm';\nimport walletActions from '../../../store/actions/walletActions';\nimport { MODAL_STATES } from '../utils';\n\nconst mapStateToProps = (state) => ({\n apiKey: apiKeySelector(state),\n});\n\nconst mapDispatchToProps = (dispatch) => ({\n dispatchCheckWalletStatus: () => dispatch(walletActions.checkWalletStatus()),\n dispatchSetApiKey: (apiKey) => dispatch(appActions.setApiKey(apiKey)),\n});\n\nclass WalletInitModal extends Component {\n state = {\n showModal: false,\n };\n\n handleShow = () => {\n this.props.onOpen(MODAL_STATES.INIT);\n this.setState({ showModal: true });\n };\n\n handleHide = () => {\n this.props.onOpen(null);\n this.props.dispatchCheckWalletStatus();\n this.setState({ showModal: false });\n };\n\n renderButton = () => {\n return (\n \n );\n };\n\n render() {\n const { apiKey } = this.props;\n\n return (\n
\n {this.renderButton()}\n this.handleHide()} centered size=\"lg\">\n \n Wallet initialization\n \n \n
\n \n
\n
\n \n
\n
\n \n \n \n
\n
\n );\n }\n}\nexport default connect(mapStateToProps, mapDispatchToProps)(memo(WalletInitModal));\n","import React, { memo, useState } from 'react';\nimport { Navbar } from 'react-bootstrap';\nimport { Link } from 'react-router-dom';\nimport ApiKeyModal from './ApiKeyModal';\nimport WalletStatusModal from './WalletStatusModal';\nimport WalletInitModal from './WalletInitModal';\nimport logo from '../../assets/images/logotype_white.svg';\nimport { MODAL_STATES } from './utils';\n\nconst renderWalletForms = (isWalletInitialized, openedModal, setOpenedModal) => {\n if (isWalletInitialized === null) {\n return <>;\n }\n\n if (isWalletInitialized && openedModal !== MODAL_STATES.INIT) {\n return (\n
\n \n
\n );\n }\n\n return (\n
\n \n
\n );\n};\n\nconst HeaderView = ({ isApiKeySetted, isWalletInitialized }) => {\n const [openedModal, setOpenedModal] = useState(null);\n\n return (\n \n \n \n \"logotype\"\n \n \n
\n \n
\n {isApiKeySetted && renderWalletForms(isWalletInitialized, openedModal, setOpenedModal)}\n
\n );\n};\n\nexport default memo(HeaderView);\n","import HeaderContainer from './HeaderContainer';\n\nexport default HeaderContainer;\n","import React, { memo, useEffect } from 'react';\nimport { connect } from 'react-redux';\nimport { apiKeySelector } from '../../store/selectors/app';\nimport { isWalletInitializedSelector } from '../../store/selectors/wallet';\nimport walletActions from '../../store/actions/walletActions';\nimport HeaderView from './HeaderView';\n\nconst mapStateToProps = (state) => ({\n apiKey: apiKeySelector(state),\n isWalletInitialized: isWalletInitializedSelector(state),\n});\n\nconst mapDispatchToProps = (dispatch) => ({\n dispatchCheckWalletStatus: () => dispatch(walletActions.checkWalletStatus()),\n});\n\nconst HeaderContainer = (props) => {\n const { apiKey, dispatchCheckWalletStatus, isWalletInitialized } = props;\n\n useEffect(() => {\n if (apiKey !== '') {\n dispatchCheckWalletStatus();\n }\n }, [apiKey, dispatchCheckWalletStatus]);\n\n const isApiKeySetted = apiKey !== '';\n\n return ;\n};\n\nexport default connect(mapStateToProps, mapDispatchToProps)(memo(HeaderContainer));\n","import React from 'react';\nimport { withRouter } from 'react-router-dom';\nimport MenuList from '../common/MenuList';\nimport './index.scss';\nimport Header from '../Header';\n\nexport const Layout = withRouter((props) => {\n return (\n
\n
\n
\n \n
\n
\n
{props.children}
\n
\n
\n );\n});\n","import React from 'react';\nimport clsx from 'clsx';\nimport './index.scss';\n\nconst InfoCard = ({ color, children, className }) => {\n return (\n \n {children}\n \n );\n};\n\nexport default InfoCard;\n","import React, { Component } from 'react';\nimport { FontAwesomeIcon } from '@fortawesome/react-fontawesome';\nimport { faSync, faCheck } from '@fortawesome/free-solid-svg-icons';\nimport InfoCard from '../InfoCard';\n\nexport default class SynchCard extends Component {\n shouldComponentUpdate(nextProps) {\n if (\n this.getSynchronizationState(nextProps) !== this.getSynchronizationState(this.props.nodeInfo)\n ) {\n return true;\n }\n\n return false;\n }\n\n renderActiveSynchronization = () => (\n <>\n

Synchronization state

\n

\n Active synchronization\n

\n \n );\n\n renderCompleteSynchronization = () => (\n <>\n

Synchronization state

\n

\n Node is synced\n

\n \n );\n\n renderSynchronizationState = (state) =>\n ({\n active: this.renderActiveSynchronization,\n complete: this.renderCompleteSynchronization,\n }[state]);\n\n getSynchronizationState = ({ fullHeight, headersHeight }) => {\n if (fullHeight !== null && headersHeight !== null && fullHeight === headersHeight) {\n return 'complete';\n }\n\n return 'active';\n };\n\n render() {\n const currentSynchState = this.getSynchronizationState(this.props.nodeInfo);\n return (\n \n {this.renderSynchronizationState(currentSynchState)()}\n \n );\n }\n}\n","import React, { Component } from 'react';\nimport { FontAwesomeIcon } from '@fortawesome/react-fontawesome';\nimport { faSync, faCheck } from '@fortawesome/free-solid-svg-icons';\nimport InfoCard from '../InfoCard';\n\nexport default class WalletSyncCard extends Component {\n renderActiveSynchronization = () => (\n <>\n

Synchronization state

\n

\n Active synchronization\n

\n \n );\n\n renderCompleteSynchronization = () => (\n <>\n

Synchronization state

\n

\n Wallet is synced\n

\n \n );\n\n renderSynchronizationState = (state) =>\n ({\n active: this.renderActiveSynchronization,\n complete: this.renderCompleteSynchronization,\n }[state]);\n\n getSynchronizationState = (walletStatusData, headersHeight) => {\n if (\n walletStatusData.walletHeight !== null &&\n headersHeight !== null &&\n walletStatusData.walletHeight === headersHeight\n ) {\n return 'complete';\n }\n\n return 'active';\n };\n\n render() {\n const { walletStatusData, headersHeight } = this.props;\n const currentSynchState = this.getSynchronizationState(walletStatusData, headersHeight);\n return (\n \n {this.renderSynchronizationState(currentSynchState)()}\n \n );\n }\n}\n","import React from 'react';\nimport './index.scss';\n\nconst LoaderLogo = () => {\n return (\n
\n \n \n \n \n
\n );\n};\n\nexport default LoaderLogo;\n","import React from 'react';\nimport { faExclamationTriangle } from '@fortawesome/free-solid-svg-icons';\nimport { FontAwesomeIcon } from '@fortawesome/react-fontawesome';\nimport { format } from 'date-fns';\nimport constants from 'utils/constants';\nimport InfoCard from './InfoCard';\nimport SynchCard from './SynchCard';\nimport WalletSyncCard from './WalletSyncCard';\nimport LoaderLogo from '../../common/ErgoLoader/index';\n\nconst getWalletStatus = (isWalletInitialized) => {\n if (!isWalletInitialized) {\n return 'Not initialized';\n }\n\n return 'Initialized';\n};\n\nconst DashboardView = ({\n error,\n nodeInfo,\n isWalletInitialized,\n walletStatusData,\n walletBalanceData,\n ergPrice,\n}) => {\n if (error !== null) {\n return (\n <>\n
\n

\n \n  \n {error}\n

\n
\n \n );\n }\n\n if (nodeInfo === null) {\n return (\n <>\n
\n \n
\n \n );\n }\n\n const { peersCount, bestHeaderId, launchTime, fullHeight, appVersion, isMining } = nodeInfo;\n\n return (\n <>\n
\n

Node Information

\n
\n
\n \n

Version

\n

{appVersion}

\n
\n
\n
\n \n
\n
\n \n

Started at

\n

\n {format(new Date(launchTime), 'MM-dd-yyyy HH:mm:ss')}\n

\n
\n
\n {fullHeight === null ? null : (\n
\n \n

Current height

\n

{fullHeight}

\n
\n
\n )}\n {bestHeaderId === null ? null : (\n
\n \n

Best block id

\n

{bestHeaderId}

\n
\n
\n )}\n
\n \n

Mining enabled

\n

{isMining ? 'Yes' : 'No'}

\n
\n
\n
\n \n

Peers connected

\n

{peersCount}

\n
\n
\n
\n
\n {ergPrice && (\n
\n

ERG Information

\n
\n
\n \n

\n ERG price in $
\n (based on oracle pool data)\n

\n

{ergPrice}

\n
\n
\n
\n
\n )}\n {walletStatusData && (\n
\n

Wallet Information

\n
\n
\n \n

Initialization state

\n

{getWalletStatus(isWalletInitialized)}

\n
\n
\n
\n \n

Lock state

\n

\n {walletStatusData.isUnlocked ? 'Unlocked' : 'Locked'}\n

\n
\n
\n
\n \n
\n {walletBalanceData && (\n
\n \n

Balance

\n

\n {walletBalanceData.balance / constants.nanoErgInErg} ERG{' '}\n {ergPrice &&\n `~ $${Number(\n ergPrice * (walletBalanceData.balance / constants.nanoErgInErg),\n ).toFixed(2)}`}\n

\n
\n
\n )}\n {walletBalanceData && (\n
\n \n

Assets

\n

\n {Object.values(walletBalanceData.assets).length || '0'}\n

\n
\n
\n )}\n
\n
\n )}\n \n );\n};\n\nexport default DashboardView;\n","import { useEffect, useRef } from 'react';\n\nfunction usePrevious(value) {\n // The ref object is a generic container whose current property is mutable ...\n // ... and can hold any value, similar to an instance property on a class\n const ref = useRef();\n\n // Store current value in ref\n useEffect(() => {\n ref.current = value;\n }, [value]); // Only re-run if value changes\n\n // Return previous value (happens before update in useEffect above)\n return ref.current;\n}\n\nexport default usePrevious;\n","import React, { useState, useEffect, useCallback, memo } from 'react';\nimport { connect } from 'react-redux';\nimport nodeApi from '../../../api/api';\nimport DashboardView from './DashboardView';\nimport {\n isWalletInitializedSelector,\n isWalletUnlockedSelector,\n walletStatusDataSelector,\n walletBalanceDataSelector,\n ergPriceSelector,\n} from '../../../store/selectors/wallet';\nimport { apiKeySelector } from '../../../store/selectors/app';\nimport usePrevious from '../../../hooks/usePrevious';\nimport walletActions from '../../../store/actions/walletActions';\n\nconst mapStateToProps = (state) => ({\n apiKey: apiKeySelector(state),\n isWalletInitialized: isWalletInitializedSelector(state),\n isWalletUnlocked: isWalletUnlockedSelector(state),\n walletStatusData: walletStatusDataSelector(state),\n walletBalanceData: walletBalanceDataSelector(state),\n ergPrice: ergPriceSelector(state),\n});\n\nconst mapDispatchToProps = (dispatch) => ({\n dispatchCheckWalletStatus: () => dispatch(walletActions.checkWalletStatus()),\n dispatchGetWalletBalance: () => dispatch(walletActions.getWalletBalance()),\n dispatchGetErgPrice: () => dispatch(walletActions.getErgPrice()),\n});\n\nconst DashboardContainer = (props) => {\n const {\n isWalletInitialized,\n isWalletUnlocked,\n apiKey,\n dispatchCheckWalletStatus,\n dispatchGetWalletBalance,\n dispatchGetErgPrice,\n walletStatusData,\n walletBalanceData,\n ergPrice,\n } = props;\n\n const [nodeInfo, setNodeInfo] = useState(null);\n const [error, setError] = useState(null);\n const [timerId, setTimerId] = useState(null);\n\n const getNodeCurrentState = () => nodeApi.get('/info');\n\n const setNodeCurrentState = useCallback(async () => {\n try {\n const { data } = await getNodeCurrentState();\n\n setNodeInfo(data);\n setError(null);\n } catch {\n setError('Node connection is lost.');\n }\n }, []);\n\n const setTimer = useCallback(() => {\n const newTimerId = setInterval(() => {\n setNodeCurrentState();\n dispatchGetErgPrice();\n\n if (apiKey) {\n dispatchCheckWalletStatus();\n dispatchGetWalletBalance();\n }\n }, 2000);\n\n setTimerId(newTimerId);\n }, [\n apiKey,\n dispatchCheckWalletStatus,\n dispatchGetErgPrice,\n dispatchGetWalletBalance,\n setNodeCurrentState,\n ]);\n\n const prevError = usePrevious(error);\n useEffect(() => {\n if (prevError && prevError !== error) {\n dispatchCheckWalletStatus();\n dispatchGetWalletBalance();\n dispatchGetErgPrice();\n }\n }, [dispatchCheckWalletStatus, dispatchGetErgPrice, dispatchGetWalletBalance, error, prevError]);\n\n useEffect(() => {\n setNodeCurrentState();\n dispatchGetErgPrice();\n\n if (apiKey) {\n dispatchCheckWalletStatus();\n dispatchGetWalletBalance();\n }\n\n setTimer();\n // eslint-disable-next-line\n }, [apiKey]);\n\n useEffect(\n () => () => {\n clearInterval(timerId);\n },\n [timerId, apiKey],\n );\n\n return (\n \n );\n};\n\nexport default connect(mapStateToProps, mapDispatchToProps)(memo(DashboardContainer));\n","import DashboardContainer from './DashboardContainer';\nimport './index.scss';\n\nexport default DashboardContainer;\n","import { useEffect, useState } from 'react';\n\nconst isBrowser = (): boolean => {\n return Boolean(typeof window !== 'undefined' && window.document && window.document.createElement);\n};\n\ntype SSRState = {\n isBrowser: boolean;\n isServer: boolean;\n};\n\nconst useSSR = (): SSRState => {\n const [browser, setBrowser] = useState(false);\n useEffect(() => {\n setBrowser(isBrowser());\n }, []);\n\n return {\n isBrowser: browser,\n isServer: !browser,\n };\n};\n\nconst createElement = (id: string): HTMLElement => {\n const el = document.createElement('div');\n el.setAttribute('id', id);\n return el;\n};\n\nconst usePortal = (\n selectId: string = Math.random().toString(32).slice(2, 10),\n): HTMLElement | null => {\n const id = `id-${selectId}`;\n const isUsingBrowser = useSSR().isBrowser;\n const [elSnapshot, setElSnapshot] = useState(\n isUsingBrowser ? createElement(id) : null,\n );\n\n useEffect(() => {\n const hasElement = document.querySelector(`#${id}`);\n const el = hasElement || createElement(id);\n\n if (!hasElement) {\n document.body.appendChild(el);\n }\n setElSnapshot(el);\n }, []);\n\n return elSnapshot;\n};\n\nexport default usePortal;\n","import { Dispatch, RefObject, SetStateAction, useEffect, useRef, useState } from 'react';\n/* eslint-disable */\nexport type ElementStackItem = {\n last: string;\n};\n\nexport type BodyScrollOptions = {\n scrollLayer: boolean;\n};\n\nconst defaultOptions: BodyScrollOptions = {\n scrollLayer: false,\n};\n\nconst elementStack = new Map();\n\nconst isIos = () => {\n /* istanbul ignore next */\n if (typeof window === 'undefined' || !window.navigator) return false;\n return /iP(ad|hone|od)/.test(window.navigator.platform);\n};\n\nconst touchHandler = (event: TouchEvent): boolean => {\n if (event.touches && event.touches.length > 1) return true;\n event.preventDefault();\n return false;\n};\n\nconst useBodyScroll = (\n elementRef?: RefObject | null,\n options?: BodyScrollOptions\n): [boolean, Dispatch>] => {\n if (typeof document === 'undefined')\n return [false, (t: SetStateAction) => t];\n const elRef = elementRef || useRef(document.body);\n const [hidden, setHidden] = useState(false);\n const safeOptions = {\n ...defaultOptions,\n ...(options || {}),\n };\n\n // don't prevent touch event when layer contain scroll\n const isIosWithCustom = () => {\n if (safeOptions.scrollLayer) return false;\n return isIos();\n };\n\n useEffect(() => {\n if (!elRef || !elRef.current) return;\n const lastOverflow = elRef.current.style.overflow;\n if (hidden) {\n if (elementStack.has(elRef.current)) return;\n if (!isIosWithCustom()) {\n elRef.current.style.overflow = 'hidden';\n } else {\n document.addEventListener('touchmove', touchHandler, {\n passive: false,\n });\n }\n elementStack.set(elRef.current, {\n last: lastOverflow,\n });\n return;\n }\n\n // reset element overflow\n if (!elementStack.has(elRef.current)) return;\n if (!isIosWithCustom()) {\n const store = elementStack.get(elRef.current) as ElementStackItem;\n elRef.current.style.overflow = store.last;\n } else {\n document.removeEventListener('touchmove', touchHandler);\n }\n elementStack.delete(elRef.current);\n }, [hidden, elRef]);\n\n return [hidden, setHidden];\n};\n\nexport default useBodyScroll;\n\n/* eslint-disable */\n","import { Dispatch, MutableRefObject, SetStateAction, useEffect, useRef, useState } from 'react';\n\nexport type CurrentStateType = [S, Dispatch>, MutableRefObject];\n\n// Добавляет ref, по которому текущее значение стейта можно получить\n// сразу вместо того чтобы ждать следующего рендера\nconst useCurrentState = (initialState: S | (() => S)): CurrentStateType => {\n const [state, setState] = useState(() => {\n return typeof initialState === 'function' ? (initialState as () => S)() : initialState;\n });\n const ref = useRef(initialState as S);\n\n useEffect(() => {\n ref.current = state;\n }, [state]);\n\n const setValue = (val: SetStateAction) => {\n const result = typeof val === 'function' ? (val as (prevState: S) => S)(ref.current) : val;\n ref.current = result;\n setState(result);\n };\n\n return [state, setValue, ref];\n};\n\nexport default useCurrentState;\n","import React, { ReactNode } from 'react';\nimport cn from 'classnames';\n\ntype TextVariant =\n | 'h1'\n | 'h2'\n | 'h3'\n | 'h4'\n | 'h5'\n | 'h6'\n | 'subtitle1'\n | 'subtitle2'\n | 'body-text1'\n | 'body-text2'\n | 'small-text1'\n | 'small-text2'\n | 'small-text3';\n\nexport type TextColor =\n | 'brandOrange'\n | 'purple'\n | 'black'\n | 'spaceGray'\n | 'gray5'\n | 'gray4'\n | 'gray3'\n | 'gray2'\n | 'gray1'\n | 'white'\n | 'orange'\n | 'red'\n | 'green'\n | 'blue'\n | 'blueHover'\n | 'brandOrangeHover'\n | 'brandOrangeActive'\n | 'purpleHover'\n | 'purpleActive';\n\nexport type TextComponent = 'span' | 'p' | 'div' | 'h1' | 'label' | 'h2' | 'h3';\n\ninterface IText {\n children?: ReactNode;\n variant?: TextVariant;\n xl?: TextVariant;\n lg?: TextVariant;\n md?: TextVariant;\n sm?: TextVariant;\n component?: TextComponent;\n color?: TextColor;\n className?: string;\n dangerouslySetInnerHTML?: any;\n htmlFor?: string;\n}\n\nconst Text = ({\n children,\n variant,\n component,\n color,\n className,\n dangerouslySetInnerHTML,\n ...props\n}: IText) => {\n const currentVariant = variant;\n\n const Component = component || 'p';\n\n if (dangerouslySetInnerHTML) {\n return (\n <>\n \n\n \n \n );\n }\n\n return (\n \n {children}\n \n \n );\n};\n\nexport default Text;\n","import React from 'react';\n\n// Прокидывает default параметры в компонент\nconst withDefaults = (component: React.ComponentType

, defaultProps: DP) => {\n type Props = Partial & Omit;\n // eslint-disable-next-line\n component.defaultProps = defaultProps;\n return component as React.ComponentType;\n};\n\nexport default withDefaults;\n","import React, { useEffect, useState } from 'react';\nimport withDefaults from 'utils/withDefaults';\n\ninterface Props {\n visible?: boolean;\n enterTime?: number;\n leaveTime?: number;\n clearTime?: number;\n className?: string;\n name?: string;\n}\n\nconst defaultProps = {\n visible: false,\n enterTime: 60,\n leaveTime: 60,\n clearTime: 60,\n className: '',\n name: 'transition',\n};\n\nexport type CSSTransitionProps = Props & typeof defaultProps;\n\nconst CSSTransition: React.FC> = ({\n children,\n className,\n visible,\n enterTime,\n leaveTime,\n clearTime,\n name,\n ...props\n}) => {\n const [classes, setClasses] = useState('');\n const [renderable, setRenderable] = useState(visible);\n\n useEffect(() => {\n const statusClassName = visible ? 'enter' : 'leave';\n const time = visible ? enterTime : leaveTime;\n if (visible && !renderable) {\n setRenderable(true);\n }\n\n setClasses(`${name}-${statusClassName}`);\n\n // set class to active\n const timer = setTimeout(() => {\n setClasses(`${name}-${statusClassName} ${name}-${statusClassName}-active`);\n clearTimeout(timer);\n }, time);\n\n // remove classess when animation over\n const clearClassesTimer = setTimeout(() => {\n if (!visible) {\n setClasses('');\n setRenderable(false);\n }\n clearTimeout(clearClassesTimer);\n }, time + clearTime);\n\n return () => {\n clearTimeout(timer);\n clearTimeout(clearClassesTimer);\n };\n }, [visible, renderable]);\n if (!React.isValidElement(children) || !renderable) return null;\n\n return React.cloneElement(children, {\n ...props,\n className: `${children.props.className} ${className} ${classes}`,\n });\n};\n\nexport default withDefaults(CSSTransition, defaultProps);\n","import React, { MouseEvent, useCallback, ReactElement } from 'react';\nimport withDefaults from 'utils/withDefaults';\nimport useCurrentState from 'hooks/useCurrentState';\nimport cn from 'classnames';\nimport CssTransition from '../CssTransition/CssTransition';\nimport styles from './Backdrop.module.scss';\n\ninterface Props {\n onClick?: (event: MouseEvent) => void;\n visible?: boolean;\n children?: ReactElement;\n className?: string;\n}\n\nconst defaultProps = {\n onClick: () => {},\n visible: false,\n};\n\nexport type BackdropProps = Props & typeof defaultProps;\n\nconst Backdrop: React.FC> = React.memo(\n ({ children, onClick, visible, className }: BackdropProps) => {\n const [, setIsContentMouseDown, IsContentMouseDownRef] = useCurrentState(false);\n const clickHandler = (event: MouseEvent) => {\n if (IsContentMouseDownRef.current) return;\n if (onClick) {\n onClick(event);\n }\n };\n const childrenClickHandler = useCallback((event: MouseEvent) => {\n event.stopPropagation();\n }, []);\n const mouseUpHandler = () => {\n if (!IsContentMouseDownRef.current) return;\n const timer = setTimeout(() => {\n setIsContentMouseDown(false);\n clearTimeout(timer);\n }, 0);\n };\n\n return (\n \n

\n
\n setIsContentMouseDown(true)}\n >\n {children}\n
\n
\n \n );\n },\n);\n\nexport default withDefaults(Backdrop, defaultProps);\n","import React from 'react';\n\nexport interface ModalConfig {\n close?: () => void;\n}\n\nconst defaultContext = {};\n\nexport const ModalContext = React.createContext(defaultContext);\n\nexport const useModalContext = (): ModalConfig => React.useContext(ModalContext);\n","function _extends() { _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }\n\nfunction _objectWithoutProperties(source, excluded) { if (source == null) return {}; var target = _objectWithoutPropertiesLoose(source, excluded); var key, i; if (Object.getOwnPropertySymbols) { var sourceSymbolKeys = Object.getOwnPropertySymbols(source); for (i = 0; i < sourceSymbolKeys.length; i++) { key = sourceSymbolKeys[i]; if (excluded.indexOf(key) >= 0) continue; if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue; target[key] = source[key]; } } return target; }\n\nfunction _objectWithoutPropertiesLoose(source, excluded) { if (source == null) return {}; var target = {}; var sourceKeys = Object.keys(source); var key, i; for (i = 0; i < sourceKeys.length; i++) { key = sourceKeys[i]; if (excluded.indexOf(key) >= 0) continue; target[key] = source[key]; } return target; }\n\nimport React from \"react\";\n\nvar _ref2 = /*#__PURE__*/React.createElement(\"path\", {\n d: \"M10.7951 9.30799C10.3844 8.89734 9.71865 8.89734 9.30799 9.30799C8.89734 9.71865 8.89734 10.3844 9.30799 10.7951L14.5129 16L9.30799 21.2049C8.89734 21.6156 8.89734 22.2814 9.30799 22.692C9.71865 23.1027 10.3844 23.1027 10.7951 22.692L16 17.4871L21.2049 22.692C21.6156 23.1027 22.2814 23.1027 22.692 22.692C23.1027 22.2814 23.1027 21.6156 22.692 21.2049L17.4871 16L22.692 10.7951C23.1027 10.3844 23.1027 9.71865 22.692 9.30799C22.2814 8.89734 21.6156 8.89734 21.2049 9.30799L16 14.5129L10.7951 9.30799Z\",\n fill: \"#76767A\"\n});\n\nvar SvgClose = function SvgClose(_ref) {\n var svgRef = _ref.svgRef,\n title = _ref.title,\n props = _objectWithoutProperties(_ref, [\"svgRef\", \"title\"]);\n\n return /*#__PURE__*/React.createElement(\"svg\", _extends({\n width: 32,\n height: 32,\n viewBox: \"0 0 32 32\",\n fill: \"none\",\n ref: svgRef\n }, props), title ? /*#__PURE__*/React.createElement(\"title\", null, title) : null, _ref2);\n};\n\nvar ForwardRef = /*#__PURE__*/React.forwardRef(function (props, ref) {\n return /*#__PURE__*/React.createElement(SvgClose, _extends({\n svgRef: ref\n }, props));\n});\nexport default __webpack_public_path__ + \"static/media/close.feae5a5c.svg\";\nexport { ForwardRef as ReactComponent };","function _extends() { _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }\n\nfunction _objectWithoutProperties(source, excluded) { if (source == null) return {}; var target = _objectWithoutPropertiesLoose(source, excluded); var key, i; if (Object.getOwnPropertySymbols) { var sourceSymbolKeys = Object.getOwnPropertySymbols(source); for (i = 0; i < sourceSymbolKeys.length; i++) { key = sourceSymbolKeys[i]; if (excluded.indexOf(key) >= 0) continue; if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue; target[key] = source[key]; } } return target; }\n\nfunction _objectWithoutPropertiesLoose(source, excluded) { if (source == null) return {}; var target = {}; var sourceKeys = Object.keys(source); var key, i; for (i = 0; i < sourceKeys.length; i++) { key = sourceKeys[i]; if (excluded.indexOf(key) >= 0) continue; target[key] = source[key]; } return target; }\n\nimport React from \"react\";\n\nvar _ref2 = /*#__PURE__*/React.createElement(\"path\", {\n d: \"M10.6668 0.666748H2.66683C1.9335 0.666748 1.3335 1.26675 1.3335 2.00008V11.3334H2.66683V2.00008H10.6668V0.666748ZM10.0002 3.33341L14.0002 7.33341V14.0001C14.0002 14.7334 13.4002 15.3334 12.6668 15.3334H5.32683C4.5935 15.3334 4.00016 14.7334 4.00016 14.0001L4.00683 4.66675C4.00683 3.93341 4.60016 3.33341 5.3335 3.33341H10.0002ZM9.3335 8.00008H13.0002L9.3335 4.33341V8.00008Z\",\n fill: \"#0078FF\"\n});\n\nvar SvgCopyicon = function SvgCopyicon(_ref) {\n var svgRef = _ref.svgRef,\n title = _ref.title,\n props = _objectWithoutProperties(_ref, [\"svgRef\", \"title\"]);\n\n return /*#__PURE__*/React.createElement(\"svg\", _extends({\n width: 16,\n height: 16,\n viewBox: \"0 0 16 16\",\n fill: \"none\",\n ref: svgRef\n }, props), title ? /*#__PURE__*/React.createElement(\"title\", null, title) : null, _ref2);\n};\n\nvar ForwardRef = /*#__PURE__*/React.forwardRef(function (props, ref) {\n return /*#__PURE__*/React.createElement(SvgCopyicon, _extends({\n svgRef: ref\n }, props));\n});\nexport default __webpack_public_path__ + \"static/media/copy.icon.835ebda7.svg\";\nexport { ForwardRef as ReactComponent };","function _extends() { _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }\n\nfunction _objectWithoutProperties(source, excluded) { if (source == null) return {}; var target = _objectWithoutPropertiesLoose(source, excluded); var key, i; if (Object.getOwnPropertySymbols) { var sourceSymbolKeys = Object.getOwnPropertySymbols(source); for (i = 0; i < sourceSymbolKeys.length; i++) { key = sourceSymbolKeys[i]; if (excluded.indexOf(key) >= 0) continue; if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue; target[key] = source[key]; } } return target; }\n\nfunction _objectWithoutPropertiesLoose(source, excluded) { if (source == null) return {}; var target = {}; var sourceKeys = Object.keys(source); var key, i; for (i = 0; i < sourceKeys.length; i++) { key = sourceKeys[i]; if (excluded.indexOf(key) >= 0) continue; target[key] = source[key]; } return target; }\n\nimport React from \"react\";\n\nvar _ref2 = /*#__PURE__*/React.createElement(\"path\", {\n d: \"M13.3332 7.99992C13.3332 8.36811 13.0347 8.66659 12.6665 8.66659H3.33317C2.96498 8.66659 2.6665 8.36811 2.6665 7.99992C2.6665 7.63173 2.96498 7.33325 3.33317 7.33325H12.6665C13.0347 7.33325 13.3332 7.63173 13.3332 7.99992Z\",\n fill: \"#0078FF\"\n});\n\nvar SvgRemove = function SvgRemove(_ref) {\n var svgRef = _ref.svgRef,\n title = _ref.title,\n props = _objectWithoutProperties(_ref, [\"svgRef\", \"title\"]);\n\n return /*#__PURE__*/React.createElement(\"svg\", _extends({\n width: 16,\n height: 16,\n viewBox: \"0 0 16 16\",\n fill: \"none\",\n ref: svgRef\n }, props), title ? /*#__PURE__*/React.createElement(\"title\", null, title) : null, _ref2);\n};\n\nvar ForwardRef = /*#__PURE__*/React.forwardRef(function (props, ref) {\n return /*#__PURE__*/React.createElement(SvgRemove, _extends({\n svgRef: ref\n }, props));\n});\nexport default __webpack_public_path__ + \"static/media/remove.94c0849a.svg\";\nexport { ForwardRef as ReactComponent };","import React from 'react';\n\nimport { ReactComponent as copyIcon } from '../../../assets/images/icons/copy.icon.svg';\nimport { ReactComponent as removeIcon } from '../../../assets/images/icons/remove.svg';\n\nexport interface IconProps {\n className?: string;\n}\n\nexport const makeIcon = (Icon: any, className?: string) => {\n return ;\n};\n\nexport const CopyIcon = ({ className }: IconProps) => {\n return makeIcon(copyIcon, className);\n};\n\nexport const RemoveIcon = ({ className }: IconProps) => {\n return makeIcon(removeIcon, className);\n};\n","import { ReactComponent as closeImage } from 'assets/images/icons/close.svg';\nimport { makeIcon, IconProps } from './icons';\n\nexport const CloseIcon = ({ className }: IconProps) => {\n return makeIcon(closeImage, className);\n};\n","import React, { useEffect, useMemo, useCallback } from 'react';\nimport { createPortal } from 'react-dom';\nimport usePortal from 'hooks/usePortal';\nimport useBodyScroll from 'hooks/useBodyScroll';\nimport useCurrentState from 'hooks/useCurrentState';\nimport Text from 'components/common/Text/Text';\nimport Backdrop from '../Backdrop/Backdrop';\nimport { ModalConfig, ModalContext } from './modal-context';\nimport CssTransition from '../CssTransition/CssTransition';\nimport { CloseIcon } from '../icons/CloseIcon';\n\ninterface Props {\n title?: React.ReactNode;\n description?: React.ReactNode;\n primaryButtonContent: React.ReactNode;\n secondaryButtonContent: React.ReactNode;\n disableBackdropClick?: boolean;\n onClose?: () => void;\n onOpen?: () => void;\n onPrimaryHandler?: () => void;\n onSecondaryHandler?: () => void;\n open?: boolean;\n width?: string;\n wrapClassName?: string;\n}\n\nconst defaultProps = {\n width: '26rem',\n wrapClassName: '',\n disableBackdropClick: false,\n};\n\ntype NativeAttrs = Omit, keyof Props>;\nexport type ModalProps = Props & typeof defaultProps & NativeAttrs;\n\nconst InfoModal: React.FC> = ({\n title,\n description,\n primaryButtonContent,\n secondaryButtonContent,\n disableBackdropClick,\n onClose,\n onOpen,\n onPrimaryHandler,\n onSecondaryHandler,\n open,\n}) => {\n const portal = usePortal('modal');\n const [, setBodyHidden] = useBodyScroll(null, { scrollLayer: true });\n const [visible, setVisible, visibleRef] = useCurrentState(false);\n\n const closeModal = useCallback(() => {\n if (onClose) {\n onClose();\n }\n setVisible(false);\n setBodyHidden(false);\n }, [onClose, setVisible, setBodyHidden]);\n\n useEffect(() => {\n if (open === undefined) return;\n if (open && onOpen) {\n onOpen();\n }\n if (!open && visibleRef.current && onClose) {\n onClose();\n }\n\n setVisible(open);\n setBodyHidden(open);\n }, [open]);\n\n const closeFromBackdrop = () => {\n if (disableBackdropClick) return;\n closeModal();\n };\n\n const primaryButtonClickHandler = () => {\n if (onPrimaryHandler) {\n onPrimaryHandler();\n }\n if (onClose) {\n onClose();\n }\n };\n\n const secondaryButtonClickHandler = () => {\n if (onSecondaryHandler) {\n onSecondaryHandler();\n }\n if (onClose) {\n onClose();\n }\n };\n\n const modalConfig: ModalConfig = useMemo(\n () => ({\n close: closeModal,\n }),\n [closeModal],\n );\n\n if (!portal) return null;\n\n return createPortal(\n \n \n \n
\n
\n

{title}

\n \n {description}\n \n \n {primaryButtonContent}\n \n \n {secondaryButtonContent}\n \n
\n \n\n \n
\n
\n
\n
,\n portal,\n );\n};\n\ntype ModalComponent

= React.FC

;\ntype ComponentProps = Partial &\n Omit &\n NativeAttrs;\n\nInfoModal.defaultProps = defaultProps;\n\nexport default InfoModal as ModalComponent;\n","import React, { useState, useCallback } from 'react';\nimport { Form, Field } from 'react-final-form';\nimport InfoModal from 'components/common/InfoModal/InfoModal';\nimport cn from 'classnames';\nimport nodeApi from '../../../../../api/api';\nimport customToast from '../../../../../utils/toast';\nimport CopyToClipboard from '../../../../common/CopyToClipboard';\nimport constants from '../../../../../utils/constants';\n\ntype Errors = {\n recipientAddress?: string;\n amount?: string;\n};\n\nconst PaymentSendForm = ({ apiKey }: { apiKey: string }) => {\n const [transactionId, setTransactionId] = useState(null);\n const [isSendedModalOpen, setIsSendedModalOpen] = useState(false);\n\n const paymentSend = useCallback(\n ({ recipientAddress, amount }) =>\n nodeApi.post(\n '/wallet/payment/send',\n [\n {\n address: recipientAddress,\n value: Number((parseFloat(amount) * constants.nanoErgInErg).toFixed(1)),\n },\n ],\n {\n headers: {\n api_key: apiKey,\n },\n },\n ),\n [apiKey],\n );\n\n const resetForm = (form: any) => {\n form.restart();\n setIsSendedModalOpen(false);\n };\n\n const sendForm = useCallback(\n (values) => {\n if (values.recipientAddress.trim() === '' || !values.recipientAddress) {\n return;\n }\n\n paymentSend(values)\n .then(({ data }) => {\n setTransactionId(data);\n setIsSendedModalOpen(true);\n })\n .catch((err) => {\n const errMessage = err.data ? err.data.detail : err.message;\n customToast('error', errMessage);\n });\n },\n [paymentSend],\n );\n\n const validateForm = useCallback((values) => {\n const errors: Errors = {};\n if (!values.recipientAddress) {\n errors.recipientAddress = 'The field cannot be empty';\n }\n if (!values.amount || values.amount < 0.001) {\n errors.amount = 'Minimum 0.001 ERG';\n }\n return errors;\n }, []);\n\n return (\n

\n
\n

Payment send

\n (\n <>\n
\n
\n \n (\n <>\n \n
{meta.error}
\n \n )}\n />\n
\n
\n \n (\n <>\n \n
{meta.error}
\n \n )}\n />\n
\n \n
\n\n {\n setIsSendedModalOpen(false);\n }}\n title=\"Payment sent\"\n description={\n <>\n

\n Your payment has been sent successfully. The transaction ID is -{' '}\n {transactionId}\n

\n

\n \n Click Here To Go To The Explorer\n \n

\n \n }\n primaryButtonContent={OK}\n secondaryButtonContent=\"Send again\"\n onPrimaryHandler={() => resetForm(form)}\n />\n \n )}\n />\n
\n
\n );\n};\n\nexport default PaymentSendForm;\n","function _extends() { _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }\n\nfunction _objectWithoutProperties(source, excluded) { if (source == null) return {}; var target = _objectWithoutPropertiesLoose(source, excluded); var key, i; if (Object.getOwnPropertySymbols) { var sourceSymbolKeys = Object.getOwnPropertySymbols(source); for (i = 0; i < sourceSymbolKeys.length; i++) { key = sourceSymbolKeys[i]; if (excluded.indexOf(key) >= 0) continue; if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue; target[key] = source[key]; } } return target; }\n\nfunction _objectWithoutPropertiesLoose(source, excluded) { if (source == null) return {}; var target = {}; var sourceKeys = Object.keys(source); var key, i; for (i = 0; i < sourceKeys.length; i++) { key = sourceKeys[i]; if (excluded.indexOf(key) >= 0) continue; target[key] = source[key]; } return target; }\n\nimport React from \"react\";\n\nvar _ref2 = /*#__PURE__*/React.createElement(\"g\", null, /*#__PURE__*/React.createElement(\"path\", {\n d: \"M39.622,21.746l-6.749,6.75c-0.562,0.562-1.326,0.879-2.122,0.879s-1.56-0.316-2.121-0.879l-6.75-6.75 c-1.171-1.171-1.171-3.071,0-4.242c1.171-1.172,3.071-1.172,4.242,0l1.832,1.832C27.486,13.697,22.758,9.25,17,9.25 c-6.064,0-11,4.935-11,11c0,6.064,4.936,11,11,11c1.657,0,3,1.343,3,3s-1.343,3-3,3c-9.373,0-17-7.626-17-17s7.627-17,17-17 c8.936,0,16.266,6.933,16.936,15.698l1.442-1.444c1.172-1.172,3.072-1.172,4.242,0C40.792,18.674,40.792,20.574,39.622,21.746z\"\n}));\n\nvar _ref3 = /*#__PURE__*/React.createElement(\"g\", null);\n\nvar _ref4 = /*#__PURE__*/React.createElement(\"g\", null);\n\nvar _ref5 = /*#__PURE__*/React.createElement(\"g\", null);\n\nvar _ref6 = /*#__PURE__*/React.createElement(\"g\", null);\n\nvar _ref7 = /*#__PURE__*/React.createElement(\"g\", null);\n\nvar _ref8 = /*#__PURE__*/React.createElement(\"g\", null);\n\nvar _ref9 = /*#__PURE__*/React.createElement(\"g\", null);\n\nvar _ref10 = /*#__PURE__*/React.createElement(\"g\", null);\n\nvar _ref11 = /*#__PURE__*/React.createElement(\"g\", null);\n\nvar _ref12 = /*#__PURE__*/React.createElement(\"g\", null);\n\nvar _ref13 = /*#__PURE__*/React.createElement(\"g\", null);\n\nvar _ref14 = /*#__PURE__*/React.createElement(\"g\", null);\n\nvar _ref15 = /*#__PURE__*/React.createElement(\"g\", null);\n\nvar _ref16 = /*#__PURE__*/React.createElement(\"g\", null);\n\nvar _ref17 = /*#__PURE__*/React.createElement(\"g\", null);\n\nvar SvgRedoArrowSymbol = function SvgRedoArrowSymbol(_ref) {\n var svgRef = _ref.svgRef,\n title = _ref.title,\n props = _objectWithoutProperties(_ref, [\"svgRef\", \"title\"]);\n\n return /*#__PURE__*/React.createElement(\"svg\", _extends({\n id: \"Capa_1\",\n x: \"0px\",\n y: \"0px\",\n width: \"32px\",\n height: \"32px\",\n viewBox: \"0 0 40.499 40.5\",\n style: {\n enableBackground: \"new 0 0 40.499 40.5\"\n },\n xmlSpace: \"preserve\",\n ref: svgRef\n }, props), title ? /*#__PURE__*/React.createElement(\"title\", null, title) : null, _ref2, _ref3, _ref4, _ref5, _ref6, _ref7, _ref8, _ref9, _ref10, _ref11, _ref12, _ref13, _ref14, _ref15, _ref16, _ref17);\n};\n\nvar ForwardRef = /*#__PURE__*/React.forwardRef(function (props, ref) {\n return /*#__PURE__*/React.createElement(SvgRedoArrowSymbol, _extends({\n svgRef: ref\n }, props));\n});\nexport default __webpack_public_path__ + \"static/media/redo-arrow-symbol.e801de31.svg\";\nexport { ForwardRef as ReactComponent };","import { ReactComponent as redoImage } from 'assets/images/icons/redo-arrow-symbol.svg';\nimport { makeIcon, IconProps } from './icons';\n\nexport const RedoIcon = ({ className }: IconProps) => {\n return makeIcon(redoImage, className);\n};\n","import React, { useState, useEffect, useCallback, useMemo } from 'react';\nimport cn from 'classnames';\nimport './index.scss';\nimport { connect } from 'react-redux';\nimport { RedoIcon } from 'components/common/icons/RedoIcon';\nimport constants from 'utils/constants';\nimport { RemoveIcon } from '../../../../common/icons/icons';\nimport {\n walletBalanceDataSelector,\n ergPriceSelector,\n walletAddressesSelector,\n} from '../../../../../store/selectors/wallet';\nimport walletActions from '../../../../../store/actions/walletActions';\n\nconst WalletInformationTableItem = ({ name, value }: any) => {\n const [isOpen, setIsOpen] = useState(false);\n let resultTitle;\n let resultContent;\n\n if (Array.isArray(value)) {\n resultTitle = value.length;\n\n resultContent = (\n
\n {value.map((item) => (\n <>\n
\n {item.value || ''} {item.name || ''}\n
\n
\n \n ))}\n
\n );\n } else {\n resultTitle = value;\n resultContent = value;\n }\n\n return (\n
\n \n
{name}
\n \n
\n {isOpen &&
{resultContent}
}\n \n );\n};\n\nconst WalletInformationTable = (props: any) => {\n const {\n walletBalance,\n dispatchGetWalletBalance,\n dispatchGetErgPrice,\n dispatchGetWalletAddresses,\n walletAddresses,\n } = props;\n\n const getValues = useCallback(() => {\n dispatchGetWalletBalance();\n dispatchGetErgPrice();\n dispatchGetWalletAddresses();\n }, [dispatchGetWalletBalance, dispatchGetErgPrice, dispatchGetWalletAddresses]);\n\n const getAddreses = useCallback((addresses: String[]) => {\n if (addresses.length === 0) {\n return 0;\n }\n\n return addresses.map((item) => ({\n value: (\n \n {item}\n \n ),\n }));\n }, []);\n\n const getAssets = useCallback((assets) => {\n if (Object.values(assets).length === 0) {\n return 0;\n }\n\n return Object.keys(assets).map((key: any) => ({\n name: {key},\n value: {assets[key]},\n }));\n }, []);\n\n useEffect(() => {\n getValues();\n }, [getValues]);\n\n const data = useMemo(\n () => [\n {\n name: 'Balance',\n value: walletBalance\n ? `${walletBalance.balance / constants.nanoErgInErg} ERG`\n : 'loading...',\n },\n // {\n // name: 'Balance in USD',\n // value: walletBalance\n // ? `$ ${(walletBalance.balance / constants.nanoErgInErg) * ergPrice}`\n // : 'Loading...',\n // },\n {\n name: 'Assets',\n value: walletBalance ? getAssets(walletBalance.assets) : `Loading...`,\n },\n {\n name: 'Addresses',\n value: walletAddresses ? getAddreses(walletAddresses) : `Loading...`,\n },\n ],\n [walletBalance, walletAddresses, getAddreses],\n );\n\n const updateValues = useCallback(() => {\n getValues();\n }, [getValues]);\n\n return (\n
\n
\n

\n Wallet Information{' '}\n \n

\n
\n
\n {data.map(({ value, name }) => (\n \n ))}\n
\n
\n );\n};\n\nconst mapStateToProps = (state: any) => ({\n walletBalance: walletBalanceDataSelector(state),\n ergPrice: ergPriceSelector(state),\n walletAddresses: walletAddressesSelector(state),\n});\n\nconst mapDispatchToProps = (dispatch: any) => ({\n dispatchGetWalletBalance: () => dispatch(walletActions.getWalletBalance()),\n dispatchGetErgPrice: () => dispatch(walletActions.getErgPrice()),\n dispatchGetWalletAddresses: () => dispatch(walletActions.getWalletAddresses()),\n});\n\nexport default connect(mapStateToProps, mapDispatchToProps)(WalletInformationTable);\n","import React, { Component, memo } from 'react';\nimport { connect } from 'react-redux';\nimport PaymentSendForm from './components/PaymentSendForm/index';\nimport { apiKeySelector } from '../../../store/selectors/app';\nimport {\n isWalletInitializedSelector,\n isWalletUnlockedSelector,\n} from '../../../store/selectors/wallet';\nimport WalletInformationTable from './components/WalletInformationTable/index';\nimport './index.scss';\n\nconst mapStateToProps = (state) => ({\n apiKey: apiKeySelector(state),\n isWalletInitialized: isWalletInitializedSelector(state),\n isWalletUnlocked: isWalletUnlockedSelector(state),\n});\n\nclass Wallet extends Component {\n renderState = (state) =>\n ({\n unlocked: (apiKey) => this.renderWalletUnlockedState(apiKey),\n locked: () => this.renderWalletLockedState(),\n initialized: (apiKey) => this.renderInitializedState(apiKey),\n }[state]);\n\n renderWalletLockedState = () => (\n
\n

The wallet UI is locked. You need to unlock the wallet to access its UI.

\n
\n );\n\n renderInitializedState = () => (\n
\n

You need to initialize your wallet to access wallet UI.

\n
\n );\n\n renderWalletUnlockedState = (apiKey) => (\n
\n \n \n {/* \n */}\n
\n );\n\n render() {\n const { apiKey, isWalletUnlocked, isWalletInitialized } = this.props;\n\n if (apiKey === '') {\n return (\n
\n

To continue, please set your API key.

\n
\n );\n }\n\n if (!isWalletInitialized) {\n return this.renderState('initialized')(apiKey);\n }\n\n if (isWalletUnlocked) {\n return this.renderState('unlocked')(apiKey);\n }\n\n return this.renderState('locked')();\n }\n}\n\nexport default connect(mapStateToProps)(memo(Wallet));\n","import React from 'react';\nimport { BrowserRouter, Switch, Route } from 'react-router-dom';\nimport { Layout } from '../components/layout';\nimport Dashboard from '../components/pages/Dashboard';\nimport Wallet from '../components/pages/Wallet';\n\nconst Router = () => (\n \n \n \n \n \n \n \n \n);\n\nexport default Router;\n","import { combineReducers } from 'redux';\nimport appSlice from '../slices/appSlice';\nimport walletSlice from '../slices/walletSlice';\n\nexport default combineReducers({\n app: appSlice.reducer,\n wallet: walletSlice.reducer,\n});\n","// import Axios from 'axios';\nimport walletActions from '../actions/walletActions';\nimport nodeApi from '../../api/api';\nimport { apiKeySelector } from '../selectors/app';\n// import oracleApi from '../../api/oracleApi';\n\nexport default (store) => (next) => (action) => {\n const { dispatch, getState } = store;\n const apiKey = apiKeySelector(getState());\n\n switch (action.type) {\n case walletActions.checkWalletStatus.type:\n nodeApi\n .get('/wallet/status', {\n headers: {\n api_key: apiKey,\n },\n })\n .then(({ data: walletData }) => {\n dispatch(walletActions.setIsWalletUnlocked(walletData.isUnlocked));\n dispatch(walletActions.setIsWalletInitialized(walletData.isInitialized));\n dispatch(walletActions.setWalletStatusData(walletData));\n })\n .catch(() => {});\n\n break;\n\n case walletActions.getWalletBalance.type:\n nodeApi\n .get('/wallet/balances', {\n headers: {\n api_key: apiKey,\n },\n })\n .then(({ data: walletData }) => {\n dispatch(walletActions.setWalletBalanceData(walletData));\n })\n .catch(() => {});\n\n break;\n\n // case walletActions.getErgPrice.type:\n // oracleApi\n // .get('/frontendData', {\n // transformResponse: [...Axios.defaults.transformResponse, (data) => JSON.parse(data)],\n // })\n // .then(({ data }) => {\n // dispatch(walletActions.setErgPrice(data.latest_price));\n // })\n // .catch(() => {});\n\n // break;\n\n case walletActions.getWalletAddresses.type:\n nodeApi\n .get('/wallet/addresses', {\n headers: {\n api_key: apiKey,\n },\n })\n .then(({ data: walletAddresses }) => {\n dispatch(walletActions.setWalletAddresses(walletAddresses));\n })\n .catch(() => {});\n\n break;\n\n default:\n break;\n }\n next(action);\n};\n","import React from 'react';\nimport { toast } from 'react-toastify';\nimport { Provider } from 'react-redux';\nimport Router from './router/router';\nimport createStore from './store';\n\nimport 'bootstrap/dist/css/bootstrap.min.css';\nimport './assets/styles/index.scss';\nimport 'react-toastify/dist/ReactToastify.min.css';\n\ntoast.configure();\nconst store = createStore();\n\nconst App = () => {\n return (\n \n \n \n );\n};\n\nexport default App;\n","import { configureStore, getDefaultMiddleware } from 'redux-starter-kit';\nimport rootReducer from './reducers/rootReducer';\nimport walletMiddleware from './middlewares/walletMiddleware';\n\nexport default () => {\n const store = configureStore({\n reducer: rootReducer,\n middleware: [...getDefaultMiddleware(), walletMiddleware],\n });\n\n return store;\n};\n","import React from 'react';\nimport ReactDOM from 'react-dom';\nimport App from './App';\n\nReactDOM.render(, document.getElementById('root'));\n","// extracted by mini-css-extract-plugin\nmodule.exports = {\"backdrop\":\"Backdrop_backdrop__PmdBI\",\"content\":\"Backdrop_content__2Kmrw\",\"layer\":\"Backdrop_layer__3V2YH\"};","module.exports = __webpack_public_path__ + \"static/media/logotype_white.4dcfd639.svg\";"],"sourceRoot":""} \ No newline at end of file