@dynamic-labs/client 4.80.0 → 4.81.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,20 @@
1
1
 
2
+ ## [4.81.0](https://github.com/dynamic-labs/dynamic-auth/compare/v4.80.0...v4.81.0) (2026-05-07)
3
+
4
+
5
+ ### Features
6
+
7
+ * **react-native:** add waitForAuthSuccess() to auth module ([#11137](https://github.com/dynamic-labs/dynamic-auth/issues/11137)) ([089a566](https://github.com/dynamic-labs/dynamic-auth/commit/089a5663283639e7e425eead291b135010c8b398))
8
+ * **waas:** hook Aleo into DynamicWaasMixin ([#11102](https://github.com/dynamic-labs/dynamic-auth/issues/11102)) ([ff42df9](https://github.com/dynamic-labs/dynamic-auth/commit/ff42df99d8993e22894caee3c0570cd9c332a3d1))
9
+ * **widget:** shielded/unshielded tabs + Shield Manually CTA on ActiveWalletBalance for Aleo ([#11103](https://github.com/dynamic-labs/dynamic-auth/issues/11103)) ([e278836](https://github.com/dynamic-labs/dynamic-auth/commit/e278836bfcb19c13828c10483ebb87d165f5d00d))
10
+
11
+
12
+ ### Bug Fixes
13
+
14
+ * **ethereum-aa:** return hex chain ids from EIP-5792 getCapabilities ([#11146](https://github.com/dynamic-labs/dynamic-auth/issues/11146)) ([b32dc8f](https://github.com/dynamic-labs/dynamic-auth/commit/b32dc8f6fdee3722073921787c4f77908ab4f740))
15
+ * remediate high-severity dependency vulnerabilities ([#11151](https://github.com/dynamic-labs/dynamic-auth/issues/11151)) ([1d84ef1](https://github.com/dynamic-labs/dynamic-auth/commit/1d84ef12e10544be0b2a80dbbbd63f615b03adc3))
16
+ * **wagmi-connector:** emit change unconditionally on MM accountsChanged DYNT-549 ([#11131](https://github.com/dynamic-labs/dynamic-auth/issues/11131)) ([348ee6f](https://github.com/dynamic-labs/dynamic-auth/commit/348ee6ff9a22cb55ef0cb84c4b8f8d2e843bd10e)), closes [#11043](https://github.com/dynamic-labs/dynamic-auth/issues/11043)
17
+
2
18
  ## [4.80.0](https://github.com/dynamic-labs/dynamic-auth/compare/v4.79.2...v4.80.0) (2026-05-05)
3
19
 
4
20
 
package/package.cjs CHANGED
@@ -3,6 +3,6 @@
3
3
 
4
4
  Object.defineProperty(exports, '__esModule', { value: true });
5
5
 
6
- var version = "4.80.0";
6
+ var version = "4.81.0";
7
7
 
8
8
  exports.version = version;
package/package.js CHANGED
@@ -1,4 +1,4 @@
1
1
  'use client'
2
- var version = "4.80.0";
2
+ var version = "4.81.0";
3
3
 
4
4
  export { version };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@dynamic-labs/client",
3
- "version": "4.80.0",
3
+ "version": "4.81.0",
4
4
  "description": "Core package for utilizing Dynamic's sdk",
5
5
  "author": "Dynamic Labs, Inc.",
6
6
  "license": "MIT",
@@ -20,13 +20,13 @@
20
20
  "dependencies": {
21
21
  "@vue/reactivity": "^3.4.21",
22
22
  "@dynamic-labs/sdk-api-core": "0.0.964",
23
- "@dynamic-labs/assert-package-version": "4.80.0",
24
- "@dynamic-labs/locale": "4.80.0",
25
- "@dynamic-labs/logger": "4.80.0",
26
- "@dynamic-labs/message-transport": "4.80.0",
27
- "@dynamic-labs/types": "4.80.0",
28
- "@dynamic-labs/wallet-connector-core": "4.80.0",
29
- "@dynamic-labs/webview-messages": "4.80.0",
23
+ "@dynamic-labs/assert-package-version": "4.81.0",
24
+ "@dynamic-labs/locale": "4.81.0",
25
+ "@dynamic-labs/logger": "4.81.0",
26
+ "@dynamic-labs/message-transport": "4.81.0",
27
+ "@dynamic-labs/types": "4.81.0",
28
+ "@dynamic-labs/wallet-connector-core": "4.81.0",
29
+ "@dynamic-labs/webview-messages": "4.81.0",
30
30
  "eventemitter3": "5.0.1"
31
31
  },
32
32
  "peerDependencies": {}
package/src/index.d.ts CHANGED
@@ -4,7 +4,7 @@ export type { Wallet } from './types';
4
4
  export { Extendable, type Extension } from './utils/Extendable';
5
5
  export { hasExtension } from './utils/Extendable/hasExtension';
6
6
  export { createClient, type BaseClient, type ClientProps, baseClientExtensionName, } from './client';
7
- export type { AuthModule } from './modules/authModule';
7
+ export type { AuthModule, WaitForAuthSuccessOptions, } from './modules/authModule';
8
8
  export type { DeviceRegistrationModule } from './modules/deviceRegistrationModule';
9
9
  export type { LocaleModule } from './modules/localeModule';
10
10
  export type { MfaModule } from './modules/mfaModule';
@@ -5,6 +5,7 @@ Object.defineProperty(exports, '__esModule', { value: true });
5
5
 
6
6
  var messageTransport = require('@dynamic-labs/message-transport');
7
7
  var webviewMessages = require('@dynamic-labs/webview-messages');
8
+ var createWaitForAuthSuccess = require('../../utils/createWaitForAuthSuccess/createWaitForAuthSuccess.cjs');
8
9
  var pickListenerActions = require('../../utils/pickListenerActions/pickListenerActions.cjs');
9
10
  var emailAuthModule = require('./emailAuthModule/emailAuthModule.cjs');
10
11
  var externalAuthModule = require('./externalAuthModule/externalAuthModule.cjs');
@@ -33,7 +34,12 @@ const createAuthModule = (core) => {
33
34
  userAuthenticated: defaultAuthenticatedUserHandler,
34
35
  };
35
36
  requestChannel.handle('handleAuthenticatedUser', ({ user }) => handlers.userAuthenticated(user));
36
- return Object.assign(store.getters, pickListenerActions.pickListenerActions(messageEvents), {
37
+ const listenerActions = pickListenerActions.pickListenerActions(messageEvents);
38
+ const waitForAuthSuccess = createWaitForAuthSuccess.createWaitForAuthSuccess({
39
+ getAuthenticatedUser: () => store.getters.authenticatedUser,
40
+ listenerActions,
41
+ });
42
+ return Object.assign(store.getters, listenerActions, {
37
43
  clearHandler: () => (handlers.userAuthenticated = defaultAuthenticatedUserHandler),
38
44
  email: emailAuthModule.createEmailAuthModule(core),
39
45
  external: externalAuthModule.createExternalAuthModule(core),
@@ -47,6 +53,7 @@ const createAuthModule = (core) => {
47
53
  social: socialAuthModule.createSocialAuthModule(core),
48
54
  updateUser: (userFields) => requestChannel.request('updateUser', userFields),
49
55
  verifyUserUpdateOtp: (verificationToken) => requestChannel.request('verifyUserUpdateOtp', verificationToken),
56
+ waitForAuthSuccess,
50
57
  });
51
58
  };
52
59
 
@@ -2,12 +2,14 @@ import { PickedEventListeners, StoreEventListeners } from '@dynamic-labs/message
2
2
  import { AuthModuleMessages, AuthModuleState, authEventNames } from '@dynamic-labs/webview-messages';
3
3
  import type { UserProfile } from '@dynamic-labs/types';
4
4
  import { Core } from '../../client/core';
5
+ import { WaitForAuthSuccessOptions } from '../../utils/createWaitForAuthSuccess';
5
6
  import { EmailAuthModule } from './emailAuthModule';
6
7
  import { ExternalAuthModule } from './externalAuthModule';
7
8
  import { PasskeyAuthModule } from './passkeyAuthModule';
8
9
  import { SmsAuthModule } from './smsAuthModule';
9
10
  import { SocialAuthModule } from './socialAuthModule';
10
11
  type PublicAuthModuleMessages = Pick<AuthModuleMessages, typeof authEventNames[number]>;
12
+ export type { WaitForAuthSuccessOptions };
11
13
  export type AuthModule = AuthModuleState & StoreEventListeners<AuthModuleState> & PickedEventListeners<PublicAuthModuleMessages> & {
12
14
  passkey: PasskeyAuthModule;
13
15
  sms: SmsAuthModule;
@@ -22,7 +24,7 @@ export type AuthModule = AuthModuleState & StoreEventListeners<AuthModuleState>
22
24
  permanentlyDeleteCurrentUser: AuthModuleMessages['permanentlyDeleteCurrentUser'];
23
25
  setHandler: (name: 'userAuthenticated', handler: AuthenticatedUserHandler) => void;
24
26
  clearHandler: (name: 'userAuthenticated') => void;
27
+ waitForAuthSuccess: (options?: WaitForAuthSuccessOptions) => Promise<UserProfile>;
25
28
  };
26
29
  type AuthenticatedUserHandler = (user: UserProfile) => Promise<void>;
27
30
  export declare const createAuthModule: (core: Core) => AuthModule;
28
- export {};
@@ -1,6 +1,7 @@
1
1
  'use client'
2
2
  import { createStore, createEventEmitterForMessages, createRequestChannel } from '@dynamic-labs/message-transport';
3
3
  import { authEventNames } from '@dynamic-labs/webview-messages';
4
+ import { createWaitForAuthSuccess } from '../../utils/createWaitForAuthSuccess/createWaitForAuthSuccess.js';
4
5
  import { pickListenerActions } from '../../utils/pickListenerActions/pickListenerActions.js';
5
6
  import { createEmailAuthModule } from './emailAuthModule/emailAuthModule.js';
6
7
  import { createExternalAuthModule } from './externalAuthModule/externalAuthModule.js';
@@ -29,7 +30,12 @@ const createAuthModule = (core) => {
29
30
  userAuthenticated: defaultAuthenticatedUserHandler,
30
31
  };
31
32
  requestChannel.handle('handleAuthenticatedUser', ({ user }) => handlers.userAuthenticated(user));
32
- return Object.assign(store.getters, pickListenerActions(messageEvents), {
33
+ const listenerActions = pickListenerActions(messageEvents);
34
+ const waitForAuthSuccess = createWaitForAuthSuccess({
35
+ getAuthenticatedUser: () => store.getters.authenticatedUser,
36
+ listenerActions,
37
+ });
38
+ return Object.assign(store.getters, listenerActions, {
33
39
  clearHandler: () => (handlers.userAuthenticated = defaultAuthenticatedUserHandler),
34
40
  email: createEmailAuthModule(core),
35
41
  external: createExternalAuthModule(core),
@@ -43,6 +49,7 @@ const createAuthModule = (core) => {
43
49
  social: createSocialAuthModule(core),
44
50
  updateUser: (userFields) => requestChannel.request('updateUser', userFields),
45
51
  verifyUserUpdateOtp: (verificationToken) => requestChannel.request('verifyUserUpdateOtp', verificationToken),
52
+ waitForAuthSuccess,
46
53
  });
47
54
  };
48
55
 
@@ -8,7 +8,7 @@ var pickListenerActions = require('../../utils/pickListenerActions/pickListenerA
8
8
 
9
9
  const createNetworksModule = (core) => {
10
10
  const store = messageTransport.createStore({
11
- initialState: { evm: [], solana: [], sui: [] },
11
+ initialState: { bitcoin: [], evm: [], solana: [], sui: [], ton: [] },
12
12
  key: 'networks',
13
13
  messageTransport: core.messageTransport,
14
14
  });
@@ -4,7 +4,7 @@ import { pickListenerActions } from '../../utils/pickListenerActions/pickListene
4
4
 
5
5
  const createNetworksModule = (core) => {
6
6
  const store = createStore({
7
- initialState: { evm: [], solana: [], sui: [] },
7
+ initialState: { bitcoin: [], evm: [], solana: [], sui: [], ton: [] },
8
8
  key: 'networks',
9
9
  messageTransport: core.messageTransport,
10
10
  });
@@ -0,0 +1,63 @@
1
+ 'use client'
2
+ 'use strict';
3
+
4
+ Object.defineProperty(exports, '__esModule', { value: true });
5
+
6
+ const ALREADY_AUTHENTICATED_GRACE_PERIOD_MS = 500;
7
+ const createWaitForAuthSuccess = ({ listenerActions, getAuthenticatedUser, }) => (options) => new Promise((resolve, reject) => {
8
+ let settled = false;
9
+ let gracePeriodTimer;
10
+ let timeoutTimer;
11
+ const cleanup = () => {
12
+ settled = true;
13
+ listenerActions.off('authSuccess', onSuccess);
14
+ listenerActions.off('authFailed', onFailed);
15
+ if (gracePeriodTimer !== undefined) {
16
+ clearTimeout(gracePeriodTimer);
17
+ }
18
+ if (timeoutTimer !== undefined) {
19
+ clearTimeout(timeoutTimer);
20
+ }
21
+ };
22
+ const onSuccess = (user) => {
23
+ if (settled)
24
+ return;
25
+ cleanup();
26
+ resolve(user);
27
+ };
28
+ const buildFailedError = (reason) => {
29
+ if (reason === 'user-cancelled') {
30
+ return new Error('Authentication was cancelled by the user');
31
+ }
32
+ const message = reason.error instanceof Error
33
+ ? reason.error.message
34
+ : String(reason.error);
35
+ return new Error(`Authentication failed: ${message}`);
36
+ };
37
+ const onFailed = (_data, reason) => {
38
+ if (settled)
39
+ return;
40
+ cleanup();
41
+ reject(buildFailedError(reason));
42
+ };
43
+ listenerActions.on('authSuccess', onSuccess);
44
+ listenerActions.on('authFailed', onFailed);
45
+ if (getAuthenticatedUser()) {
46
+ gracePeriodTimer = setTimeout(() => {
47
+ if (settled)
48
+ return;
49
+ cleanup();
50
+ resolve(getAuthenticatedUser());
51
+ }, ALREADY_AUTHENTICATED_GRACE_PERIOD_MS);
52
+ }
53
+ if ((options === null || options === void 0 ? void 0 : options.timeout) !== undefined) {
54
+ timeoutTimer = setTimeout(() => {
55
+ if (settled)
56
+ return;
57
+ cleanup();
58
+ reject(new Error('waitForAuthSuccess timed out'));
59
+ }, options.timeout);
60
+ }
61
+ });
62
+
63
+ exports.createWaitForAuthSuccess = createWaitForAuthSuccess;
@@ -0,0 +1,13 @@
1
+ import { PickedEventListeners } from '@dynamic-labs/message-transport';
2
+ import { AuthModuleMessages } from '@dynamic-labs/webview-messages';
3
+ import type { UserProfile } from '@dynamic-labs/types';
4
+ export type WaitForAuthSuccessOptions = {
5
+ timeout?: number;
6
+ };
7
+ type RequiredAuthEvents = Pick<AuthModuleMessages, 'authSuccess' | 'authFailed'>;
8
+ type CreateWaitForAuthSuccessArgs<T extends RequiredAuthEvents = RequiredAuthEvents> = {
9
+ listenerActions: PickedEventListeners<T>;
10
+ getAuthenticatedUser: () => UserProfile | null;
11
+ };
12
+ export declare const createWaitForAuthSuccess: <T extends RequiredAuthEvents = RequiredAuthEvents>({ listenerActions, getAuthenticatedUser, }: CreateWaitForAuthSuccessArgs<T>) => (options?: WaitForAuthSuccessOptions) => Promise<UserProfile>;
13
+ export {};
@@ -0,0 +1,59 @@
1
+ 'use client'
2
+ const ALREADY_AUTHENTICATED_GRACE_PERIOD_MS = 500;
3
+ const createWaitForAuthSuccess = ({ listenerActions, getAuthenticatedUser, }) => (options) => new Promise((resolve, reject) => {
4
+ let settled = false;
5
+ let gracePeriodTimer;
6
+ let timeoutTimer;
7
+ const cleanup = () => {
8
+ settled = true;
9
+ listenerActions.off('authSuccess', onSuccess);
10
+ listenerActions.off('authFailed', onFailed);
11
+ if (gracePeriodTimer !== undefined) {
12
+ clearTimeout(gracePeriodTimer);
13
+ }
14
+ if (timeoutTimer !== undefined) {
15
+ clearTimeout(timeoutTimer);
16
+ }
17
+ };
18
+ const onSuccess = (user) => {
19
+ if (settled)
20
+ return;
21
+ cleanup();
22
+ resolve(user);
23
+ };
24
+ const buildFailedError = (reason) => {
25
+ if (reason === 'user-cancelled') {
26
+ return new Error('Authentication was cancelled by the user');
27
+ }
28
+ const message = reason.error instanceof Error
29
+ ? reason.error.message
30
+ : String(reason.error);
31
+ return new Error(`Authentication failed: ${message}`);
32
+ };
33
+ const onFailed = (_data, reason) => {
34
+ if (settled)
35
+ return;
36
+ cleanup();
37
+ reject(buildFailedError(reason));
38
+ };
39
+ listenerActions.on('authSuccess', onSuccess);
40
+ listenerActions.on('authFailed', onFailed);
41
+ if (getAuthenticatedUser()) {
42
+ gracePeriodTimer = setTimeout(() => {
43
+ if (settled)
44
+ return;
45
+ cleanup();
46
+ resolve(getAuthenticatedUser());
47
+ }, ALREADY_AUTHENTICATED_GRACE_PERIOD_MS);
48
+ }
49
+ if ((options === null || options === void 0 ? void 0 : options.timeout) !== undefined) {
50
+ timeoutTimer = setTimeout(() => {
51
+ if (settled)
52
+ return;
53
+ cleanup();
54
+ reject(new Error('waitForAuthSuccess timed out'));
55
+ }, options.timeout);
56
+ }
57
+ });
58
+
59
+ export { createWaitForAuthSuccess };
@@ -0,0 +1 @@
1
+ export * from './createWaitForAuthSuccess';