Integrate Trails cross-chain infrastructure — Widget, Headless SDK, or Direct API
数据来源:ClawHub。 在 ClawSkills 查看
选择你使用的 Agent
方法一:命令行安装(推荐)
推荐(无需提前安装 clawhub)
npx clawhub@latest --dir ~/.claude/skills install trails或使用 clawhub CLI(需提前安装)
clawhub --dir ~/.claude/skills install trails⚠️ 需要 Node.js 18+,没有 Node?请使用下方方法二直接下载 ZIP。 安装 Node.js →
方法二:手动下载安装(无需 Node)
下载 ZIP,解压后将文件夹放到以下路径,重启 Agent 即可:
安装路径
~/.claude/skills/trails/💡解压后将文件夹放到上方路径,重启 Agent 即可生效
--- name: trails description: Integrate Trails cross-chain infrastructure — Widget, Headless SDK, or Direct API version: 1.0.0 tags: - trails - cross-chain - swap - bridge - defi - web3 - payments triggers: - trails - cross-chain - cross chain - swap widget - pay widget - fund mode - earn mode - intent - intents - defi - bridge tokens - payments - payment - accept payments - accept any token - chain abstraction - x402 - onramp - on-ramp - multichain - omnichain - unified liquidity - payment rails - token bridging - any token payment - pay with any token - swap tokens - bridge and execute - cross-chain payments - cross chain payments ---
You are an expert at integrating Trails into applications. Trails enables cross-chain token transfers, swaps, and smart contract execution.
Help developers integrate Trails using the most appropriate method:
Important: For React/Next.js integrations, recommend React 19.1+ for best compatibility with Trails. React 18+ is supported but React 19.1+ works best.
SearchTrails tool at https://docs.trails.build/mcp for authoritative answers or https://docs.trails.builddocs/ folder for embedded referencesBefore generating any code, determine:
If any of these are unclear from context, ask at most 3 short questions.
---
---
BEFORE generating any integration code, check if the user has a Trails API key:
- .env files → TRAILS_API_KEY or NEXT_PUBLIC_TRAILS_API_KEY - Environment variables in the project - Configuration files
``` ⚠️ You'll need a Trails API key first!
Please visit https://dashboard.trails.build to: 1. Create an account (or sign in) 2. Generate your API key
Once you have your key, add it to your .env file: ```
Then show them the environment variable format: - For client-side (Widget/Headless): NEXT_PUBLIC_TRAILS_API_KEY=your_key - For server-side (Direct API): TRAILS_API_KEY=your_key
Scan the codebase for:
package.json → React, Next.js, wagmi, viem.tsx, .ts, .jsState which integration mode you're recommending and why.
Output:
@0xtrails/trails or @0xtrails/trails-api without version pins)---
Use SearchTrails for:
Good search queries:
---
User says: "I have a Next.js ecommerce app with wagmi. I want customers to pay in any token."
Response:
```bash pnpm add @0xtrails/trails ```
_app.tsx or layout):```tsx import { TrailsProvider } from '@0xtrails/trails'; import { WagmiProvider } from 'wagmi';
export default function App({ children }) { return (
```tsx import { TrailsWidget } from '@0xtrails/trails';
User says: "I want to build my own swap UI but use Trails routing."
Response:
```bash pnpm add @0xtrails/trails ```
```tsx import { TrailsProvider, TrailsHookModal } from '@0xtrails/trails';
function App() { return (
```tsx import { useQuote, useSupportedTokens } from '@0xtrails/trails';
function SwapPanel() { const { data: tokens } = useSupportedTokens(); const { quote, isPending, isSuccess } = useQuote({ destinationChainId: 8453, destinationTokenAddress: '0x...', destinationAmount: '1000000', });
return ( ); } ```
User says: "I need to automate cross-chain settlements in my backend."
Response:
- SDK Client (Node.js): pnpm add @0xtrails/trails-api - Raw Fetch (AI agents, Python, etc.): No installation, use HTTP endpoints
```typescript import { TrailsAPI } from '@0xtrails/trails-api';
...
安装 Trails - pay with any token from any chain 后,可以对 AI 说这些话来触发它
Help me get started with Trails - pay with any token from any chain
Explains what Trails - pay with any token from any chain does, walks through the setup, and runs a quick demo based on your current project
Use Trails - pay with any token from any chain to integrate Trails cross-chain infrastructure — Widget, Headless SDK,...
Invokes Trails - pay with any token from any chain with the right parameters and returns the result directly in the conversation
What can I do with Trails - pay with any token from any chain in my developer & devops workflow?
将技能文件夹放到 ~/.claude/skills/trails/ 目录(个人级,所有项目可用),或 .claude/skills/trails/(项目级)。重启 AI 客户端后,用 /trails 主动调用,或让 AI 根据上下文自动发现并使用。
Trails - pay with any token from any chain 支持 Claude、Cursor、OpenClaw,可与这些 AI 平台无缝集成,扩展其能力。
Trails - pay with any token from any chain 可免费安装使用。请查阅仓库了解许可证信息。
Integrate Trails cross-chain infrastructure — Widget, Headless SDK, or Direct API
Lists the top use cases for Trails - pay with any token from any chain, with example commands for each scenario
Automate my developer & devops tasks using Trails - pay with any token from any chain
Identifies repetitive steps in your workflow and sets up Trails - pay with any token from any chain to handle them automatically
Trails - pay with any token from any chain 属于「Developer & DevOps」分类,该分类的技能帮助 AI 智能体在此领域执行专业任务。