标签: coinbase-api

GDAX api - 获取历史汇率返回不一致的结果

使用GDAX api使用以下内容调用历史价格时:

https://api.gdax.com/products/ETH-EUR/candles?start=2017-07-02T15:25:00.00000Z&end=2017-07-02T16:12:00.00000Z&granularity=30

我总是得到200代码响应,但有时它返回:

[]

和其他时间:

[[1499011890,234.98,235,234.98,235,7.582868079999999],[1499011830,234.4,235,234.4,235,17.7272481],[1499011680,233.71,233.71,233.71,233.71,1.61151688],[1499011650,233.71,233.71,233.71,233.71, 0.85362734],[1499011350,233.71,233.71,233.71,233.71,1.5],[1499011320,233.48,233.67,233.48,233.67,5.22588745],[1499011290,233.48,233.48,233.48,233.48,1.11358574],[1499011200,233.48, 233.48,233.48,233.48,1.70893649],[1499010990,233.44,233.47,233.44,233.47,8.34642375],[1499010270,230.11,233,231,233,9.30791793],[1499010240,231,231,231,231,10],[1499009850,233.02,233.02,233.02, 233.02,0.0000428],[1499009640,230.26,231.64,231.64,230.26,10.81225691],[1499009250,231,231.55,231.55,231,15],[1499009100,231,231.92,231.92,231,20]]

谁能解释这种行为?

如果是达到限制的情况,我期待"429太多请求",我很确定情况并非如此.

coinbase-api

6
推荐指数
1
解决办法
1233
查看次数

如何使用Python将FIX登录消息发送到GDAX/Coinbase

我正在尝试为fix.gdax.com建立一个FIX 4.2会话(docs:https://docs.gdax.com/#fix-api 或https://docs.prime.coinbase.com/?python#logon -a)使用Python 3.5和stunnel.除了我的登录消息之外,一切都正在工作,该消息被拒绝,服务器关闭会话而没有响应,因此很难调试出错的地方.我的Python代码如下:

s = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
s.connect(("127.0.0.1", 4197)) # address and port specified in stunnel config file

# generate a signature according to the gdax protocol for signing a message:
timestamp = str(time.time())
message   = [timestamp, "A", "0", "f3e85389ffb809650c367d42b37e0a80", "Coinbase", "password-goes-here"] # these are the components of the pre-hash string as specified in the docs for a logon message
message   = bytes("|".join(message), 'utf-8') # add the field separator

hmac_key  = base64.b64decode(r"api-secret-goes-here")
signature = …
Run Code Online (Sandbox Code Playgroud)

python fix-protocol coinbase-api gdax-api

6
推荐指数
1
解决办法
2338
查看次数

Coinbase 的官方 Python API 被标记为已弃用

Coinbase API 的官方文档指出coinbase作为官方Python 客户端。但是,当我在 github 上检查该库时,它被标记为“已弃用”。我还应该使用其他 Python 客户端吗?这是否存在我应该警惕的问题?

coinbase-api

6
推荐指数
0
解决办法
289
查看次数

python 中的 Coinbase APIerror(id = )

我想在我的 coinbase 账户之间转账。我正在存储我所有帐户的 ID client.get_accounts()['data']['id'],并使用该代码进行传输,

tx = client.transfer_money('2bbf394c-193b-5b2a-9155-3b4732659ede',
                       to='58542935-67b5-56e1-a3f9-42686e07fa40',
                       amount='1', currency= 'BTC)
Run Code Online (Sandbox Code Playgroud)

但是,我收到这个错误。coinbase.wallet.error.APIError: APIError(id=):

python coinbase-api

6
推荐指数
1
解决办法
370
查看次数

Coinbase API 对于有效的产品 ID 返回“未找到产品”

我目前正在使用沙箱 API,我可以查询产品,包括单独查询,但如果我尝试下购买订单,我得到的响应是{ message: 'Product not found' }.

这是我的代码:

async function cb_request( method, path, headers = {}, body = ''){

  var apiKey = 'xxxxxxxxxxxxxxxxxxxxxxxxxxx',
      apiSecret = 'xxxxxxxxxxxxxxxxxxxxxxxxxxx',
      apiPass = 'xxxxxxxxxxxxxxxxxxxxxxxxxxx';

  //get unix time in seconds
  var timestamp = Math.floor(Date.now() / 1000);

  // set the request message
  var message = timestamp + method + path + body;

  //create a hexedecimal encoded SHA256 signature of the message
  var key = Buffer.from(apiSecret, 'base64');
  var signature = crypto.createHmac('sha256', key).update(message).digest('base64');

  //create the request options …
Run Code Online (Sandbox Code Playgroud)

javascript rest post node.js coinbase-api

6
推荐指数
1
解决办法
2025
查看次数

存根 rspec and_raise 并添加消息

我正在编写需要测试代码中的救援的测试。

型号代码:

rescue Coinbase::Error => e
  #debugger
  if e == "You don't have that many bitcoins in your account to sell."
  ...
end
Run Code Online (Sandbox Code Playgroud)

R规格代码:

allow_any_instance_of(Order).to receive(:sell).and_raise(Coinbase::Error, "You don't have that many bitcoins in your account to sell.")
Run Code Online (Sandbox Code Playgroud)

e在我所做的地方添加调试器并查看控制台中的值,我明白了

#<Coinbase::UnauthorizedError: Coinbase::UnauthorizedError>

所以消息没有被传入。

在过去的 40 分钟里,我一直在谷歌上搜索这个问题,我发现的所有内容都只涉及发送错误类,而不是消息。据推测,在某些情况下,错误类别相同,但消息不同。

任何建议都会很棒。谢谢!

rspec ruby-on-rails coinbase-api

5
推荐指数
1
解决办法
1956
查看次数

如何通过Coinbase API获取交易费?

通过coinbase API发送交易之前如何获取交易费用?

或者如何通过coinbase API设置交易的交易费用?

cryptoapi bitcoin coinbase-api

5
推荐指数
1
解决办法
2071
查看次数

Coinbase API client.getAccount(...) 开始返回:“错误:无法获得本地发行者证书”

该问题于 2020 年 3 月 31 日太平洋时间上午晚些时候开始。向 Coinbase 发出 API 调用的服务器托管在带有 node.js (GCP) 的 Google App Engine 上。与 Coinbase 相同的证书连接问题也发生在几周前,并持续了大约一天。当时证书连接问题自行消失了。无论当时还是今天,都没有对调用 Coinbase API 的服务器进行任何代码更改。相同的代码已经运行了一年多,但几个月前被转移到 App 引擎。- Coinbase 是否进行了会影响对 Google Cloud Platform 的证书身份验证的网络更改?

google-app-engine node.js google-cloud-platform coinbase-api

5
推荐指数
1
解决办法
1423
查看次数

Coinbase Pro Sandbox:如何存入测试资金?

我想测试 API,因此需要在我的沙箱帐户上存钱。我如何存入假钱以进行测试?这听起来像是一个非常基本的问题,但我无法获得任何信息:(

不幸的是,GUI 不提供这种可能性。我也在 python 中尝试过,但这也不起作用。(见https://github.com/danpaquin/coinbasepro-python)

有没有人也遇到过这个问题?如何解决这个问题?

非常感谢您提前。最好的问候,约翰

sandbox coinbase-api

5
推荐指数
1
解决办法
2504
查看次数

使用 Coinbase API 从一种加密转换为另一种加密

我试图创建一个 python 程序来将 ETH 转换为 BTC。我正在使用命令:

client.transfer_money("ETH Account ID ", to="BTC Account ID", amount="0.1", currency=:"ETH")

Run Code Online (Sandbox Code Playgroud)

我使用以下命令获取了帐户 ID:

client.get_accounts()
Run Code Online (Sandbox Code Playgroud)

并将 ID 复制粘贴到我的传输命令上。但是我收到此错误:

~/opt/anaconda3/envs/Coinbase/lib/python3.8/site-packages/coinbase/wallet/client.py in transfer_money(self, account_id, **params)
    338     params['type'] = 'transfer'
    339     response = self._post('v2', 'accounts', account_id, 'transactions', data=params)
--> 340     return self._make_api_object(response, Transaction)
    341 
    342   def request_money(self, account_id, **params):

~/opt/anaconda3/envs/Coinbase/lib/python3.8/site-packages/coinbase/wallet/client.py in _make_api_object(self, response, model_type)
    143     # All valid responses have a "data" key.
    144     if data is None:
--> 145       raise build_api_error(response, blob)
    146     # Warn the user about each …
Run Code Online (Sandbox Code Playgroud)

bitcoin coinbase-api ethereum cryptocurrency

5
推荐指数
1
解决办法
2006
查看次数