@dynamic-labs/client 2.1.0-alpha.16 → 2.1.0-alpha.18

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,13 @@
1
1
 
2
+ ## [2.1.0-alpha.18](https://github.com/dynamic-labs/DynamicAuth/compare/v2.1.0-alpha.17...v2.1.0-alpha.18) (2024-05-15)
3
+
4
+ ## [2.1.0-alpha.17](https://github.com/dynamic-labs/DynamicAuth/compare/v2.1.0-alpha.16...v2.1.0-alpha.17) (2024-05-15)
5
+
6
+
7
+ ### Features
8
+
9
+ * add coinbaseWalletPreference prop ([#5607](https://github.com/dynamic-labs/DynamicAuth/issues/5607)) ([1ac3b2c](https://github.com/dynamic-labs/DynamicAuth/commit/1ac3b2ce7abb136465f4aa88b045dfb70d99aad7))
10
+
2
11
  ## [2.1.0-alpha.16](https://github.com/dynamic-labs/DynamicAuth/compare/v2.1.0-alpha.15...v2.1.0-alpha.16) (2024-05-14)
3
12
 
4
13
 
package/package.cjs CHANGED
@@ -3,6 +3,6 @@
3
3
 
4
4
  Object.defineProperty(exports, '__esModule', { value: true });
5
5
 
6
- var version = "2.1.0-alpha.16";
6
+ var version = "2.1.0-alpha.18";
7
7
 
8
8
  exports.version = version;
package/package.js CHANGED
@@ -1,4 +1,4 @@
1
1
  'use client'
2
- var version = "2.1.0-alpha.16";
2
+ var version = "2.1.0-alpha.18";
3
3
 
4
4
  export { version };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@dynamic-labs/client",
3
- "version": "2.1.0-alpha.16",
3
+ "version": "2.1.0-alpha.18",
4
4
  "repository": {
5
5
  "type": "git",
6
6
  "url": "https://github.com/dynamic-labs/DynamicAuth.git",
@@ -26,12 +26,12 @@
26
26
  "./package.json": "./package.json"
27
27
  },
28
28
  "dependencies": {
29
- "@dynamic-labs/message-transport": "2.1.0-alpha.16",
29
+ "@dynamic-labs/message-transport": "2.1.0-alpha.18",
30
30
  "@vue/reactivity": "3.4.21"
31
31
  },
32
32
  "peerDependencies": {
33
- "@dynamic-labs/logger": "2.1.0-alpha.16",
34
- "@dynamic-labs/types": "2.1.0-alpha.16",
33
+ "@dynamic-labs/logger": "2.1.0-alpha.18",
34
+ "@dynamic-labs/types": "2.1.0-alpha.18",
35
35
  "eventemitter3": "5.0.1"
36
36
  }
37
37
  }
@@ -18,13 +18,13 @@ var core = require('./core/core.cjs');
18
18
  * it will be used for.
19
19
  */
20
20
  const createClient = (props) => {
21
- const core$1 = core.createCore();
21
+ const core$1 = core.createCore(props);
22
22
  const baseExtendable = new Extendable.Extendable(core$1);
23
23
  return baseExtendable.extend(() => ({
24
24
  /** Module that gives access over authentication state, such as the auth token and user */
25
25
  auth: authModule.createAuthModule(core$1),
26
26
  /** Module that gives insight over the state of the SDK */
27
- sdk: sdkModule.createSdkModule(core$1, props),
27
+ sdk: sdkModule.createSdkModule(core$1),
28
28
  /** Module that provide access to UI features */
29
29
  ui: userInterfaceModule.createUserInterfaceModule(core$1),
30
30
  /** Module that provides access to user's wallets */
@@ -14,13 +14,13 @@ import { createCore } from './core/core.js';
14
14
  * it will be used for.
15
15
  */
16
16
  const createClient = (props) => {
17
- const core = createCore();
17
+ const core = createCore(props);
18
18
  const baseExtendable = new Extendable(core);
19
19
  return baseExtendable.extend(() => ({
20
20
  /** Module that gives access over authentication state, such as the auth token and user */
21
21
  auth: createAuthModule(core),
22
22
  /** Module that gives insight over the state of the SDK */
23
- sdk: createSdkModule(core, props),
23
+ sdk: createSdkModule(core),
24
24
  /** Module that provide access to UI features */
25
25
  ui: createUserInterfaceModule(core),
26
26
  /** Module that provides access to user's wallets */
@@ -5,6 +5,7 @@ Object.defineProperty(exports, '__esModule', { value: true });
5
5
 
6
6
  var messageTransport$1 = require('@dynamic-labs/message-transport');
7
7
  var initializationModule = require('./modules/initializationModule/initializationModule.cjs');
8
+ var manifestModule = require('./modules/manifestModule/manifestModule.cjs');
8
9
 
9
10
  const messageTransport = messageTransport$1.applyDefaultMessageOrigin({
10
11
  defaultOrigin: 'host',
@@ -18,7 +19,7 @@ const messageTransport = messageTransport$1.applyDefaultMessageOrigin({
18
19
  // messageTransport.on((message) =>
19
20
  // console.log('message', JSON.stringify(message, null, 2)),
20
21
  // );
21
- const createCore = () => ({
22
+ const createCore = (props) => ({
22
23
  /**
23
24
  * Allows an extension to add its name to the list, such that
24
25
  * other extensions are able to detect if it is present.
@@ -31,6 +32,10 @@ const createCore = () => ({
31
32
  * SDK initialization module handles the initialization error
32
33
  */
33
34
  initialization: initializationModule.createInitializationModule(messageTransport),
35
+ /**
36
+ * Manages the manifest of the host
37
+ */
38
+ manifest: manifestModule.createManifestModule(props, messageTransport),
34
39
  /**
35
40
  * Message transport that will be used to send and receive messages to the webview.
36
41
  * Should preferably be used with createRequestChannel, rather than used directly.
@@ -1,9 +1,10 @@
1
+ import { ClientProps } from '../client';
1
2
  /**
2
3
  * Holds properties and methods used by client extensions, but that we don't
3
4
  * want users to have access to.
4
5
  */
5
6
  export type Core = ReturnType<typeof createCore>;
6
- export declare const createCore: () => {
7
+ export declare const createCore: (props: ClientProps) => {
7
8
  /**
8
9
  * Allows an extension to add its name to the list, such that
9
10
  * other extensions are able to detect if it is present.
@@ -19,6 +20,12 @@ export declare const createCore: () => {
19
20
  get error(): Error | null;
20
21
  set error(error: Error);
21
22
  };
23
+ /**
24
+ * Manages the manifest of the host
25
+ */
26
+ manifest: {
27
+ setAppOrigin: (appOrigin: string) => string;
28
+ };
22
29
  /**
23
30
  * Message transport that will be used to send and receive messages to the webview.
24
31
  * Should preferably be used with createRequestChannel, rather than used directly.
@@ -1,6 +1,7 @@
1
1
  'use client'
2
2
  import { applyDefaultMessageOrigin, makeWaitForInitEvent, sdkHasLoadedEventName, createMessageTransport } from '@dynamic-labs/message-transport';
3
3
  import { createInitializationModule } from './modules/initializationModule/initializationModule.js';
4
+ import { createManifestModule } from './modules/manifestModule/manifestModule.js';
4
5
 
5
6
  const messageTransport = applyDefaultMessageOrigin({
6
7
  defaultOrigin: 'host',
@@ -14,7 +15,7 @@ const messageTransport = applyDefaultMessageOrigin({
14
15
  // messageTransport.on((message) =>
15
16
  // console.log('message', JSON.stringify(message, null, 2)),
16
17
  // );
17
- const createCore = () => ({
18
+ const createCore = (props) => ({
18
19
  /**
19
20
  * Allows an extension to add its name to the list, such that
20
21
  * other extensions are able to detect if it is present.
@@ -27,6 +28,10 @@ const createCore = () => ({
27
28
  * SDK initialization module handles the initialization error
28
29
  */
29
30
  initialization: createInitializationModule(messageTransport),
31
+ /**
32
+ * Manages the manifest of the host
33
+ */
34
+ manifest: createManifestModule(props, messageTransport),
30
35
  /**
31
36
  * Message transport that will be used to send and receive messages to the webview.
32
37
  * Should preferably be used with createRequestChannel, rather than used directly.
@@ -0,0 +1 @@
1
+ export { createManifestModule } from './manifestModule';
@@ -0,0 +1,22 @@
1
+ 'use client'
2
+ 'use strict';
3
+
4
+ Object.defineProperty(exports, '__esModule', { value: true });
5
+
6
+ var _tslib = require('../../../../../_virtual/_tslib.cjs');
7
+ var messageTransport = require('@dynamic-labs/message-transport');
8
+ var manifest = require('./utils/manifest/manifest.cjs');
9
+
10
+ /**
11
+ * Manifest module handles the client manifest that will be requested by the webview
12
+ */
13
+ const createManifestModule = (props, messageTransport$1) => {
14
+ const requestChannel = messageTransport.createRequestChannel(messageTransport$1);
15
+ const manifest$1 = manifest.createManifest(props);
16
+ requestChannel.handle('manifest', () => _tslib.__awaiter(void 0, void 0, void 0, function* () { return manifest$1; }));
17
+ return {
18
+ setAppOrigin: (appOrigin) => (manifest$1.appOrigin = appOrigin),
19
+ };
20
+ };
21
+
22
+ exports.createManifestModule = createManifestModule;
@@ -0,0 +1,8 @@
1
+ import { MessageTransportWithDefaultOrigin } from '@dynamic-labs/message-transport';
2
+ import { ClientProps } from '../../../client';
3
+ /**
4
+ * Manifest module handles the client manifest that will be requested by the webview
5
+ */
6
+ export declare const createManifestModule: (props: ClientProps, messageTransport: MessageTransportWithDefaultOrigin) => {
7
+ setAppOrigin: (appOrigin: string) => string;
8
+ };
@@ -0,0 +1,18 @@
1
+ 'use client'
2
+ import { __awaiter } from '../../../../../_virtual/_tslib.js';
3
+ import { createRequestChannel } from '@dynamic-labs/message-transport';
4
+ import { createManifest } from './utils/manifest/manifest.js';
5
+
6
+ /**
7
+ * Manifest module handles the client manifest that will be requested by the webview
8
+ */
9
+ const createManifestModule = (props, messageTransport) => {
10
+ const requestChannel = createRequestChannel(messageTransport);
11
+ const manifest = createManifest(props);
12
+ requestChannel.handle('manifest', () => __awaiter(void 0, void 0, void 0, function* () { return manifest; }));
13
+ return {
14
+ setAppOrigin: (appOrigin) => (manifest.appOrigin = appOrigin),
15
+ };
16
+ };
17
+
18
+ export { createManifestModule };
@@ -3,7 +3,7 @@
3
3
 
4
4
  Object.defineProperty(exports, '__esModule', { value: true });
5
5
 
6
- var _package = require('../../../../package.cjs');
6
+ var _package = require('../../../../../../../package.cjs');
7
7
 
8
8
  const createManifest = ({ apiBaseUrl, environmentId, appLogoUrl, appName, cssOverrides, }) => ({
9
9
  apiBaseUrl,
@@ -1,3 +1,3 @@
1
1
  import type { ClientManifest } from '@dynamic-labs/message-transport';
2
- import type { ClientProps } from '../../../client';
2
+ import type { ClientProps } from '../../../../..';
3
3
  export declare const createManifest: ({ apiBaseUrl, environmentId, appLogoUrl, appName, cssOverrides, }: ClientProps) => ClientManifest;
@@ -1,5 +1,5 @@
1
1
  'use client'
2
- import { version } from '../../../../package.js';
2
+ import { version } from '../../../../../../../package.js';
3
3
 
4
4
  const createManifest = ({ apiBaseUrl, environmentId, appLogoUrl, appName, cssOverrides, }) => ({
5
5
  apiBaseUrl,
@@ -3,15 +3,11 @@
3
3
 
4
4
  Object.defineProperty(exports, '__esModule', { value: true });
5
5
 
6
- var _tslib = require('../../../_virtual/_tslib.cjs');
7
6
  var messageTransport = require('@dynamic-labs/message-transport');
8
7
  var pickListenerActions = require('../../utils/pickListenerActions/pickListenerActions.cjs');
9
8
  var addProperty = require('../../utils/addProperty/addProperty.cjs');
10
- var manifest = require('./manifest/manifest.cjs');
11
9
 
12
- const createSdkModule = (core, props) => {
13
- const requestChannel = messageTransport.createRequestChannel(core.messageTransport);
14
- requestChannel.handle('manifest', () => _tslib.__awaiter(void 0, void 0, void 0, function* () { return manifest.createManifest(props); }));
10
+ const createSdkModule = (core) => {
15
11
  const store = messageTransport.createStore({
16
12
  initialState: {
17
13
  loaded: false,
@@ -1,7 +1,6 @@
1
1
  import { SdkModuleState, StoreEventListeners } from '@dynamic-labs/message-transport';
2
- import type { ClientProps } from '../../client';
3
2
  import { Core } from '../../client/core';
4
3
  export type SdkModule = SdkModuleState & StoreEventListeners<SdkModuleState> & {
5
4
  readonly error: Error | null;
6
5
  };
7
- export declare const createSdkModule: (core: Core, props: ClientProps) => SdkModule;
6
+ export declare const createSdkModule: (core: Core) => SdkModule;
@@ -1,13 +1,9 @@
1
1
  'use client'
2
- import { __awaiter } from '../../../_virtual/_tslib.js';
3
- import { createRequestChannel, createStore } from '@dynamic-labs/message-transport';
2
+ import { createStore } from '@dynamic-labs/message-transport';
4
3
  import { pickListenerActions } from '../../utils/pickListenerActions/pickListenerActions.js';
5
4
  import { addProperty } from '../../utils/addProperty/addProperty.js';
6
- import { createManifest } from './manifest/manifest.js';
7
5
 
8
- const createSdkModule = (core, props) => {
9
- const requestChannel = createRequestChannel(core.messageTransport);
10
- requestChannel.handle('manifest', () => __awaiter(void 0, void 0, void 0, function* () { return createManifest(props); }));
6
+ const createSdkModule = (core) => {
11
7
  const store = createStore({
12
8
  initialState: {
13
9
  loaded: false,