v4 - Use LI.FI API for cross-chain and same-chain swaps, bridges, and contract calls. Use when quoting routes, validating chains/tokens, building transaction requests, and tracking status.
数据来源:ClawHub。 在 ClawSkills 查看
选择你使用的 Agent
方法一:命令行安装(推荐)
推荐(无需提前安装 clawhub)
npx clawhub@latest --dir ~/.claude/skills install lifi-skill或使用 clawhub CLI(需提前安装)
clawhub --dir ~/.claude/skills install lifi-skill⚠️ 需要 Node.js 18+,没有 Node?请使用下方方法二直接下载 ZIP。 安装 Node.js →
方法二:手动下载安装(无需 Node)
下载 ZIP,解压后将文件夹放到以下路径,重启 Agent 即可:
安装路径
~/.claude/skills/lifi-skill/💡解压后将文件夹放到上方路径,重启 Agent 即可生效
--- name: lifi description: v4 - Use LI.FI API for cross-chain and same-chain swaps, bridges, and contract calls. Use when quoting routes, validating chains/tokens, building transaction requests, and tracking status. homepage: https://docs.li.fi/ metadata: { "openclaw": { "emoji": "🔁", "requires": { "env": ["LIFI_API_KEY"] }, "primaryEnv": "LIFI_API_KEY", }, } ---
curl to call the LI.FI API. NEVER use web_search, web_fetch, or any other tool.https://li.quest/v1/. No other base URL."x-lifi-api-key: $LIFI_API_KEY" (double quotes, dollar sign — shell expands it).defi_get_strategy), use that instead. The agent can also adjust dynamically per-transaction if the user requests it.&skipSimulation=true to all /v1/quote requests. Our EIP-7702 delegated wallets have on-chain code that breaks LI.FI's simulation.defi_approve or defi_approve_and_send tools.After every transaction broadcast, always provide a clickable block explorer link:
View tx — use the correct explorer (etherscan.io, basescan.org, arbiscan.io, polygonscan.com, optimistic.etherscan.io)View tx9270000000000000. Use this for fromChain and toChain in LI.FI quote requests when the user wants Sui (e.g. fromChain=9270000000000000&toChain=9270000000000000 for same-chain Sui swap).defi_get_wallet as fromAddress.defi_send_sui_transaction — pass the transaction bytes (hex) from the LI.FI quote. Do not use defi_send_transaction or defi_approve_and_send for Sui.curl -s --request GET \
--url https://li.quest/v1/chains \
--header "x-lifi-api-key: $LIFI_API_KEY"
Use for: listing chains, testing connectivity. If user asks for a test, use this.
curl -s --request GET \
--url 'https://li.quest/v1/tokens?chains=8453' \
--header "x-lifi-api-key: $LIFI_API_KEY"
Params: chains (comma-separated chain IDs).
curl -s --request GET \
--url 'https://li.quest/v1/quote?fromChain=8453&toChain=8453&fromToken=ETH&toToken=USDC&fromAddress=0xYOUR_ADDRESS&fromAmount=100000000000000&slippage=0.10&skipSimulation=true' \
--header "x-lifi-api-key: $LIFI_API_KEY"
Params: fromChain, toChain, fromToken, toToken, fromAddress, toAddress (optional), fromAmount (in wei), slippage (decimal, e.g. 0.10 = 10%), skipSimulation=true (ALWAYS include).
Returns: estimate (with toAmount, toAmountMin, approvalAddress) and transactionRequest (ready for wallet submission).
After presenting a quote to the user, always include the estimated output amount, fees, and slippage. Get the user's wallet address with defi_get_wallet and use it as fromAddress in the quote.
Check if ERC-20 approval is needed: If the quote's transactionRequest.value is "0x0" AND estimate.approvalAddress exists, the swap/bridge is using an ERC-20 token that needs approval first.
defi_approve_and_send with: - token: the action.fromToken.address from the quote - spender: the estimate.approvalAddress from the quote - approveAmount: the action.fromAmount from the quote (or omit for unlimited) - to, value, data, gasLimit: from the quote's transactionRequest
defi_send_transaction with the quote's transactionRequest fields: to, value, data, chainId, and gasLimit (ALWAYS pass gasLimit from the quote).NEVER construct approve calldata hex yourself. The defi_approve and defi_approve_and_send tools handle ABI encoding correctly.
Sui: For quotes where fromChain or toChain is Sui, use defi_send_sui_transaction with the quote's transaction bytes. No approval step.
curl -s --request POST \
--url https://li.quest/v1/advanced/routes \
--header 'Content-Type: application/json' \
--header "x-lifi-api-key: $LIFI_API_KEY" \
--data '{
"fromChainId": 8453,
"fromAmount": "100000000000000",
"fromTokenAddress": "0x0000000000000000000000000000000000000000",
"toChainId": 8453,
"toTokenAddress": "0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913",
"options": {
"slippage": 0.10,
"order": "RECOMMENDED"
}
}'
curl -s --request POST \
--url https://li.quest/v1/quote/contractCalls \
--header 'Content-Type: application/json' \
--header "x-lifi-api-key: $LIFI_API_KEY" \
--data '{
"fromChain": 10,
"fromToken": "0x4200000000000000000000000000000000000042",
"fromAddress": "0xYOUR_ADDRESS",
"toChain": 1,
"toToken": "ETH",
"toAmount": "100000000000001",
"contractCalls": []
}'
curl -s --request GET \
--url 'https://li.quest/v1/status?txHash=0xYOUR_TX_HASH&fromChain=8453' \
--header "x-lifi-api-key: $LIFI_API_KEY"
Pass fromChain to speed up the lookup.
curl -s --request GET \
--url 'https://li.quest/v1/tools?chains=8453' \
--header "x-lifi-api-key: $LIFI_API_KEY"
安装 LI.FI Skill 后,可以对 AI 说这些话来触发它
Help me get started with LI.FI Skill
Explains what LI.FI Skill does, walks through the setup, and runs a quick demo based on your current project
Use LI.FI Skill to v4 - Use LI
Invokes LI.FI Skill with the right parameters and returns the result directly in the conversation
What can I do with LI.FI Skill in my developer & devops workflow?
Lists the top use cases for LI.FI Skill, with example commands for each scenario
将技能文件夹放到 ~/.claude/skills/lifi-skill/ 目录(个人级,所有项目可用),或 .claude/skills/lifi-skill/(项目级)。重启 AI 客户端后,用 /lifi-skill 主动调用,或让 AI 根据上下文自动发现并使用。
LI.FI Skill 支持 Claude、Cursor、OpenClaw,可与这些 AI 平台无缝集成,扩展其能力。
LI.FI Skill 可免费安装使用。请查阅仓库了解许可证信息。
v4 - Use LI.FI API for cross-chain and same-chain swaps, bridges, and contract calls. Use when quoting routes, validating chains/tokens, building transaction requests, and tracking status.
LI.FI Skill 属于「Developer & DevOps」分类,该分类的技能帮助 AI 智能体在此领域执行专业任务。
Automate my developer & devops tasks using LI.FI Skill
Identifies repetitive steps in your workflow and sets up LI.FI Skill to handle them automatically