send method

  1. @override
Future<List<TxSubmitResult>> send(
  1. int proposalId
)
override

Sign + broadcast a prepared proposal — consumes the one-shot proposalId. A per-tx broadcast outcome is first-class DATA (the returned list), NEVER a thrown error: a tx that fails to broadcast is persisted and re-sent by the resubmission machinery on the next sync, so even a total broadcast failure loses no funds, only immediacy. Throws only for a consumed token (proposalAlreadyUsed), a stale anchor (proposalStale ⇒ re-propose), or a build/sign failure (signFailed).

Implementation

@override
Future<List<TxSubmitResult>> send(int proposalId) async {
  sendCount++;
  lastSendProposalId = proposalId;
  final gate = sendGate;
  if (gate != null) await gate.future;
  if (sendThrows != null) throw sendThrows!;
  return sendResults ?? const [TxSubmitResult.success(txidHex: 'aabbccdd')];
}