@@ -18,7 +18,10 @@ export class grpcMultiUserAccountSubscriber {
1818 private multiSubscriber : grpcMultiAccountSubscriber < UserAccount > ;
1919
2020 private userData = new Map < string , DataAndSlot < UserAccount > > ( ) ;
21- private listeners = new Map < string , Set < StrictEventEmitter < EventEmitter , UserAccountEvents > > > ( ) ;
21+ private listeners = new Map <
22+ string ,
23+ Set < StrictEventEmitter < EventEmitter , UserAccountEvents > >
24+ > ( ) ;
2225 private keyToPk = new Map < string , PublicKey > ( ) ;
2326 private pendingAddKeys = new Set < string > ( ) ;
2427 private debounceTimer ?: ReturnType < typeof setTimeout > ;
@@ -60,13 +63,14 @@ export class grpcMultiUserAccountSubscriber {
6063
6164 public async subscribe ( ) : Promise < void > {
6265 if ( ! this . multiSubscriber ) {
63- this . multiSubscriber = await grpcMultiAccountSubscriber . create < UserAccount > (
64- this . grpcConfigs ,
65- 'user' ,
66- this . program ,
67- undefined ,
68- this . resubOpts
69- ) ;
66+ this . multiSubscriber =
67+ await grpcMultiAccountSubscriber . create < UserAccount > (
68+ this . grpcConfigs ,
69+ 'user' ,
70+ this . program ,
71+ undefined ,
72+ this . resubOpts
73+ ) ;
7074 }
7175
7276 // Subscribe all per-user subscribers first
@@ -106,6 +110,7 @@ export class grpcMultiUserAccountSubscriber {
106110 const key = userAccountPublicKey . toBase58 ( ) ;
107111 const perUserEmitter : StrictEventEmitter < EventEmitter , UserAccountEvents > =
108112 new EventEmitter ( ) ;
113+ // eslint-disable-next-line @typescript-eslint/no-this-alias
109114 const parent = this ;
110115 let isSubscribed = false ;
111116
@@ -221,12 +226,18 @@ export class grpcMultiUserAccountSubscriber {
221226 await this . multiSubscriber . subscribe ( allPks , this . handleAccountChange ) ;
222227 this . isMultiSubscribed = true ;
223228 await this . multiSubscriber . fetch ( ) ;
224- for ( const k of this . pendingAddKeys ) {
229+ for ( const k of this . pendingAddKeys ) {
225230 const pk = this . keyToPk . get ( k ) ;
226231 if ( pk ) {
227232 const data = this . multiSubscriber . getAccountData ( k ) ;
228233 if ( data ) {
229- this . handleAccountChange ( pk , data . data , { slot : data . slot } , undefined , undefined ) ;
234+ this . handleAccountChange (
235+ pk ,
236+ data . data ,
237+ { slot : data . slot } ,
238+ undefined ,
239+ undefined
240+ ) ;
230241 }
231242 }
232243 }
@@ -245,7 +256,13 @@ export class grpcMultiUserAccountSubscriber {
245256 for ( const k of this . pendingAddKeys ) {
246257 ms . onChangeMap . set ( k , ( data , ctx , buffer , accountProps ) => {
247258 this . multiSubscriber . setAccountData ( k , data , ctx . slot ) ;
248- this . handleAccountChange ( new PublicKey ( k ) , data , ctx , buffer , accountProps ) ;
259+ this . handleAccountChange (
260+ new PublicKey ( k ) ,
261+ data ,
262+ ctx ,
263+ buffer ,
264+ accountProps
265+ ) ;
249266 } ) ;
250267 }
251268 await this . multiSubscriber . addAccounts ( allPks ) ;
@@ -255,5 +272,3 @@ export class grpcMultiUserAccountSubscriber {
255272 this . debounceTimer = undefined ;
256273 }
257274}
258-
259-
0 commit comments