Skip to main content

send_amount_affordable

Function send_amount_affordable 

Source
async fn send_amount_affordable<GrossUp, Quote, Fut>(
    amount: Amount,
    balance: Amount,
    gross_up: &GrossUp,
    fee_quote: &Quote,
) -> Result<bool, TransactionSubmitError>
where GrossUp: Fn(Amount) -> Amount, Quote: Fn(Amount) -> Fut, Fut: Future<Output = Result<FeeQuote, TransactionSubmitError>>,
Expand description

Whether sending amount is payable in full out of balance: the funded value gross_up(amount) plus its federation fee_quote must fit within the balance. An InsufficientFunds quote counts as unaffordable, making this safe as the monotone predicate for max_affordable_send_amount; any other quote failure is propagated, since it will not get better by probing a smaller amount.