From c9809481aeca4345f9ed557f65bd8c1be7dcc0cc Mon Sep 17 00:00:00 2001 From: Tom Kirkpatrick Date: Wed, 12 Dec 2018 23:14:35 +0100 Subject: [PATCH 1/7] fix(wallet): ensure wallet info saves correctly --- app/reducers/info.js | 9 ++++----- app/reducers/lnd.js | 4 ++-- app/reducers/wallet.js | 16 ++++++++-------- app/store/db.js | 3 ++- 4 files changed, 16 insertions(+), 16 deletions(-) diff --git a/app/reducers/info.js b/app/reducers/info.js index 3a914e4ab11..c236591eee5 100644 --- a/app/reducers/info.js +++ b/app/reducers/info.js @@ -36,23 +36,22 @@ export const fetchInfo = () => async dispatch => { // Receive IPC event for info export const receiveInfo = (event, data) => async (dispatch, getState) => { - // Determine the node's current sync state. + // Save the node info. + dispatch({ type: RECEIVE_INFO, data }) + const state = getState() + if (typeof state.info.hasSynced === 'undefined') { const node = await db.nodes.get({ id: data.identity_pubkey }) const hasSynced = node ? node.hasSynced : false dispatch(setHasSynced(hasSynced)) } - // Save the node info. - dispatch({ type: RECEIVE_INFO, data }) - // Now that we have the node info, get the current wallet address. dispatch(walletAddress('np2wkh')) // Update the active wallet settings with info discovered from getinfo. const wallet = walletSelectors.activeWalletSettings(state) - const chain = get(data, 'chains[0]') const network = data.testnet ? networks.testnet.id : networks.mainnet.id if (wallet.chain !== chain || wallet.network !== network) { diff --git a/app/reducers/lnd.js b/app/reducers/lnd.js index 9539df3fd17..d54643d76fd 100644 --- a/app/reducers/lnd.js +++ b/app/reducers/lnd.js @@ -92,7 +92,7 @@ export const lightningGrpcActive = (event, lndConfig) => async dispatch => { // Once we we have established a connection, save the wallet settings. if (lndConfig.id !== 'tmp') { const wallet = await dispatch(putWallet(lndConfig)) - dispatch(setActiveWallet(wallet.id)) + await dispatch(setActiveWallet(wallet.id)) } // Fetch info from lnd. @@ -109,7 +109,7 @@ export const walletUnlockerGrpcActive = (event, lndConfig) => async dispatch => // Once we we have established a connection, save the wallet settings. if (lndConfig.id !== 'tmp') { const wallet = await dispatch(putWallet(lndConfig)) - dispatch(setActiveWallet(wallet.id)) + await dispatch(setActiveWallet(wallet.id)) } // Let the onboarding process know that the wallet unlocker has started. diff --git a/app/reducers/wallet.js b/app/reducers/wallet.js index 6ea6e356081..95a6336b960 100644 --- a/app/reducers/wallet.js +++ b/app/reducers/wallet.js @@ -37,25 +37,25 @@ export const getWallets = () => async dispatch => { } export const setActiveWallet = activeWallet => async dispatch => { - await db.settings.put({ - key: 'activeWallet', - value: activeWallet - }) dispatch({ type: SET_ACTIVE_WALLET, activeWallet }) + await db.settings.put({ + key: 'activeWallet', + value: activeWallet + }) } export const setIsWalletOpen = isWalletOpen => async dispatch => { - await db.settings.put({ - key: 'isWalletOpen', - value: isWalletOpen - }) dispatch({ type: SET_IS_WALLET_OPEN, isWalletOpen }) + await db.settings.put({ + key: 'isWalletOpen', + value: isWalletOpen + }) } export const putWallet = wallet => async dispatch => { diff --git a/app/store/db.js b/app/store/db.js index fcfa16973ee..c5fffc18c24 100644 --- a/app/store/db.js +++ b/app/store/db.js @@ -24,9 +24,10 @@ db.version(1).stores({ export const Wallet = db.wallets.defineClass({ id: Number, type: String, - currency: String, network: String, + chain: String, alias: String, + name: String, autopilot: Boolean, cert: String, host: String, From 5f0e8599f6619595f548116ecc912842f10c0264 Mon Sep 17 00:00:00 2001 From: Tom Kirkpatrick Date: Wed, 12 Dec 2018 23:45:31 +0100 Subject: [PATCH 2/7] feat(litecoin): support litecoin currency conversions --- app/components/UI/AmountInput.js | 3 + app/components/UI/CryptoAmountInput.js | 3 + app/containers/Pay.js | 2 +- app/containers/Request.js | 2 +- app/lib/utils/btc.js | 29 ++- app/reducers/ticker.js | 53 +++-- .../__snapshots__/ticker.spec.js.snap | 220 ++++++++++++------ 7 files changed, 207 insertions(+), 105 deletions(-) diff --git a/app/components/UI/AmountInput.js b/app/components/UI/AmountInput.js index ed9f91e018a..6e2b28ac115 100644 --- a/app/components/UI/AmountInput.js +++ b/app/components/UI/AmountInput.js @@ -14,6 +14,7 @@ class AmountInput extends React.Component { const { currency } = this.props switch (currency) { case 'btc': + case 'ltc': this.rules = { precision: 8, placeholder: '0.00000000', @@ -21,6 +22,7 @@ class AmountInput extends React.Component { } break case 'bits': + case 'phots': this.rules = { precision: 2, placeholder: '0.00', @@ -28,6 +30,7 @@ class AmountInput extends React.Component { } break case 'sats': + case 'lits': this.rules = { precision: 0, placeholder: '00000000', diff --git a/app/components/UI/CryptoAmountInput.js b/app/components/UI/CryptoAmountInput.js index 27bf0f975b9..5cfce08eae0 100644 --- a/app/components/UI/CryptoAmountInput.js +++ b/app/components/UI/CryptoAmountInput.js @@ -52,18 +52,21 @@ class CryptoAmountInput extends React.Component { const { currency } = this.props switch (currency) { case 'btc': + case 'ltc': return { precision: 8, placeholder: '0.00000000', pattern: '[0-9]*.?[0-9]{0,8}?' } case 'bits': + case 'phots': return { precision: 2, placeholder: '0.00', pattern: '[0-9]*.?[0-9]{0,2}?' } case 'sats': + case 'lits': return { precision: 0, placeholder: '00000000', diff --git a/app/containers/Pay.js b/app/containers/Pay.js index b75f4de8f09..c3f09c69a92 100644 --- a/app/containers/Pay.js +++ b/app/containers/Pay.js @@ -14,7 +14,7 @@ const mapStateToProps = state => ({ currentTicker: tickerSelectors.currentTicker(state), cryptoCurrency: state.ticker.currency, cryptoCurrencyTicker: tickerSelectors.currencyName(state), - cryptoCurrencies: state.ticker.currencyFilters, + cryptoCurrencies: tickerSelectors.currencyFilters(state), fiatCurrencies: state.ticker.fiatTickers, fiatCurrency: state.ticker.fiatTicker, initialPayReq: state.pay.payReq, diff --git a/app/containers/Request.js b/app/containers/Request.js index a1f9bf47593..5c0d761ede0 100644 --- a/app/containers/Request.js +++ b/app/containers/Request.js @@ -8,7 +8,7 @@ const mapStateToProps = state => ({ currentTicker: tickerSelectors.currentTicker(state), cryptoCurrency: state.ticker.currency, cryptoCurrencyTicker: tickerSelectors.currencyName(state), - cryptoCurrencies: state.ticker.currencyFilters, + cryptoCurrencies: tickerSelectors.currencyFilters(state), fiatCurrencies: state.ticker.fiatTickers, fiatCurrency: state.ticker.fiatTicker, isProcessing: state.invoice.invoiceLoading, diff --git a/app/lib/utils/btc.js b/app/lib/utils/btc.js index 717235f53a0..d6e4bf4e814 100644 --- a/app/lib/utils/btc.js +++ b/app/lib/utils/btc.js @@ -93,64 +93,65 @@ export function fiatToSatoshis(fiat, price) { return btcToFiat(satoshisToBtc(satoshis), price) } -export function renderCurrency(currency) { - switch (currency) { - case 'btc': - return 'BTC' - case 'bits': - return 'bits' - case 'sats': - return 'satoshis' - default: - return 'satoshis' - } -} - export function convert(from, to, amount, price) { switch (from) { case 'btc': + case 'ltc': switch (to) { case 'bits': + case 'phots': return btcToBits(amount) case 'sats': + case 'lits': return btcToSatoshis(amount) case 'fiat': return btcToFiat(amount, price) case 'btc': + case 'ltc': return amount } break case 'bits': + case 'phots': switch (to) { case 'btc': return bitsToBtc(amount) case 'sats': + case 'lits': return bitsToSatoshis(amount) case 'fiat': return bitsToFiat(amount, price) case 'bits': + case 'phots': return amount } break case 'sats': + case 'lits': switch (to) { case 'btc': + case 'ltc': return satoshisToBtc(amount) case 'bits': + case 'phots': return satoshisToBits(amount) case 'fiat': return satoshisToFiat(amount, price) case 'sats': + case 'lits': return amount } break case 'fiat': switch (to) { case 'btc': + case 'ltc': return fiatToBtc(amount, price) case 'bits': + case 'phots': return fiatToBits(amount, price) case 'sats': + case 'lits': return fiatToSatoshis(amount, price) case 'fiat': return amount @@ -173,7 +174,5 @@ export default { satoshisToBits, satoshisToFiat, - renderCurrency, - convert } diff --git a/app/reducers/ticker.js b/app/reducers/ticker.js index 121c0f00120..58fea389628 100644 --- a/app/reducers/ticker.js +++ b/app/reducers/ticker.js @@ -118,13 +118,14 @@ tickerSelectors.currentTicker = createSelector( tickerSelectors.cryptoName = createSelector(cryptoSelector, crypto => cryptoNames[crypto]) tickerSelectors.currencyFilters = createSelector( + cryptoSelector, infoSelectors.networkSelector, currencyFiltersSelector, - (network, currencyFilters = []) => { - if (!network || !network.unitPrefix) { - return currencyFilters + (crypto, network, currencyFilters) => { + if (!crypto || !network) { + return [] } - return currencyFilters.map(item => { + return currencyFilters[crypto].map(item => { item.name = `${network.unitPrefix}${item.name}` return item }) @@ -158,20 +159,36 @@ const initialState = { ltcTicker: null, fiatTicker: getDefaultCurrency(), fiatTickers: currencies, - currencyFilters: [ - { - key: 'btc', - name: 'BTC' - }, - { - key: 'bits', - name: 'bits' - }, - { - key: 'sats', - name: 'satoshis' - } - ] + currencyFilters: { + bitcoin: [ + { + key: 'btc', + name: 'BTC' + }, + { + key: 'bits', + name: 'bits' + }, + { + key: 'sats', + name: 'satoshis' + } + ], + litecoin: [ + { + key: 'ltc', + name: 'LTC' + }, + { + key: 'phots', + name: 'photons' + }, + { + key: 'lits', + name: 'litoshis' + } + ] + } } export default function tickerReducer(state = initialState, action) { diff --git a/test/unit/reducers/__snapshots__/ticker.spec.js.snap b/test/unit/reducers/__snapshots__/ticker.spec.js.snap index 9bc98ecf6b6..90a4015e3e5 100644 --- a/test/unit/reducers/__snapshots__/ticker.spec.js.snap +++ b/test/unit/reducers/__snapshots__/ticker.spec.js.snap @@ -5,20 +5,36 @@ Object { "btcTicker": null, "crypto": null, "currency": null, - "currencyFilters": Array [ - Object { - "key": "btc", - "name": "BTC", - }, - Object { - "key": "bits", - "name": "bits", - }, - Object { - "key": "sats", - "name": "satoshis", - }, - ], + "currencyFilters": Object { + "bitcoin": Array [ + Object { + "key": "btc", + "name": "BTC", + }, + Object { + "key": "bits", + "name": "bits", + }, + Object { + "key": "sats", + "name": "satoshis", + }, + ], + "litecoin": Array [ + Object { + "key": "ltc", + "name": "LTC", + }, + Object { + "key": "phots", + "name": "photons", + }, + Object { + "key": "lits", + "name": "litoshis", + }, + ], + }, "fiatTicker": "USD", "fiatTickers": Array [ "USD", @@ -55,20 +71,36 @@ Object { "btcTicker": undefined, "crypto": null, "currency": null, - "currencyFilters": Array [ - Object { - "key": "btc", - "name": "BTC", - }, - Object { - "key": "bits", - "name": "bits", - }, - Object { - "key": "sats", - "name": "satoshis", - }, - ], + "currencyFilters": Object { + "bitcoin": Array [ + Object { + "key": "btc", + "name": "BTC", + }, + Object { + "key": "bits", + "name": "bits", + }, + Object { + "key": "sats", + "name": "satoshis", + }, + ], + "litecoin": Array [ + Object { + "key": "ltc", + "name": "LTC", + }, + Object { + "key": "phots", + "name": "photons", + }, + Object { + "key": "lits", + "name": "litoshis", + }, + ], + }, "fiatTicker": "USD", "fiatTickers": Array [ "USD", @@ -105,20 +137,36 @@ Object { "btcTicker": null, "crypto": "foo", "currency": null, - "currencyFilters": Array [ - Object { - "key": "btc", - "name": "BTC", - }, - Object { - "key": "bits", - "name": "bits", - }, - Object { - "key": "sats", - "name": "satoshis", - }, - ], + "currencyFilters": Object { + "bitcoin": Array [ + Object { + "key": "btc", + "name": "BTC", + }, + Object { + "key": "bits", + "name": "bits", + }, + Object { + "key": "sats", + "name": "satoshis", + }, + ], + "litecoin": Array [ + Object { + "key": "ltc", + "name": "LTC", + }, + Object { + "key": "phots", + "name": "photons", + }, + Object { + "key": "lits", + "name": "litoshis", + }, + ], + }, "fiatTicker": "USD", "fiatTickers": Array [ "USD", @@ -155,20 +203,36 @@ Object { "btcTicker": null, "crypto": null, "currency": "foo", - "currencyFilters": Array [ - Object { - "key": "btc", - "name": "BTC", - }, - Object { - "key": "bits", - "name": "bits", - }, - Object { - "key": "sats", - "name": "satoshis", - }, - ], + "currencyFilters": Object { + "bitcoin": Array [ + Object { + "key": "btc", + "name": "BTC", + }, + Object { + "key": "bits", + "name": "bits", + }, + Object { + "key": "sats", + "name": "satoshis", + }, + ], + "litecoin": Array [ + Object { + "key": "ltc", + "name": "LTC", + }, + Object { + "key": "phots", + "name": "photons", + }, + Object { + "key": "lits", + "name": "litoshis", + }, + ], + }, "fiatTicker": "USD", "fiatTickers": Array [ "USD", @@ -205,20 +269,36 @@ Object { "btcTicker": null, "crypto": null, "currency": null, - "currencyFilters": Array [ - Object { - "key": "btc", - "name": "BTC", - }, - Object { - "key": "bits", - "name": "bits", - }, - Object { - "key": "sats", - "name": "satoshis", - }, - ], + "currencyFilters": Object { + "bitcoin": Array [ + Object { + "key": "btc", + "name": "BTC", + }, + Object { + "key": "bits", + "name": "bits", + }, + Object { + "key": "sats", + "name": "satoshis", + }, + ], + "litecoin": Array [ + Object { + "key": "ltc", + "name": "LTC", + }, + Object { + "key": "phots", + "name": "photons", + }, + Object { + "key": "lits", + "name": "litoshis", + }, + ], + }, "fiatTicker": "USD", "fiatTickers": Array [ "USD", From d05ff506031a941a9f380b79ec1743849f6df5b3 Mon Sep 17 00:00:00 2001 From: Tom Kirkpatrick Date: Thu, 13 Dec 2018 01:35:03 +0100 Subject: [PATCH 3/7] feat(litecoin): remove bitcoin specific language --- app/components/Icon/SkinnyBitcoin.js | 12 ----------- app/components/Pay/Pay.js | 7 +++++-- app/components/Pay/messages.js | 2 +- app/components/Request/Request.js | 6 +++++- app/components/Request/messages.js | 2 +- app/components/UI/LightningInvoiceInput.js | 9 +++++++-- app/components/UI/messages.js | 2 +- .../Wallet/ReceiveModal/ReceiveModal.js | 20 ++++++++++++++++--- .../Wallet/ReceiveModal/messages.js | 2 +- app/containers/App.js | 2 ++ app/translations/af-ZA.json | 2 +- app/translations/ar-SA.json | 2 +- app/translations/bg-BG.json | 4 ++-- app/translations/ca-ES.json | 2 +- app/translations/cs-CZ.json | 4 ++-- app/translations/da-DK.json | 2 +- app/translations/de-DE.json | 4 ++-- app/translations/el-GR.json | 4 ++-- app/translations/en.json | 8 ++++---- app/translations/es-ES.json | 4 ++-- app/translations/fi-FI.json | 2 +- app/translations/fr-FR.json | 4 ++-- app/translations/ga-IE.json | 4 ++-- app/translations/he-IL.json | 2 +- app/translations/hi-IN.json | 2 +- app/translations/hr-HR.json | 4 ++-- app/translations/hu-HU.json | 2 +- app/translations/it-IT.json | 2 +- app/translations/ja-JP.json | 2 +- app/translations/ko-KR.json | 2 +- app/translations/nl-NL.json | 2 +- app/translations/no-NO.json | 2 +- app/translations/pl-PL.json | 2 +- app/translations/pt-BR.json | 2 +- app/translations/pt-PT.json | 2 +- app/translations/ro-RO.json | 4 ++-- app/translations/ru-RU.json | 2 +- app/translations/sr-SP.json | 2 +- app/translations/sv-SE.json | 4 ++-- app/translations/tr-TR.json | 4 ++-- app/translations/uk-UA.json | 4 ++-- app/translations/vi-VN.json | 2 +- app/translations/zh-CN.json | 2 +- app/translations/zh-TW.json | 2 +- stories/icons/icon.stories.js | 2 -- .../LightningInvoiceInput.spec.js.snap | 2 +- 46 files changed, 90 insertions(+), 76 deletions(-) delete mode 100644 app/components/Icon/SkinnyBitcoin.js diff --git a/app/components/Icon/SkinnyBitcoin.js b/app/components/Icon/SkinnyBitcoin.js deleted file mode 100644 index 191d0cd4e6f..00000000000 --- a/app/components/Icon/SkinnyBitcoin.js +++ /dev/null @@ -1,12 +0,0 @@ -import React from 'react' - -const SvgSkinnyBitcoin = props => ( - - - - - - -) - -export default SvgSkinnyBitcoin diff --git a/app/components/Pay/Pay.js b/app/components/Pay/Pay.js index 69c48c3052e..674925caa12 100644 --- a/app/components/Pay/Pay.js +++ b/app/components/Pay/Pay.js @@ -348,7 +348,7 @@ class Pay extends React.Component { } renderHelpText = () => { - const { initialPayReq } = this.props + const { cryptoName, cryptoCurrencyTicker, initialPayReq } = this.props const { currentStep, previousStep } = this.state // Do not render the help text if the form has just loadad with an initial payment request. @@ -371,7 +371,10 @@ class Pay extends React.Component { - + diff --git a/app/components/Pay/messages.js b/app/components/Pay/messages.js index 6c713f39f1b..cc84254b798 100644 --- a/app/components/Pay/messages.js +++ b/app/components/Pay/messages.js @@ -25,5 +25,5 @@ export default defineMessages({ total: 'Total', memo: 'Memo', description: - 'You can send Bitcoin (BTC) through the Lightning Network or make a On-Chain Transaction. Just paste your Lightning Payment Request or the Bitcoin Address in the field below. Zap will guide you to the process.' + 'You can send {chain} ({ticker}) through the Lightning Network or make a On-Chain Transaction. Just paste your Lightning Payment Request or the {chain} Address in the field below. Zap will guide you to the process.' }) diff --git a/app/components/Request/Request.js b/app/components/Request/Request.js index 36274fa6eb2..59695492f4e 100644 --- a/app/components/Request/Request.js +++ b/app/components/Request/Request.js @@ -173,10 +173,14 @@ class Request extends React.Component { } renderHelpText = () => { + const { cryptoName, cryptoCurrencyTicker } = this.props return ( - + ) diff --git a/app/components/Request/messages.js b/app/components/Request/messages.js index 143b101b936..e1c3496fbee 100644 --- a/app/components/Request/messages.js +++ b/app/components/Request/messages.js @@ -18,5 +18,5 @@ export default defineMessages({ title: 'Request', subtitle: 'through the Lightning Network', description: - 'You can request Bitcoin (BTC) through the Lightning Network. Just enter the Amount you want to request in the field below. Zap will generate a QR-Code and a Lightning invoice after.' + 'You can request {chain} ({ticker}) through the Lightning Network. Just enter the Amount you want to request in the field below. Zap will generate a QR-Code and a Lightning invoice after.' }) diff --git a/app/components/UI/LightningInvoiceInput.js b/app/components/UI/LightningInvoiceInput.js index 4a6731fefe6..8749b75268a 100644 --- a/app/components/UI/LightningInvoiceInput.js +++ b/app/components/UI/LightningInvoiceInput.js @@ -49,11 +49,16 @@ class LightningInvoiceInput extends React.Component { } render() { - const { intl } = this.props + const { chain, intl } = this.props return ( { const { pubkey } = this.props copy(pubkey) @@ -71,7 +84,7 @@ class ReceiveModal extends React.Component { className={qrCodeType === 2 ? styles.active : undefined} onClick={changeQrCode} > - + @@ -107,7 +120,7 @@ class ReceiveModal extends React.Component {

- {' '} + {' '} {network && network.name.toLowerCase() === 'testnet' && network.name}

@@ -133,6 +146,7 @@ ReceiveModal.propTypes = { network: PropTypes.shape({ name: PropTypes.string }).isRequired, + cryptoName: PropTypes.string, isOpen: PropTypes.bool.isRequired, pubkey: PropTypes.string, address: PropTypes.string, diff --git a/app/components/Wallet/ReceiveModal/messages.js b/app/components/Wallet/ReceiveModal/messages.js index 94f570497d8..a477c71a78e 100644 --- a/app/components/Wallet/ReceiveModal/messages.js +++ b/app/components/Wallet/ReceiveModal/messages.js @@ -3,7 +3,7 @@ import { defineMessages } from 'react-intl' export default defineMessages({ node_public_key: 'Node Public Key', node_pubkey: 'Node Pubkey', - bitcoin_address: 'Bitcoin Address', + wallet_address: '{chain} Address', copy_address: 'Copy address', copy_pubkey: 'Copy Pubkey', address_copied_notification_title: 'Address copied', diff --git a/app/containers/App.js b/app/containers/App.js index ea65ad05df8..32585688cd7 100644 --- a/app/containers/App.js +++ b/app/containers/App.js @@ -113,6 +113,7 @@ const mapStateToProps = state => ({ currencyFilters: tickerSelectors.currencyFilters(state), currencyName: tickerSelectors.currencyName(state), syncPercentage: lndSelectors.syncPercentage(state), + cryptoName: tickerSelectors.cryptoName(state), filteredNetworkNodes: contactFormSelectors.filteredNetworkNodes(state), showManualForm: contactFormSelectors.showManualForm(state), @@ -208,6 +209,7 @@ const mergeProps = (stateProps, dispatchProps, ownProps) => { const receiveModalProps = { isOpen: stateProps.address.walletModal, network: stateProps.info.network, + cryptoName: stateProps.cryptoName, pubkey: get(stateProps.info, 'data.uris[0]') || get(stateProps.info, 'data.identity_pubkey'), address: stateProps.address.address, alias: stateProps.info.data.alias, diff --git a/app/translations/af-ZA.json b/app/translations/af-ZA.json index f7c6a5412c5..3e2e77619c2 100644 --- a/app/translations/af-ZA.json +++ b/app/translations/af-ZA.json @@ -251,13 +251,13 @@ "components.UI.valid_request": "", "components.Wallet.ReceiveModal.address_copied_notification_description": "", "components.Wallet.ReceiveModal.address_copied_notification_title": "", - "components.Wallet.ReceiveModal.bitcoin_address": "", "components.Wallet.ReceiveModal.copy_address": "", "components.Wallet.ReceiveModal.copy_pubkey": "", "components.Wallet.ReceiveModal.node_pubkey": "", "components.Wallet.ReceiveModal.node_public_key": "", "components.Wallet.ReceiveModal.pubkey_copied_notification_description": "", "components.Wallet.ReceiveModal.pubkey_copied_notification_title": "", + "components.Wallet.ReceiveModal.wallet_address": "", "components.Wallet.pay": "", "components.Wallet.payment_success": "", "components.Wallet.request": "", diff --git a/app/translations/ar-SA.json b/app/translations/ar-SA.json index ec634b55d62..ab48ef02f0b 100644 --- a/app/translations/ar-SA.json +++ b/app/translations/ar-SA.json @@ -251,13 +251,13 @@ "components.UI.valid_request": "", "components.Wallet.ReceiveModal.address_copied_notification_description": "", "components.Wallet.ReceiveModal.address_copied_notification_title": "", - "components.Wallet.ReceiveModal.bitcoin_address": "", "components.Wallet.ReceiveModal.copy_address": "", "components.Wallet.ReceiveModal.copy_pubkey": "", "components.Wallet.ReceiveModal.node_pubkey": "", "components.Wallet.ReceiveModal.node_public_key": "", "components.Wallet.ReceiveModal.pubkey_copied_notification_description": "", "components.Wallet.ReceiveModal.pubkey_copied_notification_title": "", + "components.Wallet.ReceiveModal.wallet_address": "", "components.Wallet.pay": "", "components.Wallet.payment_success": "", "components.Wallet.request": "", diff --git a/app/translations/bg-BG.json b/app/translations/bg-BG.json index b18ff59558f..5bd72bfafe1 100644 --- a/app/translations/bg-BG.json +++ b/app/translations/bg-BG.json @@ -246,18 +246,18 @@ "components.UI.expired": "", "components.UI.expires": "", "components.UI.invalid_request": "", - "components.UI.payreq_placeholder": "Поставете заявката за плащане или bitcoin адресът тук", + "components.UI.payreq_placeholder": "Поставете заявката за плащане или {chain} адресът тук", "components.UI.required_field": "", "components.UI.valid_request": "", "components.Wallet.ReceiveModal.address_copied_notification_description": "", "components.Wallet.ReceiveModal.address_copied_notification_title": "", - "components.Wallet.ReceiveModal.bitcoin_address": "Bitcoin адрес", "components.Wallet.ReceiveModal.copy_address": "Копиране на адрес", "components.Wallet.ReceiveModal.copy_pubkey": "Копирай публичния ключ", "components.Wallet.ReceiveModal.node_pubkey": "Публичен ключ на Възела", "components.Wallet.ReceiveModal.node_public_key": "Публичния ключ на възела", "components.Wallet.ReceiveModal.pubkey_copied_notification_description": "", "components.Wallet.ReceiveModal.pubkey_copied_notification_title": "", + "components.Wallet.ReceiveModal.wallet_address": "{chain} адрес", "components.Wallet.pay": "Плати", "components.Wallet.payment_success": "Успешно изпратено плащане", "components.Wallet.request": "Заяви", diff --git a/app/translations/ca-ES.json b/app/translations/ca-ES.json index f7c6a5412c5..3e2e77619c2 100644 --- a/app/translations/ca-ES.json +++ b/app/translations/ca-ES.json @@ -251,13 +251,13 @@ "components.UI.valid_request": "", "components.Wallet.ReceiveModal.address_copied_notification_description": "", "components.Wallet.ReceiveModal.address_copied_notification_title": "", - "components.Wallet.ReceiveModal.bitcoin_address": "", "components.Wallet.ReceiveModal.copy_address": "", "components.Wallet.ReceiveModal.copy_pubkey": "", "components.Wallet.ReceiveModal.node_pubkey": "", "components.Wallet.ReceiveModal.node_public_key": "", "components.Wallet.ReceiveModal.pubkey_copied_notification_description": "", "components.Wallet.ReceiveModal.pubkey_copied_notification_title": "", + "components.Wallet.ReceiveModal.wallet_address": "", "components.Wallet.pay": "", "components.Wallet.payment_success": "", "components.Wallet.request": "", diff --git a/app/translations/cs-CZ.json b/app/translations/cs-CZ.json index cb53d682a99..8c2b74c55e3 100644 --- a/app/translations/cs-CZ.json +++ b/app/translations/cs-CZ.json @@ -246,18 +246,18 @@ "components.UI.expired": "", "components.UI.expires": "", "components.UI.invalid_request": "", - "components.UI.payreq_placeholder": "Vložte žádost o platbu nebo bitcoinovou adresu", + "components.UI.payreq_placeholder": "Vložte žádost o platbu nebo {chain} adresu", "components.UI.required_field": "", "components.UI.valid_request": "", "components.Wallet.ReceiveModal.address_copied_notification_description": "", "components.Wallet.ReceiveModal.address_copied_notification_title": "", - "components.Wallet.ReceiveModal.bitcoin_address": "Bitcoinová adresa", "components.Wallet.ReceiveModal.copy_address": "", "components.Wallet.ReceiveModal.copy_pubkey": "", "components.Wallet.ReceiveModal.node_pubkey": "", "components.Wallet.ReceiveModal.node_public_key": "Veřejný klíč uzlu", "components.Wallet.ReceiveModal.pubkey_copied_notification_description": "", "components.Wallet.ReceiveModal.pubkey_copied_notification_title": "", + "components.Wallet.ReceiveModal.wallet_address": "{chain} adresa", "components.Wallet.pay": "Zaplatit", "components.Wallet.payment_success": "Platba úspěšně odeslána", "components.Wallet.request": "Vyžádat", diff --git a/app/translations/da-DK.json b/app/translations/da-DK.json index ca19e209762..af672258e27 100644 --- a/app/translations/da-DK.json +++ b/app/translations/da-DK.json @@ -251,13 +251,13 @@ "components.UI.valid_request": "", "components.Wallet.ReceiveModal.address_copied_notification_description": "", "components.Wallet.ReceiveModal.address_copied_notification_title": "", - "components.Wallet.ReceiveModal.bitcoin_address": "", "components.Wallet.ReceiveModal.copy_address": "", "components.Wallet.ReceiveModal.copy_pubkey": "", "components.Wallet.ReceiveModal.node_pubkey": "", "components.Wallet.ReceiveModal.node_public_key": "", "components.Wallet.ReceiveModal.pubkey_copied_notification_description": "", "components.Wallet.ReceiveModal.pubkey_copied_notification_title": "", + "components.Wallet.ReceiveModal.wallet_address": "", "components.Wallet.pay": "", "components.Wallet.payment_success": "", "components.Wallet.request": "", diff --git a/app/translations/de-DE.json b/app/translations/de-DE.json index 69c322c309b..3ab317810e7 100644 --- a/app/translations/de-DE.json +++ b/app/translations/de-DE.json @@ -246,18 +246,18 @@ "components.UI.expired": "", "components.UI.expires": "", "components.UI.invalid_request": "", - "components.UI.payreq_placeholder": "Füge Zahlungsanfrage oder Bitcoin Adresse ein", + "components.UI.payreq_placeholder": "Füge Zahlungsanfrage oder {chain} Adresse ein", "components.UI.required_field": "", "components.UI.valid_request": "", "components.Wallet.ReceiveModal.address_copied_notification_description": "", "components.Wallet.ReceiveModal.address_copied_notification_title": "", - "components.Wallet.ReceiveModal.bitcoin_address": "Bitcoin Adresse", "components.Wallet.ReceiveModal.copy_address": "Kopiere Adresse", "components.Wallet.ReceiveModal.copy_pubkey": "Public Key kopieren", "components.Wallet.ReceiveModal.node_pubkey": "Node öffentlicher Schlüssel", "components.Wallet.ReceiveModal.node_public_key": "Node Public Key", "components.Wallet.ReceiveModal.pubkey_copied_notification_description": "", "components.Wallet.ReceiveModal.pubkey_copied_notification_title": "", + "components.Wallet.ReceiveModal.wallet_address": "{chain} Adresse", "components.Wallet.pay": "Bezahlen", "components.Wallet.payment_success": "Zahlung erfolgreich gesendet", "components.Wallet.request": "Anfrage", diff --git a/app/translations/el-GR.json b/app/translations/el-GR.json index 9172afc8692..ed62d829190 100644 --- a/app/translations/el-GR.json +++ b/app/translations/el-GR.json @@ -246,18 +246,18 @@ "components.UI.expired": "", "components.UI.expires": "", "components.UI.invalid_request": "", - "components.UI.payreq_placeholder": "Επικολλήστε το αίτημα ή το bitcoin διεύθυνση πληρωμής εδώ", + "components.UI.payreq_placeholder": "Επικολλήστε το αίτημα ή το {chain} διεύθυνση πληρωμής εδώ", "components.UI.required_field": "", "components.UI.valid_request": "", "components.Wallet.ReceiveModal.address_copied_notification_description": "", "components.Wallet.ReceiveModal.address_copied_notification_title": "", - "components.Wallet.ReceiveModal.bitcoin_address": "Διεύθυνση Bitcoin", "components.Wallet.ReceiveModal.copy_address": "", "components.Wallet.ReceiveModal.copy_pubkey": "", "components.Wallet.ReceiveModal.node_pubkey": "", "components.Wallet.ReceiveModal.node_public_key": "Κόμβος δημόσιου κλειδιού", "components.Wallet.ReceiveModal.pubkey_copied_notification_description": "", "components.Wallet.ReceiveModal.pubkey_copied_notification_title": "", + "components.Wallet.ReceiveModal.wallet_address": "Διεύθυνση {chain}", "components.Wallet.pay": "Αποστολή πληρωμής", "components.Wallet.payment_success": "Η πληρωμή έγινε με επιτυχία", "components.Wallet.request": "Αίτηση πληρωμής", diff --git a/app/translations/en.json b/app/translations/en.json index 95f119013b8..384bd6288c7 100644 --- a/app/translations/en.json +++ b/app/translations/en.json @@ -183,7 +183,7 @@ "components.Pay.back": "Back", "components.Pay.calculating": "calculating", "components.Pay.current_balance": "Your current balance", - "components.Pay.description": "You can send Bitcoin (BTC) through the Lightning Network or make a On-Chain Transaction. Just paste your Lightning Payment Request or the Bitcoin Address in the field below. Zap will guide you to the process.", + "components.Pay.description": "You can send {chain} ({ticker}) through the Lightning Network or make a On-Chain Transaction. Just paste your Lightning Payment Request or the {chain} Address in the field below. Zap will guide you to the process.", "components.Pay.error_not_enough_funds": "You do not have enough funds available to make this payment.", "components.Pay.fee": "Fee", "components.Pay.fee_less_than_1": "less than 1 satoshi", @@ -207,7 +207,7 @@ "components.Request.amount": "Amount", "components.Request.button_text": "Request", "components.Request.copy_button_text": "Copy invoice", - "components.Request.description": "You can request Bitcoin (BTC) through the Lightning Network. Just enter the Amount you want to request in the field below. Zap will generate a QR-Code and a Lightning invoice after.", + "components.Request.description": "You can request {chain} ({ticker}) through the Lightning Network. Just enter the Amount you want to request in the field below. Zap will generate a QR-Code and a Lightning invoice after.", "components.Request.ln_invoice": "Lightning Invoice", "components.Request.memo": "Memo", "components.Request.memo_placeholder": "For example \"Dinner last night\"", @@ -246,18 +246,18 @@ "components.UI.expired": "Expired", "components.UI.expires": "Expires", "components.UI.invalid_request": "Not a valid {chain} request.", - "components.UI.payreq_placeholder": "Paste a Lightning Payment Request or Bitcoin Address here", + "components.UI.payreq_placeholder": "Paste a Lightning Payment Request or {chain} Address here", "components.UI.required_field": "This is a required field", "components.UI.valid_request": "Valid {chain} request", "components.Wallet.ReceiveModal.address_copied_notification_description": "Address has been copied to your clipboard", "components.Wallet.ReceiveModal.address_copied_notification_title": "Address copied", - "components.Wallet.ReceiveModal.bitcoin_address": "Bitcoin Address", "components.Wallet.ReceiveModal.copy_address": "Copy address", "components.Wallet.ReceiveModal.copy_pubkey": "Copy Pubkey", "components.Wallet.ReceiveModal.node_pubkey": "Node Pubkey", "components.Wallet.ReceiveModal.node_public_key": "Node Public Key", "components.Wallet.ReceiveModal.pubkey_copied_notification_description": "Node public key has been copied to your clipboard", "components.Wallet.ReceiveModal.pubkey_copied_notification_title": "Node public key copied", + "components.Wallet.ReceiveModal.wallet_address": "{chain} Address", "components.Wallet.pay": "Pay", "components.Wallet.payment_success": "Successfully sent payment", "components.Wallet.request": "Request", diff --git a/app/translations/es-ES.json b/app/translations/es-ES.json index a166d06bcb5..b5c14a75ff8 100644 --- a/app/translations/es-ES.json +++ b/app/translations/es-ES.json @@ -246,18 +246,18 @@ "components.UI.expired": "", "components.UI.expires": "", "components.UI.invalid_request": "", - "components.UI.payreq_placeholder": "Pegue la solicitud de pago o la dirección bitcoin acá", + "components.UI.payreq_placeholder": "Pegue la solicitud de pago o la dirección {chain} acá", "components.UI.required_field": "", "components.UI.valid_request": "", "components.Wallet.ReceiveModal.address_copied_notification_description": "", "components.Wallet.ReceiveModal.address_copied_notification_title": "", - "components.Wallet.ReceiveModal.bitcoin_address": "Dirección Bitcoin", "components.Wallet.ReceiveModal.copy_address": "", "components.Wallet.ReceiveModal.copy_pubkey": "", "components.Wallet.ReceiveModal.node_pubkey": "", "components.Wallet.ReceiveModal.node_public_key": "Public Key del Nodo", "components.Wallet.ReceiveModal.pubkey_copied_notification_description": "", "components.Wallet.ReceiveModal.pubkey_copied_notification_title": "", + "components.Wallet.ReceiveModal.wallet_address": "Dirección {chain}", "components.Wallet.pay": "Pagar", "components.Wallet.payment_success": "Pago enviado correctamente", "components.Wallet.request": "Solicitar", diff --git a/app/translations/fi-FI.json b/app/translations/fi-FI.json index f7c6a5412c5..3e2e77619c2 100644 --- a/app/translations/fi-FI.json +++ b/app/translations/fi-FI.json @@ -251,13 +251,13 @@ "components.UI.valid_request": "", "components.Wallet.ReceiveModal.address_copied_notification_description": "", "components.Wallet.ReceiveModal.address_copied_notification_title": "", - "components.Wallet.ReceiveModal.bitcoin_address": "", "components.Wallet.ReceiveModal.copy_address": "", "components.Wallet.ReceiveModal.copy_pubkey": "", "components.Wallet.ReceiveModal.node_pubkey": "", "components.Wallet.ReceiveModal.node_public_key": "", "components.Wallet.ReceiveModal.pubkey_copied_notification_description": "", "components.Wallet.ReceiveModal.pubkey_copied_notification_title": "", + "components.Wallet.ReceiveModal.wallet_address": "", "components.Wallet.pay": "", "components.Wallet.payment_success": "", "components.Wallet.request": "", diff --git a/app/translations/fr-FR.json b/app/translations/fr-FR.json index fde9d223775..49a8b576624 100644 --- a/app/translations/fr-FR.json +++ b/app/translations/fr-FR.json @@ -246,18 +246,18 @@ "components.UI.expired": "", "components.UI.expires": "", "components.UI.invalid_request": "", - "components.UI.payreq_placeholder": "Collez ici la demande de paiement ou l'adresse bitcoin", + "components.UI.payreq_placeholder": "Collez ici la demande de paiement ou l'adresse {chain}", "components.UI.required_field": "", "components.UI.valid_request": "", "components.Wallet.ReceiveModal.address_copied_notification_description": "", "components.Wallet.ReceiveModal.address_copied_notification_title": "", - "components.Wallet.ReceiveModal.bitcoin_address": "Adresse Bitcoin", "components.Wallet.ReceiveModal.copy_address": "Copier l'adresse", "components.Wallet.ReceiveModal.copy_pubkey": "", "components.Wallet.ReceiveModal.node_pubkey": "", "components.Wallet.ReceiveModal.node_public_key": "Node Public Key", "components.Wallet.ReceiveModal.pubkey_copied_notification_description": "", "components.Wallet.ReceiveModal.pubkey_copied_notification_title": "", + "components.Wallet.ReceiveModal.wallet_address": "Adresse {chain}", "components.Wallet.pay": "Payer", "components.Wallet.payment_success": "Paiement envoyé avec succès", "components.Wallet.request": "Demande", diff --git a/app/translations/ga-IE.json b/app/translations/ga-IE.json index 2c85b42f296..95fbea2c41a 100644 --- a/app/translations/ga-IE.json +++ b/app/translations/ga-IE.json @@ -246,18 +246,18 @@ "components.UI.expired": "", "components.UI.expires": "", "components.UI.invalid_request": "", - "components.UI.payreq_placeholder": "Greamaigh iarratas íocaíochta nó seoladh bitcoin anseo", + "components.UI.payreq_placeholder": "Greamaigh iarratas íocaíochta nó seoladh {chain} anseo", "components.UI.required_field": "", "components.UI.valid_request": "", "components.Wallet.ReceiveModal.address_copied_notification_description": "", "components.Wallet.ReceiveModal.address_copied_notification_title": "", - "components.Wallet.ReceiveModal.bitcoin_address": "Seoladh Bitcoin", "components.Wallet.ReceiveModal.copy_address": "Cóipeáil an seoladh", "components.Wallet.ReceiveModal.copy_pubkey": "Cóipeáil Pubkey", "components.Wallet.ReceiveModal.node_pubkey": "Node Pubkey", "components.Wallet.ReceiveModal.node_public_key": "Node Eochair Poiblí", "components.Wallet.ReceiveModal.pubkey_copied_notification_description": "", "components.Wallet.ReceiveModal.pubkey_copied_notification_title": "", + "components.Wallet.ReceiveModal.wallet_address": "Seoladh {chain}", "components.Wallet.pay": "Íoc", "components.Wallet.payment_success": "D'éirigh leis an íocaíocht a sheoladh", "components.Wallet.request": "Iarratas", diff --git a/app/translations/he-IL.json b/app/translations/he-IL.json index b2479c0b304..d9bc235419f 100644 --- a/app/translations/he-IL.json +++ b/app/translations/he-IL.json @@ -251,13 +251,13 @@ "components.UI.valid_request": "", "components.Wallet.ReceiveModal.address_copied_notification_description": "", "components.Wallet.ReceiveModal.address_copied_notification_title": "", - "components.Wallet.ReceiveModal.bitcoin_address": "", "components.Wallet.ReceiveModal.copy_address": "", "components.Wallet.ReceiveModal.copy_pubkey": "", "components.Wallet.ReceiveModal.node_pubkey": "", "components.Wallet.ReceiveModal.node_public_key": "", "components.Wallet.ReceiveModal.pubkey_copied_notification_description": "", "components.Wallet.ReceiveModal.pubkey_copied_notification_title": "", + "components.Wallet.ReceiveModal.wallet_address": "", "components.Wallet.pay": "", "components.Wallet.payment_success": "", "components.Wallet.request": "", diff --git a/app/translations/hi-IN.json b/app/translations/hi-IN.json index dd0ca8bf4c3..2db422c538a 100644 --- a/app/translations/hi-IN.json +++ b/app/translations/hi-IN.json @@ -251,13 +251,13 @@ "components.UI.valid_request": "", "components.Wallet.ReceiveModal.address_copied_notification_description": "", "components.Wallet.ReceiveModal.address_copied_notification_title": "", - "components.Wallet.ReceiveModal.bitcoin_address": "", "components.Wallet.ReceiveModal.copy_address": "", "components.Wallet.ReceiveModal.copy_pubkey": "", "components.Wallet.ReceiveModal.node_pubkey": "", "components.Wallet.ReceiveModal.node_public_key": "", "components.Wallet.ReceiveModal.pubkey_copied_notification_description": "", "components.Wallet.ReceiveModal.pubkey_copied_notification_title": "", + "components.Wallet.ReceiveModal.wallet_address": "", "components.Wallet.pay": "", "components.Wallet.payment_success": "", "components.Wallet.request": "", diff --git a/app/translations/hr-HR.json b/app/translations/hr-HR.json index e81ae8885eb..b7e65ca6919 100644 --- a/app/translations/hr-HR.json +++ b/app/translations/hr-HR.json @@ -246,18 +246,18 @@ "components.UI.expired": "", "components.UI.expires": "", "components.UI.invalid_request": "", - "components.UI.payreq_placeholder": "Ovdje zalijepite zahtjev za plaćanjem ili bitcoin na-lanac adresu", + "components.UI.payreq_placeholder": "Ovdje zalijepite zahtjev za plaćanjem ili {chain} na-lanac adresu", "components.UI.required_field": "", "components.UI.valid_request": "", "components.Wallet.ReceiveModal.address_copied_notification_description": "", "components.Wallet.ReceiveModal.address_copied_notification_title": "", - "components.Wallet.ReceiveModal.bitcoin_address": "Bitcoin adresa", "components.Wallet.ReceiveModal.copy_address": "Kopiraj adresu", "components.Wallet.ReceiveModal.copy_pubkey": "Kopiraj Pubkey", "components.Wallet.ReceiveModal.node_pubkey": "Pubkey čvora", "components.Wallet.ReceiveModal.node_public_key": "Javni ključ za čvor", "components.Wallet.ReceiveModal.pubkey_copied_notification_description": "", "components.Wallet.ReceiveModal.pubkey_copied_notification_title": "", + "components.Wallet.ReceiveModal.wallet_address": "{chain} adresa", "components.Wallet.pay": "Plati", "components.Wallet.payment_success": "Uspješno poslana plaćanja", "components.Wallet.request": "Zahtjev", diff --git a/app/translations/hu-HU.json b/app/translations/hu-HU.json index f7c6a5412c5..3e2e77619c2 100644 --- a/app/translations/hu-HU.json +++ b/app/translations/hu-HU.json @@ -251,13 +251,13 @@ "components.UI.valid_request": "", "components.Wallet.ReceiveModal.address_copied_notification_description": "", "components.Wallet.ReceiveModal.address_copied_notification_title": "", - "components.Wallet.ReceiveModal.bitcoin_address": "", "components.Wallet.ReceiveModal.copy_address": "", "components.Wallet.ReceiveModal.copy_pubkey": "", "components.Wallet.ReceiveModal.node_pubkey": "", "components.Wallet.ReceiveModal.node_public_key": "", "components.Wallet.ReceiveModal.pubkey_copied_notification_description": "", "components.Wallet.ReceiveModal.pubkey_copied_notification_title": "", + "components.Wallet.ReceiveModal.wallet_address": "", "components.Wallet.pay": "", "components.Wallet.payment_success": "", "components.Wallet.request": "", diff --git a/app/translations/it-IT.json b/app/translations/it-IT.json index 48aee9a2c1e..fb4bf674a5a 100644 --- a/app/translations/it-IT.json +++ b/app/translations/it-IT.json @@ -251,13 +251,13 @@ "components.UI.valid_request": "", "components.Wallet.ReceiveModal.address_copied_notification_description": "", "components.Wallet.ReceiveModal.address_copied_notification_title": "", - "components.Wallet.ReceiveModal.bitcoin_address": "", "components.Wallet.ReceiveModal.copy_address": "", "components.Wallet.ReceiveModal.copy_pubkey": "", "components.Wallet.ReceiveModal.node_pubkey": "", "components.Wallet.ReceiveModal.node_public_key": "", "components.Wallet.ReceiveModal.pubkey_copied_notification_description": "", "components.Wallet.ReceiveModal.pubkey_copied_notification_title": "", + "components.Wallet.ReceiveModal.wallet_address": "", "components.Wallet.pay": "", "components.Wallet.payment_success": "", "components.Wallet.request": "", diff --git a/app/translations/ja-JP.json b/app/translations/ja-JP.json index f60632571a1..c073c93d0e2 100644 --- a/app/translations/ja-JP.json +++ b/app/translations/ja-JP.json @@ -251,13 +251,13 @@ "components.UI.valid_request": "", "components.Wallet.ReceiveModal.address_copied_notification_description": "", "components.Wallet.ReceiveModal.address_copied_notification_title": "", - "components.Wallet.ReceiveModal.bitcoin_address": "ビットコインアドレス", "components.Wallet.ReceiveModal.copy_address": "", "components.Wallet.ReceiveModal.copy_pubkey": "", "components.Wallet.ReceiveModal.node_pubkey": "", "components.Wallet.ReceiveModal.node_public_key": "ノードのパブリックキー", "components.Wallet.ReceiveModal.pubkey_copied_notification_description": "", "components.Wallet.ReceiveModal.pubkey_copied_notification_title": "", + "components.Wallet.ReceiveModal.wallet_address": "ビットコインアドレス", "components.Wallet.pay": "支払う", "components.Wallet.payment_success": "正常に支払いを送信", "components.Wallet.request": "要求", diff --git a/app/translations/ko-KR.json b/app/translations/ko-KR.json index f7c6a5412c5..3e2e77619c2 100644 --- a/app/translations/ko-KR.json +++ b/app/translations/ko-KR.json @@ -251,13 +251,13 @@ "components.UI.valid_request": "", "components.Wallet.ReceiveModal.address_copied_notification_description": "", "components.Wallet.ReceiveModal.address_copied_notification_title": "", - "components.Wallet.ReceiveModal.bitcoin_address": "", "components.Wallet.ReceiveModal.copy_address": "", "components.Wallet.ReceiveModal.copy_pubkey": "", "components.Wallet.ReceiveModal.node_pubkey": "", "components.Wallet.ReceiveModal.node_public_key": "", "components.Wallet.ReceiveModal.pubkey_copied_notification_description": "", "components.Wallet.ReceiveModal.pubkey_copied_notification_title": "", + "components.Wallet.ReceiveModal.wallet_address": "", "components.Wallet.pay": "", "components.Wallet.payment_success": "", "components.Wallet.request": "", diff --git a/app/translations/nl-NL.json b/app/translations/nl-NL.json index 0bd492a6b27..4fc68491140 100644 --- a/app/translations/nl-NL.json +++ b/app/translations/nl-NL.json @@ -251,13 +251,13 @@ "components.UI.valid_request": "", "components.Wallet.ReceiveModal.address_copied_notification_description": "", "components.Wallet.ReceiveModal.address_copied_notification_title": "", - "components.Wallet.ReceiveModal.bitcoin_address": "Bitcoin adres", "components.Wallet.ReceiveModal.copy_address": "", "components.Wallet.ReceiveModal.copy_pubkey": "", "components.Wallet.ReceiveModal.node_pubkey": "Node publieke sleutel", "components.Wallet.ReceiveModal.node_public_key": "Node Publieke Sleutel", "components.Wallet.ReceiveModal.pubkey_copied_notification_description": "", "components.Wallet.ReceiveModal.pubkey_copied_notification_title": "", + "components.Wallet.ReceiveModal.wallet_address": "{chain} adres", "components.Wallet.pay": "Betaal", "components.Wallet.payment_success": "Betaling verzonden", "components.Wallet.request": "Verzoek", diff --git a/app/translations/no-NO.json b/app/translations/no-NO.json index f7c6a5412c5..3e2e77619c2 100644 --- a/app/translations/no-NO.json +++ b/app/translations/no-NO.json @@ -251,13 +251,13 @@ "components.UI.valid_request": "", "components.Wallet.ReceiveModal.address_copied_notification_description": "", "components.Wallet.ReceiveModal.address_copied_notification_title": "", - "components.Wallet.ReceiveModal.bitcoin_address": "", "components.Wallet.ReceiveModal.copy_address": "", "components.Wallet.ReceiveModal.copy_pubkey": "", "components.Wallet.ReceiveModal.node_pubkey": "", "components.Wallet.ReceiveModal.node_public_key": "", "components.Wallet.ReceiveModal.pubkey_copied_notification_description": "", "components.Wallet.ReceiveModal.pubkey_copied_notification_title": "", + "components.Wallet.ReceiveModal.wallet_address": "", "components.Wallet.pay": "", "components.Wallet.payment_success": "", "components.Wallet.request": "", diff --git a/app/translations/pl-PL.json b/app/translations/pl-PL.json index 4ab47d16c57..c1980fdedb0 100644 --- a/app/translations/pl-PL.json +++ b/app/translations/pl-PL.json @@ -251,13 +251,13 @@ "components.UI.valid_request": "", "components.Wallet.ReceiveModal.address_copied_notification_description": "", "components.Wallet.ReceiveModal.address_copied_notification_title": "", - "components.Wallet.ReceiveModal.bitcoin_address": "", "components.Wallet.ReceiveModal.copy_address": "", "components.Wallet.ReceiveModal.copy_pubkey": "", "components.Wallet.ReceiveModal.node_pubkey": "", "components.Wallet.ReceiveModal.node_public_key": "", "components.Wallet.ReceiveModal.pubkey_copied_notification_description": "", "components.Wallet.ReceiveModal.pubkey_copied_notification_title": "", + "components.Wallet.ReceiveModal.wallet_address": "", "components.Wallet.pay": "", "components.Wallet.payment_success": "", "components.Wallet.request": "", diff --git a/app/translations/pt-BR.json b/app/translations/pt-BR.json index b6a15da81e6..5cd5d1953bc 100644 --- a/app/translations/pt-BR.json +++ b/app/translations/pt-BR.json @@ -251,13 +251,13 @@ "components.UI.valid_request": "", "components.Wallet.ReceiveModal.address_copied_notification_description": "", "components.Wallet.ReceiveModal.address_copied_notification_title": "", - "components.Wallet.ReceiveModal.bitcoin_address": "Endereço Bitcoin", "components.Wallet.ReceiveModal.copy_address": "", "components.Wallet.ReceiveModal.copy_pubkey": "", "components.Wallet.ReceiveModal.node_pubkey": "Pubkey do nó", "components.Wallet.ReceiveModal.node_public_key": "Chave Pública do Nó", "components.Wallet.ReceiveModal.pubkey_copied_notification_description": "", "components.Wallet.ReceiveModal.pubkey_copied_notification_title": "", + "components.Wallet.ReceiveModal.wallet_address": "Endereço {chain}", "components.Wallet.pay": "Pagar", "components.Wallet.payment_success": "Pagamento enviado com sucesso", "components.Wallet.request": "Solicitar", diff --git a/app/translations/pt-PT.json b/app/translations/pt-PT.json index a397e94651f..f92b3a43c53 100644 --- a/app/translations/pt-PT.json +++ b/app/translations/pt-PT.json @@ -251,13 +251,13 @@ "components.UI.valid_request": "", "components.Wallet.ReceiveModal.address_copied_notification_description": "", "components.Wallet.ReceiveModal.address_copied_notification_title": "", - "components.Wallet.ReceiveModal.bitcoin_address": "", "components.Wallet.ReceiveModal.copy_address": "", "components.Wallet.ReceiveModal.copy_pubkey": "", "components.Wallet.ReceiveModal.node_pubkey": "", "components.Wallet.ReceiveModal.node_public_key": "", "components.Wallet.ReceiveModal.pubkey_copied_notification_description": "", "components.Wallet.ReceiveModal.pubkey_copied_notification_title": "", + "components.Wallet.ReceiveModal.wallet_address": "", "components.Wallet.pay": "", "components.Wallet.payment_success": "", "components.Wallet.request": "", diff --git a/app/translations/ro-RO.json b/app/translations/ro-RO.json index 429d3ba23fa..a943fcd6c0a 100644 --- a/app/translations/ro-RO.json +++ b/app/translations/ro-RO.json @@ -246,18 +246,18 @@ "components.UI.expired": "", "components.UI.expires": "", "components.UI.invalid_request": "", - "components.UI.payreq_placeholder": "Lipeste cererea de plata sau adresa de bitcoin aici", + "components.UI.payreq_placeholder": "Lipeste cererea de plata sau adresa de {chain} aici", "components.UI.required_field": "", "components.UI.valid_request": "", "components.Wallet.ReceiveModal.address_copied_notification_description": "", "components.Wallet.ReceiveModal.address_copied_notification_title": "", - "components.Wallet.ReceiveModal.bitcoin_address": "Adresă bitcoin", "components.Wallet.ReceiveModal.copy_address": "", "components.Wallet.ReceiveModal.copy_pubkey": "", "components.Wallet.ReceiveModal.node_pubkey": "", "components.Wallet.ReceiveModal.node_public_key": "cheie publică nod", "components.Wallet.ReceiveModal.pubkey_copied_notification_description": "", "components.Wallet.ReceiveModal.pubkey_copied_notification_title": "", + "components.Wallet.ReceiveModal.wallet_address": "Adresă {chain}", "components.Wallet.pay": "Plateste", "components.Wallet.payment_success": "Plata a fost trimisa cu succes", "components.Wallet.request": "Cerere", diff --git a/app/translations/ru-RU.json b/app/translations/ru-RU.json index b67aca9c2f6..3ae82a6a334 100644 --- a/app/translations/ru-RU.json +++ b/app/translations/ru-RU.json @@ -251,13 +251,13 @@ "components.UI.valid_request": "", "components.Wallet.ReceiveModal.address_copied_notification_description": "", "components.Wallet.ReceiveModal.address_copied_notification_title": "", - "components.Wallet.ReceiveModal.bitcoin_address": "Биткоин Адрес", "components.Wallet.ReceiveModal.copy_address": "", "components.Wallet.ReceiveModal.copy_pubkey": "", "components.Wallet.ReceiveModal.node_pubkey": "Публичный ключ ноды", "components.Wallet.ReceiveModal.node_public_key": "Публичный Ключ ноды", "components.Wallet.ReceiveModal.pubkey_copied_notification_description": "", "components.Wallet.ReceiveModal.pubkey_copied_notification_title": "", + "components.Wallet.ReceiveModal.wallet_address": "Биткоин Адрес", "components.Wallet.pay": "Оплатить", "components.Wallet.payment_success": "Платеж успешно отправлен", "components.Wallet.request": "Запрос", diff --git a/app/translations/sr-SP.json b/app/translations/sr-SP.json index f7c6a5412c5..3e2e77619c2 100644 --- a/app/translations/sr-SP.json +++ b/app/translations/sr-SP.json @@ -251,13 +251,13 @@ "components.UI.valid_request": "", "components.Wallet.ReceiveModal.address_copied_notification_description": "", "components.Wallet.ReceiveModal.address_copied_notification_title": "", - "components.Wallet.ReceiveModal.bitcoin_address": "", "components.Wallet.ReceiveModal.copy_address": "", "components.Wallet.ReceiveModal.copy_pubkey": "", "components.Wallet.ReceiveModal.node_pubkey": "", "components.Wallet.ReceiveModal.node_public_key": "", "components.Wallet.ReceiveModal.pubkey_copied_notification_description": "", "components.Wallet.ReceiveModal.pubkey_copied_notification_title": "", + "components.Wallet.ReceiveModal.wallet_address": "", "components.Wallet.pay": "", "components.Wallet.payment_success": "", "components.Wallet.request": "", diff --git a/app/translations/sv-SE.json b/app/translations/sv-SE.json index 1abf4429370..69bacedb4a4 100644 --- a/app/translations/sv-SE.json +++ b/app/translations/sv-SE.json @@ -246,18 +246,18 @@ "components.UI.expired": "", "components.UI.expires": "", "components.UI.invalid_request": "", - "components.UI.payreq_placeholder": "Klistra in betalningsbegäran eller bitcoin adress här", + "components.UI.payreq_placeholder": "Klistra in betalningsbegäran eller {chain} adress här", "components.UI.required_field": "", "components.UI.valid_request": "", "components.Wallet.ReceiveModal.address_copied_notification_description": "", "components.Wallet.ReceiveModal.address_copied_notification_title": "", - "components.Wallet.ReceiveModal.bitcoin_address": "Bitcoin adress", "components.Wallet.ReceiveModal.copy_address": "", "components.Wallet.ReceiveModal.copy_pubkey": "", "components.Wallet.ReceiveModal.node_pubkey": "", "components.Wallet.ReceiveModal.node_public_key": "Node Public Key", "components.Wallet.ReceiveModal.pubkey_copied_notification_description": "", "components.Wallet.ReceiveModal.pubkey_copied_notification_title": "", + "components.Wallet.ReceiveModal.wallet_address": "{chain} adress", "components.Wallet.pay": "Betala", "components.Wallet.payment_success": "Betalning framgångsrikt skickad", "components.Wallet.request": "Begäran", diff --git a/app/translations/tr-TR.json b/app/translations/tr-TR.json index e9072f80a0b..5d98695b5a0 100644 --- a/app/translations/tr-TR.json +++ b/app/translations/tr-TR.json @@ -246,18 +246,18 @@ "components.UI.expired": "", "components.UI.expires": "", "components.UI.invalid_request": "", - "components.UI.payreq_placeholder": "Ödeme isteği veya bitcoin adresini buraya yapıştırın", + "components.UI.payreq_placeholder": "Ödeme isteği veya {chain} adresini buraya yapıştırın", "components.UI.required_field": "", "components.UI.valid_request": "", "components.Wallet.ReceiveModal.address_copied_notification_description": "", "components.Wallet.ReceiveModal.address_copied_notification_title": "", - "components.Wallet.ReceiveModal.bitcoin_address": "Bitcoin adresi", "components.Wallet.ReceiveModal.copy_address": "", "components.Wallet.ReceiveModal.copy_pubkey": "", "components.Wallet.ReceiveModal.node_pubkey": "", "components.Wallet.ReceiveModal.node_public_key": "Düğüm ortak anahtar", "components.Wallet.ReceiveModal.pubkey_copied_notification_description": "", "components.Wallet.ReceiveModal.pubkey_copied_notification_title": "", + "components.Wallet.ReceiveModal.wallet_address": "{chain} adresi", "components.Wallet.pay": "Öde", "components.Wallet.payment_success": "Ödeme başarıyla gönderildi", "components.Wallet.request": "İste", diff --git a/app/translations/uk-UA.json b/app/translations/uk-UA.json index b1cde17f644..e1365c2f18b 100644 --- a/app/translations/uk-UA.json +++ b/app/translations/uk-UA.json @@ -246,18 +246,18 @@ "components.UI.expired": "", "components.UI.expires": "", "components.UI.invalid_request": "", - "components.UI.payreq_placeholder": "Вставте запит оплати або bitcoin адресу тут", + "components.UI.payreq_placeholder": "Вставте запит оплати або {chain} адресу тут", "components.UI.required_field": "", "components.UI.valid_request": "", "components.Wallet.ReceiveModal.address_copied_notification_description": "", "components.Wallet.ReceiveModal.address_copied_notification_title": "", - "components.Wallet.ReceiveModal.bitcoin_address": "Адреси Bitcoin", "components.Wallet.ReceiveModal.copy_address": "", "components.Wallet.ReceiveModal.copy_pubkey": "", "components.Wallet.ReceiveModal.node_pubkey": "", "components.Wallet.ReceiveModal.node_public_key": "Відкритий ключ вузла", "components.Wallet.ReceiveModal.pubkey_copied_notification_description": "", "components.Wallet.ReceiveModal.pubkey_copied_notification_title": "", + "components.Wallet.ReceiveModal.wallet_address": "Адреси {chain}", "components.Wallet.pay": "Сплатити", "components.Wallet.payment_success": "Оплата успішно відправлена", "components.Wallet.request": "Запит", diff --git a/app/translations/vi-VN.json b/app/translations/vi-VN.json index f7c6a5412c5..3e2e77619c2 100644 --- a/app/translations/vi-VN.json +++ b/app/translations/vi-VN.json @@ -251,13 +251,13 @@ "components.UI.valid_request": "", "components.Wallet.ReceiveModal.address_copied_notification_description": "", "components.Wallet.ReceiveModal.address_copied_notification_title": "", - "components.Wallet.ReceiveModal.bitcoin_address": "", "components.Wallet.ReceiveModal.copy_address": "", "components.Wallet.ReceiveModal.copy_pubkey": "", "components.Wallet.ReceiveModal.node_pubkey": "", "components.Wallet.ReceiveModal.node_public_key": "", "components.Wallet.ReceiveModal.pubkey_copied_notification_description": "", "components.Wallet.ReceiveModal.pubkey_copied_notification_title": "", + "components.Wallet.ReceiveModal.wallet_address": "", "components.Wallet.pay": "", "components.Wallet.payment_success": "", "components.Wallet.request": "", diff --git a/app/translations/zh-CN.json b/app/translations/zh-CN.json index 8d16b4a3edd..75591f00f67 100644 --- a/app/translations/zh-CN.json +++ b/app/translations/zh-CN.json @@ -251,13 +251,13 @@ "components.UI.valid_request": "", "components.Wallet.ReceiveModal.address_copied_notification_description": "", "components.Wallet.ReceiveModal.address_copied_notification_title": "", - "components.Wallet.ReceiveModal.bitcoin_address": "比特币地址", "components.Wallet.ReceiveModal.copy_address": "", "components.Wallet.ReceiveModal.copy_pubkey": "", "components.Wallet.ReceiveModal.node_pubkey": "", "components.Wallet.ReceiveModal.node_public_key": "节点公钥", "components.Wallet.ReceiveModal.pubkey_copied_notification_description": "", "components.Wallet.ReceiveModal.pubkey_copied_notification_title": "", + "components.Wallet.ReceiveModal.wallet_address": "比特币地址", "components.Wallet.pay": "支付", "components.Wallet.payment_success": "成功发送付款", "components.Wallet.request": "请求", diff --git a/app/translations/zh-TW.json b/app/translations/zh-TW.json index 3246251445c..b2f1bfa1685 100644 --- a/app/translations/zh-TW.json +++ b/app/translations/zh-TW.json @@ -251,13 +251,13 @@ "components.UI.valid_request": "", "components.Wallet.ReceiveModal.address_copied_notification_description": "", "components.Wallet.ReceiveModal.address_copied_notification_title": "", - "components.Wallet.ReceiveModal.bitcoin_address": "比特币地址", "components.Wallet.ReceiveModal.copy_address": "", "components.Wallet.ReceiveModal.copy_pubkey": "", "components.Wallet.ReceiveModal.node_pubkey": "", "components.Wallet.ReceiveModal.node_public_key": "节点公钥", "components.Wallet.ReceiveModal.pubkey_copied_notification_description": "", "components.Wallet.ReceiveModal.pubkey_copied_notification_title": "", + "components.Wallet.ReceiveModal.wallet_address": "比特币地址", "components.Wallet.pay": "支付", "components.Wallet.payment_success": "成功发送付款", "components.Wallet.request": "请求", diff --git a/stories/icons/icon.stories.js b/stories/icons/icon.stories.js index f984abe9e70..051f5a43419 100644 --- a/stories/icons/icon.stories.js +++ b/stories/icons/icon.stories.js @@ -36,7 +36,6 @@ import PlusCircle from 'components/Icon/PlusCircle' import Qrcode from 'components/Icon/Qrcode' import Search from 'components/Icon/Search' import Settings from 'components/Icon/Settings' -import SkinnyBitcoin from 'components/Icon/SkinnyBitcoin' import Spinner from 'components/Icon/Spinner' import Success from 'components/Icon/Success' import SystemArrowLeft from 'components/Icon/SystemArrowLeft' @@ -88,7 +87,6 @@ const zapIconsList = { Qrcode, Search, Settings, - SkinnyBitcoin, Spinner, Success, SystemArrowLeft, diff --git a/test/unit/components/UI/__snapshots__/LightningInvoiceInput.spec.js.snap b/test/unit/components/UI/__snapshots__/LightningInvoiceInput.spec.js.snap index 9e38e21ba75..263e5f95109 100644 --- a/test/unit/components/UI/__snapshots__/LightningInvoiceInput.spec.js.snap +++ b/test/unit/components/UI/__snapshots__/LightningInvoiceInput.spec.js.snap @@ -56,7 +56,7 @@ exports[`component.UI.LightningInvoiceInput should render correctly 1`] = ` onChange={[Function]} onFocus={[Function]} opacity={null} - placeholder="Paste a Lightning Payment Request or Bitcoin Address here" + placeholder="Paste a Lightning Payment Request or bitcoin Address here" required={false} rows={5} spellCheck="false" From 94ac53d13df6f5dbd21fac1805422c3ab761d6d4 Mon Sep 17 00:00:00 2001 From: Tom Kirkpatrick Date: Thu, 13 Dec 2018 01:35:24 +0100 Subject: [PATCH 4/7] feat(litecoin): patch bolt11 to support litecoin --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index 33300926814..5b1ecc4242e 100644 --- a/package.json +++ b/package.json @@ -301,7 +301,7 @@ "axios": "0.18.0", "bip39-en": "1.1.1", "bitcoinjs-lib": "4.0.2", - "bolt11": "https://github.com/bitcoinjs/bolt11.git", + "bolt11": "LN-Zap/bolt11#7872de0f53a420d2b9c99c7022f7e94339d80682", "connected-react-router": "5.0.1", "copy-to-clipboard": "3.0.8", "country-data-lookup": "0.0.3", From d4c793d9d3913dd9c2ddbae68e18e399b5ecd9fc Mon Sep 17 00:00:00 2001 From: Tom Kirkpatrick Date: Thu, 13 Dec 2018 11:07:41 +0100 Subject: [PATCH 5/7] feat(litecoin): ability to detect onchain addresses --- app/lib/utils/crypto.js | 24 +++++++++++++++--------- package.json | 1 + test/unit/utils/crypto.spec.js | 12 +++++------- yarn.lock | 11 +++++++++-- 4 files changed, 30 insertions(+), 18 deletions(-) diff --git a/app/lib/utils/crypto.js b/app/lib/utils/crypto.js index 77f4e60dd67..71bb6599d64 100644 --- a/app/lib/utils/crypto.js +++ b/app/lib/utils/crypto.js @@ -1,6 +1,7 @@ import bitcoin from 'bitcoinjs-lib' import bech32 from 'lib/utils/bech32' import lightningRequestReq from 'bolt11' +import coininfo from 'coininfo' export const decodePayReq = (payReq, addDefaults = true) => { const data = lightningRequestReq.decode(payReq) @@ -73,20 +74,25 @@ export const parseNumber = (_value, precision) => { * @param {String} [network='mainnet'] network to check (mainnet, testnet). * @return {Boolean} boolean indicating wether the address is a valid on-chain address. */ -export const isOnchain = (input, chain = 'bitcoin', network = 'mainnet') => { - if (typeof input !== 'string') { +export const isOnchain = (input, chain, network) => { + if (!input || !chain || !network) { return false } - if (chain !== 'bitcoin') { - // TODO: Implement address checking for litecoin. - return true + const networkMap = { + bitcoin: { + mainnet: coininfo.bitcoin.main.toBitcoinJS(), + testnet: coininfo.bitcoin.test.toBitcoinJS(), + regtest: coininfo.bitcoin.regtest.toBitcoinJS() + }, + litecoin: { + mainnet: coininfo.litecoin.main.toBitcoinJS(), + testnet: coininfo.litecoin.test.toBitcoinJS() + } } + try { - bitcoin.address.toOutputScript( - input, - network === 'mainnet' ? bitcoin.networks.bitcoin : bitcoin.networks.testnet - ) + bitcoin.address.toOutputScript(input, networkMap[chain][network]) return true } catch (e) { return false diff --git a/package.json b/package.json index 5b1ecc4242e..372c721a6f0 100644 --- a/package.json +++ b/package.json @@ -302,6 +302,7 @@ "bip39-en": "1.1.1", "bitcoinjs-lib": "4.0.2", "bolt11": "LN-Zap/bolt11#7872de0f53a420d2b9c99c7022f7e94339d80682", + "coininfo": "cryptocoinjs/coininfo.git#c7e003b2fc0db165b89e6f98f6d6360ad22616b2", "connected-react-router": "5.0.1", "copy-to-clipboard": "3.0.8", "country-data-lookup": "0.0.3", diff --git a/test/unit/utils/crypto.spec.js b/test/unit/utils/crypto.spec.js index 3fc2253347b..f1c27898b53 100644 --- a/test/unit/utils/crypto.spec.js +++ b/test/unit/utils/crypto.spec.js @@ -55,7 +55,7 @@ const VALID_BITCOIN_MAINNET = '3QJmV3qfvL9SuYo34YihAf3sRCW3qSinyC' const VALID_BITCOIN_TESTNET = '2NBMEX8USTXf5uPiW16QYX2AETytrJBCK52' const VALID_LITECOIN_MAINNET = 'LW9Q7QU8dgaGBerVkxbmVfurr2E1cFudrn' -const VALID_LITECOIN_TESTNET = '2MvCEgZGPnwA5HmZ3GDXB4EteMZzxgS54it' +const VALID_LITECOIN_TESTNET = 'Qbssgb8huSkT8adTGoyoSZpHrbcUEz2vnY' describe('Crypto.isOnchain', () => { describe('Bitcoin', () => { @@ -82,18 +82,16 @@ describe('Crypto.isOnchain', () => { it('should pass with a valid address ', () => { expect(isOnchain(VALID_LITECOIN_MAINNET, 'litecoin', 'mainnet')).toBeTruthy() }) - // FIXME: TWe don't yet fully support litecoin, so this check always returns true for litecoin addresses - it('should pass with an invalid address ', () => { - expect(isOnchain(VALID_LITECOIN_TESTNET, 'litecoin', 'mainnet')).toBeTruthy() + it('should fail with an invalid address ', () => { + expect(isOnchain(VALID_LITECOIN_TESTNET, 'litecoin', 'mainnet')).toBeFalsy() }) }) describe('Testnet', () => { it('should pass with a valid address', () => { expect(isOnchain(VALID_LITECOIN_TESTNET, 'litecoin', 'testnet')).toBeTruthy() }) - // FIXME: TWe don't yet fully support litecoin, so this check always returns true for litecoin addresses - it('should pass with an invalid address ', () => { - expect(isOnchain(VALID_LITECOIN_MAINNET, 'litecoin', 'testnet')).toBeTruthy() + it('should fail with an invalid address ', () => { + expect(isOnchain(VALID_LITECOIN_MAINNET, 'litecoin', 'testnet')).toBeFalsy() }) }) }) diff --git a/yarn.lock b/yarn.lock index c83676c1f60..8a10b668673 100644 --- a/yarn.lock +++ b/yarn.lock @@ -4592,13 +4592,14 @@ body-parser@1.18.3: raw-body "2.3.3" type-is "~1.6.16" -"bolt11@https://github.com/bitcoinjs/bolt11.git": +bolt11@LN-Zap/bolt11#7872de0f53a420d2b9c99c7022f7e94339d80682: version "1.0.0" - resolved "https://github.com/bitcoinjs/bolt11.git#d543a7aba5c3dd747627f523187abaf85976f19c" + resolved "https://codeload.github.com/LN-Zap/bolt11/tar.gz/7872de0f53a420d2b9c99c7022f7e94339d80682" dependencies: bech32 "^1.1.2" bitcoinjs-lib "^3.3.1" bn.js "^4.11.8" + coininfo cryptocoinjs/coininfo.git#c7e003b2fc0db165b89e6f98f6d6360ad22616b2 lodash "^4.17.4" safe-buffer "^5.1.1" secp256k1 "^3.4.0" @@ -5476,6 +5477,12 @@ code-point-at@^1.0.0: resolved "https://registry.yarnpkg.com/code-point-at/-/code-point-at-1.1.0.tgz#0d070b4d043a5bea33a2f1a40e2edb3d9a4ccf77" integrity sha1-DQcLTQQ6W+ozovGkDi7bPZpMz3c= +coininfo@cryptocoinjs/coininfo.git#c7e003b2fc0db165b89e6f98f6d6360ad22616b2: + version "4.3.0" + resolved "https://codeload.github.com/cryptocoinjs/coininfo/tar.gz/c7e003b2fc0db165b89e6f98f6d6360ad22616b2" + dependencies: + safe-buffer "^5.1.1" + collapse-white-space@^1.0.2: version "1.0.4" resolved "https://registry.yarnpkg.com/collapse-white-space/-/collapse-white-space-1.0.4.tgz#ce05cf49e54c3277ae573036a26851ba430a0091" From 31046310662cbd0356e937497af2efc9890781c4 Mon Sep 17 00:00:00 2001 From: Tom Kirkpatrick Date: Thu, 13 Dec 2018 11:57:07 +0100 Subject: [PATCH 6/7] style(icons): update chain icons --- app/components/Icon/Lightning.js | 5 ++--- app/components/Icon/Litecoin.js | 18 ++++++++++++++++-- app/icons/lightning.svg | 6 +++--- app/icons/litecoin.svg | 16 +++++++++++----- 4 files changed, 32 insertions(+), 13 deletions(-) diff --git a/app/components/Icon/Lightning.js b/app/components/Icon/Lightning.js index d26740ab6b4..e57028e4534 100644 --- a/app/components/Icon/Lightning.js +++ b/app/components/Icon/Lightning.js @@ -11,9 +11,8 @@ const SvgLightning = props => ( diff --git a/app/components/Icon/Litecoin.js b/app/components/Icon/Litecoin.js index 0e4cf33b5cc..7a0ca367977 100644 --- a/app/components/Icon/Litecoin.js +++ b/app/components/Icon/Litecoin.js @@ -1,8 +1,22 @@ import React from 'react' const SvgLitecoin = props => ( - - + + + + + + + + + + + ) diff --git a/app/icons/lightning.svg b/app/icons/lightning.svg index c565f089a32..c75fe7bee3c 100644 --- a/app/icons/lightning.svg +++ b/app/icons/lightning.svg @@ -1,12 +1,12 @@ - + - - + + diff --git a/app/icons/litecoin.svg b/app/icons/litecoin.svg index 87b54225f5e..c50a6091ba1 100644 --- a/app/icons/litecoin.svg +++ b/app/icons/litecoin.svg @@ -1,6 +1,12 @@ - - - - - + + + + + + + + + + + From 3e826f2f79cf1a65c72814a5de8df4327c294e51 Mon Sep 17 00:00:00 2001 From: Tom Kirkpatrick Date: Thu, 13 Dec 2018 13:05:49 +0100 Subject: [PATCH 7/7] feat(litecoin): add litecoin block explorer links --- app/lib/utils/crypto.js | 26 +++---- app/preload.js | 7 +- app/reducers/info.js | 75 ++++++++++++------- .../reducers/__snapshots__/info.spec.js.snap | 42 ++++++++++- test/unit/reducers/info.spec.js | 4 +- 5 files changed, 109 insertions(+), 45 deletions(-) diff --git a/app/lib/utils/crypto.js b/app/lib/utils/crypto.js index 71bb6599d64..e1249172448 100644 --- a/app/lib/utils/crypto.js +++ b/app/lib/utils/crypto.js @@ -3,6 +3,18 @@ import bech32 from 'lib/utils/bech32' import lightningRequestReq from 'bolt11' import coininfo from 'coininfo' +export const networks = { + bitcoin: { + mainnet: coininfo.bitcoin.main.toBitcoinJS(), + testnet: coininfo.bitcoin.test.toBitcoinJS(), + regtest: coininfo.bitcoin.regtest.toBitcoinJS() + }, + litecoin: { + mainnet: coininfo.litecoin.main.toBitcoinJS(), + testnet: coininfo.litecoin.test.toBitcoinJS() + } +} + export const decodePayReq = (payReq, addDefaults = true) => { const data = lightningRequestReq.decode(payReq) const expiry = data.tags.find(t => t.tagName === 'expire_time') @@ -79,20 +91,8 @@ export const isOnchain = (input, chain, network) => { return false } - const networkMap = { - bitcoin: { - mainnet: coininfo.bitcoin.main.toBitcoinJS(), - testnet: coininfo.bitcoin.test.toBitcoinJS(), - regtest: coininfo.bitcoin.regtest.toBitcoinJS() - }, - litecoin: { - mainnet: coininfo.litecoin.main.toBitcoinJS(), - testnet: coininfo.litecoin.test.toBitcoinJS() - } - } - try { - bitcoin.address.toOutputScript(input, networkMap[chain][network]) + bitcoin.address.toOutputScript(input, networks[chain][network]) return true } catch (e) { return false diff --git a/app/preload.js b/app/preload.js index 2f664d22e0d..0963b8634b3 100644 --- a/app/preload.js +++ b/app/preload.js @@ -9,7 +9,12 @@ const url = require('url') const fsReaddir = promisify(readdir) const fsRimraf = promisify(rimraf) -const WHITELISTED_DOMAINS = ['ln-zap.github.io', 'blockstream.info'] +const WHITELISTED_DOMAINS = [ + 'ln-zap.github.io', + 'blockstream.info', + 'testnet.litecore.io', + 'litecore.io' +] init() diff --git a/app/reducers/info.js b/app/reducers/info.js index c236591eee5..0872b9dbf63 100644 --- a/app/reducers/info.js +++ b/app/reducers/info.js @@ -1,7 +1,7 @@ -import bitcoin from 'bitcoinjs-lib' import { ipcRenderer } from 'electron' import get from 'lodash.get' import db from 'store/db' +import { networks } from 'lib/utils/crypto' import { walletAddress } from './address' import { putWallet, walletSelectors } from './wallet' @@ -12,6 +12,41 @@ export const GET_INFO = 'GET_INFO' export const RECEIVE_INFO = 'RECEIVE_INFO' export const SET_HAS_SYNCED = 'SET_HAS_SYNCED' +const networkInfo = { + bitcoin: { + mainnet: { + id: 'mainnet', + name: 'Mainnet', + explorerUrl: 'https://blockstream.info', + bitcoinJsNetwork: networks.bitcoin.mainnet, + unitPrefix: '' + }, + testnet: { + id: 'testnet', + name: 'Testnet', + explorerUrl: 'https://blockstream.info/testnet', + bitcoinJsNetwork: networks.bitcoin.testnet, + unitPrefix: 't' + } + }, + litecoin: { + mainnet: { + id: 'mainnet', + name: 'Mainnet', + explorerUrl: 'https://insight.litecore.io', + bitcoinJsNetwork: networks.litecoin.mainnet, + unitPrefix: '' + }, + testnet: { + id: 'testnet', + name: 'Testnet', + explorerUrl: 'https://testnet.litecore.io', + bitcoinJsNetwork: networks.litecoin.testnet, + unitPrefix: 't' + } + } +} + // ------------------------------------ // Actions // ------------------------------------ @@ -53,7 +88,7 @@ export const receiveInfo = (event, data) => async (dispatch, getState) => { // Update the active wallet settings with info discovered from getinfo. const wallet = walletSelectors.activeWalletSettings(state) const chain = get(data, 'chains[0]') - const network = data.testnet ? networks.testnet.id : networks.mainnet.id + const network = data.testnet ? 'testnet' : 'mainnet' if (wallet.chain !== chain || wallet.network !== network) { wallet.chain = chain wallet.network = network @@ -61,23 +96,6 @@ export const receiveInfo = (event, data) => async (dispatch, getState) => { } } -const networks = { - testnet: { - id: 'testnet', - name: 'Testnet', - explorerUrl: 'https://blockstream.info/testnet', - bitcoinJsNetwork: bitcoin.networks.testnet, - unitPrefix: 't' - }, - mainnet: { - id: 'mainnet', - name: 'Mainnet', - explorerUrl: 'https://blockstream.info', - bitcoinJsNetwork: bitcoin.networks.bitcoin, - unitPrefix: '' - } -} - // ------------------------------------ // Action Handlers // ------------------------------------ @@ -87,13 +105,18 @@ const ACTION_HANDLERS = { hasSynced }), [GET_INFO]: state => ({ ...state, infoLoading: true }), - [RECEIVE_INFO]: (state, { data }) => ({ - ...state, - infoLoading: false, - network: data.testnet ? networks.testnet : networks.mainnet, - chain: get(data, 'chains[0]'), - data - }) + [RECEIVE_INFO]: (state, { data }) => { + const chain = get(data, 'chains[0]') + const network = data.testnet ? 'testnet' : 'mainnet' + const networkData = get(networkInfo, `${chain}.${network}`) + return { + ...state, + infoLoading: false, + network: networkData, + chain, + data + } + } } // ------------------------------------ diff --git a/test/unit/reducers/__snapshots__/info.spec.js.snap b/test/unit/reducers/__snapshots__/info.spec.js.snap index 005d7a0c06d..89cdd2485ca 100644 --- a/test/unit/reducers/__snapshots__/info.spec.js.snap +++ b/test/unit/reducers/__snapshots__/info.spec.js.snap @@ -12,21 +12,55 @@ Object { exports[`reducers infoReducer should correctly receiveInfo 1`] = ` Object { - "chain": undefined, - "data": "foo", + "chain": "bitcoin", + "data": Object { + "chains": Array [ + "bitcoin", + ], + }, "hasSynced": undefined, "infoLoading": false, "network": Object { "bitcoinJsNetwork": Object { - "bech32": "bc", "bip32": Object { "private": 76066276, "public": 76067358, }, - "messagePrefix": "Bitcoin Signed Message: + "dustThreshold": null, + "hashGenesisBlock": "000000000019d6689c085ae165831e934ff763ae46a2a6c172b3f1b60a8ce26f", + "messagePrefix": "undefined Signed Message: ", + "name": "Bitcoin", + "per1": 100000000, + "port": 8333, + "portRpc": 8332, + "protocol": Object { + "magic": 3652501241, + }, "pubKeyHash": 0, "scriptHash": 5, + "seedsDns": Array [ + "seed.bitcoin.sipa.be", + "dnsseed.bluematt.me", + "dnsseed.bitcoin.dashjr.org", + "seed.bitcoinstats.com", + "bitseed.xf2.org", + "seed.bitcoin.jonasschnelli.ch", + ], + "testnet": false, + "toBitcoinJS": [Function], + "toBitcore": [Function], + "unit": "BTC", + "versions": Object { + "bip32": Object { + "private": 76066276, + "public": 76067358, + }, + "bip44": 0, + "private": 128, + "public": 0, + "scripthash": 5, + }, "wif": 128, }, "explorerUrl": "https://blockstream.info", diff --git a/test/unit/reducers/info.spec.js b/test/unit/reducers/info.spec.js index 9d11a936447..53a1a62a2e4 100644 --- a/test/unit/reducers/info.spec.js +++ b/test/unit/reducers/info.spec.js @@ -19,7 +19,9 @@ describe('reducers', () => { }) it('should correctly receiveInfo', () => { - expect(infoReducer(undefined, { type: RECEIVE_INFO, data: 'foo' })).toMatchSnapshot() + expect( + infoReducer(undefined, { type: RECEIVE_INFO, data: { chains: ['bitcoin'] } }) + ).toMatchSnapshot() }) }) })