@dynamic-labs/ethereum-aa 3.0.0-alpha.56 → 3.0.0-alpha.58

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,33 @@
1
1
 
2
+ ## [3.0.0-alpha.58](https://github.com/dynamic-labs/DynamicAuth/compare/v3.0.0-alpha.57...v3.0.0-alpha.58) (2024-09-05)
3
+
4
+
5
+ ### ⚠ BREAKING CHANGES
6
+
7
+ * remove headless prop from DynamicContextProvider ([#6806](https://github.com/dynamic-labs/DynamicAuth/issues/6806)) ([1ab55a1](https://github.com/dynamic-labs/DynamicAuth/commit/1ab55a1cf5d143316617aa88a487bb59446f6f28))
8
+
9
+ ### Features
10
+
11
+ * allow selecting which MetaMask account to connect with when linking new wallet ([#6796](https://github.com/dynamic-labs/DynamicAuth/issues/6796)) ([83e270f](https://github.com/dynamic-labs/DynamicAuth/commit/83e270ffd53d5f6c95464cf570663e1008ffa6fb))
12
+
13
+ ## [3.0.0-alpha.57](https://github.com/dynamic-labs/DynamicAuth/compare/v3.0.0-alpha.56...v3.0.0-alpha.57) (2024-09-05)
14
+
15
+
16
+ ### Features
17
+
18
+ * add support for headless mfa ([#6802](https://github.com/dynamic-labs/DynamicAuth/issues/6802)) ([1eea60e](https://github.com/dynamic-labs/DynamicAuth/commit/1eea60e4f6acf60a9efa8ae64626d0c72e18a12d))
19
+ * telegram auto login ([#6803](https://github.com/dynamic-labs/DynamicAuth/issues/6803)) ([1123ae4](https://github.com/dynamic-labs/DynamicAuth/commit/1123ae4acfdfc54be8dbfa03cc41cbbd00b4bea4))
20
+
21
+
22
+ ### Bug Fixes
23
+
24
+ * circular dependency in solana-core and wallet-book ([#6794](https://github.com/dynamic-labs/DynamicAuth/issues/6794)) ([c0d9254](https://github.com/dynamic-labs/DynamicAuth/commit/c0d9254f21c4a847bcf271886997ba61fe077696))
25
+ * fix overriding cosmos wallet methods ([#6799](https://github.com/dynamic-labs/DynamicAuth/issues/6799)) ([ebce93b](https://github.com/dynamic-labs/DynamicAuth/commit/ebce93bab49bb54d320c77a558d0df48eb1ce19a))
26
+ * fix overriding solana wallet methods ([#6798](https://github.com/dynamic-labs/DynamicAuth/issues/6798)) ([6ab57b5](https://github.com/dynamic-labs/DynamicAuth/commit/6ab57b534b04a3824898bbb9df3fc23397e661f3))
27
+ * memoize return of useSwitchWallet ([#6804](https://github.com/dynamic-labs/DynamicAuth/issues/6804)) ([7e96eb2](https://github.com/dynamic-labs/DynamicAuth/commit/7e96eb28ca3809edd89855c4ecb1344f3e9d53bd))
28
+ * phantom wallets error when trying to sync wallet ([#6782](https://github.com/dynamic-labs/DynamicAuth/issues/6782)) ([481e474](https://github.com/dynamic-labs/DynamicAuth/commit/481e4746adf1ebac5584e3c83d1603e5b2e48f8a))
29
+ * remove miss use of hook inside function ([#6795](https://github.com/dynamic-labs/DynamicAuth/issues/6795)) ([35902cf](https://github.com/dynamic-labs/DynamicAuth/commit/35902cfc876e93928cf5baff0313d8b0352c1129))
30
+
2
31
  ## [3.0.0-alpha.56](https://github.com/dynamic-labs/DynamicAuth/compare/v3.0.0-alpha.55...v3.0.0-alpha.56) (2024-09-03)
3
32
 
4
33
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@dynamic-labs/ethereum-aa",
3
- "version": "3.0.0-alpha.56",
3
+ "version": "3.0.0-alpha.58",
4
4
  "repository": {
5
5
  "type": "git",
6
6
  "url": "git+https://github.com/dynamic-labs/dynamic-auth.git",
@@ -26,17 +26,17 @@
26
26
  "./package.json": "./package.json"
27
27
  },
28
28
  "dependencies": {
29
- "@dynamic-labs/sdk-api-core": "0.0.525",
29
+ "@dynamic-labs/sdk-api-core": "0.0.526",
30
30
  "@zerodev/ecdsa-validator": "5.3.1",
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-core": "3.0.0-alpha.56",
35
- "@dynamic-labs/logger": "3.0.0-alpha.56",
36
- "@dynamic-labs/types": "3.0.0-alpha.56",
37
- "@dynamic-labs/utils": "3.0.0-alpha.56",
38
- "@dynamic-labs/wallet-book": "3.0.0-alpha.56",
39
- "@dynamic-labs/wallet-connector-core": "3.0.0-alpha.56"
34
+ "@dynamic-labs/ethereum-core": "3.0.0-alpha.58",
35
+ "@dynamic-labs/logger": "3.0.0-alpha.58",
36
+ "@dynamic-labs/types": "3.0.0-alpha.58",
37
+ "@dynamic-labs/utils": "3.0.0-alpha.58",
38
+ "@dynamic-labs/wallet-book": "3.0.0-alpha.58",
39
+ "@dynamic-labs/wallet-connector-core": "3.0.0-alpha.58"
40
40
  },
41
41
  "peerDependencies": {
42
42
  "viem": "^2.7.6"
@@ -350,6 +350,26 @@ class ZeroDevConnector extends walletConnectorCore.WalletConnectorBase {
350
350
  return ethereumCore.createViemUiTransaction({ from, publicClient, walletClient });
351
351
  });
352
352
  }
353
+ validateActiveWallet(expectedAddress) {
354
+ const _super = Object.create(null, {
355
+ validateActiveWallet: { get: () => super.validateActiveWallet }
356
+ });
357
+ return _tslib.__awaiter(this, void 0, void 0, function* () {
358
+ var _a;
359
+ const eoaConnector = this === null || this === void 0 ? void 0 : this.eoaConnector;
360
+ if (eoaConnector && walletConnectorCore.isTurnkeyWalletConnector(eoaConnector)) {
361
+ const verifiedCredentials = eoaConnector === null || eoaConnector === void 0 ? void 0 : eoaConnector.verifiedCredentials;
362
+ const expectedEoaAddress = (_a = verifiedCredentials === null || verifiedCredentials === void 0 ? void 0 : verifiedCredentials.find((vc) => vc.smartWalletRefAddress === expectedAddress)) === null || _a === void 0 ? void 0 : _a.address;
363
+ if (!expectedEoaAddress) {
364
+ throw new utils.DynamicError('No EOA connector');
365
+ }
366
+ yield (eoaConnector === null || eoaConnector === void 0 ? void 0 : eoaConnector.validateActiveWallet(expectedEoaAddress));
367
+ }
368
+ else {
369
+ yield _super.validateActiveWallet.call(this, expectedAddress);
370
+ }
371
+ });
372
+ }
353
373
  }
354
374
 
355
375
  exports.ZeroDevConnector = ZeroDevConnector;
@@ -3120,5 +3120,6 @@ export declare class ZeroDevConnector extends WalletConnectorBase<typeof Ethereu
3120
3120
  getBalance(address: string): Promise<string | undefined>;
3121
3121
  signMessage(messageToSign: string): Promise<string | undefined>;
3122
3122
  createUiTransaction(from: string): Promise<IUITransaction>;
3123
+ validateActiveWallet(expectedAddress: string): Promise<void>;
3123
3124
  }
3124
3125
  export {};
@@ -6,7 +6,7 @@ import { ENTRYPOINT_ADDRESS_V07, ENTRYPOINT_ADDRESS_V06, walletClientToSmartAcco
6
6
  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
- import { WalletConnectorBase } from '@dynamic-labs/wallet-connector-core';
9
+ import { WalletConnectorBase, isTurnkeyWalletConnector } from '@dynamic-labs/wallet-connector-core';
10
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
12
  import { cachedChainIdKey, fetchChain } from './utils/fetchChain.js';
@@ -346,6 +346,26 @@ class ZeroDevConnector extends WalletConnectorBase {
346
346
  return createViemUiTransaction({ from, publicClient, walletClient });
347
347
  });
348
348
  }
349
+ validateActiveWallet(expectedAddress) {
350
+ const _super = Object.create(null, {
351
+ validateActiveWallet: { get: () => super.validateActiveWallet }
352
+ });
353
+ return __awaiter(this, void 0, void 0, function* () {
354
+ var _a;
355
+ const eoaConnector = this === null || this === void 0 ? void 0 : this.eoaConnector;
356
+ if (eoaConnector && isTurnkeyWalletConnector(eoaConnector)) {
357
+ const verifiedCredentials = eoaConnector === null || eoaConnector === void 0 ? void 0 : eoaConnector.verifiedCredentials;
358
+ const expectedEoaAddress = (_a = verifiedCredentials === null || verifiedCredentials === void 0 ? void 0 : verifiedCredentials.find((vc) => vc.smartWalletRefAddress === expectedAddress)) === null || _a === void 0 ? void 0 : _a.address;
359
+ if (!expectedEoaAddress) {
360
+ throw new DynamicError('No EOA connector');
361
+ }
362
+ yield (eoaConnector === null || eoaConnector === void 0 ? void 0 : eoaConnector.validateActiveWallet(expectedEoaAddress));
363
+ }
364
+ else {
365
+ yield _super.validateActiveWallet.call(this, expectedAddress);
366
+ }
367
+ });
368
+ }
349
369
  }
350
370
 
351
371
  export { ZeroDevConnector };