File tree Expand file tree Collapse file tree 2 files changed +6
-13
lines changed Expand file tree Collapse file tree 2 files changed +6
-13
lines changed Original file line number Diff line number Diff line change @@ -132,9 +132,6 @@ export class WebSocketDriftClientAccountSubscriberV2
132
132
this . subscriptionPromiseResolver = res ;
133
133
} ) ;
134
134
135
- // Profile public key generation
136
- const pubkeyStartTime = performance . now ( ) ;
137
-
138
135
const [ perpMarketAccountPubkeys , spotMarketAccountPubkeys ] =
139
136
await Promise . all ( [
140
137
Promise . all (
@@ -148,8 +145,6 @@ export class WebSocketDriftClientAccountSubscriberV2
148
145
)
149
146
) ,
150
147
] ) ;
151
- const pubkeyEndTime = performance . now ( ) ;
152
- const pubkeyDuration = pubkeyEndTime - pubkeyStartTime ;
153
148
154
149
// Profile findAllMarketsAndOracles if needed
155
150
let findAllMarketsDuration = 0 ;
@@ -292,12 +287,7 @@ export class WebSocketDriftClientAccountSubscriberV2
292
287
subscribeToOraclesEndTime - subscribeToOraclesStartTime ;
293
288
return duration ;
294
289
} ) ( ) ,
295
- ( async ( ) => {
296
- const stateFetchStartTime = performance . now ( ) ;
297
- await this . stateAccountSubscriber . fetch ( ) ;
298
- const stateFetchEndTime = performance . now ( ) ;
299
- const stateFetchDuration = stateFetchEndTime - stateFetchStartTime ;
300
- } ) ( ) ,
290
+ this . stateAccountSubscriber . fetch ( ) ,
301
291
] ) ;
302
292
303
293
const initialPerpMarketDataFromLatestData = new Map (
Original file line number Diff line number Diff line change @@ -192,8 +192,8 @@ import { getOracleId } from './oracles/oracleId';
192
192
import { SignedMsgOrderParams } from './types' ;
193
193
import { sha256 } from '@noble/hashes/sha256' ;
194
194
import { getOracleConfidenceFromMMOracleData } from './oracles/utils' ;
195
- import { WebSocketDriftClientAccountSubscriberV2 } from './accounts/webSocketDriftClientAccountSubscriberV2' ;
196
195
import { Commitment } from 'gill' ;
196
+ import { WebSocketDriftClientAccountSubscriber } from '@drift-labs/sdk' ;
197
197
198
198
type RemainingAccountParams = {
199
199
userAccounts : UserAccount [ ] ;
@@ -438,7 +438,10 @@ export class DriftClient {
438
438
}
439
439
) ;
440
440
} else {
441
- this . accountSubscriber = new WebSocketDriftClientAccountSubscriberV2 (
441
+ const accountSubscriberClass =
442
+ config . accountSubscription ?. driftClientAccountSubscriber ??
443
+ WebSocketDriftClientAccountSubscriber ;
444
+ this . accountSubscriber = new accountSubscriberClass (
442
445
this . program ,
443
446
config . perpMarketIndexes ?? [ ] ,
444
447
config . spotMarketIndexes ?? [ ] ,
You can’t perform that action at this time.
0 commit comments