这是我的路线:
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 也是。我可以拿走所有东西。我对此很陌生,我无法弄清楚我的代码错误在哪里。
谢谢!!