Function parseKLV

    • Parse KLV amount from human-readable string to smallest units

      Convenience function that calls parseUnits with 6 decimals (KLV precision).

      Parameters

      • amount: string | number

        Human-readable KLV amount

      Returns bigint

      Amount in smallest units as bigint

      If the amount has invalid format or too many decimals

      parseKLV('1') // 1000000n (1 KLV)
      parseKLV('1.5') // 1500000n (1.5 KLV)
      parseKLV(2) // 2000000n (2 KLV)
      parseKLV('0.000001') // 1n (smallest KLV unit)