Skip to content

feat: Summon wallets via capability-based metadata (supersedes #212) - #371

Merged
QSchlegel merged 4 commits into
preprodfrom
contrib/issue-204-summon-capabilities
Aug 21, 2026
Merged

feat: Summon wallets via capability-based metadata (supersedes #212)#371
QSchlegel merged 4 commits into
preprodfrom
contrib/issue-204-summon-capabilities

Conversation

@QSchlegel

Copy link
Copy Markdown
Collaborator

Carries @kanyuku's work from #212 onto preprod with the requested changes applied. Their two commits are preserved in this branch's history — this is a merge, not a squash — so authorship stays intact.

I could not push to the fork branch directly, so the work is re-homed here rather than updating #212 in place. #212 and #208 should be closed in favour of this.

What it does

Introduces WalletCapabilities (canStake / canVote / resolved address / stakeAddress / dRepId) on Wallet, populated by buildWallet() for all three wallet types (legacy, sdk, summon). Call sites that used to re-derive the script address by hand now read it off capabilities. Adds Summon wallet support end to end, including the API routes (freeUtxos, transactions, run-snapshots-batch).

Review feedback from #212, addressed

  • Rebased onto preprodFeature/issue 204 summon api routes #212 targeted main.
  • wallet.capabilities!.address in useWalletBalances.ts no longer asserts. capabilities is optional on Wallet, so a row reaching the hook without going through buildWallet() (cached records, tests, future call sites) would have thrown. Now guarded, with the previous address-resolution path as the fallback and wallet.address as the last resort. network restored to the dependency array.
  • Summon canVote: false carries a TODO. Summon's rawImportBodies.multisig ships only payment_script and stake_script, so there is no DRep credential to derive — the same reason dRepId is empty there. The TODO says so and points back at the Feature/issue 204 summon api routes #212 review thread.
  • run-snapshots-batch.ts explains the deletion. A comment records that buildWallet() now performs the getWalletType branch the removed conditional was doing by hand. Dropped the imports that branch was the only user of.
  • Restored the @/… path-alias imports that Feature/issue 204 summon api routes #212 had switched to relative paths in src/utils/common.ts.

Conflict resolutions against preprod

  • freeUtxos.ts — preprod's resolveWalletScriptAddress helper supersedes the local buildWallet call.
  • useAppWallet / useMultisigWallet — kept preprod's memoized form.
  • card-info.tsx — dropped the "Register Wallet — coming soon" placeholder; preprod ships the real register-wallet.tsx.
  • types/wallet.ts — additive, both sides kept.

Test plan

  • npm run typecheck clean
  • npm test — 1087 + 87 passing, including this PR's 3 Summon cases (the unordered-CBOR legacy-compatibility case among them)
  • CI smoke on preprod green on this head

🤖 Generated with Claude Code

kanyuku and others added 4 commits March 28, 2026 12:38
- Update Wallet type to include capabilities\n- Modify buildWallet to compute capabilities for Summon, SDK, and Legacy wallets\n- Update hooks (useAppWallet, useMultisigWallet, useWalletBalances) to leverage capabilities\n- Update UI components (CardWallet, ShowInfo) to use capability-driven rendering\n- Add unit tests for Summon wallet capabilities
Retargets this branch at `preprod` (per CONTRIBUTING.md all PRs land on
preprod first) and resolves the drift.

Review feedback:
- useWalletBalances.ts: `wallet.capabilities!.address` no longer asserts.
  `capabilities` is optional on `Wallet`, so a row that reaches the hook
  without going through `buildWallet()` would have crashed. Guarded, with the
  previous address-resolution path as the fallback and `wallet.address` as the
  last resort; restored `network` to the dependency array.
- common.ts: `canVote: false` for Summon now carries a TODO explaining that
  Summon's rawImportBodies.multisig has no DRep script to derive a credential
  from, pointing at the PR review thread.
- run-snapshots-batch.ts: added the note explaining that buildWallet() now
  subsumes the conditional key-ordering branch this PR deleted; dropped the
  imports that branch was the only user of.
- common.ts: restored the `@/…` path-alias imports this PR had switched to
  relative paths.

Conflict resolutions against preprod:
- freeUtxos.ts: preprod's `resolveWalletScriptAddress` helper supersedes the
  local buildWallet call.
- useAppWallet / useMultisigWallet: kept preprod's memoized form.
- card-info.tsx: dropped this branch's "Register Wallet — coming soon"
  placeholder; preprod ships the real register-wallet.tsx.
- types/wallet.ts: additive, both sides kept.

Verified: `npm run typecheck` clean, `npm test` 1087 + 87 passing, including
this PR's 3 Summon cases (unordered-CBOR compatibility).

Co-authored-by: peter maina <kanyuku@users.noreply.github.com>
@vercel

vercel Bot commented Aug 21, 2026

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
multisig Ready Ready Preview Aug 21, 2026 3:08pm

Request Review

@QSchlegel
QSchlegel merged commit 7209692 into preprod Aug 21, 2026
7 checks passed
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.

2 participants