You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

connection.d.ts 1.7KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950
  1. /// <reference types="node" />
  2. import { EventEmitter } from 'events';
  3. export interface ConnectionOptions {
  4. trace?: boolean | ((id: string, message: string) => void);
  5. proxy?: string;
  6. proxyAuthorization?: string;
  7. authorization?: string;
  8. trustedCertificates?: string[];
  9. key?: string;
  10. passphrase?: string;
  11. certificate?: string;
  12. timeout: number;
  13. connectionTimeout: number;
  14. }
  15. export declare type ConnectionUserOptions = Partial<ConnectionOptions>;
  16. export declare class Connection extends EventEmitter {
  17. private _url;
  18. private _ws;
  19. private _reconnectTimeoutID;
  20. private _heartbeatIntervalID;
  21. private _retryConnectionBackoff;
  22. private _trace;
  23. private _config;
  24. private _ledger;
  25. private _requestManager;
  26. private _connectionManager;
  27. constructor(url?: string, options?: ConnectionUserOptions);
  28. private _onMessage;
  29. private get _state();
  30. private get _shouldBeConnected();
  31. private _clearHeartbeatInterval;
  32. private _startHeartbeatInterval;
  33. private _heartbeat;
  34. private _waitForReady;
  35. private _subscribeToLedger;
  36. private _onConnectionFailed;
  37. isConnected(): boolean;
  38. connect(): Promise<void>;
  39. disconnect(): Promise<number | undefined>;
  40. reconnect(): Promise<void>;
  41. getFeeBase(): Promise<number>;
  42. getFeeRef(): Promise<number>;
  43. getLedgerVersion(): Promise<number>;
  44. getReserveBase(): Promise<number>;
  45. hasLedgerVersions(lowLedgerVersion: number, highLedgerVersion: number | undefined): Promise<boolean>;
  46. hasLedgerVersion(ledgerVersion: number): Promise<boolean>;
  47. request(request: any, timeout?: number): Promise<any>;
  48. getUrl(): string;
  49. }
  50. //# sourceMappingURL=connection.d.ts.map