@dynamic-labs-sdk/assert-package-version 0.0.1-alpha.20

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 ADDED
@@ -0,0 +1,138 @@
1
+ ## 0.0.1-alpha.20 (2025-08-06)
2
+
3
+ ### 🚀 Features
4
+
5
+ - raise an error if different dynamic packages are on different versions ([#253](https://github.com/dynamic-labs/dynamic-sdk/pull/253))
6
+
7
+ ## 0.0.1-alpha.19 (2025-07-23)
8
+
9
+ This was a version bump only, there were no code changes.
10
+
11
+ ## 0.0.1-alpha.18 (2025-07-22)
12
+
13
+ This was a version bump only, there were no code changes.
14
+
15
+ ## 0.0.1-alpha.17 (2025-07-22)
16
+
17
+ This was a version bump only, there were no code changes.
18
+
19
+ ## 0.0.1-alpha.16 (2025-07-14)
20
+
21
+ ### 🚀 Features
22
+
23
+ - add new getMultichainBalances api method ([#219](https://github.com/dynamic-labs/dynamic-sdk/pull/219))
24
+ - adds authenticated event ([#222](https://github.com/dynamic-labs/dynamic-sdk/pull/222))
25
+
26
+ ## 0.0.1-alpha.15 (2025-07-14)
27
+
28
+ ### 🚀 Features
29
+
30
+ - **SIN-7:** Add Signin with Passkey ([#201](https://github.com/dynamic-labs/dynamic-sdk/pull/201))
31
+
32
+ ## 0.0.1-alpha.14 (2025-07-11)
33
+
34
+ ### 🩹 Fixes
35
+
36
+ - import zod mini using namespace ([#214](https://github.com/dynamic-labs/dynamic-sdk/pull/214))
37
+
38
+ ## 0.0.1-alpha.13 (2025-07-09)
39
+
40
+ ### 🩹 Fixes
41
+
42
+ - convert api headers to get api headers ([#211](https://github.com/dynamic-labs/dynamic-sdk/pull/211))
43
+
44
+ ## 0.0.1-alpha.12 (2025-07-09)
45
+
46
+ ### 🩹 Fixes
47
+
48
+ - allow the api call to include cookie credentials ([#209](https://github.com/dynamic-labs/dynamic-sdk/pull/209))
49
+
50
+ ## 0.0.1-alpha.11 (2025-07-08)
51
+
52
+ This was a version bump only, there were no code changes.
53
+
54
+ ## 0.0.1-alpha.10 (2025-07-08)
55
+
56
+ This was a version bump only, there were no code changes.
57
+
58
+ ## 0.0.1-alpha.9 (2025-07-08)
59
+
60
+ ### 🩹 Fixes
61
+
62
+ - throw when attempting to set undefined prop in storage ([#200](https://github.com/dynamic-labs/dynamic-sdk/pull/200))
63
+
64
+ ## 0.0.1-alpha.8 (2025-07-03)
65
+
66
+ This was a version bump only, there were no code changes.
67
+
68
+ ## 0.0.1-alpha.7 (2025-07-02)
69
+
70
+ ### 🩹 Fixes
71
+
72
+ - **mfa:** make device id optional ([#175](https://github.com/dynamic-labs/dynamic-sdk/pull/175))
73
+ - **mfa:** allow create mfa options to authTotpMfaDevice ([#178](https://github.com/dynamic-labs/dynamic-sdk/pull/178))
74
+
75
+ ## 0.0.1-alpha.6 (2025-06-30)
76
+
77
+ ### 🚀 Features
78
+
79
+ - add support for solana wallet standard ([#133](https://github.com/dynamic-labs/dynamic-sdk/pull/133))
80
+ - add support social sign in ([#123](https://github.com/dynamic-labs/dynamic-sdk/pull/123))
81
+ - add support for TOTP MFA ([#139](https://github.com/dynamic-labs/dynamic-sdk/pull/139))([#140](https://github.com/dynamic-labs/dynamic-sdk/pull/140))([#141](https://github.com/dynamic-labs/dynamic-sdk/pull/141))([#142](https://github.com/dynamic-labs/dynamic-sdk/pull/142))([#143](https://github.com/dynamic-labs/dynamic-sdk/pull/143))([#144](https://github.com/dynamic-labs/dynamic-sdk/pull/144))([#149](https://github.com/dynamic-labs/dynamic-sdk/pull/149))([#146](https://github.com/dynamic-labs/dynamic-sdk/pull/146))([#147](https://github.com/dynamic-labs/dynamic-sdk/pull/147))
82
+ - add methods to connect and verify a wallet ([#99](https://github.com/dynamic-labs/dynamic-sdk/pull/99))
83
+ - add signMessage ([#111](https://github.com/dynamic-labs/dynamic-sdk/pull/111))
84
+ - add primary wallet account ([#128](https://github.com/dynamic-labs/dynamic-sdk/pull/128))
85
+ - cache project settings for connected users ([#148](https://github.com/dynamic-labs/dynamic-sdk/pull/148))
86
+ - add updateUser function ([#138](https://github.com/dynamic-labs/dynamic-sdk/pull/138))
87
+
88
+ ### 🩹 Fixes
89
+
90
+ - use correct import path for commonjs ([#125](https://github.com/dynamic-labs/dynamic-sdk/pull/125))
91
+ - ensure change events are fired only when state changes ([#168](https://github.com/dynamic-labs/dynamic-sdk/pull/168))
92
+
93
+ ### 🔧 Refactors
94
+
95
+ - modularize DynamicCoreState with global interface ([#93](https://github.com/dynamic-labs/dynamic-sdk/pull/93))
96
+ - add setVerifyResponse ([#106](https://github.com/dynamic-labs/dynamic-sdk/pull/106))
97
+ - rename set verify response function ([#122](https://github.com/dynamic-labs/dynamic-sdk/pull/122))
98
+
99
+ ## 0.0.1-alpha.5 (2025-06-04)
100
+
101
+ ### 🩹 Fixes
102
+
103
+ - support server side rendering ([#92](https://github.com/dynamic-labs/dynamic-sdk/pull/92))
104
+
105
+ ## 0.0.1-alpha.4 (2025-05-28)
106
+
107
+ ### 🚀 Features
108
+
109
+ - allow manual init of client ([#88](https://github.com/dynamic-labs/dynamic-sdk/pull/88))
110
+
111
+ ### 🩹 Fixes
112
+
113
+ - client core accidentally sharing state among different instances ([#89](https://github.com/dynamic-labs/dynamic-sdk/pull/89))
114
+
115
+ ## 0.0.1-alpha.3 (2025-05-27)
116
+
117
+ ### 🩹 Fixes
118
+
119
+ - properly export state changed events ([#85](https://github.com/dynamic-labs/dynamic-sdk/pull/85))
120
+
121
+ ## 0.0.1-alpha.2 (2025-05-26)
122
+
123
+ ### 🚀 Features
124
+
125
+ - logout user when session expires ([#47](https://github.com/dynamic-labs/dynamic-sdk/pull/47))
126
+ - add sms verification ([#78](https://github.com/dynamic-labs/dynamic-sdk/pull/78))
127
+ - raise changed events for state variables ([#79](https://github.com/dynamic-labs/dynamic-sdk/pull/79))
128
+ - allow extending the client ([#80](https://github.com/dynamic-labs/dynamic-sdk/pull/80))
129
+
130
+ ## 0.0.1-alpha.1 (2025-05-19)
131
+
132
+ ### 🩹 Fixes
133
+
134
+ - make the client package public ([#74](https://github.com/dynamic-labs/dynamic-sdk/pull/74))
135
+
136
+ ## 0.0.1-alpha.0 (2025-05-16)
137
+
138
+ Initial release of the Dynamic SDK.
package/README.md ADDED
@@ -0,0 +1,35 @@
1
+ # @dynamic-labs/assert-package-version
2
+
3
+ Ensures all `@dynamic-labs/*` packages in your project are running on the same version.
4
+
5
+ ## What it does
6
+
7
+ - Automatically checks version consistency across all `@dynamic-labs` packages
8
+ - Logs detailed error messages when versions don't match
9
+ - Uses `@dynamic-labs/sdk-react-core` as the reference version
10
+
11
+ ## Error Example
12
+
13
+ ```
14
+ 🚨 Version Mismatch Error
15
+
16
+ Affected Packages:
17
+ - `@dynamic-labs/sdk-ui` (installed: **4.24.0**, required: **4.25.7**)
18
+
19
+ 💡 Update all @dynamic-labs/* packages to version `4.25.7` in your package.json
20
+ ```
21
+
22
+ ## Fix
23
+
24
+ 1. Update all `@dynamic-labs/*` packages in `package.json` to the same version
25
+ 2. Run `npm install` or `yarn install`
26
+ 3. Use `npx dynamic-doctor run` for additional checks
27
+
28
+ ## API
29
+
30
+ ```typescript
31
+ import { assertPackageVersion } from '@dynamic-labs/assert-package-version';
32
+
33
+ // Called internally by @dynamic-labs packages
34
+ assertPackageVersion('@dynamic-labs/sdk-react-core', '4.25.7');
35
+ ```
package/index.cjs.d.ts ADDED
@@ -0,0 +1 @@
1
+ export * from "./src/exports/index";
package/index.cjs.js ADDED
@@ -0,0 +1,66 @@
1
+ 'use strict';
2
+
3
+ class VersionMismatchError extends Error {
4
+ constructor(targetVersion, packageVersions){
5
+ // Identify packages with mismatched versions
6
+ const affectedPackages = Object.entries(packageVersions).filter(([, v])=>v !== targetVersion).map(([pkgName, installedVersion])=>`- \`${pkgName}\` (installed: **${installedVersion}**, required: **${targetVersion}**)`).join('\n');
7
+ // Error message template
8
+ const errorMessage = `
9
+ 🚨 Version Mismatch Error
10
+
11
+ One or more \`@dynamic-labs-sdk\` packages are installed with mismatched versions. All \`@dynamic-labs-sdk\` packages must be on the same version to work correctly.
12
+
13
+ Affected Packages:
14
+ ${affectedPackages}
15
+
16
+ 💡 To fix this issue, update all @dynamic-labs-sdk/* packages to version \`${targetVersion}\` in your package.json
17
+ `;
18
+ super(errorMessage.trim());
19
+ this.name = 'VersionMismatchError';
20
+ }
21
+ }
22
+
23
+ /**
24
+ * A mapping of package names to their versions.
25
+ */ let packageVersions = {};
26
+ /**
27
+ * Timeout ID for batching version checks.
28
+ */ let versionCheckTimeout = null;
29
+ /**
30
+ * Asserts that all `@dynamic-labs-sdk` packages are on the same version.
31
+ * Throws an error with instructions if versions mismatch.
32
+ *
33
+ * @param {string} packageName - The name of the package to assert.
34
+ * @param {string} version - The version of the package.
35
+ */ const assertPackageVersion = (packageName, version)=>{
36
+ // Update the package version mapping
37
+ packageVersions[packageName] = version;
38
+ // Clear any existing timeout
39
+ if (versionCheckTimeout) {
40
+ clearTimeout(versionCheckTimeout);
41
+ versionCheckTimeout = null;
42
+ }
43
+ /**
44
+ * Timeout is set to 100ms to ensure the following:
45
+ * - All package versions have been imported and registered.
46
+ */ const timeout = 100;
47
+ /**
48
+ * Set a timeout to batch the version check.
49
+ * This ensures that the check is executed after all package versions have been imported
50
+ * and registered.
51
+ */ versionCheckTimeout = setTimeout(()=>{
52
+ const versions = Object.values(packageVersions);
53
+ const [firstVersion] = versions;
54
+ const allSameVersion = versions.every((v)=>v === firstVersion);
55
+ if (!allSameVersion) {
56
+ // Determine the required (target) version
57
+ const targetVersion = packageVersions['@dynamic-labs-sdk/client'] || firstVersion;
58
+ const error = new VersionMismatchError(targetVersion, packageVersions);
59
+ // eslint-disable-next-line no-console
60
+ console.error(error);
61
+ }
62
+ versionCheckTimeout = null;
63
+ }, timeout);
64
+ };
65
+
66
+ exports.assertPackageVersion = assertPackageVersion;
package/index.esm.d.ts ADDED
@@ -0,0 +1 @@
1
+ export * from "./src/exports/index";
package/index.esm.js ADDED
@@ -0,0 +1,64 @@
1
+ class VersionMismatchError extends Error {
2
+ constructor(targetVersion, packageVersions){
3
+ // Identify packages with mismatched versions
4
+ const affectedPackages = Object.entries(packageVersions).filter(([, v])=>v !== targetVersion).map(([pkgName, installedVersion])=>`- \`${pkgName}\` (installed: **${installedVersion}**, required: **${targetVersion}**)`).join('\n');
5
+ // Error message template
6
+ const errorMessage = `
7
+ 🚨 Version Mismatch Error
8
+
9
+ One or more \`@dynamic-labs-sdk\` packages are installed with mismatched versions. All \`@dynamic-labs-sdk\` packages must be on the same version to work correctly.
10
+
11
+ Affected Packages:
12
+ ${affectedPackages}
13
+
14
+ 💡 To fix this issue, update all @dynamic-labs-sdk/* packages to version \`${targetVersion}\` in your package.json
15
+ `;
16
+ super(errorMessage.trim());
17
+ this.name = 'VersionMismatchError';
18
+ }
19
+ }
20
+
21
+ /**
22
+ * A mapping of package names to their versions.
23
+ */ let packageVersions = {};
24
+ /**
25
+ * Timeout ID for batching version checks.
26
+ */ let versionCheckTimeout = null;
27
+ /**
28
+ * Asserts that all `@dynamic-labs-sdk` packages are on the same version.
29
+ * Throws an error with instructions if versions mismatch.
30
+ *
31
+ * @param {string} packageName - The name of the package to assert.
32
+ * @param {string} version - The version of the package.
33
+ */ const assertPackageVersion = (packageName, version)=>{
34
+ // Update the package version mapping
35
+ packageVersions[packageName] = version;
36
+ // Clear any existing timeout
37
+ if (versionCheckTimeout) {
38
+ clearTimeout(versionCheckTimeout);
39
+ versionCheckTimeout = null;
40
+ }
41
+ /**
42
+ * Timeout is set to 100ms to ensure the following:
43
+ * - All package versions have been imported and registered.
44
+ */ const timeout = 100;
45
+ /**
46
+ * Set a timeout to batch the version check.
47
+ * This ensures that the check is executed after all package versions have been imported
48
+ * and registered.
49
+ */ versionCheckTimeout = setTimeout(()=>{
50
+ const versions = Object.values(packageVersions);
51
+ const [firstVersion] = versions;
52
+ const allSameVersion = versions.every((v)=>v === firstVersion);
53
+ if (!allSameVersion) {
54
+ // Determine the required (target) version
55
+ const targetVersion = packageVersions['@dynamic-labs-sdk/client'] || firstVersion;
56
+ const error = new VersionMismatchError(targetVersion, packageVersions);
57
+ // eslint-disable-next-line no-console
58
+ console.error(error);
59
+ }
60
+ versionCheckTimeout = null;
61
+ }, timeout);
62
+ };
63
+
64
+ export { assertPackageVersion };
package/package.json ADDED
@@ -0,0 +1,21 @@
1
+ {
2
+ "name": "@dynamic-labs-sdk/assert-package-version",
3
+ "version": "0.0.1-alpha.20",
4
+ "type": "module",
5
+ "main": "./index.cjs.js",
6
+ "module": "./index.esm.js",
7
+ "types": "./index.esm.d.ts",
8
+ "exports": {
9
+ "./package.json": "./package.json",
10
+ ".": {
11
+ "types": "./index.esm.d.ts",
12
+ "import": "./index.esm.js",
13
+ "default": "./index.cjs.js"
14
+ },
15
+ "./eip6963": {
16
+ "types": "./eip6963.esm.d.ts",
17
+ "import": "./eip6963.esm.js",
18
+ "default": "./eip6963.cjs.js"
19
+ }
20
+ }
21
+ }
@@ -0,0 +1,11 @@
1
+ /**
2
+ * Asserts that all `@dynamic-labs-sdk` packages are on the same version.
3
+ * Throws an error with instructions if versions mismatch.
4
+ *
5
+ * @param {string} packageName - The name of the package to assert.
6
+ * @param {string} version - The version of the package.
7
+ */
8
+ export declare const assertPackageVersion: (packageName: string, version: string) => void;
9
+ export declare const clearPackageVersionState: () => void;
10
+ export declare const getVersionCheckTimeout: () => NodeJS.Timeout | null;
11
+ //# sourceMappingURL=assertPackageVersion.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"assertPackageVersion.d.ts","sourceRoot":"","sources":["../../../../../packages/assert-package-version/src/assertPackageVersion/assertPackageVersion.ts"],"names":[],"mappings":"AAYA;;;;;;GAMG;AACH,eAAO,MAAM,oBAAoB,gBAClB,MAAM,WACV,MAAM,KACd,IAuCF,CAAC;AAIF,eAAO,MAAM,wBAAwB,QAAO,IAO3C,CAAC;AAEF,eAAO,MAAM,sBAAsB,QAAO,MAAM,CAAC,OAAO,GAAG,IACtC,CAAC"}
@@ -0,0 +1,2 @@
1
+ export { assertPackageVersion } from './assertPackageVersion.js';
2
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../packages/assert-package-version/src/assertPackageVersion/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,oBAAoB,EAAE,MAAM,2BAA2B,CAAC"}
@@ -0,0 +1,4 @@
1
+ export declare class VersionMismatchError extends Error {
2
+ constructor(targetVersion: string, packageVersions: Record<string, string>);
3
+ }
4
+ //# sourceMappingURL=VersionMismatchError.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"VersionMismatchError.d.ts","sourceRoot":"","sources":["../../../../../packages/assert-package-version/src/errors/VersionMismatchError.ts"],"names":[],"mappings":"AAAA,qBAAa,oBAAqB,SAAQ,KAAK;gBACjC,aAAa,EAAE,MAAM,EAAE,eAAe,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC;CA0B3E"}
@@ -0,0 +1,2 @@
1
+ export { assertPackageVersion } from '../assertPackageVersion';
2
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../packages/assert-package-version/src/exports/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,oBAAoB,EAAE,MAAM,yBAAyB,CAAC"}