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
497 498 499 500 501 | |
Attributes
field: str
instance-attribute
section: str
instance-attribute
ConfigGetResponse
Bases: BaseModel
Response for configget.
Source code in jmwalletd/src/jmwalletd/models.py
504 505 506 507 | |
Attributes
configvalue: str
instance-attribute
ConfigSetRequest
Bases: BaseModel
POST /api/v1/wallet/{walletname}/configset request.
Source code in jmwalletd/src/jmwalletd/models.py
510 511 512 513 514 515 | |
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 | |
Attributes
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
70 71 72 73 74 75 76 77 78 79 | |
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.
Source code in jmwalletd/src/jmwalletd/models.py
357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 | |
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)
class-attribute
instance-attribute
DirectSendResponse
Bases: BaseModel
Response for direct-send.
Source code in jmwalletd/src/jmwalletd/models.py
385 386 387 388 | |
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.
Source code in jmwalletd/src/jmwalletd/models.py
396 397 398 399 400 401 402 403 404 405 406 407 408 409 410 411 412 413 414 | |
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)
class-attribute
instance-attribute
ErrorMessage
Bases: BaseModel
Standard error response body.
Source code in jmwalletd/src/jmwalletd/models.py
28 29 30 31 | |
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
536 537 538 539 540 541 542 543 544 545 546 547 | |
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
550 551 552 553 554 555 556 557 558 559 560 | |
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
523 524 525 526 527 528 529 530 531 532 533 | |
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
213 214 215 216 | |
Attributes
address: str
instance-attribute
GetInfoResponse
Bases: BaseModel
Response for GET /api/v1/getinfo.
Source code in jmwalletd/src/jmwalletd/models.py
137 138 139 140 141 | |
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
308 309 310 311 | |
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
256 257 258 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 | |
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
245 246 247 248 | |
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
126 127 128 129 | |
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
119 120 121 122 123 | |
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
82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 | |
Attributes
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
588 589 590 591 | |
Attributes
walletname: str
instance-attribute
RescanInfoResponse
Bases: BaseModel
Response for getrescaninfo.
Source code in jmwalletd/src/jmwalletd/models.py
594 595 596 597 598 599 | |
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
144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 | |
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
568 569 570 571 572 | |
Attributes
hd_path: str
instance-attribute
message: str
instance-attribute
SignMessageResponse
Bases: BaseModel
Response for signmessage.
Source code in jmwalletd/src/jmwalletd/models.py
575 576 577 578 579 580 | |
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
479 480 481 482 483 484 485 486 487 488 489 | |
Attributes
cjfee_a: str
instance-attribute
cjfee_r: str
instance-attribute
minsize: str
instance-attribute
ordertype: str
instance-attribute
txfee: str
instance-attribute
TokenRequest
Bases: BaseModel
POST /api/v1/token request.
Source code in jmwalletd/src/jmwalletd/models.py
39 40 41 42 43 | |
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 | |
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
433 434 435 436 437 438 439 440 441 442 443 444 445 446 447 448 449 450 451 452 453 454 | |
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
417 418 419 420 421 422 423 424 425 426 427 428 429 430 | |
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
457 458 459 460 461 462 463 464 465 466 467 468 469 470 471 | |
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
336 337 338 339 340 341 342 343 344 345 346 347 | |
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
319 320 321 322 323 324 325 | |
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
328 329 330 331 332 333 | |
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
224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 | |
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
102 103 104 105 | |
Attributes
password: str
instance-attribute
UnlockWalletResponse
Bases: BaseModel
Response for wallet unlock.
Source code in jmwalletd/src/jmwalletd/models.py
108 109 110 111 112 113 114 115 116 | |
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
183 184 185 186 187 188 189 | |
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
174 175 176 177 178 179 180 | |
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
162 163 164 165 166 167 168 169 170 171 | |
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
201 202 203 204 205 | |
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
294 295 296 297 298 299 300 | |
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
192 193 194 195 196 197 198 | |
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
607 608 609 610 | |