@dynamic-labs/sui-core 4.88.4 → 4.88.5

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,13 @@
1
1
 
2
+ ### [4.88.5](https://github.com/dynamic-labs/dynamic-auth/compare/v4.88.4...v4.88.5) (2026-06-11)
3
+
4
+
5
+ ### Bug Fixes
6
+
7
+ * **fix(webview):** fix issue where stepupauth is enabled and after it's completed the export private key window doesn't show up automatically
8
+ * **fix(global-wallet):** correctly sign ethereum messages ([#11548](https://github.com/dynamic-labs/dynamic-auth/issues/11548))
9
+
10
+
2
11
  ### [4.88.4](https://github.com/dynamic-labs/dynamic-auth/compare/v4.88.3...v4.88.4) (2026-06-10)
3
12
 
4
13
 
package/package.cjs CHANGED
@@ -3,6 +3,6 @@
3
3
 
4
4
  Object.defineProperty(exports, '__esModule', { value: true });
5
5
 
6
- var version = "4.88.4";
6
+ var version = "4.88.5";
7
7
 
8
8
  exports.version = version;
package/package.js CHANGED
@@ -1,4 +1,4 @@
1
1
  'use client'
2
- var version = "4.88.4";
2
+ var version = "4.88.5";
3
3
 
4
4
  export { version };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@dynamic-labs/sui-core",
3
- "version": "4.88.4",
3
+ "version": "4.88.5",
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",
@@ -19,16 +19,16 @@
19
19
  "homepage": "https://www.dynamic.xyz/",
20
20
  "dependencies": {
21
21
  "@dynamic-labs/sdk-api-core": "0.0.1015",
22
- "@dynamic-labs/utils": "4.88.4",
22
+ "@dynamic-labs/utils": "4.88.5",
23
23
  "@mysten/wallet-standard": "0.19.9",
24
24
  "@mysten/sui": "1.45.2",
25
25
  "text-encoding": "0.7.0",
26
- "@dynamic-labs/assert-package-version": "4.88.4",
27
- "@dynamic-labs/logger": "4.88.4",
28
- "@dynamic-labs/rpc-providers": "4.88.4",
29
- "@dynamic-labs/types": "4.88.4",
30
- "@dynamic-labs/wallet-book": "4.88.4",
31
- "@dynamic-labs/wallet-connector-core": "4.88.4"
26
+ "@dynamic-labs/assert-package-version": "4.88.5",
27
+ "@dynamic-labs/logger": "4.88.5",
28
+ "@dynamic-labs/rpc-providers": "4.88.5",
29
+ "@dynamic-labs/types": "4.88.5",
30
+ "@dynamic-labs/wallet-book": "4.88.5",
31
+ "@dynamic-labs/wallet-connector-core": "4.88.5"
32
32
  },
33
33
  "peerDependencies": {}
34
34
  }
@@ -13,12 +13,102 @@ var injected = require('./injected.cjs');
13
13
  const walletsWithCustomConnectors = {
14
14
  slush: Slush.Slush,
15
15
  };
16
+ /**
17
+ * Teardown for the active wallet-standard discovery (register listener + poll).
18
+ * Recreated on each fetchSuiInjectedWalletConnectors call.
19
+ */
20
+ let teardownSuiWalletStandardDiscovery = null;
21
+ // Some extensions inject after the initial snapshot (e.g. on prerendered pages
22
+ // where content scripts only run at activation), and a one-shot register
23
+ // listener can miss an announcement that fires before we subscribe. Polling
24
+ // the wallet-standard registry for a short window catches those late arrivals
25
+ // without a refresh. Mirrors the solana wallet-standard discovery.
26
+ const SUI_WALLET_STANDARD_POLL_INTERVAL_MS = 300;
27
+ const SUI_WALLET_STANDARD_POLL_DURATION_MS = 5000;
16
28
  const getCustomConnectorForKey = (name) => {
17
29
  var _a;
18
30
  return (_a = Object.entries(walletsWithCustomConnectors).find(([key]) => name.toLowerCase().includes(key.toLowerCase()))) === null || _a === void 0 ? void 0 : _a[1];
19
31
  };
32
+ const supportsRequiredSuiFeatures = (wallet) => { var _a; return Boolean((_a = wallet.features) === null || _a === void 0 ? void 0 : _a['sui:signPersonalMessage']); };
33
+ const createSuiWalletStandardConnector = (wallet) => {
34
+ const sanitizedName = utils.sanitizeName(wallet.name);
35
+ const customConnector = getCustomConnectorForKey(sanitizedName);
36
+ const isInstalled = true;
37
+ if (customConnector) {
38
+ return class extends customConnector {
39
+ // eslint-disable-next-line @typescript-eslint/no-explicit-any
40
+ constructor(props) {
41
+ super(wallet.name, isInstalled, Object.assign({ metadata: {
42
+ groupKey: sanitizedName,
43
+ icon: wallet.icon,
44
+ id: wallet.name,
45
+ name: wallet.name,
46
+ }, name: wallet.name, overrideKey: `${sanitizedName}sui`, wallet: wallet }, props));
47
+ }
48
+ };
49
+ }
50
+ return class extends injected.Injected {
51
+ // eslint-disable-next-line @typescript-eslint/no-explicit-any
52
+ constructor(props) {
53
+ super(wallet.name, isInstalled, Object.assign({ metadata: {
54
+ groupKey: sanitizedName,
55
+ icon: wallet.icon,
56
+ id: wallet.name,
57
+ name: wallet.name,
58
+ }, name: wallet.name, overrideKey: `${sanitizedName}sui`, wallet: wallet }, props));
59
+ }
60
+ };
61
+ };
62
+ const setupSuiWalletStandardDiscovery = () => {
63
+ // check to ensure this method doesn't run with SSR
64
+ if (typeof window === 'undefined') {
65
+ return;
66
+ }
67
+ teardownSuiWalletStandardDiscovery === null || teardownSuiWalletStandardDiscovery === void 0 ? void 0 : teardownSuiWalletStandardDiscovery();
68
+ // Tracks wallets already surfaced so neither the register listener nor the
69
+ // poll emits a duplicate providerInjected for the same wallet.
70
+ const discoveredWallets = new Set();
71
+ const handleWallet = (wallet) => {
72
+ if (discoveredWallets.has(wallet.name)) {
73
+ return;
74
+ }
75
+ if (!supportsRequiredSuiFeatures(wallet)) {
76
+ return;
77
+ }
78
+ discoveredWallets.add(wallet.name);
79
+ walletConnectorCore.walletConnectorEvents.emit('providerInjected', {
80
+ injectedConnectorConstructor: createSuiWalletStandardConnector(wallet),
81
+ });
82
+ };
83
+ const wallets = walletStandard.getWallets();
84
+ // Wallets already present are returned synchronously by
85
+ // fetchSuiInjectedWalletConnectors, so seed them as discovered (no emit
86
+ // needed); the listener and poll then only fire for wallets that appear
87
+ // afterwards.
88
+ wallets.get().forEach((wallet) => {
89
+ if (supportsRequiredSuiFeatures(wallet)) {
90
+ discoveredWallets.add(wallet.name);
91
+ }
92
+ });
93
+ const removeRegisterListener = wallets.on('register', (...registered) => {
94
+ registered.forEach(handleWallet);
95
+ });
96
+ const pollForNewWallets = () => {
97
+ walletStandard.getWallets().get().forEach(handleWallet);
98
+ };
99
+ const pollIntervalId = setInterval(pollForNewWallets, SUI_WALLET_STANDARD_POLL_INTERVAL_MS);
100
+ const pollTimeoutId = setTimeout(() => {
101
+ clearInterval(pollIntervalId);
102
+ }, SUI_WALLET_STANDARD_POLL_DURATION_MS);
103
+ teardownSuiWalletStandardDiscovery = () => {
104
+ removeRegisterListener === null || removeRegisterListener === void 0 ? void 0 : removeRegisterListener();
105
+ clearInterval(pollIntervalId);
106
+ clearTimeout(pollTimeoutId);
107
+ };
108
+ };
20
109
  const fetchSuiInjectedWalletConnectors = ({ walletBook, }) => {
21
110
  var _a;
111
+ setupSuiWalletStandardDiscovery();
22
112
  const walletStandardWallets = walletStandard.getWallets().get();
23
113
  const suiWalletStandardWallets = walletStandardWallets.filter((wallet) => walletStandard.isWalletWithRequiredFeatureSet(wallet, ['sui:signPersonalMessage']));
24
114
  const suiWalletsByKey = Object.fromEntries(suiWalletStandardWallets.map((wallet) => [wallet.name, wallet]));
@@ -52,36 +142,8 @@ const fetchSuiInjectedWalletConnectors = ({ walletBook, }) => {
52
142
  // Wallet standard wallets don't always have injectedConfig from wallet book,
53
143
  // so we filter them by checking if they support critical sui features.
54
144
  const walletStandardConnectors = walletStandardWallets
55
- .filter((wallet) => { var _a; return (_a = wallet.features) === null || _a === void 0 ? void 0 : _a['sui:signPersonalMessage']; })
56
- .map((wallet) => {
57
- const sanitizedName = utils.sanitizeName(wallet.name);
58
- const customConnector = getCustomConnectorForKey(sanitizedName);
59
- const isInstalled = true;
60
- if (customConnector) {
61
- return class extends customConnector {
62
- // eslint-disable-next-line @typescript-eslint/no-explicit-any
63
- constructor(props) {
64
- super(wallet.name, isInstalled, Object.assign({ metadata: {
65
- groupKey: sanitizedName,
66
- icon: wallet.icon,
67
- id: wallet.name,
68
- name: wallet.name,
69
- }, name: wallet.name, overrideKey: `${sanitizedName}sui`, wallet: wallet }, props));
70
- }
71
- };
72
- }
73
- return class extends injected.Injected {
74
- // eslint-disable-next-line @typescript-eslint/no-explicit-any
75
- constructor(props) {
76
- super(wallet.name, isInstalled, Object.assign({ metadata: {
77
- groupKey: sanitizedName,
78
- icon: wallet.icon,
79
- id: wallet.name,
80
- name: wallet.name,
81
- }, name: wallet.name, overrideKey: `${sanitizedName}sui`, wallet: wallet }, props));
82
- }
83
- };
84
- });
145
+ .filter(supportsRequiredSuiFeatures)
146
+ .map(createSuiWalletStandardConnector);
85
147
  return [...walletBookConnectors, ...walletStandardConnectors];
86
148
  };
87
149
 
@@ -1,5 +1,10 @@
1
1
  import { WalletBookSchema } from '@dynamic-labs/wallet-book';
2
2
  import { WalletConnectorConstructor } from '@dynamic-labs/wallet-connector-core';
3
+ /**
4
+ * Stops the active wallet-standard discovery (register listener + poll).
5
+ * @internal - Exposed for test cleanup.
6
+ */
7
+ export declare const stopSuiWalletStandardDiscovery: () => void;
3
8
  export declare const fetchSuiInjectedWalletConnectors: ({ walletBook, }: {
4
9
  walletBook?: WalletBookSchema;
5
10
  }) => WalletConnectorConstructor[];
@@ -1,7 +1,7 @@
1
1
  'use client'
2
2
  import { getWallets, isWalletWithRequiredFeatureSet } from '@mysten/wallet-standard';
3
3
  import { sanitizeName } from '@dynamic-labs/utils';
4
- import { getWalletMetadataFromWalletBook } from '@dynamic-labs/wallet-connector-core';
4
+ import { getWalletMetadataFromWalletBook, walletConnectorEvents } from '@dynamic-labs/wallet-connector-core';
5
5
  import { Slush } from '../slush/Slush.js';
6
6
  import { Injected } from './injected.js';
7
7
 
@@ -9,12 +9,102 @@ import { Injected } from './injected.js';
9
9
  const walletsWithCustomConnectors = {
10
10
  slush: Slush,
11
11
  };
12
+ /**
13
+ * Teardown for the active wallet-standard discovery (register listener + poll).
14
+ * Recreated on each fetchSuiInjectedWalletConnectors call.
15
+ */
16
+ let teardownSuiWalletStandardDiscovery = null;
17
+ // Some extensions inject after the initial snapshot (e.g. on prerendered pages
18
+ // where content scripts only run at activation), and a one-shot register
19
+ // listener can miss an announcement that fires before we subscribe. Polling
20
+ // the wallet-standard registry for a short window catches those late arrivals
21
+ // without a refresh. Mirrors the solana wallet-standard discovery.
22
+ const SUI_WALLET_STANDARD_POLL_INTERVAL_MS = 300;
23
+ const SUI_WALLET_STANDARD_POLL_DURATION_MS = 5000;
12
24
  const getCustomConnectorForKey = (name) => {
13
25
  var _a;
14
26
  return (_a = Object.entries(walletsWithCustomConnectors).find(([key]) => name.toLowerCase().includes(key.toLowerCase()))) === null || _a === void 0 ? void 0 : _a[1];
15
27
  };
28
+ const supportsRequiredSuiFeatures = (wallet) => { var _a; return Boolean((_a = wallet.features) === null || _a === void 0 ? void 0 : _a['sui:signPersonalMessage']); };
29
+ const createSuiWalletStandardConnector = (wallet) => {
30
+ const sanitizedName = sanitizeName(wallet.name);
31
+ const customConnector = getCustomConnectorForKey(sanitizedName);
32
+ const isInstalled = true;
33
+ if (customConnector) {
34
+ return class extends customConnector {
35
+ // eslint-disable-next-line @typescript-eslint/no-explicit-any
36
+ constructor(props) {
37
+ super(wallet.name, isInstalled, Object.assign({ metadata: {
38
+ groupKey: sanitizedName,
39
+ icon: wallet.icon,
40
+ id: wallet.name,
41
+ name: wallet.name,
42
+ }, name: wallet.name, overrideKey: `${sanitizedName}sui`, wallet: wallet }, props));
43
+ }
44
+ };
45
+ }
46
+ return class extends Injected {
47
+ // eslint-disable-next-line @typescript-eslint/no-explicit-any
48
+ constructor(props) {
49
+ super(wallet.name, isInstalled, Object.assign({ metadata: {
50
+ groupKey: sanitizedName,
51
+ icon: wallet.icon,
52
+ id: wallet.name,
53
+ name: wallet.name,
54
+ }, name: wallet.name, overrideKey: `${sanitizedName}sui`, wallet: wallet }, props));
55
+ }
56
+ };
57
+ };
58
+ const setupSuiWalletStandardDiscovery = () => {
59
+ // check to ensure this method doesn't run with SSR
60
+ if (typeof window === 'undefined') {
61
+ return;
62
+ }
63
+ teardownSuiWalletStandardDiscovery === null || teardownSuiWalletStandardDiscovery === void 0 ? void 0 : teardownSuiWalletStandardDiscovery();
64
+ // Tracks wallets already surfaced so neither the register listener nor the
65
+ // poll emits a duplicate providerInjected for the same wallet.
66
+ const discoveredWallets = new Set();
67
+ const handleWallet = (wallet) => {
68
+ if (discoveredWallets.has(wallet.name)) {
69
+ return;
70
+ }
71
+ if (!supportsRequiredSuiFeatures(wallet)) {
72
+ return;
73
+ }
74
+ discoveredWallets.add(wallet.name);
75
+ walletConnectorEvents.emit('providerInjected', {
76
+ injectedConnectorConstructor: createSuiWalletStandardConnector(wallet),
77
+ });
78
+ };
79
+ const wallets = getWallets();
80
+ // Wallets already present are returned synchronously by
81
+ // fetchSuiInjectedWalletConnectors, so seed them as discovered (no emit
82
+ // needed); the listener and poll then only fire for wallets that appear
83
+ // afterwards.
84
+ wallets.get().forEach((wallet) => {
85
+ if (supportsRequiredSuiFeatures(wallet)) {
86
+ discoveredWallets.add(wallet.name);
87
+ }
88
+ });
89
+ const removeRegisterListener = wallets.on('register', (...registered) => {
90
+ registered.forEach(handleWallet);
91
+ });
92
+ const pollForNewWallets = () => {
93
+ getWallets().get().forEach(handleWallet);
94
+ };
95
+ const pollIntervalId = setInterval(pollForNewWallets, SUI_WALLET_STANDARD_POLL_INTERVAL_MS);
96
+ const pollTimeoutId = setTimeout(() => {
97
+ clearInterval(pollIntervalId);
98
+ }, SUI_WALLET_STANDARD_POLL_DURATION_MS);
99
+ teardownSuiWalletStandardDiscovery = () => {
100
+ removeRegisterListener === null || removeRegisterListener === void 0 ? void 0 : removeRegisterListener();
101
+ clearInterval(pollIntervalId);
102
+ clearTimeout(pollTimeoutId);
103
+ };
104
+ };
16
105
  const fetchSuiInjectedWalletConnectors = ({ walletBook, }) => {
17
106
  var _a;
107
+ setupSuiWalletStandardDiscovery();
18
108
  const walletStandardWallets = getWallets().get();
19
109
  const suiWalletStandardWallets = walletStandardWallets.filter((wallet) => isWalletWithRequiredFeatureSet(wallet, ['sui:signPersonalMessage']));
20
110
  const suiWalletsByKey = Object.fromEntries(suiWalletStandardWallets.map((wallet) => [wallet.name, wallet]));
@@ -48,36 +138,8 @@ const fetchSuiInjectedWalletConnectors = ({ walletBook, }) => {
48
138
  // Wallet standard wallets don't always have injectedConfig from wallet book,
49
139
  // so we filter them by checking if they support critical sui features.
50
140
  const walletStandardConnectors = walletStandardWallets
51
- .filter((wallet) => { var _a; return (_a = wallet.features) === null || _a === void 0 ? void 0 : _a['sui:signPersonalMessage']; })
52
- .map((wallet) => {
53
- const sanitizedName = sanitizeName(wallet.name);
54
- const customConnector = getCustomConnectorForKey(sanitizedName);
55
- const isInstalled = true;
56
- if (customConnector) {
57
- return class extends customConnector {
58
- // eslint-disable-next-line @typescript-eslint/no-explicit-any
59
- constructor(props) {
60
- super(wallet.name, isInstalled, Object.assign({ metadata: {
61
- groupKey: sanitizedName,
62
- icon: wallet.icon,
63
- id: wallet.name,
64
- name: wallet.name,
65
- }, name: wallet.name, overrideKey: `${sanitizedName}sui`, wallet: wallet }, props));
66
- }
67
- };
68
- }
69
- return class extends Injected {
70
- // eslint-disable-next-line @typescript-eslint/no-explicit-any
71
- constructor(props) {
72
- super(wallet.name, isInstalled, Object.assign({ metadata: {
73
- groupKey: sanitizedName,
74
- icon: wallet.icon,
75
- id: wallet.name,
76
- name: wallet.name,
77
- }, name: wallet.name, overrideKey: `${sanitizedName}sui`, wallet: wallet }, props));
78
- }
79
- };
80
- });
141
+ .filter(supportsRequiredSuiFeatures)
142
+ .map(createSuiWalletStandardConnector);
81
143
  return [...walletBookConnectors, ...walletStandardConnectors];
82
144
  };
83
145