Skip to content

feat: AnonVoteClient SDK — subpath export @anonvote/crypto/client (#42) - #44

Merged
Just-Bamford merged 1 commit into
AnonVote:mainfrom
El-Chapo-Npm:feat/anon-vote-client-sdk
Jul 28, 2026
Merged

feat: AnonVoteClient SDK — subpath export @anonvote/crypto/client (#42)#44
Just-Bamford merged 1 commit into
AnonVote:mainfrom
El-Chapo-Npm:feat/anon-vote-client-sdk

Conversation

@El-Chapo-Npm

Copy link
Copy Markdown
Contributor

Title: feat: AnonVoteClient SDK — subpath export @anonvote/crypto/client

Description:

Closes #42

Implements the AnonVoteClient SDK as a subpath export @anonvote/crypto/client (Option B from the issue).

What's in this PR:

  • DECISIONS.md — ADR-001 documenting the subpath export architecture decision
  • src/client/types.ts — domain-level SDK types (ClientConfig, Election, ElectionOption, Ballot, VoteReceipt, VerificationResult)
  • src/client/index.tsAnonVoteClient class with createElection, castVote, verifyVote, serialize, deserialize
  • tests/sdk-client.test.ts — 22 test cases covering all acceptance criteria
  • test-consumer/ — minimal consuming TypeScript project validating the subpath export resolves correctly
  • package.json./client subpath added to exports
  • tsconfig.jsonsrc/client/ added to include
  • README.md — AnonVoteClient SDK section and updated repo structure

Key guarantees enforced:

  • Constructor throws INVALID_KEY immediately on bad ballotKey — fails loudly at construction, not at first crypto op
  • castVote never logs optionId
  • serialize omits optionId — only encryptedPayload reaches the server
  • verifyVote propagates decryption errors — does not swallow them as confirmed: false

@Just-Bamford
Just-Bamford merged commit 630f2e4 into AnonVote:main Jul 28, 2026
0 of 3 checks passed
@grantfox-oss grantfox-oss Bot mentioned this pull request Jul 28, 2026
10 tasks
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.

AnonVoteClient SDK

2 participants