diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml new file mode 100644 index 00000000..f445c921 --- /dev/null +++ b/.github/workflows/tests.yml @@ -0,0 +1,86 @@ +name: Integration Tests + +on: + push: + branches: + - dev + - dev2 + pull_request: + branches: + - dev + - dev2 + +jobs: + test: + runs-on: ubuntu-latest + + services: + docker: + image: docker:19.03.12 + options: --privileged + ports: + - 5432:5432 + - 18443:18443 + - 50001:50001 + - 8080:8080 + - 18080:18080 + volumes: + - /var/run/docker.sock:/var/run/docker.sock + + steps: + - name: Checkout code + uses: actions/checkout@v2 + + - name: Set up Docker Compose + run: | + docker-compose -f docker-compose-test.yml up --build -d + + - name: Wait for services to be ready + run: | + sleep 5 # Adjust time as necessary for services to initialize + + - name: Add Mnemonic + run: | + docker exec $(docker ps -qf "name=enclave") \ + curl -X POST http://0.0.0.0:18080/add_mnemonic \ + -H "Content-Type: application/json" \ + -d '{ + "mnemonic": "achieve merry hidden lyrics element brand student armed dismiss vague fury avocado grief crazy garlic gallery blur spider bag bless motor crawl surround copper", + "password": "b1gHKyfXTzs6", + "index": 0, + "threshold": 2 + }' + + - name: Set up Node.js + uses: actions/setup-node@v2 + with: + node-version: '20.12.2' + + - name: Install Node.js dependencies for client + run: | + cd clients/nodejs + npm install + + - name: Install Node.js dependencies for lib + run: | + cd clients/libs/nodejs + npm install + + - name: Run npm link + run: | + cd clients/libs/nodejs + npm link + + - name: Link mercurynodejslib + run: | + cd clients/nodejs + npm link mercurynodejslib + + - name: Run Client-Side Tests + run: | + cd clients/apps/nodejs + node test_basic_workflow2.js + + - name: Tear Down + run: | + docker-compose down diff --git a/clients/libs/nodejs/.gitignore b/clients/libs/nodejs/.gitignore deleted file mode 100644 index faae5bbe..00000000 --- a/clients/libs/nodejs/.gitignore +++ /dev/null @@ -1,133 +0,0 @@ -# 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/libs/nodejs/broadcast_backup_tx.js b/clients/libs/nodejs/broadcast_backup_tx.js deleted file mode 100644 index adb7b4f6..00000000 --- a/clients/libs/nodejs/broadcast_backup_tx.js +++ /dev/null @@ -1,68 +0,0 @@ -const mercury_wasm = require('mercury-wasm'); - -const sqlite_manager = require('./sqlite_manager'); - -const utils = require('./utils'); - -const { CoinStatus } = require('./coin_enum'); - -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(clientConfig, electrumClient); - const feeRateSatsPerByte = serverInfo.fee_rate_sats_per_byte; - feeRate = feeRateSatsPerByte; - } else { - feeRate = parseInt(feeRate, 10); - } - - let backupTxs = await sqlite_manager.getBackupTxs(db, statechainId); - - let coinsWithStatechainId = wallet.coins.filter(c => { - return c.statechain_id === statechainId - }); - - if (!coinsWithStatechainId) { - throw new Error(`There is no coin for the statechain id ${statechainId}`); - } - - // If the user sends to himself, he will have two coins with same statechain_id - // In this case, we need to find the one with the lowest locktime - // Sort the coins by locktime in ascending order and pick the first one - let coin = coinsWithStatechainId.sort((a, b) => a.locktime - b.locktime)[0]; - - if (coin.status != CoinStatus.CONFIRMED && coin.status != CoinStatus.IN_TRANSFER) { - throw new Error(`Coin status must be CONFIRMED or IN_TRANSFER to transfer it. The current status is ${coin.status}`); - } - - const backupTx = mercury_wasm.latestBackuptxPaysToUserpubkey(backupTxs, coin, wallet.network); - - if (!backupTx) { - throw new Error(`There is no backup transaction for the statechain id ${statechainId}`); - } - - const CpfpTx = mercury_wasm.createCpfpTx(backupTx, coin, toAddress, feeRate, wallet.network); - - let backupTxTxid = await electrumClient.request('blockchain.transaction.broadcast', [backupTx.tx]); - // console.log(`Broadcasting backup transaction: ${backupTxTxid}`); - - let cpfpTxTxid = await electrumClient.request('blockchain.transaction.broadcast', [CpfpTx]); - // console.log(`Broadcasting CPFP transaction: ${cpfpTxTxid}`); - - coin.tx_cpfp = cpfpTxTxid; - coin.withdrawal_address = toAddress; - coin.status = CoinStatus.WITHDRAWING; - - await sqlite_manager.updateWallet(db, wallet); - - utils.completeWithdraw(clientConfig, coin.statechain_id, coin.signed_statechain_id); - - return { - backupTx: backupTxTxid, - cpfpTx: cpfpTxTxid - }; -} - -module.exports = { execute }; \ No newline at end of file diff --git a/clients/libs/nodejs/coin_enum.js b/clients/libs/nodejs/coin_enum.js deleted file mode 100644 index ba5ceeeb..00000000 --- a/clients/libs/nodejs/coin_enum.js +++ /dev/null @@ -1,13 +0,0 @@ - -const CoinStatus = { - INITIALISED: "INITIALISED", // address generated but no Tx0 yet - IN_MEMPOOL: "IN_MEMPOOL", // Tx0 in mempool - UNCONFIRMED: "UNCONFIRMED", // Tx0 confirmed but coin not available to be sent - CONFIRMED: "CONFIRMED", // Tx0 confirmed and coin available to be sent - IN_TRANSFER: "IN_TRANSFER", // transfer-sender performed, but receiver hasn't completed transfer-receiver - WITHDRAWING: "WITHDRAWING", // withdrawal tx signed and broadcast but not yet confirmed - TRANSFERRED: "TRANSFERRED", // the coin was transferred - WITHDRAWN: "WITHDRAWN", // the coin was withdrawn -}; - -module.exports = { CoinStatus }; \ No newline at end of file diff --git a/clients/libs/nodejs/coin_status.js b/clients/libs/nodejs/coin_status.js deleted file mode 100644 index 26e453f2..00000000 --- a/clients/libs/nodejs/coin_status.js +++ /dev/null @@ -1,205 +0,0 @@ - -const sqlite_manager = require('./sqlite_manager'); -const utils = require('./utils'); -const bitcoinjs = require("bitcoinjs-lib"); -const ecc = require("tiny-secp256k1"); -const deposit = require('./deposit'); -const { CoinStatus } = require('./coin_enum'); -const mercury_wasm = require('mercury-wasm'); - -const checkDeposit = async (clientConfig, electrumClient, coin, wallet_network) => { - - if (!coin.statechain_id && !coin.utxo_txid && !coin.utxo_vout) { - if (coin.status != CoinStatus.INITIALISED) { - throw new Error(`Coin does not have a statechain ID, a UTXO and the status is not INITIALISED`); - } else { - return null; - } - } - - bitcoinjs.initEccLib(ecc); - - const network = utils.getNetwork(wallet_network); - - let script = bitcoinjs.address.toOutputScript(coin.aggregated_address, network); - let hash = bitcoinjs.crypto.sha256(script); - let reversedHash = Buffer.from(hash.reverse()); - reversedHash = reversedHash.toString('hex'); - - let utxo = null; - - let utxo_list = await electrumClient.request('blockchain.scripthash.listunspent', [reversedHash]); - - for (let unspent of utxo_list) { - if (unspent.value === coin.amount) { - utxo = unspent; - break; - } - } - - // No deposit found. No change in the coin status - if (!utxo) { - return null; - } - - // IN_MEMPOOL. there is nothing to do - if (utxo.height == 0 && coin.status == CoinStatus.IN_MEMPOOL) { - return null; - } - - let depositResult = null; - - if (coin.status == CoinStatus.INITIALISED) { - const utxo_txid = utxo.tx_hash; - const utxo_vout = utxo.tx_pos; - - const backup_tx = await deposit.createTx1(clientConfig, electrumClient, coin, wallet_network, utxo_txid, utxo_vout); - - const activity_utxo = `${utxo_txid}:${utxo_vout}`; - - const activity = utils.createActivity(activity_utxo, coin.amount, "Deposit"); - - depositResult = { - activity, - backup_tx - }; - } - - if (utxo.height > 0) { - - const block_header = await electrumClient.request('blockchain.headers.subscribe'); - const blockheight = block_header.height; - - const confirmations = blockheight - utxo.height + 1; - - const confirmationTarget = clientConfig.confirmationTarget; - - coin.status = CoinStatus.UNCONFIRMED; - - if (confirmations >= confirmationTarget) { - coin.status = CoinStatus.CONFIRMED; - } - } - - return depositResult; -} - -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(clientConfig, coin.statechain_id); - - // if the statechain info is not found, we assume the coin has been transferred - if (!statechainInfo) { - return true; - } - - let enclavePublicKey = statechainInfo.enclave_public_key; - - let isTransferred = !mercury_wasm.isEnclavePubkeyPartOfCoin(coin, enclavePublicKey); - - return isTransferred; -} - -const checkWithdrawal = async (clientConfig, electrumClient, coin, wallet_network) => { - - let txid = undefined; - - if (coin.tx_withdraw) { - txid = coin.tx_withdraw; - } - - if (coin.tx_cpfp) { - if (txid) { - throw new Error(`Coin ${coin.aggregated_address} has both tx_withdraw and tx_cpfp`); - } - txid = coin.tx_cpfp; - } - - if (!txid) { - throw new Error(`Coin ${coin.aggregated_address} has neither tx_withdraw nor tx_cpfp`); - } - - if (!coin.withdrawal_address) { - throw new Error(`Coin ${coin.aggregated_address} has no withdrawal_address`); - } - - bitcoinjs.initEccLib(ecc); - - const network = utils.getNetwork(wallet_network); - - let script = bitcoinjs.address.toOutputScript(coin.withdrawal_address, network); - let hash = bitcoinjs.crypto.sha256(script); - let reversedHash = Buffer.from(hash.reverse()); - reversedHash = reversedHash.toString('hex'); - - let utxo = undefined; - - let utxo_list = await electrumClient.request('blockchain.scripthash.listunspent', [reversedHash]); - - for (let unspent of utxo_list) { - if (unspent.tx_hash === txid) { - utxo = unspent; - break; - } - } - - if (!utxo) { - // sometimes the transaction has not yet been transmitted to the specified Electrum server - // throw new Error(`There is no UTXO with the address ${coin.withdrawal_address} and the txid ${txid}`); - return false; - } - - if (utxo.height > 0) { - const block_header = await electrumClient.request('blockchain.headers.subscribe'); - const blockheight = block_header.height; - - const confirmations = blockheight - utxo.height + 1; - - const confirmationTarget = clientConfig.confirmationTarget; - - return confirmations >= confirmationTarget; - } - - return false; -} - -const updateCoins = async (clientConfig, electrumClient, db, wallet_name) => { - - let wallet = await sqlite_manager.getWallet(db, wallet_name); - - const network = wallet.network; - - for (let i = 0; i < wallet.coins.length; i++) { - let coin = wallet.coins[i]; - - if (coin.status == CoinStatus.INITIALISED || coin.status == CoinStatus.IN_MEMPOOL || coin.status == CoinStatus.UNCONFIRMED) { - - 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(clientConfig, coin); - - if (is_transferred) { - coin.status = CoinStatus.TRANSFERRED; - } - } else if (coin.status == CoinStatus.WITHDRAWING) { - let is_withdrawn = await checkWithdrawal(clientConfig, electrumClient, coin, network); - - if (is_withdrawn) { - coin.status = CoinStatus.WITHDRAWN; - } - } - } - - await sqlite_manager.updateWallet(db, wallet); -} - -module.exports = { updateCoins }; \ No newline at end of file diff --git a/clients/libs/nodejs/deposit.js b/clients/libs/nodejs/deposit.js deleted file mode 100644 index 46978656..00000000 --- a/clients/libs/nodejs/deposit.js +++ /dev/null @@ -1,156 +0,0 @@ -const axios = require('axios').default; -const { SocksProxyAgent } = require('socks-proxy-agent'); -const transaction = require('./transaction'); - -const mercury_wasm = require('mercury-wasm'); - -const sqlite_manager = require('./sqlite_manager'); - -const { CoinStatus } = require('./coin_enum'); - -const getDepositBitcoinAddress = async (clientConfig, db, wallet_name, amount) => { - - let wallet = await sqlite_manager.getWallet(db, wallet_name); - - let foundToken = wallet.tokens.find(token => token.confirmed === true && token.spent === false); - - if (!foundToken) { - throw new Error(`There is no token available`); - } - - await init(clientConfig, db, wallet, foundToken.token_id); - - let coin = wallet.coins[wallet.coins.length - 1]; - - let aggregatedPublicKey = mercury_wasm.createAggregatedAddress(coin, wallet.network); - - coin.amount = parseInt(amount, 10); - coin.aggregated_address = aggregatedPublicKey.aggregate_address; - coin.aggregated_pubkey = aggregatedPublicKey.aggregate_pubkey; - - foundToken.spent = true; - - await sqlite_manager.updateWallet(db, wallet); - - return { "deposit_address": coin.aggregated_address, "statechain_id": coin.statechain_id }; -} - -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`); - } - - if ('utxo_txid' in coin && 'input_vout' in coin) { - throw new Error(`The coin with the aggregated address ${aggregated_address} has already been deposited`); - } - - coin.utxo_txid = tx0_hash; - coin.utxo_vout = tx0_vout; - coin.status = CoinStatus.IN_MEMPOOL; - - const toAddress = mercury_wasm.getUserBackupAddress(coin, wallet_network); - const isWithdrawal = false; - const qtBackupTx = 0; - - let signed_tx = await transaction.new_transaction(clientConfig, electrumClient, coin, toAddress, isWithdrawal, qtBackupTx, null, wallet_network); - - let backup_tx = { - tx_n: 1, - tx: signed_tx, - client_public_nonce: coin.public_nonce, - server_public_nonce: coin.server_public_nonce, - client_public_key: coin.user_pubkey, - server_public_key: coin.server_pubkey, - blinding_factor: coin.blinding_factor - }; - - coin.locktime = mercury_wasm.getBlockheight(backup_tx); - - return backup_tx; -} - -const init = async (clientConfig, db, wallet, token_id) => { - - let coin = mercury_wasm.getNewCoin(wallet); - - wallet.coins.push(coin); - - await sqlite_manager.updateWallet(db, wallet); - - // token_id = crypto.randomUUID().replace('-',''); - - let depositMsg1 = mercury_wasm.createDepositMsg1(coin, token_id); - - const statechain_entity_url = clientConfig.statechainEntity; - const path = "deposit/init/pod"; - const url = statechain_entity_url + '/' + path; - - const torProxy = clientConfig.torProxy; - - let socksAgent = undefined; - - if (torProxy) { - socksAgent = { httpAgent: new SocksProxyAgent(torProxy) }; - } - - const response = await axios.post(url, depositMsg1, socksAgent); - - if (response.status != 200) { - throw new Error(`Deposit error: ${response.data}`); - } - - let depositMsg1Response = response.data; - - let depositInitResult = mercury_wasm.handleDepositMsg1Response(coin, depositMsg1Response); - // console.log("depositInitResult:", depositInitResult); - - coin.statechain_id = depositInitResult.statechain_id; - coin.signed_statechain_id = depositInitResult.signed_statechain_id; - coin.server_pubkey = depositInitResult.server_pubkey; - - await sqlite_manager.updateWallet(db, wallet); -} - -const getTokenFromServer = async (clientConfig) => { - - const statechain_entity_url = clientConfig.statechainEntity; - const path = "tokens/token_init"; - const url = statechain_entity_url + '/' + path; - - const torProxy = clientConfig.torProxy; - - let socksAgent = undefined; - - if (torProxy) { - socksAgent = { httpAgent: new SocksProxyAgent(torProxy) }; - } - - const response = await axios.get(url, socksAgent); - - if (response.status != 200) { - throw new Error(`Token error: ${response.data}`); - } - - let token = response.data; - - return token; -} - -const getToken = async (clientConfig, db, walletName) => { - - let wallet = await sqlite_manager.getWallet(db, walletName); - - let token = await getTokenFromServer(clientConfig); - - // for dev purposes - token.confirmed = true; - - wallet.tokens.push(token); - - await sqlite_manager.updateWallet(db, wallet); - - return token; -} - -module.exports = { getDepositBitcoinAddress, createTx1, getToken }; \ No newline at end of file diff --git a/clients/libs/nodejs/package-lock.json b/clients/libs/nodejs/package-lock.json deleted file mode 100644 index dd6a915a..00000000 --- a/clients/libs/nodejs/package-lock.json +++ /dev/null @@ -1,1647 +0,0 @@ -{ - "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 deleted file mode 100644 index 955545c7..00000000 --- a/clients/libs/nodejs/package.json +++ /dev/null @@ -1,24 +0,0 @@ -{ - "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/libs/nodejs/sqlite_manager.js b/clients/libs/nodejs/sqlite_manager.js deleted file mode 100644 index 415ae9e6..00000000 --- a/clients/libs/nodejs/sqlite_manager.js +++ /dev/null @@ -1,66 +0,0 @@ -// Promisify the db.run method -const run = (db, sql, params) => { - return new Promise((resolve, reject) => { - db.run(sql, params, (err) => { - if (err) { - reject(err); - } else { - resolve(); - } - }); - }); -}; - -const createTables = async (db) => { - await run(db, "CREATE TABLE IF NOT EXISTS wallet (wallet_name TEXT NOT NULL UNIQUE, wallet_json TEXT NOT NULL)", []); - await run(db, "CREATE TABLE IF NOT EXISTS backup_txs (statechain_id TEXT NOT NULL, txs TEXT NOT NULL)", []); -} - -const insertWallet = async (db, wallet) => { - await run(db, "INSERT INTO wallet (wallet_name, wallet_json) VALUES (?, ?)", [ wallet.name, JSON.stringify(wallet) ]); -} - -const updateWallet = async (db, wallet) => { - await run(db, "UPDATE wallet SET wallet_json = ? WHERE wallet_name = ?", [ JSON.stringify(wallet), wallet.name ]); -} - -const getWallet = async (db, walletName) => { - return new Promise((resolve, reject) => { - db.get("SELECT wallet_json FROM wallet WHERE wallet_name = ?", [ walletName ], (err, row) => { - if (err) { - reject(err); - } else { - let wallet = JSON.parse(row.wallet_json); - resolve(wallet); - } - }); - }); -} - -const insertTransaction = async (db, statechain_id, txs) => { - await run(db, "INSERT INTO backup_txs (statechain_id, txs) VALUES (?, ?)", [ statechain_id, JSON.stringify(txs) ]); -} - -const updateTransaction = async (db, statechain_id, txs) => { - await run(db, "UPDATE backup_txs SET txs = ? WHERE statechain_id = ?", [ JSON.stringify(txs), statechain_id ]); -} - -const getBackupTxs = async (db, statechainId) => { - return new Promise((resolve, reject) => { - db.get("SELECT txs FROM backup_txs WHERE statechain_id = ?", [ statechainId ], (err, row) => { - if (err) { - reject(err); - } else { - let backupTxs = JSON.parse(row.txs); - resolve(backupTxs); - } - }); - }); -} - -const insertOrUpdateBackupTxs = async (db, statechain_id, txs) => { - await run(db, "DELETE FROM backup_txs WHERE statechain_id = ?", [ statechain_id]); - await run(db, "INSERT INTO backup_txs (statechain_id, txs) VALUES (?, ?)", [ statechain_id, JSON.stringify(txs) ]); -} - -module.exports = { createTables, insertWallet, updateWallet, getWallet, insertTransaction, updateTransaction, getBackupTxs, insertOrUpdateBackupTxs }; \ No newline at end of file diff --git a/clients/libs/nodejs/test_basic_workflow.js b/clients/libs/nodejs/test_basic_workflow.js new file mode 100644 index 00000000..35f7303c --- /dev/null +++ b/clients/libs/nodejs/test_basic_workflow.js @@ -0,0 +1,232 @@ +const util = require('node:util'); +const exec = util.promisify(require('node:child_process').exec); +const assert = require('node:assert/strict'); +const { CoinStatus } = require('mercurynodejslib/coin_enum'); + +async function removeDatabase() { + try { + const { stdout, stderr } = await exec('rm wallet.db'); + // console.log('stdout:', stdout); + // console.error('stderr:', stderr); + } catch (e) { + // console.error(e); + } +} + +async function createWallet(wallet_name) { + const { stdout, stderr } = await exec(`node index.js create-wallet ${wallet_name}`); + let wallet = JSON.parse(stdout); + assert.equal(wallet.name, wallet_name); + // console.log('wallet:', wallet); +} + +async function newToken(wallet_name) { + const { stdout, stderr } = await exec(`node index.js new-token ${wallet_name}`); + let json = JSON.parse(stdout); + return json; +} + +async function listTokens(wallet_name) { + const { stdout, stderr } = await exec(`node index.js list-tokens ${wallet_name}`); + let json = JSON.parse(stdout); + return json; +} + +async function getDepositBitcoinAddress(wallet_name, token_id, amount) { + const { stdout, stderr } = await exec(`node index.js new-deposit-address ${wallet_name} ${token_id} ${amount}`); + let json = JSON.parse(stdout); + return json; +} + +async function listStatecoins(wallet_name) { + try { + const { stdout, stderr } = await exec(`node index.js list-statecoins ${wallet_name}`); + let json = JSON.parse(stdout); + return json; + } catch (e) { + console.log('e:', e); + return undefined; + } +} + +async function newTransferAddress(wallet_name) { + const { stdout, stderr } = await exec(`node index.js new-transfer-address ${wallet_name}`); + let json = JSON.parse(stdout); + return json.transfer_receive; +} + +async function transferSend(wallet_name, statechain_id, to_address) { + const { stdout, stderr } = await exec(`node index.js transfer-send ${wallet_name} ${statechain_id} ${to_address}`); + let json = JSON.parse(stdout); + return json; +} + +async function transferReceive(wallet_name) { + const { stdout, stderr } = await exec(`node index.js transfer-receive ${wallet_name}`); + let json = JSON.parse(stdout); + return json; +} + +async function withdraw(wallet_name, statechain_id, to_address) { + const { stdout, stderr } = await exec(`node index.js withdraw ${wallet_name} ${statechain_id} ${to_address}`); + let json = JSON.parse(stdout); + return json.txid; +} + +async function broadcastBackupTransaction(wallet_name, statechain_id, to_address) { + const { stdout, stderr } = await exec(`node index.js broadcast-backup-transaction ${wallet_name} ${statechain_id} ${to_address}`); + let json = JSON.parse(stdout); + return json; +} + +const sleep = (ms) => { + return new Promise(resolve => setTimeout(resolve, ms)); +} + +async function walletTransfersToItselfAndWithdraw(wallet_name) { + + const amount = 10000; + + const token = await newToken(wallet_name); + const tokenId = token.token_id; + + const deposit_info = await getDepositBitcoinAddress(wallet_name, amount); + + let tokenList = await listTokens(wallet_name); + + let usedToken = tokenList.find(token => token.token_id === tokenId); + + assert(usedToken.spent); + + deposit_info["amount"] = amount; + console.log("deposit_coin: ", deposit_info); + + let coin = undefined; + + while (!coin) { + const list_coins = await listStatecoins(wallet_name); + + let coinsWithStatechainId = list_coins.filter(c => { + return c.statechain_id === deposit_info.statechain_id && c.status === CoinStatus.CONFIRMED; + }); + + if (coinsWithStatechainId.length === 0) { + console.log("Waiting for coin to be confirmed..."); + console.log(`Check the address ${deposit_info.deposit_address} ...\n`); + await sleep(5000); + continue; + } + + coin = coinsWithStatechainId[0]; + + break; + } + + console.log("coin: ", coin); + + for (let i = 0; i < 10; i++) { + + let transfer_address = await newTransferAddress(wallet_name); + + console.log("transfer_address: ", transfer_address); + + coin = await transferSend(wallet_name, coin.statechain_id, transfer_address); + + console.log("coin transferSend: ", coin); + + let received_statechain_ids = await transferReceive(wallet_name); + + console.log("received_statechain_ids: ", received_statechain_ids); + + assert(received_statechain_ids.length > 0); + assert(received_statechain_ids[0] == coin.statechain_id); + } + + let withdraw_address = "tb1qwrujs6f4gyexsextpf9p50smjtht7p7ypknteu"; + + let txid = await withdraw(wallet_name, coin.statechain_id, withdraw_address); + + console.log("txid: ", txid); + +}; + +async function walletTransfersMultipleTimesToItselfAndBroadcastsBackup(wallet_name) { + for (let i = 0; i < 3; i++) { + await walletTransfersToItselfAndWithdraw(wallet_name); + } +} + +async function walletTransfersToAnotherAndBroadcastsBackupTx(wallet_1_name, wallet_2_name) { + + const amount = 10000; + + const token = await newToken(wallet_1_name); + const tokenId = token.token_id; + + 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); + + let usedToken = tokenList.find(token => token.token_id === tokenId); + + console.log("usedToken: ", usedToken); + + assert(usedToken.spent); + + let coin = undefined; + + while (!coin) { + const list_coins = await listStatecoins(wallet_1_name); + + let coinsWithStatechainId = list_coins.filter(c => { + return c.statechain_id === deposit_info.statechain_id && c.status === CoinStatus.CONFIRMED; + }); + + if (coinsWithStatechainId.length === 0) { + console.log("Waiting for coin to be confirmed..."); + console.log(`Check the address ${deposit_info.deposit_address} ...\n`); + await sleep(5000); + continue; + } + + coin = coinsWithStatechainId[0]; + + break; + } + + let transfer_address = await newTransferAddress(wallet_2_name); + + coin = await transferSend(wallet_1_name, coin.statechain_id, transfer_address); + + let received_statechain_ids = await transferReceive(wallet_2_name); + + console.log("received_statechain_ids: ", received_statechain_ids); + + assert(received_statechain_ids.length > 0); + assert(received_statechain_ids[0] == coin.statechain_id); + + let withdraw_address = "tb1qwrujs6f4gyexsextpf9p50smjtht7p7ypknteu"; + + let txids = await broadcastBackupTransaction(wallet_2_name, received_statechain_ids[0], withdraw_address); + + console.log("txids: ", txids); + +} + +(async () => { + let wallet_1_name = "w1"; + let wallet_2_name = "w2"; + + await removeDatabase(); + await createWallet(wallet_1_name); + await createWallet(wallet_2_name); + + await walletTransfersMultipleTimesToItselfAndBroadcastsBackup(wallet_1_name); + + await walletTransfersToAnotherAndBroadcastsBackupTx(wallet_1_name, wallet_2_name) + + await removeDatabase(); +})(); diff --git a/clients/libs/nodejs/transaction.js b/clients/libs/nodejs/transaction.js deleted file mode 100644 index 1594b88b..00000000 --- a/clients/libs/nodejs/transaction.js +++ /dev/null @@ -1,109 +0,0 @@ -const axios = require('axios').default; -const { SocksProxyAgent } = require('socks-proxy-agent'); -const mercury_wasm = require('mercury-wasm'); -const utils = require('./utils'); - -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(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(clientConfig, electrumClient); - - let new_block_height = 0; - if (block_height == null) { - const block_header = await electrumClient.request('blockchain.headers.subscribe'); // request(promise) - new_block_height = block_header.height; - } else { - new_block_height = block_height; - } - - const initlock = serverInfo.initlock; - const interval = serverInfo.interval; - const feeRateSatsPerByte = serverInfo.fee_rate_sats_per_byte; - - let partialSigRequest = mercury_wasm.getPartialSigRequest( - coin, - new_block_height, - initlock, - interval, - feeRateSatsPerByte, - qtBackupTx, - toAddress, - network, - isWithdrawal); - - const serverPartialSigRequest = partialSigRequest.partial_signature_request_payload; - - const serverPartialSig = await signSecond(clientConfig, serverPartialSigRequest); - - const clientPartialSig = partialSigRequest.client_partial_sig; - const msg = partialSigRequest.msg; - const session = partialSigRequest.encoded_session; - const outputPubkey = partialSigRequest.output_pubkey; - - const signature = mercury_wasm.createSignature(msg, clientPartialSig, serverPartialSig, session, outputPubkey); - - const encodedUnsignedTx = partialSigRequest.encoded_unsigned_tx; - - const signed_tx = mercury_wasm.newBackupTransaction(encodedUnsignedTx, signature); - - return signed_tx; -} - -const signFirst = async (clientConfig, signFirstRequestPayload) => { - - const statechain_entity_url = clientConfig.statechainEntity; - const path = "sign/first"; - const url = statechain_entity_url + '/' + path; - - const torProxy = clientConfig.torProxy; - - let socksAgent = undefined; - - if (torProxy) { - socksAgent = { httpAgent: new SocksProxyAgent(torProxy) }; - } - - let response = await axios.post(url, signFirstRequestPayload, socksAgent); - - let server_pubnonce_hex = response.data.server_pubnonce; - - if (server_pubnonce_hex.startsWith("0x")) { - server_pubnonce_hex = server_pubnonce_hex.substring(2); - } - - return server_pubnonce_hex; -} - -const signSecond = async (clientConfig, partialSigRequest) => { - - const statechain_entity_url = clientConfig.statechainEntity; - const path = "sign/second"; - const url = statechain_entity_url + '/' + path; - - const torProxy = clientConfig.torProxy; - - let socksAgent = undefined; - - if (torProxy) { - socksAgent = { httpAgent: new SocksProxyAgent(torProxy) }; - } - - let response = await axios.post(url, partialSigRequest, socksAgent); - - let server_partial_sig_hex = response.data.partial_sig; - - if (server_partial_sig_hex.startsWith("0x")) { - server_partial_sig_hex = server_partial_sig_hex.substring(2); - } - - return server_partial_sig_hex; -} - -module.exports = { signFirst, signSecond, new_transaction }; \ No newline at end of file diff --git a/clients/libs/nodejs/transfer_receive.js b/clients/libs/nodejs/transfer_receive.js deleted file mode 100644 index aa57c7e7..00000000 --- a/clients/libs/nodejs/transfer_receive.js +++ /dev/null @@ -1,361 +0,0 @@ -const sqlite_manager = require('./sqlite_manager'); -const mercury_wasm = require('mercury-wasm'); -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 { CoinStatus } = require('./coin_enum'); - -const newTransferAddress = async (db, wallet_name) => { - - let wallet = await sqlite_manager.getWallet(db, wallet_name); - - let coin = mercury_wasm.getNewCoin(wallet); - - wallet.coins.push(coin); - - await sqlite_manager.updateWallet(db, wallet); - - return coin.address; -} - -const execute = async (clientConfig, electrumClient, db, wallet_name) => { - - let wallet = await sqlite_manager.getWallet(db, wallet_name); - - const serverInfo = await utils.infoConfig(clientConfig, electrumClient); - - let uniqueAuthPubkeys = new Set(); - - wallet.coins.forEach(coin => { - uniqueAuthPubkeys.add(coin.auth_pubkey); - }); - - let encMsgsPerAuthPubkey = new Map(); - - for (let authPubkey of uniqueAuthPubkeys) { - try { - let encMessages = await getMsgAddr(clientConfig, authPubkey); - if (encMessages.length === 0) { - // console.log("No messages"); - continue; - } - - encMsgsPerAuthPubkey.set(authPubkey, encMessages); - } catch (err) { - // console.error(err); - } - } - - let receivedStatechainIds = []; - - let tempCoins = [...wallet.coins]; - let tempActivities = [...wallet.activities]; - - for (let [authPubkey, encMessages] of encMsgsPerAuthPubkey.entries()) { - - for (let encMessage of encMessages) { - - let coin = tempCoins.find(coin => coin.auth_pubkey === authPubkey && coin.status === 'INITIALISED'); - - if (coin) { - try { - 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}`); - continue; - } - - } else { - try { - let newCoin = await mercury_wasm.duplicateCoinToInitializedState(wallet, authPubkey); - - if (newCoin) { - let statechainIdAdded = await processEncryptedMessage(clientConfig, electrumClient, db, newCoin, encMessage, wallet.network, serverInfo, tempActivities); - - if (statechainIdAdded) { - tempCoins.push(newCoin); - receivedStatechainIds.push(statechainIdAdded); - } - } - } catch (error) { - // console.error(`Error: ${error.message}`); - continue; - } - } - } - } - - wallet.coins = [...tempCoins]; - wallet.activities = [...tempActivities]; - - await sqlite_manager.updateWallet(db, wallet); - - return receivedStatechainIds; -} - -const getMsgAddr = async (clientConfig, auth_pubkey) => { - - const statechain_entity_url = clientConfig.statechainEntity; - const path = "transfer/get_msg_addr/"; - const url = statechain_entity_url + '/' + path + auth_pubkey; - - const torProxy = clientConfig.torProxy; - - let socksAgent = undefined; - - if (torProxy) { - socksAgent = { httpAgent: new SocksProxyAgent(torProxy) }; - } - - const response = await axios.get(url, socksAgent); - - return response.data.list_enc_transfer_msg; -} - -const processEncryptedMessage = async (clientConfig, electrumClient, db, coin, encMessage, network, serverInfo, activities) => { - let clientAuthKey = coin.auth_privkey; - let newUserPubkey = coin.user_pubkey; - - let transferMsg = mercury_wasm.decryptTransferMsg(encMessage, clientAuthKey); - - let tx0Outpoint = mercury_wasm.getTx0Outpoint(transferMsg.backup_transactions); - - const tx0Hex = await getTx0(electrumClient, tx0Outpoint.txid); - - const isTransferSignatureValid = mercury_wasm.verifyTransferSignature(newUserPubkey, tx0Outpoint, transferMsg); - - if (!isTransferSignatureValid) { - throw new Error("Invalid transfer signature"); - } - - const statechainInfo = await utils.getStatechainInfo(clientConfig, transferMsg.statechain_id); - - if (statechainInfo == null) { - throw new Error("Statechain info not found"); - } - - const isTx0OutputPubkeyValid = mercury_wasm.validateTx0OutputPubkey(statechainInfo.enclave_public_key, transferMsg, tx0Outpoint, tx0Hex, network); - - if (!isTx0OutputPubkeyValid) { - throw new Error("Invalid tx0 output pubkey"); - } - - let latestBackupTxPaysToUserPubkey = mercury_wasm.verifyLatestBackupTxPaysToUserPubkey(transferMsg, newUserPubkey, network); - - if (!latestBackupTxPaysToUserPubkey) { - throw new Error("Latest Backup Tx does not pay to the expected public key"); - } - - if (statechainInfo.num_sigs != transferMsg.backup_transactions.length) { - throw new Error("num_sigs is not correct"); - } - - 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 = clientConfig.feeRateTolerance; - - let previousLockTime = null; - - let sigSchemeValidation = true; - - for (const [index, backupTx] of transferMsg.backup_transactions.entries()) { - - const isSignatureValid = mercury_wasm.verifyTransactionSignature(backupTx.tx, tx0Hex, feeRateTolerance, currentFeeRateSatsPerByte); - - if (!isSignatureValid.result) { - console.error(`Invalid signature, ${isSignatureValid.result.msg}`); - sigSchemeValidation = false; - break; - } - - const currentStatechainInfo = statechainInfo.statechain_info[index]; - - const isBlindedMusigSchemeValid = mercury_wasm.verifyBlindedMusigScheme(backupTx, tx0Hex, currentStatechainInfo); - - if (!isBlindedMusigSchemeValid.result) { - console.error(`Invalid musig scheme, ${isBlindedMusigSchemeValid.result.msg}`); - sigSchemeValidation = false; - break; - } - - if (previousLockTime != null) { - let currentLockTime = mercury_wasm.getBlockheight(backupTx); - if ((previousLockTime - currentLockTime) != serverInfo.interval) { - console.error("interval is not correct"); - sigSchemeValidation = false; - break; - } - } - - previousLockTime = mercury_wasm.getBlockheight(backupTx); - } - - if (!sigSchemeValidation) { - throw new Error("Signature scheme validation failed"); - } - - const transferReceiverRequestPayload = mercury_wasm.createTransferReceiverRequestPayload(statechainInfo, transferMsg, coin); - - let signedStatechainIdForUnlock = mercury_wasm.signMessage(transferMsg.statechain_id, coin); - - await unlockStatecoin(clientConfig, transferMsg.statechain_id, signedStatechainIdForUnlock, coin.auth_pubkey); - - let serverPublicKeyHex = ""; - - try { - serverPublicKeyHex = await sendTransferReceiverRequestPayload(clientConfig, transferReceiverRequestPayload); - } catch (error) { - throw new Error(error); - } - - let newKeyInfo = mercury_wasm.getNewKeyInfo(serverPublicKeyHex, coin, transferMsg.statechain_id, tx0Outpoint, tx0Hex, network); - - coin.server_pubkey = serverPublicKeyHex; - coin.aggregated_pubkey = newKeyInfo.aggregate_pubkey; - coin.aggregated_address = newKeyInfo.aggregate_address; - coin.statechain_id = transferMsg.statechain_id; - coin.signed_statechain_id = newKeyInfo.signed_statechain_id; - coin.amount = newKeyInfo.amount; - coin.utxo_txid = tx0Outpoint.txid; - coin.utxo_vout = tx0Outpoint.vout; - coin.locktime = previousLockTime; - coin.status = isTx0OutputUnspent.status; - - let utxo = `${tx0Outpoint.txid}:${tx0Outpoint.vout}`; - - let activity = { - utxo: utxo, - amount: newKeyInfo.amount, - action: "Receive", - date: new Date().toISOString() - }; - - activities.push(activity); - - await sqlite_manager.insertOrUpdateBackupTxs(db, transferMsg.statechain_id, transferMsg.backup_transactions); - - return transferMsg.statechain_id; -} - -const getTx0 = async (electrumClient, tx0_txid) => { - return await electrumClient.request('blockchain.transaction.get', [tx0_txid]); // request(promise) -} - -const verifyTx0OutputIsUnspentAndConfirmed = async (clientConfig, electrumClient, tx0Outpoint, tx0Hex, wallet_network) => { - - let tx0outputAddress = mercury_wasm.getOutputAddressFromTx0(tx0Outpoint, tx0Hex, wallet_network); - - const network = utils.getNetwork(wallet_network); - - bitcoinjs.initEccLib(ecc); - - let script = bitcoinjs.address.toOutputScript(tx0outputAddress, network); - let hash = bitcoinjs.crypto.sha256(script); - let reversedHash = Buffer.from(hash.reverse()); - reversedHash = reversedHash.toString('hex'); - - let utxo_list = await electrumClient.request('blockchain.scripthash.listunspent', [reversedHash]); - - let status = CoinStatus.UNCONFIRMED; - - for (let unspent of utxo_list) { - if (unspent.tx_hash === tx0Outpoint.txid && unspent.tx_pos === tx0Outpoint.vout) { - - const block_header = await electrumClient.request('blockchain.headers.subscribe'); - const blockheight = block_header.height; - - const confirmations = blockheight - unspent.height + 1; - - const confirmationTarget = clientConfig.confirmationTarget; - - if (confirmations >= confirmationTarget) { - status = CoinStatus.CONFIRMED; - } - - return { result: true, status }; - } - } - - return { result: false, status }; -} - -const unlockStatecoin = async (clientConfig, statechainId, signedStatechainId, authPubkey) => { - - const statechain_entity_url = clientConfig.statechainEntity; - const path = "transfer/unlock"; - const url = statechain_entity_url + '/' + path; - - const torProxy = clientConfig.torProxy; - - let socksAgent = undefined; - - if (torProxy) { - socksAgent = { httpAgent: new SocksProxyAgent(torProxy) }; - } - - let transferUnlockRequestPayload = { - statechain_id: statechainId, - auth_sig: signedStatechainId, - auth_pub_key: authPubkey, - }; - - const response = await axios.post(url, transferUnlockRequestPayload, socksAgent); - - if (response.status != 200) { - throw new Error(`Failed to unlock transfer message`); - } -} - -const sleep = (ms) => { - return new Promise(resolve => setTimeout(resolve, ms)); -} - -const sendTransferReceiverRequestPayload = async (clientConfig, transferReceiverRequestPayload) => { - - const statechain_entity_url = clientConfig.statechainEntity; - const path = "transfer/receiver"; - const url = statechain_entity_url + '/' + path; - - const torProxy = clientConfig.torProxy; - - let socksAgent = undefined; - - if (torProxy) { - socksAgent = { httpAgent: new SocksProxyAgent(torProxy) }; - } - - while(true) { - - try { - const response = await axios.post(url, transferReceiverRequestPayload, socksAgent); - return response.data.server_pubkey; - } - catch (error) { - - if (error.response.status == 400) { - if (error.response.data.code == 'ExpiredBatchTimeError') { - throw new Error(`Failed to update transfer message ${error.response.data.message}`); - } else if (error.response.data.code == 'StatecoinBatchLockedError') { - console.log("Statecoin batch still locked. Waiting until expiration or unlock."); - await sleep(5000); - continue; - } - } else { - throw new Error(`Failed to update transfer message ${JSON.stringify(error.response.data)}`); - } - } - } -} - -module.exports = { newTransferAddress, execute }; diff --git a/clients/libs/nodejs/transfer_send.js b/clients/libs/nodejs/transfer_send.js deleted file mode 100644 index afa4222c..00000000 --- a/clients/libs/nodejs/transfer_send.js +++ /dev/null @@ -1,151 +0,0 @@ -const sqlite_manager = require('./sqlite_manager'); -const mercury_wasm = require('mercury-wasm'); -const transaction = require('./transaction'); -const axios = require('axios').default; -const { SocksProxyAgent } = require('socks-proxy-agent'); -const { CoinStatus } = require('./coin_enum'); - -const execute = async (clientConfig, electrumClient, db, walletName, statechainId, toAddress, batchId) => { - - let wallet = await sqlite_manager.getWallet(db, walletName); - - const backupTxs = await sqlite_manager.getBackupTxs(db, statechainId); - - if (backupTxs.length === 0) { - throw new Error(`There is no backup transaction for the statechain id ${statechainId}`); - } - - const new_tx_n = backupTxs.length + 1; - - let coinsWithStatechainId = wallet.coins.filter(c => { - return c.statechain_id === statechainId - }); - - if (!coinsWithStatechainId || coinsWithStatechainId.length === 0) { - throw new Error(`There is no coin for the statechain id ${statechainId}`); - } - - // If the user sends to himself, he will have two coins with same statechain_id - // In this case, we need to find the one with the lowest locktime - // Sort the coins by locktime in ascending order and pick the first one - let coin = coinsWithStatechainId.sort((a, b) => a.locktime - b.locktime)[0]; - - if (coin.status != CoinStatus.CONFIRMED && coin.status != CoinStatus.IN_TRANSFER) { - throw new Error(`Coin status must be CONFIRMED or IN_TRANSFER to transfer it. The current status is ${coin.status}`); - } - - if (coin.locktime == null) { - throw new Error("Coin.locktime is null"); - } - - const blockHeader = await electrumClient.request('blockchain.headers.subscribe'); // request(promise) - const currentBlockheight = blockHeader.height; - - if (currentBlockheight > coin.locktime) { - throw new Error(`The coin is expired. Coin locktime is ${coin.locktime} and current blockheight is ${currentBlockheight}`); - } - - const statechain_id = coin.statechain_id; - const signed_statechain_id = coin.signed_statechain_id; - - const isWithdrawal = false; - const qtBackupTx = backupTxs.length; - - backupTxs.sort((a, b) => a.tx_n - b.tx_n); - - const bkp_tx1 = backupTxs[0]; - - const block_height = mercury_wasm.getBlockheight(bkp_tx1); - - const decodedTransferAddress = mercury_wasm.decodeTransferAddress(toAddress); - const new_auth_pubkey = decodedTransferAddress.auth_pubkey; - - const new_x1 = await get_new_x1(clientConfig, statechain_id, signed_statechain_id, new_auth_pubkey, batchId); - - 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, - tx: signed_tx, - client_public_nonce: coin.public_nonce, - server_public_nonce: coin.server_public_nonce, - client_public_key: coin.user_pubkey, - server_public_key: coin.server_pubkey, - blinding_factor: coin.blinding_factor - }; - - backupTxs.push(backup_tx); - - const input_txid = coin.utxo_txid; - const input_vout = coin.utxo_vout; - const client_seckey = coin.user_privkey; - const recipient_address = toAddress; - - const transfer_signature = mercury_wasm.createTransferSignature(recipient_address, input_txid, input_vout, client_seckey); - - const transferUpdateMsgRequestPayload = mercury_wasm.createTransferUpdateMsg(new_x1, recipient_address, coin, transfer_signature, backupTxs); - - const statechain_entity_url = clientConfig.statechainEntity; - const path = "transfer/update_msg"; - const url = statechain_entity_url + '/' + path; - - const torProxy = clientConfig.torProxy; - - let socksAgent = undefined; - - if (torProxy) { - socksAgent = { httpAgent: new SocksProxyAgent(torProxy) }; - } - - const response = await axios.post(url, transferUpdateMsgRequestPayload, socksAgent); - - if (!response.data.updated) { - throw new Error(`Transfer update failed`); - } - - await sqlite_manager.updateTransaction(db, coin.statechain_id, backupTxs); - - let utxo = `${coin.utxo_txid}:${coin.input_vout}`; - - let activity = { - utxo: utxo, - amount: coin.amount, - action: "Transfer", - date: new Date().toISOString() - }; - - wallet.activities.push(activity); - coin.status = CoinStatus.IN_TRANSFER; - - await sqlite_manager.updateWallet(db, wallet); - - return coin; -} - -const get_new_x1 = async (clientConfig, statechain_id, signed_statechain_id, new_auth_pubkey, batchId) => { - - const statechain_entity_url = clientConfig.statechainEntity; - const path = "transfer/sender"; - const url = statechain_entity_url + '/' + path; - - let transferSenderRequestPayload = { - statechain_id: statechain_id, - auth_sig: signed_statechain_id, - new_user_auth_key: new_auth_pubkey, - batch_id: batchId, - }; - - const torProxy = clientConfig.torProxy; - - let socksAgent = undefined; - - if (torProxy) { - socksAgent = { httpAgent: new SocksProxyAgent(torProxy) }; - } - - const response = await axios.post(url, transferSenderRequestPayload, socksAgent); - - return response.data.x1; -} - -module.exports = { execute }; \ No newline at end of file diff --git a/clients/libs/nodejs/utils.js b/clients/libs/nodejs/utils.js deleted file mode 100644 index cdd9430c..00000000 --- a/clients/libs/nodejs/utils.js +++ /dev/null @@ -1,113 +0,0 @@ -const axios = require('axios').default; -const { SocksProxyAgent } = require('socks-proxy-agent'); -const bitcoinjs_lib = require("bitcoinjs-lib"); - -const infoConfig = async (clientConfig, ecl) => { - - const statechain_entity_url = clientConfig.statechainEntity; - const path = "info/config"; - - let fee_rate_btc_per_kb = await ecl.request('blockchain.estimatefee', [3]); // request(promise) - - // console.log("fee_rate_btc_per_kb:", fee_rate_btc_per_kb); - - // Why does it happen? - if (fee_rate_btc_per_kb <= 0) { - fee_rate_btc_per_kb = 0.00001; - } - const fee_rate_sats_per_byte = (fee_rate_btc_per_kb * 100000.0); - - // console.log("fee_rate_sats_per_byte: " + fee_rate_sats_per_byte); - - const torProxy = clientConfig.torProxy; - - let socksAgent = undefined; - - if (torProxy) { - socksAgent = { httpAgent: new SocksProxyAgent(torProxy) }; - } - - let response = await axios.get(statechain_entity_url + '/' + path, socksAgent); - return { - initlock: response.data.initlock, - interval: response.data.interval, - fee_rate_sats_per_byte, - }; -} - -const getNetwork = (wallet_network) => { - switch(wallet_network) { - case "signet": - return bitcoinjs_lib.networks.testnet; - case "testnet": - return bitcoinjs_lib.networks.testnet; - case "regtest": - return bitcoinjs_lib.networks.regtest; - case "bitcoin": - return bitcoinjs_lib.networks.bitcoin; - default: - throw new Error("Unknown network"); - } -} - -const createActivity = (utxo, amount, action) => { - - const activity = { - utxo, - amount, - action, - date: new Date().toISOString() - }; - - return activity; - -} - -const getStatechainInfo = async (clientConfig, statechainId) => { - - const statechainEntityUrl = clientConfig.statechainEntity; - const path = `info/statechain/${statechainId}`; - - const torProxy = clientConfig.torProxy; - - let socksAgent = undefined; - - if (torProxy) { - socksAgent = { httpAgent: new SocksProxyAgent(torProxy) }; - } - - try { - let response = await axios.get(statechainEntityUrl + '/' + path, socksAgent); - return response.data; - } catch (error) { - if (error.response.status == 404) { - return null; - } else { - throw error; - } - } -} - -const completeWithdraw = async (clientConfig, statechainId, signedStatechainId) => { - - const statechainEntityUrl = clientConfig.statechainEntity; - const path = "withdraw/complete"; - const url = statechainEntityUrl + '/' + path; - - const torProxy = clientConfig.torProxy; - - let socksAgent = undefined; - - if (torProxy) { - socksAgent = { httpAgent: new SocksProxyAgent(torProxy) }; - } - - let deleteStatechainPayload = { - statechain_id: statechainId, - signed_statechain_id: signedStatechainId - }; - - await axios.post(url, deleteStatechainPayload, socksAgent); -} - -module.exports = { infoConfig, getNetwork, createActivity, getStatechainInfo, completeWithdraw }; diff --git a/clients/libs/nodejs/wallet.js b/clients/libs/nodejs/wallet.js deleted file mode 100644 index 9362e326..00000000 --- a/clients/libs/nodejs/wallet.js +++ /dev/null @@ -1,62 +0,0 @@ -const utils = require('./utils'); - -const mercury_wasm = require('mercury-wasm'); - -const createWallet = async (name, clientConfig, electrumClient) => { - - const urlElectrum = clientConfig.electrumServer; - const urlElectrumObject = new URL(urlElectrum); - - const electrumPort = urlElectrumObject.port; - const electrumHost = urlElectrumObject.hostname; - const electrumProtocol = urlElectrumObject.protocol.slice(0, -1); - - const electrumEndpoint = urlElectrum; - 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(clientConfig, electrumClient); - - let mnemonic = mercury_wasm.generateMnemonic(); - - let settings = { - network, - block_explorerURL: null, - torProxyHost: null, - torProxyPort: null, - torProxyControlPassword: null, - torProxyControlPort: null, - statechainEntityApi: statechainEntityEndpoint, - torStatechainEntityApi: null, - electrumProtocol, - electrumHost, - electrumPort, - electrumType, - notifications: false, - tutorials: false - } - - let wallet = { - name, - mnemonic, - version: "0.1.0", - state_entity_endpoint: statechainEntityEndpoint, - electrum_endpoint: electrumEndpoint, - network: network, - blockheight, - initlock: serverInfo.initlock, - interval: serverInfo.interval, - tokens: [], - activities: [], - coins: [], - settings - }; - - return wallet; -} - -module.exports = { createWallet }; diff --git a/clients/libs/nodejs/withdraw.js b/clients/libs/nodejs/withdraw.js deleted file mode 100644 index 2177825f..00000000 --- a/clients/libs/nodejs/withdraw.js +++ /dev/null @@ -1,83 +0,0 @@ -const sqlite_manager = require('./sqlite_manager'); -const utils = require('./utils'); -const transaction = require('./transaction'); -const { CoinStatus } = require('./coin_enum'); - -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); - - if (backupTxs.length === 0) { - throw new Error(`There is no backup transaction for the statechain id ${statechainId}`); - } - - const new_tx_n = backupTxs.length + 1; - - if (!feeRate) { - const serverInfo = await utils.infoConfig(clientConfig, electrumClient); - const feeRateSatsPerByte = serverInfo.fee_rate_sats_per_byte; - feeRate = feeRateSatsPerByte; - } else { - feeRate = parseInt(feeRate, 10); - } - - let coinsWithStatechainId = wallet.coins.filter(c => { - return c.statechain_id === statechainId - }); - - if (!coinsWithStatechainId) { - throw new Error(`There is no coin for the statechain id ${statechainId}`); - } - - // If the user sends to himself, he will have two coins with same statechain_id - // In this case, we need to find the one with the lowest locktime - // Sort the coins by locktime in ascending order and pick the first one - let coin = coinsWithStatechainId.sort((a, b) => a.locktime - b.locktime)[0]; - - if (coin.status != CoinStatus.CONFIRMED && coin.status != CoinStatus.IN_TRANSFER) { - throw new Error(`Coin status must be CONFIRMED or IN_TRANSFER to transfer it. The current status is ${coin.status}`); - } - - const isWithdrawal = true; - const qtBackupTx = backupTxs.length; - - let signed_tx = await transaction.new_transaction(clientConfig, electrumClient, coin, toAddress, isWithdrawal, qtBackupTx, null, wallet.network); - - let backup_tx = { - tx_n: new_tx_n, - tx: signed_tx, - client_public_nonce: coin.public_nonce, - server_public_nonce: coin.server_public_nonce, - client_public_key: coin.user_pubkey, - server_public_key: coin.server_pubkey, - blinding_factor: coin.blinding_factor - }; - - backupTxs.push(backup_tx); - - await sqlite_manager.updateTransaction(db, coin.statechain_id, backupTxs); - - const txid = await electrumClient.request('blockchain.transaction.broadcast', [signed_tx]); - - coin.tx_withdraw = txid; - coin.withdrawal_address = toAddress; - coin.status = CoinStatus.WITHDRAWING; - - let activity = { - utxo: txid, - amount: coin.amount, - action: "Withdraw", - date: new Date().toISOString() - }; - - wallet.activities.push(activity); - - await sqlite_manager.updateWallet(db, wallet); - - utils.completeWithdraw(clientConfig, coin.statechain_id, coin.signed_statechain_id); - - return txid; -} - -module.exports = { execute }; \ No newline at end of file diff --git a/docker-compose-test.yml b/docker-compose-test.yml new file mode 100644 index 00000000..91842bbf --- /dev/null +++ b/docker-compose-test.yml @@ -0,0 +1,53 @@ +version: '3.8' + +services: + postgres: + image: postgres + environment: + POSTGRES_PASSWORD: pgpassword + ports: + - "5432:5432" + + bitcoin: + image: ruimarinho/bitcoin-core:latest + command: ["-regtest", "-server", "-rpcallowip=::/0", "-rpcbind=0.0.0.0", "-rpcuser=user", "-rpcpassword=pass"] + ports: + - "18443:18443" + volumes: + - bitcoin_data:/root/.bitcoin + + electrumx: + image: lukechilds/electrumx:latest + environment: + DAEMON_URL: http://user:pass@bitcoin:18443/ + COIN: BitcoinSegwit + NET: regtest + ports: + - "50001:50001" + + enclave-sgx: + build: + context: enclave + dockerfile: Dockerfiles/SIM/Dockerfile + depends_on: + - postgres + environment: + ENCLAVE_DATABASE_URL: postgres://postgres:pgpassword@postgres:5432/postgres + ENCLAVE_PORT: 18080 + SEED_DIR: ./seed + + mercury: + image: commerceblockx/mercury-server:3a686af + environment: + LOCKBOX: http://enclave-sgx:18080 + NETWORK: regtest + LOCKHEIGHT_INIT: 1000 + LH_DECREMENT: 10 + CONNECTION_STRING: postgres://postgres:pgpassword@postgres:5432/postgres + ports: + - "8080:8080" + depends_on: + - postgres + +volumes: + bitcoin_data: diff --git a/wasm/node_pkg/debug/README.md b/wasm/node_pkg/debug/README.md deleted file mode 100644 index 2e6b2ec5..00000000 --- a/wasm/node_pkg/debug/README.md +++ /dev/null @@ -1,23 +0,0 @@ -# Mercury layer WASM library - -A `wasm-bindgen` library of functions for the mercury layer clients. - -This project works only with clang 14. -Building it with a higher version will fail. - -To build with `wasm-pack`: - -```bash -# For web -$ wasm-pack build --release --target web --out-dir web_pkg/release/ -$ wasm-pack build --debug --target web --out-dir web_pkg/debug/ -# Or for nodejs -$ wasm-pack build --release --target nodejs --out-dir node_pkg/release/ -$ wasm-pack build --debug --target nodejs --out-dir node_pkg/debug/ -``` - -The file `build_pkgs.sh` does this. - -```bash -$ ./build_pkgs.sh -``` \ No newline at end of file diff --git a/wasm/node_pkg/debug/mercury_wasm.d.ts b/wasm/node_pkg/debug/mercury_wasm.d.ts deleted file mode 100644 index 50ac7538..00000000 --- a/wasm/node_pkg/debug/mercury_wasm.d.ts +++ /dev/null @@ -1,269 +0,0 @@ -/* tslint:disable */ -/* eslint-disable */ -/** -* @param {any} config_json -* @param {any} wallet_json -* @returns {any} -*/ -export function setConfig(config_json: any, wallet_json: any): any; -/** -* @param {number} blockheight -* @param {any} wallet_json -* @returns {any} -*/ -export function setBlockheight(blockheight: number, wallet_json: any): any; -/** -* @param {any} token_json -* @param {any} wallet_json -* @returns {any} -*/ -export function addToken(token_json: any, wallet_json: any): any; -/** -* @param {string} token_id -* @param {any} wallet_json -* @returns {any} -*/ -export function confirmToken(token_id: string, wallet_json: any): any; -/** -* @param {any} wallet_json -* @returns {any} -*/ -export function getTokens(wallet_json: any): any; -/** -* @param {any} wallet_json -* @returns {number} -*/ -export function getBalance(wallet_json: any): number; -/** -* @param {any} wallet_json -* @param {number} index -* @param {string} network -* @returns {string} -*/ -export function getSCAddress(wallet_json: any, index: number, network: string): string; -/** -* @returns {string} -*/ -export function generateMnemonic(): string; -/** -* @param {string} name -* @param {string} mnemonic -* @returns {any} -*/ -export function fromMnemonic(name: string, mnemonic: string): any; -/** -* @param {any} wallet_json -* @returns {any} -*/ -export function getActivityLog(wallet_json: any): any; -/** -* @param {any} wallet_json -* @returns {any} -*/ -export function getCoins(wallet_json: any): any; -/** -* @param {any} wallet_json -* @returns {any} -*/ -export function getNewCoin(wallet_json: any): any; -/** -* @param {any} coin_json -* @param {string} token_id -* @returns {any} -*/ -export function createDepositMsg1(coin_json: any, token_id: string): any; -/** -* @param {any} coin_json -* @param {any} deposit_msg_1_response_json -* @returns {any} -*/ -export function handleDepositMsg1Response(coin_json: any, deposit_msg_1_response_json: any): any; -/** -* @param {any} coin_json -* @param {string} network -* @returns {any} -*/ -export function createAggregatedAddress(coin_json: any, network: string): any; -/** -* @param {any} coin_json -* @returns {any} -*/ -export function createAndCommitNonces(coin_json: any): any; -/** -* @param {any} coin_json -* @param {string} network -* @returns {string} -*/ -export function getUserBackupAddress(coin_json: any, network: string): string; -/** -* @param {any} coin_json -* @param {number} block_height -* @param {number} initlock -* @param {number} interval -* @param {number} fee_rate_sats_per_byte -* @param {number} qt_backup_tx -* @param {string} to_address -* @param {string} network -* @param {boolean} is_withdrawal -* @returns {any} -*/ -export function getPartialSigRequest(coin_json: any, block_height: number, initlock: number, interval: number, fee_rate_sats_per_byte: number, qt_backup_tx: number, to_address: string, network: string, is_withdrawal: boolean): any; -/** -* @param {string} msg -* @param {string} client_partial_sig_hex -* @param {string} server_partial_sig_hex -* @param {string} session_hex -* @param {string} output_pubkey_hex -* @returns {string} -*/ -export function createSignature(msg: string, client_partial_sig_hex: string, server_partial_sig_hex: string, session_hex: string, output_pubkey_hex: string): string; -/** -* @param {string} encoded_unsigned_tx -* @param {string} signature_hex -* @returns {string} -*/ -export function newBackupTransaction(encoded_unsigned_tx: string, signature_hex: string): string; -/** -* @param {any} backup_tx_json -* @param {any} coin_json -* @param {string} to_address -* @param {number} fee_rate_sats_per_byte -* @param {string} network -* @returns {string} -*/ -export function createCpfpTx(backup_tx_json: any, coin_json: any, to_address: string, fee_rate_sats_per_byte: number, network: string): string; -/** -* @param {string} recipient_address -* @param {string} input_txid -* @param {number} input_vout -* @param {string} client_seckey -* @returns {string} -*/ -export function createTransferSignature(recipient_address: string, input_txid: string, input_vout: number, client_seckey: string): string; -/** -* @param {string} x1 -* @param {string} recipient_address -* @param {any} coin_json -* @param {string} transfer_signature -* @param {any} backup_transactions -* @returns {any} -*/ -export function createTransferUpdateMsg(x1: string, recipient_address: string, coin_json: any, transfer_signature: string, backup_transactions: any): any; -/** -* @param {string} sc_address -* @returns {any} -*/ -export function decodeTransferAddress(sc_address: string): any; -/** -* @param {string} encrypted_message -* @param {string} private_key_wif -* @returns {any} -*/ -export function decryptTransferMsg(encrypted_message: string, private_key_wif: string): any; -/** -* @param {any} backup_transactions -* @returns {any} -*/ -export function getTx0Outpoint(backup_transactions: any): any; -/** -* @param {string} new_user_pubkey -* @param {any} tx0_outpoint -* @param {any} transfer_msg -* @returns {boolean} -*/ -export function verifyTransferSignature(new_user_pubkey: string, tx0_outpoint: any, transfer_msg: any): boolean; -/** -* @param {string} enclave_public_key -* @param {any} transfer_msg -* @param {any} tx0_outpoint -* @param {string} tx0_hex -* @param {string} network -* @returns {boolean} -*/ -export function validateTx0OutputPubkey(enclave_public_key: string, transfer_msg: any, tx0_outpoint: any, tx0_hex: string, network: string): boolean; -/** -* @param {any} transfer_msg -* @param {string} client_pubkey_share -* @param {string} network -* @returns {boolean} -*/ -export function verifyLatestBackupTxPaysToUserPubkey(transfer_msg: any, client_pubkey_share: string, network: string): boolean; -/** -* @param {any} tx0_outpoint -* @param {string} tx0_hex -* @param {string} network -* @returns {string} -*/ -export function getOutputAddressFromTx0(tx0_outpoint: any, tx0_hex: string, network: string): string; -/** -* @param {string} tx_n_hex -* @param {string} tx0_hex -* @param {number} fee_rate_tolerance -* @param {number} current_fee_rate_sats_per_byte -* @returns {any} -*/ -export function verifyTransactionSignature(tx_n_hex: string, tx0_hex: string, fee_rate_tolerance: number, current_fee_rate_sats_per_byte: number): any; -/** -* @param {any} backup_tx -* @param {string} tx0_hex -* @param {any} statechain_info -* @returns {any} -*/ -export function verifyBlindedMusigScheme(backup_tx: any, tx0_hex: string, statechain_info: any): any; -/** -* @param {any} backup_tx -* @returns {number} -*/ -export function getBlockheight(backup_tx: any): number; -/** -* @param {any} statechain_info -* @param {any} transfer_msg -* @param {any} coin -* @returns {any} -*/ -export function createTransferReceiverRequestPayload(statechain_info: any, transfer_msg: any, coin: any): any; -/** -* @param {string} server_public_key_hex -* @param {any} coin -* @param {string} statechain_id -* @param {any} tx0_outpoint -* @param {string} tx0_hex -* @param {string} network -* @returns {any} -*/ -export function getNewKeyInfo(server_public_key_hex: string, coin: any, statechain_id: string, tx0_outpoint: any, tx0_hex: string, network: string): any; -/** -* @param {string} address -* @param {string} network -* @returns {boolean} -*/ -export function validateAddress(address: string, network: string): boolean; -/** -* @param {string} statechain_id -* @param {any} coin -* @returns {string} -*/ -export function signMessage(statechain_id: string, coin: any): string; -/** -* @param {any} coin -* @param {string} enclave_pubkey -* @returns {boolean} -*/ -export function isEnclavePubkeyPartOfCoin(coin: any, enclave_pubkey: string): boolean; -/** -* @param {any} backup_transactions -* @param {any} coin -* @param {string} network -* @returns {any} -*/ -export function latestBackuptxPaysToUserpubkey(backup_transactions: any, coin: any, network: string): any; -/** -* @param {any} walletJson -* @param {string} authPubkey -* @returns {any} -*/ -export function duplicateCoinToInitializedState(walletJson: any, authPubkey: string): any; -/** -* @returns {any} -*/ -export function getMockWallet(): any; diff --git a/wasm/node_pkg/debug/mercury_wasm.js b/wasm/node_pkg/debug/mercury_wasm.js deleted file mode 100644 index bd438418..00000000 --- a/wasm/node_pkg/debug/mercury_wasm.js +++ /dev/null @@ -1,1204 +0,0 @@ -let imports = {}; -imports['__wbindgen_placeholder__'] = module.exports; -let wasm; -const { TextEncoder, TextDecoder } = require(`util`); - -const heap = new Array(128).fill(undefined); - -heap.push(undefined, null, true, false); - -function getObject(idx) { return heap[idx]; } - -function _assertBoolean(n) { - if (typeof(n) !== 'boolean') { - throw new Error('expected a boolean argument'); - } -} - -function _assertNum(n) { - if (typeof(n) !== 'number') throw new Error('expected a number argument'); -} - -let WASM_VECTOR_LEN = 0; - -let cachedUint8Memory0 = null; - -function getUint8Memory0() { - if (cachedUint8Memory0 === null || cachedUint8Memory0.byteLength === 0) { - cachedUint8Memory0 = new Uint8Array(wasm.memory.buffer); - } - return cachedUint8Memory0; -} - -let cachedTextEncoder = new TextEncoder('utf-8'); - -const encodeString = (typeof cachedTextEncoder.encodeInto === 'function' - ? function (arg, view) { - return cachedTextEncoder.encodeInto(arg, view); -} - : function (arg, view) { - const buf = cachedTextEncoder.encode(arg); - view.set(buf); - return { - read: arg.length, - written: buf.length - }; -}); - -function passStringToWasm0(arg, malloc, realloc) { - - if (typeof(arg) !== 'string') throw new Error('expected a string argument'); - - if (realloc === undefined) { - const buf = cachedTextEncoder.encode(arg); - const ptr = malloc(buf.length, 1) >>> 0; - getUint8Memory0().subarray(ptr, ptr + buf.length).set(buf); - WASM_VECTOR_LEN = buf.length; - return ptr; - } - - let len = arg.length; - let ptr = malloc(len, 1) >>> 0; - - const mem = getUint8Memory0(); - - let offset = 0; - - for (; offset < len; offset++) { - const code = arg.charCodeAt(offset); - if (code > 0x7F) break; - mem[ptr + offset] = code; - } - - if (offset !== len) { - if (offset !== 0) { - arg = arg.slice(offset); - } - ptr = realloc(ptr, len, len = offset + arg.length * 3, 1) >>> 0; - const view = getUint8Memory0().subarray(ptr + offset, ptr + len); - const ret = encodeString(arg, view); - if (ret.read !== arg.length) throw new Error('failed to pass whole string'); - offset += ret.written; - } - - WASM_VECTOR_LEN = offset; - return ptr; -} - -function isLikeNone(x) { - return x === undefined || x === null; -} - -let cachedInt32Memory0 = null; - -function getInt32Memory0() { - if (cachedInt32Memory0 === null || cachedInt32Memory0.byteLength === 0) { - cachedInt32Memory0 = new Int32Array(wasm.memory.buffer); - } - return cachedInt32Memory0; -} - -let cachedTextDecoder = new TextDecoder('utf-8', { ignoreBOM: true, fatal: true }); - -cachedTextDecoder.decode(); - -function getStringFromWasm0(ptr, len) { - ptr = ptr >>> 0; - return cachedTextDecoder.decode(getUint8Memory0().subarray(ptr, ptr + len)); -} - -let heap_next = heap.length; - -function addHeapObject(obj) { - if (heap_next === heap.length) heap.push(heap.length + 1); - const idx = heap_next; - heap_next = heap[idx]; - - if (typeof(heap_next) !== 'number') throw new Error('corrupt heap'); - - heap[idx] = obj; - return idx; -} - -let cachedFloat64Memory0 = null; - -function getFloat64Memory0() { - if (cachedFloat64Memory0 === null || cachedFloat64Memory0.byteLength === 0) { - cachedFloat64Memory0 = new Float64Array(wasm.memory.buffer); - } - return cachedFloat64Memory0; -} - -function dropObject(idx) { - if (idx < 132) return; - heap[idx] = heap_next; - heap_next = idx; -} - -function takeObject(idx) { - const ret = getObject(idx); - dropObject(idx); - return ret; -} - -function debugString(val) { - // primitive types - const type = typeof val; - if (type == 'number' || type == 'boolean' || val == null) { - return `${val}`; - } - if (type == 'string') { - return `"${val}"`; - } - if (type == 'symbol') { - const description = val.description; - if (description == null) { - return 'Symbol'; - } else { - return `Symbol(${description})`; - } - } - if (type == 'function') { - const name = val.name; - if (typeof name == 'string' && name.length > 0) { - return `Function(${name})`; - } else { - return 'Function'; - } - } - // objects - if (Array.isArray(val)) { - const length = val.length; - let debug = '['; - if (length > 0) { - debug += debugString(val[0]); - } - for(let i = 1; i < length; i++) { - debug += ', ' + debugString(val[i]); - } - debug += ']'; - return debug; - } - // Test for built-in - const builtInMatches = /\[object ([^\]]+)\]/.exec(toString.call(val)); - let className; - if (builtInMatches.length > 1) { - className = builtInMatches[1]; - } else { - // Failed to match the standard '[object ClassName]' - return toString.call(val); - } - if (className == 'Object') { - // we're a user defined class or Object - // JSON.stringify avoids problems with cycles, and is generally much - // easier than looping through ownProperties of `val`. - try { - return 'Object(' + JSON.stringify(val) + ')'; - } catch (_) { - return 'Object'; - } - } - // errors - if (val instanceof Error) { - return `${val.name}: ${val.message}\n${val.stack}`; - } - // TODO we could test for more things here, like `Set`s and `Map`s. - return className; -} -/** -* @param {any} config_json -* @param {any} wallet_json -* @returns {any} -*/ -module.exports.setConfig = function(config_json, wallet_json) { - const ret = wasm.setConfig(addHeapObject(config_json), addHeapObject(wallet_json)); - return takeObject(ret); -}; - -/** -* @param {number} blockheight -* @param {any} wallet_json -* @returns {any} -*/ -module.exports.setBlockheight = function(blockheight, wallet_json) { - _assertNum(blockheight); - const ret = wasm.setBlockheight(blockheight, addHeapObject(wallet_json)); - return takeObject(ret); -}; - -/** -* @param {any} token_json -* @param {any} wallet_json -* @returns {any} -*/ -module.exports.addToken = function(token_json, wallet_json) { - const ret = wasm.addToken(addHeapObject(token_json), addHeapObject(wallet_json)); - return takeObject(ret); -}; - -/** -* @param {string} token_id -* @param {any} wallet_json -* @returns {any} -*/ -module.exports.confirmToken = function(token_id, wallet_json) { - const ptr0 = passStringToWasm0(token_id, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc); - const len0 = WASM_VECTOR_LEN; - const ret = wasm.confirmToken(ptr0, len0, addHeapObject(wallet_json)); - return takeObject(ret); -}; - -/** -* @param {any} wallet_json -* @returns {any} -*/ -module.exports.getTokens = function(wallet_json) { - const ret = wasm.getTokens(addHeapObject(wallet_json)); - return takeObject(ret); -}; - -/** -* @param {any} wallet_json -* @returns {number} -*/ -module.exports.getBalance = function(wallet_json) { - const ret = wasm.getBalance(addHeapObject(wallet_json)); - return ret >>> 0; -}; - -/** -* @param {any} wallet_json -* @param {number} index -* @param {string} network -* @returns {string} -*/ -module.exports.getSCAddress = function(wallet_json, index, network) { - let deferred2_0; - let deferred2_1; - try { - const retptr = wasm.__wbindgen_add_to_stack_pointer(-16); - _assertNum(index); - const ptr0 = passStringToWasm0(network, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc); - const len0 = WASM_VECTOR_LEN; - wasm.getSCAddress(retptr, addHeapObject(wallet_json), index, ptr0, len0); - var r0 = getInt32Memory0()[retptr / 4 + 0]; - var r1 = getInt32Memory0()[retptr / 4 + 1]; - deferred2_0 = r0; - deferred2_1 = r1; - return getStringFromWasm0(r0, r1); - } finally { - wasm.__wbindgen_add_to_stack_pointer(16); - wasm.__wbindgen_free(deferred2_0, deferred2_1, 1); - } -}; - -/** -* @returns {string} -*/ -module.exports.generateMnemonic = function() { - let deferred1_0; - let deferred1_1; - try { - const retptr = wasm.__wbindgen_add_to_stack_pointer(-16); - wasm.generateMnemonic(retptr); - var r0 = getInt32Memory0()[retptr / 4 + 0]; - var r1 = getInt32Memory0()[retptr / 4 + 1]; - deferred1_0 = r0; - deferred1_1 = r1; - return getStringFromWasm0(r0, r1); - } finally { - wasm.__wbindgen_add_to_stack_pointer(16); - wasm.__wbindgen_free(deferred1_0, deferred1_1, 1); - } -}; - -/** -* @param {string} name -* @param {string} mnemonic -* @returns {any} -*/ -module.exports.fromMnemonic = function(name, mnemonic) { - const ptr0 = passStringToWasm0(name, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc); - const len0 = WASM_VECTOR_LEN; - const ptr1 = passStringToWasm0(mnemonic, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc); - const len1 = WASM_VECTOR_LEN; - const ret = wasm.fromMnemonic(ptr0, len0, ptr1, len1); - return takeObject(ret); -}; - -/** -* @param {any} wallet_json -* @returns {any} -*/ -module.exports.getActivityLog = function(wallet_json) { - const ret = wasm.getActivityLog(addHeapObject(wallet_json)); - return takeObject(ret); -}; - -/** -* @param {any} wallet_json -* @returns {any} -*/ -module.exports.getCoins = function(wallet_json) { - const ret = wasm.getCoins(addHeapObject(wallet_json)); - return takeObject(ret); -}; - -/** -* @param {any} wallet_json -* @returns {any} -*/ -module.exports.getNewCoin = function(wallet_json) { - const ret = wasm.getNewCoin(addHeapObject(wallet_json)); - return takeObject(ret); -}; - -/** -* @param {any} coin_json -* @param {string} token_id -* @returns {any} -*/ -module.exports.createDepositMsg1 = function(coin_json, token_id) { - const ptr0 = passStringToWasm0(token_id, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc); - const len0 = WASM_VECTOR_LEN; - const ret = wasm.createDepositMsg1(addHeapObject(coin_json), ptr0, len0); - return takeObject(ret); -}; - -/** -* @param {any} coin_json -* @param {any} deposit_msg_1_response_json -* @returns {any} -*/ -module.exports.handleDepositMsg1Response = function(coin_json, deposit_msg_1_response_json) { - const ret = wasm.handleDepositMsg1Response(addHeapObject(coin_json), addHeapObject(deposit_msg_1_response_json)); - return takeObject(ret); -}; - -/** -* @param {any} coin_json -* @param {string} network -* @returns {any} -*/ -module.exports.createAggregatedAddress = function(coin_json, network) { - const ptr0 = passStringToWasm0(network, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc); - const len0 = WASM_VECTOR_LEN; - const ret = wasm.createAggregatedAddress(addHeapObject(coin_json), ptr0, len0); - return takeObject(ret); -}; - -/** -* @param {any} coin_json -* @returns {any} -*/ -module.exports.createAndCommitNonces = function(coin_json) { - const ret = wasm.createAndCommitNonces(addHeapObject(coin_json)); - return takeObject(ret); -}; - -/** -* @param {any} coin_json -* @param {string} network -* @returns {string} -*/ -module.exports.getUserBackupAddress = function(coin_json, network) { - let deferred2_0; - let deferred2_1; - try { - const retptr = wasm.__wbindgen_add_to_stack_pointer(-16); - const ptr0 = passStringToWasm0(network, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc); - const len0 = WASM_VECTOR_LEN; - wasm.getUserBackupAddress(retptr, addHeapObject(coin_json), ptr0, len0); - var r0 = getInt32Memory0()[retptr / 4 + 0]; - var r1 = getInt32Memory0()[retptr / 4 + 1]; - deferred2_0 = r0; - deferred2_1 = r1; - return getStringFromWasm0(r0, r1); - } finally { - wasm.__wbindgen_add_to_stack_pointer(16); - wasm.__wbindgen_free(deferred2_0, deferred2_1, 1); - } -}; - -/** -* @param {any} coin_json -* @param {number} block_height -* @param {number} initlock -* @param {number} interval -* @param {number} fee_rate_sats_per_byte -* @param {number} qt_backup_tx -* @param {string} to_address -* @param {string} network -* @param {boolean} is_withdrawal -* @returns {any} -*/ -module.exports.getPartialSigRequest = function(coin_json, block_height, initlock, interval, fee_rate_sats_per_byte, qt_backup_tx, to_address, network, is_withdrawal) { - _assertNum(block_height); - _assertNum(initlock); - _assertNum(interval); - _assertNum(fee_rate_sats_per_byte); - _assertNum(qt_backup_tx); - const ptr0 = passStringToWasm0(to_address, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc); - const len0 = WASM_VECTOR_LEN; - const ptr1 = passStringToWasm0(network, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc); - const len1 = WASM_VECTOR_LEN; - _assertBoolean(is_withdrawal); - const ret = wasm.getPartialSigRequest(addHeapObject(coin_json), block_height, initlock, interval, fee_rate_sats_per_byte, qt_backup_tx, ptr0, len0, ptr1, len1, is_withdrawal); - return takeObject(ret); -}; - -/** -* @param {string} msg -* @param {string} client_partial_sig_hex -* @param {string} server_partial_sig_hex -* @param {string} session_hex -* @param {string} output_pubkey_hex -* @returns {string} -*/ -module.exports.createSignature = function(msg, client_partial_sig_hex, server_partial_sig_hex, session_hex, output_pubkey_hex) { - let deferred6_0; - let deferred6_1; - try { - const retptr = wasm.__wbindgen_add_to_stack_pointer(-16); - const ptr0 = passStringToWasm0(msg, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc); - const len0 = WASM_VECTOR_LEN; - const ptr1 = passStringToWasm0(client_partial_sig_hex, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc); - const len1 = WASM_VECTOR_LEN; - const ptr2 = passStringToWasm0(server_partial_sig_hex, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc); - const len2 = WASM_VECTOR_LEN; - const ptr3 = passStringToWasm0(session_hex, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc); - const len3 = WASM_VECTOR_LEN; - const ptr4 = passStringToWasm0(output_pubkey_hex, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc); - const len4 = WASM_VECTOR_LEN; - wasm.createSignature(retptr, ptr0, len0, ptr1, len1, ptr2, len2, ptr3, len3, ptr4, len4); - var r0 = getInt32Memory0()[retptr / 4 + 0]; - var r1 = getInt32Memory0()[retptr / 4 + 1]; - deferred6_0 = r0; - deferred6_1 = r1; - return getStringFromWasm0(r0, r1); - } finally { - wasm.__wbindgen_add_to_stack_pointer(16); - wasm.__wbindgen_free(deferred6_0, deferred6_1, 1); - } -}; - -/** -* @param {string} encoded_unsigned_tx -* @param {string} signature_hex -* @returns {string} -*/ -module.exports.newBackupTransaction = function(encoded_unsigned_tx, signature_hex) { - let deferred3_0; - let deferred3_1; - try { - const retptr = wasm.__wbindgen_add_to_stack_pointer(-16); - const ptr0 = passStringToWasm0(encoded_unsigned_tx, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc); - const len0 = WASM_VECTOR_LEN; - const ptr1 = passStringToWasm0(signature_hex, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc); - const len1 = WASM_VECTOR_LEN; - wasm.newBackupTransaction(retptr, ptr0, len0, ptr1, len1); - var r0 = getInt32Memory0()[retptr / 4 + 0]; - var r1 = getInt32Memory0()[retptr / 4 + 1]; - deferred3_0 = r0; - deferred3_1 = r1; - return getStringFromWasm0(r0, r1); - } finally { - wasm.__wbindgen_add_to_stack_pointer(16); - wasm.__wbindgen_free(deferred3_0, deferred3_1, 1); - } -}; - -/** -* @param {any} backup_tx_json -* @param {any} coin_json -* @param {string} to_address -* @param {number} fee_rate_sats_per_byte -* @param {string} network -* @returns {string} -*/ -module.exports.createCpfpTx = function(backup_tx_json, coin_json, to_address, fee_rate_sats_per_byte, network) { - let deferred3_0; - let deferred3_1; - try { - const retptr = wasm.__wbindgen_add_to_stack_pointer(-16); - const ptr0 = passStringToWasm0(to_address, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc); - const len0 = WASM_VECTOR_LEN; - _assertNum(fee_rate_sats_per_byte); - const ptr1 = passStringToWasm0(network, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc); - const len1 = WASM_VECTOR_LEN; - wasm.createCpfpTx(retptr, addHeapObject(backup_tx_json), addHeapObject(coin_json), ptr0, len0, fee_rate_sats_per_byte, ptr1, len1); - var r0 = getInt32Memory0()[retptr / 4 + 0]; - var r1 = getInt32Memory0()[retptr / 4 + 1]; - deferred3_0 = r0; - deferred3_1 = r1; - return getStringFromWasm0(r0, r1); - } finally { - wasm.__wbindgen_add_to_stack_pointer(16); - wasm.__wbindgen_free(deferred3_0, deferred3_1, 1); - } -}; - -/** -* @param {string} recipient_address -* @param {string} input_txid -* @param {number} input_vout -* @param {string} client_seckey -* @returns {string} -*/ -module.exports.createTransferSignature = function(recipient_address, input_txid, input_vout, client_seckey) { - let deferred4_0; - let deferred4_1; - try { - const retptr = wasm.__wbindgen_add_to_stack_pointer(-16); - const ptr0 = passStringToWasm0(recipient_address, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc); - const len0 = WASM_VECTOR_LEN; - const ptr1 = passStringToWasm0(input_txid, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc); - const len1 = WASM_VECTOR_LEN; - _assertNum(input_vout); - const ptr2 = passStringToWasm0(client_seckey, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc); - const len2 = WASM_VECTOR_LEN; - wasm.createTransferSignature(retptr, ptr0, len0, ptr1, len1, input_vout, ptr2, len2); - var r0 = getInt32Memory0()[retptr / 4 + 0]; - var r1 = getInt32Memory0()[retptr / 4 + 1]; - deferred4_0 = r0; - deferred4_1 = r1; - return getStringFromWasm0(r0, r1); - } finally { - wasm.__wbindgen_add_to_stack_pointer(16); - wasm.__wbindgen_free(deferred4_0, deferred4_1, 1); - } -}; - -/** -* @param {string} x1 -* @param {string} recipient_address -* @param {any} coin_json -* @param {string} transfer_signature -* @param {any} backup_transactions -* @returns {any} -*/ -module.exports.createTransferUpdateMsg = function(x1, recipient_address, coin_json, transfer_signature, backup_transactions) { - const ptr0 = passStringToWasm0(x1, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc); - const len0 = WASM_VECTOR_LEN; - const ptr1 = passStringToWasm0(recipient_address, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc); - const len1 = WASM_VECTOR_LEN; - const ptr2 = passStringToWasm0(transfer_signature, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc); - const len2 = WASM_VECTOR_LEN; - const ret = wasm.createTransferUpdateMsg(ptr0, len0, ptr1, len1, addHeapObject(coin_json), ptr2, len2, addHeapObject(backup_transactions)); - return takeObject(ret); -}; - -/** -* @param {string} sc_address -* @returns {any} -*/ -module.exports.decodeTransferAddress = function(sc_address) { - const ptr0 = passStringToWasm0(sc_address, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc); - const len0 = WASM_VECTOR_LEN; - const ret = wasm.decodeTransferAddress(ptr0, len0); - return takeObject(ret); -}; - -/** -* @param {string} encrypted_message -* @param {string} private_key_wif -* @returns {any} -*/ -module.exports.decryptTransferMsg = function(encrypted_message, private_key_wif) { - const ptr0 = passStringToWasm0(encrypted_message, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc); - const len0 = WASM_VECTOR_LEN; - const ptr1 = passStringToWasm0(private_key_wif, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc); - const len1 = WASM_VECTOR_LEN; - const ret = wasm.decryptTransferMsg(ptr0, len0, ptr1, len1); - return takeObject(ret); -}; - -/** -* @param {any} backup_transactions -* @returns {any} -*/ -module.exports.getTx0Outpoint = function(backup_transactions) { - const ret = wasm.getTx0Outpoint(addHeapObject(backup_transactions)); - return takeObject(ret); -}; - -/** -* @param {string} new_user_pubkey -* @param {any} tx0_outpoint -* @param {any} transfer_msg -* @returns {boolean} -*/ -module.exports.verifyTransferSignature = function(new_user_pubkey, tx0_outpoint, transfer_msg) { - const ptr0 = passStringToWasm0(new_user_pubkey, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc); - const len0 = WASM_VECTOR_LEN; - const ret = wasm.verifyTransferSignature(ptr0, len0, addHeapObject(tx0_outpoint), addHeapObject(transfer_msg)); - return ret !== 0; -}; - -/** -* @param {string} enclave_public_key -* @param {any} transfer_msg -* @param {any} tx0_outpoint -* @param {string} tx0_hex -* @param {string} network -* @returns {boolean} -*/ -module.exports.validateTx0OutputPubkey = function(enclave_public_key, transfer_msg, tx0_outpoint, tx0_hex, network) { - const ptr0 = passStringToWasm0(enclave_public_key, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc); - const len0 = WASM_VECTOR_LEN; - const ptr1 = passStringToWasm0(tx0_hex, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc); - const len1 = WASM_VECTOR_LEN; - const ptr2 = passStringToWasm0(network, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc); - const len2 = WASM_VECTOR_LEN; - const ret = wasm.validateTx0OutputPubkey(ptr0, len0, addHeapObject(transfer_msg), addHeapObject(tx0_outpoint), ptr1, len1, ptr2, len2); - return ret !== 0; -}; - -/** -* @param {any} transfer_msg -* @param {string} client_pubkey_share -* @param {string} network -* @returns {boolean} -*/ -module.exports.verifyLatestBackupTxPaysToUserPubkey = function(transfer_msg, client_pubkey_share, network) { - const ptr0 = passStringToWasm0(client_pubkey_share, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc); - const len0 = WASM_VECTOR_LEN; - const ptr1 = passStringToWasm0(network, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc); - const len1 = WASM_VECTOR_LEN; - const ret = wasm.verifyLatestBackupTxPaysToUserPubkey(addHeapObject(transfer_msg), ptr0, len0, ptr1, len1); - return ret !== 0; -}; - -/** -* @param {any} tx0_outpoint -* @param {string} tx0_hex -* @param {string} network -* @returns {string} -*/ -module.exports.getOutputAddressFromTx0 = function(tx0_outpoint, tx0_hex, network) { - let deferred3_0; - let deferred3_1; - try { - const retptr = wasm.__wbindgen_add_to_stack_pointer(-16); - const ptr0 = passStringToWasm0(tx0_hex, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc); - const len0 = WASM_VECTOR_LEN; - const ptr1 = passStringToWasm0(network, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc); - const len1 = WASM_VECTOR_LEN; - wasm.getOutputAddressFromTx0(retptr, addHeapObject(tx0_outpoint), ptr0, len0, ptr1, len1); - var r0 = getInt32Memory0()[retptr / 4 + 0]; - var r1 = getInt32Memory0()[retptr / 4 + 1]; - deferred3_0 = r0; - deferred3_1 = r1; - return getStringFromWasm0(r0, r1); - } finally { - wasm.__wbindgen_add_to_stack_pointer(16); - wasm.__wbindgen_free(deferred3_0, deferred3_1, 1); - } -}; - -/** -* @param {string} tx_n_hex -* @param {string} tx0_hex -* @param {number} fee_rate_tolerance -* @param {number} current_fee_rate_sats_per_byte -* @returns {any} -*/ -module.exports.verifyTransactionSignature = function(tx_n_hex, tx0_hex, fee_rate_tolerance, current_fee_rate_sats_per_byte) { - const ptr0 = passStringToWasm0(tx_n_hex, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc); - const len0 = WASM_VECTOR_LEN; - const ptr1 = passStringToWasm0(tx0_hex, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc); - const len1 = WASM_VECTOR_LEN; - _assertNum(fee_rate_tolerance); - _assertNum(current_fee_rate_sats_per_byte); - const ret = wasm.verifyTransactionSignature(ptr0, len0, ptr1, len1, fee_rate_tolerance, current_fee_rate_sats_per_byte); - return takeObject(ret); -}; - -/** -* @param {any} backup_tx -* @param {string} tx0_hex -* @param {any} statechain_info -* @returns {any} -*/ -module.exports.verifyBlindedMusigScheme = function(backup_tx, tx0_hex, statechain_info) { - const ptr0 = passStringToWasm0(tx0_hex, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc); - const len0 = WASM_VECTOR_LEN; - const ret = wasm.verifyBlindedMusigScheme(addHeapObject(backup_tx), ptr0, len0, addHeapObject(statechain_info)); - return takeObject(ret); -}; - -/** -* @param {any} backup_tx -* @returns {number} -*/ -module.exports.getBlockheight = function(backup_tx) { - const ret = wasm.getBlockheight(addHeapObject(backup_tx)); - return ret >>> 0; -}; - -/** -* @param {any} statechain_info -* @param {any} transfer_msg -* @param {any} coin -* @returns {any} -*/ -module.exports.createTransferReceiverRequestPayload = function(statechain_info, transfer_msg, coin) { - const ret = wasm.createTransferReceiverRequestPayload(addHeapObject(statechain_info), addHeapObject(transfer_msg), addHeapObject(coin)); - return takeObject(ret); -}; - -/** -* @param {string} server_public_key_hex -* @param {any} coin -* @param {string} statechain_id -* @param {any} tx0_outpoint -* @param {string} tx0_hex -* @param {string} network -* @returns {any} -*/ -module.exports.getNewKeyInfo = function(server_public_key_hex, coin, statechain_id, tx0_outpoint, tx0_hex, network) { - const ptr0 = passStringToWasm0(server_public_key_hex, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc); - const len0 = WASM_VECTOR_LEN; - const ptr1 = passStringToWasm0(statechain_id, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc); - const len1 = WASM_VECTOR_LEN; - const ptr2 = passStringToWasm0(tx0_hex, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc); - const len2 = WASM_VECTOR_LEN; - const ptr3 = passStringToWasm0(network, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc); - const len3 = WASM_VECTOR_LEN; - const ret = wasm.getNewKeyInfo(ptr0, len0, addHeapObject(coin), ptr1, len1, addHeapObject(tx0_outpoint), ptr2, len2, ptr3, len3); - return takeObject(ret); -}; - -/** -* @param {string} address -* @param {string} network -* @returns {boolean} -*/ -module.exports.validateAddress = function(address, network) { - const ptr0 = passStringToWasm0(address, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc); - const len0 = WASM_VECTOR_LEN; - const ptr1 = passStringToWasm0(network, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc); - const len1 = WASM_VECTOR_LEN; - const ret = wasm.validateAddress(ptr0, len0, ptr1, len1); - return ret !== 0; -}; - -/** -* @param {string} statechain_id -* @param {any} coin -* @returns {string} -*/ -module.exports.signMessage = function(statechain_id, coin) { - let deferred2_0; - let deferred2_1; - try { - const retptr = wasm.__wbindgen_add_to_stack_pointer(-16); - const ptr0 = passStringToWasm0(statechain_id, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc); - const len0 = WASM_VECTOR_LEN; - wasm.signMessage(retptr, ptr0, len0, addHeapObject(coin)); - var r0 = getInt32Memory0()[retptr / 4 + 0]; - var r1 = getInt32Memory0()[retptr / 4 + 1]; - deferred2_0 = r0; - deferred2_1 = r1; - return getStringFromWasm0(r0, r1); - } finally { - wasm.__wbindgen_add_to_stack_pointer(16); - wasm.__wbindgen_free(deferred2_0, deferred2_1, 1); - } -}; - -/** -* @param {any} coin -* @param {string} enclave_pubkey -* @returns {boolean} -*/ -module.exports.isEnclavePubkeyPartOfCoin = function(coin, enclave_pubkey) { - const ptr0 = passStringToWasm0(enclave_pubkey, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc); - const len0 = WASM_VECTOR_LEN; - const ret = wasm.isEnclavePubkeyPartOfCoin(addHeapObject(coin), ptr0, len0); - return ret !== 0; -}; - -/** -* @param {any} backup_transactions -* @param {any} coin -* @param {string} network -* @returns {any} -*/ -module.exports.latestBackuptxPaysToUserpubkey = function(backup_transactions, coin, network) { - const ptr0 = passStringToWasm0(network, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc); - const len0 = WASM_VECTOR_LEN; - const ret = wasm.latestBackuptxPaysToUserpubkey(addHeapObject(backup_transactions), addHeapObject(coin), ptr0, len0); - return takeObject(ret); -}; - -/** -* @param {any} walletJson -* @param {string} authPubkey -* @returns {any} -*/ -module.exports.duplicateCoinToInitializedState = function(walletJson, authPubkey) { - const ptr0 = passStringToWasm0(authPubkey, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc); - const len0 = WASM_VECTOR_LEN; - const ret = wasm.duplicateCoinToInitializedState(addHeapObject(walletJson), ptr0, len0); - return takeObject(ret); -}; - -/** -* @returns {any} -*/ -module.exports.getMockWallet = function() { - const ret = wasm.getMockWallet(); - return takeObject(ret); -}; - -function logError(f, args) { - try { - return f.apply(this, args); - } catch (e) { - let error = (function () { - try { - return e instanceof Error ? `${e.message}\n\nStack:\n${e.stack}` : e.toString(); - } catch(_) { - return ""; - } - }()); - console.error("wasm-bindgen: imported JS function that was not marked as `catch` threw an error:", error); - throw e; - } -} - -function handleError(f, args) { - try { - return f.apply(this, args); - } catch (e) { - wasm.__wbindgen_exn_store(addHeapObject(e)); - } -} - -module.exports.__wbindgen_is_undefined = function(arg0) { - const ret = getObject(arg0) === undefined; - _assertBoolean(ret); - return ret; -}; - -module.exports.__wbindgen_in = function(arg0, arg1) { - const ret = getObject(arg0) in getObject(arg1); - _assertBoolean(ret); - return ret; -}; - -module.exports.__wbindgen_boolean_get = function(arg0) { - const v = getObject(arg0); - const ret = typeof(v) === 'boolean' ? (v ? 1 : 0) : 2; - _assertNum(ret); - return ret; -}; - -module.exports.__wbindgen_string_get = function(arg0, arg1) { - const obj = getObject(arg1); - const ret = typeof(obj) === 'string' ? obj : undefined; - var ptr1 = isLikeNone(ret) ? 0 : passStringToWasm0(ret, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc); - var len1 = WASM_VECTOR_LEN; - getInt32Memory0()[arg0 / 4 + 1] = len1; - getInt32Memory0()[arg0 / 4 + 0] = ptr1; -}; - -module.exports.__wbindgen_is_object = function(arg0) { - const val = getObject(arg0); - const ret = typeof(val) === 'object' && val !== null; - _assertBoolean(ret); - return ret; -}; - -module.exports.__wbindgen_is_string = function(arg0) { - const ret = typeof(getObject(arg0)) === 'string'; - _assertBoolean(ret); - return ret; -}; - -module.exports.__wbindgen_error_new = function(arg0, arg1) { - const ret = new Error(getStringFromWasm0(arg0, arg1)); - return addHeapObject(ret); -}; - -module.exports.__wbindgen_number_get = function(arg0, arg1) { - const obj = getObject(arg1); - const ret = typeof(obj) === 'number' ? obj : undefined; - if (!isLikeNone(ret)) { - _assertNum(ret); - } - getFloat64Memory0()[arg0 / 8 + 1] = isLikeNone(ret) ? 0 : ret; - getInt32Memory0()[arg0 / 4 + 0] = !isLikeNone(ret); -}; - -module.exports.__wbindgen_number_new = function(arg0) { - const ret = arg0; - return addHeapObject(ret); -}; - -module.exports.__wbindgen_string_new = function(arg0, arg1) { - const ret = getStringFromWasm0(arg0, arg1); - return addHeapObject(ret); -}; - -module.exports.__wbindgen_jsval_loose_eq = function(arg0, arg1) { - const ret = getObject(arg0) == getObject(arg1); - _assertBoolean(ret); - return ret; -}; - -module.exports.__wbindgen_object_clone_ref = function(arg0) { - const ret = getObject(arg0); - return addHeapObject(ret); -}; - -module.exports.__wbg_getwithrefkey_15c62c2b8546208d = function() { return logError(function (arg0, arg1) { - const ret = getObject(arg0)[getObject(arg1)]; - return addHeapObject(ret); -}, arguments) }; - -module.exports.__wbg_set_20cbc34131e76824 = function() { return logError(function (arg0, arg1, arg2) { - getObject(arg0)[takeObject(arg1)] = takeObject(arg2); -}, arguments) }; - -module.exports.__wbindgen_object_drop_ref = function(arg0) { - takeObject(arg0); -}; - -module.exports.__wbg_crypto_c48a774b022d20ac = function() { return logError(function (arg0) { - const ret = getObject(arg0).crypto; - return addHeapObject(ret); -}, arguments) }; - -module.exports.__wbg_msCrypto_bcb970640f50a1e8 = function() { return logError(function (arg0) { - const ret = getObject(arg0).msCrypto; - return addHeapObject(ret); -}, arguments) }; - -module.exports.__wbg_getRandomValues_37fa2ca9e4e07fab = function() { return handleError(function (arg0, arg1) { - getObject(arg0).getRandomValues(getObject(arg1)); -}, arguments) }; - -module.exports.__wbg_randomFillSync_dc1e9a60c158336d = function() { return handleError(function (arg0, arg1) { - getObject(arg0).randomFillSync(takeObject(arg1)); -}, arguments) }; - -module.exports.__wbg_require_8f08ceecec0f4fee = function() { return handleError(function () { - const ret = module.require; - return addHeapObject(ret); -}, arguments) }; - -module.exports.__wbg_process_298734cf255a885d = function() { return logError(function (arg0) { - const ret = getObject(arg0).process; - return addHeapObject(ret); -}, arguments) }; - -module.exports.__wbg_versions_e2e78e134e3e5d01 = function() { return logError(function (arg0) { - const ret = getObject(arg0).versions; - return addHeapObject(ret); -}, arguments) }; - -module.exports.__wbg_node_1cd7a5d853dbea79 = function() { return logError(function (arg0) { - const ret = getObject(arg0).node; - return addHeapObject(ret); -}, arguments) }; - -module.exports.__wbg_new_898a68150f225f2e = function() { return logError(function () { - const ret = new Array(); - return addHeapObject(ret); -}, arguments) }; - -module.exports.__wbg_get_44be0491f933a435 = function() { return logError(function (arg0, arg1) { - const ret = getObject(arg0)[arg1 >>> 0]; - return addHeapObject(ret); -}, arguments) }; - -module.exports.__wbg_set_502d29070ea18557 = function() { return logError(function (arg0, arg1, arg2) { - getObject(arg0)[arg1 >>> 0] = takeObject(arg2); -}, arguments) }; - -module.exports.__wbg_isArray_4c24b343cb13cfb1 = function() { return logError(function (arg0) { - const ret = Array.isArray(getObject(arg0)); - _assertBoolean(ret); - return ret; -}, arguments) }; - -module.exports.__wbg_length_fff51ee6522a1a18 = function() { return logError(function (arg0) { - const ret = getObject(arg0).length; - _assertNum(ret); - return ret; -}, arguments) }; - -module.exports.__wbg_instanceof_ArrayBuffer_39ac22089b74fddb = function() { return logError(function (arg0) { - let result; - try { - result = getObject(arg0) instanceof ArrayBuffer; - } catch { - result = false; - } - const ret = result; - _assertBoolean(ret); - return ret; -}, arguments) }; - -module.exports.__wbg_newnoargs_581967eacc0e2604 = function() { return logError(function (arg0, arg1) { - const ret = new Function(getStringFromWasm0(arg0, arg1)); - return addHeapObject(ret); -}, arguments) }; - -module.exports.__wbg_call_cb65541d95d71282 = function() { return handleError(function (arg0, arg1) { - const ret = getObject(arg0).call(getObject(arg1)); - return addHeapObject(ret); -}, arguments) }; - -module.exports.__wbg_call_01734de55d61e11d = function() { return handleError(function (arg0, arg1, arg2) { - const ret = getObject(arg0).call(getObject(arg1), getObject(arg2)); - return addHeapObject(ret); -}, arguments) }; - -module.exports.__wbg_next_ddb3312ca1c4e32a = function() { return handleError(function (arg0) { - const ret = getObject(arg0).next(); - return addHeapObject(ret); -}, arguments) }; - -module.exports.__wbg_next_526fc47e980da008 = function() { return logError(function (arg0) { - const ret = getObject(arg0).next; - return addHeapObject(ret); -}, arguments) }; - -module.exports.__wbg_done_5c1f01fb660d73b5 = function() { return logError(function (arg0) { - const ret = getObject(arg0).done; - _assertBoolean(ret); - return ret; -}, arguments) }; - -module.exports.__wbg_value_1695675138684bd5 = function() { return logError(function (arg0) { - const ret = getObject(arg0).value; - return addHeapObject(ret); -}, arguments) }; - -module.exports.__wbg_isSafeInteger_bb8e18dd21c97288 = function() { return logError(function (arg0) { - const ret = Number.isSafeInteger(getObject(arg0)); - _assertBoolean(ret); - return ret; -}, arguments) }; - -module.exports.__wbg_entries_e51f29c7bba0c054 = function() { return logError(function (arg0) { - const ret = Object.entries(getObject(arg0)); - return addHeapObject(ret); -}, arguments) }; - -module.exports.__wbg_new_b51585de1b234aff = function() { return logError(function () { - const ret = new Object(); - return addHeapObject(ret); -}, arguments) }; - -module.exports.__wbg_iterator_97f0c81209c6c35a = function() { return logError(function () { - const ret = Symbol.iterator; - return addHeapObject(ret); -}, arguments) }; - -module.exports.__wbg_globalThis_1d39714405582d3c = function() { return handleError(function () { - const ret = globalThis.globalThis; - return addHeapObject(ret); -}, arguments) }; - -module.exports.__wbg_self_1ff1d729e9aae938 = function() { return handleError(function () { - const ret = self.self; - return addHeapObject(ret); -}, arguments) }; - -module.exports.__wbg_window_5f4faef6c12b79ec = function() { return handleError(function () { - const ret = window.window; - return addHeapObject(ret); -}, arguments) }; - -module.exports.__wbg_global_651f05c6a0944d1c = function() { return handleError(function () { - const ret = global.global; - return addHeapObject(ret); -}, arguments) }; - -module.exports.__wbg_instanceof_Uint8Array_d8d9cb2b8e8ac1d4 = function() { return logError(function (arg0) { - let result; - try { - result = getObject(arg0) instanceof Uint8Array; - } catch { - result = false; - } - const ret = result; - _assertBoolean(ret); - return ret; -}, arguments) }; - -module.exports.__wbg_new_8125e318e6245eed = function() { return logError(function (arg0) { - const ret = new Uint8Array(getObject(arg0)); - return addHeapObject(ret); -}, arguments) }; - -module.exports.__wbg_newwithlength_e5d69174d6984cd7 = function() { return logError(function (arg0) { - const ret = new Uint8Array(arg0 >>> 0); - return addHeapObject(ret); -}, arguments) }; - -module.exports.__wbg_newwithbyteoffsetandlength_6da8e527659b86aa = function() { return logError(function (arg0, arg1, arg2) { - const ret = new Uint8Array(getObject(arg0), arg1 >>> 0, arg2 >>> 0); - return addHeapObject(ret); -}, arguments) }; - -module.exports.__wbg_subarray_13db269f57aa838d = function() { return logError(function (arg0, arg1, arg2) { - const ret = getObject(arg0).subarray(arg1 >>> 0, arg2 >>> 0); - return addHeapObject(ret); -}, arguments) }; - -module.exports.__wbg_length_72e2208bbc0efc61 = function() { return logError(function (arg0) { - const ret = getObject(arg0).length; - _assertNum(ret); - return ret; -}, arguments) }; - -module.exports.__wbg_set_5cf90238115182c3 = function() { return logError(function (arg0, arg1, arg2) { - getObject(arg0).set(getObject(arg1), arg2 >>> 0); -}, arguments) }; - -module.exports.__wbindgen_is_function = function(arg0) { - const ret = typeof(getObject(arg0)) === 'function'; - _assertBoolean(ret); - return ret; -}; - -module.exports.__wbg_buffer_085ec1f694018c4f = function() { return logError(function (arg0) { - const ret = getObject(arg0).buffer; - return addHeapObject(ret); -}, arguments) }; - -module.exports.__wbg_get_97b561fb56f034b5 = function() { return handleError(function (arg0, arg1) { - const ret = Reflect.get(getObject(arg0), getObject(arg1)); - return addHeapObject(ret); -}, arguments) }; - -module.exports.__wbindgen_debug_string = function(arg0, arg1) { - const ret = debugString(getObject(arg1)); - const ptr1 = passStringToWasm0(ret, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc); - const len1 = WASM_VECTOR_LEN; - getInt32Memory0()[arg0 / 4 + 1] = len1; - getInt32Memory0()[arg0 / 4 + 0] = ptr1; -}; - -module.exports.__wbindgen_throw = function(arg0, arg1) { - throw new Error(getStringFromWasm0(arg0, arg1)); -}; - -module.exports.__wbindgen_memory = function() { - const ret = wasm.memory; - return addHeapObject(ret); -}; - -const path = require('path').join(__dirname, 'mercury_wasm_bg.wasm'); -const bytes = require('fs').readFileSync(path); - -const wasmModule = new WebAssembly.Module(bytes); -const wasmInstance = new WebAssembly.Instance(wasmModule, imports); -wasm = wasmInstance.exports; -module.exports.__wasm = wasm; - diff --git a/wasm/node_pkg/debug/mercury_wasm_bg.wasm b/wasm/node_pkg/debug/mercury_wasm_bg.wasm deleted file mode 100644 index ae2d29d0..00000000 Binary files a/wasm/node_pkg/debug/mercury_wasm_bg.wasm and /dev/null differ diff --git a/wasm/node_pkg/debug/mercury_wasm_bg.wasm.d.ts b/wasm/node_pkg/debug/mercury_wasm_bg.wasm.d.ts deleted file mode 100644 index 636e92b7..00000000 --- a/wasm/node_pkg/debug/mercury_wasm_bg.wasm.d.ts +++ /dev/null @@ -1,55 +0,0 @@ -/* tslint:disable */ -/* eslint-disable */ -export const memory: WebAssembly.Memory; -export function setConfig(a: number, b: number): number; -export function setBlockheight(a: number, b: number): number; -export function addToken(a: number, b: number): number; -export function confirmToken(a: number, b: number, c: number): number; -export function getTokens(a: number): number; -export function getBalance(a: number): number; -export function getSCAddress(a: number, b: number, c: number, d: number, e: number): void; -export function generateMnemonic(a: number): void; -export function fromMnemonic(a: number, b: number, c: number, d: number): number; -export function getActivityLog(a: number): number; -export function getCoins(a: number): number; -export function getNewCoin(a: number): number; -export function createDepositMsg1(a: number, b: number, c: number): number; -export function handleDepositMsg1Response(a: number, b: number): number; -export function createAggregatedAddress(a: number, b: number, c: number): number; -export function createAndCommitNonces(a: number): number; -export function getUserBackupAddress(a: number, b: number, c: number, d: number): void; -export function getPartialSigRequest(a: number, b: number, c: number, d: number, e: number, f: number, g: number, h: number, i: number, j: number, k: number): number; -export function createSignature(a: number, b: number, c: number, d: number, e: number, f: number, g: number, h: number, i: number, j: number, k: number): void; -export function newBackupTransaction(a: number, b: number, c: number, d: number, e: number): void; -export function createCpfpTx(a: number, b: number, c: number, d: number, e: number, f: number, g: number, h: number): void; -export function createTransferSignature(a: number, b: number, c: number, d: number, e: number, f: number, g: number, h: number): void; -export function createTransferUpdateMsg(a: number, b: number, c: number, d: number, e: number, f: number, g: number, h: number): number; -export function decodeTransferAddress(a: number, b: number): number; -export function decryptTransferMsg(a: number, b: number, c: number, d: number): number; -export function getTx0Outpoint(a: number): number; -export function verifyTransferSignature(a: number, b: number, c: number, d: number): number; -export function validateTx0OutputPubkey(a: number, b: number, c: number, d: number, e: number, f: number, g: number, h: number): number; -export function verifyLatestBackupTxPaysToUserPubkey(a: number, b: number, c: number, d: number, e: number): number; -export function getOutputAddressFromTx0(a: number, b: number, c: number, d: number, e: number, f: number): void; -export function verifyTransactionSignature(a: number, b: number, c: number, d: number, e: number, f: number): number; -export function verifyBlindedMusigScheme(a: number, b: number, c: number, d: number): number; -export function getBlockheight(a: number): number; -export function createTransferReceiverRequestPayload(a: number, b: number, c: number): number; -export function getNewKeyInfo(a: number, b: number, c: number, d: number, e: number, f: number, g: number, h: number, i: number, j: number): number; -export function validateAddress(a: number, b: number, c: number, d: number): number; -export function signMessage(a: number, b: number, c: number, d: number): void; -export function isEnclavePubkeyPartOfCoin(a: number, b: number, c: number): number; -export function latestBackuptxPaysToUserpubkey(a: number, b: number, c: number, d: number): number; -export function duplicateCoinToInitializedState(a: number, b: number, c: number): number; -export function getMockWallet(): number; -export function rustsecp256k1zkp_v0_8_1_default_illegal_callback_fn(a: number, b: number): void; -export function rustsecp256k1zkp_v0_8_1_default_error_callback_fn(a: number, b: number): void; -export function rustsecp256k1_v0_8_1_context_create(a: number): number; -export function rustsecp256k1_v0_8_1_context_destroy(a: number): void; -export function rustsecp256k1_v0_8_1_default_illegal_callback_fn(a: number, b: number): void; -export function rustsecp256k1_v0_8_1_default_error_callback_fn(a: number, b: number): void; -export function __wbindgen_malloc(a: number, b: number): number; -export function __wbindgen_realloc(a: number, b: number, c: number, d: number): number; -export function __wbindgen_add_to_stack_pointer(a: number): number; -export function __wbindgen_free(a: number, b: number, c: number): void; -export function __wbindgen_exn_store(a: number): void; diff --git a/wasm/node_pkg/debug/package.json b/wasm/node_pkg/debug/package.json deleted file mode 100644 index e9330880..00000000 --- a/wasm/node_pkg/debug/package.json +++ /dev/null @@ -1,14 +0,0 @@ -{ - "name": "mercury-wasm", - "collaborators": [ - "ttrevethan" - ], - "version": "0.1.0", - "files": [ - "mercury_wasm_bg.wasm", - "mercury_wasm.js", - "mercury_wasm.d.ts" - ], - "main": "mercury_wasm.js", - "types": "mercury_wasm.d.ts" -} \ No newline at end of file