// Copyright 2017-2025 @polkadot/hw-ledger authors & contributors
// SPDX-License-Identifier: Apache-2.0

import type { HexString } from '@pezkuwi/util/types';

/**
 * Legacy Type that works with the `Ledger` class.
 */
export interface AccountOptions {
  /** The index of the account */
  account: number;
  /** The index of the address */
  addressIndex: number;
  /** The change to apply */
  change: number;
}

export interface AccountOptionsGeneric extends AccountOptions {
  /** Option for PolkadotGenericApp.signWithMetadata */
  metadata: Buffer;
}

export interface LedgerAddress {
  /** The ss58 encoded address */
  address: string;
  /** The hex-encoded publicKey */
  publicKey: HexString;
}

export interface LedgerSignature {
  /** A hex-encoded signature, as generated by the device */
  signature: HexString;
}

export interface LedgerVersion {
  /** Indicator flag for locked status */
  isLocked: boolean;
  /** Indicator flag for testmode status */
  isTestMode: boolean;
  /** The software version for this device */
  version: [major: number, minor: number, patch: number];
}
