@latticexyz/entrykit 2.2.22-8fad4be6941d39fe86b3f0100a04642670ff266a → 2.2.22-91837e36ade680787d224691c848540fea793a5a
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.
|
@@ -139,8 +139,11 @@ var debug2 = debug.extend("quarry");
|
|
|
139
139
|
|
|
140
140
|
// src/quarry/transports/userOpExecutor.ts
|
|
141
141
|
import { setBalance } from "viem/actions";
|
|
142
|
-
function userOpExecutor({
|
|
143
|
-
|
|
142
|
+
function userOpExecutor({
|
|
143
|
+
executor,
|
|
144
|
+
fallbackDefaultTransport
|
|
145
|
+
}) {
|
|
146
|
+
return (opts) => {
|
|
144
147
|
debug2("using a local user op executor", executor.account.address);
|
|
145
148
|
if (executor.chain.id === 31337) {
|
|
146
149
|
debug2("setting executor balance");
|
|
@@ -175,7 +178,9 @@ function userOpExecutor({ executor }) {
|
|
|
175
178
|
if (method === "eth_estimateUserOperationGas") {
|
|
176
179
|
return await estimateUserOperationGas(params);
|
|
177
180
|
}
|
|
178
|
-
|
|
181
|
+
debug2(`userOpExecutor: method "${method}" not overridden, falling back to fallback transport`);
|
|
182
|
+
const { request: fallbackRequest } = fallbackDefaultTransport(opts);
|
|
183
|
+
return fallbackRequest({ method, params });
|
|
179
184
|
};
|
|
180
185
|
return createTransport({
|
|
181
186
|
key: "userOpExecutor",
|
|
@@ -187,20 +192,27 @@ function userOpExecutor({ executor }) {
|
|
|
187
192
|
}
|
|
188
193
|
|
|
189
194
|
// src/getBundlerTransport.ts
|
|
195
|
+
import { wiresaw } from "@latticexyz/common/internal";
|
|
190
196
|
function getBundlerTransport(chain) {
|
|
197
|
+
if ("wiresaw" in chain.rpcUrls) {
|
|
198
|
+
return wiresaw();
|
|
199
|
+
}
|
|
191
200
|
const bundlerHttpUrl = chain.rpcUrls.bundler?.http[0];
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
201
|
+
if (bundlerHttpUrl) {
|
|
202
|
+
return http(bundlerHttpUrl);
|
|
203
|
+
}
|
|
204
|
+
if (chain.id === 31337) {
|
|
205
|
+
return userOpExecutor({
|
|
206
|
+
executor: createClient({
|
|
207
|
+
chain,
|
|
208
|
+
transport: fallback([webSocket(), http()]),
|
|
209
|
+
account: privateKeyToAccount(keccak256(stringToHex("local user op executor"))),
|
|
210
|
+
pollingInterval: 10
|
|
211
|
+
}).extend(transactionQueue()),
|
|
212
|
+
fallbackDefaultTransport: http()
|
|
213
|
+
});
|
|
202
214
|
}
|
|
203
|
-
|
|
215
|
+
throw new Error(`Chain ${chain.id} config did not include a bundler RPC URL.`);
|
|
204
216
|
}
|
|
205
217
|
|
|
206
218
|
// src/EntryKitConfigProvider.tsx
|