@dynamic-labs/ethereum 3.0.0-alpha.9 → 3.0.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.
Files changed (39) hide show
  1. package/CHANGELOG.md +620 -0
  2. package/package.json +8 -10
  3. package/src/coinbase/coinbase.cjs +4 -5
  4. package/src/coinbase/coinbase.d.ts +2 -2
  5. package/src/coinbase/coinbase.js +2 -3
  6. package/src/coinbase/types.d.ts +1 -1
  7. package/src/ethProviderHelper.cjs +3 -3
  8. package/src/ethProviderHelper.d.ts +2 -1
  9. package/src/ethProviderHelper.js +2 -2
  10. package/src/index.cjs +5 -7
  11. package/src/index.d.ts +2 -3
  12. package/src/index.js +1 -4
  13. package/src/injected/ExodusEvm.d.ts +1 -1
  14. package/src/injected/FallbackEvmConnector.d.ts +1 -1
  15. package/src/injected/InjectedWalletBase.cjs +5 -4
  16. package/src/injected/InjectedWalletBase.d.ts +2 -2
  17. package/src/injected/InjectedWalletBase.js +4 -3
  18. package/src/injected/PhantomEvm.cjs +4 -0
  19. package/src/injected/PhantomEvm.d.ts +2 -1
  20. package/src/injected/PhantomEvm.js +4 -0
  21. package/src/injected/UnknownInjected.d.ts +1 -1
  22. package/src/types.d.ts +1 -0
  23. package/src/walletConnect/walletConnect.cjs +3 -4
  24. package/src/walletConnect/walletConnect.d.ts +1 -1
  25. package/src/walletConnect/walletConnect.js +1 -2
  26. package/src/EthWalletConnector.cjs +0 -240
  27. package/src/EthWalletConnector.d.ts +0 -3086
  28. package/src/EthWalletConnector.js +0 -236
  29. package/src/utils/findEvmNetwork.cjs +0 -21
  30. package/src/utils/findEvmNetwork.d.ts +0 -6
  31. package/src/utils/findEvmNetwork.js +0 -17
  32. package/src/utils/getNameservice.cjs +0 -46
  33. package/src/utils/getNameservice.d.ts +0 -6
  34. package/src/utils/getNameservice.js +0 -42
  35. package/src/utils/index.d.ts +0 -2
  36. package/src/utils/isEthWalletConnector/index.d.ts +0 -1
  37. package/src/utils/isEthWalletConnector/isEthWalletConnector.cjs +0 -8
  38. package/src/utils/isEthWalletConnector/isEthWalletConnector.d.ts +0 -3
  39. package/src/utils/isEthWalletConnector/isEthWalletConnector.js +0 -4
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@dynamic-labs/ethereum",
3
- "version": "3.0.0-alpha.9",
3
+ "version": "3.0.0",
4
4
  "repository": {
5
5
  "type": "git",
6
6
  "url": "git+https://github.com/dynamic-labs/dynamic-auth.git",
@@ -26,18 +26,16 @@
26
26
  "./package.json": "./package.json"
27
27
  },
28
28
  "dependencies": {
29
- "@dynamic-labs/sdk-api-core": "0.0.470",
30
- "@coinbase/wallet-sdk": "4.0.3",
29
+ "@coinbase/wallet-sdk": "4.0.4",
31
30
  "@walletconnect/ethereum-provider": "2.11.2",
32
31
  "eventemitter3": "5.0.1",
33
32
  "buffer": "6.0.3",
34
- "@dynamic-labs/embedded-wallet-evm": "3.0.0-alpha.9",
35
- "@dynamic-labs/rpc-provider-ethereum": "3.0.0-alpha.9",
36
- "@dynamic-labs/types": "3.0.0-alpha.9",
37
- "@dynamic-labs/utils": "3.0.0-alpha.9",
38
- "@dynamic-labs/viem-utils": "3.0.0-alpha.9",
39
- "@dynamic-labs/wallet-book": "3.0.0-alpha.9",
40
- "@dynamic-labs/wallet-connector-core": "3.0.0-alpha.9",
33
+ "@dynamic-labs/embedded-wallet-evm": "3.0.0",
34
+ "@dynamic-labs/ethereum-core": "3.0.0",
35
+ "@dynamic-labs/types": "3.0.0",
36
+ "@dynamic-labs/utils": "3.0.0",
37
+ "@dynamic-labs/wallet-book": "3.0.0",
38
+ "@dynamic-labs/wallet-connector-core": "3.0.0",
41
39
  "stream": "0.0.2"
42
40
  },
43
41
  "peerDependencies": {
@@ -5,12 +5,11 @@ Object.defineProperty(exports, '__esModule', { value: true });
5
5
 
6
6
  var _tslib = require('../../_virtual/_tslib.cjs');
7
7
  var viem = require('viem');
8
- var viemUtils = require('@dynamic-labs/viem-utils');
8
+ var ethereumCore = require('@dynamic-labs/ethereum-core');
9
9
  var walletConnectorCore = require('@dynamic-labs/wallet-connector-core');
10
- var EthWalletConnector = require('../EthWalletConnector.cjs');
11
10
  var helpers = require('./helpers.cjs');
12
11
 
13
- class Coinbase extends EthWalletConnector.EthWalletConnector {
12
+ class Coinbase extends ethereumCore.EthWalletConnector {
14
13
  constructor(_a) {
15
14
  var { appName, appLogoUrl, evmNetworks, coinbaseWalletPreference } = _a, props = _tslib.__rest(_a, ["appName", "appLogoUrl", "evmNetworks", "coinbaseWalletPreference"]);
16
15
  super(Object.assign({ evmNetworks }, props));
@@ -19,7 +18,7 @@ class Coinbase extends EthWalletConnector.EthWalletConnector {
19
18
  this.supportedChains = ['EVM', 'ETH'];
20
19
  this.connectedChain = 'EVM';
21
20
  this.canConnectViaQrCode = false;
22
- this.canConnectViaCustodialService = true;
21
+ this.canConnectViaCustodialService = !this.isInstalledOnBrowser();
23
22
  this.coinbaseProviderOpts = {
24
23
  appLogoUrl: appLogoUrl,
25
24
  appName: appName,
@@ -89,7 +88,7 @@ class Coinbase extends EthWalletConnector.EthWalletConnector {
89
88
  getWalletClient(chainId) {
90
89
  return viem.createWalletClient({
91
90
  account: this.getActiveAccount(),
92
- chain: chainId ? viemUtils.chainsMap[chainId] : undefined,
91
+ chain: chainId ? ethereumCore.chainsMap[chainId] : undefined,
93
92
  transport: viem.custom(this.coinbaseProvider),
94
93
  });
95
94
  }
@@ -1,7 +1,7 @@
1
1
  import { WalletClient, Account, Transport, Chain as ViemChain } from 'viem';
2
2
  import { ProviderInterface } from '@coinbase/wallet-sdk';
3
+ import { EthWalletConnector } from '@dynamic-labs/ethereum-core';
3
4
  import { Chain } from '@dynamic-labs/wallet-connector-core';
4
- import { EthWalletConnector } from '../EthWalletConnector';
5
5
  import { CoinbaseOpts, GetCoinbaseProviderOpts } from './types';
6
6
  export declare class Coinbase extends EthWalletConnector {
7
7
  name: string;
@@ -9,12 +9,12 @@ export declare class Coinbase extends EthWalletConnector {
9
9
  supportedChains: Chain[];
10
10
  connectedChain: Chain;
11
11
  canConnectViaQrCode: boolean;
12
- canConnectViaCustodialService: boolean;
13
12
  coinbaseProviderOpts: GetCoinbaseProviderOpts;
14
13
  constructor({ appName, appLogoUrl, evmNetworks, coinbaseWalletPreference, ...props }: CoinbaseOpts);
15
14
  get coinbaseProvider(): ProviderInterface;
16
15
  getConnectedAccounts(): Promise<string[]>;
17
16
  isInstalledOnBrowser(): boolean;
17
+ canConnectViaCustodialService: boolean;
18
18
  getAddress(): Promise<string | undefined>;
19
19
  signMessage(messageToSign: string): Promise<string | undefined>;
20
20
  setupEventListeners(): void;
@@ -1,9 +1,8 @@
1
1
  'use client'
2
2
  import { __rest, __awaiter } from '../../_virtual/_tslib.js';
3
3
  import { toHex, toBytes, createWalletClient, custom } from 'viem';
4
- import { chainsMap } from '@dynamic-labs/viem-utils';
4
+ import { EthWalletConnector, chainsMap } from '@dynamic-labs/ethereum-core';
5
5
  import { eventListenerHandlers } from '@dynamic-labs/wallet-connector-core';
6
- import { EthWalletConnector } from '../EthWalletConnector.js';
7
6
  import { getCoinbaseProvider } from './helpers.js';
8
7
 
9
8
  class Coinbase extends EthWalletConnector {
@@ -15,7 +14,7 @@ class Coinbase extends EthWalletConnector {
15
14
  this.supportedChains = ['EVM', 'ETH'];
16
15
  this.connectedChain = 'EVM';
17
16
  this.canConnectViaQrCode = false;
18
- this.canConnectViaCustodialService = true;
17
+ this.canConnectViaCustodialService = !this.isInstalledOnBrowser();
19
18
  this.coinbaseProviderOpts = {
20
19
  appLogoUrl: appLogoUrl,
21
20
  appName: appName,
@@ -1,6 +1,6 @@
1
1
  import { type ProviderInterface } from '@coinbase/wallet-sdk';
2
2
  import { type CoinbaseWalletPreference, type GenericNetwork } from '@dynamic-labs/types';
3
- import { type EthWalletConnectorOpts } from '../EthWalletConnector';
3
+ import { type EthWalletConnectorOpts } from '@dynamic-labs/ethereum-core';
4
4
  export type GetCoinbaseProviderOpts = {
5
5
  appLogoUrl?: string;
6
6
  appName?: string;
@@ -7,7 +7,7 @@ var _tslib = require('../_virtual/_tslib.cjs');
7
7
  var viem = require('viem');
8
8
  var walletConnectorCore = require('@dynamic-labs/wallet-connector-core');
9
9
  var utils = require('@dynamic-labs/utils');
10
- var viemUtils = require('@dynamic-labs/viem-utils');
10
+ var ethereumCore = require('@dynamic-labs/ethereum-core');
11
11
 
12
12
  class EthProviderHelper {
13
13
  constructor(wallet, connector) {
@@ -69,7 +69,7 @@ class EthProviderHelper {
69
69
  eip6963ProviderLookup(rdns) {
70
70
  var _a;
71
71
  const { providers } = utils.Eip6963ProviderSingleton.get();
72
- return (_a = providers.find((provider) => provider.info.rdns === rdns)) === null || _a === void 0 ? void 0 : _a.provider;
72
+ return (_a = providers.find((provider) => { var _a; return ((_a = provider === null || provider === void 0 ? void 0 : provider.info) === null || _a === void 0 ? void 0 : _a.rdns) === rdns; })) === null || _a === void 0 ? void 0 : _a.provider;
73
73
  }
74
74
  isInstalledHelper() {
75
75
  return this.findProvider() !== undefined;
@@ -84,7 +84,7 @@ class EthProviderHelper {
84
84
  }
85
85
  return viem.createWalletClient({
86
86
  account: this.connector.getActiveAccount(),
87
- chain: chainId ? viemUtils.chainsMap[chainId] : this.connector.getActiveChain(),
87
+ chain: chainId ? ethereumCore.chainsMap[chainId] : this.connector.getActiveChain(),
88
88
  transport: viem.custom(provider),
89
89
  });
90
90
  }
@@ -1,8 +1,8 @@
1
1
  import { Hex, WalletClient, Account, Transport, Chain as ViemChain } from 'viem';
2
2
  import { ProviderCondition, WalletConnector } from '@dynamic-labs/wallet-connector-core';
3
3
  import { WalletSchema } from '@dynamic-labs/wallet-book';
4
+ import { EthWalletConnector } from '@dynamic-labs/ethereum-core';
4
5
  import { IEthereum, ExtensionLocator } from './types';
5
- import { EthWalletConnector } from '.';
6
6
  export declare class EthProviderHelper {
7
7
  private wallet;
8
8
  private connector;
@@ -21,6 +21,7 @@ export declare class EthProviderHelper {
21
21
  walletStandard?: {
22
22
  features: string[];
23
23
  name: string;
24
+ providerId?: string | undefined;
24
25
  } | undefined;
25
26
  walletStandardLocators?: {
26
27
  name: string;
@@ -3,7 +3,7 @@ import { __awaiter } from '../_virtual/_tslib.js';
3
3
  import { createWalletClient, custom, getAddress } from 'viem';
4
4
  import { ProviderLookup, eventListenerHandlers, logger } from '@dynamic-labs/wallet-connector-core';
5
5
  import { getProvidersFromWindow, Eip6963ProviderSingleton } from '@dynamic-labs/utils';
6
- import { chainsMap } from '@dynamic-labs/viem-utils';
6
+ import { chainsMap } from '@dynamic-labs/ethereum-core';
7
7
 
8
8
  class EthProviderHelper {
9
9
  constructor(wallet, connector) {
@@ -65,7 +65,7 @@ class EthProviderHelper {
65
65
  eip6963ProviderLookup(rdns) {
66
66
  var _a;
67
67
  const { providers } = Eip6963ProviderSingleton.get();
68
- return (_a = providers.find((provider) => provider.info.rdns === rdns)) === null || _a === void 0 ? void 0 : _a.provider;
68
+ return (_a = providers.find((provider) => { var _a; return ((_a = provider === null || provider === void 0 ? void 0 : provider.info) === null || _a === void 0 ? void 0 : _a.rdns) === rdns; })) === null || _a === void 0 ? void 0 : _a.provider;
69
69
  }
70
70
  isInstalledHelper() {
71
71
  return this.findProvider() !== undefined;
package/src/index.cjs CHANGED
@@ -13,12 +13,9 @@ var fetchInjectedWalletConnectors = require('./injected/fetchInjectedWalletConne
13
13
  require('./walletConnect/walletConnect.cjs');
14
14
  var fetchWalletConnectWallets = require('./walletConnect/fetchWalletConnectWallets.cjs');
15
15
  var coinbase = require('./coinbase/coinbase.cjs');
16
- require('@dynamic-labs/rpc-provider-ethereum');
17
- var EthWalletConnector = require('./EthWalletConnector.cjs');
16
+ var ethereumCore = require('@dynamic-labs/ethereum-core');
18
17
  var ethProviderHelper = require('./ethProviderHelper.cjs');
19
18
  var constants = require('./constants.cjs');
20
- var isEthWalletConnector = require('./utils/isEthWalletConnector/isEthWalletConnector.cjs');
21
- var getNameservice = require('./utils/getNameservice.cjs');
22
19
 
23
20
  const EthereumWalletConnectors = (props) => [
24
21
  ...fetchInjectedWalletConnectors.injectedWalletOverrides,
@@ -37,9 +34,10 @@ exports.UnknownInjected = UnknownInjected.UnknownInjected;
37
34
  exports.FallbackEvmConnector = FallbackEvmConnector.FallbackEvmConnector;
38
35
  exports.fetchInjectedWalletConnector = fetchInjectedWalletConnectors.fetchInjectedWalletConnector;
39
36
  exports.injectedWalletOverrides = fetchInjectedWalletConnectors.injectedWalletOverrides;
40
- exports.EthWalletConnector = EthWalletConnector.EthWalletConnector;
37
+ Object.defineProperty(exports, 'isEthereumWallet', {
38
+ enumerable: true,
39
+ get: function () { return ethereumCore.isEthereumWallet; }
40
+ });
41
41
  exports.EthProviderHelper = ethProviderHelper.EthProviderHelper;
42
42
  exports.INFURA_ID = constants.INFURA_ID;
43
- exports.isEthWalletConnector = isEthWalletConnector.isEthWalletConnector;
44
- exports.getNameservice = getNameservice.getNameservice;
45
43
  exports.EthereumWalletConnectors = EthereumWalletConnectors;
package/src/index.d.ts CHANGED
@@ -1,10 +1,9 @@
1
1
  import './polyfills';
2
2
  import { WalletConnectorConstructor } from '@dynamic-labs/wallet-connector-core';
3
- import '@dynamic-labs/rpc-provider-ethereum';
3
+ import '@dynamic-labs/ethereum-core';
4
4
  export * from './injected';
5
- export * from './EthWalletConnector';
6
5
  export * from './ethProviderHelper';
7
6
  export * from './constants';
8
7
  export * from './types';
9
- export * from './utils';
10
8
  export declare const EthereumWalletConnectors: (props: any) => WalletConnectorConstructor[];
9
+ export { isEthereumWallet } from '@dynamic-labs/ethereum-core';
package/src/index.js CHANGED
@@ -12,12 +12,9 @@ export { fetchInjectedWalletConnector, injectedWalletOverrides } from './injecte
12
12
  import './walletConnect/walletConnect.js';
13
13
  import { fetchWalletConnectWallets, getWalletConnectConnector } from './walletConnect/fetchWalletConnectWallets.js';
14
14
  import { Coinbase } from './coinbase/coinbase.js';
15
- import '@dynamic-labs/rpc-provider-ethereum';
16
- export { EthWalletConnector } from './EthWalletConnector.js';
15
+ export { isEthereumWallet } from '@dynamic-labs/ethereum-core';
17
16
  export { EthProviderHelper } from './ethProviderHelper.js';
18
17
  export { INFURA_ID } from './constants.js';
19
- export { isEthWalletConnector } from './utils/isEthWalletConnector/isEthWalletConnector.js';
20
- export { getNameservice } from './utils/getNameservice.js';
21
18
 
22
19
  const EthereumWalletConnectors = (props) => [
23
20
  ...injectedWalletOverrides,
@@ -1,4 +1,4 @@
1
- import { EthWalletConnectorOpts } from '..';
1
+ import { EthWalletConnectorOpts } from '@dynamic-labs/ethereum-core';
2
2
  import InjectedWalletBase from './InjectedWalletBase';
3
3
  export declare class ExodusEvm extends InjectedWalletBase {
4
4
  name: string;
@@ -1,4 +1,4 @@
1
- import { EthWalletConnectorOpts } from '..';
1
+ import { EthWalletConnectorOpts } from '@dynamic-labs/ethereum-core';
2
2
  import InjectedWalletBase from './InjectedWalletBase';
3
3
  export declare class FallbackEvmConnector extends InjectedWalletBase {
4
4
  name: string;
@@ -4,11 +4,11 @@
4
4
  var _tslib = require('../../_virtual/_tslib.cjs');
5
5
  var walletBook = require('@dynamic-labs/wallet-book');
6
6
  var utils = require('@dynamic-labs/utils');
7
+ var ethereumCore = require('@dynamic-labs/ethereum-core');
7
8
  var ethProviderHelper = require('../ethProviderHelper.cjs');
8
- var EthWalletConnector = require('../EthWalletConnector.cjs');
9
9
  var walletConnect = require('../walletConnect/walletConnect.cjs');
10
10
 
11
- class InjectedWalletBase extends EthWalletConnector.EthWalletConnector {
11
+ class InjectedWalletBase extends ethereumCore.EthWalletConnector {
12
12
  constructor() {
13
13
  super(...arguments);
14
14
  this.supportedChains = ['ETH', 'EVM'];
@@ -39,7 +39,7 @@ class InjectedWalletBase extends EthWalletConnector.EthWalletConnector {
39
39
  // when the user is in a webview, customers should set the deepLinkPreference prop to universal,
40
40
  // in which case this condition will be false, and the SDK will use WalletConnect (if available)
41
41
  if (((_b = (_a = this.wallet) === null || _a === void 0 ? void 0 : _a.mobile) === null || _b === void 0 ? void 0 : _b.inAppBrowser) &&
42
- this.constructorProps.deepLinkPreference !== 'universal' &&
42
+ this.mobileExperience === 'in-app-browser' &&
43
43
  utils.isMobile()) {
44
44
  return this;
45
45
  }
@@ -86,8 +86,9 @@ class InjectedWalletBase extends EthWalletConnector.EthWalletConnector {
86
86
  return (_a = this.getEthProviderHelper()) === null || _a === void 0 ? void 0 : _a.signMessage(messageToSign);
87
87
  });
88
88
  }
89
- proveOwnership(messageToSign) {
89
+ proveOwnership(address, messageToSign) {
90
90
  return _tslib.__awaiter(this, void 0, void 0, function* () {
91
+ yield this.validateActiveWallet(address);
91
92
  return this.signMessage(messageToSign);
92
93
  });
93
94
  }
@@ -2,8 +2,8 @@ import { WalletClient, Transport, Account, Chain as ViemChain } from 'viem';
2
2
  import { Chain } from '@dynamic-labs/wallet-connector-core';
3
3
  import { EvmNetwork } from '@dynamic-labs/types';
4
4
  import { WalletSchema } from '@dynamic-labs/wallet-book';
5
+ import { EthWalletConnector } from '@dynamic-labs/ethereum-core';
5
6
  import { EthProviderHelper } from '../ethProviderHelper';
6
- import { EthWalletConnector } from '../EthWalletConnector';
7
7
  declare abstract class InjectedWalletBase extends EthWalletConnector {
8
8
  supportedChains: Chain[];
9
9
  connectedChain: Chain;
@@ -19,7 +19,7 @@ declare abstract class InjectedWalletBase extends EthWalletConnector {
19
19
  getAddress(): Promise<string | undefined>;
20
20
  connect(): Promise<void>;
21
21
  signMessage(messageToSign: string): Promise<string | undefined>;
22
- proveOwnership(messageToSign: string): Promise<string | undefined>;
22
+ proveOwnership(address: string, messageToSign: string): Promise<string | undefined>;
23
23
  endSession(): Promise<void>;
24
24
  providerSwitchNetwork({ network, provider, }: {
25
25
  network: EvmNetwork;
@@ -2,8 +2,8 @@
2
2
  import { __awaiter } from '../../_virtual/_tslib.js';
3
3
  import { findWalletBookWallet } from '@dynamic-labs/wallet-book';
4
4
  import { isMobile } from '@dynamic-labs/utils';
5
+ import { EthWalletConnector } from '@dynamic-labs/ethereum-core';
5
6
  import { EthProviderHelper } from '../ethProviderHelper.js';
6
- import { EthWalletConnector } from '../EthWalletConnector.js';
7
7
  import { WalletConnect } from '../walletConnect/walletConnect.js';
8
8
 
9
9
  class InjectedWalletBase extends EthWalletConnector {
@@ -37,7 +37,7 @@ class InjectedWalletBase extends EthWalletConnector {
37
37
  // when the user is in a webview, customers should set the deepLinkPreference prop to universal,
38
38
  // in which case this condition will be false, and the SDK will use WalletConnect (if available)
39
39
  if (((_b = (_a = this.wallet) === null || _a === void 0 ? void 0 : _a.mobile) === null || _b === void 0 ? void 0 : _b.inAppBrowser) &&
40
- this.constructorProps.deepLinkPreference !== 'universal' &&
40
+ this.mobileExperience === 'in-app-browser' &&
41
41
  isMobile()) {
42
42
  return this;
43
43
  }
@@ -84,8 +84,9 @@ class InjectedWalletBase extends EthWalletConnector {
84
84
  return (_a = this.getEthProviderHelper()) === null || _a === void 0 ? void 0 : _a.signMessage(messageToSign);
85
85
  });
86
86
  }
87
- proveOwnership(messageToSign) {
87
+ proveOwnership(address, messageToSign) {
88
88
  return __awaiter(this, void 0, void 0, function* () {
89
+ yield this.validateActiveWallet(address);
89
90
  return this.signMessage(messageToSign);
90
91
  });
91
92
  }
@@ -32,6 +32,10 @@ class PhantomEvm extends InjectedWalletBase {
32
32
  return undefined;
33
33
  });
34
34
  }
35
+ canGetChainAddress() {
36
+ var _a, _b;
37
+ return Boolean((_b = (_a = this.getEthProviderHelper()) === null || _a === void 0 ? void 0 : _a.findProvider()) === null || _b === void 0 ? void 0 : _b.selectedAddress);
38
+ }
35
39
  }
36
40
 
37
41
  exports.PhantomEvm = PhantomEvm;
@@ -1,8 +1,9 @@
1
- import { EthWalletConnectorOpts } from '..';
1
+ import { EthWalletConnectorOpts } from '@dynamic-labs/ethereum-core';
2
2
  import InjectedWalletBase from './InjectedWalletBase';
3
3
  export declare class PhantomEvm extends InjectedWalletBase {
4
4
  name: string;
5
5
  overrideKey: string;
6
6
  constructor(props: EthWalletConnectorOpts);
7
7
  getAddress(): Promise<string | undefined>;
8
+ canGetChainAddress(): boolean;
8
9
  }
@@ -28,6 +28,10 @@ class PhantomEvm extends InjectedWalletBase {
28
28
  return undefined;
29
29
  });
30
30
  }
31
+ canGetChainAddress() {
32
+ var _a, _b;
33
+ return Boolean((_b = (_a = this.getEthProviderHelper()) === null || _a === void 0 ? void 0 : _a.findProvider()) === null || _b === void 0 ? void 0 : _b.selectedAddress);
34
+ }
31
35
  }
32
36
 
33
37
  export { PhantomEvm };
@@ -1,4 +1,4 @@
1
- import { EthWalletConnectorOpts } from '..';
1
+ import { EthWalletConnectorOpts } from '@dynamic-labs/ethereum-core';
2
2
  import InjectedWalletBase from './InjectedWalletBase';
3
3
  export declare class UnknownInjected extends InjectedWalletBase {
4
4
  name: string;
package/src/types.d.ts CHANGED
@@ -23,6 +23,7 @@ export type IEthereum = {
23
23
  request: <T extends string>(params: {
24
24
  method: T;
25
25
  } | object) => Promise<T extends 'eth_requestAccounts' ? [string] : object>;
26
+ selectedAddress: string | null;
26
27
  } & EventEmitter;
27
28
  export type ExtensionLocator = 'isDawn' | 'isBraveWallet' | 'isCoinbaseWallet' | 'isFrame' | 'isGamestop' | 'isMetaMask' | 'isExodus' | 'isOpera' | 'isBlocto' | 'isTrustWallet' | 'isZerion' | 'isPhantom' | 'isSuperb' | 'isRabby' | 'isOkxWallet';
28
29
  export type EthProviderCondition = ProviderCondition<ExtensionLocator>;
@@ -10,8 +10,7 @@ var viem = require('viem');
10
10
  var walletConnectorCore = require('@dynamic-labs/wallet-connector-core');
11
11
  var walletBook = require('@dynamic-labs/wallet-book');
12
12
  var utils = require('@dynamic-labs/utils');
13
- var viemUtils = require('@dynamic-labs/viem-utils');
14
- var EthWalletConnector = require('../EthWalletConnector.cjs');
13
+ var ethereumCore = require('@dynamic-labs/ethereum-core');
15
14
  var parseIntSafe = require('../utils/parseIntSafe.cjs');
16
15
 
17
16
  function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'default' in e ? e : { 'default': e }; }
@@ -24,7 +23,7 @@ const sessionTopicKey = (walletName) => `dynamic-wc2-session-topic-${walletName}
24
23
  const swicthedNetworkKey = (walletName) => `dynamic-wc2-switched-network-${walletName}`;
25
24
  const currentChainKey = (walletName) => `dynamic-wc2-current-chain-${walletName}`;
26
25
  const ee = new EventEmitter__default["default"]();
27
- class WalletConnect extends EthWalletConnector.EthWalletConnector {
26
+ class WalletConnect extends ethereumCore.EthWalletConnector {
28
27
  constructor(opts) {
29
28
  var _a;
30
29
  super(opts);
@@ -246,7 +245,7 @@ class WalletConnect extends EthWalletConnector.EthWalletConnector {
246
245
  }
247
246
  return viem.createWalletClient({
248
247
  account: this.getActiveAccount(),
249
- chain: viemUtils.chainsMap[chainId !== null && chainId !== void 0 ? chainId : String(this.currentChainId)],
248
+ chain: ethereumCore.chainsMap[chainId !== null && chainId !== void 0 ? chainId : String(this.currentChainId)],
250
249
  transport: viem.custom(WalletConnect.provider),
251
250
  });
252
251
  }
@@ -2,7 +2,7 @@ import type { SessionTypes } from '@walletconnect/types';
2
2
  import { WalletClient, Account, Transport, Chain as ViemChain } from 'viem';
3
3
  import { Chain, GetAddressOpts, DeepLinkVariant, IWalletConnectConnector } from '@dynamic-labs/wallet-connector-core';
4
4
  import { EvmNetwork } from '@dynamic-labs/types';
5
- import { EthWalletConnector, EthWalletConnectorOpts } from '../EthWalletConnector';
5
+ import { EthWalletConnector, EthWalletConnectorOpts } from '@dynamic-labs/ethereum-core';
6
6
  export type WalletConnectOpts = EthWalletConnectorOpts & {
7
7
  projectId?: string;
8
8
  walletName: string;
@@ -6,8 +6,7 @@ import { createWalletClient, custom } from 'viem';
6
6
  import { logger, performPlatformSpecificConnectionMethod, getDeepLink } from '@dynamic-labs/wallet-connector-core';
7
7
  import { getWalletBookWallet } from '@dynamic-labs/wallet-book';
8
8
  import { DynamicError, sleep, isMobile } from '@dynamic-labs/utils';
9
- import { chainsMap } from '@dynamic-labs/viem-utils';
10
- import { EthWalletConnector } from '../EthWalletConnector.js';
9
+ import { EthWalletConnector, chainsMap } from '@dynamic-labs/ethereum-core';
11
10
  import { parseIntSafe } from '../utils/parseIntSafe.js';
12
11
 
13
12
  const activeAccountKey = (walletName) => `dynamic-wc2-active-account-${walletName}`;