A Uniswap‑style swap interface for Bitcoin Runes, built with TanStack Start, TypeScript, and the SatsTerminal SDK, styled in a classic Windows 98 UI theme.
@satsterminal-sdk/swaps) & Laser Eyes (@omnisat/lasereyes)Create a .dev.vars file for local Worker secrets:
SUPABASE_URL=<your-supabase-url>
SUPABASE_ANON_KEY=<your-supabase-anon-key>
ORDISCAN_API_KEY=<your-ordiscan-api-key>
SATS_TERMINAL_API_KEY=<your-satsterminal-api-key>
LIQUIDIUM_API_URL=<liquidium-server-url>
LIQUIDIUM_API_KEY=<your-liquidium-api-key>
The optional VITE_QUOTE_MOCK_ADDRESS belongs in .env.local and is public.
All other variables in .env.example belong in .dev.vars; never prefix service
keys with VITE_.
LIQUIDIUM_API_URL and LIQUIDIUM_API_KEY are used on the server only to
authenticate with Liquidium's API. Never expose service keys to the client.
Client-facing third-party requests such as BTC price fetches are proxied
through local API routes where appropriate to reduce browser-side failures.
QueryClient in src/lib/queryClient.ts with sensible defaults
(retry, staleTime, gcTime, no refetchOnWindowFocus). Use key factories from
src/lib/queryKeys.ts. Prefer useSuspenseQuery for read‑only components
and wrap with error/suspense boundaries at the tab/page level.Use src/lib/logger.ts instead of console.*. Add operation context in APIs
and avoid PII.
# Clone repository
git clone https://github.com/your-username/runesswap.app.git
cd runesswap.app
# Install dependencies
bun install
# Start development server
bun run dev
Visit http://localhost:3000 to explore the app.
# Build for production
bun run build
# Preview the production Worker locally
bun run start
# Build and deploy to Cloudflare Workers
bun run deploy
Production secrets are configured with wrangler secret bulk. See
Cloudflare migration for domain cutover and rollback.
What are Bitcoin Runes?
Bitcoin Runes is a token standard on Bitcoin enabling transfer of fungible assets via inscriptions. Runes maximize efficiency while leveraging Bitcoin's security and decentralization.
How are Runes different from Ordinals?
Ordinals inscribe arbitrary data onto sats, whereas Runes specifically encode fungible token transfers, reducing on‑chain data bloat.
Are swaps instant?
Swaps depend on Bitcoin network confirmations (typically 10 minutes–1 hour). Your wallet will show transaction status once broadcast.
What fees apply?
RunesSwap.app charges no additional fees beyond SatsTerminal network fees and standard Bitcoin miner fees. You receive near‑optimal rates directly on‑chain.
When Liquidium publishes a new OpenAPI spec, regenerate the typed client:
bun run gen:liquidium-sdk
This reads liquidium-openapi/liquidium-instant-loan-api.yaml and outputs the SDK to src/sdk/liquidium. Biome and Jest ignore this folder, so no manual changes are required after regeneration.
Contributions are welcome via pull requests. The Git hooks run lint-staged on
pre-commit and the full bun run ai-check pipeline on pre-push. Please ensure:
bun run build).bun run lint and bun run format:check).bun run knip).MIT © RunesSwap.app
bun run dev runs the app in Cloudflare's local Workers runtime. bun run build
builds the client assets and Worker; bun run start previews that build locally.
bun run ai-check checks lint, architecture, formatting, types, unused code,
unit tests, and the production build.
Deploy with bun run deploy. Runtime secrets must be uploaded separately with
bunx wrangler secret bulk <private-json-file>. Vite embeds only the public
VITE_QUOTE_MOCK_ADDRESS setting. Local .dev.vars files and private secret
exports must never be committed.
User routes live in src/routes; API routes retain their /api/... URLs and
standard JSON envelopes, with business handlers in src/server/api. README and
changelog content is bundled at build time. Wallet SDK modules load only in the
browser because they access browser APIs and generate random values on import.
The pinned SatsTerminal core dependency has a one-line Bun patch replacing
node-fetch with native fetch for Workers compatibility. SDK payloads and
request frequency are unchanged. Recheck the patch when updating that SDK.
See deployment and rollback for the domain cutover.