Skip to main content

ConversionInfo

Enum ConversionInfo 

Source
pub enum ConversionInfo {
    Amm {
        pool_id: String,
        conversion_id: String,
        status: ConversionStatus,
        fee: Option<u128>,
        purpose: Option<ConversionPurpose>,
        amount_adjustment: Option<AmountAdjustmentReason>,
    },
    Orchestra {
Show 16 fields order_id: String, quote_id: String, read_token: Option<String>, chain: String, chain_id: Option<String>, asset: String, recipient_address: String, asset_amount_in: Option<u128>, estimated_out: u128, delivered_amount: Option<u128>, status: ConversionStatus, fee_amount: Option<u128>, service_fee_amount: Option<u128>, service_fee_asset: Option<String>, asset_decimals: u32, asset_contract: Option<String>,
}, Boltz {
Show 19 fields swap_id: String, invoice: String, invoice_amount_sats: u64, bridge_ref: Option<String>, max_slippage_bps: u32, quote_degraded: bool, chain: String, chain_id: Option<String>, asset: String, recipient_address: String, estimated_out: u128, delivered_amount: Option<u128>, status: ConversionStatus, asset_amount_in: Option<u128>, fee_amount: Option<u128>, service_fee_amount: Option<u128>, service_fee_asset: Option<String>, asset_decimals: u32, asset_contract: Option<String>,
}, }
Expand description

Details of the asset conversion attached to a payment, when the payment involves a swap or cross-chain bridge in addition to the on-Spark transfer.

The variant identifies which provider handled the conversion:

Variants§

§

Amm

AMM (Flashnet pool-based) conversion — Spark ↔ Spark token swaps.

Fields

§pool_id: String

The pool id associated with the conversion

§conversion_id: String

The conversion id shared by both sides of the conversion

§status: ConversionStatus

The status of the conversion

§fee: Option<u128>

The fee paid for the conversion. Denominated in satoshis if converting from Bitcoin, otherwise in the token base units.

§purpose: Option<ConversionPurpose>

The purpose of the conversion

§amount_adjustment: Option<AmountAdjustmentReason>

The reason the conversion amount was adjusted, if applicable.

§

Orchestra

Orchestra cross-chain conversion via the Flashnet orchestration API.

Fields

§order_id: String

The Orchestra order id returned by /v1/orchestration/submit.

§quote_id: String

The Orchestra quote id used to create this order.

§read_token: Option<String>

Opaque token required for querying order status.

§chain: String

Chain name (e.g. "base", "solana", "tron").

§chain_id: Option<String>

Stable chain identifier (e.g. EVM chainId decimal string "8453" for Base, SLIP-44 or similar for other chains). None if the provider doesn’t expose one for this route.

§asset: String

Asset ticker (e.g. "USDC", "USDT").

§recipient_address: String

Recipient address on the target chain.

§asset_amount_in: Option<u128>

Amount in expressed in the cross-chain asset’s base units, via the rate the SDK used at prepare time.

§estimated_out: u128

Estimated recipient amount, frozen at prepare time.

§delivered_amount: Option<u128>

Actual delivered amount, Unset until the order reaches a terminal state.

§fee_amount: Option<u128>

Best-available total fee in destination asset base units. Prepare-time estimate while pending, realized fee when Completed.

§service_fee_amount: Option<u128>

Orchestra service fee.

§service_fee_asset: Option<String>

Asset the service fee is denominated in. Unset means BTC sats.

§asset_decimals: u32

Asset decimals (e.g. 6 for USDC).

§asset_contract: Option<String>

Token contract / mint address. Unset for native-asset destinations.

§

Boltz

Boltz reverse swap: cross-chain conversion via Lightning hold invoice.

The swap’s secrets and lifecycle state live on the synced Boltz swap row keyed by swap_id, which also drives cross-instance recovery.

Fields

§swap_id: String

The Boltz swap id returned by POST /swap/reverse.

§invoice: String

The BOLT11 hold invoice paid on the Spark/Lightning side.

§invoice_amount_sats: u64

Amount of the hold invoice in sats.

§bridge_ref: Option<String>

Cross-chain bridge tracking handle for bridged swaps: a LayerZero message GUID for OFT (USDT0) routes, or a CCTP reference for USDC routes. None for same-chain (Arbitrum-direct) delivery.

§max_slippage_bps: u32

DEX slippage tolerance (basis points) committed at prepare time.

§quote_degraded: bool

Whether the claim-time DEX quote drifted beyond max_slippage_bps.

§chain: String

Chain name (e.g. "arbitrum", "solana", "tron").

§chain_id: Option<String>

Stable chain identifier (e.g. EVM chainId decimal string "42161" for Arbitrum). None if the provider doesn’t expose one for this route.

§asset: String

Asset ticker (e.g. "USDT", "USDT0").

§recipient_address: String

Recipient address on the target chain.

§estimated_out: u128

Estimated amount in the asset’s base units, frozen at prepare time.

§delivered_amount: Option<u128>

Actual amount delivered. None until the claim receipt is processed.

§status: ConversionStatus

Current status of the reverse swap.

§asset_amount_in: Option<u128>

Amount in expressed in the cross-chain asset’s base units, via the BTC/USD rate the SDK used at prepare time.

§fee_amount: Option<u128>

Best-available total fee in destination asset base units. Prepare-time estimate while pending, realized fee on Completed.

§service_fee_amount: Option<u128>

Boltz spread in sats.

§service_fee_asset: Option<String>

Asset service fee is denominated in. Unset means BTC sats.

§asset_decimals: u32

Asset decimals (e.g. 6 for USDT).

§asset_contract: Option<String>

Token contract / mint address. Unset for native-asset destinations.

Implementations§

Source§

impl ConversionInfo

Source

pub fn status(&self) -> &ConversionStatus

The current status, regardless of conversion type.

Source

pub fn status_mut(&mut self) -> &mut ConversionStatus

A mutable reference to the status, for in-place updates.

Source

pub fn fee(&self) -> Option<u128>

Headline fee: AMM pool fee in source units, or the cross-chain total in destination-asset base units.

Source

pub fn is_amm(&self) -> bool

Whether this is an AMM (Flashnet pool) conversion.

Source

pub fn is_orchestra(&self) -> bool

Whether this is an Orchestra (cross-chain) conversion.

Source

pub fn is_boltz(&self) -> bool

Whether this is a Boltz reverse swap.

Trait Implementations§

Source§

impl Clone for ConversionInfo

Source§

fn clone(&self) -> ConversionInfo

Returns a duplicate of the value. Read more
1.0.0 · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Debug for ConversionInfo

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl<'de> Deserialize<'de> for ConversionInfo

Source§

fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>
where __D: Deserializer<'de>,

Deserialize this value from the given Serde deserializer. Read more
Source§

impl PartialEq for ConversionInfo

Source§

fn eq(&self, other: &ConversionInfo) -> bool

Tests for self and other values to be equal, and is used by ==.
1.0.0 · Source§

fn ne(&self, other: &Rhs) -> bool

Tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
Source§

impl Serialize for ConversionInfo

Source§

fn serialize<__S>(&self, __serializer: __S) -> Result<__S::Ok, __S::Error>
where __S: Serializer,

Serialize this value into the given Serde serializer. Read more
Source§

impl StructuralPartialEq for ConversionInfo

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

§

impl<T> FromRef<T> for T
where T: Clone,

§

fn from_ref(input: &T) -> T

Converts to this type from a reference to the input type.
§

impl<T> Instrument for T

§

fn instrument(self, span: Span) -> Instrumented<Self>

Instruments this type with the provided [Span], returning an Instrumented wrapper. Read more
§

fn in_current_span(self) -> Instrumented<Self>

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> IntoEither for T

Source§

fn into_either(self, into_left: bool) -> Either<Self, Self>

Converts self into a Left variant of Either<Self, Self> if into_left is true. Converts self into a Right variant of Either<Self, Self> otherwise. Read more
Source§

fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
where F: FnOnce(&Self) -> bool,

Converts self into a Left variant of Either<Self, Self> if into_left(&self) returns true. Converts self into a Right variant of Either<Self, Self> otherwise. Read more
Source§

impl<T> IntoRequest<T> for T

Source§

fn into_request(self) -> Request<T>

Wrap the input message T in a tonic::Request
§

impl<T> PolicyExt for T
where T: ?Sized,

§

fn and<P, B, E>(self, other: P) -> And<T, P>
where T: Policy<B, E>, P: Policy<B, E>,

Create a new Policy that returns [Action::Follow] only if self and other return Action::Follow. Read more
§

fn or<P, B, E>(self, other: P) -> Or<T, P>
where T: Policy<B, E>, P: Policy<B, E>,

Create a new Policy that returns [Action::Follow] if either self or other returns Action::Follow. Read more
Source§

impl<T> Same for T

Source§

type Output = T

Should always be Self
Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
§

impl<V, T> VZip<V> for T
where V: MultiLane<T>,

§

fn vzip(self) -> V

§

impl<T> WithSubscriber for T

§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>
where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a [WithDispatch] wrapper. Read more
§

fn with_current_subscriber(self) -> WithDispatch<Self>

Attaches the current default Subscriber to this type, returning a [WithDispatch] wrapper. Read more
§

impl<'de, T> BorrowedRpcObject<'de> for T
where T: RpcBorrow<'de> + RpcSend,

Source§

impl<T> DeserializeOwned for T
where T: for<'de> Deserialize<'de>,

§

impl<'de, T> RpcBorrow<'de> for T
where T: Deserialize<'de> + Debug + Send + Sync + Unpin,

§

impl<T> RpcObject for T
where T: RpcSend + RpcRecv,

§

impl<T> RpcRecv for T
where T: DeserializeOwned + Debug + Send + Sync + Unpin + 'static,

§

impl<T> RpcSend for T
where T: Serialize + Clone + Debug + Send + Sync + Unpin,