crypto_vba icon indicating copy to clipboard operation
crypto_vba copied to clipboard

How to Get Binance Withdraw History?

Open birth23 opened this issue 3 years ago • 3 comments

I am trying to get the withdraw history. So I modified the TradeAPISite on the Binance module to GET /sapi/v1/capital/withdraw/history I also tried /wapi/v3/withdrawHistory.html but I get illegal characters error. Do you know how to do this?

birth23 avatar Jun 08 '21 12:06 birth23

Hi there, I found some time to create an update. Could you check the Binance code? I added an example for your question. If that works, please do close this issue. Koen

krijnsent avatar Jun 29 '21 12:06 krijnsent

I tried the following on the Binance sheet and the result is an error: response_txt -1100 Illegal characters found in a parameter.

Sub GetMyBinanceData2()

Dim JsonResponse As String
Dim Json As Object
Dim JsonRes As Dictionary
Dim Apikey As String
Dim secretKey As String

Set Sht = Worksheets("Binance")
Set Tbl4 = Sht.ListObjects("Tbl_Binance_Balances")
Apikey = Sht.Range("apikey_binance").Value
secretKey = Sht.Range("secretkey_binance").Value
Dim Cred As New Dictionary
Cred.Add "apiKey", Apikey
Cred.Add "secretKey", secretKey

Dim Params As New Dictionary
Params.Add "timestamp", GetBinanceTime()
JsonResponse = PrivateBinance("sapi/v1/capital/withdraw/history", "GET", Cred, Params)

Set Json = JsonConverter.ParseJson(JsonResponse)
ResArr = JsonToArray(Json)
Tbl = ArrayTable(ResArr, False)

If Tbl4.DataBodyRange.Rows.Count > 1 Then
    Tbl4.DataBodyRange.Offset(1, 0).Resize(Tbl4.DataBodyRange.Rows.Count - 1, Tbl4.DataBodyRange.Columns.Count).Rows.Delete
End If
Tbl4.DataBodyRange.Resize(UBound(Tbl, 2), UBound(Tbl, 1)) = TransposeArr(Tbl)

End Sub

birth23 avatar Jun 30 '21 11:06 birth23

Your code does work on my computer with my credentials. The error message suggests that either your credentials are wrong or the timestamp has some weird outcome. So on the line JsonResponse = .... go step by step through the code and see what gets added to the GET request.

krijnsent avatar Jun 30 '21 13:06 krijnsent