import type { RouteResponse, Token } from "@0xsquid/squid-types";
import type { EventListenerFunction, WidgetEventMap } from "../../core/types/event";
import { ExecuteQuoteClient } from "../../core/types/onramps/onramp";
import { RouteRequest } from "../../core/types/route";
type FindTokenMethod = (address?: string, chainId?: string) => Token | undefined;
/**
 * Creates a hash string from quote request parameters to track changes
 */
export declare const createQuoteRequestParamsHash: (params: RouteRequest) => string;
export declare class WidgetEvents extends EventTarget {
    private static instance;
    private constructor();
    private getRouteEventPayload;
    static getInstance(): WidgetEvents;
    /**
     * Overriding the addEventListener method to make it easier to use with typescript
     * @param type
     * @param listener
     * @param options
     */
    listenToWidget<T extends keyof WidgetEventMap>(type: T, listener: EventListenerFunction<T>, options?: boolean | AddEventListenerOptions): void;
    /**
     * Overriding the removeEventListener method to make it easier to use with typescript
     * @param type
     * @param listener
     * @param options
     */
    removeWidgetListener<T extends keyof WidgetEventMap>(type: T, listener: EventListenerFunction<T>, options?: boolean | EventListenerOptions): void;
    /**
     * Dispatch an event of the widget
     * To be listened from an integrator website
     * For example to display a success message when transaction is done
     * @param name
     * @param data
     */
    dispatch<T extends keyof WidgetEventMap>(name: T, data: WidgetEventMap[T]): void;
    /**
     * Will dispatch the main axelar status of transaction
     * This will be called every time the status is received by backend
     * (Using interval to check status)
     * @param status
     */
    dispatchSwapStatus(status: string): void;
    /**
     * Dispatch event when user executes a swap
     * Only when we have the tx hash received
     * @param route
     */
    dispatchSwapExecuteCall(route: RouteResponse["route"], txHash: string): void;
    /**
     * Dispatch event when user changes chain/token
     * @param swapParams
     */
    dispatchSwapParamsChanged(swapParams: {
        fromChainId?: string;
        toChainId?: string;
        fromTokenAddress?: string;
        toTokenAddress?: string;
        fromNetworkName?: string;
        toNetworkName?: string;
        fromTokenSymbol?: string;
        toTokenSymbol?: string;
    }): void;
    /**
     * Dispatch event when we are waiting for the user to sign the swap transaction
     * @param data
     */
    dispatchSwapTxSignatureRequested(data: WidgetEventMap["swapTxSignatureRequested"]): void;
    /**
     * Dispatch event when there's an error while executing the swap route
     * @param data
     */
    dispatchSwapRouteExecutionError(data: WidgetEventMap["swapRouteExecutionError"]): void;
    /**
     * Dispatch event when requesting a quote for swap
     * @param data Quote request parameters
     */
    dispatchRequestQuote(data: WidgetEventMap["requestQuote"]): void;
    /**
     * Dispatch event before swap execution
     * @param data Pre-swap parameters
     * @param findToken Function to find token details
     */
    dispatchPreSwap(data: WidgetEventMap["preSwap"], findToken: FindTokenMethod): void;
    /**
     * Dispatch event after swap execution
     * @param data Post-swap parameters including transaction hash
     * @param findToken Function to find token details
     */
    dispatchPostSwap(data: WidgetEventMap["postSwap"], findToken: FindTokenMethod): void;
    /**
     * Dispatch event when wallet is successfully connected
     * @param data Wallet connection details
     */
    dispatchWalletConnect(data: WidgetEventMap["walletConnect"]): void;
    /**
     * Dispatch event when wallet connection is rejected
     * @param data Wallet rejection details
     */
    dispatchWalletReject(data: WidgetEventMap["walletReject"]): void;
    /**
     * Dispatch event when onchain transaction is rejected
     * @param data Onchain rejection details
     */
    dispatchOnchainReject(data: WidgetEventMap["onchainReject"]): void;
    /**
     * Dispatch event when requesting an onramp quote
     * @param data Quote request parameters
     */
    dispatchOnrampQuoteRequest(data: {
        fiatCurrency: string;
        cryptoCurrencyID: string;
        amount: number;
        region?: string;
        paymentMethod?: string;
    }): void;
    /**
     * Dispatch event when executing an onramp quote
     * @param data Quote execution parameters
     */
    dispatchOnrampQuoteExecute(data: ExecuteQuoteClient): void;
    /**
     * Dispatch event when the search query has no results
     * @param data Empty search details
     */
    dispatchSearchEmpty(data: WidgetEventMap["searchEmpty"]): void;
    /**
     * Dispatch event before Send transaction execution
     * @param data Pre-send parameters
     */
    dispatchPreSend(data: WidgetEventMap["preSend"]): void;
    /**
     * Dispatch event after Send transaction execution
     * @param data Post-send parameters
     */
    dispatchPostSend(data: WidgetEventMap["postSend"]): void;
    /**
     * Dispatch event when QR code is generated for wallet connection.
     * @param data QR code data
     */
    dispatchQrCodeGeneratedForConnect(data: WidgetEventMap["qrCodeGeneratedForConnect"]): void;
    /**
     * Dispatch event when QR code is generated for signing a transaction.
     * @param data QR code data
     */
    dispatchQrCodeGeneratedForSign(data: WidgetEventMap["qrCodeGeneratedForSign"]): void;
    /**
     * Dispatch event when QR code generation for signing a transaction fails.
     * @param data Error information
     */
    dispatchQrCodeGenerationFailedForSign(data: WidgetEventMap["qrCodeGenerationFailedForSign"]): void;
    /**
     * Dispatches event after the QR code for signing a transaction is scanned
     * and we're waiting for the user to approve or reject it.
     */
    dispatchQrTxScannedAwaitingApproval(data: WidgetEventMap["qrTxScannedAwaitingUserApproval"]): void;
}
export {};
