wsPublish polls RPC

This commit is contained in:
Nour Alharithi
2023-11-13 09:29:30 -08:00
parent cda90122b5
commit ba4b665a73

View File

@@ -9,6 +9,7 @@ import {
SlotSubscriber,
UserMap,
Wallet,
BulkAccountLoader,
} from '@drift-labs/sdk';
import { logger, setLogLevel } from './utils/logger';
@@ -50,12 +51,19 @@ const main = async () => {
commitment: stateCommitment,
});
const bulkAccountLoader = new BulkAccountLoader(
connection,
stateCommitment,
ORDERBOOK_UPDATE_INTERVAL
);
driftClient = new DriftClient({
connection,
wallet,
programID: clearingHousePublicKey,
accountSubscription: {
type: 'websocket',
type: 'polling',
accountLoader: bulkAccountLoader,
},
env: driftEnv,
userStats: true,