import { ServiceBase } from "./Service"; import { Coin, ErrorResponse, SuccessResponse } from "./Types"; export declare type ServiceConf = { servicePort: number; apiHost: string; apiPort: number; nodeAddress: string; }; /** * Get the service's port either by environment var or command line arg. * (--SERVICE_PORT=value or SERVICE_PORT=value environment) * * Command line arg takes precedence over environment var. * If neither is supplied defaults to 10000 */ export declare function getServicePort(): number; /** * Get the node's address either by environment var or command line arg. * (--NODE_ADDR=value or NODE_ADDR=value environment) * * Command line arg takes precedence over environment var. * A default may be passed that is returned in case neither option is provided. * Returns undefined if none of the options are set. */ export declare function getNodeAddress(defaultAddress?: string): string; /** * Get the API's port either by environment var or command line arg. * (--API_PORT=value or API_PORT=value environment) * * Command line arg takes precedence over environment var. * If neither is supplied defaults to 9999 */ export declare function getApiPort(): number; /** * Get the api's host address either by environment var or command line arg. * (--API_HOST=value or API_HOST=value environment) * * Command line arg takes precedence over environment var. * A default may be passed that is returned in case neither option is provided. * Returns undefined if none of the options are set. */ export declare function getApiHost(defaultAddress?: string): any; /** * An abstract generic websocket wrapper around ServiceBase * Extend and implement to generate a new service */ export declare abstract class ServiceServer extends ServiceBase { private io; private wsServer; private apiSock; constructor(currency: C, conf: ServiceConf); protected publish(currency: C, port: number): Promise; protected getUid(): string; }