-
Notifications
You must be signed in to change notification settings - Fork 125
In get_account_data() and get_input(), it is giving balance 0 #212
Comments
Hi @rav1112 my first thought is that, for some reason (possibly because of a snapshot), the 0th address from that seed doesn't have any transactions on the Tangle (see https://iota.stackexchange.com/a/735/283 for more information). Try calling |
I tried for api.find_transactions i got this ----- {'hashes': [], 'duration': 45} It doesnt have any transaction. Actually I have made private tangle. |
Gotcha. That may be why If the address at index 0 doesn't have any transactions, then PyOTA assumes that the seed has a zero balance. A workaround for this is to specify the gad_result = api.get_account_data(start=2, security_level=<security level>) |
But I have balance in the index 0 itself... |
Gotcha. In that case, try calling For example, to load data for addresses 0-2, call gad_result = api.get_account_data(start=0, stop=3, security_level=<security level>) Note that |
Hey @rav1112 it's been a little while; I'm going to go ahead and close this issue. If you are still having problems with this, feel free to re-open this issue so that we can have a look 😺 |
Even trying for the |
Hmm. Ok, I'm leaning pretty heavily towards the "addresses have no transactions" hypothesis.
Does |
Yes i got non zero value by giving this command |
Cool. Once the addresses have transactions, I think in this scenario, it may be useful for the application to maintain state — persisting the list of addresses rather than relying on a tangle scan each time. Then the app can call As a bonus, maintaining state should boost performance significantly when reloading data for known addresses, as a single call to |
I understand your point. But address to have transaction i need to send the tokens but i am not able to send it as it is coming threshold value is not matching like this (iota.adapter.BadApiResponse: Accumulated balance 0 is less than threshold 10 ( |
Ah, sorry; I used the term "transaction" ambiguously here. On the Tangle, a transaction does not have to transfer IOTAs; it is allowed to send a transaction with If an application sends a transaction with So for example, if you have addresses A, B and C that you want to check with api.send_transfer([
ProposedTransaction(Address("A"), 0),
ProposedTransaction(Address("B"), 0),
ProposedTransaction(Address("C"), 0),
]) Note that the above code will work using any seed, even one that doesn't own any IOTAs. Once the transactions are published, This is, incidentally, what the "ATTACH TO TANGLE" button in the old IOTA wallet used to do. |
Thanks |
No worries! I will go ahead and close this issue; if this issue resurfaces, feel free to reopen 😺 |
While calling get_account_data() and get_input(), both gives balance zero. But when i am calling individual address get_balance, then there is balance in it.
The text was updated successfully, but these errors were encountered: