@latticexyz/entrykit 2.2.22-bd9e19b10418c4a0b8b3791e713d798b8df64a38 → 2.2.22-c6d50216477653deec25be867619a65bff768f4f
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,20 +189,40 @@ function userOpExecutor({ executor }) {
|
|
|
189
189
|
}
|
|
190
190
|
|
|
191
191
|
// src/getBundlerTransport.ts
|
|
192
|
+
import { wiresaw } from "@latticexyz/common/internal";
|
|
192
193
|
function getBundlerTransport(chain) {
|
|
194
|
+
const ethRpcUrl = chain.rpcUrls.default.http[0];
|
|
193
195
|
const bundlerHttpUrl = chain.rpcUrls.bundler?.http[0];
|
|
194
|
-
const
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
})
|
|
201
|
-
}
|
|
202
|
-
|
|
203
|
-
|
|
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
|
+
});
|
|
204
224
|
}
|
|
205
|
-
|
|
225
|
+
throw new Error(`Chain ${chain.id} config did not include a bundler RPC URL.`);
|
|
206
226
|
}
|
|
207
227
|
|
|
208
228
|
// src/EntryKitConfigProvider.tsx
|