← 返回
开发者工具 中文

Xflows Bridge

Cross-chain bridge operations using the xflows CLI (Wanchain XFlows). Use when the user wants to: (1) create or manage crypto wallets for cross-chain use, (2...
跨链桥操作使用 xflows CLI(Wanchain XFlows)。适用于用户想要:① 创建或管理用于跨链的加密钱包,② ...
lolieatapple
开发者工具 clawhub v0.2.0 2 版本 99856.7 Key: 无需
★ 0
Stars
📥 697
下载
💾 4
安装
2
版本
#latest

概述

XFlows Cross-Chain Bridge

Operate the xflows CLI to perform cross-chain bridge transactions via the Wanchain XFlows protocol, as well as same-chain native token and ERC20 token transfers.

Prerequisites

Ensure xflows is installed: npm install -g xflows. Verify with xflows --version.

Core Workflow

For any cross-chain transfer, follow this sequence:

  1. Wallet -- Ensure a wallet exists (xflows wallet list), create if needed
  2. Discover -- Find supported chains, tokens, and pairs for the route
  3. Quote -- Get estimated output and fees
  4. Send -- Execute with --dry-run first, then for real
  5. Track -- Monitor status until completion

Command Quick Reference

See references/commands.md for complete flag details.

Wallet Management

xflows wallet create --name <n>                                    # new wallet
xflows wallet create --name <n> --encrypt --password <pw>          # encrypted
xflows wallet create --name <n> --private-key 0x...                # import key
xflows wallet list                                                 # list all
xflows wallet show --name <n> [--password <pw>]                    # show key
xflows wallet balance --name <n> --chain-id <id> [--password <pw>] # balance (own wallet)
xflows wallet balance --address <addr> --chain-id <id>             # balance (any address)
xflows wallet token-balance --name <n> --chain-id <id> --token <addr> [--decimals <n>] [--password <pw>] [--rpc <url>] # ERC20 balance (own wallet)
xflows wallet token-balance --address <addr> --chain-id <id> --token <addr> [--decimals <n>] [--rpc <url>] # ERC20 balance (any address)
xflows wallet delete --name <n> --force                            # delete

Query Routes

xflows chains [--chain-id <id>] [--quix]          # supported chains
xflows tokens [--chain-id <id>] [--quix]          # supported tokens
xflows pairs --from-chain <id> [--to-chain <id>]  # bridgeable pairs
xflows bridges                                     # available bridges
xflows dexes                                       # available DEXes
xflows rpc                                         # configured RPC endpoints

Quote

xflows quote \
  --from-chain <id> --to-chain <id> \
  --from-token <addr> --to-token <addr> \
  --from-address <addr> --to-address <addr> \
  --amount <amount> \
  [--bridge wanbridge|quix] [--slippage 0.01] [--dex wanchain|rubic]

Send Transaction

xflows send \
  --wallet <name> [--password <pw>] \
  --from-chain <id> --to-chain <id> \
  --from-token <addr> --to-token <addr> \
  --to-address <addr> --amount <amount> \
  [--bridge wanbridge|quix] [--slippage 0.01] [--dry-run] [--gas-limit <n>] [--rpc <url>]

Transfer (Same-Chain Native Token)

xflows transfer --wallet <name> --chain-id <id> --to <addr> --amount <amount> \
  [--password <pw>] [--rpc <url>] [--gas-limit <n>] [--dry-run]

Transfer Token (Same-Chain ERC20)

xflows transfer-token --wallet <name> --chain-id <id> \
  --token <addr> --to <addr> --amount <amount> \
  [--decimals <n>] [--password <pw>] [--rpc <url>] [--gas-limit <n>] [--dry-run]
  • Auto-detects token decimals and symbol from the contract (or use --decimals to override)
  • Checks token balance before sending

Track Status

xflows status \
  --hash <txHash> \
  --from-chain <id> --to-chain <id> \
  --from-token <addr> --to-token <addr> \
  --from-address <addr> --to-address <addr> \
  --amount <amount> \
  [--poll --interval 10]

Key Concepts

Token Addresses

  • Native tokens (ETH, BNB, MATIC, WAN, etc.): 0x0000000000000000000000000000000000000000
  • ERC-20 tokens: find via xflows tokens --chain-id

Common Chain IDs

ChainIDChainID
----------------------
Ethereum1Arbitrum42161
BSC56Optimism10
Polygon137Base8453
Avalanche43114Wanchain888

Query Any Address Balance

Both wallet balance and wallet token-balance support --address to query any address without needing a local wallet:

# Check any address's ETH balance
xflows wallet balance --address 0xd8dA6BF26964aF9D7eEd9e03E53415D37aA96045 --chain-id 1

# Check any address's USDC balance
xflows wallet token-balance --address 0xd8dA6BF26964aF9D7eEd9e03E53415D37aA96045 \
  --chain-id 1 --token 0xA0b86991c6218b36c1d19D4a2e9Eb0cE3606eB48

Provide either --name (local wallet) or --address (any address). When --address is used, no wallet file or password is needed.

Encrypted Wallets

When a wallet was created with --encrypt, every command that uses the private key (send, transfer, transfer-token, wallet show, wallet balance) requires --password .

Wanchain Gas Rule

Sending from Wanchain (chainId 888) automatically enforces minimum gasPrice of 1 gwei. No manual action needed.

Status Codes

CodeMeaningTerminal?
--------------------------
1SuccessYes
2FailedYes
3ProcessingNo
4/5RefundedYes
6Trusteeship (manual intervention)Yes
7Risk transaction (AML flagged)Yes

Patterns

Find a Token Address

xflows tokens --chain-id 1 | jq '.data[] | select(.tokenSymbol == "USDC")'

Safe Execution (always dry-run first)

# Preview
xflows send --wallet alice --from-chain 1 --to-chain 56 \
  --from-token 0x0000000000000000000000000000000000000000 \
  --to-token 0x0000000000000000000000000000000000000000 \
  --to-address 0xRecipient --amount 0.1 --dry-run

# Execute (remove --dry-run)
xflows send --wallet alice --from-chain 1 --to-chain 56 \
  --from-token 0x0000000000000000000000000000000000000000 \
  --to-token 0x0000000000000000000000000000000000000000 \
  --to-address 0xRecipient --amount 0.1

Same-Chain Native Transfer

# Send 0.1 ETH on Ethereum
xflows transfer --wallet alice --chain-id 1 --to 0xRecipient --amount 0.1

# Dry run first
xflows transfer --wallet alice --chain-id 1 --to 0xRecipient --amount 0.1 --dry-run

Same-Chain ERC20 Transfer

# Send 100 USDC on Ethereum (auto-detect decimals)
xflows transfer-token --wallet alice --chain-id 1 \
  --token 0xA0b86991c6218b36c1d19D4a2e9Eb0cE3606eB48 \
  --to 0xRecipient --amount 100

# Specify decimals manually
xflows transfer-token --wallet alice --chain-id 1 \
  --token 0xA0b86991c6218b36c1d19D4a2e9Eb0cE3606eB48 \
  --to 0xRecipient --amount 100 --decimals 6

Poll Until Complete

xflows status --hash 0xTxHash \
  --from-chain 1 --to-chain 56 \
  --from-token 0x0000000000000000000000000000000000000000 \
  --to-token 0x0000000000000000000000000000000000000000 \
  --from-address 0xSender --to-address 0xReceiver \
  --amount 0.1 --poll --interval 10

版本历史

共 2 个版本

  • v0.2.0 当前
    2026-03-30 19:38 安全 安全
  • v0.1.0
    2026-03-11 16:43

安全检测

腾讯云安全 (Keen)

安全,无风险
查看报告

腾讯云安全 (Sanbu)

安全,无风险
查看报告

🔗 相关推荐

Debank Skill

lolieatapple
通过 DeBank API 查询 EVM 链上的钱包数据,包括余额、DeFi 持仓、代币、NFT、交易记录、Gas 价格和代币授权。
★ 0 📥 365
developer-tools

Github

steipete
使用 `gh` CLI 与 GitHub 交互,通过 `gh issue`、`gh pr`、`gh run` 和 `gh api` 管理议题、PR、CI 运行及高级查询。
★ 672 📥 324,535
developer-tools

CodeConductor.ai

larsonreever
AI驱动平台,提供快速全栈开发、智能体、工作流自动化及低代码AI集成的可扩展产品创建。
★ 68 📥 180,475