kraken.com

Cast json that contains interface in properly struct

眉间皱痕 提交于 2020-01-06 05:36:14
问题 i'm unable to cast the following json in a struct in Golang, received from Kraken API: { "error": [], "result": { "LINKUSD": { "asks": [ ["2.049720", "183.556", 1576323009], ["2.049750", "555.125", 1576323009], ["2.049760", "393.580", 1576323008], ["2.049980", "206.514", 1576322995] ], "bids": [ ["2.043800", "20.691", 1576322350], ["2.039080", "755.396", 1576323007], ["2.036960", "214.621", 1576323006], ["2.036930", "700.792", 1576322987] ] } } } Using json-to-go , he gives me the following

How do I sign the body of a requests.Request in an Auth object's __call__ method?

让人想犯罪 __ 提交于 2019-12-25 00:24:04
问题 I'm trying to write a nice auth helper for kraken. I want it to be as automatic as possible, so it needs to: add a nonce ( time.time()*1000 ) to the POST body calculate a signature over the POST body put the signature into the headers I wrote the obvious code based on this answer: class KrakenAuth(AuthBase): """a requests-module-compatible auth module for kraken.com""" def __init__(self, key, secret): self.api_key = key self.secret_key = secret def __call__(self, request): #print("Auth got a

Deserialise a Kraken JSON in C#

坚强是说给别人听的谎言 提交于 2019-12-13 08:35:37
问题 I used to be loading data from Cryptocompare's API. This post got me what I wanted for Cryptocompare. Parsing Cryptocompare API Json data in C# However, I notice that this API is not bulletproof, it's not always returning an answer. So I want to use Kraken itself. Now I am trying to deserialise the new JSON but this is not straightforward as Cryptocompare's JSON. Here is an example JSON: https://api.kraken.com/0/public/OHLC?pair=ETHUSD&interval=30 {"error":[],"result":{"XETHZUSD":[[1519236000