@dynamic-labs/ethers-v6 1.4.11 → 1.4.13

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,19 @@
1
1
 
2
+ ### [1.4.13](https://github.com/dynamic-labs/DynamicAuth/compare/v1.4.12...v1.4.13) (2024-06-05)
3
+
4
+
5
+ ### Bug Fixes
6
+
7
+ * bump @solana/web3.js containing new version of rpc-websockets ([#5864](https://github.com/dynamic-labs/DynamicAuth/issues/5864)) ([562ff9b](https://github.com/dynamic-labs/DynamicAuth/commit/562ff9b706c8be62812ace08bcaef96e26dcd841))
8
+ * wallet improvements
9
+
10
+ ### [1.4.12](https://github.com/dynamic-labs/DynamicAuth/compare/v1.4.11...v1.4.12) (2024-05-22)
11
+
12
+
13
+ ### Bug Fixes
14
+
15
+ * init ethers web3provider without a network if selected network is unsupported ([#5658](https://github.com/dynamic-labs/DynamicAuth/issues/5658)) ([9973af8](https://github.com/dynamic-labs/DynamicAuth/commit/9973af8fa6bc3f45095f4b830fe480ff2ed58a77))
16
+
2
17
  ### [1.4.11](https://github.com/dynamic-labs/DynamicAuth/compare/v1.4.10...v1.4.11) (2024-04-26)
3
18
 
4
19
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@dynamic-labs/ethers-v6",
3
- "version": "1.4.11",
3
+ "version": "1.4.13",
4
4
  "repository": {
5
5
  "type": "git",
6
6
  "url": "https://github.com/dynamic-labs/DynamicAuth.git",
@@ -30,6 +30,6 @@
30
30
  "ethers": "^6"
31
31
  },
32
32
  "dependencies": {
33
- "@dynamic-labs/wallet-connector-core": "1.4.11"
33
+ "@dynamic-labs/wallet-connector-core": "1.4.13"
34
34
  }
35
35
  }
package/src/ethers-v6.cjs CHANGED
@@ -43,17 +43,21 @@ const EthersExtension = {
43
43
  getWeb3Provider: function () {
44
44
  return _tslib.__awaiter(this, void 0, void 0, function* () {
45
45
  var _a, _b;
46
- const { chain } = yield connector.getPublicClient();
46
+ const publicClient = yield connector.getPublicClient();
47
47
  const walletClient = connector.getWalletClient();
48
48
  const { transport } = walletClient !== null && walletClient !== void 0 ? walletClient : {};
49
49
  if (!transport) {
50
50
  throw new Error('Wallet is not connected, cannot create ethers client');
51
51
  }
52
- const network = {
53
- chainId: chain === null || chain === void 0 ? void 0 : chain.id,
54
- ensAddress: (_b = (_a = chain === null || chain === void 0 ? void 0 : chain.contracts) === null || _a === void 0 ? void 0 : _a.ensRegistry) === null || _b === void 0 ? void 0 : _b.address,
55
- name: chain === null || chain === void 0 ? void 0 : chain.name,
56
- };
52
+ let network;
53
+ if (publicClient) {
54
+ const { chain } = publicClient;
55
+ network = {
56
+ chainId: chain === null || chain === void 0 ? void 0 : chain.id,
57
+ ensAddress: (_b = (_a = chain === null || chain === void 0 ? void 0 : chain.contracts) === null || _a === void 0 ? void 0 : _a.ensRegistry) === null || _b === void 0 ? void 0 : _b.address,
58
+ name: chain === null || chain === void 0 ? void 0 : chain.name,
59
+ };
60
+ }
57
61
  const provider = new ethers6.BrowserProvider(transport, network);
58
62
  return provider;
59
63
  });
package/src/ethers-v6.js CHANGED
@@ -39,17 +39,21 @@ const EthersExtension = {
39
39
  getWeb3Provider: function () {
40
40
  return __awaiter(this, void 0, void 0, function* () {
41
41
  var _a, _b;
42
- const { chain } = yield connector.getPublicClient();
42
+ const publicClient = yield connector.getPublicClient();
43
43
  const walletClient = connector.getWalletClient();
44
44
  const { transport } = walletClient !== null && walletClient !== void 0 ? walletClient : {};
45
45
  if (!transport) {
46
46
  throw new Error('Wallet is not connected, cannot create ethers client');
47
47
  }
48
- const network = {
49
- chainId: chain === null || chain === void 0 ? void 0 : chain.id,
50
- ensAddress: (_b = (_a = chain === null || chain === void 0 ? void 0 : chain.contracts) === null || _a === void 0 ? void 0 : _a.ensRegistry) === null || _b === void 0 ? void 0 : _b.address,
51
- name: chain === null || chain === void 0 ? void 0 : chain.name,
52
- };
48
+ let network;
49
+ if (publicClient) {
50
+ const { chain } = publicClient;
51
+ network = {
52
+ chainId: chain === null || chain === void 0 ? void 0 : chain.id,
53
+ ensAddress: (_b = (_a = chain === null || chain === void 0 ? void 0 : chain.contracts) === null || _a === void 0 ? void 0 : _a.ensRegistry) === null || _b === void 0 ? void 0 : _b.address,
54
+ name: chain === null || chain === void 0 ? void 0 : chain.name,
55
+ };
56
+ }
53
57
  const provider = new BrowserProvider(transport, network);
54
58
  return provider;
55
59
  });