@owlprotocol/contracts-account-abstraction
Version:
ERC4337 Account Abstraction support for deploying relevant smart contracts and interacting with UserOps.
34 lines (29 loc) • 853 B
text/typescript
import { Hex } from "viem";
import { z } from "zod";
// hexnum regex
const hexPattern = /^0x[0-9a-f]*$/;
export const executionResultSchemaV07 = z
.tuple([
z.bigint(),
z.bigint(),
z.bigint(),
z.bigint(),
z.bigint(),
z.bigint(),
z.boolean(),
z.string().regex(hexPattern),
])
.transform((val) => {
return {
preOpGas: val[0],
paid: val[1],
validationData: val[2],
paymasterValidationData: val[3],
paymasterVerificationGasLimit: val[4],
paymasterPostOpGasLimit: val[5],
targetSuccess: val[6],
targetResult: val[7] as Hex,
};
});
export const executionResultSchema = executionResultSchemaV07;
export type ExecutionResult = z.infer<typeof executionResultSchema>;