From 7f0b4a0986a8f3416707db893d01eb323048e0ef Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Loun=C3=A8s=20Ksouri?= Date: Sat, 18 Sep 2021 17:55:24 +0200 Subject: [PATCH] Merge v1.11.0 into umbrel --- RELEASES.md | 23 + accounts/api-helper.js | 4 +- accounts/fees-rest-api.js | 7 +- accounts/headers-rest-api.js | 2 +- accounts/multiaddr-rest-api.js | 51 +- accounts/notifications-server.js | 13 +- accounts/notifications-service.js | 16 +- accounts/status-rest-api.js | 2 +- accounts/status.js | 6 +- accounts/support-rest-api.js | 18 +- accounts/transactions-rest-api.js | 4 +- accounts/unspent-rest-api.js | 2 +- accounts/wallet-rest-api.js | 12 +- accounts/xpub-rest-api.js | 16 +- docker/my-dojo/.env | 6 +- docker/my-dojo/bitcoin/Dockerfile | 9 +- docker/my-dojo/bitcoin/restart.sh | 7 +- docker/my-dojo/bitcoin/rpcauth.py | 50 + docker/my-dojo/conf/docker-bitcoind.conf.tpl | 4 +- docker/my-dojo/dojo.sh | 85 +- docker/my-dojo/explorer/Dockerfile | 2 +- docker/my-dojo/node/Dockerfile | 2 +- docker/my-dojo/node/keys.index.js | 2 +- docker/my-dojo/tor/Dockerfile | 6 +- docker/my-dojo/tor/restart.sh | 18 - docker/my-dojo/whirlpool/Dockerfile | 2 +- keys/index-example.js | 4 +- lib/auth/authorizations-manager.js | 6 +- lib/auth/localapikey-strategy-configurator.js | 3 +- lib/bitcoin/addresses-helper.js | 38 +- lib/bitcoin/addresses-service.js | 12 +- lib/bitcoin/hd-accounts-helper.js | 101 +- lib/bitcoin/hd-accounts-service.js | 69 +- lib/bitcoin/parallel-address-derivation.js | 21 +- lib/bitcoind-rpc/fees.js | 4 +- lib/bitcoind-rpc/headers.js | 2 +- lib/bitcoind-rpc/latest-block.js | 2 +- lib/bitcoind-rpc/rpc-client.js | 7 +- lib/bitcoind-rpc/transactions.js | 14 +- lib/db/mysql-db-wrapper.js | 159 +- lib/http-server/http-server.js | 33 +- lib/indexer-rpc/rpc-client.js | 12 +- lib/remote-importer/bitcoind-wrapper.js | 4 +- lib/remote-importer/esplora-wrapper.js | 4 +- lib/remote-importer/local-indexer-wrapper.js | 2 +- .../local-rest-indexer-wrapper.js | 2 + lib/remote-importer/oxt-wrapper.js | 4 +- lib/remote-importer/remote-importer.js | 29 +- lib/remote-importer/sources-mainnet.js | 6 +- lib/remote-importer/sources-testnet.js | 6 +- lib/remote-importer/sources.js | 4 +- lib/remote-importer/wrapper.js | 3 + lib/util.js | 131 +- lib/wallet/address-info.js | 34 +- lib/wallet/hd-account-info.js | 37 +- lib/wallet/wallet-entities.js | 21 +- lib/wallet/wallet-info.js | 48 +- lib/wallet/wallet-service.js | 28 +- package-lock.json | 3341 ++++++----------- package.json | 30 +- pushtx/orchestrator.js | 12 +- pushtx/pushtx-processor.js | 8 +- pushtx/pushtx-rest-api.js | 4 +- pushtx/transactions-scheduler.js | 8 +- scripts/patches/revert-hd-accounts.js | 14 +- scripts/patches/translate-hd-accounts.js | 20 +- static/admin/dmt/index.js | 2 +- static/admin/dmt/status/status.js | 10 +- static/admin/dmt/txs-tools/txs-tools.js | 2 +- static/admin/dmt/xpubs-tools/xpubs-tools.js | 8 +- static/admin/lib/auth-utils.js | 4 +- static/admin/lib/common-script.js | 8 +- static/admin/lib/errors-utils.js | 2 +- static/admin/lib/format-utils.js | 2 +- test/lib/bitcoin/addresses-helper-test.js | 2 +- test/lib/bitcoin/hd-accounts-helper-test.js | 38 +- tracker/block-worker.js | 10 +- tracker/block.js | 16 +- tracker/blockchain-processor.js | 32 +- tracker/blocks-processor.js | 10 +- tracker/mempool-processor.js | 64 +- tracker/tracker.js | 30 +- tracker/transaction.js | 19 +- tracker/transactions-bundle.js | 19 +- 84 files changed, 1993 insertions(+), 2941 deletions(-) create mode 100644 docker/my-dojo/bitcoin/rpcauth.py diff --git a/RELEASES.md b/RELEASES.md index a1ffa54..6457b94 100644 --- a/RELEASES.md +++ b/RELEASES.md @@ -3,6 +3,7 @@ ## Releases ## +- [v1.11.0](#1_11_0) - [v1.10.1](#1_10_1) - [v1.10.0](#1_10_0) - [v1.9.0](#1_9_0) @@ -17,6 +18,28 @@ - [v1.2.0](#1_2_0) - [v1.1.0](#1_1_0) + + +## Samourai Dojo v1.11.0 ## + +## Breaking ## +- Dojo now requires Node.js v14 + +#### Features #### + +- [#mr242](https://code.samourai.io/dojo/samourai-dojo/-/merge_requests/242) postmix decoy change addresses +- [#mr241](https://code.samourai.io/dojo/samourai-dojo/-/merge_requests/241) update ZeroMQ and Node.js +- [#mr240](https://code.samourai.io/dojo/samourai-dojo/-/merge_requests/240) update Node.js dependencies +- [#mr239](https://code.samourai.io/dojo/samourai-dojo/-/merge_requests/239) update Tor and remove v2 onion addresses +- [#mr238](https://code.samourai.io/dojo/samourai-dojo/-/merge_requests/238) use RPC auth instead of basic auth +- other minor improvements + +#### Bug fixes #### + +- [#mr237](https://code.samourai.io/dojo/samourai-dojo/-/merge_requests/237) fix tracker initialization +- [commit 3ee4ecc6](https://code.samourai.io/dojo/samourai-dojo/-/commit/3ee4ecc645dc88632f4e7bfd00fafe602bcaef13) fix importing from local_bitcoind +- other minor fixes + ## Samourai Dojo v1.10.1 ## diff --git a/accounts/api-helper.js b/accounts/api-helper.js index 243b9d2..42353e8 100644 --- a/accounts/api-helper.js +++ b/accounts/api-helper.js @@ -70,7 +70,9 @@ class ApiHelper { item = item.toLowerCase() ret.addAddress(item, false) } - } catch(e) {} + } catch(e) { + Logger.error(e, 'API : ApiHelper.parseEntities() : Invalid arguments') + } } return ret diff --git a/accounts/fees-rest-api.js b/accounts/fees-rest-api.js index 77f83fc..a62b705 100644 --- a/accounts/fees-rest-api.js +++ b/accounts/fees-rest-api.js @@ -9,7 +9,7 @@ const rpcFees = require('../lib/bitcoind-rpc/fees') const authMgr = require('../lib/auth/authorizations-manager') const HttpServer = require('../lib/http-server/http-server') -const debugApi = !!(process.argv.indexOf('api-debug') > -1) +const debugApi = process.argv.indexOf('api-debug') > -1 /** @@ -29,6 +29,11 @@ class FeesRestApi { authMgr.checkAuthentication.bind(authMgr), this.getFees.bind(this), ) + this.httpServer.app.post( + '/fees', + authMgr.checkAuthentication.bind(authMgr), + this.getFees.bind(this), + ) // Refresh the network fees rpcFees.refresh() } diff --git a/accounts/headers-rest-api.js b/accounts/headers-rest-api.js index 3971e52..63d6e19 100644 --- a/accounts/headers-rest-api.js +++ b/accounts/headers-rest-api.js @@ -12,7 +12,7 @@ const authMgr = require('../lib/auth/authorizations-manager') const HttpServer = require('../lib/http-server/http-server') const apiHelper = require('./api-helper') -const debugApi = !!(process.argv.indexOf('api-debug') > -1) +const debugApi = process.argv.indexOf('api-debug') > -1 /** diff --git a/accounts/multiaddr-rest-api.js b/accounts/multiaddr-rest-api.js index 51cc77f..4399a5f 100644 --- a/accounts/multiaddr-rest-api.js +++ b/accounts/multiaddr-rest-api.js @@ -12,7 +12,7 @@ const authMgr = require('../lib/auth/authorizations-manager') const HttpServer = require('../lib/http-server/http-server') const apiHelper = require('./api-helper') -const debugApi = !!(process.argv.indexOf('api-debug') > -1) +const debugApi = process.argv.indexOf('api-debug') > -1 /** @@ -32,18 +32,20 @@ class MultiaddrRestApi { const urlencodedParser = bodyParser.urlencoded({ extended: true }) this.httpServer.app.get( - '/multiaddr', - authMgr.checkAuthentication.bind(authMgr), - apiHelper.validateEntitiesParams.bind(apiHelper), - this.getMultiaddr.bind(this), + '/multiaddr', + authMgr.checkAuthentication.bind(authMgr), + apiHelper.validateEntitiesParams.bind(apiHelper), + this.getMultiaddr.bind(this), + HttpServer.sendAuthError ) this.httpServer.app.post( - '/multiaddr', - urlencodedParser, - authMgr.checkAuthentication.bind(authMgr), - apiHelper.validateEntitiesParams.bind(apiHelper), - this.postMultiaddr.bind(this), + '/multiaddr', + urlencodedParser, + authMgr.checkAuthentication.bind(authMgr), + apiHelper.validateEntitiesParams.bind(apiHelper), + this.postMultiaddr.bind(this), + HttpServer.sendAuthError ) } @@ -57,16 +59,19 @@ class MultiaddrRestApi { // Check request params if (!apiHelper.checkEntitiesParams(req.query)) return HttpServer.sendError(res, errors.multiaddr.NOACT) - + //return HttpServer.sendError(res, '') // Parse params const entities = apiHelper.parseEntitiesParams(req.query) + if (entities.active.addrs.length === 1 || entities.active.addrs.length === 2 || entities.active.xpubs.length === 1) + return HttpServer.sendError(res, '') + const result = await walletService.getWalletInfo( - entities.active, - entities.legacy, - entities.bip49, - entities.bip84, - entities.pubkey + entities.active, + entities.legacy, + entities.bip49, + entities.bip84, + entities.pubkey ) const ret = JSON.stringify(result, null, 2) @@ -78,7 +83,7 @@ class MultiaddrRestApi { } finally { if (debugApi) { const strParams = - `${req.query.active ? req.query.active : ''} \ + `${req.query.active ? req.query.active : ''} \ ${req.query.new ? req.query.new : ''} \ ${req.query.pubkey ? req.query.pubkey : ''} \ ${req.query.bip49 ? req.query.bip49 : ''} \ @@ -104,11 +109,11 @@ class MultiaddrRestApi { const entities = apiHelper.parseEntitiesParams(req.body) const result = await walletService.getWalletInfo( - entities.active, - entities.legacy, - entities.bip49, - entities.bip84, - entities.pubkey + entities.active, + entities.legacy, + entities.bip49, + entities.bip84, + entities.pubkey ) HttpServer.sendOkDataOnly(res, result) @@ -119,7 +124,7 @@ class MultiaddrRestApi { } finally { if (debugApi) { const strParams = - `${req.body.active ? req.body.active : ''} \ + `${req.body.active ? req.body.active : ''} \ ${req.body.new ? req.body.new : ''} \ ${req.body.pubkey ? req.body.pubkey : ''} \ ${req.body.bip49 ? req.body.bip49 : ''} \ diff --git a/accounts/notifications-server.js b/accounts/notifications-server.js index 1926677..5fd17ec 100644 --- a/accounts/notifications-server.js +++ b/accounts/notifications-server.js @@ -5,7 +5,7 @@ 'use strict' const _ = require('lodash') -const zmq = require('zeromq') +const zmq = require('zeromq/v5-compat') const WebSocket = require('websocket') const Logger = require('../lib/logger') const network = require('../lib/bitcoin/network') @@ -27,9 +27,6 @@ class NotificationsServer { this.httpServer = null // Notifications service this.notifService = null - // Initialize the zmq socket for communications - // with the tracker - this._initTrackerSocket() } /** @@ -40,8 +37,12 @@ class NotificationsServer { this.httpServer = httpServer if (this.notifService !== null) return - + this.notifService = new NotificationsService(httpServer.server) + + // Initialize the zmq socket for communications + // with the tracker + this._initTrackerSocket() } @@ -54,7 +55,7 @@ class NotificationsServer { this.sock.subscribe('block') this.sock.subscribe('transaction') - this.sock.on('message', (topic, message, sequence) => { + this.sock.on('message', (topic, message) => { switch(topic.toString()) { case 'block': try { diff --git a/accounts/notifications-service.js b/accounts/notifications-service.js index 254ca49..8ac5969 100644 --- a/accounts/notifications-service.js +++ b/accounts/notifications-service.js @@ -14,7 +14,7 @@ const apiHelper = require('./api-helper') const status = require('./status') const authMgr = require('../lib/auth/authorizations-manager') -const debug = !!(process.argv.indexOf('ws-debug') > -1) +const debug = process.argv.indexOf('ws-debug') > -1 /** @@ -38,7 +38,7 @@ class NotificationsService { // Cache registering the most recent subscriptions received // Used to filter multiple subscriptions sent by external apps. - this.cacheSubs = LRU({ + this.cacheSubs = new LRU({ // Maximum number of subscriptions to store in cache // Estimate: 1000 clients with an average of 5 subscriptions max: 5000, @@ -80,7 +80,7 @@ class NotificationsService { }) conn.on('message', msg => { - if (msg.type == 'utf8') + if (msg.type === 'utf8') this._handleWSMessage(msg.utf8Data, conn) else this._closeWSConnection(conn, true) @@ -229,7 +229,7 @@ class NotificationsService { /** * Unsubscribe from a topic * @param {string} topic - topic - * @param {int} cid - client id + * @param {number} cid - client id */ _unsub(topic, cid) { if (!this.subs[topic]) @@ -241,7 +241,7 @@ class NotificationsService { this.subs[topic].splice(index, 1) - if (this.subs[topic].length == 0) { + if (this.subs[topic].length === 0) { delete this.subs[topic] if (this.cachePubKeys.hasOwnProperty(topic)) delete this.cachePubKeys[topic] @@ -391,7 +391,7 @@ class NotificationsService { for (let cid of this.subs[topic]) { if (!clients[cid]) clients[cid] = [] - if (clients[cid].indexOf(topic) == -1) + if (clients[cid].indexOf(topic) === -1) clients[cid].push(topic) } } @@ -429,7 +429,7 @@ class NotificationsService { } // Move on if the custom transaction has no inputs or outputs - if (ctx.inputs.length == 0 && ctx.out.length == 0) + if (ctx.inputs.length === 0 && ctx.out.length === 0) continue // Send custom transaction to client @@ -454,7 +454,7 @@ class NotificationsService { /** * Dispatch notification for an authentication error * @param {string} err - error - * @param {integer} cid - connection id + * @param {number} cid - connection id */ notifyAuthError(err, cid) { const data = { diff --git a/accounts/status-rest-api.js b/accounts/status-rest-api.js index b97ad1b..5e5fbbe 100644 --- a/accounts/status-rest-api.js +++ b/accounts/status-rest-api.js @@ -11,7 +11,7 @@ const authMgr = require('../lib/auth/authorizations-manager') const HttpServer = require('../lib/http-server/http-server') const status = require('./status') -const debugApi = !!(process.argv.indexOf('api-debug') > -1) +const debugApi = process.argv.indexOf('api-debug') > -1 /** diff --git a/accounts/status.js b/accounts/status.js index f07e0b0..93d4123 100644 --- a/accounts/status.js +++ b/accounts/status.js @@ -29,7 +29,7 @@ class Status { /** * Get current status - * @returns {Promise - object} status object + * @returns {Promise} status object */ async getCurrent() { const uptime = util.timePeriod((Date.now() - this.t0) / 1000, false) @@ -49,8 +49,8 @@ class Status { let indexerMaxHeight = null let indexerUrl = null - if (indexerType == 'third_party_explorer') { - indexerUrl = (network.key == 'bitcoin') + if (indexerType === 'third_party_explorer') { + indexerUrl = (network.key === 'bitcoin') ? keys.indexer.oxt : keys.indexer.esplora } diff --git a/accounts/support-rest-api.js b/accounts/support-rest-api.js index 3d4e51a..d4bc279 100644 --- a/accounts/support-rest-api.js +++ b/accounts/support-rest-api.js @@ -19,7 +19,7 @@ const AddressInfo = require('../lib/wallet/address-info') const apiHelper = require('./api-helper') const keys = require('../keys')[network.key] -const debugApi = !!(process.argv.indexOf('api-debug') > -1) +const debugApi = process.argv.indexOf('api-debug') > -1 /** @@ -94,7 +94,7 @@ class SupportRestApi { try { // Parse the entities passed as url params const entities = apiHelper.parseEntities(req.params.addr).addrs - if (entities.length == 0) + if (entities.length === 0) return HttpServer.sendError(res, errors.address.INVALID) const address = entities[0] @@ -133,7 +133,7 @@ class SupportRestApi { try { // Parse the entities passed as url params const entities = apiHelper.parseEntities(req.params.addr).addrs - if (entities.length == 0) + if (entities.length === 0) return HttpServer.sendError(res, errors.address.INVALID) const address = entities[0] @@ -162,7 +162,7 @@ class SupportRestApi { try { // Parse the entities passed as url params const entities = apiHelper.parseEntities(req.params.xpub).xpubs - if (entities.length == 0) + if (entities.length === 0) return HttpServer.sendError(res, errors.xpub.INVALID) const xpub = entities[0] @@ -174,7 +174,7 @@ class SupportRestApi { const ret = this._formatXpubInfoResult(info) HttpServer.sendRawData(res, ret) } catch(e) { - if(e == errors.db.ERROR_NO_HD_ACCOUNT) { + if(e === errors.db.ERROR_NO_HD_ACCOUNT) { const ret = this._formatXpubInfoResult(info) HttpServer.sendRawData(res, ret) } else { @@ -210,7 +210,7 @@ class SupportRestApi { try { // Parse the entities passed as url params const entities = apiHelper.parseEntities(req.params.xpub).xpubs - if (entities.length == 0) + if (entities.length === 0) return HttpServer.sendError(res, errors.xpub.INVALID) const xpub = entities[0] @@ -226,10 +226,10 @@ class SupportRestApi { await hdaService.rescan(xpub, gapLimit, startIndex) HttpServer.sendRawData(res, JSON.stringify(ret, null, 2)) } catch(e) { - if (e == errors.db.ERROR_NO_HD_ACCOUNT) { + if (e === errors.db.ERROR_NO_HD_ACCOUNT) { ret.status = 'Error: Not tracking xpub' HttpServer.sendRawData(res, JSON.stringify(ret, null, 2)) - } else if (e == errors.xpub.OVERLAP) { + } else if (e === errors.xpub.OVERLAP) { ret.status = 'Error: Rescan in progress' HttpServer.sendRawData(res, JSON.stringify(ret, null, 2)) } else { @@ -256,7 +256,7 @@ class SupportRestApi { try { // Parse the entities passed as url params const entities = apiHelper.parseEntities(req.params.xpub).xpubs - if (entities.length == 0) + if (entities.length === 0) return HttpServer.sendError(res, errors.xpub.INVALID) const xpub = entities[0] diff --git a/accounts/transactions-rest-api.js b/accounts/transactions-rest-api.js index fc1e9ac..04e8998 100644 --- a/accounts/transactions-rest-api.js +++ b/accounts/transactions-rest-api.js @@ -15,7 +15,7 @@ const network = require('../lib/bitcoin/network') const apiHelper = require('./api-helper') const keys = require('../keys')[network.key] -const debugApi = !!(process.argv.indexOf('api-debug') > -1) +const debugApi = process.argv.indexOf('api-debug') > -1 /** @@ -86,7 +86,7 @@ class TransactionsRestApi { const result = await walletService.getWalletTransactions(active, page, count) if (excludeNullXfer) { result.txs = result.txs.filter(tx => { - return tx['result'] != 0 + return tx['result'] !== 0 }) } diff --git a/accounts/unspent-rest-api.js b/accounts/unspent-rest-api.js index d9152f6..bda50a0 100644 --- a/accounts/unspent-rest-api.js +++ b/accounts/unspent-rest-api.js @@ -12,7 +12,7 @@ const authMgr = require('../lib/auth/authorizations-manager') const HttpServer = require('../lib/http-server/http-server') const apiHelper = require('./api-helper') -const debugApi = !!(process.argv.indexOf('api-debug') > -1) +const debugApi = process.argv.indexOf('api-debug') > -1 /** diff --git a/accounts/wallet-rest-api.js b/accounts/wallet-rest-api.js index 493eeb9..fffce1f 100644 --- a/accounts/wallet-rest-api.js +++ b/accounts/wallet-rest-api.js @@ -11,9 +11,9 @@ const walletService = require('../lib/wallet/wallet-service') const authMgr = require('../lib/auth/authorizations-manager') const HttpServer = require('../lib/http-server/http-server') const apiHelper = require('./api-helper') +const hdaService = require('../lib/bitcoin/hd-accounts-service') -const debugApi = !!(process.argv.indexOf('api-debug') > -1) - +const debugApi = process.argv.indexOf('api-debug') > -1 /** * Wallet API endpoints @@ -60,6 +60,10 @@ class WalletRestApi { // Parse params const entities = apiHelper.parseEntitiesParams(req.query) + if (req.query.importPostmixLikeTypeChange) { + await hdaService.importPostmixLikeTypeChange(entities.active.xpubs) + } + const result = await walletService.getFullWalletInfo( entities.active, entities.legacy, @@ -102,6 +106,10 @@ class WalletRestApi { // Parse params const entities = apiHelper.parseEntitiesParams(req.body) + if (req.body.importPostmixLikeTypeChange) { + await hdaService.importPostmixLikeTypeChange(entities.active.xpubs) + } + const result = await walletService.getFullWalletInfo( entities.active, entities.legacy, diff --git a/accounts/xpub-rest-api.js b/accounts/xpub-rest-api.js index 47f65a4..c18b30b 100644 --- a/accounts/xpub-rest-api.js +++ b/accounts/xpub-rest-api.js @@ -113,9 +113,9 @@ class XPubRestApi { if (argSegwit) { const segwit = argSegwit.toLowerCase() - if (segwit == 'bip49') + if (segwit === 'bip49') scheme = hdaHelper.BIP49 - else if (segwit == 'bip84') + else if (segwit === 'bip84') scheme = hdaHelper.BIP84 else return HttpServer.sendError(res, errors.xpub.SEGWIT) @@ -125,7 +125,7 @@ class XPubRestApi { const forceOverride = argForceOverride ? argForceOverride : false // Process action - if (argAction == 'new') { + if (argAction === 'new') { // New hd account try { await hdaService.createHdAccount(xpub, scheme) @@ -133,7 +133,7 @@ class XPubRestApi { } catch(e) { HttpServer.sendError(res, e) } - } else if (argAction == 'restore') { + } else if (argAction === 'restore') { // Restore hd account try { await hdaService.restoreHdAccount(xpub, scheme, forceOverride) @@ -229,7 +229,7 @@ class XPubRestApi { if (status != null) { ret['import_in_progress'] = true ret['status'] = status['status'] - if (ret['status'] == remoteImporter.STATUS_RESCAN) + if (ret['status'] === remoteImporter.STATUS_RESCAN) ret['hits'] = status['txs_int'] + status['txs_ext'] else ret['hits'] = status['txs'] @@ -268,7 +268,7 @@ class XPubRestApi { if (!req.body.message) return HttpServer.sendError(res, errors.body.NOMSG) - if (!(req.body.message == 'lock' || req.body.message == 'unlock')) + if (!(req.body.message === 'lock' || req.body.message === 'unlock')) return HttpServer.sendError(res, errors.sig.INVMSG) // Extract arguments @@ -289,7 +289,7 @@ class XPubRestApi { try { // Check the signature and process the request await hdaService.verifyXpubSignature(xpub, argAddr, argSig, argMsg, scheme) - const lock = (argMsg == 'unlock') ? false : true + const lock = argMsg !== 'unlock' const ret = await hdaService.lockHdAccount(xpub, lock) HttpServer.sendOkData(res, {derivation: ret}) } catch(e) { @@ -385,7 +385,7 @@ class XPubRestApi { } } catch(e) { - const err = (e == errors.xpub.PRIVKEY) ? e : errors.xpub.INVALID + const err = (e === errors.xpub.PRIVKEY) ? e : errors.xpub.INVALID throw err } } diff --git a/docker/my-dojo/.env b/docker/my-dojo/.env index 16da41c..6f53c81 100644 --- a/docker/my-dojo/.env +++ b/docker/my-dojo/.env @@ -10,12 +10,12 @@ COMPOSE_CONVERT_WINDOWS_PATHS=1 -DOJO_VERSION_TAG=1.10.1 +DOJO_VERSION_TAG=1.11.0 DOJO_DB_VERSION_TAG=1.3.0 DOJO_BITCOIND_VERSION_TAG=1.12.0 -DOJO_NODEJS_VERSION_TAG=1.10.1 +DOJO_NODEJS_VERSION_TAG=1.11.0 DOJO_NGINX_VERSION_TAG=1.6.0 -DOJO_TOR_VERSION_TAG=1.9.0 +DOJO_TOR_VERSION_TAG=1.10.0 DOJO_EXPLORER_VERSION_TAG=1.7.0 DOJO_INDEXER_VERSION_TAG=1.3.0 DOJO_WHIRLPOOL_VERSION_TAG=1.4.0 diff --git a/docker/my-dojo/bitcoin/Dockerfile b/docker/my-dojo/bitcoin/Dockerfile index 6c6a991..ea8128e 100644 --- a/docker/my-dojo/bitcoin/Dockerfile +++ b/docker/my-dojo/bitcoin/Dockerfile @@ -19,7 +19,7 @@ ARG TOR_LINUX_GID RUN set -ex && \ apt-get update && \ - apt-get install -qq --no-install-recommends ca-certificates dirmngr gosu gpg gpg-agent wget && \ + apt-get install -qq --no-install-recommends ca-certificates dirmngr gosu gpg gpg-agent wget python3 && \ rm -rf /var/lib/apt/lists/* # Build and install bitcoin binaries @@ -56,6 +56,13 @@ RUN chown bitcoin:bitcoin /wait-for-it.sh && \ chmod u+x /wait-for-it.sh && \ chmod g+x /wait-for-it.sh +# Copy rpcauth.py script +COPY ./rpcauth.py /rpcauth.py + +RUN chown bitcoin:bitcoin /rpcauth.py && \ + chmod u+x /rpcauth.py && \ + chmod g+x /rpcauth.py + EXPOSE 8333 9501 9502 28256 USER bitcoin diff --git a/docker/my-dojo/bitcoin/restart.sh b/docker/my-dojo/bitcoin/restart.sh index df3e9c1..3c5f961 100644 --- a/docker/my-dojo/bitcoin/restart.sh +++ b/docker/my-dojo/bitcoin/restart.sh @@ -1,6 +1,9 @@ #!/bin/bash set -e +# Generate RPC auth payload +BITCOIND_RPC_AUTH=$(./rpcauth.py $BITCOIND_RPC_USER $BITCOIND_RPC_PASSWORD) + echo "## Start bitcoind #############################" bitcoind_options=( @@ -18,11 +21,10 @@ bitcoind_options=( -proxy=$NET_DOJO_TOR_IPV4:9050 -rpcallowip=0.0.0.0/0 -rpcbind=$NET_DOJO_BITCOIND_IPV4 - -rpcpassword=$BITCOIND_RPC_PASSWORD -rpcport=28256 -rpcthreads=$BITCOIND_RPC_THREADS -rpcworkqueue=$BITCOIND_RPC_WORK_QUEUE - -rpcuser=$BITCOIND_RPC_USER + -rpcauth=$BITCOIND_RPC_AUTH -server=1 -txindex=1 -zmqpubhashblock=tcp://0.0.0.0:9502 @@ -32,7 +34,6 @@ bitcoind_options=( if [ "$BITCOIND_LISTEN_MODE" == "on" ]; then bitcoind_options+=(-listen=1) bitcoind_options+=(-bind="$NET_DOJO_BITCOIND_IPV4") - bitcoind_options+=(-externalip=$(cat /var/lib/tor/hsv2bitcoind/hostname)) bitcoind_options+=(-externalip=$(cat /var/lib/tor/hsv3bitcoind/hostname)) fi diff --git a/docker/my-dojo/bitcoin/rpcauth.py b/docker/my-dojo/bitcoin/rpcauth.py new file mode 100644 index 0000000..ac65fdc --- /dev/null +++ b/docker/my-dojo/bitcoin/rpcauth.py @@ -0,0 +1,50 @@ +#!/usr/bin/env python3 +# Copyright (c) 2015-2018 The Bitcoin Core developers +# Distributed under the MIT software license, see the accompanying +# file COPYING or http://www.opensource.org/licenses/mit-license.php. + +from argparse import ArgumentParser +from base64 import urlsafe_b64encode +from binascii import hexlify +from getpass import getpass +from os import urandom + +import hmac + +def generate_salt(size): + """Create size byte hex salt""" + return hexlify(urandom(size)).decode() + +def generate_password(): + """Create 32 byte b64 password""" + return urlsafe_b64encode(urandom(32)).decode('utf-8') + +def password_to_hmac(salt, password): + m = hmac.new(bytearray(salt, 'utf-8'), bytearray(password, 'utf-8'), 'SHA256') + return m.hexdigest() + +def main(): + parser = ArgumentParser(description='Create login credentials for a JSON-RPC user') + parser.add_argument('username', help='the username for authentication') + parser.add_argument('password', help='leave empty to generate a random password or specify "-" to prompt for password', nargs='?') + args = parser.parse_args() + + if not args.password: + args.password = generate_password() + elif args.password == '-': + args.password = getpass() + + # Create 16 byte hex salt + salt = generate_salt(16) + password_hmac = password_to_hmac(salt, args.password) + + ## Comment out original script output + # print('String to be appended to bitcoin.conf:') + # print('rpcauth={0}:{1}${2}'.format(args.username, salt, password_hmac)) + # print('Your password:\n{0}'.format(args.password)) + + ## Added custom script output to use in restart.sh + print('{0}:{1}${2}'.format(args.username, salt, password_hmac)) + +if __name__ == '__main__': + main() diff --git a/docker/my-dojo/conf/docker-bitcoind.conf.tpl b/docker/my-dojo/conf/docker-bitcoind.conf.tpl index 6a19192..02ccf70 100644 --- a/docker/my-dojo/conf/docker-bitcoind.conf.tpl +++ b/docker/my-dojo/conf/docker-bitcoind.conf.tpl @@ -28,7 +28,7 @@ BITCOIND_RPC_THREADS=6 # RPC Work queue size # Type: integer -BITCOIND_RPC_WORK_QUEUE=16 +BITCOIND_RPC_WORK_QUEUE=64 # Mempool expiry in hours # Defines how long transactions stay in your local mempool before expiring @@ -120,4 +120,4 @@ BITCOIND_ZMQ_BLK_HASH=9502 # Defines how long Dojo waits for a clean shutdown of bitcoind before shutting down the bitcoind container # This parameter is inactive if BITCOIND_INSTALL is set to 'off' # Type: integer -BITCOIND_SHUTDOWN_DELAY=180 \ No newline at end of file +BITCOIND_SHUTDOWN_DELAY=180 diff --git a/docker/my-dojo/dojo.sh b/docker/my-dojo/dojo.sh index 3798f38..37d0611 100755 --- a/docker/my-dojo/dojo.sh +++ b/docker/my-dojo/dojo.sh @@ -85,7 +85,6 @@ stop() { # Renewal of bitcoind onion address if [ "$BITCOIND_LISTEN_MODE" == "on" ]; then if [ "$BITCOIND_EPHEMERAL_HS" = "on" ]; then - $( docker exec -it tor rm -rf /var/lib/tor/hsv2bitcoind ) &> /dev/null $( docker exec -it tor rm -rf /var/lib/tor/hsv3bitcoind ) &> /dev/null fi fi @@ -355,77 +354,35 @@ upgrade() { # Display the onion addresses onion() { - version=3 - - # Extract version arguments - if [ $# -gt 0 ]; then - for option in $@ - do - case "$option" in - v2 ) version=2 ;; - v3 ) version=3 ;; - * ) break ;; - esac - done - fi - echo " " echo "WARNING: Do not share these onion addresses with anyone!" echo " To allow another person to use this Dojo with their Samourai Wallet," echo " you should share the QRCodes provided by the Maintenance Tool." echo " " - if [ $version -eq 3 ]; then - # V3 onion addresses - V3_ADDR=$( docker exec -it tor cat /var/lib/tor/hsv3dojo/hostname ) - echo "Dojo API and Maintenance Tool = $V3_ADDR" - echo " " - - if [ "$EXPLORER_INSTALL" == "on" ]; then - V3_ADDR_EXPLORER=$( docker exec -it tor cat /var/lib/tor/hsv3explorer/hostname ) - echo "Block Explorer = $V3_ADDR_EXPLORER" - echo " " - fi - - if [ "$WHIRLPOOL_INSTALL" == "on" ]; then - V3_ADDR_WHIRLPOOL=$( docker exec -it tor cat /var/lib/tor/hsv3whirlpool/hostname ) - echo "Your private Whirlpool client (do not share) = $V3_ADDR_WHIRLPOOL" - echo " " - fi - - if [ "$BITCOIND_INSTALL" == "on" ]; then - if [ "$BITCOIND_LISTEN_MODE" == "on" ]; then - V3_ADDR_BTCD=$( docker exec -it tor cat /var/lib/tor/hsv3bitcoind/hostname ) - echo "Your local bitcoind (do not share) = $V3_ADDR_BTCD" - echo " " - fi - fi + # V3 onion addresses + V3_ADDR=$( docker exec -it tor cat /var/lib/tor/hsv3dojo/hostname ) + echo "Dojo API and Maintenance Tool = $V3_ADDR" + echo " " - else - # v2 onion addresses - V2_ADDR=$( docker exec -it tor cat /var/lib/tor/hsv2dojo/hostname ) - echo "Dojo API and Maintenance Tool = $V2_ADDR" + if [ "$EXPLORER_INSTALL" == "on" ]; then + V3_ADDR_EXPLORER=$( docker exec -it tor cat /var/lib/tor/hsv3explorer/hostname ) + echo "Block Explorer = $V3_ADDR_EXPLORER" echo " " + fi - if [ "$EXPLORER_INSTALL" == "on" ]; then - V2_ADDR_EXPLORER=$( docker exec -it tor cat /var/lib/tor/hsv2explorer/hostname ) - echo "Block Explorer = $V2_ADDR_EXPLORER" - echo " " - fi + if [ "$WHIRLPOOL_INSTALL" == "on" ]; then + V3_ADDR_WHIRLPOOL=$( docker exec -it tor cat /var/lib/tor/hsv3whirlpool/hostname ) + echo "Your private Whirlpool client (do not share) = $V3_ADDR_WHIRLPOOL" + echo " " + fi - if [ "$WHIRLPOOL_INSTALL" == "on" ]; then - V2_ADDR_WHIRLPOOL=$( docker exec -it tor cat /var/lib/tor/hsv2whirlpool/hostname ) - echo "Your private Whirlpool client (do not share) = $V2_ADDR_WHIRLPOOL" + if [ "$BITCOIND_INSTALL" == "on" ]; then + if [ "$BITCOIND_LISTEN_MODE" == "on" ]; then + V3_ADDR_BTCD=$( docker exec -it tor cat /var/lib/tor/hsv3bitcoind/hostname ) + echo "Your local bitcoind (do not share) = $V3_ADDR_BTCD" echo " " fi - - if [ "$BITCOIND_INSTALL" == "on" ]; then - if [ "$BITCOIND_LISTEN_MODE" == "on" ]; then - V2_ADDR_BTCD=$( docker exec -it tor cat /var/lib/tor/hsv2bitcoind/hostname ) - echo "Your local bitcoind (do not share) = $V2_ADDR_BTCD" - echo " " - fi - fi fi } @@ -561,11 +518,7 @@ help() { echo " Available options:" echo " -n [VALUE] : display the last VALUE lines" echo " " - echo " onion [version] Display the Tor onion addresses allowing your wallet to access your dojo." - echo " " - echo " Available versions:" - echo " v2: display Tor v2 onion addresses" - echo " v3 (default): display Tor v3 onion addresses" + echo " onion Display the Tor onion addresses allowing your wallet to access your dojo." echo " " echo " restart Restart your dojo." echo " " @@ -659,7 +612,7 @@ case "$subcommand" in logs "$module" $numlines ;; onion ) - onion "$@" + onion ;; restart ) restart diff --git a/docker/my-dojo/explorer/Dockerfile b/docker/my-dojo/explorer/Dockerfile index ba351e9..6cdc3e6 100644 --- a/docker/my-dojo/explorer/Dockerfile +++ b/docker/my-dojo/explorer/Dockerfile @@ -1,4 +1,4 @@ -FROM node:12-alpine +FROM node:14-alpine ENV NODE_ENV production diff --git a/docker/my-dojo/node/Dockerfile b/docker/my-dojo/node/Dockerfile index 47527c0..b599426 100644 --- a/docker/my-dojo/node/Dockerfile +++ b/docker/my-dojo/node/Dockerfile @@ -1,4 +1,4 @@ -FROM node:12-alpine +FROM node:14-alpine ENV NODE_ENV production diff --git a/docker/my-dojo/node/keys.index.js b/docker/my-dojo/node/keys.index.js index 2d492d4..0205ecf 100644 --- a/docker/my-dojo/node/keys.index.js +++ b/docker/my-dojo/node/keys.index.js @@ -14,7 +14,7 @@ const bitcoinNetwork = (process.env.COMMON_BTC_NETWORK == 'testnet') let explorerActive = 'oxt' let explorerUrl = 'https://oxt.me' let explorerPassword = '' -if (process.env.EXPLORER_INSTALL == 'on') { +if (process.env.EXPLORER_INSTALL === 'on') { try { explorerUrl = fs.readFileSync('/var/lib/tor/hsv3explorer/hostname', 'utf8').replace('\n', '') explorerPassword = process.env.EXPLORER_KEY diff --git a/docker/my-dojo/tor/Dockerfile b/docker/my-dojo/tor/Dockerfile index 1b57a53..9774e95 100644 --- a/docker/my-dojo/tor/Dockerfile +++ b/docker/my-dojo/tor/Dockerfile @@ -3,7 +3,7 @@ FROM debian:buster-slim ENV TOR_HOME /var/lib/tor ENV TOR_URL https://dist.torproject.org ENV TOR_MIRROR_URL https://tor.eff.org/dist -ENV TOR_VERSION 0.4.5.8 +ENV TOR_VERSION 0.4.6.6 ENV TOR_GPG_KS_URI hkp://keyserver.ubuntu.com:80 ENV TOR_GPG_KEY1 0xEB5A896A28988BF5 ENV TOR_GPG_KEY2 0xC218525819F78451 @@ -11,8 +11,8 @@ ENV TOR_GPG_KEY3 0x21194EBB165733EA ENV TOR_GPG_KEY4 0x6AFEE6D49E92B601 ENV GOLANG_DL_URL https://dl.google.com/go -ENV GOLANG_ARCHIVE go1.16.4.linux-amd64.tar.gz -ENV GOLANG_SHA256 7154e88f5a8047aad4b80ebace58a059e36e7e2e4eb3b383127a28c711b4ff59 +ENV GOLANG_ARCHIVE go1.16.6.linux-amd64.tar.gz +ENV GOLANG_SHA256 be333ef18b3016e9d7cb7b1ff1fdb0cac800ca0be4cf2290fe613b3d069dfe0d ENV OBFS4_URL https://github.com/Yawning/obfs4.git ENV OBFS4_VERSION 0.0.11 diff --git a/docker/my-dojo/tor/restart.sh b/docker/my-dojo/tor/restart.sh index a7754b9..ae2b8dc 100644 --- a/docker/my-dojo/tor/restart.sh +++ b/docker/my-dojo/tor/restart.sh @@ -13,9 +13,6 @@ tor_options=( --SocksPolicy "reject *" --DataDirectory /var/lib/tor/.tor --DataDirectoryGroupReadable 1 - --HiddenServiceDir /var/lib/tor/hsv2dojo - --HiddenServiceVersion 2 - --HiddenServicePort "80 $NET_DMZ_NGINX_IPV4:80" --HiddenServiceDir /var/lib/tor/hsv3dojo --HiddenServiceVersion 3 --HiddenServicePort "80 $NET_DMZ_NGINX_IPV4:80" @@ -23,11 +20,6 @@ tor_options=( if [ "$BITCOIND_INSTALL" == "on" ]; then if [ "$BITCOIND_LISTEN_MODE" == "on" ]; then - tor_options+=(--HiddenServiceDir /var/lib/tor/hsv2bitcoind) - tor_options+=(--HiddenServiceVersion 2) - tor_options+=(--HiddenServicePort "8333 $NET_DOJO_BITCOIND_IPV4:8333") - tor_options+=(--HiddenServiceDirGroupReadable 1) - tor_options+=(--HiddenServiceDir /var/lib/tor/hsv3bitcoind) tor_options+=(--HiddenServiceVersion 3) tor_options+=(--HiddenServicePort "8333 $NET_DOJO_BITCOIND_IPV4:8333") @@ -36,11 +28,6 @@ if [ "$BITCOIND_INSTALL" == "on" ]; then fi if [ "$EXPLORER_INSTALL" == "on" ]; then - tor_options+=(--HiddenServiceDir /var/lib/tor/hsv2explorer) - tor_options+=(--HiddenServiceVersion 2) - tor_options+=(--HiddenServicePort "80 $NET_DMZ_NGINX_IPV4:9080") - tor_options+=(--HiddenServiceDirGroupReadable 1) - tor_options+=(--HiddenServiceDir /var/lib/tor/hsv3explorer) tor_options+=(--HiddenServiceVersion 3) tor_options+=(--HiddenServicePort "80 $NET_DMZ_NGINX_IPV4:9080") @@ -48,11 +35,6 @@ if [ "$EXPLORER_INSTALL" == "on" ]; then fi if [ "$WHIRLPOOL_INSTALL" == "on" ]; then - tor_options+=(--HiddenServiceDir /var/lib/tor/hsv2whirlpool) - tor_options+=(--HiddenServiceVersion 2) - tor_options+=(--HiddenServicePort "80 $NET_DMZ_NGINX_IPV4:8898") - tor_options+=(--HiddenServiceDirGroupReadable 1) - tor_options+=(--HiddenServiceDir /var/lib/tor/hsv3whirlpool) tor_options+=(--HiddenServiceVersion 3) tor_options+=(--HiddenServicePort "80 $NET_DMZ_NGINX_IPV4:8898") diff --git a/docker/my-dojo/whirlpool/Dockerfile b/docker/my-dojo/whirlpool/Dockerfile index 658e899..bb231ab 100644 --- a/docker/my-dojo/whirlpool/Dockerfile +++ b/docker/my-dojo/whirlpool/Dockerfile @@ -27,7 +27,7 @@ RUN set -ex && \ # Install Tor ENV WHIRLPOOL_TOR_URL https://dist.torproject.org ENV WHIRLPOOL_TOR_MIRROR_URL https://tor.eff.org/dist -ENV WHIRLPOOL_TOR_VERSION 0.4.4.8 +ENV WHIRLPOOL_TOR_VERSION 0.4.6.6 ENV WHIRLPOOL_TOR_GPG_KS_URI hkp://keyserver.ubuntu.com:80 ENV WHIRLPOOL_TOR_GPG_KEY1 0xEB5A896A28988BF5 ENV WHIRLPOOL_TOR_GPG_KEY2 0xC218525819F78451 diff --git a/keys/index-example.js b/keys/index-example.js index eb22f08..c1c2fa1 100644 --- a/keys/index-example.js +++ b/keys/index-example.js @@ -16,7 +16,7 @@ module.exports = { /* * Dojo version */ - dojoVersion: '1.10.1', + dojoVersion: '1.11.0', /* * Bitcoind */ @@ -233,7 +233,7 @@ module.exports = { * Testnet parameters */ testnet: { - dojoVersion: '1.9.0', + dojoVersion: '1.11.0', bitcoind: { rpc: { user: 'user', diff --git a/lib/auth/authorizations-manager.js b/lib/auth/authorizations-manager.js index 58555f9..c332722 100644 --- a/lib/auth/authorizations-manager.js +++ b/lib/auth/authorizations-manager.js @@ -162,7 +162,7 @@ class AuthorizationsManager { try { const decodedToken = this.isAuthenticated(token) - if (decodedToken['prf'] == this.TOKEN_PROFILE_ADMIN) { + if (decodedToken['prf'] === this.TOKEN_PROFILE_ADMIN) { req.authorizations = {decoded_access_token: decodedToken} next() } else { @@ -249,7 +249,7 @@ class AuthorizationsManager { {algorithms: [this.JWT_ALGO]} ) - if (payload['type'] != this.TOKEN_TYPE_ACCESS) + if (payload['type'] !== this.TOKEN_TYPE_ACCESS) throw errors.auth.INVALID_JWT return payload @@ -309,7 +309,7 @@ class AuthorizationsManager { {algorithms: [this.JWT_ALGO]} ) - if (payload['type'] != this.TOKEN_TYPE_REFRESH) + if (payload['type'] !== this.TOKEN_TYPE_REFRESH) throw errors.auth.INVALID_JWT return payload diff --git a/lib/auth/localapikey-strategy-configurator.js b/lib/auth/localapikey-strategy-configurator.js index 951c573..240011a 100644 --- a/lib/auth/localapikey-strategy-configurator.js +++ b/lib/auth/localapikey-strategy-configurator.js @@ -33,7 +33,6 @@ class LocalApiKeyStrategyConfigurator { /** * Authentication - * @param {object} req - http request object * @param {string} apiKey - api key received * @param {function} done - callback */ @@ -41,7 +40,7 @@ class LocalApiKeyStrategyConfigurator { const _adminKey = keys.auth.strategies[LocalApiKeyStrategyConfigurator.NAME].adminKey const _apiKeys = keys.auth.strategies[LocalApiKeyStrategyConfigurator.NAME].apiKeys - if (apiKey == _adminKey) { + if (apiKey === _adminKey) { // Check if received key is a valid api key Logger.info('Auth : Successful authentication with an admin key') return done(null, {'profile': authorzMgr.TOKEN_PROFILE_ADMIN}) diff --git a/lib/bitcoin/addresses-helper.js b/lib/bitcoin/addresses-helper.js index e5d6495..abb4862 100644 --- a/lib/bitcoin/addresses-helper.js +++ b/lib/bitcoin/addresses-helper.js @@ -65,7 +65,7 @@ class AddressesHelper { verifySignature(msg, address, sig) { try { const prefix = activeNet.messagePrefix - return btcMessage.verify(msg, prefix, address, sig) + return btcMessage.verify(msg, address, sig, prefix) } catch(e) { return false } @@ -77,7 +77,7 @@ class AddressesHelper { * @returns {boolean} return true if str is a supported pubkey format, false otherwise */ isSupportedPubKey(str) { - return (str.length == 66 && (str.startsWith('02') || str.startsWith('03'))) + return (str.length === 66 && (str.startsWith('02') || str.startsWith('03'))) } /** @@ -97,7 +97,7 @@ class AddressesHelper { /** * Get the script hash associated to a Bech32 address * @param {string} str - bech32 address - * @returns {string} script hash in hex format + * @returns {string | null} script hash in hex format */ getScriptHashFromBech32(str) { try { @@ -114,12 +114,12 @@ class AddressesHelper { * @returns {boolean} return true if output is a P2PKH script, otherwise return false */ isP2pkhScript(scriptpubkey) { - return scriptpubkey.length == 25 - && scriptpubkey[0] == OPS.OP_DUP - && scriptpubkey[1] == OPS.OP_HASH160 - && scriptpubkey[2] == 0x14 - && scriptpubkey[23] == OPS.OP_EQUALVERIFY - && scriptpubkey[24] == OPS.OP_CHECKSIG + return scriptpubkey.length === 25 + && scriptpubkey[0] === OPS.OP_DUP + && scriptpubkey[1] === OPS.OP_HASH160 + && scriptpubkey[2] === 0x14 + && scriptpubkey[23] === OPS.OP_EQUALVERIFY + && scriptpubkey[24] === OPS.OP_CHECKSIG } /** @@ -128,10 +128,10 @@ class AddressesHelper { * @returns {boolean} return true if output is a P2SH script, otherwise return false */ isP2shScript(scriptpubkey) { - return scriptpubkey.length == 23 - && scriptpubkey[0] == OPS.OP_HASH160 - && scriptpubkey[1] == 0x14 - && scriptpubkey[22] == OPS.OP_EQUAL + return scriptpubkey.length === 23 + && scriptpubkey[0] === OPS.OP_HASH160 + && scriptpubkey[1] === 0x14 + && scriptpubkey[22] === OPS.OP_EQUAL } /** @@ -140,9 +140,9 @@ class AddressesHelper { * @returns {boolean} return true if output is a P2WPKH script, otherwise return false */ isP2wpkhScript(scriptpubkey) { - return scriptpubkey.length == 22 - && scriptpubkey[0] == OPS.OP_0 - && scriptpubkey[1] == 0x14 + return scriptpubkey.length === 22 + && scriptpubkey[0] === OPS.OP_0 + && scriptpubkey[1] === 0x14 } /** @@ -151,9 +151,9 @@ class AddressesHelper { * @returns {boolean} return true if output is a P2WSH script, otherwise return false */ isP2wshScript(scriptpubkey) { - return scriptpubkey.length == 34 - && scriptpubkey[0] == OPS.OP_0 - && scriptpubkey[1] == 0x20 + return scriptpubkey.length === 34 + && scriptpubkey[0] === OPS.OP_0 + && scriptpubkey[1] === 0x20 } /** diff --git a/lib/bitcoin/addresses-service.js b/lib/bitcoin/addresses-service.js index fed881d..afce6d8 100644 --- a/lib/bitcoin/addresses-service.js +++ b/lib/bitcoin/addresses-service.js @@ -21,24 +21,24 @@ class AddressesService { /** * Rescan the blockchain for an address * @param {string} address - bitcoin address - * @returns {Promise} + * @returns {Promise} */ async rescan(address) { const hdaccount = await db.getUngroupedHDAccountsByAddresses([address]) // Don't filter addresses associated to an HDAccount const filterAddr = !(hdaccount.length > 0 && hdaccount[0]['hdID']) - return remote.importAddresses([address], filterAddr) + return await remote.importAddresses([address], filterAddr) } /** * Restore an address in db * @param {string[]} addresses - array of bitcoin addresses * @param {boolean} filterAddr - true if addresses should be filter, false otherwise - * @returns {Promise} + * @returns {Promise} */ - async restoreAddresses(address, filterAddr) { - return remote.importAddresses(address, filterAddr) + async restoreAddresses(addresses, filterAddr) { + return await remote.importAddresses(addresses, filterAddr) } } -module.exports = new AddressesService() \ No newline at end of file +module.exports = new AddressesService() diff --git a/lib/bitcoin/hd-accounts-helper.js b/lib/bitcoin/hd-accounts-helper.js index 51dfe0f..78287e1 100644 --- a/lib/bitcoin/hd-accounts-helper.js +++ b/lib/bitcoin/hd-accounts-helper.js @@ -16,6 +16,7 @@ const activeNet = network.network const keys = require('../../keys/')[network.key] const addrHelper = require('./addresses-helper') +const MAX_SAFE_INT_32 = Math.pow(2, 31) - 1; /** * A singleton providing HD Accounts helper functions @@ -32,6 +33,12 @@ class HDAccountsHelper { this.BIP84 = 2 this.LOCKED = 1<<7 + // known HD accounts + this.RICOCHET_ACCT = MAX_SAFE_INT_32; + this.POSTMIX_ACCT = MAX_SAFE_INT_32 - 1; + this.PREMIX_ACCT = MAX_SAFE_INT_32 - 2; + this.BADBANK_ACCT = MAX_SAFE_INT_32 - 3; + // Magic numbers this.MAGIC_XPUB = 0x0488b21e this.MAGIC_TPUB = 0x043587cf @@ -41,7 +48,7 @@ class HDAccountsHelper { this.MAGIC_VPUB = 0x045f1cf6 // HD accounts cache - this.nodes = LRU({ + this.nodes = new LRU({ // Maximum number of nodes to store in cache max: 1000, // Function used to compute length of item @@ -81,7 +88,7 @@ class HDAccountsHelper { * @returns {boolean} returns true if xpub encodes a xpub/tpub, false otherwise */ isXpub(xpub) { - return (xpub.indexOf('xpub') == 0) || (xpub.indexOf('tpub') == 0) + return (xpub.indexOf('xpub') === 0) || (xpub.indexOf('tpub') === 0) } /** @@ -90,7 +97,7 @@ class HDAccountsHelper { * @returns {boolean} returns true if xpub encodes a ypub/upub, false otherwise */ isYpub(xpub) { - return (xpub.indexOf('ypub') == 0) || (xpub.indexOf('upub') == 0) + return (xpub.indexOf('ypub') === 0) || (xpub.indexOf('upub') === 0) } /** @@ -99,7 +106,7 @@ class HDAccountsHelper { * @returns {boolean} returns true if xpub encodes a zpub/vpub, false otherwise */ isZpub(xpub) { - return (xpub.indexOf('zpub') == 0) || (xpub.indexOf('vpub') == 0) + return (xpub.indexOf('zpub') === 0) || (xpub.indexOf('vpub') === 0) } /** @@ -114,15 +121,15 @@ class HDAccountsHelper { const ver = decoded.readInt32BE() if ( - ver != this.MAGIC_XPUB - && ver != this.MAGIC_TPUB - && ver != this.MAGIC_YPUB - && ver != this.MAGIC_UPUB - && ver != this.MAGIC_ZPUB - && ver != this.MAGIC_VPUB + ver !== this.MAGIC_XPUB + && ver !== this.MAGIC_TPUB + && ver !== this.MAGIC_YPUB + && ver !== this.MAGIC_UPUB + && ver !== this.MAGIC_ZPUB + && ver !== this.MAGIC_VPUB ) { - //Logger.error(null, 'HdAccountsHelper : xlatXPUB() : Incorrect format') - return '' + Logger.error(null, 'HdAccountsHelper : xlatXPUB() : Incorrect format') + throw errors.xpub.INVALID } let xlatVer = 0 @@ -165,7 +172,7 @@ class HDAccountsHelper { /** * Classify the hd account type retrieved from db - * @param {integer} v - HD Account type (db encoding) + * @param {number} v - HD Account type (db encoding) * @returns {object} object storing the type and lock status of the hd account */ classify(v) { @@ -194,9 +201,9 @@ class HDAccountsHelper { /** * Encode hd account type and lock status in db format - * @param {integer} type - HD Account type (db encoding) + * @param {number} type - HD Account type (db encoding) * @param {boolean} locked - lock status of the hd account - * @returns {integer} + * @returns {number} */ makeType(type, locked) { let p = @@ -214,7 +221,7 @@ class HDAccountsHelper { /** * Return a string representation of the hd account type - * @param {integer} v - HD Account type (db encoding) + * @param {number} v - HD Account type (db encoding) * @returns {string} */ typeString(v) { @@ -252,6 +259,10 @@ class HDAccountsHelper { return true try { + if (!(this.isXpub(xpub) || this.isYpub(xpub) || this.isZpub(xpub))) { + throw errors.xpub.INVALID + } + // Translate the xpub const xlatedXpub = this.xlatXPUB(xpub) @@ -268,7 +279,7 @@ class HDAccountsHelper { return true } catch(e) { - if (e == errors.xpub.PRIVKEY) throw e + if (e === errors.xpub.PRIVKEY) throw e return false } } @@ -276,7 +287,7 @@ class HDAccountsHelper { /** * Get the hd node associated to an hd account * @param {string} xpub - hd account - * @returns {bip32} + * @returns {[bitcoin.bip32.BIP32Interface, bitcoin.bip32.BIP32Interface, bitcoin.bip32.BIP32Interface]} */ getNode(xpub) { if (this.isValid(xpub)) @@ -287,12 +298,12 @@ class HDAccountsHelper { /** * Derives an address for an hd account - * @param {int} chain - chain to be derived + * @param {number} chain - chain to be derived * must have a value on [0,1] for BIP44/BIP49/BIP84 derivation - * @param {bip32} chainNode - Parent bip32 used for derivation - * @param {int} index - index to be derived - * @param {int} type - type of derivation - * @returns {Promise - object} returns an object {address: '...', chain: , index: } + * @param {bitcoin.bip32.BIP32Interface} chainNode - Parent bip32 used for derivation + * @param {number} index - index to be derived + * @param {number} type - type of derivation + * @returns {Promise} returns an object {address: '...', chain: , index: , address: string } */ async deriveAddress(chain, chainNode, index, type) { // Derive M/chain/index @@ -300,7 +311,7 @@ class HDAccountsHelper { const addr = { chain: chain, - index: index + index: index, } switch (type) { @@ -321,11 +332,11 @@ class HDAccountsHelper { /** * Derives addresses for an hd account * @param {string} xpub - hd account to be derived - * @param {int} chain - chain to be derived + * @param {number} chain - chain to be derived * must have a value on [0,1] for BIP44/BIP49/BIP84 derivation - * @param {int[]} indices - array of indices to be derived - * @param {int} type - type of derivation - * @returns {Promise - object[]} array of {address: '...', chain: , index: } + * @param {number[]} indices - array of indices to be derived + * @param {number} type - type of derivation + * @returns {Promise<{ chain: number, index: number, publicKey: Buffer, address: string }[]>} array of address objects */ async deriveAddresses(xpub, chain, indices, type) { const ret = [] @@ -355,10 +366,21 @@ class HDAccountsHelper { ) { // Few addresses to be derived or external derivation deactivated // Let's do it here - let promises = indices.map(index => { + const promises = indices.map(index => { return this.deriveAddress(chain, chainNode, index, info.type) }) - return Promise.all(promises) + + // Generate additional change address types for postmix account + if (this.isPostmixAcct(node) && chain === 1) { + indices.forEach((index) => { + promises.push(this.deriveAddress(chain, chainNode, index, this.BIP44)) + promises.push(this.deriveAddress(chain, chainNode, index, this.BIP49)) + }) + } + + const addresses = await Promise.all(promises) + + return addresses; } else { // Many addresses to be derived @@ -369,12 +391,13 @@ class HDAccountsHelper { xpub: this.xlatXPUB(xpub), chain: chain, indices: indices, - type: info.type + type: info.type, + isPostmixChange: this.isPostmixAcct(node) && chain === 1 } const msg = await this.derivationPool.exec('deriveAddresses', [data]) - if (msg.status = 'ok') { + if (msg.status === 'ok') { resolve(msg.addresses) } else { Logger.error(null, 'HdAccountsHelper : A problem was met during parallel addresses derivation') @@ -393,6 +416,20 @@ class HDAccountsHelper { } } + /** + * @description Detect postmix account + * @param {[bitcoin.bip32.BIP32Interface, bitcoin.bip32.BIP32Interface, bitcoin.bip32.BIP32Interface]} node - array of BIP32 node interfaces + * @returns {boolean} + */ + isPostmixAcct(node) { + const index = node[2].index + const threshold = Math.pow(2,31) + const hardened = (index >= threshold) + const account = hardened ? (index - threshold) : index + + return account === this.POSTMIX_ACCT + } + } module.exports = new HDAccountsHelper() diff --git a/lib/bitcoin/hd-accounts-service.js b/lib/bitcoin/hd-accounts-service.js index 4de9787..5503fdd 100644 --- a/lib/bitcoin/hd-accounts-service.js +++ b/lib/bitcoin/hd-accounts-service.js @@ -4,7 +4,7 @@ */ 'use strict' -const _ = require('lodash') +const util = require('../util') const errors = require('../errors') const Logger = require('../logger') const db = require('../db/mysql-db-wrapper') @@ -29,7 +29,7 @@ class HDAccountsService { /** * Create a new hd account in db * @param {string} xpub - xpub - * @param {int} scheme - derivation scheme + * @param {number} scheme - derivation scheme * @returns {Promise} returns true if success, false otherwise */ async createHdAccount(xpub, scheme) { @@ -37,8 +37,8 @@ class HDAccountsService { await this.newHdAccount(xpub, scheme) return true } catch(e) { - const isInvalidXpub = (e == errors.xpub.INVALID || e == errors.xpub.PRIVKEY) - const isLockedXpub = (e == errors.xpub.LOCKED) + const isInvalidXpub = (e === errors.xpub.INVALID || e === errors.xpub.PRIVKEY) + const isLockedXpub = (e === errors.xpub.LOCKED) const err = (isInvalidXpub || isLockedXpub) ? e : errors.xpub.CREATE Logger.error(e, 'HdAccountsService : createHdAccount()' + err) return Promise.reject(err) @@ -49,7 +49,7 @@ class HDAccountsService { /** * Restore a hd account in db * @param {string} xpub - xpub - * @param {int} scheme - derivation scheme + * @param {number} scheme - derivation scheme * @param {bool} forceOverride - force override of scheme even if hd account is locked * @returns {Promise} */ @@ -96,7 +96,7 @@ class HDAccountsService { return hdaHelper.typeString(type) } catch(e) { - const err = (e == errors.db.ERROR_NO_HD_ACCOUNT) ? errors.get.UNKNXPUB : errors.generic.DB + const err = (e === errors.db.ERROR_NO_HD_ACCOUNT) ? errors.get.UNKNXPUB : errors.generic.DB return Promise.reject(err) } } @@ -110,7 +110,7 @@ class HDAccountsService { try { await db.deleteHDAccount(xpub) } catch(e) { - const err = (e == errors.db.ERROR_NO_HD_ACCOUNT) ? errors.get.UNKNXPUB : errors.generic.DB + const err = (e === errors.db.ERROR_NO_HD_ACCOUNT) ? errors.get.UNKNXPUB : errors.generic.DB return Promise.reject(err) } } @@ -134,17 +134,17 @@ class HDAccountsService { let segwit = '' - if (scheme == hdaHelper.BIP49) + if (scheme === hdaHelper.BIP49) segwit = ' SegWit (BIP49)' - else if (scheme == hdaHelper.BIP84) + else if (scheme === hdaHelper.BIP84) segwit = ' SegWit (BIP84)' - + Logger.info(`HdAccountsService : Created HD Account: ${xpub}${segwit}`) - const externalPrm = hdaHelper.deriveAddresses(xpub, 0, _.range(gap.external), scheme) - const internalPrm = hdaHelper.deriveAddresses(xpub, 1, _.range(gap.internal), scheme) + const externalPrm = hdaHelper.deriveAddresses(xpub, 0, util.range(0, gap.external), scheme) + const internalPrm = hdaHelper.deriveAddresses(xpub, 1, util.range(0, gap.internal), scheme) - const addresses = _.flatten(await Promise.all([externalPrm, internalPrm])) + const addresses = (await Promise.all([externalPrm, internalPrm])).flat() return db.addAddressesToHDAccount(xpub, addresses) } @@ -152,8 +152,8 @@ class HDAccountsService { /** * Rescan the blockchain for a hd account * @param {string} xpub - xpub - * @param {integer} gapLimit - (optional) gap limit for derivation - * @param {integer} startIndex - (optional) rescan shall start from this index + * @param {number=} gapLimit - (optional) gap limit for derivation + * @param {number=} startIndex - (optional) rescan shall start from this index * @returns {Promise} */ async rescan(xpub, gapLimit, startIndex) { @@ -165,7 +165,7 @@ class HDAccountsService { await remote.importHDAccount(xpub, account.hdType, gapLimit, startIndex) } catch(e) { return Promise.reject(e) - } + } } /** @@ -201,7 +201,7 @@ class HDAccountsService { const info = hdaHelper.classify(account.hdType) // If this account is already known in the database, // check for a derivation scheme mismatch - if (info.type != scheme) { + if (info.type !== scheme) { if (info.locked && !forceOverride) { Logger.info(`HdAccountsService : Attempted override on locked account: ${xpub}`) return Promise.reject(errors.xpub.LOCKED) @@ -224,7 +224,7 @@ class HDAccountsService { * @param {string} address - address used to sign the message * @param {string} sig - signature of the message * @param {string} msg - signed message - * @param {integer} scheme - derivation scheme to be used for the xpub + * @param {number} scheme - derivation scheme to be used for the xpub * @returns {Promise} returns the xpub if signature is valid, otherwise returns an error */ async verifyXpubSignature(xpub, address, sig, msg, scheme) { @@ -242,16 +242,45 @@ class HDAccountsService { if (!addrHelper.verifySignature(msg, sigAddress, sig)) return Promise.reject(errors.sig.INVSIG) // Check that adresses match - if (address != expectedAddress) + if (address !== expectedAddress) return Promise.reject(errors.sig.INVADDR) // Return the corresponding xpub return xpub } catch(err) { - const ret = (err == errors.db.ERROR_NO_HD_ACCOUNT) ? errors.get.UNKNXPUB : errors.generic.DB + const ret = (err === errors.db.ERROR_NO_HD_ACCOUNT) ? errors.get.UNKNXPUB : errors.generic.DB return Promise.reject(ret) } } + /** + * @description + * @param {string[]} xpubs - array of xpubs + * @returns {Promise} + */ + async importPostmixLikeTypeChange(xpubs) { + const postmixAcct = xpubs.find((xpub) => { + const node = hdaHelper.getNode(xpub) + + return hdaHelper.isPostmixAcct(node) + }) + + if (!postmixAcct) return Promise.resolve() + + const postmixNode = hdaHelper.getNode(postmixAcct) + const [externalUnused, internalUnused] = await db.getHDAccountNextUnusedIndices(postmixAcct) + + const deriveRange = util.range(Math.max(0, internalUnused - 50), internalUnused + gap.internal) + + const likeTypeChangeAddresses = await Promise.all(deriveRange.map((index) => { + return [ + hdaHelper.deriveAddress(1, postmixNode[1], index, hdaHelper.BIP44), + hdaHelper.deriveAddress(1, postmixNode[1], index, hdaHelper.BIP49) + ] + }).flat()) + + await db.addAddressesToHDAccount(postmixAcct, likeTypeChangeAddresses) + } + } module.exports = new HDAccountsService() diff --git a/lib/bitcoin/parallel-address-derivation.js b/lib/bitcoin/parallel-address-derivation.js index 38e1ce3..4033406 100644 --- a/lib/bitcoin/parallel-address-derivation.js +++ b/lib/bitcoin/parallel-address-derivation.js @@ -20,12 +20,12 @@ const BIP84 = 2 /** * Derives an address for an hd account - * @param {int} chain - chain to be derived + * @param {number} chain - chain to be derived * must have a value on [0,1] for BIP44/BIP49/BIP84 derivation * @param {bip32} chainNode - Parent bip32 used for derivation - * @param {int} index - index to be derived - * @param {int} type - type of derivation - * @returns {Promise - object} returns an object {address: '...', chain: , index: } + * @param {number} index - index to be derived + * @param {number} type - type of derivation + * @returns {Promise} returns an object {address: '...', chain: , index: } */ async function deriveAddress(chain, chainNode, index, type) { // Derive M/chain/index @@ -33,7 +33,7 @@ async function deriveAddress(chain, chainNode, index, type) { const addr = { chain: chain, - index: index + index: index, } switch (type) { @@ -54,7 +54,7 @@ async function deriveAddress(chain, chainNode, index, type) { /** * Derives a set of addresses for an hd account * @param {object} msg - parameters used for the derivation - * @returns {Promise - object[]} + * @returns {Promise} */ async function deriveAddresses(msg) { try { @@ -62,6 +62,7 @@ async function deriveAddresses(msg) { const chain = msg.chain const indices = msg.indices const type = msg.type + const isPostmixChange = msg.isPostmixChange // Parse input as an HD Node. Throws if invalid const node = bitcoin.bip32.fromBase58(xpub, activeNet) @@ -76,6 +77,14 @@ async function deriveAddresses(msg) { return deriveAddress(chain, chainNode, index, type) }) + // Generate additional change address types for postmix account + if (isPostmixChange) { + indices.forEach((index) => { + promises.push(deriveAddress(chain, chainNode, index, BIP44)) + promises.push(deriveAddress(chain, chainNode, index, BIP49)) + }) + } + const addresses = await Promise.all(promises) // Send response to parent process diff --git a/lib/bitcoind-rpc/fees.js b/lib/bitcoind-rpc/fees.js index ccd7c20..51da834 100644 --- a/lib/bitcoind-rpc/fees.js +++ b/lib/bitcoind-rpc/fees.js @@ -34,7 +34,7 @@ class Fees { /** * Refresh and return the current fees - * @returns {Promise} + * @returns {Promise} */ async getFees() { try { @@ -50,7 +50,7 @@ class Fees { /** * Refresh the current fees - * @returns {Promise} + * @returns {Promise} */ async refresh() { await util.parallelCall(this.targets, async tgt => { diff --git a/lib/bitcoind-rpc/headers.js b/lib/bitcoind-rpc/headers.js index eb6b965..43fee6d 100644 --- a/lib/bitcoind-rpc/headers.js +++ b/lib/bitcoind-rpc/headers.js @@ -19,7 +19,7 @@ class Headers { */ constructor() { // Cache - this.headers = LRU({ + this.headers = new LRU({ // Maximum number of headers to store in cache max: 2016, // Function used to compute length of item diff --git a/lib/bitcoind-rpc/latest-block.js b/lib/bitcoind-rpc/latest-block.js index dfe659d..96856cd 100644 --- a/lib/bitcoind-rpc/latest-block.js +++ b/lib/bitcoind-rpc/latest-block.js @@ -4,7 +4,7 @@ */ 'use strict' -const zmq = require('zeromq') +const zmq = require('zeromq/v5-compat') const Logger = require('../logger') const util = require('../util') const network = require('../bitcoin/network') diff --git a/lib/bitcoind-rpc/rpc-client.js b/lib/bitcoind-rpc/rpc-client.js index 2393bd5..72622a0 100644 --- a/lib/bitcoind-rpc/rpc-client.js +++ b/lib/bitcoind-rpc/rpc-client.js @@ -14,12 +14,13 @@ const Logger = require('../logger') /** * Wrapper for bitcoind rpc client */ -const createRpcClient = () => { +const createRpcClient = (options = {}) => { return new RPCClient({ url: `http://${keys.bitcoind.rpc.host}`, port: keys.bitcoind.rpc.port, user: keys.bitcoind.rpc.user, - pass: keys.bitcoind.rpc.pass + pass: keys.bitcoind.rpc.pass, + ...options }) } @@ -30,7 +31,7 @@ const createRpcClient = () => { * @returns {boolean} returns true if message related to a connection error */ const isConnectionError = (err) => { - if (typeof err != 'string') + if (typeof err !== 'string') return false const isTimeoutError = (err.indexOf('connect ETIMEDOUT') !== -1) diff --git a/lib/bitcoind-rpc/transactions.js b/lib/bitcoind-rpc/transactions.js index f55d363..46cc09e 100644 --- a/lib/bitcoind-rpc/transactions.js +++ b/lib/bitcoind-rpc/transactions.js @@ -23,7 +23,7 @@ class Transactions { */ constructor() { // Caches - this.prevCache = LRU({ + this.prevCache = new LRU({ // Maximum number of transactions to store max: 20000, // Function used to compute length of item @@ -41,7 +41,7 @@ class Transactions { * Get the transactions for a given array of txids * @param {string[]} txids - txids of the transaction to be retrieved * @param {boolean} fees - true if fees must be computed, false otherwise - * @returns {Promise} return an array of transactions (object[]) + * @returns {Promise} return an array of transactions (object[]) */ async getTransactions(txids, fees) { try { @@ -76,7 +76,7 @@ class Transactions { * Get the transaction for a given txid * @param {string} txid - txid of the transaction to be retrieved * @param {boolean} fees - true if fees must be computed, false otherwise - * @returns {Promise} + * @returns {Promise} */ async getTransaction(txid, fees) { try { @@ -92,7 +92,7 @@ class Transactions { * Formats a transaction object returned by the RPC API * @param {object} tx - transaction * @param {boolean} fees - true if fees must be computed, false otherwise - * @returns {Promise} return an array of inputs (object[]) + * @returns {Promise} return an array of inputs (object[]) */ async _prepareTxResult(tx, fees) { const ret = { @@ -148,7 +148,7 @@ class Transactions { * Extract information about the inputs of a transaction * @param {object} tx - transaction * @param {boolean} fees - true if fees must be computed, false otherwise - * @returns {Promise} return an array of inputs (object[]) + * @returns {Promise} return an array of inputs (object[]) */ async _getInputs(tx, fees) { const inputs = [] @@ -202,7 +202,7 @@ class Transactions { /** * Extract information about the outputs of a transaction * @param {object} tx - transaction - * @returns {Promise} return an array of outputs (object[]) + * @returns {Promise} return an array of outputs (object[]) */ async _getOutputs(tx) { const outputs = [] @@ -220,7 +220,7 @@ class Transactions { } if (pk.addresses) { - if (pk.addresses.length == 1) + if (pk.addresses.length === 1) o.address = pk.addresses[0] else o.addresses = pk.addresses diff --git a/lib/db/mysql-db-wrapper.js b/lib/db/mysql-db-wrapper.js index e704e63..0973e57 100644 --- a/lib/db/mysql-db-wrapper.js +++ b/lib/db/mysql-db-wrapper.js @@ -11,8 +11,8 @@ const errors = require('../errors') const hdaHelper = require('../bitcoin/hd-accounts-helper') const network = require('../bitcoin/network') const keys = require('../../keys/')[network.key] -const debug = !!(process.argv.indexOf('db-debug') > -1) -const queryDebug = !!(process.argv.indexOf('dbquery-debug') > -1) +const debug = process.argv.indexOf('db-debug') > -1 +const queryDebug = process.argv.indexOf('dbquery-debug') > -1 /** @@ -387,9 +387,9 @@ class MySqlDbWrapper { this.pool.query(query, null, async (err, result, fields) => { if (err) { // Retry the request on lock errors - if ((err.code == 'ER_LOCK_DEADLOCK' || - err.code == 'ER_LOCK_TIMEOUT' || - err.code == 'ER_LOCK_WAIT_TIMEOUT') && (retries > 0) + if ((err.code === 'ER_LOCK_DEADLOCK' || + err.code === 'ER_LOCK_TIMEOUT' || + err.code === 'ER_LOCK_WAIT_TIMEOUT') && (retries > 0) ) { try { this.queryError('Lock detected. Retry request in a few ms', query) @@ -426,7 +426,7 @@ class MySqlDbWrapper { /** * Get the ID of an address * @param {string} address - bitcoin address - * @returns {integer} returns the address id + * @returns {number} returns the address id */ async getAddressId(address) { const sqlQuery = 'SELECT `addrID` FROM `addresses` WHERE `addrAddress` = ?' @@ -443,7 +443,7 @@ class MySqlDbWrapper { /** * Get the ID of an Address. Ensures that the address exists. * @param {string} address - bitcoin address - * @returns {integer} returns the address id + * @returns {number} returns the address id */ async ensureAddressId(address) { const sqlQuery = 'SELECT `addrID` FROM `addresses` WHERE `addrAddress` = ?' @@ -469,7 +469,7 @@ class MySqlDbWrapper { async getAddressesIds(addresses) { const ret = {} - if (addresses.length == 0) + if (addresses.length === 0) return ret const sqlQuery = 'SELECT * FROM `addresses` WHERE `addrAddress` IN (?)' @@ -488,7 +488,7 @@ class MySqlDbWrapper { * @param {string[]} addresses - array of bitcoin addresses */ async addAddresses(addresses) { - if (addresses.length == 0) + if (addresses.length === 0) return [] const sqlQuery = 'INSERT IGNORE INTO `addresses` (addrAddress) VALUES ?' @@ -502,7 +502,7 @@ class MySqlDbWrapper { * @param {string[]} addresses - array of bitcoin addresses */ async getAddresses(addresses) { - if (addresses.length == 0) + if (addresses.length === 0) return [] const sqlQuery = 'SELECT * FROM `addresses` WHERE `addrAddress` IN (?)' @@ -514,7 +514,7 @@ class MySqlDbWrapper { /** * Get address balance. * @param {string} address - bitcoin address - * @returns {integer} returns the balance of the address + * @returns {number} returns the balance of the address */ async getAddressBalance(address) { if (address == null) @@ -532,7 +532,7 @@ class MySqlDbWrapper { const query = mysql.format(sqlQuery, params) const results = await this._query(query) - if (results.length == 1) { + if (results.length === 1) { const balance = results[0].balance return (balance == null) ? 0 : balance } @@ -543,7 +543,7 @@ class MySqlDbWrapper { /** * Get the number of transactions for an address. * @param {string} address - bitcoin address - * @returns {integer} returns the number of transactions for the address + * @returns {number} returns the number of transactions for the address */ async getAddressNbTransactions(address) { if(address == null) @@ -571,7 +571,7 @@ class MySqlDbWrapper { const query = mysql.format(sqlQuery, params) const results = await this._query(query) - if (results.length == 1) { + if (results.length === 1) { const nbTxs = results[0].nbTxs return (nbTxs == null) ? 0 : nbTxs } @@ -582,7 +582,7 @@ class MySqlDbWrapper { /** * Get an HD account. * @param {string} xpub - xpub - * @returns {integer} returns {hdID, hdXpub, hdCreated, hdType} + * @returns {number} returns {hdID, hdXpub, hdCreated, hdType} * throws if no record of xpub */ async getHDAccount(xpub) { @@ -600,7 +600,7 @@ class MySqlDbWrapper { /** * Get the ID of an HD account * @param {string} xpub - xpub - * @returns {integer} returns the id of the hd account + * @returns {number} returns the id of the hd account */ async getHDAccountId(xpub) { const sqlQuery = 'SELECT `hdID` FROM `hd` WHERE `hdXpub` = ?' @@ -618,7 +618,7 @@ class MySqlDbWrapper { * Get the ID of an HD account. Ensures that the account exists. * @param {string} xpub - xpub * @param {string} type - hd account type - * @returns {integer} returns the id of the hd account + * @returns {number} returns the id of the hd account */ async ensureHDAccountId(xpub, type) { const info = hdaHelper.classify(type) @@ -650,15 +650,14 @@ class MySqlDbWrapper { /** * Lock the type of a hd account * @param {string} xpub - xpub + * @param {boolean} locked - true for locking, false for unlocking * @returns {boolean} locked - true for locking, false for unlocking */ async setLockHDAccountType(xpub, locked) { - locked = !!locked - const account = await this.getHDAccount(xpub) const info = hdaHelper.classify(account.hdType) - if (info.locked == locked) + if (info.locked === locked) return true const hdType = hdaHelper.makeType(account.hdType, locked) @@ -700,7 +699,7 @@ class MySqlDbWrapper { * Add an address a hd account * @param {string} address - bitcoin address * @param {string} xpub - xpub - * @param {integer} chain - derivation chain + * @param {number} chain - derivation chain * @param {index} index - derivation index for the address */ async addAddressToHDAccount(address, xpub, chain, index) { @@ -733,7 +732,7 @@ class MySqlDbWrapper { * which is the output of the HDAccountsHelper.deriveAddresses() */ async addAddressesToHDAccount(xpub, addressData) { - if (addressData.length == 0) + if (addressData.length === 0) return const addresses = addressData.map(d => d.address) @@ -769,7 +768,7 @@ class MySqlDbWrapper { * @returns {object[]} */ async getUngroupedHDAccountsByAddresses(addresses) { - if (addresses.length == 0) return {} + if (addresses.length === 0) return {} const sqlQuery = 'SELECT \ `hd`.`hdID`, \ @@ -814,7 +813,7 @@ class MySqlDbWrapper { loose: [] } - if (addresses.length == 0) + if (addresses.length === 0) return ret const sqlQuery = 'SELECT \ @@ -865,7 +864,7 @@ class MySqlDbWrapper { /** * Get an HD account balance * @param {string} xpub - xpub - * @returns {integer} returns the balance of the hd account + * @returns {number} returns the balance of the hd account */ async getHDAccountBalance(xpub) { const sqlQuery = 'SELECT \ @@ -882,7 +881,7 @@ class MySqlDbWrapper { const query = mysql.format(sqlQuery, params) const results = await this._query(query) - if (results.length == 1) + if (results.length === 1) return (results[0].balance == null) ? 0 : results[0].balance return null @@ -891,7 +890,7 @@ class MySqlDbWrapper { /** * Get next unused address indices for each HD chain of an account * @param {string} xpub - xpub - * @returns {integer[]} returns an array of unused indices + * @returns {number[]} returns an array of unused indices * [M/0/X, M/1/Y] -> [X,Y] */ async getHDAccountNextUnusedIndices(xpub) { @@ -921,7 +920,7 @@ class MySqlDbWrapper { /** * Get the maximum derived address index for each HD chain of an account * @param {string} xpub - xpub - * @returns {integer[]} returns an array of derived indices + * @returns {number[]} returns an array of derived indices * [M/0/X, M/1/Y] -> [X,Y] */ async getHDAccountDerivedIndices(xpub) { @@ -950,10 +949,10 @@ class MySqlDbWrapper { /** * Get the number of indices derived in an interval for a HD chain * @param {string} xpub - xpub - * @param {integer} chain - HD chain (0 or 1) - * @param {integer} minIdx - min index of derivation - * @param {integer} maxIdx - max index of derivation - * @returns {integer[]} returns an array of number of derived indices + * @param {number} chain - HD chain (0 or 1) + * @param {number} minIdx - min index of derivation + * @param {number} maxIdx - max index of derivation + * @returns {number[]} returns an array of number of derived indices */ async getHDAccountNbDerivedIndices(xpub, chain, minIdx, maxIdx) { const sqlQuery = 'SELECT \ @@ -969,7 +968,7 @@ class MySqlDbWrapper { const query = mysql.format(sqlQuery, params) const results = await this._query(query) - if (results.length == 1) { + if (results.length === 1) { const nbDerivedIndices = results[0].nbDerivedIndices return (nbDerivedIndices == null) ? 0 : nbDerivedIndices } @@ -980,7 +979,7 @@ class MySqlDbWrapper { /** * Get the number of transactions for an HD account * @param {string} xpub - xpub - * @returns {integer} returns the balance of the hd account + * @returns {number} returns the balance of the hd account */ async getHDAccountNbTransactions(xpub) { const sqlQuery = 'SELECT COUNT(DISTINCT `r`.`txnTxid`) AS nbTxs \ @@ -1007,7 +1006,7 @@ class MySqlDbWrapper { const query = mysql.format(sqlQuery, params) const results = await this._query(query) - if (results.length == 1) + if (results.length === 1) return (results[0].nbTxs == null) ? 0 : results[0].nbTxs return null @@ -1017,12 +1016,12 @@ class MySqlDbWrapper { * Get the number of transactions for a list of addresses and HD accounts * @param {string[]} addresses - array of bitcoin addresses * @param {string[]} xpubs - array of xpubs - * @returns {int} returns the number of transactions + * @returns {number} returns the number of transactions */ async getAddrAndXpubsNbTransactions(addresses, xpubs) { if ( - (!addresses || addresses.length == 0) - && (!xpubs || xpubs.length == 0) + (!addresses || addresses.length === 0) + && (!xpubs || xpubs.length === 0) ) { return [] } @@ -1052,7 +1051,7 @@ class MySqlDbWrapper { let query = mysql.format(sqlQuery) const results = await this._query(query) - if (results.length == 1) + if (results.length === 1) return (results[0].nbTxs == null) ? 0 : results[0].nbTxs return null @@ -1062,12 +1061,14 @@ class MySqlDbWrapper { * Get the transactions for a list of addresses and HD accounts * @param {string[]} addresses - array of bitcoin addresses * @param {string[]} xpubs - array of xpubs + * @param {number=} page - page + * @param {number=} nbTxsPerPage - number of transactions per page * @returns {object[]} returns an array of transactions */ async getTxsByAddrAndXpubs(addresses, xpubs, page, nbTxsPerPage) { if ( - (!addresses || addresses.length == 0) - && (!xpubs || xpubs.length == 0) + (!addresses || addresses.length === 0) + && (!xpubs || xpubs.length === 0) ) { return [] } @@ -1117,7 +1118,7 @@ class MySqlDbWrapper { const txsIds = txs.map(t => t.txnID) - if (txsIds.length == 0) + if (txsIds.length === 0) return [] // Prepares subqueries for @@ -1189,7 +1190,7 @@ class MySqlDbWrapper { } } - if (input.hdXpub && input.hdXpub !== null) { + if (input.hdXpub) { ret.prev_out.xpub = { m: input.hdXpub, path: ['M', input.hdAddrChain, input.hdAddrIndex].join('/') @@ -1211,7 +1212,7 @@ class MySqlDbWrapper { addr: output.outAddress } - if (output.hdXpub && output.hdXpub !== null) { + if (output.hdXpub) { ret.xpub = { m: output.hdXpub, path: ['M', output.hdAddrChain, output.hdAddrIndex].join('/') @@ -1294,7 +1295,7 @@ class MySqlDbWrapper { async getXpubByAddresses(addresses) { const ret = {} - if (addresses.length == 0) + if (addresses.length === 0) return ret const sqlQuery = 'SELECT `hd`.`hdXpub`, `addresses`.`addrAddress` \ @@ -1316,7 +1317,7 @@ class MySqlDbWrapper { /** * Get the mysql ID of a transaction. Ensures that the transaction exists. * @param {string} txid - txid of a transaction - * @returns {integer} returns the transaction id (mysql id) + * @returns {number} returns the transaction id (mysql id) */ async ensureTransactionId(txid) { const sqlQuery = 'INSERT IGNORE INTO `transactions` SET ?' @@ -1346,14 +1347,14 @@ class MySqlDbWrapper { /** * Get the mysql ID of a transaction * @param {string} txid - txid of a transaction - * @returns {integer} returns the transaction id (mysql id) + * @returns {number} returns the transaction id (mysql id) */ async getTransactionId(txid) { const sqlQuery = 'SELECT `txnID` FROM `transactions` WHERE `txnTxid` = ?' const params = txid const query = mysql.format(sqlQuery, params) const result = await this._query(query) - return (result.length == 0) ? null : result[0].txnID + return (result.length === 0) ? null : result[0].txnID } /** @@ -1362,7 +1363,7 @@ class MySqlDbWrapper { * @returns {object[]} returns an array of {txnTxid: txnId} */ async getTransactionsIds(txids) { - if (txids.length == 0) + if (txids.length === 0) return [] const sqlQuery = 'SELECT `txnID`, `txnTxid` FROM `transactions` WHERE `txnTxid` IN (?)' @@ -1378,11 +1379,11 @@ class MySqlDbWrapper { /** * Get the mysql IDs of a set of transactions - * @param {string[]} txid - array of transactions txids - * @returns {integer[]} returns an array of transaction ids (mysql ids) + * @param {string[]} txnIDs - array of transactions txids + * @returns {number[]} returns an array of transaction ids (mysql ids) */ async getTransactionsById(txnIDs) { - if (txnIDs.length == 0) + if (txnIDs.length === 0) return [] const sqlQuery = 'SELECT * FROM `transactions` WHERE `txnID` IN (?)' @@ -1419,7 +1420,7 @@ class MySqlDbWrapper { * @param {object[]} txs - array of {txid, version, locktime} */ async addTransactions(txs) { - if (txs.length == 0) + if (txs.length === 0) return const sqlQuery = 'INSERT INTO `transactions` \ @@ -1567,10 +1568,10 @@ class MySqlDbWrapper { /** * Batch confirm txids in a block * @param {string[]} txnTxidArray - array of transaction txids - * @param {integer} blockID - mysql id of the blck + * @param {number} blockID - mysql id of the blck */ async confirmTransactions(txnTxidArray, blockID) { - if (txnTxidArray.length == 0) + if (txnTxidArray.length === 0) return const sqlQuery = 'UPDATE `transactions` SET `blockID` = ? WHERE `txnTxid` IN (?)' @@ -1581,8 +1582,8 @@ class MySqlDbWrapper { /** * Get the transactions confirmed after a given height - * @param {integer]} height - block height - * @param {object[]} returns an array of transactions + * @param {number} height - block height + * @returns {object[]} returns an array of transactions */ async getTransactionsConfirmedAfterHeight(height) { const sqlQuery = 'SELECT `transactions`.* FROM `transactions` \ @@ -1595,7 +1596,7 @@ class MySqlDbWrapper { /** * Delete the transactions confirmed after a given height - * @param {integer]} height - block height + * @param {number} height - block height */ async deleteTransactionsConfirmedAfterHeight(height) { const sqlQuery = 'DELETE `transactions`.* FROM `transactions` \ @@ -1611,7 +1612,7 @@ class MySqlDbWrapper { * @param {string[]} txnTxidArray - array of transaction txids */ async unconfirmTransactions(txnTxidArray) { - if (txnTxidArray.length == 0) + if (txnTxidArray.length === 0) return const sqlQuery = 'UPDATE `transactions` SET `blockID` = NULL WHERE `txnTxid` IN (?)' @@ -1633,10 +1634,10 @@ class MySqlDbWrapper { /** * Delete a set of transactions identified by their mysql ids - * @param {integer[]} txnIDs - mysql ids of the transactions + * @param {number[]} txnIDs - mysql ids of the transactions */ async deleteTransactionsByID(txnIDs) { - if (txnIDs.length == 0) + if (txnIDs.length === 0) return [] const sqlQuery = 'DELETE `transactions`.* FROM `transactions` WHERE `transactions`.`txnID` in (?)' @@ -1650,7 +1651,7 @@ class MySqlDbWrapper { * @param {object[]} outputs - array of {txnID, addrID, outIndex, outAmount, outScript} */ async addOutputs(outputs) { - if (outputs.length == 0) + if (outputs.length === 0) return const sqlQuery = 'INSERT IGNORE INTO `outputs` \ @@ -1671,7 +1672,7 @@ class MySqlDbWrapper { * {addrAddress, outID, outAmount, txnTxid, outIndex, spendingTxnID/null, spendingInID/null} */ async getOutputSpends(spends) { - if (spends.length == 0) + if (spends.length === 0) return [] const whereClauses = @@ -1703,7 +1704,7 @@ class MySqlDbWrapper { * {outID, txnTxid, outIndex} */ async getOutputIds(spends) { - if (spends.length == 0) + if (spends.length === 0) return [] const whereClauses = @@ -1730,7 +1731,7 @@ class MySqlDbWrapper { * {txnTxid, outIndex, outAmount, outScript, addrAddress} */ async getUnspentOutputs(addresses) { - if (addresses.length == 0) + if (addresses.length === 0) return [] const sqlQuery = 'SELECT \ @@ -1761,7 +1762,7 @@ class MySqlDbWrapper { * {txnID, outID, inIndex, inSequence} */ async addInputs(inputs) { - if (inputs.length == 0) + if (inputs.length === 0) return const sqlQuery = 'INSERT INTO `inputs` \ @@ -1811,7 +1812,7 @@ class MySqlDbWrapper { const params = hash const query = mysql.format(sqlQuery, params) const result = await this._query(query) - return (result.length == 1) ? result[0] : null + return (result.length === 1) ? result[0] : null } /** @@ -1820,7 +1821,7 @@ class MySqlDbWrapper { * @returns {object[]} returns the blocks */ async getBlocksByHashes(hashes) { - if (hashes.length == 0) + if (hashes.length === 0) return [] const sqlQuery = 'SELECT * FROM `blocks` WHERE `blockHash` IN (?)' @@ -1831,7 +1832,7 @@ class MySqlDbWrapper { /** * Get details about all blocks at a given block height - * @param {integer} height - block height + * @param {number} height - block height * @returns {object[]} returns an array of blocks */ async getBlocksByHeight(height) { @@ -1843,7 +1844,7 @@ class MySqlDbWrapper { /** * Delete the blocks after a given block height - * @param {integer} height - block height + * @param {number} height - block height */ async deleteBlocksAfterHeight(height) { const sqlQuery = 'DELETE FROM `blocks` WHERE `blockHeight` > ?' @@ -1854,12 +1855,12 @@ class MySqlDbWrapper { /** * Gets the last block - * @returns {object} returns the last block + * @returns {object | null} returns the last block */ async getHighestBlock() { try { const results = await this.getLastBlocks(1) - if (results == null || results.length == 0) + if (results == null || results.length === 0) return { blockID: null, blockHeight: 0 @@ -1873,7 +1874,7 @@ class MySqlDbWrapper { /** * Gets the N last blocks - * @param {integer} n - number of blocks to be retrieved + * @param {number} n - number of blocks to be retrieved * @returns {object[]} returns an array of the n last blocks */ async getLastBlocks(n) { @@ -1896,14 +1897,14 @@ class MySqlDbWrapper { /** * Get the mysql ID of a scheduled transaction * @param {string} txid - txid of a scheduled transaction - * @returns {integer} returns the scheduled transaction id (mysql id) + * @returns {number} returns the scheduled transaction id (mysql id) */ async getScheduledTransactionId(txid) { const sqlQuery = 'SELECT `schID` FROM `scheduled_transactions` WHERE `schTxid` = ?' const params = txid const query = mysql.format(sqlQuery, params) const result = await this._query(query) - return (result.length == 0) ? null : result[0].txnID + return (result.length === 0) ? null : result[0].txnID } /** @@ -1952,7 +1953,7 @@ class MySqlDbWrapper { /** * Get scheduled transactions * with a trigger lower than a given block height - * @param {integer} height - block height + * @param {number} height - block height */ async getActivatedScheduledTransactions(height) { const sqlQuery = 'SELECT * FROM `scheduled_transactions` \ @@ -1964,7 +1965,7 @@ class MySqlDbWrapper { /** * Get the scheduled transaction having a given parentID - * @param {integer} parentId - parent ID + * @param {number} parentId - parent ID * @returns {object[]} returns an array of scheduled transactions */ async getNextScheduledTransactions(parentId) { @@ -1978,8 +1979,8 @@ class MySqlDbWrapper { /** * Update the trigger of a scheduled transaction * identified by its ID - * @param {integer} id - id of the scheduled transaction - * @param {integer} trigger - new trigger + * @param {number} id - id of the scheduled transaction + * @param {number} trigger - new trigger */ async updateTriggerScheduledTransaction(id, trigger) { const sqlQuery = 'UPDATE `scheduled_transactions` \ diff --git a/lib/http-server/http-server.js b/lib/http-server/http-server.js index 65cd148..3baf71c 100644 --- a/lib/http-server/http-server.js +++ b/lib/http-server/http-server.js @@ -7,8 +7,11 @@ const { App } = require('@tinyhttp/app') const sirv = require('sirv') const helmet = require('helmet') +const nocache = require('nocache') const Logger = require('../logger') -const errors = require('../errors'); +const errors = require('../errors') +const network = require("../../lib/bitcoin/network") +const keys = require('../../keys')[network.key] /** @@ -18,7 +21,7 @@ class HttpServer { /** * Constructor - * @param {int} port - port used by the http server + * @param {number} port - port used by the http server * @param {string} host - host exposing the http server */ constructor(port, host) { @@ -31,13 +34,17 @@ class HttpServer { // Initialize the tiny-http app this.app = new App({ + noMatchHandler: (req, res) => { + Logger.error(null, `HttpServer : 404 - Not found: ${req.method} - ${req.hostname}${req.path}`) + HttpServer.sendError(res, {status: '404 - Not found'}, 404) + }, // Error handler onError: (err, req, res) => { // Detect if this is auth error if (Object.values(errors.auth).includes(err)) { HttpServer.sendError(res, err, 401) } else { - Logger.error(err.stack, 'HttpServer : general error') + Logger.error(err.stack || err, 'HttpServer : general error') const ret = {status: 'Server error'} HttpServer.sendError(res, ret, 500) } @@ -48,9 +55,15 @@ class HttpServer { this.app.use(HttpServer.requestLogger) this.app.use(HttpServer.setCrossOrigin) this.app.use(helmet(HttpServer.HELMET_POLICY)) + this.app.use(nocache()) this.app.use('/static', sirv('../static')); + this.app.use((req, res, next) => { + res.append('X-Dojo-Version', keys.dojoVersion) + next() + }) + this.app.use(HttpServer.setJSONResponse) this.app.use(HttpServer.setConnection) } @@ -62,9 +75,9 @@ class HttpServer { */ start() { // Start a http server - this.server = this.app.listen(this.port, this.host, () => { + this.server = this.app.listen(this.port, () => { Logger.info(`HttpServer : Listening on ${this.host}:${this.port}`) - }) + }, this.host) this.server.timeout = 600 * 1000 // @see https://github.com/nodejs/node/issues/13391 @@ -77,8 +90,8 @@ class HttpServer { * Stop the http server */ stop() { - if (this.app === null) return - this.app.close() + if (this.server == null) return + this.server.close() } /** @@ -93,6 +106,7 @@ class HttpServer { /** * Return a http response without status * @param {object} res - http response object + * @param {object} data */ static sendOkDataOnly(res, data) { res.status(200).json(data) @@ -218,16 +232,11 @@ HttpServer.HELMET_POLICY = { 'style-src': ["'self'", "https:", "'unsafe-inline'"], 'media-src': ["'self'", 'data:'], }, - 'browserSniff': false, - 'disableAndroid': true }, 'dnsPrefetchControl': true, 'frameguard': true, 'hidePoweredBy': true, - 'hpkp': false, - 'hsts': true, 'ieNoOpen': true, - 'noCache': true, 'noSniff': true, 'referrerPolicy': true, 'xssFilter': true diff --git a/lib/indexer-rpc/rpc-client.js b/lib/indexer-rpc/rpc-client.js index eb324ea..9be3ac4 100644 --- a/lib/indexer-rpc/rpc-client.js +++ b/lib/indexer-rpc/rpc-client.js @@ -8,6 +8,7 @@ const net = require('net') const makeConcurrent = require('make-concurrent') const network = require('../bitcoin/network') const keys = require('../../keys')[network.key] +const util = require('../util') /** @@ -62,11 +63,11 @@ class RpcClient { * @returns {boolean} returns true if message related to a connection error */ static isConnectionError(err) { - if (typeof err != 'string') + if (typeof err !== 'string') return false - const isTimeoutError = (err.indexOf('connect ETIMEDOUT') != -1) - const isConnRejected = (err.indexOf('Connection Rejected') != -1) + const isTimeoutError = (err.indexOf('connect ETIMEDOUT') !== -1) + const isConnRejected = (err.indexOf('Connection Rejected') !== -1) return (isTimeoutError || isConnRejected) } @@ -121,6 +122,7 @@ class RpcClient { /** * Send requests (internal method) * @param {Object[]} data - array of objects {method: ..., params: ...} + * @param {boolean=} batched - batch requests * @returns {Promise} */ async _call(data, batched) { @@ -173,7 +175,7 @@ class RpcClient { for (let c of chunk) { response += c // Detect the end of a response - if (c == '\n') { + if (c === '\n') { try { // Parse the response let parsed = JSON.parse(response) @@ -189,7 +191,7 @@ class RpcClient { response = '' // If all responses have been received // close the connection - if (responses.length == data.length) + if (responses.length === data.length) conn.end() } catch (err) { reject( diff --git a/lib/remote-importer/bitcoind-wrapper.js b/lib/remote-importer/bitcoind-wrapper.js index e3667b3..ee8d4b7 100644 --- a/lib/remote-importer/bitcoind-wrapper.js +++ b/lib/remote-importer/bitcoind-wrapper.js @@ -23,9 +23,9 @@ class BitcoindWrapper extends Wrapper { * Constructor */ constructor() { - super(null, null) + super('bitcoind', null) // RPC client - this.client = createRpcClient() + this.client = createRpcClient({ timeout: 5 * 60 * 1000 }) } /** diff --git a/lib/remote-importer/esplora-wrapper.js b/lib/remote-importer/esplora-wrapper.js index 1a82039..1603a37 100644 --- a/lib/remote-importer/esplora-wrapper.js +++ b/lib/remote-importer/esplora-wrapper.js @@ -20,6 +20,8 @@ class EsploraWrapper extends Wrapper { /** * Constructor + * @constructor + * @param {string} url */ constructor(url) { super(url, keys.indexer.socks5Proxy) @@ -87,7 +89,7 @@ class EsploraWrapper extends Wrapper { while (true) { const txids = await this._getTxsForAddress(address, lastSeenTxid) - if (txids.length == 0) + if (txids.length === 0) // we have all the transactions return ret diff --git a/lib/remote-importer/local-indexer-wrapper.js b/lib/remote-importer/local-indexer-wrapper.js index dbf480f..5730d72 100644 --- a/lib/remote-importer/local-indexer-wrapper.js +++ b/lib/remote-importer/local-indexer-wrapper.js @@ -104,7 +104,7 @@ class LocalIndexerWrapper extends Wrapper { }) // Send the requests - const results = (keys.indexer.localIndexer.batchRequests == 'active') + const results = (keys.indexer.localIndexer.batchRequests === 'active') ? await this.client.sendBatch(commands) : await this.client.sendRequests(commands) diff --git a/lib/remote-importer/local-rest-indexer-wrapper.js b/lib/remote-importer/local-rest-indexer-wrapper.js index 0ec7677..7445b7f 100644 --- a/lib/remote-importer/local-rest-indexer-wrapper.js +++ b/lib/remote-importer/local-rest-indexer-wrapper.js @@ -22,6 +22,8 @@ class LocalRestIndexerWrapper extends Wrapper { /** * Constructor + * @constructor + * @param {string} url */ constructor(url) { super(url, null) diff --git a/lib/remote-importer/oxt-wrapper.js b/lib/remote-importer/oxt-wrapper.js index 6bc66fa..5e761d2 100644 --- a/lib/remote-importer/oxt-wrapper.js +++ b/lib/remote-importer/oxt-wrapper.js @@ -18,6 +18,8 @@ class OxtWrapper extends Wrapper { /** * Constructor + * @constructor + * @param {string} url */ constructor(url) { super(url, keys.indexer.socks5Proxy) @@ -123,7 +125,7 @@ class OxtWrapper extends Wrapper { async getChainTipHeight() { let chainTipHeight = null const result = await this._get(`/lastblock`) - if (result != null && result['data'].length == 1) + if (result != null && result['data'].length === 1) chainTipHeight = parseInt(result['data'][0]['height']) return {'chainTipHeight': chainTipHeight} } diff --git a/lib/remote-importer/remote-importer.js b/lib/remote-importer/remote-importer.js index d56b319..f772081 100644 --- a/lib/remote-importer/remote-importer.js +++ b/lib/remote-importer/remote-importer.js @@ -17,7 +17,7 @@ const gap = keys.gap let Sources -if (network.key == 'bitcoin') { +if (network.key === 'bitcoin') { Sources = require('./sources-mainnet') } else { Sources = require('./sources-testnet') @@ -64,8 +64,8 @@ class RemoteImporter { * Import an HD account from remote sources * @param {string} xpub - HD Account * @param {string} type - type of HD Account - * @param {integer} gapLimit - (optional) gap limit for derivation - * @param {integer} startIndex - (optional) rescan shall start from this index + * @param {number} gapLimit - (optional) gap limit for derivation + * @param {number} startIndex - (optional) rescan shall start from this index */ async importHDAccount(xpub, type, gapLimit, startIndex) { if (!hdaHelper.isValid(xpub)) @@ -96,9 +96,18 @@ class RemoteImporter { startIndex = (startIndex == null) ? -1 : startIndex - 1 try { - const results = await util.parallelCall(chains, chain => { - return this.xpubScan(xpub, chain, startIndex, startIndex, gaps[chain], type) - }) + let results + + // Call in series if bitcoind is used because scantxoutset can only process one import at a time + if (keys.indexer.active === 'local_bitcoind') { + results = await util.seriesCall(chains, chain => { + return this.xpubScan(xpub, chain, startIndex, startIndex, gaps[chain], type) + }) + } else { + results = await util.parallelCall(chains, chain => { + return this.xpubScan(xpub, chain, startIndex, startIndex, gaps[chain], type) + }) + } // Accumulate addresses and transactions from all chains const txns = results.map(r => r.transactions).flat() @@ -202,7 +211,7 @@ class RemoteImporter { } if (gotTransactions) { - const keyStatus = (c == 0) ? 'txs_ext' : 'txs_int' + const keyStatus = (c === 0) ? 'txs_ext' : 'txs_int' this.importing[xpub][keyStatus] = Object.keys(txids).length // We must go deeper const result = await this.xpubScan(xpub, c, d, u, G, type, txids) @@ -236,7 +245,7 @@ class RemoteImporter { const addresses = candidates.filter(c => !this.importing[c]) this.importing = addresses.reduce((m,a) => (m[a] = true, m), this.importing) - if (addresses.length == 0) return true + if (addresses.length === 0) return true Logger.info(`Importer : Importing ${addresses.join(',')}`) @@ -318,8 +327,8 @@ class RemoteImporter { const blocks = await db.getBlocksByHashes(blocksHashes) return util.parallelCall(blocks, block => { - const filteredTxs = txs.filter(tx => (tx.block && tx.block.hash == block.blockHash)) - if (filteredTxs.length == 0) return + const filteredTxs = txs.filter(tx => (tx.block && tx.block.hash === block.blockHash)) + if (filteredTxs.length === 0) return const txids = filteredTxs.map(tx => tx.txid) return db.confirmTransactions(txids, block.blockID) }) diff --git a/lib/remote-importer/sources-mainnet.js b/lib/remote-importer/sources-mainnet.js index 48ce6a7..79dbb4f 100644 --- a/lib/remote-importer/sources-mainnet.js +++ b/lib/remote-importer/sources-mainnet.js @@ -31,17 +31,17 @@ class SourcesMainnet extends Sources { * Initialize the external data source */ _initSource() { - if (keys.indexer.active == 'local_bitcoind') { + if (keys.indexer.active === 'local_bitcoind') { // If local bitcoind option is activated // we'll use the local node as our unique source this.source = new BitcoindWrapper() Logger.info('Importer : Activated Bitcoind as the data source for imports') - } else if (keys.indexer.active == 'local_indexer') { + } else if (keys.indexer.active === 'local_indexer') { // If local indexer option is activated // we'll use the local indexer as our unique source this.source = new LocalIndexerWrapper() Logger.info('Importer : Activated local indexer as the data source for imports') - } else if (keys.indexer.active == 'local_rest_indexer') { + } else if (keys.indexer.active === 'local_rest_indexer') { // If local rest indexer option is activated // we'll use the local indexer as our unique source const uri = `http://${keys.indexer.localIndexer.host}:${keys.indexer.localIndexer.port}` diff --git a/lib/remote-importer/sources-testnet.js b/lib/remote-importer/sources-testnet.js index 3ee3907..d1068e3 100644 --- a/lib/remote-importer/sources-testnet.js +++ b/lib/remote-importer/sources-testnet.js @@ -32,17 +32,17 @@ class SourcesTestnet extends Sources { * Initialize the external data source */ _initSource() { - if (keys.indexer.active == 'local_bitcoind') { + if (keys.indexer.active === 'local_bitcoind') { // If local bitcoind option is activated // we'll use the local node as our unique source this.source = new BitcoindWrapper() Logger.info('Importer : Activated Bitcoind as the data source for imports') - } else if (keys.indexer.active == 'local_indexer') { + } else if (keys.indexer.active === 'local_indexer') { // If local indexer option is activated // we'll use the local indexer as our unique source this.source = new LocalIndexerWrapper() Logger.info('Importer : Activated local indexer as the data source for imports') - } else if (keys.indexer.active == 'local_rest_indexer') { + } else if (keys.indexer.active === 'local_rest_indexer') { // If local rest indexer option is activated // we'll use the local indexer as our unique source const uri = `http://${keys.indexer.localIndexer.host}:${keys.indexer.localIndexer.port}` diff --git a/lib/remote-importer/sources.js b/lib/remote-importer/sources.js index ee566cc..8f71c2e 100644 --- a/lib/remote-importer/sources.js +++ b/lib/remote-importer/sources.js @@ -48,7 +48,7 @@ class Sources { ret.txids = result.txids } catch(e) { - Logger.error(null, `Importer : Sources.getAddress() : ${address} from ${this.source.base}`) + Logger.error(e, `Importer : Sources.getAddress() : ${address} from ${this.source.base}`) } finally { return ret } @@ -75,7 +75,7 @@ class Sources { } } catch(e) { - Logger.error(null, `Importer : Sources.getAddresses() : Error while requesting ${addresses} from ${this.source.base}`) + Logger.error(e, `Importer : Sources.getAddresses() : Error while requesting ${addresses} from ${this.source.base}`) } finally { return ret } diff --git a/lib/remote-importer/wrapper.js b/lib/remote-importer/wrapper.js index 4272e09..038ecd6 100644 --- a/lib/remote-importer/wrapper.js +++ b/lib/remote-importer/wrapper.js @@ -16,6 +16,9 @@ class Wrapper { /** * Constructor + * @constructor + * @param {string} url + * @param {string=} socks5Proxy */ constructor(url, socks5Proxy) { this.base = url diff --git a/lib/util.js b/lib/util.js index 0c96d04..ada81b4 100644 --- a/lib/util.js +++ b/lib/util.js @@ -5,18 +5,22 @@ 'use strict' /** - * Class providing utility functions as static methods + * @class Util + * @description Class providing utility functions as static methods */ class Util { /** * Constructor + * @constructor */ constructor() {} /** - * Serialize a series of asynchronous calls to a function - * over a list of objects + * @description Serialize a series of asynchronous calls to a function over a list of objects + * @param {Array} list + * @param {function} fn + * @returns {Promise>} */ static async seriesCall(list, fn) { const results = [] @@ -29,8 +33,10 @@ class Util { } /** - * Execute parallel asynchronous calls to a function - * over a list of objects + * @description Execute parallel asynchronous calls to a function over a list of objects + * @param {Array} list + * @param {function} fn + * @returns {Promise>} */ static parallelCall(list, fn) { const operations = list.map(item => { return fn(item) }) @@ -38,16 +44,21 @@ class Util { } /** - * Delay the call to a function + * @description Delay the call to a function + * @param {number} ms + * @returns {Promise} */ - static delay(ms, v) { + static delay(ms) { return new Promise(resolve => { - setTimeout(resolve.bind(null, v), ms) + setTimeout(() => resolve(), ms) }) } /** - * Splits a list into a list of lists each with maximum length LIMIT + * @description Splits a list into a list of lists each with maximum length LIMIT + * @param {Array} list + * @param {number} limit + * @returns {Array>} */ static splitList(list, limit) { const lists = [] @@ -57,7 +68,9 @@ class Util { } /** - * Check if a string is a valid hex value + * @description Check if a string is a valid hex value + * @param {string} hash + * @returns {boolean} */ static isHashStr(hash) { const hexRegExp = new RegExp(/^[0-9a-f]*$/, 'i') @@ -65,49 +78,64 @@ class Util { } /** - * Check if a string is a well formed 256 bits hash + * @description Check if a string is a well formed 256 bits hash + * @param {string} hash + * @returns {boolean} */ static is256Hash(hash) { - return Util.isHashStr(hash) && hash.length == 64 + return Util.isHashStr(hash) && hash.length === 64 } /** - * Sum an array of values + * @description Sum an array of values + * @param {Array} arr + * @returns {number} */ static sum(arr) { return arr.reduce((memo, val) => { return memo + val }, 0) } /** - * Mean of an array of values + * @description Mean of an array of values + * @param {Array} arr + * @returns {number} */ static mean(arr) { - if (arr.length == 0) + if (arr.length === 0) return NaN return sum(arr) / arr.length } /** - * Compare 2 values (asc order) + * @description Compare 2 values (asc order) + * @param {number} a + * @param {number} b + * @returns {number} */ static cmpAsc(a, b) { return a - b } /** - * Compare 2 values (desc order) + * @description Compare 2 values (desc order) + * @param {number} a + * @param {number} b + * @returns {number} */ static cmpDesc(a,b) { return b - a } /** - * Median of an array of values + * @description Median of an array of values + * @param {Array} arr + * @param {boolean=} sorted + * @returns {number} */ static median(arr, sorted) { - if (arr.length == 0) return NaN - if (arr.length == 1) return arr[0] + if (arr.length === 0) return NaN + if (arr.length === 1) return arr[0] if (!sorted) arr.sort(Util.cmpAsc) @@ -124,7 +152,10 @@ class Util { } /** - * Median Absolute Deviation of an array of values + * @description Median Absolute Deviation of an array of values + * @param {Array} arr + * @param {boolean=} sorted + * @returns {number} */ static mad(arr, sorted) { const med = Util.median(arr, sorted) @@ -136,7 +167,10 @@ class Util { } /** - * Quartiles of an array of values + * @description Quartiles of an array of values + * @param {Array} arr + * @param {boolean=} sorted + * @returns {Array} */ static quartiles(arr, sorted) { const q = [NaN,NaN,NaN] @@ -156,10 +190,10 @@ class Util { const mod4 = arr.length % 4 const n = Math.floor(arr.length / 4) - if (mod4 == 1) { + if (mod4 === 1) { q[0] = (arr[n-1] + 3 * arr[n]) / 4 q[2] = (3 * arr[3*n] + arr[3*n+1]) / 4 - } else if (mod4 == 3) { + } else if (mod4 === 3) { q[0] = (3 * arr[n] + arr[n+1]) / 4 q[2] = (arr[3*n+1] + 3 * arr[3*n+2]) / 4 } @@ -174,7 +208,11 @@ class Util { } /** - * Obtain the value of the PCT-th percentile, where PCT on [0,100] + * @description Obtain the value of the PCT-th percentile, where PCT on [0,100] + * @param {Array} arr + * @param {number} pct + * @param {boolean=} sorted + * @returns {number} */ static percentile(arr, pct, sorted) { if (arr.length < 2) return NaN @@ -210,28 +248,35 @@ class Util { } /** - * Convert bytes to Mb + * @description Convert bytes to MB + * @param {number} bytes + * @returns {number} */ static toMb(bytes) { return +(bytes / Util.MB).toFixed(0) } /** - * Convert a date to a unix timestamp + * @description Convert a date to a unix timestamp + * @returns {number} */ static unix() { return (Date.now() / 1000) | 0 } /** - * Convert a value to a padded string (10 chars) + * @description Convert a value to a padded string (10 chars) + * @param {number} v + * @returns {string} */ static pad10(v) { return (v < 10) ? `0${v}` : `${v}` } /** - * Convert a value to a padded string (100 chars) + * @description Convert a value to a padded string (100 chars) + * @param {number} v + * @returns {string} */ static pad100(v) { if (v < 10) return `00${v}` @@ -240,7 +285,9 @@ class Util { } /** - * Convert a value to a padded string (1000 chars) + * @description Convert a value to a padded string (1000 chars) + * @param {number} v + * @returns {string} */ static pad1000(v) { if (v < 10) return `000${v}` @@ -250,7 +297,11 @@ class Util { } /** - * Left pad + * @description Left pad + * @param {number} number + * @param {number} places + * @param {string=} fill + * @returns {string} */ static leftPad(number, places, fill) { number = Math.round(number) @@ -271,7 +322,10 @@ class Util { } /** - * Display a time period, in seconds, as DDD:HH:MM:SS[.MS] + * @description Display a time period, in seconds, as DDD:HH:MM:SS[.MS] + * @param {number} period + * @param {number} milliseconds + * @returns {string} */ static timePeriod(period, milliseconds) { milliseconds = !!milliseconds @@ -297,6 +351,19 @@ class Util { } } + /** + * @description Generate array of sequential numbers from start to stop + * @param {number} start + * @param {number} stop + * @param {number=} step + * @returns {number[]} + */ + static range(start, stop, step = 1) { + return Array(Math.ceil((stop - start) / step)) + .fill(start) + .map((x, y) => x + y * step) + } + } /** diff --git a/lib/wallet/address-info.js b/lib/wallet/address-info.js index 194aba2..0ea652a 100644 --- a/lib/wallet/address-info.js +++ b/lib/wallet/address-info.js @@ -9,13 +9,15 @@ const hdaHelper = require('../bitcoin/hd-accounts-helper') /** - * A class storing information about the actibity of an address + * @class AddressInfo + * @description A class storing information about the actibity of an address */ class AddressInfo { /** * Constructor - * @param {object} address - bitcoin address + * @constructor + * @param {string} address - bitcoin address */ constructor(address) { // Initializes properties @@ -25,7 +27,7 @@ class AddressInfo { this.nTx = 0 this.unspentOutputs = [] - this.tracked = false, + this.tracked = false this.type = 'untracked' this.xpub = null this.path = null @@ -34,8 +36,8 @@ class AddressInfo { } /** - * Load information about the address - * @returns {Promise} + * @description Load information about the address + * @returns {Promise} */ async loadInfo() { return Promise.all([ @@ -57,9 +59,8 @@ class AddressInfo { } /** - * Load information about the address - * (extended form) - * @returns {Promise} + * @description Load information about the address (extended form) + * @returns {Promise} */ async loadInfoExtended() { const res = await db.getHDAccountsByAddresses([this.address]) @@ -75,7 +76,7 @@ class AddressInfo { } for (let a of res.loose) { - if (a.addrAddress == this.address) { + if (a.addrAddress === this.address) { this.tracked = true this.type = 'loose' break @@ -86,9 +87,9 @@ class AddressInfo { } /** - * Loads a partial list of transactions for this address - * @param {integer} page - page index - * @param {integer} count - number of transactions per page + * @description Loads a partial list of transactions for this address + * @param {number} page - page index + * @param {number} count - number of transactions per page * @returns {Promise} */ async loadTransactions(page, count) { @@ -96,8 +97,8 @@ class AddressInfo { } /** - * Load the utxos associated to the address - * @returns {Promise - object[]} + * @description Load the utxos associated to the address + * @returns {Promise} */ async loadUtxos() { this.unspentOutputs = [] @@ -118,7 +119,7 @@ class AddressInfo { } /** - * Return a plain old js object with address properties + * @description Return a plain old js object with address properties * @returns {object} */ toPojo() { @@ -135,8 +136,7 @@ class AddressInfo { } /** - * Return a plain old js object with address properties - * (extended version) + * @description Return a plain old js object with address properties (extended version) * @returns {object} */ toPojoExtended() { diff --git a/lib/wallet/hd-account-info.js b/lib/wallet/hd-account-info.js index 47a91eb..2f9f4e7 100644 --- a/lib/wallet/hd-account-info.js +++ b/lib/wallet/hd-account-info.js @@ -12,13 +12,14 @@ const rpcLatestBlock = require('../bitcoind-rpc/latest-block') /** - * A class storing information about the actibity of a hd account + * @class HdAccountInfo + * @description A class storing information about the actibity of a hd account */ class HdAccountInfo { /** * Constructor - * @param {object} xpub - xpub + * @param {string} xpub - xpub */ constructor(xpub) { // Initializes properties @@ -39,9 +40,8 @@ class HdAccountInfo { } /** - * Ensure the hd account exists in database - * Otherwise, tries to import it with BIP44 derivation - * @returns {Promise - integer} return the internal id of the hd account + * @description Ensure the hd account exists in database. Otherwise, tries to import it with BIP44 derivation + * @returns {Promise} return the internal id of the hd account * or null if it doesn't exist */ async ensureHdAccount() { @@ -49,7 +49,7 @@ class HdAccountInfo { const id = await db.getHDAccountId(this.xpub) return id } catch(e) { - if (e == errors.db.ERROR_NO_HD_ACCOUNT) { + if (e === errors.db.ERROR_NO_HD_ACCOUNT) { try { // Default to BIP44 import return hdaService.restoreHdAccount(this.xpub, hdaHelper.BIP44) @@ -62,8 +62,8 @@ class HdAccountInfo { } /** - * Load information about the hd account - * @returns {Promise} + * @description Load information about the hd account + * @returns {Promise} */ async loadInfo() { try { @@ -93,29 +93,41 @@ class HdAccountInfo { this.depth = node[2].depth } + /** + * @returns {Promise} + */ async _loadBalance() { this.finalBalance = await db.getHDAccountBalance(this.xpub) } + /** + * @returns {Promise} + */ async _loadUnusedIndices() { const unusedIdx = await db.getHDAccountNextUnusedIndices(this.xpub) this.accountIndex = unusedIdx[0] this.changeIndex = unusedIdx[1] } + /** + * @returns {Promise} + */ async _loadDerivedIndices() { const derivedIdx = await db.getHDAccountDerivedIndices(this.xpub) this.accountDerivedIndex = derivedIdx[0] this.changeDerivedIndex = derivedIdx[1] } + /** + * @returns {Promise} + */ async _loadNbTransactions() { this.nTx = await db.getHDAccountNbTransactions(this.xpub) } /** - * Load the utxos associated to the hd account - * @returns {Promise - object[]} + * @description Load the utxos associated to the hd account + * @returns {Promise} */ async loadUtxos() { this.unspentOutputs = [] @@ -153,7 +165,7 @@ class HdAccountInfo { } /** - * Return a plain old js object with hd account properties + * @description Return a plain old js object with hd account properties * @returns {object} */ toPojo() { @@ -169,8 +181,7 @@ class HdAccountInfo { } /** - * Return a plain old js object with hd account properties - * (extended version) + * @description Return a plain old js object with hd account properties (extended version) * @returns {object} */ toPojoExtended() { diff --git a/lib/wallet/wallet-entities.js b/lib/wallet/wallet-entities.js index 0f88f52..73a65ff 100644 --- a/lib/wallet/wallet-entities.js +++ b/lib/wallet/wallet-entities.js @@ -6,13 +6,13 @@ /** - * A class storing entities (xpubs, addresses, pubkeys) - * defining a (full|partial) wallet + * @class WalletEntities + * @description A class storing entities (xpubs, addresses, pubkeys) defining a (full|partial) wallet */ class WalletEntities { /** - * Constructor + * @constructor */ constructor() { this.pubkeys = [] @@ -23,8 +23,7 @@ class WalletEntities { } /** - * Add a new hd account - * with its translation as an xpub + * @description Add a new hd account with its translation as an xpub * @param {string} xpub - xpub or tpub * @param {string} ypub - ypub or upub or false * @param {string} zpub - zpub or vpub or false @@ -36,7 +35,7 @@ class WalletEntities { } /** - * Add a new address/pubkey + * @description Add a new address/pubkey * @param {string} address - bitcoin address * @param {string} pubkey - pubkey associated to the address or false */ @@ -46,7 +45,7 @@ class WalletEntities { } /** - * Update the pubkey associated to a given address + * @description Update the pubkey associated to a given address * @param {string} address - bitcoin address * @param {string} pubkey - public key */ @@ -57,7 +56,7 @@ class WalletEntities { } /** - * Checks if a xpub is already listed + * @description Checks if a xpub is already listed * @param {string} xpub * @returns {boolean} returns true if the xpub is already listed, false otherwise */ @@ -66,7 +65,7 @@ class WalletEntities { } /** - * Checks if an address is already listed + * @description Checks if an address is already listed * @param {string} address - bitcoin address * @returns {boolean} returns true if the address is already listed, false otherwise */ @@ -75,7 +74,7 @@ class WalletEntities { } /** - * Checks if a pubkey is already listed + * @description Checks if a pubkey is already listed * @param {string} pubkey - public key * @returns {boolean} returns true if the pubkey is already listed, false otherwise */ @@ -85,4 +84,4 @@ class WalletEntities { } -module.exports = WalletEntities \ No newline at end of file +module.exports = WalletEntities diff --git a/lib/wallet/wallet-info.js b/lib/wallet/wallet-info.js index 3d09dfa..160f223 100644 --- a/lib/wallet/wallet-info.js +++ b/lib/wallet/wallet-info.js @@ -16,11 +16,13 @@ const AddressInfo = require('./address-info') /** * A class storing information about a (full|partial) wallet * Provides a set of methods allowing to retrieve specific information + * @class WalletInfo */ class WalletInfo { /** * Constructor + * @constructor * @param {object} entities - wallet entities (hdaccounts, addresses, pubkeys) */ constructor(entities) { @@ -49,7 +51,7 @@ class WalletInfo { /** * Ensure hd accounts exist in database - * @returns {Promise} + * @returns {Promise>} */ async ensureHdAccounts() { return util.parallelCall(this.entities.xpubs, async xpub => { @@ -60,7 +62,7 @@ class WalletInfo { /** * Load information about the hd accounts - * @returns {Promise} + * @returns {Promise>} */ async loadHdAccountsInfo() { return util.parallelCall(this.entities.xpubs, async xpub => { @@ -91,7 +93,7 @@ class WalletInfo { /** * Filter addresses that belong to an active hd account - * @returns {Promise} + * @returns {Promise} */ async filterAddresses() { const res = await db.getXpubByAddresses(this.entities.addrs) @@ -110,7 +112,7 @@ class WalletInfo { /** * Load information about the addresses - * @returns {Promise} + * @returns {Promise>} */ async loadAddressesInfo() { return util.parallelCall(this.entities.addrs, async address => { @@ -123,11 +125,11 @@ class WalletInfo { /** * Loads a partial list of transactions for this wallet - * @param {integer} page - page index - * @param {integer} count - number of transactions per page - * @param {boolean} txBalance - True if past wallet balance + * @param {number} page - page index + * @param {number} count - number of transactions per page + * @param {boolean=} txBalance - True if past wallet balance * should be computed for each transaction - * @returns {Promise} + * @returns {Promise} */ async loadTransactions(page, count, txBalance) { this.txs = await db.getTxsByAddrAndXpubs( @@ -149,7 +151,7 @@ class WalletInfo { /** * Loads the number of transactions for this wallet - * @returns {Promise} + * @returns {Promise} */ async loadNbTransactions() { const nbTxs = await db.getAddrAndXpubsNbTransactions( @@ -163,7 +165,7 @@ class WalletInfo { /** * Loads tinfo about the fee rates - * @returns {Promise} + * @returns {Promise} */ async loadFeesInfo() { this.info.fees = await rpcFees.getFees() @@ -171,7 +173,7 @@ class WalletInfo { /** * Loads the list of unspent outputs for this wallet - * @returns {Promise} + * @returns {Promise} */ async loadUtxos() { // Load the utxos for the hd accounts @@ -212,7 +214,7 @@ class WalletInfo { /** * Post process addresses and public keys */ - postProcessAddresses() { + async postProcessAddresses() { for (let b = 0; b < this.entities.pubkeys.length; b++) { const pk = this.entities.pubkeys[b] @@ -221,7 +223,7 @@ class WalletInfo { // Add pubkeys in this.addresses for (let c = 0; c < this.addresses.length; c++) { - if (address == this.addresses[c].address) + if (address === this.addresses[c].address) this.addresses[c].pubkey = pk } @@ -229,30 +231,32 @@ class WalletInfo { for (let d = 0; d < this.txs.length; d++) { // inputs for (let e = 0; e < this.txs[d].inputs.length; e++) { - if (address == this.txs[d].inputs[e].prev_out.addr) + if (address === this.txs[d].inputs[e].prev_out.addr) this.txs[d].inputs[e].prev_out.pubkey = pk } // outputs for (let e = 0; e < this.txs[d].out.length; e++) { - if (address == this.txs[d].out[e].addr) + if (address === this.txs[d].out[e].addr) this.txs[d].out[e].pubkey = pk } } // Add pubkeys in this.unspentOutputs for (let f = 0; f < this.unspentOutputs.length; f++) { - if (address == this.unspentOutputs[f].addr) { + if (address === this.unspentOutputs[f].addr) { this.unspentOutputs[f].pubkey = pk } } } } + + return Promise.resolve() } /** * Post process hd accounts (xpubs translations) */ - postProcessHdAccounts() { + async postProcessHdAccounts() { for (let b = 0; b < this.entities.xpubs.length; b++) { const entityXPub = this.entities.xpubs[b] const entityYPub = this.entities.ypubs[b] @@ -263,7 +267,7 @@ class WalletInfo { // Translate xpub => ypub/zpub in this.addresses for (let c = 0; c < this.addresses.length; c++) { - if (entityXPub == this.addresses[c].address) + if (entityXPub === this.addresses[c].address) this.addresses[c].address = tgtXPub } @@ -272,14 +276,14 @@ class WalletInfo { // inputs for (let e = 0; e < this.txs[d].inputs.length; e++) { const xpub = this.txs[d].inputs[e].prev_out.xpub - if (xpub && (xpub.m == entityXPub)) + if (xpub && (xpub.m === entityXPub)) this.txs[d].inputs[e].prev_out.xpub.m = tgtXPub } // outputs for (let e = 0; e < this.txs[d].out.length; e++) { const xpub = this.txs[d].out[e].xpub - if (xpub && (xpub.m == entityXPub)) + if (xpub && (xpub.m === entityXPub)) this.txs[d].out[e].xpub.m = tgtXPub } } @@ -287,12 +291,14 @@ class WalletInfo { // Translate xpub => ypub/zpub in this.unspentOutputs for (let f = 0; f < this.unspentOutputs.length; f++) { const xpub = this.unspentOutputs[f].xpub - if (xpub && (xpub.m == entityXPub)) { + if (xpub && (xpub.m === entityXPub)) { this.unspentOutputs[f].xpub.m = tgtXPub } } } } + + return Promise.resolve() } /** diff --git a/lib/wallet/wallet-service.js b/lib/wallet/wallet-service.js index 08cb7ad..97279ac 100644 --- a/lib/wallet/wallet-service.js +++ b/lib/wallet/wallet-service.js @@ -72,7 +72,7 @@ class WalletService { // Force import of addresses associated to paynyms // if dojo relies on a local index - if (keys.indexer.active != 'third_party_explorer') + if (keys.indexer.active !== 'third_party_explorer') await this._forceEnsureAddressesForActivePubkeys(active) // Filter the addresses @@ -150,7 +150,7 @@ class WalletService { await walletInfo.ensureAddresses() // Force import of addresses associated to paynyms // if dojo relies on a local index - if (keys.indexer.active != 'third_party_explorer') + if (keys.indexer.active !== 'third_party_explorer') await this._forceEnsureAddressesForActivePubkeys(active) // Filter the address and load them await walletInfo.filterAddresses() @@ -252,7 +252,7 @@ class WalletService { await walletInfo.ensureAddresses() // Force import of addresses associated to paynyms // if dojo relies on a local index - if (keys.indexer.active != 'third_party_explorer') + if (keys.indexer.active !== 'third_party_explorer') await this._forceEnsureAddressesForActivePubkeys(active) // Filter the addresses await walletInfo.filterAddresses() @@ -274,8 +274,8 @@ class WalletService { /** * Get a subset of wallet transactions * @param {object} entities - mapping of active entities - * @param {integer} page - page of transactions to be returned - * @param {integer} count - number of transactions returned per page + * @param {number} page - page of transactions to be returned + * @param {number} count - number of transactions returned per page * @returns {Promise} */ async getWalletTransactions(entities, page, count) { @@ -287,7 +287,7 @@ class WalletService { } // Check parameters - if (entities.xpubs.length == 0 && entities.addrs.length == 0) + if (entities.xpubs.length === 0 && entities.addrs.length === 0) return ret // Initialize a WalletInfo object @@ -344,13 +344,13 @@ class WalletService { * @returns {boolean} return true if conditions are met, false otherwise */ _checkEntities(active, legacy, bip49, bip84, pubkeys) { - const allEmpty = active.xpubs.length == 0 - && active.addrs.length == 0 - && legacy.xpubs.length == 0 - && legacy.addrs.length == 0 - && pubkeys.addrs.length == 0 - && bip49.xpubs.length == 0 - && bip84.xpubs.length == 0 + const allEmpty = active.xpubs.length === 0 + && active.addrs.length === 0 + && legacy.xpubs.length === 0 + && legacy.addrs.length === 0 + && pubkeys.addrs.length === 0 + && bip49.xpubs.length === 0 + && bip84.xpubs.length === 0 return !allEmpty } @@ -375,7 +375,7 @@ class WalletService { const pubkey = source.pubkeys[idxSource] const idxActive = active.addrs.indexOf(addr) - if (idxActive == -1) { + if (idxActive === -1) { active.addrs.push(addr) active.pubkeys.push(pubkey) } else if (pubkey) { diff --git a/package-lock.json b/package-lock.json index f167a2a..8270d1e 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,45 +1,50 @@ { "name": "samourai-dojo", - "version": "1.10.1", + "version": "1.11.0", "lockfileVersion": 2, "requires": true, "packages": { "": { - "version": "1.10.1", + "name": "samourai-dojo", + "version": "1.11.0", "license": "AGPL-3.0-only", "dependencies": { - "@tinyhttp/app": "1.3.3", - "async-sema": "2.1.2", + "@tinyhttp/app": "1.3.13", + "async-sema": "3.1.0", "axios": "0.21.1", - "bip39": "2.4.0", + "bip39": "3.0.4", "bitcoinjs-lib": "5.2.0", - "bitcoinjs-message": "1.0.1", + "bitcoinjs-message": "2.2.0", "body-parser": "1.19.0", - "helmet": "3.23.3", + "helmet": "4.6.0", "jsonwebtoken": "8.5.1", "lodash": "4.17.21", - "lru-cache": "4.0.2", + "lru-cache": "6.0.0", "make-concurrent": "5.3.0", "minimist": "1.2.5", "mysql": "2.18.1", + "nocache": "3.0.1", "passport": "0.4.1", "passport-localapikey-update": "0.6.0", "rpc-bitcoin": "2.0.0", - "sirv": "1.0.11", - "socks-proxy-agent": "4.0.1", - "validator": "10.8.0", + "sirv": "1.0.12", + "socks-proxy-agent": "6.0.0", + "validator": "13.6.0", "websocket": "1.0.34", - "workerpool": "6.1.4", - "zeromq": "4.2.0" + "workerpool": "6.1.5", + "zeromq": "6.0.0-beta.5" }, "devDependencies": { - "mocha": "^7.1.1" + "mocha": "9.0.3" + }, + "engines": { + "node": "14.x.x" } }, "node_modules/@polka/url": { - "version": "1.0.0-next.12", - "resolved": "https://registry.npmjs.org/@polka/url/-/url-1.0.0-next.12.tgz", - "integrity": "sha512-6RglhutqrGFMO1MNUXp95RBuYIuc8wTnMAV5MUhLmjTOy78ncwOw7RgeQ/HeymkKXRhZd0s2DNrM1rL7unk3MQ==" + "version": "1.0.0-next.15", + "resolved": "https://registry.npmjs.org/@polka/url/-/url-1.0.0-next.15.tgz", + "integrity": "sha512-15spi3V28QdevleWBNXE4pIls3nFZmBbUGrW9IVPwiQczuSb9n76TCB4bsk8TSel+I1OkHEdPhu5QKMfY6rQHA==" }, "node_modules/@tinyhttp/accepts": { "version": "1.3.0", @@ -58,23 +63,23 @@ } }, "node_modules/@tinyhttp/app": { - "version": "1.3.3", - "resolved": "https://registry.npmjs.org/@tinyhttp/app/-/app-1.3.3.tgz", - "integrity": "sha512-PhE3En3AMWNcdrm0hVTcawz5UIWUlzHo5Zl+JunOXR2hhXJ9afvm6OCXg0GX/bgNZ1vW/Prwp10+KrGWygthnQ==", + "version": "1.3.13", + "resolved": "https://registry.npmjs.org/@tinyhttp/app/-/app-1.3.13.tgz", + "integrity": "sha512-eQO5NXfIVZRQPApdmG+00C1zYC0fJW+HwCvdvPE/VVQj81CCLdD6t2g0xgCDMKuuBfvyukFAPPKTNjpMBneWpg==", "dependencies": { "@tinyhttp/cookie": "1.3.0", "@tinyhttp/proxy-addr": "1.3.0", - "@tinyhttp/req": "1.3.0", - "@tinyhttp/res": "1.3.0", - "@tinyhttp/router": "1.3.1", - "regexparam": "^1.3.0" + "@tinyhttp/req": "1.3.1", + "@tinyhttp/res": "1.3.2", + "@tinyhttp/router": "1.3.3", + "regexparam": "^2.0.0" }, "engines": { "node": ">=12.x" }, "funding": { "type": "individual", - "url": "https://github.com/talentlessguy/tinyhttp?sponsor=1" + "url": "https://github.com/tinyhttp/tinyhttp?sponsor=1" } }, "node_modules/@tinyhttp/content-disposition": { @@ -146,13 +151,13 @@ } }, "node_modules/@tinyhttp/req": { - "version": "1.3.0", - "resolved": "https://registry.npmjs.org/@tinyhttp/req/-/req-1.3.0.tgz", - "integrity": "sha512-zIbtJA7Hp2p4MqszP2jOBi2NWi8fTGd4lso+0CjwJa+WTE+lgXVAy6mN12rTAxjXweAyRvQpRIJ5W2r8OLuEXQ==", + "version": "1.3.1", + "resolved": "https://registry.npmjs.org/@tinyhttp/req/-/req-1.3.1.tgz", + "integrity": "sha512-nNIf3OGBtiQ9WRdqAH/cqwRXgIjQi9oQYslHdGsOzu79MZRvbkco+6FUEYvkQ9N6rLfAL+xjAXkCUk+gDJ0eLA==", "dependencies": { "@tinyhttp/accepts": "1.3.0", "@tinyhttp/type-is": "1.3.0", - "@tinyhttp/url": "1.3.0", + "@tinyhttp/url": "1.3.1", "es-fresh": "^0.0.8", "range-parser": "^1.2.1" }, @@ -161,16 +166,16 @@ } }, "node_modules/@tinyhttp/res": { - "version": "1.3.0", - "resolved": "https://registry.npmjs.org/@tinyhttp/res/-/res-1.3.0.tgz", - "integrity": "sha512-ez6fCpGsYoU6HUBq0e+m4l6Cffu2FeucK+m5Z6a8sBGqLR7/teB1pFufCOPwrdwzdNrLNarGJpsNQpvQqDMWaA==", + "version": "1.3.2", + "resolved": "https://registry.npmjs.org/@tinyhttp/res/-/res-1.3.2.tgz", + "integrity": "sha512-5dl9dcBBAIEBNfiR4PodVJc/u8fJIePGdL3eqnlavdXJ2rWV3T6MfwCq4Cd6CV4RRJHbYfsj24Hl3iEYFmhJmg==", "dependencies": { "@tinyhttp/content-disposition": "1.3.0", "@tinyhttp/cookie": "1.3.0", "@tinyhttp/cookie-signature": "1.3.0", "@tinyhttp/encode-url": "0.3.0", - "@tinyhttp/req": "1.3.0", - "@tinyhttp/send": "1.3.0", + "@tinyhttp/req": "1.3.1", + "@tinyhttp/send": "1.3.1", "es-mime-types": "^0.0.16", "es-vary": "^0.0.8", "escape-html": "^1.0.3" @@ -180,17 +185,17 @@ } }, "node_modules/@tinyhttp/router": { - "version": "1.3.1", - "resolved": "https://registry.npmjs.org/@tinyhttp/router/-/router-1.3.1.tgz", - "integrity": "sha512-r+VTBrRVxCgkTUVOzR2Awzaqa8DCQKQg/BLIpKEHNGp/OVuxSvVGVIEKiZZY9Z5E3HR6FYZL0TMO7r6QvzP1Jg==", + "version": "1.3.3", + "resolved": "https://registry.npmjs.org/@tinyhttp/router/-/router-1.3.3.tgz", + "integrity": "sha512-Wjch7WR8DDkQm5xeNy4i/RrYQGmNrUhqzqls+UBZW14mULjUUtKoTlDOg59RxsPx2NmzdoDbIW4jTpbw+VyNHg==", "engines": { "node": ">=12.4.0" } }, "node_modules/@tinyhttp/send": { - "version": "1.3.0", - "resolved": "https://registry.npmjs.org/@tinyhttp/send/-/send-1.3.0.tgz", - "integrity": "sha512-3Tn8NaLhNdcIJQqc/3ZBFV0hX6jCaFNDX5/vWxoPubDrh8HOpn2foPXL7ZIRk8GDkaB/M3cSzKIlKpnTKmh0Nw==", + "version": "1.3.1", + "resolved": "https://registry.npmjs.org/@tinyhttp/send/-/send-1.3.1.tgz", + "integrity": "sha512-72JvdTkpaSZoSxqhNHc2rEjJDkwAmL5azuIcZOrd+CzQV1etn4gZcdzIoHBBl4iGrrCNKZSPEgQNpWhhjeASpQ==", "dependencies": { "@tinyhttp/etag": "1.3.0", "es-content-type": "^0.0.10", @@ -213,9 +218,9 @@ } }, "node_modules/@tinyhttp/url": { - "version": "1.3.0", - "resolved": "https://registry.npmjs.org/@tinyhttp/url/-/url-1.3.0.tgz", - "integrity": "sha512-GgdKez5AaQRIm0kFNp7BZnxFQ2F7LZ7g3rOQ/v11oYZR3jhH7JPGM+7hZQjYqFXD/5TK/of7hepu418K2fghvg==", + "version": "1.3.1", + "resolved": "https://registry.npmjs.org/@tinyhttp/url/-/url-1.3.1.tgz", + "integrity": "sha512-72XRyVFLqbm8C9FQHYgfKNNIZBKuct13/EcA4tPnF9o8dIcL7UJtXCf+kQjdMZPJzJn51c451sxjm5p4dldbvQ==", "engines": { "node": ">=12.4.0" } @@ -254,17 +259,44 @@ "resolved": "https://registry.npmjs.org/@types/tough-cookie/-/tough-cookie-4.0.0.tgz", "integrity": "sha512-I99sngh224D0M7XgW1s120zxCt3VYQ3IQsuw3P3jbq5GG4yc79+ZjyKznyOGIQrflfylLgcfekeZW/vk0yng6A==" }, + "node_modules/@ungap/promise-all-settled": { + "version": "1.1.2", + "resolved": "https://registry.npmjs.org/@ungap/promise-all-settled/-/promise-all-settled-1.1.2.tgz", + "integrity": "sha512-sL/cEvJWAnClXw0wHk85/2L0G6Sj8UB0Ctc1TEMbKSsmpRosqhwj9gWgFRZSrBr2f9tiXISwNhCPmlfqUqyb9Q==", + "dev": true + }, "node_modules/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": "6.0.2", + "resolved": "https://registry.npmjs.org/agent-base/-/agent-base-6.0.2.tgz", + "integrity": "sha512-RZNwNclF7+MS/8bDg70amg32dyeZGZxiDuQmZxKLAlQjr3jGyLx+4Kkk58UO7D2QdgFIQCovuSuZESne6RG6XQ==", + "dependencies": { + "debug": "4" + }, + "engines": { + "node": ">= 6.0.0" + } + }, + "node_modules/agent-base/node_modules/debug": { + "version": "4.3.2", + "resolved": "https://registry.npmjs.org/debug/-/debug-4.3.2.tgz", + "integrity": "sha512-mOp8wKcvj7XxC78zLgw/ZA+6TSgkoE2C/ienthhRD298T7UNwAg9diBpLRxC0mOezLl4B0xV7M0cCO6P/O0Xhw==", "dependencies": { - "es6-promisify": "^5.0.0" + "ms": "2.1.2" }, "engines": { - "node": ">= 4.0.0" + "node": ">=6.0" + }, + "peerDependenciesMeta": { + "supports-color": { + "optional": true + } } }, + "node_modules/agent-base/node_modules/ms": { + "version": "2.1.2", + "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.2.tgz", + "integrity": "sha512-sGkPx+VjMtmA6MX27oA4FBFELFCZZ4S4XqeGOXCv68tT+jb3vk/RyaKWP0PTKyWtmLSM0b+adUTEvbs1PEaH2w==" + }, "node_modules/ajv": { "version": "6.12.6", "resolved": "https://registry.npmjs.org/ajv/-/ajv-6.12.6.tgz", @@ -281,9 +313,9 @@ } }, "node_modules/ansi-colors": { - "version": "3.2.3", - "resolved": "https://registry.npmjs.org/ansi-colors/-/ansi-colors-3.2.3.tgz", - "integrity": "sha512-LEHHyuhlPY3TmuUYMh2oz89lTShfvgbmzaBcxve9t/9Wuy7Dwf4yoAKcND7KFT1HAQfqZ12qtc+DUrBMeKF9nw==", + "version": "4.1.1", + "resolved": "https://registry.npmjs.org/ansi-colors/-/ansi-colors-4.1.1.tgz", + "integrity": "sha512-JoX0apGbHaUJBNl6yF+p6JAFYZ666/hhCGKN5t9QFjbJQKUU/g8MNbFDbvfrgKXvI1QpZplPOnwIo99lX/AAmA==", "dev": true, "engines": { "node": ">=6" @@ -293,26 +325,30 @@ "version": "2.1.1", "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-2.1.1.tgz", "integrity": "sha1-w7M6te42DYbg5ijwRorn7yfWVN8=", + "dev": true, "engines": { "node": ">=0.10.0" } }, "node_modules/ansi-styles": { - "version": "3.2.1", - "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-3.2.1.tgz", - "integrity": "sha512-VT0ZI6kZRdTh8YyJw3SMbYm/u+NqfsAxEpWO0Pf9sq8/e94WxxOpPKx9FR1FlyCtOVDNOQ+8ntlqFxiRc+r5qA==", + "version": "4.3.0", + "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-4.3.0.tgz", + "integrity": "sha512-zbB9rCJAT1rbjiVDb2hqKFHNYLxgtk8NURxZ3IZwD3F6NtxbXZQCnnSi1Lkx+IDohdPlFp222wVALIheZJQSEg==", "dev": true, "dependencies": { - "color-convert": "^1.9.0" + "color-convert": "^2.0.1" }, "engines": { - "node": ">=4" + "node": ">=8" + }, + "funding": { + "url": "https://github.com/chalk/ansi-styles?sponsor=1" } }, "node_modules/anymatch": { - "version": "3.1.1", - "resolved": "https://registry.npmjs.org/anymatch/-/anymatch-3.1.1.tgz", - "integrity": "sha512-mM8522psRCqzV+6LhomX5wgp25YVibjh8Wj23I5RPkPppSVSjyKD2A2mBJmWGa+KN7f2D6LNh9jkBCeyLktzjg==", + "version": "3.1.2", + "resolved": "https://registry.npmjs.org/anymatch/-/anymatch-3.1.2.tgz", + "integrity": "sha512-P43ePfOAIupkguHUycrc4qJ9kz8ZiuOUijaETwX7THt0Y/GNK7v0aa8rY816xWjZ7rJdA5XdMcpVFTKMq+RvWg==", "dev": true, "dependencies": { "normalize-path": "^3.0.0", @@ -322,55 +358,11 @@ "node": ">= 8" } }, - "node_modules/aproba": { - "version": "1.2.0", - "resolved": "https://registry.npmjs.org/aproba/-/aproba-1.2.0.tgz", - "integrity": "sha512-Y9J6ZjXtoYh8RnXVCMOU/ttDmk1aBjunq9vO0ta5x85WDQiQfUF9sIPBITdbiiIVcBo03Hi3jMxigBtsddlXRw==" - }, - "node_modules/are-we-there-yet": { - "version": "1.1.5", - "resolved": "https://registry.npmjs.org/are-we-there-yet/-/are-we-there-yet-1.1.5.tgz", - "integrity": "sha512-5hYdAkZlcG8tOLujVDTgCT+uPX0VnpAH28gWsLfzpXYm7wP6mp5Q/gYyR7YQ0cKVJcXJnl3j2kpBan13PtQf6w==", - "dependencies": { - "delegates": "^1.0.0", - "readable-stream": "^2.0.6" - } - }, - "node_modules/are-we-there-yet/node_modules/readable-stream": { - "version": "2.3.7", - "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-2.3.7.tgz", - "integrity": "sha512-Ebho8K4jIbHAxnuxi7o42OrZgF/ZTNcsZj6nRKyUmkhLFq8CHItp/fy6hQZuZmP/n3yZ9VBUbp4zz/mX8hmYPw==", - "dependencies": { - "core-util-is": "~1.0.0", - "inherits": "~2.0.3", - "isarray": "~1.0.0", - "process-nextick-args": "~2.0.0", - "safe-buffer": "~5.1.1", - "string_decoder": "~1.1.1", - "util-deprecate": "~1.0.1" - } - }, - "node_modules/are-we-there-yet/node_modules/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==" - }, - "node_modules/are-we-there-yet/node_modules/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==", - "dependencies": { - "safe-buffer": "~5.1.0" - } - }, "node_modules/argparse": { - "version": "1.0.10", - "resolved": "https://registry.npmjs.org/argparse/-/argparse-1.0.10.tgz", - "integrity": "sha512-o5Roy6tNG4SL/FOkCAN6RzjiakZS25RLYFrcMttJqbdd8BWrnA+fGz57iN5Pb06pvBGvl5gQ0B48dJlslXvoTg==", - "dev": true, - "dependencies": { - "sprintf-js": "~1.0.2" - } + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/argparse/-/argparse-2.0.1.tgz", + "integrity": "sha512-8+9WqebbFzpX9OR+Wa6O29asIogeRMzcGtAINdpMHHyAg10f05aSFVBbcEqGf/PXw1EjAZ+q2/bEBg3DvurK3Q==", + "dev": true }, "node_modules/asn1": { "version": "0.2.4", @@ -389,12 +381,9 @@ } }, "node_modules/async-sema": { - "version": "2.1.2", - "resolved": "https://registry.npmjs.org/async-sema/-/async-sema-2.1.2.tgz", - "integrity": "sha512-7Wxs4QBLL9XklTVaRKH16ws/YJBZ7wouqnSu84jILDqZZObsrhDfsVELhQE7U53b2qkFtsAX5ED1ZMvrWzv1Yg==", - "dependencies": { - "double-ended-queue": "2.1.0-0" - } + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/async-sema/-/async-sema-3.1.0.tgz", + "integrity": "sha512-+JpRq3r0zjpRLDruS6q/nC4V5tzsaiu07521677Mdi5i+AkaU/aNJH38rYHJVQ4zvz+SSkjgc8FUI7qIZrR+3g==" }, "node_modules/asynckit": { "version": "0.4.0", @@ -423,9 +412,9 @@ } }, "node_modules/balanced-match": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/balanced-match/-/balanced-match-1.0.0.tgz", - "integrity": "sha1-ibTRmasr7kneFk6gK4nORi1xt2c=", + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/balanced-match/-/balanced-match-1.0.2.tgz", + "integrity": "sha512-3oSeUO0TMV67hN1AmbXsK4yaqU7tjiHlbxRDZOpH0KW9+CeX4bRAaX0Anxt0tx2MrpRpWwQaPwIlISEJhYU5Pw==", "dev": true }, "node_modules/base-x": { @@ -458,9 +447,9 @@ } }, "node_modules/binary-extensions": { - "version": "2.1.0", - "resolved": "https://registry.npmjs.org/binary-extensions/-/binary-extensions-2.1.0.tgz", - "integrity": "sha512-1Yj8h9Q+QDF5FzhMs/c9+6UntbD5MkRfRwac8DoEm9ZfUBZ7tZ55YcGVAzEe4bXsdQHEk+s9S5wsOKVdZrw0tQ==", + "version": "2.2.0", + "resolved": "https://registry.npmjs.org/binary-extensions/-/binary-extensions-2.2.0.tgz", + "integrity": "sha512-jDctJ/IVQbZoJykoeHbhXpOlNBqGNcwXJKJog42E5HDPUwQTSdjCHdihjj0DlnheQ7blbT6dHOafNAiS8ooQKA==", "dev": true, "engines": { "node": ">=8" @@ -500,17 +489,21 @@ } }, "node_modules/bip39": { - "version": "2.4.0", - "resolved": "https://registry.npmjs.org/bip39/-/bip39-2.4.0.tgz", - "integrity": "sha512-1++HywqIyPtWDo7gm4v0ylYbwkLvHkuwVSKbBlZBbTCP/mnkyrlARBny906VLAwxJbC5xw9EvuJasHFIZaIFMQ==", + "version": "3.0.4", + "resolved": "https://registry.npmjs.org/bip39/-/bip39-3.0.4.tgz", + "integrity": "sha512-YZKQlb752TrUWqHWj7XAwCSjYEgGAk+/Aas3V7NyjQeZYsztO8JnQUaCWhcnL4T+jL8nvB8typ2jRPzTlgugNw==", "dependencies": { + "@types/node": "11.11.6", "create-hash": "^1.1.0", "pbkdf2": "^3.0.9", - "randombytes": "^2.0.1", - "safe-buffer": "^5.0.1", - "unorm": "^1.3.3" + "randombytes": "^2.0.1" } }, + "node_modules/bip39/node_modules/@types/node": { + "version": "11.11.6", + "resolved": "https://registry.npmjs.org/@types/node/-/node-11.11.6.tgz", + "integrity": "sha512-Exw4yUWMBXM3X+8oqzJNRqZSwUAaS4+7NdvHqQuFi/d+synz++xmX3QIf+BFqneW8N31R8Ky+sikfZUXq07ggQ==" + }, "node_modules/bip66": { "version": "1.1.5", "resolved": "https://registry.npmjs.org/bip66/-/bip66-1.1.5.tgz", @@ -550,11 +543,12 @@ } }, "node_modules/bitcoinjs-message": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/bitcoinjs-message/-/bitcoinjs-message-1.0.1.tgz", - "integrity": "sha1-P8xfHYX53TCsYNERlIyxs7T+nMU=", + "version": "2.2.0", + "resolved": "https://registry.npmjs.org/bitcoinjs-message/-/bitcoinjs-message-2.2.0.tgz", + "integrity": "sha512-103Wy3xg8Y9o+pdhGP4M3/mtQQuUWs6sPuOp1mYphSUoSMHjHTlkj32K4zxU8qMH0Ckv23emfkGlFWtoWZ7YFA==", "dependencies": { - "bs58check": "^1.0.8", + "bech32": "^1.1.3", + "bs58check": "^2.1.2", "buffer-equals": "^1.0.3", "create-hash": "^1.1.2", "secp256k1": "^3.0.1", @@ -564,69 +558,6 @@ "node": ">=0.10" } }, - "node_modules/bitcoinjs-message/node_modules/base-x": { - "version": "1.1.0", - "resolved": "https://registry.npmjs.org/base-x/-/base-x-1.1.0.tgz", - "integrity": "sha1-QtPXF0dPnqAiB/bRqh9CaRPut6w=" - }, - "node_modules/bitcoinjs-message/node_modules/bs58": { - "version": "3.1.0", - "resolved": "https://registry.npmjs.org/bs58/-/bs58-3.1.0.tgz", - "integrity": "sha1-1MJjiL9IBMrHFBQbGUWqR+XrJI4=", - "dependencies": { - "base-x": "^1.1.0" - } - }, - "node_modules/bitcoinjs-message/node_modules/bs58check": { - "version": "1.3.4", - "resolved": "https://registry.npmjs.org/bs58check/-/bs58check-1.3.4.tgz", - "integrity": "sha1-xSVABzdJEXcU+gQsMEfrj5FRy/g=", - "dependencies": { - "bs58": "^3.1.0", - "create-hash": "^1.1.0" - } - }, - "node_modules/bl": { - "version": "1.2.3", - "resolved": "https://registry.npmjs.org/bl/-/bl-1.2.3.tgz", - "integrity": "sha512-pvcNpa0UU69UT341rO6AYy4FVAIkUHuZXRIWbq+zHnsVcRzDDjIAhGuuYoi0d//cwIwtt4pkpKycWEfjdV+vww==", - "dependencies": { - "readable-stream": "^2.3.5", - "safe-buffer": "^5.1.1" - } - }, - "node_modules/bl/node_modules/readable-stream": { - "version": "2.3.7", - "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-2.3.7.tgz", - "integrity": "sha512-Ebho8K4jIbHAxnuxi7o42OrZgF/ZTNcsZj6nRKyUmkhLFq8CHItp/fy6hQZuZmP/n3yZ9VBUbp4zz/mX8hmYPw==", - "dependencies": { - "core-util-is": "~1.0.0", - "inherits": "~2.0.3", - "isarray": "~1.0.0", - "process-nextick-args": "~2.0.0", - "safe-buffer": "~5.1.1", - "string_decoder": "~1.1.1", - "util-deprecate": "~1.0.1" - } - }, - "node_modules/bl/node_modules/readable-stream/node_modules/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==" - }, - "node_modules/bl/node_modules/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==", - "dependencies": { - "safe-buffer": "~5.1.0" - } - }, - "node_modules/bl/node_modules/string_decoder/node_modules/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==" - }, "node_modules/bn.js": { "version": "4.11.9", "resolved": "https://registry.npmjs.org/bn.js/-/bn.js-4.11.9.tgz", @@ -693,11 +624,6 @@ "node": ">= 0.6" } }, - "node_modules/bowser": { - "version": "2.9.0", - "resolved": "https://registry.npmjs.org/bowser/-/bowser-2.9.0.tgz", - "integrity": "sha512-2ld76tuLBNFekRgmJfT2+3j5MIrP6bFict8WAIT3beq+srz1gcKNAdNKMqHqauQt63NmAa88HfP1/Ypa9Er3HA==" - }, "node_modules/brace-expansion": { "version": "1.1.11", "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-1.1.11.tgz", @@ -762,20 +688,6 @@ "safe-buffer": "^5.1.2" } }, - "node_modules/buffer-alloc": { - "version": "1.2.0", - "resolved": "https://registry.npmjs.org/buffer-alloc/-/buffer-alloc-1.2.0.tgz", - "integrity": "sha512-CFsHQgjtW1UChdXgbyJGtnm+O/uLQeZdtbDo8mfUgYXCHSM1wgrVxXm6bSyrUuErEb+4sYVGCzASBRot7zyrow==", - "dependencies": { - "buffer-alloc-unsafe": "^1.1.0", - "buffer-fill": "^1.0.0" - } - }, - "node_modules/buffer-alloc-unsafe": { - "version": "1.1.0", - "resolved": "https://registry.npmjs.org/buffer-alloc-unsafe/-/buffer-alloc-unsafe-1.1.0.tgz", - "integrity": "sha512-TEM2iMIEQdJ2yjPJoSIsldnleVaAk1oW3DBVUykyOLsEsFmEc9kn+SFFPz+gl54KQNxlDnAwCXosOS9Okx2xAg==" - }, "node_modules/buffer-equal-constant-time": { "version": "1.0.1", "resolved": "https://registry.npmjs.org/buffer-equal-constant-time/-/buffer-equal-constant-time-1.0.1.tgz", @@ -789,11 +701,6 @@ "node": ">=0.10.0" } }, - "node_modules/buffer-fill": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/buffer-fill/-/buffer-fill-1.0.0.tgz", - "integrity": "sha1-+PeLdniYiO858gXNY39o5wISKyw=" - }, "node_modules/buffer-xor": { "version": "1.0.3", "resolved": "https://registry.npmjs.org/buffer-xor/-/buffer-xor-1.0.3.tgz", @@ -809,73 +716,71 @@ } }, "node_modules/camelcase": { - "version": "5.3.1", - "resolved": "https://registry.npmjs.org/camelcase/-/camelcase-5.3.1.tgz", - "integrity": "sha512-L28STB170nwWS63UjtlEOE3dldQApaJXZkOI1uMFfzf3rRuPegHaHesyee+YxQ+W6SvRDQV6UrdOdRiR153wJg==", + "version": "6.2.0", + "resolved": "https://registry.npmjs.org/camelcase/-/camelcase-6.2.0.tgz", + "integrity": "sha512-c7wVvbw3f37nuobQNtgsgG9POC9qMbNuMQmTCqZv23b6MIz0fcYpBiOlv9gEN/hdLdnZTDQhg6e9Dq5M1vKvfg==", "dev": true, "engines": { - "node": ">=6" + "node": ">=10" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" } }, - "node_modules/camelize": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/camelize/-/camelize-1.0.0.tgz", - "integrity": "sha1-FkpUg+Yw+kMh5a8HAg5TGDGyYJs=" - }, "node_modules/caseless": { "version": "0.12.0", "resolved": "https://registry.npmjs.org/caseless/-/caseless-0.12.0.tgz", "integrity": "sha1-G2gcIf+EAzyCZUMJBolCDRhxUdw=" }, "node_modules/chalk": { - "version": "2.4.2", - "resolved": "https://registry.npmjs.org/chalk/-/chalk-2.4.2.tgz", - "integrity": "sha512-Mti+f9lpJNcwF4tWV8/OrTTtF1gZi+f8FqlyAdouralcFWFQWF2+NgCHShjkCb+IFBLq9buZwE1xckQU4peSuQ==", + "version": "4.1.1", + "resolved": "https://registry.npmjs.org/chalk/-/chalk-4.1.1.tgz", + "integrity": "sha512-diHzdDKxcU+bAsUboHLPEDQiw0qEe0qd7SYUn3HgcFlWgbDcfLGswOHYeGrHKzG9z6UYf01d9VFMfZxPM1xZSg==", "dev": true, "dependencies": { - "ansi-styles": "^3.2.1", - "escape-string-regexp": "^1.0.5", - "supports-color": "^5.3.0" + "ansi-styles": "^4.1.0", + "supports-color": "^7.1.0" }, "engines": { - "node": ">=4" + "node": ">=10" + }, + "funding": { + "url": "https://github.com/chalk/chalk?sponsor=1" } }, "node_modules/chalk/node_modules/supports-color": { - "version": "5.5.0", - "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-5.5.0.tgz", - "integrity": "sha512-QjVjwdXIt408MIiAqCX4oUKsgU2EqAGzs2Ppkm4aQYbjm+ZEWEcW4SfFNTr4uMNZma0ey4f5lgLrkB0aX0QMow==", + "version": "7.2.0", + "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-7.2.0.tgz", + "integrity": "sha512-qpCAvRl9stuOHveKsn7HncJRvv501qIacKzQlO/+Lwxc9+0q2wLyv4Dfvt80/DPn2pqOBsJdDiogXGR9+OvwRw==", "dev": true, "dependencies": { - "has-flag": "^3.0.0" + "has-flag": "^4.0.0" }, "engines": { - "node": ">=4" + "node": ">=8" } }, "node_modules/chokidar": { - "version": "3.3.0", - "resolved": "https://registry.npmjs.org/chokidar/-/chokidar-3.3.0.tgz", - "integrity": "sha512-dGmKLDdT3Gdl7fBUe8XK+gAtGmzy5Fn0XkkWQuYxGIgWVPPse2CxFA5mtrlD0TOHaHjEUqkWNyP1XdHoJES/4A==", + "version": "3.5.2", + "resolved": "https://registry.npmjs.org/chokidar/-/chokidar-3.5.2.tgz", + "integrity": "sha512-ekGhOnNVPgT77r4K/U3GDhu+FQ2S8TnK/s2KbIGXi0SZWuwkZ2QNyfWdZW+TVfn84DpEP7rLeCt2UI6bJ8GwbQ==", "dev": true, "dependencies": { - "anymatch": "~3.1.1", + "anymatch": "~3.1.2", "braces": "~3.0.2", - "glob-parent": "~5.1.0", + "glob-parent": "~5.1.2", "is-binary-path": "~2.1.0", "is-glob": "~4.0.1", "normalize-path": "~3.0.0", - "readdirp": "~3.2.0" + "readdirp": "~3.6.0" }, "engines": { "node": ">= 8.10.0" + }, + "optionalDependencies": { + "fsevents": "~2.3.2" } }, - "node_modules/chownr": { - "version": "1.1.4", - "resolved": "https://registry.npmjs.org/chownr/-/chownr-1.1.4.tgz", - "integrity": "sha512-jJ0bqzaylmJtVnNgzTeSOs8DPavpbYgEr/b0YL8/2GO3xJEhInFmhKMUnEJQjZumK7KXGFhUy89PrsJWlakBVg==" - }, "node_modules/cipher-base": { "version": "1.0.4", "resolved": "https://registry.npmjs.org/cipher-base/-/cipher-base-1.0.4.tgz", @@ -886,81 +791,85 @@ } }, "node_modules/cliui": { - "version": "5.0.0", - "resolved": "https://registry.npmjs.org/cliui/-/cliui-5.0.0.tgz", - "integrity": "sha512-PYeGSEmmHM6zvoef2w8TPzlrnNpXIjTipYK780YswmIP9vjxmd6Y2a3CB2Ks6/AU8NHjZugXvo8w3oWM2qnwXA==", + "version": "7.0.4", + "resolved": "https://registry.npmjs.org/cliui/-/cliui-7.0.4.tgz", + "integrity": "sha512-OcRE68cOsVMXp1Yvonl/fzkQOyjLSu/8bhPDfQt0e0/Eb283TKP20Fs2MqoPsr9SwA595rRCA+QMzYc9nBP+JQ==", "dev": true, "dependencies": { - "string-width": "^3.1.0", - "strip-ansi": "^5.2.0", - "wrap-ansi": "^5.1.0" + "string-width": "^4.2.0", + "strip-ansi": "^6.0.0", + "wrap-ansi": "^7.0.0" } }, "node_modules/cliui/node_modules/ansi-regex": { - "version": "4.1.0", - "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-4.1.0.tgz", - "integrity": "sha512-1apePfXM1UOSqw0o9IiFAovVz9M5S1Dg+4TrDwfMewQ6p/rmMueb7tWZjQ1rx4Loy1ArBggoqGpfqqdI4rondg==", + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-5.0.0.tgz", + "integrity": "sha512-bY6fj56OUQ0hU1KjFNDQuJFezqKdrAyFdIevADiqrWHwSlbmBNMHp5ak2f40Pm8JTFyM2mqxkG6ngkHO11f/lg==", "dev": true, "engines": { - "node": ">=6" + "node": ">=8" } }, "node_modules/cliui/node_modules/is-fullwidth-code-point": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/is-fullwidth-code-point/-/is-fullwidth-code-point-2.0.0.tgz", - "integrity": "sha1-o7MKXE8ZkYMWeqq5O+764937ZU8=", + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/is-fullwidth-code-point/-/is-fullwidth-code-point-3.0.0.tgz", + "integrity": "sha512-zymm5+u+sCsSWyD9qNaejV3DFvhCKclKdizYaJUuHA83RLjb7nSuGnddCHGv0hk+KY7BMAlsWeK4Ueg6EV6XQg==", "dev": true, "engines": { - "node": ">=4" + "node": ">=8" } }, "node_modules/cliui/node_modules/string-width": { - "version": "3.1.0", - "resolved": "https://registry.npmjs.org/string-width/-/string-width-3.1.0.tgz", - "integrity": "sha512-vafcv6KjVZKSgz06oM/H6GDBrAtz8vdhQakGjFIvNrHA6y3HCF1CInLy+QLq8dTJPQ1b+KDUqDFctkdRW44e1w==", + "version": "4.2.2", + "resolved": "https://registry.npmjs.org/string-width/-/string-width-4.2.2.tgz", + "integrity": "sha512-XBJbT3N4JhVumXE0eoLU9DCjcaF92KLNqTmFCnG1pf8duUxFGwtP6AD6nkjw9a3IdiRtL3E2w3JDiE/xi3vOeA==", "dev": true, "dependencies": { - "emoji-regex": "^7.0.1", - "is-fullwidth-code-point": "^2.0.0", - "strip-ansi": "^5.1.0" + "emoji-regex": "^8.0.0", + "is-fullwidth-code-point": "^3.0.0", + "strip-ansi": "^6.0.0" }, "engines": { - "node": ">=6" + "node": ">=8" } }, "node_modules/cliui/node_modules/strip-ansi": { - "version": "5.2.0", - "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-5.2.0.tgz", - "integrity": "sha512-DuRs1gKbBqsMKIZlrffwlug8MHkcnpjs5VPmL1PAh+mA30U0DTotfDZ0d2UUsXpPmPmMMJ6W773MaA3J+lbiWA==", + "version": "6.0.0", + "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-6.0.0.tgz", + "integrity": "sha512-AuvKTrTfQNYNIctbR1K/YGTR1756GycPsg7b9bdV9Duqur4gv6aKqHXah67Z8ImS7WEz5QVcOtlfW2rZEugt6w==", "dev": true, "dependencies": { - "ansi-regex": "^4.1.0" + "ansi-regex": "^5.0.0" }, "engines": { - "node": ">=6" + "node": ">=8" } }, "node_modules/code-point-at": { "version": "1.1.0", "resolved": "https://registry.npmjs.org/code-point-at/-/code-point-at-1.1.0.tgz", "integrity": "sha1-DQcLTQQ6W+ozovGkDi7bPZpMz3c=", + "dev": true, "engines": { "node": ">=0.10.0" } }, "node_modules/color-convert": { - "version": "1.9.3", - "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-1.9.3.tgz", - "integrity": "sha512-QfAUtd+vFdAtFQcC8CCyYt1fYWxSqAiK2cSD6zDB8N3cpsEBAvRxp9zOGg6G/SHHJYAT88/az/IuDGALsNVbGg==", + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-2.0.1.tgz", + "integrity": "sha512-RRECPsj7iu/xb5oKYcsFHSppFNnsj/52OVTRKb4zP5onXwVF3zVmmToNcOfGC+CRDpfK/U584fMg38ZHCaElKQ==", "dev": true, "dependencies": { - "color-name": "1.1.3" + "color-name": "~1.1.4" + }, + "engines": { + "node": ">=7.0.0" } }, "node_modules/color-name": { - "version": "1.1.3", - "resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.3.tgz", - "integrity": "sha1-p9BVi9icQveV3UIyj3QIMcpTvCU=", + "version": "1.1.4", + "resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.4.tgz", + "integrity": "sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA==", "dev": true }, "node_modules/combined-stream": { @@ -980,19 +889,6 @@ "integrity": "sha1-2Klr13/Wjfd5OnMDajug1UBdR3s=", "dev": true }, - "node_modules/console-control-strings": { - "version": "1.1.0", - "resolved": "https://registry.npmjs.org/console-control-strings/-/console-control-strings-1.1.0.tgz", - "integrity": "sha1-PXz0Rk22RG6mRL9LOVB/mFEAjo4=" - }, - "node_modules/content-security-policy-builder": { - "version": "2.1.0", - "resolved": "https://registry.npmjs.org/content-security-policy-builder/-/content-security-policy-builder-2.1.0.tgz", - "integrity": "sha512-/MtLWhJVvJNkA9dVLAp6fg9LxD2gfI6R2Fi1hPmfjYXSahJJzcfvoeDOxSyp4NvxMuwWv3WMssE9o31DoULHrQ==", - "engines": { - "node": ">=4.0.0" - } - }, "node_modules/content-type": { "version": "1.0.4", "resolved": "https://registry.npmjs.org/content-type/-/content-type-1.0.4.tgz", @@ -1051,11 +947,6 @@ "node": ">=0.10" } }, - "node_modules/dasherize": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/dasherize/-/dasherize-2.0.0.tgz", - "integrity": "sha1-bYCcnNDPe7iVLYD8hPoT1H3bEwg=" - }, "node_modules/debug": { "version": "2.6.9", "resolved": "https://registry.npmjs.org/debug/-/debug-2.6.9.tgz", @@ -1065,43 +956,15 @@ } }, "node_modules/decamelize": { - "version": "1.2.0", - "resolved": "https://registry.npmjs.org/decamelize/-/decamelize-1.2.0.tgz", - "integrity": "sha1-9lNNFRSCabIDUue+4m9QH5oZEpA=", + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/decamelize/-/decamelize-4.0.0.tgz", + "integrity": "sha512-9iE1PgSik9HeIIw2JO94IidnE3eBoQrFJ3w7sFuzSX4DpmZ3v5sZpUiV5Swcf6mQEF+Y0ru8Neo+p+nyh2J+hQ==", "dev": true, "engines": { - "node": ">=0.10.0" - } - }, - "node_modules/decompress-response": { - "version": "3.3.0", - "resolved": "https://registry.npmjs.org/decompress-response/-/decompress-response-3.3.0.tgz", - "integrity": "sha1-gKTdMjdIOEv6JICDYirt7Jgq3/M=", - "dependencies": { - "mimic-response": "^1.0.0" - }, - "engines": { - "node": ">=4" - } - }, - "node_modules/deep-extend": { - "version": "0.6.0", - "resolved": "https://registry.npmjs.org/deep-extend/-/deep-extend-0.6.0.tgz", - "integrity": "sha512-LOHxIOaPYdHlJRtCQfDIVZtfw/ufM8+rVj649RIHzcm/vGwQRXFt6OPqIFWsm2XEMrNIEtWR64sY1LEKD2vAOA==", - "engines": { - "node": ">=4.0.0" - } - }, - "node_modules/define-properties": { - "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, - "dependencies": { - "object-keys": "^1.0.12" + "node": ">=10" }, - "engines": { - "node": ">= 0.4" + "funding": { + "url": "https://github.com/sponsors/sindresorhus" } }, "node_modules/delayed-stream": { @@ -1112,11 +975,6 @@ "node": ">=0.4.0" } }, - "node_modules/delegates": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/delegates/-/delegates-1.0.0.tgz", - "integrity": "sha1-hMbhWbgZBP3KWaDvRM2HDTElD5o=" - }, "node_modules/depd": { "version": "1.1.2", "resolved": "https://registry.npmjs.org/depd/-/depd-1.1.2.tgz", @@ -1125,39 +983,15 @@ "node": ">= 0.6" } }, - "node_modules/detect-libc": { - "version": "1.0.3", - "resolved": "https://registry.npmjs.org/detect-libc/-/detect-libc-1.0.3.tgz", - "integrity": "sha1-+hN8S9aY7fVc1c0CrFWfkaTEups=", - "bin": { - "detect-libc": "bin/detect-libc.js" - }, - "engines": { - "node": ">=0.10" - } - }, "node_modules/diff": { - "version": "3.5.0", - "resolved": "https://registry.npmjs.org/diff/-/diff-3.5.0.tgz", - "integrity": "sha512-A46qtFgd+g7pDZinpnwiRJtxbC1hpgf0uzP3iG89scHk0AUC7A1TGxf5OiiOUv/JMZR8GOt8hL900hV0bOy5xA==", + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/diff/-/diff-5.0.0.tgz", + "integrity": "sha512-/VTCrvm5Z0JGty/BWHljh+BAiw3IK+2j87NGMu8Nwc/f48WoDAC395uomO9ZD117ZOBaHmkX1oyLvkVM/aIT3w==", "dev": true, "engines": { "node": ">=0.3.1" } }, - "node_modules/dont-sniff-mimetype": { - "version": "1.1.0", - "resolved": "https://registry.npmjs.org/dont-sniff-mimetype/-/dont-sniff-mimetype-1.1.0.tgz", - "integrity": "sha512-ZjI4zqTaxveH2/tTlzS1wFp+7ncxNZaIEWYg3lzZRHkKf5zPT/MnEG6WL0BhHMJUabkh8GeU5NL5j+rEUCb7Ug==", - "engines": { - "node": ">=4.0.0" - } - }, - "node_modules/double-ended-queue": { - "version": "2.1.0-0", - "resolved": "https://registry.npmjs.org/double-ended-queue/-/double-ended-queue-2.1.0-0.tgz", - "integrity": "sha1-ED01J/0xUo9AGIEwyEHv3XgmTlw=" - }, "node_modules/drbg.js": { "version": "1.0.1", "resolved": "https://registry.npmjs.org/drbg.js/-/drbg.js-1.0.1.tgz", @@ -1208,41 +1042,11 @@ } }, "node_modules/emoji-regex": { - "version": "7.0.3", - "resolved": "https://registry.npmjs.org/emoji-regex/-/emoji-regex-7.0.3.tgz", - "integrity": "sha512-CwBLREIQ7LvYFB0WyRvwhq5N5qPhc6PMjD6bYggFlI5YyDgl+0vxq5VHbMOFqLg7hfWzmu8T5Z1QofhmTIhItA==", + "version": "8.0.0", + "resolved": "https://registry.npmjs.org/emoji-regex/-/emoji-regex-8.0.0.tgz", + "integrity": "sha512-MSjYzcWNOA0ewAHpz0MxpYFvwg6yjy1NG3xteoqz644VCo/RPgnr1/GGt+ic3iJTzQ8Eu3TdM14SawnVUmGE6A==", "dev": true }, - "node_modules/end-of-stream": { - "version": "1.4.4", - "resolved": "https://registry.npmjs.org/end-of-stream/-/end-of-stream-1.4.4.tgz", - "integrity": "sha512-+uw1inIHVPQoaVuHzRyXd21icM+cnt4CzD5rW+NC1wjOUSTOs+Te7FOv7AhN7vS9x/oIyhLP5PR1H+phQAHu5Q==", - "dependencies": { - "once": "^1.4.0" - } - }, - "node_modules/es-abstract": { - "version": "1.17.6", - "resolved": "https://registry.npmjs.org/es-abstract/-/es-abstract-1.17.6.tgz", - "integrity": "sha512-Fr89bON3WFyUi5EvAeI48QTWX0AyekGgLA8H+c+7fbfCkJwRWRMLd8CQedNEyJuoYYhmtEqY92pgte1FAhBlhw==", - "dev": true, - "dependencies": { - "es-to-primitive": "^1.2.1", - "function-bind": "^1.1.1", - "has": "^1.0.3", - "has-symbols": "^1.0.1", - "is-callable": "^1.2.0", - "is-regex": "^1.1.0", - "object-inspect": "^1.7.0", - "object-keys": "^1.1.1", - "object.assign": "^4.1.0", - "string.prototype.trimend": "^1.0.1", - "string.prototype.trimstart": "^1.0.1" - }, - "engines": { - "node": ">= 0.4" - } - }, "node_modules/es-content-type": { "version": "0.0.10", "resolved": "https://registry.npmjs.org/es-content-type/-/es-content-type-0.0.10.tgz", @@ -1270,20 +1074,6 @@ "node": ">=12.x" } }, - "node_modules/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==", - "dev": true, - "dependencies": { - "is-callable": "^1.1.4", - "is-date-object": "^1.0.1", - "is-symbol": "^1.0.2" - }, - "engines": { - "node": ">= 0.4" - } - }, "node_modules/es-vary": { "version": "0.0.8", "resolved": "https://registry.npmjs.org/es-vary/-/es-vary-0.0.8.tgz", @@ -1312,19 +1102,6 @@ "es6-symbol": "^3.1.1" } }, - "node_modules/es6-promise": { - "version": "4.2.8", - "resolved": "https://registry.npmjs.org/es6-promise/-/es6-promise-4.2.8.tgz", - "integrity": "sha512-HJDGx5daxeIvxdBxvG2cb9g4tEvwIk3i8+nhX0yGrYmZUzbkdg8QbDevheDB8gd0//uPj4c1EQua8Q+MViT0/w==" - }, - "node_modules/es6-promisify": { - "version": "5.0.0", - "resolved": "https://registry.npmjs.org/es6-promisify/-/es6-promisify-5.0.0.tgz", - "integrity": "sha1-UQnWLz5W6pZ8S2NQWu8IKRyKUgM=", - "dependencies": { - "es6-promise": "^4.0.3" - } - }, "node_modules/es6-symbol": { "version": "3.1.3", "resolved": "https://registry.npmjs.org/es6-symbol/-/es6-symbol-3.1.3.tgz", @@ -1334,31 +1111,30 @@ "ext": "^1.1.2" } }, + "node_modules/escalade": { + "version": "3.1.1", + "resolved": "https://registry.npmjs.org/escalade/-/escalade-3.1.1.tgz", + "integrity": "sha512-k0er2gUkLf8O0zKJiAhmkTnJlTvINGv7ygDNPbeIsX/TJjGJZHuh9B2UxbsaEkmlEo9MfhrSzmhIlhRlI2GXnw==", + "dev": true, + "engines": { + "node": ">=6" + } + }, "node_modules/escape-html": { "version": "1.0.3", "resolved": "https://registry.npmjs.org/escape-html/-/escape-html-1.0.3.tgz", "integrity": "sha1-Aljq5NPQwJdN4cFpGI7wBR0dGYg=" }, "node_modules/escape-string-regexp": { - "version": "1.0.5", - "resolved": "https://registry.npmjs.org/escape-string-regexp/-/escape-string-regexp-1.0.5.tgz", - "integrity": "sha1-G2HAViGQqN/2rjuyzwIAyhMLhtQ=", + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/escape-string-regexp/-/escape-string-regexp-4.0.0.tgz", + "integrity": "sha512-TtpcNJ3XAzx3Gq8sWRzJaVajRs0uVxA2YAkdb1jm2YkPz4G6egUFAyA3n5vtEIZefPk5Wa4UXbKuS5fKkJWdgA==", "dev": true, "engines": { - "node": ">=0.8.0" - } - }, - "node_modules/esprima": { - "version": "4.0.1", - "resolved": "https://registry.npmjs.org/esprima/-/esprima-4.0.1.tgz", - "integrity": "sha512-eGuFFw7Upda+g4p+QHvnW0RyTX/SVeJBDM/gCtMARO0cLuT2HcEKnTPvhjV6aGeqrCB/sbNop0Kszm0jsaWU4A==", - "dev": true, - "bin": { - "esparse": "bin/esparse.js", - "esvalidate": "bin/esvalidate.js" + "node": ">=10" }, - "engines": { - "node": ">=4" + "funding": { + "url": "https://github.com/sponsors/sindresorhus" } }, "node_modules/evp_bytestokey": { @@ -1370,11 +1146,6 @@ "safe-buffer": "^5.1.1" } }, - "node_modules/expand-template": { - "version": "1.1.1", - "resolved": "https://registry.npmjs.org/expand-template/-/expand-template-1.1.1.tgz", - "integrity": "sha512-cebqLtV8KOZfw0UI8TEFWxtczxxC1jvyUvx6H4fyp1K1FN7A4Q+uggVUlOsI1K8AGU0rwOGqP8nCapdrw8CYQg==" - }, "node_modules/ext": { "version": "1.4.0", "resolved": "https://registry.npmjs.org/ext/-/ext-1.4.0.tgz", @@ -1411,14 +1182,6 @@ "resolved": "https://registry.npmjs.org/fast-json-stable-stringify/-/fast-json-stable-stringify-2.1.0.tgz", "integrity": "sha512-lhd/wF+Lk98HZoTCtlVraHtfh5XYijIjalXck7saUtuanSDyLMxnHhSXEDJqHxD7msR8D0uCmqlkwjCV8xvwHw==" }, - "node_modules/feature-policy": { - "version": "0.3.0", - "resolved": "https://registry.npmjs.org/feature-policy/-/feature-policy-0.3.0.tgz", - "integrity": "sha512-ZtijOTFN7TzCujt1fnNhfWPFPSHeZkesff9AXZj+UEjYBynWNUIYpC87Ve4wHzyexQsImicLu7WsC2LHq7/xrQ==", - "engines": { - "node": ">=4.0.0" - } - }, "node_modules/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", @@ -1437,25 +1200,26 @@ } }, "node_modules/find-up": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/find-up/-/find-up-3.0.0.tgz", - "integrity": "sha512-1yD6RmLI1XBfxugvORwlck6f75tYL+iR0jqwsOrOxMZyGYqUuDhJ0l4AXdO1iX/FTs9cBAMEk1gWSEx1kSbylg==", + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/find-up/-/find-up-5.0.0.tgz", + "integrity": "sha512-78/PXT1wlLLDgTzDs7sjq9hzz0vXD+zn+7wypEe4fXQxCmdmqfGsEPQxmiCSQI3ajFV91bVSsvNtrJRiW6nGng==", "dev": true, "dependencies": { - "locate-path": "^3.0.0" + "locate-path": "^6.0.0", + "path-exists": "^4.0.0" }, "engines": { - "node": ">=6" + "node": ">=10" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" } }, "node_modules/flat": { - "version": "4.1.0", - "resolved": "https://registry.npmjs.org/flat/-/flat-4.1.0.tgz", - "integrity": "sha512-Px/TiLIznH7gEDlPXcUD4KnBusa6kR6ayRUVcnEAbreRIuhkqow/mun59BuRXwoYk7ZQOLW1ZM05ilIvK38hFw==", + "version": "5.0.2", + "resolved": "https://registry.npmjs.org/flat/-/flat-5.0.2.tgz", + "integrity": "sha512-b6suED+5/3rTpUBdG1gupIl8MPFCAMA0QXwmljLhvCUKcUvdE4gWky9zpuGCcXHOsz4J9wPGNWq6OKpmIzz3hQ==", "dev": true, - "dependencies": { - "is-buffer": "~2.0.3" - }, "bin": { "flat": "cli.js" } @@ -1464,8 +1228,19 @@ "version": "1.13.3", "resolved": "https://registry.npmjs.org/follow-redirects/-/follow-redirects-1.13.3.tgz", "integrity": "sha512-DUgl6+HDzB0iEptNQEXLx/KhTmDb8tZUHSeLqpnjpknR70H0nC2t9N73BK6fN4hOvJ84pKlIQVQ4k5FFlBedKA==", + "funding": [ + { + "type": "individual", + "url": "https://github.com/sponsors/RubenVerborgh" + } + ], "engines": { "node": ">=4.0" + }, + "peerDependenciesMeta": { + "debug": { + "optional": true + } } }, "node_modules/forever-agent": { @@ -1489,36 +1264,24 @@ "node": ">= 0.12" } }, - "node_modules/fs-constants": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/fs-constants/-/fs-constants-1.0.0.tgz", - "integrity": "sha512-y6OAwoSIf7FyjMIv94u+b5rdheZEjzR63GTyZJm5qh4Bi+2YgwLCcI/fPFZkL5PSixOt6ZNKm+w+Hfp/Bciwow==" - }, "node_modules/fs.realpath": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/fs.realpath/-/fs.realpath-1.0.0.tgz", "integrity": "sha1-FQStJSMVjKpA20onh8sBQRmU6k8=", "dev": true }, - "node_modules/function-bind": { - "version": "1.1.1", - "resolved": "https://registry.npmjs.org/function-bind/-/function-bind-1.1.1.tgz", - "integrity": "sha512-yIovAzMX49sF8Yl58fSCWJ5svSLuaibPxXQJFLmBObTuCr0Mf1KiPopGM9NiFjiYBCbfaa2Fh6breQ6ANVTI0A==", - "dev": true - }, - "node_modules/gauge": { - "version": "2.7.4", - "resolved": "https://registry.npmjs.org/gauge/-/gauge-2.7.4.tgz", - "integrity": "sha1-LANAXHU4w51+s3sxcCLjJfsBi/c=", - "dependencies": { - "aproba": "^1.0.3", - "console-control-strings": "^1.0.0", - "has-unicode": "^2.0.0", - "object-assign": "^4.1.0", - "signal-exit": "^3.0.0", - "string-width": "^1.0.1", - "strip-ansi": "^3.0.1", - "wide-align": "^1.1.0" + "node_modules/fsevents": { + "version": "2.3.2", + "resolved": "https://registry.npmjs.org/fsevents/-/fsevents-2.3.2.tgz", + "integrity": "sha512-xiqMQR4xAeHTuB9uWm+fFRcIOgKBMiOBP+eXiyT7jsgVCq1bkVygt00oASowB7EdtpOHaaPgKt812P9ab+DDKA==", + "dev": true, + "hasInstallScript": true, + "optional": true, + "os": [ + "darwin" + ], + "engines": { + "node": "^8.16.0 || ^10.6.0 || >=11.0.0" } }, "node_modules/get-caller-file": { @@ -1538,15 +1301,10 @@ "assert-plus": "^1.0.0" } }, - "node_modules/github-from-package": { - "version": "0.0.0", - "resolved": "https://registry.npmjs.org/github-from-package/-/github-from-package-0.0.0.tgz", - "integrity": "sha1-l/tdlr/eiXMxPyDoKI75oWf6ZM4=" - }, "node_modules/glob": { - "version": "7.1.3", - "resolved": "https://registry.npmjs.org/glob/-/glob-7.1.3.tgz", - "integrity": "sha512-vcfuiIxogLV4DlGBHIUOwI0IbrJ8HWPc4MU7HzviGeNho/UJDfi6B5p3sHeWIQ0KGIU0Jpxi5ZHxemQfLkkAwQ==", + "version": "7.1.7", + "resolved": "https://registry.npmjs.org/glob/-/glob-7.1.7.tgz", + "integrity": "sha512-OvD9ENzPLbegENnYP5UUfJIirTg4+XwMWGaQfQTY0JenxNvvIKP3U3/tAQSPIu/lHxXYSZmpXlUHeqAIdKzBLQ==", "dev": true, "dependencies": { "fs.realpath": "^1.0.0", @@ -1558,12 +1316,15 @@ }, "engines": { "node": "*" + }, + "funding": { + "url": "https://github.com/sponsors/isaacs" } }, "node_modules/glob-parent": { - "version": "5.1.1", - "resolved": "https://registry.npmjs.org/glob-parent/-/glob-parent-5.1.1.tgz", - "integrity": "sha512-FnI+VGOpnlGHWZxthPGR+QhR78fuiK0sNLkHQv+bL9fQi57lNNdquIbna/WrfROrolq8GK5Ek6BiMwqL/voRYQ==", + "version": "5.1.2", + "resolved": "https://registry.npmjs.org/glob-parent/-/glob-parent-5.1.2.tgz", + "integrity": "sha512-AOIgSQCepiJYwP3ARnGx+5VnTu2HBYdzbGP45eLw1vr3zB3vZLeyed1sC9hnbcOc9/SrMyM5RPQrkGz4aS9Zow==", "dev": true, "dependencies": { "is-glob": "^4.0.1" @@ -1602,41 +1363,15 @@ "node": ">=6" } }, - "node_modules/has": { - "version": "1.0.3", - "resolved": "https://registry.npmjs.org/has/-/has-1.0.3.tgz", - "integrity": "sha512-f2dvO0VU6Oej7RkWJGrehjbzMAjFp5/VKPp5tTpWIV4JHHZK1/BxbFRtf/siA2SWTe09caDmVtYYzWEIbBS4zw==", - "dev": true, - "dependencies": { - "function-bind": "^1.1.1" - }, - "engines": { - "node": ">= 0.4.0" - } - }, "node_modules/has-flag": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-3.0.0.tgz", - "integrity": "sha1-tdRU3CGZriJWmfNGfloH87lVuv0=", - "dev": true, - "engines": { - "node": ">=4" - } - }, - "node_modules/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==", + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-4.0.0.tgz", + "integrity": "sha512-EykJT/Q1KjTWctppgIAgfSO0tKVuZUjhgMr17kqTumMl6Afv3EISleU7qZUzoXDFTAHTDC4NOoG/ZxU3EvlMPQ==", "dev": true, "engines": { - "node": ">= 0.4" + "node": ">=8" } }, - "node_modules/has-unicode": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/has-unicode/-/has-unicode-2.0.1.tgz", - "integrity": "sha1-4Ob+aijPUROIVeCG0Wkedx3iqLk=" - }, "node_modules/hash-base": { "version": "3.1.0", "resolved": "https://registry.npmjs.org/hash-base/-/hash-base-3.1.0.tgz", @@ -1669,62 +1404,11 @@ } }, "node_modules/helmet": { - "version": "3.23.3", - "resolved": "https://registry.npmjs.org/helmet/-/helmet-3.23.3.tgz", - "integrity": "sha512-U3MeYdzPJQhtvqAVBPntVgAvNSOJyagwZwyKsFdyRa8TV3pOKVFljalPOCxbw5Wwf2kncGhmP0qHjyazIdNdSA==", - "dependencies": { - "depd": "2.0.0", - "dont-sniff-mimetype": "1.1.0", - "feature-policy": "0.3.0", - "helmet-crossdomain": "0.4.0", - "helmet-csp": "2.10.0", - "hide-powered-by": "1.1.0", - "hpkp": "2.0.0", - "hsts": "2.2.0", - "nocache": "2.1.0", - "referrer-policy": "1.2.0", - "x-xss-protection": "1.3.0" - }, + "version": "4.6.0", + "resolved": "https://registry.npmjs.org/helmet/-/helmet-4.6.0.tgz", + "integrity": "sha512-HVqALKZlR95ROkrnesdhbbZJFi/rIVSoNq6f3jA/9u6MIbTsPh3xZwihjeI5+DO/2sOV6HMHooXcEOuwskHpTg==", "engines": { - "node": ">=4.0.0" - } - }, - "node_modules/helmet-crossdomain": { - "version": "0.4.0", - "resolved": "https://registry.npmjs.org/helmet-crossdomain/-/helmet-crossdomain-0.4.0.tgz", - "integrity": "sha512-AB4DTykRw3HCOxovD1nPR16hllrVImeFp5VBV9/twj66lJ2nU75DP8FPL0/Jp4jj79JhTfG+pFI2MD02kWJ+fA==", - "engines": { - "node": ">=4.0.0" - } - }, - "node_modules/helmet-csp": { - "version": "2.10.0", - "resolved": "https://registry.npmjs.org/helmet-csp/-/helmet-csp-2.10.0.tgz", - "integrity": "sha512-Rz953ZNEFk8sT2XvewXkYN0Ho4GEZdjAZy4stjiEQV3eN7GDxg1QKmYggH7otDyIA7uGA6XnUMVSgeJwbR5X+w==", - "dependencies": { - "bowser": "2.9.0", - "camelize": "1.0.0", - "content-security-policy-builder": "2.1.0", - "dasherize": "2.0.0" - }, - "engines": { - "node": ">=4.0.0" - } - }, - "node_modules/helmet/node_modules/depd": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/depd/-/depd-2.0.0.tgz", - "integrity": "sha512-g7nH6P6dyDioJogAAGprGpCtVImJhpPk/roCzdb3fIh61/s/nPsfR6onyMwkCAR/OlC3yBC0lESvUoQEAssIrw==", - "engines": { - "node": ">= 0.8" - } - }, - "node_modules/hide-powered-by": { - "version": "1.1.0", - "resolved": "https://registry.npmjs.org/hide-powered-by/-/hide-powered-by-1.1.0.tgz", - "integrity": "sha512-Io1zA2yOA1YJslkr+AJlWSf2yWFkKjvkcL9Ni1XSUqnGLr/qRQe2UI3Cn/J9MsJht7yEVCe0SscY1HgVMujbgg==", - "engines": { - "node": ">=4.0.0" + "node": ">=10.0.0" } }, "node_modules/hmac-drbg": { @@ -1737,30 +1421,6 @@ "minimalistic-crypto-utils": "^1.0.1" } }, - "node_modules/hpkp": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/hpkp/-/hpkp-2.0.0.tgz", - "integrity": "sha1-EOFCJk52IVpdMMROxD3mTe5tFnI=" - }, - "node_modules/hsts": { - "version": "2.2.0", - "resolved": "https://registry.npmjs.org/hsts/-/hsts-2.2.0.tgz", - "integrity": "sha512-ToaTnQ2TbJkochoVcdXYm4HOCliNozlviNsg+X2XQLQvZNI/kCHR9rZxVYpJB3UPcHz80PgxRyWQ7PdU1r+VBQ==", - "dependencies": { - "depd": "2.0.0" - }, - "engines": { - "node": ">=4.0.0" - } - }, - "node_modules/hsts/node_modules/depd": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/depd/-/depd-2.0.0.tgz", - "integrity": "sha512-g7nH6P6dyDioJogAAGprGpCtVImJhpPk/roCzdb3fIh61/s/nPsfR6onyMwkCAR/OlC3yBC0lESvUoQEAssIrw==", - "engines": { - "node": ">= 0.8" - } - }, "node_modules/http-signature": { "version": "1.2.0", "resolved": "https://registry.npmjs.org/http-signature/-/http-signature-1.2.0.tgz", @@ -1801,20 +1461,15 @@ "resolved": "https://registry.npmjs.org/inherits/-/inherits-2.0.4.tgz", "integrity": "sha512-k/vGaX4/Yla3WzyMCvTQOXYeIHvqOKtnqBduzTHpzpQZzAskKMhZ2K+EnBiSM9zGSoIFeMpXKxa4dYeZIQqewQ==" }, - "node_modules/ini": { - "version": "1.3.8", - "resolved": "https://registry.npmjs.org/ini/-/ini-1.3.8.tgz", - "integrity": "sha512-JV/yugV2uzW5iMRSiZAyDtQd+nxtUnjeLt0acNdw98kKLrvuRVyB80tsREOE7yvGVgalhZ6RNXCmEHkUKBKxew==" - }, "node_modules/ip": { "version": "1.1.5", "resolved": "https://registry.npmjs.org/ip/-/ip-1.1.5.tgz", "integrity": "sha1-vd7XARQpCCjAoDnnLvJfWq7ENUo=" }, "node_modules/ipaddr.js": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/ipaddr.js/-/ipaddr.js-2.0.0.tgz", - "integrity": "sha512-S54H9mIj0rbxRIyrDMEuuER86LdlgUg9FSeZ8duQb6CUG2iRrA36MYVQBSprTF/ZeAwvyQ5mDGuNvIPM0BIl3w==", + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/ipaddr.js/-/ipaddr.js-2.0.1.tgz", + "integrity": "sha512-1qTgH9NG+IIJ4yfKs2e6Pp1bZg8wbDbKHT21HrLIeYBTRLgMYKnMTPAuI3Lcs61nfx5h1xlXnbJtH1kX5/d/ng==", "engines": { "node": ">= 10" } @@ -1831,33 +1486,6 @@ "node": ">=8" } }, - "node_modules/is-buffer": { - "version": "2.0.4", - "resolved": "https://registry.npmjs.org/is-buffer/-/is-buffer-2.0.4.tgz", - "integrity": "sha512-Kq1rokWXOPXWuaMAqZiJW4XxsmD9zGx9q4aePabbn3qCRGedtH7Cm+zV8WETitMfu1wdh+Rvd6w5egwSngUX2A==", - "dev": true, - "engines": { - "node": ">=4" - } - }, - "node_modules/is-callable": { - "version": "1.2.0", - "resolved": "https://registry.npmjs.org/is-callable/-/is-callable-1.2.0.tgz", - "integrity": "sha512-pyVD9AaGLxtg6srb2Ng6ynWJqkHU9bEM087AKck0w8QwDarTfNcpIYoU8x8Hv2Icm8u6kFJM18Dag8lyqGkviw==", - "dev": true, - "engines": { - "node": ">= 0.4" - } - }, - "node_modules/is-date-object": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/is-date-object/-/is-date-object-1.0.2.tgz", - "integrity": "sha512-USlDT524woQ08aoZFzh3/Z6ch9Y/EWXEHQ/AaRN0SkKq4t2Jw2R2339tSXmwuVoY7LLlBCbOIlx2myP/L5zk0g==", - "dev": true, - "engines": { - "node": ">= 0.4" - } - }, "node_modules/is-extglob": { "version": "2.1.1", "resolved": "https://registry.npmjs.org/is-extglob/-/is-extglob-2.1.1.tgz", @@ -1871,6 +1499,7 @@ "version": "1.0.0", "resolved": "https://registry.npmjs.org/is-fullwidth-code-point/-/is-fullwidth-code-point-1.0.0.tgz", "integrity": "sha1-754xOG8DGn8NZDr4L95QxFfvAMs=", + "dev": true, "dependencies": { "number-is-nan": "^1.0.0" }, @@ -1899,28 +1528,13 @@ "node": ">=0.12.0" } }, - "node_modules/is-regex": { - "version": "1.1.0", - "resolved": "https://registry.npmjs.org/is-regex/-/is-regex-1.1.0.tgz", - "integrity": "sha512-iI97M8KTWID2la5uYXlkbSDQIg4F6o1sYboZKKTDpnDQMLtUL86zxhgDet3Q2SriaYsyGqZ6Mn2SjbRKeLHdqw==", - "dev": true, - "dependencies": { - "has-symbols": "^1.0.1" - }, - "engines": { - "node": ">= 0.4" - } - }, - "node_modules/is-symbol": { - "version": "1.0.3", - "resolved": "https://registry.npmjs.org/is-symbol/-/is-symbol-1.0.3.tgz", - "integrity": "sha512-OwijhaRSgqvhm/0ZdAcXNZt9lYdKFpcRDT5ULUuYXPoT794UNOdU+gpT6Rzo7b4V2HUl/op6GqY894AZwv9faQ==", + "node_modules/is-plain-obj": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/is-plain-obj/-/is-plain-obj-2.1.0.tgz", + "integrity": "sha512-YWnfyRwxL/+SsrWYfOpUtz5b3YD+nyfkHvjbcanzk8zgyO4ASD67uVMRt8k5bM4lLMDnXfriRhOpemw+NfT1eA==", "dev": true, - "dependencies": { - "has-symbols": "^1.0.1" - }, "engines": { - "node": ">= 0.4" + "node": ">=8" } }, "node_modules/is-typedarray": { @@ -1928,6 +1542,18 @@ "resolved": "https://registry.npmjs.org/is-typedarray/-/is-typedarray-1.0.0.tgz", "integrity": "sha1-5HnICFjfDBsR3dppQPlgEfzaSpo=" }, + "node_modules/is-unicode-supported": { + "version": "0.1.0", + "resolved": "https://registry.npmjs.org/is-unicode-supported/-/is-unicode-supported-0.1.0.tgz", + "integrity": "sha512-knxG2q4UC3u8stRGyAVJCOdxFmv5DZiRcdlIaAQXAbSfJya+OhopNotLQrstBhququ4ZpuKbDc/8S6mgXgPFPw==", + "dev": true, + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, "node_modules/isarray": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/isarray/-/isarray-1.0.0.tgz", @@ -1945,13 +1571,12 @@ "integrity": "sha1-R+Y/evVa+m+S4VAOaQ64uFKcCZo=" }, "node_modules/js-yaml": { - "version": "3.13.1", - "resolved": "https://registry.npmjs.org/js-yaml/-/js-yaml-3.13.1.tgz", - "integrity": "sha512-YfbcO7jXDdyj0DGxYVSlSeQNHbD7XPWvrVWeVUujrQEoZzWJIRrCPoyk6kL6IAjAG2IolMK4T0hNUe0HOUs5Jw==", + "version": "4.1.0", + "resolved": "https://registry.npmjs.org/js-yaml/-/js-yaml-4.1.0.tgz", + "integrity": "sha512-wpxZs9NoxZaJESJGIZTyDEaYpl0FKSA+FB9aJiyemKhMwkxQg63h4T1KJgUGHpTqPDNRcmmYLugrRjJlBtWvRA==", "dev": true, "dependencies": { - "argparse": "^1.0.7", - "esprima": "^4.0.0" + "argparse": "^2.0.1" }, "bin": { "js-yaml": "bin/js-yaml.js" @@ -2037,16 +1662,18 @@ } }, "node_modules/locate-path": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/locate-path/-/locate-path-3.0.0.tgz", - "integrity": "sha512-7AO748wWnIhNqAuaty2ZWHkQHRSNfPVIsPIfwEOWO22AmaoVrWavlOcMR5nzTLNYvp36X220/maaRsrec1G65A==", + "version": "6.0.0", + "resolved": "https://registry.npmjs.org/locate-path/-/locate-path-6.0.0.tgz", + "integrity": "sha512-iPZK6eYjbxRu3uB4/WZ3EsEIMJFMqAoopl3R+zuq0UjcAm/MO6KCweDgPfP3elTztoKP3KtnVHxTn2NHBSDVUw==", "dev": true, "dependencies": { - "p-locate": "^3.0.0", - "path-exists": "^3.0.0" + "p-locate": "^5.0.0" }, "engines": { - "node": ">=6" + "node": ">=10" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" } }, "node_modules/lodash": { @@ -2090,24 +1717,30 @@ "integrity": "sha1-DdOXEhPHxW34gJd9UEyI+0cal6w=" }, "node_modules/log-symbols": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/log-symbols/-/log-symbols-3.0.0.tgz", - "integrity": "sha512-dSkNGuI7iG3mfvDzUuYZyvk5dD9ocYCYzNU6CYDE6+Xqd+gwme6Z00NS3dUh8mq/73HaEtT7m6W+yUPtU6BZnQ==", + "version": "4.1.0", + "resolved": "https://registry.npmjs.org/log-symbols/-/log-symbols-4.1.0.tgz", + "integrity": "sha512-8XPvpAA8uyhfteu8pIvQxpJZ7SYYdpUivZpGy6sFsBuKRY/7rQGavedeB8aK+Zkyq6upMFVL/9AW6vOYzfRyLg==", "dev": true, "dependencies": { - "chalk": "^2.4.2" + "chalk": "^4.1.0", + "is-unicode-supported": "^0.1.0" }, "engines": { - "node": ">=8" + "node": ">=10" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" } }, "node_modules/lru-cache": { - "version": "4.0.2", - "resolved": "https://registry.npmjs.org/lru-cache/-/lru-cache-4.0.2.tgz", - "integrity": "sha1-HRdnnAac2l0ECZGgnbwsDbN35V4=", + "version": "6.0.0", + "resolved": "https://registry.npmjs.org/lru-cache/-/lru-cache-6.0.0.tgz", + "integrity": "sha512-Jo6dJ04CmSjuznwJSS3pUeWmd/H0ffTlkXXgwZi+eq1UCmqQwCh+eLsYOYCwY991i2Fah4h1BEMCx4qThGbsiA==", "dependencies": { - "pseudomap": "^1.0.1", - "yallist": "^2.0.0" + "yallist": "^4.0.0" + }, + "engines": { + "node": ">=10" } }, "node_modules/make-concurrent": { @@ -2171,14 +1804,6 @@ "node": ">= 0.6" } }, - "node_modules/mimic-response": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/mimic-response/-/mimic-response-1.0.1.tgz", - "integrity": "sha512-j5EctnkH7amfV/q5Hgmoal1g2QHFJRraOtmx0JpIqkxhBhI/lJSl1nMpQ45hVarwNETOoWEimndZ4QK0RHxuxQ==", - "engines": { - "node": ">=4" - } - }, "node_modules/minimalistic-assert": { "version": "1.0.1", "resolved": "https://registry.npmjs.org/minimalistic-assert/-/minimalistic-assert-1.0.1.tgz", @@ -2206,71 +1831,91 @@ "resolved": "https://registry.npmjs.org/minimist/-/minimist-1.2.5.tgz", "integrity": "sha512-FM9nNUYrRBAELZQT3xeZQ7fmMOBg6nWNmJKTcgsJeaLstP/UODVpGsr5OhXhhXg6f+qtJ8uiZ+PUxkDWcgIXLw==" }, - "node_modules/mkdirp": { - "version": "0.5.5", - "resolved": "https://registry.npmjs.org/mkdirp/-/mkdirp-0.5.5.tgz", - "integrity": "sha512-NKmAlESf6jMGym1++R0Ra7wvhV+wFW63FaSOFPwRahvea0gMUcGUhVeAg/0BC0wiv9ih5NYPB1Wn1UEI1/L+xQ==", - "dependencies": { - "minimist": "^1.2.5" - }, - "bin": { - "mkdirp": "bin/cmd.js" - } - }, "node_modules/mocha": { - "version": "7.2.0", - "resolved": "https://registry.npmjs.org/mocha/-/mocha-7.2.0.tgz", - "integrity": "sha512-O9CIypScywTVpNaRrCAgoUnJgozpIofjKUYmJhiCIJMiuYnLI6otcb1/kpW9/n/tJODHGZ7i8aLQoDVsMtOKQQ==", + "version": "9.0.3", + "resolved": "https://registry.npmjs.org/mocha/-/mocha-9.0.3.tgz", + "integrity": "sha512-hnYFrSefHxYS2XFGtN01x8un0EwNu2bzKvhpRFhgoybIvMaOkkL60IVPmkb5h6XDmUl4IMSB+rT5cIO4/4bJgg==", "dev": true, "dependencies": { - "ansi-colors": "3.2.3", + "@ungap/promise-all-settled": "1.1.2", + "ansi-colors": "4.1.1", "browser-stdout": "1.3.1", - "chokidar": "3.3.0", - "debug": "3.2.6", - "diff": "3.5.0", - "escape-string-regexp": "1.0.5", - "find-up": "3.0.0", - "glob": "7.1.3", + "chokidar": "3.5.2", + "debug": "4.3.1", + "diff": "5.0.0", + "escape-string-regexp": "4.0.0", + "find-up": "5.0.0", + "glob": "7.1.7", "growl": "1.10.5", "he": "1.2.0", - "js-yaml": "3.13.1", - "log-symbols": "3.0.0", + "js-yaml": "4.1.0", + "log-symbols": "4.1.0", "minimatch": "3.0.4", - "mkdirp": "0.5.5", - "ms": "2.1.1", - "node-environment-flags": "1.0.6", - "object.assign": "4.1.0", - "strip-json-comments": "2.0.1", - "supports-color": "6.0.0", - "which": "1.3.1", + "ms": "2.1.3", + "nanoid": "3.1.23", + "serialize-javascript": "6.0.0", + "strip-json-comments": "3.1.1", + "supports-color": "8.1.1", + "which": "2.0.2", "wide-align": "1.1.3", - "yargs": "13.3.2", - "yargs-parser": "13.1.2", - "yargs-unparser": "1.6.0" + "workerpool": "6.1.5", + "yargs": "16.2.0", + "yargs-parser": "20.2.4", + "yargs-unparser": "2.0.0" }, "bin": { "_mocha": "bin/_mocha", "mocha": "bin/mocha" }, "engines": { - "node": ">= 8.10.0" + "node": ">= 12.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/mochajs" } }, "node_modules/mocha/node_modules/debug": { - "version": "3.2.6", - "resolved": "https://registry.npmjs.org/debug/-/debug-3.2.6.tgz", - "integrity": "sha512-mel+jf7nrtEl5Pn1Qx46zARXKDpBbvzezse7p7LqINmdoIk8PYP5SySaxEmYv6TZ0JyEKA1hsCId6DIhgITtWQ==", + "version": "4.3.1", + "resolved": "https://registry.npmjs.org/debug/-/debug-4.3.1.tgz", + "integrity": "sha512-doEwdvm4PCeK4K3RQN2ZC2BYUBaxwLARCqZmMjtF8a51J2Rb0xpVloFRnCODwqjpwnAoao4pelN8l3RJdv3gRQ==", "dev": true, "dependencies": { - "ms": "^2.1.1" + "ms": "2.1.2" + }, + "engines": { + "node": ">=6.0" + }, + "peerDependenciesMeta": { + "supports-color": { + "optional": true + } } }, + "node_modules/mocha/node_modules/debug/node_modules/ms": { + "version": "2.1.2", + "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.2.tgz", + "integrity": "sha512-sGkPx+VjMtmA6MX27oA4FBFELFCZZ4S4XqeGOXCv68tT+jb3vk/RyaKWP0PTKyWtmLSM0b+adUTEvbs1PEaH2w==", + "dev": true + }, "node_modules/mocha/node_modules/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.3", + "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.3.tgz", + "integrity": "sha512-6FlzubTLZG3J2a/NVCAleEhjzq5oxgHyaCU9yYXvcLsvoVaHJq/s5xXI6/XXP6tz7R9xAOtHnSO/tXtF3WRTlA==", "dev": true }, + "node_modules/mocha/node_modules/strip-json-comments": { + "version": "3.1.1", + "resolved": "https://registry.npmjs.org/strip-json-comments/-/strip-json-comments-3.1.1.tgz", + "integrity": "sha512-6fPc+R4ihwqP6N/aIv2f1gMH8lOVtWQHoqC4yK6oSDVVocumAsfCqjkXnqiYMhmMwS/mEHLp7Vehlt3ql6lEig==", + "dev": true, + "engines": { + "node": ">=8" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, "node_modules/ms": { "version": "2.0.0", "resolved": "https://registry.npmjs.org/ms/-/ms-2.0.0.tgz", @@ -2322,6 +1967,18 @@ "resolved": "https://registry.npmjs.org/nan/-/nan-2.14.1.tgz", "integrity": "sha512-isWHgVjnFjh2x2yuJ/tj3JbwoHu3UC2dX5G/88Cm24yB6YopVgxvBObDY7n5xW6ExmFhJpSEQqFPvq9zaXc8Jw==" }, + "node_modules/nanoid": { + "version": "3.1.23", + "resolved": "https://registry.npmjs.org/nanoid/-/nanoid-3.1.23.tgz", + "integrity": "sha512-FiB0kzdP0FFVGDKlRLEQ1BgDzU87dy5NnzjeW9YZNt+/c3+q82EQDUwniSAUxp/F0gFNI1ZhKU1FqYsMuqZVnw==", + "dev": true, + "bin": { + "nanoid": "bin/nanoid.cjs" + }, + "engines": { + "node": "^10 || ^12 || ^13.7 || ^14 || >=15.0.1" + } + }, "node_modules/negotiator": { "version": "0.6.2", "resolved": "https://registry.npmjs.org/negotiator/-/negotiator-0.6.2.tgz", @@ -2336,29 +1993,11 @@ "integrity": "sha1-yobR/ogoFpsBICCOPchCS524NCw=" }, "node_modules/nocache": { - "version": "2.1.0", - "resolved": "https://registry.npmjs.org/nocache/-/nocache-2.1.0.tgz", - "integrity": "sha512-0L9FvHG3nfnnmaEQPjT9xhfN4ISk0A8/2j4M37Np4mcDesJjHgEUfgPhdCyZuFI954tjokaIj/A3NdpFNdEh4Q==", + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/nocache/-/nocache-3.0.1.tgz", + "integrity": "sha512-Gh39xwJwBKy0OvFmWfBs/vDO4Nl7JhnJtkqNP76OUinQz7BiMoszHYrIDHHAaqVl/QKVxCEy4ZxC/XZninu7nQ==", "engines": { - "node": ">=4.0.0" - } - }, - "node_modules/node-abi": { - "version": "2.18.0", - "resolved": "https://registry.npmjs.org/node-abi/-/node-abi-2.18.0.tgz", - "integrity": "sha512-yi05ZoiuNNEbyT/xXfSySZE+yVnQW6fxPZuFbLyS1s6b5Kw3HzV2PHOM4XR+nsjzkHxByK+2Wg+yCQbe35l8dw==", - "dependencies": { - "semver": "^5.4.1" - } - }, - "node_modules/node-environment-flags": { - "version": "1.0.6", - "resolved": "https://registry.npmjs.org/node-environment-flags/-/node-environment-flags-1.0.6.tgz", - "integrity": "sha512-5Evy2epuL+6TM0lCQGpFIj6KwiEsGh1SrHUhTbNX+sLbBtjidPZFAnVK9y5yU1+h//RitLbRHTIMyxQPtxMdHw==", - "dev": true, - "dependencies": { - "object.getownpropertydescriptors": "^2.0.3", - "semver": "^5.7.0" + "node": ">=12.0.0" } }, "node_modules/node-gyp-build": { @@ -2371,11 +2010,6 @@ "node-gyp-build-test": "build-test.js" } }, - "node_modules/noop-logger": { - "version": "0.1.1", - "resolved": "https://registry.npmjs.org/noop-logger/-/noop-logger-0.1.1.tgz", - "integrity": "sha1-lKKxYzxPExdVMAfYlm/Q6EG2pMI=" - }, "node_modules/normalize-path": { "version": "3.0.0", "resolved": "https://registry.npmjs.org/normalize-path/-/normalize-path-3.0.0.tgz", @@ -2385,21 +2019,11 @@ "node": ">=0.10.0" } }, - "node_modules/npmlog": { - "version": "4.1.2", - "resolved": "https://registry.npmjs.org/npmlog/-/npmlog-4.1.2.tgz", - "integrity": "sha512-2uUqazuKlTaSI/dC8AzicUck7+IrEaOnN/e0jd3Xtt1KcGpwx30v50mL7oPyr/h9bL3E4aZccVwpwP+5W9Vjkg==", - "dependencies": { - "are-we-there-yet": "~1.1.2", - "console-control-strings": "~1.1.0", - "gauge": "~2.7.3", - "set-blocking": "~2.0.0" - } - }, "node_modules/number-is-nan": { "version": "1.0.1", "resolved": "https://registry.npmjs.org/number-is-nan/-/number-is-nan-1.0.1.tgz", "integrity": "sha1-CXtgK1NCKlIsGvuHkDGDNpQaAR0=", + "dev": true, "engines": { "node": ">=0.10.0" } @@ -2412,57 +2036,6 @@ "node": "*" } }, - "node_modules/object-assign": { - "version": "4.1.1", - "resolved": "https://registry.npmjs.org/object-assign/-/object-assign-4.1.1.tgz", - "integrity": "sha1-IQmtx5ZYh8/AXLvUQsrIv7s2CGM=", - "engines": { - "node": ">=0.10.0" - } - }, - "node_modules/object-inspect": { - "version": "1.8.0", - "resolved": "https://registry.npmjs.org/object-inspect/-/object-inspect-1.8.0.tgz", - "integrity": "sha512-jLdtEOB112fORuypAyl/50VRVIBIdVQOSUUGQHzJ4xBSbit81zRarz7GThkEFZy1RceYrWYcPcBFPQwHyAc1gA==", - "dev": true - }, - "node_modules/object-keys": { - "version": "1.1.1", - "resolved": "https://registry.npmjs.org/object-keys/-/object-keys-1.1.1.tgz", - "integrity": "sha512-NuAESUOUMrlIXOfHKzD6bpPu3tYt3xvjNdRIQ+FeT0lNb4K8WR70CaDxhuNguS2XG+GjkyMwOzsN5ZktImfhLA==", - "dev": true, - "engines": { - "node": ">= 0.4" - } - }, - "node_modules/object.assign": { - "version": "4.1.0", - "resolved": "https://registry.npmjs.org/object.assign/-/object.assign-4.1.0.tgz", - "integrity": "sha512-exHJeq6kBKj58mqGyTQ9DFvrZC/eR6OwxzoM9YRoGBqrXYonaFyGiFMuc9VZrXf7DarreEwMpurG3dd+CNyW5w==", - "dev": true, - "dependencies": { - "define-properties": "^1.1.2", - "function-bind": "^1.1.1", - "has-symbols": "^1.0.0", - "object-keys": "^1.0.11" - }, - "engines": { - "node": ">= 0.4" - } - }, - "node_modules/object.getownpropertydescriptors": { - "version": "2.1.0", - "resolved": "https://registry.npmjs.org/object.getownpropertydescriptors/-/object.getownpropertydescriptors-2.1.0.tgz", - "integrity": "sha512-Z53Oah9A3TdLoblT7VKJaTDdXdT+lQO+cNpKVnya5JDe9uLvzu1YyY1yFDFrcxrlRgWrEFH0jJtD/IbuwjcEVg==", - "dev": true, - "dependencies": { - "define-properties": "^1.1.3", - "es-abstract": "^1.17.0-next.1" - }, - "engines": { - "node": ">= 0.8" - } - }, "node_modules/on-finished": { "version": "2.3.0", "resolved": "https://registry.npmjs.org/on-finished/-/on-finished-2.3.0.tgz", @@ -2478,49 +2051,39 @@ "version": "1.4.0", "resolved": "https://registry.npmjs.org/once/-/once-1.4.0.tgz", "integrity": "sha1-WDsap3WWHUsROsF9nFC6753Xa9E=", + "dev": true, "dependencies": { "wrappy": "1" } }, - "node_modules/os-homedir": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/os-homedir/-/os-homedir-1.0.2.tgz", - "integrity": "sha1-/7xJiDNuDoM94MFox+8VISGqf7M=", - "engines": { - "node": ">=0.10.0" - } - }, "node_modules/p-limit": { - "version": "2.3.0", - "resolved": "https://registry.npmjs.org/p-limit/-/p-limit-2.3.0.tgz", - "integrity": "sha512-//88mFWSJx8lxCzwdAABTJL2MyWB12+eIY7MDL2SqLmAkeKU9qxRvWuSyTjm3FUmpBEMuFfckAIqEaVGUDxb6w==", + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/p-limit/-/p-limit-3.1.0.tgz", + "integrity": "sha512-TYOanM3wGwNGsZN2cVTYPArw454xnXj5qmWF1bEoAc4+cU/ol7GVh7odevjp1FNHduHc3KZMcFduxU5Xc6uJRQ==", "dev": true, "dependencies": { - "p-try": "^2.0.0" + "yocto-queue": "^0.1.0" }, "engines": { - "node": ">=6" + "node": ">=10" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" } }, "node_modules/p-locate": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/p-locate/-/p-locate-3.0.0.tgz", - "integrity": "sha512-x+12w/To+4GFfgJhBEpiDcLozRJGegY+Ei7/z0tSLkMmxGZNybVMSfWj9aJn8Z5Fc7dBUNJOOVgPv2H7IwulSQ==", + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/p-locate/-/p-locate-5.0.0.tgz", + "integrity": "sha512-LaNjtRWUBY++zB5nE/NwcaoMylSPk+S+ZHNB1TzdbMJMny6dynpAGt7X/tl/QYq3TIeE6nxHppbo2LGymrG5Pw==", "dev": true, "dependencies": { - "p-limit": "^2.0.0" + "p-limit": "^3.0.2" }, "engines": { - "node": ">=6" - } - }, - "node_modules/p-try": { - "version": "2.2.0", - "resolved": "https://registry.npmjs.org/p-try/-/p-try-2.2.0.tgz", - "integrity": "sha512-R4nPAVTAU0B9D35/Gk3uJf/7XYbQcyohSKdvAxIRSNghFl4e71hVoGnBNQz9cWaXxO2I10KTC+3jMdvvoKw6dQ==", - "dev": true, - "engines": { - "node": ">=6" + "node": ">=10" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" } }, "node_modules/passport": { @@ -2556,12 +2119,12 @@ } }, "node_modules/path-exists": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/path-exists/-/path-exists-3.0.0.tgz", - "integrity": "sha1-zg6+ql94yxiSXqfYENe1mwEP1RU=", + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/path-exists/-/path-exists-4.0.0.tgz", + "integrity": "sha512-ak9Qy5Q7jYb2Wwcey5Fpvg2KoAc/ZIhLSLOSBmRmygPsGwkVVt0fZa0qrtMz+m6tJTAHfZQ8FnmB4MG4LWy7/w==", "dev": true, "engines": { - "node": ">=4" + "node": ">=8" } }, "node_modules/path-is-absolute": { @@ -2599,12 +2162,15 @@ "integrity": "sha1-Ywn04OX6kT7BxpMHrjZLSzd8nns=" }, "node_modules/picomatch": { - "version": "2.2.2", - "resolved": "https://registry.npmjs.org/picomatch/-/picomatch-2.2.2.tgz", - "integrity": "sha512-q0M/9eZHzmr0AulXyPwNfZjtwZ/RBZlbN3K3CErVrk50T2ASYI7Bye0EvekFY3IP1Nt2DHu0re+V2ZHIpMkuWg==", + "version": "2.3.0", + "resolved": "https://registry.npmjs.org/picomatch/-/picomatch-2.3.0.tgz", + "integrity": "sha512-lY1Q/PiJGC2zOv/z391WOTD+Z02bCgsFfvxoXXf6h7kv9o+WmsmzYqrAwY63sNgOxE4xEdq0WyUnXfKeBrSvYw==", "dev": true, "engines": { "node": ">=8.6" + }, + "funding": { + "url": "https://github.com/sponsors/jonschlinkert" } }, "node_modules/pkginfo": { @@ -2615,55 +2181,16 @@ "node": ">= 0.4.0" } }, - "node_modules/prebuild-install": { - "version": "2.5.3", - "resolved": "https://registry.npmjs.org/prebuild-install/-/prebuild-install-2.5.3.tgz", - "integrity": "sha512-/rI36cN2g7vDQnKWN8Uzupi++KjyqS9iS+/fpwG4Ea8d0Pip0PQ5bshUNzVwt+/D2MRfhVAplYMMvWLqWrCF/g==", - "dependencies": { - "detect-libc": "^1.0.3", - "expand-template": "^1.0.2", - "github-from-package": "0.0.0", - "minimist": "^1.2.0", - "mkdirp": "^0.5.1", - "node-abi": "^2.2.0", - "noop-logger": "^0.1.1", - "npmlog": "^4.0.1", - "os-homedir": "^1.0.1", - "pump": "^2.0.1", - "rc": "^1.1.6", - "simple-get": "^2.7.0", - "tar-fs": "^1.13.0", - "tunnel-agent": "^0.6.0", - "which-pm-runs": "^1.0.0" - }, - "bin": { - "prebuild-install": "bin.js" - } - }, "node_modules/process-nextick-args": { "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==" }, - "node_modules/pseudomap": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/pseudomap/-/pseudomap-1.0.2.tgz", - "integrity": "sha1-8FKijacOYYkX7wqKw0wa5aaChrM=" - }, "node_modules/psl": { "version": "1.8.0", "resolved": "https://registry.npmjs.org/psl/-/psl-1.8.0.tgz", "integrity": "sha512-RIdOzyoavK+hA18OGGWDqUTsCLhtA7IcZ/6NCs4fFJaHBDab+pDDmDIByWFRQJq2Cd7r1OoQxBGKOaztq+hjIQ==" }, - "node_modules/pump": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/pump/-/pump-2.0.1.tgz", - "integrity": "sha512-ruPMNRkN3MHP1cWJc9OWr+T/xDP0jhXYCLfJcBuX54hhfIBnaQmAUMfDcG4DM5UMWByBbJY69QSphm3jtDKIkA==", - "dependencies": { - "end-of-stream": "^1.1.0", - "once": "^1.3.1" - } - }, "node_modules/punycode": { "version": "2.1.1", "resolved": "https://registry.npmjs.org/punycode/-/punycode-2.1.1.tgz", @@ -2759,20 +2286,6 @@ "node": ">= 0.6" } }, - "node_modules/rc": { - "version": "1.2.8", - "resolved": "https://registry.npmjs.org/rc/-/rc-1.2.8.tgz", - "integrity": "sha512-y3bGgqKj3QBdxLbLkomlohkvsA8gdAiUQlSBJnBhfn+BPxg4bc62d8TcBW15wavDfgexCgccckhcZvywyQYPOw==", - "dependencies": { - "deep-extend": "^0.6.0", - "ini": "~1.3.0", - "minimist": "^1.2.0", - "strip-json-comments": "~2.0.1" - }, - "bin": { - "rc": "cli.js" - } - }, "node_modules/readable-stream": { "version": "3.6.0", "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-3.6.0.tgz", @@ -2787,31 +2300,23 @@ } }, "node_modules/readdirp": { - "version": "3.2.0", - "resolved": "https://registry.npmjs.org/readdirp/-/readdirp-3.2.0.tgz", - "integrity": "sha512-crk4Qu3pmXwgxdSgGhgA/eXiJAPQiX4GMOZZMXnqKxHX7TaoL+3gQVo/WeuAiogr07DpnfjIMpXXa+PAIvwPGQ==", + "version": "3.6.0", + "resolved": "https://registry.npmjs.org/readdirp/-/readdirp-3.6.0.tgz", + "integrity": "sha512-hOS089on8RduqdbhvQ5Z37A0ESjsqz6qnRcffsMU3495FuTdqSm+7bhJ29JvIOsBDEEnan5DPu9t3To9VRlMzA==", "dev": true, "dependencies": { - "picomatch": "^2.0.4" + "picomatch": "^2.2.1" }, "engines": { - "node": ">= 8" - } - }, - "node_modules/referrer-policy": { - "version": "1.2.0", - "resolved": "https://registry.npmjs.org/referrer-policy/-/referrer-policy-1.2.0.tgz", - "integrity": "sha512-LgQJIuS6nAy1Jd88DCQRemyE3mS+ispwlqMk3b0yjZ257fI1v9c+/p6SD5gP5FGyXUIgrNOAfmyioHwZtYv2VA==", - "engines": { - "node": ">=4.0.0" + "node": ">=8.10.0" } }, "node_modules/regexparam": { - "version": "1.3.0", - "resolved": "https://registry.npmjs.org/regexparam/-/regexparam-1.3.0.tgz", - "integrity": "sha512-6IQpFBv6e5vz1QAqI+V4k8P2e/3gRrqfCJ9FI+O1FLQTO+Uz6RXZEZOPmTJ6hlGj7gkERzY5BRCv09whKP96/g==", + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/regexparam/-/regexparam-2.0.0.tgz", + "integrity": "sha512-gJKwd2MVPWHAIFLsaYDZfyKzHNS4o7E/v8YmNf44vmeV2e4YfVoDToTOKTvE7ab68cRJ++kLuEXJBaEeJVt5ow==", "engines": { - "node": ">=6" + "node": ">=8" } }, "node_modules/request": { @@ -2906,12 +2411,6 @@ "node": ">=0.10.0" } }, - "node_modules/require-main-filename": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/require-main-filename/-/require-main-filename-2.0.0.tgz", - "integrity": "sha512-NKN5kMDylKuldxYLSUfrbo5Tuzh4hd+2E8NPPX02mZtn1VuREQToYe/ZdlJy+J3uCpfaiGF05e7B8W0iXbQHmg==", - "dev": true - }, "node_modules/ripemd160": { "version": "2.0.2", "resolved": "https://registry.npmjs.org/ripemd160/-/ripemd160-2.0.2.tgz", @@ -2956,7 +2455,21 @@ "node_modules/safe-buffer": { "version": "5.2.1", "resolved": "https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.2.1.tgz", - "integrity": "sha512-rp3So07KcdmmKbGvgaNxQSJr7bGVSVk5S9Eq1F+ppbRo70+YeaDxkw5Dd8NPN+GD6bjnYm2VuPuCXmpuYvmCXQ==" + "integrity": "sha512-rp3So07KcdmmKbGvgaNxQSJr7bGVSVk5S9Eq1F+ppbRo70+YeaDxkw5Dd8NPN+GD6bjnYm2VuPuCXmpuYvmCXQ==", + "funding": [ + { + "type": "github", + "url": "https://github.com/sponsors/feross" + }, + { + "type": "patreon", + "url": "https://www.patreon.com/feross" + }, + { + "type": "consulting", + "url": "https://feross.org/support" + } + ] }, "node_modules/safer-buffer": { "version": "2.1.2", @@ -2967,6 +2480,7 @@ "version": "3.8.0", "resolved": "https://registry.npmjs.org/secp256k1/-/secp256k1-3.8.0.tgz", "integrity": "sha512-k5ke5avRZbtl9Tqx/SA7CbY3NF6Ro+Sj9cZxezFzuBlLDmyqPiL8hJJ+EmzD8Ig4LUDByHJ3/iPOVoRixs/hmw==", + "hasInstallScript": true, "dependencies": { "bindings": "^1.5.0", "bip66": "^1.1.5", @@ -2989,10 +2503,14 @@ "semver": "bin/semver" } }, - "node_modules/set-blocking": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/set-blocking/-/set-blocking-2.0.0.tgz", - "integrity": "sha1-BF+XgtARrppoA93TgrJDkrPYkPc=" + "node_modules/serialize-javascript": { + "version": "6.0.0", + "resolved": "https://registry.npmjs.org/serialize-javascript/-/serialize-javascript-6.0.0.tgz", + "integrity": "sha512-Qr3TosvguFt8ePWqsvRfrKyQXIiW+nGbYpy8XK24NQHE83caxWt+mIymTT19DGFbNWNLfEwsrkSmN64lVWB9ag==", + "dev": true, + "dependencies": { + "randombytes": "^2.1.0" + } }, "node_modules/sha.js": { "version": "2.4.11", @@ -3006,32 +2524,12 @@ "sha.js": "bin.js" } }, - "node_modules/signal-exit": { - "version": "3.0.3", - "resolved": "https://registry.npmjs.org/signal-exit/-/signal-exit-3.0.3.tgz", - "integrity": "sha512-VUJ49FC8U1OxwZLxIbTTrDvLnf/6TDgxZcK8wxR8zs13xpx7xbG60ndBlhNrFi2EMuFRoeDoJO7wthSLq42EjA==" - }, - "node_modules/simple-concat": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/simple-concat/-/simple-concat-1.0.1.tgz", - "integrity": "sha512-cSFtAPtRhljv69IK0hTVZQ+OfE9nePi/rtJmw5UjHeVyVroEqJXP1sFztKUy1qU+xvz3u/sfYJLa947b7nAN2Q==" - }, - "node_modules/simple-get": { - "version": "2.8.1", - "resolved": "https://registry.npmjs.org/simple-get/-/simple-get-2.8.1.tgz", - "integrity": "sha512-lSSHRSw3mQNUGPAYRqo7xy9dhKmxFXIjLjp4KHpf99GEH2VH7C3AM+Qfx6du6jhfUi6Vm7XnbEVEf7Wb6N8jRw==", - "dependencies": { - "decompress-response": "^3.3.0", - "once": "^1.3.1", - "simple-concat": "^1.0.0" - } - }, "node_modules/sirv": { - "version": "1.0.11", - "resolved": "https://registry.npmjs.org/sirv/-/sirv-1.0.11.tgz", - "integrity": "sha512-SR36i3/LSWja7AJNRBz4fF/Xjpn7lQFI30tZ434dIy+bitLYSP+ZEenHg36i23V2SGEz+kqjksg0uOGZ5LPiqg==", + "version": "1.0.12", + "resolved": "https://registry.npmjs.org/sirv/-/sirv-1.0.12.tgz", + "integrity": "sha512-+jQoCxndz7L2tqQL4ZyzfDhky0W/4ZJip3XoOuxyQWnAwMxindLl3Xv1qT4x1YX/re0leShvTm8Uk0kQspGhBg==", "dependencies": { - "@polka/url": "^1.0.0-next.9", + "@polka/url": "^1.0.0-next.15", "mime": "^2.3.1", "totalist": "^1.0.0" }, @@ -3040,44 +2538,60 @@ } }, "node_modules/smart-buffer": { - "version": "4.0.2", - "resolved": "https://registry.npmjs.org/smart-buffer/-/smart-buffer-4.0.2.tgz", - "integrity": "sha512-JDhEpTKzXusOqXZ0BUIdH+CjFdO/CR3tLlf5CN34IypI+xMmXW1uB16OOY8z3cICbJlDAVJzNbwBhNO0wt9OAw==", + "version": "4.1.0", + "resolved": "https://registry.npmjs.org/smart-buffer/-/smart-buffer-4.1.0.tgz", + "integrity": "sha512-iVICrxOzCynf/SNaBQCw34eM9jROU/s5rzIhpOvzhzuYHfJR/DhZfDkXiZSgKXfgv26HT3Yni3AV/DGw0cGnnw==", "engines": { - "node": ">= 4.0.0", + "node": ">= 6.0.0", "npm": ">= 3.0.0" } }, "node_modules/socks": { - "version": "2.2.3", - "resolved": "https://registry.npmjs.org/socks/-/socks-2.2.3.tgz", - "integrity": "sha512-+2r83WaRT3PXYoO/1z+RDEBE7Z2f9YcdQnJ0K/ncXXbV5gJ6wYfNAebYFYiiUjM6E4JyXnPY8cimwyvFYHVUUA==", + "version": "2.6.1", + "resolved": "https://registry.npmjs.org/socks/-/socks-2.6.1.tgz", + "integrity": "sha512-kLQ9N5ucj8uIcxrDwjm0Jsqk06xdpBjGNQtpXy4Q8/QY2k+fY7nZH8CARy+hkbG+SGAovmzzuauCpBlb8FrnBA==", "dependencies": { "ip": "^1.1.5", - "smart-buffer": "4.0.2" + "smart-buffer": "^4.1.0" }, "engines": { - "node": ">= 6.0.0", + "node": ">= 10.13.0", "npm": ">= 3.0.0" } }, "node_modules/socks-proxy-agent": { - "version": "4.0.1", - "resolved": "https://registry.npmjs.org/socks-proxy-agent/-/socks-proxy-agent-4.0.1.tgz", - "integrity": "sha512-Kezx6/VBguXOsEe5oU3lXYyKMi4+gva72TwJ7pQY5JfqUx2nMk7NXA6z/mpNqIlfQjWYVfeuNvQjexiTaTn6Nw==", + "version": "6.0.0", + "resolved": "https://registry.npmjs.org/socks-proxy-agent/-/socks-proxy-agent-6.0.0.tgz", + "integrity": "sha512-FIgZbQWlnjVEQvMkylz64/rUggGtrKstPnx8OZyYFG0tAFR8CSBtpXxSwbFLHyeXFn/cunFL7MpuSOvDSOPo9g==", "dependencies": { - "agent-base": "~4.2.0", - "socks": "~2.2.0" + "agent-base": "^6.0.2", + "debug": "^4.3.1", + "socks": "^2.6.1" }, "engines": { - "node": ">= 6" + "node": ">= 10" } }, - "node_modules/sprintf-js": { - "version": "1.0.3", - "resolved": "https://registry.npmjs.org/sprintf-js/-/sprintf-js-1.0.3.tgz", - "integrity": "sha1-BOaSb2YolTVPPdAVIDYzuFcpfiw=", - "dev": true + "node_modules/socks-proxy-agent/node_modules/debug": { + "version": "4.3.2", + "resolved": "https://registry.npmjs.org/debug/-/debug-4.3.2.tgz", + "integrity": "sha512-mOp8wKcvj7XxC78zLgw/ZA+6TSgkoE2C/ienthhRD298T7UNwAg9diBpLRxC0mOezLl4B0xV7M0cCO6P/O0Xhw==", + "dependencies": { + "ms": "2.1.2" + }, + "engines": { + "node": ">=6.0" + }, + "peerDependenciesMeta": { + "supports-color": { + "optional": true + } + } + }, + "node_modules/socks-proxy-agent/node_modules/ms": { + "version": "2.1.2", + "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.2.tgz", + "integrity": "sha512-sGkPx+VjMtmA6MX27oA4FBFELFCZZ4S4XqeGOXCv68tT+jb3vk/RyaKWP0PTKyWtmLSM0b+adUTEvbs1PEaH2w==" }, "node_modules/sqlstring": { "version": "2.3.1", @@ -3131,6 +2645,7 @@ "version": "1.0.2", "resolved": "https://registry.npmjs.org/string-width/-/string-width-1.0.2.tgz", "integrity": "sha1-EYvfW4zcUaKn5w0hHgfisLmxB9M=", + "dev": true, "dependencies": { "code-point-at": "^1.0.0", "is-fullwidth-code-point": "^1.0.0", @@ -3140,30 +2655,11 @@ "node": ">=0.10.0" } }, - "node_modules/string.prototype.trimend": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/string.prototype.trimend/-/string.prototype.trimend-1.0.1.tgz", - "integrity": "sha512-LRPxFUaTtpqYsTeNKaFOw3R4bxIzWOnbQ837QfBylo8jIxtcbK/A/sMV7Q+OAV/vWo+7s25pOE10KYSjaSO06g==", - "dev": true, - "dependencies": { - "define-properties": "^1.1.3", - "es-abstract": "^1.17.5" - } - }, - "node_modules/string.prototype.trimstart": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/string.prototype.trimstart/-/string.prototype.trimstart-1.0.1.tgz", - "integrity": "sha512-XxZn+QpvrBI1FOcg6dIpxUPgWCPuNXvMD72aaRaUQv1eD4e/Qy8i/hFTe0BUmD60p/QA6bh1avmuPTfNjqVWRw==", - "dev": true, - "dependencies": { - "define-properties": "^1.1.3", - "es-abstract": "^1.17.5" - } - }, "node_modules/strip-ansi": { "version": "3.0.1", "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-3.0.1.tgz", "integrity": "sha1-ajhfuIU9lS1f8F0Oiq+UJ43GPc8=", + "dev": true, "dependencies": { "ansi-regex": "^2.0.0" }, @@ -3171,94 +2667,26 @@ "node": ">=0.10.0" } }, - "node_modules/strip-json-comments": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/strip-json-comments/-/strip-json-comments-2.0.1.tgz", - "integrity": "sha1-PFMZQukIwml8DsNEhYwobHygpgo=", - "engines": { - "node": ">=0.10.0" - } - }, "node_modules/supports-color": { - "version": "6.0.0", - "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-6.0.0.tgz", - "integrity": "sha512-on9Kwidc1IUQo+bQdhi8+Tijpo0e1SS6RoGo2guUwn5vdaxw8RXOF9Vb2ws+ihWOmh4JnCJOvaziZWP1VABaLg==", + "version": "8.1.1", + "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-8.1.1.tgz", + "integrity": "sha512-MpUEN2OodtUzxvKQl72cUF7RQ5EiHsGvSsVG0ia9c5RbWGL2CI4C7EpPS8UTBIplnlzZiNuV56w+FuNxy3ty2Q==", "dev": true, "dependencies": { - "has-flag": "^3.0.0" + "has-flag": "^4.0.0" }, "engines": { - "node": ">=6" - } - }, - "node_modules/tar-fs": { - "version": "1.16.3", - "resolved": "https://registry.npmjs.org/tar-fs/-/tar-fs-1.16.3.tgz", - "integrity": "sha512-NvCeXpYx7OsmOh8zIOP/ebG55zZmxLE0etfWRbWok+q2Qo8x/vOR/IJT1taADXPe+jsiu9axDb3X4B+iIgNlKw==", - "dependencies": { - "chownr": "^1.0.1", - "mkdirp": "^0.5.1", - "pump": "^1.0.0", - "tar-stream": "^1.1.2" - } - }, - "node_modules/tar-fs/node_modules/pump": { - "version": "1.0.3", - "resolved": "https://registry.npmjs.org/pump/-/pump-1.0.3.tgz", - "integrity": "sha512-8k0JupWme55+9tCVE+FS5ULT3K6AbgqrGa58lTT49RpyfwwcGedHqaC5LlQNdEAumn/wFsu6aPwkuPMioy8kqw==", - "dependencies": { - "end-of-stream": "^1.1.0", - "once": "^1.3.1" - } - }, - "node_modules/tar-stream": { - "version": "1.6.2", - "resolved": "https://registry.npmjs.org/tar-stream/-/tar-stream-1.6.2.tgz", - "integrity": "sha512-rzS0heiNf8Xn7/mpdSVVSMAWAoy9bfb1WOTYC78Z0UQKeKa/CWS8FOq0lKGNa8DWKAn9gxjCvMLYc5PGXYlK2A==", - "dependencies": { - "bl": "^1.0.0", - "buffer-alloc": "^1.2.0", - "end-of-stream": "^1.0.0", - "fs-constants": "^1.0.0", - "readable-stream": "^2.3.0", - "to-buffer": "^1.1.1", - "xtend": "^4.0.0" + "node": ">=10" }, - "engines": { - "node": ">= 0.8.0" - } - }, - "node_modules/tar-stream/node_modules/readable-stream": { - "version": "2.3.7", - "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-2.3.7.tgz", - "integrity": "sha512-Ebho8K4jIbHAxnuxi7o42OrZgF/ZTNcsZj6nRKyUmkhLFq8CHItp/fy6hQZuZmP/n3yZ9VBUbp4zz/mX8hmYPw==", - "dependencies": { - "core-util-is": "~1.0.0", - "inherits": "~2.0.3", - "isarray": "~1.0.0", - "process-nextick-args": "~2.0.0", - "safe-buffer": "~5.1.1", - "string_decoder": "~1.1.1", - "util-deprecate": "~1.0.1" - } - }, - "node_modules/tar-stream/node_modules/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==" - }, - "node_modules/tar-stream/node_modules/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==", - "dependencies": { - "safe-buffer": "~5.1.0" + "funding": { + "url": "https://github.com/chalk/supports-color?sponsor=1" } }, "node_modules/tiny-secp256k1": { "version": "1.1.5", "resolved": "https://registry.npmjs.org/tiny-secp256k1/-/tiny-secp256k1-1.1.5.tgz", "integrity": "sha512-duE2hSLSQIpHGzmK48OgRrGTi+4OTkXLC6aa86uOYQ6LLCYZSarVKIAvEtY7MoXjoL6bOXMSerEGMzrvW4SkDw==", + "hasInstallScript": true, "dependencies": { "bindings": "^1.3.0", "bn.js": "^4.11.8", @@ -3270,11 +2698,6 @@ "node": ">=6.0.0" } }, - "node_modules/to-buffer": { - "version": "1.1.1", - "resolved": "https://registry.npmjs.org/to-buffer/-/to-buffer-1.1.1.tgz", - "integrity": "sha512-lx9B5iv7msuFYE3dytT+KE5tap+rNYw+K4jVkb9R/asAb+pbBSM17jtunHplhBe6RRJdZx3Pn2Jph24O32mOVg==" - }, "node_modules/to-regex-range": { "version": "5.0.1", "resolved": "https://registry.npmjs.org/to-regex-range/-/to-regex-range-5.0.1.tgz", @@ -3361,14 +2784,6 @@ "resolved": "https://registry.npmjs.org/typeforce/-/typeforce-1.18.0.tgz", "integrity": "sha512-7uc1O8h1M1g0rArakJdf0uLRSSgFcYexrVoKo+bzJd32gd4gDy2L/Z+8/FjPnU9ydY3pEnVPtr9FyscYY60K1g==" }, - "node_modules/unorm": { - "version": "1.6.0", - "resolved": "https://registry.npmjs.org/unorm/-/unorm-1.6.0.tgz", - "integrity": "sha512-b2/KCUlYZUeA7JFUuRJZPUtr4gZvBh7tavtv4fvk4+KV9pfGiR6CQAQAWl49ZpR3ts2dk4FYkP7EIgDJoiOLDA==", - "engines": { - "node": ">= 0.4.0" - } - }, "node_modules/unpipe": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/unpipe/-/unpipe-1.0.0.tgz", @@ -3403,14 +2818,15 @@ "version": "3.4.0", "resolved": "https://registry.npmjs.org/uuid/-/uuid-3.4.0.tgz", "integrity": "sha512-HjSDRw6gZE5JMggctHBcjVak08+KEVhSIiDzFnT9S9aegmp85S/bReBVTb4QTFaRNptJ9kuYaNhnbNEOkbKb/A==", + "deprecated": "Please upgrade to version 7 or higher. Older versions may use Math.random() in certain circumstances, which is known to be problematic. See https://v8.dev/blog/math-random for details.", "bin": { "uuid": "bin/uuid" } }, "node_modules/validator": { - "version": "10.8.0", - "resolved": "https://registry.npmjs.org/validator/-/validator-10.8.0.tgz", - "integrity": "sha512-mXqMxfCh5NLsVgYVKl9WvnHNDPCcbNppHSPPowu0VjtSsGWVY+z8hJF44edLR1nbLNzi3jYoYsIl8KZpioIk6g==", + "version": "13.6.0", + "resolved": "https://registry.npmjs.org/validator/-/validator-13.6.0.tgz", + "integrity": "sha512-gVgKbdbHgtxpRyR8K0O6oFZPhhB5tT1jeEHZR0Znr9Svg03U0+r9DXWMrnRAB+HtCStDQKlaIZm42tVsVjqtjg==", "engines": { "node": ">= 0.10" } @@ -3453,32 +2869,25 @@ } }, "node_modules/which": { - "version": "1.3.1", - "resolved": "https://registry.npmjs.org/which/-/which-1.3.1.tgz", - "integrity": "sha512-HxJdYWq1MTIQbJ3nw0cqssHoTNU267KlrDuGZ1WYlxDStUtKUhOaJmh112/TZmHxxUfuJqPXSOm7tDyas0OSIQ==", + "version": "2.0.2", + "resolved": "https://registry.npmjs.org/which/-/which-2.0.2.tgz", + "integrity": "sha512-BLI3Tl1TW3Pvl70l3yq3Y64i+awpwXqsGBYWkkqMtnbXgrMD+yj7rhW0kuEDxzJaYXGjEW5ogapKNMEKNMjibA==", "dev": true, "dependencies": { "isexe": "^2.0.0" }, "bin": { - "which": "bin/which" + "node-which": "bin/node-which" + }, + "engines": { + "node": ">= 8" } }, - "node_modules/which-module": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/which-module/-/which-module-2.0.0.tgz", - "integrity": "sha1-2e8H3Od7mQK4o6j6SzHD4/fm6Ho=", - "dev": true - }, - "node_modules/which-pm-runs": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/which-pm-runs/-/which-pm-runs-1.0.0.tgz", - "integrity": "sha1-Zws6+8VS4LVd9rd4DKdGFfI60cs=" - }, "node_modules/wide-align": { "version": "1.1.3", "resolved": "https://registry.npmjs.org/wide-align/-/wide-align-1.1.3.tgz", "integrity": "sha512-QGkOQc8XL6Bt5PwnsExKBPuMKBxnGxWWW3fU55Xt4feHozMUhdUMaBCk290qpm/wG5u/RSKzwdAC4i51YigihA==", + "dev": true, "dependencies": { "string-width": "^1.0.2 || 2" } @@ -3492,95 +2901,86 @@ } }, "node_modules/workerpool": { - "version": "6.1.4", - "resolved": "https://registry.npmjs.org/workerpool/-/workerpool-6.1.4.tgz", - "integrity": "sha512-jGWPzsUqzkow8HoAvqaPWTUPCrlPJaJ5tY8Iz7n1uCz3tTp6s3CDG0FF1NsX42WNlkRSW6Mr+CDZGnNoSsKa7g==" + "version": "6.1.5", + "resolved": "https://registry.npmjs.org/workerpool/-/workerpool-6.1.5.tgz", + "integrity": "sha512-XdKkCK0Zqc6w3iTxLckiuJ81tiD/o5rBE/m+nXpRCB+/Sq4DqkfXZ/x0jW02DG1tGsfUGXbTJyZDP+eu67haSw==" }, "node_modules/wrap-ansi": { - "version": "5.1.0", - "resolved": "https://registry.npmjs.org/wrap-ansi/-/wrap-ansi-5.1.0.tgz", - "integrity": "sha512-QC1/iN/2/RPVJ5jYK8BGttj5z83LmSKmvbvrXPNCLZSEb32KKVDJDl/MOt2N01qU2H/FkzEa9PKto1BqDjtd7Q==", + "version": "7.0.0", + "resolved": "https://registry.npmjs.org/wrap-ansi/-/wrap-ansi-7.0.0.tgz", + "integrity": "sha512-YVGIj2kamLSTxw6NsZjoBxfSwsn0ycdesmc4p+Q21c5zPuZ1pl+NfxVdxPtdHvmNVOQ6XSYG4AUtyt/Fi7D16Q==", "dev": true, "dependencies": { - "ansi-styles": "^3.2.0", - "string-width": "^3.0.0", - "strip-ansi": "^5.0.0" + "ansi-styles": "^4.0.0", + "string-width": "^4.1.0", + "strip-ansi": "^6.0.0" }, "engines": { - "node": ">=6" + "node": ">=10" + }, + "funding": { + "url": "https://github.com/chalk/wrap-ansi?sponsor=1" } }, "node_modules/wrap-ansi/node_modules/ansi-regex": { - "version": "4.1.0", - "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-4.1.0.tgz", - "integrity": "sha512-1apePfXM1UOSqw0o9IiFAovVz9M5S1Dg+4TrDwfMewQ6p/rmMueb7tWZjQ1rx4Loy1ArBggoqGpfqqdI4rondg==", + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-5.0.0.tgz", + "integrity": "sha512-bY6fj56OUQ0hU1KjFNDQuJFezqKdrAyFdIevADiqrWHwSlbmBNMHp5ak2f40Pm8JTFyM2mqxkG6ngkHO11f/lg==", "dev": true, "engines": { - "node": ">=6" + "node": ">=8" } }, "node_modules/wrap-ansi/node_modules/is-fullwidth-code-point": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/is-fullwidth-code-point/-/is-fullwidth-code-point-2.0.0.tgz", - "integrity": "sha1-o7MKXE8ZkYMWeqq5O+764937ZU8=", + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/is-fullwidth-code-point/-/is-fullwidth-code-point-3.0.0.tgz", + "integrity": "sha512-zymm5+u+sCsSWyD9qNaejV3DFvhCKclKdizYaJUuHA83RLjb7nSuGnddCHGv0hk+KY7BMAlsWeK4Ueg6EV6XQg==", "dev": true, "engines": { - "node": ">=4" + "node": ">=8" } }, "node_modules/wrap-ansi/node_modules/string-width": { - "version": "3.1.0", - "resolved": "https://registry.npmjs.org/string-width/-/string-width-3.1.0.tgz", - "integrity": "sha512-vafcv6KjVZKSgz06oM/H6GDBrAtz8vdhQakGjFIvNrHA6y3HCF1CInLy+QLq8dTJPQ1b+KDUqDFctkdRW44e1w==", + "version": "4.2.2", + "resolved": "https://registry.npmjs.org/string-width/-/string-width-4.2.2.tgz", + "integrity": "sha512-XBJbT3N4JhVumXE0eoLU9DCjcaF92KLNqTmFCnG1pf8duUxFGwtP6AD6nkjw9a3IdiRtL3E2w3JDiE/xi3vOeA==", "dev": true, "dependencies": { - "emoji-regex": "^7.0.1", - "is-fullwidth-code-point": "^2.0.0", - "strip-ansi": "^5.1.0" + "emoji-regex": "^8.0.0", + "is-fullwidth-code-point": "^3.0.0", + "strip-ansi": "^6.0.0" }, "engines": { - "node": ">=6" + "node": ">=8" } }, "node_modules/wrap-ansi/node_modules/strip-ansi": { - "version": "5.2.0", - "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-5.2.0.tgz", - "integrity": "sha512-DuRs1gKbBqsMKIZlrffwlug8MHkcnpjs5VPmL1PAh+mA30U0DTotfDZ0d2UUsXpPmPmMMJ6W773MaA3J+lbiWA==", + "version": "6.0.0", + "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-6.0.0.tgz", + "integrity": "sha512-AuvKTrTfQNYNIctbR1K/YGTR1756GycPsg7b9bdV9Duqur4gv6aKqHXah67Z8ImS7WEz5QVcOtlfW2rZEugt6w==", "dev": true, "dependencies": { - "ansi-regex": "^4.1.0" + "ansi-regex": "^5.0.0" }, "engines": { - "node": ">=6" + "node": ">=8" } }, "node_modules/wrappy": { "version": "1.0.2", "resolved": "https://registry.npmjs.org/wrappy/-/wrappy-1.0.2.tgz", - "integrity": "sha1-tSQ9jz7BqjXxNkYFvA0QNuMKtp8=" - }, - "node_modules/x-xss-protection": { - "version": "1.3.0", - "resolved": "https://registry.npmjs.org/x-xss-protection/-/x-xss-protection-1.3.0.tgz", - "integrity": "sha512-kpyBI9TlVipZO4diReZMAHWtS0MMa/7Kgx8hwG/EuZLiA6sg4Ah/4TRdASHhRRN3boobzcYgFRUFSgHRge6Qhg==", - "engines": { - "node": ">=4.0.0" - } + "integrity": "sha1-tSQ9jz7BqjXxNkYFvA0QNuMKtp8=", + "dev": true }, - "node_modules/xtend": { - "version": "4.0.2", - "resolved": "https://registry.npmjs.org/xtend/-/xtend-4.0.2.tgz", - "integrity": "sha512-LKYU1iAXJXUgAXn9URjiu+MWhyUXHsvfp7mcuYm9dSUKK0/CjtrUwFAxD82/mCWbtLsGjFIad0wIsod4zrTAEQ==", + "node_modules/y18n": { + "version": "5.0.8", + "resolved": "https://registry.npmjs.org/y18n/-/y18n-5.0.8.tgz", + "integrity": "sha512-0pfFzegeDWJHJIAmTLRP2DwHjdF5s7jo9tuztdQxAhINCdvS+3nGINqPd00AphqJR/0LhANUS6/+7SCb98YOfA==", + "dev": true, "engines": { - "node": ">=0.4" + "node": ">=10" } }, - "node_modules/y18n": { - "version": "4.0.3", - "resolved": "https://registry.npmjs.org/y18n/-/y18n-4.0.3.tgz", - "integrity": "sha512-JKhqTOwSrqNA1NY5lSztJ1GrBiUodLMmIZuLiDaMRJ+itFd+ABVE8XBjOvIWL+rSqNDC74LCSFmlb/U4UZ4hJQ==", - "dev": true - }, "node_modules/yaeti": { "version": "0.0.6", "resolved": "https://registry.npmjs.org/yaeti/-/yaeti-0.0.6.tgz", @@ -3590,114 +2990,126 @@ } }, "node_modules/yallist": { - "version": "2.1.2", - "resolved": "https://registry.npmjs.org/yallist/-/yallist-2.1.2.tgz", - "integrity": "sha1-HBH5IY8HYImkfdUS+TxmmaaoHVI=" + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/yallist/-/yallist-4.0.0.tgz", + "integrity": "sha512-3wdGidZyq5PB084XLES5TpOSRA3wjXAlIWMhum2kRcv/41Sn2emQ0dycQW4uZXLejwKvg6EsvbdlVL+FYEct7A==" }, "node_modules/yargs": { - "version": "13.3.2", - "resolved": "https://registry.npmjs.org/yargs/-/yargs-13.3.2.tgz", - "integrity": "sha512-AX3Zw5iPruN5ie6xGRIDgqkT+ZhnRlZMLMHAs8tg7nRruy2Nb+i5o9bwghAogtM08q1dpr2LVoS8KSTMYpWXUw==", + "version": "16.2.0", + "resolved": "https://registry.npmjs.org/yargs/-/yargs-16.2.0.tgz", + "integrity": "sha512-D1mvvtDG0L5ft/jGWkLpG1+m0eQxOfaBvTNELraWj22wSVUMWxZUvYgJYcKh6jGGIkJFhH4IZPQhR4TKpc8mBw==", "dev": true, "dependencies": { - "cliui": "^5.0.0", - "find-up": "^3.0.0", - "get-caller-file": "^2.0.1", + "cliui": "^7.0.2", + "escalade": "^3.1.1", + "get-caller-file": "^2.0.5", "require-directory": "^2.1.1", - "require-main-filename": "^2.0.0", - "set-blocking": "^2.0.0", - "string-width": "^3.0.0", - "which-module": "^2.0.0", - "y18n": "^4.0.0", - "yargs-parser": "^13.1.2" + "string-width": "^4.2.0", + "y18n": "^5.0.5", + "yargs-parser": "^20.2.2" + }, + "engines": { + "node": ">=10" } }, "node_modules/yargs-parser": { - "version": "13.1.2", - "resolved": "https://registry.npmjs.org/yargs-parser/-/yargs-parser-13.1.2.tgz", - "integrity": "sha512-3lbsNRf/j+A4QuSZfDRA7HRSfWrzO0YjqTJd5kjAq37Zep1CEgaYmrH9Q3GwPiB9cHyd1Y1UwggGhJGoxipbzg==", + "version": "20.2.4", + "resolved": "https://registry.npmjs.org/yargs-parser/-/yargs-parser-20.2.4.tgz", + "integrity": "sha512-WOkpgNhPTlE73h4VFAFsOnomJVaovO8VqLDzy5saChRBFQFBoMYirowyW+Q9HB4HFF4Z7VZTiG3iSzJJA29yRA==", "dev": true, - "dependencies": { - "camelcase": "^5.0.0", - "decamelize": "^1.2.0" + "engines": { + "node": ">=10" } }, "node_modules/yargs-unparser": { - "version": "1.6.0", - "resolved": "https://registry.npmjs.org/yargs-unparser/-/yargs-unparser-1.6.0.tgz", - "integrity": "sha512-W9tKgmSn0DpSatfri0nx52Joq5hVXgeLiqR/5G0sZNDoLZFOr/xjBUDcShCOGNsBnEMNo1KAMBkTej1Hm62HTw==", + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/yargs-unparser/-/yargs-unparser-2.0.0.tgz", + "integrity": "sha512-7pRTIA9Qc1caZ0bZ6RYRGbHJthJWuakf+WmHK0rVeLkNrrGhfoabBNdue6kdINI6r4if7ocq9aD/n7xwKOdzOA==", "dev": true, "dependencies": { - "flat": "^4.1.0", - "lodash": "^4.17.15", - "yargs": "^13.3.0" + "camelcase": "^6.0.0", + "decamelize": "^4.0.0", + "flat": "^5.0.2", + "is-plain-obj": "^2.1.0" }, "engines": { - "node": ">=6" + "node": ">=10" } }, "node_modules/yargs/node_modules/ansi-regex": { - "version": "4.1.0", - "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-4.1.0.tgz", - "integrity": "sha512-1apePfXM1UOSqw0o9IiFAovVz9M5S1Dg+4TrDwfMewQ6p/rmMueb7tWZjQ1rx4Loy1ArBggoqGpfqqdI4rondg==", + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-5.0.0.tgz", + "integrity": "sha512-bY6fj56OUQ0hU1KjFNDQuJFezqKdrAyFdIevADiqrWHwSlbmBNMHp5ak2f40Pm8JTFyM2mqxkG6ngkHO11f/lg==", "dev": true, "engines": { - "node": ">=6" + "node": ">=8" } }, "node_modules/yargs/node_modules/is-fullwidth-code-point": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/is-fullwidth-code-point/-/is-fullwidth-code-point-2.0.0.tgz", - "integrity": "sha1-o7MKXE8ZkYMWeqq5O+764937ZU8=", + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/is-fullwidth-code-point/-/is-fullwidth-code-point-3.0.0.tgz", + "integrity": "sha512-zymm5+u+sCsSWyD9qNaejV3DFvhCKclKdizYaJUuHA83RLjb7nSuGnddCHGv0hk+KY7BMAlsWeK4Ueg6EV6XQg==", "dev": true, "engines": { - "node": ">=4" + "node": ">=8" } }, "node_modules/yargs/node_modules/string-width": { - "version": "3.1.0", - "resolved": "https://registry.npmjs.org/string-width/-/string-width-3.1.0.tgz", - "integrity": "sha512-vafcv6KjVZKSgz06oM/H6GDBrAtz8vdhQakGjFIvNrHA6y3HCF1CInLy+QLq8dTJPQ1b+KDUqDFctkdRW44e1w==", + "version": "4.2.2", + "resolved": "https://registry.npmjs.org/string-width/-/string-width-4.2.2.tgz", + "integrity": "sha512-XBJbT3N4JhVumXE0eoLU9DCjcaF92KLNqTmFCnG1pf8duUxFGwtP6AD6nkjw9a3IdiRtL3E2w3JDiE/xi3vOeA==", "dev": true, "dependencies": { - "emoji-regex": "^7.0.1", - "is-fullwidth-code-point": "^2.0.0", - "strip-ansi": "^5.1.0" + "emoji-regex": "^8.0.0", + "is-fullwidth-code-point": "^3.0.0", + "strip-ansi": "^6.0.0" }, "engines": { - "node": ">=6" + "node": ">=8" } }, "node_modules/yargs/node_modules/strip-ansi": { - "version": "5.2.0", - "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-5.2.0.tgz", - "integrity": "sha512-DuRs1gKbBqsMKIZlrffwlug8MHkcnpjs5VPmL1PAh+mA30U0DTotfDZ0d2UUsXpPmPmMMJ6W773MaA3J+lbiWA==", + "version": "6.0.0", + "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-6.0.0.tgz", + "integrity": "sha512-AuvKTrTfQNYNIctbR1K/YGTR1756GycPsg7b9bdV9Duqur4gv6aKqHXah67Z8ImS7WEz5QVcOtlfW2rZEugt6w==", "dev": true, "dependencies": { - "ansi-regex": "^4.1.0" + "ansi-regex": "^5.0.0" }, "engines": { - "node": ">=6" + "node": ">=8" + } + }, + "node_modules/yocto-queue": { + "version": "0.1.0", + "resolved": "https://registry.npmjs.org/yocto-queue/-/yocto-queue-0.1.0.tgz", + "integrity": "sha512-rVksvsnNCdJ/ohGc6xgPwyN8eheCxsiLM8mxuE/t/mOVqJewPuO1miLpTHQiRgTKCLexL4MeAFVagts7HmNZ2Q==", + "dev": true, + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" } }, "node_modules/zeromq": { - "version": "4.2.0", - "resolved": "https://registry.npmjs.org/zeromq/-/zeromq-4.2.0.tgz", - "integrity": "sha1-4RMzBd9zyE+MffBgqOKzA7THLX8=", + "version": "6.0.0-beta.5", + "resolved": "https://registry.npmjs.org/zeromq/-/zeromq-6.0.0-beta.5.tgz", + "integrity": "sha512-zsSbjfLjDxQq/Mp6NemNK/AVpm1NeafJRgz7nos1nV9MI/3w/P76pFdlqzxRTW4cuNqyFXJ4Q7g2tUhaZi4rcg==", + "hasInstallScript": true, "dependencies": { - "nan": "^2.4.0", - "prebuild-install": "^2.1.1" + "node-gyp-build": "^4.1.0" }, "engines": { - "node": ">=0.10" + "node": ">= 10" } } }, "dependencies": { "@polka/url": { - "version": "1.0.0-next.12", - "resolved": "https://registry.npmjs.org/@polka/url/-/url-1.0.0-next.12.tgz", - "integrity": "sha512-6RglhutqrGFMO1MNUXp95RBuYIuc8wTnMAV5MUhLmjTOy78ncwOw7RgeQ/HeymkKXRhZd0s2DNrM1rL7unk3MQ==" + "version": "1.0.0-next.15", + "resolved": "https://registry.npmjs.org/@polka/url/-/url-1.0.0-next.15.tgz", + "integrity": "sha512-15spi3V28QdevleWBNXE4pIls3nFZmBbUGrW9IVPwiQczuSb9n76TCB4bsk8TSel+I1OkHEdPhu5QKMfY6rQHA==" }, "@tinyhttp/accepts": { "version": "1.3.0", @@ -3709,16 +3121,16 @@ } }, "@tinyhttp/app": { - "version": "1.3.3", - "resolved": "https://registry.npmjs.org/@tinyhttp/app/-/app-1.3.3.tgz", - "integrity": "sha512-PhE3En3AMWNcdrm0hVTcawz5UIWUlzHo5Zl+JunOXR2hhXJ9afvm6OCXg0GX/bgNZ1vW/Prwp10+KrGWygthnQ==", + "version": "1.3.13", + "resolved": "https://registry.npmjs.org/@tinyhttp/app/-/app-1.3.13.tgz", + "integrity": "sha512-eQO5NXfIVZRQPApdmG+00C1zYC0fJW+HwCvdvPE/VVQj81CCLdD6t2g0xgCDMKuuBfvyukFAPPKTNjpMBneWpg==", "requires": { "@tinyhttp/cookie": "1.3.0", "@tinyhttp/proxy-addr": "1.3.0", - "@tinyhttp/req": "1.3.0", - "@tinyhttp/res": "1.3.0", - "@tinyhttp/router": "1.3.1", - "regexparam": "^1.3.0" + "@tinyhttp/req": "1.3.1", + "@tinyhttp/res": "1.3.2", + "@tinyhttp/router": "1.3.3", + "regexparam": "^2.0.0" } }, "@tinyhttp/content-disposition": { @@ -3761,42 +3173,42 @@ } }, "@tinyhttp/req": { - "version": "1.3.0", - "resolved": "https://registry.npmjs.org/@tinyhttp/req/-/req-1.3.0.tgz", - "integrity": "sha512-zIbtJA7Hp2p4MqszP2jOBi2NWi8fTGd4lso+0CjwJa+WTE+lgXVAy6mN12rTAxjXweAyRvQpRIJ5W2r8OLuEXQ==", + "version": "1.3.1", + "resolved": "https://registry.npmjs.org/@tinyhttp/req/-/req-1.3.1.tgz", + "integrity": "sha512-nNIf3OGBtiQ9WRdqAH/cqwRXgIjQi9oQYslHdGsOzu79MZRvbkco+6FUEYvkQ9N6rLfAL+xjAXkCUk+gDJ0eLA==", "requires": { "@tinyhttp/accepts": "1.3.0", "@tinyhttp/type-is": "1.3.0", - "@tinyhttp/url": "1.3.0", + "@tinyhttp/url": "1.3.1", "es-fresh": "^0.0.8", "range-parser": "^1.2.1" } }, "@tinyhttp/res": { - "version": "1.3.0", - "resolved": "https://registry.npmjs.org/@tinyhttp/res/-/res-1.3.0.tgz", - "integrity": "sha512-ez6fCpGsYoU6HUBq0e+m4l6Cffu2FeucK+m5Z6a8sBGqLR7/teB1pFufCOPwrdwzdNrLNarGJpsNQpvQqDMWaA==", + "version": "1.3.2", + "resolved": "https://registry.npmjs.org/@tinyhttp/res/-/res-1.3.2.tgz", + "integrity": "sha512-5dl9dcBBAIEBNfiR4PodVJc/u8fJIePGdL3eqnlavdXJ2rWV3T6MfwCq4Cd6CV4RRJHbYfsj24Hl3iEYFmhJmg==", "requires": { "@tinyhttp/content-disposition": "1.3.0", "@tinyhttp/cookie": "1.3.0", "@tinyhttp/cookie-signature": "1.3.0", "@tinyhttp/encode-url": "0.3.0", - "@tinyhttp/req": "1.3.0", - "@tinyhttp/send": "1.3.0", + "@tinyhttp/req": "1.3.1", + "@tinyhttp/send": "1.3.1", "es-mime-types": "^0.0.16", "es-vary": "^0.0.8", "escape-html": "^1.0.3" } }, "@tinyhttp/router": { - "version": "1.3.1", - "resolved": "https://registry.npmjs.org/@tinyhttp/router/-/router-1.3.1.tgz", - "integrity": "sha512-r+VTBrRVxCgkTUVOzR2Awzaqa8DCQKQg/BLIpKEHNGp/OVuxSvVGVIEKiZZY9Z5E3HR6FYZL0TMO7r6QvzP1Jg==" + "version": "1.3.3", + "resolved": "https://registry.npmjs.org/@tinyhttp/router/-/router-1.3.3.tgz", + "integrity": "sha512-Wjch7WR8DDkQm5xeNy4i/RrYQGmNrUhqzqls+UBZW14mULjUUtKoTlDOg59RxsPx2NmzdoDbIW4jTpbw+VyNHg==" }, "@tinyhttp/send": { - "version": "1.3.0", - "resolved": "https://registry.npmjs.org/@tinyhttp/send/-/send-1.3.0.tgz", - "integrity": "sha512-3Tn8NaLhNdcIJQqc/3ZBFV0hX6jCaFNDX5/vWxoPubDrh8HOpn2foPXL7ZIRk8GDkaB/M3cSzKIlKpnTKmh0Nw==", + "version": "1.3.1", + "resolved": "https://registry.npmjs.org/@tinyhttp/send/-/send-1.3.1.tgz", + "integrity": "sha512-72JvdTkpaSZoSxqhNHc2rEjJDkwAmL5azuIcZOrd+CzQV1etn4gZcdzIoHBBl4iGrrCNKZSPEgQNpWhhjeASpQ==", "requires": { "@tinyhttp/etag": "1.3.0", "es-content-type": "^0.0.10", @@ -3813,9 +3225,9 @@ } }, "@tinyhttp/url": { - "version": "1.3.0", - "resolved": "https://registry.npmjs.org/@tinyhttp/url/-/url-1.3.0.tgz", - "integrity": "sha512-GgdKez5AaQRIm0kFNp7BZnxFQ2F7LZ7g3rOQ/v11oYZR3jhH7JPGM+7hZQjYqFXD/5TK/of7hepu418K2fghvg==" + "version": "1.3.1", + "resolved": "https://registry.npmjs.org/@tinyhttp/url/-/url-1.3.1.tgz", + "integrity": "sha512-72XRyVFLqbm8C9FQHYgfKNNIZBKuct13/EcA4tPnF9o8dIcL7UJtXCf+kQjdMZPJzJn51c451sxjm5p4dldbvQ==" }, "@types/caseless": { "version": "0.12.2", @@ -3851,12 +3263,33 @@ "resolved": "https://registry.npmjs.org/@types/tough-cookie/-/tough-cookie-4.0.0.tgz", "integrity": "sha512-I99sngh224D0M7XgW1s120zxCt3VYQ3IQsuw3P3jbq5GG4yc79+ZjyKznyOGIQrflfylLgcfekeZW/vk0yng6A==" }, + "@ungap/promise-all-settled": { + "version": "1.1.2", + "resolved": "https://registry.npmjs.org/@ungap/promise-all-settled/-/promise-all-settled-1.1.2.tgz", + "integrity": "sha512-sL/cEvJWAnClXw0wHk85/2L0G6Sj8UB0Ctc1TEMbKSsmpRosqhwj9gWgFRZSrBr2f9tiXISwNhCPmlfqUqyb9Q==", + "dev": true + }, "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": "6.0.2", + "resolved": "https://registry.npmjs.org/agent-base/-/agent-base-6.0.2.tgz", + "integrity": "sha512-RZNwNclF7+MS/8bDg70amg32dyeZGZxiDuQmZxKLAlQjr3jGyLx+4Kkk58UO7D2QdgFIQCovuSuZESne6RG6XQ==", "requires": { - "es6-promisify": "^5.0.0" + "debug": "4" + }, + "dependencies": { + "debug": { + "version": "4.3.2", + "resolved": "https://registry.npmjs.org/debug/-/debug-4.3.2.tgz", + "integrity": "sha512-mOp8wKcvj7XxC78zLgw/ZA+6TSgkoE2C/ienthhRD298T7UNwAg9diBpLRxC0mOezLl4B0xV7M0cCO6P/O0Xhw==", + "requires": { + "ms": "2.1.2" + } + }, + "ms": { + "version": "2.1.2", + "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.2.tgz", + "integrity": "sha512-sGkPx+VjMtmA6MX27oA4FBFELFCZZ4S4XqeGOXCv68tT+jb3vk/RyaKWP0PTKyWtmLSM0b+adUTEvbs1PEaH2w==" + } } }, "ajv": { @@ -3871,86 +3304,41 @@ } }, "ansi-colors": { - "version": "3.2.3", - "resolved": "https://registry.npmjs.org/ansi-colors/-/ansi-colors-3.2.3.tgz", - "integrity": "sha512-LEHHyuhlPY3TmuUYMh2oz89lTShfvgbmzaBcxve9t/9Wuy7Dwf4yoAKcND7KFT1HAQfqZ12qtc+DUrBMeKF9nw==", + "version": "4.1.1", + "resolved": "https://registry.npmjs.org/ansi-colors/-/ansi-colors-4.1.1.tgz", + "integrity": "sha512-JoX0apGbHaUJBNl6yF+p6JAFYZ666/hhCGKN5t9QFjbJQKUU/g8MNbFDbvfrgKXvI1QpZplPOnwIo99lX/AAmA==", "dev": true }, "ansi-regex": { "version": "2.1.1", "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-2.1.1.tgz", - "integrity": "sha1-w7M6te42DYbg5ijwRorn7yfWVN8=" + "integrity": "sha1-w7M6te42DYbg5ijwRorn7yfWVN8=", + "dev": true }, "ansi-styles": { - "version": "3.2.1", - "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-3.2.1.tgz", - "integrity": "sha512-VT0ZI6kZRdTh8YyJw3SMbYm/u+NqfsAxEpWO0Pf9sq8/e94WxxOpPKx9FR1FlyCtOVDNOQ+8ntlqFxiRc+r5qA==", + "version": "4.3.0", + "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-4.3.0.tgz", + "integrity": "sha512-zbB9rCJAT1rbjiVDb2hqKFHNYLxgtk8NURxZ3IZwD3F6NtxbXZQCnnSi1Lkx+IDohdPlFp222wVALIheZJQSEg==", "dev": true, "requires": { - "color-convert": "^1.9.0" + "color-convert": "^2.0.1" } }, "anymatch": { - "version": "3.1.1", - "resolved": "https://registry.npmjs.org/anymatch/-/anymatch-3.1.1.tgz", - "integrity": "sha512-mM8522psRCqzV+6LhomX5wgp25YVibjh8Wj23I5RPkPppSVSjyKD2A2mBJmWGa+KN7f2D6LNh9jkBCeyLktzjg==", + "version": "3.1.2", + "resolved": "https://registry.npmjs.org/anymatch/-/anymatch-3.1.2.tgz", + "integrity": "sha512-P43ePfOAIupkguHUycrc4qJ9kz8ZiuOUijaETwX7THt0Y/GNK7v0aa8rY816xWjZ7rJdA5XdMcpVFTKMq+RvWg==", "dev": true, "requires": { "normalize-path": "^3.0.0", "picomatch": "^2.0.4" } }, - "aproba": { - "version": "1.2.0", - "resolved": "https://registry.npmjs.org/aproba/-/aproba-1.2.0.tgz", - "integrity": "sha512-Y9J6ZjXtoYh8RnXVCMOU/ttDmk1aBjunq9vO0ta5x85WDQiQfUF9sIPBITdbiiIVcBo03Hi3jMxigBtsddlXRw==" - }, - "are-we-there-yet": { - "version": "1.1.5", - "resolved": "https://registry.npmjs.org/are-we-there-yet/-/are-we-there-yet-1.1.5.tgz", - "integrity": "sha512-5hYdAkZlcG8tOLujVDTgCT+uPX0VnpAH28gWsLfzpXYm7wP6mp5Q/gYyR7YQ0cKVJcXJnl3j2kpBan13PtQf6w==", - "requires": { - "delegates": "^1.0.0", - "readable-stream": "^2.0.6" - }, - "dependencies": { - "readable-stream": { - "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", - "isarray": "~1.0.0", - "process-nextick-args": "~2.0.0", - "safe-buffer": "~5.1.1", - "string_decoder": "~1.1.1", - "util-deprecate": "~1.0.1" - } - }, - "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==" - }, - "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==", - "requires": { - "safe-buffer": "~5.1.0" - } - } - } - }, "argparse": { - "version": "1.0.10", - "resolved": "https://registry.npmjs.org/argparse/-/argparse-1.0.10.tgz", - "integrity": "sha512-o5Roy6tNG4SL/FOkCAN6RzjiakZS25RLYFrcMttJqbdd8BWrnA+fGz57iN5Pb06pvBGvl5gQ0B48dJlslXvoTg==", - "dev": true, - "requires": { - "sprintf-js": "~1.0.2" - } + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/argparse/-/argparse-2.0.1.tgz", + "integrity": "sha512-8+9WqebbFzpX9OR+Wa6O29asIogeRMzcGtAINdpMHHyAg10f05aSFVBbcEqGf/PXw1EjAZ+q2/bEBg3DvurK3Q==", + "dev": true }, "asn1": { "version": "0.2.4", @@ -3966,12 +3354,9 @@ "integrity": "sha1-8S4PPF13sLHN2RRpQuTpbB5N1SU=" }, "async-sema": { - "version": "2.1.2", - "resolved": "https://registry.npmjs.org/async-sema/-/async-sema-2.1.2.tgz", - "integrity": "sha512-7Wxs4QBLL9XklTVaRKH16ws/YJBZ7wouqnSu84jILDqZZObsrhDfsVELhQE7U53b2qkFtsAX5ED1ZMvrWzv1Yg==", - "requires": { - "double-ended-queue": "2.1.0-0" - } + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/async-sema/-/async-sema-3.1.0.tgz", + "integrity": "sha512-+JpRq3r0zjpRLDruS6q/nC4V5tzsaiu07521677Mdi5i+AkaU/aNJH38rYHJVQ4zvz+SSkjgc8FUI7qIZrR+3g==" }, "asynckit": { "version": "0.4.0", @@ -3997,9 +3382,9 @@ } }, "balanced-match": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/balanced-match/-/balanced-match-1.0.0.tgz", - "integrity": "sha1-ibTRmasr7kneFk6gK4nORi1xt2c=", + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/balanced-match/-/balanced-match-1.0.2.tgz", + "integrity": "sha512-3oSeUO0TMV67hN1AmbXsK4yaqU7tjiHlbxRDZOpH0KW9+CeX4bRAaX0Anxt0tx2MrpRpWwQaPwIlISEJhYU5Pw==", "dev": true }, "base-x": { @@ -4029,9 +3414,9 @@ "integrity": "sha512-t/OYhhJ2SD+YGBQcjY8GzzDHEk9f3nerxjtfa6tlMXfe7frs/WozhvCNoGvpM0P3bNf3Gq5ZRMlGr5f3r4/N8A==" }, "binary-extensions": { - "version": "2.1.0", - "resolved": "https://registry.npmjs.org/binary-extensions/-/binary-extensions-2.1.0.tgz", - "integrity": "sha512-1Yj8h9Q+QDF5FzhMs/c9+6UntbD5MkRfRwac8DoEm9ZfUBZ7tZ55YcGVAzEe4bXsdQHEk+s9S5wsOKVdZrw0tQ==", + "version": "2.2.0", + "resolved": "https://registry.npmjs.org/binary-extensions/-/binary-extensions-2.2.0.tgz", + "integrity": "sha512-jDctJ/IVQbZoJykoeHbhXpOlNBqGNcwXJKJog42E5HDPUwQTSdjCHdihjj0DlnheQ7blbT6dHOafNAiS8ooQKA==", "dev": true }, "bindings": { @@ -4062,15 +3447,21 @@ } }, "bip39": { - "version": "2.4.0", - "resolved": "https://registry.npmjs.org/bip39/-/bip39-2.4.0.tgz", - "integrity": "sha512-1++HywqIyPtWDo7gm4v0ylYbwkLvHkuwVSKbBlZBbTCP/mnkyrlARBny906VLAwxJbC5xw9EvuJasHFIZaIFMQ==", + "version": "3.0.4", + "resolved": "https://registry.npmjs.org/bip39/-/bip39-3.0.4.tgz", + "integrity": "sha512-YZKQlb752TrUWqHWj7XAwCSjYEgGAk+/Aas3V7NyjQeZYsztO8JnQUaCWhcnL4T+jL8nvB8typ2jRPzTlgugNw==", "requires": { + "@types/node": "11.11.6", "create-hash": "^1.1.0", "pbkdf2": "^3.0.9", - "randombytes": "^2.0.1", - "safe-buffer": "^5.0.1", - "unorm": "^1.3.3" + "randombytes": "^2.0.1" + }, + "dependencies": { + "@types/node": { + "version": "11.11.6", + "resolved": "https://registry.npmjs.org/@types/node/-/node-11.11.6.tgz", + "integrity": "sha512-Exw4yUWMBXM3X+8oqzJNRqZSwUAaS4+7NdvHqQuFi/d+synz++xmX3QIf+BFqneW8N31R8Ky+sikfZUXq07ggQ==" + } } }, "bip66": { @@ -4109,86 +3500,16 @@ } }, "bitcoinjs-message": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/bitcoinjs-message/-/bitcoinjs-message-1.0.1.tgz", - "integrity": "sha1-P8xfHYX53TCsYNERlIyxs7T+nMU=", + "version": "2.2.0", + "resolved": "https://registry.npmjs.org/bitcoinjs-message/-/bitcoinjs-message-2.2.0.tgz", + "integrity": "sha512-103Wy3xg8Y9o+pdhGP4M3/mtQQuUWs6sPuOp1mYphSUoSMHjHTlkj32K4zxU8qMH0Ckv23emfkGlFWtoWZ7YFA==", "requires": { - "bs58check": "^1.0.8", + "bech32": "^1.1.3", + "bs58check": "^2.1.2", "buffer-equals": "^1.0.3", "create-hash": "^1.1.2", "secp256k1": "^3.0.1", "varuint-bitcoin": "^1.0.1" - }, - "dependencies": { - "base-x": { - "version": "1.1.0", - "resolved": "https://registry.npmjs.org/base-x/-/base-x-1.1.0.tgz", - "integrity": "sha1-QtPXF0dPnqAiB/bRqh9CaRPut6w=" - }, - "bs58": { - "version": "3.1.0", - "resolved": "https://registry.npmjs.org/bs58/-/bs58-3.1.0.tgz", - "integrity": "sha1-1MJjiL9IBMrHFBQbGUWqR+XrJI4=", - "requires": { - "base-x": "^1.1.0" - } - }, - "bs58check": { - "version": "1.3.4", - "resolved": "https://registry.npmjs.org/bs58check/-/bs58check-1.3.4.tgz", - "integrity": "sha1-xSVABzdJEXcU+gQsMEfrj5FRy/g=", - "requires": { - "bs58": "^3.1.0", - "create-hash": "^1.1.0" - } - } - } - }, - "bl": { - "version": "1.2.3", - "resolved": "https://registry.npmjs.org/bl/-/bl-1.2.3.tgz", - "integrity": "sha512-pvcNpa0UU69UT341rO6AYy4FVAIkUHuZXRIWbq+zHnsVcRzDDjIAhGuuYoi0d//cwIwtt4pkpKycWEfjdV+vww==", - "requires": { - "readable-stream": "^2.3.5", - "safe-buffer": "^5.1.1" - }, - "dependencies": { - "readable-stream": { - "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", - "isarray": "~1.0.0", - "process-nextick-args": "~2.0.0", - "safe-buffer": "~5.1.1", - "string_decoder": "~1.1.1", - "util-deprecate": "~1.0.1" - }, - "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==" - } - } - }, - "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==", - "requires": { - "safe-buffer": "~5.1.0" - }, - "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==" - } - } - } } }, "bn.js": { @@ -4247,11 +3568,6 @@ } } }, - "bowser": { - "version": "2.9.0", - "resolved": "https://registry.npmjs.org/bowser/-/bowser-2.9.0.tgz", - "integrity": "sha512-2ld76tuLBNFekRgmJfT2+3j5MIrP6bFict8WAIT3beq+srz1gcKNAdNKMqHqauQt63NmAa88HfP1/Ypa9Er3HA==" - }, "brace-expansion": { "version": "1.1.11", "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-1.1.11.tgz", @@ -4313,20 +3629,6 @@ "safe-buffer": "^5.1.2" } }, - "buffer-alloc": { - "version": "1.2.0", - "resolved": "https://registry.npmjs.org/buffer-alloc/-/buffer-alloc-1.2.0.tgz", - "integrity": "sha512-CFsHQgjtW1UChdXgbyJGtnm+O/uLQeZdtbDo8mfUgYXCHSM1wgrVxXm6bSyrUuErEb+4sYVGCzASBRot7zyrow==", - "requires": { - "buffer-alloc-unsafe": "^1.1.0", - "buffer-fill": "^1.0.0" - } - }, - "buffer-alloc-unsafe": { - "version": "1.1.0", - "resolved": "https://registry.npmjs.org/buffer-alloc-unsafe/-/buffer-alloc-unsafe-1.1.0.tgz", - "integrity": "sha512-TEM2iMIEQdJ2yjPJoSIsldnleVaAk1oW3DBVUykyOLsEsFmEc9kn+SFFPz+gl54KQNxlDnAwCXosOS9Okx2xAg==" - }, "buffer-equal-constant-time": { "version": "1.0.1", "resolved": "https://registry.npmjs.org/buffer-equal-constant-time/-/buffer-equal-constant-time-1.0.1.tgz", @@ -4337,11 +3639,6 @@ "resolved": "https://registry.npmjs.org/buffer-equals/-/buffer-equals-1.0.4.tgz", "integrity": "sha1-A1O1T9B/2VZBcGca5vZrnPENJ/U=" }, - "buffer-fill": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/buffer-fill/-/buffer-fill-1.0.0.tgz", - "integrity": "sha1-+PeLdniYiO858gXNY39o5wISKyw=" - }, "buffer-xor": { "version": "1.0.3", "resolved": "https://registry.npmjs.org/buffer-xor/-/buffer-xor-1.0.3.tgz", @@ -4356,63 +3653,53 @@ } }, "camelcase": { - "version": "5.3.1", - "resolved": "https://registry.npmjs.org/camelcase/-/camelcase-5.3.1.tgz", - "integrity": "sha512-L28STB170nwWS63UjtlEOE3dldQApaJXZkOI1uMFfzf3rRuPegHaHesyee+YxQ+W6SvRDQV6UrdOdRiR153wJg==", + "version": "6.2.0", + "resolved": "https://registry.npmjs.org/camelcase/-/camelcase-6.2.0.tgz", + "integrity": "sha512-c7wVvbw3f37nuobQNtgsgG9POC9qMbNuMQmTCqZv23b6MIz0fcYpBiOlv9gEN/hdLdnZTDQhg6e9Dq5M1vKvfg==", "dev": true }, - "camelize": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/camelize/-/camelize-1.0.0.tgz", - "integrity": "sha1-FkpUg+Yw+kMh5a8HAg5TGDGyYJs=" - }, "caseless": { "version": "0.12.0", "resolved": "https://registry.npmjs.org/caseless/-/caseless-0.12.0.tgz", "integrity": "sha1-G2gcIf+EAzyCZUMJBolCDRhxUdw=" }, "chalk": { - "version": "2.4.2", - "resolved": "https://registry.npmjs.org/chalk/-/chalk-2.4.2.tgz", - "integrity": "sha512-Mti+f9lpJNcwF4tWV8/OrTTtF1gZi+f8FqlyAdouralcFWFQWF2+NgCHShjkCb+IFBLq9buZwE1xckQU4peSuQ==", + "version": "4.1.1", + "resolved": "https://registry.npmjs.org/chalk/-/chalk-4.1.1.tgz", + "integrity": "sha512-diHzdDKxcU+bAsUboHLPEDQiw0qEe0qd7SYUn3HgcFlWgbDcfLGswOHYeGrHKzG9z6UYf01d9VFMfZxPM1xZSg==", "dev": true, "requires": { - "ansi-styles": "^3.2.1", - "escape-string-regexp": "^1.0.5", - "supports-color": "^5.3.0" + "ansi-styles": "^4.1.0", + "supports-color": "^7.1.0" }, "dependencies": { "supports-color": { - "version": "5.5.0", - "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-5.5.0.tgz", - "integrity": "sha512-QjVjwdXIt408MIiAqCX4oUKsgU2EqAGzs2Ppkm4aQYbjm+ZEWEcW4SfFNTr4uMNZma0ey4f5lgLrkB0aX0QMow==", + "version": "7.2.0", + "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-7.2.0.tgz", + "integrity": "sha512-qpCAvRl9stuOHveKsn7HncJRvv501qIacKzQlO/+Lwxc9+0q2wLyv4Dfvt80/DPn2pqOBsJdDiogXGR9+OvwRw==", "dev": true, "requires": { - "has-flag": "^3.0.0" + "has-flag": "^4.0.0" } } } }, "chokidar": { - "version": "3.3.0", - "resolved": "https://registry.npmjs.org/chokidar/-/chokidar-3.3.0.tgz", - "integrity": "sha512-dGmKLDdT3Gdl7fBUe8XK+gAtGmzy5Fn0XkkWQuYxGIgWVPPse2CxFA5mtrlD0TOHaHjEUqkWNyP1XdHoJES/4A==", + "version": "3.5.2", + "resolved": "https://registry.npmjs.org/chokidar/-/chokidar-3.5.2.tgz", + "integrity": "sha512-ekGhOnNVPgT77r4K/U3GDhu+FQ2S8TnK/s2KbIGXi0SZWuwkZ2QNyfWdZW+TVfn84DpEP7rLeCt2UI6bJ8GwbQ==", "dev": true, "requires": { - "anymatch": "~3.1.1", + "anymatch": "~3.1.2", "braces": "~3.0.2", - "glob-parent": "~5.1.0", + "fsevents": "~2.3.2", + "glob-parent": "~5.1.2", "is-binary-path": "~2.1.0", "is-glob": "~4.0.1", "normalize-path": "~3.0.0", - "readdirp": "~3.2.0" + "readdirp": "~3.6.0" } }, - "chownr": { - "version": "1.1.4", - "resolved": "https://registry.npmjs.org/chownr/-/chownr-1.1.4.tgz", - "integrity": "sha512-jJ0bqzaylmJtVnNgzTeSOs8DPavpbYgEr/b0YL8/2GO3xJEhInFmhKMUnEJQjZumK7KXGFhUy89PrsJWlakBVg==" - }, "cipher-base": { "version": "1.0.4", "resolved": "https://registry.npmjs.org/cipher-base/-/cipher-base-1.0.4.tgz", @@ -4423,46 +3710,46 @@ } }, "cliui": { - "version": "5.0.0", - "resolved": "https://registry.npmjs.org/cliui/-/cliui-5.0.0.tgz", - "integrity": "sha512-PYeGSEmmHM6zvoef2w8TPzlrnNpXIjTipYK780YswmIP9vjxmd6Y2a3CB2Ks6/AU8NHjZugXvo8w3oWM2qnwXA==", + "version": "7.0.4", + "resolved": "https://registry.npmjs.org/cliui/-/cliui-7.0.4.tgz", + "integrity": "sha512-OcRE68cOsVMXp1Yvonl/fzkQOyjLSu/8bhPDfQt0e0/Eb283TKP20Fs2MqoPsr9SwA595rRCA+QMzYc9nBP+JQ==", "dev": true, "requires": { - "string-width": "^3.1.0", - "strip-ansi": "^5.2.0", - "wrap-ansi": "^5.1.0" + "string-width": "^4.2.0", + "strip-ansi": "^6.0.0", + "wrap-ansi": "^7.0.0" }, "dependencies": { "ansi-regex": { - "version": "4.1.0", - "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-4.1.0.tgz", - "integrity": "sha512-1apePfXM1UOSqw0o9IiFAovVz9M5S1Dg+4TrDwfMewQ6p/rmMueb7tWZjQ1rx4Loy1ArBggoqGpfqqdI4rondg==", + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-5.0.0.tgz", + "integrity": "sha512-bY6fj56OUQ0hU1KjFNDQuJFezqKdrAyFdIevADiqrWHwSlbmBNMHp5ak2f40Pm8JTFyM2mqxkG6ngkHO11f/lg==", "dev": true }, "is-fullwidth-code-point": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/is-fullwidth-code-point/-/is-fullwidth-code-point-2.0.0.tgz", - "integrity": "sha1-o7MKXE8ZkYMWeqq5O+764937ZU8=", + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/is-fullwidth-code-point/-/is-fullwidth-code-point-3.0.0.tgz", + "integrity": "sha512-zymm5+u+sCsSWyD9qNaejV3DFvhCKclKdizYaJUuHA83RLjb7nSuGnddCHGv0hk+KY7BMAlsWeK4Ueg6EV6XQg==", "dev": true }, "string-width": { - "version": "3.1.0", - "resolved": "https://registry.npmjs.org/string-width/-/string-width-3.1.0.tgz", - "integrity": "sha512-vafcv6KjVZKSgz06oM/H6GDBrAtz8vdhQakGjFIvNrHA6y3HCF1CInLy+QLq8dTJPQ1b+KDUqDFctkdRW44e1w==", + "version": "4.2.2", + "resolved": "https://registry.npmjs.org/string-width/-/string-width-4.2.2.tgz", + "integrity": "sha512-XBJbT3N4JhVumXE0eoLU9DCjcaF92KLNqTmFCnG1pf8duUxFGwtP6AD6nkjw9a3IdiRtL3E2w3JDiE/xi3vOeA==", "dev": true, "requires": { - "emoji-regex": "^7.0.1", - "is-fullwidth-code-point": "^2.0.0", - "strip-ansi": "^5.1.0" + "emoji-regex": "^8.0.0", + "is-fullwidth-code-point": "^3.0.0", + "strip-ansi": "^6.0.0" } }, "strip-ansi": { - "version": "5.2.0", - "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-5.2.0.tgz", - "integrity": "sha512-DuRs1gKbBqsMKIZlrffwlug8MHkcnpjs5VPmL1PAh+mA30U0DTotfDZ0d2UUsXpPmPmMMJ6W773MaA3J+lbiWA==", + "version": "6.0.0", + "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-6.0.0.tgz", + "integrity": "sha512-AuvKTrTfQNYNIctbR1K/YGTR1756GycPsg7b9bdV9Duqur4gv6aKqHXah67Z8ImS7WEz5QVcOtlfW2rZEugt6w==", "dev": true, "requires": { - "ansi-regex": "^4.1.0" + "ansi-regex": "^5.0.0" } } } @@ -4470,21 +3757,22 @@ "code-point-at": { "version": "1.1.0", "resolved": "https://registry.npmjs.org/code-point-at/-/code-point-at-1.1.0.tgz", - "integrity": "sha1-DQcLTQQ6W+ozovGkDi7bPZpMz3c=" + "integrity": "sha1-DQcLTQQ6W+ozovGkDi7bPZpMz3c=", + "dev": true }, "color-convert": { - "version": "1.9.3", - "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-1.9.3.tgz", - "integrity": "sha512-QfAUtd+vFdAtFQcC8CCyYt1fYWxSqAiK2cSD6zDB8N3cpsEBAvRxp9zOGg6G/SHHJYAT88/az/IuDGALsNVbGg==", + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-2.0.1.tgz", + "integrity": "sha512-RRECPsj7iu/xb5oKYcsFHSppFNnsj/52OVTRKb4zP5onXwVF3zVmmToNcOfGC+CRDpfK/U584fMg38ZHCaElKQ==", "dev": true, "requires": { - "color-name": "1.1.3" + "color-name": "~1.1.4" } }, "color-name": { - "version": "1.1.3", - "resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.3.tgz", - "integrity": "sha1-p9BVi9icQveV3UIyj3QIMcpTvCU=", + "version": "1.1.4", + "resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.4.tgz", + "integrity": "sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA==", "dev": true }, "combined-stream": { @@ -4501,16 +3789,6 @@ "integrity": "sha1-2Klr13/Wjfd5OnMDajug1UBdR3s=", "dev": true }, - "console-control-strings": { - "version": "1.1.0", - "resolved": "https://registry.npmjs.org/console-control-strings/-/console-control-strings-1.1.0.tgz", - "integrity": "sha1-PXz0Rk22RG6mRL9LOVB/mFEAjo4=" - }, - "content-security-policy-builder": { - "version": "2.1.0", - "resolved": "https://registry.npmjs.org/content-security-policy-builder/-/content-security-policy-builder-2.1.0.tgz", - "integrity": "sha512-/MtLWhJVvJNkA9dVLAp6fg9LxD2gfI6R2Fi1hPmfjYXSahJJzcfvoeDOxSyp4NvxMuwWv3WMssE9o31DoULHrQ==" - }, "content-type": { "version": "1.0.4", "resolved": "https://registry.npmjs.org/content-type/-/content-type-1.0.4.tgz", @@ -4563,11 +3841,6 @@ "assert-plus": "^1.0.0" } }, - "dasherize": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/dasherize/-/dasherize-2.0.0.tgz", - "integrity": "sha1-bYCcnNDPe7iVLYD8hPoT1H3bEwg=" - }, "debug": { "version": "2.6.9", "resolved": "https://registry.npmjs.org/debug/-/debug-2.6.9.tgz", @@ -4577,69 +3850,27 @@ } }, "decamelize": { - "version": "1.2.0", - "resolved": "https://registry.npmjs.org/decamelize/-/decamelize-1.2.0.tgz", - "integrity": "sha1-9lNNFRSCabIDUue+4m9QH5oZEpA=", + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/decamelize/-/decamelize-4.0.0.tgz", + "integrity": "sha512-9iE1PgSik9HeIIw2JO94IidnE3eBoQrFJ3w7sFuzSX4DpmZ3v5sZpUiV5Swcf6mQEF+Y0ru8Neo+p+nyh2J+hQ==", "dev": true }, - "decompress-response": { - "version": "3.3.0", - "resolved": "https://registry.npmjs.org/decompress-response/-/decompress-response-3.3.0.tgz", - "integrity": "sha1-gKTdMjdIOEv6JICDYirt7Jgq3/M=", - "requires": { - "mimic-response": "^1.0.0" - } - }, - "deep-extend": { - "version": "0.6.0", - "resolved": "https://registry.npmjs.org/deep-extend/-/deep-extend-0.6.0.tgz", - "integrity": "sha512-LOHxIOaPYdHlJRtCQfDIVZtfw/ufM8+rVj649RIHzcm/vGwQRXFt6OPqIFWsm2XEMrNIEtWR64sY1LEKD2vAOA==" - }, - "define-properties": { - "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" - } - }, "delayed-stream": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/delayed-stream/-/delayed-stream-1.0.0.tgz", "integrity": "sha1-3zrhmayt+31ECqrgsp4icrJOxhk=" }, - "delegates": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/delegates/-/delegates-1.0.0.tgz", - "integrity": "sha1-hMbhWbgZBP3KWaDvRM2HDTElD5o=" - }, "depd": { "version": "1.1.2", "resolved": "https://registry.npmjs.org/depd/-/depd-1.1.2.tgz", "integrity": "sha1-m81S4UwJd2PnSbJ0xDRu0uVgtak=" }, - "detect-libc": { - "version": "1.0.3", - "resolved": "https://registry.npmjs.org/detect-libc/-/detect-libc-1.0.3.tgz", - "integrity": "sha1-+hN8S9aY7fVc1c0CrFWfkaTEups=" - }, "diff": { - "version": "3.5.0", - "resolved": "https://registry.npmjs.org/diff/-/diff-3.5.0.tgz", - "integrity": "sha512-A46qtFgd+g7pDZinpnwiRJtxbC1hpgf0uzP3iG89scHk0AUC7A1TGxf5OiiOUv/JMZR8GOt8hL900hV0bOy5xA==", + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/diff/-/diff-5.0.0.tgz", + "integrity": "sha512-/VTCrvm5Z0JGty/BWHljh+BAiw3IK+2j87NGMu8Nwc/f48WoDAC395uomO9ZD117ZOBaHmkX1oyLvkVM/aIT3w==", "dev": true }, - "dont-sniff-mimetype": { - "version": "1.1.0", - "resolved": "https://registry.npmjs.org/dont-sniff-mimetype/-/dont-sniff-mimetype-1.1.0.tgz", - "integrity": "sha512-ZjI4zqTaxveH2/tTlzS1wFp+7ncxNZaIEWYg3lzZRHkKf5zPT/MnEG6WL0BhHMJUabkh8GeU5NL5j+rEUCb7Ug==" - }, - "double-ended-queue": { - "version": "2.1.0-0", - "resolved": "https://registry.npmjs.org/double-ended-queue/-/double-ended-queue-2.1.0-0.tgz", - "integrity": "sha1-ED01J/0xUo9AGIEwyEHv3XgmTlw=" - }, "drbg.js": { "version": "1.0.1", "resolved": "https://registry.npmjs.org/drbg.js/-/drbg.js-1.0.1.tgz", @@ -4687,38 +3918,11 @@ } }, "emoji-regex": { - "version": "7.0.3", - "resolved": "https://registry.npmjs.org/emoji-regex/-/emoji-regex-7.0.3.tgz", - "integrity": "sha512-CwBLREIQ7LvYFB0WyRvwhq5N5qPhc6PMjD6bYggFlI5YyDgl+0vxq5VHbMOFqLg7hfWzmu8T5Z1QofhmTIhItA==", + "version": "8.0.0", + "resolved": "https://registry.npmjs.org/emoji-regex/-/emoji-regex-8.0.0.tgz", + "integrity": "sha512-MSjYzcWNOA0ewAHpz0MxpYFvwg6yjy1NG3xteoqz644VCo/RPgnr1/GGt+ic3iJTzQ8Eu3TdM14SawnVUmGE6A==", "dev": true }, - "end-of-stream": { - "version": "1.4.4", - "resolved": "https://registry.npmjs.org/end-of-stream/-/end-of-stream-1.4.4.tgz", - "integrity": "sha512-+uw1inIHVPQoaVuHzRyXd21icM+cnt4CzD5rW+NC1wjOUSTOs+Te7FOv7AhN7vS9x/oIyhLP5PR1H+phQAHu5Q==", - "requires": { - "once": "^1.4.0" - } - }, - "es-abstract": { - "version": "1.17.6", - "resolved": "https://registry.npmjs.org/es-abstract/-/es-abstract-1.17.6.tgz", - "integrity": "sha512-Fr89bON3WFyUi5EvAeI48QTWX0AyekGgLA8H+c+7fbfCkJwRWRMLd8CQedNEyJuoYYhmtEqY92pgte1FAhBlhw==", - "dev": true, - "requires": { - "es-to-primitive": "^1.2.1", - "function-bind": "^1.1.1", - "has": "^1.0.3", - "has-symbols": "^1.0.1", - "is-callable": "^1.2.0", - "is-regex": "^1.1.0", - "object-inspect": "^1.7.0", - "object-keys": "^1.1.1", - "object.assign": "^4.1.0", - "string.prototype.trimend": "^1.0.1", - "string.prototype.trimstart": "^1.0.1" - } - }, "es-content-type": { "version": "0.0.10", "resolved": "https://registry.npmjs.org/es-content-type/-/es-content-type-0.0.10.tgz", @@ -4737,17 +3941,6 @@ "mime-db": "^1.44.0" } }, - "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==", - "dev": true, - "requires": { - "is-callable": "^1.1.4", - "is-date-object": "^1.0.1", - "is-symbol": "^1.0.2" - } - }, "es-vary": { "version": "0.0.8", "resolved": "https://registry.npmjs.org/es-vary/-/es-vary-0.0.8.tgz", @@ -4773,19 +3966,6 @@ "es6-symbol": "^3.1.1" } }, - "es6-promise": { - "version": "4.2.8", - "resolved": "https://registry.npmjs.org/es6-promise/-/es6-promise-4.2.8.tgz", - "integrity": "sha512-HJDGx5daxeIvxdBxvG2cb9g4tEvwIk3i8+nhX0yGrYmZUzbkdg8QbDevheDB8gd0//uPj4c1EQua8Q+MViT0/w==" - }, - "es6-promisify": { - "version": "5.0.0", - "resolved": "https://registry.npmjs.org/es6-promisify/-/es6-promisify-5.0.0.tgz", - "integrity": "sha1-UQnWLz5W6pZ8S2NQWu8IKRyKUgM=", - "requires": { - "es6-promise": "^4.0.3" - } - }, "es6-symbol": { "version": "3.1.3", "resolved": "https://registry.npmjs.org/es6-symbol/-/es6-symbol-3.1.3.tgz", @@ -4795,21 +3975,21 @@ "ext": "^1.1.2" } }, + "escalade": { + "version": "3.1.1", + "resolved": "https://registry.npmjs.org/escalade/-/escalade-3.1.1.tgz", + "integrity": "sha512-k0er2gUkLf8O0zKJiAhmkTnJlTvINGv7ygDNPbeIsX/TJjGJZHuh9B2UxbsaEkmlEo9MfhrSzmhIlhRlI2GXnw==", + "dev": true + }, "escape-html": { "version": "1.0.3", "resolved": "https://registry.npmjs.org/escape-html/-/escape-html-1.0.3.tgz", "integrity": "sha1-Aljq5NPQwJdN4cFpGI7wBR0dGYg=" }, "escape-string-regexp": { - "version": "1.0.5", - "resolved": "https://registry.npmjs.org/escape-string-regexp/-/escape-string-regexp-1.0.5.tgz", - "integrity": "sha1-G2HAViGQqN/2rjuyzwIAyhMLhtQ=", - "dev": true - }, - "esprima": { - "version": "4.0.1", - "resolved": "https://registry.npmjs.org/esprima/-/esprima-4.0.1.tgz", - "integrity": "sha512-eGuFFw7Upda+g4p+QHvnW0RyTX/SVeJBDM/gCtMARO0cLuT2HcEKnTPvhjV6aGeqrCB/sbNop0Kszm0jsaWU4A==", + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/escape-string-regexp/-/escape-string-regexp-4.0.0.tgz", + "integrity": "sha512-TtpcNJ3XAzx3Gq8sWRzJaVajRs0uVxA2YAkdb1jm2YkPz4G6egUFAyA3n5vtEIZefPk5Wa4UXbKuS5fKkJWdgA==", "dev": true }, "evp_bytestokey": { @@ -4821,11 +4001,6 @@ "safe-buffer": "^5.1.1" } }, - "expand-template": { - "version": "1.1.1", - "resolved": "https://registry.npmjs.org/expand-template/-/expand-template-1.1.1.tgz", - "integrity": "sha512-cebqLtV8KOZfw0UI8TEFWxtczxxC1jvyUvx6H4fyp1K1FN7A4Q+uggVUlOsI1K8AGU0rwOGqP8nCapdrw8CYQg==" - }, "ext": { "version": "1.4.0", "resolved": "https://registry.npmjs.org/ext/-/ext-1.4.0.tgz", @@ -4861,11 +4036,6 @@ "resolved": "https://registry.npmjs.org/fast-json-stable-stringify/-/fast-json-stable-stringify-2.1.0.tgz", "integrity": "sha512-lhd/wF+Lk98HZoTCtlVraHtfh5XYijIjalXck7saUtuanSDyLMxnHhSXEDJqHxD7msR8D0uCmqlkwjCV8xvwHw==" }, - "feature-policy": { - "version": "0.3.0", - "resolved": "https://registry.npmjs.org/feature-policy/-/feature-policy-0.3.0.tgz", - "integrity": "sha512-ZtijOTFN7TzCujt1fnNhfWPFPSHeZkesff9AXZj+UEjYBynWNUIYpC87Ve4wHzyexQsImicLu7WsC2LHq7/xrQ==" - }, "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", @@ -4881,22 +4051,20 @@ } }, "find-up": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/find-up/-/find-up-3.0.0.tgz", - "integrity": "sha512-1yD6RmLI1XBfxugvORwlck6f75tYL+iR0jqwsOrOxMZyGYqUuDhJ0l4AXdO1iX/FTs9cBAMEk1gWSEx1kSbylg==", + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/find-up/-/find-up-5.0.0.tgz", + "integrity": "sha512-78/PXT1wlLLDgTzDs7sjq9hzz0vXD+zn+7wypEe4fXQxCmdmqfGsEPQxmiCSQI3ajFV91bVSsvNtrJRiW6nGng==", "dev": true, "requires": { - "locate-path": "^3.0.0" + "locate-path": "^6.0.0", + "path-exists": "^4.0.0" } }, "flat": { - "version": "4.1.0", - "resolved": "https://registry.npmjs.org/flat/-/flat-4.1.0.tgz", - "integrity": "sha512-Px/TiLIznH7gEDlPXcUD4KnBusa6kR6ayRUVcnEAbreRIuhkqow/mun59BuRXwoYk7ZQOLW1ZM05ilIvK38hFw==", - "dev": true, - "requires": { - "is-buffer": "~2.0.3" - } + "version": "5.0.2", + "resolved": "https://registry.npmjs.org/flat/-/flat-5.0.2.tgz", + "integrity": "sha512-b6suED+5/3rTpUBdG1gupIl8MPFCAMA0QXwmljLhvCUKcUvdE4gWky9zpuGCcXHOsz4J9wPGNWq6OKpmIzz3hQ==", + "dev": true }, "follow-redirects": { "version": "1.13.3", @@ -4918,37 +4086,18 @@ "mime-types": "^2.1.12" } }, - "fs-constants": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/fs-constants/-/fs-constants-1.0.0.tgz", - "integrity": "sha512-y6OAwoSIf7FyjMIv94u+b5rdheZEjzR63GTyZJm5qh4Bi+2YgwLCcI/fPFZkL5PSixOt6ZNKm+w+Hfp/Bciwow==" - }, "fs.realpath": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/fs.realpath/-/fs.realpath-1.0.0.tgz", "integrity": "sha1-FQStJSMVjKpA20onh8sBQRmU6k8=", "dev": true }, - "function-bind": { - "version": "1.1.1", - "resolved": "https://registry.npmjs.org/function-bind/-/function-bind-1.1.1.tgz", - "integrity": "sha512-yIovAzMX49sF8Yl58fSCWJ5svSLuaibPxXQJFLmBObTuCr0Mf1KiPopGM9NiFjiYBCbfaa2Fh6breQ6ANVTI0A==", - "dev": true - }, - "gauge": { - "version": "2.7.4", - "resolved": "https://registry.npmjs.org/gauge/-/gauge-2.7.4.tgz", - "integrity": "sha1-LANAXHU4w51+s3sxcCLjJfsBi/c=", - "requires": { - "aproba": "^1.0.3", - "console-control-strings": "^1.0.0", - "has-unicode": "^2.0.0", - "object-assign": "^4.1.0", - "signal-exit": "^3.0.0", - "string-width": "^1.0.1", - "strip-ansi": "^3.0.1", - "wide-align": "^1.1.0" - } + "fsevents": { + "version": "2.3.2", + "resolved": "https://registry.npmjs.org/fsevents/-/fsevents-2.3.2.tgz", + "integrity": "sha512-xiqMQR4xAeHTuB9uWm+fFRcIOgKBMiOBP+eXiyT7jsgVCq1bkVygt00oASowB7EdtpOHaaPgKt812P9ab+DDKA==", + "dev": true, + "optional": true }, "get-caller-file": { "version": "2.0.5", @@ -4964,15 +4113,10 @@ "assert-plus": "^1.0.0" } }, - "github-from-package": { - "version": "0.0.0", - "resolved": "https://registry.npmjs.org/github-from-package/-/github-from-package-0.0.0.tgz", - "integrity": "sha1-l/tdlr/eiXMxPyDoKI75oWf6ZM4=" - }, "glob": { - "version": "7.1.3", - "resolved": "https://registry.npmjs.org/glob/-/glob-7.1.3.tgz", - "integrity": "sha512-vcfuiIxogLV4DlGBHIUOwI0IbrJ8HWPc4MU7HzviGeNho/UJDfi6B5p3sHeWIQ0KGIU0Jpxi5ZHxemQfLkkAwQ==", + "version": "7.1.7", + "resolved": "https://registry.npmjs.org/glob/-/glob-7.1.7.tgz", + "integrity": "sha512-OvD9ENzPLbegENnYP5UUfJIirTg4+XwMWGaQfQTY0JenxNvvIKP3U3/tAQSPIu/lHxXYSZmpXlUHeqAIdKzBLQ==", "dev": true, "requires": { "fs.realpath": "^1.0.0", @@ -4984,9 +4128,9 @@ } }, "glob-parent": { - "version": "5.1.1", - "resolved": "https://registry.npmjs.org/glob-parent/-/glob-parent-5.1.1.tgz", - "integrity": "sha512-FnI+VGOpnlGHWZxthPGR+QhR78fuiK0sNLkHQv+bL9fQi57lNNdquIbna/WrfROrolq8GK5Ek6BiMwqL/voRYQ==", + "version": "5.1.2", + "resolved": "https://registry.npmjs.org/glob-parent/-/glob-parent-5.1.2.tgz", + "integrity": "sha512-AOIgSQCepiJYwP3ARnGx+5VnTu2HBYdzbGP45eLw1vr3zB3vZLeyed1sC9hnbcOc9/SrMyM5RPQrkGz4aS9Zow==", "dev": true, "requires": { "is-glob": "^4.0.1" @@ -5006,38 +4150,18 @@ "har-validator": { "version": "5.1.5", "resolved": "https://registry.npmjs.org/har-validator/-/har-validator-5.1.5.tgz", - "integrity": "sha512-nmT2T0lljbxdQZfspsno9hgrG3Uir6Ks5afism62poxqBM6sDnMEuPmzTq8XN0OEwqKLLdh1jQI3qyE66Nzb3w==", - "requires": { - "ajv": "^6.12.3", - "har-schema": "^2.0.0" - } - }, - "has": { - "version": "1.0.3", - "resolved": "https://registry.npmjs.org/has/-/has-1.0.3.tgz", - "integrity": "sha512-f2dvO0VU6Oej7RkWJGrehjbzMAjFp5/VKPp5tTpWIV4JHHZK1/BxbFRtf/siA2SWTe09caDmVtYYzWEIbBS4zw==", - "dev": true, + "integrity": "sha512-nmT2T0lljbxdQZfspsno9hgrG3Uir6Ks5afism62poxqBM6sDnMEuPmzTq8XN0OEwqKLLdh1jQI3qyE66Nzb3w==", "requires": { - "function-bind": "^1.1.1" + "ajv": "^6.12.3", + "har-schema": "^2.0.0" } }, "has-flag": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-3.0.0.tgz", - "integrity": "sha1-tdRU3CGZriJWmfNGfloH87lVuv0=", - "dev": true - }, - "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==", + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-4.0.0.tgz", + "integrity": "sha512-EykJT/Q1KjTWctppgIAgfSO0tKVuZUjhgMr17kqTumMl6Afv3EISleU7qZUzoXDFTAHTDC4NOoG/ZxU3EvlMPQ==", "dev": true }, - "has-unicode": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/has-unicode/-/has-unicode-2.0.1.tgz", - "integrity": "sha1-4Ob+aijPUROIVeCG0Wkedx3iqLk=" - }, "hash-base": { "version": "3.1.0", "resolved": "https://registry.npmjs.org/hash-base/-/hash-base-3.1.0.tgz", @@ -5064,50 +4188,9 @@ "dev": true }, "helmet": { - "version": "3.23.3", - "resolved": "https://registry.npmjs.org/helmet/-/helmet-3.23.3.tgz", - "integrity": "sha512-U3MeYdzPJQhtvqAVBPntVgAvNSOJyagwZwyKsFdyRa8TV3pOKVFljalPOCxbw5Wwf2kncGhmP0qHjyazIdNdSA==", - "requires": { - "depd": "2.0.0", - "dont-sniff-mimetype": "1.1.0", - "feature-policy": "0.3.0", - "helmet-crossdomain": "0.4.0", - "helmet-csp": "2.10.0", - "hide-powered-by": "1.1.0", - "hpkp": "2.0.0", - "hsts": "2.2.0", - "nocache": "2.1.0", - "referrer-policy": "1.2.0", - "x-xss-protection": "1.3.0" - }, - "dependencies": { - "depd": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/depd/-/depd-2.0.0.tgz", - "integrity": "sha512-g7nH6P6dyDioJogAAGprGpCtVImJhpPk/roCzdb3fIh61/s/nPsfR6onyMwkCAR/OlC3yBC0lESvUoQEAssIrw==" - } - } - }, - "helmet-crossdomain": { - "version": "0.4.0", - "resolved": "https://registry.npmjs.org/helmet-crossdomain/-/helmet-crossdomain-0.4.0.tgz", - "integrity": "sha512-AB4DTykRw3HCOxovD1nPR16hllrVImeFp5VBV9/twj66lJ2nU75DP8FPL0/Jp4jj79JhTfG+pFI2MD02kWJ+fA==" - }, - "helmet-csp": { - "version": "2.10.0", - "resolved": "https://registry.npmjs.org/helmet-csp/-/helmet-csp-2.10.0.tgz", - "integrity": "sha512-Rz953ZNEFk8sT2XvewXkYN0Ho4GEZdjAZy4stjiEQV3eN7GDxg1QKmYggH7otDyIA7uGA6XnUMVSgeJwbR5X+w==", - "requires": { - "bowser": "2.9.0", - "camelize": "1.0.0", - "content-security-policy-builder": "2.1.0", - "dasherize": "2.0.0" - } - }, - "hide-powered-by": { - "version": "1.1.0", - "resolved": "https://registry.npmjs.org/hide-powered-by/-/hide-powered-by-1.1.0.tgz", - "integrity": "sha512-Io1zA2yOA1YJslkr+AJlWSf2yWFkKjvkcL9Ni1XSUqnGLr/qRQe2UI3Cn/J9MsJht7yEVCe0SscY1HgVMujbgg==" + "version": "4.6.0", + "resolved": "https://registry.npmjs.org/helmet/-/helmet-4.6.0.tgz", + "integrity": "sha512-HVqALKZlR95ROkrnesdhbbZJFi/rIVSoNq6f3jA/9u6MIbTsPh3xZwihjeI5+DO/2sOV6HMHooXcEOuwskHpTg==" }, "hmac-drbg": { "version": "1.0.1", @@ -5119,26 +4202,6 @@ "minimalistic-crypto-utils": "^1.0.1" } }, - "hpkp": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/hpkp/-/hpkp-2.0.0.tgz", - "integrity": "sha1-EOFCJk52IVpdMMROxD3mTe5tFnI=" - }, - "hsts": { - "version": "2.2.0", - "resolved": "https://registry.npmjs.org/hsts/-/hsts-2.2.0.tgz", - "integrity": "sha512-ToaTnQ2TbJkochoVcdXYm4HOCliNozlviNsg+X2XQLQvZNI/kCHR9rZxVYpJB3UPcHz80PgxRyWQ7PdU1r+VBQ==", - "requires": { - "depd": "2.0.0" - }, - "dependencies": { - "depd": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/depd/-/depd-2.0.0.tgz", - "integrity": "sha512-g7nH6P6dyDioJogAAGprGpCtVImJhpPk/roCzdb3fIh61/s/nPsfR6onyMwkCAR/OlC3yBC0lESvUoQEAssIrw==" - } - } - }, "http-signature": { "version": "1.2.0", "resolved": "https://registry.npmjs.org/http-signature/-/http-signature-1.2.0.tgz", @@ -5172,20 +4235,15 @@ "resolved": "https://registry.npmjs.org/inherits/-/inherits-2.0.4.tgz", "integrity": "sha512-k/vGaX4/Yla3WzyMCvTQOXYeIHvqOKtnqBduzTHpzpQZzAskKMhZ2K+EnBiSM9zGSoIFeMpXKxa4dYeZIQqewQ==" }, - "ini": { - "version": "1.3.8", - "resolved": "https://registry.npmjs.org/ini/-/ini-1.3.8.tgz", - "integrity": "sha512-JV/yugV2uzW5iMRSiZAyDtQd+nxtUnjeLt0acNdw98kKLrvuRVyB80tsREOE7yvGVgalhZ6RNXCmEHkUKBKxew==" - }, "ip": { "version": "1.1.5", "resolved": "https://registry.npmjs.org/ip/-/ip-1.1.5.tgz", "integrity": "sha1-vd7XARQpCCjAoDnnLvJfWq7ENUo=" }, "ipaddr.js": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/ipaddr.js/-/ipaddr.js-2.0.0.tgz", - "integrity": "sha512-S54H9mIj0rbxRIyrDMEuuER86LdlgUg9FSeZ8duQb6CUG2iRrA36MYVQBSprTF/ZeAwvyQ5mDGuNvIPM0BIl3w==" + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/ipaddr.js/-/ipaddr.js-2.0.1.tgz", + "integrity": "sha512-1qTgH9NG+IIJ4yfKs2e6Pp1bZg8wbDbKHT21HrLIeYBTRLgMYKnMTPAuI3Lcs61nfx5h1xlXnbJtH1kX5/d/ng==" }, "is-binary-path": { "version": "2.1.0", @@ -5196,24 +4254,6 @@ "binary-extensions": "^2.0.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==", - "dev": true - }, - "is-callable": { - "version": "1.2.0", - "resolved": "https://registry.npmjs.org/is-callable/-/is-callable-1.2.0.tgz", - "integrity": "sha512-pyVD9AaGLxtg6srb2Ng6ynWJqkHU9bEM087AKck0w8QwDarTfNcpIYoU8x8Hv2Icm8u6kFJM18Dag8lyqGkviw==", - "dev": true - }, - "is-date-object": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/is-date-object/-/is-date-object-1.0.2.tgz", - "integrity": "sha512-USlDT524woQ08aoZFzh3/Z6ch9Y/EWXEHQ/AaRN0SkKq4t2Jw2R2339tSXmwuVoY7LLlBCbOIlx2myP/L5zk0g==", - "dev": true - }, "is-extglob": { "version": "2.1.1", "resolved": "https://registry.npmjs.org/is-extglob/-/is-extglob-2.1.1.tgz", @@ -5224,6 +4264,7 @@ "version": "1.0.0", "resolved": "https://registry.npmjs.org/is-fullwidth-code-point/-/is-fullwidth-code-point-1.0.0.tgz", "integrity": "sha1-754xOG8DGn8NZDr4L95QxFfvAMs=", + "dev": true, "requires": { "number-is-nan": "^1.0.0" } @@ -5243,29 +4284,23 @@ "integrity": "sha512-41Cifkg6e8TylSpdtTpeLVMqvSBEVzTttHvERD741+pnZ8ANv0004MRL43QKPDlK9cGvNp6NZWZUBlbGXYxxng==", "dev": true }, - "is-regex": { - "version": "1.1.0", - "resolved": "https://registry.npmjs.org/is-regex/-/is-regex-1.1.0.tgz", - "integrity": "sha512-iI97M8KTWID2la5uYXlkbSDQIg4F6o1sYboZKKTDpnDQMLtUL86zxhgDet3Q2SriaYsyGqZ6Mn2SjbRKeLHdqw==", - "dev": true, - "requires": { - "has-symbols": "^1.0.1" - } - }, - "is-symbol": { - "version": "1.0.3", - "resolved": "https://registry.npmjs.org/is-symbol/-/is-symbol-1.0.3.tgz", - "integrity": "sha512-OwijhaRSgqvhm/0ZdAcXNZt9lYdKFpcRDT5ULUuYXPoT794UNOdU+gpT6Rzo7b4V2HUl/op6GqY894AZwv9faQ==", - "dev": true, - "requires": { - "has-symbols": "^1.0.1" - } + "is-plain-obj": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/is-plain-obj/-/is-plain-obj-2.1.0.tgz", + "integrity": "sha512-YWnfyRwxL/+SsrWYfOpUtz5b3YD+nyfkHvjbcanzk8zgyO4ASD67uVMRt8k5bM4lLMDnXfriRhOpemw+NfT1eA==", + "dev": true }, "is-typedarray": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/is-typedarray/-/is-typedarray-1.0.0.tgz", "integrity": "sha1-5HnICFjfDBsR3dppQPlgEfzaSpo=" }, + "is-unicode-supported": { + "version": "0.1.0", + "resolved": "https://registry.npmjs.org/is-unicode-supported/-/is-unicode-supported-0.1.0.tgz", + "integrity": "sha512-knxG2q4UC3u8stRGyAVJCOdxFmv5DZiRcdlIaAQXAbSfJya+OhopNotLQrstBhququ4ZpuKbDc/8S6mgXgPFPw==", + "dev": true + }, "isarray": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/isarray/-/isarray-1.0.0.tgz", @@ -5283,13 +4318,12 @@ "integrity": "sha1-R+Y/evVa+m+S4VAOaQ64uFKcCZo=" }, "js-yaml": { - "version": "3.13.1", - "resolved": "https://registry.npmjs.org/js-yaml/-/js-yaml-3.13.1.tgz", - "integrity": "sha512-YfbcO7jXDdyj0DGxYVSlSeQNHbD7XPWvrVWeVUujrQEoZzWJIRrCPoyk6kL6IAjAG2IolMK4T0hNUe0HOUs5Jw==", + "version": "4.1.0", + "resolved": "https://registry.npmjs.org/js-yaml/-/js-yaml-4.1.0.tgz", + "integrity": "sha512-wpxZs9NoxZaJESJGIZTyDEaYpl0FKSA+FB9aJiyemKhMwkxQg63h4T1KJgUGHpTqPDNRcmmYLugrRjJlBtWvRA==", "dev": true, "requires": { - "argparse": "^1.0.7", - "esprima": "^4.0.0" + "argparse": "^2.0.1" } }, "jsbn": { @@ -5367,13 +4401,12 @@ } }, "locate-path": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/locate-path/-/locate-path-3.0.0.tgz", - "integrity": "sha512-7AO748wWnIhNqAuaty2ZWHkQHRSNfPVIsPIfwEOWO22AmaoVrWavlOcMR5nzTLNYvp36X220/maaRsrec1G65A==", + "version": "6.0.0", + "resolved": "https://registry.npmjs.org/locate-path/-/locate-path-6.0.0.tgz", + "integrity": "sha512-iPZK6eYjbxRu3uB4/WZ3EsEIMJFMqAoopl3R+zuq0UjcAm/MO6KCweDgPfP3elTztoKP3KtnVHxTn2NHBSDVUw==", "dev": true, "requires": { - "p-locate": "^3.0.0", - "path-exists": "^3.0.0" + "p-locate": "^5.0.0" } }, "lodash": { @@ -5417,21 +4450,21 @@ "integrity": "sha1-DdOXEhPHxW34gJd9UEyI+0cal6w=" }, "log-symbols": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/log-symbols/-/log-symbols-3.0.0.tgz", - "integrity": "sha512-dSkNGuI7iG3mfvDzUuYZyvk5dD9ocYCYzNU6CYDE6+Xqd+gwme6Z00NS3dUh8mq/73HaEtT7m6W+yUPtU6BZnQ==", + "version": "4.1.0", + "resolved": "https://registry.npmjs.org/log-symbols/-/log-symbols-4.1.0.tgz", + "integrity": "sha512-8XPvpAA8uyhfteu8pIvQxpJZ7SYYdpUivZpGy6sFsBuKRY/7rQGavedeB8aK+Zkyq6upMFVL/9AW6vOYzfRyLg==", "dev": true, "requires": { - "chalk": "^2.4.2" + "chalk": "^4.1.0", + "is-unicode-supported": "^0.1.0" } }, "lru-cache": { - "version": "4.0.2", - "resolved": "https://registry.npmjs.org/lru-cache/-/lru-cache-4.0.2.tgz", - "integrity": "sha1-HRdnnAac2l0ECZGgnbwsDbN35V4=", + "version": "6.0.0", + "resolved": "https://registry.npmjs.org/lru-cache/-/lru-cache-6.0.0.tgz", + "integrity": "sha512-Jo6dJ04CmSjuznwJSS3pUeWmd/H0ffTlkXXgwZi+eq1UCmqQwCh+eLsYOYCwY991i2Fah4h1BEMCx4qThGbsiA==", "requires": { - "pseudomap": "^1.0.1", - "yallist": "^2.0.0" + "yallist": "^4.0.0" } }, "make-concurrent": { @@ -5477,11 +4510,6 @@ "mime-db": "1.47.0" } }, - "mimic-response": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/mimic-response/-/mimic-response-1.0.1.tgz", - "integrity": "sha512-j5EctnkH7amfV/q5Hgmoal1g2QHFJRraOtmx0JpIqkxhBhI/lJSl1nMpQ45hVarwNETOoWEimndZ4QK0RHxuxQ==" - }, "minimalistic-assert": { "version": "1.0.1", "resolved": "https://registry.npmjs.org/minimalistic-assert/-/minimalistic-assert-1.0.1.tgz", @@ -5506,59 +4534,66 @@ "resolved": "https://registry.npmjs.org/minimist/-/minimist-1.2.5.tgz", "integrity": "sha512-FM9nNUYrRBAELZQT3xeZQ7fmMOBg6nWNmJKTcgsJeaLstP/UODVpGsr5OhXhhXg6f+qtJ8uiZ+PUxkDWcgIXLw==" }, - "mkdirp": { - "version": "0.5.5", - "resolved": "https://registry.npmjs.org/mkdirp/-/mkdirp-0.5.5.tgz", - "integrity": "sha512-NKmAlESf6jMGym1++R0Ra7wvhV+wFW63FaSOFPwRahvea0gMUcGUhVeAg/0BC0wiv9ih5NYPB1Wn1UEI1/L+xQ==", - "requires": { - "minimist": "^1.2.5" - } - }, "mocha": { - "version": "7.2.0", - "resolved": "https://registry.npmjs.org/mocha/-/mocha-7.2.0.tgz", - "integrity": "sha512-O9CIypScywTVpNaRrCAgoUnJgozpIofjKUYmJhiCIJMiuYnLI6otcb1/kpW9/n/tJODHGZ7i8aLQoDVsMtOKQQ==", + "version": "9.0.3", + "resolved": "https://registry.npmjs.org/mocha/-/mocha-9.0.3.tgz", + "integrity": "sha512-hnYFrSefHxYS2XFGtN01x8un0EwNu2bzKvhpRFhgoybIvMaOkkL60IVPmkb5h6XDmUl4IMSB+rT5cIO4/4bJgg==", "dev": true, "requires": { - "ansi-colors": "3.2.3", + "@ungap/promise-all-settled": "1.1.2", + "ansi-colors": "4.1.1", "browser-stdout": "1.3.1", - "chokidar": "3.3.0", - "debug": "3.2.6", - "diff": "3.5.0", - "escape-string-regexp": "1.0.5", - "find-up": "3.0.0", - "glob": "7.1.3", + "chokidar": "3.5.2", + "debug": "4.3.1", + "diff": "5.0.0", + "escape-string-regexp": "4.0.0", + "find-up": "5.0.0", + "glob": "7.1.7", "growl": "1.10.5", "he": "1.2.0", - "js-yaml": "3.13.1", - "log-symbols": "3.0.0", + "js-yaml": "4.1.0", + "log-symbols": "4.1.0", "minimatch": "3.0.4", - "mkdirp": "0.5.5", - "ms": "2.1.1", - "node-environment-flags": "1.0.6", - "object.assign": "4.1.0", - "strip-json-comments": "2.0.1", - "supports-color": "6.0.0", - "which": "1.3.1", + "ms": "2.1.3", + "nanoid": "3.1.23", + "serialize-javascript": "6.0.0", + "strip-json-comments": "3.1.1", + "supports-color": "8.1.1", + "which": "2.0.2", "wide-align": "1.1.3", - "yargs": "13.3.2", - "yargs-parser": "13.1.2", - "yargs-unparser": "1.6.0" + "workerpool": "6.1.5", + "yargs": "16.2.0", + "yargs-parser": "20.2.4", + "yargs-unparser": "2.0.0" }, "dependencies": { "debug": { - "version": "3.2.6", - "resolved": "https://registry.npmjs.org/debug/-/debug-3.2.6.tgz", - "integrity": "sha512-mel+jf7nrtEl5Pn1Qx46zARXKDpBbvzezse7p7LqINmdoIk8PYP5SySaxEmYv6TZ0JyEKA1hsCId6DIhgITtWQ==", + "version": "4.3.1", + "resolved": "https://registry.npmjs.org/debug/-/debug-4.3.1.tgz", + "integrity": "sha512-doEwdvm4PCeK4K3RQN2ZC2BYUBaxwLARCqZmMjtF8a51J2Rb0xpVloFRnCODwqjpwnAoao4pelN8l3RJdv3gRQ==", "dev": true, "requires": { - "ms": "^2.1.1" + "ms": "2.1.2" + }, + "dependencies": { + "ms": { + "version": "2.1.2", + "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.2.tgz", + "integrity": "sha512-sGkPx+VjMtmA6MX27oA4FBFELFCZZ4S4XqeGOXCv68tT+jb3vk/RyaKWP0PTKyWtmLSM0b+adUTEvbs1PEaH2w==", + "dev": true + } } }, "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.3", + "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.3.tgz", + "integrity": "sha512-6FlzubTLZG3J2a/NVCAleEhjzq5oxgHyaCU9yYXvcLsvoVaHJq/s5xXI6/XXP6tz7R9xAOtHnSO/tXtF3WRTlA==", + "dev": true + }, + "strip-json-comments": { + "version": "3.1.1", + "resolved": "https://registry.npmjs.org/strip-json-comments/-/strip-json-comments-3.1.1.tgz", + "integrity": "sha512-6fPc+R4ihwqP6N/aIv2f1gMH8lOVtWQHoqC4yK6oSDVVocumAsfCqjkXnqiYMhmMwS/mEHLp7Vehlt3ql6lEig==", "dev": true } } @@ -5613,6 +4648,12 @@ "resolved": "https://registry.npmjs.org/nan/-/nan-2.14.1.tgz", "integrity": "sha512-isWHgVjnFjh2x2yuJ/tj3JbwoHu3UC2dX5G/88Cm24yB6YopVgxvBObDY7n5xW6ExmFhJpSEQqFPvq9zaXc8Jw==" }, + "nanoid": { + "version": "3.1.23", + "resolved": "https://registry.npmjs.org/nanoid/-/nanoid-3.1.23.tgz", + "integrity": "sha512-FiB0kzdP0FFVGDKlRLEQ1BgDzU87dy5NnzjeW9YZNt+/c3+q82EQDUwniSAUxp/F0gFNI1ZhKU1FqYsMuqZVnw==", + "dev": true + }, "negotiator": { "version": "0.6.2", "resolved": "https://registry.npmjs.org/negotiator/-/negotiator-0.6.2.tgz", @@ -5624,104 +4665,32 @@ "integrity": "sha1-yobR/ogoFpsBICCOPchCS524NCw=" }, "nocache": { - "version": "2.1.0", - "resolved": "https://registry.npmjs.org/nocache/-/nocache-2.1.0.tgz", - "integrity": "sha512-0L9FvHG3nfnnmaEQPjT9xhfN4ISk0A8/2j4M37Np4mcDesJjHgEUfgPhdCyZuFI954tjokaIj/A3NdpFNdEh4Q==" - }, - "node-abi": { - "version": "2.18.0", - "resolved": "https://registry.npmjs.org/node-abi/-/node-abi-2.18.0.tgz", - "integrity": "sha512-yi05ZoiuNNEbyT/xXfSySZE+yVnQW6fxPZuFbLyS1s6b5Kw3HzV2PHOM4XR+nsjzkHxByK+2Wg+yCQbe35l8dw==", - "requires": { - "semver": "^5.4.1" - } - }, - "node-environment-flags": { - "version": "1.0.6", - "resolved": "https://registry.npmjs.org/node-environment-flags/-/node-environment-flags-1.0.6.tgz", - "integrity": "sha512-5Evy2epuL+6TM0lCQGpFIj6KwiEsGh1SrHUhTbNX+sLbBtjidPZFAnVK9y5yU1+h//RitLbRHTIMyxQPtxMdHw==", - "dev": true, - "requires": { - "object.getownpropertydescriptors": "^2.0.3", - "semver": "^5.7.0" - } + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/nocache/-/nocache-3.0.1.tgz", + "integrity": "sha512-Gh39xwJwBKy0OvFmWfBs/vDO4Nl7JhnJtkqNP76OUinQz7BiMoszHYrIDHHAaqVl/QKVxCEy4ZxC/XZninu7nQ==" }, "node-gyp-build": { "version": "4.2.3", "resolved": "https://registry.npmjs.org/node-gyp-build/-/node-gyp-build-4.2.3.tgz", "integrity": "sha512-MN6ZpzmfNCRM+3t57PTJHgHyw/h4OWnZ6mR8P5j/uZtqQr46RRuDE/P+g3n0YR/AiYXeWixZZzaip77gdICfRg==" }, - "noop-logger": { - "version": "0.1.1", - "resolved": "https://registry.npmjs.org/noop-logger/-/noop-logger-0.1.1.tgz", - "integrity": "sha1-lKKxYzxPExdVMAfYlm/Q6EG2pMI=" - }, "normalize-path": { "version": "3.0.0", "resolved": "https://registry.npmjs.org/normalize-path/-/normalize-path-3.0.0.tgz", "integrity": "sha512-6eZs5Ls3WtCisHWp9S2GUy8dqkpGi4BVSz3GaqiE6ezub0512ESztXUwUB6C6IKbQkY2Pnb/mD4WYojCRwcwLA==", "dev": true }, - "npmlog": { - "version": "4.1.2", - "resolved": "https://registry.npmjs.org/npmlog/-/npmlog-4.1.2.tgz", - "integrity": "sha512-2uUqazuKlTaSI/dC8AzicUck7+IrEaOnN/e0jd3Xtt1KcGpwx30v50mL7oPyr/h9bL3E4aZccVwpwP+5W9Vjkg==", - "requires": { - "are-we-there-yet": "~1.1.2", - "console-control-strings": "~1.1.0", - "gauge": "~2.7.3", - "set-blocking": "~2.0.0" - } - }, "number-is-nan": { "version": "1.0.1", "resolved": "https://registry.npmjs.org/number-is-nan/-/number-is-nan-1.0.1.tgz", - "integrity": "sha1-CXtgK1NCKlIsGvuHkDGDNpQaAR0=" + "integrity": "sha1-CXtgK1NCKlIsGvuHkDGDNpQaAR0=", + "dev": true }, "oauth-sign": { "version": "0.9.0", "resolved": "https://registry.npmjs.org/oauth-sign/-/oauth-sign-0.9.0.tgz", "integrity": "sha512-fexhUFFPTGV8ybAtSIGbV6gOkSv8UtRbDBnAyLQw4QPKkgNlsH2ByPGtMUqdWkos6YCRmAqViwgZrJc/mRDzZQ==" }, - "object-assign": { - "version": "4.1.1", - "resolved": "https://registry.npmjs.org/object-assign/-/object-assign-4.1.1.tgz", - "integrity": "sha1-IQmtx5ZYh8/AXLvUQsrIv7s2CGM=" - }, - "object-inspect": { - "version": "1.8.0", - "resolved": "https://registry.npmjs.org/object-inspect/-/object-inspect-1.8.0.tgz", - "integrity": "sha512-jLdtEOB112fORuypAyl/50VRVIBIdVQOSUUGQHzJ4xBSbit81zRarz7GThkEFZy1RceYrWYcPcBFPQwHyAc1gA==", - "dev": true - }, - "object-keys": { - "version": "1.1.1", - "resolved": "https://registry.npmjs.org/object-keys/-/object-keys-1.1.1.tgz", - "integrity": "sha512-NuAESUOUMrlIXOfHKzD6bpPu3tYt3xvjNdRIQ+FeT0lNb4K8WR70CaDxhuNguS2XG+GjkyMwOzsN5ZktImfhLA==", - "dev": true - }, - "object.assign": { - "version": "4.1.0", - "resolved": "https://registry.npmjs.org/object.assign/-/object.assign-4.1.0.tgz", - "integrity": "sha512-exHJeq6kBKj58mqGyTQ9DFvrZC/eR6OwxzoM9YRoGBqrXYonaFyGiFMuc9VZrXf7DarreEwMpurG3dd+CNyW5w==", - "dev": true, - "requires": { - "define-properties": "^1.1.2", - "function-bind": "^1.1.1", - "has-symbols": "^1.0.0", - "object-keys": "^1.0.11" - } - }, - "object.getownpropertydescriptors": { - "version": "2.1.0", - "resolved": "https://registry.npmjs.org/object.getownpropertydescriptors/-/object.getownpropertydescriptors-2.1.0.tgz", - "integrity": "sha512-Z53Oah9A3TdLoblT7VKJaTDdXdT+lQO+cNpKVnya5JDe9uLvzu1YyY1yFDFrcxrlRgWrEFH0jJtD/IbuwjcEVg==", - "dev": true, - "requires": { - "define-properties": "^1.1.3", - "es-abstract": "^1.17.0-next.1" - } - }, "on-finished": { "version": "2.3.0", "resolved": "https://registry.npmjs.org/on-finished/-/on-finished-2.3.0.tgz", @@ -5734,39 +4703,29 @@ "version": "1.4.0", "resolved": "https://registry.npmjs.org/once/-/once-1.4.0.tgz", "integrity": "sha1-WDsap3WWHUsROsF9nFC6753Xa9E=", + "dev": true, "requires": { "wrappy": "1" } }, - "os-homedir": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/os-homedir/-/os-homedir-1.0.2.tgz", - "integrity": "sha1-/7xJiDNuDoM94MFox+8VISGqf7M=" - }, "p-limit": { - "version": "2.3.0", - "resolved": "https://registry.npmjs.org/p-limit/-/p-limit-2.3.0.tgz", - "integrity": "sha512-//88mFWSJx8lxCzwdAABTJL2MyWB12+eIY7MDL2SqLmAkeKU9qxRvWuSyTjm3FUmpBEMuFfckAIqEaVGUDxb6w==", + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/p-limit/-/p-limit-3.1.0.tgz", + "integrity": "sha512-TYOanM3wGwNGsZN2cVTYPArw454xnXj5qmWF1bEoAc4+cU/ol7GVh7odevjp1FNHduHc3KZMcFduxU5Xc6uJRQ==", "dev": true, "requires": { - "p-try": "^2.0.0" + "yocto-queue": "^0.1.0" } }, "p-locate": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/p-locate/-/p-locate-3.0.0.tgz", - "integrity": "sha512-x+12w/To+4GFfgJhBEpiDcLozRJGegY+Ei7/z0tSLkMmxGZNybVMSfWj9aJn8Z5Fc7dBUNJOOVgPv2H7IwulSQ==", + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/p-locate/-/p-locate-5.0.0.tgz", + "integrity": "sha512-LaNjtRWUBY++zB5nE/NwcaoMylSPk+S+ZHNB1TzdbMJMny6dynpAGt7X/tl/QYq3TIeE6nxHppbo2LGymrG5Pw==", "dev": true, "requires": { - "p-limit": "^2.0.0" + "p-limit": "^3.0.2" } }, - "p-try": { - "version": "2.2.0", - "resolved": "https://registry.npmjs.org/p-try/-/p-try-2.2.0.tgz", - "integrity": "sha512-R4nPAVTAU0B9D35/Gk3uJf/7XYbQcyohSKdvAxIRSNghFl4e71hVoGnBNQz9cWaXxO2I10KTC+3jMdvvoKw6dQ==", - "dev": true - }, "passport": { "version": "0.4.1", "resolved": "https://registry.npmjs.org/passport/-/passport-0.4.1.tgz", @@ -5791,9 +4750,9 @@ "integrity": "sha1-tVOaqPwiWj0a0XlHbd8ja0QPUuQ=" }, "path-exists": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/path-exists/-/path-exists-3.0.0.tgz", - "integrity": "sha1-zg6+ql94yxiSXqfYENe1mwEP1RU=", + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/path-exists/-/path-exists-4.0.0.tgz", + "integrity": "sha512-ak9Qy5Q7jYb2Wwcey5Fpvg2KoAc/ZIhLSLOSBmRmygPsGwkVVt0fZa0qrtMz+m6tJTAHfZQ8FnmB4MG4LWy7/w==", "dev": true }, "path-is-absolute": { @@ -5825,9 +4784,9 @@ "integrity": "sha1-Ywn04OX6kT7BxpMHrjZLSzd8nns=" }, "picomatch": { - "version": "2.2.2", - "resolved": "https://registry.npmjs.org/picomatch/-/picomatch-2.2.2.tgz", - "integrity": "sha512-q0M/9eZHzmr0AulXyPwNfZjtwZ/RBZlbN3K3CErVrk50T2ASYI7Bye0EvekFY3IP1Nt2DHu0re+V2ZHIpMkuWg==", + "version": "2.3.0", + "resolved": "https://registry.npmjs.org/picomatch/-/picomatch-2.3.0.tgz", + "integrity": "sha512-lY1Q/PiJGC2zOv/z391WOTD+Z02bCgsFfvxoXXf6h7kv9o+WmsmzYqrAwY63sNgOxE4xEdq0WyUnXfKeBrSvYw==", "dev": true }, "pkginfo": { @@ -5835,52 +4794,16 @@ "resolved": "https://registry.npmjs.org/pkginfo/-/pkginfo-0.2.3.tgz", "integrity": "sha1-cjnEKl72wwuPMoQ52bn/cQQkkPg=" }, - "prebuild-install": { - "version": "2.5.3", - "resolved": "https://registry.npmjs.org/prebuild-install/-/prebuild-install-2.5.3.tgz", - "integrity": "sha512-/rI36cN2g7vDQnKWN8Uzupi++KjyqS9iS+/fpwG4Ea8d0Pip0PQ5bshUNzVwt+/D2MRfhVAplYMMvWLqWrCF/g==", - "requires": { - "detect-libc": "^1.0.3", - "expand-template": "^1.0.2", - "github-from-package": "0.0.0", - "minimist": "^1.2.0", - "mkdirp": "^0.5.1", - "node-abi": "^2.2.0", - "noop-logger": "^0.1.1", - "npmlog": "^4.0.1", - "os-homedir": "^1.0.1", - "pump": "^2.0.1", - "rc": "^1.1.6", - "simple-get": "^2.7.0", - "tar-fs": "^1.13.0", - "tunnel-agent": "^0.6.0", - "which-pm-runs": "^1.0.0" - } - }, "process-nextick-args": { "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==" }, - "pseudomap": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/pseudomap/-/pseudomap-1.0.2.tgz", - "integrity": "sha1-8FKijacOYYkX7wqKw0wa5aaChrM=" - }, "psl": { "version": "1.8.0", "resolved": "https://registry.npmjs.org/psl/-/psl-1.8.0.tgz", "integrity": "sha512-RIdOzyoavK+hA18OGGWDqUTsCLhtA7IcZ/6NCs4fFJaHBDab+pDDmDIByWFRQJq2Cd7r1OoQxBGKOaztq+hjIQ==" }, - "pump": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/pump/-/pump-2.0.1.tgz", - "integrity": "sha512-ruPMNRkN3MHP1cWJc9OWr+T/xDP0jhXYCLfJcBuX54hhfIBnaQmAUMfDcG4DM5UMWByBbJY69QSphm3jtDKIkA==", - "requires": { - "end-of-stream": "^1.1.0", - "once": "^1.3.1" - } - }, "punycode": { "version": "2.1.1", "resolved": "https://registry.npmjs.org/punycode/-/punycode-2.1.1.tgz", @@ -5957,17 +4880,6 @@ } } }, - "rc": { - "version": "1.2.8", - "resolved": "https://registry.npmjs.org/rc/-/rc-1.2.8.tgz", - "integrity": "sha512-y3bGgqKj3QBdxLbLkomlohkvsA8gdAiUQlSBJnBhfn+BPxg4bc62d8TcBW15wavDfgexCgccckhcZvywyQYPOw==", - "requires": { - "deep-extend": "^0.6.0", - "ini": "~1.3.0", - "minimist": "^1.2.0", - "strip-json-comments": "~2.0.1" - } - }, "readable-stream": { "version": "3.6.0", "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-3.6.0.tgz", @@ -5979,23 +4891,18 @@ } }, "readdirp": { - "version": "3.2.0", - "resolved": "https://registry.npmjs.org/readdirp/-/readdirp-3.2.0.tgz", - "integrity": "sha512-crk4Qu3pmXwgxdSgGhgA/eXiJAPQiX4GMOZZMXnqKxHX7TaoL+3gQVo/WeuAiogr07DpnfjIMpXXa+PAIvwPGQ==", + "version": "3.6.0", + "resolved": "https://registry.npmjs.org/readdirp/-/readdirp-3.6.0.tgz", + "integrity": "sha512-hOS089on8RduqdbhvQ5Z37A0ESjsqz6qnRcffsMU3495FuTdqSm+7bhJ29JvIOsBDEEnan5DPu9t3To9VRlMzA==", "dev": true, "requires": { - "picomatch": "^2.0.4" + "picomatch": "^2.2.1" } }, - "referrer-policy": { - "version": "1.2.0", - "resolved": "https://registry.npmjs.org/referrer-policy/-/referrer-policy-1.2.0.tgz", - "integrity": "sha512-LgQJIuS6nAy1Jd88DCQRemyE3mS+ispwlqMk3b0yjZ257fI1v9c+/p6SD5gP5FGyXUIgrNOAfmyioHwZtYv2VA==" - }, "regexparam": { - "version": "1.3.0", - "resolved": "https://registry.npmjs.org/regexparam/-/regexparam-1.3.0.tgz", - "integrity": "sha512-6IQpFBv6e5vz1QAqI+V4k8P2e/3gRrqfCJ9FI+O1FLQTO+Uz6RXZEZOPmTJ6hlGj7gkERzY5BRCv09whKP96/g==" + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/regexparam/-/regexparam-2.0.0.tgz", + "integrity": "sha512-gJKwd2MVPWHAIFLsaYDZfyKzHNS4o7E/v8YmNf44vmeV2e4YfVoDToTOKTvE7ab68cRJ++kLuEXJBaEeJVt5ow==" }, "request": { "version": "2.88.2", @@ -6065,12 +4972,6 @@ "integrity": "sha1-jGStX9MNqxyXbiNE/+f3kqam30I=", "dev": true }, - "require-main-filename": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/require-main-filename/-/require-main-filename-2.0.0.tgz", - "integrity": "sha512-NKN5kMDylKuldxYLSUfrbo5Tuzh4hd+2E8NPPX02mZtn1VuREQToYe/ZdlJy+J3uCpfaiGF05e7B8W0iXbQHmg==", - "dev": true - }, "ripemd160": { "version": "2.0.2", "resolved": "https://registry.npmjs.org/ripemd160/-/ripemd160-2.0.2.tgz", @@ -6128,10 +5029,14 @@ "resolved": "https://registry.npmjs.org/semver/-/semver-5.7.1.tgz", "integrity": "sha512-sauaDf/PZdVgrLTNYHRtpXa1iRiKcaebiKQ1BJdpQlWH2lCvexQdX55snPFyK7QzpudqbCI0qXFfOasHdyNDGQ==" }, - "set-blocking": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/set-blocking/-/set-blocking-2.0.0.tgz", - "integrity": "sha1-BF+XgtARrppoA93TgrJDkrPYkPc=" + "serialize-javascript": { + "version": "6.0.0", + "resolved": "https://registry.npmjs.org/serialize-javascript/-/serialize-javascript-6.0.0.tgz", + "integrity": "sha512-Qr3TosvguFt8ePWqsvRfrKyQXIiW+nGbYpy8XK24NQHE83caxWt+mIymTT19DGFbNWNLfEwsrkSmN64lVWB9ag==", + "dev": true, + "requires": { + "randombytes": "^2.1.0" + } }, "sha.js": { "version": "2.4.11", @@ -6142,65 +5047,55 @@ "safe-buffer": "^5.0.1" } }, - "signal-exit": { - "version": "3.0.3", - "resolved": "https://registry.npmjs.org/signal-exit/-/signal-exit-3.0.3.tgz", - "integrity": "sha512-VUJ49FC8U1OxwZLxIbTTrDvLnf/6TDgxZcK8wxR8zs13xpx7xbG60ndBlhNrFi2EMuFRoeDoJO7wthSLq42EjA==" - }, - "simple-concat": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/simple-concat/-/simple-concat-1.0.1.tgz", - "integrity": "sha512-cSFtAPtRhljv69IK0hTVZQ+OfE9nePi/rtJmw5UjHeVyVroEqJXP1sFztKUy1qU+xvz3u/sfYJLa947b7nAN2Q==" - }, - "simple-get": { - "version": "2.8.1", - "resolved": "https://registry.npmjs.org/simple-get/-/simple-get-2.8.1.tgz", - "integrity": "sha512-lSSHRSw3mQNUGPAYRqo7xy9dhKmxFXIjLjp4KHpf99GEH2VH7C3AM+Qfx6du6jhfUi6Vm7XnbEVEf7Wb6N8jRw==", - "requires": { - "decompress-response": "^3.3.0", - "once": "^1.3.1", - "simple-concat": "^1.0.0" - } - }, "sirv": { - "version": "1.0.11", - "resolved": "https://registry.npmjs.org/sirv/-/sirv-1.0.11.tgz", - "integrity": "sha512-SR36i3/LSWja7AJNRBz4fF/Xjpn7lQFI30tZ434dIy+bitLYSP+ZEenHg36i23V2SGEz+kqjksg0uOGZ5LPiqg==", + "version": "1.0.12", + "resolved": "https://registry.npmjs.org/sirv/-/sirv-1.0.12.tgz", + "integrity": "sha512-+jQoCxndz7L2tqQL4ZyzfDhky0W/4ZJip3XoOuxyQWnAwMxindLl3Xv1qT4x1YX/re0leShvTm8Uk0kQspGhBg==", "requires": { - "@polka/url": "^1.0.0-next.9", + "@polka/url": "^1.0.0-next.15", "mime": "^2.3.1", "totalist": "^1.0.0" } }, "smart-buffer": { - "version": "4.0.2", - "resolved": "https://registry.npmjs.org/smart-buffer/-/smart-buffer-4.0.2.tgz", - "integrity": "sha512-JDhEpTKzXusOqXZ0BUIdH+CjFdO/CR3tLlf5CN34IypI+xMmXW1uB16OOY8z3cICbJlDAVJzNbwBhNO0wt9OAw==" + "version": "4.1.0", + "resolved": "https://registry.npmjs.org/smart-buffer/-/smart-buffer-4.1.0.tgz", + "integrity": "sha512-iVICrxOzCynf/SNaBQCw34eM9jROU/s5rzIhpOvzhzuYHfJR/DhZfDkXiZSgKXfgv26HT3Yni3AV/DGw0cGnnw==" }, "socks": { - "version": "2.2.3", - "resolved": "https://registry.npmjs.org/socks/-/socks-2.2.3.tgz", - "integrity": "sha512-+2r83WaRT3PXYoO/1z+RDEBE7Z2f9YcdQnJ0K/ncXXbV5gJ6wYfNAebYFYiiUjM6E4JyXnPY8cimwyvFYHVUUA==", + "version": "2.6.1", + "resolved": "https://registry.npmjs.org/socks/-/socks-2.6.1.tgz", + "integrity": "sha512-kLQ9N5ucj8uIcxrDwjm0Jsqk06xdpBjGNQtpXy4Q8/QY2k+fY7nZH8CARy+hkbG+SGAovmzzuauCpBlb8FrnBA==", "requires": { "ip": "^1.1.5", - "smart-buffer": "4.0.2" + "smart-buffer": "^4.1.0" } }, "socks-proxy-agent": { - "version": "4.0.1", - "resolved": "https://registry.npmjs.org/socks-proxy-agent/-/socks-proxy-agent-4.0.1.tgz", - "integrity": "sha512-Kezx6/VBguXOsEe5oU3lXYyKMi4+gva72TwJ7pQY5JfqUx2nMk7NXA6z/mpNqIlfQjWYVfeuNvQjexiTaTn6Nw==", + "version": "6.0.0", + "resolved": "https://registry.npmjs.org/socks-proxy-agent/-/socks-proxy-agent-6.0.0.tgz", + "integrity": "sha512-FIgZbQWlnjVEQvMkylz64/rUggGtrKstPnx8OZyYFG0tAFR8CSBtpXxSwbFLHyeXFn/cunFL7MpuSOvDSOPo9g==", "requires": { - "agent-base": "~4.2.0", - "socks": "~2.2.0" + "agent-base": "^6.0.2", + "debug": "^4.3.1", + "socks": "^2.6.1" + }, + "dependencies": { + "debug": { + "version": "4.3.2", + "resolved": "https://registry.npmjs.org/debug/-/debug-4.3.2.tgz", + "integrity": "sha512-mOp8wKcvj7XxC78zLgw/ZA+6TSgkoE2C/ienthhRD298T7UNwAg9diBpLRxC0mOezLl4B0xV7M0cCO6P/O0Xhw==", + "requires": { + "ms": "2.1.2" + } + }, + "ms": { + "version": "2.1.2", + "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.2.tgz", + "integrity": "sha512-sGkPx+VjMtmA6MX27oA4FBFELFCZZ4S4XqeGOXCv68tT+jb3vk/RyaKWP0PTKyWtmLSM0b+adUTEvbs1PEaH2w==" + } } }, - "sprintf-js": { - "version": "1.0.3", - "resolved": "https://registry.npmjs.org/sprintf-js/-/sprintf-js-1.0.3.tgz", - "integrity": "sha1-BOaSb2YolTVPPdAVIDYzuFcpfiw=", - "dev": true - }, "sqlstring": { "version": "2.3.1", "resolved": "https://registry.npmjs.org/sqlstring/-/sqlstring-2.3.1.tgz", @@ -6239,117 +5134,29 @@ "version": "1.0.2", "resolved": "https://registry.npmjs.org/string-width/-/string-width-1.0.2.tgz", "integrity": "sha1-EYvfW4zcUaKn5w0hHgfisLmxB9M=", + "dev": true, "requires": { "code-point-at": "^1.0.0", "is-fullwidth-code-point": "^1.0.0", "strip-ansi": "^3.0.0" } }, - "string.prototype.trimend": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/string.prototype.trimend/-/string.prototype.trimend-1.0.1.tgz", - "integrity": "sha512-LRPxFUaTtpqYsTeNKaFOw3R4bxIzWOnbQ837QfBylo8jIxtcbK/A/sMV7Q+OAV/vWo+7s25pOE10KYSjaSO06g==", - "dev": true, - "requires": { - "define-properties": "^1.1.3", - "es-abstract": "^1.17.5" - } - }, - "string.prototype.trimstart": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/string.prototype.trimstart/-/string.prototype.trimstart-1.0.1.tgz", - "integrity": "sha512-XxZn+QpvrBI1FOcg6dIpxUPgWCPuNXvMD72aaRaUQv1eD4e/Qy8i/hFTe0BUmD60p/QA6bh1avmuPTfNjqVWRw==", - "dev": true, - "requires": { - "define-properties": "^1.1.3", - "es-abstract": "^1.17.5" - } - }, "strip-ansi": { "version": "3.0.1", "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-3.0.1.tgz", "integrity": "sha1-ajhfuIU9lS1f8F0Oiq+UJ43GPc8=", + "dev": true, "requires": { "ansi-regex": "^2.0.0" } }, - "strip-json-comments": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/strip-json-comments/-/strip-json-comments-2.0.1.tgz", - "integrity": "sha1-PFMZQukIwml8DsNEhYwobHygpgo=" - }, "supports-color": { - "version": "6.0.0", - "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-6.0.0.tgz", - "integrity": "sha512-on9Kwidc1IUQo+bQdhi8+Tijpo0e1SS6RoGo2guUwn5vdaxw8RXOF9Vb2ws+ihWOmh4JnCJOvaziZWP1VABaLg==", + "version": "8.1.1", + "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-8.1.1.tgz", + "integrity": "sha512-MpUEN2OodtUzxvKQl72cUF7RQ5EiHsGvSsVG0ia9c5RbWGL2CI4C7EpPS8UTBIplnlzZiNuV56w+FuNxy3ty2Q==", "dev": true, "requires": { - "has-flag": "^3.0.0" - } - }, - "tar-fs": { - "version": "1.16.3", - "resolved": "https://registry.npmjs.org/tar-fs/-/tar-fs-1.16.3.tgz", - "integrity": "sha512-NvCeXpYx7OsmOh8zIOP/ebG55zZmxLE0etfWRbWok+q2Qo8x/vOR/IJT1taADXPe+jsiu9axDb3X4B+iIgNlKw==", - "requires": { - "chownr": "^1.0.1", - "mkdirp": "^0.5.1", - "pump": "^1.0.0", - "tar-stream": "^1.1.2" - }, - "dependencies": { - "pump": { - "version": "1.0.3", - "resolved": "https://registry.npmjs.org/pump/-/pump-1.0.3.tgz", - "integrity": "sha512-8k0JupWme55+9tCVE+FS5ULT3K6AbgqrGa58lTT49RpyfwwcGedHqaC5LlQNdEAumn/wFsu6aPwkuPMioy8kqw==", - "requires": { - "end-of-stream": "^1.1.0", - "once": "^1.3.1" - } - } - } - }, - "tar-stream": { - "version": "1.6.2", - "resolved": "https://registry.npmjs.org/tar-stream/-/tar-stream-1.6.2.tgz", - "integrity": "sha512-rzS0heiNf8Xn7/mpdSVVSMAWAoy9bfb1WOTYC78Z0UQKeKa/CWS8FOq0lKGNa8DWKAn9gxjCvMLYc5PGXYlK2A==", - "requires": { - "bl": "^1.0.0", - "buffer-alloc": "^1.2.0", - "end-of-stream": "^1.0.0", - "fs-constants": "^1.0.0", - "readable-stream": "^2.3.0", - "to-buffer": "^1.1.1", - "xtend": "^4.0.0" - }, - "dependencies": { - "readable-stream": { - "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", - "isarray": "~1.0.0", - "process-nextick-args": "~2.0.0", - "safe-buffer": "~5.1.1", - "string_decoder": "~1.1.1", - "util-deprecate": "~1.0.1" - } - }, - "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==" - }, - "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==", - "requires": { - "safe-buffer": "~5.1.0" - } - } + "has-flag": "^4.0.0" } }, "tiny-secp256k1": { @@ -6364,11 +5171,6 @@ "nan": "^2.13.2" } }, - "to-buffer": { - "version": "1.1.1", - "resolved": "https://registry.npmjs.org/to-buffer/-/to-buffer-1.1.1.tgz", - "integrity": "sha512-lx9B5iv7msuFYE3dytT+KE5tap+rNYw+K4jVkb9R/asAb+pbBSM17jtunHplhBe6RRJdZx3Pn2Jph24O32mOVg==" - }, "to-regex-range": { "version": "5.0.1", "resolved": "https://registry.npmjs.org/to-regex-range/-/to-regex-range-5.0.1.tgz", @@ -6437,11 +5239,6 @@ "resolved": "https://registry.npmjs.org/typeforce/-/typeforce-1.18.0.tgz", "integrity": "sha512-7uc1O8h1M1g0rArakJdf0uLRSSgFcYexrVoKo+bzJd32gd4gDy2L/Z+8/FjPnU9ydY3pEnVPtr9FyscYY60K1g==" }, - "unorm": { - "version": "1.6.0", - "resolved": "https://registry.npmjs.org/unorm/-/unorm-1.6.0.tgz", - "integrity": "sha512-b2/KCUlYZUeA7JFUuRJZPUtr4gZvBh7tavtv4fvk4+KV9pfGiR6CQAQAWl49ZpR3ts2dk4FYkP7EIgDJoiOLDA==" - }, "unpipe": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/unpipe/-/unpipe-1.0.0.tgz", @@ -6474,9 +5271,9 @@ "integrity": "sha512-HjSDRw6gZE5JMggctHBcjVak08+KEVhSIiDzFnT9S9aegmp85S/bReBVTb4QTFaRNptJ9kuYaNhnbNEOkbKb/A==" }, "validator": { - "version": "10.8.0", - "resolved": "https://registry.npmjs.org/validator/-/validator-10.8.0.tgz", - "integrity": "sha512-mXqMxfCh5NLsVgYVKl9WvnHNDPCcbNppHSPPowu0VjtSsGWVY+z8hJF44edLR1nbLNzi3jYoYsIl8KZpioIk6g==" + "version": "13.6.0", + "resolved": "https://registry.npmjs.org/validator/-/validator-13.6.0.tgz", + "integrity": "sha512-gVgKbdbHgtxpRyR8K0O6oFZPhhB5tT1jeEHZR0Znr9Svg03U0+r9DXWMrnRAB+HtCStDQKlaIZm42tVsVjqtjg==" }, "varuint-bitcoin": { "version": "1.1.2", @@ -6510,29 +5307,19 @@ } }, "which": { - "version": "1.3.1", - "resolved": "https://registry.npmjs.org/which/-/which-1.3.1.tgz", - "integrity": "sha512-HxJdYWq1MTIQbJ3nw0cqssHoTNU267KlrDuGZ1WYlxDStUtKUhOaJmh112/TZmHxxUfuJqPXSOm7tDyas0OSIQ==", + "version": "2.0.2", + "resolved": "https://registry.npmjs.org/which/-/which-2.0.2.tgz", + "integrity": "sha512-BLI3Tl1TW3Pvl70l3yq3Y64i+awpwXqsGBYWkkqMtnbXgrMD+yj7rhW0kuEDxzJaYXGjEW5ogapKNMEKNMjibA==", "dev": true, "requires": { "isexe": "^2.0.0" } }, - "which-module": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/which-module/-/which-module-2.0.0.tgz", - "integrity": "sha1-2e8H3Od7mQK4o6j6SzHD4/fm6Ho=", - "dev": true - }, - "which-pm-runs": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/which-pm-runs/-/which-pm-runs-1.0.0.tgz", - "integrity": "sha1-Zws6+8VS4LVd9rd4DKdGFfI60cs=" - }, "wide-align": { "version": "1.1.3", "resolved": "https://registry.npmjs.org/wide-align/-/wide-align-1.1.3.tgz", "integrity": "sha512-QGkOQc8XL6Bt5PwnsExKBPuMKBxnGxWWW3fU55Xt4feHozMUhdUMaBCk290qpm/wG5u/RSKzwdAC4i51YigihA==", + "dev": true, "requires": { "string-width": "^1.0.2 || 2" } @@ -6546,51 +5333,51 @@ } }, "workerpool": { - "version": "6.1.4", - "resolved": "https://registry.npmjs.org/workerpool/-/workerpool-6.1.4.tgz", - "integrity": "sha512-jGWPzsUqzkow8HoAvqaPWTUPCrlPJaJ5tY8Iz7n1uCz3tTp6s3CDG0FF1NsX42WNlkRSW6Mr+CDZGnNoSsKa7g==" + "version": "6.1.5", + "resolved": "https://registry.npmjs.org/workerpool/-/workerpool-6.1.5.tgz", + "integrity": "sha512-XdKkCK0Zqc6w3iTxLckiuJ81tiD/o5rBE/m+nXpRCB+/Sq4DqkfXZ/x0jW02DG1tGsfUGXbTJyZDP+eu67haSw==" }, "wrap-ansi": { - "version": "5.1.0", - "resolved": "https://registry.npmjs.org/wrap-ansi/-/wrap-ansi-5.1.0.tgz", - "integrity": "sha512-QC1/iN/2/RPVJ5jYK8BGttj5z83LmSKmvbvrXPNCLZSEb32KKVDJDl/MOt2N01qU2H/FkzEa9PKto1BqDjtd7Q==", + "version": "7.0.0", + "resolved": "https://registry.npmjs.org/wrap-ansi/-/wrap-ansi-7.0.0.tgz", + "integrity": "sha512-YVGIj2kamLSTxw6NsZjoBxfSwsn0ycdesmc4p+Q21c5zPuZ1pl+NfxVdxPtdHvmNVOQ6XSYG4AUtyt/Fi7D16Q==", "dev": true, "requires": { - "ansi-styles": "^3.2.0", - "string-width": "^3.0.0", - "strip-ansi": "^5.0.0" + "ansi-styles": "^4.0.0", + "string-width": "^4.1.0", + "strip-ansi": "^6.0.0" }, "dependencies": { "ansi-regex": { - "version": "4.1.0", - "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-4.1.0.tgz", - "integrity": "sha512-1apePfXM1UOSqw0o9IiFAovVz9M5S1Dg+4TrDwfMewQ6p/rmMueb7tWZjQ1rx4Loy1ArBggoqGpfqqdI4rondg==", + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-5.0.0.tgz", + "integrity": "sha512-bY6fj56OUQ0hU1KjFNDQuJFezqKdrAyFdIevADiqrWHwSlbmBNMHp5ak2f40Pm8JTFyM2mqxkG6ngkHO11f/lg==", "dev": true }, "is-fullwidth-code-point": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/is-fullwidth-code-point/-/is-fullwidth-code-point-2.0.0.tgz", - "integrity": "sha1-o7MKXE8ZkYMWeqq5O+764937ZU8=", + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/is-fullwidth-code-point/-/is-fullwidth-code-point-3.0.0.tgz", + "integrity": "sha512-zymm5+u+sCsSWyD9qNaejV3DFvhCKclKdizYaJUuHA83RLjb7nSuGnddCHGv0hk+KY7BMAlsWeK4Ueg6EV6XQg==", "dev": true }, "string-width": { - "version": "3.1.0", - "resolved": "https://registry.npmjs.org/string-width/-/string-width-3.1.0.tgz", - "integrity": "sha512-vafcv6KjVZKSgz06oM/H6GDBrAtz8vdhQakGjFIvNrHA6y3HCF1CInLy+QLq8dTJPQ1b+KDUqDFctkdRW44e1w==", + "version": "4.2.2", + "resolved": "https://registry.npmjs.org/string-width/-/string-width-4.2.2.tgz", + "integrity": "sha512-XBJbT3N4JhVumXE0eoLU9DCjcaF92KLNqTmFCnG1pf8duUxFGwtP6AD6nkjw9a3IdiRtL3E2w3JDiE/xi3vOeA==", "dev": true, "requires": { - "emoji-regex": "^7.0.1", - "is-fullwidth-code-point": "^2.0.0", - "strip-ansi": "^5.1.0" + "emoji-regex": "^8.0.0", + "is-fullwidth-code-point": "^3.0.0", + "strip-ansi": "^6.0.0" } }, "strip-ansi": { - "version": "5.2.0", - "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-5.2.0.tgz", - "integrity": "sha512-DuRs1gKbBqsMKIZlrffwlug8MHkcnpjs5VPmL1PAh+mA30U0DTotfDZ0d2UUsXpPmPmMMJ6W773MaA3J+lbiWA==", + "version": "6.0.0", + "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-6.0.0.tgz", + "integrity": "sha512-AuvKTrTfQNYNIctbR1K/YGTR1756GycPsg7b9bdV9Duqur4gv6aKqHXah67Z8ImS7WEz5QVcOtlfW2rZEugt6w==", "dev": true, "requires": { - "ansi-regex": "^4.1.0" + "ansi-regex": "^5.0.0" } } } @@ -6598,22 +5385,13 @@ "wrappy": { "version": "1.0.2", "resolved": "https://registry.npmjs.org/wrappy/-/wrappy-1.0.2.tgz", - "integrity": "sha1-tSQ9jz7BqjXxNkYFvA0QNuMKtp8=" - }, - "x-xss-protection": { - "version": "1.3.0", - "resolved": "https://registry.npmjs.org/x-xss-protection/-/x-xss-protection-1.3.0.tgz", - "integrity": "sha512-kpyBI9TlVipZO4diReZMAHWtS0MMa/7Kgx8hwG/EuZLiA6sg4Ah/4TRdASHhRRN3boobzcYgFRUFSgHRge6Qhg==" - }, - "xtend": { - "version": "4.0.2", - "resolved": "https://registry.npmjs.org/xtend/-/xtend-4.0.2.tgz", - "integrity": "sha512-LKYU1iAXJXUgAXn9URjiu+MWhyUXHsvfp7mcuYm9dSUKK0/CjtrUwFAxD82/mCWbtLsGjFIad0wIsod4zrTAEQ==" + "integrity": "sha1-tSQ9jz7BqjXxNkYFvA0QNuMKtp8=", + "dev": true }, "y18n": { - "version": "4.0.3", - "resolved": "https://registry.npmjs.org/y18n/-/y18n-4.0.3.tgz", - "integrity": "sha512-JKhqTOwSrqNA1NY5lSztJ1GrBiUodLMmIZuLiDaMRJ+itFd+ABVE8XBjOvIWL+rSqNDC74LCSFmlb/U4UZ4hJQ==", + "version": "5.0.8", + "resolved": "https://registry.npmjs.org/y18n/-/y18n-5.0.8.tgz", + "integrity": "sha512-0pfFzegeDWJHJIAmTLRP2DwHjdF5s7jo9tuztdQxAhINCdvS+3nGINqPd00AphqJR/0LhANUS6/+7SCb98YOfA==", "dev": true }, "yaeti": { @@ -6622,90 +5400,89 @@ "integrity": "sha1-8m9ITXJoTPQr7ft2lwqhYI+/lXc=" }, "yallist": { - "version": "2.1.2", - "resolved": "https://registry.npmjs.org/yallist/-/yallist-2.1.2.tgz", - "integrity": "sha1-HBH5IY8HYImkfdUS+TxmmaaoHVI=" + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/yallist/-/yallist-4.0.0.tgz", + "integrity": "sha512-3wdGidZyq5PB084XLES5TpOSRA3wjXAlIWMhum2kRcv/41Sn2emQ0dycQW4uZXLejwKvg6EsvbdlVL+FYEct7A==" }, "yargs": { - "version": "13.3.2", - "resolved": "https://registry.npmjs.org/yargs/-/yargs-13.3.2.tgz", - "integrity": "sha512-AX3Zw5iPruN5ie6xGRIDgqkT+ZhnRlZMLMHAs8tg7nRruy2Nb+i5o9bwghAogtM08q1dpr2LVoS8KSTMYpWXUw==", + "version": "16.2.0", + "resolved": "https://registry.npmjs.org/yargs/-/yargs-16.2.0.tgz", + "integrity": "sha512-D1mvvtDG0L5ft/jGWkLpG1+m0eQxOfaBvTNELraWj22wSVUMWxZUvYgJYcKh6jGGIkJFhH4IZPQhR4TKpc8mBw==", "dev": true, "requires": { - "cliui": "^5.0.0", - "find-up": "^3.0.0", - "get-caller-file": "^2.0.1", + "cliui": "^7.0.2", + "escalade": "^3.1.1", + "get-caller-file": "^2.0.5", "require-directory": "^2.1.1", - "require-main-filename": "^2.0.0", - "set-blocking": "^2.0.0", - "string-width": "^3.0.0", - "which-module": "^2.0.0", - "y18n": "^4.0.0", - "yargs-parser": "^13.1.2" + "string-width": "^4.2.0", + "y18n": "^5.0.5", + "yargs-parser": "^20.2.2" }, "dependencies": { "ansi-regex": { - "version": "4.1.0", - "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-4.1.0.tgz", - "integrity": "sha512-1apePfXM1UOSqw0o9IiFAovVz9M5S1Dg+4TrDwfMewQ6p/rmMueb7tWZjQ1rx4Loy1ArBggoqGpfqqdI4rondg==", + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-5.0.0.tgz", + "integrity": "sha512-bY6fj56OUQ0hU1KjFNDQuJFezqKdrAyFdIevADiqrWHwSlbmBNMHp5ak2f40Pm8JTFyM2mqxkG6ngkHO11f/lg==", "dev": true }, "is-fullwidth-code-point": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/is-fullwidth-code-point/-/is-fullwidth-code-point-2.0.0.tgz", - "integrity": "sha1-o7MKXE8ZkYMWeqq5O+764937ZU8=", + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/is-fullwidth-code-point/-/is-fullwidth-code-point-3.0.0.tgz", + "integrity": "sha512-zymm5+u+sCsSWyD9qNaejV3DFvhCKclKdizYaJUuHA83RLjb7nSuGnddCHGv0hk+KY7BMAlsWeK4Ueg6EV6XQg==", "dev": true }, "string-width": { - "version": "3.1.0", - "resolved": "https://registry.npmjs.org/string-width/-/string-width-3.1.0.tgz", - "integrity": "sha512-vafcv6KjVZKSgz06oM/H6GDBrAtz8vdhQakGjFIvNrHA6y3HCF1CInLy+QLq8dTJPQ1b+KDUqDFctkdRW44e1w==", + "version": "4.2.2", + "resolved": "https://registry.npmjs.org/string-width/-/string-width-4.2.2.tgz", + "integrity": "sha512-XBJbT3N4JhVumXE0eoLU9DCjcaF92KLNqTmFCnG1pf8duUxFGwtP6AD6nkjw9a3IdiRtL3E2w3JDiE/xi3vOeA==", "dev": true, "requires": { - "emoji-regex": "^7.0.1", - "is-fullwidth-code-point": "^2.0.0", - "strip-ansi": "^5.1.0" + "emoji-regex": "^8.0.0", + "is-fullwidth-code-point": "^3.0.0", + "strip-ansi": "^6.0.0" } }, "strip-ansi": { - "version": "5.2.0", - "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-5.2.0.tgz", - "integrity": "sha512-DuRs1gKbBqsMKIZlrffwlug8MHkcnpjs5VPmL1PAh+mA30U0DTotfDZ0d2UUsXpPmPmMMJ6W773MaA3J+lbiWA==", + "version": "6.0.0", + "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-6.0.0.tgz", + "integrity": "sha512-AuvKTrTfQNYNIctbR1K/YGTR1756GycPsg7b9bdV9Duqur4gv6aKqHXah67Z8ImS7WEz5QVcOtlfW2rZEugt6w==", "dev": true, "requires": { - "ansi-regex": "^4.1.0" + "ansi-regex": "^5.0.0" } } } }, "yargs-parser": { - "version": "13.1.2", - "resolved": "https://registry.npmjs.org/yargs-parser/-/yargs-parser-13.1.2.tgz", - "integrity": "sha512-3lbsNRf/j+A4QuSZfDRA7HRSfWrzO0YjqTJd5kjAq37Zep1CEgaYmrH9Q3GwPiB9cHyd1Y1UwggGhJGoxipbzg==", - "dev": true, - "requires": { - "camelcase": "^5.0.0", - "decamelize": "^1.2.0" - } + "version": "20.2.4", + "resolved": "https://registry.npmjs.org/yargs-parser/-/yargs-parser-20.2.4.tgz", + "integrity": "sha512-WOkpgNhPTlE73h4VFAFsOnomJVaovO8VqLDzy5saChRBFQFBoMYirowyW+Q9HB4HFF4Z7VZTiG3iSzJJA29yRA==", + "dev": true }, "yargs-unparser": { - "version": "1.6.0", - "resolved": "https://registry.npmjs.org/yargs-unparser/-/yargs-unparser-1.6.0.tgz", - "integrity": "sha512-W9tKgmSn0DpSatfri0nx52Joq5hVXgeLiqR/5G0sZNDoLZFOr/xjBUDcShCOGNsBnEMNo1KAMBkTej1Hm62HTw==", + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/yargs-unparser/-/yargs-unparser-2.0.0.tgz", + "integrity": "sha512-7pRTIA9Qc1caZ0bZ6RYRGbHJthJWuakf+WmHK0rVeLkNrrGhfoabBNdue6kdINI6r4if7ocq9aD/n7xwKOdzOA==", "dev": true, "requires": { - "flat": "^4.1.0", - "lodash": "^4.17.15", - "yargs": "^13.3.0" + "camelcase": "^6.0.0", + "decamelize": "^4.0.0", + "flat": "^5.0.2", + "is-plain-obj": "^2.1.0" } }, + "yocto-queue": { + "version": "0.1.0", + "resolved": "https://registry.npmjs.org/yocto-queue/-/yocto-queue-0.1.0.tgz", + "integrity": "sha512-rVksvsnNCdJ/ohGc6xgPwyN8eheCxsiLM8mxuE/t/mOVqJewPuO1miLpTHQiRgTKCLexL4MeAFVagts7HmNZ2Q==", + "dev": true + }, "zeromq": { - "version": "4.2.0", - "resolved": "https://registry.npmjs.org/zeromq/-/zeromq-4.2.0.tgz", - "integrity": "sha1-4RMzBd9zyE+MffBgqOKzA7THLX8=", + "version": "6.0.0-beta.5", + "resolved": "https://registry.npmjs.org/zeromq/-/zeromq-6.0.0-beta.5.tgz", + "integrity": "sha512-zsSbjfLjDxQq/Mp6NemNK/AVpm1NeafJRgz7nos1nV9MI/3w/P76pFdlqzxRTW4cuNqyFXJ4Q7g2tUhaZi4rcg==", "requires": { - "nan": "^2.4.0", - "prebuild-install": "^2.1.1" + "node-gyp-build": "^4.1.0" } } } diff --git a/package.json b/package.json index c689d25..3b4381e 100644 --- a/package.json +++ b/package.json @@ -1,8 +1,11 @@ { "name": "samourai-dojo", - "version": "1.10.1", + "version": "1.11.0", "description": "Backend server for Samourai Wallet", "main": "accounts/index.js", + "engines": { + "node": "14.x.x" + }, "scripts": { "test": "mocha --recursive --reporter spec" }, @@ -14,31 +17,32 @@ "license": "AGPL-3.0-only", "homepage": "https://code.samourai.io/dojo/samourai-dojo", "dependencies": { - "@tinyhttp/app": "1.3.3", - "async-sema": "2.1.2", + "@tinyhttp/app": "1.3.13", + "async-sema": "3.1.0", "axios": "0.21.1", - "bip39": "2.4.0", + "bip39": "3.0.4", "bitcoinjs-lib": "5.2.0", - "bitcoinjs-message": "1.0.1", + "bitcoinjs-message": "2.2.0", "body-parser": "1.19.0", - "helmet": "3.23.3", + "helmet": "4.6.0", "jsonwebtoken": "8.5.1", "lodash": "4.17.21", - "lru-cache": "4.0.2", + "lru-cache": "6.0.0", "make-concurrent": "5.3.0", "minimist": "1.2.5", "mysql": "2.18.1", + "nocache": "3.0.1", "passport": "0.4.1", "passport-localapikey-update": "0.6.0", "rpc-bitcoin": "2.0.0", - "sirv": "1.0.11", - "socks-proxy-agent": "4.0.1", - "validator": "10.8.0", + "sirv": "1.0.12", + "socks-proxy-agent": "6.0.0", + "validator": "13.6.0", "websocket": "1.0.34", - "workerpool": "6.1.4", - "zeromq": "4.2.0" + "workerpool": "6.1.5", + "zeromq": "6.0.0-beta.5" }, "devDependencies": { - "mocha": "^7.1.1" + "mocha": "9.0.3" } } diff --git a/pushtx/orchestrator.js b/pushtx/orchestrator.js index 8c87931..b00bdf0 100644 --- a/pushtx/orchestrator.js +++ b/pushtx/orchestrator.js @@ -4,8 +4,8 @@ */ 'use strict' -const zmq = require('zeromq') -const Sema = require('async-sema') +const zmq = require('zeromq/v5-compat') +const { Sema } = require('async-sema') const Logger = require('../lib/logger') const db = require('../lib/db/mysql-db-wrapper') const { createRpcClient, isConnectionError } = require('../lib/bitcoind-rpc/rpc-client') @@ -94,7 +94,7 @@ class Orchestrator { break for (let tx of txs) { - let hasParentTx = (tx.schParentTxid != null) && (tx.schParentTxid != '') + let hasParentTx = (tx.schParentTxid != null) && (tx.schParentTxid !== '') let parentTx = null // Check if previous transaction has been confirmed @@ -158,11 +158,11 @@ class Orchestrator { /** * Update triggers in chain of transactions * following a transaction identified by its txid - * @param {integer} parentId - parent id - * @param {integer} shift - delta to be added to the triggers + * @param {number} parentId - parent id + * @param {number} shift - delta to be added to the triggers */ async updateTriggers(parentId, shift) { - if (shift == 0) + if (shift === 0) return const txs = await db.getNextScheduledTransactions(parentId) diff --git a/pushtx/pushtx-processor.js b/pushtx/pushtx-processor.js index 11766e6..c2934bf 100644 --- a/pushtx/pushtx-processor.js +++ b/pushtx/pushtx-processor.js @@ -5,7 +5,7 @@ 'use strict' const bitcoin = require('bitcoinjs-lib') -const zmq = require('zeromq') +const zmq = require('zeromq/v5-compat') const Logger = require('../lib/logger') const errors = require('../lib/errors') const db = require('../lib/db/mysql-db-wrapper') @@ -17,7 +17,7 @@ const keys = require('../keys')[network.key] const status = require('./status') let Sources -if (network.key == 'bitcoin') { +if (network.key === 'bitcoin') { Sources = require('../lib/remote-importer/sources-mainnet') } else { Sources = require('../lib/remote-importer/sources-testnet') @@ -46,7 +46,7 @@ class PushTxProcessor { initNotifications(config) { // Notification socket for the tracker this.notifSock = zmq.socket('pub') - this.notifSock.bindSync(config.uriSocket) + this.notifSock.bind(config.uriSocket) } /** @@ -78,7 +78,7 @@ class PushTxProcessor { } // Checks with indexer if addresses are known and have been used if (Object.keys(addrMap).length > 0) { - if (keys.indexer.active != 'local_bitcoind') { + if (keys.indexer.active !== 'local_bitcoind') { const results = await this.sources.getAddresses(Object.keys(addrMap)) for (let r of results) if (r.ntx > 0) diff --git a/pushtx/pushtx-rest-api.js b/pushtx/pushtx-rest-api.js index fe257d8..9d94855 100644 --- a/pushtx/pushtx-rest-api.js +++ b/pushtx/pushtx-rest-api.js @@ -193,7 +193,7 @@ class PushTxRestApi { HttpServer.sendOk(res) } catch(e) { // Returns code 200 if VIOLATION_STRICT_MODE_VOUTS - if (e.message && e.message.code && e.message.code == errors.pushtx.VIOLATION_STRICT_MODE_VOUTS) { + if (e.message && e.message.code && e.message.code === errors.pushtx.VIOLATION_STRICT_MODE_VOUTS) { e.message = JSON.stringify(e.message) this._traceError(res, e, 200) } else { @@ -206,7 +206,7 @@ class PushTxRestApi { * Trace an error during push * @param {object} res - http response object * @param {object} err - error object - * @param {int} errorCode - error code (optional) + * @param {number} errorCode - error code (optional) */ _traceError(res, err, errorCode) { let ret = null diff --git a/pushtx/transactions-scheduler.js b/pushtx/transactions-scheduler.js index 00b845c..177d2bf 100644 --- a/pushtx/transactions-scheduler.js +++ b/pushtx/transactions-scheduler.js @@ -68,13 +68,13 @@ class TransactionsScheduler { // Decode the transaction const tx = bitcoin.Transaction.fromHex(entry.tx) // Check that nlocktimes are matching - if (!(tx.locktime && tx.locktime == entry.nlocktime)) { + if (!(tx.locktime && tx.locktime === entry.nlocktime)) { const msg = `TransactionsScheduler.schedule() : nLockTime mismatch : ${tx.locktime} - ${entry.nlocktime}` Logger.error(null, `PushTx : ${msg}`) throw errors.pushtx.NLOCK_MISMATCH } // Check that order of hop and nlocktime values are consistent - if (entry.hop != lastHopProcessed) { + if (entry.hop !== lastHopProcessed) { if (entry.nlocktime < lastLockTimeProcessed) throw errors.pushtx.SCHEDULED_BAD_ORDER } @@ -105,7 +105,7 @@ class TransactionsScheduler { lastHopProcessed = entry.hop lastLockTimeProcessed = entry.nlocktime // Update scheduled height if needed - if (baseHeight != nltTx0) + if (baseHeight !== nltTx0) entry.nlocktime = baseHeight + entry.delta } @@ -123,7 +123,7 @@ class TransactionsScheduler { let parentNlocktime = baseHeight // Check if first transactions should be sent immediately - while ((script.length > 0) && (script[0].nlocktime <= lastHeight) && (script[0].delta == 0)) { + while ((script.length > 0) && (script[0].nlocktime <= lastHeight) && (script[0].delta === 0)) { await pushTxProcessor.pushTx(script[0].tx) const tx = bitcoin.Transaction.fromHex(script[0].tx) parentTxid = tx.getId() diff --git a/scripts/patches/revert-hd-accounts.js b/scripts/patches/revert-hd-accounts.js index efdd3de..5016c62 100644 --- a/scripts/patches/revert-hd-accounts.js +++ b/scripts/patches/revert-hd-accounts.js @@ -21,9 +21,9 @@ function xlatXPUB(xpub) { let xlatVer = 0 - if (ver == hdaHelper.MAGIC_XPUB || ver == hdaHelper.MAGIC_YPUB || ver == hdaHelper.MAGIC_ZPUB) { - xlatVer = hdaHelper.MAGIC_XPUB - } else if (ver == hdaHelper.MAGIC_TPUB || ver == hdaHelper.MAGIC_UPUB || ver == hdaHelper.MAGIC_VPUB) { + if (ver === hdaHelper.MAGIC_XPUB || ver === hdaHelper.MAGIC_YPUB || ver === hdaHelper.MAGIC_ZPUB) { + xlatVer = hdaHelper.MAGIC_XPUB + } else if (ver === hdaHelper.MAGIC_TPUB || ver === hdaHelper.MAGIC_UPUB || ver === hdaHelper.MAGIC_VPUB) { xlatVer = hdaHelper.MAGIC_TPUB } @@ -75,8 +75,8 @@ async function run() { const xpub = account.hdXpub const info = hdaHelper.classify(account.hdType) const scheme = info.type - - if ((scheme == hdaHelper.BIP49) || (scheme == hdaHelper.BIP84)) { + + if ((scheme === hdaHelper.BIP49) || (scheme === hdaHelper.BIP84)) { try { const xlatedXpub = xlatXPUB(xpub) await updateHdAccount(hdId, xlatedXpub) @@ -90,7 +90,7 @@ async function run() { } catch(e) { console.log('A problem was met') console.log(e) - } + } } /** @@ -102,4 +102,4 @@ const startupTimeout = setTimeout(async function() { return run().then(() => { console.log('Process completed') }) -}, 1500) \ No newline at end of file +}, 1500) diff --git a/scripts/patches/translate-hd-accounts.js b/scripts/patches/translate-hd-accounts.js index b1891c2..6a05baa 100644 --- a/scripts/patches/translate-hd-accounts.js +++ b/scripts/patches/translate-hd-accounts.js @@ -21,18 +21,18 @@ function xlatXPUB(xpub, targetType) { let xlatVer = 0 - if (ver == hdaHelper.MAGIC_XPUB) { + if (ver === hdaHelper.MAGIC_XPUB) { - if (targetType == hdaHelper.BIP49) + if (targetType === hdaHelper.BIP49) xlatVer = hdaHelper.MAGIC_YPUB - else if (targetType == hdaHelper.BIP84) + else if (targetType === hdaHelper.BIP84) xlatVer = hdaHelper.MAGIC_ZPUB - } else if (ver == hdaHelper.MAGIC_TPUB) { + } else if (ver === hdaHelper.MAGIC_TPUB) { - if (targetType == hdaHelper.BIP49) + if (targetType === hdaHelper.BIP49) xlatVer = hdaHelper.MAGIC_UPUB - else if (targetType == hdaHelper.BIP84) + else if (targetType === hdaHelper.BIP84) xlatVer = hdaHelper.MAGIC_VPUB } @@ -84,8 +84,8 @@ async function run() { const xpub = account.hdXpub const info = hdaHelper.classify(account.hdType) const scheme = info.type - - if ((scheme == hdaHelper.BIP49) || (scheme == hdaHelper.BIP84)) { + + if ((scheme === hdaHelper.BIP49) || (scheme === hdaHelper.BIP84)) { const xlatedXpub = xlatXPUB(xpub, scheme) await updateHdAccount(hdId, xlatedXpub) console.log(`Updated ${hdId} (${xpub} => ${xlatedXpub})`) @@ -94,7 +94,7 @@ async function run() { } catch(e) { console.log('A problem was met') console.log(e) - } + } } /** @@ -106,4 +106,4 @@ const startupTimeout = setTimeout(async function() { return run().then(() => { console.log('Process completed') }) -}, 1500) \ No newline at end of file +}, 1500) diff --git a/static/admin/dmt/index.js b/static/admin/dmt/index.js index a0396e9..2bd846d 100644 --- a/static/admin/dmt/index.js +++ b/static/admin/dmt/index.js @@ -84,7 +84,7 @@ function preparePage() { const activeTab = sessionStorage.getItem('activeTab') for (let idxTab in tabs) { const screen = screens[idxTab] - if (tabs[idxTab] == activeTab) { + if (tabs[idxTab] === activeTab) { $(screen).show() if (screenScripts.has(screen)) screenScripts.get(screen).preparePage() diff --git a/static/admin/dmt/status/status.js b/static/admin/dmt/status/status.js index 1075172..3e93550 100644 --- a/static/admin/dmt/status/status.js +++ b/static/admin/dmt/status/status.js @@ -95,7 +95,7 @@ const statusScript = { this.chaintipBitcoind = data['bitcoind']['blocks'] $('#node-chaintip').text(data['bitcoind']['blocks']) $('#node-version').text(data['bitcoind']['version']) - const network = data['bitcoind']['testnet'] == true ? 'testnet' : 'mainnet' + const network = data['bitcoind']['testnet'] === true ? 'testnet' : 'mainnet' $('#node-network').text(network) $('#node-conn').text(data['bitcoind']['conn']) $('#node-relay-fee').text(data['bitcoind']['relayfee']) @@ -123,13 +123,13 @@ const statusScript = { }, setStatusIndicator: function(id, status) { - if (status == 'ok') { + if (status === 'ok') { $(id).html('✓') $(id).css('color', '#76d776') - } else if (status == 'ko') { + } else if (status === 'ko') { $(id).html('X') $(id).css('color', '#f77c7c') - } else if (status == 'desynchronized') { + } else if (status === 'desynchronized') { $(id).html('✓') $(id).css('color', '#f0c649') } else { @@ -140,4 +140,4 @@ const statusScript = { } -screenScripts.set('#screen-status', statusScript) \ No newline at end of file +screenScripts.set('#screen-status', statusScript) diff --git a/static/admin/dmt/txs-tools/txs-tools.js b/static/admin/dmt/txs-tools/txs-tools.js index 6bf7f0e..1949872 100644 --- a/static/admin/dmt/txs-tools/txs-tools.js +++ b/static/admin/dmt/txs-tools/txs-tools.js @@ -59,7 +59,7 @@ const screenTxsToolsScript = { $('#txid-value').text(this.currentTxid) $('#txid-value').attr('href', txUrl) - const firstseen = lib_fmt.unixTsToLocaleString(txInfo['created']) + const firstseen = txInfo['created'] ? lib_fmt.unixTsToLocaleString(txInfo['created']) : '--' $('#tx-firstseen').text(firstseen) if (txInfo.hasOwnProperty('block')) diff --git a/static/admin/dmt/xpubs-tools/xpubs-tools.js b/static/admin/dmt/xpubs-tools/xpubs-tools.js index 20d93cc..5ad5ec8 100644 --- a/static/admin/dmt/xpubs-tools/xpubs-tools.js +++ b/static/admin/dmt/xpubs-tools/xpubs-tools.js @@ -31,8 +31,8 @@ const screenXpubsToolsScript = { preparePage: function() { // Disable custom lookahead if data source is a third party explorer - const isTPE = sessionStorage.getItem('indexerType') == 'third_party_explorer' - const isLRI = sessionStorage.getItem('indexerType') == 'local_rest_indexer' + const isTPE = sessionStorage.getItem('indexerType') === 'third_party_explorer' + const isLRI = sessionStorage.getItem('indexerType') === 'local_rest_indexer' const disableLookahead = isTPE || isLRI $('#rescan-lookahead').prop('disabled', disableLookahead) @@ -99,9 +99,9 @@ const screenXpubsToolsScript = { } const derivType = $('#import-deriv-type').val() - if (derivType == 'bip49' || derivType == 'bip84') { + if (derivType === 'bip49' || derivType === 'bip84') { jsonData['segwit'] = derivType - } else if (derivType == 'auto') { + } else if (derivType === 'auto') { if (this.currentXpub.startsWith('ypub')) jsonData['segwit'] = 'bip49' else if (this.currentXpub.startsWith('zpub')) diff --git a/static/admin/lib/auth-utils.js b/static/admin/lib/auth-utils.js index e17557b..bb894ea 100644 --- a/static/admin/lib/auth-utils.js +++ b/static/admin/lib/auth-utils.js @@ -98,7 +98,7 @@ const lib_auth = { isAuthenticated: function() { // Checks that an access token is stored in session storage let token = this.getAccessToken() - return (token && (token != 'null')) ? true : false + return Boolean(token && (token !== 'null')) }, /* @@ -128,7 +128,7 @@ const lib_auth = { const payload = this.getPayloadAccessToken(token) if (!payload) return false - return (('prf' in payload) && (payload['prf'] == this.TOKEN_PROFILE_ADMIN)) + return (('prf' in payload) && (payload['prf'] === this.TOKEN_PROFILE_ADMIN)) }, /* diff --git a/static/admin/lib/common-script.js b/static/admin/lib/common-script.js index 127884c..8f66b92 100644 --- a/static/admin/lib/common-script.js +++ b/static/admin/lib/common-script.js @@ -27,9 +27,9 @@ const lib_cmn = { getExplorerTxUrl: function(txid, explorerInfo) { if (explorerInfo == null) return null - else if (explorerInfo['pairing']['type'] == 'explorer.oxt') + else if (explorerInfo['pairing']['type'] === 'explorer.oxt') return `${explorerInfo['pairing']['url']}/transaction/${txid}` - else if (explorerInfo['pairing']['type'] == 'explorer.btc_rpc_explorer') + else if (explorerInfo['pairing']['type'] === 'explorer.btc_rpc_explorer') return `http://${explorerInfo['pairing']['url']}/tx/${txid}` else return null @@ -46,7 +46,7 @@ const lib_cmn = { if (file) { xhttp = new XMLHttpRequest() xhttp.onreadystatechange = function() { - if (this.readyState == 4 && this.status == 200) { + if (this.readyState === 4 && this.status === 200) { elmnt.innerHTML = this.responseText elmnt.removeAttribute('include-html') self.includeHTML(cb) @@ -72,7 +72,7 @@ const lib_cmn = { if (file) { xhttp = new XMLHttpRequest() xhttp.onreadystatechange = function() { - if (this.readyState == 4 && this.status == 200) { + if (this.readyState === 4 && this.status === 200) { const newElmnt = document.createElement('script') newElmnt.textContent = this.responseText if (elmnt.parentNode) { diff --git a/static/admin/lib/errors-utils.js b/static/admin/lib/errors-utils.js index 106cd16..b4c7e47 100644 --- a/static/admin/lib/errors-utils.js +++ b/static/admin/lib/errors-utils.js @@ -14,7 +14,7 @@ const lib_errors = { processError: function(e) { const errorMsg = this.extractJqxhrErrorMsg(e) // Redirect to sign in page if authentication error - if (errorMsg == 'Invalid JSON Web Token' || errorMsg == 'Missing JSON Web Token') { + if (errorMsg === 'Invalid JSON Web Token' || errorMsg === 'Missing JSON Web Token') { lib_auth.logout() } else { lib_msg.displayErrors(errorMsg) diff --git a/static/admin/lib/format-utils.js b/static/admin/lib/format-utils.js index 96cd07c..65683fd 100644 --- a/static/admin/lib/format-utils.js +++ b/static/admin/lib/format-utils.js @@ -52,7 +52,7 @@ const lib_fmt = { * Format a unix timestamp into a readable date/hour */ formatUnixTs: function(ts) { - if (ts == null || ts == 0) + if (ts == null || ts === 0) return '-' let tmpDate = new Date(ts*1000), diff --git a/test/lib/bitcoin/addresses-helper-test.js b/test/lib/bitcoin/addresses-helper-test.js index 7dadc13..3f5204d 100644 --- a/test/lib/bitcoin/addresses-helper-test.js +++ b/test/lib/bitcoin/addresses-helper-test.js @@ -149,7 +149,7 @@ describe('AddressesHelper', function() { const targetSig = Buffer.from(stc[1], 'hex') const expectedResult = stc[2] - const sig = btcMessage.sign(msg, prefix, privKey, true) + const sig = btcMessage.sign(msg, privKey, true, prefix) // Check that library returns valid result assert((sig.compare(targetSig) == 0) == expectedResult) diff --git a/test/lib/bitcoin/hd-accounts-helper-test.js b/test/lib/bitcoin/hd-accounts-helper-test.js index 280718c..0920b64 100644 --- a/test/lib/bitcoin/hd-accounts-helper-test.js +++ b/test/lib/bitcoin/hd-accounts-helper-test.js @@ -19,6 +19,8 @@ const XPUB = 'tpubDDDAe7GgFT4fzEzKwWVA4BWo8fiJXQeGEYDTexzo2w6CK1iDoLPYkpEisXo623 const YPUB = 'upub5ELkCsSF68UnAZE7zF9CDztvHeBJiAAhwa4VxEFzZ1CfQRbpy93mkBbUZsqYVpoeEHFwY3fGh9bfftH79ZwbhjUEUBAxQj551TMxVyny4UX' const ZPUB = 'vpub5ZB1WY7AEp2G1rREpbvpS5zRTcKkenACrgaijd9sw1aYTXR4DoDLNFFcb5o8VjTZdvNkHXFq9oxDZAtfsGMcVy9qLWsNzdtZHBRbtXe87LB' +const POSTMIX_ZPUB = 'vpub5Y6cjg7GbwSLRu33XB76n3EoJZscmYSVEToLSMqD6ugAcm4rof8E9yvDiaFfhGEuyL95P9VD4A9W3JrBTZhzWSXiRyYvWFnUBAZc67X32wh' + const BIP44_VECTORS = [ [0, 0, 'mmZ5FRccGAkwfKme4JkrsmurnimDLdfmNL'], [0, 1, 'n3yomLicyrSULiNWFKHsK8erntSpJZEPV6'], @@ -61,6 +63,27 @@ const BIP84_VECTORS = [ [1, 4, 'tb1qjrnw8u2pvspm6hq3aa83ff93wevq2zyxqczewy'] ] +const POSTMIX_VECTORS = [ + [1, 0, 'tb1qv3laps2vues6nh9fkxpds3wxd0cttd9jnr0772'], + [1, 1, 'tb1qz538rwwchv2unf97g4pugv3wjwxxjaypnwz8sk'], + [1, 2, 'tb1qdm3hfvw3knzujxx24g05e30kpe7vk0ez3dk0h8'], + [1, 3, 'tb1qxn4jgg5hgl3eggvt4alvraladpwq9pj30fy5ze'], + [1, 4, 'tb1qw2ghyxhqv5ysyehq9p9xwux4zqaf0mcwm29agh'], + + [1, 0, 'mpgLz1YXDU9buy7Zn8w9w9mJtrGghiXotH'], + [1, 1, 'mhShkJxHHgzJd2WcqeaKL4spqBMe1wcaK5'], + [1, 2, 'mqdH74foDiN8hV2mmFSHnceCm7vgErd4A2'], + [1, 3, 'mkLm7vUy1rij3YicskkQJxGovnGDG6G2oj'], + [1, 4, 'mqxjZfjdSdUmecTVALzhoQBPFRNvLViMBr'], + + [1, 0, '2N5UxwLfWexxHDm5MKHoyitRLWEK8x25tiA'], + [1, 1, '2N8wnnGoJujWGrM5YLs1nC1TFuszx2vJVA9'], + [1, 2, '2NA6Ja6PM6YMuQpSQdeWofKRV9pcBbz4aii'], + [1, 3, '2NFLd63BqGzh5BtfxobuU4dpoThg9sxMPth'], + [1, 4, '2NEeziC2dc3nbf9k3fyUWBzLWbn4MTrR2mm'] + +] + const HD_TYPES_VECTORS = [ // unlocked [0, hdaHelper.BIP44, false], @@ -74,7 +97,7 @@ const HD_TYPES_VECTORS = [ describe('HdAccountsHelper', function() { - + describe('isXpub()', function() { it('should successfully detect a XPUB', function() { assert(hdaHelper.isXpub(XPUB)) @@ -117,7 +140,7 @@ describe('HdAccountsHelper', function() { const ret = hdaHelper.classify(v[0]) assert(ret.type == v[1]) assert(ret.locked == v[2]) - } + } }) }) @@ -127,7 +150,7 @@ describe('HdAccountsHelper', function() { for (const v of HD_TYPES_VECTORS) { const ret = hdaHelper.makeType(v[1], v[2]) assert(ret == v[0]) - } + } }) }) @@ -153,6 +176,15 @@ describe('HdAccountsHelper', function() { assert(addresses[0].address == v[2]) } }) + + it('should successfully derive additional change address types for postmix account', async () => { + const addresses = await hdaHelper.deriveAddresses(POSTMIX_ZPUB, 1, [0, 1, 2, 3, 4], hdaHelper.BIP84) + + POSTMIX_VECTORS.forEach((vector) => { + assert(addresses.find((addr) => addr.index === vector[1])) + assert(addresses.find((addr) => addr.address === vector[2])) + }) + }) }) diff --git a/tracker/block-worker.js b/tracker/block-worker.js index f19a2ef..0262f28 100644 --- a/tracker/block-worker.js +++ b/tracker/block-worker.js @@ -61,22 +61,22 @@ async function processMessage(msg) { try { switch(msg.op) { case OP_INIT: - if (status != IDLE) + if (status !== IDLE) throw 'Operation not allowed' res = await initBlock(msg.header) break case OP_PROCESS_OUTPUTS: - if (status != INITIALIZED) + if (status !== INITIALIZED) throw 'Operation not allowed' res = await processOutputs() break case OP_PROCESS_INPUTS: - if (status != OUTPUTS_PROCESSED) + if (status !== OUTPUTS_PROCESSED) throw 'Operation not allowed' res = await processInputs() break case OP_CONFIRM: - if (status != INPUTS_PROCESSED) + if (status !== INPUTS_PROCESSED) throw 'Operation not allowed' res = await confirmTransactions(msg.blockId) break @@ -130,7 +130,7 @@ async function processInputs() { /** * Confirm the transactions - * @param {integer} blockId - id of the block in db + * @param {number} blockId - id of the block in db */ async function confirmTransactions(blockId) { status = TXS_CONFIRMED diff --git a/tracker/block.js b/tracker/block.js index 55161e2..fe6fc55 100644 --- a/tracker/block.js +++ b/tracker/block.js @@ -44,7 +44,7 @@ class Block extends TransactionsBundle { * @dev This method isn't used anymore. * It has been replaced by a parallel processing of blocks. * (see blocks-processor and block-worker) - * @returns {Promise - object[]} returns an array of transactions to be broadcast + * @returns {Promise} returns an array of transactions to be broadcast */ async processBlock() { Logger.info('Tracker : Beginning to process new block.') @@ -77,7 +77,7 @@ class Block extends TransactionsBundle { /** * Process the transaction outputs - * @returns {Promise - object[]} returns an array of transactions to be broadcast + * @returns {Promise} returns an array of transactions to be broadcast */ async processOutputs() { const txsForBroadcast = new Set() @@ -93,7 +93,7 @@ class Block extends TransactionsBundle { /** * Process the transaction inputs - * @returns {Promise - object[]} returns an array of transactions to be broadcast + * @returns {Promise} returns an array of transactions to be broadcast */ async processInputs() { const txsForBroadcast = new Set() @@ -109,7 +109,7 @@ class Block extends TransactionsBundle { /** * Store the block in db - * @returns {Promise - int} returns the id of the block + * @returns {Promise} returns the id of the block */ async registerBlock() { const prevBlock = await db.getBlockByHash(this.header.previousblockhash) @@ -130,8 +130,8 @@ class Block extends TransactionsBundle { /** * Confirm the transactions in db * @param {Set} txs - set of transactions stored in db - * @param {int} blockId - id of the block - * r@returns {Promise} + * @param {number} blockId - id of the block + * @returns {Promise} */ async confirmTransactions(txs, blockId) { const txids = txs.map(t => t.getId()) @@ -141,8 +141,8 @@ class Block extends TransactionsBundle { /** * Register the block header - * @param {int} prevBlockID - id of previous block - * @returns {Promise} + * @param {number} prevBlockID - id of previous block + * @returns {Promise} */ async checkBlockHeader(prevBlockID) { Logger.info('Tracker : Beginning to process new block header.') diff --git a/tracker/blockchain-processor.js b/tracker/blockchain-processor.js index 15185de..bc88875 100644 --- a/tracker/blockchain-processor.js +++ b/tracker/blockchain-processor.js @@ -5,8 +5,8 @@ 'use strict' const _ = require('lodash') -const zmq = require('zeromq') -const Sema = require('async-sema') +const zmq = require('zeromq/v5-compat') +const { Sema } = require('async-sema') const util = require('../lib/util') const Logger = require('../lib/logger') const db = require('../lib/db/mysql-db-wrapper') @@ -43,7 +43,7 @@ class BlockchainProcessor { /** * Start processing the blockchain - * @returns {Promise} + * @returns {Promise} */ async start() { await this.catchup() @@ -57,14 +57,14 @@ class BlockchainProcessor { /** * Tracker process startup - * @returns {Promise} + * @returns {Promise} */ async catchup() { const [highest, info] = await Promise.all([db.getHighestBlock(), this.client.getblockchaininfo()]) const daemonNbHeaders = info.headers // Consider that we are in IBD mode if Dojo is far in the past (> 13,000 blocks) - this.isIBD = (highest.blockHeight < 655000) || (highest.blockHeight < daemonNbHeaders - 13000) + this.isIBD = (highest.blockHeight < 681000) || (highest.blockHeight < daemonNbHeaders - 13000) if (this.isIBD) return this.catchupIBDMode() @@ -78,7 +78,7 @@ class BlockchainProcessor { * 2. Pull all block headers after database last known height * 3. Process those block headers * - * @returns {Promise} + * @returns {Promise} */ async catchupIBDMode() { try { @@ -93,7 +93,7 @@ class BlockchainProcessor { let prevBlockId = highest.blockID // If no header or block loaded by bitcoind => try later - if (daemonNbHeaders == 0 || daemonNbBlocks == 0) { + if (daemonNbHeaders === 0 || daemonNbBlocks === 0) { Logger.info('Tracker : New attempt scheduled in 30s (waiting for block headers)') return util.delay(30000).then(() => { return this.catchupIBDMode() @@ -148,7 +148,7 @@ class BlockchainProcessor { * 2. Pull all block headers after database last known height * 3. Process those block headers * - * @returns {Promise} + * @returns {Promise} */ async catchupNormalMode() { try { @@ -159,7 +159,7 @@ class BlockchainProcessor { const daemonNbBlocks = info.blocks if (highest == null) return null - if (daemonNbBlocks == highest.blockHeight) return null + if (daemonNbBlocks === highest.blockHeight) return null const blockRange = _.range(highest.blockHeight, daemonNbBlocks + 1) @@ -225,7 +225,7 @@ class BlockchainProcessor { * block confirmation. * * @param {Buffer} buf - block - * @returns {Promise} + * @returns {Promise} */ async onBlockHash(buf) { try { @@ -298,8 +298,8 @@ class BlockchainProcessor { /** * Cancel confirmation of transactions * and delete blocks after a given height - * @param {integer} height - height of last block maintained - * @returns {Promise} + * @param {number} height - height of last block maintained + * @returns {Promise} */ async rewind(height) { // Retrieve transactions confirmed in reorg'd blocks @@ -317,8 +317,8 @@ class BlockchainProcessor { /** * Rescan a range of blocks - * @param {integer} fromHeight - height of first block - * @param {integer} toHeight - height of last block + * @param {number} fromHeight - height of first block + * @param {number} toHeight - height of last block * @returns {Promise} */ async rescanBlocks(fromHeight, toHeight) { @@ -356,7 +356,7 @@ class BlockchainProcessor { /** * Process a range of blocks - * @param {int[]} heights - a range of block heights + * @param {number[]} heights - a range of block heights */ async processBlockRange(heights) { const chunks = util.splitList(heights, blocksProcessor.nbWorkers) @@ -373,7 +373,7 @@ class BlockchainProcessor { /** * Process a block header * @param {object} header - block header - * @param {int} prevBlockID - id of previous block + * @param {number} prevBlockID - id of previous block * @returns {Promise} */ async processBlockHeader(header, prevBlockID) { diff --git a/tracker/blocks-processor.js b/tracker/blocks-processor.js index 70df7cf..502f65c 100644 --- a/tracker/blocks-processor.js +++ b/tracker/blocks-processor.js @@ -5,7 +5,7 @@ 'use strict' const os = require('os') -const Sema = require('async-sema') +const { Sema } = require('async-sema') const { Worker } = require('worker_threads') const Logger = require('../lib/logger') const util = require('../lib/util') @@ -90,11 +90,11 @@ async function processWorkerMessage(msg) { if (!msg.status) { Logger.error(msg.res, 'Tracker : processWorkerMessage()') - } else if (msg.op == blockWorker.OP_CONFIRM) { + } else if (msg.op === blockWorker.OP_CONFIRM) { txsForBroadcast = txsForBroadcast.concat(msg.res) } - if (nbTasksCompleted == nbTasksEnqueued) { + if (nbTasksCompleted === nbTasksEnqueued) { switch (msg.op) { case blockWorker.OP_INIT: // Process the transaction outputs @@ -139,7 +139,7 @@ async function processWorkerMessage(msg) { /** * Execute an operation processing a block - * @param {integer} op - operation + * @param {number} op - operation * @param {*} args */ function processTask(op, args) { @@ -204,7 +204,7 @@ function notifyBlock(header) { /** * Store a block in db * @param {object} header - block header - * @returns {Promise - int} returns the id of the block + * @returns {Promise} returns the id of the block */ async function registerBlock(header) { const prevBlock = await dbProcessor.getBlockByHash(header.previousblockhash) diff --git a/tracker/mempool-processor.js b/tracker/mempool-processor.js index bd30ef3..9bcc991 100644 --- a/tracker/mempool-processor.js +++ b/tracker/mempool-processor.js @@ -5,7 +5,7 @@ 'use strict' const _ = require('lodash') -const zmq = require('zeromq') +const zmq = require('zeromq/v5-compat') const bitcoin = require('bitcoinjs-lib') const util = require('../lib/util') const Logger = require('../lib/logger') @@ -47,7 +47,7 @@ class MempoolProcessor { /** * Start processing the mempool - * @returns {Promise} + * @returns {Promise} */ async start() { this.checkUnconfirmedId = setInterval( @@ -143,7 +143,7 @@ class MempoolProcessor { /** * Process transactions from the mempool buffer - * @returns {Promise} + * @returns {Promise} */ async processMempool() { // Refresh the isActive flag @@ -181,7 +181,7 @@ class MempoolProcessor { /** * On reception of a new transaction from bitcoind mempool * @param {Buffer} buf - transaction - * @returns {Promise} + * @returns {Promise} */ async onTx(buf) { if (this.isActive) { @@ -201,7 +201,7 @@ class MempoolProcessor { /** * On reception of a new transaction from /pushtx * @param {Buffer} buf - transaction - * @returns {Promise} + * @returns {Promise} */ async onPushTx(buf) { try { @@ -249,7 +249,7 @@ class MempoolProcessor { /** * Check unconfirmed transactions - * @returns {Promise} + * @returns {Promise} */ async checkUnconfirmed() { const t0 = Date.now() @@ -259,40 +259,46 @@ class MempoolProcessor { const unconfirmedTxs = await db.getUnconfirmedTransactions() if (unconfirmedTxs.length > 0) { - await util.parallelCall(unconfirmedTxs, tx => { - try { - return this.client.getrawtransaction( { txid: tx.txnTxid, verbose: true }) - .then(async rtx => { - if (!rtx.blockhash) return null - // Transaction is confirmed - const block = await db.getBlockByHash(rtx.blockhash) - if (block && block.blockID) { - Logger.info(`Tracker : Marking TXID ${tx.txnTxid} confirmed`) - return db.confirmTransactions([tx.txnTxid], block.blockID) + const unconfirmedTxLists = util.splitList(unconfirmedTxs, 10) + + await util.seriesCall(unconfirmedTxLists, async (txList) => { + return await util.parallelCall(txList, tx => { + try { + return this.client.getrawtransaction( { txid: tx.txnTxid, verbose: true }) + .then(async rtx => { + if (!rtx.blockhash) return null + // Transaction is confirmed + const block = await db.getBlockByHash(rtx.blockhash) + if (block && block.blockID) { + Logger.info(`Tracker : Marking TXID ${tx.txnTxid} confirmed`) + return db.confirmTransactions([tx.txnTxid], block.blockID) + } + }, + (e) => { + Logger.error(e, 'Tracker : MempoolProcessor.checkUnconfirmed()') + // Transaction not in mempool. Update LRU cache and database + TransactionsBundle.cache.del(tx.txnTxid) + // TODO: Notify clients of orphaned transaction + return db.deleteTransaction(tx.txnTxid) } - }, - () => { - // Transaction not in mempool. Update LRU cache and database - TransactionsBundle.cache.del(tx.txnTxid) - // TODO: Notify clients of orphaned transaction - return db.deleteTransaction(tx.txnTxid) - } - ) - } catch(e) { - Logger.error(e, 'Tracker : MempoolProcessor.checkUnconfirmed()') - } + ) + } catch(e) { + Logger.error(e, 'Tracker : MempoolProcessor.checkUnconfirmed()') + } + }) }) } // Logs const ntx = unconfirmedTxs.length const dt = ((Date.now() - t0) / 1000).toFixed(1) - const per = (ntx == 0) ? 0 : ((Date.now() - t0) / ntx).toFixed(0) + const per = (ntx === 0) ? 0 : ((Date.now() - t0) / ntx).toFixed(0) Logger.info(`Tracker : Finished processing unconfirmed transactions ${dt}s, ${ntx} tx, ${per}ms/tx`) } /** * Sets the isActive flag + * @private */ async _refreshActiveStatus() { // Get highest header in the blockchain @@ -300,7 +306,7 @@ class MempoolProcessor { const [highestBlock, info] = await Promise.all([db.getHighestBlock(), this.client.getblockchaininfo()]) const highestHeader = info.headers - if (highestBlock == null || highestBlock.blockHeight == 0) { + if (highestBlock == null || highestBlock.blockHeight === 0) { this.isActive = false return } diff --git a/tracker/tracker.js b/tracker/tracker.js index 1089faa..556d2a7 100644 --- a/tracker/tracker.js +++ b/tracker/tracker.js @@ -4,11 +4,12 @@ */ 'use strict' -const zmq = require('zeromq') +const zmq = require('zeromq/v5-compat') const network = require('../lib/bitcoin/network') const keys = require('../keys')[network.key] const BlockchainProcessor = require('./blockchain-processor') const MempoolProcessor = require('./mempool-processor') +const util = require('../lib/util') /** @@ -22,23 +23,28 @@ class Tracker { constructor() { // Notification socket for client events this.notifSock = zmq.socket('pub') - this.notifSock.bindSync(`tcp://127.0.0.1:${keys.ports.tracker}`) - - // Initialize the blockchain processor - // and the mempool buffer - this.blockchainProcessor = new BlockchainProcessor(this.notifSock) - this.mempoolProcessor = new MempoolProcessor(this.notifSock) + this.notifSock.bind(`tcp://127.0.0.1:${keys.ports.tracker}`, () => { + // Initialize the blockchain processor + // and the mempool buffer + this.initialized = true + this.blockchainProcessor = new BlockchainProcessor(this.notifSock) + this.mempoolProcessor = new MempoolProcessor(this.notifSock) + }) } /** * Start the tracker - * @returns {Promise} + * @returns {Promise} */ async start() { - this.startupTimeout = setTimeout(async function() { - await this.blockchainProcessor.start() - await this.mempoolProcessor.start() - }.bind(this), 1500) + if (!this.initialized) { + await util.delay(1000) + + return this.start() + } + + await this.blockchainProcessor.start() + await this.mempoolProcessor.start() } /** diff --git a/tracker/transaction.js b/tracker/transaction.js index 037e774..eedd7a3 100644 --- a/tracker/transaction.js +++ b/tracker/transaction.js @@ -96,7 +96,7 @@ class Transaction { // Check if we find some inputs of interest const results = await db.getOutputSpends(spends) - if (results.length == 0) + if (results.length === 0) return null // Flag the transaction for broadcast @@ -122,7 +122,7 @@ class Transaction { }) // Detect potential double spends - if (r.spendingTxnID !== null && r.spendingTxnID != this.storedTxnID) { + if (r.spendingTxnID !== null && r.spendingTxnID !== this.storedTxnID) { Logger.info(`Tracker : DOUBLE SPEND of ${r.txnTxid}-${r.outIndex} by ${this.txid}!`) // Delete the existing transaction that has been double-spent: // since the deepest block keeps its transactions, this will @@ -190,7 +190,7 @@ class Transaction { const aHdAcctAddr = await this._processOutputsHdAccounts(result.hd, indexedOutputs) fundedAddresses = fundedAddresses.concat(aHdAcctAddr) - if (fundedAddresses.length == 0) + if (fundedAddresses.length === 0) return null // Flag the transaction for broadcast @@ -219,7 +219,7 @@ class Transaction { * Process outputs sending to tracked loose addresses * @param {object[]} addresses - array of address objects * @param {object} indexedOutputs - outputs indexed by address - * @returns {Promise - object[]} return an array of funded addresses + * @returns {Promise} return an array of funded addresses * {addrID: ..., outIndex: ..., outAmount: ..., outScript: ...} */ async _processOutputsLooseAddresses(addresses, indexedOutputs) { @@ -247,7 +247,7 @@ class Transaction { * Process outputs sending to tracked hd accounts * @param {object[]} hdAccounts - array of hd account objects * @param {object} indexedOutputs - outputs indexed by address - * @returns {Promise - object[]} return an array of funded addresses + * @returns {Promise} return an array of funded addresses * {addrID: ..., outIndex: ..., outAmount: ..., outScript: ...} */ async _processOutputsHdAccounts(hdAccounts, indexedOutputs) { @@ -297,7 +297,7 @@ class Transaction { * @param {string} xpub * @param {object} hdAccount - hd account object * @param {object} indexedOutputs - outputs indexed by address - * @returns {Promise - object[]} returns an array of the new addresses used + * @returns {Promise} returns an array of the new addresses used */ async _deriveNewAddresses(xpub, hdAccount, indexedOutputs) { const hdType = hdAccount.hdType @@ -317,10 +317,10 @@ class Transaction { for (let chain of [0,1]) { // Get addresses for this account that are on this chain const chainAddresses = _.filter(hdAccount.addresses, v => { - return v.hdAddrChain == chain + return v.hdAddrChain === chain }) - if (chainAddresses.length == 0) + if (chainAddresses.length === 0) continue // Get the maximum used address on this chain @@ -365,7 +365,8 @@ class Transaction { const indices = _.range(minIdx, maxIdx) const derived = await hdaHelper.deriveAddresses(xpub, chain, indices, hdType) - Array.prototype.push.apply(newAddresses, derived) + + newAddresses.push(...derived) Logger.info(`Tracker : Derived hdID(${hdAccount.hdID}) M/${chain}/${indices.join(',')}`) diff --git a/tracker/transactions-bundle.js b/tracker/transactions-bundle.js index a769e44..8084fc5 100644 --- a/tracker/transactions-bundle.js +++ b/tracker/transactions-bundle.js @@ -18,7 +18,8 @@ class TransactionsBundle { /** * Constructor - * @param {object[]} txs - array of bitcoin transaction objects + * @constructor + * @param {object[]=} txs - array of bitcoin transaction objects */ constructor(txs) { // List of transactions @@ -52,7 +53,7 @@ class TransactionsBundle { /** * Get the size of the bundle - * @returns {integer} return the number of transactions stored in the bundle + * @returns {number} return the number of transactions stored in the bundle */ size() { return this.transactions.length @@ -61,7 +62,7 @@ class TransactionsBundle { /** * Find the transactions of interest * based on theirs inputs - * @returns {object[]} returns an array of transactions objects + * @returns {Promise} returns an array of transactions objects */ async prefilterByInputs() { // Process transactions by slices of 5000 transactions @@ -74,7 +75,7 @@ class TransactionsBundle { /** * Find the transactions of interest * based on theirs outputs - * @returns {object[]} returns an array of transactions objects + * @returns {Promise} returns an array of transactions objects */ async prefilterByOutputs() { // Process transactions by slices of 5000 transactions @@ -88,7 +89,7 @@ class TransactionsBundle { * Find the transactions of interest * based on theirs outputs (internal implementation) * @params {object[]} txs - array of transactions objects - * @returns {object[]} returns an array of transactions objects + * @returns {Promise} returns an array of transactions objects */ async _prefilterByOutputs(txs) { let addresses = [] @@ -122,7 +123,7 @@ class TransactionsBundle { const idxTxs = indexedOutputs[key] if (idxTxs) { for (const idxTx of idxTxs) - if (filteredIdxTxs.indexOf(idxTx) == -1) + if (filteredIdxTxs.indexOf(idxTx) === -1) filteredIdxTxs.push(idxTx) } } @@ -134,7 +135,7 @@ class TransactionsBundle { * Find the transactions of interest * based on theirs inputs (internal implementation) * @params {object[]} txs - array of transactions objects - * @returns {object[]} returns an array of transactions objects + * @returns {Promise} returns an array of transactions objects */ async _prefilterByInputs(txs) { let inputs = [] @@ -169,7 +170,7 @@ class TransactionsBundle { const idxTxs = indexedInputs[key] if (idxTxs) { for (const idxTx of idxTxs) - if (filteredIdxTxs.indexOf(idxTx) == -1) + if (filteredIdxTxs.indexOf(idxTx) === -1) filteredIdxTxs.push(idxTx) } } @@ -187,7 +188,7 @@ class TransactionsBundle { * Additionally, the transaction comes in a block * Orphaned transactions are deleted during the routine check */ -TransactionsBundle.cache = LRU({ +TransactionsBundle.cache = new LRU({ // Maximum number of txids to store in cache max: 100000, // Function used to compute length of item