Class Proposer

Represents a proposer in the blockchain context. A proposer is an entity that proposes new blocks, identified by a public key and an optional system status.

Hierarchy

  • Proposer

Constructors

  • Constructs a new Proposer instance.

    Parameters

    • isSystem: boolean = false

      Indicates if the proposer is a system-level proposer.

    • Optional publicKey: PublicKey

      Optional public key if the proposer is not a system entity.

    Returns Proposer

Properties

isSystem: boolean

Indicates if the proposer is a system-level entity (without a public key).

publicKey?: PublicKey

Public key of the proposer, defined if the proposer is not a system entity.

Methods

  • Retrieves the public key of the proposer. Throws an error if the proposer is a system entity without a public key.

    Returns

    The public key of the proposer.

    Throws

    Will throw an error if the proposer is a system proposer.

    Returns PublicKey

  • Checks if the proposer is a system-level entity.

    Returns

    true if the proposer is a system entity, otherwise false.

    Returns boolean

  • Serializes the proposer instance to JSON. System proposers are represented as '00'; otherwise, the public key is serialized.

    Returns

    A JSON string representing the proposer.

    Returns string

  • Deserializes a JSON string to create a Proposer instance.

    Returns

    A new Proposer instance.

    Parameters

    • json: string

      A JSON string representing the proposer.

    Returns Proposer

  • Creates a Proposer instance from a string representation.

    Returns

    A new Proposer instance.

    Parameters

    • src: string

      A string representing the proposer. '00' indicates a system proposer.

    Returns Proposer

Generated using TypeDoc