@@ -215,6 +215,9 @@ export class grpcDriftClientAccountSubscriberV2
215215 }
216216
217217 async addOracle ( oracleInfo : OracleInfo ) : Promise < boolean > {
218+ if ( this . resubOpts ?. logResubMessages ) {
219+ console . log ( '[grpcDriftClientAccountSubscriberV2] addOracle' ) ;
220+ }
218221 if ( oracleInfo . publicKey . equals ( PublicKey . default ) ) {
219222 return true ;
220223 }
@@ -228,10 +231,7 @@ export class grpcDriftClientAccountSubscriberV2
228231 this . oracleInfos = this . oracleInfos . concat ( oracleInfo ) ;
229232 }
230233
231- if ( this . oracleMultiSubscriber ) {
232- await this . unsubscribeFromOracles ( ) ;
233- await this . subscribeToOracles ( ) ;
234- }
234+ this . oracleMultiSubscriber ?. addAccounts ( [ oracleInfo . publicKey ] ) ;
235235
236236 return true ;
237237 }
@@ -461,6 +461,11 @@ export class grpcDriftClientAccountSubscriberV2
461461 }
462462
463463 async subscribeToPerpMarketAccounts ( ) : Promise < boolean > {
464+ if ( this . resubOpts ?. logResubMessages ) {
465+ console . log (
466+ '[grpcDriftClientAccountSubscriberV2] subscribeToPerpMarketAccounts'
467+ ) ;
468+ }
464469 const perpMarketIndexToAccountPubkeys : Array < [ number , PublicKey ] > =
465470 await Promise . all (
466471 this . perpMarketIndexes . map ( async ( marketIndex ) => [
@@ -523,6 +528,11 @@ export class grpcDriftClientAccountSubscriberV2
523528 }
524529
525530 async subscribeToSpotMarketAccounts ( ) : Promise < boolean > {
531+ if ( this . resubOpts ?. logResubMessages ) {
532+ console . log (
533+ '[grpcDriftClientAccountSubscriberV2] subscribeToSpotMarketAccounts'
534+ ) ;
535+ }
526536 const spotMarketIndexToAccountPubkeys : Array < [ number , PublicKey ] > =
527537 await Promise . all (
528538 this . spotMarketIndexes . map ( async ( marketIndex ) => [
@@ -585,6 +595,9 @@ export class grpcDriftClientAccountSubscriberV2
585595 }
586596
587597 async subscribeToOracles ( ) : Promise < boolean > {
598+ if ( this . resubOpts ?. logResubMessages ) {
599+ console . log ( 'grpcDriftClientAccountSubscriberV2 subscribeToOracles' ) ;
600+ }
588601 const oraclePubkeyToInfosMap = new Map < string , OracleInfo [ ] > ( ) ;
589602 for ( const info of this . oracleInfos ) {
590603 const pubkey = info . publicKey . toBase58 ( ) ;
0 commit comments