/// import { BehaviorSubject, Subject } from 'rxjs/Rx'; import RadixNode from './RadixNode'; import { RadixAtom, RadixEUID, RadixAtomUpdate } from '../atom_model'; import events from 'events'; export declare interface RadixNodeConnection { on(event: 'closed' | 'open', listener: () => void): this; } export declare class RadixNodeConnection extends events.EventEmitter { readonly node: RadixNode; readonly port: number; private _socket; private _subscriptions; private _atomUpdateSubjects; private lastSubscriberId; address: string; constructor(node: RadixNode, port: number); private getSubscriberId; /** * Check whether the node connection is ready for requests * @returns true if ready */ isReady(): boolean; /** * Opens connection * @returns a promise that resolves once the connection is ready, or rejects on error or timeout */ openConnection(): Promise<{}>; /** * Subscribe for all existing and future atoms for a given address * @param address base58 formatted address * @returns a stream of atoms */ subscribe(address: string): Subject; /** * Submit an atom to the ledger * @param atom * @returns A stream of the status of the atom submission */ submitAtom(atom: RadixAtom): BehaviorSubject; /** * NOT IMPLEMENTED * Query the ledger for an atom by its id * @param id * @returns The atom */ getAtomById(id: RadixEUID): Promise; close: () => void; private _onClosed; private _onAtomSubmissionStateUpdate; private _onAtomReceivedNotification; } export default RadixNodeConnection;