Overview
Converting assets with Crown API is a two-step process:- Create a quote between two assets to get exchange rates and pricing
- 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/brl→eth-base/brlvfiat/brl→eth-base/wbrlyeth-base/brlv→fiat/brleth-base/wbrly→fiat/brl
Request Examples
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
| Scenario | source-wallet-address | target-wallet-address |
|---|---|---|
| Fiat → Token | Not required | Required |
| Token → Fiat | Required | Not required |
Order Examples
Order Status
After creating an order, it will go through several status states:created- Order has been createdprocessing- Order is being processedcompleted- Order has been successfully completedrolled-back- Order was rolled back
- Using the Get Order endpoint
- Setting up webhooks and listening to the order-completed webhook