Skip to Content
EnDocs
Guide
Integrate Same-chain Swap

Integrate Same-chain Swap

Same-chain swap exchanges one token for another on the same blockchain. When fromChain == toChain, you are in a same-chain scenario. Bitget Wallet offers two integration paths—choose based on who handles signing and broadcast:

ApproachBest for
Sign and broadcast yourselfHigher flexibility; you handle signing and broadcast
Platform-managed order flowCreate and submit orders via API; no order state to maintain

Sign and Broadcast Yourself

Bitget Wallet returns contract call calldata (for Solana, instructions and serialized transaction). Integrators can wrap and customize on top, then complete signing and broadcast via their own RPC node or /bgw-pro/swapx/pro/send.

Integration Flow

  1. Get Quote/bgw-pro/swapx/pro/quote
  2. Get Calldata/bgw-pro/swapx/pro/swap
  3. Sign Transaction — completed on the client side
  4. Send to Chain — via /bgw-pro/swapx/pro/send or directly to an RPC node

Characteristics

  • Higher integration flexibility
  • Integrator handles signing and broadcast
  • Supported capabilities: Same-chain swap

API Reference


Platform-Managed Order Flow

The process is split into steps; Bitget Wallet handles the full order lifecycle, and integrators submit signed transactions via API without maintaining order state.

Integration Flow

  1. Get Quote — Call /bgw-pro/swapx/order/getSwapPrice for estimated output and fees
  2. Create Order — Call /bgw-pro/swapx/order/makeSwapOrder to create an order and receive transaction data
  3. Sign Transaction — Completed on the integrator side (e.g., self-hosted wallet / custodial signing)
  4. Submit Order — Call /bgw-pro/swapx/order/submitSwapOrder with the signed transaction
  5. Monitor Status — Poll /bgw-pro/swapx/order/getSwapOrder to track completion
  6. Check reconciled fees (optional) — Call /bgw-pro/swapx/order/checkOrdersFee to batch-query reconciled fees

Characteristics

  • Bitget Wallet handles the complete order lifecycle
  • Integrators do not need to maintain order state
  • Supported capabilities: Same-chain swap, NoGas

API Reference


Last updated on