@velocity-exchange/sdk 0.0.3 → 0.1.0

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 (393) hide show
  1. package/.prettierignore +1 -1
  2. package/CHANGELOG.md +35 -0
  3. package/README.md +30 -30
  4. package/bun.lock +1 -1
  5. package/lib/browser/accounts/grpcProgramAccountSubscriber.js +1 -1
  6. package/lib/browser/accounts/grpcVelocityClientAccountSubscriber.d.ts +0 -4
  7. package/lib/browser/accounts/grpcVelocityClientAccountSubscriber.js +1 -3
  8. package/lib/browser/accounts/grpcVelocityClientAccountSubscriberV2.d.ts +0 -4
  9. package/lib/browser/accounts/grpcVelocityClientAccountSubscriberV2.js +5 -7
  10. package/lib/browser/accounts/laserProgramAccountSubscriber.js +1 -1
  11. package/lib/browser/accounts/pollingVelocityClientAccountSubscriber.d.ts +0 -4
  12. package/lib/browser/accounts/pollingVelocityClientAccountSubscriber.js +5 -7
  13. package/lib/browser/accounts/types.d.ts +2 -8
  14. package/lib/browser/accounts/utils.js +2 -2
  15. package/lib/browser/accounts/webSocketVelocityClientAccountSubscriber.d.ts +0 -4
  16. package/lib/browser/accounts/webSocketVelocityClientAccountSubscriber.js +5 -7
  17. package/lib/browser/accounts/webSocketVelocityClientAccountSubscriberV2.d.ts +0 -4
  18. package/lib/browser/accounts/webSocketVelocityClientAccountSubscriberV2.js +5 -7
  19. package/lib/browser/addresses/pda.d.ts +1 -7
  20. package/lib/browser/addresses/pda.js +4 -10
  21. package/lib/browser/adminClient.d.ts +1 -1
  22. package/lib/browser/adminClient.js +21 -21
  23. package/lib/browser/auctionSubscriber/auctionSubscriber.d.ts +1 -3
  24. package/lib/browser/auctionSubscriber/auctionSubscriber.js +2 -6
  25. package/lib/browser/auctionSubscriber/auctionSubscriberGrpc.d.ts +1 -3
  26. package/lib/browser/auctionSubscriber/auctionSubscriberGrpc.js +2 -6
  27. package/lib/browser/auctionSubscriber/types.d.ts +3 -2
  28. package/lib/browser/config.d.ts +10 -19
  29. package/lib/browser/config.js +6 -33
  30. package/lib/browser/constants/insuranceFund.d.ts +1 -1
  31. package/lib/browser/constants/insuranceFund.js +1 -1
  32. package/lib/browser/constituentMap/constituentMap.d.ts +0 -2
  33. package/lib/browser/constituentMap/constituentMap.js +5 -5
  34. package/lib/browser/core/VelocityCore.d.ts +9 -15
  35. package/lib/browser/core/VelocityCore.js +5 -7
  36. package/lib/browser/core/instructions/withdraw.d.ts +1 -1
  37. package/lib/browser/core/instructions/withdraw.js +1 -1
  38. package/lib/browser/core/remainingAccounts.js +3 -3
  39. package/lib/browser/decode/user.js +5 -5
  40. package/lib/browser/dlob/DLOB.d.ts +1 -1
  41. package/lib/browser/dlob/DLOB.js +7 -7
  42. package/lib/browser/dlob/DLOBNode.js +1 -2
  43. package/lib/browser/dlob/DLOBSubscriber.d.ts +0 -2
  44. package/lib/browser/dlob/DLOBSubscriber.js +2 -7
  45. package/lib/browser/dlob/orderBookLevels.js +7 -7
  46. package/lib/browser/dlob/types.d.ts +0 -2
  47. package/lib/browser/events/eventSubscriber.d.ts +1 -1
  48. package/lib/browser/events/eventsServerLogProvider.js +2 -2
  49. package/lib/browser/events/parse.js +14 -14
  50. package/lib/browser/events/types.d.ts +3 -5
  51. package/lib/browser/events/types.js +1 -1
  52. package/lib/browser/idl/{drift.d.ts → velocity.d.ts} +1043 -768
  53. package/lib/browser/idl/{drift.json → velocity.json} +1034 -759
  54. package/lib/browser/index.d.ts +1 -1
  55. package/lib/browser/index.js +1 -2
  56. package/lib/browser/math/amm.d.ts +10 -10
  57. package/lib/browser/math/amm.js +29 -28
  58. package/lib/browser/math/auction.d.ts +1 -1
  59. package/lib/browser/math/auction.js +18 -21
  60. package/lib/browser/math/builder.d.ts +18 -1
  61. package/lib/browser/math/builder.js +32 -1
  62. package/lib/browser/math/funding.js +26 -26
  63. package/lib/browser/math/margin.d.ts +4 -4
  64. package/lib/browser/math/margin.js +15 -15
  65. package/lib/browser/math/market.js +13 -13
  66. package/lib/browser/math/oracles.d.ts +4 -4
  67. package/lib/browser/math/oracles.js +23 -23
  68. package/lib/browser/math/orders.d.ts +2 -2
  69. package/lib/browser/math/orders.js +12 -12
  70. package/lib/browser/math/position.js +4 -4
  71. package/lib/browser/math/superStake.d.ts +8 -10
  72. package/lib/browser/math/superStake.js +18 -20
  73. package/lib/browser/math/trade.js +5 -5
  74. package/lib/browser/math/utils.d.ts +1 -1
  75. package/lib/browser/math/utils.js +1 -1
  76. package/lib/browser/oracles/pythLazerClient.js +2 -2
  77. package/lib/browser/orderSubscriber/OrderSubscriber.d.ts +0 -2
  78. package/lib/browser/orderSubscriber/OrderSubscriber.js +8 -12
  79. package/lib/browser/orderSubscriber/WebsocketSubscription.js +1 -1
  80. package/lib/browser/orderSubscriber/grpcSubscription.js +2 -2
  81. package/lib/browser/orderSubscriber/types.d.ts +0 -2
  82. package/lib/browser/priorityFee/priorityFeeSubscriber.d.ts +1 -5
  83. package/lib/browser/priorityFee/priorityFeeSubscriber.js +7 -15
  84. package/lib/browser/priorityFee/priorityFeeSubscriberMap.d.ts +0 -4
  85. package/lib/browser/priorityFee/priorityFeeSubscriberMap.js +3 -11
  86. package/lib/browser/priorityFee/types.d.ts +3 -8
  87. package/lib/browser/priorityFee/velocityPriorityFeeMethod.d.ts +0 -8
  88. package/lib/browser/priorityFee/velocityPriorityFeeMethod.js +1 -3
  89. package/lib/browser/pyth/pythLazerSubscriber.d.ts +1 -1
  90. package/lib/browser/pyth/pythLazerSubscriber.js +1 -1
  91. package/lib/browser/swap/UnifiedSwapClient.js +1 -1
  92. package/lib/browser/swift/signedMsgUserAccountSubscriber.d.ts +4 -5
  93. package/lib/browser/swift/signedMsgUserAccountSubscriber.js +2 -6
  94. package/lib/browser/swift/swiftOrderSubscriber.d.ts +6 -5
  95. package/lib/browser/swift/swiftOrderSubscriber.js +5 -11
  96. package/lib/browser/types.d.ts +81 -93
  97. package/lib/browser/types.js +4 -0
  98. package/lib/browser/user.d.ts +1 -3
  99. package/lib/browser/user.js +19 -23
  100. package/lib/browser/userConfig.d.ts +3 -2
  101. package/lib/browser/userMap/WebsocketSubscription.js +1 -1
  102. package/lib/browser/userMap/grpcSubscription.js +1 -1
  103. package/lib/browser/userMap/referrerMap.d.ts +0 -2
  104. package/lib/browser/userMap/referrerMap.js +0 -4
  105. package/lib/browser/userMap/revenueShareEscrowMap.d.ts +0 -2
  106. package/lib/browser/userMap/revenueShareEscrowMap.js +0 -4
  107. package/lib/browser/userMap/userMap.d.ts +2 -4
  108. package/lib/browser/userMap/userMap.js +10 -14
  109. package/lib/browser/userMap/userMapConfig.d.ts +3 -2
  110. package/lib/browser/userMap/userStatsMap.d.ts +0 -2
  111. package/lib/browser/userMap/userStatsMap.js +0 -4
  112. package/lib/browser/userStats.d.ts +0 -2
  113. package/lib/browser/userStats.js +10 -14
  114. package/lib/browser/userStatsConfig.d.ts +3 -2
  115. package/lib/browser/util/ed25519Utils.d.ts +1 -1
  116. package/lib/browser/util/ed25519Utils.js +1 -1
  117. package/lib/browser/velocityClient.d.ts +59 -44
  118. package/lib/browser/velocityClient.js +259 -197
  119. package/lib/browser/velocityClientConfig.d.ts +0 -8
  120. package/lib/node/accounts/grpcProgramAccountSubscriber.js +1 -1
  121. package/lib/node/accounts/grpcVelocityClientAccountSubscriber.d.ts +0 -4
  122. package/lib/node/accounts/grpcVelocityClientAccountSubscriber.d.ts.map +1 -1
  123. package/lib/node/accounts/grpcVelocityClientAccountSubscriber.js +1 -3
  124. package/lib/node/accounts/grpcVelocityClientAccountSubscriberV2.d.ts +0 -4
  125. package/lib/node/accounts/grpcVelocityClientAccountSubscriberV2.d.ts.map +1 -1
  126. package/lib/node/accounts/grpcVelocityClientAccountSubscriberV2.js +5 -7
  127. package/lib/node/accounts/laserProgramAccountSubscriber.js +1 -1
  128. package/lib/node/accounts/pollingVelocityClientAccountSubscriber.d.ts +0 -4
  129. package/lib/node/accounts/pollingVelocityClientAccountSubscriber.d.ts.map +1 -1
  130. package/lib/node/accounts/pollingVelocityClientAccountSubscriber.js +5 -7
  131. package/lib/node/accounts/types.d.ts +2 -8
  132. package/lib/node/accounts/types.d.ts.map +1 -1
  133. package/lib/node/accounts/utils.js +2 -2
  134. package/lib/node/accounts/webSocketVelocityClientAccountSubscriber.d.ts +0 -4
  135. package/lib/node/accounts/webSocketVelocityClientAccountSubscriber.d.ts.map +1 -1
  136. package/lib/node/accounts/webSocketVelocityClientAccountSubscriber.js +5 -7
  137. package/lib/node/accounts/webSocketVelocityClientAccountSubscriberV2.d.ts +0 -4
  138. package/lib/node/accounts/webSocketVelocityClientAccountSubscriberV2.d.ts.map +1 -1
  139. package/lib/node/accounts/webSocketVelocityClientAccountSubscriberV2.js +5 -7
  140. package/lib/node/addresses/pda.d.ts +1 -7
  141. package/lib/node/addresses/pda.d.ts.map +1 -1
  142. package/lib/node/addresses/pda.js +4 -10
  143. package/lib/node/adminClient.d.ts +1 -1
  144. package/lib/node/adminClient.js +21 -21
  145. package/lib/node/auctionSubscriber/auctionSubscriber.d.ts +1 -3
  146. package/lib/node/auctionSubscriber/auctionSubscriber.d.ts.map +1 -1
  147. package/lib/node/auctionSubscriber/auctionSubscriber.js +2 -6
  148. package/lib/node/auctionSubscriber/auctionSubscriberGrpc.d.ts +1 -3
  149. package/lib/node/auctionSubscriber/auctionSubscriberGrpc.d.ts.map +1 -1
  150. package/lib/node/auctionSubscriber/auctionSubscriberGrpc.js +2 -6
  151. package/lib/node/auctionSubscriber/types.d.ts +3 -2
  152. package/lib/node/auctionSubscriber/types.d.ts.map +1 -1
  153. package/lib/node/config.d.ts +10 -19
  154. package/lib/node/config.d.ts.map +1 -1
  155. package/lib/node/config.js +6 -33
  156. package/lib/node/constants/insuranceFund.d.ts +1 -1
  157. package/lib/node/constants/insuranceFund.js +1 -1
  158. package/lib/node/constituentMap/constituentMap.d.ts +0 -2
  159. package/lib/node/constituentMap/constituentMap.d.ts.map +1 -1
  160. package/lib/node/constituentMap/constituentMap.js +5 -5
  161. package/lib/node/core/VelocityCore.d.ts +9 -15
  162. package/lib/node/core/VelocityCore.d.ts.map +1 -1
  163. package/lib/node/core/VelocityCore.js +5 -7
  164. package/lib/node/core/instructions/withdraw.d.ts +1 -1
  165. package/lib/node/core/instructions/withdraw.d.ts.map +1 -1
  166. package/lib/node/core/instructions/withdraw.js +1 -1
  167. package/lib/node/core/remainingAccounts.js +3 -3
  168. package/lib/node/decode/user.js +5 -5
  169. package/lib/node/dlob/DLOB.d.ts +1 -1
  170. package/lib/node/dlob/DLOB.d.ts.map +1 -1
  171. package/lib/node/dlob/DLOB.js +7 -7
  172. package/lib/node/dlob/DLOBNode.js +1 -2
  173. package/lib/node/dlob/DLOBSubscriber.d.ts +0 -2
  174. package/lib/node/dlob/DLOBSubscriber.d.ts.map +1 -1
  175. package/lib/node/dlob/DLOBSubscriber.js +2 -7
  176. package/lib/node/dlob/orderBookLevels.d.ts.map +1 -1
  177. package/lib/node/dlob/orderBookLevels.js +7 -7
  178. package/lib/node/dlob/types.d.ts +0 -2
  179. package/lib/node/dlob/types.d.ts.map +1 -1
  180. package/lib/node/events/eventSubscriber.d.ts +1 -1
  181. package/lib/node/events/eventsServerLogProvider.js +2 -2
  182. package/lib/node/events/parse.d.ts.map +1 -1
  183. package/lib/node/events/parse.js +14 -14
  184. package/lib/node/events/types.d.ts +3 -5
  185. package/lib/node/events/types.d.ts.map +1 -1
  186. package/lib/node/events/types.js +1 -1
  187. package/lib/node/idl/{drift.d.ts → velocity.d.ts} +1044 -769
  188. package/lib/node/idl/velocity.d.ts.map +1 -0
  189. package/lib/node/idl/{drift.json → velocity.json} +1034 -759
  190. package/lib/node/index.d.ts +1 -1
  191. package/lib/node/index.d.ts.map +1 -1
  192. package/lib/node/index.js +1 -2
  193. package/lib/node/math/amm.d.ts +10 -10
  194. package/lib/node/math/amm.d.ts.map +1 -1
  195. package/lib/node/math/amm.js +29 -28
  196. package/lib/node/math/auction.d.ts +1 -1
  197. package/lib/node/math/auction.d.ts.map +1 -1
  198. package/lib/node/math/auction.js +18 -21
  199. package/lib/node/math/builder.d.ts +18 -1
  200. package/lib/node/math/builder.d.ts.map +1 -1
  201. package/lib/node/math/builder.js +32 -1
  202. package/lib/node/math/funding.d.ts.map +1 -1
  203. package/lib/node/math/funding.js +26 -26
  204. package/lib/node/math/margin.d.ts +4 -4
  205. package/lib/node/math/margin.d.ts.map +1 -1
  206. package/lib/node/math/margin.js +15 -15
  207. package/lib/node/math/market.d.ts.map +1 -1
  208. package/lib/node/math/market.js +13 -13
  209. package/lib/node/math/oracles.d.ts +4 -4
  210. package/lib/node/math/oracles.d.ts.map +1 -1
  211. package/lib/node/math/oracles.js +23 -23
  212. package/lib/node/math/orders.d.ts +2 -2
  213. package/lib/node/math/orders.d.ts.map +1 -1
  214. package/lib/node/math/orders.js +12 -12
  215. package/lib/node/math/position.d.ts.map +1 -1
  216. package/lib/node/math/position.js +4 -4
  217. package/lib/node/math/superStake.d.ts +8 -10
  218. package/lib/node/math/superStake.d.ts.map +1 -1
  219. package/lib/node/math/superStake.js +18 -20
  220. package/lib/node/math/trade.d.ts.map +1 -1
  221. package/lib/node/math/trade.js +5 -5
  222. package/lib/node/math/utils.d.ts +1 -1
  223. package/lib/node/math/utils.js +1 -1
  224. package/lib/node/oracles/pythLazerClient.js +2 -2
  225. package/lib/node/orderSubscriber/OrderSubscriber.d.ts +0 -2
  226. package/lib/node/orderSubscriber/OrderSubscriber.d.ts.map +1 -1
  227. package/lib/node/orderSubscriber/OrderSubscriber.js +8 -12
  228. package/lib/node/orderSubscriber/WebsocketSubscription.js +1 -1
  229. package/lib/node/orderSubscriber/grpcSubscription.js +2 -2
  230. package/lib/node/orderSubscriber/types.d.ts +0 -2
  231. package/lib/node/orderSubscriber/types.d.ts.map +1 -1
  232. package/lib/node/priorityFee/priorityFeeSubscriber.d.ts +1 -5
  233. package/lib/node/priorityFee/priorityFeeSubscriber.d.ts.map +1 -1
  234. package/lib/node/priorityFee/priorityFeeSubscriber.js +7 -15
  235. package/lib/node/priorityFee/priorityFeeSubscriberMap.d.ts +0 -4
  236. package/lib/node/priorityFee/priorityFeeSubscriberMap.d.ts.map +1 -1
  237. package/lib/node/priorityFee/priorityFeeSubscriberMap.js +3 -11
  238. package/lib/node/priorityFee/types.d.ts +3 -8
  239. package/lib/node/priorityFee/types.d.ts.map +1 -1
  240. package/lib/node/priorityFee/velocityPriorityFeeMethod.d.ts +0 -8
  241. package/lib/node/priorityFee/velocityPriorityFeeMethod.d.ts.map +1 -1
  242. package/lib/node/priorityFee/velocityPriorityFeeMethod.js +1 -3
  243. package/lib/node/pyth/pythLazerSubscriber.d.ts +1 -1
  244. package/lib/node/pyth/pythLazerSubscriber.js +1 -1
  245. package/lib/node/swap/UnifiedSwapClient.js +1 -1
  246. package/lib/node/swift/signedMsgUserAccountSubscriber.d.ts +4 -5
  247. package/lib/node/swift/signedMsgUserAccountSubscriber.d.ts.map +1 -1
  248. package/lib/node/swift/signedMsgUserAccountSubscriber.js +2 -6
  249. package/lib/node/swift/swiftOrderSubscriber.d.ts +6 -5
  250. package/lib/node/swift/swiftOrderSubscriber.d.ts.map +1 -1
  251. package/lib/node/swift/swiftOrderSubscriber.js +5 -11
  252. package/lib/node/types.d.ts +81 -93
  253. package/lib/node/types.d.ts.map +1 -1
  254. package/lib/node/types.js +4 -0
  255. package/lib/node/user.d.ts +1 -3
  256. package/lib/node/user.d.ts.map +1 -1
  257. package/lib/node/user.js +19 -23
  258. package/lib/node/userConfig.d.ts +3 -2
  259. package/lib/node/userConfig.d.ts.map +1 -1
  260. package/lib/node/userMap/WebsocketSubscription.js +1 -1
  261. package/lib/node/userMap/grpcSubscription.js +1 -1
  262. package/lib/node/userMap/referrerMap.d.ts +0 -2
  263. package/lib/node/userMap/referrerMap.d.ts.map +1 -1
  264. package/lib/node/userMap/referrerMap.js +0 -4
  265. package/lib/node/userMap/revenueShareEscrowMap.d.ts +0 -2
  266. package/lib/node/userMap/revenueShareEscrowMap.d.ts.map +1 -1
  267. package/lib/node/userMap/revenueShareEscrowMap.js +0 -4
  268. package/lib/node/userMap/userMap.d.ts +2 -4
  269. package/lib/node/userMap/userMap.d.ts.map +1 -1
  270. package/lib/node/userMap/userMap.js +10 -14
  271. package/lib/node/userMap/userMapConfig.d.ts +3 -2
  272. package/lib/node/userMap/userMapConfig.d.ts.map +1 -1
  273. package/lib/node/userMap/userStatsMap.d.ts +0 -2
  274. package/lib/node/userMap/userStatsMap.d.ts.map +1 -1
  275. package/lib/node/userMap/userStatsMap.js +0 -4
  276. package/lib/node/userStats.d.ts +0 -2
  277. package/lib/node/userStats.d.ts.map +1 -1
  278. package/lib/node/userStats.js +10 -14
  279. package/lib/node/userStatsConfig.d.ts +3 -2
  280. package/lib/node/userStatsConfig.d.ts.map +1 -1
  281. package/lib/node/util/ed25519Utils.d.ts +1 -1
  282. package/lib/node/util/ed25519Utils.js +1 -1
  283. package/lib/node/velocityClient.d.ts +59 -44
  284. package/lib/node/velocityClient.d.ts.map +1 -1
  285. package/lib/node/velocityClient.js +259 -197
  286. package/lib/node/velocityClientConfig.d.ts +0 -8
  287. package/lib/node/velocityClientConfig.d.ts.map +1 -1
  288. package/package.json +6 -7
  289. package/scripts/deposit-isolated-positions.ts +2 -2
  290. package/scripts/find-flagged-users.ts +1 -1
  291. package/scripts/grpc-client-test-comparison.ts +4 -4
  292. package/scripts/grpc-multiuser-client-test-comparison.ts +2 -2
  293. package/scripts/single-grpc-client-test.ts +3 -3
  294. package/scripts/updateVersion.js +4 -4
  295. package/scripts/withdraw-isolated-positions.ts +2 -2
  296. package/src/accounts/grpcProgramAccountSubscriber.ts +1 -1
  297. package/src/accounts/grpcVelocityClientAccountSubscriber.ts +0 -7
  298. package/src/accounts/grpcVelocityClientAccountSubscriberV2.ts +4 -11
  299. package/src/accounts/laserProgramAccountSubscriber.ts +1 -1
  300. package/src/accounts/pollingVelocityClientAccountSubscriber.ts +4 -11
  301. package/src/accounts/types.ts +2 -9
  302. package/src/accounts/utils.ts +2 -2
  303. package/src/accounts/webSocketVelocityClientAccountSubscriber.ts +4 -11
  304. package/src/accounts/webSocketVelocityClientAccountSubscriberV2.ts +4 -11
  305. package/src/addresses/pda.ts +3 -13
  306. package/src/adminClient.ts +21 -21
  307. package/src/auctionSubscriber/auctionSubscriber.ts +1 -6
  308. package/src/auctionSubscriber/auctionSubscriberGrpc.ts +1 -6
  309. package/src/auctionSubscriber/types.ts +3 -3
  310. package/src/config.ts +8 -64
  311. package/src/constants/insuranceFund.ts +1 -1
  312. package/src/constituentMap/constituentMap.ts +2 -6
  313. package/src/core/VelocityCore.ts +11 -20
  314. package/src/core/instructions/withdraw.ts +2 -2
  315. package/src/core/remainingAccounts.ts +3 -3
  316. package/src/decode/user.ts +5 -5
  317. package/src/dlob/DLOB.ts +7 -7
  318. package/src/dlob/DLOBNode.ts +1 -1
  319. package/src/dlob/DLOBSubscriber.ts +2 -8
  320. package/src/dlob/orderBookLevels.ts +12 -6
  321. package/src/dlob/types.ts +0 -2
  322. package/src/events/eventSubscriber.ts +1 -1
  323. package/src/events/eventsServerLogProvider.ts +2 -2
  324. package/src/events/parse.ts +14 -14
  325. package/src/events/types.ts +4 -7
  326. package/src/idl/{drift.json → velocity.json} +1034 -759
  327. package/src/idl/{drift.ts → velocity.ts} +1036 -761
  328. package/src/index.ts +1 -4
  329. package/src/margin/README.md +2 -2
  330. package/src/math/amm.ts +43 -21
  331. package/src/math/auction.ts +19 -22
  332. package/src/math/builder.ts +45 -1
  333. package/src/math/funding.ts +46 -43
  334. package/src/math/margin.ts +15 -15
  335. package/src/math/market.ts +21 -13
  336. package/src/math/oracles.ts +29 -26
  337. package/src/math/orders.ts +21 -11
  338. package/src/math/position.ts +9 -3
  339. package/src/math/superStake.ts +21 -24
  340. package/src/math/trade.ts +9 -1
  341. package/src/math/utils.ts +1 -1
  342. package/src/oracles/pythLazerClient.ts +3 -3
  343. package/src/orderSubscriber/OrderSubscriber.ts +2 -8
  344. package/src/orderSubscriber/WebsocketSubscription.ts +1 -1
  345. package/src/orderSubscriber/grpcSubscription.ts +2 -2
  346. package/src/orderSubscriber/types.ts +0 -2
  347. package/src/priorityFee/priorityFeeSubscriber.ts +5 -12
  348. package/src/priorityFee/priorityFeeSubscriberMap.ts +2 -10
  349. package/src/priorityFee/types.ts +4 -9
  350. package/src/priorityFee/velocityPriorityFeeMethod.ts +0 -12
  351. package/src/pyth/pythLazerSubscriber.ts +1 -1
  352. package/src/swap/UnifiedSwapClient.ts +1 -1
  353. package/src/swift/signedMsgUserAccountSubscriber.ts +2 -8
  354. package/src/swift/swiftOrderSubscriber.ts +7 -12
  355. package/src/types.ts +86 -104
  356. package/src/user.ts +9 -14
  357. package/src/userConfig.ts +1 -3
  358. package/src/userMap/WebsocketSubscription.ts +1 -1
  359. package/src/userMap/grpcSubscription.ts +1 -1
  360. package/src/userMap/referrerMap.ts +0 -4
  361. package/src/userMap/revenueShareEscrowMap.ts +0 -4
  362. package/src/userMap/userMap.ts +3 -7
  363. package/src/userMap/userMapConfig.ts +3 -3
  364. package/src/userMap/userStatsMap.ts +0 -4
  365. package/src/userStats.ts +1 -5
  366. package/src/userStatsConfig.ts +3 -3
  367. package/src/util/ed25519Utils.ts +1 -1
  368. package/src/velocityClient.ts +345 -231
  369. package/src/velocityClientConfig.ts +3 -11
  370. package/tests/{DriftCore → VelocityCore}/decode.test.ts +1 -1
  371. package/tests/{DriftCore → VelocityCore}/fill_trigger.test.ts +1 -1
  372. package/tests/{DriftCore → VelocityCore}/instructions.test.ts +1 -1
  373. package/tests/{DriftCore → VelocityCore}/pdas.test.ts +4 -2
  374. package/tests/auctions/test.ts +4 -4
  375. package/tests/ci/verifyConstants.ts +24 -27
  376. package/tests/decode/test.ts +3 -3
  377. package/tests/dlob/helpers.ts +5 -9
  378. package/tests/dlob/test.ts +5 -5
  379. package/tests/events/parseLogsForCuUsage.ts +15 -15
  380. package/tests/user/helpers.ts +10 -10
  381. package/tests/user/test.ts +13 -10
  382. package/lib/browser/util/deprecatedAlias.d.ts +0 -26
  383. package/lib/browser/util/deprecatedAlias.js +0 -10
  384. package/lib/node/idl/drift.d.ts.map +0 -1
  385. package/lib/node/util/deprecatedAlias.d.ts +0 -27
  386. package/lib/node/util/deprecatedAlias.d.ts.map +0 -1
  387. package/lib/node/util/deprecatedAlias.js +0 -10
  388. package/src/util/deprecatedAlias.ts +0 -25
  389. /package/lib/browser/idl/{drift.js → velocity.js} +0 -0
  390. /package/lib/node/idl/{drift.js → velocity.js} +0 -0
  391. /package/tests/{DriftCore → VelocityCore}/perp_orders.test.ts +0 -0
  392. /package/tests/{DriftCore → VelocityCore}/remainingAccounts.test.ts +0 -0
  393. /package/tests/{DriftCore → VelocityCore}/settlement_liquidation.test.ts +0 -0
@@ -3,7 +3,7 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
3
3
  return (mod && mod.__esModule) ? mod : { "default": mod };
4
4
  };
5
5
  Object.defineProperty(exports, "__esModule", { value: true });
6
- exports.calculateEstimatedSuperStakeLiquidationPrice = exports.calculateSolEarned = exports.fetchMSolMetrics = exports.fetchJitoSolMetrics = exports.findBestLstSuperStakeIxs = exports.findBestJitoSolSuperStakeIxs = exports.findBestMSolSuperStakeIxs = exports.findBestSuperStakeIxs = exports.fetchBSolDriftEmissions = exports.fetchBSolVelocityEmissions = exports.fetchBSolMetrics = void 0;
6
+ exports.calculateEstimatedSuperStakeLiquidationPrice = exports.calculateSolEarned = exports.fetchMSolMetrics = exports.fetchJitoSolMetrics = exports.findBestLstSuperStakeIxs = exports.findBestJitoSolSuperStakeIxs = exports.findBestMSolSuperStakeIxs = exports.findBestSuperStakeIxs = exports.fetchBSolVelocityEmissions = exports.fetchBSolMetrics = void 0;
7
7
  const web3_js_1 = require("@solana/web3.js");
8
8
  const marinade_1 = require("../marinade");
9
9
  const anchor_1 = require("../isomorphic/anchor");
@@ -16,17 +16,15 @@ async function fetchBSolMetrics() {
16
16
  }
17
17
  exports.fetchBSolMetrics = fetchBSolMetrics;
18
18
  async function fetchBSolVelocityEmissions() {
19
- return await (0, node_fetch_1.default)('https://stake.solblaze.org/api/v1/drift_emissions');
19
+ return await (0, node_fetch_1.default)('https://stake.solblaze.org/api/v1/velocity_emissions');
20
20
  }
21
21
  exports.fetchBSolVelocityEmissions = fetchBSolVelocityEmissions;
22
- /** @deprecated Use `fetchBSolVelocityEmissions` instead. `fetchBSolDriftEmissions` will be removed in a future major. */
23
- exports.fetchBSolDriftEmissions = fetchBSolVelocityEmissions;
24
- async function findBestSuperStakeIxs({ marketIndex, amount, jupiterClient, driftClient, userAccountPublicKey, price, forceMarinade, onlyDirectRoutes, jupiterQuote, }) {
22
+ async function findBestSuperStakeIxs({ marketIndex, amount, jupiterClient, velocityClient, userAccountPublicKey, price, forceMarinade, onlyDirectRoutes, jupiterQuote, }) {
25
23
  if (marketIndex === 2) {
26
24
  return findBestMSolSuperStakeIxs({
27
25
  amount,
28
26
  jupiterClient,
29
- driftClient,
27
+ velocityClient,
30
28
  userAccountPublicKey,
31
29
  price,
32
30
  forceMarinade,
@@ -38,7 +36,7 @@ async function findBestSuperStakeIxs({ marketIndex, amount, jupiterClient, drift
38
36
  return findBestJitoSolSuperStakeIxs({
39
37
  amount,
40
38
  jupiterClient,
41
- driftClient,
39
+ velocityClient,
42
40
  userAccountPublicKey,
43
41
  onlyDirectRoutes,
44
42
  jupiterQuote,
@@ -47,10 +45,10 @@ async function findBestSuperStakeIxs({ marketIndex, amount, jupiterClient, drift
47
45
  else if (marketIndex === 8) {
48
46
  return findBestLstSuperStakeIxs({
49
47
  amount,
50
- lstMint: driftClient.getSpotMarketAccount(8).mint,
48
+ lstMint: velocityClient.getSpotMarketAccount(8).mint,
51
49
  lstMarketIndex: 8,
52
50
  jupiterClient,
53
- driftClient,
51
+ velocityClient,
54
52
  userAccountPublicKey,
55
53
  onlyDirectRoutes,
56
54
  jupiterQuote,
@@ -61,13 +59,13 @@ async function findBestSuperStakeIxs({ marketIndex, amount, jupiterClient, drift
61
59
  }
62
60
  }
63
61
  exports.findBestSuperStakeIxs = findBestSuperStakeIxs;
64
- async function findBestMSolSuperStakeIxs({ amount, jupiterClient, driftClient, userAccountPublicKey, price, forceMarinade, onlyDirectRoutes, jupiterQuote, }) {
62
+ async function findBestMSolSuperStakeIxs({ amount, jupiterClient, velocityClient, userAccountPublicKey, price, forceMarinade, onlyDirectRoutes, jupiterQuote, }) {
65
63
  if (!price) {
66
- const marinadeProgram = (0, marinade_1.getMarinadeFinanceProgram)(driftClient.provider);
64
+ const marinadeProgram = (0, marinade_1.getMarinadeFinanceProgram)(velocityClient.provider);
67
65
  price = await (0, marinade_1.getMarinadeMSolPrice)(marinadeProgram);
68
66
  }
69
- const solSpotMarketAccount = driftClient.getSpotMarketAccount(1);
70
- const mSolSpotMarketAccount = driftClient.getSpotMarketAccount(2);
67
+ const solSpotMarketAccount = velocityClient.getSpotMarketAccount(1);
68
+ const mSolSpotMarketAccount = velocityClient.getSpotMarketAccount(2);
71
69
  let jupiterPrice;
72
70
  let quote = jupiterQuote;
73
71
  if (!jupiterQuote) {
@@ -87,7 +85,7 @@ async function findBestMSolSuperStakeIxs({ amount, jupiterClient, driftClient, u
87
85
  }
88
86
  }
89
87
  if (!jupiterPrice || price <= jupiterPrice || forceMarinade) {
90
- const ixs = await driftClient.getStakeForMSOLIx({
88
+ const ixs = await velocityClient.getStakeForMSOLIx({
91
89
  amount,
92
90
  userAccountPublicKey,
93
91
  });
@@ -99,7 +97,7 @@ async function findBestMSolSuperStakeIxs({ amount, jupiterClient, driftClient, u
99
97
  };
100
98
  }
101
99
  else {
102
- const { ixs, lookupTables } = await driftClient.getJupiterSwapIxV6({
100
+ const { ixs, lookupTables } = await velocityClient.getJupiterSwapIxV6({
103
101
  inMarketIndex: 1,
104
102
  outMarketIndex: 2,
105
103
  jupiterClient,
@@ -117,14 +115,14 @@ async function findBestMSolSuperStakeIxs({ amount, jupiterClient, driftClient, u
117
115
  }
118
116
  }
119
117
  exports.findBestMSolSuperStakeIxs = findBestMSolSuperStakeIxs;
120
- async function findBestJitoSolSuperStakeIxs({ amount, jupiterClient, driftClient, userAccountPublicKey, onlyDirectRoutes, jupiterQuote, }) {
118
+ async function findBestJitoSolSuperStakeIxs({ amount, jupiterClient, velocityClient, userAccountPublicKey, onlyDirectRoutes, jupiterQuote, }) {
121
119
  return await findBestLstSuperStakeIxs({
122
120
  amount,
123
121
  jupiterClient,
124
- driftClient,
122
+ velocityClient,
125
123
  userAccountPublicKey,
126
124
  onlyDirectRoutes,
127
- lstMint: driftClient.getSpotMarketAccount(6).mint,
125
+ lstMint: velocityClient.getSpotMarketAccount(6).mint,
128
126
  lstMarketIndex: 6,
129
127
  jupiterQuote,
130
128
  });
@@ -135,8 +133,8 @@ exports.findBestJitoSolSuperStakeIxs = findBestJitoSolSuperStakeIxs;
135
133
  *
136
134
  * Without doing any extra steps like checking if you can get a better rate by staking directly with that LST platform
137
135
  */
138
- async function findBestLstSuperStakeIxs({ amount, jupiterClient, driftClient, userAccountPublicKey, onlyDirectRoutes, lstMarketIndex, jupiterQuote, }) {
139
- const { ixs, lookupTables } = await driftClient.getJupiterSwapIxV6({
136
+ async function findBestLstSuperStakeIxs({ amount, jupiterClient, velocityClient, userAccountPublicKey, onlyDirectRoutes, lstMarketIndex, jupiterQuote, }) {
137
+ const { ixs, lookupTables } = await velocityClient.getJupiterSwapIxV6({
140
138
  inMarketIndex: 1,
141
139
  outMarketIndex: lstMarketIndex,
142
140
  jupiterClient,
@@ -1 +1 @@
1
- {"version":3,"file":"trade.d.ts","sourceRoot":"","sources":["../../../src/math/trade.ts"],"names":[],"mappings":";AAAA,OAAO,EAEN,iBAAiB,EACjB,iBAAiB,EACjB,gBAAgB,EAChB,MAAM,UAAU,CAAC;AAClB,OAAO,EAAE,EAAE,EAAE,MAAM,sBAAsB,CAAC;AAe1C,OAAO,EAIN,SAAS,EAIT,MAAM,OAAO,CAAC;AAGf,OAAO,EAAE,iBAAiB,EAAE,MAAM,kBAAkB,CAAC;AACrD,OAAO,EAAE,IAAI,EAAE,MAAM,cAAc,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B,EACzB,iBAAiB,EAAE,iBAAiB,EACpC,IAAI,EAAE,IAAI,EACV,IAAI,EAAE,MAAM,EACZ,WAAW,0BAAgC,GACzC;IACF,UAAU,EAAE,EAAE,CAAC;IACf,WAAW,EAAE,EAAE,CAAC;IAChB,SAAS,EAAE,EAAE,CAAC;IACd,UAAU,EAAE,EAAE,CAAC;IACf,UAAU,EAAE,EAAE,CAAC;IACf,WAAW,EAAE,EAAE,CAAC;CAChB,CAqRA;AAED,wBAAgB,kCAAkC,CACjD,SAAS,EAAE,SAAS,EACpB,MAAM,EAAE,EAAE,EACV,SAAS,EAAE,iBAAiB,EAC5B,aAAa,EAAE,EAAE,EACjB,EAAE,EAAE,WAAW,GACb;IACF,UAAU,EAAE,EAAE,CAAC;IACf,WAAW,EAAE,EAAE,CAAC;IAChB,SAAS,EAAE,EAAE,CAAC;IACd,UAAU,EAAE,EAAE,CAAC;IACf,UAAU,EAAE,EAAE,CAAC;IACf,WAAW,EAAE,EAAE,CAAC;CAChB,CAwEA;AAED,wBAAgB,+BAA+B,CAC9C,gBAAgB,EAAE,gBAAgB,EAClC,GAAG,CAAC,EAAE,EAAE,MAsBR"}
@@ -53,7 +53,7 @@ function calculateTradeSlippage(direction, amount, market, inputAssetType = 'quo
53
53
  .div(acquiredBaseReserve.abs());
54
54
  let amm;
55
55
  if (useSpread && market.amm.baseSpread > 0) {
56
- const { baseAssetReserve, quoteAssetReserve, sqrtK, newPeg } = (0, amm_1.calculateUpdatedAMMSpreadReserves)(market.amm, direction, mmOraclePriceData, latestSlot);
56
+ const { baseAssetReserve, quoteAssetReserve, sqrtK, newPeg } = (0, amm_1.calculateUpdatedAMMSpreadReserves)(market.amm, market.marketStats, market.totalExchangeFee, direction, mmOraclePriceData, latestSlot);
57
57
  amm = {
58
58
  baseAssetReserve,
59
59
  quoteAssetReserve,
@@ -102,7 +102,7 @@ function calculateTradeAcquiredAmounts(direction, amount, market, inputAssetType
102
102
  const swapDirection = (0, amm_1.getSwapDirection)(inputAssetType, direction);
103
103
  let amm;
104
104
  if (useSpread && market.amm.baseSpread > 0) {
105
- const { baseAssetReserve, quoteAssetReserve, sqrtK, newPeg } = (0, amm_1.calculateUpdatedAMMSpreadReserves)(market.amm, direction, mmOraclePriceData, latestSlot);
105
+ const { baseAssetReserve, quoteAssetReserve, sqrtK, newPeg } = (0, amm_1.calculateUpdatedAMMSpreadReserves)(market.amm, market.marketStats, market.totalExchangeFee, direction, mmOraclePriceData, latestSlot);
106
106
  amm = {
107
107
  baseAssetReserve,
108
108
  quoteAssetReserve,
@@ -166,7 +166,7 @@ function calculateTargetPriceTrade(market, targetPrice, pct = MAXPCT, outputAsse
166
166
  let quoteAssetReserveBefore;
167
167
  let peg = market.amm.pegMultiplier;
168
168
  if (useSpread && market.amm.baseSpread > 0) {
169
- const { baseAssetReserve, quoteAssetReserve, newPeg } = (0, amm_1.calculateUpdatedAMMSpreadReserves)(market.amm, direction, mmOraclePriceData, latestSlot);
169
+ const { baseAssetReserve, quoteAssetReserve, newPeg } = (0, amm_1.calculateUpdatedAMMSpreadReserves)(market.amm, market.marketStats, market.totalExchangeFee, direction, mmOraclePriceData, latestSlot);
170
170
  baseAssetReserveBefore = baseAssetReserve;
171
171
  quoteAssetReserveBefore = quoteAssetReserve;
172
172
  peg = newPeg;
@@ -280,14 +280,14 @@ function calculateEstimatedPerpEntryPrice(assetType, amount, direction, market,
280
280
  const takerIsLong = (0, types_2.isVariant)(direction, 'long');
281
281
  const limitOrders = dlob[takerIsLong ? 'getRestingLimitAsks' : 'getRestingLimitBids'](market.marketIndex, slot, types_1.MarketType.PERP, mmOraclePriceData);
282
282
  const swapDirection = (0, amm_1.getSwapDirection)(assetType, direction);
283
- const { baseAssetReserve, quoteAssetReserve, sqrtK, newPeg } = (0, amm_1.calculateUpdatedAMMSpreadReserves)(market.amm, direction, mmOraclePriceData, new anchor_1.BN(slot));
283
+ const { baseAssetReserve, quoteAssetReserve, sqrtK, newPeg } = (0, amm_1.calculateUpdatedAMMSpreadReserves)(market.amm, market.marketStats, market.totalExchangeFee, direction, mmOraclePriceData, new anchor_1.BN(slot));
284
284
  const amm = {
285
285
  baseAssetReserve,
286
286
  quoteAssetReserve,
287
287
  sqrtK: sqrtK,
288
288
  pegMultiplier: newPeg,
289
289
  };
290
- const [ammBids, ammAsks] = (0, amm_1.calculateMarketOpenBidAsk)(market.amm.baseAssetReserve, market.amm.minBaseAssetReserve, market.amm.maxBaseAssetReserve, market.amm.orderStepSize);
290
+ const [ammBids, ammAsks] = (0, amm_1.calculateMarketOpenBidAsk)(market.amm.baseAssetReserve, market.amm.minBaseAssetReserve, market.amm.maxBaseAssetReserve, market.orderStepSize);
291
291
  let ammLiquidity;
292
292
  if (assetType === 'base') {
293
293
  ammLiquidity = takerIsLong ? ammAsks.abs() : ammBids;
@@ -18,7 +18,7 @@ export declare function isBNSafe(number: number): boolean;
18
18
  /**
19
19
  * Converts a number to BN makes sure the number is safe to convert to BN (that it does not overflow number after multiplying by precision)
20
20
  * @param number the number to convert to BN
21
- * @param precision the BN precision to use (i.e. QUOTE_PRECISION and BASE_PRECISION from drift sdk)
21
+ * @param precision the BN precision to use (i.e. QUOTE_PRECISION and BASE_PRECISION from velocity sdk)
22
22
  */
23
23
  export declare function numberToSafeBN(number: number, precision: BN): BN;
24
24
  //# sourceMappingURL=utils.d.ts.map
@@ -93,7 +93,7 @@ exports.isBNSafe = isBNSafe;
93
93
  /**
94
94
  * Converts a number to BN makes sure the number is safe to convert to BN (that it does not overflow number after multiplying by precision)
95
95
  * @param number the number to convert to BN
96
- * @param precision the BN precision to use (i.e. QUOTE_PRECISION and BASE_PRECISION from drift sdk)
96
+ * @param precision the BN precision to use (i.e. QUOTE_PRECISION and BASE_PRECISION from velocity sdk)
97
97
  */
98
98
  function numberToSafeBN(number, precision) {
99
99
  // check if number has decimals
@@ -8,7 +8,7 @@ const web3_js_1 = require("@solana/web3.js");
8
8
  const anchor_1 = require("../isomorphic/anchor");
9
9
  const numericConstants_1 = require("../constants/numericConstants");
10
10
  const wallet_1 = require("../wallet");
11
- const drift_json_1 = __importDefault(require("../idl/drift.json"));
11
+ const velocity_json_1 = __importDefault(require("../idl/velocity.json"));
12
12
  class PythLazerClient {
13
13
  constructor(connection, multiple = numericConstants_1.ONE, stableCoin = false) {
14
14
  this.connection = connection;
@@ -19,7 +19,7 @@ class PythLazerClient {
19
19
  new wallet_1.Wallet(new web3_js_1.Keypair()), {
20
20
  commitment: connection.commitment,
21
21
  });
22
- this.program = new anchor_1.Program(drift_json_1.default, provider);
22
+ this.program = new anchor_1.Program(velocity_json_1.default, provider);
23
23
  this.decodeFunc = this.program.account.pythLazerOracle.coder.accounts.decodeUnchecked.bind(this.program.account.pythLazerOracle.coder.accounts);
24
24
  }
25
25
  async getOraclePriceData(pricePublicKey) {
@@ -14,8 +14,6 @@ import { EventEmitter } from 'events';
14
14
  import { grpcSubscription } from './grpcSubscription';
15
15
  export declare class OrderSubscriber {
16
16
  velocityClient: VelocityClient;
17
- /** @deprecated Use `velocityClient` instead. `driftClient` will be removed in a future major. */
18
- get driftClient(): VelocityClient;
19
17
  usersAccounts: Map<string, {
20
18
  slot: number;
21
19
  userAccount: UserAccount;
@@ -1 +1 @@
1
- {"version":3,"file":"OrderSubscriber.d.ts","sourceRoot":"","sources":["../../../src/orderSubscriber/OrderSubscriber.ts"],"names":[],"mappings":";;;AAAA,OAAO,EAAE,cAAc,EAAE,MAAM,mBAAmB,CAAC;AACnD,OAAO,EAAE,WAAW,EAAE,MAAM,UAAU,CAAC;AAMvC,OAAO,EAAE,UAAU,EAAE,SAAS,EAAyB,MAAM,iBAAiB,CAAC;AAC/E,OAAO,EAAE,MAAM,EAAE,MAAM,QAAQ,CAAC;AAChC,OAAO,EAAE,IAAI,EAAE,MAAM,cAAc,CAAC;AACpC,OAAO,EAAE,qBAAqB,EAAE,qBAAqB,EAAE,MAAM,SAAS,CAAC;AACvE,OAAO,EAAE,mBAAmB,EAAE,MAAM,uBAAuB,CAAC;AAC5D,OAAO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CAAC;IACvB,QAAQ,EAAE,CAAC,IAAI,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,KAAK,WAAW,CAAC;IACtD,UAAU,CAAC,EAAE,OAAO,CAAC;IAErB,oBAAoB,CAAC,EAAE,OAAO,CAAC;gBAEnB,MAAM,EAAE,qBAAqB;IAkD5B,SAAS,IAAI,OAAO,CAAC,IAAI,CAAC;IAIjC,KAAK,IAAI,OAAO,CAAC,IAAI,CAAC;IA6D5B,oBAAoB,CACnB,GAAG,EAAE,MAAM,EACX,QAAQ,EAAE,KAAK,GAAG,SAAS,GAAG,QAAQ,EACtC,IAAI,EAAE,MAAM,EAAE,GAAG,WAAW,GAAG,MAAM,EACrC,IAAI,EAAE,MAAM,GACV,IAAI;IAgFP;;;;OAIG;IACH,SAAS,CAAC,UAAU,IAAI,IAAI;IAIf,OAAO,CAAC,IAAI,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC;IAsB1C,OAAO,IAAI,MAAM;IAIX,SAAS,CAAC,oBAAoB,EAAE,SAAS,GAAG,OAAO,CAAC,IAAI,CAAC;IAgBzD,kBAAkB,CAAC,GAAG,EAAE,MAAM,GAAG,OAAO,CAAC,WAAW,CAAC;IAOrD,WAAW,IAAI,OAAO,CAAC,IAAI,CAAC;CAIzC"}
@@ -14,16 +14,12 @@ const grpcSubscription_1 = require("./grpcSubscription");
14
14
  const orders_1 = require("../math/orders");
15
15
  const numericConstants_1 = require("../constants/numericConstants");
16
16
  class OrderSubscriber {
17
- /** @deprecated Use `velocityClient` instead. `driftClient` will be removed in a future major. */
18
- get driftClient() {
19
- return this.velocityClient;
20
- }
21
17
  constructor(config) {
22
- var _a, _b, _c, _d, _e, _f;
18
+ var _a, _b, _c, _d, _e;
23
19
  this.usersAccounts = new Map();
24
- const velocityClient = (_a = config.velocityClient) !== null && _a !== void 0 ? _a : config.driftClient;
20
+ const velocityClient = config.velocityClient;
25
21
  if (!velocityClient) {
26
- throw new Error('OrderSubscriber: velocityClient (or deprecated driftClient) must be provided');
22
+ throw new Error('OrderSubscriber: velocityClient must be provided');
27
23
  }
28
24
  this.velocityClient = velocityClient;
29
25
  this.commitment = config.subscriptionConfig.commitment || 'processed';
@@ -39,8 +35,8 @@ class OrderSubscriber {
39
35
  grpcConfigs: config.subscriptionConfig.grpcConfigs,
40
36
  skipInitialLoad: config.subscriptionConfig.skipInitialLoad,
41
37
  resubOpts: {
42
- resubTimeoutMs: (_b = config.subscriptionConfig) === null || _b === void 0 ? void 0 : _b.resubTimeoutMs,
43
- logResubMessages: (_c = config.subscriptionConfig) === null || _c === void 0 ? void 0 : _c.logResubMessages,
38
+ resubTimeoutMs: (_a = config.subscriptionConfig) === null || _a === void 0 ? void 0 : _a.resubTimeoutMs,
39
+ logResubMessages: (_b = config.subscriptionConfig) === null || _b === void 0 ? void 0 : _b.logResubMessages,
44
40
  },
45
41
  resyncIntervalMs: config.subscriptionConfig.resyncIntervalMs,
46
42
  decoded: config.decodeData,
@@ -52,14 +48,14 @@ class OrderSubscriber {
52
48
  commitment: this.commitment,
53
49
  skipInitialLoad: config.subscriptionConfig.skipInitialLoad,
54
50
  resubOpts: {
55
- resubTimeoutMs: (_d = config.subscriptionConfig) === null || _d === void 0 ? void 0 : _d.resubTimeoutMs,
56
- logResubMessages: (_e = config.subscriptionConfig) === null || _e === void 0 ? void 0 : _e.logResubMessages,
51
+ resubTimeoutMs: (_c = config.subscriptionConfig) === null || _c === void 0 ? void 0 : _c.resubTimeoutMs,
52
+ logResubMessages: (_d = config.subscriptionConfig) === null || _d === void 0 ? void 0 : _d.logResubMessages,
57
53
  },
58
54
  resyncIntervalMs: config.subscriptionConfig.resyncIntervalMs,
59
55
  decoded: config.decodeData,
60
56
  });
61
57
  }
62
- if ((_f = config.fastDecode) !== null && _f !== void 0 ? _f : true) {
58
+ if ((_e = config.fastDecode) !== null && _e !== void 0 ? _e : true) {
63
59
  this.decodeFn = (name, data) => (0, user_1.decodeUser)(data);
64
60
  }
65
61
  else {
@@ -16,7 +16,7 @@ class WebsocketSubscription {
16
16
  if (this.subscriber) {
17
17
  return;
18
18
  }
19
- this.subscriber = new webSocketProgramAccountSubscriber_1.WebSocketProgramAccountSubscriber('OrderSubscriber', 'user', this.orderSubscriber.driftClient.program, this.orderSubscriber.decodeFn, {
19
+ this.subscriber = new webSocketProgramAccountSubscriber_1.WebSocketProgramAccountSubscriber('OrderSubscriber', 'user', this.orderSubscriber.velocityClient.program, this.orderSubscriber.decodeFn, {
20
20
  filters: [(0, memcmp_1.getUserFilter)(), (0, memcmp_1.getNonIdleUserFilter)()],
21
21
  commitment: this.commitment,
22
22
  }, this.resubOpts);
@@ -19,12 +19,12 @@ class grpcSubscription {
19
19
  }
20
20
  if (this.grpcConfigs.client === 'laser') {
21
21
  this.subscriber =
22
- await laserProgramAccountSubscriber_1.LaserstreamProgramAccountSubscriber.create(this.grpcConfigs, 'OrderSubscriber', 'user', this.orderSubscriber.driftClient.program, this.orderSubscriber.decodeFn, {
22
+ await laserProgramAccountSubscriber_1.LaserstreamProgramAccountSubscriber.create(this.grpcConfigs, 'OrderSubscriber', 'user', this.orderSubscriber.velocityClient.program, this.orderSubscriber.decodeFn, {
23
23
  filters: [(0, memcmp_1.getUserFilter)(), (0, memcmp_1.getNonIdleUserFilter)()],
24
24
  }, this.resubOpts);
25
25
  }
26
26
  else {
27
- this.subscriber = await grpcProgramAccountSubscriber_1.grpcProgramAccountSubscriber.create(this.grpcConfigs, 'OrderSubscriber', 'user', this.orderSubscriber.driftClient.program, this.orderSubscriber.decodeFn, {
27
+ this.subscriber = await grpcProgramAccountSubscriber_1.grpcProgramAccountSubscriber.create(this.grpcConfigs, 'OrderSubscriber', 'user', this.orderSubscriber.velocityClient.program, this.orderSubscriber.decodeFn, {
28
28
  filters: [(0, memcmp_1.getUserFilter)(), (0, memcmp_1.getNonIdleUserFilter)()],
29
29
  }, this.resubOpts);
30
30
  }
@@ -4,8 +4,6 @@ import { VelocityClient } from '../velocityClient';
4
4
  import { GrpcConfigs } from '../accounts/types';
5
5
  export type OrderSubscriberConfig = {
6
6
  velocityClient?: VelocityClient;
7
- /** @deprecated Use `velocityClient` instead. `driftClient` will be removed in a future major. */
8
- driftClient?: VelocityClient;
9
7
  subscriptionConfig: {
10
8
  type: 'polling';
11
9
  frequency: number;
@@ -1 +1 @@
1
- {"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../src/orderSubscriber/types.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,SAAS,EAAE,MAAM,iBAAiB,CAAC;AACxD,OAAO,EAAE,KAAK,EAAE,WAAW,EAAE,MAAM,UAAU,CAAC;AAC9C,OAAO,EAAE,cAAc,EAAE,MAAM,mBAAmB,CAAC;AACnD,OAAO,EAAE,WAAW,EAAE,MAAM,mBAAmB,CAAC;AAEhD,MAAM,MAAM,qBAAqB,GAAG;IACnC,cAAc,CAAC,EAAE,cAAc,CAAC;IAChC,iGAAiG;IACjG,WAAW,CAAC,EAAE,cAAc,CAAC;IAC7B,kBAAkB,EACf;QACA,IAAI,EAAE,SAAS,CAAC;QAChB,SAAS,EAAE,MAAM,CAAC;QAClB,UAAU,CAAC,EAAE,UAAU,CAAC;KACvB,GACD;QACA,IAAI,EAAE,WAAW,CAAC;QAClB,eAAe,CAAC,EAAE,OAAO,CAAC;QAC1B,cAAc,CAAC,EAAE,MAAM,CAAC;QACxB,gBAAgB,CAAC,EAAE,OAAO,CAAC;QAC3B,gBAAgB,CAAC,EAAE,MAAM,CAAC;QAC1B,UAAU,CAAC,EAAE,UAAU,CAAC;KACvB,GACD;QACA,IAAI,EAAE,MAAM,CAAC;QACb,WAAW,EAAE,WAAW,CAAC;QACzB,eAAe,CAAC,EAAE,OAAO,CAAC;QAC1B,cAAc,CAAC,EAAE,MAAM,CAAC;QACxB,gBAAgB,CAAC,EAAE,OAAO,CAAC;QAC3B,gBAAgB,CAAC,EAAE,MAAM,CAAC;QAC1B,UAAU,CAAC,EAAE,UAAU,CAAC;KACvB,CAAC;IACL,U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,gBAAgB,CAAC,EAAE,OAAO,CAAC;QAC3B,gBAAgB,CAAC,EAAE,MAAM,CAAC;QAC1B,UAAU,CAAC,EAAE,UAAU,CAAC;KACvB,GACD;QACA,IAAI,EAAE,MAAM,CAAC;QACb,WAAW,EAAE,WAAW,CAAC;QACzB,eAAe,CAAC,EAAE,OAAO,CAAC;QAC1B,cAAc,CAAC,EAAE,MAAM,CAAC;QACxB,gBAAgB,CAAC,EAAE,OAAO,CAAC;QAC3B,gBAAgB,CAAC,EAAE,MAAM,CAAC;QAC1B,UAAU,CAAC,EAAE,UAAU,CAAC;KACvB,CAAC;IACL,UAAU,CAAC,EAAE,OAAO,CAAC;IACrB,UAAU,CAAC,EAAE,OAAO,CAAC;IACrB,oBAAoB,CAAC,EAAE,OAAO,CAAC;CAC/B,CAAC;AAEF,MAAM,WAAW,qBAAqB;IACrC,YAAY,EAAE,CACb,OAAO,EAAE,WAAW,EACpB,aAAa,EAAE,KAAK,EAAE,EACtB,MAAM,EAAE,SAAS,EACjB,IAAI,EAAE,MAAM,EACZ,QAAQ,EAAE,KAAK,GAAG,SAAS,GAAG,QAAQ,KAClC,IAAI,CAAC;IACV,WAAW,EAAE,CACZ,OAAO,EAAE,WAAW,EACpB,MAAM,EAAE,SAAS,EACjB,IAAI,EAAE,MAAM,EACZ,QAAQ,EAAE,KAAK,GAAG,SAAS,GAAG,QAAQ,KAClC,IAAI,CAAC;IACV,cAAc,EAAE,CACf,MAAM,EAAE,SAAS,EACjB,IAAI,EAAE,MAAM,EACZ,QAAQ,EAAE,KAAK,GAAG,SAAS,GAAG,QAAQ,KAClC,IAAI,CAAC;CACV"}
@@ -9,8 +9,6 @@ export declare class PriorityFeeSubscriber {
9
9
  frequencyMs: number;
10
10
  addresses: string[];
11
11
  velocityMarkets?: VelocityMarketInfo[];
12
- /** @deprecated Use `velocityMarkets` instead. `driftMarkets` will be removed in a future major. */
13
- get driftMarkets(): VelocityMarketInfo[] | undefined;
14
12
  customStrategy?: PriorityFeeStrategy;
15
13
  averageStrategy: AverageOverSlotsStrategy;
16
14
  maxStrategy: MaxOverSlotsStrategy;
@@ -19,8 +17,6 @@ export declare class PriorityFeeSubscriber {
19
17
  maxFeeMicroLamports?: number;
20
18
  priorityFeeMultiplier?: number;
21
19
  velocityPriorityFeeEndpoint?: string;
22
- /** @deprecated Use `velocityPriorityFeeEndpoint` instead. `driftPriorityFeeEndpoint` will be removed in a future major. */
23
- get driftPriorityFeeEndpoint(): string | undefined;
24
20
  heliusRpcUrl?: string;
25
21
  lastHeliusSample?: HeliusPriorityFeeLevels;
26
22
  intervalId?: ReturnType<typeof setTimeout>;
@@ -33,7 +29,7 @@ export declare class PriorityFeeSubscriber {
33
29
  subscribe(): Promise<void>;
34
30
  private loadForSolana;
35
31
  private loadForHelius;
36
- private loadForDrift;
32
+ private loadForVelocity;
37
33
  getMaxPriorityFee(): number | undefined;
38
34
  updateMaxPriorityFee(newMaxFee: number | undefined): void;
39
35
  getPriorityFeeMultiplier(): number;
@@ -1 +1 @@
1
- {"version":3,"file":"priorityFeeSubscriber.d.ts","sourceRoot":"","sources":["../../../src/priorityFee/priorityFeeSubscriber.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,SAAS,EAAE,MAAM,iBAAiB,CAAC;AACxD,OAAO,EAEN,iBAAiB,EACjB,mBAAmB,EACnB,2BAA2B,EAC3B,MAAM,SAAS,CAAC;AACjB,OAAO,EAAE,wBAAwB,EAAE,MAAM,4BAA4B,CAAC;AACtE,OAAO,EAAE,oBAAoB,EAAE,MAAM,wBAAwB,CAAC;AAE9D,OAAO,EACN,uBAAuB,EACvB,mBAAmB,EAEnB,MAAM,2BAA2B,CAAC;AACnC,OAAO,EAEN,kBAAkB,EAClB,MAAM,6BAA6B,CAAC;AAErC,qBAAa,qBAAqB;IACjC,UAAU,EAAE,UAAU,CAAC;IACvB,WAAW,EAAE,MAAM,CAAC;IACpB,SAAS,EAAE,MAAM,EAAE,CAAC;IACpB,eAAe,CAA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C,SAAS,IAAI,OAAO,CAAC,IAAI,CAAC;YASzB,aAAa;YAkBb,aAAa;YAmBb,eAAe;IAkBtB,iBAAiB,IAAI,MAAM,GAAG,SAAS;IAIvC,oBAAoB,CAAC,SAAS,EAAE,MAAM,GAAG,SAAS;IAIlD,wBAAwB,IAAI,MAAM;IAIlC,2BAA2B,CAAC,wBAAwB,EAAE,MAAM;IAI5D,oBAAoB,CAAC,WAAW,EAAE,mBAAmB;IAIrD,yBAAyB,CAC/B,KAAK,GAAE,mBAAgD,GACrD,MAAM;IAUF,uBAAuB,IAAI,MAAM;IASjC,oBAAoB,IAAI,MAAM;IAQ9B,oBAAoB,IAAI,MAAM;IAQxB,IAAI,IAAI,OAAO,CAAC,IAAI,CAAC;IAsBrB,WAAW,IAAI,OAAO,CAAC,IAAI,CAAC;IAOlC,eAAe,CAAC,SAAS,EAAE,SAAS,EAAE;IAItC,wBAAwB,CAAC,eAAe,EAAE,kBAAkB,EAAE;CAGrE"}
@@ -8,16 +8,8 @@ const solanaPriorityFeeMethod_1 = require("./solanaPriorityFeeMethod");
8
8
  const heliusPriorityFeeMethod_1 = require("./heliusPriorityFeeMethod");
9
9
  const velocityPriorityFeeMethod_1 = require("./velocityPriorityFeeMethod");
10
10
  class PriorityFeeSubscriber {
11
- /** @deprecated Use `velocityMarkets` instead. `driftMarkets` will be removed in a future major. */
12
- get driftMarkets() {
13
- return this.velocityMarkets;
14
- }
15
- /** @deprecated Use `velocityPriorityFeeEndpoint` instead. `driftPriorityFeeEndpoint` will be removed in a future major. */
16
- get driftPriorityFeeEndpoint() {
17
- return this.velocityPriorityFeeEndpoint;
18
- }
19
11
  constructor(config) {
20
- var _a, _b, _c, _d, _e;
12
+ var _a, _b, _c, _d;
21
13
  this.averageStrategy = new averageOverSlotsStrategy_1.AverageOverSlotsStrategy();
22
14
  this.maxStrategy = new maxOverSlotsStrategy_1.MaxOverSlotsStrategy();
23
15
  this.priorityFeeMethod = types_1.PriorityFeeMethod.SOLANA;
@@ -32,14 +24,14 @@ class PriorityFeeSubscriber {
32
24
  this.addresses = config.addresses
33
25
  ? config.addresses.map((address) => address.toBase58())
34
26
  : [];
35
- this.velocityMarkets = (_b = config.velocityMarkets) !== null && _b !== void 0 ? _b : config.driftMarkets;
27
+ this.velocityMarkets = config.velocityMarkets;
36
28
  if (config.customStrategy) {
37
29
  this.customStrategy = config.customStrategy;
38
30
  }
39
31
  else {
40
32
  this.customStrategy = this.averageStrategy;
41
33
  }
42
- this.lookbackDistance = (_c = config.slotsToCheck) !== null && _c !== void 0 ? _c : 50;
34
+ this.lookbackDistance = (_b = config.slotsToCheck) !== null && _b !== void 0 ? _b : 50;
43
35
  if (config.priorityFeeMethod) {
44
36
  this.priorityFeeMethod = config.priorityFeeMethod;
45
37
  if (this.priorityFeeMethod === types_1.PriorityFeeMethod.HELIUS) {
@@ -57,7 +49,7 @@ class PriorityFeeSubscriber {
57
49
  }
58
50
  else if (this.priorityFeeMethod === types_1.PriorityFeeMethod.VELOCITY) {
59
51
  this.velocityPriorityFeeEndpoint =
60
- (_d = config.velocityPriorityFeeEndpoint) !== null && _d !== void 0 ? _d : config.driftPriorityFeeEndpoint;
52
+ (_c = config.velocityPriorityFeeEndpoint) !== null && _c !== void 0 ? _c : config.velocityPriorityFeeEndpoint;
61
53
  }
62
54
  }
63
55
  if (this.priorityFeeMethod === types_1.PriorityFeeMethod.SOLANA) {
@@ -66,7 +58,7 @@ class PriorityFeeSubscriber {
66
58
  }
67
59
  }
68
60
  this.maxFeeMicroLamports = config.maxFeeMicroLamports;
69
- this.priorityFeeMultiplier = (_e = config.priorityFeeMultiplier) !== null && _e !== void 0 ? _e : 1.0;
61
+ this.priorityFeeMultiplier = (_d = config.priorityFeeMultiplier) !== null && _d !== void 0 ? _d : 1.0;
70
62
  }
71
63
  async subscribe() {
72
64
  if (this.intervalId) {
@@ -101,7 +93,7 @@ class PriorityFeeSubscriber {
101
93
  }
102
94
  }
103
95
  }
104
- async loadForDrift() {
96
+ async loadForVelocity() {
105
97
  if (!this.velocityMarkets) {
106
98
  return;
107
99
  }
@@ -169,7 +161,7 @@ class PriorityFeeSubscriber {
169
161
  await this.loadForHelius();
170
162
  }
171
163
  else if (this.priorityFeeMethod === types_1.PriorityFeeMethod.VELOCITY) {
172
- await this.loadForDrift();
164
+ await this.loadForVelocity();
173
165
  }
174
166
  else {
175
167
  throw new Error(`${this.priorityFeeMethod} load not implemented`);
@@ -7,11 +7,7 @@ export declare class PriorityFeeSubscriberMap {
7
7
  frequencyMs: number;
8
8
  intervalId?: ReturnType<typeof setTimeout>;
9
9
  velocityMarkets?: VelocityMarketInfo[];
10
- /** @deprecated Use `velocityMarkets` instead. `driftMarkets` will be removed in a future major. */
11
- get driftMarkets(): VelocityMarketInfo[] | undefined;
12
10
  velocityPriorityFeeEndpoint: string;
13
- /** @deprecated Use `velocityPriorityFeeEndpoint` instead. `driftPriorityFeeEndpoint` will be removed in a future major. */
14
- get driftPriorityFeeEndpoint(): string;
15
11
  feesMap: Map<string, Map<number, VelocityPriorityFeeLevels>>;
16
12
  constructor(config: PriorityFeeSubscriberMapConfig);
17
13
  private updateFeesMap;
@@ -1 +1 @@
1
- {"version":3,"file":"priorityFeeSubscriberMap.d.ts","sourceRoot":"","sources":["../../../src/priorityFee/priorityFeeSubscriberMap.ts"],"names":[],"mappings":"AAAA,OAAO,EACN,kBAAkB,EAClB,yBAAyB,EAGzB,MAAM,6BAA6B,CAAC;AACrC,OAAO,EAEN,8BAA8B,EAC9B,MAAM,SAAS,CAAC;AAEjB;;GAEG;AACH,qBAAa,wBAAwB;IACpC,WAAW,EAAE,MAAM,CAAC;IACpB,UAAU,CAAC,EAAE,UAAU,CAAC,OAAO,UAAU,CAAC,CAAC;IAE3C,eAAe,CAAC,EAAE,kBAAkB,EAAE,CAAC;IACvC,mGAAmG;IACnG,IAAW,YAAY,IAAI,kBAAkB,EAAE,GAAG,SAAS,CAE1D;IACD,2BAA2B,EAAE,MAAM,CAAC;IACpC,2HAA2H;IAC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,EAAE,kBAAkB,EAAE;IAI9D,eAAe,CACrB,UAAU,EAAE,MAAM,EAClB,WAAW,EAAE,MAAM,GACjB,yBAAyB,GAAG,SAAS;CAGxC;AAED;;;;;;;;;;;;;;;;;;;;;;;;;;;;EA4BE"}
@@ -7,21 +7,13 @@ const types_1 = require("./types");
7
7
  * takes advantage of /batchPriorityFees endpoint from Velocity hosted priority fee service
8
8
  */
9
9
  class PriorityFeeSubscriberMap {
10
- /** @deprecated Use `velocityMarkets` instead. `driftMarkets` will be removed in a future major. */
11
- get driftMarkets() {
12
- return this.velocityMarkets;
13
- }
14
- /** @deprecated Use `velocityPriorityFeeEndpoint` instead. `driftPriorityFeeEndpoint` will be removed in a future major. */
15
- get driftPriorityFeeEndpoint() {
16
- return this.velocityPriorityFeeEndpoint;
17
- }
18
10
  constructor(config) {
19
- var _a, _b, _c;
11
+ var _a, _b;
20
12
  this.frequencyMs =
21
13
  (_a = config.frequencyMs) !== null && _a !== void 0 ? _a : types_1.DEFAULT_PRIORITY_FEE_MAP_FREQUENCY_MS;
22
14
  // Type-system guarantees at least one of the two is supplied.
23
- this.velocityPriorityFeeEndpoint = ((_b = config.velocityPriorityFeeEndpoint) !== null && _b !== void 0 ? _b : config.driftPriorityFeeEndpoint);
24
- this.velocityMarkets = (_c = config.velocityMarkets) !== null && _c !== void 0 ? _c : config.driftMarkets;
15
+ this.velocityPriorityFeeEndpoint = ((_b = config.velocityPriorityFeeEndpoint) !== null && _b !== void 0 ? _b : config.velocityPriorityFeeEndpoint);
16
+ this.velocityMarkets = config.velocityMarkets;
25
17
  this.feesMap = new Map();
26
18
  this.feesMap.set('perp', new Map());
27
19
  this.feesMap.set('spot', new Map());
@@ -2,7 +2,6 @@ import { Connection, PublicKey } from '@solana/web3.js';
2
2
  import { SolanaPriorityFeeResponse } from './solanaPriorityFeeMethod';
3
3
  import { HeliusPriorityFeeResponse } from './heliusPriorityFeeMethod';
4
4
  import { VelocityMarketInfo, VelocityPriorityFeeResponse } from './velocityPriorityFeeMethod';
5
- import { AtLeastOne } from '../util/deprecatedAlias';
6
5
  export declare const DEFAULT_PRIORITY_FEE_MAP_FREQUENCY_MS = 10000;
7
6
  export interface PriorityFeeStrategy {
8
7
  calculate(samples: SolanaPriorityFeeResponse[] | HeliusPriorityFeeResponse | VelocityPriorityFeeResponse): number;
@@ -17,24 +16,20 @@ export type PriorityFeeSubscriberConfig = {
17
16
  frequencyMs?: number;
18
17
  addresses?: PublicKey[];
19
18
  velocityMarkets?: VelocityMarketInfo[];
20
- /** @deprecated Use `velocityMarkets` instead. `driftMarkets` will be removed in a future major. */
21
- driftMarkets?: VelocityMarketInfo[];
22
19
  customStrategy?: PriorityFeeStrategy;
23
20
  priorityFeeMethod?: PriorityFeeMethod;
24
21
  slotsToCheck?: number;
25
22
  heliusRpcUrl?: string;
26
23
  velocityPriorityFeeEndpoint?: string;
27
- /** @deprecated Use `velocityPriorityFeeEndpoint` instead. `driftPriorityFeeEndpoint` will be removed in a future major. */
28
- driftPriorityFeeEndpoint?: string;
29
24
  maxFeeMicroLamports?: number;
30
25
  priorityFeeMultiplier?: number;
31
26
  };
32
27
  type PriorityFeeSubscriberMapConfigBase = {
33
28
  frequencyMs?: number;
34
29
  velocityMarkets?: VelocityMarketInfo[];
35
- /** @deprecated Use `velocityMarkets` instead. `driftMarkets` will be removed in a future major. */
36
- driftMarkets?: VelocityMarketInfo[];
37
30
  };
38
- export type PriorityFeeSubscriberMapConfig = PriorityFeeSubscriberMapConfigBase & AtLeastOne<'velocityPriorityFeeEndpoint', 'driftPriorityFeeEndpoint', string>;
31
+ export type PriorityFeeSubscriberMapConfig = PriorityFeeSubscriberMapConfigBase & {
32
+ velocityPriorityFeeEndpoint: string;
33
+ };
39
34
  export {};
40
35
  //# sourceMappingURL=types.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../src/priorityFee/types.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,SAAS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E,MAAM,CAAC;IAErB,eAAe,CAAC,EAAE,kBAAkB,EAAE,CAAC;CACvC,CAAC;AAGF,MAAM,MAAM,8BAA8B,GACzC,kCAAkC,GAAG;IACpC,2BAA2B,EAAE,MAAM,CAAC;CACpC,CAAC"}
@@ -3,20 +3,12 @@ export type VelocityMarketInfo = {
3
3
  marketType: string;
4
4
  marketIndex: number;
5
5
  };
6
- /** @deprecated Use `VelocityMarketInfo` instead. `DriftMarketInfo` will be removed in a future major. */
7
- export type DriftMarketInfo = VelocityMarketInfo;
8
6
  export type VelocityPriorityFeeLevels = {
9
7
  [key in HeliusPriorityLevel]: number;
10
8
  } & {
11
9
  marketType: 'perp' | 'spot';
12
10
  marketIndex: number;
13
11
  };
14
- /** @deprecated Use `VelocityPriorityFeeLevels` instead. `DriftPriorityFeeLevels` will be removed in a future major. */
15
- export type DriftPriorityFeeLevels = VelocityPriorityFeeLevels;
16
12
  export type VelocityPriorityFeeResponse = VelocityPriorityFeeLevels[];
17
- /** @deprecated Use `VelocityPriorityFeeResponse` instead. `DriftPriorityFeeResponse` will be removed in a future major. */
18
- export type DriftPriorityFeeResponse = VelocityPriorityFeeResponse;
19
13
  export declare function fetchVelocityPriorityFee(url: string, marketTypes: string[], marketIndexes: number[]): Promise<VelocityPriorityFeeResponse>;
20
- /** @deprecated Use `fetchVelocityPriorityFee` instead. `fetchDriftPriorityFee` will be removed in a future major. */
21
- export declare const fetchDriftPriorityFee: typeof fetchVelocityPriorityFee;
22
14
  //# sourceMappingURL=velocityPriorityFeeMethod.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"velocityPriorityFeeMethod.d.ts","sourceRoot":"","sources":["../../../src/priorityFee/velocityPriorityFeeMethod.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,mBAAmB,EAAE,MAAM,2BAA2B,CAAC;AAEhE,MAAM,MAAM,kBAAkB,GAAG;IAChC,UAAU,EAAE,MAAM,CAAC;IACnB,WAAW,EAAE,MAAM,CAAC;CACpB,CAAC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AC,CAoBtC"}
@@ -3,7 +3,7 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
3
3
  return (mod && mod.__esModule) ? mod : { "default": mod };
4
4
  };
5
5
  Object.defineProperty(exports, "__esModule", { value: true });
6
- exports.fetchDriftPriorityFee = exports.fetchVelocityPriorityFee = void 0;
6
+ exports.fetchVelocityPriorityFee = void 0;
7
7
  const node_fetch_1 = __importDefault(require("node-fetch"));
8
8
  async function fetchVelocityPriorityFee(url, marketTypes, marketIndexes) {
9
9
  try {
@@ -24,5 +24,3 @@ async function fetchVelocityPriorityFee(url, marketTypes, marketIndexes) {
24
24
  return [];
25
25
  }
26
26
  exports.fetchVelocityPriorityFee = fetchVelocityPriorityFee;
27
- /** @deprecated Use `fetchVelocityPriorityFee` instead. `fetchDriftPriorityFee` will be removed in a future major. */
28
- exports.fetchDriftPriorityFee = fetchVelocityPriorityFee;
@@ -39,7 +39,7 @@ export declare class PythLazerSubscriber {
39
39
  * @param endpoints - Array of WebSocket endpoint URLs for Pyth Lazer
40
40
  * @param token - Authentication token for Pyth Lazer API
41
41
  * @param priceFeedArrays - Array of price feed configurations to subscribe to
42
- * @param env - Drift environment (mainnet-beta, devnet, etc.)
42
+ * @param env - Velocity environment (mainnet-beta, devnet, etc.)
43
43
  * @param resubTimeoutMs - Milliseconds to wait before resubscribing on data timeout
44
44
  * @param sdkLogging - Whether to log Pyth SDK logs to the console. This is very noisy but could be useful for debugging.
45
45
  * @param feedProperties - Price feed properties to request. Must include both 'price' and 'exponent' (required for getPriceFromMarketIndex). Defaults to ['price', 'bestAskPrice', 'bestBidPrice', 'exponent']. Stored by copy so caller mutation does not affect this instance.
@@ -13,7 +13,7 @@ class PythLazerSubscriber {
13
13
  * @param endpoints - Array of WebSocket endpoint URLs for Pyth Lazer
14
14
  * @param token - Authentication token for Pyth Lazer API
15
15
  * @param priceFeedArrays - Array of price feed configurations to subscribe to
16
- * @param env - Drift environment (mainnet-beta, devnet, etc.)
16
+ * @param env - Velocity environment (mainnet-beta, devnet, etc.)
17
17
  * @param resubTimeoutMs - Milliseconds to wait before resubscribing on data timeout
18
18
  * @param sdkLogging - Whether to log Pyth SDK logs to the console. This is very noisy but could be useful for debugging.
19
19
  * @param feedProperties - Price feed properties to request. Must include both 'price' and 'exponent' (required for getPriceFromMarketIndex). Defaults to ['price', 'bestAskPrice', 'bestBidPrice', 'exponent']. Stored by copy so caller mutation does not affect this instance.
@@ -140,7 +140,7 @@ class UnifiedSwapClient {
140
140
  slippageBps,
141
141
  swapMode: isExactOut ? titanClient_1.SwapMode.ExactOut : titanClient_1.SwapMode.ExactIn,
142
142
  onlyDirectRoutes,
143
- sizeConstraint: sizeConstraint || 1280 - 375, // MAX_TX_BYTE_SIZE - buffer for drift instructions
143
+ sizeConstraint: sizeConstraint || 1280 - 375, // MAX_TX_BYTE_SIZE - buffer for velocity instructions
144
144
  });
145
145
  swapInstructions = titanClient.getTitanInstructions({
146
146
  transactionMessage,