cashaccounts
Advanced tools
Comparing version 0.3.2 to 0.3.3
94
index.js
@@ -43,11 +43,13 @@ const EmojiList = require('./emoji_names.json'); | ||
async performTrustedSearch(url) { | ||
const data = await axios | ||
.get(url) | ||
.then(x => { | ||
return x.data; | ||
}) | ||
.catch(err => { | ||
console.log('error in performTrustedSearch', ' url', url, err.response); | ||
}); | ||
const data = await axios.get(url).then(x => { | ||
if (x.data === undefined) { | ||
throw new Error('error in search'); | ||
} | ||
return x.data; | ||
}); | ||
// .catch(err => { | ||
// console.log('error in performTrustedSearch', ' url', url, err.response); | ||
// }); | ||
return data; | ||
@@ -77,11 +79,13 @@ } | ||
const resp = await axios | ||
.post(url, data) | ||
.then(x => { | ||
return x.data; | ||
}) | ||
.catch(err => { | ||
console.log('error in trustedRegistration', err); | ||
}); | ||
const resp = await axios.post(url, data).then(x => { | ||
if (x.data === undefined) { | ||
throw new Error('error with registration'); | ||
} | ||
return x.data; | ||
}); | ||
// .catch(err => { | ||
// console.log('error in trustedRegistration', err); | ||
// }); | ||
return resp; | ||
@@ -145,11 +149,13 @@ } | ||
const data = await axios | ||
.get(url) | ||
.then(x => { | ||
return x.data; | ||
}) | ||
.catch(err => { | ||
console.log('error in getAddressByCashAccount', err.response); | ||
}); | ||
const data = await axios.get(url).then(x => { | ||
if (x.data === undefined) { | ||
throw new Error('error with lookup'); | ||
} | ||
return x.data; | ||
}); | ||
// .catch(err => { | ||
// console.log('error in getAddressByCashAccount', err.response); | ||
// }); | ||
return data; | ||
@@ -447,8 +453,11 @@ } | ||
const urlString = this.bufferString(query); | ||
const response = await axios | ||
.get(`https://bitdb.bch.sx/q/${urlString}`) | ||
.catch(e => { | ||
console.error('err in getNumberofTxs', e); | ||
}); | ||
const response = await axios.get(`https://bitdb.bch.sx/q/${urlString}`); | ||
if (response.data === undefined) { | ||
throw new Error('error bitdb lookup'); | ||
} | ||
// .catch(e => { | ||
// console.error('err in getNumberofTxs', e); | ||
// }); | ||
return response.data; | ||
@@ -479,7 +488,11 @@ } | ||
const urlString = this.bufferString(query); | ||
const response = await axios | ||
.get(`https://bitdb.bch.sx/q/${urlString}`) | ||
.catch(e => { | ||
console.error('err in getNumberofTxs', e); | ||
}); | ||
const response = await axios.get(`https://bitdb.bch.sx/q/${urlString}`); | ||
if (response.data === undefined) { | ||
throw new Error('error with account lookup'); | ||
} | ||
// .catch(e => { | ||
// console.error('err in getNumberofTxs', e); | ||
// }); | ||
return response.data.c[0]; | ||
@@ -510,8 +523,11 @@ } | ||
const urlString = this.bufferString(query); | ||
const response = await axios | ||
.get(`https://bitdb.bch.sx/q/${urlString}`) | ||
.catch(e => { | ||
console.error('err in getNumberofTxs', e); | ||
}); | ||
const response = await axios.get(`https://bitdb.bch.sx/q/${urlString}`); | ||
if (response.data === undefined) { | ||
throw new Error('error with registration lookup'); | ||
} | ||
// .catch(e => { | ||
// console.error('err in getNumberofTxs', e); | ||
// }); | ||
return response.data.u[0]; | ||
@@ -518,0 +534,0 @@ } |
{ | ||
"name": "cashaccounts", | ||
"version": "0.3.2", | ||
"version": "0.3.3", | ||
"description": "decentralized identity system for bitcoin cash by Jonathan Silverblood", | ||
@@ -5,0 +5,0 @@ "main": "index.js", |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
28232
827