UNPKG

@multiversx/sdk-dapp-swap

Version:

A library to hold the main logic for swapping between tokens on the MultiversX blockchain

34 lines 1.35 kB
/// <reference types="react" /> import { OperationVariables } from '@apollo/client'; import { IPlainTransactionObject } from 'lib'; import { EsdtType, SwapRouteType, SwapActionTypesEnum } from 'types'; export interface GetSwapRouteType { amountIn?: string; tokenInID: string; amountOut?: string; tokenOutID: string; tolerancePercentage?: number; wrappingAmount?: string; } export interface GetSwapRouteVariablesType extends Omit<GetSwapRouteType, 'tolerancePercentage'> { tolerance?: number; } export interface UseSwapRouteType { swapRouteError?: string; swapRoute?: SwapRouteType; isSwapRouteError?: boolean; isAmountInLoading: boolean; isSwapRouteLoading: boolean; isAmountOutLoading: boolean; transactions?: IPlainTransactionObject[]; swapActionType?: SwapActionTypesEnum; previousFetchVariables: React.MutableRefObject<GetSwapRouteVariablesType | undefined>; getSwapRoute: (props: GetSwapRouteType) => void; refetch: (variables?: Partial<OperationVariables>) => void; } export declare const useSwapRoute: ({ wrappedEgld, isPollingEnabled, pollingIntervalMiliseconds }: { wrappedEgld?: EsdtType | undefined; pollingIntervalMiliseconds?: number | undefined; isPollingEnabled?: boolean | undefined; }) => UseSwapRouteType; //# sourceMappingURL=useSwapRoute.d.ts.map