NewsletterState: {
    content: string | null;
    content_ciphertext: HexCipher;
    content_nonce: string;
    decrypted: {
        [key: string]: NewsletterRecord;
    };
    draft_content: string;
    draft_mode: boolean;
    draft_record: NewsletterRecord;
    draft_template: string;
    draft_title: string;
    encrypted: {
        [key: string]: NewsletterRecord;
    };
    error: string | undefined;
    group_symmetric_key: string;
    individual_private_key: string;
    individual_public_key: string;
    issues: DeliveryDraft[];
    list: {
        [key: string]: NewsletterRecord;
    };
    newsletter: NewsletterRecord;
    privacy_mode: boolean;
    public_key: string | null;
    raw_records: {
        [key: string]: NewsletterRecord;
    };
    selected_recipients: DeliveryDraft[];
    status: "uninitialized" | "loading" | "idle";
    template: string | null;
    template_ciphertext: HexCipher;
    template_mode: boolean;
    template_nonce: string;
    title: string | null;
    title_ciphertext: HexCipher;
    title_nonce: string;
}

Represents the state structure stored in the newsletter program. This structure encompasses various attributes of the newsletter, including its title, template, and content. These attributes are maintained on-chain but processed client-side. They are encrypted using a group symmetric key, which is accessible to all holders of the NewsletterRecord. Additionally, the newsletter state includes the public key, individual private key, and individual public key. These are employed to encrypt the title, template, and content specifically for each recipient. Selected recipients indicate the users chosen to receive the newsletter. The newsletter state records its sent issues, i.e., newsletters delivered to subscribers. Other attributes encompass the newsletter's status, errors, draft mode, template mode, and privacy mode. Details like draft title, draft template, and draft content are also included. Nonces for title, template, and content, along with their corresponding ciphertexts, are part of the state. Raw, encrypted, and decrypted records, as well as a display list for the UI, are maintained.

Type declaration

Generated using TypeDoc