Variable ledgerConst

ledger: {
    getLedgerMasterFingerPrint: ((__namedParameters) => Promise<Buffer>);
    getLedgerXpub: ((__namedParameters) => Promise<string>);
    registerLedgerWallet: ((__namedParameters) => Promise<void>);
    assertLedgerApp: ((__namedParameters) => Promise<void>);
} = ...

Type declaration

  • getLedgerMasterFingerPrint: ((__namedParameters) => Promise<Buffer>)
      • (__namedParameters): Promise<Buffer>
      • Retrieves the masterFingerPrint of a Ledger device

        Parameters

        Returns Promise<Buffer>

  • getLedgerXpub: ((__namedParameters) => Promise<string>)
      • (__namedParameters): Promise<string>
      • Retrieves the xpub of a certain originPath of a Ledger device

        Parameters

        • __namedParameters: {
              originPath: string;
              ledgerManager: LedgerManager;
          }

        Returns Promise<string>

  • registerLedgerWallet: ((__namedParameters) => Promise<void>)
      • (__namedParameters): Promise<void>
      • Registers a policy based on a provided descriptor.

        This function will:

        1. Store the policy in ledgerState inside the ledgerManager.
        2. Avoid re-registering if the policy was previously registered.
        3. Skip registration if the policy is considered "standard".

        It's important to understand the nature of the Ledger Policy being registered:

        • While a descriptor might point to a specific output index of a particular change address, the corresponding Ledger Policy abstracts this and represents potential outputs for all addresses (both external and internal).
        • This means that the registered Ledger Policy is a generalized version of the descriptor, not assuming specific values for the keyPath.

        Parameters

        • __namedParameters: {
              descriptor: string;
              ledgerManager: LedgerManager;
              policyName: string;
          }
          • descriptor: string
          • ledgerManager: LedgerManager
          • policyName: string

            The Name we want to assign to this specific policy

        Returns Promise<void>

  • assertLedgerApp: ((__namedParameters) => Promise<void>)
      • (__namedParameters): Promise<void>
      • Verifies if the Ledger device is connected, if the required Bitcoin App is opened, and if the version of the app meets the minimum requirements.

        Parameters

        • __namedParameters: {
              transport: any;
              name: string;
              minVersion: string;
          }
          • transport: any

            Connection transport with the Ledger device. One of these: https://github.com/LedgerHQ/ledger-live#libs---libraries

          • name: string

            The name of the Bitcoin App. "Bitcoin" for mainnet or "Bitcoin Test" for testnet.

          • minVersion: string

            The minimum acceptable version of the Bitcoin App in semver format (major.minor.patch).

        Returns Promise<void>

        Promise - A promise that resolves if all assertions pass, or throws otherwise.

        Throws

        Will throw an error if the Ledger device is not connected, the required Bitcoin App is not opened, or if the version is below the required number.