@wagmi/core 1.3.2-cjs → 1.3.2

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,4 +1,4 @@
1
- "use strict";Object.defineProperty(exports, "__esModule", {value: true});var __accessCheck = (obj, member, msg) => {
1
+ var __accessCheck = (obj, member, msg) => {
2
2
  if (!member.has(obj))
3
3
  throw TypeError("Cannot " + msg);
4
4
  };
@@ -21,9 +21,9 @@ var __privateMethod = (obj, member, method) => {
21
21
  return method;
22
22
  };
23
23
 
24
-
25
-
26
-
27
-
28
-
29
- exports.__privateGet = __privateGet; exports.__privateAdd = __privateAdd; exports.__privateSet = __privateSet; exports.__privateMethod = __privateMethod;
24
+ export {
25
+ __privateGet,
26
+ __privateAdd,
27
+ __privateSet,
28
+ __privateMethod
29
+ };
@@ -1,7 +1,7 @@
1
- "use strict";Object.defineProperty(exports, "__esModule", {value: true});require('../chunk-MQXBDTVK.js');
1
+ import "../chunk-MQXBDTVK.js";
2
2
 
3
3
  // src/connectors/coinbaseWallet.ts
4
- var _coinbaseWallet = require('@wagmi/connectors/coinbaseWallet');
5
-
6
-
7
- exports.CoinbaseWalletConnector = _coinbaseWallet.CoinbaseWalletConnector;
4
+ import { CoinbaseWalletConnector } from "@wagmi/connectors/coinbaseWallet";
5
+ export {
6
+ CoinbaseWalletConnector
7
+ };
@@ -1,9 +1,9 @@
1
- "use strict";Object.defineProperty(exports, "__esModule", {value: true});
2
-
3
-
4
- var _chunkBVC4KGLQjs = require('../chunk-BVC4KGLQ.js');
5
- require('../chunk-MQXBDTVK.js');
6
-
7
-
8
-
9
- exports.Connector = _chunkBVC4KGLQjs.Connector; exports.InjectedConnector = _chunkBVC4KGLQjs.InjectedConnector;
1
+ import {
2
+ Connector,
3
+ InjectedConnector
4
+ } from "../chunk-BVC4KGLQ.js";
5
+ import "../chunk-MQXBDTVK.js";
6
+ export {
7
+ Connector,
8
+ InjectedConnector
9
+ };
@@ -1,7 +1,7 @@
1
- "use strict";Object.defineProperty(exports, "__esModule", {value: true});
2
-
3
- var _chunkEQOEZP46js = require('../chunk-EQOEZP46.js');
4
- require('../chunk-MQXBDTVK.js');
5
-
6
-
7
- exports.InjectedConnector = _chunkEQOEZP46js.InjectedConnector;
1
+ import {
2
+ InjectedConnector
3
+ } from "../chunk-EQOEZP46.js";
4
+ import "../chunk-MQXBDTVK.js";
5
+ export {
6
+ InjectedConnector
7
+ };
@@ -1,7 +1,7 @@
1
- "use strict";Object.defineProperty(exports, "__esModule", {value: true});require('../chunk-MQXBDTVK.js');
1
+ import "../chunk-MQXBDTVK.js";
2
2
 
3
3
  // src/connectors/ledger.ts
4
- var _ledger = require('@wagmi/connectors/ledger');
5
-
6
-
7
- exports.LedgerConnector = _ledger.LedgerConnector;
4
+ import { LedgerConnector } from "@wagmi/connectors/ledger";
5
+ export {
6
+ LedgerConnector
7
+ };
@@ -1,7 +1,7 @@
1
- "use strict";Object.defineProperty(exports, "__esModule", {value: true});require('../chunk-MQXBDTVK.js');
1
+ import "../chunk-MQXBDTVK.js";
2
2
 
3
3
  // src/connectors/metaMask.ts
4
- var _metaMask = require('@wagmi/connectors/metaMask');
5
-
6
-
7
- exports.MetaMaskConnector = _metaMask.MetaMaskConnector;
4
+ import { MetaMaskConnector } from "@wagmi/connectors/metaMask";
5
+ export {
6
+ MetaMaskConnector
7
+ };
@@ -1,9 +1,9 @@
1
- "use strict";Object.defineProperty(exports, "__esModule", {value: true});
2
-
3
-
4
- var _chunkKFW652VNjs = require('../chunk-KFW652VN.js');
5
- require('../chunk-MQXBDTVK.js');
6
-
7
-
8
-
9
- exports.MockConnector = _chunkKFW652VNjs.MockConnector; exports.MockProvider = _chunkKFW652VNjs.MockProvider;
1
+ import {
2
+ MockConnector,
3
+ MockProvider
4
+ } from "../chunk-KFW652VN.js";
5
+ import "../chunk-MQXBDTVK.js";
6
+ export {
7
+ MockConnector,
8
+ MockProvider
9
+ };
@@ -1,7 +1,7 @@
1
- "use strict";Object.defineProperty(exports, "__esModule", {value: true});require('../chunk-MQXBDTVK.js');
1
+ import "../chunk-MQXBDTVK.js";
2
2
 
3
3
  // src/connectors/safe.ts
4
- var _safe = require('@wagmi/connectors/safe');
5
-
6
-
7
- exports.SafeConnector = _safe.SafeConnector;
4
+ import { SafeConnector } from "@wagmi/connectors/safe";
5
+ export {
6
+ SafeConnector
7
+ };
@@ -1,7 +1,7 @@
1
- "use strict";Object.defineProperty(exports, "__esModule", {value: true});require('../chunk-MQXBDTVK.js');
1
+ import "../chunk-MQXBDTVK.js";
2
2
 
3
3
  // src/connectors/walletConnect.ts
4
- var _walletConnect = require('@wagmi/connectors/walletConnect');
5
-
6
-
7
- exports.WalletConnectConnector = _walletConnect.WalletConnectConnector;
4
+ import { WalletConnectConnector } from "@wagmi/connectors/walletConnect";
5
+ export {
6
+ WalletConnectConnector
7
+ };
@@ -1,7 +1,7 @@
1
- "use strict";Object.defineProperty(exports, "__esModule", {value: true});require('../chunk-MQXBDTVK.js');
1
+ import "../chunk-MQXBDTVK.js";
2
2
 
3
3
  // src/connectors/walletConnectLegacy.ts
4
- var _walletConnectLegacy = require('@wagmi/connectors/walletConnectLegacy');
5
-
6
-
7
- exports.WalletConnectLegacyConnector = _walletConnectLegacy.WalletConnectLegacyConnector;
4
+ import { WalletConnectLegacyConnector } from "@wagmi/connectors/walletConnectLegacy";
5
+ export {
6
+ WalletConnectLegacyConnector
7
+ };
package/dist/index.js CHANGED
@@ -1,136 +1,136 @@
1
- "use strict";Object.defineProperty(exports, "__esModule", {value: true});require('./chunk-KX4UEHS5.js');
2
-
3
-
4
-
5
-
6
-
7
-
8
-
9
-
10
-
11
-
12
-
13
-
14
-
15
-
16
-
17
-
18
-
19
-
20
-
21
-
22
-
23
-
24
-
25
-
26
-
27
-
28
-
29
-
30
-
31
-
32
-
33
-
34
-
35
-
36
-
37
-
38
-
39
-
40
-
41
-
42
-
43
-
44
-
45
-
46
-
47
-
48
-
49
-
50
-
51
-
52
-
53
-
54
-
55
-
56
-
57
-
58
-
59
-
60
-
61
- var _chunkLAFZBYO7js = require('./chunk-LAFZBYO7.js');
62
-
63
-
64
-
65
- var _chunkD7TYCC3Tjs = require('./chunk-D7TYCC3T.js');
66
-
67
-
68
- var _chunkBVC4KGLQjs = require('./chunk-BVC4KGLQ.js');
69
-
70
-
71
- var _chunkEQOEZP46js = require('./chunk-EQOEZP46.js');
72
- require('./chunk-MQXBDTVK.js');
73
-
74
-
75
-
76
-
77
-
78
-
79
-
80
-
81
-
82
-
83
-
84
-
85
-
86
-
87
-
88
-
89
-
90
-
91
-
92
-
93
-
94
-
95
-
96
-
97
-
98
-
99
-
100
-
101
-
102
-
103
-
104
-
105
-
106
-
107
-
108
-
109
-
110
-
111
-
112
-
113
-
114
-
115
-
116
-
117
-
118
-
119
-
120
-
121
-
122
-
123
-
124
-
125
-
126
-
127
-
128
-
129
-
130
-
131
-
132
-
133
-
134
-
135
-
136
- exports.ChainMismatchError = _chunkLAFZBYO7js.ChainMismatchError; exports.ChainNotConfiguredError = _chunkLAFZBYO7js.ChainNotConfiguredError; exports.Config = _chunkLAFZBYO7js.Config; exports.ConfigChainsNotFound = _chunkLAFZBYO7js.ConfigChainsNotFound; exports.Connector = _chunkBVC4KGLQjs.Connector; exports.ConnectorAlreadyConnectedError = _chunkLAFZBYO7js.ConnectorAlreadyConnectedError; exports.ConnectorNotFoundError = _chunkLAFZBYO7js.ConnectorNotFoundError; exports.InjectedConnector = _chunkEQOEZP46js.InjectedConnector; exports.SwitchChainNotSupportedError = _chunkLAFZBYO7js.SwitchChainNotSupportedError; exports.configureChains = _chunkLAFZBYO7js.configureChains; exports.connect = _chunkLAFZBYO7js.connect; exports.createConfig = _chunkLAFZBYO7js.createConfig; exports.createStorage = _chunkLAFZBYO7js.createStorage; exports.deepEqual = _chunkLAFZBYO7js.deepEqual; exports.deserialize = _chunkLAFZBYO7js.deserialize; exports.disconnect = _chunkLAFZBYO7js.disconnect; exports.erc20ABI = _chunkLAFZBYO7js.erc20ABI; exports.erc4626ABI = _chunkLAFZBYO7js.erc4626ABI; exports.erc721ABI = _chunkLAFZBYO7js.erc721ABI; exports.fetchBalance = _chunkLAFZBYO7js.fetchBalance; exports.fetchBlockNumber = _chunkLAFZBYO7js.fetchBlockNumber; exports.fetchEnsAddress = _chunkLAFZBYO7js.fetchEnsAddress; exports.fetchEnsAvatar = _chunkLAFZBYO7js.fetchEnsAvatar; exports.fetchEnsName = _chunkLAFZBYO7js.fetchEnsName; exports.fetchEnsResolver = _chunkLAFZBYO7js.fetchEnsResolver; exports.fetchFeeData = _chunkLAFZBYO7js.fetchFeeData; exports.fetchToken = _chunkLAFZBYO7js.fetchToken; exports.fetchTransaction = _chunkLAFZBYO7js.fetchTransaction; exports.getAccount = _chunkLAFZBYO7js.getAccount; exports.getConfig = _chunkLAFZBYO7js.getConfig; exports.getContract = _chunkLAFZBYO7js.getContract; exports.getNetwork = _chunkLAFZBYO7js.getNetwork; exports.getPublicClient = _chunkLAFZBYO7js.getPublicClient; exports.getUnit = _chunkLAFZBYO7js.getUnit; exports.getWalletClient = _chunkLAFZBYO7js.getWalletClient; exports.getWebSocketPublicClient = _chunkLAFZBYO7js.getWebSocketPublicClient; exports.mainnet = _chunkD7TYCC3Tjs.mainnet; exports.multicall = _chunkLAFZBYO7js.multicall; exports.noopStorage = _chunkLAFZBYO7js.noopStorage; exports.prepareSendTransaction = _chunkLAFZBYO7js.prepareSendTransaction; exports.prepareWriteContract = _chunkLAFZBYO7js.prepareWriteContract; exports.readContract = _chunkLAFZBYO7js.readContract; exports.readContracts = _chunkLAFZBYO7js.readContracts; exports.sendTransaction = _chunkLAFZBYO7js.sendTransaction; exports.sepolia = _chunkD7TYCC3Tjs.sepolia; exports.serialize = _chunkLAFZBYO7js.serialize; exports.signMessage = _chunkLAFZBYO7js.signMessage; exports.signTypedData = _chunkLAFZBYO7js.signTypedData; exports.switchNetwork = _chunkLAFZBYO7js.switchNetwork; exports.waitForTransaction = _chunkLAFZBYO7js.waitForTransaction; exports.watchAccount = _chunkLAFZBYO7js.watchAccount; exports.watchBlockNumber = _chunkLAFZBYO7js.watchBlockNumber; exports.watchContractEvent = _chunkLAFZBYO7js.watchContractEvent; exports.watchMulticall = _chunkLAFZBYO7js.watchMulticall; exports.watchNetwork = _chunkLAFZBYO7js.watchNetwork; exports.watchPendingTransactions = _chunkLAFZBYO7js.watchPendingTransactions; exports.watchPublicClient = _chunkLAFZBYO7js.watchPublicClient; exports.watchReadContract = _chunkLAFZBYO7js.watchReadContract; exports.watchReadContracts = _chunkLAFZBYO7js.watchReadContracts; exports.watchWalletClient = _chunkLAFZBYO7js.watchWalletClient; exports.watchWebSocketPublicClient = _chunkLAFZBYO7js.watchWebSocketPublicClient; exports.writeContract = _chunkLAFZBYO7js.writeContract;
1
+ import "./chunk-KX4UEHS5.js";
2
+ import {
3
+ ChainMismatchError,
4
+ ChainNotConfiguredError,
5
+ Config,
6
+ ConfigChainsNotFound,
7
+ ConnectorAlreadyConnectedError,
8
+ ConnectorNotFoundError,
9
+ SwitchChainNotSupportedError,
10
+ configureChains,
11
+ connect,
12
+ createConfig,
13
+ createStorage,
14
+ deepEqual,
15
+ deserialize,
16
+ disconnect,
17
+ erc20ABI,
18
+ erc4626ABI,
19
+ erc721ABI,
20
+ fetchBalance,
21
+ fetchBlockNumber,
22
+ fetchEnsAddress,
23
+ fetchEnsAvatar,
24
+ fetchEnsName,
25
+ fetchEnsResolver,
26
+ fetchFeeData,
27
+ fetchToken,
28
+ fetchTransaction,
29
+ getAccount,
30
+ getConfig,
31
+ getContract,
32
+ getNetwork,
33
+ getPublicClient,
34
+ getUnit,
35
+ getWalletClient,
36
+ getWebSocketPublicClient,
37
+ multicall,
38
+ noopStorage,
39
+ prepareSendTransaction,
40
+ prepareWriteContract,
41
+ readContract,
42
+ readContracts,
43
+ sendTransaction,
44
+ serialize,
45
+ signMessage,
46
+ signTypedData,
47
+ switchNetwork,
48
+ waitForTransaction,
49
+ watchAccount,
50
+ watchBlockNumber,
51
+ watchContractEvent,
52
+ watchMulticall,
53
+ watchNetwork,
54
+ watchPendingTransactions,
55
+ watchPublicClient,
56
+ watchReadContract,
57
+ watchReadContracts,
58
+ watchWalletClient,
59
+ watchWebSocketPublicClient,
60
+ writeContract
61
+ } from "./chunk-LAFZBYO7.js";
62
+ import {
63
+ mainnet,
64
+ sepolia
65
+ } from "./chunk-D7TYCC3T.js";
66
+ import {
67
+ Connector
68
+ } from "./chunk-BVC4KGLQ.js";
69
+ import {
70
+ InjectedConnector
71
+ } from "./chunk-EQOEZP46.js";
72
+ import "./chunk-MQXBDTVK.js";
73
+ export {
74
+ ChainMismatchError,
75
+ ChainNotConfiguredError,
76
+ Config,
77
+ ConfigChainsNotFound,
78
+ Connector,
79
+ ConnectorAlreadyConnectedError,
80
+ ConnectorNotFoundError,
81
+ InjectedConnector,
82
+ SwitchChainNotSupportedError,
83
+ configureChains,
84
+ connect,
85
+ createConfig,
86
+ createStorage,
87
+ deepEqual,
88
+ deserialize,
89
+ disconnect,
90
+ erc20ABI,
91
+ erc4626ABI,
92
+ erc721ABI,
93
+ fetchBalance,
94
+ fetchBlockNumber,
95
+ fetchEnsAddress,
96
+ fetchEnsAvatar,
97
+ fetchEnsName,
98
+ fetchEnsResolver,
99
+ fetchFeeData,
100
+ fetchToken,
101
+ fetchTransaction,
102
+ getAccount,
103
+ getConfig,
104
+ getContract,
105
+ getNetwork,
106
+ getPublicClient,
107
+ getUnit,
108
+ getWalletClient,
109
+ getWebSocketPublicClient,
110
+ mainnet,
111
+ multicall,
112
+ noopStorage,
113
+ prepareSendTransaction,
114
+ prepareWriteContract,
115
+ readContract,
116
+ readContracts,
117
+ sendTransaction,
118
+ sepolia,
119
+ serialize,
120
+ signMessage,
121
+ signTypedData,
122
+ switchNetwork,
123
+ waitForTransaction,
124
+ watchAccount,
125
+ watchBlockNumber,
126
+ watchContractEvent,
127
+ watchMulticall,
128
+ watchNetwork,
129
+ watchPendingTransactions,
130
+ watchPublicClient,
131
+ watchReadContract,
132
+ watchReadContracts,
133
+ watchWalletClient,
134
+ watchWebSocketPublicClient,
135
+ writeContract
136
+ };
@@ -1,10 +1,10 @@
1
- "use strict";Object.defineProperty(exports, "__esModule", {value: true});
2
-
3
-
4
- var _chunkLAFZBYO7js = require('../chunk-LAFZBYO7.js');
5
- require('../chunk-BVC4KGLQ.js');
6
- require('../chunk-MQXBDTVK.js');
7
-
8
-
9
-
10
- exports.getCallParameters = _chunkLAFZBYO7js.getCallParameters; exports.getSendTransactionParameters = _chunkLAFZBYO7js.getSendTransactionParameters;
1
+ import {
2
+ getCallParameters,
3
+ getSendTransactionParameters
4
+ } from "../chunk-LAFZBYO7.js";
5
+ import "../chunk-BVC4KGLQ.js";
6
+ import "../chunk-MQXBDTVK.js";
7
+ export {
8
+ getCallParameters,
9
+ getSendTransactionParameters
10
+ };
@@ -1,42 +1,42 @@
1
- "use strict";Object.defineProperty(exports, "__esModule", {value: true}); function _nullishCoalesce(lhs, rhsFn) { if (lhs != null) { return lhs; } else { return rhsFn(); } }require('../chunk-KX4UEHS5.js');
2
- require('../chunk-LAFZBYO7.js');
3
-
4
-
5
-
6
-
7
-
8
-
9
- var _chunkD7TYCC3Tjs = require('../chunk-D7TYCC3T.js');
10
- require('../chunk-BVC4KGLQ.js');
11
- require('../chunk-EQOEZP46.js');
12
- require('../chunk-KFW652VN.js');
13
- require('../chunk-MQXBDTVK.js');
1
+ import "../chunk-KX4UEHS5.js";
2
+ import "../chunk-LAFZBYO7.js";
3
+ import {
4
+ foundry,
5
+ goerli,
6
+ mainnet,
7
+ optimism,
8
+ polygon
9
+ } from "../chunk-D7TYCC3T.js";
10
+ import "../chunk-BVC4KGLQ.js";
11
+ import "../chunk-EQOEZP46.js";
12
+ import "../chunk-KFW652VN.js";
13
+ import "../chunk-MQXBDTVK.js";
14
14
 
15
15
  // test/utils.ts
16
- var _viem = require('viem');
17
-
18
-
19
-
20
-
21
-
22
-
23
-
24
- var _accounts = require('viem/accounts');
25
- var _utils = require('viem/utils');
16
+ import { RpcRequestError } from "viem";
17
+ import {
18
+ createPublicClient,
19
+ createWalletClient,
20
+ custom,
21
+ http,
22
+ webSocket
23
+ } from "viem";
24
+ import { privateKeyToAccount } from "viem/accounts";
25
+ import { rpc } from "viem/utils";
26
26
  var foundryMainnet = {
27
- ..._chunkD7TYCC3Tjs.mainnet,
28
- rpcUrls: _chunkD7TYCC3Tjs.foundry.rpcUrls
27
+ ...mainnet,
28
+ rpcUrls: foundry.rpcUrls
29
29
  };
30
- var testChains = [foundryMainnet, _chunkD7TYCC3Tjs.mainnet, _chunkD7TYCC3Tjs.goerli, _chunkD7TYCC3Tjs.optimism, _chunkD7TYCC3Tjs.polygon];
30
+ var testChains = [foundryMainnet, mainnet, goerli, optimism, polygon];
31
31
  function getPublicClient({
32
32
  chains = testChains,
33
33
  chainId
34
34
  } = {}) {
35
- const chain = _nullishCoalesce(chains.find((x) => x.id === chainId), () => ( foundryMainnet));
35
+ const chain = chains.find((x) => x.id === chainId) ?? foundryMainnet;
36
36
  const url = foundryMainnet.rpcUrls.default.http[0];
37
- const publicClient = _viem.createPublicClient.call(void 0, {
37
+ const publicClient = createPublicClient({
38
38
  chain,
39
- transport: _viem.http.call(void 0, url),
39
+ transport: http(url),
40
40
  pollingInterval: 1e3
41
41
  });
42
42
  return Object.assign(publicClient, {
@@ -140,11 +140,11 @@ function getWalletClients() {
140
140
  method,
141
141
  params
142
142
  };
143
- const { result, error } = await _utils.rpc.http(url, {
143
+ const { result, error } = await rpc.http(url, {
144
144
  body
145
145
  });
146
146
  if (error) {
147
- throw new (0, _viem.RpcRequestError)({
147
+ throw new RpcRequestError({
148
148
  body,
149
149
  error,
150
150
  url
@@ -153,14 +153,14 @@ function getWalletClients() {
153
153
  return result;
154
154
  };
155
155
  return accounts.map(
156
- (x) => _viem.createWalletClient.call(void 0, {
157
- account: _accounts.privateKeyToAccount.call(void 0, x.privateKey).address,
156
+ (x) => createWalletClient({
157
+ account: privateKeyToAccount(x.privateKey).address,
158
158
  chain: publicClient.chain,
159
- transport: _viem.custom.call(void 0, publicClient)
159
+ transport: custom(publicClient)
160
160
  })
161
161
  );
162
162
  }
163
-
164
-
165
-
166
- exports.getWalletClients = getWalletClients; exports.testChains = testChains;
163
+ export {
164
+ getWalletClients,
165
+ testChains
166
+ };
@@ -1,12 +1,12 @@
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');
1
+ import "../chunk-MQXBDTVK.js";
2
2
 
3
3
  // src/providers/alchemy.ts
4
4
  function alchemyProvider({
5
5
  apiKey
6
6
  }) {
7
7
  return function(chain) {
8
- const baseHttpUrl = _optionalChain([chain, 'access', _ => _.rpcUrls, 'access', _2 => _2.alchemy, 'optionalAccess', _3 => _3.http, 'access', _4 => _4[0]]);
9
- const baseWsUrl = _optionalChain([chain, 'access', _5 => _5.rpcUrls, 'access', _6 => _6.alchemy, 'optionalAccess', _7 => _7.webSocket, 'optionalAccess', _8 => _8[0]]);
8
+ const baseHttpUrl = chain.rpcUrls.alchemy?.http[0];
9
+ const baseWsUrl = chain.rpcUrls.alchemy?.webSocket?.[0];
10
10
  if (!baseHttpUrl)
11
11
  return null;
12
12
  return {
@@ -24,6 +24,6 @@ function alchemyProvider({
24
24
  };
25
25
  };
26
26
  }
27
-
28
-
29
- exports.alchemyProvider = alchemyProvider;
27
+ export {
28
+ alchemyProvider
29
+ };
@@ -1,12 +1,12 @@
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');
1
+ import "../chunk-MQXBDTVK.js";
2
2
 
3
3
  // src/providers/infura.ts
4
4
  function infuraProvider({
5
5
  apiKey
6
6
  }) {
7
7
  return function(chain) {
8
- const baseHttpUrl = _optionalChain([chain, 'access', _ => _.rpcUrls, 'access', _2 => _2.infura, 'optionalAccess', _3 => _3.http, 'access', _4 => _4[0]]);
9
- const baseWsUrl = _optionalChain([chain, 'access', _5 => _5.rpcUrls, 'access', _6 => _6.infura, 'optionalAccess', _7 => _7.webSocket, 'optionalAccess', _8 => _8[0]]);
8
+ const baseHttpUrl = chain.rpcUrls.infura?.http[0];
9
+ const baseWsUrl = chain.rpcUrls.infura?.webSocket?.[0];
10
10
  if (!baseHttpUrl)
11
11
  return null;
12
12
  return {
@@ -24,6 +24,6 @@ function infuraProvider({
24
24
  };
25
25
  };
26
26
  }
27
-
28
-
29
- exports.infuraProvider = infuraProvider;
27
+ export {
28
+ infuraProvider
29
+ };
@@ -1,4 +1,4 @@
1
- "use strict";Object.defineProperty(exports, "__esModule", {value: true});require('../chunk-MQXBDTVK.js');
1
+ import "../chunk-MQXBDTVK.js";
2
2
 
3
3
  // src/providers/jsonRpc.ts
4
4
  function jsonRpcProvider({
@@ -23,6 +23,6 @@ function jsonRpcProvider({
23
23
  };
24
24
  };
25
25
  }
26
-
27
-
28
- exports.jsonRpcProvider = jsonRpcProvider;
26
+ export {
27
+ jsonRpcProvider
28
+ };
@@ -1,4 +1,4 @@
1
- "use strict";Object.defineProperty(exports, "__esModule", {value: true});require('../chunk-MQXBDTVK.js');
1
+ import "../chunk-MQXBDTVK.js";
2
2
 
3
3
  // src/providers/public.ts
4
4
  function publicProvider() {
@@ -11,6 +11,6 @@ function publicProvider() {
11
11
  };
12
12
  };
13
13
  }
14
-
15
-
16
- exports.publicProvider = publicProvider;
14
+ export {
15
+ publicProvider
16
+ };
package/dist/window.js CHANGED
@@ -1 +0,0 @@
1
- "use strict";