@dynamic-labs/wagmi-connector 0.17.7 → 0.17.9

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
+ ### [0.17.9](https://github.com/dynamic-labs/DynamicAuth/compare/v0.17.8...v0.17.9) (2023-06-21)
3
+
4
+
5
+ ### Bug Fixes
6
+
7
+ * **balance:** normalize matic addresses to show balance ([#2385](https://github.com/dynamic-labs/DynamicAuth/issues/2385)) ([#2398](https://github.com/dynamic-labs/DynamicAuth/issues/2398)) ([8afd0a7](https://github.com/dynamic-labs/DynamicAuth/commit/8afd0a7773c962ece4b6fbb6988587a45c4b64d7))
8
+ * **wagmi-connector:** use private custom rpc if available ([#2380](https://github.com/dynamic-labs/DynamicAuth/issues/2380)) ([#2397](https://github.com/dynamic-labs/DynamicAuth/issues/2397)) ([0bf1d17](https://github.com/dynamic-labs/DynamicAuth/commit/0bf1d17705b097d25c75af25e27252a28c593ff9))
9
+
10
+ ### [0.17.8](https://github.com/dynamic-labs/DynamicAuth/compare/v0.17.7...v0.17.8) (2023-06-20)
11
+
12
+
13
+ ### Bug Fixes
14
+
15
+ * remove process variable declaration ([#2390](https://github.com/dynamic-labs/DynamicAuth/issues/2390)) ([41cfba3](https://github.com/dynamic-labs/DynamicAuth/commit/41cfba321513a76b01a6f2b6130b8568cf5afac7))
16
+
2
17
  ### [0.17.7](https://github.com/dynamic-labs/DynamicAuth/compare/v0.17.6...v0.17.7) (2023-06-16)
3
18
 
4
19
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@dynamic-labs/wagmi-connector",
3
- "version": "0.17.7",
3
+ "version": "0.17.9",
4
4
  "repository": {
5
5
  "type": "git",
6
6
  "url": "https://github.com/dynamic-labs/DynamicAuth.git",
@@ -11,9 +11,9 @@
11
11
  "react": "^17.0.2 || ^18.0.0",
12
12
  "ethers": "5.7.2",
13
13
  "wagmi": "~0.12.13",
14
- "@dynamic-labs/sdk-react-core": "0.17.7",
15
- "@dynamic-labs/types": "0.17.7",
16
- "@dynamic-labs/wallet-connector-core": "0.17.7"
14
+ "@dynamic-labs/sdk-react-core": "0.17.9",
15
+ "@dynamic-labs/types": "0.17.9",
16
+ "@dynamic-labs/wallet-connector-core": "0.17.9"
17
17
  },
18
18
  "license": "MIT",
19
19
  "main": "./src/index.cjs",
@@ -1,4 +1,5 @@
1
1
  import * as allChains from 'wagmi/chains';
2
+ import { resolveRpcUrlFromEvmNetworks } from '../utils/resolveRpcUrlFromEvmNetworks/resolveRpcUrlFromEvmNetworks.js';
2
3
 
3
4
  // eslint-disable-next-line import/no-namespace
4
5
  const findRpcProvider = (rpcUrls, privateCustomerRpcUrls, name) => {
@@ -22,12 +23,13 @@ const findRpcProvider = (rpcUrls, privateCustomerRpcUrls, name) => {
22
23
  };
23
24
  const mapDynamicChainToWagmi = (dynamicChain) => {
24
25
  var _a, _b, _c, _d, _e, _f, _g, _h, _j;
26
+ const rpcUrlResolved = resolveRpcUrlFromEvmNetworks(dynamicChain);
25
27
  const rpcUrls = {
26
28
  default: {
27
- http: dynamicChain.rpcUrls,
29
+ http: rpcUrlResolved,
28
30
  },
29
31
  public: {
30
- http: dynamicChain.rpcUrls,
32
+ http: rpcUrlResolved,
31
33
  },
32
34
  };
33
35
  const rpcUrlProviders = ['alchemy', 'infura'];
@@ -0,0 +1 @@
1
+ export * from './resolveRpcUrlFromEvmNetworks';
@@ -0,0 +1 @@
1
+ export { resolveRpcUrlFromEvmNetworks } from './resolveRpcUrlFromEvmNetworks';
@@ -0,0 +1,2 @@
1
+ import { WagmiEvmNetworks } from '../../types';
2
+ export declare const resolveRpcUrlFromEvmNetworks: (dynamicChain: WagmiEvmNetworks) => string[];
@@ -0,0 +1,9 @@
1
+ const mapCustomProviderOptionsToString = (rpcUrl) => (typeof rpcUrl === 'string' ? rpcUrl : rpcUrl.http);
2
+ const resolveRpcUrlFromEvmNetworks = (dynamicChain) => {
3
+ var _a;
4
+ const privateCustomerRpcUrls = (_a = dynamicChain.privateCustomerRpcUrls) !== null && _a !== void 0 ? _a : [];
5
+ const customerRpcUrls = privateCustomerRpcUrls.map(mapCustomProviderOptionsToString);
6
+ return customerRpcUrls.length ? customerRpcUrls : dynamicChain.rpcUrls;
7
+ };
8
+
9
+ export { resolveRpcUrlFromEvmNetworks };