swapExecute method

  1. @override
Future<String> swapExecute({
  1. required SwapQuote quote,
})
override

Execute a quote — register the swap intent with the provider and (for an OutOfZec quote) queue the §4.4 ZEC deposit send. Pass back the SwapQuote swapQuote returned; the SDK claims its own durable single-flight by the quote id BEFORE anything happens (idempotent against a double-tap / crash retry — exactly ONE deposit per quote), and the deposit uses the SDK's own frozen record, NEVER this DTO, so a tampered field can't redirect funds. Returns the opaque provider swap id (do NOT parse it; pass it to watchSwapStatus). Throws a typed SwapApiError (quoteExpired ⇒ re-quote — since #367 this also covers a not-issued/already-executed quote (every take-miss reads "no longer valid"); swapStateBusy ⇒ retry the SAME execute (nothing consumed); depositSendFailed ⇒ re-quote).

Implementation

@override
Future<String> swapExecute({required SwapQuote quote}) async {
  swapExecuteCount++;
  lastSwapExecuteQuote = quote;
  if (swapExecuteGate != null) await swapExecuteGate!.future;
  if (swapExecuteThrows != null) throw swapExecuteThrows!;
  return swapExecuteResult;
}