@dynamic-labs/sdk-react-core 4.11.1 → 4.11.2
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 +12 -0
- package/package.cjs +1 -1
- package/package.js +1 -1
- package/package.json +11 -11
- package/src/lib/store/state/nonce/nonce.cjs +25 -1
- package/src/lib/store/state/nonce/nonce.js +25 -1
- package/src/lib/styles/index.shadow.cjs +1 -1
- package/src/lib/styles/index.shadow.js +1 -1
- package/src/lib/utils/hooks/useWalletConnectors/utils/smartWallet/smartWallet.cjs +3 -5
- package/src/lib/utils/hooks/useWalletConnectors/utils/smartWallet/smartWallet.js +3 -5
package/CHANGELOG.md
CHANGED
|
@@ -1,4 +1,16 @@
|
|
|
1
1
|
|
|
2
|
+
### [4.11.2](https://github.com/dynamic-labs/dynamic-auth/compare/v4.11.1...v4.11.2) (2025-04-11)
|
|
3
|
+
|
|
4
|
+
|
|
5
|
+
### Bug Fixes
|
|
6
|
+
|
|
7
|
+
* correctly expire nonce ([#8518](https://github.com/dynamic-labs/dynamic-auth/issues/8518)) ([14c4eb1](https://github.com/dynamic-labs/dynamic-auth/commit/14c4eb143b8a6debc91fb0cb6aafe8336b370927))
|
|
8
|
+
* profile aspect ratio ([#8510](https://github.com/dynamic-labs/dynamic-auth/issues/8510)) ([869615d](https://github.com/dynamic-labs/dynamic-auth/commit/869615d00144d2df5c61eaa5ab39700114739732))
|
|
9
|
+
* **react-native:** ensure secure storage items are saved sequentially ([#8512](https://github.com/dynamic-labs/dynamic-auth/issues/8512)) ([53e2f7f](https://github.com/dynamic-labs/dynamic-auth/commit/53e2f7f47ce3ae79c781fcd3b9a446a0edbf4246))
|
|
10
|
+
* **react-native:** reload react-native webview when it is unmounted by OS ([#8477](https://github.com/dynamic-labs/dynamic-auth/issues/8477)) ([09e20a4](https://github.com/dynamic-labs/dynamic-auth/commit/09e20a418afd592fa31dffd7645729e0e77a8b3d))
|
|
11
|
+
* **react-native:** sync state with client when SDK fully loaded ([#8476](https://github.com/dynamic-labs/dynamic-auth/issues/8476)) ([bae8814](https://github.com/dynamic-labs/dynamic-auth/commit/bae88141e7d74e1ff453ee33ee16316c18e803d1))
|
|
12
|
+
* wallet standard wallets not sending SOL ([#8515](https://github.com/dynamic-labs/dynamic-auth/issues/8515)) ([0db973a](https://github.com/dynamic-labs/dynamic-auth/commit/0db973aceb5dc05cda142ceffcc925f9523a452d))
|
|
13
|
+
|
|
2
14
|
### [4.11.1](https://github.com/dynamic-labs/dynamic-auth/compare/v4.11.0...v4.11.1) (2025-04-09)
|
|
3
15
|
|
|
4
16
|
|
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.11.
|
|
3
|
+
"version": "4.11.2",
|
|
4
4
|
"dependencies": {
|
|
5
5
|
"@dynamic-labs/sdk-api-core": "0.0.650",
|
|
6
6
|
"@hcaptcha/react-hcaptcha": "1.4.4",
|
|
@@ -14,16 +14,16 @@
|
|
|
14
14
|
"yup": "0.32.11",
|
|
15
15
|
"react-international-phone": "4.2.5",
|
|
16
16
|
"bs58": "5.0.0",
|
|
17
|
-
"@dynamic-labs/assert-package-version": "4.11.
|
|
18
|
-
"@dynamic-labs/iconic": "4.11.
|
|
19
|
-
"@dynamic-labs/logger": "4.11.
|
|
20
|
-
"@dynamic-labs/multi-wallet": "4.11.
|
|
21
|
-
"@dynamic-labs/rpc-providers": "4.11.
|
|
22
|
-
"@dynamic-labs/store": "4.11.
|
|
23
|
-
"@dynamic-labs/types": "4.11.
|
|
24
|
-
"@dynamic-labs/utils": "4.11.
|
|
25
|
-
"@dynamic-labs/wallet-book": "4.11.
|
|
26
|
-
"@dynamic-labs/wallet-connector-core": "4.11.
|
|
17
|
+
"@dynamic-labs/assert-package-version": "4.11.2",
|
|
18
|
+
"@dynamic-labs/iconic": "4.11.2",
|
|
19
|
+
"@dynamic-labs/logger": "4.11.2",
|
|
20
|
+
"@dynamic-labs/multi-wallet": "4.11.2",
|
|
21
|
+
"@dynamic-labs/rpc-providers": "4.11.2",
|
|
22
|
+
"@dynamic-labs/store": "4.11.2",
|
|
23
|
+
"@dynamic-labs/types": "4.11.2",
|
|
24
|
+
"@dynamic-labs/utils": "4.11.2",
|
|
25
|
+
"@dynamic-labs/wallet-book": "4.11.2",
|
|
26
|
+
"@dynamic-labs/wallet-connector-core": "4.11.2",
|
|
27
27
|
"eventemitter3": "5.0.1"
|
|
28
28
|
},
|
|
29
29
|
"devDependencies": {
|
|
@@ -10,7 +10,7 @@ require('../../../config/ApiEndpoint.cjs');
|
|
|
10
10
|
require('../projectSettings/projectSettings.cjs');
|
|
11
11
|
require('../../../utils/constants/values.cjs');
|
|
12
12
|
require('@dynamic-labs/multi-wallet');
|
|
13
|
-
require('../../../shared/logger.cjs');
|
|
13
|
+
var logger = require('../../../shared/logger.cjs');
|
|
14
14
|
require('../../../utils/constants/colors.cjs');
|
|
15
15
|
require('react-international-phone');
|
|
16
16
|
require('@dynamic-labs/iconic');
|
|
@@ -107,14 +107,38 @@ const storeNewNonce = (newNonce) => {
|
|
|
107
107
|
nonce: newNonce,
|
|
108
108
|
});
|
|
109
109
|
};
|
|
110
|
+
let nonceExpiryTimeout;
|
|
111
|
+
const checkAndExpireNonceWhenRequired = () => {
|
|
112
|
+
const nonce = getNonceRaw();
|
|
113
|
+
if (!(nonce === null || nonce === void 0 ? void 0 : nonce.expiresAt)) {
|
|
114
|
+
return;
|
|
115
|
+
}
|
|
116
|
+
if (nonceExpiryTimeout) {
|
|
117
|
+
clearTimeout(nonceExpiryTimeout);
|
|
118
|
+
}
|
|
119
|
+
const timeToExpire = nonce.expiresAt - new Date().getTime();
|
|
120
|
+
const timeout = timeToExpire > 0 ? timeToExpire : 0;
|
|
121
|
+
nonceExpiryTimeout = setTimeout(() => {
|
|
122
|
+
logger.logger.debug('[Nonce] Expiring nonce', {
|
|
123
|
+
expiresAt: nonce.expiresAt,
|
|
124
|
+
nonce: nonce.nonce,
|
|
125
|
+
});
|
|
126
|
+
setNonce({
|
|
127
|
+
expiresAt: undefined,
|
|
128
|
+
nonce: undefined,
|
|
129
|
+
});
|
|
130
|
+
}, timeout);
|
|
131
|
+
};
|
|
110
132
|
const useFetchNonce = ({ shouldFetch = true, retries = 2, } = {}) => {
|
|
111
133
|
const nonce = useNonce();
|
|
112
134
|
const environmentId = dynamicContextProps.useEnvironmentId();
|
|
135
|
+
checkAndExpireNonceWhenRequired();
|
|
113
136
|
const { retrigger } = usePromise.usePromise(() => _tslib.__awaiter(void 0, void 0, void 0, function* () { return utils$1.getNonce(environmentId); }), {
|
|
114
137
|
deps: [environmentId],
|
|
115
138
|
enabled: shouldFetch && !nonce,
|
|
116
139
|
onResolve: (newNonce) => {
|
|
117
140
|
storeNewNonce(newNonce);
|
|
141
|
+
checkAndExpireNonceWhenRequired();
|
|
118
142
|
},
|
|
119
143
|
retries,
|
|
120
144
|
});
|
|
@@ -6,7 +6,7 @@ import '../../../config/ApiEndpoint.js';
|
|
|
6
6
|
import '../projectSettings/projectSettings.js';
|
|
7
7
|
import '../../../utils/constants/values.js';
|
|
8
8
|
import '@dynamic-labs/multi-wallet';
|
|
9
|
-
import '../../../shared/logger.js';
|
|
9
|
+
import { logger } from '../../../shared/logger.js';
|
|
10
10
|
import '../../../utils/constants/colors.js';
|
|
11
11
|
import 'react-international-phone';
|
|
12
12
|
import '@dynamic-labs/iconic';
|
|
@@ -103,14 +103,38 @@ const storeNewNonce = (newNonce) => {
|
|
|
103
103
|
nonce: newNonce,
|
|
104
104
|
});
|
|
105
105
|
};
|
|
106
|
+
let nonceExpiryTimeout;
|
|
107
|
+
const checkAndExpireNonceWhenRequired = () => {
|
|
108
|
+
const nonce = getNonceRaw();
|
|
109
|
+
if (!(nonce === null || nonce === void 0 ? void 0 : nonce.expiresAt)) {
|
|
110
|
+
return;
|
|
111
|
+
}
|
|
112
|
+
if (nonceExpiryTimeout) {
|
|
113
|
+
clearTimeout(nonceExpiryTimeout);
|
|
114
|
+
}
|
|
115
|
+
const timeToExpire = nonce.expiresAt - new Date().getTime();
|
|
116
|
+
const timeout = timeToExpire > 0 ? timeToExpire : 0;
|
|
117
|
+
nonceExpiryTimeout = setTimeout(() => {
|
|
118
|
+
logger.debug('[Nonce] Expiring nonce', {
|
|
119
|
+
expiresAt: nonce.expiresAt,
|
|
120
|
+
nonce: nonce.nonce,
|
|
121
|
+
});
|
|
122
|
+
setNonce({
|
|
123
|
+
expiresAt: undefined,
|
|
124
|
+
nonce: undefined,
|
|
125
|
+
});
|
|
126
|
+
}, timeout);
|
|
127
|
+
};
|
|
106
128
|
const useFetchNonce = ({ shouldFetch = true, retries = 2, } = {}) => {
|
|
107
129
|
const nonce = useNonce();
|
|
108
130
|
const environmentId = useEnvironmentId();
|
|
131
|
+
checkAndExpireNonceWhenRequired();
|
|
109
132
|
const { retrigger } = usePromise(() => __awaiter(void 0, void 0, void 0, function* () { return getNonce$1(environmentId); }), {
|
|
110
133
|
deps: [environmentId],
|
|
111
134
|
enabled: shouldFetch && !nonce,
|
|
112
135
|
onResolve: (newNonce) => {
|
|
113
136
|
storeNewNonce(newNonce);
|
|
137
|
+
checkAndExpireNonceWhenRequired();
|
|
114
138
|
},
|
|
115
139
|
retries,
|
|
116
140
|
});
|