@titanexchange/titan-api-skill
v1.1.0
Published
Claude Code skill for Titan Swap API — Titan Direct (WebSocket), Titan Gateway (REST), and DART public API for Solana DEX aggregation. Covers Swap V3 (payer, positiveSlippageFeeReceiver) and metadata.ExpectedWinner route selection.
Downloads
162
Readme
Titan Swap API - Claude Skill
Installation
Claude Code plugin (recommended)
This repo is a Claude Code plugin marketplace. Install directly from inside Claude Code — no Node, no npm:
/plugin marketplace add Titan-Pathfinder/titan-api-claude-skills
/plugin install titan-swap-api@titan-exchangeUpdates and uninstalls are managed natively via /plugin. Then type /titan-swap-api in Claude Code to invoke the skill.
npx (alternative)
If you'd rather install via npm:
For current project:
npx @titanexchange/titan-api-skillFor all projects (global):
npx @titanexchange/titan-api-skill --globalOverwrite existing install:
npx @titanexchange/titan-api-skill --forceManual install (curl)
If you prefer not to use npx or the plugin system:
Global:
mkdir -p ~/.claude/skills/titan-swap-api
curl -o ~/.claude/skills/titan-swap-api/SKILL.md \
https://raw.githubusercontent.com/Titan-Pathfinder/titan-api-claude-skills/main/skills/titan-swap-api/SKILL.mdProject-level:
mkdir -p .claude/skills/titan-swap-api
curl -o .claude/skills/titan-swap-api/SKILL.md \
https://raw.githubusercontent.com/Titan-Pathfinder/titan-api-claude-skills/main/skills/titan-swap-api/SKILL.mdWhat This Skill Provides
- Protocol-aware code generation — Generates TypeScript with correct MessagePack encoding, BigInt amounts, and bs58-decoded token mints matching the Titan WebSocket API spec.
- SDK and raw WebSocket support — Covers both SDK-based and direct WebSocket integration depending on developer needs.
- Parameter structure enforcement — Places fields like
slippageBps,intervalMs, andnum_quotesin their correct nested objects matching the expected request schema. - Runnable examples included — Ships with working TypeScript examples that can be executed directly after setting up environment config.
Quick Example
Ask Claude Code:
"Help me stream USDC to SOL quotes using Titan API"
Claude will guide you through:
import { V1Client } from "@titanexchange/sdk-ts";
import bs58 from "bs58";
const client = await V1Client.connect(`${WS_URL}?auth=${AUTH_TOKEN}`);
const { stream } = await client.newSwapQuoteStream({
swap: {
inputMint: bs58.decode("EPjFWdd5AufqSSqeM2qN1xzybapC8G4wEGGkZwyTDt1v"),
outputMint: bs58.decode("So11111111111111111111111111111111111111112"),
amount: BigInt(100_000_000), // 100 USDC - must be BigInt!
},
transaction: {
userPublicKey: bs58.decode(USER_PUBLIC_KEY),
},
});
for await (const quotes of stream) {
console.log(quotes);
}Runnable Examples
The /examples directory contains working TypeScript examples:
cd examples
npm install
cp .env.example .env
# Edit .env with your credentials
npm run stream-sdk # SDK streaming
npm run stream-raw # Raw WebSocket
npm run proxy # Backend proxyKey Things to Know
| Topic | Details |
|-------|---------|
| Protocol | WebSocket + MessagePack (not JSON) |
| Amount | Must be BigInt, not number |
| Token mints | Must be Uint8Array via bs58.decode() |
| Parameters | slippageBps in swap, intervalMs in update |
Required Credentials
| Variable | Description |
|----------|-------------|
| WS_URL | Titan WebSocket endpoint |
| AUTH_TOKEN | API authentication token |
Resources
License
MIT
