import type { $$t } from "@cassiozen/usestatemachine/dist/types";
import type { ActionDto, TransactionDto } from "@stakekit/api-hooks";
import type { GetStakeSessionError, SendTransactionError } from "./errors";
import { SignError } from "./errors";
type TxMeta = {
    url: string | null;
    signedTx: string | null;
    broadcasted: boolean | null;
    signError: Error | GetStakeSessionError | SendTransactionError | SignError | null;
    txCheckError: GetStakeSessionError | null;
    done: boolean;
};
export type TxState = {
    tx: TransactionDto;
    meta: TxMeta;
};
export declare const useStepsMachine: (session: ActionDto | null) => [state: {
    value: "done";
    context: {
        yieldId: string | null;
        txStates: TxState[];
        currentTxMeta: {
            idx: number;
            id: string;
        } | null;
        txCheckTimeoutId: number | null;
    };
    event: {
        type: "DONE";
    };
    nextEventsT: never[];
    nextEvents: ("START" | "SIGN_SUCCESS" | "SIGN_ERROR" | "BROADCAST_SUCCESS" | "DONE" | "SIGN_RETRY" | "BROADCAST_ERROR" | "BROADCAST_RETRY" | "SIGN_NEXT_TX" | "TX_CHECK_ERROR" | "TX_CHECK_RETRY")[];
} | {
    value: "disabled";
    context: {
        yieldId: string | null;
        txStates: TxState[];
        currentTxMeta: {
            idx: number;
            id: string;
        } | null;
        txCheckTimeoutId: number | null;
    };
    event: {
        type: "$$initial";
    };
    nextEventsT: never[];
    nextEvents: ("START" | "SIGN_SUCCESS" | "SIGN_ERROR" | "BROADCAST_SUCCESS" | "DONE" | "SIGN_RETRY" | "BROADCAST_ERROR" | "BROADCAST_RETRY" | "SIGN_NEXT_TX" | "TX_CHECK_ERROR" | "TX_CHECK_RETRY")[];
} | {
    value: "idle";
    context: {
        yieldId: string | null;
        txStates: TxState[];
        currentTxMeta: {
            idx: number;
            id: string;
        } | null;
        txCheckTimeoutId: number | null;
    };
    event: {
        type: "$$initial";
    };
    nextEventsT: "START"[];
    nextEvents: ("START" | "SIGN_SUCCESS" | "SIGN_ERROR" | "BROADCAST_SUCCESS" | "DONE" | "SIGN_RETRY" | "BROADCAST_ERROR" | "BROADCAST_RETRY" | "SIGN_NEXT_TX" | "TX_CHECK_ERROR" | "TX_CHECK_RETRY")[];
} | {
    value: "signLoading";
    context: {
        yieldId: string | null;
        txStates: TxState[];
        currentTxMeta: {
            idx: number;
            id: string;
        } | null;
        txCheckTimeoutId: number | null;
    };
    event: import("@cassiozen/usestatemachine/dist/types").Machine.EntryEventForStateValue<{
        initial: "disabled" | "idle";
        schema: {
            context: {
                [$$t]: {
                    yieldId: string | null;
                    txStates: TxState[];
                    currentTxMeta: {
                        idx: number;
                        id: string;
                    } | null;
                    txCheckTimeoutId: number | null;
                };
            };
        };
        context: {
            yieldId: string | null;
            txStates: TxState[];
            currentTxMeta: {
                idx: number;
                id: string;
            } | null;
            txCheckTimeoutId: null;
        };
        states: {
            idle: {
                on: {
                    START: "signLoading";
                };
            };
            disabled: {};
            signLoading: {
                on: {
                    SIGN_SUCCESS: "broadcastLoading";
                    SIGN_ERROR: "signError";
                    BROADCAST_SUCCESS: "txCheckLoading";
                    DONE: "done";
                };
                effect: unknown;
            };
            signError: {
                on: {
                    SIGN_RETRY: "signLoading";
                };
            };
            broadcastLoading: {
                on: {
                    BROADCAST_SUCCESS: "txCheckLoading";
                    BROADCAST_ERROR: "broadcastError";
                };
                effect: unknown;
            };
            broadcastError: {
                on: {
                    BROADCAST_RETRY: "broadcastLoading";
                };
            };
            txCheckLoading: {
                on: {
                    SIGN_NEXT_TX: "signLoading";
                    DONE: "done";
                    TX_CHECK_ERROR: "txCheckError";
                    TX_CHECK_RETRY: "txCheckRetry";
                };
                effect: unknown;
            };
            txCheckRetry: {
                on: {
                    TX_CHECK_RETRY: "txCheckLoading";
                };
                effect: unknown;
            };
            txCheckError: {
                on: {
                    TX_CHECK_RETRY: "txCheckLoading";
                };
            };
            done: {};
        };
    }, "signLoading">;
    nextEventsT: ("SIGN_SUCCESS" | "SIGN_ERROR" | "BROADCAST_SUCCESS" | "DONE")[];
    nextEvents: ("START" | "SIGN_SUCCESS" | "SIGN_ERROR" | "BROADCAST_SUCCESS" | "DONE" | "SIGN_RETRY" | "BROADCAST_ERROR" | "BROADCAST_RETRY" | "SIGN_NEXT_TX" | "TX_CHECK_ERROR" | "TX_CHECK_RETRY")[];
} | {
    value: "broadcastLoading";
    context: {
        yieldId: string | null;
        txStates: TxState[];
        currentTxMeta: {
            idx: number;
            id: string;
        } | null;
        txCheckTimeoutId: number | null;
    };
    event: import("@cassiozen/usestatemachine/dist/types").Machine.EntryEventForStateValue<{
        initial: "disabled" | "idle";
        schema: {
            context: {
                [$$t]: {
                    yieldId: string | null;
                    txStates: TxState[];
                    currentTxMeta: {
                        idx: number;
                        id: string;
                    } | null;
                    txCheckTimeoutId: number | null;
                };
            };
        };
        context: {
            yieldId: string | null;
            txStates: TxState[];
            currentTxMeta: {
                idx: number;
                id: string;
            } | null;
            txCheckTimeoutId: null;
        };
        states: {
            idle: {
                on: {
                    START: "signLoading";
                };
            };
            disabled: {};
            signLoading: {
                on: {
                    SIGN_SUCCESS: "broadcastLoading";
                    SIGN_ERROR: "signError";
                    BROADCAST_SUCCESS: "txCheckLoading";
                    DONE: "done";
                };
                effect: unknown;
            };
            signError: {
                on: {
                    SIGN_RETRY: "signLoading";
                };
            };
            broadcastLoading: {
                on: {
                    BROADCAST_SUCCESS: "txCheckLoading";
                    BROADCAST_ERROR: "broadcastError";
                };
                effect: unknown;
            };
            broadcastError: {
                on: {
                    BROADCAST_RETRY: "broadcastLoading";
                };
            };
            txCheckLoading: {
                on: {
                    SIGN_NEXT_TX: "signLoading";
                    DONE: "done";
                    TX_CHECK_ERROR: "txCheckError";
                    TX_CHECK_RETRY: "txCheckRetry";
                };
                effect: unknown;
            };
            txCheckRetry: {
                on: {
                    TX_CHECK_RETRY: "txCheckLoading";
                };
                effect: unknown;
            };
            txCheckError: {
                on: {
                    TX_CHECK_RETRY: "txCheckLoading";
                };
            };
            done: {};
        };
    }, "broadcastLoading">;
    nextEventsT: ("BROADCAST_SUCCESS" | "BROADCAST_ERROR")[];
    nextEvents: ("START" | "SIGN_SUCCESS" | "SIGN_ERROR" | "BROADCAST_SUCCESS" | "DONE" | "SIGN_RETRY" | "BROADCAST_ERROR" | "BROADCAST_RETRY" | "SIGN_NEXT_TX" | "TX_CHECK_ERROR" | "TX_CHECK_RETRY")[];
} | {
    value: "signError";
    context: {
        yieldId: string | null;
        txStates: TxState[];
        currentTxMeta: {
            idx: number;
            id: string;
        } | null;
        txCheckTimeoutId: number | null;
    };
    event: {
        type: "SIGN_ERROR";
    };
    nextEventsT: "SIGN_RETRY"[];
    nextEvents: ("START" | "SIGN_SUCCESS" | "SIGN_ERROR" | "BROADCAST_SUCCESS" | "DONE" | "SIGN_RETRY" | "BROADCAST_ERROR" | "BROADCAST_RETRY" | "SIGN_NEXT_TX" | "TX_CHECK_ERROR" | "TX_CHECK_RETRY")[];
} | {
    value: "txCheckLoading";
    context: {
        yieldId: string | null;
        txStates: TxState[];
        currentTxMeta: {
            idx: number;
            id: string;
        } | null;
        txCheckTimeoutId: number | null;
    };
    event: import("@cassiozen/usestatemachine/dist/types").Machine.EntryEventForStateValue<{
        initial: "disabled" | "idle";
        schema: {
            context: {
                [$$t]: {
                    yieldId: string | null;
                    txStates: TxState[];
                    currentTxMeta: {
                        idx: number;
                        id: string;
                    } | null;
                    txCheckTimeoutId: number | null;
                };
            };
        };
        context: {
            yieldId: string | null;
            txStates: TxState[];
            currentTxMeta: {
                idx: number;
                id: string;
            } | null;
            txCheckTimeoutId: null;
        };
        states: {
            idle: {
                on: {
                    START: "signLoading";
                };
            };
            disabled: {};
            signLoading: {
                on: {
                    SIGN_SUCCESS: "broadcastLoading";
                    SIGN_ERROR: "signError";
                    BROADCAST_SUCCESS: "txCheckLoading";
                    DONE: "done";
                };
                effect: unknown;
            };
            signError: {
                on: {
                    SIGN_RETRY: "signLoading";
                };
            };
            broadcastLoading: {
                on: {
                    BROADCAST_SUCCESS: "txCheckLoading";
                    BROADCAST_ERROR: "broadcastError";
                };
                effect: unknown;
            };
            broadcastError: {
                on: {
                    BROADCAST_RETRY: "broadcastLoading";
                };
            };
            txCheckLoading: {
                on: {
                    SIGN_NEXT_TX: "signLoading";
                    DONE: "done";
                    TX_CHECK_ERROR: "txCheckError";
                    TX_CHECK_RETRY: "txCheckRetry";
                };
                effect: unknown;
            };
            txCheckRetry: {
                on: {
                    TX_CHECK_RETRY: "txCheckLoading";
                };
                effect: unknown;
            };
            txCheckError: {
                on: {
                    TX_CHECK_RETRY: "txCheckLoading";
                };
            };
            done: {};
        };
    }, "txCheckLoading">;
    nextEventsT: ("DONE" | "SIGN_NEXT_TX" | "TX_CHECK_ERROR" | "TX_CHECK_RETRY")[];
    nextEvents: ("START" | "SIGN_SUCCESS" | "SIGN_ERROR" | "BROADCAST_SUCCESS" | "DONE" | "SIGN_RETRY" | "BROADCAST_ERROR" | "BROADCAST_RETRY" | "SIGN_NEXT_TX" | "TX_CHECK_ERROR" | "TX_CHECK_RETRY")[];
} | {
    value: "broadcastError";
    context: {
        yieldId: string | null;
        txStates: TxState[];
        currentTxMeta: {
            idx: number;
            id: string;
        } | null;
        txCheckTimeoutId: number | null;
    };
    event: {
        type: "BROADCAST_ERROR";
    };
    nextEventsT: "BROADCAST_RETRY"[];
    nextEvents: ("START" | "SIGN_SUCCESS" | "SIGN_ERROR" | "BROADCAST_SUCCESS" | "DONE" | "SIGN_RETRY" | "BROADCAST_ERROR" | "BROADCAST_RETRY" | "SIGN_NEXT_TX" | "TX_CHECK_ERROR" | "TX_CHECK_RETRY")[];
} | {
    value: "txCheckError";
    context: {
        yieldId: string | null;
        txStates: TxState[];
        currentTxMeta: {
            idx: number;
            id: string;
        } | null;
        txCheckTimeoutId: number | null;
    };
    event: {
        type: "TX_CHECK_ERROR";
    };
    nextEventsT: "TX_CHECK_RETRY"[];
    nextEvents: ("START" | "SIGN_SUCCESS" | "SIGN_ERROR" | "BROADCAST_SUCCESS" | "DONE" | "SIGN_RETRY" | "BROADCAST_ERROR" | "BROADCAST_RETRY" | "SIGN_NEXT_TX" | "TX_CHECK_ERROR" | "TX_CHECK_RETRY")[];
} | {
    value: "txCheckRetry";
    context: {
        yieldId: string | null;
        txStates: TxState[];
        currentTxMeta: {
            idx: number;
            id: string;
        } | null;
        txCheckTimeoutId: number | null;
    };
    event: {
        type: "TX_CHECK_RETRY";
    };
    nextEventsT: "TX_CHECK_RETRY"[];
    nextEvents: ("START" | "SIGN_SUCCESS" | "SIGN_ERROR" | "BROADCAST_SUCCESS" | "DONE" | "SIGN_RETRY" | "BROADCAST_ERROR" | "BROADCAST_RETRY" | "SIGN_NEXT_TX" | "TX_CHECK_ERROR" | "TX_CHECK_RETRY")[];
}, send: import("@cassiozen/usestatemachine/dist/types").Machine.Send<{
    initial: "disabled" | "idle";
    schema: {
        context: {
            [$$t]: {
                yieldId: string | null;
                txStates: TxState[];
                currentTxMeta: {
                    idx: number;
                    id: string;
                } | null;
                txCheckTimeoutId: number | null;
            };
        };
    };
    context: {
        yieldId: string | null;
        txStates: TxState[];
        currentTxMeta: {
            idx: number;
            id: string;
        } | null;
        txCheckTimeoutId: null;
    };
    states: {
        idle: {
            on: {
                START: "signLoading";
            };
        };
        disabled: {};
        signLoading: {
            on: {
                SIGN_SUCCESS: "broadcastLoading";
                SIGN_ERROR: "signError";
                BROADCAST_SUCCESS: "txCheckLoading";
                DONE: "done";
            };
            effect: unknown;
        };
        signError: {
            on: {
                SIGN_RETRY: "signLoading";
            };
        };
        broadcastLoading: {
            on: {
                BROADCAST_SUCCESS: "txCheckLoading";
                BROADCAST_ERROR: "broadcastError";
            };
            effect: unknown;
        };
        broadcastError: {
            on: {
                BROADCAST_RETRY: "broadcastLoading";
            };
        };
        txCheckLoading: {
            on: {
                SIGN_NEXT_TX: "signLoading";
                DONE: "done";
                TX_CHECK_ERROR: "txCheckError";
                TX_CHECK_RETRY: "txCheckRetry";
            };
            effect: unknown;
        };
        txCheckRetry: {
            on: {
                TX_CHECK_RETRY: "txCheckLoading";
            };
            effect: unknown;
        };
        txCheckError: {
            on: {
                TX_CHECK_RETRY: "txCheckLoading";
            };
        };
        done: {};
    };
}>];
export {};
