jmwalletd.send
jmwalletd.send
Direct-send helper for jmwalletd.
Builds, signs, broadcasts, and records direct (non-coinjoin) transactions in history.csv following the two-phase history persistence pattern.
Attributes
Classes
Functions:
do_direct_send(*, wallet_service: WalletService, mixdepth: int, amount_sats: int, destination: str, fee_rate: float | None = None, fee_target_blocks: int | None = None, tx_fee_factor: float = 0.0, max_fee_rate_sat_vb: float = DEFAULT_MAX_FEE_RATE_SAT_VB, input_utxos: list[str] | None = None, rbf: bool = True) -> DirectSendResult
async
Build, sign, broadcast, and record a direct (non-coinjoin) transaction.
fee_rate (sat/vB) takes priority; otherwise fee_target_blocks
drives backend estimation (None keeps the spend module's default
target). tx_fee_factor applies the reference fee-rate randomization,
and max_fee_rate_sat_vb applies the operator's configured hard cap.
input_utxos, when given, spends exactly those txid:vout outpoints
instead of running automatic coin selection (issue #587); see
:func:jmwallet.wallet.spend.prepare_direct_send for the validation
rules. rbf defaults to BIP125 replacement signaling and can be disabled
per transaction without disabling anti-fee-sniping locktime.
Follows the same two-phase history-write pattern as the CLI send command:
- A
role="send"row is written tohistory.csvwithfailure_reason="awaiting broadcast"before the broadcast call. This permanently marks destination and change addresses as used, even if broadcast fails — the signed bytes are already outside the wallet's control. - After broadcast resolves (success or failure) the row is patched
in-place via :func:
~jmwallet.history.update_send_awaiting_broadcast.
A pre-broadcast persistence failure aborts before broadcasting. Finalization failures remain best-effort because the transaction may already be public.
Source code in jmwalletd/src/jmwalletd/send.py
30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 | |