diff --git a/example/client.ts b/example/client.ts index 8b477e9..6ab7cee 100644 --- a/example/client.ts +++ b/example/client.ts @@ -98,8 +98,8 @@ export class WsClient extends EventEmitter { const client = new WsClient('wss://events.drift.trade/ws'); const main = async () => { client.on('connected', () => { - client.subscribe('OrderRecord', 'H5jfagEnMVNH3PMc2TU2F7tNuXE6b4zCwoL5ip1b4ZHi'); - client.subscribe('OrderActionRecord', 'H5jfagEnMVNH3PMc2TU2F7tNuXE6b4zCwoL5ip1b4ZHi'); + client.subscribe('OrderRecord', 'BRksHqLiq2gvQw1XxsZq6DXZjD3GB5a9J63tUBgd6QS9'); + client.subscribe('OrderActionRecord', 'BRksHqLiq2gvQw1XxsZq6DXZjD3GB5a9J63tUBgd6QS9'); }); client.on('message', (data) => { console.log('Received:', data); diff --git a/src/index.ts b/src/index.ts index bc296a7..01615dd 100644 --- a/src/index.ts +++ b/src/index.ts @@ -125,7 +125,7 @@ export class GrpcEventSubscriber { if (serializer) { const serialized = serializer(event.data); serialized.rawLog = rawLog; - this.redisClient.publish(event.name, JSON.stringify(serialized)); + this.redisClient.publish(event.name, serialized); } runningEventIndex++; }