@terminal3/t3n-sdk 0.10.0 → 0.12.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/README.md +1 -1
- package/dist/demo.d.ts +25 -0
- package/dist/index.d.ts +347 -172
- package/dist/index.esm.js +1 -1
- package/dist/index.js +1 -1
- package/dist/src/client/actions.d.ts +22 -0
- package/dist/src/client/config.d.ts +10 -30
- package/dist/src/client/encryption.d.ts +30 -0
- package/dist/src/client/handlers.d.ts +73 -0
- package/dist/src/client/index.d.ts +4 -0
- package/dist/src/client/request-parser.d.ts +48 -0
- package/dist/src/client/t3n-client.d.ts +113 -26
- package/dist/src/index.d.ts +6 -7
- package/dist/src/types/auth.d.ts +5 -6
- package/dist/src/types/index.d.ts +37 -13
- package/dist/src/utils/index.d.ts +0 -1
- package/dist/src/wasm/interface.d.ts +95 -54
- package/dist/src/wasm/loader.d.ts +25 -55
- package/dist/wasm/generated/interfaces/component-session-client-auth.d.ts +12 -0
- package/dist/wasm/generated/interfaces/component-session-client-handshake.d.ts +12 -0
- package/dist/wasm/generated/interfaces/component-session-cookie.d.ts +8 -0
- package/dist/wasm/generated/interfaces/component-session-session.d.ts +7 -0
- package/dist/wasm/generated/session.core.wasm +0 -0
- package/dist/wasm/generated/session.d.ts +10 -87
- package/dist/wasm/generated/session.js +3254 -6713
- package/package.json +1 -1
- package/dist/src/utils/hkdf.d.ts +0 -36
- package/dist/wasm/generated/interfaces/host-session-interfaces-contract-dispatch.d.ts +0 -2
- package/dist/wasm/generated/interfaces/host-session-interfaces-entropy.d.ts +0 -2
- package/dist/wasm/generated/interfaces/host-session-interfaces-eth-signer.d.ts +0 -2
- package/dist/wasm/generated/interfaces/host-session-interfaces-kem.d.ts +0 -3
- package/dist/wasm/generated/interfaces/host-session-interfaces-oidc-client.d.ts +0 -2
- package/dist/wasm/generated/interfaces/host-session-interfaces-oidc.d.ts +0 -3
- package/dist/wasm/generated/interfaces/host-session-interfaces-session-ops.d.ts +0 -9
- package/dist/wasm/generated/interfaces/host-session-interfaces-transport.d.ts +0 -2
- package/dist/wasm/generated/interfaces/tee-session-client-auth.d.ts +0 -7
- package/dist/wasm/generated/interfaces/tee-session-client-handshake.d.ts +0 -12
- package/dist/wasm/generated/interfaces/tee-session-cookie.d.ts +0 -7
- package/dist/wasm/generated/interfaces/tee-session-server-admin.d.ts +0 -2
- package/dist/wasm/generated/interfaces/tee-session-server-auth.d.ts +0 -10
- package/dist/wasm/generated/interfaces/tee-session-server-handshake.d.ts +0 -15
- package/dist/wasm/generated/interfaces/tee-session-server-webhook.d.ts +0 -6
- package/dist/wasm/generated/interfaces/tee-session-session-crypto.d.ts +0 -3
- package/dist/wasm/generated/session.core2.wasm +0 -0
- package/dist/wasm/generated/session.core3.wasm +0 -0
package/package.json
CHANGED
package/dist/src/utils/hkdf.d.ts
DELETED
|
@@ -1,36 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* HKDF-SHA256 key derivation that mirrors `session::session::derive_keys`
|
|
3
|
-
* in the node (`node/session/src/session.rs`).
|
|
4
|
-
*
|
|
5
|
-
* The server derives two directional keys from the raw ML-KEM shared
|
|
6
|
-
* secret using HKDF-Extract-then-Expand with:
|
|
7
|
-
* - salt = b"" (empty)
|
|
8
|
-
* - ikm = the 32-byte raw KEM shared secret
|
|
9
|
-
* - info = b"t3-session-v1-c2s" | b"t3-session-v1-s2c"
|
|
10
|
-
* - L = 32 bytes each
|
|
11
|
-
*
|
|
12
|
-
* The client must derive the same pair so that c2s / s2c line up on
|
|
13
|
-
* both sides. WebCrypto's `subtle.deriveBits` with `HKDF` does
|
|
14
|
-
* Extract+Expand in one call, so the TS implementation collapses to a
|
|
15
|
-
* few lines per direction.
|
|
16
|
-
*/
|
|
17
|
-
/**
|
|
18
|
-
* Derive directional session keys from the raw ML-KEM shared secret.
|
|
19
|
-
*
|
|
20
|
-
* @param rawSecret 32 bytes from `handshakeAsync.clientRun` (the
|
|
21
|
-
* `ClientPending.secret` field).
|
|
22
|
-
* @returns `{ c2s, s2c }` — each 32 bytes, suitable for AES-256-GCM.
|
|
23
|
-
*/
|
|
24
|
-
export declare function deriveDirectionalKeys(rawSecret: Uint8Array): Promise<{
|
|
25
|
-
c2s: Uint8Array;
|
|
26
|
-
s2c: Uint8Array;
|
|
27
|
-
}>;
|
|
28
|
-
/**
|
|
29
|
-
* Pack directional keys for the client-side session-crypto WASM calls.
|
|
30
|
-
*
|
|
31
|
-
* The contract's `session-crypto.encrypt`/`decrypt` interprets its
|
|
32
|
-
* `keys` argument as `encrypt_key || decrypt_key`. The client
|
|
33
|
-
* encrypts with c2s and decrypts with s2c, so the client packs
|
|
34
|
-
* `c2s || s2c`.
|
|
35
|
-
*/
|
|
36
|
-
export declare function packClientSessionKeys(c2s: Uint8Array, s2c: Uint8Array): Uint8Array;
|
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
/** @module Interface host:session-interfaces/session-ops@1.0.0 **/
|
|
2
|
-
export function nowMs(): bigint;
|
|
3
|
-
export function teeAddress(): Uint8Array;
|
|
4
|
-
export function fetchOrCreateDid(authenticatorHashes: Array<Uint8Array>, did: string | undefined): string;
|
|
5
|
-
export function fetchProviderConfig(providerId: string): Uint8Array;
|
|
6
|
-
export function setCookie(cookieValue: string): void;
|
|
7
|
-
export function registerScript(name: string, version: string, wasmBytes: Uint8Array, sourceHash: string | undefined): boolean;
|
|
8
|
-
export function syncUserAuths(): Uint8Array;
|
|
9
|
-
export function updateMeasurements(measurementsBase64: string): boolean;
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
/** @module Interface tee:session/client-auth@1.0.0 **/
|
|
2
|
-
export function runEth(sessionKeys: Uint8Array, ethAddress: string, siweDomain: string | undefined, siweUrl: string | undefined, siweChainId: bigint | undefined): Outcome;
|
|
3
|
-
export function runOidc(sessionKeys: Uint8Array, provider: string): Outcome;
|
|
4
|
-
export interface Outcome {
|
|
5
|
-
did: string,
|
|
6
|
-
cookie?: string,
|
|
7
|
-
}
|
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
/** @module Interface tee:session/client-handshake@1.0.0 **/
|
|
2
|
-
export function run(sid: Uint8Array, cookie: string | undefined): Outcome;
|
|
3
|
-
export interface SessionKeys {
|
|
4
|
-
blob: Uint8Array,
|
|
5
|
-
sid: Uint8Array,
|
|
6
|
-
}
|
|
7
|
-
export interface Outcome {
|
|
8
|
-
keys: SessionKeys,
|
|
9
|
-
authenticated: boolean,
|
|
10
|
-
did?: string,
|
|
11
|
-
expirySec: bigint,
|
|
12
|
-
}
|
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
/** @module Interface tee:session/server-auth@1.0.0 **/
|
|
2
|
-
export function run(persistedStateBytes: Uint8Array | undefined, initialActionJson: Uint8Array, siwePolicyJson: Uint8Array): Outcome;
|
|
3
|
-
export interface Outcome {
|
|
4
|
-
responseJson: Uint8Array,
|
|
5
|
-
stateBytes?: Uint8Array,
|
|
6
|
-
cookie?: string,
|
|
7
|
-
did?: string,
|
|
8
|
-
authenticatorsJson?: Uint8Array,
|
|
9
|
-
finalized: boolean,
|
|
10
|
-
}
|
|
@@ -1,15 +0,0 @@
|
|
|
1
|
-
/** @module Interface tee:session/server-handshake@1.0.0 **/
|
|
2
|
-
export function run(sid: Uint8Array, ciphertext: Uint8Array, cookieValue: string | undefined): Outcome;
|
|
3
|
-
export interface SessionKeys {
|
|
4
|
-
c2s: Uint8Array,
|
|
5
|
-
s2c: Uint8Array,
|
|
6
|
-
sid: Uint8Array,
|
|
7
|
-
}
|
|
8
|
-
export interface Outcome {
|
|
9
|
-
keys: SessionKeys,
|
|
10
|
-
rawSecret: Uint8Array,
|
|
11
|
-
authenticated: boolean,
|
|
12
|
-
did?: string,
|
|
13
|
-
expirySec: bigint,
|
|
14
|
-
refreshedCookie?: string,
|
|
15
|
-
}
|
|
Binary file
|
|
Binary file
|