wsPublish polls RPC
This commit is contained in:
@@ -9,6 +9,7 @@ import {
|
|||||||
SlotSubscriber,
|
SlotSubscriber,
|
||||||
UserMap,
|
UserMap,
|
||||||
Wallet,
|
Wallet,
|
||||||
|
BulkAccountLoader,
|
||||||
} from '@drift-labs/sdk';
|
} from '@drift-labs/sdk';
|
||||||
|
|
||||||
import { logger, setLogLevel } from './utils/logger';
|
import { logger, setLogLevel } from './utils/logger';
|
||||||
@@ -50,12 +51,19 @@ const main = async () => {
|
|||||||
commitment: stateCommitment,
|
commitment: stateCommitment,
|
||||||
});
|
});
|
||||||
|
|
||||||
|
const bulkAccountLoader = new BulkAccountLoader(
|
||||||
|
connection,
|
||||||
|
stateCommitment,
|
||||||
|
ORDERBOOK_UPDATE_INTERVAL
|
||||||
|
);
|
||||||
|
|
||||||
driftClient = new DriftClient({
|
driftClient = new DriftClient({
|
||||||
connection,
|
connection,
|
||||||
wallet,
|
wallet,
|
||||||
programID: clearingHousePublicKey,
|
programID: clearingHousePublicKey,
|
||||||
accountSubscription: {
|
accountSubscription: {
|
||||||
type: 'websocket',
|
type: 'polling',
|
||||||
|
accountLoader: bulkAccountLoader,
|
||||||
},
|
},
|
||||||
env: driftEnv,
|
env: driftEnv,
|
||||||
userStats: true,
|
userStats: true,
|
||||||
|
|||||||
Reference in New Issue
Block a user