mirror of
https://github.com/alsk1992/CloddsBot.git
synced 2026-10-02 02:54:40 +08:00
placeOrder/cancelOrder/cancelAllOrders/getBalance/getPositions/getOpenOrders
all called a plain X-API-Key REST API that doesn't match how Lighter (a
zk-rollup) actually works: every order/cancel is an L2 transaction, signed
by a native binary the official SDK loads via ctypes (compiled from
github.com/elliottech/lighter-go) — there's no published algorithm spec to
reimplement in TypeScript, and Lighter's own official AI-agent integration
(elliottech/lighter-agent-kit) works the same way: Python calling the real
SDK, not a from-scratch reimplementation in the host language.
New scripts/lighter-bridge/bridge.py wraps the official lighter-sdk (pinned
to a specific commit, matching elliottech/lighter-agent-kit's own lockfile),
invoked as a subprocess from src/exchanges/lighter/index.ts — one JSON
request in on stdin, one JSON result out on stdout, mirroring the existing
Rust fast-broadcast subprocess pattern (src/evm/fast-broadcast.ts) so both
"shell out to a real, verified implementation" paths in this codebase look
and behave the same way. Lazily pip-installs into a local .vendor/ dir on
first use, so nothing needs a pre-existing venv.
Verified live against mainnet: the bridge reaches Lighter's real API,
correctly loads the native signer, and gets back a genuine server response
("invalid account index" for a made-up test account) — proving the full
chain (bootstrap -> native signer load -> key validation -> live network
call) works end to end.
Also rewrote LighterOrder/LighterPosition/LighterBalance to match the real
API response shapes (verified against elliottech/lighter-agent-kit's
schemas-read.md) instead of the old guessed shape, and fixed several stale
"Lighter orderbook DEX on Arbitrum" doc/description strings — Lighter is its
own standalone zk-rollup, unrelated to Arbitrum.
88 lines
1.4 KiB
Plaintext
88 lines
1.4 KiB
Plaintext
# Dependencies
|
|
node_modules/
|
|
|
|
# Build output
|
|
dist/
|
|
rust/**/target/
|
|
scripts/lighter-bridge/.vendor/
|
|
__pycache__/
|
|
*.pyc
|
|
|
|
# Environment
|
|
.env
|
|
.env.local
|
|
.env.*.local
|
|
|
|
# IDE
|
|
.vscode/
|
|
.idea/
|
|
*.swp
|
|
*.swo
|
|
.DS_Store
|
|
|
|
# Logs
|
|
*.log
|
|
logs/
|
|
|
|
# Runtime data
|
|
pids/
|
|
*.pid
|
|
*.seed
|
|
*.pid.lock
|
|
|
|
# Coverage
|
|
coverage/
|
|
|
|
# Frontend apps - LOCAL ONLY, never push but NEVER DELETE
|
|
# Deploy via: cd apps/docs && vercel --prod --yes
|
|
apps/
|
|
.nyc_output/
|
|
|
|
# TypeScript cache
|
|
*.tsbuildinfo
|
|
|
|
# Local config
|
|
.vercel/
|
|
|
|
# =============================================================================
|
|
# Development/Internal - Not for production repo
|
|
# =============================================================================
|
|
|
|
# Frontend website (separate repo: cloddsbot-docs)
|
|
apps/
|
|
|
|
# Placeholder folders
|
|
ui/
|
|
vendor/
|
|
|
|
# Development workspace
|
|
workspace/
|
|
|
|
# Large binary files (use GitHub releases)
|
|
*.gif
|
|
*.mp4
|
|
demo.tape
|
|
assets/frames/
|
|
|
|
# Internal planning docs
|
|
PLAN.md
|
|
TODO.md
|
|
IMPLEMENTATION_AUDIT.md
|
|
CLAWDBOT_ARCHITECTURE.md
|
|
|
|
# MCP config (user-specific)
|
|
.mcp.json
|
|
|
|
# Temp files
|
|
*.bak
|
|
*~
|
|
|
|
# =============================================================================
|
|
# PRIVATE SERVER INFRASTRUCTURE - Never push to public GitHub
|
|
# Deploy to hostkey only via rsync
|
|
# =============================================================================
|
|
|
|
# Standalone compute API server (monetization layer — hosted only)
|
|
src/api/
|
|
.vercel
|