Description
Deliver all three signing adapters behind one interchangeable interface, with tests.
Problem Statement
Signing is scattered: the dashboard talks to Freighter and Rabet directly via src/lib/wallets/, and the relayer signs with an env secret through its own path. vero-guardian-dashboard#171 records the cost of that — the Freighter adapter does not normalise thrown errors the way Rabet does, so callers see different shapes depending on which wallet the user installed. The three adapters must share one interface, which is why they belong in a single change rather than three racing PRs.
Proposed Changes
Technical Implementation Scaffolding
- Target Repository: vero-sdk
- Target Path: src/signers/
- Branch Naming: feat/issue--wallet-signers
- Authority Context: Security-sensitive — wallet signing and secret handling
Acceptance Criteria
Definition of Done
This issue is self-contained. Everything it needs already exists on main; it does not wait on any other issue. Deliver the module and its tests in one PR.
Description
Deliver all three signing adapters behind one interchangeable interface, with tests.
Problem Statement
Signing is scattered: the dashboard talks to Freighter and Rabet directly via
src/lib/wallets/, and the relayer signs with an env secret through its own path. vero-guardian-dashboard#171 records the cost of that — the Freighter adapter does not normalise thrown errors the way Rabet does, so callers see different shapes depending on which wallet the user installed. The three adapters must share one interface, which is why they belong in a single change rather than three racing PRs.Proposed Changes
Signerinsrc/signers/types.ts— one interface all three implementsrc/signers/freighter.tsandsrc/signers/rabet.ts— detect absence without throwing (returnWalletUnavailable), route every throw throughnormalizeErrorso cancellation surfaces asUserRejected, and refuse to sign on a network mismatchsrc/signers/keypair.tsfor server-side use — never log, serialise, or include the secret in errors; add redactingtoString/toJSONsrc/__tests__/signers.test.tswith mocked wallet globals, asserting identicalVeroErrorCodes across adapters for equivalent failures, and asserting secret redaction explicitlyTechnical Implementation Scaffolding
Acceptance Criteria
Signernpm test,npm run typecheck,npm run lint, andnpm run buildall passDefinition of Done
This issue is self-contained. Everything it needs already exists on
main; it does not wait on any other issue. Deliver the module and its tests in one PR.