Signature Class

Constructors

Properties

Accessors

Methods

Constructors

  • Parameters

    • sig: { data: Uint8Array<ArrayBufferLike>; type: "SECP256K1" | "BLS" }

    Returns Signature

Properties

data: Uint8Array<ArrayBufferLike>
type: "SECP256K1" | "BLS"

Accessors

  • get code(): 1 | 2

    Returns 1 | 2

Methods

  • Encodes the signature as a JSON object in the Lotus RPC format.

    Returns { Data: string; Type: 1 | 2 }

  • Encodes the signature as a Lotus-style hex encoded string

    Lotus adds 0x01 or 0x02 to the signature depending on the type.

    Returns string

    Hex encoded signature

  • Parameters

    • json: { Data: string; Type: 1 | 2 }

    Returns Signature

  • Signature from Lotus-style hex encoded string

    Lotus adds 0x01 or 0x02 to the signature depending on the type.

    Parameters

    • str: string

      Hex encoded signature

    Returns Signature