├── .DS_Store ├── .babelrc ├── .env ├── .eslintrc ├── .gitignore ├── .stylelintrc ├── LICENSE ├── README.md ├── app ├── AppConfig.js ├── CommonComponents │ ├── BalanceCard.js │ ├── Chart.js │ ├── ChartOptions.js │ ├── ContentColumn │ │ └── Index.js │ ├── Modal.js │ ├── PopUp │ │ ├── InputForAddres.js │ │ ├── Search.js │ │ └── config.js │ ├── RenderComponents.js │ ├── RoutingPanel.js │ └── Select.js ├── Exchange │ ├── ActionTypes.js │ ├── Actions.js │ ├── CommonComponents │ │ └── Index.js │ ├── Confirmation.js │ ├── Exchange.js │ ├── Reducer.js │ ├── Saga.js │ ├── StartExchange.js │ └── StatusExchange.js ├── Fiat │ ├── ActionTypes.js │ ├── Actions.js │ ├── Fiat.js │ ├── Reducer.js │ └── Saga.js ├── InitialPage │ ├── ActionTypes.js │ ├── Actions.js │ ├── Auth.js │ ├── Dashboard.js │ ├── Header.js │ ├── History.js │ ├── Initial.js │ ├── ListOfWallets.js │ ├── Menu.js │ ├── NewsCard │ │ ├── ActionTypes.js │ │ ├── Actions.js │ │ ├── Container.js │ │ ├── Layout.js │ │ ├── Reducer.js │ │ ├── Saga.js │ │ ├── Selectors.js │ │ ├── Store.js │ │ └── index.js │ ├── Reducer.js │ ├── Saga.js │ ├── SummaryCash.js │ └── WalletInfo.js ├── InitialSetup │ ├── RootReducer.js │ ├── RootSaga.js │ └── Store.js ├── Providers │ ├── DateWrapper.js │ ├── Gaia.js │ ├── GaiaDicts │ │ └── Dashbord.js │ ├── GaiaTemplates │ │ └── WalletList.js │ ├── HistoryNormalization.js │ ├── Wallets.js │ ├── XHRProvider.js │ └── config.js ├── Routing │ ├── ProtectedRoute.js │ └── Router.js ├── Views │ ├── Content.js │ ├── Input.js │ ├── Popup.js │ ├── ScrollableCard.js │ ├── Snackbar.js │ ├── StyledButton.js │ ├── TabsWrapper.js │ └── index.js ├── Wallets │ ├── Reducer.js │ ├── Wallet │ │ ├── ActionTypes.js │ │ ├── Actions.js │ │ ├── AddCustomEthToken.js │ │ ├── OperationSelector.js │ │ ├── QrPopUp.js │ │ ├── Receive.js │ │ ├── Reducer.js │ │ ├── RenderFunctions.js │ │ ├── Saga.js │ │ ├── StepperForSend.js │ │ ├── StepperRenderFunctions.js │ │ ├── Tokens.js │ │ ├── Transactions.js │ │ ├── Wallet.js │ │ └── WalletInfo.js │ ├── WalletList.js │ └── WalletList │ │ ├── ActionTypes.js │ │ ├── Actions.js │ │ ├── ControlPanel.js │ │ ├── CreateNewWallet.js │ │ ├── CreateNewWalletView.js │ │ ├── Customisation.js │ │ ├── DeleteWallet.js │ │ ├── Error.js │ │ ├── LongMenu.js │ │ ├── MakeActive.js │ │ ├── PrivateKey.js │ │ ├── Receive.js │ │ ├── Reducer.js │ │ ├── RenderFunctions.js │ │ ├── Saga.js │ │ └── Views.js ├── devIndex.html ├── images │ ├── common │ │ ├── icon-add.svg │ │ ├── icon-arrow-down-grey.svg │ │ ├── icon-arrow-down.svg │ │ ├── icon-arrow-green.svg │ │ ├── icon-checkbox.svg │ │ ├── icon-cross-grey.svg │ │ ├── icon-cross-white.svg │ │ ├── icon-direction.svg │ │ ├── icon-exchange-loading.svg │ │ ├── icon-filter.svg │ │ ├── icon-link-forward-hover.svg │ │ ├── icon-link-forward.svg │ │ ├── icon-log-out.svg │ │ ├── icon-manual-address.svg │ │ ├── icon-profile.svg │ │ ├── icon-qr.svg │ │ ├── icon-scale.svg │ │ ├── icon-search.svg │ │ ├── icon-support.svg │ │ ├── icon-swap.svg │ │ ├── icon-xl-arrow.svg │ │ ├── icon-xl-swap.svg │ │ └── vision-off.svg │ ├── dappy-logo.svg │ ├── fiat │ │ ├── AUD@1x.png │ │ ├── AUD@2x.png │ │ ├── BRL@1x.png │ │ ├── BRL@2x.png │ │ ├── CAD@1x.png │ │ ├── CAD@2x.png │ │ ├── CHF@1x.png │ │ ├── CHF@2x.png │ │ ├── CNY@1x.png │ │ ├── CNY@2x.png │ │ ├── EUR@1x.png │ │ ├── EUR@2x.png │ │ ├── GBP@1x.png │ │ ├── GBP@2x.png │ │ ├── HKD@1x.png │ │ ├── HKD@2x.png │ │ ├── IDR@1x.png │ │ ├── IDR@2x.png │ │ ├── INR@1x.png │ │ ├── INR@2x.png │ │ ├── JPY@1x.png │ │ ├── JPY@2x.png │ │ ├── KRW@1x.png │ │ ├── KRW@2x.png │ │ ├── MXN@1x.png │ │ ├── MXN@2x.png │ │ ├── RUB@1x.png │ │ ├── RUB@2x.png │ │ ├── USD@1x.png │ │ ├── USD@2x.png │ │ └── index.js │ ├── ic-bch.svg │ ├── ic-btc.svg │ ├── ic-btg.svg │ ├── ic-dash.svg │ ├── ic-dcr.svg │ ├── ic-doge.svg │ ├── ic-etc.svg │ ├── ic-eth.svg │ ├── ic-ltc.svg │ ├── ic-zec.svg │ ├── index.js │ └── nav │ │ ├── icon-dashboard-hover.svg │ │ ├── icon-dashboard.svg │ │ ├── icon-exchange-hover.svg │ │ ├── icon-exchange.svg │ │ ├── icon-wallet-hover.svg │ │ └── icon-wallet.svg ├── index.css ├── index.html └── index.js ├── bundleLibs ├── lib_1.json └── lib_2.json ├── lib.webpack.config.js ├── package.json ├── postcss.config.js ├── webpack.config.js └── yarn.lock /.DS_Store: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/BCNetio/BlockStackWallet/59a4ac2ec3fe06d690643f0e5a1ddc5e6179e045/.DS_Store -------------------------------------------------------------------------------- /.babelrc: -------------------------------------------------------------------------------- 1 | { 2 | "presets": [["env", { "targets": { "node": "current" } }], ["react"], ["stage-2"]], 3 | "env": { 4 | "development": { 5 | "plugins": [ 6 | ["babel-plugin-transform-react-jsx"], 7 | ["fbjs-scripts/babel-6/dev-expression"], 8 | ["transform-runtime"] 9 | ] 10 | }, 11 | "production": { 12 | "plugins": [ 13 | [ 14 | "transform-react-remove-prop-types", 15 | { 16 | "mode": "wrap", 17 | "ignoreFilenames": ["node_modules"] 18 | } 19 | ] 20 | ] 21 | } 22 | } 23 | } 24 | -------------------------------------------------------------------------------- /.env: -------------------------------------------------------------------------------- 1 | # NODE_ENV should be production or development 2 | 3 | NODE_ENV=development 4 | 5 | API_URL= 6 | 7 | STATIC_URL= 8 | 9 | 10 | -------------------------------------------------------------------------------- /.eslintrc: -------------------------------------------------------------------------------- 1 | { 2 | "extends": ["airbnb","prettier"], 3 | "parser": "babel-eslint", 4 | "env": { 5 | "browser": true, 6 | "node": true, 7 | "es6": true, 8 | "mocha": true 9 | }, 10 | "rules": { 11 | "linebreak-style": 0, 12 | "react/jsx-no-bind": 1, 13 | "react/jsx-filename-extension": [1, { "extensions": [".js", ".jsx"] }], 14 | "react/prop-types": 0, 15 | } 16 | } 17 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | # Logs 2 | logs 3 | *.log 4 | npm-debug.log* 5 | 6 | # Runtime data 7 | pids 8 | *.pid 9 | *.seed 10 | 11 | # Directory for instrumented libs generated by jscoverage/JSCover 12 | lib-cov 13 | 14 | # Coverage directory used by tools like istanbul 15 | coverage 16 | 17 | # Grunt intermediate storage (http://gruntjs.com/creating-plugins#storing-task-files) 18 | .grunt 19 | 20 | # node-waf configuration 21 | .lock-wscript 22 | 23 | # Compiled binary addons (http://nodejs.org/api/addons.html) 24 | build/Release 25 | 26 | # Dependency directory 27 | # https://docs.npmjs.com/misc/faq#should-i-check-my-node-modules-folder-into-git 28 | node_modules 29 | 30 | \.idea/ico\.iml 31 | 32 | \.idea/misc\.xml 33 | 34 | \.idea/modules\.xml 35 | 36 | \.idea/workspace\.xml 37 | 38 | public/ 39 | 40 | package-lock\.json 41 | 42 | \.idea/ 43 | -------------------------------------------------------------------------------- /.stylelintrc: -------------------------------------------------------------------------------- 1 | { 2 | "extends": "stylelint-config-standard" 3 | } 4 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | MIT License 2 | 3 | Copyright (c) 2018 BCNetio 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | SOFTWARE. 22 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | 2 | # Blockstack & ShapeShift Signature Bounty Universal Wallet 3 | 4 | ## Getting Started in dev mode. 5 | ``` 6 | git clone https://github.com/BCNetio/BlockStackWallet 7 | npm install 8 | npm run start 9 | ``` 10 | 11 | ## Production build 12 | 13 | ``` 14 | git clone https://github.com/BCNetio/BlockStackWallet 15 | npm install 16 | npm run production 17 | cd public/ 18 | mv * /your/public/server/folder 19 | ``` 20 | 21 | ## Remember you have to add API keys and Ethereum like nodes. 22 | 23 | ``` 24 | app/Providers/config.js - apiKeys and config.exchangeApiKeys 25 | app/AppConfig.js - config.bsNodeProfile (url of blockstack profile) needed in case you run local node 26 | app/AppConfig.js - config.nodes (list of ethereum like nodes) 27 | ``` 28 | 29 | ## Manifest file 30 | ``` 31 | { 32 | "name": "Dappy Wallet", 33 | "start_url": "https://app.bcnet.io", 34 | "description": "Dappy Wallet is a non-custodial universal wallet", 35 | "icons": [ 36 | { 37 | "src": "https://app.bcnet.io/dappy_logo.png", 38 | "sizes": "192x192", 39 | "type": "image/png" 40 | } 41 | ] 42 | } 43 | ``` 44 | 45 | ## Nginx example 46 | ``` 47 | server { 48 | listen 443 ssl; 49 | server_name app.bcnet.io; 50 | ssl_certificate /etc/crypto/app.bcnet.io/fullchain.pem; 51 | ssl_certificate_key /etc/crypto/app.bcnet.io/privkey.pem; 52 | 53 | location / { 54 | root /cdn/dappy/; 55 | try_files $uri /index.html; 56 | add_header Access-Control-Allow-Origin *; 57 | } 58 | } 59 | server { 60 | if ($host = app.bcnet.io) { 61 | return 301 https://$host$request_uri; 62 | } 63 | listen 80; 64 | listen [::]:80; 65 | server_name app.bcnet.io; 66 | return 404; 67 | } 68 | ``` 69 | -------------------------------------------------------------------------------- /app/AppConfig.js: -------------------------------------------------------------------------------- 1 | export const curNames = { 2 | BTC: "btc", 3 | BCH: "bch", 4 | ETH: "eth", 5 | ETC: "etc", 6 | DOGE: "doge", 7 | LTC: "ltc", 8 | DASH: "dash", 9 | BTG: "btg" 10 | }; 11 | 12 | export const config = {}; 13 | 14 | config.mediumNewsRoot = "https://medium.com/dappy/"; 15 | 16 | config.bsNodeProfile = "https://browser.blockstack.org/profiles"; 17 | 18 | config.avCurrencyes = new Map([ 19 | [curNames.BTC, { name: "Bitcoin", abbr: "BTC", sysName: curNames.BTC }], 20 | [curNames.BCH, { name: "Bitcoin cash", abbr: "BCH", sysName: curNames.BCH }], 21 | [curNames.ETH, { name: "Ethereum", abbr: "ETH", sysName: curNames.ETH }], 22 | [ 23 | curNames.ETC, 24 | { name: "Ethereum classic", abbr: "ETC", sysName: curNames.ETC } 25 | ], 26 | [curNames.DOGE, { name: "Dogecoin", abbr: "DOGE", sysName: curNames.DOGE }], 27 | [curNames.LTC, { name: "Litecoin", abbr: "LTC", sysName: curNames.LTC }], 28 | [curNames.DASH, { name: "Dash", abbr: "DASH", sysName: curNames.DASH }], 29 | [curNames.BTG, { name: "Bitcoin Gold", abbr: "BTG", sysName: curNames.BTG }] 30 | ]); 31 | 32 | config.nodes = new Map([[curNames.ETH, ""], [curNames.ETC, ""]]); 33 | 34 | config.networks = { 35 | [curNames.LTC]: { 36 | messagePrefix: "\x19Litecoin Signed Message:\n", 37 | bip32: { 38 | public: 0x019da462, 39 | private: 0x019d9cfe 40 | }, 41 | pubKeyHash: 0x30, 42 | scriptHash: 0x32, 43 | wif: 0xb0 44 | }, 45 | [curNames.DCR]: { 46 | messagePrefix: "\x18Bitcoin Signed Message:\n", 47 | bech32: "dc", 48 | bip32: { 49 | public: 0x0488b21e, 50 | private: 0x0488ade4 51 | }, 52 | pubKeyHash: 0x00, 53 | scriptHash: 0x05, 54 | wif: 0x80 55 | }, 56 | [curNames.BTC]: { 57 | messagePrefix: "\x18Bitcoin Signed Message:\n", 58 | bech32: "bc", 59 | bip32: { 60 | public: 0x0488b21e, 61 | private: 0x0488ade4 62 | }, 63 | pubKeyHash: 0x00, 64 | scriptHash: 0x05, 65 | wif: 0x80 66 | }, 67 | [curNames.BTG]: { 68 | messagePrefix: "\x18Bitcoin Gold Signed Message:\n", 69 | bip32: { 70 | public: 0x0488b21e, 71 | private: 0x0488ade4 72 | }, 73 | pubKeyHash: 0x26, 74 | scriptHash: 0x17, 75 | wif: 0x80 76 | }, 77 | [curNames.DOGE]: { 78 | messagePrefix: "\x19Dogecoin Signed Message:\n", 79 | bip32: { 80 | private: 0x02fac398, 81 | public: 0x02facafd 82 | }, 83 | wif: 0x9e, 84 | pubKeyHash: 0x1e, 85 | scriptHash: 0x16 86 | }, 87 | [curNames.DASH]: { 88 | messagePrefix: "\x19DarkCoin Signed Message:\n", 89 | bip32: { 90 | public: 0x02fe52f8, 91 | private: 0x02fe52cc 92 | }, 93 | pubKeyHash: 0x4c, 94 | scriptHash: 0x10, 95 | wif: 0xcc 96 | } 97 | }; 98 | -------------------------------------------------------------------------------- /app/CommonComponents/BalanceCard.js: -------------------------------------------------------------------------------- 1 | import styled from "styled-components"; 2 | 3 | export const BalanceCard = styled.div` 4 | .title { 5 | color: #f1f1f1; 6 | font-size: 14px; 7 | letter-spacing: 0.26px; 8 | line-height: 16px; 9 | margin: 0; 10 | margin-bottom: 32px; 11 | } 12 | .subtitle { 13 | color: #ffffff; 14 | font-size: 12px; 15 | letter-spacing: 0.3px; 16 | line-height: 14px; 17 | margin: 0; 18 | margin-bottom: 10px; 19 | margin-top: 35px; 20 | span { 21 | font-size: 8px; 22 | text-align: right; 23 | letter-spacing: 0.2px; 24 | color: #8d96b2; 25 | display: inline-block; 26 | margin-left: 5px; 27 | cursor: pointer; 28 | } 29 | } 30 | .total { 31 | color: #ffffff; 32 | font-size: 28px; 33 | font-weight: 300; 34 | letter-spacing: 0.19px; 35 | line-height: 33px; 36 | margin: 0; 37 | margin-bottom: 5px; 38 | } 39 | .currency { 40 | color: #8d96b2; 41 | font-size: 12px; 42 | letter-spacing: 0.3px; 43 | line-height: 14px; 44 | margin: 0; 45 | } 46 | .wallets-number { 47 | background-color: #1f2431; 48 | height: 60px; 49 | width: 65px; 50 | text-align: center; 51 | border-radius: 2px; 52 | p:first-child { 53 | color: #8d96b2; 54 | font-size: 28px; 55 | font-weight: 300; 56 | letter-spacing: 0.25px; 57 | line-height: 33px; 58 | margin: 0; 59 | margin-top: 5px; 60 | } 61 | p:last-child { 62 | color: #8d96b2; 63 | font-size: 12px; 64 | letter-spacing: 0.28px; 65 | line-height: 14px; 66 | margin: 0; 67 | margin-bottom: 10px; 68 | } 69 | } 70 | .address { 71 | margin: 0; 72 | padding: 10px; 73 | background-color: rgba(241, 241, 241, 0.1); 74 | border-radius: 2px 0 0 2px; 75 | height: auto; 76 | width: 90%; 77 | overflow: hidden; 78 | } 79 | `; 80 | -------------------------------------------------------------------------------- /app/CommonComponents/Chart.js: -------------------------------------------------------------------------------- 1 | import React from "react"; 2 | import { Line } from "react-chartjs-2"; 3 | import Card from "@material-ui/core/Card"; 4 | import Button from "@material-ui/core/Button"; 5 | import { merge, lensPath, over, equals } from "ramda"; 6 | import Select from "./Select"; 7 | import { config, curNames } from "../AppConfig"; 8 | import { 9 | layout, 10 | ChartDrapdawnTitle, 11 | lineOptions, 12 | options, 13 | periods, 14 | ChartBox, 15 | chartOptions, 16 | toolTips 17 | } from "./ChartOptions"; 18 | 19 | class Chart extends React.Component { 20 | static currentTime() { 21 | return Math.round(new Date().getTime() / 1000.0); 22 | } 23 | 24 | constructor(props) { 25 | super(props); 26 | const currency = config.avCurrencyes.get(props.currency); 27 | 28 | this.state = { 29 | currency: currency || config.avCurrencyes.get(curNames.BTC), 30 | period: "day", 31 | list: Array.from(config.avCurrencyes) 32 | }; 33 | 34 | this.fetchData = this.fetchData.bind(this); 35 | this.onChangePeriod = this.onChangePeriod.bind(this); 36 | this.handleCurrency = this.handleCurrency.bind(this); 37 | this.mergeCallbacksForFiat = this.mergeCallbacksForFiat.bind(this); 38 | } 39 | 40 | componentDidMount() { 41 | this.fetchData(); 42 | } 43 | 44 | shouldComponentUpdate(nextProps, nextState) { 45 | return !equals(this.props, nextProps) || !equals(this.state, nextState); 46 | } 47 | 48 | onChangePeriod(period) { 49 | this.setState({ period }); 50 | } 51 | 52 | getSnapshotBeforeUpdate(prevProps, prevState) { 53 | if ( 54 | !equals(prevProps.selectedFiat, this.props.selectedFiat) || 55 | !equals(prevState.period, this.state.period) || 56 | !equals(prevState.currency, this.state.currency) 57 | ) { 58 | this.fetchData(); 59 | } 60 | return null; 61 | } 62 | 63 | fetchData() { 64 | this.props.action( 65 | this.state.currency.abbr, 66 | this.state.period, 67 | Chart.currentTime(), 68 | this.props.selectedFiat.abbr 69 | ); 70 | } 71 | 72 | handleCurrency(currency) { 73 | this.setState({ currency }); 74 | } 75 | 76 | mergeCallbacksForFiat() { 77 | const { name, abbr } = this.props.selectedFiat; 78 | return merge(options(`${name} (${abbr})`), toolTips(abbr)); 79 | } 80 | 81 | render() { 82 | return ( 83 | 84 | 85 | 86 | 24 | ); 25 | } 26 | } 27 | 28 | export default SearchBar; 29 | -------------------------------------------------------------------------------- /app/CommonComponents/PopUp/config.js: -------------------------------------------------------------------------------- 1 | import { filter } from "ramda"; 2 | 3 | export const searachFunctions = { 4 | transactions: (searchPredicate, list) => 5 | filter( 6 | wallet => 7 | wallet.alias.toUpperCase().includes(searchPredicate.toUpperCase()), 8 | list 9 | ), 10 | fiat: (searchPredicate, list) => 11 | filter( 12 | fiat => 13 | fiat.name.toUpperCase().includes(searchPredicate.toUpperCase()) || 14 | fiat.abbr.toUpperCase().includes(searchPredicate.toUpperCase()), 15 | list 16 | ), 17 | chart: (searchPredicate, list) => 18 | filter( 19 | currency => 20 | currency[1].name 21 | .toUpperCase() 22 | .includes(searchPredicate.toUpperCase()) || 23 | currency[1].abbr.toUpperCase().includes(searchPredicate.toUpperCase()), 24 | list 25 | ), 26 | wallet: (searchPredicate, list) => 27 | filter( 28 | currency => 29 | currency[1].name 30 | .toUpperCase() 31 | .includes(searchPredicate.toUpperCase()) || 32 | currency[1].abbr.toUpperCase().includes(searchPredicate.toUpperCase()), 33 | list 34 | ) 35 | }; 36 | -------------------------------------------------------------------------------- /app/CommonComponents/RoutingPanel.js: -------------------------------------------------------------------------------- 1 | import React from "react"; 2 | import { withStyles } from "@material-ui/core/styles"; 3 | 4 | import NavbarWrapper from "../InitialPage/Menu"; 5 | 6 | const styles = { 7 | navItem: { 8 | color: "#FFFFFF" 9 | } 10 | }; 11 | 12 | export const RoutingPanel = withStyles(styles)(({}) => ); 13 | -------------------------------------------------------------------------------- /app/Exchange/ActionTypes.js: -------------------------------------------------------------------------------- 1 | export const types = { 2 | FETCH_WALLETS: "@@exchange/FETCH_WALLETS", 3 | MOUNT_WALLETS: "@@exchange/MOUNT_WALLETS", 4 | FETCH_WALLET_BALANCE: "@@exchange/FETCH_WALLET_BALANCE", 5 | MOUNT_WALLET_BALANCE: "@@exchange/MOUNT_WALLET_BALANCE", 6 | FETCH_MARKET_INFO: "@@exchange/FETCH_MARKET_INFO", 7 | MOUNT_MARKET_INFO: "@@exchange/MOUNT_MARKET_INFO", 8 | FETCH_CHECK_EXCHANGE: "@@exchange/FETCH_CHECK_EXCHANGE", 9 | MOUNT_EXCHANGE_CHECK: "@@exchange/MOUNT_EXCHANGE_CHECK", 10 | MOUNT_EXCHANGE_CHECK_ERROR: "@@exchange/MOUNT_EXCHANGE_CHECK_ERROR", 11 | MOUNT_ACTIVE_TAB: "@@exchange/MOUNT_ACTIVE_TAB", 12 | MOUNT_EXCHANE_DETAILS: "@@exchange/MOUNT_EXCHANE_DETAILS", 13 | MAKE_TRANSACTION: "@@exchange/MAKE_TRANSACTION", 14 | FETTCH_STATUS_DEPOSIT: "@@exchange/FETTCH_STATUS_DEPOSIT", 15 | MOUNT_STATUS_DEPOSIT: "@@exchange/MOUNT_STATUS_DEPOSIT" 16 | }; 17 | -------------------------------------------------------------------------------- /app/Exchange/Actions.js: -------------------------------------------------------------------------------- 1 | import { createAction } from "redux-actions"; 2 | import { types } from "./ActionTypes"; 3 | 4 | export const fetchWallets = createAction(types.FETCH_WALLETS, () => ({})); 5 | 6 | export const fetchMarketInfo = createAction(types.FETCH_MARKET_INFO, pair => ({ 7 | pair 8 | })); 9 | 10 | export const fetchWalletBalance = createAction( 11 | types.FETCH_WALLET_BALANCE, 12 | (type, address) => ({ 13 | type, 14 | address 15 | }) 16 | ); 17 | 18 | export const mountActiveTab = createAction(types.MOUNT_ACTIVE_TAB, tabId => ({ 19 | tabId 20 | })); 21 | 22 | export const mountExchangeDetails = createAction( 23 | types.MOUNT_EXCHANE_DETAILS, 24 | details => ({ 25 | details 26 | }) 27 | ); 28 | 29 | export const fetchStatusExchange = createAction( 30 | types.FETCH_CHECK_EXCHANGE, 31 | params => ({ 32 | params 33 | }) 34 | ); 35 | 36 | export const makeTransaction = createAction( 37 | types.MAKE_TRANSACTION, 38 | (wallet, receivers) => ({ 39 | wallet, 40 | receivers 41 | }) 42 | ); 43 | 44 | export const fetchStatusDeposit = createAction( 45 | types.FETTCH_STATUS_DEPOSIT, 46 | address => ({ 47 | address 48 | }) 49 | ); 50 | -------------------------------------------------------------------------------- /app/Exchange/CommonComponents/Index.js: -------------------------------------------------------------------------------- 1 | import styled, { css } from "styled-components"; 2 | 3 | // Icons 4 | import IconArrowDown from "../../images/common/icon-arrow-down.svg"; 5 | 6 | // Styled 7 | // One string in form 8 | export const Row = styled.div` 9 | display: flex; 10 | justify-content: space-between; 11 | align-items: center; 12 | @media (max-width: 768px) { 13 | flex-wrap: wrap; 14 | } 15 | 16 | ${props => 17 | props.mt20 && 18 | css` 19 | margin-top: 20px; 20 | `} 21 | `; 22 | 23 | // Wrapper for input + select 24 | export const DoubleInputSelectWrapper = styled.div` 25 | display: flex; 26 | justify-content: flex-end; 27 | align-items: stretch; 28 | @media (max-width: 768px) { 29 | width: 100%; 30 | justify-content: flex-start; 31 | } 32 | `; 33 | 34 | // Input for exchange 35 | export const Input = styled.input` 36 | border-radius: 2px 0 0 2px; 37 | background-color: #1f2431; 38 | border: none; 39 | height: auto; 40 | padding-left: 20px; 41 | color: #fff; 42 | width: 194px; 43 | @media (max-width: 768px) { 44 | width: 40%; 45 | min-width: 50px; 46 | } 47 | `; 48 | 49 | // Dropdawn list 50 | export const SelectWrapper = styled.div` 51 | height: auto; 52 | background-color: #273041; 53 | position: relative; 54 | cursor: pointer; 55 | &:after { 56 | content: ""; 57 | display: block; 58 | height: 9px; 59 | width: 6px; 60 | position: absolute; 61 | right: 10px; 62 | top: 42%; 63 | background: url(${IconArrowDown}) no-repeat; 64 | transform: rotate(-90deg) translateY(-50%); 65 | } 66 | &:hover { 67 | background-color: rgba(0, 0, 0, 0.08); 68 | } 69 | > div { 70 | padding: 8px 10px; 71 | width: 156px; 72 | > div:first-child { 73 | display: flex; 74 | align-items: center; 75 | justify-content: flex-start; 76 | font-size: 11px; 77 | letter-spacing: 0.4125px; 78 | color: #ffffff; 79 | div { 80 | width: 20%; 81 | height: 20px; 82 | margin-right: 10px; 83 | img { 84 | width: 100%; 85 | height: 100%; 86 | object-fit: contain; 87 | } 88 | } 89 | p { 90 | white-space: nowrap; 91 | text-overflow: ellipsis; 92 | overflow: hidden; 93 | padding-right: 20px; 94 | width: 80%; 95 | } 96 | } 97 | } 98 | `; 99 | 100 | // Label for DoubleInputSelectWrapper 101 | export const Label = styled.p` 102 | font-size: 11px; 103 | letter-spacing: 0.41px; 104 | line-height: 13px; 105 | @media (max-width: 768px) { 106 | margin-bottom: 10px; 107 | } 108 | `; 109 | 110 | // Span for avalaible amount + error 111 | export const Tooltip = styled.span` 112 | color: #8d96b2; 113 | font-size: 8px; 114 | letter-spacing: 0.2px; 115 | line-height: 9px; 116 | margin-left: 61px; 117 | @media (max-width: 768px) { 118 | margin-left: 0; 119 | } 120 | &.error { 121 | color: red; 122 | display: block; 123 | margin-top: 10px; 124 | } 125 | `; 126 | 127 | // Button to next screen 128 | export const NextButtonWrapper = styled.div` 129 | margin-top: 35px; 130 | text-align: right; 131 | `; 132 | 133 | export const Next = styled.button` 134 | border: 1px solid #8d96b2; 135 | border-radius: 14px; 136 | background: transparent; 137 | color: #8d96b2; 138 | padding: 5px 20px; 139 | cursor: pointer; 140 | margin-right: 5px; 141 | outline: none; 142 | `; 143 | 144 | // Info tabs 145 | export const Tabs = styled.div` 146 | border-top: 1px solid rgba(141, 150, 178, 0.1); 147 | display: flex; 148 | justify-content: space-between; 149 | width: 100%; 150 | margin-left: -20px; 151 | position: absolute; 152 | bottom: 0; 153 | div { 154 | width: 33.9%; 155 | text-align: center; 156 | padding: 15px 0; 157 | &:not(:last-child) { 158 | border-right: 1px solid rgba(141, 150, 178, 0.1); 159 | } 160 | p { 161 | color: #8d96b2; 162 | font-size: 10px; 163 | letter-spacing: 0.25px; 164 | line-height: 11px; 165 | margin-bottom: 4px; 166 | } 167 | span { 168 | color: #f1f1f1; 169 | font-size: 10px; 170 | letter-spacing: 0.25px; 171 | line-height: 11px; 172 | text-transform: uppercase; 173 | } 174 | } 175 | `; 176 | 177 | // 178 | const Button = styled.button` 179 | border: 1px solid #7ed321; 180 | border-radius: 14px; 181 | background: transparent; 182 | color: #8d96b2; 183 | padding: 5px 20px; 184 | cursor: pointer; 185 | margin-right: 5px; 186 | outline: none; 187 | `; 188 | -------------------------------------------------------------------------------- /app/Exchange/Exchange.js: -------------------------------------------------------------------------------- 1 | import React from "react"; 2 | import { connect } from "react-redux"; 3 | import { withStyles } from "@material-ui/core/styles"; 4 | import Divider from "@material-ui/core/Divider"; 5 | import styled from "styled-components"; 6 | import * as actions from "./Actions"; 7 | import StartExchange from "./StartExchange"; 8 | import Confirmation from "./Confirmation"; 9 | import StatusExchange from "./StatusExchange"; 10 | import IconSwap from "../images/common/icon-swap.svg"; 11 | 12 | // Import components 13 | import { Button } from "./CommonComponents/Index"; 14 | 15 | const styles = {}; 16 | 17 | // Styled 18 | const ExchangeWrapper = styled.div` 19 | width: 450px; 20 | height: 380px; 21 | background-color: #2b3649; 22 | color: #fff; 23 | text-overflow: ellipsis; 24 | position: relative; 25 | overflow: visible; 26 | @media (max-width: 768px) { 27 | order: 3; 28 | margin: 0 auto; 29 | width: auto; 30 | } 31 | `; 32 | 33 | const Title = styled.div` 34 | padding: 20px; 35 | display: flex; 36 | justify-content: space-between; 37 | align-items: center; 38 | span { 39 | font-size: 14px; 40 | letter-spacing: 0.26px; 41 | line-height: 16px; 42 | position: relative; 43 | &:after { 44 | content: ""; 45 | display: block; 46 | position: absolute; 47 | right: -30px; 48 | top: 50%; 49 | transform: translateY(-50%); 50 | width: 16px; 51 | height: 12px; 52 | background-image: url(${IconSwap}); 53 | } 54 | } 55 | `; 56 | 57 | const tabs = [ 58 | { name: "Start Exchange", value: 1, render: }, 59 | { name: "Confirmation", value: 2, render: }, 60 | { name: "Exchange detalls", value: 3, render: } 61 | ]; 62 | 63 | class Exchange extends React.Component { 64 | render() { 65 | return ( 66 | 67 | 68 | <span className="swap">Exchange your funds</span> 69 | {this.props.activeTabId === 2 && ( 70 | <Button onClick={() => this.props.mountActiveTab(0)}> 71 | New Order 72 | </Button> 73 | )} 74 | 75 | 76 |
77 | {tabs[this.props.activeTabId].render} 78 |
79 |
80 | ); 81 | } 82 | } 83 | 84 | const mapStateToProps = state => ({ 85 | wallets: state.exchange.wallets, 86 | activeTabId: state.exchange.activeTabId 87 | }); 88 | 89 | const mapDispatchToProps = dispatch => ({ 90 | fetchWallets: () => dispatch(actions.fetchWallets()), 91 | mountActiveTab: tabId => dispatch(actions.mountActiveTab(tabId)) 92 | }); 93 | 94 | export default withStyles(styles)( 95 | connect( 96 | mapStateToProps, 97 | mapDispatchToProps 98 | )(Exchange) 99 | ); 100 | -------------------------------------------------------------------------------- /app/Exchange/Reducer.js: -------------------------------------------------------------------------------- 1 | import { handleActions } from "redux-actions"; 2 | import { types } from "./ActionTypes"; 3 | 4 | const initialState = { 5 | amount: null, 6 | depositWallet: null, 7 | reciveAddr: null, 8 | balanceDeposit: null, 9 | wallets: [], 10 | marketInfo: {}, 11 | activeTabId: 0, 12 | exchangeDetails: {}, 13 | trx: {}, 14 | shapeShiftError: "", 15 | statusDeposit: "" 16 | }; 17 | 18 | export const exchange = handleActions( 19 | { 20 | [types.MOUNT_WALLETS]: (state, action) => ({ 21 | ...state, 22 | wallets: action.payload 23 | }), 24 | [types.MOUNT_WALLET_BALANCE]: (state, action) => ({ 25 | ...state, 26 | balanceDeposit: action.payload 27 | }), 28 | [types.MOUNT_MARKET_INFO]: (state, action) => ({ 29 | ...state, 30 | marketInfo: action.payload 31 | }), 32 | [types.MOUNT_ACTIVE_TAB]: (state, action) => ({ 33 | ...state, 34 | activeTabId: action.payload.tabId 35 | }), 36 | [types.MOUNT_EXCHANE_DETAILS]: (state, action) => ({ 37 | ...state, 38 | exchangeDetails: action.payload.details, 39 | statusDeposit: "" 40 | }), 41 | [types.MOUNT_EXCHANGE_CHECK]: (state, action) => ({ 42 | ...state, 43 | trx: action.payload, 44 | shapeShiftError: "" 45 | }), 46 | [types.MOUNT_STATUS_DEPOSIT]: (state, action) => ({ 47 | ...state, 48 | statusDeposit: action.payload 49 | }), 50 | [types.MOUNT_EXCHANGE_CHECK_ERROR]: (state, action) => ({ 51 | ...state, 52 | shapeShiftError: action.payload, 53 | trx: {} 54 | }) 55 | }, 56 | 57 | initialState 58 | ); 59 | -------------------------------------------------------------------------------- /app/Exchange/Saga.js: -------------------------------------------------------------------------------- 1 | import { put, call, takeLatest } from "redux-saga/effects"; 2 | import { delay } from "redux-saga"; 3 | import { has } from "ramda"; 4 | import { types } from "./ActionTypes"; 5 | import XHRProvider from "../Providers/XHRProvider"; 6 | import { getWalletList } from "../Providers/Gaia"; 7 | import { transactionByType } from "../Providers/Wallets"; 8 | 9 | const xhr = new XHRProvider(); 10 | 11 | function* fetchWallets(action) { 12 | try { 13 | const walletList = yield call(getWalletList); 14 | yield put({ 15 | type: types.MOUNT_WALLETS, 16 | payload: walletList.kpList 17 | }); 18 | } catch (error) { 19 | console.log(error); 20 | } 21 | } 22 | 23 | function* fecthWalletBalance(action) { 24 | const wallet = yield call( 25 | xhr.getWalletInfo, 26 | action.payload.type, 27 | action.payload.address 28 | ); 29 | yield put({ type: types.MOUNT_WALLET_BALANCE, payload: wallet }); 30 | } 31 | 32 | function* fetchMarketInfo(action) { 33 | const marketInfo = yield call(xhr.getMarketInfo, action.payload.pair); 34 | yield put({ type: types.MOUNT_MARKET_INFO, payload: marketInfo }); 35 | } 36 | 37 | function* fetchCheckExchange(action) { 38 | try { 39 | const exchange = yield call(xhr.checkExchange, action.payload.params); 40 | has("success", exchange) 41 | ? yield put({ 42 | type: types.MOUNT_EXCHANGE_CHECK, 43 | payload: exchange.success 44 | }) 45 | : yield put({ 46 | type: types.MOUNT_EXCHANGE_CHECK_ERROR, 47 | payload: exchange.error 48 | }); 49 | } catch (error) { 50 | console.log(error); 51 | } 52 | } 53 | 54 | function* makeTransaction(action) { 55 | const { wallet, receivers } = action.payload; 56 | const { data } = yield call(xhr.getUtxo, wallet.type, wallet.address); 57 | const hash = transactionByType.get(wallet.type)( 58 | wallet.privateKey, 59 | data, 60 | receivers, 61 | wallet.type 62 | ); 63 | const e = yield call(xhr.broadcastTX, wallet.type, hash); 64 | yield e; 65 | } 66 | 67 | function* fetchStatusDeposit(action) { 68 | yield put({ 69 | type: types.MOUNT_STATUS_DEPOSIT, 70 | payload: "Pending" 71 | }); 72 | try { 73 | while (true) { 74 | const data = yield call(xhr.checkStatusDeposit, action.payload.address); 75 | yield call(delay, 10000); 76 | if (data.status === "complete") { 77 | yield put({ 78 | type: types.MOUNT_STATUS_DEPOSIT, 79 | payload: "Finished" 80 | }); 81 | break; 82 | } 83 | } 84 | } catch (error) { 85 | yield put({ 86 | type: types.MOUNT_STATUS_DEPOSIT, 87 | payload: "Failed" 88 | }); 89 | } 90 | } 91 | 92 | export function* exchangeSaga() { 93 | yield takeLatest(types.FETCH_WALLET_BALANCE, fecthWalletBalance); 94 | yield takeLatest(types.FETCH_WALLETS, fetchWallets); 95 | yield takeLatest(types.FETCH_MARKET_INFO, fetchMarketInfo); 96 | yield takeLatest(types.FETCH_CHECK_EXCHANGE, fetchCheckExchange); 97 | yield takeLatest(types.MAKE_TRANSACTION, makeTransaction); 98 | yield takeLatest(types.FETTCH_STATUS_DEPOSIT, fetchStatusDeposit); 99 | } 100 | -------------------------------------------------------------------------------- /app/Exchange/StatusExchange.js: -------------------------------------------------------------------------------- 1 | import React from "react"; 2 | import { connect } from "react-redux"; 3 | import CircularProgress from "@material-ui/core/CircularProgress"; 4 | import styled, { css } from "styled-components"; 5 | 6 | import * as actions from "./Actions"; 7 | 8 | const Dots = styled.span``; 9 | 10 | const waitingSucces = () => { 11 |
12 |
Awaiting exchange
13 | 14 |
; 15 | }; 16 | 17 | const Awaiting = styled.div` 18 | height: 310px; 19 | position: relative; 20 | padding: 20px; 21 | p { 22 | font-size: 12px; 23 | letter-spacing: 0.225px; 24 | color: #f1f1f1; 25 | } 26 | .result { 27 | p { 28 | &:first-child { 29 | font-size: 12px; 30 | line-height: 19px; 31 | letter-spacing: 0.225px; 32 | color: #f1f1f1; 33 | span { 34 | color: #8d96b2; 35 | } 36 | } 37 | &:last-child { 38 | font-size: 18px; 39 | letter-spacing: 0.3375px; 40 | color: #7ac231; 41 | margin: 0; 42 | } 43 | } 44 | } 45 | .loading:after { 46 | left: 0; 47 | } 48 | .awaiting-info { 49 | position: absolute; 50 | bottom: 20px; 51 | width: 100%; 52 | div { 53 | display: flex; 54 | align-items: center; 55 | &:not(:last-child) { 56 | margin-bottom: 10px; 57 | } 58 | p { 59 | font-size: 10px; 60 | letter-spacing: 0.1875px; 61 | color: #f1f1f1; 62 | &:first-child { 63 | width: 12%; 64 | } 65 | &:last-child { 66 | width: 80%; 67 | } 68 | } 69 | .order-value { 70 | font-size: 10px; 71 | letter-spacing: 0.1875px; 72 | color: #7ac231; 73 | } 74 | .order-status { 75 | color: #8d96b2; 76 | } 77 | } 78 | } 79 | `; 80 | 81 | class StatusExchange extends React.Component { 82 | render() { 83 | return ( 84 | 85 | {this.props.statusDeposit === "Pending" && ( 86 |
87 |

Awaiting Exchange

88 | 89 |
90 | )} 91 | {this.props.statusDeposit === "Finished" && ( 92 |
93 |

94 | Congratulations! You just exchange 95 |
96 | 97 | {this.props.exchangeDetails.amount}{" "} 98 | {this.props.exchangeDetails.walletFrom.type.toUpperCase()} 99 | {" "} 100 | to 101 |

102 |

103 | {(this.props.exchangeDetails.amount - 104 | this.props.marketInfo.minimum) * 105 | this.props.marketInfo.rate} 106 | {this.props.exchangeDetails.walletTo.type.toUpperCase()} 107 |

108 |
109 | )} 110 |
111 |
112 |

Order ID

113 | 118 | {this.props.trx.orderId} 119 | 120 |
121 |
122 |

Status

123 |

{this.props.statusDeposit}

124 |
125 |
126 |
127 | ); 128 | } 129 | } 130 | 131 | const mapStateToProps = state => ({ 132 | marketInfo: state.exchange.marketInfo, 133 | exchangeDetails: state.exchange.exchangeDetails, 134 | trx: state.exchange.trx, 135 | statusDeposit: state.exchange.statusDeposit 136 | }); 137 | 138 | const mapDispatchToProps = dispatch => ({ 139 | mountActiveTab: tabId => dispatch(actions.mountActiveTab(tabId)), 140 | makeTransaction: (wallet, receivers) => 141 | dispatch(actions.makeTransaction(wallet, receivers)) 142 | }); 143 | 144 | export default connect( 145 | mapStateToProps, 146 | mapDispatchToProps 147 | )(StatusExchange); 148 | -------------------------------------------------------------------------------- /app/Fiat/ActionTypes.js: -------------------------------------------------------------------------------- 1 | export const types = { 2 | FETCH_COURSE: "@@fiat/FETCH_COURSE", 3 | MOUNT_COURSE: "@@fiat/MOUNT_COURSE", 4 | MOUNT_FIAT: "@@fiat/MOUNT_FIAT", 5 | FETCH_COURSE_COMISSION: "@@fiat/FETCH_COURSE_COMISSION", 6 | MOUNT_COURSE_COMISSION: "@@fiat/MOUNT_COURSE_COMISSION" 7 | }; 8 | -------------------------------------------------------------------------------- /app/Fiat/Actions.js: -------------------------------------------------------------------------------- 1 | import { createAction } from "redux-actions"; 2 | import { types } from "./ActionTypes"; 3 | 4 | export const fetchCourse = createAction(types.FETCH_COURSE, fiat => ({ fiat })); 5 | 6 | export const mountFiat = createAction(types.MOUNT_FIAT, fiat => ({ fiat })); 7 | 8 | export const fetchCourseComission = createAction( 9 | types.FETCH_COURSE_COMISSION, 10 | () => ({}) 11 | ); 12 | -------------------------------------------------------------------------------- /app/Fiat/Fiat.js: -------------------------------------------------------------------------------- 1 | import React from "react"; 2 | import { connect } from "react-redux"; 3 | import Select from "../CommonComponents/Select"; 4 | import * as actions from "./Actions"; 5 | 6 | const fiat = [ 7 | { name: "United States Dollar", abbr: "USD" }, 8 | { name: "Euro", abbr: "EUR" }, 9 | { name: "Russian ruble", abbr: "RUB" }, 10 | { name: "Australian Dollar", abbr: "AUD" }, 11 | { name: "Brazilian Real", abbr: "BRL" }, 12 | { name: "Canadian dollar", abbr: "CAD" }, 13 | { name: "Swiss Franc", abbr: "CHF" }, 14 | { name: "Chinese Yuan", abbr: "CNY" }, 15 | { name: "British Pound", abbr: "GBP" }, 16 | { name: "Hong Kong dollar", abbr: "HKD" }, 17 | { name: "Indonesian Rupiah", abbr: "IDR" }, 18 | { name: "Indian Rupee", abbr: "INR" }, 19 | { name: "Japanese Yen", abbr: "JPY" }, 20 | { name: "Korean Won", abbr: "KRW" }, 21 | { name: "Mexican Peso", abbr: "MXN" } 22 | ]; 23 | 24 | class Fiat extends React.Component { 25 | componentDidMount() { 26 | this.props.fetchCourse(this.props.selectedFiat.abbr); 27 | this.props.fetchCourseComission(); 28 | } 29 | 30 | handleMenuItemClick = fiat => { 31 | this.props.mountFiat(fiat); 32 | this.props.fetchCourse(fiat.abbr); 33 | }; 34 | 35 | render() { 36 | return ( 37 | 26 | ); 27 | 28 | export const WalletTypeSelect = ({ wType, handleChange }) => ( 29 | 90 | 91 | Read to Write 92 | 93 | {this.state.warning ? {this.state.warning} : null} 94 | 95 | 96 | } 97 | 98 | 99 | ); 100 | } 101 | } 102 | export default connect( 103 | mapStateToProps, 104 | mapDispatchToProps 105 | )(MakeActive); 106 | -------------------------------------------------------------------------------- /app/Wallets/WalletList/PrivateKey.js: -------------------------------------------------------------------------------- 1 | import React from "react"; 2 | import { connect } from "react-redux"; 3 | import { head } from "ramda"; 4 | import { Popup, PopupLayout, CloseUpButton, PopupButton } from "../../Views"; 5 | 6 | const mapStateToProps = state => ({ 7 | wallets: state.wallets.walletList.walletList 8 | }); 9 | 10 | class PrivateKey extends React.Component { 11 | constructor(props) { 12 | super(props); 13 | this.gaiaWallet = head( 14 | props.wallets.filter(wallet => wallet.wid === props.options.wid) 15 | ); 16 | } 17 | 18 | render() { 19 | return ( 20 | 21 | 22 | 23 |

The wallet private key

24 |

{this.gaiaWallet.privateKey}

25 | OK 26 |
27 |
28 | ); 29 | } 30 | } 31 | 32 | export default connect(mapStateToProps)(PrivateKey); 33 | -------------------------------------------------------------------------------- /app/Wallets/WalletList/Receive.js: -------------------------------------------------------------------------------- 1 | import React from "react"; 2 | 3 | export const Receive = () =>
Receive
; 4 | -------------------------------------------------------------------------------- /app/Wallets/WalletList/Reducer.js: -------------------------------------------------------------------------------- 1 | import { handleActions } from "redux-actions"; 2 | import { types } from "./ActionTypes"; 3 | 4 | const initialState = { 5 | walletList: [], 6 | selectedWallet: null, 7 | selectedWalletInfo: {} 8 | }; 9 | 10 | export const walletList = handleActions( 11 | { 12 | [types.MOUNT_WALLETS]: (state, action) => ({ 13 | ...state, 14 | walletList: action.payload 15 | }), 16 | [types.SELECT_WALLET]: (state, action) => ({ 17 | ...state, 18 | selectedWallet: action.payload 19 | }), 20 | [types.MOUNT_WALLET_INFO]: (state, action) => ({ 21 | ...state, 22 | selectedWalletInfo: action.payload 23 | }) 24 | }, 25 | initialState 26 | ); 27 | -------------------------------------------------------------------------------- /app/Wallets/WalletList/RenderFunctions.js: -------------------------------------------------------------------------------- 1 | export const SEND = 1; 2 | -------------------------------------------------------------------------------- /app/Wallets/WalletList/Saga.js: -------------------------------------------------------------------------------- 1 | import { put, call, takeLatest } from "redux-saga/effects"; 2 | import { delay } from "redux-saga"; 3 | import { getWalletList, logEvent, setWalletList } from "../../Providers/Gaia"; 4 | import { types } from "./ActionTypes"; 5 | import * as dashboard from "../../InitialPage/ActionTypes"; 6 | import XHRProvider from "../../Providers/XHRProvider"; 7 | 8 | const xhr = new XHRProvider(); 9 | 10 | function* checkoutWallets() { 11 | const walletList = yield call(getWalletList); 12 | if (walletList.kpList && walletList.kpList.length) { 13 | yield put({ type: types.MOUNT_WALLETS, payload: walletList.kpList }); 14 | } else { 15 | const newWallet = yield setWalletList(); 16 | yield put({ type: types.MOUNT_WALLETS, payload: newWallet }); 17 | } 18 | } 19 | 20 | function* createWallet(action) { 21 | const { walletList, wallet } = action.payload; 22 | const newWalletList = yield setWalletList([...walletList, wallet]); 23 | yield call(logEvent, { 24 | date: new Date(), 25 | type: "walletCreate", 26 | text: `${wallet.type} was created` 27 | }); 28 | yield put({ type: dashboard.types.MOUNT_WALLETS, payload: newWalletList }); 29 | yield put({ type: types.MOUNT_WALLETS, payload: newWalletList }); 30 | yield delay(3000); 31 | yield put({ type: dashboard.types.CHECKOUT_HISTORY, payload: undefined }); 32 | } 33 | 34 | function* updateWalletByWID(action) { 35 | const { wallet } = action.payload; 36 | const { kpList } = yield call(getWalletList); 37 | const newWalletList = yield setWalletList([ 38 | ...kpList.filter(w => w.wid !== wallet.wid), 39 | wallet 40 | ]); 41 | yield put({ type: types.MOUNT_WALLETS, payload: newWalletList }); 42 | } 43 | 44 | function* updateWalletList(action) { 45 | const { walletList } = action.payload; 46 | const newWalletList = yield setWalletList(walletList); 47 | yield put({ type: types.MOUNT_WALLETS, payload: newWalletList }); 48 | } 49 | 50 | function* deleteWallet(action) { 51 | const { walletList, toBeDeleted } = action.payload; 52 | const wallet = walletList.find(wallet => wallet.wid === toBeDeleted); 53 | 54 | const newWalletList = yield setWalletList( 55 | walletList.filter(wallet => wallet.wid !== toBeDeleted) 56 | ); 57 | yield call(logEvent, { 58 | date: new Date(), 59 | type: "walletCreate", 60 | text: `${wallet.type} wallet was deleted` 61 | }); 62 | yield put({ type: dashboard.types.CHECKOUT_HISTORY, payload: undefined }); 63 | yield put({ type: types.MOUNT_WALLETS, payload: newWalletList }); 64 | yield delay(3000); 65 | yield put({ type: dashboard.types.CHECKOUT_HISTORY, payload: undefined }); 66 | } 67 | 68 | function* fetchWalletInfo(action) { 69 | let walletInfo; 70 | try { 71 | walletInfo = yield call(xhr.get, action.payload); 72 | } catch (e) { 73 | yield delay(5000); 74 | yield put(action); 75 | } 76 | yield put({ type: types.MOUNT_WALLET_INFO, payload: walletInfo.data }); 77 | } 78 | 79 | export function* walletListSaga() { 80 | yield takeLatest(types.CHECKOUT_WALLETS, checkoutWallets); 81 | yield takeLatest(types.CREATE_WALLET, createWallet); 82 | yield takeLatest(types.DELETE_WALLET, deleteWallet); 83 | yield takeLatest(types.FETCH_WALLET_INFO, fetchWalletInfo); 84 | yield takeLatest(types.UPDATE_WALLET_LIST, updateWalletList); 85 | yield takeLatest(types.UPDATE_WALLET_BY_WID, updateWalletByWID); 86 | } 87 | -------------------------------------------------------------------------------- /app/devIndex.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | Dappy 9 | 10 | 11 | 12 | 18 | 19 | 20 | 21 |
22 | 23 | 24 | 25 | 26 | -------------------------------------------------------------------------------- /app/images/common/icon-add.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 6D79490F-36F7-4DA4-8C64-857D0CE3548E 5 | Created with sketchtool. 6 | 7 | 8 | 9 | 10 | 11 | 12 | -------------------------------------------------------------------------------- /app/images/common/icon-arrow-down-grey.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | -------------------------------------------------------------------------------- /app/images/common/icon-arrow-down.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 545EBAA7-0ACF-45D8-9696-89BB9EFD07C1 5 | Created with sketchtool. 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | -------------------------------------------------------------------------------- /app/images/common/icon-arrow-green.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | -------------------------------------------------------------------------------- /app/images/common/icon-checkbox.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | E69A28E9-0B59-4E8A-8B8B-5264F42F2409 5 | Created with sketchtool. 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | -------------------------------------------------------------------------------- /app/images/common/icon-cross-grey.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | -------------------------------------------------------------------------------- /app/images/common/icon-cross-white.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | -------------------------------------------------------------------------------- /app/images/common/icon-direction.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 4F43218C-2B09-4603-9942-75A3A59038C3 5 | Created with sketchtool. 6 | 7 | 8 | 9 | 10 | 11 | 12 | -------------------------------------------------------------------------------- /app/images/common/icon-exchange-loading.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | -------------------------------------------------------------------------------- /app/images/common/icon-filter.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 86B1B81B-CC72-4846-A57E-028C3A61015C 5 | Created with sketchtool. 6 | 7 | 8 | 9 | 10 | 11 | 12 | -------------------------------------------------------------------------------- /app/images/common/icon-link-forward-hover.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | -------------------------------------------------------------------------------- /app/images/common/icon-link-forward.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | -------------------------------------------------------------------------------- /app/images/common/icon-log-out.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | -------------------------------------------------------------------------------- /app/images/common/icon-manual-address.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | -------------------------------------------------------------------------------- /app/images/common/icon-profile.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | -------------------------------------------------------------------------------- /app/images/common/icon-scale.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | -------------------------------------------------------------------------------- /app/images/common/icon-search.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 3DD5EE58-01AA-4DDE-899C-0679E9A13187 5 | Created with sketchtool. 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | -------------------------------------------------------------------------------- /app/images/common/icon-support.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | -------------------------------------------------------------------------------- /app/images/common/icon-swap.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 02D0D12B-B589-4FBC-B2BA-F6DCD20F4F91 5 | Created with sketchtool. 6 | 7 | 8 | 9 | 10 | 11 | 12 | -------------------------------------------------------------------------------- /app/images/common/icon-xl-arrow.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | -------------------------------------------------------------------------------- /app/images/common/icon-xl-swap.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | -------------------------------------------------------------------------------- /app/images/common/vision-off.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | -------------------------------------------------------------------------------- /app/images/fiat/AUD@1x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/BCNetio/BlockStackWallet/59a4ac2ec3fe06d690643f0e5a1ddc5e6179e045/app/images/fiat/AUD@1x.png -------------------------------------------------------------------------------- /app/images/fiat/AUD@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/BCNetio/BlockStackWallet/59a4ac2ec3fe06d690643f0e5a1ddc5e6179e045/app/images/fiat/AUD@2x.png -------------------------------------------------------------------------------- /app/images/fiat/BRL@1x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/BCNetio/BlockStackWallet/59a4ac2ec3fe06d690643f0e5a1ddc5e6179e045/app/images/fiat/BRL@1x.png -------------------------------------------------------------------------------- /app/images/fiat/BRL@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/BCNetio/BlockStackWallet/59a4ac2ec3fe06d690643f0e5a1ddc5e6179e045/app/images/fiat/BRL@2x.png -------------------------------------------------------------------------------- /app/images/fiat/CAD@1x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/BCNetio/BlockStackWallet/59a4ac2ec3fe06d690643f0e5a1ddc5e6179e045/app/images/fiat/CAD@1x.png -------------------------------------------------------------------------------- /app/images/fiat/CAD@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/BCNetio/BlockStackWallet/59a4ac2ec3fe06d690643f0e5a1ddc5e6179e045/app/images/fiat/CAD@2x.png -------------------------------------------------------------------------------- /app/images/fiat/CHF@1x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/BCNetio/BlockStackWallet/59a4ac2ec3fe06d690643f0e5a1ddc5e6179e045/app/images/fiat/CHF@1x.png -------------------------------------------------------------------------------- /app/images/fiat/CHF@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/BCNetio/BlockStackWallet/59a4ac2ec3fe06d690643f0e5a1ddc5e6179e045/app/images/fiat/CHF@2x.png -------------------------------------------------------------------------------- /app/images/fiat/CNY@1x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/BCNetio/BlockStackWallet/59a4ac2ec3fe06d690643f0e5a1ddc5e6179e045/app/images/fiat/CNY@1x.png -------------------------------------------------------------------------------- /app/images/fiat/CNY@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/BCNetio/BlockStackWallet/59a4ac2ec3fe06d690643f0e5a1ddc5e6179e045/app/images/fiat/CNY@2x.png -------------------------------------------------------------------------------- /app/images/fiat/EUR@1x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/BCNetio/BlockStackWallet/59a4ac2ec3fe06d690643f0e5a1ddc5e6179e045/app/images/fiat/EUR@1x.png -------------------------------------------------------------------------------- /app/images/fiat/EUR@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/BCNetio/BlockStackWallet/59a4ac2ec3fe06d690643f0e5a1ddc5e6179e045/app/images/fiat/EUR@2x.png -------------------------------------------------------------------------------- /app/images/fiat/GBP@1x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/BCNetio/BlockStackWallet/59a4ac2ec3fe06d690643f0e5a1ddc5e6179e045/app/images/fiat/GBP@1x.png -------------------------------------------------------------------------------- /app/images/fiat/GBP@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/BCNetio/BlockStackWallet/59a4ac2ec3fe06d690643f0e5a1ddc5e6179e045/app/images/fiat/GBP@2x.png -------------------------------------------------------------------------------- /app/images/fiat/HKD@1x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/BCNetio/BlockStackWallet/59a4ac2ec3fe06d690643f0e5a1ddc5e6179e045/app/images/fiat/HKD@1x.png -------------------------------------------------------------------------------- /app/images/fiat/HKD@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/BCNetio/BlockStackWallet/59a4ac2ec3fe06d690643f0e5a1ddc5e6179e045/app/images/fiat/HKD@2x.png -------------------------------------------------------------------------------- /app/images/fiat/IDR@1x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/BCNetio/BlockStackWallet/59a4ac2ec3fe06d690643f0e5a1ddc5e6179e045/app/images/fiat/IDR@1x.png -------------------------------------------------------------------------------- /app/images/fiat/IDR@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/BCNetio/BlockStackWallet/59a4ac2ec3fe06d690643f0e5a1ddc5e6179e045/app/images/fiat/IDR@2x.png -------------------------------------------------------------------------------- /app/images/fiat/INR@1x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/BCNetio/BlockStackWallet/59a4ac2ec3fe06d690643f0e5a1ddc5e6179e045/app/images/fiat/INR@1x.png -------------------------------------------------------------------------------- /app/images/fiat/INR@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/BCNetio/BlockStackWallet/59a4ac2ec3fe06d690643f0e5a1ddc5e6179e045/app/images/fiat/INR@2x.png -------------------------------------------------------------------------------- /app/images/fiat/JPY@1x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/BCNetio/BlockStackWallet/59a4ac2ec3fe06d690643f0e5a1ddc5e6179e045/app/images/fiat/JPY@1x.png -------------------------------------------------------------------------------- /app/images/fiat/JPY@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/BCNetio/BlockStackWallet/59a4ac2ec3fe06d690643f0e5a1ddc5e6179e045/app/images/fiat/JPY@2x.png -------------------------------------------------------------------------------- /app/images/fiat/KRW@1x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/BCNetio/BlockStackWallet/59a4ac2ec3fe06d690643f0e5a1ddc5e6179e045/app/images/fiat/KRW@1x.png -------------------------------------------------------------------------------- /app/images/fiat/KRW@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/BCNetio/BlockStackWallet/59a4ac2ec3fe06d690643f0e5a1ddc5e6179e045/app/images/fiat/KRW@2x.png -------------------------------------------------------------------------------- /app/images/fiat/MXN@1x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/BCNetio/BlockStackWallet/59a4ac2ec3fe06d690643f0e5a1ddc5e6179e045/app/images/fiat/MXN@1x.png -------------------------------------------------------------------------------- /app/images/fiat/MXN@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/BCNetio/BlockStackWallet/59a4ac2ec3fe06d690643f0e5a1ddc5e6179e045/app/images/fiat/MXN@2x.png -------------------------------------------------------------------------------- /app/images/fiat/RUB@1x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/BCNetio/BlockStackWallet/59a4ac2ec3fe06d690643f0e5a1ddc5e6179e045/app/images/fiat/RUB@1x.png -------------------------------------------------------------------------------- /app/images/fiat/RUB@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/BCNetio/BlockStackWallet/59a4ac2ec3fe06d690643f0e5a1ddc5e6179e045/app/images/fiat/RUB@2x.png -------------------------------------------------------------------------------- /app/images/fiat/USD@1x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/BCNetio/BlockStackWallet/59a4ac2ec3fe06d690643f0e5a1ddc5e6179e045/app/images/fiat/USD@1x.png -------------------------------------------------------------------------------- /app/images/fiat/USD@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/BCNetio/BlockStackWallet/59a4ac2ec3fe06d690643f0e5a1ddc5e6179e045/app/images/fiat/USD@2x.png -------------------------------------------------------------------------------- /app/images/fiat/index.js: -------------------------------------------------------------------------------- 1 | import USD1x from "./USD@1x.png"; 2 | import USD2x from "./USD@2x.png"; 3 | import EUR1x from "./EUR@1x.png"; 4 | import EUR2x from "./EUR@2x.png"; 5 | import RUB1x from "./RUB@1x.png"; 6 | import RUB2x from "./RUB@2x.png"; 7 | import AUD1x from "./AUD@1x.png"; 8 | import AUD2x from "./AUD@2x.png"; 9 | import BRL1x from "./BRL@1x.png"; 10 | import BRL2x from "./BRL@2x.png"; 11 | import CAD1x from "./CAD@1x.png"; 12 | import CAD2x from "./CAD@2x.png"; 13 | import CHF1x from "./CHF@1x.png"; 14 | import CHF2x from "./CHF@2x.png"; 15 | import CNY1x from "./CNY@1x.png"; 16 | import CNY2x from "./CNY@2x.png"; 17 | import GBP1x from "./GBP@1x.png"; 18 | import GBP2x from "./GBP@2x.png"; 19 | import HKD1x from "./HKD@1x.png"; 20 | import HKD2x from "./HKD@2x.png"; 21 | import IDR1x from "./IDR@1x.png"; 22 | import IDR2x from "./IDR@2x.png"; 23 | import INR1x from "./INR@1x.png"; 24 | import INR2x from "./INR@2x.png"; 25 | import JPY1x from "./JPY@1x.png"; 26 | import JPY2x from "./JPY@2x.png"; 27 | import KRW1x from "./KRW@1x.png"; 28 | import KRW2x from "./KRW@2x.png"; 29 | import MXN1x from "./MXN@1x.png"; 30 | import MXN2x from "./MXN@2x.png"; 31 | 32 | export const fiats = { 33 | USD: { x1: USD1x, x2: USD2x }, 34 | EUR: { x1: EUR1x, x2: EUR2x }, 35 | RUB: { x1: RUB1x, x2: RUB2x }, 36 | AUD: { x1: AUD1x, x2: AUD2x }, 37 | BRL: { x1: BRL1x, x2: BRL2x }, 38 | CAD: { x1: CAD1x, x2: CAD2x }, 39 | CHF: { x1: CHF1x, x2: CHF2x }, 40 | CNY: { x1: CNY1x, x2: CNY2x }, 41 | GBP: { x1: GBP1x, x2: GBP2x }, 42 | HKD: { x1: HKD1x, x2: HKD2x }, 43 | IDR: { x1: IDR1x, x2: IDR2x }, 44 | INR: { x1: INR1x, x2: INR2x }, 45 | JPY: { x1: JPY1x, x2: JPY2x }, 46 | KRW: { x1: KRW1x, x2: KRW2x }, 47 | MXN: { x1: MXN1x, x2: MXN2x } 48 | }; 49 | -------------------------------------------------------------------------------- /app/images/ic-bch.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | -------------------------------------------------------------------------------- /app/images/ic-btc.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | -------------------------------------------------------------------------------- /app/images/ic-btg.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | -------------------------------------------------------------------------------- /app/images/ic-dash.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | -------------------------------------------------------------------------------- /app/images/ic-dcr.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | -------------------------------------------------------------------------------- /app/images/ic-doge.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | -------------------------------------------------------------------------------- /app/images/ic-etc.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | -------------------------------------------------------------------------------- /app/images/ic-eth.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | -------------------------------------------------------------------------------- /app/images/ic-ltc.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | -------------------------------------------------------------------------------- /app/images/ic-zec.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | -------------------------------------------------------------------------------- /app/images/index.js: -------------------------------------------------------------------------------- 1 | import { curNames } from "../AppConfig"; 2 | import icBtc from "./ic-btc.svg"; 3 | import icBch from "./ic-bch.svg"; 4 | import icEth from "./ic-eth.svg"; 5 | import icEtc from "./ic-etc.svg"; 6 | import icDoge from "./ic-doge.svg"; 7 | import icLtc from "./ic-ltc.svg"; 8 | import icZec from "./ic-zec.svg"; 9 | import icDcr from "./ic-dcr.svg"; 10 | import icDash from "./ic-dash.svg"; 11 | import icBtg from "./ic-btg.svg"; 12 | 13 | export const logos = { 14 | [curNames.BTC]: icBtc, 15 | [curNames.BCH]: icBch, 16 | [curNames.ETH]: icEth, 17 | [curNames.ETC]: icEtc, 18 | [curNames.DOGE]: icDoge, 19 | [curNames.LTC]: icLtc, 20 | [curNames.ZEC]: icZec, 21 | [curNames.DCR]: icDcr, 22 | [curNames.DASH]: icDash, 23 | [curNames.BTG]: icBtg 24 | }; 25 | -------------------------------------------------------------------------------- /app/images/nav/icon-dashboard-hover.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | -------------------------------------------------------------------------------- /app/images/nav/icon-dashboard.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | -------------------------------------------------------------------------------- /app/images/nav/icon-exchange-hover.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | -------------------------------------------------------------------------------- /app/images/nav/icon-exchange.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | -------------------------------------------------------------------------------- /app/images/nav/icon-wallet-hover.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | -------------------------------------------------------------------------------- /app/images/nav/icon-wallet.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | -------------------------------------------------------------------------------- /app/index.css: -------------------------------------------------------------------------------- 1 | @import url("https://fonts.googleapis.com/css?family=Roboto:300,400,500,700"); 2 | 3 | /* body color */ 4 | * { 5 | box-sizing: border-box; 6 | } 7 | 8 | body { 9 | background-color: #1f2431; 10 | margin: 0; 11 | } 12 | 13 | p, 14 | span, 15 | div, 16 | label, 17 | input, 18 | button, 19 | a, 20 | li, 21 | h1, 22 | h2, 23 | h3, 24 | h4, 25 | h5, 26 | h6 { 27 | font-family: "Roboto"; 28 | } 29 | 30 | p, 31 | input { 32 | margin: 0; 33 | } 34 | 35 | button { 36 | cursor: pointer; 37 | outline: none; 38 | &[disabled] { 39 | cursor: no-drop; 40 | } 41 | } 42 | 43 | ul { 44 | margin: 0; 45 | padding: 0; 46 | list-style: none; 47 | } 48 | 49 | /* styles for scrollbar */ 50 | .scroll-wrapper::-webkit-scrollbar { 51 | width: 10px; 52 | } 53 | 54 | .scroll-wrapper::-webkit-scrollbar-track { 55 | background-color: #e2e4e8; 56 | } 57 | 58 | .scroll-wrapper.dark::-webkit-scrollbar-track { 59 | background-color: #273041; 60 | width: 10px; 61 | } 62 | 63 | .scroll-wrapper::-webkit-scrollbar-thumb { 64 | background-color: #8d96b2; 65 | border: 3px solid transparent; 66 | border-radius: 9px; 67 | background-clip: content-box; 68 | } 69 | 70 | .bg-swap { 71 | background-image: url(images/common/icon-xl-swap.svg); 72 | background-position: center right; 73 | background-repeat: no-repeat; 74 | background-size: 65%; 75 | margin: -20px; 76 | } 77 | 78 | .bg-arrow { 79 | background-image: url(images/common/icon-xl-arrow.svg); 80 | background-position: 100%; 81 | background-repeat: no-repeat; 82 | background-size: 43%; 83 | height: 240px; 84 | padding: 20px; 85 | position: relative; 86 | } 87 | 88 | /* checkbox */ 89 | .checkbox { 90 | display: none; 91 | } 92 | 93 | .checkbox-custom { 94 | position: relative; 95 | height: 16px; 96 | width: 16px; 97 | border-radius: 4px; 98 | background-color: #1f2431; 99 | margin-right: 10px; 100 | } 101 | 102 | .checkbox-custom.header { 103 | border: 1px solid #2b3649; 104 | } 105 | 106 | .checkbox-custom, 107 | .label { 108 | display: inline-block; 109 | vertical-align: middle; 110 | cursor: pointer; 111 | } 112 | 113 | .checkbox:checked + .checkbox-custom::before { 114 | content: ""; 115 | display: block; 116 | position: absolute; 117 | top: 0px; 118 | right: 0px; 119 | bottom: 0px; 120 | left: 0px; 121 | background: url(images/common/icon-checkbox.svg) no-repeat; 122 | border-radius: 4px; 123 | } 124 | 125 | .loading { 126 | position: relative; 127 | display: block; 128 | height: 1px; 129 | width: 100%; 130 | &:after { 131 | content: " ."; 132 | display: block; 133 | animation: dots 1s steps(5, end) infinite; 134 | font-size: 30px; 135 | line-height: 0px; 136 | position: absolute; 137 | top: -8px; 138 | left: -11px; 139 | } 140 | } 141 | 142 | @keyframes dots { 143 | 0%, 144 | 20% { 145 | color: rgba(0, 0, 0, 0); 146 | text-shadow: 0.25em 0 0 rgba(0, 0, 0, 0), 0.5em 0 0 rgba(0, 0, 0, 0); 147 | } 148 | 40% { 149 | color: white; 150 | text-shadow: 0.25em 0 0 rgba(0, 0, 0, 0), 0.5em 0 0 rgba(0, 0, 0, 0); 151 | } 152 | 60% { 153 | text-shadow: 0.25em 0 0 white, 0.5em 0 0 rgba(0, 0, 0, 0); 154 | } 155 | 80%, 156 | 100% { 157 | text-shadow: 0.25em 0 0 #7ac231, 0.5em 0 0 #7ac231; 158 | } 159 | } 160 | 161 | /* switch chexbox */ 162 | .switch { 163 | position: relative; 164 | display: inline-block; 165 | width: 30px; 166 | height: 16px; 167 | } 168 | 169 | .switch input { 170 | display: none; 171 | } 172 | 173 | .slider { 174 | position: absolute; 175 | cursor: pointer; 176 | top: 0; 177 | left: 0; 178 | right: 0; 179 | bottom: 0; 180 | -webkit-transition: 0.4s; 181 | transition: 0.4s; 182 | border: 1px solid #2b3649; 183 | } 184 | 185 | .slider:before { 186 | position: absolute; 187 | content: ""; 188 | height: 10px; 189 | width: 10px; 190 | left: 4px; 191 | bottom: 2px; 192 | background-color: white; 193 | -webkit-transition: 0.4s; 194 | transition: 0.4s; 195 | } 196 | 197 | input:focus + .slider { 198 | box-shadow: 0 0 1px #2196f3; 199 | } 200 | 201 | input:checked + .slider:before { 202 | -webkit-transform: translateX(26px); 203 | -ms-transform: translateX(26px); 204 | transform: translateX(11px); 205 | } 206 | 207 | input:checked + .slider { 208 | background-color: #7ac231; 209 | } 210 | 211 | .slider.round { 212 | border-radius: 34px; 213 | } 214 | 215 | .slider.round:before { 216 | border-radius: 50%; 217 | } 218 | 219 | .long-menu { 220 | div:last-child { 221 | box-shadow: none; 222 | ul { 223 | padding: 4px 0; 224 | } 225 | li { 226 | padding: 5px 50px 5px 12px; 227 | font-size: 10px; 228 | line-height: 10px; 229 | letter-spacing: 0.230769px; 230 | color: #2b3649; 231 | height: auto; 232 | } 233 | } 234 | } 235 | -------------------------------------------------------------------------------- /app/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | Dappy 9 | 10 | 16 | 17 | 18 | 19 |
20 | 21 | 22 | 23 | 24 | -------------------------------------------------------------------------------- /app/index.js: -------------------------------------------------------------------------------- 1 | import React from "react"; 2 | import { Provider } from "react-redux"; 3 | import { BrowserRouter } from "react-router-dom"; 4 | import ReactDOM from "react-dom"; 5 | import Router from "./Routing/Router"; 6 | import { store } from "./InitialSetup/Store"; 7 | 8 | ReactDOM.render( 9 | 10 | 11 | 12 | 13 | , 14 | document.getElementById("root") 15 | ); 16 | -------------------------------------------------------------------------------- /bundleLibs/lib_2.json: -------------------------------------------------------------------------------- 1 | {"name":"lib_2","content":{"./node_modules/react-dom/index.js":{"id":"./node_modules/react-dom/index.js","buildMeta":{"providedExports":true}},"./node_modules/react/cjs/react.development.js":{"id":"./node_modules/react/cjs/react.development.js","buildMeta":{"providedExports":true}},"./node_modules/object-assign/index.js":{"id":"./node_modules/object-assign/index.js","buildMeta":{"providedExports":true}},"./node_modules/prop-types/checkPropTypes.js":{"id":"./node_modules/prop-types/checkPropTypes.js","buildMeta":{"providedExports":true}},"./node_modules/prop-types/lib/ReactPropTypesSecret.js":{"id":"./node_modules/prop-types/lib/ReactPropTypesSecret.js","buildMeta":{"providedExports":true}},"./node_modules/react/index.js":{"id":"./node_modules/react/index.js","buildMeta":{"providedExports":true}},"./node_modules/react-dom/cjs/react-dom.development.js":{"id":"./node_modules/react-dom/cjs/react-dom.development.js","buildMeta":{"providedExports":true}},"./node_modules/scheduler/index.js":{"id":"./node_modules/scheduler/index.js","buildMeta":{"providedExports":true}},"./node_modules/scheduler/cjs/scheduler.development.js":{"id":"./node_modules/scheduler/cjs/scheduler.development.js","buildMeta":{"providedExports":true}},"./node_modules/webpack/buildin/global.js":{"id":"./node_modules/webpack/buildin/global.js","buildMeta":{"providedExports":true}},"./node_modules/scheduler/tracing.js":{"id":"./node_modules/scheduler/tracing.js","buildMeta":{"providedExports":true}},"./node_modules/scheduler/cjs/scheduler-tracing.development.js":{"id":"./node_modules/scheduler/cjs/scheduler-tracing.development.js","buildMeta":{"providedExports":true}}}} -------------------------------------------------------------------------------- /lib.webpack.config.js: -------------------------------------------------------------------------------- 1 | const path = require('path'); 2 | const webpack = require('webpack'); 3 | require('dotenv').config(); 4 | const publicFolder = path.resolve(__dirname, 'public'); 5 | module.exports = { 6 | mode: process.env.NODE_ENV, 7 | context: process.cwd(), 8 | resolve: { 9 | extensions: ['.js', '.jsx', '.json', '.less', '.css'], 10 | modules: [__dirname, 'node_modules'] 11 | }, 12 | 13 | entry: { 14 | lib_1: ["redux", "ramda", "redux-saga", "react-redux", "lodash"], 15 | lib_2: ["react", "react-dom"], 16 | }, 17 | output: { 18 | filename: '[name].dll.js', 19 | path: publicFolder, 20 | library: '[name]' 21 | }, 22 | plugins: [ 23 | new webpack.DllPlugin({ 24 | name: '[name]', 25 | path: `bundleLibs/[name].json` 26 | }) 27 | ] 28 | }; 29 | -------------------------------------------------------------------------------- /package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "bcnet.io", 3 | "version": "1.0.0", 4 | "description": "", 5 | "main": "index.js", 6 | "scripts": { 7 | "prettier": "prettier --write './app/**/{*.js,*.css, *json}'", 8 | "production": "NODE_ENV=production node node_modules/webpack/bin/webpack.js -p", 9 | "prestart": "node node_modules/webpack/bin/webpack.js --config lib.webpack.config.js", 10 | "start": "node node_modules/webpack-dev-server/bin/webpack-dev-server.js" 11 | }, 12 | "author": "", 13 | "license": "MIT", 14 | "dependencies": { 15 | "@material-ui/core": "^1.0.0", 16 | "@material-ui/icons": "^1.0.0", 17 | "axios": "^0.18.0", 18 | "babel-cli": "^6.26.0", 19 | "bigi": "^1.4.2", 20 | "bip39": "^2.5.0", 21 | "bitcoinjs-lib": "^4.0.1", 22 | "bitcore-lib-cash": "^0.19.0", 23 | "blockstack": "^18.2.0", 24 | "chart.js": "^2.7.2", 25 | "classnames": "^2.2.5", 26 | "dotenv": "^4.0.0", 27 | "ethereumjs-tx": "^1.3.4", 28 | "ethereumjs-util": "^5.2.0", 29 | "ethereumjs-wallet": "^0.6.0", 30 | "file-loader": "^1.1.11", 31 | "human-standard-token-abi": "^1.0.2", 32 | "immutable": "^4.0.0-rc.12", 33 | "normalize-css": "^2.3.1", 34 | "postcss-nested": "^3.0.0", 35 | "prettier": "1.15.3", 36 | "prop-types": "^15.6.1", 37 | "ramda": "^0.25.0", 38 | "react": "^16.4.0", 39 | "react-chartjs-2": "^2.7.2", 40 | "react-copy-to-clipboard": "^5.0.1", 41 | "react-dom": "^16.2.0", 42 | "react-icons": "^2.2.7", 43 | "react-prefixer": "^2.0.0", 44 | "react-redux": "^5.0.2", 45 | "react-router": "^4.2.0", 46 | "react-router-dom": "^4.2.2", 47 | "redux": "^4.0.0", 48 | "redux-action": "^1.2.2", 49 | "redux-actions": "^2.3.0", 50 | "redux-devtools-extension": "^2.13.2", 51 | "redux-saga": "^0.16.0", 52 | "reselect": "^4.0.0", 53 | "styled-components": "^3.2.6", 54 | "stylelint-config-standard": "^18.2.0", 55 | "stylelint-webpack-plugin": "^0.10.3", 56 | "uglifyjs-webpack-plugin": "^1.3.0", 57 | "uuid": "^3.2.1", 58 | "web3": "^1.0.0-beta.34", 59 | "whatwg-fetch": "^2.0.3" 60 | }, 61 | "devDependencies": { 62 | "autoprefixer": "^7.2.6", 63 | "babel-core": "^6.21.0", 64 | "babel-eslint": "^7.2.3", 65 | "babel-jest": "^18.0.0", 66 | "babel-loader": "^7.1.4", 67 | "babel-plugin-transform-react-jsx": "^6.24.1", 68 | "babel-plugin-transform-react-remove-prop-types": "^0.4.13", 69 | "babel-plugin-transform-runtime": "^6.15.0", 70 | "babel-polyfill": "^6.26.0", 71 | "babel-preset-env": "^1.6.1", 72 | "babel-preset-react": "^6.24.1", 73 | "babel-preset-stage-2": "^6.24.1", 74 | "clean-webpack-plugin": "^0.1.15", 75 | "compression-webpack-plugin": "^1.1.11", 76 | "css-hot-loader": "^1.1.1", 77 | "css-loader": "^0.28.11", 78 | "eslint": "^3.19.0", 79 | "eslint-config-airbnb": "^14.0.0", 80 | "eslint-config-prettier": "^3.3.0", 81 | "eslint-plugin-import": "^2.2.0", 82 | "eslint-plugin-jsx-a11y": "^3.0.2", 83 | "eslint-plugin-prettier": "^3.0.0", 84 | "eslint-plugin-react": "^6.9.0", 85 | "extract-text-webpack-plugin": "^4.0.0-beta.0", 86 | "fbjs-scripts": "^0.6.0-alpha.3", 87 | "html-webpack-plugin": "^3.1.0", 88 | "jest": "^18.1.0", 89 | "normalize.css": "^8.0.0", 90 | "postcss": "^6.0.21", 91 | "postcss-css-variables": "^0.8.1", 92 | "postcss-cssnext": "^3.1.0", 93 | "postcss-extend": "^1.0.5", 94 | "postcss-import": "^11.1.0", 95 | "postcss-loader": "^2.1.3", 96 | "postcss-mixins": "^6.2.0", 97 | "postcss-partial-import": "^4.1.0", 98 | "postcss-utilities": "^0.8.0", 99 | "precss": "^3.1.2", 100 | "prettier-eslint": "^8.2.2", 101 | "react-hot-loader": "^4.0.0", 102 | "style-loader": "^0.20.3", 103 | "stylelint": "^9.2.0", 104 | "sugarss": "^1.0.1", 105 | "webpack": "^4.28.2", 106 | "webpack-cli": "^3.1.1", 107 | "webpack-dev-server": "^3.1.1", 108 | "webpack-manifest-plugin": "^2.0.2" 109 | } 110 | } 111 | -------------------------------------------------------------------------------- /postcss.config.js: -------------------------------------------------------------------------------- 1 | module.exports = { 2 | plugins: { 3 | 'postcss-import': {}, 4 | 'postcss-nested': {}, 5 | 'postcss-partial-import': {}, 6 | 'postcss-mixins': {}, 7 | 'postcss-css-variables': {}, 8 | 'postcss-preset-env': {}, 9 | 'postcss-extend': {}, 10 | 'precss':{}, 11 | 'postcss-cssnext': {}, 12 | 'postcss-utilities': {}, 13 | } 14 | 15 | } 16 | --------------------------------------------------------------------------------