@dynamic-labs/client 3.0.0-alpha.13 → 3.0.0-alpha.14

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,41 @@
1
1
 
2
+ ## [3.0.0-alpha.14](https://github.com/dynamic-labs/DynamicAuth/compare/v3.0.0-alpha.13...v3.0.0-alpha.14) (2024-07-09)
3
+
4
+
5
+ ### ⚠ BREAKING CHANGES
6
+
7
+ * remove setPrimaryWallet in favor of useSwitchWallet (#6212)
8
+ * move getBalance method to wallet so it can be fetched for any wallet not just the active one (#6200)
9
+ * make Wallet a class instead of just a type (#6094)
10
+
11
+ ### Features
12
+
13
+ * add @dynamic-labs/solana-extension ([#6140](https://github.com/dynamic-labs/DynamicAuth/issues/6140)) ([c0e2a06](https://github.com/dynamic-labs/DynamicAuth/commit/c0e2a067dd83163094b58a15696df8654da47c65))
14
+ * add solana support for multi-asset ([#6222](https://github.com/dynamic-labs/DynamicAuth/issues/6222)) ([9660d79](https://github.com/dynamic-labs/DynamicAuth/commit/9660d7962f1fb01011d68397bb367fdfc5335ca9))
15
+
16
+
17
+ ### Bug Fixes
18
+
19
+ * allow closing re-connect wallet modal ([#6250](https://github.com/dynamic-labs/DynamicAuth/issues/6250)) ([55ba25b](https://github.com/dynamic-labs/DynamicAuth/commit/55ba25bd3e907629aaa26e788885bfa38f8fe350))
20
+ * move getBalance method to wallet so it can be fetched for any wallet not just the active one ([#6200](https://github.com/dynamic-labs/DynamicAuth/issues/6200)) ([ee94773](https://github.com/dynamic-labs/DynamicAuth/commit/ee94773df9b31462a325666760fcf1fc70dec68a))
21
+ * move getNameService method to wallet so name service data can be fetched for any wallet ([#6205](https://github.com/dynamic-labs/DynamicAuth/issues/6205)) ([6671ae9](https://github.com/dynamic-labs/DynamicAuth/commit/6671ae92532ffc1889e24519e75f47d336ac0da6))
22
+ * relax phone number length validation ([#6226](https://github.com/dynamic-labs/DynamicAuth/issues/6226)) ([f0969b4](https://github.com/dynamic-labs/DynamicAuth/commit/f0969b4fbdafde07125cddecb16b4bfd011ea65e))
23
+ * sdkHasLoaded flipping back to false with otp ([#6242](https://github.com/dynamic-labs/DynamicAuth/issues/6242)) ([32ad9dd](https://github.com/dynamic-labs/DynamicAuth/commit/32ad9dd2dae7775f494506773fb343fe1a249c65))
24
+ * send transaction demo undefined address/value ([#6248](https://github.com/dynamic-labs/DynamicAuth/issues/6248)) ([036a511](https://github.com/dynamic-labs/DynamicAuth/commit/036a511fb848ef461edd9b7a5d79d478b0f1cf23))
25
+ * set last active account on accountChange request ([#6218](https://github.com/dynamic-labs/DynamicAuth/issues/6218)) ([05797d2](https://github.com/dynamic-labs/DynamicAuth/commit/05797d292aab8b4de02555594d4d1bbd4c9543eb))
26
+ * show ledger toggle when linking wallet ([#6202](https://github.com/dynamic-labs/DynamicAuth/issues/6202)) ([a449c0b](https://github.com/dynamic-labs/DynamicAuth/commit/a449c0bfc4e3a75ccd7084b930c48fbd6c14f691))
27
+ * show user wallet in profile view on single wallet mode even if it's not primary ([#6187](https://github.com/dynamic-labs/DynamicAuth/issues/6187)) ([ffaaeb2](https://github.com/dynamic-labs/DynamicAuth/commit/ffaaeb2c6cbb2868a381d85451ae5574024156bb))
28
+ * stop auto-switching to connected secondary wallet if primary wallet is not connected ([#6196](https://github.com/dynamic-labs/DynamicAuth/issues/6196)) ([4e8bcd2](https://github.com/dynamic-labs/DynamicAuth/commit/4e8bcd2d02d3fca54a0ed29c45b386ae99266b84))
29
+ * stop coinbase and solflare popups when secondary ([#6225](https://github.com/dynamic-labs/DynamicAuth/issues/6225)) ([7e9c104](https://github.com/dynamic-labs/DynamicAuth/commit/7e9c1049a09c9fd513c9a2a746d6baac916f1bf4))
30
+ * stop sending double sign request on network switch ([e325709](https://github.com/dynamic-labs/DynamicAuth/commit/e325709bb5d2d1331fe16cc705398fc7b1cc292a))
31
+ * tunrkey solana signer accept uint8array message ([#6137](https://github.com/dynamic-labs/DynamicAuth/issues/6137)) ([70f89ce](https://github.com/dynamic-labs/DynamicAuth/commit/70f89ce0dafa4c99b318c9c5adce59083cd6d284))
32
+ * update formatting of phantom bitcoin publickey ([#6210](https://github.com/dynamic-labs/DynamicAuth/issues/6210)) ([f58cea9](https://github.com/dynamic-labs/DynamicAuth/commit/f58cea99333fd7c6af8f56f637ee32f1f7ce8d76))
33
+ * use white color in farcaster qr code when in dark mode ([#6245](https://github.com/dynamic-labs/DynamicAuth/issues/6245)) ([a91958d](https://github.com/dynamic-labs/DynamicAuth/commit/a91958d8773be138da8f54791c4c67866257bbad))
34
+
35
+
36
+ * make Wallet a class instead of just a type ([#6094](https://github.com/dynamic-labs/DynamicAuth/issues/6094)) ([6dc4672](https://github.com/dynamic-labs/DynamicAuth/commit/6dc4672951cfadc22a6c569e74eae3485bd472f3))
37
+ * remove setPrimaryWallet in favor of useSwitchWallet ([#6212](https://github.com/dynamic-labs/DynamicAuth/issues/6212)) ([de125e1](https://github.com/dynamic-labs/DynamicAuth/commit/de125e1ebbc20507e4ec07f337f5f5fd13aabcbe))
38
+
2
39
  ## [3.0.0-alpha.13](https://github.com/dynamic-labs/DynamicAuth/compare/v3.0.0-alpha.12...v3.0.0-alpha.13) (2024-06-27)
3
40
 
4
41
 
package/package.cjs CHANGED
@@ -3,6 +3,6 @@
3
3
 
4
4
  Object.defineProperty(exports, '__esModule', { value: true });
5
5
 
6
- var version = "3.0.0-alpha.13";
6
+ var version = "3.0.0-alpha.14";
7
7
 
8
8
  exports.version = version;
package/package.js CHANGED
@@ -1,4 +1,4 @@
1
1
  'use client'
2
- var version = "3.0.0-alpha.13";
2
+ var version = "3.0.0-alpha.14";
3
3
 
4
4
  export { version };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@dynamic-labs/client",
3
- "version": "3.0.0-alpha.13",
3
+ "version": "3.0.0-alpha.14",
4
4
  "repository": {
5
5
  "type": "git",
6
6
  "url": "git+https://github.com/dynamic-labs/dynamic-auth.git",
@@ -26,12 +26,12 @@
26
26
  "./package.json": "./package.json"
27
27
  },
28
28
  "dependencies": {
29
- "@dynamic-labs/message-transport": "3.0.0-alpha.13",
29
+ "@dynamic-labs/message-transport": "3.0.0-alpha.14",
30
30
  "@vue/reactivity": "3.4.21"
31
31
  },
32
32
  "peerDependencies": {
33
- "@dynamic-labs/logger": "3.0.0-alpha.13",
34
- "@dynamic-labs/types": "3.0.0-alpha.13",
33
+ "@dynamic-labs/logger": "3.0.0-alpha.14",
34
+ "@dynamic-labs/types": "3.0.0-alpha.14",
35
35
  "eventemitter3": "5.0.1"
36
36
  }
37
37
  }
@@ -11,6 +11,7 @@ var walletsModule = require('../modules/walletsModule/walletsModule.cjs');
11
11
  var Extendable = require('../utils/Extendable/Extendable.cjs');
12
12
  var core = require('./core/core.cjs');
13
13
 
14
+ const baseClientExtensionName = 'base';
14
15
  /**
15
16
  * Generates a basic client that allows interacting with Dynamic's SDK, which
16
17
  * will be rendered inside a webview.
@@ -21,18 +22,22 @@ var core = require('./core/core.cjs');
21
22
  const createClient = (props) => {
22
23
  const core$1 = core.createCore(props);
23
24
  const baseExtendable = new Extendable.Extendable(core$1);
24
- return baseExtendable.extend(() => ({
25
- /** Module that gives access over authentication state, such as the auth token and user */
26
- auth: authModule.createAuthModule(core$1),
27
- /** Module that provides all the networks configured */
28
- networks: networksModule.createNetworksModule(core$1),
29
- /** Module that gives insight over the state of the SDK */
30
- sdk: sdkModule.createSdkModule(core$1),
31
- /** Module that provide access to UI features */
32
- ui: userInterfaceModule.createUserInterfaceModule(core$1),
33
- /** Module that provides access to user's wallets */
34
- wallets: walletsModule.createWalletsModule(core$1),
35
- }));
25
+ return baseExtendable.extend(() => {
26
+ core$1.declaredExtensionNames.push(baseClientExtensionName);
27
+ return {
28
+ /** Module that gives access over authentication state, such as the auth token and user */
29
+ auth: authModule.createAuthModule(core$1),
30
+ /** Module that provides all the networks configured */
31
+ networks: networksModule.createNetworksModule(core$1),
32
+ /** Module that gives insight over the state of the SDK */
33
+ sdk: sdkModule.createSdkModule(core$1),
34
+ /** Module that provide access to UI features */
35
+ ui: userInterfaceModule.createUserInterfaceModule(core$1),
36
+ /** Module that provides access to user's wallets */
37
+ wallets: walletsModule.createWalletsModule(core$1),
38
+ };
39
+ });
36
40
  };
37
41
 
42
+ exports.baseClientExtensionName = baseClientExtensionName;
38
43
  exports.createClient = createClient;
@@ -1,4 +1,5 @@
1
1
  import { Extendable } from '../utils/Extendable';
2
+ export declare const baseClientExtensionName = "base";
2
3
  export type BaseClient = ReturnType<typeof createClient>;
3
4
  export type ClientProps = {
4
5
  environmentId: string;
@@ -7,6 +7,7 @@ import { createWalletsModule } from '../modules/walletsModule/walletsModule.js';
7
7
  import { Extendable } from '../utils/Extendable/Extendable.js';
8
8
  import { createCore } from './core/core.js';
9
9
 
10
+ const baseClientExtensionName = 'base';
10
11
  /**
11
12
  * Generates a basic client that allows interacting with Dynamic's SDK, which
12
13
  * will be rendered inside a webview.
@@ -17,18 +18,21 @@ import { createCore } from './core/core.js';
17
18
  const createClient = (props) => {
18
19
  const core = createCore(props);
19
20
  const baseExtendable = new Extendable(core);
20
- return baseExtendable.extend(() => ({
21
- /** Module that gives access over authentication state, such as the auth token and user */
22
- auth: createAuthModule(core),
23
- /** Module that provides all the networks configured */
24
- networks: createNetworksModule(core),
25
- /** Module that gives insight over the state of the SDK */
26
- sdk: createSdkModule(core),
27
- /** Module that provide access to UI features */
28
- ui: createUserInterfaceModule(core),
29
- /** Module that provides access to user's wallets */
30
- wallets: createWalletsModule(core),
31
- }));
21
+ return baseExtendable.extend(() => {
22
+ core.declaredExtensionNames.push(baseClientExtensionName);
23
+ return {
24
+ /** Module that gives access over authentication state, such as the auth token and user */
25
+ auth: createAuthModule(core),
26
+ /** Module that provides all the networks configured */
27
+ networks: createNetworksModule(core),
28
+ /** Module that gives insight over the state of the SDK */
29
+ sdk: createSdkModule(core),
30
+ /** Module that provide access to UI features */
31
+ ui: createUserInterfaceModule(core),
32
+ /** Module that provides access to user's wallets */
33
+ wallets: createWalletsModule(core),
34
+ };
35
+ });
32
36
  };
33
37
 
34
- export { createClient };
38
+ export { baseClientExtensionName, createClient };
package/src/index.cjs CHANGED
@@ -4,9 +4,12 @@
4
4
  Object.defineProperty(exports, '__esModule', { value: true });
5
5
 
6
6
  var Extendable = require('./utils/Extendable/Extendable.cjs');
7
+ var hasExtension = require('./utils/Extendable/hasExtension/hasExtension.cjs');
7
8
  var client = require('./client/client.cjs');
8
9
 
9
10
 
10
11
 
11
12
  exports.Extendable = Extendable.Extendable;
13
+ exports.hasExtension = hasExtension.hasExtension;
14
+ exports.baseClientExtensionName = client.baseClientExtensionName;
12
15
  exports.createClient = client.createClient;
package/src/index.d.ts CHANGED
@@ -2,7 +2,8 @@ export type { SocialProvider } from '@dynamic-labs/message-transport';
2
2
  export type { BaseWallet as Wallet } from '@dynamic-labs/types';
3
3
  export { type Core } from './client/core';
4
4
  export { Extendable, type Extension } from './utils/Extendable';
5
- export { createClient, type BaseClient, type ClientProps } from './client';
5
+ export { hasExtension } from './utils/Extendable/hasExtension';
6
+ export { createClient, type BaseClient, type ClientProps, baseClientExtensionName, } from './client';
6
7
  export type { AuthModule } from './modules/authModule';
7
8
  export type { SdkModule } from './modules/sdkModule';
8
9
  export type { WalletsModule } from './modules/walletsModule';
package/src/index.js CHANGED
@@ -1,3 +1,4 @@
1
1
  'use client'
2
2
  export { Extendable } from './utils/Extendable/Extendable.js';
3
- export { createClient } from './client/client.js';
3
+ export { hasExtension } from './utils/Extendable/hasExtension/hasExtension.js';
4
+ export { baseClientExtensionName, createClient } from './client/client.js';
@@ -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: [] },
11
+ initialState: { evm: [], solana: [] },
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: [] },
7
+ initialState: { evm: [], solana: [] },
8
8
  key: 'networks',
9
9
  messageTransport: core.messageTransport,
10
10
  });
@@ -0,0 +1,14 @@
1
+ 'use client'
2
+ 'use strict';
3
+
4
+ Object.defineProperty(exports, '__esModule', { value: true });
5
+
6
+ /**
7
+ * This method allows safely type casting an Extendable object to include an extension type.
8
+ *
9
+ * It assumes you are checking if the target extension has declared its name to the core,
10
+ * and if that name is found in core's declaredExtensionNames, it will complete the type cast.
11
+ */
12
+ const hasExtension = (extendable, core, extensionName) => core.declaredExtensionNames.includes(extensionName);
13
+
14
+ exports.hasExtension = hasExtension;
@@ -0,0 +1,10 @@
1
+ 'use client'
2
+ /**
3
+ * This method allows safely type casting an Extendable object to include an extension type.
4
+ *
5
+ * It assumes you are checking if the target extension has declared its name to the core,
6
+ * and if that name is found in core's declaredExtensionNames, it will complete the type cast.
7
+ */
8
+ const hasExtension = (extendable, core, extensionName) => core.declaredExtensionNames.includes(extensionName);
9
+
10
+ export { hasExtension };
@@ -0,0 +1 @@
1
+ export { hasExtension } from './hasExtension';