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