import { Device } from 'react-native-ble-plx'; import type { SolanaIntent } from '../intent'; import type { OfflineTransaction } from '../types/nonceAccount'; /** * BLE MTU Configuration for different device types */ export interface BLEMTUConfig { maxPayloadSize: number; chunkSize: number; maxRetries: number; timeout: number; } /** * Represents a fragmented message with header information */ export interface BLEFragment { messageId: string; sequenceNumber: number; totalFragments: number; checksumValue: number; payload: Uint8Array; } /** * Represents a Noise-encrypted BLE message */ export interface EncryptedBLEMessage { version: number; ciphertext: Uint8Array; nonce: Uint8Array; tag: Uint8Array; } /** * BLETransactionHandler * Manages secure, fragmented BLE transmission of offline transactions * with Noise Protocol encryption */ export declare class BLETransactionHandler { private mtuConfig; private fragmentCache; private messageIdMap; constructor(platform?: 'android' | 'ios'); /** * Fragment a large transaction/intent into BLE-safe chunks * Respects MTU limitations and adds framing information */ fragmentTransaction(transaction: OfflineTransaction | SolanaIntent, isIntent?: boolean): BLEFragment[]; /** * Prepare encrypted BLE message for transmission * Uses Noise Protocol for end-to-end encryption */ prepareEncryptedMessage(fragment: BLEFragment, noiseEncryptFn: (data: Uint8Array) => Promise): Promise; /** * Send fragmented transaction over BLE with encryption * Handles retries and verification */ sendFragmentedTransactionBLE(device: Device, transaction: OfflineTransaction | SolanaIntent, sendFn: (deviceId: string, characteristicUUID: string, data: Buffer) => Promise, noiseEncryptFn?: (data: Uint8Array) => Promise, isIntent?: boolean): Promise<{ success: boolean; sentFragments: number; failedFragments: number[]; messageId: string; }>; /** * Receive and reassemble fragmented messages */ receiveFragmentedMessage(fragment: BLEFragment, _noiseDecryptFn?: (encrypted: EncryptedBLEMessage) => Promise): Promise<{ complete: boolean; transaction?: OfflineTransaction | SolanaIntent; progress: { received: number; total: number; }; }>; /** * Reassemble fragments into original message */ private reassembleMessage; /** * Serialize BLE fragment for transmission */ private serializeFragment; /** * Calculate CRC32 checksum for fragment verification */ private calculateCRC32; /** * Delay utility for retries */ private delay; /** * Get MTU configuration */ getMTUConfig(): BLEMTUConfig; /** * Set custom MTU configuration */ setMTUConfig(config: Partial): void; } //# sourceMappingURL=BLETransactionHandler.d.ts.map