@dynamic-labs/ethereum-aa 4.0.0-alpha.4 → 4.0.0-alpha.41

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.
@@ -1,14 +1,12 @@
1
1
  import { KernelAccountClient } from '@zerodev/sdk/clients';
2
2
  import { KernelSmartAccount } from '@zerodev/sdk/accounts';
3
- import { toMultiChainECDSAValidator } from '@zerodev/multi-chain-validator';
4
3
  import { Account, PublicClient, Transport, WalletClient } from 'viem';
5
4
  import { type Chain as ViemChain } from 'viem/chains';
6
5
  import { EntryPoint } from 'permissionless/types';
7
6
  import { KERNEL_VERSION_TYPE } from '@zerodev/sdk/types';
8
- import { signerToEcdsaValidator } from '@zerodev/ecdsa-validator';
9
- import { Provider, ProviderEnum } from '@dynamic-labs/sdk-api-core';
10
- import { Chain, IAccountAbstractionWalletConnector, ISendBalanceWalletConnector, InternalWalletConnector, WalletConnectorBase } from '@dynamic-labs/wallet-connector-core';
11
7
  import { EthereumWallet } from '@dynamic-labs/ethereum-core';
8
+ import { EcdsaValidatorOptions, Provider, ProviderEntryPointVersionEnum, ProviderEnum, ProviderKernelVersionEnum, ProviderMultichainAccountAbstractionProviders } from '@dynamic-labs/sdk-api-core';
9
+ import { Chain, IAccountAbstractionWalletConnector, ISendBalanceWalletConnector, InternalWalletConnector, WalletConnectorBase } from '@dynamic-labs/wallet-connector-core';
12
10
  import { WalletBookSchema } from '@dynamic-labs/wallet-book';
13
11
  import { EvmNetwork, GenericNetwork, IUITransaction, WalletUiUtils } from '@dynamic-labs/types';
14
12
  import { BundlerProvider } from './utils';
@@ -22,11 +20,13 @@ type ZeroDevConnectorProps = {
22
20
  bundlerProvider: BundlerProvider | undefined;
23
21
  };
24
22
  type IZeroDevConnector = IAccountAbstractionWalletConnector & ISendBalanceWalletConnector;
23
+ type KernelClient = KernelAccountClient<EntryPoint, Transport, ViemChain, KernelSmartAccount<EntryPoint>>;
25
24
  export declare class ZeroDevConnector extends WalletConnectorBase<typeof EthereumWallet> implements IZeroDevConnector {
26
- projectId: string;
27
- kernelClient: KernelAccountClient<EntryPoint, Transport, ViemChain, KernelSmartAccount<EntryPoint>> | undefined;
25
+ clientId: string;
28
26
  eoaConnector: InternalWalletConnector | undefined;
29
- kernelClientWithSponsorship: KernelAccountClient<EntryPoint, Transport, ViemChain, KernelSmartAccount<EntryPoint>> | undefined;
27
+ eoaAddress: string | undefined;
28
+ private providerMap;
29
+ private eoaConnectorMap;
30
30
  ChainWallet: typeof EthereumWallet;
31
31
  connectedChain: Chain;
32
32
  supportedChains: Chain[];
@@ -36,6 +36,8 @@ export declare class ZeroDevConnector extends WalletConnectorBase<typeof Ethereu
36
36
  entryPoint: EntryPoint;
37
37
  kernelVersion: KERNEL_VERSION_TYPE;
38
38
  ecdsaProviderType: string | undefined;
39
+ defaultChainId: string | undefined;
40
+ providersFromApi: ProviderMultichainAccountAbstractionProviders[];
39
41
  static bundlerProvider: BundlerProvider | undefined;
40
42
  static bundlerRpc: string | undefined;
41
43
  static paymasterRpc: string | undefined;
@@ -56,9 +58,17 @@ export declare class ZeroDevConnector extends WalletConnectorBase<typeof Ethereu
56
58
  };
57
59
  private _walletUiUtils;
58
60
  constructor(opts: ZeroDevConnectorProps);
59
- getEntryPoint(entryPoint: string | undefined): "0x5FF137D4b0FDCD49DcA30c7CF57E578a026d2789" | "0x0000000071727De22E5E9d8BAf0edAc6f37da032";
60
- getKernelVersion(kernelVersion: string | undefined): KERNEL_VERSION_TYPE;
61
- getEcdsaValidator(ecdsaProviderType: string | undefined): typeof signerToEcdsaValidator | typeof toMultiChainECDSAValidator;
61
+ get currentNetworkProvider(): {
62
+ kernelClient: KernelClient;
63
+ kernelClientWithSponsorship: KernelClient;
64
+ } | undefined;
65
+ get lastUsedChainId(): string;
66
+ get kernelClient(): KernelClient | undefined;
67
+ get kernelClientWithSponsorship(): KernelClient | undefined;
68
+ supportsNetworkSwitching(): boolean;
69
+ switchNetwork({ networkChainId, }: {
70
+ networkChainId?: number | string;
71
+ }): Promise<void>;
62
72
  /**
63
73
  * @deprecated You should get the EOA connector by passing the SCW to getEOAConnector,
64
74
  * from the useSmartWallet hook
@@ -66,10 +76,21 @@ export declare class ZeroDevConnector extends WalletConnectorBase<typeof Ethereu
66
76
  getEOAConnector(): InternalWalletConnector | undefined;
67
77
  getAccountAbstractionProvider({ withSponsorship, }?: {
68
78
  withSponsorship?: boolean;
69
- }): KernelAccountClient<EntryPoint> | undefined;
79
+ }): KernelClient | undefined;
70
80
  endSession(): Promise<void>;
71
- setEoaConnector(connector: InternalWalletConnector): Promise<void>;
72
- private checkIsProjectChainEnabled;
81
+ registerEoa({ smartWalletAddress, eoaAddress, eoaConnector, shouldSetEoaConnector, ecdsaProviderType, kernelVersion, entryPointVersion, }: {
82
+ smartWalletAddress: string;
83
+ eoaAddress: string;
84
+ eoaConnector: InternalWalletConnector;
85
+ shouldSetEoaConnector: boolean;
86
+ ecdsaProviderType?: EcdsaValidatorOptions;
87
+ kernelVersion?: ProviderKernelVersionEnum;
88
+ entryPointVersion?: ProviderEntryPointVersionEnum;
89
+ }): Promise<void>;
90
+ private setEoaConnector;
91
+ private warnIfProjectChainNotEnabled;
92
+ private generateProviderMap;
93
+ private getKernelClientWithoutSponsorshipValidation;
73
94
  private getKernelClientWithSponsorshipValidation;
74
95
  getAddress(): Promise<string | undefined>;
75
96
  getConnectedAccounts(): Promise<string[]>;
@@ -2895,44 +2916,44 @@ export declare class ZeroDevConnector extends WalletConnectorBase<typeof Ethereu
2895
2916
  [x: `address[${string}]`]: undefined;
2896
2917
  [x: `bool[${string}]`]: undefined;
2897
2918
  [x: `bytes[${string}]`]: undefined;
2898
- [x: `bytes9[${string}]`]: undefined;
2899
2919
  [x: `bytes1[${string}]`]: undefined;
2900
- [x: `bytes32[${string}]`]: undefined;
2901
- [x: `bytes31[${string}]`]: undefined;
2902
- [x: `bytes30[${string}]`]: undefined;
2903
- [x: `bytes29[${string}]`]: undefined;
2904
- [x: `bytes28[${string}]`]: undefined;
2905
- [x: `bytes27[${string}]`]: undefined;
2906
- [x: `bytes26[${string}]`]: undefined;
2907
- [x: `bytes25[${string}]`]: undefined;
2908
- [x: `bytes24[${string}]`]: undefined;
2909
- [x: `bytes23[${string}]`]: undefined;
2910
- [x: `bytes22[${string}]`]: undefined;
2911
- [x: `bytes21[${string}]`]: undefined;
2912
- [x: `bytes20[${string}]`]: undefined;
2913
- [x: `bytes19[${string}]`]: undefined;
2914
2920
  [x: `bytes2[${string}]`]: undefined;
2915
- [x: `bytes18[${string}]`]: undefined;
2916
- [x: `bytes17[${string}]`]: undefined;
2917
- [x: `bytes16[${string}]`]: undefined;
2918
- [x: `bytes15[${string}]`]: undefined;
2919
- [x: `bytes14[${string}]`]: undefined;
2920
- [x: `bytes13[${string}]`]: undefined;
2921
- [x: `bytes12[${string}]`]: undefined;
2922
- [x: `bytes11[${string}]`]: undefined;
2923
- [x: `bytes10[${string}]`]: undefined;
2924
- [x: `bytes8[${string}]`]: undefined;
2925
- [x: `bytes7[${string}]`]: undefined;
2926
- [x: `bytes6[${string}]`]: undefined;
2927
- [x: `bytes5[${string}]`]: undefined;
2928
- [x: `bytes4[${string}]`]: undefined;
2929
2921
  [x: `bytes3[${string}]`]: undefined;
2922
+ [x: `bytes4[${string}]`]: undefined;
2923
+ [x: `bytes5[${string}]`]: undefined;
2924
+ [x: `bytes6[${string}]`]: undefined;
2925
+ [x: `bytes7[${string}]`]: undefined;
2926
+ [x: `bytes8[${string}]`]: undefined;
2927
+ [x: `bytes9[${string}]`]: undefined;
2928
+ [x: `bytes10[${string}]`]: undefined;
2929
+ [x: `bytes11[${string}]`]: undefined;
2930
+ [x: `bytes12[${string}]`]: undefined;
2931
+ [x: `bytes13[${string}]`]: undefined;
2932
+ [x: `bytes14[${string}]`]: undefined;
2933
+ [x: `bytes15[${string}]`]: undefined;
2934
+ [x: `bytes16[${string}]`]: undefined;
2935
+ [x: `bytes17[${string}]`]: undefined;
2936
+ [x: `bytes18[${string}]`]: undefined;
2937
+ [x: `bytes19[${string}]`]: undefined;
2938
+ [x: `bytes20[${string}]`]: undefined;
2939
+ [x: `bytes21[${string}]`]: undefined;
2940
+ [x: `bytes22[${string}]`]: undefined;
2941
+ [x: `bytes23[${string}]`]: undefined;
2942
+ [x: `bytes24[${string}]`]: undefined;
2943
+ [x: `bytes25[${string}]`]: undefined;
2944
+ [x: `bytes26[${string}]`]: undefined;
2945
+ [x: `bytes27[${string}]`]: undefined;
2946
+ [x: `bytes28[${string}]`]: undefined;
2947
+ [x: `bytes29[${string}]`]: undefined;
2948
+ [x: `bytes30[${string}]`]: undefined;
2949
+ [x: `bytes31[${string}]`]: undefined;
2950
+ [x: `bytes32[${string}]`]: undefined;
2930
2951
  [x: `int[${string}]`]: undefined;
2931
- [x: `int40[${string}]`]: undefined;
2932
- [x: `int32[${string}]`]: undefined;
2933
- [x: `int24[${string}]`]: undefined;
2934
- [x: `int16[${string}]`]: undefined;
2935
2952
  [x: `int8[${string}]`]: undefined;
2953
+ [x: `int16[${string}]`]: undefined;
2954
+ [x: `int24[${string}]`]: undefined;
2955
+ [x: `int32[${string}]`]: undefined;
2956
+ [x: `int40[${string}]`]: undefined;
2936
2957
  [x: `int48[${string}]`]: undefined;
2937
2958
  [x: `int56[${string}]`]: undefined;
2938
2959
  [x: `int64[${string}]`]: undefined;
@@ -2961,11 +2982,11 @@ export declare class ZeroDevConnector extends WalletConnectorBase<typeof Ethereu
2961
2982
  [x: `int248[${string}]`]: undefined;
2962
2983
  [x: `int256[${string}]`]: undefined;
2963
2984
  [x: `uint[${string}]`]: undefined;
2964
- [x: `uint40[${string}]`]: undefined;
2965
- [x: `uint32[${string}]`]: undefined;
2966
- [x: `uint24[${string}]`]: undefined;
2967
- [x: `uint16[${string}]`]: undefined;
2968
2985
  [x: `uint8[${string}]`]: undefined;
2986
+ [x: `uint16[${string}]`]: undefined;
2987
+ [x: `uint24[${string}]`]: undefined;
2988
+ [x: `uint32[${string}]`]: undefined;
2989
+ [x: `uint40[${string}]`]: undefined;
2969
2990
  [x: `uint48[${string}]`]: undefined;
2970
2991
  [x: `uint56[${string}]`]: undefined;
2971
2992
  [x: `uint64[${string}]`]: undefined;
@@ -2997,43 +3018,43 @@ export declare class ZeroDevConnector extends WalletConnectorBase<typeof Ethereu
2997
3018
  address?: undefined;
2998
3019
  bool?: undefined;
2999
3020
  bytes?: undefined;
3000
- bytes9?: undefined;
3001
3021
  bytes1?: undefined;
3002
- bytes32?: undefined;
3003
- bytes31?: undefined;
3004
- bytes30?: undefined;
3005
- bytes29?: undefined;
3006
- bytes28?: undefined;
3007
- bytes27?: undefined;
3008
- bytes26?: undefined;
3009
- bytes25?: undefined;
3010
- bytes24?: undefined;
3011
- bytes23?: undefined;
3012
- bytes22?: undefined;
3013
- bytes21?: undefined;
3014
- bytes20?: undefined;
3015
- bytes19?: undefined;
3016
3022
  bytes2?: undefined;
3017
- bytes18?: undefined;
3018
- bytes17?: undefined;
3019
- bytes16?: undefined;
3020
- bytes15?: undefined;
3021
- bytes14?: undefined;
3022
- bytes13?: undefined;
3023
- bytes12?: undefined;
3024
- bytes11?: undefined;
3025
- bytes10?: undefined;
3026
- bytes8?: undefined;
3027
- bytes7?: undefined;
3028
- bytes6?: undefined;
3029
- bytes5?: undefined;
3030
- bytes4?: undefined;
3031
3023
  bytes3?: undefined;
3032
- int40?: undefined;
3033
- int32?: undefined;
3034
- int24?: undefined;
3035
- int16?: undefined;
3024
+ bytes4?: undefined;
3025
+ bytes5?: undefined;
3026
+ bytes6?: undefined;
3027
+ bytes7?: undefined;
3028
+ bytes8?: undefined;
3029
+ bytes9?: undefined;
3030
+ bytes10?: undefined;
3031
+ bytes11?: undefined;
3032
+ bytes12?: undefined;
3033
+ bytes13?: undefined;
3034
+ bytes14?: undefined;
3035
+ bytes15?: undefined;
3036
+ bytes16?: undefined;
3037
+ bytes17?: undefined;
3038
+ bytes18?: undefined;
3039
+ bytes19?: undefined;
3040
+ bytes20?: undefined;
3041
+ bytes21?: undefined;
3042
+ bytes22?: undefined;
3043
+ bytes23?: undefined;
3044
+ bytes24?: undefined;
3045
+ bytes25?: undefined;
3046
+ bytes26?: undefined;
3047
+ bytes27?: undefined;
3048
+ bytes28?: undefined;
3049
+ bytes29?: undefined;
3050
+ bytes30?: undefined;
3051
+ bytes31?: undefined;
3052
+ bytes32?: undefined;
3036
3053
  int8?: undefined;
3054
+ int16?: undefined;
3055
+ int24?: undefined;
3056
+ int32?: undefined;
3057
+ int40?: undefined;
3037
3058
  int48?: undefined;
3038
3059
  int56?: undefined;
3039
3060
  int64?: undefined;
@@ -3061,11 +3082,11 @@ export declare class ZeroDevConnector extends WalletConnectorBase<typeof Ethereu
3061
3082
  int240?: undefined;
3062
3083
  int248?: undefined;
3063
3084
  int256?: undefined;
3064
- uint40?: undefined;
3065
- uint32?: undefined;
3066
- uint24?: undefined;
3067
- uint16?: undefined;
3068
3085
  uint8?: undefined;
3086
+ uint16?: undefined;
3087
+ uint24?: undefined;
3088
+ uint32?: undefined;
3089
+ uint40?: undefined;
3069
3090
  uint48?: undefined;
3070
3091
  uint56?: undefined;
3071
3092
  uint64?: undefined;