Compare commits

..
5 Commits
Author SHA1 Message Date
Chris Troutner 9a9f1427fd Merge pull request #14 from Permissionless-Software-Foundation/ct-unstable
fix(bch-js): Updating to v5
2022-01-18 15:43:56 -08:00
Chris Troutner 5c9539373c Merge branch 'master' into ct-unstable 2022-01-18 15:41:08 -08:00
Chris Troutner 79484f706d fix(bch-js): Updating to v5 2022-01-18 15:40:21 -08:00
Chris Troutner 6f6b5874d9 Merge pull request #13 from Permissionless-Software-Foundation/ct-unstable
fix(cors): slight tweak to avoid CORS error
2022-01-12 14:50:28 -08:00
Chris Troutner d0ef1a8669 fix(cors): slight tweak to avoid CORS error 2022-01-12 14:48:33 -08:00
4 changed files with 52 additions and 29 deletions
+4 -4
View File
@@ -68,6 +68,10 @@ class Server {
app.use(passport.initialize())
app.use(passport.session())
// Enable CORS for testing
// THIS IS A SECURITY RISK. COMMENT OUT FOR PRODUCTION
app.use(cors({ origin: '*' }))
// Attach REST API and JSON RPC controllers to the app.
const Controllers = require('../src/controllers')
const controllers = new Controllers()
@@ -75,10 +79,6 @@ class Server {
app.controllers = controllers
// Enable CORS for testing
// THIS IS A SECURITY RISK. COMMENT OUT FOR PRODUCTION
app.use(cors({ origin: '*' }))
// MIDDLEWARE END
console.log(`Running server in environment: ${config.env}`)
+41 -22
View File
@@ -9,8 +9,8 @@
"version": "1.0.0",
"license": "MIT",
"dependencies": {
"@psf/bch-js": "4.20.28",
"axios": "0.21.1",
"@psf/bch-js": "5.2.0",
"axios": "0.25.0",
"bcryptjs": "2.4.3",
"glob": "7.1.6",
"ipfs": "0.60.0",
@@ -2231,9 +2231,9 @@
"license": "BSD-3-Clause"
},
"node_modules/@psf/bch-js": {
"version": "4.20.28",
"resolved": "http://94.130.170.209:4873/@psf%2fbch-js/-/bch-js-4.20.28.tgz",
"integrity": "sha512-tlWfYTUnmAzrFZDHTuP2CccE6fp20j4XcCIJiJYlpaKzxB0ilH8CEVWBQaMY+Fb+eaTrlSdiaDC5MBWV4klpQg==",
"version": "5.2.0",
"resolved": "http://94.130.170.209:4873/@psf%2fbch-js/-/bch-js-5.2.0.tgz",
"integrity": "sha512-1QbKrdtww+nISvuwKe9X8/9GrqZWswjn0AChm0+UqobEV6WqGUXbsYL7621nvUaWzHz040evgOAiM6VaTtfNhg==",
"license": "MIT",
"dependencies": {
"@chris.troutner/bip32-utils": "1.0.5",
@@ -3611,12 +3611,12 @@
"license": "MIT"
},
"node_modules/axios": {
"version": "0.21.1",
"resolved": "http://94.130.170.209:4873/axios/-/axios-0.21.1.tgz",
"integrity": "sha512-dKQiRHxGD9PPRIUNIWvZhPTPpl1rf/OxTYKsqKUDjBwYylTvV7SjSHJb9ratfyzM6wCdLCOYLzs73qpg5c4iGA==",
"version": "0.25.0",
"resolved": "http://94.130.170.209:4873/axios/-/axios-0.25.0.tgz",
"integrity": "sha512-cD8FOb0tRH3uuEe6+evtAbgJtfxr7ly3fQjYcMcuPlgkwVS9xboaVIpcDV+cYQe+yGykgwZCs1pzjntcGa6l5g==",
"license": "MIT",
"dependencies": {
"follow-redirects": "^1.10.0"
"follow-redirects": "^1.14.7"
}
},
"node_modules/backo2": {
@@ -7577,9 +7577,9 @@
"license": "MIT"
},
"node_modules/follow-redirects": {
"version": "1.14.6",
"resolved": "http://94.130.170.209:4873/follow-redirects/-/follow-redirects-1.14.6.tgz",
"integrity": "sha512-fhUl5EwSJbbl8AR+uYL2KQDxLkdSjZGR36xy46AO7cOMTrCMON6Sa28FmAnC2tRTDbd/Uuzz3aJBv7EBN7JH8A==",
"version": "1.14.7",
"resolved": "http://94.130.170.209:4873/follow-redirects/-/follow-redirects-1.14.7.tgz",
"integrity": "sha512-+hbxoLbFMbRKDwohX8GkTataGqO6Jb7jGwpAlwgy2bIz25XtRm7KEzJM76R1WiNT5SwZkX4Y75SwBolkpmE7iQ==",
"funding": [
{
"type": "individual",
@@ -12099,6 +12099,15 @@
"axios": "^0.21.1"
}
},
"node_modules/jwt-bch-lib/node_modules/axios": {
"version": "0.21.4",
"resolved": "http://94.130.170.209:4873/axios/-/axios-0.21.4.tgz",
"integrity": "sha512-ut5vewkiu8jjGBdqpM44XxjuCjq9LAKeHVmoVfHVzy8eHgxxq8SbAVQNovDA8mVi05kP0Ea/n/UzcSHcTJQfNg==",
"license": "MIT",
"dependencies": {
"follow-redirects": "^1.14.0"
}
},
"node_modules/k-bucket": {
"version": "5.1.0",
"resolved": "http://94.130.170.209:4873/k-bucket/-/k-bucket-5.1.0.tgz",
@@ -27380,9 +27389,9 @@
"integrity": "sha1-p3c2C1s5oaLlEG+OhY8v0tBgxXA="
},
"@psf/bch-js": {
"version": "4.20.28",
"resolved": "http://94.130.170.209:4873/@psf%2fbch-js/-/bch-js-4.20.28.tgz",
"integrity": "sha512-tlWfYTUnmAzrFZDHTuP2CccE6fp20j4XcCIJiJYlpaKzxB0ilH8CEVWBQaMY+Fb+eaTrlSdiaDC5MBWV4klpQg==",
"version": "5.2.0",
"resolved": "http://94.130.170.209:4873/@psf%2fbch-js/-/bch-js-5.2.0.tgz",
"integrity": "sha512-1QbKrdtww+nISvuwKe9X8/9GrqZWswjn0AChm0+UqobEV6WqGUXbsYL7621nvUaWzHz040evgOAiM6VaTtfNhg==",
"requires": {
"@chris.troutner/bip32-utils": "1.0.5",
"@psf/bip21": "2.0.1",
@@ -28446,11 +28455,11 @@
"integrity": "sha512-xh1Rl34h6Fi1DC2WWKfxUTVqRsNnr6LsKz2+hfwDxQJWmrx8+c7ylaqBMcHfl1U1r2dsifOvKX3LQuLNZ+XSvA=="
},
"axios": {
"version": "0.21.1",
"resolved": "http://94.130.170.209:4873/axios/-/axios-0.21.1.tgz",
"integrity": "sha512-dKQiRHxGD9PPRIUNIWvZhPTPpl1rf/OxTYKsqKUDjBwYylTvV7SjSHJb9ratfyzM6wCdLCOYLzs73qpg5c4iGA==",
"version": "0.25.0",
"resolved": "http://94.130.170.209:4873/axios/-/axios-0.25.0.tgz",
"integrity": "sha512-cD8FOb0tRH3uuEe6+evtAbgJtfxr7ly3fQjYcMcuPlgkwVS9xboaVIpcDV+cYQe+yGykgwZCs1pzjntcGa6l5g==",
"requires": {
"follow-redirects": "^1.10.0"
"follow-redirects": "^1.14.7"
}
},
"backo2": {
@@ -31387,9 +31396,9 @@
"integrity": "sha1-kV4tbQI8Q9UiStn20qPEFW9XEvU="
},
"follow-redirects": {
"version": "1.14.6",
"resolved": "http://94.130.170.209:4873/follow-redirects/-/follow-redirects-1.14.6.tgz",
"integrity": "sha512-fhUl5EwSJbbl8AR+uYL2KQDxLkdSjZGR36xy46AO7cOMTrCMON6Sa28FmAnC2tRTDbd/Uuzz3aJBv7EBN7JH8A=="
"version": "1.14.7",
"resolved": "http://94.130.170.209:4873/follow-redirects/-/follow-redirects-1.14.7.tgz",
"integrity": "sha512-+hbxoLbFMbRKDwohX8GkTataGqO6Jb7jGwpAlwgy2bIz25XtRm7KEzJM76R1WiNT5SwZkX4Y75SwBolkpmE7iQ=="
},
"for-each": {
"version": "0.3.3",
@@ -34719,6 +34728,16 @@
"integrity": "sha512-CZs3jUHJlWvConvoTeLDogDEwUysKeojYJxfUhbwJKJrtDCSfi3ZWbsZZ8WN30Xs28aZPDB+qlHPJlTXQmup0w==",
"requires": {
"axios": "^0.21.1"
},
"dependencies": {
"axios": {
"version": "0.21.4",
"resolved": "http://94.130.170.209:4873/axios/-/axios-0.21.4.tgz",
"integrity": "sha512-ut5vewkiu8jjGBdqpM44XxjuCjq9LAKeHVmoVfHVzy8eHgxxq8SbAVQNovDA8mVi05kP0Ea/n/UzcSHcTJQfNg==",
"requires": {
"follow-redirects": "^1.14.0"
}
}
}
},
"k-bucket": {
+2 -2
View File
@@ -23,8 +23,8 @@
},
"repository": "Permissionless-Software-Foundation/ipfs-bch-wallet-consumer",
"dependencies": {
"@psf/bch-js": "4.20.28",
"axios": "0.21.1",
"@psf/bch-js": "5.2.0",
"axios": "0.25.0",
"bcryptjs": "2.4.3",
"glob": "7.1.6",
"ipfs": "0.60.0",
+5 -1
View File
@@ -198,8 +198,9 @@ class BchAdapter {
// Wait for data to come back from the wallet service.
const data = await this.waitForRPCResponse(rpcId)
// console.log(`data: ${JSON.stringify(data, null, 2)}`)
return data[0]
return data
} catch (err) {
// console.log('createUser() error: ', err)
wlogger.error('Error in use-cases/bch.js/getUtxos()')
@@ -400,6 +401,9 @@ class BchAdapter {
dataFound = true
// console.log('data was found in the queue')
// console.log(
// `rawData.payload: ${JSON.stringify(rawData.payload, null, 2)}`
// )
data = rawData.payload.result.value
// Remove the data from the queue