import type { ActionDto, TransactionDto } from "@stakekit/api-hooks";
import { Maybe } from "purify-ts";
import type { ActionMeta } from "../../../domain/types/wallets/generic-wallet";
import type { SendTransactionError, TransactionDecodeError } from "../../../providers/sk-wallet/errors";
import type { GetStakeSessionError } from "./errors";
import { SignError, SubmitHashError, TransactionConstructError, TXCheckError } from "./errors";
type TxMeta = {
    url: string | null;
    signedTx: string | null;
    broadcasted: boolean | null;
    signError: SendTransactionError | TransactionDecodeError | TransactionConstructError | null;
    txCheckError: GetStakeSessionError | null;
    done: boolean;
};
export type TxState = {
    tx: TransactionDto;
    meta: TxMeta;
};
type SignRes = {
    type: "broadcasted";
} | {
    type: "regular";
    data: {
        signedTx: string;
        broadcasted: boolean;
    };
};
export declare const useStepsMachine: ({ transactions, integrationId, actionMeta, }: {
    transactions: ActionDto["transactions"];
    integrationId: ActionDto["integrationId"];
    actionMeta: ActionMeta;
}) => [import("xstate").MachineSnapshot<{
    yieldId: Maybe<string>;
    txStates: TxState[];
    currentTxMeta: Maybe<{
        idx: number;
        id: string;
    }>;
    txCheckTimeoutId: Maybe<number>;
}, {
    type: "START";
} | {
    type: "__SIGN_SUCCESS__";
    val: Extract<SignRes, {
        type: "regular";
    }>;
} | {
    type: "__SIGN_ERROR__";
    val: SendTransactionError | TransactionDecodeError | TransactionConstructError | SignError;
} | {
    type: "__BROADCAST_SUCCESS__";
} | {
    type: "__BROADCAST_ERROR__";
    val: Error | SubmitHashError;
} | {
    type: "__DONE__";
    val: TxState[];
} | {
    type: "__SIGN_RETRY__";
} | {
    type: "__BROADCAST_RETRY__";
} | {
    type: "__SIGN_NEXT_TX__";
    val: {
        newCurrentTxMeta: {
            idx: number;
            id: string;
        };
        newTxStates: TxState[];
    };
} | {
    type: "__TX_CHECK_ERROR__";
    val: Error | SignError | TXCheckError;
} | {
    type: "__TX_CHECK_RETRY__";
} | {
    type: "__TX_CHECK_RETRY_TIMEOUT__";
    val: number;
}, {}, "done" | "disabled" | "idle" | "signLoading" | "broadcastLoading" | "signError" | "txCheckLoading" | "broadcastError" | "txCheckError" | "txCheckRetry", string, import("xstate").NonReducibleUnknown, import("xstate").MetaObject, {
    states: {
        readonly idle: {};
        readonly disabled: {};
        readonly signLoading: {};
        readonly signError: {};
        readonly broadcastLoading: {};
        readonly broadcastError: {};
        readonly txCheckLoading: {};
        readonly txCheckRetry: {};
        readonly txCheckError: {};
        readonly done: {};
    };
}>, (event: {
    type: "START";
} | {
    type: "__SIGN_SUCCESS__";
    val: Extract<SignRes, {
        type: "regular";
    }>;
} | {
    type: "__SIGN_ERROR__";
    val: SendTransactionError | TransactionDecodeError | TransactionConstructError | SignError;
} | {
    type: "__BROADCAST_SUCCESS__";
} | {
    type: "__BROADCAST_ERROR__";
    val: Error | SubmitHashError;
} | {
    type: "__DONE__";
    val: TxState[];
} | {
    type: "__SIGN_RETRY__";
} | {
    type: "__BROADCAST_RETRY__";
} | {
    type: "__SIGN_NEXT_TX__";
    val: {
        newCurrentTxMeta: {
            idx: number;
            id: string;
        };
        newTxStates: TxState[];
    };
} | {
    type: "__TX_CHECK_ERROR__";
    val: Error | SignError | TXCheckError;
} | {
    type: "__TX_CHECK_RETRY__";
} | {
    type: "__TX_CHECK_RETRY_TIMEOUT__";
    val: number;
}) => void, import("xstate").Actor<import("xstate").StateMachine<{
    yieldId: Maybe<string>;
    txStates: TxState[];
    currentTxMeta: Maybe<{
        idx: number;
        id: string;
    }>;
    txCheckTimeoutId: Maybe<number>;
}, {
    type: "START";
} | {
    type: "__SIGN_SUCCESS__";
    val: Extract<SignRes, {
        type: "regular";
    }>;
} | {
    type: "__SIGN_ERROR__";
    val: SendTransactionError | TransactionDecodeError | TransactionConstructError | SignError;
} | {
    type: "__BROADCAST_SUCCESS__";
} | {
    type: "__BROADCAST_ERROR__";
    val: Error | SubmitHashError;
} | {
    type: "__DONE__";
    val: TxState[];
} | {
    type: "__SIGN_RETRY__";
} | {
    type: "__BROADCAST_RETRY__";
} | {
    type: "__SIGN_NEXT_TX__";
    val: {
        newCurrentTxMeta: {
            idx: number;
            id: string;
        };
        newTxStates: TxState[];
    };
} | {
    type: "__TX_CHECK_ERROR__";
    val: Error | SignError | TXCheckError;
} | {
    type: "__TX_CHECK_RETRY__";
} | {
    type: "__TX_CHECK_RETRY_TIMEOUT__";
    val: number;
}, {}, never, never, never, never, "done" | "disabled" | "idle" | "signLoading" | "broadcastLoading" | "signError" | "txCheckLoading" | "broadcastError" | "txCheckError" | "txCheckRetry", string, import("xstate").NonReducibleUnknown, import("xstate").NonReducibleUnknown, {
    type: "signSuccess";
}, import("xstate").MetaObject, {
    states: {
        readonly idle: {};
        readonly disabled: {};
        readonly signLoading: {};
        readonly signError: {};
        readonly broadcastLoading: {};
        readonly broadcastError: {};
        readonly txCheckLoading: {};
        readonly txCheckRetry: {};
        readonly txCheckError: {};
        readonly done: {};
    };
}>>];
export {};
