@dynamic-labs/ethereum 0.18.12 → 0.18.14

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
+ ### [0.18.14](https://github.com/dynamic-labs/DynamicAuth/compare/v0.18.13...v0.18.14) (2023-09-05)
3
+
4
+
5
+ ### Features
6
+
7
+ * add onSignedMessage callback ([#3213](https://github.com/dynamic-labs/DynamicAuth/issues/3213)) ([648defa](https://github.com/dynamic-labs/DynamicAuth/commit/648defa1c5f84805e5dcdbb98a30be2a47f53ed7))
8
+
9
+
10
+ ### Bug Fixes
11
+
12
+ * prefer mainnet chain id when connecting with WCv2 ([#3219](https://github.com/dynamic-labs/DynamicAuth/issues/3219)) ([6ee8fb6](https://github.com/dynamic-labs/DynamicAuth/commit/6ee8fb6c0565e759837f45179de12c985ac0dd71))
13
+
14
+ ### [0.18.13](https://github.com/dynamic-labs/DynamicAuth/compare/v0.18.12...v0.18.13) (2023-08-31)
15
+
16
+
17
+ ### Features
18
+
19
+ * add option to disable the locked wallet view ([#3188](https://github.com/dynamic-labs/DynamicAuth/issues/3188)) ([47ae562](https://github.com/dynamic-labs/DynamicAuth/commit/47ae562e58b38ec704490cdab56a73115cdee184))
20
+ * migrate starknet version to v5 ([#3199](https://github.com/dynamic-labs/DynamicAuth/issues/3199)) ([185beb0](https://github.com/dynamic-labs/DynamicAuth/commit/185beb099d9dcce0935b2d11b49460fc3a5f2608))
21
+
22
+
23
+ ### Bug Fixes
24
+
25
+ * show the multi wallet list when opening the auth flow to authenticated users ([#3163](https://github.com/dynamic-labs/DynamicAuth/issues/3163)) ([25d30cd](https://github.com/dynamic-labs/DynamicAuth/commit/25d30cdebc46a84725d289aab0bb30c3d54a15ab)), closes [#3134](https://github.com/dynamic-labs/DynamicAuth/issues/3134) [#3152](https://github.com/dynamic-labs/DynamicAuth/issues/3152) [#3168](https://github.com/dynamic-labs/DynamicAuth/issues/3168)
26
+ * sign message for embedded wallet when auth mode is connect only ([#3194](https://github.com/dynamic-labs/DynamicAuth/issues/3194)) ([6879aeb](https://github.com/dynamic-labs/DynamicAuth/commit/6879aebb3b22d7476fb06f8d33a0029199bf910f))
27
+ * verify email OTP when email is updated ([#3168](https://github.com/dynamic-labs/DynamicAuth/issues/3168)) ([641eeb6](https://github.com/dynamic-labs/DynamicAuth/commit/641eeb685b0c9d77cc72912f29b137c699c192f0))
28
+
2
29
  ### [0.18.12](https://github.com/dynamic-labs/DynamicAuth/compare/v0.18.11...v0.18.12) (2023-08-30)
3
30
 
4
31
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@dynamic-labs/ethereum",
3
- "version": "0.18.12",
3
+ "version": "0.18.14",
4
4
  "repository": {
5
5
  "type": "git",
6
6
  "url": "https://github.com/dynamic-labs/DynamicAuth.git",
@@ -32,11 +32,11 @@
32
32
  "ethers": "5.7.2",
33
33
  "eventemitter3": "5.0.1",
34
34
  "buffer": "6.0.3",
35
- "@dynamic-labs/rpc-providers": "0.18.12",
36
- "@dynamic-labs/types": "0.18.12",
37
- "@dynamic-labs/utils": "0.18.12",
38
- "@dynamic-labs/wallet-book": "0.18.12",
39
- "@dynamic-labs/wallet-connector-core": "0.18.12",
35
+ "@dynamic-labs/rpc-providers": "0.18.14",
36
+ "@dynamic-labs/types": "0.18.14",
37
+ "@dynamic-labs/utils": "0.18.14",
38
+ "@dynamic-labs/wallet-book": "0.18.14",
39
+ "@dynamic-labs/wallet-connector-core": "0.18.14",
40
40
  "@ethersproject/providers": "5.7.2"
41
41
  },
42
42
  "peerDependencies": {}
@@ -32,8 +32,15 @@ class WalletConnectV2 extends EthWalletConnector.EthWalletConnector {
32
32
  this.projectId = opts.projectId;
33
33
  this.deepLinkPreference = opts.deepLinkPreference || 'native';
34
34
  }
35
+ getDefaultChainId() {
36
+ var _a, _b;
37
+ const etheriumMainnetNetwork = (_a = this.evmNetworks) === null || _a === void 0 ? void 0 : _a.find((network) => network.chainId === 1);
38
+ if (!etheriumMainnetNetwork && ((_b = this.evmNetworks) === null || _b === void 0 ? void 0 : _b.length)) {
39
+ return this.evmNetworks[0].chainId;
40
+ }
41
+ return 1;
42
+ }
35
43
  initConnection() {
36
- var _a;
37
44
  return _tslib.__awaiter(this, void 0, void 0, function* () {
38
45
  const { provider } = WalletConnectV2;
39
46
  if (!provider) {
@@ -43,9 +50,7 @@ class WalletConnectV2 extends EthWalletConnector.EthWalletConnector {
43
50
  if (provider === null || provider === void 0 ? void 0 : provider.uri) {
44
51
  return;
45
52
  }
46
- const defaultChain = ((_a = this.evmNetworks) === null || _a === void 0 ? void 0 : _a.length)
47
- ? this.evmNetworks[0].chainId
48
- : 1;
53
+ const defaultChain = this.getDefaultChainId();
49
54
  provider
50
55
  .connect({
51
56
  namespaces: {
@@ -22,6 +22,7 @@ export declare class WalletConnectV2 extends EthWalletConnector {
22
22
  private projectId?;
23
23
  private deepLinkPreference;
24
24
  constructor(opts: WalletConnectorV2Opts);
25
+ getDefaultChainId(): number;
25
26
  private initConnection;
26
27
  private createInitProviderPromise;
27
28
  private initProvider;
@@ -23,8 +23,15 @@ class WalletConnectV2 extends EthWalletConnector {
23
23
  this.projectId = opts.projectId;
24
24
  this.deepLinkPreference = opts.deepLinkPreference || 'native';
25
25
  }
26
+ getDefaultChainId() {
27
+ var _a, _b;
28
+ const etheriumMainnetNetwork = (_a = this.evmNetworks) === null || _a === void 0 ? void 0 : _a.find((network) => network.chainId === 1);
29
+ if (!etheriumMainnetNetwork && ((_b = this.evmNetworks) === null || _b === void 0 ? void 0 : _b.length)) {
30
+ return this.evmNetworks[0].chainId;
31
+ }
32
+ return 1;
33
+ }
26
34
  initConnection() {
27
- var _a;
28
35
  return __awaiter(this, void 0, void 0, function* () {
29
36
  const { provider } = WalletConnectV2;
30
37
  if (!provider) {
@@ -34,9 +41,7 @@ class WalletConnectV2 extends EthWalletConnector {
34
41
  if (provider === null || provider === void 0 ? void 0 : provider.uri) {
35
42
  return;
36
43
  }
37
- const defaultChain = ((_a = this.evmNetworks) === null || _a === void 0 ? void 0 : _a.length)
38
- ? this.evmNetworks[0].chainId
39
- : 1;
44
+ const defaultChain = this.getDefaultChainId();
40
45
  provider
41
46
  .connect({
42
47
  namespaces: {