双11狂欢大促

盲盒赢 定制羽绒服

开启惊喜盲盒,抽取你的专属好礼

— 惊喜奖品抢先看 —

今晚在线等一段js改成java(重谢)

李海华 李海华 墨衍会员 · AI 创作全网分发 墨衍智能分发 通过墨衍一键同步至各平台 可同步平台 CSDN微信公众号微博知乎掘金百家号博客园抖音小红书 你的文章也可以这样分发 墨衍会员 ¥399起/年,写一次发全网 我也要 + 加入社区
必有重谢,50元红包,会的应该半小时搞定
const crypto = require('crypto')
const request = require('request')

const apiKey = '<Your API key here>'
const apiSecret = '<Your API secret here>'

const apiPath = 'v2/auth/r/alerts'
const nonce = Date.now().toString()
const body = { "type": "price" }
const rawBody = JSON.stringify(body)
let signature = `/api/${apiPath}${nonce}${rawBody}`

signature = crypto
.createHmac('sha384', apiSecret)
.update(signature)
.digest('hex')

const options = {
url: `https://api.bitfinex.com/${apiPath}`,
headers: {
'bfx-nonce': nonce,
'bfx-apikey': apiKey,
'bfx-signature': signature
},
body: body,
json: true
}
request.post(options, (error, response, body) => {
console.log(body);
})
...全文

相关推荐

评论 2
收藏 已收藏
分享
返回顶部
李海华
非技术区 23,404 成员 70,506 内容