这是我的路线:
router.post('/withdraw', async (req, res, next) => {
const {code, address, amount, otpToken, currency } = req.body;
const exchange = await new ccxt.bitmex();
exchange.apiKey = "MY - KEY";
exchange.secret = "MY - SECRET";
await exchange.withdraw (code, amount, address, tag = undefined, params = {}, otpToken)
.then((response) => console.log(res))
.catch(ex => console.log(ex))
});
这就是我要发布的内容:
{
"address": "THE ADRESS",
"amount": 0.0022,
"code": "BTC",
"otpToken": "MY TOKEN"
}
执行此路线时,出现此错误:
BadRequest: bitmex {"error":{"message":"amount is invalid","name":"HTTPError"}}
密钥和机密均确定。 otpToken也是。我什么都可以拿 我对此很陌生,我无法弄清楚代码中的错误在哪里。
谢谢!
答案 0 :(得分:1)
ccxt团队回答了我的问题。这是对我有用的答案:
我认为BitMEX要求以satoshis(整数,而不是 浮点十进制)。因此,代替“数量”:0.0022应该是 “数量”:220000。
答案 1 :(得分:1)
BitMEX要求提取金额为聪(整数值220000
而不是浮点值0.0022
)。
在GitHub上的以下问题中回答了此问题: