mirror of
https://github.com/Permissionless-Software-Foundation/bch-dex.git
synced 2026-09-22 01:02:00 -07:00
Compare commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
94cfb4c785 |
@@ -69,6 +69,5 @@ ipfs-service-provider.sh
|
||||
run-dev.sh
|
||||
wallet.json
|
||||
data/
|
||||
*.zip
|
||||
|
||||
!README.md
|
||||
|
||||
Vendored
-4
@@ -47,7 +47,6 @@ 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,
|
||||
@@ -63,9 +62,6 @@ 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,
|
||||
|
||||
Generated
+33
-198
@@ -13,7 +13,6 @@
|
||||
"@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",
|
||||
@@ -35,11 +34,11 @@
|
||||
"koa2-ratelimit": "0.9.1",
|
||||
"libp2p": "0.36.2",
|
||||
"line-reader": "0.4.0",
|
||||
"minimal-slp-wallet": "5.5.5",
|
||||
"minimal-slp-wallet": "5.4.3",
|
||||
"mongoose": "5.13.14",
|
||||
"node-fetch": "npm:@achingbrain/node-fetch@2.6.7",
|
||||
"nodemailer": "6.7.5",
|
||||
"p2wdb-esm": "2.2.9",
|
||||
"p2wdb-esm": "2.2.7",
|
||||
"passport-local": "1.0.0",
|
||||
"public-ip": "4.0.4",
|
||||
"winston": "3.3.3",
|
||||
@@ -47,6 +46,7 @@
|
||||
},
|
||||
"devDependencies": {
|
||||
"apidoc": "0.51.1",
|
||||
"bch-token-sweep": "2.1.2",
|
||||
"c8": "7.12.0",
|
||||
"chai": "4.3.0",
|
||||
"coveralls": "2.11.4",
|
||||
@@ -2103,54 +2103,15 @@
|
||||
}
|
||||
},
|
||||
"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==",
|
||||
"version": "1.4.0",
|
||||
"resolved": "https://registry.npmjs.org/bch-consumer/-/bch-consumer-1.4.0.tgz",
|
||||
"integrity": "sha512-olftYKtCgT+81fnEL0iSArmeRANw1SZjSwwYsZV7t9CJZjtMXBSXJDCaQoAzUAXNRMtICB3uxAKD1MWuBznZuw==",
|
||||
"dependencies": {
|
||||
"@psf/bch-js": "6.5.3",
|
||||
"@psf/bch-js": "6.5.1",
|
||||
"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",
|
||||
@@ -2302,9 +2263,9 @@
|
||||
}
|
||||
},
|
||||
"node_modules/bch-token-sweep": {
|
||||
"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==",
|
||||
"version": "2.1.2",
|
||||
"dev": true,
|
||||
"license": "MIT",
|
||||
"dependencies": {
|
||||
"bch-donation": "1.1.2",
|
||||
"bignumber.js": "9.0.0"
|
||||
@@ -8107,49 +8068,17 @@
|
||||
}
|
||||
},
|
||||
"node_modules/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==",
|
||||
"version": "5.4.3",
|
||||
"resolved": "https://registry.npmjs.org/minimal-slp-wallet/-/minimal-slp-wallet-5.4.3.tgz",
|
||||
"integrity": "sha512-l9shPcWUHJhmHa6iJs917XNVQR0jaLHgww0fC78ubRokW0Zhea2jO9FNJLi74T8Nd8StCg1pVAlS+MKszU3swQ==",
|
||||
"dependencies": {
|
||||
"@chris.troutner/retry-queue-commonjs": "1.0.8",
|
||||
"@psf/bch-js": "6.5.3",
|
||||
"@psf/bch-js": "6.5.1",
|
||||
"apidoc": "0.51.0",
|
||||
"bch-consumer": "1.4.1",
|
||||
"bch-consumer": "1.4.0",
|
||||
"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",
|
||||
@@ -8192,14 +8121,6 @@
|
||||
"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",
|
||||
@@ -8932,8 +8853,6 @@
|
||||
"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"
|
||||
@@ -11946,9 +11865,9 @@
|
||||
}
|
||||
},
|
||||
"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==",
|
||||
"version": "2.2.7",
|
||||
"resolved": "https://registry.npmjs.org/p2wdb-esm/-/p2wdb-esm-2.2.7.tgz",
|
||||
"integrity": "sha512-528nGjthkkAf8n4H7jSX52pCpsprKgRfZKB4emIYHkOFo9rHYOOZMLlbRkluYtAThjVxJd7w3fyplZFPEXzlyA==",
|
||||
"dependencies": {
|
||||
"@chris.troutner/retry-queue-commonjs": "1.0.8",
|
||||
"axios": "0.24.0"
|
||||
@@ -17190,56 +17109,15 @@
|
||||
"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==",
|
||||
"version": "1.4.0",
|
||||
"resolved": "https://registry.npmjs.org/bch-consumer/-/bch-consumer-1.4.0.tgz",
|
||||
"integrity": "sha512-olftYKtCgT+81fnEL0iSArmeRANw1SZjSwwYsZV7t9CJZjtMXBSXJDCaQoAzUAXNRMtICB3uxAKD1MWuBznZuw==",
|
||||
"requires": {
|
||||
"@psf/bch-js": "6.5.3",
|
||||
"@psf/bch-js": "6.5.1",
|
||||
"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",
|
||||
@@ -17350,9 +17228,8 @@
|
||||
"requires": {}
|
||||
},
|
||||
"bch-token-sweep": {
|
||||
"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==",
|
||||
"version": "2.1.2",
|
||||
"dev": true,
|
||||
"requires": {
|
||||
"bch-donation": "1.1.2",
|
||||
"bignumber.js": "9.0.0"
|
||||
@@ -21202,49 +21079,17 @@
|
||||
"dev": true
|
||||
},
|
||||
"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==",
|
||||
"version": "5.4.3",
|
||||
"resolved": "https://registry.npmjs.org/minimal-slp-wallet/-/minimal-slp-wallet-5.4.3.tgz",
|
||||
"integrity": "sha512-l9shPcWUHJhmHa6iJs917XNVQR0jaLHgww0fC78ubRokW0Zhea2jO9FNJLi74T8Nd8StCg1pVAlS+MKszU3swQ==",
|
||||
"requires": {
|
||||
"@chris.troutner/retry-queue-commonjs": "1.0.8",
|
||||
"@psf/bch-js": "6.5.3",
|
||||
"@psf/bch-js": "6.5.1",
|
||||
"apidoc": "0.51.0",
|
||||
"bch-consumer": "1.4.1",
|
||||
"bch-consumer": "1.4.0",
|
||||
"bch-donation": "1.1.2",
|
||||
"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",
|
||||
@@ -21274,14 +21119,6 @@
|
||||
"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",
|
||||
@@ -21762,9 +21599,7 @@
|
||||
}
|
||||
},
|
||||
"node-fetch": {
|
||||
"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=="
|
||||
"version": "npm:@achingbrain/node-fetch@2.6.7"
|
||||
},
|
||||
"node-forge": {
|
||||
"version": "1.3.1"
|
||||
@@ -23791,9 +23626,9 @@
|
||||
"dev": true
|
||||
},
|
||||
"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==",
|
||||
"version": "2.2.7",
|
||||
"resolved": "https://registry.npmjs.org/p2wdb-esm/-/p2wdb-esm-2.2.7.tgz",
|
||||
"integrity": "sha512-528nGjthkkAf8n4H7jSX52pCpsprKgRfZKB4emIYHkOFo9rHYOOZMLlbRkluYtAThjVxJd7w3fyplZFPEXzlyA==",
|
||||
"requires": {
|
||||
"@chris.troutner/retry-queue-commonjs": "1.0.8",
|
||||
"axios": "0.24.0"
|
||||
|
||||
+3
-3
@@ -32,7 +32,6 @@
|
||||
"@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",
|
||||
@@ -54,11 +53,11 @@
|
||||
"koa2-ratelimit": "0.9.1",
|
||||
"libp2p": "0.36.2",
|
||||
"line-reader": "0.4.0",
|
||||
"minimal-slp-wallet": "5.5.5",
|
||||
"minimal-slp-wallet": "5.4.3",
|
||||
"mongoose": "5.13.14",
|
||||
"node-fetch": "npm:@achingbrain/node-fetch@2.6.7",
|
||||
"nodemailer": "6.7.5",
|
||||
"p2wdb-esm": "2.2.9",
|
||||
"p2wdb-esm": "2.2.7",
|
||||
"passport-local": "1.0.0",
|
||||
"public-ip": "4.0.4",
|
||||
"winston": "3.3.3",
|
||||
@@ -66,6 +65,7 @@
|
||||
},
|
||||
"devDependencies": {
|
||||
"apidoc": "0.51.1",
|
||||
"bch-token-sweep": "2.1.2",
|
||||
"c8": "7.12.0",
|
||||
"chai": "4.3.0",
|
||||
"coveralls": "2.11.4",
|
||||
|
||||
@@ -53,7 +53,7 @@ RUN git clone https://github.com/Permissionless-Software-Foundation/bch-dex-ui-v
|
||||
WORKDIR /home/safeuser/bch-dex-ui-v2
|
||||
|
||||
# For development: switch to unstable branch
|
||||
RUN git checkout ct-unstable
|
||||
RUN git checkout temp-demo
|
||||
|
||||
# Install dependencies
|
||||
#RUN mkdir .ipfsdata
|
||||
|
||||
@@ -29,6 +29,4 @@ 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,11 +46,10 @@ services:
|
||||
#build:
|
||||
# context: ./p2wdb/
|
||||
# dockerfile: Dockerfile
|
||||
image: christroutner/p2wdb:v3.3.5
|
||||
image: christroutner/p2wdb:v3.1.8
|
||||
container_name: p2wdb
|
||||
environment:
|
||||
CONSUMER_URL: 'https://free-bch.fullstack.cash'
|
||||
#ENABLE_BCH_PAYMENT: 1
|
||||
DEBUG_LEVEL: 1
|
||||
logging:
|
||||
driver: 'json-file'
|
||||
@@ -68,14 +67,13 @@ 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.2.4
|
||||
build:
|
||||
context: ./bch-dex/
|
||||
dockerfile: Dockerfile
|
||||
#image: christroutner/bch-dex:v2.0.8
|
||||
container_name: bch-dex
|
||||
environment:
|
||||
CONSUMER_URL: 'https://free-bch.fullstack.cash'
|
||||
@@ -96,10 +94,10 @@ services:
|
||||
restart: always
|
||||
|
||||
dex-ui:
|
||||
#build:
|
||||
# context: ./bch-dex-ui/
|
||||
# dockerfile: Dockerfile
|
||||
image: christroutner/bch-dex-ui:v1.2.4
|
||||
build:
|
||||
context: ./bch-dex-ui/
|
||||
dockerfile: Dockerfile
|
||||
#image: christroutner/bch-dex-ui:v1.2.4
|
||||
container_name: dex-ui
|
||||
environment:
|
||||
SERVER: 'http://192.168.2.3'
|
||||
|
||||
+1
-45
@@ -4,7 +4,6 @@
|
||||
|
||||
// Public npm libraries
|
||||
import BchWallet from 'minimal-slp-wallet'
|
||||
import BchTokenSweep from 'bch-token-sweep/index.js'
|
||||
|
||||
import bitcoinJs from 'bitcoincashjs-lib'
|
||||
|
||||
@@ -23,8 +22,6 @@ const WALLET_FILE = `${__dirname.toString()}/../../wallet.json`
|
||||
// const P2WDB_TOKEN_ID =
|
||||
// '38e97c5d7d3585a2cbf3f9580c82ca33985f9cb0845d4dcce220cb709f9538b0'
|
||||
|
||||
const advancedConfig = {}
|
||||
|
||||
class WalletAdapter {
|
||||
constructor (localConfig = {}) {
|
||||
// Encapsulate dependencies
|
||||
@@ -90,7 +87,7 @@ 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'
|
||||
@@ -515,47 +512,6 @@ 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,7 +35,6 @@ 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)
|
||||
|
||||
@@ -48,41 +47,6 @@ 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,8 +50,6 @@ 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())
|
||||
|
||||
@@ -306,7 +306,7 @@ class OfferUseCases {
|
||||
console.log(`utxos: ${JSON.stringify(utxos, null, 2)}`)
|
||||
|
||||
// Calculate amount of sats to generate a counter offer.
|
||||
let satsToMove = Math.ceil(offerInfo.numTokens * parseInt(offerInfo.rateInBaseUnit))
|
||||
let satsToMove = offerInfo.numTokens * parseInt(offerInfo.rateInBaseUnit)
|
||||
if (isNaN(satsToMove)) {
|
||||
throw new Error('Could not calculate the amount of BCH to generate counter offer')
|
||||
}
|
||||
@@ -385,7 +385,7 @@ class OfferUseCases {
|
||||
// Sell Offer
|
||||
|
||||
// Calculate the sats needed
|
||||
const satsNeeded = Math.ceil(offerEntity.numTokens * parseInt(offerEntity.rateInBaseUnit))
|
||||
const satsNeeded = offerEntity.numTokens * parseInt(offerEntity.rateInBaseUnit)
|
||||
if (isNaN(satsNeeded)) {
|
||||
throw new Error('Could not calculate sats needed!')
|
||||
}
|
||||
@@ -467,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 = Math.ceil(orderData.numTokens * parseInt(orderData.rateInBaseUnit))
|
||||
const satsToReceive = orderData.numTokens * parseInt(orderData.rateInBaseUnit)
|
||||
if (isNaN(satsToReceive)) {
|
||||
throw new Error('Could not calculate the amount of BCH offered in the Counter Offer')
|
||||
}
|
||||
@@ -579,8 +579,7 @@ class OfferUseCases {
|
||||
}
|
||||
|
||||
// If the Offer UTXO is spent, delete the Offer model.
|
||||
if (utxoStatus === false) {
|
||||
console.log('utxoStatus: ', utxoStatus)
|
||||
if (!utxoStatus) {
|
||||
console.log(`Spent UTXO detected. Deleting this Offer: ${JSON.stringify(thisOffer, null, 2)}`)
|
||||
await thisOffer.remove()
|
||||
}
|
||||
|
||||
+1
-45
@@ -10,8 +10,6 @@ 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)
|
||||
@@ -49,10 +47,6 @@ 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)
|
||||
@@ -241,8 +235,7 @@ class OrderLib {
|
||||
}
|
||||
|
||||
// If the Order UTXO is spent, delete the Order model.
|
||||
if (utxoStatus === false) {
|
||||
console.log('utxoStatus: ', utxoStatus)
|
||||
if (!utxoStatus) {
|
||||
console.log(`Spent UTXO detected. Deleting this Order: ${JSON.stringify(thisOrder, null, 2)}`)
|
||||
await thisOrder.remove()
|
||||
}
|
||||
@@ -252,43 +245,6 @@ 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
|
||||
|
||||
@@ -37,7 +37,6 @@ 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) {
|
||||
|
||||
Reference in New Issue
Block a user