βš™
LI.FI SDK Interface
Technical overview about LI.FI's SDK.
1
interface LIFI {
2
3
getPossibilities(request?: PossibilitiesRequest): Promise<PossibilitiesResponse> // request available chains, bridges, exchanges, tokens
4
5
getRoutes(routesRequest: RoutesRequest): Promise<RoutesResponse>
6
7
getTools(request?: ToolsRequest): Promise<ToolsResponse>
8
9
executeRoute(signer: Signer, route: Route, settings?: ExecutionSettings): Promise<Route>
10
11
resumeRoute(signer: JsonRpcSigner, route: Route, settings?: ExecutionSettings): Promise<Route> // skips completed steps;
12
13
getStepTransaction(step: Step): Promise<StepTransactionResponse>
14
15
stopExecution(route: Route): Route // completely halts execution; deletes all execution data for given route
16
17
moveExecutionToBackground(route: Route): void // Route execution continues until a user interaction (tx singing) is required
18
19
setConfig(configUpdate: ConfigUpdate): Config
20
21
getConfig(): Config
22
23
updateExecutionSettings(settings: ExecutionSettings, route: Route): void
24
​
25
getActiveRoutes(): Route[]
26
27
getActiveRoute(route: Route): Route | undefined
28
29
getTokenBalance(walletAddress: string, token: Token): Promise<TokenAmount | null>
30
31
getTokenBalances(walletAddress: string, tokens: Token[]): Promise<TokenAmount[]>
32
33
getTokenBalancesForChains(walletAddress: string, tokensByChain: { [chainId: number]: Token[] }): Promise<{ [chainId: number]: TokenAmount[] }>
34
​
35
}
Copied!
Copy link