Get On-Ramp Quote
This method allows you to get a quote for an on-ramp transaction.
Method Signature
async quote(params: XellarOnRampQuoteRequest): Promise<OnRampQuoteResponse>
Parameters
params
: XellarOnRampQuoteRequest
- An object with the following properties:
amount
:number
(required) - The amount of the on-ramp transaction in the input currency.inputCurrency
:string
(required) - The currency of the on-ramp transaction (e.g., "IDR"). See Reference for available options.outputCurrency
:string
(required) - The crypto id of the on-ramp transaction (e.g., "usdt-polygon"). See Reference for available options.withLimit
:boolean
(optional) - When set to false, no daily limit calculation is applied to the quote based on the user's limits (pure quote only).
Returns
Promise<OnRampQuoteResponse>
- An object containing the on-ramp quote details.
Example Usage
const quote = await sdk.onRamp.quote({
amount: 100,
inputCurrency: 'IDR',
outputCurrency: 'usdt-polygon',
withLimit: true
});
console.log(quote);
Response Example
{
"status": true,
"acceptance_method": "",
"onramp_service": "indodax",
"coin": "usdt",
"currency": "idr",
"amount_in_crypto": 1.0218048114372003,
"amount_in_currency": 16000,
"rate_amount": 15658.56788,
"total_fee_percentage": 1.25,
"total_fee_amount": 0.012772560142965003,
"total_fee_amount_in_currency": 200,
"total_received_amount_in_crypto": 1.0090322512942353,
"total_received_amount_in_currency": 15800.000000000002,
"expiry_time": 10
}
ℹ️
The response includes details such as the exchange rate, fees, and the final amount to be received in both crypto and fiat currency.
Additional Information
- The
withLimit
parameter allows you to get a quote using only the client secret, without including your user access token in request headers. This is useful for client-side applications. - When
withLimit
is set tofalse
, no daily limit calculation is applied to the quote based on the user's limits (pure quote only). - The
inputCurrency
andoutputCurrency
parameters should match the available options in the Rampable reference documentation.
For more information, see the Rampable On-Ramp Quote API Documentation (opens in a new tab).