Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion docs/classes/av_client.AVClient.html
Original file line number Diff line number Diff line change
Expand Up @@ -263,7 +263,7 @@ <h2 id="example-walkthrough-test" class="tsd-anchor-link">Example walkthrough te
<code>electionStatus.sessionCountdown.extendSeconds</code>.</p>
</div><div class="tsd-parameters"><h4 class="tsd-parameters-title">Parameters</h4><ul class="tsd-parameter-list"><li><span><span class="tsd-kind-parameter">extendedBy</span>: <span class="tsd-signature-type">number</span></span><div class="tsd-comment tsd-typography"><p>Number of <strong>seconds</strong> to extend the session by.</p>
</div></li></ul></div><h4 class="tsd-returns-title">Returns <span class="tsd-signature-type">Promise</span><span class="tsd-signature-symbol">&lt;</span><span class="tsd-signature-type">void</span><span class="tsd-signature-symbol">&gt;</span></h4><p>Returns undefined on success or throws an error.</p>
<div class="tsd-comment tsd-typography"><div class="tsd-tag-throws"><h4 class="tsd-anchor-link" id="throws-26">Throws<a href="#throws-26" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24" aria-hidden="true"><use href="../assets/icons.svg#icon-anchor"></use></svg></a></h4><p>TypeError if called before voter registration (<code>this.voterSession</code> is undefined — the guard on line 628 dereferences it directly).</p>
<div class="tsd-comment tsd-typography"><div class="tsd-tag-throws"><h4 class="tsd-anchor-link" id="throws-26">Throws<a href="#throws-26" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24" aria-hidden="true"><use href="../assets/icons.svg#icon-anchor"></use></svg></a></h4><p>TypeError if called before voter registration (<code>this.voterSession</code> is undefined — the method dereferences it directly without a null check).</p>
</div><div class="tsd-tag-throws"><h4 class="tsd-anchor-link" id="throws-27">Throws<a href="#throws-27" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24" aria-hidden="true"><use href="../assets/icons.svg#icon-anchor"></use></svg></a></h4><p><a href="av_client.NetworkError.html" class="tsd-kind-class">NetworkError</a> if any request failed to get a response.</p>
</div></div></div></li></ul></section><section class="tsd-panel tsd-member"><h3 class="tsd-anchor-link" id="constructballot"><span>construct<wbr/>Ballot</span><a href="#constructballot" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24" aria-hidden="true"><use href="../assets/icons.svg#icon-anchor"></use></svg></a></h3><ul class="tsd-signatures"><li class=""><div class="tsd-signature tsd-anchor-link" id="constructballot-1"><span class="tsd-kind-call-signature">constructBallot</span><span class="tsd-signature-symbol">(</span><span class="tsd-kind-parameter">ballotSelection</span><span class="tsd-signature-symbol">:</span> <a href="../interfaces/av_client.BallotSelection.html" class="tsd-signature-type tsd-kind-interface">BallotSelection</a><span class="tsd-signature-symbol">)</span><span class="tsd-signature-symbol">:</span> <span class="tsd-signature-type">Promise</span><span class="tsd-signature-symbol">&lt;</span><span class="tsd-signature-type">string</span><span class="tsd-signature-symbol">&gt;</span><a href="#constructballot-1" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24" aria-hidden="true"><use href="../assets/icons.svg#icon-anchor"></use></svg></a></div><div class="tsd-description"><div class="tsd-comment tsd-typography"><p>Encrypts the voter's ballot selections and submits them to the Digital Ballot Box.</p>
<p>Must be called after <a href="#registervoter" class="tsd-kind-method">registerVoter</a> (or
Expand Down
2 changes: 1 addition & 1 deletion docs/classes/av_verifier.AVVerifier.html
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@
</div></li></ul></div><h4 class="tsd-returns-title">Returns <span class="tsd-signature-type">Promise</span><span class="tsd-signature-symbol">&lt;</span><span class="tsd-signature-type">string</span><span class="tsd-signature-symbol">&gt;</span></h4><p>The 7-character Base58 pairing code derived from the verifier item's short address.
Both the voter's app and this verifier should display this code so the voter can confirm
they are paired with the correct device.</p>
<div class="tsd-comment tsd-typography"><div class="tsd-tag-throws"><h4 class="tsd-anchor-link" id="throws-3">Throws<a href="#throws-3" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24" aria-hidden="true"><use href="../assets/icons.svg#icon-anchor"></use></svg></a></h4><p><a href="av_client.NetworkError.html" class="tsd-kind-class">NetworkError</a> if any request failed to get a response.</p>
<div class="tsd-comment tsd-typography"><div class="tsd-tag-throws"><h4 class="tsd-anchor-link" id="throws-3">Throws<a href="#throws-3" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24" aria-hidden="true"><use href="../assets/icons.svg#icon-anchor"></use></svg></a></h4><p>An error if the DBB request fails (raw Axios error — not wrapped in <code>NetworkError</code>).</p>
</div></div></div></li></ul></section><section class="tsd-panel tsd-member"><h3 class="tsd-anchor-link" id="decryptballot"><span>decrypt<wbr/>Ballot</span><a href="#decryptballot" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24" aria-hidden="true"><use href="../assets/icons.svg#icon-anchor"></use></svg></a></h3><ul class="tsd-signatures"><li class=""><div class="tsd-signature tsd-anchor-link" id="decryptballot-1"><span class="tsd-kind-call-signature">decryptBallot</span><span class="tsd-signature-symbol">()</span><span class="tsd-signature-symbol">:</span> <span class="tsd-signature-type">ContestSelection</span><span class="tsd-signature-symbol">[]</span><a href="#decryptballot-1" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24" aria-hidden="true"><use href="../assets/icons.svg#icon-anchor"></use></svg></a></div><div class="tsd-description"><div class="tsd-comment tsd-typography"><p>Decrypts the ballot and returns the original contest selections.</p>
<p>Synchronous. Uses the verifier's private key (generated in
<a href="#submitverifierkey" class="tsd-kind-method">submitVerifierKey</a>) to decrypt both the voter and board
Expand Down
2 changes: 1 addition & 1 deletion lib/av_client.ts
Original file line number Diff line number Diff line change
Expand Up @@ -622,7 +622,7 @@ export class AVClient implements IAVClient {
*
* @param extendedBy Number of **seconds** to extend the session by.
* @returns Returns undefined on success or throws an error.
* @throws TypeError if called before voter registration (`this.voterSession` is undefined — the guard on line 628 dereferences it directly).
* @throws TypeError if called before voter registration (`this.voterSession` is undefined — the method dereferences it directly without a null check).
* @throws {@link NetworkError | NetworkError} if any request failed to get a response.
*/
public async extendVoterSessions(extendedBy: number): Promise<void> {
Expand Down
2 changes: 1 addition & 1 deletion lib/av_verifier.ts
Original file line number Diff line number Diff line change
Expand Up @@ -125,7 +125,7 @@ export class AVVerifier {
* @returns The 7-character Base58 pairing code derived from the verifier item's short address.
* Both the voter's app and this verifier should display this code so the voter can confirm
* they are paired with the correct device.
* @throws {@link NetworkError | NetworkError} if any request failed to get a response.
* @throws An error if the DBB request fails (raw Axios error — not wrapped in `NetworkError`).
*/
public async submitVerifierKey(spoilRequestAddress: string): Promise<string> {
const keyPair = randomKeyPair(this.crypto)
Expand Down