@theqrl/wallet.js 0.2.2 → 1.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -4526,12 +4526,10 @@ function binToMnemonic(input) {
4526
4526
  for (let nibble = 0; nibble < input.length * 2; nibble += 3) {
4527
4527
  const p = nibble >> 1;
4528
4528
  const b1 = input[p];
4529
+ /* c8 ignore next -- fallback unreachable for valid (multiple of 3) input */
4529
4530
  const b2 = p + 1 < input.length ? input[p + 1] : 0;
4530
4531
  const idx = nibble % 2 === 0 ? (b1 << 4) + (b2 >> 4) : ((b1 & 0x0f) << 8) + b2;
4531
4532
 
4532
- if (idx >= WordList.length) {
4533
- throw new Error('mnemonic index out of range');
4534
- }
4535
4533
  words.push(WordList[idx]);
4536
4534
  }
4537
4535
 
@@ -4835,6 +4833,7 @@ function newWalletFromExtendedSeed(extendedSeed) {
4835
4833
  return Wallet.newWalletFromExtendedSeed(ext);
4836
4834
  // case WalletType.SPHINCSPLUS_256S:
4837
4835
  // Not yet implemented - reserved for future use
4836
+ /* c8 ignore next 2 */
4838
4837
  default:
4839
4838
  throw new Error(`Unsupported wallet type: ${desc.type()}`);
4840
4839
  }
@@ -4524,12 +4524,10 @@ function binToMnemonic(input) {
4524
4524
  for (let nibble = 0; nibble < input.length * 2; nibble += 3) {
4525
4525
  const p = nibble >> 1;
4526
4526
  const b1 = input[p];
4527
+ /* c8 ignore next -- fallback unreachable for valid (multiple of 3) input */
4527
4528
  const b2 = p + 1 < input.length ? input[p + 1] : 0;
4528
4529
  const idx = nibble % 2 === 0 ? (b1 << 4) + (b2 >> 4) : ((b1 & 0x0f) << 8) + b2;
4529
4530
 
4530
- if (idx >= WordList.length) {
4531
- throw new Error('mnemonic index out of range');
4532
- }
4533
4531
  words.push(WordList[idx]);
4534
4532
  }
4535
4533
 
@@ -4833,6 +4831,7 @@ function newWalletFromExtendedSeed(extendedSeed) {
4833
4831
  return Wallet.newWalletFromExtendedSeed(ext);
4834
4832
  // case WalletType.SPHINCSPLUS_256S:
4835
4833
  // Not yet implemented - reserved for future use
4834
+ /* c8 ignore next 2 */
4836
4835
  default:
4837
4836
  throw new Error(`Unsupported wallet type: ${desc.type()}`);
4838
4837
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@theqrl/wallet.js",
3
- "version": "0.2.2",
3
+ "version": "1.0.0",
4
4
  "description": "Quantum-resistant wallet library for The QRL using ML-DSA-87 (FIPS 204)",
5
5
  "type": "module",
6
6
  "main": "dist/cjs/wallet.js",
@@ -49,6 +49,7 @@
49
49
  "@types/node": "^20.14.12",
50
50
  "c8": "^7.13.0",
51
51
  "chai": "^4.3.7",
52
+ "conventional-changelog-conventionalcommits": "^9.1.0",
52
53
  "eslint": "^8.37.0",
53
54
  "eslint-config-airbnb": "^19.0.4",
54
55
  "eslint-config-prettier": "^8.8.0",
@@ -31,6 +31,7 @@ function newWalletFromExtendedSeed(extendedSeed) {
31
31
  return MLDSA87.newWalletFromExtendedSeed(ext);
32
32
  // case WalletType.SPHINCSPLUS_256S:
33
33
  // Not yet implemented - reserved for future use
34
+ /* c8 ignore next 2 */
34
35
  default:
35
36
  throw new Error(`Unsupported wallet type: ${desc.type()}`);
36
37
  }
@@ -24,12 +24,10 @@ function binToMnemonic(input) {
24
24
  for (let nibble = 0; nibble < input.length * 2; nibble += 3) {
25
25
  const p = nibble >> 1;
26
26
  const b1 = input[p];
27
+ /* c8 ignore next -- fallback unreachable for valid (multiple of 3) input */
27
28
  const b2 = p + 1 < input.length ? input[p + 1] : 0;
28
29
  const idx = nibble % 2 === 0 ? (b1 << 4) + (b2 >> 4) : ((b1 & 0x0f) << 8) + b2;
29
30
 
30
- if (idx >= WordList.length) {
31
- throw new Error('mnemonic index out of range');
32
- }
33
31
  words.push(WordList[idx]);
34
32
  }
35
33