From 98484cff6433bd66ec0a20191f09126fb539f627 Mon Sep 17 00:00:00 2001 From: wphan Date: Tue, 2 Jan 2024 10:58:34 -0800 Subject: [PATCH] bump sdk fix build --- package.json | 2 +- src/grpc/OrderSubscriberGRPC.ts | 2 +- src/index.ts | 10 +++++----- yarn.lock | 8 ++++---- 4 files changed, 11 insertions(+), 11 deletions(-) diff --git a/package.json b/package.json index 7697e4a..4ce1611 100644 --- a/package.json +++ b/package.json @@ -6,7 +6,7 @@ "license": "Apache-2.0", "dependencies": { "@coral-xyz/anchor": "^0.29.0", - "@drift-labs/sdk": "2.53.0-beta.8", + "@drift-labs/sdk": "2.54.0-beta.2", "@opentelemetry/api": "^1.1.0", "@opentelemetry/auto-instrumentations-node": "^0.31.1", "@opentelemetry/exporter-prometheus": "^0.31.0", diff --git a/src/grpc/OrderSubscriberGRPC.ts b/src/grpc/OrderSubscriberGRPC.ts index ca4c935..30f385a 100644 --- a/src/grpc/OrderSubscriberGRPC.ts +++ b/src/grpc/OrderSubscriberGRPC.ts @@ -215,7 +215,7 @@ export class GeyserOrderSubscriber { for (const [key, { userAccount }] of this.usersAccounts.entries()) { const userAccountPubkey = new PublicKey(key); for (const order of userAccount.orders) { - dlob.insertOrder(order, userAccountPubkey, slot); + dlob.insertOrder(order, userAccountPubkey.toBase58(), slot); } } return dlob; diff --git a/src/index.ts b/src/index.ts index 931aef3..f17a8f1 100644 --- a/src/index.ts +++ b/src/index.ts @@ -236,7 +236,7 @@ const initializeAllMarketSubscribers = async (driftClient: DriftClient) => { return markets; }; -const main = async () => { +const main = async (): Promise => { const wallet = new Wallet(new Keypair()); const clearingHousePublicKey = new PublicKey(sdkConfig.DRIFT_PROGRAM_ID); @@ -687,13 +687,13 @@ const main = async () => { break; } if (side.userAccount) { - const maker = side.userAccount.toBase58(); + const maker = side.userAccount; if (topMakers.has(maker)) { continue; } else { if (`${includeUserStats}`.toLowerCase() === 'true') { const userAccount = dlobProvider.getUserAccount( - side.userAccount + new PublicKey(side.userAccount) ); topMakers.add([ userAccount, @@ -703,7 +703,7 @@ const main = async () => { ), ]); } else { - topMakers.add(side.userAccount.toBase58()); + topMakers.add(side.userAccount); } foundMakers++; } @@ -1217,7 +1217,7 @@ const main = async () => { }); }; -async function recursiveTryCatch(f: () => void) { +async function recursiveTryCatch(f: () => Promise) { try { await f(); } catch (e) { diff --git a/yarn.lock b/yarn.lock index cbb5f50..6c55fe3 100644 --- a/yarn.lock +++ b/yarn.lock @@ -115,10 +115,10 @@ enabled "2.0.x" kuler "^2.0.0" -"@drift-labs/sdk@2.53.0-beta.8": - version "2.53.0-beta.8" - resolved "https://registry.yarnpkg.com/@drift-labs/sdk/-/sdk-2.53.0-beta.8.tgz#bc12747a8f2c4fa26b979fa6a8202a3bd3f52b2b" - integrity sha512-R2OPzgWjEVrJMeSwXa/UiquM6c72iOnFdoHbXJ4JJPd/KJDvghjOIXshF+7ttf80Uwswrox0sEhCJOYcYZOMIQ== +"@drift-labs/sdk@2.54.0-beta.2": + version "2.54.0-beta.2" + resolved "https://registry.yarnpkg.com/@drift-labs/sdk/-/sdk-2.54.0-beta.2.tgz#3b7cce3abf9f24a7e7e2af959a953ee9c7d14cdc" + integrity sha512-ilUoVtWYPw7nKzuohfgmb1CBwg5tvL/fctdOiIG1izku1jMqNL4D19zr/uNUSpCwbRVnZy0F/8AX/3UKju85iw== dependencies: "@coral-xyz/anchor" "0.28.1-beta.2" "@ellipsis-labs/phoenix-sdk" "^1.4.2"