krijnsent / crypto_vba

An Excel/VBA project to communicate with various cryptocurrency exchanges APIs
MIT License
157 stars 54 forks source link

CoinbasePro /fills #62

Closed Johnnybald closed 3 years ago

Johnnybald commented 3 years ago

Hi Developer,

first of all, thank you for the great work. So far it helped me a lot! I managed to connect to BinanceAPI and with some twerks also KrakenAPI.

Right now I am stuck with the coinbase pro API.

Retrieving /accounts works but if i want to GET /fills i always retrieving "invalid signatur"

{"error_nr":401,"error_txt":"HTTP-Unauthorized","response_txt":{"message":"invalid signature"}}

It seems like if i add params to the body, there is some issues with the header "CB-ACCESS-SIGN".

My key, secret and passphrase are correct and does have the right rights.

What I am doing wrong?

Code:

Dim apiKey As String Dim secretKey As String Dim passphrase As String

apiKey = x" secretKey = "y" passphrase = "z"

Dim Cred As New Dictionary Cred.Add "apiKey", apiKey Cred.Add "secretKey", secretKey Cred.Add "Passphrase", passphrase

Dim Paramscoin As New Dictionary Paramscoin.Add "product_id", "ETH-USDC"

Testresult = PrivateCoinbasePro("fills", "GET", Cred, Paramscoin)

Set JsonResult = JsonConverter.ParseJson(Testresult)

....

The SignMsg results in = 1603538001GET/fills{"product_id":"ETH-USDC"}

Best regards and thanks in advance

krijnsent commented 3 years ago

Sorry for the delay. Can you test again, I just pushed an update with the fills as test (which passes for me)? Thanks