@dynamic-labs/waas-evm 4.25.1 → 4.25.3
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 +22 -0
- package/package.cjs +1 -1
- package/package.js +1 -1
- package/package.json +9 -9
- package/src/DynamicWaasEVMConnector.cjs +25 -8
- package/src/DynamicWaasEVMConnector.d.ts +5 -3
- package/src/DynamicWaasEVMConnector.js +25 -8
package/CHANGELOG.md
CHANGED
|
@@ -1,4 +1,26 @@
|
|
|
1
1
|
|
|
2
|
+
### [4.25.3](https://github.com/dynamic-labs/dynamic-auth/compare/v4.25.2...v4.25.3) (2025-07-22)
|
|
3
|
+
|
|
4
|
+
|
|
5
|
+
### Features
|
|
6
|
+
|
|
7
|
+
* add permanentlyDeleteUser for react native ([#8838](https://github.com/dynamic-labs/dynamic-auth/issues/8838)) ([1e00fd1](https://github.com/dynamic-labs/dynamic-auth/commit/1e00fd166f2cef55cd0526a66d9bb3123d10504f))
|
|
8
|
+
|
|
9
|
+
|
|
10
|
+
### Bug Fixes
|
|
11
|
+
|
|
12
|
+
* chain id on dynamic waas for confirmation view and clean up tests ([#9204](https://github.com/dynamic-labs/dynamic-auth/issues/9204)) ([4cebd8b](https://github.com/dynamic-labs/dynamic-auth/commit/4cebd8b63c9327d936ebe1c2305eb4e8f5f69aeb))
|
|
13
|
+
* remove errant calls to fetchMultichainTokenBalances from useEffect ([#9207](https://github.com/dynamic-labs/dynamic-auth/issues/9207)) ([84bacfc](https://github.com/dynamic-labs/dynamic-auth/commit/84bacfc1ddd6b18fde9ba1baed310531b3ec0adc))
|
|
14
|
+
|
|
15
|
+
### [4.25.2](https://github.com/dynamic-labs/dynamic-auth/compare/v4.25.1...v4.25.2) (2025-07-18)
|
|
16
|
+
|
|
17
|
+
|
|
18
|
+
### Bug Fixes
|
|
19
|
+
|
|
20
|
+
* ensure captcha is engaged only once ([#9197](https://github.com/dynamic-labs/dynamic-auth/issues/9197)) ([708edea](https://github.com/dynamic-labs/dynamic-auth/commit/708edea5d492f1dedb398886bf6201d458b40454))
|
|
21
|
+
* **GVTY-3193:** emit embedded wallet create event for waas ([#9179](https://github.com/dynamic-labs/dynamic-auth/issues/9179)) ([59c354d](https://github.com/dynamic-labs/dynamic-auth/commit/59c354d09524eed7d2f7727d1afbb567aabd1da2))
|
|
22
|
+
* reset user/wallet state when removing last wallet ([#9192](https://github.com/dynamic-labs/dynamic-auth/issues/9192)) ([78d84f9](https://github.com/dynamic-labs/dynamic-auth/commit/78d84f9bd6cafd75ec3f18a312600e2bf46db85f))
|
|
23
|
+
|
|
2
24
|
### [4.25.1](https://github.com/dynamic-labs/dynamic-auth/compare/v4.25.0...v4.25.1) (2025-07-18)
|
|
3
25
|
|
|
4
26
|
|
package/package.cjs
CHANGED
package/package.js
CHANGED
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@dynamic-labs/waas-evm",
|
|
3
|
-
"version": "4.25.
|
|
3
|
+
"version": "4.25.3",
|
|
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",
|
|
@@ -18,15 +18,15 @@
|
|
|
18
18
|
},
|
|
19
19
|
"homepage": "https://www.dynamic.xyz/",
|
|
20
20
|
"dependencies": {
|
|
21
|
-
"@dynamic-labs/sdk-api-core": "0.0.
|
|
21
|
+
"@dynamic-labs/sdk-api-core": "0.0.724",
|
|
22
22
|
"viem": "^2.28.4",
|
|
23
|
-
"@dynamic-labs/assert-package-version": "4.25.
|
|
24
|
-
"@dynamic-labs/ethereum-core": "4.25.
|
|
25
|
-
"@dynamic-labs/logger": "4.25.
|
|
26
|
-
"@dynamic-labs/types": "4.25.
|
|
27
|
-
"@dynamic-labs/utils": "4.25.
|
|
28
|
-
"@dynamic-labs/waas": "4.25.
|
|
29
|
-
"@dynamic-labs/wallet-connector-core": "4.25.
|
|
23
|
+
"@dynamic-labs/assert-package-version": "4.25.3",
|
|
24
|
+
"@dynamic-labs/ethereum-core": "4.25.3",
|
|
25
|
+
"@dynamic-labs/logger": "4.25.3",
|
|
26
|
+
"@dynamic-labs/types": "4.25.3",
|
|
27
|
+
"@dynamic-labs/utils": "4.25.3",
|
|
28
|
+
"@dynamic-labs/waas": "4.25.3",
|
|
29
|
+
"@dynamic-labs/wallet-connector-core": "4.25.3"
|
|
30
30
|
},
|
|
31
31
|
"peerDependencies": {}
|
|
32
32
|
}
|
|
@@ -35,8 +35,23 @@ class DynamicWaasEVMConnector extends waas.withDynamicWaas(ethereumCore.Ethereum
|
|
|
35
35
|
this.name = 'Dynamic Waas';
|
|
36
36
|
this.overrideKey = 'dynamicwaas';
|
|
37
37
|
this.isEmbeddedWallet = true;
|
|
38
|
+
this._selectedChainId = this.getLastUsedChainId();
|
|
38
39
|
this.__exportHandler = new WaasExportHandler();
|
|
39
40
|
}
|
|
41
|
+
getLastUsedChainId() {
|
|
42
|
+
var _a;
|
|
43
|
+
logger.logVerboseTroubleshootingMessage('[DynamicWaasEVMConnector] getLastUsedChainId', {
|
|
44
|
+
evmNetworks: this.evmNetworks,
|
|
45
|
+
lastUsedChainId: this.lastUsedChainId,
|
|
46
|
+
});
|
|
47
|
+
if (this.lastUsedChainId) {
|
|
48
|
+
return this.lastUsedChainId;
|
|
49
|
+
}
|
|
50
|
+
if (!((_a = this.evmNetworks) === null || _a === void 0 ? void 0 : _a.length)) {
|
|
51
|
+
return undefined;
|
|
52
|
+
}
|
|
53
|
+
return this.evmNetworks[0].chainId;
|
|
54
|
+
}
|
|
40
55
|
set verifiedCredentials(verifiedCredentials) {
|
|
41
56
|
this._verifiedCredentials = verifiedCredentials;
|
|
42
57
|
}
|
|
@@ -68,15 +83,16 @@ class DynamicWaasEVMConnector extends waas.withDynamicWaas(ethereumCore.Ethereum
|
|
|
68
83
|
this.verifiedCredential = dynamicWaasVerifiedCredential;
|
|
69
84
|
this.verifiedCredentials = dynamicWaasVerifiedCredentials;
|
|
70
85
|
}
|
|
71
|
-
|
|
86
|
+
set lastUsedChainId(chainId) {
|
|
72
87
|
if (chainId === undefined) {
|
|
73
88
|
localStorage.removeItem(DynamicWaasEVMConnector.lastUsedChainIdStorageKey);
|
|
74
89
|
}
|
|
75
90
|
else {
|
|
76
91
|
localStorage.setItem(DynamicWaasEVMConnector.lastUsedChainIdStorageKey, chainId.toString());
|
|
77
92
|
}
|
|
93
|
+
this._selectedChainId = chainId;
|
|
78
94
|
}
|
|
79
|
-
|
|
95
|
+
get lastUsedChainId() {
|
|
80
96
|
const lastUsedChainIdLS = localStorage.getItem(DynamicWaasEVMConnector.lastUsedChainIdStorageKey);
|
|
81
97
|
if (!lastUsedChainIdLS)
|
|
82
98
|
return undefined;
|
|
@@ -88,7 +104,7 @@ class DynamicWaasEVMConnector extends waas.withDynamicWaas(ethereumCore.Ethereum
|
|
|
88
104
|
const isChainCurrentlyEnabled = this.evmNetworks.some((network) => network.chainId === chainId);
|
|
89
105
|
if (!isChainCurrentlyEnabled) {
|
|
90
106
|
const lastUsedChainId = this.evmNetworks[0].chainId;
|
|
91
|
-
this.
|
|
107
|
+
this.lastUsedChainId = lastUsedChainId;
|
|
92
108
|
return lastUsedChainId;
|
|
93
109
|
}
|
|
94
110
|
return chainId;
|
|
@@ -98,20 +114,20 @@ class DynamicWaasEVMConnector extends waas.withDynamicWaas(ethereumCore.Ethereum
|
|
|
98
114
|
return undefined;
|
|
99
115
|
}
|
|
100
116
|
}
|
|
101
|
-
currentChainId() {
|
|
117
|
+
get currentChainId() {
|
|
102
118
|
var _a, _b, _c;
|
|
103
|
-
return (_a = this.
|
|
119
|
+
return (_a = this._selectedChainId) !== null && _a !== void 0 ? _a : (_c = (_b = this.evmNetworks) === null || _b === void 0 ? void 0 : _b[0]) === null || _c === void 0 ? void 0 : _c.chainId;
|
|
104
120
|
}
|
|
105
121
|
getNetwork() {
|
|
106
122
|
return _tslib.__awaiter(this, void 0, void 0, function* () {
|
|
107
|
-
return this.currentChainId
|
|
123
|
+
return this.currentChainId;
|
|
108
124
|
});
|
|
109
125
|
}
|
|
110
126
|
getEvmNetworkByChainId(chainId) {
|
|
111
127
|
return this.evmNetworks.find((network) => network.chainId === chainId);
|
|
112
128
|
}
|
|
113
129
|
currentEvmNetwork() {
|
|
114
|
-
const chainId = this.currentChainId
|
|
130
|
+
const chainId = this.currentChainId;
|
|
115
131
|
if (!chainId) {
|
|
116
132
|
return undefined;
|
|
117
133
|
}
|
|
@@ -126,7 +142,8 @@ class DynamicWaasEVMConnector extends waas.withDynamicWaas(ethereumCore.Ethereum
|
|
|
126
142
|
if (typeof networkChainId === 'string') {
|
|
127
143
|
networkChainIdInt = parseInt(networkChainId);
|
|
128
144
|
}
|
|
129
|
-
this.
|
|
145
|
+
this.lastUsedChainId = networkChainIdInt;
|
|
146
|
+
this._selectedChainId = networkChainIdInt;
|
|
130
147
|
this.emit('chainChange', {
|
|
131
148
|
chain: networkChainIdInt.toString(),
|
|
132
149
|
});
|
|
@@ -44,15 +44,17 @@ export declare class DynamicWaasEVMConnector extends DynamicWaasEVMConnector_bas
|
|
|
44
44
|
private _verifiedCredential;
|
|
45
45
|
private _verifiedCredentials;
|
|
46
46
|
static lastUsedChainIdStorageKey: string;
|
|
47
|
+
private _selectedChainId;
|
|
47
48
|
constructor(props: EthereumWalletConnectorOpts);
|
|
49
|
+
private getLastUsedChainId;
|
|
48
50
|
set verifiedCredentials(verifiedCredentials: JwtVerifiedCredentialWithSmartWalletRef[] | undefined);
|
|
49
51
|
get verifiedCredentials(): JwtVerifiedCredentialWithSmartWalletRef[] | undefined;
|
|
50
52
|
set verifiedCredential(verifiedCredential: JwtVerifiedCredentialWithSmartWalletRef | undefined);
|
|
51
53
|
get verifiedCredential(): JwtVerifiedCredentialWithSmartWalletRef | undefined;
|
|
52
54
|
setVerifiedCredentials(verifiedCredentials: JwtVerifiedCredential[]): void;
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
private currentChainId;
|
|
55
|
+
set lastUsedChainId(chainId: number | undefined);
|
|
56
|
+
get lastUsedChainId(): number | undefined;
|
|
57
|
+
private get currentChainId();
|
|
56
58
|
getNetwork(): Promise<number | undefined>;
|
|
57
59
|
private getEvmNetworkByChainId;
|
|
58
60
|
private currentEvmNetwork;
|
|
@@ -31,8 +31,23 @@ class DynamicWaasEVMConnector extends withDynamicWaas(EthereumWalletConnector) {
|
|
|
31
31
|
this.name = 'Dynamic Waas';
|
|
32
32
|
this.overrideKey = 'dynamicwaas';
|
|
33
33
|
this.isEmbeddedWallet = true;
|
|
34
|
+
this._selectedChainId = this.getLastUsedChainId();
|
|
34
35
|
this.__exportHandler = new WaasExportHandler();
|
|
35
36
|
}
|
|
37
|
+
getLastUsedChainId() {
|
|
38
|
+
var _a;
|
|
39
|
+
logger.logVerboseTroubleshootingMessage('[DynamicWaasEVMConnector] getLastUsedChainId', {
|
|
40
|
+
evmNetworks: this.evmNetworks,
|
|
41
|
+
lastUsedChainId: this.lastUsedChainId,
|
|
42
|
+
});
|
|
43
|
+
if (this.lastUsedChainId) {
|
|
44
|
+
return this.lastUsedChainId;
|
|
45
|
+
}
|
|
46
|
+
if (!((_a = this.evmNetworks) === null || _a === void 0 ? void 0 : _a.length)) {
|
|
47
|
+
return undefined;
|
|
48
|
+
}
|
|
49
|
+
return this.evmNetworks[0].chainId;
|
|
50
|
+
}
|
|
36
51
|
set verifiedCredentials(verifiedCredentials) {
|
|
37
52
|
this._verifiedCredentials = verifiedCredentials;
|
|
38
53
|
}
|
|
@@ -64,15 +79,16 @@ class DynamicWaasEVMConnector extends withDynamicWaas(EthereumWalletConnector) {
|
|
|
64
79
|
this.verifiedCredential = dynamicWaasVerifiedCredential;
|
|
65
80
|
this.verifiedCredentials = dynamicWaasVerifiedCredentials;
|
|
66
81
|
}
|
|
67
|
-
|
|
82
|
+
set lastUsedChainId(chainId) {
|
|
68
83
|
if (chainId === undefined) {
|
|
69
84
|
localStorage.removeItem(DynamicWaasEVMConnector.lastUsedChainIdStorageKey);
|
|
70
85
|
}
|
|
71
86
|
else {
|
|
72
87
|
localStorage.setItem(DynamicWaasEVMConnector.lastUsedChainIdStorageKey, chainId.toString());
|
|
73
88
|
}
|
|
89
|
+
this._selectedChainId = chainId;
|
|
74
90
|
}
|
|
75
|
-
|
|
91
|
+
get lastUsedChainId() {
|
|
76
92
|
const lastUsedChainIdLS = localStorage.getItem(DynamicWaasEVMConnector.lastUsedChainIdStorageKey);
|
|
77
93
|
if (!lastUsedChainIdLS)
|
|
78
94
|
return undefined;
|
|
@@ -84,7 +100,7 @@ class DynamicWaasEVMConnector extends withDynamicWaas(EthereumWalletConnector) {
|
|
|
84
100
|
const isChainCurrentlyEnabled = this.evmNetworks.some((network) => network.chainId === chainId);
|
|
85
101
|
if (!isChainCurrentlyEnabled) {
|
|
86
102
|
const lastUsedChainId = this.evmNetworks[0].chainId;
|
|
87
|
-
this.
|
|
103
|
+
this.lastUsedChainId = lastUsedChainId;
|
|
88
104
|
return lastUsedChainId;
|
|
89
105
|
}
|
|
90
106
|
return chainId;
|
|
@@ -94,20 +110,20 @@ class DynamicWaasEVMConnector extends withDynamicWaas(EthereumWalletConnector) {
|
|
|
94
110
|
return undefined;
|
|
95
111
|
}
|
|
96
112
|
}
|
|
97
|
-
currentChainId() {
|
|
113
|
+
get currentChainId() {
|
|
98
114
|
var _a, _b, _c;
|
|
99
|
-
return (_a = this.
|
|
115
|
+
return (_a = this._selectedChainId) !== null && _a !== void 0 ? _a : (_c = (_b = this.evmNetworks) === null || _b === void 0 ? void 0 : _b[0]) === null || _c === void 0 ? void 0 : _c.chainId;
|
|
100
116
|
}
|
|
101
117
|
getNetwork() {
|
|
102
118
|
return __awaiter(this, void 0, void 0, function* () {
|
|
103
|
-
return this.currentChainId
|
|
119
|
+
return this.currentChainId;
|
|
104
120
|
});
|
|
105
121
|
}
|
|
106
122
|
getEvmNetworkByChainId(chainId) {
|
|
107
123
|
return this.evmNetworks.find((network) => network.chainId === chainId);
|
|
108
124
|
}
|
|
109
125
|
currentEvmNetwork() {
|
|
110
|
-
const chainId = this.currentChainId
|
|
126
|
+
const chainId = this.currentChainId;
|
|
111
127
|
if (!chainId) {
|
|
112
128
|
return undefined;
|
|
113
129
|
}
|
|
@@ -122,7 +138,8 @@ class DynamicWaasEVMConnector extends withDynamicWaas(EthereumWalletConnector) {
|
|
|
122
138
|
if (typeof networkChainId === 'string') {
|
|
123
139
|
networkChainIdInt = parseInt(networkChainId);
|
|
124
140
|
}
|
|
125
|
-
this.
|
|
141
|
+
this.lastUsedChainId = networkChainIdInt;
|
|
142
|
+
this._selectedChainId = networkChainIdInt;
|
|
126
143
|
this.emit('chainChange', {
|
|
127
144
|
chain: networkChainIdInt.toString(),
|
|
128
145
|
});
|