public class AccountBalanceCache extends Object
| Constructor and Description |
|---|
AccountBalanceCache(AddressGeneratorService addressGenerator,
AccountState state,
IotaAPI api) |
| Modifier and Type | Method and Description |
|---|---|
void |
addBalance(Input input,
DepositRequest depositRequest) |
Input |
first() |
Map.Entry<Input,DepositRequest> |
getByAddress(Address address) |
Map.Entry<Input,DepositRequest> |
getByHash(Hash hash) |
Map.Entry<Input,DepositRequest> |
getByHash(String hash) |
Map.Entry<Input,DepositRequest> |
getByIndex(int index) |
Stream<Map.Entry<Input,DepositRequest>> |
getStream() |
long |
getTotalBalance()
Based on CDA amount defined
TODO: if CDA amount = 0, add input amount
|
void |
recalcluate(IotaAPI api)
Calculates the balance currently available using the stored deposits.
|
void |
removeInput(Input input) |
public AccountBalanceCache(AddressGeneratorService addressGenerator, AccountState state, IotaAPI api)
public void recalcluate(IotaAPI api)
addBalance(Input, DepositRequest), but not stored will be discarded.api - public Map.Entry<Input,DepositRequest> getByAddress(Address address)
public Map.Entry<Input,DepositRequest> getByHash(Hash hash)
public Map.Entry<Input,DepositRequest> getByHash(String hash)
public Map.Entry<Input,DepositRequest> getByIndex(int index)
public Input first()
public Stream<Map.Entry<Input,DepositRequest>> getStream()
public void addBalance(Input input, DepositRequest depositRequest)
public long getTotalBalance()
public void removeInput(Input input)
Copyright © 2019. All rights reserved.