@dynamic-labs/ethereum-aa 3.0.0-alpha.52 → 3.0.0-alpha.54

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 CHANGED
@@ -1,4 +1,50 @@
1
1
 
2
+ ## [3.0.0-alpha.54](https://github.com/dynamic-labs/DynamicAuth/compare/v3.0.0-alpha.53...v3.0.0-alpha.54) (2024-08-29)
3
+
4
+
5
+ ### Bug Fixes
6
+
7
+ * transaction hanging in confirmation modal ([#6740](https://github.com/dynamic-labs/DynamicAuth/issues/6740)) ([f03d286](https://github.com/dynamic-labs/DynamicAuth/commit/f03d286aaf471dbc7a6149acee10512be7b56b18))
8
+
9
+ ## [3.0.0-alpha.53](https://github.com/dynamic-labs/DynamicAuth/compare/v3.0.0-alpha.52...v3.0.0-alpha.53) (2024-08-29)
10
+
11
+
12
+ ### ⚠ BREAKING CHANGES
13
+
14
+ * simplify solana wallet signer types (#6748)
15
+ * deprecate getEoaConnector (#6571)
16
+ * limit methods and props returned by wallet.connector (#6540)
17
+ * move generic solana code to solana-core package (#6701)
18
+ * revamp ether v6 interface (#6548)
19
+ * add ethereum wallet specific methods and intercept to sync when needed (#6662)
20
+ * add solana wallet specific methods and intercept to sync when needed (#6608)
21
+ * don't force primary wallet to be connected (#6128)
22
+
23
+ ### Features
24
+
25
+ * add bitcoin wallet specific methods and intercept to sync when needed ([#6663](https://github.com/dynamic-labs/DynamicAuth/issues/6663)) ([ed699b1](https://github.com/dynamic-labs/DynamicAuth/commit/ed699b1f8c264755779ec4840d105f89ade5500e))
26
+ * add ethereum wallet specific methods and intercept to sync when needed ([#6662](https://github.com/dynamic-labs/DynamicAuth/issues/6662)) ([372360e](https://github.com/dynamic-labs/DynamicAuth/commit/372360ed7ca395f88811fc62c94b2b494eb59971))
27
+ * add solana wallet specific methods and intercept to sync when needed ([#6608](https://github.com/dynamic-labs/DynamicAuth/issues/6608)) ([565f610](https://github.com/dynamic-labs/DynamicAuth/commit/565f6100340296c267e9706fd263e9bd3f7d3732))
28
+ * add useSmartWallets hook to manage aa wallets ([#6564](https://github.com/dynamic-labs/DynamicAuth/issues/6564)) ([a243d36](https://github.com/dynamic-labs/DynamicAuth/commit/a243d361ce7c368d0f1afda55f9c1fabefd75ba8))
29
+ * don't force primary wallet to be connected ([#6128](https://github.com/dynamic-labs/DynamicAuth/issues/6128)) ([018a6f6](https://github.com/dynamic-labs/DynamicAuth/commit/018a6f66f8725914ab97ea3e2e1c80626266e503))
30
+ * new prop to enable prompt for linking when account change is detected ([#6713](https://github.com/dynamic-labs/DynamicAuth/issues/6713)) ([b5a6321](https://github.com/dynamic-labs/DynamicAuth/commit/b5a63212ae33fae24401f141d5ca2356b446dcff))
31
+
32
+
33
+ ### Bug Fixes
34
+
35
+ * always sync wagmi client with primary wallet ([#6577](https://github.com/dynamic-labs/DynamicAuth/issues/6577)) ([be22fde](https://github.com/dynamic-labs/DynamicAuth/commit/be22fdea3bb61db79b06ba56cb32da6cd8141b66))
36
+ * cosmos wallet intercepts ([#6720](https://github.com/dynamic-labs/DynamicAuth/issues/6720)) ([cfc9df4](https://github.com/dynamic-labs/DynamicAuth/commit/cfc9df48a8032f7348fec14f77b9e378d2e26a22))
37
+ * magiceden wallet events not working correctly on page refresh ([#6735](https://github.com/dynamic-labs/DynamicAuth/issues/6735)) ([6ed5964](https://github.com/dynamic-labs/DynamicAuth/commit/6ed5964134a2cafd392c19f18eb71e6ca2ce238d))
38
+ * use proxy to intercept solana signer methods ([#6743](https://github.com/dynamic-labs/DynamicAuth/issues/6743)) ([ecbe5ea](https://github.com/dynamic-labs/DynamicAuth/commit/ecbe5ea772592d2c693d8222d85b7642acd151a8))
39
+ * wallet.chain references ([525c1ca](https://github.com/dynamic-labs/DynamicAuth/commit/525c1ca9a8fe6402c06eabe6aebc30e310411d9b))
40
+
41
+
42
+ * deprecate getEoaConnector ([#6571](https://github.com/dynamic-labs/DynamicAuth/issues/6571)) ([0226ee5](https://github.com/dynamic-labs/DynamicAuth/commit/0226ee5a13f2418607076ee6f2ec0a579b06dd5d))
43
+ * limit methods and props returned by wallet.connector ([#6540](https://github.com/dynamic-labs/DynamicAuth/issues/6540)) ([9c86e35](https://github.com/dynamic-labs/DynamicAuth/commit/9c86e35c72cd40313bfd19254dd6171ee8f62213))
44
+ * move generic solana code to solana-core package ([#6701](https://github.com/dynamic-labs/DynamicAuth/issues/6701)) ([30815f5](https://github.com/dynamic-labs/DynamicAuth/commit/30815f5d46feeefb2413c1b7d30b43d5370ee032))
45
+ * revamp ether v6 interface ([#6548](https://github.com/dynamic-labs/DynamicAuth/issues/6548)) ([f3b2fb8](https://github.com/dynamic-labs/DynamicAuth/commit/f3b2fb8da7de21f9c58e67fa7f5580166195092a))
46
+ * simplify solana wallet signer types ([#6748](https://github.com/dynamic-labs/DynamicAuth/issues/6748)) ([01d1a42](https://github.com/dynamic-labs/DynamicAuth/commit/01d1a42bc916ab329580b741ba60d706bf6c5491))
47
+
2
48
  ## [3.0.0-alpha.52](https://github.com/dynamic-labs/DynamicAuth/compare/v3.0.0-alpha.51...v3.0.0-alpha.52) (2024-08-28)
3
49
 
4
50
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@dynamic-labs/ethereum-aa",
3
- "version": "3.0.0-alpha.52",
3
+ "version": "3.0.0-alpha.54",
4
4
  "repository": {
5
5
  "type": "git",
6
6
  "url": "git+https://github.com/dynamic-labs/dynamic-auth.git",
@@ -31,13 +31,12 @@
31
31
  "@zerodev/multi-chain-validator": "5.3.3",
32
32
  "@zerodev/sdk": "5.3.4",
33
33
  "permissionless": "^0.1.20",
34
- "@dynamic-labs/ethereum": "3.0.0-alpha.52",
35
- "@dynamic-labs/ethereum-core": "3.0.0-alpha.52",
36
- "@dynamic-labs/logger": "3.0.0-alpha.52",
37
- "@dynamic-labs/types": "3.0.0-alpha.52",
38
- "@dynamic-labs/utils": "3.0.0-alpha.52",
39
- "@dynamic-labs/wallet-book": "3.0.0-alpha.52",
40
- "@dynamic-labs/wallet-connector-core": "3.0.0-alpha.52"
34
+ "@dynamic-labs/ethereum-core": "3.0.0-alpha.54",
35
+ "@dynamic-labs/logger": "3.0.0-alpha.54",
36
+ "@dynamic-labs/types": "3.0.0-alpha.54",
37
+ "@dynamic-labs/utils": "3.0.0-alpha.54",
38
+ "@dynamic-labs/wallet-book": "3.0.0-alpha.54",
39
+ "@dynamic-labs/wallet-connector-core": "3.0.0-alpha.54"
41
40
  },
42
41
  "peerDependencies": {
43
42
  "viem": "^2.7.6"
@@ -13,7 +13,6 @@ var sdkApiCore = require('@dynamic-labs/sdk-api-core');
13
13
  var walletConnectorCore = require('@dynamic-labs/wallet-connector-core');
14
14
  var ethereumCore = require('@dynamic-labs/ethereum-core');
15
15
  var utils = require('@dynamic-labs/utils');
16
- var ethereum = require('@dynamic-labs/ethereum');
17
16
  var fetchChain = require('./utils/fetchChain.cjs');
18
17
  var logger = require('./utils/logger.cjs');
19
18
  var createEcsdaKernelAccountClient = require('./utils/createEcsdaKernelAccountClient.cjs');
@@ -22,6 +21,7 @@ class ZeroDevConnector extends walletConnectorCore.WalletConnectorBase {
22
21
  constructor(opts) {
23
22
  var _a, _b, _c, _d;
24
23
  super(opts);
24
+ this.ChainWallet = ethereumCore.EthereumWallet;
25
25
  this.connectedChain = 'EVM';
26
26
  this.supportedChains = ['ETH', 'EVM'];
27
27
  this.isGasSponsorshipDisabled = false;
@@ -89,6 +89,10 @@ class ZeroDevConnector extends walletConnectorCore.WalletConnectorBase {
89
89
  return ecdsaValidator.signerToEcdsaValidator;
90
90
  }
91
91
  }
92
+ /**
93
+ * @deprecated You should get the EOA connector by passing the SCW to getEOAConnector,
94
+ * from the useSmartWallet hook
95
+ */
92
96
  getEOAConnector() {
93
97
  return this.eoaConnector;
94
98
  }
@@ -111,7 +115,7 @@ class ZeroDevConnector extends walletConnectorCore.WalletConnectorBase {
111
115
  }
112
116
  this.kernelClientDeferredPromise = new utils.DeferredPromise();
113
117
  this.eoaConnector = connector;
114
- if (ethereum.isEthWalletConnector(this.eoaConnector) &&
118
+ if (ethereumCore.isEthWalletConnector(this.eoaConnector) &&
115
119
  !this.eoaConnector.getActiveAccount()) {
116
120
  yield this.eoaConnector.getConnectedAccounts();
117
121
  }
@@ -249,6 +253,7 @@ class ZeroDevConnector extends walletConnectorCore.WalletConnectorBase {
249
253
  }),
250
254
  provider: provider.extend(viem.publicActions),
251
255
  transport: viem.custom(provider),
256
+ // TODO: remove this. We should not be passing references to wallet connectors
252
257
  walletConnector: this,
253
258
  walletUiUtils: this._walletUiUtils,
254
259
  });
@@ -336,6 +341,7 @@ class ZeroDevConnector extends walletConnectorCore.WalletConnectorBase {
336
341
  }
337
342
  createUiTransaction(from) {
338
343
  return _tslib.__awaiter(this, void 0, void 0, function* () {
344
+ yield this.validateActiveWallet(from);
339
345
  const walletClient = this.getWalletClient();
340
346
  const publicClient = yield this.getPublicClient();
341
347
  if (!publicClient || !walletClient) {
@@ -7,7 +7,8 @@ import { EntryPoint } from 'permissionless/types';
7
7
  import { KERNEL_VERSION_TYPE } from '@zerodev/sdk/types';
8
8
  import { signerToEcdsaValidator } from '@zerodev/ecdsa-validator';
9
9
  import { Provider, ProviderEnum } from '@dynamic-labs/sdk-api-core';
10
- import { Chain, IAccountAbstractionWalletConnector, ISendBalanceWalletConnector, WalletConnector, WalletConnectorBase } from '@dynamic-labs/wallet-connector-core';
10
+ import { Chain, IAccountAbstractionWalletConnector, ISendBalanceWalletConnector, InternalWalletConnector, WalletConnectorBase } from '@dynamic-labs/wallet-connector-core';
11
+ import { EthereumWallet } from '@dynamic-labs/ethereum-core';
11
12
  import { WalletBookSchema } from '@dynamic-labs/wallet-book';
12
13
  import { EvmNetwork, GenericNetwork, IUITransaction, WalletUiUtils } from '@dynamic-labs/types';
13
14
  import { BundlerProvider } from './utils';
@@ -17,15 +18,16 @@ type ZeroDevConnectorProps = {
17
18
  };
18
19
  evmNetworks: GenericNetwork[];
19
20
  walletBook: WalletBookSchema;
20
- walletUiUtils: WalletUiUtils<WalletConnector>;
21
+ walletUiUtils: WalletUiUtils<InternalWalletConnector>;
21
22
  bundlerProvider: BundlerProvider | undefined;
22
23
  };
23
24
  type IZeroDevConnector = IAccountAbstractionWalletConnector & ISendBalanceWalletConnector;
24
- export declare class ZeroDevConnector extends WalletConnectorBase implements IZeroDevConnector {
25
+ export declare class ZeroDevConnector extends WalletConnectorBase<typeof EthereumWallet> implements IZeroDevConnector {
25
26
  projectId: string;
26
27
  kernelClient: KernelAccountClient<EntryPoint, Transport, ViemChain, KernelSmartAccount<EntryPoint>> | undefined;
27
- eoaConnector: WalletConnector | undefined;
28
+ eoaConnector: InternalWalletConnector | undefined;
28
29
  kernelClientWithSponsorship: KernelAccountClient<EntryPoint, Transport, ViemChain, KernelSmartAccount<EntryPoint>> | undefined;
30
+ ChainWallet: typeof EthereumWallet;
29
31
  connectedChain: Chain;
30
32
  supportedChains: Chain[];
31
33
  evmNetworks: EvmNetwork[];
@@ -57,12 +59,16 @@ export declare class ZeroDevConnector extends WalletConnectorBase implements IZe
57
59
  getEntryPoint(entryPoint: string | undefined): "0x5FF137D4b0FDCD49DcA30c7CF57E578a026d2789" | "0x0000000071727De22E5E9d8BAf0edAc6f37da032";
58
60
  getKernelVersion(kernelVersion: string | undefined): KERNEL_VERSION_TYPE;
59
61
  getEcdsaValidator(ecdsaProviderType: string | undefined): typeof signerToEcdsaValidator | typeof toMultiChainECDSAValidator;
60
- getEOAConnector(): WalletConnector | undefined;
62
+ /**
63
+ * @deprecated You should get the EOA connector by passing the SCW to getEOAConnector,
64
+ * from the useSmartWallet hook
65
+ */
66
+ getEOAConnector(): InternalWalletConnector | undefined;
61
67
  getAccountAbstractionProvider({ withSponsorship, }?: {
62
68
  withSponsorship?: boolean;
63
69
  }): KernelAccountClient<EntryPoint> | undefined;
64
70
  endSession(): Promise<void>;
65
- setEoaConnector(connector: WalletConnector): Promise<void>;
71
+ setEoaConnector(connector: InternalWalletConnector): Promise<void>;
66
72
  private checkIsProjectChainEnabled;
67
73
  private getKernelClientWithSponsorshipValidation;
68
74
  getAddress(): Promise<string | undefined>;
@@ -7,9 +7,8 @@ import { KERNEL_V3_1, KERNEL_V3_0, KERNEL_V2_4 } from '@zerodev/sdk/constants';
7
7
  import { signerToEcdsaValidator } from '@zerodev/ecdsa-validator';
8
8
  import { ProviderEntryPointVersionEnum, ProviderKernelVersionEnum } from '@dynamic-labs/sdk-api-core';
9
9
  import { WalletConnectorBase } from '@dynamic-labs/wallet-connector-core';
10
- import { confirmationTransport, chainsMap, unFormatTransaction, createViemUiTransaction } from '@dynamic-labs/ethereum-core';
10
+ import { EthereumWallet, confirmationTransport, chainsMap, isEthWalletConnector, unFormatTransaction, createViemUiTransaction } from '@dynamic-labs/ethereum-core';
11
11
  import { parseEvmNetworks, DynamicError, DeferredPromise, wrapMethodWithCallback, TransactionGasCannotBeSponsoredError, InsufficientFundsError } from '@dynamic-labs/utils';
12
- import { isEthWalletConnector } from '@dynamic-labs/ethereum';
13
12
  import { cachedChainIdKey, fetchChain } from './utils/fetchChain.js';
14
13
  import { logger } from './utils/logger.js';
15
14
  import { createEcdsaKernelAccountClient } from './utils/createEcsdaKernelAccountClient.js';
@@ -18,6 +17,7 @@ class ZeroDevConnector extends WalletConnectorBase {
18
17
  constructor(opts) {
19
18
  var _a, _b, _c, _d;
20
19
  super(opts);
20
+ this.ChainWallet = EthereumWallet;
21
21
  this.connectedChain = 'EVM';
22
22
  this.supportedChains = ['ETH', 'EVM'];
23
23
  this.isGasSponsorshipDisabled = false;
@@ -85,6 +85,10 @@ class ZeroDevConnector extends WalletConnectorBase {
85
85
  return signerToEcdsaValidator;
86
86
  }
87
87
  }
88
+ /**
89
+ * @deprecated You should get the EOA connector by passing the SCW to getEOAConnector,
90
+ * from the useSmartWallet hook
91
+ */
88
92
  getEOAConnector() {
89
93
  return this.eoaConnector;
90
94
  }
@@ -245,6 +249,7 @@ class ZeroDevConnector extends WalletConnectorBase {
245
249
  }),
246
250
  provider: provider.extend(publicActions),
247
251
  transport: custom(provider),
252
+ // TODO: remove this. We should not be passing references to wallet connectors
248
253
  walletConnector: this,
249
254
  walletUiUtils: this._walletUiUtils,
250
255
  });
@@ -332,6 +337,7 @@ class ZeroDevConnector extends WalletConnectorBase {
332
337
  }
333
338
  createUiTransaction(from) {
334
339
  return __awaiter(this, void 0, void 0, function* () {
340
+ yield this.validateActiveWallet(from);
335
341
  const walletClient = this.getWalletClient();
336
342
  const publicClient = yield this.getPublicClient();
337
343
  if (!publicClient || !walletClient) {