@latticexyz/entrykit 2.2.22-341fd4962155b3cd2267b0fbd0fc00db35c7d214 → 2.2.22-3baa3fd86f5917471729ba6551f12c17cdca53e3

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.
@@ -141,11 +141,8 @@ var debug2 = debug.extend("quarry");
141
141
 
142
142
  // src/quarry/transports/userOpExecutor.ts
143
143
  import { setBalance } from "viem/actions";
144
- function userOpExecutor({
145
- executor,
146
- fallbackEth
147
- }) {
148
- return (opts) => {
144
+ function userOpExecutor({ executor }) {
145
+ return () => {
149
146
  debug2("using a local user op executor", executor.account.address);
150
147
  if (executor.chain.id === 31337) {
151
148
  debug2("setting executor balance");
@@ -180,9 +177,7 @@ function userOpExecutor({
180
177
  if (method === "eth_estimateUserOperationGas") {
181
178
  return await estimateUserOperationGas(params);
182
179
  }
183
- debug2(`userOpExecutor: method "${method}" not overridden, falling back to fallback transport`);
184
- const { request: fallbackRequest } = fallbackEth(opts);
185
- return fallbackRequest({ method, params });
180
+ throw new Error(`userOpExecutor: method "${method}" not supported`);
186
181
  };
187
182
  return createTransport({
188
183
  key: "userOpExecutor",
@@ -194,41 +189,20 @@ function userOpExecutor({
194
189
  }
195
190
 
196
191
  // src/getBundlerTransport.ts
197
- import { wiresaw } from "@latticexyz/common/internal";
198
192
  function getBundlerTransport(chain) {
199
- const ethRpcUrl = chain.rpcUrls.default.http[0];
200
193
  const bundlerHttpUrl = chain.rpcUrls.bundler?.http[0];
201
- const wiresawWebSocketUrl = chain.rpcUrls.wiresaw?.webSocket?.[0];
202
- if (wiresawWebSocketUrl) {
203
- return wiresaw({
204
- wiresaw: webSocket(wiresawWebSocketUrl),
205
- fallbackBundler: http(bundlerHttpUrl),
206
- fallbackEth: http(ethRpcUrl)
207
- });
208
- }
209
- const wiresawHttpUrl = chain.rpcUrls.wiresaw?.http[0];
210
- if (wiresawHttpUrl) {
211
- return wiresaw({
212
- wiresaw: http(wiresawHttpUrl),
213
- fallbackBundler: http(bundlerHttpUrl),
214
- fallbackEth: http(ethRpcUrl)
215
- });
216
- }
217
- if (bundlerHttpUrl) {
218
- return http(bundlerHttpUrl);
219
- }
220
- if (chain.id === 31337) {
221
- return userOpExecutor({
222
- executor: createClient({
223
- chain,
224
- transport: fallback([webSocket(), http()]),
225
- account: privateKeyToAccount(keccak256(stringToHex("local user op executor"))),
226
- pollingInterval: 10
227
- }).extend(transactionQueue()),
228
- fallbackEth: http(ethRpcUrl)
229
- });
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.`);
230
204
  }
231
- throw new Error(`Chain ${chain.id} config did not include a bundler RPC URL.`);
205
+ return bundlerTransport;
232
206
  }
233
207
 
234
208
  // src/EntryKitConfigProvider.tsx