diff --git a/clients/libs/nodejs/.gitignore b/clients/libs/nodejs/.gitignore new file mode 100644 index 00000000..faae5bbe --- /dev/null +++ b/clients/libs/nodejs/.gitignore @@ -0,0 +1,133 @@ +# Logs +logs +*.log +npm-debug.log* +yarn-debug.log* +yarn-error.log* +lerna-debug.log* +.pnpm-debug.log* + +# Diagnostic reports (https://nodejs.org/api/report.html) +report.[0-9]*.[0-9]*.[0-9]*.[0-9]*.json + +# Runtime data +pids +*.pid +*.seed +*.pid.lock + +# Directory for instrumented libs generated by jscoverage/JSCover +lib-cov + +# Coverage directory used by tools like istanbul +coverage +*.lcov + +# nyc test coverage +.nyc_output + +# Grunt intermediate storage (https://gruntjs.com/creating-plugins#storing-task-files) +.grunt + +# Bower dependency directory (https://bower.io/) +bower_components + +# node-waf configuration +.lock-wscript + +# Compiled binary addons (https://nodejs.org/api/addons.html) +build/Release + +# Dependency directories +node_modules/ +jspm_packages/ + +# Snowpack dependency directory (https://snowpack.dev/) +web_modules/ + +# TypeScript cache +*.tsbuildinfo + +# Optional npm cache directory +.npm + +# Optional eslint cache +.eslintcache + +# Optional stylelint cache +.stylelintcache + +# Microbundle cache +.rpt2_cache/ +.rts2_cache_cjs/ +.rts2_cache_es/ +.rts2_cache_umd/ + +# Optional REPL history +.node_repl_history + +# Output of 'npm pack' +*.tgz + +# Yarn Integrity file +.yarn-integrity + +# dotenv environment variable files +.env +.env.development.local +.env.test.local +.env.production.local +.env.local + +# parcel-bundler cache (https://parceljs.org/) +.cache +.parcel-cache + +# Next.js build output +.next +out + +# Nuxt.js build / generate output +.nuxt +dist + +# Gatsby files +.cache/ +# Comment in the public line in if your project uses Gatsby and not Next.js +# https://nextjs.org/blog/next-9-1#public-directory-support +# public + +# vuepress build output +.vuepress/dist + +# vuepress v2.x temp and cache directory +.temp +.cache + +# Docusaurus cache and generated files +.docusaurus + +# Serverless directories +.serverless/ + +# FuseBox cache +.fusebox/ + +# DynamoDB Local files +.dynamodb/ + +# TernJS port file +.tern-port + +# Stores VSCode versions used for testing VSCode extensions +.vscode-test + +# yarn v2 +.yarn/cache +.yarn/unplugged +.yarn/build-state.yml +.yarn/install-state.gz +.pnp.* + +wallet.db* +wallet.json \ No newline at end of file diff --git a/clients/nodejs/broadcast_backup_tx.js b/clients/libs/nodejs/broadcast_backup_tx.js similarity index 88% rename from clients/nodejs/broadcast_backup_tx.js rename to clients/libs/nodejs/broadcast_backup_tx.js index 1102c3da..adb7b4f6 100644 --- a/clients/nodejs/broadcast_backup_tx.js +++ b/clients/libs/nodejs/broadcast_backup_tx.js @@ -6,12 +6,12 @@ const utils = require('./utils'); const { CoinStatus } = require('./coin_enum'); -const execute = async (electrumClient, db, walletName, statechainId, toAddress, feeRate) => { +const execute = async (clientConfig, electrumClient, db, walletName, statechainId, toAddress, feeRate) => { let wallet = await sqlite_manager.getWallet(db, walletName); if (!feeRate) { - const serverInfo = await utils.infoConfig(electrumClient); + const serverInfo = await utils.infoConfig(clientConfig, electrumClient); const feeRateSatsPerByte = serverInfo.fee_rate_sats_per_byte; feeRate = feeRateSatsPerByte; } else { @@ -57,7 +57,7 @@ const execute = async (electrumClient, db, walletName, statechainId, toAddress, await sqlite_manager.updateWallet(db, wallet); - utils.completeWithdraw(coin.statechain_id, coin.signed_statechain_id); + utils.completeWithdraw(clientConfig, coin.statechain_id, coin.signed_statechain_id); return { backupTx: backupTxTxid, diff --git a/clients/nodejs/coin_enum.js b/clients/libs/nodejs/coin_enum.js similarity index 100% rename from clients/nodejs/coin_enum.js rename to clients/libs/nodejs/coin_enum.js diff --git a/clients/nodejs/coin_status.js b/clients/libs/nodejs/coin_status.js similarity index 85% rename from clients/nodejs/coin_status.js rename to clients/libs/nodejs/coin_status.js index b2a8b29c..26e453f2 100644 --- a/clients/nodejs/coin_status.js +++ b/clients/libs/nodejs/coin_status.js @@ -1,8 +1,5 @@ -const config = require('config'); const sqlite_manager = require('./sqlite_manager'); -const axios = require('axios').default; -const { SocksProxyAgent } = require('socks-proxy-agent'); const utils = require('./utils'); const bitcoinjs = require("bitcoinjs-lib"); const ecc = require("tiny-secp256k1"); @@ -10,7 +7,7 @@ const deposit = require('./deposit'); const { CoinStatus } = require('./coin_enum'); const mercury_wasm = require('mercury-wasm'); -const checkDeposit = async (electrumClient, coin, wallet_network) => { +const checkDeposit = async (clientConfig, electrumClient, coin, wallet_network) => { if (!coin.statechain_id && !coin.utxo_txid && !coin.utxo_vout) { if (coin.status != CoinStatus.INITIALISED) { @@ -56,7 +53,7 @@ const checkDeposit = async (electrumClient, coin, wallet_network) => { const utxo_txid = utxo.tx_hash; const utxo_vout = utxo.tx_pos; - const backup_tx = await deposit.createTx1(electrumClient, coin, wallet_network, utxo_txid, utxo_vout); + const backup_tx = await deposit.createTx1(clientConfig, electrumClient, coin, wallet_network, utxo_txid, utxo_vout); const activity_utxo = `${utxo_txid}:${utxo_vout}`; @@ -75,7 +72,7 @@ const checkDeposit = async (electrumClient, coin, wallet_network) => { const confirmations = blockheight - utxo.height + 1; - const confirmationTarget = config.get('confirmationTarget'); + const confirmationTarget = clientConfig.confirmationTarget; coin.status = CoinStatus.UNCONFIRMED; @@ -87,13 +84,13 @@ const checkDeposit = async (electrumClient, coin, wallet_network) => { return depositResult; } -const checkTransfer = async (coin) => { +const checkTransfer = async (clientConfig, coin) => { if (!coin.statechain_id) { throw new Error(`The coin with the aggregated address ${coin.aggregated_address} does not have a statechain ID`); } - let statechainInfo = await utils.getStatechainInfo(coin.statechain_id); + let statechainInfo = await utils.getStatechainInfo(clientConfig, coin.statechain_id); // if the statechain info is not found, we assume the coin has been transferred if (!statechainInfo) { @@ -107,7 +104,7 @@ const checkTransfer = async (coin) => { return isTransferred; } -const checkWithdrawal = async (electrumClient, coin, wallet_network) => { +const checkWithdrawal = async (clientConfig, electrumClient, coin, wallet_network) => { let txid = undefined; @@ -162,7 +159,7 @@ const checkWithdrawal = async (electrumClient, coin, wallet_network) => { const confirmations = blockheight - utxo.height + 1; - const confirmationTarget = config.get('confirmationTarget'); + const confirmationTarget = clientConfig.confirmationTarget; return confirmations >= confirmationTarget; } @@ -170,7 +167,7 @@ const checkWithdrawal = async (electrumClient, coin, wallet_network) => { return false; } -const updateCoins = async (electrumClient, db, wallet_name) => { +const updateCoins = async (clientConfig, electrumClient, db, wallet_name) => { let wallet = await sqlite_manager.getWallet(db, wallet_name); @@ -181,20 +178,20 @@ const updateCoins = async (electrumClient, db, wallet_name) => { if (coin.status == CoinStatus.INITIALISED || coin.status == CoinStatus.IN_MEMPOOL || coin.status == CoinStatus.UNCONFIRMED) { - let depositResult = await checkDeposit(electrumClient, coin, network); + let depositResult = await checkDeposit(clientConfig, electrumClient, coin, network); if (depositResult) { wallet.activities.push(depositResult.activity); await sqlite_manager.insertTransaction(db, coin.statechain_id, [depositResult.backup_tx]); } } else if (coin.status === CoinStatus.IN_TRANSFER) { - let is_transferred = await checkTransfer(coin); + let is_transferred = await checkTransfer(clientConfig, coin); if (is_transferred) { coin.status = CoinStatus.TRANSFERRED; } } else if (coin.status == CoinStatus.WITHDRAWING) { - let is_withdrawn = await checkWithdrawal(electrumClient, coin, network); + let is_withdrawn = await checkWithdrawal(clientConfig, electrumClient, coin, network); if (is_withdrawn) { coin.status = CoinStatus.WITHDRAWN; diff --git a/clients/nodejs/deposit.js b/clients/libs/nodejs/deposit.js similarity index 77% rename from clients/nodejs/deposit.js rename to clients/libs/nodejs/deposit.js index 96312d79..46978656 100644 --- a/clients/nodejs/deposit.js +++ b/clients/libs/nodejs/deposit.js @@ -1,13 +1,6 @@ const axios = require('axios').default; const { SocksProxyAgent } = require('socks-proxy-agent'); -const bitcoinjs = require("bitcoinjs-lib"); -const ecc = require("tiny-secp256k1"); -const utils = require('./utils'); const transaction = require('./transaction'); -const config = require('config'); - -// used only for random token. Can be removed later -// const crypto = require('crypto'); const mercury_wasm = require('mercury-wasm'); @@ -15,7 +8,7 @@ const sqlite_manager = require('./sqlite_manager'); const { CoinStatus } = require('./coin_enum'); -const getDepositBitcoinAddress = async (db, wallet_name, amount) => { +const getDepositBitcoinAddress = async (clientConfig, db, wallet_name, amount) => { let wallet = await sqlite_manager.getWallet(db, wallet_name); @@ -25,7 +18,7 @@ const getDepositBitcoinAddress = async (db, wallet_name, amount) => { throw new Error(`There is no token available`); } - await init(db, wallet, foundToken.token_id); + await init(clientConfig, db, wallet, foundToken.token_id); let coin = wallet.coins[wallet.coins.length - 1]; @@ -42,7 +35,7 @@ const getDepositBitcoinAddress = async (db, wallet_name, amount) => { return { "deposit_address": coin.aggregated_address, "statechain_id": coin.statechain_id }; } -const createTx1 = async (electrumClient, coin, wallet_network, tx0_hash, tx0_vout) => { +const createTx1 = async (clientConfig, electrumClient, coin, wallet_network, tx0_hash, tx0_vout) => { if (coin.status !== CoinStatus.INITIALISED) { throw new Error(`The coin with the aggregated address ${aggregated_address} is not in the INITIALISED state`); @@ -60,7 +53,7 @@ const createTx1 = async (electrumClient, coin, wallet_network, tx0_hash, tx0_vou const isWithdrawal = false; const qtBackupTx = 0; - let signed_tx = await transaction.new_transaction(electrumClient, coin, toAddress, isWithdrawal, qtBackupTx, null, wallet_network); + let signed_tx = await transaction.new_transaction(clientConfig, electrumClient, coin, toAddress, isWithdrawal, qtBackupTx, null, wallet_network); let backup_tx = { tx_n: 1, @@ -77,7 +70,7 @@ const createTx1 = async (electrumClient, coin, wallet_network, tx0_hash, tx0_vou return backup_tx; } -const init = async (db, wallet, token_id) => { +const init = async (clientConfig, db, wallet, token_id) => { let coin = mercury_wasm.getNewCoin(wallet); @@ -89,11 +82,11 @@ const init = async (db, wallet, token_id) => { let depositMsg1 = mercury_wasm.createDepositMsg1(coin, token_id); - const statechain_entity_url = config.get('statechainEntity'); + const statechain_entity_url = clientConfig.statechainEntity; const path = "deposit/init/pod"; const url = statechain_entity_url + '/' + path; - const torProxy = config.get('torProxy'); + const torProxy = clientConfig.torProxy; let socksAgent = undefined; @@ -119,13 +112,13 @@ const init = async (db, wallet, token_id) => { await sqlite_manager.updateWallet(db, wallet); } -const getTokenFromServer = async () => { +const getTokenFromServer = async (clientConfig) => { - const statechain_entity_url = config.get('statechainEntity'); + const statechain_entity_url = clientConfig.statechainEntity; const path = "tokens/token_init"; const url = statechain_entity_url + '/' + path; - const torProxy = config.get('torProxy'); + const torProxy = clientConfig.torProxy; let socksAgent = undefined; @@ -144,11 +137,11 @@ const getTokenFromServer = async () => { return token; } -const getToken = async (db, walletName) => { +const getToken = async (clientConfig, db, walletName) => { let wallet = await sqlite_manager.getWallet(db, walletName); - let token = await getTokenFromServer(); + let token = await getTokenFromServer(clientConfig); // for dev purposes token.confirmed = true; @@ -160,4 +153,4 @@ const getToken = async (db, walletName) => { return token; } -module.exports = { /*execute, createStatecoin,*/ getDepositBitcoinAddress, createTx1, getToken }; \ No newline at end of file +module.exports = { getDepositBitcoinAddress, createTx1, getToken }; \ No newline at end of file diff --git a/clients/libs/nodejs/index.js b/clients/libs/nodejs/index.js new file mode 100644 index 00000000..ea650047 --- /dev/null +++ b/clients/libs/nodejs/index.js @@ -0,0 +1,196 @@ + +const ElectrumCli = require('@mempool/electrum-client'); + +const deposit = require('./deposit'); +const broadcast_backup_tx = require('./broadcast_backup_tx'); +const withdraw = require('./withdraw'); +const transfer_receive = require('./transfer_receive'); +const transfer_send = require('./transfer_send'); +const coin_status = require('./coin_status'); + +const sqlite3 = require('sqlite3').verbose(); + +const sqlite_manager = require('./sqlite_manager'); + +const { v4: uuidv4 } = require('uuid'); + +const wallet_manager = require('./wallet'); + +const getDatabase = async (clientConfig) => { + const databaseFile = clientConfig.databaseFile; + const db = new sqlite3.Database(databaseFile); + await sqlite_manager.createTables(db); + return db; +} + +const getElectrumClient = async (clientConfig) => { + + const urlElectrum = clientConfig.electrumServer; + const urlElectrumObject = new URL(urlElectrum); + + const electrumPort = parseInt(urlElectrumObject.port, 10); + const electrumHostname = urlElectrumObject.hostname; + const electrumProtocol = urlElectrumObject.protocol.slice(0, -1); + + const electrumClient = new ElectrumCli(electrumPort, electrumHostname, electrumProtocol); + await electrumClient.connect(); + + return electrumClient; +} + +const createWallet = async (clientConfig, walletName) => { + + const db = await getDatabase(clientConfig); + + const electrumClient = await getElectrumClient(clientConfig); + + let wallet = await wallet_manager.createWallet(walletName, clientConfig, electrumClient); + + await sqlite_manager.insertWallet(db, wallet); + + electrumClient.close(); + db.close(); + + return wallet; +} + +const newToken = async (clientConfig, walletName) => { + const db = await getDatabase(clientConfig); + const token = await deposit.getToken(clientConfig, db, walletName); + db.close(); + return token; +} + +const getDepositBitcoinAddress = async (clientConfig, walletName, amount) => { + const db = await getDatabase(clientConfig); + const address_info = await deposit.getDepositBitcoinAddress(clientConfig, db, walletName, amount); + db.close(); + return address_info; +} + +const getWalletTokens = async (clientConfig, walletName) => { + const db = await getDatabase(clientConfig); + let wallet = await sqlite_manager.getWallet(db, walletName); + db.close(); + return wallet.tokens; +} + +const broadcastBackupTransaction = async (clientConfig, walletName, statechainId, toAddress, options) => { + + const db = await getDatabase(clientConfig); + + const electrumClient = await getElectrumClient(clientConfig); + + await coin_status.updateCoins(clientConfig, electrumClient, db, walletName); + + let txIds = await broadcast_backup_tx.execute(clientConfig, electrumClient, db, walletName, statechainId, toAddress, options.fee_rate); + + electrumClient.close(); + db.close(); + + return txIds; +} + +const listStatecoins = async (clientConfig, walletName) => { + + const db = await getDatabase(clientConfig); + + const electrumClient = await getElectrumClient(clientConfig); + + await coin_status.updateCoins(clientConfig, electrumClient, db, walletName); + + let wallet = await sqlite_manager.getWallet(db, walletName); + + let coins = wallet.coins.map(coin => ({ + statechain_id: coin.statechain_id, + amount: coin.amount, + status: coin.status, + adress: coin.address, + locktime: coin.locktime + })); + + electrumClient.close(); + db.close(); + + return coins; +} + +const withdrawCoin = async (clientConfig, walletName, statechainId, toAddress, options) => { + + const db = await getDatabase(clientConfig); + + const electrumClient = await getElectrumClient(clientConfig); + + await coin_status.updateCoins(clientConfig, electrumClient, db, walletName); + + const txId = await withdraw.execute(clientConfig, electrumClient, db, walletName, statechainId, toAddress, options.fee_rate); + + electrumClient.close(); + db.close(); + + return txId; +} + +const newTransferAddress = async (clientConfig, walletName, options) => { + + const db = await getDatabase(clientConfig); + + const addr = await transfer_receive.newTransferAddress(db, walletName) + let res = {transfer_receive: addr}; + + if (options.generateBatchId) { + const batchId = uuidv4(); + res.batch_id = batchId; + } + + db.close(); + + return res; +} + +const transferSend = async (clientConfig, walletName, statechainId, toAddress, options) => { + + const db = await getDatabase(clientConfig); + + const electrumClient = await getElectrumClient(clientConfig); + + let batchId = options.batchId || null; + + await coin_status.updateCoins(clientConfig, electrumClient, db, walletName); + + let coin = await transfer_send.execute(clientConfig, electrumClient, db, walletName, statechainId, toAddress, batchId); + + electrumClient.close(); + db.close(); + + return coin; +} + +const transferReceive = async (clientConfig, walletName) => { + + const db = await getDatabase(clientConfig); + + const electrumClient = await getElectrumClient(clientConfig); + + await coin_status.updateCoins(clientConfig, electrumClient, db, walletName); + + let received_statechain_ids = await transfer_receive.execute(clientConfig, electrumClient, db, walletName); + + electrumClient.close(); + db.close(); + + return received_statechain_ids; +} + +module.exports = { + createWallet, + newToken, + getDepositBitcoinAddress, + getWalletTokens, + broadcastBackupTransaction, + listStatecoins, + withdrawCoin, + newTransferAddress, + transferSend, + transferReceive +}; \ No newline at end of file diff --git a/clients/libs/nodejs/package-lock.json b/clients/libs/nodejs/package-lock.json new file mode 100644 index 00000000..dd6a915a --- /dev/null +++ b/clients/libs/nodejs/package-lock.json @@ -0,0 +1,1647 @@ +{ + "name": "mercurynodejslib", + "version": "0.0.1", + "lockfileVersion": 3, + "requires": true, + "packages": { + "": { + "name": "mercurynodejslib", + "version": "0.0.1", + "license": "ISC", + "dependencies": { + "@mempool/electrum-client": "^1.1.9", + "axios": "^1.5.1", + "bitcoinjs-lib": "^6.1.5", + "commander": "^11.1.0", + "config": "^3.3.9", + "mercury-wasm": "file:../../../wasm/node_pkg/debug", + "socks-proxy-agent": "^8.0.2", + "sqlite3": "^5.1.6", + "tiny-secp256k1": "^2.2.3", + "uuid": "^9.0.1" + } + }, + "../../../wasm/node_pkg/debug": { + "name": "mercury-wasm", + "version": "0.1.0" + }, + "../../wasm/node_pkg/debug": { + "extraneous": true + }, + "node_modules/@gar/promisify": { + "version": "1.1.3", + "resolved": "https://registry.npmjs.org/@gar/promisify/-/promisify-1.1.3.tgz", + "integrity": "sha512-k2Ty1JcVojjJFwrg/ThKi2ujJ7XNLYaFGNB/bWT9wGR+oSMJHMa5w+CUq6p/pVrKeNNgA7pCqEcjSnHVoqJQFw==", + "optional": true + }, + "node_modules/@mempool/electrum-client": { + "version": "1.1.9", + "resolved": "https://registry.npmjs.org/@mempool/electrum-client/-/electrum-client-1.1.9.tgz", + "integrity": "sha512-mlvPiCzUlaETpYW3i6V87A24jjMYgsebaXtUo3WQyyLnYUuxs0KiXQ2mnKh3h15j8Xg/hfxeGIi+5OC9u0nftQ==", + "engines": { + "node": ">=6" + } + }, + "node_modules/@noble/hashes": { + "version": "1.4.0", + "resolved": "https://registry.npmjs.org/@noble/hashes/-/hashes-1.4.0.tgz", + "integrity": "sha512-V1JJ1WTRUqHHrOSh597hURcMqVKVGL/ea3kv0gSnEdsEZ0/+VyPghM1lMNGc00z7CIQorSvbKpuJkxvuHbvdbg==", + "engines": { + "node": ">= 16" + }, + "funding": { + "url": "https://paulmillr.com/funding/" + } + }, + "node_modules/@npmcli/fs": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/@npmcli/fs/-/fs-1.1.1.tgz", + "integrity": "sha512-8KG5RD0GVP4ydEzRn/I4BNDuxDtqVbOdm8675T49OIG/NGhaK0pjPX7ZcDlvKYbA+ulvVK3ztfcF4uBdOxuJbQ==", + "optional": true, + "dependencies": { + "@gar/promisify": "^1.0.1", + "semver": "^7.3.5" + } + }, + "node_modules/@npmcli/move-file": { + "version": "1.1.2", + "resolved": "https://registry.npmjs.org/@npmcli/move-file/-/move-file-1.1.2.tgz", + "integrity": "sha512-1SUf/Cg2GzGDyaf15aR9St9TWlb+XvbZXWpDx8YKs7MLzMH/BCeopv+y9vzrzgkfykCGuWOlSu3mZhj2+FQcrg==", + "deprecated": "This functionality has been moved to @npmcli/fs", + "optional": true, + "dependencies": { + "mkdirp": "^1.0.4", + "rimraf": "^3.0.2" + }, + "engines": { + "node": ">=10" + } + }, + "node_modules/@tootallnate/once": { + "version": "1.1.2", + "resolved": "https://registry.npmjs.org/@tootallnate/once/-/once-1.1.2.tgz", + "integrity": "sha512-RbzJvlNzmRq5c3O09UipeuXno4tA1FE6ikOjxZK0tuxVv3412l64l5t1W5pj4+rJq9vpkm/kwiR07aZXnsKPxw==", + "optional": true, + "engines": { + "node": ">= 6" + } + }, + "node_modules/abbrev": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/abbrev/-/abbrev-1.1.1.tgz", + "integrity": "sha512-nne9/IiQ/hzIhY6pdDnbBtz7DjPTKrY00P/zvPSm5pOFkl6xuGrGnXn/VtTNNfNtAfZ9/1RtehkszU9qcTii0Q==", + "optional": true + }, + "node_modules/agent-base": { + "version": "7.1.1", + "resolved": "https://registry.npmjs.org/agent-base/-/agent-base-7.1.1.tgz", + "integrity": "sha512-H0TSyFNDMomMNJQBn8wFV5YC/2eJ+VXECwOadZJT554xP6cODZHPX3H9QMQECxvrgiSOP1pHjy1sMWQVYJOUOA==", + "dependencies": { + "debug": "^4.3.4" + }, + "engines": { + "node": ">= 14" + } + }, + "node_modules/agentkeepalive": { + "version": "4.5.0", + "resolved": "https://registry.npmjs.org/agentkeepalive/-/agentkeepalive-4.5.0.tgz", + "integrity": "sha512-5GG/5IbQQpC9FpkRGsSvZI5QYeSCzlJHdpBQntCsuTOxhKD8lqKhrleg2Yi7yvMIf82Ycmmqln9U8V9qwEiJew==", + "optional": true, + "dependencies": { + "humanize-ms": "^1.2.1" + }, + "engines": { + "node": ">= 8.0.0" + } + }, + "node_modules/aggregate-error": { + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/aggregate-error/-/aggregate-error-3.1.0.tgz", + "integrity": "sha512-4I7Td01quW/RpocfNayFdFVk1qSuoh0E7JrbRJ16nH01HhKFQ88INq9Sd+nd72zqRySlr9BmDA8xlEJ6vJMrYA==", + "optional": true, + "dependencies": { + "clean-stack": "^2.0.0", + "indent-string": "^4.0.0" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/ansi-regex": { + "version": "5.0.1", + "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-5.0.1.tgz", + "integrity": "sha512-quJQXlTSUGL2LH9SUXo8VwsY4soanhgo6LNSm84E1LBcE8s3O0wpdiRzyR9z/ZZJMlMWv37qOOb9pdJlMUEKFQ==", + "optional": true, + "engines": { + "node": ">=8" + } + }, + "node_modules/aproba": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/aproba/-/aproba-2.0.0.tgz", + "integrity": "sha512-lYe4Gx7QT+MKGbDsA+Z+he/Wtef0BiwDOlK/XkBrdfsh9J/jPPXbX0tE9x9cl27Tmu5gg3QUbUrQYa/y+KOHPQ==", + "optional": true + }, + "node_modules/are-we-there-yet": { + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/are-we-there-yet/-/are-we-there-yet-3.0.1.tgz", + "integrity": "sha512-QZW4EDmGwlYur0Yyf/b2uGucHQMa8aFUP7eu9ddR73vvhFyt4V0Vl3QHPcTNJ8l6qYOBdxgXdnBXQrHilfRQBg==", + "deprecated": "This package is no longer supported.", + "optional": true, + "dependencies": { + "delegates": "^1.0.0", + "readable-stream": "^3.6.0" + }, + "engines": { + "node": "^12.13.0 || ^14.15.0 || >=16.0.0" + } + }, + "node_modules/asynckit": { + "version": "0.4.0", + "resolved": "https://registry.npmjs.org/asynckit/-/asynckit-0.4.0.tgz", + "integrity": "sha512-Oei9OH4tRh0YqU3GxhX79dM/mwVgvbZJaSNaRk+bshkj0S5cfHcgYakreBjrHwatXKbz+IoIdYLxrKim2MjW0Q==" + }, + "node_modules/axios": { + "version": "1.7.2", + "resolved": "https://registry.npmjs.org/axios/-/axios-1.7.2.tgz", + "integrity": "sha512-2A8QhOMrbomlDuiLeK9XibIBzuHeRcqqNOHp0Cyp5EoJ1IFDh+XZH3A6BkXtv0K4gFGCI0Y4BM7B1wOEi0Rmgw==", + "dependencies": { + "follow-redirects": "^1.15.6", + "form-data": "^4.0.0", + "proxy-from-env": "^1.1.0" + } + }, + "node_modules/balanced-match": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/balanced-match/-/balanced-match-1.0.2.tgz", + "integrity": "sha512-3oSeUO0TMV67hN1AmbXsK4yaqU7tjiHlbxRDZOpH0KW9+CeX4bRAaX0Anxt0tx2MrpRpWwQaPwIlISEJhYU5Pw==", + "optional": true + }, + "node_modules/base-x": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/base-x/-/base-x-4.0.0.tgz", + "integrity": "sha512-FuwxlW4H5kh37X/oW59pwTzzTKRzfrrQwhmyspRM7swOEZcHtDZSCt45U6oKgtuFE+WYPblePMVIPR4RZrh/hw==" + }, + "node_modules/base64-js": { + "version": "1.5.1", + "resolved": "https://registry.npmjs.org/base64-js/-/base64-js-1.5.1.tgz", + "integrity": "sha512-AKpaYlHn8t4SVbOHCy+b5+KKgvR4vrsD8vbvrbiQJps7fKDTkjkDry6ji0rUJjC0kzbNePLwzxq8iypo41qeWA==", + "funding": [ + { + "type": "github", + "url": "https://github.com/sponsors/feross" + }, + { + "type": "patreon", + "url": "https://www.patreon.com/feross" + }, + { + "type": "consulting", + "url": "https://feross.org/support" + } + ] + }, + "node_modules/bech32": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/bech32/-/bech32-2.0.0.tgz", + "integrity": "sha512-LcknSilhIGatDAsY1ak2I8VtGaHNhgMSYVxFrGLXv+xLHytaKZKcaUJJUE7qmBr7h33o5YQwP55pMI0xmkpJwg==" + }, + "node_modules/bindings": { + "version": "1.5.0", + "resolved": "https://registry.npmjs.org/bindings/-/bindings-1.5.0.tgz", + "integrity": "sha512-p2q/t/mhvuOj/UeLlV6566GD/guowlr0hHxClI0W9m7MWYkL1F0hLo+0Aexs9HSPCtR1SXQ0TD3MMKrXZajbiQ==", + "dependencies": { + "file-uri-to-path": "1.0.0" + } + }, + "node_modules/bip174": { + "version": "2.1.1", + "resolved": "https://registry.npmjs.org/bip174/-/bip174-2.1.1.tgz", + "integrity": "sha512-mdFV5+/v0XyNYXjBS6CQPLo9ekCx4gtKZFnJm5PMto7Fs9hTTDpkkzOB7/FtluRI6JbUUAu+snTYfJRgHLZbZQ==", + "engines": { + "node": ">=8.0.0" + } + }, + "node_modules/bitcoinjs-lib": { + "version": "6.1.5", + "resolved": "https://registry.npmjs.org/bitcoinjs-lib/-/bitcoinjs-lib-6.1.5.tgz", + "integrity": "sha512-yuf6xs9QX/E8LWE2aMJPNd0IxGofwfuVOiYdNUESkc+2bHHVKjhJd8qewqapeoolh9fihzHGoDCB5Vkr57RZCQ==", + "dependencies": { + "@noble/hashes": "^1.2.0", + "bech32": "^2.0.0", + "bip174": "^2.1.1", + "bs58check": "^3.0.1", + "typeforce": "^1.11.3", + "varuint-bitcoin": "^1.1.2" + }, + "engines": { + "node": ">=8.0.0" + } + }, + "node_modules/bl": { + "version": "4.1.0", + "resolved": "https://registry.npmjs.org/bl/-/bl-4.1.0.tgz", + "integrity": "sha512-1W07cM9gS6DcLperZfFSj+bWLtaPGSOHWhPiGzXmvVJbRLdG82sH/Kn8EtW1VqWVA54AKf2h5k5BbnIbwF3h6w==", + "dependencies": { + "buffer": "^5.5.0", + "inherits": "^2.0.4", + "readable-stream": "^3.4.0" + } + }, + "node_modules/brace-expansion": { + "version": "1.1.11", + "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-1.1.11.tgz", + "integrity": "sha512-iCuPHDFgrHX7H2vEI/5xpz07zSHB00TpugqhmYtVmMO6518mCuRMoOYFldEBl0g187ufozdaHgWKcYFb61qGiA==", + "optional": true, + "dependencies": { + "balanced-match": "^1.0.0", + "concat-map": "0.0.1" + } + }, + "node_modules/bs58": { + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/bs58/-/bs58-5.0.0.tgz", + "integrity": "sha512-r+ihvQJvahgYT50JD05dyJNKlmmSlMoOGwn1lCcEzanPglg7TxYjioQUYehQ9mAR/+hOSd2jRc/Z2y5UxBymvQ==", + "dependencies": { + "base-x": "^4.0.0" + } + }, + "node_modules/bs58check": { + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/bs58check/-/bs58check-3.0.1.tgz", + "integrity": "sha512-hjuuJvoWEybo7Hn/0xOrczQKKEKD63WguEjlhLExYs2wUBcebDC1jDNK17eEAD2lYfw82d5ASC1d7K3SWszjaQ==", + "dependencies": { + "@noble/hashes": "^1.2.0", + "bs58": "^5.0.0" + } + }, + "node_modules/buffer": { + "version": "5.7.1", + "resolved": "https://registry.npmjs.org/buffer/-/buffer-5.7.1.tgz", + "integrity": "sha512-EHcyIPBQ4BSGlvjB16k5KgAJ27CIsHY/2JBmCRReo48y9rQ3MaUzWX3KVlBa4U7MyX02HdVj0K7C3WaB3ju7FQ==", + "funding": [ + { + "type": "github", + "url": "https://github.com/sponsors/feross" + }, + { + "type": "patreon", + "url": "https://www.patreon.com/feross" + }, + { + "type": "consulting", + "url": "https://feross.org/support" + } + ], + "dependencies": { + "base64-js": "^1.3.1", + "ieee754": "^1.1.13" + } + }, + "node_modules/cacache": { + "version": "15.3.0", + "resolved": "https://registry.npmjs.org/cacache/-/cacache-15.3.0.tgz", + "integrity": "sha512-VVdYzXEn+cnbXpFgWs5hTT7OScegHVmLhJIR8Ufqk3iFD6A6j5iSX1KuBTfNEv4tdJWE2PzA6IVFtcLC7fN9wQ==", + "optional": true, + "dependencies": { + "@npmcli/fs": "^1.0.0", + "@npmcli/move-file": "^1.0.1", + "chownr": "^2.0.0", + "fs-minipass": "^2.0.0", + "glob": "^7.1.4", + "infer-owner": "^1.0.4", + "lru-cache": "^6.0.0", + "minipass": "^3.1.1", + "minipass-collect": "^1.0.2", + "minipass-flush": "^1.0.5", + "minipass-pipeline": "^1.2.2", + "mkdirp": "^1.0.3", + "p-map": "^4.0.0", + "promise-inflight": "^1.0.1", + "rimraf": "^3.0.2", + "ssri": "^8.0.1", + "tar": "^6.0.2", + "unique-filename": "^1.1.1" + }, + "engines": { + "node": ">= 10" + } + }, + "node_modules/chownr": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/chownr/-/chownr-2.0.0.tgz", + "integrity": "sha512-bIomtDF5KGpdogkLd9VspvFzk9KfpyyGlS8YFVZl7TGPBHL5snIOnxeshwVgPteQ9b4Eydl+pVbIyE1DcvCWgQ==", + "engines": { + "node": ">=10" + } + }, + "node_modules/clean-stack": { + "version": "2.2.0", + "resolved": "https://registry.npmjs.org/clean-stack/-/clean-stack-2.2.0.tgz", + "integrity": "sha512-4diC9HaTE+KRAMWhDhrGOECgWZxoevMc5TlkObMqNSsVU62PYzXZ/SMTjzyGAFF1YusgxGcSWTEXBhp0CPwQ1A==", + "optional": true, + "engines": { + "node": ">=6" + } + }, + "node_modules/color-support": { + "version": "1.1.3", + "resolved": "https://registry.npmjs.org/color-support/-/color-support-1.1.3.tgz", + "integrity": "sha512-qiBjkpbMLO/HL68y+lh4q0/O1MZFj2RX6X/KmMa3+gJD3z+WwI1ZzDHysvqHGS3mP6mznPckpXmw1nI9cJjyRg==", + "optional": true, + "bin": { + "color-support": "bin.js" + } + }, + "node_modules/combined-stream": { + "version": "1.0.8", + "resolved": "https://registry.npmjs.org/combined-stream/-/combined-stream-1.0.8.tgz", + "integrity": "sha512-FQN4MRfuJeHf7cBbBMJFXhKSDq+2kAArBlmRBvcvFE5BB1HZKXtSFASDhdlz9zOYwxh8lDdnvmMOe/+5cdoEdg==", + "dependencies": { + "delayed-stream": "~1.0.0" + }, + "engines": { + "node": ">= 0.8" + } + }, + "node_modules/commander": { + "version": "11.1.0", + "resolved": "https://registry.npmjs.org/commander/-/commander-11.1.0.tgz", + "integrity": "sha512-yPVavfyCcRhmorC7rWlkHn15b4wDVgVmBA7kV4QVBsF7kv/9TKJAbAXVTxvTnwP8HHKjRCJDClKbciiYS7p0DQ==", + "engines": { + "node": ">=16" + } + }, + "node_modules/concat-map": { + "version": "0.0.1", + "resolved": "https://registry.npmjs.org/concat-map/-/concat-map-0.0.1.tgz", + "integrity": "sha512-/Srv4dswyQNBfohGpz9o6Yb3Gz3SrUDqBH5rTuhGR7ahtlbYKnVxw2bCFMRljaA7EXHaXZ8wsHdodFvbkhKmqg==", + "optional": true + }, + "node_modules/config": { + "version": "3.3.11", + "resolved": "https://registry.npmjs.org/config/-/config-3.3.11.tgz", + "integrity": "sha512-Dhn63ZoWCW5EMg4P0Sl/XNsj/7RLiUIA1x1npCy+m2cRwRHzLnt3UtYtxRDMZW/6oOMdWhCzaGYkOcajGgrAOA==", + "dependencies": { + "json5": "^2.2.3" + }, + "engines": { + "node": ">= 10.0.0" + } + }, + "node_modules/console-control-strings": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/console-control-strings/-/console-control-strings-1.1.0.tgz", + "integrity": "sha512-ty/fTekppD2fIwRvnZAVdeOiGd1c7YXEixbgJTNzqcxJWKQnjJ/V1bNEEE6hygpM3WjwHFUVK6HTjWSzV4a8sQ==", + "optional": true + }, + "node_modules/debug": { + "version": "4.3.4", + "resolved": "https://registry.npmjs.org/debug/-/debug-4.3.4.tgz", + "integrity": "sha512-PRWFHuSU3eDtQJPvnNY7Jcket1j0t5OuOsFzPPzsekD52Zl8qUfFIPEiswXqIvHWGVHOgX+7G/vCNNhehwxfkQ==", + "dependencies": { + "ms": "2.1.2" + }, + "engines": { + "node": ">=6.0" + }, + "peerDependenciesMeta": { + "supports-color": { + "optional": true + } + } + }, + "node_modules/decompress-response": { + "version": "6.0.0", + "resolved": "https://registry.npmjs.org/decompress-response/-/decompress-response-6.0.0.tgz", + "integrity": "sha512-aW35yZM6Bb/4oJlZncMH2LCoZtJXTRxES17vE3hoRiowU2kWHaJKFkSBDnDR+cm9J+9QhXmREyIfv0pji9ejCQ==", + "dependencies": { + "mimic-response": "^3.1.0" + }, + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/deep-extend": { + "version": "0.6.0", + "resolved": "https://registry.npmjs.org/deep-extend/-/deep-extend-0.6.0.tgz", + "integrity": "sha512-LOHxIOaPYdHlJRtCQfDIVZtfw/ufM8+rVj649RIHzcm/vGwQRXFt6OPqIFWsm2XEMrNIEtWR64sY1LEKD2vAOA==", + "engines": { + "node": ">=4.0.0" + } + }, + "node_modules/delayed-stream": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/delayed-stream/-/delayed-stream-1.0.0.tgz", + "integrity": "sha512-ZySD7Nf91aLB0RxL4KGrKHBXl7Eds1DAmEdcoVawXnLD7SDhpNgtuII2aAkg7a7QS41jxPSZ17p4VdGnMHk3MQ==", + "engines": { + "node": ">=0.4.0" + } + }, + "node_modules/delegates": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/delegates/-/delegates-1.0.0.tgz", + "integrity": "sha512-bd2L678uiWATM6m5Z1VzNCErI3jiGzt6HGY8OVICs40JQq/HALfbyNJmp0UDakEY4pMMaN0Ly5om/B1VI/+xfQ==", + "optional": true + }, + "node_modules/detect-libc": { + "version": "2.0.3", + "resolved": "https://registry.npmjs.org/detect-libc/-/detect-libc-2.0.3.tgz", + "integrity": "sha512-bwy0MGW55bG41VqxxypOsdSdGqLwXPI/focwgTYCFMbdUiBAxLg9CFzG08sz2aqzknwiX7Hkl0bQENjg8iLByw==", + "engines": { + "node": ">=8" + } + }, + "node_modules/emoji-regex": { + "version": "8.0.0", + "resolved": "https://registry.npmjs.org/emoji-regex/-/emoji-regex-8.0.0.tgz", + "integrity": "sha512-MSjYzcWNOA0ewAHpz0MxpYFvwg6yjy1NG3xteoqz644VCo/RPgnr1/GGt+ic3iJTzQ8Eu3TdM14SawnVUmGE6A==", + "optional": true + }, + "node_modules/encoding": { + "version": "0.1.13", + "resolved": "https://registry.npmjs.org/encoding/-/encoding-0.1.13.tgz", + "integrity": "sha512-ETBauow1T35Y/WZMkio9jiM0Z5xjHHmJ4XmjZOq1l/dXz3lr2sRn87nJy20RupqSh1F2m3HHPSp8ShIPQJrJ3A==", + "optional": true, + "dependencies": { + "iconv-lite": "^0.6.2" + } + }, + "node_modules/end-of-stream": { + "version": "1.4.4", + "resolved": "https://registry.npmjs.org/end-of-stream/-/end-of-stream-1.4.4.tgz", + "integrity": "sha512-+uw1inIHVPQoaVuHzRyXd21icM+cnt4CzD5rW+NC1wjOUSTOs+Te7FOv7AhN7vS9x/oIyhLP5PR1H+phQAHu5Q==", + "dependencies": { + "once": "^1.4.0" + } + }, + "node_modules/env-paths": { + "version": "2.2.1", + "resolved": "https://registry.npmjs.org/env-paths/-/env-paths-2.2.1.tgz", + "integrity": "sha512-+h1lkLKhZMTYjog1VEpJNG7NZJWcuc2DDk/qsqSTRRCOXiLjeQ1d1/udrUGhqMxUgAlwKNZ0cf2uqan5GLuS2A==", + "optional": true, + "engines": { + "node": ">=6" + } + }, + "node_modules/err-code": { + "version": "2.0.3", + "resolved": "https://registry.npmjs.org/err-code/-/err-code-2.0.3.tgz", + "integrity": "sha512-2bmlRpNKBxT/CRmPOlyISQpNj+qSeYvcym/uT0Jx2bMOlKLtSy1ZmLuVxSEKKyor/N5yhvp/ZiG1oE3DEYMSFA==", + "optional": true + }, + "node_modules/expand-template": { + "version": "2.0.3", + "resolved": "https://registry.npmjs.org/expand-template/-/expand-template-2.0.3.tgz", + "integrity": "sha512-XYfuKMvj4O35f/pOXLObndIRvyQ+/+6AhODh+OKWj9S9498pHHn/IMszH+gt0fBCRWMNfk1ZSp5x3AifmnI2vg==", + "engines": { + "node": ">=6" + } + }, + "node_modules/file-uri-to-path": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/file-uri-to-path/-/file-uri-to-path-1.0.0.tgz", + "integrity": "sha512-0Zt+s3L7Vf1biwWZ29aARiVYLx7iMGnEUl9x33fbB/j3jR81u/O2LbqK+Bm1CDSNDKVtJ/YjwY7TUd5SkeLQLw==" + }, + "node_modules/follow-redirects": { + "version": "1.15.6", + "resolved": "https://registry.npmjs.org/follow-redirects/-/follow-redirects-1.15.6.tgz", + "integrity": "sha512-wWN62YITEaOpSK584EZXJafH1AGpO8RVgElfkuXbTOrPX4fIfOyEpW/CsiNd8JdYrAoOvafRTOEnvsO++qCqFA==", + "funding": [ + { + "type": "individual", + "url": "https://github.com/sponsors/RubenVerborgh" + } + ], + "engines": { + "node": ">=4.0" + }, + "peerDependenciesMeta": { + "debug": { + "optional": true + } + } + }, + "node_modules/form-data": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/form-data/-/form-data-4.0.0.tgz", + "integrity": "sha512-ETEklSGi5t0QMZuiXoA/Q6vcnxcLQP5vdugSpuAyi6SVGi2clPPp+xgEhuMaHC+zGgn31Kd235W35f7Hykkaww==", + "dependencies": { + "asynckit": "^0.4.0", + "combined-stream": "^1.0.8", + "mime-types": "^2.1.12" + }, + "engines": { + "node": ">= 6" + } + }, + "node_modules/fs-constants": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/fs-constants/-/fs-constants-1.0.0.tgz", + "integrity": "sha512-y6OAwoSIf7FyjMIv94u+b5rdheZEjzR63GTyZJm5qh4Bi+2YgwLCcI/fPFZkL5PSixOt6ZNKm+w+Hfp/Bciwow==" + }, + "node_modules/fs-minipass": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/fs-minipass/-/fs-minipass-2.1.0.tgz", + "integrity": "sha512-V/JgOLFCS+R6Vcq0slCuaeWEdNC3ouDlJMNIsacH2VtALiu9mV4LPrHc5cDl8k5aw6J8jwgWWpiTo5RYhmIzvg==", + "dependencies": { + "minipass": "^3.0.0" + }, + "engines": { + "node": ">= 8" + } + }, + "node_modules/fs.realpath": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/fs.realpath/-/fs.realpath-1.0.0.tgz", + "integrity": "sha512-OO0pH2lK6a0hZnAdau5ItzHPI6pUlvI7jMVnxUQRtw4owF2wk8lOSabtGDCTP4Ggrg2MbGnWO9X8K1t4+fGMDw==", + "optional": true + }, + "node_modules/gauge": { + "version": "4.0.4", + "resolved": "https://registry.npmjs.org/gauge/-/gauge-4.0.4.tgz", + "integrity": "sha512-f9m+BEN5jkg6a0fZjleidjN51VE1X+mPFQ2DJ0uv1V39oCLCbsGe6yjbBnp7eK7z/+GAon99a3nHuqbuuthyPg==", + "deprecated": "This package is no longer supported.", + "optional": true, + "dependencies": { + "aproba": "^1.0.3 || ^2.0.0", + "color-support": "^1.1.3", + "console-control-strings": "^1.1.0", + "has-unicode": "^2.0.1", + "signal-exit": "^3.0.7", + "string-width": "^4.2.3", + "strip-ansi": "^6.0.1", + "wide-align": "^1.1.5" + }, + "engines": { + "node": "^12.13.0 || ^14.15.0 || >=16.0.0" + } + }, + "node_modules/github-from-package": { + "version": "0.0.0", + "resolved": "https://registry.npmjs.org/github-from-package/-/github-from-package-0.0.0.tgz", + "integrity": "sha512-SyHy3T1v2NUXn29OsWdxmK6RwHD+vkj3v8en8AOBZ1wBQ/hCAQ5bAQTD02kW4W9tUp/3Qh6J8r9EvntiyCmOOw==" + }, + "node_modules/glob": { + "version": "7.2.3", + "resolved": "https://registry.npmjs.org/glob/-/glob-7.2.3.tgz", + "integrity": "sha512-nFR0zLpU2YCaRxwoCJvL6UvCH2JFyFVIvwTLsIf21AuHlMskA1hhTdk+LlYJtOlYt9v6dvszD2BGRqBL+iQK9Q==", + "deprecated": "Glob versions prior to v9 are no longer supported", + "optional": true, + "dependencies": { + "fs.realpath": "^1.0.0", + "inflight": "^1.0.4", + "inherits": "2", + "minimatch": "^3.1.1", + "once": "^1.3.0", + "path-is-absolute": "^1.0.0" + }, + "engines": { + "node": "*" + }, + "funding": { + "url": "https://github.com/sponsors/isaacs" + } + }, + "node_modules/graceful-fs": { + "version": "4.2.11", + "resolved": "https://registry.npmjs.org/graceful-fs/-/graceful-fs-4.2.11.tgz", + "integrity": "sha512-RbJ5/jmFcNNCcDV5o9eTnBLJ/HszWV0P73bc+Ff4nS/rJj+YaS6IGyiOL0VoBYX+l1Wrl3k63h/KrH+nhJ0XvQ==", + "optional": true + }, + "node_modules/has-unicode": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/has-unicode/-/has-unicode-2.0.1.tgz", + "integrity": "sha512-8Rf9Y83NBReMnx0gFzA8JImQACstCYWUplepDa9xprwwtmgEZUF0h/i5xSA625zB/I37EtrswSST6OXxwaaIJQ==", + "optional": true + }, + "node_modules/http-cache-semantics": { + "version": "4.1.1", + "resolved": "https://registry.npmjs.org/http-cache-semantics/-/http-cache-semantics-4.1.1.tgz", + "integrity": "sha512-er295DKPVsV82j5kw1Gjt+ADA/XYHsajl82cGNQG2eyoPkvgUhX+nDIyelzhIWbbsXP39EHcI6l5tYs2FYqYXQ==", + "optional": true + }, + "node_modules/http-proxy-agent": { + "version": "4.0.1", + "resolved": "https://registry.npmjs.org/http-proxy-agent/-/http-proxy-agent-4.0.1.tgz", + "integrity": "sha512-k0zdNgqWTGA6aeIRVpvfVob4fL52dTfaehylg0Y4UvSySvOq/Y+BOyPrgpUrA7HylqvU8vIZGsRuXmspskV0Tg==", + "optional": true, + "dependencies": { + "@tootallnate/once": "1", + "agent-base": "6", + "debug": "4" + }, + "engines": { + "node": ">= 6" + } + }, + "node_modules/http-proxy-agent/node_modules/agent-base": { + "version": "6.0.2", + "resolved": "https://registry.npmjs.org/agent-base/-/agent-base-6.0.2.tgz", + "integrity": "sha512-RZNwNclF7+MS/8bDg70amg32dyeZGZxiDuQmZxKLAlQjr3jGyLx+4Kkk58UO7D2QdgFIQCovuSuZESne6RG6XQ==", + "optional": true, + "dependencies": { + "debug": "4" + }, + "engines": { + "node": ">= 6.0.0" + } + }, + "node_modules/https-proxy-agent": { + "version": "5.0.1", + "resolved": "https://registry.npmjs.org/https-proxy-agent/-/https-proxy-agent-5.0.1.tgz", + "integrity": "sha512-dFcAjpTQFgoLMzC2VwU+C/CbS7uRL0lWmxDITmqm7C+7F0Odmj6s9l6alZc6AELXhrnggM2CeWSXHGOdX2YtwA==", + "optional": true, + "dependencies": { + "agent-base": "6", + "debug": "4" + }, + "engines": { + "node": ">= 6" + } + }, + "node_modules/https-proxy-agent/node_modules/agent-base": { + "version": "6.0.2", + "resolved": "https://registry.npmjs.org/agent-base/-/agent-base-6.0.2.tgz", + "integrity": "sha512-RZNwNclF7+MS/8bDg70amg32dyeZGZxiDuQmZxKLAlQjr3jGyLx+4Kkk58UO7D2QdgFIQCovuSuZESne6RG6XQ==", + "optional": true, + "dependencies": { + "debug": "4" + }, + "engines": { + "node": ">= 6.0.0" + } + }, + "node_modules/humanize-ms": { + "version": "1.2.1", + "resolved": "https://registry.npmjs.org/humanize-ms/-/humanize-ms-1.2.1.tgz", + "integrity": "sha512-Fl70vYtsAFb/C06PTS9dZBo7ihau+Tu/DNCk/OyHhea07S+aeMWpFFkUaXRa8fI+ScZbEI8dfSxwY7gxZ9SAVQ==", + "optional": true, + "dependencies": { + "ms": "^2.0.0" + } + }, + "node_modules/iconv-lite": { + "version": "0.6.3", + "resolved": "https://registry.npmjs.org/iconv-lite/-/iconv-lite-0.6.3.tgz", + "integrity": "sha512-4fCk79wshMdzMp2rH06qWrJE4iolqLhCUH+OiuIgU++RB0+94NlDL81atO7GX55uUKueo0txHNtvEyI6D7WdMw==", + "optional": true, + "dependencies": { + "safer-buffer": ">= 2.1.2 < 3.0.0" + }, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/ieee754": { + "version": "1.2.1", + "resolved": "https://registry.npmjs.org/ieee754/-/ieee754-1.2.1.tgz", + "integrity": "sha512-dcyqhDvX1C46lXZcVqCpK+FtMRQVdIMN6/Df5js2zouUsqG7I6sFxitIC+7KYK29KdXOLHdu9zL4sFnoVQnqaA==", + "funding": [ + { + "type": "github", + "url": "https://github.com/sponsors/feross" + }, + { + "type": "patreon", + "url": "https://www.patreon.com/feross" + }, + { + "type": "consulting", + "url": "https://feross.org/support" + } + ] + }, + "node_modules/imurmurhash": { + "version": "0.1.4", + "resolved": "https://registry.npmjs.org/imurmurhash/-/imurmurhash-0.1.4.tgz", + "integrity": "sha512-JmXMZ6wuvDmLiHEml9ykzqO6lwFbof0GG4IkcGaENdCRDDmMVnny7s5HsIgHCbaq0w2MyPhDqkhTUgS2LU2PHA==", + "optional": true, + "engines": { + "node": ">=0.8.19" + } + }, + "node_modules/indent-string": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/indent-string/-/indent-string-4.0.0.tgz", + "integrity": "sha512-EdDDZu4A2OyIK7Lr/2zG+w5jmbuk1DVBnEwREQvBzspBJkCEbRa8GxU1lghYcaGJCnRWibjDXlq779X1/y5xwg==", + "optional": true, + "engines": { + "node": ">=8" + } + }, + "node_modules/infer-owner": { + "version": "1.0.4", + "resolved": "https://registry.npmjs.org/infer-owner/-/infer-owner-1.0.4.tgz", + "integrity": "sha512-IClj+Xz94+d7irH5qRyfJonOdfTzuDaifE6ZPWfx0N0+/ATZCbuTPq2prFl526urkQd90WyUKIh1DfBQ2hMz9A==", + "optional": true + }, + "node_modules/inflight": { + "version": "1.0.6", + "resolved": "https://registry.npmjs.org/inflight/-/inflight-1.0.6.tgz", + "integrity": "sha512-k92I/b08q4wvFscXCLvqfsHCrjrF7yiXsQuIVvVE7N82W3+aqpzuUdBbfhWcy/FZR3/4IgflMgKLOsvPDrGCJA==", + "deprecated": "This module is not supported, and leaks memory. Do not use it. Check out lru-cache if you want a good and tested way to coalesce async requests by a key value, which is much more comprehensive and powerful.", + "optional": true, + "dependencies": { + "once": "^1.3.0", + "wrappy": "1" + } + }, + "node_modules/inherits": { + "version": "2.0.4", + "resolved": "https://registry.npmjs.org/inherits/-/inherits-2.0.4.tgz", + "integrity": "sha512-k/vGaX4/Yla3WzyMCvTQOXYeIHvqOKtnqBduzTHpzpQZzAskKMhZ2K+EnBiSM9zGSoIFeMpXKxa4dYeZIQqewQ==" + }, + "node_modules/ini": { + "version": "1.3.8", + "resolved": "https://registry.npmjs.org/ini/-/ini-1.3.8.tgz", + "integrity": "sha512-JV/yugV2uzW5iMRSiZAyDtQd+nxtUnjeLt0acNdw98kKLrvuRVyB80tsREOE7yvGVgalhZ6RNXCmEHkUKBKxew==" + }, + "node_modules/ip-address": { + "version": "9.0.5", + "resolved": "https://registry.npmjs.org/ip-address/-/ip-address-9.0.5.tgz", + "integrity": "sha512-zHtQzGojZXTwZTHQqra+ETKd4Sn3vgi7uBmlPoXVWZqYvuKmtI0l/VZTjqGmJY9x88GGOaZ9+G9ES8hC4T4X8g==", + "dependencies": { + "jsbn": "1.1.0", + "sprintf-js": "^1.1.3" + }, + "engines": { + "node": ">= 12" + } + }, + "node_modules/is-fullwidth-code-point": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/is-fullwidth-code-point/-/is-fullwidth-code-point-3.0.0.tgz", + "integrity": "sha512-zymm5+u+sCsSWyD9qNaejV3DFvhCKclKdizYaJUuHA83RLjb7nSuGnddCHGv0hk+KY7BMAlsWeK4Ueg6EV6XQg==", + "optional": true, + "engines": { + "node": ">=8" + } + }, + "node_modules/is-lambda": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/is-lambda/-/is-lambda-1.0.1.tgz", + "integrity": "sha512-z7CMFGNrENq5iFB9Bqo64Xk6Y9sg+epq1myIcdHaGnbMTYOxvzsEtdYqQUylB7LxfkvgrrjP32T6Ywciio9UIQ==", + "optional": true + }, + "node_modules/isexe": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/isexe/-/isexe-2.0.0.tgz", + "integrity": "sha512-RHxMLp9lnKHGHRng9QFhRCMbYAcVpn69smSGcq3f36xjgVVWThj4qqLbTLlq7Ssj8B+fIQ1EuCEGI2lKsyQeIw==", + "optional": true + }, + "node_modules/jsbn": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/jsbn/-/jsbn-1.1.0.tgz", + "integrity": "sha512-4bYVV3aAMtDTTu4+xsDYa6sy9GyJ69/amsu9sYF2zqjiEoZA5xJi3BrfX3uY+/IekIu7MwdObdbDWpoZdBv3/A==" + }, + "node_modules/json5": { + "version": "2.2.3", + "resolved": "https://registry.npmjs.org/json5/-/json5-2.2.3.tgz", + "integrity": "sha512-XmOWe7eyHYH14cLdVPoyg+GOH3rYX++KpzrylJwSW98t3Nk+U8XOl8FWKOgwtzdb8lXGf6zYwDUzeHMWfxasyg==", + "bin": { + "json5": "lib/cli.js" + }, + "engines": { + "node": ">=6" + } + }, + "node_modules/lru-cache": { + "version": "6.0.0", + "resolved": "https://registry.npmjs.org/lru-cache/-/lru-cache-6.0.0.tgz", + "integrity": "sha512-Jo6dJ04CmSjuznwJSS3pUeWmd/H0ffTlkXXgwZi+eq1UCmqQwCh+eLsYOYCwY991i2Fah4h1BEMCx4qThGbsiA==", + "optional": true, + "dependencies": { + "yallist": "^4.0.0" + }, + "engines": { + "node": ">=10" + } + }, + "node_modules/make-fetch-happen": { + "version": "9.1.0", + "resolved": "https://registry.npmjs.org/make-fetch-happen/-/make-fetch-happen-9.1.0.tgz", + "integrity": "sha512-+zopwDy7DNknmwPQplem5lAZX/eCOzSvSNNcSKm5eVwTkOBzoktEfXsa9L23J/GIRhxRsaxzkPEhrJEpE2F4Gg==", + "optional": true, + "dependencies": { + "agentkeepalive": "^4.1.3", + "cacache": "^15.2.0", + "http-cache-semantics": "^4.1.0", + "http-proxy-agent": "^4.0.1", + "https-proxy-agent": "^5.0.0", + "is-lambda": "^1.0.1", + "lru-cache": "^6.0.0", + "minipass": "^3.1.3", + "minipass-collect": "^1.0.2", + "minipass-fetch": "^1.3.2", + "minipass-flush": "^1.0.5", + "minipass-pipeline": "^1.2.4", + "negotiator": "^0.6.2", + "promise-retry": "^2.0.1", + "socks-proxy-agent": "^6.0.0", + "ssri": "^8.0.0" + }, + "engines": { + "node": ">= 10" + } + }, + "node_modules/make-fetch-happen/node_modules/agent-base": { + "version": "6.0.2", + "resolved": "https://registry.npmjs.org/agent-base/-/agent-base-6.0.2.tgz", + "integrity": "sha512-RZNwNclF7+MS/8bDg70amg32dyeZGZxiDuQmZxKLAlQjr3jGyLx+4Kkk58UO7D2QdgFIQCovuSuZESne6RG6XQ==", + "optional": true, + "dependencies": { + "debug": "4" + }, + "engines": { + "node": ">= 6.0.0" + } + }, + "node_modules/make-fetch-happen/node_modules/socks-proxy-agent": { + "version": "6.2.1", + "resolved": "https://registry.npmjs.org/socks-proxy-agent/-/socks-proxy-agent-6.2.1.tgz", + "integrity": "sha512-a6KW9G+6B3nWZ1yB8G7pJwL3ggLy1uTzKAgCb7ttblwqdz9fMGJUuTy3uFzEP48FAs9FLILlmzDlE2JJhVQaXQ==", + "optional": true, + "dependencies": { + "agent-base": "^6.0.2", + "debug": "^4.3.3", + "socks": "^2.6.2" + }, + "engines": { + "node": ">= 10" + } + }, + "node_modules/mercury-wasm": { + "resolved": "../../../wasm/node_pkg/debug", + "link": true + }, + "node_modules/mime-db": { + "version": "1.52.0", + "resolved": "https://registry.npmjs.org/mime-db/-/mime-db-1.52.0.tgz", + "integrity": "sha512-sPU4uV7dYlvtWJxwwxHD0PuihVNiE7TyAbQ5SWxDCB9mUYvOgroQOwYQQOKPJ8CIbE+1ETVlOoK1UC2nU3gYvg==", + "engines": { + "node": ">= 0.6" + } + }, + "node_modules/mime-types": { + "version": "2.1.35", + "resolved": "https://registry.npmjs.org/mime-types/-/mime-types-2.1.35.tgz", + "integrity": "sha512-ZDY+bPm5zTTF+YpCrAU9nK0UgICYPT0QtT1NZWFv4s++TNkcgVaT0g6+4R2uI4MjQjzysHB1zxuWL50hzaeXiw==", + "dependencies": { + "mime-db": "1.52.0" + }, + "engines": { + "node": ">= 0.6" + } + }, + "node_modules/mimic-response": { + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/mimic-response/-/mimic-response-3.1.0.tgz", + "integrity": "sha512-z0yWI+4FDrrweS8Zmt4Ej5HdJmky15+L2e6Wgn3+iK5fWzb6T3fhNFq2+MeTRb064c6Wr4N/wv0DzQTjNzHNGQ==", + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/minimatch": { + "version": "3.1.2", + "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-3.1.2.tgz", + "integrity": "sha512-J7p63hRiAjw1NDEww1W7i37+ByIrOWO5XQQAzZ3VOcL0PNybwpfmV/N05zFAzwQ9USyEcX6t3UO+K5aqBQOIHw==", + "optional": true, + "dependencies": { + "brace-expansion": "^1.1.7" + }, + "engines": { + "node": "*" + } + }, + "node_modules/minimist": { + "version": "1.2.8", + "resolved": "https://registry.npmjs.org/minimist/-/minimist-1.2.8.tgz", + "integrity": "sha512-2yyAR8qBkN3YuheJanUpWC5U3bb5osDywNB8RzDVlDwDHbocAJveqqj1u8+SVD7jkWT4yvsHCpWqqWqAxb0zCA==", + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/minipass": { + "version": "3.3.6", + "resolved": "https://registry.npmjs.org/minipass/-/minipass-3.3.6.tgz", + "integrity": "sha512-DxiNidxSEK+tHG6zOIklvNOwm3hvCrbUrdtzY74U6HKTJxvIDfOUL5W5P2Ghd3DTkhhKPYGqeNUIh5qcM4YBfw==", + "dependencies": { + "yallist": "^4.0.0" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/minipass-collect": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/minipass-collect/-/minipass-collect-1.0.2.tgz", + "integrity": "sha512-6T6lH0H8OG9kITm/Jm6tdooIbogG9e0tLgpY6mphXSm/A9u8Nq1ryBG+Qspiub9LjWlBPsPS3tWQ/Botq4FdxA==", + "optional": true, + "dependencies": { + "minipass": "^3.0.0" + }, + "engines": { + "node": ">= 8" + } + }, + "node_modules/minipass-fetch": { + "version": "1.4.1", + "resolved": "https://registry.npmjs.org/minipass-fetch/-/minipass-fetch-1.4.1.tgz", + "integrity": "sha512-CGH1eblLq26Y15+Azk7ey4xh0J/XfJfrCox5LDJiKqI2Q2iwOLOKrlmIaODiSQS8d18jalF6y2K2ePUm0CmShw==", + "optional": true, + "dependencies": { + "minipass": "^3.1.0", + "minipass-sized": "^1.0.3", + "minizlib": "^2.0.0" + }, + "engines": { + "node": ">=8" + }, + "optionalDependencies": { + "encoding": "^0.1.12" + } + }, + "node_modules/minipass-flush": { + "version": "1.0.5", + "resolved": "https://registry.npmjs.org/minipass-flush/-/minipass-flush-1.0.5.tgz", + "integrity": "sha512-JmQSYYpPUqX5Jyn1mXaRwOda1uQ8HP5KAT/oDSLCzt1BYRhQU0/hDtsB1ufZfEEzMZ9aAVmsBw8+FWsIXlClWw==", + "optional": true, + "dependencies": { + "minipass": "^3.0.0" + }, + "engines": { + "node": ">= 8" + } + }, + "node_modules/minipass-pipeline": { + "version": "1.2.4", + "resolved": "https://registry.npmjs.org/minipass-pipeline/-/minipass-pipeline-1.2.4.tgz", + "integrity": "sha512-xuIq7cIOt09RPRJ19gdi4b+RiNvDFYe5JH+ggNvBqGqpQXcru3PcRmOZuHBKWK1Txf9+cQ+HMVN4d6z46LZP7A==", + "optional": true, + "dependencies": { + "minipass": "^3.0.0" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/minipass-sized": { + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/minipass-sized/-/minipass-sized-1.0.3.tgz", + "integrity": "sha512-MbkQQ2CTiBMlA2Dm/5cY+9SWFEN8pzzOXi6rlM5Xxq0Yqbda5ZQy9sU75a673FE9ZK0Zsbr6Y5iP6u9nktfg2g==", + "optional": true, + "dependencies": { + "minipass": "^3.0.0" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/minizlib": { + "version": "2.1.2", + "resolved": "https://registry.npmjs.org/minizlib/-/minizlib-2.1.2.tgz", + "integrity": "sha512-bAxsR8BVfj60DWXHE3u30oHzfl4G7khkSuPW+qvpd7jFRHm7dLxOjUk1EHACJ/hxLY8phGJ0YhYHZo7jil7Qdg==", + "dependencies": { + "minipass": "^3.0.0", + "yallist": "^4.0.0" + }, + "engines": { + "node": ">= 8" + } + }, + "node_modules/mkdirp": { + "version": "1.0.4", + "resolved": "https://registry.npmjs.org/mkdirp/-/mkdirp-1.0.4.tgz", + "integrity": "sha512-vVqVZQyf3WLx2Shd0qJ9xuvqgAyKPLAiqITEtqW0oIUjzo3PePDd6fW9iFz30ef7Ysp/oiWqbhszeGWW2T6Gzw==", + "bin": { + "mkdirp": "bin/cmd.js" + }, + "engines": { + "node": ">=10" + } + }, + "node_modules/mkdirp-classic": { + "version": "0.5.3", + "resolved": "https://registry.npmjs.org/mkdirp-classic/-/mkdirp-classic-0.5.3.tgz", + "integrity": "sha512-gKLcREMhtuZRwRAfqP3RFW+TK4JqApVBtOIftVgjuABpAtpxhPGaDcfvbhNvD0B8iD1oUr/txX35NjcaY6Ns/A==" + }, + "node_modules/ms": { + "version": "2.1.2", + "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.2.tgz", + "integrity": "sha512-sGkPx+VjMtmA6MX27oA4FBFELFCZZ4S4XqeGOXCv68tT+jb3vk/RyaKWP0PTKyWtmLSM0b+adUTEvbs1PEaH2w==" + }, + "node_modules/napi-build-utils": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/napi-build-utils/-/napi-build-utils-1.0.2.tgz", + "integrity": "sha512-ONmRUqK7zj7DWX0D9ADe03wbwOBZxNAfF20PlGfCWQcD3+/MakShIHrMqx9YwPTfxDdF1zLeL+RGZiR9kGMLdg==" + }, + "node_modules/negotiator": { + "version": "0.6.3", + "resolved": "https://registry.npmjs.org/negotiator/-/negotiator-0.6.3.tgz", + "integrity": "sha512-+EUsqGPLsM+j/zdChZjsnX51g4XrHFOIXwfnCVPGlQk/k5giakcKsuxCObBRu6DSm9opw/O6slWbJdghQM4bBg==", + "optional": true, + "engines": { + "node": ">= 0.6" + } + }, + "node_modules/node-abi": { + "version": "3.62.0", + "resolved": "https://registry.npmjs.org/node-abi/-/node-abi-3.62.0.tgz", + "integrity": "sha512-CPMcGa+y33xuL1E0TcNIu4YyaZCxnnvkVaEXrsosR3FxN+fV8xvb7Mzpb7IgKler10qeMkE6+Dp8qJhpzdq35g==", + "dependencies": { + "semver": "^7.3.5" + }, + "engines": { + "node": ">=10" + } + }, + "node_modules/node-addon-api": { + "version": "7.1.0", + "resolved": "https://registry.npmjs.org/node-addon-api/-/node-addon-api-7.1.0.tgz", + "integrity": "sha512-mNcltoe1R8o7STTegSOHdnJNN7s5EUvhoS7ShnTHDyOSd+8H+UdWODq6qSv67PjC8Zc5JRT8+oLAMCr0SIXw7g==", + "engines": { + "node": "^16 || ^18 || >= 20" + } + }, + "node_modules/node-gyp": { + "version": "8.4.1", + "resolved": "https://registry.npmjs.org/node-gyp/-/node-gyp-8.4.1.tgz", + "integrity": "sha512-olTJRgUtAb/hOXG0E93wZDs5YiJlgbXxTwQAFHyNlRsXQnYzUaF2aGgujZbw+hR8aF4ZG/rST57bWMWD16jr9w==", + "optional": true, + "dependencies": { + "env-paths": "^2.2.0", + "glob": "^7.1.4", + "graceful-fs": "^4.2.6", + "make-fetch-happen": "^9.1.0", + "nopt": "^5.0.0", + "npmlog": "^6.0.0", + "rimraf": "^3.0.2", + "semver": "^7.3.5", + "tar": "^6.1.2", + "which": "^2.0.2" + }, + "bin": { + "node-gyp": "bin/node-gyp.js" + }, + "engines": { + "node": ">= 10.12.0" + } + }, + "node_modules/nopt": { + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/nopt/-/nopt-5.0.0.tgz", + "integrity": "sha512-Tbj67rffqceeLpcRXrT7vKAN8CwfPeIBgM7E6iBkmKLV7bEMwpGgYLGv0jACUsECaa/vuxP0IjEont6umdMgtQ==", + "optional": true, + "dependencies": { + "abbrev": "1" + }, + "bin": { + "nopt": "bin/nopt.js" + }, + "engines": { + "node": ">=6" + } + }, + "node_modules/npmlog": { + "version": "6.0.2", + "resolved": "https://registry.npmjs.org/npmlog/-/npmlog-6.0.2.tgz", + "integrity": "sha512-/vBvz5Jfr9dT/aFWd0FIRf+T/Q2WBsLENygUaFUqstqsycmZAP/t5BvFJTK0viFmSUxiUKTUplWy5vt+rvKIxg==", + "deprecated": "This package is no longer supported.", + "optional": true, + "dependencies": { + "are-we-there-yet": "^3.0.0", + "console-control-strings": "^1.1.0", + "gauge": "^4.0.3", + "set-blocking": "^2.0.0" + }, + "engines": { + "node": "^12.13.0 || ^14.15.0 || >=16.0.0" + } + }, + "node_modules/once": { + "version": "1.4.0", + "resolved": "https://registry.npmjs.org/once/-/once-1.4.0.tgz", + "integrity": "sha512-lNaJgI+2Q5URQBkccEKHTQOPaXdUxnZZElQTZY0MFUAuaEqe1E+Nyvgdz/aIyNi6Z9MzO5dv1H8n58/GELp3+w==", + "dependencies": { + "wrappy": "1" + } + }, + "node_modules/p-map": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/p-map/-/p-map-4.0.0.tgz", + "integrity": "sha512-/bjOqmgETBYB5BoEeGVea8dmvHb2m9GLy1E9W43yeyfP6QQCZGFNa+XRceJEuDB6zqr+gKpIAmlLebMpykw/MQ==", + "optional": true, + "dependencies": { + "aggregate-error": "^3.0.0" + }, + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/path-is-absolute": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/path-is-absolute/-/path-is-absolute-1.0.1.tgz", + "integrity": "sha512-AVbw3UJ2e9bq64vSaS9Am0fje1Pa8pbGqTTsmXfaIiMpnr5DlDhfJOuLj9Sf95ZPVDAUerDfEk88MPmPe7UCQg==", + "optional": true, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/prebuild-install": { + "version": "7.1.2", + "resolved": "https://registry.npmjs.org/prebuild-install/-/prebuild-install-7.1.2.tgz", + "integrity": "sha512-UnNke3IQb6sgarcZIDU3gbMeTp/9SSU1DAIkil7PrqG1vZlBtY5msYccSKSHDqa3hNg436IXK+SNImReuA1wEQ==", + "dependencies": { + "detect-libc": "^2.0.0", + "expand-template": "^2.0.3", + "github-from-package": "0.0.0", + "minimist": "^1.2.3", + "mkdirp-classic": "^0.5.3", + "napi-build-utils": "^1.0.1", + "node-abi": "^3.3.0", + "pump": "^3.0.0", + "rc": "^1.2.7", + "simple-get": "^4.0.0", + "tar-fs": "^2.0.0", + "tunnel-agent": "^0.6.0" + }, + "bin": { + "prebuild-install": "bin.js" + }, + "engines": { + "node": ">=10" + } + }, + "node_modules/promise-inflight": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/promise-inflight/-/promise-inflight-1.0.1.tgz", + "integrity": "sha512-6zWPyEOFaQBJYcGMHBKTKJ3u6TBsnMFOIZSa6ce1e/ZrrsOlnHRHbabMjLiBYKp+n44X9eUI6VUPaukCXHuG4g==", + "optional": true + }, + "node_modules/promise-retry": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/promise-retry/-/promise-retry-2.0.1.tgz", + "integrity": "sha512-y+WKFlBR8BGXnsNlIHFGPZmyDf3DFMoLhaflAnyZgV6rG6xu+JwesTo2Q9R6XwYmtmwAFCkAk3e35jEdoeh/3g==", + "optional": true, + "dependencies": { + "err-code": "^2.0.2", + "retry": "^0.12.0" + }, + "engines": { + "node": ">=10" + } + }, + "node_modules/proxy-from-env": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/proxy-from-env/-/proxy-from-env-1.1.0.tgz", + "integrity": "sha512-D+zkORCbA9f1tdWRK0RaCR3GPv50cMxcrz4X8k5LTSUD1Dkw47mKJEZQNunItRTkWwgtaUSo1RVFRIG9ZXiFYg==" + }, + "node_modules/pump": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/pump/-/pump-3.0.0.tgz", + "integrity": "sha512-LwZy+p3SFs1Pytd/jYct4wpv49HiYCqd9Rlc5ZVdk0V+8Yzv6jR5Blk3TRmPL1ft69TxP0IMZGJ+WPFU2BFhww==", + "dependencies": { + "end-of-stream": "^1.1.0", + "once": "^1.3.1" + } + }, + "node_modules/rc": { + "version": "1.2.8", + "resolved": "https://registry.npmjs.org/rc/-/rc-1.2.8.tgz", + "integrity": "sha512-y3bGgqKj3QBdxLbLkomlohkvsA8gdAiUQlSBJnBhfn+BPxg4bc62d8TcBW15wavDfgexCgccckhcZvywyQYPOw==", + "dependencies": { + "deep-extend": "^0.6.0", + "ini": "~1.3.0", + "minimist": "^1.2.0", + "strip-json-comments": "~2.0.1" + }, + "bin": { + "rc": "cli.js" + } + }, + "node_modules/readable-stream": { + "version": "3.6.2", + "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-3.6.2.tgz", + "integrity": "sha512-9u/sniCrY3D5WdsERHzHE4G2YCXqoG5FTHUiCC4SIbr6XcLZBY05ya9EKjYek9O5xOAwjGq+1JdGBAS7Q9ScoA==", + "dependencies": { + "inherits": "^2.0.3", + "string_decoder": "^1.1.1", + "util-deprecate": "^1.0.1" + }, + "engines": { + "node": ">= 6" + } + }, + "node_modules/retry": { + "version": "0.12.0", + "resolved": "https://registry.npmjs.org/retry/-/retry-0.12.0.tgz", + "integrity": "sha512-9LkiTwjUh6rT555DtE9rTX+BKByPfrMzEAtnlEtdEwr3Nkffwiihqe2bWADg+OQRjt9gl6ICdmB/ZFDCGAtSow==", + "optional": true, + "engines": { + "node": ">= 4" + } + }, + "node_modules/rimraf": { + "version": "3.0.2", + "resolved": "https://registry.npmjs.org/rimraf/-/rimraf-3.0.2.tgz", + "integrity": "sha512-JZkJMZkAGFFPP2YqXZXPbMlMBgsxzE8ILs4lMIX/2o0L9UBw9O/Y3o6wFw/i9YLapcUJWwqbi3kdxIPdC62TIA==", + "deprecated": "Rimraf versions prior to v4 are no longer supported", + "optional": true, + "dependencies": { + "glob": "^7.1.3" + }, + "bin": { + "rimraf": "bin.js" + }, + "funding": { + "url": "https://github.com/sponsors/isaacs" + } + }, + "node_modules/safe-buffer": { + "version": "5.2.1", + "resolved": "https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.2.1.tgz", + "integrity": "sha512-rp3So07KcdmmKbGvgaNxQSJr7bGVSVk5S9Eq1F+ppbRo70+YeaDxkw5Dd8NPN+GD6bjnYm2VuPuCXmpuYvmCXQ==", + "funding": [ + { + "type": "github", + "url": "https://github.com/sponsors/feross" + }, + { + "type": "patreon", + "url": "https://www.patreon.com/feross" + }, + { + "type": "consulting", + "url": "https://feross.org/support" + } + ] + }, + "node_modules/safer-buffer": { + "version": "2.1.2", + "resolved": "https://registry.npmjs.org/safer-buffer/-/safer-buffer-2.1.2.tgz", + "integrity": "sha512-YZo3K82SD7Riyi0E1EQPojLz7kpepnSQI9IyPbHHg1XXXevb5dJI7tpyN2ADxGcQbHG7vcyRHk0cbwqcQriUtg==", + "optional": true + }, + "node_modules/semver": { + "version": "7.6.2", + "resolved": "https://registry.npmjs.org/semver/-/semver-7.6.2.tgz", + "integrity": "sha512-FNAIBWCx9qcRhoHcgcJ0gvU7SN1lYU2ZXuSfl04bSC5OpvDHFyJCjdNHomPXxjQlCBU67YW64PzY7/VIEH7F2w==", + "bin": { + "semver": "bin/semver.js" + }, + "engines": { + "node": ">=10" + } + }, + "node_modules/set-blocking": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/set-blocking/-/set-blocking-2.0.0.tgz", + "integrity": "sha512-KiKBS8AnWGEyLzofFfmvKwpdPzqiy16LvQfK3yv/fVH7Bj13/wl3JSR1J+rfgRE9q7xUJK4qvgS8raSOeLUehw==", + "optional": true + }, + "node_modules/signal-exit": { + "version": "3.0.7", + "resolved": "https://registry.npmjs.org/signal-exit/-/signal-exit-3.0.7.tgz", + "integrity": "sha512-wnD2ZE+l+SPC/uoS0vXeE9L1+0wuaMqKlfz9AMUo38JsyLSBWSFcHR1Rri62LZc12vLr1gb3jl7iwQhgwpAbGQ==", + "optional": true + }, + "node_modules/simple-concat": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/simple-concat/-/simple-concat-1.0.1.tgz", + "integrity": "sha512-cSFtAPtRhljv69IK0hTVZQ+OfE9nePi/rtJmw5UjHeVyVroEqJXP1sFztKUy1qU+xvz3u/sfYJLa947b7nAN2Q==", + "funding": [ + { + "type": "github", + "url": "https://github.com/sponsors/feross" + }, + { + "type": "patreon", + "url": "https://www.patreon.com/feross" + }, + { + "type": "consulting", + "url": "https://feross.org/support" + } + ] + }, + "node_modules/simple-get": { + "version": "4.0.1", + "resolved": "https://registry.npmjs.org/simple-get/-/simple-get-4.0.1.tgz", + "integrity": "sha512-brv7p5WgH0jmQJr1ZDDfKDOSeWWg+OVypG99A/5vYGPqJ6pxiaHLy8nxtFjBA7oMa01ebA9gfh1uMCFqOuXxvA==", + "funding": [ + { + "type": "github", + "url": "https://github.com/sponsors/feross" + }, + { + "type": "patreon", + "url": "https://www.patreon.com/feross" + }, + { + "type": "consulting", + "url": "https://feross.org/support" + } + ], + "dependencies": { + "decompress-response": "^6.0.0", + "once": "^1.3.1", + "simple-concat": "^1.0.0" + } + }, + "node_modules/smart-buffer": { + "version": "4.2.0", + "resolved": "https://registry.npmjs.org/smart-buffer/-/smart-buffer-4.2.0.tgz", + "integrity": "sha512-94hK0Hh8rPqQl2xXc3HsaBoOXKV20MToPkcXvwbISWLEs+64sBq5kFgn2kJDHb1Pry9yrP0dxrCI9RRci7RXKg==", + "engines": { + "node": ">= 6.0.0", + "npm": ">= 3.0.0" + } + }, + "node_modules/socks": { + "version": "2.8.3", + "resolved": "https://registry.npmjs.org/socks/-/socks-2.8.3.tgz", + "integrity": "sha512-l5x7VUUWbjVFbafGLxPWkYsHIhEvmF85tbIeFZWc8ZPtoMyybuEhL7Jye/ooC4/d48FgOjSJXgsF/AJPYCW8Zw==", + "dependencies": { + "ip-address": "^9.0.5", + "smart-buffer": "^4.2.0" + }, + "engines": { + "node": ">= 10.0.0", + "npm": ">= 3.0.0" + } + }, + "node_modules/socks-proxy-agent": { + "version": "8.0.3", + "resolved": "https://registry.npmjs.org/socks-proxy-agent/-/socks-proxy-agent-8.0.3.tgz", + "integrity": "sha512-VNegTZKhuGq5vSD6XNKlbqWhyt/40CgoEw8XxD6dhnm8Jq9IEa3nIa4HwnM8XOqU0CdB0BwWVXusqiFXfHB3+A==", + "dependencies": { + "agent-base": "^7.1.1", + "debug": "^4.3.4", + "socks": "^2.7.1" + }, + "engines": { + "node": ">= 14" + } + }, + "node_modules/sprintf-js": { + "version": "1.1.3", + "resolved": "https://registry.npmjs.org/sprintf-js/-/sprintf-js-1.1.3.tgz", + "integrity": "sha512-Oo+0REFV59/rz3gfJNKQiBlwfHaSESl1pcGyABQsnnIfWOFt6JNj5gCog2U6MLZ//IGYD+nA8nI+mTShREReaA==" + }, + "node_modules/sqlite3": { + "version": "5.1.7", + "resolved": "https://registry.npmjs.org/sqlite3/-/sqlite3-5.1.7.tgz", + "integrity": "sha512-GGIyOiFaG+TUra3JIfkI/zGP8yZYLPQ0pl1bH+ODjiX57sPhrLU5sQJn1y9bDKZUFYkX1crlrPfSYt0BKKdkog==", + "hasInstallScript": true, + "dependencies": { + "bindings": "^1.5.0", + "node-addon-api": "^7.0.0", + "prebuild-install": "^7.1.1", + "tar": "^6.1.11" + }, + "optionalDependencies": { + "node-gyp": "8.x" + }, + "peerDependencies": { + "node-gyp": "8.x" + }, + "peerDependenciesMeta": { + "node-gyp": { + "optional": true + } + } + }, + "node_modules/ssri": { + "version": "8.0.1", + "resolved": "https://registry.npmjs.org/ssri/-/ssri-8.0.1.tgz", + "integrity": "sha512-97qShzy1AiyxvPNIkLWoGua7xoQzzPjQ0HAH4B0rWKo7SZ6USuPcrUiAFrws0UH8RrbWmgq3LMTObhPIHbbBeQ==", + "optional": true, + "dependencies": { + "minipass": "^3.1.1" + }, + "engines": { + "node": ">= 8" + } + }, + "node_modules/string_decoder": { + "version": "1.3.0", + "resolved": "https://registry.npmjs.org/string_decoder/-/string_decoder-1.3.0.tgz", + "integrity": "sha512-hkRX8U1WjJFd8LsDJ2yQ/wWWxaopEsABU1XfkM8A+j0+85JAGppt16cr1Whg6KIbb4okU6Mql6BOj+uup/wKeA==", + "dependencies": { + "safe-buffer": "~5.2.0" + } + }, + "node_modules/string-width": { + "version": "4.2.3", + "resolved": "https://registry.npmjs.org/string-width/-/string-width-4.2.3.tgz", + "integrity": "sha512-wKyQRQpjJ0sIp62ErSZdGsjMJWsap5oRNihHhu6G7JVO/9jIB6UyevL+tXuOqrng8j/cxKTWyWUwvSTriiZz/g==", + "optional": true, + "dependencies": { + "emoji-regex": "^8.0.0", + "is-fullwidth-code-point": "^3.0.0", + "strip-ansi": "^6.0.1" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/strip-ansi": { + "version": "6.0.1", + "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-6.0.1.tgz", + "integrity": "sha512-Y38VPSHcqkFrCpFnQ9vuSXmquuv5oXOKpGeT6aGrr3o3Gc9AlVa6JBfUSOCnbxGGZF+/0ooI7KrPuUSztUdU5A==", + "optional": true, + "dependencies": { + "ansi-regex": "^5.0.1" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/strip-json-comments": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/strip-json-comments/-/strip-json-comments-2.0.1.tgz", + "integrity": "sha512-4gB8na07fecVVkOI6Rs4e7T6NOTki5EmL7TUduTs6bu3EdnSycntVJ4re8kgZA+wx9IueI2Y11bfbgwtzuE0KQ==", + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/tar": { + "version": "6.2.1", + "resolved": "https://registry.npmjs.org/tar/-/tar-6.2.1.tgz", + "integrity": "sha512-DZ4yORTwrbTj/7MZYq2w+/ZFdI6OZ/f9SFHR+71gIVUZhOQPHzVCLpvRnPgyaMpfWxxk/4ONva3GQSyNIKRv6A==", + "dependencies": { + "chownr": "^2.0.0", + "fs-minipass": "^2.0.0", + "minipass": "^5.0.0", + "minizlib": "^2.1.1", + "mkdirp": "^1.0.3", + "yallist": "^4.0.0" + }, + "engines": { + "node": ">=10" + } + }, + "node_modules/tar-fs": { + "version": "2.1.1", + "resolved": "https://registry.npmjs.org/tar-fs/-/tar-fs-2.1.1.tgz", + "integrity": "sha512-V0r2Y9scmbDRLCNex/+hYzvp/zyYjvFbHPNgVTKfQvVrb6guiE/fxP+XblDNR011utopbkex2nM4dHNV6GDsng==", + "dependencies": { + "chownr": "^1.1.1", + "mkdirp-classic": "^0.5.2", + "pump": "^3.0.0", + "tar-stream": "^2.1.4" + } + }, + "node_modules/tar-fs/node_modules/chownr": { + "version": "1.1.4", + "resolved": "https://registry.npmjs.org/chownr/-/chownr-1.1.4.tgz", + "integrity": "sha512-jJ0bqzaylmJtVnNgzTeSOs8DPavpbYgEr/b0YL8/2GO3xJEhInFmhKMUnEJQjZumK7KXGFhUy89PrsJWlakBVg==" + }, + "node_modules/tar-stream": { + "version": "2.2.0", + "resolved": "https://registry.npmjs.org/tar-stream/-/tar-stream-2.2.0.tgz", + "integrity": "sha512-ujeqbceABgwMZxEJnk2HDY2DlnUZ+9oEcb1KzTVfYHio0UE6dG71n60d8D2I4qNvleWrrXpmjpt7vZeF1LnMZQ==", + "dependencies": { + "bl": "^4.0.3", + "end-of-stream": "^1.4.1", + "fs-constants": "^1.0.0", + "inherits": "^2.0.3", + "readable-stream": "^3.1.1" + }, + "engines": { + "node": ">=6" + } + }, + "node_modules/tar/node_modules/minipass": { + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/minipass/-/minipass-5.0.0.tgz", + "integrity": "sha512-3FnjYuehv9k6ovOEbyOswadCDPX1piCfhV8ncmYtHOjuPwylVWsghTLo7rabjC3Rx5xD4HDx8Wm1xnMF7S5qFQ==", + "engines": { + "node": ">=8" + } + }, + "node_modules/tiny-secp256k1": { + "version": "2.2.3", + "resolved": "https://registry.npmjs.org/tiny-secp256k1/-/tiny-secp256k1-2.2.3.tgz", + "integrity": "sha512-SGcL07SxcPN2nGKHTCvRMkQLYPSoeFcvArUSCYtjVARiFAWU44cCIqYS0mYAU6nY7XfvwURuTIGo2Omt3ZQr0Q==", + "dependencies": { + "uint8array-tools": "0.0.7" + }, + "engines": { + "node": ">=14.0.0" + } + }, + "node_modules/tunnel-agent": { + "version": "0.6.0", + "resolved": "https://registry.npmjs.org/tunnel-agent/-/tunnel-agent-0.6.0.tgz", + "integrity": "sha512-McnNiV1l8RYeY8tBgEpuodCC1mLUdbSN+CYBL7kJsJNInOP8UjDDEwdk6Mw60vdLLrr5NHKZhMAOSrR2NZuQ+w==", + "dependencies": { + "safe-buffer": "^5.0.1" + }, + "engines": { + "node": "*" + } + }, + "node_modules/typeforce": { + "version": "1.18.0", + "resolved": "https://registry.npmjs.org/typeforce/-/typeforce-1.18.0.tgz", + "integrity": "sha512-7uc1O8h1M1g0rArakJdf0uLRSSgFcYexrVoKo+bzJd32gd4gDy2L/Z+8/FjPnU9ydY3pEnVPtr9FyscYY60K1g==" + }, + "node_modules/uint8array-tools": { + "version": "0.0.7", + "resolved": "https://registry.npmjs.org/uint8array-tools/-/uint8array-tools-0.0.7.tgz", + "integrity": "sha512-vrrNZJiusLWoFWBqz5Y5KMCgP9W9hnjZHzZiZRT8oNAkq3d5Z5Oe76jAvVVSRh4U8GGR90N2X1dWtrhvx6L8UQ==", + "engines": { + "node": ">=14.0.0" + } + }, + "node_modules/unique-filename": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/unique-filename/-/unique-filename-1.1.1.tgz", + "integrity": "sha512-Vmp0jIp2ln35UTXuryvjzkjGdRyf9b2lTXuSYUiPmzRcl3FDtYqAwOnTJkAngD9SWhnoJzDbTKwaOrZ+STtxNQ==", + "optional": true, + "dependencies": { + "unique-slug": "^2.0.0" + } + }, + "node_modules/unique-slug": { + "version": "2.0.2", + "resolved": "https://registry.npmjs.org/unique-slug/-/unique-slug-2.0.2.tgz", + "integrity": "sha512-zoWr9ObaxALD3DOPfjPSqxt4fnZiWblxHIgeWqW8x7UqDzEtHEQLzji2cuJYQFCU6KmoJikOYAZlrTHHebjx2w==", + "optional": true, + "dependencies": { + "imurmurhash": "^0.1.4" + } + }, + "node_modules/util-deprecate": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/util-deprecate/-/util-deprecate-1.0.2.tgz", + "integrity": "sha512-EPD5q1uXyFxJpCrLnCc1nHnq3gOa6DZBocAIiI2TaSCA7VCJ1UJDMagCzIkXNsUYfD1daK//LTEQ8xiIbrHtcw==" + }, + "node_modules/uuid": { + "version": "9.0.1", + "resolved": "https://registry.npmjs.org/uuid/-/uuid-9.0.1.tgz", + "integrity": "sha512-b+1eJOlsR9K8HJpow9Ok3fiWOWSIcIzXodvv0rQjVoOVNpWMpxf1wZNpt4y9h10odCNrqnYp1OBzRktckBe3sA==", + "funding": [ + "https://github.com/sponsors/broofa", + "https://github.com/sponsors/ctavan" + ], + "bin": { + "uuid": "dist/bin/uuid" + } + }, + "node_modules/varuint-bitcoin": { + "version": "1.1.2", + "resolved": "https://registry.npmjs.org/varuint-bitcoin/-/varuint-bitcoin-1.1.2.tgz", + "integrity": "sha512-4EVb+w4rx+YfVM32HQX42AbbT7/1f5zwAYhIujKXKk8NQK+JfRVl3pqT3hjNn/L+RstigmGGKVwHA/P0wgITZw==", + "dependencies": { + "safe-buffer": "^5.1.1" + } + }, + "node_modules/which": { + "version": "2.0.2", + "resolved": "https://registry.npmjs.org/which/-/which-2.0.2.tgz", + "integrity": "sha512-BLI3Tl1TW3Pvl70l3yq3Y64i+awpwXqsGBYWkkqMtnbXgrMD+yj7rhW0kuEDxzJaYXGjEW5ogapKNMEKNMjibA==", + "optional": true, + "dependencies": { + "isexe": "^2.0.0" + }, + "bin": { + "node-which": "bin/node-which" + }, + "engines": { + "node": ">= 8" + } + }, + "node_modules/wide-align": { + "version": "1.1.5", + "resolved": "https://registry.npmjs.org/wide-align/-/wide-align-1.1.5.tgz", + "integrity": "sha512-eDMORYaPNZ4sQIuuYPDHdQvf4gyCF9rEEV/yPxGfwPkRodwEgiMUUXTx/dex+Me0wxx53S+NgUHaP7y3MGlDmg==", + "optional": true, + "dependencies": { + "string-width": "^1.0.2 || 2 || 3 || 4" + } + }, + "node_modules/wrappy": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/wrappy/-/wrappy-1.0.2.tgz", + "integrity": "sha512-l4Sp/DRseor9wL6EvV2+TuQn63dMkPjZ/sp9XkghTEbV9KlPS1xUsZ3u7/IQO4wxtcFB4bgpQPRcR3QCvezPcQ==" + }, + "node_modules/yallist": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/yallist/-/yallist-4.0.0.tgz", + "integrity": "sha512-3wdGidZyq5PB084XLES5TpOSRA3wjXAlIWMhum2kRcv/41Sn2emQ0dycQW4uZXLejwKvg6EsvbdlVL+FYEct7A==" + } + } +} diff --git a/clients/libs/nodejs/package.json b/clients/libs/nodejs/package.json new file mode 100644 index 00000000..955545c7 --- /dev/null +++ b/clients/libs/nodejs/package.json @@ -0,0 +1,24 @@ +{ + "name": "mercurynodejslib", + "version": "0.0.1", + "description": "", + "main": "index.js", + "scripts": { + "test": "echo \"Error: no test specified\" && exit 1" + }, + "keywords": [], + "author": "", + "license": "ISC", + "dependencies": { + "@mempool/electrum-client": "^1.1.9", + "axios": "^1.5.1", + "bitcoinjs-lib": "^6.1.5", + "commander": "^11.1.0", + "config": "^3.3.9", + "mercury-wasm": "file:../../../wasm/node_pkg/debug", + "socks-proxy-agent": "^8.0.2", + "sqlite3": "^5.1.6", + "tiny-secp256k1": "^2.2.3", + "uuid": "^9.0.1" + } +} diff --git a/clients/nodejs/sqlite_manager.js b/clients/libs/nodejs/sqlite_manager.js similarity index 100% rename from clients/nodejs/sqlite_manager.js rename to clients/libs/nodejs/sqlite_manager.js diff --git a/clients/nodejs/transaction.js b/clients/libs/nodejs/transaction.js similarity index 79% rename from clients/nodejs/transaction.js rename to clients/libs/nodejs/transaction.js index 3e3be3fa..1594b88b 100644 --- a/clients/nodejs/transaction.js +++ b/clients/libs/nodejs/transaction.js @@ -2,19 +2,18 @@ const axios = require('axios').default; const { SocksProxyAgent } = require('socks-proxy-agent'); const mercury_wasm = require('mercury-wasm'); const utils = require('./utils'); -const config = require('config'); -const new_transaction = async(electrumClient, coin, toAddress, isWithdrawal, qtBackupTx, block_height, network) => { +const new_transaction = async(clientConfig, electrumClient, coin, toAddress, isWithdrawal, qtBackupTx, block_height, network) => { let coin_nonce = mercury_wasm.createAndCommitNonces(coin); - let server_pubnonce = await signFirst(coin_nonce.sign_first_request_payload); + let server_pubnonce = await signFirst(clientConfig, coin_nonce.sign_first_request_payload); coin.secret_nonce = coin_nonce.secret_nonce; coin.public_nonce = coin_nonce.public_nonce; coin.server_public_nonce = server_pubnonce; coin.blinding_factor = coin_nonce.blinding_factor; - const serverInfo = await utils.infoConfig(electrumClient); + const serverInfo = await utils.infoConfig(clientConfig, electrumClient); let new_block_height = 0; if (block_height == null) { @@ -41,7 +40,7 @@ const new_transaction = async(electrumClient, coin, toAddress, isWithdrawal, qtB const serverPartialSigRequest = partialSigRequest.partial_signature_request_payload; - const serverPartialSig = await signSecond(serverPartialSigRequest); + const serverPartialSig = await signSecond(clientConfig, serverPartialSigRequest); const clientPartialSig = partialSigRequest.client_partial_sig; const msg = partialSigRequest.msg; @@ -57,13 +56,13 @@ const new_transaction = async(electrumClient, coin, toAddress, isWithdrawal, qtB return signed_tx; } -const signFirst = async (signFirstRequestPayload) => { +const signFirst = async (clientConfig, signFirstRequestPayload) => { - const statechain_entity_url = config.get('statechainEntity'); + const statechain_entity_url = clientConfig.statechainEntity; const path = "sign/first"; const url = statechain_entity_url + '/' + path; - const torProxy = config.get('torProxy'); + const torProxy = clientConfig.torProxy; let socksAgent = undefined; @@ -82,13 +81,13 @@ const signFirst = async (signFirstRequestPayload) => { return server_pubnonce_hex; } -const signSecond = async (partialSigRequest) => { +const signSecond = async (clientConfig, partialSigRequest) => { - const statechain_entity_url = config.get('statechainEntity'); + const statechain_entity_url = clientConfig.statechainEntity; const path = "sign/second"; const url = statechain_entity_url + '/' + path; - const torProxy = config.get('torProxy'); + const torProxy = clientConfig.torProxy; let socksAgent = undefined; diff --git a/clients/nodejs/transfer_receive.js b/clients/libs/nodejs/transfer_receive.js similarity index 84% rename from clients/nodejs/transfer_receive.js rename to clients/libs/nodejs/transfer_receive.js index 19b3ea30..aa57c7e7 100644 --- a/clients/nodejs/transfer_receive.js +++ b/clients/libs/nodejs/transfer_receive.js @@ -5,7 +5,6 @@ const { SocksProxyAgent } = require('socks-proxy-agent'); const bitcoinjs = require("bitcoinjs-lib"); const ecc = require("tiny-secp256k1"); const utils = require('./utils'); -const config = require('config'); const { CoinStatus } = require('./coin_enum'); const newTransferAddress = async (db, wallet_name) => { @@ -21,11 +20,11 @@ const newTransferAddress = async (db, wallet_name) => { return coin.address; } -const execute = async (electrumClient, db, wallet_name) => { +const execute = async (clientConfig, electrumClient, db, wallet_name) => { let wallet = await sqlite_manager.getWallet(db, wallet_name); - const serverInfo = await utils.infoConfig(electrumClient); + const serverInfo = await utils.infoConfig(clientConfig, electrumClient); let uniqueAuthPubkeys = new Set(); @@ -37,15 +36,15 @@ const execute = async (electrumClient, db, wallet_name) => { for (let authPubkey of uniqueAuthPubkeys) { try { - let encMessages = await getMsgAddr(authPubkey); + let encMessages = await getMsgAddr(clientConfig, authPubkey); if (encMessages.length === 0) { - console.log("No messages"); + // console.log("No messages"); continue; } encMsgsPerAuthPubkey.set(authPubkey, encMessages); } catch (err) { - console.error(err); + // console.error(err); } } @@ -62,13 +61,13 @@ const execute = async (electrumClient, db, wallet_name) => { if (coin) { try { - let statechainIdAdded = await processEncryptedMessage(electrumClient, db, coin, encMessage, wallet.network, serverInfo, tempActivities); + let statechainIdAdded = await processEncryptedMessage(clientConfig, electrumClient, db, coin, encMessage, wallet.network, serverInfo, tempActivities); if (statechainIdAdded) { receivedStatechainIds.push(statechainIdAdded); } } catch (error) { - console.error(`Error: ${error.message}`); + // console.error(`Error: ${error.message}`); continue; } @@ -77,7 +76,7 @@ const execute = async (electrumClient, db, wallet_name) => { let newCoin = await mercury_wasm.duplicateCoinToInitializedState(wallet, authPubkey); if (newCoin) { - let statechainIdAdded = await processEncryptedMessage(electrumClient, db, newCoin, encMessage, wallet.network, serverInfo, tempActivities); + let statechainIdAdded = await processEncryptedMessage(clientConfig, electrumClient, db, newCoin, encMessage, wallet.network, serverInfo, tempActivities); if (statechainIdAdded) { tempCoins.push(newCoin); @@ -85,7 +84,7 @@ const execute = async (electrumClient, db, wallet_name) => { } } } catch (error) { - console.error(`Error: ${error.message}`); + // console.error(`Error: ${error.message}`); continue; } } @@ -100,13 +99,13 @@ const execute = async (electrumClient, db, wallet_name) => { return receivedStatechainIds; } -const getMsgAddr = async (auth_pubkey) => { +const getMsgAddr = async (clientConfig, auth_pubkey) => { - const statechain_entity_url = config.get('statechainEntity'); + const statechain_entity_url = clientConfig.statechainEntity; const path = "transfer/get_msg_addr/"; const url = statechain_entity_url + '/' + path + auth_pubkey; - const torProxy = config.get('torProxy'); + const torProxy = clientConfig.torProxy; let socksAgent = undefined; @@ -119,7 +118,7 @@ const getMsgAddr = async (auth_pubkey) => { return response.data.list_enc_transfer_msg; } -const processEncryptedMessage = async (electrumClient, db, coin, encMessage, network, serverInfo, activities) => { +const processEncryptedMessage = async (clientConfig, electrumClient, db, coin, encMessage, network, serverInfo, activities) => { let clientAuthKey = coin.auth_privkey; let newUserPubkey = coin.user_pubkey; @@ -135,7 +134,7 @@ const processEncryptedMessage = async (electrumClient, db, coin, encMessage, net throw new Error("Invalid transfer signature"); } - const statechainInfo = await utils.getStatechainInfo(transferMsg.statechain_id); + const statechainInfo = await utils.getStatechainInfo(clientConfig, transferMsg.statechain_id); if (statechainInfo == null) { throw new Error("Statechain info not found"); @@ -157,14 +156,14 @@ const processEncryptedMessage = async (electrumClient, db, coin, encMessage, net throw new Error("num_sigs is not correct"); } - let isTx0OutputUnspent = await verifyTx0OutputIsUnspentAndConfirmed(electrumClient, tx0Outpoint, tx0Hex, network); + let isTx0OutputUnspent = await verifyTx0OutputIsUnspentAndConfirmed(clientConfig, electrumClient, tx0Outpoint, tx0Hex, network); if (!isTx0OutputUnspent.result) { throw new Error("tx0 output is spent or not confirmed"); } const currentFeeRateSatsPerByte = serverInfo.fee_rate_sats_per_byte; - const feeRateTolerance = config.get('feeRateTolerance'); + const feeRateTolerance = clientConfig.feeRateTolerance; let previousLockTime = null; @@ -210,12 +209,12 @@ const processEncryptedMessage = async (electrumClient, db, coin, encMessage, net let signedStatechainIdForUnlock = mercury_wasm.signMessage(transferMsg.statechain_id, coin); - await unlockStatecoin(transferMsg.statechain_id, signedStatechainIdForUnlock, coin.auth_pubkey); + await unlockStatecoin(clientConfig, transferMsg.statechain_id, signedStatechainIdForUnlock, coin.auth_pubkey); let serverPublicKeyHex = ""; try { - serverPublicKeyHex = await sendTransferReceiverRequestPayload(transferReceiverRequestPayload); + serverPublicKeyHex = await sendTransferReceiverRequestPayload(clientConfig, transferReceiverRequestPayload); } catch (error) { throw new Error(error); } @@ -253,7 +252,7 @@ const getTx0 = async (electrumClient, tx0_txid) => { return await electrumClient.request('blockchain.transaction.get', [tx0_txid]); // request(promise) } -const verifyTx0OutputIsUnspentAndConfirmed = async (electrumClient, tx0Outpoint, tx0Hex, wallet_network) => { +const verifyTx0OutputIsUnspentAndConfirmed = async (clientConfig, electrumClient, tx0Outpoint, tx0Hex, wallet_network) => { let tx0outputAddress = mercury_wasm.getOutputAddressFromTx0(tx0Outpoint, tx0Hex, wallet_network); @@ -278,7 +277,7 @@ const verifyTx0OutputIsUnspentAndConfirmed = async (electrumClient, tx0Outpoint, const confirmations = blockheight - unspent.height + 1; - const confirmationTarget = config.get('confirmationTarget'); + const confirmationTarget = clientConfig.confirmationTarget; if (confirmations >= confirmationTarget) { status = CoinStatus.CONFIRMED; @@ -291,13 +290,13 @@ const verifyTx0OutputIsUnspentAndConfirmed = async (electrumClient, tx0Outpoint, return { result: false, status }; } -const unlockStatecoin = async (statechainId, signedStatechainId, authPubkey) => { +const unlockStatecoin = async (clientConfig, statechainId, signedStatechainId, authPubkey) => { - const statechain_entity_url = config.get('statechainEntity'); + const statechain_entity_url = clientConfig.statechainEntity; const path = "transfer/unlock"; const url = statechain_entity_url + '/' + path; - const torProxy = config.get('torProxy'); + const torProxy = clientConfig.torProxy; let socksAgent = undefined; @@ -322,13 +321,13 @@ const sleep = (ms) => { return new Promise(resolve => setTimeout(resolve, ms)); } -const sendTransferReceiverRequestPayload = async (transferReceiverRequestPayload) => { +const sendTransferReceiverRequestPayload = async (clientConfig, transferReceiverRequestPayload) => { - const statechain_entity_url = config.get('statechainEntity'); + const statechain_entity_url = clientConfig.statechainEntity; const path = "transfer/receiver"; const url = statechain_entity_url + '/' + path; - const torProxy = config.get('torProxy'); + const torProxy = clientConfig.torProxy; let socksAgent = undefined; diff --git a/clients/nodejs/transfer_send.js b/clients/libs/nodejs/transfer_send.js similarity index 86% rename from clients/nodejs/transfer_send.js rename to clients/libs/nodejs/transfer_send.js index 02e6fca3..afa4222c 100644 --- a/clients/nodejs/transfer_send.js +++ b/clients/libs/nodejs/transfer_send.js @@ -4,9 +4,8 @@ const transaction = require('./transaction'); const axios = require('axios').default; const { SocksProxyAgent } = require('socks-proxy-agent'); const { CoinStatus } = require('./coin_enum'); -const config = require('config'); -const execute = async (electrumClient, db, walletName, statechainId, toAddress, batchId) => { +const execute = async (clientConfig, electrumClient, db, walletName, statechainId, toAddress, batchId) => { let wallet = await sqlite_manager.getWallet(db, walletName); @@ -61,9 +60,9 @@ const execute = async (electrumClient, db, walletName, statechainId, toAddress, const decodedTransferAddress = mercury_wasm.decodeTransferAddress(toAddress); const new_auth_pubkey = decodedTransferAddress.auth_pubkey; - const new_x1 = await get_new_x1(statechain_id, signed_statechain_id, new_auth_pubkey, batchId); + const new_x1 = await get_new_x1(clientConfig, statechain_id, signed_statechain_id, new_auth_pubkey, batchId); - const signed_tx = await transaction.new_transaction(electrumClient, coin, toAddress, isWithdrawal, qtBackupTx, block_height, wallet.network); + const signed_tx = await transaction.new_transaction(clientConfig, electrumClient, coin, toAddress, isWithdrawal, qtBackupTx, block_height, wallet.network); const backup_tx = { tx_n: new_tx_n, @@ -86,11 +85,11 @@ const execute = async (electrumClient, db, walletName, statechainId, toAddress, const transferUpdateMsgRequestPayload = mercury_wasm.createTransferUpdateMsg(new_x1, recipient_address, coin, transfer_signature, backupTxs); - const statechain_entity_url = config.get('statechainEntity'); + const statechain_entity_url = clientConfig.statechainEntity; const path = "transfer/update_msg"; const url = statechain_entity_url + '/' + path; - const torProxy = config.get('torProxy'); + const torProxy = clientConfig.torProxy; let socksAgent = undefined; @@ -123,9 +122,9 @@ const execute = async (electrumClient, db, walletName, statechainId, toAddress, return coin; } -const get_new_x1 = async (statechain_id, signed_statechain_id, new_auth_pubkey, batchId) => { +const get_new_x1 = async (clientConfig, statechain_id, signed_statechain_id, new_auth_pubkey, batchId) => { - const statechain_entity_url = config.get('statechainEntity'); + const statechain_entity_url = clientConfig.statechainEntity; const path = "transfer/sender"; const url = statechain_entity_url + '/' + path; @@ -136,7 +135,7 @@ const get_new_x1 = async (statechain_id, signed_statechain_id, new_auth_pubkey, batch_id: batchId, }; - const torProxy = config.get('torProxy'); + const torProxy = clientConfig.torProxy; let socksAgent = undefined; diff --git a/clients/nodejs/utils.js b/clients/libs/nodejs/utils.js similarity index 83% rename from clients/nodejs/utils.js rename to clients/libs/nodejs/utils.js index 358d88bd..cdd9430c 100644 --- a/clients/nodejs/utils.js +++ b/clients/libs/nodejs/utils.js @@ -1,11 +1,10 @@ const axios = require('axios').default; const { SocksProxyAgent } = require('socks-proxy-agent'); const bitcoinjs_lib = require("bitcoinjs-lib"); -const config = require('config'); -const infoConfig = async (ecl) => { +const infoConfig = async (clientConfig, ecl) => { - const statechain_entity_url = config.get('statechainEntity'); + const statechain_entity_url = clientConfig.statechainEntity; const path = "info/config"; let fee_rate_btc_per_kb = await ecl.request('blockchain.estimatefee', [3]); // request(promise) @@ -20,7 +19,7 @@ const infoConfig = async (ecl) => { // console.log("fee_rate_sats_per_byte: " + fee_rate_sats_per_byte); - const torProxy = config.get('torProxy'); + const torProxy = clientConfig.torProxy; let socksAgent = undefined; @@ -64,12 +63,12 @@ const createActivity = (utxo, amount, action) => { } -const getStatechainInfo = async (statechainId) => { +const getStatechainInfo = async (clientConfig, statechainId) => { - const statechainEntityUrl = config.get('statechainEntity'); + const statechainEntityUrl = clientConfig.statechainEntity; const path = `info/statechain/${statechainId}`; - const torProxy = config.get('torProxy'); + const torProxy = clientConfig.torProxy; let socksAgent = undefined; @@ -89,13 +88,13 @@ const getStatechainInfo = async (statechainId) => { } } -const completeWithdraw = async (statechainId, signedStatechainId) => { +const completeWithdraw = async (clientConfig, statechainId, signedStatechainId) => { - const statechainEntityUrl = config.get('statechainEntity'); + const statechainEntityUrl = clientConfig.statechainEntity; const path = "withdraw/complete"; const url = statechainEntityUrl + '/' + path; - const torProxy = config.get('torProxy'); + const torProxy = clientConfig.torProxy; let socksAgent = undefined; diff --git a/clients/nodejs/wallet.js b/clients/libs/nodejs/wallet.js similarity index 80% rename from clients/nodejs/wallet.js rename to clients/libs/nodejs/wallet.js index 78f67057..9362e326 100644 --- a/clients/nodejs/wallet.js +++ b/clients/libs/nodejs/wallet.js @@ -2,9 +2,9 @@ const utils = require('./utils'); const mercury_wasm = require('mercury-wasm'); -const createWallet = async (name, config, electrumClient) => { +const createWallet = async (name, clientConfig, electrumClient) => { - const urlElectrum = config.get('electrumServer'); + const urlElectrum = clientConfig.electrumServer; const urlElectrumObject = new URL(urlElectrum); const electrumPort = urlElectrumObject.port; @@ -12,14 +12,14 @@ const createWallet = async (name, config, electrumClient) => { const electrumProtocol = urlElectrumObject.protocol.slice(0, -1); const electrumEndpoint = urlElectrum; - const statechainEntityEndpoint = config.get('statechainEntity'); - const network = config.get('network'); - const electrumType = config.get('electrumType'); + const statechainEntityEndpoint = clientConfig.statechainEntity; + const network = clientConfig.network; + const electrumType = clientConfig.electrumType; let block_header = await electrumClient.request('blockchain.headers.subscribe'); let blockheight = block_header.height; - let serverInfo = await utils.infoConfig(electrumClient); + let serverInfo = await utils.infoConfig(clientConfig, electrumClient); let mnemonic = mercury_wasm.generateMnemonic(); diff --git a/clients/nodejs/withdraw.js b/clients/libs/nodejs/withdraw.js similarity index 85% rename from clients/nodejs/withdraw.js rename to clients/libs/nodejs/withdraw.js index a7cb4aea..2177825f 100644 --- a/clients/nodejs/withdraw.js +++ b/clients/libs/nodejs/withdraw.js @@ -1,10 +1,9 @@ -const mercury_wasm = require('mercury-wasm'); const sqlite_manager = require('./sqlite_manager'); const utils = require('./utils'); const transaction = require('./transaction'); const { CoinStatus } = require('./coin_enum'); -const execute = async (electrumClient, db, walletName, statechainId, toAddress, feeRate) => { +const execute = async (clientConfig, electrumClient, db, walletName, statechainId, toAddress, feeRate) => { let wallet = await sqlite_manager.getWallet(db, walletName); const backupTxs = await sqlite_manager.getBackupTxs(db, statechainId); @@ -16,7 +15,7 @@ const execute = async (electrumClient, db, walletName, statechainId, toAddress, const new_tx_n = backupTxs.length + 1; if (!feeRate) { - const serverInfo = await utils.infoConfig(electrumClient); + const serverInfo = await utils.infoConfig(clientConfig, electrumClient); const feeRateSatsPerByte = serverInfo.fee_rate_sats_per_byte; feeRate = feeRateSatsPerByte; } else { @@ -43,7 +42,7 @@ const execute = async (electrumClient, db, walletName, statechainId, toAddress, const isWithdrawal = true; const qtBackupTx = backupTxs.length; - let signed_tx = await transaction.new_transaction(electrumClient, coin, toAddress, isWithdrawal, qtBackupTx, null, wallet.network); + let signed_tx = await transaction.new_transaction(clientConfig, electrumClient, coin, toAddress, isWithdrawal, qtBackupTx, null, wallet.network); let backup_tx = { tx_n: new_tx_n, @@ -76,7 +75,7 @@ const execute = async (electrumClient, db, walletName, statechainId, toAddress, await sqlite_manager.updateWallet(db, wallet); - utils.completeWithdraw(coin.statechain_id, coin.signed_statechain_id); + utils.completeWithdraw(clientConfig, coin.statechain_id, coin.signed_statechain_id); return txid; } diff --git a/clients/nodejs/client_config.js b/clients/nodejs/client_config.js new file mode 100644 index 00000000..48144be0 --- /dev/null +++ b/clients/nodejs/client_config.js @@ -0,0 +1,16 @@ +const config = require('config'); + +const load = () => { + return { + confirmationTarget: config.get('confirmationTarget'), + statechainEntity: config.get('statechainEntity'), + torProxy: config.get('torProxy'), + databaseFile: config.get('databaseFile'), + electrumServer: config.get('electrumServer'), + feeRateTolerance: config.get('feeRateTolerance'), + network: config.get('network'), + electrumType: config.get('electrumType') + } +} + +module.exports = { load }; diff --git a/clients/nodejs/index.js b/clients/nodejs/index.js index ba9391d4..1ea33018 100644 --- a/clients/nodejs/index.js +++ b/clients/nodejs/index.js @@ -1,42 +1,12 @@ const { Command } = require('commander'); const program = new Command(); -const mercury_wasm = require('mercury-wasm'); - -const ElectrumCli = require('@mempool/electrum-client'); - -const deposit = require('./deposit'); -const broadcast_backup_tx = require('./broadcast_backup_tx'); -const withdraw = require('./withdraw'); -const transfer_receive = require('./transfer_receive'); -const transfer_send = require('./transfer_send'); -const coin_status = require('./coin_status'); - -const sqlite3 = require('sqlite3').verbose(); - -const sqlite_manager = require('./sqlite_manager'); - -const { v4: uuidv4 } = require('uuid'); - -const wallet_manager = require('./wallet'); - -const config = require('config'); +const mercurynodejslib = require('mercurynodejslib'); +const client_config = require('./client_config'); async function main() { - const db = new sqlite3.Database('wallet.db'); - - await sqlite_manager.createTables(db); - - const urlElectrum = config.get('electrumServer'); - const urlElectrumObject = new URL(urlElectrum); - - const electrumPort = parseInt(urlElectrumObject.port, 10); - const electrumHostname = urlElectrumObject.hostname; - const electrumProtocol = urlElectrumObject.protocol.slice(0, -1); - - const electrumClient = new ElectrumCli(electrumPort, electrumHostname, electrumProtocol); - await electrumClient.connect(); + const clientConfig = client_config.load(); program .name('Statechain nodejs CLI client') @@ -48,14 +18,10 @@ async function main() { .argument('', 'name of the wallet') .action(async (name) => { - let wallet = await wallet_manager.createWallet(name, config, electrumClient); - - await sqlite_manager.insertWallet(db, wallet); + let wallet = await mercurynodejslib.createWallet(clientConfig, name); console.log(JSON.stringify(wallet, null, 2)); - - electrumClient.close(); - db.close(); + }); program.command('new-token') @@ -63,11 +29,9 @@ async function main() { .argument('', 'name of the wallet') .action(async (wallet_name) => { - const token = await deposit.getToken(db, wallet_name); + const token = await mercurynodejslib.newToken(clientConfig, wallet_name); console.log(JSON.stringify(token, null, 2)); - electrumClient.close(); - db.close(); }); program.command('list-tokens') @@ -75,13 +39,10 @@ async function main() { .argument('', 'name of the wallet') .action(async (wallet_name) => { - let wallet = await sqlite_manager.getWallet(db, wallet_name); + let tokens = await mercurynodejslib.getWalletTokens(clientConfig, wallet_name); - console.log(JSON.stringify(wallet.tokens, null, 2)); + console.log(JSON.stringify(tokens, null, 2)); - electrumClient.close(); - db.close(); - }); program.command('new-deposit-address') @@ -90,12 +51,9 @@ async function main() { .argument('', 'amount to deposit') .action(async (wallet_name, amount) => { - const address_info = await deposit.getDepositBitcoinAddress(db, wallet_name, amount); + const address_info = await mercurynodejslib.getDepositBitcoinAddress(clientConfig, wallet_name, amount); console.log(JSON.stringify(address_info, null, 2)); - - electrumClient.close(); - db.close(); }); program.command('broadcast-backup-transaction') @@ -106,14 +64,9 @@ async function main() { .option('-f, --fee_rate ', '(optional) fee rate in satoshis per byte') .action(async (wallet_name, statechain_id, to_address, options) => { - await coin_status.updateCoins(electrumClient, db, wallet_name); - - let tx_ids = await broadcast_backup_tx.execute(electrumClient, db, wallet_name, statechain_id, to_address, options.fee_rate); + let tx_ids = await mercurynodejslib.broadcastBackupTransaction(clientConfig, wallet_name, statechain_id, to_address, options); console.log(JSON.stringify(tx_ids, null, 2)); - - electrumClient.close(); - db.close(); }); program.command('list-statecoins') @@ -121,23 +74,9 @@ async function main() { .argument('', 'name of the wallet') .action(async (wallet_name) => { - await coin_status.updateCoins(electrumClient, db, wallet_name); - - let wallet = await sqlite_manager.getWallet(db, wallet_name); - - let coins = wallet.coins.map(coin => ({ - statechain_id: coin.statechain_id, - amount: coin.amount, - status: coin.status, - adress: coin.address, - locktime: coin.locktime - })); + let coins = await mercurynodejslib.listStatecoins(clientConfig, wallet_name); console.log(JSON.stringify(coins, null, 2)); - - electrumClient.close(); - db.close(); - }); program.command('withdraw') @@ -148,16 +87,11 @@ async function main() { .option('-f, --fee_rate ', '(optional) fee rate in satoshis per byte') .action(async (wallet_name, statechain_id, to_address, options) => { - await coin_status.updateCoins(electrumClient, db, wallet_name); - - const txid = await withdraw.execute(electrumClient, db, wallet_name, statechain_id, to_address, options.fee_rate); + const txid = await mercurynodejslib.withdrawCoin(clientConfig, wallet_name, statechain_id, to_address, options); console.log(JSON.stringify({ txid }, null, 2)); - - electrumClient.close(); - db.close(); }); program.command('new-transfer-address') @@ -166,18 +100,9 @@ async function main() { .option('-b, --generate-batch-id', 'optional batch id for the transaction') .action(async (wallet_name, options) => { - const addr = await transfer_receive.newTransferAddress(db, wallet_name) - let res = {transfer_receive: addr}; - - if (options.generateBatchId) { - const batchId = uuidv4(); - res.batch_id = batchId; - } + let res = await mercurynodejslib.newTransferAddress(clientConfig, wallet_name, options); console.log(JSON.stringify(res, null, 2)); - - electrumClient.close(); - db.close(); }); program.command('transfer-send') @@ -188,16 +113,9 @@ async function main() { .option('-b, --batch-id ', 'optional batch id for the transaction') .action(async (wallet_name, statechain_id, to_address, options) => { - let batchId = options.batchId || null; - - await coin_status.updateCoins(electrumClient, db, wallet_name); - - let coin = await transfer_send.execute(electrumClient, db, wallet_name, statechain_id, to_address, batchId); + let coin = await mercurynodejslib.transferSend(clientConfig, wallet_name, statechain_id, to_address, options); console.log(JSON.stringify(coin, null, 2)); - - electrumClient.close(); - db.close(); }); program.command('transfer-receive') @@ -205,14 +123,9 @@ async function main() { .argument('', 'name of the wallet') .action(async (wallet_name) => { - await coin_status.updateCoins(electrumClient, db, wallet_name); - - let received_statechain_ids = await transfer_receive.execute(electrumClient, db, wallet_name); + let received_statechain_ids = await mercurynodejslib.transferReceive(clientConfig, wallet_name); console.log(JSON.stringify(received_statechain_ids, null, 2)); - - electrumClient.close(); - db.close(); }); program.parse(); diff --git a/clients/nodejs/test_basic_workflow.js b/clients/nodejs/test_basic_workflow.js index 066f14d7..d851a379 100644 --- a/clients/nodejs/test_basic_workflow.js +++ b/clients/nodejs/test_basic_workflow.js @@ -1,7 +1,7 @@ const util = require('node:util'); const exec = util.promisify(require('node:child_process').exec); const assert = require('node:assert/strict'); -const { CoinStatus } = require('./coin_enum'); +const { CoinStatus } = require('mercurynodejslib/coin_enum'); const c = require('config'); async function lsExample() { @@ -105,6 +105,7 @@ async function walletTransfersToItselfAndWithdraw(wallet_name) { assert(usedToken.spent); + deposit_info["amount"] = amount; console.log("deposit_coin: ", deposit_info); let coin = undefined; @@ -171,6 +172,7 @@ async function walletTransfersToAnotherAndBroadcastsBackupTx(wallet_1_name, wall const deposit_info = await getDepositBitcoinAddress(wallet_1_name, amount); + deposit_info["amount"] = amount; console.log("deposit_info w1: ", deposit_info); let tokenList = await listTokens(wallet_1_name);