import { Session } from './Session'; import { EncryptFunction, DecryptFunction, KeyPair } from './types'; /** * Device payload for QR code / text code sharing. */ export interface DevicePayload { /** Ephemeral public key (64 hex chars) */ ephemeralPubkey: string; /** Shared secret (64 hex chars) */ sharedSecret: string; /** Device ID (16 hex chars) */ deviceId: string; /** Human-readable device label */ deviceLabel: string; /** Identity public key for this device (64 hex chars) */ identityPubkey: string; } /** * Generates a new ephemeral keypair for invites. * @returns A keypair with publicKey (hex string) and privateKey (Uint8Array) */ export declare function generateEphemeralKeypair(): KeyPair; /** * Generates a new shared secret for invite handshakes. * @returns A 64-character hex string (32 bytes) */ export declare function generateSharedSecret(): string; /** * Generates a unique device ID. * @returns A random device ID string */ export declare function generateDeviceId(): string; export interface EncryptInviteResponseParams { /** The invitee's session public key */ inviteeSessionPublicKey: string; /** The invitee's identity public key (also serves as device ID) */ inviteePublicKey: string; /** The invitee's identity private key (optional if encrypt function provided) */ inviteePrivateKey?: Uint8Array; /** The inviter's identity public key */ inviterPublicKey: string; /** The inviter's ephemeral public key */ inviterEphemeralPublicKey: string; /** The shared secret for the invite */ sharedSecret: string; /** The invitee's owner/Nostr identity public key (optional for single-device users) */ ownerPublicKey?: string; /** Optional custom encrypt function */ encrypt?: EncryptFunction; } export interface EncryptedInviteResponse { /** The inner event containing the encrypted payload */ innerEvent: { pubkey: string; content: string; created_at: number; }; /** The outer envelope event */ envelope: { kind: number; pubkey: string; content: string; created_at: number; tags: string[][]; }; /** The random sender's public key used for the envelope */ randomSenderPublicKey: string; /** The random sender's private key used for the envelope */ randomSenderPrivateKey: Uint8Array; } /** * Encrypts an invite response with two-layer encryption. * * Layer 1 (inner): Payload encrypted with DH key, then encrypted with shared secret. * Layer 2 (outer): Envelope encrypted with random key -> inviter ephemeral key. */ export declare function encryptInviteResponse(params: EncryptInviteResponseParams): Promise; export interface DecryptInviteResponseParams { /** The encrypted envelope content */ envelopeContent: string; /** The envelope sender's public key */ envelopeSenderPubkey: string; /** The inviter's ephemeral private key */ inviterEphemeralPrivateKey: Uint8Array; /** The inviter's identity private key (optional if decrypt function provided) */ inviterPrivateKey?: Uint8Array; /** The shared secret for the invite */ sharedSecret: string; /** Optional custom decrypt function */ decrypt?: DecryptFunction; } export interface DecryptedInviteResponse { /** The invitee's identity public key (also serves as device ID) */ inviteeIdentity: string; /** The invitee's session public key */ inviteeSessionPublicKey: string; /** The invitee's owner/Nostr identity public key (optional for backward compat) */ ownerPublicKey?: string; } /** * Decrypts an invite response. */ export declare function decryptInviteResponse(params: DecryptInviteResponseParams): Promise; export interface CreateSessionFromAcceptParams { /** The other party's public key */ theirPublicKey: string; /** Our session private key */ ourSessionPrivateKey: Uint8Array; /** The shared secret (hex string) */ sharedSecret: string; /** Whether we are the sender (initiator) */ isSender: boolean; /** Optional session name */ name?: string; } /** * Creates a Session from invite acceptance parameters. */ export declare function createSessionFromAccept(params: CreateSessionFromAcceptParams): Session; //# sourceMappingURL=inviteUtils.d.ts.map