Options
All
  • Public
  • Public/Protected
  • All
Menu

Class ConfirmedTransaction

Wrapper class for a Plasma transaction and its associated confirmSignatures. For transactions that haven't been confirmed yet, each element of the confirmSignatures array will be a zero-filled Buffer of length 65.

Hierarchy

  • ConfirmedTransaction

Index

Constructors

constructor

Properties

confirmSignatures

confirmSignatures: [Buffer, Buffer] | null

The list of confirm signatures for this transaction.

transaction

transaction: Transaction

The transaction itself.

Methods

confirmHash

  • confirmHash(merkleRoot: Buffer): Buffer
  • Returns the hash of the transaction used to generate the transaction's confirmSignatures. According to the specification, confirmSignatures are generated by taking the `sha256 hash of the concatenation of:

    1. The sha256 hash of the RLP-encoded transaction.
    2. The merkleRoot of the block that includes this transaction.

    This method will throw an error if the wrapped transaction does not have a blockNum set. A transaction without a blockNum set has not been included in a block, and so cannot be confirmed.

    Parameters

    • merkleRoot: Buffer

      The merkleRoot of the block that includes this transaction.

    Returns Buffer

confirmSign

  • confirmSign(privateKey: Buffer, merkleRoot: Buffer): void
  • Sets this ConfirmedTransaction's confirmation signatures by signing the result of confirmHash with the provided privateKey.

    Note that this method sets the confirmSignatures on the class itself and does not return them.

    This method will throw an error if the wrapped transaction does not have a blockNum set. A transaction without a blockNum set has not been included in a block, and so cannot be confirmed.

    Parameters

    • privateKey: Buffer

      The private key to create the confirmSignatures with.

    • merkleRoot: Buffer

      The merkleRoot of the block that includes this transaction.

    Returns void

Generated using TypeDoc