import { ChainType, type ChainData, type StatusResponse, type Token } from "@0xsquid/squid-types"; import { UseQueryResult } from "@tanstack/react-query"; import { HistoryTransaction } from "../../core/types/history"; import type { SimplifiedRouteAction, StepStatusGetterProps, SwapTransactionForStatus, TransactionParams } from "../../core/types/transaction"; import { TransactionStatus, TransactionType } from "../../core/types/transaction"; /** * Get the steps for a transaction * First step and second step are always the same * @param transaction * @param statusResponse * @returns {TransactionStepStatus[]} */ export declare const getStepStatuses: ({ transaction, statusResponse, onlyFullStatusStep, }: StepStatusGetterProps) => TransactionStatus[]; export declare const getHalfSuccessState: (status?: TransactionStatus) => TransactionStatus | undefined; export declare const getStepsInfos: ({ fromChain, toChain, fromToken, toToken, amount, txType, transaction, statusResponse, }: { txType: TransactionType; amount: string; fromChain?: ChainData | undefined; toChain?: ChainData | undefined; fromToken?: Token | undefined; toToken?: Token | undefined; transaction?: TransactionParams | undefined; statusResponse?: UseQueryResult | undefined; }) => { label: string; status: TransactionStatus; subTitle?: string; link?: string; }[]; /** * Returns the status refetch interval of a Swap transaction * Some routes have a faster refetch interval (i.e Coral RFQ routes) * * @returns Refetch interval in milliseconds */ export declare const getSwapTxStatusRefetchInterval: (transaction: Pick | undefined) => number; /** * Returns the status refetch interval of a Send transaction * * @returns Refetch interval in milliseconds */ export declare const getSendTxStatusRefetchInterval: (chainType: ChainType) => number; export declare const chainflipMultihopBridgeType = "chainflipMultihop"; /** * Some routes have special bridges, like CCTP or Chainflip * Squid API is using a different status endpoint to track status of these bridges * Only certain bridges are supported * @param transaction * @returns */ export declare const getBridgeType: (actions?: SimplifiedRouteAction[]) => string | undefined; export declare const getTransactionStatus: (statusResponse: Pick) => string | undefined; /** * Checks statusResponse of a transaction and returns the end status (if any) * If transaction status is not an end status, means the transaction is still pending * * End statuses are success, refunded, or error */ export declare const getTransactionEndStatus: ({ statusResponse, }: { statusResponse: StatusResponse; }) => TransactionStatus | undefined; export declare function isHistoryTransactionPending({ txType, data, }: HistoryTransaction): boolean; export declare function isHistoryTransactionFailed({ txType, data, }: HistoryTransaction): boolean; export declare function isHistoryTransactionWarning({ txType, data, }: HistoryTransaction): boolean; export declare function isHistoryTransactionEnded({ txType, data, }: HistoryTransaction): boolean;