@drift-labs/jit-proxy 0.13.69 → 0.13.71

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -23,6 +23,9 @@ class BaseJitter {
23
23
  if (this.swiftOrderSubscriber && !this.slotSubscriber) {
24
24
  throw new Error('Slot subscriber is required for signedMsg order subscriber');
25
25
  }
26
+ if (!this.swiftOrderSubscriber.userAccountGetter) {
27
+ throw new Error('User account getter is required in swift order subscriber for jit integration');
28
+ }
26
29
  }
27
30
  async subscribe() {
28
31
  var _a, _b;
@@ -103,7 +106,7 @@ class BaseJitter {
103
106
  const signingAuthority = new web3_js_1.PublicKey(orderMessageRaw['signing_authority']);
104
107
  const takerUserPubkey = await (0, sdk_1.getUserAccountPublicKey)(this.driftClient.program.programId, takerAuthority, takerSubaccountId);
105
108
  const takerUserPubkeyString = takerUserPubkey.toBase58();
106
- const takerUserAccount = (await this.swiftOrderSubscriber.userMap.mustGet(takerUserPubkey.toString())).getUserAccount();
109
+ const takerUserAccount = await this.swiftOrderSubscriber.userAccountGetter.mustGetUserAccount(takerUserPubkey.toString());
107
110
  const orderSlot = Math.min(signedMsgOrderParamsMessage.slot.toNumber(), this.slotSubscriber.getSlot());
108
111
  const signedMsgOrder = {
109
112
  status: sdk_1.OrderStatus.OPEN,
package/package.json CHANGED
@@ -1,13 +1,13 @@
1
1
  {
2
2
  "name": "@drift-labs/jit-proxy",
3
- "version": "0.13.69",
3
+ "version": "0.13.71",
4
4
  "scripts": {
5
5
  "clean": "rm -rf lib",
6
6
  "build": "yarn clean && tsc"
7
7
  },
8
8
  "dependencies": {
9
9
  "@coral-xyz/anchor": "0.26.0",
10
- "@drift-labs/sdk": "2.114.0-beta.1",
10
+ "@drift-labs/sdk": "2.114.0-beta.3",
11
11
  "@solana/web3.js": "1.91.7",
12
12
  "tweetnacl-util": "^0.15.1"
13
13
  },
@@ -99,6 +99,12 @@ export abstract class BaseJitter {
99
99
  'Slot subscriber is required for signedMsg order subscriber'
100
100
  );
101
101
  }
102
+
103
+ if (!this.swiftOrderSubscriber.userAccountGetter) {
104
+ throw new Error(
105
+ 'User account getter is required in swift order subscriber for jit integration'
106
+ );
107
+ }
102
108
  }
103
109
 
104
110
  async subscribe(): Promise<void> {
@@ -239,12 +245,10 @@ export abstract class BaseJitter {
239
245
  takerSubaccountId
240
246
  );
241
247
  const takerUserPubkeyString = takerUserPubkey.toBase58();
242
- const takerUserAccount = (
243
- await this.swiftOrderSubscriber.userMap.mustGet(
248
+ const takerUserAccount =
249
+ await this.swiftOrderSubscriber.userAccountGetter.mustGetUserAccount(
244
250
  takerUserPubkey.toString()
245
- )
246
- ).getUserAccount();
247
-
251
+ );
248
252
  const orderSlot = Math.min(
249
253
  signedMsgOrderParamsMessage.slot.toNumber(),
250
254
  this.slotSubscriber.getSlot()