import { EncodeObject, OfflineSigner } from '@cosmjs/proto-signing';
import { DeliverTxResponse, GasPrice, HttpEndpoint, SigningStargateClient, SigningStargateClientOptions, SignerData } from '@cosmjs/stargate';
import { CometClient } from '@cosmjs/tendermint-rpc';
import { MsgCreateDidDocPayload, SignInfo, MsgUpdateDidDocPayload, MsgDeactivateDidDocPayload, VerificationMethod } from '@cheqd/ts-proto/cheqd/did/v2/index.js';
import { DIDDocument, DidStdFee, ISignInputs, MessageBatch, TSignerAlgo } from './types.js';
import { Signer } from 'did-jwt';
import { SignerInfo, TxRaw } from 'cosmjs-types/cosmos/tx/v1beta1/tx.js';
import { SignMode } from 'cosmjs-types/cosmos/tx/signing/v1beta1/signing.js';
import { Any } from 'cosmjs-types/google/protobuf/any.js';
import { Coin } from 'cosmjs-types/cosmos/base/v1beta1/coin.js';
import { CheqdQuerier } from './querier.js';
import { TxExtension } from './types';
export declare function calculateDidFee(gasLimit: number, gasPrice: string | GasPrice): DidStdFee;
export declare function makeSignerInfos(signers: ReadonlyArray<{
    readonly pubkey: Any;
    readonly sequence: number;
}>, signMode: SignMode): SignerInfo[];
export declare function makeDidAuthInfoBytes(signers: ReadonlyArray<{
    readonly pubkey: Any;
    readonly sequence: number;
}>, feeAmount: readonly Coin[], gasLimit: bigint, feePayer: string, signMode?: SignMode): Uint8Array;
export declare class CheqdSigningStargateClient extends SigningStargateClient {
    private didSigners;
    private readonly _gasPrice;
    private readonly _signer;
    private readonly endpoint?;
    static readonly maxGasLimit: number;
    static connectWithSigner(endpoint: string | HttpEndpoint, signer: OfflineSigner, options?: (SigningStargateClientOptions & {
        endpoint?: string;
    }) | undefined): Promise<CheqdSigningStargateClient>;
    constructor(cometClient: CometClient | undefined, signer: OfflineSigner, options?: SigningStargateClientOptions & {
        endpoint?: string;
    });
    signAndBroadcast(signerAddress: string, messages: readonly EncodeObject[], fee: DidStdFee | 'auto' | number, memo?: string): Promise<DeliverTxResponse>;
    sign(signerAddress: string, messages: readonly EncodeObject[], fee: DidStdFee, memo: string, explicitSignerData?: SignerData): Promise<TxRaw>;
    private _signDirect;
    /**
     * Broadcasts a signed transaction to the network and monitors its inclusion in a block,
     * with support for retrying on failure and graceful timeout handling.
     *
     * ## Optimizations over base implementation:
     * - Implements a retry policy (`maxRetries`, default: 3) to handle transient broadcast errors.
     * - Prevents double spend by reusing the exact same signed transaction (immutable `Uint8Array`).
     * - Tracks and returns the last known transaction hash (`txId`), even in the case of timeout or failure.
     * - Throws a `TimeoutError` if the transaction is not found within `timeoutMs`, attaching the `txHash` if known.
     * - Polling frequency and timeout are customizable via `pollIntervalMs` and `timeoutMs` parameters.
     *
     * @param tx - The signed transaction bytes to broadcast.
     * @param timeoutMs - Maximum duration (in milliseconds) to wait for block inclusion. Defaults to 60,000 ms.
     * @param pollIntervalMs - Polling interval (in milliseconds) when checking for transaction inclusion. Defaults to 3,000 ms.
     * @param maxRetries - Maximum number of times to retry `broadcastTxSync` on failure. Defaults to 3.
     *
     * @returns A `Promise` that resolves to `DeliverTxResponse` upon successful inclusion in a block.
     * @throws `BroadcastTxError` if the transaction is rejected by the node during CheckTx.
     * @throws `TimeoutError` if the transaction is not found on-chain within the timeout window. Includes `txHash` if available.
     */
    broadcastTx(tx: Uint8Array, timeoutMs?: number, pollIntervalMs?: number, maxRetries?: number): Promise<DeliverTxResponse>;
    simulate(signerAddress: string, messages: readonly EncodeObject[], memo: string | undefined): Promise<number>;
    constructSimulateExtension(querier: CheqdQuerier): Promise<TxExtension>;
    batchMessages(messages: readonly EncodeObject[], signerAddress: string, memo?: string, maxGasLimit?: number): Promise<MessageBatch>;
    checkDidSigners(verificationMethods?: Partial<VerificationMethod>[]): Promise<TSignerAlgo>;
    getDidSigner(verificationMethodId: string, verificationMethods: Partial<VerificationMethod>[]): Promise<(secretKey: Uint8Array) => Signer>;
    signCreateDidDocTx(signInputs: ISignInputs[], payload: MsgCreateDidDocPayload): Promise<SignInfo[]>;
    signUpdateDidDocTx(signInputs: ISignInputs[], payload: MsgUpdateDidDocPayload, externalControllers?: DIDDocument[], previousDidDocument?: DIDDocument): Promise<SignInfo[]>;
    signDeactivateDidDocTx(signInputs: ISignInputs[], payload: MsgDeactivateDidDocPayload, verificationMethod: VerificationMethod[]): Promise<SignInfo[]>;
    static signIdentityTx(signBytes: Uint8Array, signInputs: ISignInputs[]): Promise<SignInfo[]>;
}
//# sourceMappingURL=signer.d.ts.map