【发布时间】:2021-07-27 00:46:14
【问题描述】:
我正在使用以下 coinbase pro api 发出销售请求
const sellParams = {"side":"sell","product_id":"DOGE-USD","type":"market","size":"135.5200"}
try{
sellResp = await authedClient.placeOrder(sellParams)
functions.logger.log("Sold today at:", sellResp)
}catch(err)
它如何失败并出现如下错误,我没有得到这个,因为我的单位比那个大。
Failed with error: { Error: HTTP 400 Error: size is too accurate. Smallest unit is 0.10000000
at Request._callback (/workspace/node_modules/coinbase-pro/lib/clients/public.js:68:15)
at Request.self.callback (/workspace/node_modules/request/request.js:185:22)
at Request.emit (events.js:198:13)
at Request.EventEmitter.emit (domain.js:466:23)
at Request.<anonymous> (/workspace/node_modules/request/request.js:1154:10)
at Request.emit (events.js:198:13)
at Request.EventEmitter.emit (domain.js:466:23)
at IncomingMessage.<anonymous> (/workspace/node_modules/request/request.js:1076:12)
at Object.onceWrapper (events.js:286:20)
at IncomingMessage.emit (events.js:203:15)
【问题讨论】:
-
0.02 看起来小于 0.1。
-
是的,错误是告诉您可以执行 135.5 或 135.6,但不能执行 135.52
标签: node.js typescript coinbase-api