@mysten/deepbook-v3 0.28.2 → 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 (535) hide show
  1. package/CHANGELOG.md +86 -0
  2. package/dist/client.d.mts +897 -0
  3. package/dist/client.d.mts.map +1 -0
  4. package/dist/client.mjs +2067 -0
  5. package/dist/client.mjs.map +1 -0
  6. package/dist/contracts/deepbook/account.d.mts +38 -0
  7. package/dist/contracts/deepbook/account.d.mts.map +1 -0
  8. package/dist/contracts/deepbook/account.mjs +31 -0
  9. package/dist/contracts/deepbook/account.mjs.map +1 -0
  10. package/dist/contracts/deepbook/balances.d.mts +13 -0
  11. package/dist/contracts/deepbook/balances.d.mts.map +1 -0
  12. package/dist/contracts/deepbook/balances.mjs +24 -0
  13. package/dist/contracts/deepbook/balances.mjs.map +1 -0
  14. package/dist/contracts/deepbook/deep_price.d.mts +13 -0
  15. package/dist/contracts/deepbook/deep_price.d.mts.map +1 -0
  16. package/dist/contracts/deepbook/deep_price.mjs +49 -0
  17. package/dist/contracts/deepbook/deep_price.mjs.map +1 -0
  18. package/dist/contracts/deepbook/deps/sui/vec_set.d.mts +22 -0
  19. package/dist/contracts/deepbook/deps/sui/vec_set.d.mts.map +1 -0
  20. package/dist/contracts/deepbook/deps/sui/vec_set.mjs +26 -0
  21. package/dist/contracts/deepbook/deps/sui/vec_set.mjs.map +1 -0
  22. package/dist/contracts/deepbook/order.d.mts +24 -0
  23. package/dist/contracts/deepbook/order.d.mts.map +1 -0
  24. package/dist/contracts/deepbook/order.mjs +63 -0
  25. package/dist/contracts/deepbook/order.mjs.map +1 -0
  26. package/dist/contracts/pyth/data_source.mjs +20 -0
  27. package/dist/contracts/pyth/data_source.mjs.map +1 -0
  28. package/dist/contracts/pyth/deps/0x0000000000000000000000000000000000000000000000000000000000000002/package.mjs +21 -0
  29. package/dist/contracts/pyth/deps/0x0000000000000000000000000000000000000000000000000000000000000002/package.mjs.map +1 -0
  30. package/dist/contracts/pyth/deps/0x0000000000000000000000000000000000000000000000000000000000000002/table.mjs +19 -0
  31. package/dist/contracts/pyth/deps/0x0000000000000000000000000000000000000000000000000000000000000002/table.mjs.map +1 -0
  32. package/dist/contracts/pyth/deps/0xf47329f4344f3bf0f8e436e2f7b485466cff300f12a166563995d3888c296a94/bytes32.mjs +16 -0
  33. package/dist/contracts/pyth/deps/0xf47329f4344f3bf0f8e436e2f7b485466cff300f12a166563995d3888c296a94/bytes32.mjs.map +1 -0
  34. package/dist/contracts/pyth/deps/0xf47329f4344f3bf0f8e436e2f7b485466cff300f12a166563995d3888c296a94/consumed_vaas.mjs +16 -0
  35. package/dist/contracts/pyth/deps/0xf47329f4344f3bf0f8e436e2f7b485466cff300f12a166563995d3888c296a94/consumed_vaas.mjs.map +1 -0
  36. package/dist/contracts/pyth/deps/0xf47329f4344f3bf0f8e436e2f7b485466cff300f12a166563995d3888c296a94/external_address.mjs +16 -0
  37. package/dist/contracts/pyth/deps/0xf47329f4344f3bf0f8e436e2f7b485466cff300f12a166563995d3888c296a94/external_address.mjs.map +1 -0
  38. package/dist/contracts/pyth/deps/0xf47329f4344f3bf0f8e436e2f7b485466cff300f12a166563995d3888c296a94/set.mjs +16 -0
  39. package/dist/contracts/pyth/deps/0xf47329f4344f3bf0f8e436e2f7b485466cff300f12a166563995d3888c296a94/set.mjs.map +1 -0
  40. package/dist/contracts/pyth/i64.mjs +19 -0
  41. package/dist/contracts/pyth/i64.mjs.map +1 -0
  42. package/dist/contracts/pyth/price.mjs +22 -0
  43. package/dist/contracts/pyth/price.mjs.map +1 -0
  44. package/dist/contracts/pyth/price_feed.mjs +21 -0
  45. package/dist/contracts/pyth/price_feed.mjs.map +1 -0
  46. package/dist/contracts/pyth/price_identifier.mjs +16 -0
  47. package/dist/contracts/pyth/price_identifier.mjs.map +1 -0
  48. package/dist/contracts/pyth/price_info.mjs +28 -0
  49. package/dist/contracts/pyth/price_info.mjs.map +1 -0
  50. package/dist/contracts/pyth/state.mjs +36 -0
  51. package/dist/contracts/pyth/state.mjs.map +1 -0
  52. package/dist/contracts/utils/index.d.mts +34 -0
  53. package/dist/contracts/utils/index.d.mts.map +1 -0
  54. package/dist/contracts/utils/index.mjs +35 -0
  55. package/dist/contracts/utils/index.mjs.map +1 -0
  56. package/dist/index.d.mts +25 -0
  57. package/dist/index.mjs +26 -0
  58. package/dist/pyth/PriceServiceConnection.d.mts +26 -0
  59. package/dist/pyth/PriceServiceConnection.d.mts.map +1 -0
  60. package/dist/pyth/PriceServiceConnection.mjs +35 -0
  61. package/dist/pyth/PriceServiceConnection.mjs.map +1 -0
  62. package/dist/pyth/pyth-helpers.mjs +18 -0
  63. package/dist/pyth/pyth-helpers.mjs.map +1 -0
  64. package/dist/pyth/pyth.d.mts +69 -0
  65. package/dist/pyth/pyth.d.mts.map +1 -0
  66. package/dist/pyth/pyth.mjs +223 -0
  67. package/dist/pyth/pyth.mjs.map +1 -0
  68. package/dist/transactions/balanceManager.d.mts +174 -0
  69. package/dist/transactions/balanceManager.d.mts.map +1 -0
  70. package/dist/transactions/balanceManager.mjs +233 -0
  71. package/dist/transactions/balanceManager.mjs.map +1 -0
  72. package/dist/transactions/deepbook.d.mts +490 -0
  73. package/dist/transactions/deepbook.d.mts.map +1 -0
  74. package/dist/transactions/deepbook.mjs +978 -0
  75. package/dist/transactions/deepbook.mjs.map +1 -0
  76. package/dist/transactions/deepbookAdmin.d.mts +111 -0
  77. package/dist/transactions/deepbookAdmin.d.mts.map +1 -0
  78. package/dist/transactions/deepbookAdmin.mjs +221 -0
  79. package/dist/transactions/deepbookAdmin.mjs.map +1 -0
  80. package/dist/transactions/flashLoans.d.mts +62 -0
  81. package/dist/transactions/flashLoans.d.mts.map +1 -0
  82. package/dist/transactions/flashLoans.mjs +75 -0
  83. package/dist/transactions/flashLoans.mjs.map +1 -0
  84. package/dist/transactions/governance.d.mts +48 -0
  85. package/dist/transactions/governance.d.mts.map +1 -0
  86. package/dist/transactions/governance.mjs +90 -0
  87. package/dist/transactions/governance.mjs.map +1 -0
  88. package/dist/transactions/marginAdmin.d.mts +139 -0
  89. package/dist/transactions/marginAdmin.d.mts.map +1 -0
  90. package/dist/transactions/marginAdmin.mjs +249 -0
  91. package/dist/transactions/marginAdmin.mjs.map +1 -0
  92. package/dist/transactions/marginLiquidations.d.mts +67 -0
  93. package/dist/transactions/marginLiquidations.d.mts.map +1 -0
  94. package/dist/transactions/marginLiquidations.mjs +109 -0
  95. package/dist/transactions/marginLiquidations.mjs.map +1 -0
  96. package/dist/transactions/marginMaintainer.d.mts +86 -0
  97. package/dist/transactions/marginMaintainer.d.mts.map +1 -0
  98. package/dist/transactions/marginMaintainer.mjs +160 -0
  99. package/dist/transactions/marginMaintainer.mjs.map +1 -0
  100. package/dist/transactions/marginManager.d.mts +255 -0
  101. package/dist/transactions/marginManager.d.mts.map +1 -0
  102. package/dist/transactions/marginManager.mjs +558 -0
  103. package/dist/transactions/marginManager.mjs.map +1 -0
  104. package/dist/transactions/marginPool.d.mts +140 -0
  105. package/dist/transactions/marginPool.d.mts.map +1 -0
  106. package/dist/transactions/marginPool.mjs +206 -0
  107. package/dist/transactions/marginPool.mjs.map +1 -0
  108. package/dist/transactions/marginRegistry.d.mts +100 -0
  109. package/dist/transactions/marginRegistry.d.mts.map +1 -0
  110. package/dist/transactions/marginRegistry.mjs +128 -0
  111. package/dist/transactions/marginRegistry.mjs.map +1 -0
  112. package/dist/transactions/marginTPSL.d.mts +99 -0
  113. package/dist/transactions/marginTPSL.d.mts.map +1 -0
  114. package/dist/transactions/marginTPSL.mjs +176 -0
  115. package/dist/transactions/marginTPSL.mjs.map +1 -0
  116. package/dist/transactions/poolProxy.d.mts +117 -0
  117. package/dist/transactions/poolProxy.d.mts.map +1 -0
  118. package/dist/transactions/poolProxy.mjs +318 -0
  119. package/dist/transactions/poolProxy.mjs.map +1 -0
  120. package/dist/types/bcs.d.mts +5 -0
  121. package/dist/types/bcs.mjs +7 -0
  122. package/dist/types/index.d.mts +237 -0
  123. package/dist/types/index.d.mts.map +1 -0
  124. package/dist/types/index.mjs +18 -0
  125. package/dist/types/index.mjs.map +1 -0
  126. package/dist/utils/config.d.mts +82 -0
  127. package/dist/utils/config.d.mts.map +1 -0
  128. package/dist/utils/config.mjs +88 -0
  129. package/dist/utils/config.mjs.map +1 -0
  130. package/dist/utils/constants.d.mts +81 -0
  131. package/dist/utils/constants.d.mts.map +1 -0
  132. package/dist/utils/constants.mjs +362 -0
  133. package/dist/utils/constants.mjs.map +1 -0
  134. package/dist/utils/errors.d.mts +46 -0
  135. package/dist/utils/errors.d.mts.map +1 -0
  136. package/dist/utils/errors.mjs +59 -0
  137. package/dist/utils/errors.mjs.map +1 -0
  138. package/dist/{cjs/utils/validation.d.ts → utils/validation.d.mts} +11 -7
  139. package/dist/utils/validation.d.mts.map +1 -0
  140. package/dist/utils/validation.mjs +76 -0
  141. package/dist/utils/validation.mjs.map +1 -0
  142. package/package.json +23 -21
  143. package/src/client.ts +577 -549
  144. package/src/contracts/deepbook/account.ts +14 -14
  145. package/src/contracts/deepbook/balance_manager.ts +340 -54
  146. package/src/contracts/deepbook/balances.ts +3 -2
  147. package/src/contracts/deepbook/big_vector.ts +5 -6
  148. package/src/contracts/deepbook/book.ts +3 -2
  149. package/src/contracts/deepbook/constants.ts +95 -3
  150. package/src/contracts/deepbook/deep_price.ts +7 -7
  151. package/src/contracts/deepbook/deps/std/type_name.ts +3 -2
  152. package/src/contracts/deepbook/deps/sui/bag.ts +4 -4
  153. package/src/contracts/deepbook/deps/sui/balance.ts +3 -2
  154. package/src/contracts/deepbook/deps/sui/object.ts +3 -2
  155. package/src/contracts/deepbook/deps/sui/table.ts +4 -4
  156. package/src/contracts/deepbook/deps/sui/vec_map.ts +4 -4
  157. package/src/contracts/deepbook/deps/sui/vec_set.ts +4 -4
  158. package/src/contracts/deepbook/deps/sui/versioned.ts +4 -4
  159. package/src/contracts/deepbook/ewma.ts +14 -3
  160. package/src/contracts/deepbook/fill.ts +21 -21
  161. package/src/contracts/deepbook/governance.ts +3 -2
  162. package/src/contracts/deepbook/history.ts +3 -2
  163. package/src/contracts/deepbook/math.ts +15 -15
  164. package/src/contracts/deepbook/order.ts +16 -16
  165. package/src/contracts/deepbook/order_info.ts +39 -27
  166. package/src/contracts/deepbook/order_query.ts +12 -12
  167. package/src/contracts/deepbook/pool.ts +876 -519
  168. package/src/contracts/deepbook/registry.ts +146 -35
  169. package/src/contracts/deepbook/state.ts +13 -2
  170. package/src/contracts/deepbook/trade_params.ts +3 -2
  171. package/src/contracts/deepbook/vault.ts +3 -2
  172. package/src/contracts/pyth/batch_price_attestation.ts +92 -0
  173. package/src/contracts/pyth/contract_upgrade.ts +54 -0
  174. package/src/contracts/pyth/data_source.ts +64 -0
  175. package/src/contracts/pyth/deps/0x0000000000000000000000000000000000000000000000000000000000000002/object.ts +12 -0
  176. package/src/contracts/pyth/deps/0x0000000000000000000000000000000000000000000000000000000000000002/package.ts +15 -0
  177. package/src/contracts/pyth/deps/0x0000000000000000000000000000000000000000000000000000000000000002/table.ts +13 -0
  178. package/src/contracts/pyth/deps/0xf47329f4344f3bf0f8e436e2f7b485466cff300f12a166563995d3888c296a94/bytes32.ts +12 -0
  179. package/src/contracts/pyth/deps/0xf47329f4344f3bf0f8e436e2f7b485466cff300f12a166563995d3888c296a94/consumed_vaas.ts +13 -0
  180. package/src/contracts/pyth/deps/0xf47329f4344f3bf0f8e436e2f7b485466cff300f12a166563995d3888c296a94/external_address.ts +13 -0
  181. package/src/contracts/pyth/deps/0xf47329f4344f3bf0f8e436e2f7b485466cff300f12a166563995d3888c296a94/set.ts +12 -0
  182. package/src/contracts/pyth/deserialize.ts +117 -0
  183. package/src/contracts/pyth/event.ts +20 -0
  184. package/src/contracts/pyth/governance.ts +113 -0
  185. package/src/contracts/pyth/governance_action.ts +130 -0
  186. package/src/contracts/pyth/governance_instruction.ts +98 -0
  187. package/src/contracts/pyth/hot_potato_vector.ts +70 -0
  188. package/src/contracts/pyth/i64.ts +94 -0
  189. package/src/contracts/pyth/merkle_tree.ts +41 -0
  190. package/src/contracts/pyth/migrate.ts +29 -0
  191. package/src/contracts/pyth/price.ts +102 -0
  192. package/src/contracts/pyth/price_feed.ts +101 -0
  193. package/src/contracts/pyth/price_identifier.ts +46 -0
  194. package/src/contracts/pyth/price_info.ts +220 -0
  195. package/src/contracts/pyth/price_status.ts +74 -0
  196. package/src/contracts/pyth/pyth.ts +236 -0
  197. package/src/contracts/pyth/set.ts +93 -0
  198. package/src/contracts/pyth/set_data_sources.ts +14 -0
  199. package/src/contracts/pyth/set_fee_recipient.ts +13 -0
  200. package/src/contracts/pyth/set_governance_data_source.ts +16 -0
  201. package/src/contracts/pyth/set_stale_price_threshold.ts +13 -0
  202. package/src/contracts/pyth/set_update_fee.ts +14 -0
  203. package/src/contracts/pyth/setup.ts +12 -0
  204. package/src/contracts/pyth/state.ts +227 -0
  205. package/src/contracts/pyth/version_control.ts +25 -0
  206. package/src/contracts/utils/index.ts +99 -49
  207. package/src/index.ts +2 -2
  208. package/src/pyth/pyth.ts +39 -40
  209. package/src/transactions/deepbook.ts +19 -0
  210. package/src/transactions/marginAdmin.ts +1 -1
  211. package/src/transactions/poolProxy.ts +22 -0
  212. package/src/types/index.ts +0 -2
  213. package/src/utils/config.ts +11 -13
  214. package/src/utils/validation.ts +1 -1
  215. package/dist/cjs/client.d.ts +0 -882
  216. package/dist/cjs/client.js +0 -2003
  217. package/dist/cjs/client.js.map +0 -7
  218. package/dist/cjs/contracts/deepbook/account.d.ts +0 -105
  219. package/dist/cjs/contracts/deepbook/account.js +0 -163
  220. package/dist/cjs/contracts/deepbook/account.js.map +0 -7
  221. package/dist/cjs/contracts/deepbook/balance_manager.d.ts +0 -268
  222. package/dist/cjs/contracts/deepbook/balance_manager.js +0 -361
  223. package/dist/cjs/contracts/deepbook/balance_manager.js.map +0 -7
  224. package/dist/cjs/contracts/deepbook/balances.d.ts +0 -10
  225. package/dist/cjs/contracts/deepbook/balances.js +0 -35
  226. package/dist/cjs/contracts/deepbook/balances.js.map +0 -7
  227. package/dist/cjs/contracts/deepbook/big_vector.d.ts +0 -62
  228. package/dist/cjs/contracts/deepbook/big_vector.js +0 -80
  229. package/dist/cjs/contracts/deepbook/big_vector.js.map +0 -7
  230. package/dist/cjs/contracts/deepbook/book.d.ts +0 -34
  231. package/dist/cjs/contracts/deepbook/book.js +0 -50
  232. package/dist/cjs/contracts/deepbook/book.js.map +0 -7
  233. package/dist/cjs/contracts/deepbook/constants.d.ts +0 -176
  234. package/dist/cjs/contracts/deepbook/constants.js +0 -338
  235. package/dist/cjs/contracts/deepbook/constants.js.map +0 -7
  236. package/dist/cjs/contracts/deepbook/deep_price.d.ts +0 -60
  237. package/dist/cjs/contracts/deepbook/deep_price.js +0 -87
  238. package/dist/cjs/contracts/deepbook/deep_price.js.map +0 -7
  239. package/dist/cjs/contracts/deepbook/deps/std/type_name.d.ts +0 -14
  240. package/dist/cjs/contracts/deepbook/deps/std/type_name.js +0 -42
  241. package/dist/cjs/contracts/deepbook/deps/std/type_name.js.map +0 -7
  242. package/dist/cjs/contracts/deepbook/deps/sui/bag.d.ts +0 -33
  243. package/dist/cjs/contracts/deepbook/deps/sui/bag.js +0 -47
  244. package/dist/cjs/contracts/deepbook/deps/sui/bag.js.map +0 -7
  245. package/dist/cjs/contracts/deepbook/deps/sui/balance.d.ts +0 -9
  246. package/dist/cjs/contracts/deepbook/deps/sui/balance.js +0 -33
  247. package/dist/cjs/contracts/deepbook/deps/sui/balance.js.map +0 -7
  248. package/dist/cjs/contracts/deepbook/deps/sui/object.d.ts +0 -5
  249. package/dist/cjs/contracts/deepbook/deps/sui/object.js +0 -33
  250. package/dist/cjs/contracts/deepbook/deps/sui/object.js.map +0 -7
  251. package/dist/cjs/contracts/deepbook/deps/sui/table.d.ts +0 -28
  252. package/dist/cjs/contracts/deepbook/deps/sui/table.js +0 -47
  253. package/dist/cjs/contracts/deepbook/deps/sui/table.js.map +0 -7
  254. package/dist/cjs/contracts/deepbook/deps/sui/vec_map.d.ts +0 -27
  255. package/dist/cjs/contracts/deepbook/deps/sui/vec_map.js +0 -45
  256. package/dist/cjs/contracts/deepbook/deps/sui/vec_map.js.map +0 -7
  257. package/dist/cjs/contracts/deepbook/deps/sui/vec_set.d.ts +0 -15
  258. package/dist/cjs/contracts/deepbook/deps/sui/vec_set.js +0 -35
  259. package/dist/cjs/contracts/deepbook/deps/sui/vec_set.js.map +0 -7
  260. package/dist/cjs/contracts/deepbook/deps/sui/versioned.d.ts +0 -7
  261. package/dist/cjs/contracts/deepbook/deps/sui/versioned.js +0 -45
  262. package/dist/cjs/contracts/deepbook/deps/sui/versioned.js.map +0 -7
  263. package/dist/cjs/contracts/deepbook/ewma.d.ts +0 -17
  264. package/dist/cjs/contracts/deepbook/ewma.js +0 -39
  265. package/dist/cjs/contracts/deepbook/ewma.js.map +0 -7
  266. package/dist/cjs/contracts/deepbook/fill.d.ts +0 -153
  267. package/dist/cjs/contracts/deepbook/fill.js +0 -251
  268. package/dist/cjs/contracts/deepbook/fill.js.map +0 -7
  269. package/dist/cjs/contracts/deepbook/governance.d.ts +0 -63
  270. package/dist/cjs/contracts/deepbook/governance.js +0 -79
  271. package/dist/cjs/contracts/deepbook/governance.js.map +0 -7
  272. package/dist/cjs/contracts/deepbook/history.d.ts +0 -60
  273. package/dist/cjs/contracts/deepbook/history.js +0 -78
  274. package/dist/cjs/contracts/deepbook/history.js.map +0 -7
  275. package/dist/cjs/contracts/deepbook/math.d.ts +0 -94
  276. package/dist/cjs/contracts/deepbook/math.js +0 -132
  277. package/dist/cjs/contracts/deepbook/math.js.map +0 -7
  278. package/dist/cjs/contracts/deepbook/order.d.ts +0 -135
  279. package/dist/cjs/contracts/deepbook/order.js +0 -218
  280. package/dist/cjs/contracts/deepbook/order.js.map +0 -7
  281. package/dist/cjs/contracts/deepbook/order_info.d.ts +0 -296
  282. package/dist/cjs/contracts/deepbook/order_info.js +0 -386
  283. package/dist/cjs/contracts/deepbook/order_info.js.map +0 -7
  284. package/dist/cjs/contracts/deepbook/order_query.d.ts +0 -85
  285. package/dist/cjs/contracts/deepbook/order_query.js +0 -96
  286. package/dist/cjs/contracts/deepbook/order_query.js.map +0 -7
  287. package/dist/cjs/contracts/deepbook/pool.d.ts +0 -1218
  288. package/dist/cjs/contracts/deepbook/pool.js +0 -1236
  289. package/dist/cjs/contracts/deepbook/pool.js.map +0 -7
  290. package/dist/cjs/contracts/deepbook/registry.d.ts +0 -134
  291. package/dist/cjs/contracts/deepbook/registry.js +0 -182
  292. package/dist/cjs/contracts/deepbook/registry.js.map +0 -7
  293. package/dist/cjs/contracts/deepbook/state.d.ts +0 -117
  294. package/dist/cjs/contracts/deepbook/state.js +0 -104
  295. package/dist/cjs/contracts/deepbook/state.js.map +0 -7
  296. package/dist/cjs/contracts/deepbook/trade_params.d.ts +0 -7
  297. package/dist/cjs/contracts/deepbook/trade_params.js +0 -35
  298. package/dist/cjs/contracts/deepbook/trade_params.js.map +0 -7
  299. package/dist/cjs/contracts/deepbook/vault.d.ts +0 -30
  300. package/dist/cjs/contracts/deepbook/vault.js +0 -65
  301. package/dist/cjs/contracts/deepbook/vault.js.map +0 -7
  302. package/dist/cjs/contracts/utils/index.d.ts +0 -25
  303. package/dist/cjs/contracts/utils/index.js +0 -148
  304. package/dist/cjs/contracts/utils/index.js.map +0 -7
  305. package/dist/cjs/index.d.ts +0 -24
  306. package/dist/cjs/index.js +0 -92
  307. package/dist/cjs/index.js.map +0 -7
  308. package/dist/cjs/package.json +0 -4
  309. package/dist/cjs/pyth/PriceServiceConnection.d.ts +0 -26
  310. package/dist/cjs/pyth/PriceServiceConnection.js +0 -68
  311. package/dist/cjs/pyth/PriceServiceConnection.js.map +0 -7
  312. package/dist/cjs/pyth/pyth-helpers.d.ts +0 -7
  313. package/dist/cjs/pyth/pyth-helpers.js +0 -36
  314. package/dist/cjs/pyth/pyth-helpers.js.map +0 -7
  315. package/dist/cjs/pyth/pyth.d.ts +0 -65
  316. package/dist/cjs/pyth/pyth.js +0 -269
  317. package/dist/cjs/pyth/pyth.js.map +0 -7
  318. package/dist/cjs/transactions/balanceManager.d.ts +0 -168
  319. package/dist/cjs/transactions/balanceManager.js +0 -384
  320. package/dist/cjs/transactions/balanceManager.js.map +0 -7
  321. package/dist/cjs/transactions/deepbook.d.ts +0 -477
  322. package/dist/cjs/transactions/deepbook.js +0 -1335
  323. package/dist/cjs/transactions/deepbook.js.map +0 -7
  324. package/dist/cjs/transactions/deepbookAdmin.d.ts +0 -105
  325. package/dist/cjs/transactions/deepbookAdmin.js +0 -334
  326. package/dist/cjs/transactions/deepbookAdmin.js.map +0 -7
  327. package/dist/cjs/transactions/flashLoans.d.ts +0 -56
  328. package/dist/cjs/transactions/flashLoans.js +0 -124
  329. package/dist/cjs/transactions/flashLoans.js.map +0 -7
  330. package/dist/cjs/transactions/governance.d.ts +0 -42
  331. package/dist/cjs/transactions/governance.js +0 -135
  332. package/dist/cjs/transactions/governance.js.map +0 -7
  333. package/dist/cjs/transactions/marginAdmin.d.ts +0 -133
  334. package/dist/cjs/transactions/marginAdmin.js +0 -396
  335. package/dist/cjs/transactions/marginAdmin.js.map +0 -7
  336. package/dist/cjs/transactions/marginLiquidations.d.ts +0 -61
  337. package/dist/cjs/transactions/marginLiquidations.js +0 -173
  338. package/dist/cjs/transactions/marginLiquidations.js.map +0 -7
  339. package/dist/cjs/transactions/marginMaintainer.d.ts +0 -80
  340. package/dist/cjs/transactions/marginMaintainer.js +0 -257
  341. package/dist/cjs/transactions/marginMaintainer.js.map +0 -7
  342. package/dist/cjs/transactions/marginManager.d.ts +0 -249
  343. package/dist/cjs/transactions/marginManager.js +0 -739
  344. package/dist/cjs/transactions/marginManager.js.map +0 -7
  345. package/dist/cjs/transactions/marginPool.d.ts +0 -134
  346. package/dist/cjs/transactions/marginPool.js +0 -330
  347. package/dist/cjs/transactions/marginPool.js.map +0 -7
  348. package/dist/cjs/transactions/marginRegistry.d.ts +0 -94
  349. package/dist/cjs/transactions/marginRegistry.js +0 -221
  350. package/dist/cjs/transactions/marginRegistry.js.map +0 -7
  351. package/dist/cjs/transactions/marginTPSL.d.ts +0 -93
  352. package/dist/cjs/transactions/marginTPSL.js +0 -286
  353. package/dist/cjs/transactions/marginTPSL.js.map +0 -7
  354. package/dist/cjs/transactions/poolProxy.d.ts +0 -104
  355. package/dist/cjs/transactions/poolProxy.js +0 -435
  356. package/dist/cjs/transactions/poolProxy.js.map +0 -7
  357. package/dist/cjs/types/bcs.d.ts +0 -5
  358. package/dist/cjs/types/bcs.js +0 -33
  359. package/dist/cjs/types/bcs.js.map +0 -7
  360. package/dist/cjs/types/index.d.ts +0 -247
  361. package/dist/cjs/types/index.js +0 -38
  362. package/dist/cjs/types/index.js.map +0 -7
  363. package/dist/cjs/utils/config.d.ts +0 -65
  364. package/dist/cjs/utils/config.js +0 -144
  365. package/dist/cjs/utils/config.js.map +0 -7
  366. package/dist/cjs/utils/constants.d.ts +0 -76
  367. package/dist/cjs/utils/constants.js +0 -392
  368. package/dist/cjs/utils/constants.js.map +0 -7
  369. package/dist/cjs/utils/errors.d.ts +0 -42
  370. package/dist/cjs/utils/errors.js +0 -70
  371. package/dist/cjs/utils/errors.js.map +0 -7
  372. package/dist/cjs/utils/validation.js +0 -67
  373. package/dist/cjs/utils/validation.js.map +0 -7
  374. package/dist/esm/client.d.ts +0 -882
  375. package/dist/esm/client.js +0 -1988
  376. package/dist/esm/client.js.map +0 -7
  377. package/dist/esm/contracts/deepbook/account.d.ts +0 -105
  378. package/dist/esm/contracts/deepbook/account.js +0 -133
  379. package/dist/esm/contracts/deepbook/account.js.map +0 -7
  380. package/dist/esm/contracts/deepbook/balance_manager.d.ts +0 -268
  381. package/dist/esm/contracts/deepbook/balance_manager.js +0 -331
  382. package/dist/esm/contracts/deepbook/balance_manager.js.map +0 -7
  383. package/dist/esm/contracts/deepbook/balances.d.ts +0 -10
  384. package/dist/esm/contracts/deepbook/balances.js +0 -15
  385. package/dist/esm/contracts/deepbook/balances.js.map +0 -7
  386. package/dist/esm/contracts/deepbook/big_vector.d.ts +0 -62
  387. package/dist/esm/contracts/deepbook/big_vector.js +0 -50
  388. package/dist/esm/contracts/deepbook/big_vector.js.map +0 -7
  389. package/dist/esm/contracts/deepbook/book.d.ts +0 -34
  390. package/dist/esm/contracts/deepbook/book.js +0 -20
  391. package/dist/esm/contracts/deepbook/book.js.map +0 -7
  392. package/dist/esm/contracts/deepbook/constants.d.ts +0 -176
  393. package/dist/esm/contracts/deepbook/constants.js +0 -318
  394. package/dist/esm/contracts/deepbook/constants.js.map +0 -7
  395. package/dist/esm/contracts/deepbook/deep_price.d.ts +0 -60
  396. package/dist/esm/contracts/deepbook/deep_price.js +0 -67
  397. package/dist/esm/contracts/deepbook/deep_price.js.map +0 -7
  398. package/dist/esm/contracts/deepbook/deps/std/type_name.d.ts +0 -14
  399. package/dist/esm/contracts/deepbook/deps/std/type_name.js +0 -22
  400. package/dist/esm/contracts/deepbook/deps/std/type_name.js.map +0 -7
  401. package/dist/esm/contracts/deepbook/deps/sui/bag.d.ts +0 -33
  402. package/dist/esm/contracts/deepbook/deps/sui/bag.js +0 -17
  403. package/dist/esm/contracts/deepbook/deps/sui/bag.js.map +0 -7
  404. package/dist/esm/contracts/deepbook/deps/sui/balance.d.ts +0 -9
  405. package/dist/esm/contracts/deepbook/deps/sui/balance.js +0 -13
  406. package/dist/esm/contracts/deepbook/deps/sui/balance.js.map +0 -7
  407. package/dist/esm/contracts/deepbook/deps/sui/object.d.ts +0 -5
  408. package/dist/esm/contracts/deepbook/deps/sui/object.js +0 -13
  409. package/dist/esm/contracts/deepbook/deps/sui/object.js.map +0 -7
  410. package/dist/esm/contracts/deepbook/deps/sui/table.d.ts +0 -28
  411. package/dist/esm/contracts/deepbook/deps/sui/table.js +0 -17
  412. package/dist/esm/contracts/deepbook/deps/sui/table.js.map +0 -7
  413. package/dist/esm/contracts/deepbook/deps/sui/vec_map.d.ts +0 -27
  414. package/dist/esm/contracts/deepbook/deps/sui/vec_map.js +0 -25
  415. package/dist/esm/contracts/deepbook/deps/sui/vec_map.js.map +0 -7
  416. package/dist/esm/contracts/deepbook/deps/sui/vec_set.d.ts +0 -15
  417. package/dist/esm/contracts/deepbook/deps/sui/vec_set.js +0 -15
  418. package/dist/esm/contracts/deepbook/deps/sui/vec_set.js.map +0 -7
  419. package/dist/esm/contracts/deepbook/deps/sui/versioned.d.ts +0 -7
  420. package/dist/esm/contracts/deepbook/deps/sui/versioned.js +0 -15
  421. package/dist/esm/contracts/deepbook/deps/sui/versioned.js.map +0 -7
  422. package/dist/esm/contracts/deepbook/ewma.d.ts +0 -17
  423. package/dist/esm/contracts/deepbook/ewma.js +0 -19
  424. package/dist/esm/contracts/deepbook/ewma.js.map +0 -7
  425. package/dist/esm/contracts/deepbook/fill.d.ts +0 -153
  426. package/dist/esm/contracts/deepbook/fill.js +0 -221
  427. package/dist/esm/contracts/deepbook/fill.js.map +0 -7
  428. package/dist/esm/contracts/deepbook/governance.d.ts +0 -63
  429. package/dist/esm/contracts/deepbook/governance.js +0 -49
  430. package/dist/esm/contracts/deepbook/governance.js.map +0 -7
  431. package/dist/esm/contracts/deepbook/history.d.ts +0 -60
  432. package/dist/esm/contracts/deepbook/history.js +0 -48
  433. package/dist/esm/contracts/deepbook/history.js.map +0 -7
  434. package/dist/esm/contracts/deepbook/math.d.ts +0 -94
  435. package/dist/esm/contracts/deepbook/math.js +0 -112
  436. package/dist/esm/contracts/deepbook/math.js.map +0 -7
  437. package/dist/esm/contracts/deepbook/order.d.ts +0 -135
  438. package/dist/esm/contracts/deepbook/order.js +0 -188
  439. package/dist/esm/contracts/deepbook/order.js.map +0 -7
  440. package/dist/esm/contracts/deepbook/order_info.d.ts +0 -296
  441. package/dist/esm/contracts/deepbook/order_info.js +0 -356
  442. package/dist/esm/contracts/deepbook/order_info.js.map +0 -7
  443. package/dist/esm/contracts/deepbook/order_query.d.ts +0 -85
  444. package/dist/esm/contracts/deepbook/order_query.js +0 -66
  445. package/dist/esm/contracts/deepbook/order_query.js.map +0 -7
  446. package/dist/esm/contracts/deepbook/pool.d.ts +0 -1218
  447. package/dist/esm/contracts/deepbook/pool.js +0 -1206
  448. package/dist/esm/contracts/deepbook/pool.js.map +0 -7
  449. package/dist/esm/contracts/deepbook/registry.d.ts +0 -134
  450. package/dist/esm/contracts/deepbook/registry.js +0 -152
  451. package/dist/esm/contracts/deepbook/registry.js.map +0 -7
  452. package/dist/esm/contracts/deepbook/state.d.ts +0 -117
  453. package/dist/esm/contracts/deepbook/state.js +0 -74
  454. package/dist/esm/contracts/deepbook/state.js.map +0 -7
  455. package/dist/esm/contracts/deepbook/trade_params.d.ts +0 -7
  456. package/dist/esm/contracts/deepbook/trade_params.js +0 -15
  457. package/dist/esm/contracts/deepbook/trade_params.js.map +0 -7
  458. package/dist/esm/contracts/deepbook/vault.d.ts +0 -30
  459. package/dist/esm/contracts/deepbook/vault.js +0 -35
  460. package/dist/esm/contracts/deepbook/vault.js.map +0 -7
  461. package/dist/esm/contracts/utils/index.d.ts +0 -25
  462. package/dist/esm/contracts/utils/index.js +0 -128
  463. package/dist/esm/contracts/utils/index.js.map +0 -7
  464. package/dist/esm/index.d.ts +0 -24
  465. package/dist/esm/index.js +0 -103
  466. package/dist/esm/index.js.map +0 -7
  467. package/dist/esm/package.json +0 -4
  468. package/dist/esm/pyth/PriceServiceConnection.d.ts +0 -26
  469. package/dist/esm/pyth/PriceServiceConnection.js +0 -38
  470. package/dist/esm/pyth/PriceServiceConnection.js.map +0 -7
  471. package/dist/esm/pyth/pyth-helpers.d.ts +0 -7
  472. package/dist/esm/pyth/pyth-helpers.js +0 -16
  473. package/dist/esm/pyth/pyth-helpers.js.map +0 -7
  474. package/dist/esm/pyth/pyth.d.ts +0 -65
  475. package/dist/esm/pyth/pyth.js +0 -249
  476. package/dist/esm/pyth/pyth.js.map +0 -7
  477. package/dist/esm/transactions/balanceManager.d.ts +0 -168
  478. package/dist/esm/transactions/balanceManager.js +0 -364
  479. package/dist/esm/transactions/balanceManager.js.map +0 -7
  480. package/dist/esm/transactions/deepbook.d.ts +0 -477
  481. package/dist/esm/transactions/deepbook.js +0 -1321
  482. package/dist/esm/transactions/deepbook.js.map +0 -7
  483. package/dist/esm/transactions/deepbookAdmin.d.ts +0 -105
  484. package/dist/esm/transactions/deepbookAdmin.js +0 -314
  485. package/dist/esm/transactions/deepbookAdmin.js.map +0 -7
  486. package/dist/esm/transactions/flashLoans.d.ts +0 -56
  487. package/dist/esm/transactions/flashLoans.js +0 -104
  488. package/dist/esm/transactions/flashLoans.js.map +0 -7
  489. package/dist/esm/transactions/governance.d.ts +0 -42
  490. package/dist/esm/transactions/governance.js +0 -115
  491. package/dist/esm/transactions/governance.js.map +0 -7
  492. package/dist/esm/transactions/marginAdmin.d.ts +0 -133
  493. package/dist/esm/transactions/marginAdmin.js +0 -376
  494. package/dist/esm/transactions/marginAdmin.js.map +0 -7
  495. package/dist/esm/transactions/marginLiquidations.d.ts +0 -61
  496. package/dist/esm/transactions/marginLiquidations.js +0 -153
  497. package/dist/esm/transactions/marginLiquidations.js.map +0 -7
  498. package/dist/esm/transactions/marginMaintainer.d.ts +0 -80
  499. package/dist/esm/transactions/marginMaintainer.js +0 -237
  500. package/dist/esm/transactions/marginMaintainer.js.map +0 -7
  501. package/dist/esm/transactions/marginManager.d.ts +0 -249
  502. package/dist/esm/transactions/marginManager.js +0 -719
  503. package/dist/esm/transactions/marginManager.js.map +0 -7
  504. package/dist/esm/transactions/marginPool.d.ts +0 -134
  505. package/dist/esm/transactions/marginPool.js +0 -310
  506. package/dist/esm/transactions/marginPool.js.map +0 -7
  507. package/dist/esm/transactions/marginRegistry.d.ts +0 -94
  508. package/dist/esm/transactions/marginRegistry.js +0 -201
  509. package/dist/esm/transactions/marginRegistry.js.map +0 -7
  510. package/dist/esm/transactions/marginTPSL.d.ts +0 -93
  511. package/dist/esm/transactions/marginTPSL.js +0 -266
  512. package/dist/esm/transactions/marginTPSL.js.map +0 -7
  513. package/dist/esm/transactions/poolProxy.d.ts +0 -104
  514. package/dist/esm/transactions/poolProxy.js +0 -415
  515. package/dist/esm/transactions/poolProxy.js.map +0 -7
  516. package/dist/esm/types/bcs.d.ts +0 -5
  517. package/dist/esm/types/bcs.js +0 -13
  518. package/dist/esm/types/bcs.js.map +0 -7
  519. package/dist/esm/types/index.d.ts +0 -247
  520. package/dist/esm/types/index.js +0 -18
  521. package/dist/esm/types/index.js.map +0 -7
  522. package/dist/esm/utils/config.d.ts +0 -65
  523. package/dist/esm/utils/config.js +0 -135
  524. package/dist/esm/utils/config.js.map +0 -7
  525. package/dist/esm/utils/constants.d.ts +0 -76
  526. package/dist/esm/utils/constants.js +0 -372
  527. package/dist/esm/utils/constants.js.map +0 -7
  528. package/dist/esm/utils/errors.d.ts +0 -42
  529. package/dist/esm/utils/errors.js +0 -50
  530. package/dist/esm/utils/errors.js.map +0 -7
  531. package/dist/esm/utils/validation.d.ts +0 -50
  532. package/dist/esm/utils/validation.js +0 -47
  533. package/dist/esm/utils/validation.js.map +0 -7
  534. package/dist/tsconfig.esm.tsbuildinfo +0 -1
  535. package/dist/tsconfig.tsbuildinfo +0 -1
@@ -0,0 +1,897 @@
1
+ import { BalanceManager, CanPlaceLimitOrderParams, CanPlaceMarketOrderParams, MarginManager } from "./types/index.mjs";
2
+ import { CoinMap, PoolMap } from "./utils/constants.mjs";
3
+ import { BalanceManagerContract } from "./transactions/balanceManager.mjs";
4
+ import { DeepBookContract } from "./transactions/deepbook.mjs";
5
+ import { DeepBookAdminContract } from "./transactions/deepbookAdmin.mjs";
6
+ import { FlashLoanContract } from "./transactions/flashLoans.mjs";
7
+ import { GovernanceContract } from "./transactions/governance.mjs";
8
+ import { MarginAdminContract } from "./transactions/marginAdmin.mjs";
9
+ import { MarginMaintainerContract } from "./transactions/marginMaintainer.mjs";
10
+ import { MarginPoolContract } from "./transactions/marginPool.mjs";
11
+ import { MarginManagerContract } from "./transactions/marginManager.mjs";
12
+ import { MarginRegistryContract } from "./transactions/marginRegistry.mjs";
13
+ import { MarginLiquidationsContract } from "./transactions/marginLiquidations.mjs";
14
+ import { PoolProxyContract } from "./transactions/poolProxy.mjs";
15
+ import { MarginTPSLContract } from "./transactions/marginTPSL.mjs";
16
+ import { Transaction } from "@mysten/sui/transactions";
17
+ import { ClientWithCoreApi, SuiClientRegistration, SuiClientTypes } from "@mysten/sui/client";
18
+
19
+ //#region src/client.d.ts
20
+ interface DeepBookCompatibleClient extends ClientWithCoreApi {}
21
+ interface DeepBookOptions<Name = 'deepbook'> {
22
+ address: string;
23
+ balanceManagers?: {
24
+ [key: string]: BalanceManager;
25
+ };
26
+ marginManagers?: {
27
+ [key: string]: MarginManager;
28
+ };
29
+ coins?: CoinMap;
30
+ pools?: PoolMap;
31
+ adminCap?: string;
32
+ marginAdminCap?: string;
33
+ marginMaintainerCap?: string;
34
+ name?: Name;
35
+ }
36
+ interface DeepBookClientOptions extends DeepBookOptions {
37
+ client: DeepBookCompatibleClient;
38
+ network: SuiClientTypes.Network;
39
+ }
40
+ declare function deepbook<Name extends string = 'deepbook'>({
41
+ name,
42
+ ...options
43
+ }: DeepBookOptions<Name>): SuiClientRegistration<DeepBookCompatibleClient, Name, DeepBookClient>;
44
+ /**
45
+ * DeepBookClient class for managing DeepBook operations.
46
+ */
47
+ declare class DeepBookClient {
48
+ #private;
49
+ balanceManager: BalanceManagerContract;
50
+ deepBook: DeepBookContract;
51
+ deepBookAdmin: DeepBookAdminContract;
52
+ flashLoans: FlashLoanContract;
53
+ governance: GovernanceContract;
54
+ marginAdmin: MarginAdminContract;
55
+ marginMaintainer: MarginMaintainerContract;
56
+ marginPool: MarginPoolContract;
57
+ marginManager: MarginManagerContract;
58
+ marginRegistry: MarginRegistryContract;
59
+ marginLiquidations: MarginLiquidationsContract;
60
+ poolProxy: PoolProxyContract;
61
+ marginTPSL: MarginTPSLContract;
62
+ /**
63
+ * Creates a new DeepBookClient instance
64
+ */
65
+ constructor({
66
+ client,
67
+ address,
68
+ network,
69
+ balanceManagers,
70
+ marginManagers,
71
+ coins,
72
+ pools,
73
+ adminCap,
74
+ marginAdminCap,
75
+ marginMaintainerCap
76
+ }: DeepBookClientOptions);
77
+ /**
78
+ * @description Check the balance of a balance manager for a specific coin
79
+ * @param {string} managerKey Key of the balance manager
80
+ * @param {string} coinKey Key of the coin
81
+ * @returns {Promise<{ coinType: string, balance: number }>} An object with coin type and balance
82
+ */
83
+ checkManagerBalance(managerKey: string, coinKey: string): Promise<{
84
+ coinType: string;
85
+ balance: number;
86
+ }>;
87
+ /**
88
+ * @description Check if a pool is whitelisted
89
+ * @param {string} poolKey Key of the pool
90
+ * @returns {Promise<boolean>} Boolean indicating if the pool is whitelisted
91
+ */
92
+ whitelisted(poolKey: string): Promise<boolean>;
93
+ /**
94
+ * @description Get the quote quantity out for a given base quantity
95
+ * @param {string} poolKey Key of the pool
96
+ * @param {number} baseQuantity Base quantity to convert
97
+ * @returns {Promise<{ baseQuantity: number, baseOut: number, quoteOut: number, deepRequired: number }>}
98
+ * An object with base quantity, base out, quote out, and deep required for the dry run
99
+ */
100
+ getQuoteQuantityOut(poolKey: string, baseQuantity: number): Promise<{
101
+ baseQuantity: number;
102
+ baseOut: number;
103
+ quoteOut: number;
104
+ deepRequired: number;
105
+ }>;
106
+ /**
107
+ * @description Get the base quantity out for a given quote quantity
108
+ * @param {string} poolKey Key of the pool
109
+ * @param {number} quoteQuantity Quote quantity to convert
110
+ * @returns {Promise<{ quoteQuantity: number, baseOut: number, quoteOut: number, deepRequired: number }>}
111
+ * An object with quote quantity, base out, quote out, and deep required for the dry run
112
+ */
113
+ getBaseQuantityOut(poolKey: string, quoteQuantity: number): Promise<{
114
+ quoteQuantity: number;
115
+ baseOut: number;
116
+ quoteOut: number;
117
+ deepRequired: number;
118
+ }>;
119
+ /**
120
+ * @description Get the output quantities for given base and quote quantities. Only one quantity can be non-zero
121
+ * @param {string} poolKey Key of the pool
122
+ * @param {number} baseQuantity Base quantity to convert
123
+ * @param {number} quoteQuantity Quote quantity to convert
124
+ * @returns {Promise<{ baseQuantity: number, quoteQuantity: number, baseOut: number, quoteOut: number, deepRequired: number }>}
125
+ * An object with base quantity, quote quantity, base out, quote out, and deep required for the dry run
126
+ */
127
+ getQuantityOut(poolKey: string, baseQuantity: number, quoteQuantity: number): Promise<{
128
+ baseQuantity: number;
129
+ quoteQuantity: number;
130
+ baseOut: number;
131
+ quoteOut: number;
132
+ deepRequired: number;
133
+ }>;
134
+ /**
135
+ * @description Get open orders for a balance manager in a pool
136
+ * @param {string} poolKey Key of the pool
137
+ * @param {string} managerKey Key of the balance manager
138
+ * @returns {Promise<Array>} An array of open order IDs
139
+ */
140
+ accountOpenOrders(poolKey: string, managerKey: string): Promise<string[]>;
141
+ /**
142
+ * @description Get the order information for a specific order in a pool
143
+ * @param {string} poolKey Key of the pool
144
+ * @param {string} orderId Order ID
145
+ * @returns {Promise<Object>} A promise that resolves to an object containing the order information
146
+ */
147
+ getOrder(poolKey: string, orderId: string): Promise<{
148
+ balance_manager_id: string;
149
+ order_id: string;
150
+ client_order_id: string;
151
+ quantity: string;
152
+ filled_quantity: string;
153
+ fee_is_deep: boolean;
154
+ order_deep_price: {
155
+ asset_is_base: boolean;
156
+ deep_per_asset: string;
157
+ };
158
+ epoch: string;
159
+ status: number;
160
+ expire_timestamp: string;
161
+ } | null>;
162
+ /**
163
+ * @description Get the order information for a specific order in a pool, with normalized price
164
+ * @param {string} poolKey Key of the pool
165
+ * @param {string} orderId Order ID
166
+ * @returns {Promise<Object>} A promise that resolves to an object containing the order information with normalized price
167
+ */
168
+ getOrderNormalized(poolKey: string, orderId: string): Promise<{
169
+ quantity: string;
170
+ filled_quantity: string;
171
+ order_deep_price: {
172
+ deep_per_asset: string;
173
+ asset_is_base: boolean;
174
+ };
175
+ isBid: boolean;
176
+ normalized_price: string;
177
+ balance_manager_id: string;
178
+ order_id: string;
179
+ client_order_id: string;
180
+ fee_is_deep: boolean;
181
+ epoch: string;
182
+ status: number;
183
+ expire_timestamp: string;
184
+ } | null>;
185
+ /**
186
+ * @description Retrieves information for multiple specific orders in a pool.
187
+ * @param {string} poolKey - The key identifying the pool from which to retrieve order information.
188
+ * @param {string[]} orderIds - List of order IDs to retrieve information for.
189
+ * @returns {Promise<Object[] | null>} A promise that resolves to an array of order objects, each containing details such as
190
+ * balance manager ID, order ID, client order ID, quantity, filled quantity, fee information, order price, epoch, status,
191
+ * and expiration timestamp. Returns `null` if the retrieval fails.
192
+ */
193
+ getOrders(poolKey: string, orderIds: string[]): Promise<{
194
+ balance_manager_id: string;
195
+ order_id: string;
196
+ client_order_id: string;
197
+ quantity: string;
198
+ filled_quantity: string;
199
+ fee_is_deep: boolean;
200
+ order_deep_price: {
201
+ asset_is_base: boolean;
202
+ deep_per_asset: string;
203
+ };
204
+ epoch: string;
205
+ status: number;
206
+ expire_timestamp: string;
207
+ }[] | null>;
208
+ /**
209
+ * @description Get level 2 order book specifying range of price
210
+ * @param {string} poolKey Key of the pool
211
+ * @param {number} priceLow Lower bound of the price range
212
+ * @param {number} priceHigh Upper bound of the price range
213
+ * @param {boolean} isBid Whether to get bid or ask orders
214
+ * @returns {Promise<{ prices: Array<number>, quantities: Array<number> }>}
215
+ * An object with arrays of prices and quantities
216
+ */
217
+ getLevel2Range(poolKey: string, priceLow: number, priceHigh: number, isBid: boolean): Promise<{
218
+ prices: number[];
219
+ quantities: number[];
220
+ }>;
221
+ /**
222
+ * @description Get level 2 order book ticks from mid-price for a pool
223
+ * @param {string} poolKey Key of the pool
224
+ * @param {number} ticks Number of ticks from mid-price
225
+ * @returns {Promise<{ bid_prices: Array<number>, bid_quantities: Array<number>, ask_prices: Array<number>, ask_quantities: Array<number> }>}
226
+ * An object with arrays of prices and quantities
227
+ */
228
+ getLevel2TicksFromMid(poolKey: string, ticks: number): Promise<{
229
+ bid_prices: number[];
230
+ bid_quantities: number[];
231
+ ask_prices: number[];
232
+ ask_quantities: number[];
233
+ }>;
234
+ /**
235
+ * @description Get the vault balances for a pool
236
+ * @param {string} poolKey Key of the pool
237
+ * @returns {Promise<{ base: number, quote: number, deep: number }>}
238
+ * An object with base, quote, and deep balances in the vault
239
+ */
240
+ vaultBalances(poolKey: string): Promise<{
241
+ base: number;
242
+ quote: number;
243
+ deep: number;
244
+ }>;
245
+ /**
246
+ * @description Get the pool ID by asset types
247
+ * @param {string} baseType Type of the base asset
248
+ * @param {string} quoteType Type of the quote asset
249
+ * @returns {Promise<string>} The address of the pool
250
+ */
251
+ getPoolIdByAssets(baseType: string, quoteType: string): Promise<string>;
252
+ /**
253
+ * @description Get the mid price for a pool
254
+ * @param {string} poolKey Key of the pool
255
+ * @returns {Promise<number>} The mid price
256
+ */
257
+ midPrice(poolKey: string): Promise<number>;
258
+ /**
259
+ * @description Get the trade parameters for a given pool, including taker fee, maker fee, and stake required.
260
+ * @param {string} poolKey Key of the pool
261
+ * @returns {Promise<{ takerFee: number, makerFee: number, stakeRequired: number }>}
262
+ */
263
+ poolTradeParams(poolKey: string): Promise<{
264
+ takerFee: number;
265
+ makerFee: number;
266
+ stakeRequired: number;
267
+ }>;
268
+ /**
269
+ * @description Get the trade parameters for a given pool, including tick size, lot size, and min size.
270
+ * @param {string} poolKey Key of the pool
271
+ * @returns {Promise<{ tickSize: number, lotSize: number, minSize: number }>}
272
+ */
273
+ poolBookParams(poolKey: string): Promise<{
274
+ tickSize: number;
275
+ lotSize: number;
276
+ minSize: number;
277
+ }>;
278
+ /**
279
+ * @description Get the account information for a given pool and balance manager
280
+ * @param {string} poolKey Key of the pool
281
+ * @param {string} managerKey The key of the BalanceManager
282
+ * @returns {Promise<Object>} A promise that resolves to an object containing the account information
283
+ */
284
+ account(poolKey: string, managerKey: string): Promise<{
285
+ epoch: string;
286
+ open_orders: {
287
+ contents: string[];
288
+ };
289
+ taker_volume: number;
290
+ maker_volume: number;
291
+ active_stake: number;
292
+ inactive_stake: number;
293
+ created_proposal: boolean;
294
+ voted_proposal: string | null;
295
+ unclaimed_rebates: {
296
+ base: number;
297
+ quote: number;
298
+ deep: number;
299
+ };
300
+ settled_balances: {
301
+ base: number;
302
+ quote: number;
303
+ deep: number;
304
+ };
305
+ owed_balances: {
306
+ base: number;
307
+ quote: number;
308
+ deep: number;
309
+ };
310
+ }>;
311
+ /**
312
+ * @description Get the locked balances for a pool and balance manager
313
+ * @param {string} poolKey Key of the pool
314
+ * @param {string} managerKey The key of the BalanceManager
315
+ * @returns {Promise<{ base: number, quote: number, deep: number }>}
316
+ * An object with base, quote, and deep locked for the balance manager in the pool
317
+ */
318
+ lockedBalance(poolKey: string, balanceManagerKey: string): Promise<{
319
+ base: number;
320
+ quote: number;
321
+ deep: number;
322
+ }>;
323
+ /**
324
+ * @description Get the DEEP price conversion for a pool
325
+ * @param {string} poolKey Key of the pool
326
+ * @returns {Promise<{ asset_is_base: bool, deep_per_quote: number }>} Deep price conversion
327
+ */
328
+ getPoolDeepPrice(poolKey: string): Promise<{
329
+ asset_is_base: true;
330
+ deep_per_base: number;
331
+ deep_per_quote?: undefined;
332
+ } | {
333
+ asset_is_base: false;
334
+ deep_per_quote: number;
335
+ deep_per_base?: undefined;
336
+ }>;
337
+ /**
338
+ * @description Decode the order ID to get bid/ask status, price, and orderId
339
+ * @param {bigint} encodedOrderId Encoded order ID
340
+ * @returns {Object} Object containing isBid, price, and orderId
341
+ */
342
+ decodeOrderId(encodedOrderId: bigint): {
343
+ isBid: boolean;
344
+ price: number;
345
+ orderId: number;
346
+ };
347
+ /**
348
+ * @description Get all balance manager IDs for a given owner
349
+ * @param {string} owner The owner address to get balance manager IDs for
350
+ * @returns {Promise<string[]>} Array of balance manager ID strings
351
+ */
352
+ getBalanceManagerIds(owner: string): Promise<string[]>;
353
+ /**
354
+ * @description Get the owner of the referral (DeepBookPoolReferral)
355
+ * @param {string} referral The ID of the referral to get the owner of
356
+ * @returns {Promise<string>} The owner of the referral
357
+ */
358
+ balanceManagerReferralOwner(referral: string): Promise<string>;
359
+ /**
360
+ * @description Get the referral balances for a pool and referral (DeepBookPoolReferral)
361
+ * @param {string} poolKey Key of the pool
362
+ * @param {string} referral The referral ID to get balances for
363
+ * @returns {Promise<{ base: number, quote: number, deep: number }>} Object with base, quote, and deep balances
364
+ */
365
+ getPoolReferralBalances(poolKey: string, referral: string): Promise<{
366
+ base: number;
367
+ quote: number;
368
+ deep: number;
369
+ }>;
370
+ /**
371
+ * @description Get the pool ID associated with a referral (DeepBookPoolReferral)
372
+ * @param {string} referral The referral (DeepBookPoolReferral) to get the pool ID for
373
+ * @returns {Promise<string>} The pool ID
374
+ */
375
+ balanceManagerReferralPoolId(referral: string): Promise<string>;
376
+ /**
377
+ * @description Get the multiplier for a referral (DeepBookPoolReferral)
378
+ * @param {string} poolKey Key of the pool
379
+ * @param {string} referral The referral (DeepBookPoolReferral) to get the multiplier for
380
+ * @returns {Promise<number>} The multiplier value
381
+ */
382
+ poolReferralMultiplier(poolKey: string, referral: string): Promise<number>;
383
+ /**
384
+ * @description Get the referral ID from a balance manager for a specific pool
385
+ * @param {string} managerKey Key of the balance manager
386
+ * @param {string} poolKey Key of the pool to get the referral for
387
+ * @returns {Promise<string | null>} The referral ID or null if not set
388
+ */
389
+ getBalanceManagerReferralId(managerKey: string, poolKey: string): Promise<string | null>;
390
+ getPriceInfoObject(tx: Transaction, coinKey: string): Promise<string>;
391
+ /**
392
+ * @description Get the age of the price info object for a specific coin
393
+ * @param {string} coinKey Key of the coin
394
+ * @returns {Promise<number>} The arrival time of the price info object
395
+ */
396
+ getPriceInfoObjectAge(coinKey: string): Promise<number>;
397
+ /**
398
+ * @description Get the margin pool ID
399
+ * @param {string} coinKey The key to identify the margin pool
400
+ * @returns {Promise<string>} The margin pool ID
401
+ */
402
+ getMarginPoolId(coinKey: string): Promise<string>;
403
+ /**
404
+ * @description Check if a deepbook pool is allowed for borrowing from margin pool
405
+ * @param {string} coinKey The key to identify the margin pool
406
+ * @param {string} deepbookPoolId The ID of the deepbook pool
407
+ * @returns {Promise<boolean>} Whether the deepbook pool is allowed
408
+ */
409
+ isDeepbookPoolAllowed(coinKey: string, deepbookPoolId: string): Promise<boolean>;
410
+ /**
411
+ * @description Get the total supply amount in the margin pool
412
+ * @param {string} coinKey The key to identify the margin pool
413
+ * @param {number} decimals Number of decimal places to show (default: 6)
414
+ * @returns {Promise<string>} The total supply amount as a string
415
+ */
416
+ getMarginPoolTotalSupply(coinKey: string, decimals?: number): Promise<string>;
417
+ /**
418
+ * @description Get the total supply shares in the margin pool
419
+ * @param {string} coinKey The key to identify the margin pool
420
+ * @param {number} decimals Number of decimal places to show (default: 6)
421
+ * @returns {Promise<string>} The total supply shares as a string
422
+ */
423
+ getMarginPoolSupplyShares(coinKey: string, decimals?: number): Promise<string>;
424
+ /**
425
+ * @description Get the total borrow amount in the margin pool
426
+ * @param {string} coinKey The key to identify the margin pool
427
+ * @param {number} decimals Number of decimal places to show (default: 6)
428
+ * @returns {Promise<string>} The total borrow amount as a string
429
+ */
430
+ getMarginPoolTotalBorrow(coinKey: string, decimals?: number): Promise<string>;
431
+ /**
432
+ * @description Get the total borrow shares in the margin pool
433
+ * @param {string} coinKey The key to identify the margin pool
434
+ * @param {number} decimals Number of decimal places to show (default: 6)
435
+ * @returns {Promise<string>} The total borrow shares as a string
436
+ */
437
+ getMarginPoolBorrowShares(coinKey: string, decimals?: number): Promise<string>;
438
+ /**
439
+ * @description Get the last update timestamp of the margin pool
440
+ * @param {string} coinKey The key to identify the margin pool
441
+ * @returns {Promise<number>} The last update timestamp in milliseconds
442
+ */
443
+ getMarginPoolLastUpdateTimestamp(coinKey: string): Promise<number>;
444
+ /**
445
+ * @description Get the supply cap of the margin pool
446
+ * @param {string} coinKey The key to identify the margin pool
447
+ * @param {number} decimals Number of decimal places to show (default: 6)
448
+ * @returns {Promise<string>} The supply cap as a string
449
+ */
450
+ getMarginPoolSupplyCap(coinKey: string, decimals?: number): Promise<string>;
451
+ /**
452
+ * @description Get the max utilization rate of the margin pool
453
+ * @param {string} coinKey The key to identify the margin pool
454
+ * @returns {Promise<number>} The max utilization rate (as a decimal, e.g., 0.95 for 95%)
455
+ */
456
+ getMarginPoolMaxUtilizationRate(coinKey: string): Promise<number>;
457
+ /**
458
+ * @description Get the protocol spread of the margin pool
459
+ * @param {string} coinKey The key to identify the margin pool
460
+ * @returns {Promise<number>} The protocol spread (as a decimal)
461
+ */
462
+ getMarginPoolProtocolSpread(coinKey: string): Promise<number>;
463
+ /**
464
+ * @description Get the minimum borrow amount for the margin pool
465
+ * @param {string} coinKey The key to identify the margin pool
466
+ * @param {number} decimals Number of decimal places to show (default: 6)
467
+ * @returns {Promise<string>} The minimum borrow amount as a string
468
+ */
469
+ getMarginPoolMinBorrow(coinKey: string, decimals?: number): Promise<string>;
470
+ /**
471
+ * @description Get the current interest rate of the margin pool
472
+ * @param {string} coinKey The key to identify the margin pool
473
+ * @returns {Promise<number>} The current interest rate (as a decimal)
474
+ */
475
+ getMarginPoolInterestRate(coinKey: string): Promise<number>;
476
+ /**
477
+ * @description Get user supply shares for a supplier cap
478
+ * @param {string} coinKey The key to identify the margin pool
479
+ * @param {string} supplierCapId The ID of the supplier cap
480
+ * @param {number} decimals Number of decimal places to show (default: 6)
481
+ * @returns {Promise<string>} The user's supply shares as a string
482
+ */
483
+ getUserSupplyShares(coinKey: string, supplierCapId: string, decimals?: number): Promise<string>;
484
+ /**
485
+ * @description Get user supply amount for a supplier cap
486
+ * @param {string} coinKey The key to identify the margin pool
487
+ * @param {string} supplierCapId The ID of the supplier cap
488
+ * @param {number} decimals Number of decimal places to show (default: 6)
489
+ * @returns {Promise<string>} The user's supply amount as a string
490
+ */
491
+ getUserSupplyAmount(coinKey: string, supplierCapId: string, decimals?: number): Promise<string>;
492
+ /**
493
+ * @description Get the owner address of a margin manager
494
+ * @param {string} marginManagerKey The key to identify the margin manager
495
+ * @returns {Promise<string>} The owner address
496
+ */
497
+ getMarginManagerOwner(marginManagerKey: string): Promise<string>;
498
+ /**
499
+ * @description Get the DeepBook pool ID associated with a margin manager
500
+ * @param {string} marginManagerKey The key to identify the margin manager
501
+ * @returns {Promise<string>} The DeepBook pool ID
502
+ */
503
+ getMarginManagerDeepbookPool(marginManagerKey: string): Promise<string>;
504
+ /**
505
+ * @description Get the margin pool ID (if any) associated with a margin manager
506
+ * @param {string} marginManagerKey The key to identify the margin manager
507
+ * @returns {Promise<string | null>} The margin pool ID or null if no active loan
508
+ */
509
+ getMarginManagerMarginPoolId(marginManagerKey: string): Promise<string | null>;
510
+ /**
511
+ * @description Get borrowed shares for both base and quote assets
512
+ * @param {string} marginManagerKey The key to identify the margin manager
513
+ * @returns {Promise<{baseShares: string, quoteShares: string}>} The borrowed shares
514
+ */
515
+ getMarginManagerBorrowedShares(marginManagerKey: string): Promise<{
516
+ baseShares: string;
517
+ quoteShares: string;
518
+ }>;
519
+ /**
520
+ * @description Get borrowed base shares
521
+ * @param {string} marginManagerKey The key to identify the margin manager
522
+ * @returns {Promise<string>} The borrowed base shares
523
+ */
524
+ getMarginManagerBorrowedBaseShares(marginManagerKey: string): Promise<string>;
525
+ /**
526
+ * @description Get borrowed quote shares
527
+ * @param {string} marginManagerKey The key to identify the margin manager
528
+ * @returns {Promise<string>} The borrowed quote shares
529
+ */
530
+ getMarginManagerBorrowedQuoteShares(marginManagerKey: string): Promise<string>;
531
+ /**
532
+ * @description Check if margin manager has base asset debt
533
+ * @param {string} marginManagerKey The key to identify the margin manager
534
+ * @returns {Promise<boolean>} True if has base debt, false otherwise
535
+ */
536
+ getMarginManagerHasBaseDebt(marginManagerKey: string): Promise<boolean>;
537
+ /**
538
+ * @description Get the balance manager ID for a margin manager
539
+ * @param {string} marginManagerKey The key to identify the margin manager
540
+ * @returns {Promise<string>} The balance manager ID
541
+ */
542
+ getMarginManagerBalanceManagerId(marginManagerKey: string): Promise<string>;
543
+ /**
544
+ * @description Calculate assets (base and quote) for a margin manager
545
+ * @param {string} marginManagerKey The key to identify the margin manager
546
+ * @param {number} decimals Number of decimal places to show (default: 6)
547
+ * @returns {Promise<{baseAsset: string, quoteAsset: string}>} The base and quote assets
548
+ */
549
+ getMarginManagerAssets(marginManagerKey: string, decimals?: number): Promise<{
550
+ baseAsset: string;
551
+ quoteAsset: string;
552
+ }>;
553
+ /**
554
+ * @description Calculate debts (base and quote) for a margin manager
555
+ * NOTE: This function automatically determines whether to use base or quote margin pool
556
+ * based on hasBaseDebt. You don't need to specify the debt coin type.
557
+ * @param {string} marginManagerKey The key to identify the margin manager
558
+ * @param {number} decimals Number of decimal places to show (default: 6)
559
+ * @returns {Promise<{baseDebt: string, quoteDebt: string}>} The base and quote debts
560
+ */
561
+ getMarginManagerDebts(marginManagerKey: string, decimals?: number): Promise<{
562
+ baseDebt: string;
563
+ quoteDebt: string;
564
+ }>;
565
+ /**
566
+ * @description Get comprehensive state information for a margin manager
567
+ * @param {string} marginManagerKey The key to identify the margin manager
568
+ * @param {number} decimals Number of decimal places to show (default: 6)
569
+ * @returns {Promise<{
570
+ * managerId: string,
571
+ * deepbookPoolId: string,
572
+ * riskRatio: number,
573
+ * baseAsset: string,
574
+ * quoteAsset: string,
575
+ * baseDebt: string,
576
+ * quoteDebt: string,
577
+ * basePythPrice: string,
578
+ * basePythDecimals: number,
579
+ * quotePythPrice: string,
580
+ * quotePythDecimals: number
581
+ * }>} Comprehensive margin manager state
582
+ */
583
+ getMarginManagerState(marginManagerKey: string, decimals?: number): Promise<{
584
+ managerId: string;
585
+ deepbookPoolId: string;
586
+ riskRatio: number;
587
+ baseAsset: string;
588
+ quoteAsset: string;
589
+ baseDebt: string;
590
+ quoteDebt: string;
591
+ basePythPrice: string;
592
+ basePythDecimals: number;
593
+ quotePythPrice: string;
594
+ quotePythDecimals: number;
595
+ currentPrice: bigint;
596
+ lowestTriggerAbovePrice: bigint;
597
+ highestTriggerBelowPrice: bigint;
598
+ }>;
599
+ /**
600
+ * @description Get the base asset balance of a margin manager
601
+ * @param {string} marginManagerKey The key to identify the margin manager
602
+ * @param {number} decimals Number of decimal places to show (default: 6)
603
+ * @returns {Promise<string>} The base asset balance
604
+ */
605
+ getMarginManagerBaseBalance(marginManagerKey: string, decimals?: number): Promise<string>;
606
+ /**
607
+ * @description Get the quote asset balance of a margin manager
608
+ * @param {string} marginManagerKey The key to identify the margin manager
609
+ * @param {number} decimals Number of decimal places to show (default: 6)
610
+ * @returns {Promise<string>} The quote asset balance
611
+ */
612
+ getMarginManagerQuoteBalance(marginManagerKey: string, decimals?: number): Promise<string>;
613
+ /**
614
+ * @description Get the DEEP token balance of a margin manager
615
+ * @param {string} marginManagerKey The key to identify the margin manager
616
+ * @param {number} decimals Number of decimal places to show (default: 6)
617
+ * @returns {Promise<string>} The DEEP token balance
618
+ */
619
+ getMarginManagerDeepBalance(marginManagerKey: string, decimals?: number): Promise<string>;
620
+ /**
621
+ * @description Get account order details for a margin manager.
622
+ * This retrieves the balance manager from the margin manager and returns order details.
623
+ * @param {string} marginManagerKey The key to identify the margin manager
624
+ * @returns {Promise<Array>} Array of order details
625
+ */
626
+ getMarginAccountOrderDetails(marginManagerKey: string): Promise<{
627
+ balance_manager_id: string;
628
+ order_id: string;
629
+ client_order_id: string;
630
+ quantity: string;
631
+ filled_quantity: string;
632
+ fee_is_deep: boolean;
633
+ order_deep_price: {
634
+ asset_is_base: boolean;
635
+ deep_per_asset: string;
636
+ };
637
+ epoch: string;
638
+ status: number;
639
+ expire_timestamp: string;
640
+ }[]>;
641
+ /**
642
+ * @description Get all conditional order IDs for a margin manager
643
+ * @param {string} marginManagerKey The key to identify the margin manager
644
+ * @returns {Promise<string[]>} Array of conditional order IDs
645
+ */
646
+ getConditionalOrderIds(marginManagerKey: string): Promise<string[]>;
647
+ /**
648
+ * @description Get the lowest trigger price for trigger_above orders
649
+ * Returns MAX_U64 if there are no trigger_above orders
650
+ * @param {string} marginManagerKey The key to identify the margin manager
651
+ * @returns {Promise<bigint>} The lowest trigger above price
652
+ */
653
+ getLowestTriggerAbovePrice(marginManagerKey: string): Promise<bigint>;
654
+ /**
655
+ * @description Get the highest trigger price for trigger_below orders
656
+ * Returns 0 if there are no trigger_below orders
657
+ * @param {string} marginManagerKey The key to identify the margin manager
658
+ * @returns {Promise<bigint>} The highest trigger below price
659
+ */
660
+ getHighestTriggerBelowPrice(marginManagerKey: string): Promise<bigint>;
661
+ /**
662
+ * @description Check if a deepbook pool is enabled for margin trading
663
+ * @param {string} poolKey The key to identify the pool
664
+ * @returns {Promise<boolean>} True if the pool is enabled for margin trading
665
+ */
666
+ isPoolEnabledForMargin(poolKey: string): Promise<boolean>;
667
+ /**
668
+ * @description Get the margin manager IDs for a given owner address
669
+ * @param {string} owner The owner address
670
+ * @returns {Promise<string[]>} Array of margin manager IDs
671
+ */
672
+ getMarginManagerIdsForOwner(owner: string): Promise<string[]>;
673
+ /**
674
+ * @description Get the base margin pool ID for a deepbook pool
675
+ * @param {string} poolKey The key to identify the pool
676
+ * @returns {Promise<string>} The base margin pool ID
677
+ */
678
+ getBaseMarginPoolId(poolKey: string): Promise<string>;
679
+ /**
680
+ * @description Get the quote margin pool ID for a deepbook pool
681
+ * @param {string} poolKey The key to identify the pool
682
+ * @returns {Promise<string>} The quote margin pool ID
683
+ */
684
+ getQuoteMarginPoolId(poolKey: string): Promise<string>;
685
+ /**
686
+ * @description Get the minimum withdraw risk ratio for a deepbook pool
687
+ * @param {string} poolKey The key to identify the pool
688
+ * @returns {Promise<number>} The minimum withdraw risk ratio as a decimal (e.g., 1.5 for 150%)
689
+ */
690
+ getMinWithdrawRiskRatio(poolKey: string): Promise<number>;
691
+ /**
692
+ * @description Get the minimum borrow risk ratio for a deepbook pool
693
+ * @param {string} poolKey The key to identify the pool
694
+ * @returns {Promise<number>} The minimum borrow risk ratio as a decimal (e.g., 1.25 for 125%)
695
+ */
696
+ getMinBorrowRiskRatio(poolKey: string): Promise<number>;
697
+ /**
698
+ * @description Get the liquidation risk ratio for a deepbook pool
699
+ * @param {string} poolKey The key to identify the pool
700
+ * @returns {Promise<number>} The liquidation risk ratio as a decimal (e.g., 1.125 for 112.5%)
701
+ */
702
+ getLiquidationRiskRatio(poolKey: string): Promise<number>;
703
+ /**
704
+ * @description Get the target liquidation risk ratio for a deepbook pool
705
+ * @param {string} poolKey The key to identify the pool
706
+ * @returns {Promise<number>} The target liquidation risk ratio as a decimal (e.g., 1.25 for 125%)
707
+ */
708
+ getTargetLiquidationRiskRatio(poolKey: string): Promise<number>;
709
+ /**
710
+ * @description Get the user liquidation reward for a deepbook pool
711
+ * @param {string} poolKey The key to identify the pool
712
+ * @returns {Promise<number>} The user liquidation reward as a decimal (e.g., 0.05 for 5%)
713
+ */
714
+ getUserLiquidationReward(poolKey: string): Promise<number>;
715
+ /**
716
+ * @description Get the pool liquidation reward for a deepbook pool
717
+ * @param {string} poolKey The key to identify the pool
718
+ * @returns {Promise<number>} The pool liquidation reward as a decimal (e.g., 0.05 for 5%)
719
+ */
720
+ getPoolLiquidationReward(poolKey: string): Promise<number>;
721
+ /**
722
+ * @description Get all allowed maintainer cap IDs
723
+ * @returns {Promise<string[]>} Array of allowed maintainer cap IDs
724
+ */
725
+ getAllowedMaintainers(): Promise<string[]>;
726
+ /**
727
+ * @description Get all allowed pause cap IDs
728
+ * @returns {Promise<string[]>} Array of allowed pause cap IDs
729
+ */
730
+ getAllowedPauseCaps(): Promise<string[]>;
731
+ /**
732
+ * @description Check if a pool is a stable pool
733
+ * @param {string} poolKey Key of the pool
734
+ * @returns {Promise<boolean>} Whether the pool is a stable pool
735
+ */
736
+ stablePool(poolKey: string): Promise<boolean>;
737
+ /**
738
+ * @description Check if a pool is registered
739
+ * @param {string} poolKey Key of the pool
740
+ * @returns {Promise<boolean>} Whether the pool is registered
741
+ */
742
+ registeredPool(poolKey: string): Promise<boolean>;
743
+ /**
744
+ * @description Get the quote quantity out using input token as fee
745
+ * @param {string} poolKey Key of the pool
746
+ * @param {number} baseQuantity Base quantity
747
+ * @returns {Promise<{baseQuantity: number, baseOut: number, quoteOut: number, deepRequired: number}>}
748
+ */
749
+ getQuoteQuantityOutInputFee(poolKey: string, baseQuantity: number): Promise<{
750
+ baseQuantity: number;
751
+ baseOut: number;
752
+ quoteOut: number;
753
+ deepRequired: number;
754
+ }>;
755
+ /**
756
+ * @description Get the base quantity out using input token as fee
757
+ * @param {string} poolKey Key of the pool
758
+ * @param {number} quoteQuantity Quote quantity
759
+ * @returns {Promise<{quoteQuantity: number, baseOut: number, quoteOut: number, deepRequired: number}>}
760
+ */
761
+ getBaseQuantityOutInputFee(poolKey: string, quoteQuantity: number): Promise<{
762
+ quoteQuantity: number;
763
+ baseOut: number;
764
+ quoteOut: number;
765
+ deepRequired: number;
766
+ }>;
767
+ /**
768
+ * @description Get the quantity out using input token as fee
769
+ * @param {string} poolKey Key of the pool
770
+ * @param {number} baseQuantity Base quantity
771
+ * @param {number} quoteQuantity Quote quantity
772
+ * @returns {Promise<{baseQuantity: number, quoteQuantity: number, baseOut: number, quoteOut: number, deepRequired: number}>}
773
+ */
774
+ getQuantityOutInputFee(poolKey: string, baseQuantity: number, quoteQuantity: number): Promise<{
775
+ baseQuantity: number;
776
+ quoteQuantity: number;
777
+ baseOut: number;
778
+ quoteOut: number;
779
+ deepRequired: number;
780
+ }>;
781
+ /**
782
+ * @description Get the base quantity needed to receive target quote quantity
783
+ * @param {string} poolKey Key of the pool
784
+ * @param {number} targetQuoteQuantity Target quote quantity
785
+ * @param {boolean} payWithDeep Whether to pay fees with DEEP
786
+ * @returns {Promise<{baseIn: number, quoteOut: number, deepRequired: number}>}
787
+ */
788
+ getBaseQuantityIn(poolKey: string, targetQuoteQuantity: number, payWithDeep: boolean): Promise<{
789
+ baseIn: number;
790
+ quoteOut: number;
791
+ deepRequired: number;
792
+ }>;
793
+ /**
794
+ * @description Get the quote quantity needed to receive target base quantity
795
+ * @param {string} poolKey Key of the pool
796
+ * @param {number} targetBaseQuantity Target base quantity
797
+ * @param {boolean} payWithDeep Whether to pay fees with DEEP
798
+ * @returns {Promise<{baseOut: number, quoteIn: number, deepRequired: number}>}
799
+ */
800
+ getQuoteQuantityIn(poolKey: string, targetBaseQuantity: number, payWithDeep: boolean): Promise<{
801
+ baseOut: number;
802
+ quoteIn: number;
803
+ deepRequired: number;
804
+ }>;
805
+ /**
806
+ * @description Get account order details for a balance manager
807
+ * @param {string} poolKey Key of the pool
808
+ * @param {string} managerKey Key of the balance manager
809
+ * @returns {Promise<Array>} Array of order details
810
+ */
811
+ getAccountOrderDetails(poolKey: string, managerKey: string): Promise<{
812
+ balance_manager_id: string;
813
+ order_id: string;
814
+ client_order_id: string;
815
+ quantity: string;
816
+ filled_quantity: string;
817
+ fee_is_deep: boolean;
818
+ order_deep_price: {
819
+ asset_is_base: boolean;
820
+ deep_per_asset: string;
821
+ };
822
+ epoch: string;
823
+ status: number;
824
+ expire_timestamp: string;
825
+ }[]>;
826
+ /**
827
+ * @description Get the DEEP required for an order
828
+ * @param {string} poolKey Key of the pool
829
+ * @param {number} baseQuantity Base quantity
830
+ * @param {number} price Price
831
+ * @returns {Promise<{deepRequiredTaker: number, deepRequiredMaker: number}>}
832
+ */
833
+ getOrderDeepRequired(poolKey: string, baseQuantity: number, price: number): Promise<{
834
+ deepRequiredTaker: number;
835
+ deepRequiredMaker: number;
836
+ }>;
837
+ /**
838
+ * @description Check if account exists for a balance manager
839
+ * @param {string} poolKey Key of the pool
840
+ * @param {string} managerKey Key of the balance manager
841
+ * @returns {Promise<boolean>} Whether account exists
842
+ */
843
+ accountExists(poolKey: string, managerKey: string): Promise<boolean>;
844
+ /**
845
+ * @description Get the next epoch trade parameters
846
+ * @param {string} poolKey Key of the pool
847
+ * @returns {Promise<{takerFee: number, makerFee: number, stakeRequired: number}>}
848
+ */
849
+ poolTradeParamsNext(poolKey: string): Promise<{
850
+ takerFee: number;
851
+ makerFee: number;
852
+ stakeRequired: number;
853
+ }>;
854
+ /**
855
+ * @description Get the quorum for a pool
856
+ * @param {string} poolKey Key of the pool
857
+ * @returns {Promise<number>} The quorum amount in DEEP
858
+ */
859
+ quorum(poolKey: string): Promise<number>;
860
+ /**
861
+ * @description Get the pool ID
862
+ * @param {string} poolKey Key of the pool
863
+ * @returns {Promise<string>} The pool ID
864
+ */
865
+ poolId(poolKey: string): Promise<string>;
866
+ /**
867
+ * @description Check if a limit order can be placed
868
+ * @param {CanPlaceLimitOrderParams} params Parameters for checking limit order placement
869
+ * @returns {Promise<boolean>} Whether order can be placed
870
+ */
871
+ canPlaceLimitOrder(params: CanPlaceLimitOrderParams): Promise<boolean>;
872
+ /**
873
+ * @description Check if a market order can be placed
874
+ * @param {CanPlaceMarketOrderParams} params Parameters for checking market order placement
875
+ * @returns {Promise<boolean>} Whether order can be placed
876
+ */
877
+ canPlaceMarketOrder(params: CanPlaceMarketOrderParams): Promise<boolean>;
878
+ /**
879
+ * @description Check if market order params are valid
880
+ * @param {string} poolKey Key of the pool
881
+ * @param {number} quantity Quantity
882
+ * @returns {Promise<boolean>} Whether params are valid
883
+ */
884
+ checkMarketOrderParams(poolKey: string, quantity: number): Promise<boolean>;
885
+ /**
886
+ * @description Check if limit order params are valid
887
+ * @param {string} poolKey Key of the pool
888
+ * @param {number} price Price
889
+ * @param {number} quantity Quantity
890
+ * @param {number} expireTimestamp Expiration timestamp
891
+ * @returns {Promise<boolean>} Whether params are valid
892
+ */
893
+ checkLimitOrderParams(poolKey: string, price: number, quantity: number, expireTimestamp: number): Promise<boolean>;
894
+ }
895
+ //#endregion
896
+ export { DeepBookClient, DeepBookClientOptions, DeepBookCompatibleClient, DeepBookOptions, deepbook };
897
+ //# sourceMappingURL=client.d.mts.map