diff --git a/package-lock.json b/package-lock.json index aea59f9..626b1ec 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,14 +1,16 @@ { "name": "bch-dex", - "version": "1.0.0", + "version": "2.0.2", "lockfileVersion": 2, "requires": true, "packages": { "": { "name": "bch-dex", - "version": "1.0.0", + "version": "2.0.2", "license": "MIT", "dependencies": { + "@chris.troutner/retry-queue": "1.0.5", + "@psf/bch-js": "^6.4.5", "axios": "0.27.2", "bch-message-lib": "2.2.1", "bcryptjs": "2.4.3", @@ -32,7 +34,7 @@ "koa2-ratelimit": "0.9.1", "libp2p": "^0.36.2", "line-reader": "0.4.0", - "minimal-slp-wallet": "5.1.0", + "minimal-slp-wallet": "../minimal-slp-wallet/", "mongoose": "5.13.14", "node-fetch": "npm:@achingbrain/node-fetch@2.6.7", "nodemailer": "6.7.5", @@ -56,6 +58,36 @@ "uuid": "8.3.2" } }, + "../minimal-slp-wallet": { + "version": "5.0.0", + "license": "MIT", + "dependencies": { + "@psf/bch-js": "6.4.5", + "apidoc": "0.51.0", + "bch-consumer": "1.3.1", + "bch-donation": "1.1.2", + "crypto-js": "4.0.0" + }, + "devDependencies": { + "browserify": "17.0.0", + "chai": "4.2.0", + "coveralls": "3.1.0", + "eslint": "7.17.0", + "eslint-config-prettier": "7.1.0", + "eslint-config-standard": "16.0.2", + "eslint-plugin-node": "11.1.0", + "eslint-plugin-prettier": "3.3.1", + "eslint-plugin-standard": "4.0.1", + "husky": "4.3.8", + "lodash.clonedeep": "4.5.0", + "mocha": "9.2.1", + "nyc": "15.1.0", + "semantic-release": "19.0.3", + "sinon": "9.2.0", + "standard": "16.0.4", + "tinyify": "3.0.0" + } + }, "node_modules/@babel/code-frame": { "version": "7.18.6", "dev": true, @@ -160,7 +192,8 @@ }, "node_modules/@chris.troutner/bip32-utils": { "version": "1.0.5", - "license": "MIT", + "resolved": "https://registry.npmjs.org/@chris.troutner/bip32-utils/-/bip32-utils-1.0.5.tgz", + "integrity": "sha512-pa9dh5VpPmfol1bdLy+FyqONmxlf/QH6Q01a57OP6C9gTVOZM1Rt0kCLXxXKC6e2AnNIrXpYN1UtlyBm+r6P0g==", "dependencies": { "keccak": "^3.0.1", "tape": "*" @@ -169,6 +202,50 @@ "node": ">=10.15.1" } }, + "node_modules/@chris.troutner/retry-queue": { + "version": "1.0.5", + "resolved": "https://registry.npmjs.org/@chris.troutner/retry-queue/-/retry-queue-1.0.5.tgz", + "integrity": "sha512-autE5GRCXR0xgPqq6qIq1sbUw8j2btxCWlezSvpRJmPVQQZwGhYbeF7euxRbpMmi31kj47iHgG7sb45bD0HY7Q==", + "dependencies": { + "p-queue": "7.3.0", + "p-retry": "5.1.1" + } + }, + "node_modules/@chris.troutner/retry-queue/node_modules/@types/retry": { + "version": "0.12.1", + "resolved": "https://registry.npmjs.org/@types/retry/-/retry-0.12.1.tgz", + "integrity": "sha512-xoDlM2S4ortawSWORYqsdU+2rxdh4LRW9ytc3zmT37RIKQh6IHyKwwtKhKis9ah8ol07DCkZxPt8BBvPjC6v4g==" + }, + "node_modules/@chris.troutner/retry-queue/node_modules/p-queue": { + "version": "7.3.0", + "resolved": "https://registry.npmjs.org/p-queue/-/p-queue-7.3.0.tgz", + "integrity": "sha512-5fP+yVQ0qp0rEfZoDTlP2c3RYBgxvRsw30qO+VtPPc95lyvSG+x6USSh1TuLB4n96IO6I8/oXQGsTgtna4q2nQ==", + "dependencies": { + "eventemitter3": "^4.0.7", + "p-timeout": "^5.0.2" + }, + "engines": { + "node": ">=12" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/@chris.troutner/retry-queue/node_modules/p-retry": { + "version": "5.1.1", + "resolved": "https://registry.npmjs.org/p-retry/-/p-retry-5.1.1.tgz", + "integrity": "sha512-i69WkEU5ZAL8mrmdmVviWwU+DN+IUF8f4sSJThoJ3z5A7Nn5iuO5ROX3Boye0u+uYQLOSfgFl7SuFZCjlAVbQA==", + "dependencies": { + "@types/retry": "0.12.1", + "retry": "^0.13.1" + }, + "engines": { + "node": "^12.20.0 || ^14.13.1 || >=16.0.0" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, "node_modules/@colors/colors": { "version": "1.5.0", "license": "MIT", @@ -1000,7 +1077,8 @@ }, "node_modules/@psf/bch-js": { "version": "6.4.5", - "license": "MIT", + "resolved": "https://registry.npmjs.org/@psf/bch-js/-/bch-js-6.4.5.tgz", + "integrity": "sha512-sH72zbJJI5oe9EUMczFQb0jCaNQb8rc3/86E6xXKl3325HCwBqE80BX7JFvZ97Qv1gGxwp/3WROp59v6Dz2NKA==", "dependencies": { "@chris.troutner/bip32-utils": "1.0.5", "@psf/bip21": "2.0.1", @@ -1030,25 +1108,29 @@ }, "node_modules/@psf/bch-js/node_modules/axios": { "version": "0.26.1", - "license": "MIT", + "resolved": "https://registry.npmjs.org/axios/-/axios-0.26.1.tgz", + "integrity": "sha512-fPwcX4EvnSHuInCMItEhAGnaSEXRBjtzh9fOtsE6E1G6p7vl7edEeZe11QHf18+6+9gR5PbKV/sGKNaD8YaMeA==", "dependencies": { "follow-redirects": "^1.14.8" } }, "node_modules/@psf/bip21": { "version": "2.0.1", - "license": "ISC", + "resolved": "https://registry.npmjs.org/@psf/bip21/-/bip21-2.0.1.tgz", + "integrity": "sha512-U9c8xBV31n+D7qxOPBO0vQ015DNvKskWCUbVgoMfH5AUNHLYrSDWIrCx4P7v9etfdu6LpPdsYr53KDSAIk0b7Q==", "dependencies": { "qs": "^6.3.0" } }, "node_modules/@psf/bitcoincash-ops": { "version": "2.0.0", - "license": "MIT" + "resolved": "https://registry.npmjs.org/@psf/bitcoincash-ops/-/bitcoincash-ops-2.0.0.tgz", + "integrity": "sha512-M3PWqRpeJq6rli2NqWGbas76z9TrdGOmNuDFACBWBMctPucEAsFQY2AmyFHRSa7hEwythwvrPh9AG/n6ehmEog==" }, "node_modules/@psf/bitcoincashjs-lib": { "version": "4.0.2", - "license": "MIT", + "resolved": "https://registry.npmjs.org/@psf/bitcoincashjs-lib/-/bitcoincashjs-lib-4.0.2.tgz", + "integrity": "sha512-fTy9mW4H0NkQ+dojGtf+nPduA27F3V2YpBi5licYUVjdVRD/xpUCTgEN1cYRAupOaeDH/AYOWT0MWLkbQSTxAQ==", "dependencies": { "@psf/bitcoincash-ops": "^2.0.0", "@psf/pushdata-bitcoin": "^1.2.2", @@ -1072,14 +1154,16 @@ }, "node_modules/@psf/coininfo": { "version": "4.0.0", - "license": "MIT", + "resolved": "https://registry.npmjs.org/@psf/coininfo/-/coininfo-4.0.0.tgz", + "integrity": "sha512-RwBc09790kbaOt8uZJMyvLqf1UziTd20FXu78bM8bMlkClnZQTJyNDdLCsFSBkJQYAJtGMkjdQ/o3/UaSC7c2Q==", "dependencies": { "safe-buffer": "^5.1.1" } }, "node_modules/@psf/pushdata-bitcoin": { "version": "1.2.2", - "license": "MIT", + "resolved": "https://registry.npmjs.org/@psf/pushdata-bitcoin/-/pushdata-bitcoin-1.2.2.tgz", + "integrity": "sha512-e1qkZLJFU6Ldg7TMBgSkiR5U1NfpRgSIr2ppk8BeED/Q9wUc9DEVAjXfPMD65xgXdqnlyFEtLbpPMWwyydMVUQ==", "dependencies": { "@psf/bitcoincash-ops": "^2.0.0" } @@ -1833,7 +1917,8 @@ }, "node_modules/array.prototype.every": { "version": "1.1.3", - "license": "MIT", + "resolved": "https://registry.npmjs.org/array.prototype.every/-/array.prototype.every-1.1.3.tgz", + "integrity": "sha512-vWnriJI//SOMOWtXbU/VXhJ/InfnNHPF6BLKn5WfY8xXy+NWql0fUy20GO3sdqBhCAO+qw8S/E5nJiZX+QFdCA==", "dependencies": { "call-bind": "^1.0.2", "define-properties": "^1.1.3", @@ -1932,7 +2017,8 @@ }, "node_modules/available-typed-arrays": { "version": "1.0.5", - "license": "MIT", + "resolved": "https://registry.npmjs.org/available-typed-arrays/-/available-typed-arrays-1.0.5.tgz", + "integrity": "sha512-DMD0KiN46eipeziST1LPP/STfDU0sufISXmjSgvVsoU2tqxctQeASejWcfNtxYKqETM1UxQ8sp2OrSBWpHY6sw==", "engines": { "node": ">= 0.4" }, @@ -1991,88 +2077,15 @@ }, "node_modules/bc-bip68": { "version": "1.0.5", - "license": "ISC", + "resolved": "https://registry.npmjs.org/bc-bip68/-/bc-bip68-1.0.5.tgz", + "integrity": "sha512-GzaMlN7pNthrY5BhReVhnfr4Ixx+GUSfyNRHYh0QiMUF0d0+0YaD8MpEdv6AjFBksg/zlqL1fVCBBm6PpTt2Rg==", "engines": { "node": ">=4.5.0" } }, - "node_modules/bch-consumer": { - "version": "1.3.1", - "license": "MIT", - "dependencies": { - "@psf/bch-js": "6.4.5", - "apidoc": "0.51.0", - "axios": "0.25.0" - } - }, - "node_modules/bch-consumer/node_modules/apidoc": { - "version": "0.51.0", - "license": "MIT", - "os": [ - "darwin", - "freebsd", - "linux", - "openbsd", - "win32" - ], - "dependencies": { - "bootstrap": "3.4.1", - "commander": "^8.3.0", - "diff-match-patch": "^1.0.5", - "esbuild-loader": "^2.16.0", - "expose-loader": "^3.1.0", - "fs-extra": "^10.0.0", - "glob": "^7.2.0", - "handlebars": "^4.7.7", - "iconv-lite": "^0.6.3", - "jquery": "^3.6.0", - "klaw-sync": "^6.0.0", - "lodash": "^4.17.21", - "markdown-it": "^12.2.0", - "nodemon": "^2.0.15", - "path-to-regexp": "^6.2.0", - "prismjs": "^1.25.0", - "semver": "^7.3.5", - "style-loader": "^3.3.1", - "url-parse": "^1.5.3", - "webpack": "^5.64.2", - "webpack-cli": "^4.9.1", - "winston": "^3.3.3" - }, - "bin": { - "apidoc": "bin/apidoc" - }, - "engines": { - "node": ">=14.0.0" - } - }, - "node_modules/bch-consumer/node_modules/axios": { - "version": "0.25.0", - "license": "MIT", - "dependencies": { - "follow-redirects": "^1.14.7" - } - }, - "node_modules/bch-consumer/node_modules/glob": { - "version": "7.2.3", - "license": "ISC", - "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/bch-donation": { "version": "1.1.2", + "dev": true, "license": "MIT", "dependencies": { "apidoc": "0.51.0" @@ -2080,6 +2093,7 @@ }, "node_modules/bch-donation/node_modules/apidoc": { "version": "0.51.0", + "dev": true, "license": "MIT", "os": [ "darwin", @@ -2121,6 +2135,7 @@ }, "node_modules/bch-donation/node_modules/glob": { "version": "7.2.3", + "dev": true, "license": "ISC", "dependencies": { "fs.realpath": "^1.0.0", @@ -2166,7 +2181,8 @@ }, "node_modules/bchaddrjs-slp": { "version": "0.2.5", - "license": "MIT", + "resolved": "https://registry.npmjs.org/bchaddrjs-slp/-/bchaddrjs-slp-0.2.5.tgz", + "integrity": "sha512-33flmPcqMFswerKu7477DSUNMVMQR3tHDk3lvbmsdkEva+TxVGGWWE/p5Lqx9M/8t3vkbe7fzmVhj4QhChcCyA==", "dependencies": { "bs58check": "^2.1.2", "cashaddrjs-slp": "^0.2.11" @@ -2197,7 +2213,8 @@ }, "node_modules/big-integer": { "version": "1.6.51", - "license": "Unlicense", + "resolved": "https://registry.npmjs.org/big-integer/-/big-integer-1.6.51.tgz", + "integrity": "sha512-GPEid2Y9QU1Exl1rpO9B2IPJGHPSupF5GnVIP0blYvNOMer2bTvSWs1jGOUg04hTmu67nmLsQ9TBo1puaotBHg==", "engines": { "node": ">=0.6" } @@ -2235,7 +2252,8 @@ }, "node_modules/bip-schnorr": { "version": "0.3.0", - "license": "MIT", + "resolved": "https://registry.npmjs.org/bip-schnorr/-/bip-schnorr-0.3.0.tgz", + "integrity": "sha512-Sc1Hn2+1n+okPEW8G+JLjeaM12dsUOwr+oFlMDSKR9wYwNGMw0alskeBIHTmXxBxMZSWKhCW7PwKQVDyGmnaVg==", "dependencies": { "ecurve": "^1.0.6", "js-sha256": "^0.9.0", @@ -2248,6 +2266,8 @@ }, "node_modules/bip38": { "version": "2.0.2", + "resolved": "https://registry.npmjs.org/bip38/-/bip38-2.0.2.tgz", + "integrity": "sha512-22KDak0RDyghFbR0Si7wyq9IgY423YzGYzWLpGeofH3DaolOQqjD3mNN08eFoubKlbyclOQKFwtONMv2SD9V3A==", "dependencies": { "bigi": "^1.2.0", "browserify-aes": "^1.0.1", @@ -2260,7 +2280,8 @@ }, "node_modules/bip39": { "version": "3.0.2", - "license": "ISC", + "resolved": "https://registry.npmjs.org/bip39/-/bip39-3.0.2.tgz", + "integrity": "sha512-J4E1r2N0tUylTKt07ibXvhpT2c5pyAFgvuA5q1H9uDy6dEGpjV8jmymh3MTYJDLCNbIVClSB9FbND49I6N24MQ==", "dependencies": { "@types/node": "11.11.6", "create-hash": "^1.1.0", @@ -2305,7 +2326,8 @@ }, "node_modules/bitcoinjs-message": { "version": "2.0.0", - "license": "MIT", + "resolved": "https://registry.npmjs.org/bitcoinjs-message/-/bitcoinjs-message-2.0.0.tgz", + "integrity": "sha512-H5pJC7/eSqVjREiEOZ4jifX+7zXYP3Y28GIOIqg9hrgE7Vj8Eva9+HnVqnxwA1rJPOwZKuw0vo6k0UxgVc6q1A==", "dependencies": { "bs58check": "^2.0.2", "buffer-equals": "^1.0.3", @@ -2524,7 +2546,8 @@ }, "node_modules/buffer-equals": { "version": "1.0.4", - "license": "MIT", + "resolved": "https://registry.npmjs.org/buffer-equals/-/buffer-equals-1.0.4.tgz", + "integrity": "sha512-99MsCq0j5+RhubVEtKQgKaD6EM+UP3xJgIvQqwJ3SOLDUekzxMX1ylXBng+Wa2sh7mGT0W6RUly8ojjr1Tt6nA==", "engines": { "node": ">=0.10.0" } @@ -2779,7 +2802,8 @@ }, "node_modules/cashaddrjs-slp": { "version": "0.2.12", - "license": "MIT", + "resolved": "https://registry.npmjs.org/cashaddrjs-slp/-/cashaddrjs-slp-0.2.12.tgz", + "integrity": "sha512-n2TTIuW6vZZxYvjvsUAA+wOM0Zkj+3RRKUtDC1XSu4Ic4XVr0yFJkl1bzQkHWda7nkVT51sxjZneygz7D0SyrQ==", "dependencies": { "big-integer": "^1.6.34" } @@ -3357,10 +3381,6 @@ "node": ">=0.8.0" } }, - "node_modules/crypto-js": { - "version": "4.0.0", - "license": "MIT" - }, "node_modules/crypto-random-string": { "version": "2.0.0", "license": "MIT", @@ -3524,7 +3544,8 @@ }, "node_modules/defined": { "version": "1.0.0", - "license": "MIT" + "resolved": "https://registry.npmjs.org/defined/-/defined-1.0.0.tgz", + "integrity": "sha512-Y2caI5+ZwS5c3RiNDJ6u53VhQHv+hHKwhkI1iHvceKUHw9Df6EK2zRLfjejRgMuCuxK7PfSWIMwWecceVvThjQ==" }, "node_modules/del": { "version": "6.1.1", @@ -3660,7 +3681,8 @@ }, "node_modules/dotignore": { "version": "0.1.2", - "license": "MIT", + "resolved": "https://registry.npmjs.org/dotignore/-/dotignore-0.1.2.tgz", + "integrity": "sha512-UGGGWfSauusaVJC+8fgV+NVvBXkCTmVv7sk6nojDZZvuOUNGUy0Zk4UpHQD6EDjS0jpBwcACvH4eofvyzBcRDw==", "dependencies": { "minimatch": "^3.0.4" }, @@ -3720,14 +3742,16 @@ }, "node_modules/ecashaddrjs": { "version": "1.0.7", - "license": "MIT", + "resolved": "https://registry.npmjs.org/ecashaddrjs/-/ecashaddrjs-1.0.7.tgz", + "integrity": "sha512-KsvHYLlYtLr/GBkEPiwwQDIDBzqRx61qC34n1puHKOjVE4Uwg3syHccjFCqNynLa6T6xI0Rd7ByCRUJcuJcoIw==", "dependencies": { "big-integer": "1.6.36" } }, "node_modules/ecashaddrjs/node_modules/big-integer": { "version": "1.6.36", - "license": "Unlicense", + "resolved": "https://registry.npmjs.org/big-integer/-/big-integer-1.6.36.tgz", + "integrity": "sha512-t70bfa7HYEA1D9idDbmuv7YbsbVkQ+Hp+8KFSul4aE5e/i1bjCNIRYJZlA8Q8p0r9T8cF/RVvwUgRA//FydEyg==", "engines": { "node": ">=0.6" } @@ -3961,7 +3985,8 @@ }, "node_modules/es-get-iterator": { "version": "1.1.2", - "license": "MIT", + "resolved": "https://registry.npmjs.org/es-get-iterator/-/es-get-iterator-1.1.2.tgz", + "integrity": "sha512-+DTO8GYwbMCwbywjimwZMHp8AuYXOS2JZFWoi2AlPOS3ebnII9w/NLpNZtA7A0YLaVDw+O7KFCeoIV7OPvM7hQ==", "dependencies": { "call-bind": "^1.0.2", "get-intrinsic": "^1.1.0", @@ -3978,7 +4003,8 @@ }, "node_modules/es-get-iterator/node_modules/isarray": { "version": "2.0.5", - "license": "MIT" + "resolved": "https://registry.npmjs.org/isarray/-/isarray-2.0.5.tgz", + "integrity": "sha512-xHjhDr3cNBK0BzdUJSPXZntQUx/mwMS5Rw4A7lPJ90XGAO6ISP/ePDNuo0vhqOZU+UD5JoodwCAAoZQd3FeAKw==" }, "node_modules/es-module-lexer": { "version": "0.9.3", @@ -4818,7 +4844,8 @@ }, "node_modules/for-each": { "version": "0.3.3", - "license": "MIT", + "resolved": "https://registry.npmjs.org/for-each/-/for-each-0.3.3.tgz", + "integrity": "sha512-jqYfLp7mo9vIyQf8ykW2v7A+2N4QjeCeI5+Dz9XraiO1ign81wjiH7Fb9vSOWvQfNtmSa4H2RoQTrrXivdUZmw==", "dependencies": { "is-callable": "^1.1.3" } @@ -5011,7 +5038,8 @@ }, "node_modules/get-package-type": { "version": "0.1.0", - "license": "MIT", + "resolved": "https://registry.npmjs.org/get-package-type/-/get-package-type-0.1.0.tgz", + "integrity": "sha512-pjzuKtY64GYfWizNAJ0fr9VqttZkNiK2iS430LtIHzjBEr6bX8Am2zm4sW4Ro5wjWW5cAlRL1qAMTcXbjNAO2Q==", "engines": { "node": ">=8.0.0" } @@ -5290,7 +5318,8 @@ }, "node_modules/has-dynamic-import": { "version": "2.0.1", - "license": "MIT", + "resolved": "https://registry.npmjs.org/has-dynamic-import/-/has-dynamic-import-2.0.1.tgz", + "integrity": "sha512-X3fbtsZmwb6W7fJGR9o7x65fZoodygCrZ3TVycvghP62yYQfS0t4RS0Qcz+j5tQYUKeSWS09tHkWW6WhFV3XhQ==", "dependencies": { "call-bind": "^1.0.2", "get-intrinsic": "^1.1.1" @@ -6135,7 +6164,8 @@ }, "node_modules/is-arguments": { "version": "1.1.1", - "license": "MIT", + "resolved": "https://registry.npmjs.org/is-arguments/-/is-arguments-1.1.1.tgz", + "integrity": "sha512-8Q7EARjzEnKpt/PCD7e1cgUS0a6X8u5tdSiMqXhojOdoV9TsMsiO+9VLC5vAmO8N7/GmXn7yjR8qnA6bVAEzfA==", "dependencies": { "call-bind": "^1.0.2", "has-tostringtag": "^1.0.0" @@ -6307,7 +6337,8 @@ }, "node_modules/is-map": { "version": "2.0.2", - "license": "MIT", + "resolved": "https://registry.npmjs.org/is-map/-/is-map-2.0.2.tgz", + "integrity": "sha512-cOZFQQozTha1f4MxLFzlgKYPTyj26picdZTx82hbc/Xf4K/tZOOXSCkMvU4pKioRXGDLJRn0GM7Upe7kR721yg==", "funding": { "url": "https://github.com/sponsors/ljharb" } @@ -6416,7 +6447,8 @@ }, "node_modules/is-set": { "version": "2.0.2", - "license": "MIT", + "resolved": "https://registry.npmjs.org/is-set/-/is-set-2.0.2.tgz", + "integrity": "sha512-+2cnTEZeY5z/iXGbLhPrOAaK/Mau5k5eXq9j14CpRTftq0pAJu2MwVRSZhyZWBzx3o6X795Lz6Bpb6R0GKf37g==", "funding": { "url": "https://github.com/sponsors/ljharb" } @@ -6480,7 +6512,8 @@ }, "node_modules/is-typed-array": { "version": "1.1.9", - "license": "MIT", + "resolved": "https://registry.npmjs.org/is-typed-array/-/is-typed-array-1.1.9.tgz", + "integrity": "sha512-kfrlnTTn8pZkfpJMUgYD7YZ3qzeJgWUn8XfVYBARc4wnmNOmLbmuuaAs3q5fvB0UJOn6yHAKaGTPM7d6ezoD/A==", "dependencies": { "available-typed-arrays": "^1.0.5", "call-bind": "^1.0.2", @@ -6512,7 +6545,8 @@ }, "node_modules/is-weakmap": { "version": "2.0.1", - "license": "MIT", + "resolved": "https://registry.npmjs.org/is-weakmap/-/is-weakmap-2.0.1.tgz", + "integrity": "sha512-NSBR4kH5oVj1Uwvv970ruUkCV7O1mzgVFO4/rev2cLRda9Tm9HrL70ZPut4rOHgY0FNrUu9BCbXA2sdQ+x0chA==", "funding": { "url": "https://github.com/sponsors/ljharb" } @@ -6529,7 +6563,8 @@ }, "node_modules/is-weakset": { "version": "2.0.2", - "license": "MIT", + "resolved": "https://registry.npmjs.org/is-weakset/-/is-weakset-2.0.2.tgz", + "integrity": "sha512-t2yVvttHkQktwnNNmBQ98AhENLdPUTDTE21uPqAQ0ARwQfGeQKRVS0NNurH7bTf7RrvcVn1OOge45CnBeHCSmg==", "dependencies": { "call-bind": "^1.0.2", "get-intrinsic": "^1.1.1" @@ -6792,7 +6827,8 @@ }, "node_modules/js-sha256": { "version": "0.9.0", - "license": "MIT" + "resolved": "https://registry.npmjs.org/js-sha256/-/js-sha256-0.9.0.tgz", + "integrity": "sha512-sga3MHh9sgQN2+pJ9VYZ+1LPwXOxuBJBA5nrR5/ofPfuiJBE2hnjsaN8se8JznOmGLN2p49Pe5U/ttafcs/apA==" }, "node_modules/js-sha3": { "version": "0.8.0", @@ -7007,8 +7043,9 @@ }, "node_modules/keccak": { "version": "3.0.2", + "resolved": "https://registry.npmjs.org/keccak/-/keccak-3.0.2.tgz", + "integrity": "sha512-PyKKjkH53wDMLGrvmRGSNWgmSxZOUqbnXwKL9tmgbFYA1iAYqW21kfR7mZXV0MlESiefxQQE9X9fTa3X+2MPDQ==", "hasInstallScript": true, - "license": "MIT", "dependencies": { "node-addon-api": "^2.0.0", "node-gyp-build": "^4.2.0", @@ -7931,74 +7968,8 @@ } }, "node_modules/minimal-slp-wallet": { - "version": "5.1.0", - "license": "MIT", - "dependencies": { - "@psf/bch-js": "6.4.5", - "apidoc": "0.51.0", - "bch-consumer": "1.3.1", - "bch-donation": "1.1.2", - "crypto-js": "4.0.0" - } - }, - "node_modules/minimal-slp-wallet/node_modules/apidoc": { - "version": "0.51.0", - "license": "MIT", - "os": [ - "darwin", - "freebsd", - "linux", - "openbsd", - "win32" - ], - "dependencies": { - "bootstrap": "3.4.1", - "commander": "^8.3.0", - "diff-match-patch": "^1.0.5", - "esbuild-loader": "^2.16.0", - "expose-loader": "^3.1.0", - "fs-extra": "^10.0.0", - "glob": "^7.2.0", - "handlebars": "^4.7.7", - "iconv-lite": "^0.6.3", - "jquery": "^3.6.0", - "klaw-sync": "^6.0.0", - "lodash": "^4.17.21", - "markdown-it": "^12.2.0", - "nodemon": "^2.0.15", - "path-to-regexp": "^6.2.0", - "prismjs": "^1.25.0", - "semver": "^7.3.5", - "style-loader": "^3.3.1", - "url-parse": "^1.5.3", - "webpack": "^5.64.2", - "webpack-cli": "^4.9.1", - "winston": "^3.3.3" - }, - "bin": { - "apidoc": "bin/apidoc" - }, - "engines": { - "node": ">=14.0.0" - } - }, - "node_modules/minimal-slp-wallet/node_modules/glob": { - "version": "7.2.3", - "license": "ISC", - "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" - } + "resolved": "../minimal-slp-wallet", + "link": true }, "node_modules/minimalistic-assert": { "version": "1.0.1", @@ -8699,7 +8670,8 @@ }, "node_modules/node-addon-api": { "version": "2.0.2", - "license": "MIT" + "resolved": "https://registry.npmjs.org/node-addon-api/-/node-addon-api-2.0.2.tgz", + "integrity": "sha512-Ntyt4AIXyaLIuMHF6IOoTakB3K+RWxwtsHNRxllEoA6vPwP9o4866g6YWDLUdnucilZhmkxiHwHr11gAENw+QA==" }, "node_modules/node-emoji": { "version": "1.11.0", @@ -8725,8 +8697,9 @@ } }, "node_modules/node-gyp-build": { - "version": "4.4.0", - "license": "MIT", + "version": "4.5.0", + "resolved": "https://registry.npmjs.org/node-gyp-build/-/node-gyp-build-4.5.0.tgz", + "integrity": "sha512-2iGbaQBV+ITgCz76ZEjmhUKAKVf7xfY1sRl4UiKQspfZMH2h06SyhNsnSVy50cwkFQDGLyif6m/6uFXHkOZ6rg==", "bin": { "node-gyp-build": "bin.js", "node-gyp-build-optional": "optional.js", @@ -11320,7 +11293,8 @@ }, "node_modules/object-is": { "version": "1.1.5", - "license": "MIT", + "resolved": "https://registry.npmjs.org/object-is/-/object-is-1.1.5.tgz", + "integrity": "sha512-3cyDsyHgtmi7I7DfSSI2LDp6SK2lwvtbg0p0R1e0RvTqF5ceGx+K2dfSjm1bKDMVCFEDAQvy+o8c6a7VujOddw==", "dependencies": { "call-bind": "^1.0.2", "define-properties": "^1.1.3" @@ -11702,6 +11676,17 @@ "url": "https://github.com/sponsors/sindresorhus" } }, + "node_modules/p-timeout": { + "version": "5.1.0", + "resolved": "https://registry.npmjs.org/p-timeout/-/p-timeout-5.1.0.tgz", + "integrity": "sha512-auFDyzzzGZZZdHz3BtET9VEz0SE/uMEAx7uWfGPucfzEwwe/xH0iVeZibQmANYE/hp9T2+UUZT5m+BKyrDp3Ew==", + "engines": { + "node": ">=12" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, "node_modules/p-try": { "version": "1.0.0", "dev": true, @@ -12228,6 +12213,7 @@ }, "node_modules/querystringify": { "version": "2.2.0", + "dev": true, "license": "MIT" }, "node_modules/queue-microtask": { @@ -12715,6 +12701,7 @@ }, "node_modules/requires-port": { "version": "1.0.0", + "dev": true, "license": "MIT" }, "node_modules/resolve": { @@ -12805,7 +12792,8 @@ }, "node_modules/resumer": { "version": "0.0.0", - "license": "MIT", + "resolved": "https://registry.npmjs.org/resumer/-/resumer-0.0.0.tgz", + "integrity": "sha512-Fn9X8rX8yYF4m81rZCK/5VmrmsSbqS/i3rDLl6ZZHAXgC2nTAx3dhwG8q8odP/RmdLa2YrybDJaAMg+X1ajY3w==", "dependencies": { "through": "~2.3.4" } @@ -12916,14 +12904,16 @@ }, "node_modules/satoshi-bitcoin": { "version": "1.0.4", - "license": "MIT", + "resolved": "https://registry.npmjs.org/satoshi-bitcoin/-/satoshi-bitcoin-1.0.4.tgz", + "integrity": "sha512-YuHOmw5wsz6wuHIQdsz5b2cgtuKtV/jEcZ4NGmWN5tM/gz5T9Q+DSuLlnuf5BP/jsQWgR0ofmY4f8Dm6JnqSug==", "dependencies": { "big.js": "^3.1.3" } }, "node_modules/satoshi-bitcoin/node_modules/big.js": { "version": "3.2.0", - "license": "MIT", + "resolved": "https://registry.npmjs.org/big.js/-/big.js-3.2.0.tgz", + "integrity": "sha512-+hN/Zh2D08Mx65pZ/4g5bsmNiZUuChDiQfTUQ7qJr4/kuopCr88xZsAXv6mBoZEsUI4OuGHlX59qE94K2mMW8Q==", "engines": { "node": "*" } @@ -12950,7 +12940,8 @@ }, "node_modules/scryptsy": { "version": "2.1.0", - "license": "MIT" + "resolved": "https://registry.npmjs.org/scryptsy/-/scryptsy-2.1.0.tgz", + "integrity": "sha512-1CdSqHQowJBnMAFyPEBRfqag/YP9OF394FV+4YREIJX4ljD7OxvQRDayyoyyCk+senRjSkP6VnUNQmVQqB6g7w==" }, "node_modules/secp256k1": { "version": "3.8.0", @@ -13342,14 +13333,16 @@ }, "node_modules/slp-mdm": { "version": "0.0.6", - "license": "MIT", + "resolved": "https://registry.npmjs.org/slp-mdm/-/slp-mdm-0.0.6.tgz", + "integrity": "sha512-fbjlIg/o8OtzgK2JydC6POJp3Qup/rLgy4yB5hoLgxWRlERyJyE29ScwS3r9TTwPxe12qK55pyivAdNOZZXL0A==", "dependencies": { "bignumber.js": "^9.0.0" } }, "node_modules/slp-parser": { "version": "0.0.4", - "license": "MIT", + "resolved": "https://registry.npmjs.org/slp-parser/-/slp-parser-0.0.4.tgz", + "integrity": "sha512-AvbslJumkzGfMGWNvuE2pWx2nyHEk/VgQ7l119kDKIFRTuRUWOkyOULLauw5laGRQsBRThg6NCx/TsR3grX6GA==", "dependencies": { "bignumber.js": "^9.0.0" } @@ -14128,7 +14121,8 @@ }, "node_modules/string.prototype.trim": { "version": "1.2.6", - "license": "MIT", + "resolved": "https://registry.npmjs.org/string.prototype.trim/-/string.prototype.trim-1.2.6.tgz", + "integrity": "sha512-8lMR2m+U0VJTPp6JjvJTtGyc4FIGq9CdRt7O9p6T0e6K4vjU+OP+SQJpbe/SBmRcCUIvNUnjsbmY6lnMp8MhsQ==", "dependencies": { "call-bind": "^1.0.2", "define-properties": "^1.1.4", @@ -14318,8 +14312,9 @@ } }, "node_modules/tape": { - "version": "5.5.3", - "license": "MIT", + "version": "5.6.1", + "resolved": "https://registry.npmjs.org/tape/-/tape-5.6.1.tgz", + "integrity": "sha512-reNzS3rzsJtKk0f+zJx2XlzIsjJXlIcOIrIxk5shHAG/DzW3BKyMg8UfN79oluYlcWo4lIt56ahLqwgpRT4idg==", "dependencies": { "array.prototype.every": "^1.1.3", "call-bind": "^1.0.2", @@ -14328,28 +14323,32 @@ "dotignore": "^0.1.2", "for-each": "^0.3.3", "get-package-type": "^0.1.0", - "glob": "^7.2.0", + "glob": "^7.2.3", "has": "^1.0.3", "has-dynamic-import": "^2.0.1", "inherits": "^2.0.4", "is-regex": "^1.1.4", "minimist": "^1.2.6", - "object-inspect": "^1.12.0", + "object-inspect": "^1.12.2", "object-is": "^1.1.5", "object-keys": "^1.1.1", - "object.assign": "^4.1.2", + "object.assign": "^4.1.4", "resolve": "^2.0.0-next.3", "resumer": "^0.0.0", - "string.prototype.trim": "^1.2.5", + "string.prototype.trim": "^1.2.6", "through": "^2.3.8" }, "bin": { "tape": "bin/tape" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" } }, "node_modules/tape/node_modules/deep-equal": { "version": "2.0.5", - "license": "MIT", + "resolved": "https://registry.npmjs.org/deep-equal/-/deep-equal-2.0.5.tgz", + "integrity": "sha512-nPiRgmbAtm1a3JsnLCf6/SLfXcjyN5v8L1TXzdCmHrXJ4hx+gW/w1YCcn7z8gJtSiDArZCgYtbao3QqLm/N1Sw==", "dependencies": { "call-bind": "^1.0.0", "es-get-iterator": "^1.1.1", @@ -14373,7 +14372,8 @@ }, "node_modules/tape/node_modules/glob": { "version": "7.2.3", - "license": "ISC", + "resolved": "https://registry.npmjs.org/glob/-/glob-7.2.3.tgz", + "integrity": "sha512-nFR0zLpU2YCaRxwoCJvL6UvCH2JFyFVIvwTLsIf21AuHlMskA1hhTdk+LlYJtOlYt9v6dvszD2BGRqBL+iQK9Q==", "dependencies": { "fs.realpath": "^1.0.0", "inflight": "^1.0.4", @@ -14391,11 +14391,13 @@ }, "node_modules/tape/node_modules/isarray": { "version": "2.0.5", - "license": "MIT" + "resolved": "https://registry.npmjs.org/isarray/-/isarray-2.0.5.tgz", + "integrity": "sha512-xHjhDr3cNBK0BzdUJSPXZntQUx/mwMS5Rw4A7lPJ90XGAO6ISP/ePDNuo0vhqOZU+UD5JoodwCAAoZQd3FeAKw==" }, "node_modules/tape/node_modules/resolve": { "version": "2.0.0-next.4", - "license": "MIT", + "resolved": "https://registry.npmjs.org/resolve/-/resolve-2.0.0-next.4.tgz", + "integrity": "sha512-iMDbmAWtfU+MHpxt/I5iWI7cY6YVEZUQ3MBgPQ++XD1PELuJHIl82xBmObyP2KyQmkNB2dsqF7seoQQiAn5yDQ==", "dependencies": { "is-core-module": "^2.9.0", "path-parse": "^1.0.7", @@ -14966,6 +14968,7 @@ }, "node_modules/url-parse": { "version": "1.5.10", + "dev": true, "license": "MIT", "dependencies": { "querystringify": "^2.1.1", @@ -15268,7 +15271,8 @@ }, "node_modules/which-collection": { "version": "1.0.1", - "license": "MIT", + "resolved": "https://registry.npmjs.org/which-collection/-/which-collection-1.0.1.tgz", + "integrity": "sha512-W8xeTUwaln8i3K/cY1nGXzdnVZlidBcagyNFtBdD5kxnb4TvGKR7FfSIS3mYpwWS1QUCutfKz8IY8RjftB0+1A==", "dependencies": { "is-map": "^2.0.1", "is-set": "^2.0.1", @@ -15289,7 +15293,8 @@ }, "node_modules/which-typed-array": { "version": "1.1.8", - "license": "MIT", + "resolved": "https://registry.npmjs.org/which-typed-array/-/which-typed-array-1.1.8.tgz", + "integrity": "sha512-Jn4e5PItbcAHyLoRDwvPj1ypu27DJbtdYXUa5zsinrUx77Uvfb0cXwwnGMTn7cjUfhhqgVQnVJCwF+7cgU7tpw==", "dependencies": { "available-typed-arrays": "^1.0.5", "call-bind": "^1.0.2", @@ -15623,11 +15628,47 @@ }, "@chris.troutner/bip32-utils": { "version": "1.0.5", + "resolved": "https://registry.npmjs.org/@chris.troutner/bip32-utils/-/bip32-utils-1.0.5.tgz", + "integrity": "sha512-pa9dh5VpPmfol1bdLy+FyqONmxlf/QH6Q01a57OP6C9gTVOZM1Rt0kCLXxXKC6e2AnNIrXpYN1UtlyBm+r6P0g==", "requires": { "keccak": "^3.0.1", "tape": "*" } }, + "@chris.troutner/retry-queue": { + "version": "1.0.5", + "resolved": "https://registry.npmjs.org/@chris.troutner/retry-queue/-/retry-queue-1.0.5.tgz", + "integrity": "sha512-autE5GRCXR0xgPqq6qIq1sbUw8j2btxCWlezSvpRJmPVQQZwGhYbeF7euxRbpMmi31kj47iHgG7sb45bD0HY7Q==", + "requires": { + "p-queue": "7.3.0", + "p-retry": "5.1.1" + }, + "dependencies": { + "@types/retry": { + "version": "0.12.1", + "resolved": "https://registry.npmjs.org/@types/retry/-/retry-0.12.1.tgz", + "integrity": "sha512-xoDlM2S4ortawSWORYqsdU+2rxdh4LRW9ytc3zmT37RIKQh6IHyKwwtKhKis9ah8ol07DCkZxPt8BBvPjC6v4g==" + }, + "p-queue": { + "version": "7.3.0", + "resolved": "https://registry.npmjs.org/p-queue/-/p-queue-7.3.0.tgz", + "integrity": "sha512-5fP+yVQ0qp0rEfZoDTlP2c3RYBgxvRsw30qO+VtPPc95lyvSG+x6USSh1TuLB4n96IO6I8/oXQGsTgtna4q2nQ==", + "requires": { + "eventemitter3": "^4.0.7", + "p-timeout": "^5.0.2" + } + }, + "p-retry": { + "version": "5.1.1", + "resolved": "https://registry.npmjs.org/p-retry/-/p-retry-5.1.1.tgz", + "integrity": "sha512-i69WkEU5ZAL8mrmdmVviWwU+DN+IUF8f4sSJThoJ3z5A7Nn5iuO5ROX3Boye0u+uYQLOSfgFl7SuFZCjlAVbQA==", + "requires": { + "@types/retry": "0.12.1", + "retry": "^0.13.1" + } + } + } + }, "@colors/colors": { "version": "1.5.0" }, @@ -16219,6 +16260,8 @@ }, "@psf/bch-js": { "version": "6.4.5", + "resolved": "https://registry.npmjs.org/@psf/bch-js/-/bch-js-6.4.5.tgz", + "integrity": "sha512-sH72zbJJI5oe9EUMczFQb0jCaNQb8rc3/86E6xXKl3325HCwBqE80BX7JFvZ97Qv1gGxwp/3WROp59v6Dz2NKA==", "requires": { "@chris.troutner/bip32-utils": "1.0.5", "@psf/bip21": "2.0.1", @@ -16248,6 +16291,8 @@ "dependencies": { "axios": { "version": "0.26.1", + "resolved": "https://registry.npmjs.org/axios/-/axios-0.26.1.tgz", + "integrity": "sha512-fPwcX4EvnSHuInCMItEhAGnaSEXRBjtzh9fOtsE6E1G6p7vl7edEeZe11QHf18+6+9gR5PbKV/sGKNaD8YaMeA==", "requires": { "follow-redirects": "^1.14.8" } @@ -16256,15 +16301,21 @@ }, "@psf/bip21": { "version": "2.0.1", + "resolved": "https://registry.npmjs.org/@psf/bip21/-/bip21-2.0.1.tgz", + "integrity": "sha512-U9c8xBV31n+D7qxOPBO0vQ015DNvKskWCUbVgoMfH5AUNHLYrSDWIrCx4P7v9etfdu6LpPdsYr53KDSAIk0b7Q==", "requires": { "qs": "^6.3.0" } }, "@psf/bitcoincash-ops": { - "version": "2.0.0" + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/@psf/bitcoincash-ops/-/bitcoincash-ops-2.0.0.tgz", + "integrity": "sha512-M3PWqRpeJq6rli2NqWGbas76z9TrdGOmNuDFACBWBMctPucEAsFQY2AmyFHRSa7hEwythwvrPh9AG/n6ehmEog==" }, "@psf/bitcoincashjs-lib": { "version": "4.0.2", + "resolved": "https://registry.npmjs.org/@psf/bitcoincashjs-lib/-/bitcoincashjs-lib-4.0.2.tgz", + "integrity": "sha512-fTy9mW4H0NkQ+dojGtf+nPduA27F3V2YpBi5licYUVjdVRD/xpUCTgEN1cYRAupOaeDH/AYOWT0MWLkbQSTxAQ==", "requires": { "@psf/bitcoincash-ops": "^2.0.0", "@psf/pushdata-bitcoin": "^1.2.2", @@ -16285,12 +16336,16 @@ }, "@psf/coininfo": { "version": "4.0.0", + "resolved": "https://registry.npmjs.org/@psf/coininfo/-/coininfo-4.0.0.tgz", + "integrity": "sha512-RwBc09790kbaOt8uZJMyvLqf1UziTd20FXu78bM8bMlkClnZQTJyNDdLCsFSBkJQYAJtGMkjdQ/o3/UaSC7c2Q==", "requires": { "safe-buffer": "^5.1.1" } }, "@psf/pushdata-bitcoin": { "version": "1.2.2", + "resolved": "https://registry.npmjs.org/@psf/pushdata-bitcoin/-/pushdata-bitcoin-1.2.2.tgz", + "integrity": "sha512-e1qkZLJFU6Ldg7TMBgSkiR5U1NfpRgSIr2ppk8BeED/Q9wUc9DEVAjXfPMD65xgXdqnlyFEtLbpPMWwyydMVUQ==", "requires": { "@psf/bitcoincash-ops": "^2.0.0" } @@ -16823,6 +16878,8 @@ }, "array.prototype.every": { "version": "1.1.3", + "resolved": "https://registry.npmjs.org/array.prototype.every/-/array.prototype.every-1.1.3.tgz", + "integrity": "sha512-vWnriJI//SOMOWtXbU/VXhJ/InfnNHPF6BLKn5WfY8xXy+NWql0fUy20GO3sdqBhCAO+qw8S/E5nJiZX+QFdCA==", "requires": { "call-bind": "^1.0.2", "define-properties": "^1.1.3", @@ -16880,7 +16937,9 @@ "version": "0.4.0" }, "available-typed-arrays": { - "version": "1.0.5" + "version": "1.0.5", + "resolved": "https://registry.npmjs.org/available-typed-arrays/-/available-typed-arrays-1.0.5.tgz", + "integrity": "sha512-DMD0KiN46eipeziST1LPP/STfDU0sufISXmjSgvVsoU2tqxctQeASejWcfNtxYKqETM1UxQ8sp2OrSBWpHY6sw==" }, "aws-sign2": { "version": "0.5.0", @@ -16910,70 +16969,20 @@ "version": "1.5.1" }, "bc-bip68": { - "version": "1.0.5" - }, - "bch-consumer": { - "version": "1.3.1", - "requires": { - "@psf/bch-js": "6.4.5", - "apidoc": "0.51.0", - "axios": "0.25.0" - }, - "dependencies": { - "apidoc": { - "version": "0.51.0", - "requires": { - "bootstrap": "3.4.1", - "commander": "^8.3.0", - "diff-match-patch": "^1.0.5", - "esbuild-loader": "^2.16.0", - "expose-loader": "^3.1.0", - "fs-extra": "^10.0.0", - "glob": "^7.2.0", - "handlebars": "^4.7.7", - "iconv-lite": "^0.6.3", - "jquery": "^3.6.0", - "klaw-sync": "^6.0.0", - "lodash": "^4.17.21", - "markdown-it": "^12.2.0", - "nodemon": "^2.0.15", - "path-to-regexp": "^6.2.0", - "prismjs": "^1.25.0", - "semver": "^7.3.5", - "style-loader": "^3.3.1", - "url-parse": "^1.5.3", - "webpack": "^5.64.2", - "webpack-cli": "^4.9.1", - "winston": "^3.3.3" - } - }, - "axios": { - "version": "0.25.0", - "requires": { - "follow-redirects": "^1.14.7" - } - }, - "glob": { - "version": "7.2.3", - "requires": { - "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" - } - } - } + "version": "1.0.5", + "resolved": "https://registry.npmjs.org/bc-bip68/-/bc-bip68-1.0.5.tgz", + "integrity": "sha512-GzaMlN7pNthrY5BhReVhnfr4Ixx+GUSfyNRHYh0QiMUF0d0+0YaD8MpEdv6AjFBksg/zlqL1fVCBBm6PpTt2Rg==" }, "bch-donation": { "version": "1.1.2", + "dev": true, "requires": { "apidoc": "0.51.0" }, "dependencies": { "apidoc": { "version": "0.51.0", + "dev": true, "requires": { "bootstrap": "3.4.1", "commander": "^8.3.0", @@ -17001,6 +17010,7 @@ }, "glob": { "version": "7.2.3", + "dev": true, "requires": { "fs.realpath": "^1.0.0", "inflight": "^1.0.4", @@ -17033,6 +17043,8 @@ }, "bchaddrjs-slp": { "version": "0.2.5", + "resolved": "https://registry.npmjs.org/bchaddrjs-slp/-/bchaddrjs-slp-0.2.5.tgz", + "integrity": "sha512-33flmPcqMFswerKu7477DSUNMVMQR3tHDk3lvbmsdkEva+TxVGGWWE/p5Lqx9M/8t3vkbe7fzmVhj4QhChcCyA==", "requires": { "bs58check": "^2.1.2", "cashaddrjs-slp": "^0.2.11" @@ -17055,7 +17067,9 @@ "dev": true }, "big-integer": { - "version": "1.6.51" + "version": "1.6.51", + "resolved": "https://registry.npmjs.org/big-integer/-/big-integer-1.6.51.tgz", + "integrity": "sha512-GPEid2Y9QU1Exl1rpO9B2IPJGHPSupF5GnVIP0blYvNOMer2bTvSWs1jGOUg04hTmu67nmLsQ9TBo1puaotBHg==" }, "big.js": { "version": "5.2.2" @@ -17077,6 +17091,8 @@ }, "bip-schnorr": { "version": "0.3.0", + "resolved": "https://registry.npmjs.org/bip-schnorr/-/bip-schnorr-0.3.0.tgz", + "integrity": "sha512-Sc1Hn2+1n+okPEW8G+JLjeaM12dsUOwr+oFlMDSKR9wYwNGMw0alskeBIHTmXxBxMZSWKhCW7PwKQVDyGmnaVg==", "requires": { "ecurve": "^1.0.6", "js-sha256": "^0.9.0", @@ -17086,6 +17102,8 @@ }, "bip38": { "version": "2.0.2", + "resolved": "https://registry.npmjs.org/bip38/-/bip38-2.0.2.tgz", + "integrity": "sha512-22KDak0RDyghFbR0Si7wyq9IgY423YzGYzWLpGeofH3DaolOQqjD3mNN08eFoubKlbyclOQKFwtONMv2SD9V3A==", "requires": { "bigi": "^1.2.0", "browserify-aes": "^1.0.1", @@ -17098,6 +17116,8 @@ }, "bip39": { "version": "3.0.2", + "resolved": "https://registry.npmjs.org/bip39/-/bip39-3.0.2.tgz", + "integrity": "sha512-J4E1r2N0tUylTKt07ibXvhpT2c5pyAFgvuA5q1H9uDy6dEGpjV8jmymh3MTYJDLCNbIVClSB9FbND49I6N24MQ==", "requires": { "@types/node": "11.11.6", "create-hash": "^1.1.0", @@ -17136,6 +17156,8 @@ }, "bitcoinjs-message": { "version": "2.0.0", + "resolved": "https://registry.npmjs.org/bitcoinjs-message/-/bitcoinjs-message-2.0.0.tgz", + "integrity": "sha512-H5pJC7/eSqVjREiEOZ4jifX+7zXYP3Y28GIOIqg9hrgE7Vj8Eva9+HnVqnxwA1rJPOwZKuw0vo6k0UxgVc6q1A==", "requires": { "bs58check": "^2.0.2", "buffer-equals": "^1.0.3", @@ -17271,7 +17293,9 @@ "version": "1.0.1" }, "buffer-equals": { - "version": "1.0.4" + "version": "1.0.4", + "resolved": "https://registry.npmjs.org/buffer-equals/-/buffer-equals-1.0.4.tgz", + "integrity": "sha512-99MsCq0j5+RhubVEtKQgKaD6EM+UP3xJgIvQqwJ3SOLDUekzxMX1ylXBng+Wa2sh7mGT0W6RUly8ojjr1Tt6nA==" }, "buffer-from": { "version": "1.1.2" @@ -17430,6 +17454,8 @@ }, "cashaddrjs-slp": { "version": "0.2.12", + "resolved": "https://registry.npmjs.org/cashaddrjs-slp/-/cashaddrjs-slp-0.2.12.tgz", + "integrity": "sha512-n2TTIuW6vZZxYvjvsUAA+wOM0Zkj+3RRKUtDC1XSu4Ic4XVr0yFJkl1bzQkHWda7nkVT51sxjZneygz7D0SyrQ==", "requires": { "big-integer": "^1.6.34" } @@ -17819,9 +17845,6 @@ "boom": "0.4.x" } }, - "crypto-js": { - "version": "4.0.0" - }, "crypto-random-string": { "version": "2.0.0" }, @@ -17921,7 +17944,9 @@ } }, "defined": { - "version": "1.0.0" + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/defined/-/defined-1.0.0.tgz", + "integrity": "sha512-Y2caI5+ZwS5c3RiNDJ6u53VhQHv+hHKwhkI1iHvceKUHw9Df6EK2zRLfjejRgMuCuxK7PfSWIMwWecceVvThjQ==" }, "del": { "version": "6.1.1", @@ -18005,6 +18030,8 @@ }, "dotignore": { "version": "0.1.2", + "resolved": "https://registry.npmjs.org/dotignore/-/dotignore-0.1.2.tgz", + "integrity": "sha512-UGGGWfSauusaVJC+8fgV+NVvBXkCTmVv7sk6nojDZZvuOUNGUy0Zk4UpHQD6EDjS0jpBwcACvH4eofvyzBcRDw==", "requires": { "minimatch": "^3.0.4" } @@ -18054,12 +18081,16 @@ }, "ecashaddrjs": { "version": "1.0.7", + "resolved": "https://registry.npmjs.org/ecashaddrjs/-/ecashaddrjs-1.0.7.tgz", + "integrity": "sha512-KsvHYLlYtLr/GBkEPiwwQDIDBzqRx61qC34n1puHKOjVE4Uwg3syHccjFCqNynLa6T6xI0Rd7ByCRUJcuJcoIw==", "requires": { "big-integer": "1.6.36" }, "dependencies": { "big-integer": { - "version": "1.6.36" + "version": "1.6.36", + "resolved": "https://registry.npmjs.org/big-integer/-/big-integer-1.6.36.tgz", + "integrity": "sha512-t70bfa7HYEA1D9idDbmuv7YbsbVkQ+Hp+8KFSul4aE5e/i1bjCNIRYJZlA8Q8p0r9T8cF/RVvwUgRA//FydEyg==" } } }, @@ -18239,6 +18270,8 @@ }, "es-get-iterator": { "version": "1.1.2", + "resolved": "https://registry.npmjs.org/es-get-iterator/-/es-get-iterator-1.1.2.tgz", + "integrity": "sha512-+DTO8GYwbMCwbywjimwZMHp8AuYXOS2JZFWoi2AlPOS3ebnII9w/NLpNZtA7A0YLaVDw+O7KFCeoIV7OPvM7hQ==", "requires": { "call-bind": "^1.0.2", "get-intrinsic": "^1.1.0", @@ -18251,7 +18284,9 @@ }, "dependencies": { "isarray": { - "version": "2.0.5" + "version": "2.0.5", + "resolved": "https://registry.npmjs.org/isarray/-/isarray-2.0.5.tgz", + "integrity": "sha512-xHjhDr3cNBK0BzdUJSPXZntQUx/mwMS5Rw4A7lPJ90XGAO6ISP/ePDNuo0vhqOZU+UD5JoodwCAAoZQd3FeAKw==" } } }, @@ -18794,6 +18829,8 @@ }, "for-each": { "version": "0.3.3", + "resolved": "https://registry.npmjs.org/for-each/-/for-each-0.3.3.tgz", + "integrity": "sha512-jqYfLp7mo9vIyQf8ykW2v7A+2N4QjeCeI5+Dz9XraiO1ign81wjiH7Fb9vSOWvQfNtmSa4H2RoQTrrXivdUZmw==", "requires": { "is-callable": "^1.1.3" } @@ -18913,7 +18950,9 @@ "version": "1.0.2" }, "get-package-type": { - "version": "0.1.0" + "version": "0.1.0", + "resolved": "https://registry.npmjs.org/get-package-type/-/get-package-type-0.1.0.tgz", + "integrity": "sha512-pjzuKtY64GYfWizNAJ0fr9VqttZkNiK2iS430LtIHzjBEr6bX8Am2zm4sW4Ro5wjWW5cAlRL1qAMTcXbjNAO2Q==" }, "get-stdin": { "version": "8.0.0", @@ -19087,6 +19126,8 @@ }, "has-dynamic-import": { "version": "2.0.1", + "resolved": "https://registry.npmjs.org/has-dynamic-import/-/has-dynamic-import-2.0.1.tgz", + "integrity": "sha512-X3fbtsZmwb6W7fJGR9o7x65fZoodygCrZ3TVycvghP62yYQfS0t4RS0Qcz+j5tQYUKeSWS09tHkWW6WhFV3XhQ==", "requires": { "call-bind": "^1.0.2", "get-intrinsic": "^1.1.1" @@ -19635,6 +19676,8 @@ }, "is-arguments": { "version": "1.1.1", + "resolved": "https://registry.npmjs.org/is-arguments/-/is-arguments-1.1.1.tgz", + "integrity": "sha512-8Q7EARjzEnKpt/PCD7e1cgUS0a6X8u5tdSiMqXhojOdoV9TsMsiO+9VLC5vAmO8N7/GmXn7yjR8qnA6bVAEzfA==", "requires": { "call-bind": "^1.0.2", "has-tostringtag": "^1.0.0" @@ -19725,7 +19768,9 @@ "version": "1.0.1" }, "is-map": { - "version": "2.0.2" + "version": "2.0.2", + "resolved": "https://registry.npmjs.org/is-map/-/is-map-2.0.2.tgz", + "integrity": "sha512-cOZFQQozTha1f4MxLFzlgKYPTyj26picdZTx82hbc/Xf4K/tZOOXSCkMvU4pKioRXGDLJRn0GM7Upe7kR721yg==" }, "is-negative-zero": { "version": "2.0.2" @@ -19772,7 +19817,9 @@ "integrity": "sha512-rbku49cWloU5bSMI+zaRaXdQHXnthP6DZ/vLnfdSKyL4zUzuWnomtOEiZZOd+ioQ+avFo/qau3KPTc7Fjy1uPA==" }, "is-set": { - "version": "2.0.2" + "version": "2.0.2", + "resolved": "https://registry.npmjs.org/is-set/-/is-set-2.0.2.tgz", + "integrity": "sha512-+2cnTEZeY5z/iXGbLhPrOAaK/Mau5k5eXq9j14CpRTftq0pAJu2MwVRSZhyZWBzx3o6X795Lz6Bpb6R0GKf37g==" }, "is-shared-array-buffer": { "version": "1.0.2", @@ -19804,6 +19851,8 @@ }, "is-typed-array": { "version": "1.1.9", + "resolved": "https://registry.npmjs.org/is-typed-array/-/is-typed-array-1.1.9.tgz", + "integrity": "sha512-kfrlnTTn8pZkfpJMUgYD7YZ3qzeJgWUn8XfVYBARc4wnmNOmLbmuuaAs3q5fvB0UJOn6yHAKaGTPM7d6ezoD/A==", "requires": { "available-typed-arrays": "^1.0.5", "call-bind": "^1.0.2", @@ -19820,7 +19869,9 @@ "dev": true }, "is-weakmap": { - "version": "2.0.1" + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/is-weakmap/-/is-weakmap-2.0.1.tgz", + "integrity": "sha512-NSBR4kH5oVj1Uwvv970ruUkCV7O1mzgVFO4/rev2cLRda9Tm9HrL70ZPut4rOHgY0FNrUu9BCbXA2sdQ+x0chA==" }, "is-weakref": { "version": "1.0.2", @@ -19830,6 +19881,8 @@ }, "is-weakset": { "version": "2.0.2", + "resolved": "https://registry.npmjs.org/is-weakset/-/is-weakset-2.0.2.tgz", + "integrity": "sha512-t2yVvttHkQktwnNNmBQ98AhENLdPUTDTE21uPqAQ0ARwQfGeQKRVS0NNurH7bTf7RrvcVn1OOge45CnBeHCSmg==", "requires": { "call-bind": "^1.0.2", "get-intrinsic": "^1.1.1" @@ -20019,7 +20072,9 @@ "version": "3.6.0" }, "js-sha256": { - "version": "0.9.0" + "version": "0.9.0", + "resolved": "https://registry.npmjs.org/js-sha256/-/js-sha256-0.9.0.tgz", + "integrity": "sha512-sga3MHh9sgQN2+pJ9VYZ+1LPwXOxuBJBA5nrR5/ofPfuiJBE2hnjsaN8se8JznOmGLN2p49Pe5U/ttafcs/apA==" }, "js-sha3": { "version": "0.8.0" @@ -20170,6 +20225,8 @@ }, "keccak": { "version": "3.0.2", + "resolved": "https://registry.npmjs.org/keccak/-/keccak-3.0.2.tgz", + "integrity": "sha512-PyKKjkH53wDMLGrvmRGSNWgmSxZOUqbnXwKL9tmgbFYA1iAYqW21kfR7mZXV0MlESiefxQQE9X9fTa3X+2MPDQ==", "requires": { "node-addon-api": "^2.0.0", "node-gyp-build": "^4.2.0", @@ -20823,53 +20880,30 @@ "dev": true }, "minimal-slp-wallet": { - "version": "5.1.0", + "version": "file:../minimal-slp-wallet", "requires": { "@psf/bch-js": "6.4.5", "apidoc": "0.51.0", "bch-consumer": "1.3.1", "bch-donation": "1.1.2", - "crypto-js": "4.0.0" - }, - "dependencies": { - "apidoc": { - "version": "0.51.0", - "requires": { - "bootstrap": "3.4.1", - "commander": "^8.3.0", - "diff-match-patch": "^1.0.5", - "esbuild-loader": "^2.16.0", - "expose-loader": "^3.1.0", - "fs-extra": "^10.0.0", - "glob": "^7.2.0", - "handlebars": "^4.7.7", - "iconv-lite": "^0.6.3", - "jquery": "^3.6.0", - "klaw-sync": "^6.0.0", - "lodash": "^4.17.21", - "markdown-it": "^12.2.0", - "nodemon": "^2.0.15", - "path-to-regexp": "^6.2.0", - "prismjs": "^1.25.0", - "semver": "^7.3.5", - "style-loader": "^3.3.1", - "url-parse": "^1.5.3", - "webpack": "^5.64.2", - "webpack-cli": "^4.9.1", - "winston": "^3.3.3" - } - }, - "glob": { - "version": "7.2.3", - "requires": { - "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" - } - } + "browserify": "17.0.0", + "chai": "4.2.0", + "coveralls": "3.1.0", + "crypto-js": "4.0.0", + "eslint": "7.17.0", + "eslint-config-prettier": "7.1.0", + "eslint-config-standard": "16.0.2", + "eslint-plugin-node": "11.1.0", + "eslint-plugin-prettier": "3.3.1", + "eslint-plugin-standard": "4.0.1", + "husky": "4.3.8", + "lodash.clonedeep": "4.5.0", + "mocha": "9.2.1", + "nyc": "15.1.0", + "semantic-release": "19.0.3", + "sinon": "9.2.0", + "standard": "16.0.4", + "tinyify": "3.0.0" } }, "minimalistic-assert": { @@ -21325,7 +21359,9 @@ } }, "node-addon-api": { - "version": "2.0.2" + "version": "2.0.2", + "resolved": "https://registry.npmjs.org/node-addon-api/-/node-addon-api-2.0.2.tgz", + "integrity": "sha512-Ntyt4AIXyaLIuMHF6IOoTakB3K+RWxwtsHNRxllEoA6vPwP9o4866g6YWDLUdnucilZhmkxiHwHr11gAENw+QA==" }, "node-emoji": { "version": "1.11.0", @@ -21341,7 +21377,9 @@ "version": "1.3.1" }, "node-gyp-build": { - "version": "4.4.0" + "version": "4.5.0", + "resolved": "https://registry.npmjs.org/node-gyp-build/-/node-gyp-build-4.5.0.tgz", + "integrity": "sha512-2iGbaQBV+ITgCz76ZEjmhUKAKVf7xfY1sRl4UiKQspfZMH2h06SyhNsnSVy50cwkFQDGLyif6m/6uFXHkOZ6rg==" }, "node-releases": { "version": "2.0.5" @@ -23128,6 +23166,8 @@ }, "object-is": { "version": "1.1.5", + "resolved": "https://registry.npmjs.org/object-is/-/object-is-1.1.5.tgz", + "integrity": "sha512-3cyDsyHgtmi7I7DfSSI2LDp6SK2lwvtbg0p0R1e0RvTqF5ceGx+K2dfSjm1bKDMVCFEDAQvy+o8c6a7VujOddw==", "requires": { "call-bind": "^1.0.2", "define-properties": "^1.1.3" @@ -23348,6 +23388,11 @@ "p-cancelable": "^2.0.0" } }, + "p-timeout": { + "version": "5.1.0", + "resolved": "https://registry.npmjs.org/p-timeout/-/p-timeout-5.1.0.tgz", + "integrity": "sha512-auFDyzzzGZZZdHz3BtET9VEz0SE/uMEAx7uWfGPucfzEwwe/xH0iVeZibQmANYE/hp9T2+UUZT5m+BKyrDp3Ew==" + }, "p-try": { "version": "1.0.0", "dev": true @@ -23681,7 +23726,8 @@ } }, "querystringify": { - "version": "2.2.0" + "version": "2.2.0", + "dev": true }, "queue-microtask": { "version": "1.2.3", @@ -23996,7 +24042,8 @@ "peer": true }, "requires-port": { - "version": "1.0.0" + "version": "1.0.0", + "dev": true }, "resolve": { "version": "1.22.1", @@ -24056,6 +24103,8 @@ }, "resumer": { "version": "0.0.0", + "resolved": "https://registry.npmjs.org/resumer/-/resumer-0.0.0.tgz", + "integrity": "sha512-Fn9X8rX8yYF4m81rZCK/5VmrmsSbqS/i3rDLl6ZZHAXgC2nTAx3dhwG8q8odP/RmdLa2YrybDJaAMg+X1ajY3w==", "requires": { "through": "~2.3.4" } @@ -24121,12 +24170,16 @@ }, "satoshi-bitcoin": { "version": "1.0.4", + "resolved": "https://registry.npmjs.org/satoshi-bitcoin/-/satoshi-bitcoin-1.0.4.tgz", + "integrity": "sha512-YuHOmw5wsz6wuHIQdsz5b2cgtuKtV/jEcZ4NGmWN5tM/gz5T9Q+DSuLlnuf5BP/jsQWgR0ofmY4f8Dm6JnqSug==", "requires": { "big.js": "^3.1.3" }, "dependencies": { "big.js": { - "version": "3.2.0" + "version": "3.2.0", + "resolved": "https://registry.npmjs.org/big.js/-/big.js-3.2.0.tgz", + "integrity": "sha512-+hN/Zh2D08Mx65pZ/4g5bsmNiZUuChDiQfTUQ7qJr4/kuopCr88xZsAXv6mBoZEsUI4OuGHlX59qE94K2mMW8Q==" } } }, @@ -24142,7 +24195,9 @@ } }, "scryptsy": { - "version": "2.1.0" + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/scryptsy/-/scryptsy-2.1.0.tgz", + "integrity": "sha512-1CdSqHQowJBnMAFyPEBRfqag/YP9OF394FV+4YREIJX4ljD7OxvQRDayyoyyCk+senRjSkP6VnUNQmVQqB6g7w==" }, "secp256k1": { "version": "3.8.0", @@ -24417,12 +24472,16 @@ }, "slp-mdm": { "version": "0.0.6", + "resolved": "https://registry.npmjs.org/slp-mdm/-/slp-mdm-0.0.6.tgz", + "integrity": "sha512-fbjlIg/o8OtzgK2JydC6POJp3Qup/rLgy4yB5hoLgxWRlERyJyE29ScwS3r9TTwPxe12qK55pyivAdNOZZXL0A==", "requires": { "bignumber.js": "^9.0.0" } }, "slp-parser": { "version": "0.0.4", + "resolved": "https://registry.npmjs.org/slp-parser/-/slp-parser-0.0.4.tgz", + "integrity": "sha512-AvbslJumkzGfMGWNvuE2pWx2nyHEk/VgQ7l119kDKIFRTuRUWOkyOULLauw5laGRQsBRThg6NCx/TsR3grX6GA==", "requires": { "bignumber.js": "^9.0.0" } @@ -24890,6 +24949,8 @@ }, "string.prototype.trim": { "version": "1.2.6", + "resolved": "https://registry.npmjs.org/string.prototype.trim/-/string.prototype.trim-1.2.6.tgz", + "integrity": "sha512-8lMR2m+U0VJTPp6JjvJTtGyc4FIGq9CdRt7O9p6T0e6K4vjU+OP+SQJpbe/SBmRcCUIvNUnjsbmY6lnMp8MhsQ==", "requires": { "call-bind": "^1.0.2", "define-properties": "^1.1.4", @@ -25002,7 +25063,9 @@ "version": "2.2.1" }, "tape": { - "version": "5.5.3", + "version": "5.6.1", + "resolved": "https://registry.npmjs.org/tape/-/tape-5.6.1.tgz", + "integrity": "sha512-reNzS3rzsJtKk0f+zJx2XlzIsjJXlIcOIrIxk5shHAG/DzW3BKyMg8UfN79oluYlcWo4lIt56ahLqwgpRT4idg==", "requires": { "array.prototype.every": "^1.1.3", "call-bind": "^1.0.2", @@ -25011,24 +25074,26 @@ "dotignore": "^0.1.2", "for-each": "^0.3.3", "get-package-type": "^0.1.0", - "glob": "^7.2.0", + "glob": "^7.2.3", "has": "^1.0.3", "has-dynamic-import": "^2.0.1", "inherits": "^2.0.4", "is-regex": "^1.1.4", "minimist": "^1.2.6", - "object-inspect": "^1.12.0", + "object-inspect": "^1.12.2", "object-is": "^1.1.5", "object-keys": "^1.1.1", - "object.assign": "^4.1.2", + "object.assign": "^4.1.4", "resolve": "^2.0.0-next.3", "resumer": "^0.0.0", - "string.prototype.trim": "^1.2.5", + "string.prototype.trim": "^1.2.6", "through": "^2.3.8" }, "dependencies": { "deep-equal": { "version": "2.0.5", + "resolved": "https://registry.npmjs.org/deep-equal/-/deep-equal-2.0.5.tgz", + "integrity": "sha512-nPiRgmbAtm1a3JsnLCf6/SLfXcjyN5v8L1TXzdCmHrXJ4hx+gW/w1YCcn7z8gJtSiDArZCgYtbao3QqLm/N1Sw==", "requires": { "call-bind": "^1.0.0", "es-get-iterator": "^1.1.1", @@ -25049,6 +25114,8 @@ }, "glob": { "version": "7.2.3", + "resolved": "https://registry.npmjs.org/glob/-/glob-7.2.3.tgz", + "integrity": "sha512-nFR0zLpU2YCaRxwoCJvL6UvCH2JFyFVIvwTLsIf21AuHlMskA1hhTdk+LlYJtOlYt9v6dvszD2BGRqBL+iQK9Q==", "requires": { "fs.realpath": "^1.0.0", "inflight": "^1.0.4", @@ -25059,10 +25126,14 @@ } }, "isarray": { - "version": "2.0.5" + "version": "2.0.5", + "resolved": "https://registry.npmjs.org/isarray/-/isarray-2.0.5.tgz", + "integrity": "sha512-xHjhDr3cNBK0BzdUJSPXZntQUx/mwMS5Rw4A7lPJ90XGAO6ISP/ePDNuo0vhqOZU+UD5JoodwCAAoZQd3FeAKw==" }, "resolve": { "version": "2.0.0-next.4", + "resolved": "https://registry.npmjs.org/resolve/-/resolve-2.0.0-next.4.tgz", + "integrity": "sha512-iMDbmAWtfU+MHpxt/I5iWI7cY6YVEZUQ3MBgPQ++XD1PELuJHIl82xBmObyP2KyQmkNB2dsqF7seoQQiAn5yDQ==", "requires": { "is-core-module": "^2.9.0", "path-parse": "^1.0.7", @@ -25426,6 +25497,7 @@ }, "url-parse": { "version": "1.5.10", + "dev": true, "requires": { "querystringify": "^2.1.1", "requires-port": "^1.0.0" @@ -25609,6 +25681,8 @@ }, "which-collection": { "version": "1.0.1", + "resolved": "https://registry.npmjs.org/which-collection/-/which-collection-1.0.1.tgz", + "integrity": "sha512-W8xeTUwaln8i3K/cY1nGXzdnVZlidBcagyNFtBdD5kxnb4TvGKR7FfSIS3mYpwWS1QUCutfKz8IY8RjftB0+1A==", "requires": { "is-map": "^2.0.1", "is-set": "^2.0.1", @@ -25622,6 +25696,8 @@ }, "which-typed-array": { "version": "1.1.8", + "resolved": "https://registry.npmjs.org/which-typed-array/-/which-typed-array-1.1.8.tgz", + "integrity": "sha512-Jn4e5PItbcAHyLoRDwvPj1ypu27DJbtdYXUa5zsinrUx77Uvfb0cXwwnGMTn7cjUfhhqgVQnVJCwF+7cgU7tpw==", "requires": { "available-typed-arrays": "^1.0.5", "call-bind": "^1.0.2", diff --git a/package.json b/package.json index 688177d..0372554 100644 --- a/package.json +++ b/package.json @@ -28,6 +28,8 @@ }, "repository": "Permissionless-Software-Foundation/bch-dex", "dependencies": { + "@chris.troutner/retry-queue": "1.0.5", + "@psf/bch-js": "^6.4.5", "axios": "0.27.2", "bch-message-lib": "2.2.1", "bcryptjs": "2.4.3", @@ -51,7 +53,7 @@ "koa2-ratelimit": "0.9.1", "libp2p": "^0.36.2", "line-reader": "0.4.0", - "minimal-slp-wallet": "5.1.0", + "minimal-slp-wallet": "../minimal-slp-wallet/", "mongoose": "5.13.14", "node-fetch": "npm:@achingbrain/node-fetch@2.6.7", "nodemailer": "6.7.5", diff --git a/src/adapters/p2wdb-adapter.js b/src/adapters/p2wdb-adapter.js index 9e94482..fb3cc62 100644 --- a/src/adapters/p2wdb-adapter.js +++ b/src/adapters/p2wdb-adapter.js @@ -27,6 +27,10 @@ class P2wdbAdapter { // Allow the localConfig to overwrite the config file values. this.p2wdbURL = localConfig.p2wdbURL || config.p2wdbUrl + + // Bind the 'this' object to all functions + this.write = this.write.bind(this) + this.checkForSufficientFunds = this.checkForSufficientFunds.bind(this) } // Write some data to the P2WDB diff --git a/src/adapters/wallet.js b/src/adapters/wallet.js index 9cb68f1..d4f5f00 100644 --- a/src/adapters/wallet.js +++ b/src/adapters/wallet.js @@ -31,6 +31,9 @@ class WalletAdapter { this.bitcoinJs = bitcoinJs this.BchWallet = BchWallet this.bchWallet = {} // Will be replaced when initialized. + + // Bind the 'this' object + this.moveTokens = this.moveTokens.bind(this) } // Open the wallet file, or create one if the file doesn't exist. diff --git a/src/entities/offer.js b/src/entities/offer.js index 275e6b0..44bea7b 100644 --- a/src/entities/offer.js +++ b/src/entities/offer.js @@ -29,7 +29,7 @@ class OfferEntity { utxoVout, offerStatus, makerAddr, - ticker, + // ticker, tokenType } = offerData.data @@ -67,9 +67,9 @@ class OfferEntity { if (!makerAddr || typeof makerAddr !== 'string') { throw new Error("Property 'makerAddr' must be a string.") } - if (!ticker || typeof ticker !== 'string') { - throw new Error("Property 'ticker' must be a string.") - } + // if (!ticker || typeof ticker !== 'string') { + // throw new Error("Property 'ticker' must be a string.") + // } if (!tokenType || typeof tokenType !== 'number') { throw new Error("Property 'tokenType' must be a number.") } @@ -95,7 +95,7 @@ class OfferEntity { p2wdbHash: offerData.hash, offerStatus: offerStatus || this.offerStatus[0], makerAddr, - ticker, + // ticker, tokenType } diff --git a/src/entities/order.js b/src/entities/order.js index b62c3c0..8dd60c4 100644 --- a/src/entities/order.js +++ b/src/entities/order.js @@ -7,7 +7,10 @@ The Order tracks the hdIndex address used to hold tokens or BCH for sale. */ class Order { - validate (data) { + // TODO: Create a fullValidate() function that validates a fully-hydrated + // order model. + + inputValidate (data) { const { messageType, messageClass, @@ -16,8 +19,7 @@ class Order { rateInBaseUnit, minUnitsToExchange, numTokens, - makerAddr, - ticker + makerAddr } = data // Input Validation @@ -45,9 +47,9 @@ class Order { if (!makerAddr || typeof makerAddr !== 'string') { throw new Error("Property 'makerAddr' must be a string.") } - if (!ticker || typeof ticker !== 'string') { - throw new Error("Property 'ticker' must be a string.") - } + // if (!ticker || typeof ticker !== 'string') { + // throw new Error("Property 'ticker' must be a string.") + // } const offerData = { messageType, @@ -57,8 +59,8 @@ class Order { rateInBaseUnit, minUnitsToExchange, numTokens, - makerAddr, - ticker + makerAddr + // ticker } return offerData diff --git a/src/use-cases/offer/index.js b/src/use-cases/offer/index.js index 241b895..54700f2 100644 --- a/src/use-cases/offer/index.js +++ b/src/use-cases/offer/index.js @@ -15,6 +15,7 @@ // Global npm libraries import axios from 'axios' +import RetryQueue from '@chris.troutner/retry-queue' // Local libraries import OfferEntity from '../../entities/offer.js' @@ -43,9 +44,12 @@ class OfferUseCases { // Encapsulate dependencies this.config = config this.axios = axios - this.offerEntity = new OfferEntity() this.OfferModel = this.adapters.localdb.Offer + this.retryQueue = new RetryQueue({ retryPeriod: 1000, attempts: 3 }) + + // Bind 'this' object to functions + this.detectNsfw = this.detectNsfw.bind(this) } // This method is called by the POST /offer REST API controller, which is @@ -73,14 +77,23 @@ class OfferUseCases { // Verify that UTXO in offer is unspent. If it is spent, then ignore the // offer. - const txid = offerObj.data.utxoTxid - const vout = offerObj.data.utxoVout - const utxoStatus = await this.adapters.bchjs.Blockchain.getTxOut( - txid, - vout - ) + // const txid = offerObj.data.utxoTxid + // const vout = offerObj.data.utxoVout + // const utxoStatus = await this.adapters.bchjs.Blockchain.getTxOut( + // txid, + // vout + // ) + // + const utxo = { + tx_hash: offerObj.data.utxoTxid, + tx_pos: offerObj.data.utxoVout + } + // const utxoStatus = await this.adapters.wallet.bchWallet.utxoIsValid(utxo) + const utxoStatus = await this.retryQueue.addToQueue(this.adapters.wallet.bchWallet.utxoIsValid, utxo) + console.log('utxoStatus: ', utxoStatus) - if (utxoStatus === null) return false + // if (utxoStatus === null) return false + if (!utxoStatus) return false // A new offer gets a status of 'posted' offerObj.data.offerStatus = 'posted' @@ -90,18 +103,20 @@ class OfferUseCases { // Get data about the token. const tokenId = offerEntity.tokenId - const tokenData = await this.adapters.wallet.bchWallet.getTokenData(tokenId) + // const tokenData = await this.adapters.wallet.bchWallet.getTokenData(tokenId) + const tokenData = await this.retryQueue.addToQueue(this.adapters.wallet.bchWallet.getTokenData, tokenId) console.log(`tokenData: ${JSON.stringify(tokenData, null, 2)}`) // Generate a 'display category' for the token. This will allow the // front end UI to figure out how to display the token. - const displayCategory = await this.categorizeToken(offerEntity, tokenData) + const displayCategory = this.categorizeToken(offerEntity, tokenData) console.log('displayCategory: ', displayCategory) offerEntity.displayCategory = displayCategory // Detect if user set the NSFW flag. let nsfw = false - nsfw = await this.detectNsfw(tokenData) + // nsfw = await this.detectNsfw(tokenData) + nsfw = await this.retryQueue.addToQueue(this.detectNsfw, tokenData) offerEntity.nsfw = nsfw // Add offer to the local database. @@ -165,7 +180,7 @@ class OfferUseCases { // The first three are easy to categorize. The simple-nft is a fungible token // with a quantity of 1, decimals of 0, and no minting baton. Categorizing this // type of token is the main reason why this function exists. - async categorizeToken (offerData, tokenData) { + categorizeToken (offerData, tokenData) { try { // console.log(`categorizeToken(): ${JSON.stringify(offerData, null, 2)}`) diff --git a/src/use-cases/order.js b/src/use-cases/order.js index 8cdde6b..59c94f5 100644 --- a/src/use-cases/order.js +++ b/src/use-cases/order.js @@ -2,9 +2,11 @@ Order use-case library. */ +// Global npm libraries +import RetryQueue from '@chris.troutner/retry-queue' + // Local libraries import wlogger from '../adapters/wlogger.js' - import OrderEntity from '../entities/order.js' import config from '../../config/index.js' @@ -23,6 +25,10 @@ class OrderLib { this.OrderModel = this.adapters.localdb.Order this.bch = this.adapters.bch this.config = config + this.retryQueue = new RetryQueue({ retryPeriod: 1000, attempts: 3 }) + + // Bind subfunctions to the 'this' object. + this.ensureFunds = this.ensureFunds.bind(this) } // Create a new order model and add it to the Mongo database. @@ -37,33 +43,33 @@ class OrderLib { entryObj.makerAddr = this.adapters.wallet.bchWallet.walletInfo.cashAddress console.log('entryObj.makerAddr: ', entryObj.makerAddr) - // Get Ticker for token ID. - // TODO: Move this below the orderEntity.validate() call. - const tokenData = await this.adapters.wallet.bchWallet.getTxData([entryObj.tokenId]) - // console.log(`tokenData: ${JSON.stringify(tokenData, null, 2)}`) - entryObj.ticker = tokenData[0].tokenTicker - // Input Validation - // TODO: Remove ticker from validation. - // TODO: Rename validate() to inputValidate(). Create fullValidate() that - // validates a fully hydrated Order entity. - const orderEntity = this.orderEntity.validate(entryObj) + const orderEntity = this.orderEntity.inputValidate(entryObj) console.log('orderEntity: ', orderEntity) // Ensure sufficient tokens exist to create the order. - await this.ensureFunds(orderEntity) + // await this.ensureFunds(orderEntity) + await this.retryQueue.addToQueue(this.ensureFunds, orderEntity) + + // Get Ticker for token ID. + // const tokenData = await this.adapters.wallet.bchWallet.getTxData([entryObj.tokenId]) + const tokenData = await this.retryQueue.addToQueue(this.adapters.wallet.bchWallet.getTxData, [entryObj.tokenId]) + // console.log(`tokenData: ${JSON.stringify(tokenData, null, 2)}`) + entryObj.ticker = tokenData[0].tokenTicker // Move the tokens to holding address. const moveObj = { tokenId: orderEntity.tokenId, qty: orderEntity.numTokens } - const utxoInfo = await this.adapters.wallet.moveTokens(moveObj) + // const utxoInfo = await this.adapters.wallet.moveTokens(moveObj) + const utxoInfo = await this.retryQueue.addToQueue(this.adapters.wallet.moveTokens, moveObj) console.log('utxoInfo: ', utxoInfo) // Update the UTXO store for the wallet. await this.adapters.wallet.bchWallet.bchjs.Util.sleep(3000) - await this.adapters.wallet.bchWallet.getUtxos() + // await this.adapters.wallet.bchWallet.getUtxos() + await this.retryQueue.addToQueue(this.adapters.wallet.bchWallet.initialize, {}) // Update the order with the new UTXO information. orderEntity.utxoTxid = utxoInfo.txid @@ -79,7 +85,8 @@ class OrderLib { data: orderEntity, appId: this.config.p2wdbAppId } - const hash = await this.adapters.p2wdb.write(p2wdbObj) + // const hash = await this.adapters.p2wdb.write(p2wdbObj) + const hash = await this.retryQueue.addToQueue(this.adapters.p2wdb.write, p2wdbObj) // console.log('hash: ', hash) // Create a MongoDB model to hold the Order diff --git a/test/unit/entities/order.entity.unit.js b/test/unit/entities/order.entity.unit.js index 9322377..9a80d4b 100644 --- a/test/unit/entities/order.entity.unit.js +++ b/test/unit/entities/order.entity.unit.js @@ -21,10 +21,10 @@ describe('#Order-Entity', () => { afterEach(() => sandbox.restore()) - describe('#validate', () => { + describe('#inputValidate', () => { it('should throw an error if data is not provided', () => { try { - uut.validate() + uut.inputValidate() } catch (err) { // console.log(err) assert.include(err.message, 'Cannot destructure property') @@ -34,7 +34,7 @@ describe('#Order-Entity', () => { it('should throw an error if messageType is not included', () => { try { const data = {} - uut.validate(data) + uut.inputValidate(data) } catch (err) { // console.log(err) assert.include( @@ -47,7 +47,7 @@ describe('#Order-Entity', () => { it('should throw an error if messageClass is not included', () => { try { const data = { messageType: 1 } - uut.validate(data) + uut.inputValidate(data) } catch (err) { // console.log(err) assert.include( @@ -60,7 +60,7 @@ describe('#Order-Entity', () => { it('should throw an error if tokenId is not included', () => { try { const data = { messageType: 1, messageClass: 1 } - uut.validate(data) + uut.inputValidate(data) } catch (err) { // console.log(err) assert.include(err.message, "Property 'tokenId' must be a string.") @@ -70,7 +70,7 @@ describe('#Order-Entity', () => { it('should throw an error if buyOrSell is not included', () => { try { const data = { messageType: 1, messageClass: 1, tokenId: 'fakeId' } - uut.validate(data) + uut.inputValidate(data) } catch (err) { // console.log(err) assert.include(err.message, "Property 'buyOrSell' must be a string.") @@ -85,7 +85,7 @@ describe('#Order-Entity', () => { tokenId: 'fakeId', buyOrSell: 'buy' } - uut.validate(data) + uut.inputValidate(data) } catch (err) { // console.log(err) assert.include( @@ -104,7 +104,7 @@ describe('#Order-Entity', () => { buyOrSell: 'buy', rateInBaseUnit: 1000 } - uut.validate(data) + uut.inputValidate(data) } catch (err) { // console.log(err) assert.include( @@ -124,7 +124,7 @@ describe('#Order-Entity', () => { rateInBaseUnit: 1000, minUnitsToExchange: 350 } - uut.validate(data) + uut.inputValidate(data) } catch (err) { // console.log(err) assert.include(err.message, "Property 'numTokens' must be a number.") diff --git a/test/unit/mocks/adapters/wallet.js b/test/unit/mocks/adapters/wallet.js index 1b4acb0..7a0c921 100644 --- a/test/unit/mocks/adapters/wallet.js +++ b/test/unit/mocks/adapters/wallet.js @@ -35,6 +35,8 @@ class MockBchWallet { }] } this.getTokenData = async () => {} + this.initialize = async () => {} + this.utxoIsValid = async () => {} // Environment variable is used by wallet-balance.unit.js to force an error. if (process.env.NO_UTXO) { diff --git a/test/unit/use-cases/offer.use-case.unit.js b/test/unit/use-cases/offer.use-case.unit.js index 1203a4d..66fdc61 100644 --- a/test/unit/use-cases/offer.use-case.unit.js +++ b/test/unit/use-cases/offer.use-case.unit.js @@ -74,7 +74,7 @@ describe('#offer-use-case', () => { } // Mock dependencies - sandbox.stub(uut.adapters.bchjs.Blockchain, 'getTxOut').resolves(null) + sandbox.stub(uut.adapters.wallet.bchWallet, 'utxoIsValid').resolves(false) sandbox.stub(uut.adapters.wallet.bchWallet, 'getTokenData').resolves({}) sandbox.stub(uut, 'categorizeToken').resolves('nft') sandbox.stub(uut, 'detectNsfw').resolves(false) @@ -111,18 +111,7 @@ describe('#offer-use-case', () => { } // Mock dependencies - sandbox.stub(uut.adapters.bchjs.Blockchain, 'getTxOut').resolves({ - bestblock: - '000000000000000000d2060b83f90f8187b92fcccb4a42aaa19ce5a305fe0ae3', - confirmations: 0, - value: 0, - scriptPubKey: { - asm: 'OP_RETURN 5262419 1 1145980243 38e97c5d7d3585a2cbf3f9580c82ca33985f9cb0845d4dcce220cb709f9538b0 00000000001e8480 0000000009a7ec80', - hex: '6a04534c500001010453454e442038e97c5d7d3585a2cbf3f9580c82ca33985f9cb0845d4dcce220cb709f9538b00800000000001e8480080000000009a7ec80', - type: 'nulldata' - }, - coinbase: false - }) + sandbox.stub(uut.adapters.wallet.bchWallet, 'utxoIsValid').resolves(true) sandbox.stub(uut, 'categorizeToken').resolves('fungible') sandbox.stub(uut.adapters.wallet.bchWallet, 'getTokenData').resolves({}) sandbox.stub(uut, 'detectNsfw').resolves(false) diff --git a/test/unit/use-cases/order.use-case.unit.js b/test/unit/use-cases/order.use-case.unit.js index c0ea860..1d42e84 100644 --- a/test/unit/use-cases/order.use-case.unit.js +++ b/test/unit/use-cases/order.use-case.unit.js @@ -106,14 +106,12 @@ describe('#order-use-case', () => { numTokens: 1 } - // Mock dependencies - // sandbox.stub(uut.adapters.wallet, 'burnPsf').resolves('fakeTxid') - // sandbox.stub(uut.adapters.wallet.bchWallet, 'getTxData').resolves({ tokenTicker: 'TROUT' }) - sandbox.stub(uut.orderEntity, 'validate').returns(entryObj) + // Mock dependencies and force expected code path + sandbox.stub(uut.orderEntity, 'inputValidate').returns(entryObj) sandbox.stub(uut, 'ensureFunds').resolves() sandbox.stub(uut.adapters.wallet.bchWallet.bchjs.Util, 'sleep').resolves() sandbox.stub(uut.adapters.wallet, 'moveTokens').resolves({ txid: 'fakeTxid', vout: 0, hdIndex: 1 }) - sandbox.stub(uut.adapters.wallet.bchWallet, 'getUtxos').resolves() + sandbox.stub(uut.adapters.wallet.bchWallet, 'initialize').resolves() sandbox.stub(uut.adapters.p2wdb, 'write').resolves('fakeHash') const result = await uut.createOrder(entryObj)