Skip to content

feat(connect): AntSeed Connect with signed auto-deposit state#18

Open
gabrielpoca wants to merge 3 commits into
auto-deposit-funding-portalfrom
funding-portal
Open

feat(connect): AntSeed Connect with signed auto-deposit state#18
gabrielpoca wants to merge 3 commits into
auto-deposit-funding-portalfrom
funding-portal

Conversation

@gabrielpoca

@gabrielpoca gabrielpoca commented Jun 23, 2026

Copy link
Copy Markdown
Member

What

Adds the AntSeed Connect protocol and uses it to share the buyer's
auto-deposit status with a web app (the funding portal), signed by the seed
app. Stacked on top of auto-deposit-funding-portal.

A portal that only reads delegation on-chain (eth_getCode) cannot tell
"auto-deposit is off" from "the user turned it on but no funds have arrived
yet" (delegation lands lazily on the first deposit). Connect lets the seed app
report its real state { enabled, delegated } so the portal can show accurate
messaging.

Changes

  • connect-core (new package): scope-driven request/response over the
    antseed://connect deep link, single EIP-191 personal_sign signature,
    response delivered in the redirect URL fragment. Scopes: address and
    auto-deposit (signed deterministic JSON { enabled, delegated }). Standalone,
    no @antseed/node dependency.
  • CLI: antseed connect <link> with a consent prompt (--yes / --print).
  • Desktop: antseed:// deep-link handler with cold-start buffering, parsing
    and signing in the main process (the renderer only shows the request and
    returns the decision), and a consent dialog.
  • Seed-side auto-deposit state: enabled from config consent plus
    delegated read on-chain (eth_getCode against the EIP-7702 designator),
    signed into the response. The on-chain read reuses service-auto-deposit.
  • Optional-plugin loading: the connect path does not hard-depend on
    service-auto-deposit. The CLI resolves the state reader from the plugins dir
    at runtime the same way loader.ts loads any plugin (moved to
    devDependencies); the desktop imports it lazily. A missing or stale plugin
    degrades to delegated: false while still reporting enabled from config,
    instead of failing at startup.
  • Dark mode fix: re-map @antseed/ui --as-* tokens under
    body.dark-theme so the consent modal renders correctly in dark mode.

Testing

  • connect-core: 37 unit tests (request-link validation incl. control-char
    injection, manifest parsing, response sign/verify round-trip, auto-deposit
    scope round-trip).
  • Verified against the real CLI binary: antseed connect boots without the
    plugin installed, signs { enabled, delegated }, and the response verifies via
    verifyConnectResponse (recovered signer matches, auto-deposit value parses
    back). Graceful fallback confirmed when the plugin is absent/stale, and the
    reader is invoked for real when a current plugin is present.
  • Desktop main builds and typechecks; the lazy import resolves from the desktop's
    bundled copy and the fallback preserves enabled.

Notes

  • Base is auto-deposit-funding-portal (stacked), not main.
  • The web funding-portal consumer is intentionally excluded from this PR.

Add the AntSeed Connect protocol (connect-core) so a web app can request
signed account info from the local seed app, and share the buyer's
auto-deposit status through it.

- connect-core: scope-driven EIP-191 request/response; scopes `address`
  and `auto-deposit` (signed JSON {enabled, delegated})
- cli: `antseed connect <link>` command with consent prompt
- desktop: macOS antseed:// deep-link handler, main-process signing,
  consent dialog
- seed side computes the auto-deposit state (consent from config,
  delegation via eth_getCode, reusing service-auto-deposit) and signs it
  into the response
- desktop: re-map @antseed/ui --as-* tokens under body.dark-theme so modal
  primitives render correctly in dark mode
Remove doc comments that only restate the field/type name, delete the
(Section N) / spec 07-connect.md references from the inline docs, and
replace emdashes with colons.
…ithout it

The CLI connect command statically imported @antseed/service-auto-deposit,
so a missing plugin would crash the whole CLI at startup instead of just the
auto-deposit scope. Resolve the connect-state reader from the plugins dir at
runtime the same way loader.ts loads any plugin, and move the package to
devDependencies. A missing or stale plugin now degrades to delegated:false
while still reporting enabled from config.

Desktop keeps the plugin bundled but imports it lazily inside getAutoDepositState
so a broken copy degrades instead of crashing the main process.
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