@dynamic-labs/ethereum-aa 4.7.1 → 4.8.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 +26 -0
- package/package.cjs +1 -1
- package/package.js +1 -1
- package/package.json +8 -8
- package/src/utils/fetchZeroDevChain.cjs +6 -4
- package/src/utils/fetchZeroDevChain.d.ts +1 -1
- package/src/utils/fetchZeroDevChain.js +6 -4
package/CHANGELOG.md
CHANGED
|
@@ -1,4 +1,30 @@
|
|
|
1
1
|
|
|
2
|
+
## [4.8.0](https://github.com/dynamic-labs/dynamic-auth/compare/v4.7.2...v4.8.0) (2025-02-25)
|
|
3
|
+
|
|
4
|
+
|
|
5
|
+
### Features
|
|
6
|
+
|
|
7
|
+
* add support for network switching for SOL wallets ([#8095](https://github.com/dynamic-labs/dynamic-auth/issues/8095)) ([8997b39](https://github.com/dynamic-labs/dynamic-auth/commit/8997b399e1e5cd294aad8b719d39928eed5e911d))
|
|
8
|
+
* add support for solNetworks override ([#8138](https://github.com/dynamic-labs/dynamic-auth/issues/8138)) ([8c3f374](https://github.com/dynamic-labs/dynamic-auth/commit/8c3f374a9b2b451f984aed98e7ce506552e2a6c5))
|
|
9
|
+
* **react-native:** add account abstraction multi-chain ([#8132](https://github.com/dynamic-labs/dynamic-auth/issues/8132)) ([c64a26e](https://github.com/dynamic-labs/dynamic-auth/commit/c64a26e16943d913edf4683084f59592a9aeedfc))
|
|
10
|
+
|
|
11
|
+
|
|
12
|
+
### Bug Fixes
|
|
13
|
+
|
|
14
|
+
* ensure zero dev network cache use project id ([#8133](https://github.com/dynamic-labs/dynamic-auth/issues/8133)) ([408c4ed](https://github.com/dynamic-labs/dynamic-auth/commit/408c4ed764a623b6d870cd24973320e5ca4a74c7))
|
|
15
|
+
|
|
16
|
+
### [4.7.2](https://github.com/dynamic-labs/dynamic-auth/compare/v4.7.1...v4.7.2) (2025-02-22)
|
|
17
|
+
|
|
18
|
+
### Features
|
|
19
|
+
|
|
20
|
+
* add bitcoin rune support for token balances ([95640](https://github.com/dynamic-labs/dynamic-auth/commit/956403dc0e427e9a99c62e189fc59de0d8b11e1b))
|
|
21
|
+
|
|
22
|
+
### Bug Fixes
|
|
23
|
+
|
|
24
|
+
* hidrate the user state when a valid token is present ([#8116](https://github.com/dynamic-labs/dynamic-auth/issues/8116)) ([dad5837](https://github.com/dynamic-labs/dynamic-auth/commit/dad58373c4c2fe0c870d918474d6a1f541eae659))
|
|
25
|
+
* prompt to re-establish wallet connect session for secondary wallets ([#8111](https://github.com/dynamic-labs/dynamic-auth/issues/8111)) ([c713ead](https://github.com/dynamic-labs/dynamic-auth/commit/c713ead0611c658aea3d7aca534c2ba2c3cab584))
|
|
26
|
+
* upgrade elliptic ([#8106](https://github.com/dynamic-labs/dynamic-auth/issues/8106)) ([359c873](https://github.com/dynamic-labs/dynamic-auth/commit/359c8733fdd8c0510c2f0018ee0fefa337847aae))
|
|
27
|
+
|
|
2
28
|
### [4.7.1](https://github.com/dynamic-labs/dynamic-auth/compare/v4.7.0...v4.7.1) (2025-02-20)
|
|
3
29
|
|
|
4
30
|
|
package/package.cjs
CHANGED
package/package.js
CHANGED
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@dynamic-labs/ethereum-aa",
|
|
3
|
-
"version": "4.
|
|
3
|
+
"version": "4.8.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",
|
|
@@ -22,13 +22,13 @@
|
|
|
22
22
|
"@zerodev/ecdsa-validator": "5.4.4",
|
|
23
23
|
"@zerodev/multi-chain-ecdsa-validator": "5.4.3",
|
|
24
24
|
"@zerodev/sdk": "5.4.21",
|
|
25
|
-
"@dynamic-labs/assert-package-version": "4.
|
|
26
|
-
"@dynamic-labs/ethereum-core": "4.
|
|
27
|
-
"@dynamic-labs/logger": "4.
|
|
28
|
-
"@dynamic-labs/types": "4.
|
|
29
|
-
"@dynamic-labs/utils": "4.
|
|
30
|
-
"@dynamic-labs/wallet-book": "4.
|
|
31
|
-
"@dynamic-labs/wallet-connector-core": "4.
|
|
25
|
+
"@dynamic-labs/assert-package-version": "4.8.0",
|
|
26
|
+
"@dynamic-labs/ethereum-core": "4.8.0",
|
|
27
|
+
"@dynamic-labs/logger": "4.8.0",
|
|
28
|
+
"@dynamic-labs/types": "4.8.0",
|
|
29
|
+
"@dynamic-labs/utils": "4.8.0",
|
|
30
|
+
"@dynamic-labs/wallet-book": "4.8.0",
|
|
31
|
+
"@dynamic-labs/wallet-connector-core": "4.8.0"
|
|
32
32
|
},
|
|
33
33
|
"peerDependencies": {
|
|
34
34
|
"viem": "^2.21.55"
|
|
@@ -7,15 +7,17 @@ var _tslib = require('../../_virtual/_tslib.cjs');
|
|
|
7
7
|
var ethereumCore = require('@dynamic-labs/ethereum-core');
|
|
8
8
|
var logger = require('./logger.cjs');
|
|
9
9
|
|
|
10
|
-
const
|
|
10
|
+
const CACHED_CHAIN_ID_KEY = 'dynamic_zd_chain_id';
|
|
11
|
+
const getCachedChainIdKey = (projectId) => `${CACHED_CHAIN_ID_KEY}-${projectId}`;
|
|
11
12
|
const fetchZeroDevChain = (projectId) => _tslib.__awaiter(void 0, void 0, void 0, function* () {
|
|
12
13
|
try {
|
|
13
|
-
const
|
|
14
|
+
const cacheKey = getCachedChainIdKey(projectId);
|
|
15
|
+
const cachedChainId = localStorage.getItem(cacheKey);
|
|
14
16
|
if (cachedChainId) {
|
|
15
17
|
return ethereumCore.chainsMap[cachedChainId];
|
|
16
18
|
}
|
|
17
19
|
const response = yield (yield fetch(`https://prod-api.zerodev.app/projects/${projectId}`)).json();
|
|
18
|
-
localStorage.setItem(
|
|
20
|
+
localStorage.setItem(cacheKey, response.chainId);
|
|
19
21
|
return ethereumCore.chainsMap[response.chainId];
|
|
20
22
|
}
|
|
21
23
|
catch (err) {
|
|
@@ -25,5 +27,5 @@ const fetchZeroDevChain = (projectId) => _tslib.__awaiter(void 0, void 0, void 0
|
|
|
25
27
|
}
|
|
26
28
|
});
|
|
27
29
|
|
|
28
|
-
exports.cachedChainIdKey = cachedChainIdKey;
|
|
29
30
|
exports.fetchZeroDevChain = fetchZeroDevChain;
|
|
31
|
+
exports.getCachedChainIdKey = getCachedChainIdKey;
|
|
@@ -3,15 +3,17 @@ import { __awaiter } from '../../_virtual/_tslib.js';
|
|
|
3
3
|
import { chainsMap } from '@dynamic-labs/ethereum-core';
|
|
4
4
|
import { logger } from './logger.js';
|
|
5
5
|
|
|
6
|
-
const
|
|
6
|
+
const CACHED_CHAIN_ID_KEY = 'dynamic_zd_chain_id';
|
|
7
|
+
const getCachedChainIdKey = (projectId) => `${CACHED_CHAIN_ID_KEY}-${projectId}`;
|
|
7
8
|
const fetchZeroDevChain = (projectId) => __awaiter(void 0, void 0, void 0, function* () {
|
|
8
9
|
try {
|
|
9
|
-
const
|
|
10
|
+
const cacheKey = getCachedChainIdKey(projectId);
|
|
11
|
+
const cachedChainId = localStorage.getItem(cacheKey);
|
|
10
12
|
if (cachedChainId) {
|
|
11
13
|
return chainsMap[cachedChainId];
|
|
12
14
|
}
|
|
13
15
|
const response = yield (yield fetch(`https://prod-api.zerodev.app/projects/${projectId}`)).json();
|
|
14
|
-
localStorage.setItem(
|
|
16
|
+
localStorage.setItem(cacheKey, response.chainId);
|
|
15
17
|
return chainsMap[response.chainId];
|
|
16
18
|
}
|
|
17
19
|
catch (err) {
|
|
@@ -21,4 +23,4 @@ const fetchZeroDevChain = (projectId) => __awaiter(void 0, void 0, void 0, funct
|
|
|
21
23
|
}
|
|
22
24
|
});
|
|
23
25
|
|
|
24
|
-
export {
|
|
26
|
+
export { fetchZeroDevChain, getCachedChainIdKey };
|