diff --git a/src/eventstream-proxy/eventstream-proxy.base.ts b/src/eventstream-proxy/eventstream-proxy.base.ts index 5d9696e..45a400c 100644 --- a/src/eventstream-proxy/eventstream-proxy.base.ts +++ b/src/eventstream-proxy/eventstream-proxy.base.ts @@ -77,13 +77,15 @@ export abstract class EventStreamProxyBase extends WebSocketEventsBase { client.on('message', async (message: string) => { const action = JSON.parse(message) as WebSocketActionBase; switch (action.type) { - case 'start': + case 'start': { const startAction = action as WebSocketStart; this.startListening(client, startAction.namespace); break; - case 'ack': + } + case 'ack': { const ackAction = action as WebSocketAck; this.handleAck(client, ackAction); + } } }); } diff --git a/src/tokens/tokens.service.ts b/src/tokens/tokens.service.ts index 711ab6a..8da5091 100644 --- a/src/tokens/tokens.service.ts +++ b/src/tokens/tokens.service.ts @@ -94,14 +94,11 @@ export class TokensService { this.instancePath = instancePath; this.topic = topic; this.contractAddress = contractAddress.toLowerCase(); - this.proxy.addConnectionListener(this); this.proxy.addEventListener(new TokenListener(this.blockchain)); const wsUrl = new URL('/ws', this.baseUrl.replace('http', 'ws')).href; this.proxy.configure(wsUrl, this.topic); } - async onConnect() {} - private async createPoolSubscription( ctx: Context, namespace: string,