@terminal3/t3n-sdk 0.3.0 → 0.4.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.
@@ -30,20 +30,35 @@ export declare function eth_get_address(privateKey: string): string;
30
30
  * from `${baseUrl}/status` on first invocation and caches the encoded
31
31
  * response for subsequent calls.
32
32
  *
33
- * @param baseUrl - Optional explicit node URL. If omitted, falls back to the
34
- * current environment default (see `getNodeUrl()`).
33
+ * @param baseUrl - **Required**. The node URL whose `/status` endpoint should
34
+ * serve the ML-KEM public key. Must be the same URL the
35
+ * T3nClient is constructed with — otherwise the handshake
36
+ * encrypts to one node and sends ciphertext to another.
37
+ *
38
+ * Was optional in 0.3.x, where omitting it caused the lazy
39
+ * fetch to silently fall back to `NODE_URLS[currentEnv]` and
40
+ * hit the wrong node. Three downstream consumers (demo.ts,
41
+ * t3-apps dev wallet hooks, t3n-mcp session manager) all
42
+ * hit this trap before we tightened the type.
35
43
  */
36
- export declare function createMlKemPublicKeyHandler(baseUrl?: string): GuestToHostHandler;
44
+ export declare function createMlKemPublicKeyHandler(baseUrl: string): GuestToHostHandler;
37
45
  /**
38
46
  * Create Random handler backed by crypto.getRandomValues
39
47
  * Note: The Rust Vec<u8> type serializes as an array of bytes, not a base64 string
40
48
  */
41
49
  export declare function createRandomHandler(): GuestToHostHandler;
42
50
  /**
43
- * Create the default handler set required by the T3n handshake
51
+ * Create the default handler set required by the T3n handshake.
52
+ *
53
+ * @param baseUrl - **Required**. Forwarded to `createMlKemPublicKeyHandler`
54
+ * so the lazy /status fetch hits the right node.
44
55
  */
45
- export declare function createDefaultHandlers(baseUrl?: string): GuestToHostHandlers;
56
+ export declare function createDefaultHandlers(baseUrl: string): GuestToHostHandlers;
46
57
  /**
47
- * Merge consumer-provided handlers with defaults (user handlers take precedence)
58
+ * Merge consumer-provided handlers with defaults (user handlers take precedence).
59
+ *
60
+ * @param handlers - Optional consumer overrides.
61
+ * @param baseUrl - **Required**. Forwarded to the default handler set so the
62
+ * ML-KEM key fetch hits the right node.
48
63
  */
49
- export declare function mergeWithDefaultHandlers(handlers?: GuestToHostHandlers, baseUrl?: string): GuestToHostHandlers;
64
+ export declare function mergeWithDefaultHandlers(handlers: GuestToHostHandlers | undefined, baseUrl: string): GuestToHostHandlers;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@terminal3/t3n-sdk",
3
- "version": "0.3.0",
3
+ "version": "0.4.0",
4
4
  "type": "module",
5
5
  "description": "T3n TypeScript SDK - A minimal SDK that mirrors the server's RPC handler approach",
6
6
  "main": "dist/index.js",