βš™
LI.FI SDK Interface
Technical overview about LI.FI's SDK.
interface LIFI {
getPossibilities(request?: PossibilitiesRequest): Promise<PossibilitiesResponse> // request available chains, bridges, exchanges, tokens
getRoutes(routesRequest: RoutesRequest): Promise<RoutesResponse>
getTools(request?: ToolsRequest): Promise<ToolsResponse>
executeRoute(signer: Signer, route: Route, settings?: ExecutionSettings): Promise<Route>
resumeRoute(signer: JsonRpcSigner, route: Route, settings?: ExecutionSettings): Promise<Route> // skips completed steps;
getStepTransaction(step: Step): Promise<StepTransactionResponse>
stopExecution(route: Route): Route // completely halts execution; deletes all execution data for given route
moveExecutionToBackground(route: Route): void // Route execution continues until a user interaction (tx singing) is required
setConfig(configUpdate: ConfigUpdate): Config
getConfig(): Config
updateExecutionSettings(settings: ExecutionSettings, route: Route): void
​
getActiveRoutes(): Route[]
getActiveRoute(route: Route): Route | undefined
getTokenBalance(walletAddress: string, token: Token): Promise<TokenAmount | null>
getTokenBalances(walletAddress: string, tokens: Token[]): Promise<TokenAmount[]>
getTokenBalancesForChains(walletAddress: string, tokensByChain: { [chainId: number]: Token[] }): Promise<{ [chainId: number]: TokenAmount[] }>
​
}
Copy link