mirror of
https://github.com/Permissionless-Software-Foundation/bch-dex.git
synced 2026-09-21 16:52:00 -07:00
Compare commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
25aaf4146f | ||
|
|
8ee10f2f8c | ||
|
|
bf96821c2c | ||
|
|
9787806427 | ||
|
|
9043aab432 | ||
|
|
58989a81dc | ||
|
|
82acd623d8 | ||
|
|
e4fe8cc492 | ||
|
|
66b8e6b263 | ||
|
|
cabff83222 | ||
|
|
d94b527780 | ||
|
|
f0e8a05f08 | ||
|
|
278b4127e1 | ||
|
|
87b3d7519c | ||
|
|
ed4e75c9ad | ||
|
|
b0cc5a6e0b | ||
|
|
6b4139a29e | ||
|
|
925242262a | ||
|
|
74fe77009c | ||
|
|
51f7905dad | ||
|
|
0b1d3e63f6 | ||
|
|
549fd4fd5a | ||
|
|
846ee21c48 | ||
|
|
6654836440 | ||
|
|
a25a13673e | ||
|
|
30eed1ffb1 | ||
|
|
7884cffdc6 | ||
|
|
c1a8210fa7 | ||
|
|
9f3b482f57 | ||
|
|
9487027852 | ||
|
|
9065900608 | ||
|
|
2da319f896 | ||
|
|
449a98d80c | ||
|
|
2343120fcf | ||
|
|
2d4fa523cd | ||
|
|
c8cc3adbc5 | ||
|
|
169e0ad3d2 | ||
|
|
e20a0a5d27 | ||
|
|
6dda29bb14 | ||
|
|
dd662e9fe9 | ||
|
|
9b775c5bf6 | ||
|
|
2047673862 | ||
|
|
5b545aebeb | ||
|
|
1e75816125 | ||
|
|
455fd807a4 | ||
|
|
8b75ac0f32 | ||
|
|
f1a5ae70e2 | ||
|
|
46bd532eeb | ||
|
|
6f99b215cd | ||
|
|
3482540fc8 | ||
|
|
fb999c7bd4 | ||
|
|
a09e5a5ba7 | ||
|
|
ba14b97258 | ||
|
|
79ac3729c9 | ||
|
|
bd77754686 | ||
|
|
b3b5322226 | ||
|
|
ec1f950ffb | ||
|
|
b18bc51885 | ||
|
|
e8c35dd1f3 | ||
|
|
8be0accdca | ||
|
|
94c56a06b7 | ||
|
|
42f64e3304 | ||
|
|
140707ce6b |
@@ -69,5 +69,6 @@ ipfs-service-provider.sh
|
||||
run-dev.sh
|
||||
wallet.json
|
||||
data/
|
||||
*.zip
|
||||
|
||||
!README.md
|
||||
|
||||
Vendored
+5
-1
@@ -47,6 +47,7 @@ export default {
|
||||
|
||||
// P2WDB URL that will accept API calls from the p2wdb npm library.
|
||||
p2wdbUrl: process.env.P2WDB_URL ? process.env.P2WDB_URL : 'https://p2wdb.fullstack.cash',
|
||||
// p2wdbUrl: process.env.P2WDB_URL ? process.env.P2WDB_URL : 'http://localhost:5010',
|
||||
|
||||
// FullStack.cash account information, used for automatic JWT handling.
|
||||
getJwtAtStartup: process.env.GET_JWT_AT_STARTUP ? true : false,
|
||||
@@ -62,6 +63,9 @@ export default {
|
||||
fullstackPassword: process.env.FULLSTACKPASS
|
||||
? process.env.FULLSTACKPASS
|
||||
: 'demo',
|
||||
authPass: process.env.FULLSTACK_AUTH_PASS
|
||||
? process.env.FULLSTACK_AUTH_PASS
|
||||
: '',
|
||||
|
||||
// IPFS settings.
|
||||
isCircuitRelay: process.env.ENABLE_CIRCUIT_RELAY ? true : false,
|
||||
@@ -116,5 +120,5 @@ export default {
|
||||
chatPubSubChan: 'psf-ipfs-chat-001',
|
||||
|
||||
// IPFS gateway
|
||||
ipfsGateway: process.env.IPFS_GATEWAY ? process.env.IPFS_GATEWAY : 'https://p2wdb-gateway.fullstack.cash/ipfs/'
|
||||
ipfsGateway: process.env.IPFS_GATEWAY ? process.env.IPFS_GATEWAY : 'https://p2wdb-gateway-678.fullstack.cash/ipfs/'
|
||||
}
|
||||
|
||||
Generated
+538
-180
@@ -9,10 +9,11 @@
|
||||
"version": "2.0.2",
|
||||
"license": "MIT",
|
||||
"dependencies": {
|
||||
"@chris.troutner/retry-queue": "1.0.5",
|
||||
"@psf/bch-js": "^6.4.5",
|
||||
"@chris.troutner/retry-queue": "1.0.8",
|
||||
"@psf/bch-js": "6.5.1",
|
||||
"axios": "0.27.2",
|
||||
"bch-message-lib": "2.2.1",
|
||||
"bch-token-sweep": "2.2.1",
|
||||
"bcryptjs": "2.4.3",
|
||||
"bitcoincashjs-lib": "3.3.3",
|
||||
"glob": "7.1.6",
|
||||
@@ -32,21 +33,20 @@
|
||||
"koa-router": "10.0.0",
|
||||
"koa-static": "5.0.0",
|
||||
"koa2-ratelimit": "0.9.1",
|
||||
"libp2p": "^0.36.2",
|
||||
"libp2p": "0.36.2",
|
||||
"line-reader": "0.4.0",
|
||||
"minimal-slp-wallet": "../minimal-slp-wallet/",
|
||||
"minimal-slp-wallet": "5.5.5",
|
||||
"mongoose": "5.13.14",
|
||||
"node-fetch": "npm:@achingbrain/node-fetch@2.6.7",
|
||||
"nodemailer": "6.7.5",
|
||||
"p2wdb": "2.2.3",
|
||||
"p2wdb-esm": "2.2.9",
|
||||
"passport-local": "1.0.0",
|
||||
"public-ip": "^4.0.4",
|
||||
"public-ip": "4.0.4",
|
||||
"winston": "3.3.3",
|
||||
"winston-daily-rotate-file": "4.5.0"
|
||||
},
|
||||
"devDependencies": {
|
||||
"apidoc": "0.51.1",
|
||||
"bch-token-sweep": "2.1.2",
|
||||
"c8": "7.12.0",
|
||||
"chai": "4.3.0",
|
||||
"coveralls": "2.11.4",
|
||||
@@ -58,32 +58,26 @@
|
||||
"uuid": "8.3.2"
|
||||
}
|
||||
},
|
||||
"../minimal-slp-wallet": {
|
||||
"version": "5.0.0",
|
||||
"../p2wdb": {
|
||||
"version": "2.0.0",
|
||||
"extraneous": true,
|
||||
"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"
|
||||
"@chris.troutner/retry-queue-commonjs": "1.0.8",
|
||||
"apidoc": "0.52.0",
|
||||
"axios": "0.24.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",
|
||||
"minimal-slp-wallet": "5.2.1",
|
||||
"mocha": "^10.0.0",
|
||||
"nyc": "15.1.0",
|
||||
"semantic-release": "19.0.3",
|
||||
"sinon": "9.2.0",
|
||||
"semantic-release": "19.0.5",
|
||||
"sinon": "9.2.2",
|
||||
"standard": "16.0.4",
|
||||
"tinyify": "3.0.0"
|
||||
}
|
||||
@@ -203,14 +197,39 @@
|
||||
}
|
||||
},
|
||||
"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==",
|
||||
"version": "1.0.8",
|
||||
"resolved": "https://registry.npmjs.org/@chris.troutner/retry-queue/-/retry-queue-1.0.8.tgz",
|
||||
"integrity": "sha512-ucyUGWTeXhOcXLglwb8alR3dNATPy+3vGea2uQJ0J8jnJufWrUr/NEq4b53op1tOTF029qrun6OmIN6Ls58pqw==",
|
||||
"dependencies": {
|
||||
"p-queue": "7.3.0",
|
||||
"p-retry": "5.1.1"
|
||||
}
|
||||
},
|
||||
"node_modules/@chris.troutner/retry-queue-commonjs": {
|
||||
"version": "1.0.8",
|
||||
"resolved": "https://registry.npmjs.org/@chris.troutner/retry-queue-commonjs/-/retry-queue-commonjs-1.0.8.tgz",
|
||||
"integrity": "sha512-jEHmCKffjIXTm0d/YcRQzCDPbzW2NFTEO72b1vmETnmATO57MmO39F37gEaq7J7lnF5JMxuM3Oq+FWa1L7HXxA==",
|
||||
"dependencies": {
|
||||
"p-queue": "4.0.0",
|
||||
"p-retry": "4.6.2"
|
||||
}
|
||||
},
|
||||
"node_modules/@chris.troutner/retry-queue-commonjs/node_modules/eventemitter3": {
|
||||
"version": "3.1.2",
|
||||
"resolved": "https://registry.npmjs.org/eventemitter3/-/eventemitter3-3.1.2.tgz",
|
||||
"integrity": "sha512-tvtQIeLVHjDkJYnzf2dgVMxfuSGJeM/7UCG17TT4EumTfNtF+0nebF/4zWOIkCreAbtNqhGEboB6BWrwqNaw4Q=="
|
||||
},
|
||||
"node_modules/@chris.troutner/retry-queue-commonjs/node_modules/p-queue": {
|
||||
"version": "4.0.0",
|
||||
"resolved": "https://registry.npmjs.org/p-queue/-/p-queue-4.0.0.tgz",
|
||||
"integrity": "sha512-3cRXXn3/O0o3+eVmUroJPSj/esxoEFIm0ZOno/T+NzG/VZgPOqQ8WKmlNqubSEpZmCIngEy34unkHGg83ZIBmg==",
|
||||
"dependencies": {
|
||||
"eventemitter3": "^3.1.0"
|
||||
},
|
||||
"engines": {
|
||||
"node": ">=6"
|
||||
}
|
||||
},
|
||||
"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",
|
||||
@@ -1076,9 +1095,9 @@
|
||||
"license": "BSD-3-Clause"
|
||||
},
|
||||
"node_modules/@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==",
|
||||
"version": "6.5.1",
|
||||
"resolved": "https://registry.npmjs.org/@psf/bch-js/-/bch-js-6.5.1.tgz",
|
||||
"integrity": "sha512-W52V6NCte/LJZ2TMJwXorq2FdwMMzjS94sh4slebrcUp6oHiAG+/NouQ4ID/I1DEJQlQnQpf2j3zxveCimDERQ==",
|
||||
"dependencies": {
|
||||
"@chris.troutner/bip32-utils": "1.0.5",
|
||||
"@psf/bip21": "2.0.1",
|
||||
@@ -2083,9 +2102,126 @@
|
||||
"node": ">=4.5.0"
|
||||
}
|
||||
},
|
||||
"node_modules/bch-consumer": {
|
||||
"version": "1.4.1",
|
||||
"resolved": "https://registry.npmjs.org/bch-consumer/-/bch-consumer-1.4.1.tgz",
|
||||
"integrity": "sha512-sRXcM4vNGoC+jUfm2t6z37a9FBZvJJ0/6DUbRtzY7lZad4PXDY34wZ7xYvDfCUUuarTk9epp5sVyWxZowQRIOA==",
|
||||
"dependencies": {
|
||||
"@psf/bch-js": "6.5.3",
|
||||
"apidoc": "0.51.0",
|
||||
"axios": "0.25.0"
|
||||
}
|
||||
},
|
||||
"node_modules/bch-consumer/node_modules/@psf/bch-js": {
|
||||
"version": "6.5.3",
|
||||
"resolved": "https://registry.npmjs.org/@psf/bch-js/-/bch-js-6.5.3.tgz",
|
||||
"integrity": "sha512-38UB7NRrVzslZydWZWnB8FVWr5UpxG0cs0Xb1zmovfyOnp96XrAXfWLEuNKstAkpLApegeMY055b7vaKop/wRQ==",
|
||||
"dependencies": {
|
||||
"@chris.troutner/bip32-utils": "1.0.5",
|
||||
"@psf/bip21": "2.0.1",
|
||||
"@psf/bitcoincash-ops": "2.0.0",
|
||||
"@psf/bitcoincashjs-lib": "4.0.2",
|
||||
"@psf/coininfo": "4.0.0",
|
||||
"axios": "0.26.1",
|
||||
"bc-bip68": "1.0.5",
|
||||
"bchaddrjs-slp": "0.2.5",
|
||||
"bigi": "1.4.2",
|
||||
"bignumber.js": "9.0.0",
|
||||
"bip-schnorr": "0.3.0",
|
||||
"bip38": "2.0.2",
|
||||
"bip39": "3.0.2",
|
||||
"bip66": "1.1.5",
|
||||
"bitcoinjs-message": "2.0.0",
|
||||
"bs58": "4.0.1",
|
||||
"ecashaddrjs": "1.0.7",
|
||||
"ini": "1.3.8",
|
||||
"randombytes": "2.0.6",
|
||||
"safe-buffer": "5.1.2",
|
||||
"satoshi-bitcoin": "1.0.4",
|
||||
"slp-mdm": "0.0.6",
|
||||
"slp-parser": "0.0.4",
|
||||
"wif": "2.0.6"
|
||||
}
|
||||
},
|
||||
"node_modules/bch-consumer/node_modules/@psf/bch-js/node_modules/axios": {
|
||||
"version": "0.26.1",
|
||||
"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/bch-consumer/node_modules/apidoc": {
|
||||
"version": "0.51.0",
|
||||
"resolved": "https://registry.npmjs.org/apidoc/-/apidoc-0.51.0.tgz",
|
||||
"integrity": "sha512-3P4srhm6NA+kE/YRM4qL5jESElpQQJL+Z8n7hyr4uC+1DSwGzmE6adXPVxuT/hpDyShrqmRlHk8hf40RSqEsNw==",
|
||||
"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",
|
||||
"resolved": "https://registry.npmjs.org/axios/-/axios-0.25.0.tgz",
|
||||
"integrity": "sha512-cD8FOb0tRH3uuEe6+evtAbgJtfxr7ly3fQjYcMcuPlgkwVS9xboaVIpcDV+cYQe+yGykgwZCs1pzjntcGa6l5g==",
|
||||
"dependencies": {
|
||||
"follow-redirects": "^1.14.7"
|
||||
}
|
||||
},
|
||||
"node_modules/bch-consumer/node_modules/glob": {
|
||||
"version": "7.2.3",
|
||||
"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",
|
||||
"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"
|
||||
@@ -2093,7 +2229,6 @@
|
||||
},
|
||||
"node_modules/bch-donation/node_modules/apidoc": {
|
||||
"version": "0.51.0",
|
||||
"dev": true,
|
||||
"license": "MIT",
|
||||
"os": [
|
||||
"darwin",
|
||||
@@ -2135,7 +2270,6 @@
|
||||
},
|
||||
"node_modules/bch-donation/node_modules/glob": {
|
||||
"version": "7.2.3",
|
||||
"dev": true,
|
||||
"license": "ISC",
|
||||
"dependencies": {
|
||||
"fs.realpath": "^1.0.0",
|
||||
@@ -2168,9 +2302,9 @@
|
||||
}
|
||||
},
|
||||
"node_modules/bch-token-sweep": {
|
||||
"version": "2.1.2",
|
||||
"dev": true,
|
||||
"license": "MIT",
|
||||
"version": "2.2.1",
|
||||
"resolved": "https://registry.npmjs.org/bch-token-sweep/-/bch-token-sweep-2.2.1.tgz",
|
||||
"integrity": "sha512-f4UGEpPXzea7HQMRSEb6h/amXiwrlsMBAjl1dVYg5//26IDWeG+e3qVNtMJhm00NMZ0BS+LasUa2xlz0UVziZA==",
|
||||
"dependencies": {
|
||||
"bch-donation": "1.1.2",
|
||||
"bignumber.js": "9.0.0"
|
||||
@@ -3381,6 +3515,11 @@
|
||||
"node": ">=0.8.0"
|
||||
}
|
||||
},
|
||||
"node_modules/crypto-js": {
|
||||
"version": "4.0.0",
|
||||
"resolved": "https://registry.npmjs.org/crypto-js/-/crypto-js-4.0.0.tgz",
|
||||
"integrity": "sha512-bzHZN8Pn+gS7DQA6n+iUmBfl0hO5DJq++QP3U6uTucDtk/0iGpXd/Gg7CGR0p8tJhofJyaKoWBuJI4eAO00BBg=="
|
||||
},
|
||||
"node_modules/crypto-random-string": {
|
||||
"version": "2.0.0",
|
||||
"license": "MIT",
|
||||
@@ -7968,8 +8107,117 @@
|
||||
}
|
||||
},
|
||||
"node_modules/minimal-slp-wallet": {
|
||||
"resolved": "../minimal-slp-wallet",
|
||||
"link": true
|
||||
"version": "5.5.5",
|
||||
"resolved": "https://registry.npmjs.org/minimal-slp-wallet/-/minimal-slp-wallet-5.5.5.tgz",
|
||||
"integrity": "sha512-2L0AsMqaQVz939UNUWXnI+9+pzUEaxPSZfXgYQc2hErpk0+XvysnLTjWvT1DOgB1Cqg5Edy6Q02mRxOdXCJO+w==",
|
||||
"dependencies": {
|
||||
"@chris.troutner/retry-queue-commonjs": "1.0.8",
|
||||
"@psf/bch-js": "6.5.3",
|
||||
"apidoc": "0.51.0",
|
||||
"bch-consumer": "1.4.1",
|
||||
"bch-donation": "1.1.2",
|
||||
"crypto-js": "4.0.0"
|
||||
}
|
||||
},
|
||||
"node_modules/minimal-slp-wallet/node_modules/@psf/bch-js": {
|
||||
"version": "6.5.3",
|
||||
"resolved": "https://registry.npmjs.org/@psf/bch-js/-/bch-js-6.5.3.tgz",
|
||||
"integrity": "sha512-38UB7NRrVzslZydWZWnB8FVWr5UpxG0cs0Xb1zmovfyOnp96XrAXfWLEuNKstAkpLApegeMY055b7vaKop/wRQ==",
|
||||
"dependencies": {
|
||||
"@chris.troutner/bip32-utils": "1.0.5",
|
||||
"@psf/bip21": "2.0.1",
|
||||
"@psf/bitcoincash-ops": "2.0.0",
|
||||
"@psf/bitcoincashjs-lib": "4.0.2",
|
||||
"@psf/coininfo": "4.0.0",
|
||||
"axios": "0.26.1",
|
||||
"bc-bip68": "1.0.5",
|
||||
"bchaddrjs-slp": "0.2.5",
|
||||
"bigi": "1.4.2",
|
||||
"bignumber.js": "9.0.0",
|
||||
"bip-schnorr": "0.3.0",
|
||||
"bip38": "2.0.2",
|
||||
"bip39": "3.0.2",
|
||||
"bip66": "1.1.5",
|
||||
"bitcoinjs-message": "2.0.0",
|
||||
"bs58": "4.0.1",
|
||||
"ecashaddrjs": "1.0.7",
|
||||
"ini": "1.3.8",
|
||||
"randombytes": "2.0.6",
|
||||
"safe-buffer": "5.1.2",
|
||||
"satoshi-bitcoin": "1.0.4",
|
||||
"slp-mdm": "0.0.6",
|
||||
"slp-parser": "0.0.4",
|
||||
"wif": "2.0.6"
|
||||
}
|
||||
},
|
||||
"node_modules/minimal-slp-wallet/node_modules/apidoc": {
|
||||
"version": "0.51.0",
|
||||
"resolved": "https://registry.npmjs.org/apidoc/-/apidoc-0.51.0.tgz",
|
||||
"integrity": "sha512-3P4srhm6NA+kE/YRM4qL5jESElpQQJL+Z8n7hyr4uC+1DSwGzmE6adXPVxuT/hpDyShrqmRlHk8hf40RSqEsNw==",
|
||||
"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/axios": {
|
||||
"version": "0.26.1",
|
||||
"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/minimal-slp-wallet/node_modules/glob": {
|
||||
"version": "7.2.3",
|
||||
"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",
|
||||
"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/minimalistic-assert": {
|
||||
"version": "1.0.1",
|
||||
@@ -8684,6 +8932,8 @@
|
||||
"node_modules/node-fetch": {
|
||||
"name": "@achingbrain/node-fetch",
|
||||
"version": "2.6.7",
|
||||
"resolved": "https://registry.npmjs.org/@achingbrain/node-fetch/-/node-fetch-2.6.7.tgz",
|
||||
"integrity": "sha512-iTASGs+HTFK5E4ZqcMsHmeJ4zodyq8L38lZV33jwqcBJYoUt3HjN4+ot+O9/0b+ke8ddE7UgOtVuZN/OkV19/g==",
|
||||
"license": "MIT",
|
||||
"engines": {
|
||||
"node": "4.x || >=6.0.0"
|
||||
@@ -11695,78 +11945,23 @@
|
||||
"node": ">=4"
|
||||
}
|
||||
},
|
||||
"node_modules/p2wdb": {
|
||||
"version": "2.2.3",
|
||||
"license": "MIT",
|
||||
"node_modules/p2wdb-esm": {
|
||||
"version": "2.2.9",
|
||||
"resolved": "https://registry.npmjs.org/p2wdb-esm/-/p2wdb-esm-2.2.9.tgz",
|
||||
"integrity": "sha512-I6Pc/Jj2kQRIpDmvs0LAnIv7ssFm1kz+SW+SRkjHezw84arFeeIMkqaVk8DXnKWKfIqy3asG4E77jVGrD55IRA==",
|
||||
"dependencies": {
|
||||
"apidoc": "0.52.0",
|
||||
"@chris.troutner/retry-queue-commonjs": "1.0.8",
|
||||
"axios": "0.24.0"
|
||||
}
|
||||
},
|
||||
"node_modules/p2wdb/node_modules/apidoc": {
|
||||
"version": "0.52.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",
|
||||
"prismjs": "^1.25.0",
|
||||
"semver": "^7.3.5",
|
||||
"style-loader": "^3.3.1",
|
||||
"webpack": "^5.64.2",
|
||||
"webpack-cli": "^4.9.1",
|
||||
"winston": "^3.3.3"
|
||||
},
|
||||
"bin": {
|
||||
"apidoc": "bin/apidoc"
|
||||
},
|
||||
"engines": {
|
||||
"node": ">=14.0.0"
|
||||
}
|
||||
},
|
||||
"node_modules/p2wdb/node_modules/axios": {
|
||||
"node_modules/p2wdb-esm/node_modules/axios": {
|
||||
"version": "0.24.0",
|
||||
"license": "MIT",
|
||||
"resolved": "https://registry.npmjs.org/axios/-/axios-0.24.0.tgz",
|
||||
"integrity": "sha512-Q6cWsys88HoPgAaFAVUb0WpPk0O8iTeisR9IMqy9G8AbO4NlpVknrnQS03zzF9PGAWgO3cgletO3VjV/P7VztA==",
|
||||
"dependencies": {
|
||||
"follow-redirects": "^1.14.4"
|
||||
}
|
||||
},
|
||||
"node_modules/p2wdb/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/package-json": {
|
||||
"version": "6.5.0",
|
||||
"license": "MIT",
|
||||
@@ -12213,7 +12408,6 @@
|
||||
},
|
||||
"node_modules/querystringify": {
|
||||
"version": "2.2.0",
|
||||
"dev": true,
|
||||
"license": "MIT"
|
||||
},
|
||||
"node_modules/queue-microtask": {
|
||||
@@ -12701,7 +12895,6 @@
|
||||
},
|
||||
"node_modules/requires-port": {
|
||||
"version": "1.0.0",
|
||||
"dev": true,
|
||||
"license": "MIT"
|
||||
},
|
||||
"node_modules/resolve": {
|
||||
@@ -14968,7 +15161,6 @@
|
||||
},
|
||||
"node_modules/url-parse": {
|
||||
"version": "1.5.10",
|
||||
"dev": true,
|
||||
"license": "MIT",
|
||||
"dependencies": {
|
||||
"querystringify": "^2.1.1",
|
||||
@@ -15636,9 +15828,9 @@
|
||||
}
|
||||
},
|
||||
"@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==",
|
||||
"version": "1.0.8",
|
||||
"resolved": "https://registry.npmjs.org/@chris.troutner/retry-queue/-/retry-queue-1.0.8.tgz",
|
||||
"integrity": "sha512-ucyUGWTeXhOcXLglwb8alR3dNATPy+3vGea2uQJ0J8jnJufWrUr/NEq4b53op1tOTF029qrun6OmIN6Ls58pqw==",
|
||||
"requires": {
|
||||
"p-queue": "7.3.0",
|
||||
"p-retry": "5.1.1"
|
||||
@@ -15669,6 +15861,30 @@
|
||||
}
|
||||
}
|
||||
},
|
||||
"@chris.troutner/retry-queue-commonjs": {
|
||||
"version": "1.0.8",
|
||||
"resolved": "https://registry.npmjs.org/@chris.troutner/retry-queue-commonjs/-/retry-queue-commonjs-1.0.8.tgz",
|
||||
"integrity": "sha512-jEHmCKffjIXTm0d/YcRQzCDPbzW2NFTEO72b1vmETnmATO57MmO39F37gEaq7J7lnF5JMxuM3Oq+FWa1L7HXxA==",
|
||||
"requires": {
|
||||
"p-queue": "4.0.0",
|
||||
"p-retry": "4.6.2"
|
||||
},
|
||||
"dependencies": {
|
||||
"eventemitter3": {
|
||||
"version": "3.1.2",
|
||||
"resolved": "https://registry.npmjs.org/eventemitter3/-/eventemitter3-3.1.2.tgz",
|
||||
"integrity": "sha512-tvtQIeLVHjDkJYnzf2dgVMxfuSGJeM/7UCG17TT4EumTfNtF+0nebF/4zWOIkCreAbtNqhGEboB6BWrwqNaw4Q=="
|
||||
},
|
||||
"p-queue": {
|
||||
"version": "4.0.0",
|
||||
"resolved": "https://registry.npmjs.org/p-queue/-/p-queue-4.0.0.tgz",
|
||||
"integrity": "sha512-3cRXXn3/O0o3+eVmUroJPSj/esxoEFIm0ZOno/T+NzG/VZgPOqQ8WKmlNqubSEpZmCIngEy34unkHGg83ZIBmg==",
|
||||
"requires": {
|
||||
"eventemitter3": "^3.1.0"
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
"@colors/colors": {
|
||||
"version": "1.5.0"
|
||||
},
|
||||
@@ -16259,9 +16475,9 @@
|
||||
"version": "1.1.0"
|
||||
},
|
||||
"@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==",
|
||||
"version": "6.5.1",
|
||||
"resolved": "https://registry.npmjs.org/@psf/bch-js/-/bch-js-6.5.1.tgz",
|
||||
"integrity": "sha512-W52V6NCte/LJZ2TMJwXorq2FdwMMzjS94sh4slebrcUp6oHiAG+/NouQ4ID/I1DEJQlQnQpf2j3zxveCimDERQ==",
|
||||
"requires": {
|
||||
"@chris.troutner/bip32-utils": "1.0.5",
|
||||
"@psf/bip21": "2.0.1",
|
||||
@@ -16973,16 +17189,117 @@
|
||||
"resolved": "https://registry.npmjs.org/bc-bip68/-/bc-bip68-1.0.5.tgz",
|
||||
"integrity": "sha512-GzaMlN7pNthrY5BhReVhnfr4Ixx+GUSfyNRHYh0QiMUF0d0+0YaD8MpEdv6AjFBksg/zlqL1fVCBBm6PpTt2Rg=="
|
||||
},
|
||||
"bch-consumer": {
|
||||
"version": "1.4.1",
|
||||
"resolved": "https://registry.npmjs.org/bch-consumer/-/bch-consumer-1.4.1.tgz",
|
||||
"integrity": "sha512-sRXcM4vNGoC+jUfm2t6z37a9FBZvJJ0/6DUbRtzY7lZad4PXDY34wZ7xYvDfCUUuarTk9epp5sVyWxZowQRIOA==",
|
||||
"requires": {
|
||||
"@psf/bch-js": "6.5.3",
|
||||
"apidoc": "0.51.0",
|
||||
"axios": "0.25.0"
|
||||
},
|
||||
"dependencies": {
|
||||
"@psf/bch-js": {
|
||||
"version": "6.5.3",
|
||||
"resolved": "https://registry.npmjs.org/@psf/bch-js/-/bch-js-6.5.3.tgz",
|
||||
"integrity": "sha512-38UB7NRrVzslZydWZWnB8FVWr5UpxG0cs0Xb1zmovfyOnp96XrAXfWLEuNKstAkpLApegeMY055b7vaKop/wRQ==",
|
||||
"requires": {
|
||||
"@chris.troutner/bip32-utils": "1.0.5",
|
||||
"@psf/bip21": "2.0.1",
|
||||
"@psf/bitcoincash-ops": "2.0.0",
|
||||
"@psf/bitcoincashjs-lib": "4.0.2",
|
||||
"@psf/coininfo": "4.0.0",
|
||||
"axios": "0.26.1",
|
||||
"bc-bip68": "1.0.5",
|
||||
"bchaddrjs-slp": "0.2.5",
|
||||
"bigi": "1.4.2",
|
||||
"bignumber.js": "9.0.0",
|
||||
"bip-schnorr": "0.3.0",
|
||||
"bip38": "2.0.2",
|
||||
"bip39": "3.0.2",
|
||||
"bip66": "1.1.5",
|
||||
"bitcoinjs-message": "2.0.0",
|
||||
"bs58": "4.0.1",
|
||||
"ecashaddrjs": "1.0.7",
|
||||
"ini": "1.3.8",
|
||||
"randombytes": "2.0.6",
|
||||
"safe-buffer": "5.1.2",
|
||||
"satoshi-bitcoin": "1.0.4",
|
||||
"slp-mdm": "0.0.6",
|
||||
"slp-parser": "0.0.4",
|
||||
"wif": "2.0.6"
|
||||
},
|
||||
"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"
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
"apidoc": {
|
||||
"version": "0.51.0",
|
||||
"resolved": "https://registry.npmjs.org/apidoc/-/apidoc-0.51.0.tgz",
|
||||
"integrity": "sha512-3P4srhm6NA+kE/YRM4qL5jESElpQQJL+Z8n7hyr4uC+1DSwGzmE6adXPVxuT/hpDyShrqmRlHk8hf40RSqEsNw==",
|
||||
"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",
|
||||
"resolved": "https://registry.npmjs.org/axios/-/axios-0.25.0.tgz",
|
||||
"integrity": "sha512-cD8FOb0tRH3uuEe6+evtAbgJtfxr7ly3fQjYcMcuPlgkwVS9xboaVIpcDV+cYQe+yGykgwZCs1pzjntcGa6l5g==",
|
||||
"requires": {
|
||||
"follow-redirects": "^1.14.7"
|
||||
}
|
||||
},
|
||||
"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",
|
||||
"inherits": "2",
|
||||
"minimatch": "^3.1.1",
|
||||
"once": "^1.3.0",
|
||||
"path-is-absolute": "^1.0.0"
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
"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",
|
||||
@@ -17010,7 +17327,6 @@
|
||||
},
|
||||
"glob": {
|
||||
"version": "7.2.3",
|
||||
"dev": true,
|
||||
"requires": {
|
||||
"fs.realpath": "^1.0.0",
|
||||
"inflight": "^1.0.4",
|
||||
@@ -17034,8 +17350,9 @@
|
||||
"requires": {}
|
||||
},
|
||||
"bch-token-sweep": {
|
||||
"version": "2.1.2",
|
||||
"dev": true,
|
||||
"version": "2.2.1",
|
||||
"resolved": "https://registry.npmjs.org/bch-token-sweep/-/bch-token-sweep-2.2.1.tgz",
|
||||
"integrity": "sha512-f4UGEpPXzea7HQMRSEb6h/amXiwrlsMBAjl1dVYg5//26IDWeG+e3qVNtMJhm00NMZ0BS+LasUa2xlz0UVziZA==",
|
||||
"requires": {
|
||||
"bch-donation": "1.1.2",
|
||||
"bignumber.js": "9.0.0"
|
||||
@@ -17845,6 +18162,11 @@
|
||||
"boom": "0.4.x"
|
||||
}
|
||||
},
|
||||
"crypto-js": {
|
||||
"version": "4.0.0",
|
||||
"resolved": "https://registry.npmjs.org/crypto-js/-/crypto-js-4.0.0.tgz",
|
||||
"integrity": "sha512-bzHZN8Pn+gS7DQA6n+iUmBfl0hO5DJq++QP3U6uTucDtk/0iGpXd/Gg7CGR0p8tJhofJyaKoWBuJI4eAO00BBg=="
|
||||
},
|
||||
"crypto-random-string": {
|
||||
"version": "2.0.0"
|
||||
},
|
||||
@@ -20880,30 +21202,99 @@
|
||||
"dev": true
|
||||
},
|
||||
"minimal-slp-wallet": {
|
||||
"version": "file:../minimal-slp-wallet",
|
||||
"version": "5.5.5",
|
||||
"resolved": "https://registry.npmjs.org/minimal-slp-wallet/-/minimal-slp-wallet-5.5.5.tgz",
|
||||
"integrity": "sha512-2L0AsMqaQVz939UNUWXnI+9+pzUEaxPSZfXgYQc2hErpk0+XvysnLTjWvT1DOgB1Cqg5Edy6Q02mRxOdXCJO+w==",
|
||||
"requires": {
|
||||
"@psf/bch-js": "6.4.5",
|
||||
"@chris.troutner/retry-queue-commonjs": "1.0.8",
|
||||
"@psf/bch-js": "6.5.3",
|
||||
"apidoc": "0.51.0",
|
||||
"bch-consumer": "1.3.1",
|
||||
"bch-consumer": "1.4.1",
|
||||
"bch-donation": "1.1.2",
|
||||
"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"
|
||||
"crypto-js": "4.0.0"
|
||||
},
|
||||
"dependencies": {
|
||||
"@psf/bch-js": {
|
||||
"version": "6.5.3",
|
||||
"resolved": "https://registry.npmjs.org/@psf/bch-js/-/bch-js-6.5.3.tgz",
|
||||
"integrity": "sha512-38UB7NRrVzslZydWZWnB8FVWr5UpxG0cs0Xb1zmovfyOnp96XrAXfWLEuNKstAkpLApegeMY055b7vaKop/wRQ==",
|
||||
"requires": {
|
||||
"@chris.troutner/bip32-utils": "1.0.5",
|
||||
"@psf/bip21": "2.0.1",
|
||||
"@psf/bitcoincash-ops": "2.0.0",
|
||||
"@psf/bitcoincashjs-lib": "4.0.2",
|
||||
"@psf/coininfo": "4.0.0",
|
||||
"axios": "0.26.1",
|
||||
"bc-bip68": "1.0.5",
|
||||
"bchaddrjs-slp": "0.2.5",
|
||||
"bigi": "1.4.2",
|
||||
"bignumber.js": "9.0.0",
|
||||
"bip-schnorr": "0.3.0",
|
||||
"bip38": "2.0.2",
|
||||
"bip39": "3.0.2",
|
||||
"bip66": "1.1.5",
|
||||
"bitcoinjs-message": "2.0.0",
|
||||
"bs58": "4.0.1",
|
||||
"ecashaddrjs": "1.0.7",
|
||||
"ini": "1.3.8",
|
||||
"randombytes": "2.0.6",
|
||||
"safe-buffer": "5.1.2",
|
||||
"satoshi-bitcoin": "1.0.4",
|
||||
"slp-mdm": "0.0.6",
|
||||
"slp-parser": "0.0.4",
|
||||
"wif": "2.0.6"
|
||||
}
|
||||
},
|
||||
"apidoc": {
|
||||
"version": "0.51.0",
|
||||
"resolved": "https://registry.npmjs.org/apidoc/-/apidoc-0.51.0.tgz",
|
||||
"integrity": "sha512-3P4srhm6NA+kE/YRM4qL5jESElpQQJL+Z8n7hyr4uC+1DSwGzmE6adXPVxuT/hpDyShrqmRlHk8hf40RSqEsNw==",
|
||||
"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.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"
|
||||
}
|
||||
},
|
||||
"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",
|
||||
"inherits": "2",
|
||||
"minimatch": "^3.1.1",
|
||||
"once": "^1.3.0",
|
||||
"path-is-absolute": "^1.0.0"
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
"minimalistic-assert": {
|
||||
@@ -21371,7 +21762,9 @@
|
||||
}
|
||||
},
|
||||
"node-fetch": {
|
||||
"version": "npm:@achingbrain/node-fetch@2.6.7"
|
||||
"version": "npm:@achingbrain/node-fetch@2.6.7",
|
||||
"resolved": "https://registry.npmjs.org/@achingbrain/node-fetch/-/node-fetch-2.6.7.tgz",
|
||||
"integrity": "sha512-iTASGs+HTFK5E4ZqcMsHmeJ4zodyq8L38lZV33jwqcBJYoUt3HjN4+ot+O9/0b+ke8ddE7UgOtVuZN/OkV19/g=="
|
||||
},
|
||||
"node-forge": {
|
||||
"version": "1.3.1"
|
||||
@@ -23397,54 +23790,22 @@
|
||||
"version": "1.0.0",
|
||||
"dev": true
|
||||
},
|
||||
"p2wdb": {
|
||||
"version": "2.2.3",
|
||||
"p2wdb-esm": {
|
||||
"version": "2.2.9",
|
||||
"resolved": "https://registry.npmjs.org/p2wdb-esm/-/p2wdb-esm-2.2.9.tgz",
|
||||
"integrity": "sha512-I6Pc/Jj2kQRIpDmvs0LAnIv7ssFm1kz+SW+SRkjHezw84arFeeIMkqaVk8DXnKWKfIqy3asG4E77jVGrD55IRA==",
|
||||
"requires": {
|
||||
"apidoc": "0.52.0",
|
||||
"@chris.troutner/retry-queue-commonjs": "1.0.8",
|
||||
"axios": "0.24.0"
|
||||
},
|
||||
"dependencies": {
|
||||
"apidoc": {
|
||||
"version": "0.52.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",
|
||||
"prismjs": "^1.25.0",
|
||||
"semver": "^7.3.5",
|
||||
"style-loader": "^3.3.1",
|
||||
"webpack": "^5.64.2",
|
||||
"webpack-cli": "^4.9.1",
|
||||
"winston": "^3.3.3"
|
||||
}
|
||||
},
|
||||
"axios": {
|
||||
"version": "0.24.0",
|
||||
"resolved": "https://registry.npmjs.org/axios/-/axios-0.24.0.tgz",
|
||||
"integrity": "sha512-Q6cWsys88HoPgAaFAVUb0WpPk0O8iTeisR9IMqy9G8AbO4NlpVknrnQS03zzF9PGAWgO3cgletO3VjV/P7VztA==",
|
||||
"requires": {
|
||||
"follow-redirects": "^1.14.4"
|
||||
}
|
||||
},
|
||||
"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"
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
@@ -23726,8 +24087,7 @@
|
||||
}
|
||||
},
|
||||
"querystringify": {
|
||||
"version": "2.2.0",
|
||||
"dev": true
|
||||
"version": "2.2.0"
|
||||
},
|
||||
"queue-microtask": {
|
||||
"version": "1.2.3",
|
||||
@@ -24042,8 +24402,7 @@
|
||||
"peer": true
|
||||
},
|
||||
"requires-port": {
|
||||
"version": "1.0.0",
|
||||
"dev": true
|
||||
"version": "1.0.0"
|
||||
},
|
||||
"resolve": {
|
||||
"version": "1.22.1",
|
||||
@@ -25497,7 +25856,6 @@
|
||||
},
|
||||
"url-parse": {
|
||||
"version": "1.5.10",
|
||||
"dev": true,
|
||||
"requires": {
|
||||
"querystringify": "^2.1.1",
|
||||
"requires-port": "^1.0.0"
|
||||
|
||||
+7
-7
@@ -28,10 +28,11 @@
|
||||
},
|
||||
"repository": "Permissionless-Software-Foundation/bch-dex",
|
||||
"dependencies": {
|
||||
"@chris.troutner/retry-queue": "1.0.5",
|
||||
"@psf/bch-js": "^6.4.5",
|
||||
"@chris.troutner/retry-queue": "1.0.8",
|
||||
"@psf/bch-js": "6.5.1",
|
||||
"axios": "0.27.2",
|
||||
"bch-message-lib": "2.2.1",
|
||||
"bch-token-sweep": "2.2.1",
|
||||
"bcryptjs": "2.4.3",
|
||||
"bitcoincashjs-lib": "3.3.3",
|
||||
"glob": "7.1.6",
|
||||
@@ -51,21 +52,20 @@
|
||||
"koa-router": "10.0.0",
|
||||
"koa-static": "5.0.0",
|
||||
"koa2-ratelimit": "0.9.1",
|
||||
"libp2p": "^0.36.2",
|
||||
"libp2p": "0.36.2",
|
||||
"line-reader": "0.4.0",
|
||||
"minimal-slp-wallet": "../minimal-slp-wallet/",
|
||||
"minimal-slp-wallet": "5.5.5",
|
||||
"mongoose": "5.13.14",
|
||||
"node-fetch": "npm:@achingbrain/node-fetch@2.6.7",
|
||||
"nodemailer": "6.7.5",
|
||||
"p2wdb": "2.2.3",
|
||||
"p2wdb-esm": "2.2.9",
|
||||
"passport-local": "1.0.0",
|
||||
"public-ip": "^4.0.4",
|
||||
"public-ip": "4.0.4",
|
||||
"winston": "3.3.3",
|
||||
"winston-daily-rotate-file": "4.5.0"
|
||||
},
|
||||
"devDependencies": {
|
||||
"apidoc": "0.51.1",
|
||||
"bch-token-sweep": "2.1.2",
|
||||
"c8": "7.12.0",
|
||||
"chai": "4.3.0",
|
||||
"coveralls": "2.11.4",
|
||||
|
||||
@@ -72,7 +72,10 @@ RUN npm run docs
|
||||
#EXPOSE 5010
|
||||
|
||||
# Start the application.
|
||||
#COPY start-production.sh start-production.sh
|
||||
CMD ["./start-production.sh"]
|
||||
|
||||
#CMD ["npm", "start"]
|
||||
|
||||
# Used for debugging
|
||||
#COPY dummy-app.js dummy-app.js
|
||||
#CMD ["node", "dummy-app.js"]
|
||||
|
||||
@@ -0,0 +1,4 @@
|
||||
setInterval(function () {
|
||||
const now = new Date()
|
||||
console.log(`timestamp: ${now.toLocaleString()}`)
|
||||
}, 5000)
|
||||
@@ -24,9 +24,11 @@ export DBURL=mongodb://172.17.0.1:5666/bch-swap-service-prod
|
||||
export PORT=5700
|
||||
|
||||
# bch-dex specific env vars
|
||||
export BCH_DEX=production
|
||||
export BCH_DEX=prod
|
||||
export WEBHOOKSERVICE=http://172.17.0.1:5667/webhook
|
||||
export WEBHOOKTARGET=http://172.17.0.1:5700/p2wdb
|
||||
export APP_ID=bch-dex-001
|
||||
|
||||
#export P2WDB_URL=http://172.17.0.1:5667
|
||||
|
||||
npm start
|
||||
|
||||
@@ -46,10 +46,11 @@ services:
|
||||
#build:
|
||||
# context: ./p2wdb/
|
||||
# dockerfile: Dockerfile
|
||||
image: christroutner/p2wdb:v3.1.8
|
||||
image: christroutner/p2wdb:v3.3.3
|
||||
container_name: p2wdb
|
||||
environment:
|
||||
CONSUMER_URL: 'https://free-bch.fullstack.cash'
|
||||
#ENABLE_BCH_PAYMENT: 1
|
||||
DEBUG_LEVEL: 1
|
||||
logging:
|
||||
driver: 'json-file'
|
||||
@@ -67,13 +68,14 @@ services:
|
||||
volumes:
|
||||
- ../data/ipfsdata/p2wdb:/home/safeuser/ipfs-p2wdb-service/.ipfsdata/p2wdb
|
||||
- ./p2wdb/start-production.sh:/home/safeuser/ipfs-p2wdb-service/start-production.sh
|
||||
#- ../scripts/wallet.json:/home/safeuser/ipfs-p2wdb-service/wallet.json
|
||||
restart: always
|
||||
|
||||
bch-dex:
|
||||
#build:
|
||||
# context: ./bch-dex/
|
||||
# dockerfile: Dockerfile
|
||||
image: christroutner/bch-dex:v2.0.0
|
||||
image: christroutner/bch-dex:v2.2.4
|
||||
container_name: bch-dex
|
||||
environment:
|
||||
CONSUMER_URL: 'https://free-bch.fullstack.cash'
|
||||
@@ -97,7 +99,7 @@ services:
|
||||
#build:
|
||||
# context: ./bch-dex-ui/
|
||||
# dockerfile: Dockerfile
|
||||
image: christroutner/bch-dex-ui:v1.12.0
|
||||
image: christroutner/bch-dex-ui:v1.2.4
|
||||
container_name: dex-ui
|
||||
environment:
|
||||
SERVER: 'http://192.168.2.3'
|
||||
|
||||
@@ -43,7 +43,7 @@ services:
|
||||
#build:
|
||||
# context: ./p2wdb/
|
||||
# dockerfile: Dockerfile
|
||||
image: christroutner/p2wdb-rpi:v3.1.8
|
||||
image: christroutner/p2wdb-rpi:v3.1.9
|
||||
container_name: p2wdb
|
||||
environment:
|
||||
CONSUMER_URL: 'https://wa-usa-bch-consumer.fullstackcash.nl'
|
||||
@@ -70,7 +70,7 @@ services:
|
||||
#build:
|
||||
# context: ./bch-dex/
|
||||
# dockerfile: Dockerfile
|
||||
image: christroutner/bch-dex-rpi:v2.0.0
|
||||
image: christroutner/bch-dex-rpi:v2.0.8
|
||||
container_name: bch-dex
|
||||
environment:
|
||||
#CONSUMER_URL: 'https://free-bch.fullstack.cash'
|
||||
@@ -95,7 +95,7 @@ services:
|
||||
#build:
|
||||
# context: ./bch-dex-ui/
|
||||
# dockerfile: Dockerfile
|
||||
image: christroutner/bch-dex-ui-rpi:v1.2.2
|
||||
image: christroutner/bch-dex-ui-rpi:v1.2.4
|
||||
container_name: dex-ui
|
||||
logging:
|
||||
driver: 'json-file'
|
||||
|
||||
@@ -43,6 +43,6 @@ export IPFS_TCP_PORT=4001
|
||||
export IPFS_WS_PORT=4003
|
||||
|
||||
# P2WDB specific env vars
|
||||
export ORBITDB_NAME=/orbitdb/zdpuAqNiwLiJBfbRK7uihV2hAbNSXj78ufzv5VyQb8GuvRwDh/psf-bch-p2wdb-keyvalue-v3.0.0-0001
|
||||
#export ORBITDB_NAME=/orbitdb/zdpuAqNiwLiJBfbRK7uihV2hAbNSXj78ufzv5VyQb8GuvRwDh/psf-bch-p2wdb-keyvalue-v3.0.0-0001
|
||||
|
||||
npm start
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
*/
|
||||
|
||||
// Public NPM libraries
|
||||
import BchWallet from 'minimal-slp-wallet/index'
|
||||
import BchWallet from 'minimal-slp-wallet'
|
||||
|
||||
import { promises as fs } from 'fs'
|
||||
|
||||
@@ -16,9 +16,9 @@ async function createWallet () {
|
||||
}
|
||||
|
||||
// Wait for the wallet to be created.
|
||||
this.bchWallet = new BchWallet(undefined, advancedConfig)
|
||||
await this.bchWallet.walletInfoPromise
|
||||
const walletData = this.bchWallet.walletInfo
|
||||
const bchWallet = new BchWallet(undefined, advancedConfig)
|
||||
await bchWallet.walletInfoPromise
|
||||
const walletData = bchWallet.walletInfo
|
||||
walletData.nextAddress = 1
|
||||
|
||||
// Save the wallet file to disk.
|
||||
|
||||
@@ -5,7 +5,7 @@
|
||||
*/
|
||||
|
||||
// Global npm libraries
|
||||
import BchWallet from 'minimal-slp-wallet/index.js'
|
||||
import BchWallet from 'minimal-slp-wallet'
|
||||
|
||||
// Local libraries
|
||||
import WalletAdapter from '../../src/adapters/wallet.js'
|
||||
|
||||
+1
-1
@@ -6,7 +6,7 @@
|
||||
import BCHJS from '@psf/bch-js'
|
||||
|
||||
import MsgLib from 'bch-message-lib'
|
||||
import BchWallet from 'minimal-slp-wallet/index.js'
|
||||
import BchWallet from 'minimal-slp-wallet'
|
||||
|
||||
class Bch {
|
||||
constructor () {
|
||||
|
||||
@@ -8,7 +8,7 @@
|
||||
import IpfsCoord from 'ipfs-coord-esm'
|
||||
|
||||
// import BCHJS from '@psf/bch-js';
|
||||
import SlpWallet from 'minimal-slp-wallet/index.js'
|
||||
import SlpWallet from 'minimal-slp-wallet'
|
||||
import publicIp from 'public-ip'
|
||||
|
||||
// Local libraries
|
||||
|
||||
@@ -6,7 +6,7 @@ const Offer = new mongoose.Schema({
|
||||
tokenId: { type: String },
|
||||
utxoTxid: { type: String },
|
||||
utxoVout: { type: Number },
|
||||
ticker: { type: String },
|
||||
ticker: { type: String, default: '' },
|
||||
tokenType: { type: Number },
|
||||
|
||||
// Trade data
|
||||
|
||||
@@ -5,10 +5,11 @@
|
||||
// Public npm libraries.
|
||||
import axios from 'axios'
|
||||
|
||||
import { Write, Read } from 'p2wdb/index.js'
|
||||
import P2WDB from 'p2wdb-esm'
|
||||
|
||||
// Local libraries
|
||||
import config from '../../config/index.js'
|
||||
const { Write, Read } = P2WDB
|
||||
|
||||
class P2wdbAdapter {
|
||||
constructor (localConfig = {}) {
|
||||
|
||||
+48
-3
@@ -3,7 +3,8 @@
|
||||
*/
|
||||
|
||||
// Public npm libraries
|
||||
import BchWallet from 'minimal-slp-wallet/index.js'
|
||||
import BchWallet from 'minimal-slp-wallet'
|
||||
import BchTokenSweep from 'bch-token-sweep/index.js'
|
||||
|
||||
import bitcoinJs from 'bitcoincashjs-lib'
|
||||
|
||||
@@ -22,6 +23,8 @@ const WALLET_FILE = `${__dirname.toString()}/../../wallet.json`
|
||||
// const P2WDB_TOKEN_ID =
|
||||
// '38e97c5d7d3585a2cbf3f9580c82ca33985f9cb0845d4dcce220cb709f9538b0'
|
||||
|
||||
const advancedConfig = {}
|
||||
|
||||
class WalletAdapter {
|
||||
constructor (localConfig = {}) {
|
||||
// Encapsulate dependencies
|
||||
@@ -87,7 +90,8 @@ class WalletAdapter {
|
||||
throw new Error('Wallet data is not formatted correctly. Can not read mnemonic in wallet file!')
|
||||
}
|
||||
|
||||
const advancedConfig = {}
|
||||
// const advancedConfig = {}
|
||||
console.log(`Using FullStack.cash: ${this.config.useFullStackCash}`)
|
||||
if (this.config.useFullStackCash) {
|
||||
advancedConfig.interface = 'rest-api'
|
||||
advancedConfig.restURL = this.config.apiServer
|
||||
@@ -359,7 +363,7 @@ class WalletAdapter {
|
||||
}
|
||||
|
||||
// Update the UTXO store of the wallet.
|
||||
await this.bchWallet.getUtxos()
|
||||
await this.bchWallet.initialize()
|
||||
|
||||
// Get the token type of the token being moved.
|
||||
// Combine Fungible and NFT token UTXOs.
|
||||
@@ -511,6 +515,47 @@ class WalletAdapter {
|
||||
throw err
|
||||
}
|
||||
}
|
||||
|
||||
// Given an Order database object, this function sends the tokens from the
|
||||
// HD index where they are stored, back to the root address of the wallet.
|
||||
async reclaimTokens (orderData) {
|
||||
try {
|
||||
// Get the key pair from the Order.
|
||||
const keyPair = await this.getKeyPair(orderData.hdIndex)
|
||||
console.log('keyPair: ', keyPair)
|
||||
|
||||
// Instantiate the wallet using the private key of the Order.
|
||||
// const tempWallet = new this.BchWallet(keyPair.wif, advancedConfig)
|
||||
// await tempWallet.initialize()
|
||||
|
||||
// Send the tokens from the Order to the root address.
|
||||
// const receiver = {
|
||||
// address: this.bchWallet.walletInfo.address,
|
||||
// tokenId: orderData.tokenId,
|
||||
// qty: orderData.numTokens
|
||||
// }
|
||||
// console.log('receiver: ', receiver)
|
||||
//
|
||||
// const txid = await tempWallet.sendTokens(receiver)
|
||||
|
||||
// Sweep the tokens to the root address.
|
||||
const sweeper = new BchTokenSweep(
|
||||
keyPair.wif,
|
||||
this.bchWallet.walletInfo.privateKey,
|
||||
this.bchWallet,
|
||||
550,
|
||||
this.bchWallet.walletInfo.cashAddress
|
||||
)
|
||||
await sweeper.populateObjectFromNetwork()
|
||||
const hex = await sweeper.sweepTo(this.bchWallet.walletInfo.cashAddress)
|
||||
const txid = await this.bchWallet.ar.sendTx(hex)
|
||||
|
||||
return txid
|
||||
} catch (err) {
|
||||
console.error('Error in wallet.js/reclaimTokens()')
|
||||
throw err
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
export default WalletAdapter
|
||||
|
||||
@@ -35,6 +35,7 @@ class OrderRESTControllerLib {
|
||||
// console.log('body: ', ctx.request.body)
|
||||
|
||||
const orderObj = ctx.request.body.order
|
||||
console.log('orderObj: ', orderObj)
|
||||
|
||||
const hash = await _this.useCases.order.createOrder(orderObj)
|
||||
|
||||
@@ -47,6 +48,41 @@ class OrderRESTControllerLib {
|
||||
}
|
||||
}
|
||||
|
||||
// curl -X GET http://localhost:5700/order/list/all/0
|
||||
async listOrders (ctx) {
|
||||
try {
|
||||
let page = ctx.params.page
|
||||
if (!page) page = 0
|
||||
|
||||
const offers = await _this.useCases.order.listOrders(page)
|
||||
|
||||
ctx.body = offers
|
||||
} catch (err) {
|
||||
console.log('Error in listOrders REST API handler: ', err)
|
||||
_this.handleError(ctx, err)
|
||||
}
|
||||
}
|
||||
|
||||
// Delete an existing order by returning the token to the root address of
|
||||
// the DEX wallet.
|
||||
async deleteOrder (ctx) {
|
||||
try {
|
||||
// console.log('body: ', ctx.request.body)
|
||||
|
||||
const p2wdbHash = ctx.request.body.p2wdbHash
|
||||
// console.log('p2wdbHash: ', p2wdbHash)
|
||||
|
||||
const txid = await _this.useCases.order.deleteOrder(p2wdbHash)
|
||||
|
||||
ctx.body = { txid }
|
||||
} catch (err) {
|
||||
// console.log(`err.message: ${err.message}`)
|
||||
// console.log('err: ', err)
|
||||
// ctx.throw(422, err.message)
|
||||
_this.handleError(ctx, err)
|
||||
}
|
||||
}
|
||||
|
||||
// DRY error handler
|
||||
handleError (ctx, err) {
|
||||
console.log('err', err)
|
||||
|
||||
@@ -50,6 +50,8 @@ class OrderRouter {
|
||||
|
||||
// Define the routes and attach the controller.
|
||||
this.router.post('/', _this.orderRESTController.createOrder)
|
||||
this.router.get('/list/all/:page', _this.orderRESTController.listOrders)
|
||||
this.router.post('/delete', _this.orderRESTController.deleteOrder)
|
||||
|
||||
// Attach the Controller routes to the Koa app.
|
||||
app.use(_this.router.routes())
|
||||
|
||||
@@ -33,6 +33,7 @@ class TimerControllers {
|
||||
startTimers () {
|
||||
setInterval(this.gcOrders, 60000 * 5)
|
||||
setInterval(this.gcOffers, 60000 * 5)
|
||||
setInterval(this.checkDupOffers, 60000 * 4.5)
|
||||
}
|
||||
|
||||
// Garbage Collect the Orders.
|
||||
@@ -54,6 +55,16 @@ class TimerControllers {
|
||||
console.log('Error in timer-controllers.js/gcOffers(): ', err)
|
||||
}
|
||||
}
|
||||
|
||||
// Remove duplicate Offers
|
||||
checkDupOffers () {
|
||||
try {
|
||||
_this.useCases.offer.removeDuplicateOffers()
|
||||
} catch (err) {
|
||||
// Do not throw an error. This is a top-level function.
|
||||
console.log('Error in timer-controllers.js/checkDupOffers(): ', err)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
export default TimerControllers
|
||||
|
||||
@@ -29,7 +29,7 @@ class OfferEntity {
|
||||
utxoVout,
|
||||
offerStatus,
|
||||
makerAddr,
|
||||
// ticker,
|
||||
ticker,
|
||||
tokenType
|
||||
} = offerData.data
|
||||
|
||||
@@ -95,7 +95,7 @@ class OfferEntity {
|
||||
p2wdbHash: offerData.hash,
|
||||
offerStatus: offerStatus || this.offerStatus[0],
|
||||
makerAddr,
|
||||
// ticker,
|
||||
ticker,
|
||||
tokenType
|
||||
}
|
||||
|
||||
|
||||
@@ -77,20 +77,12 @@ 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 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) return false
|
||||
@@ -292,18 +284,11 @@ class OfferUseCases {
|
||||
}
|
||||
|
||||
// Verify that UTXO for sale is unspent. Abort if it's been spent.
|
||||
// const txid = offerInfo.utxoTxid
|
||||
// const vout = offerInfo.utxoVout
|
||||
|
||||
const utxo = {
|
||||
tx_hash: offerInfo.utxoTxid,
|
||||
tx_pos: offerInfo.utxoVout
|
||||
}
|
||||
const utxoStatus = await this.adapters.wallet.bchWallet.utxoIsValid(utxo)
|
||||
// const utxoStatus = await this.adapters.bchjs.Blockchain.getTxOut(
|
||||
// txid,
|
||||
// vout
|
||||
// )
|
||||
console.log('utxoStatus: ', utxoStatus)
|
||||
if (!utxoStatus) {
|
||||
console.log(`utxo txid: ${offerInfo.utxoTxid}, vout: ${offerInfo.utxoVout}`)
|
||||
@@ -321,7 +306,7 @@ class OfferUseCases {
|
||||
console.log(`utxos: ${JSON.stringify(utxos, null, 2)}`)
|
||||
|
||||
// Calculate amount of sats to generate a counter offer.
|
||||
let satsToMove = offerInfo.numTokens * parseInt(offerInfo.rateInBaseUnit)
|
||||
let satsToMove = Math.ceil(offerInfo.numTokens * parseInt(offerInfo.rateInBaseUnit))
|
||||
if (isNaN(satsToMove)) {
|
||||
throw new Error('Could not calculate the amount of BCH to generate counter offer')
|
||||
}
|
||||
@@ -400,7 +385,7 @@ class OfferUseCases {
|
||||
// Sell Offer
|
||||
|
||||
// Calculate the sats needed
|
||||
const satsNeeded = offerEntity.numTokens * parseInt(offerEntity.rateInBaseUnit)
|
||||
const satsNeeded = Math.ceil(offerEntity.numTokens * parseInt(offerEntity.rateInBaseUnit))
|
||||
if (isNaN(satsNeeded)) {
|
||||
throw new Error('Could not calculate sats needed!')
|
||||
}
|
||||
@@ -482,7 +467,7 @@ class OfferUseCases {
|
||||
console.log(`txObj: ${JSON.stringify(txObj, null, 2)}`)
|
||||
|
||||
// Ensure the 3rd output (vout=2) contains the required amount of BCH.
|
||||
const satsToReceive = orderData.numTokens * parseInt(orderData.rateInBaseUnit)
|
||||
const satsToReceive = Math.ceil(orderData.numTokens * parseInt(orderData.rateInBaseUnit))
|
||||
if (isNaN(satsToReceive)) {
|
||||
throw new Error('Could not calculate the amount of BCH offered in the Counter Offer')
|
||||
}
|
||||
@@ -512,6 +497,45 @@ class OfferUseCases {
|
||||
}
|
||||
}
|
||||
|
||||
// TODO: Write unit tests for this function, then add it to the Timer Controllers
|
||||
// Looks for duplicate offers and removes the duplicate.
|
||||
// Duplicates are checked for when an offer is created, and so should not
|
||||
// exist. But emperical testing shows that they do. This function is called
|
||||
// periodically by a timer, to clean up any duplicates that slipped through
|
||||
// the cracks.
|
||||
async removeDuplicateOffers () {
|
||||
try {
|
||||
const now = new Date()
|
||||
console.log(`Starting removeDuplicateOffers() at ${now.toLocaleString()}`)
|
||||
|
||||
let duplicateFound = false
|
||||
|
||||
// Get all Offers in the database.
|
||||
const offers = await this.OfferModel.find({})
|
||||
// console.log('offers: ', offers)
|
||||
|
||||
const offerZcids = []
|
||||
|
||||
for (let i = 0; i < offers.length; i++) {
|
||||
const thisOffer = offers[i]
|
||||
|
||||
if (offerZcids.includes(thisOffer.p2wdbHash)) {
|
||||
await thisOffer.remove()
|
||||
duplicateFound = true
|
||||
continue
|
||||
}
|
||||
|
||||
// Add the zcid to the array.
|
||||
offerZcids.push(thisOffer.p2wdbHash)
|
||||
}
|
||||
|
||||
return duplicateFound
|
||||
} catch (err) {
|
||||
console.error('Error in removeDuplicateOffers()')
|
||||
throw err
|
||||
}
|
||||
}
|
||||
|
||||
// This function is called by the garbage collection timer controller. It
|
||||
// checks the UTXO associated with each Offer in the database. If the UTXO
|
||||
// has been spent, the Offer is deleted from the database.
|
||||
@@ -530,12 +554,6 @@ class OfferUseCases {
|
||||
|
||||
let utxoStatus = null
|
||||
try {
|
||||
// Get the status of the UTXO associate with this Offer.
|
||||
// utxoStatus = await this.adapters.bchjs.Blockchain.getTxOut(
|
||||
// thisOffer.utxoTxid,
|
||||
// thisOffer.utxoVout
|
||||
// )
|
||||
|
||||
// Get the status of the UTXO associate with this Offer.
|
||||
const utxo = {
|
||||
tx_hash: thisOffer.utxoTxid,
|
||||
@@ -543,7 +561,8 @@ class OfferUseCases {
|
||||
}
|
||||
// console.log(`Checking this UTXO: ${JSON.stringify(utxo, null, 2)}`)
|
||||
|
||||
utxoStatus = await this.adapters.wallet.bchWallet.utxoIsValid(utxo)
|
||||
// utxoStatus = await this.adapters.wallet.bchWallet.utxoIsValid(utxo)
|
||||
utxoStatus = await this.retryQueue.addToQueue(this.adapters.wallet.bchWallet.utxoIsValid, utxo)
|
||||
// console.log('utxoStatus: ', utxoStatus)
|
||||
} catch (err) {
|
||||
// Handle corner case of bad-data in the Offer model.
|
||||
@@ -560,7 +579,8 @@ class OfferUseCases {
|
||||
}
|
||||
|
||||
// If the Offer UTXO is spent, delete the Offer model.
|
||||
if (!utxoStatus) {
|
||||
if (utxoStatus === false) {
|
||||
console.log('utxoStatus: ', utxoStatus)
|
||||
console.log(`Spent UTXO detected. Deleting this Offer: ${JSON.stringify(thisOffer, null, 2)}`)
|
||||
await thisOffer.remove()
|
||||
}
|
||||
|
||||
+50
-4
@@ -10,6 +10,8 @@ import wlogger from '../adapters/wlogger.js'
|
||||
import OrderEntity from '../entities/order.js'
|
||||
import config from '../../config/index.js'
|
||||
|
||||
const DEFAULT_ENTRIES_PER_PAGE = 20
|
||||
|
||||
class OrderLib {
|
||||
constructor (localConfig = {}) {
|
||||
// console.log('User localConfig: ', localConfig)
|
||||
@@ -47,6 +49,10 @@ class OrderLib {
|
||||
const orderEntity = this.orderEntity.inputValidate(entryObj)
|
||||
console.log('orderEntity: ', orderEntity)
|
||||
|
||||
// Optimize the wallet to speed up working with it.
|
||||
console.log('Optimizing wallet before creating new order.')
|
||||
await this.retryQueue.addToQueue(this.adapters.wallet.bchWallet.optimize, {})
|
||||
|
||||
// Ensure sufficient tokens exist to create the order.
|
||||
// await this.ensureFunds(orderEntity)
|
||||
await this.retryQueue.addToQueue(this.ensureFunds, orderEntity)
|
||||
@@ -55,7 +61,7 @@ class OrderLib {
|
||||
// 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
|
||||
orderEntity.ticker = tokenData[0].tokenTicker
|
||||
|
||||
// Move the tokens to holding address.
|
||||
const moveObj = {
|
||||
@@ -115,6 +121,7 @@ class OrderLib {
|
||||
|
||||
// Update the wallet balance
|
||||
await this.adapters.wallet.bchWallet.getUtxos()
|
||||
// console.log(`wallet UTXOs: ${JSON.stringify(this.adapters.wallet.bchWallet.utxos.utxoStore, null, 2)}`)
|
||||
|
||||
// Ensure the app wallet has enough funds to write to the P2WDB.
|
||||
const wif = this.adapters.wallet.bchWallet.walletInfo.privateKey
|
||||
@@ -123,7 +130,7 @@ class OrderLib {
|
||||
|
||||
// Get UTXOs.
|
||||
const utxos = this.adapters.wallet.bchWallet.utxos.utxoStore
|
||||
console.log(`utxos: ${JSON.stringify(utxos, null, 2)}`)
|
||||
// console.log(`utxos: ${JSON.stringify(utxos, null, 2)}`)
|
||||
|
||||
if (orderEntity.buyOrSell.includes('sell')) {
|
||||
// Sell Order
|
||||
@@ -216,7 +223,8 @@ class OrderLib {
|
||||
tx_hash: thisOrder.utxoTxid,
|
||||
tx_pos: thisOrder.utxoVout
|
||||
}
|
||||
utxoStatus = await this.adapters.wallet.bchWallet.utxoIsValid(utxo)
|
||||
// utxoStatus = await this.adapters.wallet.bchWallet.utxoIsValid(utxo)
|
||||
utxoStatus = await this.retryQueue.addToQueue(this.adapters.wallet.bchWallet.utxoIsValid, utxo)
|
||||
// console.log('utxoStatus: ', utxoStatus)
|
||||
} catch (err) {
|
||||
// Handle corner case of bad-data in the Order model.
|
||||
@@ -233,7 +241,8 @@ class OrderLib {
|
||||
}
|
||||
|
||||
// If the Order UTXO is spent, delete the Order model.
|
||||
if (!utxoStatus) {
|
||||
if (utxoStatus === false) {
|
||||
console.log('utxoStatus: ', utxoStatus)
|
||||
console.log(`Spent UTXO detected. Deleting this Order: ${JSON.stringify(thisOrder, null, 2)}`)
|
||||
await thisOrder.remove()
|
||||
}
|
||||
@@ -243,6 +252,43 @@ class OrderLib {
|
||||
throw err
|
||||
}
|
||||
}
|
||||
|
||||
async listOrders (page = 0) {
|
||||
try {
|
||||
const data = await this.OrderModel.find({})
|
||||
// Sort entries so newest entries show first.
|
||||
.sort('-timestamp')
|
||||
// Skip to the start of the selected page.
|
||||
.skip(page * DEFAULT_ENTRIES_PER_PAGE)
|
||||
// Only return 20 results.
|
||||
.limit(DEFAULT_ENTRIES_PER_PAGE)
|
||||
|
||||
return data
|
||||
} catch (error) {
|
||||
console.error('Error in use-cases/order/listOrders()')
|
||||
throw error
|
||||
}
|
||||
}
|
||||
|
||||
// Delete an Order model by sending the token back to the root address. This
|
||||
// will allow the garbage collectors to delete the Order and the Offer.
|
||||
async deleteOrder (p2wdbHash) {
|
||||
try {
|
||||
console.log('p2wdbHash: ', p2wdbHash)
|
||||
|
||||
// Find the order by the given hash.
|
||||
const order = await this.findOrderByHash(p2wdbHash)
|
||||
console.log('order: ', order)
|
||||
|
||||
// Reclaim the tokens
|
||||
const txid = await this.adapters.wallet.reclaimTokens(order)
|
||||
|
||||
return txid
|
||||
} catch (err) {
|
||||
console.error('Error in use-cases/order/deleteOrder()')
|
||||
throw err
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
export default OrderLib
|
||||
|
||||
@@ -8,7 +8,7 @@ import { assert } from 'chai'
|
||||
import sinon from 'sinon'
|
||||
|
||||
// const BCHJS = require('@psf/bch-js')
|
||||
import BchWallet from 'minimal-slp-wallet/index.js'
|
||||
import BchWallet from 'minimal-slp-wallet'
|
||||
|
||||
// Local libraries.
|
||||
import P2wdbAdapter from '../../../src/adapters/p2wdb-adapter.js'
|
||||
|
||||
@@ -37,6 +37,7 @@ class MockBchWallet {
|
||||
this.getTokenData = async () => {}
|
||||
this.initialize = async () => {}
|
||||
this.utxoIsValid = async () => {}
|
||||
this.optimize = async () => {}
|
||||
|
||||
// Environment variable is used by wallet-balance.unit.js to force an error.
|
||||
if (process.env.NO_UTXO) {
|
||||
|
||||
@@ -160,4 +160,35 @@ describe('#offer-use-case', () => {
|
||||
assert.equal(result, 'fungible')
|
||||
})
|
||||
})
|
||||
|
||||
describe('#removeDuplicateOffers', () => {
|
||||
it('should remove duplicate entries and return true', async () => {
|
||||
// Mock dependencies and force desired code path.
|
||||
sandbox.stub(uut.OfferModel, 'find').resolves([
|
||||
{ p2wdbHash: 'a', remove: async () => {} },
|
||||
{ p2wdbHash: 'a', remove: async () => {} },
|
||||
{ p2wdbHash: 'b', remove: async () => {} }
|
||||
])
|
||||
// sandbox.stub(uut.OfferModel, 'remove').resolves()
|
||||
|
||||
const result = await uut.removeDuplicateOffers()
|
||||
console.log('result: ', result)
|
||||
|
||||
assert.equal(result, true)
|
||||
})
|
||||
|
||||
it('should return false if there are no duplicate entries', async () => {
|
||||
// Mock dependencies and force desired code path.
|
||||
sandbox.stub(uut.OfferModel, 'find').resolves([
|
||||
{ p2wdbHash: 'a', remove: async () => {} },
|
||||
{ p2wdbHash: 'b', remove: async () => {} }
|
||||
])
|
||||
// sandbox.stub(uut.OfferModel, 'remove').resolves()
|
||||
|
||||
const result = await uut.removeDuplicateOffers()
|
||||
console.log('result: ', result)
|
||||
|
||||
assert.equal(result, false)
|
||||
})
|
||||
})
|
||||
})
|
||||
|
||||
@@ -103,7 +103,8 @@ describe('#order-use-case', () => {
|
||||
buyOrSell: 'sell',
|
||||
rateInBaseUnit: 1000,
|
||||
minUnitsToExchange: 1250,
|
||||
numTokens: 1
|
||||
numTokens: 1,
|
||||
ticker: 'TEST'
|
||||
}
|
||||
|
||||
// Mock dependencies and force expected code path
|
||||
|
||||
@@ -2,15 +2,15 @@
|
||||
This script has not been customized for offers yet.
|
||||
*/
|
||||
|
||||
const mongoose = require('mongoose')
|
||||
import mongoose from 'mongoose'
|
||||
|
||||
// Force test environment
|
||||
// make sure environment variable is set before this file gets called.
|
||||
// see test script in package.json.
|
||||
// process.env.KOA_ENV = 'test'
|
||||
const config = require('../../config')
|
||||
import config from '../../config'
|
||||
|
||||
const User = require('../../src/models/users')
|
||||
import User from '../../src/models/users'
|
||||
|
||||
async function deleteUsers () {
|
||||
// Connect to the Mongo Database.
|
||||
|
||||
@@ -2,11 +2,10 @@
|
||||
Get all Offers in the database.
|
||||
*/
|
||||
|
||||
const mongoose = require('mongoose')
|
||||
import mongoose from 'mongoose'
|
||||
|
||||
const config = require('../../config')
|
||||
|
||||
const Offer = require('../../src/adapters/localdb/models/offer')
|
||||
import config from '../../config/index.js'
|
||||
import Offer from '../../src/adapters/localdb/models/offer.js'
|
||||
|
||||
async function getOffers () {
|
||||
// Connect to the Mongo Database.
|
||||
|
||||
@@ -1,12 +1,12 @@
|
||||
const mongoose = require('mongoose')
|
||||
import mongoose from 'mongoose'
|
||||
|
||||
// Force test environment
|
||||
// make sure environment variable is set before this file gets called.
|
||||
// see test script in package.json.
|
||||
// process.env.KOA_ENV = 'test'
|
||||
const config = require('../../config')
|
||||
import config from '../../config'
|
||||
|
||||
const User = require('../../src/models/users')
|
||||
import User from '../../src/models/users'
|
||||
|
||||
async function deleteUsers () {
|
||||
// Connect to the Mongo Database.
|
||||
|
||||
@@ -1,8 +1,6 @@
|
||||
const mongoose = require('mongoose')
|
||||
|
||||
const config = require('../../config')
|
||||
|
||||
const Order = require('../../src/adapters/localdb/models/order')
|
||||
import mongoose from 'mongoose'
|
||||
import config from '../../config/index.js'
|
||||
import Order from '../../src/adapters/localdb/models/order.js'
|
||||
|
||||
async function getOrder () {
|
||||
// Connect to the Mongo Database.
|
||||
|
||||
@@ -7,11 +7,12 @@
|
||||
*/
|
||||
|
||||
// Public npm libraries
|
||||
const BCHJS = require('@psf/bch-js')
|
||||
const BchTokenSweep = require('bch-token-sweep/index')
|
||||
import BCHJS from '@psf/bch-js'
|
||||
|
||||
import BchTokenSweep from 'bch-token-sweep/index'
|
||||
|
||||
// Local libraries
|
||||
const WalletAdapter = require('../../src/adapters/wallet')
|
||||
import WalletAdapter from '../../src/adapters/wallet'
|
||||
|
||||
// Constants
|
||||
const EMTPY_ADDR_CUTOFF = 15
|
||||
|
||||
Reference in New Issue
Block a user