/**
 * Kernel revert decoding.
 *
 * The deployed SailKernel reverts with custom errors (4-byte selectors). viem
 * cannot name them unless the error fragments are present in the ABI it was
 * given, so by default a dispatch failure surfaces as an opaque selector like
 * `0xeb6942f1`. This module ships the full set of kernel error fragments (the
 * UNION of the currently-deployed and latest-source versions) plus a decoder
 * that turns a raw revert into a named, human-readable diagnosis with a hint at
 * the likely cause and fix.
 */
import { type Abi, type Hex } from "viem";
/**
 * Human-readable signatures for every custom error the SailKernel can revert
 * with, across deployed and latest-source versions. Used purely for decoding —
 * unknown selectors simply fail to match and fall through to `null`.
 */
export declare const KERNEL_ERROR_SIGNATURES: readonly ["error AccountAlreadyRegistered(address account)", "error AccountNotRegistered(address account)", "error AccountSelfTarget()", "error ArrayLengthMismatch()", "error BatchPermissionDenied()", "error BatchSubcallFailed(uint256 index, address target)", "error BatchTooLong(uint256 length)", "error BatchZeroTarget(uint256 index)", "error DeadlineExpired(uint256 deadline, uint256 current)", "error DistributorBpsTooLarge(uint256 bps)", "error EmptyBatch()", "error FeePolicyNotSet()", "error FeeTokenMismatch(address provided, address expected)", "error FeeTooLarge(uint256 requested, uint256 maxAllowed)", "error FeeTransferFailed()", "error InsufficientFee(uint256 required, uint256 provided)", "error InvalidInitializer()", "error InvalidManagerSignature()", "error InvalidSignerSignature()", "error KernelSelfTarget(uint256 index)", "error ManagerUnchanged()", "error ModuleNotEnabled()", "error NoPermissionsRegistered(address account)", "error NotAContract(address addr)", "error NotGovernance()", "error NotManager(address caller, address expected)", "error NotPermissionSigner()", "error NotTimelock()", "error PermissionAlreadyRegistered(address permission)", "error PermissionDenied(address permission)", "error PermissionNotBatchAware(address permission)", "error PermissionNotRegistered(address permission)", "error ProtocolPaused()", "error SafeExecutionFailed()", "error SessionInactive(address account)", "error TooManyPermissions(address account, uint256 limit)", "error UntrustedFactory(address factory)", "error UntrustedFeePolicy(address policy)", "error UntrustedModuleSetup(address setup)", "error UntrustedProxyCodehash(bytes32 codehash)", "error UntrustedSingleton(address singleton)", "error ZeroAddress()", "error ZeroFee()"];
/** The kernel error fragments as a viem ABI, ready for `decodeErrorResult`. */
export declare const KERNEL_ERROR_ABI: Abi;
/** A decoded kernel custom error. */
export type KernelError = {
    /** Solidity error name, e.g. "InvalidManagerSignature". */
    name: string;
    /** Decoded arguments, in declaration order (empty for zero-arg errors). */
    args: readonly unknown[];
    /** The 4-byte selector that was matched, e.g. "0xeb6942f1". */
    selector: Hex;
    /** Operator-facing hint at the likely cause and fix, when one is known. */
    hint?: string;
    /** A one-line, log-friendly summary combining name, args, and hint. */
    message: string;
};
/**
 * Decode a raw revert data hex string (`0x` + selector + abi-encoded args) into
 * a named kernel error. Returns null if the data does not match any known kernel
 * error fragment.
 */
export declare function decodeKernelError(data: Hex): Promise<KernelError | null>;
/**
 * Walk a thrown viem error to find embedded revert data, then decode it as a
 * kernel error. Handles ContractFunctionExecutionError / ContractFunctionReverted
 * / RawContractError shapes by scanning `.cause` chains and common data fields.
 * Returns null when no kernel error can be recovered.
 */
export declare function explainKernelRevert(err: unknown): Promise<KernelError | null>;
//# sourceMappingURL=errors.d.ts.map