@dynamic-labs/client 4.9.0 → 4.9.1

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,21 @@
1
1
 
2
+ ### [4.9.1](https://github.com/dynamic-labs/dynamic-auth/compare/v4.9.0...v4.9.1) (2025-03-11)
3
+
4
+
5
+ ### Features
6
+
7
+ * waas svm connector ([#8191](https://github.com/dynamic-labs/dynamic-auth/issues/8191)) ([049a360](https://github.com/dynamic-labs/dynamic-auth/commit/049a360642d6aa2122676c7a29d36a7baef9e49b))
8
+
9
+
10
+ ### Bug Fixes
11
+
12
+ * 7702 on sepolia ([#8242](https://github.com/dynamic-labs/dynamic-auth/issues/8242)) ([8e1c63f](https://github.com/dynamic-labs/dynamic-auth/commit/8e1c63f240024f419e12787636dd2ebaacf8da94))
13
+ * close auth flow when promptExport enabled but createWallet is false ([#8239](https://github.com/dynamic-labs/dynamic-auth/issues/8239)) ([f82429f](https://github.com/dynamic-labs/dynamic-auth/commit/f82429f85e729a76c2516f0db112033fdd2a36d5))
14
+ * fix solana genesis hashes bug that was causing a breaking change ([#8250](https://github.com/dynamic-labs/dynamic-auth/issues/8250)) ([731c93b](https://github.com/dynamic-labs/dynamic-auth/commit/731c93bea4b8b95caa8cc665f2ecb53f9948ef8e))
15
+ * move setup-inside-iframe utility method to the utils package ([#8256](https://github.com/dynamic-labs/dynamic-auth/issues/8256)) ([d34eb6d](https://github.com/dynamic-labs/dynamic-auth/commit/d34eb6d211baecb496b84fefaee8179a5fb1b52a))
16
+ * **QNTM-2952:** support headless social sign in ([#8226](https://github.com/dynamic-labs/dynamic-auth/issues/8226)) ([0c3082d](https://github.com/dynamic-labs/dynamic-auth/commit/0c3082d593c633519c9eed20be15186f18f65c09))
17
+ * sign message with trust wallet on solana ([#8249](https://github.com/dynamic-labs/dynamic-auth/issues/8249)) ([99a7917](https://github.com/dynamic-labs/dynamic-auth/commit/99a791796f7d2c83b9f18e45367aa9689c67869d))
18
+
2
19
  ## [4.9.0](https://github.com/dynamic-labs/dynamic-auth/compare/v4.8.6...v4.9.0) (2025-03-07)
3
20
 
4
21
 
package/package.cjs CHANGED
@@ -3,6 +3,6 @@
3
3
 
4
4
  Object.defineProperty(exports, '__esModule', { value: true });
5
5
 
6
- var version = "4.9.0";
6
+ var version = "4.9.1";
7
7
 
8
8
  exports.version = version;
package/package.js CHANGED
@@ -1,4 +1,4 @@
1
1
  'use client'
2
- var version = "4.9.0";
2
+ var version = "4.9.1";
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.9.0",
3
+ "version": "4.9.1",
4
4
  "description": "Core package for utilizing Dynamic's sdk",
5
5
  "author": "Dynamic Labs, Inc.",
6
6
  "license": "MIT",
@@ -19,10 +19,10 @@
19
19
  "homepage": "https://www.dynamic.xyz/",
20
20
  "dependencies": {
21
21
  "@vue/reactivity": "^3.4.21",
22
- "@dynamic-labs/assert-package-version": "4.9.0",
23
- "@dynamic-labs/logger": "4.9.0",
24
- "@dynamic-labs/message-transport": "4.9.0",
25
- "@dynamic-labs/types": "4.9.0",
22
+ "@dynamic-labs/assert-package-version": "4.9.1",
23
+ "@dynamic-labs/logger": "4.9.1",
24
+ "@dynamic-labs/message-transport": "4.9.1",
25
+ "@dynamic-labs/types": "4.9.1",
26
26
  "eventemitter3": "5.0.1"
27
27
  },
28
28
  "peerDependencies": {}
@@ -3,8 +3,8 @@
3
3
 
4
4
  Object.defineProperty(exports, '__esModule', { value: true });
5
5
 
6
- var logger = require('@dynamic-labs/logger');
7
6
  var authModule = require('../modules/authModule/authModule.cjs');
7
+ var instrumentationModule = require('../modules/instrumentationModule/instrumentationModule.cjs');
8
8
  var networksModule = require('../modules/networksModule/networksModule.cjs');
9
9
  var sdkModule = require('../modules/sdkModule/sdkModule.cjs');
10
10
  var userInterfaceModule = require('../modules/userInterfaceModule/userInterfaceModule.cjs');
@@ -22,11 +22,12 @@ const baseClientExtensionName = 'base';
22
22
  * it will be used for.
23
23
  */
24
24
  const createClient = (props) => {
25
- logger.Logger.setEnvironmentId(props.environmentId);
25
+ const instrumentation = instrumentationModule.setupInstrumentationModule(props);
26
26
  const core$1 = core.createCore(props);
27
+ instrumentation.trackCore(core$1);
27
28
  setupFetchHandler.setupFetchHandler(core$1);
28
29
  const baseExtendable = new Extendable.Extendable(core$1);
29
- return baseExtendable.extend(() => {
30
+ const client = baseExtendable.extend(() => {
30
31
  core$1.declaredExtensionNames.push(baseClientExtensionName);
31
32
  return {
32
33
  /** Module that gives access over authentication state, such as the auth token and user */
@@ -41,6 +42,8 @@ const createClient = (props) => {
41
42
  wallets: walletsModule.createWalletsModule(core$1),
42
43
  };
43
44
  });
45
+ instrumentation.trackClient(client);
46
+ return client;
44
47
  };
45
48
 
46
49
  exports.baseClientExtensionName = baseClientExtensionName;
@@ -1,6 +1,6 @@
1
1
  'use client'
2
- import { Logger } from '@dynamic-labs/logger';
3
2
  import { createAuthModule } from '../modules/authModule/authModule.js';
3
+ import { setupInstrumentationModule } from '../modules/instrumentationModule/instrumentationModule.js';
4
4
  import { createNetworksModule } from '../modules/networksModule/networksModule.js';
5
5
  import { createSdkModule } from '../modules/sdkModule/sdkModule.js';
6
6
  import { createUserInterfaceModule } from '../modules/userInterfaceModule/userInterfaceModule.js';
@@ -18,11 +18,12 @@ const baseClientExtensionName = 'base';
18
18
  * it will be used for.
19
19
  */
20
20
  const createClient = (props) => {
21
- Logger.setEnvironmentId(props.environmentId);
21
+ const instrumentation = setupInstrumentationModule(props);
22
22
  const core = createCore(props);
23
+ instrumentation.trackCore(core);
23
24
  setupFetchHandler(core);
24
25
  const baseExtendable = new Extendable(core);
25
- return baseExtendable.extend(() => {
26
+ const client = baseExtendable.extend(() => {
26
27
  core.declaredExtensionNames.push(baseClientExtensionName);
27
28
  return {
28
29
  /** Module that gives access over authentication state, such as the auth token and user */
@@ -37,6 +38,8 @@ const createClient = (props) => {
37
38
  wallets: createWalletsModule(core),
38
39
  };
39
40
  });
41
+ instrumentation.trackClient(client);
42
+ return client;
40
43
  };
41
44
 
42
45
  export { baseClientExtensionName, createClient };
@@ -3,6 +3,7 @@
3
3
 
4
4
  Object.defineProperty(exports, '__esModule', { value: true });
5
5
 
6
+ var reactivity = require('@vue/reactivity');
6
7
  var messageTransport = require('@dynamic-labs/message-transport');
7
8
  var initializationModule = require('./modules/initializationModule/initializationModule.cjs');
8
9
  var manifestModule = require('./modules/manifestModule/manifestModule.cjs');
@@ -29,7 +30,7 @@ const createCore = (props) => {
29
30
  * Ex: ViemExtension adds "viem" to the list, and WagmiExtension later
30
31
  * checks this list and throws an error if it doesn't find "viem" there.
31
32
  */
32
- declaredExtensionNames: [],
33
+ declaredExtensionNames: reactivity.reactive([]),
33
34
  /**
34
35
  * SDK initialization module handles the initialization error
35
36
  */
@@ -1,4 +1,5 @@
1
1
  'use client'
2
+ import { reactive } from '@vue/reactivity';
2
3
  import { applyDefaultMessageOrigin, makeWaitForInitEvent, sdkHasLoadedEventName, createMessageTransport } from '@dynamic-labs/message-transport';
3
4
  import { createInitializationModule } from './modules/initializationModule/initializationModule.js';
4
5
  import { createManifestModule } from './modules/manifestModule/manifestModule.js';
@@ -25,7 +26,7 @@ const createCore = (props) => {
25
26
  * Ex: ViemExtension adds "viem" to the list, and WagmiExtension later
26
27
  * checks this list and throws an error if it doesn't find "viem" there.
27
28
  */
28
- declaredExtensionNames: [],
29
+ declaredExtensionNames: reactive([]),
29
30
  /**
30
31
  * SDK initialization module handles the initialization error
31
32
  */
@@ -0,0 +1 @@
1
+ export * from './instrumentationModule';
@@ -0,0 +1,34 @@
1
+ 'use client'
2
+ 'use strict';
3
+
4
+ Object.defineProperty(exports, '__esModule', { value: true });
5
+
6
+ var reactivity = require('@vue/reactivity');
7
+ var logger = require('@dynamic-labs/logger');
8
+
9
+ const setupInstrumentationModule = (clientProps) => {
10
+ logger.Logger.setEnvironmentId(clientProps.environmentId);
11
+ logger.Logger.globalMetaData.set('platform-origin', 'host');
12
+ logger.Logger.globalMetaData.set('app-name', clientProps.appName);
13
+ return {
14
+ trackClient: (client) => {
15
+ client.sdk.on('loadedChanged', (loaded) => {
16
+ logger.Logger.globalMetaData.set('sdk-loaded', loaded);
17
+ });
18
+ client.auth.on('authenticatedUserChanged', (user) => {
19
+ logger.Logger.globalMetaData.set('user-id', user === null || user === void 0 ? void 0 : user.userId);
20
+ });
21
+ },
22
+ trackCore: (core) => {
23
+ reactivity.effect(() => {
24
+ logger.Logger.globalMetaData.set('declared-extension-names', core.declaredExtensionNames);
25
+ });
26
+ reactivity.effect(() => {
27
+ var _a;
28
+ logger.Logger.globalMetaData.set('initialization-error', (_a = core.initialization.error) === null || _a === void 0 ? void 0 : _a.toString());
29
+ });
30
+ },
31
+ };
32
+ };
33
+
34
+ exports.setupInstrumentationModule = setupInstrumentationModule;
@@ -0,0 +1,6 @@
1
+ import { BaseClient, ClientProps } from '../../client';
2
+ import { Core } from '../../client/core';
3
+ export declare const setupInstrumentationModule: (clientProps: ClientProps) => {
4
+ trackClient: (client: BaseClient) => void;
5
+ trackCore: (core: Core) => void;
6
+ };
@@ -0,0 +1,30 @@
1
+ 'use client'
2
+ import { effect } from '@vue/reactivity';
3
+ import { Logger } from '@dynamic-labs/logger';
4
+
5
+ const setupInstrumentationModule = (clientProps) => {
6
+ Logger.setEnvironmentId(clientProps.environmentId);
7
+ Logger.globalMetaData.set('platform-origin', 'host');
8
+ Logger.globalMetaData.set('app-name', clientProps.appName);
9
+ return {
10
+ trackClient: (client) => {
11
+ client.sdk.on('loadedChanged', (loaded) => {
12
+ Logger.globalMetaData.set('sdk-loaded', loaded);
13
+ });
14
+ client.auth.on('authenticatedUserChanged', (user) => {
15
+ Logger.globalMetaData.set('user-id', user === null || user === void 0 ? void 0 : user.userId);
16
+ });
17
+ },
18
+ trackCore: (core) => {
19
+ effect(() => {
20
+ Logger.globalMetaData.set('declared-extension-names', core.declaredExtensionNames);
21
+ });
22
+ effect(() => {
23
+ var _a;
24
+ Logger.globalMetaData.set('initialization-error', (_a = core.initialization.error) === null || _a === void 0 ? void 0 : _a.toString());
25
+ });
26
+ },
27
+ };
28
+ };
29
+
30
+ export { setupInstrumentationModule };
@@ -17,6 +17,10 @@ const createUserInterfaceModule = (core) => {
17
17
  hide: () => userInterfaceRequestChannel.emit('hideAuthFlow'),
18
18
  show: () => userInterfaceRequestChannel.emit('openAuthFlow'),
19
19
  },
20
+ fundingOptions: {
21
+ hide: () => userInterfaceRequestChannel.emit('hideFundingOptions'),
22
+ show: () => userInterfaceRequestChannel.emit('openFundingOptions'),
23
+ },
20
24
  userProfile: {
21
25
  hide: () => userInterfaceRequestChannel.emit('hideUserProfile'),
22
26
  show: () => userInterfaceRequestChannel.emit('openUserProfile'),
@@ -36,6 +36,22 @@ type UserInterfaceModuleMethods = {
36
36
  wallets: {
37
37
  revealEmbeddedWalletKey: UserInterfaceModuleMessages['revealEmbeddedWalletKey'];
38
38
  };
39
+ fundingOptions: {
40
+ /**
41
+ * Opens a screen with a list of funding options.
42
+ *
43
+ * Resolves when our SDK receives the request.
44
+ * Rejects if the request is not received.
45
+ */
46
+ show: () => Promise<void>;
47
+ /**
48
+ * Closes the funding options screen.
49
+ *
50
+ * Resolves when our SDK receives the request.
51
+ * Rejects if the request is not received.
52
+ */
53
+ hide: () => Promise<void>;
54
+ };
39
55
  };
40
56
  type PublicUserInterfaceModuleMessages = Pick<UserInterfaceModuleMessages, typeof userInterfaceEventNames[number]>;
41
57
  export type UserInterfaceModule = PickedEventListeners<PublicUserInterfaceModuleMessages> & UserInterfaceModuleMethods;
@@ -13,6 +13,10 @@ const createUserInterfaceModule = (core) => {
13
13
  hide: () => userInterfaceRequestChannel.emit('hideAuthFlow'),
14
14
  show: () => userInterfaceRequestChannel.emit('openAuthFlow'),
15
15
  },
16
+ fundingOptions: {
17
+ hide: () => userInterfaceRequestChannel.emit('hideFundingOptions'),
18
+ show: () => userInterfaceRequestChannel.emit('openFundingOptions'),
19
+ },
16
20
  userProfile: {
17
21
  hide: () => userInterfaceRequestChannel.emit('hideUserProfile'),
18
22
  show: () => userInterfaceRequestChannel.emit('openUserProfile'),