diff --git a/.eslintrc b/.eslintrc index b8139df6..a13d37b4 100644 --- a/.eslintrc +++ b/.eslintrc @@ -3,10 +3,9 @@ "eslint-config-airbnb", "prettier", "prettier/babel", - "plugin:flowtype/recommended", "prettier/flowtype", "prettier/react", - "plugin:jest/recommended", + "plugin:flowtype/recommended", "plugin:jest/recommended" ], "globals": { diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 88677518..eebcbfb3 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -179,4 +179,4 @@ integration tests: when: always expire_in: 1 week paths: - - trezor-wallet/ \ No newline at end of file + - trezor-wallet/ diff --git a/.stylelintrc b/.stylelintrc index b8426f0f..91320583 100644 --- a/.stylelintrc +++ b/.stylelintrc @@ -17,13 +17,6 @@ "ignoreProperties": ["composes", "font-smoothing", "font-smooth"] } ], - "at-rule-empty-line-before": [ - "always", { - "ignoreAtRules": [ - "import" - ] - } - ], "at-rule-no-unknown": [ true, { ignoreAtRules: ["each"] }] diff --git a/CHANGELOG.md b/CHANGELOG.md index 478f54f0..ddedfbcc 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,8 @@ +## 1.1.0-beta +__added__ +- Ripple destination tag option +- Tezos external wallet + ## 1.1.0-beta __added__ - Ripple support diff --git a/package.json b/package.json index c3fedc5c..917e09c9 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "trezor-wallet", - "version": "1.1.0-beta", + "version": "1.1.1-beta", "author": "TREZOR ", "description": "", "bin": { @@ -21,7 +21,7 @@ "lint": "run-s lint:*", "lint:js": "npx eslint ./src ./webpack", "lint:css": "npx stylelint './src/**/*.js'", - "lint:prettier": "npx pretty-quick", + "lint:prettier": "npx pretty-quick --bail", "lint-fix": "npx eslint ./src ./webpack --fix", "prettier:check": "npx eslint --print-config ./src | eslint-config-prettier-check", "test": "run-s test:*", diff --git a/public/data/appConfig.json b/public/data/appConfig.json index 6125250a..09d07ce9 100644 --- a/public/data/appConfig.json +++ b/public/data/appConfig.json @@ -1,6 +1,7 @@ { "networks": [ { + "order": 2, "type": "ethereum", "name": "Ethereum", "symbol": "ETH", @@ -21,6 +22,7 @@ } }, { + "order": 18, "type": "ethereum", "name": "Ethereum Classic", "symbol": "ETC", @@ -40,7 +42,8 @@ "address": "https://gastracker.io/addr/" } }, - { + { + "order": 2, "type": "ethereum", "name": "Ethereum Ropsten", "testnet": true, @@ -74,6 +77,7 @@ } }, { + "order": 3, "type": "ripple", "name": "Ripple", "symbol": "XRP", @@ -94,6 +98,7 @@ } }, { + "order": 3, "type": "ripple", "name": "Ripple Testnet", "testnet": true, diff --git a/src/components/modals/external/Tezos/images/xtz.png b/src/components/modals/external/Tezos/images/xtz.png new file mode 100644 index 00000000..447e53ef Binary files /dev/null and b/src/components/modals/external/Tezos/images/xtz.png differ diff --git a/src/components/modals/external/Tezos/index.js b/src/components/modals/external/Tezos/index.js new file mode 100644 index 00000000..428b5e1a --- /dev/null +++ b/src/components/modals/external/Tezos/index.js @@ -0,0 +1,70 @@ +/* @flow */ + +import React from 'react'; +import PropTypes from 'prop-types'; +import styled from 'styled-components'; +import colors from 'config/colors'; +import icons from 'config/icons'; +import Icon from 'components/Icon'; +import Link from 'components/Link'; +import Button from 'components/Button'; +import { H2 } from 'components/Heading'; +import P from 'components/Paragraph'; +import coins from 'constants/coins'; + +import TezosImage from './images/xtz.png'; +import type { Props as BaseProps } from '../../Container'; + +type Props = { + onCancel: $ElementType<$ElementType, 'onCancel'>; +} + +const Wrapper = styled.div` + width: 100%; + max-width: 620px; + padding: 30px 48px; +`; + +const StyledButton = styled(Button)` + margin-top: 10px; + width: 100%; +`; + +const StyledLink = styled(Link)` + position: absolute; + right: 15px; + top: 10px; +`; + +const Img = styled.img` + display: block; + max-width: 100px; + margin: 0 auto; + height: auto; + padding-bottom: 20px; +`; + +const TezosWallet = (props: Props) => ( + + + + + +

Tezos wallet

+

You will be redirected to external wallet

+ + i.id === 'xtz').url}> + Go to external wallet + +
+); + +TezosWallet.propTypes = { + onCancel: PropTypes.func.isRequired, +}; + +export default TezosWallet; \ No newline at end of file diff --git a/src/components/modals/index.js b/src/components/modals/index.js index 2f5d43b0..3d7a9642 100644 --- a/src/components/modals/index.js +++ b/src/components/modals/index.js @@ -29,6 +29,7 @@ import WalletType from 'components/modals/device/WalletType'; import Nem from 'components/modals/external/Nem'; import Cardano from 'components/modals/external/Cardano'; import Stellar from 'components/modals/external/Stellar'; +import Tezos from 'components/modals/external/Tezos'; import QrModal from 'components/modals/QrModal'; @@ -168,7 +169,9 @@ const getExternalContextModal = (props: Props) => { case 'xlm': return ; case 'ada': - return ; + return (); + case 'xtz': + return (); default: return null; } diff --git a/src/components/notifications/Context/components/Static/index.js b/src/components/notifications/Context/components/Static/index.js index 5cb6c9ce..fa148ea1 100644 --- a/src/components/notifications/Context/components/Static/index.js +++ b/src/components/notifications/Context/components/Static/index.js @@ -49,26 +49,6 @@ export default (props: Props) => { } /> ); - } else if (location.state.send) { - notifications.push( - - Destination tag is an arbitrary number which serves as a unique - identifier of your transaction. Some services may require this to - process your transaction. The current firmware version{' '} - does not support destination tags yet. -
-
- If the receiver requires a destination tag, do not use Trezor to send - XRP. We are working on adding this feature. - - } - /> - ); } } diff --git a/src/constants/coins.js b/src/constants/coins.js index fb9ef8a9..b584b7ab 100644 --- a/src/constants/coins.js +++ b/src/constants/coins.js @@ -3,68 +3,87 @@ export default [ id: 'btc', coinName: 'Bitcoin', url: '../?coin=btc', + order: 1, }, { id: 'bch', coinName: 'Bitcoin Cash', url: '../?coin=bch', + order: 6, }, { id: 'btg', coinName: 'Bitcoin Gold', url: '../?coin=btg', + order: 27, }, { id: 'dash', coinName: 'Dash', url: '../?coin=dash', + order: 15, }, { id: 'dgb', coinName: 'DigiByte', url: '../?coin=dgb', + order: 42, }, { id: 'doge', coinName: 'Dogecoin', url: '../?coin=doge', + order: 26, }, { id: 'ltc', coinName: 'Litecoin', url: '../?coin=ltc', + order: 5, }, { id: 'nmc', coinName: 'Namecoin', url: '../?coin=nmc', + order: 255, }, { id: 'vtc', coinName: 'Vertcoin', url: '../?coin=vtc', + order: 154, }, { id: 'zec', coinName: 'Zcash', url: '../?coin=zec', + order: 20, }, { id: 'xem', coinName: 'NEM', url: 'https://nem.io/downloads/', external: true, + order: 19, }, { id: 'xlm', coinName: 'Stellar', url: 'https://trezor.io/stellar', external: true, + order: 9, }, { id: 'ada', coinName: 'Cardano', url: 'https://adalite.io/app', external: true, + order: 12, + }, + { + id: 'xtz', + coinName: 'Tezos', + url: 'https://wallet.simplestaking.com/tezos/wallet/start', + external: true, }, ]; diff --git a/src/images/coins/xtz.png b/src/images/coins/xtz.png new file mode 100644 index 00000000..567ec415 Binary files /dev/null and b/src/images/coins/xtz.png differ diff --git a/src/reducers/LocalStorageReducer.js b/src/reducers/LocalStorageReducer.js index 3e3918dd..4c1c81bf 100644 --- a/src/reducers/LocalStorageReducer.js +++ b/src/reducers/LocalStorageReducer.js @@ -13,6 +13,7 @@ type NetworkFeeLevel = { }; export type Network = { + order: number, type: string, name: string, testnet?: boolean, diff --git a/src/views/Wallet/components/LeftNavigation/components/CoinMenu/index.js b/src/views/Wallet/components/LeftNavigation/components/CoinMenu/index.js index 4a7d60e8..30be38bb 100644 --- a/src/views/Wallet/components/LeftNavigation/components/CoinMenu/index.js +++ b/src/views/Wallet/components/LeftNavigation/components/CoinMenu/index.js @@ -37,59 +37,62 @@ class CoinMenu extends PureComponent { } getOtherCoins() { - return coins.map(coin => { - const row = ( - - ); + return coins + .sort((a, b) => a.order - b.order) + .map(coin => { + const row = ( + + ); - if (coin.external) + if (coin.external) + return ( + this.props.gotoExternalWallet(coin.id, coin.url)} + > + {row} + + ); return ( - this.props.gotoExternalWallet(coin.id, coin.url)} - > + {row} - + ); - return ( - - {row} - - ); - }); + }); } render() { const { config } = this.props.localStorage; return ( - {config.networks.map(item => ( - - - - ))} + {config.networks + .sort((a, b) => a.order - b.order) + .map(item => ( + + + + ))} } - textRight={} hasBorder /> {this.getOtherCoins()} diff --git a/src/views/Wallet/components/LeftNavigation/components/CoinMenu/index.messages.js b/src/views/Wallet/components/LeftNavigation/components/CoinMenu/index.messages.js index fea97195..78b43096 100644 --- a/src/views/Wallet/components/LeftNavigation/components/CoinMenu/index.messages.js +++ b/src/views/Wallet/components/LeftNavigation/components/CoinMenu/index.messages.js @@ -7,10 +7,6 @@ const definedMessages: Messages = defineMessages({ id: 'TR_OTHER_COINS', defaultMessage: 'Other coins', }, - TR_YOU_WILL_BE_REDIRECTED: { - id: 'TR_YOU_WILL_BE_REDIRECTED', - defaultMessage: '(You will be redirected)', - }, }); export default definedMessages; diff --git a/src/views/Wallet/components/LeftNavigation/components/Divider/index.js b/src/views/Wallet/components/LeftNavigation/components/Divider/index.js index 20d8ad0f..a22d7d60 100644 --- a/src/views/Wallet/components/LeftNavigation/components/Divider/index.js +++ b/src/views/Wallet/components/LeftNavigation/components/Divider/index.js @@ -27,7 +27,7 @@ const TextLeft = styled.p` const Divider = ({ textLeft, textRight, hasBorder = false, className, testId }) => ( {textLeft} -

{textRight}

+ {textRight &&

{textRight}

}
); diff --git a/src/views/Wallet/views/Account/Send/ripple/components/AdvancedForm/index.js b/src/views/Wallet/views/Account/Send/ripple/components/AdvancedForm/index.js index 9051ef3c..eac4ed01 100644 --- a/src/views/Wallet/views/Account/Send/ripple/components/AdvancedForm/index.js +++ b/src/views/Wallet/views/Account/Send/ripple/components/AdvancedForm/index.js @@ -82,16 +82,16 @@ const getFeeInputState = (feeErrors: string, feeWarnings: string): string => { return state; }; -// const getDestinationTagInputState = (errors: string, warnings: string): string => { -// let state = ''; -// if (warnings && !errors) { -// state = 'warning'; -// } -// if (errors) { -// state = 'error'; -// } -// return state; -// }; +const getDestinationTagInputState = (errors: string, warnings: string): string => { + let state = ''; + if (warnings && !errors) { + state = 'warning'; + } + if (errors) { + state = 'error'; + } + return state; +}; const Left = styled.div` display: flex; @@ -107,11 +107,11 @@ const AdvancedForm = (props: Props) => { warnings, infos, fee, - // destinationTag, + destinationTag, } = props.sendForm; const { onFeeChange, - // onDestinationTagChange, + onDestinationTagChange, } = props.sendFormActions; return ( @@ -150,7 +150,7 @@ const AdvancedForm = (props: Props) => { /> - {/* + { value={destinationTag} onChange={event => onDestinationTagChange(event.target.value)} /> - */} + {props.children}