Skip to content

wandevs/xflows-open-api

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

XFlows OpenAPI

OpenAPI 3.1 specification and Swagger UI for the Wanchain XFlows cross-chain swap & bridge API, hosted on Cloudflare Workers.

🔗 Live: https://xflows-open-api.wanscan.org 📄 Spec: https://xflows-open-api.wanscan.org/openapi.json


What is XFlows?

XFlows is Wanchain's decentralized cross-chain solution. It uses decentralized liquidity pools to perform native-to-native cross-chain asset transfers, aggregating WanBridge, XPort, QUiX, and other underlying protocols.

It supports 6 work modes:

Mode Flow
1 Direct bridge via WanBridge
2 Direct bridge via QUiX
3 Bridge → swap on destination chain
4 Bridge → Wanchain → swap → bridge out
5 Swap only (on Wanchain, or other chains via Rubic)
6 Swap on Wanchain → bridge out

Endpoints documented

Method Path Purpose
GET /api/v3/supported/chains List supported chains
GET /api/v3/supported/tokens List supported tokens
GET /api/v3/supported/pairs List direct-bridge token pairs
GET /api/v3/supported/bridges List supported bridges (wanbridge, quix)
GET /api/v3/supported/dexes List supported DEXes (wanchain, rubic)
POST /api/v3/quote Get the best cross-chain swap quote
POST /api/v3/buildTx Build wallet-ready transaction data
POST /api/v3/status Query cross-chain transaction status

The spec includes complete request/response examples for all 6 work modes and for buildTx payloads across EVM, Bitcoin, Cardano, Solana, SUI, and Tron source chains.

Project layout

.
├── public/
│   ├── index.html       # Swagger UI (loads /openapi.json from CDN)
│   └── openapi.json     # OpenAPI 3.1 spec — single source of truth
├── wrangler.jsonc       # Cloudflare Workers static-assets config
├── package.json         # Scripts: dev / deploy / validate
└── .gitignore

The Cloudflare Worker is assets-only — no Worker script is required; public/ is served directly by Workers Static Assets.

Prerequisites

  • Bun ≥ 1.0
  • Wrangler ≥ 3.90 (bun add -g wrangler)
  • A Cloudflare account (run wrangler login once)

Local development

bun install
bun run dev          # http://localhost:8787

Edit public/openapi.json — Swagger UI auto-reloads on refresh.

Validation

bun run validate                           # quick JSON parse check
bunx @redocly/cli lint public/openapi.json # full OpenAPI lint

Deploy

bun run deploy       # wrangler deploy

The production site is served at https://xflows-open-api.wanscan.org via a Cloudflare Workers custom domain. The *.workers.dev URL also works as a fallback. To bind another custom domain, add a routes block to wrangler.jsonc:

"routes": [
  { "pattern": "xflows-open-api.wanscan.org", "custom_domain": true }
]

Editing the spec

public/openapi.json is the only source of truth. The flow is:

  1. Edit public/openapi.json.
  2. Run bunx @redocly/cli lint public/openapi.json to verify.
  3. Run bun run deploy.

References

License

Documentation is proprietary to Wanchain. The repository scaffolding (Worker config, Swagger UI loader) is MIT-style — use freely.

About

xflows-open-api

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages