Function convert_xlm_fee_to_token

Source
pub async fn convert_xlm_fee_to_token<D>(
    dex_service: &D,
    policy: &RelayerStellarPolicy,
    xlm_fee: u64,
    fee_token: &str,
) -> Result<FeeQuote, StellarTransactionUtilsError>
Expand description

Convert XLM fee to token amount using DEX service

This function converts an XLM fee (in stroops) to the equivalent amount in the requested token using the DEX service. For native XLM, no conversion is needed. Optionally applies a fee margin percentage to the XLM fee before conversion.

§Arguments

  • dex_service - DEX service for token conversion quotes
  • policy - Stellar relayer policy for slippage and token decimals
  • xlm_fee - Fee amount in XLM stroops (already estimated)
  • fee_token - Token identifier (e.g., “native” or “USDC:GA5Z…”)

§Returns

A tuple containing:

  • FeeQuote - Fee quote with amounts in both token and XLM
  • u64 - Buffered XLM fee (with margin applied if specified)