Migration guide for upgrading LI.FI SDK v2 to v3
getQuote
function from anywhere using SDK v3, whereas with SDK v2, you had to share a created LiFi
class instance and call getQuote
as a method of that class.
LiFi
interface are no longer needed. The previous interface included:
@lifi/sdk
package. Some of these methods have been renamed to better reflect their functionality or to have a more concise name.
getContractCallQuote
-> getContractCallsQuote
getTokenApproval
-> getTokenAllowance
bulkGetTokenApproval
-> getTokenAllowanceMulticall
approveToken
-> setTokenAllowance
moveExecutionToBackground
-> updateRouteExecution
Ethers.js
library for all EVM-related interactions. However, as the industry evolves, Viem
is gaining wide adoption and starting to replace Ethers.js
.
To ensure our product remains robust and future-proof, we have decided to transition our entire stack to a more reliable solution - Viem
(Wagmi
for the Widget).
Please see the Ethers v5 → viem Migration Guide for more details. Among other notable changes, this transition also replaces all BigNumber utilities we previously used in v2 with the native bigint
primitive.
Ethers.js
Signer object to executeRoute
and other functions for EVM interactions. With the introduction of ecosystem providers, you only need to configure them once when setting up the SDK. After that, you can use executeRoute
and other functions without passing any additional options. The SDK will automatically determine the appropriate ecosystem provider and notify you if no suitable provider is configured.
Read more Introduction to SDK Ecosystem Providers.