accounts
Version:
Tempo Accounts SDK
25 lines • 1.07 kB
TypeScript
import { type DecodeErrorResultReturnType, type Hex } from 'viem';
import { Abis } from 'viem/tempo';
import type { OneOf, UnionOmit } from '../internal/types.js';
type AllAbis = typeof Abis.abis;
type AbiErrorName = Extract<AllAbis[number], {
type: 'error';
}>['name'];
/** Decoded execution error from a Tempo precompile revert. */
export type ExecutionError = OneOf<(DecodeErrorResultReturnType<AllAbis> & {
data: Hex;
message: string;
}) | {
errorName: 'unknown';
message: string;
}>;
/** RPC-serialized execution error (bigints and numbers as hex). */
export type Rpc = UnionOmit<ExecutionError, 'args'>;
/** Human-readable messages keyed by ABI error name. */
export declare const messages: Record<AbiErrorName, string>;
/** Parse a viem error into a structured execution error. */
export declare function parse(error: Error): ExecutionError;
/** Serializes an ExecutionError for RPC transport (bigints/numbers → hex). */
export declare function serialize(preimage: ExecutionError): Rpc;
export {};
//# sourceMappingURL=ExecutionError.d.ts.map