import { type Address, type TransactionSigner } from '@solana/kit';
import { type AltVM } from '@hyperlane-xyz/provider-sdk';
import type { InstructionAccountMeta } from '../instructions/utils.js';
import type { AnnotatedSvmTransaction, SvmReceipt, SvmTransaction, WithExtraSigners } from '../types.js';
import { SvmProvider } from './provider.js';
/** Transaction input for `send()` — feePayer is excluded since the signer provides it. */
type SendableSvmTransaction = Omit<SvmTransaction, 'feePayer'>;
/** Shape returned by `transactionToPrintableJson`. */
export interface PrintableSvmTransaction {
    annotation?: string;
    instructions: PrintableSvmInstruction[];
    computeUnits?: number;
    transaction_base58: string;
    message_base58: string;
}
export interface PrintableSvmInstruction {
    programAddress: Address;
    accounts?: readonly InstructionAccountMeta[];
    data?: string;
}
export declare class SvmSigner extends SvmProvider implements AltVM.ISigner<SvmTransaction, SvmReceipt> {
    readonly signer: TransactionSigner;
    private readonly logger;
    private constructor();
    static connectWithSigner(rpcUrls: string[], privateKey: string, _extraParams?: Record<string, any>): Promise<SvmSigner>;
    getSignerAddress(): string;
    supportsTransactionBatching(): boolean;
    transactionToPrintableJson(transaction: AnnotatedSvmTransaction): Promise<PrintableSvmTransaction>;
    /**
     * Builds, signs, and sends a transaction with a confirmed blockhash.
     * Retries on blockhash-not-found errors with backoff to handle
     * load-balanced RPC node desync.
     */
    private signAndSend;
    /**
     * Evaluates a signature status result. Throws on error, returns
     * `{ confirmed: true, slot }` if confirmed/finalized, `{ confirmed: false }`
     * if still progressing, or `null` if the signature was not found.
     */
    private checkSignatureResult;
    /**
     * Sends a transaction and polls for confirmation. On blockhash expiry,
     * checks transaction history before resubmitting to prevent double-execution.
     */
    send(tx: SendableSvmTransaction): Promise<SvmReceipt>;
    /**
     * Polls getSignatureStatuses while the blockhash is still valid.
     * Rebroadcasts the same signed tx periodically (fire-and-forget).
     * Returns the receipt if confirmed, or null if the blockhash expired.
     */
    private pollForConfirmation;
    sendAndConfirmTransaction(transaction: WithExtraSigners<SendableSvmTransaction>): Promise<SvmReceipt>;
    /**
     * Fetches full transaction to populate meta (including logs) on the receipt.
     * Retries with backoff since RPC indexing can lag behind confirmation.
     * // TODO: make meta-fetch opt-in once the legacy compat layer is removed
     */
    private fetchTransactionMeta;
    sendAndConfirmBatchTransactions(_transactions: SendableSvmTransaction[]): Promise<SvmReceipt>;
}
export {};
//# sourceMappingURL=signer.d.ts.map