Skip to main content
POST
/
api
/
v1
/
market
/
quote
TypeScript SDK - BTC to USDT
import { KaleidoClient } from '@kaleidoswap/kaleidoswap-sdk';

const client = new KaleidoClient({
  baseUrl: 'https://api.staging.kaleidoswap.com/api/v1'
});

const quote = await client.quoteRequest(
  'BTC',
  'rgb:im7mWgoS-4QX_1b1-DT23iPq-niObDFM-qGN7R2x-lFLJYak',
  1000000 // 0.01 BTC minimum
);
console.log(`Exchange rate: ${quote.price}`);
{
  "rfq_id": "1234567890",
  "from_asset": "BTC",
  "from_amount": 100000000000,
  "to_asset": "rgb:2dkSTbr-jFhznbPmo-TQafzswCN-av4gTsJjX-ttx6CNou5-M98k8Zd",
  "to_amount": 49900123,
  "price": 50000123456,
  "fee": {
    "base_fee": 1000000,
    "variable_fee": 1000000,
    "fee_rate": 0.0001,
    "final_fee": 2000000,
    "fee_asset": "rgb:2dkSTbr-jFhznbPmo-TQafzswCN-av4gTsJjX-ttx6CNou5-M98k8Zd",
    "fee_asset_precision": 6
  },
  "timestamp": 123,
  "expires_at": 123
}

Usage

Provide either from_amount or to_amount, but not both. The API will calculate the other side based on current market rates.
Quotes are valid for a limited time. Check the expires_at field.

Authorizations

Authorization
string
header
required

Bearer authentication header of the form Bearer <token>, where <token> is your auth token.

Body

application/json
from_asset
string
required
Example:

"BTC"

to_asset
string
required
Example:

"rgb:2dkSTbr-jFhznbPmo-TQafzswCN-av4gTsJjX-ttx6CNou5-M98k8Zd"

from_amount
integer | null

Amount of from_asset to convert. Either from_amount or to_amount must be provided, but not both.

Example:

1000000

to_amount
integer | null

Desired amount of to_asset to receive. Either from_amount or to_amount must be provided, but not both.

Example:

1000000

Response

Successful Response

rfq_id
string
required
Example:

"1234567890"

from_asset
string
required
Example:

"BTC"

from_amount
integer
required

Amount of from_asset in its smallest unit (e.g., millisatoshis for BTC if precision is 11)

Example:

100000000000

to_asset
string
required
Example:

"rgb:2dkSTbr-jFhznbPmo-TQafzswCN-av4gTsJjX-ttx6CNou5-M98k8Zd"

to_amount
integer
required

Amount of to_asset in its smallest unit, after applying price and fees.

Example:

49900123

price
integer
required

Price of 1 whole unit of from_asset (e.g., 1 BTC) in terms of the smallest unit of to_asset (e.g., USDT with precision 6). Matches PriceData.price for the given rfq_id.

Example:

50000123456

fee
Fee · object
required
timestamp
integer
required
expires_at
integer
required