import { PrivateKey, PublicKey } from "./crypto.js"; /** * Encodes a Hive memo, encrypting messages that begin with `#`. * * @param private_key - Sender memo private key, either as a {@link PrivateKey} * instance or WIF string. * @param public_key - Recipient memo public key, either as a {@link PublicKey} * instance or Hive public-key string. * @param memo - Plain memo text. Only values beginning with `#` are encrypted; * unprefixed memos are returned unchanged. * @param testNonce - Optional deterministic nonce used by tests. * @returns The original plaintext memo or a `#`-prefixed encrypted memo payload. * * @remarks * Pollen serializes the memo with its binary writer before AES-CBC encryption so * Unicode text and Hive's encrypted memo structure round-trip consistently. * * @throws Error * Thrown when the runtime cannot support memo encryption or key conversion * fails. * * @example * ```ts * const encrypted = Memo.encode(senderMemoKey, recipientMemoPublicKey, '#hello nectar') * ``` */ declare const encode: (private_key: PrivateKey | string, public_key: PublicKey | string, memo: string, testNonce?: string) => string; /** * Decodes a Hive memo, decrypting messages that begin with `#`. * * @param private_key - Recipient or sender memo private key, either as a * {@link PrivateKey} instance or WIF string. * @param memo - Memo text or encrypted memo payload. * @returns The original memo text. Encrypted memos remain `#`-prefixed after * decryption to preserve Hive memo semantics. * * @remarks * The decryptor determines the counterparty public key from the encrypted memo * envelope, derives the AES key through the memo shared secret, and supports * legacy payloads that were not length-prefixed. * * @throws Error * Thrown when the runtime cannot support memo encryption, the key is invalid, * or AES checksum validation fails. * * @example * ```ts * const plaintext = Memo.decode(recipientMemoKey, encryptedMemo) * console.log(plaintext) * ``` */ declare const decode: (private_key: PrivateKey | string, memo: string) => string; /** * Hive encrypted memo helper. * * @remarks * `Memo` exposes the two operations most applications need: encode before * broadcasting a transfer memo and decode after reading a transfer memo from * account history. The helper follows Hive's convention that only memos * beginning with `#` are encrypted. * * @example * ```ts * import { Memo } from '@srbde/pollen' * * const encrypted = Memo.encode(senderMemoKey, recipientMemoPublicKey, '#for your eyes') * const plaintext = Memo.decode(recipientMemoKey, encrypted) * ``` */ export declare const Memo: { decode: typeof decode; encode: typeof encode; }; export {};