convez.ai
SkillIntegração & APIsAvançado
to-nexus

CrossDefi Swap-Bridge Driver

to-nexus/skill-cross-crossd

Driver de swap-bridge multi-chain para BSC, CROSS Chain e Klaytn

Ver no GitHub
InicialPluginScore · de 0 a 100

Skill para Claude que opera o backend do CrossDefi swap-bridge, gerenciando operações de swap e bridge entre BSC, CROSS Chain e Klaytn. Suporta leitura de pares, metadata de tokens, construção de quotes com ETA e rotas, consulta de status de bridge e histórico de transações.

Instalação

$npx convez-ai to-nexus/skill-cross-crossd

1 comando no terminal: detecta o formato do repositório (marketplace ou plugin avulso) e instala via Claude Code. Requer Node 18+ e o Claude Code instalado.

Métricas

Estrelas
0
Forks
0
Acompanhando
0
Saúde
37%
Último commit
há 5 meses
Versão
—
Issues abertas
0
Contribuidores
1

Casos de uso

  • Consultar pares e pools de swap disponíveis entre cadeias
  • Gerar quotes de preço com estimativa de tempo e rotas otimizadas
  • Executar operações de bridge de tokens entre cadeias (nativo, permit, approve)
  • Monitorar status de transações de bridge em tempo real

Veredito

Ferramenta especializada e bem estruturada para integração com a infraestrutura CrossDefi. Exige conhecimento técnico de blockchain (EOA, EIP-2612, gas dynamics) e é ideal para desenvolvedores que precisam orquestrar operações de bridge multi-chain programaticamente.

README

A tradução para o português deste README ainda está na fila.

cross-crossd

A Claude Code skill that drives the CrossDefi swap-bridge backend (https://www.crossdefi.io/swap-bridge) — list supported pairs, resolve token metadata, build quotes (ETA + swap-pool route), poll bridge status, and read history. Targets BSC (chain id 56), CROSS Chain (612055), and Klaytn (8217).

  • Stack: EOA + viem (no ERC-4337, no paymaster, no Playwright)
  • Backends:
    • bridge-api.crosstoken.io/bridge/* — pairs, swap-pools, tx-time, token-config, permit, permit-hash, check-cached-tx-hashes, history
    • wallet-server.crosstoken.io/v1/public/* — chain info, token metadata, gas suggestion
  • Subcommands: pairs, tokens, quote, status, history, bridge
  • Distribution: standalone Claude skill and wrapped as a Claude Code plugin

v0.2 ships read + write. bridge.mjs auto-detects the right execution path per the live frontend logic:

  • native — from-token is the chain's native asset → encodes bridgeToken(...) against the source-chain bridge router and sends the tx with msg.value = value + gasFee + exFee. Returns the on-chain tx hash.
  • permit — from-token supports EIP-2612 → signs typed data offline, POSTs to /bridge/permit. The backend submits the on-chain call; the user pays no source-chain gas. Returns the permitId.
  • approve — non-permit ERC-20 → approves the bridge router (exact amount by default; --max-approve for unlimited), then sends bridgeToken(...) with msg.value = 0. Returns approve + bridge tx hashes.

Override with --path=native|permit|approve if needed.


Install — Recommended (via Marketplace)

/plugin marketplace add github.com/to-nexus/cross-skills-suite
/plugin install cross-crossd@cross-skills-suite

Part of the CROSS Skills Suite — installs alongside cross-rewards, cross-dex-trade, cross-prediction.


Install — Standalone

Option 1 — Plain skill (one user, fastest)

git clone <this-repo> /tmp/skill-cross-crossd
bash /tmp/skill-cross-crossd/install.sh        # symlinks into ~/.claude/skills/

Or manually:

cp -r skills/cross-crossd ~/.claude/skills/
cd ~/.claude/skills/cross-crossd && npm install

Option 2 — Claude Code plugin (marketplace-installable)

{
  "name": "cross-crossd",
  "source": { "source": "github", "repo": "to-nexus/skill-cross-crossd" },
  "category": "blockchain"
}

Configuration

Read-path commands (pairs, tokens, quote, status) do not require a private key. Only history and bridge need one.

cp skills/cross-crossd/.env.example skills/cross-crossd/.env
chmod 600 skills/cross-crossd/.env
VariableRequiredDefaultNotes
PRIVATE_KEYonly for history / future bridge—EOA signer, 0x + 64 hex chars
WALLET_ADDRESSoptionalderived from PKMismatch warns via signerWarn
BSC_RPC_URLoptionalwallet-server lookupOverride only if you have a private RPC
CROSS_RPC_URLoptionalwallet-server lookupOverride only if you have a private RPC
KLAYTN_RPC_URLoptionalwallet-server lookupOverride only if you have a private RPC
MAX_BRIDGE_NOTIONALrecommendedunsetPer-bridge cap; aborts above this
CONFIRM_THRESHOLDrecommended1Bridges above this require --confirm
MIN_GAS_NATIVEoptional0.001Source-chain native floor

Quick start

Inside Claude Code, just describe the action in plain language. The skill activates on phrases like:

  • "list bridge pairs"
  • "BSC에서 CROSS로 브릿지"
  • "USDT BSC to CROSS"
  • "swap-bridge 견적 1 USDT"
  • "내 브릿지 진행상황 0xabc..."
  • "permit-hash status 12345"

Direct CLI:

cd ~/.claude/skills/cross-crossd
node scripts/pairs.mjs
node scripts/tokens.mjs --chain 56
node scripts/quote.mjs 56-0x6bf62ca91e397b5a7d1d6bce97d9092065d7a510 612055-0x0000000000000000000000000000000000000001 1.0
node scripts/status.mjs <permitId>
node scripts/status.mjs --tx 0xabc...
PRIVATE_KEY=0x... node scripts/history.mjs
PRIVATE_KEY=0x... node scripts/bridge.mjs 612055-0x0000000000000000000000000000000000000001 56-0x6bf62ca91e397b5a7d1d6bce97d9092065d7a510 1.0 --confirm

All commands emit a single JSON object on stdout.


Layout

skill-cross-crossd/                     # repo root = plugin
├── .claude-plugin/plugin.json          # plugin manifest
├── install.sh                          # symlink installer
├── README.md
├── LICENSE
└── skills/
    └── cross-crossd/                   # the skill itself
        ├── SKILL.md
        ├── package.json
        ├── .env.example
        ├── scripts/
        │   ├── _api.mjs                # bridge-api + wallet-server fetch wrapper, snake↔camel
        │   ├── _chain.mjs              # chain registry (56 / 612055 / 8217); RPC resolution
        │   ├── _signer.mjs             # PK → wallet client; mismatch warn
        │   ├── _abi.mjs                # ERC20 minimal ABI; bridge-router ABIs left null
        │   ├── _guard.mjs              # chain, gas, cap, confirm gates
        │   ├── pairs.mjs               # GET /bridge/pairs
        │   ├── tokens.mjs              # wallet-server token metadata, iter via /pairs
        │   ├── quote.mjs               # /tx-time + /token-config + /swap-pools
        │   ├── status.mjs              # GET /bridge/permit-hash/{id} or check-cached-tx-hashes
        │   ├── history.mjs             # POST /bridge/history
        │   └── bridge.mjs              # native / permit / approve auto-dispatch
        └── references/cross-crossd.md  # chain map, endpoints, derivation provenance

Safety model

The skill enforces these rails on every write op via _guard.mjs:

  1. Source-chain id check — every signed tx aborts unless eth_chainId matches the <FROM> chain id.
  2. MAX_BRIDGE_NOTIONAL — env cap; aborts when amount exceeds it.
  3. CONFIRM_THRESHOLD + --confirm gate — any bridge above this aborts with awaiting_confirm.
  4. MIN_GAS_NATIVE pre-flight — aborts if source-chain native balance < this.
  5. Pair existence guard — refuses to sign for any pair not present in /bridge/pairs.
  6. WALLET_ADDRESS mismatch warning — non-null signerWarn when env disagrees with PK-derived address.

The private key never appears in the Claude transcript unless the user pastes it in directly. Even then it's passed via process.env to the spawned node, never echoed back.


License

MIT — but read the disclaimer at the bottom of the LICENSE file before using.

Ver o original no GitHub

Bom para

Relacionados