import { Asset } from '@skip-go/client'; import { Chain } from '@skip-go/client'; import { ChainType } from '@skip-go/client'; import { default as default_2 } from 'react'; import { MessagesRequest } from '@skip-go/client'; import { RouteRequest } from '@skip-go/client'; import { SetApiOptionsProps } from '@skip-go/client'; import { SignClientTypes } from '@walletconnect/types'; import { SignerGetters } from '@skip-go/client'; import { SkipClientOptions } from '@skip-go/client'; import { WalletConnectModalConfig } from '@walletconnect/modal'; declare type AssetDetailsProps = { asset?: ClientAsset; chain?: Chain; symbol?: string; assetImage?: string; chainName?: string; chainImage?: string; amount?: string; tokenAmount?: string; decimals?: number; }; declare type Callbacks = { onWalletConnected?: (props: onWalletConnectedProps) => void; onWalletDisconnected?: (props: onWalletDisconnectedProps) => void; onTransactionSignRequested?: (props: onTransactionSignRequestedProps) => void; onTransactionBroadcasted?: (props: onTransactionBroadcastedProps) => void; onTransactionComplete?: (props: onTransactionCompleteProps) => void; onTransactionFailed?: (props: onTransactionFailedProps) => void; onRouteUpdated?: (props: onRouteUpdatedProps) => void; onSourceAndDestinationSwapped?: (props: onSourceAndDestinationSwappedProps) => void; onSourceAssetUpdated?: (props: onAssetUpdatedProps) => void; onDestinationAssetUpdated?: (props: onAssetUpdatedProps) => void; }; declare type ChainFilter = { source?: Record; destination?: Record; }; declare type ClientAsset = Asset & { chain_key: string; chainName: string; }; declare type DefaultRouteConfig = { amountIn?: number; amountOut?: number; srcChainId?: string; srcAssetDenom?: string; destChainId?: string; destAssetDenom?: string; srcLocked?: boolean; destLocked?: boolean; }; export declare const defaultTheme: { brandColor: string; brandTextColor: undefined; borderRadius: WidgetBorderRadius; primary: { background: { normal: string; }; text: { normal: string; lowContrast: string; ultraLowContrast: string; }; ghostButtonHover: string; }; secondary: { background: { normal: string; transparent: string; hover: string; }; }; success: { background: string; text: string; }; warning: { background: string; text: string; }; error: { background: string; text: string; }; }; declare type IbcEurekaHighlightedAssets = Record; export declare const lightTheme: { brandColor: string; brandTextColor: undefined; borderRadius: WidgetBorderRadius; primary: { background: { normal: string; }; text: { normal: string; lowContrast: string; ultraLowContrast: string; }; ghostButtonHover: string; }; secondary: { background: { normal: string; transparent: string; hover: string; }; }; success: { background: string; text: string; }; warning: { background: string; text: string; }; error: { background: string; text: string; }; }; declare type onAssetUpdatedProps = { chainId?: string; denom?: string; }; declare type onRouteUpdatedProps = { srcChainId?: string; srcAssetDenom?: string; destChainId?: string; destAssetDenom?: string; amountIn?: string; amountOut?: string; requiredChainAddresses?: string[]; }; declare type onSourceAndDestinationSwappedProps = { srcChainId?: string; srcAssetDenom?: string; destChainId?: string; destAssetDenom?: string; amountIn?: string; amountOut?: string; }; declare type onTransactionBroadcastedProps = { txHash: string; chainId: string; explorerLink: string; sourceAddress: string; destinationAddress: string; sourceAssetDenom: string; sourceAssetChainId: string; destAssetDenom: string; destAssetChainId: string; }; declare type onTransactionCompleteProps = { txHash: string; chainId: string; explorerLink: string; sourceAddress: string; destinationAddress: string; sourceAssetDenom: string; sourceAssetChainId: string; destAssetDenom: string; destAssetChainId: string; }; declare type onTransactionFailedProps = { error: string; }; declare type onTransactionSignRequestedProps = { chainId: string; signerAddress?: string; txIndex: number; }; declare type onWalletConnectedProps = { walletName: string; chainIdToAddressMap?: Record; chainId?: string; address?: string; }; declare type onWalletDisconnectedProps = { walletName: string; chainType?: ChainType; }; export declare const openAssetAndChainSelectorModal: ({ context, onSelect, }: { onSelect: (asset: ClientAsset | null) => void; context: "source" | "destination"; }) => void; declare type PartialTheme = Partial | undefined; export declare const resetWidget: ({ onlyClearInputValues }?: { onlyClearInputValues?: boolean; }) => void; /** * Sets the selected asset (source or destination) in the global state * @param {"source" | "destination"} options.type - Indicates whether to update the source or destination asset. * @param {string} options.chainId - The chain Id of the asset. * @param {string} options.denom - The denom (token identifier) of the asset. * @param {number} options.amount - Optional amount to associate with the asset. */ export declare const setAsset: ({ type, ...assetDetails }: SetAssetProps) => void; declare type SetAssetProps = { type: "source" | "destination"; chainId: string; denom: string; amount?: number; }; export declare type Theme = { brandColor: string; brandTextColor?: string; borderRadius?: WidgetBorderRadius; primary: { background: { normal: string; }; text: { normal: string; lowContrast: string; ultraLowContrast: string; }; ghostButtonHover: string; }; secondary: { background: { normal: string; transparent: string; hover: string; }; }; success: { background: string; text: string; }; warning: { background: string; text: string; }; error: { background: string; text: string; }; }; /** * @param {string} [params.assetDenom] - The denomination of the asset to retrieve details for * @param {string} [params.amount] - The human-readable amount amount of the asset * @param {string} [params.tokenAmount] - The token/raw amount of the asset * @param {string} [params.chainId] - The id of the chain associated with the asset * * @returns {AssetDetails} An object containing the following properties: * - `asset` The asset object corresponding to the provided denomination * - `chain` The chain object associated with the provided chain id * - `symbol` The symbol of the asset, derived from the asset object * - `assetImage` The asset image url derived from the asset object * - `chainName` The name of the chain, derived from the chain object * - `chainImage` The chain image url, derived from the chain object * - `amount` The human-readable amount of the asset * - `tokenAmount` The token/raw amount of the asset */ export declare const useGetAssetDetails: ({ assetDenom, amount, tokenAmount, chainId, }: { assetDenom?: string; amount?: string; tokenAmount?: string; chainId?: string; }) => AssetDetailsProps; declare type WalletConnect = { options: Pick | null; walletConnectModal?: Pick | null; }; export declare const Widget: (props: WidgetProps) => default_2.JSX.Element; declare type WidgetBorderRadius = { /** * Border radius for the main container and buttons, used in main pages container and main used in buttons. */ main?: string | number; /** * Border radius for the selection button, used in buttons like "Select asset" or "Selector for route preferences and slippage slector button". */ selectionButton?: string | number; /** * Border radius for the ghost button, used in buttons like "Max button" or "History button" or "Bottom drawer button". */ ghostButton?: string | number; /** * Border radius for the modal container, used in modals like "Asset selector modal" or "History modal" or "Wallet connector modal". */ modalContainer?: string | number; /** * Border radius for the row item, used in row items like "History row item" or "Modal row item (Wallet connector or asset selecion)". */ rowItem?: string | number; }; export declare type WidgetProps = { /** * If specified, add a `data-root-id` attribute to all root elements of the widget, including portals. * This can be used to style or document.querySelector specific parts of the widget. */ rootId?: string; theme?: PartialTheme | "light" | "dark"; brandColor?: string; /** * Customize the corner roundness of widget components * @default 25 */ onlyTestnet?: boolean; defaultRoute?: DefaultRouteConfig; settings?: { /** * Default slippage percentage (0-100) for CosmosSDK chain swaps. * @default 1 */ slippage?: number; /** * Set allowance amount to max if EVM transaction requires allowance approval */ useUnlimitedApproval?: boolean; }; routeConfig?: WidgetRouteConfig; filter?: ChainFilter; filterOut?: ChainFilter; filterOutUnlessUserHasBalance?: ChainFilter; walletConnect?: WalletConnect; /** * Enable Amplitude analytics for the widget to improve user experience. */ enableAmplitudeAnalytics?: boolean; /** * Map of connected wallet addresses, allowing your app to pass pre-connected addresses to the widget. * This feature enables the widget to display a specific address as connected for a given chain. * * If a chain ID is mapped to an address, the widget will automatically use it as the connected address for that chain. * * @example * ```tsx * * ``` */ connectedAddresses?: Record; /** * Allow widget to simulate transactions before executing the route to validating gas and balances. * @default true */ simulate?: boolean; disableShadowDom?: boolean; ibcEurekaHighlightedAssets?: IbcEurekaHighlightedAssets; assetSymbolsSortedToTop?: string[]; hideAssetsUnlessWalletTypeConnected?: boolean; batchSignTxs?: boolean; /** * Custom z-index for modals. If not provided, defaults to 10 * @default 10 */ modalZIndex?: number; } & SkipClientOptions & Callbacks & SignerGetters & SetApiOptionsProps; declare type WidgetRouteConfig = RouteRequest & Pick; export { } declare module "styled-components" { interface DefaultTheme extends Theme { } }