@theqrl/wallet.js 0.2.0 → 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.
package/LICENSE ADDED
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2023-2026 The Quantum Resistant Ledger
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
@@ -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.0",
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",
@@ -24,9 +24,13 @@
24
24
  },
25
25
  "author": "QRL contributors <info@theqrl.org> (https://theqrl.org)",
26
26
  "license": "MIT",
27
+ "repository": {
28
+ "type": "git",
29
+ "url": "https://github.com/theQRL/wallet.js"
30
+ },
27
31
  "dependencies": {
28
32
  "@noble/hashes": "^1.8.0",
29
- "@theqrl/mldsa87": "^0.2.0",
33
+ "@theqrl/mldsa87": "^1.0.3",
30
34
  "randombytes": "^2.1.0"
31
35
  },
32
36
  "directories": {
@@ -39,9 +43,13 @@
39
43
  "types"
40
44
  ],
41
45
  "devDependencies": {
46
+ "@semantic-release/changelog": "^6.0.3",
47
+ "@semantic-release/exec": "^7.1.0",
48
+ "@semantic-release/git": "^10.0.1",
42
49
  "@types/node": "^20.14.12",
43
50
  "c8": "^7.13.0",
44
51
  "chai": "^4.3.7",
52
+ "conventional-changelog-conventionalcommits": "^9.1.0",
45
53
  "eslint": "^8.37.0",
46
54
  "eslint-config-airbnb": "^19.0.4",
47
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