UNPKG

@lifi/widget

Version:

LI.FI Widget for cross-chain bridging and swapping. It will drive your multi-chain strategy and attract new users from everywhere.

49 lines (48 loc) 1.66 kB
import type { ChainId, Process, Route } from '@lifi/sdk'; export declare enum WidgetEvent { RouteExecutionStarted = "routeExecutionStarted", RouteExecutionUpdated = "routeExecutionUpdated", RouteExecutionCompleted = "routeExecutionCompleted", RouteExecutionFailed = "routeExecutionFailed", RouteHighValueLoss = "routeHighValueLoss", RouteContactSupport = "routeContactSupport", SourceChainTokenSelected = "sourceChainTokenSelected", DestinationChainTokenSelected = "destinationChainTokenSelected", SendToWalletToggled = "sendToWalletToggled", ReviewTransactionPageEntered = "reviewTransactionPageEntered", WalletConnected = "walletConnected" } export type WidgetEvents = { routeExecutionStarted: Route; routeExecutionUpdated: RouteExecutionUpdate; routeExecutionCompleted: Route; routeExecutionFailed: RouteExecutionUpdate; routeHighValueLoss: RouteHighValueLossUpdate; routeContactSupport: RouteContactSupport; sourceChainTokenSelected: ChainTokenSelected; destinationChainTokenSelected: ChainTokenSelected; sendToWalletToggled: boolean; reviewTransactionPageEntered?: Route; walletConnected: WalletConnected; }; export interface RouteContactSupport { supportId?: string; } export interface RouteHighValueLossUpdate { fromAmountUsd: string; gasCostUSD?: string; toAmountUSD: string; valueLoss: string; } export interface RouteExecutionUpdate { route: Route; process: Process; } export interface ChainTokenSelected { chainId: ChainId; tokenAddress: string; } export interface WalletConnected { chainId?: number; address?: string; }