import { Blockchain } from '../../blockchain'; import { Identity, PrivateIdentity } from '../identity'; import { IdentifyMessage } from '../messages/identify'; import { IsomorphicWebSocketConstructor } from '../types'; /** * Wraps configuration needed for establishing connections with other peers * and maintains references to all known peers. */ export declare class LocalPeer { readonly chain: Blockchain; readonly privateIdentity: PrivateIdentity; readonly publicIdentity: Identity; readonly agent: string; readonly version: number; readonly webSocket: IsomorphicWebSocketConstructor; readonly networkId: number; readonly enableSyncing: boolean; port: number | null; name: string | null; constructor(identity: PrivateIdentity, agent: string, version: number, chain: Blockchain, webSocket: IsomorphicWebSocketConstructor, networkId: number, enableSyncing: boolean); /** * Construct an Identify message with our identity and version. */ getIdentifyMessage(): IdentifyMessage; /** * Encrypt a string for recipient with the stored private identity. * @param plainTextMessage The string to encrypt. * @param recipient The public key of the recipient of the message. */ boxMessage(plainTextMessage: string, recipient: Identity): { nonce: string; boxedMessage: string; }; /** * Decrypt a message using a nonce from a sender. * @param boxedMessage An encrypted message string. * @param nonce A nonce, generated by boxMessage. * @param sender The public key of the message sender. */ unboxMessage(boxedMessage: string, nonce: string, sender: Identity): { message: string | null; }; } //# sourceMappingURL=localPeer.d.ts.map