@cogcoin/client 0.5.0 → 0.5.1

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/README.md CHANGED
@@ -1,8 +1,8 @@
1
1
  # `@cogcoin/client`
2
2
 
3
- `@cogcoin/client@0.5.0` is the store-backed Cogcoin client package for applications that want a local wallet, durable SQLite-backed state, and a managed Bitcoin Core integration around `@cogcoin/indexer`. It publishes the reusable client APIs, the SQLite adapter, the managed `bitcoind` integration, and the first-party `cogcoin` CLI in one package.
3
+ `@cogcoin/client@0.5.1` is the store-backed Cogcoin client package for applications that want a local wallet, durable SQLite-backed state, and a managed Bitcoin Core integration around `@cogcoin/indexer`. It publishes the reusable client APIs, the SQLite adapter, the managed `bitcoind` integration, and the first-party `cogcoin` CLI in one package.
4
4
 
5
- Use Node 22 or newer.
5
+ Use Node 24.7.0 or newer.
6
6
 
7
7
  ## Links
8
8
 
@@ -1,4 +1,5 @@
1
- import { argon2, createCipheriv, createDecipheriv, randomBytes, } from "node:crypto";
1
+ import * as crypto from "node:crypto";
2
+ const { createCipheriv, createDecipheriv, randomBytes, } = crypto;
2
3
  const DEFAULT_ARGON2_MEMORY_KIB = 65_536;
3
4
  const DEFAULT_ARGON2_ITERATIONS = 3;
4
5
  const DEFAULT_ARGON2_PARALLELISM = 1;
@@ -6,6 +7,12 @@ const DERIVED_KEY_LENGTH = 32;
6
7
  const GCM_NONCE_BYTES = 12;
7
8
  const ARGON2_SALT_BYTES = 16;
8
9
  const BIGINT_JSON_TAG = "$cogcoinBigInt";
10
+ function requireArgon2() {
11
+ if (typeof crypto.argon2 !== "function") {
12
+ throw new Error("Node.js 24.7.0 or newer is required because node:crypto argon2 is unavailable.");
13
+ }
14
+ return crypto.argon2;
15
+ }
9
16
  function jsonReplacer(_key, value) {
10
17
  if (typeof value === "bigint") {
11
18
  return {
@@ -25,7 +32,7 @@ function jsonReviver(_key, value) {
25
32
  }
26
33
  function deriveArgon2Key(message, nonce, memoryKib, iterations, parallelism) {
27
34
  return new Promise((resolve, reject) => {
28
- argon2("argon2id", {
35
+ requireArgon2()("argon2id", {
29
36
  message,
30
37
  nonce,
31
38
  memory: memoryKib,
package/package.json CHANGED
@@ -1,11 +1,11 @@
1
1
  {
2
2
  "name": "@cogcoin/client",
3
- "version": "0.5.0",
3
+ "version": "0.5.1",
4
4
  "description": "Store-backed Cogcoin client with wallet flows, SQLite persistence, and managed Bitcoin Core integration.",
5
5
  "license": "MIT",
6
6
  "type": "module",
7
7
  "engines": {
8
- "node": ">=22"
8
+ "node": ">=24.7.0"
9
9
  },
10
10
  "homepage": "https://cogcoin.org",
11
11
  "repository": {