@terminal3/t3n-sdk 3.1.0 → 3.3.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/dist/index.d.ts +28 -0
- package/dist/index.esm.js +1 -1
- package/dist/index.js +1 -1
- package/dist/src/client/actions.d.ts +9 -0
- package/dist/src/client/org-data.d.ts +7 -0
- package/dist/src/client/t3n-client.d.ts +22 -1
- package/dist/wasm/generated/session.core.wasm +0 -0
- package/dist/wasm/generated/session.js +557 -148
- package/package.json +1 -1
|
@@ -20,3 +20,12 @@ export declare function createAuthAction(authInput: AuthInput): Uint8Array;
|
|
|
20
20
|
* @param idToken - The id_token JWT obtained from the OIDC provider with the nonce
|
|
21
21
|
*/
|
|
22
22
|
export declare function createOidcSubmitTokenAction(idToken: string): Uint8Array;
|
|
23
|
+
/**
|
|
24
|
+
* Create the initial action for the ADD-authenticator flow: link a new
|
|
25
|
+
* Ethereum wallet to the session's already-authenticated DID. Drives
|
|
26
|
+
* the same client state machine as {@link createAuthAction} (eth), but
|
|
27
|
+
* the `AddAuthenticator` tag routes the server to the link path instead
|
|
28
|
+
* of resolve-or-mint. Only Ethereum is supported — OIDC/email identities
|
|
29
|
+
* are established at login, not added afterwards.
|
|
30
|
+
*/
|
|
31
|
+
export declare function createAddEthAuthAction(address: string): Uint8Array;
|
|
@@ -106,6 +106,13 @@ export interface OrgDataClientOptions extends ExecuteOrgDataActionOptions {
|
|
|
106
106
|
* auth challenge flow automatically.
|
|
107
107
|
*/
|
|
108
108
|
handlers?: GuestToHostHandlers;
|
|
109
|
+
/**
|
|
110
|
+
* Extra headers added to every `/api/rpc` request the internal
|
|
111
|
+
* `T3nClient` makes. Mirrors `T3nClientConfig.headers` — needed when
|
|
112
|
+
* the node sits behind an edge policy that gates `/api/rpc` on a
|
|
113
|
+
* header (e.g. the staging Cloud Armor bypass token).
|
|
114
|
+
*/
|
|
115
|
+
headers?: Record<string, string>;
|
|
109
116
|
}
|
|
110
117
|
/**
|
|
111
118
|
* Client for session-authenticated org-data contract execution.
|
|
@@ -6,7 +6,7 @@
|
|
|
6
6
|
*/
|
|
7
7
|
import { T3nClientConfig } from "./config";
|
|
8
8
|
import { type ContractResponseSchema } from "./contract-response";
|
|
9
|
-
import { SessionId, Did, SessionStatus, AuthInput, HandshakeResult } from "../types";
|
|
9
|
+
import { SessionId, Did, SessionStatus, AuthInput, EthAuthInput, HandshakeResult } from "../types";
|
|
10
10
|
import { KycPollOptions, KycStatus } from "../types/kyc";
|
|
11
11
|
import { OtpChannel, OtpRequestInput, OtpRequestResult, OtpVerifyInput, OtpVerifyResult, SubmitUserInputArgs, SubmitUserInputResult } from "../types/user";
|
|
12
12
|
import { GetUsageOptions, UsagePage } from "../types/token";
|
|
@@ -82,6 +82,27 @@ export declare class T3nClient {
|
|
|
82
82
|
* 3. Sends `SubmitIdToken` with the nonce-bearing token → receives DID.
|
|
83
83
|
*/
|
|
84
84
|
authenticate(authInput: AuthInput): Promise<Did>;
|
|
85
|
+
/**
|
|
86
|
+
* Add an Ethereum wallet as an additional authenticator on the
|
|
87
|
+
* already-authenticated account.
|
|
88
|
+
*
|
|
89
|
+
* Proves control of the wallet via SIWE and links it to the session's
|
|
90
|
+
* EXISTING DID (resolved server-side from the session) — it does NOT
|
|
91
|
+
* mint a new DID and does NOT change the session: `this.did` and
|
|
92
|
+
* `this.status` are left untouched, and no new cookie is issued.
|
|
93
|
+
*
|
|
94
|
+
* Requires a completed {@link authenticate} first (e.g. an OIDC
|
|
95
|
+
* login). Only Ethereum is supported — OIDC/email identities are
|
|
96
|
+
* established at login, not added afterwards.
|
|
97
|
+
*
|
|
98
|
+
* Reuses the same client-side eth state machine as login, but posts
|
|
99
|
+
* to the authenticated `auth.add-authenticator` route. If the wallet
|
|
100
|
+
* is already linked to a different account, the server rejects with a
|
|
101
|
+
* typed `eth_auth_map_conflict` error (resolve via account merge).
|
|
102
|
+
*
|
|
103
|
+
* @returns the existing DID the wallet was linked to.
|
|
104
|
+
*/
|
|
105
|
+
addAuthMethod(authInput: EthAuthInput): Promise<Did>;
|
|
85
106
|
/**
|
|
86
107
|
* OIDC two-step authentication with session-binding nonce.
|
|
87
108
|
*
|
|
Binary file
|