How to get the balance by address?
Closed this issue · 2 comments
christopher-wilke commented
How do I get the balance by an address? I found an example with a SecretManager but I really just need the balance and I dont want to create a SecretManager
for this use case.
Balance for addresses were supported on V 1.3.0.
Thoralf-M commented
There isn't a clear definition for what the balance is with the new outputs and unlock conditions, but we have an example which gets the basic outputs with address unlock condition alone and returns the amount + native tokens:
iota.rs/client/examples/02_get_address_balance.rs
Lines 40 to 70 in 6f6b059
Other output types and outputs with other unlock conditions might be also part of what you understand under balance, so they would then need to be requested and processed also
christopher-wilke commented
Thanks @thibault-martinez, worked as expected.