import { Address, Hex } from 'viem';
export * from './request';
export * from './response';
export type RequestID = number;
export type Timestamp = number;
export type AccountID = Hex;
export type RequestData = [RequestID, RPCMethod, object[], Timestamp?];
export type ResponseData = [RequestID, RPCMethod, object[], Timestamp?];
export declare enum RPCChannelStatus {
    Joining = "joining",
    Open = "open",
    Closed = "closed",
    Challenged = "challenged"
}
export interface GenericRPCMessage {
    requestId: RequestID;
    timestamp?: Timestamp;
    signatures?: Hex[];
}
export type AssetAllocation = {
    asset: string;
    amount: string;
};
export type Allowance = {
    asset: string;
    amount: string;
};
export type AppSessionAllocation = AssetAllocation & {
    participant: Address;
};
export type TransferAllocation = AssetAllocation;
export interface NitroliteRPCErrorDetail {
    error: string;
}
export type ErrorResponseData = [RequestID, 'error', [NitroliteRPCErrorDetail], Timestamp?];
export type ResponsePayload = ResponseData | ErrorResponseData;
export interface NitroliteRPCMessage {
    req?: RequestData;
    res?: ResponsePayload;
    sig?: Hex[] | [''];
}
export interface ApplicationRPCMessage extends NitroliteRPCMessage {
    sid: Hex;
}
export interface ParsedResponse {
    isValid: boolean;
    error?: string;
    isError?: boolean;
    requestId?: RequestID;
    method?: RPCMethod;
    data?: object[] | NitroliteRPCErrorDetail;
    sid?: Hex;
    timestamp?: Timestamp;
}
export interface AppDefinition {
    protocol: string;
    participants: Hex[];
    weights: number[];
    quorum: number;
    challenge: number;
    nonce?: number;
}
export interface ChannelUpdate {
    channelId: Hex;
    participant: Address;
    status: RPCChannelStatus;
    token: Address;
    wallet: Address;
    amount: BigInt;
    chainId: number;
    adjudicator: Address;
    challenge: number;
    nonce: BigInt;
    version: number;
    createdAt: Date;
    updatedAt: Date;
}
export declare enum NitroliteErrorCode {
    PARSE_ERROR = -32700,
    INVALID_REQUEST = -32600,
    METHOD_NOT_FOUND = -32601,
    INVALID_PARAMS = -32602,
    INTERNAL_ERROR = -32603,
    AUTHENTICATION_FAILED = -32000,
    INVALID_SIGNATURE = -32003,
    INVALID_TIMESTAMP = -32004,
    INVALID_REQUEST_ID = -32005,
    INSUFFICIENT_FUNDS = -32007,
    ACCOUNT_NOT_FOUND = -32008,
    APPLICATION_NOT_FOUND = -32009,
    INVALID_INTENT = -32010,
    INSUFFICIENT_SIGNATURES = -32006,
    CHALLENGE_EXPIRED = -32011,
    INVALID_CHALLENGE = -32012
}
export type MessageSigner = (payload: RequestData | ResponsePayload) => Promise<Hex>;
export type ChallengeStateSigner = (stateHash: Hex) => Promise<Hex>;
export type SingleMessageVerifier = (payload: RequestData | ResponsePayload, signature: Hex, address: Address) => Promise<boolean>;
export type MultiMessageVerifier = (payload: RequestData | ResponsePayload, signatures: Hex[], expectedSigners: Address[]) => Promise<boolean>;
export interface PartialEIP712AuthMessage {
    scope: string;
    application: Address;
    participant: Address;
    expire: string;
    allowances: {
        asset: string;
        amount: string;
    }[];
}
export interface EIP712AuthMessage extends PartialEIP712AuthMessage {
    wallet: Address;
    challenge: string;
}
export interface EIP712AuthDomain {
    name: string;
}
export declare const EIP712AuthTypes: {
    Policy: {
        name: string;
        type: string;
    }[];
    Allowance: {
        name: string;
        type: string;
    }[];
};
export declare enum RPCMethod {
    AuthRequest = "auth_request",
    AuthChallenge = "auth_challenge",
    AuthVerify = "auth_verify",
    Error = "error",
    GetConfig = "get_config",
    GetLedgerBalances = "get_ledger_balances",
    GetLedgerEntries = "get_ledger_entries",
    GetLedgerTransactions = "get_ledger_transactions",
    GetUserTag = "get_user_tag",
    CreateAppSession = "create_app_session",
    SubmitAppState = "submit_app_state",
    CloseAppSession = "close_app_session",
    GetAppDefinition = "get_app_definition",
    GetAppSessions = "get_app_sessions",
    ResizeChannel = "resize_channel",
    CloseChannel = "close_channel",
    GetChannels = "get_channels",
    GetRPCHistory = "get_rpc_history",
    GetAssets = "get_assets",
    Assets = "assets",
    Message = "message",
    BalanceUpdate = "bu",
    ChannelsUpdate = "channels",
    ChannelUpdate = "cu",
    Ping = "ping",
    Pong = "pong",
    Transfer = "transfer",
    TransferNotification = "tr"
}
