candle.bot
Advanced tools
Comparing version 0.3.8 to 0.4.0
@@ -44,10 +44,19 @@ import { TimeFrame, Market, BithumbCC, BitfinexCC } from 'cryptocurrency-crawler.client'; | ||
} | ||
export declare class CandleMasterBot extends BaseBot { | ||
readonly host: BotHost; | ||
constructor(host: BotHost); | ||
open(): Promise<void>; | ||
ids(name?: string): Promise<string[]>; | ||
beBot(name: string): Promise<boolean>; | ||
getBot(name: string): Promise<CandleBot>; | ||
newBot(name: string, config?: CandleBotConfig): Promise<CandleBot>; | ||
export declare class CandleMasterBot { | ||
private static _host; | ||
private static _socket; | ||
private static _ack; | ||
static init(host: BotHost): Promise<void>; | ||
static readonly host: BotHost; | ||
static readonly socket: SocketIOClient.Socket; | ||
static readonly id: string; | ||
static readonly connected: boolean; | ||
static readonly disconnected: boolean; | ||
static close(): void; | ||
static on(event: string, fn: Function): SocketIOClient.Emitter; | ||
static once(event: string, fn: Function): SocketIOClient.Emitter; | ||
static ids(name?: string): Promise<string[]>; | ||
static beBot(name: string): Promise<boolean>; | ||
static getBot(name: string): Promise<CandleBot>; | ||
static newBot(name: string, config?: CandleBotConfig): Promise<CandleBot>; | ||
} | ||
@@ -54,0 +63,0 @@ export declare class CandleBot extends BaseBot { |
@@ -84,11 +84,37 @@ "use strict"; | ||
} | ||
class CandleMasterBot extends BaseBot { | ||
constructor(host) { | ||
super('master', newSocket(host)); | ||
this.host = host; | ||
class CandleMasterBot { | ||
static init(host) { | ||
return __awaiter(this, void 0, void 0, function* () { | ||
const socket = newSocket(host); | ||
yield openSocket(socket, 'master'); | ||
this._host = host; | ||
this._socket = socket; | ||
this._ack = fourdollar_promisify_1.default(socket.emit, socket); | ||
}); | ||
} | ||
open() { | ||
return openSocket(this.socket, 'master'); | ||
static get host() { | ||
return this._host; | ||
} | ||
ids(name) { | ||
static get socket() { | ||
return this._socket; | ||
} | ||
static get id() { | ||
return this.socket.id; | ||
} | ||
static get connected() { | ||
return this.socket.connected; | ||
} | ||
static get disconnected() { | ||
return this.socket.disconnected; | ||
} | ||
static close() { | ||
this.socket.close(); | ||
} | ||
static on(event, fn) { | ||
return this.socket.on(event, fn); | ||
} | ||
static once(event, fn) { | ||
return this.socket.on(event, fn); | ||
} | ||
static ids(name) { | ||
return __awaiter(this, void 0, void 0, function* () { | ||
@@ -98,3 +124,3 @@ return this._ack(':ids', name); | ||
} | ||
beBot(name) { | ||
static beBot(name) { | ||
return __awaiter(this, void 0, void 0, function* () { | ||
@@ -104,3 +130,3 @@ return this._ack(':be.bot', name); | ||
} | ||
getBot(name) { | ||
static getBot(name) { | ||
return __awaiter(this, void 0, void 0, function* () { | ||
@@ -110,3 +136,3 @@ return this.newBot(name); | ||
} | ||
newBot(name, config) { | ||
static newBot(name, config) { | ||
return __awaiter(this, void 0, void 0, function* () { | ||
@@ -113,0 +139,0 @@ if (name === 'master') { |
{ | ||
"name": "candle.bot", | ||
"version": "0.3.8", | ||
"version": "0.4.0", | ||
"description": "Cryptocurrency Candle Bot", | ||
@@ -5,0 +5,0 @@ "main": "index.js", |
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
Major refactor
Supply chain riskPackage has recently undergone a major refactor. It may be unstable or indicate significant internal changes. Use caution when updating to versions that include significant changes.
Found 1 instance in 1 package
15760
271
0