import { type Account, type Address, type Client, type Hex, type ReadContractReturnType } from 'viem';
import * as FeePayer from '../internal/fee-payer.js';
import { escrowAbi } from './escrow.abi.js';
import type { SignedVoucher } from './Types.js';
export { escrowAbi };
/**
 * On-chain channel state from the escrow contract.
 */
export type OnChainChannel = ReadContractReturnType<typeof escrowAbi, 'getChannel'>;
/**
 * Read channel state from the escrow contract.
 */
export declare function getOnChainChannel(client: Client, escrowContract: Address, channelId: Hex): Promise<OnChainChannel>;
/**
 * Verify a topUp by re-reading on-chain channel state.
 */
export declare function verifyTopUpTransaction(client: Client, escrowContract: Address, channelId: Hex, previousDeposit: bigint): Promise<{
    deposit: bigint;
}>;
/** Options for {@link settleOnChain}. */
export type SettleOptions = {
    candidateFeeTokens?: readonly Address[] | undefined;
    feePayer: Account;
    account: Account;
} | {
    candidateFeeTokens?: readonly Address[] | undefined;
    feePayer?: undefined;
    account?: Account | undefined;
};
/**
 * Submit a settle transaction on-chain.
 */
export declare function settleOnChain(client: Client, escrowContract: Address, voucher: SignedVoucher, options?: SettleOptions): Promise<Hex>;
/** Options for {@link closeOnChain}. */
export type CloseOptions = {
    candidateFeeTokens?: readonly Address[] | undefined;
    feePayer: Account;
    account: Account;
} | {
    candidateFeeTokens?: readonly Address[] | undefined;
    feePayer?: undefined;
    account?: Account | undefined;
};
/**
 * Submit a close transaction on-chain.
 */
export declare function closeOnChain(client: Client, escrowContract: Address, voucher: SignedVoucher, options?: CloseOptions): Promise<Hex>;
export type BroadcastResult = {
    txHash: Hex | undefined;
    onChain: OnChainChannel;
};
export declare function broadcastOpenTransaction(parameters: {
    client: Client;
    serializedTransaction: Hex;
    escrowContract: Address;
    channelId: Hex;
    recipient: Address;
    currency: Address;
    challengeExpires?: string | undefined;
    feePayerPolicy?: Partial<FeePayer.Policy> | undefined;
    feePayer?: Account | undefined;
    beforeBroadcast?: ((onChain: OnChainChannel) => Promise<void> | void) | undefined;
    /** When false, simulates instead of waiting for confirmation and returns derived on-chain state. @default true */
    waitForConfirmation?: boolean | undefined;
}): Promise<BroadcastResult>;
export declare function broadcastTopUpTransaction(parameters: {
    client: Client;
    serializedTransaction: Hex;
    escrowContract: Address;
    channelId: Hex;
    currency: Address;
    declaredDeposit: bigint;
    previousDeposit: bigint;
    challengeExpires?: string | undefined;
    feePayerPolicy?: Partial<FeePayer.Policy> | undefined;
    feePayer?: Account | undefined;
}): Promise<{
    txHash: Hex;
    newDeposit: bigint;
}>;
//# sourceMappingURL=Chain.d.ts.map