├── src
├── App.css
├── config
│ ├── package.json
│ ├── config.jsx
│ ├── development.config.js
│ └── production.config.js
├── stores
│ ├── package.json
│ └── connectors.jsx
├── theme
│ ├── package.json
│ └── theme.jsx
├── constants
│ ├── package.json
│ └── constants.jsx
├── components
│ ├── footer
│ │ ├── package.json
│ │ └── footer.jsx
│ ├── header
│ │ ├── package.json
│ │ └── header.jsx
│ ├── home
│ │ ├── package.json
│ │ └── home.jsx
│ ├── loader
│ │ ├── package.json
│ │ └── loader.jsx
│ ├── pool
│ │ ├── package.json
│ │ ├── deposit
│ │ │ ├── package.json
│ │ │ └── deposit.jsx
│ │ ├── exchange
│ │ │ └── package.json
│ │ ├── withdraw
│ │ │ ├── package.json
│ │ │ └── withdraw.jsx
│ │ └── pool.jsx
│ ├── unlock
│ │ ├── package.json
│ │ ├── unlockModal.jsx
│ │ ├── hooks.jsx
│ │ └── unlock.jsx
│ ├── account
│ │ ├── package.json
│ │ └── account.jsx
│ └── snackbar
│ │ ├── package.json
│ │ └── snackbar.jsx
├── assets
│ ├── aave.png
│ ├── bzx.png
│ ├── ddex.jpg
│ ├── ddex.png
│ ├── dydx.jpg
│ ├── ledger.png
│ ├── lendf.png
│ ├── torus.jpg
│ ├── trezor.png
│ ├── BAT-logo.png
│ ├── BUSD-logo.png
│ ├── COMP-logo.png
│ ├── CRV-icon.png
│ ├── CRV-logo.jpg
│ ├── CRV-logo.png
│ ├── DAI-logo.png
│ ├── ENJ-logo.png
│ ├── ETH-icon.png
│ ├── ETH-logo.png
│ ├── FTM-logo.png
│ ├── KNC-logo.png
│ ├── LEND-logo.png
│ ├── LINK-logo.png
│ ├── LRC-logo.png
│ ├── MANA-logo.png
│ ├── MKR-logo.png
│ ├── REN-logo.png
│ ├── REP-logo.png
│ ├── SAI-logo.png
│ ├── SNX-logo.png
│ ├── SUSD-logo.png
│ ├── TUSD-logo.png
│ ├── USDC-icon.png
│ ├── USDC-logo.png
│ ├── USDT-icon.png
│ ├── USDT-logo.png
│ ├── ZRX-logo.png
│ ├── aBAT-logo.png
│ ├── aDAI-logo.png
│ ├── aETH-logo.png
│ ├── aKNC-logo.png
│ ├── aMKR-logo.png
│ ├── aREP-logo.png
│ ├── aSNX-logo.png
│ ├── aZRX-logo.png
│ ├── compound.png
│ ├── curvefi.jpg
│ ├── defipulse.png
│ ├── defizap.png
│ ├── ethereum.png
│ ├── etherscan.png
│ ├── fUSD-logo.png
│ ├── iDAI-logo.png
│ ├── metamask.png
│ ├── synthetix.png
│ ├── truffle.png
│ ├── uniswap.png
│ ├── wBTC-icon.png
│ ├── wBTC-logo.png
│ ├── IEARN-icon.png
│ ├── aBUSD-logo.png
│ ├── aLEND-logo.png
│ ├── aLINK-logo.png
│ ├── aMANA-logo.png
│ ├── aSUSD-logo.png
│ ├── aTUSD-logo.png
│ ├── aUSDC-logo.png
│ ├── aUSDT-logo.png
│ ├── aWBTC-logo.png
│ ├── cUSDC-logo.png
│ ├── cUSDT-logo.png
│ ├── portisIcon.png
│ ├── squarelink.png
│ ├── trustWallet.png
│ ├── ycUSDC-logo.png
│ ├── ycUSDT-logo.png
│ ├── fortmaticIcon.png
│ ├── kybernetwork.png
│ ├── fonts
│ │ └── WorkSans-VariableFont_wght.ttf
│ ├── icn-ledger.svg
│ ├── defisnap.svg
│ ├── icn-aethereum.svg
│ ├── aave.svg
│ ├── lendf.svg
│ ├── uniswap.svg
│ ├── metamask.svg
│ ├── dydx.svg
│ ├── icn-metamask.svg
│ └── walletConnectIcon.svg
├── App.test.js
├── index.js
├── i18n.js
├── index.css
├── locales
│ ├── ja
│ │ └── translation.json
│ ├── zh
│ │ └── translation.json
│ └── en
│ │ └── translation.json
├── App.js
└── serviceWorker.js
├── public
├── aave.png
├── busd.png
├── lendf.png
├── BAT-logo.png
├── DAI-logo.png
├── ETH-icon.png
├── FTM-logo.png
├── KNC-logo.png
├── MKR-logo.png
├── REP-logo.png
├── SAI-logo.png
├── SNX-logo.png
├── ZRX-logo.png
├── compound.png
├── defizap.png
├── favicon.ico
├── ledger.png
├── metamask.png
├── trezor.png
├── truffle.png
├── uniswap.png
├── LEND-logo.png
├── LINK-logo.png
├── MANA-logo.png
├── SUSD-logo.png
├── TUSD-logo.png
├── USDC-icon.png
├── USDC-logo.png
├── USDT-icon.png
├── USDT-logo.png
├── apple-icon.png
├── etherscan.png
├── portisIcon.png
├── squarelink.png
├── wBTC-icon.png
├── wBTC-logo.png
├── favicon-16x16.png
├── favicon-32x32.png
├── favicon-96x96.png
├── favicon.png.png
├── fortmaticIcon.png
├── kybernetwork.png
├── ms-icon-70x70.png
├── trustWallet.png
├── ms-icon-144x144.png
├── ms-icon-150x150.png
├── ms-icon-310x310.png
├── android-icon-36x36.png
├── android-icon-48x48.png
├── android-icon-72x72.png
├── android-icon-96x96.png
├── apple-icon-114x114.png
├── apple-icon-120x120.png
├── apple-icon-144x144.png
├── apple-icon-152x152.png
├── apple-icon-180x180.png
├── apple-icon-57x57.png
├── apple-icon-60x60.png
├── apple-icon-72x72.png
├── apple-icon-76x76.png
├── android-icon-144x144.png
├── android-icon-192x192.png
├── apple-icon-precomposed.png
├── browserconfig.xml
├── manifest.json
└── index.html
├── .gitignore
├── LICENSE
├── package.json
└── README.md
/src/App.css:
--------------------------------------------------------------------------------
1 |
--------------------------------------------------------------------------------
/src/config/package.json:
--------------------------------------------------------------------------------
1 | {
2 | "main": "config.jsx"
3 | }
4 |
--------------------------------------------------------------------------------
/src/stores/package.json:
--------------------------------------------------------------------------------
1 | {
2 | "main": "store.jsx"
3 | }
4 |
--------------------------------------------------------------------------------
/src/theme/package.json:
--------------------------------------------------------------------------------
1 | {
2 | "main": "theme.jsx"
3 | }
4 |
--------------------------------------------------------------------------------
/src/constants/package.json:
--------------------------------------------------------------------------------
1 | {
2 | "main": "constants.jsx"
3 | }
4 |
--------------------------------------------------------------------------------
/src/components/footer/package.json:
--------------------------------------------------------------------------------
1 | {
2 | "main": "footer.jsx"
3 | }
4 |
--------------------------------------------------------------------------------
/src/components/header/package.json:
--------------------------------------------------------------------------------
1 | {
2 | "main": "header.jsx"
3 | }
4 |
--------------------------------------------------------------------------------
/src/components/home/package.json:
--------------------------------------------------------------------------------
1 | {
2 | "main": "home.jsx"
3 | }
4 |
--------------------------------------------------------------------------------
/src/components/loader/package.json:
--------------------------------------------------------------------------------
1 | {
2 | "main": "loader.jsx"
3 | }
4 |
--------------------------------------------------------------------------------
/src/components/pool/package.json:
--------------------------------------------------------------------------------
1 | {
2 | "main": "pool.jsx"
3 | }
4 |
--------------------------------------------------------------------------------
/src/components/unlock/package.json:
--------------------------------------------------------------------------------
1 | {
2 | "main": "unlock.jsx"
3 | }
4 |
--------------------------------------------------------------------------------
/src/components/account/package.json:
--------------------------------------------------------------------------------
1 | {
2 | "main": "account.jsx"
3 | }
4 |
--------------------------------------------------------------------------------
/src/components/snackbar/package.json:
--------------------------------------------------------------------------------
1 | {
2 | "main": "snackbar.jsx"
3 | }
4 |
--------------------------------------------------------------------------------
/src/components/pool/deposit/package.json:
--------------------------------------------------------------------------------
1 | {
2 | "main": "deposit.jsx"
3 | }
4 |
--------------------------------------------------------------------------------
/src/components/pool/exchange/package.json:
--------------------------------------------------------------------------------
1 | {
2 | "main": "exchange.jsx"
3 | }
4 |
--------------------------------------------------------------------------------
/src/components/pool/withdraw/package.json:
--------------------------------------------------------------------------------
1 | {
2 | "main": "withdraw.jsx"
3 | }
4 |
--------------------------------------------------------------------------------
/public/aave.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/yearn/yswap-finance/HEAD/public/aave.png
--------------------------------------------------------------------------------
/public/busd.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/yearn/yswap-finance/HEAD/public/busd.png
--------------------------------------------------------------------------------
/public/lendf.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/yearn/yswap-finance/HEAD/public/lendf.png
--------------------------------------------------------------------------------
/public/BAT-logo.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/yearn/yswap-finance/HEAD/public/BAT-logo.png
--------------------------------------------------------------------------------
/public/DAI-logo.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/yearn/yswap-finance/HEAD/public/DAI-logo.png
--------------------------------------------------------------------------------
/public/ETH-icon.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/yearn/yswap-finance/HEAD/public/ETH-icon.png
--------------------------------------------------------------------------------
/public/FTM-logo.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/yearn/yswap-finance/HEAD/public/FTM-logo.png
--------------------------------------------------------------------------------
/public/KNC-logo.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/yearn/yswap-finance/HEAD/public/KNC-logo.png
--------------------------------------------------------------------------------
/public/MKR-logo.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/yearn/yswap-finance/HEAD/public/MKR-logo.png
--------------------------------------------------------------------------------
/public/REP-logo.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/yearn/yswap-finance/HEAD/public/REP-logo.png
--------------------------------------------------------------------------------
/public/SAI-logo.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/yearn/yswap-finance/HEAD/public/SAI-logo.png
--------------------------------------------------------------------------------
/public/SNX-logo.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/yearn/yswap-finance/HEAD/public/SNX-logo.png
--------------------------------------------------------------------------------
/public/ZRX-logo.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/yearn/yswap-finance/HEAD/public/ZRX-logo.png
--------------------------------------------------------------------------------
/public/compound.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/yearn/yswap-finance/HEAD/public/compound.png
--------------------------------------------------------------------------------
/public/defizap.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/yearn/yswap-finance/HEAD/public/defizap.png
--------------------------------------------------------------------------------
/public/favicon.ico:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/yearn/yswap-finance/HEAD/public/favicon.ico
--------------------------------------------------------------------------------
/public/ledger.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/yearn/yswap-finance/HEAD/public/ledger.png
--------------------------------------------------------------------------------
/public/metamask.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/yearn/yswap-finance/HEAD/public/metamask.png
--------------------------------------------------------------------------------
/public/trezor.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/yearn/yswap-finance/HEAD/public/trezor.png
--------------------------------------------------------------------------------
/public/truffle.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/yearn/yswap-finance/HEAD/public/truffle.png
--------------------------------------------------------------------------------
/public/uniswap.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/yearn/yswap-finance/HEAD/public/uniswap.png
--------------------------------------------------------------------------------
/src/assets/aave.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/yearn/yswap-finance/HEAD/src/assets/aave.png
--------------------------------------------------------------------------------
/src/assets/bzx.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/yearn/yswap-finance/HEAD/src/assets/bzx.png
--------------------------------------------------------------------------------
/src/assets/ddex.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/yearn/yswap-finance/HEAD/src/assets/ddex.jpg
--------------------------------------------------------------------------------
/src/assets/ddex.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/yearn/yswap-finance/HEAD/src/assets/ddex.png
--------------------------------------------------------------------------------
/src/assets/dydx.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/yearn/yswap-finance/HEAD/src/assets/dydx.jpg
--------------------------------------------------------------------------------
/public/LEND-logo.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/yearn/yswap-finance/HEAD/public/LEND-logo.png
--------------------------------------------------------------------------------
/public/LINK-logo.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/yearn/yswap-finance/HEAD/public/LINK-logo.png
--------------------------------------------------------------------------------
/public/MANA-logo.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/yearn/yswap-finance/HEAD/public/MANA-logo.png
--------------------------------------------------------------------------------
/public/SUSD-logo.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/yearn/yswap-finance/HEAD/public/SUSD-logo.png
--------------------------------------------------------------------------------
/public/TUSD-logo.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/yearn/yswap-finance/HEAD/public/TUSD-logo.png
--------------------------------------------------------------------------------
/public/USDC-icon.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/yearn/yswap-finance/HEAD/public/USDC-icon.png
--------------------------------------------------------------------------------
/public/USDC-logo.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/yearn/yswap-finance/HEAD/public/USDC-logo.png
--------------------------------------------------------------------------------
/public/USDT-icon.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/yearn/yswap-finance/HEAD/public/USDT-icon.png
--------------------------------------------------------------------------------
/public/USDT-logo.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/yearn/yswap-finance/HEAD/public/USDT-logo.png
--------------------------------------------------------------------------------
/public/apple-icon.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/yearn/yswap-finance/HEAD/public/apple-icon.png
--------------------------------------------------------------------------------
/public/etherscan.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/yearn/yswap-finance/HEAD/public/etherscan.png
--------------------------------------------------------------------------------
/public/portisIcon.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/yearn/yswap-finance/HEAD/public/portisIcon.png
--------------------------------------------------------------------------------
/public/squarelink.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/yearn/yswap-finance/HEAD/public/squarelink.png
--------------------------------------------------------------------------------
/public/wBTC-icon.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/yearn/yswap-finance/HEAD/public/wBTC-icon.png
--------------------------------------------------------------------------------
/public/wBTC-logo.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/yearn/yswap-finance/HEAD/public/wBTC-logo.png
--------------------------------------------------------------------------------
/src/assets/ledger.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/yearn/yswap-finance/HEAD/src/assets/ledger.png
--------------------------------------------------------------------------------
/src/assets/lendf.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/yearn/yswap-finance/HEAD/src/assets/lendf.png
--------------------------------------------------------------------------------
/src/assets/torus.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/yearn/yswap-finance/HEAD/src/assets/torus.jpg
--------------------------------------------------------------------------------
/src/assets/trezor.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/yearn/yswap-finance/HEAD/src/assets/trezor.png
--------------------------------------------------------------------------------
/public/favicon-16x16.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/yearn/yswap-finance/HEAD/public/favicon-16x16.png
--------------------------------------------------------------------------------
/public/favicon-32x32.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/yearn/yswap-finance/HEAD/public/favicon-32x32.png
--------------------------------------------------------------------------------
/public/favicon-96x96.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/yearn/yswap-finance/HEAD/public/favicon-96x96.png
--------------------------------------------------------------------------------
/public/favicon.png.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/yearn/yswap-finance/HEAD/public/favicon.png.png
--------------------------------------------------------------------------------
/public/fortmaticIcon.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/yearn/yswap-finance/HEAD/public/fortmaticIcon.png
--------------------------------------------------------------------------------
/public/kybernetwork.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/yearn/yswap-finance/HEAD/public/kybernetwork.png
--------------------------------------------------------------------------------
/public/ms-icon-70x70.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/yearn/yswap-finance/HEAD/public/ms-icon-70x70.png
--------------------------------------------------------------------------------
/public/trustWallet.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/yearn/yswap-finance/HEAD/public/trustWallet.png
--------------------------------------------------------------------------------
/src/assets/BAT-logo.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/yearn/yswap-finance/HEAD/src/assets/BAT-logo.png
--------------------------------------------------------------------------------
/src/assets/BUSD-logo.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/yearn/yswap-finance/HEAD/src/assets/BUSD-logo.png
--------------------------------------------------------------------------------
/src/assets/COMP-logo.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/yearn/yswap-finance/HEAD/src/assets/COMP-logo.png
--------------------------------------------------------------------------------
/src/assets/CRV-icon.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/yearn/yswap-finance/HEAD/src/assets/CRV-icon.png
--------------------------------------------------------------------------------
/src/assets/CRV-logo.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/yearn/yswap-finance/HEAD/src/assets/CRV-logo.jpg
--------------------------------------------------------------------------------
/src/assets/CRV-logo.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/yearn/yswap-finance/HEAD/src/assets/CRV-logo.png
--------------------------------------------------------------------------------
/src/assets/DAI-logo.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/yearn/yswap-finance/HEAD/src/assets/DAI-logo.png
--------------------------------------------------------------------------------
/src/assets/ENJ-logo.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/yearn/yswap-finance/HEAD/src/assets/ENJ-logo.png
--------------------------------------------------------------------------------
/src/assets/ETH-icon.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/yearn/yswap-finance/HEAD/src/assets/ETH-icon.png
--------------------------------------------------------------------------------
/src/assets/ETH-logo.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/yearn/yswap-finance/HEAD/src/assets/ETH-logo.png
--------------------------------------------------------------------------------
/src/assets/FTM-logo.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/yearn/yswap-finance/HEAD/src/assets/FTM-logo.png
--------------------------------------------------------------------------------
/src/assets/KNC-logo.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/yearn/yswap-finance/HEAD/src/assets/KNC-logo.png
--------------------------------------------------------------------------------
/src/assets/LEND-logo.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/yearn/yswap-finance/HEAD/src/assets/LEND-logo.png
--------------------------------------------------------------------------------
/src/assets/LINK-logo.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/yearn/yswap-finance/HEAD/src/assets/LINK-logo.png
--------------------------------------------------------------------------------
/src/assets/LRC-logo.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/yearn/yswap-finance/HEAD/src/assets/LRC-logo.png
--------------------------------------------------------------------------------
/src/assets/MANA-logo.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/yearn/yswap-finance/HEAD/src/assets/MANA-logo.png
--------------------------------------------------------------------------------
/src/assets/MKR-logo.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/yearn/yswap-finance/HEAD/src/assets/MKR-logo.png
--------------------------------------------------------------------------------
/src/assets/REN-logo.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/yearn/yswap-finance/HEAD/src/assets/REN-logo.png
--------------------------------------------------------------------------------
/src/assets/REP-logo.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/yearn/yswap-finance/HEAD/src/assets/REP-logo.png
--------------------------------------------------------------------------------
/src/assets/SAI-logo.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/yearn/yswap-finance/HEAD/src/assets/SAI-logo.png
--------------------------------------------------------------------------------
/src/assets/SNX-logo.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/yearn/yswap-finance/HEAD/src/assets/SNX-logo.png
--------------------------------------------------------------------------------
/src/assets/SUSD-logo.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/yearn/yswap-finance/HEAD/src/assets/SUSD-logo.png
--------------------------------------------------------------------------------
/src/assets/TUSD-logo.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/yearn/yswap-finance/HEAD/src/assets/TUSD-logo.png
--------------------------------------------------------------------------------
/src/assets/USDC-icon.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/yearn/yswap-finance/HEAD/src/assets/USDC-icon.png
--------------------------------------------------------------------------------
/src/assets/USDC-logo.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/yearn/yswap-finance/HEAD/src/assets/USDC-logo.png
--------------------------------------------------------------------------------
/src/assets/USDT-icon.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/yearn/yswap-finance/HEAD/src/assets/USDT-icon.png
--------------------------------------------------------------------------------
/src/assets/USDT-logo.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/yearn/yswap-finance/HEAD/src/assets/USDT-logo.png
--------------------------------------------------------------------------------
/src/assets/ZRX-logo.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/yearn/yswap-finance/HEAD/src/assets/ZRX-logo.png
--------------------------------------------------------------------------------
/src/assets/aBAT-logo.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/yearn/yswap-finance/HEAD/src/assets/aBAT-logo.png
--------------------------------------------------------------------------------
/src/assets/aDAI-logo.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/yearn/yswap-finance/HEAD/src/assets/aDAI-logo.png
--------------------------------------------------------------------------------
/src/assets/aETH-logo.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/yearn/yswap-finance/HEAD/src/assets/aETH-logo.png
--------------------------------------------------------------------------------
/src/assets/aKNC-logo.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/yearn/yswap-finance/HEAD/src/assets/aKNC-logo.png
--------------------------------------------------------------------------------
/src/assets/aMKR-logo.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/yearn/yswap-finance/HEAD/src/assets/aMKR-logo.png
--------------------------------------------------------------------------------
/src/assets/aREP-logo.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/yearn/yswap-finance/HEAD/src/assets/aREP-logo.png
--------------------------------------------------------------------------------
/src/assets/aSNX-logo.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/yearn/yswap-finance/HEAD/src/assets/aSNX-logo.png
--------------------------------------------------------------------------------
/src/assets/aZRX-logo.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/yearn/yswap-finance/HEAD/src/assets/aZRX-logo.png
--------------------------------------------------------------------------------
/src/assets/compound.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/yearn/yswap-finance/HEAD/src/assets/compound.png
--------------------------------------------------------------------------------
/src/assets/curvefi.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/yearn/yswap-finance/HEAD/src/assets/curvefi.jpg
--------------------------------------------------------------------------------
/src/assets/defipulse.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/yearn/yswap-finance/HEAD/src/assets/defipulse.png
--------------------------------------------------------------------------------
/src/assets/defizap.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/yearn/yswap-finance/HEAD/src/assets/defizap.png
--------------------------------------------------------------------------------
/src/assets/ethereum.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/yearn/yswap-finance/HEAD/src/assets/ethereum.png
--------------------------------------------------------------------------------
/src/assets/etherscan.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/yearn/yswap-finance/HEAD/src/assets/etherscan.png
--------------------------------------------------------------------------------
/src/assets/fUSD-logo.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/yearn/yswap-finance/HEAD/src/assets/fUSD-logo.png
--------------------------------------------------------------------------------
/src/assets/iDAI-logo.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/yearn/yswap-finance/HEAD/src/assets/iDAI-logo.png
--------------------------------------------------------------------------------
/src/assets/metamask.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/yearn/yswap-finance/HEAD/src/assets/metamask.png
--------------------------------------------------------------------------------
/src/assets/synthetix.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/yearn/yswap-finance/HEAD/src/assets/synthetix.png
--------------------------------------------------------------------------------
/src/assets/truffle.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/yearn/yswap-finance/HEAD/src/assets/truffle.png
--------------------------------------------------------------------------------
/src/assets/uniswap.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/yearn/yswap-finance/HEAD/src/assets/uniswap.png
--------------------------------------------------------------------------------
/src/assets/wBTC-icon.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/yearn/yswap-finance/HEAD/src/assets/wBTC-icon.png
--------------------------------------------------------------------------------
/src/assets/wBTC-logo.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/yearn/yswap-finance/HEAD/src/assets/wBTC-logo.png
--------------------------------------------------------------------------------
/public/ms-icon-144x144.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/yearn/yswap-finance/HEAD/public/ms-icon-144x144.png
--------------------------------------------------------------------------------
/public/ms-icon-150x150.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/yearn/yswap-finance/HEAD/public/ms-icon-150x150.png
--------------------------------------------------------------------------------
/public/ms-icon-310x310.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/yearn/yswap-finance/HEAD/public/ms-icon-310x310.png
--------------------------------------------------------------------------------
/src/assets/IEARN-icon.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/yearn/yswap-finance/HEAD/src/assets/IEARN-icon.png
--------------------------------------------------------------------------------
/src/assets/aBUSD-logo.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/yearn/yswap-finance/HEAD/src/assets/aBUSD-logo.png
--------------------------------------------------------------------------------
/src/assets/aLEND-logo.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/yearn/yswap-finance/HEAD/src/assets/aLEND-logo.png
--------------------------------------------------------------------------------
/src/assets/aLINK-logo.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/yearn/yswap-finance/HEAD/src/assets/aLINK-logo.png
--------------------------------------------------------------------------------
/src/assets/aMANA-logo.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/yearn/yswap-finance/HEAD/src/assets/aMANA-logo.png
--------------------------------------------------------------------------------
/src/assets/aSUSD-logo.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/yearn/yswap-finance/HEAD/src/assets/aSUSD-logo.png
--------------------------------------------------------------------------------
/src/assets/aTUSD-logo.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/yearn/yswap-finance/HEAD/src/assets/aTUSD-logo.png
--------------------------------------------------------------------------------
/src/assets/aUSDC-logo.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/yearn/yswap-finance/HEAD/src/assets/aUSDC-logo.png
--------------------------------------------------------------------------------
/src/assets/aUSDT-logo.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/yearn/yswap-finance/HEAD/src/assets/aUSDT-logo.png
--------------------------------------------------------------------------------
/src/assets/aWBTC-logo.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/yearn/yswap-finance/HEAD/src/assets/aWBTC-logo.png
--------------------------------------------------------------------------------
/src/assets/cUSDC-logo.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/yearn/yswap-finance/HEAD/src/assets/cUSDC-logo.png
--------------------------------------------------------------------------------
/src/assets/cUSDT-logo.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/yearn/yswap-finance/HEAD/src/assets/cUSDT-logo.png
--------------------------------------------------------------------------------
/src/assets/portisIcon.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/yearn/yswap-finance/HEAD/src/assets/portisIcon.png
--------------------------------------------------------------------------------
/src/assets/squarelink.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/yearn/yswap-finance/HEAD/src/assets/squarelink.png
--------------------------------------------------------------------------------
/src/assets/trustWallet.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/yearn/yswap-finance/HEAD/src/assets/trustWallet.png
--------------------------------------------------------------------------------
/src/assets/ycUSDC-logo.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/yearn/yswap-finance/HEAD/src/assets/ycUSDC-logo.png
--------------------------------------------------------------------------------
/src/assets/ycUSDT-logo.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/yearn/yswap-finance/HEAD/src/assets/ycUSDT-logo.png
--------------------------------------------------------------------------------
/public/android-icon-36x36.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/yearn/yswap-finance/HEAD/public/android-icon-36x36.png
--------------------------------------------------------------------------------
/public/android-icon-48x48.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/yearn/yswap-finance/HEAD/public/android-icon-48x48.png
--------------------------------------------------------------------------------
/public/android-icon-72x72.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/yearn/yswap-finance/HEAD/public/android-icon-72x72.png
--------------------------------------------------------------------------------
/public/android-icon-96x96.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/yearn/yswap-finance/HEAD/public/android-icon-96x96.png
--------------------------------------------------------------------------------
/public/apple-icon-114x114.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/yearn/yswap-finance/HEAD/public/apple-icon-114x114.png
--------------------------------------------------------------------------------
/public/apple-icon-120x120.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/yearn/yswap-finance/HEAD/public/apple-icon-120x120.png
--------------------------------------------------------------------------------
/public/apple-icon-144x144.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/yearn/yswap-finance/HEAD/public/apple-icon-144x144.png
--------------------------------------------------------------------------------
/public/apple-icon-152x152.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/yearn/yswap-finance/HEAD/public/apple-icon-152x152.png
--------------------------------------------------------------------------------
/public/apple-icon-180x180.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/yearn/yswap-finance/HEAD/public/apple-icon-180x180.png
--------------------------------------------------------------------------------
/public/apple-icon-57x57.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/yearn/yswap-finance/HEAD/public/apple-icon-57x57.png
--------------------------------------------------------------------------------
/public/apple-icon-60x60.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/yearn/yswap-finance/HEAD/public/apple-icon-60x60.png
--------------------------------------------------------------------------------
/public/apple-icon-72x72.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/yearn/yswap-finance/HEAD/public/apple-icon-72x72.png
--------------------------------------------------------------------------------
/public/apple-icon-76x76.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/yearn/yswap-finance/HEAD/public/apple-icon-76x76.png
--------------------------------------------------------------------------------
/src/assets/fortmaticIcon.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/yearn/yswap-finance/HEAD/src/assets/fortmaticIcon.png
--------------------------------------------------------------------------------
/src/assets/kybernetwork.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/yearn/yswap-finance/HEAD/src/assets/kybernetwork.png
--------------------------------------------------------------------------------
/public/android-icon-144x144.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/yearn/yswap-finance/HEAD/public/android-icon-144x144.png
--------------------------------------------------------------------------------
/public/android-icon-192x192.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/yearn/yswap-finance/HEAD/public/android-icon-192x192.png
--------------------------------------------------------------------------------
/public/apple-icon-precomposed.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/yearn/yswap-finance/HEAD/public/apple-icon-precomposed.png
--------------------------------------------------------------------------------
/src/assets/fonts/WorkSans-VariableFont_wght.ttf:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/yearn/yswap-finance/HEAD/src/assets/fonts/WorkSans-VariableFont_wght.ttf
--------------------------------------------------------------------------------
/public/browserconfig.xml:
--------------------------------------------------------------------------------
1 |
2 | #ffffff
--------------------------------------------------------------------------------
/src/App.test.js:
--------------------------------------------------------------------------------
1 | import React from 'react';
2 | import ReactDOM from 'react-dom';
3 | import App from './App';
4 |
5 | it('renders without crashing', () => {
6 | const div = document.createElement('div');
7 | ReactDOM.render(, div);
8 | ReactDOM.unmountComponentAtNode(div);
9 | });
10 |
--------------------------------------------------------------------------------
/src/config/config.jsx:
--------------------------------------------------------------------------------
1 | import development from "./development.config";
2 | import production from "./production.config";
3 | import example from "./example.config";
4 | const env = process.env.APP_ENV || 'example';
5 |
6 | const config = {
7 | example,
8 | development,
9 | production
10 | };
11 |
12 | export default config[env];
13 |
--------------------------------------------------------------------------------
/src/components/loader/loader.jsx:
--------------------------------------------------------------------------------
1 | import React, { Component } from 'react'
2 | import { LinearProgress } from '@material-ui/core'
3 |
4 | class Loader extends Component {
5 | render() {
6 | return (
7 |
86 |
87 |
88 | { t('Footer.Home') }
89 |
90 | window.open("https://docs.iearn.finance", "_blank")} className={ classes.footerText } variant={ 'h6'}>{ t('Footer.About') }
91 | window.open("https://docs.iearn.finance", "_blank")} className={ classes.footerText } variant={ 'h6'}>{ t('Footer.Docs') }
92 | window.open("https://github.com/iearn-finance", "_blank")} className={ classes.footerText } variant={ 'h6'}>{ t('Footer.Code') }
93 | window.open("https://t.me/iearnfinance", "_blank")} className={ classes.footerText } variant={ 'h6'}>{ t('Footer.Telegram') }
94 |
95 |
96 |
97 |
109 |
110 |
111 |
112 | )
113 | }
114 |
115 | handleLanguageChange = (event) => {
116 | let val = []
117 | val.language = event.target.value
118 | this.setState(val)
119 |
120 | i18n.changeLanguage(event.target.value)
121 | }
122 | }
123 |
124 | export default withNamespaces()(withRouter(withStyles(styles)(Footer)));
125 |
--------------------------------------------------------------------------------
/src/assets/dydx.svg:
--------------------------------------------------------------------------------
1 |
147 | { this.renderNotConnected() }
148 | { modalOpen && this.renderModal() }
149 |
150 | )
151 | };
152 |
153 | renderNotConnected = () => {
154 | const { classes } = this.props
155 | const { loading } = this.state
156 |
157 | return (
158 |
172 | {icon}
173 |
174 | { messageType }
175 | { message }
176 |
177 |
178 | }
179 | action={actions}
180 | />
181 | );
182 | }
183 | }
184 |
185 | export default withNamespaces()(MySnackbar);
186 |
--------------------------------------------------------------------------------
/src/assets/icn-metamask.svg:
--------------------------------------------------------------------------------
1 |
32 |
--------------------------------------------------------------------------------
/src/components/home/home.jsx:
--------------------------------------------------------------------------------
1 | import React, { Component } from "react";
2 | import { withRouter } from "react-router-dom";
3 | import { withStyles } from '@material-ui/core/styles';
4 | import {
5 | Card,
6 | Typography,
7 | } from '@material-ui/core';
8 | import { withNamespaces } from 'react-i18next';
9 | import { colors } from '../../theme'
10 | import FlashOnIcon from '@material-ui/icons/FlashOn';
11 | import AttachMoneyIcon from '@material-ui/icons/AttachMoney';
12 | import SecurityIcon from '@material-ui/icons/Security';
13 | import BarChartIcon from '@material-ui/icons/BarChart';
14 | import PieChartIcon from '@material-ui/icons/PieChart';
15 | import DetailsIcon from '@material-ui/icons/Details';
16 |
17 | const styles = theme => ({
18 | root: {
19 | flex: 1,
20 | display: 'flex',
21 | width: '100%',
22 | justifyContent: 'space-around',
23 | alignItems: 'center',
24 | flexDirection: 'column',
25 | [theme.breakpoints.up('sm')]: {
26 | flexDirection: 'row',
27 | }
28 | },
29 | card: {
30 | flex: '1',
31 | height: '25vh',
32 | width: '100%',
33 | display: 'flex',
34 | justifyContent: 'center',
35 | alignItems: 'center',
36 | flexDirection: 'column',
37 | cursor: 'pointer',
38 | borderRadius: '0px',
39 | transition: 'background-color 0.2s linear',
40 | [theme.breakpoints.up('sm')]: {
41 | height: '100vh',
42 | minWidth: '20%',
43 | minHeight: '50vh',
44 | }
45 | },
46 | earn: {
47 | backgroundColor: colors.white,
48 | '&:hover': {
49 | backgroundColor: colors.pink,
50 | '& .title': {
51 | color: colors.white
52 | },
53 | '& .icon': {
54 | color: colors.white
55 | }
56 | },
57 | '& .title': {
58 | color: colors.pink
59 | },
60 | '& .icon': {
61 | color: colors.pink
62 | }
63 | },
64 | zap: {
65 | backgroundColor: colors.white,
66 | '&:hover': {
67 | backgroundColor: colors.blue,
68 | '& .title': {
69 | color: colors.white,
70 | },
71 | '& .icon': {
72 | color: colors.white
73 | }
74 | },
75 | '& .title': {
76 | color: colors.blue,
77 | display: 'block'
78 | },
79 | '& .soon': {
80 | color: colors.blue,
81 | display: 'none'
82 | },
83 | '& .icon': {
84 | color: colors.blue
85 | },
86 | },
87 | apr: {
88 | backgroundColor: colors.white,
89 | '&:hover': {
90 | backgroundColor: colors.lightBlack,
91 | '& .title': {
92 | color: colors.white
93 | },
94 | '& .icon': {
95 | color: colors.white
96 | }
97 | },
98 | '& .title': {
99 | color: colors.lightBlack
100 | },
101 | '& .icon': {
102 | color: colors.lightBlack
103 | },
104 | },
105 | cover: {
106 | backgroundColor: colors.white,
107 | '&:hover': {
108 | backgroundColor: colors.compoundGreen,
109 | '& .title': {
110 | color: colors.white,
111 | },
112 | '& .icon': {
113 | color: colors.white
114 | }
115 | },
116 | '& .title': {
117 | color: colors.compoundGreen,
118 | },
119 | '& .icon': {
120 | color: colors.compoundGreen
121 | },
122 | },
123 | pool: {
124 | backgroundColor: colors.white,
125 | '&:hover': {
126 | backgroundColor: colors.tomato,
127 | '& .title': {
128 | color: colors.white,
129 | },
130 | '& .icon': {
131 | color: colors.white
132 | }
133 | },
134 | '& .title': {
135 | color: colors.tomato,
136 | },
137 | '& .icon': {
138 | color: colors.tomato
139 | },
140 | },
141 | balancer: {
142 | backgroundColor: colors.white,
143 | '&:hover': {
144 | backgroundColor: colors.purple,
145 | '& .title': {
146 | color: colors.white,
147 | },
148 | '& .icon': {
149 | color: colors.white
150 | }
151 | },
152 | '& .title': {
153 | color: colors.purple,
154 | },
155 | '& .icon': {
156 | color: colors.purple
157 | },
158 | },
159 | title: {
160 | padding: '24px',
161 | paddingBottom: '0px',
162 | [theme.breakpoints.up('sm')]: {
163 | paddingBottom: '24px'
164 | }
165 | },
166 | icon: {
167 | fontSize: '60px',
168 | [theme.breakpoints.up('sm')]: {
169 | fontSize: '100px',
170 | }
171 | },
172 | link: {
173 | textDecoration: 'none'
174 | }
175 | });
176 |
177 | class Home extends Component {
178 |
179 | constructor(props) {
180 | super()
181 |
182 | this.state = {
183 | }
184 | }
185 |
186 | render() {
187 | const { classes, t, location } = this.props;
188 |
189 | console.log(location)
190 |
191 | return (
192 |
193 |
{ this.nav(location.pathname+'earn') } }>
194 |
195 | { t("Home.Earn") }
196 |
197 |
{ this.nav(location.pathname+'zap') } }>
198 |
199 | { t("Home.Zap") }
200 |
201 |
{ this.nav(location.pathname+'apr') } }>
202 |
203 | { t("Home.Apr") }
204 |
205 |
{ this.nav(location.pathname+'cover') }}>
206 |
207 | { t("Home.Cover") }
208 |
209 |
{ this.nav(location.pathname+'pool') }}>
210 |
211 | { t("Home.Pool") }
212 |
213 |
214 |
215 | )
216 | };
217 |
218 | nav = (screen) => {
219 | this.props.history.push(screen)
220 | }
221 | }
222 |
223 | export default withNamespaces()(withRouter(withStyles(styles)(Home)));
224 |
--------------------------------------------------------------------------------
/src/components/pool/pool.jsx:
--------------------------------------------------------------------------------
1 | import React, { Component } from "react";
2 | import { withRouter } from "react-router-dom";
3 | import { withStyles } from '@material-ui/core/styles';
4 | import {
5 | Tabs,
6 | Tab,
7 | Typography,
8 | Button,
9 | Card
10 | } from '@material-ui/core';
11 | import { withNamespaces } from 'react-i18next';
12 |
13 | import UnlockModal from '../unlock/unlockModal.jsx'
14 | import Deposit from './deposit'
15 | import Withdraw from './withdraw'
16 | import Exchange from './exchange'
17 | import Store from "../../stores";
18 |
19 | import {
20 | ERROR,
21 | GET_POOL_BALANCES,
22 | CONFIGURE_RETURNED
23 | } from '../../constants'
24 |
25 | const styles = theme => ({
26 | root: {
27 | flex: 1,
28 | display: 'flex',
29 | flexDirection: 'column',
30 | maxWidth: '1200px',
31 | width: '100%',
32 | justifyContent: 'center',
33 | alignItems: 'center',
34 | marginTop: '40px'
35 | },
36 | intro: {
37 | width: '100%',
38 | position: 'relative',
39 | display: 'flex',
40 | justifyContent: 'space-between',
41 | alignItems: 'center',
42 | maxWidth: '400px'
43 | },
44 | introCenter: {
45 | minWidth: '100%',
46 | textAlign: 'center',
47 | padding: '48px 0px'
48 | },
49 | investedContainer: {
50 | display: 'flex',
51 | flex: 1,
52 | flexDirection: 'column',
53 | alignItems: 'center',
54 | justifyContent: 'center',
55 | padding: '12px',
56 | minWidth: '100%',
57 | [theme.breakpoints.up('md')]: {
58 | minWidth: '800px',
59 | }
60 | },
61 | connectContainer: {
62 | padding: '12px',
63 | display: 'flex',
64 | justifyContent: 'center',
65 | width: '100%',
66 | maxWidth: '450px',
67 | [theme.breakpoints.up('md')]: {
68 | width: '450',
69 | }
70 | },
71 | actionButton: {
72 | '&:hover': {
73 | backgroundColor: "#2F80ED",
74 | },
75 | padding: '12px',
76 | backgroundColor: "#2F80ED",
77 | borderRadius: '1rem',
78 | border: '1px solid #E1E1E1',
79 | fontWeight: 500,
80 | [theme.breakpoints.up('md')]: {
81 | padding: '15px',
82 | }
83 | },
84 | buttonText: {
85 | fontWeight: '700',
86 | color: 'white',
87 | },
88 | disaclaimer: {
89 | padding: '12px',
90 | border: '1px solid rgb(174, 174, 174)',
91 | borderRadius: '0.75rem',
92 | marginBottom: '24px',
93 | },
94 | card: {
95 | width: '100%',
96 | display: 'flex',
97 | flexWrap: 'wrap',
98 | justifyContent: 'center',
99 | paddingBottom: '20px',
100 | flexDirection: 'column',
101 | alignItems: 'center',
102 | },
103 | })
104 |
105 | const StyledTabs = withStyles({
106 | indicator: {
107 | display: 'flex',
108 | justifyContent: 'center',
109 | backgroundColor: 'transparent',
110 | '& > div': {
111 | maxWidth: 40,
112 | width: '100%',
113 | backgroundColor: '#DC6BE5',
114 | },
115 | },
116 | })(props => }} />);
117 |
118 |
119 | const StyledTab = withStyles(theme => ({
120 | root: {
121 | textTransform: 'none',
122 | fontWeight: theme.typography.fontWeightRegular,
123 | fontSize: theme.typography.pxToRem(15),
124 | marginRight: '1px',
125 | '&:focus': {
126 | color: '#DC6BE5',
127 | opacity: 1,
128 | },
129 | },
130 | }))(props => );
131 |
132 |
133 | const emitter = Store.emitter
134 | const dispatcher = Store.dispatcher
135 | const store = Store.store
136 |
137 | class Pool extends Component {
138 |
139 | constructor(props) {
140 | super()
141 |
142 | const account = store.getStore('account')
143 | const assets = store.getStore('assets')
144 |
145 | this.state = {
146 | value: 0,
147 | loading: !(account && assets),
148 | account: account
149 | }
150 |
151 | }
152 |
153 | componentWillMount() {
154 | emitter.on(CONFIGURE_RETURNED, this.configureReturned)
155 | }
156 |
157 | componentWillUnmount() {
158 | emitter.removeListener(CONFIGURE_RETURNED, this.configureReturned)
159 | };
160 |
161 | configureReturned = () => {
162 | this.setState({ loading: false })
163 | dispatcher.dispatch({ type: GET_POOL_BALANCES, content: {} })
164 | }
165 |
166 | render() {
167 | const { classes, t } = this.props;
168 | const {
169 | value,
170 | account,
171 | loading,
172 | modalOpen,
173 | } = this.state
174 |
175 | var address = null;
176 | if (account.address) {
177 | address = account.address.substring(0,6)+'...'+account.address.substring(account.address.length-4,account.address.length)
178 | }
179 |
180 | return (
181 |
182 | { !account.address &&
183 |
184 |
This project is in beta. Use at your own risk.
185 |
186 | { t('Pool.Intro') }
187 |
188 |
189 |
198 |
199 |
200 | }
201 | { account.address &&
202 |
203 |
204 |
205 |
206 |
207 |
208 |
209 | }
210 | { account.address && value == 0 &&
}
211 | { account.address && value == 1 &&
}
212 | { account.address && value == 2 &&
}
213 | { modalOpen && this.renderModal() }
214 |
215 | )
216 | }
217 |
218 | renderModal = () => {
219 | return (
220 |
221 | )
222 | }
223 |
224 | handleTabChange = (event, newValue) => {
225 | this.setState({value:newValue})
226 | };
227 |
228 | overlayClicked = () => {
229 | this.setState({ modalOpen: true })
230 | }
231 |
232 | closeModal = () => {
233 | this.setState({ modalOpen: false })
234 | }
235 |
236 | }
237 |
238 | export default withNamespaces()(withRouter(withStyles(styles)(Pool)));
239 |
--------------------------------------------------------------------------------
/src/components/header/header.jsx:
--------------------------------------------------------------------------------
1 | import React from 'react'
2 | import { withStyles } from '@material-ui/core/styles';
3 | import {
4 | Tabs,
5 | Tab,
6 | Typography
7 | } from '@material-ui/core';
8 | import { withRouter } from "react-router-dom";
9 | import { colors } from '../../theme'
10 |
11 | const styles = theme => ({
12 | root: {
13 | verticalAlign: 'top',
14 | width: '100%',
15 | display: 'flex',
16 | },
17 | earn: {
18 | flex: '1',
19 | height: '75px',
20 | width: '100%',
21 | display: 'flex',
22 | justifyContent: 'center',
23 | alignItems: 'center',
24 | cursor: 'pointer',
25 | backgroundColor: colors.pink,
26 | '&:hover': {
27 | backgroundColor: "#f9fafb",
28 | '& .title': {
29 | color: colors.pink
30 | },
31 | '& .titleActive': {
32 | color: colors.pink,
33 | borderBottom: '4px solid '+colors.pink,
34 | padding: '10px 0px'
35 | },
36 | '& .icon': {
37 | color: colors.pink
38 | }
39 | },
40 | '& .title': {
41 | color: colors.white
42 | },
43 | '& .titleActive': {
44 | color: colors.white,
45 | borderBottom: '4px solid white',
46 | padding: '10px 0px'
47 | },
48 | '& .icon': {
49 | color: colors.white
50 | },
51 | },
52 | zap: {
53 | flex: '1',
54 | height: '75px',
55 | width: '100%',
56 | display: 'flex',
57 | justifyContent: 'center',
58 | alignItems: 'center',
59 | cursor: 'pointer',
60 | backgroundColor: colors.lightBlue,
61 | '&:hover': {
62 | backgroundColor: "#f9fafb",
63 | '& .title': {
64 | color: colors.lightBlue,
65 | },
66 | '& .titleActive': {
67 | color: colors.lightBlue,
68 | borderBottom: '4px solid '+colors.lightBlue,
69 | padding: '10px 0px'
70 | },
71 | '& .icon': {
72 | color: colors.lightBlue
73 | }
74 | },
75 | '& .title': {
76 | color: colors.white
77 | },
78 | '& .titleActive': {
79 | color: colors.white,
80 | borderBottom: '4px solid white',
81 | padding: '10px 0px'
82 | },
83 | '& .icon': {
84 | color: colors.white
85 | },
86 | },
87 | apr: {
88 | flex: '1',
89 | height: '75px',
90 | width: '100%',
91 | display: 'flex',
92 | justifyContent: 'center',
93 | alignItems: 'center',
94 | cursor: 'pointer',
95 | backgroundColor: colors.lightBlack,
96 | '&:hover': {
97 | backgroundColor: "#f9fafb",
98 | '& .title': {
99 | color: colors.lightBlack
100 | },
101 | '& .titleActive': {
102 | color: colors.lightBlack,
103 | borderBottom: '4px solid '+colors.lightBlack,
104 | padding: '10px 0px'
105 | },
106 | '& .icon': {
107 | color: colors.lightBlack
108 | }
109 | },
110 | '& .title': {
111 | color: colors.white
112 | },
113 | '& .titleActive': {
114 | color: colors.white,
115 | borderBottom: '4px solid white',
116 | padding: '10px 0px'
117 | },
118 | '& .icon': {
119 | color: colors.white
120 | }
121 | },
122 | cover: {
123 | flex: '1',
124 | height: '75px',
125 | width: '100%',
126 | display: 'flex',
127 | justifyContent: 'center',
128 | alignItems: 'center',
129 | cursor: 'pointer',
130 | backgroundColor: colors.compoundGreen,
131 | '&:hover': {
132 | backgroundColor: "#f9fafb",
133 | '& .title': {
134 | color: colors.compoundGreen
135 | },
136 | '& .titleActive': {
137 | color: colors.compoundGreen,
138 | borderBottom: '4px solid '+colors.compoundGreen,
139 | padding: '10px 0px'
140 | },
141 | '& .icon': {
142 | color: colors.compoundGreen
143 | }
144 | },
145 | '& .title': {
146 | color: colors.white
147 | },
148 | '& .titleActive': {
149 | color: colors.white,
150 | borderBottom: '4px solid white',
151 | padding: '10px 0px'
152 | },
153 | '& .icon': {
154 | color: colors.white
155 | }
156 | },
157 | pool: {
158 | flex: '1',
159 | height: '75px',
160 | width: '100%',
161 | display: 'flex',
162 | justifyContent: 'center',
163 | alignItems: 'center',
164 | cursor: 'pointer',
165 | backgroundColor: colors.tomato,
166 | '&:hover': {
167 | backgroundColor: "#f9fafb",
168 | '& .title': {
169 | color: colors.tomato
170 | },
171 | '& .titleActive': {
172 | color: colors.tomato,
173 | borderBottom: '4px solid '+colors.tomato,
174 | padding: '10px 0px'
175 | },
176 | '& .icon': {
177 | color: colors.tomato
178 | }
179 | },
180 | '& .title': {
181 | color: colors.white
182 | },
183 | '& .titleActive': {
184 | color: colors.white,
185 | borderBottom: '4px solid white',
186 | padding: '10px 0px'
187 | },
188 | '& .icon': {
189 | color: colors.white
190 | }
191 | },
192 | });
193 |
194 | function Header(props) {
195 | const {
196 | classes,
197 | setHeaderValue,
198 | headerValue,
199 | location
200 | } = props;
201 |
202 | const [value, setValue] = React.useState(0);
203 |
204 | const handleChange = (event, newValue) => {
205 | setValue(newValue);
206 | setHeaderValue(newValue)
207 | };
208 |
209 | const nav = (screen) => {
210 | props.history.push('/'+screen)
211 | }
212 |
213 | return()
214 |
215 | return (
216 |
217 |
{ nav('earn') } }>
218 | Earn
219 |
220 |
{ nav('zap') } }>
221 | Zap
222 |
223 |
{ nav('apr') } }>
224 | APR
225 |
226 |
{ nav('cover') } }>
227 | Cover
228 |
229 |
{ nav('pool') } }>
230 | Pool
231 |
232 |
233 | )
234 | }
235 |
236 | function a11yProps(index) {
237 | return {
238 | id: `full-width-tab-${index}`,
239 | 'aria-controls': `full-width-tabpanel-${index}`,
240 | };
241 | }
242 |
243 | export default withRouter(withStyles(styles)(Header));
244 |
--------------------------------------------------------------------------------
/src/theme/theme.jsx:
--------------------------------------------------------------------------------
1 | import createBreakpoints from '@material-ui/core/styles/createBreakpoints'
2 |
3 | import WorkSansTTF from '../assets/fonts/WorkSans-VariableFont_wght.ttf';
4 |
5 | const WorkSans = {
6 | fontFamily: 'Work Sans Thin',
7 | fontStyle: 'normal',
8 | fontDisplay: 'swap',
9 | fontWeight: 400,
10 | src: `
11 | local('Work Sans Thin'),
12 | local('Work Sans Thin'),
13 | url(${WorkSansTTF}) format('truetype')
14 | `,
15 | unicodeRange:
16 | 'U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+2000-206F, U+2074, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF',
17 | };
18 |
19 | export const colors = {
20 | white: "#fff",
21 | black: '#000',
22 | darkBlue: "#2c3b57",
23 | blue: "#2F80ED",
24 | gray: "#e1e1e1",
25 | lightGray: "#737373",
26 | lightBlack: "#6a6a6a",
27 | darkBlack: "#141414",
28 | green: '#1abc9c',
29 | red: '#ed4337',
30 | orange: 'orange',
31 | pink: '#DC6BE5',
32 | compoundGreen: '#00d395',
33 | tomato: '#e56b73',
34 | purple: '#935dff',
35 |
36 | text: "#212529",
37 | lightBlue: "#2F80ED",
38 | topaz: "#0b8f92",
39 | darkGray: "rgba(43,57,84,.5)",
40 | borderBlue: 'rgba(25, 101, 233, 0.5)'
41 | };
42 |
43 | const breakpoints = createBreakpoints({
44 | keys: ["xs", "sm", "md", "lg", "xl"],
45 | values: {
46 | xs: 0,
47 | sm: 600,
48 | md: 900,
49 | lg: 1200,
50 | xl: 1800
51 | }
52 | })
53 |
54 | const iswapTheme = {
55 | typography: {
56 | fontFamily: [
57 | '"Work Sans Thin"',
58 | 'BlinkMacSystemFont',
59 | '"Segoe UI"',
60 | 'Roboto',
61 | '"Helvetica Neue"',
62 | 'Arial',
63 | 'sans-serif',
64 | '"Apple Color Emoji"',
65 | '"Segoe UI Emoji"',
66 | '"Segoe UI Symbol"',
67 | ].join(','),
68 | h1: {
69 | fontSize: '48px',
70 | fontWeight: '600',
71 | WebkitFontSmoothing: "antialiased",
72 | MozOsxFontSmoothing: "grayscale",
73 | lineHeight: 1.2
74 | },
75 | h2: {
76 | fontSize: '36px',
77 | fontWeight: '600',
78 | WebkitFontSmoothing: "antialiased",
79 | MozOsxFontSmoothing: "grayscale",
80 | lineHeight: 1.2
81 | },
82 | h3: {
83 | fontSize: '24px',
84 | fontWeight: '600',
85 | WebkitFontSmoothing: "antialiased",
86 | MozOsxFontSmoothing: "grayscale",
87 | lineHeight: 1.2
88 | },
89 | h4: {
90 | fontSize: '16px',
91 | fontWeight: '600',
92 | WebkitFontSmoothing: "antialiased",
93 | MozOsxFontSmoothing: "grayscale",
94 | lineHeight: 1.2
95 | },
96 | h5: {
97 | fontSize: '14px',
98 | fontWeight: '600',
99 | WebkitFontSmoothing: "antialiased",
100 | MozOsxFontSmoothing: "grayscale",
101 | lineHeight: 1.2
102 | },
103 | body1: {
104 | fontSize: '16px',
105 | fontWeight: '300',
106 | WebkitFontSmoothing: "antialiased",
107 | MozOsxFontSmoothing: "grayscale",
108 | },
109 | body2: {
110 | fontSize: '16px',
111 | fontWeight: '300',
112 | WebkitFontSmoothing: "antialiased",
113 | MozOsxFontSmoothing: "grayscale",
114 | },
115 | },
116 | type: 'light',
117 | overrides: {
118 | MuiCssBaseline: {
119 | '@global': {
120 | '@font-face': [WorkSans],
121 | },
122 | },
123 | MuiSelect: {
124 | select: {
125 | padding: '9px'
126 | },
127 | selectMenu: {
128 | minHeight: '30px',
129 | display: 'flex',
130 | alignItems: 'center'
131 | }
132 | },
133 | MuiButton: {
134 | root: {
135 | borderRadius: '50px',
136 | padding: '10px 24px'
137 | },
138 | outlined: {
139 | padding: '10px 24px',
140 | borderWidth: '2px !important'
141 | },
142 | text: {
143 | padding: '10px 24px'
144 | },
145 | label: {
146 | textTransform: 'none',
147 | fontSize: '1rem'
148 | }
149 | },
150 | MuiInputBase: {
151 | input: {
152 | fontSize: '16px',
153 | fontWeight: '600',
154 | WebkitFontSmoothing: "antialiased",
155 | MozOsxFontSmoothing: "grayscale",
156 | lineHeight: 1.2
157 | }
158 | },
159 | MuiOutlinedInput: {
160 | adornedEnd: {
161 |
162 | },
163 | input: {
164 | "&::placeholder": {
165 | color: colors.text
166 | },
167 | color: colors.text,
168 | padding: '14px',
169 | borderRadius: '50px'
170 | },
171 | root: {
172 | // border: "none !important",
173 | borderRadius: '50px'
174 | },
175 | notchedOutline: {
176 | // border: "none !important"
177 | }
178 | },
179 | MuiSnackbar : {
180 | root: {
181 | maxWidth: 'calc(100vw - 24px)'
182 | },
183 | anchorOriginBottomLeft: {
184 | bottom: '12px',
185 | left: '12px',
186 | '@media (min-width: 960px)': {
187 | bottom: '50px',
188 | left: '80px'
189 | }
190 | }
191 | },
192 | MuiSnackbarContent: {
193 | root: {
194 | backgroundColor: colors.white,
195 | padding: '0px',
196 | minWidth: 'auto',
197 | '@media (min-width: 960px)': {
198 | minWidth: '500px',
199 | }
200 | },
201 | message: {
202 | padding: '0px'
203 | },
204 | action: {
205 | marginRight: '0px'
206 | }
207 | },
208 | MuiExpansionPanel: {
209 | root: {
210 | border: '1px solid '+colors.borderBlue,
211 | borderRadius: '50px',
212 | margin: '8px 0px',
213 | '&:before': { //underline color when textfield is inactive
214 | backgroundColor: 'none',
215 | height: '0px'
216 | },
217 | }
218 | },
219 | MuiInput: {
220 | underline: {
221 | '&:before': { //underline color when textfield is inactive
222 | borderBottom: 'none !important'
223 | },
224 | '&:after': { //underline color when textfield is inactive
225 | borderBottom: 'none !important'
226 | },
227 | }
228 | },
229 | MuiExpansionPanelSummary: {
230 | root: {
231 | padding: '30px 42px'
232 | },
233 | content: {
234 | margin: '0px !important'
235 | }
236 | },
237 | MuiExpansionPanelDetails: {
238 | root: {
239 | padding: '0 12px 15px 12px',
240 | '@media (min-width: 960px)': {
241 | padding: '0 24px 30px 24px',
242 | }
243 | }
244 | },
245 | MuiToggleButton: {
246 | root: {
247 | borderRadius: '50px',
248 | textTransform: 'none',
249 | minWidth: '100px',
250 | border: 'none',
251 | '& > span > h4': {
252 | color: '#555',
253 | },
254 | '&:hover': {
255 | backgroundColor: "rgba(47,128,237, 0.2)",
256 | },
257 | "&$selected": {
258 | backgroundColor: '#2f80ed',
259 | '& > span > h4': {
260 | color: '#fff',
261 | },
262 | '&:hover': {
263 | backgroundColor: "rgba(47,128,237, 0.2)",
264 | '& > span > h4': {
265 | color: '#000',
266 | },
267 | },
268 | }
269 | }
270 | },
271 | MuiPaper: {
272 | elevation1: {
273 | boxShadow: 'none'
274 | }
275 | },
276 | MuiToggleButtonGroup: {
277 | root: {
278 | border: '1px solid '+colors.borderBlue,
279 | borderRadius: '50px',
280 | },
281 | groupedSizeSmall: {
282 | padding: '42px 30px'
283 | }
284 | },
285 | MuiFormControlLabel: {
286 | label: {
287 | color: colors.darkBlack
288 | }
289 | }
290 | },
291 | palette: {
292 | primary: {
293 | main: colors.blue
294 | },
295 | secondary: {
296 | main: colors.topaz
297 | },
298 | text: {
299 | primary: colors.text,
300 | secondary: colors.text
301 | }
302 | },
303 | breakpoints: breakpoints
304 | };
305 |
306 | export default iswapTheme;
307 |
--------------------------------------------------------------------------------
/src/components/unlock/unlock.jsx:
--------------------------------------------------------------------------------
1 | import React, { Component } from "react";
2 | import { withRouter } from "react-router-dom";
3 | import { withStyles } from '@material-ui/core/styles';
4 | import {
5 | Typography,
6 | Button,
7 | CircularProgress
8 | } from '@material-ui/core';
9 | import CloseIcon from '@material-ui/icons/Close';
10 | import { withNamespaces } from 'react-i18next';
11 |
12 | import {
13 | Web3ReactProvider,
14 | useWeb3React,
15 | } from "@web3-react/core";
16 | import { Web3Provider } from "@ethersproject/providers";
17 | import { useEagerConnect, useInactiveListener } from "./hooks";
18 |
19 | import {
20 | ERROR,
21 | CONNECTION_DISCONNECTED,
22 | CONNECTION_CONNECTED
23 | } from '../../constants'
24 |
25 | import Store from "../../stores";
26 | const emitter = Store.emitter
27 | const store = Store.store
28 |
29 | const styles = theme => ({
30 | root: {
31 | flex: 1,
32 | height: 'auto',
33 | display: 'flex',
34 | position: 'relative'
35 | },
36 | contentContainer: {
37 | margin: 'auto',
38 | textAlign: 'center',
39 | padding: '12px',
40 | display: 'flex',
41 | flexWrap: 'wrap'
42 | },
43 | cardContainer: {
44 | marginTop: '60px',
45 | minHeight: '260px',
46 | display: 'flex',
47 | flexDirection: 'column',
48 | justifyContent: 'space-around',
49 | alignItems: 'center'
50 | },
51 | unlockCard: {
52 | padding: '24px'
53 | },
54 | buttonText: {
55 | marginLeft: '12px',
56 | fontWeight: '700',
57 | },
58 | instruction: {
59 | maxWidth: '400px',
60 | marginBottom: '32px',
61 | marginTop: '32px'
62 | },
63 | actionButton: {
64 | padding: '12px',
65 | backgroundColor: 'white',
66 | borderRadius: '3rem',
67 | border: '1px solid #E1E1E1',
68 | fontWeight: 500,
69 | [theme.breakpoints.up('md')]: {
70 | padding: '15px',
71 | }
72 | },
73 | connect: {
74 | width: '100%'
75 | },
76 | closeIcon: {
77 | position: 'fixed',
78 | right: '12px',
79 | top: '12px',
80 | cursor: 'pointer'
81 | }
82 | });
83 |
84 | class Unlock extends Component {
85 |
86 | constructor(props) {
87 | super()
88 |
89 | this.state = {
90 | error: null,
91 | metamaskLoading: false,
92 | ledgerLoading: false
93 | }
94 | }
95 |
96 | componentWillMount() {
97 | emitter.on(CONNECTION_CONNECTED, this.connectionConnected);
98 | emitter.on(CONNECTION_DISCONNECTED, this.connectionDisconnected);
99 | emitter.on(ERROR, this.error);
100 | };
101 |
102 | componentWillUnmount() {
103 | emitter.removeListener(CONNECTION_CONNECTED, this.connectionConnected);
104 | emitter.removeListener(CONNECTION_DISCONNECTED, this.connectionDisconnected);
105 | emitter.removeListener(ERROR, this.error);
106 | };
107 |
108 | error = (err) => {
109 | this.setState({ loading: false, error: err, metamaskLoading: false, ledgerLoading: false })
110 | };
111 |
112 | connectionConnected = () => {
113 | if(this.props.closeModal != null) {
114 | this.props.closeModal()
115 | }
116 | }
117 |
118 | connectionDisconnected = () => {
119 | if(this.props.closeModal != null) {
120 | this.props.closeModal()
121 | }
122 | }
123 |
124 | metamaskUnlocked = () => {
125 | this.setState({ metamaskLoading: false })
126 | if(this.props.closeModal != null) {
127 | this.props.closeModal()
128 | }
129 | }
130 |
131 | ledgerUnlocked = () => {
132 | this.setState({ ledgerLoading: false })
133 | if(this.props.closeModal != null) {
134 | this.props.closeModal()
135 | }
136 | }
137 |
138 | cancelLedger = () => {
139 | this.setState({ ledgerLoading: false })
140 | }
141 |
142 | cancelMetamask = () => {
143 | this.setState({ metamaskLoading: false })
144 | }
145 |
146 | render() {
147 | const { classes, closeModal, t } = this.props;
148 |
149 | return (
150 |
151 |
152 |
153 |
154 |
155 |
156 |
157 |
158 | )
159 | };
160 | }
161 |
162 | function getLibrary(provider) {
163 |
164 | const library = new Web3Provider(provider);
165 | library.pollingInterval = 8000;
166 | return library;
167 | }
168 |
169 | function onConnectionClicked(currentConnector, name, setActivatingConnector, activate) {
170 | const connectorsByName = store.getStore('connectorsByName')
171 | setActivatingConnector(currentConnector);
172 | activate(connectorsByName[name]);
173 | }
174 |
175 | function onDeactivateClicked(deactivate, connector) {
176 | if(deactivate) {
177 | deactivate()
178 | }
179 | if(connector && connector.close) {
180 | connector.close()
181 | }
182 | store.setStore({ account: { }, web3context: null })
183 | emitter.emit(CONNECTION_DISCONNECTED)
184 | }
185 |
186 | function MyComponent(props) {
187 |
188 | const context = useWeb3React();
189 | const localContext = store.getStore('web3context');
190 | var localConnector = null;
191 | if (localContext) {
192 | localConnector = localContext.connector
193 | }
194 | const {
195 | connector,
196 | library,
197 | account,
198 | activate,
199 | deactivate,
200 | active,
201 | error
202 | } = context;
203 | var connectorsByName = store.getStore('connectorsByName')
204 |
205 | const { closeModal, t } = props
206 |
207 | const [activatingConnector, setActivatingConnector] = React.useState();
208 | React.useEffect(() => {
209 | if (activatingConnector && activatingConnector === connector) {
210 | setActivatingConnector(undefined);
211 | }
212 | }, [activatingConnector, connector]);
213 |
214 | React.useEffect(() => {
215 | if (account && active && library) {
216 | store.setStore({ account: { address: account }, web3context: context })
217 | emitter.emit(CONNECTION_CONNECTED)
218 | }
219 | }, [account, active, closeModal, context, library]);
220 |
221 | // React.useEffect(() => {
222 | // if (storeContext && storeContext.active && !active) {
223 | // console.log("we are deactive: "+storeContext.account)
224 | // store.setStore({ account: {}, web3context: null })
225 | // }
226 | // }, [active, storeContext]);
227 |
228 | // handle logic to eagerly connect to the injected ethereum provider, if it exists and has granted access already
229 | const triedEager = useEagerConnect();
230 |
231 | // handle logic to connect in reaction to certain events on the injected ethereum provider, if it exists
232 | useInactiveListener(!triedEager || !!activatingConnector);
233 | const width = window.innerWidth
234 |
235 | return (
236 | 650 ? 'space-between' : 'center'), alignItems: 'center' }}>
237 | {Object.keys(connectorsByName).map(name => {
238 | const currentConnector = connectorsByName[name];
239 | const activating = currentConnector === activatingConnector;
240 | const connected = (currentConnector === connector||currentConnector === localConnector);
241 | const disabled =
242 | !triedEager || !!activatingConnector || !!error;
243 |
244 | var url;
245 | var display = name;
246 | if (name === 'MetaMask') {
247 | url = require('../../assets/icn-metamask.svg')
248 | } else if (name === 'WalletConnect') {
249 | url = require('../../assets/walletConnectIcon.svg')
250 | } else if (name === 'TrustWallet') {
251 | url = require('../../assets/trustWallet.png')
252 | } else if (name === 'Portis') {
253 | url = require('../../assets/portisIcon.png')
254 | } else if (name === 'Fortmatic') {
255 | url = require('../../assets/fortmaticIcon.png')
256 | } else if (name === 'Ledger') {
257 | url = require('../../assets/icn-ledger.svg')
258 | } else if (name === 'Squarelink') {
259 | url = require('../../assets/squarelink.png')
260 | } else if (name === 'Trezor') {
261 | url = require('../../assets/trezor.png')
262 | } else if (name === 'Torus') {
263 | url = require('../../assets/torus.jpg')
264 | } else if (name === 'Authereum') {
265 | url = require('../../assets/icn-aethereum.svg')
266 | } else if (name === 'WalletLink') {
267 | display = 'Coinbase Wallet'
268 | url = require('../../assets/coinbaseWalletIcon.svg')
269 | } else if (name === 'Frame') {
270 | return ''
271 | }
272 |
273 | return (
274 |
275 |
313 |
314 | )
315 | }) }
316 |
317 |
318 |
339 |
340 |
341 | )
342 |
343 | }
344 |
345 | export default withNamespaces()(withRouter(withStyles(styles)(Unlock)));
346 |
--------------------------------------------------------------------------------
/src/assets/walletConnectIcon.svg:
--------------------------------------------------------------------------------
1 |
10 |
--------------------------------------------------------------------------------
/src/components/pool/deposit/deposit.jsx:
--------------------------------------------------------------------------------
1 | import React, { Component } from "react";
2 | import { withRouter } from "react-router-dom";
3 | import { withStyles } from '@material-ui/core/styles';
4 | import {
5 | Card,
6 | Typography,
7 | Button,
8 | InputAdornment,
9 | TextField
10 | } from '@material-ui/core';
11 |
12 | import Loader from '../../loader'
13 | import Snackbar from '../../snackbar'
14 |
15 | import { colors } from '../../../theme'
16 |
17 | import {
18 | ERROR,
19 | GET_POOL_BALANCES,
20 | POOL_BALANCES_RETURNED,
21 | DEPOSIT_POOL,
22 | DEPOSIT_POOL_RETURNED,
23 | GET_DEPOSIT_PRICE,
24 | DEPOSIT_PRICE_RETURNED,
25 | GET_WITHDRAW_PRICE,
26 | WITHDRAW_PRICE_RETURNED,
27 | } from '../../../constants'
28 |
29 | import { withNamespaces } from 'react-i18next';
30 | import Store from "../../../stores";
31 | const emitter = Store.emitter
32 | const dispatcher = Store.dispatcher
33 | const store = Store.store
34 |
35 | const styles = theme => ({
36 | root: {
37 | flex: 1,
38 | display: 'flex',
39 | flexDirection: 'column',
40 | maxWidth: '1200px',
41 | width: '100%',
42 | justifyContent: 'flex-start',
43 | alignItems: 'center'
44 | },
45 | introText: {
46 | flex: 1
47 | },
48 | intro: {
49 | width: '100%',
50 | position: 'relative',
51 | display: 'flex',
52 | justifyContent: 'center',
53 | alignItems: 'center',
54 | },
55 | introCenter: {
56 | minWidth: '100%',
57 | textAlign: 'center',
58 | padding: '48px 0px'
59 | },
60 | investedContainer: {
61 | display: 'flex',
62 | flex: 1,
63 | flexDirection: 'column',
64 | alignItems: 'center',
65 | justifyContent: 'center',
66 | padding: '12px',
67 | minWidth: '100%',
68 | [theme.breakpoints.up('md')]: {
69 | minWidth: '800px',
70 | }
71 | },
72 | connectContainer: {
73 | padding: '12px',
74 | display: 'flex',
75 | justifyContent: 'center',
76 | width: '100%',
77 | maxWidth: '450px',
78 | [theme.breakpoints.up('md')]: {
79 | width: '450',
80 | }
81 | },
82 | actionButton: {
83 | '&:hover': {
84 | backgroundColor: "#2F80ED",
85 | },
86 | padding: '12px',
87 | backgroundColor: "#2F80ED",
88 | borderRadius: '1rem',
89 | border: '1px solid #E1E1E1',
90 | fontWeight: 500,
91 | [theme.breakpoints.up('md')]: {
92 | padding: '15px',
93 | }
94 | },
95 | buttonText: {
96 | fontWeight: '700',
97 | color: 'white',
98 | },
99 | disaclaimer: {
100 | padding: '12px',
101 | border: '1px solid rgb(174, 174, 174)',
102 | borderRadius: '0.75rem',
103 | marginBottom: '24px',
104 | },
105 | aUSDCard: {
106 | display: 'flex',
107 | justifyContent: 'space-between',
108 | overflow: 'hidden',
109 | flex: 1,
110 | whiteSpace: 'nowrap',
111 | fontSize: '0.83rem',
112 | padding: '28px 30px',
113 | borderRadius: '50px',
114 | border: '1px solid '+colors.borderBlue,
115 | alignItems: 'center',
116 | maxWidth: '500px',
117 | marginTop: '40px',
118 | background: colors.white,
119 | [theme.breakpoints.up('md')]: {
120 | width: '100%'
121 | }
122 | },
123 | aUSDBalance: {
124 | display: 'flex',
125 | alignItems: 'center'
126 | },
127 | addressContainer: {
128 | display: 'flex',
129 | justifyContent: 'space-between',
130 | overflow: 'hidden',
131 | flex: 1,
132 | whiteSpace: 'nowrap',
133 | fontSize: '0.83rem',
134 | textOverflow:'ellipsis',
135 | cursor: 'pointer',
136 | padding: '28px 30px',
137 | borderRadius: '50px',
138 | border: '1px solid '+colors.borderBlue,
139 | alignItems: 'center',
140 | maxWidth: '500px',
141 | [theme.breakpoints.up('md')]: {
142 | width: '100%'
143 | }
144 | },
145 | card: {
146 | width: '100%',
147 | display: 'flex',
148 | flexWrap: 'wrap',
149 | maxWidth: '800px',
150 | justifyContent: 'center',
151 | flexDirection: 'column',
152 | alignItems: 'center',
153 | },
154 | inputContainer: {
155 | flex: 1,
156 | display: 'flex',
157 | flexWrap: 'wrap',
158 | padding: '42px 30px',
159 | borderRadius: '50px',
160 | flexDirection: 'column',
161 | justifyContent: 'flex-start',
162 | alignItems: 'center',
163 | margin: '40px 0px',
164 | border: '1px solid '+colors.borderBlue,
165 | minWidth: '500px',
166 | },
167 | actionInput: {
168 | padding: '0px 0px 12px 0px',
169 | fontSize: '0.5rem'
170 | },
171 | inputAdornment: {
172 | fontWeight: '600',
173 | fontSize: '1.5rem'
174 | },
175 | assetIcon: {
176 | display: 'inline-block',
177 | verticalAlign: 'middle',
178 | borderRadius: '25px',
179 | background: '#dedede',
180 | height: '30px',
181 | width: '30px',
182 | textAlign: 'center',
183 | marginRight: '16px'
184 | },
185 | balances: {
186 | width: '100%',
187 | textAlign: 'right',
188 | paddingRight: '20px',
189 | cursor: 'pointer'
190 | },
191 | title: {
192 | paddingRight: '24px'
193 | },
194 | value: {
195 | cursor: 'pointer'
196 | },
197 | valContainer: {
198 | display: 'flex',
199 | flexDirection: 'column',
200 | width: '100%'
201 | },
202 | inputCardHeading: {
203 | width: '100%',
204 | color: colors.darkGray
205 | },
206 | placceholder: {
207 | marginBottom: '12px'
208 | },
209 | ratios: {
210 | marginBottom: '12px'
211 | },
212 | idealHolder: {
213 | display: 'flex'
214 | },
215 | disabledAdornment: {
216 | color: 'rgb(170, 170, 170)'
217 | },
218 | walletAddress: {
219 | padding: '0px 12px'
220 | },
221 | walletTitle: {
222 | flex: 1,
223 | color: colors.darkGray
224 | },
225 | });
226 |
227 | class Deposit extends Component {
228 |
229 | constructor() {
230 | super()
231 |
232 | const account = store.getStore('account')
233 | const assets = store.getStore('assets')
234 |
235 | this.state = {
236 | loading: !assets,
237 | account: account,
238 | assets: assets ? assets.filter((asset) => { return asset.balance > 0 }) : null,
239 | }
240 | }
241 |
242 | componentWillMount() {
243 | emitter.on(ERROR, this.errorReturned);
244 | emitter.on(POOL_BALANCES_RETURNED, this.balancesReturned);
245 | emitter.on(DEPOSIT_POOL_RETURNED, this.depositPoolReturned);
246 | }
247 |
248 | componentWillUnmount() {
249 | emitter.removeListener(ERROR, this.errorReturned);
250 | emitter.removeListener(POOL_BALANCES_RETURNED, this.balancesReturned);
251 | emitter.removeListener(DEPOSIT_POOL_RETURNED, this.depositPoolReturned);
252 | };
253 |
254 | depositPoolReturned = (txHash) => {
255 | this.setState({ snackbarMessage: null, snackbarType: null, loading: false })
256 | const that = this
257 | setTimeout(() => {
258 | const snackbarObj = { snackbarMessage: txHash, snackbarType: 'Hash' }
259 | that.setState(snackbarObj)
260 | })
261 | };
262 |
263 | balancesReturned = (balances) => {
264 | const assets = store.getStore('assets')
265 | this.setState({
266 | loading: false,
267 | assets: assets ? assets.filter((asset) => { return asset.balance > 0 }) : null
268 | })
269 | };
270 |
271 | errorReturned = (error) => {
272 | const snackbarObj = { snackbarMessage: null, snackbarType: null }
273 | this.setState(snackbarObj)
274 | this.setState({ loading: false })
275 | const that = this
276 | setTimeout(() => {
277 | const snackbarObj = { snackbarMessage: error.toString(), snackbarType: 'Error' }
278 | that.setState(snackbarObj)
279 | })
280 | };
281 |
282 | render() {
283 | const { classes, t } = this.props;
284 | const {
285 | account,
286 | assets,
287 | loading,
288 | snackbarMessage
289 | } = this.state
290 |
291 | var address = null;
292 | if (account && account.address) {
293 | address = account.address.substring(0,6)+'...'+account.address.substring(account.address.length-4,account.address.length)
294 | }
295 |
296 | return (
297 |
298 |
299 |
This project is in beta. Use at your own risk.
300 |
301 |
302 | Wallet
303 | { address }
304 |
305 |
306 |
307 | {/*
308 |
309 |

314 |
315 |
{ aUSD.name }
316 |
317 | { aUSD.balance }
318 | { aUSD.symbol }
319 |
320 |
*/}
321 |
322 |
323 | { !assets &&
324 | Loading assets ...
325 | }
326 | { assets &&
327 |
328 | { t("PoolDeposit.Deposit") }
329 | { this.renderDepositAssets() }
330 |
340 |
341 | }
342 |
343 |
344 |
345 | { snackbarMessage && this.renderSnackbar() }
346 | { loading &&
}
347 |
348 | )
349 | };
350 |
351 | renderDepositAssets = () => {
352 | const assets = this.state.assets
353 |
354 | return assets.map((asset) => {
355 | return this.renderAssetInput(asset, 'deposit')
356 | })
357 | }
358 |
359 | renderAssetInput = (asset, type) => {
360 | const {
361 | classes
362 | } = this.props
363 |
364 | const {
365 | loading
366 | } = this.state
367 |
368 | const amount = this.state[asset.id + '_' + type]
369 | const amountError = this.state[asset.id + '_' + type + '_error']
370 |
371 | return (
372 |
373 |
374 | { this.setAmount(asset.id, type, (asset ? asset.balance : 0)) } } className={ classes.value } noWrap>{ 'Balance: '+ ( asset && asset.balance ? (Math.floor(asset.balance*10000)/10000).toFixed(4) : '0.0000') } { asset ? asset.symbol : '' }
375 |
376 |
377 |
{ asset.symbol },
389 | startAdornment:
390 |
391 |

396 |
397 | ,
398 | }}
399 | />
400 |
401 |
402 | )
403 | }
404 |
405 | onDeposit = () => {
406 | this.setState({ amountError: false })
407 | let state = this.state
408 |
409 | const sendAssets = state.assets.map((asset) => {
410 | asset.amount = state[asset.id + '_deposit']
411 | if(asset.amount == null || asset.amount === '') {
412 | asset.amount = 0
413 | }
414 | return asset
415 | }).filter((asset) => {
416 | return asset.amount > 0
417 | })
418 |
419 | if(sendAssets.length > 0) {
420 | this.setState({ loading: true })
421 | dispatcher.dispatch({ type: DEPOSIT_POOL, content: { assets: sendAssets } })
422 | }
423 | }
424 |
425 | renderSnackbar = () => {
426 | var {
427 | snackbarType,
428 | snackbarMessage
429 | } = this.state
430 | return
431 | };
432 |
433 | onChange = (event) => {
434 | let val = []
435 | val[event.target.id] = event.target.value
436 | this.setState(val)
437 | }
438 |
439 | setAmount = (id, type, balance) => {
440 | const bal = (Math.floor((balance === '' ? '0' : balance)*10000)/10000).toFixed(4)
441 | let val = []
442 | val[id + '_' + type] = bal
443 | this.setState(val)
444 | }
445 | }
446 |
447 | export default withNamespaces()(withRouter(withStyles(styles)(Deposit)));
448 |
--------------------------------------------------------------------------------
/src/components/pool/withdraw/withdraw.jsx:
--------------------------------------------------------------------------------
1 | import React, { Component } from "react";
2 | import { withRouter } from "react-router-dom";
3 | import { withStyles } from '@material-ui/core/styles';
4 | import {
5 | Card,
6 | Typography,
7 | Button,
8 | InputAdornment,
9 | TextField
10 | } from '@material-ui/core';
11 |
12 | import Loader from '../../loader'
13 | import UnlockModal from '../../unlock/unlockModal.jsx'
14 | import Snackbar from '../../snackbar'
15 | import { colors } from '../../../theme'
16 |
17 | import {
18 | ERROR,
19 | GET_POOL_BALANCES,
20 | POOL_BALANCES_RETURNED,
21 | CONNECTION_CONNECTED,
22 | CONNECTION_DISCONNECTED,
23 | WITHDRAW_POOL,
24 | WITHDRAW_POOL_RETURNED,
25 | GET_WITHDRAW_PRICE,
26 | WITHDRAW_PRICE_RETURNED,
27 | } from '../../../constants'
28 |
29 | import { withNamespaces } from 'react-i18next';
30 | import Store from "../../../stores";
31 | const emitter = Store.emitter
32 | const dispatcher = Store.dispatcher
33 | const store = Store.store
34 |
35 | const styles = theme => ({
36 | root: {
37 | flex: 1,
38 | display: 'flex',
39 | flexDirection: 'column',
40 | maxWidth: '1200px',
41 | width: '100%',
42 | justifyContent: 'flex-start',
43 | alignItems: 'center'
44 | },
45 | introText: {
46 | flex: 1
47 | },
48 | intro: {
49 | width: '100%',
50 | position: 'relative',
51 | display: 'flex',
52 | justifyContent: 'center',
53 | alignItems: 'center',
54 | },
55 | introCenter: {
56 | minWidth: '100%',
57 | textAlign: 'center',
58 | padding: '48px 0px'
59 | },
60 | investedContainer: {
61 | display: 'flex',
62 | flex: 1,
63 | flexDirection: 'column',
64 | alignItems: 'center',
65 | justifyContent: 'center',
66 | padding: '12px',
67 | minWidth: '100%',
68 | [theme.breakpoints.up('md')]: {
69 | minWidth: '800px',
70 | }
71 | },
72 | connectContainer: {
73 | padding: '12px',
74 | display: 'flex',
75 | justifyContent: 'center',
76 | width: '100%',
77 | maxWidth: '450px',
78 | [theme.breakpoints.up('md')]: {
79 | width: '450',
80 | }
81 | },
82 | actionButton: {
83 | '&:hover': {
84 | backgroundColor: "#2F80ED",
85 | },
86 | padding: '12px',
87 | backgroundColor: "#2F80ED",
88 | borderRadius: '1rem',
89 | border: '1px solid #E1E1E1',
90 | fontWeight: 500,
91 | [theme.breakpoints.up('md')]: {
92 | padding: '15px',
93 | }
94 | },
95 | buttonText: {
96 | fontWeight: '700',
97 | color: 'white',
98 | },
99 | disaclaimer: {
100 | padding: '12px',
101 | border: '1px solid rgb(174, 174, 174)',
102 | borderRadius: '0.75rem',
103 | marginBottom: '24px',
104 | },
105 | addressContainer: {
106 | display: 'flex',
107 | justifyContent: 'space-between',
108 | overflow: 'hidden',
109 | flex: 1,
110 | whiteSpace: 'nowrap',
111 | fontSize: '0.83rem',
112 | textOverflow:'ellipsis',
113 | cursor: 'pointer',
114 | padding: '28px 30px',
115 | borderRadius: '50px',
116 | border: '1px solid '+colors.borderBlue,
117 | alignItems: 'center',
118 | maxWidth: '500px',
119 | [theme.breakpoints.up('md')]: {
120 | width: '100%'
121 | }
122 | },
123 | card: {
124 | width: '100%',
125 | display: 'flex',
126 | flexWrap: 'wrap',
127 | maxWidth: '800px',
128 | justifyContent: 'center',
129 | flexDirection: 'column',
130 | alignItems: 'center',
131 | },
132 | inputContainer: {
133 | flex: 1,
134 | display: 'flex',
135 | flexWrap: 'wrap',
136 | padding: '42px 30px',
137 | borderRadius: '50px',
138 | flexDirection: 'column',
139 | justifyContent: 'flex-start',
140 | alignItems: 'center',
141 | margin: '40px 0px',
142 | border: '1px solid '+colors.borderBlue,
143 | minWidth: '500px',
144 | },
145 | actionInput: {
146 | padding: '0px 0px 12px 0px',
147 | fontSize: '0.5rem'
148 | },
149 | inputAdornment: {
150 | fontWeight: '600',
151 | fontSize: '1.5rem'
152 | },
153 | assetIcon: {
154 | display: 'inline-block',
155 | verticalAlign: 'middle',
156 | borderRadius: '25px',
157 | background: '#dedede',
158 | height: '30px',
159 | width: '30px',
160 | textAlign: 'center',
161 | marginRight: '16px'
162 | },
163 | balances: {
164 | width: '100%',
165 | textAlign: 'right',
166 | paddingRight: '20px',
167 | cursor: 'pointer'
168 | },
169 | title: {
170 | paddingRight: '24px'
171 | },
172 | value: {
173 | cursor: 'pointer'
174 | },
175 | valContainer: {
176 | display: 'flex',
177 | flexDirection: 'column',
178 | width: '100%'
179 | },
180 | inputCardHeading: {
181 | width: '100%',
182 | color: colors.darkGray
183 | },
184 | placceholder: {
185 | marginBottom: '12px'
186 | },
187 | ratios: {
188 | marginBottom: '12px'
189 | },
190 | idealHolder: {
191 | display: 'flex'
192 | },
193 | disabledAdornment: {
194 | color: 'rgb(170, 170, 170)'
195 | },
196 | walletAddress: {
197 | padding: '0px 12px'
198 | },
199 | walletTitle: {
200 | flex: 1,
201 | color: colors.darkGray
202 | },
203 | aUSDCard: {
204 | display: 'flex',
205 | justifyContent: 'space-between',
206 | overflow: 'hidden',
207 | flex: 1,
208 | whiteSpace: 'nowrap',
209 | fontSize: '0.83rem',
210 | padding: '28px 30px',
211 | borderRadius: '50px',
212 | border: '1px solid '+colors.borderBlue,
213 | alignItems: 'center',
214 | maxWidth: '500px',
215 | marginTop: '40px',
216 | background: colors.white,
217 | [theme.breakpoints.up('md')]: {
218 | width: '100%'
219 | }
220 | },
221 | aUSDBalance: {
222 | display: 'flex',
223 | alignItems: 'center'
224 | },
225 | });
226 |
227 | class Withdraw extends Component {
228 |
229 | constructor() {
230 | super()
231 |
232 | const account = store.getStore('account')
233 | const assets = store.getStore('assets')
234 |
235 | this.state = {
236 | loading: !assets,
237 | account: account,
238 | assets: assets.filter((asset) => { return asset.uniBalance > 0 })
239 | }
240 | }
241 |
242 | componentWillMount() {
243 | emitter.on(ERROR, this.errorReturned);
244 | emitter.on(POOL_BALANCES_RETURNED, this.balancesReturned);
245 | emitter.on(WITHDRAW_POOL_RETURNED, this.withdrawPoolReturned);
246 | }
247 |
248 | componentWillUnmount() {
249 | emitter.removeListener(ERROR, this.errorReturned);
250 | emitter.removeListener(POOL_BALANCES_RETURNED, this.balancesReturned);
251 | emitter.removeListener(WITHDRAW_POOL_RETURNED, this.withdrawPoolReturned);
252 | };
253 |
254 | withdrawPoolReturned = (txHash) => {
255 | this.setState({ snackbarMessage: null, snackbarType: null, loading: false })
256 | const that = this
257 | setTimeout(() => {
258 | const snackbarObj = { snackbarMessage: txHash, snackbarType: 'Hash' }
259 | that.setState(snackbarObj)
260 | })
261 | };
262 |
263 | balancesReturned = (balances) => {
264 | this.setState({
265 | assets: store.getStore('assets').filter((asset) => { return asset.uniBalance > 0 }),
266 | loading: false
267 | })
268 | };
269 |
270 | errorReturned = (error) => {
271 | const snackbarObj = { snackbarMessage: null, snackbarType: null }
272 | this.setState(snackbarObj)
273 | this.setState({ loading: false })
274 | const that = this
275 | setTimeout(() => {
276 | const snackbarObj = { snackbarMessage: error.toString(), snackbarType: 'Error' }
277 | that.setState(snackbarObj)
278 | })
279 | };
280 |
281 | render() {
282 | const { classes, t } = this.props;
283 | const {
284 | account,
285 | loading,
286 | modalOpen,
287 | snackbarMessage,
288 | amount,
289 | assets,
290 | } = this.state
291 |
292 | var address = null;
293 | if (account.address) {
294 | address = account.address.substring(0,6)+'...'+account.address.substring(account.address.length-4,account.address.length)
295 | }
296 |
297 | return (
298 |
299 |
300 |
This project is in beta. Use at your own risk.
301 |
302 |
303 | Wallet
304 | { address }
305 |
306 |
307 |
308 | {/*
309 |
310 |

315 |
316 |
{ aUSD.name }
317 |
318 | { aUSD.balance }
319 | { aUSD.symbol }
320 |
321 |
*/}
322 |
323 | { !assets &&
324 | Loading assets ...
325 | }
326 | { assets &&
327 |
328 | { t("PoolWithdraw.Withdraw") }
329 | { this.renderWithdrawAssets() }
330 |
340 |
341 | }
342 |
343 |
344 | { modalOpen && this.renderModal() }
345 | { snackbarMessage && this.renderSnackbar() }
346 | { loading &&
}
347 |
348 | )
349 | };
350 |
351 | onWithdraw = () => {
352 | this.setState({ amountError: false })
353 | let state = this.state
354 |
355 | const sendAssets = state.assets.map((asset) => {
356 | asset.amount = state[asset.id + '_withdraw']
357 | if(asset.amount == null || asset.amount === '') {
358 | asset.amount = 0
359 | }
360 | return asset
361 | }).filter((asset) => {
362 | return asset.amount > 0
363 | })
364 |
365 | if(sendAssets.length > 0) {
366 | this.setState({ loading: true })
367 | dispatcher.dispatch({ type: WITHDRAW_POOL, content: { assets: sendAssets } })
368 | }
369 | }
370 |
371 | renderModal = () => {
372 | return (
373 |
374 | )
375 | }
376 |
377 | renderSnackbar = () => {
378 | var {
379 | snackbarType,
380 | snackbarMessage
381 | } = this.state
382 | return
383 | };
384 |
385 | overlayClicked = () => {
386 | this.setState({ modalOpen: true })
387 | }
388 |
389 | closeModal = () => {
390 | this.setState({ modalOpen: false })
391 | }
392 |
393 | onChange = (event) => {
394 | let val = []
395 | val[event.target.id] = event.target.value
396 | this.setState(val)
397 | };
398 |
399 | renderWithdrawAssets = () => {
400 | const assets = this.state.assets
401 |
402 | return assets.map((asset) => {
403 | return this.renderAssetInput(asset, 'withdraw')
404 | })
405 | }
406 |
407 | renderAssetInput = (asset, type) => {
408 | const {
409 | classes
410 | } = this.props
411 |
412 | const {
413 | loading
414 | } = this.state
415 |
416 | const amount = this.state[asset.id + '_' + type]
417 | const amountError = this.state[asset.id + '_' + type + '_error']
418 |
419 | return (
420 |
421 |
422 | { this.setAmount(asset.id, type, (asset ? asset.uniBalance : 0)) } } className={ classes.value } noWrap>{ 'Balance: '+ ( asset && asset.uniBalance ? (Math.floor(asset.uniBalance*10000)/10000).toFixed(4) : '0.0000') } { asset ? (asset.symbol+'UNI') : '' }
423 |
424 |
425 |
{ (asset.symbol+'UNI') },
437 | startAdornment:
438 |
439 |

444 |
445 | ,
446 | }}
447 | />
448 |
449 |
450 | )
451 | }
452 |
453 | setAmount = (id, type, balance) => {
454 | const bal = (Math.floor((balance === '' ? '0' : balance)*10000)/10000).toFixed(4)
455 | let val = []
456 | val[id + '_' + type] = bal
457 | this.setState(val)
458 | }
459 |
460 | }
461 |
462 | export default withNamespaces()(withRouter(withStyles(styles)(Withdraw)));
463 |
--------------------------------------------------------------------------------