@latticexyz/entrykit 2.2.22-5669ab13e650f496a60c780983866778ae8943a3 → 2.2.22-5f0b4d10731aa3b4c1f5bb872d4571e4dd3b4aa3

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.
@@ -189,40 +189,20 @@ function userOpExecutor({ executor }) {
189
189
  }
190
190
 
191
191
  // src/getBundlerTransport.ts
192
- import { wiresaw } from "@latticexyz/common/internal";
193
192
  function getBundlerTransport(chain) {
194
- const ethRpcUrl = chain.rpcUrls.default.http[0];
195
193
  const bundlerHttpUrl = chain.rpcUrls.bundler?.http[0];
196
- const wiresawWebSocketUrl = chain.rpcUrls.wiresaw?.webSocket?.[0];
197
- if (wiresawWebSocketUrl) {
198
- return wiresaw({
199
- wiresaw: webSocket(wiresawWebSocketUrl),
200
- fallbackBundler: http(bundlerHttpUrl),
201
- fallbackEth: http(ethRpcUrl)
202
- });
203
- }
204
- const wiresawHttpUrl = chain.rpcUrls.wiresaw?.http[0];
205
- if (wiresawHttpUrl) {
206
- return wiresaw({
207
- wiresaw: http(wiresawHttpUrl),
208
- fallbackBundler: http(bundlerHttpUrl),
209
- fallbackEth: http(ethRpcUrl)
210
- });
211
- }
212
- if (bundlerHttpUrl) {
213
- return http(bundlerHttpUrl);
214
- }
215
- if (chain.id === 31337) {
216
- return userOpExecutor({
217
- executor: createClient({
218
- chain,
219
- transport: fallback([webSocket(), http()]),
220
- account: privateKeyToAccount(keccak256(stringToHex("local user op executor"))),
221
- pollingInterval: 10
222
- }).extend(transactionQueue())
223
- });
194
+ const bundlerTransport = bundlerHttpUrl ? http(bundlerHttpUrl) : chain.id === 31337 ? userOpExecutor({
195
+ executor: createClient({
196
+ chain,
197
+ transport: fallback([webSocket(), http()]),
198
+ account: privateKeyToAccount(keccak256(stringToHex("local user op executor"))),
199
+ pollingInterval: 10
200
+ }).extend(transactionQueue())
201
+ }) : null;
202
+ if (!bundlerTransport) {
203
+ throw new Error(`Chain ${chain.id} config did not include a bundler RPC URL.`);
224
204
  }
225
- throw new Error(`Chain ${chain.id} config did not include a bundler RPC URL.`);
205
+ return bundlerTransport;
226
206
  }
227
207
 
228
208
  // src/EntryKitConfigProvider.tsx