卖出指定 "total" 而不是 "amount" 参数
Sell specifying the "total" instead of the "amount" parameter
根据 "Place sell order" documentation,您可以使用 amount
作为参数,或者 total
:
amount string Required Sell amount
total string Optional Sell amount with fees (alternative to amount)
使用Ruby客户端,我打了一个电话
client.sell(account.id,{
"total" => some_value,
"currency" => "ETH",
"payment_method" => fiat_payment_method_id
});
将一些 ETH 卖回美元。我收到以下错误消息
.../lib/coinbase/wallet/api_client.rb:402:in `block in sell': Missing parameter: amount (Coinbase::Wallet::APIError)
我是不是误读了文档?我是否需要同时指定帐户和总计,服务器是否会使用总计而忽略金额?
或者文档有误?
没有意识到错误是由 Ruby 代码抛出的,而不是由 Coinbase 服务器抛出的。
看起来代码强制存在 amount 参数。
提交 pull request 以解决此问题。使用我自己的 gem 本地修改版本进行测试表明,使用 "total" 而不是 "amount" 时服务器工作正常。
根据 "Place sell order" documentation,您可以使用 amount
作为参数,或者 total
:
amount string Required Sell amount
total string Optional Sell amount with fees (alternative to amount)
使用Ruby客户端,我打了一个电话
client.sell(account.id,{
"total" => some_value,
"currency" => "ETH",
"payment_method" => fiat_payment_method_id
});
将一些 ETH 卖回美元。我收到以下错误消息
.../lib/coinbase/wallet/api_client.rb:402:in `block in sell': Missing parameter: amount (Coinbase::Wallet::APIError)
我是不是误读了文档?我是否需要同时指定帐户和总计,服务器是否会使用总计而忽略金额?
或者文档有误?
没有意识到错误是由 Ruby 代码抛出的,而不是由 Coinbase 服务器抛出的。 看起来代码强制存在 amount 参数。
提交 pull request 以解决此问题。使用我自己的 gem 本地修改版本进行测试表明,使用 "total" 而不是 "amount" 时服务器工作正常。