@dynamic-labs/embedded-wallet-evm 3.0.0-alpha.52 → 3.0.0-alpha.53

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,43 @@
1
1
 
2
+ ## [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)
3
+
4
+
5
+ ### ⚠ BREAKING CHANGES
6
+
7
+ * simplify solana wallet signer types (#6748)
8
+ * deprecate getEoaConnector (#6571)
9
+ * limit methods and props returned by wallet.connector (#6540)
10
+ * move generic solana code to solana-core package (#6701)
11
+ * revamp ether v6 interface (#6548)
12
+ * add ethereum wallet specific methods and intercept to sync when needed (#6662)
13
+ * add solana wallet specific methods and intercept to sync when needed (#6608)
14
+ * don't force primary wallet to be connected (#6128)
15
+
16
+ ### Features
17
+
18
+ * 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))
19
+ * 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))
20
+ * 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))
21
+ * 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))
22
+ * 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))
23
+ * 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))
24
+
25
+
26
+ ### Bug Fixes
27
+
28
+ * 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))
29
+ * cosmos wallet intercepts ([#6720](https://github.com/dynamic-labs/DynamicAuth/issues/6720)) ([cfc9df4](https://github.com/dynamic-labs/DynamicAuth/commit/cfc9df48a8032f7348fec14f77b9e378d2e26a22))
30
+ * 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))
31
+ * 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))
32
+ * wallet.chain references ([525c1ca](https://github.com/dynamic-labs/DynamicAuth/commit/525c1ca9a8fe6402c06eabe6aebc30e310411d9b))
33
+
34
+
35
+ * deprecate getEoaConnector ([#6571](https://github.com/dynamic-labs/DynamicAuth/issues/6571)) ([0226ee5](https://github.com/dynamic-labs/DynamicAuth/commit/0226ee5a13f2418607076ee6f2ec0a579b06dd5d))
36
+ * 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))
37
+ * 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))
38
+ * revamp ether v6 interface ([#6548](https://github.com/dynamic-labs/DynamicAuth/issues/6548)) ([f3b2fb8](https://github.com/dynamic-labs/DynamicAuth/commit/f3b2fb8da7de21f9c58e67fa7f5580166195092a))
39
+ * simplify solana wallet signer types ([#6748](https://github.com/dynamic-labs/DynamicAuth/issues/6748)) ([01d1a42](https://github.com/dynamic-labs/DynamicAuth/commit/01d1a42bc916ab329580b741ba60d706bf6c5491))
40
+
2
41
  ## [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
42
 
4
43
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@dynamic-labs/embedded-wallet-evm",
3
- "version": "3.0.0-alpha.52",
3
+ "version": "3.0.0-alpha.53",
4
4
  "repository": {
5
5
  "type": "git",
6
6
  "url": "git+https://github.com/dynamic-labs/dynamic-auth.git",
@@ -32,13 +32,13 @@
32
32
  "@turnkey/iframe-stamper": "2.0.0",
33
33
  "@turnkey/viem": "0.4.26",
34
34
  "@turnkey/webauthn-stamper": "0.5.0",
35
- "@dynamic-labs/embedded-wallet": "3.0.0-alpha.52",
36
- "@dynamic-labs/ethereum-core": "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",
41
- "@dynamic-labs/webauthn": "3.0.0-alpha.52"
35
+ "@dynamic-labs/embedded-wallet": "3.0.0-alpha.53",
36
+ "@dynamic-labs/ethereum-core": "3.0.0-alpha.53",
37
+ "@dynamic-labs/types": "3.0.0-alpha.53",
38
+ "@dynamic-labs/utils": "3.0.0-alpha.53",
39
+ "@dynamic-labs/wallet-book": "3.0.0-alpha.53",
40
+ "@dynamic-labs/wallet-connector-core": "3.0.0-alpha.53",
41
+ "@dynamic-labs/webauthn": "3.0.0-alpha.53"
42
42
  },
43
43
  "peerDependencies": {
44
44
  "viem": "^2.7.6"
@@ -28,6 +28,7 @@ class TurnkeyEVMWalletConnector extends embeddedWallet.TurnkeyWalletConnectorBas
28
28
  name: 'Turnkey HD',
29
29
  };
30
30
  // Public fields
31
+ this.ChainWallet = ethereumCore.EthereumWallet;
31
32
  this.connectedChain = 'EVM';
32
33
  this.supportedChains = ['ETH', 'EVM'];
33
34
  this.verifiedCredentialChain = 'eip155';
@@ -188,6 +189,7 @@ class TurnkeyEVMWalletConnector extends embeddedWallet.TurnkeyWalletConnectorBas
188
189
  address: this.turnkeyAddress,
189
190
  chain: ethereumCore.getOrMapViemChain(evmNetwork),
190
191
  transport: viem.http(rpcUrl),
192
+ // TODO: remove this. We should not be passing references to wallet connectors
191
193
  walletConnector: this,
192
194
  walletUiUtils: this.walletUiUtils,
193
195
  });
@@ -358,6 +360,7 @@ class TurnkeyEVMWalletConnector extends embeddedWallet.TurnkeyWalletConnectorBas
358
360
  }
359
361
  createUiTransaction(from) {
360
362
  return _tslib.__awaiter(this, void 0, void 0, function* () {
363
+ yield this.validateActiveWallet(from);
361
364
  const walletClient = this.getWalletClient();
362
365
  const publicClient = yield this.getPublicClient();
363
366
  if (!publicClient || !walletClient) {
@@ -2,12 +2,12 @@ import { TurnkeyClient, TurnkeyApiTypes } from '@turnkey/http';
2
2
  import { Account, LocalAccount, PublicClient, Transport, Chain as ViemChain, WalletClient } from 'viem';
3
3
  import { JwtVerifiedCredential } from '@dynamic-labs/sdk-api-core';
4
4
  import { EvmNetwork, GenericNetwork, IUITransaction, WalletUiUtils } from '@dynamic-labs/types';
5
- import { IChainRpcProviders } from '@dynamic-labs/ethereum-core';
5
+ import { IChainRpcProviders, EthereumWallet } from '@dynamic-labs/ethereum-core';
6
6
  import { WalletBookSchema } from '@dynamic-labs/wallet-book';
7
- import type { Chain, ISendBalanceWalletConnector, WalletConnector } from '@dynamic-labs/wallet-connector-core';
7
+ import type { Chain, ISendBalanceWalletConnector, InternalWalletConnector } from '@dynamic-labs/wallet-connector-core';
8
8
  import { TurnkeyWalletConnectorNameAndKey, TurnkeyWalletConnectorBase } from '@dynamic-labs/embedded-wallet';
9
9
  export type TurnkeyEVMConnectorProps = {
10
- walletUiUtils: WalletUiUtils<WalletConnector>;
10
+ walletUiUtils: WalletUiUtils<InternalWalletConnector>;
11
11
  walletBook: WalletBookSchema;
12
12
  evmNetworks: GenericNetwork[];
13
13
  appName?: string;
@@ -21,6 +21,7 @@ export declare class TurnkeyEVMWalletConnector extends TurnkeyWalletConnectorBas
21
21
  };
22
22
  name: string;
23
23
  };
24
+ ChainWallet: typeof EthereumWallet;
24
25
  connectedChain: Chain;
25
26
  supportedChains: Chain[];
26
27
  evmNetworks: EvmNetwork[];
@@ -8,7 +8,7 @@ import { WebauthnStamper } from '@turnkey/webauthn-stamper';
8
8
  import { http, createPublicClient, formatEther } from 'viem';
9
9
  import { toAccount } from 'viem/accounts';
10
10
  import { parseEvmNetworks, getTLD, PlatformService, DynamicError } from '@dynamic-labs/utils';
11
- import { createWalletClientWithUiConfirmation, getOrMapViemChain, createViemUiTransaction } from '@dynamic-labs/ethereum-core';
11
+ import { EthereumWallet, createWalletClientWithUiConfirmation, getOrMapViemChain, createViemUiTransaction } from '@dynamic-labs/ethereum-core';
12
12
  import { getRpcUrlForChain } from '@dynamic-labs/wallet-connector-core';
13
13
  import { TurnkeyWalletConnectorBase, findTurnkeyVerifiedCredential, PasskeyService, TURNKEY_API_BASE_URL, logger, TURNKEY_SDK_SESSION_KEY_RETRYABLE_ERRORS } from '@dynamic-labs/embedded-wallet';
14
14
 
@@ -24,6 +24,7 @@ class TurnkeyEVMWalletConnector extends TurnkeyWalletConnectorBase {
24
24
  name: 'Turnkey HD',
25
25
  };
26
26
  // Public fields
27
+ this.ChainWallet = EthereumWallet;
27
28
  this.connectedChain = 'EVM';
28
29
  this.supportedChains = ['ETH', 'EVM'];
29
30
  this.verifiedCredentialChain = 'eip155';
@@ -184,6 +185,7 @@ class TurnkeyEVMWalletConnector extends TurnkeyWalletConnectorBase {
184
185
  address: this.turnkeyAddress,
185
186
  chain: getOrMapViemChain(evmNetwork),
186
187
  transport: http(rpcUrl),
188
+ // TODO: remove this. We should not be passing references to wallet connectors
187
189
  walletConnector: this,
188
190
  walletUiUtils: this.walletUiUtils,
189
191
  });
@@ -354,6 +356,7 @@ class TurnkeyEVMWalletConnector extends TurnkeyWalletConnectorBase {
354
356
  }
355
357
  createUiTransaction(from) {
356
358
  return __awaiter(this, void 0, void 0, function* () {
359
+ yield this.validateActiveWallet(from);
357
360
  const walletClient = this.getWalletClient();
358
361
  const publicClient = yield this.getPublicClient();
359
362
  if (!publicClient || !walletClient) {