@dynamic-labs/ethereum-aa 4.4.2-preview.0 → 4.4.2-preview.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 +11 -0
- package/package.cjs +1 -1
- package/package.js +1 -1
- package/package.json +8 -8
- package/src/ZeroDevConnector.cjs +43 -20
- package/src/ZeroDevConnector.d.ts +2 -0
- package/src/ZeroDevConnector.js +44 -21
- package/src/index.cjs +2 -1
- package/src/index.d.ts +2 -1
- package/src/index.js +2 -1
- package/src/utils/createEcsdaKernelAccountClient.cjs +0 -4
- package/src/utils/createEcsdaKernelAccountClient.js +0 -4
package/CHANGELOG.md
CHANGED
|
@@ -1,4 +1,15 @@
|
|
|
1
1
|
|
|
2
|
+
### [4.4.2-preview.1](https://github.com/dynamic-labs/dynamic-auth/compare/v4.4.2...v4.4.2-preview.1) (2025-01-30)
|
|
3
|
+
|
|
4
|
+
|
|
5
|
+
### Features
|
|
6
|
+
|
|
7
|
+
* add support for 7702 on ZeroDevConnector ([144e99a](https://github.com/dynamic-labs/dynamic-auth/commit/144e99a673abbe4c775ec2124375925e96f76071))
|
|
8
|
+
* implement experimental_signAuthorization method in TurnkeyEVMWalletConnector ([#7866](https://github.com/dynamic-labs/dynamic-auth/issues/7866)) ([9622d1e](https://github.com/dynamic-labs/dynamic-auth/commit/9622d1e0e42bb3401fffbdda7b735db1736717ce))
|
|
9
|
+
* implement experimental_signAuthorization method in TurnkeyEVMWalletConnector ([#7866](https://github.com/dynamic-labs/dynamic-auth/issues/7866)) ([7f367b8](https://github.com/dynamic-labs/dynamic-auth/commit/7f367b8bc9d6a0ece0268867bf9c7754d75d7949))
|
|
10
|
+
* implement experimental_signAuthorization method in TurnkeyEVMWalletConnector ([#7866](https://github.com/dynamic-labs/dynamic-auth/issues/7866)) ([2019c4c](https://github.com/dynamic-labs/dynamic-auth/commit/2019c4cb89e4a042dc1c896a71b803db572e1842))
|
|
11
|
+
* override kernel address and add auth to localstorage ([1074ebc](https://github.com/dynamic-labs/dynamic-auth/commit/1074ebc0f3eca26fb868fd7acc9e3ac7c1048007))
|
|
12
|
+
|
|
2
13
|
### [4.4.2-preview.0](https://github.com/dynamic-labs/dynamic-auth/compare/v4.4.1...v4.4.2-preview.0) (2025-01-28)
|
|
3
14
|
|
|
4
15
|
|
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.4.2-preview.
|
|
3
|
+
"version": "4.4.2-preview.1",
|
|
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.3",
|
|
23
23
|
"@zerodev/multi-chain-ecdsa-validator": "5.4.2",
|
|
24
24
|
"@zerodev/sdk": "5.4.17",
|
|
25
|
-
"@dynamic-labs/assert-package-version": "4.4.2-preview.
|
|
26
|
-
"@dynamic-labs/ethereum-core": "4.4.2-preview.
|
|
27
|
-
"@dynamic-labs/logger": "4.4.2-preview.
|
|
28
|
-
"@dynamic-labs/types": "4.4.2-preview.
|
|
29
|
-
"@dynamic-labs/utils": "4.4.2-preview.
|
|
30
|
-
"@dynamic-labs/wallet-book": "4.4.2-preview.
|
|
31
|
-
"@dynamic-labs/wallet-connector-core": "4.4.2-preview.
|
|
25
|
+
"@dynamic-labs/assert-package-version": "4.4.2-preview.1",
|
|
26
|
+
"@dynamic-labs/ethereum-core": "4.4.2-preview.1",
|
|
27
|
+
"@dynamic-labs/logger": "4.4.2-preview.1",
|
|
28
|
+
"@dynamic-labs/types": "4.4.2-preview.1",
|
|
29
|
+
"@dynamic-labs/utils": "4.4.2-preview.1",
|
|
30
|
+
"@dynamic-labs/wallet-book": "4.4.2-preview.1",
|
|
31
|
+
"@dynamic-labs/wallet-connector-core": "4.4.2-preview.1"
|
|
32
32
|
},
|
|
33
33
|
"peerDependencies": {
|
|
34
34
|
"viem": "^2.21.55"
|
package/src/ZeroDevConnector.cjs
CHANGED
|
@@ -7,7 +7,6 @@ var _tslib = require('../_virtual/_tslib.cjs');
|
|
|
7
7
|
var viem = require('viem');
|
|
8
8
|
var accounts = require('viem/accounts');
|
|
9
9
|
var constants$1 = require('@zerodev/sdk/constants');
|
|
10
|
-
var chains = require('viem/chains');
|
|
11
10
|
var ethereumCore = require('@dynamic-labs/ethereum-core');
|
|
12
11
|
var walletConnectorCore = require('@dynamic-labs/wallet-connector-core');
|
|
13
12
|
var utils = require('@dynamic-labs/utils');
|
|
@@ -20,7 +19,7 @@ var getKernelVersion = require('./utils/getKernelVersion.cjs');
|
|
|
20
19
|
|
|
21
20
|
class ZeroDevConnector extends walletConnectorCore.WalletConnectorBase {
|
|
22
21
|
constructor(opts) {
|
|
23
|
-
var _a, _b, _c, _d, _e, _f
|
|
22
|
+
var _a, _b, _c, _d, _e, _f;
|
|
24
23
|
super(opts);
|
|
25
24
|
// provider map maintains the kernel clients per chain
|
|
26
25
|
this.providerMap = {};
|
|
@@ -41,23 +40,23 @@ class ZeroDevConnector extends walletConnectorCore.WalletConnectorBase {
|
|
|
41
40
|
},
|
|
42
41
|
name: 'ZeroDev',
|
|
43
42
|
};
|
|
44
|
-
this.isEip7702Mode =
|
|
43
|
+
this.isEip7702Mode = true; //opts.apiProviders.zerodev?.isEip7702 ?? false;
|
|
45
44
|
this._walletUiUtils = opts.walletUiUtils;
|
|
46
45
|
this.evmNetworks = utils.parseEvmNetworks(opts.evmNetworks);
|
|
47
|
-
this.entryPoint = getEntryPoint.getEntryPoint((
|
|
48
|
-
this.kernelVersion = getKernelVersion.getKernelVersion((
|
|
46
|
+
this.entryPoint = getEntryPoint.getEntryPoint((_a = opts.apiProviders.zerodev) === null || _a === void 0 ? void 0 : _a.entryPointVersion);
|
|
47
|
+
this.kernelVersion = getKernelVersion.getKernelVersion((_b = opts.apiProviders.zerodev) === null || _b === void 0 ? void 0 : _b.kernelVersion, this.entryPoint);
|
|
49
48
|
this.enableKernelV3Migration =
|
|
50
|
-
(
|
|
49
|
+
(_d = (_c = opts.apiProviders.zerodev) === null || _c === void 0 ? void 0 : _c.enableKernelV3Migration) !== null && _d !== void 0 ? _d : false;
|
|
51
50
|
// this is the list of providers from the api that are used for multi-chain account abstraction
|
|
52
51
|
this.providersFromApi =
|
|
53
|
-
((
|
|
52
|
+
((_e = opts.apiProviders.zerodev) === null || _e === void 0 ? void 0 : _e.multichainAccountAbstractionProviders) || [];
|
|
54
53
|
const [defaultProvider] = this.providersFromApi;
|
|
55
54
|
this.clientId = defaultProvider === null || defaultProvider === void 0 ? void 0 : defaultProvider.clientId;
|
|
56
55
|
if (!this.clientId) {
|
|
57
56
|
throw new Error('Missing ZeroDev project ID provided. Add your ZeroDev project id to your project configuration via the Dynamic Labs dashboard.');
|
|
58
57
|
}
|
|
59
58
|
this.defaultChainId = defaultProvider === null || defaultProvider === void 0 ? void 0 : defaultProvider.chain;
|
|
60
|
-
this.ecdsaProviderType = (
|
|
59
|
+
this.ecdsaProviderType = (_f = opts.apiProviders.zerodev) === null || _f === void 0 ? void 0 : _f.ecdsaProviderType;
|
|
61
60
|
}
|
|
62
61
|
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
|
63
62
|
confirmTransactionStatus(txHash) {
|
|
@@ -156,9 +155,42 @@ class ZeroDevConnector extends walletConnectorCore.WalletConnectorBase {
|
|
|
156
155
|
}
|
|
157
156
|
});
|
|
158
157
|
}
|
|
158
|
+
getOrCreateAuthorization() {
|
|
159
|
+
return _tslib.__awaiter(this, void 0, void 0, function* () {
|
|
160
|
+
var _a, _b;
|
|
161
|
+
if (!this.eoaConnector)
|
|
162
|
+
throw new utils.DynamicError('No EOA connector');
|
|
163
|
+
if (!walletConnectorCore.isTurnkeyWalletConnector(this.eoaConnector)) {
|
|
164
|
+
throw new utils.DynamicError('No EOA connector');
|
|
165
|
+
}
|
|
166
|
+
const ZERODEV_AUTHORIZATION = 'zerodev_authorization';
|
|
167
|
+
try {
|
|
168
|
+
const storedAuthorization = utils.StorageService.getItem(ZERODEV_AUTHORIZATION);
|
|
169
|
+
if (storedAuthorization) {
|
|
170
|
+
return storedAuthorization;
|
|
171
|
+
}
|
|
172
|
+
const authorization = yield ((_a = this.eoaConnector) === null || _a === void 0 ? void 0 : _a.experimental_signAuthorization({
|
|
173
|
+
contractAddress: (_b = ZeroDevConnector.kernelDelegationAddress) !== null && _b !== void 0 ? _b : constants$1.KERNEL_7702_DELEGATION_ADDRESS,
|
|
174
|
+
}));
|
|
175
|
+
if (authorization) {
|
|
176
|
+
const serializedAuth = Object.entries(authorization).reduce((acc, [key, value]) => {
|
|
177
|
+
acc[key] = typeof value === 'bigint' ? value.toString() : value;
|
|
178
|
+
return acc;
|
|
179
|
+
}, {});
|
|
180
|
+
utils.StorageService.setItem(ZERODEV_AUTHORIZATION, serializedAuth);
|
|
181
|
+
}
|
|
182
|
+
return authorization;
|
|
183
|
+
}
|
|
184
|
+
catch (error) {
|
|
185
|
+
logger.logger.error('Failed to get/set authorization:', error);
|
|
186
|
+
utils.StorageService.removeItem(ZERODEV_AUTHORIZATION);
|
|
187
|
+
return undefined;
|
|
188
|
+
}
|
|
189
|
+
});
|
|
190
|
+
}
|
|
159
191
|
setEoaConnector(_a) {
|
|
160
192
|
return _tslib.__awaiter(this, arguments, void 0, function* ({ eoaAddress, connector, properties, }) {
|
|
161
|
-
var _b, _c
|
|
193
|
+
var _b, _c;
|
|
162
194
|
if (!connector) {
|
|
163
195
|
logger.logger.error('No EOA connector provided');
|
|
164
196
|
return;
|
|
@@ -184,18 +216,9 @@ class ZeroDevConnector extends walletConnectorCore.WalletConnectorBase {
|
|
|
184
216
|
}
|
|
185
217
|
const signer = yield this.eoaConnector.getSigner();
|
|
186
218
|
signer.account = accounts.toAccount(eoaAddress);
|
|
187
|
-
if (
|
|
188
|
-
|
|
189
|
-
yield this.eoaConnector.switchNetwork({
|
|
190
|
-
networkChainId: chains.odysseyTestnet.id,
|
|
191
|
-
});
|
|
192
|
-
if (!walletConnectorCore.isTurnkeyWalletConnector(this.eoaConnector)) {
|
|
193
|
-
throw new utils.DynamicError('No EOA connector');
|
|
219
|
+
if (this.isEip7702Mode) {
|
|
220
|
+
this.authorization = yield this.getOrCreateAuthorization();
|
|
194
221
|
}
|
|
195
|
-
const authorization = yield ((_d = this.eoaConnector) === null || _d === void 0 ? void 0 : _d.experimental_signAuthorization({
|
|
196
|
-
contractAddress: constants$1.KERNEL_7702_DELEGATION_ADDRESS,
|
|
197
|
-
})); // add to localstorage, remove on logout
|
|
198
|
-
this.authorization = authorization;
|
|
199
222
|
yield this.generateProviderMap(signer);
|
|
200
223
|
this.evmNetworks = this.evmNetworks.filter((network) => Boolean(this.providerMap[network.chainId]));
|
|
201
224
|
this.kernelClientDeferredPromise.resolve();
|
|
@@ -43,6 +43,7 @@ export declare class ZeroDevConnector extends WalletConnectorBase<typeof Ethereu
|
|
|
43
43
|
static bundlerProvider: BundlerProvider | undefined;
|
|
44
44
|
static bundlerRpc: string | undefined;
|
|
45
45
|
static paymasterRpc: string | undefined;
|
|
46
|
+
static kernelDelegationAddress: `0x${string}` | undefined;
|
|
46
47
|
/**
|
|
47
48
|
* Deferred promise that resolves when the ZeroDev provider is set.
|
|
48
49
|
* This is used to make sure that the provider is set before any other method is called.
|
|
@@ -92,6 +93,7 @@ export declare class ZeroDevConnector extends WalletConnectorBase<typeof Ethereu
|
|
|
92
93
|
kernelVersion?: ProviderKernelVersionEnum;
|
|
93
94
|
entryPointVersion?: ProviderEntryPointVersionEnum;
|
|
94
95
|
}): Promise<void>;
|
|
96
|
+
private getOrCreateAuthorization;
|
|
95
97
|
private setEoaConnector;
|
|
96
98
|
private warnIfProjectChainNotEnabled;
|
|
97
99
|
private generateProviderMap;
|
package/src/ZeroDevConnector.js
CHANGED
|
@@ -3,10 +3,9 @@ import { __awaiter, __rest } from '../_virtual/_tslib.js';
|
|
|
3
3
|
import { publicActions, custom, createWalletClient, toHex, formatEther } from 'viem';
|
|
4
4
|
import { toAccount } from 'viem/accounts';
|
|
5
5
|
import { KERNEL_7702_DELEGATION_ADDRESS, getEntryPoint as getEntryPoint$1 } from '@zerodev/sdk/constants';
|
|
6
|
-
import { odysseyTestnet } from 'viem/chains';
|
|
7
6
|
import { EthereumWallet, isEthWalletConnector, chainsMap, confirmationTransport, unFormatTransaction, createViemUiTransaction } from '@dynamic-labs/ethereum-core';
|
|
8
7
|
import { WalletConnectorBase, eventListenerHandlers, isTurnkeyWalletConnector } from '@dynamic-labs/wallet-connector-core';
|
|
9
|
-
import { parseEvmNetworks, StorageService,
|
|
8
|
+
import { parseEvmNetworks, StorageService, DynamicError, DeferredPromise, parseChainId, wrapMethodWithCallback, TransactionGasCannotBeSponsoredError, InsufficientFundsError } from '@dynamic-labs/utils';
|
|
10
9
|
import { ZERO_DEV_LAST_USED_CHAIN_ID_KEY } from './constants.js';
|
|
11
10
|
import { logger } from './utils/logger.js';
|
|
12
11
|
import { createEcdsaKernelAccountClientWith7702, createEcdsaKernelAccountClient } from './utils/createEcsdaKernelAccountClient.js';
|
|
@@ -16,7 +15,7 @@ import { getKernelVersion } from './utils/getKernelVersion.js';
|
|
|
16
15
|
|
|
17
16
|
class ZeroDevConnector extends WalletConnectorBase {
|
|
18
17
|
constructor(opts) {
|
|
19
|
-
var _a, _b, _c, _d, _e, _f
|
|
18
|
+
var _a, _b, _c, _d, _e, _f;
|
|
20
19
|
super(opts);
|
|
21
20
|
// provider map maintains the kernel clients per chain
|
|
22
21
|
this.providerMap = {};
|
|
@@ -37,23 +36,23 @@ class ZeroDevConnector extends WalletConnectorBase {
|
|
|
37
36
|
},
|
|
38
37
|
name: 'ZeroDev',
|
|
39
38
|
};
|
|
40
|
-
this.isEip7702Mode =
|
|
39
|
+
this.isEip7702Mode = true; //opts.apiProviders.zerodev?.isEip7702 ?? false;
|
|
41
40
|
this._walletUiUtils = opts.walletUiUtils;
|
|
42
41
|
this.evmNetworks = parseEvmNetworks(opts.evmNetworks);
|
|
43
|
-
this.entryPoint = getEntryPoint((
|
|
44
|
-
this.kernelVersion = getKernelVersion((
|
|
42
|
+
this.entryPoint = getEntryPoint((_a = opts.apiProviders.zerodev) === null || _a === void 0 ? void 0 : _a.entryPointVersion);
|
|
43
|
+
this.kernelVersion = getKernelVersion((_b = opts.apiProviders.zerodev) === null || _b === void 0 ? void 0 : _b.kernelVersion, this.entryPoint);
|
|
45
44
|
this.enableKernelV3Migration =
|
|
46
|
-
(
|
|
45
|
+
(_d = (_c = opts.apiProviders.zerodev) === null || _c === void 0 ? void 0 : _c.enableKernelV3Migration) !== null && _d !== void 0 ? _d : false;
|
|
47
46
|
// this is the list of providers from the api that are used for multi-chain account abstraction
|
|
48
47
|
this.providersFromApi =
|
|
49
|
-
((
|
|
48
|
+
((_e = opts.apiProviders.zerodev) === null || _e === void 0 ? void 0 : _e.multichainAccountAbstractionProviders) || [];
|
|
50
49
|
const [defaultProvider] = this.providersFromApi;
|
|
51
50
|
this.clientId = defaultProvider === null || defaultProvider === void 0 ? void 0 : defaultProvider.clientId;
|
|
52
51
|
if (!this.clientId) {
|
|
53
52
|
throw new Error('Missing ZeroDev project ID provided. Add your ZeroDev project id to your project configuration via the Dynamic Labs dashboard.');
|
|
54
53
|
}
|
|
55
54
|
this.defaultChainId = defaultProvider === null || defaultProvider === void 0 ? void 0 : defaultProvider.chain;
|
|
56
|
-
this.ecdsaProviderType = (
|
|
55
|
+
this.ecdsaProviderType = (_f = opts.apiProviders.zerodev) === null || _f === void 0 ? void 0 : _f.ecdsaProviderType;
|
|
57
56
|
}
|
|
58
57
|
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
|
59
58
|
confirmTransactionStatus(txHash) {
|
|
@@ -152,9 +151,42 @@ class ZeroDevConnector extends WalletConnectorBase {
|
|
|
152
151
|
}
|
|
153
152
|
});
|
|
154
153
|
}
|
|
154
|
+
getOrCreateAuthorization() {
|
|
155
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
156
|
+
var _a, _b;
|
|
157
|
+
if (!this.eoaConnector)
|
|
158
|
+
throw new DynamicError('No EOA connector');
|
|
159
|
+
if (!isTurnkeyWalletConnector(this.eoaConnector)) {
|
|
160
|
+
throw new DynamicError('No EOA connector');
|
|
161
|
+
}
|
|
162
|
+
const ZERODEV_AUTHORIZATION = 'zerodev_authorization';
|
|
163
|
+
try {
|
|
164
|
+
const storedAuthorization = StorageService.getItem(ZERODEV_AUTHORIZATION);
|
|
165
|
+
if (storedAuthorization) {
|
|
166
|
+
return storedAuthorization;
|
|
167
|
+
}
|
|
168
|
+
const authorization = yield ((_a = this.eoaConnector) === null || _a === void 0 ? void 0 : _a.experimental_signAuthorization({
|
|
169
|
+
contractAddress: (_b = ZeroDevConnector.kernelDelegationAddress) !== null && _b !== void 0 ? _b : KERNEL_7702_DELEGATION_ADDRESS,
|
|
170
|
+
}));
|
|
171
|
+
if (authorization) {
|
|
172
|
+
const serializedAuth = Object.entries(authorization).reduce((acc, [key, value]) => {
|
|
173
|
+
acc[key] = typeof value === 'bigint' ? value.toString() : value;
|
|
174
|
+
return acc;
|
|
175
|
+
}, {});
|
|
176
|
+
StorageService.setItem(ZERODEV_AUTHORIZATION, serializedAuth);
|
|
177
|
+
}
|
|
178
|
+
return authorization;
|
|
179
|
+
}
|
|
180
|
+
catch (error) {
|
|
181
|
+
logger.error('Failed to get/set authorization:', error);
|
|
182
|
+
StorageService.removeItem(ZERODEV_AUTHORIZATION);
|
|
183
|
+
return undefined;
|
|
184
|
+
}
|
|
185
|
+
});
|
|
186
|
+
}
|
|
155
187
|
setEoaConnector(_a) {
|
|
156
188
|
return __awaiter(this, arguments, void 0, function* ({ eoaAddress, connector, properties, }) {
|
|
157
|
-
var _b, _c
|
|
189
|
+
var _b, _c;
|
|
158
190
|
if (!connector) {
|
|
159
191
|
logger.error('No EOA connector provided');
|
|
160
192
|
return;
|
|
@@ -180,18 +212,9 @@ class ZeroDevConnector extends WalletConnectorBase {
|
|
|
180
212
|
}
|
|
181
213
|
const signer = yield this.eoaConnector.getSigner();
|
|
182
214
|
signer.account = toAccount(eoaAddress);
|
|
183
|
-
if (
|
|
184
|
-
|
|
185
|
-
yield this.eoaConnector.switchNetwork({
|
|
186
|
-
networkChainId: odysseyTestnet.id,
|
|
187
|
-
});
|
|
188
|
-
if (!isTurnkeyWalletConnector(this.eoaConnector)) {
|
|
189
|
-
throw new DynamicError('No EOA connector');
|
|
215
|
+
if (this.isEip7702Mode) {
|
|
216
|
+
this.authorization = yield this.getOrCreateAuthorization();
|
|
190
217
|
}
|
|
191
|
-
const authorization = yield ((_d = this.eoaConnector) === null || _d === void 0 ? void 0 : _d.experimental_signAuthorization({
|
|
192
|
-
contractAddress: KERNEL_7702_DELEGATION_ADDRESS,
|
|
193
|
-
})); // add to localstorage, remove on logout
|
|
194
|
-
this.authorization = authorization;
|
|
195
218
|
yield this.generateProviderMap(signer);
|
|
196
219
|
this.evmNetworks = this.evmNetworks.filter((network) => Boolean(this.providerMap[network.chainId]));
|
|
197
220
|
this.kernelClientDeferredPromise.resolve();
|
package/src/index.cjs
CHANGED
|
@@ -15,10 +15,11 @@ var ethereumAa = require('./ethereum-aa.cjs');
|
|
|
15
15
|
var isZeroDevConnector = require('./utils/isZeroDevConnector.cjs');
|
|
16
16
|
|
|
17
17
|
assertPackageVersion.assertPackageVersion('@dynamic-labs/ethereum-aa', _package.version);
|
|
18
|
-
const ZeroDevSmartWalletConnectorsWithConfig = ({ bundlerProvider, bundlerRpc, paymasterRpc, } = {}) => {
|
|
18
|
+
const ZeroDevSmartWalletConnectorsWithConfig = ({ bundlerProvider, bundlerRpc, paymasterRpc, kernelDelegationAddress, } = {}) => {
|
|
19
19
|
ZeroDevConnector.ZeroDevConnector.bundlerProvider = bundlerProvider;
|
|
20
20
|
ZeroDevConnector.ZeroDevConnector.bundlerRpc = bundlerRpc;
|
|
21
21
|
ZeroDevConnector.ZeroDevConnector.paymasterRpc = paymasterRpc;
|
|
22
|
+
ZeroDevConnector.ZeroDevConnector.kernelDelegationAddress = kernelDelegationAddress;
|
|
22
23
|
return ZeroDevSmartWalletConnectors;
|
|
23
24
|
};
|
|
24
25
|
const ZeroDevSmartWalletConnectors = (props) => {
|
package/src/index.d.ts
CHANGED
|
@@ -7,9 +7,10 @@ export { getEntryPoint } from './utils/getEntryPoint';
|
|
|
7
7
|
export { getKernelVersion } from './utils/getKernelVersion';
|
|
8
8
|
export * from './ethereum-aa';
|
|
9
9
|
export { isZeroDevConnector } from './utils/isZeroDevConnector';
|
|
10
|
-
export declare const ZeroDevSmartWalletConnectorsWithConfig: ({ bundlerProvider, bundlerRpc, paymasterRpc, }?: {
|
|
10
|
+
export declare const ZeroDevSmartWalletConnectorsWithConfig: ({ bundlerProvider, bundlerRpc, paymasterRpc, kernelDelegationAddress, }?: {
|
|
11
11
|
bundlerProvider?: BundlerProvider;
|
|
12
12
|
bundlerRpc?: string;
|
|
13
13
|
paymasterRpc?: string;
|
|
14
|
+
kernelDelegationAddress?: `0x${string}`;
|
|
14
15
|
}) => (props: any) => WalletConnectorConstructor[];
|
|
15
16
|
export declare const ZeroDevSmartWalletConnectors: (props: any) => WalletConnectorConstructor[];
|
package/src/index.js
CHANGED
|
@@ -11,10 +11,11 @@ export { EthereumAaConnector } from './ethereum-aa.js';
|
|
|
11
11
|
export { isZeroDevConnector } from './utils/isZeroDevConnector.js';
|
|
12
12
|
|
|
13
13
|
assertPackageVersion('@dynamic-labs/ethereum-aa', version);
|
|
14
|
-
const ZeroDevSmartWalletConnectorsWithConfig = ({ bundlerProvider, bundlerRpc, paymasterRpc, } = {}) => {
|
|
14
|
+
const ZeroDevSmartWalletConnectorsWithConfig = ({ bundlerProvider, bundlerRpc, paymasterRpc, kernelDelegationAddress, } = {}) => {
|
|
15
15
|
ZeroDevConnector.bundlerProvider = bundlerProvider;
|
|
16
16
|
ZeroDevConnector.bundlerRpc = bundlerRpc;
|
|
17
17
|
ZeroDevConnector.paymasterRpc = paymasterRpc;
|
|
18
|
+
ZeroDevConnector.kernelDelegationAddress = kernelDelegationAddress;
|
|
18
19
|
return ZeroDevSmartWalletConnectors;
|
|
19
20
|
};
|
|
20
21
|
const ZeroDevSmartWalletConnectors = (props) => {
|
|
@@ -49,10 +49,6 @@ const createPaymasterHandler = (paymaster, zerodevPaymaster) => {
|
|
|
49
49
|
userOperation: _userOperation,
|
|
50
50
|
});
|
|
51
51
|
}
|
|
52
|
-
console.log('sponsoring user operation');
|
|
53
|
-
console.log(_userOperation);
|
|
54
|
-
console.log(zerodevPaymaster);
|
|
55
|
-
console.log(paymaster);
|
|
56
52
|
return zerodevPaymaster.sponsorUserOperation({
|
|
57
53
|
userOperation: _userOperation,
|
|
58
54
|
});
|
|
@@ -45,10 +45,6 @@ const createPaymasterHandler = (paymaster, zerodevPaymaster) => {
|
|
|
45
45
|
userOperation: _userOperation,
|
|
46
46
|
});
|
|
47
47
|
}
|
|
48
|
-
console.log('sponsoring user operation');
|
|
49
|
-
console.log(_userOperation);
|
|
50
|
-
console.log(zerodevPaymaster);
|
|
51
|
-
console.log(paymaster);
|
|
52
48
|
return zerodevPaymaster.sponsorUserOperation({
|
|
53
49
|
userOperation: _userOperation,
|
|
54
50
|
});
|