@dynamic-labs/global-wallet-client 4.18.8 → 4.19.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,20 @@
1
1
 
2
+ ## [4.19.0](https://github.com/dynamic-labs/dynamic-auth/compare/v4.18.8...v4.19.0) (2025-05-23)
3
+
4
+
5
+ ### Features
6
+
7
+ * expose 7702 kernel and add viem controller ([#8786](https://github.com/dynamic-labs/dynamic-auth/issues/8786)) ([eea710e](https://github.com/dynamic-labs/dynamic-auth/commit/eea710e238ccbc36e6be37d8f7493954b99858ef))
8
+ * use browser wallet client & iframe for waas operations ([#8697](https://github.com/dynamic-labs/dynamic-auth/issues/8697)) ([13a47b1](https://github.com/dynamic-labs/dynamic-auth/commit/13a47b1c9a2984f08682e833ca8c87605a3a872f))
9
+
10
+
11
+ ### Bug Fixes
12
+
13
+ * **global-wallet:** close popup when page unloads to prevent orphaned popup windows ([#8787](https://github.com/dynamic-labs/dynamic-auth/issues/8787)) ([441b04c](https://github.com/dynamic-labs/dynamic-auth/commit/441b04ca04a02feb37473e43bca0e66c5d772ce2))
14
+ * override network when requesting BTC networks in useTokenBalances ([#8773](https://github.com/dynamic-labs/dynamic-auth/issues/8773)) ([fd07d09](https://github.com/dynamic-labs/dynamic-auth/commit/fd07d09de970c7e6f85b251a88854e8eca57e249))
15
+ * remove libmpc executor dependency global wallet ([#8792](https://github.com/dynamic-labs/dynamic-auth/issues/8792)) ([7502585](https://github.com/dynamic-labs/dynamic-auth/commit/75025859d2f952915322cf65504117ec2506152b))
16
+ * standardize font on headers ([#8734](https://github.com/dynamic-labs/dynamic-auth/issues/8734)) ([9f0900c](https://github.com/dynamic-labs/dynamic-auth/commit/9f0900cb7c4294201cc952ae7538648bdea83ff5))
17
+
2
18
  ### [4.18.8](https://github.com/dynamic-labs/dynamic-auth/compare/v4.18.7...v4.18.8) (2025-05-22)
3
19
 
4
20
  ### Bug Fixes
package/package.cjs CHANGED
@@ -3,6 +3,6 @@
3
3
 
4
4
  Object.defineProperty(exports, '__esModule', { value: true });
5
5
 
6
- var version = "4.18.8";
6
+ var version = "4.19.0";
7
7
 
8
8
  exports.version = version;
package/package.js CHANGED
@@ -1,4 +1,4 @@
1
1
  'use client'
2
- var version = "4.18.8";
2
+ var version = "4.19.0";
3
3
 
4
4
  export { version };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@dynamic-labs/global-wallet-client",
3
- "version": "4.18.8",
3
+ "version": "4.19.0",
4
4
  "description": "Core package for building Dynamic's Global Wallet",
5
5
  "author": "Dynamic Labs, Inc.",
6
6
  "license": "MIT",
@@ -47,12 +47,12 @@
47
47
  },
48
48
  "homepage": "https://www.dynamic.xyz/",
49
49
  "dependencies": {
50
- "@dynamic-labs/assert-package-version": "4.18.8",
51
- "@dynamic-labs/logger": "4.18.8",
52
- "@dynamic-labs/message-transport": "4.18.8",
53
- "@dynamic-labs/store": "4.18.8",
54
- "@dynamic-labs/types": "4.18.8",
55
- "@dynamic-labs/utils": "4.18.8",
50
+ "@dynamic-labs/assert-package-version": "4.19.0",
51
+ "@dynamic-labs/logger": "4.19.0",
52
+ "@dynamic-labs/message-transport": "4.19.0",
53
+ "@dynamic-labs/store": "4.19.0",
54
+ "@dynamic-labs/types": "4.19.0",
55
+ "@dynamic-labs/utils": "4.19.0",
56
56
  "eventemitter3": "5.0.1"
57
57
  },
58
58
  "peerDependencies": {
@@ -13,7 +13,7 @@ var PopupClosedError = require('../../errors/PopupClosedError.cjs');
13
13
  var logger = require('../../constants/logger.cjs');
14
14
 
15
15
  const createPopupOpener = ({ environmentId, popupUrl, popupWidth = 420, popupHeight = 640, popupActionTimeout = 1000, // Wait page up to 1 second for new actions before closing
16
- onError, }) => {
16
+ onError, globalWindow = global.window, }) => {
17
17
  let popup = null;
18
18
  let didOpenPopup = false;
19
19
  let lastActionId = null;
@@ -24,6 +24,12 @@ onError, }) => {
24
24
  didOpenPopup = false;
25
25
  lastActionId = null;
26
26
  };
27
+ /**
28
+ * Close popup on page unload
29
+ */
30
+ if (typeof globalWindow !== 'undefined') {
31
+ globalWindow.addEventListener('beforeunload', closePopup);
32
+ }
27
33
  return (_a) => _tslib.__awaiter(void 0, [_a], void 0, function* ({ params, pathname, connection, }) {
28
34
  logger.logger.logVerboseTroubleshootingMessage('new popup action', {
29
35
  params,
@@ -38,14 +44,14 @@ onError, }) => {
38
44
  popupFinalUrl.hash = `/${pathname}`;
39
45
  popupFinalUrl.searchParams.set('provider_env_id', environmentId);
40
46
  // TODO: use PlatformService
41
- popupFinalUrl.searchParams.set('requester_origin', window.location.origin);
47
+ popupFinalUrl.searchParams.set('requester_origin', globalWindow.location.origin);
42
48
  if (popup === null) {
43
49
  const features = getCenteredPopupFeatures.getCenteredPopupFeatures({
44
50
  height: popupHeight,
45
51
  width: popupWidth,
46
52
  });
47
53
  // Open popup
48
- popup = window.open('', '_blank', features);
54
+ popup = globalWindow.open('', '_blank', features);
49
55
  }
50
56
  // Encrypt params if active connection is present
51
57
  if (params) {
@@ -7,11 +7,12 @@ type CreatePopupOpenerProps = {
7
7
  popupHeight?: number;
8
8
  popupActionTimeout?: number;
9
9
  onError?: (error: Error) => void;
10
+ globalWindow?: Window;
10
11
  };
11
12
  type OpenPopupProps<TAction extends IPopupAction> = {
12
13
  params: GetPopupActionFuncArgs<TAction>;
13
14
  pathname: GetPopupActionName<TAction>;
14
15
  connection: GlobalWalletConnection | null;
15
16
  };
16
- export declare const createPopupOpener: ({ environmentId, popupUrl, popupWidth, popupHeight, popupActionTimeout, onError, }: CreatePopupOpenerProps) => PopupOpener;
17
+ export declare const createPopupOpener: ({ environmentId, popupUrl, popupWidth, popupHeight, popupActionTimeout, onError, globalWindow, }: CreatePopupOpenerProps) => PopupOpener;
17
18
  export {};
@@ -9,7 +9,7 @@ import { PopupClosedError } from '../../errors/PopupClosedError.js';
9
9
  import { logger } from '../../constants/logger.js';
10
10
 
11
11
  const createPopupOpener = ({ environmentId, popupUrl, popupWidth = 420, popupHeight = 640, popupActionTimeout = 1000, // Wait page up to 1 second for new actions before closing
12
- onError, }) => {
12
+ onError, globalWindow = global.window, }) => {
13
13
  let popup = null;
14
14
  let didOpenPopup = false;
15
15
  let lastActionId = null;
@@ -20,6 +20,12 @@ onError, }) => {
20
20
  didOpenPopup = false;
21
21
  lastActionId = null;
22
22
  };
23
+ /**
24
+ * Close popup on page unload
25
+ */
26
+ if (typeof globalWindow !== 'undefined') {
27
+ globalWindow.addEventListener('beforeunload', closePopup);
28
+ }
23
29
  return (_a) => __awaiter(void 0, [_a], void 0, function* ({ params, pathname, connection, }) {
24
30
  logger.logVerboseTroubleshootingMessage('new popup action', {
25
31
  params,
@@ -34,14 +40,14 @@ onError, }) => {
34
40
  popupFinalUrl.hash = `/${pathname}`;
35
41
  popupFinalUrl.searchParams.set('provider_env_id', environmentId);
36
42
  // TODO: use PlatformService
37
- popupFinalUrl.searchParams.set('requester_origin', window.location.origin);
43
+ popupFinalUrl.searchParams.set('requester_origin', globalWindow.location.origin);
38
44
  if (popup === null) {
39
45
  const features = getCenteredPopupFeatures({
40
46
  height: popupHeight,
41
47
  width: popupWidth,
42
48
  });
43
49
  // Open popup
44
- popup = window.open('', '_blank', features);
50
+ popup = globalWindow.open('', '_blank', features);
45
51
  }
46
52
  // Encrypt params if active connection is present
47
53
  if (params) {