Class: Aggregator

Aggregator(settingsopt) → {Aggregator}

Aggregates a set of balances (inputs).

Constructor

new Aggregator(settingsopt) → {Aggregator}

Create a new Aggregator.
Parameters:
Name Type Attributes Description
settings Object <optional>
Map of configuration values.
Properties
Name Type Attributes Description
inputs Array <optional>
Array of AnchorBalance instances.
Source:
Returns:
Instance of the Aggregator.
Type
Aggregator

Methods

_computeBalances() → {AnchorBalance}

Updates the state to reflect balances from current inputs.
Source:
Returns:
Summary of balances.
Type
AnchorBalance

_importBalances(list) → {AnchorBalance}

Import a list of AnchorBalance instances.
Parameters:
Name Type Description
list Array List of inputs to add.
Source:
Returns:
Summary of resulting balances.
Type
AnchorBalance

commit() → {AggregatorCommit}

Commits the balance of all input.
Source:
Fires:
Returns:
Commit instance.
Type
AggregatorCommit

Events

commit

Commit event.
Type:
  • Object
Properties:
Name Type Description
root Uint8Array Root of the Tree.
leaves Array Leaves of the Tree.
Source: