@dynamic-labs/utils 4.85.0 → 4.87.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,29 @@
1
1
 
2
+ ## [4.87.0](https://github.com/dynamic-labs/dynamic-auth/compare/v4.86.0...v4.87.0) (2026-06-02)
3
+
4
+
5
+ ### Features
6
+
7
+ * **sdk-react-core:** instrument logout reason for Datadog observability DYNT-870 ([#11429](https://github.com/dynamic-labs/dynamic-auth/issues/11429)) ([8f9b3f3](https://github.com/dynamic-labs/dynamic-auth/commit/8f9b3f364dc711414ae59642c36f5f0a4cc4576a))
8
+
9
+
10
+ ### Bug Fixes
11
+
12
+ * **sdk-react-core:** only flag auto-wallet abandoned on a sustained exit, not transient webview hide DYNT-870 ([#11428](https://github.com/dynamic-labs/dynamic-auth/issues/11428)) ([5984cdd](https://github.com/dynamic-labs/dynamic-auth/commit/5984cddb4ac04b226f6dd6ebe44340186902b012))
13
+
14
+ ## [4.86.0](https://github.com/dynamic-labs/dynamic-auth/compare/v4.85.0...v4.86.0) (2026-06-01)
15
+
16
+
17
+ ### Features
18
+
19
+ * add support to new MetaMask SDK ([#11056](https://github.com/dynamic-labs/dynamic-auth/issues/11056)) ([8a6c973](https://github.com/dynamic-labs/dynamic-auth/commit/8a6c973876207256c06b04f6a16454f07446393d))
20
+ * **ethereum-gasless:** expose optional nonce on sign/send/relay ([#11422](https://github.com/dynamic-labs/dynamic-auth/issues/11422)) ([d2d074e](https://github.com/dynamic-labs/dynamic-auth/commit/d2d074ebe82452990281eba14a73f52a0af1e98b))
21
+
22
+
23
+ ### Bug Fixes
24
+
25
+ * **sdk-react-core:** retry auto wallet creation on transient failures before erroring ([#11408](https://github.com/dynamic-labs/dynamic-auth/issues/11408)) ([8175460](https://github.com/dynamic-labs/dynamic-auth/commit/8175460bdee6f041ead0ea3f020cfd2168683239)), closes [#11399](https://github.com/dynamic-labs/dynamic-auth/issues/11399) [forward-mpc-client#286](https://github.com/dynamic-labs/forward-mpc-client/issues/286) [#11396](https://github.com/dynamic-labs/dynamic-auth/issues/11396)
26
+
2
27
  ## [4.85.0](https://github.com/dynamic-labs/dynamic-auth/compare/v4.84.1...v4.85.0) (2026-05-29)
3
28
 
4
29
 
package/package.cjs CHANGED
@@ -3,6 +3,6 @@
3
3
 
4
4
  Object.defineProperty(exports, '__esModule', { value: true });
5
5
 
6
- var version = "4.85.0";
6
+ var version = "4.87.0";
7
7
 
8
8
  exports.version = version;
package/package.js CHANGED
@@ -1,4 +1,4 @@
1
1
  'use client'
2
- var version = "4.85.0";
2
+ var version = "4.87.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.85.0",
3
+ "version": "4.87.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",
@@ -20,9 +20,9 @@
20
20
  "dependencies": {
21
21
  "@dynamic-labs/sdk-api-core": "0.0.985",
22
22
  "tldts": "6.0.16",
23
- "@dynamic-labs/assert-package-version": "4.85.0",
24
- "@dynamic-labs/logger": "4.85.0",
25
- "@dynamic-labs/types": "4.85.0",
23
+ "@dynamic-labs/assert-package-version": "4.87.0",
24
+ "@dynamic-labs/logger": "4.87.0",
25
+ "@dynamic-labs/types": "4.87.0",
26
26
  "buffer": "6.0.3",
27
27
  "eventemitter3": "5.0.1"
28
28
  },
@@ -13,7 +13,33 @@ ${trace.payload.join('\n')}
13
13
  */
14
14
  const createTracing = () => {
15
15
  const traces = [];
16
+ const pack = (scopes) => traces
17
+ .filter((trace) => (scopes ? scopes.includes(trace.scope) : true))
18
+ .map(formatTrace)
19
+ .join('\n\n');
16
20
  return {
21
+ /**
22
+ * Ships the buffered traces to `sink` and clears them. Otherwise traces are
23
+ * only collected in memory and never leave the device. Logger-agnostic
24
+ * (caller supplies the sink) so this stays dependency-free.
25
+ * @param sink - Receives the packed trace string (e.g. logger.instrument)
26
+ * @param scopes - Optional array of scopes to flush
27
+ */
28
+ flush: (sink, scopes) => {
29
+ const packed = pack(scopes);
30
+ if (packed) {
31
+ sink(packed);
32
+ }
33
+ if (scopes) {
34
+ // Only remove the flushed scopes
35
+ const scopeSet = new Set(scopes);
36
+ traces.splice(0, traces.length, ...traces.filter((t) => !scopeSet.has(t.scope)));
37
+ }
38
+ else {
39
+ // No scopes specified, clear all
40
+ traces.length = 0;
41
+ }
42
+ },
17
43
  /**
18
44
  * Formats an object as a pretty-printed JSON string
19
45
  * @param object - The object to format
@@ -37,10 +63,7 @@ const createTracing = () => {
37
63
  * @param scopes - Optional array of scopes to filter traces
38
64
  * @returns Formatted trace output as a string
39
65
  */
40
- packScopes: (scopes) => traces
41
- .filter((trace) => (scopes ? scopes.includes(trace.scope) : true))
42
- .map(formatTrace)
43
- .join('\n\n'),
66
+ packScopes: (scopes) => pack(scopes),
44
67
  };
45
68
  };
46
69
  const tracing = createTracing();
@@ -4,6 +4,14 @@ type Payload = string[];
4
4
  * @returns Tracing utility object
5
5
  */
6
6
  export declare const createTracing: () => {
7
+ /**
8
+ * Ships the buffered traces to `sink` and clears them. Otherwise traces are
9
+ * only collected in memory and never leave the device. Logger-agnostic
10
+ * (caller supplies the sink) so this stays dependency-free.
11
+ * @param sink - Receives the packed trace string (e.g. logger.instrument)
12
+ * @param scopes - Optional array of scopes to flush
13
+ */
14
+ flush: (sink: (packed: string) => void, scopes?: string[]) => void;
7
15
  /**
8
16
  * Formats an object as a pretty-printed JSON string
9
17
  * @param object - The object to format
@@ -24,6 +32,14 @@ export declare const createTracing: () => {
24
32
  packScopes: (scopes?: string[] | undefined) => string;
25
33
  };
26
34
  export declare const tracing: {
35
+ /**
36
+ * Ships the buffered traces to `sink` and clears them. Otherwise traces are
37
+ * only collected in memory and never leave the device. Logger-agnostic
38
+ * (caller supplies the sink) so this stays dependency-free.
39
+ * @param sink - Receives the packed trace string (e.g. logger.instrument)
40
+ * @param scopes - Optional array of scopes to flush
41
+ */
42
+ flush: (sink: (packed: string) => void, scopes?: string[]) => void;
27
43
  /**
28
44
  * Formats an object as a pretty-printed JSON string
29
45
  * @param object - The object to format
@@ -9,7 +9,33 @@ ${trace.payload.join('\n')}
9
9
  */
10
10
  const createTracing = () => {
11
11
  const traces = [];
12
+ const pack = (scopes) => traces
13
+ .filter((trace) => (scopes ? scopes.includes(trace.scope) : true))
14
+ .map(formatTrace)
15
+ .join('\n\n');
12
16
  return {
17
+ /**
18
+ * Ships the buffered traces to `sink` and clears them. Otherwise traces are
19
+ * only collected in memory and never leave the device. Logger-agnostic
20
+ * (caller supplies the sink) so this stays dependency-free.
21
+ * @param sink - Receives the packed trace string (e.g. logger.instrument)
22
+ * @param scopes - Optional array of scopes to flush
23
+ */
24
+ flush: (sink, scopes) => {
25
+ const packed = pack(scopes);
26
+ if (packed) {
27
+ sink(packed);
28
+ }
29
+ if (scopes) {
30
+ // Only remove the flushed scopes
31
+ const scopeSet = new Set(scopes);
32
+ traces.splice(0, traces.length, ...traces.filter((t) => !scopeSet.has(t.scope)));
33
+ }
34
+ else {
35
+ // No scopes specified, clear all
36
+ traces.length = 0;
37
+ }
38
+ },
13
39
  /**
14
40
  * Formats an object as a pretty-printed JSON string
15
41
  * @param object - The object to format
@@ -33,10 +59,7 @@ const createTracing = () => {
33
59
  * @param scopes - Optional array of scopes to filter traces
34
60
  * @returns Formatted trace output as a string
35
61
  */
36
- packScopes: (scopes) => traces
37
- .filter((trace) => (scopes ? scopes.includes(trace.scope) : true))
38
- .map(formatTrace)
39
- .join('\n\n'),
62
+ packScopes: (scopes) => pack(scopes),
40
63
  };
41
64
  };
42
65
  const tracing = createTracing();