@dynamic-labs/utils 4.78.0 → 4.79.0

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.79.0](https://github.com/dynamic-labs/dynamic-auth/compare/v4.78.1...v4.79.0) (2026-04-30)
3
+
4
+
5
+ ### Features
6
+
7
+ * **sdk-react-core:** two-layer Google Drive backup access defense [DYNT-754] ([#11069](https://github.com/dynamic-labs/dynamic-auth/issues/11069)) ([1ff8b83](https://github.com/dynamic-labs/dynamic-auth/commit/1ff8b83f9c7ba077c586513a250f6aed114e4b07))
8
+
9
+
10
+ ### Bug Fixes
11
+
12
+ * **solana-core,sui-core:** prevent RangeError on send balance ([#11071](https://github.com/dynamic-labs/dynamic-auth/issues/11071)) ([21f5f97](https://github.com/dynamic-labs/dynamic-auth/commit/21f5f9724c788053774ce5eaa19f073af9a33d27))
13
+
14
+ ### [4.78.1](https://github.com/dynamic-labs/dynamic-auth/compare/v4.78.0...v4.78.1) (2026-04-29)
15
+
16
+
17
+ ### Bug Fixes
18
+
19
+ * **ci:** do not fail on heroku check ([#11054](https://github.com/dynamic-labs/dynamic-auth/issues/11054)) ([fa92c8d](https://github.com/dynamic-labs/dynamic-auth/commit/fa92c8d3770f17802a3d3c4b28fbd72595eff78e))
20
+ * **demo-v2:** gate step-up sign on the actual signing connector (covers ZeroDev over WaaS) ([#11021](https://github.com/dynamic-labs/dynamic-auth/issues/11021)) ([2d7df88](https://github.com/dynamic-labs/dynamic-auth/commit/2d7df884f28013fe53b2f331a6d0f625a0313ff4))
21
+ * remediate high-severity dependency vulnerabilities ([#11039](https://github.com/dynamic-labs/dynamic-auth/issues/11039)) ([55315d9](https://github.com/dynamic-labs/dynamic-auth/commit/55315d92d2b956259b454b888db55bf552e16348)), closes [#498](https://github.com/dynamic-labs/dynamic-auth/issues/498) [#499](https://github.com/dynamic-labs/dynamic-auth/issues/499) [#538](https://github.com/dynamic-labs/dynamic-auth/issues/538) [#256](https://github.com/dynamic-labs/dynamic-auth/issues/256) [#132](https://github.com/dynamic-labs/dynamic-auth/issues/132) [#132](https://github.com/dynamic-labs/dynamic-auth/issues/132) [#11011](https://github.com/dynamic-labs/dynamic-auth/issues/11011) [#10991](https://github.com/dynamic-labs/dynamic-auth/issues/10991)
22
+ * remediate high-severity dependency vulnerabilities ([#11060](https://github.com/dynamic-labs/dynamic-auth/issues/11060)) ([514b8d6](https://github.com/dynamic-labs/dynamic-auth/commit/514b8d60d1436c765388c3a93877c562a6e6b105))
23
+
2
24
  ## [4.78.0](https://github.com/dynamic-labs/dynamic-auth/compare/v4.77.4...v4.78.0) (2026-04-22)
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.78.0";
6
+ var version = "4.79.0";
7
7
 
8
8
  exports.version = version;
package/package.js CHANGED
@@ -1,4 +1,4 @@
1
1
  'use client'
2
- var version = "4.78.0";
2
+ var version = "4.79.0";
3
3
 
4
4
  export { version };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@dynamic-labs/utils",
3
- "version": "4.78.0",
3
+ "version": "4.79.0",
4
4
  "description": "A React SDK for implementing wallet web3 authentication and authorization to your website.",
5
5
  "author": "Dynamic Labs, Inc.",
6
6
  "license": "MIT",
@@ -18,11 +18,11 @@
18
18
  },
19
19
  "homepage": "https://www.dynamic.xyz/",
20
20
  "dependencies": {
21
- "@dynamic-labs/sdk-api-core": "0.0.927",
21
+ "@dynamic-labs/sdk-api-core": "0.0.956",
22
22
  "tldts": "6.0.16",
23
- "@dynamic-labs/assert-package-version": "4.78.0",
24
- "@dynamic-labs/logger": "4.78.0",
25
- "@dynamic-labs/types": "4.78.0",
23
+ "@dynamic-labs/assert-package-version": "4.79.0",
24
+ "@dynamic-labs/logger": "4.79.0",
25
+ "@dynamic-labs/types": "4.79.0",
26
26
  "buffer": "6.0.3",
27
27
  "eventemitter3": "5.0.1"
28
28
  },
package/src/index.cjs CHANGED
@@ -110,6 +110,7 @@ var createStorageService = require('./services/StorageService/createStorageServi
110
110
  require('./services/StorageService/storageEvents.cjs');
111
111
  var applyPostfixToStorageService = require('./services/StorageService/applyPostfixToStorageService/applyPostfixToStorageService.cjs');
112
112
  var connectWithAppleId = require('./services/Oauth2Service/utils/connectWithAppleId/connectWithAppleId.cjs');
113
+ var parseAmountToSmallestUnit = require('./parseAmountToSmallestUnit/parseAmountToSmallestUnit.cjs');
113
114
  var solToLamports = require('./solToLamports/solToLamports.cjs');
114
115
  var getEnvVarWithFallback = require('./env/getEnvVarWithFallback.cjs');
115
116
  var setupInsideIframe = require('./setupInsideIframe/setupInsideIframe.cjs');
@@ -245,6 +246,7 @@ exports.StorageService = StorageService.StorageService;
245
246
  exports.createStorageService = createStorageService.createStorageService;
246
247
  exports.applyPostfixToStorageService = applyPostfixToStorageService.applyPostfixToStorageService;
247
248
  exports.connectWithAppleId = connectWithAppleId.connectWithAppleId;
249
+ exports.parseAmountToSmallestUnit = parseAmountToSmallestUnit.parseAmountToSmallestUnit;
248
250
  exports.solToLamports = solToLamports.solToLamports;
249
251
  exports.getEnvVarWithFallback = getEnvVarWithFallback.getEnvVarWithFallback;
250
252
  exports.setupInsideIframe = setupInsideIframe.setupInsideIframe;
package/src/index.d.ts CHANGED
@@ -46,6 +46,7 @@ export { FetchService } from './services/FetchService';
46
46
  export { Oauth2Service, type GetOauthCodeError, type GetOauthCodeProps, type IOauth2Service, createWindowOauth2Service, } from './services/Oauth2Service';
47
47
  export { type IStorageService, type StorageOptions, StorageService, createStorageService, applyPostfixToStorageService, } from './services/StorageService';
48
48
  export { connectWithAppleId } from './services/Oauth2Service/utils/connectWithAppleId';
49
+ export { parseAmountToSmallestUnit } from './parseAmountToSmallestUnit';
49
50
  export { solToLamports } from './solToLamports';
50
51
  export { getEnvVarWithFallback } from './env/getEnvVarWithFallback';
51
52
  export { setupInsideIframe } from './setupInsideIframe';
package/src/index.js CHANGED
@@ -106,6 +106,7 @@ export { createStorageService } from './services/StorageService/createStorageSer
106
106
  import './services/StorageService/storageEvents.js';
107
107
  export { applyPostfixToStorageService } from './services/StorageService/applyPostfixToStorageService/applyPostfixToStorageService.js';
108
108
  export { connectWithAppleId } from './services/Oauth2Service/utils/connectWithAppleId/connectWithAppleId.js';
109
+ export { parseAmountToSmallestUnit } from './parseAmountToSmallestUnit/parseAmountToSmallestUnit.js';
109
110
  export { solToLamports } from './solToLamports/solToLamports.js';
110
111
  export { getEnvVarWithFallback } from './env/getEnvVarWithFallback.js';
111
112
  export { setupInsideIframe } from './setupInsideIframe/setupInsideIframe.js';
@@ -0,0 +1 @@
1
+ export { parseAmountToSmallestUnit } from './parseAmountToSmallestUnit';
@@ -0,0 +1,21 @@
1
+ 'use client'
2
+ 'use strict';
3
+
4
+ Object.defineProperty(exports, '__esModule', { value: true });
5
+
6
+ /**
7
+ * Converts a human-readable decimal amount string to the smallest unit
8
+ * representation as a bigint, using string-based arithmetic to avoid
9
+ * floating-point precision loss.
10
+ *
11
+ * @param amount - The amount as a decimal string (e.g. "1.5").
12
+ * @param decimals - The number of decimal places for the token.
13
+ * @returns The amount in smallest units as a bigint.
14
+ */
15
+ const parseAmountToSmallestUnit = ({ amount, decimals, }) => {
16
+ const [whole, fraction = ''] = amount.split('.');
17
+ const paddedFraction = fraction.padEnd(decimals, '0').slice(0, decimals);
18
+ return BigInt((whole || '0') + paddedFraction);
19
+ };
20
+
21
+ exports.parseAmountToSmallestUnit = parseAmountToSmallestUnit;
@@ -0,0 +1,13 @@
1
+ /**
2
+ * Converts a human-readable decimal amount string to the smallest unit
3
+ * representation as a bigint, using string-based arithmetic to avoid
4
+ * floating-point precision loss.
5
+ *
6
+ * @param amount - The amount as a decimal string (e.g. "1.5").
7
+ * @param decimals - The number of decimal places for the token.
8
+ * @returns The amount in smallest units as a bigint.
9
+ */
10
+ export declare const parseAmountToSmallestUnit: ({ amount, decimals, }: {
11
+ amount: string;
12
+ decimals: number;
13
+ }) => bigint;
@@ -0,0 +1,17 @@
1
+ 'use client'
2
+ /**
3
+ * Converts a human-readable decimal amount string to the smallest unit
4
+ * representation as a bigint, using string-based arithmetic to avoid
5
+ * floating-point precision loss.
6
+ *
7
+ * @param amount - The amount as a decimal string (e.g. "1.5").
8
+ * @param decimals - The number of decimal places for the token.
9
+ * @returns The amount in smallest units as a bigint.
10
+ */
11
+ const parseAmountToSmallestUnit = ({ amount, decimals, }) => {
12
+ const [whole, fraction = ''] = amount.split('.');
13
+ const paddedFraction = fraction.padEnd(decimals, '0').slice(0, decimals);
14
+ return BigInt((whole || '0') + paddedFraction);
15
+ };
16
+
17
+ export { parseAmountToSmallestUnit };