소스 정보
- 저장소
- johnalbertini14-glitch/openclaw-skills
- 최근 소스 활동
- 2026년 2월 2일 18:35
- 감지된 SKILL.md 언어
- 영어
- 스타
- 1
- 포크
- 0
설치 방법
기본적으로 소스를 먼저 확인하는 Prompt가 선택됩니다. 직접 명령으로 전환하거나 로컬 사본을 다운로드할 수도 있습니다.
소스 파일 검토
설치 여부를 결정하기 전에 SKILL.md와 SkillsMP에 표시된 보조 파일을 읽어 보세요.
메뉴
기본적으로 소스를 먼저 확인하는 Prompt가 선택됩니다. 직접 명령으로 전환하거나 로컬 사본을 다운로드할 수도 있습니다.
설치 여부를 결정하기 전에 SKILL.md와 SkillsMP에 표시된 보조 파일을 읽어 보세요.
Codex 또는 Claude로 설치 이 Prompt를 복사해 Codex, Claude 또는 다른 어시스턴트에 붙여 넣으면 Skill 페이지를 검토하고 설치를 진행할 수 있습니다.
직접 명령은 검토 Prompt를 거치지 않습니다. 실행하기 전에 소스를 확인하세요.
npx skills add https://github.com/johnalbertini14-glitch/openclaw-skills --skill trails명령은 한 줄로 유지됩니다. 복사하기 전에 가로로 스크롤해 전체 내용을 확인하세요.
로컬 사본을 원하시나요? SkillsMP에서 현재 제공할 수 있는 파일을 다운로드하세요.
SOC 직업 분류 기준
SKILL.md 표시 중
| 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:
Search for API key in:
.env files → TRAILS_API_KEY or NEXT_PUBLIC_TRAILS_API_KEYIf NO API key found, IMMEDIATELY tell the user:
⚠️ 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:
NEXT_PUBLIC_TRAILS_API_KEY=your_keyTRAILS_API_KEY=your_keyAfter they confirm they have the key, proceed with integration steps.
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:
pnpm add @0xtrails/trails
_app.tsx or layout):
import { TrailsProvider } from '@0xtrails/trails';
import { WagmiProvider } from 'wagmi';
export default function App({ children }) {
return (
<WagmiProvider config={wagmiConfig}>
<TrailsProvider trailsApiKey={process.env.NEXT_PUBLIC_TRAILS_API_KEY}>
{children}
</TrailsProvider>
</WagmiProvider>
);
}
import { TrailsWidget } from '@0xtrails/trails';
<TrailsWidget
mode="pay"
destinationChainId={8453}
destinationTokenAddress="0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913"
destinationAmount="10000000" // ( )
=
/>
User says: "I want to build my own swap UI but use Trails routing."
Response:
pnpm add @0xtrails/trails
import { TrailsProvider, TrailsHookModal } from '@0xtrails/trails';
function App() {
return (
<WagmiProvider config={wagmiConfig}>
<TrailsProvider trailsApiKey={process.env.NEXT_PUBLIC_TRAILS_API_KEY}>
<TrailsHookModal />
{/* Your app */}
</TrailsProvider>
</WagmiProvider>
);
}
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:
pnpm add @0xtrails/trails-apiimport { TrailsAPI } from '@0xtrails/trails-api';
const trails = new TrailsAPI({ apiKey: process.env.TRAILS_API_KEY });
async function executeSettlement() {
// 1. Quote
const quote = await trails.quoteIntent({
sourceChainId: 1,
sourceTokenAddress: '0xA0b86991c6218b36c1d19D4a2e9Eb0cE3606eB48', // USDC
destinationChainId: 8453,
destinationTokenAddress: '0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913',
amount: '1000000000', // 1000 USDC
tradeType: 'EXACT_INPUT',
});
// 2. Commit (locks the quote)
const intent = await trails.commitIntent({ quoteId: quote.quoteId });
// 3. Execute (user signs, or use a signer)
execution = trails.({
: intent.,
});
receipt = trails.({
: intent.,
: ,
});
receipt;
}
Or Raw Fetch (for AI agents like OpenClaw, Python, etc.):
// No npm install needed - just HTTP fetch
const quote = await fetch('https://api.trails.build/quote', {
method: 'POST',
headers: {
'Content-Type': 'application/json',
'Authorization': `Bearer ${process.env.TRAILS_API_KEY}`
},
body: JSON.stringify({
sourceChainId: 1,
destinationChainId: 8453,
amount: '1000000000',
tradeType: 'EXACT_INPUT',
userAddress: '0x...'
})
});
const quoteData = await quote.json();
// Then commit, execute, and poll status via fetch
// See API_RECIPES.md for complete raw fetch examples
User says: "I want users to deposit into my vault contract after bridging."
Response:
EXACT_INPUT — user picks input amount, output is computed. Use placeholder for destination amount in calldata.import { encodeFunctionData } from 'viem';
const vaultAbi = [
{
name: 'deposit',
type: 'function',
inputs: [
{ name: 'amount', type: 'uint256' },
{ name: 'receiver', type: 'address' },
],
outputs: [],
},
] as const;
// Use placeholder for amount (Trails fills actual value)
const PLACEHOLDER_AMOUNT = '0xffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff';
const calldata = encodeFunctionData({
abi: vaultAbi,
functionName: 'deposit',
args: [BigInt(PLACEHOLDER_AMOUNT), userAddress],
});
<TrailsWidget
mode="fund"
destinationChainId={42161}
destinationTokenAddress="0xaf88d065e77c8cC2239327C5EDb3A432268e5831"
destinationRecipient="0xYourVaultContract"
destinationCalldata={calldata}
/>
ALWAYS check if the user has an API key BEFORE providing integration code!
If no API key is found:
Stop and inform the user:
⚠️ You need a Trails API key to use this integration.
Please visit: https://dashboard.trails.build
Steps:
1. Create an account (or sign in if you have one)
2. Navigate to the API Keys section
3. Generate a new API key
4. Copy the key
Once you have your key, add it to your .env file and let me know!
Wait for confirmation that they have the key before proceeding.
Then show them how to add it:
# For client-side (Widget/Headless SDK)
NEXT_PUBLIC_TRAILS_API_KEY=your_api_key
# For server-side (Direct API)
TRAILS_API_KEY=your_api_key
Never generate integration code without first verifying the user has or can get an API key!
// Hooks
import { useSupportedChains, useSupportedTokens } from '@0xtrails/trails';
// Functions
import { getSupportedChains, getSupportedTokens, getChainInfo } from '@0xtrails/trails';
| Mode | TradeType | Meaning |
|---|---|---|
| Pay | EXACT_OUTPUT | User pays whatever needed to get exact destination amount |
| Fund | EXACT_INPUT | User picks input amount, destination computed |
| Swap | Both | User chooses direction |
| Earn | EXACT_INPUT | Deposit into DeFi protocols |
See docs/ for detailed guides:
TRAILS_OVERVIEW.md — Core conceptsINTEGRATION_DECISION_TREE.md — Mode selection flowchartWIDGET_RECIPES.md — Widget examplesHEADLESS_SDK_RECIPES.md — Hooks patternsAPI_RECIPES.md — Server-side flowsCALLDATA_GUIDE.md — Encoding destination callsTROUBLESHOOTING.md — Common issues