@terminal3/t3n-sdk 3.0.0 → 3.2.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.
@@ -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;
@@ -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
  *
@@ -20,6 +20,7 @@ export type { KycStatus, KycStatusKind, KycPollOptions, KycPollCadence, } from "
20
20
  export { DEFAULT_KYC_POLL_CADENCE, TERMINAL_KYC_STATUSES, KycStatusTimeoutError, } from "./types/kyc";
21
21
  export type { OtpChannel, OtpRequestInput, OtpRequestResult, OtpVerifyInput, OtpVerifyResult, OtpMergeSuggestion, UserInputProfile, SubmitUserInputArgs, SubmitUserInputResult, TenantAdmitProjection, TenantAdmitStatus, UserUpsertErrorKind, } from "./types/user";
22
22
  export { UserUpsertError } from "./types/user";
23
+ export type { UsagePage, UsageEntry, GetUsageOptions, BalanceRow, TokenTxKind, Direction, ChargeReason, } from "./types/token";
23
24
  export { OrgDataClient, SessionOrgDataClient, createOrgDataClientFromSession, } from "./client/org-data";
24
25
  export type { OrgDataClientOptions, CreatePolicyInput, UpdateMetaInput, SetWritersInput, SetGrantsInput, DeleteGrantsInput, WriteDataInput, DeleteDataInput, DeleteScopeInput, PolicyGetInput, WritersGetInput, GrantsGetInput, DataListInput, DataGetInput, ExecuteOrgDataActionOptions, } from "./client/org-data";
25
26
  export type { OrgDataActionWire, OrgPolicyMeta, OrgWriters, OrgContractGrants, UserGrant, EmployeeRecord, EmploymentStatus, ResidencyCategory, AgeBand, ExpenseClaim, MutationResponse, DataListResponse, DataGetResponse, } from "./types/org-data";