Skip to main content

Overview

Converting assets with Crown API is a two-step process:
  1. Create a quote between two assets to get exchange rates and pricing
  2. Create an order using the quote ID with additional information based on the asset types
Wallet addresses are required only for token assets (like eth-base/brlv, eth-base/wbrly). For fiat assets (fiat/brl), no wallet addresses are needed.

Step 1: Create a Quote

First, request a quote specifying your source and target assets, along with either the source or target amount.

Supported Conversions

  • fiat/brleth-base/brlv
  • fiat/brleth-base/wbrly
  • eth-base/brlvfiat/brl
  • eth-base/wbrlyfiat/brl

Request Examples

curl -X POST https://api.brl.xyz/api/v0/quotes \
  -H "X-API-Key: your_api_key" \
  -H "Authorization: Bearer your_jwt_token" \
  -H "Content-Type: application/json" \
  -d '{
    "source-asset": "fiat/brl",
    "target-asset": "eth-base/brlv",
    "source-amount": "100.00"
  }'
You can specify either source-amount or target-amount in your quote request, but not both. The quote engine will calculate the other amount based on current exchange rates.

Step 2: Create an Order

Once you have a quote ID, create an order to execute the conversion. The required fields depend on your source and target asset types.

Wallet Address Requirements

Scenariosource-wallet-addresstarget-wallet-address
Fiat → TokenNot requiredRequired
Token → FiatRequiredNot required

Order Examples

curl -X POST https://api.brl.xyz/api/v0/orders \
  -H "X-API-Key: your_api_key" \
  -H "Authorization: Bearer your_jwt_token" \
  -H "Content-Type: application/json" \
  -d '{
    "quote-id": "550e8400-e29b-41d4-a716-446655440000",
    "target-wallet-address": "0x742d35Cc6635C0532925a3b8D295FD6C6e7e2c2c"
  }'

Order Status

After creating an order, it will go through several status states:
  • created - Order has been created
  • processing - Order is being processed
  • completed - Order has been successfully completed
  • rolled-back - Order was rolled back
You can track your order status by: