@velocity-exchange/sdk 0.0.2 → 0.0.5

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.
Files changed (192) hide show
  1. package/CHANGELOG.md +15 -0
  2. package/README.md +5 -6
  3. package/bunfig.toml +3 -0
  4. package/lib/browser/auctionSubscriber/auctionSubscriber.d.ts +4 -2
  5. package/lib/browser/auctionSubscriber/auctionSubscriber.js +9 -4
  6. package/lib/browser/auctionSubscriber/auctionSubscriberGrpc.d.ts +4 -2
  7. package/lib/browser/auctionSubscriber/auctionSubscriberGrpc.js +9 -4
  8. package/lib/browser/auctionSubscriber/types.d.ts +4 -2
  9. package/lib/browser/config.d.ts +3 -8
  10. package/lib/browser/config.js +14 -22
  11. package/lib/browser/constituentMap/constituentMap.d.ts +4 -2
  12. package/lib/browser/constituentMap/constituentMap.js +14 -10
  13. package/lib/browser/core/VelocityCore.d.ts +4 -0
  14. package/lib/browser/core/VelocityCore.js +3 -1
  15. package/lib/browser/decode/user.js +5 -5
  16. package/lib/browser/dlob/DLOB.js +1 -1
  17. package/lib/browser/dlob/DLOBNode.js +1 -2
  18. package/lib/browser/dlob/DLOBSubscriber.d.ts +3 -1
  19. package/lib/browser/dlob/DLOBSubscriber.js +19 -10
  20. package/lib/browser/dlob/types.d.ts +3 -1
  21. package/lib/browser/idl/drift.d.ts +59 -6
  22. package/lib/browser/idl/drift.json +6049 -806
  23. package/lib/browser/math/auction.d.ts +1 -1
  24. package/lib/browser/math/auction.js +2 -9
  25. package/lib/browser/math/orders.js +3 -3
  26. package/lib/browser/orderSubscriber/OrderSubscriber.d.ts +3 -1
  27. package/lib/browser/orderSubscriber/OrderSubscriber.js +19 -11
  28. package/lib/browser/orderSubscriber/types.d.ts +3 -1
  29. package/lib/browser/priorityFee/priorityFeeSubscriber.d.ts +4 -2
  30. package/lib/browser/priorityFee/priorityFeeSubscriber.js +15 -11
  31. package/lib/browser/priorityFee/priorityFeeSubscriberMap.d.ts +11 -9
  32. package/lib/browser/priorityFee/priorityFeeSubscriberMap.js +18 -18
  33. package/lib/browser/priorityFee/types.d.ts +9 -5
  34. package/lib/browser/priorityFee/types.js +1 -1
  35. package/lib/browser/swift/grpcSignedMsgUserAccountSubscriber.d.ts +3 -12
  36. package/lib/browser/swift/grpcSignedMsgUserAccountSubscriber.js +3 -9
  37. package/lib/browser/swift/signedMsgUserAccountSubscriber.d.ts +11 -8
  38. package/lib/browser/swift/signedMsgUserAccountSubscriber.js +10 -5
  39. package/lib/browser/swift/swiftOrderSubscriber.d.ts +7 -4
  40. package/lib/browser/swift/swiftOrderSubscriber.js +19 -11
  41. package/lib/browser/types.d.ts +2 -2
  42. package/lib/browser/user.d.ts +3 -1
  43. package/lib/browser/user.js +93 -86
  44. package/lib/browser/userConfig.d.ts +4 -2
  45. package/lib/browser/userMap/referrerMap.d.ts +5 -3
  46. package/lib/browser/userMap/referrerMap.js +18 -14
  47. package/lib/browser/userMap/revenueShareEscrowMap.d.ts +5 -3
  48. package/lib/browser/userMap/revenueShareEscrowMap.js +18 -14
  49. package/lib/browser/userMap/userMap.d.ts +3 -1
  50. package/lib/browser/userMap/userMap.js +24 -19
  51. package/lib/browser/userMap/userMapConfig.d.ts +4 -2
  52. package/lib/browser/userMap/userStatsMap.d.ts +5 -3
  53. package/lib/browser/userMap/userStatsMap.js +15 -11
  54. package/lib/browser/userStats.d.ts +3 -1
  55. package/lib/browser/userStats.js +21 -15
  56. package/lib/browser/userStatsConfig.d.ts +4 -2
  57. package/lib/browser/util/deprecatedAlias.d.ts +26 -0
  58. package/lib/browser/util/deprecatedAlias.js +10 -0
  59. package/lib/browser/velocityClient.d.ts +6 -6
  60. package/lib/browser/velocityClient.js +6 -6
  61. package/lib/browser/velocityClientConfig.d.ts +7 -4
  62. package/lib/node/auctionSubscriber/auctionSubscriber.d.ts +4 -2
  63. package/lib/node/auctionSubscriber/auctionSubscriber.d.ts.map +1 -1
  64. package/lib/node/auctionSubscriber/auctionSubscriber.js +9 -4
  65. package/lib/node/auctionSubscriber/auctionSubscriberGrpc.d.ts +4 -2
  66. package/lib/node/auctionSubscriber/auctionSubscriberGrpc.d.ts.map +1 -1
  67. package/lib/node/auctionSubscriber/auctionSubscriberGrpc.js +9 -4
  68. package/lib/node/auctionSubscriber/types.d.ts +4 -2
  69. package/lib/node/auctionSubscriber/types.d.ts.map +1 -1
  70. package/lib/node/config.d.ts +3 -8
  71. package/lib/node/config.d.ts.map +1 -1
  72. package/lib/node/config.js +14 -22
  73. package/lib/node/constituentMap/constituentMap.d.ts +4 -2
  74. package/lib/node/constituentMap/constituentMap.d.ts.map +1 -1
  75. package/lib/node/constituentMap/constituentMap.js +14 -10
  76. package/lib/node/core/VelocityCore.d.ts +4 -0
  77. package/lib/node/core/VelocityCore.d.ts.map +1 -1
  78. package/lib/node/core/VelocityCore.js +3 -1
  79. package/lib/node/decode/user.js +5 -5
  80. package/lib/node/dlob/DLOB.js +1 -1
  81. package/lib/node/dlob/DLOBNode.js +1 -2
  82. package/lib/node/dlob/DLOBSubscriber.d.ts +3 -1
  83. package/lib/node/dlob/DLOBSubscriber.d.ts.map +1 -1
  84. package/lib/node/dlob/DLOBSubscriber.js +19 -10
  85. package/lib/node/dlob/types.d.ts +3 -1
  86. package/lib/node/dlob/types.d.ts.map +1 -1
  87. package/lib/node/idl/drift.d.ts +59 -6
  88. package/lib/node/idl/drift.d.ts.map +1 -1
  89. package/lib/node/idl/drift.json +6049 -806
  90. package/lib/node/math/auction.d.ts +1 -1
  91. package/lib/node/math/auction.d.ts.map +1 -1
  92. package/lib/node/math/auction.js +2 -9
  93. package/lib/node/math/orders.d.ts.map +1 -1
  94. package/lib/node/math/orders.js +3 -3
  95. package/lib/node/orderSubscriber/OrderSubscriber.d.ts +3 -1
  96. package/lib/node/orderSubscriber/OrderSubscriber.d.ts.map +1 -1
  97. package/lib/node/orderSubscriber/OrderSubscriber.js +19 -11
  98. package/lib/node/orderSubscriber/types.d.ts +3 -1
  99. package/lib/node/orderSubscriber/types.d.ts.map +1 -1
  100. package/lib/node/priorityFee/priorityFeeSubscriber.d.ts +4 -2
  101. package/lib/node/priorityFee/priorityFeeSubscriber.d.ts.map +1 -1
  102. package/lib/node/priorityFee/priorityFeeSubscriber.js +15 -11
  103. package/lib/node/priorityFee/priorityFeeSubscriberMap.d.ts +11 -9
  104. package/lib/node/priorityFee/priorityFeeSubscriberMap.d.ts.map +1 -1
  105. package/lib/node/priorityFee/priorityFeeSubscriberMap.js +18 -18
  106. package/lib/node/priorityFee/types.d.ts +9 -5
  107. package/lib/node/priorityFee/types.d.ts.map +1 -1
  108. package/lib/node/priorityFee/types.js +1 -1
  109. package/lib/node/swift/grpcSignedMsgUserAccountSubscriber.d.ts +3 -12
  110. package/lib/node/swift/grpcSignedMsgUserAccountSubscriber.d.ts.map +1 -1
  111. package/lib/node/swift/grpcSignedMsgUserAccountSubscriber.js +3 -9
  112. package/lib/node/swift/signedMsgUserAccountSubscriber.d.ts +11 -8
  113. package/lib/node/swift/signedMsgUserAccountSubscriber.d.ts.map +1 -1
  114. package/lib/node/swift/signedMsgUserAccountSubscriber.js +10 -5
  115. package/lib/node/swift/swiftOrderSubscriber.d.ts +7 -4
  116. package/lib/node/swift/swiftOrderSubscriber.d.ts.map +1 -1
  117. package/lib/node/swift/swiftOrderSubscriber.js +19 -11
  118. package/lib/node/types.d.ts +2 -2
  119. package/lib/node/types.d.ts.map +1 -1
  120. package/lib/node/user.d.ts +3 -1
  121. package/lib/node/user.d.ts.map +1 -1
  122. package/lib/node/user.js +93 -86
  123. package/lib/node/userConfig.d.ts +4 -2
  124. package/lib/node/userConfig.d.ts.map +1 -1
  125. package/lib/node/userMap/referrerMap.d.ts +5 -3
  126. package/lib/node/userMap/referrerMap.d.ts.map +1 -1
  127. package/lib/node/userMap/referrerMap.js +18 -14
  128. package/lib/node/userMap/revenueShareEscrowMap.d.ts +5 -3
  129. package/lib/node/userMap/revenueShareEscrowMap.d.ts.map +1 -1
  130. package/lib/node/userMap/revenueShareEscrowMap.js +18 -14
  131. package/lib/node/userMap/userMap.d.ts +3 -1
  132. package/lib/node/userMap/userMap.d.ts.map +1 -1
  133. package/lib/node/userMap/userMap.js +24 -19
  134. package/lib/node/userMap/userMapConfig.d.ts +4 -2
  135. package/lib/node/userMap/userMapConfig.d.ts.map +1 -1
  136. package/lib/node/userMap/userStatsMap.d.ts +5 -3
  137. package/lib/node/userMap/userStatsMap.d.ts.map +1 -1
  138. package/lib/node/userMap/userStatsMap.js +15 -11
  139. package/lib/node/userStats.d.ts +3 -1
  140. package/lib/node/userStats.d.ts.map +1 -1
  141. package/lib/node/userStats.js +21 -15
  142. package/lib/node/userStatsConfig.d.ts +4 -2
  143. package/lib/node/userStatsConfig.d.ts.map +1 -1
  144. package/lib/node/util/deprecatedAlias.d.ts +27 -0
  145. package/lib/node/util/deprecatedAlias.d.ts.map +1 -0
  146. package/lib/node/util/deprecatedAlias.js +10 -0
  147. package/lib/node/velocityClient.d.ts +6 -6
  148. package/lib/node/velocityClient.d.ts.map +1 -1
  149. package/lib/node/velocityClient.js +6 -6
  150. package/lib/node/velocityClientConfig.d.ts +7 -4
  151. package/lib/node/velocityClientConfig.d.ts.map +1 -1
  152. package/package.json +1 -1
  153. package/src/auctionSubscriber/auctionSubscriber.ts +12 -6
  154. package/src/auctionSubscriber/auctionSubscriberGrpc.ts +12 -6
  155. package/src/auctionSubscriber/types.ts +5 -2
  156. package/src/config.ts +38 -27
  157. package/src/constituentMap/constituentMap.ts +17 -9
  158. package/src/core/VelocityCore.ts +6 -0
  159. package/src/decode/user.ts +5 -5
  160. package/src/dlob/DLOB.ts +1 -1
  161. package/src/dlob/DLOBNode.ts +1 -1
  162. package/src/dlob/DLOBSubscriber.ts +21 -11
  163. package/src/dlob/types.ts +3 -1
  164. package/src/idl/drift.json +23940 -18697
  165. package/src/idl/drift.ts +59 -6
  166. package/src/math/auction.ts +3 -10
  167. package/src/math/orders.ts +3 -6
  168. package/src/orderSubscriber/OrderSubscriber.ts +17 -7
  169. package/src/orderSubscriber/types.ts +3 -1
  170. package/src/priorityFee/priorityFeeSubscriber.ts +13 -9
  171. package/src/priorityFee/priorityFeeSubscriberMap.ts +23 -25
  172. package/src/priorityFee/types.ts +19 -9
  173. package/src/swift/grpcSignedMsgUserAccountSubscriber.ts +10 -23
  174. package/src/swift/signedMsgUserAccountSubscriber.ts +22 -14
  175. package/src/swift/swiftOrderSubscriber.ts +24 -16
  176. package/src/types.ts +2 -2
  177. package/src/user.ts +93 -82
  178. package/src/userConfig.ts +5 -2
  179. package/src/userMap/referrerMap.ts +19 -15
  180. package/src/userMap/revenueShareEscrowMap.ts +20 -16
  181. package/src/userMap/userMap.ts +20 -15
  182. package/src/userMap/userMapConfig.ts +6 -3
  183. package/src/userMap/userStatsMap.ts +19 -15
  184. package/src/userStats.ts +13 -7
  185. package/src/userStatsConfig.ts +5 -2
  186. package/src/util/deprecatedAlias.ts +21 -0
  187. package/src/velocityClient.ts +12 -12
  188. package/src/velocityClientConfig.ts +27 -42
  189. package/tests/auctions/test.ts +4 -4
  190. package/tests/decode/test.ts +1 -1
  191. package/tests/dlob/test.ts +5 -5
  192. package/tests/user/helpers.ts +1 -1
@@ -790,7 +790,7 @@ export declare class VelocityClient {
790
790
  * @param newOraclePriceOffset: The new oracle price offset for the order. One of [newBaseAmount|newLimitPrice|newOraclePriceOffset] must be provided.
791
791
  * @returns
792
792
  */
793
- modifyPerpOrder(orderId: number, newBaseAmount?: BN, newLimitPrice?: BN, newOraclePriceOffset?: number): Promise<TransactionSignature>;
793
+ modifyPerpOrder(orderId: number, newBaseAmount?: BN, newLimitPrice?: BN, newOraclePriceOffset?: BN): Promise<TransactionSignature>;
794
794
  /**
795
795
  * Modifies an open order by closing it and replacing it with a new order.
796
796
  * @deprecated use modifyOrderByUserOrderId instead
@@ -800,7 +800,7 @@ export declare class VelocityClient {
800
800
  * @param newOraclePriceOffset: The new oracle price offset for the order. One of [newBaseAmount|newLimitPrice|newOraclePriceOffset] must be provided.
801
801
  * @returns
802
802
  */
803
- modifyPerpOrderByUserOrderId(userOrderId: number, newBaseAmount?: BN, newLimitPrice?: BN, newOraclePriceOffset?: number): Promise<TransactionSignature>;
803
+ modifyPerpOrderByUserOrderId(userOrderId: number, newBaseAmount?: BN, newLimitPrice?: BN, newOraclePriceOffset?: BN): Promise<TransactionSignature>;
804
804
  /**
805
805
  * Modifies an open order (spot or perp) by closing it and replacing it with a new order.
806
806
  * @param orderParams.orderId: The open order to modify
@@ -824,7 +824,7 @@ export declare class VelocityClient {
824
824
  newDirection?: PositionDirection;
825
825
  newBaseAmount?: BN;
826
826
  newLimitPrice?: BN;
827
- newOraclePriceOffset?: number;
827
+ newOraclePriceOffset?: BN;
828
828
  newTriggerPrice?: BN;
829
829
  newTriggerCondition?: OrderTriggerCondition;
830
830
  auctionDuration?: number;
@@ -847,7 +847,7 @@ export declare class VelocityClient {
847
847
  newDirection?: PositionDirection;
848
848
  newBaseAmount?: BN;
849
849
  newLimitPrice?: BN;
850
- newOraclePriceOffset?: number;
850
+ newOraclePriceOffset?: BN;
851
851
  newTriggerPrice?: BN;
852
852
  newTriggerCondition?: OrderTriggerCondition;
853
853
  auctionDuration?: number;
@@ -885,7 +885,7 @@ export declare class VelocityClient {
885
885
  newDirection?: PositionDirection;
886
886
  newBaseAmount?: BN;
887
887
  newLimitPrice?: BN;
888
- newOraclePriceOffset?: number;
888
+ newOraclePriceOffset?: BN;
889
889
  newTriggerPrice?: BN;
890
890
  newTriggerCondition?: OrderTriggerCondition;
891
891
  auctionDuration?: number;
@@ -902,7 +902,7 @@ export declare class VelocityClient {
902
902
  newDirection?: PositionDirection;
903
903
  newBaseAmount?: BN;
904
904
  newLimitPrice?: BN;
905
- newOraclePriceOffset?: number;
905
+ newOraclePriceOffset?: BN;
906
906
  newTriggerPrice?: BN;
907
907
  newTriggerCondition?: OrderTriggerCondition;
908
908
  auctionDuration?: number;
@@ -192,7 +192,7 @@ class VelocityClient {
192
192
  }
193
193
  if (config.userStats) {
194
194
  this.userStats = new userStats_1.UserStats({
195
- driftClient: this,
195
+ velocityClient: this,
196
196
  userStatsAccountPublicKey: (0, pda_1.getUserStatsAccountPublicKey)(this.program.programId, this.authority),
197
197
  accountSubscription: this.userAccountSubscriptionConfig,
198
198
  });
@@ -245,7 +245,7 @@ class VelocityClient {
245
245
  createUser(subAccountId, accountSubscriptionConfig, authority) {
246
246
  const userAccountPublicKey = (0, pda_1.getUserAccountPublicKeySync)(this.program.programId, authority !== null && authority !== void 0 ? authority : this.authority, subAccountId);
247
247
  return new user_1.User({
248
- driftClient: this,
248
+ velocityClient: this,
249
249
  userAccountPublicKey,
250
250
  accountSubscription: accountSubscriptionConfig,
251
251
  });
@@ -437,7 +437,7 @@ class VelocityClient {
437
437
  }
438
438
  this.userStats = undefined;
439
439
  this.userStats = new userStats_1.UserStats({
440
- driftClient: this,
440
+ velocityClient: this,
441
441
  userStatsAccountPublicKey: this.getUserStatsAccountPublicKey(),
442
442
  accountSubscription: this.userStatsAccountSubscriptionConfig,
443
443
  });
@@ -475,7 +475,7 @@ class VelocityClient {
475
475
  }
476
476
  this.userStats = undefined;
477
477
  this.userStats = new userStats_1.UserStats({
478
- driftClient: this,
478
+ velocityClient: this,
479
479
  userStatsAccountPublicKey: this.getUserStatsAccountPublicKey(),
480
480
  accountSubscription: this.userStatsAccountSubscriptionConfig,
481
481
  });
@@ -500,7 +500,7 @@ class VelocityClient {
500
500
  await this.userStats.unsubscribe();
501
501
  }
502
502
  this.userStats = new userStats_1.UserStats({
503
- driftClient: this,
503
+ velocityClient: this,
504
504
  userStatsAccountPublicKey: this.userStatsAccountPublicKey,
505
505
  accountSubscription: this.userStatsAccountSubscriptionConfig,
506
506
  });
@@ -2756,7 +2756,7 @@ class VelocityClient {
2756
2756
  }
2757
2757
  }
2758
2758
  else if (isSignedMsg) {
2759
- // Order hasn't been placed yet, we cant tell if it has a builder or not.
2759
+ // Order hasn't been placed yet, we can't tell if it has a builder or not.
2760
2760
  // Include it optimistically
2761
2761
  withBuilder = true;
2762
2762
  }
@@ -56,14 +56,16 @@ export type VelocityClientConfig = {
56
56
  };
57
57
  /** @deprecated Use `VelocityClientConfig` instead. `DriftClientConfig` will be removed in a future major. */
58
58
  export type DriftClientConfig = VelocityClientConfig;
59
+ type GrpcVelocityClientAccountSubscriberCtor = new (grpcConfigs: GrpcConfigs, program: Program, perpMarketIndexes: number[], spotMarketIndexes: number[], oracleInfos: OracleInfo[], shouldFindAllMarketsAndOracles: boolean, delistedMarketSetting: DelistedMarketSetting) => grpcVelocityClientAccountSubscriberV2 | grpcVelocityClientAccountSubscriber;
60
+ type WsVelocityClientAccountSubscriberCtor = new (program: Program, perpMarketIndexes: number[], spotMarketIndexes: number[], oracleInfos: OracleInfo[], shouldFindAllMarketsAndOracles: boolean, delistedMarketSetting: DelistedMarketSetting) => WebSocketVelocityClientAccountSubscriber | WebSocketVelocityClientAccountSubscriberV2;
59
61
  export type VelocityClientSubscriptionConfig = {
60
62
  type: 'grpc';
61
63
  grpcConfigs: GrpcConfigs;
62
64
  resubTimeoutMs?: number;
63
65
  logResubMessages?: boolean;
64
- velocityClientAccountSubscriber?: new (grpcConfigs: GrpcConfigs, program: Program, perpMarketIndexes: number[], spotMarketIndexes: number[], oracleInfos: OracleInfo[], shouldFindAllMarketsAndOracles: boolean, delistedMarketSetting: DelistedMarketSetting) => grpcVelocityClientAccountSubscriberV2 | grpcVelocityClientAccountSubscriber;
66
+ velocityClientAccountSubscriber?: GrpcVelocityClientAccountSubscriberCtor;
65
67
  /** @deprecated Use `velocityClientAccountSubscriber` instead. `driftClientAccountSubscriber` will be removed in a future major. */
66
- driftClientAccountSubscriber?: new (grpcConfigs: GrpcConfigs, program: Program, perpMarketIndexes: number[], spotMarketIndexes: number[], oracleInfos: OracleInfo[], shouldFindAllMarketsAndOracles: boolean, delistedMarketSetting: DelistedMarketSetting) => grpcVelocityClientAccountSubscriberV2 | grpcVelocityClientAccountSubscriber;
68
+ driftClientAccountSubscriber?: GrpcVelocityClientAccountSubscriberCtor;
67
69
  grpcMultiUserAccountSubscriber?: grpcMultiUserAccountSubscriber;
68
70
  } | {
69
71
  type: 'websocket';
@@ -73,12 +75,13 @@ export type VelocityClientSubscriptionConfig = {
73
75
  programUserAccountSubscriber?: WebSocketProgramAccountSubscriber<UserAccount>;
74
76
  perpMarketAccountSubscriber?: new (accountName: string, program: Program, accountPublicKey: PublicKey, decodeBuffer?: (buffer: Buffer) => any, resubOpts?: ResubOpts, commitment?: Commitment) => WebSocketAccountSubscriberV2<any> | WebSocketAccountSubscriber<any>;
75
77
  /** If you use V2 here, whatever you pass for perpMarketAccountSubscriber will be ignored and it will use v2 under the hood regardless */
76
- velocityClientAccountSubscriber?: new (program: Program, perpMarketIndexes: number[], spotMarketIndexes: number[], oracleInfos: OracleInfo[], shouldFindAllMarketsAndOracles: boolean, delistedMarketSetting: DelistedMarketSetting) => WebSocketVelocityClientAccountSubscriber | WebSocketVelocityClientAccountSubscriberV2;
78
+ velocityClientAccountSubscriber?: WsVelocityClientAccountSubscriberCtor;
77
79
  /** @deprecated Use `velocityClientAccountSubscriber` instead. `driftClientAccountSubscriber` will be removed in a future major. */
78
- driftClientAccountSubscriber?: new (program: Program, perpMarketIndexes: number[], spotMarketIndexes: number[], oracleInfos: OracleInfo[], shouldFindAllMarketsAndOracles: boolean, delistedMarketSetting: DelistedMarketSetting) => WebSocketVelocityClientAccountSubscriber | WebSocketVelocityClientAccountSubscriberV2;
80
+ driftClientAccountSubscriber?: WsVelocityClientAccountSubscriberCtor;
79
81
  } | {
80
82
  type: 'polling';
81
83
  accountLoader: BulkAccountLoader;
82
84
  };
83
85
  /** @deprecated Use `VelocityClientSubscriptionConfig` instead. `DriftClientSubscriptionConfig` will be removed in a future major. */
84
86
  export type DriftClientSubscriptionConfig = VelocityClientSubscriptionConfig;
87
+ export {};
@@ -3,12 +3,14 @@ import { AuctionSubscriberConfig, AuctionSubscriberEvents } from './types';
3
3
  import StrictEventEmitter from 'strict-event-emitter-types';
4
4
  import { EventEmitter } from 'events';
5
5
  export declare class AuctionSubscriber {
6
- private driftClient;
6
+ private velocityClient;
7
+ /** @deprecated Use `velocityClient` instead. `driftClient` will be removed in a future major. */
8
+ private get driftClient();
7
9
  private opts;
8
10
  private resubOpts?;
9
11
  eventEmitter: StrictEventEmitter<EventEmitter, AuctionSubscriberEvents>;
10
12
  private subscriber;
11
- constructor({ driftClient, opts, resubTimeoutMs, logResubMessages, }: AuctionSubscriberConfig);
13
+ constructor({ velocityClient, driftClient, opts, resubTimeoutMs, logResubMessages, }: AuctionSubscriberConfig);
12
14
  subscribe(): Promise<void>;
13
15
  unsubscribe(): Promise<void>;
14
16
  }
@@ -1 +1 @@
1
- {"version":3,"file":"auctionSubscriber.d.ts","sourceRoot":"","sources":["../../../src/auctionSubscriber/auctionSubscriber.ts"],"names":[],"mappings":";AAAA,OAAO,EAAE,uBAAuB,EAAE,uBAAuB,EAAE,MAAM,SAAS,CAAC;AAG3E,OAAO,kBAAkB,MAAM,4BAA4B,CAAC;AAC5D,OAAO,EAAE,YAAY,EAAE,MAAM,QAAQ,CAAC;AAMtC,qBAAa,iBAAiB;IAC7B,OAAO,CAAC,WAAW,CAAiB;IACpC,OAAO,CAAC,IAAI,CAAiB;IAC7B,OAAO,CAAC,SAAS,CAAC,CAAY;IAE9B,YAAY,EAAE,kBAAkB,CAAC,YAAY,EAAE,uBAAuB,CAAC,CAAC;IACxE,OAAO,CAAC,UAAU,CAAiD;gBAEvD,EACX,WAAW,EACX,IAAI,EACJ,cAAc,EACd,gBAAgB,GAChB,EAAE,uBAAuB;IAOb,SAAS;IA+BT,WAAW;CAMxB"}
1
+ {"version":3,"file":"auctionSubscriber.d.ts","sourceRoot":"","sources":["../../../src/auctionSubscriber/auctionSubscriber.ts"],"names":[],"mappings":";AAAA,OAAO,EAAE,uBAAuB,EAAE,uBAAuB,EAAE,MAAM,SAAS,CAAC;AAG3E,OAAO,kBAAkB,MAAM,4BAA4B,CAAC;AAC5D,OAAO,EAAE,YAAY,EAAE,MAAM,QAAQ,CAAC;AAMtC,qBAAa,iBAAiB;IAC7B,OAAO,CAAC,cAAc,CAAiB;IACvC,iGAAiG;IACjG,OAAO,KAAK,WAAW,GAEtB;IACD,OAAO,CAAC,IAAI,CAAiB;IAC7B,OAAO,CAAC,SAAS,CAAC,CAAY;IAE9B,YAAY,EAAE,kBAAkB,CAAC,YAAY,EAAE,uBAAuB,CAAC,CAAC;IACxE,OAAO,CAAC,UAAU,CAAiD;gBAEvD,EACX,cAAc,EACd,WAAW,EACX,IAAI,EACJ,cAAc,EACd,gBAAgB,GAChB,EAAE,uBAAuB;IAQb,SAAS;IA+BT,WAAW;CAMxB"}
@@ -5,15 +5,20 @@ const memcmp_1 = require("../memcmp");
5
5
  const events_1 = require("events");
6
6
  const webSocketProgramAccountSubscriber_1 = require("../accounts/webSocketProgramAccountSubscriber");
7
7
  class AuctionSubscriber {
8
- constructor({ driftClient, opts, resubTimeoutMs, logResubMessages, }) {
9
- this.driftClient = driftClient;
10
- this.opts = opts || this.driftClient.opts;
8
+ /** @deprecated Use `velocityClient` instead. `driftClient` will be removed in a future major. */
9
+ get driftClient() {
10
+ return this.velocityClient;
11
+ }
12
+ constructor({ velocityClient, driftClient, opts, resubTimeoutMs, logResubMessages, }) {
13
+ // Type-system guarantees at least one of the two is supplied.
14
+ this.velocityClient = (velocityClient !== null && velocityClient !== void 0 ? velocityClient : driftClient);
15
+ this.opts = opts || this.velocityClient.opts;
11
16
  this.eventEmitter = new events_1.EventEmitter();
12
17
  this.resubOpts = { resubTimeoutMs, logResubMessages };
13
18
  }
14
19
  async subscribe() {
15
20
  if (!this.subscriber) {
16
- this.subscriber = new webSocketProgramAccountSubscriber_1.WebSocketProgramAccountSubscriber('AuctionSubscriber', 'user', this.driftClient.program, this.driftClient.program.account.user.coder.accounts.decode.bind(this.driftClient.program.account.user.coder.accounts), {
21
+ this.subscriber = new webSocketProgramAccountSubscriber_1.WebSocketProgramAccountSubscriber('AuctionSubscriber', 'user', this.velocityClient.program, this.velocityClient.program.account.user.coder.accounts.decode.bind(this.velocityClient.program.account.user.coder.accounts), {
17
22
  filters: [(0, memcmp_1.getUserFilter)(), (0, memcmp_1.getUserWithAuctionFilter)()],
18
23
  commitment: this.opts.commitment,
19
24
  }, this.resubOpts);
@@ -3,13 +3,15 @@ import { AuctionSubscriberConfig, AuctionSubscriberEvents } from './types';
3
3
  import StrictEventEmitter from 'strict-event-emitter-types';
4
4
  import { EventEmitter } from 'events';
5
5
  export declare class AuctionSubscriberGrpc {
6
- private driftClient;
6
+ private velocityClient;
7
+ /** @deprecated Use `velocityClient` instead. `driftClient` will be removed in a future major. */
8
+ private get driftClient();
7
9
  private opts;
8
10
  private resubOpts?;
9
11
  private grpcConfigs?;
10
12
  eventEmitter: StrictEventEmitter<EventEmitter, AuctionSubscriberEvents>;
11
13
  private subscriber;
12
- constructor({ driftClient, opts, grpcConfigs, resubTimeoutMs, logResubMessages, }: AuctionSubscriberConfig);
14
+ constructor({ velocityClient, driftClient, opts, grpcConfigs, resubTimeoutMs, logResubMessages, }: AuctionSubscriberConfig);
13
15
  subscribe(): Promise<void>;
14
16
  unsubscribe(): Promise<void>;
15
17
  }
@@ -1 +1 @@
1
- {"version":3,"file":"auctionSubscriberGrpc.d.ts","sourceRoot":"","sources":["../../../src/auctionSubscriber/auctionSubscriberGrpc.ts"],"names":[],"mappings":";AAAA,OAAO,EAAE,uBAAuB,EAAE,uBAAuB,EAAE,MAAM,SAAS,CAAC;AAG3E,OAAO,kBAAkB,MAAM,4BAA4B,CAAC;AAC5D,OAAO,EAAE,YAAY,EAAE,MAAM,QAAQ,CAAC;AAOtC,qBAAa,qBAAqB;IACjC,OAAO,CAAC,WAAW,CAAiB;IACpC,OAAO,CAAC,IAAI,CAAiB;IAC7B,OAAO,CAAC,SAAS,CAAC,CAAY;IAC9B,OAAO,CAAC,WAAW,CAAC,CAAc;IAElC,YAAY,EAAE,kBAAkB,CAAC,YAAY,EAAE,uBAAuB,CAAC,CAAC;IACxE,OAAO,CAAC,UAAU,CAAiD;gBAEvD,EACX,WAAW,EACX,IAAI,EACJ,WAAW,EACX,cAAc,EACd,gBAAgB,GAChB,EAAE,uBAAuB;IAQb,SAAS;IA+BT,WAAW;CAMxB"}
1
+ {"version":3,"file":"auctionSubscriberGrpc.d.ts","sourceRoot":"","sources":["../../../src/auctionSubscriber/auctionSubscriberGrpc.ts"],"names":[],"mappings":";AAAA,OAAO,EAAE,uBAAuB,EAAE,uBAAuB,EAAE,MAAM,SAAS,CAAC;AAG3E,OAAO,kBAAkB,MAAM,4BAA4B,CAAC;AAC5D,OAAO,EAAE,YAAY,EAAE,MAAM,QAAQ,CAAC;AAOtC,qBAAa,qBAAqB;IACjC,OAAO,CAAC,cAAc,CAAiB;IACvC,iGAAiG;IACjG,OAAO,KAAK,WAAW,GAEtB;IACD,OAAO,CAAC,IAAI,CAAiB;IAC7B,OAAO,CAAC,SAAS,CAAC,CAAY;IAC9B,OAAO,CAAC,WAAW,CAAC,CAAc;IAElC,YAAY,EAAE,kBAAkB,CAAC,YAAY,EAAE,uBAAuB,CAAC,CAAC;IACxE,OAAO,CAAC,UAAU,CAAiD;gBAEvD,EACX,cAAc,EACd,WAAW,EACX,IAAI,EACJ,WAAW,EACX,cAAc,EACd,gBAAgB,GAChB,EAAE,uBAAuB;IASb,SAAS;IA+BT,WAAW;CAMxB"}
@@ -5,16 +5,21 @@ const memcmp_1 = require("../memcmp");
5
5
  const events_1 = require("events");
6
6
  const grpcProgramAccountSubscriber_1 = require("../accounts/grpcProgramAccountSubscriber");
7
7
  class AuctionSubscriberGrpc {
8
- constructor({ driftClient, opts, grpcConfigs, resubTimeoutMs, logResubMessages, }) {
9
- this.driftClient = driftClient;
10
- this.opts = opts || this.driftClient.opts;
8
+ /** @deprecated Use `velocityClient` instead. `driftClient` will be removed in a future major. */
9
+ get driftClient() {
10
+ return this.velocityClient;
11
+ }
12
+ constructor({ velocityClient, driftClient, opts, grpcConfigs, resubTimeoutMs, logResubMessages, }) {
13
+ // Type-system guarantees at least one of the two is supplied.
14
+ this.velocityClient = (velocityClient !== null && velocityClient !== void 0 ? velocityClient : driftClient);
15
+ this.opts = opts || this.velocityClient.opts;
11
16
  this.eventEmitter = new events_1.EventEmitter();
12
17
  this.resubOpts = { resubTimeoutMs, logResubMessages };
13
18
  this.grpcConfigs = grpcConfigs;
14
19
  }
15
20
  async subscribe() {
16
21
  if (!this.subscriber) {
17
- this.subscriber = await grpcProgramAccountSubscriber_1.grpcProgramAccountSubscriber.create(this.grpcConfigs, 'AuctionSubscriber', 'user', this.driftClient.program, this.driftClient.program.account.user.coder.accounts.decode.bind(this.driftClient.program.account.user.coder.accounts), {
22
+ this.subscriber = await grpcProgramAccountSubscriber_1.grpcProgramAccountSubscriber.create(this.grpcConfigs, 'AuctionSubscriber', 'user', this.velocityClient.program, this.velocityClient.program.account.user.coder.accounts.decode.bind(this.velocityClient.program.account.user.coder.accounts), {
18
23
  filters: [(0, memcmp_1.getUserFilter)(), (0, memcmp_1.getUserWithAuctionFilter)()],
19
24
  }, this.resubOpts);
20
25
  }
@@ -2,14 +2,16 @@ import { GrpcConfigs } from '../accounts/types';
2
2
  import { VelocityClient } from '../velocityClient';
3
3
  import { UserAccount } from '../types';
4
4
  import { ConfirmOptions, PublicKey } from '@solana/web3.js';
5
- export type AuctionSubscriberConfig = {
6
- driftClient: VelocityClient;
5
+ import { AtLeastOne } from '../util/deprecatedAlias';
6
+ type AuctionSubscriberConfigBase = {
7
7
  opts?: ConfirmOptions;
8
8
  resubTimeoutMs?: number;
9
9
  logResubMessages?: boolean;
10
10
  grpcConfigs?: GrpcConfigs;
11
11
  };
12
+ export type AuctionSubscriberConfig = AuctionSubscriberConfigBase & AtLeastOne<'velocityClient', 'driftClient', VelocityClient>;
12
13
  export interface AuctionSubscriberEvents {
13
14
  onAccountUpdate: (account: UserAccount, pubkey: PublicKey, slot: number) => void;
14
15
  }
16
+ export {};
15
17
  //# sourceMappingURL=types.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../src/auctionSubscriber/types.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,MAAM,mBAAmB,CAAC;AAChD,OAAO,EAAE,cAAc,EAAE,MAAM,mBAAmB,CAAC;AACnD,OAAO,EAAE,WAAW,EAAE,MAAM,UAAU,CAAC;AACvC,OAAO,EAAE,cAAc,EAAE,SAAS,EAAE,MAAM,iBAAiB,CAAC;AAE5D,MAAM,MAAM,uBAAuB,GAAG;IACrC,WAAW,EAAE,cAAc,CAAC;IAC5B,IAAI,CAAC,EAAE,cAAc,CAAC;IACtB,cAAc,CAAC,EAAE,MAAM,CAAC;IACxB,gBAAgB,CAAC,EAAE,OAAO,CAAC;IAC3B,WAAW,CAAC,EAAE,WAAW,CAAC;CAC1B,CAAC;AAEF,MAAM,WAAW,uBAAuB;IACvC,eAAe,EAAE,CAChB,OAAO,EAAE,WAAW,EACpB,MAAM,EAAE,SAAS,EACjB,IAAI,EAAE,MAAM,KACR,IAAI,CAAC;CACV"}
1
+ {"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../src/auctionSubscriber/types.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,MAAM,mBAAmB,CAAC;AAChD,OAAO,EAAE,cAAc,EAAE,MAAM,mBAAmB,CAAC;AACnD,OAAO,EAAE,WAAW,EAAE,MAAM,UAAU,CAAC;AACvC,OAAO,EAAE,cAAc,EAAE,SAAS,EAAE,MAAM,iBAAiB,CAAC;AAC5D,OAAO,EAAE,UAAU,EAAE,MAAM,yBAAyB,CAAC;AAErD,KAAK,2BAA2B,GAAG;IAClC,IAAI,CAAC,EAAE,cAAc,CAAC;IACtB,cAAc,CAAC,EAAE,MAAM,CAAC;IACxB,gBAAgB,CAAC,EAAE,OAAO,CAAC;IAC3B,WAAW,CAAC,EAAE,WAAW,CAAC;CAC1B,CAAC;AAEF,MAAM,MAAM,uBAAuB,GAAG,2BAA2B,GAChE,UAAU,CAAC,gBAAgB,EAAE,aAAa,EAAE,cAAc,CAAC,CAAC;AAE7D,MAAM,WAAW,uBAAuB;IACvC,eAAe,EAAE,CAChB,OAAO,EAAE,WAAW,EACpB,MAAM,EAAE,SAAS,EACjB,IAAI,EAAE,MAAM,KACR,IAAI,CAAC;CACV"}
@@ -11,6 +11,8 @@ export type DriftProgram = VelocityProgram;
11
11
  export type VelocityEnv = 'devnet' | 'mainnet-beta';
12
12
  /** @deprecated Use `VelocityEnv` instead. `DriftEnv` will be removed in a future major. */
13
13
  export type DriftEnv = VelocityEnv;
14
+ /** Widened env type accepted by `initialize()`; `'master'` is a legacy alias for `'devnet'`. */
15
+ export type LegacyVelocityEnv = VelocityEnv | 'master';
14
16
  export interface VelocityConfig {
15
17
  ENV: VelocityEnv;
16
18
  PYTH_ORACLE_MAPPING_ADDRESS: string;
@@ -50,15 +52,8 @@ export declare const configs: {
50
52
  [key in VelocityEnv]: VelocityConfig;
51
53
  };
52
54
  export declare const getConfig: () => VelocityConfig;
53
- /**
54
- * Allows customization of the SDK's environment and endpoints. You can pass individual settings to override the settings with your own presets.
55
- *
56
- * Defaults to master environment if you don't use this function.
57
- * @param props
58
- * @returns
59
- */
60
55
  export declare const initialize: (props: {
61
- env: VelocityEnv;
56
+ env: LegacyVelocityEnv;
62
57
  overrideEnv?: Partial<VelocityConfig>;
63
58
  }) => VelocityConfig;
64
59
  export declare function getMarketsAndOraclesForSubscription(env: VelocityEnv, perpMarkets?: PerpMarketConfig[], spotMarkets?: SpotMarketConfig[]): {
@@ -1 +1 @@
1
- {"version":3,"file":"config.d.ts","sourceRoot":"","sources":["../../src/config.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,cAAc,EAAE,SAAS,EAAE,MAAM,iBAAiB,CAAC;AAC5D,OAAO,EAAE,iBAAiB,EAAE,iBAAiB,EAAE,MAAM,SAAS,CAAC;AAC/D,OAAO,EAGN,gBAAgB,EAEhB,MAAM,yBAAyB,CAAC;AAC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EAAE,MAAM,EAAE,CAAC;IAC5B,WAAW,EAAE,UAAU,EAAE,CAAC;IAC1B,kBAAkB,EAAE,iBAAiB,EAAE,CAAC;CACxC,CAAC,CA4CD"}
@@ -75,31 +75,23 @@ exports.getConfig = getConfig;
75
75
  * @param props
76
76
  * @returns
77
77
  */
78
+ /**
79
+ * Mirror a canonical/deprecated alias pair so the resolved config carries the
80
+ * same value under both keys regardless of which one the caller overrode.
81
+ */
82
+ const mirrorAlias = (merged, override, canon, deprecated) => {
83
+ var _a, _b;
84
+ const value = (_b = (_a = override[canon]) !== null && _a !== void 0 ? _a : override[deprecated]) !== null && _b !== void 0 ? _b : merged[canon];
85
+ merged[canon] = value;
86
+ merged[deprecated] = value;
87
+ };
78
88
  const initialize = (props) => {
79
89
  var _a;
80
90
  const override = (_a = props.overrideEnv) !== null && _a !== void 0 ? _a : {};
81
- //@ts-ignore
82
- const base = props.env === 'master' ? exports.configs['devnet'] : exports.configs[props.env];
83
- const merged = { ...base, ...override };
84
- const overrodeVelocity = 'VELOCITY_PROGRAM_ID' in override;
85
- const overrodeDrift = 'DRIFT_PROGRAM_ID' in override;
86
- if (overrodeVelocity && !overrodeDrift) {
87
- merged.DRIFT_PROGRAM_ID = merged.VELOCITY_PROGRAM_ID;
88
- }
89
- else if (overrodeDrift && !overrodeVelocity) {
90
- merged.VELOCITY_PROGRAM_ID = merged.DRIFT_PROGRAM_ID;
91
- }
92
- const overrodeVelocityOracleReceiver = 'VELOCITY_ORACLE_RECEIVER_ID' in override;
93
- const overrodeDriftOracleReceiver = 'DRIFT_ORACLE_RECEIVER_ID' in override;
94
- if (overrodeVelocityOracleReceiver && !overrodeDriftOracleReceiver) {
95
- merged.DRIFT_ORACLE_RECEIVER_ID = merged.VELOCITY_ORACLE_RECEIVER_ID;
96
- }
97
- else if (overrodeDriftOracleReceiver && !overrodeVelocityOracleReceiver) {
98
- merged.VELOCITY_ORACLE_RECEIVER_ID = merged.DRIFT_ORACLE_RECEIVER_ID;
99
- }
100
- //@ts-ignore
101
- if (props.env === 'master')
102
- return merged;
91
+ const normalizedEnv = props.env === 'master' ? 'devnet' : props.env;
92
+ const merged = { ...exports.configs[normalizedEnv], ...override };
93
+ mirrorAlias(merged, override, 'VELOCITY_PROGRAM_ID', 'DRIFT_PROGRAM_ID');
94
+ mirrorAlias(merged, override, 'VELOCITY_ORACLE_RECEIVER_ID', 'DRIFT_ORACLE_RECEIVER_ID');
103
95
  currentConfig = merged;
104
96
  return currentConfig;
105
97
  };
@@ -3,7 +3,9 @@ import { DataAndSlot } from '../accounts/types';
3
3
  import { ConstituentAccount } from '../types';
4
4
  import { VelocityClient } from '../velocityClient';
5
5
  export type ConstituentMapConfig = {
6
- driftClient: VelocityClient;
6
+ velocityClient?: VelocityClient;
7
+ /** @deprecated Use `velocityClient` instead. `driftClient` will be removed in a future major. */
8
+ driftClient?: VelocityClient;
7
9
  connection?: Connection;
8
10
  subscriptionConfig: {
9
11
  type: 'polling';
@@ -31,7 +33,7 @@ export interface ConstituentMapInterface {
31
33
  mustGetWithSlot(key: string): Promise<DataAndSlot<ConstituentAccount>>;
32
34
  }
33
35
  export declare class ConstituentMap implements ConstituentMapInterface {
34
- private driftClient;
36
+ private velocityClient;
35
37
  private constituentMap;
36
38
  private constituentAccountSubscriber;
37
39
  private additionalFilters?;
@@ -1 +1 @@
1
- {"version":3,"file":"constituentMap.d.ts","sourceRoot":"","sources":["../../../src/constituentMap/constituentMap.ts"],"names":[],"mappings":"AAAA,OAAO,EACN,UAAU,EACV,UAAU,EACV,YAAY,EAGZ,MAAM,iBAAiB,CAAC;AACzB,OAAO,EAAgC,WAAW,EAAE,MAAM,mBAAmB,CAAC;AAC9E,OAAO,EAAE,kBAAkB,EAAE,MAAM,UAAU,CAAC;AAG9C,OAAO,EAAE,cAAc,EAAE,MAAM,mBAAmB,CAAC;AAOnD,MAAM,MAAM,oBAAoB,GAAG;IAClC,WAAW,EAAE,cAAc,CAAC;IAC5B,UAAU,CAAC,EAAE,UAAU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,kBAAkB,GAAG,SAAS;IAK1B,WAAW,CAAC,GAAG,EAAE,MAAM,GAAG,WAAW,CAAC,kBAAkB,CAAC,GAAG,SAAS;IAI/D,OAAO,CAAC,GAAG,EAAE,MAAM,GAAG,OAAO,CAAC,kBAAkB,CAAC;IAWjD,eAAe,CAC3B,GAAG,EAAE,MAAM,GACT,OAAO,CAAC,WAAW,CAAC,kBAAkB,CAAC,CAAC;IAWpC,IAAI,IAAI,MAAM;IAIb,MAAM,IAAI,gBAAgB,CAAC,kBAAkB,CAAC;IAM/C,cAAc,IAAI,gBAAgB,CAAC,WAAW,CAAC,kBAAkB,CAAC,CAAC;IAIlE,OAAO,IAAI,gBAAgB,CAAC,CAAC,MAAM,EAAE,kBAAkB,CAAC,CAAC;IAM1D,eAAe,IAAI,gBAAgB,CACzC;QAAC,MAAM;QAAE,WAAW,CAAC,kBAAkB,CAAC;KAAC,CACzC;IAIM,wBAAwB,CAC9B,GAAG,EAAE,MAAM,EACX,kBAAkB,EAAE,kBAAkB,EACtC,IAAI,EAAE,MAAM,GACV,IAAI;CAkBP"}
@@ -9,23 +9,27 @@ const pda_1 = require("../addresses/pda");
9
9
  const MAX_CONSTITUENT_SIZE_BYTES = 480; // TODO: update this when account is finalized
10
10
  class ConstituentMap {
11
11
  constructor(config) {
12
- var _a, _b;
12
+ var _a, _b, _c;
13
13
  this.constituentMap = new Map();
14
14
  this.constituentIndexToKeyMap = new Map();
15
15
  this.spotMarketIndexToKeyMap = new Map();
16
- this.driftClient = config.driftClient;
16
+ const velocityClient = (_a = config.velocityClient) !== null && _a !== void 0 ? _a : config.driftClient;
17
+ if (!velocityClient) {
18
+ throw new Error('ConstituentMap: velocityClient (or deprecated driftClient) must be provided');
19
+ }
20
+ this.velocityClient = velocityClient;
17
21
  this.additionalFilters = config.additionalFilters;
18
22
  this.commitment = config.subscriptionConfig.commitment;
19
- this.connection = config.connection || this.driftClient.connection;
20
- this.lpPoolId = (_a = config.lpPoolId) !== null && _a !== void 0 ? _a : 0;
21
- this.decoder = (_b = config.decoder) !== null && _b !== void 0 ? _b : 'base64+zstd';
23
+ this.connection = config.connection || this.velocityClient.connection;
24
+ this.lpPoolId = (_b = config.lpPoolId) !== null && _b !== void 0 ? _b : 0;
25
+ this.decoder = (_c = config.decoder) !== null && _c !== void 0 ? _c : 'base64+zstd';
22
26
  if (config.subscriptionConfig.type === 'polling') {
23
27
  this.constituentAccountSubscriber =
24
- new pollingConstituentAccountSubscriber_1.PollingConstituentAccountSubscriber(this, this.driftClient.program, config.subscriptionConfig.frequency, config.subscriptionConfig.commitment, this.getFilters());
28
+ new pollingConstituentAccountSubscriber_1.PollingConstituentAccountSubscriber(this, this.velocityClient.program, config.subscriptionConfig.frequency, config.subscriptionConfig.commitment, this.getFilters());
25
29
  }
26
30
  else if (config.subscriptionConfig.type === 'websocket') {
27
31
  this.constituentAccountSubscriber =
28
- new webSocketConstituentAccountSubscriber_1.WebSocketConstituentAccountSubscriber(this, this.driftClient.program, config.subscriptionConfig.resubTimeoutMs, config.subscriptionConfig.commitment, this.getFilters());
32
+ new webSocketConstituentAccountSubscriber_1.WebSocketConstituentAccountSubscriber(this, this.velocityClient.program, config.subscriptionConfig.resubTimeoutMs, config.subscriptionConfig.commitment, this.getFilters());
29
33
  }
30
34
  // Listen for account updates from the subscriber
31
35
  this.constituentAccountSubscriber.eventEmitter.on('onAccountUpdate', (account, pubkey, slot) => {
@@ -35,7 +39,7 @@ class ConstituentMap {
35
39
  getFilters() {
36
40
  const filters = [
37
41
  (0, memcmp_1.getConstituentFilter)(),
38
- (0, memcmp_1.getConstituentLpPoolFilter)((0, pda_1.getLpPoolPublicKey)(this.driftClient.program.programId, this.lpPoolId)),
42
+ (0, memcmp_1.getConstituentLpPoolFilter)((0, pda_1.getLpPoolPublicKey)(this.velocityClient.program.programId, this.lpPoolId)),
39
43
  ];
40
44
  if (this.additionalFilters) {
41
45
  filters.push(...this.additionalFilters);
@@ -43,12 +47,12 @@ class ConstituentMap {
43
47
  return filters;
44
48
  }
45
49
  decode(name, buffer) {
46
- return this.driftClient.program.account.constituent.coder.accounts.decodeUnchecked(name, buffer);
50
+ return this.velocityClient.program.account.constituent.coder.accounts.decodeUnchecked(name, buffer);
47
51
  }
48
52
  async sync() {
49
53
  try {
50
54
  const rpcRequestArgs = [
51
- this.driftClient.program.programId.toBase58(),
55
+ this.velocityClient.program.programId.toBase58(),
52
56
  {
53
57
  commitment: this.commitment,
54
58
  filters: this.getFilters(),
@@ -224,4 +224,8 @@ export declare class VelocityCore {
224
224
  */
225
225
  static buildInstructions(_ctx: VelocityCoreContext): TransactionInstruction[];
226
226
  }
227
+ /** @deprecated Use `VelocityCore` instead. `DriftCore` will be removed in a future major. */
228
+ export declare const DriftCore: typeof VelocityCore;
229
+ /** @deprecated Use `VelocityCore` instead. `DriftCore` will be removed in a future major. */
230
+ export type DriftCore = VelocityCore;
227
231
  //# sourceMappingURL=VelocityCore.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"VelocityCore.d.ts","sourceRoot":"","sources":["../../../src/core/VelocityCore.ts"],"names":[],"mappings":";;;AAAA,OAAO,KAAK,EACX,WAAW,EACX,UAAU,EACV,SAAS,EACT,sBAAsB,EACtB,MAAM,iBAAiB,CAAC;AAEzB,OAAO,KAAK,IAAI,MAAM,kBAAkB,CAAC;AACzC,OAAO,KAAK,SAAS,MAAM,cAAc,CAAC;AAE1C,OAAO,EAAE,gBAAgB,EAAE,MAAM,uBAAuB,CAAC;AAEzD,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,cAAc,CAAC;AAC1C,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,UAAU,CAAC;AAC5C,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,WAAW,CAAC;AAEjD,OAAO,KAAK,EAAE,EAAE,EAAE,MAAM,mBAAmB,CAAC;AAsB5C,OAAO,KAAK,iBAAiB,MAAM,qBAAqB,CAAC;AACzD,OAAO,KAAK,SAAS,MAAM,aAAa,CAAC;AAEzC,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AC;QACzB,eAAe,EAAE,MAAM,CAAC;QACxB,KAAK,EAAE,SAAS,CAAC;QACjB,UAAU,EAAE,SAAS,CAAC;QACtB,MAAM,EAAE,SAAS,CAAC;KAClB,GAAG,OAAO,CAAC,sBAAsB,CAAC;IAInC;;;;;OAKG;IACH,MAAM,CAAC,iBAAiB,CACvB,IAAI,EAAE,mBAAmB,GACvB,sBAAsB,EAAE;CAG3B;AAED,6FAA6F;AAC7F,eAAO,MAAM,SAAS,qBAAe,CAAC;AAEtC,6FAA6F;AAC7F,MAAM,MAAM,SAAS,GAAG,YAAY,CAAC"}
@@ -26,7 +26,7 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
26
26
  return (mod && mod.__esModule) ? mod : { "default": mod };
27
27
  };
28
28
  Object.defineProperty(exports, "__esModule", { value: true });
29
- exports.VelocityCore = void 0;
29
+ exports.DriftCore = exports.VelocityCore = void 0;
30
30
  const pdas = __importStar(require("../addresses/pda"));
31
31
  const constants = __importStar(require("../constants"));
32
32
  const user_1 = require("../decode/user");
@@ -136,3 +136,5 @@ VelocityCore.constants = constants;
136
136
  /** Re-export remaining-accounts logic (pure). */
137
137
  VelocityCore.remainingAccounts = remainingAccounts;
138
138
  VelocityCore.signedMsg = signedMsg;
139
+ /** @deprecated Use `VelocityCore` instead. `DriftCore` will be removed in a future major. */
140
+ exports.DriftCore = VelocityCore;
@@ -120,8 +120,8 @@ function decodeUser(buffer) {
120
120
  const orders = [];
121
121
  for (let i = 0; i < 32; i++) {
122
122
  // skip order if it's not open
123
- if (buffer.readUint8(offset + 82) !== 1) {
124
- offset += 96;
123
+ if (buffer.readUint8(offset + 86) !== 1) {
124
+ offset += 104;
125
125
  continue;
126
126
  }
127
127
  const slot = readUnsignedBigInt64LE(buffer, offset);
@@ -142,8 +142,8 @@ function decodeUser(buffer) {
142
142
  offset += 8;
143
143
  const maxTs = readSignedBigInt64LE(buffer, offset);
144
144
  offset += 8;
145
- const oraclePriceOffset = buffer.readInt32LE(offset);
146
- offset += 4;
145
+ const oraclePriceOffset = readSignedBigInt64LE(buffer, offset);
146
+ offset += 8;
147
147
  const orderId = buffer.readUInt32LE(offset);
148
148
  offset += 4;
149
149
  const marketIndex = buffer.readUInt16LE(offset);
@@ -231,7 +231,7 @@ function decodeUser(buffer) {
231
231
  offset += 1;
232
232
  const bitFlags = buffer.readUint8(offset);
233
233
  offset += 1;
234
- offset += 1; // padding
234
+ offset += 5; // padding
235
235
  orders.push({
236
236
  slot,
237
237
  price,
@@ -181,7 +181,7 @@ class DLOB {
181
181
  else if ((0, types_1.isOneOfVariant)(order.orderType, ['market', 'triggerMarket', 'oracle'])) {
182
182
  type = 'market';
183
183
  }
184
- else if (order.oraclePriceOffset !== 0) {
184
+ else if (!order.oraclePriceOffset.eq(numericConstants_1.ZERO)) {
185
185
  type = 'floatingLimit';
186
186
  }
187
187
  else {
@@ -1,7 +1,6 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.createNode = exports.SignedMsgOrderNode = exports.TriggerOrderNode = exports.MarketOrderNode = exports.FloatingLimitOrderNode = exports.RestingLimitOrderNode = exports.TakingLimitOrderNode = exports.OrderNode = void 0;
4
- const anchor_1 = require("../isomorphic/anchor");
5
4
  const numericConstants_1 = require("../constants/numericConstants");
6
5
  const orders_1 = require("../math/orders");
7
6
  const types_1 = require("../types");
@@ -56,7 +55,7 @@ class RestingLimitOrderNode extends OrderNode {
56
55
  exports.RestingLimitOrderNode = RestingLimitOrderNode;
57
56
  class FloatingLimitOrderNode extends OrderNode {
58
57
  getSortValue(order) {
59
- return new anchor_1.BN(order.oraclePriceOffset);
58
+ return order.oraclePriceOffset;
60
59
  }
61
60
  }
62
61
  exports.FloatingLimitOrderNode = FloatingLimitOrderNode;
@@ -9,7 +9,9 @@ import { MarketType } from '../types';
9
9
  import { L2OrderBook, L2OrderBookGenerator, L3OrderBook } from './orderBookLevels';
10
10
  import { BN } from '../isomorphic/anchor';
11
11
  export declare class DLOBSubscriber {
12
- driftClient: VelocityClient;
12
+ velocityClient: VelocityClient;
13
+ /** @deprecated Use `velocityClient` instead. `driftClient` will be removed in a future major. */
14
+ get driftClient(): VelocityClient;
13
15
  dlobSource: DLOBSource;
14
16
  slotSource: SlotSource;
15
17
  updateFrequency: number;
@@ -1 +1 @@
1
- {"version":3,"file":"DLOBSubscriber.d.ts","sourceRoot":"","sources":["../../../src/dlob/DLOBSubscriber.ts"],"names":[],"mappings":";;AAAA,OAAO,EAAE,IAAI,EAAE,MAAM,QAAQ,CAAC;AAC9B,OAAO,EAAE,YAAY,EAAE,MAAM,QAAQ,CAAC;AACtC,OAAO,kBAAkB,MAAM,4BAA4B,CAAC;AAC5D,OAAO,EACN,UAAU,EACV,oBAAoB,EACpB,sBAAsB,EACtB,UAAU,EACV,MAAM,SAAS,CAAC;AACjB,OAAO,EAAE,cAAc,EAAE,MAAM,mBAAmB,CAAC;AACnD,OAAO,EAAa,UAAU,EAAE,MAAM,UAAU,CAAC;AACjD,OAAO,EAIN,WAAW,EACX,oBAAoB,EACpB,WAAW,EACX,MAAM,mBAAmB,CAAC;AAC3B,OAAO,EAAE,EAAE,EAAE,MAAM,sBAAsB,CAAC;AAE1C,qBAAa,cAAc;IAC1B,WAAW,EAAE,cAAc,CAAC;IAC5B,UAAU,EAAE,UAAU,CAAC;IACvB,UAAU,EAAE,UAAU,CAAC;IACvB,eAAe,EAAE,MAAM,CAAC;IACxB,UAAU,CAAC,EAAE,UAAU,CAAC,OAAO,UAAU,CAAC,CAAC;IAC3C,IAAI,EAAE,IAAI,CAAC;IACJ,YAAY,EAAE,kBAAkB,CAAC,YAAY,EAAE,oBAAoB,CAAC,CAAC;gBAChE,MAAM,EAAE,sBAAsB;IAS7B,SAAS,IAAI,OAAO,CAAC,IAAI,CAAC;IAiBjC,UAAU,IAAI,OAAO,CAAC,IAAI,CAAC;IAI1B,OAAO,IAAI,IAAI;IAItB;;;;;;;;;;OAUG;IACI,KAAK,CAAC,EACZ,UAAU,EACV,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