LI.FI SDK 包提供对 LI.FI API 的访问,以查找和执行跨各种桥接器和交易所的最佳同链和跨链路由。Documentation Index
Fetch the complete documentation index at: https://docs.li.fi/llms.txt
Use this file to discover all available pages before exploring further.
New: LI.FI's API for Agentic Commerce is live — MCP Server, Agent Skills, and AI-first docs. Learn more
将我们的 LI.FI SDK 集成到您的 dApp/钱包/交换 UI
LI.FI SDK 包提供对 LI.FI API 的访问,以查找和执行跨各种桥接器和交易所的最佳同链和跨链路由。Documentation Index
Fetch the complete documentation index at: https://docs.li.fi/llms.txt
Use this file to discover all available pages before exploring further.
yarn add @lifi/sdk
设置 SDK
import { createConfig } from '@lifi/sdk'
createConfig({
integrator: 'Your dApp/company name',
})
请求报价
import { ChainId, getQuote } from '@lifi/sdk'
const quote = await getQuote({
fromAddress: '0xd8dA6BF26964aF9D7eEd9e03E53415D37aA96045',
fromChain: ChainId.ARB,
toChain: ChainId.OPT,
fromToken: '0x0000000000000000000000000000000000000000',
toToken: '0x0000000000000000000000000000000000000000',
fromAmount: '1000000000000000000',
})
import { createConfig } from '@lifi/sdk'
createConfig({
integrator: 'Your dApp/company name',
})
import { ChainId, getQuote } from '@lifi/sdk'
const quote = await getQuote({
fromAddress: '0xd8dA6BF26964aF9D7eEd9e03E53415D37aA96045',
fromChain: ChainId.ARB,
toChain: ChainId.OPT,
fromToken: '0x0000000000000000000000000000000000000000',
toToken: '0x0000000000000000000000000000000000000000',
fromAmount: '1000000000000000000',
})