Interface IKBUniversalAccumulatorState

Interface for accumulator state. This should be implemented by the persistence layer that stores the accumulator members. It is advised to update the state when elements are added or removed from the accumulator.

interface IKBUniversalAccumulatorState {
    add(element: Uint8Array): Promise<void>;
    addToDomain(element: Uint8Array): Promise<void>;
    has(element: Uint8Array): Promise<boolean>;
    inDomain(element: Uint8Array): Promise<boolean>;
    remove(element: Uint8Array): Promise<void>;
}

Hierarchy (view full)

Methods

  • Takes an element not in the domain and adds it.

    Parameters

    • element: Uint8Array

    Returns Promise<void>

  • Whether this element is in the domain (could be a member or not)

    Parameters

    • element: Uint8Array

    Returns Promise<boolean>