@terminal3/t3n-sdk 2.9.0 → 2.10.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.
@@ -4,7 +4,7 @@
4
4
  * Creates the initial action payloads for WASM state machines.
5
5
  * These are JSON-serialized and passed to the WASM component to start flows.
6
6
  */
7
- import { AuthInput } from "../types";
7
+ import type { AuthInput } from "../types";
8
8
  /**
9
9
  * Create the initial handshake request
10
10
  * This kicks off the handshake state machine in WASM
@@ -101,6 +101,10 @@ export declare class T3nClient {
101
101
  * optionally validates it with a schema.
102
102
  */
103
103
  execute(payload: unknown): Promise<string>;
104
+ /**
105
+ * Execute an action with an attached binary blob using multipart RPC.
106
+ */
107
+ executeWithBlob(payload: unknown, blob: Blob): Promise<string>;
104
108
  /**
105
109
  * Execute an action and JSON-decode the response.
106
110
  *
@@ -441,6 +445,7 @@ export declare class T3nClient {
441
445
  * Send an RPC request with automatic encryption/decryption
442
446
  */
443
447
  private sendRpcRequest;
448
+ private sendMultipartRpcRequest;
444
449
  /**
445
450
  * Capture the server-minted `Session-Id` from the last handshake
446
451
  * response headers (pentest M-1 / MAT-983). Validates shape so a
@@ -37,6 +37,10 @@ export interface Transport {
37
37
  * @returns Promise that resolves to the JSON-RPC response
38
38
  */
39
39
  send(request: JsonRpcRequest, headers: Record<string, string>): Promise<JsonRpcResponse>;
40
+ /**
41
+ * Optionally send a JSON-RPC request with an attached binary blob.
42
+ */
43
+ sendMultipart?(request: JsonRpcRequest, headers: Record<string, string>, blob: Blob): Promise<JsonRpcResponse>;
40
44
  /**
41
45
  * Optional accessor for the latest Set-Cookie header value.
42
46
  * (Useful in Node.js demos/tests; browsers block HttpOnly cookies.)
@@ -59,6 +63,7 @@ export declare class HttpTransport implements Transport {
59
63
  getLastSetCookie(): string | null;
60
64
  getLastResponseHeaders(): Record<string, string>;
61
65
  send(request: JsonRpcRequest, headers: Record<string, string>): Promise<JsonRpcResponse>;
66
+ sendMultipart(request: JsonRpcRequest, headers: Record<string, string>, blob: Blob): Promise<JsonRpcResponse>;
62
67
  }
63
68
  /**
64
69
  * Mock transport for testing
@@ -79,6 +84,7 @@ export declare class MockTransport implements Transport {
79
84
  private responseHeaders;
80
85
  private lastResponseHeaders;
81
86
  private requests;
87
+ private multipartRequests;
82
88
  /**
83
89
  * Mock a response for a specific method
84
90
  */
@@ -109,9 +115,15 @@ export declare class MockTransport implements Transport {
109
115
  request: JsonRpcRequest;
110
116
  headers: Record<string, string>;
111
117
  }>;
118
+ getMultipartRequests(): Array<{
119
+ request: JsonRpcRequest;
120
+ headers: Record<string, string>;
121
+ blob: Blob;
122
+ }>;
112
123
  /**
113
124
  * Clear all recorded requests
114
125
  */
115
126
  clearRequests(): void;
127
+ sendMultipart(request: JsonRpcRequest, headers: Record<string, string>, blob: Blob): Promise<JsonRpcResponse>;
116
128
  send(request: JsonRpcRequest, headers: Record<string, string>): Promise<JsonRpcResponse>;
117
129
  }
@@ -33,12 +33,19 @@ export interface OidcCredentials {
33
33
  interface BaseAuthInput {
34
34
  method: AuthMethod;
35
35
  }
36
+ /**
37
+ * Ethereum authentication options
38
+ */
39
+ export interface EthAuthOptions {
40
+ ethDerived?: boolean;
41
+ }
36
42
  /**
37
43
  * Ethereum authentication input
38
44
  */
39
45
  export interface EthAuthInput extends BaseAuthInput {
40
46
  method: AuthMethod.Ethereum;
41
47
  address: string;
48
+ ethDerived?: boolean;
42
49
  }
43
50
  /**
44
51
  * OIDC authentication input
@@ -54,6 +61,6 @@ export type AuthInput = EthAuthInput | OidcAuthInput;
54
61
  /**
55
62
  * Helper functions to create auth inputs
56
63
  */
57
- export declare function createEthAuthInput(address: string): EthAuthInput;
64
+ export declare function createEthAuthInput(address: string, options?: EthAuthOptions): EthAuthInput;
58
65
  export declare function createOidcAuthInput(credentials: OidcCredentials): OidcAuthInput;
59
66
  export {};
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@terminal3/t3n-sdk",
3
- "version": "2.9.0",
3
+ "version": "2.10.1",
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",