• Cleans up and formats Account Abstraction (AA) revert reasons by extracting the error code and message. Handles null byte termination and standardizes the output format.

    Parameters

    • revertReason: string

      The raw revert reason string from the transaction

    Returns string

    A cleaned up revert reason in the format "AA{code} {message}"

    cleanUpRevertReason("AA25 invalid account nonce\u0000"); // Returns "AA25 invalid account nonce"
    cleanUpRevertReason("AA31 paymaster deposit too low"); // Returns "AA31 paymaster deposit too low"