Skip to content

jmwalletd.models

jmwalletd.models

Pydantic request/response models for the wallet daemon API.

All models match the schemas defined in the reference JoinMarket OpenAPI spec (jm-wallet-rpc.yaml) to ensure JAM compatibility.

Attributes

MAX_MONEY_SATS = 21000000 * 100000000 module-attribute

WalletName = Annotated[str, AfterValidator(_validate_wallet_name)] module-attribute

Classes

ConfigGetRequest

Bases: BaseModel

POST /api/v1/wallet/{walletname}/configget request.

Source code in jmwalletd/src/jmwalletd/models.py
544
545
546
547
548
class ConfigGetRequest(BaseModel):
    """POST /api/v1/wallet/{walletname}/configget request."""

    section: str
    field: str
Attributes
field: str instance-attribute
section: str instance-attribute

ConfigGetResponse

Bases: BaseModel

Response for configget.

Source code in jmwalletd/src/jmwalletd/models.py
551
552
553
554
class ConfigGetResponse(BaseModel):
    """Response for configget."""

    configvalue: str
Attributes
configvalue: str instance-attribute

ConfigSetRequest

Bases: BaseModel

POST /api/v1/wallet/{walletname}/configset request.

Source code in jmwalletd/src/jmwalletd/models.py
557
558
559
560
561
562
class ConfigSetRequest(BaseModel):
    """POST /api/v1/wallet/{walletname}/configset request."""

    section: str
    field: str
    value: str
Attributes
field: str instance-attribute
section: str instance-attribute
value: str instance-attribute

CreateWalletRequest

Bases: BaseModel

POST /api/v1/wallet/create request.

Source code in jmwalletd/src/jmwalletd/models.py
62
63
64
65
66
67
68
class CreateWalletRequest(BaseModel):
    """POST /api/v1/wallet/create request."""

    walletname: WalletName
    password: str
    bip39_passphrase: SecretStr = Field(default_factory=lambda: SecretStr(""))
    wallettype: str = "sw-fb"
Attributes
bip39_passphrase: SecretStr = Field(default_factory=lambda: SecretStr('')) class-attribute instance-attribute
password: str instance-attribute
walletname: WalletName instance-attribute
wallettype: str = 'sw-fb' class-attribute instance-attribute

CreateWalletResponse

Bases: BaseModel

Response for wallet create and recover.

Source code in jmwalletd/src/jmwalletd/models.py
71
72
73
74
75
76
77
78
79
80
class CreateWalletResponse(BaseModel):
    """Response for wallet create and recover."""

    walletname: str
    seedphrase: str
    token: str
    token_type: str = "bearer"
    expires_in: int = 1800
    scope: str = ""
    refresh_token: str
Attributes
expires_in: int = 1800 class-attribute instance-attribute
refresh_token: str instance-attribute
scope: str = '' class-attribute instance-attribute
seedphrase: str instance-attribute
token: str instance-attribute
token_type: str = 'bearer' class-attribute instance-attribute
walletname: str instance-attribute

DirectSendRequest

Bases: BaseModel

POST /api/v1/wallet/{walletname}/taker/direct-send request.

amount_sats is the amount to send in satoshis; 0 means sweep the entire mixdepth. mixdepth is the source account index.

input_utxos is an optional explicit list of "txid:vout" strings (issue #587). When given, exactly those UTXOs are spent and automatic coin selection is skipped entirely, including for sweeps (amount_sats: 0 + input_utxos sweeps only the listed inputs). Every listed UTXO must already be unfrozen and belong to mixdepth; anything unusable is rejected with a reason rather than falling back to automatic selection. Omit the field (the default) to keep the previous auto-selecting behavior; an explicit empty list is always an error.

rbf controls BIP125 replacement signaling and defaults to True. Set it to False to retain anti-fee-sniping locktime without opting in to replacement.

txfee sets the miner fee for this send only, with the reference [POLICY] tx_fees semantics: 1-1000 is a block confirmation target, anything above is a rate in sat/kvB (5000 is 5 sat/vB). It takes precedence over a configset tx_fees value. Omit it or send 0 to use the configured fee policy. A value beyond the money supply is rejected here rather than silently falling back to the configured policy, so an explicit fee is never replaced by a different one.

Source code in jmwalletd/src/jmwalletd/models.py
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
class DirectSendRequest(BaseModel):
    """POST /api/v1/wallet/{walletname}/taker/direct-send request.

    ``amount_sats`` is the amount to send in satoshis; ``0`` means sweep the
    entire mixdepth. ``mixdepth`` is the source account index.

    ``input_utxos`` is an optional explicit list of ``"txid:vout"`` strings
    (issue #587). When given, exactly those UTXOs are spent and automatic
    coin selection is skipped entirely, including for sweeps
    (``amount_sats: 0`` + ``input_utxos`` sweeps only the listed inputs).
    Every listed UTXO must already be unfrozen and belong to ``mixdepth``;
    anything unusable is rejected with a reason rather than falling back to
    automatic selection. Omit the field (the default) to keep the previous
    auto-selecting behavior; an explicit empty list is always an error.

    ``rbf`` controls BIP125 replacement signaling and defaults to ``True``.
    Set it to ``False`` to retain anti-fee-sniping locktime without opting in
    to replacement.

    ``txfee`` sets the miner fee for this send only, with the reference
    ``[POLICY] tx_fees`` semantics: ``1``-``1000`` is a block confirmation
    target, anything above is a rate in sat/kvB (``5000`` is 5 sat/vB). It
    takes precedence over a ``configset`` ``tx_fees`` value. Omit it or send
    ``0`` to use the configured fee policy. A value beyond the money supply
    is rejected here rather than silently falling back to the configured
    policy, so an explicit fee is never replaced by a different one.
    """

    mixdepth: int = Field(..., ge=0)
    amount_sats: int = Field(..., ge=0, le=MAX_MONEY_SATS)
    destination: str
    txfee: int | None = Field(default=None, ge=0, le=MAX_MONEY_SATS)
    input_utxos: list[str] | None = None
    rbf: bool = True
Attributes
amount_sats: int = Field(..., ge=0, le=MAX_MONEY_SATS) class-attribute instance-attribute
destination: str instance-attribute
input_utxos: list[str] | None = None class-attribute instance-attribute
mixdepth: int = Field(..., ge=0) class-attribute instance-attribute
rbf: bool = True class-attribute instance-attribute
txfee: int | None = Field(default=None, ge=0, le=MAX_MONEY_SATS) class-attribute instance-attribute

DirectSendResponse

Bases: BaseModel

Response for direct-send.

Source code in jmwalletd/src/jmwalletd/models.py
396
397
398
399
class DirectSendResponse(BaseModel):
    """Response for direct-send."""

    txinfo: TxInfo
Attributes
txinfo: TxInfo instance-attribute

DoCoinjoinRequest

Bases: BaseModel

POST /api/v1/wallet/{walletname}/taker/coinjoin request.

counterparties is the number of makers requested in the coinjoin; the lower bound of 2 matches the minimum the taker protocol can run with, and the upper bound prevents a malformed request from triggering large allocations / long-running RPC under the auth boundary.

input_utxos is an optional explicit list of "txid:vout" strings. When given, the CoinJoin spends exactly those UTXOs. Omit the field to preserve automatic coin selection.

txfee sets the miner fee for this CoinJoin only, with the same semantics and bounds as on DirectSendRequest: 1-1000 is a block target, anything above is a rate in sat/kvB. It takes precedence over a configset tx_fees value; omit it or send 0 to use the configured fee policy.

Source code in jmwalletd/src/jmwalletd/models.py
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
class DoCoinjoinRequest(BaseModel):
    """POST /api/v1/wallet/{walletname}/taker/coinjoin request.

    ``counterparties`` is the number of makers requested in the coinjoin;
    the lower bound of 2 matches the minimum the taker protocol can run with,
    and the upper bound prevents a malformed request from triggering large
    allocations / long-running RPC under the auth boundary.

    ``input_utxos`` is an optional explicit list of ``"txid:vout"`` strings.
    When given, the CoinJoin spends exactly those UTXOs. Omit the field to
    preserve automatic coin selection.

    ``txfee`` sets the miner fee for this CoinJoin only, with the same
    semantics and bounds as on ``DirectSendRequest``: ``1``-``1000`` is a
    block target, anything above is a rate in sat/kvB. It takes precedence
    over a ``configset`` ``tx_fees`` value; omit it or send ``0`` to use the
    configured fee policy.
    """

    mixdepth: int = Field(..., ge=0)
    amount_sats: int = Field(..., ge=0, le=MAX_MONEY_SATS)
    counterparties: int = Field(..., ge=2, le=20)
    destination: str
    txfee: int | None = Field(default=None, ge=0, le=MAX_MONEY_SATS)
    input_utxos: list[str] | None = None
Attributes
amount_sats: int = Field(..., ge=0, le=MAX_MONEY_SATS) class-attribute instance-attribute
counterparties: int = Field(..., ge=2, le=20) class-attribute instance-attribute
destination: str instance-attribute
input_utxos: list[str] | None = None class-attribute instance-attribute
mixdepth: int = Field(..., ge=0) class-attribute instance-attribute
txfee: int | None = Field(default=None, ge=0, le=MAX_MONEY_SATS) class-attribute instance-attribute

ErrorMessage

Bases: BaseModel

Standard error response body.

Source code in jmwalletd/src/jmwalletd/models.py
28
29
30
31
class ErrorMessage(BaseModel):
    """Standard error response body."""

    message: str = ""
Attributes
message: str = '' class-attribute instance-attribute

FreezeBatchEntry

Bases: BaseModel

One entry of a POST /api/v1/wallet/{walletname}/freeze-batch request.

Same field name and hyphenated wire alias as :class:FreezeRequest, so a caller migrating from one-at-a-time calls to a batch just wraps the same entries in a list.

Source code in jmwalletd/src/jmwalletd/models.py
583
584
585
586
587
588
589
590
591
592
593
594
class FreezeBatchEntry(BaseModel):
    """One entry of a POST /api/v1/wallet/{walletname}/freeze-batch request.

    Same field name and hyphenated wire alias as :class:`FreezeRequest`, so a
    caller migrating from one-at-a-time calls to a batch just wraps the same
    entries in a list.
    """

    utxo_string: str = Field(alias="utxo-string")
    freeze: bool

    model_config = {"populate_by_name": True}
Attributes
freeze: bool instance-attribute
model_config = {'populate_by_name': True} class-attribute instance-attribute
utxo_string: str = Field(alias='utxo-string') class-attribute instance-attribute

FreezeBatchRequest

Bases: BaseModel

POST /api/v1/wallet/{walletname}/freeze-batch request (issue #596).

Applies every entry atomically: either the whole batch lands or, if any entry is invalid, none of it does. An empty list and a repeated outpoint are both rejected outright rather than treated as a partial no-op, since a duplicate has no well-defined outcome (list order alone would decide it) and an empty list is more likely a client bug than "no preference".

Source code in jmwalletd/src/jmwalletd/models.py
597
598
599
600
601
602
603
604
605
606
607
class FreezeBatchRequest(BaseModel):
    """POST /api/v1/wallet/{walletname}/freeze-batch request (issue #596).

    Applies every entry atomically: either the whole batch lands or, if any
    entry is invalid, none of it does. An empty list and a repeated outpoint
    are both rejected outright rather than treated as a partial no-op, since
    a duplicate has no well-defined outcome (list order alone would decide
    it) and an empty list is more likely a client bug than "no preference".
    """

    entries: list[FreezeBatchEntry] = Field(..., min_length=1, max_length=500)
Attributes
entries: list[FreezeBatchEntry] = Field(..., min_length=1, max_length=500) class-attribute instance-attribute

FreezeRequest

Bases: BaseModel

POST /api/v1/wallet/{walletname}/freeze request.

Note: the field name uses a hyphen in the reference API JSON. We use Field(alias=...) to handle this.

Source code in jmwalletd/src/jmwalletd/models.py
570
571
572
573
574
575
576
577
578
579
580
class FreezeRequest(BaseModel):
    """POST /api/v1/wallet/{walletname}/freeze request.

    Note: the field name uses a hyphen in the reference API JSON.
    We use Field(alias=...) to handle this.
    """

    utxo_string: str = Field(alias="utxo-string")
    freeze: bool

    model_config = {"populate_by_name": True}
Attributes
freeze: bool instance-attribute
model_config = {'populate_by_name': True} class-attribute instance-attribute
utxo_string: str = Field(alias='utxo-string') class-attribute instance-attribute

GetAddressResponse

Bases: BaseModel

Response for new address / timelock address requests.

Source code in jmwalletd/src/jmwalletd/models.py
216
217
218
219
class GetAddressResponse(BaseModel):
    """Response for new address / timelock address requests."""

    address: str
Attributes
address: str instance-attribute

GetInfoResponse

Bases: BaseModel

Response for GET /api/v1/getinfo.

Source code in jmwalletd/src/jmwalletd/models.py
140
141
142
143
144
class GetInfoResponse(BaseModel):
    """Response for GET /api/v1/getinfo."""

    version: str
    backend: str
Attributes
backend: str instance-attribute
version: str instance-attribute

GetSeedResponse

Bases: BaseModel

Response for GET /api/v1/wallet/{walletname}/getseed.

Source code in jmwalletd/src/jmwalletd/models.py
311
312
313
314
class GetSeedResponse(BaseModel):
    """Response for GET /api/v1/wallet/{walletname}/getseed."""

    seedphrase: str
Attributes
seedphrase: str instance-attribute

HistoryEntry

Bases: BaseModel

A single CoinJoin/spend record from the wallet history (history.csv).

Mirrors jmwallet.history.TransactionHistoryEntry; surfaced read-only so frontends can display past activity (maker earnings, taker spends, sends).

Source code in jmwalletd/src/jmwalletd/models.py
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
class HistoryEntry(BaseModel):
    """A single CoinJoin/spend record from the wallet history (history.csv).

    Mirrors ``jmwallet.history.TransactionHistoryEntry``; surfaced read-only so
    frontends can display past activity (maker earnings, taker spends, sends).
    """

    timestamp: str
    completed_at: str = ""
    confirmed_at: str = ""
    role: Literal["maker", "taker", "send", "deposit"] = "taker"
    success: bool = True
    failure_reason: str = ""
    confirmations: int = 0
    txid: str = ""
    amount: int = 0
    cj_amount: int | None = None
    peer_count: int | None = None
    counterparty_nicks: str = ""
    fee_received: int = 0
    txfee_contribution: int = 0
    total_maker_fees_paid: int = 0
    mining_fee_paid: int = 0
    net_fee: int = 0
    source_mixdepth: int | None = None
    destination_address: str = ""
    change_address: str = ""
    utxos_used: str = ""
    broadcast_method: str = ""
    broadcast_policy: str = ""
    broadcast_fallback_reason: str = ""
    network: str = ""
    # "protocol" for rows recorded at protocol time (authoritative);
    # "onchain" for rows reconstructed from blockchain data after a seed
    # import (best-effort guesses).
    source: Literal["protocol", "onchain"] = "protocol"
Attributes
amount: int = 0 class-attribute instance-attribute
broadcast_fallback_reason: str = '' class-attribute instance-attribute
broadcast_method: str = '' class-attribute instance-attribute
broadcast_policy: str = '' class-attribute instance-attribute
change_address: str = '' class-attribute instance-attribute
cj_amount: int | None = None class-attribute instance-attribute
completed_at: str = '' class-attribute instance-attribute
confirmations: int = 0 class-attribute instance-attribute
confirmed_at: str = '' class-attribute instance-attribute
counterparty_nicks: str = '' class-attribute instance-attribute
destination_address: str = '' class-attribute instance-attribute
failure_reason: str = '' class-attribute instance-attribute
fee_received: int = 0 class-attribute instance-attribute
mining_fee_paid: int = 0 class-attribute instance-attribute
net_fee: int = 0 class-attribute instance-attribute
network: str = '' class-attribute instance-attribute
peer_count: int | None = None class-attribute instance-attribute
role: Literal['maker', 'taker', 'send', 'deposit'] = 'taker' class-attribute instance-attribute
source: Literal['protocol', 'onchain'] = 'protocol' class-attribute instance-attribute
source_mixdepth: int | None = None class-attribute instance-attribute
success: bool = True class-attribute instance-attribute
timestamp: str instance-attribute
total_maker_fees_paid: int = 0 class-attribute instance-attribute
txfee_contribution: int = 0 class-attribute instance-attribute
txid: str = '' class-attribute instance-attribute
utxos_used: str = '' class-attribute instance-attribute

ListUtxosResponse

Bases: BaseModel

Response for GET /api/v1/wallet/{walletname}/utxos.

Source code in jmwalletd/src/jmwalletd/models.py
248
249
250
251
class ListUtxosResponse(BaseModel):
    """Response for GET /api/v1/wallet/{walletname}/utxos."""

    utxos: list[UTXOEntry] = Field(default_factory=list)
Attributes
utxos: list[UTXOEntry] = Field(default_factory=list) class-attribute instance-attribute

ListWalletsResponse

Bases: BaseModel

Response for GET /api/v1/wallet/all.

Source code in jmwalletd/src/jmwalletd/models.py
129
130
131
132
class ListWalletsResponse(BaseModel):
    """Response for GET /api/v1/wallet/all."""

    wallets: list[str] = Field(default_factory=list)
Attributes
wallets: list[str] = Field(default_factory=list) class-attribute instance-attribute

LockWalletResponse

Bases: BaseModel

Response for wallet lock.

Source code in jmwalletd/src/jmwalletd/models.py
122
123
124
125
126
class LockWalletResponse(BaseModel):
    """Response for wallet lock."""

    walletname: str
    already_locked: bool
Attributes
already_locked: bool instance-attribute
walletname: str instance-attribute

RecoverWalletRequest

Bases: BaseModel

POST /api/v1/wallet/recover request.

Source code in jmwalletd/src/jmwalletd/models.py
 83
 84
 85
 86
 87
 88
 89
 90
 91
 92
 93
 94
 95
 96
 97
 98
 99
100
101
class RecoverWalletRequest(BaseModel):
    """POST /api/v1/wallet/recover request."""

    walletname: WalletName
    password: str
    bip39_passphrase: SecretStr = Field(default_factory=lambda: SecretStr(""))
    wallettype: str = "sw-fb"
    seedphrase: str
    scan_range: int | None = Field(
        default=None,
        ge=1,
        le=10_000,
        description=(
            "Regular address indices to import per branch during descriptor-backend recovery. "
            "Widen-only: values below the configured [wallet].scan_range are "
            "raised to it, so legacy gaplimit-style values cannot shrink "
            "coverage."
        ),
    )
Attributes
bip39_passphrase: SecretStr = Field(default_factory=lambda: SecretStr('')) class-attribute instance-attribute
password: str instance-attribute
scan_range: int | None = Field(default=None, ge=1, le=10000, description='Regular address indices to import per branch during descriptor-backend recovery. Widen-only: values below the configured [wallet].scan_range are raised to it, so legacy gaplimit-style values cannot shrink coverage.') class-attribute instance-attribute
seedphrase: str instance-attribute
walletname: WalletName instance-attribute
wallettype: str = 'sw-fb' class-attribute instance-attribute

RescanBlockchainResponse

Bases: BaseModel

Response for rescanblockchain.

Source code in jmwalletd/src/jmwalletd/models.py
635
636
637
638
class RescanBlockchainResponse(BaseModel):
    """Response for rescanblockchain."""

    walletname: str
Attributes
walletname: str instance-attribute

RescanInfoResponse

Bases: BaseModel

Response for getrescaninfo.

Source code in jmwalletd/src/jmwalletd/models.py
641
642
643
644
645
646
class RescanInfoResponse(BaseModel):
    """Response for getrescaninfo."""

    rescanning: bool
    progress: float | None = None
    error: str | None = None
Attributes
error: str | None = None class-attribute instance-attribute
progress: float | None = None class-attribute instance-attribute
rescanning: bool instance-attribute

SessionResponse

Bases: BaseModel

Response for GET /api/v1/session.

Source code in jmwalletd/src/jmwalletd/models.py
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
class SessionResponse(BaseModel):
    """Response for GET /api/v1/session."""

    session: bool
    maker_running: bool
    coinjoin_in_process: bool
    schedule: list[list[str | int | float]] | None = None
    wallet_name: str = ""
    offer_list: list[dict[str, str | int | float]] | None = None
    nickname: str | None = None
    rescanning: bool = False
    block_height: int | None = None
    descriptor_wallet_name: str | None = None
    broadcast_policy: str | None = None
    broadcast_method: str | None = None
    broadcast_fallback_reason: str | None = None
Attributes
block_height: int | None = None class-attribute instance-attribute
broadcast_fallback_reason: str | None = None class-attribute instance-attribute
broadcast_method: str | None = None class-attribute instance-attribute
broadcast_policy: str | None = None class-attribute instance-attribute
coinjoin_in_process: bool instance-attribute
descriptor_wallet_name: str | None = None class-attribute instance-attribute
maker_running: bool instance-attribute
nickname: str | None = None class-attribute instance-attribute
offer_list: list[dict[str, str | int | float]] | None = None class-attribute instance-attribute
rescanning: bool = False class-attribute instance-attribute
schedule: list[list[str | int | float]] | None = None class-attribute instance-attribute
session: bool instance-attribute
wallet_name: str = '' class-attribute instance-attribute

SignMessageRequest

Bases: BaseModel

POST /api/v1/wallet/{walletname}/signmessage request.

Source code in jmwalletd/src/jmwalletd/models.py
615
616
617
618
619
class SignMessageRequest(BaseModel):
    """POST /api/v1/wallet/{walletname}/signmessage request."""

    hd_path: str
    message: str
Attributes
hd_path: str instance-attribute
message: str instance-attribute

SignMessageResponse

Bases: BaseModel

Response for signmessage.

Source code in jmwalletd/src/jmwalletd/models.py
622
623
624
625
626
627
class SignMessageResponse(BaseModel):
    """Response for signmessage."""

    signature: str
    message: str
    address: str
Attributes
address: str instance-attribute
message: str instance-attribute
signature: str instance-attribute

StartMakerRequest

Bases: BaseModel

POST /api/v1/wallet/{walletname}/maker/start request.

All fields are strings per the reference implementation.

Source code in jmwalletd/src/jmwalletd/models.py
526
527
528
529
530
531
532
533
534
535
536
class StartMakerRequest(BaseModel):
    """POST /api/v1/wallet/{walletname}/maker/start request.

    All fields are strings per the reference implementation.
    """

    txfee: str
    cjfee_a: str
    cjfee_r: str
    ordertype: str
    minsize: str
Attributes
cjfee_a: str instance-attribute
cjfee_r: str instance-attribute
minsize: str instance-attribute
ordertype: str instance-attribute
txfee: str instance-attribute

TakerStatusResponse

Bases: BaseModel

GET /api/v1/wallet/{walletname}/taker/status response.

Reports the outcome of the most recent single-shot taker/coinjoin call (or the live one, while running is true), mirroring the status/txid/error shape of TumblerPhaseResponse so a caller has real evidence of what happened instead of inferring it from wallet-level side effects such as a changed utxo set (issue #627).

status is a TakerState value (e.g. "complete", "failed", "cancelled", "broadcasting") or None if no taker run has happened yet this session. A txid being present does not by itself mean the CoinJoin is final: check status == "complete" for a good broadcast, and confirmation status separately via the wallet history.

Even status == "complete" is not on its own a verified broadcast: with a peer policy that allows delivery without local mempool access (e.g. broadcast_method starting with "makers-unverified:"), the taker reports completion once a maker accepted delivery, not once it has confirmed the tx is actually in the mempool. Check broadcast_method to tell the two apart before wording a success message.

Source code in jmwalletd/src/jmwalletd/models.py
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
class TakerStatusResponse(BaseModel):
    """GET /api/v1/wallet/{walletname}/taker/status response.

    Reports the outcome of the most recent single-shot ``taker/coinjoin``
    call (or the live one, while ``running`` is true), mirroring the
    status/txid/error shape of ``TumblerPhaseResponse`` so a caller has
    real evidence of what happened instead of inferring it from wallet-level
    side effects such as a changed utxo set (issue #627).

    ``status`` is a ``TakerState`` value (e.g. ``"complete"``, ``"failed"``,
    ``"cancelled"``, ``"broadcasting"``) or ``None`` if no taker run has
    happened yet this session. A ``txid`` being present does not by itself
    mean the CoinJoin is final: check ``status == "complete"`` for a good
    broadcast, and confirmation status separately via the wallet history.

    Even ``status == "complete"`` is not on its own a verified broadcast: with
    a peer policy that allows delivery without local mempool access (e.g.
    ``broadcast_method`` starting with ``"makers-unverified:"``), the taker
    reports completion once a maker accepted delivery, not once it has
    confirmed the tx is actually in the mempool. Check ``broadcast_method``
    to tell the two apart before wording a success message.
    """

    running: bool
    status: str | None = None
    txid: str | None = None
    error: str | None = None
    broadcast_method: str | None = None
Attributes
broadcast_method: str | None = None class-attribute instance-attribute
error: str | None = None class-attribute instance-attribute
running: bool instance-attribute
status: str | None = None class-attribute instance-attribute
txid: str | None = None class-attribute instance-attribute

TokenRequest

Bases: BaseModel

POST /api/v1/token request.

Source code in jmwalletd/src/jmwalletd/models.py
39
40
41
42
43
class TokenRequest(BaseModel):
    """POST /api/v1/token request."""

    grant_type: str
    refresh_token: str
Attributes
grant_type: str instance-attribute
refresh_token: str instance-attribute

TokenResponse

Bases: BaseModel

Token issuance response (used by create, unlock, recover, refresh).

Source code in jmwalletd/src/jmwalletd/models.py
46
47
48
49
50
51
52
53
54
class TokenResponse(BaseModel):
    """Token issuance response (used by create, unlock, recover, refresh)."""

    walletname: str = ""
    token: str
    token_type: str = "bearer"
    expires_in: int = 1800
    scope: str = ""
    refresh_token: str
Attributes
expires_in: int = 1800 class-attribute instance-attribute
refresh_token: str instance-attribute
scope: str = '' class-attribute instance-attribute
token: str instance-attribute
token_type: str = 'bearer' class-attribute instance-attribute
walletname: str = '' class-attribute instance-attribute

TumblerPhaseResponse

Bases: BaseModel

A single phase rendered for the API. Keeps the discriminator flat.

Source code in jmwalletd/src/jmwalletd/models.py
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
class TumblerPhaseResponse(BaseModel):
    """A single phase rendered for the API. Keeps the discriminator flat."""

    kind: str
    index: int
    status: str
    wait_seconds: float
    started_at: str | None = None
    finished_at: str | None = None
    error: str | None = None
    # Optional variant fields; only the ones relevant to ``kind`` are populated.
    mixdepth: int | None = None
    amount: int | None = None
    amount_fraction: float | None = None
    counterparty_count: int | None = None
    destination: str | None = None
    txid: str | None = None
    duration_seconds: float | None = None
    target_cj_count: int | None = None
    idle_timeout_seconds: float | None = None
    cj_served: int | None = None
    attempt_count: int | None = None
Attributes
amount: int | None = None class-attribute instance-attribute
amount_fraction: float | None = None class-attribute instance-attribute
attempt_count: int | None = None class-attribute instance-attribute
cj_served: int | None = None class-attribute instance-attribute
counterparty_count: int | None = None class-attribute instance-attribute
destination: str | None = None class-attribute instance-attribute
duration_seconds: float | None = None class-attribute instance-attribute
error: str | None = None class-attribute instance-attribute
finished_at: str | None = None class-attribute instance-attribute
idle_timeout_seconds: float | None = None class-attribute instance-attribute
index: int instance-attribute
kind: str instance-attribute
mixdepth: int | None = None class-attribute instance-attribute
started_at: str | None = None class-attribute instance-attribute
status: str instance-attribute
target_cj_count: int | None = None class-attribute instance-attribute
txid: str | None = None class-attribute instance-attribute
wait_seconds: float instance-attribute

TumblerPlanRequest

Bases: BaseModel

POST /api/v1/wallet/{walletname}/tumbler/plan request.

Destinations are the external bitcoin addresses the tumble should ultimately sweep funds to; order is significant (first destination maps to the first non-empty landing mixdepth). parameters lets the caller override the builder defaults; omit for sensible knobs. force overrides a pending-only plan on disk; plans that are RUNNING in the daemon are always protected (stop first).

Source code in jmwalletd/src/jmwalletd/models.py
464
465
466
467
468
469
470
471
472
473
474
475
476
477
class TumblerPlanRequest(BaseModel):
    """POST /api/v1/wallet/{walletname}/tumbler/plan request.

    Destinations are the external bitcoin addresses the tumble should
    ultimately sweep funds to; order is significant (first destination
    maps to the first non-empty landing mixdepth). ``parameters`` lets
    the caller override the builder defaults; omit for sensible knobs.
    ``force`` overrides a pending-only plan on disk; plans that are
    ``RUNNING`` in the daemon are always protected (stop first).
    """

    destinations: list[str] = Field(..., min_length=1)
    parameters: dict[str, object] | None = None
    force: bool = False
Attributes
destinations: list[str] = Field(..., min_length=1) class-attribute instance-attribute
force: bool = False class-attribute instance-attribute
parameters: dict[str, object] | None = None class-attribute instance-attribute

TumblerPlanResponse

Bases: BaseModel

Response body returned by tumbler plan / status endpoints.

Source code in jmwalletd/src/jmwalletd/models.py
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
class TumblerPlanResponse(BaseModel):
    """Response body returned by tumbler plan / status endpoints."""

    plan_id: str
    wallet_name: str
    status: str
    destinations: list[str]
    current_phase: int
    phases: list[TumblerPhaseResponse]
    created_at: str
    updated_at: str
    error: str | None = None
    # True iff the plan was found in ``RUNNING`` on disk but no runner is
    # live in the daemon; set by the status endpoint so the UI can flag it.
    stale: bool = False
Attributes
created_at: str instance-attribute
current_phase: int instance-attribute
destinations: list[str] instance-attribute
error: str | None = None class-attribute instance-attribute
phases: list[TumblerPhaseResponse] instance-attribute
plan_id: str instance-attribute
stale: bool = False class-attribute instance-attribute
status: str instance-attribute
updated_at: str instance-attribute
wallet_name: str instance-attribute

TxInfo

Bases: BaseModel

Full transaction information.

Source code in jmwalletd/src/jmwalletd/models.py
339
340
341
342
343
344
345
346
347
348
349
350
class TxInfo(BaseModel):
    """Full transaction information."""

    hex: str
    inputs: list[TxInput] = Field(default_factory=list)
    outputs: list[TxOutput] = Field(default_factory=list)
    txid: str
    nLockTime: int = 0
    nVersion: int = 2
    # Confirmation count when known (set by the transaction monitor: ``0`` while
    # in the mempool, >=1 once mined). ``None`` for a freshly broadcast tx.
    confirmations: int | None = None
Attributes
confirmations: int | None = None class-attribute instance-attribute
hex: str instance-attribute
inputs: list[TxInput] = Field(default_factory=list) class-attribute instance-attribute
nLockTime: int = 0 class-attribute instance-attribute
nVersion: int = 2 class-attribute instance-attribute
outputs: list[TxOutput] = Field(default_factory=list) class-attribute instance-attribute
txid: str instance-attribute

TxInput

Bases: BaseModel

A transaction input.

Source code in jmwalletd/src/jmwalletd/models.py
322
323
324
325
326
327
328
class TxInput(BaseModel):
    """A transaction input."""

    outpoint: str
    scriptSig: str = ""
    nSequence: int = 4294967295
    witness: str = ""
Attributes
nSequence: int = 4294967295 class-attribute instance-attribute
outpoint: str instance-attribute
scriptSig: str = '' class-attribute instance-attribute
witness: str = '' class-attribute instance-attribute

TxOutput

Bases: BaseModel

A transaction output.

Source code in jmwalletd/src/jmwalletd/models.py
331
332
333
334
335
336
class TxOutput(BaseModel):
    """A transaction output."""

    value_sats: int
    scriptPubKey: str
    address: str
Attributes
address: str instance-attribute
scriptPubKey: str instance-attribute
value_sats: int instance-attribute

UTXOEntry

Bases: BaseModel

A single UTXO in the listutxos response.

Source code in jmwalletd/src/jmwalletd/models.py
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
class UTXOEntry(BaseModel):
    """A single UTXO in the listutxos response."""

    utxo: str  # "txid:vout"
    address: str
    path: str
    label: str = ""
    value: int
    tries: int = 0
    tries_remaining: int = 3
    external: bool = False
    mixdepth: int
    confirmations: int
    frozen: bool = False
    # Present only for timelocked fidelity bond UTXOs. Formatted as the legacy
    # joinmarket-clientserver UTC datetime string (e.g. "2025-06-01 00:00:00")
    # so JAM (which keys fidelity-bond detection off a truthy ``locktime``)
    # treats the UTXO as a bond. Regular UTXOs omit the field entirely.
    locktime: str | None = None
Attributes
address: str instance-attribute
confirmations: int instance-attribute
external: bool = False class-attribute instance-attribute
frozen: bool = False class-attribute instance-attribute
label: str = '' class-attribute instance-attribute
locktime: str | None = None class-attribute instance-attribute
mixdepth: int instance-attribute
path: str instance-attribute
tries: int = 0 class-attribute instance-attribute
tries_remaining: int = 3 class-attribute instance-attribute
utxo: str instance-attribute
value: int instance-attribute

UnlockWalletRequest

Bases: BaseModel

POST /api/v1/wallet/{walletname}/unlock request.

Source code in jmwalletd/src/jmwalletd/models.py
104
105
106
107
108
class UnlockWalletRequest(BaseModel):
    """POST /api/v1/wallet/{walletname}/unlock request."""

    password: str
    bip39_passphrase: SecretStr = Field(default_factory=lambda: SecretStr(""))
Attributes
bip39_passphrase: SecretStr = Field(default_factory=lambda: SecretStr('')) class-attribute instance-attribute
password: str instance-attribute

UnlockWalletResponse

Bases: BaseModel

Response for wallet unlock.

Source code in jmwalletd/src/jmwalletd/models.py
111
112
113
114
115
116
117
118
119
class UnlockWalletResponse(BaseModel):
    """Response for wallet unlock."""

    walletname: str
    token: str
    token_type: str = "bearer"
    expires_in: int = 1800
    scope: str = ""
    refresh_token: str
Attributes
expires_in: int = 1800 class-attribute instance-attribute
refresh_token: str instance-attribute
scope: str = '' class-attribute instance-attribute
token: str instance-attribute
token_type: str = 'bearer' class-attribute instance-attribute
walletname: str instance-attribute

WalletDisplayAccount

Bases: BaseModel

A single account (mixdepth) in the wallet display.

Source code in jmwalletd/src/jmwalletd/models.py
186
187
188
189
190
191
192
class WalletDisplayAccount(BaseModel):
    """A single account (mixdepth) in the wallet display."""

    account: str
    account_balance: str
    available_balance: str = "0.00000000"
    branches: list[WalletDisplayBranch] = Field(default_factory=list)
Attributes
account: str instance-attribute
account_balance: str instance-attribute
available_balance: str = '0.00000000' class-attribute instance-attribute
branches: list[WalletDisplayBranch] = Field(default_factory=list) class-attribute instance-attribute

WalletDisplayBranch

Bases: BaseModel

A branch (external/internal/bond) within an account.

Source code in jmwalletd/src/jmwalletd/models.py
177
178
179
180
181
182
183
class WalletDisplayBranch(BaseModel):
    """A branch (external/internal/bond) within an account."""

    branch: str
    balance: str
    available_balance: str = "0.00000000"
    entries: list[WalletDisplayEntry] = Field(default_factory=list)
Attributes
available_balance: str = '0.00000000' class-attribute instance-attribute
balance: str instance-attribute
branch: str instance-attribute
entries: list[WalletDisplayEntry] = Field(default_factory=list) class-attribute instance-attribute

WalletDisplayEntry

Bases: BaseModel

A single address entry in the wallet display.

Source code in jmwalletd/src/jmwalletd/models.py
165
166
167
168
169
170
171
172
173
174
class WalletDisplayEntry(BaseModel):
    """A single address entry in the wallet display."""

    hd_path: str
    address: str
    amount: str
    available_balance: str = "0.00000000"
    status: str = ""
    label: str = ""
    extradata: str = ""
Attributes
address: str instance-attribute
amount: str instance-attribute
available_balance: str = '0.00000000' class-attribute instance-attribute
extradata: str = '' class-attribute instance-attribute
hd_path: str instance-attribute
label: str = '' class-attribute instance-attribute
status: str = '' class-attribute instance-attribute

WalletDisplayResponse

Bases: BaseModel

Response for GET /api/v1/wallet/{walletname}/display.

Source code in jmwalletd/src/jmwalletd/models.py
204
205
206
207
208
class WalletDisplayResponse(BaseModel):
    """Response for GET /api/v1/wallet/{walletname}/display."""

    walletname: str
    walletinfo: WalletInfo
Attributes
walletinfo: WalletInfo instance-attribute
walletname: str instance-attribute

WalletHistoryResponse

Bases: BaseModel

Response for GET /api/v1/wallet/{walletname}/history.

history is ordered most-recent first.

Source code in jmwalletd/src/jmwalletd/models.py
297
298
299
300
301
302
303
class WalletHistoryResponse(BaseModel):
    """Response for GET /api/v1/wallet/{walletname}/history.

    ``history`` is ordered most-recent first.
    """

    history: list[HistoryEntry] = Field(default_factory=list)
Attributes
history: list[HistoryEntry] = Field(default_factory=list) class-attribute instance-attribute

WalletInfo

Bases: BaseModel

The walletinfo object within the display response.

Source code in jmwalletd/src/jmwalletd/models.py
195
196
197
198
199
200
201
class WalletInfo(BaseModel):
    """The walletinfo object within the display response."""

    wallet_name: str = "JM wallet"
    total_balance: str = "0.00000000"
    available_balance: str = "0.00000000"
    accounts: list[WalletDisplayAccount] = Field(default_factory=list)
Attributes
accounts: list[WalletDisplayAccount] = Field(default_factory=list) class-attribute instance-attribute
available_balance: str = '0.00000000' class-attribute instance-attribute
total_balance: str = '0.00000000' class-attribute instance-attribute
wallet_name: str = 'JM wallet' class-attribute instance-attribute

YieldGenReportResponse

Bases: BaseModel

Response for yieldgen/report.

Source code in jmwalletd/src/jmwalletd/models.py
654
655
656
657
class YieldGenReportResponse(BaseModel):
    """Response for yieldgen/report."""

    yigen_data: list[str] = Field(default_factory=list)
Attributes
yigen_data: list[str] = Field(default_factory=list) class-attribute instance-attribute