From 825c9baa5d493e75fc1600f1a11d43e62b1a6ee1 Mon Sep 17 00:00:00 2001 From: naconner <7396812+naconner@users.noreply.github.com> Date: Sun, 8 Dec 2019 11:40:58 -0500 Subject: [PATCH 01/25] Update Infura credential naming --- schemas/infura.json | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/schemas/infura.json b/schemas/infura.json index 153a70fb..1c58f6f1 100644 --- a/schemas/infura.json +++ b/schemas/infura.json @@ -4,7 +4,7 @@ "fields": [ { "code": "apiKey", - "display": "API key", + "display": "Project ID", "fieldType": "string", "secret": true, "required": true, @@ -12,7 +12,7 @@ }, { "code": "apiSecret", - "display": "API secret", + "display": "Project secret", "fieldType": "password", "secret": true, "required": true, From 8e7b59bddc70de6f95c82ff9d74097bd0ea40189 Mon Sep 17 00:00:00 2001 From: naconner <7396812+naconner@users.noreply.github.com> Date: Wed, 18 Dec 2019 12:14:18 -0500 Subject: [PATCH 02/25] chore: version v7.4.6 --- package-lock.json | 2 +- package.json | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/package-lock.json b/package-lock.json index 97093932..e206df6e 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,6 +1,6 @@ { "name": "lamassu-server", - "version": "7.4.4", + "version": "7.4.6", "lockfileVersion": 1, "requires": true, "dependencies": { diff --git a/package.json b/package.json index 96e13249..252e2a7e 100644 --- a/package.json +++ b/package.json @@ -2,7 +2,7 @@ "name": "lamassu-server", "description": "bitcoin atm client server protocol module", "keywords": [], - "version": "7.4.4", + "version": "7.4.6", "license": "Unlicense", "author": "Lamassu (https://lamassu.is)", "dependencies": { From 1d0252133475e1aa6b08553c1bfdf00a5ec822d0 Mon Sep 17 00:00:00 2001 From: naconner <7396812+naconner@users.noreply.github.com> Date: Tue, 31 Dec 2019 16:10:31 -0500 Subject: [PATCH 03/25] Bitcoin ABC 0.20.9 getbalance compatibility change --- lib/plugins/wallet/bitcoincashd/bitcoincashd.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/plugins/wallet/bitcoincashd/bitcoincashd.js b/lib/plugins/wallet/bitcoincashd/bitcoincashd.js index e7c4e322..0a242791 100644 --- a/lib/plugins/wallet/bitcoincashd/bitcoincashd.js +++ b/lib/plugins/wallet/bitcoincashd/bitcoincashd.js @@ -27,7 +27,7 @@ function checkCryptoCode (cryptoCode) { function accountBalance (account, cryptoCode, confirmations) { return checkCryptoCode(cryptoCode) - .then(() => fetch('getbalance', ['', confirmations])) + .then(() => fetch('getbalance', ['*', confirmations])) .then(r => BN(r).shift(unitScale).round()) } From 6b26e65d28f9523a69e62b741653b82f9b7908f4 Mon Sep 17 00:00:00 2001 From: naconner <7396812+naconner@users.noreply.github.com> Date: Tue, 31 Dec 2019 16:20:14 -0500 Subject: [PATCH 04/25] Update BTC, BCH, ETH, DASH --- lib/blockchain/common.js | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/lib/blockchain/common.js b/lib/blockchain/common.js index 6162ec90..1c021ae6 100644 --- a/lib/blockchain/common.js +++ b/lib/blockchain/common.js @@ -21,19 +21,19 @@ module.exports = { const BINARIES = { BTC: { - url: 'https://bitcoin.org/bin/bitcoin-core-0.18.1/bitcoin-0.18.1-x86_64-linux-gnu.tar.gz', - dir: 'bitcoin-0.18.1/bin' + url: 'https://bitcoin.org/bin/bitcoin-core-0.19.0.1/bitcoin-0.19.0.1-x86_64-linux-gnu.tar.gz', + dir: 'bitcoin-0.19.0.1/bin' }, ETH: { - url: 'https://gethstore.blob.core.windows.net/builds/geth-linux-amd64-1.9.7-a718daa6.tar.gz', - dir: 'geth-linux-amd64-1.9.7-a718daa6' + url: 'https://gethstore.blob.core.windows.net/builds/geth-linux-amd64-1.9.9-01744997.tar.gz', + dir: 'geth-linux-amd64-1.9.9-01744997' }, ZEC: { url: 'https://z.cash/downloads/zcash-2.1.0-1-linux64-debian-jessie.tar.gz', dir: 'zcash-2.1.0-1/bin' }, DASH: { - url: 'https://github.com/dashpay/dash/releases/download/v0.14.0.3/dashcore-0.14.0.3-x86_64-linux-gnu.tar.gz', + url: 'https://github.com/dashpay/dash/releases/download/v0.14.0.5/dashcore-0.14.0.5-x86_64-linux-gnu.tar.gz', dir: 'dashcore-0.14.0/bin' }, LTC: { @@ -41,8 +41,8 @@ const BINARIES = { dir: 'litecoin-0.17.1/bin' }, BCH: { - url: 'https://download.bitcoinabc.org/0.20.5/linux/bitcoin-abc-0.20.5-x86_64-linux-gnu.tar.gz', - dir: 'bitcoin-abc-0.20.5/bin', + url: 'https://download.bitcoinabc.org/0.20.9/linux/bitcoin-abc-0.20.9-x86_64-linux-gnu.tar.gz', + dir: 'bitcoin-abc-0.20.9/bin', files: [['bitcoind', 'bitcoincashd'], ['bitcoin-cli', 'bitcoincash-cli']] } } From 8f5f40032c6be9a4b988daab120ab556f184737b Mon Sep 17 00:00:00 2001 From: naconner <7396812+naconner@users.noreply.github.com> Date: Wed, 15 Jan 2020 17:13:10 -0500 Subject: [PATCH 05/25] fix: downgrade BTC, BCH, LTC daemons BTC & LTC 0.17 and above change the account RPC such that unconfirmed deposits are not seen, and may affect availability of unconfirmed change. This happens on BCH 0.20.6 and above as well. Remain on older releases until new RPC calls are accounted for. --- lib/blockchain/common.js | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/lib/blockchain/common.js b/lib/blockchain/common.js index 1c021ae6..4224651f 100644 --- a/lib/blockchain/common.js +++ b/lib/blockchain/common.js @@ -21,8 +21,8 @@ module.exports = { const BINARIES = { BTC: { - url: 'https://bitcoin.org/bin/bitcoin-core-0.19.0.1/bitcoin-0.19.0.1-x86_64-linux-gnu.tar.gz', - dir: 'bitcoin-0.19.0.1/bin' + url: 'https://bitcoin.org/bin/bitcoin-core-0.16.3/bitcoin-0.16.3-x86_64-linux-gnu.tar.gz', + dir: 'bitcoin-0.16.3/bin' }, ETH: { url: 'https://gethstore.blob.core.windows.net/builds/geth-linux-amd64-1.9.9-01744997.tar.gz', @@ -37,12 +37,12 @@ const BINARIES = { dir: 'dashcore-0.14.0/bin' }, LTC: { - url: 'https://download.litecoin.org/litecoin-0.17.1/linux/litecoin-0.17.1-x86_64-linux-gnu.tar.gz', - dir: 'litecoin-0.17.1/bin' + url: 'https://download.litecoin.org/litecoin-0.16.3/linux/litecoin-0.16.3-x86_64-linux-gnu.tar.gz', + dir: 'litecoin-0.16.3/bin' }, BCH: { - url: 'https://download.bitcoinabc.org/0.20.9/linux/bitcoin-abc-0.20.9-x86_64-linux-gnu.tar.gz', - dir: 'bitcoin-abc-0.20.9/bin', + url: 'https://download.bitcoinabc.org/0.20.5/linux/bitcoin-abc-0.20.5-x86_64-linux-gnu.tar.gz', + dir: 'bitcoin-abc-0.20.5/bin', files: [['bitcoind', 'bitcoincashd'], ['bitcoin-cli', 'bitcoincash-cli']] } } From 77b678e9912860f49b04f779c12612f7ce549376 Mon Sep 17 00:00:00 2001 From: naconner <7396812+naconner@users.noreply.github.com> Date: Tue, 21 Jan 2020 15:20:34 -0500 Subject: [PATCH 06/25] feat: add fixed fee reporting to CAR --- lib/coinatmradar/coinatmradar.js | 2 ++ 1 file changed, 2 insertions(+) diff --git a/lib/coinatmradar/coinatmradar.js b/lib/coinatmradar/coinatmradar.js index 78acf983..1edddbd3 100644 --- a/lib/coinatmradar/coinatmradar.js +++ b/lib/coinatmradar/coinatmradar.js @@ -29,6 +29,7 @@ function mapCoin (info, deviceId, settings, cryptoCode) { const cashInFee = showRates ? cryptoConfig.cashInCommission / 100 : null const cashOutFee = showRates ? cryptoConfig.cashOutCommission / 100 : null + const cashInFixedFee = showRates ? cryptoConfig.cashInFee : null const cashInRate = showRates ? _.invoke('cashIn.toNumber', rates) : null const cashOutRate = showRates ? _.invoke('cashOut.toNumber', rates) : null @@ -36,6 +37,7 @@ function mapCoin (info, deviceId, settings, cryptoCode) { cryptoCode, cashInFee, cashOutFee, + cashInFixedFee, cashInRate, cashOutRate } From dc85afda13f5288f505d95229892da38bc09ce77 Mon Sep 17 00:00:00 2001 From: naconner <7396812+naconner@users.noreply.github.com> Date: Sun, 26 Jan 2020 11:32:04 -0500 Subject: [PATCH 07/25] chore: version v7.4.7 --- package-lock.json | 2 +- package.json | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/package-lock.json b/package-lock.json index e206df6e..bc6c81ea 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,6 +1,6 @@ { "name": "lamassu-server", - "version": "7.4.6", + "version": "7.4.7", "lockfileVersion": 1, "requires": true, "dependencies": { diff --git a/package.json b/package.json index 252e2a7e..201608fb 100644 --- a/package.json +++ b/package.json @@ -2,7 +2,7 @@ "name": "lamassu-server", "description": "bitcoin atm client server protocol module", "keywords": [], - "version": "7.4.6", + "version": "7.4.7", "license": "Unlicense", "author": "Lamassu (https://lamassu.is)", "dependencies": { From 22b4df54a04882895fe19f19bf6f669528facd53 Mon Sep 17 00:00:00 2001 From: Neal Conner <7396812+naconner@users.noreply.github.com> Date: Sat, 1 Feb 2020 19:00:44 -0500 Subject: [PATCH 08/25] chore: default to twilio and mailgun --- lamassu-schema.json | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/lamassu-schema.json b/lamassu-schema.json index 3169522c..1ad84fa0 100644 --- a/lamassu-schema.json +++ b/lamassu-schema.json @@ -846,7 +846,8 @@ "notificationsSMSEnabled", "cashOutEnabled" ], - "fieldValidation": [{"code": "required"}] + "fieldValidation": [{"code": "required"}], + "default": "twilio" }, { "code": "email", @@ -857,7 +858,8 @@ "enabledIfAny": [ "notificationsEmailEnabled" ], - "fieldValidation": [{"code": "required"}] + "fieldValidation": [{"code": "required"}], + "default": "mailgun" }, { "code": "coinAtmRadarActive", From 203b1a33e0e1965a745f08461fffbed6fc9b03e4 Mon Sep 17 00:00:00 2001 From: naconner <7396812+naconner@users.noreply.github.com> Date: Thu, 27 Feb 2020 17:22:05 -0500 Subject: [PATCH 09/25] chore: version v7.4.8 --- package-lock.json | 2 +- package.json | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/package-lock.json b/package-lock.json index bc6c81ea..3d90570f 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,6 +1,6 @@ { "name": "lamassu-server", - "version": "7.4.7", + "version": "7.4.8", "lockfileVersion": 1, "requires": true, "dependencies": { diff --git a/package.json b/package.json index 201608fb..5eac4578 100644 --- a/package.json +++ b/package.json @@ -2,7 +2,7 @@ "name": "lamassu-server", "description": "bitcoin atm client server protocol module", "keywords": [], - "version": "7.4.7", + "version": "7.4.8", "license": "Unlicense", "author": "Lamassu (https://lamassu.is)", "dependencies": { From 47e5e953329ea957261934838264256f5f5a3c9f Mon Sep 17 00:00:00 2001 From: Taranto Date: Mon, 24 Feb 2020 09:56:01 +0000 Subject: [PATCH 10/25] fix: prevent trading on tx rollback --- lib/cash-out/cash-out-atomic.js | 6 +----- lib/cash-out/cash-out-low.js | 2 +- lib/cash-out/cash-out-tx.js | 12 +++++++++--- 3 files changed, 11 insertions(+), 9 deletions(-) diff --git a/lib/cash-out/cash-out-atomic.js b/lib/cash-out/cash-out-atomic.js index 69854c19..f3365123 100644 --- a/lib/cash-out/cash-out-atomic.js +++ b/lib/cash-out/cash-out-atomic.js @@ -65,11 +65,7 @@ function preProcess (t, oldTx, newTx, pi) { .then(updatedTx => { if (updatedTx.status !== oldTx.status) { const isZeroConf = pi.isZeroConf(updatedTx) - if (wasJustAuthorized(oldTx, updatedTx, isZeroConf)) { - pi.sell(updatedTx) - pi.notifyOperator(updatedTx, { isRedemption: false }) - .catch((err) => logger.error('Failure sending transaction notification', err)) - } + updatedTx.justAuthorized = wasJustAuthorized(oldTx, updatedTx, isZeroConf) const rec = { to_address: updatedTx.toAddress, diff --git a/lib/cash-out/cash-out-low.js b/lib/cash-out/cash-out-low.js index b47f3c76..2f000c42 100644 --- a/lib/cash-out/cash-out-low.js +++ b/lib/cash-out/cash-out-low.js @@ -18,7 +18,7 @@ function upsert (t, oldTx, tx) { } return update(t, tx, diff(oldTx, tx)) - .then(newTx => [oldTx, newTx]) + .then(newTx => [oldTx, newTx, tx.justAuthorized]) } function insert (t, tx) { diff --git a/lib/cash-out/cash-out-tx.js b/lib/cash-out/cash-out-tx.js index 41ee2261..851f3a92 100644 --- a/lib/cash-out/cash-out-tx.js +++ b/lib/cash-out/cash-out-tx.js @@ -45,15 +45,21 @@ function selfPost (tx, pi) { function post (tx, pi, fromClient = true) { return db.tx(cashOutAtomic.atomic(tx, pi, fromClient)) .then(txVector => { - const [, newTx] = txVector - return postProcess(txVector, pi) + const [, newTx, justAuthorized] = txVector + return postProcess(txVector, justAuthorized, pi) .then(changes => cashOutLow.update(db, newTx, changes)) }) } -function postProcess (txVector, pi) { +function postProcess (txVector, justAuthorized, pi) { const [oldTx, newTx] = txVector + if (justAuthorized) { + pi.sell(newTx) + pi.notifyOperator(newTx, { isRedemption: false }) + .catch((err) => logger.error('Failure sending transaction notification', err)) + } + if ((newTx.dispense && !oldTx.dispense) || (newTx.redeem && !oldTx.redeem)) { return pi.buildAvailableCassettes(newTx.id) .then(cassettes => { From 1cdf29b1185b81a8313e51326e95363e5609c97b Mon Sep 17 00:00:00 2001 From: Neal Conner <7396812+naconner@users.noreply.github.com> Date: Thu, 20 Feb 2020 13:06:13 -0500 Subject: [PATCH 11/25] chore: update DASH, ZEC, ETH nodes; default to PrivateSend on DASH --- lib/blockchain/common.js | 12 ++++++------ lib/blockchain/dash.js | 4 +++- 2 files changed, 9 insertions(+), 7 deletions(-) diff --git a/lib/blockchain/common.js b/lib/blockchain/common.js index 4224651f..15df7156 100644 --- a/lib/blockchain/common.js +++ b/lib/blockchain/common.js @@ -25,16 +25,16 @@ const BINARIES = { dir: 'bitcoin-0.16.3/bin' }, ETH: { - url: 'https://gethstore.blob.core.windows.net/builds/geth-linux-amd64-1.9.9-01744997.tar.gz', - dir: 'geth-linux-amd64-1.9.9-01744997' + url: 'https://gethstore.blob.core.windows.net/builds/geth-linux-amd64-1.9.11-6a62fe39.tar.gz', + dir: 'geth-linux-amd64-1.9.11-6a62fe39' }, ZEC: { - url: 'https://z.cash/downloads/zcash-2.1.0-1-linux64-debian-jessie.tar.gz', - dir: 'zcash-2.1.0-1/bin' + url: 'https://z.cash/downloads/zcash-2.1.1-1-linux64-debian-jessie.tar.gz', + dir: 'zcash-2.1.1-1/bin' }, DASH: { - url: 'https://github.com/dashpay/dash/releases/download/v0.14.0.5/dashcore-0.14.0.5-x86_64-linux-gnu.tar.gz', - dir: 'dashcore-0.14.0/bin' + url: 'https://github.com/dashpay/dash/releases/download/v0.15.0.0/dashcore-0.15.0.0-x86_64-linux-gnu.tar.gz', + dir: 'dashcore-0.15.0/bin' }, LTC: { url: 'https://download.litecoin.org/litecoin-0.16.3/linux/litecoin-0.16.3-x86_64-linux-gnu.tar.gz', diff --git a/lib/blockchain/dash.js b/lib/blockchain/dash.js index 868734b3..8afb2f55 100644 --- a/lib/blockchain/dash.js +++ b/lib/blockchain/dash.js @@ -23,5 +23,7 @@ dbcache=500 keypool=10000 litemode=1 prune=4000 -txindex=0` +txindex=0 +enableprivatesend=1 +privatesendautostart=1` } From bf341476bbe418e75e4288557e21b6fa9c226720 Mon Sep 17 00:00:00 2001 From: naconner <7396812+naconner@users.noreply.github.com> Date: Wed, 15 Jan 2020 13:45:34 -0500 Subject: [PATCH 12/25] chore: change ETH language --- lib/blockchain/install.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/blockchain/install.js b/lib/blockchain/install.js index c4083f60..4ae45b0a 100644 --- a/lib/blockchain/install.js +++ b/lib/blockchain/install.js @@ -104,7 +104,7 @@ function run () { value: c.code, checked, disabled: c.cryptoCode === 'ETH' - ? 'Installed, use Infura option' + ? 'Use admin\'s Infura plugin' : checked && 'Installed' } }, cryptos) From fa69d2a030dea02299cd048d169bd2318257eb61 Mon Sep 17 00:00:00 2001 From: Taranto Date: Tue, 11 Feb 2020 21:06:30 +0000 Subject: [PATCH 13/25] hotfix: add fudge factor --- lamassu-admin-elm/src/NavBar.elm | 3 +- lamassu-schema.json | 17 + lib/cash-out/cash-out-helper.js | 23 +- lib/cash-out/cash-out-low.js | 3 +- lib/cash-out/cash-out-tx.js | 2 +- .../wallet/bitcoincashd/bitcoincashd.js | 8 +- lib/plugins/wallet/bitcoind/bitcoind.js | 8 +- lib/plugins/wallet/bitgo/bitgo.js | 8 +- lib/plugins/wallet/dashd/dashd.js | 8 +- lib/plugins/wallet/geth/base.js | 8 +- lib/plugins/wallet/litecoind/litecoind.js | 8 +- lib/plugins/wallet/mock-wallet/mock-wallet.js | 6 +- lib/plugins/wallet/zcashd/zcashd.js | 8 +- lib/tx.js | 4 +- lib/wallet.js | 9 +- .../1581455088977-add-amount-received.js | 13 + package-lock.json | 751 +++++++++++++----- public/elm.js | 12 +- 18 files changed, 650 insertions(+), 249 deletions(-) create mode 100644 migrations/1581455088977-add-amount-received.js diff --git a/lamassu-admin-elm/src/NavBar.elm b/lamassu-admin-elm/src/NavBar.elm index a0233995..ad94776a 100644 --- a/lamassu-admin-elm/src/NavBar.elm +++ b/lamassu-admin-elm/src/NavBar.elm @@ -156,7 +156,7 @@ determineConfigCategory : String -> Maybe Category determineConfigCategory configCode = if List.member configCode [ "definition", "setup", "cashOut", "commissions", "balanceAlerts" ] then Just MachineSettingsCat - else if List.member configCode [ "walletSettings", "notifications", "compliance", "coinAtmRadar", "terms", "operatorInfo" ] then + else if List.member configCode [ "walletSettings", "notifications", "compliance", "coinAtmRadar", "terms", "operatorInfo", "fudgeFactor" ] then Just GlobalSettingsCat else Nothing @@ -253,6 +253,7 @@ view route invalidGroups = , configLink "coinAtmRadar" "Coin ATM Radar" , configLink "terms" "Terms and Conditions" , configLink "operatorInfo" "Operator Info" + , configLink "fudgeFactor" "Fudge Factor" ] , ll ( "Third Party Services", AccountCat, AccountRoute "bitgo", True ) [ ( "BitGo", AccountRoute "bitgo", True ) diff --git a/lamassu-schema.json b/lamassu-schema.json index 1ad84fa0..2e41936a 100644 --- a/lamassu-schema.json +++ b/lamassu-schema.json @@ -147,6 +147,15 @@ "operatorInfoWebsite", "operatorInfoCompanyNumber" ] + }, + { + "code": "fudgeFactor", + "display": "Fudge Factor", + "cryptoScope": "global", + "machineScope": "global", + "fields": [ + "fudgeFactorActive" + ] } ], "fields": [ @@ -941,6 +950,14 @@ ], "fieldValidation": [] }, + { + "code": "fudgeFactorActive", + "displayBottom": "Enabled", + "fieldType": "onOff", + "fieldClass": null, + "fieldValidation": [], + "default": false + }, { "code": "operatorInfoActive", "displayBottom": "Info card enabled", diff --git a/lib/cash-out/cash-out-helper.js b/lib/cash-out/cash-out-helper.js index 7ce41156..8a3a37cb 100644 --- a/lib/cash-out/cash-out-helper.js +++ b/lib/cash-out/cash-out-helper.js @@ -11,14 +11,17 @@ module.exports = { redeemableTxs, toObj, toDb, REDEEMABLE_AGE } const mapValuesWithKey = _.mapValues.convert({cap: false}) function convertBigNumFields (obj) { - const convert = (value, key) => _.includes(key, [ - 'cryptoAtoms', - 'fiat', - 'commissionPercentage', - 'rawTickerPrice' - ]) - ? value.toString() - : value + const convert = (value, key) => { + if (_.includes(key, [ 'cryptoAtoms', 'receivedCryptoAtoms', 'fiat' ])) { + return value.toString() + } + + if (_.includes(key, [ 'commissionPercentage', 'rawTickerPrice' ]) && value) { + return value.toString() + } + + return value + } const convertKey = key => _.includes(key, ['cryptoAtoms', 'fiat']) ? key + '#' @@ -58,6 +61,10 @@ function toObj (row) { keys.forEach(key => { const objKey = _.camelCase(key) + if (key === 'received_crypto_atoms' && row[key]) { + newObj[objKey] = BN(row[key]) + return + } if (_.includes(key, ['crypto_atoms', 'fiat', 'commission_percentage', 'raw_ticker_price'])) { newObj[objKey] = BN(row[key]) return diff --git a/lib/cash-out/cash-out-low.js b/lib/cash-out/cash-out-low.js index 2f000c42..b5fdd22c 100644 --- a/lib/cash-out/cash-out-low.js +++ b/lib/cash-out/cash-out-low.js @@ -7,7 +7,8 @@ const toDb = helper.toDb const toObj = helper.toObj const UPDATEABLE_FIELDS = ['txHash', 'txVersion', 'status', 'dispense', 'dispenseConfirmed', - 'notified', 'redeem', 'phone', 'error', 'swept', 'publishedAt', 'confirmedAt', 'errorCode'] + 'notified', 'redeem', 'phone', 'error', 'swept', 'publishedAt', 'confirmedAt', 'errorCode', + 'receivedCryptoAtoms' ] module.exports = {upsert, update, insert} diff --git a/lib/cash-out/cash-out-tx.js b/lib/cash-out/cash-out-tx.js index 851f3a92..2a2ebac0 100644 --- a/lib/cash-out/cash-out-tx.js +++ b/lib/cash-out/cash-out-tx.js @@ -112,7 +112,7 @@ function processTxStatus (tx, settings) { const pi = plugins(settings, tx.deviceId) return pi.getStatus(tx) - .then(res => _.assign(tx, {status: res.status})) + .then(res => _.assign(tx, { receivedCryptoAtoms: res.receivedCryptoAtoms, status: res.status })) .then(_tx => selfPost(_tx, pi)) } diff --git a/lib/plugins/wallet/bitcoincashd/bitcoincashd.js b/lib/plugins/wallet/bitcoincashd/bitcoincashd.js index 0a242791..0ef29ede 100644 --- a/lib/plugins/wallet/bitcoincashd/bitcoincashd.js +++ b/lib/plugins/wallet/bitcoincashd/bitcoincashd.js @@ -80,13 +80,13 @@ function getStatus (account, toAddress, requested, cryptoCode) { return checkCryptoCode(cryptoCode) .then(() => confirmedBalance(toAddress, cryptoCode)) .then(confirmed => { - if (confirmed.gte(requested)) return {status: 'confirmed'} + if (confirmed.gte(requested)) return { receivedCryptoAtoms: confirmed, status: 'confirmed' } return pendingBalance(toAddress, cryptoCode) .then(pending => { - if (pending.gte(requested)) return {status: 'authorized'} - if (pending.gt(0)) return {status: 'insufficientFunds'} - return {status: 'notSeen'} + if (pending.gte(requested)) return { receivedCryptoAtoms: pending, status: 'authorized' } + if (pending.gt(0)) return { receivedCryptoAtoms: pending, status: 'insufficientFunds' } + return { receivedCryptoAtoms: pending, status: 'notSeen' } }) }) } diff --git a/lib/plugins/wallet/bitcoind/bitcoind.js b/lib/plugins/wallet/bitcoind/bitcoind.js index 68ed5a8d..a8fc91f2 100644 --- a/lib/plugins/wallet/bitcoind/bitcoind.js +++ b/lib/plugins/wallet/bitcoind/bitcoind.js @@ -80,13 +80,13 @@ function getStatus (account, toAddress, requested, cryptoCode) { return checkCryptoCode(cryptoCode) .then(() => confirmedBalance(toAddress, cryptoCode)) .then(confirmed => { - if (confirmed.gte(requested)) return {status: 'confirmed'} + if (confirmed.gte(requested)) return { receivedCryptoAtoms: confirmed, status: 'confirmed' } return pendingBalance(toAddress, cryptoCode) .then(pending => { - if (pending.gte(requested)) return {status: 'authorized'} - if (pending.gt(0)) return {status: 'insufficientFunds'} - return {status: 'notSeen'} + if (pending.gte(requested)) return { receivedCryptoAtoms: pending, status: 'authorized' } + if (pending.gt(0)) return { receivedCryptoAtoms: pending, status: 'insufficientFunds' } + return { receivedCryptoAtoms: pending, status: 'notSeen' } }) }) } diff --git a/lib/plugins/wallet/bitgo/bitgo.js b/lib/plugins/wallet/bitgo/bitgo.js index 60820efd..26b1c9db 100644 --- a/lib/plugins/wallet/bitgo/bitgo.js +++ b/lib/plugins/wallet/bitgo/bitgo.js @@ -124,10 +124,10 @@ function getStatus (account, toAddress, requested, cryptoCode) { const confirmed = _.compose(sum, toBn, filterConfirmed)(transfers) const pending = _.compose(sum, toBn, filterPending)(transfers) - if (confirmed.gte(requested)) return { status: 'confirmed' } - if (pending.gte(requested)) return { status: 'authorized' } - if (pending.gt(0)) return { status: 'insufficientFunds' } - return { status: 'notSeen' } + if (confirmed.gte(requested)) return { receivedCryptoAtoms: confirmed, status: 'confirmed' } + if (pending.gte(requested)) return { receivedCryptoAtoms: pending, status: 'authorized' } + if (pending.gt(0)) return { receivedCryptoAtoms: pending, status: 'insufficientFunds' } + return { receivedCryptoAtoms: pending, status: 'notSeen' } }) } diff --git a/lib/plugins/wallet/dashd/dashd.js b/lib/plugins/wallet/dashd/dashd.js index 8fec7587..4d664269 100644 --- a/lib/plugins/wallet/dashd/dashd.js +++ b/lib/plugins/wallet/dashd/dashd.js @@ -81,13 +81,13 @@ function getStatus (account, toAddress, requested, cryptoCode) { return checkCryptoCode(cryptoCode) .then(() => confirmedBalance(toAddress, cryptoCode)) .then(confirmed => { - if (confirmed.gte(requested)) return {status: 'confirmed'} + if (confirmed.gte(requested)) return { receivedCryptoAtoms: confirmed, status: 'confirmed' } return pendingBalance(toAddress, cryptoCode) .then(pending => { - if (pending.gte(requested)) return {status: 'authorized'} - if (pending.gt(0)) return {status: 'insufficientFunds'} - return {status: 'notSeen'} + if (pending.gte(requested)) return { receivedCryptoAtoms: pending, status: 'authorized' } + if (pending.gt(0)) return { receivedCryptoAtoms: pending, status: 'insufficientFunds' } + return { receivedCryptoAtoms: pending, status: 'notSeen' } }) }) } diff --git a/lib/plugins/wallet/geth/base.js b/lib/plugins/wallet/geth/base.js index 381bf90d..0e8b8dfa 100644 --- a/lib/plugins/wallet/geth/base.js +++ b/lib/plugins/wallet/geth/base.js @@ -158,13 +158,13 @@ function getStatus (account, toAddress, cryptoAtoms, cryptoCode) { return checkCryptoCode(cryptoCode) .then(() => confirmedBalance(toAddress)) .then(confirmed => { - if (confirmed.gte(cryptoAtoms)) return {status: 'confirmed'} + if (confirmed.gte(cryptoAtoms)) return { receivedCryptoAtoms: confirmed, status: 'confirmed' } return pendingBalance(toAddress) .then(pending => { - if (pending.gte(cryptoAtoms)) return {status: 'published'} - if (pending.gt(0)) return {status: 'insufficientFunds'} - return {status: 'notSeen'} + if (pending.gte(cryptoAtoms)) return { receivedCryptoAtoms: pending, status: 'published' } + if (pending.gt(0)) return { receivedCryptoAtoms: pending, status: 'insufficientFunds' } + return { receivedCryptoAtoms: pending, status: 'notSeen' } }) }) } diff --git a/lib/plugins/wallet/litecoind/litecoind.js b/lib/plugins/wallet/litecoind/litecoind.js index 1c8dba56..fc4c9bce 100644 --- a/lib/plugins/wallet/litecoind/litecoind.js +++ b/lib/plugins/wallet/litecoind/litecoind.js @@ -81,13 +81,13 @@ function getStatus (account, toAddress, requested, cryptoCode) { return checkCryptoCode(cryptoCode) .then(() => confirmedBalance(toAddress, cryptoCode)) .then(confirmed => { - if (confirmed.gte(requested)) return {status: 'confirmed'} + if (confirmed.gte(requested)) return { receivedCryptoAtoms: confirmed, status: 'confirmed' } return pendingBalance(toAddress, cryptoCode) .then(pending => { - if (pending.gte(requested)) return {status: 'authorized'} - if (pending.gt(0)) return {status: 'insufficientFunds'} - return {status: 'notSeen'} + if (pending.gte(requested)) return { receivedCryptoAtoms: pending, status: 'authorized' } + if (pending.gt(0)) return { receivedCryptoAtoms: pending, status: 'insufficientFunds' } + return { receivedCryptoAtoms: pending, status: 'notSeen' } }) }) } diff --git a/lib/plugins/wallet/mock-wallet/mock-wallet.js b/lib/plugins/wallet/mock-wallet/mock-wallet.js index 2a15e7b0..eea9b3b4 100644 --- a/lib/plugins/wallet/mock-wallet/mock-wallet.js +++ b/lib/plugins/wallet/mock-wallet/mock-wallet.js @@ -79,9 +79,9 @@ function newFunding (account, cryptoCode) { function getStatus (account, toAddress, cryptoAtoms, cryptoCode) { const elapsed = Date.now() - t0 - if (elapsed < PUBLISH_TIME) return Promise.resolve({status: 'notSeen'}) - if (elapsed < AUTHORIZE_TIME) return Promise.resolve({status: 'published'}) - if (elapsed < CONFIRM_TIME) return Promise.resolve({status: 'authorized'}) + if (elapsed < PUBLISH_TIME) return Promise.resolve({ receivedCryptoAtoms: cryptoAtoms - 10, status: 'notSeen' }) + if (elapsed < AUTHORIZE_TIME) return Promise.resolve({ receivedCryptoAtoms: cryptoAtoms - 10, status: 'published' }) + if (elapsed < CONFIRM_TIME) return Promise.resolve({ receivedCryptoAtoms: null, status: 'authorized' }) console.log('[%s] DEBUG: Mock wallet has confirmed transaction [%s]', cryptoCode, toAddress.slice(0, 5)) diff --git a/lib/plugins/wallet/zcashd/zcashd.js b/lib/plugins/wallet/zcashd/zcashd.js index 25618fe7..1f9e7656 100644 --- a/lib/plugins/wallet/zcashd/zcashd.js +++ b/lib/plugins/wallet/zcashd/zcashd.js @@ -81,13 +81,13 @@ function getStatus (account, toAddress, requested, cryptoCode) { return checkCryptoCode(cryptoCode) .then(() => confirmedBalance(toAddress, cryptoCode)) .then(confirmed => { - if (confirmed.gte(requested)) return {status: 'confirmed'} + if (confirmed.gte(requested)) return { receivedCryptoAtoms: confirmed, status: 'confirmed' } return pendingBalance(toAddress, cryptoCode) .then(pending => { - if (pending.gte(requested)) return {status: 'authorized'} - if (pending.gt(0)) return {status: 'insufficientFunds'} - return {status: 'notSeen'} + if (pending.gte(requested)) return { receivedCryptoAtoms: pending, status: 'authorized' } + if (pending.gt(0)) return { receivedCryptoAtoms: pending, status: 'insufficientFunds' } + return { receivedCryptoAtoms: pending, status: 'notSeen' } }) }) } diff --git a/lib/tx.js b/lib/tx.js index 32eb3366..9d290ce5 100644 --- a/lib/tx.js +++ b/lib/tx.js @@ -29,13 +29,13 @@ function massage (tx, pi) { cashInFee: BN(r.cashInFee), cashInFeeCrypto: BN(r.cashInFeeCrypto), commissionPercentage: BN(r.commissionPercentage), - rawTickerPrice: BN(r.rawTickerPrice), + rawTickerPrice: r.rawTickerPrice ? BN(r.rawTickerPrice) : null, minimumTx: BN(r.minimumTx) } : { cryptoAtoms: BN(r.cryptoAtoms), fiat: BN(r.fiat), - rawTickerPrice: BN(r.rawTickerPrice), + rawTickerPrice: r.rawTickerPrice ? BN(r.rawTickerPrice) : null, commissionPercentage: BN(r.commissionPercentage) } diff --git a/lib/wallet.js b/lib/wallet.js index 0e069f8c..4fc8e0de 100644 --- a/lib/wallet.js +++ b/lib/wallet.js @@ -104,7 +104,7 @@ function mergeStatus (a, b) { if (!a) return b if (!b) return a - return { status: mergeStatusMode(a.status, b.status) } + return { receivedCryptoAtoms: a.receivedCryptoAtoms, status: mergeStatusMode(a.status, b.status) } } function mergeStatusMode (a, b) { @@ -122,8 +122,11 @@ function mergeStatusMode (a, b) { } function getWalletStatus (settings, tx) { + const fudgeFactorEnabled = configManager.unscoped(settings.config).fudgeFactor + const fudgeFactor = fudgeFactorEnabled ? 10 : 0 + const walletStatusPromise = fetchWallet(settings, tx.cryptoCode) - .then(r => r.wallet.getStatus(r.account, tx.toAddress, tx.cryptoAtoms, tx.cryptoCode)) + .then(r => r.wallet.getStatus(r.account, tx.toAddress, tx.cryptoAtoms.add(fudgeFactor), tx.cryptoCode)) return Promise.all([ walletStatusPromise, @@ -170,7 +173,7 @@ function getStatus (settings, tx, machineId) { const status = isAuthorized ? 'authorized' : unauthorizedStatus - return { status } + return { receivedCryptoAtoms: statusRec.receivedCryptoAtoms, status } }) } diff --git a/migrations/1581455088977-add-amount-received.js b/migrations/1581455088977-add-amount-received.js new file mode 100644 index 00000000..89c27426 --- /dev/null +++ b/migrations/1581455088977-add-amount-received.js @@ -0,0 +1,13 @@ +const db = require('./db') + +exports.up = function (next) { + var sql = [ + 'ALTER TABLE cash_out_txs ADD COLUMN received_crypto_atoms numeric(30) null DEFAULT null' + ] + + db.multi(sql, next) +} + +exports.down = function (next) { + next() +} diff --git a/package-lock.json b/package-lock.json index 3d90570f..6bb7963b 100644 --- a/package-lock.json +++ b/package-lock.json @@ -76,14 +76,14 @@ "integrity": "sha1-lksiHLlV4csPBEdnqWaCgCOjhLs=" }, "@types/lodash": { - "version": "4.14.118", - "resolved": "https://registry.npmjs.org/@types/lodash/-/lodash-4.14.118.tgz", - "integrity": "sha512-iiJbKLZbhSa6FYRip/9ZDX6HXhayXLDGY2Fqws9cOkEQ6XeKfaxB0sC541mowZJueYyMnVUmmG+al5/4fCDrgw==" + "version": "4.14.149", + "resolved": "https://registry.npmjs.org/@types/lodash/-/lodash-4.14.149.tgz", + "integrity": "sha512-ijGqzZt/b7BfzcK9vTrS6MFljQRPn5BFWOx8oE0GYxribu6uV+aA9zZuXI1zc/etK9E8nrgdoF2+LgUw7+9tJQ==" }, "@types/node": { - "version": "10.12.9", - "resolved": "https://registry.npmjs.org/@types/node/-/node-10.12.9.tgz", - "integrity": "sha512-eajkMXG812/w3w4a1OcBlaTwsFPO5F7fJ/amy+tieQxEMWBlbV1JGSjkFM+zkHNf81Cad+dfIRA+IBkvmvdAeA==" + "version": "13.7.0", + "resolved": "https://registry.npmjs.org/@types/node/-/node-13.7.0.tgz", + "integrity": "sha512-GnZbirvmqZUzMgkFn70c74OQpTTUcCzlhQliTzYjQMqg+hVKcDnxdL19Ne3UdYzdMA/+W3eb646FWn/ZaT1NfQ==" }, "@types/ws": { "version": "3.2.1", @@ -132,9 +132,9 @@ "integrity": "sha1-/ts5T58OAqqXaOcCvaI7UF+ufh8=" }, "agent-base": { - "version": "4.2.1", - "resolved": "https://registry.npmjs.org/agent-base/-/agent-base-4.2.1.tgz", - "integrity": "sha512-JVwXMr9nHYTUXsBFKUqhJwvlcYU/blreOEUkhNR2eXZIvwd+c+o5V4MgDPKWnMS/56awN3TRzIP+KoPn+roQtg==", + "version": "4.3.0", + "resolved": "https://registry.npmjs.org/agent-base/-/agent-base-4.3.0.tgz", + "integrity": "sha512-salcGninV0nPrwpGNn4VTXBb1SOuXQBiqbrNXoeizJsHrsL6ERFM2Ne3JUSBWRE6aeNJI2ROP/WEEIDUiDe3cg==", "requires": { "es6-promisify": "^5.0.0" } @@ -388,9 +388,9 @@ "dev": true }, "async-limiter": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/async-limiter/-/async-limiter-1.0.0.tgz", - "integrity": "sha512-jp/uFnooOiO+L211eZOoSyzpOITMXx1rBITauYykG3BRYPu8h0UcxsPNB04RR5vo4Tyz3+ay17tR6JVf9qzYWg==" + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/async-limiter/-/async-limiter-1.0.1.tgz", + "integrity": "sha512-csOlWGAcRFJaI6m+F2WKdnMKr4HhdhFVBk0H/QbJFMCr+uO2kwohwXQPxw/9OCxp05r5ghVBFSyioixx3gfkNQ==" }, "asynckit": { "version": "0.4.0", @@ -1252,9 +1252,9 @@ } }, "safe-buffer": { - "version": "5.1.2", - "resolved": "https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.1.2.tgz", - "integrity": "sha512-Gd2UZBJDkXlY7GbJxfsE8/nvKkUEU1G38c1siN6QP6a9PT9MmHB8GnpscSmMJSoF8LOIrt8ud/wPtojys4G6+g==" + "version": "5.2.0", + "resolved": "https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.2.0.tgz", + "integrity": "sha512-fZEwUGbVl7kouZs1jCdMLdt95hdIv0ZeHg6L7qPeciMZhZ+/gdesW4wgTARkrFWEpspjEATAzUGPG8N2jJiwbg==" } } }, @@ -1289,9 +1289,9 @@ } }, "safe-buffer": { - "version": "5.1.2", - "resolved": "https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.1.2.tgz", - "integrity": "sha512-Gd2UZBJDkXlY7GbJxfsE8/nvKkUEU1G38c1siN6QP6a9PT9MmHB8GnpscSmMJSoF8LOIrt8ud/wPtojys4G6+g==" + "version": "5.2.0", + "resolved": "https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.2.0.tgz", + "integrity": "sha512-fZEwUGbVl7kouZs1jCdMLdt95hdIv0ZeHg6L7qPeciMZhZ+/gdesW4wgTARkrFWEpspjEATAzUGPG8N2jJiwbg==" } } }, @@ -1372,58 +1372,63 @@ } }, "bitgo": { - "version": "4.40.2", - "resolved": "https://registry.npmjs.org/bitgo/-/bitgo-4.40.2.tgz", - "integrity": "sha512-rQY92xdUaI1yKGyBmlAk6/uoLUj4H13Jla0g+q8Hmw30rniX1QUF7Kfwe7KsmIb/JnVse3Kt5omqg6PYQQIl2A==", + "version": "4.47.0", + "resolved": "https://registry.npmjs.org/bitgo/-/bitgo-4.47.0.tgz", + "integrity": "sha512-reh8M5UMMRLnUzWo0qY+SyDQmM+LNXnVjwb4S78r2lukdszmSHX+JWl2T7t5hyelJyFXF/5ySAxj6SYpHTiChQ==", "requires": { - "argparse": "~1.0.10", + "argparse": "1.0.10", "assert": "0.4.9", - "big.js": "~3.1.3", + "big.js": "3.1.3", "bigi": "1.4.0", - "bignumber.js": "~4.0.2", - "bitcoinjs-message": "~2.0.0", - "bitgo-utxo-lib": "^1.2.1", - "bluebird": "~3.5.0", - "body-parser": "~1.18.2", + "bignumber.js": "8.0.1", + "bitcoinjs-message": "2.0.0", + "bitgo-utxo-lib": "1.3.0", + "bluebird": "3.5.3", + "body-parser": "1.18.3", "bs58": "2.0.1", "bs58check": "1.0.4", "cashaddress": "1.1.0", - "create-hmac": "~1.1.4", - "debug": "~3.1.0", - "ecurve": "~1.0.2", + "create-hmac": "1.1.7", + "debug": "3.1.0", + "ecurve": "1.0.6", "eol": "0.5.0", - "ethereumjs-abi": "~0.6.2", - "ethereumjs-tx": "^1.3.4", - "ethereumjs-util": "~4.4.1", - "express": "~4.16.2", + "ethereumjs-abi": "0.6.5", + "ethereumjs-tx": "1.3.7", + "ethereumjs-util": "4.4.1", + "express": "4.16.4", "http-proxy": "1.11.1", - "lodash": "~4.17.10", + "lodash": "4.17.11", "minimist": "0.2.0", - "moment": "~2.20.1", - "morgan": "1.9.0", - "prova-lib": "0.2.9", - "ripple-lib": "~0.22.0", + "moment": "2.20.1", + "morgan": "1.9.1", + "prova-lib": "0.2.10", + "ripple-lib": "0.22.0", "sanitize-html": "1.13.0", - "secp256k1": "3.2.5", + "secp256k1": "3.6.1", "secrets.js-grempe": "1.1.0", - "stellar-sdk": "~0.11.0", - "superagent": "~3.8.3", - "superagent-proxy": "~1.0.0" + "stellar-sdk": "0.11.0", + "superagent": "3.8.3", + "superagent-proxy": "1.0.3" }, "dependencies": { "accepts": { - "version": "1.3.5", - "resolved": "https://registry.npmjs.org/accepts/-/accepts-1.3.5.tgz", - "integrity": "sha1-63d99gEXI6OxTopywIBcjoZ0a9I=", + "version": "1.3.7", + "resolved": "https://registry.npmjs.org/accepts/-/accepts-1.3.7.tgz", + "integrity": "sha512-Il80Qs2WjYlJIBNzNkK6KYqlVMTbZLXgHx2oT0pU/fjRHyEp+PEfEPY0R3WCwAGVOtauxh1hOxNgIf5bv7dQpA==", "requires": { - "mime-types": "~2.1.18", - "negotiator": "0.6.1" + "mime-types": "~2.1.24", + "negotiator": "0.6.2" } }, "bignumber.js": { - "version": "4.0.4", - "resolved": "https://registry.npmjs.org/bignumber.js/-/bignumber.js-4.0.4.tgz", - "integrity": "sha512-LDXpJKVzEx2/OqNbG9mXBNvHuiRL4PzHCGfnANHMJ+fv68Ads3exDVJeGDJws+AoNEuca93bU3q+S0woeUaCdg==" + "version": "8.0.1", + "resolved": "https://registry.npmjs.org/bignumber.js/-/bignumber.js-8.0.1.tgz", + "integrity": "sha512-zAySveTJXkgLYCBi0b14xzfnOs+f3G6x36I8w2a1+PFQpWk/dp0mI0F+ZZK2bu+3ELewDcSyP+Cfq++NcHX7sg==" + }, + "bluebird": { + "version": "3.5.3", + "resolved": "https://registry.npmjs.org/bluebird/-/bluebird-3.5.3.tgz", + "integrity": "sha512-/qKPUQlaW1OyR51WeCPBvRnAlnZFUJkCSG5HzGnuIqhgyJtF+T94lFnn33eiazjRm2LAHVy2guNnaq48X9SJuw==" }, "body-parser": { "version": "1.18.3", @@ -1462,6 +1467,19 @@ "resolved": "https://registry.npmjs.org/content-type/-/content-type-1.0.4.tgz", "integrity": "sha512-hIP3EEPs8tB9AT1L+NUqtwOAps4mk2Zob89MWXMHjHWg9milF/j4osnnQLXBCBFBk/tvIG/tUc9mOUJiPBhPXA==" }, + "create-hmac": { + "version": "1.1.7", + "resolved": "https://registry.npmjs.org/create-hmac/-/create-hmac-1.1.7.tgz", + "integrity": "sha512-MJG9liiZ+ogc4TzUwuvbER1JRdgvUFSB5+VR/g5h82fGaIRWMWddtKBHi7/sVhfjQZ6SehlyhvQYrcYkaUIpLg==", + "requires": { + "cipher-base": "^1.0.3", + "create-hash": "^1.1.0", + "inherits": "^2.0.1", + "ripemd160": "^2.0.0", + "safe-buffer": "^5.0.1", + "sha.js": "^2.4.8" + } + }, "debug": { "version": "3.1.0", "resolved": "https://registry.npmjs.org/debug/-/debug-3.1.0.tgz", @@ -1584,7 +1602,7 @@ }, "finalhandler": { "version": "1.1.1", - "resolved": "http://registry.npmjs.org/finalhandler/-/finalhandler-1.1.1.tgz", + "resolved": "https://registry.npmjs.org/finalhandler/-/finalhandler-1.1.1.tgz", "integrity": "sha512-Y1GUDo39ez4aHAw7MysnUD5JzYX+WaIj8I57kO3aEPT1fFRL4sr7mjei97FgnwhAyyzRYmQZaTHb2+9uZ1dPtg==", "requires": { "debug": "2.6.9", @@ -1618,7 +1636,7 @@ }, "http-errors": { "version": "1.6.3", - "resolved": "http://registry.npmjs.org/http-errors/-/http-errors-1.6.3.tgz", + "resolved": "https://registry.npmjs.org/http-errors/-/http-errors-1.6.3.tgz", "integrity": "sha1-i1VoC7S+KDoLW/TqLjhYC+HZMg0=", "requires": { "depd": "~1.1.2", @@ -1635,17 +1653,22 @@ "safer-buffer": ">= 2.1.2 < 3" } }, + "lodash": { + "version": "4.17.11", + "resolved": "https://registry.npmjs.org/lodash/-/lodash-4.17.11.tgz", + "integrity": "sha512-cQKh8igo5QUhZ7lg38DYWAxMvjSAKG0A8wGSVimP07SIUEK2UO+arSRKbRZWtelMtN5V0Hkwh5ryOto/SshYIg==" + }, "mime-db": { - "version": "1.37.0", - "resolved": "https://registry.npmjs.org/mime-db/-/mime-db-1.37.0.tgz", - "integrity": "sha512-R3C4db6bgQhlIhPU48fUtdVmKnflq+hRdad7IyKhtFj06VPNVdk2RhiYL3UjQIlso8L+YxAtFkobT0VK+S/ybg==" + "version": "1.43.0", + "resolved": "https://registry.npmjs.org/mime-db/-/mime-db-1.43.0.tgz", + "integrity": "sha512-+5dsGEEovYbT8UY9yD7eE4XTc4UwJ1jBYlgaQQF38ENsKR3wj/8q8RFZrF9WIZpB2V1ArTVFUva8sAul1NzRzQ==" }, "mime-types": { - "version": "2.1.21", - "resolved": "https://registry.npmjs.org/mime-types/-/mime-types-2.1.21.tgz", - "integrity": "sha512-3iL6DbwpyLzjR3xHSFNFeb9Nz/M8WDkX33t1GFQnFOllWk8pOrh/LSrB5OXlnlW5P9LH73X6loW/eogc+F5lJg==", + "version": "2.1.26", + "resolved": "https://registry.npmjs.org/mime-types/-/mime-types-2.1.26.tgz", + "integrity": "sha512-01paPWYgLrkqAyrlDorC1uDwl2p3qZT7yl806vW7DvDoxwXi46jsjFbg+WdwotBIk6/MbEhO/dh5aZ5sNj/dWQ==", "requires": { - "mime-db": "~1.37.0" + "mime-db": "1.43.0" } }, "minimist": { @@ -1659,13 +1682,13 @@ "integrity": "sha512-Yh9y73JRljxW5QxN08Fner68eFLxM5ynNOAw2LbIB1YAGeQzZT8QFSUvkAz609Zf+IHhhaUxqZK8dG3W/+HEvg==" }, "morgan": { - "version": "1.9.0", - "resolved": "https://registry.npmjs.org/morgan/-/morgan-1.9.0.tgz", - "integrity": "sha1-0B+mxlhZt2/PMbPLU6OCGjEdgFE=", + "version": "1.9.1", + "resolved": "https://registry.npmjs.org/morgan/-/morgan-1.9.1.tgz", + "integrity": "sha512-HQStPIV4y3afTiCYVxirakhlCfGkI161c76kKFca7Fk1JusM//Qeo1ej2XaMniiNeaZklMVrh3vTtIzpzwbpmA==", "requires": { "basic-auth": "~2.0.0", "debug": "2.6.9", - "depd": "~1.1.1", + "depd": "~1.1.2", "on-finished": "~2.3.0", "on-headers": "~1.0.1" }, @@ -1680,10 +1703,15 @@ } } }, + "negotiator": { + "version": "0.6.2", + "resolved": "https://registry.npmjs.org/negotiator/-/negotiator-0.6.2.tgz", + "integrity": "sha512-hZXc7K2e+PgeI1eDBe/10Ard4ekbfrrqG8Ep+8Jmf4JID2bNg7NvCPOZN+kfF574pFQI7mum2AUqDidoKqcTOw==" + }, "parseurl": { - "version": "1.3.2", - "resolved": "https://registry.npmjs.org/parseurl/-/parseurl-1.3.2.tgz", - "integrity": "sha1-/CidTtiZMRlGDBViUyYs3I3mW/M=" + "version": "1.3.3", + "resolved": "https://registry.npmjs.org/parseurl/-/parseurl-1.3.3.tgz", + "integrity": "sha512-CiyeOxFT/JZyN5m0z9PfXw4SCBJ6Sygz1Dpl0wqjlhDEGGBP1GnsUVEL0p63hoG1fcj3fHynXi9NYO4nWOL+qQ==" }, "qs": { "version": "6.5.2", @@ -1701,6 +1729,22 @@ "unpipe": "1.0.0" } }, + "secp256k1": { + "version": "3.6.1", + "resolved": "https://registry.npmjs.org/secp256k1/-/secp256k1-3.6.1.tgz", + "integrity": "sha512-utLpWv4P4agEw7hakR73wlWX0NBmC5t/vkJ0TAfTyvETAUzo0tm6aFKPYetVYRaVubxMeWm5Ekv9ETwOgcDCqw==", + "optional": true, + "requires": { + "bindings": "^1.2.1", + "bip66": "^1.1.3", + "bn.js": "^4.11.3", + "create-hash": "^1.1.2", + "drbg.js": "^1.0.1", + "elliptic": "^6.2.3", + "nan": "^2.2.1", + "safe-buffer": "^5.1.0" + } + }, "serve-static": { "version": "1.13.2", "resolved": "https://registry.npmjs.org/serve-static/-/serve-static-1.13.2.tgz", @@ -1723,12 +1767,12 @@ "integrity": "sha1-Fhx9rBd2Wf2YEfQ3cfqZOBR4Yow=" }, "type-is": { - "version": "1.6.16", - "resolved": "https://registry.npmjs.org/type-is/-/type-is-1.6.16.tgz", - "integrity": "sha512-HRkVv/5qY2G6I8iab9cI7v1bOIdhm94dVjQCPFElW9W+3GeDOSHmy2EBYe4VTApuzolPcmgFTN3ftVJRKR2J9Q==", + "version": "1.6.18", + "resolved": "https://registry.npmjs.org/type-is/-/type-is-1.6.18.tgz", + "integrity": "sha512-TkRKr9sUTxEH8MdfuCSP7VizJyzRNMjj2J2do2Jr3Kym598JVdEksuzPQCnlFPW4ky9Q+iA+ma9BGm06XQBy8g==", "requires": { "media-typer": "0.3.0", - "mime-types": "~2.1.18" + "mime-types": "~2.1.24" } }, "utils-merge": { @@ -1744,9 +1788,9 @@ } }, "bitgo-utxo-lib": { - "version": "1.2.1", - "resolved": "https://registry.npmjs.org/bitgo-utxo-lib/-/bitgo-utxo-lib-1.2.1.tgz", - "integrity": "sha512-8qwcU4HZEGAInXYntkCiZwfeFFQ6cwWOVb8+VwEMnoQb+TCNIRh1BFxfJ79ZHrzSGZ+L951HqdzKW5XhFb9E6Q==", + "version": "1.3.0", + "resolved": "https://registry.npmjs.org/bitgo-utxo-lib/-/bitgo-utxo-lib-1.3.0.tgz", + "integrity": "sha512-jry6Y97g2jr1XlY1Ou5WkWUg1rQbyioLYp9AgyK4OwZ7t2ETRyTB1rcJV9kYOlTnTjC6k+Sef+IKcZLM/u9zjA==", "requires": { "bech32": "0.0.3", "bigi": "^1.4.0", @@ -1762,11 +1806,26 @@ "pushdata-bitcoin": "^1.0.1", "randombytes": "^2.0.1", "safe-buffer": "^5.0.1", + "secp256k1": "^3.5.2", "typeforce": "^1.11.3", "varuint-bitcoin": "^1.0.4", "wif": "^2.0.1" }, "dependencies": { + "bindings": { + "version": "1.5.0", + "resolved": "https://registry.npmjs.org/bindings/-/bindings-1.5.0.tgz", + "integrity": "sha512-p2q/t/mhvuOj/UeLlV6566GD/guowlr0hHxClI0W9m7MWYkL1F0hLo+0Aexs9HSPCtR1SXQ0TD3MMKrXZajbiQ==", + "optional": true, + "requires": { + "file-uri-to-path": "1.0.0" + } + }, + "bn.js": { + "version": "4.11.8", + "resolved": "https://registry.npmjs.org/bn.js/-/bn.js-4.11.8.tgz", + "integrity": "sha512-ItfYfPLkWHUjckQCk8xC+LwxgK8NYcXywGigJgSwOP8Y2iyWT4f2vsZnoOXTTbo+o5yXmIUJ4gn5538SO5S3gA==" + }, "bs58": { "version": "4.0.1", "resolved": "https://registry.npmjs.org/bs58/-/bs58-4.0.1.tgz", @@ -1786,9 +1845,9 @@ }, "dependencies": { "safe-buffer": { - "version": "5.1.2", - "resolved": "https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.1.2.tgz", - "integrity": "sha512-Gd2UZBJDkXlY7GbJxfsE8/nvKkUEU1G38c1siN6QP6a9PT9MmHB8GnpscSmMJSoF8LOIrt8ud/wPtojys4G6+g==" + "version": "5.2.0", + "resolved": "https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.2.0.tgz", + "integrity": "sha512-fZEwUGbVl7kouZs1jCdMLdt95hdIv0ZeHg6L7qPeciMZhZ+/gdesW4wgTARkrFWEpspjEATAzUGPG8N2jJiwbg==" } } }, @@ -1799,6 +1858,70 @@ "requires": { "ms": "2.0.0" } + }, + "elliptic": { + "version": "6.5.2", + "resolved": "https://registry.npmjs.org/elliptic/-/elliptic-6.5.2.tgz", + "integrity": "sha512-f4x70okzZbIQl/NSRLkI/+tteV/9WqL98zx+SQ69KbXxmVrmjwsNUPn/gYJJ0sHvEak24cZgHIPegRePAtA/xw==", + "optional": true, + "requires": { + "bn.js": "^4.4.0", + "brorand": "^1.0.1", + "hash.js": "^1.0.0", + "hmac-drbg": "^1.0.0", + "inherits": "^2.0.1", + "minimalistic-assert": "^1.0.0", + "minimalistic-crypto-utils": "^1.0.0" + } + }, + "file-uri-to-path": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/file-uri-to-path/-/file-uri-to-path-1.0.0.tgz", + "integrity": "sha512-0Zt+s3L7Vf1biwWZ29aARiVYLx7iMGnEUl9x33fbB/j3jR81u/O2LbqK+Bm1CDSNDKVtJ/YjwY7TUd5SkeLQLw==", + "optional": true + }, + "nan": { + "version": "2.14.0", + "resolved": "https://registry.npmjs.org/nan/-/nan-2.14.0.tgz", + "integrity": "sha512-INOFj37C7k3AfaNTtX8RhsTw7qRy7eLET14cROi9+5HAVbbHuIWUHEauBv5qT4Av2tWasiTY1Jw6puUNqRJXQg==", + "optional": true + }, + "secp256k1": { + "version": "3.8.0", + "resolved": "https://registry.npmjs.org/secp256k1/-/secp256k1-3.8.0.tgz", + "integrity": "sha512-k5ke5avRZbtl9Tqx/SA7CbY3NF6Ro+Sj9cZxezFzuBlLDmyqPiL8hJJ+EmzD8Ig4LUDByHJ3/iPOVoRixs/hmw==", + "optional": true, + "requires": { + "bindings": "^1.5.0", + "bip66": "^1.1.5", + "bn.js": "^4.11.8", + "create-hash": "^1.2.0", + "drbg.js": "^1.0.1", + "elliptic": "^6.5.2", + "nan": "^2.14.0", + "safe-buffer": "^5.1.2" + }, + "dependencies": { + "create-hash": { + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/create-hash/-/create-hash-1.2.0.tgz", + "integrity": "sha512-z00bCGNHDG8mHAkP7CtT1qVu+bFQUPjYq/4Iv3C3kWjTFV10zIjfSoeqXo9Asws8gwSHDGj/hl2u4OGIjapeCg==", + "optional": true, + "requires": { + "cipher-base": "^1.0.1", + "inherits": "^2.0.1", + "md5.js": "^1.3.4", + "ripemd160": "^2.0.1", + "sha.js": "^2.4.0" + } + }, + "safe-buffer": { + "version": "5.2.0", + "resolved": "https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.2.0.tgz", + "integrity": "sha512-fZEwUGbVl7kouZs1jCdMLdt95hdIv0ZeHg6L7qPeciMZhZ+/gdesW4wgTARkrFWEpspjEATAzUGPG8N2jJiwbg==", + "optional": true + } + } } } }, @@ -1841,7 +1964,8 @@ "bluebird": { "version": "3.5.0", "resolved": "https://registry.npmjs.org/bluebird/-/bluebird-3.5.0.tgz", - "integrity": "sha1-eRQg1/VR7qKJdFOop3ZT+WYG1nw=" + "integrity": "sha1-eRQg1/VR7qKJdFOop3ZT+WYG1nw=", + "dev": true }, "bn.js": { "version": "4.11.7", @@ -2938,7 +3062,6 @@ "version": "1.1.3", "resolved": "https://registry.npmjs.org/define-properties/-/define-properties-1.1.3.tgz", "integrity": "sha512-3MqfYKj2lLzdMSf8ZIZE/V+Zuy+BgD6f164e8K2w7dgnpKArBDerGYpM46IYYcjnkdPNMjPk9A6VFB8+3SKlXQ==", - "dev": true, "requires": { "object-keys": "^1.0.12" } @@ -3043,25 +3166,30 @@ } }, "dom-serializer": { - "version": "0.1.0", - "resolved": "https://registry.npmjs.org/dom-serializer/-/dom-serializer-0.1.0.tgz", - "integrity": "sha1-BzxpdUbOB4DOI75KKOKT5AvDDII=", + "version": "0.2.2", + "resolved": "https://registry.npmjs.org/dom-serializer/-/dom-serializer-0.2.2.tgz", + "integrity": "sha512-2/xPb3ORsQ42nHYiSunXkDjPLBaEj/xTwUO4B7XCZQTRk7EBtTOPaygh10YAAh2OI1Qrp6NWfpAhzswj0ydt9g==", "requires": { - "domelementtype": "~1.1.1", - "entities": "~1.1.1" + "domelementtype": "^2.0.1", + "entities": "^2.0.0" }, "dependencies": { "domelementtype": { - "version": "1.1.3", - "resolved": "https://registry.npmjs.org/domelementtype/-/domelementtype-1.1.3.tgz", - "integrity": "sha1-vSh3PiZCiBrsUVRJJCmcXNgiGFs=" + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/domelementtype/-/domelementtype-2.0.1.tgz", + "integrity": "sha512-5HOHUDsYZWV8FGWN0Njbr/Rn7f/eWSQi1v7+HsUVwXgn8nWWlL64zKDkS0n8ZmQ3mlWOMuXOnR+7Nx/5tMO5AQ==" + }, + "entities": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/entities/-/entities-2.0.0.tgz", + "integrity": "sha512-D9f7V0JSRwIxlRI2mjMqufDrRDnx8p+eEOz7aUM9SuvF8gsBzra0/6tbjl1m8eQHrZlYj6PxqE00hZ1SAIKPLw==" } } }, "domelementtype": { - "version": "1.3.0", - "resolved": "https://registry.npmjs.org/domelementtype/-/domelementtype-1.3.0.tgz", - "integrity": "sha1-sXrtguirWeUt2cGbF1bg/BhyBMI=" + "version": "1.3.1", + "resolved": "https://registry.npmjs.org/domelementtype/-/domelementtype-1.3.1.tgz", + "integrity": "sha512-BSKB+TSpMpFI/HOxCNr1O8aMOTZ8hT3pM3GQ0w/mWRmkhEDSFJkkyzz4XQsBV44BChwGkrDfMyjVD0eA2aFV3w==" }, "domhandler": { "version": "2.4.2", @@ -4546,9 +4674,9 @@ "integrity": "sha1-+8cfDEGt6zf5bFd60e1C2P2sypE=" }, "form-data": { - "version": "2.3.3", - "resolved": "https://registry.npmjs.org/form-data/-/form-data-2.3.3.tgz", - "integrity": "sha512-1lLKB2Mu3aGP1Q/2eCOx0fNbRMe7XdwktwOruhfqqd0rIJWwN4Dh+E3hrPSlDCXnSR7UtZ1N38rVXm+6+MEhJQ==", + "version": "2.5.1", + "resolved": "https://registry.npmjs.org/form-data/-/form-data-2.5.1.tgz", + "integrity": "sha512-m21N3WOmEEURgk6B9GLOE4RuWOFf28Lhh9qGYeNlGq4VDXUlJy2th2slBNU8Gp8EzloYZOibZJ7t5ecIrFSjVA==", "requires": { "asynckit": "^0.4.0", "combined-stream": "^1.0.6", @@ -4556,9 +4684,9 @@ }, "dependencies": { "combined-stream": { - "version": "1.0.7", - "resolved": "https://registry.npmjs.org/combined-stream/-/combined-stream-1.0.7.tgz", - "integrity": "sha512-brWl9y6vOB1xYPZcpZde3N9zDByXTosAeMDo4p1wzo6UMOX4vumB+TP1RZ76sfE6Md68Q0NJSrE/gbezd4Ul+w==", + "version": "1.0.8", + "resolved": "https://registry.npmjs.org/combined-stream/-/combined-stream-1.0.8.tgz", + "integrity": "sha512-FQN4MRfuJeHf7cBbBMJFXhKSDq+2kAArBlmRBvcvFE5BB1HZKXtSFASDhdlz9zOYwxh8lDdnvmMOe/+5cdoEdg==", "requires": { "delayed-stream": "~1.0.0" } @@ -5079,8 +5207,7 @@ "function-bind": { "version": "1.1.1", "resolved": "https://registry.npmjs.org/function-bind/-/function-bind-1.1.1.tgz", - "integrity": "sha512-yIovAzMX49sF8Yl58fSCWJ5svSLuaibPxXQJFLmBObTuCr0Mf1KiPopGM9NiFjiYBCbfaa2Fh6breQ6ANVTI0A==", - "dev": true + "integrity": "sha512-yIovAzMX49sF8Yl58fSCWJ5svSLuaibPxXQJFLmBObTuCr0Mf1KiPopGM9NiFjiYBCbfaa2Fh6breQ6ANVTI0A==" }, "functional-red-black-tree": { "version": "1.0.1", @@ -5695,7 +5822,6 @@ "version": "1.0.3", "resolved": "https://registry.npmjs.org/has/-/has-1.0.3.tgz", "integrity": "sha512-f2dvO0VU6Oej7RkWJGrehjbzMAjFp5/VKPp5tTpWIV4JHHZK1/BxbFRtf/siA2SWTe09caDmVtYYzWEIbBS4zw==", - "dev": true, "requires": { "function-bind": "^1.1.1" } @@ -5748,8 +5874,7 @@ "has-symbols": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/has-symbols/-/has-symbols-1.0.0.tgz", - "integrity": "sha1-uhqPGvKg/DllD1yFA2dwQSIGO0Q=", - "dev": true + "integrity": "sha1-uhqPGvKg/DllD1yFA2dwQSIGO0Q=" }, "has-to-string-tag-x": { "version": "1.2.0", @@ -5913,34 +6038,39 @@ "integrity": "sha1-DfKTUfByEWNRXfueVUPl9u7VFi8=" }, "htmlparser2": { - "version": "3.10.0", - "resolved": "https://registry.npmjs.org/htmlparser2/-/htmlparser2-3.10.0.tgz", - "integrity": "sha512-J1nEUGv+MkXS0weHNWVKJJ+UrLfePxRWpN3C9bEi9fLxL2+ggW94DQvgYVXsaT30PGwYRIZKNZXuyMhp3Di4bQ==", + "version": "3.10.1", + "resolved": "https://registry.npmjs.org/htmlparser2/-/htmlparser2-3.10.1.tgz", + "integrity": "sha512-IgieNijUMbkDovyoKObU1DUhm1iwNYE/fuifEoEHfd1oZKZDaONBSkal7Y01shxsM49R4XaMdGez3WnF9UfiCQ==", "requires": { - "domelementtype": "^1.3.0", + "domelementtype": "^1.3.1", "domhandler": "^2.3.0", "domutils": "^1.5.1", "entities": "^1.1.1", "inherits": "^2.0.1", - "readable-stream": "^3.0.6" + "readable-stream": "^3.1.1" }, "dependencies": { "readable-stream": { - "version": "3.0.6", - "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-3.0.6.tgz", - "integrity": "sha512-9E1oLoOWfhSXHGv6QlwXJim7uNzd9EVlWK+21tCU9Ju/kR0/p2AZYPz4qSchgO8PlLIH4FpZYfzwS+rEksZjIg==", + "version": "3.5.0", + "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-3.5.0.tgz", + "integrity": "sha512-gSz026xs2LfxBPudDuI41V1lka8cxg64E66SGe78zJlsUofOg/yqwezdIcdfwik6B4h8LFmWPA9ef9X3FiNFLA==", "requires": { "inherits": "^2.0.3", "string_decoder": "^1.1.1", "util-deprecate": "^1.0.1" } }, + "safe-buffer": { + "version": "5.2.0", + "resolved": "https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.2.0.tgz", + "integrity": "sha512-fZEwUGbVl7kouZs1jCdMLdt95hdIv0ZeHg6L7qPeciMZhZ+/gdesW4wgTARkrFWEpspjEATAzUGPG8N2jJiwbg==" + }, "string_decoder": { - "version": "1.1.1", - "resolved": "https://registry.npmjs.org/string_decoder/-/string_decoder-1.1.1.tgz", - "integrity": "sha512-n/ShnvDi6FHbbVfviro+WojiFzv+s8MPMHBczVePfUpDJLwoLT0ht1l4YwBCbi8pJAveEEdnkHyPyTP/mzRfwg==", + "version": "1.3.0", + "resolved": "https://registry.npmjs.org/string_decoder/-/string_decoder-1.3.0.tgz", + "integrity": "sha512-hkRX8U1WjJFd8LsDJ2yQ/wWWxaopEsABU1XfkM8A+j0+85JAGppt16cr1Whg6KIbb4okU6Mql6BOj+uup/wKeA==", "requires": { - "safe-buffer": "~5.1.0" + "safe-buffer": "~5.2.0" } } } @@ -6012,9 +6142,9 @@ } }, "ms": { - "version": "2.1.1", - "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.1.tgz", - "integrity": "sha512-tgp+dl5cGk28utYktBsrFqA7HKgrhgPsg6Z/EfhWI4gl1Hwq8B/GmY/0oXZ6nF8hDVesS/FpnYaD/kOWhYQvyg==" + "version": "2.1.2", + "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.2.tgz", + "integrity": "sha512-sGkPx+VjMtmA6MX27oA4FBFELFCZZ4S4XqeGOXCv68tT+jb3vk/RyaKWP0PTKyWtmLSM0b+adUTEvbs1PEaH2w==" } } }, @@ -6246,9 +6376,9 @@ "integrity": "sha1-vd7XARQpCCjAoDnnLvJfWq7ENUo=" }, "ipaddr.js": { - "version": "1.8.0", - "resolved": "https://registry.npmjs.org/ipaddr.js/-/ipaddr.js-1.8.0.tgz", - "integrity": "sha1-6qM9bd16zo9/b+DJygRA5wZzix4=" + "version": "1.9.0", + "resolved": "https://registry.npmjs.org/ipaddr.js/-/ipaddr.js-1.9.0.tgz", + "integrity": "sha512-M4Sjn6N/+O6/IXSJseKqHoFc+5FdGJ22sXqnjTpdZweHK64MzEPAyQZyEU3R/KRv2GLoa7nNtg/C2Ev6m7z+eA==" }, "irregular-plurals": { "version": "1.2.0", @@ -6256,6 +6386,11 @@ "integrity": "sha1-OPKZg0uowAwwvpxVThNyaXUv86w=", "dev": true }, + "is-arguments": { + "version": "1.0.4", + "resolved": "https://registry.npmjs.org/is-arguments/-/is-arguments-1.0.4.tgz", + "integrity": "sha512-xPh0Rmt8NE65sNzvyUmWgI1tz3mKq74lGA0mL8LYZcoIzKOzDh6HmrYm3d18k60nHerC8A9Km8kYu87zfSFnLA==" + }, "is-arrayish": { "version": "0.2.1", "resolved": "https://registry.npmjs.org/is-arrayish/-/is-arrayish-0.2.1.tgz", @@ -6303,8 +6438,7 @@ "is-date-object": { "version": "1.0.1", "resolved": "https://registry.npmjs.org/is-date-object/-/is-date-object-1.0.1.tgz", - "integrity": "sha1-mqIOtq7rv/d/vTPnTKAbM1gdOhY=", - "dev": true + "integrity": "sha1-mqIOtq7rv/d/vTPnTKAbM1gdOhY=" }, "is-dotfile": { "version": "1.0.3", @@ -6361,6 +6495,11 @@ "integrity": "sha1-lp1J4bszKfa7fwkIm+JleLLd1Go=", "dev": true }, + "is-generator-function": { + "version": "1.0.7", + "resolved": "https://registry.npmjs.org/is-generator-function/-/is-generator-function-1.0.7.tgz", + "integrity": "sha512-YZc5EwyO4f2kWCax7oegfuSr9mFz1ZvieNYBEjmukLxgXfBUbxAWGVF7GZf0zidYtoBl3WvC07YK0wT76a+Rtw==" + }, "is-glob": { "version": "2.0.1", "resolved": "https://registry.npmjs.org/is-glob/-/is-glob-2.0.1.tgz", @@ -6483,7 +6622,6 @@ "version": "1.0.2", "resolved": "https://registry.npmjs.org/is-symbol/-/is-symbol-1.0.2.tgz", "integrity": "sha512-HS8bZ9ox60yCJLH9snBpIwv9pYUAkcuLhSA1oero1UB5y9aiQpRA8y2ex945AOtCZL1lJDeIk3G5LthswI46Lw==", - "dev": true, "requires": { "has-symbols": "^1.0.0" } @@ -6658,15 +6796,21 @@ "dev": true }, "js-xdr": { - "version": "1.0.5", - "resolved": "https://registry.npmjs.org/js-xdr/-/js-xdr-1.0.5.tgz", - "integrity": "sha512-v0jffMa8bko3uFcGYt1lHrtpd1adhH6qk41RfLPsNPj77/K8fi7LOi4+lUUY3MBEIFnJgaGHrbc6sxdTwHImxQ==", + "version": "1.1.3", + "resolved": "https://registry.npmjs.org/js-xdr/-/js-xdr-1.1.3.tgz", + "integrity": "sha512-zFg7dIc6lI7LiZ/eru5U/cOur/SJGkbKflgkwoFIiHewgpmBGsRJNKbeOh/8Ffzz5mYvfmsO6gHAe5wv/ZYM2g==", "requires": { + "core-js": "^2.6.3", "cursor": "^0.1.5", "lodash": "^4.17.5", "long": "^2.2.3" }, "dependencies": { + "core-js": { + "version": "2.6.11", + "resolved": "https://registry.npmjs.org/core-js/-/core-js-2.6.11.tgz", + "integrity": "sha512-5wjnpaT/3dV+XB4borEsnAYQchn00XSgTAWKDkEqv+K8KevjbzmofK6hfJ9TZIlpj2N0xQpazy7PiRQiWHqzWg==" + }, "long": { "version": "2.4.0", "resolved": "https://registry.npmjs.org/long/-/long-2.4.0.tgz", @@ -7061,9 +7205,9 @@ "integrity": "sha1-TjNms55/VFfjXxMkvfb4jQv8cwY=" }, "lru-cache": { - "version": "4.1.3", - "resolved": "https://registry.npmjs.org/lru-cache/-/lru-cache-4.1.3.tgz", - "integrity": "sha512-fFEhvcgzuIoJVUF8fYr5KR0YqxD238zgObTps31YdADwPPAp82a4M8TrckkWyx7ekNlf9aBcVn81cFwwXngrJA==", + "version": "4.1.5", + "resolved": "https://registry.npmjs.org/lru-cache/-/lru-cache-4.1.5.tgz", + "integrity": "sha512-sWZlbEP2OsHNkXrMl5GYk/jKk70MBng6UU4YI/qGDYbgf6YbP4EvmqISbXCoJiRKs+1bSpFHVgQxvJ17F2li5g==", "requires": { "pseudomap": "^1.0.2", "yallist": "^2.1.2" @@ -7276,6 +7420,34 @@ "integrity": "sha1-givM1l4RfFFPqxdrJZRdVBAKA8M=", "dev": true }, + "md5.js": { + "version": "1.3.5", + "resolved": "https://registry.npmjs.org/md5.js/-/md5.js-1.3.5.tgz", + "integrity": "sha512-xitP+WxNPcTTOgnTJcrhM0xvdPepipPSf3I8EIpGKeFLjt3PlJLIDG3u8EX53ZIubkb+5U2+3rELYpEhHhzdkg==", + "optional": true, + "requires": { + "hash-base": "^3.0.0", + "inherits": "^2.0.1", + "safe-buffer": "^5.1.2" + }, + "dependencies": { + "hash-base": { + "version": "3.0.4", + "resolved": "https://registry.npmjs.org/hash-base/-/hash-base-3.0.4.tgz", + "integrity": "sha1-X8hoaEfs1zSZQDMZprCj8/auSRg=", + "optional": true, + "requires": { + "inherits": "^2.0.1", + "safe-buffer": "^5.0.1" + } + }, + "safe-buffer": { + "version": "5.2.0", + "resolved": "https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.2.0.tgz", + "integrity": "sha512-fZEwUGbVl7kouZs1jCdMLdt95hdIv0ZeHg6L7qPeciMZhZ+/gdesW4wgTARkrFWEpspjEATAzUGPG8N2jJiwbg==" + } + } + }, "media-typer": { "version": "0.3.0", "resolved": "https://registry.npmjs.org/media-typer/-/media-typer-0.3.0.tgz", @@ -7700,11 +7872,90 @@ "resolved": "https://registry.npmjs.org/object-component/-/object-component-0.0.3.tgz", "integrity": "sha1-8MaapQ78lbhmwYb0AKM3acsvEpE=" }, + "object-inspect": { + "version": "1.7.0", + "resolved": "https://registry.npmjs.org/object-inspect/-/object-inspect-1.7.0.tgz", + "integrity": "sha512-a7pEHdh1xKIAgTySUGgLMx/xwDZskN1Ud6egYYN3EdRW4ZMPNEDUTF+hwy2LUC+Bl+SyLXANnwz/jyh/qutKUw==" + }, "object-keys": { "version": "1.0.12", "resolved": "https://registry.npmjs.org/object-keys/-/object-keys-1.0.12.tgz", - "integrity": "sha512-FTMyFUm2wBcGHnH2eXmz7tC6IwlqQZ6mVZ+6dm6vZ4IQIHjs6FdNsQBuKGPuUUUY6NfJw2PshC08Tn6LzLDOag==", - "dev": true + "integrity": "sha512-FTMyFUm2wBcGHnH2eXmz7tC6IwlqQZ6mVZ+6dm6vZ4IQIHjs6FdNsQBuKGPuUUUY6NfJw2PshC08Tn6LzLDOag==" + }, + "object.assign": { + "version": "4.1.0", + "resolved": "https://registry.npmjs.org/object.assign/-/object.assign-4.1.0.tgz", + "integrity": "sha512-exHJeq6kBKj58mqGyTQ9DFvrZC/eR6OwxzoM9YRoGBqrXYonaFyGiFMuc9VZrXf7DarreEwMpurG3dd+CNyW5w==", + "requires": { + "define-properties": "^1.1.2", + "function-bind": "^1.1.1", + "has-symbols": "^1.0.0", + "object-keys": "^1.0.11" + } + }, + "object.entries": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/object.entries/-/object.entries-1.1.1.tgz", + "integrity": "sha512-ilqR7BgdyZetJutmDPfXCDffGa0/Yzl2ivVNpbx/g4UeWrCdRnFDUBrKJGLhGieRHDATnyZXWBeCb29k9CJysQ==", + "requires": { + "define-properties": "^1.1.3", + "es-abstract": "^1.17.0-next.1", + "function-bind": "^1.1.1", + "has": "^1.0.3" + }, + "dependencies": { + "es-abstract": { + "version": "1.17.4", + "resolved": "https://registry.npmjs.org/es-abstract/-/es-abstract-1.17.4.tgz", + "integrity": "sha512-Ae3um/gb8F0mui/jPL+QiqmglkUsaQf7FwBEHYIFkztkneosu9imhqHpBzQ3h1vit8t5iQ74t6PEVvphBZiuiQ==", + "requires": { + "es-to-primitive": "^1.2.1", + "function-bind": "^1.1.1", + "has": "^1.0.3", + "has-symbols": "^1.0.1", + "is-callable": "^1.1.5", + "is-regex": "^1.0.5", + "object-inspect": "^1.7.0", + "object-keys": "^1.1.1", + "object.assign": "^4.1.0", + "string.prototype.trimleft": "^2.1.1", + "string.prototype.trimright": "^2.1.1" + } + }, + "es-to-primitive": { + "version": "1.2.1", + "resolved": "https://registry.npmjs.org/es-to-primitive/-/es-to-primitive-1.2.1.tgz", + "integrity": "sha512-QCOllgZJtaUo9miYBcLChTUaHNjJF3PYs1VidD7AwiEj1kYxKeQTctLAezAOH5ZKRH0g2IgPn6KwB4IT8iRpvA==", + "requires": { + "is-callable": "^1.1.4", + "is-date-object": "^1.0.1", + "is-symbol": "^1.0.2" + } + }, + "has-symbols": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/has-symbols/-/has-symbols-1.0.1.tgz", + "integrity": "sha512-PLcsoqu++dmEIZB+6totNFKq/7Do+Z0u4oT0zKOJNl3lYK6vGwwu2hjHs+68OEZbTjiUE9bgOABXbP/GvrS0Kg==" + }, + "is-callable": { + "version": "1.1.5", + "resolved": "https://registry.npmjs.org/is-callable/-/is-callable-1.1.5.tgz", + "integrity": "sha512-ESKv5sMCJB2jnHTWZ3O5itG+O128Hsus4K4Qh1h2/cgn2vbgnLSVqfV46AeJA9D5EeeLa9w81KUXMtn34zhX+Q==" + }, + "is-regex": { + "version": "1.0.5", + "resolved": "https://registry.npmjs.org/is-regex/-/is-regex-1.0.5.tgz", + "integrity": "sha512-vlKW17SNq44owv5AQR3Cq0bQPEb8+kF3UKZ2fiZNOWtztYE5i0CzCZxFDwO58qAOWtxdBRVO/V5Qin1wjCqFYQ==", + "requires": { + "has": "^1.0.3" + } + }, + "object-keys": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/object-keys/-/object-keys-1.1.1.tgz", + "integrity": "sha512-NuAESUOUMrlIXOfHKzD6bpPu3tYt3xvjNdRIQ+FeT0lNb4K8WR70CaDxhuNguS2XG+GjkyMwOzsN5ZktImfhLA==" + } + } }, "object.omit": { "version": "2.0.1", @@ -7902,9 +8153,9 @@ } }, "ms": { - "version": "2.1.1", - "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.1.tgz", - "integrity": "sha512-tgp+dl5cGk28utYktBsrFqA7HKgrhgPsg6Z/EfhWI4gl1Hwq8B/GmY/0oXZ6nF8hDVesS/FpnYaD/kOWhYQvyg==" + "version": "2.1.2", + "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.2.tgz", + "integrity": "sha512-sGkPx+VjMtmA6MX27oA4FBFELFCZZ4S4XqeGOXCv68tT+jb3vk/RyaKWP0PTKyWtmLSM0b+adUTEvbs1PEaH2w==" } } }, @@ -8520,9 +8771,9 @@ } }, "prova-lib": { - "version": "0.2.9", - "resolved": "https://registry.npmjs.org/prova-lib/-/prova-lib-0.2.9.tgz", - "integrity": "sha512-YaulnI8L3LozBjwy64afOYmQdz2SzMiZgGvhHSU1BA7TIH8VlHZVN5/PrZ4roKS9tOPT7rl5A0C4RB63BlnVow==", + "version": "0.2.10", + "resolved": "https://registry.npmjs.org/prova-lib/-/prova-lib-0.2.10.tgz", + "integrity": "sha512-L1K1BiBteuTL4Q/gyMROmPI4BJVG2KsmEkhmQEOKQw5SA3D54UC3iG6u+DSZKW7nvjsTPSbpzDzaCOmSgtTGuA==", "requires": { "bigi": "~1.4.2", "bitcoin-ops": "~1.3.0", @@ -8530,7 +8781,7 @@ "bs58check": "~2.0.1", "ecurve": "~1.0.5", "lodash": "~4.17.4", - "secp256k1": "~3.3.0", + "secp256k1": "~3.5.0", "typeforce": "~1.10.6", "varuint-bitcoin": "~1.0.4" }, @@ -8563,9 +8814,9 @@ } }, "secp256k1": { - "version": "3.3.1", - "resolved": "https://registry.npmjs.org/secp256k1/-/secp256k1-3.3.1.tgz", - "integrity": "sha512-lygjgfjzjBHblEDDkppUF5KK1EeVk6P/Dv2MsJZpYIR3vW5TKFRexOFkf0hHy9J5YxEpjQZ6x98Y3XQpMQO/vA==", + "version": "3.5.2", + "resolved": "https://registry.npmjs.org/secp256k1/-/secp256k1-3.5.2.tgz", + "integrity": "sha512-iin3kojdybY6NArd+UFsoTuapOF7bnJNf2UbcWXaY3z+E1sJDipl60vtzB5hbO/uquBu7z0fd4VC4Irp+xoFVQ==", "optional": true, "requires": { "bindings": "^1.2.1", @@ -8575,7 +8826,6 @@ "drbg.js": "^1.0.1", "elliptic": "^6.2.3", "nan": "^2.2.1", - "prebuild-install": "^2.0.0", "safe-buffer": "^5.1.0" } }, @@ -8595,12 +8845,12 @@ } }, "proxy-addr": { - "version": "2.0.4", - "resolved": "https://registry.npmjs.org/proxy-addr/-/proxy-addr-2.0.4.tgz", - "integrity": "sha512-5erio2h9jp5CHGwcybmxmVqHmnCBZeewlfJ0pex+UW7Qny7OOZXTtH56TGNyBizkgiOwhJtMKrVzDTeKcySZwA==", + "version": "2.0.5", + "resolved": "https://registry.npmjs.org/proxy-addr/-/proxy-addr-2.0.5.tgz", + "integrity": "sha512-t/7RxHXPH6cJtP0pRG6smSr9QJidhB+3kXu0KgXnbGYMgzEnUxRQ4/LDdfOwZEMyIh3/xHb8PX3t+lfL9z+YVQ==", "requires": { "forwarded": "~0.1.2", - "ipaddr.js": "1.8.0" + "ipaddr.js": "1.9.0" }, "dependencies": { "forwarded": { @@ -8612,7 +8862,7 @@ }, "proxy-agent": { "version": "2.3.1", - "resolved": "http://registry.npmjs.org/proxy-agent/-/proxy-agent-2.3.1.tgz", + "resolved": "https://registry.npmjs.org/proxy-agent/-/proxy-agent-2.3.1.tgz", "integrity": "sha512-CNKuhC1jVtm8KJYFTS2ZRO71VCBx3QSA92So/e6NrY6GoJonkx3Irnk4047EsCcswczwqAekRj3s8qLRGahSKg==", "requires": { "agent-base": "^4.2.0", @@ -8634,9 +8884,9 @@ } }, "ms": { - "version": "2.1.1", - "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.1.tgz", - "integrity": "sha512-tgp+dl5cGk28utYktBsrFqA7HKgrhgPsg6Z/EfhWI4gl1Hwq8B/GmY/0oXZ6nF8hDVesS/FpnYaD/kOWhYQvyg==" + "version": "2.1.2", + "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.2.tgz", + "integrity": "sha512-sGkPx+VjMtmA6MX27oA4FBFELFCZZ4S4XqeGOXCv68tT+jb3vk/RyaKWP0PTKyWtmLSM0b+adUTEvbs1PEaH2w==" } } }, @@ -8683,9 +8933,9 @@ "integrity": "sha1-sgmEkgO7Jd+CDadW50cAWHhSFiA=" }, "querystringify": { - "version": "2.1.0", - "resolved": "https://registry.npmjs.org/querystringify/-/querystringify-2.1.0.tgz", - "integrity": "sha512-sluvZZ1YiTLD5jsqZcDmFyV2EwToyXZBfpoVOmktMmW+VEnhgakFHnasVph65fOjGPTWN0Nw3+XQaSeMayr0kg==" + "version": "2.1.1", + "resolved": "https://registry.npmjs.org/querystringify/-/querystringify-2.1.1.tgz", + "integrity": "sha512-w7fLxIRCRT7U8Qu53jQnJyPkYZIaR4n5151KMfcJlO/A9397Wxb1amJvROTK6TOnp7PfoAmg/qXiNHI+08jRfA==" }, "randomatic": { "version": "1.1.7", @@ -9455,14 +9705,81 @@ } }, "ripple-hashes": { - "version": "0.3.1", - "resolved": "https://registry.npmjs.org/ripple-hashes/-/ripple-hashes-0.3.1.tgz", - "integrity": "sha1-8vRvH/BeZIdQCpmDkBkRTNJIJBE=", + "version": "0.3.4", + "resolved": "https://registry.npmjs.org/ripple-hashes/-/ripple-hashes-0.3.4.tgz", + "integrity": "sha512-u2kgg9Yu9D44HWnC9R2lNg+amVLllJkMQmXZEEM2DAMFXigr4+ph1O8LLxLv+k0fbdjAjos4aUyWwcw6cxzYMw==", "requires": { "bignumber.js": "^4.1.0", "create-hash": "^1.1.2", - "ripple-address-codec": "^2.0.1", - "ripple-binary-codec": "^0.1.0" + "ripple-address-codec": "^3.0.4", + "ripple-binary-codec": "^0.2.4" + }, + "dependencies": { + "base-x": { + "version": "3.0.4", + "resolved": "https://registry.npmjs.org/base-x/-/base-x-3.0.4.tgz", + "integrity": "sha512-UYOadoSIkEI/VrRGSG6qp93rp2WdokiAiNYDfGW5qURAY8GiAQkvMbwNNSDYiVJopqv4gCna7xqf4rrNGp+5AA==", + "requires": { + "safe-buffer": "^5.0.1" + } + }, + "bn.js": { + "version": "5.1.1", + "resolved": "https://registry.npmjs.org/bn.js/-/bn.js-5.1.1.tgz", + "integrity": "sha512-IUTD/REb78Z2eodka1QZyyEk66pciRcP6Sroka0aI3tG/iwIdYLrBD62RsubR7vqdt3WyX8p4jxeatzmRSphtA==" + }, + "decimal.js": { + "version": "10.2.0", + "resolved": "https://registry.npmjs.org/decimal.js/-/decimal.js-10.2.0.tgz", + "integrity": "sha512-vDPw+rDgn3bZe1+F/pyEwb1oMG2XTlRVgAa6B4KccTEpYgF8w6eQllVbQcfIJnZyvzFtFpxnpGtx8dd7DJp/Rw==" + }, + "lodash": { + "version": "4.17.15", + "resolved": "https://registry.npmjs.org/lodash/-/lodash-4.17.15.tgz", + "integrity": "sha512-8xOcRHvCjnocdS5cpwXQXVzmmh5e5+saE2QGoeQmbKmRS6J3VQppPOIt0MnmE+4xlZoumy0GPG0D0MVIQbNA1A==" + }, + "ripple-address-codec": { + "version": "3.0.4", + "resolved": "https://registry.npmjs.org/ripple-address-codec/-/ripple-address-codec-3.0.4.tgz", + "integrity": "sha512-GFk1BgavW+9oy5Z1Cp6YAGMfB51QdbeuhOo0Zir+s+S40F5vHtVZYu6zZE1eOAX92A5kygPuBRX4APH2v8Yhmg==", + "requires": { + "base-x": "3.0.4", + "create-hash": "^1.1.2" + } + }, + "ripple-binary-codec": { + "version": "0.2.6", + "resolved": "https://registry.npmjs.org/ripple-binary-codec/-/ripple-binary-codec-0.2.6.tgz", + "integrity": "sha512-k0efyjpcde7p+rJ9PXW9tJSYsUDdlC9Z9xU7OPM7fJiHVKlR1E7nfu0jqw9vVXtTG3tujqKeEgtcb8yaa7rMXA==", + "requires": { + "babel-runtime": "^6.6.1", + "bn.js": "^5.1.1", + "create-hash": "^1.1.2", + "decimal.js": "^10.2.0", + "inherits": "^2.0.1", + "lodash": "^4.17.15", + "ripple-address-codec": "^4.0.0" + }, + "dependencies": { + "base-x": { + "version": "3.0.7", + "resolved": "https://registry.npmjs.org/base-x/-/base-x-3.0.7.tgz", + "integrity": "sha512-zAKJGuQPihXW22fkrfOclUUZXM2g92z5GzlSMHxhO6r6Qj+Nm0ccaGNBzDZojzwOMkpjAv4J0fOv1U4go+a4iw==", + "requires": { + "safe-buffer": "^5.0.1" + } + }, + "ripple-address-codec": { + "version": "4.1.0", + "resolved": "https://registry.npmjs.org/ripple-address-codec/-/ripple-address-codec-4.1.0.tgz", + "integrity": "sha512-C72gJpwvDagaOUiHyh67otqNqFduB4hjvJFiiPz/8I3FCiUYuvFLXeLhb29CEkoAEdoN9p7pPreLgoHUvwzt9w==", + "requires": { + "base-x": "3.0.7", + "create-hash": "^1.1.2" + } + } + } + } } }, "ripple-keypairs": { @@ -9738,7 +10055,7 @@ }, "http-errors": { "version": "1.6.3", - "resolved": "http://registry.npmjs.org/http-errors/-/http-errors-1.6.3.tgz", + "resolved": "https://registry.npmjs.org/http-errors/-/http-errors-1.6.3.tgz", "integrity": "sha1-i1VoC7S+KDoLW/TqLjhYC+HZMg0=", "requires": { "depd": "~1.1.2", @@ -10191,9 +10508,9 @@ }, "dependencies": { "tweetnacl": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/tweetnacl/-/tweetnacl-1.0.0.tgz", - "integrity": "sha1-cT2LgY2kIGh0C/aDhtBHnmb8ins=" + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/tweetnacl/-/tweetnacl-1.0.2.tgz", + "integrity": "sha512-+8aPRjmXgf1VqvyxSlBUzKzeYqVS9Ai8vZ28g+mL7dNQl1jlUTCMDZnvNQdAS1xTywMkIXwJsfipsR/6s2+syw==" } } }, @@ -10213,12 +10530,12 @@ }, "dependencies": { "axios": { - "version": "0.18.0", - "resolved": "http://registry.npmjs.org/axios/-/axios-0.18.0.tgz", - "integrity": "sha1-MtU+SFHv3AoRmTts0AB4nXDAUQI=", + "version": "0.18.1", + "resolved": "https://registry.npmjs.org/axios/-/axios-0.18.1.tgz", + "integrity": "sha512-0BfJq4NSfQXd+SkFdrvFbG7addhYSBA2mQwISr46pD6E5iqkWg02RAs8vyTT/j0RTnoYmeXauBuSv1qKwR179g==", "requires": { - "follow-redirects": "^1.3.0", - "is-buffer": "^1.1.5" + "follow-redirects": "1.5.10", + "is-buffer": "^2.0.2" } }, "debug": { @@ -10236,6 +10553,11 @@ "requires": { "debug": "=3.1.0" } + }, + "is-buffer": { + "version": "2.0.4", + "resolved": "https://registry.npmjs.org/is-buffer/-/is-buffer-2.0.4.tgz", + "integrity": "sha512-Kq1rokWXOPXWuaMAqZiJW4XxsmD9zGx9q4aePabbn3qCRGedtH7Cm+zV8WETitMfu1wdh+Rvd6w5egwSngUX2A==" } } }, @@ -10249,6 +10571,24 @@ "strip-ansi": "^3.0.0" } }, + "string.prototype.trimleft": { + "version": "2.1.1", + "resolved": "https://registry.npmjs.org/string.prototype.trimleft/-/string.prototype.trimleft-2.1.1.tgz", + "integrity": "sha512-iu2AGd3PuP5Rp7x2kEZCrB2Nf41ehzh+goo8TV7z8/XDBbsvc6HQIlUl9RjkZ4oyrW1XM5UwlGl1oVEaDjg6Ag==", + "requires": { + "define-properties": "^1.1.3", + "function-bind": "^1.1.1" + } + }, + "string.prototype.trimright": { + "version": "2.1.1", + "resolved": "https://registry.npmjs.org/string.prototype.trimright/-/string.prototype.trimright-2.1.1.tgz", + "integrity": "sha512-qFvWL3/+QIgZXVmJBfpHmxLB7xsUXz6HsUmP8+5dRaC3Q7oKUv9Vo6aMCRZC1smrtyECFsIT30PqBJ1gTjAs+g==", + "requires": { + "define-properties": "^1.1.3", + "function-bind": "^1.1.1" + } + }, "string_decoder": { "version": "1.0.3", "resolved": "https://registry.npmjs.org/string_decoder/-/string_decoder-1.0.3.tgz", @@ -10347,24 +10687,24 @@ "integrity": "sha512-x0Vn8spI+wuJ1O6S7gnbaQg8Pxh4NNHb7KSINmEWKiPE4RKOplvijn+NkmYmmRgP68mc70j2EbeTFRsrswaQeg==" }, "ms": { - "version": "2.1.1", - "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.1.tgz", - "integrity": "sha512-tgp+dl5cGk28utYktBsrFqA7HKgrhgPsg6Z/EfhWI4gl1Hwq8B/GmY/0oXZ6nF8hDVesS/FpnYaD/kOWhYQvyg==" + "version": "2.1.2", + "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.2.tgz", + "integrity": "sha512-sGkPx+VjMtmA6MX27oA4FBFELFCZZ4S4XqeGOXCv68tT+jb3vk/RyaKWP0PTKyWtmLSM0b+adUTEvbs1PEaH2w==" }, "process-nextick-args": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/process-nextick-args/-/process-nextick-args-2.0.0.tgz", - "integrity": "sha512-MtEC1TqN0EU5nephaJ4rAtThHtC86dNN9qCuEhtshvpVBkAW5ZO7BASN9REnF9eoXGcRub+pFuKEpOHE+HbEMw==" + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/process-nextick-args/-/process-nextick-args-2.0.1.tgz", + "integrity": "sha512-3ouUOpQhtgrbOa17J7+uxOTpITYWaGP7/AhoR3+A+/1e9skrzelGi/dXzEYyvbxubEF6Wn2ypscTKiKJFFn1ag==" }, "qs": { - "version": "6.5.2", - "resolved": "https://registry.npmjs.org/qs/-/qs-6.5.2.tgz", - "integrity": "sha512-N5ZAX4/LxJmF+7wN74pUD6qAh9/wnvdQcjq9TZjevvXzSUo7bfmw91saqMjzGS2xq91/odN2dW/WOl7qQHNDGA==" + "version": "6.9.1", + "resolved": "https://registry.npmjs.org/qs/-/qs-6.9.1.tgz", + "integrity": "sha512-Cxm7/SS/y/Z3MHWSxXb8lIFqgqBowP5JMlTUFyJN88y0SGQhVmZnqFK/PeuMX9LzUyWsqqhNxIyg0jlzq946yA==" }, "readable-stream": { - "version": "2.3.6", - "resolved": "http://registry.npmjs.org/readable-stream/-/readable-stream-2.3.6.tgz", - "integrity": "sha512-tQtKA9WIAhBF3+VLAseyMqZeBjW0AHJoxOtYqSUZNJxauErmLbVm2FW1y+J/YA9dUrAC39ITejlZWhVIwawkKw==", + "version": "2.3.7", + "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-2.3.7.tgz", + "integrity": "sha512-Ebho8K4jIbHAxnuxi7o42OrZgF/ZTNcsZj6nRKyUmkhLFq8CHItp/fy6hQZuZmP/n3yZ9VBUbp4zz/mX8hmYPw==", "requires": { "core-util-is": "~1.0.0", "inherits": "~2.0.3", @@ -10387,7 +10727,7 @@ }, "superagent-proxy": { "version": "1.0.3", - "resolved": "http://registry.npmjs.org/superagent-proxy/-/superagent-proxy-1.0.3.tgz", + "resolved": "https://registry.npmjs.org/superagent-proxy/-/superagent-proxy-1.0.3.tgz", "integrity": "sha512-79Ujg1lRL2ICfuHUdX+H2MjIw73kB7bXsIkxLwHURz3j0XUmEEEoJ+u/wq+mKwna21Uejsm2cGR3OESA00TIjA==", "requires": { "debug": "^3.1.0", @@ -10403,9 +10743,9 @@ } }, "ms": { - "version": "2.1.1", - "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.1.tgz", - "integrity": "sha512-tgp+dl5cGk28utYktBsrFqA7HKgrhgPsg6Z/EfhWI4gl1Hwq8B/GmY/0oXZ6nF8hDVesS/FpnYaD/kOWhYQvyg==" + "version": "2.1.2", + "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.2.tgz", + "integrity": "sha512-sGkPx+VjMtmA6MX27oA4FBFELFCZZ4S4XqeGOXCv68tT+jb3vk/RyaKWP0PTKyWtmLSM0b+adUTEvbs1PEaH2w==" } } }, @@ -10732,9 +11072,9 @@ "dev": true }, "toml": { - "version": "2.3.3", - "resolved": "https://registry.npmjs.org/toml/-/toml-2.3.3.tgz", - "integrity": "sha512-O7L5hhSQHxuufWUdcTRPfuTh3phKfAZ/dqfxZFoxPCj2RYmpaSGLEIs016FCXItQwNr08yefUB5TSjzRYnajTA==" + "version": "2.3.6", + "resolved": "https://registry.npmjs.org/toml/-/toml-2.3.6.tgz", + "integrity": "sha512-gVweAectJU3ebq//Ferr2JUY4WKSDe5N+z0FvjDncLGyHmIDoxgY/2Ie4qfEIDm4IS7OA6Rmdm7pdEEdMcV/xQ==" }, "topo": { "version": "1.1.0", @@ -10853,9 +11193,9 @@ "integrity": "sha1-hnrHTjhkGHsdPUfZlqeOxciDB3c=" }, "typeforce": { - "version": "1.16.0", - "resolved": "https://registry.npmjs.org/typeforce/-/typeforce-1.16.0.tgz", - "integrity": "sha512-V60F7OHPH7vPlgIU73vYyeebKxWjQqCTlge+MvKlVn09PIhCOi/ZotowYdgREHB5S1dyHOr906ui6NheYXjlVQ==" + "version": "1.18.0", + "resolved": "https://registry.npmjs.org/typeforce/-/typeforce-1.18.0.tgz", + "integrity": "sha512-7uc1O8h1M1g0rArakJdf0uLRSSgFcYexrVoKo+bzJd32gd4gDy2L/Z+8/FjPnU9ydY3pEnVPtr9FyscYY60K1g==" }, "uid-number": { "version": "0.0.6", @@ -10960,11 +11300,11 @@ "integrity": "sha512-xVrGVi94ueCJNrBSTjWqjvtgvl3cyOTThp2zaMaFNGp3F542TR6sM3f2o8RqZl+AwteClSVmoCyt0ka4RjQOQg==" }, "url-parse": { - "version": "1.4.4", - "resolved": "https://registry.npmjs.org/url-parse/-/url-parse-1.4.4.tgz", - "integrity": "sha512-/92DTTorg4JjktLNLe6GPS2/RvAd/RGr6LuktmWSMLEOa6rjnlrFXNgSbSmkNvCoL2T028A0a1JaJLzRMlFoHg==", + "version": "1.4.7", + "resolved": "https://registry.npmjs.org/url-parse/-/url-parse-1.4.7.tgz", + "integrity": "sha512-d3uaVyzDB9tQoSXFvuSUNFibTd9zxd2bkVrDRvF5TmvWWQwqE4lgYJ5m+x1DbecWkw+LK4RNl2CU1hHuOKPVlg==", "requires": { - "querystringify": "^2.0.0", + "querystringify": "^2.1.1", "requires-port": "^1.0.0" }, "dependencies": { @@ -10994,11 +11334,22 @@ "integrity": "sha1-H6DZJw6b6FDZsFAn9jUZv0ZFfZY=" }, "util": { - "version": "0.11.1", - "resolved": "https://registry.npmjs.org/util/-/util-0.11.1.tgz", - "integrity": "sha512-HShAsny+zS2TZfaXxD9tYj4HQGlBezXZMZuM/S5PKLLoZkShZiGk9o5CzukI1LVHZvjdvZ2Sj1aW/Ndn2NB/HQ==", + "version": "0.12.1", + "resolved": "https://registry.npmjs.org/util/-/util-0.12.1.tgz", + "integrity": "sha512-MREAtYOp+GTt9/+kwf00IYoHZyjM8VU4aVrkzUlejyqaIjd2GztVl5V9hGXKlvBKE3gENn/FMfHE5v6hElXGcQ==", "requires": { - "inherits": "2.0.3" + "inherits": "^2.0.3", + "is-arguments": "^1.0.4", + "is-generator-function": "^1.0.7", + "object.entries": "^1.1.0", + "safe-buffer": "^5.1.2" + }, + "dependencies": { + "safe-buffer": { + "version": "5.2.0", + "resolved": "https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.2.0.tgz", + "integrity": "sha512-fZEwUGbVl7kouZs1jCdMLdt95hdIv0ZeHg6L7qPeciMZhZ+/gdesW4wgTARkrFWEpspjEATAzUGPG8N2jJiwbg==" + } } }, "util-deprecate": { @@ -11033,9 +11384,9 @@ } }, "varuint-bitcoin": { - "version": "1.1.0", - "resolved": "https://registry.npmjs.org/varuint-bitcoin/-/varuint-bitcoin-1.1.0.tgz", - "integrity": "sha512-jCEPG+COU/1Rp84neKTyDJQr478/hAfVp5xxYn09QEH0yBjbmPeMfuuQIrp+BUD83hybtYZKhr5elV3bvdV1bA==", + "version": "1.1.2", + "resolved": "https://registry.npmjs.org/varuint-bitcoin/-/varuint-bitcoin-1.1.2.tgz", + "integrity": "sha512-4EVb+w4rx+YfVM32HQX42AbbT7/1f5zwAYhIujKXKk8NQK+JfRVl3pqT3hjNn/L+RstigmGGKVwHA/P0wgITZw==", "requires": { "safe-buffer": "^5.1.1" } diff --git a/public/elm.js b/public/elm.js index 80c247d2..cede45d8 100644 --- a/public/elm.js +++ b/public/elm.js @@ -37383,7 +37383,11 @@ var _user$project$NavBar$determineConfigCategory = function (configCode) { _1: { ctor: '::', _0: 'operatorInfo', - _1: {ctor: '[]'} + _1: { + ctor: '::', + _0: 'fudgeFactor', + _1: {ctor: '[]'} + } } } } @@ -37836,7 +37840,11 @@ var _user$project$NavBar$view = F2( _1: { ctor: '::', _0: A2(configLink, 'operatorInfo', 'Operator Info'), - _1: {ctor: '[]'} + _1: { + ctor: '::', + _0: A2(configLink, 'fudgeFactor', 'Fudge Factor'), + _1: {ctor: '[]'} + } } } } From 1cc3c820b5e9775d78cff2408059404009ef9fba Mon Sep 17 00:00:00 2001 From: Taranto Date: Fri, 20 Mar 2020 17:55:55 +0000 Subject: [PATCH 14/25] fix: pr fixes --- lib/cash-out/cash-out-helper.js | 3 ++- lib/plugins/wallet/mock-wallet/mock-wallet.js | 6 +++--- lib/wallet.js | 2 +- 3 files changed, 6 insertions(+), 5 deletions(-) diff --git a/lib/cash-out/cash-out-helper.js b/lib/cash-out/cash-out-helper.js index 8a3a37cb..dc4597fd 100644 --- a/lib/cash-out/cash-out-helper.js +++ b/lib/cash-out/cash-out-helper.js @@ -16,7 +16,8 @@ function convertBigNumFields (obj) { return value.toString() } - if (_.includes(key, [ 'commissionPercentage', 'rawTickerPrice' ]) && value) { + // Only test isNil for these fields since the others should not be empty. + if (_.includes(key, [ 'commissionPercentage', 'rawTickerPrice' ]) && !_.isNil(value)) { return value.toString() } diff --git a/lib/plugins/wallet/mock-wallet/mock-wallet.js b/lib/plugins/wallet/mock-wallet/mock-wallet.js index eea9b3b4..abaff6f7 100644 --- a/lib/plugins/wallet/mock-wallet/mock-wallet.js +++ b/lib/plugins/wallet/mock-wallet/mock-wallet.js @@ -79,9 +79,9 @@ function newFunding (account, cryptoCode) { function getStatus (account, toAddress, cryptoAtoms, cryptoCode) { const elapsed = Date.now() - t0 - if (elapsed < PUBLISH_TIME) return Promise.resolve({ receivedCryptoAtoms: cryptoAtoms - 10, status: 'notSeen' }) - if (elapsed < AUTHORIZE_TIME) return Promise.resolve({ receivedCryptoAtoms: cryptoAtoms - 10, status: 'published' }) - if (elapsed < CONFIRM_TIME) return Promise.resolve({ receivedCryptoAtoms: null, status: 'authorized' }) + if (elapsed < PUBLISH_TIME) return Promise.resolve({ receivedCryptoAtoms: BN(0), status: 'notSeen' }) + if (elapsed < AUTHORIZE_TIME) return Promise.resolve({ receivedCryptoAtoms: cryptoAtoms, status: 'published' }) + if (elapsed < CONFIRM_TIME) return Promise.resolve({ receivedCryptoAtoms: cryptoAtoms, status: 'authorized' }) console.log('[%s] DEBUG: Mock wallet has confirmed transaction [%s]', cryptoCode, toAddress.slice(0, 5)) diff --git a/lib/wallet.js b/lib/wallet.js index 4fc8e0de..49124ef9 100644 --- a/lib/wallet.js +++ b/lib/wallet.js @@ -126,7 +126,7 @@ function getWalletStatus (settings, tx) { const fudgeFactor = fudgeFactorEnabled ? 10 : 0 const walletStatusPromise = fetchWallet(settings, tx.cryptoCode) - .then(r => r.wallet.getStatus(r.account, tx.toAddress, tx.cryptoAtoms.add(fudgeFactor), tx.cryptoCode)) + .then(r => r.wallet.getStatus(r.account, tx.toAddress, tx.cryptoAtoms.minus(fudgeFactor), tx.cryptoCode)) return Promise.all([ walletStatusPromise, From a7823736e6ddadca4d7acb973959b371363bfc5d Mon Sep 17 00:00:00 2001 From: Neal Conner <7396812+naconner@users.noreply.github.com> Date: Thu, 26 Mar 2020 15:42:44 -0400 Subject: [PATCH 15/25] chore: update BTC, BCH, LTC, ETH wallets --- lib/blockchain/common.js | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/lib/blockchain/common.js b/lib/blockchain/common.js index 15df7156..74f99a45 100644 --- a/lib/blockchain/common.js +++ b/lib/blockchain/common.js @@ -21,12 +21,12 @@ module.exports = { const BINARIES = { BTC: { - url: 'https://bitcoin.org/bin/bitcoin-core-0.16.3/bitcoin-0.16.3-x86_64-linux-gnu.tar.gz', - dir: 'bitcoin-0.16.3/bin' + url: 'https://bitcoincore.org/bin/bitcoin-core-0.19.1/bitcoin-0.19.1-x86_64-linux-gnu.tar.gz', + dir: 'bitcoin-0.19.1/bin' }, ETH: { - url: 'https://gethstore.blob.core.windows.net/builds/geth-linux-amd64-1.9.11-6a62fe39.tar.gz', - dir: 'geth-linux-amd64-1.9.11-6a62fe39' + url: 'https://gethstore.blob.core.windows.net/builds/geth-linux-amd64-1.9.12-b6f1c8dc.tar.gz', + dir: 'geth-linux-amd64-1.9.12-b6f1c8dc' }, ZEC: { url: 'https://z.cash/downloads/zcash-2.1.1-1-linux64-debian-jessie.tar.gz', @@ -37,12 +37,12 @@ const BINARIES = { dir: 'dashcore-0.15.0/bin' }, LTC: { - url: 'https://download.litecoin.org/litecoin-0.16.3/linux/litecoin-0.16.3-x86_64-linux-gnu.tar.gz', - dir: 'litecoin-0.16.3/bin' + url: 'https://download.litecoin.org/litecoin-0.17.1/linux/litecoin-0.17.1-x86_64-linux-gnu.tar.gz', + dir: 'litecoin-0.17.1/bin' }, BCH: { - url: 'https://download.bitcoinabc.org/0.20.5/linux/bitcoin-abc-0.20.5-x86_64-linux-gnu.tar.gz', - dir: 'bitcoin-abc-0.20.5/bin', + url: 'https://download.bitcoinabc.org/0.21.2/linux/bitcoin-abc-0.21.2-x86_64-linux-gnu.tar.gz', + dir: 'bitcoin-abc-0.21.2/bin', files: [['bitcoind', 'bitcoincashd'], ['bitcoin-cli', 'bitcoincash-cli']] } } From 8f28b7aa0af9fa06b268166d1e63b73ea2d00aae Mon Sep 17 00:00:00 2001 From: Taranto Date: Wed, 22 Jan 2020 18:13:01 +0000 Subject: [PATCH 16/25] feat: only refetch t&c on config change --- lib/plugins.js | 3 ++- lib/routes.js | 20 +++++++++++++++++--- 2 files changed, 19 insertions(+), 4 deletions(-) diff --git a/lib/plugins.js b/lib/plugins.js index 7f0cb6ae..0b55a815 100644 --- a/lib/plugins.js +++ b/lib/plugins.js @@ -793,7 +793,8 @@ function plugins (settings, deviceId) { buy, sell, notificationsEnabled, - notifyOperator + notifyOperator, + fetchCurrentConfigVersion } } diff --git a/lib/routes.js b/lib/routes.js index 9564eb15..b1a7928d 100644 --- a/lib/routes.js +++ b/lib/routes.js @@ -72,8 +72,6 @@ function poll (req, res, next) { } } - const terms = config.termsScreenActive && config.termsScreenText ? createTerms(config) : null - const response = { error: null, locale, @@ -94,7 +92,6 @@ function poll (req, res, next) { frontCameraVerificationActive: config.frontCameraVerificationActive, frontCameraVerificationThreshold: config.frontCameraVerificationThreshold, receiptPrintingActive: config.receiptPrintingActive, - terms, cassettes, twoWayMode: config.cashOutEnabled, zeroConfLimit: config.zeroConfLimit, @@ -120,6 +117,21 @@ function poll (req, res, next) { .catch(next) } +function getTermsConditions (req, res, next) { + const deviceId = req.deviceId + const settings = req.settings + + const config = configManager.unscoped(req.settings.config) + const pi = plugins(settings, deviceId) + + const terms = config.termsScreenActive && config.termsScreenText ? createTerms(config) : null + + return pi.fetchCurrentConfigVersion().then(version => { + return res.json({ terms, version }) + }) + .catch(next) +} + function getTx (req, res, next) { if (req.query.status) { return helpers.fetchStatusTx(req.params.id, req.query.status) @@ -356,6 +368,7 @@ const skip = (req, res) => _.includes(req.path, ['/poll', '/state', '/logs']) && const configRequiredRoutes = [ '/poll', + '/terms_conditions', '/event', '/phone_code', '/customer', @@ -379,6 +392,7 @@ app.use(configRequiredRoutes, populateSettings) app.use(filterOldRequests) app.get('/poll', poll) +app.get('/terms_conditions', getTermsConditions) app.post('/state', stateChange) app.post('/verify_user', verifyUser) From 7fc8ff3d1d599f24dea4a2afecba2d9571426502 Mon Sep 17 00:00:00 2001 From: Taranto Date: Mon, 24 Feb 2020 10:29:36 +0000 Subject: [PATCH 17/25] fix: make t&c changes backwards compatible --- lib/routes.js | 11 +++++++++++ package-lock.json | 23 +++++++++++++++++++---- package.json | 1 + 3 files changed, 31 insertions(+), 4 deletions(-) diff --git a/lib/routes.js b/lib/routes.js index b1a7928d..20bcbc69 100644 --- a/lib/routes.js +++ b/lib/routes.js @@ -6,6 +6,7 @@ const bodyParser = require('body-parser') const _ = require('lodash/fp') const express = require('express') const nmd = require('nano-markdown') +const semver = require('semver') const dbErrorCodes = require('./db-error-codes') const options = require('./options') @@ -22,6 +23,8 @@ const customers = require('./customers') const logs = require('./logs') const compliance = require('./compliance') +const version = require('../package.json').version + const argv = require('minimist')(process.argv.slice(2)) const CLOCK_SKEW = 60 * 1000 @@ -44,6 +47,7 @@ function checkHasLightning (settings) { } function poll (req, res, next) { + const machineVersion = req.query.version const deviceId = req.deviceId const deviceTime = req.deviceTime const serialNumber = req.query.sn @@ -75,6 +79,7 @@ function poll (req, res, next) { const response = { error: null, locale, + version, txLimit: config.cashInTransactionLimit, idVerificationEnabled: config.idVerificationEnabled, smsVerificationActive: config.smsVerificationActive, @@ -108,6 +113,12 @@ function poll (req, res, next) { } } + // BACKWARDS_COMPATIBILITY 7.5 + // machines before 7.5 expect t&c on poll + if (!machineVersion || semver.lt(machineVersion, '7.5.0-beta')) { + response.terms = config.termsScreenActive && config.termsScreenText ? createTerms(config) : null + } + if (response.idVerificationEnabled) { response.idVerificationLimit = config.idVerificationLimit } diff --git a/package-lock.json b/package-lock.json index 6bb7963b..fd4b0af5 100644 --- a/package-lock.json +++ b/package-lock.json @@ -7816,6 +7816,14 @@ "is-builtin-module": "^1.0.0", "semver": "2 || 3 || 4 || 5", "validate-npm-package-license": "^3.0.1" + }, + "dependencies": { + "semver": { + "version": "5.7.1", + "resolved": "https://registry.npmjs.org/semver/-/semver-5.7.1.tgz", + "integrity": "sha512-sauaDf/PZdVgrLTNYHRtpXa1iRiKcaebiKQ1BJdpQlWH2lCvexQdX55snPFyK7QzpudqbCI0qXFfOasHdyNDGQ==", + "dev": true + } } }, "normalize-path": { @@ -9991,10 +9999,9 @@ "integrity": "sha1-uztgbdaGN8okRoGhD97mxRIEkpQ=" }, "semver": { - "version": "5.0.3", - "resolved": "https://registry.npmjs.org/semver/-/semver-5.0.3.tgz", - "integrity": "sha1-d0Zt5YnNXTyV8TiqeLxWmjy10no=", - "dev": true + "version": "7.1.3", + "resolved": "https://registry.npmjs.org/semver/-/semver-7.1.3.tgz", + "integrity": "sha512-ekM0zfiA9SCBlsKa2X1hxyxiI4L3B6EbVJkkdgQXnSEEaHlGdvyodMruTiulSRWMMB4NeIuYNMC9rTKTz97GxA==" }, "semver-diff": { "version": "2.1.0", @@ -10003,6 +10010,14 @@ "dev": true, "requires": { "semver": "^5.0.3" + }, + "dependencies": { + "semver": { + "version": "5.7.1", + "resolved": "https://registry.npmjs.org/semver/-/semver-5.7.1.tgz", + "integrity": "sha512-sauaDf/PZdVgrLTNYHRtpXa1iRiKcaebiKQ1BJdpQlWH2lCvexQdX55snPFyK7QzpudqbCI0qXFfOasHdyNDGQ==", + "dev": true + } } }, "send": { diff --git a/package.json b/package.json index 5eac4578..feb94f43 100644 --- a/package.json +++ b/package.json @@ -51,6 +51,7 @@ "pify": "^3.0.0", "pretty-ms": "^2.1.0", "promise-sequential": "^1.1.1", + "semver": "^7.1.3", "serve-static": "^1.12.4", "socket.io": "^2.0.3", "socket.io-client": "^2.0.3", From 8b149031e3886d25db6482ce53245682546b1cfd Mon Sep 17 00:00:00 2001 From: Taranto Date: Thu, 26 Mar 2020 08:14:59 +0000 Subject: [PATCH 18/25] chore: early t&c release --- lib/routes.js | 6 +++--- package.json | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/lib/routes.js b/lib/routes.js index 20bcbc69..5dde21c4 100644 --- a/lib/routes.js +++ b/lib/routes.js @@ -113,9 +113,9 @@ function poll (req, res, next) { } } - // BACKWARDS_COMPATIBILITY 7.5 - // machines before 7.5 expect t&c on poll - if (!machineVersion || semver.lt(machineVersion, '7.5.0-beta')) { + // BACKWARDS_COMPATIBILITY 7.4.9 + // machines before 7.4.9 expect t&c on poll + if (!machineVersion || semver.lt(machineVersion, '7.4.9')) { response.terms = config.termsScreenActive && config.termsScreenText ? createTerms(config) : null } diff --git a/package.json b/package.json index feb94f43..8b8f473c 100644 --- a/package.json +++ b/package.json @@ -2,7 +2,7 @@ "name": "lamassu-server", "description": "bitcoin atm client server protocol module", "keywords": [], - "version": "7.4.8", + "version": "7.4.9", "license": "Unlicense", "author": "Lamassu (https://lamassu.is)", "dependencies": { From cf616c1f1637800ff9ae1258ffa97c2426824126 Mon Sep 17 00:00:00 2001 From: Neal Conner <7396812+naconner@users.noreply.github.com> Date: Wed, 25 Mar 2020 14:19:58 -0400 Subject: [PATCH 19/25] feat: reintroduce lowBalanceMargin --- lib/plugins.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/plugins.js b/lib/plugins.js index 0b55a815..39c02778 100644 --- a/lib/plugins.js +++ b/lib/plugins.js @@ -308,7 +308,7 @@ function plugins (settings, deviceId) { const rate = rawRate.div(cashInCommission) - const lowBalanceMargin = BN(1) + const lowBalanceMargin = BN(1.03) const cryptoRec = coinUtils.getCryptoCurrency(cryptoCode) const unitScale = cryptoRec.unitScale From 086c5ec188de5baaad62a2b25fb3976dd59fc24c Mon Sep 17 00:00:00 2001 From: Taranto Date: Tue, 28 Jan 2020 13:23:38 +0000 Subject: [PATCH 20/25] fix: change rpc call after get balance deprecation --- .../wallet/bitcoincashd/bitcoincashd.js | 20 ++++++++++++------- lib/plugins/wallet/bitcoind/bitcoind.js | 20 ++++++++++++------- lib/plugins/wallet/dashd/dashd.js | 20 ++++++++++++------- lib/plugins/wallet/litecoind/litecoind.js | 20 ++++++++++++------- lib/plugins/wallet/zcashd/zcashd.js | 20 ++++++++++++------- 5 files changed, 65 insertions(+), 35 deletions(-) diff --git a/lib/plugins/wallet/bitcoincashd/bitcoincashd.js b/lib/plugins/wallet/bitcoincashd/bitcoincashd.js index 0ef29ede..fd141ede 100644 --- a/lib/plugins/wallet/bitcoincashd/bitcoincashd.js +++ b/lib/plugins/wallet/bitcoincashd/bitcoincashd.js @@ -25,16 +25,22 @@ function checkCryptoCode (cryptoCode) { return Promise.resolve() } -function accountBalance (account, cryptoCode, confirmations) { +function accountBalance (cryptoCode) { return checkCryptoCode(cryptoCode) - .then(() => fetch('getbalance', ['*', confirmations])) - .then(r => BN(r).shift(unitScale).round()) + .then(() => fetch('getwalletinfo')) + .then(({ balance }) => BN(balance).shift(unitScale).round()) +} + +function accountUnconfirmedBalance (cryptoCode) { + return checkCryptoCode(cryptoCode) + .then(() => fetch('getwalletinfo')) + .then(({ unconfirmed_balance: balance }) => BN(balance).shift(unitScale).round()) } // We want a balance that includes all spends (0 conf) but only deposits that // have at least 1 confirmation. getbalance does this for us automatically. function balance (account, cryptoCode) { - return accountBalance(account, cryptoCode, 1) + return accountBalance(cryptoCode) } function sendCoins (account, address, cryptoAtoms, cryptoCode) { @@ -95,9 +101,9 @@ function newFunding (account, cryptoCode) { return checkCryptoCode(cryptoCode) .then(() => { const promises = [ - accountBalance(account, cryptoCode, 0), - accountBalance(account, cryptoCode, 1), - newAddress(account, {cryptoCode}) + accountUnconfirmedBalance(cryptoCode), + accountBalance(cryptoCode), + newAddress(account, { cryptoCode }) ] return Promise.all(promises) diff --git a/lib/plugins/wallet/bitcoind/bitcoind.js b/lib/plugins/wallet/bitcoind/bitcoind.js index a8fc91f2..e424eeef 100644 --- a/lib/plugins/wallet/bitcoind/bitcoind.js +++ b/lib/plugins/wallet/bitcoind/bitcoind.js @@ -25,16 +25,22 @@ function checkCryptoCode (cryptoCode) { return Promise.resolve() } -function accountBalance (account, cryptoCode, confirmations) { +function accountBalance (cryptoCode) { return checkCryptoCode(cryptoCode) - .then(() => fetch('getbalance', ['*', confirmations])) - .then(r => BN(r).shift(unitScale).round()) + .then(() => fetch('getwalletinfo')) + .then(({ balance }) => BN(balance).shift(unitScale).round()) +} + +function accountUnconfirmedBalance (cryptoCode) { + return checkCryptoCode(cryptoCode) + .then(() => fetch('getwalletinfo')) + .then(({ unconfirmed_balance: balance }) => BN(balance).shift(unitScale).round()) } // We want a balance that includes all spends (0 conf) but only deposits that // have at least 1 confirmation. getbalance does this for us automatically. function balance (account, cryptoCode) { - return accountBalance(account, cryptoCode, 1) + return accountBalance(cryptoCode) } function sendCoins (account, address, cryptoAtoms, cryptoCode) { @@ -95,9 +101,9 @@ function newFunding (account, cryptoCode) { return checkCryptoCode(cryptoCode) .then(() => { const promises = [ - accountBalance(account, cryptoCode, 0), - accountBalance(account, cryptoCode, 1), - newAddress(account, {cryptoCode}) + accountUnconfirmedBalance(cryptoCode), + accountBalance(cryptoCode), + newAddress(account, { cryptoCode }) ] return Promise.all(promises) diff --git a/lib/plugins/wallet/dashd/dashd.js b/lib/plugins/wallet/dashd/dashd.js index 4d664269..33c86c13 100644 --- a/lib/plugins/wallet/dashd/dashd.js +++ b/lib/plugins/wallet/dashd/dashd.js @@ -26,16 +26,22 @@ function checkCryptoCode (cryptoCode) { return Promise.resolve() } -function accountBalance (acount, cryptoCode, confirmations) { +function accountBalance (cryptoCode) { return checkCryptoCode(cryptoCode) - .then(() => fetch('getbalance', ['', confirmations])) - .then(r => BN(r).shift(unitScale).round()) + .then(() => fetch('getwalletinfo')) + .then(({ balance }) => BN(balance).shift(unitScale).round()) +} + +function accountUnconfirmedBalance (cryptoCode) { + return checkCryptoCode(cryptoCode) + .then(() => fetch('getwalletinfo')) + .then(({ unconfirmed_balance: balance }) => BN(balance).shift(unitScale).round()) } // We want a balance that includes all spends (0 conf) but only deposits that // have at least 1 confirmation. getbalance does this for us automatically. function balance (account, cryptoCode) { - return accountBalance(account, cryptoCode, 1) + return accountBalance(cryptoCode) } function sendCoins (account, address, cryptoAtoms, cryptoCode) { @@ -96,9 +102,9 @@ function newFunding (account, cryptoCode) { return checkCryptoCode(cryptoCode) .then(() => { const promises = [ - accountBalance(account, cryptoCode, 0), - accountBalance(account, cryptoCode, 1), - newAddress(account, {cryptoCode}) + accountUnconfirmedBalance(cryptoCode), + accountBalance(cryptoCode), + newAddress(account, { cryptoCode }) ] return Promise.all(promises) diff --git a/lib/plugins/wallet/litecoind/litecoind.js b/lib/plugins/wallet/litecoind/litecoind.js index fc4c9bce..234b816e 100644 --- a/lib/plugins/wallet/litecoind/litecoind.js +++ b/lib/plugins/wallet/litecoind/litecoind.js @@ -26,16 +26,22 @@ function checkCryptoCode (cryptoCode) { return Promise.resolve() } -function accountBalance (acount, cryptoCode, confirmations) { +function accountBalance (cryptoCode) { return checkCryptoCode(cryptoCode) - .then(() => fetch('getbalance', ['*', confirmations])) - .then(r => BN(r).shift(unitScale).round()) + .then(() => fetch('getwalletinfo')) + .then(({ balance }) => BN(balance).shift(unitScale).round()) +} + +function accountUnconfirmedBalance (cryptoCode) { + return checkCryptoCode(cryptoCode) + .then(() => fetch('getwalletinfo')) + .then(({ unconfirmed_balance: balance }) => BN(balance).shift(unitScale).round()) } // We want a balance that includes all spends (0 conf) but only deposits that // have at least 1 confirmation. getbalance does this for us automatically. function balance (account, cryptoCode) { - return accountBalance(account, cryptoCode, 1) + return accountBalance(cryptoCode) } function sendCoins (account, address, cryptoAtoms, cryptoCode) { @@ -96,9 +102,9 @@ function newFunding (account, cryptoCode) { return checkCryptoCode(cryptoCode) .then(() => { const promises = [ - accountBalance(account, cryptoCode, 0), - accountBalance(account, cryptoCode, 1), - newAddress(account, {cryptoCode}) + accountUnconfirmedBalance(cryptoCode), + accountBalance(cryptoCode), + newAddress(account, { cryptoCode }) ] return Promise.all(promises) diff --git a/lib/plugins/wallet/zcashd/zcashd.js b/lib/plugins/wallet/zcashd/zcashd.js index 1f9e7656..b5b23da6 100644 --- a/lib/plugins/wallet/zcashd/zcashd.js +++ b/lib/plugins/wallet/zcashd/zcashd.js @@ -26,16 +26,22 @@ function checkCryptoCode (cryptoCode) { return Promise.resolve() } -function accountBalance (acount, cryptoCode, confirmations) { +function accountBalance (cryptoCode) { return checkCryptoCode(cryptoCode) - .then(() => fetch('getbalance', ['', confirmations])) - .then(r => BN(r).shift(unitScale).round()) + .then(() => fetch('getwalletinfo')) + .then(({ balance }) => BN(balance).shift(unitScale).round()) +} + +function accountUnconfirmedBalance (cryptoCode) { + return checkCryptoCode(cryptoCode) + .then(() => fetch('getwalletinfo')) + .then(({ unconfirmed_balance: balance }) => BN(balance).shift(unitScale).round()) } // We want a balance that includes all spends (0 conf) but only deposits that // have at least 1 confirmation. getbalance does this for us automatically. function balance (account, cryptoCode) { - return accountBalance(account, cryptoCode, 1) + return accountBalance(cryptoCode) } function sendCoins (account, address, cryptoAtoms, cryptoCode) { @@ -96,9 +102,9 @@ function newFunding (account, cryptoCode) { return checkCryptoCode(cryptoCode) .then(() => { const promises = [ - accountBalance(account, cryptoCode, 0), - accountBalance(account, cryptoCode, 1), - newAddress(account, {cryptoCode}) + accountUnconfirmedBalance(cryptoCode), + accountBalance(cryptoCode), + newAddress(account, { cryptoCode }) ] return Promise.all(promises) From 7152230d08345ee394ed538ee7885cd2d70831a3 Mon Sep 17 00:00:00 2001 From: Taranto Date: Thu, 26 Mar 2020 17:44:44 +0000 Subject: [PATCH 21/25] fix: pending already considers confirmed balance --- lib/admin/funding.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/admin/funding.js b/lib/admin/funding.js index b927b0bd..c912d913 100644 --- a/lib/admin/funding.js +++ b/lib/admin/funding.js @@ -78,7 +78,7 @@ function getFunding (_cryptoCode) { const rate = (rates.ask.add(rates.bid)).div(2) const fundingConfirmedBalance = fundingRec.fundingConfirmedBalance const fiatConfirmedBalance = computeFiat(rate, cryptoCode, fundingConfirmedBalance) - const pending = fundingRec.fundingPendingBalance.sub(fundingConfirmedBalance) + const pending = fundingRec.fundingPendingBalance const fiatPending = computeFiat(rate, cryptoCode, pending) const fundingAddress = fundingRec.fundingAddress const fundingAddressUrl = coinUtils.buildUrl(cryptoCode, fundingAddress) From 4425ccce58313b4ae22ddc4a27969fa456d02c14 Mon Sep 17 00:00:00 2001 From: Taranto Date: Tue, 7 Apr 2020 11:34:35 +0100 Subject: [PATCH 22/25] feat: First steps into regtest integration tests --- test/integration/README.md | 1 + test/integration/balance.sh | 35 +++++++++++++++++++++++++++++++++++ test/integration/bitcoind.sh | 7 +++++++ 3 files changed, 43 insertions(+) create mode 100644 test/integration/README.md create mode 100644 test/integration/balance.sh create mode 100644 test/integration/bitcoind.sh diff --git a/test/integration/README.md b/test/integration/README.md new file mode 100644 index 00000000..3ad283f6 --- /dev/null +++ b/test/integration/README.md @@ -0,0 +1 @@ +### Early experiments in regtest diff --git a/test/integration/balance.sh b/test/integration/balance.sh new file mode 100644 index 00000000..81709b8c --- /dev/null +++ b/test/integration/balance.sh @@ -0,0 +1,35 @@ +#!/bin/bash + +PREFIX_W1='docker exec --user bitcoin bitcoin-server bitcoin-cli -rpcwallet=wallet1.dat -regtest ' +PREFIX_W2='docker exec --user bitcoin bitcoin-server bitcoin-cli -rpcwallet=wallet2.dat -regtest ' + +# Create address and generate mine blocks +ADDRESS_1=`$PREFIX_W1 getnewaddress` +ADDRESS_2=`$PREFIX_W2 getnewaddress` +$PREFIX_W1 generatetoaddress 101 $ADDRESS_1 > /dev/null 2>&1 + +echo -e 'Wallet 1 balance' +$PREFIX_W1 getwalletinfo | grep balance + +echo -e '\nWallet 2 balance' +$PREFIX_W2 getwalletinfo | grep balance + +# Wallet one has one UTXO, so this also tests change +echo -e '\n\nCreate send\n' +$PREFIX_W1 sendtoaddress $ADDRESS_2 0.3 > /dev/null 2>&1 + +echo -e 'Wallet 1 balance' +$PREFIX_W1 getwalletinfo | grep balance + +echo -e '\nWallet 2 balance' +$PREFIX_W2 getwalletinfo | grep balance + +echo -e '\n\nMine one block \n' +$PREFIX_W1 generatetoaddress 1 $ADDRESS_1 > /dev/null 2>&1 + +echo -e 'Wallet 1 balance' +$PREFIX_W1 getwalletinfo | grep balance + +echo -e '\nWallet 2 balance' +$PREFIX_W2 getwalletinfo | grep balance + diff --git a/test/integration/bitcoind.sh b/test/integration/bitcoind.sh new file mode 100644 index 00000000..33313887 --- /dev/null +++ b/test/integration/bitcoind.sh @@ -0,0 +1,7 @@ +#!/bin/bash + + docker run --rm --name bitcoin-server -it ruimarinho/bitcoin-core \ + -regtest=1 \ + -wallet=wallet1.dat \ + -wallet=wallet2.dat + From 35aa0a058d5d0c9feb683696fb526a0a8a734259 Mon Sep 17 00:00:00 2001 From: Neal Date: Thu, 23 Apr 2020 17:38:43 -0400 Subject: [PATCH 23/25] chore: update ZEC, BCH, ETH wallets --- lib/blockchain/common.js | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/lib/blockchain/common.js b/lib/blockchain/common.js index 74f99a45..be714e82 100644 --- a/lib/blockchain/common.js +++ b/lib/blockchain/common.js @@ -25,12 +25,12 @@ const BINARIES = { dir: 'bitcoin-0.19.1/bin' }, ETH: { - url: 'https://gethstore.blob.core.windows.net/builds/geth-linux-amd64-1.9.12-b6f1c8dc.tar.gz', - dir: 'geth-linux-amd64-1.9.12-b6f1c8dc' + url: 'https://gethstore.blob.core.windows.net/builds/geth-linux-amd64-1.9.13-cbc4ac26.tar.gz', + dir: 'geth-linux-amd64-1.9.13-cbc4ac26' }, ZEC: { - url: 'https://z.cash/downloads/zcash-2.1.1-1-linux64-debian-jessie.tar.gz', - dir: 'zcash-2.1.1-1/bin' + url: 'https://z.cash/downloads/zcash-2.1.2-linux64-debian-jessie.tar.gz', + dir: 'zcash-2.1.2/bin' }, DASH: { url: 'https://github.com/dashpay/dash/releases/download/v0.15.0.0/dashcore-0.15.0.0-x86_64-linux-gnu.tar.gz', @@ -41,8 +41,8 @@ const BINARIES = { dir: 'litecoin-0.17.1/bin' }, BCH: { - url: 'https://download.bitcoinabc.org/0.21.2/linux/bitcoin-abc-0.21.2-x86_64-linux-gnu.tar.gz', - dir: 'bitcoin-abc-0.21.2/bin', + url: 'https://download.bitcoinabc.org/0.21.4/linux/bitcoin-abc-0.21.4-x86_64-linux-gnu.tar.gz', + dir: 'bitcoin-abc-0.21.4/bin', files: [['bitcoind', 'bitcoincashd'], ['bitcoin-cli', 'bitcoincash-cli']] } } From 278c9777632f71c447c9556ed2d524149d92a7b5 Mon Sep 17 00:00:00 2001 From: naconner <7396812+naconner@users.noreply.github.com> Date: Wed, 20 May 2020 12:54:44 -0400 Subject: [PATCH 24/25] chore: update BCH, ZEC, ETH --- lib/blockchain/common.js | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/lib/blockchain/common.js b/lib/blockchain/common.js index 74f99a45..951152b3 100644 --- a/lib/blockchain/common.js +++ b/lib/blockchain/common.js @@ -25,12 +25,12 @@ const BINARIES = { dir: 'bitcoin-0.19.1/bin' }, ETH: { - url: 'https://gethstore.blob.core.windows.net/builds/geth-linux-amd64-1.9.12-b6f1c8dc.tar.gz', - dir: 'geth-linux-amd64-1.9.12-b6f1c8dc' + url: 'https://gethstore.blob.core.windows.net/builds/geth-linux-amd64-1.9.14-6d74d1e5.tar.gz', + dir: 'geth-linux-amd64-1.9.14-6d74d1e5' }, ZEC: { - url: 'https://z.cash/downloads/zcash-2.1.1-1-linux64-debian-jessie.tar.gz', - dir: 'zcash-2.1.1-1/bin' + url: 'https://z.cash/downloads/zcash-2.1.2-3-linux64-debian-jessie.tar.gz', + dir: 'zcash-2.1.2-3/bin' }, DASH: { url: 'https://github.com/dashpay/dash/releases/download/v0.15.0.0/dashcore-0.15.0.0-x86_64-linux-gnu.tar.gz', @@ -41,8 +41,8 @@ const BINARIES = { dir: 'litecoin-0.17.1/bin' }, BCH: { - url: 'https://download.bitcoinabc.org/0.21.2/linux/bitcoin-abc-0.21.2-x86_64-linux-gnu.tar.gz', - dir: 'bitcoin-abc-0.21.2/bin', + url: 'https://download.bitcoinabc.org/0.21.7/linux/bitcoin-abc-0.21.7-x86_64-linux-gnu.tar.gz', + dir: 'bitcoin-abc-0.21.7/bin', files: [['bitcoind', 'bitcoincashd'], ['bitcoin-cli', 'bitcoincash-cli']] } } From 6e9feb6be4f7dffa7037397cb36fb85d3d3a0340 Mon Sep 17 00:00:00 2001 From: Taranto Date: Wed, 6 May 2020 22:21:39 +0100 Subject: [PATCH 25/25] fix: rename fudge factor and change value --- lib/wallet.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/wallet.js b/lib/wallet.js index 49124ef9..10f334d8 100644 --- a/lib/wallet.js +++ b/lib/wallet.js @@ -122,8 +122,8 @@ function mergeStatusMode (a, b) { } function getWalletStatus (settings, tx) { - const fudgeFactorEnabled = configManager.unscoped(settings.config).fudgeFactor - const fudgeFactor = fudgeFactorEnabled ? 10 : 0 + const fudgeFactorEnabled = configManager.unscoped(settings.config).fudgeFactorActive + const fudgeFactor = fudgeFactorEnabled ? 100 : 0 const walletStatusPromise = fetchWallet(settings, tx.cryptoCode) .then(r => r.wallet.getStatus(r.account, tx.toAddress, tx.cryptoAtoms.minus(fudgeFactor), tx.cryptoCode))