UNPKG

@tunghm/relay-kit

Version:

SDK for Safe Smart Accounts with support for ERC-4337 and Relay

34 lines 1.82 kB
import { EstimateGasData, SafeOperation, SafeOperationOptions, SafeSignature, SafeUserOperation, UserOperation } from '@safe-global/types-kit'; import { GasAdjustments } from '../../packs/safe-4337/types'; import { EIP712_SAFE_OPERATION_TYPE_V06, EIP712_SAFE_OPERATION_TYPE_V07 } from '../../packs/safe-4337/constants'; declare abstract class BaseSafeOperation implements SafeOperation { userOperation: UserOperation; options: SafeOperationOptions; signatures: Map<string, SafeSignature>; constructor(userOperation: UserOperation, options: SafeOperationOptions); abstract addEstimations(estimations: EstimateGasData): void; /** * Adjusts gas values by adding a percentage to each specified field. * @param adjustments - Object containing percentage adjustments for each gas field * @example * // Increase verificationGasLimit by 50% and callGasLimit by 30% * safeOperation.adjustEstimations({ verificationGasLimit: 50, callGasLimit: 30 }) */ abstract adjustEstimations(adjustments: GasAdjustments): void; /** * Helper to apply percentage increase to a bigint value. * @param value - The original value * @param percentage - The percentage to add (e.g., 50 means +50%) * @returns The adjusted value */ protected applyPercentageIncrease(value: bigint, percentage: number): bigint; abstract getSafeOperation(): SafeUserOperation; getSignature(signer: string): SafeSignature | undefined; addSignature(signature: SafeSignature): void; encodedSignatures(): string; getUserOperation(): UserOperation; getHash(): string; abstract getEIP712Type(): typeof EIP712_SAFE_OPERATION_TYPE_V06 | typeof EIP712_SAFE_OPERATION_TYPE_V07; } export default BaseSafeOperation; //# sourceMappingURL=BaseSafeOperation.d.ts.map