@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,67 @@
1
+ {
2
+ "programId": "JUP4Fb2cqiRUcaTHdrPC8h2gNsA2ETXiPDD33WcGuJB",
3
+ "errorsList": {
4
+ "EmptyRoute": {
5
+ "code": 6000,
6
+ "name": "EmptyRoute",
7
+ "msg": "Empty route"
8
+ },
9
+ "SlippageToleranceExceeded": {
10
+ "code": 6001,
11
+ "name": "SlippageToleranceExceeded",
12
+ "msg": "Slippage tolerance exceeded"
13
+ },
14
+ "InvalidCalculation": {
15
+ "code": 6002,
16
+ "name": "InvalidCalculation",
17
+ "msg": "Invalid calculation"
18
+ },
19
+ "MissingPlatformFeeAccount": {
20
+ "code": 6003,
21
+ "name": "MissingPlatformFeeAccount",
22
+ "msg": "Missing platform fee account"
23
+ },
24
+ "InvalidSlippage": {
25
+ "code": 6004,
26
+ "name": "InvalidSlippage",
27
+ "msg": "Invalid slippage"
28
+ },
29
+ "NotEnoughPercent": {
30
+ "code": 6005,
31
+ "name": "NotEnoughPercent",
32
+ "msg": "Not enough percent to 100"
33
+ },
34
+ "InAmountsStackIsEmpty": {
35
+ "code": 6006,
36
+ "name": "InAmountsStackIsEmpty",
37
+ "msg": "In amounts stack is empty"
38
+ },
39
+ "OutAmountsStackIsEmpty": {
40
+ "code": 6007,
41
+ "name": "OutAmountsStackIsEmpty",
42
+ "msg": "Out amounts stack is empty"
43
+ },
44
+ "NotEnoughAccountKeys": {
45
+ "code": 6008,
46
+ "name": "NotEnoughAccountKeys",
47
+ "msg": "Not Enough Account keys"
48
+ },
49
+ "NonZeroMinimumOutAmountNotSupported": {
50
+ "code": 6009,
51
+ "name": "NonZeroMinimumOutAmountNotSupported",
52
+ "msg": "Non zero minimum out amount not supported"
53
+ }
54
+ },
55
+ "errorCodesMap": {
56
+ "6000": "EmptyRoute",
57
+ "6001": "SlippageToleranceExceeded",
58
+ "6002": "InvalidCalculation",
59
+ "6003": "MissingPlatformFeeAccount",
60
+ "6004": "InvalidSlippage",
61
+ "6005": "NotEnoughPercent",
62
+ "6006": "InAmountsStackIsEmpty",
63
+ "6007": "OutAmountsStackIsEmpty",
64
+ "6008": "NotEnoughAccountKeys",
65
+ "6009": "NonZeroMinimumOutAmountNotSupported"
66
+ }
67
+ }
@@ -0,0 +1,115 @@
1
+ {
2
+ "programId": "JUP6LkbZbjS1jKKwapdHNy74zcZ3tLUZoi5QNyVTaV4",
3
+ "errorsList": {
4
+ "EmptyRoute": {
5
+ "code": 6000,
6
+ "name": "EmptyRoute",
7
+ "msg": "Empty route"
8
+ },
9
+ "SlippageToleranceExceeded": {
10
+ "code": 6001,
11
+ "name": "SlippageToleranceExceeded",
12
+ "msg": "Slippage tolerance exceeded"
13
+ },
14
+ "InvalidCalculation": {
15
+ "code": 6002,
16
+ "name": "InvalidCalculation",
17
+ "msg": "Invalid calculation"
18
+ },
19
+ "MissingPlatformFeeAccount": {
20
+ "code": 6003,
21
+ "name": "MissingPlatformFeeAccount",
22
+ "msg": "Missing platform fee account"
23
+ },
24
+ "InvalidSlippage": {
25
+ "code": 6004,
26
+ "name": "InvalidSlippage",
27
+ "msg": "Invalid slippage"
28
+ },
29
+ "NotEnoughPercent": {
30
+ "code": 6005,
31
+ "name": "NotEnoughPercent",
32
+ "msg": "Not enough percent to 100"
33
+ },
34
+ "InvalidInputIndex": {
35
+ "code": 6006,
36
+ "name": "InvalidInputIndex",
37
+ "msg": "Token input index is invalid"
38
+ },
39
+ "InvalidOutputIndex": {
40
+ "code": 6007,
41
+ "name": "InvalidOutputIndex",
42
+ "msg": "Token output index is invalid"
43
+ },
44
+ "NotEnoughAccountKeys": {
45
+ "code": 6008,
46
+ "name": "NotEnoughAccountKeys",
47
+ "msg": "Not Enough Account keys"
48
+ },
49
+ "NonZeroMinimumOutAmountNotSupported": {
50
+ "code": 6009,
51
+ "name": "NonZeroMinimumOutAmountNotSupported",
52
+ "msg": "Non zero minimum out amount not supported"
53
+ },
54
+ "InvalidRoutePlan": {
55
+ "code": 6010,
56
+ "name": "InvalidRoutePlan",
57
+ "msg": "Invalid route plan"
58
+ },
59
+ "InvalidReferralAuthority": {
60
+ "code": 6011,
61
+ "name": "InvalidReferralAuthority",
62
+ "msg": "Invalid referral authority"
63
+ },
64
+ "LedgerTokenAccountDoesNotMatch": {
65
+ "code": 6012,
66
+ "name": "LedgerTokenAccountDoesNotMatch",
67
+ "msg": "Token account doesn't match the ledger"
68
+ },
69
+ "InvalidTokenLedger": {
70
+ "code": 6013,
71
+ "name": "InvalidTokenLedger",
72
+ "msg": "Invalid token ledger"
73
+ },
74
+ "IncorrectTokenProgramID": {
75
+ "code": 6014,
76
+ "name": "IncorrectTokenProgramID",
77
+ "msg": "Token program ID is invalid"
78
+ },
79
+ "TokenProgramNotProvided": {
80
+ "code": 6015,
81
+ "name": "TokenProgramNotProvided",
82
+ "msg": "Token program not provided"
83
+ },
84
+ "SwapNotSupported": {
85
+ "code": 6016,
86
+ "name": "SwapNotSupported",
87
+ "msg": "Swap not supported"
88
+ },
89
+ "ExactOutAmountNotMatched": {
90
+ "code": 6017,
91
+ "name": "ExactOutAmountNotMatched",
92
+ "msg": "Exact out amount doesn't match"
93
+ }
94
+ },
95
+ "errorCodesMap": {
96
+ "6000": "EmptyRoute",
97
+ "6001": "SlippageToleranceExceeded",
98
+ "6002": "InvalidCalculation",
99
+ "6003": "MissingPlatformFeeAccount",
100
+ "6004": "InvalidSlippage",
101
+ "6005": "NotEnoughPercent",
102
+ "6006": "InvalidInputIndex",
103
+ "6007": "InvalidOutputIndex",
104
+ "6008": "NotEnoughAccountKeys",
105
+ "6009": "NonZeroMinimumOutAmountNotSupported",
106
+ "6010": "InvalidRoutePlan",
107
+ "6011": "InvalidReferralAuthority",
108
+ "6012": "LedgerTokenAccountDoesNotMatch",
109
+ "6013": "InvalidTokenLedger",
110
+ "6014": "IncorrectTokenProgramID",
111
+ "6015": "TokenProgramNotProvided",
112
+ "6016": "SwapNotSupported",
113
+ "6017": "ExactOutAmountNotMatched"
114
+ }
115
+ }
@@ -0,0 +1,15 @@
1
+ export declare const PERFORMANCE_TESTING_LABELS: {
2
+ totalRenders: string;
3
+ totalActualDuration: string;
4
+ min: string;
5
+ median: string;
6
+ max: string;
7
+ p90: string;
8
+ mean: string;
9
+ totalDurationMs: string;
10
+ totalDurationSec: string;
11
+ avgRendersPerSec: string;
12
+ avgDurationPerSec: string;
13
+ avgFPS: string;
14
+ avgEventLoopLag: string;
15
+ };
@@ -0,0 +1,19 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.PERFORMANCE_TESTING_LABELS = void 0;
4
+ exports.PERFORMANCE_TESTING_LABELS = {
5
+ totalRenders: 'Total Renders',
6
+ totalActualDuration: 'Total Render Duration',
7
+ min: 'Min Duration',
8
+ median: 'Median Duration',
9
+ max: 'Max Duration',
10
+ p90: '90th Percentile Duration',
11
+ mean: 'Mean Duration',
12
+ totalDurationMs: 'Total Profiling Duration',
13
+ totalDurationSec: 'Total Profiling Duration',
14
+ avgRendersPerSec: 'Average Renders Per Second',
15
+ avgDurationPerSec: 'Average Render Duration Per Second',
16
+ avgFPS: 'Avg FPS',
17
+ avgEventLoopLag: 'Avg Event Loop Lag',
18
+ };
19
+ //# sourceMappingURL=dev.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"dev.js","sourceRoot":"","sources":["../../src/constants/dev.ts"],"names":[],"mappings":";;;AAAa,QAAA,0BAA0B,GAAG;IACzC,YAAY,EAAE,eAAe;IAC7B,mBAAmB,EAAE,uBAAuB;IAC5C,GAAG,EAAE,cAAc;IACnB,MAAM,EAAE,iBAAiB;IACzB,GAAG,EAAE,cAAc;IACnB,GAAG,EAAE,0BAA0B;IAC/B,IAAI,EAAE,eAAe;IACrB,eAAe,EAAE,0BAA0B;IAC3C,gBAAgB,EAAE,0BAA0B;IAC5C,gBAAgB,EAAE,4BAA4B;IAC9C,iBAAiB,EAAE,oCAAoC;IACvD,MAAM,EAAE,SAAS;IACjB,eAAe,EAAE,oBAAoB;CACrC,CAAC","sourcesContent":["export const PERFORMANCE_TESTING_LABELS = {\n\ttotalRenders: 'Total Renders',\n\ttotalActualDuration: 'Total Render Duration',\n\tmin: 'Min Duration',\n\tmedian: 'Median Duration',\n\tmax: 'Max Duration',\n\tp90: '90th Percentile Duration',\n\tmean: 'Mean Duration',\n\ttotalDurationMs: 'Total Profiling Duration',\n\ttotalDurationSec: 'Total Profiling Duration',\n\tavgRendersPerSec: 'Average Renders Per Second',\n\tavgDurationPerSec: 'Average Render Duration Per Second',\n\tavgFPS: 'Avg FPS',\n\tavgEventLoopLag: 'Avg Event Loop Lag',\n};\n"]}
@@ -0,0 +1,4 @@
1
+ export declare const GEOBLOCK_LIST: {
2
+ code: string;
3
+ name: string;
4
+ }[];
@@ -0,0 +1,32 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.GEOBLOCK_LIST = void 0;
4
+ exports.GEOBLOCK_LIST = [
5
+ { code: 'AG', name: 'Antigua and Barbuda' },
6
+ { code: 'DZ', name: 'Algeria' },
7
+ { code: 'BD', name: 'Bangladesh' },
8
+ { code: 'BO', name: 'Bolivia' },
9
+ { code: 'BY', name: 'Belarus' },
10
+ { code: 'BI', name: 'Burundi' },
11
+ { code: 'MM', name: 'Burma (Myanmar)' },
12
+ { code: 'CI', name: "Cote D'Ivoire (Ivory Coast)" },
13
+ { code: 'CU', name: 'Cuba' },
14
+ { code: 'CD', name: 'Democratic Republic of Congo' },
15
+ { code: 'EC', name: 'Ecuador' },
16
+ { code: 'IR', name: 'Iran' },
17
+ { code: 'IQ', name: 'Iraq' },
18
+ { code: 'LR', name: 'Liberia' },
19
+ { code: 'LY', name: 'Libya' },
20
+ { code: 'ML', name: 'Mali' },
21
+ { code: 'MA', name: 'Morocco' },
22
+ { code: 'NP', name: 'Nepal' },
23
+ { code: 'KP', name: 'North Korea' },
24
+ { code: 'SO', name: 'Somalia' },
25
+ { code: 'SD', name: 'Sudan' },
26
+ { code: 'SY', name: 'Syria' },
27
+ { code: 'VE', name: 'Venezuela' },
28
+ { code: 'YE', name: 'Yemen' },
29
+ { code: 'ZW', name: 'Zimbabwe' },
30
+ { code: 'US', name: 'United States' },
31
+ ];
32
+ //# sourceMappingURL=geoblockList.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"geoblockList.js","sourceRoot":"","sources":["../../src/constants/geoblockList.ts"],"names":[],"mappings":";;;AAAa,QAAA,aAAa,GAAG;IAC5B,EAAE,IAAI,EAAE,IAAI,EAAE,IAAI,EAAE,qBAAqB,EAAE;IAC3C,EAAE,IAAI,EAAE,IAAI,EAAE,IAAI,EAAE,SAAS,EAAE;IAC/B,EAAE,IAAI,EAAE,IAAI,EAAE,IAAI,EAAE,YAAY,EAAE;IAClC,EAAE,IAAI,EAAE,IAAI,EAAE,IAAI,EAAE,SAAS,EAAE;IAC/B,EAAE,IAAI,EAAE,IAAI,EAAE,IAAI,EAAE,SAAS,EAAE;IAC/B,EAAE,IAAI,EAAE,IAAI,EAAE,IAAI,EAAE,SAAS,EAAE;IAC/B,EAAE,IAAI,EAAE,IAAI,EAAE,IAAI,EAAE,iBAAiB,EAAE;IACvC,EAAE,IAAI,EAAE,IAAI,EAAE,IAAI,EAAE,6BAA6B,EAAE;IACnD,EAAE,IAAI,EAAE,IAAI,EAAE,IAAI,EAAE,MAAM,EAAE;IAC5B,EAAE,IAAI,EAAE,IAAI,EAAE,IAAI,EAAE,8BAA8B,EAAE;IACpD,EAAE,IAAI,EAAE,IAAI,EAAE,IAAI,EAAE,SAAS,EAAE;IAC/B,EAAE,IAAI,EAAE,IAAI,EAAE,IAAI,EAAE,MAAM,EAAE;IAC5B,EAAE,IAAI,EAAE,IAAI,EAAE,IAAI,EAAE,MAAM,EAAE;IAC5B,EAAE,IAAI,EAAE,IAAI,EAAE,IAAI,EAAE,SAAS,EAAE;IAC/B,EAAE,IAAI,EAAE,IAAI,EAAE,IAAI,EAAE,OAAO,EAAE;IAC7B,EAAE,IAAI,EAAE,IAAI,EAAE,IAAI,EAAE,MAAM,EAAE;IAC5B,EAAE,IAAI,EAAE,IAAI,EAAE,IAAI,EAAE,SAAS,EAAE;IAC/B,EAAE,IAAI,EAAE,IAAI,EAAE,IAAI,EAAE,OAAO,EAAE;IAC7B,EAAE,IAAI,EAAE,IAAI,EAAE,IAAI,EAAE,aAAa,EAAE;IACnC,EAAE,IAAI,EAAE,IAAI,EAAE,IAAI,EAAE,SAAS,EAAE;IAC/B,EAAE,IAAI,EAAE,IAAI,EAAE,IAAI,EAAE,OAAO,EAAE;IAC7B,EAAE,IAAI,EAAE,IAAI,EAAE,IAAI,EAAE,OAAO,EAAE;IAC7B,EAAE,IAAI,EAAE,IAAI,EAAE,IAAI,EAAE,WAAW,EAAE;IACjC,EAAE,IAAI,EAAE,IAAI,EAAE,IAAI,EAAE,OAAO,EAAE;IAC7B,EAAE,IAAI,EAAE,IAAI,EAAE,IAAI,EAAE,UAAU,EAAE;IAChC,EAAE,IAAI,EAAE,IAAI,EAAE,IAAI,EAAE,eAAe,EAAE;CACrC,CAAC","sourcesContent":["export const GEOBLOCK_LIST = [\n\t{ code: 'AG', name: 'Antigua and Barbuda' },\n\t{ code: 'DZ', name: 'Algeria' },\n\t{ code: 'BD', name: 'Bangladesh' },\n\t{ code: 'BO', name: 'Bolivia' },\n\t{ code: 'BY', name: 'Belarus' },\n\t{ code: 'BI', name: 'Burundi' },\n\t{ code: 'MM', name: 'Burma (Myanmar)' },\n\t{ code: 'CI', name: \"Cote D'Ivoire (Ivory Coast)\" },\n\t{ code: 'CU', name: 'Cuba' },\n\t{ code: 'CD', name: 'Democratic Republic of Congo' },\n\t{ code: 'EC', name: 'Ecuador' },\n\t{ code: 'IR', name: 'Iran' },\n\t{ code: 'IQ', name: 'Iraq' },\n\t{ code: 'LR', name: 'Liberia' },\n\t{ code: 'LY', name: 'Libya' },\n\t{ code: 'ML', name: 'Mali' },\n\t{ code: 'MA', name: 'Morocco' },\n\t{ code: 'NP', name: 'Nepal' },\n\t{ code: 'KP', name: 'North Korea' },\n\t{ code: 'SO', name: 'Somalia' },\n\t{ code: 'SD', name: 'Sudan' },\n\t{ code: 'SY', name: 'Syria' },\n\t{ code: 'VE', name: 'Venezuela' },\n\t{ code: 'YE', name: 'Yemen' },\n\t{ code: 'ZW', name: 'Zimbabwe' },\n\t{ code: 'US', name: 'United States' },\n];\n"]}
@@ -0,0 +1,9 @@
1
+ export * from './dev';
2
+ export * from './orders';
3
+ export * from './geoblockList';
4
+ export * from './misc';
5
+ export * from './superstake';
6
+ export * from './pools';
7
+ export * from './trade';
8
+ export * from './markets';
9
+ export * from './predictionMarket';
@@ -0,0 +1,26 @@
1
+ "use strict";
2
+ var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
+ if (k2 === undefined) k2 = k;
4
+ var desc = Object.getOwnPropertyDescriptor(m, k);
5
+ if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
6
+ desc = { enumerable: true, get: function() { return m[k]; } };
7
+ }
8
+ Object.defineProperty(o, k2, desc);
9
+ }) : (function(o, m, k, k2) {
10
+ if (k2 === undefined) k2 = k;
11
+ o[k2] = m[k];
12
+ }));
13
+ var __exportStar = (this && this.__exportStar) || function(m, exports) {
14
+ for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
15
+ };
16
+ Object.defineProperty(exports, "__esModule", { value: true });
17
+ __exportStar(require("./dev"), exports);
18
+ __exportStar(require("./orders"), exports);
19
+ __exportStar(require("./geoblockList"), exports);
20
+ __exportStar(require("./misc"), exports);
21
+ __exportStar(require("./superstake"), exports);
22
+ __exportStar(require("./pools"), exports);
23
+ __exportStar(require("./trade"), exports);
24
+ __exportStar(require("./markets"), exports);
25
+ __exportStar(require("./predictionMarket"), exports);
26
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/constants/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,wCAAsB;AACtB,2CAAyB;AACzB,iDAA+B;AAC/B,yCAAuB;AACvB,+CAA6B;AAC7B,0CAAwB;AACxB,0CAAwB;AACxB,4CAA0B;AAC1B,qDAAmC","sourcesContent":["export * from './dev';\nexport * from './orders';\nexport * from './geoblockList';\nexport * from './misc';\nexport * from './superstake';\nexport * from './pools';\nexport * from './trade';\nexport * from './markets';\nexport * from './predictionMarket';\n"]}
@@ -0,0 +1 @@
1
+ export declare const USDC_SPOT_MARKET_INDEX = 0;
@@ -0,0 +1,5 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.USDC_SPOT_MARKET_INDEX = void 0;
4
+ exports.USDC_SPOT_MARKET_INDEX = 0;
5
+ //# sourceMappingURL=markets.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"markets.js","sourceRoot":"","sources":["../../src/constants/markets.ts"],"names":[],"mappings":";;;AAAa,QAAA,sBAAsB,GAAG,CAAC,CAAC","sourcesContent":["export const USDC_SPOT_MARKET_INDEX = 0;\n"]}
@@ -0,0 +1,23 @@
1
+ import { BigNum } from '@drift-labs/sdk';
2
+ /**
3
+ * Equal to 0.0001
4
+ */
5
+ export declare const NEW_ACCOUNT_DONATION: BigNum;
6
+ /**
7
+ * Equal to 0.035
8
+ */
9
+ export declare const NEW_ACCOUNT_BASE_RENT: BigNum;
10
+ export declare const SWIFT_ACCOUNT_BASE_RENT: BigNum;
11
+ /**
12
+ * Equal to NEW_ACCOUNT_DONATION + NEW_ACCOUNT_BASE_RENT
13
+ */
14
+ export declare const NEW_ACCOUNT_BASE_COST: BigNum;
15
+ /**
16
+ * Equal to 0.002
17
+ */
18
+ export declare const IF_STAKE_ACCOUNT_BASE_RENT: BigNum;
19
+ /**
20
+ * Equal to 0.015 SOL
21
+ */
22
+ export declare const MIN_LEFTOVER_SOL: BigNum;
23
+ export declare const ONE_DAY_MS: number;
@@ -0,0 +1,27 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.ONE_DAY_MS = exports.MIN_LEFTOVER_SOL = exports.IF_STAKE_ACCOUNT_BASE_RENT = exports.NEW_ACCOUNT_BASE_COST = exports.SWIFT_ACCOUNT_BASE_RENT = exports.NEW_ACCOUNT_BASE_RENT = exports.NEW_ACCOUNT_DONATION = void 0;
4
+ const sdk_1 = require("@drift-labs/sdk");
5
+ /**
6
+ * Equal to 0.0001
7
+ */
8
+ exports.NEW_ACCOUNT_DONATION = sdk_1.BigNum.fromPrint('0.0001', sdk_1.LAMPORTS_EXP);
9
+ /**
10
+ * Equal to 0.035
11
+ */
12
+ exports.NEW_ACCOUNT_BASE_RENT = new sdk_1.BigNum('31347840', sdk_1.LAMPORTS_EXP);
13
+ exports.SWIFT_ACCOUNT_BASE_RENT = new sdk_1.BigNum('2756160', sdk_1.LAMPORTS_EXP);
14
+ /**
15
+ * Equal to NEW_ACCOUNT_DONATION + NEW_ACCOUNT_BASE_RENT
16
+ */
17
+ exports.NEW_ACCOUNT_BASE_COST = exports.NEW_ACCOUNT_BASE_RENT.add(exports.NEW_ACCOUNT_DONATION).add(exports.SWIFT_ACCOUNT_BASE_RENT);
18
+ /**
19
+ * Equal to 0.002
20
+ */
21
+ exports.IF_STAKE_ACCOUNT_BASE_RENT = sdk_1.BigNum.fromPrint('0.002', sdk_1.LAMPORTS_EXP);
22
+ /**
23
+ * Equal to 0.015 SOL
24
+ */
25
+ exports.MIN_LEFTOVER_SOL = sdk_1.BigNum.fromPrint('0.015', sdk_1.LAMPORTS_EXP);
26
+ exports.ONE_DAY_MS = 1000 * 60 * 60 * 24;
27
+ //# sourceMappingURL=misc.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"misc.js","sourceRoot":"","sources":["../../src/constants/misc.ts"],"names":[],"mappings":";;;AAAA,yCAAuD;AAEvD;;GAEG;AACU,QAAA,oBAAoB,GAAG,YAAM,CAAC,SAAS,CAAC,QAAQ,EAAE,kBAAY,CAAC,CAAC;AAE7E;;GAEG;AACU,QAAA,qBAAqB,GAAG,IAAI,YAAM,CAAC,UAAU,EAAE,kBAAY,CAAC,CAAC;AAE7D,QAAA,uBAAuB,GAAG,IAAI,YAAM,CAAC,SAAS,EAAE,kBAAY,CAAC,CAAC;AAE3E;;GAEG;AACU,QAAA,qBAAqB,GAAG,6BAAqB,CAAC,GAAG,CAC7D,4BAAoB,CACpB,CAAC,GAAG,CAAC,+BAAuB,CAAC,CAAC;AAE/B;;GAEG;AACU,QAAA,0BAA0B,GAAG,YAAM,CAAC,SAAS,CACzD,OAAO,EACP,kBAAY,CACZ,CAAC;AAEF;;GAEG;AACU,QAAA,gBAAgB,GAAG,YAAM,CAAC,SAAS,CAAC,OAAO,EAAE,kBAAY,CAAC,CAAC;AAE3D,QAAA,UAAU,GAAG,IAAI,GAAG,EAAE,GAAG,EAAE,GAAG,EAAE,CAAC","sourcesContent":["import { BigNum, LAMPORTS_EXP } from '@drift-labs/sdk';\n\n/**\n * Equal to 0.0001\n */\nexport const NEW_ACCOUNT_DONATION = BigNum.fromPrint('0.0001', LAMPORTS_EXP);\n\n/**\n * Equal to 0.035\n */\nexport const NEW_ACCOUNT_BASE_RENT = new BigNum('31347840', LAMPORTS_EXP);\n\nexport const SWIFT_ACCOUNT_BASE_RENT = new BigNum('2756160', LAMPORTS_EXP);\n\n/**\n * Equal to NEW_ACCOUNT_DONATION + NEW_ACCOUNT_BASE_RENT\n */\nexport const NEW_ACCOUNT_BASE_COST = NEW_ACCOUNT_BASE_RENT.add(\n\tNEW_ACCOUNT_DONATION\n).add(SWIFT_ACCOUNT_BASE_RENT);\n\n/**\n * Equal to 0.002\n */\nexport const IF_STAKE_ACCOUNT_BASE_RENT = BigNum.fromPrint(\n\t'0.002',\n\tLAMPORTS_EXP\n);\n\n/**\n * Equal to 0.015 SOL\n */\nexport const MIN_LEFTOVER_SOL = BigNum.fromPrint('0.015', LAMPORTS_EXP);\n\nexport const ONE_DAY_MS = 1000 * 60 * 60 * 24;\n"]}
@@ -0,0 +1,12 @@
1
+ import { UIOrderTypeLookup, UIOrderTypeValue } from '../types';
2
+ export declare const MARKET_ORDER_TYPE_CONFIG: UIOrderTypeValue;
3
+ export declare const LIMIT_ORDER_TYPE_CONFIG: UIOrderTypeValue;
4
+ export declare const STOP_MARKET_ORDER_TYPE_CONFIG: UIOrderTypeValue;
5
+ export declare const STOP_LIMIT_ORDER_TYPE_CONFIG: UIOrderTypeValue;
6
+ export declare const TAKE_PROFIT_MARKET_ORDER_TYPE_CONFIG: UIOrderTypeValue;
7
+ export declare const TAKE_PROFIT_LIMIT_ORDER_TYPE_CONFIG: UIOrderTypeValue;
8
+ export declare const ORACLE_MARKET_ORDER_TYPE_CONFIG: UIOrderTypeValue;
9
+ export declare const ORACLE_LIMIT_ORDER_TYPE_CONFIG: UIOrderTypeValue;
10
+ export declare const SCALED_ORDERS_ORDER_TYPE_CONFIG: UIOrderTypeValue;
11
+ export declare const UI_ORDER_TYPES: UIOrderTypeLookup;
12
+ export declare const UI_ORDER_TYPES_LIST: UIOrderTypeValue[];
@@ -0,0 +1,79 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.UI_ORDER_TYPES_LIST = exports.UI_ORDER_TYPES = exports.SCALED_ORDERS_ORDER_TYPE_CONFIG = exports.ORACLE_LIMIT_ORDER_TYPE_CONFIG = exports.ORACLE_MARKET_ORDER_TYPE_CONFIG = exports.TAKE_PROFIT_LIMIT_ORDER_TYPE_CONFIG = exports.TAKE_PROFIT_MARKET_ORDER_TYPE_CONFIG = exports.STOP_LIMIT_ORDER_TYPE_CONFIG = exports.STOP_MARKET_ORDER_TYPE_CONFIG = exports.LIMIT_ORDER_TYPE_CONFIG = exports.MARKET_ORDER_TYPE_CONFIG = void 0;
4
+ const sdk_1 = require("@drift-labs/sdk");
5
+ // Market order type
6
+ exports.MARKET_ORDER_TYPE_CONFIG = {
7
+ label: 'Market',
8
+ value: 'market',
9
+ orderType: sdk_1.OrderType.MARKET,
10
+ description: 'A Market Order is an order to buy or sell an asset immediately at the current Market Price. Users can set a maximum slippage tolerance.',
11
+ };
12
+ // Limit order type
13
+ exports.LIMIT_ORDER_TYPE_CONFIG = {
14
+ label: 'Limit',
15
+ value: 'limit',
16
+ orderType: sdk_1.OrderType.LIMIT,
17
+ description: 'A Limit Order is an order to buy or sell a given asset at a specified price. Limit Orders are triggered once Oracle Price reaches the specified price.',
18
+ };
19
+ // Stop Market order type
20
+ exports.STOP_MARKET_ORDER_TYPE_CONFIG = {
21
+ label: 'Stop Market',
22
+ value: 'stopMarket',
23
+ orderType: sdk_1.OrderType.TRIGGER_MARKET,
24
+ description: 'A Stop Market Order is an order to close the position of a given asset if its specified Trigger Price is reached. If this happens, the position is closed at Market Price.',
25
+ };
26
+ // Stop Limit order type
27
+ exports.STOP_LIMIT_ORDER_TYPE_CONFIG = {
28
+ label: 'Stop Limit',
29
+ value: 'stopLimit',
30
+ orderType: sdk_1.OrderType.TRIGGER_LIMIT,
31
+ description: 'A Stop Limit Order will only execute where the specified Trigger Price of a given asset is reached. If this happens, a Limit Order at the specified Limit Price will be placed.',
32
+ };
33
+ // Take Profit Market order type
34
+ exports.TAKE_PROFIT_MARKET_ORDER_TYPE_CONFIG = {
35
+ label: 'Take Profit',
36
+ value: 'takeProfitMarket',
37
+ orderType: sdk_1.OrderType.TRIGGER_MARKET,
38
+ description: 'A Take Profit Order is an order to close the position of a given asset if its Oracle Price reaches the specified Trigger Price. If this happens, the position is closed at Market Price.',
39
+ };
40
+ // Take Profit Limit order type
41
+ exports.TAKE_PROFIT_LIMIT_ORDER_TYPE_CONFIG = {
42
+ label: 'Take Profit Limit',
43
+ value: 'takeProfitLimit',
44
+ orderType: sdk_1.OrderType.TRIGGER_LIMIT,
45
+ description: 'A Take Profit Limit Order will only execute where the Oracle Price of a given asset reaches the Trigger Price. If this happens, a Limit Order at the specified Limit Price will be placed.',
46
+ };
47
+ // Oracle Market order type
48
+ exports.ORACLE_MARKET_ORDER_TYPE_CONFIG = {
49
+ label: 'Oracle Market',
50
+ value: 'oracle',
51
+ orderType: sdk_1.OrderType.ORACLE,
52
+ };
53
+ // Oracle Limit order type
54
+ exports.ORACLE_LIMIT_ORDER_TYPE_CONFIG = {
55
+ label: 'Oracle Limit',
56
+ value: 'oracleLimit',
57
+ orderType: sdk_1.OrderType.LIMIT,
58
+ description: 'An Oracle Limit Order allows you to specify an offset rather than limit price to execute your order. The offset represents the price above/below the current Oracle Price you want to be filled at. Learn more.',
59
+ };
60
+ // Scaled Orders order type
61
+ exports.SCALED_ORDERS_ORDER_TYPE_CONFIG = {
62
+ label: 'Scale',
63
+ value: 'scaledOrders',
64
+ orderType: sdk_1.OrderType.LIMIT,
65
+ description: 'A scaled order automatically generates multiple limit orders within a specified price range. It splits the order amount into several suborders and places them separately without significantly impacting the market.',
66
+ };
67
+ exports.UI_ORDER_TYPES = {
68
+ market: exports.MARKET_ORDER_TYPE_CONFIG,
69
+ limit: exports.LIMIT_ORDER_TYPE_CONFIG,
70
+ stopMarket: exports.STOP_MARKET_ORDER_TYPE_CONFIG,
71
+ stopLimit: exports.STOP_LIMIT_ORDER_TYPE_CONFIG,
72
+ takeProfitMarket: exports.TAKE_PROFIT_MARKET_ORDER_TYPE_CONFIG,
73
+ takeProfitLimit: exports.TAKE_PROFIT_LIMIT_ORDER_TYPE_CONFIG,
74
+ oracle: exports.ORACLE_MARKET_ORDER_TYPE_CONFIG,
75
+ oracleLimit: exports.ORACLE_LIMIT_ORDER_TYPE_CONFIG,
76
+ scaledOrders: exports.SCALED_ORDERS_ORDER_TYPE_CONFIG,
77
+ };
78
+ exports.UI_ORDER_TYPES_LIST = Object.values(exports.UI_ORDER_TYPES);
79
+ //# sourceMappingURL=orders.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"orders.js","sourceRoot":"","sources":["../../src/constants/orders.ts"],"names":[],"mappings":";;;AAAA,yCAA4C;AAG5C,oBAAoB;AACP,QAAA,wBAAwB,GAAqB;IACzD,KAAK,EAAE,QAAQ;IACf,KAAK,EAAE,QAAQ;IACf,SAAS,EAAE,eAAS,CAAC,MAAM;IAC3B,WAAW,EACV,yIAAyI;CAC1I,CAAC;AAEF,mBAAmB;AACN,QAAA,uBAAuB,GAAqB;IACxD,KAAK,EAAE,OAAO;IACd,KAAK,EAAE,OAAO;IACd,SAAS,EAAE,eAAS,CAAC,KAAK;IAC1B,WAAW,EACV,wJAAwJ;CACzJ,CAAC;AAEF,yBAAyB;AACZ,QAAA,6BAA6B,GAAqB;IAC9D,KAAK,EAAE,aAAa;IACpB,KAAK,EAAE,YAAY;IACnB,SAAS,EAAE,eAAS,CAAC,cAAc;IACnC,WAAW,EACV,4KAA4K;CAC7K,CAAC;AAEF,wBAAwB;AACX,QAAA,4BAA4B,GAAqB;IAC7D,KAAK,EAAE,YAAY;IACnB,KAAK,EAAE,WAAW;IAClB,SAAS,EAAE,eAAS,CAAC,aAAa;IAClC,WAAW,EACV,iLAAiL;CAClL,CAAC;AAEF,gCAAgC;AACnB,QAAA,oCAAoC,GAAqB;IACrE,KAAK,EAAE,aAAa;IACpB,KAAK,EAAE,kBAAkB;IACzB,SAAS,EAAE,eAAS,CAAC,cAAc;IACnC,WAAW,EACV,0LAA0L;CAC3L,CAAC;AAEF,+BAA+B;AAClB,QAAA,mCAAmC,GAAqB;IACpE,KAAK,EAAE,mBAAmB;IAC1B,KAAK,EAAE,iBAAiB;IACxB,SAAS,EAAE,eAAS,CAAC,aAAa;IAClC,WAAW,EACV,4LAA4L;CAC7L,CAAC;AAEF,2BAA2B;AACd,QAAA,+BAA+B,GAAqB;IAChE,KAAK,EAAE,eAAe;IACtB,KAAK,EAAE,QAAQ;IACf,SAAS,EAAE,eAAS,CAAC,MAAM;CAC3B,CAAC;AAEF,0BAA0B;AACb,QAAA,8BAA8B,GAAqB;IAC/D,KAAK,EAAE,cAAc;IACrB,KAAK,EAAE,aAAa;IACpB,SAAS,EAAE,eAAS,CAAC,KAAK;IAC1B,WAAW,EACV,iNAAiN;CAClN,CAAC;AAEF,2BAA2B;AACd,QAAA,+BAA+B,GAAqB;IAChE,KAAK,EAAE,OAAO;IACd,KAAK,EAAE,cAAc;IACrB,SAAS,EAAE,eAAS,CAAC,KAAK;IAC1B,WAAW,EACV,uNAAuN;CACxN,CAAC;AAEW,QAAA,cAAc,GAAsB;IAChD,MAAM,EAAE,gCAAwB;IAChC,KAAK,EAAE,+BAAuB;IAC9B,UAAU,EAAE,qCAA6B;IACzC,SAAS,EAAE,oCAA4B;IACvC,gBAAgB,EAAE,4CAAoC;IACtD,eAAe,EAAE,2CAAmC;IACpD,MAAM,EAAE,uCAA+B;IACvC,WAAW,EAAE,sCAA8B;IAC3C,YAAY,EAAE,uCAA+B;CAC7C,CAAC;AAEW,QAAA,mBAAmB,GAAG,MAAM,CAAC,MAAM,CAAC,sBAAc,CAAC,CAAC","sourcesContent":["import { OrderType } from '@drift-labs/sdk';\nimport { UIOrderTypeLookup, UIOrderTypeValue } from '../types';\n\n// Market order type\nexport const MARKET_ORDER_TYPE_CONFIG: UIOrderTypeValue = {\n\tlabel: 'Market',\n\tvalue: 'market',\n\torderType: OrderType.MARKET,\n\tdescription:\n\t\t'A Market Order is an order to buy or sell an asset immediately at the current Market Price. Users can set a maximum slippage tolerance.',\n};\n\n// Limit order type\nexport const LIMIT_ORDER_TYPE_CONFIG: UIOrderTypeValue = {\n\tlabel: 'Limit',\n\tvalue: 'limit',\n\torderType: OrderType.LIMIT,\n\tdescription:\n\t\t'A Limit Order is an order to buy or sell a given asset at a specified price. Limit Orders are triggered once Oracle Price reaches the specified price.',\n};\n\n// Stop Market order type\nexport const STOP_MARKET_ORDER_TYPE_CONFIG: UIOrderTypeValue = {\n\tlabel: 'Stop Market',\n\tvalue: 'stopMarket',\n\torderType: OrderType.TRIGGER_MARKET,\n\tdescription:\n\t\t'A Stop Market Order is an order to close the position of a given asset if its specified Trigger Price is reached. If this happens, the position is closed at Market Price.',\n};\n\n// Stop Limit order type\nexport const STOP_LIMIT_ORDER_TYPE_CONFIG: UIOrderTypeValue = {\n\tlabel: 'Stop Limit',\n\tvalue: 'stopLimit',\n\torderType: OrderType.TRIGGER_LIMIT,\n\tdescription:\n\t\t'A Stop Limit Order will only execute where the specified Trigger Price of a given asset is reached. If this happens, a Limit Order at the specified Limit Price will be placed.',\n};\n\n// Take Profit Market order type\nexport const TAKE_PROFIT_MARKET_ORDER_TYPE_CONFIG: UIOrderTypeValue = {\n\tlabel: 'Take Profit',\n\tvalue: 'takeProfitMarket',\n\torderType: OrderType.TRIGGER_MARKET,\n\tdescription:\n\t\t'A Take Profit Order is an order to close the position of a given asset if its Oracle Price reaches the specified Trigger Price. If this happens, the position is closed at Market Price.',\n};\n\n// Take Profit Limit order type\nexport const TAKE_PROFIT_LIMIT_ORDER_TYPE_CONFIG: UIOrderTypeValue = {\n\tlabel: 'Take Profit Limit',\n\tvalue: 'takeProfitLimit',\n\torderType: OrderType.TRIGGER_LIMIT,\n\tdescription:\n\t\t'A Take Profit Limit Order will only execute where the Oracle Price of a given asset reaches the Trigger Price. If this happens, a Limit Order at the specified Limit Price will be placed.',\n};\n\n// Oracle Market order type\nexport const ORACLE_MARKET_ORDER_TYPE_CONFIG: UIOrderTypeValue = {\n\tlabel: 'Oracle Market',\n\tvalue: 'oracle',\n\torderType: OrderType.ORACLE,\n};\n\n// Oracle Limit order type\nexport const ORACLE_LIMIT_ORDER_TYPE_CONFIG: UIOrderTypeValue = {\n\tlabel: 'Oracle Limit',\n\tvalue: 'oracleLimit',\n\torderType: OrderType.LIMIT,\n\tdescription:\n\t\t'An Oracle Limit Order allows you to specify an offset rather than limit price to execute your order. The offset represents the price above/below the current Oracle Price you want to be filled at. Learn more.',\n};\n\n// Scaled Orders order type\nexport const SCALED_ORDERS_ORDER_TYPE_CONFIG: UIOrderTypeValue = {\n\tlabel: 'Scale',\n\tvalue: 'scaledOrders',\n\torderType: OrderType.LIMIT,\n\tdescription:\n\t\t'A scaled order automatically generates multiple limit orders within a specified price range. It splits the order amount into several suborders and places them separately without significantly impacting the market.',\n};\n\nexport const UI_ORDER_TYPES: UIOrderTypeLookup = {\n\tmarket: MARKET_ORDER_TYPE_CONFIG,\n\tlimit: LIMIT_ORDER_TYPE_CONFIG,\n\tstopMarket: STOP_MARKET_ORDER_TYPE_CONFIG,\n\tstopLimit: STOP_LIMIT_ORDER_TYPE_CONFIG,\n\ttakeProfitMarket: TAKE_PROFIT_MARKET_ORDER_TYPE_CONFIG,\n\ttakeProfitLimit: TAKE_PROFIT_LIMIT_ORDER_TYPE_CONFIG,\n\toracle: ORACLE_MARKET_ORDER_TYPE_CONFIG,\n\toracleLimit: ORACLE_LIMIT_ORDER_TYPE_CONFIG,\n\tscaledOrders: SCALED_ORDERS_ORDER_TYPE_CONFIG,\n};\n\nexport const UI_ORDER_TYPES_LIST = Object.values(UI_ORDER_TYPES);\n"]}
@@ -0,0 +1,5 @@
1
+ export declare const MAIN_POOL_ID = 0;
2
+ export declare const JLP_POOL_ID = 1;
3
+ export declare const LST_POOL_ID = 2;
4
+ export declare const EXPONENT_POOL_ID = 3;
5
+ export declare const SACRED_POOL_ID = 4;
@@ -0,0 +1,9 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.SACRED_POOL_ID = exports.EXPONENT_POOL_ID = exports.LST_POOL_ID = exports.JLP_POOL_ID = exports.MAIN_POOL_ID = void 0;
4
+ exports.MAIN_POOL_ID = 0;
5
+ exports.JLP_POOL_ID = 1;
6
+ exports.LST_POOL_ID = 2;
7
+ exports.EXPONENT_POOL_ID = 3;
8
+ exports.SACRED_POOL_ID = 4;
9
+ //# sourceMappingURL=pools.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"pools.js","sourceRoot":"","sources":["../../src/constants/pools.ts"],"names":[],"mappings":";;;AAAa,QAAA,YAAY,GAAG,CAAC,CAAC;AACjB,QAAA,WAAW,GAAG,CAAC,CAAC;AAChB,QAAA,WAAW,GAAG,CAAC,CAAC;AAChB,QAAA,gBAAgB,GAAG,CAAC,CAAC;AACrB,QAAA,cAAc,GAAG,CAAC,CAAC","sourcesContent":["export const MAIN_POOL_ID = 0;\nexport const JLP_POOL_ID = 1;\nexport const LST_POOL_ID = 2;\nexport const EXPONENT_POOL_ID = 3;\nexport const SACRED_POOL_ID = 4;\n"]}
@@ -0,0 +1,3 @@
1
+ import { BigNum } from '@drift-labs/sdk';
2
+ export declare const MAX_PREDICTION_PRICE_NUM: number;
3
+ export declare const MAX_PREDICTION_PRICE_BIG_NUM: BigNum;
@@ -0,0 +1,7 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.MAX_PREDICTION_PRICE_BIG_NUM = exports.MAX_PREDICTION_PRICE_NUM = void 0;
4
+ const sdk_1 = require("@drift-labs/sdk");
5
+ exports.MAX_PREDICTION_PRICE_NUM = sdk_1.MAX_PREDICTION_PRICE.div(sdk_1.PRICE_PRECISION).toNumber();
6
+ exports.MAX_PREDICTION_PRICE_BIG_NUM = sdk_1.BigNum.from(sdk_1.MAX_PREDICTION_PRICE, sdk_1.PRICE_PRECISION_EXP);
7
+ //# sourceMappingURL=predictionMarket.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"predictionMarket.js","sourceRoot":"","sources":["../../src/constants/predictionMarket.ts"],"names":[],"mappings":";;;AAAA,yCAKyB;AAEZ,QAAA,wBAAwB,GACpC,0BAAoB,CAAC,GAAG,CAAC,qBAAe,CAAC,CAAC,QAAQ,EAAE,CAAC;AAEzC,QAAA,4BAA4B,GAAG,YAAM,CAAC,IAAI,CACtD,0BAAoB,EACpB,yBAAmB,CACnB,CAAC","sourcesContent":["import {\n\tMAX_PREDICTION_PRICE,\n\tBigNum,\n\tPRICE_PRECISION,\n\tPRICE_PRECISION_EXP,\n} from '@drift-labs/sdk';\n\nexport const MAX_PREDICTION_PRICE_NUM =\n\tMAX_PREDICTION_PRICE.div(PRICE_PRECISION).toNumber();\n\nexport const MAX_PREDICTION_PRICE_BIG_NUM = BigNum.from(\n\tMAX_PREDICTION_PRICE,\n\tPRICE_PRECISION_EXP\n);\n"]}
@@ -0,0 +1,22 @@
1
+ import { SpotMarketConfig } from '@drift-labs/sdk';
2
+ export type LST = {
3
+ symbol: string;
4
+ driftAccountName: string;
5
+ spotMarket: SpotMarketConfig;
6
+ logoUrl: string;
7
+ maxLeverage: number;
8
+ defaultLeverage: number;
9
+ emissionsTokenSymbol?: string;
10
+ onlyDirectRoute?: boolean;
11
+ };
12
+ export declare const M_SOL: LST;
13
+ export declare const JITO_SOL: LST;
14
+ export declare const B_SOL: LST;
15
+ /**
16
+ * All LSTs that support one-click superstaking
17
+ */
18
+ export declare const SUPERSTAKE_ALL_LST: LST[];
19
+ /**
20
+ * All LSTs that support one-click superstaking
21
+ */
22
+ export declare const SUPERSTAKE_ALL_LST_MAP: Record<string, LST>;
@@ -0,0 +1,45 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.SUPERSTAKE_ALL_LST_MAP = exports.SUPERSTAKE_ALL_LST = exports.B_SOL = exports.JITO_SOL = exports.M_SOL = void 0;
4
+ const sdk_1 = require("@drift-labs/sdk");
5
+ exports.M_SOL = {
6
+ symbol: 'mSOL',
7
+ driftAccountName: 'Super Stake SOL',
8
+ spotMarket: sdk_1.MainnetSpotMarkets[2],
9
+ logoUrl: '/mSol.svg',
10
+ maxLeverage: 3,
11
+ defaultLeverage: 2,
12
+ onlyDirectRoute: true,
13
+ };
14
+ exports.JITO_SOL = {
15
+ symbol: 'JitoSOL',
16
+ driftAccountName: 'Super Stake JitoSOL',
17
+ spotMarket: sdk_1.MainnetSpotMarkets[6],
18
+ logoUrl: '/jitoSol.svg',
19
+ maxLeverage: 1.8,
20
+ defaultLeverage: 1.4,
21
+ onlyDirectRoute: true,
22
+ };
23
+ exports.B_SOL = {
24
+ symbol: 'bSOL',
25
+ driftAccountName: 'Super Stake bSOL',
26
+ spotMarket: sdk_1.MainnetSpotMarkets[8],
27
+ logoUrl: '/bsol.svg',
28
+ maxLeverage: 2.5,
29
+ defaultLeverage: 1.8,
30
+ emissionsTokenSymbol: 'BLZE',
31
+ onlyDirectRoute: true,
32
+ };
33
+ /**
34
+ * All LSTs that support one-click superstaking
35
+ */
36
+ exports.SUPERSTAKE_ALL_LST = [exports.M_SOL, exports.JITO_SOL, exports.B_SOL];
37
+ /**
38
+ * All LSTs that support one-click superstaking
39
+ */
40
+ exports.SUPERSTAKE_ALL_LST_MAP = {
41
+ [exports.M_SOL.symbol]: exports.M_SOL,
42
+ [exports.JITO_SOL.symbol]: exports.JITO_SOL,
43
+ [exports.B_SOL.symbol]: exports.B_SOL,
44
+ };
45
+ //# sourceMappingURL=superstake.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"superstake.js","sourceRoot":"","sources":["../../src/constants/superstake.ts"],"names":[],"mappings":";;;AAAA,yCAAuE;AAiB1D,QAAA,KAAK,GAAQ;IACzB,MAAM,EAAE,MAAM;IACd,gBAAgB,EAAE,iBAAiB;IACnC,UAAU,EAAE,wBAAkB,CAAC,CAAC,CAAC;IACjC,OAAO,EAAE,WAAW;IACpB,WAAW,EAAE,CAAC;IACd,eAAe,EAAE,CAAC;IAClB,eAAe,EAAE,IAAI;CACrB,CAAC;AAEW,QAAA,QAAQ,GAAQ;IAC5B,MAAM,EAAE,SAAS;IACjB,gBAAgB,EAAE,qBAAqB;IACvC,UAAU,EAAE,wBAAkB,CAAC,CAAC,CAAC;IACjC,OAAO,EAAE,cAAc;IACvB,WAAW,EAAE,GAAG;IAChB,eAAe,EAAE,GAAG;IACpB,eAAe,EAAE,IAAI;CACrB,CAAC;AAEW,QAAA,KAAK,GAAQ;IACzB,MAAM,EAAE,MAAM;IACd,gBAAgB,EAAE,kBAAkB;IACpC,UAAU,EAAE,wBAAkB,CAAC,CAAC,CAAC;IACjC,OAAO,EAAE,WAAW;IACpB,WAAW,EAAE,GAAG;IAChB,eAAe,EAAE,GAAG;IACpB,oBAAoB,EAAE,MAAM;IAC5B,eAAe,EAAE,IAAI;CACrB,CAAC;AAEF;;GAEG;AACU,QAAA,kBAAkB,GAAU,CAAC,aAAK,EAAE,gBAAQ,EAAE,aAAK,CAAC,CAAC;AAElE;;GAEG;AACU,QAAA,sBAAsB,GAAwB;IAC1D,CAAC,aAAK,CAAC,MAAM,CAAC,EAAE,aAAK;IACrB,CAAC,gBAAQ,CAAC,MAAM,CAAC,EAAE,gBAAQ;IAC3B,CAAC,aAAK,CAAC,MAAM,CAAC,EAAE,aAAK;CACrB,CAAC","sourcesContent":["import { MainnetSpotMarkets, SpotMarketConfig } from '@drift-labs/sdk';\n\nexport type LST = {\n\tsymbol: string; // symbol is added as a config because JitoSOL's symbol in the spotMarket is jitoSOL\n\tdriftAccountName: string;\n\tspotMarket: SpotMarketConfig;\n\tlogoUrl: string;\n\t// maxLeverage set manually for now, but would be nice if we make it derived from the asset weight later on\n\tmaxLeverage: number;\n\t// Default leverage to start the form out with when switching to the lst\n\tdefaultLeverage: number;\n\t// Symbol of the token offered as emissions if there's an emissions APY on top of the normal APY\n\temissionsTokenSymbol?: string;\n\t// use direct route for Jupiter swap\n\tonlyDirectRoute?: boolean;\n};\n\nexport const M_SOL: LST = {\n\tsymbol: 'mSOL',\n\tdriftAccountName: 'Super Stake SOL',\n\tspotMarket: MainnetSpotMarkets[2],\n\tlogoUrl: '/mSol.svg',\n\tmaxLeverage: 3,\n\tdefaultLeverage: 2,\n\tonlyDirectRoute: true,\n};\n\nexport const JITO_SOL: LST = {\n\tsymbol: 'JitoSOL',\n\tdriftAccountName: 'Super Stake JitoSOL',\n\tspotMarket: MainnetSpotMarkets[6],\n\tlogoUrl: '/jitoSol.svg',\n\tmaxLeverage: 1.8,\n\tdefaultLeverage: 1.4,\n\tonlyDirectRoute: true,\n};\n\nexport const B_SOL: LST = {\n\tsymbol: 'bSOL',\n\tdriftAccountName: 'Super Stake bSOL',\n\tspotMarket: MainnetSpotMarkets[8],\n\tlogoUrl: '/bsol.svg',\n\tmaxLeverage: 2.5,\n\tdefaultLeverage: 1.8,\n\temissionsTokenSymbol: 'BLZE',\n\tonlyDirectRoute: true,\n};\n\n/**\n * All LSTs that support one-click superstaking\n */\nexport const SUPERSTAKE_ALL_LST: LST[] = [M_SOL, JITO_SOL, B_SOL];\n\n/**\n * All LSTs that support one-click superstaking\n */\nexport const SUPERSTAKE_ALL_LST_MAP: Record<string, LST> = {\n\t[M_SOL.symbol]: M_SOL,\n\t[JITO_SOL.symbol]: JITO_SOL,\n\t[B_SOL.symbol]: B_SOL,\n};\n"]}
@@ -0,0 +1,2 @@
1
+ import { AuctionParams } from 'src/types';
2
+ export declare const EMPTY_AUCTION_PARAMS: AuctionParams;
@@ -0,0 +1,9 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.EMPTY_AUCTION_PARAMS = void 0;
4
+ exports.EMPTY_AUCTION_PARAMS = {
5
+ auctionStartPrice: null,
6
+ auctionEndPrice: null,
7
+ auctionDuration: null,
8
+ };
9
+ //# sourceMappingURL=trade.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"trade.js","sourceRoot":"","sources":["../../src/constants/trade.ts"],"names":[],"mappings":";;;AAEa,QAAA,oBAAoB,GAAkB;IAClD,iBAAiB,EAAE,IAAI;IACvB,eAAe,EAAE,IAAI;IACrB,eAAe,EAAE,IAAI;CACrB,CAAC","sourcesContent":["import { AuctionParams } from 'src/types';\n\nexport const EMPTY_AUCTION_PARAMS: AuctionParams = {\n\tauctionStartPrice: null,\n\tauctionEndPrice: null,\n\tauctionDuration: null,\n};\n"]}