@dynamic-labs/ethereum 2.1.0-alpha.27 → 2.1.0-alpha.29

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,31 @@
1
1
 
2
+ ## [2.1.0-alpha.29](https://github.com/dynamic-labs/DynamicAuth/compare/v2.1.0-alpha.28...v2.1.0-alpha.29) (2024-05-30)
3
+
4
+
5
+ ### Features
6
+
7
+ * add account and chain to coinbase walletClient ([#5776](https://github.com/dynamic-labs/DynamicAuth/issues/5776)) ([557091c](https://github.com/dynamic-labs/DynamicAuth/commit/557091c0efaec11273bd40b53c8bcd633c1bf48d))
8
+ * add support for phantom btc ([#5717](https://github.com/dynamic-labs/DynamicAuth/issues/5717)) ([c61ca4f](https://github.com/dynamic-labs/DynamicAuth/commit/c61ca4f437796be2b420902de7e7de730725d122))
9
+
10
+
11
+ ### Bug Fixes
12
+
13
+ * add phantom btc mobile redirect ([#5789](https://github.com/dynamic-labs/DynamicAuth/issues/5789)) ([aaa2654](https://github.com/dynamic-labs/DynamicAuth/commit/aaa26548668b0733e7930c1d7f5cc3937b3dfb50))
14
+ * clear settings and configurations when logged out on page load ([#5787](https://github.com/dynamic-labs/DynamicAuth/issues/5787)) ([53c4d0b](https://github.com/dynamic-labs/DynamicAuth/commit/53c4d0b4686debdb43b1ab1b8b9e296ed4dd74b6))
15
+ * lookup projectSettings from store to check if cookie enabled ([#5790](https://github.com/dynamic-labs/DynamicAuth/issues/5790)) ([6f2314b](https://github.com/dynamic-labs/DynamicAuth/commit/6f2314b0afef984e6caea79ead73d12c5c6d83f0))
16
+
17
+ ## [2.1.0-alpha.28](https://github.com/dynamic-labs/DynamicAuth/compare/v2.1.0-alpha.27...v2.1.0-alpha.28) (2024-05-29)
18
+
19
+
20
+ ### Features
21
+
22
+ * adds solana standard wallet connector ([#5752](https://github.com/dynamic-labs/DynamicAuth/issues/5752)) ([0040940](https://github.com/dynamic-labs/DynamicAuth/commit/0040940fd1adb37ab3106bb0e4dfe79403bc41f2))
23
+
24
+
25
+ ### Bug Fixes
26
+
27
+ * farcaster fetch url fix ([#5767](https://github.com/dynamic-labs/DynamicAuth/issues/5767)) ([1408ba9](https://github.com/dynamic-labs/DynamicAuth/commit/1408ba92680363b9db7820a63d5e3d15dc26ad22))
28
+
2
29
  ## [2.1.0-alpha.27](https://github.com/dynamic-labs/DynamicAuth/compare/v2.1.0-alpha.26...v2.1.0-alpha.27) (2024-05-29)
3
30
 
4
31
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@dynamic-labs/ethereum",
3
- "version": "2.1.0-alpha.27",
3
+ "version": "2.1.0-alpha.29",
4
4
  "repository": {
5
5
  "type": "git",
6
6
  "url": "git+https://github.com/dynamic-labs/dynamic-auth.git",
@@ -31,13 +31,13 @@
31
31
  "@walletconnect/ethereum-provider": "2.11.2",
32
32
  "eventemitter3": "5.0.1",
33
33
  "buffer": "6.0.3",
34
- "@dynamic-labs/rpc-provider-ethereum": "2.1.0-alpha.27",
35
- "@dynamic-labs/turnkey": "2.1.0-alpha.27",
36
- "@dynamic-labs/types": "2.1.0-alpha.27",
37
- "@dynamic-labs/utils": "2.1.0-alpha.27",
38
- "@dynamic-labs/viem-utils": "2.1.0-alpha.27",
39
- "@dynamic-labs/wallet-book": "2.1.0-alpha.27",
40
- "@dynamic-labs/wallet-connector-core": "2.1.0-alpha.27",
34
+ "@dynamic-labs/rpc-provider-ethereum": "2.1.0-alpha.29",
35
+ "@dynamic-labs/turnkey": "2.1.0-alpha.29",
36
+ "@dynamic-labs/types": "2.1.0-alpha.29",
37
+ "@dynamic-labs/utils": "2.1.0-alpha.29",
38
+ "@dynamic-labs/viem-utils": "2.1.0-alpha.29",
39
+ "@dynamic-labs/wallet-book": "2.1.0-alpha.29",
40
+ "@dynamic-labs/wallet-connector-core": "2.1.0-alpha.29",
41
41
  "stream": "0.0.2"
42
42
  },
43
43
  "peerDependencies": {
@@ -18,7 +18,7 @@ export type EthWalletConnectorOpts = {
18
18
  export declare abstract class EthWalletConnector extends WalletConnectorBase {
19
19
  evmNetworks: EvmNetwork[];
20
20
  private activeAccount;
21
- abstract getWalletClient(): WalletClient | undefined;
21
+ abstract getWalletClient(chainId?: string): WalletClient | undefined;
22
22
  getPublicClient(): Promise<PublicClient | undefined>;
23
23
  constructor(props: EthWalletConnectorOpts);
24
24
  getNetwork(): Promise<number | undefined>;
@@ -6,6 +6,7 @@ Object.defineProperty(exports, '__esModule', { value: true });
6
6
  var _tslib = require('../../_virtual/_tslib.cjs');
7
7
  var viem = require('viem');
8
8
  var walletConnectorCore = require('@dynamic-labs/wallet-connector-core');
9
+ var viemUtils = require('@dynamic-labs/viem-utils');
9
10
  var EthWalletConnector = require('../EthWalletConnector.cjs');
10
11
  var helpers = require('./helpers.cjs');
11
12
 
@@ -31,9 +32,13 @@ class Coinbase extends EthWalletConnector.EthWalletConnector {
31
32
  getConnectedAccounts() {
32
33
  return _tslib.__awaiter(this, void 0, void 0, function* () {
33
34
  try {
34
- return yield this.coinbaseProvider.request({
35
+ const accounts = yield this.coinbaseProvider.request({
35
36
  method: 'eth_accounts',
36
37
  });
38
+ if (accounts[0]) {
39
+ this.setActiveAccount(accounts[0]);
40
+ }
41
+ return accounts;
37
42
  }
38
43
  catch (error) {
39
44
  return [];
@@ -45,6 +50,7 @@ class Coinbase extends EthWalletConnector.EthWalletConnector {
45
50
  const [address] = yield this.coinbaseProvider.request({
46
51
  method: 'eth_requestAccounts',
47
52
  });
53
+ this.setActiveAccount(address);
48
54
  return address;
49
55
  });
50
56
  }
@@ -75,9 +81,10 @@ class Coinbase extends EthWalletConnector.EthWalletConnector {
75
81
  this.coinbaseProvider.removeListener('disconnect', handleDisconnect);
76
82
  };
77
83
  }
78
- getWalletClient() {
84
+ getWalletClient(chainId) {
79
85
  return viem.createWalletClient({
80
- // add account and chain
86
+ account: this.getActiveAccount(),
87
+ chain: chainId ? viemUtils.chainsMap[chainId] : undefined,
81
88
  transport: viem.custom(this.coinbaseProvider),
82
89
  });
83
90
  }