@@ -77,6 +77,14 @@ export class WebSocketDriftClientAccountSubscriber
7777 resubOpts ?: ResubOpts ,
7878 commitment ?: Commitment
7979 ) => AccountSubscriber < any > ;
80+ customOracleAccountSubscriber ?: new (
81+ accountName : string ,
82+ program : Program ,
83+ accountPublicKey : PublicKey ,
84+ decodeBuffer ?: ( buffer : Buffer ) => any ,
85+ resubOpts ?: ResubOpts ,
86+ commitment ?: Commitment
87+ ) => AccountSubscriber < any > ;
8088
8189 protected isSubscribing = false ;
8290 protected subscriptionPromise : Promise < boolean > ;
@@ -98,6 +106,14 @@ export class WebSocketDriftClientAccountSubscriber
98106 decodeBuffer ?: ( buffer : Buffer ) => any ,
99107 resubOpts ?: ResubOpts ,
100108 commitment ?: Commitment
109+ ) => WebSocketAccountSubscriberV2 < any > | WebSocketAccountSubscriber < any > ,
110+ customOracleAccountSubscriber ?: new (
111+ accountName : string ,
112+ program : Program ,
113+ accountPublicKey : PublicKey ,
114+ decodeBuffer ?: ( buffer : Buffer ) => any ,
115+ resubOpts ?: ResubOpts ,
116+ commitment ?: Commitment
101117 ) => WebSocketAccountSubscriberV2 < any > | WebSocketAccountSubscriber < any >
102118 ) {
103119 this . isSubscribed = false ;
@@ -111,6 +127,7 @@ export class WebSocketDriftClientAccountSubscriber
111127 this . resubOpts = resubOpts ;
112128 this . commitment = commitment ;
113129 this . customPerpMarketAccountSubscriber = customPerpMarketAccountSubscriber ;
130+ this . customOracleAccountSubscriber = customOracleAccountSubscriber ;
114131 }
115132
116133 public async subscribe ( ) : Promise < boolean > {
@@ -381,7 +398,9 @@ export class WebSocketDriftClientAccountSubscriber
381398 this . program . provider . connection ,
382399 this . program
383400 ) ;
384- const accountSubscriber = new WebSocketAccountSubscriber < OraclePriceData > (
401+ const AccountSubscriberClass =
402+ this . customOracleAccountSubscriber || WebSocketAccountSubscriber ;
403+ const accountSubscriber = new AccountSubscriberClass < OraclePriceData > (
385404 'oracle' ,
386405 this . program ,
387406 oracleInfo . publicKey ,
0 commit comments