TypeScript SDK
BuyWithFiatQuote
The response object returned by the getBuyWithFiatQuote function.
This includes various information for buying a token using a fiat currency:
on-ramp provider UI link
The estimated time for the transaction to complete.
The on-ramp and destination token information.
Processing fees
type BuyWithFiatQuote = { estimatedDurationSeconds: number; estimatedToAmountMin: string; estimatedToAmountMinWei: string; fromAddress: string; fromCurrency: { amount: string; amountUnits: string; currencySymbol: string; decimals: number; }; fromCurrencyWithFees: { amount: string; amountUnits: string; currencySymbol: string; decimals: number; }; intentId: string; maxSlippageBPS: number; onRampLink: string; onRampToken: { amount: string; amountUSDCents: number; amountWei: string; }; processingFees: Array<{ amount: string; amountUnits: string; currencySymbol: string; decimals: number; feeType: "ON_RAMP" | "NETWORK"; }>; provider: FiatProvider; routingToken?: { amount: string; amountUSDCents: number; amountWei: string; }; toAddress: string; toAmountMin: string; toAmountMinWei: string;};Estimated time for the transaction to complete in seconds.
type estimatedDurationSeconds = number;Minimum amount of token that is expected to be received in units.
type estimatedToAmountMin = string;Minimum amount of token that is expected to be received in wei.
type estimatedToAmountMinWei = string;Address of the wallet used for buying the token.
type fromAddress = string;fiat currency used to buy the token - excluding the fees.
type fromCurrency = { amount: string; amountUnits: string; currencySymbol: string; decimals: number;};Fiat currency used to buy the token - including the fees.
type fromCurrencyWithFees = { amount: string; amountUnits: string; currencySymbol: string; decimals: number;};Id of transaction
type intentId = string;The maximum slippage in basis points (bps) allowed for the transaction.
type maxSlippageBPS = number;Token that will be sent to the user's wallet address by the on-ramp provider.
If the token is same as toToken - the user can directly buy the token from the on-ramp provider.
If not, the user will receive this token and a swap is required to convert it toToken.
type onRampToken = { amount: string; amountUSDCents: number; amountWei: string;};Array of processing fees for the transaction.
This includes the processing fees for on-ramp and swap (if required).
type processingFees = Array<{ amount: string; amountUnits: string; currencySymbol: string; decimals: number; feeType: "ON_RAMP" | "NETWORK";}>;The provider that was used to get the quote.
type provider = FiatProvider;Routing token that will be swapped from the on-ramp token, so that it can be bridged to the destination token.
type routingToken = { amount: string; amountUSDCents: number; amountWei: string;};Address of the wallet to which the tokens will be sent.
type toAddress = string;Amount of token that is expected to be received in wei.
(estimatedToAmountMin - maxSlippageWei)
type toAmountMin = string;Amount of token that is expected to be received in units.
(estimatedToAmountMinWei - maxSlippageWei)
type toAmountMinWei = string;Token information for the desired token. (token the user wants to buy)