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 @@ -193,8 +193,8 @@ import { getOracleId } from './oracles/oracleId';
193
193
import { SignedMsgOrderParams } from './types' ;
194
194
import { sha256 } from '@noble/hashes/sha256' ;
195
195
import { getOracleConfidenceFromMMOracleData } from './oracles/utils' ;
196
- import { WebSocketDriftClientAccountSubscriberV2 } from './accounts/webSocketDriftClientAccountSubscriberV2' ;
197
196
import { Commitment } from 'gill' ;
197
+ import { WebSocketDriftClientAccountSubscriber } from '@drift-labs/sdk' ;
198
198
199
199
type RemainingAccountParams = {
200
200
userAccounts : UserAccount [ ] ;
@@ -439,7 +439,10 @@ export class DriftClient {
439
439
}
440
440
) ;
441
441
} else {
442
- this . accountSubscriber = new WebSocketDriftClientAccountSubscriberV2 (
442
+ const accountSubscriberClass =
443
+ config . accountSubscription ?. driftClientAccountSubscriber ??
444
+ WebSocketDriftClientAccountSubscriber ;
445
+ this . accountSubscriber = new accountSubscriberClass (
443
446
this . program ,
444
447
config . perpMarketIndexes ?? [ ] ,
445
448
config . spotMarketIndexes ?? [ ] ,
You can’t perform that action at this time.
0 commit comments