@wagmi/core 0.8.17 → 0.8.18-cjs

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.
@@ -1,7 +1,7 @@
1
- import "../chunk-MQXBDTVK.js";
1
+ "use strict";Object.defineProperty(exports, "__esModule", {value: true}); function _optionalChain(ops) { let lastAccessLHS = undefined; let value = ops[0]; let i = 1; while (i < ops.length) { const op = ops[i]; const fn = ops[i + 1]; i += 2; if ((op === 'optionalAccess' || op === 'optionalCall') && value == null) { return undefined; } if (op === 'access' || op === 'optionalAccess') { lastAccessLHS = value; value = fn(value); } else if (op === 'call' || op === 'optionalCall') { value = fn((...args) => value.call(lastAccessLHS, ...args)); lastAccessLHS = undefined; } } return value; }require('../chunk-MQXBDTVK.js');
2
2
 
3
3
  // src/providers/infura.ts
4
- import { providers } from "ethers";
4
+ var _ethers = require('ethers');
5
5
  function infuraProvider({
6
6
  apiKey,
7
7
  priority,
@@ -9,38 +9,38 @@ function infuraProvider({
9
9
  weight
10
10
  }) {
11
11
  return function(chain) {
12
- if (!chain.rpcUrls.infura?.http[0])
12
+ if (!_optionalChain([chain, 'access', _ => _.rpcUrls, 'access', _2 => _2.infura, 'optionalAccess', _3 => _3.http, 'access', _4 => _4[0]]))
13
13
  return null;
14
14
  return {
15
15
  chain: {
16
16
  ...chain,
17
17
  rpcUrls: {
18
18
  ...chain.rpcUrls,
19
- default: { http: [`${chain.rpcUrls.infura?.http[0]}/${apiKey}`] }
19
+ default: { http: [`${_optionalChain([chain, 'access', _5 => _5.rpcUrls, 'access', _6 => _6.infura, 'optionalAccess', _7 => _7.http, 'access', _8 => _8[0]])}/${apiKey}`] }
20
20
  }
21
21
  },
22
22
  provider: () => {
23
- const provider = new providers.InfuraProvider(
23
+ const provider = new _ethers.providers.InfuraProvider(
24
24
  {
25
25
  chainId: chain.id,
26
26
  name: chain.network,
27
- ensAddress: chain.contracts?.ensRegistry?.address
27
+ ensAddress: _optionalChain([chain, 'access', _9 => _9.contracts, 'optionalAccess', _10 => _10.ensRegistry, 'optionalAccess', _11 => _11.address])
28
28
  },
29
29
  apiKey
30
30
  );
31
31
  return Object.assign(provider, { priority, stallTimeout, weight });
32
32
  },
33
- webSocketProvider: () => new providers.InfuraWebSocketProvider(
33
+ webSocketProvider: () => new _ethers.providers.InfuraWebSocketProvider(
34
34
  {
35
35
  chainId: chain.id,
36
36
  name: chain.network,
37
- ensAddress: chain.contracts?.ensRegistry?.address
37
+ ensAddress: _optionalChain([chain, 'access', _12 => _12.contracts, 'optionalAccess', _13 => _13.ensRegistry, 'optionalAccess', _14 => _14.address])
38
38
  },
39
39
  apiKey
40
40
  )
41
41
  };
42
42
  };
43
43
  }
44
- export {
45
- infuraProvider
46
- };
44
+
45
+
46
+ exports.infuraProvider = infuraProvider;
@@ -1,7 +1,7 @@
1
- import "../chunk-MQXBDTVK.js";
1
+ "use strict";Object.defineProperty(exports, "__esModule", {value: true}); function _optionalChain(ops) { let lastAccessLHS = undefined; let value = ops[0]; let i = 1; while (i < ops.length) { const op = ops[i]; const fn = ops[i + 1]; i += 2; if ((op === 'optionalAccess' || op === 'optionalCall') && value == null) { return undefined; } if (op === 'access' || op === 'optionalAccess') { lastAccessLHS = value; value = fn(value); } else if (op === 'call' || op === 'optionalCall') { value = fn((...args) => value.call(lastAccessLHS, ...args)); lastAccessLHS = undefined; } } return value; }require('../chunk-MQXBDTVK.js');
2
2
 
3
3
  // src/providers/jsonRpc.ts
4
- import { providers } from "ethers";
4
+ var _ethers = require('ethers');
5
5
  function jsonRpcProvider({
6
6
  priority,
7
7
  rpc,
@@ -22,16 +22,16 @@ function jsonRpcProvider({
22
22
  }
23
23
  },
24
24
  provider: () => {
25
- const RpcProvider = static_ ? providers.StaticJsonRpcProvider : providers.JsonRpcProvider;
25
+ const RpcProvider = static_ ? _ethers.providers.StaticJsonRpcProvider : _ethers.providers.JsonRpcProvider;
26
26
  const provider = new RpcProvider(rpcConfig.http, {
27
- ensAddress: chain.contracts?.ensRegistry?.address,
27
+ ensAddress: _optionalChain([chain, 'access', _ => _.contracts, 'optionalAccess', _2 => _2.ensRegistry, 'optionalAccess', _3 => _3.address]),
28
28
  chainId: chain.id,
29
29
  name: chain.network
30
30
  });
31
31
  return Object.assign(provider, { priority, stallTimeout, weight });
32
32
  },
33
33
  ...rpcConfig.webSocket && {
34
- webSocketProvider: () => new providers.WebSocketProvider(
34
+ webSocketProvider: () => new _ethers.providers.WebSocketProvider(
35
35
  rpcConfig.webSocket,
36
36
  chain.id
37
37
  )
@@ -39,6 +39,6 @@ function jsonRpcProvider({
39
39
  };
40
40
  };
41
41
  }
42
- export {
43
- jsonRpcProvider
44
- };
42
+
43
+
44
+ exports.jsonRpcProvider = jsonRpcProvider;
@@ -1,7 +1,7 @@
1
- import "../chunk-MQXBDTVK.js";
1
+ "use strict";Object.defineProperty(exports, "__esModule", {value: true}); function _optionalChain(ops) { let lastAccessLHS = undefined; let value = ops[0]; let i = 1; while (i < ops.length) { const op = ops[i]; const fn = ops[i + 1]; i += 2; if ((op === 'optionalAccess' || op === 'optionalCall') && value == null) { return undefined; } if (op === 'access' || op === 'optionalAccess') { lastAccessLHS = value; value = fn(value); } else if (op === 'call' || op === 'optionalCall') { value = fn((...args) => value.call(lastAccessLHS, ...args)); lastAccessLHS = undefined; } } return value; }require('../chunk-MQXBDTVK.js');
2
2
 
3
3
  // src/providers/public.ts
4
- import { providers } from "ethers";
4
+ var _ethers = require('ethers');
5
5
  function publicProvider({
6
6
  priority,
7
7
  stallTimeout,
@@ -13,12 +13,12 @@ function publicProvider({
13
13
  return {
14
14
  chain,
15
15
  provider: () => {
16
- const provider = new providers.StaticJsonRpcProvider(
16
+ const provider = new _ethers.providers.StaticJsonRpcProvider(
17
17
  chain.rpcUrls.default.http[0],
18
18
  {
19
19
  chainId: chain.id,
20
20
  name: chain.network,
21
- ensAddress: chain.contracts?.ensRegistry?.address
21
+ ensAddress: _optionalChain([chain, 'access', _ => _.contracts, 'optionalAccess', _2 => _2.ensRegistry, 'optionalAccess', _3 => _3.address])
22
22
  }
23
23
  );
24
24
  return Object.assign(provider, { priority, stallTimeout, weight });
@@ -26,6 +26,6 @@ function publicProvider({
26
26
  };
27
27
  };
28
28
  }
29
- export {
30
- publicProvider
31
- };
29
+
30
+
31
+ exports.publicProvider = publicProvider;
package/package.json CHANGED
@@ -2,7 +2,7 @@
2
2
  "name": "@wagmi/core",
3
3
  "description": "Vanilla JS library for Ethereum",
4
4
  "license": "MIT",
5
- "version": "0.8.17",
5
+ "version": "0.8.18-cjs",
6
6
  "repository": {
7
7
  "type": "git",
8
8
  "url": "https://github.com/wagmi-dev/wagmi.git",
@@ -23,7 +23,6 @@
23
23
  "url": "https://github.com/sponsors/wagmi-dev"
24
24
  }
25
25
  ],
26
- "type": "module",
27
26
  "main": "dist/index.js",
28
27
  "types": "dist/index.d.ts",
29
28
  "exports": {
@@ -111,11 +110,11 @@
111
110
  }
112
111
  },
113
112
  "dependencies": {
113
+ "@wagmi/chains": "0.1.13-cjs",
114
+ "@wagmi/connectors": "0.1.9-cjs",
114
115
  "abitype": "^0.2.5",
115
116
  "eventemitter3": "^4.0.7",
116
- "zustand": "^4.3.1",
117
- "@wagmi/chains": "0.1.12",
118
- "@wagmi/connectors": "0.1.9"
117
+ "zustand": "^4.3.1"
119
118
  },
120
119
  "devDependencies": {
121
120
  "@coinbase/wallet-sdk": "^3.6.0",