isSwapRequiredPostOnramp

Check if a Swap is required after on-ramp when buying a token with fiat currency.

If quote.toToken and quote.onRampToken are the same (same token and chain), it means on-ramp provider can directly send the desired token to the user's wallet and no swap is required.

If quote.toToken and quote.onRampToken are different (different token or chain), A swap is required to swap the on-ramp token to the desired token.

function isSwapRequiredPostOnramp(
buyWithFiatQuote: Pick<BuyWithFiatQuote, "toToken" | "onRampToken">,
): boolean;

Parameters

The quote of type BuyWithFiatQuote returned by the getBuyWithFiatQuote function.

Type

let buyWithFiatQuote: Pick<
"toToken" | "onRampToken"
>;

Returns

let returnType: boolean;