@arkade-os/sdk Documentation - v0.5.0-rc.11
    Preparing search index...

    Interface RouteQuote

    A priced route. The three amounts are receiver-exact and mean the same thing on every rail, so options() can be ranked on cost and a rail swapped without changing what the recipient gets:

    • amount — sats delivered to the recipient.
    • fee — sats charged on top, by the rail and its counterparty.
    • total — amount + fee; the sats that leave the wallet.

    Rails whose underlying primitive deducts its fee (the collaborative exit) gross the amount up to honour this; rails that add it on top pass it through. A rail that does not perform the deducting spend cannot gross up to a fee it never chooses, and flags that instead: see claimFeeDeductedFromPayout.

    fee is a pre-send estimate wherever the true cost is only fixed later: the collaborative exit omits the per-input intent fees whenever the request left the VTXO selection to settlement — naming PaymentRequest.selectedVtxos fixes them, and they are priced in. Treat it as a display and ranking figure, not a guarantee.

    interface RouteQuote {
        amount: number;
        assets?: { delivered: Asset; spent: Asset };
        fee: number;
        meta?: Record<string, unknown>;
        railId: string;
        total: number;
        validUntil?: number;
        send(): Promise<PaymentHandle>;
    }
    Index

    Properties

    amount: number

    Sats delivered to the recipient.

    assets?: { delivered: Asset; spent: Asset }

    The asset shape is provisional. The v2 swap client models assets as give/take/amountOn over AssetRef, and the two vocabularies are expected to converge on v0.5; do not treat this field as stable 0.4.x API.

    The asset view; absent means BTC only. The sats fields keep their meaning — an asset rides a sats-carrying output, so amount is the carrier, not zero.

    A pair, not a triple: on a cross-asset route these name DIFFERENT assets, so total = amount + fee cannot hold across the two units — which forces the purchase price into fee. Prefer assets.spent for a cost display.

    fee: number

    Sats charged on top of amount; an estimate where the cost is fixed later.

    meta?: Record<string, unknown>
    railId: string
    total: number

    amount + fee — what leaves the wallet.

    validUntil?: number

    Unix seconds after which the counterparty stops honouring this quote.

    Absent means "nothing to observe", not "never expires": a rail with no counterparty and no quote book — an Arkade transfer, an asset transfer, a collaborative exit — has no validity to state. A caller holding a quote across user think-time should read absence as "no check possible", and must still expect send to refuse either way: the swap rails re-check validity there, which is the only point that can judge it against the moment of spending.

    Methods