Overview

supportedTokens

Returns the list of Tokens supported by Fibrous Finance

/**
 * Supported token list
*/
supportedTokens(): Promise<Record<string, Token>>;

supportedProtocols

Returns the list of Protocols supported by Fibrous Finance

/**
 * @returns Supported protocol list
*/
supportedProtocols(): Promise<Record<string, ProtocolId>>;

getBestRoute

Returns the best route via Fibrous Finance

 /**
  * Gets the best route from the API
  * @param amount: Amount to swap, formatted
  * @param tokenInAddress: Token to swap from
  * @param tokenOutAddress: Token to swap to
  * @param options: Optional parameters
  * @returns Route response
  * @throws Error if the API returns an error
 */
getBestRoute(amount: BigNumber, tokenInAddress: string, tokenOutAddress: string, options?: Partial<RouteOverrides>): Promise<RouteResponse>;

buildTransaction

Returns calldata with best route to transaction via Fibrous Finance

/**
 * Builds a Starknet transaction out of the route response
 * @param amount: Amount to swap, formatted
 * @param tokenInAddress: Token to swap from
 * @param tokenOutAddress: Token to swap to
 * @param slippage: Slippage percentage (0.01 = 1%)
 * @param receiverAddress: Address to receive the tokens
*/
buildTransaction(
    amount: BigNumber,
    tokenInAddress: string,
    tokenOutAddress: string,
    slippage: number,
    receiverAddress: string
): Transaction;

Last updated