1-Inputs.Ledgermodule Addr = Location.Addrmodule Path : Merkle_path.S with type hash := Hash.tmodule Location = Locationinclude Syncable_intf.S
with type root_hash := Hash.t
and type hash := Hash.t
and type account := Account.t
and type addr := Addr.t
and type path = Path.t
and type t := ttype path = Path.tval depth : t -> intval num_accounts : t -> intGet all of the accounts that are in a subtree of the underlying Merkle tree rooted at `address`. The accounts are ordered by their addresses.
val make_space_for : t -> int -> unitfold over accounts in the ledger, passing the Merkle address
val foldi_with_ignored_accounts :
t ->
Account_id.Set.t ->
init:'accum ->
f:( Addr.t -> 'accum -> Account.t -> 'accum ) ->
'accumthe set of account_ids are ledger elements to skip during the fold, because they're in a mask
val fold_until :
t ->
init:'accum ->
f:( 'accum -> Account.t -> ( 'accum, 'stop ) Base.Continue_or_stop.t ) ->
finish:( 'accum -> 'stop ) ->
'stopfold over accounts until stop condition reached when calling f; calls finish for result
val accounts : t -> Account_id.Set.tset of account ids associated with accounts
val token_owner : t -> token_id -> Account_id.t optionGet the account id that owns a token.
val token_owners : t -> Account_id.Set.tGet the set of all accounts which own a token.
val tokens : t -> key -> token_id_setGet all of the tokens for which a public key has accounts.
val location_of_account : t -> Account_id.t -> Location.t optionval location_of_account_batch :
t ->
Account_id.t list ->
(Account_id.t * Location.t option) listval get_or_create_account :
t ->
Account_id.t ->
Account.t ->
([ `Added | `Existed ] * Location.t) Core.Or_error.tThis may return an error if the ledger is full.
val close : t -> unitthe ledger should not be used after calling close
val last_filled : t -> Location.t optionfor account locations in the ledger, the last (rightmost) filled location
val get_uuid : t -> Uuid.tval get_directory : t -> string optionreturn Some directory for ledgers that use a file system, else None
val get : t -> Location.t -> Account.t optionval get_batch : t -> Location.t list -> (Location.t * Account.t option) listval set : t -> Location.t -> Account.t -> unitval set_batch : t -> (Location.t * Account.t) list -> unitval index_of_account_exn : t -> Account_id.t -> intmeant to be a fast operation: the root hash is stored, rather than calculated dynamically
val merkle_path : t -> Location.t -> Path.tval remove_accounts_exn : t -> Account_id.t list -> unitval detached_signal : t -> unit Async_kernel.Deferred.tTriggers when the ledger has been detached and should no longer be accessed.