@dynamic-labs/ethereum-aa 4.91.2 → 4.91.4
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 +20 -0
- package/package.cjs +1 -1
- package/package.js +1 -1
- package/package.json +9 -9
- package/src/ZeroDevConnector.cjs +23 -23
- package/src/ZeroDevConnector.js +23 -23
package/CHANGELOG.md
CHANGED
|
@@ -1,4 +1,24 @@
|
|
|
1
1
|
|
|
2
|
+
### [4.91.4](https://github.com/dynamic-labs/dynamic-auth/compare/v4.91.3...v4.91.4) (2026-07-01)
|
|
3
|
+
|
|
4
|
+
|
|
5
|
+
### Bug Fixes
|
|
6
|
+
|
|
7
|
+
* conditionally use /op/ route for AA transactions based on block explorer support ([#11628](https://github.com/dynamic-labs/dynamic-auth/issues/11628)) ([95822dc](https://github.com/dynamic-labs/dynamic-auth/commit/95822dc0edbcd739afe870f0b3881555fdb17eb6))
|
|
8
|
+
* require error codes in all SDK error classes ([#11761](https://github.com/dynamic-labs/dynamic-auth/issues/11761)) ([5744811](https://github.com/dynamic-labs/dynamic-auth/commit/5744811efdd1e415aaf51eec5b3300b323ec1347))
|
|
9
|
+
|
|
10
|
+
### [4.91.3](https://github.com/dynamic-labs/dynamic-auth/compare/v4.91.2...v4.91.3) (2026-06-30)
|
|
11
|
+
|
|
12
|
+
|
|
13
|
+
### Bug Fixes
|
|
14
|
+
|
|
15
|
+
* **bitcoin:** detect late-registering wallet-standard wallets (DYNT-1210) ([#11747](https://github.com/dynamic-labs/dynamic-auth/issues/11747)) ([17809f6](https://github.com/dynamic-labs/dynamic-auth/commit/17809f6e811fe101367cc31a2d899a8d0b0d107e))
|
|
16
|
+
* fetch onramp providers lazily instead of eagerly on mount ([#11767](https://github.com/dynamic-labs/dynamic-auth/issues/11767)) ([3ee6708](https://github.com/dynamic-labs/dynamic-auth/commit/3ee67087142ae1942f865e0ab37b7108700b3327))
|
|
17
|
+
* **iframe-setup:** sync parent URL to iframe on pushState/replaceState ([#11751](https://github.com/dynamic-labs/dynamic-auth/issues/11751)) ([c8be3af](https://github.com/dynamic-labs/dynamic-auth/commit/c8be3afc301f77b349f23398bed940ce40f93b73))
|
|
18
|
+
* **nonce:** fetch nonce on demand when missing before wallet verification ([#11753](https://github.com/dynamic-labs/dynamic-auth/issues/11753)) ([4f01a21](https://github.com/dynamic-labs/dynamic-auth/commit/4f01a21b6081c852f32868c8a5e04d70aaf280a2)), closes [#1](https://github.com/dynamic-labs/dynamic-auth/issues/1)
|
|
19
|
+
* **react-native-extension:** arm loading timer before setUrl to cover pre-onLoadStart gap ([#11764](https://github.com/dynamic-labs/dynamic-auth/issues/11764)) ([31f2015](https://github.com/dynamic-labs/dynamic-auth/commit/31f20151a4b59279f9c133b723e50de771b06436))
|
|
20
|
+
* **webview-controller:** unwrap ZeroDev smart wallet for native gasless ([#11758](https://github.com/dynamic-labs/dynamic-auth/issues/11758)) ([989714e](https://github.com/dynamic-labs/dynamic-auth/commit/989714e414556868c8e0c54401aac1ed7354331b))
|
|
21
|
+
|
|
2
22
|
### [4.91.2](https://github.com/dynamic-labs/dynamic-auth/compare/v4.91.1...v4.91.2) (2026-06-26)
|
|
3
23
|
|
|
4
24
|
|
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.91.
|
|
3
|
+
"version": "4.91.4",
|
|
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,14 +22,14 @@
|
|
|
22
22
|
"@zerodev/ecdsa-validator": "5.4.9",
|
|
23
23
|
"@zerodev/multi-chain-ecdsa-validator": "5.4.5",
|
|
24
24
|
"@zerodev/sdk": "5.5.7",
|
|
25
|
-
"@dynamic-labs/assert-package-version": "4.91.
|
|
26
|
-
"@dynamic-labs/ethereum-aa-core": "4.91.
|
|
27
|
-
"@dynamic-labs/ethereum-core": "4.91.
|
|
28
|
-
"@dynamic-labs/logger": "4.91.
|
|
29
|
-
"@dynamic-labs/types": "4.91.
|
|
30
|
-
"@dynamic-labs/utils": "4.91.
|
|
31
|
-
"@dynamic-labs/wallet-book": "4.91.
|
|
32
|
-
"@dynamic-labs/wallet-connector-core": "4.91.
|
|
25
|
+
"@dynamic-labs/assert-package-version": "4.91.4",
|
|
26
|
+
"@dynamic-labs/ethereum-aa-core": "4.91.4",
|
|
27
|
+
"@dynamic-labs/ethereum-core": "4.91.4",
|
|
28
|
+
"@dynamic-labs/logger": "4.91.4",
|
|
29
|
+
"@dynamic-labs/types": "4.91.4",
|
|
30
|
+
"@dynamic-labs/utils": "4.91.4",
|
|
31
|
+
"@dynamic-labs/wallet-book": "4.91.4",
|
|
32
|
+
"@dynamic-labs/wallet-connector-core": "4.91.4"
|
|
33
33
|
},
|
|
34
34
|
"peerDependencies": {
|
|
35
35
|
"viem": "^2.45.3"
|
package/src/ZeroDevConnector.cjs
CHANGED
|
@@ -186,7 +186,7 @@ class ZeroDevConnector extends ethereumAaCore.AccountAbstractionBaseConnector {
|
|
|
186
186
|
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
|
187
187
|
verifiedCredentials } = _a, properties = _tslib.__rest(_a, ["smartWalletAddress", "eoaAddress", "eoaConnector", "shouldSetEoaConnector", "verifiedCredentials"]);
|
|
188
188
|
if (!eoaConnector) {
|
|
189
|
-
throw new utils.DynamicError('No EOA connector');
|
|
189
|
+
throw new utils.DynamicError('No EOA connector', 'no_eoa_connector');
|
|
190
190
|
}
|
|
191
191
|
// Determine per-wallet 7702 mode: address equality is the defining property of EIP-7702
|
|
192
192
|
// (the EOA itself IS the smart wallet). A 4337 wallet always has a different counterfactual address.
|
|
@@ -220,13 +220,13 @@ class ZeroDevConnector extends ethereumAaCore.AccountAbstractionBaseConnector {
|
|
|
220
220
|
var _a, _b;
|
|
221
221
|
const { eoaConnector } = this;
|
|
222
222
|
if (!eoaConnector) {
|
|
223
|
-
throw new utils.DynamicError('The wallet connector must be an EVM wallet connector to sign EIP-7702 authorizations.');
|
|
223
|
+
throw new utils.DynamicError('The wallet connector must be an EVM wallet connector to sign EIP-7702 authorizations.', 'the_wallet_connector_must_be_an');
|
|
224
224
|
}
|
|
225
225
|
if (!ethereumCore.isEthWalletConnector(eoaConnector)) {
|
|
226
|
-
throw new utils.DynamicError('The wallet connector must be an EVM wallet connector to sign EIP-7702 authorizations.');
|
|
226
|
+
throw new utils.DynamicError('The wallet connector must be an EVM wallet connector to sign EIP-7702 authorizations.', 'the_wallet_connector_must_be_an');
|
|
227
227
|
}
|
|
228
228
|
if (!((_a = eoaConnector.isSignAuthorizationSupported) === null || _a === void 0 ? void 0 : _a.call(eoaConnector))) {
|
|
229
|
-
throw new utils.DynamicError(`The wallet connector (${eoaConnector.key}) does not support EIP-7702 authorization signing. Only embedded wallets (Turnkey, WaaS) support this feature
|
|
229
|
+
throw new utils.DynamicError(`The wallet connector (${eoaConnector.key}) does not support EIP-7702 authorization signing. Only embedded wallets (Turnkey, WaaS) support this feature.`, 'the_wallet_connector_does_not_support');
|
|
230
230
|
}
|
|
231
231
|
let resolvedChainId = chainId;
|
|
232
232
|
if (!resolvedChainId) {
|
|
@@ -236,11 +236,11 @@ class ZeroDevConnector extends ethereumAaCore.AccountAbstractionBaseConnector {
|
|
|
236
236
|
}
|
|
237
237
|
}
|
|
238
238
|
if (!resolvedChainId) {
|
|
239
|
-
throw new utils.DynamicError('Chain ID is required but could not be determined from the wallet. Please provide a chainId parameter.');
|
|
239
|
+
throw new utils.DynamicError('Chain ID is required but could not be determined from the wallet. Please provide a chainId parameter.', 'chain_id_is_required_but_could');
|
|
240
240
|
}
|
|
241
241
|
const walletClient = eoaConnector.getWalletClient(String(resolvedChainId));
|
|
242
242
|
if (!walletClient) {
|
|
243
|
-
throw new utils.DynamicError(`Failed to get wallet client for chain ID ${resolvedChainId}. Ensure the wallet is connected to the correct network
|
|
243
|
+
throw new utils.DynamicError(`Failed to get wallet client for chain ID ${resolvedChainId}. Ensure the wallet is connected to the correct network.`, 'get_wallet_client_for_chain_id');
|
|
244
244
|
}
|
|
245
245
|
return signEip7702Authorization.signEip7702Authorization({
|
|
246
246
|
chainId: resolvedChainId,
|
|
@@ -256,11 +256,11 @@ class ZeroDevConnector extends ethereumAaCore.AccountAbstractionBaseConnector {
|
|
|
256
256
|
return _tslib.__awaiter(this, void 0, void 0, function* () {
|
|
257
257
|
const walletAddress = this.activeWalletAddress;
|
|
258
258
|
if (!walletAddress) {
|
|
259
|
-
throw new utils.DynamicError('No active wallet');
|
|
259
|
+
throw new utils.DynamicError('No active wallet', 'no_active_wallet');
|
|
260
260
|
}
|
|
261
261
|
const walletInfo = this.eoaConnectorMap[walletAddress];
|
|
262
262
|
if (!(walletInfo === null || walletInfo === void 0 ? void 0 : walletInfo.is7702)) {
|
|
263
|
-
throw new utils.DynamicError('Active wallet is not an EIP-7702 wallet');
|
|
263
|
+
throw new utils.DynamicError('Active wallet is not an EIP-7702 wallet', 'active_wallet_is_not_an_eip7702');
|
|
264
264
|
}
|
|
265
265
|
this.pendingEip7702Auth = auth;
|
|
266
266
|
// Clear the cached kernel clients so they get recreated with the new auth
|
|
@@ -382,7 +382,7 @@ class ZeroDevConnector extends ethereumAaCore.AccountAbstractionBaseConnector {
|
|
|
382
382
|
createKernelClient(_a) {
|
|
383
383
|
return _tslib.__awaiter(this, arguments, void 0, function* ({ chainId, eip7702Auth, is7702 = false, projectId, signer, paymaster, paymasterRpcOverride, bundlerRpcOverride, }) {
|
|
384
384
|
if (!signer)
|
|
385
|
-
throw new utils.DynamicError('No signer provided');
|
|
385
|
+
throw new utils.DynamicError('No signer provided', 'no_signer_provided');
|
|
386
386
|
const chain = ethereumCore.chainsMap[chainId];
|
|
387
387
|
let kernelClient;
|
|
388
388
|
const params = {
|
|
@@ -493,7 +493,7 @@ class ZeroDevConnector extends ethereumAaCore.AccountAbstractionBaseConnector {
|
|
|
493
493
|
const chainId = (_c = (_b = chain === null || chain === void 0 ? void 0 : chain.id) === null || _b === void 0 ? void 0 : _b.toString()) !== null && _c !== void 0 ? _c : this.lastUsedChainId;
|
|
494
494
|
const clientId = (_d = this.providersFromApi.find((provider) => provider.chain === chainId)) === null || _d === void 0 ? void 0 : _d.clientId;
|
|
495
495
|
if (!clientId) {
|
|
496
|
-
throw new utils.DynamicError('No client id for chain id: ' + chainId);
|
|
496
|
+
throw new utils.DynamicError('No client id for chain id: ' + chainId, 'no_client_id_for_chain_id');
|
|
497
497
|
}
|
|
498
498
|
const shouldSponsor = Boolean(ZeroDevConnector.defaultToKernelWithSponsorship || paymasterUrl);
|
|
499
499
|
const client = yield this.createKernelClient({
|
|
@@ -506,7 +506,7 @@ class ZeroDevConnector extends ethereumAaCore.AccountAbstractionBaseConnector {
|
|
|
506
506
|
signer,
|
|
507
507
|
});
|
|
508
508
|
if (!client) {
|
|
509
|
-
throw new utils.DynamicError('No kernel client');
|
|
509
|
+
throw new utils.DynamicError('No kernel client', 'no_kernel_client');
|
|
510
510
|
}
|
|
511
511
|
const callData = yield client.account.encodeCalls(calls);
|
|
512
512
|
const hash = yield client.sendUserOperation({
|
|
@@ -529,7 +529,7 @@ class ZeroDevConnector extends ethereumAaCore.AccountAbstractionBaseConnector {
|
|
|
529
529
|
? provider
|
|
530
530
|
: this.kernelClientWithSponsorship;
|
|
531
531
|
if (!effectiveProvider) {
|
|
532
|
-
throw new utils.DynamicError('No provider');
|
|
532
|
+
throw new utils.DynamicError('No provider', 'no_provider');
|
|
533
533
|
}
|
|
534
534
|
const unformattedTransaction = ethereumCore.unFormatTransaction(transaction);
|
|
535
535
|
const key = `${unformattedTransaction.from}-${unformattedTransaction.to}-${unformattedTransaction.data}`;
|
|
@@ -570,10 +570,10 @@ class ZeroDevConnector extends ethereumAaCore.AccountAbstractionBaseConnector {
|
|
|
570
570
|
onSignTransaction: (_c) => _tslib.__awaiter(this, [_c], void 0, function* ({ transaction }) {
|
|
571
571
|
this._walletUiUtils.disabledConfirmationOnce();
|
|
572
572
|
if (!this.eoaConnector) {
|
|
573
|
-
throw new utils.DynamicError('signTransaction requires an EOA connector to be available');
|
|
573
|
+
throw new utils.DynamicError('signTransaction requires an EOA connector to be available', 'signtransaction_requires_an_eoa_connector_to');
|
|
574
574
|
}
|
|
575
575
|
if (!this.eoaAddress) {
|
|
576
|
-
throw new utils.DynamicError('No EOA address');
|
|
576
|
+
throw new utils.DynamicError('No EOA address', 'no_eoa_address');
|
|
577
577
|
}
|
|
578
578
|
let localAccount;
|
|
579
579
|
if (walletConnectorCore.isDynamicWaasConnector(this.eoaConnector)) {
|
|
@@ -585,12 +585,12 @@ class ZeroDevConnector extends ethereumAaCore.AccountAbstractionBaseConnector {
|
|
|
585
585
|
localAccount = yield this.eoaConnector.getAccount();
|
|
586
586
|
}
|
|
587
587
|
else {
|
|
588
|
-
throw new utils.DynamicError('signTransaction is only supported with Dynamic embedded wallets');
|
|
588
|
+
throw new utils.DynamicError('signTransaction is only supported with Dynamic embedded wallets', 'signtransaction_is_only_supported_with_dynamic');
|
|
589
589
|
}
|
|
590
590
|
const tx = ethereumCore.unFormatTransaction(transaction);
|
|
591
591
|
const publicClient = yield this.getPublicClient();
|
|
592
592
|
if (!publicClient) {
|
|
593
|
-
throw new utils.DynamicError('Public client not available');
|
|
593
|
+
throw new utils.DynamicError('Public client not available', 'public_client_not_available');
|
|
594
594
|
}
|
|
595
595
|
const preparedTx = yield publicClient.prepareTransactionRequest(Object.assign(Object.assign({}, tx), { account: this.eoaAddress }));
|
|
596
596
|
return localAccount.signTransaction(preparedTx);
|
|
@@ -696,7 +696,7 @@ class ZeroDevConnector extends ethereumAaCore.AccountAbstractionBaseConnector {
|
|
|
696
696
|
signAndSendUserOperationWithWaas(provider, userOperation) {
|
|
697
697
|
return _tslib.__awaiter(this, void 0, void 0, function* () {
|
|
698
698
|
if (!userOperation) {
|
|
699
|
-
throw new utils.DynamicError('Failed to prepare user operation for transaction');
|
|
699
|
+
throw new utils.DynamicError('Failed to prepare user operation for transaction', 'prepare_user_operation_for_transaction');
|
|
700
700
|
}
|
|
701
701
|
const chainId = Number(this.lastUsedChainId);
|
|
702
702
|
const hash = accountAbstraction.getUserOperationHash({
|
|
@@ -728,7 +728,7 @@ class ZeroDevConnector extends ethereumAaCore.AccountAbstractionBaseConnector {
|
|
|
728
728
|
}
|
|
729
729
|
const { kernelClientWithSponsorship } = this;
|
|
730
730
|
if (!kernelClientWithSponsorship) {
|
|
731
|
-
throw new utils.DynamicError('No kernel client with sponsorship found');
|
|
731
|
+
throw new utils.DynamicError('No kernel client with sponsorship found', 'no_kernel_client_with_sponsorship_found');
|
|
732
732
|
}
|
|
733
733
|
const value = BigInt((_a = transaction.value) !== null && _a !== void 0 ? _a : 0);
|
|
734
734
|
const callData = yield kernelClientWithSponsorship.account.encodeCalls([
|
|
@@ -784,7 +784,7 @@ class ZeroDevConnector extends ethereumAaCore.AccountAbstractionBaseConnector {
|
|
|
784
784
|
var _a;
|
|
785
785
|
const publicClient = (_a = this.kernelClient) === null || _a === void 0 ? void 0 : _a.client;
|
|
786
786
|
if (!publicClient)
|
|
787
|
-
throw new utils.DynamicError('No RPC client');
|
|
787
|
+
throw new utils.DynamicError('No RPC client', 'no_rpc_client');
|
|
788
788
|
return viem.formatEther(yield publicClient.getBalance({
|
|
789
789
|
address: address,
|
|
790
790
|
}));
|
|
@@ -799,11 +799,11 @@ class ZeroDevConnector extends ethereumAaCore.AccountAbstractionBaseConnector {
|
|
|
799
799
|
return _tslib.__awaiter(this, void 0, void 0, function* () {
|
|
800
800
|
var _a, _b;
|
|
801
801
|
if (!this.activeWalletAddress) {
|
|
802
|
-
throw new utils.DynamicError('No active wallet address');
|
|
802
|
+
throw new utils.DynamicError('No active wallet address', 'no_active_wallet_address');
|
|
803
803
|
}
|
|
804
804
|
const client = (_b = (_a = this.providerMap[this.activeWalletAddress]) === null || _a === void 0 ? void 0 : _a[chainId]) === null || _b === void 0 ? void 0 : _b.kernelClient;
|
|
805
805
|
if (!client) {
|
|
806
|
-
throw new utils.DynamicError(`Provider for Chain ID ${chainId} not available. Please make sure that Chain ID ${chainId} is enabled in both the Dynamic dashboard and the ZeroDev dashboard
|
|
806
|
+
throw new utils.DynamicError(`Provider for Chain ID ${chainId} not available. Please make sure that Chain ID ${chainId} is enabled in both the Dynamic dashboard and the ZeroDev dashboard.`, 'provider_for_chain_id_not_available');
|
|
807
807
|
}
|
|
808
808
|
return client.signMessage({ message: messageToSign });
|
|
809
809
|
});
|
|
@@ -812,7 +812,7 @@ class ZeroDevConnector extends ethereumAaCore.AccountAbstractionBaseConnector {
|
|
|
812
812
|
return _tslib.__awaiter(this, void 0, void 0, function* () {
|
|
813
813
|
var _a, _b;
|
|
814
814
|
if (!this.kernelClient) {
|
|
815
|
-
throw new utils.DynamicError('Error fetching signer');
|
|
815
|
+
throw new utils.DynamicError('Error fetching signer', 'fetch_signer_failed');
|
|
816
816
|
}
|
|
817
817
|
if (!this.isActiveWallet7702) {
|
|
818
818
|
return this.kernelClient.signMessage({ message: messageToSign });
|
|
@@ -834,7 +834,7 @@ class ZeroDevConnector extends ethereumAaCore.AccountAbstractionBaseConnector {
|
|
|
834
834
|
var _a, _b;
|
|
835
835
|
const eoa = this.eoaConnectorMap[expectedAddress];
|
|
836
836
|
if (!eoa) {
|
|
837
|
-
throw new utils.DynamicError('No EOA connector');
|
|
837
|
+
throw new utils.DynamicError('No EOA connector', 'no_eoa_connector');
|
|
838
838
|
}
|
|
839
839
|
const { eoaAddress, eoaConnector, is7702, properties } = eoa;
|
|
840
840
|
// Validate the underlying EOA connector
|
package/src/ZeroDevConnector.js
CHANGED
|
@@ -182,7 +182,7 @@ class ZeroDevConnector extends AccountAbstractionBaseConnector {
|
|
|
182
182
|
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
|
183
183
|
verifiedCredentials } = _a, properties = __rest(_a, ["smartWalletAddress", "eoaAddress", "eoaConnector", "shouldSetEoaConnector", "verifiedCredentials"]);
|
|
184
184
|
if (!eoaConnector) {
|
|
185
|
-
throw new DynamicError('No EOA connector');
|
|
185
|
+
throw new DynamicError('No EOA connector', 'no_eoa_connector');
|
|
186
186
|
}
|
|
187
187
|
// Determine per-wallet 7702 mode: address equality is the defining property of EIP-7702
|
|
188
188
|
// (the EOA itself IS the smart wallet). A 4337 wallet always has a different counterfactual address.
|
|
@@ -216,13 +216,13 @@ class ZeroDevConnector extends AccountAbstractionBaseConnector {
|
|
|
216
216
|
var _a, _b;
|
|
217
217
|
const { eoaConnector } = this;
|
|
218
218
|
if (!eoaConnector) {
|
|
219
|
-
throw new DynamicError('The wallet connector must be an EVM wallet connector to sign EIP-7702 authorizations.');
|
|
219
|
+
throw new DynamicError('The wallet connector must be an EVM wallet connector to sign EIP-7702 authorizations.', 'the_wallet_connector_must_be_an');
|
|
220
220
|
}
|
|
221
221
|
if (!isEthWalletConnector(eoaConnector)) {
|
|
222
|
-
throw new DynamicError('The wallet connector must be an EVM wallet connector to sign EIP-7702 authorizations.');
|
|
222
|
+
throw new DynamicError('The wallet connector must be an EVM wallet connector to sign EIP-7702 authorizations.', 'the_wallet_connector_must_be_an');
|
|
223
223
|
}
|
|
224
224
|
if (!((_a = eoaConnector.isSignAuthorizationSupported) === null || _a === void 0 ? void 0 : _a.call(eoaConnector))) {
|
|
225
|
-
throw new DynamicError(`The wallet connector (${eoaConnector.key}) does not support EIP-7702 authorization signing. Only embedded wallets (Turnkey, WaaS) support this feature
|
|
225
|
+
throw new DynamicError(`The wallet connector (${eoaConnector.key}) does not support EIP-7702 authorization signing. Only embedded wallets (Turnkey, WaaS) support this feature.`, 'the_wallet_connector_does_not_support');
|
|
226
226
|
}
|
|
227
227
|
let resolvedChainId = chainId;
|
|
228
228
|
if (!resolvedChainId) {
|
|
@@ -232,11 +232,11 @@ class ZeroDevConnector extends AccountAbstractionBaseConnector {
|
|
|
232
232
|
}
|
|
233
233
|
}
|
|
234
234
|
if (!resolvedChainId) {
|
|
235
|
-
throw new DynamicError('Chain ID is required but could not be determined from the wallet. Please provide a chainId parameter.');
|
|
235
|
+
throw new DynamicError('Chain ID is required but could not be determined from the wallet. Please provide a chainId parameter.', 'chain_id_is_required_but_could');
|
|
236
236
|
}
|
|
237
237
|
const walletClient = eoaConnector.getWalletClient(String(resolvedChainId));
|
|
238
238
|
if (!walletClient) {
|
|
239
|
-
throw new DynamicError(`Failed to get wallet client for chain ID ${resolvedChainId}. Ensure the wallet is connected to the correct network
|
|
239
|
+
throw new DynamicError(`Failed to get wallet client for chain ID ${resolvedChainId}. Ensure the wallet is connected to the correct network.`, 'get_wallet_client_for_chain_id');
|
|
240
240
|
}
|
|
241
241
|
return signEip7702Authorization({
|
|
242
242
|
chainId: resolvedChainId,
|
|
@@ -252,11 +252,11 @@ class ZeroDevConnector extends AccountAbstractionBaseConnector {
|
|
|
252
252
|
return __awaiter(this, void 0, void 0, function* () {
|
|
253
253
|
const walletAddress = this.activeWalletAddress;
|
|
254
254
|
if (!walletAddress) {
|
|
255
|
-
throw new DynamicError('No active wallet');
|
|
255
|
+
throw new DynamicError('No active wallet', 'no_active_wallet');
|
|
256
256
|
}
|
|
257
257
|
const walletInfo = this.eoaConnectorMap[walletAddress];
|
|
258
258
|
if (!(walletInfo === null || walletInfo === void 0 ? void 0 : walletInfo.is7702)) {
|
|
259
|
-
throw new DynamicError('Active wallet is not an EIP-7702 wallet');
|
|
259
|
+
throw new DynamicError('Active wallet is not an EIP-7702 wallet', 'active_wallet_is_not_an_eip7702');
|
|
260
260
|
}
|
|
261
261
|
this.pendingEip7702Auth = auth;
|
|
262
262
|
// Clear the cached kernel clients so they get recreated with the new auth
|
|
@@ -378,7 +378,7 @@ class ZeroDevConnector extends AccountAbstractionBaseConnector {
|
|
|
378
378
|
createKernelClient(_a) {
|
|
379
379
|
return __awaiter(this, arguments, void 0, function* ({ chainId, eip7702Auth, is7702 = false, projectId, signer, paymaster, paymasterRpcOverride, bundlerRpcOverride, }) {
|
|
380
380
|
if (!signer)
|
|
381
|
-
throw new DynamicError('No signer provided');
|
|
381
|
+
throw new DynamicError('No signer provided', 'no_signer_provided');
|
|
382
382
|
const chain = chainsMap[chainId];
|
|
383
383
|
let kernelClient;
|
|
384
384
|
const params = {
|
|
@@ -489,7 +489,7 @@ class ZeroDevConnector extends AccountAbstractionBaseConnector {
|
|
|
489
489
|
const chainId = (_c = (_b = chain === null || chain === void 0 ? void 0 : chain.id) === null || _b === void 0 ? void 0 : _b.toString()) !== null && _c !== void 0 ? _c : this.lastUsedChainId;
|
|
490
490
|
const clientId = (_d = this.providersFromApi.find((provider) => provider.chain === chainId)) === null || _d === void 0 ? void 0 : _d.clientId;
|
|
491
491
|
if (!clientId) {
|
|
492
|
-
throw new DynamicError('No client id for chain id: ' + chainId);
|
|
492
|
+
throw new DynamicError('No client id for chain id: ' + chainId, 'no_client_id_for_chain_id');
|
|
493
493
|
}
|
|
494
494
|
const shouldSponsor = Boolean(ZeroDevConnector.defaultToKernelWithSponsorship || paymasterUrl);
|
|
495
495
|
const client = yield this.createKernelClient({
|
|
@@ -502,7 +502,7 @@ class ZeroDevConnector extends AccountAbstractionBaseConnector {
|
|
|
502
502
|
signer,
|
|
503
503
|
});
|
|
504
504
|
if (!client) {
|
|
505
|
-
throw new DynamicError('No kernel client');
|
|
505
|
+
throw new DynamicError('No kernel client', 'no_kernel_client');
|
|
506
506
|
}
|
|
507
507
|
const callData = yield client.account.encodeCalls(calls);
|
|
508
508
|
const hash = yield client.sendUserOperation({
|
|
@@ -525,7 +525,7 @@ class ZeroDevConnector extends AccountAbstractionBaseConnector {
|
|
|
525
525
|
? provider
|
|
526
526
|
: this.kernelClientWithSponsorship;
|
|
527
527
|
if (!effectiveProvider) {
|
|
528
|
-
throw new DynamicError('No provider');
|
|
528
|
+
throw new DynamicError('No provider', 'no_provider');
|
|
529
529
|
}
|
|
530
530
|
const unformattedTransaction = unFormatTransaction(transaction);
|
|
531
531
|
const key = `${unformattedTransaction.from}-${unformattedTransaction.to}-${unformattedTransaction.data}`;
|
|
@@ -566,10 +566,10 @@ class ZeroDevConnector extends AccountAbstractionBaseConnector {
|
|
|
566
566
|
onSignTransaction: (_c) => __awaiter(this, [_c], void 0, function* ({ transaction }) {
|
|
567
567
|
this._walletUiUtils.disabledConfirmationOnce();
|
|
568
568
|
if (!this.eoaConnector) {
|
|
569
|
-
throw new DynamicError('signTransaction requires an EOA connector to be available');
|
|
569
|
+
throw new DynamicError('signTransaction requires an EOA connector to be available', 'signtransaction_requires_an_eoa_connector_to');
|
|
570
570
|
}
|
|
571
571
|
if (!this.eoaAddress) {
|
|
572
|
-
throw new DynamicError('No EOA address');
|
|
572
|
+
throw new DynamicError('No EOA address', 'no_eoa_address');
|
|
573
573
|
}
|
|
574
574
|
let localAccount;
|
|
575
575
|
if (isDynamicWaasConnector(this.eoaConnector)) {
|
|
@@ -581,12 +581,12 @@ class ZeroDevConnector extends AccountAbstractionBaseConnector {
|
|
|
581
581
|
localAccount = yield this.eoaConnector.getAccount();
|
|
582
582
|
}
|
|
583
583
|
else {
|
|
584
|
-
throw new DynamicError('signTransaction is only supported with Dynamic embedded wallets');
|
|
584
|
+
throw new DynamicError('signTransaction is only supported with Dynamic embedded wallets', 'signtransaction_is_only_supported_with_dynamic');
|
|
585
585
|
}
|
|
586
586
|
const tx = unFormatTransaction(transaction);
|
|
587
587
|
const publicClient = yield this.getPublicClient();
|
|
588
588
|
if (!publicClient) {
|
|
589
|
-
throw new DynamicError('Public client not available');
|
|
589
|
+
throw new DynamicError('Public client not available', 'public_client_not_available');
|
|
590
590
|
}
|
|
591
591
|
const preparedTx = yield publicClient.prepareTransactionRequest(Object.assign(Object.assign({}, tx), { account: this.eoaAddress }));
|
|
592
592
|
return localAccount.signTransaction(preparedTx);
|
|
@@ -692,7 +692,7 @@ class ZeroDevConnector extends AccountAbstractionBaseConnector {
|
|
|
692
692
|
signAndSendUserOperationWithWaas(provider, userOperation) {
|
|
693
693
|
return __awaiter(this, void 0, void 0, function* () {
|
|
694
694
|
if (!userOperation) {
|
|
695
|
-
throw new DynamicError('Failed to prepare user operation for transaction');
|
|
695
|
+
throw new DynamicError('Failed to prepare user operation for transaction', 'prepare_user_operation_for_transaction');
|
|
696
696
|
}
|
|
697
697
|
const chainId = Number(this.lastUsedChainId);
|
|
698
698
|
const hash = getUserOperationHash({
|
|
@@ -724,7 +724,7 @@ class ZeroDevConnector extends AccountAbstractionBaseConnector {
|
|
|
724
724
|
}
|
|
725
725
|
const { kernelClientWithSponsorship } = this;
|
|
726
726
|
if (!kernelClientWithSponsorship) {
|
|
727
|
-
throw new DynamicError('No kernel client with sponsorship found');
|
|
727
|
+
throw new DynamicError('No kernel client with sponsorship found', 'no_kernel_client_with_sponsorship_found');
|
|
728
728
|
}
|
|
729
729
|
const value = BigInt((_a = transaction.value) !== null && _a !== void 0 ? _a : 0);
|
|
730
730
|
const callData = yield kernelClientWithSponsorship.account.encodeCalls([
|
|
@@ -780,7 +780,7 @@ class ZeroDevConnector extends AccountAbstractionBaseConnector {
|
|
|
780
780
|
var _a;
|
|
781
781
|
const publicClient = (_a = this.kernelClient) === null || _a === void 0 ? void 0 : _a.client;
|
|
782
782
|
if (!publicClient)
|
|
783
|
-
throw new DynamicError('No RPC client');
|
|
783
|
+
throw new DynamicError('No RPC client', 'no_rpc_client');
|
|
784
784
|
return formatEther(yield publicClient.getBalance({
|
|
785
785
|
address: address,
|
|
786
786
|
}));
|
|
@@ -795,11 +795,11 @@ class ZeroDevConnector extends AccountAbstractionBaseConnector {
|
|
|
795
795
|
return __awaiter(this, void 0, void 0, function* () {
|
|
796
796
|
var _a, _b;
|
|
797
797
|
if (!this.activeWalletAddress) {
|
|
798
|
-
throw new DynamicError('No active wallet address');
|
|
798
|
+
throw new DynamicError('No active wallet address', 'no_active_wallet_address');
|
|
799
799
|
}
|
|
800
800
|
const client = (_b = (_a = this.providerMap[this.activeWalletAddress]) === null || _a === void 0 ? void 0 : _a[chainId]) === null || _b === void 0 ? void 0 : _b.kernelClient;
|
|
801
801
|
if (!client) {
|
|
802
|
-
throw new DynamicError(`Provider for Chain ID ${chainId} not available. Please make sure that Chain ID ${chainId} is enabled in both the Dynamic dashboard and the ZeroDev dashboard
|
|
802
|
+
throw new DynamicError(`Provider for Chain ID ${chainId} not available. Please make sure that Chain ID ${chainId} is enabled in both the Dynamic dashboard and the ZeroDev dashboard.`, 'provider_for_chain_id_not_available');
|
|
803
803
|
}
|
|
804
804
|
return client.signMessage({ message: messageToSign });
|
|
805
805
|
});
|
|
@@ -808,7 +808,7 @@ class ZeroDevConnector extends AccountAbstractionBaseConnector {
|
|
|
808
808
|
return __awaiter(this, void 0, void 0, function* () {
|
|
809
809
|
var _a, _b;
|
|
810
810
|
if (!this.kernelClient) {
|
|
811
|
-
throw new DynamicError('Error fetching signer');
|
|
811
|
+
throw new DynamicError('Error fetching signer', 'fetch_signer_failed');
|
|
812
812
|
}
|
|
813
813
|
if (!this.isActiveWallet7702) {
|
|
814
814
|
return this.kernelClient.signMessage({ message: messageToSign });
|
|
@@ -830,7 +830,7 @@ class ZeroDevConnector extends AccountAbstractionBaseConnector {
|
|
|
830
830
|
var _a, _b;
|
|
831
831
|
const eoa = this.eoaConnectorMap[expectedAddress];
|
|
832
832
|
if (!eoa) {
|
|
833
|
-
throw new DynamicError('No EOA connector');
|
|
833
|
+
throw new DynamicError('No EOA connector', 'no_eoa_connector');
|
|
834
834
|
}
|
|
835
835
|
const { eoaAddress, eoaConnector, is7702, properties } = eoa;
|
|
836
836
|
// Validate the underlying EOA connector
|