@drift-labs/common 1.0.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 (400) hide show
  1. package/lib/Config.d.ts +26 -0
  2. package/lib/Config.js +29 -0
  3. package/lib/Config.js.map +1 -0
  4. package/lib/EnvironmentConstants.d.ts +40 -0
  5. package/lib/EnvironmentConstants.js +64 -0
  6. package/lib/EnvironmentConstants.js.map +1 -0
  7. package/lib/actions/actionHelpers/accountDeletionHelpers.d.ts +16 -0
  8. package/lib/actions/actionHelpers/accountDeletionHelpers.js +151 -0
  9. package/lib/actions/actionHelpers/accountDeletionHelpers.js.map +1 -0
  10. package/lib/actions/actionHelpers/actionHelpers.d.ts +13 -0
  11. package/lib/actions/actionHelpers/actionHelpers.js +8 -0
  12. package/lib/actions/actionHelpers/actionHelpers.js.map +1 -0
  13. package/lib/chartConstants.d.ts +2 -0
  14. package/lib/chartConstants.js +14 -0
  15. package/lib/chartConstants.js.map +1 -0
  16. package/lib/clients/candleClient.d.ts +74 -0
  17. package/lib/clients/candleClient.js +364 -0
  18. package/lib/clients/candleClient.js.map +1 -0
  19. package/lib/clients/dataApiWsClient.d.ts +33 -0
  20. package/lib/clients/dataApiWsClient.js +118 -0
  21. package/lib/clients/dataApiWsClient.js.map +1 -0
  22. package/lib/clients/index.d.ts +1 -0
  23. package/lib/clients/index.js +19 -0
  24. package/lib/clients/index.js.map +1 -0
  25. package/lib/clients/marketDataFeed.d.ts +42 -0
  26. package/lib/clients/marketDataFeed.js +422 -0
  27. package/lib/clients/marketDataFeed.js.map +1 -0
  28. package/lib/clients/redisClient.d.ts +89 -0
  29. package/lib/clients/redisClient.js +647 -0
  30. package/lib/clients/redisClient.js.map +1 -0
  31. package/lib/clients/swiftClient.d.ts +57 -0
  32. package/lib/clients/swiftClient.js +289 -0
  33. package/lib/clients/swiftClient.js.map +1 -0
  34. package/lib/clients/tvFeed.d.ts +63 -0
  35. package/lib/clients/tvFeed.js +351 -0
  36. package/lib/clients/tvFeed.js.map +1 -0
  37. package/lib/common-ui-utils/commonUiUtils.d.ts +211 -0
  38. package/lib/common-ui-utils/commonUiUtils.js +624 -0
  39. package/lib/common-ui-utils/commonUiUtils.js.map +1 -0
  40. package/lib/common-ui-utils/index.d.ts +6 -0
  41. package/lib/common-ui-utils/index.js +23 -0
  42. package/lib/common-ui-utils/index.js.map +1 -0
  43. package/lib/common-ui-utils/market.d.ts +27 -0
  44. package/lib/common-ui-utils/market.js +80 -0
  45. package/lib/common-ui-utils/market.js.map +1 -0
  46. package/lib/common-ui-utils/order.d.ts +11 -0
  47. package/lib/common-ui-utils/order.js +161 -0
  48. package/lib/common-ui-utils/order.js.map +1 -0
  49. package/lib/common-ui-utils/settings/settings.d.ts +51 -0
  50. package/lib/common-ui-utils/settings/settings.js +84 -0
  51. package/lib/common-ui-utils/settings/settings.js.map +1 -0
  52. package/lib/common-ui-utils/trading.d.ts +56 -0
  53. package/lib/common-ui-utils/trading.js +200 -0
  54. package/lib/common-ui-utils/trading.js.map +1 -0
  55. package/lib/common-ui-utils/user.d.ts +13 -0
  56. package/lib/common-ui-utils/user.js +124 -0
  57. package/lib/common-ui-utils/user.js.map +1 -0
  58. package/lib/constants/autogenerated/driftErrors.json +1787 -0
  59. package/lib/constants/autogenerated/jup-v4-error-codes.json +67 -0
  60. package/lib/constants/autogenerated/jup-v6-error-codes.json +115 -0
  61. package/lib/constants/dev.d.ts +15 -0
  62. package/lib/constants/dev.js +19 -0
  63. package/lib/constants/dev.js.map +1 -0
  64. package/lib/constants/geoblockList.d.ts +4 -0
  65. package/lib/constants/geoblockList.js +32 -0
  66. package/lib/constants/geoblockList.js.map +1 -0
  67. package/lib/constants/index.d.ts +9 -0
  68. package/lib/constants/index.js +26 -0
  69. package/lib/constants/index.js.map +1 -0
  70. package/lib/constants/markets.d.ts +1 -0
  71. package/lib/constants/markets.js +5 -0
  72. package/lib/constants/markets.js.map +1 -0
  73. package/lib/constants/misc.d.ts +23 -0
  74. package/lib/constants/misc.js +27 -0
  75. package/lib/constants/misc.js.map +1 -0
  76. package/lib/constants/orders.d.ts +12 -0
  77. package/lib/constants/orders.js +79 -0
  78. package/lib/constants/orders.js.map +1 -0
  79. package/lib/constants/pools.d.ts +5 -0
  80. package/lib/constants/pools.js +9 -0
  81. package/lib/constants/pools.js.map +1 -0
  82. package/lib/constants/predictionMarket.d.ts +3 -0
  83. package/lib/constants/predictionMarket.js +7 -0
  84. package/lib/constants/predictionMarket.js.map +1 -0
  85. package/lib/constants/superstake.d.ts +22 -0
  86. package/lib/constants/superstake.js +45 -0
  87. package/lib/constants/superstake.js.map +1 -0
  88. package/lib/constants/trade.d.ts +2 -0
  89. package/lib/constants/trade.js +9 -0
  90. package/lib/constants/trade.js.map +1 -0
  91. package/lib/drift/Drift/clients/AuthorityDrift/DriftL2OrderbookManager.d.ts +68 -0
  92. package/lib/drift/Drift/clients/AuthorityDrift/DriftL2OrderbookManager.js +146 -0
  93. package/lib/drift/Drift/clients/AuthorityDrift/DriftL2OrderbookManager.js.map +1 -0
  94. package/lib/drift/Drift/clients/AuthorityDrift/DriftOperations/index.d.ts +204 -0
  95. package/lib/drift/Drift/clients/AuthorityDrift/DriftOperations/index.js +530 -0
  96. package/lib/drift/Drift/clients/AuthorityDrift/DriftOperations/index.js.map +1 -0
  97. package/lib/drift/Drift/clients/AuthorityDrift/DriftOperations/types.d.ts +90 -0
  98. package/lib/drift/Drift/clients/AuthorityDrift/DriftOperations/types.js +3 -0
  99. package/lib/drift/Drift/clients/AuthorityDrift/DriftOperations/types.js.map +1 -0
  100. package/lib/drift/Drift/clients/AuthorityDrift/SubscriptionManager.d.ts +139 -0
  101. package/lib/drift/Drift/clients/AuthorityDrift/SubscriptionManager.js +287 -0
  102. package/lib/drift/Drift/clients/AuthorityDrift/SubscriptionManager.js.map +1 -0
  103. package/lib/drift/Drift/clients/AuthorityDrift/index.d.ts +242 -0
  104. package/lib/drift/Drift/clients/AuthorityDrift/index.js +503 -0
  105. package/lib/drift/Drift/clients/AuthorityDrift/index.js.map +1 -0
  106. package/lib/drift/Drift/clients/CentralServerDrift.d.ts +91 -0
  107. package/lib/drift/Drift/clients/CentralServerDrift.js +326 -0
  108. package/lib/drift/Drift/clients/CentralServerDrift.js.map +1 -0
  109. package/lib/drift/Drift/clients/index.d.ts +3 -0
  110. package/lib/drift/Drift/clients/index.js +20 -0
  111. package/lib/drift/Drift/clients/index.js.map +1 -0
  112. package/lib/drift/Drift/constants/blockchain.d.ts +24 -0
  113. package/lib/drift/Drift/constants/blockchain.js +32 -0
  114. package/lib/drift/Drift/constants/blockchain.js.map +1 -0
  115. package/lib/drift/Drift/constants/errors.d.ts +6 -0
  116. package/lib/drift/Drift/constants/errors.js +14 -0
  117. package/lib/drift/Drift/constants/errors.js.map +1 -0
  118. package/lib/drift/Drift/constants/index.d.ts +3 -0
  119. package/lib/drift/Drift/constants/index.js +20 -0
  120. package/lib/drift/Drift/constants/index.js.map +1 -0
  121. package/lib/drift/Drift/constants/orderbook.d.ts +7 -0
  122. package/lib/drift/Drift/constants/orderbook.js +10 -0
  123. package/lib/drift/Drift/constants/orderbook.js.map +1 -0
  124. package/lib/drift/Drift/data/PollingDlob.d.ts +154 -0
  125. package/lib/drift/Drift/data/PollingDlob.js +387 -0
  126. package/lib/drift/Drift/data/PollingDlob.js.map +1 -0
  127. package/lib/drift/Drift/data/index.d.ts +1 -0
  128. package/lib/drift/Drift/data/index.js +18 -0
  129. package/lib/drift/Drift/data/index.js.map +1 -0
  130. package/lib/drift/Drift/index.d.ts +4 -0
  131. package/lib/drift/Drift/index.js +21 -0
  132. package/lib/drift/Drift/index.js.map +1 -0
  133. package/lib/drift/Drift/stores/MarkPriceCache.d.ts +27 -0
  134. package/lib/drift/Drift/stores/MarkPriceCache.js +59 -0
  135. package/lib/drift/Drift/stores/MarkPriceCache.js.map +1 -0
  136. package/lib/drift/Drift/stores/OraclePriceCache.d.ts +21 -0
  137. package/lib/drift/Drift/stores/OraclePriceCache.js +57 -0
  138. package/lib/drift/Drift/stores/OraclePriceCache.js.map +1 -0
  139. package/lib/drift/Drift/stores/UserAccountCache.d.ts +49 -0
  140. package/lib/drift/Drift/stores/UserAccountCache.js +107 -0
  141. package/lib/drift/Drift/stores/UserAccountCache.js.map +1 -0
  142. package/lib/drift/Drift/stores/index.d.ts +3 -0
  143. package/lib/drift/Drift/stores/index.js +20 -0
  144. package/lib/drift/Drift/stores/index.js.map +1 -0
  145. package/lib/drift/base/actions/index.d.ts +4 -0
  146. package/lib/drift/base/actions/index.js +21 -0
  147. package/lib/drift/base/actions/index.js.map +1 -0
  148. package/lib/drift/base/actions/perp/index.d.ts +2 -0
  149. package/lib/drift/base/actions/perp/index.js +19 -0
  150. package/lib/drift/base/actions/perp/index.js.map +1 -0
  151. package/lib/drift/base/actions/perp/settleFunding.d.ts +25 -0
  152. package/lib/drift/base/actions/perp/settleFunding.js +41 -0
  153. package/lib/drift/base/actions/perp/settleFunding.js.map +1 -0
  154. package/lib/drift/base/actions/perp/settlePnl.d.ts +35 -0
  155. package/lib/drift/base/actions/perp/settlePnl.js +44 -0
  156. package/lib/drift/base/actions/perp/settlePnl.js.map +1 -0
  157. package/lib/drift/base/actions/spot/borrow.d.ts +1 -0
  158. package/lib/drift/base/actions/spot/borrow.js +8 -0
  159. package/lib/drift/base/actions/spot/borrow.js.map +1 -0
  160. package/lib/drift/base/actions/spot/deposit.d.ts +40 -0
  161. package/lib/drift/base/actions/spot/deposit.js +82 -0
  162. package/lib/drift/base/actions/spot/deposit.js.map +1 -0
  163. package/lib/drift/base/actions/spot/index.d.ts +3 -0
  164. package/lib/drift/base/actions/spot/index.js +20 -0
  165. package/lib/drift/base/actions/spot/index.js.map +1 -0
  166. package/lib/drift/base/actions/spot/withdraw.d.ts +16 -0
  167. package/lib/drift/base/actions/spot/withdraw.js +39 -0
  168. package/lib/drift/base/actions/spot/withdraw.js.map +1 -0
  169. package/lib/drift/base/actions/trade/cancelOrder.d.ts +47 -0
  170. package/lib/drift/base/actions/trade/cancelOrder.js +55 -0
  171. package/lib/drift/base/actions/trade/cancelOrder.js.map +1 -0
  172. package/lib/drift/base/actions/trade/editOrder.d.ts +55 -0
  173. package/lib/drift/base/actions/trade/editOrder.js +35 -0
  174. package/lib/drift/base/actions/trade/editOrder.js.map +1 -0
  175. package/lib/drift/base/actions/trade/index.d.ts +4 -0
  176. package/lib/drift/base/actions/trade/index.js +21 -0
  177. package/lib/drift/base/actions/trade/index.js.map +1 -0
  178. package/lib/drift/base/actions/trade/openPerpOrder/index.d.ts +3 -0
  179. package/lib/drift/base/actions/trade/openPerpOrder/index.js +20 -0
  180. package/lib/drift/base/actions/trade/openPerpOrder/index.js.map +1 -0
  181. package/lib/drift/base/actions/trade/openPerpOrder/openPerpMarketOrder/index.d.ts +84 -0
  182. package/lib/drift/base/actions/trade/openPerpOrder/openPerpMarketOrder/index.js +293 -0
  183. package/lib/drift/base/actions/trade/openPerpOrder/openPerpMarketOrder/index.js.map +1 -0
  184. package/lib/drift/base/actions/trade/openPerpOrder/openPerpNonMarketOrder/index.d.ts +19 -0
  185. package/lib/drift/base/actions/trade/openPerpOrder/openPerpNonMarketOrder/index.js +161 -0
  186. package/lib/drift/base/actions/trade/openPerpOrder/openPerpNonMarketOrder/index.js.map +1 -0
  187. package/lib/drift/base/actions/trade/openPerpOrder/openSwiftOrder/index.d.ts +166 -0
  188. package/lib/drift/base/actions/trade/openPerpOrder/openSwiftOrder/index.js +156 -0
  189. package/lib/drift/base/actions/trade/openPerpOrder/openSwiftOrder/index.js.map +1 -0
  190. package/lib/drift/base/actions/trade/swap.d.ts +62 -0
  191. package/lib/drift/base/actions/trade/swap.js +60 -0
  192. package/lib/drift/base/actions/trade/swap.js.map +1 -0
  193. package/lib/drift/base/actions/user/create.d.ts +75 -0
  194. package/lib/drift/base/actions/user/create.js +104 -0
  195. package/lib/drift/base/actions/user/create.js.map +1 -0
  196. package/lib/drift/base/actions/user/delete.d.ts +47 -0
  197. package/lib/drift/base/actions/user/delete.js +39 -0
  198. package/lib/drift/base/actions/user/delete.js.map +1 -0
  199. package/lib/drift/base/actions/user/index.d.ts +1 -0
  200. package/lib/drift/base/actions/user/index.js +18 -0
  201. package/lib/drift/base/actions/user/index.js.map +1 -0
  202. package/lib/drift/base/constants/accountNames.d.ts +1 -0
  203. package/lib/drift/base/constants/accountNames.js +13 -0
  204. package/lib/drift/base/constants/accountNames.js.map +1 -0
  205. package/lib/drift/base/details/index.d.ts +2 -0
  206. package/lib/drift/base/details/index.js +19 -0
  207. package/lib/drift/base/details/index.js.map +1 -0
  208. package/lib/drift/base/details/market/funding.d.ts +9 -0
  209. package/lib/drift/base/details/market/funding.js +50 -0
  210. package/lib/drift/base/details/market/funding.js.map +1 -0
  211. package/lib/drift/base/details/market/index.d.ts +2 -0
  212. package/lib/drift/base/details/market/index.js +19 -0
  213. package/lib/drift/base/details/market/index.js.map +1 -0
  214. package/lib/drift/base/details/market/openInterest.d.ts +5 -0
  215. package/lib/drift/base/details/market/openInterest.js +12 -0
  216. package/lib/drift/base/details/market/openInterest.js.map +1 -0
  217. package/lib/drift/base/details/user/balances.d.ts +40 -0
  218. package/lib/drift/base/details/user/balances.js +39 -0
  219. package/lib/drift/base/details/user/balances.js.map +1 -0
  220. package/lib/drift/base/details/user/index.d.ts +4 -0
  221. package/lib/drift/base/details/user/index.js +21 -0
  222. package/lib/drift/base/details/user/index.js.map +1 -0
  223. package/lib/drift/base/details/user/marginInfo.d.ts +29 -0
  224. package/lib/drift/base/details/user/marginInfo.js +49 -0
  225. package/lib/drift/base/details/user/marginInfo.js.map +1 -0
  226. package/lib/drift/base/details/user/orders.d.ts +3 -0
  227. package/lib/drift/base/details/user/orders.js +11 -0
  228. package/lib/drift/base/details/user/orders.js.map +1 -0
  229. package/lib/drift/base/details/user/positions.d.ts +70 -0
  230. package/lib/drift/base/details/user/positions.js +146 -0
  231. package/lib/drift/base/details/user/positions.js.map +1 -0
  232. package/lib/drift/cli.d.ts +25 -0
  233. package/lib/drift/cli.js +900 -0
  234. package/lib/drift/cli.js.map +1 -0
  235. package/lib/drift/constants/apiUrls.d.ts +27 -0
  236. package/lib/drift/constants/apiUrls.js +31 -0
  237. package/lib/drift/constants/apiUrls.js.map +1 -0
  238. package/lib/drift/example.d.ts +19 -0
  239. package/lib/drift/example.js +249 -0
  240. package/lib/drift/example.js.map +1 -0
  241. package/lib/drift/index.d.ts +3 -0
  242. package/lib/drift/index.js +20 -0
  243. package/lib/drift/index.js.map +1 -0
  244. package/lib/drift/utils/auctionParamsResponseMapper.d.ts +45 -0
  245. package/lib/drift/utils/auctionParamsResponseMapper.js +148 -0
  246. package/lib/drift/utils/auctionParamsResponseMapper.js.map +1 -0
  247. package/lib/drift/utils/funding.d.ts +2 -0
  248. package/lib/drift/utils/funding.js +9 -0
  249. package/lib/drift/utils/funding.js.map +1 -0
  250. package/lib/drift/utils/index.d.ts +3 -0
  251. package/lib/drift/utils/index.js +23 -0
  252. package/lib/drift/utils/index.js.map +1 -0
  253. package/lib/drift/utils/orderParams.d.ts +48 -0
  254. package/lib/drift/utils/orderParams.js +140 -0
  255. package/lib/drift/utils/orderParams.js.map +1 -0
  256. package/lib/index.d.ts +45 -0
  257. package/lib/index.js +68 -0
  258. package/lib/index.js.map +1 -0
  259. package/lib/serializableTypes.d.ts +961 -0
  260. package/lib/serializableTypes.js +3887 -0
  261. package/lib/serializableTypes.js.map +1 -0
  262. package/lib/types/MarketId.d.ts +26 -0
  263. package/lib/types/MarketId.js +64 -0
  264. package/lib/types/MarketId.js.map +1 -0
  265. package/lib/types/Superstake.d.ts +7 -0
  266. package/lib/types/Superstake.js +3 -0
  267. package/lib/types/Superstake.js.map +1 -0
  268. package/lib/types/UIEnv.d.ts +26 -0
  269. package/lib/types/UIEnv.js +49 -0
  270. package/lib/types/UIEnv.js.map +1 -0
  271. package/lib/types/UIMarket.d.ts +94 -0
  272. package/lib/types/UIMarket.js +224 -0
  273. package/lib/types/UIMarket.js.map +1 -0
  274. package/lib/types/candles.d.ts +4 -0
  275. package/lib/types/candles.js +9 -0
  276. package/lib/types/candles.js.map +1 -0
  277. package/lib/types/dataServer.d.ts +53 -0
  278. package/lib/types/dataServer.js +3 -0
  279. package/lib/types/dataServer.js.map +1 -0
  280. package/lib/types/historyServer.d.ts +38 -0
  281. package/lib/types/historyServer.js +11 -0
  282. package/lib/types/historyServer.js.map +1 -0
  283. package/lib/types/index.d.ts +12 -0
  284. package/lib/types/index.js +29 -0
  285. package/lib/types/index.js.map +1 -0
  286. package/lib/types/leaderboard.d.ts +80 -0
  287. package/lib/types/leaderboard.js +11 -0
  288. package/lib/types/leaderboard.js.map +1 -0
  289. package/lib/types/remote-configs.d.ts +61 -0
  290. package/lib/types/remote-configs.js +3 -0
  291. package/lib/types/remote-configs.js.map +1 -0
  292. package/lib/types/trade.d.ts +18 -0
  293. package/lib/types/trade.js +3 -0
  294. package/lib/types/trade.js.map +1 -0
  295. package/lib/types/user.d.ts +40 -0
  296. package/lib/types/user.js +3 -0
  297. package/lib/types/user.js.map +1 -0
  298. package/lib/types/utility.d.ts +15 -0
  299. package/lib/types/utility.js +3 -0
  300. package/lib/types/utility.js.map +1 -0
  301. package/lib/utils/CircularBuffers/CircularBuffer.d.ts +22 -0
  302. package/lib/utils/CircularBuffers/CircularBuffer.js +73 -0
  303. package/lib/utils/CircularBuffers/CircularBuffer.js.map +1 -0
  304. package/lib/utils/CircularBuffers/UniqueCircularBuffer.d.ts +19 -0
  305. package/lib/utils/CircularBuffers/UniqueCircularBuffer.js +78 -0
  306. package/lib/utils/CircularBuffers/UniqueCircularBuffer.js.map +1 -0
  307. package/lib/utils/CircularBuffers/index.d.ts +2 -0
  308. package/lib/utils/CircularBuffers/index.js +19 -0
  309. package/lib/utils/CircularBuffers/index.js.map +1 -0
  310. package/lib/utils/MultiplexWebSocket.d.ts +95 -0
  311. package/lib/utils/MultiplexWebSocket.js +416 -0
  312. package/lib/utils/MultiplexWebSocket.js.map +1 -0
  313. package/lib/utils/NumLib.d.ts +106 -0
  314. package/lib/utils/NumLib.js +300 -0
  315. package/lib/utils/NumLib.js.map +1 -0
  316. package/lib/utils/SharedInterval.d.ts +21 -0
  317. package/lib/utils/SharedInterval.js +47 -0
  318. package/lib/utils/SharedInterval.js.map +1 -0
  319. package/lib/utils/SlotBasedResultValidator.d.ts +9 -0
  320. package/lib/utils/SlotBasedResultValidator.js +27 -0
  321. package/lib/utils/SlotBasedResultValidator.js.map +1 -0
  322. package/lib/utils/Stopwatch.d.ts +15 -0
  323. package/lib/utils/Stopwatch.js +31 -0
  324. package/lib/utils/Stopwatch.js.map +1 -0
  325. package/lib/utils/StrictEventEmitter.d.ts +15 -0
  326. package/lib/utils/StrictEventEmitter.js +55 -0
  327. package/lib/utils/StrictEventEmitter.js.map +1 -0
  328. package/lib/utils/WalletConnectionState.d.ts +31 -0
  329. package/lib/utils/WalletConnectionState.js +83 -0
  330. package/lib/utils/WalletConnectionState.js.map +1 -0
  331. package/lib/utils/assert.d.ts +1 -0
  332. package/lib/utils/assert.js +10 -0
  333. package/lib/utils/assert.js.map +1 -0
  334. package/lib/utils/candles/Candle.d.ts +94 -0
  335. package/lib/utils/candles/Candle.js +580 -0
  336. package/lib/utils/candles/Candle.js.map +1 -0
  337. package/lib/utils/candles/types.d.ts +8 -0
  338. package/lib/utils/candles/types.js +3 -0
  339. package/lib/utils/candles/types.js.map +1 -0
  340. package/lib/utils/dlob-server/DlobServerWebsocketUtils.d.ts +57 -0
  341. package/lib/utils/dlob-server/DlobServerWebsocketUtils.js +137 -0
  342. package/lib/utils/dlob-server/DlobServerWebsocketUtils.js.map +1 -0
  343. package/lib/utils/driftEvents.d.ts +10 -0
  344. package/lib/utils/driftEvents.js +123 -0
  345. package/lib/utils/driftEvents.js.map +1 -0
  346. package/lib/utils/equalityChecks.d.ts +12 -0
  347. package/lib/utils/equalityChecks.js +71 -0
  348. package/lib/utils/equalityChecks.js.map +1 -0
  349. package/lib/utils/featureFlags.d.ts +3 -0
  350. package/lib/utils/featureFlags.js +7 -0
  351. package/lib/utils/featureFlags.js.map +1 -0
  352. package/lib/utils/geoblock/index.d.ts +4 -0
  353. package/lib/utils/geoblock/index.js +20 -0
  354. package/lib/utils/geoblock/index.js.map +1 -0
  355. package/lib/utils/index.d.ts +181 -0
  356. package/lib/utils/index.js +608 -0
  357. package/lib/utils/index.js.map +1 -0
  358. package/lib/utils/insuranceFund.d.ts +15 -0
  359. package/lib/utils/insuranceFund.js +84 -0
  360. package/lib/utils/insuranceFund.js.map +1 -0
  361. package/lib/utils/logger.d.ts +5 -0
  362. package/lib/utils/logger.js +53 -0
  363. package/lib/utils/logger.js.map +1 -0
  364. package/lib/utils/math.d.ts +10 -0
  365. package/lib/utils/math.js +89 -0
  366. package/lib/utils/math.js.map +1 -0
  367. package/lib/utils/orderbook/index.d.ts +65 -0
  368. package/lib/utils/orderbook/index.js +80 -0
  369. package/lib/utils/orderbook/index.js.map +1 -0
  370. package/lib/utils/pollingSequenceGuard.d.ts +9 -0
  371. package/lib/utils/pollingSequenceGuard.js +24 -0
  372. package/lib/utils/pollingSequenceGuard.js.map +1 -0
  373. package/lib/utils/priority-fees/PriorityFeeCalculator.d.ts +24 -0
  374. package/lib/utils/priority-fees/PriorityFeeCalculator.js +53 -0
  375. package/lib/utils/priority-fees/PriorityFeeCalculator.js.map +1 -0
  376. package/lib/utils/priority-fees/PriorityFeeStrategies.d.ts +5 -0
  377. package/lib/utils/priority-fees/PriorityFeeStrategies.js +43 -0
  378. package/lib/utils/priority-fees/PriorityFeeStrategies.js.map +1 -0
  379. package/lib/utils/priority-fees/index.d.ts +2 -0
  380. package/lib/utils/priority-fees/index.js +19 -0
  381. package/lib/utils/priority-fees/index.js.map +1 -0
  382. package/lib/utils/priorityFees.d.ts +14 -0
  383. package/lib/utils/priorityFees.js +68 -0
  384. package/lib/utils/priorityFees.js.map +1 -0
  385. package/lib/utils/rpcLatency.d.ts +7 -0
  386. package/lib/utils/rpcLatency.js +49 -0
  387. package/lib/utils/rpcLatency.js.map +1 -0
  388. package/lib/utils/rxjs.d.ts +11 -0
  389. package/lib/utils/rxjs.js +24 -0
  390. package/lib/utils/rxjs.js.map +1 -0
  391. package/lib/utils/s3Buckets.d.ts +43 -0
  392. package/lib/utils/s3Buckets.js +108 -0
  393. package/lib/utils/s3Buckets.js.map +1 -0
  394. package/lib/utils/superstake.d.ts +86 -0
  395. package/lib/utils/superstake.js +224 -0
  396. package/lib/utils/superstake.js.map +1 -0
  397. package/lib/utils/token.d.ts +16 -0
  398. package/lib/utils/token.js +44 -0
  399. package/lib/utils/token.js.map +1 -0
  400. package/package.json +87 -0
@@ -0,0 +1,647 @@
1
+ "use strict";
2
+ var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
3
+ var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
4
+ if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
5
+ else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
6
+ return c > 3 && r && Object.defineProperty(target, key, r), r;
7
+ };
8
+ var __metadata = (this && this.__metadata) || function (k, v) {
9
+ if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
10
+ };
11
+ var __importDefault = (this && this.__importDefault) || function (mod) {
12
+ return (mod && mod.__esModule) ? mod : { "default": mod };
13
+ };
14
+ Object.defineProperty(exports, "__esModule", { value: true });
15
+ exports.RedisClient = exports.getRedisClient = exports.getRedisClusterClient = exports.RedisClientPrefix = void 0;
16
+ const __1 = require("..");
17
+ const ioredis_1 = __importDefault(require("ioredis"));
18
+ const BULK_WRITE_CHUNK_SIZE = 500;
19
+ const BULK_READ_CHUNK_SIZE = 1000;
20
+ const CHUNK_SLEEP_TIME = 100;
21
+ var RedisClientPrefix;
22
+ (function (RedisClientPrefix) {
23
+ RedisClientPrefix["EXCHANGE"] = "";
24
+ RedisClientPrefix["USER_MAP"] = "usermap-server:";
25
+ RedisClientPrefix["DLOB"] = "dlob:";
26
+ RedisClientPrefix["DLOB_HELIUS"] = "dlob-helius:";
27
+ })(RedisClientPrefix || (exports.RedisClientPrefix = RedisClientPrefix = {}));
28
+ function isWrite() {
29
+ return function (_target, propertyKey, descriptor) {
30
+ const method = descriptor.value;
31
+ const methodName = propertyKey;
32
+ descriptor.value = function (...args) {
33
+ if (process.env.DISABLE_CACHE_WRITE) {
34
+ console.log(`DISABLE_CACHE_WRITE=true :: Skipping ${methodName}`);
35
+ return;
36
+ }
37
+ // Run the decorated method and return the value
38
+ const returnValue = method.apply(this, args);
39
+ return returnValue;
40
+ };
41
+ };
42
+ }
43
+ function isRead(_target, _propertyKey, descriptor) {
44
+ return descriptor;
45
+ }
46
+ const getTlsConfiguration = () => {
47
+ if (process.env.RUNNING_LOCAL === 'true' &&
48
+ process.env.LOCAL_CACHE === 'true') {
49
+ console.log('Redis: Running LOCAL with LOCAL cache');
50
+ return undefined;
51
+ }
52
+ if (process.env.RUNNING_LOCAL === 'true') {
53
+ console.log('Redis: Running LOCAL with REMOTE cache');
54
+ return {
55
+ checkServerIdentity: () => {
56
+ return undefined;
57
+ },
58
+ };
59
+ }
60
+ console.log('Redis: Making a tls connection');
61
+ return {};
62
+ };
63
+ const getNatMap = () => {
64
+ var _a;
65
+ if (process.env.RUNNING_LOCAL === 'true' &&
66
+ process.env.LOCAL_CACHE === 'false') {
67
+ console.log('Redis: Getting NATMAP for remote connection');
68
+ const natMap = ((_a = process.env) === null || _a === void 0 ? void 0 : _a.NAT_MAP)
69
+ ? JSON.parse(process.env.NAT_MAP)
70
+ : false;
71
+ console.log(`NATMAP: ${process.env.NAT_MAP}`);
72
+ if (!natMap) {
73
+ throw new Error('NATMAP not found. When running the openElasticacheTunnel script copy the output into your terminal');
74
+ }
75
+ return natMap;
76
+ }
77
+ return {};
78
+ };
79
+ const getRedisClusterClient = (host, port, prefix, opts) => {
80
+ if (host && port) {
81
+ console.log(`Connecting to configured cluster redis:: ${host}:${port}`);
82
+ const redisClient = new ioredis_1.default.Cluster([
83
+ {
84
+ host,
85
+ port: parseInt(port, 10),
86
+ },
87
+ ], {
88
+ keyPrefix: prefix,
89
+ natMap: getNatMap(),
90
+ clusterRetryStrategy: (times) => {
91
+ const delay = Math.min(times * 1000, 10000);
92
+ console.log(`Reconnecting to Redis in ${delay}ms... (retries: ${times})`);
93
+ return delay;
94
+ },
95
+ dnsLookup: (address, callback) => callback(null, address),
96
+ redisOptions: {
97
+ reconnectOnError: (err) => {
98
+ const targetError = 'ECONNREFUSED';
99
+ if (err.message.includes(targetError)) {
100
+ console.log(`Redis error: ${targetError}. Attempting to reconnect...`);
101
+ return true;
102
+ }
103
+ return false;
104
+ },
105
+ maxRetriesPerRequest: null,
106
+ tls: getTlsConfiguration(),
107
+ },
108
+ ...(opts !== null && opts !== void 0 ? opts : {}),
109
+ });
110
+ redisClient.on('connect', () => {
111
+ console.log('Connected to Redis.');
112
+ });
113
+ redisClient.on('error', (err) => {
114
+ console.error('Redis error:', err);
115
+ });
116
+ redisClient.on('reconnecting', () => {
117
+ console.log('Reconnecting to Redis...');
118
+ });
119
+ return redisClient;
120
+ }
121
+ throw Error('Missing redis client configuration');
122
+ };
123
+ exports.getRedisClusterClient = getRedisClusterClient;
124
+ const getRedisClient = (host, port, prefix, opts) => {
125
+ if (host && port) {
126
+ console.log(`Connecting to configured redis:: ${host}:${port}`);
127
+ const redisClient = new ioredis_1.default({
128
+ host,
129
+ port: parseInt(port, 10),
130
+ keyPrefix: prefix,
131
+ retryStrategy: (times) => {
132
+ const delay = Math.min(times * 1000, 10000);
133
+ console.log(`Reconnecting to Redis in ${delay}ms... (retries: ${times})`);
134
+ return delay;
135
+ },
136
+ reconnectOnError: (err) => {
137
+ const targetError = 'ECONNREFUSED';
138
+ if (err.message.includes(targetError)) {
139
+ console.log(`Redis error: ${targetError}. Attempting to reconnect...`);
140
+ return true;
141
+ }
142
+ return false;
143
+ },
144
+ maxRetriesPerRequest: null,
145
+ tls: getTlsConfiguration(),
146
+ ...(opts !== null && opts !== void 0 ? opts : {}),
147
+ });
148
+ redisClient.on('connect', () => {
149
+ console.log('Connected to Redis.');
150
+ });
151
+ redisClient.on('error', (err) => {
152
+ console.error('Redis error:', err);
153
+ });
154
+ redisClient.on('reconnecting', () => {
155
+ console.log('Reconnecting to Redis...');
156
+ });
157
+ return redisClient;
158
+ }
159
+ throw Error('Missing redis client configuration');
160
+ };
161
+ exports.getRedisClient = getRedisClient;
162
+ /**
163
+ * Wrapper around the redis client.
164
+ *
165
+ * You can hover over the underlying redis client methods for explanations of the methods, but will also include links to DOCS for some important concepts below:
166
+ *
167
+ * zRange, zRangeByScore etc.:
168
+ * - All of the "z" methods are methods that use sorted sets.
169
+ * - Sorted sets are explained here : https://redis.io/docs/data-types/sorted-sets/
170
+ */
171
+ class RedisClient {
172
+ constructor(_a) {
173
+ var _b, _c;
174
+ var { host = (_b = process.env.ELASTICACHE_HOST) !== null && _b !== void 0 ? _b : 'localhost', port = (_c = process.env.ELASTICACHE_PORT) !== null && _c !== void 0 ? _c : '6379', prefix = RedisClientPrefix.EXCHANGE, opts, cluster = process.env.LOCAL_CACHE === 'true' &&
175
+ process.env.RUNNING_LOCAL === 'true', } = _a;
176
+ this.prefix = prefix;
177
+ if (cluster) {
178
+ this.client = (0, exports.getRedisClusterClient)(host, port, prefix, opts);
179
+ return;
180
+ }
181
+ this.client = (0, exports.getRedisClient)(host, port, prefix, opts);
182
+ }
183
+ /**
184
+ * Should avoid using this unless necessary.
185
+ * @returns
186
+ */
187
+ forceGetClient() {
188
+ return this.client;
189
+ }
190
+ getPrefix() {
191
+ return this.prefix;
192
+ }
193
+ get connected() {
194
+ var _a;
195
+ return ((_a = this === null || this === void 0 ? void 0 : this.client) === null || _a === void 0 ? void 0 : _a.status) === 'ready';
196
+ }
197
+ async connect() {
198
+ if (process.env.CI_TEST)
199
+ return;
200
+ if (this.connected)
201
+ return;
202
+ await (0, __1.sleep)(100);
203
+ if (this.client.status === 'connecting') {
204
+ return this.connectionPromise;
205
+ }
206
+ if (this.client.status === 'connect') {
207
+ return this.connectionPromise;
208
+ }
209
+ if (this.client.status === 'ready') {
210
+ return true;
211
+ }
212
+ this.client.on('error', (error) => console.log(`'Redis Client Error :: ', ${error === null || error === void 0 ? void 0 : error.message}`));
213
+ try {
214
+ await this.client.connect();
215
+ }
216
+ catch (e) {
217
+ console.error(e);
218
+ }
219
+ return true;
220
+ }
221
+ disconnect() {
222
+ if (process.env.CI_TEST)
223
+ return;
224
+ this.client.disconnect();
225
+ }
226
+ assertConnected() {
227
+ if (!this.connected) {
228
+ throw 'Redis client not connected';
229
+ }
230
+ }
231
+ /**
232
+ * IMPORTANT NOTE: non-expiring keys will not be cleared up by the eviction policy, so they must be cleared manually
233
+ * @param key
234
+ * @param value
235
+ */
236
+ async set(key, value) {
237
+ this.assertConnected();
238
+ this.client.set(key, JSON.stringify(value));
239
+ }
240
+ async setRaw(key, value) {
241
+ this.assertConnected();
242
+ this.client.set(key, value);
243
+ }
244
+ /**
245
+ * IMPORTANT NOTE: non-expiring keys will not be cleared up by the eviction policy, so they must be cleared manually
246
+ * @param key
247
+ * @param value
248
+ */
249
+ async mset(values) {
250
+ this.assertConnected();
251
+ if (values.length === 0)
252
+ return;
253
+ const chunkedValues = __1.COMMON_UTILS.chunks(values, BULK_WRITE_CHUNK_SIZE);
254
+ for (const valuesChunk of chunkedValues) {
255
+ for (const [key, val] of valuesChunk) {
256
+ await this.client.set(key, JSON.stringify(val));
257
+ }
258
+ if (chunkedValues.length > 0) {
259
+ await (0, __1.sleep)(CHUNK_SLEEP_TIME);
260
+ }
261
+ }
262
+ }
263
+ async setExpiring(key, value, expirySeconds) {
264
+ this.assertConnected();
265
+ const resp = await this.client.setex(key, expirySeconds, JSON.stringify(value));
266
+ return resp;
267
+ }
268
+ async msetExpiring(values, expirySeconds) {
269
+ if (!values)
270
+ return;
271
+ if (values.length === 0)
272
+ return;
273
+ this.assertConnected();
274
+ const chunkedValues = __1.COMMON_UTILS.chunks(values, BULK_WRITE_CHUNK_SIZE);
275
+ for (const valuesChunk of chunkedValues) {
276
+ for (const [key, val] of valuesChunk) {
277
+ this.client.setex(key, expirySeconds, JSON.stringify(val));
278
+ }
279
+ if (chunkedValues.length > 0) {
280
+ await (0, __1.sleep)(CHUNK_SLEEP_TIME);
281
+ }
282
+ }
283
+ }
284
+ async expireKey(key, expirySeconds) {
285
+ this.assertConnected();
286
+ const resp = await this.client.expire(key, expirySeconds);
287
+ return resp;
288
+ }
289
+ async get(key) {
290
+ this.assertConnected();
291
+ const value = await this.client.get(key);
292
+ if (value) {
293
+ return JSON.parse(value);
294
+ }
295
+ return undefined;
296
+ }
297
+ async getRaw(key) {
298
+ this.assertConnected();
299
+ const resp = await this.client.get(key);
300
+ return resp;
301
+ }
302
+ async mget(keys) {
303
+ this.assertConnected();
304
+ if (keys.length === 0)
305
+ return [];
306
+ const chunkedValues = __1.COMMON_UTILS.chunks(keys, BULK_READ_CHUNK_SIZE);
307
+ const rawValues = [];
308
+ const chunkPromises = chunkedValues.map(async (valuesChunk, index) => {
309
+ const chunkResults = await Promise.all(valuesChunk.map((key) => this.client.get(key)));
310
+ if (index < chunkedValues.length - 1) {
311
+ await (0, __1.sleep)(20);
312
+ }
313
+ return chunkResults;
314
+ });
315
+ const allChunks = await Promise.all(chunkPromises);
316
+ for (const chunk of allChunks) {
317
+ rawValues.push(...chunk);
318
+ }
319
+ const parsedValues = rawValues.map((value) => {
320
+ if (value) {
321
+ return JSON.parse(value);
322
+ }
323
+ return undefined;
324
+ });
325
+ return parsedValues;
326
+ }
327
+ async smembers(key) {
328
+ const resp = await this.client.smembers(key);
329
+ return resp;
330
+ }
331
+ async zRange(key, min, max) {
332
+ const resp = await this.client.zrange(key, min, max);
333
+ return resp;
334
+ }
335
+ async zRevRange(key, start, stop, withScores) {
336
+ const resp = withScores
337
+ ? this.client.zrevrange(key, start, stop, withScores)
338
+ : this.client.zrevrange(key, start, stop);
339
+ return resp;
340
+ }
341
+ async zRangeByScore(key, min, max) {
342
+ const resp = await this.client.zrangebyscore(key, min, max);
343
+ return resp;
344
+ }
345
+ async zRevRangeByScore(key, max, min) {
346
+ const resp = await this.client.zrevrangebyscore(key, max, min);
347
+ return resp;
348
+ }
349
+ async zRank(key, member) {
350
+ const resp = await this.client.zrank(key, member);
351
+ return resp;
352
+ }
353
+ async zRevRank(key, member) {
354
+ const resp = await this.client.zrevrank(key, member);
355
+ return resp;
356
+ }
357
+ async zRem(key, member) {
358
+ const resp = await this.client.zrem(key, member);
359
+ return resp;
360
+ }
361
+ async zRemRange(key, start, stop) {
362
+ const resp = await this.client.zremrangebyrank(key, start, stop);
363
+ return resp;
364
+ }
365
+ async zRemRangeByScore(key, start, stop) {
366
+ const resp = await this.client.zremrangebyscore(key, start, stop);
367
+ return resp;
368
+ }
369
+ async zCount(key, start, stop) {
370
+ const resp = await this.client.zcount(key, start, stop);
371
+ return resp;
372
+ }
373
+ async zCard(key) {
374
+ const resp = await this.client.zcard(key);
375
+ return resp;
376
+ }
377
+ async zAdd(key, ...scoreMembers) {
378
+ const resp = await this.client.zadd(key, ...scoreMembers);
379
+ return resp;
380
+ }
381
+ async lPush(key, ...elements) {
382
+ const resp = await this.client.lpush(key, ...elements);
383
+ return resp;
384
+ }
385
+ async rPush(key, ...elements) {
386
+ const resp = await this.client.rpush(key, ...elements);
387
+ return resp;
388
+ }
389
+ async lTrim(key, start, stop) {
390
+ const resp = await this.client.ltrim(key, start, stop);
391
+ return resp;
392
+ }
393
+ async lRem(key, count, element) {
394
+ const resp = await this.client.lrem(key, count, element);
395
+ return resp;
396
+ }
397
+ async lSet(key, index, element) {
398
+ const resp = await this.client.lset(key, index, element);
399
+ return resp;
400
+ }
401
+ async lRange(key, start, stop) {
402
+ const resp = await this.client.lrange(key, start, stop);
403
+ return resp;
404
+ }
405
+ async lLen(key) {
406
+ const resp = await this.client.llen(key);
407
+ return resp;
408
+ }
409
+ async lIndex(key, index) {
410
+ const resp = await this.client.lindex(key, index);
411
+ return resp;
412
+ }
413
+ async publish(key, value) {
414
+ const resp = await this.client.publish(key, JSON.stringify(value));
415
+ return resp;
416
+ }
417
+ async subscribe(key) {
418
+ const resp = await this.client.subscribe(key);
419
+ return resp;
420
+ }
421
+ async unsubscribe(key) {
422
+ const resp = await this.client.unsubscribe(key);
423
+ return resp;
424
+ }
425
+ /**
426
+ * Clears the entire cache of the current DB (not the other DBs in the redis instance)
427
+ */
428
+ async flush() {
429
+ this.assertConnected();
430
+ return this.client.flushdb();
431
+ }
432
+ async delete(...keys) {
433
+ this.assertConnected();
434
+ const chunkedValues = __1.COMMON_UTILS.chunks(keys, BULK_WRITE_CHUNK_SIZE);
435
+ let count = 0;
436
+ for (const valuesChunk of chunkedValues) {
437
+ for (const key of valuesChunk) {
438
+ await this.client.del(key);
439
+ count++;
440
+ }
441
+ if (chunkedValues.length > 0) {
442
+ await (0, __1.sleep)(20);
443
+ }
444
+ }
445
+ return count;
446
+ }
447
+ }
448
+ exports.RedisClient = RedisClient;
449
+ __decorate([
450
+ isWrite(),
451
+ __metadata("design:type", Function),
452
+ __metadata("design:paramtypes", [String, Object]),
453
+ __metadata("design:returntype", Promise)
454
+ ], RedisClient.prototype, "set", null);
455
+ __decorate([
456
+ isWrite(),
457
+ __metadata("design:type", Function),
458
+ __metadata("design:paramtypes", [String, Object]),
459
+ __metadata("design:returntype", Promise)
460
+ ], RedisClient.prototype, "setRaw", null);
461
+ __decorate([
462
+ isWrite(),
463
+ __metadata("design:type", Function),
464
+ __metadata("design:paramtypes", [Array]),
465
+ __metadata("design:returntype", Promise)
466
+ ], RedisClient.prototype, "mset", null);
467
+ __decorate([
468
+ isWrite(),
469
+ __metadata("design:type", Function),
470
+ __metadata("design:paramtypes", [String, Object, Number]),
471
+ __metadata("design:returntype", Promise)
472
+ ], RedisClient.prototype, "setExpiring", null);
473
+ __decorate([
474
+ isRead,
475
+ __metadata("design:type", Function),
476
+ __metadata("design:paramtypes", [Array, Number]),
477
+ __metadata("design:returntype", Promise)
478
+ ], RedisClient.prototype, "msetExpiring", null);
479
+ __decorate([
480
+ isWrite(),
481
+ __metadata("design:type", Function),
482
+ __metadata("design:paramtypes", [String, Number]),
483
+ __metadata("design:returntype", Promise)
484
+ ], RedisClient.prototype, "expireKey", null);
485
+ __decorate([
486
+ isRead,
487
+ __metadata("design:type", Function),
488
+ __metadata("design:paramtypes", [String]),
489
+ __metadata("design:returntype", Promise)
490
+ ], RedisClient.prototype, "get", null);
491
+ __decorate([
492
+ isRead,
493
+ __metadata("design:type", Function),
494
+ __metadata("design:paramtypes", [String]),
495
+ __metadata("design:returntype", Promise)
496
+ ], RedisClient.prototype, "getRaw", null);
497
+ __decorate([
498
+ isRead,
499
+ __metadata("design:type", Function),
500
+ __metadata("design:paramtypes", [Array]),
501
+ __metadata("design:returntype", Promise)
502
+ ], RedisClient.prototype, "mget", null);
503
+ __decorate([
504
+ isRead,
505
+ __metadata("design:type", Function),
506
+ __metadata("design:paramtypes", [String]),
507
+ __metadata("design:returntype", Promise)
508
+ ], RedisClient.prototype, "smembers", null);
509
+ __decorate([
510
+ isRead,
511
+ __metadata("design:type", Function),
512
+ __metadata("design:paramtypes", [String, Number, Number]),
513
+ __metadata("design:returntype", Promise)
514
+ ], RedisClient.prototype, "zRange", null);
515
+ __decorate([
516
+ isRead,
517
+ __metadata("design:type", Function),
518
+ __metadata("design:paramtypes", [String, Number, Number, String]),
519
+ __metadata("design:returntype", Promise)
520
+ ], RedisClient.prototype, "zRevRange", null);
521
+ __decorate([
522
+ isRead,
523
+ __metadata("design:type", Function),
524
+ __metadata("design:paramtypes", [String, Object, Object]),
525
+ __metadata("design:returntype", Promise)
526
+ ], RedisClient.prototype, "zRangeByScore", null);
527
+ __decorate([
528
+ isRead,
529
+ __metadata("design:type", Function),
530
+ __metadata("design:paramtypes", [String, Object, Object]),
531
+ __metadata("design:returntype", Promise)
532
+ ], RedisClient.prototype, "zRevRangeByScore", null);
533
+ __decorate([
534
+ isRead,
535
+ __metadata("design:type", Function),
536
+ __metadata("design:paramtypes", [String, String]),
537
+ __metadata("design:returntype", Promise)
538
+ ], RedisClient.prototype, "zRank", null);
539
+ __decorate([
540
+ isRead,
541
+ __metadata("design:type", Function),
542
+ __metadata("design:paramtypes", [String, String]),
543
+ __metadata("design:returntype", Promise)
544
+ ], RedisClient.prototype, "zRevRank", null);
545
+ __decorate([
546
+ isWrite(),
547
+ __metadata("design:type", Function),
548
+ __metadata("design:paramtypes", [String, Object]),
549
+ __metadata("design:returntype", Promise)
550
+ ], RedisClient.prototype, "zRem", null);
551
+ __decorate([
552
+ isWrite(),
553
+ __metadata("design:type", Function),
554
+ __metadata("design:paramtypes", [String, Number, Number]),
555
+ __metadata("design:returntype", Promise)
556
+ ], RedisClient.prototype, "zRemRange", null);
557
+ __decorate([
558
+ isWrite(),
559
+ __metadata("design:type", Function),
560
+ __metadata("design:paramtypes", [String, Number, Number]),
561
+ __metadata("design:returntype", Promise)
562
+ ], RedisClient.prototype, "zRemRangeByScore", null);
563
+ __decorate([
564
+ isRead,
565
+ __metadata("design:type", Function),
566
+ __metadata("design:paramtypes", [String, Number, Number]),
567
+ __metadata("design:returntype", Promise)
568
+ ], RedisClient.prototype, "zCount", null);
569
+ __decorate([
570
+ isRead,
571
+ __metadata("design:type", Function),
572
+ __metadata("design:paramtypes", [String]),
573
+ __metadata("design:returntype", Promise)
574
+ ], RedisClient.prototype, "zCard", null);
575
+ __decorate([
576
+ isWrite(),
577
+ __metadata("design:type", Function),
578
+ __metadata("design:paramtypes", [String, Object]),
579
+ __metadata("design:returntype", Promise)
580
+ ], RedisClient.prototype, "zAdd", null);
581
+ __decorate([
582
+ isWrite(),
583
+ __metadata("design:type", Function),
584
+ __metadata("design:paramtypes", [String, Object]),
585
+ __metadata("design:returntype", Promise)
586
+ ], RedisClient.prototype, "lPush", null);
587
+ __decorate([
588
+ isWrite(),
589
+ __metadata("design:type", Function),
590
+ __metadata("design:paramtypes", [String, Object]),
591
+ __metadata("design:returntype", Promise)
592
+ ], RedisClient.prototype, "rPush", null);
593
+ __decorate([
594
+ isWrite(),
595
+ __metadata("design:type", Function),
596
+ __metadata("design:paramtypes", [String, Number, Number]),
597
+ __metadata("design:returntype", Promise)
598
+ ], RedisClient.prototype, "lTrim", null);
599
+ __decorate([
600
+ isWrite(),
601
+ __metadata("design:type", Function),
602
+ __metadata("design:paramtypes", [String, Number, Object]),
603
+ __metadata("design:returntype", Promise)
604
+ ], RedisClient.prototype, "lRem", null);
605
+ __decorate([
606
+ isWrite(),
607
+ __metadata("design:type", Function),
608
+ __metadata("design:paramtypes", [String, Number, Object]),
609
+ __metadata("design:returntype", Promise)
610
+ ], RedisClient.prototype, "lSet", null);
611
+ __decorate([
612
+ isRead,
613
+ __metadata("design:type", Function),
614
+ __metadata("design:paramtypes", [String, Number, Number]),
615
+ __metadata("design:returntype", Promise)
616
+ ], RedisClient.prototype, "lRange", null);
617
+ __decorate([
618
+ isRead,
619
+ __metadata("design:type", Function),
620
+ __metadata("design:paramtypes", [String]),
621
+ __metadata("design:returntype", Promise)
622
+ ], RedisClient.prototype, "lLen", null);
623
+ __decorate([
624
+ isRead,
625
+ __metadata("design:type", Function),
626
+ __metadata("design:paramtypes", [String, Number]),
627
+ __metadata("design:returntype", Promise)
628
+ ], RedisClient.prototype, "lIndex", null);
629
+ __decorate([
630
+ isWrite(),
631
+ __metadata("design:type", Function),
632
+ __metadata("design:paramtypes", [String, Object]),
633
+ __metadata("design:returntype", Promise)
634
+ ], RedisClient.prototype, "publish", null);
635
+ __decorate([
636
+ isRead,
637
+ __metadata("design:type", Function),
638
+ __metadata("design:paramtypes", []),
639
+ __metadata("design:returntype", Promise)
640
+ ], RedisClient.prototype, "flush", null);
641
+ __decorate([
642
+ isRead,
643
+ __metadata("design:type", Function),
644
+ __metadata("design:paramtypes", [String]),
645
+ __metadata("design:returntype", Promise)
646
+ ], RedisClient.prototype, "delete", null);
647
+ //# sourceMappingURL=redisClient.js.map