Skip to main content

Welcome

The BOB Gateway API enables seamless cross-chain interactions for Bitcoin-powered applications. Build bridges, swaps, and DeFi integrations with Bitcoin liquidity.

OpenAPI Specification

View the complete API specification

How It Works

Gateway transactions follow a 6-step flow to execute Bitcoin-to-chain or chain-to-Bitcoin swaps:
1

Get Available Routes

Call GET /v1/get-routes to fetch all supported routes, chains, and tokens. This helps you understand what swaps are available and present options to your users.
GET /v1/get-routes
Returns information about supported chains, tokens, bridges, and fee structures.
2

Get a Quote

Call GET /v1/get-quote with your swap parameters (amount, source/destination chains, tokens, etc.). The API returns a quote with routing information, fees, and expected outputs.
GET /v1/get-quote?srcChain=bitcoin&dstChain=bob&amount=10000000...
3

Create an Order

Pass the quote to POST /v1/create-order to lock in the quote and create an order. This reserves liquidity with the market maker and returns transaction details including:
  • For onramp (Bitcoin → Chain): A Bitcoin address to send to, or a PSBT to sign
  • For offramp (Chain → Bitcoin): EVM transaction data to execute
POST /v1/create-order
{ "onramp": { ...quote data } }
4

Sign and Send Transaction

Execute the transaction:
  • For onramp: Create and sign a Bitcoin transaction to the provided address, or use the provided PSBT
  • For offramp: Sign and broadcast the EVM transaction using the provided transaction data
5

Register Transaction

Call PATCH /v1/register-tx with the signed transaction hash/hex. This allows Gateway to track your order and provide status updates.
PATCH /v1/register-tx
{ "onramp": { "orderId": "...", "bitcoinTxHex": "..." } }
6

Monitor Order Status

Track your order’s progress using GET /v1/get-orders/{user_address}. This endpoint returns all orders (pending and completed) for a given user address.
GET /v1/get-orders/0x742d35Cc6634C0532925a3b844Bc9e7595f0bEb
Poll this endpoint to update your UI as the order progresses through states: pending → confirmed → completed.
The SDK handles all these steps automatically via executeQuote(). Use the SDK for easier integration, or call the API directly for custom implementations.