import type { RouteResponse } from "@0xsquid/squid-types";
import { TransactionErrorWithMessage } from "./error";
import { ExecuteQuoteServer } from "./onramps";
import { RouteRequest } from "./route";
type BaseSwapEventParams = Pick<RouteRequest, "fromAddress" | "toAddress" | "fromChain" | "toChain" | "fromToken" | "toToken" | "fromAmount">;
type BaseSendTransactionEventParams = {
    fromAddress: string;
    toAddress: string;
    amount: string;
    tokenAddress: string;
    tokenChainId: string;
    tokenSymbol: string;
    tokenType: string;
};
export type SearchContext = "token" | "chain";
export interface QrCodeData {
    matrix: Array<Array<boolean>>;
    deepLinkUrl: string;
}
export type SwapEventPayload = BaseSwapEventParams & {
    quoteId: string;
    txHash: string;
};
export type OnrampQuoteRequestEventPayload = Omit<ExecuteQuoteServer, "paymentMethod"> & {
    tokenAddress?: string;
    tokenChainId?: string;
    paymentMethod?: string;
};
export interface WidgetEventMap {
    swapStatus: {
        status: string;
    };
    swap: SwapEventPayload;
    swapParamsChanged: {
        fromChainId?: string;
        toChainId?: string;
        fromTokenAddress?: string;
        toTokenAddress?: string;
        fromNetworkName?: string;
        toNetworkName?: string;
        fromTokenSymbol?: string;
        toTokenSymbol?: string;
    };
    swapTxSignatureRequested: {
        route: RouteResponse["route"];
    };
    swapRouteExecutionError: {
        error: TransactionErrorWithMessage;
    };
    requestQuote: BaseSwapEventParams;
    preSwap: BaseSwapEventParams;
    postSwap: BaseSwapEventParams & {
        txHash: string;
    };
    walletConnect: {
        walletAddress: string;
        chainType: string;
        provider: string;
    };
    walletReject: {
        chainId: string;
        provider: string;
        reason?: string;
    };
    onchainReject: {
        walletAddress: string;
        chainId: string;
        reason?: string;
        txHash?: string;
    };
    onrampQuoteRequest: {
        fiatCurrency: string;
        cryptoCurrencyID: string;
        amount: number;
        region?: string;
    };
    onrampQuoteExecute: OnrampQuoteRequestEventPayload;
    searchEmpty: {
        searchQuery: string;
        context: SearchContext;
    };
    preSend: BaseSendTransactionEventParams;
    postSend: BaseSendTransactionEventParams & {
        txHash: string;
    };
    qrCodeGeneratedForConnect: QrCodeData;
    qrCodeGeneratedForSign: QrCodeData;
    qrCodeGenerationFailedForSign: undefined;
    qrTxScannedAwaitingUserApproval: undefined;
}
export type EventListenerFunction<T extends keyof WidgetEventMap> = (event: CustomEvent<WidgetEventMap[T]>) => void;
export {};
