krijnsent / crypto_vba

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

Binance giving generic authentication errors on anything relating to test orders #65

Closed binancetester closed 3 years ago

binancetester commented 3 years ago

Hello, Great job with this. The VBA code, "Test a test order" and "Delete a non-existing order" both come back with {"error_nr":401,"error_txt":"HTTP-Unauthorized","response_txt":{"code":-2015,"msg":"Invalid API-key, IP, or permissions for action."}}.

Is this because, despite it being a test order, the account is yet to be verified?
Thanks heaps!!

krijnsent commented 3 years ago

Hi there, that does sound like you didn't set the trade permission on your API-key. So please do check your API-key at the Binance site and check that the trade checkbox is checked. Does that do the trick? Koen

Rayzola commented 3 years ago

Hi krijnsent.

It would be great if you could also add a comment line in Function PublicBinance() and PrivateBinance() to show a sample parameters to call that function properly. For example to see the current positions in the portfolio. Thank you

updates: TestResult = PrivateBinance("account", "GET", Cred, Params2) only return part of the portfolio position as follow: "{"makerCommission":10,"takerCommission":10,"buyerCommission":0,"sellerCommission":0,"canTrade":true,"canWithdraw":true,"canDeposit":true,"updateTime":1613356490895,"accountType":"SPOT","balances":[{"asset":"BTC","free":"0.01203670","locked":"0.000000

Please help when free. Thank you

krijnsent commented 3 years ago

For samples: please see the Test Sub that is at the top of the Binance module, it has quite some examples. Secondly: check out the excel file in this repository, it provides some examples too and also how to get it to a spreadsheet. If you want case specific examples or code, that's not the purpose of this repository, sorry.

anarkiz commented 3 years ago

Rayzola, if I understand what you want, use this easy solution to get a specific data like your BNB total in spot: Total_BNB = Mid(ResulFromExchange, InStr(ResulFromExchange, "BNB") + 13, 10) The function gives you all the data sent by the exchange, we have to code our solution to get specific information.