format for latest standard
This commit is contained in:
parent
4108efd9c7
commit
c2af183911
77 changed files with 1697 additions and 1693 deletions
|
|
@ -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 = {
|
||||
|
|
|
|||
|
|
@ -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) {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue