@terminal3/t3n-sdk 1.0.0 → 1.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.
package/dist/index.d.ts CHANGED
@@ -763,6 +763,62 @@ declare class T3nClient {
763
763
  * the response is not a JSON string / `null`.
764
764
  */
765
765
  getSelfEthAddress(): Promise<string | null>;
766
+ /**
767
+ * Enumerate every wallet the authenticated user currently controls
768
+ * under T3-TS-028 multi-wallet custody.
769
+ *
770
+ * `primary` is the identity-bearing wallet — same address
771
+ * {@link getSelfEthAddress} returns, same address the host signs
772
+ * with under `sign-as-user`. `secondary` is an insertion-ordered
773
+ * list of archival wallets absorbed through prior
774
+ * {@link mergeProfiles} calls (most recent last); these are signable
775
+ * only via an explicit sign-with-wallet flow — never ambient.
776
+ *
777
+ * Backed by `tee:user/list-user-wallets` which delegates to the
778
+ * signing host's `list-user-wallets` primitive. See T3-TS-028 §7.1.
779
+ *
780
+ * @throws if unauthenticated, if the node rejects the action, or if
781
+ * the response shape is unexpected.
782
+ */
783
+ listUserWallets(): Promise<{
784
+ primary: string;
785
+ secondary: string[];
786
+ }>;
787
+ /**
788
+ * Return the ownership audit trail for a specific wallet address.
789
+ *
790
+ * The response is an array of `AuditEntry` objects (newest last)
791
+ * describing every DID that has owned the wallet: `Created` at DID
792
+ * creation, `MergedFrom { source_did }` for every merge that pulled
793
+ * this wallet onto a new owner, `Abandoned` if
794
+ * {@link removeUserWithWalletAbandonment} was called on the last
795
+ * owner. Public-safe data: DIDs + timestamps + reason codes only,
796
+ * no key material or PII. See T3-TS-028 §4.1.
797
+ *
798
+ * @param walletAddress 0x-prefixed 40-char hex Ethereum address.
799
+ * @throws if the node rejects the action or if the response is not
800
+ * a JSON array.
801
+ */
802
+ getWalletHistory(walletAddress: string): Promise<unknown[]>;
803
+ /**
804
+ * Remove the authenticated user's account AND explicitly abandon
805
+ * any wallets. Writes `Abandoned` audit rows to wallet history,
806
+ * clears the DID's wallet index, then runs the usual user-removal
807
+ * cleanup (profile, authenticators, VCs, attribution).
808
+ *
809
+ * `wallet_secrets[*]` is NOT deleted — key material stays preserved
810
+ * in the TEE but becomes unreachable from any DID. This path
811
+ * exists as an opt-in alternative to {@link removeUser}, which
812
+ * refuses when the DID owns wallets. Callers must sweep funds
813
+ * off-chain BEFORE calling this if they want to retain access —
814
+ * the host does not reconcile balances. See T3-TS-028 §6.2.
815
+ *
816
+ * Requires the session to be Authenticated (SelfOnly delegation).
817
+ *
818
+ * @throws if unauthenticated, if the node rejects the action, or if
819
+ * the response cannot be decoded.
820
+ */
821
+ removeUserWithWalletAbandonment(): Promise<unknown>;
766
822
  /**
767
823
  * The server-minted session ID once handshake has completed, or
768
824
  * `null` beforehand (pentest M-1 / MAT-983).
@@ -961,7 +1017,7 @@ declare function redactSecretsFromJson(jsonString: string): string;
961
1017
  /**
962
1018
  * Environment type for SDK configuration
963
1019
  */
964
- type Environment = "local" | "staging" | "production" | "test";
1020
+ type Environment = "local" | "staging" | "testnet" | "production" | "test";
965
1021
  /**
966
1022
  * SDK configuration structure
967
1023
  */