joaopsilva / binance-java-api

binance-java-api is a lightweight Java library for the Binance API, supporting synchronous and asynchronous requests, as well as event streaming using WebSockets.
208 stars 803 forks source link

How to get account balance for my coins on binance ? #16

Closed theJaxon closed 5 years ago

theJaxon commented 5 years ago

I want to get the exact amount in my binance account, when i try the account.getBalances(); method it returns all the coins (The ones i own and the ones i don't), i want something more specific, how to get every coin i own with the total amount existing in my balance using this API ?

Eric-Musa commented 5 years ago

Iterate through and add the assets with non-zero "free" amounts to a different list.

theJaxon commented 5 years ago

Iterate through and add the assets with non-zero "free" amounts to a different list.

The problem with this approach is that it displays all the coins that i owned then sold, so for example you may have some ADA, you later sold all your ADA but on binance still there will be an amount left (0.0000023) for example, so it lists lots of coins that currently have no value in the account, the better approach is to enable something like that in the API itself.

Eric-Musa commented 5 years ago

for example you may have some ADA, you later sold all your ADA but on binance still there will be an amount left (0.0000023)

Do you mean that it's returning the tiny leftover amounts from previous "sell-all" trades? If so then I would suggest using the "convert to BNB" function on the binance app which turns any coins worth less than a certain BTC value into BNB. Otherwise I'm not sure I understand your issue

theJaxon commented 5 years ago

I would suggest using the "convert to BNB" function on the binance app which turns any coins worth less than a certain BTC value into BNB.

I will give it a try, i've never heard of the "convert dust to BNB" but now i know, thanks.

Eric-Musa commented 5 years ago

No problemo, best of luck