@dynamic-labs/ethereum 0.17.16 → 0.17.18

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,14 @@
1
1
 
2
+ ### [0.17.18](https://github.com/dynamic-labs/DynamicAuth/compare/v0.17.17...v0.17.18) (2023-06-29)
3
+
4
+ ### [0.17.17](https://github.com/dynamic-labs/DynamicAuth/compare/v0.17.16...v0.17.17) (2023-06-29)
5
+
6
+
7
+ ### Bug Fixes
8
+
9
+ * walletconnect v2 fixes ([#2529](https://github.com/dynamic-labs/DynamicAuth/issues/2529)) ([6fe03d8](https://github.com/dynamic-labs/DynamicAuth/commit/6fe03d802b0a3b8f7995d3a52ce5183b3b0bfb83)), closes [#2523](https://github.com/dynamic-labs/DynamicAuth/issues/2523) [#2527](https://github.com/dynamic-labs/DynamicAuth/issues/2527)
10
+ * **wcv2:** use native or universal link when signing message ([#2502](https://github.com/dynamic-labs/DynamicAuth/issues/2502)) ([#2513](https://github.com/dynamic-labs/DynamicAuth/issues/2513)) ([01f7ca1](https://github.com/dynamic-labs/DynamicAuth/commit/01f7ca109c97d5cb04d6f4b4b574ec99aa8272f1))
11
+
2
12
  ### [0.17.16](https://github.com/dynamic-labs/DynamicAuth/compare/v0.17.15...v0.17.16) (2023-06-28)
3
13
 
4
14
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@dynamic-labs/ethereum",
3
- "version": "0.17.16",
3
+ "version": "0.17.18",
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.17.16",
36
- "@dynamic-labs/types": "0.17.16",
37
- "@dynamic-labs/utils": "0.17.16",
38
- "@dynamic-labs/wallet-book": "0.17.16",
39
- "@dynamic-labs/wallet-connector-core": "0.17.16"
35
+ "@dynamic-labs/rpc-providers": "0.17.18",
36
+ "@dynamic-labs/types": "0.17.18",
37
+ "@dynamic-labs/utils": "0.17.18",
38
+ "@dynamic-labs/wallet-book": "0.17.18",
39
+ "@dynamic-labs/wallet-connector-core": "0.17.18"
40
40
  },
41
41
  "peerDependencies": {}
42
42
  }
@@ -66,6 +66,7 @@ class WalletConnectV2 extends EthWalletConnector.EthWalletConnector {
66
66
  'eth_sign',
67
67
  'personal_sign',
68
68
  'eth_sendTransaction',
69
+ 'eth_signTypedData_v4',
69
70
  ],
70
71
  rpcMap: this.evmNetworkRpcMap(),
71
72
  },
@@ -183,7 +184,7 @@ class WalletConnectV2 extends EthWalletConnector.EthWalletConnector {
183
184
  }
184
185
  getWeb3Provider() {
185
186
  if (!WalletConnectV2.provider) {
186
- throw new Error('No provider found');
187
+ return;
187
188
  }
188
189
  return new ethers.ethers.providers.Web3Provider(WalletConnectV2.provider, 'any');
189
190
  }
@@ -258,6 +259,9 @@ class WalletConnectV2 extends EthWalletConnector.EthWalletConnector {
258
259
  window.location.href = deepLink;
259
260
  }
260
261
  const web3Provider = this.getWeb3Provider();
262
+ if (!web3Provider) {
263
+ throw new utils.DynamicError('No web3 provider found');
264
+ }
261
265
  const response = web3Provider.send('personal_sign', [
262
266
  walletConnectorCore.utf8ToHex(messageToSign, true),
263
267
  this.activeAccount,
@@ -31,7 +31,7 @@ export declare class WalletConnectV2 extends EthWalletConnector {
31
31
  setupEventListeners(listeners: WalletEventListeners): void;
32
32
  teardownEventListeners(): void;
33
33
  getDeepLink(): string | undefined;
34
- getWeb3Provider(): ethers.providers.Web3Provider;
34
+ getWeb3Provider(): ethers.providers.Web3Provider | undefined;
35
35
  fetchPublicAddress(opts?: FetchPublicAddressOpts): Promise<string | undefined>;
36
36
  signMessage(messageToSign: string): Promise<string | undefined>;
37
37
  private clearActiveAccount;
@@ -57,6 +57,7 @@ class WalletConnectV2 extends EthWalletConnector {
57
57
  'eth_sign',
58
58
  'personal_sign',
59
59
  'eth_sendTransaction',
60
+ 'eth_signTypedData_v4',
60
61
  ],
61
62
  rpcMap: this.evmNetworkRpcMap(),
62
63
  },
@@ -174,7 +175,7 @@ class WalletConnectV2 extends EthWalletConnector {
174
175
  }
175
176
  getWeb3Provider() {
176
177
  if (!WalletConnectV2.provider) {
177
- throw new Error('No provider found');
178
+ return;
178
179
  }
179
180
  return new ethers.providers.Web3Provider(WalletConnectV2.provider, 'any');
180
181
  }
@@ -249,6 +250,9 @@ class WalletConnectV2 extends EthWalletConnector {
249
250
  window.location.href = deepLink;
250
251
  }
251
252
  const web3Provider = this.getWeb3Provider();
253
+ if (!web3Provider) {
254
+ throw new DynamicError('No web3 provider found');
255
+ }
252
256
  const response = web3Provider.send('personal_sign', [
253
257
  utf8ToHex(messageToSign, true),
254
258
  this.activeAccount,