File tree Expand file tree Collapse file tree 1 file changed +5
-6
lines changed
Expand file tree Collapse file tree 1 file changed +5
-6
lines changed Original file line number Diff line number Diff line change @@ -5,7 +5,6 @@ import * as Buffer from 'buffer';
55import { WebSocketProgramAccountSubscriber } from './webSocketProgramAccountSubscriber' ;
66import {
77 Client ,
8- ClientDuplexStream ,
98 CommitmentLevel ,
109 createClient ,
1110 SubscribeRequest ,
@@ -16,7 +15,7 @@ export class grpcProgramAccountSubscriber<
1615 T ,
1716> extends WebSocketProgramAccountSubscriber < T > {
1817 private client : Client ;
19- private stream : ClientDuplexStream < SubscribeRequest , SubscribeUpdate > ;
18+ private stream : Awaited < ReturnType < Client [ 'subscribe' ] > > ;
2019 private commitmentLevel : CommitmentLevel ;
2120 public listenerId ?: number ;
2221
@@ -91,19 +90,18 @@ export class grpcProgramAccountSubscriber<
9190 this . onChange = onChange ;
9291
9392 // Subscribe with grpc
94- this . stream =
95- ( await this . client . subscribe ( ) ) as unknown as typeof this . stream ;
93+ this . stream = await this . client . subscribe ( ) ;
9694
9795 const filters = this . options . filters . map ( ( filter ) => {
9896 return {
9997 memcmp : {
100- offset : filter . memcmp . offset . toString ( ) ,
98+ offset : filter . memcmp . offset ,
10199 base58 : filter . memcmp . bytes ,
102100 } ,
103101 } ;
104102 } ) ;
105103
106- const request : SubscribeRequest = {
104+ const request = {
107105 slots : { } ,
108106 accounts : {
109107 drift : {
@@ -120,6 +118,7 @@ export class grpcProgramAccountSubscriber<
120118 entry : { } ,
121119 transactionsStatus : { } ,
122120 } ;
121+
123122 this . stream . on ( 'data' , ( chunk : SubscribeUpdate ) => {
124123 if ( ! chunk . account ) {
125124 return ;
You can’t perform that action at this time.
0 commit comments