feat: Summon wallets via capability-based metadata (supersedes #212) - #371
Merged
Conversation
- 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>
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
This was referenced Aug 21, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Carries @kanyuku's work from #212 onto
preprodwith 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/ resolvedaddress/stakeAddress/dRepId) onWallet, populated bybuildWallet()for all three wallet types (legacy, sdk, summon). Call sites that used to re-derive the script address by hand now read it offcapabilities. Adds Summon wallet support end to end, including the API routes (freeUtxos,transactions,run-snapshots-batch).Review feedback from #212, addressed
preprod— Feature/issue 204 summon api routes #212 targetedmain.wallet.capabilities!.addressinuseWalletBalances.tsno longer asserts.capabilitiesis optional onWallet, so a row reaching the hook without going throughbuildWallet()(cached records, tests, future call sites) would have thrown. Now guarded, with the previous address-resolution path as the fallback andwallet.addressas the last resort.networkrestored to the dependency array.canVote: falsecarries a TODO. Summon'srawImportBodies.multisigships onlypayment_scriptandstake_script, so there is no DRep credential to derive — the same reasondRepIdis empty there. The TODO says so and points back at the Feature/issue 204 summon api routes #212 review thread.run-snapshots-batch.tsexplains the deletion. A comment records thatbuildWallet()now performs thegetWalletTypebranch the removed conditional was doing by hand. Dropped the imports that branch was the only user of.@/…path-alias imports that Feature/issue 204 summon api routes #212 had switched to relative paths insrc/utils/common.ts.Conflict resolutions against preprod
freeUtxos.ts— preprod'sresolveWalletScriptAddresshelper supersedes the localbuildWalletcall.useAppWallet/useMultisigWallet— kept preprod's memoized form.card-info.tsx— dropped the "Register Wallet — coming soon" placeholder; preprod ships the realregister-wallet.tsx.types/wallet.ts— additive, both sides kept.Test plan
npm run typecheckcleannpm test— 1087 + 87 passing, including this PR's 3 Summon cases (the unordered-CBOR legacy-compatibility case among them)🤖 Generated with Claude Code