Skip to content

V2 JoinMarket NG tumbler#1232

Draft
m0wer wants to merge 11 commits into
v2-jm-ngfrom
v2-jm-ng-tumbler
Draft

V2 JoinMarket NG tumbler#1232
m0wer wants to merge 11 commits into
v2-jm-ngfrom
v2-jm-ng-tumbler

Conversation

@m0wer
Copy link
Copy Markdown
Member

@m0wer m0wer commented Apr 28, 2026

This is a continuation of #1166 that adds breaking changes to the jmwalletd API.

The tumbler redesign shares and endpoint for the schedule.

By default the tumbler will fail since the default setting is to not accepted bondless makers with more than 0 fees. Need to find a way to switch that off for testing.

m0wer added 11 commits April 28, 2026 12:51
Replace the published @joinmarket-webui/joinmarket-api-ts@0.3.0
(generated from joinmarket-clientserver/docs/api/wallet-rpc.yaml) with
a fresh build generated from jm-ng's /openapi.json.

The new client is consumed from the m0wer/joinmarket-api-ts#jm-ng fork
(see follow-up commit) until the upstream package publishes a
jm-ng-compatible release. It pulls in the new tumbler endpoints
(tumblerplan, tumblerstart, tumblerstatus, tumblerstop,
tumblerplandelete) and removes the legacy /taker/schedule operations.
The jm-ng OpenAPI client emits FastAPI-shaped error types (HttpValidationError)
instead of the legacy ErrorMessage interface, and several response fields are
now optional or nullable that previously were required.

- Drop the explicit ErrorMessage error generic on useQuery / useMutation /
  callback annotations; let inference flow from the SDK options or fall back
  to unknown for prop signatures.
- Route all error message extraction through getErrorReason(error, fallback)
  so the runtime '{message: ...}' shape returned by jm-ng's
  daemon_error_handler keeps working without leaking type assumptions.
- Guard the now-optional WalletInfo.accounts and nullable
  RescanInfoResponse.progress.
- Coerce the now-mixed string|number values in SessionResponse.offer_list
  via String(... ?? '').
- Drop unused non-null assertion on the now-required WalletDisplayBranch.branch.

Sweep is intentionally left untouched here -- the legacy /taker/schedule
operations no longer exist in the SDK and SweepPage is rewritten in the
follow-up commit.
Replace the legacy /taker/schedule integration with the new tumbler
plan/start/status/stop/delete flow. The progress UI now consumes
TumblerPlanResponse/TumblerPhaseResponse directly: scheduleUtils derives
the per-step summary from phase status (pending/running/completed/failed/
cancelled) instead of the legacy 7-tuple state flag, and surfaces
broadcast txids from either phase.txid or the multi-tx phase.txids list.

SweepPage drives a two-step start (POST /tumbler/plan -> POST
/tumbler/start) with force=true so leftover PENDING plans never trap
the user, polls /tumbler/status while a coinjoin is in process, and
shows a terminal-state alert with a 'clear plan' button (DELETE
/tumbler/plan) once the runner reaches completed/failed/cancelled.

Changelog: Use jm-ng tumbler API for the Sweep page; show terminal
plan state with an option to clear it before starting a new run.
Point the Logs page at jm-ng's in-memory /api/v1/logs endpoint instead of the legacy file-based route.

Changelog: Restore the Logs page against jm-ng backends
After lock/unlock the SweepPage rendered a leftover PENDING tumbler plan as if it were live, scheduling fake transactions and offering a Stop button that hit the backend with no running plan. Only render the progress card for running or terminal plans, and surface pending plans with an informational alert so the user can either start or discard them. Also move the insecure regtest parameter payload to jm-ng-native TumbleParameters fields.

Changelog: Stop rendering pending sweep plans as live schedules.
On failed plans the progress card showed a success banner alongside
the outer terminal-error alert. The running Stop button also stuck
around once the plan reached a terminal state, and per-phase rows
exposed only the bare state/wait fields while jm-ng already returns
kind, mixdepth, amount/fraction, destination, counterparty_count,
duration and per-phase errors.

Suppress the success banner unless the plan status is completed, hide
the Stop button on terminal plans, and render the planned taker /
maker / bondless-burst metadata (plus any phase-level error) directly
under each transaction row.
Now that the regtest stack runs three maker peers simultaneously
(jm_regtest_joinmarket2/3/4 with Satoshi.jmdat) the insecure debug
parameters no longer need to force counterparty_count=1; lift them
to 2..3 so dev tumbles exercise realistic maker-count logic while
staying fast.
Replace the local tarball reference (`file:./tmp/joinmarket-api-ts/...`)
with a git URL pointing at the m0wer/joinmarket-api-ts#jm-ng fork. The
fork ships a `prepare` script that builds `dist/` on install when
absent, so `npm install` works on a clean clone without any out-of-tree
checkout.

The lockfile pins the fork commit, so installs are reproducible until the
upstream package publishes a jm-ng-compatible release.
…ial fork

Replace the temporary github:m0wer/joinmarket-api-ts#jm-ng dependency
with github:joinmarket-ng/joinmarket-ng-api-ts#master and rename all 40
imports from @joinmarket-webui/joinmarket-api-ts to
@joinmarket-ng/joinmarket-ng-api-ts to match the official fork's
package name.

The new repository publishes the OpenAPI spec to GitHub Pages on every
push to master:

  https://joinmarket-ng.github.io/joinmarket-ng-api-ts/openapi.json
  https://joinmarket-ng.github.io/joinmarket-ng-api-ts/openapi.yaml
  https://joinmarket-ng.github.io/joinmarket-ng-api-ts/  (Swagger UI)

so consumers (and the schema-fetch script in the SDK repo) can pull the
canonical jm-ng spec without needing local access to a running
jmwalletd.
…kage commit

Refresh package-lock.json after the upstream fork pushed the rename
commit (1e7c573) which fixes the package name to match the repository
name (@joinmarket-ng/joinmarket-ng-api-ts).
Pin a CI build of jmwalletd to test the tumbler in regtest. This is a
temporary change and should be reverted once the tumbler branch
is merged to main and a new jmwalletd image is built.
@m0wer m0wer changed the title V2 jm ng tumbler V2 JoinMarket NG tumbler Apr 28, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant