Interface EnclaveWriter

Describes the connection a client has to an Enclave running Erdstall.

Hierarchy

Implemented by

Properties

off: (<EV>(ev: EV, cb: ErdstallEventHandler<EV>) => void)

Type declaration

    • <EV>(ev: EV, cb: ErdstallEventHandler<EV>): void
    • Unregisters a callback for the given event.

      Type Parameters

      • EV extends "error" | "open" | "close" | "config" | "receipt" | "phaseshift" | "proof" | "exitproof"

        Type of event the callback is parameterized on.

      Parameters

      • ev: EV

        The event of interest.

      • cb: ErdstallEventHandler<EV>

        The callback depending on the type of ev.

      Returns void

on: (<EV>(ev: EV, cb: ErdstallEventHandler<EV>) => void)

Type declaration

    • <EV>(ev: EV, cb: ErdstallEventHandler<EV>): void
    • Registers a callback for the given event, s.t. it fires everytime until manually unregistered with off(ev, cb).

      Remarks

      The registered callback should always be manually unregistered.

      Type Parameters

      • EV extends "error" | "open" | "close" | "config" | "receipt" | "phaseshift" | "proof" | "exitproof"

        Type of event the callback is parameterized on.

      Parameters

      • ev: EV

        The event of interest.

      • cb: ErdstallEventHandler<EV>

        The callback depending on the type of ev.

      Returns void

once: (<EV>(ev: EV, cb: ErdstallEventHandler<EV>) => void)

Type declaration

    • <EV>(ev: EV, cb: ErdstallEventHandler<EV>): void
    • Registers a callback for the given event, s.t. it fires only ONCE. Once registered, a callback cannot be unregistered again.

      Type Parameters

      • EV extends "error" | "open" | "close" | "config" | "receipt" | "phaseshift" | "proof" | "exitproof"

        Type of event the callback is parameterized on.

      Parameters

      • ev: EV

        The event of interest.

      • cb: ErdstallEventHandler<EV>

        The callback depending on the type of ev.

      Returns void

removeAllListeners: (() => void)

Type declaration

    • (): void
    • Removes all registered callbacks for all events.

      Returns void

Methods

  • Sends the given burn transaction to the enclave.

    Returns

    A promise containing the transaction accepted message for this burn.

    Parameters

    • tx: Burn

      The burn transaction to send.

    Returns Promise<TxAccepted>

  • Sends the given exit request to the enclave.

    Returns

    A promise containing the balance proof with its exit flag set.

    Parameters

    • exitRequest: ExitRequest

    Returns Promise<BalanceProof>

  • Sends the given mint transaction to the enclave.

    Returns

    A promise containing the transaction accepted message for this mint.

    Parameters

    • tx: Mint

      The mint transaction to send.

    Returns Promise<TxAccepted>

  • Subscribes the entity to receive TxReceipts and BalanceProofs concerning either all or the specified address.

    Handlers for incoming messages can be set using on and once.

    Returns

    An empty promise which can be awaited.

    Parameters

    • Optional who: Address

      When omitted subscribes to ALL available BalanceProofs and TxReceipts.

    Returns Promise<void>

  • Sends the given trade transaction to the enclave.

    Returns

    A promise containing the transaction accepted message for this trade.

    Parameters

    • tx: Trade

      The trade transaction to send.

    Returns Promise<TxAccepted>

  • Sends the given transfer transaction to the enclave.

    Returns

    A promise containing the transaction accepted message for this transfer.

    Parameters

    • tx: Transfer

      The transfer transaction to send.

    Returns Promise<TxAccepted>

Generated using TypeDoc