Skip to content

docs: vault-side ETH tx tracker handoff#54

Open
BitHighlander wants to merge 1 commit intodevelopfrom
docs/vault-eth-tx-tracker
Open

docs: vault-side ETH tx tracker handoff#54
BitHighlander wants to merge 1 commit intodevelopfrom
docs/vault-eth-tx-tracker

Conversation

@BitHighlander
Copy link
Copy Markdown
Collaborator

Handoff doc for the vault-v11 changes required to unblock the BEX pending-tx visibility feature (ShieldBadge pip + dropdown, rebroadcast/cancel/speed-up).

What's in it

  • Audit of existing vault infrastructure — `api_log` already stores full raw signed hex (source comment at `rest-api.ts:1053-1066` confirms intent), `swap-tracker.ts` is the polling+push pattern to mirror, `/api/v1/activity` already exposes filterable history. Don't reinvent.
  • One known bug: running vault binary returns `responseBody.serialized = "[trimmed]"`. Source doesn't trim — running build is older. Action: rebuild vault.
  • Full proposed design with diagram, vocabulary (networkId vs chainId convention), state machine.
  • Vault change list — 1 new sqlite table (`eth_tx_status`), 1 new module (`eth-tx-tracker.ts` mirrors swap-tracker), 5 new REST endpoints, 5 new SDK methods. Every file referenced with absolute path.
  • Cancel + speed-up flow detail — both reuse `/eth/sign-transaction` + device confirmation. Original tx fields sourced from `api_log.request_body`.
  • Test plan for `keepkey-vault-v11/projects/keepkey-sdk/tests/` (the controlled environment).
  • Sequencing — vault PR Bump eslint-plugin-react from 7.35.0 to 7.36.1 #1 (storage + tracker + GET endpoints), then SDK release, then vault PR Bump tailwindcss from 3.4.10 to 3.4.11 #2 (rebroadcast/speed-up/cancel), then BEX PR.
  • File index at the bottom — every absolute path in one place for the vault maintainer.

Companion BEX work

Lives on `feat/pending-tx-visibility` in this repo. Gated on vault SDK release.

Why this is doc-only

No vault repo changes happen here. This PR just gets the proposal reviewed + lands a stable URL the vault PR can reference.

Complete proposal + handoff for vault changes needed to unblock the
BEX pending-tx visibility feature. Audits what already exists
(api_log raw hex storage, swap-tracker.ts polling pattern,
/api/v1/activity endpoint), proposes a narrow extension that mirrors
swap-tracker for plain ETH txs, and lists every file with absolute
paths.

Architecture follows the corrected direction: vault owns persistence
(SQLite + tracker), BEX is a thin polling client. No new BEX-side
storage. Re-broadcast uses cached raw hex from api_log
(re-uses existing data, no duplication).

Five new vault REST endpoints + matching SDK methods:
  GET  /api/v1/eth/pending
  GET  /api/v1/eth/tx/:txid
  POST /api/v1/eth/tx/:txid/rebroadcast
  POST /api/v1/eth/tx/:txid/speed-up
  POST /api/v1/eth/tx/:txid/cancel

One new SQLite table (eth_tx_status) — separate from api_log
because audit must remain immutable. Polling cadence 60s,
drop heuristic pending-vs-latest after 2min.

BEX companion work goes on feat/pending-tx-visibility branch
(separate PR, gated on vault SDK release).

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
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