Class Operation

An operation object.

Constructors

Properties

id: string

Methods

  • Gets the address of the smart contract deployed by the operation.

    Parameters

    • waitFinal: boolean = false

      Whether to wait for the final execution or the speculative one.

    • timeout: number = DEFAULT_EVENTS_TIMEOUT_MS

      The maximum time to wait for the events once the operation is executed.

    • period: number = DEFAULT_WAIT_PERIOD_MS

      The time interval between two reads of the events.

    Returns Promise<string>

    The address of the deployed smart contract.

    Remarks

    A node can report the operation as executed slightly before it serves the operation events. The events are read again, every period ms, until they arrive or timeout ms have passed.

  • Gets the events of the operation once the block reaches the final state.

    Returns Promise<OutputEvents>

    The events of the operation.

  • Gets the events of the speculative execution of the operation.

    Returns Promise<OutputEvents>

    The speculative events of the operation.

  • Waits for the block containing the operation to be final.

    Parameters

    • Optional timeout: number

      The maximum time to wait.

    • Optional period: number

      The time interval to check the status.

    Returns Promise<OperationStatus>

    The status of the operation or NotFound if the timeout is reached.

  • Waits for the operation to be included in a block.

    Parameters

    • Optional timeout: number

      The maximum time to wait.

    • Optional period: number

      The time interval to check the status.

    Returns Promise<OperationStatus>

    The status of the operation or NotFound if the timeout is reached.