public interface AccountStore
| Modifier and Type | Method and Description |
|---|---|
void |
addDepositAddress(String id,
int index,
StoredDepositAddress address)
Stores the deposit address under the given account with the used key index.
|
void |
addPendingTransfer(String id,
Hash tailTx,
Trytes[] bundleTrytes,
int... indices)
Stores the pending transfer under the given account with the origin tail tx hash as a key and
removes all deposit addresses which correspond to the used key indices for the transfer.
|
void |
addTailHash(String id,
Hash tailHash,
Hash newTailTxHash)
Adds the given new tail transaction hash (presumably from a reattachment) under the given pending transfer
indexed by the given origin tail transaction hash.
|
ExportedAccountState |
exportAccount(String id)
Axports the given account from the store.
|
Map<Integer,StoredDepositAddress> |
getDepositAddresses(String id)
Loads the stored deposit addresses of the given account.
|
Map<String,PendingTransfer> |
getPendingTransfers(String id)
Returns all pending transfers of the given account.
|
void |
importAccount(ExportedAccountState state)
Imports the given account state into the store.
|
AccountState |
loadAccount(String id)
Loads an existing or allocates a new account state from/in the database and returns the state.
|
int |
readIndex(String id)
Reads and returns the last used key index.
|
void |
removeAccount(String id)
Removes the accoutn state linekd to this account.
|
void |
removeDepositAddress(String id,
int index)
Removes the deposit address with the given key index under the given account.
|
void |
removePendingTransfer(String id,
Hash tailHash)
Removes the pending transfer with the given origin tail transaction hash from the given account.
|
void |
saveAccount(String id,
AccountState state)
Saves this specific account state to the store, regardless of what was stored.
|
void |
writeIndex(String id,
int index)
Stores the given index as the last used key index for the given account.
|
AccountState loadAccount(String id)
id - The account we are loading or creatingvoid saveAccount(String id, AccountState state)
id - The id of the account we are storingstate - The state we are storing for the accountvoid removeAccount(String id)
id - The id of the accountint readIndex(String id)
id - The id of the account we check forvoid writeIndex(String id, int index)
id - The id of the accountindex - The new index of this accountvoid addDepositAddress(String id, int index, StoredDepositAddress address)
id - The id of the accountindex - The index used for this addressaddress - The deposit address we are addingvoid removeDepositAddress(String id, int index)
id - The id of the accountindex - The index of the deposit we are removingMap<Integer,StoredDepositAddress> getDepositAddresses(String id)
id - The id of the accountvoid addPendingTransfer(String id, Hash tailTx, Trytes[] bundleTrytes, int... indices)
id - The id of the accounttailTx - The tail tx of this transferbundleTrytes - The trytes/essense of this transferindices - indexes to remove for this transfer, currently unused since we remove when we ask for inputsvoid removePendingTransfer(String id, Hash tailHash)
id - The id of the accounttailHash - The tail tx of the transfer we are remivingvoid addTailHash(String id, Hash tailHash, Hash newTailTxHash)
id - The id of the accounttailHash - The tail tx of the initial transfernewTailTxHash - The tail tx of the newly added transferMap<String,PendingTransfer> getPendingTransfers(String id)
id - The id of the accountvoid importAccount(ExportedAccountState state)
state - The state of the account we are storingExportedAccountState exportAccount(String id)
id - The id of the account we want to exportCopyright © 2019. All rights reserved.