diff --git a/packages/api/src/dto/EstimateUserOperation.dto.ts b/packages/api/src/dto/EstimateUserOperation.dto.ts index c505be9f..ba6fa3d5 100644 --- a/packages/api/src/dto/EstimateUserOperation.dto.ts +++ b/packages/api/src/dto/EstimateUserOperation.dto.ts @@ -2,6 +2,7 @@ import { IsDefined, IsEthereumAddress, IsObject, + IsOptional, IsString, ValidateNested, } from "class-validator"; @@ -20,21 +21,33 @@ export class EstimateUserOperationStruct { initCode!: BytesLike; @IsString() callData!: BytesLike; + @IsString() + signature!: BytesLike; + @IsBigNumber() + @IsOptional() verificationGasLimit?: BigNumberish; + @IsBigNumber() + @IsOptional() preVerificationGas?: BigNumberish; + @IsBigNumber() + @IsOptional() maxFeePerGas?: BigNumberish; + @IsBigNumber() + @IsOptional() maxPriorityFeePerGas?: BigNumberish; + @IsString() @IsCallData() + @IsOptional() paymasterAndData?: BytesLike; - @IsString() - signature!: BytesLike; + @IsBigNumber() - callGasLimit!: BigNumberish; + @IsOptional() + callGasLimit?: BigNumberish; } export class EstimateUserOperationGasArgs { diff --git a/packages/api/src/utils/RpcMethodValidator.ts b/packages/api/src/utils/RpcMethodValidator.ts index 3a609e12..3970fe8b 100644 --- a/packages/api/src/utils/RpcMethodValidator.ts +++ b/packages/api/src/utils/RpcMethodValidator.ts @@ -23,12 +23,15 @@ export function validationFactory( const schema = Reflect.getOwnMetadata(metadataKey, target, propertyName); const errors = await validate(plainToInstance(schema, args[0])); if (errors.length > 0) { - logger.info("Invalid Request", { - data: { - errors, - arguments: args[0], + logger.info( + { + data: { + errors, + arguments: args[0], + }, }, - }); + "Invalid Request" + ); throw new RpcError("Invalid Request", RpcErrorCodes.INVALID_REQUEST); } diff --git a/packages/executor/src/modules/interfaces.ts b/packages/executor/src/modules/interfaces.ts index 164f4c33..de75b50b 100644 --- a/packages/executor/src/modules/interfaces.ts +++ b/packages/executor/src/modules/interfaces.ts @@ -6,13 +6,14 @@ export class EstimateUserOperationStruct { nonce!: BigNumberish; initCode!: BytesLike; callData!: BytesLike; + signature!: BytesLike; + verificationGasLimit?: BigNumberish; preVerificationGas?: BigNumberish; maxFeePerGas?: BigNumberish; maxPriorityFeePerGas?: BigNumberish; paymasterAndData?: BytesLike; - signature!: BytesLike; - callGasLimit!: BigNumberish; + callGasLimit?: BigNumberish; } export class EstimateUserOperationGasArgs {