UNPKG

bigblocks

Version:

Complete Bitcoin UI component library - authentication, social, wallet, market, inscriptions, and blockchain interactions for React

100 lines 2.43 kB
import type { ExtendedBAP } from "./identity.js"; export type EncryptionMode = "symmetric" | "asymmetric"; export type EncryptionContentType = "message" | "file" | "json"; export interface EncryptedData { encrypted: string; type: EncryptionContentType; mode: EncryptionMode; recipientPublicKey?: string; timestamp: Date; metadata?: Record<string, unknown>; } export interface DecryptedData { content: string | ArrayBuffer; type: EncryptionContentType; decryptedAt: Date; senderAddress?: string; metadata?: Record<string, unknown>; } export interface EncryptionKeyInfo { publicKey: string; address: string; identityKey: string; } export interface BapEncryptionSuiteProps { /** * The BAP instance for encryption/decryption */ bapInstance: ExtendedBAP; /** * Optional recipient BAP instance for asymmetric encryption */ recipientBapId?: ExtendedBAP; /** * Callback when content is encrypted */ onEncrypted?: (result: EncryptedData) => void; /** * Callback when content is decrypted */ onDecrypted?: (result: DecryptedData) => void; /** * Allowed content types */ allowedTypes?: EncryptionContentType[]; /** * Use Type 42 key derivation */ useType42?: boolean; /** * Theme variant */ variant?: "surface" | "ghost" | "classic"; /** * Component size */ size?: "1" | "2" | "3"; /** * Error handler */ onError?: (error: Error) => void; /** * Initial content */ initialContent?: string; /** * Initial mode */ initialMode?: "encrypt" | "decrypt"; /** * CSS class name */ className?: string; } export interface EncryptionResult { success: boolean; data?: EncryptedData; error?: Error; } export interface DecryptionResult { success: boolean; data?: DecryptedData; error?: Error; } export interface EncryptionOptions { type?: EncryptionContentType; mode?: EncryptionMode; recipientPublicKey?: string; metadata?: Record<string, unknown>; useType42?: boolean; } export interface DecryptionOptions { type?: EncryptionContentType; mode?: EncryptionMode; senderPublicKey?: string; useType42?: boolean; } export interface UseBapEncryptionOptions { useType42?: boolean; } //# sourceMappingURL=encryption.d.ts.map