Merge pull request #16 from drift-labs/master

wsPublish polls RPC now
This commit is contained in:
Nour Alharithi
2023-11-13 09:32:49 -08:00
committed by GitHub
3 changed files with 14 additions and 6 deletions

View File

@@ -5,7 +5,7 @@
"main": "lib/index.js", "main": "lib/index.js",
"license": "Apache-2.0", "license": "Apache-2.0",
"dependencies": { "dependencies": {
"@drift-labs/sdk": "2.43.0-beta.14", "@drift-labs/sdk": "2.43.0-beta.15",
"@opentelemetry/api": "^1.1.0", "@opentelemetry/api": "^1.1.0",
"@opentelemetry/auto-instrumentations-node": "^0.31.1", "@opentelemetry/auto-instrumentations-node": "^0.31.1",
"@opentelemetry/exporter-prometheus": "^0.31.0", "@opentelemetry/exporter-prometheus": "^0.31.0",

View File

@@ -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,

View File

@@ -80,10 +80,10 @@
enabled "2.0.x" enabled "2.0.x"
kuler "^2.0.0" kuler "^2.0.0"
"@drift-labs/sdk@2.43.0-beta.14": "@drift-labs/sdk@2.43.0-beta.15":
version "2.43.0-beta.14" version "2.43.0-beta.15"
resolved "https://registry.yarnpkg.com/@drift-labs/sdk/-/sdk-2.43.0-beta.14.tgz#0cd2ada9cda91519d341d7963ad7d18f6d3f1dff" resolved "https://registry.yarnpkg.com/@drift-labs/sdk/-/sdk-2.43.0-beta.15.tgz#60dba13d6dffff5a65c1ca807f1f60153e05e2bb"
integrity sha512-9o+zbpBo0U5nRxcspobV2J4vYGssJaJRvOCOHYql/bnlzXd8qweXg3zRZI2XD1T9vQX4Si12DW5Hw5+jsxIsuw== integrity sha512-0dxf5w3Lga1CXAkVo3AKsvoatEiS7HV6YdVW1bhtyCO4sXNoR1sMVC0wlFIQL8nGpDNC8gpyWSyT6cOuZ3boqA==
dependencies: dependencies:
"@coral-xyz/anchor" "0.28.1-beta.2" "@coral-xyz/anchor" "0.28.1-beta.2"
"@ellipsis-labs/phoenix-sdk" "^1.4.2" "@ellipsis-labs/phoenix-sdk" "^1.4.2"