@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 @@
1
+ {"version":3,"file":"client.mjs","names":["#client","#address","#config","#formatTokenAmount"],"sources":["../src/client.ts"],"sourcesContent":["// Copyright (c) Mysten Labs, Inc.\n// SPDX-License-Identifier: Apache-2.0\nimport { bcs } from '@mysten/sui/bcs';\nimport { Account, Order, OrderDeepPrice, VecSet } from './types/bcs.js';\nimport type { ClientWithCoreApi, SuiClientRegistration, SuiClientTypes } from '@mysten/sui/client';\nimport { Transaction } from '@mysten/sui/transactions';\nimport { normalizeSuiAddress } from '@mysten/sui/utils';\n\nimport { BalanceManagerContract } from './transactions/balanceManager.js';\nimport { DeepBookContract } from './transactions/deepbook.js';\nimport { DeepBookAdminContract } from './transactions/deepbookAdmin.js';\nimport { FlashLoanContract } from './transactions/flashLoans.js';\nimport { GovernanceContract } from './transactions/governance.js';\nimport type {\n\tBalanceManager,\n\tMarginManager,\n\tCanPlaceLimitOrderParams,\n\tCanPlaceMarketOrderParams,\n} from './types/index.js';\nimport {\n\tDEEP_SCALAR,\n\tDeepBookConfig,\n\tFLOAT_SCALAR,\n\tPRICE_INFO_OBJECT_MAX_AGE_MS,\n} from './utils/config.js';\nimport type { CoinMap, PoolMap } from './utils/constants.js';\nimport { MarginAdminContract } from './transactions/marginAdmin.js';\nimport { MarginMaintainerContract } from './transactions/marginMaintainer.js';\nimport { MarginPoolContract } from './transactions/marginPool.js';\nimport { MarginManagerContract } from './transactions/marginManager.js';\nimport { MarginRegistryContract } from './transactions/marginRegistry.js';\nimport { MarginLiquidationsContract } from './transactions/marginLiquidations.js';\nimport { SuiPriceServiceConnection } from './pyth/pyth.js';\nimport { SuiPythClient } from './pyth/pyth.js';\nimport { PriceInfoObject } from './contracts/pyth/price_info.js';\nimport { PoolProxyContract } from './transactions/poolProxy.js';\nimport { MarginTPSLContract } from './transactions/marginTPSL.js';\n\nexport interface DeepBookCompatibleClient extends ClientWithCoreApi {}\n\nexport interface DeepBookOptions<Name = 'deepbook'> {\n\taddress: string;\n\tbalanceManagers?: { [key: string]: BalanceManager };\n\tmarginManagers?: { [key: string]: MarginManager };\n\tcoins?: CoinMap;\n\tpools?: PoolMap;\n\tadminCap?: string;\n\tmarginAdminCap?: string;\n\tmarginMaintainerCap?: string;\n\tname?: Name;\n}\n\nexport interface DeepBookClientOptions extends DeepBookOptions {\n\tclient: DeepBookCompatibleClient;\n\tnetwork: SuiClientTypes.Network;\n}\n\nexport function deepbook<Name extends string = 'deepbook'>({\n\tname = 'deepbook' as Name,\n\t...options\n}: DeepBookOptions<Name>): SuiClientRegistration<DeepBookCompatibleClient, Name, DeepBookClient> {\n\treturn {\n\t\tname,\n\t\tregister: (client) => {\n\t\t\treturn new DeepBookClient({\n\t\t\t\tclient,\n\t\t\t\tnetwork: client.network,\n\t\t\t\t...options,\n\t\t\t});\n\t\t},\n\t};\n}\n\n/**\n * DeepBookClient class for managing DeepBook operations.\n */\nexport class DeepBookClient {\n\t#client: DeepBookCompatibleClient;\n\t#config: DeepBookConfig;\n\t#address: string;\n\tbalanceManager: BalanceManagerContract;\n\tdeepBook: DeepBookContract;\n\tdeepBookAdmin: DeepBookAdminContract;\n\tflashLoans: FlashLoanContract;\n\tgovernance: GovernanceContract;\n\tmarginAdmin: MarginAdminContract;\n\tmarginMaintainer: MarginMaintainerContract;\n\tmarginPool: MarginPoolContract;\n\tmarginManager: MarginManagerContract;\n\tmarginRegistry: MarginRegistryContract;\n\tmarginLiquidations: MarginLiquidationsContract;\n\tpoolProxy: PoolProxyContract;\n\tmarginTPSL: MarginTPSLContract;\n\n\t/**\n\t * Creates a new DeepBookClient instance\n\t */\n\tconstructor({\n\t\tclient,\n\t\taddress,\n\t\tnetwork,\n\t\tbalanceManagers,\n\t\tmarginManagers,\n\t\tcoins,\n\t\tpools,\n\t\tadminCap,\n\t\tmarginAdminCap,\n\t\tmarginMaintainerCap,\n\t}: DeepBookClientOptions) {\n\t\tthis.#client = client;\n\t\tthis.#address = normalizeSuiAddress(address);\n\t\tthis.#config = new DeepBookConfig({\n\t\t\taddress: this.#address,\n\t\t\tnetwork,\n\t\t\tbalanceManagers,\n\t\t\tmarginManagers,\n\t\t\tcoins,\n\t\t\tpools,\n\t\t\tadminCap,\n\t\t\tmarginAdminCap,\n\t\t\tmarginMaintainerCap,\n\t\t});\n\t\tthis.balanceManager = new BalanceManagerContract(this.#config);\n\t\tthis.deepBook = new DeepBookContract(this.#config);\n\t\tthis.deepBookAdmin = new DeepBookAdminContract(this.#config);\n\t\tthis.flashLoans = new FlashLoanContract(this.#config);\n\t\tthis.governance = new GovernanceContract(this.#config);\n\t\tthis.marginAdmin = new MarginAdminContract(this.#config);\n\t\tthis.marginMaintainer = new MarginMaintainerContract(this.#config);\n\t\tthis.marginPool = new MarginPoolContract(this.#config);\n\t\tthis.marginManager = new MarginManagerContract(this.#config);\n\t\tthis.marginRegistry = new MarginRegistryContract(this.#config);\n\t\tthis.marginLiquidations = new MarginLiquidationsContract(this.#config);\n\t\tthis.poolProxy = new PoolProxyContract(this.#config);\n\t\tthis.marginTPSL = new MarginTPSLContract(this.#config);\n\t}\n\n\t/**\n\t * @description Check the balance of a balance manager for a specific coin\n\t * @param {string} managerKey Key of the balance manager\n\t * @param {string} coinKey Key of the coin\n\t * @returns {Promise<{ coinType: string, balance: number }>} An object with coin type and balance\n\t */\n\tasync checkManagerBalance(managerKey: string, coinKey: string) {\n\t\tconst tx = new Transaction();\n\t\tconst coin = this.#config.getCoin(coinKey);\n\n\t\ttx.add(this.balanceManager.checkManagerBalance(managerKey, coinKey));\n\t\tconst res = await this.#client.core.simulateTransaction({\n\t\t\ttransaction: tx,\n\t\t\tinclude: { commandResults: true, effects: true },\n\t\t});\n\n\t\tconst bytes = res.commandResults![0].returnValues[0].bcs;\n\t\tconst parsed_balance = bcs.U64.parse(bytes);\n\t\tconst balanceNumber = Number(parsed_balance);\n\t\tconst adjusted_balance = balanceNumber / coin.scalar;\n\n\t\treturn {\n\t\t\tcoinType: coin.type,\n\t\t\tbalance: Number(adjusted_balance.toFixed(9)),\n\t\t};\n\t}\n\n\t/**\n\t * @description Check if a pool is whitelisted\n\t * @param {string} poolKey Key of the pool\n\t * @returns {Promise<boolean>} Boolean indicating if the pool is whitelisted\n\t */\n\tasync whitelisted(poolKey: string) {\n\t\tconst tx = new Transaction();\n\n\t\ttx.add(this.deepBook.whitelisted(poolKey));\n\t\tconst res = await this.#client.core.simulateTransaction({\n\t\t\ttransaction: tx,\n\t\t\tinclude: { commandResults: true, effects: true },\n\t\t});\n\n\t\tconst bytes = res.commandResults![0].returnValues[0].bcs;\n\t\tconst whitelisted = bcs.Bool.parse(bytes);\n\n\t\treturn whitelisted;\n\t}\n\n\t/**\n\t * @description Get the quote quantity out for a given base quantity\n\t * @param {string} poolKey Key of the pool\n\t * @param {number} baseQuantity Base quantity to convert\n\t * @returns {Promise<{ baseQuantity: number, baseOut: number, quoteOut: number, deepRequired: number }>}\n\t * An object with base quantity, base out, quote out, and deep required for the dry run\n\t */\n\tasync getQuoteQuantityOut(poolKey: string, baseQuantity: number) {\n\t\tconst tx = new Transaction();\n\t\tconst pool = this.#config.getPool(poolKey);\n\t\tconst baseScalar = this.#config.getCoin(pool.baseCoin).scalar;\n\t\tconst quoteScalar = this.#config.getCoin(pool.quoteCoin).scalar;\n\n\t\ttx.add(this.deepBook.getQuoteQuantityOut(poolKey, baseQuantity));\n\t\tconst res = await this.#client.core.simulateTransaction({\n\t\t\ttransaction: tx,\n\t\t\tinclude: { commandResults: true, effects: true },\n\t\t});\n\n\t\tconst baseOut = Number(bcs.U64.parse(res.commandResults![0].returnValues[0].bcs));\n\t\tconst quoteOut = Number(bcs.U64.parse(res.commandResults![0].returnValues[1].bcs));\n\t\tconst deepRequired = Number(bcs.U64.parse(res.commandResults![0].returnValues[2].bcs));\n\n\t\treturn {\n\t\t\tbaseQuantity,\n\t\t\tbaseOut: Number((baseOut / baseScalar).toFixed(9)),\n\t\t\tquoteOut: Number((quoteOut / quoteScalar).toFixed(9)),\n\t\t\tdeepRequired: Number((deepRequired / DEEP_SCALAR).toFixed(9)),\n\t\t};\n\t}\n\n\t/**\n\t * @description Get the base quantity out for a given quote quantity\n\t * @param {string} poolKey Key of the pool\n\t * @param {number} quoteQuantity Quote quantity to convert\n\t * @returns {Promise<{ quoteQuantity: number, baseOut: number, quoteOut: number, deepRequired: number }>}\n\t * An object with quote quantity, base out, quote out, and deep required for the dry run\n\t */\n\tasync getBaseQuantityOut(poolKey: string, quoteQuantity: number) {\n\t\tconst tx = new Transaction();\n\t\tconst pool = this.#config.getPool(poolKey);\n\t\tconst baseScalar = this.#config.getCoin(pool.baseCoin).scalar;\n\t\tconst quoteScalar = this.#config.getCoin(pool.quoteCoin).scalar;\n\n\t\ttx.add(this.deepBook.getBaseQuantityOut(poolKey, quoteQuantity));\n\t\tconst res = await this.#client.core.simulateTransaction({\n\t\t\ttransaction: tx,\n\t\t\tinclude: { commandResults: true, effects: true },\n\t\t});\n\n\t\tconst baseOut = Number(bcs.U64.parse(res.commandResults![0].returnValues[0].bcs));\n\t\tconst quoteOut = Number(bcs.U64.parse(res.commandResults![0].returnValues[1].bcs));\n\t\tconst deepRequired = Number(bcs.U64.parse(res.commandResults![0].returnValues[2].bcs));\n\n\t\treturn {\n\t\t\tquoteQuantity: quoteQuantity,\n\t\t\tbaseOut: Number((baseOut / baseScalar).toFixed(9)),\n\t\t\tquoteOut: Number((quoteOut / quoteScalar).toFixed(9)),\n\t\t\tdeepRequired: Number((deepRequired / DEEP_SCALAR).toFixed(9)),\n\t\t};\n\t}\n\n\t/**\n\t * @description Get the output quantities for given base and quote quantities. Only one quantity can be non-zero\n\t * @param {string} poolKey Key of the pool\n\t * @param {number} baseQuantity Base quantity to convert\n\t * @param {number} quoteQuantity Quote quantity to convert\n\t * @returns {Promise<{ baseQuantity: number, quoteQuantity: number, baseOut: number, quoteOut: number, deepRequired: number }>}\n\t * An object with base quantity, quote quantity, base out, quote out, and deep required for the dry run\n\t */\n\tasync getQuantityOut(poolKey: string, baseQuantity: number, quoteQuantity: number) {\n\t\tconst tx = new Transaction();\n\t\tconst pool = this.#config.getPool(poolKey);\n\t\tconst baseScalar = this.#config.getCoin(pool.baseCoin).scalar;\n\t\tconst quoteScalar = this.#config.getCoin(pool.quoteCoin).scalar;\n\n\t\ttx.add(this.deepBook.getQuantityOut(poolKey, baseQuantity, quoteQuantity));\n\t\tconst res = await this.#client.core.simulateTransaction({\n\t\t\ttransaction: tx,\n\t\t\tinclude: { commandResults: true, effects: true },\n\t\t});\n\n\t\tconst baseOut = Number(bcs.U64.parse(res.commandResults![0].returnValues[0].bcs));\n\t\tconst quoteOut = Number(bcs.U64.parse(res.commandResults![0].returnValues[1].bcs));\n\t\tconst deepRequired = Number(bcs.U64.parse(res.commandResults![0].returnValues[2].bcs));\n\n\t\treturn {\n\t\t\tbaseQuantity,\n\t\t\tquoteQuantity,\n\t\t\tbaseOut: Number((baseOut / baseScalar).toFixed(9)),\n\t\t\tquoteOut: Number((quoteOut / quoteScalar).toFixed(9)),\n\t\t\tdeepRequired: Number((deepRequired / DEEP_SCALAR).toFixed(9)),\n\t\t};\n\t}\n\n\t/**\n\t * @description Get open orders for a balance manager in a pool\n\t * @param {string} poolKey Key of the pool\n\t * @param {string} managerKey Key of the balance manager\n\t * @returns {Promise<Array>} An array of open order IDs\n\t */\n\tasync accountOpenOrders(poolKey: string, managerKey: string) {\n\t\tconst tx = new Transaction();\n\n\t\ttx.add(this.deepBook.accountOpenOrders(poolKey, managerKey));\n\t\tconst res = await this.#client.core.simulateTransaction({\n\t\t\ttransaction: tx,\n\t\t\tinclude: { commandResults: true, effects: true },\n\t\t});\n\n\t\tconst order_ids = res.commandResults![0].returnValues[0].bcs;\n\n\t\treturn VecSet(bcs.u128()).parse(new Uint8Array(order_ids)).contents;\n\t}\n\n\t/**\n\t * @description Get the order information for a specific order in a pool\n\t * @param {string} poolKey Key of the pool\n\t * @param {string} orderId Order ID\n\t * @returns {Promise<Object>} A promise that resolves to an object containing the order information\n\t */\n\tasync getOrder(poolKey: string, orderId: string) {\n\t\tconst tx = new Transaction();\n\n\t\ttx.add(this.deepBook.getOrder(poolKey, orderId));\n\t\tconst res = await this.#client.core.simulateTransaction({\n\t\t\ttransaction: tx,\n\t\t\tinclude: { commandResults: true, effects: true },\n\t\t});\n\n\t\ttry {\n\t\t\tconst orderInformation = res.commandResults![0].returnValues[0].bcs;\n\t\t\treturn Order.parse(new Uint8Array(orderInformation));\n\t\t} catch {\n\t\t\treturn null;\n\t\t}\n\t}\n\n\t/**\n\t * @description Get the order information for a specific order in a pool, with normalized price\n\t * @param {string} poolKey Key of the pool\n\t * @param {string} orderId Order ID\n\t * @returns {Promise<Object>} A promise that resolves to an object containing the order information with normalized price\n\t */\n\tasync getOrderNormalized(poolKey: string, orderId: string) {\n\t\tconst tx = new Transaction();\n\t\ttx.add(this.deepBook.getOrder(poolKey, orderId));\n\t\tconst res = await this.#client.core.simulateTransaction({\n\t\t\ttransaction: tx,\n\t\t\tinclude: { commandResults: true, effects: true },\n\t\t});\n\n\t\ttry {\n\t\t\tconst orderInformation = res.commandResults![0].returnValues[0].bcs;\n\t\t\tconst orderInfo = Order.parse(new Uint8Array(orderInformation));\n\n\t\t\tif (!orderInfo) {\n\t\t\t\treturn null;\n\t\t\t}\n\t\t\tconst baseCoin = this.#config.getCoin(this.#config.getPool(poolKey).baseCoin);\n\t\t\tconst quoteCoin = this.#config.getCoin(this.#config.getPool(poolKey).quoteCoin);\n\t\t\tconst { isBid, price: rawPrice } = this.decodeOrderId(BigInt(orderInfo.order_id));\n\t\t\tconst normalizedPrice = (rawPrice * baseCoin.scalar) / quoteCoin.scalar / FLOAT_SCALAR;\n\n\t\t\tconst normalizedOrderInfo = {\n\t\t\t\t...orderInfo,\n\t\t\t\tquantity: String((Number(orderInfo.quantity) / baseCoin.scalar).toFixed(9)),\n\t\t\t\tfilled_quantity: String((Number(orderInfo.filled_quantity) / baseCoin.scalar).toFixed(9)),\n\t\t\t\torder_deep_price: {\n\t\t\t\t\t...orderInfo.order_deep_price,\n\t\t\t\t\tdeep_per_asset: String(\n\t\t\t\t\t\t(Number(orderInfo.order_deep_price.deep_per_asset) / DEEP_SCALAR).toFixed(9),\n\t\t\t\t\t),\n\t\t\t\t},\n\t\t\t\tisBid,\n\t\t\t\tnormalized_price: normalizedPrice.toFixed(9),\n\t\t\t};\n\t\t\treturn normalizedOrderInfo;\n\t\t} catch {\n\t\t\treturn null;\n\t\t}\n\t}\n\n\t/**\n\t * @description Retrieves information for multiple specific orders in a pool.\n\t * @param {string} poolKey - The key identifying the pool from which to retrieve order information.\n\t * @param {string[]} orderIds - List of order IDs to retrieve information for.\n\t * @returns {Promise<Object[] | null>} A promise that resolves to an array of order objects, each containing details such as\n\t * balance manager ID, order ID, client order ID, quantity, filled quantity, fee information, order price, epoch, status,\n\t * and expiration timestamp. Returns `null` if the retrieval fails.\n\t */\n\tasync getOrders(poolKey: string, orderIds: string[]) {\n\t\tconst tx = new Transaction();\n\n\t\ttx.add(this.deepBook.getOrders(poolKey, orderIds));\n\t\tconst res = await this.#client.core.simulateTransaction({\n\t\t\ttransaction: tx,\n\t\t\tinclude: { commandResults: true, effects: true },\n\t\t});\n\n\t\ttry {\n\t\t\tconst orderInformation = res.commandResults![0].returnValues[0].bcs;\n\t\t\treturn bcs.vector(Order).parse(new Uint8Array(orderInformation));\n\t\t} catch {\n\t\t\treturn null;\n\t\t}\n\t}\n\n\t/**\n\t * @description Get level 2 order book specifying range of price\n\t * @param {string} poolKey Key of the pool\n\t * @param {number} priceLow Lower bound of the price range\n\t * @param {number} priceHigh Upper bound of the price range\n\t * @param {boolean} isBid Whether to get bid or ask orders\n\t * @returns {Promise<{ prices: Array<number>, quantities: Array<number> }>}\n\t * An object with arrays of prices and quantities\n\t */\n\tasync getLevel2Range(poolKey: string, priceLow: number, priceHigh: number, isBid: boolean) {\n\t\tconst tx = new Transaction();\n\t\tconst pool = this.#config.getPool(poolKey);\n\t\tconst baseCoin = this.#config.getCoin(pool.baseCoin);\n\t\tconst quoteCoin = this.#config.getCoin(pool.quoteCoin);\n\n\t\ttx.add(this.deepBook.getLevel2Range(poolKey, priceLow, priceHigh, isBid));\n\t\tconst res = await this.#client.core.simulateTransaction({\n\t\t\ttransaction: tx,\n\t\t\tinclude: { commandResults: true, effects: true },\n\t\t});\n\n\t\tconst prices = res.commandResults![0].returnValues[0].bcs;\n\t\tconst parsed_prices = bcs.vector(bcs.u64()).parse(new Uint8Array(prices));\n\t\tconst quantities = res.commandResults![0].returnValues[1].bcs;\n\t\tconst parsed_quantities = bcs.vector(bcs.u64()).parse(new Uint8Array(quantities));\n\n\t\treturn {\n\t\t\tprices: parsed_prices.map((price) =>\n\t\t\t\tNumber(((Number(price) / FLOAT_SCALAR / quoteCoin.scalar) * baseCoin.scalar).toFixed(9)),\n\t\t\t),\n\t\t\tquantities: parsed_quantities.map((price) =>\n\t\t\t\tNumber((Number(price) / baseCoin.scalar).toFixed(9)),\n\t\t\t),\n\t\t};\n\t}\n\n\t/**\n\t * @description Get level 2 order book ticks from mid-price for a pool\n\t * @param {string} poolKey Key of the pool\n\t * @param {number} ticks Number of ticks from mid-price\n\t * @returns {Promise<{ bid_prices: Array<number>, bid_quantities: Array<number>, ask_prices: Array<number>, ask_quantities: Array<number> }>}\n\t * An object with arrays of prices and quantities\n\t */\n\tasync getLevel2TicksFromMid(poolKey: string, ticks: number) {\n\t\tconst tx = new Transaction();\n\t\tconst pool = this.#config.getPool(poolKey);\n\t\tconst baseCoin = this.#config.getCoin(pool.baseCoin);\n\t\tconst quoteCoin = this.#config.getCoin(pool.quoteCoin);\n\n\t\ttx.add(this.deepBook.getLevel2TicksFromMid(poolKey, ticks));\n\t\tconst res = await this.#client.core.simulateTransaction({\n\t\t\ttransaction: tx,\n\t\t\tinclude: { commandResults: true, effects: true },\n\t\t});\n\n\t\tconst bid_prices = res.commandResults![0].returnValues[0].bcs;\n\t\tconst bid_parsed_prices = bcs.vector(bcs.u64()).parse(new Uint8Array(bid_prices));\n\t\tconst bid_quantities = res.commandResults![0].returnValues[1].bcs;\n\t\tconst bid_parsed_quantities = bcs.vector(bcs.u64()).parse(new Uint8Array(bid_quantities));\n\n\t\tconst ask_prices = res.commandResults![0].returnValues[2].bcs;\n\t\tconst ask_parsed_prices = bcs.vector(bcs.u64()).parse(new Uint8Array(ask_prices));\n\t\tconst ask_quantities = res.commandResults![0].returnValues[3].bcs;\n\t\tconst ask_parsed_quantities = bcs.vector(bcs.u64()).parse(new Uint8Array(ask_quantities));\n\n\t\treturn {\n\t\t\tbid_prices: bid_parsed_prices.map((price) =>\n\t\t\t\tNumber(((Number(price) / FLOAT_SCALAR / quoteCoin.scalar) * baseCoin.scalar).toFixed(9)),\n\t\t\t),\n\t\t\tbid_quantities: bid_parsed_quantities.map((quantity) =>\n\t\t\t\tNumber((Number(quantity) / baseCoin.scalar).toFixed(9)),\n\t\t\t),\n\t\t\task_prices: ask_parsed_prices.map((price) =>\n\t\t\t\tNumber(((Number(price) / FLOAT_SCALAR / quoteCoin.scalar) * baseCoin.scalar).toFixed(9)),\n\t\t\t),\n\t\t\task_quantities: ask_parsed_quantities.map((quantity) =>\n\t\t\t\tNumber((Number(quantity) / baseCoin.scalar).toFixed(9)),\n\t\t\t),\n\t\t};\n\t}\n\n\t/**\n\t * @description Get the vault balances for a pool\n\t * @param {string} poolKey Key of the pool\n\t * @returns {Promise<{ base: number, quote: number, deep: number }>}\n\t * An object with base, quote, and deep balances in the vault\n\t */\n\tasync vaultBalances(poolKey: string) {\n\t\tconst tx = new Transaction();\n\t\tconst pool = this.#config.getPool(poolKey);\n\t\tconst baseScalar = this.#config.getCoin(pool.baseCoin).scalar;\n\t\tconst quoteScalar = this.#config.getCoin(pool.quoteCoin).scalar;\n\n\t\ttx.add(this.deepBook.vaultBalances(poolKey));\n\t\tconst res = await this.#client.core.simulateTransaction({\n\t\t\ttransaction: tx,\n\t\t\tinclude: { commandResults: true, effects: true },\n\t\t});\n\n\t\tconst baseInVault = Number(bcs.U64.parse(res.commandResults![0].returnValues[0].bcs));\n\t\tconst quoteInVault = Number(bcs.U64.parse(res.commandResults![0].returnValues[1].bcs));\n\t\tconst deepInVault = Number(bcs.U64.parse(res.commandResults![0].returnValues[2].bcs));\n\n\t\treturn {\n\t\t\tbase: Number((baseInVault / baseScalar).toFixed(9)),\n\t\t\tquote: Number((quoteInVault / quoteScalar).toFixed(9)),\n\t\t\tdeep: Number((deepInVault / DEEP_SCALAR).toFixed(9)),\n\t\t};\n\t}\n\n\t/**\n\t * @description Get the pool ID by asset types\n\t * @param {string} baseType Type of the base asset\n\t * @param {string} quoteType Type of the quote asset\n\t * @returns {Promise<string>} The address of the pool\n\t */\n\tasync getPoolIdByAssets(baseType: string, quoteType: string) {\n\t\tconst tx = new Transaction();\n\t\ttx.add(this.deepBook.getPoolIdByAssets(baseType, quoteType));\n\n\t\tconst res = await this.#client.core.simulateTransaction({\n\t\t\ttransaction: tx,\n\t\t\tinclude: { commandResults: true, effects: true },\n\t\t});\n\n\t\tconst address = bcs.Address.parse(res.commandResults![0].returnValues[0].bcs);\n\n\t\treturn address;\n\t}\n\n\t/**\n\t * @description Get the mid price for a pool\n\t * @param {string} poolKey Key of the pool\n\t * @returns {Promise<number>} The mid price\n\t */\n\tasync midPrice(poolKey: string) {\n\t\tconst tx = new Transaction();\n\t\tconst pool = this.#config.getPool(poolKey);\n\t\ttx.add(this.deepBook.midPrice(poolKey));\n\n\t\tconst baseCoin = this.#config.getCoin(pool.baseCoin);\n\t\tconst quoteCoin = this.#config.getCoin(pool.quoteCoin);\n\n\t\tconst res = await this.#client.core.simulateTransaction({\n\t\t\ttransaction: tx,\n\t\t\tinclude: { commandResults: true, effects: true },\n\t\t});\n\n\t\tconst bytes = res.commandResults![0].returnValues[0].bcs;\n\t\tconst parsed_mid_price = Number(bcs.U64.parse(bytes));\n\t\tconst adjusted_mid_price =\n\t\t\t(parsed_mid_price * baseCoin.scalar) / quoteCoin.scalar / FLOAT_SCALAR;\n\n\t\treturn Number(adjusted_mid_price.toFixed(9));\n\t}\n\n\t/**\n\t * @description Get the trade parameters for a given pool, including taker fee, maker fee, and stake required.\n\t * @param {string} poolKey Key of the pool\n\t * @returns {Promise<{ takerFee: number, makerFee: number, stakeRequired: number }>}\n\t */\n\tasync poolTradeParams(poolKey: string) {\n\t\tconst tx = new Transaction();\n\n\t\ttx.add(this.deepBook.poolTradeParams(poolKey));\n\t\tconst res = await this.#client.core.simulateTransaction({\n\t\t\ttransaction: tx,\n\t\t\tinclude: { commandResults: true, effects: true },\n\t\t});\n\n\t\tconst takerFee = Number(bcs.U64.parse(res.commandResults![0].returnValues[0].bcs));\n\t\tconst makerFee = Number(bcs.U64.parse(res.commandResults![0].returnValues[1].bcs));\n\t\tconst stakeRequired = Number(bcs.U64.parse(res.commandResults![0].returnValues[2].bcs));\n\n\t\treturn {\n\t\t\ttakerFee: Number(takerFee / FLOAT_SCALAR),\n\t\t\tmakerFee: Number(makerFee / FLOAT_SCALAR),\n\t\t\tstakeRequired: Number(stakeRequired / DEEP_SCALAR),\n\t\t};\n\t}\n\n\t/**\n\t * @description Get the trade parameters for a given pool, including tick size, lot size, and min size.\n\t * @param {string} poolKey Key of the pool\n\t * @returns {Promise<{ tickSize: number, lotSize: number, minSize: number }>}\n\t */\n\tasync poolBookParams(poolKey: string) {\n\t\tconst tx = new Transaction();\n\t\tconst pool = this.#config.getPool(poolKey);\n\t\tconst baseScalar = this.#config.getCoin(pool.baseCoin).scalar;\n\t\tconst quoteScalar = this.#config.getCoin(pool.quoteCoin).scalar;\n\n\t\ttx.add(this.deepBook.poolBookParams(poolKey));\n\t\tconst res = await this.#client.core.simulateTransaction({\n\t\t\ttransaction: tx,\n\t\t\tinclude: { commandResults: true, effects: true },\n\t\t});\n\n\t\tconst tickSize = Number(bcs.U64.parse(res.commandResults![0].returnValues[0].bcs));\n\t\tconst lotSize = Number(bcs.U64.parse(res.commandResults![0].returnValues[1].bcs));\n\t\tconst minSize = Number(bcs.U64.parse(res.commandResults![0].returnValues[2].bcs));\n\n\t\treturn {\n\t\t\ttickSize: Number((tickSize * baseScalar) / quoteScalar / FLOAT_SCALAR),\n\t\t\tlotSize: Number(lotSize / baseScalar),\n\t\t\tminSize: Number(minSize / baseScalar),\n\t\t};\n\t}\n\n\t/**\n\t * @description Get the account information for a given pool and balance manager\n\t * @param {string} poolKey Key of the pool\n\t * @param {string} managerKey The key of the BalanceManager\n\t * @returns {Promise<Object>} A promise that resolves to an object containing the account information\n\t */\n\tasync account(poolKey: string, managerKey: string) {\n\t\tconst tx = new Transaction();\n\t\tconst pool = this.#config.getPool(poolKey);\n\t\tconst baseScalar = this.#config.getCoin(pool.baseCoin).scalar;\n\t\tconst quoteScalar = this.#config.getCoin(pool.quoteCoin).scalar;\n\n\t\ttx.add(this.deepBook.account(poolKey, managerKey));\n\t\tconst res = await this.#client.core.simulateTransaction({\n\t\t\ttransaction: tx,\n\t\t\tinclude: { commandResults: true, effects: true },\n\t\t});\n\n\t\tconst accountInformation = res.commandResults![0].returnValues[0].bcs;\n\t\tconst accountInfo = Account.parse(new Uint8Array(accountInformation));\n\n\t\treturn {\n\t\t\tepoch: accountInfo.epoch,\n\t\t\topen_orders: accountInfo.open_orders,\n\t\t\ttaker_volume: Number(accountInfo.taker_volume) / baseScalar,\n\t\t\tmaker_volume: Number(accountInfo.maker_volume) / baseScalar,\n\t\t\tactive_stake: Number(accountInfo.active_stake) / DEEP_SCALAR,\n\t\t\tinactive_stake: Number(accountInfo.inactive_stake) / DEEP_SCALAR,\n\t\t\tcreated_proposal: accountInfo.created_proposal,\n\t\t\tvoted_proposal: accountInfo.voted_proposal,\n\t\t\tunclaimed_rebates: {\n\t\t\t\tbase: Number(accountInfo.unclaimed_rebates.base) / baseScalar,\n\t\t\t\tquote: Number(accountInfo.unclaimed_rebates.quote) / quoteScalar,\n\t\t\t\tdeep: Number(accountInfo.unclaimed_rebates.deep) / DEEP_SCALAR,\n\t\t\t},\n\t\t\tsettled_balances: {\n\t\t\t\tbase: Number(accountInfo.settled_balances.base) / baseScalar,\n\t\t\t\tquote: Number(accountInfo.settled_balances.quote) / quoteScalar,\n\t\t\t\tdeep: Number(accountInfo.settled_balances.deep) / DEEP_SCALAR,\n\t\t\t},\n\t\t\towed_balances: {\n\t\t\t\tbase: Number(accountInfo.owed_balances.base) / baseScalar,\n\t\t\t\tquote: Number(accountInfo.owed_balances.quote) / quoteScalar,\n\t\t\t\tdeep: Number(accountInfo.owed_balances.deep) / DEEP_SCALAR,\n\t\t\t},\n\t\t};\n\t}\n\n\t/**\n\t * @description Get the locked balances for a pool and balance manager\n\t * @param {string} poolKey Key of the pool\n\t * @param {string} managerKey The key of the BalanceManager\n\t * @returns {Promise<{ base: number, quote: number, deep: number }>}\n\t * An object with base, quote, and deep locked for the balance manager in the pool\n\t */\n\tasync lockedBalance(poolKey: string, balanceManagerKey: string) {\n\t\tconst tx = new Transaction();\n\t\tconst pool = this.#config.getPool(poolKey);\n\t\tconst baseScalar = this.#config.getCoin(pool.baseCoin).scalar;\n\t\tconst quoteScalar = this.#config.getCoin(pool.quoteCoin).scalar;\n\n\t\ttx.add(this.deepBook.lockedBalance(poolKey, balanceManagerKey));\n\t\tconst res = await this.#client.core.simulateTransaction({\n\t\t\ttransaction: tx,\n\t\t\tinclude: { commandResults: true, effects: true },\n\t\t});\n\n\t\tconst baseLocked = Number(bcs.U64.parse(res.commandResults![0].returnValues[0].bcs));\n\t\tconst quoteLocked = Number(bcs.U64.parse(res.commandResults![0].returnValues[1].bcs));\n\t\tconst deepLocked = Number(bcs.U64.parse(res.commandResults![0].returnValues[2].bcs));\n\n\t\treturn {\n\t\t\tbase: Number((baseLocked / baseScalar).toFixed(9)),\n\t\t\tquote: Number((quoteLocked / quoteScalar).toFixed(9)),\n\t\t\tdeep: Number((deepLocked / DEEP_SCALAR).toFixed(9)),\n\t\t};\n\t}\n\n\t/**\n\t * @description Get the DEEP price conversion for a pool\n\t * @param {string} poolKey Key of the pool\n\t * @returns {Promise<{ asset_is_base: bool, deep_per_quote: number }>} Deep price conversion\n\t */\n\tasync getPoolDeepPrice(poolKey: string) {\n\t\tconst tx = new Transaction();\n\t\tconst pool = this.#config.getPool(poolKey);\n\t\ttx.add(this.deepBook.getPoolDeepPrice(poolKey));\n\n\t\tconst baseCoin = this.#config.getCoin(pool.baseCoin);\n\t\tconst quoteCoin = this.#config.getCoin(pool.quoteCoin);\n\t\tconst deepCoin = this.#config.getCoin('DEEP');\n\n\t\tconst res = await this.#client.core.simulateTransaction({\n\t\t\ttransaction: tx,\n\t\t\tinclude: { commandResults: true, effects: true },\n\t\t});\n\n\t\tconst poolDeepPriceBytes = res.commandResults![0].returnValues[0].bcs;\n\t\tconst poolDeepPrice = OrderDeepPrice.parse(new Uint8Array(poolDeepPriceBytes));\n\n\t\tif (poolDeepPrice.asset_is_base) {\n\t\t\treturn {\n\t\t\t\tasset_is_base: poolDeepPrice.asset_is_base,\n\t\t\t\tdeep_per_base:\n\t\t\t\t\t((Number(poolDeepPrice.deep_per_asset) / FLOAT_SCALAR) * baseCoin.scalar) /\n\t\t\t\t\tdeepCoin.scalar,\n\t\t\t};\n\t\t} else {\n\t\t\treturn {\n\t\t\t\tasset_is_base: poolDeepPrice.asset_is_base,\n\t\t\t\tdeep_per_quote:\n\t\t\t\t\t((Number(poolDeepPrice.deep_per_asset) / FLOAT_SCALAR) * quoteCoin.scalar) /\n\t\t\t\t\tdeepCoin.scalar,\n\t\t\t};\n\t\t}\n\t}\n\n\t/**\n\t * @description Decode the order ID to get bid/ask status, price, and orderId\n\t * @param {bigint} encodedOrderId Encoded order ID\n\t * @returns {Object} Object containing isBid, price, and orderId\n\t */\n\tdecodeOrderId(encodedOrderId: bigint): { isBid: boolean; price: number; orderId: number } {\n\t\tconst isBid = encodedOrderId >> 127n === 0n;\n\t\tconst price = Number((encodedOrderId >> 64n) & ((1n << 63n) - 1n));\n\t\tconst orderId = Number(encodedOrderId & ((1n << 64n) - 1n));\n\n\t\treturn { isBid, price, orderId };\n\t}\n\n\t/**\n\t * @description Get all balance manager IDs for a given owner\n\t * @param {string} owner The owner address to get balance manager IDs for\n\t * @returns {Promise<string[]>} Array of balance manager ID strings\n\t */\n\tasync getBalanceManagerIds(owner: string): Promise<string[]> {\n\t\tconst tx = new Transaction();\n\t\ttx.add(this.deepBook.getBalanceManagerIds(owner));\n\n\t\tconst res = await this.#client.core.simulateTransaction({\n\t\t\ttransaction: tx,\n\t\t\tinclude: { commandResults: true, effects: true },\n\t\t});\n\n\t\tconst bytes = res.commandResults![0].returnValues[0].bcs;\n\t\tconst vecOfAddresses = bcs.vector(bcs.Address).parse(bytes);\n\n\t\treturn vecOfAddresses.map((id: string) => normalizeSuiAddress(id));\n\t}\n\n\t/**\n\t * @description Get the owner of the referral (DeepBookPoolReferral)\n\t * @param {string} referral The ID of the referral to get the owner of\n\t * @returns {Promise<string>} The owner of the referral\n\t */\n\tasync balanceManagerReferralOwner(referral: string) {\n\t\tconst tx = new Transaction();\n\t\ttx.add(this.balanceManager.balanceManagerReferralOwner(referral));\n\n\t\tconst res = await this.#client.core.simulateTransaction({\n\t\t\ttransaction: tx,\n\t\t\tinclude: { commandResults: true, effects: true },\n\t\t});\n\n\t\tconst bytes = res.commandResults![0].returnValues[0].bcs;\n\t\tconst owner = bcs.Address.parse(bytes);\n\n\t\treturn owner;\n\t}\n\n\t/**\n\t * @description Get the referral balances for a pool and referral (DeepBookPoolReferral)\n\t * @param {string} poolKey Key of the pool\n\t * @param {string} referral The referral ID to get balances for\n\t * @returns {Promise<{ base: number, quote: number, deep: number }>} Object with base, quote, and deep balances\n\t */\n\tasync getPoolReferralBalances(\n\t\tpoolKey: string,\n\t\treferral: string,\n\t): Promise<{ base: number; quote: number; deep: number }> {\n\t\tconst tx = new Transaction();\n\t\tconst pool = this.#config.getPool(poolKey);\n\t\tconst baseScalar = this.#config.getCoin(pool.baseCoin).scalar;\n\t\tconst quoteScalar = this.#config.getCoin(pool.quoteCoin).scalar;\n\n\t\ttx.add(this.deepBook.getPoolReferralBalances(poolKey, referral));\n\n\t\tconst res = await this.#client.core.simulateTransaction({\n\t\t\ttransaction: tx,\n\t\t\tinclude: { commandResults: true, effects: true },\n\t\t});\n\n\t\t// The function returns three u64 values: (base, quote, deep)\n\t\tconst baseBytes = res.commandResults![0].returnValues[0].bcs;\n\t\tconst quoteBytes = res.commandResults![0].returnValues[1].bcs;\n\t\tconst deepBytes = res.commandResults![0].returnValues[2].bcs;\n\n\t\tconst baseBalance = Number(bcs.U64.parse(baseBytes));\n\t\tconst quoteBalance = Number(bcs.U64.parse(quoteBytes));\n\t\tconst deepBalance = Number(bcs.U64.parse(deepBytes));\n\n\t\treturn {\n\t\t\tbase: baseBalance / baseScalar,\n\t\t\tquote: quoteBalance / quoteScalar,\n\t\t\tdeep: deepBalance / DEEP_SCALAR,\n\t\t};\n\t}\n\n\t/**\n\t * @description Get the pool ID associated with a referral (DeepBookPoolReferral)\n\t * @param {string} referral The referral (DeepBookPoolReferral) to get the pool ID for\n\t * @returns {Promise<string>} The pool ID\n\t */\n\tasync balanceManagerReferralPoolId(referral: string): Promise<string> {\n\t\tconst tx = new Transaction();\n\n\t\ttx.add(this.balanceManager.balanceManagerReferralPoolId(referral));\n\n\t\tconst res = await this.#client.core.simulateTransaction({\n\t\t\ttransaction: tx,\n\t\t\tinclude: { commandResults: true, effects: true },\n\t\t});\n\n\t\tconst bytes = res.commandResults![0].returnValues[0].bcs;\n\t\tconst poolId = bcs.Address.parse(bytes);\n\n\t\treturn normalizeSuiAddress(poolId);\n\t}\n\n\t/**\n\t * @description Get the multiplier for a referral (DeepBookPoolReferral)\n\t * @param {string} poolKey Key of the pool\n\t * @param {string} referral The referral (DeepBookPoolReferral) to get the multiplier for\n\t * @returns {Promise<number>} The multiplier value\n\t */\n\tasync poolReferralMultiplier(poolKey: string, referral: string): Promise<number> {\n\t\tconst tx = new Transaction();\n\n\t\ttx.add(this.deepBook.poolReferralMultiplier(poolKey, referral));\n\n\t\tconst res = await this.#client.core.simulateTransaction({\n\t\t\ttransaction: tx,\n\t\t\tinclude: { commandResults: true, effects: true },\n\t\t});\n\n\t\tconst bytes = res.commandResults![0].returnValues[0].bcs;\n\t\tconst multiplier = Number(bcs.U64.parse(bytes));\n\n\t\treturn multiplier / FLOAT_SCALAR;\n\t}\n\n\t/**\n\t * @description Get the referral ID from a balance manager for a specific pool\n\t * @param {string} managerKey Key of the balance manager\n\t * @param {string} poolKey Key of the pool to get the referral for\n\t * @returns {Promise<string | null>} The referral ID or null if not set\n\t */\n\tasync getBalanceManagerReferralId(managerKey: string, poolKey: string): Promise<string | null> {\n\t\tconst tx = new Transaction();\n\t\ttx.add(this.balanceManager.getBalanceManagerReferralId(managerKey, poolKey));\n\n\t\tconst res = await this.#client.core.simulateTransaction({\n\t\t\ttransaction: tx,\n\t\t\tinclude: { commandResults: true, effects: true },\n\t\t});\n\n\t\ttry {\n\t\t\tconst bytes = res.commandResults![0].returnValues[0].bcs;\n\t\t\tconst optionId = bcs.option(bcs.Address).parse(bytes);\n\t\t\tif (optionId === null) {\n\t\t\t\treturn null;\n\t\t\t}\n\t\t\treturn normalizeSuiAddress(optionId);\n\t\t} catch {\n\t\t\treturn null;\n\t\t}\n\t}\n\n\tasync getPriceInfoObject(tx: Transaction, coinKey: string): Promise<string> {\n\t\tconst currentTime = Date.now();\n\t\tconst priceInfoObjectAge = await this.getPriceInfoObjectAge(coinKey);\n\t\tif (\n\t\t\tpriceInfoObjectAge &&\n\t\t\tcurrentTime - priceInfoObjectAge * 1000 < PRICE_INFO_OBJECT_MAX_AGE_MS\n\t\t) {\n\t\t\treturn await this.#config.getCoin(coinKey).priceInfoObjectId!;\n\t\t}\n\n\t\t// Initialize connection to the Sui Price Service\n\t\tconst endpoint =\n\t\t\tthis.#config.network === 'testnet'\n\t\t\t\t? 'https://hermes-beta.pyth.network'\n\t\t\t\t: 'https://hermes.pyth.network';\n\t\tconst connection = new SuiPriceServiceConnection(endpoint);\n\n\t\t// List of price feed IDs\n\t\tconst priceIDs = [\n\t\t\tthis.#config.getCoin(coinKey).feed!, // ASSET/USD price ID\n\t\t];\n\n\t\t// Fetch price feed update data\n\t\tconst priceUpdateData = await connection.getPriceFeedsUpdateData(priceIDs);\n\n\t\t// Initialize Sui Client and Pyth Client\n\t\tconst wormholeStateId = this.#config.pyth.wormholeStateId;\n\t\tconst pythStateId = this.#config.pyth.pythStateId;\n\n\t\tconst client = new SuiPythClient(this.#client, pythStateId, wormholeStateId);\n\n\t\treturn (await client.updatePriceFeeds(tx, priceUpdateData, priceIDs))[0]; // returns priceInfoObjectIds\n\t}\n\n\t/**\n\t * @description Get the age of the price info object for a specific coin\n\t * @param {string} coinKey Key of the coin\n\t * @returns {Promise<number>} The arrival time of the price info object\n\t */\n\tasync getPriceInfoObjectAge(coinKey: string) {\n\t\tconst priceInfoObjectId = this.#config.getCoin(coinKey).priceInfoObjectId!;\n\t\tconst res = await this.#client.core.getObject({\n\t\t\tobjectId: priceInfoObjectId,\n\t\t\tinclude: {\n\t\t\t\tcontent: true,\n\t\t\t},\n\t\t});\n\n\t\tif (!res.object?.content) {\n\t\t\tthrow new Error(`Price info object not found for ${coinKey}`);\n\t\t}\n\n\t\tconst priceInfoObject = PriceInfoObject.parse(res.object.content);\n\t\treturn Number(priceInfoObject.price_info.arrival_time);\n\t}\n\n\t// === Margin Pool View Methods ===\n\n\t/**\n\t * @description Get the margin pool ID\n\t * @param {string} coinKey The key to identify the margin pool\n\t * @returns {Promise<string>} The margin pool ID\n\t */\n\tasync getMarginPoolId(coinKey: string): Promise<string> {\n\t\tconst tx = new Transaction();\n\t\ttx.add(this.marginPool.getId(coinKey));\n\n\t\tconst res = await this.#client.core.simulateTransaction({\n\t\t\ttransaction: tx,\n\t\t\tinclude: { commandResults: true, effects: true },\n\t\t});\n\n\t\tconst bytes = res.commandResults![0].returnValues[0].bcs;\n\t\treturn bcs.Address.parse(bytes);\n\t}\n\n\t/**\n\t * @description Check if a deepbook pool is allowed for borrowing from margin pool\n\t * @param {string} coinKey The key to identify the margin pool\n\t * @param {string} deepbookPoolId The ID of the deepbook pool\n\t * @returns {Promise<boolean>} Whether the deepbook pool is allowed\n\t */\n\tasync isDeepbookPoolAllowed(coinKey: string, deepbookPoolId: string): Promise<boolean> {\n\t\tconst tx = new Transaction();\n\t\ttx.add(this.marginPool.deepbookPoolAllowed(coinKey, deepbookPoolId));\n\n\t\tconst res = await this.#client.core.simulateTransaction({\n\t\t\ttransaction: tx,\n\t\t\tinclude: { commandResults: true, effects: true },\n\t\t});\n\n\t\tconst bytes = res.commandResults![0].returnValues[0].bcs;\n\t\treturn bcs.bool().parse(bytes);\n\t}\n\n\t/**\n\t * @description Get the total supply amount in the margin pool\n\t * @param {string} coinKey The key to identify the margin pool\n\t * @param {number} decimals Number of decimal places to show (default: 6)\n\t * @returns {Promise<string>} The total supply amount as a string\n\t */\n\tasync getMarginPoolTotalSupply(coinKey: string, decimals: number = 6): Promise<string> {\n\t\tconst tx = new Transaction();\n\t\ttx.add(this.marginPool.totalSupply(coinKey));\n\n\t\tconst res = await this.#client.core.simulateTransaction({\n\t\t\ttransaction: tx,\n\t\t\tinclude: { commandResults: true, effects: true },\n\t\t});\n\n\t\tconst bytes = res.commandResults![0].returnValues[0].bcs;\n\t\tconst rawAmount = BigInt(bcs.U64.parse(bytes));\n\t\tconst coin = this.#config.getCoin(coinKey);\n\t\treturn this.#formatTokenAmount(rawAmount, coin.scalar, decimals);\n\t}\n\n\t/**\n\t * @description Get the total supply shares in the margin pool\n\t * @param {string} coinKey The key to identify the margin pool\n\t * @param {number} decimals Number of decimal places to show (default: 6)\n\t * @returns {Promise<string>} The total supply shares as a string\n\t */\n\tasync getMarginPoolSupplyShares(coinKey: string, decimals: number = 6): Promise<string> {\n\t\tconst tx = new Transaction();\n\t\ttx.add(this.marginPool.supplyShares(coinKey));\n\n\t\tconst res = await this.#client.core.simulateTransaction({\n\t\t\ttransaction: tx,\n\t\t\tinclude: { commandResults: true, effects: true },\n\t\t});\n\n\t\tconst bytes = res.commandResults![0].returnValues[0].bcs;\n\t\tconst rawShares = BigInt(bcs.U64.parse(bytes));\n\t\tconst coin = this.#config.getCoin(coinKey);\n\t\treturn this.#formatTokenAmount(rawShares, coin.scalar, decimals);\n\t}\n\n\t/**\n\t * @description Get the total borrow amount in the margin pool\n\t * @param {string} coinKey The key to identify the margin pool\n\t * @param {number} decimals Number of decimal places to show (default: 6)\n\t * @returns {Promise<string>} The total borrow amount as a string\n\t */\n\tasync getMarginPoolTotalBorrow(coinKey: string, decimals: number = 6): Promise<string> {\n\t\tconst tx = new Transaction();\n\t\ttx.add(this.marginPool.totalBorrow(coinKey));\n\n\t\tconst res = await this.#client.core.simulateTransaction({\n\t\t\ttransaction: tx,\n\t\t\tinclude: { commandResults: true, effects: true },\n\t\t});\n\n\t\tconst bytes = res.commandResults![0].returnValues[0].bcs;\n\t\tconst rawAmount = BigInt(bcs.U64.parse(bytes));\n\t\tconst coin = this.#config.getCoin(coinKey);\n\t\treturn this.#formatTokenAmount(rawAmount, coin.scalar, decimals);\n\t}\n\n\t/**\n\t * @description Get the total borrow shares in the margin pool\n\t * @param {string} coinKey The key to identify the margin pool\n\t * @param {number} decimals Number of decimal places to show (default: 6)\n\t * @returns {Promise<string>} The total borrow shares as a string\n\t */\n\tasync getMarginPoolBorrowShares(coinKey: string, decimals: number = 6): Promise<string> {\n\t\tconst tx = new Transaction();\n\t\ttx.add(this.marginPool.borrowShares(coinKey));\n\n\t\tconst res = await this.#client.core.simulateTransaction({\n\t\t\ttransaction: tx,\n\t\t\tinclude: { commandResults: true, effects: true },\n\t\t});\n\n\t\tconst bytes = res.commandResults![0].returnValues[0].bcs;\n\t\tconst rawShares = BigInt(bcs.U64.parse(bytes));\n\t\tconst coin = this.#config.getCoin(coinKey);\n\t\treturn this.#formatTokenAmount(rawShares, coin.scalar, decimals);\n\t}\n\n\t/**\n\t * @description Get the last update timestamp of the margin pool\n\t * @param {string} coinKey The key to identify the margin pool\n\t * @returns {Promise<number>} The last update timestamp in milliseconds\n\t */\n\tasync getMarginPoolLastUpdateTimestamp(coinKey: string): Promise<number> {\n\t\tconst tx = new Transaction();\n\t\ttx.add(this.marginPool.lastUpdateTimestamp(coinKey));\n\n\t\tconst res = await this.#client.core.simulateTransaction({\n\t\t\ttransaction: tx,\n\t\t\tinclude: { commandResults: true, effects: true },\n\t\t});\n\n\t\tconst bytes = res.commandResults![0].returnValues[0].bcs;\n\t\treturn Number(bcs.U64.parse(bytes));\n\t}\n\n\t/**\n\t * @description Get the supply cap of the margin pool\n\t * @param {string} coinKey The key to identify the margin pool\n\t * @param {number} decimals Number of decimal places to show (default: 6)\n\t * @returns {Promise<string>} The supply cap as a string\n\t */\n\tasync getMarginPoolSupplyCap(coinKey: string, decimals: number = 6): Promise<string> {\n\t\tconst tx = new Transaction();\n\t\ttx.add(this.marginPool.supplyCap(coinKey));\n\n\t\tconst res = await this.#client.core.simulateTransaction({\n\t\t\ttransaction: tx,\n\t\t\tinclude: { commandResults: true, effects: true },\n\t\t});\n\n\t\tconst bytes = res.commandResults![0].returnValues[0].bcs;\n\t\tconst rawAmount = BigInt(bcs.U64.parse(bytes));\n\t\tconst coin = this.#config.getCoin(coinKey);\n\t\treturn this.#formatTokenAmount(rawAmount, coin.scalar, decimals);\n\t}\n\n\t/**\n\t * @description Get the max utilization rate of the margin pool\n\t * @param {string} coinKey The key to identify the margin pool\n\t * @returns {Promise<number>} The max utilization rate (as a decimal, e.g., 0.95 for 95%)\n\t */\n\tasync getMarginPoolMaxUtilizationRate(coinKey: string): Promise<number> {\n\t\tconst tx = new Transaction();\n\t\ttx.add(this.marginPool.maxUtilizationRate(coinKey));\n\n\t\tconst res = await this.#client.core.simulateTransaction({\n\t\t\ttransaction: tx,\n\t\t\tinclude: { commandResults: true, effects: true },\n\t\t});\n\n\t\tconst bytes = res.commandResults![0].returnValues[0].bcs;\n\t\tconst rawRate = Number(bcs.U64.parse(bytes));\n\t\treturn rawRate / FLOAT_SCALAR;\n\t}\n\n\t/**\n\t * @description Get the protocol spread of the margin pool\n\t * @param {string} coinKey The key to identify the margin pool\n\t * @returns {Promise<number>} The protocol spread (as a decimal)\n\t */\n\tasync getMarginPoolProtocolSpread(coinKey: string): Promise<number> {\n\t\tconst tx = new Transaction();\n\t\ttx.add(this.marginPool.protocolSpread(coinKey));\n\n\t\tconst res = await this.#client.core.simulateTransaction({\n\t\t\ttransaction: tx,\n\t\t\tinclude: { commandResults: true, effects: true },\n\t\t});\n\n\t\tconst bytes = res.commandResults![0].returnValues[0].bcs;\n\t\tconst rawSpread = Number(bcs.U64.parse(bytes));\n\t\treturn rawSpread / FLOAT_SCALAR;\n\t}\n\n\t/**\n\t * @description Get the minimum borrow amount for the margin pool\n\t * @param {string} coinKey The key to identify the margin pool\n\t * @param {number} decimals Number of decimal places to show (default: 6)\n\t * @returns {Promise<string>} The minimum borrow amount as a string\n\t */\n\tasync getMarginPoolMinBorrow(coinKey: string, decimals: number = 6): Promise<string> {\n\t\tconst tx = new Transaction();\n\t\ttx.add(this.marginPool.minBorrow(coinKey));\n\n\t\tconst res = await this.#client.core.simulateTransaction({\n\t\t\ttransaction: tx,\n\t\t\tinclude: { commandResults: true, effects: true },\n\t\t});\n\n\t\tconst bytes = res.commandResults![0].returnValues[0].bcs;\n\t\tconst rawAmount = BigInt(bcs.U64.parse(bytes));\n\t\tconst coin = this.#config.getCoin(coinKey);\n\t\treturn this.#formatTokenAmount(rawAmount, coin.scalar, decimals);\n\t}\n\n\t/**\n\t * @description Get the current interest rate of the margin pool\n\t * @param {string} coinKey The key to identify the margin pool\n\t * @returns {Promise<number>} The current interest rate (as a decimal)\n\t */\n\tasync getMarginPoolInterestRate(coinKey: string): Promise<number> {\n\t\tconst tx = new Transaction();\n\t\ttx.add(this.marginPool.interestRate(coinKey));\n\n\t\tconst res = await this.#client.core.simulateTransaction({\n\t\t\ttransaction: tx,\n\t\t\tinclude: { commandResults: true, effects: true },\n\t\t});\n\n\t\tconst bytes = res.commandResults![0].returnValues[0].bcs;\n\t\tconst rawRate = Number(bcs.U64.parse(bytes));\n\t\treturn rawRate / FLOAT_SCALAR;\n\t}\n\n\t/**\n\t * @description Get user supply shares for a supplier cap\n\t * @param {string} coinKey The key to identify the margin pool\n\t * @param {string} supplierCapId The ID of the supplier cap\n\t * @param {number} decimals Number of decimal places to show (default: 6)\n\t * @returns {Promise<string>} The user's supply shares as a string\n\t */\n\tasync getUserSupplyShares(\n\t\tcoinKey: string,\n\t\tsupplierCapId: string,\n\t\tdecimals: number = 6,\n\t): Promise<string> {\n\t\tconst tx = new Transaction();\n\t\ttx.add(this.marginPool.userSupplyShares(coinKey, supplierCapId));\n\n\t\tconst res = await this.#client.core.simulateTransaction({\n\t\t\ttransaction: tx,\n\t\t\tinclude: { commandResults: true, effects: true },\n\t\t});\n\n\t\tconst bytes = res.commandResults![0].returnValues[0].bcs;\n\t\tconst rawShares = BigInt(bcs.U64.parse(bytes));\n\t\tconst coin = this.#config.getCoin(coinKey);\n\t\treturn this.#formatTokenAmount(rawShares, coin.scalar, decimals);\n\t}\n\n\t/**\n\t * @description Get user supply amount for a supplier cap\n\t * @param {string} coinKey The key to identify the margin pool\n\t * @param {string} supplierCapId The ID of the supplier cap\n\t * @param {number} decimals Number of decimal places to show (default: 6)\n\t * @returns {Promise<string>} The user's supply amount as a string\n\t */\n\tasync getUserSupplyAmount(\n\t\tcoinKey: string,\n\t\tsupplierCapId: string,\n\t\tdecimals: number = 6,\n\t): Promise<string> {\n\t\tconst tx = new Transaction();\n\t\ttx.add(this.marginPool.userSupplyAmount(coinKey, supplierCapId));\n\n\t\tconst res = await this.#client.core.simulateTransaction({\n\t\t\ttransaction: tx,\n\t\t\tinclude: { commandResults: true, effects: true },\n\t\t});\n\n\t\tconst bytes = res.commandResults![0].returnValues[0].bcs;\n\t\tconst rawAmount = BigInt(bcs.U64.parse(bytes));\n\t\tconst coin = this.#config.getCoin(coinKey);\n\t\treturn this.#formatTokenAmount(rawAmount, coin.scalar, decimals);\n\t}\n\n\t// === Margin Manager Read-Only Functions ===\n\n\t/**\n\t * @description Get the owner address of a margin manager\n\t * @param {string} marginManagerKey The key to identify the margin manager\n\t * @returns {Promise<string>} The owner address\n\t */\n\tasync getMarginManagerOwner(marginManagerKey: string): Promise<string> {\n\t\tconst manager = this.#config.getMarginManager(marginManagerKey);\n\t\tconst tx = new Transaction();\n\t\ttx.add(this.marginManager.ownerByPoolKey(manager.poolKey, manager.address));\n\n\t\tconst res = await this.#client.core.simulateTransaction({\n\t\t\ttransaction: tx,\n\t\t\tinclude: { commandResults: true, effects: true },\n\t\t});\n\n\t\tconst bytes = res.commandResults![0].returnValues[0].bcs;\n\t\treturn normalizeSuiAddress(bcs.Address.parse(bytes));\n\t}\n\n\t/**\n\t * @description Get the DeepBook pool ID associated with a margin manager\n\t * @param {string} marginManagerKey The key to identify the margin manager\n\t * @returns {Promise<string>} The DeepBook pool ID\n\t */\n\tasync getMarginManagerDeepbookPool(marginManagerKey: string): Promise<string> {\n\t\tconst manager = this.#config.getMarginManager(marginManagerKey);\n\t\tconst tx = new Transaction();\n\t\ttx.add(this.marginManager.deepbookPool(manager.poolKey, manager.address));\n\n\t\tconst res = await this.#client.core.simulateTransaction({\n\t\t\ttransaction: tx,\n\t\t\tinclude: { commandResults: true, effects: true },\n\t\t});\n\n\t\tconst bytes = res.commandResults![0].returnValues[0].bcs;\n\t\treturn normalizeSuiAddress(bcs.Address.parse(bytes));\n\t}\n\n\t/**\n\t * @description Get the margin pool ID (if any) associated with a margin manager\n\t * @param {string} marginManagerKey The key to identify the margin manager\n\t * @returns {Promise<string | null>} The margin pool ID or null if no active loan\n\t */\n\tasync getMarginManagerMarginPoolId(marginManagerKey: string): Promise<string | null> {\n\t\tconst manager = this.#config.getMarginManager(marginManagerKey);\n\t\tconst tx = new Transaction();\n\t\ttx.add(this.marginManager.marginPoolId(manager.poolKey, manager.address));\n\n\t\tconst res = await this.#client.core.simulateTransaction({\n\t\t\ttransaction: tx,\n\t\t\tinclude: { commandResults: true, effects: true },\n\t\t});\n\n\t\tconst bytes = res.commandResults![0].returnValues[0].bcs;\n\t\tconst option = bcs.option(bcs.Address).parse(bytes);\n\t\treturn option ? normalizeSuiAddress(option) : null;\n\t}\n\n\t/**\n\t * @description Get borrowed shares for both base and quote assets\n\t * @param {string} marginManagerKey The key to identify the margin manager\n\t * @returns {Promise<{baseShares: string, quoteShares: string}>} The borrowed shares\n\t */\n\tasync getMarginManagerBorrowedShares(\n\t\tmarginManagerKey: string,\n\t): Promise<{ baseShares: string; quoteShares: string }> {\n\t\tconst manager = this.#config.getMarginManager(marginManagerKey);\n\t\tconst tx = new Transaction();\n\t\ttx.add(this.marginManager.borrowedShares(manager.poolKey, manager.address));\n\n\t\tconst res = await this.#client.core.simulateTransaction({\n\t\t\ttransaction: tx,\n\t\t\tinclude: { commandResults: true, effects: true },\n\t\t});\n\n\t\tconst baseBytes = res.commandResults![0].returnValues[0].bcs;\n\t\tconst quoteBytes = res.commandResults![0].returnValues[1].bcs;\n\t\tconst baseShares = bcs.U64.parse(baseBytes).toString();\n\t\tconst quoteShares = bcs.U64.parse(quoteBytes).toString();\n\n\t\treturn { baseShares, quoteShares };\n\t}\n\n\t/**\n\t * @description Get borrowed base shares\n\t * @param {string} marginManagerKey The key to identify the margin manager\n\t * @returns {Promise<string>} The borrowed base shares\n\t */\n\tasync getMarginManagerBorrowedBaseShares(marginManagerKey: string): Promise<string> {\n\t\tconst manager = this.#config.getMarginManager(marginManagerKey);\n\t\tconst tx = new Transaction();\n\t\ttx.add(this.marginManager.borrowedBaseShares(manager.poolKey, manager.address));\n\n\t\tconst res = await this.#client.core.simulateTransaction({\n\t\t\ttransaction: tx,\n\t\t\tinclude: { commandResults: true, effects: true },\n\t\t});\n\n\t\tconst bytes = res.commandResults![0].returnValues[0].bcs;\n\t\treturn bcs.U64.parse(bytes).toString();\n\t}\n\n\t/**\n\t * @description Get borrowed quote shares\n\t * @param {string} marginManagerKey The key to identify the margin manager\n\t * @returns {Promise<string>} The borrowed quote shares\n\t */\n\tasync getMarginManagerBorrowedQuoteShares(marginManagerKey: string): Promise<string> {\n\t\tconst manager = this.#config.getMarginManager(marginManagerKey);\n\t\tconst tx = new Transaction();\n\t\ttx.add(this.marginManager.borrowedQuoteShares(manager.poolKey, manager.address));\n\n\t\tconst res = await this.#client.core.simulateTransaction({\n\t\t\ttransaction: tx,\n\t\t\tinclude: { commandResults: true, effects: true },\n\t\t});\n\n\t\tconst bytes = res.commandResults![0].returnValues[0].bcs;\n\t\treturn bcs.U64.parse(bytes).toString();\n\t}\n\n\t/**\n\t * @description Check if margin manager has base asset debt\n\t * @param {string} marginManagerKey The key to identify the margin manager\n\t * @returns {Promise<boolean>} True if has base debt, false otherwise\n\t */\n\tasync getMarginManagerHasBaseDebt(marginManagerKey: string): Promise<boolean> {\n\t\tconst manager = this.#config.getMarginManager(marginManagerKey);\n\t\tconst tx = new Transaction();\n\t\ttx.add(this.marginManager.hasBaseDebt(manager.poolKey, manager.address));\n\n\t\tconst res = await this.#client.core.simulateTransaction({\n\t\t\ttransaction: tx,\n\t\t\tinclude: { commandResults: true, effects: true },\n\t\t});\n\n\t\tconst bytes = res.commandResults![0].returnValues[0].bcs;\n\t\treturn bcs.bool().parse(bytes);\n\t}\n\n\t/**\n\t * @description Get the balance manager ID for a margin manager\n\t * @param {string} marginManagerKey The key to identify the margin manager\n\t * @returns {Promise<string>} The balance manager ID\n\t */\n\tasync getMarginManagerBalanceManagerId(marginManagerKey: string): Promise<string> {\n\t\tconst manager = this.#config.getMarginManager(marginManagerKey);\n\t\tconst tx = new Transaction();\n\t\ttx.add(this.marginManager.balanceManager(manager.poolKey, manager.address));\n\n\t\tconst res = await this.#client.core.simulateTransaction({\n\t\t\ttransaction: tx,\n\t\t\tinclude: { commandResults: true, effects: true },\n\t\t});\n\n\t\tconst bytes = res.commandResults![0].returnValues[0].bcs;\n\t\treturn normalizeSuiAddress(bcs.Address.parse(bytes));\n\t}\n\n\t/**\n\t * @description Calculate assets (base and quote) for a margin manager\n\t * @param {string} marginManagerKey The key to identify the margin manager\n\t * @param {number} decimals Number of decimal places to show (default: 6)\n\t * @returns {Promise<{baseAsset: string, quoteAsset: string}>} The base and quote assets\n\t */\n\tasync getMarginManagerAssets(\n\t\tmarginManagerKey: string,\n\t\tdecimals: number = 6,\n\t): Promise<{ baseAsset: string; quoteAsset: string }> {\n\t\tconst manager = this.#config.getMarginManager(marginManagerKey);\n\t\tconst tx = new Transaction();\n\t\ttx.add(this.marginManager.calculateAssets(manager.poolKey, manager.address));\n\n\t\tconst res = await this.#client.core.simulateTransaction({\n\t\t\ttransaction: tx,\n\t\t\tinclude: { commandResults: true, effects: true },\n\t\t});\n\n\t\tconst baseBytes = res.commandResults![0].returnValues[0].bcs;\n\t\tconst quoteBytes = res.commandResults![0].returnValues[1].bcs;\n\t\tconst pool = this.#config.getPool(manager.poolKey);\n\t\tconst baseCoin = this.#config.getCoin(pool.baseCoin);\n\t\tconst quoteCoin = this.#config.getCoin(pool.quoteCoin);\n\n\t\tconst baseAsset = this.#formatTokenAmount(\n\t\t\tBigInt(bcs.U64.parse(baseBytes)),\n\t\t\tbaseCoin.scalar,\n\t\t\tdecimals,\n\t\t);\n\t\tconst quoteAsset = this.#formatTokenAmount(\n\t\t\tBigInt(bcs.U64.parse(quoteBytes)),\n\t\t\tquoteCoin.scalar,\n\t\t\tdecimals,\n\t\t);\n\n\t\treturn { baseAsset, quoteAsset };\n\t}\n\n\t/**\n\t * @description Calculate debts (base and quote) for a margin manager\n\t * NOTE: This function automatically determines whether to use base or quote margin pool\n\t * based on hasBaseDebt. You don't need to specify the debt coin type.\n\t * @param {string} marginManagerKey The key to identify the margin manager\n\t * @param {number} decimals Number of decimal places to show (default: 6)\n\t * @returns {Promise<{baseDebt: string, quoteDebt: string}>} The base and quote debts\n\t */\n\tasync getMarginManagerDebts(\n\t\tmarginManagerKey: string,\n\t\tdecimals: number = 6,\n\t): Promise<{ baseDebt: string; quoteDebt: string }> {\n\t\t// First check if the margin manager has base debt\n\t\tconst hasBaseDebt = await this.getMarginManagerHasBaseDebt(marginManagerKey);\n\n\t\t// Get the manager and pool configuration\n\t\tconst manager = this.#config.getMarginManager(marginManagerKey);\n\t\tconst pool = this.#config.getPool(manager.poolKey);\n\t\tconst debtCoinKey = hasBaseDebt ? pool.baseCoin : pool.quoteCoin;\n\n\t\t// Now call calculateDebts with the correct debt coin\n\t\tconst tx = new Transaction();\n\t\ttx.add(this.marginManager.calculateDebts(manager.poolKey, debtCoinKey, manager.address));\n\n\t\tconst res = await this.#client.core.simulateTransaction({\n\t\t\ttransaction: tx,\n\t\t\tinclude: { commandResults: true, effects: true },\n\t\t});\n\n\t\tif (res.FailedTransaction) {\n\t\t\tthrow new Error(\n\t\t\t\t`Transaction failed: ${res.FailedTransaction.status.error?.message || 'Unknown error'}`,\n\t\t\t);\n\t\t}\n\n\t\tif (!res.commandResults || !res.commandResults[0] || !res.commandResults[0].returnValues) {\n\t\t\tthrow new Error(`Failed to get margin manager debts: ${'Unknown error'}`);\n\t\t}\n\n\t\t// The Move function returns a tuple (u64, u64), so returnValues has 2 elements\n\t\tconst baseBytes = res.commandResults[0].returnValues[0].bcs;\n\t\tconst quoteBytes = res.commandResults[0].returnValues[1].bcs;\n\t\tconst debtCoin = this.#config.getCoin(debtCoinKey);\n\n\t\tconst baseDebt = this.#formatTokenAmount(\n\t\t\tBigInt(bcs.U64.parse(baseBytes)),\n\t\t\tdebtCoin.scalar,\n\t\t\tdecimals,\n\t\t);\n\t\tconst quoteDebt = this.#formatTokenAmount(\n\t\t\tBigInt(bcs.U64.parse(quoteBytes)),\n\t\t\tdebtCoin.scalar,\n\t\t\tdecimals,\n\t\t);\n\n\t\treturn { baseDebt, quoteDebt };\n\t}\n\n\t/**\n\t * @description Get comprehensive state information for a margin manager\n\t * @param {string} marginManagerKey The key to identify the margin manager\n\t * @param {number} decimals Number of decimal places to show (default: 6)\n\t * @returns {Promise<{\n\t * managerId: string,\n\t * deepbookPoolId: string,\n\t * riskRatio: number,\n\t * baseAsset: string,\n\t * quoteAsset: string,\n\t * baseDebt: string,\n\t * quoteDebt: string,\n\t * basePythPrice: string,\n\t * basePythDecimals: number,\n\t * quotePythPrice: string,\n\t * quotePythDecimals: number\n\t * }>} Comprehensive margin manager state\n\t */\n\tasync getMarginManagerState(\n\t\tmarginManagerKey: string,\n\t\tdecimals: number = 6,\n\t): Promise<{\n\t\tmanagerId: string;\n\t\tdeepbookPoolId: string;\n\t\triskRatio: number;\n\t\tbaseAsset: string;\n\t\tquoteAsset: string;\n\t\tbaseDebt: string;\n\t\tquoteDebt: string;\n\t\tbasePythPrice: string;\n\t\tbasePythDecimals: number;\n\t\tquotePythPrice: string;\n\t\tquotePythDecimals: number;\n\t\tcurrentPrice: bigint;\n\t\tlowestTriggerAbovePrice: bigint;\n\t\thighestTriggerBelowPrice: bigint;\n\t}> {\n\t\tconst manager = this.#config.getMarginManager(marginManagerKey);\n\t\tconst tx = new Transaction();\n\t\ttx.add(this.marginManager.managerState(manager.poolKey, manager.address));\n\n\t\tconst res = await this.#client.core.simulateTransaction({\n\t\t\ttransaction: tx,\n\t\t\tinclude: { commandResults: true, effects: true },\n\t\t});\n\n\t\tif (res.FailedTransaction) {\n\t\t\tthrow new Error(\n\t\t\t\t`Transaction failed: ${res.FailedTransaction.status.error?.message || 'Unknown error'}`,\n\t\t\t);\n\t\t}\n\n\t\tif (!res.commandResults || !res.commandResults[0] || !res.commandResults[0].returnValues) {\n\t\t\tthrow new Error(`Failed to get margin manager state: Unknown error`);\n\t\t}\n\n\t\tconst pool = this.#config.getPool(manager.poolKey);\n\t\tconst baseCoin = this.#config.getCoin(pool.baseCoin);\n\t\tconst quoteCoin = this.#config.getCoin(pool.quoteCoin);\n\n\t\t// Parse all 11 return values\n\t\tconst managerId = normalizeSuiAddress(\n\t\t\tbcs.Address.parse(res.commandResults[0].returnValues[0].bcs),\n\t\t);\n\t\tconst deepbookPoolId = normalizeSuiAddress(\n\t\t\tbcs.Address.parse(res.commandResults[0].returnValues[1].bcs),\n\t\t);\n\t\tconst riskRatio =\n\t\t\tNumber(bcs.U64.parse(res.commandResults[0].returnValues[2].bcs)) / FLOAT_SCALAR;\n\t\tconst baseAsset = this.#formatTokenAmount(\n\t\t\tBigInt(bcs.U64.parse(res.commandResults[0].returnValues[3].bcs)),\n\t\t\tbaseCoin.scalar,\n\t\t\tdecimals,\n\t\t);\n\t\tconst quoteAsset = this.#formatTokenAmount(\n\t\t\tBigInt(bcs.U64.parse(res.commandResults[0].returnValues[4].bcs)),\n\t\t\tquoteCoin.scalar,\n\t\t\tdecimals,\n\t\t);\n\t\tconst baseDebt = this.#formatTokenAmount(\n\t\t\tBigInt(bcs.U64.parse(res.commandResults[0].returnValues[5].bcs)),\n\t\t\tbaseCoin.scalar,\n\t\t\tdecimals,\n\t\t);\n\t\tconst quoteDebt = this.#formatTokenAmount(\n\t\t\tBigInt(bcs.U64.parse(res.commandResults[0].returnValues[6].bcs)),\n\t\t\tquoteCoin.scalar,\n\t\t\tdecimals,\n\t\t);\n\t\tconst basePythPrice = bcs.U64.parse(res.commandResults[0].returnValues[7].bcs);\n\t\tconst basePythDecimals = Number(\n\t\t\tbcs.u8().parse(new Uint8Array(res.commandResults[0].returnValues[8].bcs)),\n\t\t);\n\t\tconst quotePythPrice = bcs.U64.parse(res.commandResults[0].returnValues[9].bcs);\n\t\tconst quotePythDecimals = Number(\n\t\t\tbcs.u8().parse(new Uint8Array(res.commandResults[0].returnValues[10].bcs)),\n\t\t);\n\t\tconst currentPrice = BigInt(bcs.U64.parse(res.commandResults[0].returnValues[11].bcs));\n\t\tconst lowestTriggerAbovePrice = BigInt(\n\t\t\tbcs.U64.parse(res.commandResults[0].returnValues[12].bcs),\n\t\t);\n\t\tconst highestTriggerBelowPrice = BigInt(\n\t\t\tbcs.U64.parse(res.commandResults[0].returnValues[13].bcs),\n\t\t);\n\n\t\treturn {\n\t\t\tmanagerId,\n\t\t\tdeepbookPoolId,\n\t\t\triskRatio,\n\t\t\tbaseAsset,\n\t\t\tquoteAsset,\n\t\t\tbaseDebt,\n\t\t\tquoteDebt,\n\t\t\tbasePythPrice: basePythPrice.toString(),\n\t\t\tbasePythDecimals,\n\t\t\tquotePythPrice: quotePythPrice.toString(),\n\t\t\tquotePythDecimals,\n\t\t\tcurrentPrice,\n\t\t\tlowestTriggerAbovePrice,\n\t\t\thighestTriggerBelowPrice,\n\t\t};\n\t}\n\n\t/**\n\t * @description Get the base asset balance of a margin manager\n\t * @param {string} marginManagerKey The key to identify the margin manager\n\t * @param {number} decimals Number of decimal places to show (default: 6)\n\t * @returns {Promise<string>} The base asset balance\n\t */\n\tasync getMarginManagerBaseBalance(\n\t\tmarginManagerKey: string,\n\t\tdecimals: number = 9,\n\t): Promise<string> {\n\t\tconst manager = this.#config.getMarginManager(marginManagerKey);\n\t\tconst tx = new Transaction();\n\t\ttx.add(this.marginManager.baseBalance(manager.poolKey, manager.address));\n\n\t\tconst res = await this.#client.core.simulateTransaction({\n\t\t\ttransaction: tx,\n\t\t\tinclude: { commandResults: true, effects: true },\n\t\t});\n\n\t\tif (res.FailedTransaction) {\n\t\t\tthrow new Error(\n\t\t\t\t`Transaction failed: ${res.FailedTransaction.status.error?.message || 'Unknown error'}`,\n\t\t\t);\n\t\t}\n\n\t\tif (!res.commandResults || !res.commandResults[0] || !res.commandResults[0].returnValues) {\n\t\t\tthrow new Error(`Failed to get margin manager base balance: Unknown error`);\n\t\t}\n\n\t\tconst bytes = res.commandResults[0].returnValues[0].bcs;\n\t\tconst pool = this.#config.getPool(manager.poolKey);\n\t\tconst baseCoin = this.#config.getCoin(pool.baseCoin);\n\n\t\treturn this.#formatTokenAmount(BigInt(bcs.U64.parse(bytes)), baseCoin.scalar, decimals);\n\t}\n\n\t/**\n\t * @description Get the quote asset balance of a margin manager\n\t * @param {string} marginManagerKey The key to identify the margin manager\n\t * @param {number} decimals Number of decimal places to show (default: 6)\n\t * @returns {Promise<string>} The quote asset balance\n\t */\n\tasync getMarginManagerQuoteBalance(\n\t\tmarginManagerKey: string,\n\t\tdecimals: number = 9,\n\t): Promise<string> {\n\t\tconst manager = this.#config.getMarginManager(marginManagerKey);\n\t\tconst tx = new Transaction();\n\t\ttx.add(this.marginManager.quoteBalance(manager.poolKey, manager.address));\n\n\t\tconst res = await this.#client.core.simulateTransaction({\n\t\t\ttransaction: tx,\n\t\t\tinclude: { commandResults: true, effects: true },\n\t\t});\n\n\t\tif (res.FailedTransaction) {\n\t\t\tthrow new Error(\n\t\t\t\t`Transaction failed: ${res.FailedTransaction.status.error?.message || 'Unknown error'}`,\n\t\t\t);\n\t\t}\n\n\t\tif (!res.commandResults || !res.commandResults[0] || !res.commandResults[0].returnValues) {\n\t\t\tthrow new Error(`Failed to get margin manager quote balance: Unknown error`);\n\t\t}\n\n\t\tconst bytes = res.commandResults[0].returnValues[0].bcs;\n\t\tconst pool = this.#config.getPool(manager.poolKey);\n\t\tconst quoteCoin = this.#config.getCoin(pool.quoteCoin);\n\n\t\treturn this.#formatTokenAmount(BigInt(bcs.U64.parse(bytes)), quoteCoin.scalar, decimals);\n\t}\n\n\t/**\n\t * @description Get the DEEP token balance of a margin manager\n\t * @param {string} marginManagerKey The key to identify the margin manager\n\t * @param {number} decimals Number of decimal places to show (default: 6)\n\t * @returns {Promise<string>} The DEEP token balance\n\t */\n\tasync getMarginManagerDeepBalance(\n\t\tmarginManagerKey: string,\n\t\tdecimals: number = 6,\n\t): Promise<string> {\n\t\tconst manager = this.#config.getMarginManager(marginManagerKey);\n\t\tconst tx = new Transaction();\n\t\ttx.add(this.marginManager.deepBalance(manager.poolKey, manager.address));\n\n\t\tconst res = await this.#client.core.simulateTransaction({\n\t\t\ttransaction: tx,\n\t\t\tinclude: { commandResults: true, effects: true },\n\t\t});\n\n\t\tif (res.FailedTransaction) {\n\t\t\tthrow new Error(\n\t\t\t\t`Transaction failed: ${res.FailedTransaction.status.error?.message || 'Unknown error'}`,\n\t\t\t);\n\t\t}\n\n\t\tif (!res.commandResults || !res.commandResults[0] || !res.commandResults[0].returnValues) {\n\t\t\tthrow new Error(`Failed to get margin manager DEEP balance: Unknown error`);\n\t\t}\n\n\t\tconst bytes = res.commandResults[0].returnValues[0].bcs;\n\t\tconst deepCoin = this.#config.getCoin('DEEP');\n\n\t\treturn this.#formatTokenAmount(BigInt(bcs.U64.parse(bytes)), deepCoin.scalar, decimals);\n\t}\n\n\t/**\n\t * @description Get account order details for a margin manager.\n\t * This retrieves the balance manager from the margin manager and returns order details.\n\t * @param {string} marginManagerKey The key to identify the margin manager\n\t * @returns {Promise<Array>} Array of order details\n\t */\n\tasync getMarginAccountOrderDetails(marginManagerKey: string) {\n\t\tconst manager = this.#config.getMarginManager(marginManagerKey);\n\t\tconst tx = new Transaction();\n\t\ttx.add(this.marginManager.getMarginAccountOrderDetails(manager.poolKey, manager.address));\n\n\t\ttx.setSenderIfNotSet(normalizeSuiAddress(this.#address));\n\n\t\tconst res = await this.#client.core.simulateTransaction({\n\t\t\ttransaction: tx,\n\t\t\tinclude: { commandResults: true, effects: true },\n\t\t});\n\n\t\tif (res.FailedTransaction) {\n\t\t\tthrow new Error(\n\t\t\t\t`Transaction failed: ${res.FailedTransaction.status.error?.message || 'Unknown error'}`,\n\t\t\t);\n\t\t}\n\n\t\tif (!res.commandResults || !res.commandResults[0] || !res.commandResults[0].returnValues) {\n\t\t\tthrow new Error(`Failed to get conditional order IDs: Unknown error`);\n\t\t}\n\n\t\ttry {\n\t\t\tconst bytes = res.commandResults[1].returnValues[0].bcs;\n\t\t\treturn bcs.vector(Order).parse(bytes);\n\t\t} catch {\n\t\t\treturn [];\n\t\t}\n\t}\n\n\t// === Margin TPSL (Take Profit / Stop Loss) Read-Only Functions ===\n\n\t/**\n\t * @description Get all conditional order IDs for a margin manager\n\t * @param {string} marginManagerKey The key to identify the margin manager\n\t * @returns {Promise<string[]>} Array of conditional order IDs\n\t */\n\tasync getConditionalOrderIds(marginManagerKey: string): Promise<string[]> {\n\t\tconst manager = this.#config.getMarginManager(marginManagerKey);\n\t\tconst tx = new Transaction();\n\t\ttx.add(this.marginTPSL.conditionalOrderIds(manager.poolKey, manager.address));\n\n\t\tconst res = await this.#client.core.simulateTransaction({\n\t\t\ttransaction: tx,\n\t\t\tinclude: { commandResults: true, effects: true },\n\t\t});\n\n\t\tif (res.FailedTransaction) {\n\t\t\tthrow new Error(\n\t\t\t\t`Transaction failed: ${res.FailedTransaction.status.error?.message || 'Unknown error'}`,\n\t\t\t);\n\t\t}\n\n\t\tif (!res.commandResults || !res.commandResults[0] || !res.commandResults[0].returnValues) {\n\t\t\tthrow new Error(`Failed to get conditional order IDs: Unknown error`);\n\t\t}\n\n\t\tconst bytes = res.commandResults[0].returnValues[0].bcs;\n\t\tconst orderIds = bcs.vector(bcs.u64()).parse(bytes);\n\t\treturn orderIds.map((id) => id.toString());\n\t}\n\n\t/**\n\t * @description Get the lowest trigger price for trigger_above orders\n\t * Returns MAX_U64 if there are no trigger_above orders\n\t * @param {string} marginManagerKey The key to identify the margin manager\n\t * @returns {Promise<bigint>} The lowest trigger above price\n\t */\n\tasync getLowestTriggerAbovePrice(marginManagerKey: string): Promise<bigint> {\n\t\tconst manager = this.#config.getMarginManager(marginManagerKey);\n\t\tconst tx = new Transaction();\n\t\ttx.add(this.marginTPSL.lowestTriggerAbovePrice(manager.poolKey, manager.address));\n\n\t\tconst res = await this.#client.core.simulateTransaction({\n\t\t\ttransaction: tx,\n\t\t\tinclude: { commandResults: true, effects: true },\n\t\t});\n\n\t\tif (res.FailedTransaction) {\n\t\t\tthrow new Error(\n\t\t\t\t`Transaction failed: ${res.FailedTransaction.status.error?.message || 'Unknown error'}`,\n\t\t\t);\n\t\t}\n\n\t\tif (!res.commandResults || !res.commandResults[0] || !res.commandResults[0].returnValues) {\n\t\t\tthrow new Error(`Failed to get lowest trigger above price: Unknown error`);\n\t\t}\n\n\t\tconst bytes = res.commandResults[0].returnValues[0].bcs;\n\t\treturn BigInt(bcs.U64.parse(bytes));\n\t}\n\n\t/**\n\t * @description Get the highest trigger price for trigger_below orders\n\t * Returns 0 if there are no trigger_below orders\n\t * @param {string} marginManagerKey The key to identify the margin manager\n\t * @returns {Promise<bigint>} The highest trigger below price\n\t */\n\tasync getHighestTriggerBelowPrice(marginManagerKey: string): Promise<bigint> {\n\t\tconst manager = this.#config.getMarginManager(marginManagerKey);\n\t\tconst tx = new Transaction();\n\t\ttx.add(this.marginTPSL.highestTriggerBelowPrice(manager.poolKey, manager.address));\n\n\t\tconst res = await this.#client.core.simulateTransaction({\n\t\t\ttransaction: tx,\n\t\t\tinclude: { commandResults: true, effects: true },\n\t\t});\n\n\t\tif (res.FailedTransaction) {\n\t\t\tthrow new Error(\n\t\t\t\t`Transaction failed: ${res.FailedTransaction.status.error?.message || 'Unknown error'}`,\n\t\t\t);\n\t\t}\n\n\t\tif (!res.commandResults || !res.commandResults[0] || !res.commandResults[0].returnValues) {\n\t\t\tthrow new Error(`Failed to get highest trigger below price: Unknown error`);\n\t\t}\n\n\t\tconst bytes = res.commandResults[0].returnValues[0].bcs;\n\t\treturn BigInt(bcs.U64.parse(bytes));\n\t}\n\n\t// === Margin Registry Functions ===\n\n\t/**\n\t * @description Check if a deepbook pool is enabled for margin trading\n\t * @param {string} poolKey The key to identify the pool\n\t * @returns {Promise<boolean>} True if the pool is enabled for margin trading\n\t */\n\tasync isPoolEnabledForMargin(poolKey: string): Promise<boolean> {\n\t\tconst tx = new Transaction();\n\t\ttx.add(this.marginRegistry.poolEnabled(poolKey));\n\n\t\tconst res = await this.#client.core.simulateTransaction({\n\t\t\ttransaction: tx,\n\t\t\tinclude: { commandResults: true, effects: true },\n\t\t});\n\n\t\tconst bytes = res.commandResults![0].returnValues[0].bcs;\n\t\treturn bcs.Bool.parse(bytes);\n\t}\n\n\t/**\n\t * @description Get the margin manager IDs for a given owner address\n\t * @param {string} owner The owner address\n\t * @returns {Promise<string[]>} Array of margin manager IDs\n\t */\n\tasync getMarginManagerIdsForOwner(owner: string): Promise<string[]> {\n\t\tconst tx = new Transaction();\n\t\ttx.add(this.marginRegistry.getMarginManagerIds(owner));\n\n\t\tconst res = await this.#client.core.simulateTransaction({\n\t\t\ttransaction: tx,\n\t\t\tinclude: { commandResults: true, effects: true },\n\t\t});\n\n\t\tconst bytes = res.commandResults![0].returnValues[0].bcs;\n\t\tconst vecSet = VecSet(bcs.Address).parse(bytes);\n\t\treturn vecSet.contents.map((id) => normalizeSuiAddress(id));\n\t}\n\n\t/**\n\t * @description Get the base margin pool ID for a deepbook pool\n\t * @param {string} poolKey The key to identify the pool\n\t * @returns {Promise<string>} The base margin pool ID\n\t */\n\tasync getBaseMarginPoolId(poolKey: string): Promise<string> {\n\t\tconst tx = new Transaction();\n\t\ttx.add(this.marginRegistry.baseMarginPoolId(poolKey));\n\n\t\tconst res = await this.#client.core.simulateTransaction({\n\t\t\ttransaction: tx,\n\t\t\tinclude: { commandResults: true, effects: true },\n\t\t});\n\n\t\tconst bytes = res.commandResults![0].returnValues[0].bcs;\n\t\tconst id = bcs.Address.parse(bytes);\n\t\treturn '0x' + id;\n\t}\n\n\t/**\n\t * @description Get the quote margin pool ID for a deepbook pool\n\t * @param {string} poolKey The key to identify the pool\n\t * @returns {Promise<string>} The quote margin pool ID\n\t */\n\tasync getQuoteMarginPoolId(poolKey: string): Promise<string> {\n\t\tconst tx = new Transaction();\n\t\ttx.add(this.marginRegistry.quoteMarginPoolId(poolKey));\n\n\t\tconst res = await this.#client.core.simulateTransaction({\n\t\t\ttransaction: tx,\n\t\t\tinclude: { commandResults: true, effects: true },\n\t\t});\n\n\t\tconst bytes = res.commandResults![0].returnValues[0].bcs;\n\t\tconst id = bcs.Address.parse(bytes);\n\t\treturn '0x' + id;\n\t}\n\n\t/**\n\t * @description Get the minimum withdraw risk ratio for a deepbook pool\n\t * @param {string} poolKey The key to identify the pool\n\t * @returns {Promise<number>} The minimum withdraw risk ratio as a decimal (e.g., 1.5 for 150%)\n\t */\n\tasync getMinWithdrawRiskRatio(poolKey: string): Promise<number> {\n\t\tconst tx = new Transaction();\n\t\ttx.add(this.marginRegistry.minWithdrawRiskRatio(poolKey));\n\n\t\tconst res = await this.#client.core.simulateTransaction({\n\t\t\ttransaction: tx,\n\t\t\tinclude: { commandResults: true, effects: true },\n\t\t});\n\n\t\tconst bytes = res.commandResults![0].returnValues[0].bcs;\n\t\tconst ratio = Number(bcs.U64.parse(bytes));\n\t\treturn ratio / FLOAT_SCALAR;\n\t}\n\n\t/**\n\t * @description Get the minimum borrow risk ratio for a deepbook pool\n\t * @param {string} poolKey The key to identify the pool\n\t * @returns {Promise<number>} The minimum borrow risk ratio as a decimal (e.g., 1.25 for 125%)\n\t */\n\tasync getMinBorrowRiskRatio(poolKey: string): Promise<number> {\n\t\tconst tx = new Transaction();\n\t\ttx.add(this.marginRegistry.minBorrowRiskRatio(poolKey));\n\n\t\tconst res = await this.#client.core.simulateTransaction({\n\t\t\ttransaction: tx,\n\t\t\tinclude: { commandResults: true, effects: true },\n\t\t});\n\n\t\tconst bytes = res.commandResults![0].returnValues[0].bcs;\n\t\tconst ratio = Number(bcs.U64.parse(bytes));\n\t\treturn ratio / FLOAT_SCALAR;\n\t}\n\n\t/**\n\t * @description Get the liquidation risk ratio for a deepbook pool\n\t * @param {string} poolKey The key to identify the pool\n\t * @returns {Promise<number>} The liquidation risk ratio as a decimal (e.g., 1.125 for 112.5%)\n\t */\n\tasync getLiquidationRiskRatio(poolKey: string): Promise<number> {\n\t\tconst tx = new Transaction();\n\t\ttx.add(this.marginRegistry.liquidationRiskRatio(poolKey));\n\n\t\tconst res = await this.#client.core.simulateTransaction({\n\t\t\ttransaction: tx,\n\t\t\tinclude: { commandResults: true, effects: true },\n\t\t});\n\n\t\tconst bytes = res.commandResults![0].returnValues[0].bcs;\n\t\tconst ratio = Number(bcs.U64.parse(bytes));\n\t\treturn ratio / FLOAT_SCALAR;\n\t}\n\n\t/**\n\t * @description Get the target liquidation risk ratio for a deepbook pool\n\t * @param {string} poolKey The key to identify the pool\n\t * @returns {Promise<number>} The target liquidation risk ratio as a decimal (e.g., 1.25 for 125%)\n\t */\n\tasync getTargetLiquidationRiskRatio(poolKey: string): Promise<number> {\n\t\tconst tx = new Transaction();\n\t\ttx.add(this.marginRegistry.targetLiquidationRiskRatio(poolKey));\n\n\t\tconst res = await this.#client.core.simulateTransaction({\n\t\t\ttransaction: tx,\n\t\t\tinclude: { commandResults: true, effects: true },\n\t\t});\n\n\t\tconst bytes = res.commandResults![0].returnValues[0].bcs;\n\t\tconst ratio = Number(bcs.U64.parse(bytes));\n\t\treturn ratio / FLOAT_SCALAR;\n\t}\n\n\t/**\n\t * @description Get the user liquidation reward for a deepbook pool\n\t * @param {string} poolKey The key to identify the pool\n\t * @returns {Promise<number>} The user liquidation reward as a decimal (e.g., 0.05 for 5%)\n\t */\n\tasync getUserLiquidationReward(poolKey: string): Promise<number> {\n\t\tconst tx = new Transaction();\n\t\ttx.add(this.marginRegistry.userLiquidationReward(poolKey));\n\n\t\tconst res = await this.#client.core.simulateTransaction({\n\t\t\ttransaction: tx,\n\t\t\tinclude: { commandResults: true, effects: true },\n\t\t});\n\n\t\tconst bytes = res.commandResults![0].returnValues[0].bcs;\n\t\tconst reward = Number(bcs.U64.parse(bytes));\n\t\treturn reward / FLOAT_SCALAR;\n\t}\n\n\t/**\n\t * @description Get the pool liquidation reward for a deepbook pool\n\t * @param {string} poolKey The key to identify the pool\n\t * @returns {Promise<number>} The pool liquidation reward as a decimal (e.g., 0.05 for 5%)\n\t */\n\tasync getPoolLiquidationReward(poolKey: string): Promise<number> {\n\t\tconst tx = new Transaction();\n\t\ttx.add(this.marginRegistry.poolLiquidationReward(poolKey));\n\n\t\tconst res = await this.#client.core.simulateTransaction({\n\t\t\ttransaction: tx,\n\t\t\tinclude: { commandResults: true, effects: true },\n\t\t});\n\n\t\tconst bytes = res.commandResults![0].returnValues[0].bcs;\n\t\tconst reward = Number(bcs.U64.parse(bytes));\n\t\treturn reward / FLOAT_SCALAR;\n\t}\n\n\t/**\n\t * @description Get all allowed maintainer cap IDs\n\t * @returns {Promise<string[]>} Array of allowed maintainer cap IDs\n\t */\n\tasync getAllowedMaintainers(): Promise<string[]> {\n\t\tconst tx = new Transaction();\n\t\ttx.add(this.marginRegistry.allowedMaintainers());\n\n\t\tconst res = await this.#client.core.simulateTransaction({\n\t\t\ttransaction: tx,\n\t\t\tinclude: { commandResults: true, effects: true },\n\t\t});\n\n\t\tconst bytes = res.commandResults![0].returnValues[0].bcs;\n\t\tconst vecSet = VecSet(bcs.Address).parse(bytes);\n\t\treturn vecSet.contents.map((id) => normalizeSuiAddress(id));\n\t}\n\n\t/**\n\t * @description Get all allowed pause cap IDs\n\t * @returns {Promise<string[]>} Array of allowed pause cap IDs\n\t */\n\tasync getAllowedPauseCaps(): Promise<string[]> {\n\t\tconst tx = new Transaction();\n\t\ttx.add(this.marginRegistry.allowedPauseCaps());\n\n\t\tconst res = await this.#client.core.simulateTransaction({\n\t\t\ttransaction: tx,\n\t\t\tinclude: { commandResults: true, effects: true },\n\t\t});\n\n\t\tconst bytes = res.commandResults![0].returnValues[0].bcs;\n\t\tconst vecSet = VecSet(bcs.Address).parse(bytes);\n\t\treturn vecSet.contents.map((id) => normalizeSuiAddress(id));\n\t}\n\n\t/**\n\t * @description Check if a pool is a stable pool\n\t * @param {string} poolKey Key of the pool\n\t * @returns {Promise<boolean>} Whether the pool is a stable pool\n\t */\n\tasync stablePool(poolKey: string): Promise<boolean> {\n\t\tconst tx = new Transaction();\n\t\ttx.add(this.deepBook.stablePool(poolKey));\n\n\t\tconst res = await this.#client.core.simulateTransaction({\n\t\t\ttransaction: tx,\n\t\t\tinclude: { commandResults: true, effects: true },\n\t\t});\n\n\t\tconst bytes = res.commandResults![0].returnValues[0].bcs;\n\t\treturn bcs.bool().parse(bytes);\n\t}\n\n\t/**\n\t * @description Check if a pool is registered\n\t * @param {string} poolKey Key of the pool\n\t * @returns {Promise<boolean>} Whether the pool is registered\n\t */\n\tasync registeredPool(poolKey: string): Promise<boolean> {\n\t\tconst tx = new Transaction();\n\t\ttx.add(this.deepBook.registeredPool(poolKey));\n\n\t\tconst res = await this.#client.core.simulateTransaction({\n\t\t\ttransaction: tx,\n\t\t\tinclude: { commandResults: true, effects: true },\n\t\t});\n\n\t\tconst bytes = res.commandResults![0].returnValues[0].bcs;\n\t\treturn bcs.bool().parse(bytes);\n\t}\n\n\t/**\n\t * @description Get the quote quantity out using input token as fee\n\t * @param {string} poolKey Key of the pool\n\t * @param {number} baseQuantity Base quantity\n\t * @returns {Promise<{baseQuantity: number, baseOut: number, quoteOut: number, deepRequired: number}>}\n\t */\n\tasync getQuoteQuantityOutInputFee(poolKey: string, baseQuantity: number) {\n\t\tconst tx = new Transaction();\n\t\tconst pool = this.#config.getPool(poolKey);\n\t\tconst baseScalar = this.#config.getCoin(pool.baseCoin).scalar;\n\t\tconst quoteScalar = this.#config.getCoin(pool.quoteCoin).scalar;\n\n\t\ttx.add(this.deepBook.getQuoteQuantityOutInputFee(poolKey, baseQuantity));\n\t\tconst res = await this.#client.core.simulateTransaction({\n\t\t\ttransaction: tx,\n\t\t\tinclude: { commandResults: true, effects: true },\n\t\t});\n\n\t\tconst baseOut = Number(bcs.U64.parse(res.commandResults![0].returnValues[0].bcs));\n\t\tconst quoteOut = Number(bcs.U64.parse(res.commandResults![0].returnValues[1].bcs));\n\t\tconst deepRequired = Number(bcs.U64.parse(res.commandResults![0].returnValues[2].bcs));\n\n\t\treturn {\n\t\t\tbaseQuantity,\n\t\t\tbaseOut: Number((baseOut / baseScalar).toFixed(9)),\n\t\t\tquoteOut: Number((quoteOut / quoteScalar).toFixed(9)),\n\t\t\tdeepRequired: Number((deepRequired / DEEP_SCALAR).toFixed(9)),\n\t\t};\n\t}\n\n\t/**\n\t * @description Get the base quantity out using input token as fee\n\t * @param {string} poolKey Key of the pool\n\t * @param {number} quoteQuantity Quote quantity\n\t * @returns {Promise<{quoteQuantity: number, baseOut: number, quoteOut: number, deepRequired: number}>}\n\t */\n\tasync getBaseQuantityOutInputFee(poolKey: string, quoteQuantity: number) {\n\t\tconst tx = new Transaction();\n\t\tconst pool = this.#config.getPool(poolKey);\n\t\tconst baseScalar = this.#config.getCoin(pool.baseCoin).scalar;\n\t\tconst quoteScalar = this.#config.getCoin(pool.quoteCoin).scalar;\n\n\t\ttx.add(this.deepBook.getBaseQuantityOutInputFee(poolKey, quoteQuantity));\n\t\tconst res = await this.#client.core.simulateTransaction({\n\t\t\ttransaction: tx,\n\t\t\tinclude: { commandResults: true, effects: true },\n\t\t});\n\n\t\tconst baseOut = Number(bcs.U64.parse(res.commandResults![0].returnValues[0].bcs));\n\t\tconst quoteOut = Number(bcs.U64.parse(res.commandResults![0].returnValues[1].bcs));\n\t\tconst deepRequired = Number(bcs.U64.parse(res.commandResults![0].returnValues[2].bcs));\n\n\t\treturn {\n\t\t\tquoteQuantity,\n\t\t\tbaseOut: Number((baseOut / baseScalar).toFixed(9)),\n\t\t\tquoteOut: Number((quoteOut / quoteScalar).toFixed(9)),\n\t\t\tdeepRequired: Number((deepRequired / DEEP_SCALAR).toFixed(9)),\n\t\t};\n\t}\n\n\t/**\n\t * @description Get the quantity out using input token as fee\n\t * @param {string} poolKey Key of the pool\n\t * @param {number} baseQuantity Base quantity\n\t * @param {number} quoteQuantity Quote quantity\n\t * @returns {Promise<{baseQuantity: number, quoteQuantity: number, baseOut: number, quoteOut: number, deepRequired: number}>}\n\t */\n\tasync getQuantityOutInputFee(poolKey: string, baseQuantity: number, quoteQuantity: number) {\n\t\tconst tx = new Transaction();\n\t\tconst pool = this.#config.getPool(poolKey);\n\t\tconst baseScalar = this.#config.getCoin(pool.baseCoin).scalar;\n\t\tconst quoteScalar = this.#config.getCoin(pool.quoteCoin).scalar;\n\n\t\ttx.add(this.deepBook.getQuantityOutInputFee(poolKey, baseQuantity, quoteQuantity));\n\t\tconst res = await this.#client.core.simulateTransaction({\n\t\t\ttransaction: tx,\n\t\t\tinclude: { commandResults: true, effects: true },\n\t\t});\n\n\t\tconst baseOut = Number(bcs.U64.parse(res.commandResults![0].returnValues[0].bcs));\n\t\tconst quoteOut = Number(bcs.U64.parse(res.commandResults![0].returnValues[1].bcs));\n\t\tconst deepRequired = Number(bcs.U64.parse(res.commandResults![0].returnValues[2].bcs));\n\n\t\treturn {\n\t\t\tbaseQuantity,\n\t\t\tquoteQuantity,\n\t\t\tbaseOut: Number((baseOut / baseScalar).toFixed(9)),\n\t\t\tquoteOut: Number((quoteOut / quoteScalar).toFixed(9)),\n\t\t\tdeepRequired: Number((deepRequired / DEEP_SCALAR).toFixed(9)),\n\t\t};\n\t}\n\n\t/**\n\t * @description Get the base quantity needed to receive target quote quantity\n\t * @param {string} poolKey Key of the pool\n\t * @param {number} targetQuoteQuantity Target quote quantity\n\t * @param {boolean} payWithDeep Whether to pay fees with DEEP\n\t * @returns {Promise<{baseIn: number, quoteOut: number, deepRequired: number}>}\n\t */\n\tasync getBaseQuantityIn(poolKey: string, targetQuoteQuantity: number, payWithDeep: boolean) {\n\t\tconst tx = new Transaction();\n\t\tconst pool = this.#config.getPool(poolKey);\n\t\tconst baseScalar = this.#config.getCoin(pool.baseCoin).scalar;\n\t\tconst quoteScalar = this.#config.getCoin(pool.quoteCoin).scalar;\n\n\t\ttx.add(this.deepBook.getBaseQuantityIn(poolKey, targetQuoteQuantity, payWithDeep));\n\t\tconst res = await this.#client.core.simulateTransaction({\n\t\t\ttransaction: tx,\n\t\t\tinclude: { commandResults: true, effects: true },\n\t\t});\n\n\t\tconst baseIn = Number(bcs.U64.parse(res.commandResults![0].returnValues[0].bcs));\n\t\tconst quoteOut = Number(bcs.U64.parse(res.commandResults![0].returnValues[1].bcs));\n\t\tconst deepRequired = Number(bcs.U64.parse(res.commandResults![0].returnValues[2].bcs));\n\n\t\treturn {\n\t\t\tbaseIn: Number((baseIn / baseScalar).toFixed(9)),\n\t\t\tquoteOut: Number((quoteOut / quoteScalar).toFixed(9)),\n\t\t\tdeepRequired: Number((deepRequired / DEEP_SCALAR).toFixed(9)),\n\t\t};\n\t}\n\n\t/**\n\t * @description Get the quote quantity needed to receive target base quantity\n\t * @param {string} poolKey Key of the pool\n\t * @param {number} targetBaseQuantity Target base quantity\n\t * @param {boolean} payWithDeep Whether to pay fees with DEEP\n\t * @returns {Promise<{baseOut: number, quoteIn: number, deepRequired: number}>}\n\t */\n\tasync getQuoteQuantityIn(poolKey: string, targetBaseQuantity: number, payWithDeep: boolean) {\n\t\tconst tx = new Transaction();\n\t\tconst pool = this.#config.getPool(poolKey);\n\t\tconst baseScalar = this.#config.getCoin(pool.baseCoin).scalar;\n\t\tconst quoteScalar = this.#config.getCoin(pool.quoteCoin).scalar;\n\n\t\ttx.add(this.deepBook.getQuoteQuantityIn(poolKey, targetBaseQuantity, payWithDeep));\n\t\tconst res = await this.#client.core.simulateTransaction({\n\t\t\ttransaction: tx,\n\t\t\tinclude: { commandResults: true, effects: true },\n\t\t});\n\n\t\tconst baseOut = Number(bcs.U64.parse(res.commandResults![0].returnValues[0].bcs));\n\t\tconst quoteIn = Number(bcs.U64.parse(res.commandResults![0].returnValues[1].bcs));\n\t\tconst deepRequired = Number(bcs.U64.parse(res.commandResults![0].returnValues[2].bcs));\n\n\t\treturn {\n\t\t\tbaseOut: Number((baseOut / baseScalar).toFixed(9)),\n\t\t\tquoteIn: Number((quoteIn / quoteScalar).toFixed(9)),\n\t\t\tdeepRequired: Number((deepRequired / DEEP_SCALAR).toFixed(9)),\n\t\t};\n\t}\n\n\t/**\n\t * @description Get account order details for a balance manager\n\t * @param {string} poolKey Key of the pool\n\t * @param {string} managerKey Key of the balance manager\n\t * @returns {Promise<Array>} Array of order details\n\t */\n\tasync getAccountOrderDetails(poolKey: string, managerKey: string) {\n\t\tconst tx = new Transaction();\n\t\ttx.add(this.deepBook.getAccountOrderDetails(poolKey, managerKey));\n\n\t\tconst res = await this.#client.core.simulateTransaction({\n\t\t\ttransaction: tx,\n\t\t\tinclude: { commandResults: true, effects: true },\n\t\t});\n\n\t\ttry {\n\t\t\tconst orderInformation = res.commandResults![0].returnValues[0].bcs;\n\t\t\treturn bcs.vector(Order).parse(new Uint8Array(orderInformation));\n\t\t} catch {\n\t\t\treturn [];\n\t\t}\n\t}\n\n\t/**\n\t * @description Get the DEEP required for an order\n\t * @param {string} poolKey Key of the pool\n\t * @param {number} baseQuantity Base quantity\n\t * @param {number} price Price\n\t * @returns {Promise<{deepRequiredTaker: number, deepRequiredMaker: number}>}\n\t */\n\tasync getOrderDeepRequired(poolKey: string, baseQuantity: number, price: number) {\n\t\tconst tx = new Transaction();\n\t\ttx.add(this.deepBook.getOrderDeepRequired(poolKey, baseQuantity, price));\n\n\t\tconst res = await this.#client.core.simulateTransaction({\n\t\t\ttransaction: tx,\n\t\t\tinclude: { commandResults: true, effects: true },\n\t\t});\n\n\t\tconst deepRequiredTaker = Number(bcs.U64.parse(res.commandResults![0].returnValues[0].bcs));\n\t\tconst deepRequiredMaker = Number(bcs.U64.parse(res.commandResults![0].returnValues[1].bcs));\n\n\t\treturn {\n\t\t\tdeepRequiredTaker: Number((deepRequiredTaker / DEEP_SCALAR).toFixed(9)),\n\t\t\tdeepRequiredMaker: Number((deepRequiredMaker / DEEP_SCALAR).toFixed(9)),\n\t\t};\n\t}\n\n\t/**\n\t * @description Check if account exists for a balance manager\n\t * @param {string} poolKey Key of the pool\n\t * @param {string} managerKey Key of the balance manager\n\t * @returns {Promise<boolean>} Whether account exists\n\t */\n\tasync accountExists(poolKey: string, managerKey: string): Promise<boolean> {\n\t\tconst tx = new Transaction();\n\t\ttx.add(this.deepBook.accountExists(poolKey, managerKey));\n\n\t\tconst res = await this.#client.core.simulateTransaction({\n\t\t\ttransaction: tx,\n\t\t\tinclude: { commandResults: true, effects: true },\n\t\t});\n\n\t\tconst bytes = res.commandResults![0].returnValues[0].bcs;\n\t\treturn bcs.bool().parse(bytes);\n\t}\n\n\t/**\n\t * @description Get the next epoch trade parameters\n\t * @param {string} poolKey Key of the pool\n\t * @returns {Promise<{takerFee: number, makerFee: number, stakeRequired: number}>}\n\t */\n\tasync poolTradeParamsNext(poolKey: string) {\n\t\tconst tx = new Transaction();\n\t\ttx.add(this.deepBook.poolTradeParamsNext(poolKey));\n\n\t\tconst res = await this.#client.core.simulateTransaction({\n\t\t\ttransaction: tx,\n\t\t\tinclude: { commandResults: true, effects: true },\n\t\t});\n\n\t\tconst takerFee = Number(bcs.U64.parse(res.commandResults![0].returnValues[0].bcs));\n\t\tconst makerFee = Number(bcs.U64.parse(res.commandResults![0].returnValues[1].bcs));\n\t\tconst stakeRequired = Number(bcs.U64.parse(res.commandResults![0].returnValues[2].bcs));\n\n\t\treturn {\n\t\t\ttakerFee: takerFee / FLOAT_SCALAR,\n\t\t\tmakerFee: makerFee / FLOAT_SCALAR,\n\t\t\tstakeRequired: stakeRequired / DEEP_SCALAR,\n\t\t};\n\t}\n\n\t/**\n\t * @description Get the quorum for a pool\n\t * @param {string} poolKey Key of the pool\n\t * @returns {Promise<number>} The quorum amount in DEEP\n\t */\n\tasync quorum(poolKey: string): Promise<number> {\n\t\tconst tx = new Transaction();\n\t\ttx.add(this.deepBook.quorum(poolKey));\n\n\t\tconst res = await this.#client.core.simulateTransaction({\n\t\t\ttransaction: tx,\n\t\t\tinclude: { commandResults: true, effects: true },\n\t\t});\n\n\t\tconst bytes = res.commandResults![0].returnValues[0].bcs;\n\t\tconst quorum = Number(bcs.U64.parse(bytes));\n\t\treturn quorum / DEEP_SCALAR;\n\t}\n\n\t/**\n\t * @description Get the pool ID\n\t * @param {string} poolKey Key of the pool\n\t * @returns {Promise<string>} The pool ID\n\t */\n\tasync poolId(poolKey: string): Promise<string> {\n\t\tconst tx = new Transaction();\n\t\ttx.add(this.deepBook.poolId(poolKey));\n\n\t\tconst res = await this.#client.core.simulateTransaction({\n\t\t\ttransaction: tx,\n\t\t\tinclude: { commandResults: true, effects: true },\n\t\t});\n\n\t\tconst bytes = res.commandResults![0].returnValues[0].bcs;\n\t\treturn normalizeSuiAddress(bcs.Address.parse(bytes));\n\t}\n\n\t/**\n\t * @description Check if a limit order can be placed\n\t * @param {CanPlaceLimitOrderParams} params Parameters for checking limit order placement\n\t * @returns {Promise<boolean>} Whether order can be placed\n\t */\n\tasync canPlaceLimitOrder(params: CanPlaceLimitOrderParams): Promise<boolean> {\n\t\tconst tx = new Transaction();\n\t\ttx.add(this.deepBook.canPlaceLimitOrder(params));\n\n\t\tconst res = await this.#client.core.simulateTransaction({\n\t\t\ttransaction: tx,\n\t\t\tinclude: { commandResults: true, effects: true },\n\t\t});\n\n\t\tconst bytes = res.commandResults![0].returnValues[0].bcs;\n\t\treturn bcs.bool().parse(bytes);\n\t}\n\n\t/**\n\t * @description Check if a market order can be placed\n\t * @param {CanPlaceMarketOrderParams} params Parameters for checking market order placement\n\t * @returns {Promise<boolean>} Whether order can be placed\n\t */\n\tasync canPlaceMarketOrder(params: CanPlaceMarketOrderParams): Promise<boolean> {\n\t\tconst tx = new Transaction();\n\t\ttx.add(this.deepBook.canPlaceMarketOrder(params));\n\n\t\tconst res = await this.#client.core.simulateTransaction({\n\t\t\ttransaction: tx,\n\t\t\tinclude: { commandResults: true, effects: true },\n\t\t});\n\n\t\tconst bytes = res.commandResults![0].returnValues[0].bcs;\n\t\treturn bcs.bool().parse(bytes);\n\t}\n\n\t/**\n\t * @description Check if market order params are valid\n\t * @param {string} poolKey Key of the pool\n\t * @param {number} quantity Quantity\n\t * @returns {Promise<boolean>} Whether params are valid\n\t */\n\tasync checkMarketOrderParams(poolKey: string, quantity: number): Promise<boolean> {\n\t\tconst tx = new Transaction();\n\t\ttx.add(this.deepBook.checkMarketOrderParams(poolKey, quantity));\n\n\t\tconst res = await this.#client.core.simulateTransaction({\n\t\t\ttransaction: tx,\n\t\t\tinclude: { commandResults: true, effects: true },\n\t\t});\n\n\t\tconst bytes = res.commandResults![0].returnValues[0].bcs;\n\t\treturn bcs.bool().parse(bytes);\n\t}\n\n\t/**\n\t * @description Check if limit order params are valid\n\t * @param {string} poolKey Key of the pool\n\t * @param {number} price Price\n\t * @param {number} quantity Quantity\n\t * @param {number} expireTimestamp Expiration timestamp\n\t * @returns {Promise<boolean>} Whether params are valid\n\t */\n\tasync checkLimitOrderParams(\n\t\tpoolKey: string,\n\t\tprice: number,\n\t\tquantity: number,\n\t\texpireTimestamp: number,\n\t): Promise<boolean> {\n\t\tconst tx = new Transaction();\n\t\ttx.add(this.deepBook.checkLimitOrderParams(poolKey, price, quantity, expireTimestamp));\n\n\t\tconst res = await this.#client.core.simulateTransaction({\n\t\t\ttransaction: tx,\n\t\t\tinclude: { commandResults: true, effects: true },\n\t\t});\n\n\t\tconst bytes = res.commandResults![0].returnValues[0].bcs;\n\t\treturn bcs.bool().parse(bytes);\n\t}\n\n\t/**\n\t * @description Helper function to format token amounts without floating point errors\n\t * @param {bigint} rawAmount The raw amount as bigint\n\t * @param {number} scalar The token scalar (e.g., 1000000000 for 9 decimals)\n\t * @param {number} decimals Number of decimal places to show\n\t * @returns {string} Formatted amount as string\n\t */\n\t#formatTokenAmount(rawAmount: bigint, scalar: number, decimals: number): string {\n\t\tconst scalarBigInt = BigInt(scalar);\n\t\tconst integerPart = rawAmount / scalarBigInt;\n\t\tconst fractionalPart = rawAmount % scalarBigInt;\n\n\t\t// If no fractional part, return just the integer\n\t\tif (fractionalPart === 0n) {\n\t\t\treturn integerPart.toString();\n\t\t}\n\n\t\t// Convert fractional part to string with leading zeros\n\t\tconst scalarDigits = scalar.toString().length - 1;\n\t\tconst fractionalStr = fractionalPart.toString().padStart(scalarDigits, '0');\n\n\t\t// Truncate to desired decimal places\n\t\tconst truncated = fractionalStr.slice(0, decimals);\n\n\t\t// Remove trailing zeros for cleaner output\n\t\tconst trimmed = truncated.replace(/0+$/, '');\n\n\t\t// If nothing left after trimming, return just integer\n\t\tif (!trimmed) {\n\t\t\treturn integerPart.toString();\n\t\t}\n\n\t\treturn `${integerPart}.${trimmed}`;\n\t}\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;AAyDA,SAAgB,SAA2C,EAC1D,OAAO,YACP,GAAG,WAC6F;AAChG,QAAO;EACN;EACA,WAAW,WAAW;AACrB,UAAO,IAAI,eAAe;IACzB;IACA,SAAS,OAAO;IAChB,GAAG;IACH,CAAC;;EAEH;;;;;AAMF,IAAa,iBAAb,MAA4B;CAC3B;CACA;CACA;;;;CAkBA,YAAY,EACX,QACA,SACA,SACA,iBACA,gBACA,OACA,OACA,UACA,gBACA,uBACyB;AACzB,QAAKA,SAAU;AACf,QAAKC,UAAW,oBAAoB,QAAQ;AAC5C,QAAKC,SAAU,IAAI,eAAe;GACjC,SAAS,MAAKD;GACd;GACA;GACA;GACA;GACA;GACA;GACA;GACA;GACA,CAAC;AACF,OAAK,iBAAiB,IAAI,uBAAuB,MAAKC,OAAQ;AAC9D,OAAK,WAAW,IAAI,iBAAiB,MAAKA,OAAQ;AAClD,OAAK,gBAAgB,IAAI,sBAAsB,MAAKA,OAAQ;AAC5D,OAAK,aAAa,IAAI,kBAAkB,MAAKA,OAAQ;AACrD,OAAK,aAAa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AS;IAAE,gBAAgB;IAAM,SAAS;IAAM;GAChD,CAAC,EAEgB,eAAgB,GAAG,aAAa,GAAG;AACrD,SAAO,IAAI,MAAM,CAAC,MAAM,MAAM;;;;;;;;;CAU/B,mBAAmB,WAAmB,QAAgB,UAA0B;EAC/E,MAAM,eAAe,OAAO,OAAO;EACnC,MAAM,cAAc,YAAY;EAChC,MAAM,iBAAiB,YAAY;AAGnC,MAAI,mBAAmB,GACtB,QAAO,YAAY,UAAU;EAI9B,MAAM,eAAe,OAAO,UAAU,CAAC,SAAS;EAOhD,MAAM,UANgB,eAAe,UAAU,CAAC,SAAS,cAAc,IAAI,CAG3C,MAAM,GAAG,SAAS,CAGxB,QAAQ,OAAO,GAAG;AAG5C,MAAI,CAAC,QACJ,QAAO,YAAY,UAAU;AAG9B,SAAO,GAAG,YAAY,GAAG"}
@@ -0,0 +1,38 @@
1
+ import { MoveStruct } from "../utils/index.mjs";
2
+ import * as _mysten_sui_bcs0 from "@mysten/sui/bcs";
3
+ import { Transaction } from "@mysten/sui/transactions";
4
+
5
+ //#region src/contracts/deepbook/account.d.ts
6
+
7
+ declare const Account: MoveStruct<{
8
+ epoch: _mysten_sui_bcs0.BcsType<string, string | number | bigint, "u64">;
9
+ open_orders: MoveStruct<{
10
+ contents: _mysten_sui_bcs0.BcsType<string[], Iterable<string | number | bigint> & {
11
+ length: number;
12
+ }, string>;
13
+ }, "0x2::vec_set::VecSet<u128>">;
14
+ taker_volume: _mysten_sui_bcs0.BcsType<string, string | number | bigint, "u128">;
15
+ maker_volume: _mysten_sui_bcs0.BcsType<string, string | number | bigint, "u128">;
16
+ active_stake: _mysten_sui_bcs0.BcsType<string, string | number | bigint, "u64">;
17
+ inactive_stake: _mysten_sui_bcs0.BcsType<string, string | number | bigint, "u64">;
18
+ created_proposal: _mysten_sui_bcs0.BcsType<boolean, boolean, "bool">;
19
+ voted_proposal: _mysten_sui_bcs0.BcsType<string | null, string | Uint8Array<ArrayBufferLike> | null | undefined, "Option<bytes[32]>">;
20
+ unclaimed_rebates: MoveStruct<{
21
+ base: _mysten_sui_bcs0.BcsType<string, string | number | bigint, "u64">;
22
+ quote: _mysten_sui_bcs0.BcsType<string, string | number | bigint, "u64">;
23
+ deep: _mysten_sui_bcs0.BcsType<string, string | number | bigint, "u64">;
24
+ }, "@deepbook/core::balances::Balances">;
25
+ settled_balances: MoveStruct<{
26
+ base: _mysten_sui_bcs0.BcsType<string, string | number | bigint, "u64">;
27
+ quote: _mysten_sui_bcs0.BcsType<string, string | number | bigint, "u64">;
28
+ deep: _mysten_sui_bcs0.BcsType<string, string | number | bigint, "u64">;
29
+ }, "@deepbook/core::balances::Balances">;
30
+ owed_balances: MoveStruct<{
31
+ base: _mysten_sui_bcs0.BcsType<string, string | number | bigint, "u64">;
32
+ quote: _mysten_sui_bcs0.BcsType<string, string | number | bigint, "u64">;
33
+ deep: _mysten_sui_bcs0.BcsType<string, string | number | bigint, "u64">;
34
+ }, "@deepbook/core::balances::Balances">;
35
+ }, "@deepbook/core::account::Account">;
36
+ //#endregion
37
+ export { Account };
38
+ //# sourceMappingURL=account.d.mts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"account.d.mts","names":[],"sources":["../../../src/contracts/deepbook/account.ts"],"sourcesContent":[],"mappings":";;;;;;AA2BE,cAfW,OAeX,EAfkB,UAelB,CAAA;SAAA,gBAAA,CAAA;;;;;;;;;;;;;;;;;;;;;;;IAfkB,IAAA,0BAAA,CAAA,MAAA,EAAA,MAAA,GAAA,MAAA,GAAA,MAAA,EAAA,KAAA,CAAA;IAAA,KAAA,0BAAA,CAAA,MAAA,EAAA,MAAA,GAAA,MAAA,GAAA,MAAA,EAAA,KAAA,CAAA"}
@@ -0,0 +1,31 @@
1
+ import { MoveStruct } from "../utils/index.mjs";
2
+ import { VecSet } from "./deps/sui/vec_set.mjs";
3
+ import { Balances } from "./balances.mjs";
4
+ import { bcs } from "@mysten/sui/bcs";
5
+
6
+ //#region src/contracts/deepbook/account.ts
7
+ /**************************************************************
8
+ * THIS FILE IS GENERATED AND SHOULD NOT BE MANUALLY MODIFIED *
9
+ **************************************************************/
10
+ /** Account module manages the account data for each user. */
11
+ const $moduleName = "@deepbook/core::account";
12
+ const Account = new MoveStruct({
13
+ name: `${$moduleName}::Account`,
14
+ fields: {
15
+ epoch: bcs.u64(),
16
+ open_orders: VecSet(bcs.u128()),
17
+ taker_volume: bcs.u128(),
18
+ maker_volume: bcs.u128(),
19
+ active_stake: bcs.u64(),
20
+ inactive_stake: bcs.u64(),
21
+ created_proposal: bcs.bool(),
22
+ voted_proposal: bcs.option(bcs.Address),
23
+ unclaimed_rebates: Balances,
24
+ settled_balances: Balances,
25
+ owed_balances: Balances
26
+ }
27
+ });
28
+
29
+ //#endregion
30
+ export { Account };
31
+ //# sourceMappingURL=account.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"account.mjs","names":["vec_set.VecSet","balances.Balances"],"sources":["../../../src/contracts/deepbook/account.ts"],"sourcesContent":["/**************************************************************\n * THIS FILE IS GENERATED AND SHOULD NOT BE MANUALLY MODIFIED *\n **************************************************************/\n\n/** Account module manages the account data for each user. */\n\nimport { MoveStruct, normalizeMoveArguments, type RawTransactionArgument } from '../utils/index.js';\nimport { bcs } from '@mysten/sui/bcs';\nimport { type Transaction } from '@mysten/sui/transactions';\nimport * as vec_set from './deps/sui/vec_set.js';\nimport * as balances from './balances.js';\nconst $moduleName = '@deepbook/core::account';\nexport const Account = new MoveStruct({\n\tname: `${$moduleName}::Account`,\n\tfields: {\n\t\tepoch: bcs.u64(),\n\t\topen_orders: vec_set.VecSet(bcs.u128()),\n\t\ttaker_volume: bcs.u128(),\n\t\tmaker_volume: bcs.u128(),\n\t\tactive_stake: bcs.u64(),\n\t\tinactive_stake: bcs.u64(),\n\t\tcreated_proposal: bcs.bool(),\n\t\tvoted_proposal: bcs.option(bcs.Address),\n\t\tunclaimed_rebates: balances.Balances,\n\t\tsettled_balances: balances.Balances,\n\t\towed_balances: balances.Balances,\n\t},\n});\nexport interface OpenOrdersArguments {\n\tself: RawTransactionArgument<string>;\n}\nexport interface OpenOrdersOptions {\n\tpackage?: string;\n\targuments: OpenOrdersArguments | [self: RawTransactionArgument<string>];\n}\nexport function openOrders(options: OpenOrdersOptions) {\n\tconst packageAddress = options.package ?? '@deepbook/core';\n\tconst argumentsTypes = [null] satisfies (string | null)[];\n\tconst parameterNames = ['self'];\n\treturn (tx: Transaction) =>\n\t\ttx.moveCall({\n\t\t\tpackage: packageAddress,\n\t\t\tmodule: 'account',\n\t\t\tfunction: 'open_orders',\n\t\t\targuments: normalizeMoveArguments(options.arguments, argumentsTypes, parameterNames),\n\t\t});\n}\nexport interface TakerVolumeArguments {\n\tself: RawTransactionArgument<string>;\n}\nexport interface TakerVolumeOptions {\n\tpackage?: string;\n\targuments: TakerVolumeArguments | [self: RawTransactionArgument<string>];\n}\nexport function takerVolume(options: TakerVolumeOptions) {\n\tconst packageAddress = options.package ?? '@deepbook/core';\n\tconst argumentsTypes = [null] satisfies (string | null)[];\n\tconst parameterNames = ['self'];\n\treturn (tx: Transaction) =>\n\t\ttx.moveCall({\n\t\t\tpackage: packageAddress,\n\t\t\tmodule: 'account',\n\t\t\tfunction: 'taker_volume',\n\t\t\targuments: normalizeMoveArguments(options.arguments, argumentsTypes, parameterNames),\n\t\t});\n}\nexport interface MakerVolumeArguments {\n\tself: RawTransactionArgument<string>;\n}\nexport interface MakerVolumeOptions {\n\tpackage?: string;\n\targuments: MakerVolumeArguments | [self: RawTransactionArgument<string>];\n}\nexport function makerVolume(options: MakerVolumeOptions) {\n\tconst packageAddress = options.package ?? '@deepbook/core';\n\tconst argumentsTypes = [null] satisfies (string | null)[];\n\tconst parameterNames = ['self'];\n\treturn (tx: Transaction) =>\n\t\ttx.moveCall({\n\t\t\tpackage: packageAddress,\n\t\t\tmodule: 'account',\n\t\t\tfunction: 'maker_volume',\n\t\t\targuments: normalizeMoveArguments(options.arguments, argumentsTypes, parameterNames),\n\t\t});\n}\nexport interface TotalVolumeArguments {\n\tself: RawTransactionArgument<string>;\n}\nexport interface TotalVolumeOptions {\n\tpackage?: string;\n\targuments: TotalVolumeArguments | [self: RawTransactionArgument<string>];\n}\nexport function totalVolume(options: TotalVolumeOptions) {\n\tconst packageAddress = options.package ?? '@deepbook/core';\n\tconst argumentsTypes = [null] satisfies (string | null)[];\n\tconst parameterNames = ['self'];\n\treturn (tx: Transaction) =>\n\t\ttx.moveCall({\n\t\t\tpackage: packageAddress,\n\t\t\tmodule: 'account',\n\t\t\tfunction: 'total_volume',\n\t\t\targuments: normalizeMoveArguments(options.arguments, argumentsTypes, parameterNames),\n\t\t});\n}\nexport interface ActiveStakeArguments {\n\tself: RawTransactionArgument<string>;\n}\nexport interface ActiveStakeOptions {\n\tpackage?: string;\n\targuments: ActiveStakeArguments | [self: RawTransactionArgument<string>];\n}\nexport function activeStake(options: ActiveStakeOptions) {\n\tconst packageAddress = options.package ?? '@deepbook/core';\n\tconst argumentsTypes = [null] satisfies (string | null)[];\n\tconst parameterNames = ['self'];\n\treturn (tx: Transaction) =>\n\t\ttx.moveCall({\n\t\t\tpackage: packageAddress,\n\t\t\tmodule: 'account',\n\t\t\tfunction: 'active_stake',\n\t\t\targuments: normalizeMoveArguments(options.arguments, argumentsTypes, parameterNames),\n\t\t});\n}\nexport interface InactiveStakeArguments {\n\tself: RawTransactionArgument<string>;\n}\nexport interface InactiveStakeOptions {\n\tpackage?: string;\n\targuments: InactiveStakeArguments | [self: RawTransactionArgument<string>];\n}\nexport function inactiveStake(options: InactiveStakeOptions) {\n\tconst packageAddress = options.package ?? '@deepbook/core';\n\tconst argumentsTypes = [null] satisfies (string | null)[];\n\tconst parameterNames = ['self'];\n\treturn (tx: Transaction) =>\n\t\ttx.moveCall({\n\t\t\tpackage: packageAddress,\n\t\t\tmodule: 'account',\n\t\t\tfunction: 'inactive_stake',\n\t\t\targuments: normalizeMoveArguments(options.arguments, argumentsTypes, parameterNames),\n\t\t});\n}\nexport interface CreatedProposalArguments {\n\tself: RawTransactionArgument<string>;\n}\nexport interface CreatedProposalOptions {\n\tpackage?: string;\n\targuments: CreatedProposalArguments | [self: RawTransactionArgument<string>];\n}\nexport function createdProposal(options: CreatedProposalOptions) {\n\tconst packageAddress = options.package ?? '@deepbook/core';\n\tconst argumentsTypes = [null] satisfies (string | null)[];\n\tconst parameterNames = ['self'];\n\treturn (tx: Transaction) =>\n\t\ttx.moveCall({\n\t\t\tpackage: packageAddress,\n\t\t\tmodule: 'account',\n\t\t\tfunction: 'created_proposal',\n\t\t\targuments: normalizeMoveArguments(options.arguments, argumentsTypes, parameterNames),\n\t\t});\n}\nexport interface VotedProposalArguments {\n\tself: RawTransactionArgument<string>;\n}\nexport interface VotedProposalOptions {\n\tpackage?: string;\n\targuments: VotedProposalArguments | [self: RawTransactionArgument<string>];\n}\nexport function votedProposal(options: VotedProposalOptions) {\n\tconst packageAddress = options.package ?? '@deepbook/core';\n\tconst argumentsTypes = [null] satisfies (string | null)[];\n\tconst parameterNames = ['self'];\n\treturn (tx: Transaction) =>\n\t\ttx.moveCall({\n\t\t\tpackage: packageAddress,\n\t\t\tmodule: 'account',\n\t\t\tfunction: 'voted_proposal',\n\t\t\targuments: normalizeMoveArguments(options.arguments, argumentsTypes, parameterNames),\n\t\t});\n}\nexport interface SettledBalancesArguments {\n\tself: RawTransactionArgument<string>;\n}\nexport interface SettledBalancesOptions {\n\tpackage?: string;\n\targuments: SettledBalancesArguments | [self: RawTransactionArgument<string>];\n}\nexport function settledBalances(options: SettledBalancesOptions) {\n\tconst packageAddress = options.package ?? '@deepbook/core';\n\tconst argumentsTypes = [null] satisfies (string | null)[];\n\tconst parameterNames = ['self'];\n\treturn (tx: Transaction) =>\n\t\ttx.moveCall({\n\t\t\tpackage: packageAddress,\n\t\t\tmodule: 'account',\n\t\t\tfunction: 'settled_balances',\n\t\t\targuments: normalizeMoveArguments(options.arguments, argumentsTypes, parameterNames),\n\t\t});\n}\n"],"mappings":";;;;;;;;;;AAWA,MAAM,cAAc;AACpB,MAAa,UAAU,IAAI,WAAW;CACrC,MAAM,GAAG,YAAY;CACrB,QAAQ;EACP,OAAO,IAAI,KAAK;EAChB,aAAaA,OAAe,IAAI,MAAM,CAAC;EACvC,cAAc,IAAI,MAAM;EACxB,cAAc,IAAI,MAAM;EACxB,cAAc,IAAI,KAAK;EACvB,gBAAgB,IAAI,KAAK;EACzB,kBAAkB,IAAI,MAAM;EAC5B,gBAAgB,IAAI,OAAO,IAAI,QAAQ;EACvC,mBAAmBC;EACnB,kBAAkBA;EAClB,eAAeA;EACf;CACD,CAAC"}
@@ -0,0 +1,13 @@
1
+ import { MoveStruct } from "../utils/index.mjs";
2
+ import * as _mysten_sui_bcs16 from "@mysten/sui/bcs";
3
+
4
+ //#region src/contracts/deepbook/balances.d.ts
5
+
6
+ declare const Balances: MoveStruct<{
7
+ base: _mysten_sui_bcs16.BcsType<string, string | number | bigint, "u64">;
8
+ quote: _mysten_sui_bcs16.BcsType<string, string | number | bigint, "u64">;
9
+ deep: _mysten_sui_bcs16.BcsType<string, string | number | bigint, "u64">;
10
+ }, "@deepbook/core::balances::Balances">;
11
+ //#endregion
12
+ export { Balances };
13
+ //# sourceMappingURL=balances.d.mts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"balances.d.mts","names":[],"sources":["../../../src/contracts/deepbook/balances.ts"],"sourcesContent":[],"mappings":";;;;;AAYqB,cAAR,QAAQ,EAAA,UAAA,CAAA;EAAA,IAAA,EAOnB,iBAAA,CAAA,OAPmB,CAAA,MAAA,EAAA,MAAA,GAAA,MAAA,GAAA,MAAA,EAAA,KAAA,CAAA"}
@@ -0,0 +1,24 @@
1
+ import { MoveStruct } from "../utils/index.mjs";
2
+ import { bcs } from "@mysten/sui/bcs";
3
+
4
+ //#region src/contracts/deepbook/balances.ts
5
+ /**************************************************************
6
+ * THIS FILE IS GENERATED AND SHOULD NOT BE MANUALLY MODIFIED *
7
+ **************************************************************/
8
+ /**
9
+ * `Balances` represents the three assets make up a pool: base, quote, and deep.
10
+ * Whenever funds are moved, they are moved in the form of `Balances`.
11
+ */
12
+ const $moduleName = "@deepbook/core::balances";
13
+ const Balances = new MoveStruct({
14
+ name: `${$moduleName}::Balances`,
15
+ fields: {
16
+ base: bcs.u64(),
17
+ quote: bcs.u64(),
18
+ deep: bcs.u64()
19
+ }
20
+ });
21
+
22
+ //#endregion
23
+ export { Balances };
24
+ //# sourceMappingURL=balances.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"balances.mjs","names":[],"sources":["../../../src/contracts/deepbook/balances.ts"],"sourcesContent":["/**************************************************************\n * THIS FILE IS GENERATED AND SHOULD NOT BE MANUALLY MODIFIED *\n **************************************************************/\n\n/**\n * `Balances` represents the three assets make up a pool: base, quote, and deep.\n * Whenever funds are moved, they are moved in the form of `Balances`.\n */\n\nimport { MoveStruct } from '../utils/index.js';\nimport { bcs } from '@mysten/sui/bcs';\nconst $moduleName = '@deepbook/core::balances';\nexport const Balances = new MoveStruct({\n\tname: `${$moduleName}::Balances`,\n\tfields: {\n\t\tbase: bcs.u64(),\n\t\tquote: bcs.u64(),\n\t\tdeep: bcs.u64(),\n\t},\n});\n"],"mappings":";;;;;;;;;;;AAWA,MAAM,cAAc;AACpB,MAAa,WAAW,IAAI,WAAW;CACtC,MAAM,GAAG,YAAY;CACrB,QAAQ;EACP,MAAM,IAAI,KAAK;EACf,OAAO,IAAI,KAAK;EAChB,MAAM,IAAI,KAAK;EACf;CACD,CAAC"}
@@ -0,0 +1,13 @@
1
+ import { MoveStruct } from "../utils/index.mjs";
2
+ import * as _mysten_sui_bcs19 from "@mysten/sui/bcs";
3
+ import { Transaction } from "@mysten/sui/transactions";
4
+
5
+ //#region src/contracts/deepbook/deep_price.d.ts
6
+
7
+ declare const OrderDeepPrice: MoveStruct<{
8
+ asset_is_base: _mysten_sui_bcs19.BcsType<boolean, boolean, "bool">;
9
+ deep_per_asset: _mysten_sui_bcs19.BcsType<string, string | number | bigint, "u64">;
10
+ }, "@deepbook/core::deep_price::OrderDeepPrice">;
11
+ //#endregion
12
+ export { OrderDeepPrice };
13
+ //# sourceMappingURL=deep_price.d.mts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"deep_price.d.mts","names":[],"sources":["../../../src/contracts/deepbook/deep_price.ts"],"sourcesContent":[],"mappings":";;;;;;cAuCa,gBAAc;iBAMzB,iBAAA,CAAA"}
@@ -0,0 +1,49 @@
1
+ import { MoveStruct } from "../utils/index.mjs";
2
+ import { bcs } from "@mysten/sui/bcs";
3
+
4
+ //#region src/contracts/deepbook/deep_price.ts
5
+ /**************************************************************
6
+ * THIS FILE IS GENERATED AND SHOULD NOT BE MANUALLY MODIFIED *
7
+ **************************************************************/
8
+ /**
9
+ * DEEP price module. This module maintains the conversion rate between DEEP and
10
+ * the base and quote assets.
11
+ */
12
+ const $moduleName = "@deepbook/core::deep_price";
13
+ const Price = new MoveStruct({
14
+ name: `${$moduleName}::Price`,
15
+ fields: {
16
+ conversion_rate: bcs.u64(),
17
+ timestamp: bcs.u64()
18
+ }
19
+ });
20
+ const PriceAdded = new MoveStruct({
21
+ name: `${$moduleName}::PriceAdded`,
22
+ fields: {
23
+ conversion_rate: bcs.u64(),
24
+ timestamp: bcs.u64(),
25
+ is_base_conversion: bcs.bool(),
26
+ reference_pool: bcs.Address,
27
+ target_pool: bcs.Address
28
+ }
29
+ });
30
+ const DeepPrice = new MoveStruct({
31
+ name: `${$moduleName}::DeepPrice`,
32
+ fields: {
33
+ base_prices: bcs.vector(Price),
34
+ cumulative_base: bcs.u64(),
35
+ quote_prices: bcs.vector(Price),
36
+ cumulative_quote: bcs.u64()
37
+ }
38
+ });
39
+ const OrderDeepPrice = new MoveStruct({
40
+ name: `${$moduleName}::OrderDeepPrice`,
41
+ fields: {
42
+ asset_is_base: bcs.bool(),
43
+ deep_per_asset: bcs.u64()
44
+ }
45
+ });
46
+
47
+ //#endregion
48
+ export { OrderDeepPrice };
49
+ //# sourceMappingURL=deep_price.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"deep_price.mjs","names":[],"sources":["../../../src/contracts/deepbook/deep_price.ts"],"sourcesContent":["/**************************************************************\n * THIS FILE IS GENERATED AND SHOULD NOT BE MANUALLY MODIFIED *\n **************************************************************/\n\n/**\n * DEEP price module. This module maintains the conversion rate between DEEP and\n * the base and quote assets.\n */\n\nimport { MoveStruct, normalizeMoveArguments, type RawTransactionArgument } from '../utils/index.js';\nimport { bcs } from '@mysten/sui/bcs';\nimport { type Transaction } from '@mysten/sui/transactions';\nconst $moduleName = '@deepbook/core::deep_price';\nexport const Price = new MoveStruct({\n\tname: `${$moduleName}::Price`,\n\tfields: {\n\t\tconversion_rate: bcs.u64(),\n\t\ttimestamp: bcs.u64(),\n\t},\n});\nexport const PriceAdded = new MoveStruct({\n\tname: `${$moduleName}::PriceAdded`,\n\tfields: {\n\t\tconversion_rate: bcs.u64(),\n\t\ttimestamp: bcs.u64(),\n\t\tis_base_conversion: bcs.bool(),\n\t\treference_pool: bcs.Address,\n\t\ttarget_pool: bcs.Address,\n\t},\n});\nexport const DeepPrice = new MoveStruct({\n\tname: `${$moduleName}::DeepPrice`,\n\tfields: {\n\t\tbase_prices: bcs.vector(Price),\n\t\tcumulative_base: bcs.u64(),\n\t\tquote_prices: bcs.vector(Price),\n\t\tcumulative_quote: bcs.u64(),\n\t},\n});\nexport const OrderDeepPrice = new MoveStruct({\n\tname: `${$moduleName}::OrderDeepPrice`,\n\tfields: {\n\t\tasset_is_base: bcs.bool(),\n\t\tdeep_per_asset: bcs.u64(),\n\t},\n});\nexport interface AssetIsBaseArguments {\n\tself: RawTransactionArgument<string>;\n}\nexport interface AssetIsBaseOptions {\n\tpackage?: string;\n\targuments: AssetIsBaseArguments | [self: RawTransactionArgument<string>];\n}\nexport function assetIsBase(options: AssetIsBaseOptions) {\n\tconst packageAddress = options.package ?? '@deepbook/core';\n\tconst argumentsTypes = [null] satisfies (string | null)[];\n\tconst parameterNames = ['self'];\n\treturn (tx: Transaction) =>\n\t\ttx.moveCall({\n\t\t\tpackage: packageAddress,\n\t\t\tmodule: 'deep_price',\n\t\t\tfunction: 'asset_is_base',\n\t\t\targuments: normalizeMoveArguments(options.arguments, argumentsTypes, parameterNames),\n\t\t});\n}\nexport interface DeepPerAssetArguments {\n\tself: RawTransactionArgument<string>;\n}\nexport interface DeepPerAssetOptions {\n\tpackage?: string;\n\targuments: DeepPerAssetArguments | [self: RawTransactionArgument<string>];\n}\nexport function deepPerAsset(options: DeepPerAssetOptions) {\n\tconst packageAddress = options.package ?? '@deepbook/core';\n\tconst argumentsTypes = [null] satisfies (string | null)[];\n\tconst parameterNames = ['self'];\n\treturn (tx: Transaction) =>\n\t\ttx.moveCall({\n\t\t\tpackage: packageAddress,\n\t\t\tmodule: 'deep_price',\n\t\t\tfunction: 'deep_per_asset',\n\t\t\targuments: normalizeMoveArguments(options.arguments, argumentsTypes, parameterNames),\n\t\t});\n}\n"],"mappings":";;;;;;;;;;;AAYA,MAAM,cAAc;AACpB,MAAa,QAAQ,IAAI,WAAW;CACnC,MAAM,GAAG,YAAY;CACrB,QAAQ;EACP,iBAAiB,IAAI,KAAK;EAC1B,WAAW,IAAI,KAAK;EACpB;CACD,CAAC;AACF,MAAa,aAAa,IAAI,WAAW;CACxC,MAAM,GAAG,YAAY;CACrB,QAAQ;EACP,iBAAiB,IAAI,KAAK;EAC1B,WAAW,IAAI,KAAK;EACpB,oBAAoB,IAAI,MAAM;EAC9B,gBAAgB,IAAI;EACpB,aAAa,IAAI;EACjB;CACD,CAAC;AACF,MAAa,YAAY,IAAI,WAAW;CACvC,MAAM,GAAG,YAAY;CACrB,QAAQ;EACP,aAAa,IAAI,OAAO,MAAM;EAC9B,iBAAiB,IAAI,KAAK;EAC1B,cAAc,IAAI,OAAO,MAAM;EAC/B,kBAAkB,IAAI,KAAK;EAC3B;CACD,CAAC;AACF,MAAa,iBAAiB,IAAI,WAAW;CAC5C,MAAM,GAAG,YAAY;CACrB,QAAQ;EACP,eAAe,IAAI,MAAM;EACzB,gBAAgB,IAAI,KAAK;EACzB;CACD,CAAC"}
@@ -0,0 +1,22 @@
1
+ import { MoveStruct } from "../../../utils/index.mjs";
2
+ import { BcsType } from "@mysten/sui/bcs";
3
+ import * as _mysten_bcs0 from "@mysten/bcs";
4
+
5
+ //#region src/contracts/deepbook/deps/sui/vec_set.d.ts
6
+
7
+ /**
8
+ * A set data structure backed by a vector. The set is guaranteed not to contain
9
+ * duplicate keys. All operations are O(N) in the size of the set
10
+ *
11
+ * - the intention of this data structure is only to provide the convenience of
12
+ * programming against a set API. Sets that need sorted iteration rather than
13
+ * insertion order iteration should be handwritten.
14
+ */
15
+ declare function VecSet<K extends BcsType<any>>(...typeParameters: [K]): MoveStruct<{
16
+ contents: BcsType<_mysten_bcs0.InferBcsType<K>[], Iterable<_mysten_bcs0.InferBcsInput<K>> & {
17
+ length: number;
18
+ }, string>;
19
+ }, `0x2::vec_set::VecSet<${K["name"]}>`>;
20
+ //#endregion
21
+ export { VecSet };
22
+ //# sourceMappingURL=vec_set.d.mts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"vec_set.d.mts","names":[],"sources":["../../../../../src/contracts/deepbook/deps/sui/vec_set.ts"],"sourcesContent":[],"mappings":";;;;;;AAcA;;;;;;;;iBAAgB,iBAAiB,kCAAkC,KAAE;;IAAA,MAAA,EAAA,MAAA;EAAA,CAAA,EAAA,MAAA,CAAA"}
@@ -0,0 +1,26 @@
1
+ import { MoveStruct } from "../../../utils/index.mjs";
2
+ import { bcs } from "@mysten/sui/bcs";
3
+
4
+ //#region src/contracts/deepbook/deps/sui/vec_set.ts
5
+ /**************************************************************
6
+ * THIS FILE IS GENERATED AND SHOULD NOT BE MANUALLY MODIFIED *
7
+ **************************************************************/
8
+ const $moduleName = "0x2::vec_set";
9
+ /**
10
+ * A set data structure backed by a vector. The set is guaranteed not to contain
11
+ * duplicate keys. All operations are O(N) in the size of the set
12
+ *
13
+ * - the intention of this data structure is only to provide the convenience of
14
+ * programming against a set API. Sets that need sorted iteration rather than
15
+ * insertion order iteration should be handwritten.
16
+ */
17
+ function VecSet(...typeParameters) {
18
+ return new MoveStruct({
19
+ name: `${$moduleName}::VecSet<${typeParameters[0].name}>`,
20
+ fields: { contents: bcs.vector(typeParameters[0]) }
21
+ });
22
+ }
23
+
24
+ //#endregion
25
+ export { VecSet };
26
+ //# sourceMappingURL=vec_set.mjs.map