@dynamic-labs/sdk-react-core 4.45.0 → 4.45.1
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 +7 -0
- package/package.cjs +1 -1
- package/package.js +1 -1
- package/package.json +12 -12
- package/src/lib/utils/hooks/useWalletDelegation/useWalletDelegation.cjs +11 -3
- package/src/lib/utils/hooks/useWalletDelegation/useWalletDelegation.d.ts +0 -1
- package/src/lib/utils/hooks/useWalletDelegation/useWalletDelegation.js +11 -3
- package/src/lib/widgets/DynamicWidget/views/WalletsDelegatedSettingsView/WalletsDelegatedSettingsView.cjs +0 -1
- package/src/lib/widgets/DynamicWidget/views/WalletsDelegatedSettingsView/WalletsDelegatedSettingsView.d.ts +0 -1
- package/src/lib/widgets/DynamicWidget/views/WalletsDelegatedSettingsView/WalletsDelegatedSettingsView.js +0 -1
package/CHANGELOG.md
CHANGED
|
@@ -1,4 +1,11 @@
|
|
|
1
1
|
|
|
2
|
+
### [4.45.1](https://github.com/dynamic-labs/dynamic-auth/compare/v4.45.0...v4.45.1) (2025-11-14)
|
|
3
|
+
|
|
4
|
+
|
|
5
|
+
### Bug Fixes
|
|
6
|
+
|
|
7
|
+
* validate global wallet requester origin protocol ([#9871](https://github.com/dynamic-labs/dynamic-auth/issues/9871)) ([da8a533](https://github.com/dynamic-labs/dynamic-auth/commit/da8a5332cf615ff0923e7dc8b0e6608c6caab353))
|
|
8
|
+
|
|
2
9
|
## [4.45.0](https://github.com/dynamic-labs/dynamic-auth/compare/v4.44.4...v4.45.0) (2025-11-11)
|
|
3
10
|
|
|
4
11
|
* **react-native:** add mfaCompletionSuccess and mfaCompletionFailure events to react-native client
|
package/package.cjs
CHANGED
package/package.js
CHANGED
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@dynamic-labs/sdk-react-core",
|
|
3
|
-
"version": "4.45.
|
|
3
|
+
"version": "4.45.1",
|
|
4
4
|
"dependencies": {
|
|
5
5
|
"@dynamic-labs/sdk-api-core": "0.0.821",
|
|
6
6
|
"@dynamic-labs-sdk/client": "0.1.0-alpha.28",
|
|
@@ -15,17 +15,17 @@
|
|
|
15
15
|
"yup": "0.32.11",
|
|
16
16
|
"react-international-phone": "4.5.0",
|
|
17
17
|
"bs58": "5.0.0",
|
|
18
|
-
"@dynamic-labs/assert-package-version": "4.45.
|
|
19
|
-
"@dynamic-labs/iconic": "4.45.
|
|
20
|
-
"@dynamic-labs/locale": "4.45.
|
|
21
|
-
"@dynamic-labs/logger": "4.45.
|
|
22
|
-
"@dynamic-labs/multi-wallet": "4.45.
|
|
23
|
-
"@dynamic-labs/rpc-providers": "4.45.
|
|
24
|
-
"@dynamic-labs/store": "4.45.
|
|
25
|
-
"@dynamic-labs/types": "4.45.
|
|
26
|
-
"@dynamic-labs/utils": "4.45.
|
|
27
|
-
"@dynamic-labs/wallet-book": "4.45.
|
|
28
|
-
"@dynamic-labs/wallet-connector-core": "4.45.
|
|
18
|
+
"@dynamic-labs/assert-package-version": "4.45.1",
|
|
19
|
+
"@dynamic-labs/iconic": "4.45.1",
|
|
20
|
+
"@dynamic-labs/locale": "4.45.1",
|
|
21
|
+
"@dynamic-labs/logger": "4.45.1",
|
|
22
|
+
"@dynamic-labs/multi-wallet": "4.45.1",
|
|
23
|
+
"@dynamic-labs/rpc-providers": "4.45.1",
|
|
24
|
+
"@dynamic-labs/store": "4.45.1",
|
|
25
|
+
"@dynamic-labs/types": "4.45.1",
|
|
26
|
+
"@dynamic-labs/utils": "4.45.1",
|
|
27
|
+
"@dynamic-labs/wallet-book": "4.45.1",
|
|
28
|
+
"@dynamic-labs/wallet-connector-core": "4.45.1",
|
|
29
29
|
"eventemitter3": "5.0.1"
|
|
30
30
|
},
|
|
31
31
|
"devDependencies": {
|
|
@@ -240,12 +240,20 @@ const useWalletDelegation = () => {
|
|
|
240
240
|
yield refresh();
|
|
241
241
|
}), [getWaasWalletConnector, refresh, getWalletsDelegatedStatus]);
|
|
242
242
|
const revokeDelegation = React.useCallback((wallets) => _tslib.__awaiter(void 0, void 0, void 0, function* () {
|
|
243
|
+
// Get current wallet statuses to check which ones are actually delegated
|
|
244
|
+
const walletsWithStatus = getWalletsDelegatedStatus();
|
|
243
245
|
for (const wallet of wallets) {
|
|
244
246
|
const walletConnector = getWaasWalletConnector(wallet.chainName);
|
|
245
247
|
if (!walletConnector)
|
|
246
248
|
continue;
|
|
247
|
-
|
|
248
|
-
|
|
249
|
+
// Find the wallet status from getWalletsDelegatedStatus
|
|
250
|
+
const walletStatus = walletsWithStatus.find((w) => w.address === wallet.accountAddress && w.chain === wallet.chainName);
|
|
251
|
+
if (!walletStatus || walletStatus.status !== 'delegated') {
|
|
252
|
+
logger.logger.warn('Wallet is not delegated, skipping revoke', {
|
|
253
|
+
accountAddress: wallet.accountAddress,
|
|
254
|
+
chainName: wallet.chainName,
|
|
255
|
+
status: walletStatus === null || walletStatus === void 0 ? void 0 : walletStatus.status,
|
|
256
|
+
});
|
|
249
257
|
continue;
|
|
250
258
|
}
|
|
251
259
|
try {
|
|
@@ -261,7 +269,7 @@ const useWalletDelegation = () => {
|
|
|
261
269
|
}
|
|
262
270
|
}
|
|
263
271
|
yield refresh();
|
|
264
|
-
}), [getWaasWalletConnector, refresh]);
|
|
272
|
+
}), [getWaasWalletConnector, refresh, getWalletsDelegatedStatus]);
|
|
265
273
|
const denyWalletDelegation = React.useCallback((walletId) => _tslib.__awaiter(void 0, void 0, void 0, function* () {
|
|
266
274
|
try {
|
|
267
275
|
// Update backend - permanent denial
|
|
@@ -29,7 +29,6 @@ export declare const useWalletDelegation: () => {
|
|
|
29
29
|
readonly revokeDelegation: (wallets: {
|
|
30
30
|
chainName: ChainEnum;
|
|
31
31
|
accountAddress: string;
|
|
32
|
-
status: WalletDelegationStatus;
|
|
33
32
|
}[]) => Promise<void>;
|
|
34
33
|
readonly shouldPromptWalletDelegation: () => boolean;
|
|
35
34
|
};
|
|
@@ -236,12 +236,20 @@ const useWalletDelegation = () => {
|
|
|
236
236
|
yield refresh();
|
|
237
237
|
}), [getWaasWalletConnector, refresh, getWalletsDelegatedStatus]);
|
|
238
238
|
const revokeDelegation = useCallback((wallets) => __awaiter(void 0, void 0, void 0, function* () {
|
|
239
|
+
// Get current wallet statuses to check which ones are actually delegated
|
|
240
|
+
const walletsWithStatus = getWalletsDelegatedStatus();
|
|
239
241
|
for (const wallet of wallets) {
|
|
240
242
|
const walletConnector = getWaasWalletConnector(wallet.chainName);
|
|
241
243
|
if (!walletConnector)
|
|
242
244
|
continue;
|
|
243
|
-
|
|
244
|
-
|
|
245
|
+
// Find the wallet status from getWalletsDelegatedStatus
|
|
246
|
+
const walletStatus = walletsWithStatus.find((w) => w.address === wallet.accountAddress && w.chain === wallet.chainName);
|
|
247
|
+
if (!walletStatus || walletStatus.status !== 'delegated') {
|
|
248
|
+
logger.warn('Wallet is not delegated, skipping revoke', {
|
|
249
|
+
accountAddress: wallet.accountAddress,
|
|
250
|
+
chainName: wallet.chainName,
|
|
251
|
+
status: walletStatus === null || walletStatus === void 0 ? void 0 : walletStatus.status,
|
|
252
|
+
});
|
|
245
253
|
continue;
|
|
246
254
|
}
|
|
247
255
|
try {
|
|
@@ -257,7 +265,7 @@ const useWalletDelegation = () => {
|
|
|
257
265
|
}
|
|
258
266
|
}
|
|
259
267
|
yield refresh();
|
|
260
|
-
}), [getWaasWalletConnector, refresh]);
|
|
268
|
+
}), [getWaasWalletConnector, refresh, getWalletsDelegatedStatus]);
|
|
261
269
|
const denyWalletDelegation = useCallback((walletId) => __awaiter(void 0, void 0, void 0, function* () {
|
|
262
270
|
try {
|
|
263
271
|
// Update backend - permanent denial
|
|
@@ -114,7 +114,6 @@ const mapWalletsForRevoke = (wallets) => wallets
|
|
|
114
114
|
.map((wallet) => ({
|
|
115
115
|
accountAddress: wallet.address,
|
|
116
116
|
chainName: wallet.chain,
|
|
117
|
-
status: wallet.status,
|
|
118
117
|
}));
|
|
119
118
|
const mapWalletsForDelegate = (wallets) => wallets.map((wallet) => ({
|
|
120
119
|
accountAddress: wallet.address,
|
|
@@ -13,7 +13,6 @@ export type WalletsDelegatedSettingsViewProps = {
|
|
|
13
13
|
export declare const mapWalletsForRevoke: (wallets: WalletWithStatus[]) => {
|
|
14
14
|
accountAddress: string;
|
|
15
15
|
chainName: ChainEnum;
|
|
16
|
-
status: "delegated";
|
|
17
16
|
}[];
|
|
18
17
|
export declare const mapWalletsForDelegate: (wallets: WalletWithStatus[]) => {
|
|
19
18
|
accountAddress: string;
|
|
@@ -110,7 +110,6 @@ const mapWalletsForRevoke = (wallets) => wallets
|
|
|
110
110
|
.map((wallet) => ({
|
|
111
111
|
accountAddress: wallet.address,
|
|
112
112
|
chainName: wallet.chain,
|
|
113
|
-
status: wallet.status,
|
|
114
113
|
}));
|
|
115
114
|
const mapWalletsForDelegate = (wallets) => wallets.map((wallet) => ({
|
|
116
115
|
accountAddress: wallet.address,
|