conversion_steps_from_payments

Function conversion_steps_from_payments 

Source
pub fn conversion_steps_from_payments(
    payments: &[Payment],
) -> Result<(Option<ConversionStep>, Option<ConversionStep>), SdkError>
Expand description

Extracts conversion steps (from/to) from a conversion’s child payments.

Each conversion produces a send payment (sats → Flashnet) and a receive payment (tokens ← Flashnet), linked to the parent payment via parent_payment_id in payment metadata. The SDK queries these children from storage and converts them into the from and to steps.

Returns (None, None) when no child payments exist yet (e.g. Pending or Failed).