From 9aef106237a777bb666daef597566b2f2c56d10e Mon Sep 17 00:00:00 2001 From: Asher Dawes Date: Fri, 14 Jun 2024 22:56:14 -0700 Subject: [PATCH 01/17] Enable `fastload` on VRSC and VRSCTEST --- routes/chainParams.js | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/routes/chainParams.js b/routes/chainParams.js index b148b639..b12a7ef8 100644 --- a/routes/chainParams.js +++ b/routes/chainParams.js @@ -3,13 +3,15 @@ const chainParams = { daemon: 0 }, VRSC: { - ac_name: "VRSC" - }, + ac_name: "VRSC", + fastload: 1 + }, ZEC: { addnode: ['mainnet.z.cash'] }, VRSCTEST: { ac_name: "VRSCTEST", + fastload: 1 }, SUPERNET: { ac_name: "SUPERNET", @@ -30,8 +32,8 @@ const chainParams = { ac_staked: 90, ac_public: 1, addnode: [ - '37.187.225.231', - '51.38.38.134', + '37.187.225.231', + '51.38.38.134', ], }, PANGEA: { @@ -95,7 +97,7 @@ const chainParams = { ac_name: "COQUI", ac_supply: 72000000, ac_ccactivate: 200000, - }, + }, KMDICE: { ac_name: "KMDICE", ac_supply: 10500000, @@ -120,7 +122,7 @@ const chainParams = { ac_name: "EQL", ac_supply: 500000000, addnode: ['46.101.124.153'], - ac_ccactivate: 205000, + ac_ccactivate: 205000, }, AXO: { ac_name: "AXO", From fb234a209b1977056f4cd4b80363f734bda5d6d8 Mon Sep 17 00:00:00 2001 From: michaeltout Date: Thu, 20 Jun 2024 12:45:47 +0200 Subject: [PATCH 02/17] Add fastload option to settings --- routes/api/daemonControl.js | 7 +++++++ routes/appConfig.js | 13 +++++++++++-- routes/chainParams.js | 6 ++---- 3 files changed, 20 insertions(+), 6 deletions(-) diff --git a/routes/api/daemonControl.js b/routes/api/daemonControl.js index f2fda772..a7bab66a 100644 --- a/routes/api/daemonControl.js +++ b/routes/api/daemonControl.js @@ -544,6 +544,13 @@ module.exports = (api) => { acOptions.push("-bootstrap"); } + if (daemon === "verusd" && + api.appConfig.coin.native.noFastLoad[coin] === false && + !acOptions.includes("-fastload") + ) { + acOptions.push("-fastload"); + } + api.log( `selected data: ${JSON.stringify(acOptions, null, "\t")}`, "native.confd" diff --git a/routes/appConfig.js b/routes/appConfig.js index c7ff8fc9..059f408c 100644 --- a/routes/appConfig.js +++ b/routes/appConfig.js @@ -3,6 +3,7 @@ const zcashParamsSources = require('./zcashParamsSources') let nonZCoins = {} let nativeCoinStrings = {} +let nativeCoinBools = {} const coinObjArray = coinDataTranslated.getSimpleCoinArray().map(simpleCoinObj => { const coinObj = coinDataTranslated.getCoinObj(simpleCoinObj.id) @@ -11,7 +12,8 @@ const coinObjArray = coinDataTranslated.getSimpleCoinArray().map(simpleCoinObj = else nonZCoins[coinObj.id] = true if (coinObj.available_modes.native === true) { - nativeCoinStrings[coinObj.id] = '' + nativeCoinStrings[coinObj.id] = '', + nativeCoinBools[coinObj.id] = false } return coinObj @@ -97,7 +99,8 @@ const appConfig = { stakeGuard: nativeCoinStrings, refundAddress: nativeCoinStrings, refundFromSource: nonZCoins, - dataDir: nativeCoinStrings + dataDir: nativeCoinStrings, + noFastLoad: nativeCoinBools } }, pubkey: "", @@ -240,6 +243,12 @@ const appConfig = { info: "Sapling address for Verus StakeGuard. (Will be used when Verus is started)" }, + noFastLoad: { + type: "checkbox", + displayName: "Memory optimization", + info: + "Reduce memory usage for this coin in native mode. May increase loading times on coin startup." + }, refundAddress: { type: "text_input", displayName: "Refund address", diff --git a/routes/chainParams.js b/routes/chainParams.js index b12a7ef8..9d7f2b31 100644 --- a/routes/chainParams.js +++ b/routes/chainParams.js @@ -3,15 +3,13 @@ const chainParams = { daemon: 0 }, VRSC: { - ac_name: "VRSC", - fastload: 1 + ac_name: "VRSC" }, ZEC: { addnode: ['mainnet.z.cash'] }, VRSCTEST: { - ac_name: "VRSCTEST", - fastload: 1 + ac_name: "VRSCTEST" }, SUPERNET: { ac_name: "SUPERNET", From 64e46904c558680cb9a331f0951ecfb58f92de16 Mon Sep 17 00:00:00 2001 From: michaeltout Date: Fri, 21 Jun 2024 16:25:10 +0200 Subject: [PATCH 03/17] Refactor daemonControl.js to use logical negation for fastload check --- routes/api/daemonControl.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/routes/api/daemonControl.js b/routes/api/daemonControl.js index a7bab66a..629b0e11 100644 --- a/routes/api/daemonControl.js +++ b/routes/api/daemonControl.js @@ -545,7 +545,7 @@ module.exports = (api) => { } if (daemon === "verusd" && - api.appConfig.coin.native.noFastLoad[coin] === false && + !api.appConfig.coin.native.noFastLoad[coin] && !acOptions.includes("-fastload") ) { acOptions.push("-fastload"); From 5301639f263efbc7def285021e004c38c8786f77 Mon Sep 17 00:00:00 2001 From: michaeltout Date: Wed, 18 Sep 2024 22:52:08 +0200 Subject: [PATCH 04/17] Handle error when getting transactions for z-addresses with z_listreceivedbyaddress --- routes/api/native/transactions.js | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) diff --git a/routes/api/native/transactions.js b/routes/api/native/transactions.js index ab76ab42..d120f7e8 100644 --- a/routes/api/native/transactions.js +++ b/routes/api/native/transactions.js @@ -100,11 +100,15 @@ module.exports = api => { let receivedByAddressList = [] for (const address of privateAddresses) { - receivedByAddressList.push(await api.native.callDaemon( - coin, - "z_listreceivedbyaddress", - [address, 0] - )) + try { + receivedByAddressList.push(await api.native.callDaemon( + coin, + "z_listreceivedbyaddress", + [address, 0] + )) + } catch(e) { + api.log('Could not get transactions for z-addr ' + address, 'get_transactions'); + } } const privateTxs = receivedByAddressList From f3afc4218740ac961c8be0bb74d24710cbf52802 Mon Sep 17 00:00:00 2001 From: michaeltout Date: Wed, 23 Oct 2024 05:26:44 +0200 Subject: [PATCH 05/17] Remove CHIPS and support for ZCash native mode --- routes/api/explorer/remoteExplorers.js | 1 - routes/api/native/remove.js | 3 +-- routes/api/pathsUtil.js | 8 -------- routes/api/utils/constants/daemons.js | 3 --- routes/appConfig.js | 2 +- routes/chainParams.js | 3 --- routes/coinDataTranslated.js | 2 -- routes/ports.js | 4 +--- routes/workers/openExternalSafe.js | 1 - 9 files changed, 3 insertions(+), 24 deletions(-) diff --git a/routes/api/explorer/remoteExplorers.js b/routes/api/explorer/remoteExplorers.js index 4d233160..d30abe80 100644 --- a/routes/api/explorer/remoteExplorers.js +++ b/routes/api/explorer/remoteExplorers.js @@ -13,7 +13,6 @@ const remoteExplorers = { BOTS: 'http://BOTS.explorer.supernet.org', MGW: 'http://MGW.explorer.supernet.org', WLC: 'http://WIRELESS.explorer.supernet.org', - CHIPS: 'http://CHIPS1.explorer.supernet.org', COQUI: 'https://explorer.coqui.cash', MNZ: 'https://www.mnzexplorer.com', VRSC: 'https://explorer.verus.io/', diff --git a/routes/api/native/remove.js b/routes/api/native/remove.js index 2d8430f1..16b46cc5 100644 --- a/routes/api/native/remove.js +++ b/routes/api/native/remove.js @@ -12,8 +12,7 @@ module.exports = (api) => { let _arg = []; if (chain && - !api.nativeCoindList[key.toLowerCase()] && - key !== 'CHIPS') { + !api.nativeCoindList[key.toLowerCase()]) { _arg.push(`-ac_name=${chain}`); if (api.appConfig.general.native.dataDir.length) { diff --git a/routes/api/pathsUtil.js b/routes/api/pathsUtil.js index 7cd22143..2c4cc16d 100644 --- a/routes/api/pathsUtil.js +++ b/routes/api/pathsUtil.js @@ -89,7 +89,6 @@ const pathsDaemons = (api) => { api.paths.verusDir = `${global.HOME}/Verus`, api.paths.verusTestDir = `${global.HOME}/VerusTest`, api.paths.zcashParamsDir = `${global.HOME}/ZcashParams`, - api.paths.chipsDir = `${global.HOME}/Chips`, api.paths.mmBin = path.join(__dirname, '../../node_modules/marketmaker/bin/darwin/x64/marketmaker'); return api; break; @@ -101,7 +100,6 @@ const pathsDaemons = (api) => { api.paths.verusDir = `${global.HOME}/Verus`, api.paths.verusTestDir = `${global.HOME}/VerusTest`, api.paths.zcashParamsDir = `${global.HOME}/ZcashParams`, - api.paths.chipsDir = `${global.HOME}/Chips`, api.paths.mmBin = path.join(__dirname, '../../node_modules/marketmaker/bin/linux/x64/marketmaker'); return api; break; @@ -117,8 +115,6 @@ const pathsDaemons = (api) => { api.paths.verusDir = path.normalize(api.paths.verusDir), api.paths.verusTestDir = `${global.HOME}/VerusTest`, api.paths.verusTestDir = path.normalize(api.paths.verusTestDir), - api.paths.chipsDir = `${global.HOME}/Chips`, - api.paths.chipsDir = path.normalize(api.paths.chipsDir); api.paths.zcashParamsDir = `${global.HOME}/ZcashParams`; api.paths.zcashParamsDir = path.normalize(api.paths.zcashParamsDir); api.paths.mmBin = path.join(__dirname, '../../node_modules/marketmaker/bin/win32/x64/marketmaker.exe'); @@ -136,7 +132,6 @@ const pathsDaemons = (api) => { api.paths.verusDir = `${global.HOME}/Library/Application Support/Verus`, api.paths.verusTestDir = `${global.HOME}/Library/Application Support/VerusTest`, api.paths.zcashParamsDir = `${global.HOME}/Library/Application Support/ZcashParams`, - api.paths.chipsDir = `${global.HOME}/Library/Application Support/Chips`, api.paths.mmBin = path.join(__dirname, '../../node_modules/marketmaker/bin/darwin/x64/marketmaker'); api.paths[`vrsc-fetch-bootstrap`] = path.join(__dirname, `../../assets/bin/osx/verusd/fetch-bootstrap`); return api; @@ -149,7 +144,6 @@ const pathsDaemons = (api) => { api.paths.verusDir = `${global.HOME}/.verus`, api.paths.verusTestDir = `${global.HOME}/.verustest`, api.paths.zcashParamsDir = `${global.HOME}/.zcash-params`, - api.paths.chipsDir = `${global.HOME}/.chips`, api.paths.mmBin = path.join(__dirname, '../../node_modules/marketmaker/bin/linux/x64/marketmaker'); api.paths[`vrsc-fetch-bootstrap`] = path.join(__dirname, `../../assets/bin/linux64/verusd/fetch-bootstrap`); return api; @@ -166,8 +160,6 @@ const pathsDaemons = (api) => { api.paths.verusDir = path.normalize(api.paths.verusDir), api.paths.verusTestDir = `${global.HOME}/VerusTest`, api.paths.verusTestDir = path.normalize(api.paths.verusTestDir), - api.paths.chipsDir = `${global.HOME}/Chips`, - api.paths.chipsDir = path.normalize(api.paths.chipsDir); api.paths.zcashParamsDir = `${global.HOME}/ZcashParams`; api.paths.zcashParamsDir = path.normalize(api.paths.zcashParamsDir); api.paths.mmBin = path.join(__dirname, '../../node_modules/marketmaker/bin/win32/x64/marketmaker.exe'); diff --git a/routes/api/utils/constants/daemons.js b/routes/api/utils/constants/daemons.js index 88708aec..06b8b79a 100644 --- a/routes/api/utils/constants/daemons.js +++ b/routes/api/utils/constants/daemons.js @@ -1,18 +1,15 @@ const VERUS_DAEMON = 'verusd'; -const ZCASH_DAEMON = 'zcashd'; const KOMODO_DAEMON = 'komodod'; const PIRATE_DAEMON = 'pirated'; const DAEMON_NAMES = [ VERUS_DAEMON, - ZCASH_DAEMON, KOMODO_DAEMON, PIRATE_DAEMON ]; module.exports = { VERUS_DAEMON, - ZCASH_DAEMON, KOMODO_DAEMON, PIRATE_DAEMON, DAEMON_NAMES diff --git a/routes/appConfig.js b/routes/appConfig.js index 059f408c..f96a12b1 100644 --- a/routes/appConfig.js +++ b/routes/appConfig.js @@ -54,7 +54,7 @@ const appConfig = { defaultUserId: "", reservedChains: coinObjArray .map(coinObj => coinObj.id) - .concat(["KOMODO", "zcashd", "pirated", "komodod", "chipsd"]), + .concat(["KOMODO", "pirated", "komodod"]), pbaasChains: [], pbaasTestmode: true, alwaysPromptUpdates: true, diff --git a/routes/chainParams.js b/routes/chainParams.js index 9d7f2b31..ba7d6f0a 100644 --- a/routes/chainParams.js +++ b/routes/chainParams.js @@ -5,9 +5,6 @@ const chainParams = { VRSC: { ac_name: "VRSC" }, - ZEC: { - addnode: ['mainnet.z.cash'] - }, VRSCTEST: { ac_name: "VRSCTEST" }, diff --git a/routes/coinDataTranslated.js b/routes/coinDataTranslated.js index a1c0a734..7f5e0f9d 100644 --- a/routes/coinDataTranslated.js +++ b/routes/coinDataTranslated.js @@ -120,8 +120,6 @@ var getCoinObj = function getCoinObj(chainTicker) { chainTickerUc !== "VRSCTEST" ) { coinObj.options.daemon = 'komodod'; // komodod - } else if (chainTickerUc === 'ZEC') { - coinObj.options.daemon = 'zcashd' } else { coinObj.options.daemon = 'verusd'; // verusd } diff --git a/routes/ports.js b/routes/ports.js index fe04475b..8c74f3d7 100644 --- a/routes/ports.js +++ b/routes/ports.js @@ -6,7 +6,6 @@ const assetChainPorts = { OOT: 12467, PIZZA: 11608, BEER: 8923, - CHIPS: 57776, SUPERNET: 11341, REVS: 10196, WLC: 12167, @@ -51,9 +50,8 @@ const assetChainPorts = { ZEXO: 33970, LABS: 40265, DP: 28388, - VRSCTEST: 18299, + VRSCTEST: 18843, VRSC: 27486, - ZEC: 11192, VOTE2020: 44249, VOTE2021: 55638 }; diff --git a/routes/workers/openExternalSafe.js b/routes/workers/openExternalSafe.js index 1efd33b4..bcdaa239 100644 --- a/routes/workers/openExternalSafe.js +++ b/routes/workers/openExternalSafe.js @@ -41,7 +41,6 @@ const allowedOrigins = [ 'bots.kmdexplorer.io', 'mgw.kmdexplorer.io', 'wlc.kmdexplorer.io', - 'explorer.chips.cash', 'explorer.coqui.cash', '178.62.240.191', 'btch.kmdexplorer.io', From 0720062f865e9f466c292e951c47e9c59acfacbb Mon Sep 17 00:00:00 2001 From: michaeltout Date: Wed, 23 Oct 2024 06:37:32 +0200 Subject: [PATCH 06/17] Update deps --- package.json | 3 ++- yarn.lock | 35 ++++++----------------------------- 2 files changed, 8 insertions(+), 30 deletions(-) diff --git a/package.json b/package.json index dc02e340..a493c5e6 100644 --- a/package.json +++ b/package.json @@ -192,6 +192,7 @@ "axios": "1.6.5", "json5": "2.2.2", "semver": "6.3.1", - "tough-cookie": "4.1.3" + "tough-cookie": "4.1.3", + "secp256k1": "3.8.1" } } diff --git a/yarn.lock b/yarn.lock index 0bfa263d..3f064370 100644 --- a/yarn.lock +++ b/yarn.lock @@ -2737,7 +2737,7 @@ electron@22.3.25: "@types/node" "^16.11.26" extract-zip "^2.0.1" -elliptic@6.5.2, elliptic@6.5.3, elliptic@6.5.4, elliptic@=3.0.3, elliptic@^6.4.0, elliptic@^6.4.1, elliptic@^6.5.2: +elliptic@6.5.2, elliptic@6.5.3, elliptic@6.5.4, elliptic@=3.0.3, elliptic@^6.4.0, elliptic@^6.5.2, elliptic@^6.5.7: version "6.5.4" resolved "https://registry.yarnpkg.com/elliptic/-/elliptic-6.5.4.tgz#da37cebd31e79a1367e941b592ed1fbebd58abbb" integrity sha512-iLhC6ULemrljPZb+QutR5TQGB+pdW6KGD5RSegS+8sorOZT+rdQFbsQFJgvN3eRqNALqJer4oQ16YvJHlU8hzQ== @@ -6547,43 +6547,20 @@ scrypt-js@3.0.1, scrypt-js@^3.0.0, scrypt-js@^3.0.1: resolved "https://registry.yarnpkg.com/scrypt-js/-/scrypt-js-3.0.1.tgz#d314a57c2aef69d1ad98a138a21fe9eafa9ee312" integrity sha512-cdwTTnqPu0Hyvf5in5asVdZocVDTNRmR7XEcJuIzMjJeSHybHl7vpB66AzwTaIg6CLSbtjcxc8fqcySfnTkccA== -secp256k1@^3.0.1: - version "3.8.0" - resolved "https://registry.yarnpkg.com/secp256k1/-/secp256k1-3.8.0.tgz#28f59f4b01dbee9575f56a47034b7d2e3b3b352d" - integrity sha512-k5ke5avRZbtl9Tqx/SA7CbY3NF6Ro+Sj9cZxezFzuBlLDmyqPiL8hJJ+EmzD8Ig4LUDByHJ3/iPOVoRixs/hmw== - dependencies: - bindings "^1.5.0" - bip66 "^1.1.5" - bn.js "^4.11.8" - create-hash "^1.2.0" - drbg.js "^1.0.1" - elliptic "^6.5.2" - nan "^2.14.0" - safe-buffer "^5.1.2" - -secp256k1@^3.5.2: - version "3.7.1" - resolved "https://registry.yarnpkg.com/secp256k1/-/secp256k1-3.7.1.tgz#12e473e0e9a7c2f2d4d4818e722ad0e14cc1e2f1" - integrity sha512-1cf8sbnRreXrQFdH6qsg2H71Xw91fCCS9Yp021GnUNJzWJS/py96fS4lHbnTnouLp08Xj6jBoBB6V78Tdbdu5g== +secp256k1@3.8.1, secp256k1@^3.0.1, secp256k1@^3.5.2, secp256k1@^4.0.1: + version "3.8.1" + resolved "https://registry.yarnpkg.com/secp256k1/-/secp256k1-3.8.1.tgz#b62a62a882d6b16f9b51fe599c6b3a861e36c59f" + integrity sha512-tArjQw2P0RTdY7QmkNehgp6TVvQXq6ulIhxv8gaH6YubKG/wxxAoNKcbuXjDhybbc+b2Ihc7e0xxiGN744UIiQ== dependencies: bindings "^1.5.0" bip66 "^1.1.5" bn.js "^4.11.8" create-hash "^1.2.0" drbg.js "^1.0.1" - elliptic "^6.4.1" + elliptic "^6.5.7" nan "^2.14.0" safe-buffer "^5.1.2" -secp256k1@^4.0.1: - version "4.0.2" - resolved "https://registry.yarnpkg.com/secp256k1/-/secp256k1-4.0.2.tgz#15dd57d0f0b9fdb54ac1fa1694f40e5e9a54f4a1" - integrity sha512-UDar4sKvWAksIlfX3xIaQReADn+WFnHvbVujpcbr+9Sf/69odMwy2MUsz5CKLQgX9nsIyrjuxL2imVyoNHa3fg== - dependencies: - elliptic "^6.5.2" - node-addon-api "^2.0.0" - node-gyp-build "^4.2.0" - semver-compare@1.0.0, semver-compare@^1.0.0: version "1.0.0" resolved "https://registry.yarnpkg.com/semver-compare/-/semver-compare-1.0.0.tgz#0dee216a1c941ab37e9efb1788f6afc5ff5537fc" From 2b4f4b1c6cca4fdb67ea2744108c80b7b343f9b9 Mon Sep 17 00:00:00 2001 From: mcstoer <49734282+mcstoer@users.noreply.github.com> Date: Sun, 13 Oct 2024 11:01:00 -0700 Subject: [PATCH 07/17] Update handling of the deeplinks for login consent requests to match the newer version. --- package.json | 1 + routes/api/dlhandler.js | 8 +- .../api/native/verusid/login/signResponse.js | 42 ++++- .../api/native/verusid/login/verifyRequest.js | 19 +- routes/api/plugin/builtin/loginconsentui.js | 10 +- routes/deeplink/openurlhandler.js | 11 +- yarn.lock | 174 ++++++++++++++++-- 7 files changed, 231 insertions(+), 34 deletions(-) diff --git a/package.json b/package.json index 971682a0..5465625b 100644 --- a/package.json +++ b/package.json @@ -45,6 +45,7 @@ "typescript": "4.4.4" }, "dependencies": { + "@bitgo/utxo-lib": "git+https://github.com/VerusCoin/BitGoJS.git#8a9c08f51f3af53cd691ff5346196d54b34ae04c", "@electron/remote": "1.1.0", "@ethersproject/signing-key": "5.0.5", "@xmldom/xmldom": "0.8.4", diff --git a/routes/api/dlhandler.js b/routes/api/dlhandler.js index 12289cb2..30d0ebc8 100644 --- a/routes/api/dlhandler.js +++ b/routes/api/dlhandler.js @@ -1,4 +1,4 @@ -const { LOGIN_CONSENT_REQUEST_VDXF_KEY } = require('verus-typescript-primitives'); +const { LOGIN_CONSENT_REQUEST_VDXF_KEY, LoginConsentRequest } = require('verus-typescript-primitives'); const base64url = require("base64url"); module.exports = (api) => { @@ -6,9 +6,11 @@ module.exports = (api) => { const handlers = { [LOGIN_CONSENT_REQUEST_VDXF_KEY.vdxfid]: (url) => { const value = url.searchParams.get(LOGIN_CONSENT_REQUEST_VDXF_KEY.vdxfid) - + const req = new LoginConsentRequest(); + req.fromBuffer(base64url.toBuffer(value)); + return api.loginConsentUi.request( - JSON.parse(base64url.decode(value)), + req.toJson(), { id: "VERUS_DESKTOP_MAIN", search_builtin: true diff --git a/routes/api/native/verusid/login/signResponse.js b/routes/api/native/verusid/login/signResponse.js index 786066b8..4411ee76 100644 --- a/routes/api/native/verusid/login/signResponse.js +++ b/routes/api/native/verusid/login/signResponse.js @@ -4,6 +4,15 @@ const { LOGIN_CONSENT_RESPONSE_SIG_VDXF_KEY, } = require("verus-typescript-primitives"); +const { + ECPair, + networks, + IdentitySignature +} = require("@bitgo/utxo-lib"); + +const ID_SIG_VERSION = 2 +const ID_SIG_TYPE = 5 + module.exports = (api) => { api.native.verusid.login.sign_response = async (response) => { const loginResponse = new LoginConsentResponse(response); @@ -16,22 +25,37 @@ module.exports = (api) => { throw new Error(verificatonCheck.message); } - const subject = loginResponse.decision.request.challenge.subject; - if (subject != null && loginResponse.signing_id !== subject) - throw new Error("Cannot sign request for different user."); + // Sign the decision hash of the response not using the daemon since sign_hash is disabled. + const info = await api.native.get_info(response.chain_id) + + const signingIdentity = await api.native.get_identity(response.chain_id, loginResponse.signing_id); + + const network = response.chain_id == "VRSC" ? networks.verus : networks.verustest; - const userSignature = await api.native.sign_message( - loginResponse.chain_id, - loginResponse.signing_id, - loginResponse.getSignedData() + const wif = await api.native.get_privkey(response.chain_id, signingIdentity.identity.primaryaddresses[0]) + + const keyPair = ECPair.fromWIF(wif, network); + + const sig = new IdentitySignature( + network, + ID_SIG_VERSION, + ID_SIG_TYPE, + info.longestchain, + null, + response.system_id, + response.signing_id ); + sig.signHashOffline(loginResponse.getDecisionHash(info.longestchain), keyPair); + + const signedSig = sig.toBuffer().toString("base64"); + loginResponse.signature = new VerusIDSignature( - { signature: userSignature.signature }, + { signature: signedSig }, LOGIN_CONSENT_RESPONSE_SIG_VDXF_KEY ); - return { response: loginResponse.stringable() }; + return { response: loginResponse}; }; api.setPost("/native/verusid/login/sign_response", async (req, res, next) => { diff --git a/routes/api/native/verusid/login/verifyRequest.js b/routes/api/native/verusid/login/verifyRequest.js index ee747009..183abea7 100644 --- a/routes/api/native/verusid/login/verifyRequest.js +++ b/routes/api/native/verusid/login/verifyRequest.js @@ -8,10 +8,23 @@ module.exports = (api) => { api.native.verusid.login.verify_request = async (request) => { const loginConsentRequest = new LoginConsentRequest(request); - const verified = await api.native.verify_message( - loginConsentRequest.chain_id, + let chain_id + + switch (loginConsentRequest.system_id) { + case "i5w5MuNik5NtLcYmNzcvaoixooEebB6MGV": + chain_id = "VRSC"; + break; + case "iJhCezBExJHvtyH3fGhNnt2NhU4Ztkf2yq": + chain_id = "VRSCTEST"; + break; + default: + throw new Error("Unknown system id.") + } + + const verified = await api.native.verify_hash( + chain_id, loginConsentRequest.signing_id, - loginConsentRequest.getSignedData(), + loginConsentRequest.challenge.toSha256().toString('hex'), loginConsentRequest.signature.signature ); diff --git a/routes/api/plugin/builtin/loginconsentui.js b/routes/api/plugin/builtin/loginconsentui.js index 482c5636..edd99eb2 100644 --- a/routes/api/plugin/builtin/loginconsentui.js +++ b/routes/api/plugin/builtin/loginconsentui.js @@ -3,6 +3,7 @@ const { LOGIN_CONSENT_RESPONSE_VDXF_KEY, LOGIN_CONSENT_WEBHOOK_VDXF_KEY, LOGIN_CONSENT_REDIRECT_VDXF_KEY, + LoginConsentResponse, } = require("verus-typescript-primitives"); const { pushMessage } = require('../../../ipc/ipc'); const { ReservedPluginTypes } = require('../../utils/plugin/builtin'); @@ -14,8 +15,8 @@ module.exports = (api) => { api.loginConsentUi = {} api.loginConsentUi.handle_redirect = (response, redirectinfo) => { - const { type, uri } = redirectinfo - + const { vdxfkey, uri } = redirectinfo + const handlers = { [LOGIN_CONSENT_WEBHOOK_VDXF_KEY.vdxfid]: async () => { return await axios.post( @@ -25,9 +26,10 @@ module.exports = (api) => { }, [LOGIN_CONSENT_REDIRECT_VDXF_KEY.vdxfid]: () => { const url = new URL(uri) + const res = new LoginConsentResponse(response) url.searchParams.set( LOGIN_CONSENT_RESPONSE_VDXF_KEY.vdxfid, - base64url(JSON.stringify(response)) + base64url(res.toBuffer()) ); shell.openExternal(url.toString()) @@ -35,7 +37,7 @@ module.exports = (api) => { } } - return handlers[type] == null ? null : handlers[type](); + return handlers[vdxfkey] == null ? null : handlers[vdxfkey](); } api.loginConsentUi.request = async ( diff --git a/routes/deeplink/openurlhandler.js b/routes/deeplink/openurlhandler.js index d51d4315..5828959c 100644 --- a/routes/deeplink/openurlhandler.js +++ b/routes/deeplink/openurlhandler.js @@ -12,10 +12,13 @@ function openurlhandler(event, urlstring, apihandler) { return apihandler(url); } catch (e) { - dialog.showErrorBox( - "Something went wrong", - `Error: "${e.message}". For url string: "${urlstring}".` - ); + setTimeout(() => { + // This avoids crashing 20 seconds after the error box has been left open. + dialog.showErrorBox( + "Something went wrong?", + `Error: "${e.message}". For url string: "${urlstring}".` + ); + }, 0); } } diff --git a/yarn.lock b/yarn.lock index a02d3da0..459fa475 100644 --- a/yarn.lock +++ b/yarn.lock @@ -28,6 +28,47 @@ chalk "^2.0.0" js-tokens "^4.0.0" +"@bitgo/blake2b-wasm@^3.0.1": + version "3.2.3" + resolved "https://registry.yarnpkg.com/@bitgo/blake2b-wasm/-/blake2b-wasm-3.2.3.tgz#6ae5e942f2a5fd5b3ed27103af5df0ed50adfbc9" + integrity sha512-NaurBrMaEpjfg7EdUJgW/c6byt27O6q1ZaxB5Ita10MjjYjUu0SyYF4q7JPNxpHF/lMxb0YZakOxigbDBu9Jjw== + dependencies: + nanoassert "^1.0.0" + +"@bitgo/blake2b@3.0.1": + version "3.0.1" + resolved "https://registry.yarnpkg.com/@bitgo/blake2b/-/blake2b-3.0.1.tgz#d9f2893420c1d4861fea0e05d775afd99a191b00" + integrity sha512-+Neg+nsqUhYOPlvyITHXYzKUTJofyxYdLQTzNjufamifBzxLGTpgn2KKUfvGNsGovlUYzlyPZj+CB6je2D7mhw== + dependencies: + "@bitgo/blake2b-wasm" "^3.0.1" + nanoassert "^2.0.0" + +"@bitgo/utxo-lib@git+https://github.com/VerusCoin/BitGoJS.git#8a9c08f51f3af53cd691ff5346196d54b34ae04c": + version "1.9.6" + resolved "git+https://github.com/VerusCoin/BitGoJS.git#8a9c08f51f3af53cd691ff5346196d54b34ae04c" + dependencies: + "@bitgo/blake2b" "3.0.1" + bech32 "0.0.3" + bigi "1.4.0" + bip32 "2.0.6" + bip66 "1.1.0" + bitcoin-ops "git+https://github.com/VerusCoin/bitcoin-ops" + bs58check "2.0.0" + create-hash "1.1.0" + create-hmac "1.1.3" + debug "~3.1.0" + ecurve "1.0.0" + merkle-lib "2.0.10" + pushdata-bitcoin "1.0.1" + randombytes "2.0.1" + safe-buffer "5.0.1" + typeforce "1.11.3" + varuint-bitcoin "1.0.4" + verus-typescript-primitives "git+https://github.com/VerusCoin/verus-typescript-primitives.git" + wif "2.0.1" + optionalDependencies: + secp256k1 "3.5.2" + "@develar/schema-utils@~2.6.5": version "2.6.5" resolved "https://registry.yarnpkg.com/@develar/schema-utils/-/schema-utils-2.6.5.tgz#3ece22c5838402419a6e0425f85742b961d9b6c6" @@ -929,6 +970,11 @@ resolved "https://registry.yarnpkg.com/@types/node/-/node-14.0.1.tgz#5d93e0a099cd0acd5ef3d5bde3c086e1f49ff68c" integrity sha512-FAYBGwC+W6F9+huFIDtn43cpy7+SzG+atzRiTfdp3inUKL2hXnd4rG8hylJLIh4+hqrQy1P17kvJByE/z825hA== +"@types/node@10.12.18": + version "10.12.18" + resolved "https://registry.yarnpkg.com/@types/node/-/node-10.12.18.tgz#1d3ca764718915584fcd9f6344621b7672665c67" + integrity sha512-fh+pAqt4xRzPfqA6eh3Z2y6fyZavRIumvjhaCL753+TVkGKGhpPeyrJG2JftD0T9q4GF00KjefsQ+PQNDdWQaQ== + "@types/node@>=10.0.0": version "17.0.16" resolved "https://registry.yarnpkg.com/@types/node/-/node-17.0.16.tgz#e3733f46797b9df9e853ca9f719c8a6f7b84cd26" @@ -1364,6 +1410,11 @@ big-integer@^1.6.17: resolved "https://registry.yarnpkg.com/big-integer/-/big-integer-1.6.50.tgz#299a4be8bd441c73dcc492ed46b7169c34e92e70" integrity sha512-+O2uoQWFRo8ysZNo/rjtri2jIwjr3XfeAgRjAUADRqGG+ZITvyn8J1kvXLTaKVr3hhGXk+f23tKfdzmklVM9vQ== +bigi@1.4.0: + version "1.4.0" + resolved "https://registry.yarnpkg.com/bigi/-/bigi-1.4.0.tgz#90ac1aeac0a531216463bdb58f42c1e05c8407ac" + integrity sha512-TUFZGBZiOE98fuGBot6SKLQPFmRkXyeyOybmE8XMUDsrwP380cFh8qs7VX8C2CLj73OYW7+sgCStfL3ySy+Ozg== + bigi@1.4.2, bigi@^1.1.0, bigi@^1.4.0, bigi@^1.4.2: version "1.4.2" resolved "https://registry.yarnpkg.com/bigi/-/bigi-1.4.2.tgz#9c665a95f88b8b08fc05cfd731f561859d725825" @@ -1394,13 +1445,26 @@ binary@~0.3.0: buffers "~0.1.1" chainsaw "~0.1.0" -bindings@^1.3.0, bindings@^1.5.0: +bindings@^1.2.1, bindings@^1.3.0, bindings@^1.5.0: version "1.5.0" resolved "https://registry.yarnpkg.com/bindings/-/bindings-1.5.0.tgz#10353c9e945334bc0511a6d90b38fbc7c9c504df" integrity sha512-p2q/t/mhvuOj/UeLlV6566GD/guowlr0hHxClI0W9m7MWYkL1F0hLo+0Aexs9HSPCtR1SXQ0TD3MMKrXZajbiQ== dependencies: file-uri-to-path "1.0.0" +bip32@2.0.6: + version "2.0.6" + resolved "https://registry.yarnpkg.com/bip32/-/bip32-2.0.6.tgz#6a81d9f98c4cd57d05150c60d8f9e75121635134" + integrity sha512-HpV5OMLLGTjSVblmrtYRfFFKuQB+GArM0+XP8HGWfJ5vxYBqo+DesvJwOdC2WJ3bCkZShGf0QIfoIpeomVzVdA== + dependencies: + "@types/node" "10.12.18" + bs58check "^2.1.1" + create-hash "^1.2.0" + create-hmac "^1.1.7" + tiny-secp256k1 "^1.1.3" + typeforce "^1.11.5" + wif "^2.0.6" + bip32@^1.0.2, bip32@^1.0.4: version "1.0.4" resolved "https://registry.yarnpkg.com/bip32/-/bip32-1.0.4.tgz#188ad57a45fb1342c9aabe969d0612c704a987b4" @@ -1424,17 +1488,21 @@ bip39@^2.3.1, bip39@^2.4.0: safe-buffer "^5.0.1" unorm "^1.3.3" -bip66@^1.1.0, bip66@^1.1.5: +bip66@1.1.0: + version "1.1.0" + resolved "https://registry.yarnpkg.com/bip66/-/bip66-1.1.0.tgz#c5551d49d1696d78211be047e997fe7aac8820c5" + integrity sha512-dBoAPJYg6HaaQeJGr4cNiqat1meGzlrv2qX+EJcW5q0zEdryMSLKlQKdTaCtDnrzEUPkwmlYqsD7ANaye4BEfg== + +bip66@^1.1.0, bip66@^1.1.3, bip66@^1.1.5: version "1.1.5" resolved "https://registry.yarnpkg.com/bip66/-/bip66-1.1.5.tgz#01fa8748785ca70955d5011217d1b3139969ca22" integrity sha1-AfqHSHhcpwlV1QESF9GzE5lpyiI= dependencies: safe-buffer "^5.0.1" -bitcoin-ops@^1.3.0, bitcoin-ops@^1.4.0, bitcoin-ops@^1.4.1: +bitcoin-ops@^1.3.0, bitcoin-ops@^1.4.0, bitcoin-ops@^1.4.1, "bitcoin-ops@git+https://github.com/VerusCoin/bitcoin-ops": version "1.4.1" - resolved "https://registry.yarnpkg.com/bitcoin-ops/-/bitcoin-ops-1.4.1.tgz#e45de620398e22fd4ca6023de43974ff42240278" - integrity sha512-pef6gxZFztEhaE9RY9HmWVmiIHqCb2OyS4HPKkpc6CIiiOa3Qmuoylxc5P2EkU3w+5eTSifI9SEZC88idAIGow== + resolved "git+https://github.com/VerusCoin/bitcoin-ops#a5f8f56e658301bc39881d41740b3a0010530efd" bitcoinjs-lib@^4.0.1: version "4.0.5" @@ -1570,7 +1638,7 @@ bluebird@~3.4.1: resolved "https://registry.yarnpkg.com/bluebird/-/bluebird-3.4.7.tgz#f72d760be09b7f76d08ed8fae98b289a8d05fab3" integrity sha1-9y12C+Cbf3bQjtj66Ysomo0F+rM= -bn.js@4.11.6, bn.js@4.11.8, bn.js@5.2.1, bn.js@=2.0.4, bn.js@^4.11.0, bn.js@^4.11.1, bn.js@^4.11.6, bn.js@^4.11.8, bn.js@^4.11.9, bn.js@^4.4.0, bn.js@^5.1.2, bn.js@^5.2.0, bn.js@^5.2.1: +bn.js@4.11.6, bn.js@4.11.8, bn.js@5.2.1, bn.js@=2.0.4, bn.js@^4.11.0, bn.js@^4.11.1, bn.js@^4.11.3, bn.js@^4.11.6, bn.js@^4.11.8, bn.js@^4.11.9, bn.js@^4.4.0, bn.js@^5.1.2, bn.js@^5.2.0, bn.js@^5.2.1: version "4.11.8" resolved "https://registry.yarnpkg.com/bn.js/-/bn.js-4.11.8.tgz#2cde09eb5ee341f484746bb0309b3253b1b1442f" integrity sha512-ItfYfPLkWHUjckQCk8xC+LwxgK8NYcXywGigJgSwOP8Y2iyWT4f2vsZnoOXTTbo+o5yXmIUJ4gn5538SO5S3gA== @@ -1672,7 +1740,7 @@ bs58@=2.0.0: resolved "https://registry.yarnpkg.com/bs58/-/bs58-2.0.0.tgz#72b713bed223a0ac518bbda0e3ce3f4817f39eb5" integrity sha1-crcTvtIjoKxRi72g484/SBfznrU= -bs58@^3.0.0: +bs58@^3.0.0, bs58@^3.1.0: version "3.1.0" resolved "https://registry.yarnpkg.com/bs58/-/bs58-3.1.0.tgz#d4c26388bf4804cac714141b1945aa47e5eb248e" integrity sha512-9C2bRFTGy3meqO65O9jLvVTyawvhLVp4h2ECm5KlRPuV5KPDNJZcJIj3gl+aA0ENXcYrUSLCkPAeqbTcI2uWyQ== @@ -1686,6 +1754,14 @@ bs58@^4.0.0: dependencies: base-x "^3.0.2" +bs58check@2.0.0: + version "2.0.0" + resolved "https://registry.yarnpkg.com/bs58check/-/bs58check-2.0.0.tgz#b70fffd80bc72de18a040a547d7e5e08ce1b1e4e" + integrity sha512-afttdRHvL1HCgBJqcMtoRXe8xCQ7fbUidoLp1JTRXT4bAvtfDyZx7mb79w82XkcdIFFstG3A4NhKOBdEsLbQbw== + dependencies: + bs58 "^4.0.0" + create-hash "^1.1.0" + bs58check@<3.0.0, bs58check@^2.0.0, bs58check@^2.1.1, bs58check@^2.1.2: version "2.1.2" resolved "https://registry.yarnpkg.com/bs58check/-/bs58check-2.1.2.tgz#53b018291228d82a5aa08e7d796fdafda54aebfc" @@ -1695,6 +1771,14 @@ bs58check@<3.0.0, bs58check@^2.0.0, bs58check@^2.1.1, bs58check@^2.1.2: create-hash "^1.1.0" safe-buffer "^5.1.2" +bs58check@^1.0.6: + version "1.3.4" + resolved "https://registry.yarnpkg.com/bs58check/-/bs58check-1.3.4.tgz#c52540073749117714fa042c3047eb8f9151cbf8" + integrity sha512-+cZ/mYuyfHboELKvDTYF6onDT4XEgbM9kBsKW91q2YlyDsGRpgT/O6pU4ws5n+LD38XAiD7LChgB3+NBqMGk6g== + dependencies: + bs58 "^3.1.0" + create-hash "^1.1.0" + "bs58check@https://github.com/bitcoinjs/bs58check": version "2.1.2" resolved "https://github.com/bitcoinjs/bs58check#12b3e700f355c5c49d0be3f8fc29be6c66e753e9" @@ -2299,6 +2383,15 @@ crc@^3.8.0: dependencies: buffer "^5.1.0" +create-hash@1.1.0: + version "1.1.0" + resolved "https://registry.yarnpkg.com/create-hash/-/create-hash-1.1.0.tgz#c2ab96b5d4ece5f22df2ef4306803d14da6931e7" + integrity sha512-We+Cyev4lG5VlvuSRkNkOhSMu8l2QoMgQR8e/j/fYUQvleXXtF/9apzzLZF9plriySKWQ5cW/PUx3RSTcKMqTA== + dependencies: + inherits "^2.0.1" + ripemd160 "^1.0.0" + sha.js "^2.3.6" + create-hash@1.2.0, create-hash@^1.1.0, create-hash@^1.1.2, create-hash@^1.2.0: version "1.2.0" resolved "https://registry.yarnpkg.com/create-hash/-/create-hash-1.2.0.tgz#889078af11a63756bcfb59bd221996be3a9ef196" @@ -2320,6 +2413,14 @@ create-hash@1.2.0, create-hash@^1.1.0, create-hash@^1.1.2, create-hash@^1.2.0: ripemd160 "^2.0.2" sha.js "^2.4.0" +create-hmac@1.1.3: + version "1.1.3" + resolved "https://registry.yarnpkg.com/create-hmac/-/create-hmac-1.1.3.tgz#29843e9c191ba412ab001bc55ac8b8b9ae54b670" + integrity sha512-WAh5X07rFIM0EZ166unEOAMdrPWcg7A6alzdqIRNnMn8woJnZfKUFOBpAIzOEzrn1ouRjRv+O+gcESddnN/Xlw== + dependencies: + create-hash "^1.1.0" + inherits "^2.0.1" + create-hmac@^1.1.3, create-hmac@^1.1.4, create-hmac@^1.1.7: version "1.1.7" resolved "https://registry.yarnpkg.com/create-hmac/-/create-hmac-1.1.7.tgz#69170c78b3ab957147b2b8b04572e47ead2243ff" @@ -2651,6 +2752,13 @@ ecc-jsbn@~0.1.1: jsbn "~0.1.0" safer-buffer "^2.1.0" +ecurve@1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/ecurve/-/ecurve-1.0.0.tgz#32cfd5ce5f421e9351206a33d4e3cfd36f3465a4" + integrity sha512-gwAh/B9hSnkq5SssZhJnXaXHcKrBK2tCh76G12+BXXjqLH4Kx1QBALz9IszvUtrxhM9+SBXx6fU0dW4WDBk2pA== + dependencies: + bigi "^1.1.0" + ecurve@^1.0.0: version "1.0.6" resolved "https://registry.yarnpkg.com/ecurve/-/ecurve-1.0.6.tgz#dfdabbb7149f8d8b78816be5a7d5b83fcf6de797" @@ -4922,7 +5030,7 @@ merge-descriptors@1.0.1: resolved "https://registry.yarnpkg.com/merge-descriptors/-/merge-descriptors-1.0.1.tgz#b00aaa556dd8b44568150ec9d1b953f3f90cbb61" integrity sha1-sAqqVW3YtEVoFQ7J0blT8/kMu2E= -merkle-lib@^2.0.10: +merkle-lib@2.0.10, merkle-lib@^2.0.10: version "2.0.10" resolved "https://registry.yarnpkg.com/merkle-lib/-/merkle-lib-2.0.10.tgz#82b8dbae75e27a7785388b73f9d7725d0f6f3326" integrity sha1-grjbrnXieneFOItz+ddyXQ9vMyY= @@ -5169,6 +5277,11 @@ nan@^2.14.0: resolved "https://registry.yarnpkg.com/nan/-/nan-2.14.0.tgz#7818f722027b2459a86f0295d434d1fc2336c52c" integrity sha512-INOFj37C7k3AfaNTtX8RhsTw7qRy7eLET14cROi9+5HAVbbHuIWUHEauBv5qT4Av2tWasiTY1Jw6puUNqRJXQg== +nan@^2.2.1: + version "2.20.0" + resolved "https://registry.yarnpkg.com/nan/-/nan-2.20.0.tgz#08c5ea813dd54ed16e5bd6505bf42af4f7838ca3" + integrity sha512-bk3gXBZDGILuuo/6sKtr0DQmSThYHLtNCdSdXk9YkxD/jK6X2vmCyyXBBxyqZ4XcnzTyYEAThfX3DCEnLf6igw== + nano-json-stream-parser@^0.1.2: version "0.1.2" resolved "https://registry.yarnpkg.com/nano-json-stream-parser/-/nano-json-stream-parser-0.1.2.tgz#0cc8f6d0e2b622b479c40d499c46d64b755c6f5f" @@ -5184,6 +5297,11 @@ nanoassert@^1.0.0: resolved "https://registry.yarnpkg.com/nanoassert/-/nanoassert-1.1.0.tgz#4f3152e09540fde28c76f44b19bbcd1d5a42478d" integrity sha1-TzFS4JVA/eKMdvRLGbvNHVpCR40= +nanoassert@^2.0.0: + version "2.0.0" + resolved "https://registry.yarnpkg.com/nanoassert/-/nanoassert-2.0.0.tgz#a05f86de6c7a51618038a620f88878ed1e490c09" + integrity sha512-7vO7n28+aYO4J+8w96AzhmU8G+Y/xpPDJz/se19ICsqj/momRbb9mh9ZUtkoJ5X3nTnPdhEJyc0qnM6yAsHBaA== + negotiator@0.6.2: version "0.6.2" resolved "https://registry.yarnpkg.com/negotiator/-/negotiator-0.6.2.tgz#feacf7ccf525a77ae9634436a64883ffeca346fb" @@ -6080,7 +6198,7 @@ punycode@^2.1.0, punycode@^2.1.1: resolved "https://registry.yarnpkg.com/punycode/-/punycode-2.1.1.tgz#b58b010ac40c22c5657616c8d2c2c02c7bf479ec" integrity sha512-XRsRjdf+j5ml+y/6GKHPZbrF/8p2Yga0JPtdqTIY2Xe5ohJPD9saDJJLPvp9+NSBprVvevdXZybnj2cv8OEd0A== -pushdata-bitcoin@^1.0.1: +pushdata-bitcoin@1.0.1, pushdata-bitcoin@^1.0.1: version "1.0.1" resolved "https://registry.yarnpkg.com/pushdata-bitcoin/-/pushdata-bitcoin-1.0.1.tgz#15931d3cd967ade52206f523aa7331aef7d43af7" integrity sha1-FZMdPNlnreUiBvUjqnMxrvfUOvc= @@ -6135,6 +6253,11 @@ ramda@^0.24.1: resolved "https://registry.yarnpkg.com/ramda/-/ramda-0.24.1.tgz#c3b7755197f35b8dc3502228262c4c91ddb6b857" integrity sha1-w7d1UZfzW43DUCIoJixMkd22uFc= +randombytes@2.0.1: + version "2.0.1" + resolved "https://registry.yarnpkg.com/randombytes/-/randombytes-2.0.1.tgz#18f4a9ba0dd07bdb1580bc9156091fcf90eabc6f" + integrity sha512-siCt2duOdZbmvgk8IDL4U0SYXI8ypBEKWuor0qUpHBWAyOCrXQvSIYJ+VKuEpoX36moZ1pAu+mXkwUVAVssu6w== + randombytes@^2.0.1, randombytes@^2.1.0: version "2.1.0" resolved "https://registry.yarnpkg.com/randombytes/-/randombytes-2.1.0.tgz#df6f84372f0270dc65cdf6291349ab7a473d4f2a" @@ -6519,6 +6642,11 @@ rimraf@^3.0.0, rimraf@^3.0.2: dependencies: glob "^7.1.3" +ripemd160@^1.0.0: + version "1.0.1" + resolved "https://registry.yarnpkg.com/ripemd160/-/ripemd160-1.0.1.tgz#93a4bbd4942bc574b69a8fa57c71de10ecca7d6e" + integrity sha512-J0YlH2ow/i7d5PJX9RC1XnjmZc7cNNYWe89PIlFszvHeiEtxzA1/VYePkjQ7l1SkUejAcHeDo3IVp2WIzstXXQ== + ripemd160@^2.0.0, ripemd160@^2.0.1, ripemd160@^2.0.2: version "2.0.2" resolved "https://registry.yarnpkg.com/ripemd160/-/ripemd160-2.0.2.tgz#a1c1a6f624751577ba5d07914cbc92850585890c" @@ -6560,6 +6688,11 @@ run-queue@^1.0.0, run-queue@^1.0.3: dependencies: aproba "^1.1.1" +safe-buffer@5.0.1: + version "5.0.1" + resolved "https://registry.yarnpkg.com/safe-buffer/-/safe-buffer-5.0.1.tgz#d263ca54696cd8a306b5ca6551e92de57918fbe7" + integrity sha512-cr7dZWLwOeaFBLTIuZeYdkfO7UzGIKhjYENJFAxUOMKWGaWDm2nJM2rzxNRm5Owu0DH3ApwNo6kx5idXZfb/Iw== + safe-buffer@5.2.1, safe-buffer@^5.2.1, safe-buffer@~5.2.0: version "5.2.1" resolved "https://registry.yarnpkg.com/safe-buffer/-/safe-buffer-5.2.1.tgz#1eaf9fa9bdb1fdd4ec75f58f9cdb4e6b7827eec6" @@ -6729,7 +6862,7 @@ setprototypeof@1.2.0: resolved "https://registry.yarnpkg.com/setprototypeof/-/setprototypeof-1.2.0.tgz#66c9a24a73f9fc28cbe66b09fed3d33dcaf1b424" integrity sha512-E5LDX7Wrp85Kil5bhZv46j8jOeboKq5JMmYM3gVGdGH8xFpPWXUMsNrlODCrkoxMEeNi/XZIwuRvY4XNwYMJpw== -sha.js@^2.4.0, sha.js@^2.4.8: +sha.js@^2.3.6, sha.js@^2.4.0, sha.js@^2.4.8: version "2.4.11" resolved "https://registry.yarnpkg.com/sha.js/-/sha.js-2.4.11.tgz#37a5cf0b81ecbc6943de109ba2960d1b26584ae7" integrity sha512-QMEp5B7cftE7APOjk5Y6xgrbWu+WkLVQwk8JNjZ8nKRciZaByEW6MubieAiToS7+dwvrjGhH8jRXz3MVd0AYqQ== @@ -7324,7 +7457,7 @@ tiny-relative-date@^1.3.0: resolved "https://registry.yarnpkg.com/tiny-relative-date/-/tiny-relative-date-1.3.0.tgz#fa08aad501ed730f31cc043181d995c39a935e07" integrity sha512-MOQHpzllWxDCHHaDno30hhLfbouoYlOI8YlMNtvKe1zXbjEVhbcEovQxvZrPvtiYW630GQDoMMarCnjfyfHA+A== -tiny-secp256k1@^1.0.0: +tiny-secp256k1@^1.0.0, tiny-secp256k1@^1.1.3: version "1.1.6" resolved "https://registry.yarnpkg.com/tiny-secp256k1/-/tiny-secp256k1-1.1.6.tgz#7e224d2bee8ab8283f284e40e6b4acb74ffe047c" integrity sha512-FmqJZGduTyvsr2cF3375fqGHUovSwDi/QytexX1Se4BPuPZpTE5Ftp5fg+EFSuEf3lhZqgCRjEG3ydUQ/aNiwA== @@ -7481,6 +7614,13 @@ typedarray@^0.0.6: resolved "https://registry.yarnpkg.com/typedarray/-/typedarray-0.0.6.tgz#867ac74e3864187b1d3d47d996a78ec5c8830777" integrity sha1-hnrHTjhkGHsdPUfZlqeOxciDB3c= +typeforce@1.11.3: + version "1.11.3" + resolved "https://registry.yarnpkg.com/typeforce/-/typeforce-1.11.3.tgz#a54d0ff58808788fba358020982270bd6995d8e4" + integrity sha512-+vllWbxe1AKLkO3KNyZPjb51NRHwRE/8bAi/cmF6TK24VqrPiQPRiHrFV19j1xHxxCHQbIvN4Zfco+skuiXSWQ== + dependencies: + inherits "^2.0.1" + typeforce@^1.11.1, typeforce@^1.11.3, typeforce@^1.11.5, "typeforce@git+https://github.com/michaeltout/typeforce": version "1.18.0" resolved "git+https://github.com/michaeltout/typeforce#c9b0abc33ff006d7a6a6150eff034bc7eb8b07de" @@ -7717,6 +7857,11 @@ varint@^5.0.0: resolved "https://registry.yarnpkg.com/varint/-/varint-5.0.2.tgz#5b47f8a947eb668b848e034dcfa87d0ff8a7f7a4" integrity sha512-lKxKYG6H03yCZUpAGOPOsMcGxd1RHCu1iKvEHYDPmTyq2HueGhD73ssNBqqQWfvYs04G9iUFRvmAVLW20Jw6ow== +varuint-bitcoin@1.0.4: + version "1.0.4" + resolved "https://registry.yarnpkg.com/varuint-bitcoin/-/varuint-bitcoin-1.0.4.tgz#d812c5dae16e32f60544b6adee1d4be1307d0283" + integrity sha512-2nW4pVicYWxOMY1u+3T3eFXw24wbFlKz+ug7hd02rozYmeFVBoC6LB7/P4E46jN9aD1ezhX01g2Uh4zrZ+9RWw== + varuint-bitcoin@^1.0.1, varuint-bitcoin@^1.0.4: version "1.1.2" resolved "https://registry.yarnpkg.com/varuint-bitcoin/-/varuint-bitcoin-1.1.2.tgz#e76c138249d06138b480d4c5b40ef53693e24e92" @@ -8110,6 +8255,13 @@ widest-line@^2.0.0: dependencies: string-width "^2.1.1" +wif@2.0.1: + version "2.0.1" + resolved "https://registry.yarnpkg.com/wif/-/wif-2.0.1.tgz#27149a62757e4db694729378e7aeca7b09648012" + integrity sha512-Ba/Ypzo2Vg512kPn+Rt8R1ss019J/8n5E+lVyHJDc8EwTZ8fNLmhkTe7GitxghAiENWuunOa4qnwl7KIj39zfw== + dependencies: + bs58check "^1.0.6" + wif@2.0.6, wif@^2.0.1, wif@^2.0.6: version "2.0.6" resolved "https://registry.yarnpkg.com/wif/-/wif-2.0.6.tgz#08d3f52056c66679299726fade0d432ae74b4704" From 6a3f91557237879f1ec7eee79c64895fbd1ac7f3 Mon Sep 17 00:00:00 2001 From: mcstoer <49734282+mcstoer@users.noreply.github.com> Date: Tue, 15 Oct 2024 16:21:51 -0700 Subject: [PATCH 08/17] Add mimetype to the desktop file of the AppImage and fix parsing of the deeplink for windows and linux. --- main.js | 2 +- package.json | 3 ++- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/main.js b/main.js index 91cfcaef..f0f59b7e 100644 --- a/main.js +++ b/main.js @@ -551,7 +551,7 @@ if (!hasLock) { focusMain(); if (process.platform == "win32" || process.platform == "linux") { - const argIndex = (appConfig.general.main.dev || process.argv.indexOf("devmode") > -1) ? 2 : 1; + const argIndex = 2; openurlhandler(null, argv.slice(1).toString().split(",")[argIndex], api.dlhandler); } } diff --git a/package.json b/package.json index 5465625b..dc4dc0d3 100644 --- a/package.json +++ b/package.json @@ -135,7 +135,8 @@ "artifactName": "${productName}-v${version}-${arch}.${ext}", "icon": "assets/icons/agama_icons", "desktop": { - "Encoding": "UTF-8" + "Encoding": "UTF-8", + "MimeType": "x-scheme-handler/i5jtwbp6zymeay9llnraglgjqgdrffsau4" }, "target": [ "appimage" From dbeabb9d03e36c66b4da1dd839877e64071d2495 Mon Sep 17 00:00:00 2001 From: mcstoer <49734282+mcstoer@users.noreply.github.com> Date: Wed, 16 Oct 2024 19:07:43 -0700 Subject: [PATCH 09/17] Change the signing of the login consent response to use the signdata command. --- package.json | 1 - routes/api/native/signdata.js | 30 +++ .../api/native/verusid/login/signResponse.js | 41 +--- yarn.lock | 185 +++--------------- 4 files changed, 59 insertions(+), 198 deletions(-) diff --git a/package.json b/package.json index dc4dc0d3..0b783a05 100644 --- a/package.json +++ b/package.json @@ -45,7 +45,6 @@ "typescript": "4.4.4" }, "dependencies": { - "@bitgo/utxo-lib": "git+https://github.com/VerusCoin/BitGoJS.git#8a9c08f51f3af53cd691ff5346196d54b34ae04c", "@electron/remote": "1.1.0", "@ethersproject/signing-key": "5.0.5", "@xmldom/xmldom": "0.8.4", diff --git a/routes/api/native/signdata.js b/routes/api/native/signdata.js index f6aec032..0cb05ac8 100644 --- a/routes/api/native/signdata.js +++ b/routes/api/native/signdata.js @@ -68,6 +68,36 @@ module.exports = (api) => { }); }; + /** + * Signs data given the arguments including an identity/address currently in the wallet + * and the data to be signed + * + * @param {String} coin The chainTicker of the coin to make the call on + * @param {String} arguments The arguments to pass to signdata + */ + api.native.sign_data = ( + coin, + arguments, + ) => { + return new Promise((resolve, reject) => { + api.native + .callDaemon( + coin, + "signdata", + [ + arguments, + ] + ) + .then(resultObj => { + resolve(resultObj) + }) + .catch(err => { + reject(err); + }); + }); + }; + + api.setPost('/native/sign_message', (req, res, next) => { const { chainTicker, diff --git a/routes/api/native/verusid/login/signResponse.js b/routes/api/native/verusid/login/signResponse.js index 4411ee76..6eb5668d 100644 --- a/routes/api/native/verusid/login/signResponse.js +++ b/routes/api/native/verusid/login/signResponse.js @@ -4,15 +4,6 @@ const { LOGIN_CONSENT_RESPONSE_SIG_VDXF_KEY, } = require("verus-typescript-primitives"); -const { - ECPair, - networks, - IdentitySignature -} = require("@bitgo/utxo-lib"); - -const ID_SIG_VERSION = 2 -const ID_SIG_TYPE = 5 - module.exports = (api) => { api.native.verusid.login.sign_response = async (response) => { const loginResponse = new LoginConsentResponse(response); @@ -25,33 +16,15 @@ module.exports = (api) => { throw new Error(verificatonCheck.message); } - // Sign the decision hash of the response not using the daemon since sign_hash is disabled. - const info = await api.native.get_info(response.chain_id) - - const signingIdentity = await api.native.get_identity(response.chain_id, loginResponse.signing_id); - - const network = response.chain_id == "VRSC" ? networks.verus : networks.verustest; - - const wif = await api.native.get_privkey(response.chain_id, signingIdentity.identity.primaryaddresses[0]) - - const keyPair = ECPair.fromWIF(wif, network); - - const sig = new IdentitySignature( - network, - ID_SIG_VERSION, - ID_SIG_TYPE, - info.longestchain, - null, - response.system_id, - response.signing_id - ); - - sig.signHashOffline(loginResponse.getDecisionHash(info.longestchain), keyPair); - - const signedSig = sig.toBuffer().toString("base64"); + const signdataResult = await api.native.sign_data(response.chain_id, + { + "address": loginResponse.signing_id, + "datahash": loginResponse.decision.toSha256().toString("hex") + } + ) loginResponse.signature = new VerusIDSignature( - { signature: signedSig }, + { signature: signdataResult.signature }, LOGIN_CONSENT_RESPONSE_SIG_VDXF_KEY ); diff --git a/yarn.lock b/yarn.lock index 459fa475..34059730 100644 --- a/yarn.lock +++ b/yarn.lock @@ -28,47 +28,6 @@ chalk "^2.0.0" js-tokens "^4.0.0" -"@bitgo/blake2b-wasm@^3.0.1": - version "3.2.3" - resolved "https://registry.yarnpkg.com/@bitgo/blake2b-wasm/-/blake2b-wasm-3.2.3.tgz#6ae5e942f2a5fd5b3ed27103af5df0ed50adfbc9" - integrity sha512-NaurBrMaEpjfg7EdUJgW/c6byt27O6q1ZaxB5Ita10MjjYjUu0SyYF4q7JPNxpHF/lMxb0YZakOxigbDBu9Jjw== - dependencies: - nanoassert "^1.0.0" - -"@bitgo/blake2b@3.0.1": - version "3.0.1" - resolved "https://registry.yarnpkg.com/@bitgo/blake2b/-/blake2b-3.0.1.tgz#d9f2893420c1d4861fea0e05d775afd99a191b00" - integrity sha512-+Neg+nsqUhYOPlvyITHXYzKUTJofyxYdLQTzNjufamifBzxLGTpgn2KKUfvGNsGovlUYzlyPZj+CB6je2D7mhw== - dependencies: - "@bitgo/blake2b-wasm" "^3.0.1" - nanoassert "^2.0.0" - -"@bitgo/utxo-lib@git+https://github.com/VerusCoin/BitGoJS.git#8a9c08f51f3af53cd691ff5346196d54b34ae04c": - version "1.9.6" - resolved "git+https://github.com/VerusCoin/BitGoJS.git#8a9c08f51f3af53cd691ff5346196d54b34ae04c" - dependencies: - "@bitgo/blake2b" "3.0.1" - bech32 "0.0.3" - bigi "1.4.0" - bip32 "2.0.6" - bip66 "1.1.0" - bitcoin-ops "git+https://github.com/VerusCoin/bitcoin-ops" - bs58check "2.0.0" - create-hash "1.1.0" - create-hmac "1.1.3" - debug "~3.1.0" - ecurve "1.0.0" - merkle-lib "2.0.10" - pushdata-bitcoin "1.0.1" - randombytes "2.0.1" - safe-buffer "5.0.1" - typeforce "1.11.3" - varuint-bitcoin "1.0.4" - verus-typescript-primitives "git+https://github.com/VerusCoin/verus-typescript-primitives.git" - wif "2.0.1" - optionalDependencies: - secp256k1 "3.5.2" - "@develar/schema-utils@~2.6.5": version "2.6.5" resolved "https://registry.yarnpkg.com/@develar/schema-utils/-/schema-utils-2.6.5.tgz#3ece22c5838402419a6e0425f85742b961d9b6c6" @@ -970,11 +929,6 @@ resolved "https://registry.yarnpkg.com/@types/node/-/node-14.0.1.tgz#5d93e0a099cd0acd5ef3d5bde3c086e1f49ff68c" integrity sha512-FAYBGwC+W6F9+huFIDtn43cpy7+SzG+atzRiTfdp3inUKL2hXnd4rG8hylJLIh4+hqrQy1P17kvJByE/z825hA== -"@types/node@10.12.18": - version "10.12.18" - resolved "https://registry.yarnpkg.com/@types/node/-/node-10.12.18.tgz#1d3ca764718915584fcd9f6344621b7672665c67" - integrity sha512-fh+pAqt4xRzPfqA6eh3Z2y6fyZavRIumvjhaCL753+TVkGKGhpPeyrJG2JftD0T9q4GF00KjefsQ+PQNDdWQaQ== - "@types/node@>=10.0.0": version "17.0.16" resolved "https://registry.yarnpkg.com/@types/node/-/node-17.0.16.tgz#e3733f46797b9df9e853ca9f719c8a6f7b84cd26" @@ -1410,11 +1364,6 @@ big-integer@^1.6.17: resolved "https://registry.yarnpkg.com/big-integer/-/big-integer-1.6.50.tgz#299a4be8bd441c73dcc492ed46b7169c34e92e70" integrity sha512-+O2uoQWFRo8ysZNo/rjtri2jIwjr3XfeAgRjAUADRqGG+ZITvyn8J1kvXLTaKVr3hhGXk+f23tKfdzmklVM9vQ== -bigi@1.4.0: - version "1.4.0" - resolved "https://registry.yarnpkg.com/bigi/-/bigi-1.4.0.tgz#90ac1aeac0a531216463bdb58f42c1e05c8407ac" - integrity sha512-TUFZGBZiOE98fuGBot6SKLQPFmRkXyeyOybmE8XMUDsrwP380cFh8qs7VX8C2CLj73OYW7+sgCStfL3ySy+Ozg== - bigi@1.4.2, bigi@^1.1.0, bigi@^1.4.0, bigi@^1.4.2: version "1.4.2" resolved "https://registry.yarnpkg.com/bigi/-/bigi-1.4.2.tgz#9c665a95f88b8b08fc05cfd731f561859d725825" @@ -1445,26 +1394,13 @@ binary@~0.3.0: buffers "~0.1.1" chainsaw "~0.1.0" -bindings@^1.2.1, bindings@^1.3.0, bindings@^1.5.0: +bindings@^1.3.0, bindings@^1.5.0: version "1.5.0" resolved "https://registry.yarnpkg.com/bindings/-/bindings-1.5.0.tgz#10353c9e945334bc0511a6d90b38fbc7c9c504df" integrity sha512-p2q/t/mhvuOj/UeLlV6566GD/guowlr0hHxClI0W9m7MWYkL1F0hLo+0Aexs9HSPCtR1SXQ0TD3MMKrXZajbiQ== dependencies: file-uri-to-path "1.0.0" -bip32@2.0.6: - version "2.0.6" - resolved "https://registry.yarnpkg.com/bip32/-/bip32-2.0.6.tgz#6a81d9f98c4cd57d05150c60d8f9e75121635134" - integrity sha512-HpV5OMLLGTjSVblmrtYRfFFKuQB+GArM0+XP8HGWfJ5vxYBqo+DesvJwOdC2WJ3bCkZShGf0QIfoIpeomVzVdA== - dependencies: - "@types/node" "10.12.18" - bs58check "^2.1.1" - create-hash "^1.2.0" - create-hmac "^1.1.7" - tiny-secp256k1 "^1.1.3" - typeforce "^1.11.5" - wif "^2.0.6" - bip32@^1.0.2, bip32@^1.0.4: version "1.0.4" resolved "https://registry.yarnpkg.com/bip32/-/bip32-1.0.4.tgz#188ad57a45fb1342c9aabe969d0612c704a987b4" @@ -1488,21 +1424,17 @@ bip39@^2.3.1, bip39@^2.4.0: safe-buffer "^5.0.1" unorm "^1.3.3" -bip66@1.1.0: - version "1.1.0" - resolved "https://registry.yarnpkg.com/bip66/-/bip66-1.1.0.tgz#c5551d49d1696d78211be047e997fe7aac8820c5" - integrity sha512-dBoAPJYg6HaaQeJGr4cNiqat1meGzlrv2qX+EJcW5q0zEdryMSLKlQKdTaCtDnrzEUPkwmlYqsD7ANaye4BEfg== - -bip66@^1.1.0, bip66@^1.1.3, bip66@^1.1.5: +bip66@^1.1.0, bip66@^1.1.5: version "1.1.5" resolved "https://registry.yarnpkg.com/bip66/-/bip66-1.1.5.tgz#01fa8748785ca70955d5011217d1b3139969ca22" integrity sha1-AfqHSHhcpwlV1QESF9GzE5lpyiI= dependencies: safe-buffer "^5.0.1" -bitcoin-ops@^1.3.0, bitcoin-ops@^1.4.0, bitcoin-ops@^1.4.1, "bitcoin-ops@git+https://github.com/VerusCoin/bitcoin-ops": +bitcoin-ops@^1.3.0, bitcoin-ops@^1.4.0, bitcoin-ops@^1.4.1: version "1.4.1" - resolved "git+https://github.com/VerusCoin/bitcoin-ops#a5f8f56e658301bc39881d41740b3a0010530efd" + resolved "https://registry.yarnpkg.com/bitcoin-ops/-/bitcoin-ops-1.4.1.tgz#e45de620398e22fd4ca6023de43974ff42240278" + integrity sha512-pef6gxZFztEhaE9RY9HmWVmiIHqCb2OyS4HPKkpc6CIiiOa3Qmuoylxc5P2EkU3w+5eTSifI9SEZC88idAIGow== bitcoinjs-lib@^4.0.1: version "4.0.5" @@ -1638,7 +1570,7 @@ bluebird@~3.4.1: resolved "https://registry.yarnpkg.com/bluebird/-/bluebird-3.4.7.tgz#f72d760be09b7f76d08ed8fae98b289a8d05fab3" integrity sha1-9y12C+Cbf3bQjtj66Ysomo0F+rM= -bn.js@4.11.6, bn.js@4.11.8, bn.js@5.2.1, bn.js@=2.0.4, bn.js@^4.11.0, bn.js@^4.11.1, bn.js@^4.11.3, bn.js@^4.11.6, bn.js@^4.11.8, bn.js@^4.11.9, bn.js@^4.4.0, bn.js@^5.1.2, bn.js@^5.2.0, bn.js@^5.2.1: +bn.js@4.11.6, bn.js@4.11.8, bn.js@5.2.1, bn.js@=2.0.4, bn.js@^4.11.0, bn.js@^4.11.1, bn.js@^4.11.6, bn.js@^4.11.8, bn.js@^4.11.9, bn.js@^4.4.0, bn.js@^5.1.2, bn.js@^5.2.0, bn.js@^5.2.1: version "4.11.8" resolved "https://registry.yarnpkg.com/bn.js/-/bn.js-4.11.8.tgz#2cde09eb5ee341f484746bb0309b3253b1b1442f" integrity sha512-ItfYfPLkWHUjckQCk8xC+LwxgK8NYcXywGigJgSwOP8Y2iyWT4f2vsZnoOXTTbo+o5yXmIUJ4gn5538SO5S3gA== @@ -1740,7 +1672,7 @@ bs58@=2.0.0: resolved "https://registry.yarnpkg.com/bs58/-/bs58-2.0.0.tgz#72b713bed223a0ac518bbda0e3ce3f4817f39eb5" integrity sha1-crcTvtIjoKxRi72g484/SBfznrU= -bs58@^3.0.0, bs58@^3.1.0: +bs58@^3.0.0: version "3.1.0" resolved "https://registry.yarnpkg.com/bs58/-/bs58-3.1.0.tgz#d4c26388bf4804cac714141b1945aa47e5eb248e" integrity sha512-9C2bRFTGy3meqO65O9jLvVTyawvhLVp4h2ECm5KlRPuV5KPDNJZcJIj3gl+aA0ENXcYrUSLCkPAeqbTcI2uWyQ== @@ -1754,14 +1686,6 @@ bs58@^4.0.0: dependencies: base-x "^3.0.2" -bs58check@2.0.0: - version "2.0.0" - resolved "https://registry.yarnpkg.com/bs58check/-/bs58check-2.0.0.tgz#b70fffd80bc72de18a040a547d7e5e08ce1b1e4e" - integrity sha512-afttdRHvL1HCgBJqcMtoRXe8xCQ7fbUidoLp1JTRXT4bAvtfDyZx7mb79w82XkcdIFFstG3A4NhKOBdEsLbQbw== - dependencies: - bs58 "^4.0.0" - create-hash "^1.1.0" - bs58check@<3.0.0, bs58check@^2.0.0, bs58check@^2.1.1, bs58check@^2.1.2: version "2.1.2" resolved "https://registry.yarnpkg.com/bs58check/-/bs58check-2.1.2.tgz#53b018291228d82a5aa08e7d796fdafda54aebfc" @@ -1771,14 +1695,6 @@ bs58check@<3.0.0, bs58check@^2.0.0, bs58check@^2.1.1, bs58check@^2.1.2: create-hash "^1.1.0" safe-buffer "^5.1.2" -bs58check@^1.0.6: - version "1.3.4" - resolved "https://registry.yarnpkg.com/bs58check/-/bs58check-1.3.4.tgz#c52540073749117714fa042c3047eb8f9151cbf8" - integrity sha512-+cZ/mYuyfHboELKvDTYF6onDT4XEgbM9kBsKW91q2YlyDsGRpgT/O6pU4ws5n+LD38XAiD7LChgB3+NBqMGk6g== - dependencies: - bs58 "^3.1.0" - create-hash "^1.1.0" - "bs58check@https://github.com/bitcoinjs/bs58check": version "2.1.2" resolved "https://github.com/bitcoinjs/bs58check#12b3e700f355c5c49d0be3f8fc29be6c66e753e9" @@ -2383,15 +2299,6 @@ crc@^3.8.0: dependencies: buffer "^5.1.0" -create-hash@1.1.0: - version "1.1.0" - resolved "https://registry.yarnpkg.com/create-hash/-/create-hash-1.1.0.tgz#c2ab96b5d4ece5f22df2ef4306803d14da6931e7" - integrity sha512-We+Cyev4lG5VlvuSRkNkOhSMu8l2QoMgQR8e/j/fYUQvleXXtF/9apzzLZF9plriySKWQ5cW/PUx3RSTcKMqTA== - dependencies: - inherits "^2.0.1" - ripemd160 "^1.0.0" - sha.js "^2.3.6" - create-hash@1.2.0, create-hash@^1.1.0, create-hash@^1.1.2, create-hash@^1.2.0: version "1.2.0" resolved "https://registry.yarnpkg.com/create-hash/-/create-hash-1.2.0.tgz#889078af11a63756bcfb59bd221996be3a9ef196" @@ -2413,14 +2320,6 @@ create-hash@1.2.0, create-hash@^1.1.0, create-hash@^1.1.2, create-hash@^1.2.0: ripemd160 "^2.0.2" sha.js "^2.4.0" -create-hmac@1.1.3: - version "1.1.3" - resolved "https://registry.yarnpkg.com/create-hmac/-/create-hmac-1.1.3.tgz#29843e9c191ba412ab001bc55ac8b8b9ae54b670" - integrity sha512-WAh5X07rFIM0EZ166unEOAMdrPWcg7A6alzdqIRNnMn8woJnZfKUFOBpAIzOEzrn1ouRjRv+O+gcESddnN/Xlw== - dependencies: - create-hash "^1.1.0" - inherits "^2.0.1" - create-hmac@^1.1.3, create-hmac@^1.1.4, create-hmac@^1.1.7: version "1.1.7" resolved "https://registry.yarnpkg.com/create-hmac/-/create-hmac-1.1.7.tgz#69170c78b3ab957147b2b8b04572e47ead2243ff" @@ -2752,13 +2651,6 @@ ecc-jsbn@~0.1.1: jsbn "~0.1.0" safer-buffer "^2.1.0" -ecurve@1.0.0: - version "1.0.0" - resolved "https://registry.yarnpkg.com/ecurve/-/ecurve-1.0.0.tgz#32cfd5ce5f421e9351206a33d4e3cfd36f3465a4" - integrity sha512-gwAh/B9hSnkq5SssZhJnXaXHcKrBK2tCh76G12+BXXjqLH4Kx1QBALz9IszvUtrxhM9+SBXx6fU0dW4WDBk2pA== - dependencies: - bigi "^1.1.0" - ecurve@^1.0.0: version "1.0.6" resolved "https://registry.yarnpkg.com/ecurve/-/ecurve-1.0.6.tgz#dfdabbb7149f8d8b78816be5a7d5b83fcf6de797" @@ -2833,7 +2725,11 @@ electron@22.3.25: "@types/node" "^16.11.26" extract-zip "^2.0.1" +<<<<<<< HEAD elliptic@6.5.2, elliptic@6.5.3, elliptic@6.5.4, elliptic@=3.0.3, elliptic@^6.4.0, elliptic@^6.5.2, elliptic@^6.5.7: +======= +elliptic@6.5.2, elliptic@6.5.3, elliptic@6.5.4, elliptic@=3.0.3, elliptic@^6.4.0, elliptic@^6.4.1, elliptic@^6.5.2: +>>>>>>> 13ce27e (Change the signing of the login consent response to use the signdata command.) version "6.5.4" resolved "https://registry.yarnpkg.com/elliptic/-/elliptic-6.5.4.tgz#da37cebd31e79a1367e941b592ed1fbebd58abbb" integrity sha512-iLhC6ULemrljPZb+QutR5TQGB+pdW6KGD5RSegS+8sorOZT+rdQFbsQFJgvN3eRqNALqJer4oQ16YvJHlU8hzQ== @@ -5030,7 +4926,7 @@ merge-descriptors@1.0.1: resolved "https://registry.yarnpkg.com/merge-descriptors/-/merge-descriptors-1.0.1.tgz#b00aaa556dd8b44568150ec9d1b953f3f90cbb61" integrity sha1-sAqqVW3YtEVoFQ7J0blT8/kMu2E= -merkle-lib@2.0.10, merkle-lib@^2.0.10: +merkle-lib@^2.0.10: version "2.0.10" resolved "https://registry.yarnpkg.com/merkle-lib/-/merkle-lib-2.0.10.tgz#82b8dbae75e27a7785388b73f9d7725d0f6f3326" integrity sha1-grjbrnXieneFOItz+ddyXQ9vMyY= @@ -5277,11 +5173,6 @@ nan@^2.14.0: resolved "https://registry.yarnpkg.com/nan/-/nan-2.14.0.tgz#7818f722027b2459a86f0295d434d1fc2336c52c" integrity sha512-INOFj37C7k3AfaNTtX8RhsTw7qRy7eLET14cROi9+5HAVbbHuIWUHEauBv5qT4Av2tWasiTY1Jw6puUNqRJXQg== -nan@^2.2.1: - version "2.20.0" - resolved "https://registry.yarnpkg.com/nan/-/nan-2.20.0.tgz#08c5ea813dd54ed16e5bd6505bf42af4f7838ca3" - integrity sha512-bk3gXBZDGILuuo/6sKtr0DQmSThYHLtNCdSdXk9YkxD/jK6X2vmCyyXBBxyqZ4XcnzTyYEAThfX3DCEnLf6igw== - nano-json-stream-parser@^0.1.2: version "0.1.2" resolved "https://registry.yarnpkg.com/nano-json-stream-parser/-/nano-json-stream-parser-0.1.2.tgz#0cc8f6d0e2b622b479c40d499c46d64b755c6f5f" @@ -5297,11 +5188,6 @@ nanoassert@^1.0.0: resolved "https://registry.yarnpkg.com/nanoassert/-/nanoassert-1.1.0.tgz#4f3152e09540fde28c76f44b19bbcd1d5a42478d" integrity sha1-TzFS4JVA/eKMdvRLGbvNHVpCR40= -nanoassert@^2.0.0: - version "2.0.0" - resolved "https://registry.yarnpkg.com/nanoassert/-/nanoassert-2.0.0.tgz#a05f86de6c7a51618038a620f88878ed1e490c09" - integrity sha512-7vO7n28+aYO4J+8w96AzhmU8G+Y/xpPDJz/se19ICsqj/momRbb9mh9ZUtkoJ5X3nTnPdhEJyc0qnM6yAsHBaA== - negotiator@0.6.2: version "0.6.2" resolved "https://registry.yarnpkg.com/negotiator/-/negotiator-0.6.2.tgz#feacf7ccf525a77ae9634436a64883ffeca346fb" @@ -6198,7 +6084,7 @@ punycode@^2.1.0, punycode@^2.1.1: resolved "https://registry.yarnpkg.com/punycode/-/punycode-2.1.1.tgz#b58b010ac40c22c5657616c8d2c2c02c7bf479ec" integrity sha512-XRsRjdf+j5ml+y/6GKHPZbrF/8p2Yga0JPtdqTIY2Xe5ohJPD9saDJJLPvp9+NSBprVvevdXZybnj2cv8OEd0A== -pushdata-bitcoin@1.0.1, pushdata-bitcoin@^1.0.1: +pushdata-bitcoin@^1.0.1: version "1.0.1" resolved "https://registry.yarnpkg.com/pushdata-bitcoin/-/pushdata-bitcoin-1.0.1.tgz#15931d3cd967ade52206f523aa7331aef7d43af7" integrity sha1-FZMdPNlnreUiBvUjqnMxrvfUOvc= @@ -6253,11 +6139,6 @@ ramda@^0.24.1: resolved "https://registry.yarnpkg.com/ramda/-/ramda-0.24.1.tgz#c3b7755197f35b8dc3502228262c4c91ddb6b857" integrity sha1-w7d1UZfzW43DUCIoJixMkd22uFc= -randombytes@2.0.1: - version "2.0.1" - resolved "https://registry.yarnpkg.com/randombytes/-/randombytes-2.0.1.tgz#18f4a9ba0dd07bdb1580bc9156091fcf90eabc6f" - integrity sha512-siCt2duOdZbmvgk8IDL4U0SYXI8ypBEKWuor0qUpHBWAyOCrXQvSIYJ+VKuEpoX36moZ1pAu+mXkwUVAVssu6w== - randombytes@^2.0.1, randombytes@^2.1.0: version "2.1.0" resolved "https://registry.yarnpkg.com/randombytes/-/randombytes-2.1.0.tgz#df6f84372f0270dc65cdf6291349ab7a473d4f2a" @@ -6642,11 +6523,6 @@ rimraf@^3.0.0, rimraf@^3.0.2: dependencies: glob "^7.1.3" -ripemd160@^1.0.0: - version "1.0.1" - resolved "https://registry.yarnpkg.com/ripemd160/-/ripemd160-1.0.1.tgz#93a4bbd4942bc574b69a8fa57c71de10ecca7d6e" - integrity sha512-J0YlH2ow/i7d5PJX9RC1XnjmZc7cNNYWe89PIlFszvHeiEtxzA1/VYePkjQ7l1SkUejAcHeDo3IVp2WIzstXXQ== - ripemd160@^2.0.0, ripemd160@^2.0.1, ripemd160@^2.0.2: version "2.0.2" resolved "https://registry.yarnpkg.com/ripemd160/-/ripemd160-2.0.2.tgz#a1c1a6f624751577ba5d07914cbc92850585890c" @@ -6688,11 +6564,6 @@ run-queue@^1.0.0, run-queue@^1.0.3: dependencies: aproba "^1.1.1" -safe-buffer@5.0.1: - version "5.0.1" - resolved "https://registry.yarnpkg.com/safe-buffer/-/safe-buffer-5.0.1.tgz#d263ca54696cd8a306b5ca6551e92de57918fbe7" - integrity sha512-cr7dZWLwOeaFBLTIuZeYdkfO7UzGIKhjYENJFAxUOMKWGaWDm2nJM2rzxNRm5Owu0DH3ApwNo6kx5idXZfb/Iw== - safe-buffer@5.2.1, safe-buffer@^5.2.1, safe-buffer@~5.2.0: version "5.2.1" resolved "https://registry.yarnpkg.com/safe-buffer/-/safe-buffer-5.2.1.tgz#1eaf9fa9bdb1fdd4ec75f58f9cdb4e6b7827eec6" @@ -6735,10 +6606,17 @@ scrypt-js@3.0.1, scrypt-js@^3.0.0, scrypt-js@^3.0.1: resolved "https://registry.yarnpkg.com/scrypt-js/-/scrypt-js-3.0.1.tgz#d314a57c2aef69d1ad98a138a21fe9eafa9ee312" integrity sha512-cdwTTnqPu0Hyvf5in5asVdZocVDTNRmR7XEcJuIzMjJeSHybHl7vpB66AzwTaIg6CLSbtjcxc8fqcySfnTkccA== +<<<<<<< HEAD secp256k1@3.8.1, secp256k1@^3.0.1, secp256k1@^3.5.2, secp256k1@^4.0.1: version "3.8.1" resolved "https://registry.yarnpkg.com/secp256k1/-/secp256k1-3.8.1.tgz#b62a62a882d6b16f9b51fe599c6b3a861e36c59f" integrity sha512-tArjQw2P0RTdY7QmkNehgp6TVvQXq6ulIhxv8gaH6YubKG/wxxAoNKcbuXjDhybbc+b2Ihc7e0xxiGN744UIiQ== +======= +secp256k1@^3.0.1: + version "3.8.0" + resolved "https://registry.yarnpkg.com/secp256k1/-/secp256k1-3.8.0.tgz#28f59f4b01dbee9575f56a47034b7d2e3b3b352d" + integrity sha512-k5ke5avRZbtl9Tqx/SA7CbY3NF6Ro+Sj9cZxezFzuBlLDmyqPiL8hJJ+EmzD8Ig4LUDByHJ3/iPOVoRixs/hmw== +>>>>>>> 13ce27e (Change the signing of the login consent response to use the signdata command.) dependencies: bindings "^1.5.0" bip66 "^1.1.5" @@ -6862,7 +6740,7 @@ setprototypeof@1.2.0: resolved "https://registry.yarnpkg.com/setprototypeof/-/setprototypeof-1.2.0.tgz#66c9a24a73f9fc28cbe66b09fed3d33dcaf1b424" integrity sha512-E5LDX7Wrp85Kil5bhZv46j8jOeboKq5JMmYM3gVGdGH8xFpPWXUMsNrlODCrkoxMEeNi/XZIwuRvY4XNwYMJpw== -sha.js@^2.3.6, sha.js@^2.4.0, sha.js@^2.4.8: +sha.js@^2.4.0, sha.js@^2.4.8: version "2.4.11" resolved "https://registry.yarnpkg.com/sha.js/-/sha.js-2.4.11.tgz#37a5cf0b81ecbc6943de109ba2960d1b26584ae7" integrity sha512-QMEp5B7cftE7APOjk5Y6xgrbWu+WkLVQwk8JNjZ8nKRciZaByEW6MubieAiToS7+dwvrjGhH8jRXz3MVd0AYqQ== @@ -7457,7 +7335,7 @@ tiny-relative-date@^1.3.0: resolved "https://registry.yarnpkg.com/tiny-relative-date/-/tiny-relative-date-1.3.0.tgz#fa08aad501ed730f31cc043181d995c39a935e07" integrity sha512-MOQHpzllWxDCHHaDno30hhLfbouoYlOI8YlMNtvKe1zXbjEVhbcEovQxvZrPvtiYW630GQDoMMarCnjfyfHA+A== -tiny-secp256k1@^1.0.0, tiny-secp256k1@^1.1.3: +tiny-secp256k1@^1.0.0: version "1.1.6" resolved "https://registry.yarnpkg.com/tiny-secp256k1/-/tiny-secp256k1-1.1.6.tgz#7e224d2bee8ab8283f284e40e6b4acb74ffe047c" integrity sha512-FmqJZGduTyvsr2cF3375fqGHUovSwDi/QytexX1Se4BPuPZpTE5Ftp5fg+EFSuEf3lhZqgCRjEG3ydUQ/aNiwA== @@ -7614,13 +7492,6 @@ typedarray@^0.0.6: resolved "https://registry.yarnpkg.com/typedarray/-/typedarray-0.0.6.tgz#867ac74e3864187b1d3d47d996a78ec5c8830777" integrity sha1-hnrHTjhkGHsdPUfZlqeOxciDB3c= -typeforce@1.11.3: - version "1.11.3" - resolved "https://registry.yarnpkg.com/typeforce/-/typeforce-1.11.3.tgz#a54d0ff58808788fba358020982270bd6995d8e4" - integrity sha512-+vllWbxe1AKLkO3KNyZPjb51NRHwRE/8bAi/cmF6TK24VqrPiQPRiHrFV19j1xHxxCHQbIvN4Zfco+skuiXSWQ== - dependencies: - inherits "^2.0.1" - typeforce@^1.11.1, typeforce@^1.11.3, typeforce@^1.11.5, "typeforce@git+https://github.com/michaeltout/typeforce": version "1.18.0" resolved "git+https://github.com/michaeltout/typeforce#c9b0abc33ff006d7a6a6150eff034bc7eb8b07de" @@ -7857,11 +7728,6 @@ varint@^5.0.0: resolved "https://registry.yarnpkg.com/varint/-/varint-5.0.2.tgz#5b47f8a947eb668b848e034dcfa87d0ff8a7f7a4" integrity sha512-lKxKYG6H03yCZUpAGOPOsMcGxd1RHCu1iKvEHYDPmTyq2HueGhD73ssNBqqQWfvYs04G9iUFRvmAVLW20Jw6ow== -varuint-bitcoin@1.0.4: - version "1.0.4" - resolved "https://registry.yarnpkg.com/varuint-bitcoin/-/varuint-bitcoin-1.0.4.tgz#d812c5dae16e32f60544b6adee1d4be1307d0283" - integrity sha512-2nW4pVicYWxOMY1u+3T3eFXw24wbFlKz+ug7hd02rozYmeFVBoC6LB7/P4E46jN9aD1ezhX01g2Uh4zrZ+9RWw== - varuint-bitcoin@^1.0.1, varuint-bitcoin@^1.0.4: version "1.1.2" resolved "https://registry.yarnpkg.com/varuint-bitcoin/-/varuint-bitcoin-1.1.2.tgz#e76c138249d06138b480d4c5b40ef53693e24e92" @@ -8255,13 +8121,6 @@ widest-line@^2.0.0: dependencies: string-width "^2.1.1" -wif@2.0.1: - version "2.0.1" - resolved "https://registry.yarnpkg.com/wif/-/wif-2.0.1.tgz#27149a62757e4db694729378e7aeca7b09648012" - integrity sha512-Ba/Ypzo2Vg512kPn+Rt8R1ss019J/8n5E+lVyHJDc8EwTZ8fNLmhkTe7GitxghAiENWuunOa4qnwl7KIj39zfw== - dependencies: - bs58check "^1.0.6" - wif@2.0.6, wif@^2.0.1, wif@^2.0.6: version "2.0.6" resolved "https://registry.yarnpkg.com/wif/-/wif-2.0.6.tgz#08d3f52056c66679299726fade0d432ae74b4704" From e1493fd2372adcc769af11216988838111f950e2 Mon Sep 17 00:00:00 2001 From: mcstoer <49734282+mcstoer@users.noreply.github.com> Date: Wed, 23 Oct 2024 15:32:57 -0700 Subject: [PATCH 10/17] Add api call to get the block height from a signature. --- package.json | 1 + routes/api.js | 3 + routes/api/getSignatureInfo.js | 56 +++++++++++ yarn.lock | 172 +++++++++++++++++++++++++++++++-- 4 files changed, 225 insertions(+), 7 deletions(-) create mode 100644 routes/api/getSignatureInfo.js diff --git a/package.json b/package.json index 0b783a05..234ae60a 100644 --- a/package.json +++ b/package.json @@ -45,6 +45,7 @@ "typescript": "4.4.4" }, "dependencies": { + "@bitgo/utxo-lib": "git+https://github.com/VerusCoin/BitGoJS.git#utxo-lib-verus", "@electron/remote": "1.1.0", "@ethersproject/signing-key": "5.0.5", "@xmldom/xmldom": "0.8.4", diff --git a/routes/api.js b/routes/api.js index 0c0b6968..f2ae6712 100644 --- a/routes/api.js +++ b/routes/api.js @@ -172,6 +172,9 @@ api = require('./api/native/getNetworkGraph')(api); api = require('./api/native/verusbridge/verusbridge.js')(api); api = require('./api/native/verusbridge/vethconf.js')(api); +// lite +api = require('./api/getSignatureInfo.js')(api); + // general network calls api.networkFees = {} api.coinSupply = {} diff --git a/routes/api/getSignatureInfo.js b/routes/api/getSignatureInfo.js new file mode 100644 index 00000000..c9c31f9b --- /dev/null +++ b/routes/api/getSignatureInfo.js @@ -0,0 +1,56 @@ +const { + IdentitySignature, + networks, +} = require("@bitgo/utxo-lib"); + +module.exports = (api) => { + /** + * Gets the version, hashtype and height from a signature. + * + * @param {String} coin The chainTicker of the coin to make the call on + * @param {String} systemId The iaddress of the system + * @param {String} signature The signature to process + * @param {String} iaddress The iaddress associated with the signature + */ + api.getSignatureInfo = (coin, systemId, signature, iaddress) => { + + const network = coin == "VRSC" ? networks.verus : networks.verustest; + + const sig = new IdentitySignature(network); + + sig.fromBuffer(Buffer.from(signature, "base64"), 0, systemId, iaddress); + + return { + version: sig.version, + hashtype: sig.hashType, + height: sig.blockHeight, + }; + } + + api.setPost('/lite/get_signature_info', (req, res, next) => { + const { + chainTicker, + systemId, + signature, + iaddress + } = req.body; + + try { + res.send( + JSON.stringify({ + msg: "success", + result: api.getSignatureInfo(chainTicker, systemId, signature, iaddress), + }) + ); + } catch (e) { + res.send( + JSON.stringify({ + msg: "error", + result: e.message, + }) + ); + } + }); + + return api; +} \ No newline at end of file diff --git a/yarn.lock b/yarn.lock index 34059730..eb2b5894 100644 --- a/yarn.lock +++ b/yarn.lock @@ -28,6 +28,47 @@ chalk "^2.0.0" js-tokens "^4.0.0" +"@bitgo/blake2b-wasm@^3.0.1": + version "3.2.3" + resolved "https://registry.yarnpkg.com/@bitgo/blake2b-wasm/-/blake2b-wasm-3.2.3.tgz#6ae5e942f2a5fd5b3ed27103af5df0ed50adfbc9" + integrity sha512-NaurBrMaEpjfg7EdUJgW/c6byt27O6q1ZaxB5Ita10MjjYjUu0SyYF4q7JPNxpHF/lMxb0YZakOxigbDBu9Jjw== + dependencies: + nanoassert "^1.0.0" + +"@bitgo/blake2b@3.0.1": + version "3.0.1" + resolved "https://registry.yarnpkg.com/@bitgo/blake2b/-/blake2b-3.0.1.tgz#d9f2893420c1d4861fea0e05d775afd99a191b00" + integrity sha512-+Neg+nsqUhYOPlvyITHXYzKUTJofyxYdLQTzNjufamifBzxLGTpgn2KKUfvGNsGovlUYzlyPZj+CB6je2D7mhw== + dependencies: + "@bitgo/blake2b-wasm" "^3.0.1" + nanoassert "^2.0.0" + +"@bitgo/utxo-lib@git+https://github.com/VerusCoin/BitGoJS.git#utxo-lib-verus": + version "1.9.6" + resolved "git+https://github.com/VerusCoin/BitGoJS.git#3c6efada45b6a4fc2a1065951c307016dca7f953" + dependencies: + "@bitgo/blake2b" "3.0.1" + bech32 "0.0.3" + bigi "1.4.0" + bip32 "2.0.6" + bip66 "1.1.0" + bitcoin-ops "git+https://github.com/VerusCoin/bitcoin-ops" + bs58check "2.0.0" + create-hash "1.1.0" + create-hmac "1.1.3" + debug "~3.1.0" + ecurve "1.0.0" + merkle-lib "2.0.10" + pushdata-bitcoin "1.0.1" + randombytes "2.0.1" + safe-buffer "5.0.1" + typeforce "1.11.3" + varuint-bitcoin "1.0.4" + verus-typescript-primitives "git+https://github.com/VerusCoin/verus-typescript-primitives.git" + wif "2.0.1" + optionalDependencies: + secp256k1 "3.5.2" + "@develar/schema-utils@~2.6.5": version "2.6.5" resolved "https://registry.yarnpkg.com/@develar/schema-utils/-/schema-utils-2.6.5.tgz#3ece22c5838402419a6e0425f85742b961d9b6c6" @@ -1364,6 +1405,11 @@ big-integer@^1.6.17: resolved "https://registry.yarnpkg.com/big-integer/-/big-integer-1.6.50.tgz#299a4be8bd441c73dcc492ed46b7169c34e92e70" integrity sha512-+O2uoQWFRo8ysZNo/rjtri2jIwjr3XfeAgRjAUADRqGG+ZITvyn8J1kvXLTaKVr3hhGXk+f23tKfdzmklVM9vQ== +bigi@1.4.0: + version "1.4.0" + resolved "https://registry.yarnpkg.com/bigi/-/bigi-1.4.0.tgz#90ac1aeac0a531216463bdb58f42c1e05c8407ac" + integrity sha512-TUFZGBZiOE98fuGBot6SKLQPFmRkXyeyOybmE8XMUDsrwP380cFh8qs7VX8C2CLj73OYW7+sgCStfL3ySy+Ozg== + bigi@1.4.2, bigi@^1.1.0, bigi@^1.4.0, bigi@^1.4.2: version "1.4.2" resolved "https://registry.yarnpkg.com/bigi/-/bigi-1.4.2.tgz#9c665a95f88b8b08fc05cfd731f561859d725825" @@ -1394,13 +1440,26 @@ binary@~0.3.0: buffers "~0.1.1" chainsaw "~0.1.0" -bindings@^1.3.0, bindings@^1.5.0: +bindings@^1.2.1, bindings@^1.3.0, bindings@^1.5.0: version "1.5.0" resolved "https://registry.yarnpkg.com/bindings/-/bindings-1.5.0.tgz#10353c9e945334bc0511a6d90b38fbc7c9c504df" integrity sha512-p2q/t/mhvuOj/UeLlV6566GD/guowlr0hHxClI0W9m7MWYkL1F0hLo+0Aexs9HSPCtR1SXQ0TD3MMKrXZajbiQ== dependencies: file-uri-to-path "1.0.0" +bip32@2.0.6: + version "2.0.6" + resolved "https://registry.yarnpkg.com/bip32/-/bip32-2.0.6.tgz#6a81d9f98c4cd57d05150c60d8f9e75121635134" + integrity sha512-HpV5OMLLGTjSVblmrtYRfFFKuQB+GArM0+XP8HGWfJ5vxYBqo+DesvJwOdC2WJ3bCkZShGf0QIfoIpeomVzVdA== + dependencies: + "@types/node" "10.12.18" + bs58check "^2.1.1" + create-hash "^1.2.0" + create-hmac "^1.1.7" + tiny-secp256k1 "^1.1.3" + typeforce "^1.11.5" + wif "^2.0.6" + bip32@^1.0.2, bip32@^1.0.4: version "1.0.4" resolved "https://registry.yarnpkg.com/bip32/-/bip32-1.0.4.tgz#188ad57a45fb1342c9aabe969d0612c704a987b4" @@ -1424,7 +1483,12 @@ bip39@^2.3.1, bip39@^2.4.0: safe-buffer "^5.0.1" unorm "^1.3.3" -bip66@^1.1.0, bip66@^1.1.5: +bip66@1.1.0: + version "1.1.0" + resolved "https://registry.yarnpkg.com/bip66/-/bip66-1.1.0.tgz#c5551d49d1696d78211be047e997fe7aac8820c5" + integrity sha512-dBoAPJYg6HaaQeJGr4cNiqat1meGzlrv2qX+EJcW5q0zEdryMSLKlQKdTaCtDnrzEUPkwmlYqsD7ANaye4BEfg== + +bip66@^1.1.0, bip66@^1.1.3, bip66@^1.1.5: version "1.1.5" resolved "https://registry.yarnpkg.com/bip66/-/bip66-1.1.5.tgz#01fa8748785ca70955d5011217d1b3139969ca22" integrity sha1-AfqHSHhcpwlV1QESF9GzE5lpyiI= @@ -1436,6 +1500,10 @@ bitcoin-ops@^1.3.0, bitcoin-ops@^1.4.0, bitcoin-ops@^1.4.1: resolved "https://registry.yarnpkg.com/bitcoin-ops/-/bitcoin-ops-1.4.1.tgz#e45de620398e22fd4ca6023de43974ff42240278" integrity sha512-pef6gxZFztEhaE9RY9HmWVmiIHqCb2OyS4HPKkpc6CIiiOa3Qmuoylxc5P2EkU3w+5eTSifI9SEZC88idAIGow== +"bitcoin-ops@git+https://github.com/VerusCoin/bitcoin-ops": + version "1.4.1" + resolved "git+https://github.com/VerusCoin/bitcoin-ops#a5f8f56e658301bc39881d41740b3a0010530efd" + bitcoinjs-lib@^4.0.1: version "4.0.5" resolved "https://registry.yarnpkg.com/bitcoinjs-lib/-/bitcoinjs-lib-4.0.5.tgz#2cce3469b950fade9f0442755ebb26bf9de519a1" @@ -1570,7 +1638,7 @@ bluebird@~3.4.1: resolved "https://registry.yarnpkg.com/bluebird/-/bluebird-3.4.7.tgz#f72d760be09b7f76d08ed8fae98b289a8d05fab3" integrity sha1-9y12C+Cbf3bQjtj66Ysomo0F+rM= -bn.js@4.11.6, bn.js@4.11.8, bn.js@5.2.1, bn.js@=2.0.4, bn.js@^4.11.0, bn.js@^4.11.1, bn.js@^4.11.6, bn.js@^4.11.8, bn.js@^4.11.9, bn.js@^4.4.0, bn.js@^5.1.2, bn.js@^5.2.0, bn.js@^5.2.1: +bn.js@4.11.6, bn.js@4.11.8, bn.js@5.2.1, bn.js@=2.0.4, bn.js@^4.11.0, bn.js@^4.11.1, bn.js@^4.11.3, bn.js@^4.11.6, bn.js@^4.11.8, bn.js@^4.11.9, bn.js@^4.4.0, bn.js@^5.1.2, bn.js@^5.2.0, bn.js@^5.2.1: version "4.11.8" resolved "https://registry.yarnpkg.com/bn.js/-/bn.js-4.11.8.tgz#2cde09eb5ee341f484746bb0309b3253b1b1442f" integrity sha512-ItfYfPLkWHUjckQCk8xC+LwxgK8NYcXywGigJgSwOP8Y2iyWT4f2vsZnoOXTTbo+o5yXmIUJ4gn5538SO5S3gA== @@ -1672,7 +1740,7 @@ bs58@=2.0.0: resolved "https://registry.yarnpkg.com/bs58/-/bs58-2.0.0.tgz#72b713bed223a0ac518bbda0e3ce3f4817f39eb5" integrity sha1-crcTvtIjoKxRi72g484/SBfznrU= -bs58@^3.0.0: +bs58@^3.0.0, bs58@^3.1.0: version "3.1.0" resolved "https://registry.yarnpkg.com/bs58/-/bs58-3.1.0.tgz#d4c26388bf4804cac714141b1945aa47e5eb248e" integrity sha512-9C2bRFTGy3meqO65O9jLvVTyawvhLVp4h2ECm5KlRPuV5KPDNJZcJIj3gl+aA0ENXcYrUSLCkPAeqbTcI2uWyQ== @@ -1686,6 +1754,14 @@ bs58@^4.0.0: dependencies: base-x "^3.0.2" +bs58check@2.0.0: + version "2.0.0" + resolved "https://registry.yarnpkg.com/bs58check/-/bs58check-2.0.0.tgz#b70fffd80bc72de18a040a547d7e5e08ce1b1e4e" + integrity sha512-afttdRHvL1HCgBJqcMtoRXe8xCQ7fbUidoLp1JTRXT4bAvtfDyZx7mb79w82XkcdIFFstG3A4NhKOBdEsLbQbw== + dependencies: + bs58 "^4.0.0" + create-hash "^1.1.0" + bs58check@<3.0.0, bs58check@^2.0.0, bs58check@^2.1.1, bs58check@^2.1.2: version "2.1.2" resolved "https://registry.yarnpkg.com/bs58check/-/bs58check-2.1.2.tgz#53b018291228d82a5aa08e7d796fdafda54aebfc" @@ -1695,6 +1771,14 @@ bs58check@<3.0.0, bs58check@^2.0.0, bs58check@^2.1.1, bs58check@^2.1.2: create-hash "^1.1.0" safe-buffer "^5.1.2" +bs58check@^1.0.6: + version "1.3.4" + resolved "https://registry.yarnpkg.com/bs58check/-/bs58check-1.3.4.tgz#c52540073749117714fa042c3047eb8f9151cbf8" + integrity sha512-+cZ/mYuyfHboELKvDTYF6onDT4XEgbM9kBsKW91q2YlyDsGRpgT/O6pU4ws5n+LD38XAiD7LChgB3+NBqMGk6g== + dependencies: + bs58 "^3.1.0" + create-hash "^1.1.0" + "bs58check@https://github.com/bitcoinjs/bs58check": version "2.1.2" resolved "https://github.com/bitcoinjs/bs58check#12b3e700f355c5c49d0be3f8fc29be6c66e753e9" @@ -2299,6 +2383,15 @@ crc@^3.8.0: dependencies: buffer "^5.1.0" +create-hash@1.1.0: + version "1.1.0" + resolved "https://registry.yarnpkg.com/create-hash/-/create-hash-1.1.0.tgz#c2ab96b5d4ece5f22df2ef4306803d14da6931e7" + integrity sha512-We+Cyev4lG5VlvuSRkNkOhSMu8l2QoMgQR8e/j/fYUQvleXXtF/9apzzLZF9plriySKWQ5cW/PUx3RSTcKMqTA== + dependencies: + inherits "^2.0.1" + ripemd160 "^1.0.0" + sha.js "^2.3.6" + create-hash@1.2.0, create-hash@^1.1.0, create-hash@^1.1.2, create-hash@^1.2.0: version "1.2.0" resolved "https://registry.yarnpkg.com/create-hash/-/create-hash-1.2.0.tgz#889078af11a63756bcfb59bd221996be3a9ef196" @@ -2320,6 +2413,14 @@ create-hash@1.2.0, create-hash@^1.1.0, create-hash@^1.1.2, create-hash@^1.2.0: ripemd160 "^2.0.2" sha.js "^2.4.0" +create-hmac@1.1.3: + version "1.1.3" + resolved "https://registry.yarnpkg.com/create-hmac/-/create-hmac-1.1.3.tgz#29843e9c191ba412ab001bc55ac8b8b9ae54b670" + integrity sha512-WAh5X07rFIM0EZ166unEOAMdrPWcg7A6alzdqIRNnMn8woJnZfKUFOBpAIzOEzrn1ouRjRv+O+gcESddnN/Xlw== + dependencies: + create-hash "^1.1.0" + inherits "^2.0.1" + create-hmac@^1.1.3, create-hmac@^1.1.4, create-hmac@^1.1.7: version "1.1.7" resolved "https://registry.yarnpkg.com/create-hmac/-/create-hmac-1.1.7.tgz#69170c78b3ab957147b2b8b04572e47ead2243ff" @@ -2651,6 +2752,13 @@ ecc-jsbn@~0.1.1: jsbn "~0.1.0" safer-buffer "^2.1.0" +ecurve@1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/ecurve/-/ecurve-1.0.0.tgz#32cfd5ce5f421e9351206a33d4e3cfd36f3465a4" + integrity sha512-gwAh/B9hSnkq5SssZhJnXaXHcKrBK2tCh76G12+BXXjqLH4Kx1QBALz9IszvUtrxhM9+SBXx6fU0dW4WDBk2pA== + dependencies: + bigi "^1.1.0" + ecurve@^1.0.0: version "1.0.6" resolved "https://registry.yarnpkg.com/ecurve/-/ecurve-1.0.6.tgz#dfdabbb7149f8d8b78816be5a7d5b83fcf6de797" @@ -4926,7 +5034,7 @@ merge-descriptors@1.0.1: resolved "https://registry.yarnpkg.com/merge-descriptors/-/merge-descriptors-1.0.1.tgz#b00aaa556dd8b44568150ec9d1b953f3f90cbb61" integrity sha1-sAqqVW3YtEVoFQ7J0blT8/kMu2E= -merkle-lib@^2.0.10: +merkle-lib@2.0.10, merkle-lib@^2.0.10: version "2.0.10" resolved "https://registry.yarnpkg.com/merkle-lib/-/merkle-lib-2.0.10.tgz#82b8dbae75e27a7785388b73f9d7725d0f6f3326" integrity sha1-grjbrnXieneFOItz+ddyXQ9vMyY= @@ -5173,6 +5281,11 @@ nan@^2.14.0: resolved "https://registry.yarnpkg.com/nan/-/nan-2.14.0.tgz#7818f722027b2459a86f0295d434d1fc2336c52c" integrity sha512-INOFj37C7k3AfaNTtX8RhsTw7qRy7eLET14cROi9+5HAVbbHuIWUHEauBv5qT4Av2tWasiTY1Jw6puUNqRJXQg== +nan@^2.2.1: + version "2.22.0" + resolved "https://registry.yarnpkg.com/nan/-/nan-2.22.0.tgz#31bc433fc33213c97bad36404bb68063de604de3" + integrity sha512-nbajikzWTMwsW+eSsNm3QwlOs7het9gGJU5dDZzRTQGk03vyBOauxgI4VakDzE0PtsGTmXPsXTbbjVhRwR5mpw== + nano-json-stream-parser@^0.1.2: version "0.1.2" resolved "https://registry.yarnpkg.com/nano-json-stream-parser/-/nano-json-stream-parser-0.1.2.tgz#0cc8f6d0e2b622b479c40d499c46d64b755c6f5f" @@ -5188,6 +5301,11 @@ nanoassert@^1.0.0: resolved "https://registry.yarnpkg.com/nanoassert/-/nanoassert-1.1.0.tgz#4f3152e09540fde28c76f44b19bbcd1d5a42478d" integrity sha1-TzFS4JVA/eKMdvRLGbvNHVpCR40= +nanoassert@^2.0.0: + version "2.0.0" + resolved "https://registry.yarnpkg.com/nanoassert/-/nanoassert-2.0.0.tgz#a05f86de6c7a51618038a620f88878ed1e490c09" + integrity sha512-7vO7n28+aYO4J+8w96AzhmU8G+Y/xpPDJz/se19ICsqj/momRbb9mh9ZUtkoJ5X3nTnPdhEJyc0qnM6yAsHBaA== + negotiator@0.6.2: version "0.6.2" resolved "https://registry.yarnpkg.com/negotiator/-/negotiator-0.6.2.tgz#feacf7ccf525a77ae9634436a64883ffeca346fb" @@ -6084,7 +6202,7 @@ punycode@^2.1.0, punycode@^2.1.1: resolved "https://registry.yarnpkg.com/punycode/-/punycode-2.1.1.tgz#b58b010ac40c22c5657616c8d2c2c02c7bf479ec" integrity sha512-XRsRjdf+j5ml+y/6GKHPZbrF/8p2Yga0JPtdqTIY2Xe5ohJPD9saDJJLPvp9+NSBprVvevdXZybnj2cv8OEd0A== -pushdata-bitcoin@^1.0.1: +pushdata-bitcoin@1.0.1, pushdata-bitcoin@^1.0.1: version "1.0.1" resolved "https://registry.yarnpkg.com/pushdata-bitcoin/-/pushdata-bitcoin-1.0.1.tgz#15931d3cd967ade52206f523aa7331aef7d43af7" integrity sha1-FZMdPNlnreUiBvUjqnMxrvfUOvc= @@ -6139,6 +6257,11 @@ ramda@^0.24.1: resolved "https://registry.yarnpkg.com/ramda/-/ramda-0.24.1.tgz#c3b7755197f35b8dc3502228262c4c91ddb6b857" integrity sha1-w7d1UZfzW43DUCIoJixMkd22uFc= +randombytes@2.0.1: + version "2.0.1" + resolved "https://registry.yarnpkg.com/randombytes/-/randombytes-2.0.1.tgz#18f4a9ba0dd07bdb1580bc9156091fcf90eabc6f" + integrity sha512-siCt2duOdZbmvgk8IDL4U0SYXI8ypBEKWuor0qUpHBWAyOCrXQvSIYJ+VKuEpoX36moZ1pAu+mXkwUVAVssu6w== + randombytes@^2.0.1, randombytes@^2.1.0: version "2.1.0" resolved "https://registry.yarnpkg.com/randombytes/-/randombytes-2.1.0.tgz#df6f84372f0270dc65cdf6291349ab7a473d4f2a" @@ -6523,6 +6646,11 @@ rimraf@^3.0.0, rimraf@^3.0.2: dependencies: glob "^7.1.3" +ripemd160@^1.0.0: + version "1.0.1" + resolved "https://registry.yarnpkg.com/ripemd160/-/ripemd160-1.0.1.tgz#93a4bbd4942bc574b69a8fa57c71de10ecca7d6e" + integrity sha512-J0YlH2ow/i7d5PJX9RC1XnjmZc7cNNYWe89PIlFszvHeiEtxzA1/VYePkjQ7l1SkUejAcHeDo3IVp2WIzstXXQ== + ripemd160@^2.0.0, ripemd160@^2.0.1, ripemd160@^2.0.2: version "2.0.2" resolved "https://registry.yarnpkg.com/ripemd160/-/ripemd160-2.0.2.tgz#a1c1a6f624751577ba5d07914cbc92850585890c" @@ -6740,7 +6868,7 @@ setprototypeof@1.2.0: resolved "https://registry.yarnpkg.com/setprototypeof/-/setprototypeof-1.2.0.tgz#66c9a24a73f9fc28cbe66b09fed3d33dcaf1b424" integrity sha512-E5LDX7Wrp85Kil5bhZv46j8jOeboKq5JMmYM3gVGdGH8xFpPWXUMsNrlODCrkoxMEeNi/XZIwuRvY4XNwYMJpw== -sha.js@^2.4.0, sha.js@^2.4.8: +sha.js@^2.3.6, sha.js@^2.4.0, sha.js@^2.4.8: version "2.4.11" resolved "https://registry.yarnpkg.com/sha.js/-/sha.js-2.4.11.tgz#37a5cf0b81ecbc6943de109ba2960d1b26584ae7" integrity sha512-QMEp5B7cftE7APOjk5Y6xgrbWu+WkLVQwk8JNjZ8nKRciZaByEW6MubieAiToS7+dwvrjGhH8jRXz3MVd0AYqQ== @@ -7346,6 +7474,17 @@ tiny-secp256k1@^1.0.0: elliptic "^6.4.0" nan "^2.13.2" +tiny-secp256k1@^1.1.3: + version "1.1.7" + resolved "https://registry.yarnpkg.com/tiny-secp256k1/-/tiny-secp256k1-1.1.7.tgz#0c1b6b9d2d93404f9093dc7e287b0aa834480573" + integrity sha512-eb+F6NabSnjbLwNoC+2o5ItbmP1kg7HliWue71JgLegQt6A5mTN8YbvTLCazdlg6e5SV6A+r8OGvZYskdlmhqQ== + dependencies: + bindings "^1.3.0" + bn.js "^4.11.8" + create-hmac "^1.1.7" + elliptic "^6.4.0" + nan "^2.13.2" + tmp-promise@^3.0.2: version "3.0.3" resolved "https://registry.yarnpkg.com/tmp-promise/-/tmp-promise-3.0.3.tgz#60a1a1cc98c988674fcbfd23b6e3367bdeac4ce7" @@ -7492,6 +7631,13 @@ typedarray@^0.0.6: resolved "https://registry.yarnpkg.com/typedarray/-/typedarray-0.0.6.tgz#867ac74e3864187b1d3d47d996a78ec5c8830777" integrity sha1-hnrHTjhkGHsdPUfZlqeOxciDB3c= +typeforce@1.11.3: + version "1.11.3" + resolved "https://registry.yarnpkg.com/typeforce/-/typeforce-1.11.3.tgz#a54d0ff58808788fba358020982270bd6995d8e4" + integrity sha512-+vllWbxe1AKLkO3KNyZPjb51NRHwRE/8bAi/cmF6TK24VqrPiQPRiHrFV19j1xHxxCHQbIvN4Zfco+skuiXSWQ== + dependencies: + inherits "^2.0.1" + typeforce@^1.11.1, typeforce@^1.11.3, typeforce@^1.11.5, "typeforce@git+https://github.com/michaeltout/typeforce": version "1.18.0" resolved "git+https://github.com/michaeltout/typeforce#c9b0abc33ff006d7a6a6150eff034bc7eb8b07de" @@ -7728,6 +7874,11 @@ varint@^5.0.0: resolved "https://registry.yarnpkg.com/varint/-/varint-5.0.2.tgz#5b47f8a947eb668b848e034dcfa87d0ff8a7f7a4" integrity sha512-lKxKYG6H03yCZUpAGOPOsMcGxd1RHCu1iKvEHYDPmTyq2HueGhD73ssNBqqQWfvYs04G9iUFRvmAVLW20Jw6ow== +varuint-bitcoin@1.0.4: + version "1.0.4" + resolved "https://registry.yarnpkg.com/varuint-bitcoin/-/varuint-bitcoin-1.0.4.tgz#d812c5dae16e32f60544b6adee1d4be1307d0283" + integrity sha512-2nW4pVicYWxOMY1u+3T3eFXw24wbFlKz+ug7hd02rozYmeFVBoC6LB7/P4E46jN9aD1ezhX01g2Uh4zrZ+9RWw== + varuint-bitcoin@^1.0.1, varuint-bitcoin@^1.0.4: version "1.1.2" resolved "https://registry.yarnpkg.com/varuint-bitcoin/-/varuint-bitcoin-1.1.2.tgz#e76c138249d06138b480d4c5b40ef53693e24e92" @@ -8121,6 +8272,13 @@ widest-line@^2.0.0: dependencies: string-width "^2.1.1" +wif@2.0.1: + version "2.0.1" + resolved "https://registry.yarnpkg.com/wif/-/wif-2.0.1.tgz#27149a62757e4db694729378e7aeca7b09648012" + integrity sha512-Ba/Ypzo2Vg512kPn+Rt8R1ss019J/8n5E+lVyHJDc8EwTZ8fNLmhkTe7GitxghAiENWuunOa4qnwl7KIj39zfw== + dependencies: + bs58check "^1.0.6" + wif@2.0.6, wif@^2.0.1, wif@^2.0.6: version "2.0.6" resolved "https://registry.yarnpkg.com/wif/-/wif-2.0.6.tgz#08d3f52056c66679299726fade0d432ae74b4704" From 7569c1b9557eb04497720ddd38db395db18033f8 Mon Sep 17 00:00:00 2001 From: mcstoer <49734282+mcstoer@users.noreply.github.com> Date: Wed, 23 Oct 2024 16:55:30 -0700 Subject: [PATCH 11/17] Add api call for calling the daemon with the getblock command. --- routes/api.js | 1 + routes/api/native/getBlock.js | 65 +++++++++++++++++++++++++++++++++++ 2 files changed, 66 insertions(+) create mode 100644 routes/api/native/getBlock.js diff --git a/routes/api.js b/routes/api.js index f2ae6712..256295dc 100644 --- a/routes/api.js +++ b/routes/api.js @@ -130,6 +130,7 @@ api = require('./api/native/callDaemon')(api); api = require('./api/native/addresses')(api); api = require('./api/native/balances')(api); api = require('./api/native/definedchains')(api); +api = require('./api/native/getBlock.js')(api); api = require('./api/native/info')(api); api = require('./api/native/mininginfo')(api); api = require('./api/native/getTransaction.js')(api); diff --git a/routes/api/native/getBlock.js b/routes/api/native/getBlock.js new file mode 100644 index 00000000..44a10c11 --- /dev/null +++ b/routes/api/native/getBlock.js @@ -0,0 +1,65 @@ +module.exports = (api) => { + /** + * Gets the version, hashtype and height from a signature. + * + * @param {String} coin The chainTicker of the coin to make the call on + * @param {String} hashorheight The block hash or height + * @param {String} verbosity The verbosity of the result. 0 for hex encoded data, 1 for a json object, and 2 for json object with transaction data + */ + api.native.get_block = ( + coin, + hashorheight, + verbosity = 1, + ) => { + return new Promise((resolve, reject) => { + api.native + .callDaemon( + coin, + "getblock", + [ + hashorheight, + verbosity + ] + ) + .then(resultObj => { + resolve(resultObj) + }) + .catch(err => { + reject(err); + }); + }); + }; + + api.setPost('/native/get_block', (req, res, next) => { + const { + chainTicker, + hashorheight, + verbosity + } = req.body; + + api.native + .get_block( + chainTicker, + hashorheight, + verbosity + ) + .then(resultObj => { + const retObj = { + msg: "success", + result: resultObj + }; + + res.send(JSON.stringify(retObj)); + }) + .catch(error => { + const retObj = { + msg: "error", + result: error.message + }; + + res.send(JSON.stringify(retObj)); + }); + }); + + return api; +} \ No newline at end of file From 7efb8d3b47ab4ee714e221facd9bc0c22cc048cf Mon Sep 17 00:00:00 2001 From: mcstoer <49734282+mcstoer@users.noreply.github.com> Date: Mon, 28 Oct 2024 16:15:26 -0700 Subject: [PATCH 12/17] Update handling login consent requests to support Pbaas chains. --- routes/api/dlhandler.js | 3 +- .../api/native/verusid/login/signResponse.js | 11 ++++- .../api/native/verusid/login/verifyRequest.js | 16 +------- yarn.lock | 41 +++++++------------ 4 files changed, 28 insertions(+), 43 deletions(-) diff --git a/routes/api/dlhandler.js b/routes/api/dlhandler.js index 30d0ebc8..8a51ccca 100644 --- a/routes/api/dlhandler.js +++ b/routes/api/dlhandler.js @@ -13,7 +13,8 @@ module.exports = (api) => { req.toJson(), { id: "VERUS_DESKTOP_MAIN", - search_builtin: true + search_builtin: true, + main_chain_ticker: "VRSC" } ) } diff --git a/routes/api/native/verusid/login/signResponse.js b/routes/api/native/verusid/login/signResponse.js index 6eb5668d..540c1b72 100644 --- a/routes/api/native/verusid/login/signResponse.js +++ b/routes/api/native/verusid/login/signResponse.js @@ -7,16 +7,20 @@ const { module.exports = (api) => { api.native.verusid.login.sign_response = async (response) => { const loginResponse = new LoginConsentResponse(response); + const chainTicker = response.chainTicker + // Add the chainTicker when checking the request since the verify request needs it. + let decisionRequest = loginResponse.decision.request + decisionRequest.chainTicker = chainTicker const verificatonCheck = await api.native.verusid.login.verify_request( - loginResponse.decision.request + decisionRequest ); if (!verificatonCheck.verified) { throw new Error(verificatonCheck.message); } - const signdataResult = await api.native.sign_data(response.chain_id, + const signdataResult = await api.native.sign_data(chainTicker, { "address": loginResponse.signing_id, "datahash": loginResponse.decision.toSha256().toString("hex") @@ -28,6 +32,9 @@ module.exports = (api) => { LOGIN_CONSENT_RESPONSE_SIG_VDXF_KEY ); + // Remove the chainTicker field since it's not normally part of the response. + delete decisionRequest.chainTicker + return { response: loginResponse}; }; diff --git a/routes/api/native/verusid/login/verifyRequest.js b/routes/api/native/verusid/login/verifyRequest.js index 183abea7..c80c0358 100644 --- a/routes/api/native/verusid/login/verifyRequest.js +++ b/routes/api/native/verusid/login/verifyRequest.js @@ -7,22 +7,10 @@ module.exports = (api) => { */ api.native.verusid.login.verify_request = async (request) => { const loginConsentRequest = new LoginConsentRequest(request); - - let chain_id - - switch (loginConsentRequest.system_id) { - case "i5w5MuNik5NtLcYmNzcvaoixooEebB6MGV": - chain_id = "VRSC"; - break; - case "iJhCezBExJHvtyH3fGhNnt2NhU4Ztkf2yq": - chain_id = "VRSCTEST"; - break; - default: - throw new Error("Unknown system id.") - } + const chainTicker = request.chainTicker const verified = await api.native.verify_hash( - chain_id, + chainTicker, loginConsentRequest.signing_id, loginConsentRequest.challenge.toSha256().toString('hex'), loginConsentRequest.signature.signature diff --git a/yarn.lock b/yarn.lock index eb2b5894..e656e25c 100644 --- a/yarn.lock +++ b/yarn.lock @@ -970,6 +970,11 @@ resolved "https://registry.yarnpkg.com/@types/node/-/node-14.0.1.tgz#5d93e0a099cd0acd5ef3d5bde3c086e1f49ff68c" integrity sha512-FAYBGwC+W6F9+huFIDtn43cpy7+SzG+atzRiTfdp3inUKL2hXnd4rG8hylJLIh4+hqrQy1P17kvJByE/z825hA== +"@types/node@10.12.18": + version "10.12.18" + resolved "https://registry.yarnpkg.com/@types/node/-/node-10.12.18.tgz#1d3ca764718915584fcd9f6344621b7672665c67" + integrity sha512-fh+pAqt4xRzPfqA6eh3Z2y6fyZavRIumvjhaCL753+TVkGKGhpPeyrJG2JftD0T9q4GF00KjefsQ+PQNDdWQaQ== + "@types/node@>=10.0.0": version "17.0.16" resolved "https://registry.yarnpkg.com/@types/node/-/node-17.0.16.tgz#e3733f46797b9df9e853ca9f719c8a6f7b84cd26" @@ -1440,7 +1445,7 @@ binary@~0.3.0: buffers "~0.1.1" chainsaw "~0.1.0" -bindings@^1.2.1, bindings@^1.3.0, bindings@^1.5.0: +bindings@^1.3.0, bindings@^1.5.0: version "1.5.0" resolved "https://registry.yarnpkg.com/bindings/-/bindings-1.5.0.tgz#10353c9e945334bc0511a6d90b38fbc7c9c504df" integrity sha512-p2q/t/mhvuOj/UeLlV6566GD/guowlr0hHxClI0W9m7MWYkL1F0hLo+0Aexs9HSPCtR1SXQ0TD3MMKrXZajbiQ== @@ -1488,19 +1493,14 @@ bip66@1.1.0: resolved "https://registry.yarnpkg.com/bip66/-/bip66-1.1.0.tgz#c5551d49d1696d78211be047e997fe7aac8820c5" integrity sha512-dBoAPJYg6HaaQeJGr4cNiqat1meGzlrv2qX+EJcW5q0zEdryMSLKlQKdTaCtDnrzEUPkwmlYqsD7ANaye4BEfg== -bip66@^1.1.0, bip66@^1.1.3, bip66@^1.1.5: +bip66@^1.1.0, bip66@^1.1.5: version "1.1.5" resolved "https://registry.yarnpkg.com/bip66/-/bip66-1.1.5.tgz#01fa8748785ca70955d5011217d1b3139969ca22" integrity sha1-AfqHSHhcpwlV1QESF9GzE5lpyiI= dependencies: safe-buffer "^5.0.1" -bitcoin-ops@^1.3.0, bitcoin-ops@^1.4.0, bitcoin-ops@^1.4.1: - version "1.4.1" - resolved "https://registry.yarnpkg.com/bitcoin-ops/-/bitcoin-ops-1.4.1.tgz#e45de620398e22fd4ca6023de43974ff42240278" - integrity sha512-pef6gxZFztEhaE9RY9HmWVmiIHqCb2OyS4HPKkpc6CIiiOa3Qmuoylxc5P2EkU3w+5eTSifI9SEZC88idAIGow== - -"bitcoin-ops@git+https://github.com/VerusCoin/bitcoin-ops": +bitcoin-ops@^1.3.0, bitcoin-ops@^1.4.0, bitcoin-ops@^1.4.1, "bitcoin-ops@git+https://github.com/VerusCoin/bitcoin-ops": version "1.4.1" resolved "git+https://github.com/VerusCoin/bitcoin-ops#a5f8f56e658301bc39881d41740b3a0010530efd" @@ -1638,7 +1638,7 @@ bluebird@~3.4.1: resolved "https://registry.yarnpkg.com/bluebird/-/bluebird-3.4.7.tgz#f72d760be09b7f76d08ed8fae98b289a8d05fab3" integrity sha1-9y12C+Cbf3bQjtj66Ysomo0F+rM= -bn.js@4.11.6, bn.js@4.11.8, bn.js@5.2.1, bn.js@=2.0.4, bn.js@^4.11.0, bn.js@^4.11.1, bn.js@^4.11.3, bn.js@^4.11.6, bn.js@^4.11.8, bn.js@^4.11.9, bn.js@^4.4.0, bn.js@^5.1.2, bn.js@^5.2.0, bn.js@^5.2.1: +bn.js@4.11.6, bn.js@4.11.8, bn.js@5.2.1, bn.js@=2.0.4, bn.js@^4.11.0, bn.js@^4.11.1, bn.js@^4.11.6, bn.js@^4.11.8, bn.js@^4.11.9, bn.js@^4.4.0, bn.js@^5.1.2, bn.js@^5.2.0, bn.js@^5.2.1: version "4.11.8" resolved "https://registry.yarnpkg.com/bn.js/-/bn.js-4.11.8.tgz#2cde09eb5ee341f484746bb0309b3253b1b1442f" integrity sha512-ItfYfPLkWHUjckQCk8xC+LwxgK8NYcXywGigJgSwOP8Y2iyWT4f2vsZnoOXTTbo+o5yXmIUJ4gn5538SO5S3gA== @@ -2833,11 +2833,7 @@ electron@22.3.25: "@types/node" "^16.11.26" extract-zip "^2.0.1" -<<<<<<< HEAD elliptic@6.5.2, elliptic@6.5.3, elliptic@6.5.4, elliptic@=3.0.3, elliptic@^6.4.0, elliptic@^6.5.2, elliptic@^6.5.7: -======= -elliptic@6.5.2, elliptic@6.5.3, elliptic@6.5.4, elliptic@=3.0.3, elliptic@^6.4.0, elliptic@^6.4.1, elliptic@^6.5.2: ->>>>>>> 13ce27e (Change the signing of the login consent response to use the signdata command.) version "6.5.4" resolved "https://registry.yarnpkg.com/elliptic/-/elliptic-6.5.4.tgz#da37cebd31e79a1367e941b592ed1fbebd58abbb" integrity sha512-iLhC6ULemrljPZb+QutR5TQGB+pdW6KGD5RSegS+8sorOZT+rdQFbsQFJgvN3eRqNALqJer4oQ16YvJHlU8hzQ== @@ -5281,11 +5277,6 @@ nan@^2.14.0: resolved "https://registry.yarnpkg.com/nan/-/nan-2.14.0.tgz#7818f722027b2459a86f0295d434d1fc2336c52c" integrity sha512-INOFj37C7k3AfaNTtX8RhsTw7qRy7eLET14cROi9+5HAVbbHuIWUHEauBv5qT4Av2tWasiTY1Jw6puUNqRJXQg== -nan@^2.2.1: - version "2.22.0" - resolved "https://registry.yarnpkg.com/nan/-/nan-2.22.0.tgz#31bc433fc33213c97bad36404bb68063de604de3" - integrity sha512-nbajikzWTMwsW+eSsNm3QwlOs7het9gGJU5dDZzRTQGk03vyBOauxgI4VakDzE0PtsGTmXPsXTbbjVhRwR5mpw== - nano-json-stream-parser@^0.1.2: version "0.1.2" resolved "https://registry.yarnpkg.com/nano-json-stream-parser/-/nano-json-stream-parser-0.1.2.tgz#0cc8f6d0e2b622b479c40d499c46d64b755c6f5f" @@ -6692,6 +6683,11 @@ run-queue@^1.0.0, run-queue@^1.0.3: dependencies: aproba "^1.1.1" +safe-buffer@5.0.1: + version "5.0.1" + resolved "https://registry.yarnpkg.com/safe-buffer/-/safe-buffer-5.0.1.tgz#d263ca54696cd8a306b5ca6551e92de57918fbe7" + integrity sha512-cr7dZWLwOeaFBLTIuZeYdkfO7UzGIKhjYENJFAxUOMKWGaWDm2nJM2rzxNRm5Owu0DH3ApwNo6kx5idXZfb/Iw== + safe-buffer@5.2.1, safe-buffer@^5.2.1, safe-buffer@~5.2.0: version "5.2.1" resolved "https://registry.yarnpkg.com/safe-buffer/-/safe-buffer-5.2.1.tgz#1eaf9fa9bdb1fdd4ec75f58f9cdb4e6b7827eec6" @@ -6734,17 +6730,10 @@ scrypt-js@3.0.1, scrypt-js@^3.0.0, scrypt-js@^3.0.1: resolved "https://registry.yarnpkg.com/scrypt-js/-/scrypt-js-3.0.1.tgz#d314a57c2aef69d1ad98a138a21fe9eafa9ee312" integrity sha512-cdwTTnqPu0Hyvf5in5asVdZocVDTNRmR7XEcJuIzMjJeSHybHl7vpB66AzwTaIg6CLSbtjcxc8fqcySfnTkccA== -<<<<<<< HEAD -secp256k1@3.8.1, secp256k1@^3.0.1, secp256k1@^3.5.2, secp256k1@^4.0.1: +secp256k1@3.5.2, secp256k1@3.8.1, secp256k1@^3.0.1, secp256k1@^3.5.2, secp256k1@^4.0.1: version "3.8.1" resolved "https://registry.yarnpkg.com/secp256k1/-/secp256k1-3.8.1.tgz#b62a62a882d6b16f9b51fe599c6b3a861e36c59f" integrity sha512-tArjQw2P0RTdY7QmkNehgp6TVvQXq6ulIhxv8gaH6YubKG/wxxAoNKcbuXjDhybbc+b2Ihc7e0xxiGN744UIiQ== -======= -secp256k1@^3.0.1: - version "3.8.0" - resolved "https://registry.yarnpkg.com/secp256k1/-/secp256k1-3.8.0.tgz#28f59f4b01dbee9575f56a47034b7d2e3b3b352d" - integrity sha512-k5ke5avRZbtl9Tqx/SA7CbY3NF6Ro+Sj9cZxezFzuBlLDmyqPiL8hJJ+EmzD8Ig4LUDByHJ3/iPOVoRixs/hmw== ->>>>>>> 13ce27e (Change the signing of the login consent response to use the signdata command.) dependencies: bindings "^1.5.0" bip66 "^1.1.5" From 732afd1f910174d3e35fe1f9de4435b367662be2 Mon Sep 17 00:00:00 2001 From: mcstoer <49734282+mcstoer@users.noreply.github.com> Date: Sat, 2 Nov 2024 11:47:50 -0700 Subject: [PATCH 13/17] Update base64url library to use the VerusCoin version and update the deeplink handler to use a constant for checking whether the app is testnet or not. --- package.json | 2 +- routes/api/dlhandler.js | 3 ++- routes/api/utils/constants/dev_options.js | 5 +++++ yarn.lock | 7 ++++++- 4 files changed, 14 insertions(+), 3 deletions(-) create mode 100644 routes/api/utils/constants/dev_options.js diff --git a/package.json b/package.json index 234ae60a..8b2e0e0d 100644 --- a/package.json +++ b/package.json @@ -53,7 +53,7 @@ "arch": "2.1.0", "async": "2.6.4", "axios": "1.6.5", - "base64url": "https://github.com/michaeltout/base64url.git", + "base64url": "https://github.com/VerusCoin/base64url.git", "bigi": "1.4.2", "bitgo-utxo-lib": "git+https://github.com/VerusCoin/bitgo-utxo-lib.git", "blake2b": "https://github.com/VerusCoin/blake2b.git", diff --git a/routes/api/dlhandler.js b/routes/api/dlhandler.js index 8a51ccca..8cd17f45 100644 --- a/routes/api/dlhandler.js +++ b/routes/api/dlhandler.js @@ -1,5 +1,6 @@ const { LOGIN_CONSENT_REQUEST_VDXF_KEY, LoginConsentRequest } = require('verus-typescript-primitives'); const base64url = require("base64url"); +const { IS_TESTNET } = require('./utils/constants/dev_options'); module.exports = (api) => { api.dlhandler = (url) => { @@ -14,7 +15,7 @@ module.exports = (api) => { { id: "VERUS_DESKTOP_MAIN", search_builtin: true, - main_chain_ticker: "VRSC" + main_chain_ticker: IS_TESTNET ? "VRSCTEST" : "VRSC" } ) } diff --git a/routes/api/utils/constants/dev_options.js b/routes/api/utils/constants/dev_options.js new file mode 100644 index 00000000..5edd2014 --- /dev/null +++ b/routes/api/utils/constants/dev_options.js @@ -0,0 +1,5 @@ +const IS_TESTNET = false; + +module.exports = { + IS_TESTNET +} \ No newline at end of file diff --git a/yarn.lock b/yarn.lock index e656e25c..d304e3bd 100644 --- a/yarn.lock +++ b/yarn.lock @@ -1379,10 +1379,15 @@ base64id@2.0.0, base64id@~2.0.0: resolved "https://registry.yarnpkg.com/base64id/-/base64id-2.0.0.tgz#2770ac6bc47d312af97a8bf9a634342e0cd25cb6" integrity sha512-lGe34o6EHj9y3Kts9R4ZYs/Gr+6N7MCaMlIFA3F1R2O5/m7K06AxfSeO5530PEERE6/WyEg3lsuyw4GHlPZHog== -base64url@3.0.1, "base64url@https://github.com/michaeltout/base64url.git": +base64url@3.0.1: version "3.0.1" resolved "https://github.com/michaeltout/base64url.git#3217a593e0e665078aa4a71c9f887f8d2e5424fb" +"base64url@https://github.com/VerusCoin/base64url.git": + version "3.0.1" + uid "3217a593e0e665078aa4a71c9f887f8d2e5424fb" + resolved "https://github.com/VerusCoin/base64url.git#3217a593e0e665078aa4a71c9f887f8d2e5424fb" + bcrypt-pbkdf@^1.0.0: version "1.0.2" resolved "https://registry.yarnpkg.com/bcrypt-pbkdf/-/bcrypt-pbkdf-1.0.2.tgz#a4301d389b6a43f9b67ff3ca11a3f6637e360e9e" From a7de089145a93ff22ffc52544432c2acc70ef427 Mon Sep 17 00:00:00 2001 From: Asher Dawes Date: Tue, 5 Nov 2024 17:36:01 -0800 Subject: [PATCH 14/17] Use git+ prefix for base64url dependency and remove the previous base64url dependency reference --- package.json | 2 +- yarn.lock | 8 ++------ 2 files changed, 3 insertions(+), 7 deletions(-) diff --git a/package.json b/package.json index 8b2e0e0d..392ab04a 100644 --- a/package.json +++ b/package.json @@ -53,7 +53,7 @@ "arch": "2.1.0", "async": "2.6.4", "axios": "1.6.5", - "base64url": "https://github.com/VerusCoin/base64url.git", + "base64url": "git+https://github.com/VerusCoin/base64url.git", "bigi": "1.4.2", "bitgo-utxo-lib": "git+https://github.com/VerusCoin/bitgo-utxo-lib.git", "blake2b": "https://github.com/VerusCoin/blake2b.git", diff --git a/yarn.lock b/yarn.lock index d304e3bd..c9fc1131 100644 --- a/yarn.lock +++ b/yarn.lock @@ -1379,14 +1379,10 @@ base64id@2.0.0, base64id@~2.0.0: resolved "https://registry.yarnpkg.com/base64id/-/base64id-2.0.0.tgz#2770ac6bc47d312af97a8bf9a634342e0cd25cb6" integrity sha512-lGe34o6EHj9y3Kts9R4ZYs/Gr+6N7MCaMlIFA3F1R2O5/m7K06AxfSeO5530PEERE6/WyEg3lsuyw4GHlPZHog== -base64url@3.0.1: - version "3.0.1" - resolved "https://github.com/michaeltout/base64url.git#3217a593e0e665078aa4a71c9f887f8d2e5424fb" - -"base64url@https://github.com/VerusCoin/base64url.git": +"base64url@git+https://github.com/VerusCoin/base64url.git": version "3.0.1" uid "3217a593e0e665078aa4a71c9f887f8d2e5424fb" - resolved "https://github.com/VerusCoin/base64url.git#3217a593e0e665078aa4a71c9f887f8d2e5424fb" + resolved "git+https://github.com/VerusCoin/base64url.git#3217a593e0e665078aa4a71c9f887f8d2e5424fb" bcrypt-pbkdf@^1.0.0: version "1.0.2" From 31442a02eba5a47933d7481d55edaa22d75db62a Mon Sep 17 00:00:00 2001 From: mcstoer <49734282+mcstoer@users.noreply.github.com> Date: Tue, 5 Nov 2024 22:13:30 -0800 Subject: [PATCH 15/17] Prevent opening any redirect urls from login consent requests that don't go the browser. --- routes/api/plugin/builtin/loginconsentui.js | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/routes/api/plugin/builtin/loginconsentui.js b/routes/api/plugin/builtin/loginconsentui.js index edd99eb2..aa169032 100644 --- a/routes/api/plugin/builtin/loginconsentui.js +++ b/routes/api/plugin/builtin/loginconsentui.js @@ -26,6 +26,12 @@ module.exports = (api) => { }, [LOGIN_CONSENT_REDIRECT_VDXF_KEY.vdxfid]: () => { const url = new URL(uri) + + // Prevent opening any urls that don't go to the browser. + if (!['https:', 'http:'].includes(url.protocol)) { + return null; + } + const res = new LoginConsentResponse(response) url.searchParams.set( LOGIN_CONSENT_RESPONSE_VDXF_KEY.vdxfid, From 736d12394d7c56ab8dba5294faa1ab541f5496f8 Mon Sep 17 00:00:00 2001 From: michaeltout Date: Fri, 8 Nov 2024 22:25:59 +0100 Subject: [PATCH 16/17] Make VerusID login enabled by default --- main.js | 2 +- routes/appConfig.js | 8 ++++---- yarn.lock | 37 ++++++++----------------------------- 3 files changed, 13 insertions(+), 34 deletions(-) diff --git a/main.js b/main.js index f0f59b7e..bf502fe0 100644 --- a/main.js +++ b/main.js @@ -562,7 +562,7 @@ if (!hasLock) { app.on("second-instance", handleSecondInstance); // Deep linking - if (appConfig.general.main.enableDeeplink) { + if (!appConfig.general.main.disableDeeplink) { api.log("setting up deeplink", "init"); setuplink(app); } else { diff --git a/routes/appConfig.js b/routes/appConfig.js index f96a12b1..f092fccd 100644 --- a/routes/appConfig.js +++ b/routes/appConfig.js @@ -60,7 +60,7 @@ const appConfig = { alwaysPromptUpdates: true, periodicallyCheckUpdates: true, encryptApiPost: true, - enableDeeplink: false, + disableDeeplink: false, agreedToTerms: false }, electrum: { @@ -166,10 +166,10 @@ const appConfig = { encryptApiPost: { hidden: true }, - enableDeeplink: { + disableDeeplink: { type: "checkbox", - displayName: "Enable experimental VerusID login", - info: "Enable logging in with VerusID through browser redirects. This is an experimental feature." + displayName: "Disable VerusID login", + info: "Disable logging in with VerusID through browser redirects." }, }, electrum: { diff --git a/yarn.lock b/yarn.lock index c9fc1131..0997f9f6 100644 --- a/yarn.lock +++ b/yarn.lock @@ -1379,9 +1379,13 @@ base64id@2.0.0, base64id@~2.0.0: resolved "https://registry.yarnpkg.com/base64id/-/base64id-2.0.0.tgz#2770ac6bc47d312af97a8bf9a634342e0cd25cb6" integrity sha512-lGe34o6EHj9y3Kts9R4ZYs/Gr+6N7MCaMlIFA3F1R2O5/m7K06AxfSeO5530PEERE6/WyEg3lsuyw4GHlPZHog== +base64url@3.0.1: + version "3.0.1" + resolved "https://registry.yarnpkg.com/base64url/-/base64url-3.0.1.tgz#6399d572e2bc3f90a9a8b22d5dbb0a32d33f788d" + integrity sha512-ir1UPr3dkwexU7FdV8qBBbNDRUhMmIekYMFZfi+C/sLNnRESKPl23nB9b2pltqfOQNnGzsDdId90AEtG5tCx4A== + "base64url@git+https://github.com/VerusCoin/base64url.git": version "3.0.1" - uid "3217a593e0e665078aa4a71c9f887f8d2e5424fb" resolved "git+https://github.com/VerusCoin/base64url.git#3217a593e0e665078aa4a71c9f887f8d2e5424fb" bcrypt-pbkdf@^1.0.0: @@ -7163,7 +7167,7 @@ strict-uri-encode@^2.0.0: resolved "https://registry.yarnpkg.com/strict-uri-encode/-/strict-uri-encode-2.0.0.tgz#b9c7330c7042862f6b142dc274bbcc5866ce3546" integrity sha1-ucczDHBChi9rFC3CdLvMWGbONUY= -"string-width-cjs@npm:string-width@^4.2.0": +"string-width-cjs@npm:string-width@^4.2.0", string-width@^4.2.3: version "4.2.3" resolved "https://registry.yarnpkg.com/string-width/-/string-width-4.2.3.tgz#269c7117d27b05ad2e536830a8ec895ef9c6d010" integrity sha512-wKyQRQpjJ0sIp62ErSZdGsjMJWsap5oRNihHhu6G7JVO/9jIB6UyevL+tXuOqrng8j/cxKTWyWUwvSTriiZz/g== @@ -7207,15 +7211,6 @@ string-width@^4.1.0, string-width@^4.2.0: is-fullwidth-code-point "^3.0.0" strip-ansi "^6.0.0" -string-width@^4.2.3: - version "4.2.3" - resolved "https://registry.yarnpkg.com/string-width/-/string-width-4.2.3.tgz#269c7117d27b05ad2e536830a8ec895ef9c6d010" - integrity sha512-wKyQRQpjJ0sIp62ErSZdGsjMJWsap5oRNihHhu6G7JVO/9jIB6UyevL+tXuOqrng8j/cxKTWyWUwvSTriiZz/g== - dependencies: - emoji-regex "^8.0.0" - is-fullwidth-code-point "^3.0.0" - strip-ansi "^6.0.1" - string-width@^5.0.1, string-width@^5.1.2: version "5.1.2" resolved "https://registry.yarnpkg.com/string-width/-/string-width-5.1.2.tgz#14f8daec6d81e7221d2a357e668cab73bdbca794" @@ -7283,7 +7278,7 @@ stringify-package@^1.0.0, stringify-package@^1.0.1: resolved "https://registry.yarnpkg.com/stringify-package/-/stringify-package-1.0.1.tgz#e5aa3643e7f74d0f28628b72f3dad5cecfc3ba85" integrity sha512-sa4DUQsYciMP1xhKWGuFM04fB0LG/9DlluZoSVywUMRNvzid6XucHK0/90xGxRoHrAaROrcHK1aPKaijCtSrhg== -"strip-ansi-cjs@npm:strip-ansi@^6.0.1": +"strip-ansi-cjs@npm:strip-ansi@^6.0.1", strip-ansi@^6.0.1: version "6.0.1" resolved "https://registry.yarnpkg.com/strip-ansi/-/strip-ansi-6.0.1.tgz#9e26c63d30f53443e9489495b2105d37b67a85d9" integrity sha512-Y38VPSHcqkFrCpFnQ9vuSXmquuv5oXOKpGeT6aGrr3o3Gc9AlVa6JBfUSOCnbxGGZF+/0ooI7KrPuUSztUdU5A== @@ -7318,13 +7313,6 @@ strip-ansi@^6.0.0: dependencies: ansi-regex "^5.0.0" -strip-ansi@^6.0.1: - version "6.0.1" - resolved "https://registry.yarnpkg.com/strip-ansi/-/strip-ansi-6.0.1.tgz#9e26c63d30f53443e9489495b2105d37b67a85d9" - integrity sha512-Y38VPSHcqkFrCpFnQ9vuSXmquuv5oXOKpGeT6aGrr3o3Gc9AlVa6JBfUSOCnbxGGZF+/0ooI7KrPuUSztUdU5A== - dependencies: - ansi-regex "^5.0.1" - strip-ansi@^7.0.1: version "7.1.0" resolved "https://registry.yarnpkg.com/strip-ansi/-/strip-ansi-7.1.0.tgz#d5b6568ca689d8561370b0707685d22434faff45" @@ -8283,7 +8271,7 @@ worker-farm@^1.6.0, worker-farm@^1.7.0: dependencies: errno "~0.1.7" -"wrap-ansi-cjs@npm:wrap-ansi@^7.0.0": +"wrap-ansi-cjs@npm:wrap-ansi@^7.0.0", wrap-ansi@^7.0.0: version "7.0.0" resolved "https://registry.yarnpkg.com/wrap-ansi/-/wrap-ansi-7.0.0.tgz#67e145cff510a6a6984bdf1152911d69d2eb9e43" integrity sha512-YVGIj2kamLSTxw6NsZjoBxfSwsn0ycdesmc4p+Q21c5zPuZ1pl+NfxVdxPtdHvmNVOQ6XSYG4AUtyt/Fi7D16Q== @@ -8309,15 +8297,6 @@ wrap-ansi@^5.1.0: string-width "^3.0.0" strip-ansi "^5.0.0" -wrap-ansi@^7.0.0: - version "7.0.0" - resolved "https://registry.yarnpkg.com/wrap-ansi/-/wrap-ansi-7.0.0.tgz#67e145cff510a6a6984bdf1152911d69d2eb9e43" - integrity sha512-YVGIj2kamLSTxw6NsZjoBxfSwsn0ycdesmc4p+Q21c5zPuZ1pl+NfxVdxPtdHvmNVOQ6XSYG4AUtyt/Fi7D16Q== - dependencies: - ansi-styles "^4.0.0" - string-width "^4.1.0" - strip-ansi "^6.0.0" - wrap-ansi@^8.1.0: version "8.1.0" resolved "https://registry.yarnpkg.com/wrap-ansi/-/wrap-ansi-8.1.0.tgz#56dc22368ee570face1b49819975d9b9a5ead214" From 528d70f00c0810fe0f981ba613beb5f482df0837 Mon Sep 17 00:00:00 2001 From: Asher Dawes Date: Sun, 10 Nov 2024 15:56:55 -0800 Subject: [PATCH 17/17] Update version --- .gitlab-ci.yml | 4 ++-- package.json | 2 +- version.json | 4 ++-- version_build | 2 +- 4 files changed, 6 insertions(+), 6 deletions(-) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 1804b31e..7de8b0f5 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -8,8 +8,8 @@ stages: variables: DOCKER_DRIVER: overlay2 DEFAULT_VERUSCOIN_BRANCH: release - VERUS_VERSION: 1.2.5-2 - VERUSCOIN_VERSION: 1.2.5-2 + VERUS_VERSION: 1.2.5-3 + VERUSCOIN_VERSION: 1.2.5-3 KOMODO_VERSION: 0.9.0 KOMODO_DOWNLOAD_URL: https://github.com/KomodoPlatform/komodo/releases/download PIRATE_VERSION: 5.9.0 diff --git a/package.json b/package.json index 392ab04a..41841c4f 100644 --- a/package.json +++ b/package.json @@ -1,7 +1,7 @@ { "name": "verus-desktop", "productName": "Verus-Desktop", - "version": "1.2.5-2", + "version": "1.2.5-3", "description": "Verus Desktop Wallet App", "main": "main.js", "scripts": { diff --git a/version.json b/version.json index d540ddfd..15d22121 100644 --- a/version.json +++ b/version.json @@ -1,6 +1,6 @@ { - "version": "1.2.5-2", - "minVersion": "1.2.5-2", + "version": "1.2.5-3", + "minVersion": "1.2.5-3", "versionUrl": "https://raw.githubusercontent.com/VerusCoin/Verus-Desktop/master/version.json", "repository": "https://github.com/VerusCoin/Verus-Desktop/" } diff --git a/version_build b/version_build index c585323c..e3c8cb93 100644 --- a/version_build +++ b/version_build @@ -1 +1 @@ -1.2.5-2 \ No newline at end of file +1.2.5-3 \ No newline at end of file