Class LedgerDI

Represents an interface for Ledger device interactions.

Implements

  • Connected

Constructors

Properties

appClient: null | AppClient = null
policyRegistrationRequired: boolean = true

Methods

  • Extracts master fingerprint from device

    Returns Promise<string>

  • Gets the extended public key (xpub) by derivation path.

    Parameters

    • derivationPath: string

    Returns Promise<string>

    The extended public key (xpub).

  • Extracts device key params.

    Parameters

    • derivationPath: string

    Returns Promise<{
        masterFingerprint: string;
        xpub: string;
    }>

  • Registers a device policy.

    Parameters

    • walletKeys: WalletKey[]

      The wallet keys.

    • Optional options: {
          walletName: string;
      }

      Additional options.

      • walletName: string

    Returns Promise<{
        policy: string;
        policy_hmac: string;
    }>

    The registered device policy.

  • Signs a message.

    Parameters

    • message: string

      The message to sign.

    • dp: string

      The derivation path.

    Returns Promise<{
        signature: string;
    }>

    The signature of the message.

  • Signs a transaction.

    Parameters

    • psbtHex: string

      The hexadecimal representation of the partially signed bitcoin transaction (PSBT).

    • params: {
          policy?: string;
          policy_hmac?: string;
          walletKey: WalletKey;
          walletType: WalletTypeEnum;
      }

      Additional parameters for signing.

      • Optional policy?: string
      • Optional policy_hmac?: string
      • walletKey: WalletKey
      • walletType: WalletTypeEnum

    Returns Promise<string>

    The raw signed transaction.

  • Initializes the LedgerDI instance asynchronously. This method should be used to create an instance of LedgerDI. It waits for the initialization process to complete.

    Returns Promise<LedgerDI>

    Resolves with a fully initialized instance of LedgerDI.