A service class for managing L1X wallets, private keys, and signatures.

Hierarchy

  • L1XWalletService

Constructors

Methods

  • Converts a public key to an address.

    Parameters

    • publicKey: string

      The public key to be converted to an address.

    Returns Promise<string>

    • A promise that resolves to the address derived from the public key.

    See

    • strToUint8Array
    • keccak256
  • Signs a payload using a private key and returns the signature.

    Parameters

    • rawPayload: any

      The raw payload to be signed.

    • privateKey: string

      The private key in hexadecimal format.

    Returns Promise<Uint8Array>

    • A promise that resolves to the signature of the payload.

    Async

    See

    RawPayloadArg

  • Converts a Uint8Array to its hexadecimal representation.

    Parameters

    • _data: Uint8Array

      The Uint8Array to be converted to hexadecimal.

    Returns Promise<string>

    • A promise that resolves to the hexadecimal representation of the input Uint8Array.

    See

    uint8ArrayToHex

  • Verifies the integrity of a payload using a given signature and public key.

    Parameters

    • _signature: string

      The signature to be verified.

    • _payload: Object

      The payload object to be verified.

    • _publicKey: string

      The public key used for verification.

    Returns Promise<boolean>

    • A promise that resolves to a boolean indicating whether the signature is valid.

    See

    • strToUint8Array
    • Sha256
    • secp256k1

Generated using TypeDoc