Files
427e7578-d7bf-49c8-aee9-2dd…/app/utils/types.ts
1ynx bc5e2eead8 + create user with public/private key
+ sign and verify votes and prevent unverified updates
2026-04-04 22:36:17 +02:00

36 lines
708 B
TypeScript

export interface PollProps {
userid: string | undefined,
activePollId: string,
pollData: PollData,
addOption: (name: string) => void,
vote: (optionName: string) => void
}
export interface PollListProps {
userid: string | undefined,
}
export interface PollData extends Record<string, SignedData<VoteData>[]> {
}
export interface SignedData<T> {
data: T,
signature: string
}
export interface VoteData {
userid: string,
timestamp: string
}
export interface OptionData {
userid: string,
timestamp: string,
optionName: string
}
export interface UserData {
userid: string,
private_key: CryptoKey | undefined,
public_key: CryptoKey | undefined
}