format for latest standard

This commit is contained in:
Josh Harvey 2018-03-10 18:59:40 +00:00
parent 4108efd9c7
commit c2af183911
77 changed files with 1697 additions and 1693 deletions

View file

@ -37,10 +37,10 @@ function authRequest (config, path, data) {
const msg = [nonce, config.clientId, config.key].join('')
const signature = crypto
.createHmac('sha256', Buffer.from(config.secret))
.update(msg)
.digest('hex')
.toUpperCase()
.createHmac('sha256', Buffer.from(config.secret))
.update(msg)
.digest('hex')
.toUpperCase()
const signedData = _.merge(data, {
key: config.key,
@ -76,7 +76,7 @@ function request (path, method, data) {
if (data) options.data = querystring.stringify(data)
return axios(options)
.then(r => r.data)
.then(r => r.data)
}
module.exports = {

View file

@ -18,17 +18,17 @@ function fetch (account, method, params) {
url: `http://localhost:${account.port}`,
data
})
.then(r => {
if (r.error) throw r.error
return r.data.result
})
.catch(err => {
console.log(err.message)
try {
console.log(err.response.data.error)
} catch (__) {}
throw err
})
.then(r => {
if (r.error) throw r.error
return r.data.result
})
.catch(err => {
console.log(err.message)
try {
console.log(err.response.data.error)
} catch (__) {}
throw err
})
}
function split (str) {