@dynamic-labs/ethereum 1.1.0-alpha.0 → 1.1.0-alpha.10

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 (71) hide show
  1. package/CHANGELOG.md +106 -0
  2. package/package.json +9 -9
  3. package/src/EthWalletConnector.cjs +7 -0
  4. package/src/EthWalletConnector.js +7 -0
  5. package/src/coinbase/client/client.cjs +2 -8
  6. package/src/coinbase/client/client.js +2 -8
  7. package/src/coinbase/coinbase.cjs +27 -8
  8. package/src/coinbase/coinbase.d.ts +2 -0
  9. package/src/coinbase/coinbase.js +27 -8
  10. package/src/ethProviderHelper.cjs +1 -4
  11. package/src/ethProviderHelper.d.ts +4 -0
  12. package/src/ethProviderHelper.js +1 -4
  13. package/src/index.cjs +4 -26
  14. package/src/index.d.ts +0 -1
  15. package/src/index.js +4 -16
  16. package/src/injected/ExodusEvm.cjs +7 -4
  17. package/src/injected/ExodusEvm.d.ts +4 -2
  18. package/src/injected/ExodusEvm.js +7 -4
  19. package/src/injected/PhantomEvm.cjs +10 -13
  20. package/src/injected/PhantomEvm.d.ts +4 -2
  21. package/src/injected/PhantomEvm.js +11 -14
  22. package/src/injected/fetchInjectedWalletConnectors.cjs +13 -2
  23. package/src/injected/fetchInjectedWalletConnectors.d.ts +1 -0
  24. package/src/injected/fetchInjectedWalletConnectors.js +13 -3
  25. package/src/injected/index.d.ts +1 -11
  26. package/src/walletConnect/client/client.cjs +2 -2
  27. package/src/walletConnect/client/client.d.ts +1 -1
  28. package/src/walletConnect/client/client.js +2 -2
  29. package/src/walletConnect/walletConnect.cjs +1 -1
  30. package/src/walletConnect/walletConnect.js +2 -2
  31. package/src/injected/BloctoInjected.cjs +0 -14
  32. package/src/injected/BloctoInjected.d.ts +0 -4
  33. package/src/injected/BloctoInjected.js +0 -10
  34. package/src/injected/BraveEvm.cjs +0 -14
  35. package/src/injected/BraveEvm.d.ts +0 -4
  36. package/src/injected/BraveEvm.js +0 -10
  37. package/src/injected/Dawn.cjs +0 -14
  38. package/src/injected/Dawn.d.ts +0 -4
  39. package/src/injected/Dawn.js +0 -10
  40. package/src/injected/Frame.cjs +0 -14
  41. package/src/injected/Frame.d.ts +0 -4
  42. package/src/injected/Frame.js +0 -10
  43. package/src/injected/GameStop.cjs +0 -14
  44. package/src/injected/GameStop.d.ts +0 -4
  45. package/src/injected/GameStop.js +0 -10
  46. package/src/injected/LegacyInjectedWalletBase.cjs +0 -83
  47. package/src/injected/LegacyInjectedWalletBase.d.ts +0 -24
  48. package/src/injected/LegacyInjectedWalletBase.js +0 -81
  49. package/src/injected/Opera.cjs +0 -14
  50. package/src/injected/Opera.d.ts +0 -4
  51. package/src/injected/Opera.js +0 -10
  52. package/src/injected/Rabby.cjs +0 -15
  53. package/src/injected/Rabby.d.ts +0 -5
  54. package/src/injected/Rabby.js +0 -11
  55. package/src/injected/Superb.cjs +0 -14
  56. package/src/injected/Superb.d.ts +0 -4
  57. package/src/injected/Superb.js +0 -10
  58. package/src/injected/Trust.cjs +0 -15
  59. package/src/injected/Trust.d.ts +0 -5
  60. package/src/injected/Trust.js +0 -11
  61. package/src/injected/Zerion.cjs +0 -15
  62. package/src/injected/Zerion.d.ts +0 -5
  63. package/src/injected/Zerion.js +0 -11
  64. package/src/injected/legacyInjectedWallets.cjs +0 -48
  65. package/src/injected/legacyInjectedWallets.d.ts +0 -3
  66. package/src/injected/legacyInjectedWallets.js +0 -43
  67. package/src/legacyEthProviderHelper.cjs +0 -187
  68. package/src/legacyEthProviderHelper.d.ts +0 -34
  69. package/src/legacyEthProviderHelper.js +0 -183
  70. package/src/utils/isUnsupportedProviderError/isUnsupportedProviderError.cjs +0 -13
  71. package/src/utils/isUnsupportedProviderError/isUnsupportedProviderError.js +0 -9
package/CHANGELOG.md CHANGED
@@ -1,4 +1,110 @@
1
1
 
2
+ ## [1.1.0-alpha.10](https://github.com/dynamic-labs/DynamicAuth/compare/v1.1.0-alpha.9...v1.1.0-alpha.10) (2024-01-06)
3
+
4
+
5
+ ### Bug Fixes
6
+
7
+ * pass flow network to magic client ([#4322](https://github.com/dynamic-labs/DynamicAuth/issues/4322)) ([f3adccf](https://github.com/dynamic-labs/DynamicAuth/commit/f3adccf9f8d835f6b04e4767acd0fbd2ac238379))
8
+ * prevent error message when mobile wallet app is open ([#4301](https://github.com/dynamic-labs/DynamicAuth/issues/4301)) ([2a66dcf](https://github.com/dynamic-labs/DynamicAuth/commit/2a66dcfaf8100b3d910c559d35d8b731b1cb380e))
9
+ * turnkeyWalletConnector is not an email otp connector and uses dynamic otp ([#4313](https://github.com/dynamic-labs/DynamicAuth/issues/4313)) ([e4ea56f](https://github.com/dynamic-labs/DynamicAuth/commit/e4ea56f40fdf97b3f5440b016ebd95501089cebe))
10
+
11
+ ## [1.1.0-alpha.9](https://github.com/dynamic-labs/DynamicAuth/compare/v1.1.0-alpha.8...v1.1.0-alpha.9) (2024-01-04)
12
+
13
+
14
+ ### Features
15
+
16
+ * add solana magic support ([#4258](https://github.com/dynamic-labs/DynamicAuth/issues/4258)) ([da726aa](https://github.com/dynamic-labs/DynamicAuth/commit/da726aa78466c52ee3e1f18952e4351cde754cbc))
17
+
18
+
19
+ ### Bug Fixes
20
+
21
+ * edge case with unlinking wallet ([#4285](https://github.com/dynamic-labs/DynamicAuth/issues/4285)) ([1057fe4](https://github.com/dynamic-labs/DynamicAuth/commit/1057fe47599381f5d9dc39ce4cbeca2041c70319))
22
+ * remove normalizeWalletName from DynamicAuth ([5592817](https://github.com/dynamic-labs/DynamicAuth/commit/5592817b62e345319e04cca9a98276ffad87cfc2))
23
+ * **useFetchBalance:** ensure the latest wallet balance is fetched ([#4288](https://github.com/dynamic-labs/DynamicAuth/issues/4288)) ([25dd035](https://github.com/dynamic-labs/DynamicAuth/commit/25dd035cf8893b7cd28f550026134ba0eecda142))
24
+
25
+ ## [1.1.0-alpha.8](https://github.com/dynamic-labs/DynamicAuth/compare/v1.1.0-alpha.7...v1.1.0-alpha.8) (2024-01-03)
26
+
27
+
28
+ ### Features
29
+
30
+ * add new sdk view section for text ([#4280](https://github.com/dynamic-labs/DynamicAuth/issues/4280)) ([457ae38](https://github.com/dynamic-labs/DynamicAuth/commit/457ae38cd2be8dae078f40b54ffc4704299d4ed9))
31
+ * add new setShowLinkNewWalletModal method ([f46447a](https://github.com/dynamic-labs/DynamicAuth/commit/f46447ab606f4fdbf55e5fef21dd98f8f2650e90))
32
+ * add pk export for hd wallets ([#4266](https://github.com/dynamic-labs/DynamicAuth/issues/4266)) ([44aac69](https://github.com/dynamic-labs/DynamicAuth/commit/44aac69580ed44e66eab971f87cb6061a3fadc90))
33
+ * add starknet support for sopelia ([#4248](https://github.com/dynamic-labs/DynamicAuth/issues/4248)) ([f9a0980](https://github.com/dynamic-labs/DynamicAuth/commit/f9a0980c3cd2d6d95c5dd17b179fbd0931f08b1a))
34
+ * enable hardware wallet for solana wallets ([#4275](https://github.com/dynamic-labs/DynamicAuth/issues/4275)) ([704b380](https://github.com/dynamic-labs/DynamicAuth/commit/704b380186618a5a5793e88f36ccbe84b59a2e4a))
35
+
36
+
37
+ ### Bug Fixes
38
+
39
+ * phantom solana not connecting on mobile ([#4284](https://github.com/dynamic-labs/DynamicAuth/issues/4284)) ([6ad75f1](https://github.com/dynamic-labs/DynamicAuth/commit/6ad75f152896459f5cf658227f998c246b6a572b))
40
+ * use bitcoin payment address for onramp ([#4273](https://github.com/dynamic-labs/DynamicAuth/issues/4273)) ([a2f54e8](https://github.com/dynamic-labs/DynamicAuth/commit/a2f54e812a11a91ee488eca64f14b5eeea1a8874))
41
+
42
+ ## [1.1.0-alpha.7](https://github.com/dynamic-labs/DynamicAuth/compare/v1.1.0-alpha.6...v1.1.0-alpha.7) (2023-12-28)
43
+
44
+
45
+ ### Features
46
+
47
+ * better coinbase deeplinking ux ([#4164](https://github.com/dynamic-labs/DynamicAuth/issues/4164)) ([5252608](https://github.com/dynamic-labs/DynamicAuth/commit/525260851900a33a52f129def338963400344205))
48
+
49
+
50
+ ### Bug Fixes
51
+
52
+ * don't prompt for connect when selecting bitcoin wallet if already connected ([#4265](https://github.com/dynamic-labs/DynamicAuth/issues/4265)) ([adef402](https://github.com/dynamic-labs/DynamicAuth/commit/adef402ef94270a17fab896a8585a7f2eacd3681))
53
+
54
+ ## [1.1.0-alpha.6](https://github.com/dynamic-labs/DynamicAuth/compare/v1.1.0-alpha.5...v1.1.0-alpha.6) (2023-12-27)
55
+
56
+
57
+ ### Features
58
+
59
+ * add multi-wallet-prompts-widget ([#4166](https://github.com/dynamic-labs/DynamicAuth/issues/4166)) ([151e3d2](https://github.com/dynamic-labs/DynamicAuth/commit/151e3d2e7bebbf18448e4af8eecbf660f713cd3d))
60
+
61
+
62
+ ### Bug Fixes
63
+
64
+ * coinbase solana signMessage ([#4254](https://github.com/dynamic-labs/DynamicAuth/issues/4254)) ([f0300a9](https://github.com/dynamic-labs/DynamicAuth/commit/f0300a93ed6c9ba9dfab613820d8cedbe72abb87))
65
+ * make useConnectWithEmailOtp work cross views ([#4252](https://github.com/dynamic-labs/DynamicAuth/issues/4252)) ([a097119](https://github.com/dynamic-labs/DynamicAuth/commit/a097119556c38a22f338a783f79d512b99203cf5))
66
+
67
+ ## [1.1.0-alpha.5](https://github.com/dynamic-labs/DynamicAuth/compare/v1.1.0-alpha.4...v1.1.0-alpha.5) (2023-12-21)
68
+
69
+
70
+ ### Features
71
+
72
+ * add support for xverse wallet ([#4245](https://github.com/dynamic-labs/DynamicAuth/issues/4245)) ([7b68546](https://github.com/dynamic-labs/DynamicAuth/commit/7b6854684412007bcb33896555900936395176df))
73
+ * **gvty-526:** add embedded reveal ([#4233](https://github.com/dynamic-labs/DynamicAuth/issues/4233)) ([c2d0f90](https://github.com/dynamic-labs/DynamicAuth/commit/c2d0f903f4a4646f86c71834540fd49d51a4a7ae))
74
+
75
+ ## [1.1.0-alpha.4](https://github.com/dynamic-labs/DynamicAuth/compare/v1.1.0-alpha.3...v1.1.0-alpha.4) (2023-12-21)
76
+
77
+
78
+ ### Features
79
+
80
+ * add bitcoin integration ([#4216](https://github.com/dynamic-labs/DynamicAuth/issues/4216)) ([9584f1c](https://github.com/dynamic-labs/DynamicAuth/commit/9584f1cc3133835049ad1c53da980192263b8f21))
81
+ * add default footer to wallet list when tos and pp not enabled ([#4224](https://github.com/dynamic-labs/DynamicAuth/issues/4224)) ([0ad81c4](https://github.com/dynamic-labs/DynamicAuth/commit/0ad81c409bcb4aafb0dc565685525d620a95efce))
82
+ * adds useConnectWithEmailOtp ([#4234](https://github.com/dynamic-labs/DynamicAuth/issues/4234)) ([4a4e50a](https://github.com/dynamic-labs/DynamicAuth/commit/4a4e50ac8651c2a249d5125ae6bcf49aaf49be8c))
83
+
84
+ ## [1.1.0-alpha.3](https://github.com/dynamic-labs/DynamicAuth/compare/v1.1.0-alpha.2...v1.1.0-alpha.3) (2023-12-19)
85
+
86
+
87
+ ### Features
88
+
89
+ * add Flow support in magic wallet connector ([#4158](https://github.com/dynamic-labs/DynamicAuth/issues/4158)) ([fbbaea7](https://github.com/dynamic-labs/DynamicAuth/commit/fbbaea76b36ceb693f6bd4f2404dfa1204e61492))
90
+ * add showDynamicUserProfile to DynamicContext ([#4214](https://github.com/dynamic-labs/DynamicAuth/issues/4214)) ([2aeb8e3](https://github.com/dynamic-labs/DynamicAuth/commit/2aeb8e3c45a3d9f87bd9196ea9b46927e02eb633))
91
+
92
+
93
+ ### Bug Fixes
94
+
95
+ * add shortname to braveevm to allow for lookups by name as well as key ([#4213](https://github.com/dynamic-labs/DynamicAuth/issues/4213)) ([969b089](https://github.com/dynamic-labs/DynamicAuth/commit/969b089be516fb57fcdc941f908c078998eb4ec0))
96
+ * solflare connect ([#4215](https://github.com/dynamic-labs/DynamicAuth/issues/4215)) ([9a4164e](https://github.com/dynamic-labs/DynamicAuth/commit/9a4164e53198f33ef7201cd4e1eff745a09e9701))
97
+ * wagmi attempt to connect to primary wallet first ([#4206](https://github.com/dynamic-labs/DynamicAuth/issues/4206)) ([9e5fc8e](https://github.com/dynamic-labs/DynamicAuth/commit/9e5fc8ef026628935ac32d3bb0c22bda35057e5d))
98
+
99
+ ## [1.1.0-alpha.2](https://github.com/dynamic-labs/DynamicAuth/compare/v1.1.0-alpha.1...v1.1.0-alpha.2) (2023-12-18)
100
+
101
+
102
+ ### Bug Fixes
103
+
104
+ * increase timeout when fetching wallet network ([#4197](https://github.com/dynamic-labs/DynamicAuth/issues/4197)) ([bd43d45](https://github.com/dynamic-labs/DynamicAuth/commit/bd43d452dccf36f68bd012e5737480599b93c3b5))
105
+
106
+ ## [1.1.0-alpha.1](https://github.com/dynamic-labs/DynamicAuth/compare/v1.1.0-alpha.0...v1.1.0-alpha.1) (2023-12-15)
107
+
2
108
  ## [1.1.0-alpha.0](https://github.com/dynamic-labs/DynamicAuth/compare/v1.0.0-alpha.14...v1.1.0-alpha.0) (2023-12-12)
3
109
 
4
110
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@dynamic-labs/ethereum",
3
- "version": "1.1.0-alpha.0",
3
+ "version": "1.1.0-alpha.10",
4
4
  "repository": {
5
5
  "type": "git",
6
6
  "url": "https://github.com/dynamic-labs/DynamicAuth.git",
@@ -26,21 +26,21 @@
26
26
  "./package.json": "./package.json"
27
27
  },
28
28
  "dependencies": {
29
- "@coinbase/wallet-sdk": "3.7.2",
29
+ "@coinbase/wallet-sdk": "3.9.1",
30
30
  "@walletconnect/client": "1.8.0",
31
31
  "@walletconnect/ethereum-provider": "1.8.0",
32
32
  "@walletconnect/universal-provider": "2.10.6",
33
33
  "eventemitter3": "5.0.1",
34
34
  "buffer": "6.0.3",
35
- "@dynamic-labs/rpc-providers": "1.1.0-alpha.0",
36
- "@dynamic-labs/turnkey": "1.1.0-alpha.0",
37
- "@dynamic-labs/types": "1.1.0-alpha.0",
38
- "@dynamic-labs/utils": "1.1.0-alpha.0",
39
- "@dynamic-labs/wallet-book": "1.1.0-alpha.0",
40
- "@dynamic-labs/wallet-connector-core": "1.1.0-alpha.0",
35
+ "@dynamic-labs/rpc-providers": "1.1.0-alpha.10",
36
+ "@dynamic-labs/turnkey": "1.1.0-alpha.10",
37
+ "@dynamic-labs/types": "1.1.0-alpha.10",
38
+ "@dynamic-labs/utils": "1.1.0-alpha.10",
39
+ "@dynamic-labs/wallet-book": "1.1.0-alpha.10",
40
+ "@dynamic-labs/wallet-connector-core": "1.1.0-alpha.10",
41
41
  "stream": "0.0.2"
42
42
  },
43
43
  "peerDependencies": {
44
- "viem": "^1.1.0"
44
+ "viem": "^1.19.13"
45
45
  }
46
46
  }
@@ -66,6 +66,13 @@ class EthWalletConnector extends walletConnectorCore.WalletConnectorBase {
66
66
  }
67
67
  return utils.retryableFn(provider.getChainId, {
68
68
  fallbackValue: utils.FALLBACK_UNDEFINED,
69
+ /**
70
+ * The timeout is set to 1 second because the getChainId method
71
+ * takes around 500ms to resolve on Brave. If the timeout is not set
72
+ * it will use 100ms by default and the method will fail.
73
+ * QNTM-815
74
+ */
75
+ timeoutMs: 1000,
69
76
  });
70
77
  });
71
78
  }
@@ -62,6 +62,13 @@ class EthWalletConnector extends WalletConnectorBase {
62
62
  }
63
63
  return retryableFn(provider.getChainId, {
64
64
  fallbackValue: FALLBACK_UNDEFINED,
65
+ /**
66
+ * The timeout is set to 1 second because the getChainId method
67
+ * takes around 500ms to resolve on Brave. If the timeout is not set
68
+ * it will use 100ms by default and the method will fail.
69
+ * QNTM-815
70
+ */
71
+ timeoutMs: 1000,
65
72
  });
66
73
  });
67
74
  }
@@ -11,19 +11,13 @@ var constants = require('../../constants.cjs');
11
11
  const jsonRpcUrl = `https://mainnet.infura.io/v3/${constants.INFURA_ID}`;
12
12
  const chainId = 1;
13
13
  let coinbaseProvider;
14
- const getCoinbaseProvider = ({ opts: { appLogoUrl, appName = '', evmNetworks = [] } = {}, handlers, }) => {
14
+ const getCoinbaseProvider = ({ opts: { appLogoUrl, appName = '', evmNetworks = [] } = {}, }) => {
15
15
  var _a, _b;
16
16
  if (!coinbaseProvider) {
17
17
  const coinbaseWalletSDK = new walletSdk.CoinbaseWalletSDK({
18
18
  appLogoUrl,
19
19
  appName,
20
- eventListener: {
21
- onEvent: (eventType) => {
22
- if (eventType === 'walletlink_sdk.disconnected') {
23
- handlers === null || handlers === void 0 ? void 0 : handlers.onDisconnect();
24
- }
25
- },
26
- },
20
+ enableMobileWalletLink: true,
27
21
  headlessMode: true,
28
22
  reloadOnDisconnect: false,
29
23
  });
@@ -7,19 +7,13 @@ import { INFURA_ID } from '../../constants.js';
7
7
  const jsonRpcUrl = `https://mainnet.infura.io/v3/${INFURA_ID}`;
8
8
  const chainId = 1;
9
9
  let coinbaseProvider;
10
- const getCoinbaseProvider = ({ opts: { appLogoUrl, appName = '', evmNetworks = [] } = {}, handlers, }) => {
10
+ const getCoinbaseProvider = ({ opts: { appLogoUrl, appName = '', evmNetworks = [] } = {}, }) => {
11
11
  var _a, _b;
12
12
  if (!coinbaseProvider) {
13
13
  const coinbaseWalletSDK = new CoinbaseWalletSDK({
14
14
  appLogoUrl,
15
15
  appName,
16
- eventListener: {
17
- onEvent: (eventType) => {
18
- if (eventType === 'walletlink_sdk.disconnected') {
19
- handlers === null || handlers === void 0 ? void 0 : handlers.onDisconnect();
20
- }
21
- },
22
- },
16
+ enableMobileWalletLink: true,
23
17
  headlessMode: true,
24
18
  reloadOnDisconnect: false,
25
19
  });
@@ -4,8 +4,16 @@ Object.defineProperty(exports, '__esModule', { value: true });
4
4
 
5
5
  var _tslib = require('../../_virtual/_tslib.cjs');
6
6
  var viem = require('viem');
7
+ var walletBook = require('@dynamic-labs/wallet-book');
8
+ require('../polyfills.cjs');
9
+ require('@dynamic-labs/turnkey');
10
+ require('@dynamic-labs/utils');
11
+ var ethProviderHelper = require('../ethProviderHelper.cjs');
7
12
  var EthWalletConnector = require('../EthWalletConnector.cjs');
8
- var legacyEthProviderHelper = require('../legacyEthProviderHelper.cjs');
13
+ require('../walletConnect/walletConnectV2.cjs');
14
+ require('@walletconnect/ethereum-provider');
15
+ require('@dynamic-labs/wallet-connector-core');
16
+ require('@walletconnect/client');
9
17
  var client = require('./client/client.cjs');
10
18
 
11
19
  class Coinbase extends EthWalletConnector.EthWalletConnector {
@@ -21,18 +29,26 @@ class Coinbase extends EthWalletConnector.EthWalletConnector {
21
29
  appName: appName,
22
30
  evmNetworks: evmNetworks,
23
31
  };
32
+ const wallet = walletBook.findWalletBookWallet(this.walletBook, this.key);
33
+ if (!wallet)
34
+ return;
35
+ this.ethProviderHelper = new ethProviderHelper.EthProviderHelper(wallet);
24
36
  }
25
37
  setupEventListeners() {
26
- const provider = legacyEthProviderHelper.LegacyEthProviderHelper.findProvider(this.name);
38
+ var _a, _b, _c;
39
+ const provider = (_a = this.ethProviderHelper) === null || _a === void 0 ? void 0 : _a.findProvider();
27
40
  if (!provider) {
28
41
  return;
29
42
  }
30
- const { tearDownEventListeners } = legacyEthProviderHelper.LegacyEthProviderHelper._setupEventListeners(this.name, this, viem.createPublicClient({ transport: viem.custom(provider) }));
31
- this.teardownEventListeners = tearDownEventListeners;
43
+ const setupResponse = (_c = (_b = this.ethProviderHelper) === null || _b === void 0 ? void 0 : _b._setupEventListeners) === null || _c === void 0 ? void 0 : _c.call(_b, this, viem.createPublicClient({ transport: viem.custom(provider) }));
44
+ if (!(setupResponse === null || setupResponse === void 0 ? void 0 : setupResponse.tearDownEventListeners))
45
+ return;
46
+ this.teardownEventListeners = setupResponse.tearDownEventListeners;
32
47
  }
33
48
  getWalletClient() {
49
+ var _a;
34
50
  if (this.isInstalledOnBrowser()) {
35
- return legacyEthProviderHelper.LegacyEthProviderHelper.findWalletClient(this.name);
51
+ return (_a = this.ethProviderHelper) === null || _a === void 0 ? void 0 : _a.findWalletClient();
36
52
  }
37
53
  return viem.createWalletClient({
38
54
  transport: viem.custom(client.getCoinbaseProvider({
@@ -41,20 +57,23 @@ class Coinbase extends EthWalletConnector.EthWalletConnector {
41
57
  });
42
58
  }
43
59
  isInstalledOnBrowser() {
44
- return legacyEthProviderHelper.LegacyEthProviderHelper.isInstalledHelper(this.name);
60
+ var _a;
61
+ return ((_a = this.ethProviderHelper) === null || _a === void 0 ? void 0 : _a.findProvider()) !== undefined;
45
62
  }
46
63
  fetchPublicAddress(opts) {
64
+ var _a;
47
65
  return _tslib.__awaiter(this, void 0, void 0, function* () {
48
66
  if (this.isInstalledOnBrowser()) {
49
- return legacyEthProviderHelper.LegacyEthProviderHelper.fetchPublicAddressWithName(this.name);
67
+ return (_a = this.ethProviderHelper) === null || _a === void 0 ? void 0 : _a.fetchPublicAddress();
50
68
  }
51
69
  return client.fetchPublicAddress(this.coinbaseProviderOpts, opts);
52
70
  });
53
71
  }
54
72
  signMessage(messageToSign) {
73
+ var _a;
55
74
  return _tslib.__awaiter(this, void 0, void 0, function* () {
56
75
  if (this.isInstalledOnBrowser()) {
57
- return legacyEthProviderHelper.LegacyEthProviderHelper.signMessageWithName(messageToSign, this.name);
76
+ return (_a = this.ethProviderHelper) === null || _a === void 0 ? void 0 : _a.signMessage(messageToSign);
58
77
  }
59
78
  return client.signMessage(this.coinbaseProviderOpts, messageToSign);
60
79
  });
@@ -1,4 +1,5 @@
1
1
  import { Chain, FetchPublicAddressOpts } from '@dynamic-labs/wallet-connector-core';
2
+ import { EthProviderHelper } from '..';
2
3
  import { EthWalletConnector, EthWalletConnectorOpts } from '../EthWalletConnector';
3
4
  type CoinbaseOpts = EthWalletConnectorOpts & {
4
5
  appLogoUrl?: string;
@@ -10,6 +11,7 @@ export declare class Coinbase extends EthWalletConnector {
10
11
  connectedChain: Chain;
11
12
  canConnectViaQrCode: boolean;
12
13
  private coinbaseProviderOpts;
14
+ ethProviderHelper: EthProviderHelper | undefined;
13
15
  constructor({ appName, appLogoUrl, evmNetworks, ...props }: CoinbaseOpts);
14
16
  setupEventListeners(): void;
15
17
  getWalletClient(): {
@@ -1,7 +1,15 @@
1
1
  import { __rest, __awaiter } from '../../_virtual/_tslib.js';
2
2
  import { createPublicClient, custom, createWalletClient } from 'viem';
3
+ import { findWalletBookWallet } from '@dynamic-labs/wallet-book';
4
+ import '../polyfills.js';
5
+ import '@dynamic-labs/turnkey';
6
+ import '@dynamic-labs/utils';
7
+ import { EthProviderHelper } from '../ethProviderHelper.js';
3
8
  import { EthWalletConnector } from '../EthWalletConnector.js';
4
- import { LegacyEthProviderHelper } from '../legacyEthProviderHelper.js';
9
+ import '../walletConnect/walletConnectV2.js';
10
+ import '@walletconnect/ethereum-provider';
11
+ import '@dynamic-labs/wallet-connector-core';
12
+ import '@walletconnect/client';
5
13
  import { getCoinbaseProvider, fetchPublicAddress, signMessage, killCoinbaseSession } from './client/client.js';
6
14
 
7
15
  class Coinbase extends EthWalletConnector {
@@ -17,18 +25,26 @@ class Coinbase extends EthWalletConnector {
17
25
  appName: appName,
18
26
  evmNetworks: evmNetworks,
19
27
  };
28
+ const wallet = findWalletBookWallet(this.walletBook, this.key);
29
+ if (!wallet)
30
+ return;
31
+ this.ethProviderHelper = new EthProviderHelper(wallet);
20
32
  }
21
33
  setupEventListeners() {
22
- const provider = LegacyEthProviderHelper.findProvider(this.name);
34
+ var _a, _b, _c;
35
+ const provider = (_a = this.ethProviderHelper) === null || _a === void 0 ? void 0 : _a.findProvider();
23
36
  if (!provider) {
24
37
  return;
25
38
  }
26
- const { tearDownEventListeners } = LegacyEthProviderHelper._setupEventListeners(this.name, this, createPublicClient({ transport: custom(provider) }));
27
- this.teardownEventListeners = tearDownEventListeners;
39
+ const setupResponse = (_c = (_b = this.ethProviderHelper) === null || _b === void 0 ? void 0 : _b._setupEventListeners) === null || _c === void 0 ? void 0 : _c.call(_b, this, createPublicClient({ transport: custom(provider) }));
40
+ if (!(setupResponse === null || setupResponse === void 0 ? void 0 : setupResponse.tearDownEventListeners))
41
+ return;
42
+ this.teardownEventListeners = setupResponse.tearDownEventListeners;
28
43
  }
29
44
  getWalletClient() {
45
+ var _a;
30
46
  if (this.isInstalledOnBrowser()) {
31
- return LegacyEthProviderHelper.findWalletClient(this.name);
47
+ return (_a = this.ethProviderHelper) === null || _a === void 0 ? void 0 : _a.findWalletClient();
32
48
  }
33
49
  return createWalletClient({
34
50
  transport: custom(getCoinbaseProvider({
@@ -37,20 +53,23 @@ class Coinbase extends EthWalletConnector {
37
53
  });
38
54
  }
39
55
  isInstalledOnBrowser() {
40
- return LegacyEthProviderHelper.isInstalledHelper(this.name);
56
+ var _a;
57
+ return ((_a = this.ethProviderHelper) === null || _a === void 0 ? void 0 : _a.findProvider()) !== undefined;
41
58
  }
42
59
  fetchPublicAddress(opts) {
60
+ var _a;
43
61
  return __awaiter(this, void 0, void 0, function* () {
44
62
  if (this.isInstalledOnBrowser()) {
45
- return LegacyEthProviderHelper.fetchPublicAddressWithName(this.name);
63
+ return (_a = this.ethProviderHelper) === null || _a === void 0 ? void 0 : _a.fetchPublicAddress();
46
64
  }
47
65
  return fetchPublicAddress(this.coinbaseProviderOpts, opts);
48
66
  });
49
67
  }
50
68
  signMessage(messageToSign) {
69
+ var _a;
51
70
  return __awaiter(this, void 0, void 0, function* () {
52
71
  if (this.isInstalledOnBrowser()) {
53
- return LegacyEthProviderHelper.signMessageWithName(messageToSign, this.name);
72
+ return (_a = this.ethProviderHelper) === null || _a === void 0 ? void 0 : _a.signMessage(messageToSign);
54
73
  }
55
74
  return signMessage(this.coinbaseProviderOpts, messageToSign);
56
75
  });
@@ -16,10 +16,7 @@ class EthProviderHelper {
16
16
  getInstalledProvider() {
17
17
  const eip6963Config = this.getEip6963Config();
18
18
  if (eip6963Config) {
19
- const eip6963Provider = this.eip6963ProviderLookup(eip6963Config.rdns);
20
- if (eip6963Provider) {
21
- return eip6963Provider;
22
- }
19
+ return this.eip6963ProviderLookup(eip6963Config.rdns);
23
20
  }
24
21
  const config = this.getInjectedConfig();
25
22
  if (!config ||
@@ -15,6 +15,10 @@ export declare class EthProviderHelper {
15
15
  value: boolean;
16
16
  flag: string;
17
17
  }[];
18
+ walletStandard?: {
19
+ features: string[];
20
+ name: string;
21
+ } | undefined;
18
22
  windowLocations?: string[] | undefined;
19
23
  } | undefined;
20
24
  installedProviders(): IEthereum[];
@@ -12,10 +12,7 @@ class EthProviderHelper {
12
12
  getInstalledProvider() {
13
13
  const eip6963Config = this.getEip6963Config();
14
14
  if (eip6963Config) {
15
- const eip6963Provider = this.eip6963ProviderLookup(eip6963Config.rdns);
16
- if (eip6963Provider) {
17
- return eip6963Provider;
18
- }
15
+ return this.eip6963ProviderLookup(eip6963Config.rdns);
19
16
  }
20
17
  const config = this.getInjectedConfig();
21
18
  if (!config ||
package/src/index.cjs CHANGED
@@ -4,19 +4,9 @@ Object.defineProperty(exports, '__esModule', { value: true });
4
4
 
5
5
  require('./polyfills.cjs');
6
6
  var turnkey = require('@dynamic-labs/turnkey');
7
- var BloctoInjected = require('./injected/BloctoInjected.cjs');
8
- var BraveEvm = require('./injected/BraveEvm.cjs');
9
- var Dawn = require('./injected/Dawn.cjs');
10
- var ExodusEvm = require('./injected/ExodusEvm.cjs');
11
- var Frame = require('./injected/Frame.cjs');
12
- var GameStop = require('./injected/GameStop.cjs');
13
- var Opera = require('./injected/Opera.cjs');
14
7
  var PhantomEvm = require('./injected/PhantomEvm.cjs');
15
- var Trust = require('./injected/Trust.cjs');
16
- var Zerion = require('./injected/Zerion.cjs');
17
- var Rabby = require('./injected/Rabby.cjs');
8
+ var ExodusEvm = require('./injected/ExodusEvm.cjs');
18
9
  var fetchInjectedWalletConnectors = require('./injected/fetchInjectedWalletConnectors.cjs');
19
- var legacyInjectedWallets = require('./injected/legacyInjectedWallets.cjs');
20
10
  require('./walletConnect/walletConnectV2.cjs');
21
11
  require('@walletconnect/ethereum-provider');
22
12
  require('viem');
@@ -29,10 +19,9 @@ require('@walletconnect/client');
29
19
  var fetchWalletConnectWallets = require('./walletConnect/fetchWalletConnectWallets.cjs');
30
20
  var coinbase = require('./coinbase/coinbase.cjs');
31
21
  var ethProviderHelper = require('./ethProviderHelper.cjs');
32
- var legacyEthProviderHelper = require('./legacyEthProviderHelper.cjs');
33
22
 
34
23
  const EthereumWalletConnectors = (props) => [
35
- ...legacyInjectedWallets.legacyInjectedWallets,
24
+ ...fetchInjectedWalletConnectors.injectedWalletOverrides,
36
25
  ...fetchInjectedWalletConnectors.fetchInjectedWalletConnector(props),
37
26
  ...fetchWalletConnectWallets.fetchWalletConnectWallets(props),
38
27
  ...turnkey.TurnkeyWalletConnectors(props),
@@ -40,22 +29,11 @@ const EthereumWalletConnectors = (props) => [
40
29
  fetchWalletConnectWallets.getWalletConnectConnector(props),
41
30
  ];
42
31
 
43
- exports.BloctoInjected = BloctoInjected.BloctoInjected;
44
- exports.BraveEvm = BraveEvm.BraveEvm;
45
- exports.Dawn = Dawn.Dawn;
46
- exports.ExodusEvm = ExodusEvm.ExodusEvm;
47
- exports.Frame = Frame.Frame;
48
- exports.GameStop = GameStop.GameStop;
49
- exports.Opera = Opera.Opera;
50
32
  exports.PhantomEvm = PhantomEvm.PhantomEvm;
51
- exports.Trust = Trust.Trust;
52
- exports.Zerion = Zerion.Zerion;
53
- exports.Rabby = Rabby.Rabby;
33
+ exports.ExodusEvm = ExodusEvm.ExodusEvm;
54
34
  exports.fetchInjectedWalletConnector = fetchInjectedWalletConnectors.fetchInjectedWalletConnector;
55
- exports.filteredLegacyInjectedWalletKeys = legacyInjectedWallets.filteredLegacyInjectedWalletKeys;
56
- exports.legacyInjectedWallets = legacyInjectedWallets.legacyInjectedWallets;
35
+ exports.injectedWalletOverrides = fetchInjectedWalletConnectors.injectedWalletOverrides;
57
36
  exports.EthWalletConnector = EthWalletConnector.EthWalletConnector;
58
37
  exports.INFURA_ID = constants.INFURA_ID;
59
38
  exports.EthProviderHelper = ethProviderHelper.EthProviderHelper;
60
- exports.LegacyEthProviderHelper = legacyEthProviderHelper.LegacyEthProviderHelper;
61
39
  exports.EthereumWalletConnectors = EthereumWalletConnectors;
package/src/index.d.ts CHANGED
@@ -3,7 +3,6 @@ import { WalletConnectorConstructor } from '@dynamic-labs/wallet-connector-core'
3
3
  export * from './injected';
4
4
  export * from './EthWalletConnector';
5
5
  export * from './ethProviderHelper';
6
- export * from './legacyEthProviderHelper';
7
6
  export * from './constants';
8
7
  export * from './types';
9
8
  export declare const EthereumWalletConnectors: (props: any) => WalletConnectorConstructor[];
package/src/index.js CHANGED
@@ -1,20 +1,9 @@
1
1
  import './polyfills.js';
2
2
  import { TurnkeyWalletConnectors } from '@dynamic-labs/turnkey';
3
- export { BloctoInjected } from './injected/BloctoInjected.js';
4
- export { BraveEvm } from './injected/BraveEvm.js';
5
- export { Dawn } from './injected/Dawn.js';
6
- export { ExodusEvm } from './injected/ExodusEvm.js';
7
- export { Frame } from './injected/Frame.js';
8
- export { GameStop } from './injected/GameStop.js';
9
- export { Opera } from './injected/Opera.js';
10
3
  export { PhantomEvm } from './injected/PhantomEvm.js';
11
- export { Trust } from './injected/Trust.js';
12
- export { Zerion } from './injected/Zerion.js';
13
- export { Rabby } from './injected/Rabby.js';
14
- import { fetchInjectedWalletConnector } from './injected/fetchInjectedWalletConnectors.js';
15
- export { fetchInjectedWalletConnector } from './injected/fetchInjectedWalletConnectors.js';
16
- import { legacyInjectedWallets } from './injected/legacyInjectedWallets.js';
17
- export { filteredLegacyInjectedWalletKeys, legacyInjectedWallets } from './injected/legacyInjectedWallets.js';
4
+ export { ExodusEvm } from './injected/ExodusEvm.js';
5
+ import { injectedWalletOverrides, fetchInjectedWalletConnector } from './injected/fetchInjectedWalletConnectors.js';
6
+ export { fetchInjectedWalletConnector, injectedWalletOverrides } from './injected/fetchInjectedWalletConnectors.js';
18
7
  import './walletConnect/walletConnectV2.js';
19
8
  import '@walletconnect/ethereum-provider';
20
9
  import 'viem';
@@ -27,10 +16,9 @@ import '@walletconnect/client';
27
16
  import { fetchWalletConnectWallets, getWalletConnectConnector } from './walletConnect/fetchWalletConnectWallets.js';
28
17
  import { Coinbase } from './coinbase/coinbase.js';
29
18
  export { EthProviderHelper } from './ethProviderHelper.js';
30
- export { LegacyEthProviderHelper } from './legacyEthProviderHelper.js';
31
19
 
32
20
  const EthereumWalletConnectors = (props) => [
33
- ...legacyInjectedWallets,
21
+ ...injectedWalletOverrides,
34
22
  ...fetchInjectedWalletConnector(props),
35
23
  ...fetchWalletConnectWallets(props),
36
24
  ...TurnkeyWalletConnectors(props),
@@ -2,13 +2,16 @@
2
2
 
3
3
  Object.defineProperty(exports, '__esModule', { value: true });
4
4
 
5
- var LegacyInjectedWalletBase = require('./LegacyInjectedWalletBase.cjs');
5
+ var walletBook = require('@dynamic-labs/wallet-book');
6
+ var InjectedWalletBase = require('./InjectedWalletBase.cjs');
6
7
 
7
- class ExodusEvm extends LegacyInjectedWalletBase {
8
- constructor() {
9
- super(...arguments);
8
+ // leaving ExodusEvm in here due to a backwards compatibility issue with this one wallet and v18
9
+ class ExodusEvm extends InjectedWalletBase {
10
+ constructor(props) {
11
+ super(props);
10
12
  this.name = 'ExodusEvm';
11
13
  this.walletConnectorFallback = true;
14
+ this.wallet = walletBook.findWalletBookWallet(this.walletBook, this.key);
12
15
  }
13
16
  }
14
17
 
@@ -1,5 +1,7 @@
1
- import LegacyInjectedWalletBase from './LegacyInjectedWalletBase';
2
- export declare class ExodusEvm extends LegacyInjectedWalletBase {
1
+ import { EthWalletConnectorOpts } from '..';
2
+ import InjectedWalletBase from './InjectedWalletBase';
3
+ export declare class ExodusEvm extends InjectedWalletBase {
3
4
  name: string;
4
5
  walletConnectorFallback: boolean;
6
+ constructor(props: EthWalletConnectorOpts);
5
7
  }
@@ -1,10 +1,13 @@
1
- import LegacyInjectedWalletBase from './LegacyInjectedWalletBase.js';
1
+ import { findWalletBookWallet } from '@dynamic-labs/wallet-book';
2
+ import InjectedWalletBase from './InjectedWalletBase.js';
2
3
 
3
- class ExodusEvm extends LegacyInjectedWalletBase {
4
- constructor() {
5
- super(...arguments);
4
+ // leaving ExodusEvm in here due to a backwards compatibility issue with this one wallet and v18
5
+ class ExodusEvm extends InjectedWalletBase {
6
+ constructor(props) {
7
+ super(props);
6
8
  this.name = 'ExodusEvm';
7
9
  this.walletConnectorFallback = true;
10
+ this.wallet = findWalletBookWallet(this.walletBook, this.key);
8
11
  }
9
12
  }
10
13
 
@@ -4,12 +4,14 @@ Object.defineProperty(exports, '__esModule', { value: true });
4
4
 
5
5
  var _tslib = require('../../_virtual/_tslib.cjs');
6
6
  var utils = require('@dynamic-labs/utils');
7
- var LegacyInjectedWalletBase = require('./LegacyInjectedWalletBase.cjs');
7
+ var walletBook = require('@dynamic-labs/wallet-book');
8
+ var InjectedWalletBase = require('./InjectedWalletBase.cjs');
8
9
 
9
- class PhantomEvm extends LegacyInjectedWalletBase {
10
- constructor() {
11
- super(...arguments);
10
+ class PhantomEvm extends InjectedWalletBase {
11
+ constructor(props) {
12
+ super(props);
12
13
  this.name = 'PhantomEvm';
14
+ this.wallet = walletBook.findWalletBookWallet(this.walletBook, this.key);
13
15
  }
14
16
  fetchPublicAddress() {
15
17
  const _super = Object.create(null, {
@@ -19,16 +21,11 @@ class PhantomEvm extends LegacyInjectedWalletBase {
19
21
  if (this.isInstalledOnBrowser()) {
20
22
  return _super.fetchPublicAddress.call(this);
21
23
  }
22
- const url = encodeURIComponent(window.location.toString());
23
- const ref = encodeURIComponent(window.location.origin);
24
- // samsung browser only supports native links, not universal links
25
24
  if (utils.isMobile()) {
26
- if (utils.isSamsungBrowser()) {
27
- window.location.assign(`phantom://browse/${url}?ref=${ref}`);
28
- }
29
- else {
30
- window.location.assign(`https://phantom.app/ul/browse/${url}?ref=${ref}`);
31
- }
25
+ utils.handleMobileWalletRedirect({
26
+ nativeLink: 'phantom://browse',
27
+ universalLink: 'https://phantom.app/ul/browse',
28
+ });
32
29
  }
33
30
  return undefined;
34
31
  });
@@ -1,5 +1,7 @@
1
- import LegacyInjectedWalletBase from './LegacyInjectedWalletBase';
2
- export declare class PhantomEvm extends LegacyInjectedWalletBase {
1
+ import { EthWalletConnectorOpts } from '..';
2
+ import InjectedWalletBase from './InjectedWalletBase';
3
+ export declare class PhantomEvm extends InjectedWalletBase {
3
4
  name: string;
5
+ constructor(props: EthWalletConnectorOpts);
4
6
  fetchPublicAddress(): Promise<string | undefined>;
5
7
  }