@dynamic-labs/ethereum-aa 4.14.0 → 4.16.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 +31 -0
- package/package.cjs +1 -1
- package/package.js +1 -1
- package/package.json +10 -10
- package/src/ZeroDevConnector.cjs +12 -6
- package/src/ZeroDevConnector.d.ts +2 -2
- package/src/ZeroDevConnector.js +13 -7
- package/src/utils/createEcdsaKernelAccountClient.cjs +6 -6
- package/src/utils/createEcdsaKernelAccountClient.d.ts +3 -2
- package/src/utils/createEcdsaKernelAccountClient.js +6 -6
- package/src/utils/index.d.ts +1 -0
- package/src/utils/isEVMAuthorizationCapable.cjs +8 -0
- package/src/utils/isEVMAuthorizationCapable.d.ts +6 -0
- package/src/utils/isEVMAuthorizationCapable.js +4 -0
package/CHANGELOG.md
CHANGED
|
@@ -1,4 +1,35 @@
|
|
|
1
1
|
|
|
2
|
+
## [4.16.0](https://github.com/dynamic-labs/dynamic-auth/compare/v4.15.0...v4.16.0) (2025-05-03)
|
|
3
|
+
|
|
4
|
+
|
|
5
|
+
### Features
|
|
6
|
+
|
|
7
|
+
* (GVTY-3020) add send balance to waas sui connector ([#8638](https://github.com/dynamic-labs/dynamic-auth/issues/8638)) ([97f0af0](https://github.com/dynamic-labs/dynamic-auth/commit/97f0af0504a0079ebf0958fde1f8edc34c035927))
|
|
8
|
+
* add isAtomicSupported and isPaymasterServiceSupported methods to EthereumWallet ([#8627](https://github.com/dynamic-labs/dynamic-auth/issues/8627)) ([df82b9e](https://github.com/dynamic-labs/dynamic-auth/commit/df82b9e86eafea9dd6c505227722450bc56d7c57))
|
|
9
|
+
* add solana mpc to global wallets ([#8605](https://github.com/dynamic-labs/dynamic-auth/issues/8605)) ([6261bf9](https://github.com/dynamic-labs/dynamic-auth/commit/6261bf9bec45b1d1afa13869cf5d10cda215783e))
|
|
10
|
+
|
|
11
|
+
## [4.15.0](https://github.com/dynamic-labs/dynamic-auth/compare/v4.14.0...v4.15.0) (2025-04-30)
|
|
12
|
+
|
|
13
|
+
|
|
14
|
+
### Features
|
|
15
|
+
|
|
16
|
+
* add end session override for waas sui connector ([#8602](https://github.com/dynamic-labs/dynamic-auth/issues/8602)) ([6c9e6fd](https://github.com/dynamic-labs/dynamic-auth/commit/6c9e6fda4581a4e3b9e1544f22d6e5f03723d928))
|
|
17
|
+
* add presets and demo fixes ([#8609](https://github.com/dynamic-labs/dynamic-auth/issues/8609)) ([2201914](https://github.com/dynamic-labs/dynamic-auth/commit/2201914d2029ff0b67dfc2c6e696f728f32f57b3))
|
|
18
|
+
* add ShareConfig component with modal and styling ([74aff97](https://github.com/dynamic-labs/dynamic-auth/commit/74aff97689c9e7c9abc892c1deac4d748b498909))
|
|
19
|
+
* add wallet actions section and update UI components ([#8598](https://github.com/dynamic-labs/dynamic-auth/issues/8598)) ([d6170b7](https://github.com/dynamic-labs/dynamic-auth/commit/d6170b7f6abd963e6a081541e2c674b7141f1c15))
|
|
20
|
+
* dynamic waas to sign 7702 authorization ([#8603](https://github.com/dynamic-labs/dynamic-auth/issues/8603)) ([74e1722](https://github.com/dynamic-labs/dynamic-auth/commit/74e1722f417aab621f4062093e109dc45cf542ea))
|
|
21
|
+
* add signMessage feature to global wallet client ([#8563](https://github.com/dynamic-labs/dynamic-auth/issues/8563)) ([c3f9734](https://github.com/dynamic-labs/dynamic-auth/commit/c3f9734c097f5c9b88c35e0f642632f261e40fe7))
|
|
22
|
+
* allow displaying custom links in the global wallet profile dropdown menu ([#8617](https://github.com/dynamic-labs/dynamic-auth/issues/8617)) ([5fb956c](https://github.com/dynamic-labs/dynamic-auth/commit/5fb956c0c2b681fece56104b330a0e90fc8fb936))
|
|
23
|
+
|
|
24
|
+
|
|
25
|
+
### Bug Fixes
|
|
26
|
+
|
|
27
|
+
* add default base api url for dynamic waas config on connector initialization ([#8604](https://github.com/dynamic-labs/dynamic-auth/issues/8604)) ([6218a7e](https://github.com/dynamic-labs/dynamic-auth/commit/6218a7edda4feb9028be548acfe8eff64578f0a0))
|
|
28
|
+
* enables caching for sprite.svg ([#8610](https://github.com/dynamic-labs/dynamic-auth/issues/8610)) ([decdb69](https://github.com/dynamic-labs/dynamic-auth/commit/decdb69b4df8bc2d97ee579fa423e9682ab1720b))
|
|
29
|
+
* change mobile experience to redirect ([#8003](https://github.com/dynamic-labs/dynamic-auth/issues/8003)) ([2e8a1d8](https://github.com/dynamic-labs/dynamic-auth/commit/2e8a1d8b54f54386e1abc9f4e6e5e9acf859e5fa))
|
|
30
|
+
* optimize wallet finder when performing eth and sol operations in global wallet popup ([#8564](https://github.com/dynamic-labs/dynamic-auth/issues/8564)) ([2eaf424](https://github.com/dynamic-labs/dynamic-auth/commit/2eaf4244d4aa1b1cc5c6e32574db10ab34f8ed80))
|
|
31
|
+
* loading state for v3 connect-only embedded wallet generation ([#8600](https://github.com/dynamic-labs/dynamic-auth/issues/8600)) ([af34d16](https://github.com/dynamic-labs/dynamic-auth/commit/af34d168a765aa82867116541e73c59672ab2341))
|
|
32
|
+
|
|
2
33
|
## [4.14.0](https://github.com/dynamic-labs/dynamic-auth/compare/v4.13.0...v4.14.0) (2025-04-25)
|
|
3
34
|
|
|
4
35
|
|
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.16.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",
|
|
@@ -18,18 +18,18 @@
|
|
|
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.660",
|
|
22
22
|
"@zerodev/ecdsa-validator": "5.4.4",
|
|
23
23
|
"@zerodev/multi-chain-ecdsa-validator": "5.4.3",
|
|
24
24
|
"@zerodev/sdk": "5.4.26",
|
|
25
|
-
"@dynamic-labs/assert-package-version": "4.
|
|
26
|
-
"@dynamic-labs/ethereum-aa-core": "4.
|
|
27
|
-
"@dynamic-labs/ethereum-core": "4.
|
|
28
|
-
"@dynamic-labs/logger": "4.
|
|
29
|
-
"@dynamic-labs/types": "4.
|
|
30
|
-
"@dynamic-labs/utils": "4.
|
|
31
|
-
"@dynamic-labs/wallet-book": "4.
|
|
32
|
-
"@dynamic-labs/wallet-connector-core": "4.
|
|
25
|
+
"@dynamic-labs/assert-package-version": "4.16.0",
|
|
26
|
+
"@dynamic-labs/ethereum-aa-core": "4.16.0",
|
|
27
|
+
"@dynamic-labs/ethereum-core": "4.16.0",
|
|
28
|
+
"@dynamic-labs/logger": "4.16.0",
|
|
29
|
+
"@dynamic-labs/types": "4.16.0",
|
|
30
|
+
"@dynamic-labs/utils": "4.16.0",
|
|
31
|
+
"@dynamic-labs/wallet-book": "4.16.0",
|
|
32
|
+
"@dynamic-labs/wallet-connector-core": "4.16.0"
|
|
33
33
|
},
|
|
34
34
|
"peerDependencies": {
|
|
35
35
|
"viem": "^2.21.60"
|
package/src/ZeroDevConnector.cjs
CHANGED
|
@@ -17,6 +17,7 @@ var createEcdsaKernelAccountClient = require('./utils/createEcdsaKernelAccountCl
|
|
|
17
17
|
var getEcdsaValidator = require('./utils/getEcdsaValidator.cjs');
|
|
18
18
|
var getEntryPoint = require('./utils/getEntryPoint.cjs');
|
|
19
19
|
var getKernelVersion = require('./utils/getKernelVersion.cjs');
|
|
20
|
+
var isEVMAuthorizationCapable = require('./utils/isEVMAuthorizationCapable.cjs');
|
|
20
21
|
|
|
21
22
|
class ZeroDevConnector extends ethereumAaCore.AccountAbstractionBaseConnector {
|
|
22
23
|
constructor(opts) {
|
|
@@ -159,11 +160,11 @@ class ZeroDevConnector extends ethereumAaCore.AccountAbstractionBaseConnector {
|
|
|
159
160
|
}
|
|
160
161
|
getOrCreateAuthorization() {
|
|
161
162
|
return _tslib.__awaiter(this, void 0, void 0, function* () {
|
|
162
|
-
var _a
|
|
163
|
+
var _a;
|
|
163
164
|
if (!this.eoaConnector)
|
|
164
165
|
throw new utils.DynamicError('No EOA connector');
|
|
165
|
-
if (!
|
|
166
|
-
throw new utils.DynamicError('
|
|
166
|
+
if (!isEVMAuthorizationCapable.isEVMAuthorizationCapable(this.eoaConnector)) {
|
|
167
|
+
throw new utils.DynamicError('Connector does not support EVM authorization');
|
|
167
168
|
}
|
|
168
169
|
const ZERODEV_AUTHORIZATION = 'zerodev_authorization';
|
|
169
170
|
try {
|
|
@@ -172,10 +173,10 @@ class ZeroDevConnector extends ethereumAaCore.AccountAbstractionBaseConnector {
|
|
|
172
173
|
return storedAuthorization;
|
|
173
174
|
}
|
|
174
175
|
const kernelVersion = constants$1.KERNEL_V3_3_BETA;
|
|
175
|
-
const authorization = yield
|
|
176
|
-
contractAddress: (
|
|
176
|
+
const authorization = yield this.eoaConnector.experimental_signAuthorization({
|
|
177
|
+
contractAddress: (_a = ZeroDevConnector.kernelDelegationAddress) !== null && _a !== void 0 ? _a : constants$1.KernelVersionToAddressesMap[kernelVersion]
|
|
177
178
|
.accountImplementationAddress,
|
|
178
|
-
})
|
|
179
|
+
});
|
|
179
180
|
if (authorization) {
|
|
180
181
|
const serializedAuth = Object.entries(authorization).reduce((acc, [key, value]) => {
|
|
181
182
|
acc[key] = typeof value === 'bigint' ? value.toString() : value;
|
|
@@ -295,6 +296,7 @@ class ZeroDevConnector extends ethereumAaCore.AccountAbstractionBaseConnector {
|
|
|
295
296
|
}
|
|
296
297
|
createKernelClient(_a) {
|
|
297
298
|
return _tslib.__awaiter(this, arguments, void 0, function* ({ chainId, projectId, signer, paymaster, authorization, }) {
|
|
299
|
+
var _b;
|
|
298
300
|
if (chainId && this.providerMap[chainId]) {
|
|
299
301
|
return paymaster === 'SPONSOR'
|
|
300
302
|
? this.providerMap[chainId].kernelClientWithSponsorship
|
|
@@ -304,6 +306,8 @@ class ZeroDevConnector extends ethereumAaCore.AccountAbstractionBaseConnector {
|
|
|
304
306
|
if (!eoaConnector)
|
|
305
307
|
throw new utils.DynamicError('No EOA connector');
|
|
306
308
|
const chain = ethereumCore.chainsMap[chainId];
|
|
309
|
+
const network = this.evmNetworks.find((network) => network.chainId === utils.parseChainId(chainId));
|
|
310
|
+
const publicClientRpc = (_b = network === null || network === void 0 ? void 0 : network.privateCustomerRpcUrls) === null || _b === void 0 ? void 0 : _b[0];
|
|
307
311
|
let kernelClient;
|
|
308
312
|
if (this.enableEIP7702Mode) {
|
|
309
313
|
kernelClient = yield createEcdsaKernelAccountClient.createEcdsaKernelAccountClientWith7702({
|
|
@@ -318,6 +322,7 @@ class ZeroDevConnector extends ethereumAaCore.AccountAbstractionBaseConnector {
|
|
|
318
322
|
paymasterRpc: ZeroDevConnector.paymasterRpc,
|
|
319
323
|
projectId,
|
|
320
324
|
provider: ZeroDevConnector.bundlerProvider,
|
|
325
|
+
publicClientRpc,
|
|
321
326
|
signer,
|
|
322
327
|
});
|
|
323
328
|
}
|
|
@@ -333,6 +338,7 @@ class ZeroDevConnector extends ethereumAaCore.AccountAbstractionBaseConnector {
|
|
|
333
338
|
paymasterRpc: ZeroDevConnector.paymasterRpc,
|
|
334
339
|
projectId,
|
|
335
340
|
provider: ZeroDevConnector.bundlerProvider,
|
|
341
|
+
publicClientRpc,
|
|
336
342
|
signer,
|
|
337
343
|
});
|
|
338
344
|
}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { KernelAccountClient } from '@zerodev/sdk/clients';
|
|
2
2
|
import { SmartAccount, EntryPointVersion } from 'viem/account-abstraction';
|
|
3
|
-
import { Client, PublicClient, RpcSchema, Transport, WalletClient } from 'viem';
|
|
3
|
+
import { Account, Client, PublicClient, RpcSchema, Transport, WalletClient } from 'viem';
|
|
4
4
|
import { SignAuthorizationReturnType } from 'viem/accounts';
|
|
5
5
|
import { type Chain as ViemChain } from 'viem/chains';
|
|
6
6
|
import { EntryPointType, KERNEL_VERSION_TYPE } from '@zerodev/sdk/types';
|
|
@@ -110,7 +110,7 @@ export declare class ZeroDevConnector extends AccountAbstractionBaseConnector im
|
|
|
110
110
|
getConnectedAccounts(): Promise<string[]>;
|
|
111
111
|
getNetwork(): Promise<number | undefined>;
|
|
112
112
|
private getTransport;
|
|
113
|
-
getWalletClient(chainId?: string): WalletClient<Transport, ViemChain> | undefined;
|
|
113
|
+
getWalletClient(chainId?: string): WalletClient<Transport, ViemChain, Account> | undefined;
|
|
114
114
|
getPublicClient(): Promise<void | PublicClient<Transport, ViemChain> | undefined>;
|
|
115
115
|
formatUserOperation(params: any): Promise<{
|
|
116
116
|
callData: any;
|
package/src/ZeroDevConnector.js
CHANGED
|
@@ -4,7 +4,7 @@ import { publicActions, custom, createWalletClient, toHex, formatEther } from 'v
|
|
|
4
4
|
import { toAccount } from 'viem/accounts';
|
|
5
5
|
import { KERNEL_V3_3_BETA, KernelVersionToAddressesMap, getEntryPoint as getEntryPoint$1 } from '@zerodev/sdk/constants';
|
|
6
6
|
import { EthereumWallet, isEthWalletConnector, chainsMap, confirmationTransport, unFormatTransaction } from '@dynamic-labs/ethereum-core';
|
|
7
|
-
import { eventListenerHandlers
|
|
7
|
+
import { eventListenerHandlers } from '@dynamic-labs/wallet-connector-core';
|
|
8
8
|
import { parseEvmNetworks, StorageService, DynamicError, DeferredPromise, parseChainId, wrapMethodWithCallback, TransactionGasCannotBeSponsoredError, InsufficientFundsError } from '@dynamic-labs/utils';
|
|
9
9
|
import { AccountAbstractionBaseConnector } from '@dynamic-labs/ethereum-aa-core';
|
|
10
10
|
import { ZERO_DEV_LAST_USED_CHAIN_ID_KEY } from './constants.js';
|
|
@@ -13,6 +13,7 @@ import { createEcdsaKernelAccountClientWith7702, createEcdsaKernelAccountClient
|
|
|
13
13
|
import { getEcdsaValidator } from './utils/getEcdsaValidator.js';
|
|
14
14
|
import { getEntryPoint } from './utils/getEntryPoint.js';
|
|
15
15
|
import { getKernelVersion } from './utils/getKernelVersion.js';
|
|
16
|
+
import { isEVMAuthorizationCapable } from './utils/isEVMAuthorizationCapable.js';
|
|
16
17
|
|
|
17
18
|
class ZeroDevConnector extends AccountAbstractionBaseConnector {
|
|
18
19
|
constructor(opts) {
|
|
@@ -155,11 +156,11 @@ class ZeroDevConnector extends AccountAbstractionBaseConnector {
|
|
|
155
156
|
}
|
|
156
157
|
getOrCreateAuthorization() {
|
|
157
158
|
return __awaiter(this, void 0, void 0, function* () {
|
|
158
|
-
var _a
|
|
159
|
+
var _a;
|
|
159
160
|
if (!this.eoaConnector)
|
|
160
161
|
throw new DynamicError('No EOA connector');
|
|
161
|
-
if (!
|
|
162
|
-
throw new DynamicError('
|
|
162
|
+
if (!isEVMAuthorizationCapable(this.eoaConnector)) {
|
|
163
|
+
throw new DynamicError('Connector does not support EVM authorization');
|
|
163
164
|
}
|
|
164
165
|
const ZERODEV_AUTHORIZATION = 'zerodev_authorization';
|
|
165
166
|
try {
|
|
@@ -168,10 +169,10 @@ class ZeroDevConnector extends AccountAbstractionBaseConnector {
|
|
|
168
169
|
return storedAuthorization;
|
|
169
170
|
}
|
|
170
171
|
const kernelVersion = KERNEL_V3_3_BETA;
|
|
171
|
-
const authorization = yield
|
|
172
|
-
contractAddress: (
|
|
172
|
+
const authorization = yield this.eoaConnector.experimental_signAuthorization({
|
|
173
|
+
contractAddress: (_a = ZeroDevConnector.kernelDelegationAddress) !== null && _a !== void 0 ? _a : KernelVersionToAddressesMap[kernelVersion]
|
|
173
174
|
.accountImplementationAddress,
|
|
174
|
-
})
|
|
175
|
+
});
|
|
175
176
|
if (authorization) {
|
|
176
177
|
const serializedAuth = Object.entries(authorization).reduce((acc, [key, value]) => {
|
|
177
178
|
acc[key] = typeof value === 'bigint' ? value.toString() : value;
|
|
@@ -291,6 +292,7 @@ class ZeroDevConnector extends AccountAbstractionBaseConnector {
|
|
|
291
292
|
}
|
|
292
293
|
createKernelClient(_a) {
|
|
293
294
|
return __awaiter(this, arguments, void 0, function* ({ chainId, projectId, signer, paymaster, authorization, }) {
|
|
295
|
+
var _b;
|
|
294
296
|
if (chainId && this.providerMap[chainId]) {
|
|
295
297
|
return paymaster === 'SPONSOR'
|
|
296
298
|
? this.providerMap[chainId].kernelClientWithSponsorship
|
|
@@ -300,6 +302,8 @@ class ZeroDevConnector extends AccountAbstractionBaseConnector {
|
|
|
300
302
|
if (!eoaConnector)
|
|
301
303
|
throw new DynamicError('No EOA connector');
|
|
302
304
|
const chain = chainsMap[chainId];
|
|
305
|
+
const network = this.evmNetworks.find((network) => network.chainId === parseChainId(chainId));
|
|
306
|
+
const publicClientRpc = (_b = network === null || network === void 0 ? void 0 : network.privateCustomerRpcUrls) === null || _b === void 0 ? void 0 : _b[0];
|
|
303
307
|
let kernelClient;
|
|
304
308
|
if (this.enableEIP7702Mode) {
|
|
305
309
|
kernelClient = yield createEcdsaKernelAccountClientWith7702({
|
|
@@ -314,6 +318,7 @@ class ZeroDevConnector extends AccountAbstractionBaseConnector {
|
|
|
314
318
|
paymasterRpc: ZeroDevConnector.paymasterRpc,
|
|
315
319
|
projectId,
|
|
316
320
|
provider: ZeroDevConnector.bundlerProvider,
|
|
321
|
+
publicClientRpc,
|
|
317
322
|
signer,
|
|
318
323
|
});
|
|
319
324
|
}
|
|
@@ -329,6 +334,7 @@ class ZeroDevConnector extends AccountAbstractionBaseConnector {
|
|
|
329
334
|
paymasterRpc: ZeroDevConnector.paymasterRpc,
|
|
330
335
|
projectId,
|
|
331
336
|
provider: ZeroDevConnector.bundlerProvider,
|
|
337
|
+
publicClientRpc,
|
|
332
338
|
signer,
|
|
333
339
|
});
|
|
334
340
|
}
|
|
@@ -26,10 +26,10 @@ const getZeroDevPaymasterRPC = (projectId, provider) => {
|
|
|
26
26
|
return rpc;
|
|
27
27
|
};
|
|
28
28
|
const isERC20 = (value) => viem.isAddress(value);
|
|
29
|
-
const createPublicAndPaymasterClients = (bundlerRpc, paymasterRpc, chain) => {
|
|
29
|
+
const createPublicAndPaymasterClients = (bundlerRpc, paymasterRpc, chain, publicClientRpc) => {
|
|
30
30
|
const publicClient = viem.createPublicClient({
|
|
31
31
|
chain,
|
|
32
|
-
transport: viem.http(bundlerRpc),
|
|
32
|
+
transport: publicClientRpc ? viem.http(publicClientRpc) : viem.http(bundlerRpc),
|
|
33
33
|
});
|
|
34
34
|
const zerodevPaymaster = clients.createZeroDevPaymasterClient({
|
|
35
35
|
chain,
|
|
@@ -65,10 +65,10 @@ const createKernelClientConfig = (account, bundlerRpc, chain, publicClient, paym
|
|
|
65
65
|
estimateFeesPerGas: (_a) => _tslib.__awaiter(void 0, [_a], void 0, function* ({ bundlerClient }) { return actions.getUserOperationGasPrice(bundlerClient); }),
|
|
66
66
|
},
|
|
67
67
|
});
|
|
68
|
-
const createEcdsaKernelAccountClient = (_b) => _tslib.__awaiter(void 0, [_b], void 0, function* ({ bundlerRpc, chain, paymasterRpc, projectId, signer, provider, paymaster = 'SPONSOR', entryPoint, kernelVersion, ecdsaValidator: ecdsaValidator$1, enableKernelV3Migration, }) {
|
|
68
|
+
const createEcdsaKernelAccountClient = (_b) => _tslib.__awaiter(void 0, [_b], void 0, function* ({ bundlerRpc, chain, paymasterRpc, projectId, signer, provider, paymaster = 'SPONSOR', entryPoint, kernelVersion, ecdsaValidator: ecdsaValidator$1, enableKernelV3Migration, publicClientRpc, }) {
|
|
69
69
|
const resolvedBundlerRpc = bundlerRpc !== null && bundlerRpc !== void 0 ? bundlerRpc : getZeroDevBundlerRPC(projectId, provider);
|
|
70
70
|
const resolvedPaymasterRpc = paymasterRpc !== null && paymasterRpc !== void 0 ? paymasterRpc : getZeroDevPaymasterRPC(projectId, provider);
|
|
71
|
-
const { publicClient, zerodevPaymaster } = createPublicAndPaymasterClients(resolvedBundlerRpc, resolvedPaymasterRpc, chain);
|
|
71
|
+
const { publicClient, zerodevPaymaster } = createPublicAndPaymasterClients(resolvedBundlerRpc, resolvedPaymasterRpc, chain, publicClientRpc);
|
|
72
72
|
const validator = yield ecdsaValidator$1(publicClient, {
|
|
73
73
|
entryPoint,
|
|
74
74
|
kernelVersion,
|
|
@@ -97,10 +97,10 @@ const createEcdsaKernelAccountClient = (_b) => _tslib.__awaiter(void 0, [_b], vo
|
|
|
97
97
|
const clientConfig = createKernelClientConfig(selectedAccount, resolvedBundlerRpc, chain, publicClient, paymasterHandler);
|
|
98
98
|
return clients.createKernelAccountClient(clientConfig);
|
|
99
99
|
});
|
|
100
|
-
const createEcdsaKernelAccountClientWith7702 = (_c) => _tslib.__awaiter(void 0, [_c], void 0, function* ({ bundlerRpc, chain, paymasterRpc, projectId, signer, provider, authorization, paymaster = 'SPONSOR', entryPoint, kernelVersion, ecdsaValidator, }) {
|
|
100
|
+
const createEcdsaKernelAccountClientWith7702 = (_c) => _tslib.__awaiter(void 0, [_c], void 0, function* ({ bundlerRpc, chain, paymasterRpc, projectId, signer, provider, authorization, paymaster = 'SPONSOR', entryPoint, kernelVersion, ecdsaValidator, publicClientRpc, }) {
|
|
101
101
|
const resolvedBundlerRpc = bundlerRpc !== null && bundlerRpc !== void 0 ? bundlerRpc : getZeroDevBundlerRPC(projectId, provider);
|
|
102
102
|
const resolvedPaymasterRpc = paymasterRpc !== null && paymasterRpc !== void 0 ? paymasterRpc : getZeroDevPaymasterRPC(projectId, provider);
|
|
103
|
-
const { publicClient, zerodevPaymaster } = createPublicAndPaymasterClients(resolvedBundlerRpc, resolvedPaymasterRpc, chain);
|
|
103
|
+
const { publicClient, zerodevPaymaster } = createPublicAndPaymasterClients(resolvedBundlerRpc, resolvedPaymasterRpc, chain, publicClientRpc);
|
|
104
104
|
const validator = yield ecdsaValidator(publicClient, {
|
|
105
105
|
entryPoint,
|
|
106
106
|
kernelVersion,
|
|
@@ -21,9 +21,10 @@ type CommonClientParams<TChain extends Chain | undefined = Chain | undefined> =
|
|
|
21
21
|
kernelVersion: GetKernelVersion<EntryPointVersion>;
|
|
22
22
|
ecdsaValidator: any;
|
|
23
23
|
enableKernelV3Migration: boolean;
|
|
24
|
+
publicClientRpc?: string;
|
|
24
25
|
};
|
|
25
|
-
export declare const createEcdsaKernelAccountClient: <entryPoint extends EntryPointVersion, TChain extends ViemChain | undefined = ViemChain | undefined>({ bundlerRpc, chain, paymasterRpc, projectId, signer, provider, paymaster, entryPoint, kernelVersion, ecdsaValidator, enableKernelV3Migration, }: CommonClientParams<TChain>) => Promise<KernelAccountClient<Transport, ViemChain, SmartAccount, Client, RpcSchema>>;
|
|
26
|
-
export declare const createEcdsaKernelAccountClientWith7702: <TChain extends ViemChain | undefined = ViemChain | undefined>({ bundlerRpc, chain, paymasterRpc, projectId, signer, provider, authorization, paymaster, entryPoint, kernelVersion, ecdsaValidator, }: CommonClientParams<TChain> & {
|
|
26
|
+
export declare const createEcdsaKernelAccountClient: <entryPoint extends EntryPointVersion, TChain extends ViemChain | undefined = ViemChain | undefined>({ bundlerRpc, chain, paymasterRpc, projectId, signer, provider, paymaster, entryPoint, kernelVersion, ecdsaValidator, enableKernelV3Migration, publicClientRpc, }: CommonClientParams<TChain>) => Promise<KernelAccountClient<Transport, ViemChain, SmartAccount, Client, RpcSchema>>;
|
|
27
|
+
export declare const createEcdsaKernelAccountClientWith7702: <TChain extends ViemChain | undefined = ViemChain | undefined>({ bundlerRpc, chain, paymasterRpc, projectId, signer, provider, authorization, paymaster, entryPoint, kernelVersion, ecdsaValidator, publicClientRpc, }: CommonClientParams<TChain> & {
|
|
27
28
|
authorization?: SignAuthorizationReturnType;
|
|
28
29
|
}) => Promise<KernelAccountClient<Transport, ViemChain, SmartAccount, Client, RpcSchema>>;
|
|
29
30
|
export {};
|
|
@@ -22,10 +22,10 @@ const getZeroDevPaymasterRPC = (projectId, provider) => {
|
|
|
22
22
|
return rpc;
|
|
23
23
|
};
|
|
24
24
|
const isERC20 = (value) => isAddress(value);
|
|
25
|
-
const createPublicAndPaymasterClients = (bundlerRpc, paymasterRpc, chain) => {
|
|
25
|
+
const createPublicAndPaymasterClients = (bundlerRpc, paymasterRpc, chain, publicClientRpc) => {
|
|
26
26
|
const publicClient = createPublicClient({
|
|
27
27
|
chain,
|
|
28
|
-
transport: http(bundlerRpc),
|
|
28
|
+
transport: publicClientRpc ? http(publicClientRpc) : http(bundlerRpc),
|
|
29
29
|
});
|
|
30
30
|
const zerodevPaymaster = createZeroDevPaymasterClient({
|
|
31
31
|
chain,
|
|
@@ -61,10 +61,10 @@ const createKernelClientConfig = (account, bundlerRpc, chain, publicClient, paym
|
|
|
61
61
|
estimateFeesPerGas: (_a) => __awaiter(void 0, [_a], void 0, function* ({ bundlerClient }) { return getUserOperationGasPrice(bundlerClient); }),
|
|
62
62
|
},
|
|
63
63
|
});
|
|
64
|
-
const createEcdsaKernelAccountClient = (_b) => __awaiter(void 0, [_b], void 0, function* ({ bundlerRpc, chain, paymasterRpc, projectId, signer, provider, paymaster = 'SPONSOR', entryPoint, kernelVersion, ecdsaValidator, enableKernelV3Migration, }) {
|
|
64
|
+
const createEcdsaKernelAccountClient = (_b) => __awaiter(void 0, [_b], void 0, function* ({ bundlerRpc, chain, paymasterRpc, projectId, signer, provider, paymaster = 'SPONSOR', entryPoint, kernelVersion, ecdsaValidator, enableKernelV3Migration, publicClientRpc, }) {
|
|
65
65
|
const resolvedBundlerRpc = bundlerRpc !== null && bundlerRpc !== void 0 ? bundlerRpc : getZeroDevBundlerRPC(projectId, provider);
|
|
66
66
|
const resolvedPaymasterRpc = paymasterRpc !== null && paymasterRpc !== void 0 ? paymasterRpc : getZeroDevPaymasterRPC(projectId, provider);
|
|
67
|
-
const { publicClient, zerodevPaymaster } = createPublicAndPaymasterClients(resolvedBundlerRpc, resolvedPaymasterRpc, chain);
|
|
67
|
+
const { publicClient, zerodevPaymaster } = createPublicAndPaymasterClients(resolvedBundlerRpc, resolvedPaymasterRpc, chain, publicClientRpc);
|
|
68
68
|
const validator = yield ecdsaValidator(publicClient, {
|
|
69
69
|
entryPoint,
|
|
70
70
|
kernelVersion,
|
|
@@ -93,10 +93,10 @@ const createEcdsaKernelAccountClient = (_b) => __awaiter(void 0, [_b], void 0, f
|
|
|
93
93
|
const clientConfig = createKernelClientConfig(selectedAccount, resolvedBundlerRpc, chain, publicClient, paymasterHandler);
|
|
94
94
|
return createKernelAccountClient(clientConfig);
|
|
95
95
|
});
|
|
96
|
-
const createEcdsaKernelAccountClientWith7702 = (_c) => __awaiter(void 0, [_c], void 0, function* ({ bundlerRpc, chain, paymasterRpc, projectId, signer, provider, authorization, paymaster = 'SPONSOR', entryPoint, kernelVersion, ecdsaValidator, }) {
|
|
96
|
+
const createEcdsaKernelAccountClientWith7702 = (_c) => __awaiter(void 0, [_c], void 0, function* ({ bundlerRpc, chain, paymasterRpc, projectId, signer, provider, authorization, paymaster = 'SPONSOR', entryPoint, kernelVersion, ecdsaValidator, publicClientRpc, }) {
|
|
97
97
|
const resolvedBundlerRpc = bundlerRpc !== null && bundlerRpc !== void 0 ? bundlerRpc : getZeroDevBundlerRPC(projectId, provider);
|
|
98
98
|
const resolvedPaymasterRpc = paymasterRpc !== null && paymasterRpc !== void 0 ? paymasterRpc : getZeroDevPaymasterRPC(projectId, provider);
|
|
99
|
-
const { publicClient, zerodevPaymaster } = createPublicAndPaymasterClients(resolvedBundlerRpc, resolvedPaymasterRpc, chain);
|
|
99
|
+
const { publicClient, zerodevPaymaster } = createPublicAndPaymasterClients(resolvedBundlerRpc, resolvedPaymasterRpc, chain, publicClientRpc);
|
|
100
100
|
const validator = yield ecdsaValidator(publicClient, {
|
|
101
101
|
entryPoint,
|
|
102
102
|
kernelVersion,
|
package/src/utils/index.d.ts
CHANGED
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import { InternalWalletConnector, EVMAuthorizationParameters, EVMAuthorizationResult } from '@dynamic-labs/wallet-connector-core';
|
|
2
|
+
type EVMAuthorizationCapableConnector = InternalWalletConnector & {
|
|
3
|
+
experimental_signAuthorization: (params: EVMAuthorizationParameters) => Promise<EVMAuthorizationResult>;
|
|
4
|
+
};
|
|
5
|
+
export declare const isEVMAuthorizationCapable: (connector: InternalWalletConnector) => connector is EVMAuthorizationCapableConnector;
|
|
6
|
+
export {};
|