Function useRoute

  • React hook to get the Skip Route Quote for an amount, a source token/chain and destination token/chain pair

    Parameters

    • amountIn: string
    • Optional sourceAsset: Asset
    • Optional sourceAssetChain: ChainData
    • Optional destinationAsset: Asset
    • Optional destinationAssetChain: ChainData
    • enabled: boolean = true
    • Optional allowedBridges: BRIDGES[]

    Returns {
        amountOut: string;
        isLoadingRoute: boolean;
        refresh: (() => Promise<any>);
        routeError: any;
        routeResponse: undefined | {
            amountIn: string;
            amountOut: string;
            destinationAsset: Asset;
            destinationAssetChain: ChainData;
            operations: any[];
            response: RouteResponse;
            sourceAsset: Asset;
            sourceAssetChain: ChainData;
            transactionCount: number;
        };
    }

    • amountOut: string
    • isLoadingRoute: boolean
    • Readonly refresh: (() => Promise<any>)
        • (): Promise<any>
        • Returns Promise<any>

    • routeError: any
    • routeResponse: undefined | {
          amountIn: string;
          amountOut: string;
          destinationAsset: Asset;
          destinationAssetChain: ChainData;
          operations: any[];
          response: RouteResponse;
          sourceAsset: Asset;
          sourceAssetChain: ChainData;
          transactionCount: number;
      }