@dynamic-labs/waas 4.59.2 → 4.60.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/CHANGELOG.md CHANGED
@@ -1,4 +1,14 @@
1
1
 
2
+ ## [4.60.0](https://github.com/dynamic-labs/dynamic-auth/compare/v4.59.2...v4.60.0) (2026-02-05)
3
+
4
+
5
+ ### Features
6
+
7
+ * add prompt to unlock wallet when getting encrypted shares ([#10333](https://github.com/dynamic-labs/dynamic-auth/issues/10333)) ([7009dfa](https://github.com/dynamic-labs/dynamic-auth/commit/7009dfa315538f4f4ad27ff37e7902f10e1cf019))
8
+ * add stellar sendBalance method ([#10310](https://github.com/dynamic-labs/dynamic-auth/issues/10310)) ([c083ea0](https://github.com/dynamic-labs/dynamic-auth/commit/c083ea0a7caa0cb9095d32897acf677c1b661cb4))
9
+ * **webview-controller:** add DelegatedAccessController ([#10348](https://github.com/dynamic-labs/dynamic-auth/issues/10348)) ([57599e4](https://github.com/dynamic-labs/dynamic-auth/commit/57599e4dd1ad6f4b22f98d49d7fae1a724b719ee))
10
+ * **webview-messages:** add DelegatedAccessMessages types ([#10347](https://github.com/dynamic-labs/dynamic-auth/issues/10347)) ([b0a1275](https://github.com/dynamic-labs/dynamic-auth/commit/b0a12759016fa6f8a76753c2394d589acb18ccf1))
11
+
2
12
  ### [4.59.2](https://github.com/dynamic-labs/dynamic-auth/compare/v4.59.1...v4.59.2) (2026-02-03)
3
13
 
4
14
 
package/package.cjs CHANGED
@@ -3,6 +3,6 @@
3
3
 
4
4
  Object.defineProperty(exports, '__esModule', { value: true });
5
5
 
6
- var version = "4.59.2";
6
+ var version = "4.60.0";
7
7
 
8
8
  exports.version = version;
package/package.js CHANGED
@@ -1,4 +1,4 @@
1
1
  'use client'
2
- var version = "4.59.2";
2
+ var version = "4.60.0";
3
3
 
4
4
  export { version };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@dynamic-labs/waas",
3
- "version": "4.59.2",
3
+ "version": "4.60.0",
4
4
  "type": "module",
5
5
  "author": "Dynamic Labs, Inc.",
6
6
  "license": "MIT",
@@ -16,15 +16,15 @@
16
16
  "./package.json": "./package.json"
17
17
  },
18
18
  "dependencies": {
19
- "@dynamic-labs/assert-package-version": "4.59.2",
19
+ "@dynamic-labs/assert-package-version": "4.60.0",
20
20
  "@dynamic-labs/sdk-api-core": "0.0.860",
21
- "@dynamic-labs-wallet/browser-wallet-client": "0.0.254",
22
- "@dynamic-labs/ethereum-core": "4.59.2",
23
- "@dynamic-labs/logger": "4.59.2",
24
- "@dynamic-labs/solana-core": "4.59.2",
25
- "@dynamic-labs/sui-core": "4.59.2",
26
- "@dynamic-labs/utils": "4.59.2",
27
- "@dynamic-labs/wallet-book": "4.59.2"
21
+ "@dynamic-labs-wallet/browser-wallet-client": "0.0.259",
22
+ "@dynamic-labs/ethereum-core": "4.60.0",
23
+ "@dynamic-labs/logger": "4.60.0",
24
+ "@dynamic-labs/solana-core": "4.60.0",
25
+ "@dynamic-labs/sui-core": "4.60.0",
26
+ "@dynamic-labs/utils": "4.60.0",
27
+ "@dynamic-labs/wallet-book": "4.60.0"
28
28
  },
29
29
  "peerDependencies": {}
30
30
  }
@@ -37,6 +37,43 @@ const withDynamicWaas = (BaseClass) => {
37
37
  setGetMfaTokenFunction(getMfaToken) {
38
38
  this.getMfaToken = getMfaToken;
39
39
  }
40
+ setGetPasswordForSigningFunction(getPasswordForSigning) {
41
+ this.getPasswordForSigning = getPasswordForSigning;
42
+ }
43
+ /**
44
+ * Checks if the wallet needs a password for signing operations.
45
+ * Returns the password if needed, or undefined if the wallet is already unlocked.
46
+ * Automatically retrieves the signed session ID internally.
47
+ */
48
+ getPasswordIfNeeded(_a) {
49
+ return _tslib.__awaiter(this, arguments, void 0, function* ({ accountAddress, }) {
50
+ var _b;
51
+ const signedSessionId = yield ((_b = this.getSignedSessionId) === null || _b === void 0 ? void 0 : _b.call(this));
52
+ if (!signedSessionId) {
53
+ throw new utils.DynamicError('Signed session ID is required');
54
+ }
55
+ const recoveryState = yield this.getWalletRecoveryState({
56
+ accountAddress,
57
+ signedSessionId,
58
+ });
59
+ // If wallet is ready (already unlocked), no password needed
60
+ if (recoveryState.walletReadyState === 'ready') {
61
+ return undefined;
62
+ }
63
+ // Wallet is encrypted and needs to be unlocked
64
+ if (!this.getPasswordForSigning) {
65
+ throw new utils.DynamicError('Wallet is locked but no password provider is configured');
66
+ }
67
+ const password = yield this.getPasswordForSigning({
68
+ accountAddress,
69
+ chainName: this.chainName,
70
+ });
71
+ if (!password) {
72
+ throw new utils.DynamicError('Password is required to sign with this wallet');
73
+ }
74
+ return password;
75
+ });
76
+ }
40
77
  setEnvironmentId(environmentId) {
41
78
  this.environmentId = environmentId;
42
79
  }
@@ -440,10 +477,11 @@ const withDynamicWaas = (BaseClass) => {
440
477
  });
441
478
  }
442
479
  getWalletRecoveryState(_a) {
443
- return _tslib.__awaiter(this, arguments, void 0, function* ({ accountAddress, }) {
480
+ return _tslib.__awaiter(this, arguments, void 0, function* ({ accountAddress, signedSessionId, }) {
444
481
  const walletClient = yield this.getWaasWalletClient();
445
482
  return walletClient.getWalletRecoveryState({
446
483
  accountAddress,
484
+ signedSessionId,
447
485
  });
448
486
  });
449
487
  }
@@ -2,6 +2,10 @@ import { BitcoinConfig, DynamicWalletClient } from '@dynamic-labs-wallet/browser
2
2
  import { InstrumentOptions, Logger } from '@dynamic-labs/logger';
3
3
  import { MFAAction } from '@dynamic-labs/sdk-api-core';
4
4
  import { InstrumentContext, InstrumentationTimer, TraceContext } from '../utils/instrumentation';
5
+ export type GetPasswordForSigningFn = (props: {
6
+ accountAddress: string;
7
+ chainName: string;
8
+ }) => Promise<string | undefined>;
5
9
  export declare class WaasExportHandler {
6
10
  private iframeStamper;
7
11
  setIframeStamper(iframe: HTMLIFrameElement): void;
@@ -16,6 +20,7 @@ export declare const withDynamicWaas: <T extends abstract new (...args: any[]) =
16
20
  getMfaToken?: ((props?: {
17
21
  mfaAction?: MFAAction;
18
22
  }) => Promise<string | undefined>) | undefined;
23
+ getPasswordForSigning?: GetPasswordForSigningFn | undefined;
19
24
  getAuthToken?: (() => string) | undefined;
20
25
  environmentId?: string | undefined;
21
26
  baseApiUrl?: string | undefined;
@@ -32,6 +37,15 @@ export declare const withDynamicWaas: <T extends abstract new (...args: any[]) =
32
37
  setGetMfaTokenFunction(getMfaToken: (props?: {
33
38
  mfaAction?: MFAAction;
34
39
  }) => Promise<string | undefined>): void;
40
+ setGetPasswordForSigningFunction(getPasswordForSigning: GetPasswordForSigningFn): void;
41
+ /**
42
+ * Checks if the wallet needs a password for signing operations.
43
+ * Returns the password if needed, or undefined if the wallet is already unlocked.
44
+ * Automatically retrieves the signed session ID internally.
45
+ */
46
+ getPasswordIfNeeded({ accountAddress, }: {
47
+ accountAddress: string;
48
+ }): Promise<string | undefined>;
35
49
  setEnvironmentId(environmentId: string): void;
36
50
  setBaseApiUrl(baseApiUrl: string): void;
37
51
  setBaseClientKeysharesRelayApiUrl(baseClientKeysharesRelayApiUrl?: string): void;
@@ -116,8 +130,9 @@ export declare const withDynamicWaas: <T extends abstract new (...args: any[]) =
116
130
  accountAddress: string;
117
131
  password: string;
118
132
  }): Promise<import("@dynamic-labs-wallet/browser-wallet-client").GetWalletResponse>;
119
- getWalletRecoveryState({ accountAddress, }: {
133
+ getWalletRecoveryState({ accountAddress, signedSessionId, }: {
120
134
  accountAddress: string;
135
+ signedSessionId: string;
121
136
  }): Promise<import("@dynamic-labs-wallet/browser-wallet-client").WalletRecoveryState>;
122
137
  endSession(): Promise<void>;
123
138
  getActiveAccountAddress(): Promise<string | undefined>;
@@ -33,6 +33,43 @@ const withDynamicWaas = (BaseClass) => {
33
33
  setGetMfaTokenFunction(getMfaToken) {
34
34
  this.getMfaToken = getMfaToken;
35
35
  }
36
+ setGetPasswordForSigningFunction(getPasswordForSigning) {
37
+ this.getPasswordForSigning = getPasswordForSigning;
38
+ }
39
+ /**
40
+ * Checks if the wallet needs a password for signing operations.
41
+ * Returns the password if needed, or undefined if the wallet is already unlocked.
42
+ * Automatically retrieves the signed session ID internally.
43
+ */
44
+ getPasswordIfNeeded(_a) {
45
+ return __awaiter(this, arguments, void 0, function* ({ accountAddress, }) {
46
+ var _b;
47
+ const signedSessionId = yield ((_b = this.getSignedSessionId) === null || _b === void 0 ? void 0 : _b.call(this));
48
+ if (!signedSessionId) {
49
+ throw new DynamicError('Signed session ID is required');
50
+ }
51
+ const recoveryState = yield this.getWalletRecoveryState({
52
+ accountAddress,
53
+ signedSessionId,
54
+ });
55
+ // If wallet is ready (already unlocked), no password needed
56
+ if (recoveryState.walletReadyState === 'ready') {
57
+ return undefined;
58
+ }
59
+ // Wallet is encrypted and needs to be unlocked
60
+ if (!this.getPasswordForSigning) {
61
+ throw new DynamicError('Wallet is locked but no password provider is configured');
62
+ }
63
+ const password = yield this.getPasswordForSigning({
64
+ accountAddress,
65
+ chainName: this.chainName,
66
+ });
67
+ if (!password) {
68
+ throw new DynamicError('Password is required to sign with this wallet');
69
+ }
70
+ return password;
71
+ });
72
+ }
36
73
  setEnvironmentId(environmentId) {
37
74
  this.environmentId = environmentId;
38
75
  }
@@ -436,10 +473,11 @@ const withDynamicWaas = (BaseClass) => {
436
473
  });
437
474
  }
438
475
  getWalletRecoveryState(_a) {
439
- return __awaiter(this, arguments, void 0, function* ({ accountAddress, }) {
476
+ return __awaiter(this, arguments, void 0, function* ({ accountAddress, signedSessionId, }) {
440
477
  const walletClient = yield this.getWaasWalletClient();
441
478
  return walletClient.getWalletRecoveryState({
442
479
  accountAddress,
480
+ signedSessionId,
443
481
  });
444
482
  });
445
483
  }