diff --git a/react/src/assets/images/cryptologo/bch.png b/react/src/assets/images/cryptologo/bch.png new file mode 100644 index 0000000..c9de9aa Binary files /dev/null and b/react/src/assets/images/cryptologo/bch.png differ diff --git a/react/src/assets/images/cryptologo/btg.png b/react/src/assets/images/cryptologo/btg.png new file mode 100644 index 0000000..6a5bec4 Binary files /dev/null and b/react/src/assets/images/cryptologo/btg.png differ diff --git a/react/src/components/addcoin/addcoinOptionsCrypto.js b/react/src/components/addcoin/addcoinOptionsCrypto.js index b2c36a2..6d04615 100644 --- a/react/src/components/addcoin/addcoinOptionsCrypto.js +++ b/react/src/components/addcoin/addcoinOptionsCrypto.js @@ -4,7 +4,7 @@ import mainWindow from '../../util/mainWindow'; const addCoinOptionsCrypto = () => { const availableKMDModes = mainWindow.arch === 'x64' ? 'spv|native' : 'spv'; - return [{ + let _coins = [{ label: 'Komodo (KMD)', icon: 'KMD', value: `KMD|${availableKMDModes}`, @@ -14,6 +14,76 @@ const addCoinOptionsCrypto = () => { icon: 'CHIPS', value: `CHIPS|spv`, }]; + + if (mainWindow.argv.indexOf('spvcoins=all') > -1) { + _coins.push(/*{ + label: 'BitcoinGold (BTG)', + icon: 'BTG', + value: `BTG|spv`, + }, { + label: 'BitcoinCash (BCH)', + icon: 'BCH', + value: `BCH|spv`, + }, { + label: 'Bitcoin (BTC)', + icon: 'BTC', + value: `BTC|spv`, + }, */{ + label: 'Crown (CRW)', + icon: 'CRW', + value: `CRW|spv`, + }, { + label: 'Dash (DASH)', + icon: 'DASH', + value: `DASH|spv`, + }, { + label: 'DigiByte (DGB)', + icon: 'DGB', + value: `DGB|spv`, + }, { + label: 'Faircoin (FAIR)', + icon: 'FAIR', + value: `FAIR|spv`, + }, { + label: 'Argentum (ARG)', + icon: 'ARG', + value: `ARG|spv`, + }, { + label: 'Litecoin (LTC)', + icon: 'LTC', + value: `LTC|spv`, + }, { + label: 'Monacoin (MONA)', + icon: 'MONA', + value: `MONA|spv`, + }, { + label: 'Namecoin (NMC)', + icon: 'NMC', + value: `NMC|spv`, + }, { + label: 'Vertcoin (VTC)', + icon: 'VTC', + value: `VTC|spv`, + }, { + label: 'Viacoin (VIA)', + icon: 'VIA', + value: `VIA|spv`, + }, { + label: 'Sibcoin (SIB)', + icon: 'SIB', + value: `SIB|spv`, + },/* { + label: 'Blackcoin (BLK)', + icon: 'BLK', + value: `BLK|spv`, + }, */{ + label: 'Dogecoin (DOGE)', + icon: 'DOGE', + value: `DOGE|spv`, + }); + } + + return _coins; } export default addCoinOptionsCrypto; diff --git a/react/src/components/dashboard/sendCoin/sendCoin.js b/react/src/components/dashboard/sendCoin/sendCoin.js index 0306473..9faa84a 100644 --- a/react/src/components/dashboard/sendCoin/sendCoin.js +++ b/react/src/components/dashboard/sendCoin/sendCoin.js @@ -20,6 +20,7 @@ import { _SendFormRender } from './sendCoin.render'; import { isPositiveNumber } from '../../../util/number'; +import mainWindow from '../../../util/mainWindow'; // TODO: - add links to explorers // - render z address trim @@ -111,6 +112,10 @@ class SendCoin extends React.Component { } componentWillReceiveProps(props) { + if (this.props.ActiveCoin.coin !== props.ActiveCoin.coin && + this.props.ActiveCoin.lastSendToResponse) { + Store.dispatch(clearLastSendToResponseState()); + } this.checkZAddressCount(props); } @@ -488,11 +493,21 @@ class SendCoin extends React.Component { const _amount = this.state.amount; const _amountSats = this.state.amount * 100000000; const _balanceSats = this.props.ActiveCoin.balance.balanceSats; + const _fees = mainWindow.spvFees; - if (Number(_amountSats) + 10000 > _balanceSats) { + if (Number(_amountSats) + _fees[this.props.ActiveCoin.coin] > _balanceSats) { + Store.dispatch( + triggerToaster( + `${translate('SEND.INSUFFICIENT_FUNDS')} max available balance is ${(0.00000001 * (_balanceSats - _fees[this.props.ActiveCoin.coin])).toFixed(8)} ${this.props.ActiveCoin.coin}`, + translate('TOASTR.WALLET_NOTIFICATION'), + 'error' + ) + ); + valid = false; + } else if (Number(_amountSats) < _fees[this.props.ActiveCoin.coin]) { Store.dispatch( triggerToaster( - `${translate('SEND.INSUFFICIENT_FUNDS')} max available balance is ${(0.00000001 * (_balanceSats - 10000)).toFixed(8)} ${this.props.ActiveCoin.coin}`, + `Amount ${this.state.amount} is too small, min ${this.props.ActiveCoin.coin} amount is ${_fees[this.props.ActiveCoin.coin] * 0.00000001}`, translate('TOASTR.WALLET_NOTIFICATION'), 'error' ) diff --git a/react/src/components/dashboard/sendCoin/sendCoin.render.js b/react/src/components/dashboard/sendCoin/sendCoin.render.js index e818afc..f739102 100644 --- a/react/src/components/dashboard/sendCoin/sendCoin.render.js +++ b/react/src/components/dashboard/sendCoin/sendCoin.render.js @@ -1,6 +1,7 @@ import React from 'react'; import { translate } from '../../../translate/translate'; import QRModal from '../qrModal/qrModal'; +import { isKomodoCoin } from '../../../util/coinHelper'; export const AddressListRender = function() { return ( @@ -293,6 +294,7 @@ export const SendRender = function() { this.state.lastSendToResponse && this.state.lastSendToResponse.txid) || (this.props.ActiveCoin.mode === 'native' && this.state.lastSendToResponse && this.state.lastSendToResponse.length === 64)) && + isKomodoCoin(this.props.ActiveCoin.coin) &&