LI.FI - Bridge & DEX aggregation: Any-to-Any Cross-Chain-Swap SDK
APACHE-2.0 License
LI.FI SDK provides a powerful toolkit for developers to enable seamless cross-chain and on-chain swaps and bridging within their applications. Our JavaScript/TypeScript SDK can be implemented in front-end or back-end environments, allowing you to build robust UX/UI around our advanced bridge and swap functionalities. LI.FI SDK efficiently manages all communications between our smart routing API and smart contracts and ensures optimal performance, security, and scalability for your cross-chain and on-chain needs.
LI.FI SDK features include:
yarn add @lifi/sdk
or
npm install --save @lifi/sdk
Firstly, create SDK config with your integrator string.
import { createConfig } from '@lifi/sdk'
createConfig({
integrator: 'Your dApp/company name',
})
Now you can interact with the SDK and for example request a quote.
import { ChainId, getQuote } from '@lifi/sdk'
const quote = await getQuote({
fromAddress: '0xd8dA6BF26964aF9D7eEd9e03E53415D37aA96045',
fromChain: ChainId.ARB,
toChain: ChainId.OPT,
fromToken: '0x0000000000000000000000000000000000000000',
toToken: '0x0000000000000000000000000000000000000000',
fromAmount: '1000000000000000000',
})
See examples folder in this repository.
Please checkout the SDK documentation and our API reference for further information.
The changelog is regularly updated to reflect what's changed in each new release.
This project is licensed under the terms of the Apache-2.0.