@typus/typus-perp-sdk 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 (415) hide show
  1. package/dist/src/_dependencies/source/0x1/ascii/structs.d.ts +92 -0
  2. package/dist/src/_dependencies/source/0x1/ascii/structs.js +398 -0
  3. package/dist/src/_dependencies/source/0x1/bit-vector/structs.d.ts +56 -0
  4. package/dist/src/_dependencies/source/0x1/bit-vector/structs.js +268 -0
  5. package/dist/src/_dependencies/source/0x1/fixed-point32/structs.d.ts +46 -0
  6. package/dist/src/_dependencies/source/0x1/fixed-point32/structs.js +222 -0
  7. package/dist/src/_dependencies/source/0x1/index.d.ts +3 -0
  8. package/dist/src/_dependencies/source/0x1/index.js +6 -0
  9. package/dist/src/_dependencies/source/0x1/init.d.ts +2 -0
  10. package/dist/src/_dependencies/source/0x1/init.js +55 -0
  11. package/dist/src/_dependencies/source/0x1/option/structs.d.ts +52 -0
  12. package/dist/src/_dependencies/source/0x1/option/structs.js +271 -0
  13. package/dist/src/_dependencies/source/0x1/string/structs.d.ts +50 -0
  14. package/dist/src/_dependencies/source/0x1/string/structs.js +256 -0
  15. package/dist/src/_dependencies/source/0x1/type-name/structs.d.ts +53 -0
  16. package/dist/src/_dependencies/source/0x1/type-name/structs.js +223 -0
  17. package/dist/src/_dependencies/source/0x1/uq32-32/structs.d.ts +46 -0
  18. package/dist/src/_dependencies/source/0x1/uq32-32/structs.js +222 -0
  19. package/dist/src/_dependencies/source/0x1/uq64-64/structs.d.ts +46 -0
  20. package/dist/src/_dependencies/source/0x1/uq64-64/structs.js +222 -0
  21. package/dist/src/_dependencies/source/0x1d17058789bd1e1e79f1a92424519a88146f191f58a06cc4d9ab23d17d46ab73/index.d.ts +5 -0
  22. package/dist/src/_dependencies/source/0x1d17058789bd1e1e79f1a92424519a88146f191f58a06cc4d9ab23d17d46ab73/index.js +8 -0
  23. package/dist/src/_dependencies/source/0x1d17058789bd1e1e79f1a92424519a88146f191f58a06cc4d9ab23d17d46ab73/init.d.ts +2 -0
  24. package/dist/src/_dependencies/source/0x1d17058789bd1e1e79f1a92424519a88146f191f58a06cc4d9ab23d17d46ab73/init.js +50 -0
  25. package/dist/src/_dependencies/source/0x1d17058789bd1e1e79f1a92424519a88146f191f58a06cc4d9ab23d17d46ab73/oracle/structs.d.ts +350 -0
  26. package/dist/src/_dependencies/source/0x1d17058789bd1e1e79f1a92424519a88146f191f58a06cc4d9ab23d17d46ab73/oracle/structs.js +794 -0
  27. package/dist/src/_dependencies/source/0x1d17058789bd1e1e79f1a92424519a88146f191f58a06cc4d9ab23d17d46ab73/pyth-parser/structs.d.ts +111 -0
  28. package/dist/src/_dependencies/source/0x1d17058789bd1e1e79f1a92424519a88146f191f58a06cc4d9ab23d17d46ab73/pyth-parser/structs.js +389 -0
  29. package/dist/src/_dependencies/source/0x1d17058789bd1e1e79f1a92424519a88146f191f58a06cc4d9ab23d17d46ab73/supra/structs.d.ts +70 -0
  30. package/dist/src/_dependencies/source/0x1d17058789bd1e1e79f1a92424519a88146f191f58a06cc4d9ab23d17d46ab73/supra/structs.js +252 -0
  31. package/dist/src/_dependencies/source/0x1d17058789bd1e1e79f1a92424519a88146f191f58a06cc4d9ab23d17d46ab73/switchboard-feed-parser/structs.d.ts +70 -0
  32. package/dist/src/_dependencies/source/0x1d17058789bd1e1e79f1a92424519a88146f191f58a06cc4d9ab23d17d46ab73/switchboard-feed-parser/structs.js +252 -0
  33. package/dist/src/_dependencies/source/0x2/authenticator-state/structs.d.ts +464 -0
  34. package/dist/src/_dependencies/source/0x2/authenticator-state/structs.js +904 -0
  35. package/dist/src/_dependencies/source/0x2/bag/structs.d.ts +61 -0
  36. package/dist/src/_dependencies/source/0x2/bag/structs.js +229 -0
  37. package/dist/src/_dependencies/source/0x2/balance/structs.d.ts +88 -0
  38. package/dist/src/_dependencies/source/0x2/balance/structs.js +386 -0
  39. package/dist/src/_dependencies/source/0x2/bcs/structs.d.ts +50 -0
  40. package/dist/src/_dependencies/source/0x2/bcs/structs.js +256 -0
  41. package/dist/src/_dependencies/source/0x2/bls12381/structs.d.ts +214 -0
  42. package/dist/src/_dependencies/source/0x2/bls12381/structs.js +790 -0
  43. package/dist/src/_dependencies/source/0x2/borrow/structs.d.ts +113 -0
  44. package/dist/src/_dependencies/source/0x2/borrow/structs.js +398 -0
  45. package/dist/src/_dependencies/source/0x2/clock/structs.d.ts +61 -0
  46. package/dist/src/_dependencies/source/0x2/clock/structs.js +235 -0
  47. package/dist/src/_dependencies/source/0x2/coin/structs.d.ts +460 -0
  48. package/dist/src/_dependencies/source/0x2/coin/structs.js +1247 -0
  49. package/dist/src/_dependencies/source/0x2/config/structs.d.ts +179 -0
  50. package/dist/src/_dependencies/source/0x2/config/structs.js +567 -0
  51. package/dist/src/_dependencies/source/0x2/deny-list/structs.d.ts +430 -0
  52. package/dist/src/_dependencies/source/0x2/deny-list/structs.js +1166 -0
  53. package/dist/src/_dependencies/source/0x2/display/structs.d.ts +241 -0
  54. package/dist/src/_dependencies/source/0x2/display/structs.js +578 -0
  55. package/dist/src/_dependencies/source/0x2/dynamic-field/structs.d.ts +68 -0
  56. package/dist/src/_dependencies/source/0x2/dynamic-field/structs.js +256 -0
  57. package/dist/src/_dependencies/source/0x2/dynamic-object-field/structs.d.ts +47 -0
  58. package/dist/src/_dependencies/source/0x2/dynamic-object-field/structs.js +236 -0
  59. package/dist/src/_dependencies/source/0x2/groth16/structs.d.ts +204 -0
  60. package/dist/src/_dependencies/source/0x2/groth16/structs.js +706 -0
  61. package/dist/src/_dependencies/source/0x2/group-ops/structs.d.ts +50 -0
  62. package/dist/src/_dependencies/source/0x2/group-ops/structs.js +267 -0
  63. package/dist/src/_dependencies/source/0x2/index.d.ts +3 -0
  64. package/dist/src/_dependencies/source/0x2/index.js +6 -0
  65. package/dist/src/_dependencies/source/0x2/init.d.ts +2 -0
  66. package/dist/src/_dependencies/source/0x2/init.js +171 -0
  67. package/dist/src/_dependencies/source/0x2/kiosk/structs.d.ts +606 -0
  68. package/dist/src/_dependencies/source/0x2/kiosk/structs.js +1719 -0
  69. package/dist/src/_dependencies/source/0x2/kiosk-extension/structs.d.ts +121 -0
  70. package/dist/src/_dependencies/source/0x2/kiosk-extension/structs.js +394 -0
  71. package/dist/src/_dependencies/source/0x2/linked-table/structs.d.ts +153 -0
  72. package/dist/src/_dependencies/source/0x2/linked-table/structs.js +438 -0
  73. package/dist/src/_dependencies/source/0x2/object/structs.d.ts +92 -0
  74. package/dist/src/_dependencies/source/0x2/object/structs.js +364 -0
  75. package/dist/src/_dependencies/source/0x2/object-bag/structs.d.ts +61 -0
  76. package/dist/src/_dependencies/source/0x2/object-bag/structs.js +229 -0
  77. package/dist/src/_dependencies/source/0x2/object-table/structs.d.ts +61 -0
  78. package/dist/src/_dependencies/source/0x2/object-table/structs.js +248 -0
  79. package/dist/src/_dependencies/source/0x2/package/structs.d.ts +280 -0
  80. package/dist/src/_dependencies/source/0x2/package/structs.js +762 -0
  81. package/dist/src/_dependencies/source/0x2/priority-queue/structs.d.ts +111 -0
  82. package/dist/src/_dependencies/source/0x2/priority-queue/structs.js +440 -0
  83. package/dist/src/_dependencies/source/0x2/random/structs.d.ts +204 -0
  84. package/dist/src/_dependencies/source/0x2/random/structs.js +596 -0
  85. package/dist/src/_dependencies/source/0x2/sui/structs.d.ts +46 -0
  86. package/dist/src/_dependencies/source/0x2/sui/structs.js +222 -0
  87. package/dist/src/_dependencies/source/0x2/table/structs.d.ts +61 -0
  88. package/dist/src/_dependencies/source/0x2/table/structs.js +248 -0
  89. package/dist/src/_dependencies/source/0x2/table-vec/structs.d.ts +68 -0
  90. package/dist/src/_dependencies/source/0x2/table-vec/structs.js +274 -0
  91. package/dist/src/_dependencies/source/0x2/token/structs.d.ts +449 -0
  92. package/dist/src/_dependencies/source/0x2/token/structs.js +1095 -0
  93. package/dist/src/_dependencies/source/0x2/transfer/structs.d.ts +57 -0
  94. package/dist/src/_dependencies/source/0x2/transfer/structs.js +246 -0
  95. package/dist/src/_dependencies/source/0x2/transfer-policy/structs.d.ts +370 -0
  96. package/dist/src/_dependencies/source/0x2/transfer-policy/structs.js +1091 -0
  97. package/dist/src/_dependencies/source/0x2/tx-context/structs.d.ts +74 -0
  98. package/dist/src/_dependencies/source/0x2/tx-context/structs.js +286 -0
  99. package/dist/src/_dependencies/source/0x2/url/structs.d.ts +53 -0
  100. package/dist/src/_dependencies/source/0x2/url/structs.js +223 -0
  101. package/dist/src/_dependencies/source/0x2/vec-map/structs.d.ts +111 -0
  102. package/dist/src/_dependencies/source/0x2/vec-map/structs.js +446 -0
  103. package/dist/src/_dependencies/source/0x2/vec-set/structs.d.ts +51 -0
  104. package/dist/src/_dependencies/source/0x2/vec-set/structs.js +270 -0
  105. package/dist/src/_dependencies/source/0x2/versioned/structs.d.ts +113 -0
  106. package/dist/src/_dependencies/source/0x2/versioned/structs.js +389 -0
  107. package/dist/src/_dependencies/source/0x2/zklogin-verified-id/structs.d.ts +110 -0
  108. package/dist/src/_dependencies/source/0x2/zklogin-verified-id/structs.js +260 -0
  109. package/dist/src/_dependencies/source/0x2/zklogin-verified-issuer/structs.d.ts +74 -0
  110. package/dist/src/_dependencies/source/0x2/zklogin-verified-issuer/structs.js +242 -0
  111. package/dist/src/_dependencies/source/0x277f90d256d1015a78cad646db091bec451c5bbab834b9fb70bace7885b5c698/index.d.ts +3 -0
  112. package/dist/src/_dependencies/source/0x277f90d256d1015a78cad646db091bec451c5bbab834b9fb70bace7885b5c698/index.js +6 -0
  113. package/dist/src/_dependencies/source/0x277f90d256d1015a78cad646db091bec451c5bbab834b9fb70bace7885b5c698/init.d.ts +2 -0
  114. package/dist/src/_dependencies/source/0x277f90d256d1015a78cad646db091bec451c5bbab834b9fb70bace7885b5c698/init.js +40 -0
  115. package/dist/src/_dependencies/source/0x277f90d256d1015a78cad646db091bec451c5bbab834b9fb70bace7885b5c698/validator/structs.d.ts +55 -0
  116. package/dist/src/_dependencies/source/0x277f90d256d1015a78cad646db091bec451c5bbab834b9fb70bace7885b5c698/validator/structs.js +223 -0
  117. package/dist/src/_dependencies/source/0x2fdff17b86e34ab722c8ba5e63f0da070d9a4163705b3fdc6a95802cab40a72a/index.d.ts +4 -0
  118. package/dist/src/_dependencies/source/0x2fdff17b86e34ab722c8ba5e63f0da070d9a4163705b3fdc6a95802cab40a72a/index.js +7 -0
  119. package/dist/src/_dependencies/source/0x2fdff17b86e34ab722c8ba5e63f0da070d9a4163705b3fdc6a95802cab40a72a/init.d.ts +2 -0
  120. package/dist/src/_dependencies/source/0x2fdff17b86e34ab722c8ba5e63f0da070d9a4163705b3fdc6a95802cab40a72a/init.js +43 -0
  121. package/dist/src/_dependencies/source/0x2fdff17b86e34ab722c8ba5e63f0da070d9a4163705b3fdc6a95802cab40a72a/price-data-pull/structs.d.ts +46 -0
  122. package/dist/src/_dependencies/source/0x2fdff17b86e34ab722c8ba5e63f0da070d9a4163705b3fdc6a95802cab40a72a/price-data-pull/structs.js +222 -0
  123. package/dist/src/_dependencies/source/0x2fdff17b86e34ab722c8ba5e63f0da070d9a4163705b3fdc6a95802cab40a72a/suprasvaluefeed/structs.d.ts +121 -0
  124. package/dist/src/_dependencies/source/0x2fdff17b86e34ab722c8ba5e63f0da070d9a4163705b3fdc6a95802cab40a72a/suprasvaluefeed/structs.js +395 -0
  125. package/dist/src/_dependencies/source/0x4213e12a2220f15f1837a76897110d2260786558169bd8d0847f21e9b551f277/airdrop/structs.d.ts +489 -0
  126. package/dist/src/_dependencies/source/0x4213e12a2220f15f1837a76897110d2260786558169bd8d0847f21e9b551f277/airdrop/structs.js +1084 -0
  127. package/dist/src/_dependencies/source/0x4213e12a2220f15f1837a76897110d2260786558169bd8d0847f21e9b551f277/big-vector/structs.d.ts +147 -0
  128. package/dist/src/_dependencies/source/0x4213e12a2220f15f1837a76897110d2260786558169bd8d0847f21e9b551f277/big-vector/structs.js +456 -0
  129. package/dist/src/_dependencies/source/0x4213e12a2220f15f1837a76897110d2260786558169bd8d0847f21e9b551f277/critbit/structs.d.ts +239 -0
  130. package/dist/src/_dependencies/source/0x4213e12a2220f15f1837a76897110d2260786558169bd8d0847f21e9b551f277/critbit/structs.js +653 -0
  131. package/dist/src/_dependencies/source/0x4213e12a2220f15f1837a76897110d2260786558169bd8d0847f21e9b551f277/ecosystem/structs.d.ts +405 -0
  132. package/dist/src/_dependencies/source/0x4213e12a2220f15f1837a76897110d2260786558169bd8d0847f21e9b551f277/ecosystem/structs.js +899 -0
  133. package/dist/src/_dependencies/source/0x4213e12a2220f15f1837a76897110d2260786558169bd8d0847f21e9b551f277/index.d.ts +8 -0
  134. package/dist/src/_dependencies/source/0x4213e12a2220f15f1837a76897110d2260786558169bd8d0847f21e9b551f277/index.js +11 -0
  135. package/dist/src/_dependencies/source/0x4213e12a2220f15f1837a76897110d2260786558169bd8d0847f21e9b551f277/init.d.ts +2 -0
  136. package/dist/src/_dependencies/source/0x4213e12a2220f15f1837a76897110d2260786558169bd8d0847f21e9b551f277/init.js +102 -0
  137. package/dist/src/_dependencies/source/0x4213e12a2220f15f1837a76897110d2260786558169bd8d0847f21e9b551f277/keyed-big-vector/structs.d.ts +227 -0
  138. package/dist/src/_dependencies/source/0x4213e12a2220f15f1837a76897110d2260786558169bd8d0847f21e9b551f277/keyed-big-vector/structs.js +632 -0
  139. package/dist/src/_dependencies/source/0x4213e12a2220f15f1837a76897110d2260786558169bd8d0847f21e9b551f277/leaderboard/structs.d.ts +699 -0
  140. package/dist/src/_dependencies/source/0x4213e12a2220f15f1837a76897110d2260786558169bd8d0847f21e9b551f277/leaderboard/structs.js +1459 -0
  141. package/dist/src/_dependencies/source/0x4213e12a2220f15f1837a76897110d2260786558169bd8d0847f21e9b551f277/linked-object-table/structs.d.ts +161 -0
  142. package/dist/src/_dependencies/source/0x4213e12a2220f15f1837a76897110d2260786558169bd8d0847f21e9b551f277/linked-object-table/structs.js +438 -0
  143. package/dist/src/_dependencies/source/0x4213e12a2220f15f1837a76897110d2260786558169bd8d0847f21e9b551f277/linked-set/structs.d.ts +147 -0
  144. package/dist/src/_dependencies/source/0x4213e12a2220f15f1837a76897110d2260786558169bd8d0847f21e9b551f277/linked-set/structs.js +430 -0
  145. package/dist/src/_dependencies/source/0x4213e12a2220f15f1837a76897110d2260786558169bd8d0847f21e9b551f277/tails-staking/structs.d.ts +1071 -0
  146. package/dist/src/_dependencies/source/0x4213e12a2220f15f1837a76897110d2260786558169bd8d0847f21e9b551f277/tails-staking/structs.js +2261 -0
  147. package/dist/src/_dependencies/source/0x4213e12a2220f15f1837a76897110d2260786558169bd8d0847f21e9b551f277/tgld/structs.d.ts +279 -0
  148. package/dist/src/_dependencies/source/0x4213e12a2220f15f1837a76897110d2260786558169bd8d0847f21e9b551f277/tgld/structs.js +733 -0
  149. package/dist/src/_dependencies/source/0x4213e12a2220f15f1837a76897110d2260786558169bd8d0847f21e9b551f277/user/structs.d.ts +328 -0
  150. package/dist/src/_dependencies/source/0x4213e12a2220f15f1837a76897110d2260786558169bd8d0847f21e9b551f277/user/structs.js +892 -0
  151. package/dist/src/_dependencies/source/0x5cfd0819411be98034cba544cbffab192c2c35674a05ff57f4f1c5042875b828/discount-mint/structs.d.ts +628 -0
  152. package/dist/src/_dependencies/source/0x5cfd0819411be98034cba544cbffab192c2c35674a05ff57f4f1c5042875b828/discount-mint/structs.js +1324 -0
  153. package/dist/src/_dependencies/source/0x5cfd0819411be98034cba544cbffab192c2c35674a05ff57f4f1c5042875b828/index.d.ts +9 -0
  154. package/dist/src/_dependencies/source/0x5cfd0819411be98034cba544cbffab192c2c35674a05ff57f4f1c5042875b828/index.js +12 -0
  155. package/dist/src/_dependencies/source/0x5cfd0819411be98034cba544cbffab192c2c35674a05ff57f4f1c5042875b828/init.d.ts +2 -0
  156. package/dist/src/_dependencies/source/0x5cfd0819411be98034cba544cbffab192c2c35674a05ff57f4f1c5042875b828/init.js +72 -0
  157. package/dist/src/_dependencies/source/0x5cfd0819411be98034cba544cbffab192c2c35674a05ff57f4f1c5042875b828/royalty-rule/structs.d.ts +94 -0
  158. package/dist/src/_dependencies/source/0x5cfd0819411be98034cba544cbffab192c2c35674a05ff57f4f1c5042875b828/royalty-rule/structs.js +376 -0
  159. package/dist/src/_dependencies/source/0x5cfd0819411be98034cba544cbffab192c2c35674a05ff57f4f1c5042875b828/staking/structs.d.ts +454 -0
  160. package/dist/src/_dependencies/source/0x5cfd0819411be98034cba544cbffab192c2c35674a05ff57f4f1c5042875b828/staking/structs.js +881 -0
  161. package/dist/src/_dependencies/source/0x5cfd0819411be98034cba544cbffab192c2c35674a05ff57f4f1c5042875b828/table-vec/structs.d.ts +68 -0
  162. package/dist/src/_dependencies/source/0x5cfd0819411be98034cba544cbffab192c2c35674a05ff57f4f1c5042875b828/table-vec/structs.js +274 -0
  163. package/dist/src/_dependencies/source/0x5cfd0819411be98034cba544cbffab192c2c35674a05ff57f4f1c5042875b828/typus-nft/structs.d.ts +1117 -0
  164. package/dist/src/_dependencies/source/0x5cfd0819411be98034cba544cbffab192c2c35674a05ff57f4f1c5042875b828/typus-nft/structs.js +2387 -0
  165. package/dist/src/_dependencies/source/0x6c9a394a43844fc09d9617bc8a8e775a4521f0e28e83de1da780d043a498671f/auto-bid/structs.d.ts +1524 -0
  166. package/dist/src/_dependencies/source/0x6c9a394a43844fc09d9617bc8a8e775a4521f0e28e83de1da780d043a498671f/auto-bid/structs.js +3008 -0
  167. package/dist/src/_dependencies/source/0x6c9a394a43844fc09d9617bc8a8e775a4521f0e28e83de1da780d043a498671f/index.d.ts +10 -0
  168. package/dist/src/_dependencies/source/0x6c9a394a43844fc09d9617bc8a8e775a4521f0e28e83de1da780d043a498671f/index.js +13 -0
  169. package/dist/src/_dependencies/source/0x6c9a394a43844fc09d9617bc8a8e775a4521f0e28e83de1da780d043a498671f/init.d.ts +2 -0
  170. package/dist/src/_dependencies/source/0x6c9a394a43844fc09d9617bc8a8e775a4521f0e28e83de1da780d043a498671f/init.js +145 -0
  171. package/dist/src/_dependencies/source/0x6c9a394a43844fc09d9617bc8a8e775a4521f0e28e83de1da780d043a498671f/tails-staking/structs.d.ts +1267 -0
  172. package/dist/src/_dependencies/source/0x6c9a394a43844fc09d9617bc8a8e775a4521f0e28e83de1da780d043a498671f/tails-staking/structs.js +2820 -0
  173. package/dist/src/_dependencies/source/0x6c9a394a43844fc09d9617bc8a8e775a4521f0e28e83de1da780d043a498671f/tds-authorized-entry/structs.d.ts +1412 -0
  174. package/dist/src/_dependencies/source/0x6c9a394a43844fc09d9617bc8a8e775a4521f0e28e83de1da780d043a498671f/tds-authorized-entry/structs.js +1646 -0
  175. package/dist/src/_dependencies/source/0x6c9a394a43844fc09d9617bc8a8e775a4521f0e28e83de1da780d043a498671f/tds-fee-pool-entry/structs.d.ts +425 -0
  176. package/dist/src/_dependencies/source/0x6c9a394a43844fc09d9617bc8a8e775a4521f0e28e83de1da780d043a498671f/tds-fee-pool-entry/structs.js +1223 -0
  177. package/dist/src/_dependencies/source/0x6c9a394a43844fc09d9617bc8a8e775a4521f0e28e83de1da780d043a498671f/tds-registry-authorized-entry/structs.d.ts +1156 -0
  178. package/dist/src/_dependencies/source/0x6c9a394a43844fc09d9617bc8a8e775a4521f0e28e83de1da780d043a498671f/tds-registry-authorized-entry/structs.js +1828 -0
  179. package/dist/src/_dependencies/source/0x6c9a394a43844fc09d9617bc8a8e775a4521f0e28e83de1da780d043a498671f/tds-view-function/structs.d.ts +82 -0
  180. package/dist/src/_dependencies/source/0x6c9a394a43844fc09d9617bc8a8e775a4521f0e28e83de1da780d043a498671f/tds-view-function/structs.js +264 -0
  181. package/dist/src/_dependencies/source/0x6c9a394a43844fc09d9617bc8a8e775a4521f0e28e83de1da780d043a498671f/typus-dov-single/structs.d.ts +5022 -0
  182. package/dist/src/_dependencies/source/0x6c9a394a43844fc09d9617bc8a8e775a4521f0e28e83de1da780d043a498671f/typus-dov-single/structs.js +7585 -0
  183. package/dist/src/_dependencies/source/0x7237ec8436ef7e927c45470db6db3a834dd84cf903aedee3844e847fe4805399/index.d.ts +3 -0
  184. package/dist/src/_dependencies/source/0x7237ec8436ef7e927c45470db6db3a834dd84cf903aedee3844e847fe4805399/index.js +6 -0
  185. package/dist/src/_dependencies/source/0x7237ec8436ef7e927c45470db6db3a834dd84cf903aedee3844e847fe4805399/init.d.ts +2 -0
  186. package/dist/src/_dependencies/source/0x7237ec8436ef7e927c45470db6db3a834dd84cf903aedee3844e847fe4805399/init.js +4 -0
  187. package/dist/src/_dependencies/source/0x908a10789a1a6953e0b73a997c10e3552f7ce4e2907afd00a334ed74bd973ded/authority/structs.d.ts +88 -0
  188. package/dist/src/_dependencies/source/0x908a10789a1a6953e0b73a997c10e3552f7ce4e2907afd00a334ed74bd973ded/authority/structs.js +263 -0
  189. package/dist/src/_dependencies/source/0x908a10789a1a6953e0b73a997c10e3552f7ce4e2907afd00a334ed74bd973ded/balance-pool/structs.d.ts +347 -0
  190. package/dist/src/_dependencies/source/0x908a10789a1a6953e0b73a997c10e3552f7ce4e2907afd00a334ed74bd973ded/balance-pool/structs.js +591 -0
  191. package/dist/src/_dependencies/source/0x908a10789a1a6953e0b73a997c10e3552f7ce4e2907afd00a334ed74bd973ded/big-vector/structs.d.ts +73 -0
  192. package/dist/src/_dependencies/source/0x908a10789a1a6953e0b73a997c10e3552f7ce4e2907afd00a334ed74bd973ded/big-vector/structs.js +258 -0
  193. package/dist/src/_dependencies/source/0x908a10789a1a6953e0b73a997c10e3552f7ce4e2907afd00a334ed74bd973ded/dutch/structs.d.ts +876 -0
  194. package/dist/src/_dependencies/source/0x908a10789a1a6953e0b73a997c10e3552f7ce4e2907afd00a334ed74bd973ded/dutch/structs.js +1721 -0
  195. package/dist/src/_dependencies/source/0x908a10789a1a6953e0b73a997c10e3552f7ce4e2907afd00a334ed74bd973ded/i64/structs.d.ts +46 -0
  196. package/dist/src/_dependencies/source/0x908a10789a1a6953e0b73a997c10e3552f7ce4e2907afd00a334ed74bd973ded/i64/structs.js +222 -0
  197. package/dist/src/_dependencies/source/0x908a10789a1a6953e0b73a997c10e3552f7ce4e2907afd00a334ed74bd973ded/index.d.ts +3 -0
  198. package/dist/src/_dependencies/source/0x908a10789a1a6953e0b73a997c10e3552f7ce4e2907afd00a334ed74bd973ded/index.js +6 -0
  199. package/dist/src/_dependencies/source/0x908a10789a1a6953e0b73a997c10e3552f7ce4e2907afd00a334ed74bd973ded/init.d.ts +2 -0
  200. package/dist/src/_dependencies/source/0x908a10789a1a6953e0b73a997c10e3552f7ce4e2907afd00a334ed74bd973ded/init.js +89 -0
  201. package/dist/src/_dependencies/source/0x908a10789a1a6953e0b73a997c10e3552f7ce4e2907afd00a334ed74bd973ded/linked-list/structs.d.ts +155 -0
  202. package/dist/src/_dependencies/source/0x908a10789a1a6953e0b73a997c10e3552f7ce4e2907afd00a334ed74bd973ded/linked-list/structs.js +444 -0
  203. package/dist/src/_dependencies/source/0x908a10789a1a6953e0b73a997c10e3552f7ce4e2907afd00a334ed74bd973ded/vault/structs.d.ts +2386 -0
  204. package/dist/src/_dependencies/source/0x908a10789a1a6953e0b73a997c10e3552f7ce4e2907afd00a334ed74bd973ded/vault/structs.js +4952 -0
  205. package/dist/src/_dependencies/source/0x98670585b87e06628ef2d7f7cb1e7bee8ada65b43b82997935225a7e6e21d18e/aggregator/structs.d.ts +745 -0
  206. package/dist/src/_dependencies/source/0x98670585b87e06628ef2d7f7cb1e7bee8ada65b43b82997935225a7e6e21d18e/aggregator/structs.js +1221 -0
  207. package/dist/src/_dependencies/source/0x98670585b87e06628ef2d7f7cb1e7bee8ada65b43b82997935225a7e6e21d18e/index.d.ts +3 -0
  208. package/dist/src/_dependencies/source/0x98670585b87e06628ef2d7f7cb1e7bee8ada65b43b82997935225a7e6e21d18e/index.js +6 -0
  209. package/dist/src/_dependencies/source/0x98670585b87e06628ef2d7f7cb1e7bee8ada65b43b82997935225a7e6e21d18e/init.d.ts +2 -0
  210. package/dist/src/_dependencies/source/0x98670585b87e06628ef2d7f7cb1e7bee8ada65b43b82997935225a7e6e21d18e/init.js +53 -0
  211. package/dist/src/_dependencies/source/0x98670585b87e06628ef2d7f7cb1e7bee8ada65b43b82997935225a7e6e21d18e/job/structs.d.ts +87 -0
  212. package/dist/src/_dependencies/source/0x98670585b87e06628ef2d7f7cb1e7bee8ada65b43b82997935225a7e6e21d18e/job/structs.js +287 -0
  213. package/dist/src/_dependencies/source/0x98670585b87e06628ef2d7f7cb1e7bee8ada65b43b82997935225a7e6e21d18e/math/structs.d.ts +58 -0
  214. package/dist/src/_dependencies/source/0x98670585b87e06628ef2d7f7cb1e7bee8ada65b43b82997935225a7e6e21d18e/math/structs.js +240 -0
  215. package/dist/src/_dependencies/source/0x98670585b87e06628ef2d7f7cb1e7bee8ada65b43b82997935225a7e6e21d18e/quote/structs.d.ts +121 -0
  216. package/dist/src/_dependencies/source/0x98670585b87e06628ef2d7f7cb1e7bee8ada65b43b82997935225a7e6e21d18e/quote/structs.js +323 -0
  217. package/dist/src/_dependencies/source/0x98670585b87e06628ef2d7f7cb1e7bee8ada65b43b82997935225a7e6e21d18e/switchboard/structs.d.ts +55 -0
  218. package/dist/src/_dependencies/source/0x98670585b87e06628ef2d7f7cb1e7bee8ada65b43b82997935225a7e6e21d18e/switchboard/structs.js +223 -0
  219. package/dist/src/_dependencies/source/0xabf837e98c26087cba0883c0a7a28326b1fa3c5e1e2c5abdb486f9e8f594c837/batch-price-attestation/structs.d.ts +289 -0
  220. package/dist/src/_dependencies/source/0xabf837e98c26087cba0883c0a7a28326b1fa3c5e1e2c5abdb486f9e8f594c837/batch-price-attestation/structs.js +453 -0
  221. package/dist/src/_dependencies/source/0xabf837e98c26087cba0883c0a7a28326b1fa3c5e1e2c5abdb486f9e8f594c837/contract-upgrade/structs.d.ts +114 -0
  222. package/dist/src/_dependencies/source/0xabf837e98c26087cba0883c0a7a28326b1fa3c5e1e2c5abdb486f9e8f594c837/contract-upgrade/structs.js +378 -0
  223. package/dist/src/_dependencies/source/0xabf837e98c26087cba0883c0a7a28326b1fa3c5e1e2c5abdb486f9e8f594c837/data-source/structs.d.ts +71 -0
  224. package/dist/src/_dependencies/source/0xabf837e98c26087cba0883c0a7a28326b1fa3c5e1e2c5abdb486f9e8f594c837/data-source/structs.js +235 -0
  225. package/dist/src/_dependencies/source/0xabf837e98c26087cba0883c0a7a28326b1fa3c5e1e2c5abdb486f9e8f594c837/event/structs.d.ts +209 -0
  226. package/dist/src/_dependencies/source/0xabf837e98c26087cba0883c0a7a28326b1fa3c5e1e2c5abdb486f9e8f594c837/event/structs.js +377 -0
  227. package/dist/src/_dependencies/source/0xabf837e98c26087cba0883c0a7a28326b1fa3c5e1e2c5abdb486f9e8f594c837/governance/structs.d.ts +73 -0
  228. package/dist/src/_dependencies/source/0xabf837e98c26087cba0883c0a7a28326b1fa3c5e1e2c5abdb486f9e8f594c837/governance/structs.js +275 -0
  229. package/dist/src/_dependencies/source/0xabf837e98c26087cba0883c0a7a28326b1fa3c5e1e2c5abdb486f9e8f594c837/governance-action/structs.d.ts +46 -0
  230. package/dist/src/_dependencies/source/0xabf837e98c26087cba0883c0a7a28326b1fa3c5e1e2c5abdb486f9e8f594c837/governance-action/structs.js +222 -0
  231. package/dist/src/_dependencies/source/0xabf837e98c26087cba0883c0a7a28326b1fa3c5e1e2c5abdb486f9e8f594c837/governance-instruction/structs.d.ts +77 -0
  232. package/dist/src/_dependencies/source/0xabf837e98c26087cba0883c0a7a28326b1fa3c5e1e2c5abdb486f9e8f594c837/governance-instruction/structs.js +281 -0
  233. package/dist/src/_dependencies/source/0xabf837e98c26087cba0883c0a7a28326b1fa3c5e1e2c5abdb486f9e8f594c837/hot-potato-vector/structs.d.ts +51 -0
  234. package/dist/src/_dependencies/source/0xabf837e98c26087cba0883c0a7a28326b1fa3c5e1e2c5abdb486f9e8f594c837/hot-potato-vector/structs.js +270 -0
  235. package/dist/src/_dependencies/source/0xabf837e98c26087cba0883c0a7a28326b1fa3c5e1e2c5abdb486f9e8f594c837/i64/structs.d.ts +52 -0
  236. package/dist/src/_dependencies/source/0xabf837e98c26087cba0883c0a7a28326b1fa3c5e1e2c5abdb486f9e8f594c837/i64/structs.js +234 -0
  237. package/dist/src/_dependencies/source/0xabf837e98c26087cba0883c0a7a28326b1fa3c5e1e2c5abdb486f9e8f594c837/index.d.ts +3 -0
  238. package/dist/src/_dependencies/source/0xabf837e98c26087cba0883c0a7a28326b1fa3c5e1e2c5abdb486f9e8f594c837/index.js +6 -0
  239. package/dist/src/_dependencies/source/0xabf837e98c26087cba0883c0a7a28326b1fa3c5e1e2c5abdb486f9e8f594c837/init.d.ts +2 -0
  240. package/dist/src/_dependencies/source/0xabf837e98c26087cba0883c0a7a28326b1fa3c5e1e2c5abdb486f9e8f594c837/init.js +95 -0
  241. package/dist/src/_dependencies/source/0xabf837e98c26087cba0883c0a7a28326b1fa3c5e1e2c5abdb486f9e8f594c837/migrate/structs.d.ts +51 -0
  242. package/dist/src/_dependencies/source/0xabf837e98c26087cba0883c0a7a28326b1fa3c5e1e2c5abdb486f9e8f594c837/migrate/structs.js +223 -0
  243. package/dist/src/_dependencies/source/0xabf837e98c26087cba0883c0a7a28326b1fa3c5e1e2c5abdb486f9e8f594c837/price/structs.d.ts +89 -0
  244. package/dist/src/_dependencies/source/0xabf837e98c26087cba0883c0a7a28326b1fa3c5e1e2c5abdb486f9e8f594c837/price/structs.js +247 -0
  245. package/dist/src/_dependencies/source/0xabf837e98c26087cba0883c0a7a28326b1fa3c5e1e2c5abdb486f9e8f594c837/price-feed/structs.d.ts +158 -0
  246. package/dist/src/_dependencies/source/0xabf837e98c26087cba0883c0a7a28326b1fa3c5e1e2c5abdb486f9e8f594c837/price-feed/structs.js +242 -0
  247. package/dist/src/_dependencies/source/0xabf837e98c26087cba0883c0a7a28326b1fa3c5e1e2c5abdb486f9e8f594c837/price-identifier/structs.d.ts +50 -0
  248. package/dist/src/_dependencies/source/0xabf837e98c26087cba0883c0a7a28326b1fa3c5e1e2c5abdb486f9e8f594c837/price-identifier/structs.js +256 -0
  249. package/dist/src/_dependencies/source/0xabf837e98c26087cba0883c0a7a28326b1fa3c5e1e2c5abdb486f9e8f594c837/price-info/structs.d.ts +360 -0
  250. package/dist/src/_dependencies/source/0xabf837e98c26087cba0883c0a7a28326b1fa3c5e1e2c5abdb486f9e8f594c837/price-info/structs.js +396 -0
  251. package/dist/src/_dependencies/source/0xabf837e98c26087cba0883c0a7a28326b1fa3c5e1e2c5abdb486f9e8f594c837/price-status/structs.d.ts +46 -0
  252. package/dist/src/_dependencies/source/0xabf837e98c26087cba0883c0a7a28326b1fa3c5e1e2c5abdb486f9e8f594c837/price-status/structs.js +222 -0
  253. package/dist/src/_dependencies/source/0xabf837e98c26087cba0883c0a7a28326b1fa3c5e1e2c5abdb486f9e8f594c837/set/structs.d.ts +120 -0
  254. package/dist/src/_dependencies/source/0xabf837e98c26087cba0883c0a7a28326b1fa3c5e1e2c5abdb486f9e8f594c837/set/structs.js +425 -0
  255. package/dist/src/_dependencies/source/0xabf837e98c26087cba0883c0a7a28326b1fa3c5e1e2c5abdb486f9e8f594c837/set-data-sources/structs.d.ts +81 -0
  256. package/dist/src/_dependencies/source/0xabf837e98c26087cba0883c0a7a28326b1fa3c5e1e2c5abdb486f9e8f594c837/set-data-sources/structs.js +257 -0
  257. package/dist/src/_dependencies/source/0xabf837e98c26087cba0883c0a7a28326b1fa3c5e1e2c5abdb486f9e8f594c837/set-fee-recipient/structs.d.ts +46 -0
  258. package/dist/src/_dependencies/source/0xabf837e98c26087cba0883c0a7a28326b1fa3c5e1e2c5abdb486f9e8f594c837/set-fee-recipient/structs.js +222 -0
  259. package/dist/src/_dependencies/source/0xabf837e98c26087cba0883c0a7a28326b1fa3c5e1e2c5abdb486f9e8f594c837/set-governance-data-source/structs.d.ts +77 -0
  260. package/dist/src/_dependencies/source/0xabf837e98c26087cba0883c0a7a28326b1fa3c5e1e2c5abdb486f9e8f594c837/set-governance-data-source/structs.js +241 -0
  261. package/dist/src/_dependencies/source/0xabf837e98c26087cba0883c0a7a28326b1fa3c5e1e2c5abdb486f9e8f594c837/set-stale-price-threshold/structs.d.ts +46 -0
  262. package/dist/src/_dependencies/source/0xabf837e98c26087cba0883c0a7a28326b1fa3c5e1e2c5abdb486f9e8f594c837/set-stale-price-threshold/structs.js +222 -0
  263. package/dist/src/_dependencies/source/0xabf837e98c26087cba0883c0a7a28326b1fa3c5e1e2c5abdb486f9e8f594c837/set-update-fee/structs.d.ts +52 -0
  264. package/dist/src/_dependencies/source/0xabf837e98c26087cba0883c0a7a28326b1fa3c5e1e2c5abdb486f9e8f594c837/set-update-fee/structs.js +234 -0
  265. package/dist/src/_dependencies/source/0xabf837e98c26087cba0883c0a7a28326b1fa3c5e1e2c5abdb486f9e8f594c837/setup/structs.d.ts +55 -0
  266. package/dist/src/_dependencies/source/0xabf837e98c26087cba0883c0a7a28326b1fa3c5e1e2c5abdb486f9e8f594c837/setup/structs.js +223 -0
  267. package/dist/src/_dependencies/source/0xabf837e98c26087cba0883c0a7a28326b1fa3c5e1e2c5abdb486f9e8f594c837/state/structs.d.ts +282 -0
  268. package/dist/src/_dependencies/source/0xabf837e98c26087cba0883c0a7a28326b1fa3c5e1e2c5abdb486f9e8f594c837/state/structs.js +560 -0
  269. package/dist/src/_dependencies/source/0xabf837e98c26087cba0883c0a7a28326b1fa3c5e1e2c5abdb486f9e8f594c837/version-control/structs.d.ts +130 -0
  270. package/dist/src/_dependencies/source/0xabf837e98c26087cba0883c0a7a28326b1fa3c5e1e2c5abdb486f9e8f594c837/version-control/structs.js +506 -0
  271. package/dist/src/_dependencies/source/0xbd8fc1947cf119350184107a3087e2dc27efefa0dd82e25a1f699069fe81a585/index.d.ts +3 -0
  272. package/dist/src/_dependencies/source/0xbd8fc1947cf119350184107a3087e2dc27efefa0dd82e25a1f699069fe81a585/index.js +6 -0
  273. package/dist/src/_dependencies/source/0xbd8fc1947cf119350184107a3087e2dc27efefa0dd82e25a1f699069fe81a585/init.d.ts +2 -0
  274. package/dist/src/_dependencies/source/0xbd8fc1947cf119350184107a3087e2dc27efefa0dd82e25a1f699069fe81a585/init.js +46 -0
  275. package/dist/src/_dependencies/source/0xbd8fc1947cf119350184107a3087e2dc27efefa0dd82e25a1f699069fe81a585/kiosk-lock-rule/structs.d.ts +88 -0
  276. package/dist/src/_dependencies/source/0xbd8fc1947cf119350184107a3087e2dc27efefa0dd82e25a1f699069fe81a585/kiosk-lock-rule/structs.js +364 -0
  277. package/dist/src/_dependencies/source/0xbd8fc1947cf119350184107a3087e2dc27efefa0dd82e25a1f699069fe81a585/royalty-rule/structs.d.ts +94 -0
  278. package/dist/src/_dependencies/source/0xbd8fc1947cf119350184107a3087e2dc27efefa0dd82e25a1f699069fe81a585/royalty-rule/structs.js +376 -0
  279. package/dist/src/_dependencies/source/0xbd8fc1947cf119350184107a3087e2dc27efefa0dd82e25a1f699069fe81a585/witness-rule/structs.d.ts +46 -0
  280. package/dist/src/_dependencies/source/0xbd8fc1947cf119350184107a3087e2dc27efefa0dd82e25a1f699069fe81a585/witness-rule/structs.js +233 -0
  281. package/dist/src/_dependencies/source/0xf47329f4344f3bf0f8e436e2f7b485466cff300f12a166563995d3888c296a94/bytes20/structs.d.ts +50 -0
  282. package/dist/src/_dependencies/source/0xf47329f4344f3bf0f8e436e2f7b485466cff300f12a166563995d3888c296a94/bytes20/structs.js +256 -0
  283. package/dist/src/_dependencies/source/0xf47329f4344f3bf0f8e436e2f7b485466cff300f12a166563995d3888c296a94/bytes32/structs.d.ts +50 -0
  284. package/dist/src/_dependencies/source/0xf47329f4344f3bf0f8e436e2f7b485466cff300f12a166563995d3888c296a94/bytes32/structs.js +256 -0
  285. package/dist/src/_dependencies/source/0xf47329f4344f3bf0f8e436e2f7b485466cff300f12a166563995d3888c296a94/consumed-vaas/structs.d.ts +77 -0
  286. package/dist/src/_dependencies/source/0xf47329f4344f3bf0f8e436e2f7b485466cff300f12a166563995d3888c296a94/consumed-vaas/structs.js +260 -0
  287. package/dist/src/_dependencies/source/0xf47329f4344f3bf0f8e436e2f7b485466cff300f12a166563995d3888c296a94/cursor/structs.d.ts +51 -0
  288. package/dist/src/_dependencies/source/0xf47329f4344f3bf0f8e436e2f7b485466cff300f12a166563995d3888c296a94/cursor/structs.js +270 -0
  289. package/dist/src/_dependencies/source/0xf47329f4344f3bf0f8e436e2f7b485466cff300f12a166563995d3888c296a94/emitter/structs.d.ts +153 -0
  290. package/dist/src/_dependencies/source/0xf47329f4344f3bf0f8e436e2f7b485466cff300f12a166563995d3888c296a94/emitter/structs.js +519 -0
  291. package/dist/src/_dependencies/source/0xf47329f4344f3bf0f8e436e2f7b485466cff300f12a166563995d3888c296a94/external-address/structs.d.ts +57 -0
  292. package/dist/src/_dependencies/source/0xf47329f4344f3bf0f8e436e2f7b485466cff300f12a166563995d3888c296a94/external-address/structs.js +223 -0
  293. package/dist/src/_dependencies/source/0xf47329f4344f3bf0f8e436e2f7b485466cff300f12a166563995d3888c296a94/fee-collector/structs.d.ts +63 -0
  294. package/dist/src/_dependencies/source/0xf47329f4344f3bf0f8e436e2f7b485466cff300f12a166563995d3888c296a94/fee-collector/structs.js +270 -0
  295. package/dist/src/_dependencies/source/0xf47329f4344f3bf0f8e436e2f7b485466cff300f12a166563995d3888c296a94/governance-message/structs.d.ts +168 -0
  296. package/dist/src/_dependencies/source/0xf47329f4344f3bf0f8e436e2f7b485466cff300f12a166563995d3888c296a94/governance-message/structs.js +470 -0
  297. package/dist/src/_dependencies/source/0xf47329f4344f3bf0f8e436e2f7b485466cff300f12a166563995d3888c296a94/guardian/structs.d.ts +57 -0
  298. package/dist/src/_dependencies/source/0xf47329f4344f3bf0f8e436e2f7b485466cff300f12a166563995d3888c296a94/guardian/structs.js +223 -0
  299. package/dist/src/_dependencies/source/0xf47329f4344f3bf0f8e436e2f7b485466cff300f12a166563995d3888c296a94/guardian-set/structs.d.ts +81 -0
  300. package/dist/src/_dependencies/source/0xf47329f4344f3bf0f8e436e2f7b485466cff300f12a166563995d3888c296a94/guardian-set/structs.js +275 -0
  301. package/dist/src/_dependencies/source/0xf47329f4344f3bf0f8e436e2f7b485466cff300f12a166563995d3888c296a94/guardian-signature/structs.d.ts +85 -0
  302. package/dist/src/_dependencies/source/0xf47329f4344f3bf0f8e436e2f7b485466cff300f12a166563995d3888c296a94/guardian-signature/structs.js +247 -0
  303. package/dist/src/_dependencies/source/0xf47329f4344f3bf0f8e436e2f7b485466cff300f12a166563995d3888c296a94/index.d.ts +3 -0
  304. package/dist/src/_dependencies/source/0xf47329f4344f3bf0f8e436e2f7b485466cff300f12a166563995d3888c296a94/index.js +6 -0
  305. package/dist/src/_dependencies/source/0xf47329f4344f3bf0f8e436e2f7b485466cff300f12a166563995d3888c296a94/init.d.ts +2 -0
  306. package/dist/src/_dependencies/source/0xf47329f4344f3bf0f8e436e2f7b485466cff300f12a166563995d3888c296a94/init.js +100 -0
  307. package/dist/src/_dependencies/source/0xf47329f4344f3bf0f8e436e2f7b485466cff300f12a166563995d3888c296a94/migrate/structs.d.ts +51 -0
  308. package/dist/src/_dependencies/source/0xf47329f4344f3bf0f8e436e2f7b485466cff300f12a166563995d3888c296a94/migrate/structs.js +223 -0
  309. package/dist/src/_dependencies/source/0xf47329f4344f3bf0f8e436e2f7b485466cff300f12a166563995d3888c296a94/package-utils/structs.d.ts +194 -0
  310. package/dist/src/_dependencies/source/0xf47329f4344f3bf0f8e436e2f7b485466cff300f12a166563995d3888c296a94/package-utils/structs.js +662 -0
  311. package/dist/src/_dependencies/source/0xf47329f4344f3bf0f8e436e2f7b485466cff300f12a166563995d3888c296a94/publish-message/structs.d.ts +151 -0
  312. package/dist/src/_dependencies/source/0xf47329f4344f3bf0f8e436e2f7b485466cff300f12a166563995d3888c296a94/publish-message/structs.js +459 -0
  313. package/dist/src/_dependencies/source/0xf47329f4344f3bf0f8e436e2f7b485466cff300f12a166563995d3888c296a94/set/structs.d.ts +110 -0
  314. package/dist/src/_dependencies/source/0xf47329f4344f3bf0f8e436e2f7b485466cff300f12a166563995d3888c296a94/set/structs.js +416 -0
  315. package/dist/src/_dependencies/source/0xf47329f4344f3bf0f8e436e2f7b485466cff300f12a166563995d3888c296a94/set-fee/structs.d.ts +88 -0
  316. package/dist/src/_dependencies/source/0xf47329f4344f3bf0f8e436e2f7b485466cff300f12a166563995d3888c296a94/set-fee/structs.js +364 -0
  317. package/dist/src/_dependencies/source/0xf47329f4344f3bf0f8e436e2f7b485466cff300f12a166563995d3888c296a94/setup/structs.d.ts +55 -0
  318. package/dist/src/_dependencies/source/0xf47329f4344f3bf0f8e436e2f7b485466cff300f12a166563995d3888c296a94/setup/structs.js +223 -0
  319. package/dist/src/_dependencies/source/0xf47329f4344f3bf0f8e436e2f7b485466cff300f12a166563995d3888c296a94/state/structs.d.ts +278 -0
  320. package/dist/src/_dependencies/source/0xf47329f4344f3bf0f8e436e2f7b485466cff300f12a166563995d3888c296a94/state/structs.js +459 -0
  321. package/dist/src/_dependencies/source/0xf47329f4344f3bf0f8e436e2f7b485466cff300f12a166563995d3888c296a94/transfer-fee/structs.d.ts +94 -0
  322. package/dist/src/_dependencies/source/0xf47329f4344f3bf0f8e436e2f7b485466cff300f12a166563995d3888c296a94/transfer-fee/structs.js +376 -0
  323. package/dist/src/_dependencies/source/0xf47329f4344f3bf0f8e436e2f7b485466cff300f12a166563995d3888c296a94/update-guardian-set/structs.d.ts +159 -0
  324. package/dist/src/_dependencies/source/0xf47329f4344f3bf0f8e436e2f7b485466cff300f12a166563995d3888c296a94/update-guardian-set/structs.js +553 -0
  325. package/dist/src/_dependencies/source/0xf47329f4344f3bf0f8e436e2f7b485466cff300f12a166563995d3888c296a94/upgrade-contract/structs.d.ts +156 -0
  326. package/dist/src/_dependencies/source/0xf47329f4344f3bf0f8e436e2f7b485466cff300f12a166563995d3888c296a94/upgrade-contract/structs.js +520 -0
  327. package/dist/src/_dependencies/source/0xf47329f4344f3bf0f8e436e2f7b485466cff300f12a166563995d3888c296a94/vaa/structs.d.ts +128 -0
  328. package/dist/src/_dependencies/source/0xf47329f4344f3bf0f8e436e2f7b485466cff300f12a166563995d3888c296a94/vaa/structs.js +312 -0
  329. package/dist/src/_dependencies/source/0xf47329f4344f3bf0f8e436e2f7b485466cff300f12a166563995d3888c296a94/version-control/structs.d.ts +88 -0
  330. package/dist/src/_dependencies/source/0xf47329f4344f3bf0f8e436e2f7b485466cff300f12a166563995d3888c296a94/version-control/structs.js +364 -0
  331. package/dist/src/_framework/init-loader.d.ts +2 -0
  332. package/dist/src/_framework/init-loader.js +73 -0
  333. package/dist/src/_framework/loader.d.ts +17 -0
  334. package/dist/src/_framework/loader.js +108 -0
  335. package/dist/src/_framework/reified.d.ts +108 -0
  336. package/dist/src/_framework/reified.js +237 -0
  337. package/dist/src/_framework/util.d.ts +35 -0
  338. package/dist/src/_framework/util.js +396 -0
  339. package/dist/src/_framework/vector.d.ts +35 -0
  340. package/dist/src/_framework/vector.js +112 -0
  341. package/dist/src/fetch.d.ts +17 -0
  342. package/dist/src/fetch.js +408 -0
  343. package/dist/src/index.d.ts +5 -0
  344. package/dist/src/index.js +29 -0
  345. package/dist/src/readVec.d.ts +3 -0
  346. package/dist/src/readVec.js +118 -0
  347. package/dist/src/typus_perp/admin/functions.d.ts +49 -0
  348. package/dist/src/typus_perp/admin/functions.js +92 -0
  349. package/dist/src/typus_perp/admin/structs.d.ts +405 -0
  350. package/dist/src/typus_perp/admin/structs.js +757 -0
  351. package/dist/src/typus_perp/error/functions.d.ts +64 -0
  352. package/dist/src/typus_perp/error/functions.js +255 -0
  353. package/dist/src/typus_perp/escrow/functions.d.ts +17 -0
  354. package/dist/src/typus_perp/escrow/functions.js +33 -0
  355. package/dist/src/typus_perp/escrow/structs.d.ts +172 -0
  356. package/dist/src/typus_perp/escrow/structs.js +324 -0
  357. package/dist/src/typus_perp/index.d.ts +3 -0
  358. package/dist/src/typus_perp/index.js +7 -0
  359. package/dist/src/typus_perp/init.d.ts +2 -0
  360. package/dist/src/typus_perp/init.js +121 -0
  361. package/dist/src/typus_perp/lp-pool/functions.d.ts +356 -0
  362. package/dist/src/typus_perp/lp-pool/functions.js +528 -0
  363. package/dist/src/typus_perp/lp-pool/structs.d.ts +3219 -0
  364. package/dist/src/typus_perp/lp-pool/structs.js +4789 -0
  365. package/dist/src/typus_perp/math/functions.d.ts +18 -0
  366. package/dist/src/typus_perp/math/functions.js +40 -0
  367. package/dist/src/typus_perp/oracle/functions.d.ts +13 -0
  368. package/dist/src/typus_perp/oracle/functions.js +22 -0
  369. package/dist/src/typus_perp/oracle/structs.d.ts +111 -0
  370. package/dist/src/typus_perp/oracle/structs.js +389 -0
  371. package/dist/src/typus_perp/position/functions.d.ts +339 -0
  372. package/dist/src/typus_perp/position/functions.js +576 -0
  373. package/dist/src/typus_perp/position/structs.d.ts +1186 -0
  374. package/dist/src/typus_perp/position/structs.js +1628 -0
  375. package/dist/src/typus_perp/symbol/functions.d.ts +9 -0
  376. package/dist/src/typus_perp/symbol/functions.js +20 -0
  377. package/dist/src/typus_perp/symbol/structs.d.ts +81 -0
  378. package/dist/src/typus_perp/symbol/structs.js +235 -0
  379. package/dist/src/typus_perp/tlp/functions.d.ts +19 -0
  380. package/dist/src/typus_perp/tlp/functions.js +35 -0
  381. package/dist/src/typus_perp/tlp/structs.d.ts +97 -0
  382. package/dist/src/typus_perp/tlp/structs.js +365 -0
  383. package/dist/src/typus_perp/token-interface/functions.d.ts +11 -0
  384. package/dist/src/typus_perp/token-interface/functions.js +20 -0
  385. package/dist/src/typus_perp/trading/functions.d.ts +549 -0
  386. package/dist/src/typus_perp/trading/functions.js +786 -0
  387. package/dist/src/typus_perp/trading/structs.d.ts +3418 -0
  388. package/dist/src/typus_perp/trading/structs.js +5556 -0
  389. package/dist/src/typus_perp/treasury-caps/functions.d.ts +9 -0
  390. package/dist/src/typus_perp/treasury-caps/functions.js +32 -0
  391. package/dist/src/typus_perp/treasury-caps/structs.d.ts +55 -0
  392. package/dist/src/typus_perp/treasury-caps/structs.js +223 -0
  393. package/dist/src/typus_stake_pool/admin/functions.d.ts +49 -0
  394. package/dist/src/typus_stake_pool/admin/functions.js +92 -0
  395. package/dist/src/typus_stake_pool/admin/structs.d.ts +405 -0
  396. package/dist/src/typus_stake_pool/admin/structs.js +757 -0
  397. package/dist/src/typus_stake_pool/index.d.ts +3 -0
  398. package/dist/src/typus_stake_pool/index.js +7 -0
  399. package/dist/src/typus_stake_pool/init.d.ts +2 -0
  400. package/dist/src/typus_stake_pool/init.js +66 -0
  401. package/dist/src/typus_stake_pool/stake-pool/functions.d.ts +175 -0
  402. package/dist/src/typus_stake_pool/stake-pool/functions.js +263 -0
  403. package/dist/src/typus_stake_pool/stake-pool/structs.d.ts +2179 -0
  404. package/dist/src/typus_stake_pool/stake-pool/structs.js +3907 -0
  405. package/dist/src/user/history.d.ts +2 -0
  406. package/dist/src/user/history.js +194 -0
  407. package/dist/src/user/index.d.ts +4 -0
  408. package/dist/src/user/index.js +20 -0
  409. package/dist/src/user/order.d.ts +29 -0
  410. package/dist/src/user/order.js +205 -0
  411. package/dist/src/user/orderWithBidReceipt.d.ts +22 -0
  412. package/dist/src/user/orderWithBidReceipt.js +144 -0
  413. package/dist/src/user/tlp.d.ts +32 -0
  414. package/dist/src/user/tlp.js +266 -0
  415. package/package.json +36 -0
@@ -0,0 +1,4789 @@
1
+ "use strict";
2
+ var __assign = (this && this.__assign) || function () {
3
+ __assign = Object.assign || function(t) {
4
+ for (var s, i = 1, n = arguments.length; i < n; i++) {
5
+ s = arguments[i];
6
+ for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
7
+ t[p] = s[p];
8
+ }
9
+ return t;
10
+ };
11
+ return __assign.apply(this, arguments);
12
+ };
13
+ var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
14
+ if (k2 === undefined) k2 = k;
15
+ var desc = Object.getOwnPropertyDescriptor(m, k);
16
+ if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
17
+ desc = { enumerable: true, get: function() { return m[k]; } };
18
+ }
19
+ Object.defineProperty(o, k2, desc);
20
+ }) : (function(o, m, k, k2) {
21
+ if (k2 === undefined) k2 = k;
22
+ o[k2] = m[k];
23
+ }));
24
+ var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
25
+ Object.defineProperty(o, "default", { enumerable: true, value: v });
26
+ }) : function(o, v) {
27
+ o["default"] = v;
28
+ });
29
+ var __importStar = (this && this.__importStar) || (function () {
30
+ var ownKeys = function(o) {
31
+ ownKeys = Object.getOwnPropertyNames || function (o) {
32
+ var ar = [];
33
+ for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
34
+ return ar;
35
+ };
36
+ return ownKeys(o);
37
+ };
38
+ return function (mod) {
39
+ if (mod && mod.__esModule) return mod;
40
+ var result = {};
41
+ if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
42
+ __setModuleDefault(result, mod);
43
+ return result;
44
+ };
45
+ })();
46
+ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
47
+ function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
48
+ return new (P || (P = Promise))(function (resolve, reject) {
49
+ function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
50
+ function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
51
+ function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
52
+ step((generator = generator.apply(thisArg, _arguments || [])).next());
53
+ });
54
+ };
55
+ var __generator = (this && this.__generator) || function (thisArg, body) {
56
+ var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g = Object.create((typeof Iterator === "function" ? Iterator : Object).prototype);
57
+ return g.next = verb(0), g["throw"] = verb(1), g["return"] = verb(2), typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g;
58
+ function verb(n) { return function (v) { return step([n, v]); }; }
59
+ function step(op) {
60
+ if (f) throw new TypeError("Generator is already executing.");
61
+ while (g && (g = 0, op[0] && (_ = 0)), _) try {
62
+ if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;
63
+ if (y = 0, t) op = [op[0] & 2, t.value];
64
+ switch (op[0]) {
65
+ case 0: case 1: t = op; break;
66
+ case 4: _.label++; return { value: op[1], done: false };
67
+ case 5: _.label++; y = op[1]; op = [0]; continue;
68
+ case 7: op = _.ops.pop(); _.trys.pop(); continue;
69
+ default:
70
+ if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }
71
+ if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }
72
+ if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }
73
+ if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }
74
+ if (t[2]) _.ops.pop();
75
+ _.trys.pop(); continue;
76
+ }
77
+ op = body.call(thisArg, _);
78
+ } catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }
79
+ if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };
80
+ }
81
+ };
82
+ var __read = (this && this.__read) || function (o, n) {
83
+ var m = typeof Symbol === "function" && o[Symbol.iterator];
84
+ if (!m) return o;
85
+ var i = m.call(o), r, ar = [], e;
86
+ try {
87
+ while ((n === void 0 || n-- > 0) && !(r = i.next()).done) ar.push(r.value);
88
+ }
89
+ catch (error) { e = { error: error }; }
90
+ finally {
91
+ try {
92
+ if (r && !r.done && (m = i["return"])) m.call(i);
93
+ }
94
+ finally { if (e) throw e.error; }
95
+ }
96
+ return ar;
97
+ };
98
+ var __spreadArray = (this && this.__spreadArray) || function (to, from, pack) {
99
+ if (pack || arguments.length === 2) for (var i = 0, l = from.length, ar; i < l; i++) {
100
+ if (ar || !(i in from)) {
101
+ if (!ar) ar = Array.prototype.slice.call(from, 0, i);
102
+ ar[i] = from[i];
103
+ }
104
+ }
105
+ return to.concat(ar || Array.prototype.slice.call(from));
106
+ };
107
+ Object.defineProperty(exports, "__esModule", { value: true });
108
+ exports.UpdateSpotConfigEvent = exports.UpdateMarginConfigEvent = exports.UpdateLiquidityValueEvent = exports.UpdateBorrowInfoEvent = exports.TokenPool = exports.SwapEvent = exports.SuspendTokenPoolEvent = exports.SuspendPoolEvent = exports.StartRemoveLiquidityTokenProcessEvent = exports.SpotConfig = exports.ResumeTokenPoolEvent = exports.ResumePoolEvent = exports.RemoveLiquidityTokenProcess = exports.NewLiquidityPoolEvent = exports.MintLpEvent = exports.MarginConfig = exports.ManagerFlashRepayLiquidityEvent = exports.ManagerFlashRemoveLiquidityEvent = exports.LiquidityPoolInfo = exports.LiquidityPool = exports.CompleteRemoveLiquidityTokenProcessEvent = exports.BurnLpEvent = exports.AddLiquidityTokenEvent = exports.Registry = exports.State = exports.Config = void 0;
109
+ exports.isConfig = isConfig;
110
+ exports.isState = isState;
111
+ exports.isRegistry = isRegistry;
112
+ exports.isAddLiquidityTokenEvent = isAddLiquidityTokenEvent;
113
+ exports.isBurnLpEvent = isBurnLpEvent;
114
+ exports.isCompleteRemoveLiquidityTokenProcessEvent = isCompleteRemoveLiquidityTokenProcessEvent;
115
+ exports.isLiquidityPool = isLiquidityPool;
116
+ exports.isLiquidityPoolInfo = isLiquidityPoolInfo;
117
+ exports.isManagerFlashRemoveLiquidityEvent = isManagerFlashRemoveLiquidityEvent;
118
+ exports.isManagerFlashRepayLiquidityEvent = isManagerFlashRepayLiquidityEvent;
119
+ exports.isMarginConfig = isMarginConfig;
120
+ exports.isMintLpEvent = isMintLpEvent;
121
+ exports.isNewLiquidityPoolEvent = isNewLiquidityPoolEvent;
122
+ exports.isRemoveLiquidityTokenProcess = isRemoveLiquidityTokenProcess;
123
+ exports.isResumePoolEvent = isResumePoolEvent;
124
+ exports.isResumeTokenPoolEvent = isResumeTokenPoolEvent;
125
+ exports.isSpotConfig = isSpotConfig;
126
+ exports.isStartRemoveLiquidityTokenProcessEvent = isStartRemoveLiquidityTokenProcessEvent;
127
+ exports.isSuspendPoolEvent = isSuspendPoolEvent;
128
+ exports.isSuspendTokenPoolEvent = isSuspendTokenPoolEvent;
129
+ exports.isSwapEvent = isSwapEvent;
130
+ exports.isTokenPool = isTokenPool;
131
+ exports.isUpdateBorrowInfoEvent = isUpdateBorrowInfoEvent;
132
+ exports.isUpdateLiquidityValueEvent = isUpdateLiquidityValueEvent;
133
+ exports.isUpdateMarginConfigEvent = isUpdateMarginConfigEvent;
134
+ exports.isUpdateSpotConfigEvent = isUpdateSpotConfigEvent;
135
+ var reified = __importStar(require("../../_framework/reified"));
136
+ var structs_1 = require("../../_dependencies/source/0x1/type-name/structs");
137
+ var structs_2 = require("../../_dependencies/source/0x2/object/structs");
138
+ var reified_1 = require("../../_framework/reified");
139
+ var util_1 = require("../../_framework/util");
140
+ var structs_3 = require("../escrow/structs");
141
+ var index_1 = require("../index");
142
+ var bcs_1 = require("@mysten/sui/bcs");
143
+ var utils_1 = require("@mysten/sui/utils");
144
+ /* ============================== Config =============================== */
145
+ function isConfig(type) {
146
+ type = (0, util_1.compressSuiType)(type);
147
+ return type === "".concat(index_1.PKG_V1, "::lp_pool::Config");
148
+ }
149
+ var Config = /** @class */ (function () {
150
+ function Config(typeArgs, fields) {
151
+ this.__StructClass = true;
152
+ this.$typeName = Config.$typeName;
153
+ this.$isPhantom = Config.$isPhantom;
154
+ this.$fullTypeName = util_1.composeSuiType.apply(void 0, __spreadArray([Config.$typeName], __read(typeArgs), false));
155
+ this.$typeArgs = typeArgs;
156
+ this.oracleId = fields.oracleId;
157
+ this.liquidityTokenDecimal = fields.liquidityTokenDecimal;
158
+ this.spotConfig = fields.spotConfig;
159
+ this.marginConfig = fields.marginConfig;
160
+ this.u64Padding = fields.u64Padding;
161
+ }
162
+ Config.reified = function () {
163
+ var _this = this;
164
+ return {
165
+ typeName: Config.$typeName,
166
+ fullTypeName: util_1.composeSuiType.apply(void 0, __spreadArray([Config.$typeName], [], false)),
167
+ typeArgs: [],
168
+ isPhantom: Config.$isPhantom,
169
+ reifiedTypeArgs: [],
170
+ fromFields: function (fields) { return Config.fromFields(fields); },
171
+ fromFieldsWithTypes: function (item) { return Config.fromFieldsWithTypes(item); },
172
+ fromBcs: function (data) { return Config.fromBcs(data); },
173
+ bcs: Config.bcs,
174
+ fromJSONField: function (field) { return Config.fromJSONField(field); },
175
+ fromJSON: function (json) { return Config.fromJSON(json); },
176
+ fromSuiParsedData: function (content) { return Config.fromSuiParsedData(content); },
177
+ fromSuiObjectData: function (content) { return Config.fromSuiObjectData(content); },
178
+ fetch: function (client, id) { return __awaiter(_this, void 0, void 0, function () { return __generator(this, function (_a) {
179
+ return [2 /*return*/, Config.fetch(client, id)];
180
+ }); }); },
181
+ new: function (fields) {
182
+ return new Config([], fields);
183
+ },
184
+ kind: "StructClassReified",
185
+ };
186
+ };
187
+ Object.defineProperty(Config, "r", {
188
+ get: function () {
189
+ return Config.reified();
190
+ },
191
+ enumerable: false,
192
+ configurable: true
193
+ });
194
+ Config.phantom = function () {
195
+ return (0, reified_1.phantom)(Config.reified());
196
+ };
197
+ Object.defineProperty(Config, "p", {
198
+ get: function () {
199
+ return Config.phantom();
200
+ },
201
+ enumerable: false,
202
+ configurable: true
203
+ });
204
+ Object.defineProperty(Config, "bcs", {
205
+ get: function () {
206
+ return bcs_1.bcs.struct("Config", {
207
+ oracle_id: bcs_1.bcs.bytes(32).transform({ input: function (val) { return (0, utils_1.fromHEX)(val); }, output: function (val) { return (0, utils_1.toHEX)(val); } }),
208
+ liquidity_token_decimal: bcs_1.bcs.u64(),
209
+ spot_config: SpotConfig.bcs,
210
+ margin_config: MarginConfig.bcs,
211
+ u64_padding: bcs_1.bcs.vector(bcs_1.bcs.u64()),
212
+ });
213
+ },
214
+ enumerable: false,
215
+ configurable: true
216
+ });
217
+ Config.fromFields = function (fields) {
218
+ return Config.reified().new({
219
+ oracleId: (0, reified_1.decodeFromFields)("address", fields.oracle_id),
220
+ liquidityTokenDecimal: (0, reified_1.decodeFromFields)("u64", fields.liquidity_token_decimal),
221
+ spotConfig: (0, reified_1.decodeFromFields)(SpotConfig.reified(), fields.spot_config),
222
+ marginConfig: (0, reified_1.decodeFromFields)(MarginConfig.reified(), fields.margin_config),
223
+ u64Padding: (0, reified_1.decodeFromFields)(reified.vector("u64"), fields.u64_padding),
224
+ });
225
+ };
226
+ Config.fromFieldsWithTypes = function (item) {
227
+ if (!isConfig(item.type)) {
228
+ throw new Error("not a Config type");
229
+ }
230
+ return Config.reified().new({
231
+ oracleId: (0, reified_1.decodeFromFieldsWithTypes)("address", item.fields.oracle_id),
232
+ liquidityTokenDecimal: (0, reified_1.decodeFromFieldsWithTypes)("u64", item.fields.liquidity_token_decimal),
233
+ spotConfig: (0, reified_1.decodeFromFieldsWithTypes)(SpotConfig.reified(), item.fields.spot_config),
234
+ marginConfig: (0, reified_1.decodeFromFieldsWithTypes)(MarginConfig.reified(), item.fields.margin_config),
235
+ u64Padding: (0, reified_1.decodeFromFieldsWithTypes)(reified.vector("u64"), item.fields.u64_padding),
236
+ });
237
+ };
238
+ Config.fromBcs = function (data) {
239
+ return Config.fromFields(Config.bcs.parse(data));
240
+ };
241
+ Config.prototype.toJSONField = function () {
242
+ return {
243
+ oracleId: this.oracleId,
244
+ liquidityTokenDecimal: this.liquidityTokenDecimal.toString(),
245
+ spotConfig: this.spotConfig.toJSONField(),
246
+ marginConfig: this.marginConfig.toJSONField(),
247
+ u64Padding: (0, reified_1.fieldToJSON)("vector<u64>", this.u64Padding),
248
+ };
249
+ };
250
+ Config.prototype.toJSON = function () {
251
+ return __assign({ $typeName: this.$typeName, $typeArgs: this.$typeArgs }, this.toJSONField());
252
+ };
253
+ Config.fromJSONField = function (field) {
254
+ return Config.reified().new({
255
+ oracleId: (0, reified_1.decodeFromJSONField)("address", field.oracleId),
256
+ liquidityTokenDecimal: (0, reified_1.decodeFromJSONField)("u64", field.liquidityTokenDecimal),
257
+ spotConfig: (0, reified_1.decodeFromJSONField)(SpotConfig.reified(), field.spotConfig),
258
+ marginConfig: (0, reified_1.decodeFromJSONField)(MarginConfig.reified(), field.marginConfig),
259
+ u64Padding: (0, reified_1.decodeFromJSONField)(reified.vector("u64"), field.u64Padding),
260
+ });
261
+ };
262
+ Config.fromJSON = function (json) {
263
+ if (json.$typeName !== Config.$typeName) {
264
+ throw new Error("not a WithTwoGenerics json object");
265
+ }
266
+ return Config.fromJSONField(json);
267
+ };
268
+ Config.fromSuiParsedData = function (content) {
269
+ if (content.dataType !== "moveObject") {
270
+ throw new Error("not an object");
271
+ }
272
+ if (!isConfig(content.type)) {
273
+ throw new Error("object at ".concat(content.fields.id, " is not a Config object"));
274
+ }
275
+ return Config.fromFieldsWithTypes(content);
276
+ };
277
+ Config.fromSuiObjectData = function (data) {
278
+ if (data.bcs) {
279
+ if (data.bcs.dataType !== "moveObject" || !isConfig(data.bcs.type)) {
280
+ throw new Error("object at is not a Config object");
281
+ }
282
+ return Config.fromBcs((0, utils_1.fromB64)(data.bcs.bcsBytes));
283
+ }
284
+ if (data.content) {
285
+ return Config.fromSuiParsedData(data.content);
286
+ }
287
+ throw new Error("Both `bcs` and `content` fields are missing from the data. Include `showBcs` or `showContent` in the request.");
288
+ };
289
+ Config.fetch = function (client, id) {
290
+ return __awaiter(this, void 0, void 0, function () {
291
+ var res;
292
+ var _a, _b;
293
+ return __generator(this, function (_c) {
294
+ switch (_c.label) {
295
+ case 0: return [4 /*yield*/, client.getObject({ id: id, options: { showBcs: true } })];
296
+ case 1:
297
+ res = _c.sent();
298
+ if (res.error) {
299
+ throw new Error("error fetching Config object at id ".concat(id, ": ").concat(res.error.code));
300
+ }
301
+ if (((_b = (_a = res.data) === null || _a === void 0 ? void 0 : _a.bcs) === null || _b === void 0 ? void 0 : _b.dataType) !== "moveObject" || !isConfig(res.data.bcs.type)) {
302
+ throw new Error("object at id ".concat(id, " is not a Config object"));
303
+ }
304
+ return [2 /*return*/, Config.fromSuiObjectData(res.data)];
305
+ }
306
+ });
307
+ });
308
+ };
309
+ Config.$typeName = "".concat(index_1.PKG_V1, "::lp_pool::Config");
310
+ Config.$numTypeParams = 0;
311
+ Config.$isPhantom = [];
312
+ return Config;
313
+ }());
314
+ exports.Config = Config;
315
+ /* ============================== State =============================== */
316
+ function isState(type) {
317
+ type = (0, util_1.compressSuiType)(type);
318
+ return type === "".concat(index_1.PKG_V1, "::lp_pool::State");
319
+ }
320
+ var State = /** @class */ (function () {
321
+ function State(typeArgs, fields) {
322
+ this.__StructClass = true;
323
+ this.$typeName = State.$typeName;
324
+ this.$isPhantom = State.$isPhantom;
325
+ this.$fullTypeName = util_1.composeSuiType.apply(void 0, __spreadArray([State.$typeName], __read(typeArgs), false));
326
+ this.$typeArgs = typeArgs;
327
+ this.liquidityAmount = fields.liquidityAmount;
328
+ this.valueInUsd = fields.valueInUsd;
329
+ this.reservedAmount = fields.reservedAmount;
330
+ this.updateTsMs = fields.updateTsMs;
331
+ this.isActive = fields.isActive;
332
+ this.lastBorrowRateTsMs = fields.lastBorrowRateTsMs;
333
+ this.cumulativeBorrowRate = fields.cumulativeBorrowRate;
334
+ this.previousLastBorrowRateTsMs = fields.previousLastBorrowRateTsMs;
335
+ this.previousCumulativeBorrowRate = fields.previousCumulativeBorrowRate;
336
+ this.u64Padding = fields.u64Padding;
337
+ }
338
+ State.reified = function () {
339
+ var _this = this;
340
+ return {
341
+ typeName: State.$typeName,
342
+ fullTypeName: util_1.composeSuiType.apply(void 0, __spreadArray([State.$typeName], [], false)),
343
+ typeArgs: [],
344
+ isPhantom: State.$isPhantom,
345
+ reifiedTypeArgs: [],
346
+ fromFields: function (fields) { return State.fromFields(fields); },
347
+ fromFieldsWithTypes: function (item) { return State.fromFieldsWithTypes(item); },
348
+ fromBcs: function (data) { return State.fromBcs(data); },
349
+ bcs: State.bcs,
350
+ fromJSONField: function (field) { return State.fromJSONField(field); },
351
+ fromJSON: function (json) { return State.fromJSON(json); },
352
+ fromSuiParsedData: function (content) { return State.fromSuiParsedData(content); },
353
+ fromSuiObjectData: function (content) { return State.fromSuiObjectData(content); },
354
+ fetch: function (client, id) { return __awaiter(_this, void 0, void 0, function () { return __generator(this, function (_a) {
355
+ return [2 /*return*/, State.fetch(client, id)];
356
+ }); }); },
357
+ new: function (fields) {
358
+ return new State([], fields);
359
+ },
360
+ kind: "StructClassReified",
361
+ };
362
+ };
363
+ Object.defineProperty(State, "r", {
364
+ get: function () {
365
+ return State.reified();
366
+ },
367
+ enumerable: false,
368
+ configurable: true
369
+ });
370
+ State.phantom = function () {
371
+ return (0, reified_1.phantom)(State.reified());
372
+ };
373
+ Object.defineProperty(State, "p", {
374
+ get: function () {
375
+ return State.phantom();
376
+ },
377
+ enumerable: false,
378
+ configurable: true
379
+ });
380
+ Object.defineProperty(State, "bcs", {
381
+ get: function () {
382
+ return bcs_1.bcs.struct("State", {
383
+ liquidity_amount: bcs_1.bcs.u64(),
384
+ value_in_usd: bcs_1.bcs.u64(),
385
+ reserved_amount: bcs_1.bcs.u64(),
386
+ update_ts_ms: bcs_1.bcs.u64(),
387
+ is_active: bcs_1.bcs.bool(),
388
+ last_borrow_rate_ts_ms: bcs_1.bcs.u64(),
389
+ cumulative_borrow_rate: bcs_1.bcs.u64(),
390
+ previous_last_borrow_rate_ts_ms: bcs_1.bcs.u64(),
391
+ previous_cumulative_borrow_rate: bcs_1.bcs.u64(),
392
+ u64_padding: bcs_1.bcs.vector(bcs_1.bcs.u64()),
393
+ });
394
+ },
395
+ enumerable: false,
396
+ configurable: true
397
+ });
398
+ State.fromFields = function (fields) {
399
+ return State.reified().new({
400
+ liquidityAmount: (0, reified_1.decodeFromFields)("u64", fields.liquidity_amount),
401
+ valueInUsd: (0, reified_1.decodeFromFields)("u64", fields.value_in_usd),
402
+ reservedAmount: (0, reified_1.decodeFromFields)("u64", fields.reserved_amount),
403
+ updateTsMs: (0, reified_1.decodeFromFields)("u64", fields.update_ts_ms),
404
+ isActive: (0, reified_1.decodeFromFields)("bool", fields.is_active),
405
+ lastBorrowRateTsMs: (0, reified_1.decodeFromFields)("u64", fields.last_borrow_rate_ts_ms),
406
+ cumulativeBorrowRate: (0, reified_1.decodeFromFields)("u64", fields.cumulative_borrow_rate),
407
+ previousLastBorrowRateTsMs: (0, reified_1.decodeFromFields)("u64", fields.previous_last_borrow_rate_ts_ms),
408
+ previousCumulativeBorrowRate: (0, reified_1.decodeFromFields)("u64", fields.previous_cumulative_borrow_rate),
409
+ u64Padding: (0, reified_1.decodeFromFields)(reified.vector("u64"), fields.u64_padding),
410
+ });
411
+ };
412
+ State.fromFieldsWithTypes = function (item) {
413
+ if (!isState(item.type)) {
414
+ throw new Error("not a State type");
415
+ }
416
+ return State.reified().new({
417
+ liquidityAmount: (0, reified_1.decodeFromFieldsWithTypes)("u64", item.fields.liquidity_amount),
418
+ valueInUsd: (0, reified_1.decodeFromFieldsWithTypes)("u64", item.fields.value_in_usd),
419
+ reservedAmount: (0, reified_1.decodeFromFieldsWithTypes)("u64", item.fields.reserved_amount),
420
+ updateTsMs: (0, reified_1.decodeFromFieldsWithTypes)("u64", item.fields.update_ts_ms),
421
+ isActive: (0, reified_1.decodeFromFieldsWithTypes)("bool", item.fields.is_active),
422
+ lastBorrowRateTsMs: (0, reified_1.decodeFromFieldsWithTypes)("u64", item.fields.last_borrow_rate_ts_ms),
423
+ cumulativeBorrowRate: (0, reified_1.decodeFromFieldsWithTypes)("u64", item.fields.cumulative_borrow_rate),
424
+ previousLastBorrowRateTsMs: (0, reified_1.decodeFromFieldsWithTypes)("u64", item.fields.previous_last_borrow_rate_ts_ms),
425
+ previousCumulativeBorrowRate: (0, reified_1.decodeFromFieldsWithTypes)("u64", item.fields.previous_cumulative_borrow_rate),
426
+ u64Padding: (0, reified_1.decodeFromFieldsWithTypes)(reified.vector("u64"), item.fields.u64_padding),
427
+ });
428
+ };
429
+ State.fromBcs = function (data) {
430
+ return State.fromFields(State.bcs.parse(data));
431
+ };
432
+ State.prototype.toJSONField = function () {
433
+ return {
434
+ liquidityAmount: this.liquidityAmount.toString(),
435
+ valueInUsd: this.valueInUsd.toString(),
436
+ reservedAmount: this.reservedAmount.toString(),
437
+ updateTsMs: this.updateTsMs.toString(),
438
+ isActive: this.isActive,
439
+ lastBorrowRateTsMs: this.lastBorrowRateTsMs.toString(),
440
+ cumulativeBorrowRate: this.cumulativeBorrowRate.toString(),
441
+ previousLastBorrowRateTsMs: this.previousLastBorrowRateTsMs.toString(),
442
+ previousCumulativeBorrowRate: this.previousCumulativeBorrowRate.toString(),
443
+ u64Padding: (0, reified_1.fieldToJSON)("vector<u64>", this.u64Padding),
444
+ };
445
+ };
446
+ State.prototype.toJSON = function () {
447
+ return __assign({ $typeName: this.$typeName, $typeArgs: this.$typeArgs }, this.toJSONField());
448
+ };
449
+ State.fromJSONField = function (field) {
450
+ return State.reified().new({
451
+ liquidityAmount: (0, reified_1.decodeFromJSONField)("u64", field.liquidityAmount),
452
+ valueInUsd: (0, reified_1.decodeFromJSONField)("u64", field.valueInUsd),
453
+ reservedAmount: (0, reified_1.decodeFromJSONField)("u64", field.reservedAmount),
454
+ updateTsMs: (0, reified_1.decodeFromJSONField)("u64", field.updateTsMs),
455
+ isActive: (0, reified_1.decodeFromJSONField)("bool", field.isActive),
456
+ lastBorrowRateTsMs: (0, reified_1.decodeFromJSONField)("u64", field.lastBorrowRateTsMs),
457
+ cumulativeBorrowRate: (0, reified_1.decodeFromJSONField)("u64", field.cumulativeBorrowRate),
458
+ previousLastBorrowRateTsMs: (0, reified_1.decodeFromJSONField)("u64", field.previousLastBorrowRateTsMs),
459
+ previousCumulativeBorrowRate: (0, reified_1.decodeFromJSONField)("u64", field.previousCumulativeBorrowRate),
460
+ u64Padding: (0, reified_1.decodeFromJSONField)(reified.vector("u64"), field.u64Padding),
461
+ });
462
+ };
463
+ State.fromJSON = function (json) {
464
+ if (json.$typeName !== State.$typeName) {
465
+ throw new Error("not a WithTwoGenerics json object");
466
+ }
467
+ return State.fromJSONField(json);
468
+ };
469
+ State.fromSuiParsedData = function (content) {
470
+ if (content.dataType !== "moveObject") {
471
+ throw new Error("not an object");
472
+ }
473
+ if (!isState(content.type)) {
474
+ throw new Error("object at ".concat(content.fields.id, " is not a State object"));
475
+ }
476
+ return State.fromFieldsWithTypes(content);
477
+ };
478
+ State.fromSuiObjectData = function (data) {
479
+ if (data.bcs) {
480
+ if (data.bcs.dataType !== "moveObject" || !isState(data.bcs.type)) {
481
+ throw new Error("object at is not a State object");
482
+ }
483
+ return State.fromBcs((0, utils_1.fromB64)(data.bcs.bcsBytes));
484
+ }
485
+ if (data.content) {
486
+ return State.fromSuiParsedData(data.content);
487
+ }
488
+ throw new Error("Both `bcs` and `content` fields are missing from the data. Include `showBcs` or `showContent` in the request.");
489
+ };
490
+ State.fetch = function (client, id) {
491
+ return __awaiter(this, void 0, void 0, function () {
492
+ var res;
493
+ var _a, _b;
494
+ return __generator(this, function (_c) {
495
+ switch (_c.label) {
496
+ case 0: return [4 /*yield*/, client.getObject({ id: id, options: { showBcs: true } })];
497
+ case 1:
498
+ res = _c.sent();
499
+ if (res.error) {
500
+ throw new Error("error fetching State object at id ".concat(id, ": ").concat(res.error.code));
501
+ }
502
+ if (((_b = (_a = res.data) === null || _a === void 0 ? void 0 : _a.bcs) === null || _b === void 0 ? void 0 : _b.dataType) !== "moveObject" || !isState(res.data.bcs.type)) {
503
+ throw new Error("object at id ".concat(id, " is not a State object"));
504
+ }
505
+ return [2 /*return*/, State.fromSuiObjectData(res.data)];
506
+ }
507
+ });
508
+ });
509
+ };
510
+ State.$typeName = "".concat(index_1.PKG_V1, "::lp_pool::State");
511
+ State.$numTypeParams = 0;
512
+ State.$isPhantom = [];
513
+ return State;
514
+ }());
515
+ exports.State = State;
516
+ /* ============================== Registry =============================== */
517
+ function isRegistry(type) {
518
+ type = (0, util_1.compressSuiType)(type);
519
+ return type === "".concat(index_1.PKG_V1, "::lp_pool::Registry");
520
+ }
521
+ var Registry = /** @class */ (function () {
522
+ function Registry(typeArgs, fields) {
523
+ this.__StructClass = true;
524
+ this.$typeName = Registry.$typeName;
525
+ this.$isPhantom = Registry.$isPhantom;
526
+ this.$fullTypeName = util_1.composeSuiType.apply(void 0, __spreadArray([Registry.$typeName], __read(typeArgs), false));
527
+ this.$typeArgs = typeArgs;
528
+ this.id = fields.id;
529
+ this.numPool = fields.numPool;
530
+ this.liquidityPoolRegistry = fields.liquidityPoolRegistry;
531
+ }
532
+ Registry.reified = function () {
533
+ var _this = this;
534
+ return {
535
+ typeName: Registry.$typeName,
536
+ fullTypeName: util_1.composeSuiType.apply(void 0, __spreadArray([Registry.$typeName], [], false)),
537
+ typeArgs: [],
538
+ isPhantom: Registry.$isPhantom,
539
+ reifiedTypeArgs: [],
540
+ fromFields: function (fields) { return Registry.fromFields(fields); },
541
+ fromFieldsWithTypes: function (item) { return Registry.fromFieldsWithTypes(item); },
542
+ fromBcs: function (data) { return Registry.fromBcs(data); },
543
+ bcs: Registry.bcs,
544
+ fromJSONField: function (field) { return Registry.fromJSONField(field); },
545
+ fromJSON: function (json) { return Registry.fromJSON(json); },
546
+ fromSuiParsedData: function (content) { return Registry.fromSuiParsedData(content); },
547
+ fromSuiObjectData: function (content) { return Registry.fromSuiObjectData(content); },
548
+ fetch: function (client, id) { return __awaiter(_this, void 0, void 0, function () { return __generator(this, function (_a) {
549
+ return [2 /*return*/, Registry.fetch(client, id)];
550
+ }); }); },
551
+ new: function (fields) {
552
+ return new Registry([], fields);
553
+ },
554
+ kind: "StructClassReified",
555
+ };
556
+ };
557
+ Object.defineProperty(Registry, "r", {
558
+ get: function () {
559
+ return Registry.reified();
560
+ },
561
+ enumerable: false,
562
+ configurable: true
563
+ });
564
+ Registry.phantom = function () {
565
+ return (0, reified_1.phantom)(Registry.reified());
566
+ };
567
+ Object.defineProperty(Registry, "p", {
568
+ get: function () {
569
+ return Registry.phantom();
570
+ },
571
+ enumerable: false,
572
+ configurable: true
573
+ });
574
+ Object.defineProperty(Registry, "bcs", {
575
+ get: function () {
576
+ return bcs_1.bcs.struct("Registry", {
577
+ id: structs_2.UID.bcs,
578
+ num_pool: bcs_1.bcs.u64(),
579
+ liquidity_pool_registry: structs_2.UID.bcs,
580
+ });
581
+ },
582
+ enumerable: false,
583
+ configurable: true
584
+ });
585
+ Registry.fromFields = function (fields) {
586
+ return Registry.reified().new({
587
+ id: (0, reified_1.decodeFromFields)(structs_2.UID.reified(), fields.id),
588
+ numPool: (0, reified_1.decodeFromFields)("u64", fields.num_pool),
589
+ liquidityPoolRegistry: (0, reified_1.decodeFromFields)(structs_2.UID.reified(), fields.liquidity_pool_registry),
590
+ });
591
+ };
592
+ Registry.fromFieldsWithTypes = function (item) {
593
+ if (!isRegistry(item.type)) {
594
+ throw new Error("not a Registry type");
595
+ }
596
+ return Registry.reified().new({
597
+ id: (0, reified_1.decodeFromFieldsWithTypes)(structs_2.UID.reified(), item.fields.id),
598
+ numPool: (0, reified_1.decodeFromFieldsWithTypes)("u64", item.fields.num_pool),
599
+ liquidityPoolRegistry: (0, reified_1.decodeFromFieldsWithTypes)(structs_2.UID.reified(), item.fields.liquidity_pool_registry),
600
+ });
601
+ };
602
+ Registry.fromBcs = function (data) {
603
+ return Registry.fromFields(Registry.bcs.parse(data));
604
+ };
605
+ Registry.prototype.toJSONField = function () {
606
+ return {
607
+ id: this.id,
608
+ numPool: this.numPool.toString(),
609
+ liquidityPoolRegistry: this.liquidityPoolRegistry,
610
+ };
611
+ };
612
+ Registry.prototype.toJSON = function () {
613
+ return __assign({ $typeName: this.$typeName, $typeArgs: this.$typeArgs }, this.toJSONField());
614
+ };
615
+ Registry.fromJSONField = function (field) {
616
+ return Registry.reified().new({
617
+ id: (0, reified_1.decodeFromJSONField)(structs_2.UID.reified(), field.id),
618
+ numPool: (0, reified_1.decodeFromJSONField)("u64", field.numPool),
619
+ liquidityPoolRegistry: (0, reified_1.decodeFromJSONField)(structs_2.UID.reified(), field.liquidityPoolRegistry),
620
+ });
621
+ };
622
+ Registry.fromJSON = function (json) {
623
+ if (json.$typeName !== Registry.$typeName) {
624
+ throw new Error("not a WithTwoGenerics json object");
625
+ }
626
+ return Registry.fromJSONField(json);
627
+ };
628
+ Registry.fromSuiParsedData = function (content) {
629
+ if (content.dataType !== "moveObject") {
630
+ throw new Error("not an object");
631
+ }
632
+ if (!isRegistry(content.type)) {
633
+ throw new Error("object at ".concat(content.fields.id, " is not a Registry object"));
634
+ }
635
+ return Registry.fromFieldsWithTypes(content);
636
+ };
637
+ Registry.fromSuiObjectData = function (data) {
638
+ if (data.bcs) {
639
+ if (data.bcs.dataType !== "moveObject" || !isRegistry(data.bcs.type)) {
640
+ throw new Error("object at is not a Registry object");
641
+ }
642
+ return Registry.fromBcs((0, utils_1.fromB64)(data.bcs.bcsBytes));
643
+ }
644
+ if (data.content) {
645
+ return Registry.fromSuiParsedData(data.content);
646
+ }
647
+ throw new Error("Both `bcs` and `content` fields are missing from the data. Include `showBcs` or `showContent` in the request.");
648
+ };
649
+ Registry.fetch = function (client, id) {
650
+ return __awaiter(this, void 0, void 0, function () {
651
+ var res;
652
+ var _a, _b;
653
+ return __generator(this, function (_c) {
654
+ switch (_c.label) {
655
+ case 0: return [4 /*yield*/, client.getObject({ id: id, options: { showBcs: true } })];
656
+ case 1:
657
+ res = _c.sent();
658
+ if (res.error) {
659
+ throw new Error("error fetching Registry object at id ".concat(id, ": ").concat(res.error.code));
660
+ }
661
+ if (((_b = (_a = res.data) === null || _a === void 0 ? void 0 : _a.bcs) === null || _b === void 0 ? void 0 : _b.dataType) !== "moveObject" || !isRegistry(res.data.bcs.type)) {
662
+ throw new Error("object at id ".concat(id, " is not a Registry object"));
663
+ }
664
+ return [2 /*return*/, Registry.fromSuiObjectData(res.data)];
665
+ }
666
+ });
667
+ });
668
+ };
669
+ Registry.$typeName = "".concat(index_1.PKG_V1, "::lp_pool::Registry");
670
+ Registry.$numTypeParams = 0;
671
+ Registry.$isPhantom = [];
672
+ return Registry;
673
+ }());
674
+ exports.Registry = Registry;
675
+ /* ============================== AddLiquidityTokenEvent =============================== */
676
+ function isAddLiquidityTokenEvent(type) {
677
+ type = (0, util_1.compressSuiType)(type);
678
+ return type === "".concat(index_1.PKG_V1, "::lp_pool::AddLiquidityTokenEvent");
679
+ }
680
+ var AddLiquidityTokenEvent = /** @class */ (function () {
681
+ function AddLiquidityTokenEvent(typeArgs, fields) {
682
+ this.__StructClass = true;
683
+ this.$typeName = AddLiquidityTokenEvent.$typeName;
684
+ this.$isPhantom = AddLiquidityTokenEvent.$isPhantom;
685
+ this.$fullTypeName = util_1.composeSuiType.apply(void 0, __spreadArray([AddLiquidityTokenEvent.$typeName], __read(typeArgs), false));
686
+ this.$typeArgs = typeArgs;
687
+ this.sender = fields.sender;
688
+ this.index = fields.index;
689
+ this.tokenType = fields.tokenType;
690
+ this.config = fields.config;
691
+ this.state = fields.state;
692
+ this.u64Padding = fields.u64Padding;
693
+ }
694
+ AddLiquidityTokenEvent.reified = function () {
695
+ var _this = this;
696
+ return {
697
+ typeName: AddLiquidityTokenEvent.$typeName,
698
+ fullTypeName: util_1.composeSuiType.apply(void 0, __spreadArray([AddLiquidityTokenEvent.$typeName], [], false)),
699
+ typeArgs: [],
700
+ isPhantom: AddLiquidityTokenEvent.$isPhantom,
701
+ reifiedTypeArgs: [],
702
+ fromFields: function (fields) { return AddLiquidityTokenEvent.fromFields(fields); },
703
+ fromFieldsWithTypes: function (item) { return AddLiquidityTokenEvent.fromFieldsWithTypes(item); },
704
+ fromBcs: function (data) { return AddLiquidityTokenEvent.fromBcs(data); },
705
+ bcs: AddLiquidityTokenEvent.bcs,
706
+ fromJSONField: function (field) { return AddLiquidityTokenEvent.fromJSONField(field); },
707
+ fromJSON: function (json) { return AddLiquidityTokenEvent.fromJSON(json); },
708
+ fromSuiParsedData: function (content) { return AddLiquidityTokenEvent.fromSuiParsedData(content); },
709
+ fromSuiObjectData: function (content) { return AddLiquidityTokenEvent.fromSuiObjectData(content); },
710
+ fetch: function (client, id) { return __awaiter(_this, void 0, void 0, function () { return __generator(this, function (_a) {
711
+ return [2 /*return*/, AddLiquidityTokenEvent.fetch(client, id)];
712
+ }); }); },
713
+ new: function (fields) {
714
+ return new AddLiquidityTokenEvent([], fields);
715
+ },
716
+ kind: "StructClassReified",
717
+ };
718
+ };
719
+ Object.defineProperty(AddLiquidityTokenEvent, "r", {
720
+ get: function () {
721
+ return AddLiquidityTokenEvent.reified();
722
+ },
723
+ enumerable: false,
724
+ configurable: true
725
+ });
726
+ AddLiquidityTokenEvent.phantom = function () {
727
+ return (0, reified_1.phantom)(AddLiquidityTokenEvent.reified());
728
+ };
729
+ Object.defineProperty(AddLiquidityTokenEvent, "p", {
730
+ get: function () {
731
+ return AddLiquidityTokenEvent.phantom();
732
+ },
733
+ enumerable: false,
734
+ configurable: true
735
+ });
736
+ Object.defineProperty(AddLiquidityTokenEvent, "bcs", {
737
+ get: function () {
738
+ return bcs_1.bcs.struct("AddLiquidityTokenEvent", {
739
+ sender: bcs_1.bcs.bytes(32).transform({ input: function (val) { return (0, utils_1.fromHEX)(val); }, output: function (val) { return (0, utils_1.toHEX)(val); } }),
740
+ index: bcs_1.bcs.u64(),
741
+ token_type: structs_1.TypeName.bcs,
742
+ config: Config.bcs,
743
+ state: State.bcs,
744
+ u64_padding: bcs_1.bcs.vector(bcs_1.bcs.u64()),
745
+ });
746
+ },
747
+ enumerable: false,
748
+ configurable: true
749
+ });
750
+ AddLiquidityTokenEvent.fromFields = function (fields) {
751
+ return AddLiquidityTokenEvent.reified().new({
752
+ sender: (0, reified_1.decodeFromFields)("address", fields.sender),
753
+ index: (0, reified_1.decodeFromFields)("u64", fields.index),
754
+ tokenType: (0, reified_1.decodeFromFields)(structs_1.TypeName.reified(), fields.token_type),
755
+ config: (0, reified_1.decodeFromFields)(Config.reified(), fields.config),
756
+ state: (0, reified_1.decodeFromFields)(State.reified(), fields.state),
757
+ u64Padding: (0, reified_1.decodeFromFields)(reified.vector("u64"), fields.u64_padding),
758
+ });
759
+ };
760
+ AddLiquidityTokenEvent.fromFieldsWithTypes = function (item) {
761
+ if (!isAddLiquidityTokenEvent(item.type)) {
762
+ throw new Error("not a AddLiquidityTokenEvent type");
763
+ }
764
+ return AddLiquidityTokenEvent.reified().new({
765
+ sender: (0, reified_1.decodeFromFieldsWithTypes)("address", item.fields.sender),
766
+ index: (0, reified_1.decodeFromFieldsWithTypes)("u64", item.fields.index),
767
+ tokenType: (0, reified_1.decodeFromFieldsWithTypes)(structs_1.TypeName.reified(), item.fields.token_type),
768
+ config: (0, reified_1.decodeFromFieldsWithTypes)(Config.reified(), item.fields.config),
769
+ state: (0, reified_1.decodeFromFieldsWithTypes)(State.reified(), item.fields.state),
770
+ u64Padding: (0, reified_1.decodeFromFieldsWithTypes)(reified.vector("u64"), item.fields.u64_padding),
771
+ });
772
+ };
773
+ AddLiquidityTokenEvent.fromBcs = function (data) {
774
+ return AddLiquidityTokenEvent.fromFields(AddLiquidityTokenEvent.bcs.parse(data));
775
+ };
776
+ AddLiquidityTokenEvent.prototype.toJSONField = function () {
777
+ return {
778
+ sender: this.sender,
779
+ index: this.index.toString(),
780
+ tokenType: this.tokenType.toJSONField(),
781
+ config: this.config.toJSONField(),
782
+ state: this.state.toJSONField(),
783
+ u64Padding: (0, reified_1.fieldToJSON)("vector<u64>", this.u64Padding),
784
+ };
785
+ };
786
+ AddLiquidityTokenEvent.prototype.toJSON = function () {
787
+ return __assign({ $typeName: this.$typeName, $typeArgs: this.$typeArgs }, this.toJSONField());
788
+ };
789
+ AddLiquidityTokenEvent.fromJSONField = function (field) {
790
+ return AddLiquidityTokenEvent.reified().new({
791
+ sender: (0, reified_1.decodeFromJSONField)("address", field.sender),
792
+ index: (0, reified_1.decodeFromJSONField)("u64", field.index),
793
+ tokenType: (0, reified_1.decodeFromJSONField)(structs_1.TypeName.reified(), field.tokenType),
794
+ config: (0, reified_1.decodeFromJSONField)(Config.reified(), field.config),
795
+ state: (0, reified_1.decodeFromJSONField)(State.reified(), field.state),
796
+ u64Padding: (0, reified_1.decodeFromJSONField)(reified.vector("u64"), field.u64Padding),
797
+ });
798
+ };
799
+ AddLiquidityTokenEvent.fromJSON = function (json) {
800
+ if (json.$typeName !== AddLiquidityTokenEvent.$typeName) {
801
+ throw new Error("not a WithTwoGenerics json object");
802
+ }
803
+ return AddLiquidityTokenEvent.fromJSONField(json);
804
+ };
805
+ AddLiquidityTokenEvent.fromSuiParsedData = function (content) {
806
+ if (content.dataType !== "moveObject") {
807
+ throw new Error("not an object");
808
+ }
809
+ if (!isAddLiquidityTokenEvent(content.type)) {
810
+ throw new Error("object at ".concat(content.fields.id, " is not a AddLiquidityTokenEvent object"));
811
+ }
812
+ return AddLiquidityTokenEvent.fromFieldsWithTypes(content);
813
+ };
814
+ AddLiquidityTokenEvent.fromSuiObjectData = function (data) {
815
+ if (data.bcs) {
816
+ if (data.bcs.dataType !== "moveObject" || !isAddLiquidityTokenEvent(data.bcs.type)) {
817
+ throw new Error("object at is not a AddLiquidityTokenEvent object");
818
+ }
819
+ return AddLiquidityTokenEvent.fromBcs((0, utils_1.fromB64)(data.bcs.bcsBytes));
820
+ }
821
+ if (data.content) {
822
+ return AddLiquidityTokenEvent.fromSuiParsedData(data.content);
823
+ }
824
+ throw new Error("Both `bcs` and `content` fields are missing from the data. Include `showBcs` or `showContent` in the request.");
825
+ };
826
+ AddLiquidityTokenEvent.fetch = function (client, id) {
827
+ return __awaiter(this, void 0, void 0, function () {
828
+ var res;
829
+ var _a, _b;
830
+ return __generator(this, function (_c) {
831
+ switch (_c.label) {
832
+ case 0: return [4 /*yield*/, client.getObject({ id: id, options: { showBcs: true } })];
833
+ case 1:
834
+ res = _c.sent();
835
+ if (res.error) {
836
+ throw new Error("error fetching AddLiquidityTokenEvent object at id ".concat(id, ": ").concat(res.error.code));
837
+ }
838
+ if (((_b = (_a = res.data) === null || _a === void 0 ? void 0 : _a.bcs) === null || _b === void 0 ? void 0 : _b.dataType) !== "moveObject" || !isAddLiquidityTokenEvent(res.data.bcs.type)) {
839
+ throw new Error("object at id ".concat(id, " is not a AddLiquidityTokenEvent object"));
840
+ }
841
+ return [2 /*return*/, AddLiquidityTokenEvent.fromSuiObjectData(res.data)];
842
+ }
843
+ });
844
+ });
845
+ };
846
+ AddLiquidityTokenEvent.$typeName = "".concat(index_1.PKG_V1, "::lp_pool::AddLiquidityTokenEvent");
847
+ AddLiquidityTokenEvent.$numTypeParams = 0;
848
+ AddLiquidityTokenEvent.$isPhantom = [];
849
+ return AddLiquidityTokenEvent;
850
+ }());
851
+ exports.AddLiquidityTokenEvent = AddLiquidityTokenEvent;
852
+ /* ============================== BurnLpEvent =============================== */
853
+ function isBurnLpEvent(type) {
854
+ type = (0, util_1.compressSuiType)(type);
855
+ return type === "".concat(index_1.PKG_V1, "::lp_pool::BurnLpEvent");
856
+ }
857
+ var BurnLpEvent = /** @class */ (function () {
858
+ function BurnLpEvent(typeArgs, fields) {
859
+ this.__StructClass = true;
860
+ this.$typeName = BurnLpEvent.$typeName;
861
+ this.$isPhantom = BurnLpEvent.$isPhantom;
862
+ this.$fullTypeName = util_1.composeSuiType.apply(void 0, __spreadArray([BurnLpEvent.$typeName], __read(typeArgs), false));
863
+ this.$typeArgs = typeArgs;
864
+ this.sender = fields.sender;
865
+ this.index = fields.index;
866
+ this.lpTokenType = fields.lpTokenType;
867
+ this.burnLpAmount = fields.burnLpAmount;
868
+ this.burnAmountUsd = fields.burnAmountUsd;
869
+ this.burnFeeUsd = fields.burnFeeUsd;
870
+ this.liquidityTokenType = fields.liquidityTokenType;
871
+ this.withdrawTokenAmount = fields.withdrawTokenAmount;
872
+ this.u64Padding = fields.u64Padding;
873
+ }
874
+ BurnLpEvent.reified = function () {
875
+ var _this = this;
876
+ return {
877
+ typeName: BurnLpEvent.$typeName,
878
+ fullTypeName: util_1.composeSuiType.apply(void 0, __spreadArray([BurnLpEvent.$typeName], [], false)),
879
+ typeArgs: [],
880
+ isPhantom: BurnLpEvent.$isPhantom,
881
+ reifiedTypeArgs: [],
882
+ fromFields: function (fields) { return BurnLpEvent.fromFields(fields); },
883
+ fromFieldsWithTypes: function (item) { return BurnLpEvent.fromFieldsWithTypes(item); },
884
+ fromBcs: function (data) { return BurnLpEvent.fromBcs(data); },
885
+ bcs: BurnLpEvent.bcs,
886
+ fromJSONField: function (field) { return BurnLpEvent.fromJSONField(field); },
887
+ fromJSON: function (json) { return BurnLpEvent.fromJSON(json); },
888
+ fromSuiParsedData: function (content) { return BurnLpEvent.fromSuiParsedData(content); },
889
+ fromSuiObjectData: function (content) { return BurnLpEvent.fromSuiObjectData(content); },
890
+ fetch: function (client, id) { return __awaiter(_this, void 0, void 0, function () { return __generator(this, function (_a) {
891
+ return [2 /*return*/, BurnLpEvent.fetch(client, id)];
892
+ }); }); },
893
+ new: function (fields) {
894
+ return new BurnLpEvent([], fields);
895
+ },
896
+ kind: "StructClassReified",
897
+ };
898
+ };
899
+ Object.defineProperty(BurnLpEvent, "r", {
900
+ get: function () {
901
+ return BurnLpEvent.reified();
902
+ },
903
+ enumerable: false,
904
+ configurable: true
905
+ });
906
+ BurnLpEvent.phantom = function () {
907
+ return (0, reified_1.phantom)(BurnLpEvent.reified());
908
+ };
909
+ Object.defineProperty(BurnLpEvent, "p", {
910
+ get: function () {
911
+ return BurnLpEvent.phantom();
912
+ },
913
+ enumerable: false,
914
+ configurable: true
915
+ });
916
+ Object.defineProperty(BurnLpEvent, "bcs", {
917
+ get: function () {
918
+ return bcs_1.bcs.struct("BurnLpEvent", {
919
+ sender: bcs_1.bcs.bytes(32).transform({ input: function (val) { return (0, utils_1.fromHEX)(val); }, output: function (val) { return (0, utils_1.toHEX)(val); } }),
920
+ index: bcs_1.bcs.u64(),
921
+ lp_token_type: structs_1.TypeName.bcs,
922
+ burn_lp_amount: bcs_1.bcs.u64(),
923
+ burn_amount_usd: bcs_1.bcs.u64(),
924
+ burn_fee_usd: bcs_1.bcs.u64(),
925
+ liquidity_token_type: structs_1.TypeName.bcs,
926
+ withdraw_token_amount: bcs_1.bcs.u64(),
927
+ u64_padding: bcs_1.bcs.vector(bcs_1.bcs.u64()),
928
+ });
929
+ },
930
+ enumerable: false,
931
+ configurable: true
932
+ });
933
+ BurnLpEvent.fromFields = function (fields) {
934
+ return BurnLpEvent.reified().new({
935
+ sender: (0, reified_1.decodeFromFields)("address", fields.sender),
936
+ index: (0, reified_1.decodeFromFields)("u64", fields.index),
937
+ lpTokenType: (0, reified_1.decodeFromFields)(structs_1.TypeName.reified(), fields.lp_token_type),
938
+ burnLpAmount: (0, reified_1.decodeFromFields)("u64", fields.burn_lp_amount),
939
+ burnAmountUsd: (0, reified_1.decodeFromFields)("u64", fields.burn_amount_usd),
940
+ burnFeeUsd: (0, reified_1.decodeFromFields)("u64", fields.burn_fee_usd),
941
+ liquidityTokenType: (0, reified_1.decodeFromFields)(structs_1.TypeName.reified(), fields.liquidity_token_type),
942
+ withdrawTokenAmount: (0, reified_1.decodeFromFields)("u64", fields.withdraw_token_amount),
943
+ u64Padding: (0, reified_1.decodeFromFields)(reified.vector("u64"), fields.u64_padding),
944
+ });
945
+ };
946
+ BurnLpEvent.fromFieldsWithTypes = function (item) {
947
+ if (!isBurnLpEvent(item.type)) {
948
+ throw new Error("not a BurnLpEvent type");
949
+ }
950
+ return BurnLpEvent.reified().new({
951
+ sender: (0, reified_1.decodeFromFieldsWithTypes)("address", item.fields.sender),
952
+ index: (0, reified_1.decodeFromFieldsWithTypes)("u64", item.fields.index),
953
+ lpTokenType: (0, reified_1.decodeFromFieldsWithTypes)(structs_1.TypeName.reified(), item.fields.lp_token_type),
954
+ burnLpAmount: (0, reified_1.decodeFromFieldsWithTypes)("u64", item.fields.burn_lp_amount),
955
+ burnAmountUsd: (0, reified_1.decodeFromFieldsWithTypes)("u64", item.fields.burn_amount_usd),
956
+ burnFeeUsd: (0, reified_1.decodeFromFieldsWithTypes)("u64", item.fields.burn_fee_usd),
957
+ liquidityTokenType: (0, reified_1.decodeFromFieldsWithTypes)(structs_1.TypeName.reified(), item.fields.liquidity_token_type),
958
+ withdrawTokenAmount: (0, reified_1.decodeFromFieldsWithTypes)("u64", item.fields.withdraw_token_amount),
959
+ u64Padding: (0, reified_1.decodeFromFieldsWithTypes)(reified.vector("u64"), item.fields.u64_padding),
960
+ });
961
+ };
962
+ BurnLpEvent.fromBcs = function (data) {
963
+ return BurnLpEvent.fromFields(BurnLpEvent.bcs.parse(data));
964
+ };
965
+ BurnLpEvent.prototype.toJSONField = function () {
966
+ return {
967
+ sender: this.sender,
968
+ index: this.index.toString(),
969
+ lpTokenType: this.lpTokenType.toJSONField(),
970
+ burnLpAmount: this.burnLpAmount.toString(),
971
+ burnAmountUsd: this.burnAmountUsd.toString(),
972
+ burnFeeUsd: this.burnFeeUsd.toString(),
973
+ liquidityTokenType: this.liquidityTokenType.toJSONField(),
974
+ withdrawTokenAmount: this.withdrawTokenAmount.toString(),
975
+ u64Padding: (0, reified_1.fieldToJSON)("vector<u64>", this.u64Padding),
976
+ };
977
+ };
978
+ BurnLpEvent.prototype.toJSON = function () {
979
+ return __assign({ $typeName: this.$typeName, $typeArgs: this.$typeArgs }, this.toJSONField());
980
+ };
981
+ BurnLpEvent.fromJSONField = function (field) {
982
+ return BurnLpEvent.reified().new({
983
+ sender: (0, reified_1.decodeFromJSONField)("address", field.sender),
984
+ index: (0, reified_1.decodeFromJSONField)("u64", field.index),
985
+ lpTokenType: (0, reified_1.decodeFromJSONField)(structs_1.TypeName.reified(), field.lpTokenType),
986
+ burnLpAmount: (0, reified_1.decodeFromJSONField)("u64", field.burnLpAmount),
987
+ burnAmountUsd: (0, reified_1.decodeFromJSONField)("u64", field.burnAmountUsd),
988
+ burnFeeUsd: (0, reified_1.decodeFromJSONField)("u64", field.burnFeeUsd),
989
+ liquidityTokenType: (0, reified_1.decodeFromJSONField)(structs_1.TypeName.reified(), field.liquidityTokenType),
990
+ withdrawTokenAmount: (0, reified_1.decodeFromJSONField)("u64", field.withdrawTokenAmount),
991
+ u64Padding: (0, reified_1.decodeFromJSONField)(reified.vector("u64"), field.u64Padding),
992
+ });
993
+ };
994
+ BurnLpEvent.fromJSON = function (json) {
995
+ if (json.$typeName !== BurnLpEvent.$typeName) {
996
+ throw new Error("not a WithTwoGenerics json object");
997
+ }
998
+ return BurnLpEvent.fromJSONField(json);
999
+ };
1000
+ BurnLpEvent.fromSuiParsedData = function (content) {
1001
+ if (content.dataType !== "moveObject") {
1002
+ throw new Error("not an object");
1003
+ }
1004
+ if (!isBurnLpEvent(content.type)) {
1005
+ throw new Error("object at ".concat(content.fields.id, " is not a BurnLpEvent object"));
1006
+ }
1007
+ return BurnLpEvent.fromFieldsWithTypes(content);
1008
+ };
1009
+ BurnLpEvent.fromSuiObjectData = function (data) {
1010
+ if (data.bcs) {
1011
+ if (data.bcs.dataType !== "moveObject" || !isBurnLpEvent(data.bcs.type)) {
1012
+ throw new Error("object at is not a BurnLpEvent object");
1013
+ }
1014
+ return BurnLpEvent.fromBcs((0, utils_1.fromB64)(data.bcs.bcsBytes));
1015
+ }
1016
+ if (data.content) {
1017
+ return BurnLpEvent.fromSuiParsedData(data.content);
1018
+ }
1019
+ throw new Error("Both `bcs` and `content` fields are missing from the data. Include `showBcs` or `showContent` in the request.");
1020
+ };
1021
+ BurnLpEvent.fetch = function (client, id) {
1022
+ return __awaiter(this, void 0, void 0, function () {
1023
+ var res;
1024
+ var _a, _b;
1025
+ return __generator(this, function (_c) {
1026
+ switch (_c.label) {
1027
+ case 0: return [4 /*yield*/, client.getObject({ id: id, options: { showBcs: true } })];
1028
+ case 1:
1029
+ res = _c.sent();
1030
+ if (res.error) {
1031
+ throw new Error("error fetching BurnLpEvent object at id ".concat(id, ": ").concat(res.error.code));
1032
+ }
1033
+ if (((_b = (_a = res.data) === null || _a === void 0 ? void 0 : _a.bcs) === null || _b === void 0 ? void 0 : _b.dataType) !== "moveObject" || !isBurnLpEvent(res.data.bcs.type)) {
1034
+ throw new Error("object at id ".concat(id, " is not a BurnLpEvent object"));
1035
+ }
1036
+ return [2 /*return*/, BurnLpEvent.fromSuiObjectData(res.data)];
1037
+ }
1038
+ });
1039
+ });
1040
+ };
1041
+ BurnLpEvent.$typeName = "".concat(index_1.PKG_V1, "::lp_pool::BurnLpEvent");
1042
+ BurnLpEvent.$numTypeParams = 0;
1043
+ BurnLpEvent.$isPhantom = [];
1044
+ return BurnLpEvent;
1045
+ }());
1046
+ exports.BurnLpEvent = BurnLpEvent;
1047
+ /* ============================== CompleteRemoveLiquidityTokenProcessEvent =============================== */
1048
+ function isCompleteRemoveLiquidityTokenProcessEvent(type) {
1049
+ type = (0, util_1.compressSuiType)(type);
1050
+ return type === "".concat(index_1.PKG_V1, "::lp_pool::CompleteRemoveLiquidityTokenProcessEvent");
1051
+ }
1052
+ var CompleteRemoveLiquidityTokenProcessEvent = /** @class */ (function () {
1053
+ function CompleteRemoveLiquidityTokenProcessEvent(typeArgs, fields) {
1054
+ this.__StructClass = true;
1055
+ this.$typeName = CompleteRemoveLiquidityTokenProcessEvent.$typeName;
1056
+ this.$isPhantom = CompleteRemoveLiquidityTokenProcessEvent.$isPhantom;
1057
+ this.$fullTypeName = util_1.composeSuiType.apply(void 0, __spreadArray([CompleteRemoveLiquidityTokenProcessEvent.$typeName], __read(typeArgs), false));
1058
+ this.$typeArgs = typeArgs;
1059
+ this.index = fields.index;
1060
+ this.liquidityToken = fields.liquidityToken;
1061
+ this.removedUsd = fields.removedUsd;
1062
+ this.repaidUsd = fields.repaidUsd;
1063
+ this.u64Padding = fields.u64Padding;
1064
+ }
1065
+ CompleteRemoveLiquidityTokenProcessEvent.reified = function () {
1066
+ var _this = this;
1067
+ return {
1068
+ typeName: CompleteRemoveLiquidityTokenProcessEvent.$typeName,
1069
+ fullTypeName: util_1.composeSuiType.apply(void 0, __spreadArray([CompleteRemoveLiquidityTokenProcessEvent.$typeName], [], false)),
1070
+ typeArgs: [],
1071
+ isPhantom: CompleteRemoveLiquidityTokenProcessEvent.$isPhantom,
1072
+ reifiedTypeArgs: [],
1073
+ fromFields: function (fields) { return CompleteRemoveLiquidityTokenProcessEvent.fromFields(fields); },
1074
+ fromFieldsWithTypes: function (item) { return CompleteRemoveLiquidityTokenProcessEvent.fromFieldsWithTypes(item); },
1075
+ fromBcs: function (data) { return CompleteRemoveLiquidityTokenProcessEvent.fromBcs(data); },
1076
+ bcs: CompleteRemoveLiquidityTokenProcessEvent.bcs,
1077
+ fromJSONField: function (field) { return CompleteRemoveLiquidityTokenProcessEvent.fromJSONField(field); },
1078
+ fromJSON: function (json) { return CompleteRemoveLiquidityTokenProcessEvent.fromJSON(json); },
1079
+ fromSuiParsedData: function (content) { return CompleteRemoveLiquidityTokenProcessEvent.fromSuiParsedData(content); },
1080
+ fromSuiObjectData: function (content) { return CompleteRemoveLiquidityTokenProcessEvent.fromSuiObjectData(content); },
1081
+ fetch: function (client, id) { return __awaiter(_this, void 0, void 0, function () { return __generator(this, function (_a) {
1082
+ return [2 /*return*/, CompleteRemoveLiquidityTokenProcessEvent.fetch(client, id)];
1083
+ }); }); },
1084
+ new: function (fields) {
1085
+ return new CompleteRemoveLiquidityTokenProcessEvent([], fields);
1086
+ },
1087
+ kind: "StructClassReified",
1088
+ };
1089
+ };
1090
+ Object.defineProperty(CompleteRemoveLiquidityTokenProcessEvent, "r", {
1091
+ get: function () {
1092
+ return CompleteRemoveLiquidityTokenProcessEvent.reified();
1093
+ },
1094
+ enumerable: false,
1095
+ configurable: true
1096
+ });
1097
+ CompleteRemoveLiquidityTokenProcessEvent.phantom = function () {
1098
+ return (0, reified_1.phantom)(CompleteRemoveLiquidityTokenProcessEvent.reified());
1099
+ };
1100
+ Object.defineProperty(CompleteRemoveLiquidityTokenProcessEvent, "p", {
1101
+ get: function () {
1102
+ return CompleteRemoveLiquidityTokenProcessEvent.phantom();
1103
+ },
1104
+ enumerable: false,
1105
+ configurable: true
1106
+ });
1107
+ Object.defineProperty(CompleteRemoveLiquidityTokenProcessEvent, "bcs", {
1108
+ get: function () {
1109
+ return bcs_1.bcs.struct("CompleteRemoveLiquidityTokenProcessEvent", {
1110
+ index: bcs_1.bcs.u64(),
1111
+ liquidity_token: structs_1.TypeName.bcs,
1112
+ removed_usd: bcs_1.bcs.u64(),
1113
+ repaid_usd: bcs_1.bcs.u64(),
1114
+ u64_padding: bcs_1.bcs.vector(bcs_1.bcs.u64()),
1115
+ });
1116
+ },
1117
+ enumerable: false,
1118
+ configurable: true
1119
+ });
1120
+ CompleteRemoveLiquidityTokenProcessEvent.fromFields = function (fields) {
1121
+ return CompleteRemoveLiquidityTokenProcessEvent.reified().new({
1122
+ index: (0, reified_1.decodeFromFields)("u64", fields.index),
1123
+ liquidityToken: (0, reified_1.decodeFromFields)(structs_1.TypeName.reified(), fields.liquidity_token),
1124
+ removedUsd: (0, reified_1.decodeFromFields)("u64", fields.removed_usd),
1125
+ repaidUsd: (0, reified_1.decodeFromFields)("u64", fields.repaid_usd),
1126
+ u64Padding: (0, reified_1.decodeFromFields)(reified.vector("u64"), fields.u64_padding),
1127
+ });
1128
+ };
1129
+ CompleteRemoveLiquidityTokenProcessEvent.fromFieldsWithTypes = function (item) {
1130
+ if (!isCompleteRemoveLiquidityTokenProcessEvent(item.type)) {
1131
+ throw new Error("not a CompleteRemoveLiquidityTokenProcessEvent type");
1132
+ }
1133
+ return CompleteRemoveLiquidityTokenProcessEvent.reified().new({
1134
+ index: (0, reified_1.decodeFromFieldsWithTypes)("u64", item.fields.index),
1135
+ liquidityToken: (0, reified_1.decodeFromFieldsWithTypes)(structs_1.TypeName.reified(), item.fields.liquidity_token),
1136
+ removedUsd: (0, reified_1.decodeFromFieldsWithTypes)("u64", item.fields.removed_usd),
1137
+ repaidUsd: (0, reified_1.decodeFromFieldsWithTypes)("u64", item.fields.repaid_usd),
1138
+ u64Padding: (0, reified_1.decodeFromFieldsWithTypes)(reified.vector("u64"), item.fields.u64_padding),
1139
+ });
1140
+ };
1141
+ CompleteRemoveLiquidityTokenProcessEvent.fromBcs = function (data) {
1142
+ return CompleteRemoveLiquidityTokenProcessEvent.fromFields(CompleteRemoveLiquidityTokenProcessEvent.bcs.parse(data));
1143
+ };
1144
+ CompleteRemoveLiquidityTokenProcessEvent.prototype.toJSONField = function () {
1145
+ return {
1146
+ index: this.index.toString(),
1147
+ liquidityToken: this.liquidityToken.toJSONField(),
1148
+ removedUsd: this.removedUsd.toString(),
1149
+ repaidUsd: this.repaidUsd.toString(),
1150
+ u64Padding: (0, reified_1.fieldToJSON)("vector<u64>", this.u64Padding),
1151
+ };
1152
+ };
1153
+ CompleteRemoveLiquidityTokenProcessEvent.prototype.toJSON = function () {
1154
+ return __assign({ $typeName: this.$typeName, $typeArgs: this.$typeArgs }, this.toJSONField());
1155
+ };
1156
+ CompleteRemoveLiquidityTokenProcessEvent.fromJSONField = function (field) {
1157
+ return CompleteRemoveLiquidityTokenProcessEvent.reified().new({
1158
+ index: (0, reified_1.decodeFromJSONField)("u64", field.index),
1159
+ liquidityToken: (0, reified_1.decodeFromJSONField)(structs_1.TypeName.reified(), field.liquidityToken),
1160
+ removedUsd: (0, reified_1.decodeFromJSONField)("u64", field.removedUsd),
1161
+ repaidUsd: (0, reified_1.decodeFromJSONField)("u64", field.repaidUsd),
1162
+ u64Padding: (0, reified_1.decodeFromJSONField)(reified.vector("u64"), field.u64Padding),
1163
+ });
1164
+ };
1165
+ CompleteRemoveLiquidityTokenProcessEvent.fromJSON = function (json) {
1166
+ if (json.$typeName !== CompleteRemoveLiquidityTokenProcessEvent.$typeName) {
1167
+ throw new Error("not a WithTwoGenerics json object");
1168
+ }
1169
+ return CompleteRemoveLiquidityTokenProcessEvent.fromJSONField(json);
1170
+ };
1171
+ CompleteRemoveLiquidityTokenProcessEvent.fromSuiParsedData = function (content) {
1172
+ if (content.dataType !== "moveObject") {
1173
+ throw new Error("not an object");
1174
+ }
1175
+ if (!isCompleteRemoveLiquidityTokenProcessEvent(content.type)) {
1176
+ throw new Error("object at ".concat(content.fields.id, " is not a CompleteRemoveLiquidityTokenProcessEvent object"));
1177
+ }
1178
+ return CompleteRemoveLiquidityTokenProcessEvent.fromFieldsWithTypes(content);
1179
+ };
1180
+ CompleteRemoveLiquidityTokenProcessEvent.fromSuiObjectData = function (data) {
1181
+ if (data.bcs) {
1182
+ if (data.bcs.dataType !== "moveObject" || !isCompleteRemoveLiquidityTokenProcessEvent(data.bcs.type)) {
1183
+ throw new Error("object at is not a CompleteRemoveLiquidityTokenProcessEvent object");
1184
+ }
1185
+ return CompleteRemoveLiquidityTokenProcessEvent.fromBcs((0, utils_1.fromB64)(data.bcs.bcsBytes));
1186
+ }
1187
+ if (data.content) {
1188
+ return CompleteRemoveLiquidityTokenProcessEvent.fromSuiParsedData(data.content);
1189
+ }
1190
+ throw new Error("Both `bcs` and `content` fields are missing from the data. Include `showBcs` or `showContent` in the request.");
1191
+ };
1192
+ CompleteRemoveLiquidityTokenProcessEvent.fetch = function (client, id) {
1193
+ return __awaiter(this, void 0, void 0, function () {
1194
+ var res;
1195
+ var _a, _b;
1196
+ return __generator(this, function (_c) {
1197
+ switch (_c.label) {
1198
+ case 0: return [4 /*yield*/, client.getObject({ id: id, options: { showBcs: true } })];
1199
+ case 1:
1200
+ res = _c.sent();
1201
+ if (res.error) {
1202
+ throw new Error("error fetching CompleteRemoveLiquidityTokenProcessEvent object at id ".concat(id, ": ").concat(res.error.code));
1203
+ }
1204
+ if (((_b = (_a = res.data) === null || _a === void 0 ? void 0 : _a.bcs) === null || _b === void 0 ? void 0 : _b.dataType) !== "moveObject" || !isCompleteRemoveLiquidityTokenProcessEvent(res.data.bcs.type)) {
1205
+ throw new Error("object at id ".concat(id, " is not a CompleteRemoveLiquidityTokenProcessEvent object"));
1206
+ }
1207
+ return [2 /*return*/, CompleteRemoveLiquidityTokenProcessEvent.fromSuiObjectData(res.data)];
1208
+ }
1209
+ });
1210
+ });
1211
+ };
1212
+ CompleteRemoveLiquidityTokenProcessEvent.$typeName = "".concat(index_1.PKG_V1, "::lp_pool::CompleteRemoveLiquidityTokenProcessEvent");
1213
+ CompleteRemoveLiquidityTokenProcessEvent.$numTypeParams = 0;
1214
+ CompleteRemoveLiquidityTokenProcessEvent.$isPhantom = [];
1215
+ return CompleteRemoveLiquidityTokenProcessEvent;
1216
+ }());
1217
+ exports.CompleteRemoveLiquidityTokenProcessEvent = CompleteRemoveLiquidityTokenProcessEvent;
1218
+ /* ============================== LiquidityPool =============================== */
1219
+ function isLiquidityPool(type) {
1220
+ type = (0, util_1.compressSuiType)(type);
1221
+ return type === "".concat(index_1.PKG_V1, "::lp_pool::LiquidityPool");
1222
+ }
1223
+ var LiquidityPool = /** @class */ (function () {
1224
+ function LiquidityPool(typeArgs, fields) {
1225
+ this.__StructClass = true;
1226
+ this.$typeName = LiquidityPool.$typeName;
1227
+ this.$isPhantom = LiquidityPool.$isPhantom;
1228
+ this.$fullTypeName = util_1.composeSuiType.apply(void 0, __spreadArray([LiquidityPool.$typeName], __read(typeArgs), false));
1229
+ this.$typeArgs = typeArgs;
1230
+ this.id = fields.id;
1231
+ this.index = fields.index;
1232
+ this.lpTokenType = fields.lpTokenType;
1233
+ this.liquidityTokens = fields.liquidityTokens;
1234
+ this.tokenPools = fields.tokenPools;
1235
+ this.poolInfo = fields.poolInfo;
1236
+ this.liquidatedUnsettledReceipts = fields.liquidatedUnsettledReceipts;
1237
+ this.u64Padding = fields.u64Padding;
1238
+ this.bcsPadding = fields.bcsPadding;
1239
+ }
1240
+ LiquidityPool.reified = function () {
1241
+ var _this = this;
1242
+ return {
1243
+ typeName: LiquidityPool.$typeName,
1244
+ fullTypeName: util_1.composeSuiType.apply(void 0, __spreadArray([LiquidityPool.$typeName], [], false)),
1245
+ typeArgs: [],
1246
+ isPhantom: LiquidityPool.$isPhantom,
1247
+ reifiedTypeArgs: [],
1248
+ fromFields: function (fields) { return LiquidityPool.fromFields(fields); },
1249
+ fromFieldsWithTypes: function (item) { return LiquidityPool.fromFieldsWithTypes(item); },
1250
+ fromBcs: function (data) { return LiquidityPool.fromBcs(data); },
1251
+ bcs: LiquidityPool.bcs,
1252
+ fromJSONField: function (field) { return LiquidityPool.fromJSONField(field); },
1253
+ fromJSON: function (json) { return LiquidityPool.fromJSON(json); },
1254
+ fromSuiParsedData: function (content) { return LiquidityPool.fromSuiParsedData(content); },
1255
+ fromSuiObjectData: function (content) { return LiquidityPool.fromSuiObjectData(content); },
1256
+ fetch: function (client, id) { return __awaiter(_this, void 0, void 0, function () { return __generator(this, function (_a) {
1257
+ return [2 /*return*/, LiquidityPool.fetch(client, id)];
1258
+ }); }); },
1259
+ new: function (fields) {
1260
+ return new LiquidityPool([], fields);
1261
+ },
1262
+ kind: "StructClassReified",
1263
+ };
1264
+ };
1265
+ Object.defineProperty(LiquidityPool, "r", {
1266
+ get: function () {
1267
+ return LiquidityPool.reified();
1268
+ },
1269
+ enumerable: false,
1270
+ configurable: true
1271
+ });
1272
+ LiquidityPool.phantom = function () {
1273
+ return (0, reified_1.phantom)(LiquidityPool.reified());
1274
+ };
1275
+ Object.defineProperty(LiquidityPool, "p", {
1276
+ get: function () {
1277
+ return LiquidityPool.phantom();
1278
+ },
1279
+ enumerable: false,
1280
+ configurable: true
1281
+ });
1282
+ Object.defineProperty(LiquidityPool, "bcs", {
1283
+ get: function () {
1284
+ return bcs_1.bcs.struct("LiquidityPool", {
1285
+ id: structs_2.UID.bcs,
1286
+ index: bcs_1.bcs.u64(),
1287
+ lp_token_type: structs_1.TypeName.bcs,
1288
+ liquidity_tokens: bcs_1.bcs.vector(structs_1.TypeName.bcs),
1289
+ token_pools: bcs_1.bcs.vector(TokenPool.bcs),
1290
+ pool_info: LiquidityPoolInfo.bcs,
1291
+ liquidated_unsettled_receipts: bcs_1.bcs.vector(structs_3.UnsettledBidReceipt.bcs),
1292
+ u64_padding: bcs_1.bcs.vector(bcs_1.bcs.u64()),
1293
+ bcs_padding: bcs_1.bcs.vector(bcs_1.bcs.u8()),
1294
+ });
1295
+ },
1296
+ enumerable: false,
1297
+ configurable: true
1298
+ });
1299
+ LiquidityPool.fromFields = function (fields) {
1300
+ return LiquidityPool.reified().new({
1301
+ id: (0, reified_1.decodeFromFields)(structs_2.UID.reified(), fields.id),
1302
+ index: (0, reified_1.decodeFromFields)("u64", fields.index),
1303
+ lpTokenType: (0, reified_1.decodeFromFields)(structs_1.TypeName.reified(), fields.lp_token_type),
1304
+ liquidityTokens: (0, reified_1.decodeFromFields)(reified.vector(structs_1.TypeName.reified()), fields.liquidity_tokens),
1305
+ tokenPools: (0, reified_1.decodeFromFields)(reified.vector(TokenPool.reified()), fields.token_pools),
1306
+ poolInfo: (0, reified_1.decodeFromFields)(LiquidityPoolInfo.reified(), fields.pool_info),
1307
+ liquidatedUnsettledReceipts: (0, reified_1.decodeFromFields)(reified.vector(structs_3.UnsettledBidReceipt.reified()), fields.liquidated_unsettled_receipts),
1308
+ u64Padding: (0, reified_1.decodeFromFields)(reified.vector("u64"), fields.u64_padding),
1309
+ bcsPadding: (0, reified_1.decodeFromFields)(reified.vector("u8"), fields.bcs_padding),
1310
+ });
1311
+ };
1312
+ LiquidityPool.fromFieldsWithTypes = function (item) {
1313
+ if (!isLiquidityPool(item.type)) {
1314
+ throw new Error("not a LiquidityPool type");
1315
+ }
1316
+ return LiquidityPool.reified().new({
1317
+ id: (0, reified_1.decodeFromFieldsWithTypes)(structs_2.UID.reified(), item.fields.id),
1318
+ index: (0, reified_1.decodeFromFieldsWithTypes)("u64", item.fields.index),
1319
+ lpTokenType: (0, reified_1.decodeFromFieldsWithTypes)(structs_1.TypeName.reified(), item.fields.lp_token_type),
1320
+ liquidityTokens: (0, reified_1.decodeFromFieldsWithTypes)(reified.vector(structs_1.TypeName.reified()), item.fields.liquidity_tokens),
1321
+ tokenPools: (0, reified_1.decodeFromFieldsWithTypes)(reified.vector(TokenPool.reified()), item.fields.token_pools),
1322
+ poolInfo: (0, reified_1.decodeFromFieldsWithTypes)(LiquidityPoolInfo.reified(), item.fields.pool_info),
1323
+ liquidatedUnsettledReceipts: (0, reified_1.decodeFromFieldsWithTypes)(reified.vector(structs_3.UnsettledBidReceipt.reified()), item.fields.liquidated_unsettled_receipts),
1324
+ u64Padding: (0, reified_1.decodeFromFieldsWithTypes)(reified.vector("u64"), item.fields.u64_padding),
1325
+ bcsPadding: (0, reified_1.decodeFromFieldsWithTypes)(reified.vector("u8"), item.fields.bcs_padding),
1326
+ });
1327
+ };
1328
+ LiquidityPool.fromBcs = function (data) {
1329
+ return LiquidityPool.fromFields(LiquidityPool.bcs.parse(data));
1330
+ };
1331
+ LiquidityPool.prototype.toJSONField = function () {
1332
+ return {
1333
+ id: this.id,
1334
+ index: this.index.toString(),
1335
+ lpTokenType: this.lpTokenType.toJSONField(),
1336
+ liquidityTokens: (0, reified_1.fieldToJSON)("vector<".concat(structs_1.TypeName.$typeName, ">"), this.liquidityTokens),
1337
+ tokenPools: (0, reified_1.fieldToJSON)("vector<".concat(TokenPool.$typeName, ">"), this.tokenPools),
1338
+ poolInfo: this.poolInfo.toJSONField(),
1339
+ liquidatedUnsettledReceipts: (0, reified_1.fieldToJSON)("vector<".concat(structs_3.UnsettledBidReceipt.$typeName, ">"), this.liquidatedUnsettledReceipts),
1340
+ u64Padding: (0, reified_1.fieldToJSON)("vector<u64>", this.u64Padding),
1341
+ bcsPadding: (0, reified_1.fieldToJSON)("vector<u8>", this.bcsPadding),
1342
+ };
1343
+ };
1344
+ LiquidityPool.prototype.toJSON = function () {
1345
+ return __assign({ $typeName: this.$typeName, $typeArgs: this.$typeArgs }, this.toJSONField());
1346
+ };
1347
+ LiquidityPool.fromJSONField = function (field) {
1348
+ return LiquidityPool.reified().new({
1349
+ id: (0, reified_1.decodeFromJSONField)(structs_2.UID.reified(), field.id),
1350
+ index: (0, reified_1.decodeFromJSONField)("u64", field.index),
1351
+ lpTokenType: (0, reified_1.decodeFromJSONField)(structs_1.TypeName.reified(), field.lpTokenType),
1352
+ liquidityTokens: (0, reified_1.decodeFromJSONField)(reified.vector(structs_1.TypeName.reified()), field.liquidityTokens),
1353
+ tokenPools: (0, reified_1.decodeFromJSONField)(reified.vector(TokenPool.reified()), field.tokenPools),
1354
+ poolInfo: (0, reified_1.decodeFromJSONField)(LiquidityPoolInfo.reified(), field.poolInfo),
1355
+ liquidatedUnsettledReceipts: (0, reified_1.decodeFromJSONField)(reified.vector(structs_3.UnsettledBidReceipt.reified()), field.liquidatedUnsettledReceipts),
1356
+ u64Padding: (0, reified_1.decodeFromJSONField)(reified.vector("u64"), field.u64Padding),
1357
+ bcsPadding: (0, reified_1.decodeFromJSONField)(reified.vector("u8"), field.bcsPadding),
1358
+ });
1359
+ };
1360
+ LiquidityPool.fromJSON = function (json) {
1361
+ if (json.$typeName !== LiquidityPool.$typeName) {
1362
+ throw new Error("not a WithTwoGenerics json object");
1363
+ }
1364
+ return LiquidityPool.fromJSONField(json);
1365
+ };
1366
+ LiquidityPool.fromSuiParsedData = function (content) {
1367
+ if (content.dataType !== "moveObject") {
1368
+ throw new Error("not an object");
1369
+ }
1370
+ if (!isLiquidityPool(content.type)) {
1371
+ throw new Error("object at ".concat(content.fields.id, " is not a LiquidityPool object"));
1372
+ }
1373
+ return LiquidityPool.fromFieldsWithTypes(content);
1374
+ };
1375
+ LiquidityPool.fromSuiObjectData = function (data) {
1376
+ if (data.bcs) {
1377
+ if (data.bcs.dataType !== "moveObject" || !isLiquidityPool(data.bcs.type)) {
1378
+ throw new Error("object at is not a LiquidityPool object");
1379
+ }
1380
+ return LiquidityPool.fromBcs((0, utils_1.fromB64)(data.bcs.bcsBytes));
1381
+ }
1382
+ if (data.content) {
1383
+ return LiquidityPool.fromSuiParsedData(data.content);
1384
+ }
1385
+ throw new Error("Both `bcs` and `content` fields are missing from the data. Include `showBcs` or `showContent` in the request.");
1386
+ };
1387
+ LiquidityPool.fetch = function (client, id) {
1388
+ return __awaiter(this, void 0, void 0, function () {
1389
+ var res;
1390
+ var _a, _b;
1391
+ return __generator(this, function (_c) {
1392
+ switch (_c.label) {
1393
+ case 0: return [4 /*yield*/, client.getObject({ id: id, options: { showBcs: true } })];
1394
+ case 1:
1395
+ res = _c.sent();
1396
+ if (res.error) {
1397
+ throw new Error("error fetching LiquidityPool object at id ".concat(id, ": ").concat(res.error.code));
1398
+ }
1399
+ if (((_b = (_a = res.data) === null || _a === void 0 ? void 0 : _a.bcs) === null || _b === void 0 ? void 0 : _b.dataType) !== "moveObject" || !isLiquidityPool(res.data.bcs.type)) {
1400
+ throw new Error("object at id ".concat(id, " is not a LiquidityPool object"));
1401
+ }
1402
+ return [2 /*return*/, LiquidityPool.fromSuiObjectData(res.data)];
1403
+ }
1404
+ });
1405
+ });
1406
+ };
1407
+ LiquidityPool.$typeName = "".concat(index_1.PKG_V1, "::lp_pool::LiquidityPool");
1408
+ LiquidityPool.$numTypeParams = 0;
1409
+ LiquidityPool.$isPhantom = [];
1410
+ return LiquidityPool;
1411
+ }());
1412
+ exports.LiquidityPool = LiquidityPool;
1413
+ /* ============================== LiquidityPoolInfo =============================== */
1414
+ function isLiquidityPoolInfo(type) {
1415
+ type = (0, util_1.compressSuiType)(type);
1416
+ return type === "".concat(index_1.PKG_V1, "::lp_pool::LiquidityPoolInfo");
1417
+ }
1418
+ var LiquidityPoolInfo = /** @class */ (function () {
1419
+ function LiquidityPoolInfo(typeArgs, fields) {
1420
+ this.__StructClass = true;
1421
+ this.$typeName = LiquidityPoolInfo.$typeName;
1422
+ this.$isPhantom = LiquidityPoolInfo.$isPhantom;
1423
+ this.$fullTypeName = util_1.composeSuiType.apply(void 0, __spreadArray([LiquidityPoolInfo.$typeName], __read(typeArgs), false));
1424
+ this.$typeArgs = typeArgs;
1425
+ this.lpTokenDecimal = fields.lpTokenDecimal;
1426
+ this.totalShareSupply = fields.totalShareSupply;
1427
+ this.tvlUsd = fields.tvlUsd;
1428
+ this.isActive = fields.isActive;
1429
+ }
1430
+ LiquidityPoolInfo.reified = function () {
1431
+ var _this = this;
1432
+ return {
1433
+ typeName: LiquidityPoolInfo.$typeName,
1434
+ fullTypeName: util_1.composeSuiType.apply(void 0, __spreadArray([LiquidityPoolInfo.$typeName], [], false)),
1435
+ typeArgs: [],
1436
+ isPhantom: LiquidityPoolInfo.$isPhantom,
1437
+ reifiedTypeArgs: [],
1438
+ fromFields: function (fields) { return LiquidityPoolInfo.fromFields(fields); },
1439
+ fromFieldsWithTypes: function (item) { return LiquidityPoolInfo.fromFieldsWithTypes(item); },
1440
+ fromBcs: function (data) { return LiquidityPoolInfo.fromBcs(data); },
1441
+ bcs: LiquidityPoolInfo.bcs,
1442
+ fromJSONField: function (field) { return LiquidityPoolInfo.fromJSONField(field); },
1443
+ fromJSON: function (json) { return LiquidityPoolInfo.fromJSON(json); },
1444
+ fromSuiParsedData: function (content) { return LiquidityPoolInfo.fromSuiParsedData(content); },
1445
+ fromSuiObjectData: function (content) { return LiquidityPoolInfo.fromSuiObjectData(content); },
1446
+ fetch: function (client, id) { return __awaiter(_this, void 0, void 0, function () { return __generator(this, function (_a) {
1447
+ return [2 /*return*/, LiquidityPoolInfo.fetch(client, id)];
1448
+ }); }); },
1449
+ new: function (fields) {
1450
+ return new LiquidityPoolInfo([], fields);
1451
+ },
1452
+ kind: "StructClassReified",
1453
+ };
1454
+ };
1455
+ Object.defineProperty(LiquidityPoolInfo, "r", {
1456
+ get: function () {
1457
+ return LiquidityPoolInfo.reified();
1458
+ },
1459
+ enumerable: false,
1460
+ configurable: true
1461
+ });
1462
+ LiquidityPoolInfo.phantom = function () {
1463
+ return (0, reified_1.phantom)(LiquidityPoolInfo.reified());
1464
+ };
1465
+ Object.defineProperty(LiquidityPoolInfo, "p", {
1466
+ get: function () {
1467
+ return LiquidityPoolInfo.phantom();
1468
+ },
1469
+ enumerable: false,
1470
+ configurable: true
1471
+ });
1472
+ Object.defineProperty(LiquidityPoolInfo, "bcs", {
1473
+ get: function () {
1474
+ return bcs_1.bcs.struct("LiquidityPoolInfo", {
1475
+ lp_token_decimal: bcs_1.bcs.u64(),
1476
+ total_share_supply: bcs_1.bcs.u64(),
1477
+ tvl_usd: bcs_1.bcs.u64(),
1478
+ is_active: bcs_1.bcs.bool(),
1479
+ });
1480
+ },
1481
+ enumerable: false,
1482
+ configurable: true
1483
+ });
1484
+ LiquidityPoolInfo.fromFields = function (fields) {
1485
+ return LiquidityPoolInfo.reified().new({
1486
+ lpTokenDecimal: (0, reified_1.decodeFromFields)("u64", fields.lp_token_decimal),
1487
+ totalShareSupply: (0, reified_1.decodeFromFields)("u64", fields.total_share_supply),
1488
+ tvlUsd: (0, reified_1.decodeFromFields)("u64", fields.tvl_usd),
1489
+ isActive: (0, reified_1.decodeFromFields)("bool", fields.is_active),
1490
+ });
1491
+ };
1492
+ LiquidityPoolInfo.fromFieldsWithTypes = function (item) {
1493
+ if (!isLiquidityPoolInfo(item.type)) {
1494
+ throw new Error("not a LiquidityPoolInfo type");
1495
+ }
1496
+ return LiquidityPoolInfo.reified().new({
1497
+ lpTokenDecimal: (0, reified_1.decodeFromFieldsWithTypes)("u64", item.fields.lp_token_decimal),
1498
+ totalShareSupply: (0, reified_1.decodeFromFieldsWithTypes)("u64", item.fields.total_share_supply),
1499
+ tvlUsd: (0, reified_1.decodeFromFieldsWithTypes)("u64", item.fields.tvl_usd),
1500
+ isActive: (0, reified_1.decodeFromFieldsWithTypes)("bool", item.fields.is_active),
1501
+ });
1502
+ };
1503
+ LiquidityPoolInfo.fromBcs = function (data) {
1504
+ return LiquidityPoolInfo.fromFields(LiquidityPoolInfo.bcs.parse(data));
1505
+ };
1506
+ LiquidityPoolInfo.prototype.toJSONField = function () {
1507
+ return {
1508
+ lpTokenDecimal: this.lpTokenDecimal.toString(),
1509
+ totalShareSupply: this.totalShareSupply.toString(),
1510
+ tvlUsd: this.tvlUsd.toString(),
1511
+ isActive: this.isActive,
1512
+ };
1513
+ };
1514
+ LiquidityPoolInfo.prototype.toJSON = function () {
1515
+ return __assign({ $typeName: this.$typeName, $typeArgs: this.$typeArgs }, this.toJSONField());
1516
+ };
1517
+ LiquidityPoolInfo.fromJSONField = function (field) {
1518
+ return LiquidityPoolInfo.reified().new({
1519
+ lpTokenDecimal: (0, reified_1.decodeFromJSONField)("u64", field.lpTokenDecimal),
1520
+ totalShareSupply: (0, reified_1.decodeFromJSONField)("u64", field.totalShareSupply),
1521
+ tvlUsd: (0, reified_1.decodeFromJSONField)("u64", field.tvlUsd),
1522
+ isActive: (0, reified_1.decodeFromJSONField)("bool", field.isActive),
1523
+ });
1524
+ };
1525
+ LiquidityPoolInfo.fromJSON = function (json) {
1526
+ if (json.$typeName !== LiquidityPoolInfo.$typeName) {
1527
+ throw new Error("not a WithTwoGenerics json object");
1528
+ }
1529
+ return LiquidityPoolInfo.fromJSONField(json);
1530
+ };
1531
+ LiquidityPoolInfo.fromSuiParsedData = function (content) {
1532
+ if (content.dataType !== "moveObject") {
1533
+ throw new Error("not an object");
1534
+ }
1535
+ if (!isLiquidityPoolInfo(content.type)) {
1536
+ throw new Error("object at ".concat(content.fields.id, " is not a LiquidityPoolInfo object"));
1537
+ }
1538
+ return LiquidityPoolInfo.fromFieldsWithTypes(content);
1539
+ };
1540
+ LiquidityPoolInfo.fromSuiObjectData = function (data) {
1541
+ if (data.bcs) {
1542
+ if (data.bcs.dataType !== "moveObject" || !isLiquidityPoolInfo(data.bcs.type)) {
1543
+ throw new Error("object at is not a LiquidityPoolInfo object");
1544
+ }
1545
+ return LiquidityPoolInfo.fromBcs((0, utils_1.fromB64)(data.bcs.bcsBytes));
1546
+ }
1547
+ if (data.content) {
1548
+ return LiquidityPoolInfo.fromSuiParsedData(data.content);
1549
+ }
1550
+ throw new Error("Both `bcs` and `content` fields are missing from the data. Include `showBcs` or `showContent` in the request.");
1551
+ };
1552
+ LiquidityPoolInfo.fetch = function (client, id) {
1553
+ return __awaiter(this, void 0, void 0, function () {
1554
+ var res;
1555
+ var _a, _b;
1556
+ return __generator(this, function (_c) {
1557
+ switch (_c.label) {
1558
+ case 0: return [4 /*yield*/, client.getObject({ id: id, options: { showBcs: true } })];
1559
+ case 1:
1560
+ res = _c.sent();
1561
+ if (res.error) {
1562
+ throw new Error("error fetching LiquidityPoolInfo object at id ".concat(id, ": ").concat(res.error.code));
1563
+ }
1564
+ if (((_b = (_a = res.data) === null || _a === void 0 ? void 0 : _a.bcs) === null || _b === void 0 ? void 0 : _b.dataType) !== "moveObject" || !isLiquidityPoolInfo(res.data.bcs.type)) {
1565
+ throw new Error("object at id ".concat(id, " is not a LiquidityPoolInfo object"));
1566
+ }
1567
+ return [2 /*return*/, LiquidityPoolInfo.fromSuiObjectData(res.data)];
1568
+ }
1569
+ });
1570
+ });
1571
+ };
1572
+ LiquidityPoolInfo.$typeName = "".concat(index_1.PKG_V1, "::lp_pool::LiquidityPoolInfo");
1573
+ LiquidityPoolInfo.$numTypeParams = 0;
1574
+ LiquidityPoolInfo.$isPhantom = [];
1575
+ return LiquidityPoolInfo;
1576
+ }());
1577
+ exports.LiquidityPoolInfo = LiquidityPoolInfo;
1578
+ /* ============================== ManagerFlashRemoveLiquidityEvent =============================== */
1579
+ function isManagerFlashRemoveLiquidityEvent(type) {
1580
+ type = (0, util_1.compressSuiType)(type);
1581
+ return type === "".concat(index_1.PKG_V1, "::lp_pool::ManagerFlashRemoveLiquidityEvent");
1582
+ }
1583
+ var ManagerFlashRemoveLiquidityEvent = /** @class */ (function () {
1584
+ function ManagerFlashRemoveLiquidityEvent(typeArgs, fields) {
1585
+ this.__StructClass = true;
1586
+ this.$typeName = ManagerFlashRemoveLiquidityEvent.$typeName;
1587
+ this.$isPhantom = ManagerFlashRemoveLiquidityEvent.$isPhantom;
1588
+ this.$fullTypeName = util_1.composeSuiType.apply(void 0, __spreadArray([ManagerFlashRemoveLiquidityEvent.$typeName], __read(typeArgs), false));
1589
+ this.$typeArgs = typeArgs;
1590
+ this.index = fields.index;
1591
+ this.liquidityToken = fields.liquidityToken;
1592
+ this.price = fields.price;
1593
+ this.priceDecimal = fields.priceDecimal;
1594
+ this.removeAmount = fields.removeAmount;
1595
+ this.removedUsd = fields.removedUsd;
1596
+ this.u64Padding = fields.u64Padding;
1597
+ }
1598
+ ManagerFlashRemoveLiquidityEvent.reified = function () {
1599
+ var _this = this;
1600
+ return {
1601
+ typeName: ManagerFlashRemoveLiquidityEvent.$typeName,
1602
+ fullTypeName: util_1.composeSuiType.apply(void 0, __spreadArray([ManagerFlashRemoveLiquidityEvent.$typeName], [], false)),
1603
+ typeArgs: [],
1604
+ isPhantom: ManagerFlashRemoveLiquidityEvent.$isPhantom,
1605
+ reifiedTypeArgs: [],
1606
+ fromFields: function (fields) { return ManagerFlashRemoveLiquidityEvent.fromFields(fields); },
1607
+ fromFieldsWithTypes: function (item) { return ManagerFlashRemoveLiquidityEvent.fromFieldsWithTypes(item); },
1608
+ fromBcs: function (data) { return ManagerFlashRemoveLiquidityEvent.fromBcs(data); },
1609
+ bcs: ManagerFlashRemoveLiquidityEvent.bcs,
1610
+ fromJSONField: function (field) { return ManagerFlashRemoveLiquidityEvent.fromJSONField(field); },
1611
+ fromJSON: function (json) { return ManagerFlashRemoveLiquidityEvent.fromJSON(json); },
1612
+ fromSuiParsedData: function (content) { return ManagerFlashRemoveLiquidityEvent.fromSuiParsedData(content); },
1613
+ fromSuiObjectData: function (content) { return ManagerFlashRemoveLiquidityEvent.fromSuiObjectData(content); },
1614
+ fetch: function (client, id) { return __awaiter(_this, void 0, void 0, function () { return __generator(this, function (_a) {
1615
+ return [2 /*return*/, ManagerFlashRemoveLiquidityEvent.fetch(client, id)];
1616
+ }); }); },
1617
+ new: function (fields) {
1618
+ return new ManagerFlashRemoveLiquidityEvent([], fields);
1619
+ },
1620
+ kind: "StructClassReified",
1621
+ };
1622
+ };
1623
+ Object.defineProperty(ManagerFlashRemoveLiquidityEvent, "r", {
1624
+ get: function () {
1625
+ return ManagerFlashRemoveLiquidityEvent.reified();
1626
+ },
1627
+ enumerable: false,
1628
+ configurable: true
1629
+ });
1630
+ ManagerFlashRemoveLiquidityEvent.phantom = function () {
1631
+ return (0, reified_1.phantom)(ManagerFlashRemoveLiquidityEvent.reified());
1632
+ };
1633
+ Object.defineProperty(ManagerFlashRemoveLiquidityEvent, "p", {
1634
+ get: function () {
1635
+ return ManagerFlashRemoveLiquidityEvent.phantom();
1636
+ },
1637
+ enumerable: false,
1638
+ configurable: true
1639
+ });
1640
+ Object.defineProperty(ManagerFlashRemoveLiquidityEvent, "bcs", {
1641
+ get: function () {
1642
+ return bcs_1.bcs.struct("ManagerFlashRemoveLiquidityEvent", {
1643
+ index: bcs_1.bcs.u64(),
1644
+ liquidity_token: structs_1.TypeName.bcs,
1645
+ price: bcs_1.bcs.u64(),
1646
+ price_decimal: bcs_1.bcs.u64(),
1647
+ remove_amount: bcs_1.bcs.u64(),
1648
+ removed_usd: bcs_1.bcs.u64(),
1649
+ u64_padding: bcs_1.bcs.vector(bcs_1.bcs.u64()),
1650
+ });
1651
+ },
1652
+ enumerable: false,
1653
+ configurable: true
1654
+ });
1655
+ ManagerFlashRemoveLiquidityEvent.fromFields = function (fields) {
1656
+ return ManagerFlashRemoveLiquidityEvent.reified().new({
1657
+ index: (0, reified_1.decodeFromFields)("u64", fields.index),
1658
+ liquidityToken: (0, reified_1.decodeFromFields)(structs_1.TypeName.reified(), fields.liquidity_token),
1659
+ price: (0, reified_1.decodeFromFields)("u64", fields.price),
1660
+ priceDecimal: (0, reified_1.decodeFromFields)("u64", fields.price_decimal),
1661
+ removeAmount: (0, reified_1.decodeFromFields)("u64", fields.remove_amount),
1662
+ removedUsd: (0, reified_1.decodeFromFields)("u64", fields.removed_usd),
1663
+ u64Padding: (0, reified_1.decodeFromFields)(reified.vector("u64"), fields.u64_padding),
1664
+ });
1665
+ };
1666
+ ManagerFlashRemoveLiquidityEvent.fromFieldsWithTypes = function (item) {
1667
+ if (!isManagerFlashRemoveLiquidityEvent(item.type)) {
1668
+ throw new Error("not a ManagerFlashRemoveLiquidityEvent type");
1669
+ }
1670
+ return ManagerFlashRemoveLiquidityEvent.reified().new({
1671
+ index: (0, reified_1.decodeFromFieldsWithTypes)("u64", item.fields.index),
1672
+ liquidityToken: (0, reified_1.decodeFromFieldsWithTypes)(structs_1.TypeName.reified(), item.fields.liquidity_token),
1673
+ price: (0, reified_1.decodeFromFieldsWithTypes)("u64", item.fields.price),
1674
+ priceDecimal: (0, reified_1.decodeFromFieldsWithTypes)("u64", item.fields.price_decimal),
1675
+ removeAmount: (0, reified_1.decodeFromFieldsWithTypes)("u64", item.fields.remove_amount),
1676
+ removedUsd: (0, reified_1.decodeFromFieldsWithTypes)("u64", item.fields.removed_usd),
1677
+ u64Padding: (0, reified_1.decodeFromFieldsWithTypes)(reified.vector("u64"), item.fields.u64_padding),
1678
+ });
1679
+ };
1680
+ ManagerFlashRemoveLiquidityEvent.fromBcs = function (data) {
1681
+ return ManagerFlashRemoveLiquidityEvent.fromFields(ManagerFlashRemoveLiquidityEvent.bcs.parse(data));
1682
+ };
1683
+ ManagerFlashRemoveLiquidityEvent.prototype.toJSONField = function () {
1684
+ return {
1685
+ index: this.index.toString(),
1686
+ liquidityToken: this.liquidityToken.toJSONField(),
1687
+ price: this.price.toString(),
1688
+ priceDecimal: this.priceDecimal.toString(),
1689
+ removeAmount: this.removeAmount.toString(),
1690
+ removedUsd: this.removedUsd.toString(),
1691
+ u64Padding: (0, reified_1.fieldToJSON)("vector<u64>", this.u64Padding),
1692
+ };
1693
+ };
1694
+ ManagerFlashRemoveLiquidityEvent.prototype.toJSON = function () {
1695
+ return __assign({ $typeName: this.$typeName, $typeArgs: this.$typeArgs }, this.toJSONField());
1696
+ };
1697
+ ManagerFlashRemoveLiquidityEvent.fromJSONField = function (field) {
1698
+ return ManagerFlashRemoveLiquidityEvent.reified().new({
1699
+ index: (0, reified_1.decodeFromJSONField)("u64", field.index),
1700
+ liquidityToken: (0, reified_1.decodeFromJSONField)(structs_1.TypeName.reified(), field.liquidityToken),
1701
+ price: (0, reified_1.decodeFromJSONField)("u64", field.price),
1702
+ priceDecimal: (0, reified_1.decodeFromJSONField)("u64", field.priceDecimal),
1703
+ removeAmount: (0, reified_1.decodeFromJSONField)("u64", field.removeAmount),
1704
+ removedUsd: (0, reified_1.decodeFromJSONField)("u64", field.removedUsd),
1705
+ u64Padding: (0, reified_1.decodeFromJSONField)(reified.vector("u64"), field.u64Padding),
1706
+ });
1707
+ };
1708
+ ManagerFlashRemoveLiquidityEvent.fromJSON = function (json) {
1709
+ if (json.$typeName !== ManagerFlashRemoveLiquidityEvent.$typeName) {
1710
+ throw new Error("not a WithTwoGenerics json object");
1711
+ }
1712
+ return ManagerFlashRemoveLiquidityEvent.fromJSONField(json);
1713
+ };
1714
+ ManagerFlashRemoveLiquidityEvent.fromSuiParsedData = function (content) {
1715
+ if (content.dataType !== "moveObject") {
1716
+ throw new Error("not an object");
1717
+ }
1718
+ if (!isManagerFlashRemoveLiquidityEvent(content.type)) {
1719
+ throw new Error("object at ".concat(content.fields.id, " is not a ManagerFlashRemoveLiquidityEvent object"));
1720
+ }
1721
+ return ManagerFlashRemoveLiquidityEvent.fromFieldsWithTypes(content);
1722
+ };
1723
+ ManagerFlashRemoveLiquidityEvent.fromSuiObjectData = function (data) {
1724
+ if (data.bcs) {
1725
+ if (data.bcs.dataType !== "moveObject" || !isManagerFlashRemoveLiquidityEvent(data.bcs.type)) {
1726
+ throw new Error("object at is not a ManagerFlashRemoveLiquidityEvent object");
1727
+ }
1728
+ return ManagerFlashRemoveLiquidityEvent.fromBcs((0, utils_1.fromB64)(data.bcs.bcsBytes));
1729
+ }
1730
+ if (data.content) {
1731
+ return ManagerFlashRemoveLiquidityEvent.fromSuiParsedData(data.content);
1732
+ }
1733
+ throw new Error("Both `bcs` and `content` fields are missing from the data. Include `showBcs` or `showContent` in the request.");
1734
+ };
1735
+ ManagerFlashRemoveLiquidityEvent.fetch = function (client, id) {
1736
+ return __awaiter(this, void 0, void 0, function () {
1737
+ var res;
1738
+ var _a, _b;
1739
+ return __generator(this, function (_c) {
1740
+ switch (_c.label) {
1741
+ case 0: return [4 /*yield*/, client.getObject({ id: id, options: { showBcs: true } })];
1742
+ case 1:
1743
+ res = _c.sent();
1744
+ if (res.error) {
1745
+ throw new Error("error fetching ManagerFlashRemoveLiquidityEvent object at id ".concat(id, ": ").concat(res.error.code));
1746
+ }
1747
+ if (((_b = (_a = res.data) === null || _a === void 0 ? void 0 : _a.bcs) === null || _b === void 0 ? void 0 : _b.dataType) !== "moveObject" || !isManagerFlashRemoveLiquidityEvent(res.data.bcs.type)) {
1748
+ throw new Error("object at id ".concat(id, " is not a ManagerFlashRemoveLiquidityEvent object"));
1749
+ }
1750
+ return [2 /*return*/, ManagerFlashRemoveLiquidityEvent.fromSuiObjectData(res.data)];
1751
+ }
1752
+ });
1753
+ });
1754
+ };
1755
+ ManagerFlashRemoveLiquidityEvent.$typeName = "".concat(index_1.PKG_V1, "::lp_pool::ManagerFlashRemoveLiquidityEvent");
1756
+ ManagerFlashRemoveLiquidityEvent.$numTypeParams = 0;
1757
+ ManagerFlashRemoveLiquidityEvent.$isPhantom = [];
1758
+ return ManagerFlashRemoveLiquidityEvent;
1759
+ }());
1760
+ exports.ManagerFlashRemoveLiquidityEvent = ManagerFlashRemoveLiquidityEvent;
1761
+ /* ============================== ManagerFlashRepayLiquidityEvent =============================== */
1762
+ function isManagerFlashRepayLiquidityEvent(type) {
1763
+ type = (0, util_1.compressSuiType)(type);
1764
+ return type === "".concat(index_1.PKG_V1, "::lp_pool::ManagerFlashRepayLiquidityEvent");
1765
+ }
1766
+ var ManagerFlashRepayLiquidityEvent = /** @class */ (function () {
1767
+ function ManagerFlashRepayLiquidityEvent(typeArgs, fields) {
1768
+ this.__StructClass = true;
1769
+ this.$typeName = ManagerFlashRepayLiquidityEvent.$typeName;
1770
+ this.$isPhantom = ManagerFlashRepayLiquidityEvent.$isPhantom;
1771
+ this.$fullTypeName = util_1.composeSuiType.apply(void 0, __spreadArray([ManagerFlashRepayLiquidityEvent.$typeName], __read(typeArgs), false));
1772
+ this.$typeArgs = typeArgs;
1773
+ this.index = fields.index;
1774
+ this.liquidityToken = fields.liquidityToken;
1775
+ this.price = fields.price;
1776
+ this.priceDecimal = fields.priceDecimal;
1777
+ this.repaidAmount = fields.repaidAmount;
1778
+ this.repaidUsd = fields.repaidUsd;
1779
+ this.u64Padding = fields.u64Padding;
1780
+ }
1781
+ ManagerFlashRepayLiquidityEvent.reified = function () {
1782
+ var _this = this;
1783
+ return {
1784
+ typeName: ManagerFlashRepayLiquidityEvent.$typeName,
1785
+ fullTypeName: util_1.composeSuiType.apply(void 0, __spreadArray([ManagerFlashRepayLiquidityEvent.$typeName], [], false)),
1786
+ typeArgs: [],
1787
+ isPhantom: ManagerFlashRepayLiquidityEvent.$isPhantom,
1788
+ reifiedTypeArgs: [],
1789
+ fromFields: function (fields) { return ManagerFlashRepayLiquidityEvent.fromFields(fields); },
1790
+ fromFieldsWithTypes: function (item) { return ManagerFlashRepayLiquidityEvent.fromFieldsWithTypes(item); },
1791
+ fromBcs: function (data) { return ManagerFlashRepayLiquidityEvent.fromBcs(data); },
1792
+ bcs: ManagerFlashRepayLiquidityEvent.bcs,
1793
+ fromJSONField: function (field) { return ManagerFlashRepayLiquidityEvent.fromJSONField(field); },
1794
+ fromJSON: function (json) { return ManagerFlashRepayLiquidityEvent.fromJSON(json); },
1795
+ fromSuiParsedData: function (content) { return ManagerFlashRepayLiquidityEvent.fromSuiParsedData(content); },
1796
+ fromSuiObjectData: function (content) { return ManagerFlashRepayLiquidityEvent.fromSuiObjectData(content); },
1797
+ fetch: function (client, id) { return __awaiter(_this, void 0, void 0, function () { return __generator(this, function (_a) {
1798
+ return [2 /*return*/, ManagerFlashRepayLiquidityEvent.fetch(client, id)];
1799
+ }); }); },
1800
+ new: function (fields) {
1801
+ return new ManagerFlashRepayLiquidityEvent([], fields);
1802
+ },
1803
+ kind: "StructClassReified",
1804
+ };
1805
+ };
1806
+ Object.defineProperty(ManagerFlashRepayLiquidityEvent, "r", {
1807
+ get: function () {
1808
+ return ManagerFlashRepayLiquidityEvent.reified();
1809
+ },
1810
+ enumerable: false,
1811
+ configurable: true
1812
+ });
1813
+ ManagerFlashRepayLiquidityEvent.phantom = function () {
1814
+ return (0, reified_1.phantom)(ManagerFlashRepayLiquidityEvent.reified());
1815
+ };
1816
+ Object.defineProperty(ManagerFlashRepayLiquidityEvent, "p", {
1817
+ get: function () {
1818
+ return ManagerFlashRepayLiquidityEvent.phantom();
1819
+ },
1820
+ enumerable: false,
1821
+ configurable: true
1822
+ });
1823
+ Object.defineProperty(ManagerFlashRepayLiquidityEvent, "bcs", {
1824
+ get: function () {
1825
+ return bcs_1.bcs.struct("ManagerFlashRepayLiquidityEvent", {
1826
+ index: bcs_1.bcs.u64(),
1827
+ liquidity_token: structs_1.TypeName.bcs,
1828
+ price: bcs_1.bcs.u64(),
1829
+ price_decimal: bcs_1.bcs.u64(),
1830
+ repaid_amount: bcs_1.bcs.u64(),
1831
+ repaid_usd: bcs_1.bcs.u64(),
1832
+ u64_padding: bcs_1.bcs.vector(bcs_1.bcs.u64()),
1833
+ });
1834
+ },
1835
+ enumerable: false,
1836
+ configurable: true
1837
+ });
1838
+ ManagerFlashRepayLiquidityEvent.fromFields = function (fields) {
1839
+ return ManagerFlashRepayLiquidityEvent.reified().new({
1840
+ index: (0, reified_1.decodeFromFields)("u64", fields.index),
1841
+ liquidityToken: (0, reified_1.decodeFromFields)(structs_1.TypeName.reified(), fields.liquidity_token),
1842
+ price: (0, reified_1.decodeFromFields)("u64", fields.price),
1843
+ priceDecimal: (0, reified_1.decodeFromFields)("u64", fields.price_decimal),
1844
+ repaidAmount: (0, reified_1.decodeFromFields)("u64", fields.repaid_amount),
1845
+ repaidUsd: (0, reified_1.decodeFromFields)("u64", fields.repaid_usd),
1846
+ u64Padding: (0, reified_1.decodeFromFields)(reified.vector("u64"), fields.u64_padding),
1847
+ });
1848
+ };
1849
+ ManagerFlashRepayLiquidityEvent.fromFieldsWithTypes = function (item) {
1850
+ if (!isManagerFlashRepayLiquidityEvent(item.type)) {
1851
+ throw new Error("not a ManagerFlashRepayLiquidityEvent type");
1852
+ }
1853
+ return ManagerFlashRepayLiquidityEvent.reified().new({
1854
+ index: (0, reified_1.decodeFromFieldsWithTypes)("u64", item.fields.index),
1855
+ liquidityToken: (0, reified_1.decodeFromFieldsWithTypes)(structs_1.TypeName.reified(), item.fields.liquidity_token),
1856
+ price: (0, reified_1.decodeFromFieldsWithTypes)("u64", item.fields.price),
1857
+ priceDecimal: (0, reified_1.decodeFromFieldsWithTypes)("u64", item.fields.price_decimal),
1858
+ repaidAmount: (0, reified_1.decodeFromFieldsWithTypes)("u64", item.fields.repaid_amount),
1859
+ repaidUsd: (0, reified_1.decodeFromFieldsWithTypes)("u64", item.fields.repaid_usd),
1860
+ u64Padding: (0, reified_1.decodeFromFieldsWithTypes)(reified.vector("u64"), item.fields.u64_padding),
1861
+ });
1862
+ };
1863
+ ManagerFlashRepayLiquidityEvent.fromBcs = function (data) {
1864
+ return ManagerFlashRepayLiquidityEvent.fromFields(ManagerFlashRepayLiquidityEvent.bcs.parse(data));
1865
+ };
1866
+ ManagerFlashRepayLiquidityEvent.prototype.toJSONField = function () {
1867
+ return {
1868
+ index: this.index.toString(),
1869
+ liquidityToken: this.liquidityToken.toJSONField(),
1870
+ price: this.price.toString(),
1871
+ priceDecimal: this.priceDecimal.toString(),
1872
+ repaidAmount: this.repaidAmount.toString(),
1873
+ repaidUsd: this.repaidUsd.toString(),
1874
+ u64Padding: (0, reified_1.fieldToJSON)("vector<u64>", this.u64Padding),
1875
+ };
1876
+ };
1877
+ ManagerFlashRepayLiquidityEvent.prototype.toJSON = function () {
1878
+ return __assign({ $typeName: this.$typeName, $typeArgs: this.$typeArgs }, this.toJSONField());
1879
+ };
1880
+ ManagerFlashRepayLiquidityEvent.fromJSONField = function (field) {
1881
+ return ManagerFlashRepayLiquidityEvent.reified().new({
1882
+ index: (0, reified_1.decodeFromJSONField)("u64", field.index),
1883
+ liquidityToken: (0, reified_1.decodeFromJSONField)(structs_1.TypeName.reified(), field.liquidityToken),
1884
+ price: (0, reified_1.decodeFromJSONField)("u64", field.price),
1885
+ priceDecimal: (0, reified_1.decodeFromJSONField)("u64", field.priceDecimal),
1886
+ repaidAmount: (0, reified_1.decodeFromJSONField)("u64", field.repaidAmount),
1887
+ repaidUsd: (0, reified_1.decodeFromJSONField)("u64", field.repaidUsd),
1888
+ u64Padding: (0, reified_1.decodeFromJSONField)(reified.vector("u64"), field.u64Padding),
1889
+ });
1890
+ };
1891
+ ManagerFlashRepayLiquidityEvent.fromJSON = function (json) {
1892
+ if (json.$typeName !== ManagerFlashRepayLiquidityEvent.$typeName) {
1893
+ throw new Error("not a WithTwoGenerics json object");
1894
+ }
1895
+ return ManagerFlashRepayLiquidityEvent.fromJSONField(json);
1896
+ };
1897
+ ManagerFlashRepayLiquidityEvent.fromSuiParsedData = function (content) {
1898
+ if (content.dataType !== "moveObject") {
1899
+ throw new Error("not an object");
1900
+ }
1901
+ if (!isManagerFlashRepayLiquidityEvent(content.type)) {
1902
+ throw new Error("object at ".concat(content.fields.id, " is not a ManagerFlashRepayLiquidityEvent object"));
1903
+ }
1904
+ return ManagerFlashRepayLiquidityEvent.fromFieldsWithTypes(content);
1905
+ };
1906
+ ManagerFlashRepayLiquidityEvent.fromSuiObjectData = function (data) {
1907
+ if (data.bcs) {
1908
+ if (data.bcs.dataType !== "moveObject" || !isManagerFlashRepayLiquidityEvent(data.bcs.type)) {
1909
+ throw new Error("object at is not a ManagerFlashRepayLiquidityEvent object");
1910
+ }
1911
+ return ManagerFlashRepayLiquidityEvent.fromBcs((0, utils_1.fromB64)(data.bcs.bcsBytes));
1912
+ }
1913
+ if (data.content) {
1914
+ return ManagerFlashRepayLiquidityEvent.fromSuiParsedData(data.content);
1915
+ }
1916
+ throw new Error("Both `bcs` and `content` fields are missing from the data. Include `showBcs` or `showContent` in the request.");
1917
+ };
1918
+ ManagerFlashRepayLiquidityEvent.fetch = function (client, id) {
1919
+ return __awaiter(this, void 0, void 0, function () {
1920
+ var res;
1921
+ var _a, _b;
1922
+ return __generator(this, function (_c) {
1923
+ switch (_c.label) {
1924
+ case 0: return [4 /*yield*/, client.getObject({ id: id, options: { showBcs: true } })];
1925
+ case 1:
1926
+ res = _c.sent();
1927
+ if (res.error) {
1928
+ throw new Error("error fetching ManagerFlashRepayLiquidityEvent object at id ".concat(id, ": ").concat(res.error.code));
1929
+ }
1930
+ if (((_b = (_a = res.data) === null || _a === void 0 ? void 0 : _a.bcs) === null || _b === void 0 ? void 0 : _b.dataType) !== "moveObject" || !isManagerFlashRepayLiquidityEvent(res.data.bcs.type)) {
1931
+ throw new Error("object at id ".concat(id, " is not a ManagerFlashRepayLiquidityEvent object"));
1932
+ }
1933
+ return [2 /*return*/, ManagerFlashRepayLiquidityEvent.fromSuiObjectData(res.data)];
1934
+ }
1935
+ });
1936
+ });
1937
+ };
1938
+ ManagerFlashRepayLiquidityEvent.$typeName = "".concat(index_1.PKG_V1, "::lp_pool::ManagerFlashRepayLiquidityEvent");
1939
+ ManagerFlashRepayLiquidityEvent.$numTypeParams = 0;
1940
+ ManagerFlashRepayLiquidityEvent.$isPhantom = [];
1941
+ return ManagerFlashRepayLiquidityEvent;
1942
+ }());
1943
+ exports.ManagerFlashRepayLiquidityEvent = ManagerFlashRepayLiquidityEvent;
1944
+ /* ============================== MarginConfig =============================== */
1945
+ function isMarginConfig(type) {
1946
+ type = (0, util_1.compressSuiType)(type);
1947
+ return type === "".concat(index_1.PKG_V1, "::lp_pool::MarginConfig");
1948
+ }
1949
+ var MarginConfig = /** @class */ (function () {
1950
+ function MarginConfig(typeArgs, fields) {
1951
+ this.__StructClass = true;
1952
+ this.$typeName = MarginConfig.$typeName;
1953
+ this.$isPhantom = MarginConfig.$isPhantom;
1954
+ this.$fullTypeName = util_1.composeSuiType.apply(void 0, __spreadArray([MarginConfig.$typeName], __read(typeArgs), false));
1955
+ this.$typeArgs = typeArgs;
1956
+ this.basicBorrowRate0 = fields.basicBorrowRate0;
1957
+ this.basicBorrowRate1 = fields.basicBorrowRate1;
1958
+ this.basicBorrowRate2 = fields.basicBorrowRate2;
1959
+ this.utilizationThresholdBp0 = fields.utilizationThresholdBp0;
1960
+ this.utilizationThresholdBp1 = fields.utilizationThresholdBp1;
1961
+ this.borrowIntervalTsMs = fields.borrowIntervalTsMs;
1962
+ this.maxOrderReserveRatioBp = fields.maxOrderReserveRatioBp;
1963
+ this.u64Padding = fields.u64Padding;
1964
+ }
1965
+ MarginConfig.reified = function () {
1966
+ var _this = this;
1967
+ return {
1968
+ typeName: MarginConfig.$typeName,
1969
+ fullTypeName: util_1.composeSuiType.apply(void 0, __spreadArray([MarginConfig.$typeName], [], false)),
1970
+ typeArgs: [],
1971
+ isPhantom: MarginConfig.$isPhantom,
1972
+ reifiedTypeArgs: [],
1973
+ fromFields: function (fields) { return MarginConfig.fromFields(fields); },
1974
+ fromFieldsWithTypes: function (item) { return MarginConfig.fromFieldsWithTypes(item); },
1975
+ fromBcs: function (data) { return MarginConfig.fromBcs(data); },
1976
+ bcs: MarginConfig.bcs,
1977
+ fromJSONField: function (field) { return MarginConfig.fromJSONField(field); },
1978
+ fromJSON: function (json) { return MarginConfig.fromJSON(json); },
1979
+ fromSuiParsedData: function (content) { return MarginConfig.fromSuiParsedData(content); },
1980
+ fromSuiObjectData: function (content) { return MarginConfig.fromSuiObjectData(content); },
1981
+ fetch: function (client, id) { return __awaiter(_this, void 0, void 0, function () { return __generator(this, function (_a) {
1982
+ return [2 /*return*/, MarginConfig.fetch(client, id)];
1983
+ }); }); },
1984
+ new: function (fields) {
1985
+ return new MarginConfig([], fields);
1986
+ },
1987
+ kind: "StructClassReified",
1988
+ };
1989
+ };
1990
+ Object.defineProperty(MarginConfig, "r", {
1991
+ get: function () {
1992
+ return MarginConfig.reified();
1993
+ },
1994
+ enumerable: false,
1995
+ configurable: true
1996
+ });
1997
+ MarginConfig.phantom = function () {
1998
+ return (0, reified_1.phantom)(MarginConfig.reified());
1999
+ };
2000
+ Object.defineProperty(MarginConfig, "p", {
2001
+ get: function () {
2002
+ return MarginConfig.phantom();
2003
+ },
2004
+ enumerable: false,
2005
+ configurable: true
2006
+ });
2007
+ Object.defineProperty(MarginConfig, "bcs", {
2008
+ get: function () {
2009
+ return bcs_1.bcs.struct("MarginConfig", {
2010
+ basic_borrow_rate_0: bcs_1.bcs.u64(),
2011
+ basic_borrow_rate_1: bcs_1.bcs.u64(),
2012
+ basic_borrow_rate_2: bcs_1.bcs.u64(),
2013
+ utilization_threshold_bp_0: bcs_1.bcs.u64(),
2014
+ utilization_threshold_bp_1: bcs_1.bcs.u64(),
2015
+ borrow_interval_ts_ms: bcs_1.bcs.u64(),
2016
+ max_order_reserve_ratio_bp: bcs_1.bcs.u64(),
2017
+ u64_padding: bcs_1.bcs.vector(bcs_1.bcs.u64()),
2018
+ });
2019
+ },
2020
+ enumerable: false,
2021
+ configurable: true
2022
+ });
2023
+ MarginConfig.fromFields = function (fields) {
2024
+ return MarginConfig.reified().new({
2025
+ basicBorrowRate0: (0, reified_1.decodeFromFields)("u64", fields.basic_borrow_rate_0),
2026
+ basicBorrowRate1: (0, reified_1.decodeFromFields)("u64", fields.basic_borrow_rate_1),
2027
+ basicBorrowRate2: (0, reified_1.decodeFromFields)("u64", fields.basic_borrow_rate_2),
2028
+ utilizationThresholdBp0: (0, reified_1.decodeFromFields)("u64", fields.utilization_threshold_bp_0),
2029
+ utilizationThresholdBp1: (0, reified_1.decodeFromFields)("u64", fields.utilization_threshold_bp_1),
2030
+ borrowIntervalTsMs: (0, reified_1.decodeFromFields)("u64", fields.borrow_interval_ts_ms),
2031
+ maxOrderReserveRatioBp: (0, reified_1.decodeFromFields)("u64", fields.max_order_reserve_ratio_bp),
2032
+ u64Padding: (0, reified_1.decodeFromFields)(reified.vector("u64"), fields.u64_padding),
2033
+ });
2034
+ };
2035
+ MarginConfig.fromFieldsWithTypes = function (item) {
2036
+ if (!isMarginConfig(item.type)) {
2037
+ throw new Error("not a MarginConfig type");
2038
+ }
2039
+ return MarginConfig.reified().new({
2040
+ basicBorrowRate0: (0, reified_1.decodeFromFieldsWithTypes)("u64", item.fields.basic_borrow_rate_0),
2041
+ basicBorrowRate1: (0, reified_1.decodeFromFieldsWithTypes)("u64", item.fields.basic_borrow_rate_1),
2042
+ basicBorrowRate2: (0, reified_1.decodeFromFieldsWithTypes)("u64", item.fields.basic_borrow_rate_2),
2043
+ utilizationThresholdBp0: (0, reified_1.decodeFromFieldsWithTypes)("u64", item.fields.utilization_threshold_bp_0),
2044
+ utilizationThresholdBp1: (0, reified_1.decodeFromFieldsWithTypes)("u64", item.fields.utilization_threshold_bp_1),
2045
+ borrowIntervalTsMs: (0, reified_1.decodeFromFieldsWithTypes)("u64", item.fields.borrow_interval_ts_ms),
2046
+ maxOrderReserveRatioBp: (0, reified_1.decodeFromFieldsWithTypes)("u64", item.fields.max_order_reserve_ratio_bp),
2047
+ u64Padding: (0, reified_1.decodeFromFieldsWithTypes)(reified.vector("u64"), item.fields.u64_padding),
2048
+ });
2049
+ };
2050
+ MarginConfig.fromBcs = function (data) {
2051
+ return MarginConfig.fromFields(MarginConfig.bcs.parse(data));
2052
+ };
2053
+ MarginConfig.prototype.toJSONField = function () {
2054
+ return {
2055
+ basicBorrowRate0: this.basicBorrowRate0.toString(),
2056
+ basicBorrowRate1: this.basicBorrowRate1.toString(),
2057
+ basicBorrowRate2: this.basicBorrowRate2.toString(),
2058
+ utilizationThresholdBp0: this.utilizationThresholdBp0.toString(),
2059
+ utilizationThresholdBp1: this.utilizationThresholdBp1.toString(),
2060
+ borrowIntervalTsMs: this.borrowIntervalTsMs.toString(),
2061
+ maxOrderReserveRatioBp: this.maxOrderReserveRatioBp.toString(),
2062
+ u64Padding: (0, reified_1.fieldToJSON)("vector<u64>", this.u64Padding),
2063
+ };
2064
+ };
2065
+ MarginConfig.prototype.toJSON = function () {
2066
+ return __assign({ $typeName: this.$typeName, $typeArgs: this.$typeArgs }, this.toJSONField());
2067
+ };
2068
+ MarginConfig.fromJSONField = function (field) {
2069
+ return MarginConfig.reified().new({
2070
+ basicBorrowRate0: (0, reified_1.decodeFromJSONField)("u64", field.basicBorrowRate0),
2071
+ basicBorrowRate1: (0, reified_1.decodeFromJSONField)("u64", field.basicBorrowRate1),
2072
+ basicBorrowRate2: (0, reified_1.decodeFromJSONField)("u64", field.basicBorrowRate2),
2073
+ utilizationThresholdBp0: (0, reified_1.decodeFromJSONField)("u64", field.utilizationThresholdBp0),
2074
+ utilizationThresholdBp1: (0, reified_1.decodeFromJSONField)("u64", field.utilizationThresholdBp1),
2075
+ borrowIntervalTsMs: (0, reified_1.decodeFromJSONField)("u64", field.borrowIntervalTsMs),
2076
+ maxOrderReserveRatioBp: (0, reified_1.decodeFromJSONField)("u64", field.maxOrderReserveRatioBp),
2077
+ u64Padding: (0, reified_1.decodeFromJSONField)(reified.vector("u64"), field.u64Padding),
2078
+ });
2079
+ };
2080
+ MarginConfig.fromJSON = function (json) {
2081
+ if (json.$typeName !== MarginConfig.$typeName) {
2082
+ throw new Error("not a WithTwoGenerics json object");
2083
+ }
2084
+ return MarginConfig.fromJSONField(json);
2085
+ };
2086
+ MarginConfig.fromSuiParsedData = function (content) {
2087
+ if (content.dataType !== "moveObject") {
2088
+ throw new Error("not an object");
2089
+ }
2090
+ if (!isMarginConfig(content.type)) {
2091
+ throw new Error("object at ".concat(content.fields.id, " is not a MarginConfig object"));
2092
+ }
2093
+ return MarginConfig.fromFieldsWithTypes(content);
2094
+ };
2095
+ MarginConfig.fromSuiObjectData = function (data) {
2096
+ if (data.bcs) {
2097
+ if (data.bcs.dataType !== "moveObject" || !isMarginConfig(data.bcs.type)) {
2098
+ throw new Error("object at is not a MarginConfig object");
2099
+ }
2100
+ return MarginConfig.fromBcs((0, utils_1.fromB64)(data.bcs.bcsBytes));
2101
+ }
2102
+ if (data.content) {
2103
+ return MarginConfig.fromSuiParsedData(data.content);
2104
+ }
2105
+ throw new Error("Both `bcs` and `content` fields are missing from the data. Include `showBcs` or `showContent` in the request.");
2106
+ };
2107
+ MarginConfig.fetch = function (client, id) {
2108
+ return __awaiter(this, void 0, void 0, function () {
2109
+ var res;
2110
+ var _a, _b;
2111
+ return __generator(this, function (_c) {
2112
+ switch (_c.label) {
2113
+ case 0: return [4 /*yield*/, client.getObject({ id: id, options: { showBcs: true } })];
2114
+ case 1:
2115
+ res = _c.sent();
2116
+ if (res.error) {
2117
+ throw new Error("error fetching MarginConfig object at id ".concat(id, ": ").concat(res.error.code));
2118
+ }
2119
+ if (((_b = (_a = res.data) === null || _a === void 0 ? void 0 : _a.bcs) === null || _b === void 0 ? void 0 : _b.dataType) !== "moveObject" || !isMarginConfig(res.data.bcs.type)) {
2120
+ throw new Error("object at id ".concat(id, " is not a MarginConfig object"));
2121
+ }
2122
+ return [2 /*return*/, MarginConfig.fromSuiObjectData(res.data)];
2123
+ }
2124
+ });
2125
+ });
2126
+ };
2127
+ MarginConfig.$typeName = "".concat(index_1.PKG_V1, "::lp_pool::MarginConfig");
2128
+ MarginConfig.$numTypeParams = 0;
2129
+ MarginConfig.$isPhantom = [];
2130
+ return MarginConfig;
2131
+ }());
2132
+ exports.MarginConfig = MarginConfig;
2133
+ /* ============================== MintLpEvent =============================== */
2134
+ function isMintLpEvent(type) {
2135
+ type = (0, util_1.compressSuiType)(type);
2136
+ return type === "".concat(index_1.PKG_V1, "::lp_pool::MintLpEvent");
2137
+ }
2138
+ var MintLpEvent = /** @class */ (function () {
2139
+ function MintLpEvent(typeArgs, fields) {
2140
+ this.__StructClass = true;
2141
+ this.$typeName = MintLpEvent.$typeName;
2142
+ this.$isPhantom = MintLpEvent.$isPhantom;
2143
+ this.$fullTypeName = util_1.composeSuiType.apply(void 0, __spreadArray([MintLpEvent.$typeName], __read(typeArgs), false));
2144
+ this.$typeArgs = typeArgs;
2145
+ this.sender = fields.sender;
2146
+ this.index = fields.index;
2147
+ this.liquidityTokenType = fields.liquidityTokenType;
2148
+ this.depositAmount = fields.depositAmount;
2149
+ this.depositAmountUsd = fields.depositAmountUsd;
2150
+ this.mintFeeUsd = fields.mintFeeUsd;
2151
+ this.lpTokenType = fields.lpTokenType;
2152
+ this.mintedLpAmount = fields.mintedLpAmount;
2153
+ this.u64Padding = fields.u64Padding;
2154
+ }
2155
+ MintLpEvent.reified = function () {
2156
+ var _this = this;
2157
+ return {
2158
+ typeName: MintLpEvent.$typeName,
2159
+ fullTypeName: util_1.composeSuiType.apply(void 0, __spreadArray([MintLpEvent.$typeName], [], false)),
2160
+ typeArgs: [],
2161
+ isPhantom: MintLpEvent.$isPhantom,
2162
+ reifiedTypeArgs: [],
2163
+ fromFields: function (fields) { return MintLpEvent.fromFields(fields); },
2164
+ fromFieldsWithTypes: function (item) { return MintLpEvent.fromFieldsWithTypes(item); },
2165
+ fromBcs: function (data) { return MintLpEvent.fromBcs(data); },
2166
+ bcs: MintLpEvent.bcs,
2167
+ fromJSONField: function (field) { return MintLpEvent.fromJSONField(field); },
2168
+ fromJSON: function (json) { return MintLpEvent.fromJSON(json); },
2169
+ fromSuiParsedData: function (content) { return MintLpEvent.fromSuiParsedData(content); },
2170
+ fromSuiObjectData: function (content) { return MintLpEvent.fromSuiObjectData(content); },
2171
+ fetch: function (client, id) { return __awaiter(_this, void 0, void 0, function () { return __generator(this, function (_a) {
2172
+ return [2 /*return*/, MintLpEvent.fetch(client, id)];
2173
+ }); }); },
2174
+ new: function (fields) {
2175
+ return new MintLpEvent([], fields);
2176
+ },
2177
+ kind: "StructClassReified",
2178
+ };
2179
+ };
2180
+ Object.defineProperty(MintLpEvent, "r", {
2181
+ get: function () {
2182
+ return MintLpEvent.reified();
2183
+ },
2184
+ enumerable: false,
2185
+ configurable: true
2186
+ });
2187
+ MintLpEvent.phantom = function () {
2188
+ return (0, reified_1.phantom)(MintLpEvent.reified());
2189
+ };
2190
+ Object.defineProperty(MintLpEvent, "p", {
2191
+ get: function () {
2192
+ return MintLpEvent.phantom();
2193
+ },
2194
+ enumerable: false,
2195
+ configurable: true
2196
+ });
2197
+ Object.defineProperty(MintLpEvent, "bcs", {
2198
+ get: function () {
2199
+ return bcs_1.bcs.struct("MintLpEvent", {
2200
+ sender: bcs_1.bcs.bytes(32).transform({ input: function (val) { return (0, utils_1.fromHEX)(val); }, output: function (val) { return (0, utils_1.toHEX)(val); } }),
2201
+ index: bcs_1.bcs.u64(),
2202
+ liquidity_token_type: structs_1.TypeName.bcs,
2203
+ deposit_amount: bcs_1.bcs.u64(),
2204
+ deposit_amount_usd: bcs_1.bcs.u64(),
2205
+ mint_fee_usd: bcs_1.bcs.u64(),
2206
+ lp_token_type: structs_1.TypeName.bcs,
2207
+ minted_lp_amount: bcs_1.bcs.u64(),
2208
+ u64_padding: bcs_1.bcs.vector(bcs_1.bcs.u64()),
2209
+ });
2210
+ },
2211
+ enumerable: false,
2212
+ configurable: true
2213
+ });
2214
+ MintLpEvent.fromFields = function (fields) {
2215
+ return MintLpEvent.reified().new({
2216
+ sender: (0, reified_1.decodeFromFields)("address", fields.sender),
2217
+ index: (0, reified_1.decodeFromFields)("u64", fields.index),
2218
+ liquidityTokenType: (0, reified_1.decodeFromFields)(structs_1.TypeName.reified(), fields.liquidity_token_type),
2219
+ depositAmount: (0, reified_1.decodeFromFields)("u64", fields.deposit_amount),
2220
+ depositAmountUsd: (0, reified_1.decodeFromFields)("u64", fields.deposit_amount_usd),
2221
+ mintFeeUsd: (0, reified_1.decodeFromFields)("u64", fields.mint_fee_usd),
2222
+ lpTokenType: (0, reified_1.decodeFromFields)(structs_1.TypeName.reified(), fields.lp_token_type),
2223
+ mintedLpAmount: (0, reified_1.decodeFromFields)("u64", fields.minted_lp_amount),
2224
+ u64Padding: (0, reified_1.decodeFromFields)(reified.vector("u64"), fields.u64_padding),
2225
+ });
2226
+ };
2227
+ MintLpEvent.fromFieldsWithTypes = function (item) {
2228
+ if (!isMintLpEvent(item.type)) {
2229
+ throw new Error("not a MintLpEvent type");
2230
+ }
2231
+ return MintLpEvent.reified().new({
2232
+ sender: (0, reified_1.decodeFromFieldsWithTypes)("address", item.fields.sender),
2233
+ index: (0, reified_1.decodeFromFieldsWithTypes)("u64", item.fields.index),
2234
+ liquidityTokenType: (0, reified_1.decodeFromFieldsWithTypes)(structs_1.TypeName.reified(), item.fields.liquidity_token_type),
2235
+ depositAmount: (0, reified_1.decodeFromFieldsWithTypes)("u64", item.fields.deposit_amount),
2236
+ depositAmountUsd: (0, reified_1.decodeFromFieldsWithTypes)("u64", item.fields.deposit_amount_usd),
2237
+ mintFeeUsd: (0, reified_1.decodeFromFieldsWithTypes)("u64", item.fields.mint_fee_usd),
2238
+ lpTokenType: (0, reified_1.decodeFromFieldsWithTypes)(structs_1.TypeName.reified(), item.fields.lp_token_type),
2239
+ mintedLpAmount: (0, reified_1.decodeFromFieldsWithTypes)("u64", item.fields.minted_lp_amount),
2240
+ u64Padding: (0, reified_1.decodeFromFieldsWithTypes)(reified.vector("u64"), item.fields.u64_padding),
2241
+ });
2242
+ };
2243
+ MintLpEvent.fromBcs = function (data) {
2244
+ return MintLpEvent.fromFields(MintLpEvent.bcs.parse(data));
2245
+ };
2246
+ MintLpEvent.prototype.toJSONField = function () {
2247
+ return {
2248
+ sender: this.sender,
2249
+ index: this.index.toString(),
2250
+ liquidityTokenType: this.liquidityTokenType.toJSONField(),
2251
+ depositAmount: this.depositAmount.toString(),
2252
+ depositAmountUsd: this.depositAmountUsd.toString(),
2253
+ mintFeeUsd: this.mintFeeUsd.toString(),
2254
+ lpTokenType: this.lpTokenType.toJSONField(),
2255
+ mintedLpAmount: this.mintedLpAmount.toString(),
2256
+ u64Padding: (0, reified_1.fieldToJSON)("vector<u64>", this.u64Padding),
2257
+ };
2258
+ };
2259
+ MintLpEvent.prototype.toJSON = function () {
2260
+ return __assign({ $typeName: this.$typeName, $typeArgs: this.$typeArgs }, this.toJSONField());
2261
+ };
2262
+ MintLpEvent.fromJSONField = function (field) {
2263
+ return MintLpEvent.reified().new({
2264
+ sender: (0, reified_1.decodeFromJSONField)("address", field.sender),
2265
+ index: (0, reified_1.decodeFromJSONField)("u64", field.index),
2266
+ liquidityTokenType: (0, reified_1.decodeFromJSONField)(structs_1.TypeName.reified(), field.liquidityTokenType),
2267
+ depositAmount: (0, reified_1.decodeFromJSONField)("u64", field.depositAmount),
2268
+ depositAmountUsd: (0, reified_1.decodeFromJSONField)("u64", field.depositAmountUsd),
2269
+ mintFeeUsd: (0, reified_1.decodeFromJSONField)("u64", field.mintFeeUsd),
2270
+ lpTokenType: (0, reified_1.decodeFromJSONField)(structs_1.TypeName.reified(), field.lpTokenType),
2271
+ mintedLpAmount: (0, reified_1.decodeFromJSONField)("u64", field.mintedLpAmount),
2272
+ u64Padding: (0, reified_1.decodeFromJSONField)(reified.vector("u64"), field.u64Padding),
2273
+ });
2274
+ };
2275
+ MintLpEvent.fromJSON = function (json) {
2276
+ if (json.$typeName !== MintLpEvent.$typeName) {
2277
+ throw new Error("not a WithTwoGenerics json object");
2278
+ }
2279
+ return MintLpEvent.fromJSONField(json);
2280
+ };
2281
+ MintLpEvent.fromSuiParsedData = function (content) {
2282
+ if (content.dataType !== "moveObject") {
2283
+ throw new Error("not an object");
2284
+ }
2285
+ if (!isMintLpEvent(content.type)) {
2286
+ throw new Error("object at ".concat(content.fields.id, " is not a MintLpEvent object"));
2287
+ }
2288
+ return MintLpEvent.fromFieldsWithTypes(content);
2289
+ };
2290
+ MintLpEvent.fromSuiObjectData = function (data) {
2291
+ if (data.bcs) {
2292
+ if (data.bcs.dataType !== "moveObject" || !isMintLpEvent(data.bcs.type)) {
2293
+ throw new Error("object at is not a MintLpEvent object");
2294
+ }
2295
+ return MintLpEvent.fromBcs((0, utils_1.fromB64)(data.bcs.bcsBytes));
2296
+ }
2297
+ if (data.content) {
2298
+ return MintLpEvent.fromSuiParsedData(data.content);
2299
+ }
2300
+ throw new Error("Both `bcs` and `content` fields are missing from the data. Include `showBcs` or `showContent` in the request.");
2301
+ };
2302
+ MintLpEvent.fetch = function (client, id) {
2303
+ return __awaiter(this, void 0, void 0, function () {
2304
+ var res;
2305
+ var _a, _b;
2306
+ return __generator(this, function (_c) {
2307
+ switch (_c.label) {
2308
+ case 0: return [4 /*yield*/, client.getObject({ id: id, options: { showBcs: true } })];
2309
+ case 1:
2310
+ res = _c.sent();
2311
+ if (res.error) {
2312
+ throw new Error("error fetching MintLpEvent object at id ".concat(id, ": ").concat(res.error.code));
2313
+ }
2314
+ if (((_b = (_a = res.data) === null || _a === void 0 ? void 0 : _a.bcs) === null || _b === void 0 ? void 0 : _b.dataType) !== "moveObject" || !isMintLpEvent(res.data.bcs.type)) {
2315
+ throw new Error("object at id ".concat(id, " is not a MintLpEvent object"));
2316
+ }
2317
+ return [2 /*return*/, MintLpEvent.fromSuiObjectData(res.data)];
2318
+ }
2319
+ });
2320
+ });
2321
+ };
2322
+ MintLpEvent.$typeName = "".concat(index_1.PKG_V1, "::lp_pool::MintLpEvent");
2323
+ MintLpEvent.$numTypeParams = 0;
2324
+ MintLpEvent.$isPhantom = [];
2325
+ return MintLpEvent;
2326
+ }());
2327
+ exports.MintLpEvent = MintLpEvent;
2328
+ /* ============================== NewLiquidityPoolEvent =============================== */
2329
+ function isNewLiquidityPoolEvent(type) {
2330
+ type = (0, util_1.compressSuiType)(type);
2331
+ return type === "".concat(index_1.PKG_V1, "::lp_pool::NewLiquidityPoolEvent");
2332
+ }
2333
+ var NewLiquidityPoolEvent = /** @class */ (function () {
2334
+ function NewLiquidityPoolEvent(typeArgs, fields) {
2335
+ this.__StructClass = true;
2336
+ this.$typeName = NewLiquidityPoolEvent.$typeName;
2337
+ this.$isPhantom = NewLiquidityPoolEvent.$isPhantom;
2338
+ this.$fullTypeName = util_1.composeSuiType.apply(void 0, __spreadArray([NewLiquidityPoolEvent.$typeName], __read(typeArgs), false));
2339
+ this.$typeArgs = typeArgs;
2340
+ this.sender = fields.sender;
2341
+ this.index = fields.index;
2342
+ this.lpTokenType = fields.lpTokenType;
2343
+ this.lpTokenDecimal = fields.lpTokenDecimal;
2344
+ this.u64Padding = fields.u64Padding;
2345
+ }
2346
+ NewLiquidityPoolEvent.reified = function () {
2347
+ var _this = this;
2348
+ return {
2349
+ typeName: NewLiquidityPoolEvent.$typeName,
2350
+ fullTypeName: util_1.composeSuiType.apply(void 0, __spreadArray([NewLiquidityPoolEvent.$typeName], [], false)),
2351
+ typeArgs: [],
2352
+ isPhantom: NewLiquidityPoolEvent.$isPhantom,
2353
+ reifiedTypeArgs: [],
2354
+ fromFields: function (fields) { return NewLiquidityPoolEvent.fromFields(fields); },
2355
+ fromFieldsWithTypes: function (item) { return NewLiquidityPoolEvent.fromFieldsWithTypes(item); },
2356
+ fromBcs: function (data) { return NewLiquidityPoolEvent.fromBcs(data); },
2357
+ bcs: NewLiquidityPoolEvent.bcs,
2358
+ fromJSONField: function (field) { return NewLiquidityPoolEvent.fromJSONField(field); },
2359
+ fromJSON: function (json) { return NewLiquidityPoolEvent.fromJSON(json); },
2360
+ fromSuiParsedData: function (content) { return NewLiquidityPoolEvent.fromSuiParsedData(content); },
2361
+ fromSuiObjectData: function (content) { return NewLiquidityPoolEvent.fromSuiObjectData(content); },
2362
+ fetch: function (client, id) { return __awaiter(_this, void 0, void 0, function () { return __generator(this, function (_a) {
2363
+ return [2 /*return*/, NewLiquidityPoolEvent.fetch(client, id)];
2364
+ }); }); },
2365
+ new: function (fields) {
2366
+ return new NewLiquidityPoolEvent([], fields);
2367
+ },
2368
+ kind: "StructClassReified",
2369
+ };
2370
+ };
2371
+ Object.defineProperty(NewLiquidityPoolEvent, "r", {
2372
+ get: function () {
2373
+ return NewLiquidityPoolEvent.reified();
2374
+ },
2375
+ enumerable: false,
2376
+ configurable: true
2377
+ });
2378
+ NewLiquidityPoolEvent.phantom = function () {
2379
+ return (0, reified_1.phantom)(NewLiquidityPoolEvent.reified());
2380
+ };
2381
+ Object.defineProperty(NewLiquidityPoolEvent, "p", {
2382
+ get: function () {
2383
+ return NewLiquidityPoolEvent.phantom();
2384
+ },
2385
+ enumerable: false,
2386
+ configurable: true
2387
+ });
2388
+ Object.defineProperty(NewLiquidityPoolEvent, "bcs", {
2389
+ get: function () {
2390
+ return bcs_1.bcs.struct("NewLiquidityPoolEvent", {
2391
+ sender: bcs_1.bcs.bytes(32).transform({ input: function (val) { return (0, utils_1.fromHEX)(val); }, output: function (val) { return (0, utils_1.toHEX)(val); } }),
2392
+ index: bcs_1.bcs.u64(),
2393
+ lp_token_type: structs_1.TypeName.bcs,
2394
+ lp_token_decimal: bcs_1.bcs.u64(),
2395
+ u64_padding: bcs_1.bcs.vector(bcs_1.bcs.u64()),
2396
+ });
2397
+ },
2398
+ enumerable: false,
2399
+ configurable: true
2400
+ });
2401
+ NewLiquidityPoolEvent.fromFields = function (fields) {
2402
+ return NewLiquidityPoolEvent.reified().new({
2403
+ sender: (0, reified_1.decodeFromFields)("address", fields.sender),
2404
+ index: (0, reified_1.decodeFromFields)("u64", fields.index),
2405
+ lpTokenType: (0, reified_1.decodeFromFields)(structs_1.TypeName.reified(), fields.lp_token_type),
2406
+ lpTokenDecimal: (0, reified_1.decodeFromFields)("u64", fields.lp_token_decimal),
2407
+ u64Padding: (0, reified_1.decodeFromFields)(reified.vector("u64"), fields.u64_padding),
2408
+ });
2409
+ };
2410
+ NewLiquidityPoolEvent.fromFieldsWithTypes = function (item) {
2411
+ if (!isNewLiquidityPoolEvent(item.type)) {
2412
+ throw new Error("not a NewLiquidityPoolEvent type");
2413
+ }
2414
+ return NewLiquidityPoolEvent.reified().new({
2415
+ sender: (0, reified_1.decodeFromFieldsWithTypes)("address", item.fields.sender),
2416
+ index: (0, reified_1.decodeFromFieldsWithTypes)("u64", item.fields.index),
2417
+ lpTokenType: (0, reified_1.decodeFromFieldsWithTypes)(structs_1.TypeName.reified(), item.fields.lp_token_type),
2418
+ lpTokenDecimal: (0, reified_1.decodeFromFieldsWithTypes)("u64", item.fields.lp_token_decimal),
2419
+ u64Padding: (0, reified_1.decodeFromFieldsWithTypes)(reified.vector("u64"), item.fields.u64_padding),
2420
+ });
2421
+ };
2422
+ NewLiquidityPoolEvent.fromBcs = function (data) {
2423
+ return NewLiquidityPoolEvent.fromFields(NewLiquidityPoolEvent.bcs.parse(data));
2424
+ };
2425
+ NewLiquidityPoolEvent.prototype.toJSONField = function () {
2426
+ return {
2427
+ sender: this.sender,
2428
+ index: this.index.toString(),
2429
+ lpTokenType: this.lpTokenType.toJSONField(),
2430
+ lpTokenDecimal: this.lpTokenDecimal.toString(),
2431
+ u64Padding: (0, reified_1.fieldToJSON)("vector<u64>", this.u64Padding),
2432
+ };
2433
+ };
2434
+ NewLiquidityPoolEvent.prototype.toJSON = function () {
2435
+ return __assign({ $typeName: this.$typeName, $typeArgs: this.$typeArgs }, this.toJSONField());
2436
+ };
2437
+ NewLiquidityPoolEvent.fromJSONField = function (field) {
2438
+ return NewLiquidityPoolEvent.reified().new({
2439
+ sender: (0, reified_1.decodeFromJSONField)("address", field.sender),
2440
+ index: (0, reified_1.decodeFromJSONField)("u64", field.index),
2441
+ lpTokenType: (0, reified_1.decodeFromJSONField)(structs_1.TypeName.reified(), field.lpTokenType),
2442
+ lpTokenDecimal: (0, reified_1.decodeFromJSONField)("u64", field.lpTokenDecimal),
2443
+ u64Padding: (0, reified_1.decodeFromJSONField)(reified.vector("u64"), field.u64Padding),
2444
+ });
2445
+ };
2446
+ NewLiquidityPoolEvent.fromJSON = function (json) {
2447
+ if (json.$typeName !== NewLiquidityPoolEvent.$typeName) {
2448
+ throw new Error("not a WithTwoGenerics json object");
2449
+ }
2450
+ return NewLiquidityPoolEvent.fromJSONField(json);
2451
+ };
2452
+ NewLiquidityPoolEvent.fromSuiParsedData = function (content) {
2453
+ if (content.dataType !== "moveObject") {
2454
+ throw new Error("not an object");
2455
+ }
2456
+ if (!isNewLiquidityPoolEvent(content.type)) {
2457
+ throw new Error("object at ".concat(content.fields.id, " is not a NewLiquidityPoolEvent object"));
2458
+ }
2459
+ return NewLiquidityPoolEvent.fromFieldsWithTypes(content);
2460
+ };
2461
+ NewLiquidityPoolEvent.fromSuiObjectData = function (data) {
2462
+ if (data.bcs) {
2463
+ if (data.bcs.dataType !== "moveObject" || !isNewLiquidityPoolEvent(data.bcs.type)) {
2464
+ throw new Error("object at is not a NewLiquidityPoolEvent object");
2465
+ }
2466
+ return NewLiquidityPoolEvent.fromBcs((0, utils_1.fromB64)(data.bcs.bcsBytes));
2467
+ }
2468
+ if (data.content) {
2469
+ return NewLiquidityPoolEvent.fromSuiParsedData(data.content);
2470
+ }
2471
+ throw new Error("Both `bcs` and `content` fields are missing from the data. Include `showBcs` or `showContent` in the request.");
2472
+ };
2473
+ NewLiquidityPoolEvent.fetch = function (client, id) {
2474
+ return __awaiter(this, void 0, void 0, function () {
2475
+ var res;
2476
+ var _a, _b;
2477
+ return __generator(this, function (_c) {
2478
+ switch (_c.label) {
2479
+ case 0: return [4 /*yield*/, client.getObject({ id: id, options: { showBcs: true } })];
2480
+ case 1:
2481
+ res = _c.sent();
2482
+ if (res.error) {
2483
+ throw new Error("error fetching NewLiquidityPoolEvent object at id ".concat(id, ": ").concat(res.error.code));
2484
+ }
2485
+ if (((_b = (_a = res.data) === null || _a === void 0 ? void 0 : _a.bcs) === null || _b === void 0 ? void 0 : _b.dataType) !== "moveObject" || !isNewLiquidityPoolEvent(res.data.bcs.type)) {
2486
+ throw new Error("object at id ".concat(id, " is not a NewLiquidityPoolEvent object"));
2487
+ }
2488
+ return [2 /*return*/, NewLiquidityPoolEvent.fromSuiObjectData(res.data)];
2489
+ }
2490
+ });
2491
+ });
2492
+ };
2493
+ NewLiquidityPoolEvent.$typeName = "".concat(index_1.PKG_V1, "::lp_pool::NewLiquidityPoolEvent");
2494
+ NewLiquidityPoolEvent.$numTypeParams = 0;
2495
+ NewLiquidityPoolEvent.$isPhantom = [];
2496
+ return NewLiquidityPoolEvent;
2497
+ }());
2498
+ exports.NewLiquidityPoolEvent = NewLiquidityPoolEvent;
2499
+ /* ============================== RemoveLiquidityTokenProcess =============================== */
2500
+ function isRemoveLiquidityTokenProcess(type) {
2501
+ type = (0, util_1.compressSuiType)(type);
2502
+ return type === "".concat(index_1.PKG_V1, "::lp_pool::RemoveLiquidityTokenProcess");
2503
+ }
2504
+ var RemoveLiquidityTokenProcess = /** @class */ (function () {
2505
+ function RemoveLiquidityTokenProcess(typeArgs, fields) {
2506
+ this.__StructClass = true;
2507
+ this.$typeName = RemoveLiquidityTokenProcess.$typeName;
2508
+ this.$isPhantom = RemoveLiquidityTokenProcess.$isPhantom;
2509
+ this.$fullTypeName = util_1.composeSuiType.apply(void 0, __spreadArray([RemoveLiquidityTokenProcess.$typeName], __read(typeArgs), false));
2510
+ this.$typeArgs = typeArgs;
2511
+ this.liquidityToken = fields.liquidityToken;
2512
+ this.removedPositionsBaseToken = fields.removedPositionsBaseToken;
2513
+ this.removedOrdersBaseToken = fields.removedOrdersBaseToken;
2514
+ this.removedTokenOracleId = fields.removedTokenOracleId;
2515
+ this.removedUsd = fields.removedUsd;
2516
+ this.repaidUsd = fields.repaidUsd;
2517
+ this.status = fields.status;
2518
+ }
2519
+ RemoveLiquidityTokenProcess.reified = function () {
2520
+ var _this = this;
2521
+ return {
2522
+ typeName: RemoveLiquidityTokenProcess.$typeName,
2523
+ fullTypeName: util_1.composeSuiType.apply(void 0, __spreadArray([RemoveLiquidityTokenProcess.$typeName], [], false)),
2524
+ typeArgs: [],
2525
+ isPhantom: RemoveLiquidityTokenProcess.$isPhantom,
2526
+ reifiedTypeArgs: [],
2527
+ fromFields: function (fields) { return RemoveLiquidityTokenProcess.fromFields(fields); },
2528
+ fromFieldsWithTypes: function (item) { return RemoveLiquidityTokenProcess.fromFieldsWithTypes(item); },
2529
+ fromBcs: function (data) { return RemoveLiquidityTokenProcess.fromBcs(data); },
2530
+ bcs: RemoveLiquidityTokenProcess.bcs,
2531
+ fromJSONField: function (field) { return RemoveLiquidityTokenProcess.fromJSONField(field); },
2532
+ fromJSON: function (json) { return RemoveLiquidityTokenProcess.fromJSON(json); },
2533
+ fromSuiParsedData: function (content) { return RemoveLiquidityTokenProcess.fromSuiParsedData(content); },
2534
+ fromSuiObjectData: function (content) { return RemoveLiquidityTokenProcess.fromSuiObjectData(content); },
2535
+ fetch: function (client, id) { return __awaiter(_this, void 0, void 0, function () { return __generator(this, function (_a) {
2536
+ return [2 /*return*/, RemoveLiquidityTokenProcess.fetch(client, id)];
2537
+ }); }); },
2538
+ new: function (fields) {
2539
+ return new RemoveLiquidityTokenProcess([], fields);
2540
+ },
2541
+ kind: "StructClassReified",
2542
+ };
2543
+ };
2544
+ Object.defineProperty(RemoveLiquidityTokenProcess, "r", {
2545
+ get: function () {
2546
+ return RemoveLiquidityTokenProcess.reified();
2547
+ },
2548
+ enumerable: false,
2549
+ configurable: true
2550
+ });
2551
+ RemoveLiquidityTokenProcess.phantom = function () {
2552
+ return (0, reified_1.phantom)(RemoveLiquidityTokenProcess.reified());
2553
+ };
2554
+ Object.defineProperty(RemoveLiquidityTokenProcess, "p", {
2555
+ get: function () {
2556
+ return RemoveLiquidityTokenProcess.phantom();
2557
+ },
2558
+ enumerable: false,
2559
+ configurable: true
2560
+ });
2561
+ Object.defineProperty(RemoveLiquidityTokenProcess, "bcs", {
2562
+ get: function () {
2563
+ return bcs_1.bcs.struct("RemoveLiquidityTokenProcess", {
2564
+ liquidity_token: structs_1.TypeName.bcs,
2565
+ removed_positions_base_token: bcs_1.bcs.vector(structs_1.TypeName.bcs),
2566
+ removed_orders_base_token: bcs_1.bcs.vector(structs_1.TypeName.bcs),
2567
+ removed_token_oracle_id: bcs_1.bcs
2568
+ .bytes(32)
2569
+ .transform({ input: function (val) { return (0, utils_1.fromHEX)(val); }, output: function (val) { return (0, utils_1.toHEX)(val); } }),
2570
+ removed_usd: bcs_1.bcs.u64(),
2571
+ repaid_usd: bcs_1.bcs.u64(),
2572
+ status: bcs_1.bcs.u64(),
2573
+ });
2574
+ },
2575
+ enumerable: false,
2576
+ configurable: true
2577
+ });
2578
+ RemoveLiquidityTokenProcess.fromFields = function (fields) {
2579
+ return RemoveLiquidityTokenProcess.reified().new({
2580
+ liquidityToken: (0, reified_1.decodeFromFields)(structs_1.TypeName.reified(), fields.liquidity_token),
2581
+ removedPositionsBaseToken: (0, reified_1.decodeFromFields)(reified.vector(structs_1.TypeName.reified()), fields.removed_positions_base_token),
2582
+ removedOrdersBaseToken: (0, reified_1.decodeFromFields)(reified.vector(structs_1.TypeName.reified()), fields.removed_orders_base_token),
2583
+ removedTokenOracleId: (0, reified_1.decodeFromFields)("address", fields.removed_token_oracle_id),
2584
+ removedUsd: (0, reified_1.decodeFromFields)("u64", fields.removed_usd),
2585
+ repaidUsd: (0, reified_1.decodeFromFields)("u64", fields.repaid_usd),
2586
+ status: (0, reified_1.decodeFromFields)("u64", fields.status),
2587
+ });
2588
+ };
2589
+ RemoveLiquidityTokenProcess.fromFieldsWithTypes = function (item) {
2590
+ if (!isRemoveLiquidityTokenProcess(item.type)) {
2591
+ throw new Error("not a RemoveLiquidityTokenProcess type");
2592
+ }
2593
+ return RemoveLiquidityTokenProcess.reified().new({
2594
+ liquidityToken: (0, reified_1.decodeFromFieldsWithTypes)(structs_1.TypeName.reified(), item.fields.liquidity_token),
2595
+ removedPositionsBaseToken: (0, reified_1.decodeFromFieldsWithTypes)(reified.vector(structs_1.TypeName.reified()), item.fields.removed_positions_base_token),
2596
+ removedOrdersBaseToken: (0, reified_1.decodeFromFieldsWithTypes)(reified.vector(structs_1.TypeName.reified()), item.fields.removed_orders_base_token),
2597
+ removedTokenOracleId: (0, reified_1.decodeFromFieldsWithTypes)("address", item.fields.removed_token_oracle_id),
2598
+ removedUsd: (0, reified_1.decodeFromFieldsWithTypes)("u64", item.fields.removed_usd),
2599
+ repaidUsd: (0, reified_1.decodeFromFieldsWithTypes)("u64", item.fields.repaid_usd),
2600
+ status: (0, reified_1.decodeFromFieldsWithTypes)("u64", item.fields.status),
2601
+ });
2602
+ };
2603
+ RemoveLiquidityTokenProcess.fromBcs = function (data) {
2604
+ return RemoveLiquidityTokenProcess.fromFields(RemoveLiquidityTokenProcess.bcs.parse(data));
2605
+ };
2606
+ RemoveLiquidityTokenProcess.prototype.toJSONField = function () {
2607
+ return {
2608
+ liquidityToken: this.liquidityToken.toJSONField(),
2609
+ removedPositionsBaseToken: (0, reified_1.fieldToJSON)("vector<".concat(structs_1.TypeName.$typeName, ">"), this.removedPositionsBaseToken),
2610
+ removedOrdersBaseToken: (0, reified_1.fieldToJSON)("vector<".concat(structs_1.TypeName.$typeName, ">"), this.removedOrdersBaseToken),
2611
+ removedTokenOracleId: this.removedTokenOracleId,
2612
+ removedUsd: this.removedUsd.toString(),
2613
+ repaidUsd: this.repaidUsd.toString(),
2614
+ status: this.status.toString(),
2615
+ };
2616
+ };
2617
+ RemoveLiquidityTokenProcess.prototype.toJSON = function () {
2618
+ return __assign({ $typeName: this.$typeName, $typeArgs: this.$typeArgs }, this.toJSONField());
2619
+ };
2620
+ RemoveLiquidityTokenProcess.fromJSONField = function (field) {
2621
+ return RemoveLiquidityTokenProcess.reified().new({
2622
+ liquidityToken: (0, reified_1.decodeFromJSONField)(structs_1.TypeName.reified(), field.liquidityToken),
2623
+ removedPositionsBaseToken: (0, reified_1.decodeFromJSONField)(reified.vector(structs_1.TypeName.reified()), field.removedPositionsBaseToken),
2624
+ removedOrdersBaseToken: (0, reified_1.decodeFromJSONField)(reified.vector(structs_1.TypeName.reified()), field.removedOrdersBaseToken),
2625
+ removedTokenOracleId: (0, reified_1.decodeFromJSONField)("address", field.removedTokenOracleId),
2626
+ removedUsd: (0, reified_1.decodeFromJSONField)("u64", field.removedUsd),
2627
+ repaidUsd: (0, reified_1.decodeFromJSONField)("u64", field.repaidUsd),
2628
+ status: (0, reified_1.decodeFromJSONField)("u64", field.status),
2629
+ });
2630
+ };
2631
+ RemoveLiquidityTokenProcess.fromJSON = function (json) {
2632
+ if (json.$typeName !== RemoveLiquidityTokenProcess.$typeName) {
2633
+ throw new Error("not a WithTwoGenerics json object");
2634
+ }
2635
+ return RemoveLiquidityTokenProcess.fromJSONField(json);
2636
+ };
2637
+ RemoveLiquidityTokenProcess.fromSuiParsedData = function (content) {
2638
+ if (content.dataType !== "moveObject") {
2639
+ throw new Error("not an object");
2640
+ }
2641
+ if (!isRemoveLiquidityTokenProcess(content.type)) {
2642
+ throw new Error("object at ".concat(content.fields.id, " is not a RemoveLiquidityTokenProcess object"));
2643
+ }
2644
+ return RemoveLiquidityTokenProcess.fromFieldsWithTypes(content);
2645
+ };
2646
+ RemoveLiquidityTokenProcess.fromSuiObjectData = function (data) {
2647
+ if (data.bcs) {
2648
+ if (data.bcs.dataType !== "moveObject" || !isRemoveLiquidityTokenProcess(data.bcs.type)) {
2649
+ throw new Error("object at is not a RemoveLiquidityTokenProcess object");
2650
+ }
2651
+ return RemoveLiquidityTokenProcess.fromBcs((0, utils_1.fromB64)(data.bcs.bcsBytes));
2652
+ }
2653
+ if (data.content) {
2654
+ return RemoveLiquidityTokenProcess.fromSuiParsedData(data.content);
2655
+ }
2656
+ throw new Error("Both `bcs` and `content` fields are missing from the data. Include `showBcs` or `showContent` in the request.");
2657
+ };
2658
+ RemoveLiquidityTokenProcess.fetch = function (client, id) {
2659
+ return __awaiter(this, void 0, void 0, function () {
2660
+ var res;
2661
+ var _a, _b;
2662
+ return __generator(this, function (_c) {
2663
+ switch (_c.label) {
2664
+ case 0: return [4 /*yield*/, client.getObject({ id: id, options: { showBcs: true } })];
2665
+ case 1:
2666
+ res = _c.sent();
2667
+ if (res.error) {
2668
+ throw new Error("error fetching RemoveLiquidityTokenProcess object at id ".concat(id, ": ").concat(res.error.code));
2669
+ }
2670
+ if (((_b = (_a = res.data) === null || _a === void 0 ? void 0 : _a.bcs) === null || _b === void 0 ? void 0 : _b.dataType) !== "moveObject" || !isRemoveLiquidityTokenProcess(res.data.bcs.type)) {
2671
+ throw new Error("object at id ".concat(id, " is not a RemoveLiquidityTokenProcess object"));
2672
+ }
2673
+ return [2 /*return*/, RemoveLiquidityTokenProcess.fromSuiObjectData(res.data)];
2674
+ }
2675
+ });
2676
+ });
2677
+ };
2678
+ RemoveLiquidityTokenProcess.$typeName = "".concat(index_1.PKG_V1, "::lp_pool::RemoveLiquidityTokenProcess");
2679
+ RemoveLiquidityTokenProcess.$numTypeParams = 0;
2680
+ RemoveLiquidityTokenProcess.$isPhantom = [];
2681
+ return RemoveLiquidityTokenProcess;
2682
+ }());
2683
+ exports.RemoveLiquidityTokenProcess = RemoveLiquidityTokenProcess;
2684
+ /* ============================== ResumePoolEvent =============================== */
2685
+ function isResumePoolEvent(type) {
2686
+ type = (0, util_1.compressSuiType)(type);
2687
+ return type === "".concat(index_1.PKG_V1, "::lp_pool::ResumePoolEvent");
2688
+ }
2689
+ var ResumePoolEvent = /** @class */ (function () {
2690
+ function ResumePoolEvent(typeArgs, fields) {
2691
+ this.__StructClass = true;
2692
+ this.$typeName = ResumePoolEvent.$typeName;
2693
+ this.$isPhantom = ResumePoolEvent.$isPhantom;
2694
+ this.$fullTypeName = util_1.composeSuiType.apply(void 0, __spreadArray([ResumePoolEvent.$typeName], __read(typeArgs), false));
2695
+ this.$typeArgs = typeArgs;
2696
+ this.sender = fields.sender;
2697
+ this.index = fields.index;
2698
+ this.u64Padding = fields.u64Padding;
2699
+ }
2700
+ ResumePoolEvent.reified = function () {
2701
+ var _this = this;
2702
+ return {
2703
+ typeName: ResumePoolEvent.$typeName,
2704
+ fullTypeName: util_1.composeSuiType.apply(void 0, __spreadArray([ResumePoolEvent.$typeName], [], false)),
2705
+ typeArgs: [],
2706
+ isPhantom: ResumePoolEvent.$isPhantom,
2707
+ reifiedTypeArgs: [],
2708
+ fromFields: function (fields) { return ResumePoolEvent.fromFields(fields); },
2709
+ fromFieldsWithTypes: function (item) { return ResumePoolEvent.fromFieldsWithTypes(item); },
2710
+ fromBcs: function (data) { return ResumePoolEvent.fromBcs(data); },
2711
+ bcs: ResumePoolEvent.bcs,
2712
+ fromJSONField: function (field) { return ResumePoolEvent.fromJSONField(field); },
2713
+ fromJSON: function (json) { return ResumePoolEvent.fromJSON(json); },
2714
+ fromSuiParsedData: function (content) { return ResumePoolEvent.fromSuiParsedData(content); },
2715
+ fromSuiObjectData: function (content) { return ResumePoolEvent.fromSuiObjectData(content); },
2716
+ fetch: function (client, id) { return __awaiter(_this, void 0, void 0, function () { return __generator(this, function (_a) {
2717
+ return [2 /*return*/, ResumePoolEvent.fetch(client, id)];
2718
+ }); }); },
2719
+ new: function (fields) {
2720
+ return new ResumePoolEvent([], fields);
2721
+ },
2722
+ kind: "StructClassReified",
2723
+ };
2724
+ };
2725
+ Object.defineProperty(ResumePoolEvent, "r", {
2726
+ get: function () {
2727
+ return ResumePoolEvent.reified();
2728
+ },
2729
+ enumerable: false,
2730
+ configurable: true
2731
+ });
2732
+ ResumePoolEvent.phantom = function () {
2733
+ return (0, reified_1.phantom)(ResumePoolEvent.reified());
2734
+ };
2735
+ Object.defineProperty(ResumePoolEvent, "p", {
2736
+ get: function () {
2737
+ return ResumePoolEvent.phantom();
2738
+ },
2739
+ enumerable: false,
2740
+ configurable: true
2741
+ });
2742
+ Object.defineProperty(ResumePoolEvent, "bcs", {
2743
+ get: function () {
2744
+ return bcs_1.bcs.struct("ResumePoolEvent", {
2745
+ sender: bcs_1.bcs.bytes(32).transform({ input: function (val) { return (0, utils_1.fromHEX)(val); }, output: function (val) { return (0, utils_1.toHEX)(val); } }),
2746
+ index: bcs_1.bcs.u64(),
2747
+ u64_padding: bcs_1.bcs.vector(bcs_1.bcs.u64()),
2748
+ });
2749
+ },
2750
+ enumerable: false,
2751
+ configurable: true
2752
+ });
2753
+ ResumePoolEvent.fromFields = function (fields) {
2754
+ return ResumePoolEvent.reified().new({
2755
+ sender: (0, reified_1.decodeFromFields)("address", fields.sender),
2756
+ index: (0, reified_1.decodeFromFields)("u64", fields.index),
2757
+ u64Padding: (0, reified_1.decodeFromFields)(reified.vector("u64"), fields.u64_padding),
2758
+ });
2759
+ };
2760
+ ResumePoolEvent.fromFieldsWithTypes = function (item) {
2761
+ if (!isResumePoolEvent(item.type)) {
2762
+ throw new Error("not a ResumePoolEvent type");
2763
+ }
2764
+ return ResumePoolEvent.reified().new({
2765
+ sender: (0, reified_1.decodeFromFieldsWithTypes)("address", item.fields.sender),
2766
+ index: (0, reified_1.decodeFromFieldsWithTypes)("u64", item.fields.index),
2767
+ u64Padding: (0, reified_1.decodeFromFieldsWithTypes)(reified.vector("u64"), item.fields.u64_padding),
2768
+ });
2769
+ };
2770
+ ResumePoolEvent.fromBcs = function (data) {
2771
+ return ResumePoolEvent.fromFields(ResumePoolEvent.bcs.parse(data));
2772
+ };
2773
+ ResumePoolEvent.prototype.toJSONField = function () {
2774
+ return {
2775
+ sender: this.sender,
2776
+ index: this.index.toString(),
2777
+ u64Padding: (0, reified_1.fieldToJSON)("vector<u64>", this.u64Padding),
2778
+ };
2779
+ };
2780
+ ResumePoolEvent.prototype.toJSON = function () {
2781
+ return __assign({ $typeName: this.$typeName, $typeArgs: this.$typeArgs }, this.toJSONField());
2782
+ };
2783
+ ResumePoolEvent.fromJSONField = function (field) {
2784
+ return ResumePoolEvent.reified().new({
2785
+ sender: (0, reified_1.decodeFromJSONField)("address", field.sender),
2786
+ index: (0, reified_1.decodeFromJSONField)("u64", field.index),
2787
+ u64Padding: (0, reified_1.decodeFromJSONField)(reified.vector("u64"), field.u64Padding),
2788
+ });
2789
+ };
2790
+ ResumePoolEvent.fromJSON = function (json) {
2791
+ if (json.$typeName !== ResumePoolEvent.$typeName) {
2792
+ throw new Error("not a WithTwoGenerics json object");
2793
+ }
2794
+ return ResumePoolEvent.fromJSONField(json);
2795
+ };
2796
+ ResumePoolEvent.fromSuiParsedData = function (content) {
2797
+ if (content.dataType !== "moveObject") {
2798
+ throw new Error("not an object");
2799
+ }
2800
+ if (!isResumePoolEvent(content.type)) {
2801
+ throw new Error("object at ".concat(content.fields.id, " is not a ResumePoolEvent object"));
2802
+ }
2803
+ return ResumePoolEvent.fromFieldsWithTypes(content);
2804
+ };
2805
+ ResumePoolEvent.fromSuiObjectData = function (data) {
2806
+ if (data.bcs) {
2807
+ if (data.bcs.dataType !== "moveObject" || !isResumePoolEvent(data.bcs.type)) {
2808
+ throw new Error("object at is not a ResumePoolEvent object");
2809
+ }
2810
+ return ResumePoolEvent.fromBcs((0, utils_1.fromB64)(data.bcs.bcsBytes));
2811
+ }
2812
+ if (data.content) {
2813
+ return ResumePoolEvent.fromSuiParsedData(data.content);
2814
+ }
2815
+ throw new Error("Both `bcs` and `content` fields are missing from the data. Include `showBcs` or `showContent` in the request.");
2816
+ };
2817
+ ResumePoolEvent.fetch = function (client, id) {
2818
+ return __awaiter(this, void 0, void 0, function () {
2819
+ var res;
2820
+ var _a, _b;
2821
+ return __generator(this, function (_c) {
2822
+ switch (_c.label) {
2823
+ case 0: return [4 /*yield*/, client.getObject({ id: id, options: { showBcs: true } })];
2824
+ case 1:
2825
+ res = _c.sent();
2826
+ if (res.error) {
2827
+ throw new Error("error fetching ResumePoolEvent object at id ".concat(id, ": ").concat(res.error.code));
2828
+ }
2829
+ if (((_b = (_a = res.data) === null || _a === void 0 ? void 0 : _a.bcs) === null || _b === void 0 ? void 0 : _b.dataType) !== "moveObject" || !isResumePoolEvent(res.data.bcs.type)) {
2830
+ throw new Error("object at id ".concat(id, " is not a ResumePoolEvent object"));
2831
+ }
2832
+ return [2 /*return*/, ResumePoolEvent.fromSuiObjectData(res.data)];
2833
+ }
2834
+ });
2835
+ });
2836
+ };
2837
+ ResumePoolEvent.$typeName = "".concat(index_1.PKG_V1, "::lp_pool::ResumePoolEvent");
2838
+ ResumePoolEvent.$numTypeParams = 0;
2839
+ ResumePoolEvent.$isPhantom = [];
2840
+ return ResumePoolEvent;
2841
+ }());
2842
+ exports.ResumePoolEvent = ResumePoolEvent;
2843
+ /* ============================== ResumeTokenPoolEvent =============================== */
2844
+ function isResumeTokenPoolEvent(type) {
2845
+ type = (0, util_1.compressSuiType)(type);
2846
+ return type === "".concat(index_1.PKG_V1, "::lp_pool::ResumeTokenPoolEvent");
2847
+ }
2848
+ var ResumeTokenPoolEvent = /** @class */ (function () {
2849
+ function ResumeTokenPoolEvent(typeArgs, fields) {
2850
+ this.__StructClass = true;
2851
+ this.$typeName = ResumeTokenPoolEvent.$typeName;
2852
+ this.$isPhantom = ResumeTokenPoolEvent.$isPhantom;
2853
+ this.$fullTypeName = util_1.composeSuiType.apply(void 0, __spreadArray([ResumeTokenPoolEvent.$typeName], __read(typeArgs), false));
2854
+ this.$typeArgs = typeArgs;
2855
+ this.sender = fields.sender;
2856
+ this.index = fields.index;
2857
+ this.liquidityToken = fields.liquidityToken;
2858
+ this.u64Padding = fields.u64Padding;
2859
+ }
2860
+ ResumeTokenPoolEvent.reified = function () {
2861
+ var _this = this;
2862
+ return {
2863
+ typeName: ResumeTokenPoolEvent.$typeName,
2864
+ fullTypeName: util_1.composeSuiType.apply(void 0, __spreadArray([ResumeTokenPoolEvent.$typeName], [], false)),
2865
+ typeArgs: [],
2866
+ isPhantom: ResumeTokenPoolEvent.$isPhantom,
2867
+ reifiedTypeArgs: [],
2868
+ fromFields: function (fields) { return ResumeTokenPoolEvent.fromFields(fields); },
2869
+ fromFieldsWithTypes: function (item) { return ResumeTokenPoolEvent.fromFieldsWithTypes(item); },
2870
+ fromBcs: function (data) { return ResumeTokenPoolEvent.fromBcs(data); },
2871
+ bcs: ResumeTokenPoolEvent.bcs,
2872
+ fromJSONField: function (field) { return ResumeTokenPoolEvent.fromJSONField(field); },
2873
+ fromJSON: function (json) { return ResumeTokenPoolEvent.fromJSON(json); },
2874
+ fromSuiParsedData: function (content) { return ResumeTokenPoolEvent.fromSuiParsedData(content); },
2875
+ fromSuiObjectData: function (content) { return ResumeTokenPoolEvent.fromSuiObjectData(content); },
2876
+ fetch: function (client, id) { return __awaiter(_this, void 0, void 0, function () { return __generator(this, function (_a) {
2877
+ return [2 /*return*/, ResumeTokenPoolEvent.fetch(client, id)];
2878
+ }); }); },
2879
+ new: function (fields) {
2880
+ return new ResumeTokenPoolEvent([], fields);
2881
+ },
2882
+ kind: "StructClassReified",
2883
+ };
2884
+ };
2885
+ Object.defineProperty(ResumeTokenPoolEvent, "r", {
2886
+ get: function () {
2887
+ return ResumeTokenPoolEvent.reified();
2888
+ },
2889
+ enumerable: false,
2890
+ configurable: true
2891
+ });
2892
+ ResumeTokenPoolEvent.phantom = function () {
2893
+ return (0, reified_1.phantom)(ResumeTokenPoolEvent.reified());
2894
+ };
2895
+ Object.defineProperty(ResumeTokenPoolEvent, "p", {
2896
+ get: function () {
2897
+ return ResumeTokenPoolEvent.phantom();
2898
+ },
2899
+ enumerable: false,
2900
+ configurable: true
2901
+ });
2902
+ Object.defineProperty(ResumeTokenPoolEvent, "bcs", {
2903
+ get: function () {
2904
+ return bcs_1.bcs.struct("ResumeTokenPoolEvent", {
2905
+ sender: bcs_1.bcs.bytes(32).transform({ input: function (val) { return (0, utils_1.fromHEX)(val); }, output: function (val) { return (0, utils_1.toHEX)(val); } }),
2906
+ index: bcs_1.bcs.u64(),
2907
+ liquidity_token: structs_1.TypeName.bcs,
2908
+ u64_padding: bcs_1.bcs.vector(bcs_1.bcs.u64()),
2909
+ });
2910
+ },
2911
+ enumerable: false,
2912
+ configurable: true
2913
+ });
2914
+ ResumeTokenPoolEvent.fromFields = function (fields) {
2915
+ return ResumeTokenPoolEvent.reified().new({
2916
+ sender: (0, reified_1.decodeFromFields)("address", fields.sender),
2917
+ index: (0, reified_1.decodeFromFields)("u64", fields.index),
2918
+ liquidityToken: (0, reified_1.decodeFromFields)(structs_1.TypeName.reified(), fields.liquidity_token),
2919
+ u64Padding: (0, reified_1.decodeFromFields)(reified.vector("u64"), fields.u64_padding),
2920
+ });
2921
+ };
2922
+ ResumeTokenPoolEvent.fromFieldsWithTypes = function (item) {
2923
+ if (!isResumeTokenPoolEvent(item.type)) {
2924
+ throw new Error("not a ResumeTokenPoolEvent type");
2925
+ }
2926
+ return ResumeTokenPoolEvent.reified().new({
2927
+ sender: (0, reified_1.decodeFromFieldsWithTypes)("address", item.fields.sender),
2928
+ index: (0, reified_1.decodeFromFieldsWithTypes)("u64", item.fields.index),
2929
+ liquidityToken: (0, reified_1.decodeFromFieldsWithTypes)(structs_1.TypeName.reified(), item.fields.liquidity_token),
2930
+ u64Padding: (0, reified_1.decodeFromFieldsWithTypes)(reified.vector("u64"), item.fields.u64_padding),
2931
+ });
2932
+ };
2933
+ ResumeTokenPoolEvent.fromBcs = function (data) {
2934
+ return ResumeTokenPoolEvent.fromFields(ResumeTokenPoolEvent.bcs.parse(data));
2935
+ };
2936
+ ResumeTokenPoolEvent.prototype.toJSONField = function () {
2937
+ return {
2938
+ sender: this.sender,
2939
+ index: this.index.toString(),
2940
+ liquidityToken: this.liquidityToken.toJSONField(),
2941
+ u64Padding: (0, reified_1.fieldToJSON)("vector<u64>", this.u64Padding),
2942
+ };
2943
+ };
2944
+ ResumeTokenPoolEvent.prototype.toJSON = function () {
2945
+ return __assign({ $typeName: this.$typeName, $typeArgs: this.$typeArgs }, this.toJSONField());
2946
+ };
2947
+ ResumeTokenPoolEvent.fromJSONField = function (field) {
2948
+ return ResumeTokenPoolEvent.reified().new({
2949
+ sender: (0, reified_1.decodeFromJSONField)("address", field.sender),
2950
+ index: (0, reified_1.decodeFromJSONField)("u64", field.index),
2951
+ liquidityToken: (0, reified_1.decodeFromJSONField)(structs_1.TypeName.reified(), field.liquidityToken),
2952
+ u64Padding: (0, reified_1.decodeFromJSONField)(reified.vector("u64"), field.u64Padding),
2953
+ });
2954
+ };
2955
+ ResumeTokenPoolEvent.fromJSON = function (json) {
2956
+ if (json.$typeName !== ResumeTokenPoolEvent.$typeName) {
2957
+ throw new Error("not a WithTwoGenerics json object");
2958
+ }
2959
+ return ResumeTokenPoolEvent.fromJSONField(json);
2960
+ };
2961
+ ResumeTokenPoolEvent.fromSuiParsedData = function (content) {
2962
+ if (content.dataType !== "moveObject") {
2963
+ throw new Error("not an object");
2964
+ }
2965
+ if (!isResumeTokenPoolEvent(content.type)) {
2966
+ throw new Error("object at ".concat(content.fields.id, " is not a ResumeTokenPoolEvent object"));
2967
+ }
2968
+ return ResumeTokenPoolEvent.fromFieldsWithTypes(content);
2969
+ };
2970
+ ResumeTokenPoolEvent.fromSuiObjectData = function (data) {
2971
+ if (data.bcs) {
2972
+ if (data.bcs.dataType !== "moveObject" || !isResumeTokenPoolEvent(data.bcs.type)) {
2973
+ throw new Error("object at is not a ResumeTokenPoolEvent object");
2974
+ }
2975
+ return ResumeTokenPoolEvent.fromBcs((0, utils_1.fromB64)(data.bcs.bcsBytes));
2976
+ }
2977
+ if (data.content) {
2978
+ return ResumeTokenPoolEvent.fromSuiParsedData(data.content);
2979
+ }
2980
+ throw new Error("Both `bcs` and `content` fields are missing from the data. Include `showBcs` or `showContent` in the request.");
2981
+ };
2982
+ ResumeTokenPoolEvent.fetch = function (client, id) {
2983
+ return __awaiter(this, void 0, void 0, function () {
2984
+ var res;
2985
+ var _a, _b;
2986
+ return __generator(this, function (_c) {
2987
+ switch (_c.label) {
2988
+ case 0: return [4 /*yield*/, client.getObject({ id: id, options: { showBcs: true } })];
2989
+ case 1:
2990
+ res = _c.sent();
2991
+ if (res.error) {
2992
+ throw new Error("error fetching ResumeTokenPoolEvent object at id ".concat(id, ": ").concat(res.error.code));
2993
+ }
2994
+ if (((_b = (_a = res.data) === null || _a === void 0 ? void 0 : _a.bcs) === null || _b === void 0 ? void 0 : _b.dataType) !== "moveObject" || !isResumeTokenPoolEvent(res.data.bcs.type)) {
2995
+ throw new Error("object at id ".concat(id, " is not a ResumeTokenPoolEvent object"));
2996
+ }
2997
+ return [2 /*return*/, ResumeTokenPoolEvent.fromSuiObjectData(res.data)];
2998
+ }
2999
+ });
3000
+ });
3001
+ };
3002
+ ResumeTokenPoolEvent.$typeName = "".concat(index_1.PKG_V1, "::lp_pool::ResumeTokenPoolEvent");
3003
+ ResumeTokenPoolEvent.$numTypeParams = 0;
3004
+ ResumeTokenPoolEvent.$isPhantom = [];
3005
+ return ResumeTokenPoolEvent;
3006
+ }());
3007
+ exports.ResumeTokenPoolEvent = ResumeTokenPoolEvent;
3008
+ /* ============================== SpotConfig =============================== */
3009
+ function isSpotConfig(type) {
3010
+ type = (0, util_1.compressSuiType)(type);
3011
+ return type === "".concat(index_1.PKG_V1, "::lp_pool::SpotConfig");
3012
+ }
3013
+ var SpotConfig = /** @class */ (function () {
3014
+ function SpotConfig(typeArgs, fields) {
3015
+ this.__StructClass = true;
3016
+ this.$typeName = SpotConfig.$typeName;
3017
+ this.$isPhantom = SpotConfig.$isPhantom;
3018
+ this.$fullTypeName = util_1.composeSuiType.apply(void 0, __spreadArray([SpotConfig.$typeName], __read(typeArgs), false));
3019
+ this.$typeArgs = typeArgs;
3020
+ this.minDeposit = fields.minDeposit;
3021
+ this.maxCapacity = fields.maxCapacity;
3022
+ this.targetWeightBp = fields.targetWeightBp;
3023
+ this.basicMintFeeBp = fields.basicMintFeeBp;
3024
+ this.additionalMintFeeBp = fields.additionalMintFeeBp;
3025
+ this.basicBurnFeeBp = fields.basicBurnFeeBp;
3026
+ this.additionalBurnFeeBp = fields.additionalBurnFeeBp;
3027
+ this.swapFeeBp = fields.swapFeeBp;
3028
+ this.swapFeeProtocolShareBp = fields.swapFeeProtocolShareBp;
3029
+ this.u64Padding = fields.u64Padding;
3030
+ }
3031
+ SpotConfig.reified = function () {
3032
+ var _this = this;
3033
+ return {
3034
+ typeName: SpotConfig.$typeName,
3035
+ fullTypeName: util_1.composeSuiType.apply(void 0, __spreadArray([SpotConfig.$typeName], [], false)),
3036
+ typeArgs: [],
3037
+ isPhantom: SpotConfig.$isPhantom,
3038
+ reifiedTypeArgs: [],
3039
+ fromFields: function (fields) { return SpotConfig.fromFields(fields); },
3040
+ fromFieldsWithTypes: function (item) { return SpotConfig.fromFieldsWithTypes(item); },
3041
+ fromBcs: function (data) { return SpotConfig.fromBcs(data); },
3042
+ bcs: SpotConfig.bcs,
3043
+ fromJSONField: function (field) { return SpotConfig.fromJSONField(field); },
3044
+ fromJSON: function (json) { return SpotConfig.fromJSON(json); },
3045
+ fromSuiParsedData: function (content) { return SpotConfig.fromSuiParsedData(content); },
3046
+ fromSuiObjectData: function (content) { return SpotConfig.fromSuiObjectData(content); },
3047
+ fetch: function (client, id) { return __awaiter(_this, void 0, void 0, function () { return __generator(this, function (_a) {
3048
+ return [2 /*return*/, SpotConfig.fetch(client, id)];
3049
+ }); }); },
3050
+ new: function (fields) {
3051
+ return new SpotConfig([], fields);
3052
+ },
3053
+ kind: "StructClassReified",
3054
+ };
3055
+ };
3056
+ Object.defineProperty(SpotConfig, "r", {
3057
+ get: function () {
3058
+ return SpotConfig.reified();
3059
+ },
3060
+ enumerable: false,
3061
+ configurable: true
3062
+ });
3063
+ SpotConfig.phantom = function () {
3064
+ return (0, reified_1.phantom)(SpotConfig.reified());
3065
+ };
3066
+ Object.defineProperty(SpotConfig, "p", {
3067
+ get: function () {
3068
+ return SpotConfig.phantom();
3069
+ },
3070
+ enumerable: false,
3071
+ configurable: true
3072
+ });
3073
+ Object.defineProperty(SpotConfig, "bcs", {
3074
+ get: function () {
3075
+ return bcs_1.bcs.struct("SpotConfig", {
3076
+ min_deposit: bcs_1.bcs.u64(),
3077
+ max_capacity: bcs_1.bcs.u64(),
3078
+ target_weight_bp: bcs_1.bcs.u64(),
3079
+ basic_mint_fee_bp: bcs_1.bcs.u64(),
3080
+ additional_mint_fee_bp: bcs_1.bcs.u64(),
3081
+ basic_burn_fee_bp: bcs_1.bcs.u64(),
3082
+ additional_burn_fee_bp: bcs_1.bcs.u64(),
3083
+ swap_fee_bp: bcs_1.bcs.u64(),
3084
+ swap_fee_protocol_share_bp: bcs_1.bcs.u64(),
3085
+ u64_padding: bcs_1.bcs.vector(bcs_1.bcs.u64()),
3086
+ });
3087
+ },
3088
+ enumerable: false,
3089
+ configurable: true
3090
+ });
3091
+ SpotConfig.fromFields = function (fields) {
3092
+ return SpotConfig.reified().new({
3093
+ minDeposit: (0, reified_1.decodeFromFields)("u64", fields.min_deposit),
3094
+ maxCapacity: (0, reified_1.decodeFromFields)("u64", fields.max_capacity),
3095
+ targetWeightBp: (0, reified_1.decodeFromFields)("u64", fields.target_weight_bp),
3096
+ basicMintFeeBp: (0, reified_1.decodeFromFields)("u64", fields.basic_mint_fee_bp),
3097
+ additionalMintFeeBp: (0, reified_1.decodeFromFields)("u64", fields.additional_mint_fee_bp),
3098
+ basicBurnFeeBp: (0, reified_1.decodeFromFields)("u64", fields.basic_burn_fee_bp),
3099
+ additionalBurnFeeBp: (0, reified_1.decodeFromFields)("u64", fields.additional_burn_fee_bp),
3100
+ swapFeeBp: (0, reified_1.decodeFromFields)("u64", fields.swap_fee_bp),
3101
+ swapFeeProtocolShareBp: (0, reified_1.decodeFromFields)("u64", fields.swap_fee_protocol_share_bp),
3102
+ u64Padding: (0, reified_1.decodeFromFields)(reified.vector("u64"), fields.u64_padding),
3103
+ });
3104
+ };
3105
+ SpotConfig.fromFieldsWithTypes = function (item) {
3106
+ if (!isSpotConfig(item.type)) {
3107
+ throw new Error("not a SpotConfig type");
3108
+ }
3109
+ return SpotConfig.reified().new({
3110
+ minDeposit: (0, reified_1.decodeFromFieldsWithTypes)("u64", item.fields.min_deposit),
3111
+ maxCapacity: (0, reified_1.decodeFromFieldsWithTypes)("u64", item.fields.max_capacity),
3112
+ targetWeightBp: (0, reified_1.decodeFromFieldsWithTypes)("u64", item.fields.target_weight_bp),
3113
+ basicMintFeeBp: (0, reified_1.decodeFromFieldsWithTypes)("u64", item.fields.basic_mint_fee_bp),
3114
+ additionalMintFeeBp: (0, reified_1.decodeFromFieldsWithTypes)("u64", item.fields.additional_mint_fee_bp),
3115
+ basicBurnFeeBp: (0, reified_1.decodeFromFieldsWithTypes)("u64", item.fields.basic_burn_fee_bp),
3116
+ additionalBurnFeeBp: (0, reified_1.decodeFromFieldsWithTypes)("u64", item.fields.additional_burn_fee_bp),
3117
+ swapFeeBp: (0, reified_1.decodeFromFieldsWithTypes)("u64", item.fields.swap_fee_bp),
3118
+ swapFeeProtocolShareBp: (0, reified_1.decodeFromFieldsWithTypes)("u64", item.fields.swap_fee_protocol_share_bp),
3119
+ u64Padding: (0, reified_1.decodeFromFieldsWithTypes)(reified.vector("u64"), item.fields.u64_padding),
3120
+ });
3121
+ };
3122
+ SpotConfig.fromBcs = function (data) {
3123
+ return SpotConfig.fromFields(SpotConfig.bcs.parse(data));
3124
+ };
3125
+ SpotConfig.prototype.toJSONField = function () {
3126
+ return {
3127
+ minDeposit: this.minDeposit.toString(),
3128
+ maxCapacity: this.maxCapacity.toString(),
3129
+ targetWeightBp: this.targetWeightBp.toString(),
3130
+ basicMintFeeBp: this.basicMintFeeBp.toString(),
3131
+ additionalMintFeeBp: this.additionalMintFeeBp.toString(),
3132
+ basicBurnFeeBp: this.basicBurnFeeBp.toString(),
3133
+ additionalBurnFeeBp: this.additionalBurnFeeBp.toString(),
3134
+ swapFeeBp: this.swapFeeBp.toString(),
3135
+ swapFeeProtocolShareBp: this.swapFeeProtocolShareBp.toString(),
3136
+ u64Padding: (0, reified_1.fieldToJSON)("vector<u64>", this.u64Padding),
3137
+ };
3138
+ };
3139
+ SpotConfig.prototype.toJSON = function () {
3140
+ return __assign({ $typeName: this.$typeName, $typeArgs: this.$typeArgs }, this.toJSONField());
3141
+ };
3142
+ SpotConfig.fromJSONField = function (field) {
3143
+ return SpotConfig.reified().new({
3144
+ minDeposit: (0, reified_1.decodeFromJSONField)("u64", field.minDeposit),
3145
+ maxCapacity: (0, reified_1.decodeFromJSONField)("u64", field.maxCapacity),
3146
+ targetWeightBp: (0, reified_1.decodeFromJSONField)("u64", field.targetWeightBp),
3147
+ basicMintFeeBp: (0, reified_1.decodeFromJSONField)("u64", field.basicMintFeeBp),
3148
+ additionalMintFeeBp: (0, reified_1.decodeFromJSONField)("u64", field.additionalMintFeeBp),
3149
+ basicBurnFeeBp: (0, reified_1.decodeFromJSONField)("u64", field.basicBurnFeeBp),
3150
+ additionalBurnFeeBp: (0, reified_1.decodeFromJSONField)("u64", field.additionalBurnFeeBp),
3151
+ swapFeeBp: (0, reified_1.decodeFromJSONField)("u64", field.swapFeeBp),
3152
+ swapFeeProtocolShareBp: (0, reified_1.decodeFromJSONField)("u64", field.swapFeeProtocolShareBp),
3153
+ u64Padding: (0, reified_1.decodeFromJSONField)(reified.vector("u64"), field.u64Padding),
3154
+ });
3155
+ };
3156
+ SpotConfig.fromJSON = function (json) {
3157
+ if (json.$typeName !== SpotConfig.$typeName) {
3158
+ throw new Error("not a WithTwoGenerics json object");
3159
+ }
3160
+ return SpotConfig.fromJSONField(json);
3161
+ };
3162
+ SpotConfig.fromSuiParsedData = function (content) {
3163
+ if (content.dataType !== "moveObject") {
3164
+ throw new Error("not an object");
3165
+ }
3166
+ if (!isSpotConfig(content.type)) {
3167
+ throw new Error("object at ".concat(content.fields.id, " is not a SpotConfig object"));
3168
+ }
3169
+ return SpotConfig.fromFieldsWithTypes(content);
3170
+ };
3171
+ SpotConfig.fromSuiObjectData = function (data) {
3172
+ if (data.bcs) {
3173
+ if (data.bcs.dataType !== "moveObject" || !isSpotConfig(data.bcs.type)) {
3174
+ throw new Error("object at is not a SpotConfig object");
3175
+ }
3176
+ return SpotConfig.fromBcs((0, utils_1.fromB64)(data.bcs.bcsBytes));
3177
+ }
3178
+ if (data.content) {
3179
+ return SpotConfig.fromSuiParsedData(data.content);
3180
+ }
3181
+ throw new Error("Both `bcs` and `content` fields are missing from the data. Include `showBcs` or `showContent` in the request.");
3182
+ };
3183
+ SpotConfig.fetch = function (client, id) {
3184
+ return __awaiter(this, void 0, void 0, function () {
3185
+ var res;
3186
+ var _a, _b;
3187
+ return __generator(this, function (_c) {
3188
+ switch (_c.label) {
3189
+ case 0: return [4 /*yield*/, client.getObject({ id: id, options: { showBcs: true } })];
3190
+ case 1:
3191
+ res = _c.sent();
3192
+ if (res.error) {
3193
+ throw new Error("error fetching SpotConfig object at id ".concat(id, ": ").concat(res.error.code));
3194
+ }
3195
+ if (((_b = (_a = res.data) === null || _a === void 0 ? void 0 : _a.bcs) === null || _b === void 0 ? void 0 : _b.dataType) !== "moveObject" || !isSpotConfig(res.data.bcs.type)) {
3196
+ throw new Error("object at id ".concat(id, " is not a SpotConfig object"));
3197
+ }
3198
+ return [2 /*return*/, SpotConfig.fromSuiObjectData(res.data)];
3199
+ }
3200
+ });
3201
+ });
3202
+ };
3203
+ SpotConfig.$typeName = "".concat(index_1.PKG_V1, "::lp_pool::SpotConfig");
3204
+ SpotConfig.$numTypeParams = 0;
3205
+ SpotConfig.$isPhantom = [];
3206
+ return SpotConfig;
3207
+ }());
3208
+ exports.SpotConfig = SpotConfig;
3209
+ /* ============================== StartRemoveLiquidityTokenProcessEvent =============================== */
3210
+ function isStartRemoveLiquidityTokenProcessEvent(type) {
3211
+ type = (0, util_1.compressSuiType)(type);
3212
+ return type === "".concat(index_1.PKG_V1, "::lp_pool::StartRemoveLiquidityTokenProcessEvent");
3213
+ }
3214
+ var StartRemoveLiquidityTokenProcessEvent = /** @class */ (function () {
3215
+ function StartRemoveLiquidityTokenProcessEvent(typeArgs, fields) {
3216
+ this.__StructClass = true;
3217
+ this.$typeName = StartRemoveLiquidityTokenProcessEvent.$typeName;
3218
+ this.$isPhantom = StartRemoveLiquidityTokenProcessEvent.$isPhantom;
3219
+ this.$fullTypeName = util_1.composeSuiType.apply(void 0, __spreadArray([StartRemoveLiquidityTokenProcessEvent.$typeName], __read(typeArgs), false));
3220
+ this.$typeArgs = typeArgs;
3221
+ this.index = fields.index;
3222
+ this.liquidityToken = fields.liquidityToken;
3223
+ this.u64Padding = fields.u64Padding;
3224
+ }
3225
+ StartRemoveLiquidityTokenProcessEvent.reified = function () {
3226
+ var _this = this;
3227
+ return {
3228
+ typeName: StartRemoveLiquidityTokenProcessEvent.$typeName,
3229
+ fullTypeName: util_1.composeSuiType.apply(void 0, __spreadArray([StartRemoveLiquidityTokenProcessEvent.$typeName], [], false)),
3230
+ typeArgs: [],
3231
+ isPhantom: StartRemoveLiquidityTokenProcessEvent.$isPhantom,
3232
+ reifiedTypeArgs: [],
3233
+ fromFields: function (fields) { return StartRemoveLiquidityTokenProcessEvent.fromFields(fields); },
3234
+ fromFieldsWithTypes: function (item) { return StartRemoveLiquidityTokenProcessEvent.fromFieldsWithTypes(item); },
3235
+ fromBcs: function (data) { return StartRemoveLiquidityTokenProcessEvent.fromBcs(data); },
3236
+ bcs: StartRemoveLiquidityTokenProcessEvent.bcs,
3237
+ fromJSONField: function (field) { return StartRemoveLiquidityTokenProcessEvent.fromJSONField(field); },
3238
+ fromJSON: function (json) { return StartRemoveLiquidityTokenProcessEvent.fromJSON(json); },
3239
+ fromSuiParsedData: function (content) { return StartRemoveLiquidityTokenProcessEvent.fromSuiParsedData(content); },
3240
+ fromSuiObjectData: function (content) { return StartRemoveLiquidityTokenProcessEvent.fromSuiObjectData(content); },
3241
+ fetch: function (client, id) { return __awaiter(_this, void 0, void 0, function () { return __generator(this, function (_a) {
3242
+ return [2 /*return*/, StartRemoveLiquidityTokenProcessEvent.fetch(client, id)];
3243
+ }); }); },
3244
+ new: function (fields) {
3245
+ return new StartRemoveLiquidityTokenProcessEvent([], fields);
3246
+ },
3247
+ kind: "StructClassReified",
3248
+ };
3249
+ };
3250
+ Object.defineProperty(StartRemoveLiquidityTokenProcessEvent, "r", {
3251
+ get: function () {
3252
+ return StartRemoveLiquidityTokenProcessEvent.reified();
3253
+ },
3254
+ enumerable: false,
3255
+ configurable: true
3256
+ });
3257
+ StartRemoveLiquidityTokenProcessEvent.phantom = function () {
3258
+ return (0, reified_1.phantom)(StartRemoveLiquidityTokenProcessEvent.reified());
3259
+ };
3260
+ Object.defineProperty(StartRemoveLiquidityTokenProcessEvent, "p", {
3261
+ get: function () {
3262
+ return StartRemoveLiquidityTokenProcessEvent.phantom();
3263
+ },
3264
+ enumerable: false,
3265
+ configurable: true
3266
+ });
3267
+ Object.defineProperty(StartRemoveLiquidityTokenProcessEvent, "bcs", {
3268
+ get: function () {
3269
+ return bcs_1.bcs.struct("StartRemoveLiquidityTokenProcessEvent", {
3270
+ index: bcs_1.bcs.u64(),
3271
+ liquidity_token: structs_1.TypeName.bcs,
3272
+ u64_padding: bcs_1.bcs.vector(bcs_1.bcs.u64()),
3273
+ });
3274
+ },
3275
+ enumerable: false,
3276
+ configurable: true
3277
+ });
3278
+ StartRemoveLiquidityTokenProcessEvent.fromFields = function (fields) {
3279
+ return StartRemoveLiquidityTokenProcessEvent.reified().new({
3280
+ index: (0, reified_1.decodeFromFields)("u64", fields.index),
3281
+ liquidityToken: (0, reified_1.decodeFromFields)(structs_1.TypeName.reified(), fields.liquidity_token),
3282
+ u64Padding: (0, reified_1.decodeFromFields)(reified.vector("u64"), fields.u64_padding),
3283
+ });
3284
+ };
3285
+ StartRemoveLiquidityTokenProcessEvent.fromFieldsWithTypes = function (item) {
3286
+ if (!isStartRemoveLiquidityTokenProcessEvent(item.type)) {
3287
+ throw new Error("not a StartRemoveLiquidityTokenProcessEvent type");
3288
+ }
3289
+ return StartRemoveLiquidityTokenProcessEvent.reified().new({
3290
+ index: (0, reified_1.decodeFromFieldsWithTypes)("u64", item.fields.index),
3291
+ liquidityToken: (0, reified_1.decodeFromFieldsWithTypes)(structs_1.TypeName.reified(), item.fields.liquidity_token),
3292
+ u64Padding: (0, reified_1.decodeFromFieldsWithTypes)(reified.vector("u64"), item.fields.u64_padding),
3293
+ });
3294
+ };
3295
+ StartRemoveLiquidityTokenProcessEvent.fromBcs = function (data) {
3296
+ return StartRemoveLiquidityTokenProcessEvent.fromFields(StartRemoveLiquidityTokenProcessEvent.bcs.parse(data));
3297
+ };
3298
+ StartRemoveLiquidityTokenProcessEvent.prototype.toJSONField = function () {
3299
+ return {
3300
+ index: this.index.toString(),
3301
+ liquidityToken: this.liquidityToken.toJSONField(),
3302
+ u64Padding: (0, reified_1.fieldToJSON)("vector<u64>", this.u64Padding),
3303
+ };
3304
+ };
3305
+ StartRemoveLiquidityTokenProcessEvent.prototype.toJSON = function () {
3306
+ return __assign({ $typeName: this.$typeName, $typeArgs: this.$typeArgs }, this.toJSONField());
3307
+ };
3308
+ StartRemoveLiquidityTokenProcessEvent.fromJSONField = function (field) {
3309
+ return StartRemoveLiquidityTokenProcessEvent.reified().new({
3310
+ index: (0, reified_1.decodeFromJSONField)("u64", field.index),
3311
+ liquidityToken: (0, reified_1.decodeFromJSONField)(structs_1.TypeName.reified(), field.liquidityToken),
3312
+ u64Padding: (0, reified_1.decodeFromJSONField)(reified.vector("u64"), field.u64Padding),
3313
+ });
3314
+ };
3315
+ StartRemoveLiquidityTokenProcessEvent.fromJSON = function (json) {
3316
+ if (json.$typeName !== StartRemoveLiquidityTokenProcessEvent.$typeName) {
3317
+ throw new Error("not a WithTwoGenerics json object");
3318
+ }
3319
+ return StartRemoveLiquidityTokenProcessEvent.fromJSONField(json);
3320
+ };
3321
+ StartRemoveLiquidityTokenProcessEvent.fromSuiParsedData = function (content) {
3322
+ if (content.dataType !== "moveObject") {
3323
+ throw new Error("not an object");
3324
+ }
3325
+ if (!isStartRemoveLiquidityTokenProcessEvent(content.type)) {
3326
+ throw new Error("object at ".concat(content.fields.id, " is not a StartRemoveLiquidityTokenProcessEvent object"));
3327
+ }
3328
+ return StartRemoveLiquidityTokenProcessEvent.fromFieldsWithTypes(content);
3329
+ };
3330
+ StartRemoveLiquidityTokenProcessEvent.fromSuiObjectData = function (data) {
3331
+ if (data.bcs) {
3332
+ if (data.bcs.dataType !== "moveObject" || !isStartRemoveLiquidityTokenProcessEvent(data.bcs.type)) {
3333
+ throw new Error("object at is not a StartRemoveLiquidityTokenProcessEvent object");
3334
+ }
3335
+ return StartRemoveLiquidityTokenProcessEvent.fromBcs((0, utils_1.fromB64)(data.bcs.bcsBytes));
3336
+ }
3337
+ if (data.content) {
3338
+ return StartRemoveLiquidityTokenProcessEvent.fromSuiParsedData(data.content);
3339
+ }
3340
+ throw new Error("Both `bcs` and `content` fields are missing from the data. Include `showBcs` or `showContent` in the request.");
3341
+ };
3342
+ StartRemoveLiquidityTokenProcessEvent.fetch = function (client, id) {
3343
+ return __awaiter(this, void 0, void 0, function () {
3344
+ var res;
3345
+ var _a, _b;
3346
+ return __generator(this, function (_c) {
3347
+ switch (_c.label) {
3348
+ case 0: return [4 /*yield*/, client.getObject({ id: id, options: { showBcs: true } })];
3349
+ case 1:
3350
+ res = _c.sent();
3351
+ if (res.error) {
3352
+ throw new Error("error fetching StartRemoveLiquidityTokenProcessEvent object at id ".concat(id, ": ").concat(res.error.code));
3353
+ }
3354
+ if (((_b = (_a = res.data) === null || _a === void 0 ? void 0 : _a.bcs) === null || _b === void 0 ? void 0 : _b.dataType) !== "moveObject" || !isStartRemoveLiquidityTokenProcessEvent(res.data.bcs.type)) {
3355
+ throw new Error("object at id ".concat(id, " is not a StartRemoveLiquidityTokenProcessEvent object"));
3356
+ }
3357
+ return [2 /*return*/, StartRemoveLiquidityTokenProcessEvent.fromSuiObjectData(res.data)];
3358
+ }
3359
+ });
3360
+ });
3361
+ };
3362
+ StartRemoveLiquidityTokenProcessEvent.$typeName = "".concat(index_1.PKG_V1, "::lp_pool::StartRemoveLiquidityTokenProcessEvent");
3363
+ StartRemoveLiquidityTokenProcessEvent.$numTypeParams = 0;
3364
+ StartRemoveLiquidityTokenProcessEvent.$isPhantom = [];
3365
+ return StartRemoveLiquidityTokenProcessEvent;
3366
+ }());
3367
+ exports.StartRemoveLiquidityTokenProcessEvent = StartRemoveLiquidityTokenProcessEvent;
3368
+ /* ============================== SuspendPoolEvent =============================== */
3369
+ function isSuspendPoolEvent(type) {
3370
+ type = (0, util_1.compressSuiType)(type);
3371
+ return type === "".concat(index_1.PKG_V1, "::lp_pool::SuspendPoolEvent");
3372
+ }
3373
+ var SuspendPoolEvent = /** @class */ (function () {
3374
+ function SuspendPoolEvent(typeArgs, fields) {
3375
+ this.__StructClass = true;
3376
+ this.$typeName = SuspendPoolEvent.$typeName;
3377
+ this.$isPhantom = SuspendPoolEvent.$isPhantom;
3378
+ this.$fullTypeName = util_1.composeSuiType.apply(void 0, __spreadArray([SuspendPoolEvent.$typeName], __read(typeArgs), false));
3379
+ this.$typeArgs = typeArgs;
3380
+ this.sender = fields.sender;
3381
+ this.index = fields.index;
3382
+ this.u64Padding = fields.u64Padding;
3383
+ }
3384
+ SuspendPoolEvent.reified = function () {
3385
+ var _this = this;
3386
+ return {
3387
+ typeName: SuspendPoolEvent.$typeName,
3388
+ fullTypeName: util_1.composeSuiType.apply(void 0, __spreadArray([SuspendPoolEvent.$typeName], [], false)),
3389
+ typeArgs: [],
3390
+ isPhantom: SuspendPoolEvent.$isPhantom,
3391
+ reifiedTypeArgs: [],
3392
+ fromFields: function (fields) { return SuspendPoolEvent.fromFields(fields); },
3393
+ fromFieldsWithTypes: function (item) { return SuspendPoolEvent.fromFieldsWithTypes(item); },
3394
+ fromBcs: function (data) { return SuspendPoolEvent.fromBcs(data); },
3395
+ bcs: SuspendPoolEvent.bcs,
3396
+ fromJSONField: function (field) { return SuspendPoolEvent.fromJSONField(field); },
3397
+ fromJSON: function (json) { return SuspendPoolEvent.fromJSON(json); },
3398
+ fromSuiParsedData: function (content) { return SuspendPoolEvent.fromSuiParsedData(content); },
3399
+ fromSuiObjectData: function (content) { return SuspendPoolEvent.fromSuiObjectData(content); },
3400
+ fetch: function (client, id) { return __awaiter(_this, void 0, void 0, function () { return __generator(this, function (_a) {
3401
+ return [2 /*return*/, SuspendPoolEvent.fetch(client, id)];
3402
+ }); }); },
3403
+ new: function (fields) {
3404
+ return new SuspendPoolEvent([], fields);
3405
+ },
3406
+ kind: "StructClassReified",
3407
+ };
3408
+ };
3409
+ Object.defineProperty(SuspendPoolEvent, "r", {
3410
+ get: function () {
3411
+ return SuspendPoolEvent.reified();
3412
+ },
3413
+ enumerable: false,
3414
+ configurable: true
3415
+ });
3416
+ SuspendPoolEvent.phantom = function () {
3417
+ return (0, reified_1.phantom)(SuspendPoolEvent.reified());
3418
+ };
3419
+ Object.defineProperty(SuspendPoolEvent, "p", {
3420
+ get: function () {
3421
+ return SuspendPoolEvent.phantom();
3422
+ },
3423
+ enumerable: false,
3424
+ configurable: true
3425
+ });
3426
+ Object.defineProperty(SuspendPoolEvent, "bcs", {
3427
+ get: function () {
3428
+ return bcs_1.bcs.struct("SuspendPoolEvent", {
3429
+ sender: bcs_1.bcs.bytes(32).transform({ input: function (val) { return (0, utils_1.fromHEX)(val); }, output: function (val) { return (0, utils_1.toHEX)(val); } }),
3430
+ index: bcs_1.bcs.u64(),
3431
+ u64_padding: bcs_1.bcs.vector(bcs_1.bcs.u64()),
3432
+ });
3433
+ },
3434
+ enumerable: false,
3435
+ configurable: true
3436
+ });
3437
+ SuspendPoolEvent.fromFields = function (fields) {
3438
+ return SuspendPoolEvent.reified().new({
3439
+ sender: (0, reified_1.decodeFromFields)("address", fields.sender),
3440
+ index: (0, reified_1.decodeFromFields)("u64", fields.index),
3441
+ u64Padding: (0, reified_1.decodeFromFields)(reified.vector("u64"), fields.u64_padding),
3442
+ });
3443
+ };
3444
+ SuspendPoolEvent.fromFieldsWithTypes = function (item) {
3445
+ if (!isSuspendPoolEvent(item.type)) {
3446
+ throw new Error("not a SuspendPoolEvent type");
3447
+ }
3448
+ return SuspendPoolEvent.reified().new({
3449
+ sender: (0, reified_1.decodeFromFieldsWithTypes)("address", item.fields.sender),
3450
+ index: (0, reified_1.decodeFromFieldsWithTypes)("u64", item.fields.index),
3451
+ u64Padding: (0, reified_1.decodeFromFieldsWithTypes)(reified.vector("u64"), item.fields.u64_padding),
3452
+ });
3453
+ };
3454
+ SuspendPoolEvent.fromBcs = function (data) {
3455
+ return SuspendPoolEvent.fromFields(SuspendPoolEvent.bcs.parse(data));
3456
+ };
3457
+ SuspendPoolEvent.prototype.toJSONField = function () {
3458
+ return {
3459
+ sender: this.sender,
3460
+ index: this.index.toString(),
3461
+ u64Padding: (0, reified_1.fieldToJSON)("vector<u64>", this.u64Padding),
3462
+ };
3463
+ };
3464
+ SuspendPoolEvent.prototype.toJSON = function () {
3465
+ return __assign({ $typeName: this.$typeName, $typeArgs: this.$typeArgs }, this.toJSONField());
3466
+ };
3467
+ SuspendPoolEvent.fromJSONField = function (field) {
3468
+ return SuspendPoolEvent.reified().new({
3469
+ sender: (0, reified_1.decodeFromJSONField)("address", field.sender),
3470
+ index: (0, reified_1.decodeFromJSONField)("u64", field.index),
3471
+ u64Padding: (0, reified_1.decodeFromJSONField)(reified.vector("u64"), field.u64Padding),
3472
+ });
3473
+ };
3474
+ SuspendPoolEvent.fromJSON = function (json) {
3475
+ if (json.$typeName !== SuspendPoolEvent.$typeName) {
3476
+ throw new Error("not a WithTwoGenerics json object");
3477
+ }
3478
+ return SuspendPoolEvent.fromJSONField(json);
3479
+ };
3480
+ SuspendPoolEvent.fromSuiParsedData = function (content) {
3481
+ if (content.dataType !== "moveObject") {
3482
+ throw new Error("not an object");
3483
+ }
3484
+ if (!isSuspendPoolEvent(content.type)) {
3485
+ throw new Error("object at ".concat(content.fields.id, " is not a SuspendPoolEvent object"));
3486
+ }
3487
+ return SuspendPoolEvent.fromFieldsWithTypes(content);
3488
+ };
3489
+ SuspendPoolEvent.fromSuiObjectData = function (data) {
3490
+ if (data.bcs) {
3491
+ if (data.bcs.dataType !== "moveObject" || !isSuspendPoolEvent(data.bcs.type)) {
3492
+ throw new Error("object at is not a SuspendPoolEvent object");
3493
+ }
3494
+ return SuspendPoolEvent.fromBcs((0, utils_1.fromB64)(data.bcs.bcsBytes));
3495
+ }
3496
+ if (data.content) {
3497
+ return SuspendPoolEvent.fromSuiParsedData(data.content);
3498
+ }
3499
+ throw new Error("Both `bcs` and `content` fields are missing from the data. Include `showBcs` or `showContent` in the request.");
3500
+ };
3501
+ SuspendPoolEvent.fetch = function (client, id) {
3502
+ return __awaiter(this, void 0, void 0, function () {
3503
+ var res;
3504
+ var _a, _b;
3505
+ return __generator(this, function (_c) {
3506
+ switch (_c.label) {
3507
+ case 0: return [4 /*yield*/, client.getObject({ id: id, options: { showBcs: true } })];
3508
+ case 1:
3509
+ res = _c.sent();
3510
+ if (res.error) {
3511
+ throw new Error("error fetching SuspendPoolEvent object at id ".concat(id, ": ").concat(res.error.code));
3512
+ }
3513
+ if (((_b = (_a = res.data) === null || _a === void 0 ? void 0 : _a.bcs) === null || _b === void 0 ? void 0 : _b.dataType) !== "moveObject" || !isSuspendPoolEvent(res.data.bcs.type)) {
3514
+ throw new Error("object at id ".concat(id, " is not a SuspendPoolEvent object"));
3515
+ }
3516
+ return [2 /*return*/, SuspendPoolEvent.fromSuiObjectData(res.data)];
3517
+ }
3518
+ });
3519
+ });
3520
+ };
3521
+ SuspendPoolEvent.$typeName = "".concat(index_1.PKG_V1, "::lp_pool::SuspendPoolEvent");
3522
+ SuspendPoolEvent.$numTypeParams = 0;
3523
+ SuspendPoolEvent.$isPhantom = [];
3524
+ return SuspendPoolEvent;
3525
+ }());
3526
+ exports.SuspendPoolEvent = SuspendPoolEvent;
3527
+ /* ============================== SuspendTokenPoolEvent =============================== */
3528
+ function isSuspendTokenPoolEvent(type) {
3529
+ type = (0, util_1.compressSuiType)(type);
3530
+ return type === "".concat(index_1.PKG_V1, "::lp_pool::SuspendTokenPoolEvent");
3531
+ }
3532
+ var SuspendTokenPoolEvent = /** @class */ (function () {
3533
+ function SuspendTokenPoolEvent(typeArgs, fields) {
3534
+ this.__StructClass = true;
3535
+ this.$typeName = SuspendTokenPoolEvent.$typeName;
3536
+ this.$isPhantom = SuspendTokenPoolEvent.$isPhantom;
3537
+ this.$fullTypeName = util_1.composeSuiType.apply(void 0, __spreadArray([SuspendTokenPoolEvent.$typeName], __read(typeArgs), false));
3538
+ this.$typeArgs = typeArgs;
3539
+ this.sender = fields.sender;
3540
+ this.index = fields.index;
3541
+ this.liquidityToken = fields.liquidityToken;
3542
+ this.u64Padding = fields.u64Padding;
3543
+ }
3544
+ SuspendTokenPoolEvent.reified = function () {
3545
+ var _this = this;
3546
+ return {
3547
+ typeName: SuspendTokenPoolEvent.$typeName,
3548
+ fullTypeName: util_1.composeSuiType.apply(void 0, __spreadArray([SuspendTokenPoolEvent.$typeName], [], false)),
3549
+ typeArgs: [],
3550
+ isPhantom: SuspendTokenPoolEvent.$isPhantom,
3551
+ reifiedTypeArgs: [],
3552
+ fromFields: function (fields) { return SuspendTokenPoolEvent.fromFields(fields); },
3553
+ fromFieldsWithTypes: function (item) { return SuspendTokenPoolEvent.fromFieldsWithTypes(item); },
3554
+ fromBcs: function (data) { return SuspendTokenPoolEvent.fromBcs(data); },
3555
+ bcs: SuspendTokenPoolEvent.bcs,
3556
+ fromJSONField: function (field) { return SuspendTokenPoolEvent.fromJSONField(field); },
3557
+ fromJSON: function (json) { return SuspendTokenPoolEvent.fromJSON(json); },
3558
+ fromSuiParsedData: function (content) { return SuspendTokenPoolEvent.fromSuiParsedData(content); },
3559
+ fromSuiObjectData: function (content) { return SuspendTokenPoolEvent.fromSuiObjectData(content); },
3560
+ fetch: function (client, id) { return __awaiter(_this, void 0, void 0, function () { return __generator(this, function (_a) {
3561
+ return [2 /*return*/, SuspendTokenPoolEvent.fetch(client, id)];
3562
+ }); }); },
3563
+ new: function (fields) {
3564
+ return new SuspendTokenPoolEvent([], fields);
3565
+ },
3566
+ kind: "StructClassReified",
3567
+ };
3568
+ };
3569
+ Object.defineProperty(SuspendTokenPoolEvent, "r", {
3570
+ get: function () {
3571
+ return SuspendTokenPoolEvent.reified();
3572
+ },
3573
+ enumerable: false,
3574
+ configurable: true
3575
+ });
3576
+ SuspendTokenPoolEvent.phantom = function () {
3577
+ return (0, reified_1.phantom)(SuspendTokenPoolEvent.reified());
3578
+ };
3579
+ Object.defineProperty(SuspendTokenPoolEvent, "p", {
3580
+ get: function () {
3581
+ return SuspendTokenPoolEvent.phantom();
3582
+ },
3583
+ enumerable: false,
3584
+ configurable: true
3585
+ });
3586
+ Object.defineProperty(SuspendTokenPoolEvent, "bcs", {
3587
+ get: function () {
3588
+ return bcs_1.bcs.struct("SuspendTokenPoolEvent", {
3589
+ sender: bcs_1.bcs.bytes(32).transform({ input: function (val) { return (0, utils_1.fromHEX)(val); }, output: function (val) { return (0, utils_1.toHEX)(val); } }),
3590
+ index: bcs_1.bcs.u64(),
3591
+ liquidity_token: structs_1.TypeName.bcs,
3592
+ u64_padding: bcs_1.bcs.vector(bcs_1.bcs.u64()),
3593
+ });
3594
+ },
3595
+ enumerable: false,
3596
+ configurable: true
3597
+ });
3598
+ SuspendTokenPoolEvent.fromFields = function (fields) {
3599
+ return SuspendTokenPoolEvent.reified().new({
3600
+ sender: (0, reified_1.decodeFromFields)("address", fields.sender),
3601
+ index: (0, reified_1.decodeFromFields)("u64", fields.index),
3602
+ liquidityToken: (0, reified_1.decodeFromFields)(structs_1.TypeName.reified(), fields.liquidity_token),
3603
+ u64Padding: (0, reified_1.decodeFromFields)(reified.vector("u64"), fields.u64_padding),
3604
+ });
3605
+ };
3606
+ SuspendTokenPoolEvent.fromFieldsWithTypes = function (item) {
3607
+ if (!isSuspendTokenPoolEvent(item.type)) {
3608
+ throw new Error("not a SuspendTokenPoolEvent type");
3609
+ }
3610
+ return SuspendTokenPoolEvent.reified().new({
3611
+ sender: (0, reified_1.decodeFromFieldsWithTypes)("address", item.fields.sender),
3612
+ index: (0, reified_1.decodeFromFieldsWithTypes)("u64", item.fields.index),
3613
+ liquidityToken: (0, reified_1.decodeFromFieldsWithTypes)(structs_1.TypeName.reified(), item.fields.liquidity_token),
3614
+ u64Padding: (0, reified_1.decodeFromFieldsWithTypes)(reified.vector("u64"), item.fields.u64_padding),
3615
+ });
3616
+ };
3617
+ SuspendTokenPoolEvent.fromBcs = function (data) {
3618
+ return SuspendTokenPoolEvent.fromFields(SuspendTokenPoolEvent.bcs.parse(data));
3619
+ };
3620
+ SuspendTokenPoolEvent.prototype.toJSONField = function () {
3621
+ return {
3622
+ sender: this.sender,
3623
+ index: this.index.toString(),
3624
+ liquidityToken: this.liquidityToken.toJSONField(),
3625
+ u64Padding: (0, reified_1.fieldToJSON)("vector<u64>", this.u64Padding),
3626
+ };
3627
+ };
3628
+ SuspendTokenPoolEvent.prototype.toJSON = function () {
3629
+ return __assign({ $typeName: this.$typeName, $typeArgs: this.$typeArgs }, this.toJSONField());
3630
+ };
3631
+ SuspendTokenPoolEvent.fromJSONField = function (field) {
3632
+ return SuspendTokenPoolEvent.reified().new({
3633
+ sender: (0, reified_1.decodeFromJSONField)("address", field.sender),
3634
+ index: (0, reified_1.decodeFromJSONField)("u64", field.index),
3635
+ liquidityToken: (0, reified_1.decodeFromJSONField)(structs_1.TypeName.reified(), field.liquidityToken),
3636
+ u64Padding: (0, reified_1.decodeFromJSONField)(reified.vector("u64"), field.u64Padding),
3637
+ });
3638
+ };
3639
+ SuspendTokenPoolEvent.fromJSON = function (json) {
3640
+ if (json.$typeName !== SuspendTokenPoolEvent.$typeName) {
3641
+ throw new Error("not a WithTwoGenerics json object");
3642
+ }
3643
+ return SuspendTokenPoolEvent.fromJSONField(json);
3644
+ };
3645
+ SuspendTokenPoolEvent.fromSuiParsedData = function (content) {
3646
+ if (content.dataType !== "moveObject") {
3647
+ throw new Error("not an object");
3648
+ }
3649
+ if (!isSuspendTokenPoolEvent(content.type)) {
3650
+ throw new Error("object at ".concat(content.fields.id, " is not a SuspendTokenPoolEvent object"));
3651
+ }
3652
+ return SuspendTokenPoolEvent.fromFieldsWithTypes(content);
3653
+ };
3654
+ SuspendTokenPoolEvent.fromSuiObjectData = function (data) {
3655
+ if (data.bcs) {
3656
+ if (data.bcs.dataType !== "moveObject" || !isSuspendTokenPoolEvent(data.bcs.type)) {
3657
+ throw new Error("object at is not a SuspendTokenPoolEvent object");
3658
+ }
3659
+ return SuspendTokenPoolEvent.fromBcs((0, utils_1.fromB64)(data.bcs.bcsBytes));
3660
+ }
3661
+ if (data.content) {
3662
+ return SuspendTokenPoolEvent.fromSuiParsedData(data.content);
3663
+ }
3664
+ throw new Error("Both `bcs` and `content` fields are missing from the data. Include `showBcs` or `showContent` in the request.");
3665
+ };
3666
+ SuspendTokenPoolEvent.fetch = function (client, id) {
3667
+ return __awaiter(this, void 0, void 0, function () {
3668
+ var res;
3669
+ var _a, _b;
3670
+ return __generator(this, function (_c) {
3671
+ switch (_c.label) {
3672
+ case 0: return [4 /*yield*/, client.getObject({ id: id, options: { showBcs: true } })];
3673
+ case 1:
3674
+ res = _c.sent();
3675
+ if (res.error) {
3676
+ throw new Error("error fetching SuspendTokenPoolEvent object at id ".concat(id, ": ").concat(res.error.code));
3677
+ }
3678
+ if (((_b = (_a = res.data) === null || _a === void 0 ? void 0 : _a.bcs) === null || _b === void 0 ? void 0 : _b.dataType) !== "moveObject" || !isSuspendTokenPoolEvent(res.data.bcs.type)) {
3679
+ throw new Error("object at id ".concat(id, " is not a SuspendTokenPoolEvent object"));
3680
+ }
3681
+ return [2 /*return*/, SuspendTokenPoolEvent.fromSuiObjectData(res.data)];
3682
+ }
3683
+ });
3684
+ });
3685
+ };
3686
+ SuspendTokenPoolEvent.$typeName = "".concat(index_1.PKG_V1, "::lp_pool::SuspendTokenPoolEvent");
3687
+ SuspendTokenPoolEvent.$numTypeParams = 0;
3688
+ SuspendTokenPoolEvent.$isPhantom = [];
3689
+ return SuspendTokenPoolEvent;
3690
+ }());
3691
+ exports.SuspendTokenPoolEvent = SuspendTokenPoolEvent;
3692
+ /* ============================== SwapEvent =============================== */
3693
+ function isSwapEvent(type) {
3694
+ type = (0, util_1.compressSuiType)(type);
3695
+ return type === "".concat(index_1.PKG_V1, "::lp_pool::SwapEvent");
3696
+ }
3697
+ var SwapEvent = /** @class */ (function () {
3698
+ function SwapEvent(typeArgs, fields) {
3699
+ this.__StructClass = true;
3700
+ this.$typeName = SwapEvent.$typeName;
3701
+ this.$isPhantom = SwapEvent.$isPhantom;
3702
+ this.$fullTypeName = util_1.composeSuiType.apply(void 0, __spreadArray([SwapEvent.$typeName], __read(typeArgs), false));
3703
+ this.$typeArgs = typeArgs;
3704
+ this.sender = fields.sender;
3705
+ this.index = fields.index;
3706
+ this.fromTokenType = fields.fromTokenType;
3707
+ this.fromAmount = fields.fromAmount;
3708
+ this.toTokenType = fields.toTokenType;
3709
+ this.minToAmount = fields.minToAmount;
3710
+ this.actualToAmount = fields.actualToAmount;
3711
+ this.feeAmount = fields.feeAmount;
3712
+ this.feeAmountUsd = fields.feeAmountUsd;
3713
+ this.oraclePriceFromToken = fields.oraclePriceFromToken;
3714
+ this.oraclePriceToToken = fields.oraclePriceToToken;
3715
+ this.u64Padding = fields.u64Padding;
3716
+ }
3717
+ SwapEvent.reified = function () {
3718
+ var _this = this;
3719
+ return {
3720
+ typeName: SwapEvent.$typeName,
3721
+ fullTypeName: util_1.composeSuiType.apply(void 0, __spreadArray([SwapEvent.$typeName], [], false)),
3722
+ typeArgs: [],
3723
+ isPhantom: SwapEvent.$isPhantom,
3724
+ reifiedTypeArgs: [],
3725
+ fromFields: function (fields) { return SwapEvent.fromFields(fields); },
3726
+ fromFieldsWithTypes: function (item) { return SwapEvent.fromFieldsWithTypes(item); },
3727
+ fromBcs: function (data) { return SwapEvent.fromBcs(data); },
3728
+ bcs: SwapEvent.bcs,
3729
+ fromJSONField: function (field) { return SwapEvent.fromJSONField(field); },
3730
+ fromJSON: function (json) { return SwapEvent.fromJSON(json); },
3731
+ fromSuiParsedData: function (content) { return SwapEvent.fromSuiParsedData(content); },
3732
+ fromSuiObjectData: function (content) { return SwapEvent.fromSuiObjectData(content); },
3733
+ fetch: function (client, id) { return __awaiter(_this, void 0, void 0, function () { return __generator(this, function (_a) {
3734
+ return [2 /*return*/, SwapEvent.fetch(client, id)];
3735
+ }); }); },
3736
+ new: function (fields) {
3737
+ return new SwapEvent([], fields);
3738
+ },
3739
+ kind: "StructClassReified",
3740
+ };
3741
+ };
3742
+ Object.defineProperty(SwapEvent, "r", {
3743
+ get: function () {
3744
+ return SwapEvent.reified();
3745
+ },
3746
+ enumerable: false,
3747
+ configurable: true
3748
+ });
3749
+ SwapEvent.phantom = function () {
3750
+ return (0, reified_1.phantom)(SwapEvent.reified());
3751
+ };
3752
+ Object.defineProperty(SwapEvent, "p", {
3753
+ get: function () {
3754
+ return SwapEvent.phantom();
3755
+ },
3756
+ enumerable: false,
3757
+ configurable: true
3758
+ });
3759
+ Object.defineProperty(SwapEvent, "bcs", {
3760
+ get: function () {
3761
+ return bcs_1.bcs.struct("SwapEvent", {
3762
+ sender: bcs_1.bcs.bytes(32).transform({ input: function (val) { return (0, utils_1.fromHEX)(val); }, output: function (val) { return (0, utils_1.toHEX)(val); } }),
3763
+ index: bcs_1.bcs.u64(),
3764
+ from_token_type: structs_1.TypeName.bcs,
3765
+ from_amount: bcs_1.bcs.u64(),
3766
+ to_token_type: structs_1.TypeName.bcs,
3767
+ min_to_amount: bcs_1.bcs.u64(),
3768
+ actual_to_amount: bcs_1.bcs.u64(),
3769
+ fee_amount: bcs_1.bcs.u64(),
3770
+ fee_amount_usd: bcs_1.bcs.u64(),
3771
+ oracle_price_from_token: bcs_1.bcs.u64(),
3772
+ oracle_price_to_token: bcs_1.bcs.u64(),
3773
+ u64_padding: bcs_1.bcs.vector(bcs_1.bcs.u64()),
3774
+ });
3775
+ },
3776
+ enumerable: false,
3777
+ configurable: true
3778
+ });
3779
+ SwapEvent.fromFields = function (fields) {
3780
+ return SwapEvent.reified().new({
3781
+ sender: (0, reified_1.decodeFromFields)("address", fields.sender),
3782
+ index: (0, reified_1.decodeFromFields)("u64", fields.index),
3783
+ fromTokenType: (0, reified_1.decodeFromFields)(structs_1.TypeName.reified(), fields.from_token_type),
3784
+ fromAmount: (0, reified_1.decodeFromFields)("u64", fields.from_amount),
3785
+ toTokenType: (0, reified_1.decodeFromFields)(structs_1.TypeName.reified(), fields.to_token_type),
3786
+ minToAmount: (0, reified_1.decodeFromFields)("u64", fields.min_to_amount),
3787
+ actualToAmount: (0, reified_1.decodeFromFields)("u64", fields.actual_to_amount),
3788
+ feeAmount: (0, reified_1.decodeFromFields)("u64", fields.fee_amount),
3789
+ feeAmountUsd: (0, reified_1.decodeFromFields)("u64", fields.fee_amount_usd),
3790
+ oraclePriceFromToken: (0, reified_1.decodeFromFields)("u64", fields.oracle_price_from_token),
3791
+ oraclePriceToToken: (0, reified_1.decodeFromFields)("u64", fields.oracle_price_to_token),
3792
+ u64Padding: (0, reified_1.decodeFromFields)(reified.vector("u64"), fields.u64_padding),
3793
+ });
3794
+ };
3795
+ SwapEvent.fromFieldsWithTypes = function (item) {
3796
+ if (!isSwapEvent(item.type)) {
3797
+ throw new Error("not a SwapEvent type");
3798
+ }
3799
+ return SwapEvent.reified().new({
3800
+ sender: (0, reified_1.decodeFromFieldsWithTypes)("address", item.fields.sender),
3801
+ index: (0, reified_1.decodeFromFieldsWithTypes)("u64", item.fields.index),
3802
+ fromTokenType: (0, reified_1.decodeFromFieldsWithTypes)(structs_1.TypeName.reified(), item.fields.from_token_type),
3803
+ fromAmount: (0, reified_1.decodeFromFieldsWithTypes)("u64", item.fields.from_amount),
3804
+ toTokenType: (0, reified_1.decodeFromFieldsWithTypes)(structs_1.TypeName.reified(), item.fields.to_token_type),
3805
+ minToAmount: (0, reified_1.decodeFromFieldsWithTypes)("u64", item.fields.min_to_amount),
3806
+ actualToAmount: (0, reified_1.decodeFromFieldsWithTypes)("u64", item.fields.actual_to_amount),
3807
+ feeAmount: (0, reified_1.decodeFromFieldsWithTypes)("u64", item.fields.fee_amount),
3808
+ feeAmountUsd: (0, reified_1.decodeFromFieldsWithTypes)("u64", item.fields.fee_amount_usd),
3809
+ oraclePriceFromToken: (0, reified_1.decodeFromFieldsWithTypes)("u64", item.fields.oracle_price_from_token),
3810
+ oraclePriceToToken: (0, reified_1.decodeFromFieldsWithTypes)("u64", item.fields.oracle_price_to_token),
3811
+ u64Padding: (0, reified_1.decodeFromFieldsWithTypes)(reified.vector("u64"), item.fields.u64_padding),
3812
+ });
3813
+ };
3814
+ SwapEvent.fromBcs = function (data) {
3815
+ return SwapEvent.fromFields(SwapEvent.bcs.parse(data));
3816
+ };
3817
+ SwapEvent.prototype.toJSONField = function () {
3818
+ return {
3819
+ sender: this.sender,
3820
+ index: this.index.toString(),
3821
+ fromTokenType: this.fromTokenType.toJSONField(),
3822
+ fromAmount: this.fromAmount.toString(),
3823
+ toTokenType: this.toTokenType.toJSONField(),
3824
+ minToAmount: this.minToAmount.toString(),
3825
+ actualToAmount: this.actualToAmount.toString(),
3826
+ feeAmount: this.feeAmount.toString(),
3827
+ feeAmountUsd: this.feeAmountUsd.toString(),
3828
+ oraclePriceFromToken: this.oraclePriceFromToken.toString(),
3829
+ oraclePriceToToken: this.oraclePriceToToken.toString(),
3830
+ u64Padding: (0, reified_1.fieldToJSON)("vector<u64>", this.u64Padding),
3831
+ };
3832
+ };
3833
+ SwapEvent.prototype.toJSON = function () {
3834
+ return __assign({ $typeName: this.$typeName, $typeArgs: this.$typeArgs }, this.toJSONField());
3835
+ };
3836
+ SwapEvent.fromJSONField = function (field) {
3837
+ return SwapEvent.reified().new({
3838
+ sender: (0, reified_1.decodeFromJSONField)("address", field.sender),
3839
+ index: (0, reified_1.decodeFromJSONField)("u64", field.index),
3840
+ fromTokenType: (0, reified_1.decodeFromJSONField)(structs_1.TypeName.reified(), field.fromTokenType),
3841
+ fromAmount: (0, reified_1.decodeFromJSONField)("u64", field.fromAmount),
3842
+ toTokenType: (0, reified_1.decodeFromJSONField)(structs_1.TypeName.reified(), field.toTokenType),
3843
+ minToAmount: (0, reified_1.decodeFromJSONField)("u64", field.minToAmount),
3844
+ actualToAmount: (0, reified_1.decodeFromJSONField)("u64", field.actualToAmount),
3845
+ feeAmount: (0, reified_1.decodeFromJSONField)("u64", field.feeAmount),
3846
+ feeAmountUsd: (0, reified_1.decodeFromJSONField)("u64", field.feeAmountUsd),
3847
+ oraclePriceFromToken: (0, reified_1.decodeFromJSONField)("u64", field.oraclePriceFromToken),
3848
+ oraclePriceToToken: (0, reified_1.decodeFromJSONField)("u64", field.oraclePriceToToken),
3849
+ u64Padding: (0, reified_1.decodeFromJSONField)(reified.vector("u64"), field.u64Padding),
3850
+ });
3851
+ };
3852
+ SwapEvent.fromJSON = function (json) {
3853
+ if (json.$typeName !== SwapEvent.$typeName) {
3854
+ throw new Error("not a WithTwoGenerics json object");
3855
+ }
3856
+ return SwapEvent.fromJSONField(json);
3857
+ };
3858
+ SwapEvent.fromSuiParsedData = function (content) {
3859
+ if (content.dataType !== "moveObject") {
3860
+ throw new Error("not an object");
3861
+ }
3862
+ if (!isSwapEvent(content.type)) {
3863
+ throw new Error("object at ".concat(content.fields.id, " is not a SwapEvent object"));
3864
+ }
3865
+ return SwapEvent.fromFieldsWithTypes(content);
3866
+ };
3867
+ SwapEvent.fromSuiObjectData = function (data) {
3868
+ if (data.bcs) {
3869
+ if (data.bcs.dataType !== "moveObject" || !isSwapEvent(data.bcs.type)) {
3870
+ throw new Error("object at is not a SwapEvent object");
3871
+ }
3872
+ return SwapEvent.fromBcs((0, utils_1.fromB64)(data.bcs.bcsBytes));
3873
+ }
3874
+ if (data.content) {
3875
+ return SwapEvent.fromSuiParsedData(data.content);
3876
+ }
3877
+ throw new Error("Both `bcs` and `content` fields are missing from the data. Include `showBcs` or `showContent` in the request.");
3878
+ };
3879
+ SwapEvent.fetch = function (client, id) {
3880
+ return __awaiter(this, void 0, void 0, function () {
3881
+ var res;
3882
+ var _a, _b;
3883
+ return __generator(this, function (_c) {
3884
+ switch (_c.label) {
3885
+ case 0: return [4 /*yield*/, client.getObject({ id: id, options: { showBcs: true } })];
3886
+ case 1:
3887
+ res = _c.sent();
3888
+ if (res.error) {
3889
+ throw new Error("error fetching SwapEvent object at id ".concat(id, ": ").concat(res.error.code));
3890
+ }
3891
+ if (((_b = (_a = res.data) === null || _a === void 0 ? void 0 : _a.bcs) === null || _b === void 0 ? void 0 : _b.dataType) !== "moveObject" || !isSwapEvent(res.data.bcs.type)) {
3892
+ throw new Error("object at id ".concat(id, " is not a SwapEvent object"));
3893
+ }
3894
+ return [2 /*return*/, SwapEvent.fromSuiObjectData(res.data)];
3895
+ }
3896
+ });
3897
+ });
3898
+ };
3899
+ SwapEvent.$typeName = "".concat(index_1.PKG_V1, "::lp_pool::SwapEvent");
3900
+ SwapEvent.$numTypeParams = 0;
3901
+ SwapEvent.$isPhantom = [];
3902
+ return SwapEvent;
3903
+ }());
3904
+ exports.SwapEvent = SwapEvent;
3905
+ /* ============================== TokenPool =============================== */
3906
+ function isTokenPool(type) {
3907
+ type = (0, util_1.compressSuiType)(type);
3908
+ return type === "".concat(index_1.PKG_V1, "::lp_pool::TokenPool");
3909
+ }
3910
+ var TokenPool = /** @class */ (function () {
3911
+ function TokenPool(typeArgs, fields) {
3912
+ this.__StructClass = true;
3913
+ this.$typeName = TokenPool.$typeName;
3914
+ this.$isPhantom = TokenPool.$isPhantom;
3915
+ this.$fullTypeName = util_1.composeSuiType.apply(void 0, __spreadArray([TokenPool.$typeName], __read(typeArgs), false));
3916
+ this.$typeArgs = typeArgs;
3917
+ this.tokenType = fields.tokenType;
3918
+ this.config = fields.config;
3919
+ this.state = fields.state;
3920
+ }
3921
+ TokenPool.reified = function () {
3922
+ var _this = this;
3923
+ return {
3924
+ typeName: TokenPool.$typeName,
3925
+ fullTypeName: util_1.composeSuiType.apply(void 0, __spreadArray([TokenPool.$typeName], [], false)),
3926
+ typeArgs: [],
3927
+ isPhantom: TokenPool.$isPhantom,
3928
+ reifiedTypeArgs: [],
3929
+ fromFields: function (fields) { return TokenPool.fromFields(fields); },
3930
+ fromFieldsWithTypes: function (item) { return TokenPool.fromFieldsWithTypes(item); },
3931
+ fromBcs: function (data) { return TokenPool.fromBcs(data); },
3932
+ bcs: TokenPool.bcs,
3933
+ fromJSONField: function (field) { return TokenPool.fromJSONField(field); },
3934
+ fromJSON: function (json) { return TokenPool.fromJSON(json); },
3935
+ fromSuiParsedData: function (content) { return TokenPool.fromSuiParsedData(content); },
3936
+ fromSuiObjectData: function (content) { return TokenPool.fromSuiObjectData(content); },
3937
+ fetch: function (client, id) { return __awaiter(_this, void 0, void 0, function () { return __generator(this, function (_a) {
3938
+ return [2 /*return*/, TokenPool.fetch(client, id)];
3939
+ }); }); },
3940
+ new: function (fields) {
3941
+ return new TokenPool([], fields);
3942
+ },
3943
+ kind: "StructClassReified",
3944
+ };
3945
+ };
3946
+ Object.defineProperty(TokenPool, "r", {
3947
+ get: function () {
3948
+ return TokenPool.reified();
3949
+ },
3950
+ enumerable: false,
3951
+ configurable: true
3952
+ });
3953
+ TokenPool.phantom = function () {
3954
+ return (0, reified_1.phantom)(TokenPool.reified());
3955
+ };
3956
+ Object.defineProperty(TokenPool, "p", {
3957
+ get: function () {
3958
+ return TokenPool.phantom();
3959
+ },
3960
+ enumerable: false,
3961
+ configurable: true
3962
+ });
3963
+ Object.defineProperty(TokenPool, "bcs", {
3964
+ get: function () {
3965
+ return bcs_1.bcs.struct("TokenPool", {
3966
+ token_type: structs_1.TypeName.bcs,
3967
+ config: Config.bcs,
3968
+ state: State.bcs,
3969
+ });
3970
+ },
3971
+ enumerable: false,
3972
+ configurable: true
3973
+ });
3974
+ TokenPool.fromFields = function (fields) {
3975
+ return TokenPool.reified().new({
3976
+ tokenType: (0, reified_1.decodeFromFields)(structs_1.TypeName.reified(), fields.token_type),
3977
+ config: (0, reified_1.decodeFromFields)(Config.reified(), fields.config),
3978
+ state: (0, reified_1.decodeFromFields)(State.reified(), fields.state),
3979
+ });
3980
+ };
3981
+ TokenPool.fromFieldsWithTypes = function (item) {
3982
+ if (!isTokenPool(item.type)) {
3983
+ throw new Error("not a TokenPool type");
3984
+ }
3985
+ return TokenPool.reified().new({
3986
+ tokenType: (0, reified_1.decodeFromFieldsWithTypes)(structs_1.TypeName.reified(), item.fields.token_type),
3987
+ config: (0, reified_1.decodeFromFieldsWithTypes)(Config.reified(), item.fields.config),
3988
+ state: (0, reified_1.decodeFromFieldsWithTypes)(State.reified(), item.fields.state),
3989
+ });
3990
+ };
3991
+ TokenPool.fromBcs = function (data) {
3992
+ return TokenPool.fromFields(TokenPool.bcs.parse(data));
3993
+ };
3994
+ TokenPool.prototype.toJSONField = function () {
3995
+ return {
3996
+ tokenType: this.tokenType.toJSONField(),
3997
+ config: this.config.toJSONField(),
3998
+ state: this.state.toJSONField(),
3999
+ };
4000
+ };
4001
+ TokenPool.prototype.toJSON = function () {
4002
+ return __assign({ $typeName: this.$typeName, $typeArgs: this.$typeArgs }, this.toJSONField());
4003
+ };
4004
+ TokenPool.fromJSONField = function (field) {
4005
+ return TokenPool.reified().new({
4006
+ tokenType: (0, reified_1.decodeFromJSONField)(structs_1.TypeName.reified(), field.tokenType),
4007
+ config: (0, reified_1.decodeFromJSONField)(Config.reified(), field.config),
4008
+ state: (0, reified_1.decodeFromJSONField)(State.reified(), field.state),
4009
+ });
4010
+ };
4011
+ TokenPool.fromJSON = function (json) {
4012
+ if (json.$typeName !== TokenPool.$typeName) {
4013
+ throw new Error("not a WithTwoGenerics json object");
4014
+ }
4015
+ return TokenPool.fromJSONField(json);
4016
+ };
4017
+ TokenPool.fromSuiParsedData = function (content) {
4018
+ if (content.dataType !== "moveObject") {
4019
+ throw new Error("not an object");
4020
+ }
4021
+ if (!isTokenPool(content.type)) {
4022
+ throw new Error("object at ".concat(content.fields.id, " is not a TokenPool object"));
4023
+ }
4024
+ return TokenPool.fromFieldsWithTypes(content);
4025
+ };
4026
+ TokenPool.fromSuiObjectData = function (data) {
4027
+ if (data.bcs) {
4028
+ if (data.bcs.dataType !== "moveObject" || !isTokenPool(data.bcs.type)) {
4029
+ throw new Error("object at is not a TokenPool object");
4030
+ }
4031
+ return TokenPool.fromBcs((0, utils_1.fromB64)(data.bcs.bcsBytes));
4032
+ }
4033
+ if (data.content) {
4034
+ return TokenPool.fromSuiParsedData(data.content);
4035
+ }
4036
+ throw new Error("Both `bcs` and `content` fields are missing from the data. Include `showBcs` or `showContent` in the request.");
4037
+ };
4038
+ TokenPool.fetch = function (client, id) {
4039
+ return __awaiter(this, void 0, void 0, function () {
4040
+ var res;
4041
+ var _a, _b;
4042
+ return __generator(this, function (_c) {
4043
+ switch (_c.label) {
4044
+ case 0: return [4 /*yield*/, client.getObject({ id: id, options: { showBcs: true } })];
4045
+ case 1:
4046
+ res = _c.sent();
4047
+ if (res.error) {
4048
+ throw new Error("error fetching TokenPool object at id ".concat(id, ": ").concat(res.error.code));
4049
+ }
4050
+ if (((_b = (_a = res.data) === null || _a === void 0 ? void 0 : _a.bcs) === null || _b === void 0 ? void 0 : _b.dataType) !== "moveObject" || !isTokenPool(res.data.bcs.type)) {
4051
+ throw new Error("object at id ".concat(id, " is not a TokenPool object"));
4052
+ }
4053
+ return [2 /*return*/, TokenPool.fromSuiObjectData(res.data)];
4054
+ }
4055
+ });
4056
+ });
4057
+ };
4058
+ TokenPool.$typeName = "".concat(index_1.PKG_V1, "::lp_pool::TokenPool");
4059
+ TokenPool.$numTypeParams = 0;
4060
+ TokenPool.$isPhantom = [];
4061
+ return TokenPool;
4062
+ }());
4063
+ exports.TokenPool = TokenPool;
4064
+ /* ============================== UpdateBorrowInfoEvent =============================== */
4065
+ function isUpdateBorrowInfoEvent(type) {
4066
+ type = (0, util_1.compressSuiType)(type);
4067
+ return type === "".concat(index_1.PKG_V1, "::lp_pool::UpdateBorrowInfoEvent");
4068
+ }
4069
+ var UpdateBorrowInfoEvent = /** @class */ (function () {
4070
+ function UpdateBorrowInfoEvent(typeArgs, fields) {
4071
+ this.__StructClass = true;
4072
+ this.$typeName = UpdateBorrowInfoEvent.$typeName;
4073
+ this.$isPhantom = UpdateBorrowInfoEvent.$isPhantom;
4074
+ this.$fullTypeName = util_1.composeSuiType.apply(void 0, __spreadArray([UpdateBorrowInfoEvent.$typeName], __read(typeArgs), false));
4075
+ this.$typeArgs = typeArgs;
4076
+ this.index = fields.index;
4077
+ this.liquidityTokenType = fields.liquidityTokenType;
4078
+ this.previousBorrowTsMs = fields.previousBorrowTsMs;
4079
+ this.previousCumulativeBorrowRate = fields.previousCumulativeBorrowRate;
4080
+ this.borrowIntervalTsMs = fields.borrowIntervalTsMs;
4081
+ this.lastBorrowRateTsMs = fields.lastBorrowRateTsMs;
4082
+ this.lastCumulativeBorrowRate = fields.lastCumulativeBorrowRate;
4083
+ this.u64Padding = fields.u64Padding;
4084
+ }
4085
+ UpdateBorrowInfoEvent.reified = function () {
4086
+ var _this = this;
4087
+ return {
4088
+ typeName: UpdateBorrowInfoEvent.$typeName,
4089
+ fullTypeName: util_1.composeSuiType.apply(void 0, __spreadArray([UpdateBorrowInfoEvent.$typeName], [], false)),
4090
+ typeArgs: [],
4091
+ isPhantom: UpdateBorrowInfoEvent.$isPhantom,
4092
+ reifiedTypeArgs: [],
4093
+ fromFields: function (fields) { return UpdateBorrowInfoEvent.fromFields(fields); },
4094
+ fromFieldsWithTypes: function (item) { return UpdateBorrowInfoEvent.fromFieldsWithTypes(item); },
4095
+ fromBcs: function (data) { return UpdateBorrowInfoEvent.fromBcs(data); },
4096
+ bcs: UpdateBorrowInfoEvent.bcs,
4097
+ fromJSONField: function (field) { return UpdateBorrowInfoEvent.fromJSONField(field); },
4098
+ fromJSON: function (json) { return UpdateBorrowInfoEvent.fromJSON(json); },
4099
+ fromSuiParsedData: function (content) { return UpdateBorrowInfoEvent.fromSuiParsedData(content); },
4100
+ fromSuiObjectData: function (content) { return UpdateBorrowInfoEvent.fromSuiObjectData(content); },
4101
+ fetch: function (client, id) { return __awaiter(_this, void 0, void 0, function () { return __generator(this, function (_a) {
4102
+ return [2 /*return*/, UpdateBorrowInfoEvent.fetch(client, id)];
4103
+ }); }); },
4104
+ new: function (fields) {
4105
+ return new UpdateBorrowInfoEvent([], fields);
4106
+ },
4107
+ kind: "StructClassReified",
4108
+ };
4109
+ };
4110
+ Object.defineProperty(UpdateBorrowInfoEvent, "r", {
4111
+ get: function () {
4112
+ return UpdateBorrowInfoEvent.reified();
4113
+ },
4114
+ enumerable: false,
4115
+ configurable: true
4116
+ });
4117
+ UpdateBorrowInfoEvent.phantom = function () {
4118
+ return (0, reified_1.phantom)(UpdateBorrowInfoEvent.reified());
4119
+ };
4120
+ Object.defineProperty(UpdateBorrowInfoEvent, "p", {
4121
+ get: function () {
4122
+ return UpdateBorrowInfoEvent.phantom();
4123
+ },
4124
+ enumerable: false,
4125
+ configurable: true
4126
+ });
4127
+ Object.defineProperty(UpdateBorrowInfoEvent, "bcs", {
4128
+ get: function () {
4129
+ return bcs_1.bcs.struct("UpdateBorrowInfoEvent", {
4130
+ index: bcs_1.bcs.u64(),
4131
+ liquidity_token_type: structs_1.TypeName.bcs,
4132
+ previous_borrow_ts_ms: bcs_1.bcs.u64(),
4133
+ previous_cumulative_borrow_rate: bcs_1.bcs.u64(),
4134
+ borrow_interval_ts_ms: bcs_1.bcs.u64(),
4135
+ last_borrow_rate_ts_ms: bcs_1.bcs.u64(),
4136
+ last_cumulative_borrow_rate: bcs_1.bcs.u64(),
4137
+ u64_padding: bcs_1.bcs.vector(bcs_1.bcs.u64()),
4138
+ });
4139
+ },
4140
+ enumerable: false,
4141
+ configurable: true
4142
+ });
4143
+ UpdateBorrowInfoEvent.fromFields = function (fields) {
4144
+ return UpdateBorrowInfoEvent.reified().new({
4145
+ index: (0, reified_1.decodeFromFields)("u64", fields.index),
4146
+ liquidityTokenType: (0, reified_1.decodeFromFields)(structs_1.TypeName.reified(), fields.liquidity_token_type),
4147
+ previousBorrowTsMs: (0, reified_1.decodeFromFields)("u64", fields.previous_borrow_ts_ms),
4148
+ previousCumulativeBorrowRate: (0, reified_1.decodeFromFields)("u64", fields.previous_cumulative_borrow_rate),
4149
+ borrowIntervalTsMs: (0, reified_1.decodeFromFields)("u64", fields.borrow_interval_ts_ms),
4150
+ lastBorrowRateTsMs: (0, reified_1.decodeFromFields)("u64", fields.last_borrow_rate_ts_ms),
4151
+ lastCumulativeBorrowRate: (0, reified_1.decodeFromFields)("u64", fields.last_cumulative_borrow_rate),
4152
+ u64Padding: (0, reified_1.decodeFromFields)(reified.vector("u64"), fields.u64_padding),
4153
+ });
4154
+ };
4155
+ UpdateBorrowInfoEvent.fromFieldsWithTypes = function (item) {
4156
+ if (!isUpdateBorrowInfoEvent(item.type)) {
4157
+ throw new Error("not a UpdateBorrowInfoEvent type");
4158
+ }
4159
+ return UpdateBorrowInfoEvent.reified().new({
4160
+ index: (0, reified_1.decodeFromFieldsWithTypes)("u64", item.fields.index),
4161
+ liquidityTokenType: (0, reified_1.decodeFromFieldsWithTypes)(structs_1.TypeName.reified(), item.fields.liquidity_token_type),
4162
+ previousBorrowTsMs: (0, reified_1.decodeFromFieldsWithTypes)("u64", item.fields.previous_borrow_ts_ms),
4163
+ previousCumulativeBorrowRate: (0, reified_1.decodeFromFieldsWithTypes)("u64", item.fields.previous_cumulative_borrow_rate),
4164
+ borrowIntervalTsMs: (0, reified_1.decodeFromFieldsWithTypes)("u64", item.fields.borrow_interval_ts_ms),
4165
+ lastBorrowRateTsMs: (0, reified_1.decodeFromFieldsWithTypes)("u64", item.fields.last_borrow_rate_ts_ms),
4166
+ lastCumulativeBorrowRate: (0, reified_1.decodeFromFieldsWithTypes)("u64", item.fields.last_cumulative_borrow_rate),
4167
+ u64Padding: (0, reified_1.decodeFromFieldsWithTypes)(reified.vector("u64"), item.fields.u64_padding),
4168
+ });
4169
+ };
4170
+ UpdateBorrowInfoEvent.fromBcs = function (data) {
4171
+ return UpdateBorrowInfoEvent.fromFields(UpdateBorrowInfoEvent.bcs.parse(data));
4172
+ };
4173
+ UpdateBorrowInfoEvent.prototype.toJSONField = function () {
4174
+ return {
4175
+ index: this.index.toString(),
4176
+ liquidityTokenType: this.liquidityTokenType.toJSONField(),
4177
+ previousBorrowTsMs: this.previousBorrowTsMs.toString(),
4178
+ previousCumulativeBorrowRate: this.previousCumulativeBorrowRate.toString(),
4179
+ borrowIntervalTsMs: this.borrowIntervalTsMs.toString(),
4180
+ lastBorrowRateTsMs: this.lastBorrowRateTsMs.toString(),
4181
+ lastCumulativeBorrowRate: this.lastCumulativeBorrowRate.toString(),
4182
+ u64Padding: (0, reified_1.fieldToJSON)("vector<u64>", this.u64Padding),
4183
+ };
4184
+ };
4185
+ UpdateBorrowInfoEvent.prototype.toJSON = function () {
4186
+ return __assign({ $typeName: this.$typeName, $typeArgs: this.$typeArgs }, this.toJSONField());
4187
+ };
4188
+ UpdateBorrowInfoEvent.fromJSONField = function (field) {
4189
+ return UpdateBorrowInfoEvent.reified().new({
4190
+ index: (0, reified_1.decodeFromJSONField)("u64", field.index),
4191
+ liquidityTokenType: (0, reified_1.decodeFromJSONField)(structs_1.TypeName.reified(), field.liquidityTokenType),
4192
+ previousBorrowTsMs: (0, reified_1.decodeFromJSONField)("u64", field.previousBorrowTsMs),
4193
+ previousCumulativeBorrowRate: (0, reified_1.decodeFromJSONField)("u64", field.previousCumulativeBorrowRate),
4194
+ borrowIntervalTsMs: (0, reified_1.decodeFromJSONField)("u64", field.borrowIntervalTsMs),
4195
+ lastBorrowRateTsMs: (0, reified_1.decodeFromJSONField)("u64", field.lastBorrowRateTsMs),
4196
+ lastCumulativeBorrowRate: (0, reified_1.decodeFromJSONField)("u64", field.lastCumulativeBorrowRate),
4197
+ u64Padding: (0, reified_1.decodeFromJSONField)(reified.vector("u64"), field.u64Padding),
4198
+ });
4199
+ };
4200
+ UpdateBorrowInfoEvent.fromJSON = function (json) {
4201
+ if (json.$typeName !== UpdateBorrowInfoEvent.$typeName) {
4202
+ throw new Error("not a WithTwoGenerics json object");
4203
+ }
4204
+ return UpdateBorrowInfoEvent.fromJSONField(json);
4205
+ };
4206
+ UpdateBorrowInfoEvent.fromSuiParsedData = function (content) {
4207
+ if (content.dataType !== "moveObject") {
4208
+ throw new Error("not an object");
4209
+ }
4210
+ if (!isUpdateBorrowInfoEvent(content.type)) {
4211
+ throw new Error("object at ".concat(content.fields.id, " is not a UpdateBorrowInfoEvent object"));
4212
+ }
4213
+ return UpdateBorrowInfoEvent.fromFieldsWithTypes(content);
4214
+ };
4215
+ UpdateBorrowInfoEvent.fromSuiObjectData = function (data) {
4216
+ if (data.bcs) {
4217
+ if (data.bcs.dataType !== "moveObject" || !isUpdateBorrowInfoEvent(data.bcs.type)) {
4218
+ throw new Error("object at is not a UpdateBorrowInfoEvent object");
4219
+ }
4220
+ return UpdateBorrowInfoEvent.fromBcs((0, utils_1.fromB64)(data.bcs.bcsBytes));
4221
+ }
4222
+ if (data.content) {
4223
+ return UpdateBorrowInfoEvent.fromSuiParsedData(data.content);
4224
+ }
4225
+ throw new Error("Both `bcs` and `content` fields are missing from the data. Include `showBcs` or `showContent` in the request.");
4226
+ };
4227
+ UpdateBorrowInfoEvent.fetch = function (client, id) {
4228
+ return __awaiter(this, void 0, void 0, function () {
4229
+ var res;
4230
+ var _a, _b;
4231
+ return __generator(this, function (_c) {
4232
+ switch (_c.label) {
4233
+ case 0: return [4 /*yield*/, client.getObject({ id: id, options: { showBcs: true } })];
4234
+ case 1:
4235
+ res = _c.sent();
4236
+ if (res.error) {
4237
+ throw new Error("error fetching UpdateBorrowInfoEvent object at id ".concat(id, ": ").concat(res.error.code));
4238
+ }
4239
+ if (((_b = (_a = res.data) === null || _a === void 0 ? void 0 : _a.bcs) === null || _b === void 0 ? void 0 : _b.dataType) !== "moveObject" || !isUpdateBorrowInfoEvent(res.data.bcs.type)) {
4240
+ throw new Error("object at id ".concat(id, " is not a UpdateBorrowInfoEvent object"));
4241
+ }
4242
+ return [2 /*return*/, UpdateBorrowInfoEvent.fromSuiObjectData(res.data)];
4243
+ }
4244
+ });
4245
+ });
4246
+ };
4247
+ UpdateBorrowInfoEvent.$typeName = "".concat(index_1.PKG_V1, "::lp_pool::UpdateBorrowInfoEvent");
4248
+ UpdateBorrowInfoEvent.$numTypeParams = 0;
4249
+ UpdateBorrowInfoEvent.$isPhantom = [];
4250
+ return UpdateBorrowInfoEvent;
4251
+ }());
4252
+ exports.UpdateBorrowInfoEvent = UpdateBorrowInfoEvent;
4253
+ /* ============================== UpdateLiquidityValueEvent =============================== */
4254
+ function isUpdateLiquidityValueEvent(type) {
4255
+ type = (0, util_1.compressSuiType)(type);
4256
+ return type === "".concat(index_1.PKG_V1, "::lp_pool::UpdateLiquidityValueEvent");
4257
+ }
4258
+ var UpdateLiquidityValueEvent = /** @class */ (function () {
4259
+ function UpdateLiquidityValueEvent(typeArgs, fields) {
4260
+ this.__StructClass = true;
4261
+ this.$typeName = UpdateLiquidityValueEvent.$typeName;
4262
+ this.$isPhantom = UpdateLiquidityValueEvent.$isPhantom;
4263
+ this.$fullTypeName = util_1.composeSuiType.apply(void 0, __spreadArray([UpdateLiquidityValueEvent.$typeName], __read(typeArgs), false));
4264
+ this.$typeArgs = typeArgs;
4265
+ this.sender = fields.sender;
4266
+ this.index = fields.index;
4267
+ this.liquidityToken = fields.liquidityToken;
4268
+ this.price = fields.price;
4269
+ this.valueInUsd = fields.valueInUsd;
4270
+ this.lpPoolTvlUsd = fields.lpPoolTvlUsd;
4271
+ this.u64Padding = fields.u64Padding;
4272
+ }
4273
+ UpdateLiquidityValueEvent.reified = function () {
4274
+ var _this = this;
4275
+ return {
4276
+ typeName: UpdateLiquidityValueEvent.$typeName,
4277
+ fullTypeName: util_1.composeSuiType.apply(void 0, __spreadArray([UpdateLiquidityValueEvent.$typeName], [], false)),
4278
+ typeArgs: [],
4279
+ isPhantom: UpdateLiquidityValueEvent.$isPhantom,
4280
+ reifiedTypeArgs: [],
4281
+ fromFields: function (fields) { return UpdateLiquidityValueEvent.fromFields(fields); },
4282
+ fromFieldsWithTypes: function (item) { return UpdateLiquidityValueEvent.fromFieldsWithTypes(item); },
4283
+ fromBcs: function (data) { return UpdateLiquidityValueEvent.fromBcs(data); },
4284
+ bcs: UpdateLiquidityValueEvent.bcs,
4285
+ fromJSONField: function (field) { return UpdateLiquidityValueEvent.fromJSONField(field); },
4286
+ fromJSON: function (json) { return UpdateLiquidityValueEvent.fromJSON(json); },
4287
+ fromSuiParsedData: function (content) { return UpdateLiquidityValueEvent.fromSuiParsedData(content); },
4288
+ fromSuiObjectData: function (content) { return UpdateLiquidityValueEvent.fromSuiObjectData(content); },
4289
+ fetch: function (client, id) { return __awaiter(_this, void 0, void 0, function () { return __generator(this, function (_a) {
4290
+ return [2 /*return*/, UpdateLiquidityValueEvent.fetch(client, id)];
4291
+ }); }); },
4292
+ new: function (fields) {
4293
+ return new UpdateLiquidityValueEvent([], fields);
4294
+ },
4295
+ kind: "StructClassReified",
4296
+ };
4297
+ };
4298
+ Object.defineProperty(UpdateLiquidityValueEvent, "r", {
4299
+ get: function () {
4300
+ return UpdateLiquidityValueEvent.reified();
4301
+ },
4302
+ enumerable: false,
4303
+ configurable: true
4304
+ });
4305
+ UpdateLiquidityValueEvent.phantom = function () {
4306
+ return (0, reified_1.phantom)(UpdateLiquidityValueEvent.reified());
4307
+ };
4308
+ Object.defineProperty(UpdateLiquidityValueEvent, "p", {
4309
+ get: function () {
4310
+ return UpdateLiquidityValueEvent.phantom();
4311
+ },
4312
+ enumerable: false,
4313
+ configurable: true
4314
+ });
4315
+ Object.defineProperty(UpdateLiquidityValueEvent, "bcs", {
4316
+ get: function () {
4317
+ return bcs_1.bcs.struct("UpdateLiquidityValueEvent", {
4318
+ sender: bcs_1.bcs.bytes(32).transform({ input: function (val) { return (0, utils_1.fromHEX)(val); }, output: function (val) { return (0, utils_1.toHEX)(val); } }),
4319
+ index: bcs_1.bcs.u64(),
4320
+ liquidity_token: structs_1.TypeName.bcs,
4321
+ price: bcs_1.bcs.u64(),
4322
+ value_in_usd: bcs_1.bcs.u64(),
4323
+ lp_pool_tvl_usd: bcs_1.bcs.u64(),
4324
+ u64_padding: bcs_1.bcs.vector(bcs_1.bcs.u64()),
4325
+ });
4326
+ },
4327
+ enumerable: false,
4328
+ configurable: true
4329
+ });
4330
+ UpdateLiquidityValueEvent.fromFields = function (fields) {
4331
+ return UpdateLiquidityValueEvent.reified().new({
4332
+ sender: (0, reified_1.decodeFromFields)("address", fields.sender),
4333
+ index: (0, reified_1.decodeFromFields)("u64", fields.index),
4334
+ liquidityToken: (0, reified_1.decodeFromFields)(structs_1.TypeName.reified(), fields.liquidity_token),
4335
+ price: (0, reified_1.decodeFromFields)("u64", fields.price),
4336
+ valueInUsd: (0, reified_1.decodeFromFields)("u64", fields.value_in_usd),
4337
+ lpPoolTvlUsd: (0, reified_1.decodeFromFields)("u64", fields.lp_pool_tvl_usd),
4338
+ u64Padding: (0, reified_1.decodeFromFields)(reified.vector("u64"), fields.u64_padding),
4339
+ });
4340
+ };
4341
+ UpdateLiquidityValueEvent.fromFieldsWithTypes = function (item) {
4342
+ if (!isUpdateLiquidityValueEvent(item.type)) {
4343
+ throw new Error("not a UpdateLiquidityValueEvent type");
4344
+ }
4345
+ return UpdateLiquidityValueEvent.reified().new({
4346
+ sender: (0, reified_1.decodeFromFieldsWithTypes)("address", item.fields.sender),
4347
+ index: (0, reified_1.decodeFromFieldsWithTypes)("u64", item.fields.index),
4348
+ liquidityToken: (0, reified_1.decodeFromFieldsWithTypes)(structs_1.TypeName.reified(), item.fields.liquidity_token),
4349
+ price: (0, reified_1.decodeFromFieldsWithTypes)("u64", item.fields.price),
4350
+ valueInUsd: (0, reified_1.decodeFromFieldsWithTypes)("u64", item.fields.value_in_usd),
4351
+ lpPoolTvlUsd: (0, reified_1.decodeFromFieldsWithTypes)("u64", item.fields.lp_pool_tvl_usd),
4352
+ u64Padding: (0, reified_1.decodeFromFieldsWithTypes)(reified.vector("u64"), item.fields.u64_padding),
4353
+ });
4354
+ };
4355
+ UpdateLiquidityValueEvent.fromBcs = function (data) {
4356
+ return UpdateLiquidityValueEvent.fromFields(UpdateLiquidityValueEvent.bcs.parse(data));
4357
+ };
4358
+ UpdateLiquidityValueEvent.prototype.toJSONField = function () {
4359
+ return {
4360
+ sender: this.sender,
4361
+ index: this.index.toString(),
4362
+ liquidityToken: this.liquidityToken.toJSONField(),
4363
+ price: this.price.toString(),
4364
+ valueInUsd: this.valueInUsd.toString(),
4365
+ lpPoolTvlUsd: this.lpPoolTvlUsd.toString(),
4366
+ u64Padding: (0, reified_1.fieldToJSON)("vector<u64>", this.u64Padding),
4367
+ };
4368
+ };
4369
+ UpdateLiquidityValueEvent.prototype.toJSON = function () {
4370
+ return __assign({ $typeName: this.$typeName, $typeArgs: this.$typeArgs }, this.toJSONField());
4371
+ };
4372
+ UpdateLiquidityValueEvent.fromJSONField = function (field) {
4373
+ return UpdateLiquidityValueEvent.reified().new({
4374
+ sender: (0, reified_1.decodeFromJSONField)("address", field.sender),
4375
+ index: (0, reified_1.decodeFromJSONField)("u64", field.index),
4376
+ liquidityToken: (0, reified_1.decodeFromJSONField)(structs_1.TypeName.reified(), field.liquidityToken),
4377
+ price: (0, reified_1.decodeFromJSONField)("u64", field.price),
4378
+ valueInUsd: (0, reified_1.decodeFromJSONField)("u64", field.valueInUsd),
4379
+ lpPoolTvlUsd: (0, reified_1.decodeFromJSONField)("u64", field.lpPoolTvlUsd),
4380
+ u64Padding: (0, reified_1.decodeFromJSONField)(reified.vector("u64"), field.u64Padding),
4381
+ });
4382
+ };
4383
+ UpdateLiquidityValueEvent.fromJSON = function (json) {
4384
+ if (json.$typeName !== UpdateLiquidityValueEvent.$typeName) {
4385
+ throw new Error("not a WithTwoGenerics json object");
4386
+ }
4387
+ return UpdateLiquidityValueEvent.fromJSONField(json);
4388
+ };
4389
+ UpdateLiquidityValueEvent.fromSuiParsedData = function (content) {
4390
+ if (content.dataType !== "moveObject") {
4391
+ throw new Error("not an object");
4392
+ }
4393
+ if (!isUpdateLiquidityValueEvent(content.type)) {
4394
+ throw new Error("object at ".concat(content.fields.id, " is not a UpdateLiquidityValueEvent object"));
4395
+ }
4396
+ return UpdateLiquidityValueEvent.fromFieldsWithTypes(content);
4397
+ };
4398
+ UpdateLiquidityValueEvent.fromSuiObjectData = function (data) {
4399
+ if (data.bcs) {
4400
+ if (data.bcs.dataType !== "moveObject" || !isUpdateLiquidityValueEvent(data.bcs.type)) {
4401
+ throw new Error("object at is not a UpdateLiquidityValueEvent object");
4402
+ }
4403
+ return UpdateLiquidityValueEvent.fromBcs((0, utils_1.fromB64)(data.bcs.bcsBytes));
4404
+ }
4405
+ if (data.content) {
4406
+ return UpdateLiquidityValueEvent.fromSuiParsedData(data.content);
4407
+ }
4408
+ throw new Error("Both `bcs` and `content` fields are missing from the data. Include `showBcs` or `showContent` in the request.");
4409
+ };
4410
+ UpdateLiquidityValueEvent.fetch = function (client, id) {
4411
+ return __awaiter(this, void 0, void 0, function () {
4412
+ var res;
4413
+ var _a, _b;
4414
+ return __generator(this, function (_c) {
4415
+ switch (_c.label) {
4416
+ case 0: return [4 /*yield*/, client.getObject({ id: id, options: { showBcs: true } })];
4417
+ case 1:
4418
+ res = _c.sent();
4419
+ if (res.error) {
4420
+ throw new Error("error fetching UpdateLiquidityValueEvent object at id ".concat(id, ": ").concat(res.error.code));
4421
+ }
4422
+ if (((_b = (_a = res.data) === null || _a === void 0 ? void 0 : _a.bcs) === null || _b === void 0 ? void 0 : _b.dataType) !== "moveObject" || !isUpdateLiquidityValueEvent(res.data.bcs.type)) {
4423
+ throw new Error("object at id ".concat(id, " is not a UpdateLiquidityValueEvent object"));
4424
+ }
4425
+ return [2 /*return*/, UpdateLiquidityValueEvent.fromSuiObjectData(res.data)];
4426
+ }
4427
+ });
4428
+ });
4429
+ };
4430
+ UpdateLiquidityValueEvent.$typeName = "".concat(index_1.PKG_V1, "::lp_pool::UpdateLiquidityValueEvent");
4431
+ UpdateLiquidityValueEvent.$numTypeParams = 0;
4432
+ UpdateLiquidityValueEvent.$isPhantom = [];
4433
+ return UpdateLiquidityValueEvent;
4434
+ }());
4435
+ exports.UpdateLiquidityValueEvent = UpdateLiquidityValueEvent;
4436
+ /* ============================== UpdateMarginConfigEvent =============================== */
4437
+ function isUpdateMarginConfigEvent(type) {
4438
+ type = (0, util_1.compressSuiType)(type);
4439
+ return type === "".concat(index_1.PKG_V1, "::lp_pool::UpdateMarginConfigEvent");
4440
+ }
4441
+ var UpdateMarginConfigEvent = /** @class */ (function () {
4442
+ function UpdateMarginConfigEvent(typeArgs, fields) {
4443
+ this.__StructClass = true;
4444
+ this.$typeName = UpdateMarginConfigEvent.$typeName;
4445
+ this.$isPhantom = UpdateMarginConfigEvent.$isPhantom;
4446
+ this.$fullTypeName = util_1.composeSuiType.apply(void 0, __spreadArray([UpdateMarginConfigEvent.$typeName], __read(typeArgs), false));
4447
+ this.$typeArgs = typeArgs;
4448
+ this.sender = fields.sender;
4449
+ this.index = fields.index;
4450
+ this.liquidityTokenType = fields.liquidityTokenType;
4451
+ this.previousMarginConfig = fields.previousMarginConfig;
4452
+ this.newMarginConfig = fields.newMarginConfig;
4453
+ this.u64Padding = fields.u64Padding;
4454
+ }
4455
+ UpdateMarginConfigEvent.reified = function () {
4456
+ var _this = this;
4457
+ return {
4458
+ typeName: UpdateMarginConfigEvent.$typeName,
4459
+ fullTypeName: util_1.composeSuiType.apply(void 0, __spreadArray([UpdateMarginConfigEvent.$typeName], [], false)),
4460
+ typeArgs: [],
4461
+ isPhantom: UpdateMarginConfigEvent.$isPhantom,
4462
+ reifiedTypeArgs: [],
4463
+ fromFields: function (fields) { return UpdateMarginConfigEvent.fromFields(fields); },
4464
+ fromFieldsWithTypes: function (item) { return UpdateMarginConfigEvent.fromFieldsWithTypes(item); },
4465
+ fromBcs: function (data) { return UpdateMarginConfigEvent.fromBcs(data); },
4466
+ bcs: UpdateMarginConfigEvent.bcs,
4467
+ fromJSONField: function (field) { return UpdateMarginConfigEvent.fromJSONField(field); },
4468
+ fromJSON: function (json) { return UpdateMarginConfigEvent.fromJSON(json); },
4469
+ fromSuiParsedData: function (content) { return UpdateMarginConfigEvent.fromSuiParsedData(content); },
4470
+ fromSuiObjectData: function (content) { return UpdateMarginConfigEvent.fromSuiObjectData(content); },
4471
+ fetch: function (client, id) { return __awaiter(_this, void 0, void 0, function () { return __generator(this, function (_a) {
4472
+ return [2 /*return*/, UpdateMarginConfigEvent.fetch(client, id)];
4473
+ }); }); },
4474
+ new: function (fields) {
4475
+ return new UpdateMarginConfigEvent([], fields);
4476
+ },
4477
+ kind: "StructClassReified",
4478
+ };
4479
+ };
4480
+ Object.defineProperty(UpdateMarginConfigEvent, "r", {
4481
+ get: function () {
4482
+ return UpdateMarginConfigEvent.reified();
4483
+ },
4484
+ enumerable: false,
4485
+ configurable: true
4486
+ });
4487
+ UpdateMarginConfigEvent.phantom = function () {
4488
+ return (0, reified_1.phantom)(UpdateMarginConfigEvent.reified());
4489
+ };
4490
+ Object.defineProperty(UpdateMarginConfigEvent, "p", {
4491
+ get: function () {
4492
+ return UpdateMarginConfigEvent.phantom();
4493
+ },
4494
+ enumerable: false,
4495
+ configurable: true
4496
+ });
4497
+ Object.defineProperty(UpdateMarginConfigEvent, "bcs", {
4498
+ get: function () {
4499
+ return bcs_1.bcs.struct("UpdateMarginConfigEvent", {
4500
+ sender: bcs_1.bcs.bytes(32).transform({ input: function (val) { return (0, utils_1.fromHEX)(val); }, output: function (val) { return (0, utils_1.toHEX)(val); } }),
4501
+ index: bcs_1.bcs.u64(),
4502
+ liquidity_token_type: structs_1.TypeName.bcs,
4503
+ previous_margin_config: MarginConfig.bcs,
4504
+ new_margin_config: MarginConfig.bcs,
4505
+ u64_padding: bcs_1.bcs.vector(bcs_1.bcs.u64()),
4506
+ });
4507
+ },
4508
+ enumerable: false,
4509
+ configurable: true
4510
+ });
4511
+ UpdateMarginConfigEvent.fromFields = function (fields) {
4512
+ return UpdateMarginConfigEvent.reified().new({
4513
+ sender: (0, reified_1.decodeFromFields)("address", fields.sender),
4514
+ index: (0, reified_1.decodeFromFields)("u64", fields.index),
4515
+ liquidityTokenType: (0, reified_1.decodeFromFields)(structs_1.TypeName.reified(), fields.liquidity_token_type),
4516
+ previousMarginConfig: (0, reified_1.decodeFromFields)(MarginConfig.reified(), fields.previous_margin_config),
4517
+ newMarginConfig: (0, reified_1.decodeFromFields)(MarginConfig.reified(), fields.new_margin_config),
4518
+ u64Padding: (0, reified_1.decodeFromFields)(reified.vector("u64"), fields.u64_padding),
4519
+ });
4520
+ };
4521
+ UpdateMarginConfigEvent.fromFieldsWithTypes = function (item) {
4522
+ if (!isUpdateMarginConfigEvent(item.type)) {
4523
+ throw new Error("not a UpdateMarginConfigEvent type");
4524
+ }
4525
+ return UpdateMarginConfigEvent.reified().new({
4526
+ sender: (0, reified_1.decodeFromFieldsWithTypes)("address", item.fields.sender),
4527
+ index: (0, reified_1.decodeFromFieldsWithTypes)("u64", item.fields.index),
4528
+ liquidityTokenType: (0, reified_1.decodeFromFieldsWithTypes)(structs_1.TypeName.reified(), item.fields.liquidity_token_type),
4529
+ previousMarginConfig: (0, reified_1.decodeFromFieldsWithTypes)(MarginConfig.reified(), item.fields.previous_margin_config),
4530
+ newMarginConfig: (0, reified_1.decodeFromFieldsWithTypes)(MarginConfig.reified(), item.fields.new_margin_config),
4531
+ u64Padding: (0, reified_1.decodeFromFieldsWithTypes)(reified.vector("u64"), item.fields.u64_padding),
4532
+ });
4533
+ };
4534
+ UpdateMarginConfigEvent.fromBcs = function (data) {
4535
+ return UpdateMarginConfigEvent.fromFields(UpdateMarginConfigEvent.bcs.parse(data));
4536
+ };
4537
+ UpdateMarginConfigEvent.prototype.toJSONField = function () {
4538
+ return {
4539
+ sender: this.sender,
4540
+ index: this.index.toString(),
4541
+ liquidityTokenType: this.liquidityTokenType.toJSONField(),
4542
+ previousMarginConfig: this.previousMarginConfig.toJSONField(),
4543
+ newMarginConfig: this.newMarginConfig.toJSONField(),
4544
+ u64Padding: (0, reified_1.fieldToJSON)("vector<u64>", this.u64Padding),
4545
+ };
4546
+ };
4547
+ UpdateMarginConfigEvent.prototype.toJSON = function () {
4548
+ return __assign({ $typeName: this.$typeName, $typeArgs: this.$typeArgs }, this.toJSONField());
4549
+ };
4550
+ UpdateMarginConfigEvent.fromJSONField = function (field) {
4551
+ return UpdateMarginConfigEvent.reified().new({
4552
+ sender: (0, reified_1.decodeFromJSONField)("address", field.sender),
4553
+ index: (0, reified_1.decodeFromJSONField)("u64", field.index),
4554
+ liquidityTokenType: (0, reified_1.decodeFromJSONField)(structs_1.TypeName.reified(), field.liquidityTokenType),
4555
+ previousMarginConfig: (0, reified_1.decodeFromJSONField)(MarginConfig.reified(), field.previousMarginConfig),
4556
+ newMarginConfig: (0, reified_1.decodeFromJSONField)(MarginConfig.reified(), field.newMarginConfig),
4557
+ u64Padding: (0, reified_1.decodeFromJSONField)(reified.vector("u64"), field.u64Padding),
4558
+ });
4559
+ };
4560
+ UpdateMarginConfigEvent.fromJSON = function (json) {
4561
+ if (json.$typeName !== UpdateMarginConfigEvent.$typeName) {
4562
+ throw new Error("not a WithTwoGenerics json object");
4563
+ }
4564
+ return UpdateMarginConfigEvent.fromJSONField(json);
4565
+ };
4566
+ UpdateMarginConfigEvent.fromSuiParsedData = function (content) {
4567
+ if (content.dataType !== "moveObject") {
4568
+ throw new Error("not an object");
4569
+ }
4570
+ if (!isUpdateMarginConfigEvent(content.type)) {
4571
+ throw new Error("object at ".concat(content.fields.id, " is not a UpdateMarginConfigEvent object"));
4572
+ }
4573
+ return UpdateMarginConfigEvent.fromFieldsWithTypes(content);
4574
+ };
4575
+ UpdateMarginConfigEvent.fromSuiObjectData = function (data) {
4576
+ if (data.bcs) {
4577
+ if (data.bcs.dataType !== "moveObject" || !isUpdateMarginConfigEvent(data.bcs.type)) {
4578
+ throw new Error("object at is not a UpdateMarginConfigEvent object");
4579
+ }
4580
+ return UpdateMarginConfigEvent.fromBcs((0, utils_1.fromB64)(data.bcs.bcsBytes));
4581
+ }
4582
+ if (data.content) {
4583
+ return UpdateMarginConfigEvent.fromSuiParsedData(data.content);
4584
+ }
4585
+ throw new Error("Both `bcs` and `content` fields are missing from the data. Include `showBcs` or `showContent` in the request.");
4586
+ };
4587
+ UpdateMarginConfigEvent.fetch = function (client, id) {
4588
+ return __awaiter(this, void 0, void 0, function () {
4589
+ var res;
4590
+ var _a, _b;
4591
+ return __generator(this, function (_c) {
4592
+ switch (_c.label) {
4593
+ case 0: return [4 /*yield*/, client.getObject({ id: id, options: { showBcs: true } })];
4594
+ case 1:
4595
+ res = _c.sent();
4596
+ if (res.error) {
4597
+ throw new Error("error fetching UpdateMarginConfigEvent object at id ".concat(id, ": ").concat(res.error.code));
4598
+ }
4599
+ if (((_b = (_a = res.data) === null || _a === void 0 ? void 0 : _a.bcs) === null || _b === void 0 ? void 0 : _b.dataType) !== "moveObject" || !isUpdateMarginConfigEvent(res.data.bcs.type)) {
4600
+ throw new Error("object at id ".concat(id, " is not a UpdateMarginConfigEvent object"));
4601
+ }
4602
+ return [2 /*return*/, UpdateMarginConfigEvent.fromSuiObjectData(res.data)];
4603
+ }
4604
+ });
4605
+ });
4606
+ };
4607
+ UpdateMarginConfigEvent.$typeName = "".concat(index_1.PKG_V1, "::lp_pool::UpdateMarginConfigEvent");
4608
+ UpdateMarginConfigEvent.$numTypeParams = 0;
4609
+ UpdateMarginConfigEvent.$isPhantom = [];
4610
+ return UpdateMarginConfigEvent;
4611
+ }());
4612
+ exports.UpdateMarginConfigEvent = UpdateMarginConfigEvent;
4613
+ /* ============================== UpdateSpotConfigEvent =============================== */
4614
+ function isUpdateSpotConfigEvent(type) {
4615
+ type = (0, util_1.compressSuiType)(type);
4616
+ return type === "".concat(index_1.PKG_V1, "::lp_pool::UpdateSpotConfigEvent");
4617
+ }
4618
+ var UpdateSpotConfigEvent = /** @class */ (function () {
4619
+ function UpdateSpotConfigEvent(typeArgs, fields) {
4620
+ this.__StructClass = true;
4621
+ this.$typeName = UpdateSpotConfigEvent.$typeName;
4622
+ this.$isPhantom = UpdateSpotConfigEvent.$isPhantom;
4623
+ this.$fullTypeName = util_1.composeSuiType.apply(void 0, __spreadArray([UpdateSpotConfigEvent.$typeName], __read(typeArgs), false));
4624
+ this.$typeArgs = typeArgs;
4625
+ this.sender = fields.sender;
4626
+ this.index = fields.index;
4627
+ this.liquidityTokenType = fields.liquidityTokenType;
4628
+ this.previousSpotConfig = fields.previousSpotConfig;
4629
+ this.newSpotConfig = fields.newSpotConfig;
4630
+ this.u64Padding = fields.u64Padding;
4631
+ }
4632
+ UpdateSpotConfigEvent.reified = function () {
4633
+ var _this = this;
4634
+ return {
4635
+ typeName: UpdateSpotConfigEvent.$typeName,
4636
+ fullTypeName: util_1.composeSuiType.apply(void 0, __spreadArray([UpdateSpotConfigEvent.$typeName], [], false)),
4637
+ typeArgs: [],
4638
+ isPhantom: UpdateSpotConfigEvent.$isPhantom,
4639
+ reifiedTypeArgs: [],
4640
+ fromFields: function (fields) { return UpdateSpotConfigEvent.fromFields(fields); },
4641
+ fromFieldsWithTypes: function (item) { return UpdateSpotConfigEvent.fromFieldsWithTypes(item); },
4642
+ fromBcs: function (data) { return UpdateSpotConfigEvent.fromBcs(data); },
4643
+ bcs: UpdateSpotConfigEvent.bcs,
4644
+ fromJSONField: function (field) { return UpdateSpotConfigEvent.fromJSONField(field); },
4645
+ fromJSON: function (json) { return UpdateSpotConfigEvent.fromJSON(json); },
4646
+ fromSuiParsedData: function (content) { return UpdateSpotConfigEvent.fromSuiParsedData(content); },
4647
+ fromSuiObjectData: function (content) { return UpdateSpotConfigEvent.fromSuiObjectData(content); },
4648
+ fetch: function (client, id) { return __awaiter(_this, void 0, void 0, function () { return __generator(this, function (_a) {
4649
+ return [2 /*return*/, UpdateSpotConfigEvent.fetch(client, id)];
4650
+ }); }); },
4651
+ new: function (fields) {
4652
+ return new UpdateSpotConfigEvent([], fields);
4653
+ },
4654
+ kind: "StructClassReified",
4655
+ };
4656
+ };
4657
+ Object.defineProperty(UpdateSpotConfigEvent, "r", {
4658
+ get: function () {
4659
+ return UpdateSpotConfigEvent.reified();
4660
+ },
4661
+ enumerable: false,
4662
+ configurable: true
4663
+ });
4664
+ UpdateSpotConfigEvent.phantom = function () {
4665
+ return (0, reified_1.phantom)(UpdateSpotConfigEvent.reified());
4666
+ };
4667
+ Object.defineProperty(UpdateSpotConfigEvent, "p", {
4668
+ get: function () {
4669
+ return UpdateSpotConfigEvent.phantom();
4670
+ },
4671
+ enumerable: false,
4672
+ configurable: true
4673
+ });
4674
+ Object.defineProperty(UpdateSpotConfigEvent, "bcs", {
4675
+ get: function () {
4676
+ return bcs_1.bcs.struct("UpdateSpotConfigEvent", {
4677
+ sender: bcs_1.bcs.bytes(32).transform({ input: function (val) { return (0, utils_1.fromHEX)(val); }, output: function (val) { return (0, utils_1.toHEX)(val); } }),
4678
+ index: bcs_1.bcs.u64(),
4679
+ liquidity_token_type: structs_1.TypeName.bcs,
4680
+ previous_spot_config: SpotConfig.bcs,
4681
+ new_spot_config: SpotConfig.bcs,
4682
+ u64_padding: bcs_1.bcs.vector(bcs_1.bcs.u64()),
4683
+ });
4684
+ },
4685
+ enumerable: false,
4686
+ configurable: true
4687
+ });
4688
+ UpdateSpotConfigEvent.fromFields = function (fields) {
4689
+ return UpdateSpotConfigEvent.reified().new({
4690
+ sender: (0, reified_1.decodeFromFields)("address", fields.sender),
4691
+ index: (0, reified_1.decodeFromFields)("u64", fields.index),
4692
+ liquidityTokenType: (0, reified_1.decodeFromFields)(structs_1.TypeName.reified(), fields.liquidity_token_type),
4693
+ previousSpotConfig: (0, reified_1.decodeFromFields)(SpotConfig.reified(), fields.previous_spot_config),
4694
+ newSpotConfig: (0, reified_1.decodeFromFields)(SpotConfig.reified(), fields.new_spot_config),
4695
+ u64Padding: (0, reified_1.decodeFromFields)(reified.vector("u64"), fields.u64_padding),
4696
+ });
4697
+ };
4698
+ UpdateSpotConfigEvent.fromFieldsWithTypes = function (item) {
4699
+ if (!isUpdateSpotConfigEvent(item.type)) {
4700
+ throw new Error("not a UpdateSpotConfigEvent type");
4701
+ }
4702
+ return UpdateSpotConfigEvent.reified().new({
4703
+ sender: (0, reified_1.decodeFromFieldsWithTypes)("address", item.fields.sender),
4704
+ index: (0, reified_1.decodeFromFieldsWithTypes)("u64", item.fields.index),
4705
+ liquidityTokenType: (0, reified_1.decodeFromFieldsWithTypes)(structs_1.TypeName.reified(), item.fields.liquidity_token_type),
4706
+ previousSpotConfig: (0, reified_1.decodeFromFieldsWithTypes)(SpotConfig.reified(), item.fields.previous_spot_config),
4707
+ newSpotConfig: (0, reified_1.decodeFromFieldsWithTypes)(SpotConfig.reified(), item.fields.new_spot_config),
4708
+ u64Padding: (0, reified_1.decodeFromFieldsWithTypes)(reified.vector("u64"), item.fields.u64_padding),
4709
+ });
4710
+ };
4711
+ UpdateSpotConfigEvent.fromBcs = function (data) {
4712
+ return UpdateSpotConfigEvent.fromFields(UpdateSpotConfigEvent.bcs.parse(data));
4713
+ };
4714
+ UpdateSpotConfigEvent.prototype.toJSONField = function () {
4715
+ return {
4716
+ sender: this.sender,
4717
+ index: this.index.toString(),
4718
+ liquidityTokenType: this.liquidityTokenType.toJSONField(),
4719
+ previousSpotConfig: this.previousSpotConfig.toJSONField(),
4720
+ newSpotConfig: this.newSpotConfig.toJSONField(),
4721
+ u64Padding: (0, reified_1.fieldToJSON)("vector<u64>", this.u64Padding),
4722
+ };
4723
+ };
4724
+ UpdateSpotConfigEvent.prototype.toJSON = function () {
4725
+ return __assign({ $typeName: this.$typeName, $typeArgs: this.$typeArgs }, this.toJSONField());
4726
+ };
4727
+ UpdateSpotConfigEvent.fromJSONField = function (field) {
4728
+ return UpdateSpotConfigEvent.reified().new({
4729
+ sender: (0, reified_1.decodeFromJSONField)("address", field.sender),
4730
+ index: (0, reified_1.decodeFromJSONField)("u64", field.index),
4731
+ liquidityTokenType: (0, reified_1.decodeFromJSONField)(structs_1.TypeName.reified(), field.liquidityTokenType),
4732
+ previousSpotConfig: (0, reified_1.decodeFromJSONField)(SpotConfig.reified(), field.previousSpotConfig),
4733
+ newSpotConfig: (0, reified_1.decodeFromJSONField)(SpotConfig.reified(), field.newSpotConfig),
4734
+ u64Padding: (0, reified_1.decodeFromJSONField)(reified.vector("u64"), field.u64Padding),
4735
+ });
4736
+ };
4737
+ UpdateSpotConfigEvent.fromJSON = function (json) {
4738
+ if (json.$typeName !== UpdateSpotConfigEvent.$typeName) {
4739
+ throw new Error("not a WithTwoGenerics json object");
4740
+ }
4741
+ return UpdateSpotConfigEvent.fromJSONField(json);
4742
+ };
4743
+ UpdateSpotConfigEvent.fromSuiParsedData = function (content) {
4744
+ if (content.dataType !== "moveObject") {
4745
+ throw new Error("not an object");
4746
+ }
4747
+ if (!isUpdateSpotConfigEvent(content.type)) {
4748
+ throw new Error("object at ".concat(content.fields.id, " is not a UpdateSpotConfigEvent object"));
4749
+ }
4750
+ return UpdateSpotConfigEvent.fromFieldsWithTypes(content);
4751
+ };
4752
+ UpdateSpotConfigEvent.fromSuiObjectData = function (data) {
4753
+ if (data.bcs) {
4754
+ if (data.bcs.dataType !== "moveObject" || !isUpdateSpotConfigEvent(data.bcs.type)) {
4755
+ throw new Error("object at is not a UpdateSpotConfigEvent object");
4756
+ }
4757
+ return UpdateSpotConfigEvent.fromBcs((0, utils_1.fromB64)(data.bcs.bcsBytes));
4758
+ }
4759
+ if (data.content) {
4760
+ return UpdateSpotConfigEvent.fromSuiParsedData(data.content);
4761
+ }
4762
+ throw new Error("Both `bcs` and `content` fields are missing from the data. Include `showBcs` or `showContent` in the request.");
4763
+ };
4764
+ UpdateSpotConfigEvent.fetch = function (client, id) {
4765
+ return __awaiter(this, void 0, void 0, function () {
4766
+ var res;
4767
+ var _a, _b;
4768
+ return __generator(this, function (_c) {
4769
+ switch (_c.label) {
4770
+ case 0: return [4 /*yield*/, client.getObject({ id: id, options: { showBcs: true } })];
4771
+ case 1:
4772
+ res = _c.sent();
4773
+ if (res.error) {
4774
+ throw new Error("error fetching UpdateSpotConfigEvent object at id ".concat(id, ": ").concat(res.error.code));
4775
+ }
4776
+ if (((_b = (_a = res.data) === null || _a === void 0 ? void 0 : _a.bcs) === null || _b === void 0 ? void 0 : _b.dataType) !== "moveObject" || !isUpdateSpotConfigEvent(res.data.bcs.type)) {
4777
+ throw new Error("object at id ".concat(id, " is not a UpdateSpotConfigEvent object"));
4778
+ }
4779
+ return [2 /*return*/, UpdateSpotConfigEvent.fromSuiObjectData(res.data)];
4780
+ }
4781
+ });
4782
+ });
4783
+ };
4784
+ UpdateSpotConfigEvent.$typeName = "".concat(index_1.PKG_V1, "::lp_pool::UpdateSpotConfigEvent");
4785
+ UpdateSpotConfigEvent.$numTypeParams = 0;
4786
+ UpdateSpotConfigEvent.$isPhantom = [];
4787
+ return UpdateSpotConfigEvent;
4788
+ }());
4789
+ exports.UpdateSpotConfigEvent = UpdateSpotConfigEvent;