@dynamic-labs/ethereum 2.0.0-alpha.18 → 2.0.0-alpha.19

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,13 @@
1
1
 
2
+ ## [2.0.0-alpha.19](https://github.com/dynamic-labs/DynamicAuth/compare/v2.0.0-alpha.18...v2.0.0-alpha.19) (2024-03-19)
3
+
4
+
5
+ ### Bug Fixes
6
+
7
+ * add localization to email form ([#5009](https://github.com/dynamic-labs/DynamicAuth/issues/5009)) ([f3c100c](https://github.com/dynamic-labs/DynamicAuth/commit/f3c100cb0b815880d11c6b619d94bfaa7330a115))
8
+ * include domain on signTypedData for ZeroDev connector ([#5017](https://github.com/dynamic-labs/DynamicAuth/issues/5017)) ([71c9131](https://github.com/dynamic-labs/DynamicAuth/commit/71c91311a75309810bc497c8f82981553ddc57fd))
9
+ * Remove Copy Address button if there is no wallet ([#4994](https://github.com/dynamic-labs/DynamicAuth/issues/4994)) ([fe1e641](https://github.com/dynamic-labs/DynamicAuth/commit/fe1e6417be2299e65ba4bcbc3347dfc27f021853))
10
+
2
11
  ## [2.0.0-alpha.18](https://github.com/dynamic-labs/DynamicAuth/compare/v2.0.0-alpha.17...v2.0.0-alpha.18) (2024-03-15)
3
12
 
4
13
  ## [2.0.0-alpha.17](https://github.com/dynamic-labs/DynamicAuth/compare/v2.0.0-alpha.16...v2.0.0-alpha.17) (2024-03-15)
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@dynamic-labs/ethereum",
3
- "version": "2.0.0-alpha.18",
3
+ "version": "2.0.0-alpha.19",
4
4
  "repository": {
5
5
  "type": "git",
6
6
  "url": "https://github.com/dynamic-labs/DynamicAuth.git",
@@ -30,13 +30,13 @@
30
30
  "@walletconnect/universal-provider": "2.10.6",
31
31
  "eventemitter3": "5.0.1",
32
32
  "buffer": "6.0.3",
33
- "@dynamic-labs/rpc-provider-ethereum": "2.0.0-alpha.18",
34
- "@dynamic-labs/turnkey": "2.0.0-alpha.18",
35
- "@dynamic-labs/types": "2.0.0-alpha.18",
36
- "@dynamic-labs/utils": "2.0.0-alpha.18",
37
- "@dynamic-labs/viem-utils": "2.0.0-alpha.18",
38
- "@dynamic-labs/wallet-book": "2.0.0-alpha.18",
39
- "@dynamic-labs/wallet-connector-core": "2.0.0-alpha.18",
33
+ "@dynamic-labs/rpc-provider-ethereum": "2.0.0-alpha.19",
34
+ "@dynamic-labs/turnkey": "2.0.0-alpha.19",
35
+ "@dynamic-labs/types": "2.0.0-alpha.19",
36
+ "@dynamic-labs/utils": "2.0.0-alpha.19",
37
+ "@dynamic-labs/viem-utils": "2.0.0-alpha.19",
38
+ "@dynamic-labs/wallet-book": "2.0.0-alpha.19",
39
+ "@dynamic-labs/wallet-connector-core": "2.0.0-alpha.19",
40
40
  "stream": "0.0.2"
41
41
  },
42
42
  "peerDependencies": {
@@ -5,6 +5,7 @@ Object.defineProperty(exports, '__esModule', { value: true });
5
5
  var _tslib = require('../../_virtual/_tslib.cjs');
6
6
  var viem = require('viem');
7
7
  var walletBook = require('@dynamic-labs/wallet-book');
8
+ var walletConnectorCore = require('@dynamic-labs/wallet-connector-core');
8
9
  require('../polyfills.cjs');
9
10
  require('@dynamic-labs/turnkey');
10
11
  require('@dynamic-labs/utils');
@@ -35,6 +36,10 @@ class Coinbase extends EthWalletConnector.EthWalletConnector {
35
36
  }
36
37
  setupEventListeners() {
37
38
  var _a, _b, _c;
39
+ if (!this.isInstalledOnBrowser()) {
40
+ this.setupCoinbaseProviderEventListeners();
41
+ return;
42
+ }
38
43
  const provider = (_a = this.ethProviderHelper) === null || _a === void 0 ? void 0 : _a.findProvider();
39
44
  if (!provider) {
40
45
  return;
@@ -84,6 +89,23 @@ class Coinbase extends EthWalletConnector.EthWalletConnector {
84
89
  client.killCoinbaseSession();
85
90
  });
86
91
  }
92
+ setupCoinbaseProviderEventListeners() {
93
+ const provider = client.getCoinbaseProvider({
94
+ opts: this.coinbaseProviderOpts,
95
+ });
96
+ if (!provider) {
97
+ return;
98
+ }
99
+ const { handleAccountChange, handleChainChange, handleDisconnect } = walletConnectorCore.eventListenerHandlers(this);
100
+ provider.on('accountsChanged', handleAccountChange);
101
+ provider.on('chainChanged', handleChainChange);
102
+ provider.on('disconnect', handleDisconnect);
103
+ this.teardownEventListeners = () => {
104
+ provider.removeListener('accountsChanged', handleAccountChange);
105
+ provider.removeListener('chainChanged', handleChainChange);
106
+ provider.removeListener('disconnect', handleDisconnect);
107
+ };
108
+ }
87
109
  }
88
110
 
89
111
  exports.Coinbase = Coinbase;
@@ -534,5 +534,6 @@ export declare class Coinbase extends EthWalletConnector {
534
534
  getAddress(opts?: GetAddressOpts): Promise<string | undefined>;
535
535
  signMessage(messageToSign: string): Promise<string | undefined>;
536
536
  endSession(): Promise<void>;
537
+ private setupCoinbaseProviderEventListeners;
537
538
  }
538
539
  export {};
@@ -1,6 +1,7 @@
1
1
  import { __rest, __awaiter } from '../../_virtual/_tslib.js';
2
2
  import { createWalletClient, custom } from 'viem';
3
3
  import { findWalletBookWallet } from '@dynamic-labs/wallet-book';
4
+ import { eventListenerHandlers } from '@dynamic-labs/wallet-connector-core';
4
5
  import '../polyfills.js';
5
6
  import '@dynamic-labs/turnkey';
6
7
  import '@dynamic-labs/utils';
@@ -31,6 +32,10 @@ class Coinbase extends EthWalletConnector {
31
32
  }
32
33
  setupEventListeners() {
33
34
  var _a, _b, _c;
35
+ if (!this.isInstalledOnBrowser()) {
36
+ this.setupCoinbaseProviderEventListeners();
37
+ return;
38
+ }
34
39
  const provider = (_a = this.ethProviderHelper) === null || _a === void 0 ? void 0 : _a.findProvider();
35
40
  if (!provider) {
36
41
  return;
@@ -80,6 +85,23 @@ class Coinbase extends EthWalletConnector {
80
85
  killCoinbaseSession();
81
86
  });
82
87
  }
88
+ setupCoinbaseProviderEventListeners() {
89
+ const provider = getCoinbaseProvider({
90
+ opts: this.coinbaseProviderOpts,
91
+ });
92
+ if (!provider) {
93
+ return;
94
+ }
95
+ const { handleAccountChange, handleChainChange, handleDisconnect } = eventListenerHandlers(this);
96
+ provider.on('accountsChanged', handleAccountChange);
97
+ provider.on('chainChanged', handleChainChange);
98
+ provider.on('disconnect', handleDisconnect);
99
+ this.teardownEventListeners = () => {
100
+ provider.removeListener('accountsChanged', handleAccountChange);
101
+ provider.removeListener('chainChanged', handleChainChange);
102
+ provider.removeListener('disconnect', handleDisconnect);
103
+ };
104
+ }
83
105
  }
84
106
 
85
107
  export { Coinbase };