Options
All
  • Public
  • Public/Protected
  • All
Menu

Class SendOperation

Executes a send on the sidechain.

Hierarchy

  • SendOperation

Index

Constructors

constructor

  • Constructs a SendOperation.

    Parameters

    • client: IRootClient

      An instance of the Plasma root node gRPC client.

    • contract: PlasmaContract

      An instance of the Plasma smart contract.

    • from: string

      The address whose outpoints are to be exited.

    Returns SendOperation

Methods

forValue

  • The amount of funds to send.

    Parameters

    • value: BN

      The amount.

    Returns SendOperation

send

  • Performs the send. Will throw an error if to, value, or fee are not defined.

    Performing a send entails the following steps:

    1. Looking up the address's UTXO set.
    2. Choosing the appropriate UTXOs to spend.
    3. Generating and signing a transaction.
    4. Sending that transaction to the root node.
    5. Consuming the returned inclusion receipt, generating confirm signatures, and forwarding them to the root node.

    Parameters

    • privateKey: Buffer

    Returns Promise<ConfirmedTransaction>

toAddress

  • The address to send funds to.

    Parameters

    • to: string

      The address.

    Returns SendOperation

withDepositNonce

  • A deposit nonce. Set when spending a deposit.

    Parameters

    • depositNonce: BN

    Returns SendOperation

withFee

  • The fee amount to pay to the root node.

    Parameters

    • fee: BN

      The fee.

    Returns SendOperation

Generated using TypeDoc