@dynamic-labs/client 4.0.0-alpha.1 → 4.0.0-alpha.3

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,26 @@
1
1
 
2
+ ## [4.0.0-alpha.3](https://github.com/dynamic-labs/DynamicAuth/compare/v4.0.0-alpha.2...v4.0.0-alpha.3) (2024-09-20)
3
+
4
+
5
+ ### Features
6
+
7
+ * developers provide global connectivity appkit project id ([#6941](https://github.com/dynamic-labs/DynamicAuth/issues/6941)) ([83760ea](https://github.com/dynamic-labs/DynamicAuth/commit/83760ea57591685b12caee945f173f6a7f9312d1))
8
+
9
+
10
+ ### Bug Fixes
11
+
12
+ * don't try to set up event listeners if wallet provider doesn't support it ([#6943](https://github.com/dynamic-labs/DynamicAuth/issues/6943)) ([439f1bb](https://github.com/dynamic-labs/DynamicAuth/commit/439f1bbb3c765959756cfc6eeb8429e4018e0379))
13
+ * dont verify all signatures for solana embedded multisig tx ([#6953](https://github.com/dynamic-labs/DynamicAuth/issues/6953)) ([7a7973e](https://github.com/dynamic-labs/DynamicAuth/commit/7a7973e05f0960421b348a55c6a00c9fd873b0b7))
14
+
15
+ ## [4.0.0-alpha.2](https://github.com/dynamic-labs/DynamicAuth/compare/v4.0.0-alpha.1...v4.0.0-alpha.2) (2024-09-18)
16
+
17
+
18
+ ### Features
19
+
20
+ * add iconVariant prop to DynamicBridgeWidget ([#6915](https://github.com/dynamic-labs/DynamicAuth/issues/6915)) ([8aa0f3d](https://github.com/dynamic-labs/DynamicAuth/commit/8aa0f3d8d8c41c7b5c4796106f611f208010cb6d))
21
+ * allow to create extra embedded wallets in react-native ([#6923](https://github.com/dynamic-labs/DynamicAuth/issues/6923)) ([ba22f7b](https://github.com/dynamic-labs/DynamicAuth/commit/ba22f7bcf41a444a4df0aff9b6aec257457e9402))
22
+ * **client:** add hide method for auth and userProfile ui modules ([#6928](https://github.com/dynamic-labs/DynamicAuth/issues/6928)) ([a11a4a5](https://github.com/dynamic-labs/DynamicAuth/commit/a11a4a5d6e25ce2a916ebd52f0b341020dc1a7e5))
23
+
2
24
  ## [4.0.0-alpha.1](https://github.com/dynamic-labs/DynamicAuth/compare/v4.0.0-alpha.0...v4.0.0-alpha.1) (2024-09-17)
3
25
 
4
26
 
package/package.cjs CHANGED
@@ -3,6 +3,6 @@
3
3
 
4
4
  Object.defineProperty(exports, '__esModule', { value: true });
5
5
 
6
- var version = "4.0.0-alpha.1";
6
+ var version = "4.0.0-alpha.3";
7
7
 
8
8
  exports.version = version;
package/package.js CHANGED
@@ -1,4 +1,4 @@
1
1
  'use client'
2
- var version = "4.0.0-alpha.1";
2
+ var version = "4.0.0-alpha.3";
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.0.0-alpha.1",
3
+ "version": "4.0.0-alpha.3",
4
4
  "repository": {
5
5
  "type": "git",
6
6
  "url": "git+https://github.com/dynamic-labs/dynamic-auth.git",
@@ -27,9 +27,9 @@
27
27
  },
28
28
  "dependencies": {
29
29
  "@vue/reactivity": "3.4.21",
30
- "@dynamic-labs/logger": "4.0.0-alpha.1",
31
- "@dynamic-labs/message-transport": "4.0.0-alpha.1",
32
- "@dynamic-labs/types": "4.0.0-alpha.1",
30
+ "@dynamic-labs/logger": "4.0.0-alpha.3",
31
+ "@dynamic-labs/message-transport": "4.0.0-alpha.3",
32
+ "@dynamic-labs/types": "4.0.0-alpha.3",
33
33
  "eventemitter3": "5.0.1"
34
34
  },
35
35
  "peerDependencies": {}
@@ -3,6 +3,7 @@
3
3
 
4
4
  Object.defineProperty(exports, '__esModule', { value: true });
5
5
 
6
+ var logger = require('@dynamic-labs/logger');
6
7
  var authModule = require('../modules/authModule/authModule.cjs');
7
8
  var networksModule = require('../modules/networksModule/networksModule.cjs');
8
9
  var sdkModule = require('../modules/sdkModule/sdkModule.cjs');
@@ -20,6 +21,7 @@ const baseClientExtensionName = 'base';
20
21
  * it will be used for.
21
22
  */
22
23
  const createClient = (props) => {
24
+ logger.Logger.setEnvironmentId(props.environmentId);
23
25
  const core$1 = core.createCore(props);
24
26
  const baseExtendable = new Extendable.Extendable(core$1);
25
27
  return baseExtendable.extend(() => {
@@ -1,4 +1,5 @@
1
1
  'use client'
2
+ import { Logger } from '@dynamic-labs/logger';
2
3
  import { createAuthModule } from '../modules/authModule/authModule.js';
3
4
  import { createNetworksModule } from '../modules/networksModule/networksModule.js';
4
5
  import { createSdkModule } from '../modules/sdkModule/sdkModule.js';
@@ -16,6 +17,7 @@ const baseClientExtensionName = 'base';
16
17
  * it will be used for.
17
18
  */
18
19
  const createClient = (props) => {
20
+ Logger.setEnvironmentId(props.environmentId);
19
21
  const core = createCore(props);
20
22
  const baseExtendable = new Extendable(core);
21
23
  return baseExtendable.extend(() => {
@@ -22,7 +22,7 @@ export declare const createCore: (props: ClientProps) => {
22
22
  */
23
23
  manifest: {
24
24
  setAppOrigin: (appOrigin: string) => string;
25
- setPlatform: (platform: "browser" | "react-native" | "flutter") => "browser" | "react-native" | "flutter";
25
+ setPlatform: (platform: "browser" | "react-native" | "flutter") => void;
26
26
  setRedirectUrl: (redirectUrl: string) => string;
27
27
  };
28
28
  /**
@@ -17,7 +17,12 @@ const createInitializationModule = (messageTransport$1) => {
17
17
  if (severity === 'fatal') {
18
18
  state.error = error;
19
19
  }
20
- logger.logger.error(error);
20
+ /**
21
+ * Uses regular console.error to log the error
22
+ * so we dont send the error to the backend twice
23
+ */
24
+ // eslint-disable-next-line no-console
25
+ console.error(error);
21
26
  });
22
27
  return {
23
28
  get error() {
@@ -25,6 +30,9 @@ const createInitializationModule = (messageTransport$1) => {
25
30
  },
26
31
  set error(error) {
27
32
  state.error = error;
33
+ /**
34
+ * Uses the logger so the error is sent to the backend
35
+ */
28
36
  logger.logger.error(state.error);
29
37
  },
30
38
  };
@@ -13,7 +13,12 @@ const createInitializationModule = (messageTransport) => {
13
13
  if (severity === 'fatal') {
14
14
  state.error = error;
15
15
  }
16
- logger.error(error);
16
+ /**
17
+ * Uses regular console.error to log the error
18
+ * so we dont send the error to the backend twice
19
+ */
20
+ // eslint-disable-next-line no-console
21
+ console.error(error);
17
22
  });
18
23
  return {
19
24
  get error() {
@@ -21,6 +26,9 @@ const createInitializationModule = (messageTransport) => {
21
26
  },
22
27
  set error(error) {
23
28
  state.error = error;
29
+ /**
30
+ * Uses the logger so the error is sent to the backend
31
+ */
24
32
  logger.error(state.error);
25
33
  },
26
34
  };
@@ -5,7 +5,8 @@ Object.defineProperty(exports, '__esModule', { value: true });
5
5
 
6
6
  var _tslib = require('../../../../../_virtual/_tslib.cjs');
7
7
  var messageTransport = require('@dynamic-labs/message-transport');
8
- var logger = require('../../../../utils/logger/logger.cjs');
8
+ var logger = require('@dynamic-labs/logger');
9
+ var logger$1 = require('../../../../utils/logger/logger.cjs');
9
10
  var createPartialManifest = require('./createPartialManifest/createPartialManifest.cjs');
10
11
  var validateManifest = require('./validateManifest/validateManifest.cjs');
11
12
 
@@ -20,7 +21,7 @@ const createManifestModule = (props, messageTransport$1, initializationModule) =
20
21
  return validateManifest.validateManifest(manifest);
21
22
  }
22
23
  catch (error) {
23
- logger.logger.error(error);
24
+ logger$1.logger.error(error);
24
25
  if (error instanceof Error)
25
26
  initializationModule.error = error;
26
27
  throw error;
@@ -28,7 +29,10 @@ const createManifestModule = (props, messageTransport$1, initializationModule) =
28
29
  }));
29
30
  return {
30
31
  setAppOrigin: (appOrigin) => (manifest.appOrigin = appOrigin),
31
- setPlatform: (platform) => (manifest.platform = platform),
32
+ setPlatform: (platform) => {
33
+ logger.Logger.globalMetaData.set('platform', platform);
34
+ manifest.platform = platform;
35
+ },
32
36
  setRedirectUrl: (redirectUrl) => (manifest.redirectUrl = redirectUrl),
33
37
  };
34
38
  };
@@ -6,6 +6,6 @@ import { InitializationModule } from '../initializationModule/initializationModu
6
6
  */
7
7
  export declare const createManifestModule: (props: ClientProps, messageTransport: MessageTransportWithDefaultOrigin, initializationModule: InitializationModule) => {
8
8
  setAppOrigin: (appOrigin: string) => string;
9
- setPlatform: (platform: ClientManifest['platform']) => "browser" | "react-native" | "flutter";
9
+ setPlatform: (platform: ClientManifest['platform']) => void;
10
10
  setRedirectUrl: (redirectUrl: string) => string;
11
11
  };
@@ -1,6 +1,7 @@
1
1
  'use client'
2
2
  import { __awaiter } from '../../../../../_virtual/_tslib.js';
3
3
  import { createRequestChannel } from '@dynamic-labs/message-transport';
4
+ import { Logger } from '@dynamic-labs/logger';
4
5
  import { logger } from '../../../../utils/logger/logger.js';
5
6
  import { createPartialManifest } from './createPartialManifest/createPartialManifest.js';
6
7
  import { validateManifest } from './validateManifest/validateManifest.js';
@@ -24,7 +25,10 @@ const createManifestModule = (props, messageTransport, initializationModule) =>
24
25
  }));
25
26
  return {
26
27
  setAppOrigin: (appOrigin) => (manifest.appOrigin = appOrigin),
27
- setPlatform: (platform) => (manifest.platform = platform),
28
+ setPlatform: (platform) => {
29
+ Logger.globalMetaData.set('platform', platform);
30
+ manifest.platform = platform;
31
+ },
28
32
  setRedirectUrl: (redirectUrl) => (manifest.redirectUrl = redirectUrl),
29
33
  };
30
34
  };
@@ -9,9 +9,11 @@ const createUserInterfaceModule = (core) => {
9
9
  const userInterfaceRequestChannel = messageTransport.createRequestChannel(core.messageTransport);
10
10
  return {
11
11
  auth: {
12
+ hide: () => userInterfaceRequestChannel.emit('hideAuthFlow'),
12
13
  show: () => userInterfaceRequestChannel.emit('openAuthFlow'),
13
14
  },
14
15
  userProfile: {
16
+ hide: () => userInterfaceRequestChannel.emit('hideUserProfile'),
15
17
  show: () => userInterfaceRequestChannel.emit('openUserProfile'),
16
18
  },
17
19
  wallets: {
@@ -9,6 +9,13 @@ export type UserInterfaceModule = {
9
9
  * Rejects if the request is not received.
10
10
  */
11
11
  show: () => Promise<void>;
12
+ /**
13
+ * Closes the auth flow UI.
14
+ *
15
+ * Resolves when our SDK receives the request.
16
+ * Rejects if the request is not received.
17
+ */
18
+ hide: () => Promise<void>;
12
19
  };
13
20
  userProfile: {
14
21
  /**
@@ -18,6 +25,13 @@ export type UserInterfaceModule = {
18
25
  * Rejects if the request is not received.
19
26
  */
20
27
  show: () => Promise<void>;
28
+ /**
29
+ * Closes the user profile UI.
30
+ *
31
+ * Resolves when our SDK receives the request.
32
+ * Rejects if the request is not received.
33
+ */
34
+ hide: () => Promise<void>;
21
35
  };
22
36
  wallets: {
23
37
  revealEmbeddedWalletKey: UserInterfaceModuleMessages['revealEmbeddedWalletKey'];
@@ -5,9 +5,11 @@ const createUserInterfaceModule = (core) => {
5
5
  const userInterfaceRequestChannel = createRequestChannel(core.messageTransport);
6
6
  return {
7
7
  auth: {
8
+ hide: () => userInterfaceRequestChannel.emit('hideAuthFlow'),
8
9
  show: () => userInterfaceRequestChannel.emit('openAuthFlow'),
9
10
  },
10
11
  userProfile: {
12
+ hide: () => userInterfaceRequestChannel.emit('hideUserProfile'),
11
13
  show: () => userInterfaceRequestChannel.emit('openUserProfile'),
12
14
  },
13
15
  wallets: {
@@ -21,7 +21,7 @@ const createEmbeddedWalletsModule = (core) => {
21
21
  });
22
22
  const requestChannel = messageTransport.createRequestChannel(core.messageTransport);
23
23
  return Object.assign(store.getters, pickListenerActions.pickListenerActions(messageEvents), {
24
- createWallet: () => requestChannel.request('createWallet'),
24
+ createWallet: (args) => requestChannel.request('createWallet', args),
25
25
  getWallet: () => requestChannel.request('getWallet'),
26
26
  });
27
27
  };
@@ -17,7 +17,7 @@ const createEmbeddedWalletsModule = (core) => {
17
17
  });
18
18
  const requestChannel = createRequestChannel(core.messageTransport);
19
19
  return Object.assign(store.getters, pickListenerActions(messageEvents), {
20
- createWallet: () => requestChannel.request('createWallet'),
20
+ createWallet: (args) => requestChannel.request('createWallet', args),
21
21
  getWallet: () => requestChannel.request('getWallet'),
22
22
  });
23
23
  };