Skip to content

Commit

Permalink
update user op endpoint, fake the receipt
Browse files Browse the repository at this point in the history
  • Loading branch information
holic committed Oct 18, 2024
1 parent beb8d1d commit c0b663d
Showing 1 changed file with 9 additions and 5 deletions.
14 changes: 9 additions & 5 deletions packages/entrykit/src/wiresaw.ts
Original file line number Diff line number Diff line change
Expand Up @@ -48,12 +48,16 @@ export function wiresaw<const transport extends Transport>(originalTransport: tr

if (req.method === "eth_sendUserOperation") {
// TODO: type `request` so we don't have to cast
const result = await originalRequest({
const result = (await originalRequest({
...req,
method: "pimlico_sendUserOperationNow",
});
// eslint-disable-next-line @typescript-eslint/no-explicit-any
return (result as any).userOpHash;
method: "wiresaw_sendUserOperation",
})) as { txHash: Hex; userOpHash: Hex };
// :haroldsmile:
receipts.set(result.userOpHash, {
userOpHash: result.userOpHash,
receipt: { transactionHash: result.txHash },
} as UserOperationReceipt);
return result.userOpHash;
}

if (req.method === "eth_getUserOperationReceipt") {
Expand Down

0 comments on commit c0b663d

Please sign in to comment.