Seedelf-Wallet

Chunk 15b plan: a swap that runs itself

Why: a private swap works today (chunk 15, step 2), but every step is a button: fund the session, place the order, bring it back. On 2026-09-25 the user asked for it to run on its own after one approval, and above all to be able to pick up at any point and carry on. That matters for more than a locked wallet: a closed browser, a restarted worker, a wallet opened again hours later. It’s built on the same branch, web-wallet/dapp-connector, in the same PR as the rest of chunk 15.

Built (2026-09-25)

A swap runs itself after one approval, from a dApp browser, as The design below says, with the decisions above.

Found on the user’s first try (2026-09-25)

Start here

  1. git fetch origin && git checkout web-wallet/dapp-connector. The branch is at 384ef7b or later: the connector (fe8b774), the Koios CORS fix (9d96bcd), private swaps (b858d22), preprod MIN’s decimals (384ef7b).
  2. Read, in order:
  3. Build and test.
    • From seedelf-platform/: cargo test -p seedelf-wasm, then seedelf-web-wallet/wasm/build.sh, then node --test "seedelf-web-wallet/wasm/tests/*.test.mjs".
    • From extension/: npm run typecheck && npm test && npm run build:ext && npm run e2e.
    • Totals at the handoff: WebAssembly native 62 (plus 1 ignored fixture writer), Node 33, Vitest 239 (plus 2 skipped), Playwright 45.
  4. The user tests by hand on preprod. They reload the extension after npm run build (never npm run package, which leaves a store build without the dev key in dist/).

What’s there now

Decided (the user, 2026-09-25)

Decided when 15b started (the user, 2026-09-25)

Decided in the build

The design

A runner that takes the next step

The steps

Step Moves on when Does
funding the funding is on chain (tx_status), or the account holds it → ordering
ordering always swapBuild, then the checks below; within them, sign and submit (txSubmit) → waiting; outside them → paused
waiting the swap is on chain and Minswap lists no open order backBuild + backSubmit → returning
returning the return is on chain and the account is empty → done, in the success colour

Resuming at any point

The waiting zone (UI)

Requests per swap

Tests to write

Gotchas found in chunk 15

Not in this step