@typus/typus-sdk 1.4.5 → 1.4.7

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 (496) hide show
  1. package/dist/config.json +189 -0
  2. package/dist/src/_dependencies/source/0x1/ascii/structs.d.ts +82 -0
  3. package/dist/src/_dependencies/source/0x1/ascii/structs.js +280 -0
  4. package/dist/src/_dependencies/source/0x1/bit-vector/structs.d.ts +50 -0
  5. package/dist/src/_dependencies/source/0x1/bit-vector/structs.js +193 -0
  6. package/dist/src/_dependencies/source/0x1/fixed-point32/structs.d.ts +41 -0
  7. package/dist/src/_dependencies/source/0x1/fixed-point32/structs.js +167 -0
  8. package/dist/src/_dependencies/source/0x1/index.d.ts +2 -0
  9. package/dist/src/_dependencies/source/0x1/index.js +5 -0
  10. package/dist/src/_dependencies/source/0x1/init.d.ts +2 -0
  11. package/dist/src/_dependencies/source/0x1/init.js +41 -0
  12. package/dist/src/_dependencies/source/0x1/option/structs.d.ts +46 -0
  13. package/dist/src/_dependencies/source/0x1/option/structs.js +198 -0
  14. package/dist/src/_dependencies/source/0x1/string/structs.d.ts +44 -0
  15. package/dist/src/_dependencies/source/0x1/string/structs.js +191 -0
  16. package/dist/src/_dependencies/source/0x1/type-name/structs.d.ts +48 -0
  17. package/dist/src/_dependencies/source/0x1/type-name/structs.js +168 -0
  18. package/dist/src/_dependencies/source/0x1d17058789bd1e1e79f1a92424519a88146f191f58a06cc4d9ab23d17d46ab73/index.d.ts +2 -0
  19. package/dist/src/_dependencies/source/0x1d17058789bd1e1e79f1a92424519a88146f191f58a06cc4d9ab23d17d46ab73/index.js +5 -0
  20. package/dist/src/_dependencies/source/0x1d17058789bd1e1e79f1a92424519a88146f191f58a06cc4d9ab23d17d46ab73/init.d.ts +2 -0
  21. package/dist/src/_dependencies/source/0x1d17058789bd1e1e79f1a92424519a88146f191f58a06cc4d9ab23d17d46ab73/init.js +39 -0
  22. package/dist/src/_dependencies/source/0x1d17058789bd1e1e79f1a92424519a88146f191f58a06cc4d9ab23d17d46ab73/oracle/structs.d.ts +277 -0
  23. package/dist/src/_dependencies/source/0x1d17058789bd1e1e79f1a92424519a88146f191f58a06cc4d9ab23d17d46ab73/oracle/structs.js +377 -0
  24. package/dist/src/_dependencies/source/0x1d17058789bd1e1e79f1a92424519a88146f191f58a06cc4d9ab23d17d46ab73/pyth-parser/structs.d.ts +102 -0
  25. package/dist/src/_dependencies/source/0x1d17058789bd1e1e79f1a92424519a88146f191f58a06cc4d9ab23d17d46ab73/pyth-parser/structs.js +353 -0
  26. package/dist/src/_dependencies/source/0x1d17058789bd1e1e79f1a92424519a88146f191f58a06cc4d9ab23d17d46ab73/supra/structs.d.ts +65 -0
  27. package/dist/src/_dependencies/source/0x1d17058789bd1e1e79f1a92424519a88146f191f58a06cc4d9ab23d17d46ab73/supra/structs.js +175 -0
  28. package/dist/src/_dependencies/source/0x1d17058789bd1e1e79f1a92424519a88146f191f58a06cc4d9ab23d17d46ab73/switchboard-feed-parser/structs.d.ts +65 -0
  29. package/dist/src/_dependencies/source/0x1d17058789bd1e1e79f1a92424519a88146f191f58a06cc4d9ab23d17d46ab73/switchboard-feed-parser/structs.js +175 -0
  30. package/dist/src/_dependencies/source/0x2/authenticator-state/structs.d.ts +442 -0
  31. package/dist/src/_dependencies/source/0x2/authenticator-state/structs.js +565 -0
  32. package/dist/src/_dependencies/source/0x2/bag/structs.d.ts +56 -0
  33. package/dist/src/_dependencies/source/0x2/bag/structs.js +170 -0
  34. package/dist/src/_dependencies/source/0x2/balance/structs.d.ts +79 -0
  35. package/dist/src/_dependencies/source/0x2/balance/structs.js +260 -0
  36. package/dist/src/_dependencies/source/0x2/bcs/structs.d.ts +44 -0
  37. package/dist/src/_dependencies/source/0x2/bcs/structs.js +191 -0
  38. package/dist/src/_dependencies/source/0x2/bls12381/structs.d.ts +155 -0
  39. package/dist/src/_dependencies/source/0x2/bls12381/structs.js +434 -0
  40. package/dist/src/_dependencies/source/0x2/borrow/structs.d.ts +104 -0
  41. package/dist/src/_dependencies/source/0x2/borrow/structs.js +267 -0
  42. package/dist/src/_dependencies/source/0x2/clock/structs.d.ts +56 -0
  43. package/dist/src/_dependencies/source/0x2/clock/structs.js +170 -0
  44. package/dist/src/_dependencies/source/0x2/coin/structs.d.ts +379 -0
  45. package/dist/src/_dependencies/source/0x2/coin/structs.js +648 -0
  46. package/dist/src/_dependencies/source/0x2/deny-list/structs.d.ts +178 -0
  47. package/dist/src/_dependencies/source/0x2/deny-list/structs.js +290 -0
  48. package/dist/src/_dependencies/source/0x2/display/structs.d.ts +228 -0
  49. package/dist/src/_dependencies/source/0x2/display/structs.js +362 -0
  50. package/dist/src/_dependencies/source/0x2/dynamic-field/structs.d.ts +63 -0
  51. package/dist/src/_dependencies/source/0x2/dynamic-field/structs.js +174 -0
  52. package/dist/src/_dependencies/source/0x2/dynamic-object-field/structs.d.ts +42 -0
  53. package/dist/src/_dependencies/source/0x2/dynamic-object-field/structs.js +172 -0
  54. package/dist/src/_dependencies/source/0x2/groth16/structs.d.ts +186 -0
  55. package/dist/src/_dependencies/source/0x2/groth16/structs.js +464 -0
  56. package/dist/src/_dependencies/source/0x2/group-ops/structs.d.ts +44 -0
  57. package/dist/src/_dependencies/source/0x2/group-ops/structs.js +193 -0
  58. package/dist/src/_dependencies/source/0x2/index.d.ts +2 -0
  59. package/dist/src/_dependencies/source/0x2/index.js +5 -0
  60. package/dist/src/_dependencies/source/0x2/init.d.ts +2 -0
  61. package/dist/src/_dependencies/source/0x2/init.js +150 -0
  62. package/dist/src/_dependencies/source/0x2/kiosk/structs.d.ts +565 -0
  63. package/dist/src/_dependencies/source/0x2/kiosk/structs.js +1033 -0
  64. package/dist/src/_dependencies/source/0x2/kiosk-extension/structs.d.ts +112 -0
  65. package/dist/src/_dependencies/source/0x2/kiosk-extension/structs.js +263 -0
  66. package/dist/src/_dependencies/source/0x2/linked-table/structs.d.ts +144 -0
  67. package/dist/src/_dependencies/source/0x2/linked-table/structs.js +272 -0
  68. package/dist/src/_dependencies/source/0x2/object/structs.d.ts +83 -0
  69. package/dist/src/_dependencies/source/0x2/object/structs.js +256 -0
  70. package/dist/src/_dependencies/source/0x2/object-bag/structs.d.ts +56 -0
  71. package/dist/src/_dependencies/source/0x2/object-bag/structs.js +170 -0
  72. package/dist/src/_dependencies/source/0x2/object-table/structs.d.ts +56 -0
  73. package/dist/src/_dependencies/source/0x2/object-table/structs.js +172 -0
  74. package/dist/src/_dependencies/source/0x2/package/structs.d.ts +262 -0
  75. package/dist/src/_dependencies/source/0x2/package/structs.js +478 -0
  76. package/dist/src/_dependencies/source/0x2/priority-queue/structs.d.ts +101 -0
  77. package/dist/src/_dependencies/source/0x2/priority-queue/structs.js +292 -0
  78. package/dist/src/_dependencies/source/0x2/random/structs.d.ts +190 -0
  79. package/dist/src/_dependencies/source/0x2/random/structs.js +383 -0
  80. package/dist/src/_dependencies/source/0x2/sui/structs.d.ts +41 -0
  81. package/dist/src/_dependencies/source/0x2/sui/structs.js +167 -0
  82. package/dist/src/_dependencies/source/0x2/table/structs.d.ts +56 -0
  83. package/dist/src/_dependencies/source/0x2/table/structs.js +172 -0
  84. package/dist/src/_dependencies/source/0x2/table-vec/structs.d.ts +63 -0
  85. package/dist/src/_dependencies/source/0x2/table-vec/structs.js +194 -0
  86. package/dist/src/_dependencies/source/0x2/token/structs.d.ts +424 -0
  87. package/dist/src/_dependencies/source/0x2/token/structs.js +651 -0
  88. package/dist/src/_dependencies/source/0x2/transfer/structs.d.ts +52 -0
  89. package/dist/src/_dependencies/source/0x2/transfer/structs.js +172 -0
  90. package/dist/src/_dependencies/source/0x2/transfer-policy/structs.d.ts +345 -0
  91. package/dist/src/_dependencies/source/0x2/transfer-policy/structs.js +665 -0
  92. package/dist/src/_dependencies/source/0x2/tx-context/structs.d.ts +68 -0
  93. package/dist/src/_dependencies/source/0x2/tx-context/structs.js +199 -0
  94. package/dist/src/_dependencies/source/0x2/url/structs.d.ts +48 -0
  95. package/dist/src/_dependencies/source/0x2/url/structs.js +168 -0
  96. package/dist/src/_dependencies/source/0x2/vec-map/structs.d.ts +101 -0
  97. package/dist/src/_dependencies/source/0x2/vec-map/structs.js +286 -0
  98. package/dist/src/_dependencies/source/0x2/vec-set/structs.d.ts +45 -0
  99. package/dist/src/_dependencies/source/0x2/vec-set/structs.js +196 -0
  100. package/dist/src/_dependencies/source/0x2/versioned/structs.d.ts +104 -0
  101. package/dist/src/_dependencies/source/0x2/versioned/structs.js +261 -0
  102. package/dist/src/_dependencies/source/0x2/zklogin-verified-id/structs.d.ts +105 -0
  103. package/dist/src/_dependencies/source/0x2/zklogin-verified-id/structs.js +179 -0
  104. package/dist/src/_dependencies/source/0x2/zklogin-verified-issuer/structs.d.ts +69 -0
  105. package/dist/src/_dependencies/source/0x2/zklogin-verified-issuer/structs.js +173 -0
  106. package/dist/src/_dependencies/source/0x277f90d256d1015a78cad646db091bec451c5bbab834b9fb70bace7885b5c698/index.d.ts +2 -0
  107. package/dist/src/_dependencies/source/0x277f90d256d1015a78cad646db091bec451c5bbab834b9fb70bace7885b5c698/index.js +5 -0
  108. package/dist/src/_dependencies/source/0x277f90d256d1015a78cad646db091bec451c5bbab834b9fb70bace7885b5c698/init.d.ts +2 -0
  109. package/dist/src/_dependencies/source/0x277f90d256d1015a78cad646db091bec451c5bbab834b9fb70bace7885b5c698/init.js +30 -0
  110. package/dist/src/_dependencies/source/0x277f90d256d1015a78cad646db091bec451c5bbab834b9fb70bace7885b5c698/validator/structs.d.ts +50 -0
  111. package/dist/src/_dependencies/source/0x277f90d256d1015a78cad646db091bec451c5bbab834b9fb70bace7885b5c698/validator/structs.js +168 -0
  112. package/dist/src/_dependencies/source/0x2fdff17b86e34ab722c8ba5e63f0da070d9a4163705b3fdc6a95802cab40a72a/index.d.ts +2 -0
  113. package/dist/src/_dependencies/source/0x2fdff17b86e34ab722c8ba5e63f0da070d9a4163705b3fdc6a95802cab40a72a/index.js +5 -0
  114. package/dist/src/_dependencies/source/0x2fdff17b86e34ab722c8ba5e63f0da070d9a4163705b3fdc6a95802cab40a72a/init.d.ts +2 -0
  115. package/dist/src/_dependencies/source/0x2fdff17b86e34ab722c8ba5e63f0da070d9a4163705b3fdc6a95802cab40a72a/init.js +33 -0
  116. package/dist/src/_dependencies/source/0x2fdff17b86e34ab722c8ba5e63f0da070d9a4163705b3fdc6a95802cab40a72a/price-data-pull/structs.d.ts +41 -0
  117. package/dist/src/_dependencies/source/0x2fdff17b86e34ab722c8ba5e63f0da070d9a4163705b3fdc6a95802cab40a72a/price-data-pull/structs.js +167 -0
  118. package/dist/src/_dependencies/source/0x2fdff17b86e34ab722c8ba5e63f0da070d9a4163705b3fdc6a95802cab40a72a/suprasvaluefeed/structs.d.ts +112 -0
  119. package/dist/src/_dependencies/source/0x2fdff17b86e34ab722c8ba5e63f0da070d9a4163705b3fdc6a95802cab40a72a/suprasvaluefeed/structs.js +265 -0
  120. package/dist/src/_dependencies/source/0x4213e12a2220f15f1837a76897110d2260786558169bd8d0847f21e9b551f277/airdrop/structs.d.ts +463 -0
  121. package/dist/src/_dependencies/source/0x4213e12a2220f15f1837a76897110d2260786558169bd8d0847f21e9b551f277/airdrop/structs.js +669 -0
  122. package/dist/src/_dependencies/source/0x4213e12a2220f15f1837a76897110d2260786558169bd8d0847f21e9b551f277/big-vector/structs.d.ts +137 -0
  123. package/dist/src/_dependencies/source/0x4213e12a2220f15f1837a76897110d2260786558169bd8d0847f21e9b551f277/big-vector/structs.js +401 -0
  124. package/dist/src/_dependencies/source/0x4213e12a2220f15f1837a76897110d2260786558169bd8d0847f21e9b551f277/critbit/structs.d.ts +226 -0
  125. package/dist/src/_dependencies/source/0x4213e12a2220f15f1837a76897110d2260786558169bd8d0847f21e9b551f277/critbit/structs.js +402 -0
  126. package/dist/src/_dependencies/source/0x4213e12a2220f15f1837a76897110d2260786558169bd8d0847f21e9b551f277/ecosystem/structs.d.ts +383 -0
  127. package/dist/src/_dependencies/source/0x4213e12a2220f15f1837a76897110d2260786558169bd8d0847f21e9b551f277/ecosystem/structs.js +566 -0
  128. package/dist/src/_dependencies/source/0x4213e12a2220f15f1837a76897110d2260786558169bd8d0847f21e9b551f277/index.d.ts +2 -0
  129. package/dist/src/_dependencies/source/0x4213e12a2220f15f1837a76897110d2260786558169bd8d0847f21e9b551f277/index.js +5 -0
  130. package/dist/src/_dependencies/source/0x4213e12a2220f15f1837a76897110d2260786558169bd8d0847f21e9b551f277/init.d.ts +2 -0
  131. package/dist/src/_dependencies/source/0x4213e12a2220f15f1837a76897110d2260786558169bd8d0847f21e9b551f277/init.js +73 -0
  132. package/dist/src/_dependencies/source/0x4213e12a2220f15f1837a76897110d2260786558169bd8d0847f21e9b551f277/leaderboard/structs.d.ts +591 -0
  133. package/dist/src/_dependencies/source/0x4213e12a2220f15f1837a76897110d2260786558169bd8d0847f21e9b551f277/leaderboard/structs.js +774 -0
  134. package/dist/src/_dependencies/source/0x4213e12a2220f15f1837a76897110d2260786558169bd8d0847f21e9b551f277/linked-object-table/structs.d.ts +152 -0
  135. package/dist/src/_dependencies/source/0x4213e12a2220f15f1837a76897110d2260786558169bd8d0847f21e9b551f277/linked-object-table/structs.js +272 -0
  136. package/dist/src/_dependencies/source/0x4213e12a2220f15f1837a76897110d2260786558169bd8d0847f21e9b551f277/linked-set/structs.d.ts +138 -0
  137. package/dist/src/_dependencies/source/0x4213e12a2220f15f1837a76897110d2260786558169bd8d0847f21e9b551f277/linked-set/structs.js +276 -0
  138. package/dist/src/_dependencies/source/0x4213e12a2220f15f1837a76897110d2260786558169bd8d0847f21e9b551f277/tgld/structs.d.ts +261 -0
  139. package/dist/src/_dependencies/source/0x4213e12a2220f15f1837a76897110d2260786558169bd8d0847f21e9b551f277/tgld/structs.js +471 -0
  140. package/dist/src/_dependencies/source/0x4213e12a2220f15f1837a76897110d2260786558169bd8d0847f21e9b551f277/user/structs.d.ts +306 -0
  141. package/dist/src/_dependencies/source/0x4213e12a2220f15f1837a76897110d2260786558169bd8d0847f21e9b551f277/user/structs.js +563 -0
  142. package/dist/src/_dependencies/source/0x5cfd0819411be98034cba544cbffab192c2c35674a05ff57f4f1c5042875b828/discount-mint/structs.d.ts +598 -0
  143. package/dist/src/_dependencies/source/0x5cfd0819411be98034cba544cbffab192c2c35674a05ff57f4f1c5042875b828/discount-mint/structs.js +789 -0
  144. package/dist/src/_dependencies/source/0x5cfd0819411be98034cba544cbffab192c2c35674a05ff57f4f1c5042875b828/index.d.ts +2 -0
  145. package/dist/src/_dependencies/source/0x5cfd0819411be98034cba544cbffab192c2c35674a05ff57f4f1c5042875b828/index.js +5 -0
  146. package/dist/src/_dependencies/source/0x5cfd0819411be98034cba544cbffab192c2c35674a05ff57f4f1c5042875b828/init.d.ts +2 -0
  147. package/dist/src/_dependencies/source/0x5cfd0819411be98034cba544cbffab192c2c35674a05ff57f4f1c5042875b828/init.js +61 -0
  148. package/dist/src/_dependencies/source/0x5cfd0819411be98034cba544cbffab192c2c35674a05ff57f4f1c5042875b828/royalty-rule/structs.d.ts +85 -0
  149. package/dist/src/_dependencies/source/0x5cfd0819411be98034cba544cbffab192c2c35674a05ff57f4f1c5042875b828/royalty-rule/structs.js +258 -0
  150. package/dist/src/_dependencies/source/0x5cfd0819411be98034cba544cbffab192c2c35674a05ff57f4f1c5042875b828/staking/structs.d.ts +433 -0
  151. package/dist/src/_dependencies/source/0x5cfd0819411be98034cba544cbffab192c2c35674a05ff57f4f1c5042875b828/staking/structs.js +562 -0
  152. package/dist/src/_dependencies/source/0x5cfd0819411be98034cba544cbffab192c2c35674a05ff57f4f1c5042875b828/table-vec/structs.d.ts +63 -0
  153. package/dist/src/_dependencies/source/0x5cfd0819411be98034cba544cbffab192c2c35674a05ff57f4f1c5042875b828/table-vec/structs.js +194 -0
  154. package/dist/src/_dependencies/source/0x5cfd0819411be98034cba544cbffab192c2c35674a05ff57f4f1c5042875b828/typus-nft/structs.d.ts +1006 -0
  155. package/dist/src/_dependencies/source/0x5cfd0819411be98034cba544cbffab192c2c35674a05ff57f4f1c5042875b828/typus-nft/structs.js +1331 -0
  156. package/dist/src/_dependencies/source/0x6c9a394a43844fc09d9617bc8a8e775a4521f0e28e83de1da780d043a498671f/auto-bid/structs.d.ts +1458 -0
  157. package/dist/src/_dependencies/source/0x6c9a394a43844fc09d9617bc8a8e775a4521f0e28e83de1da780d043a498671f/auto-bid/structs.js +1706 -0
  158. package/dist/src/_dependencies/source/0x6c9a394a43844fc09d9617bc8a8e775a4521f0e28e83de1da780d043a498671f/index.d.ts +2 -0
  159. package/dist/src/_dependencies/source/0x6c9a394a43844fc09d9617bc8a8e775a4521f0e28e83de1da780d043a498671f/index.js +5 -0
  160. package/dist/src/_dependencies/source/0x6c9a394a43844fc09d9617bc8a8e775a4521f0e28e83de1da780d043a498671f/init.d.ts +2 -0
  161. package/dist/src/_dependencies/source/0x6c9a394a43844fc09d9617bc8a8e775a4521f0e28e83de1da780d043a498671f/init.js +129 -0
  162. package/dist/src/_dependencies/source/0x6c9a394a43844fc09d9617bc8a8e775a4521f0e28e83de1da780d043a498671f/tails-staking/structs.d.ts +1201 -0
  163. package/dist/src/_dependencies/source/0x6c9a394a43844fc09d9617bc8a8e775a4521f0e28e83de1da780d043a498671f/tails-staking/structs.js +1643 -0
  164. package/dist/src/_dependencies/source/0x6c9a394a43844fc09d9617bc8a8e775a4521f0e28e83de1da780d043a498671f/tds-authorized-entry/structs.d.ts +1374 -0
  165. package/dist/src/_dependencies/source/0x6c9a394a43844fc09d9617bc8a8e775a4521f0e28e83de1da780d043a498671f/tds-authorized-entry/structs.js +971 -0
  166. package/dist/src/_dependencies/source/0x6c9a394a43844fc09d9617bc8a8e775a4521f0e28e83de1da780d043a498671f/tds-fee-pool-entry/structs.d.ts +395 -0
  167. package/dist/src/_dependencies/source/0x6c9a394a43844fc09d9617bc8a8e775a4521f0e28e83de1da780d043a498671f/tds-fee-pool-entry/structs.js +750 -0
  168. package/dist/src/_dependencies/source/0x6c9a394a43844fc09d9617bc8a8e775a4521f0e28e83de1da780d043a498671f/tds-registry-authorized-entry/structs.d.ts +994 -0
  169. package/dist/src/_dependencies/source/0x6c9a394a43844fc09d9617bc8a8e775a4521f0e28e83de1da780d043a498671f/tds-registry-authorized-entry/structs.js +933 -0
  170. package/dist/src/_dependencies/source/0x6c9a394a43844fc09d9617bc8a8e775a4521f0e28e83de1da780d043a498671f/tds-view-function/structs.d.ts +77 -0
  171. package/dist/src/_dependencies/source/0x6c9a394a43844fc09d9617bc8a8e775a4521f0e28e83de1da780d043a498671f/tds-view-function/structs.js +179 -0
  172. package/dist/src/_dependencies/source/0x6c9a394a43844fc09d9617bc8a8e775a4521f0e28e83de1da780d043a498671f/typus-dov-single/structs.d.ts +4562 -0
  173. package/dist/src/_dependencies/source/0x6c9a394a43844fc09d9617bc8a8e775a4521f0e28e83de1da780d043a498671f/typus-dov-single/structs.js +3796 -0
  174. package/dist/src/_dependencies/source/0x7237ec8436ef7e927c45470db6db3a834dd84cf903aedee3844e847fe4805399/index.d.ts +2 -0
  175. package/dist/src/_dependencies/source/0x7237ec8436ef7e927c45470db6db3a834dd84cf903aedee3844e847fe4805399/index.js +5 -0
  176. package/dist/src/_dependencies/source/0x7237ec8436ef7e927c45470db6db3a834dd84cf903aedee3844e847fe4805399/init.d.ts +2 -0
  177. package/dist/src/_dependencies/source/0x7237ec8436ef7e927c45470db6db3a834dd84cf903aedee3844e847fe4805399/init.js +4 -0
  178. package/dist/src/_dependencies/source/0x908a10789a1a6953e0b73a997c10e3552f7ce4e2907afd00a334ed74bd973ded/authority/structs.d.ts +83 -0
  179. package/dist/src/_dependencies/source/0x908a10789a1a6953e0b73a997c10e3552f7ce4e2907afd00a334ed74bd973ded/authority/structs.js +192 -0
  180. package/dist/src/_dependencies/source/0x908a10789a1a6953e0b73a997c10e3552f7ce4e2907afd00a334ed74bd973ded/balance-pool/structs.d.ts +333 -0
  181. package/dist/src/_dependencies/source/0x908a10789a1a6953e0b73a997c10e3552f7ce4e2907afd00a334ed74bd973ded/balance-pool/structs.js +382 -0
  182. package/dist/src/_dependencies/source/0x908a10789a1a6953e0b73a997c10e3552f7ce4e2907afd00a334ed74bd973ded/big-vector/structs.d.ts +68 -0
  183. package/dist/src/_dependencies/source/0x908a10789a1a6953e0b73a997c10e3552f7ce4e2907afd00a334ed74bd973ded/big-vector/structs.js +176 -0
  184. package/dist/src/_dependencies/source/0x908a10789a1a6953e0b73a997c10e3552f7ce4e2907afd00a334ed74bd973ded/dutch/structs.d.ts +843 -0
  185. package/dist/src/_dependencies/source/0x908a10789a1a6953e0b73a997c10e3552f7ce4e2907afd00a334ed74bd973ded/dutch/structs.js +959 -0
  186. package/dist/src/_dependencies/source/0x908a10789a1a6953e0b73a997c10e3552f7ce4e2907afd00a334ed74bd973ded/i64/structs.d.ts +41 -0
  187. package/dist/src/_dependencies/source/0x908a10789a1a6953e0b73a997c10e3552f7ce4e2907afd00a334ed74bd973ded/i64/structs.js +167 -0
  188. package/dist/src/_dependencies/source/0x908a10789a1a6953e0b73a997c10e3552f7ce4e2907afd00a334ed74bd973ded/index.d.ts +2 -0
  189. package/dist/src/_dependencies/source/0x908a10789a1a6953e0b73a997c10e3552f7ce4e2907afd00a334ed74bd973ded/index.js +5 -0
  190. package/dist/src/_dependencies/source/0x908a10789a1a6953e0b73a997c10e3552f7ce4e2907afd00a334ed74bd973ded/init.d.ts +2 -0
  191. package/dist/src/_dependencies/source/0x908a10789a1a6953e0b73a997c10e3552f7ce4e2907afd00a334ed74bd973ded/init.js +79 -0
  192. package/dist/src/_dependencies/source/0x908a10789a1a6953e0b73a997c10e3552f7ce4e2907afd00a334ed74bd973ded/linked-list/structs.d.ts +146 -0
  193. package/dist/src/_dependencies/source/0x908a10789a1a6953e0b73a997c10e3552f7ce4e2907afd00a334ed74bd973ded/linked-list/structs.js +274 -0
  194. package/dist/src/_dependencies/source/0x908a10789a1a6953e0b73a997c10e3552f7ce4e2907afd00a334ed74bd973ded/vault/structs.d.ts +2272 -0
  195. package/dist/src/_dependencies/source/0x908a10789a1a6953e0b73a997c10e3552f7ce4e2907afd00a334ed74bd973ded/vault/structs.js +2830 -0
  196. package/dist/src/_dependencies/source/0x98670585b87e06628ef2d7f7cb1e7bee8ada65b43b82997935225a7e6e21d18e/aggregator/structs.d.ts +719 -0
  197. package/dist/src/_dependencies/source/0x98670585b87e06628ef2d7f7cb1e7bee8ada65b43b82997935225a7e6e21d18e/aggregator/structs.js +711 -0
  198. package/dist/src/_dependencies/source/0x98670585b87e06628ef2d7f7cb1e7bee8ada65b43b82997935225a7e6e21d18e/index.d.ts +2 -0
  199. package/dist/src/_dependencies/source/0x98670585b87e06628ef2d7f7cb1e7bee8ada65b43b82997935225a7e6e21d18e/index.js +5 -0
  200. package/dist/src/_dependencies/source/0x98670585b87e06628ef2d7f7cb1e7bee8ada65b43b82997935225a7e6e21d18e/init.d.ts +2 -0
  201. package/dist/src/_dependencies/source/0x98670585b87e06628ef2d7f7cb1e7bee8ada65b43b82997935225a7e6e21d18e/init.js +43 -0
  202. package/dist/src/_dependencies/source/0x98670585b87e06628ef2d7f7cb1e7bee8ada65b43b82997935225a7e6e21d18e/job/structs.d.ts +81 -0
  203. package/dist/src/_dependencies/source/0x98670585b87e06628ef2d7f7cb1e7bee8ada65b43b82997935225a7e6e21d18e/job/structs.js +200 -0
  204. package/dist/src/_dependencies/source/0x98670585b87e06628ef2d7f7cb1e7bee8ada65b43b82997935225a7e6e21d18e/math/structs.d.ts +53 -0
  205. package/dist/src/_dependencies/source/0x98670585b87e06628ef2d7f7cb1e7bee8ada65b43b82997935225a7e6e21d18e/math/structs.js +171 -0
  206. package/dist/src/_dependencies/source/0x98670585b87e06628ef2d7f7cb1e7bee8ada65b43b82997935225a7e6e21d18e/quote/structs.d.ts +115 -0
  207. package/dist/src/_dependencies/source/0x98670585b87e06628ef2d7f7cb1e7bee8ada65b43b82997935225a7e6e21d18e/quote/structs.js +212 -0
  208. package/dist/src/_dependencies/source/0x98670585b87e06628ef2d7f7cb1e7bee8ada65b43b82997935225a7e6e21d18e/switchboard/structs.d.ts +50 -0
  209. package/dist/src/_dependencies/source/0x98670585b87e06628ef2d7f7cb1e7bee8ada65b43b82997935225a7e6e21d18e/switchboard/structs.js +168 -0
  210. package/dist/src/_dependencies/source/0xbd8fc1947cf119350184107a3087e2dc27efefa0dd82e25a1f699069fe81a585/index.d.ts +2 -0
  211. package/dist/src/_dependencies/source/0xbd8fc1947cf119350184107a3087e2dc27efefa0dd82e25a1f699069fe81a585/index.js +5 -0
  212. package/dist/src/_dependencies/source/0xbd8fc1947cf119350184107a3087e2dc27efefa0dd82e25a1f699069fe81a585/init.d.ts +2 -0
  213. package/dist/src/_dependencies/source/0xbd8fc1947cf119350184107a3087e2dc27efefa0dd82e25a1f699069fe81a585/init.js +36 -0
  214. package/dist/src/_dependencies/source/0xbd8fc1947cf119350184107a3087e2dc27efefa0dd82e25a1f699069fe81a585/kiosk-lock-rule/structs.d.ts +79 -0
  215. package/dist/src/_dependencies/source/0xbd8fc1947cf119350184107a3087e2dc27efefa0dd82e25a1f699069fe81a585/kiosk-lock-rule/structs.js +256 -0
  216. package/dist/src/_dependencies/source/0xbd8fc1947cf119350184107a3087e2dc27efefa0dd82e25a1f699069fe81a585/royalty-rule/structs.d.ts +85 -0
  217. package/dist/src/_dependencies/source/0xbd8fc1947cf119350184107a3087e2dc27efefa0dd82e25a1f699069fe81a585/royalty-rule/structs.js +258 -0
  218. package/dist/src/_dependencies/source/0xbd8fc1947cf119350184107a3087e2dc27efefa0dd82e25a1f699069fe81a585/witness-rule/structs.d.ts +41 -0
  219. package/dist/src/_dependencies/source/0xbd8fc1947cf119350184107a3087e2dc27efefa0dd82e25a1f699069fe81a585/witness-rule/structs.js +169 -0
  220. package/dist/src/_dependencies/source/0xcc029e2810f17f9f43f52262f40026a71fbdca40ed3803ad2884994361910b7e/bytes20/structs.d.ts +44 -0
  221. package/dist/src/_dependencies/source/0xcc029e2810f17f9f43f52262f40026a71fbdca40ed3803ad2884994361910b7e/bytes20/structs.js +191 -0
  222. package/dist/src/_dependencies/source/0xcc029e2810f17f9f43f52262f40026a71fbdca40ed3803ad2884994361910b7e/bytes32/structs.d.ts +44 -0
  223. package/dist/src/_dependencies/source/0xcc029e2810f17f9f43f52262f40026a71fbdca40ed3803ad2884994361910b7e/bytes32/structs.js +191 -0
  224. package/dist/src/_dependencies/source/0xcc029e2810f17f9f43f52262f40026a71fbdca40ed3803ad2884994361910b7e/consumed-vaas/structs.d.ts +72 -0
  225. package/dist/src/_dependencies/source/0xcc029e2810f17f9f43f52262f40026a71fbdca40ed3803ad2884994361910b7e/consumed-vaas/structs.js +193 -0
  226. package/dist/src/_dependencies/source/0xcc029e2810f17f9f43f52262f40026a71fbdca40ed3803ad2884994361910b7e/cursor/structs.d.ts +45 -0
  227. package/dist/src/_dependencies/source/0xcc029e2810f17f9f43f52262f40026a71fbdca40ed3803ad2884994361910b7e/cursor/structs.js +196 -0
  228. package/dist/src/_dependencies/source/0xcc029e2810f17f9f43f52262f40026a71fbdca40ed3803ad2884994361910b7e/emitter/structs.d.ts +140 -0
  229. package/dist/src/_dependencies/source/0xcc029e2810f17f9f43f52262f40026a71fbdca40ed3803ad2884994361910b7e/emitter/structs.js +348 -0
  230. package/dist/src/_dependencies/source/0xcc029e2810f17f9f43f52262f40026a71fbdca40ed3803ad2884994361910b7e/external-address/structs.d.ts +52 -0
  231. package/dist/src/_dependencies/source/0xcc029e2810f17f9f43f52262f40026a71fbdca40ed3803ad2884994361910b7e/external-address/structs.js +168 -0
  232. package/dist/src/_dependencies/source/0xcc029e2810f17f9f43f52262f40026a71fbdca40ed3803ad2884994361910b7e/fee-collector/structs.d.ts +58 -0
  233. package/dist/src/_dependencies/source/0xcc029e2810f17f9f43f52262f40026a71fbdca40ed3803ad2884994361910b7e/fee-collector/structs.js +195 -0
  234. package/dist/src/_dependencies/source/0xcc029e2810f17f9f43f52262f40026a71fbdca40ed3803ad2884994361910b7e/governance-message/structs.d.ts +158 -0
  235. package/dist/src/_dependencies/source/0xcc029e2810f17f9f43f52262f40026a71fbdca40ed3803ad2884994361910b7e/governance-message/structs.js +298 -0
  236. package/dist/src/_dependencies/source/0xcc029e2810f17f9f43f52262f40026a71fbdca40ed3803ad2884994361910b7e/guardian/structs.d.ts +52 -0
  237. package/dist/src/_dependencies/source/0xcc029e2810f17f9f43f52262f40026a71fbdca40ed3803ad2884994361910b7e/guardian/structs.js +168 -0
  238. package/dist/src/_dependencies/source/0xcc029e2810f17f9f43f52262f40026a71fbdca40ed3803ad2884994361910b7e/guardian-set/structs.d.ts +75 -0
  239. package/dist/src/_dependencies/source/0xcc029e2810f17f9f43f52262f40026a71fbdca40ed3803ad2884994361910b7e/guardian-set/structs.js +196 -0
  240. package/dist/src/_dependencies/source/0xcc029e2810f17f9f43f52262f40026a71fbdca40ed3803ad2884994361910b7e/guardian-signature/structs.d.ts +80 -0
  241. package/dist/src/_dependencies/source/0xcc029e2810f17f9f43f52262f40026a71fbdca40ed3803ad2884994361910b7e/guardian-signature/structs.js +174 -0
  242. package/dist/src/_dependencies/source/0xcc029e2810f17f9f43f52262f40026a71fbdca40ed3803ad2884994361910b7e/index.d.ts +2 -0
  243. package/dist/src/_dependencies/source/0xcc029e2810f17f9f43f52262f40026a71fbdca40ed3803ad2884994361910b7e/index.js +5 -0
  244. package/dist/src/_dependencies/source/0xcc029e2810f17f9f43f52262f40026a71fbdca40ed3803ad2884994361910b7e/init.d.ts +2 -0
  245. package/dist/src/_dependencies/source/0xcc029e2810f17f9f43f52262f40026a71fbdca40ed3803ad2884994361910b7e/init.js +90 -0
  246. package/dist/src/_dependencies/source/0xcc029e2810f17f9f43f52262f40026a71fbdca40ed3803ad2884994361910b7e/migrate/structs.d.ts +46 -0
  247. package/dist/src/_dependencies/source/0xcc029e2810f17f9f43f52262f40026a71fbdca40ed3803ad2884994361910b7e/migrate/structs.js +168 -0
  248. package/dist/src/_dependencies/source/0xcc029e2810f17f9f43f52262f40026a71fbdca40ed3803ad2884994361910b7e/package-utils/structs.d.ts +177 -0
  249. package/dist/src/_dependencies/source/0xcc029e2810f17f9f43f52262f40026a71fbdca40ed3803ad2884994361910b7e/package-utils/structs.js +438 -0
  250. package/dist/src/_dependencies/source/0xcc029e2810f17f9f43f52262f40026a71fbdca40ed3803ad2884994361910b7e/publish-message/structs.d.ts +141 -0
  251. package/dist/src/_dependencies/source/0xcc029e2810f17f9f43f52262f40026a71fbdca40ed3803ad2884994361910b7e/publish-message/structs.js +297 -0
  252. package/dist/src/_dependencies/source/0xcc029e2810f17f9f43f52262f40026a71fbdca40ed3803ad2884994361910b7e/set/structs.d.ts +101 -0
  253. package/dist/src/_dependencies/source/0xcc029e2810f17f9f43f52262f40026a71fbdca40ed3803ad2884994361910b7e/set/structs.js +283 -0
  254. package/dist/src/_dependencies/source/0xcc029e2810f17f9f43f52262f40026a71fbdca40ed3803ad2884994361910b7e/set-fee/structs.d.ts +79 -0
  255. package/dist/src/_dependencies/source/0xcc029e2810f17f9f43f52262f40026a71fbdca40ed3803ad2884994361910b7e/set-fee/structs.js +256 -0
  256. package/dist/src/_dependencies/source/0xcc029e2810f17f9f43f52262f40026a71fbdca40ed3803ad2884994361910b7e/setup/structs.d.ts +50 -0
  257. package/dist/src/_dependencies/source/0xcc029e2810f17f9f43f52262f40026a71fbdca40ed3803ad2884994361910b7e/setup/structs.js +168 -0
  258. package/dist/src/_dependencies/source/0xcc029e2810f17f9f43f52262f40026a71fbdca40ed3803ad2884994361910b7e/state/structs.d.ts +269 -0
  259. package/dist/src/_dependencies/source/0xcc029e2810f17f9f43f52262f40026a71fbdca40ed3803ad2884994361910b7e/state/structs.js +303 -0
  260. package/dist/src/_dependencies/source/0xcc029e2810f17f9f43f52262f40026a71fbdca40ed3803ad2884994361910b7e/transfer-fee/structs.d.ts +85 -0
  261. package/dist/src/_dependencies/source/0xcc029e2810f17f9f43f52262f40026a71fbdca40ed3803ad2884994361910b7e/transfer-fee/structs.js +258 -0
  262. package/dist/src/_dependencies/source/0xcc029e2810f17f9f43f52262f40026a71fbdca40ed3803ad2884994361910b7e/update-guardian-set/structs.d.ts +145 -0
  263. package/dist/src/_dependencies/source/0xcc029e2810f17f9f43f52262f40026a71fbdca40ed3803ad2884994361910b7e/update-guardian-set/structs.js +372 -0
  264. package/dist/src/_dependencies/source/0xcc029e2810f17f9f43f52262f40026a71fbdca40ed3803ad2884994361910b7e/upgrade-contract/structs.d.ts +143 -0
  265. package/dist/src/_dependencies/source/0xcc029e2810f17f9f43f52262f40026a71fbdca40ed3803ad2884994361910b7e/upgrade-contract/structs.js +349 -0
  266. package/dist/src/_dependencies/source/0xcc029e2810f17f9f43f52262f40026a71fbdca40ed3803ad2884994361910b7e/vaa/structs.d.ts +122 -0
  267. package/dist/src/_dependencies/source/0xcc029e2810f17f9f43f52262f40026a71fbdca40ed3803ad2884994361910b7e/vaa/structs.js +209 -0
  268. package/dist/src/_dependencies/source/0xcc029e2810f17f9f43f52262f40026a71fbdca40ed3803ad2884994361910b7e/version-control/structs.d.ts +79 -0
  269. package/dist/src/_dependencies/source/0xcc029e2810f17f9f43f52262f40026a71fbdca40ed3803ad2884994361910b7e/version-control/structs.js +256 -0
  270. package/dist/src/_dependencies/source/0xe76d8a37d4132278a7a752183e90e04890b9e7d0f6657eadb68821609a2a56a3/batch-price-attestation/structs.d.ts +279 -0
  271. package/dist/src/_dependencies/source/0xe76d8a37d4132278a7a752183e90e04890b9e7d0f6657eadb68821609a2a56a3/batch-price-attestation/structs.js +295 -0
  272. package/dist/src/_dependencies/source/0xe76d8a37d4132278a7a752183e90e04890b9e7d0f6657eadb68821609a2a56a3/contract-upgrade/structs.d.ts +105 -0
  273. package/dist/src/_dependencies/source/0xe76d8a37d4132278a7a752183e90e04890b9e7d0f6657eadb68821609a2a56a3/contract-upgrade/structs.js +260 -0
  274. package/dist/src/_dependencies/source/0xe76d8a37d4132278a7a752183e90e04890b9e7d0f6657eadb68821609a2a56a3/data-source/structs.d.ts +66 -0
  275. package/dist/src/_dependencies/source/0xe76d8a37d4132278a7a752183e90e04890b9e7d0f6657eadb68821609a2a56a3/data-source/structs.js +170 -0
  276. package/dist/src/_dependencies/source/0xe76d8a37d4132278a7a752183e90e04890b9e7d0f6657eadb68821609a2a56a3/event/structs.d.ts +200 -0
  277. package/dist/src/_dependencies/source/0xe76d8a37d4132278a7a752183e90e04890b9e7d0f6657eadb68821609a2a56a3/event/structs.js +259 -0
  278. package/dist/src/_dependencies/source/0xe76d8a37d4132278a7a752183e90e04890b9e7d0f6657eadb68821609a2a56a3/governance/structs.d.ts +67 -0
  279. package/dist/src/_dependencies/source/0xe76d8a37d4132278a7a752183e90e04890b9e7d0f6657eadb68821609a2a56a3/governance/structs.js +196 -0
  280. package/dist/src/_dependencies/source/0xe76d8a37d4132278a7a752183e90e04890b9e7d0f6657eadb68821609a2a56a3/governance-action/structs.d.ts +41 -0
  281. package/dist/src/_dependencies/source/0xe76d8a37d4132278a7a752183e90e04890b9e7d0f6657eadb68821609a2a56a3/governance-action/structs.js +167 -0
  282. package/dist/src/_dependencies/source/0xe76d8a37d4132278a7a752183e90e04890b9e7d0f6657eadb68821609a2a56a3/governance-instruction/structs.d.ts +71 -0
  283. package/dist/src/_dependencies/source/0xe76d8a37d4132278a7a752183e90e04890b9e7d0f6657eadb68821609a2a56a3/governance-instruction/structs.js +198 -0
  284. package/dist/src/_dependencies/source/0xe76d8a37d4132278a7a752183e90e04890b9e7d0f6657eadb68821609a2a56a3/hot-potato-vector/structs.d.ts +45 -0
  285. package/dist/src/_dependencies/source/0xe76d8a37d4132278a7a752183e90e04890b9e7d0f6657eadb68821609a2a56a3/hot-potato-vector/structs.js +196 -0
  286. package/dist/src/_dependencies/source/0xe76d8a37d4132278a7a752183e90e04890b9e7d0f6657eadb68821609a2a56a3/i64/structs.d.ts +47 -0
  287. package/dist/src/_dependencies/source/0xe76d8a37d4132278a7a752183e90e04890b9e7d0f6657eadb68821609a2a56a3/i64/structs.js +169 -0
  288. package/dist/src/_dependencies/source/0xe76d8a37d4132278a7a752183e90e04890b9e7d0f6657eadb68821609a2a56a3/index.d.ts +2 -0
  289. package/dist/src/_dependencies/source/0xe76d8a37d4132278a7a752183e90e04890b9e7d0f6657eadb68821609a2a56a3/index.js +5 -0
  290. package/dist/src/_dependencies/source/0xe76d8a37d4132278a7a752183e90e04890b9e7d0f6657eadb68821609a2a56a3/init.d.ts +2 -0
  291. package/dist/src/_dependencies/source/0xe76d8a37d4132278a7a752183e90e04890b9e7d0f6657eadb68821609a2a56a3/init.js +84 -0
  292. package/dist/src/_dependencies/source/0xe76d8a37d4132278a7a752183e90e04890b9e7d0f6657eadb68821609a2a56a3/migrate/structs.d.ts +46 -0
  293. package/dist/src/_dependencies/source/0xe76d8a37d4132278a7a752183e90e04890b9e7d0f6657eadb68821609a2a56a3/migrate/structs.js +168 -0
  294. package/dist/src/_dependencies/source/0xe76d8a37d4132278a7a752183e90e04890b9e7d0f6657eadb68821609a2a56a3/price/structs.d.ts +84 -0
  295. package/dist/src/_dependencies/source/0xe76d8a37d4132278a7a752183e90e04890b9e7d0f6657eadb68821609a2a56a3/price/structs.js +174 -0
  296. package/dist/src/_dependencies/source/0xe76d8a37d4132278a7a752183e90e04890b9e7d0f6657eadb68821609a2a56a3/price-feed/structs.d.ts +153 -0
  297. package/dist/src/_dependencies/source/0xe76d8a37d4132278a7a752183e90e04890b9e7d0f6657eadb68821609a2a56a3/price-feed/structs.js +173 -0
  298. package/dist/src/_dependencies/source/0xe76d8a37d4132278a7a752183e90e04890b9e7d0f6657eadb68821609a2a56a3/price-identifier/structs.d.ts +44 -0
  299. package/dist/src/_dependencies/source/0xe76d8a37d4132278a7a752183e90e04890b9e7d0f6657eadb68821609a2a56a3/price-identifier/structs.js +191 -0
  300. package/dist/src/_dependencies/source/0xe76d8a37d4132278a7a752183e90e04890b9e7d0f6657eadb68821609a2a56a3/price-info/structs.d.ts +351 -0
  301. package/dist/src/_dependencies/source/0xe76d8a37d4132278a7a752183e90e04890b9e7d0f6657eadb68821609a2a56a3/price-info/structs.js +264 -0
  302. package/dist/src/_dependencies/source/0xe76d8a37d4132278a7a752183e90e04890b9e7d0f6657eadb68821609a2a56a3/price-status/structs.d.ts +41 -0
  303. package/dist/src/_dependencies/source/0xe76d8a37d4132278a7a752183e90e04890b9e7d0f6657eadb68821609a2a56a3/price-status/structs.js +167 -0
  304. package/dist/src/_dependencies/source/0xe76d8a37d4132278a7a752183e90e04890b9e7d0f6657eadb68821609a2a56a3/set/structs.d.ts +110 -0
  305. package/dist/src/_dependencies/source/0xe76d8a37d4132278a7a752183e90e04890b9e7d0f6657eadb68821609a2a56a3/set/structs.js +288 -0
  306. package/dist/src/_dependencies/source/0xe76d8a37d4132278a7a752183e90e04890b9e7d0f6657eadb68821609a2a56a3/set-data-sources/structs.d.ts +75 -0
  307. package/dist/src/_dependencies/source/0xe76d8a37d4132278a7a752183e90e04890b9e7d0f6657eadb68821609a2a56a3/set-data-sources/structs.js +192 -0
  308. package/dist/src/_dependencies/source/0xe76d8a37d4132278a7a752183e90e04890b9e7d0f6657eadb68821609a2a56a3/set-fee-recipient/structs.d.ts +41 -0
  309. package/dist/src/_dependencies/source/0xe76d8a37d4132278a7a752183e90e04890b9e7d0f6657eadb68821609a2a56a3/set-fee-recipient/structs.js +167 -0
  310. package/dist/src/_dependencies/source/0xe76d8a37d4132278a7a752183e90e04890b9e7d0f6657eadb68821609a2a56a3/set-governance-data-source/structs.d.ts +72 -0
  311. package/dist/src/_dependencies/source/0xe76d8a37d4132278a7a752183e90e04890b9e7d0f6657eadb68821609a2a56a3/set-governance-data-source/structs.js +172 -0
  312. package/dist/src/_dependencies/source/0xe76d8a37d4132278a7a752183e90e04890b9e7d0f6657eadb68821609a2a56a3/set-stale-price-threshold/structs.d.ts +41 -0
  313. package/dist/src/_dependencies/source/0xe76d8a37d4132278a7a752183e90e04890b9e7d0f6657eadb68821609a2a56a3/set-stale-price-threshold/structs.js +167 -0
  314. package/dist/src/_dependencies/source/0xe76d8a37d4132278a7a752183e90e04890b9e7d0f6657eadb68821609a2a56a3/set-update-fee/structs.d.ts +47 -0
  315. package/dist/src/_dependencies/source/0xe76d8a37d4132278a7a752183e90e04890b9e7d0f6657eadb68821609a2a56a3/set-update-fee/structs.js +169 -0
  316. package/dist/src/_dependencies/source/0xe76d8a37d4132278a7a752183e90e04890b9e7d0f6657eadb68821609a2a56a3/setup/structs.d.ts +50 -0
  317. package/dist/src/_dependencies/source/0xe76d8a37d4132278a7a752183e90e04890b9e7d0f6657eadb68821609a2a56a3/setup/structs.js +168 -0
  318. package/dist/src/_dependencies/source/0xe76d8a37d4132278a7a752183e90e04890b9e7d0f6657eadb68821609a2a56a3/state/structs.d.ts +269 -0
  319. package/dist/src/_dependencies/source/0xe76d8a37d4132278a7a752183e90e04890b9e7d0f6657eadb68821609a2a56a3/state/structs.js +363 -0
  320. package/dist/src/_dependencies/source/0xe76d8a37d4132278a7a752183e90e04890b9e7d0f6657eadb68821609a2a56a3/version-control/structs.d.ts +79 -0
  321. package/dist/src/_dependencies/source/0xe76d8a37d4132278a7a752183e90e04890b9e7d0f6657eadb68821609a2a56a3/version-control/structs.js +256 -0
  322. package/dist/src/_framework/init-source.d.ts +1 -0
  323. package/dist/src/_framework/init-source.js +64 -0
  324. package/dist/src/_framework/loader.d.ts +17 -0
  325. package/dist/src/_framework/loader.js +99 -0
  326. package/dist/src/_framework/reified.d.ts +100 -0
  327. package/dist/src/_framework/reified.js +263 -0
  328. package/dist/src/_framework/util.d.ts +53 -0
  329. package/dist/src/_framework/util.js +251 -0
  330. package/dist/src/airdrop/authority-entry.d.ts +22 -0
  331. package/dist/src/airdrop/authority-entry.js +137 -0
  332. package/dist/src/airdrop/index.d.ts +3 -0
  333. package/dist/src/airdrop/index.js +19 -0
  334. package/dist/src/airdrop/user-entry.d.ts +10 -0
  335. package/dist/src/airdrop/user-entry.js +16 -0
  336. package/dist/src/airdrop/view-function.d.ts +9 -0
  337. package/dist/src/airdrop/view-function.js +73 -0
  338. package/dist/src/auto-bid/index.d.ts +2 -0
  339. package/dist/src/auto-bid/index.js +18 -0
  340. package/dist/src/auto-bid/user-entry.d.ts +45 -0
  341. package/dist/src/auto-bid/user-entry.js +203 -0
  342. package/dist/src/auto-bid/view-function.d.ts +43 -0
  343. package/dist/src/auto-bid/view-function.js +347 -0
  344. package/dist/src/constants/constant.d.ts +22 -0
  345. package/dist/src/constants/constant.js +29 -0
  346. package/dist/src/constants/index.d.ts +2 -0
  347. package/dist/src/constants/index.js +18 -0
  348. package/dist/src/constants/token.d.ts +51 -0
  349. package/dist/src/constants/token.js +178 -0
  350. package/dist/src/index.d.ts +11 -0
  351. package/dist/src/index.js +27 -0
  352. package/dist/src/leaderboard/authority-entry.d.ts +22 -0
  353. package/dist/src/leaderboard/authority-entry.js +90 -0
  354. package/dist/src/leaderboard/index.d.ts +2 -0
  355. package/dist/src/leaderboard/index.js +18 -0
  356. package/dist/src/leaderboard/view-function.d.ts +20 -0
  357. package/dist/src/leaderboard/view-function.js +93 -0
  358. package/dist/src/tails-exp-dice/api.d.ts +1 -0
  359. package/dist/src/tails-exp-dice/api.js +76 -0
  360. package/dist/src/tails-exp-dice/fetch.d.ts +81 -0
  361. package/dist/src/tails-exp-dice/fetch.js +346 -0
  362. package/dist/src/tails-exp-dice/index.d.ts +4 -0
  363. package/dist/src/tails-exp-dice/index.js +20 -0
  364. package/dist/src/tails-exp-dice/user-entry.d.ts +70 -0
  365. package/dist/src/tails-exp-dice/user-entry.js +249 -0
  366. package/dist/src/tails-exp-dice/view-function.d.ts +8 -0
  367. package/dist/src/tails-exp-dice/view-function.js +130 -0
  368. package/dist/src/tails-staking/authority-entry.d.ts +182 -0
  369. package/dist/src/tails-staking/authority-entry.js +247 -0
  370. package/dist/src/tails-staking/index.d.ts +3 -0
  371. package/dist/src/tails-staking/index.js +19 -0
  372. package/dist/src/tails-staking/user-entry.d.ts +157 -0
  373. package/dist/src/tails-staking/user-entry.js +416 -0
  374. package/dist/src/tails-staking/view-function.d.ts +20 -0
  375. package/dist/src/tails-staking/view-function.js +122 -0
  376. package/dist/src/typus-dov-single-v2/entry/authority-entry.d.ts +70 -0
  377. package/dist/src/typus-dov-single-v2/entry/authority-entry.js +167 -0
  378. package/dist/src/typus-dov-single-v2/entry/index.d.ts +3 -0
  379. package/dist/src/typus-dov-single-v2/entry/index.js +19 -0
  380. package/dist/src/typus-dov-single-v2/entry/mfud-user-entry.d.ts +126 -0
  381. package/dist/src/typus-dov-single-v2/entry/mfud-user-entry.js +425 -0
  382. package/dist/src/typus-dov-single-v2/entry/user-entry.d.ts +212 -0
  383. package/dist/src/typus-dov-single-v2/entry/user-entry.js +448 -0
  384. package/dist/src/typus-dov-single-v2/function/bidding.d.ts +151 -0
  385. package/dist/src/typus-dov-single-v2/function/bidding.js +833 -0
  386. package/dist/src/typus-dov-single-v2/function/index.d.ts +3 -0
  387. package/dist/src/typus-dov-single-v2/function/index.js +19 -0
  388. package/dist/src/typus-dov-single-v2/function/token.d.ts +21 -0
  389. package/dist/src/typus-dov-single-v2/function/token.js +38 -0
  390. package/dist/src/typus-dov-single-v2/function/vault.d.ts +8 -0
  391. package/dist/src/typus-dov-single-v2/function/vault.js +23 -0
  392. package/dist/src/typus-dov-single-v2/history/index.d.ts +2 -0
  393. package/dist/src/typus-dov-single-v2/history/index.js +18 -0
  394. package/dist/src/typus-dov-single-v2/history/user-history.d.ts +36 -0
  395. package/dist/src/typus-dov-single-v2/history/user-history.js +999 -0
  396. package/dist/src/typus-dov-single-v2/history/vault-history.d.ts +123 -0
  397. package/dist/src/typus-dov-single-v2/history/vault-history.js +403 -0
  398. package/dist/src/typus-dov-single-v2/index.d.ts +4 -0
  399. package/dist/src/typus-dov-single-v2/index.js +20 -0
  400. package/dist/src/typus-dov-single-v2/view-function.d.ts +212 -0
  401. package/dist/src/typus-dov-single-v2/view-function.js +578 -0
  402. package/dist/src/typus-nft/fetch.d.ts +69 -0
  403. package/dist/src/typus-nft/fetch.js +565 -0
  404. package/dist/src/typus-nft/index.d.ts +2 -0
  405. package/dist/src/typus-nft/index.js +18 -0
  406. package/dist/src/typus-nft/user-entry.d.ts +38 -0
  407. package/dist/src/typus-nft/user-entry.js +173 -0
  408. package/dist/src/typus-perp/admin/functions.d.ts +51 -0
  409. package/dist/src/typus-perp/admin/functions.js +100 -0
  410. package/dist/src/typus-perp/admin/structs.d.ts +425 -0
  411. package/dist/src/typus-perp/admin/structs.js +802 -0
  412. package/dist/src/typus-perp/fetch.d.ts +57 -0
  413. package/dist/src/typus-perp/fetch.js +400 -0
  414. package/dist/src/typus-perp/index.d.ts +7 -0
  415. package/dist/src/typus-perp/index.js +33 -0
  416. package/dist/src/typus-perp/init.d.ts +2 -0
  417. package/dist/src/typus-perp/init.js +120 -0
  418. package/dist/src/typus-perp/lp-pool/functions.d.ts +283 -0
  419. package/dist/src/typus-perp/lp-pool/functions.js +418 -0
  420. package/dist/src/typus-perp/lp-pool/structs.d.ts +2538 -0
  421. package/dist/src/typus-perp/lp-pool/structs.js +3515 -0
  422. package/dist/src/typus-perp/math/functions.d.ts +18 -0
  423. package/dist/src/typus-perp/math/functions.js +40 -0
  424. package/dist/src/typus-perp/oracle/functions.d.ts +14 -0
  425. package/dist/src/typus-perp/oracle/functions.js +22 -0
  426. package/dist/src/typus-perp/oracle/structs.d.ts +102 -0
  427. package/dist/src/typus-perp/oracle/structs.js +353 -0
  428. package/dist/src/typus-perp/position/functions.d.ts +339 -0
  429. package/dist/src/typus-perp/position/functions.js +564 -0
  430. package/dist/src/typus-perp/position/structs.d.ts +1144 -0
  431. package/dist/src/typus-perp/position/structs.js +1485 -0
  432. package/dist/src/typus-perp/readVec.d.ts +3 -0
  433. package/dist/src/typus-perp/readVec.js +117 -0
  434. package/dist/src/typus-perp/stake-pool/functions.d.ts +169 -0
  435. package/dist/src/typus-perp/stake-pool/functions.js +258 -0
  436. package/dist/src/typus-perp/stake-pool/structs.d.ts +2071 -0
  437. package/dist/src/typus-perp/stake-pool/structs.js +3515 -0
  438. package/dist/src/typus-perp/symbol/functions.d.ts +10 -0
  439. package/dist/src/typus-perp/symbol/functions.js +20 -0
  440. package/dist/src/typus-perp/symbol/structs.d.ts +76 -0
  441. package/dist/src/typus-perp/symbol/structs.js +216 -0
  442. package/dist/src/typus-perp/tlp/functions.d.ts +20 -0
  443. package/dist/src/typus-perp/tlp/functions.js +35 -0
  444. package/dist/src/typus-perp/tlp/structs.d.ts +88 -0
  445. package/dist/src/typus-perp/tlp/structs.js +329 -0
  446. package/dist/src/typus-perp/token-interface/functions.d.ts +12 -0
  447. package/dist/src/typus-perp/token-interface/functions.js +20 -0
  448. package/dist/src/typus-perp/trading/functions.d.ts +427 -0
  449. package/dist/src/typus-perp/trading/functions.js +612 -0
  450. package/dist/src/typus-perp/trading/structs.d.ts +2631 -0
  451. package/dist/src/typus-perp/trading/structs.js +4067 -0
  452. package/dist/src/typus-perp/treasury-caps/functions.d.ts +10 -0
  453. package/dist/src/typus-perp/treasury-caps/functions.js +32 -0
  454. package/dist/src/typus-perp/treasury-caps/structs.d.ts +50 -0
  455. package/dist/src/typus-perp/treasury-caps/structs.js +204 -0
  456. package/dist/src/typus-perp/user/index.d.ts +3 -0
  457. package/dist/src/typus-perp/user/index.js +19 -0
  458. package/dist/src/typus-perp/user/order.d.ts +70 -0
  459. package/dist/src/typus-perp/user/order.js +206 -0
  460. package/dist/src/typus-perp/user/orderWithBidReceipt.d.ts +62 -0
  461. package/dist/src/typus-perp/user/orderWithBidReceipt.js +149 -0
  462. package/dist/src/typus-perp/user/tlp.d.ts +93 -0
  463. package/dist/src/typus-perp/user/tlp.js +268 -0
  464. package/dist/src/user/index.d.ts +1 -0
  465. package/dist/src/user/index.js +17 -0
  466. package/dist/src/user/view-function.d.ts +8 -0
  467. package/dist/src/user/view-function.js +71 -0
  468. package/dist/src/utils/api/defillama/index.d.ts +1 -0
  469. package/dist/src/utils/api/defillama/index.js +17 -0
  470. package/dist/src/utils/api/defillama/tvl.d.ts +1 -0
  471. package/dist/src/utils/api/defillama/tvl.js +58 -0
  472. package/dist/src/utils/api/index.d.ts +3 -0
  473. package/dist/src/utils/api/index.js +19 -0
  474. package/dist/src/utils/api/price.d.ts +4 -0
  475. package/dist/src/utils/api/price.js +208 -0
  476. package/dist/src/utils/api/sentio/index.d.ts +2 -0
  477. package/dist/src/utils/api/sentio/index.js +18 -0
  478. package/dist/src/utils/api/sentio/leader-board.d.ts +7 -0
  479. package/dist/src/utils/api/sentio/leader-board.js +103 -0
  480. package/dist/src/utils/api/sentio/reward-generated.d.ts +16 -0
  481. package/dist/src/utils/api/sentio/reward-generated.js +506 -0
  482. package/dist/src/utils/index.d.ts +5 -0
  483. package/dist/src/utils/index.js +21 -0
  484. package/dist/src/utils/load_env.d.ts +1 -0
  485. package/dist/src/utils/load_env.js +9 -0
  486. package/dist/src/utils/mint.d.ts +2 -0
  487. package/dist/src/utils/mint.js +57 -0
  488. package/dist/src/utils/pyth/constant.d.ts +49 -0
  489. package/dist/src/utils/pyth/constant.js +70 -0
  490. package/dist/src/utils/pyth/index.d.ts +2 -0
  491. package/dist/src/utils/pyth/index.js +18 -0
  492. package/dist/src/utils/pyth/pythClient.d.ts +12 -0
  493. package/dist/src/utils/pyth/pythClient.js +80 -0
  494. package/dist/src/utils/tools.d.ts +6 -0
  495. package/dist/src/utils/tools.js +45 -0
  496. package/package.json +1 -1
@@ -0,0 +1,3515 @@
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 (mod) {
30
+ if (mod && mod.__esModule) return mod;
31
+ var result = {};
32
+ if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
33
+ __setModuleDefault(result, mod);
34
+ return result;
35
+ };
36
+ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
37
+ function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
38
+ return new (P || (P = Promise))(function (resolve, reject) {
39
+ function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
40
+ function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
41
+ function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
42
+ step((generator = generator.apply(thisArg, _arguments || [])).next());
43
+ });
44
+ };
45
+ var __generator = (this && this.__generator) || function (thisArg, body) {
46
+ var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;
47
+ return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g;
48
+ function verb(n) { return function (v) { return step([n, v]); }; }
49
+ function step(op) {
50
+ if (f) throw new TypeError("Generator is already executing.");
51
+ while (g && (g = 0, op[0] && (_ = 0)), _) try {
52
+ 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;
53
+ if (y = 0, t) op = [op[0] & 2, t.value];
54
+ switch (op[0]) {
55
+ case 0: case 1: t = op; break;
56
+ case 4: _.label++; return { value: op[1], done: false };
57
+ case 5: _.label++; y = op[1]; op = [0]; continue;
58
+ case 7: op = _.ops.pop(); _.trys.pop(); continue;
59
+ default:
60
+ if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }
61
+ if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }
62
+ if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }
63
+ if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }
64
+ if (t[2]) _.ops.pop();
65
+ _.trys.pop(); continue;
66
+ }
67
+ op = body.call(thisArg, _);
68
+ } catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }
69
+ if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };
70
+ }
71
+ };
72
+ var __read = (this && this.__read) || function (o, n) {
73
+ var m = typeof Symbol === "function" && o[Symbol.iterator];
74
+ if (!m) return o;
75
+ var i = m.call(o), r, ar = [], e;
76
+ try {
77
+ while ((n === void 0 || n-- > 0) && !(r = i.next()).done) ar.push(r.value);
78
+ }
79
+ catch (error) { e = { error: error }; }
80
+ finally {
81
+ try {
82
+ if (r && !r.done && (m = i["return"])) m.call(i);
83
+ }
84
+ finally { if (e) throw e.error; }
85
+ }
86
+ return ar;
87
+ };
88
+ var __spreadArray = (this && this.__spreadArray) || function (to, from, pack) {
89
+ if (pack || arguments.length === 2) for (var i = 0, l = from.length, ar; i < l; i++) {
90
+ if (ar || !(i in from)) {
91
+ if (!ar) ar = Array.prototype.slice.call(from, 0, i);
92
+ ar[i] = from[i];
93
+ }
94
+ }
95
+ return to.concat(ar || Array.prototype.slice.call(from));
96
+ };
97
+ Object.defineProperty(exports, "__esModule", { value: true });
98
+ exports.UpdateSpotConfigEvent = exports.UpdateMarginConfigEvent = exports.UpdateLiquidityValueEvent = exports.UpdateBorrowInfoEvent = exports.TokenPool = exports.SwapEvent = exports.SuspendTokenPoolEvent = exports.SuspendPoolEvent = exports.SpotConfig = exports.ResumeTokenPoolEvent = exports.ResumePoolEvent = exports.Registry = exports.NewLiquidityPoolEvent = exports.MintLpEvent = exports.MarginConfig = exports.LiquidityPoolInfo = exports.LiquidityPool = exports.BurnLpEvent = exports.AddLiquidityTokenEvent = exports.State = exports.Config = void 0;
99
+ exports.isConfig = isConfig;
100
+ exports.isState = isState;
101
+ exports.isAddLiquidityTokenEvent = isAddLiquidityTokenEvent;
102
+ exports.isBurnLpEvent = isBurnLpEvent;
103
+ exports.isLiquidityPool = isLiquidityPool;
104
+ exports.isLiquidityPoolInfo = isLiquidityPoolInfo;
105
+ exports.isMarginConfig = isMarginConfig;
106
+ exports.isMintLpEvent = isMintLpEvent;
107
+ exports.isNewLiquidityPoolEvent = isNewLiquidityPoolEvent;
108
+ exports.isRegistry = isRegistry;
109
+ exports.isResumePoolEvent = isResumePoolEvent;
110
+ exports.isResumeTokenPoolEvent = isResumeTokenPoolEvent;
111
+ exports.isSpotConfig = isSpotConfig;
112
+ exports.isSuspendPoolEvent = isSuspendPoolEvent;
113
+ exports.isSuspendTokenPoolEvent = isSuspendTokenPoolEvent;
114
+ exports.isSwapEvent = isSwapEvent;
115
+ exports.isTokenPool = isTokenPool;
116
+ exports.isUpdateBorrowInfoEvent = isUpdateBorrowInfoEvent;
117
+ exports.isUpdateLiquidityValueEvent = isUpdateLiquidityValueEvent;
118
+ exports.isUpdateMarginConfigEvent = isUpdateMarginConfigEvent;
119
+ exports.isUpdateSpotConfigEvent = isUpdateSpotConfigEvent;
120
+ var reified = __importStar(require("../../_framework/reified"));
121
+ var structs_1 = require("../../_dependencies/source/0x1/type-name/structs");
122
+ var structs_2 = require("../../_dependencies/source/0x2/object/structs");
123
+ var reified_1 = require("../../_framework/reified");
124
+ var util_1 = require("../../_framework/util");
125
+ var bcs_1 = require("@mysten/bcs");
126
+ /* ============================== Config =============================== */
127
+ function isConfig(type) {
128
+ type = (0, util_1.compressSuiType)(type);
129
+ return type === "0x4bcf9eade4480bcb9fcd3139ec8d22afda34b25af06092904fcccb06e1b8043c::lp_pool::Config";
130
+ }
131
+ var Config = /** @class */ (function () {
132
+ function Config(typeArgs, fields) {
133
+ this.$typeName = Config.$typeName;
134
+ this.$fullTypeName = util_1.composeSuiType.apply(void 0, __spreadArray([Config.$typeName], __read(typeArgs), false));
135
+ this.$typeArgs = typeArgs;
136
+ this.oracleId = fields.oracleId;
137
+ this.liquidityTokenDecimal = fields.liquidityTokenDecimal;
138
+ this.spotConfig = fields.spotConfig;
139
+ this.marginConfig = fields.marginConfig;
140
+ this.u64Padding = fields.u64Padding;
141
+ }
142
+ Config.reified = function () {
143
+ var _this = this;
144
+ return {
145
+ typeName: Config.$typeName,
146
+ fullTypeName: util_1.composeSuiType.apply(void 0, __spreadArray([Config.$typeName], [], false)),
147
+ typeArgs: [],
148
+ reifiedTypeArgs: [],
149
+ fromFields: function (fields) { return Config.fromFields(fields); },
150
+ fromFieldsWithTypes: function (item) { return Config.fromFieldsWithTypes(item); },
151
+ fromBcs: function (data) { return Config.fromBcs(data); },
152
+ bcs: Config.bcs,
153
+ fromJSONField: function (field) { return Config.fromJSONField(field); },
154
+ fromJSON: function (json) { return Config.fromJSON(json); },
155
+ fromSuiParsedData: function (content) { return Config.fromSuiParsedData(content); },
156
+ fetch: function (client, id) { return __awaiter(_this, void 0, void 0, function () { return __generator(this, function (_a) {
157
+ return [2 /*return*/, Config.fetch(client, id)];
158
+ }); }); },
159
+ new: function (fields) {
160
+ return new Config([], fields);
161
+ },
162
+ kind: "StructClassReified",
163
+ };
164
+ };
165
+ Object.defineProperty(Config, "r", {
166
+ get: function () {
167
+ return Config.reified();
168
+ },
169
+ enumerable: false,
170
+ configurable: true
171
+ });
172
+ Config.phantom = function () {
173
+ return (0, reified_1.phantom)(Config.reified());
174
+ };
175
+ Object.defineProperty(Config, "p", {
176
+ get: function () {
177
+ return Config.phantom();
178
+ },
179
+ enumerable: false,
180
+ configurable: true
181
+ });
182
+ Object.defineProperty(Config, "bcs", {
183
+ get: function () {
184
+ return bcs_1.bcs.struct("Config", {
185
+ oracle_id: bcs_1.bcs.bytes(32).transform({ input: function (val) { return (0, bcs_1.fromHEX)(val); }, output: function (val) { return (0, bcs_1.toHEX)(val); } }),
186
+ liquidity_token_decimal: bcs_1.bcs.u64(),
187
+ spot_config: SpotConfig.bcs,
188
+ margin_config: MarginConfig.bcs,
189
+ u64_padding: bcs_1.bcs.vector(bcs_1.bcs.u64()),
190
+ });
191
+ },
192
+ enumerable: false,
193
+ configurable: true
194
+ });
195
+ Config.fromFields = function (fields) {
196
+ return Config.reified().new({
197
+ oracleId: (0, reified_1.decodeFromFields)("address", fields.oracle_id),
198
+ liquidityTokenDecimal: (0, reified_1.decodeFromFields)("u64", fields.liquidity_token_decimal),
199
+ spotConfig: (0, reified_1.decodeFromFields)(SpotConfig.reified(), fields.spot_config),
200
+ marginConfig: (0, reified_1.decodeFromFields)(MarginConfig.reified(), fields.margin_config),
201
+ u64Padding: (0, reified_1.decodeFromFields)(reified.vector("u64"), fields.u64_padding),
202
+ });
203
+ };
204
+ Config.fromFieldsWithTypes = function (item) {
205
+ if (!isConfig(item.type)) {
206
+ throw new Error("not a Config type");
207
+ }
208
+ return Config.reified().new({
209
+ oracleId: (0, reified_1.decodeFromFieldsWithTypes)("address", item.fields.oracle_id),
210
+ liquidityTokenDecimal: (0, reified_1.decodeFromFieldsWithTypes)("u64", item.fields.liquidity_token_decimal),
211
+ spotConfig: (0, reified_1.decodeFromFieldsWithTypes)(SpotConfig.reified(), item.fields.spot_config),
212
+ marginConfig: (0, reified_1.decodeFromFieldsWithTypes)(MarginConfig.reified(), item.fields.margin_config),
213
+ u64Padding: (0, reified_1.decodeFromFieldsWithTypes)(reified.vector("u64"), item.fields.u64_padding),
214
+ });
215
+ };
216
+ Config.fromBcs = function (data) {
217
+ return Config.fromFields(Config.bcs.parse(data));
218
+ };
219
+ Config.prototype.toJSONField = function () {
220
+ return {
221
+ oracleId: this.oracleId,
222
+ liquidityTokenDecimal: this.liquidityTokenDecimal.toString(),
223
+ spotConfig: this.spotConfig.toJSONField(),
224
+ marginConfig: this.marginConfig.toJSONField(),
225
+ u64Padding: (0, reified_1.fieldToJSON)("vector<u64>", this.u64Padding),
226
+ };
227
+ };
228
+ Config.prototype.toJSON = function () {
229
+ return __assign({ $typeName: this.$typeName, $typeArgs: this.$typeArgs }, this.toJSONField());
230
+ };
231
+ Config.fromJSONField = function (field) {
232
+ return Config.reified().new({
233
+ oracleId: (0, reified_1.decodeFromJSONField)("address", field.oracleId),
234
+ liquidityTokenDecimal: (0, reified_1.decodeFromJSONField)("u64", field.liquidityTokenDecimal),
235
+ spotConfig: (0, reified_1.decodeFromJSONField)(SpotConfig.reified(), field.spotConfig),
236
+ marginConfig: (0, reified_1.decodeFromJSONField)(MarginConfig.reified(), field.marginConfig),
237
+ u64Padding: (0, reified_1.decodeFromJSONField)(reified.vector("u64"), field.u64Padding),
238
+ });
239
+ };
240
+ Config.fromJSON = function (json) {
241
+ if (json.$typeName !== Config.$typeName) {
242
+ throw new Error("not a WithTwoGenerics json object");
243
+ }
244
+ return Config.fromJSONField(json);
245
+ };
246
+ Config.fromSuiParsedData = function (content) {
247
+ if (content.dataType !== "moveObject") {
248
+ throw new Error("not an object");
249
+ }
250
+ if (!isConfig(content.type)) {
251
+ throw new Error("object at ".concat(content.fields.id, " is not a Config object"));
252
+ }
253
+ return Config.fromFieldsWithTypes(content);
254
+ };
255
+ Config.fetch = function (client, id) {
256
+ return __awaiter(this, void 0, void 0, function () {
257
+ var res;
258
+ var _a, _b;
259
+ return __generator(this, function (_c) {
260
+ switch (_c.label) {
261
+ case 0: return [4 /*yield*/, client.getObject({ id: id, options: { showBcs: true } })];
262
+ case 1:
263
+ res = _c.sent();
264
+ if (res.error) {
265
+ throw new Error("error fetching Config object at id ".concat(id, ": ").concat(res.error.code));
266
+ }
267
+ 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)) {
268
+ throw new Error("object at id ".concat(id, " is not a Config object"));
269
+ }
270
+ return [2 /*return*/, Config.fromBcs((0, bcs_1.fromB64)(res.data.bcs.bcsBytes))];
271
+ }
272
+ });
273
+ });
274
+ };
275
+ Config.$typeName = "0x4bcf9eade4480bcb9fcd3139ec8d22afda34b25af06092904fcccb06e1b8043c::lp_pool::Config";
276
+ Config.$numTypeParams = 0;
277
+ return Config;
278
+ }());
279
+ exports.Config = Config;
280
+ /* ============================== State =============================== */
281
+ function isState(type) {
282
+ type = (0, util_1.compressSuiType)(type);
283
+ return type === "0x4bcf9eade4480bcb9fcd3139ec8d22afda34b25af06092904fcccb06e1b8043c::lp_pool::State";
284
+ }
285
+ var State = /** @class */ (function () {
286
+ function State(typeArgs, fields) {
287
+ this.$typeName = State.$typeName;
288
+ this.$fullTypeName = util_1.composeSuiType.apply(void 0, __spreadArray([State.$typeName], __read(typeArgs), false));
289
+ this.$typeArgs = typeArgs;
290
+ this.liquidityAmount = fields.liquidityAmount;
291
+ this.valueInUsd = fields.valueInUsd;
292
+ this.reservedAmount = fields.reservedAmount;
293
+ this.updateTsMs = fields.updateTsMs;
294
+ this.isActive = fields.isActive;
295
+ this.lastBorrowRateTsMs = fields.lastBorrowRateTsMs;
296
+ this.cumulativeBorrowRate = fields.cumulativeBorrowRate;
297
+ this.previousLastBorrowRateTsMs = fields.previousLastBorrowRateTsMs;
298
+ this.previousCumulativeBorrowRate = fields.previousCumulativeBorrowRate;
299
+ this.u64Padding = fields.u64Padding;
300
+ }
301
+ State.reified = function () {
302
+ var _this = this;
303
+ return {
304
+ typeName: State.$typeName,
305
+ fullTypeName: util_1.composeSuiType.apply(void 0, __spreadArray([State.$typeName], [], false)),
306
+ typeArgs: [],
307
+ reifiedTypeArgs: [],
308
+ fromFields: function (fields) { return State.fromFields(fields); },
309
+ fromFieldsWithTypes: function (item) { return State.fromFieldsWithTypes(item); },
310
+ fromBcs: function (data) { return State.fromBcs(data); },
311
+ bcs: State.bcs,
312
+ fromJSONField: function (field) { return State.fromJSONField(field); },
313
+ fromJSON: function (json) { return State.fromJSON(json); },
314
+ fromSuiParsedData: function (content) { return State.fromSuiParsedData(content); },
315
+ fetch: function (client, id) { return __awaiter(_this, void 0, void 0, function () { return __generator(this, function (_a) {
316
+ return [2 /*return*/, State.fetch(client, id)];
317
+ }); }); },
318
+ new: function (fields) {
319
+ return new State([], fields);
320
+ },
321
+ kind: "StructClassReified",
322
+ };
323
+ };
324
+ Object.defineProperty(State, "r", {
325
+ get: function () {
326
+ return State.reified();
327
+ },
328
+ enumerable: false,
329
+ configurable: true
330
+ });
331
+ State.phantom = function () {
332
+ return (0, reified_1.phantom)(State.reified());
333
+ };
334
+ Object.defineProperty(State, "p", {
335
+ get: function () {
336
+ return State.phantom();
337
+ },
338
+ enumerable: false,
339
+ configurable: true
340
+ });
341
+ Object.defineProperty(State, "bcs", {
342
+ get: function () {
343
+ return bcs_1.bcs.struct("State", {
344
+ liquidity_amount: bcs_1.bcs.u64(),
345
+ value_in_usd: bcs_1.bcs.u64(),
346
+ reserved_amount: bcs_1.bcs.u64(),
347
+ update_ts_ms: bcs_1.bcs.u64(),
348
+ is_active: bcs_1.bcs.bool(),
349
+ last_borrow_rate_ts_ms: bcs_1.bcs.u64(),
350
+ cumulative_borrow_rate: bcs_1.bcs.u64(),
351
+ previous_last_borrow_rate_ts_ms: bcs_1.bcs.u64(),
352
+ previous_cumulative_borrow_rate: bcs_1.bcs.u64(),
353
+ u64_padding: bcs_1.bcs.vector(bcs_1.bcs.u64()),
354
+ });
355
+ },
356
+ enumerable: false,
357
+ configurable: true
358
+ });
359
+ State.fromFields = function (fields) {
360
+ return State.reified().new({
361
+ liquidityAmount: (0, reified_1.decodeFromFields)("u64", fields.liquidity_amount),
362
+ valueInUsd: (0, reified_1.decodeFromFields)("u64", fields.value_in_usd),
363
+ reservedAmount: (0, reified_1.decodeFromFields)("u64", fields.reserved_amount),
364
+ updateTsMs: (0, reified_1.decodeFromFields)("u64", fields.update_ts_ms),
365
+ isActive: (0, reified_1.decodeFromFields)("bool", fields.is_active),
366
+ lastBorrowRateTsMs: (0, reified_1.decodeFromFields)("u64", fields.last_borrow_rate_ts_ms),
367
+ cumulativeBorrowRate: (0, reified_1.decodeFromFields)("u64", fields.cumulative_borrow_rate),
368
+ previousLastBorrowRateTsMs: (0, reified_1.decodeFromFields)("u64", fields.previous_last_borrow_rate_ts_ms),
369
+ previousCumulativeBorrowRate: (0, reified_1.decodeFromFields)("u64", fields.previous_cumulative_borrow_rate),
370
+ u64Padding: (0, reified_1.decodeFromFields)(reified.vector("u64"), fields.u64_padding),
371
+ });
372
+ };
373
+ State.fromFieldsWithTypes = function (item) {
374
+ if (!isState(item.type)) {
375
+ throw new Error("not a State type");
376
+ }
377
+ return State.reified().new({
378
+ liquidityAmount: (0, reified_1.decodeFromFieldsWithTypes)("u64", item.fields.liquidity_amount),
379
+ valueInUsd: (0, reified_1.decodeFromFieldsWithTypes)("u64", item.fields.value_in_usd),
380
+ reservedAmount: (0, reified_1.decodeFromFieldsWithTypes)("u64", item.fields.reserved_amount),
381
+ updateTsMs: (0, reified_1.decodeFromFieldsWithTypes)("u64", item.fields.update_ts_ms),
382
+ isActive: (0, reified_1.decodeFromFieldsWithTypes)("bool", item.fields.is_active),
383
+ lastBorrowRateTsMs: (0, reified_1.decodeFromFieldsWithTypes)("u64", item.fields.last_borrow_rate_ts_ms),
384
+ cumulativeBorrowRate: (0, reified_1.decodeFromFieldsWithTypes)("u64", item.fields.cumulative_borrow_rate),
385
+ previousLastBorrowRateTsMs: (0, reified_1.decodeFromFieldsWithTypes)("u64", item.fields.previous_last_borrow_rate_ts_ms),
386
+ previousCumulativeBorrowRate: (0, reified_1.decodeFromFieldsWithTypes)("u64", item.fields.previous_cumulative_borrow_rate),
387
+ u64Padding: (0, reified_1.decodeFromFieldsWithTypes)(reified.vector("u64"), item.fields.u64_padding),
388
+ });
389
+ };
390
+ State.fromBcs = function (data) {
391
+ return State.fromFields(State.bcs.parse(data));
392
+ };
393
+ State.prototype.toJSONField = function () {
394
+ return {
395
+ liquidityAmount: this.liquidityAmount.toString(),
396
+ valueInUsd: this.valueInUsd.toString(),
397
+ reservedAmount: this.reservedAmount.toString(),
398
+ updateTsMs: this.updateTsMs.toString(),
399
+ isActive: this.isActive,
400
+ lastBorrowRateTsMs: this.lastBorrowRateTsMs.toString(),
401
+ cumulativeBorrowRate: this.cumulativeBorrowRate.toString(),
402
+ previousLastBorrowRateTsMs: this.previousLastBorrowRateTsMs.toString(),
403
+ previousCumulativeBorrowRate: this.previousCumulativeBorrowRate.toString(),
404
+ u64Padding: (0, reified_1.fieldToJSON)("vector<u64>", this.u64Padding),
405
+ };
406
+ };
407
+ State.prototype.toJSON = function () {
408
+ return __assign({ $typeName: this.$typeName, $typeArgs: this.$typeArgs }, this.toJSONField());
409
+ };
410
+ State.fromJSONField = function (field) {
411
+ return State.reified().new({
412
+ liquidityAmount: (0, reified_1.decodeFromJSONField)("u64", field.liquidityAmount),
413
+ valueInUsd: (0, reified_1.decodeFromJSONField)("u64", field.valueInUsd),
414
+ reservedAmount: (0, reified_1.decodeFromJSONField)("u64", field.reservedAmount),
415
+ updateTsMs: (0, reified_1.decodeFromJSONField)("u64", field.updateTsMs),
416
+ isActive: (0, reified_1.decodeFromJSONField)("bool", field.isActive),
417
+ lastBorrowRateTsMs: (0, reified_1.decodeFromJSONField)("u64", field.lastBorrowRateTsMs),
418
+ cumulativeBorrowRate: (0, reified_1.decodeFromJSONField)("u64", field.cumulativeBorrowRate),
419
+ previousLastBorrowRateTsMs: (0, reified_1.decodeFromJSONField)("u64", field.previousLastBorrowRateTsMs),
420
+ previousCumulativeBorrowRate: (0, reified_1.decodeFromJSONField)("u64", field.previousCumulativeBorrowRate),
421
+ u64Padding: (0, reified_1.decodeFromJSONField)(reified.vector("u64"), field.u64Padding),
422
+ });
423
+ };
424
+ State.fromJSON = function (json) {
425
+ if (json.$typeName !== State.$typeName) {
426
+ throw new Error("not a WithTwoGenerics json object");
427
+ }
428
+ return State.fromJSONField(json);
429
+ };
430
+ State.fromSuiParsedData = function (content) {
431
+ if (content.dataType !== "moveObject") {
432
+ throw new Error("not an object");
433
+ }
434
+ if (!isState(content.type)) {
435
+ throw new Error("object at ".concat(content.fields.id, " is not a State object"));
436
+ }
437
+ return State.fromFieldsWithTypes(content);
438
+ };
439
+ State.fetch = function (client, id) {
440
+ return __awaiter(this, void 0, void 0, function () {
441
+ var res;
442
+ var _a, _b;
443
+ return __generator(this, function (_c) {
444
+ switch (_c.label) {
445
+ case 0: return [4 /*yield*/, client.getObject({ id: id, options: { showBcs: true } })];
446
+ case 1:
447
+ res = _c.sent();
448
+ if (res.error) {
449
+ throw new Error("error fetching State object at id ".concat(id, ": ").concat(res.error.code));
450
+ }
451
+ 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)) {
452
+ throw new Error("object at id ".concat(id, " is not a State object"));
453
+ }
454
+ return [2 /*return*/, State.fromBcs((0, bcs_1.fromB64)(res.data.bcs.bcsBytes))];
455
+ }
456
+ });
457
+ });
458
+ };
459
+ State.$typeName = "0x4bcf9eade4480bcb9fcd3139ec8d22afda34b25af06092904fcccb06e1b8043c::lp_pool::State";
460
+ State.$numTypeParams = 0;
461
+ return State;
462
+ }());
463
+ exports.State = State;
464
+ /* ============================== AddLiquidityTokenEvent =============================== */
465
+ function isAddLiquidityTokenEvent(type) {
466
+ type = (0, util_1.compressSuiType)(type);
467
+ return type === "0x4bcf9eade4480bcb9fcd3139ec8d22afda34b25af06092904fcccb06e1b8043c::lp_pool::AddLiquidityTokenEvent";
468
+ }
469
+ var AddLiquidityTokenEvent = /** @class */ (function () {
470
+ function AddLiquidityTokenEvent(typeArgs, fields) {
471
+ this.$typeName = AddLiquidityTokenEvent.$typeName;
472
+ this.$fullTypeName = util_1.composeSuiType.apply(void 0, __spreadArray([AddLiquidityTokenEvent.$typeName], __read(typeArgs), false));
473
+ this.$typeArgs = typeArgs;
474
+ this.sender = fields.sender;
475
+ this.index = fields.index;
476
+ this.tokenType = fields.tokenType;
477
+ this.config = fields.config;
478
+ this.state = fields.state;
479
+ this.u64Padding = fields.u64Padding;
480
+ }
481
+ AddLiquidityTokenEvent.reified = function () {
482
+ var _this = this;
483
+ return {
484
+ typeName: AddLiquidityTokenEvent.$typeName,
485
+ fullTypeName: util_1.composeSuiType.apply(void 0, __spreadArray([AddLiquidityTokenEvent.$typeName], [], false)),
486
+ typeArgs: [],
487
+ reifiedTypeArgs: [],
488
+ fromFields: function (fields) { return AddLiquidityTokenEvent.fromFields(fields); },
489
+ fromFieldsWithTypes: function (item) { return AddLiquidityTokenEvent.fromFieldsWithTypes(item); },
490
+ fromBcs: function (data) { return AddLiquidityTokenEvent.fromBcs(data); },
491
+ bcs: AddLiquidityTokenEvent.bcs,
492
+ fromJSONField: function (field) { return AddLiquidityTokenEvent.fromJSONField(field); },
493
+ fromJSON: function (json) { return AddLiquidityTokenEvent.fromJSON(json); },
494
+ fromSuiParsedData: function (content) { return AddLiquidityTokenEvent.fromSuiParsedData(content); },
495
+ fetch: function (client, id) { return __awaiter(_this, void 0, void 0, function () { return __generator(this, function (_a) {
496
+ return [2 /*return*/, AddLiquidityTokenEvent.fetch(client, id)];
497
+ }); }); },
498
+ new: function (fields) {
499
+ return new AddLiquidityTokenEvent([], fields);
500
+ },
501
+ kind: "StructClassReified",
502
+ };
503
+ };
504
+ Object.defineProperty(AddLiquidityTokenEvent, "r", {
505
+ get: function () {
506
+ return AddLiquidityTokenEvent.reified();
507
+ },
508
+ enumerable: false,
509
+ configurable: true
510
+ });
511
+ AddLiquidityTokenEvent.phantom = function () {
512
+ return (0, reified_1.phantom)(AddLiquidityTokenEvent.reified());
513
+ };
514
+ Object.defineProperty(AddLiquidityTokenEvent, "p", {
515
+ get: function () {
516
+ return AddLiquidityTokenEvent.phantom();
517
+ },
518
+ enumerable: false,
519
+ configurable: true
520
+ });
521
+ Object.defineProperty(AddLiquidityTokenEvent, "bcs", {
522
+ get: function () {
523
+ return bcs_1.bcs.struct("AddLiquidityTokenEvent", {
524
+ sender: bcs_1.bcs.bytes(32).transform({ input: function (val) { return (0, bcs_1.fromHEX)(val); }, output: function (val) { return (0, bcs_1.toHEX)(val); } }),
525
+ index: bcs_1.bcs.u64(),
526
+ token_type: structs_1.TypeName.bcs,
527
+ config: Config.bcs,
528
+ state: State.bcs,
529
+ u64_padding: bcs_1.bcs.vector(bcs_1.bcs.u64()),
530
+ });
531
+ },
532
+ enumerable: false,
533
+ configurable: true
534
+ });
535
+ AddLiquidityTokenEvent.fromFields = function (fields) {
536
+ return AddLiquidityTokenEvent.reified().new({
537
+ sender: (0, reified_1.decodeFromFields)("address", fields.sender),
538
+ index: (0, reified_1.decodeFromFields)("u64", fields.index),
539
+ tokenType: (0, reified_1.decodeFromFields)(structs_1.TypeName.reified(), fields.token_type),
540
+ config: (0, reified_1.decodeFromFields)(Config.reified(), fields.config),
541
+ state: (0, reified_1.decodeFromFields)(State.reified(), fields.state),
542
+ u64Padding: (0, reified_1.decodeFromFields)(reified.vector("u64"), fields.u64_padding),
543
+ });
544
+ };
545
+ AddLiquidityTokenEvent.fromFieldsWithTypes = function (item) {
546
+ if (!isAddLiquidityTokenEvent(item.type)) {
547
+ throw new Error("not a AddLiquidityTokenEvent type");
548
+ }
549
+ return AddLiquidityTokenEvent.reified().new({
550
+ sender: (0, reified_1.decodeFromFieldsWithTypes)("address", item.fields.sender),
551
+ index: (0, reified_1.decodeFromFieldsWithTypes)("u64", item.fields.index),
552
+ tokenType: (0, reified_1.decodeFromFieldsWithTypes)(structs_1.TypeName.reified(), item.fields.token_type),
553
+ config: (0, reified_1.decodeFromFieldsWithTypes)(Config.reified(), item.fields.config),
554
+ state: (0, reified_1.decodeFromFieldsWithTypes)(State.reified(), item.fields.state),
555
+ u64Padding: (0, reified_1.decodeFromFieldsWithTypes)(reified.vector("u64"), item.fields.u64_padding),
556
+ });
557
+ };
558
+ AddLiquidityTokenEvent.fromBcs = function (data) {
559
+ return AddLiquidityTokenEvent.fromFields(AddLiquidityTokenEvent.bcs.parse(data));
560
+ };
561
+ AddLiquidityTokenEvent.prototype.toJSONField = function () {
562
+ return {
563
+ sender: this.sender,
564
+ index: this.index.toString(),
565
+ tokenType: this.tokenType.toJSONField(),
566
+ config: this.config.toJSONField(),
567
+ state: this.state.toJSONField(),
568
+ u64Padding: (0, reified_1.fieldToJSON)("vector<u64>", this.u64Padding),
569
+ };
570
+ };
571
+ AddLiquidityTokenEvent.prototype.toJSON = function () {
572
+ return __assign({ $typeName: this.$typeName, $typeArgs: this.$typeArgs }, this.toJSONField());
573
+ };
574
+ AddLiquidityTokenEvent.fromJSONField = function (field) {
575
+ return AddLiquidityTokenEvent.reified().new({
576
+ sender: (0, reified_1.decodeFromJSONField)("address", field.sender),
577
+ index: (0, reified_1.decodeFromJSONField)("u64", field.index),
578
+ tokenType: (0, reified_1.decodeFromJSONField)(structs_1.TypeName.reified(), field.tokenType),
579
+ config: (0, reified_1.decodeFromJSONField)(Config.reified(), field.config),
580
+ state: (0, reified_1.decodeFromJSONField)(State.reified(), field.state),
581
+ u64Padding: (0, reified_1.decodeFromJSONField)(reified.vector("u64"), field.u64Padding),
582
+ });
583
+ };
584
+ AddLiquidityTokenEvent.fromJSON = function (json) {
585
+ if (json.$typeName !== AddLiquidityTokenEvent.$typeName) {
586
+ throw new Error("not a WithTwoGenerics json object");
587
+ }
588
+ return AddLiquidityTokenEvent.fromJSONField(json);
589
+ };
590
+ AddLiquidityTokenEvent.fromSuiParsedData = function (content) {
591
+ if (content.dataType !== "moveObject") {
592
+ throw new Error("not an object");
593
+ }
594
+ if (!isAddLiquidityTokenEvent(content.type)) {
595
+ throw new Error("object at ".concat(content.fields.id, " is not a AddLiquidityTokenEvent object"));
596
+ }
597
+ return AddLiquidityTokenEvent.fromFieldsWithTypes(content);
598
+ };
599
+ AddLiquidityTokenEvent.fetch = function (client, id) {
600
+ return __awaiter(this, void 0, void 0, function () {
601
+ var res;
602
+ var _a, _b;
603
+ return __generator(this, function (_c) {
604
+ switch (_c.label) {
605
+ case 0: return [4 /*yield*/, client.getObject({ id: id, options: { showBcs: true } })];
606
+ case 1:
607
+ res = _c.sent();
608
+ if (res.error) {
609
+ throw new Error("error fetching AddLiquidityTokenEvent object at id ".concat(id, ": ").concat(res.error.code));
610
+ }
611
+ 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)) {
612
+ throw new Error("object at id ".concat(id, " is not a AddLiquidityTokenEvent object"));
613
+ }
614
+ return [2 /*return*/, AddLiquidityTokenEvent.fromBcs((0, bcs_1.fromB64)(res.data.bcs.bcsBytes))];
615
+ }
616
+ });
617
+ });
618
+ };
619
+ AddLiquidityTokenEvent.$typeName = "0x4bcf9eade4480bcb9fcd3139ec8d22afda34b25af06092904fcccb06e1b8043c::lp_pool::AddLiquidityTokenEvent";
620
+ AddLiquidityTokenEvent.$numTypeParams = 0;
621
+ return AddLiquidityTokenEvent;
622
+ }());
623
+ exports.AddLiquidityTokenEvent = AddLiquidityTokenEvent;
624
+ /* ============================== BurnLpEvent =============================== */
625
+ function isBurnLpEvent(type) {
626
+ type = (0, util_1.compressSuiType)(type);
627
+ return type === "0x4bcf9eade4480bcb9fcd3139ec8d22afda34b25af06092904fcccb06e1b8043c::lp_pool::BurnLpEvent";
628
+ }
629
+ var BurnLpEvent = /** @class */ (function () {
630
+ function BurnLpEvent(typeArgs, fields) {
631
+ this.$typeName = BurnLpEvent.$typeName;
632
+ this.$fullTypeName = util_1.composeSuiType.apply(void 0, __spreadArray([BurnLpEvent.$typeName], __read(typeArgs), false));
633
+ this.$typeArgs = typeArgs;
634
+ this.sender = fields.sender;
635
+ this.index = fields.index;
636
+ this.lpTokenType = fields.lpTokenType;
637
+ this.burnLpAmount = fields.burnLpAmount;
638
+ this.burnAmountUsd = fields.burnAmountUsd;
639
+ this.burnFeeUsd = fields.burnFeeUsd;
640
+ this.liquidityTokenType = fields.liquidityTokenType;
641
+ this.withdrawTokenAmount = fields.withdrawTokenAmount;
642
+ this.u64Padding = fields.u64Padding;
643
+ }
644
+ BurnLpEvent.reified = function () {
645
+ var _this = this;
646
+ return {
647
+ typeName: BurnLpEvent.$typeName,
648
+ fullTypeName: util_1.composeSuiType.apply(void 0, __spreadArray([BurnLpEvent.$typeName], [], false)),
649
+ typeArgs: [],
650
+ reifiedTypeArgs: [],
651
+ fromFields: function (fields) { return BurnLpEvent.fromFields(fields); },
652
+ fromFieldsWithTypes: function (item) { return BurnLpEvent.fromFieldsWithTypes(item); },
653
+ fromBcs: function (data) { return BurnLpEvent.fromBcs(data); },
654
+ bcs: BurnLpEvent.bcs,
655
+ fromJSONField: function (field) { return BurnLpEvent.fromJSONField(field); },
656
+ fromJSON: function (json) { return BurnLpEvent.fromJSON(json); },
657
+ fromSuiParsedData: function (content) { return BurnLpEvent.fromSuiParsedData(content); },
658
+ fetch: function (client, id) { return __awaiter(_this, void 0, void 0, function () { return __generator(this, function (_a) {
659
+ return [2 /*return*/, BurnLpEvent.fetch(client, id)];
660
+ }); }); },
661
+ new: function (fields) {
662
+ return new BurnLpEvent([], fields);
663
+ },
664
+ kind: "StructClassReified",
665
+ };
666
+ };
667
+ Object.defineProperty(BurnLpEvent, "r", {
668
+ get: function () {
669
+ return BurnLpEvent.reified();
670
+ },
671
+ enumerable: false,
672
+ configurable: true
673
+ });
674
+ BurnLpEvent.phantom = function () {
675
+ return (0, reified_1.phantom)(BurnLpEvent.reified());
676
+ };
677
+ Object.defineProperty(BurnLpEvent, "p", {
678
+ get: function () {
679
+ return BurnLpEvent.phantom();
680
+ },
681
+ enumerable: false,
682
+ configurable: true
683
+ });
684
+ Object.defineProperty(BurnLpEvent, "bcs", {
685
+ get: function () {
686
+ return bcs_1.bcs.struct("BurnLpEvent", {
687
+ sender: bcs_1.bcs.bytes(32).transform({ input: function (val) { return (0, bcs_1.fromHEX)(val); }, output: function (val) { return (0, bcs_1.toHEX)(val); } }),
688
+ index: bcs_1.bcs.u64(),
689
+ lp_token_type: structs_1.TypeName.bcs,
690
+ burn_lp_amount: bcs_1.bcs.u64(),
691
+ burn_amount_usd: bcs_1.bcs.u64(),
692
+ burn_fee_usd: bcs_1.bcs.u64(),
693
+ liquidity_token_type: structs_1.TypeName.bcs,
694
+ withdraw_token_amount: bcs_1.bcs.u64(),
695
+ u64_padding: bcs_1.bcs.vector(bcs_1.bcs.u64()),
696
+ });
697
+ },
698
+ enumerable: false,
699
+ configurable: true
700
+ });
701
+ BurnLpEvent.fromFields = function (fields) {
702
+ return BurnLpEvent.reified().new({
703
+ sender: (0, reified_1.decodeFromFields)("address", fields.sender),
704
+ index: (0, reified_1.decodeFromFields)("u64", fields.index),
705
+ lpTokenType: (0, reified_1.decodeFromFields)(structs_1.TypeName.reified(), fields.lp_token_type),
706
+ burnLpAmount: (0, reified_1.decodeFromFields)("u64", fields.burn_lp_amount),
707
+ burnAmountUsd: (0, reified_1.decodeFromFields)("u64", fields.burn_amount_usd),
708
+ burnFeeUsd: (0, reified_1.decodeFromFields)("u64", fields.burn_fee_usd),
709
+ liquidityTokenType: (0, reified_1.decodeFromFields)(structs_1.TypeName.reified(), fields.liquidity_token_type),
710
+ withdrawTokenAmount: (0, reified_1.decodeFromFields)("u64", fields.withdraw_token_amount),
711
+ u64Padding: (0, reified_1.decodeFromFields)(reified.vector("u64"), fields.u64_padding),
712
+ });
713
+ };
714
+ BurnLpEvent.fromFieldsWithTypes = function (item) {
715
+ if (!isBurnLpEvent(item.type)) {
716
+ throw new Error("not a BurnLpEvent type");
717
+ }
718
+ return BurnLpEvent.reified().new({
719
+ sender: (0, reified_1.decodeFromFieldsWithTypes)("address", item.fields.sender),
720
+ index: (0, reified_1.decodeFromFieldsWithTypes)("u64", item.fields.index),
721
+ lpTokenType: (0, reified_1.decodeFromFieldsWithTypes)(structs_1.TypeName.reified(), item.fields.lp_token_type),
722
+ burnLpAmount: (0, reified_1.decodeFromFieldsWithTypes)("u64", item.fields.burn_lp_amount),
723
+ burnAmountUsd: (0, reified_1.decodeFromFieldsWithTypes)("u64", item.fields.burn_amount_usd),
724
+ burnFeeUsd: (0, reified_1.decodeFromFieldsWithTypes)("u64", item.fields.burn_fee_usd),
725
+ liquidityTokenType: (0, reified_1.decodeFromFieldsWithTypes)(structs_1.TypeName.reified(), item.fields.liquidity_token_type),
726
+ withdrawTokenAmount: (0, reified_1.decodeFromFieldsWithTypes)("u64", item.fields.withdraw_token_amount),
727
+ u64Padding: (0, reified_1.decodeFromFieldsWithTypes)(reified.vector("u64"), item.fields.u64_padding),
728
+ });
729
+ };
730
+ BurnLpEvent.fromBcs = function (data) {
731
+ return BurnLpEvent.fromFields(BurnLpEvent.bcs.parse(data));
732
+ };
733
+ BurnLpEvent.prototype.toJSONField = function () {
734
+ return {
735
+ sender: this.sender,
736
+ index: this.index.toString(),
737
+ lpTokenType: this.lpTokenType.toJSONField(),
738
+ burnLpAmount: this.burnLpAmount.toString(),
739
+ burnAmountUsd: this.burnAmountUsd.toString(),
740
+ burnFeeUsd: this.burnFeeUsd.toString(),
741
+ liquidityTokenType: this.liquidityTokenType.toJSONField(),
742
+ withdrawTokenAmount: this.withdrawTokenAmount.toString(),
743
+ u64Padding: (0, reified_1.fieldToJSON)("vector<u64>", this.u64Padding),
744
+ };
745
+ };
746
+ BurnLpEvent.prototype.toJSON = function () {
747
+ return __assign({ $typeName: this.$typeName, $typeArgs: this.$typeArgs }, this.toJSONField());
748
+ };
749
+ BurnLpEvent.fromJSONField = function (field) {
750
+ return BurnLpEvent.reified().new({
751
+ sender: (0, reified_1.decodeFromJSONField)("address", field.sender),
752
+ index: (0, reified_1.decodeFromJSONField)("u64", field.index),
753
+ lpTokenType: (0, reified_1.decodeFromJSONField)(structs_1.TypeName.reified(), field.lpTokenType),
754
+ burnLpAmount: (0, reified_1.decodeFromJSONField)("u64", field.burnLpAmount),
755
+ burnAmountUsd: (0, reified_1.decodeFromJSONField)("u64", field.burnAmountUsd),
756
+ burnFeeUsd: (0, reified_1.decodeFromJSONField)("u64", field.burnFeeUsd),
757
+ liquidityTokenType: (0, reified_1.decodeFromJSONField)(structs_1.TypeName.reified(), field.liquidityTokenType),
758
+ withdrawTokenAmount: (0, reified_1.decodeFromJSONField)("u64", field.withdrawTokenAmount),
759
+ u64Padding: (0, reified_1.decodeFromJSONField)(reified.vector("u64"), field.u64Padding),
760
+ });
761
+ };
762
+ BurnLpEvent.fromJSON = function (json) {
763
+ if (json.$typeName !== BurnLpEvent.$typeName) {
764
+ throw new Error("not a WithTwoGenerics json object");
765
+ }
766
+ return BurnLpEvent.fromJSONField(json);
767
+ };
768
+ BurnLpEvent.fromSuiParsedData = function (content) {
769
+ if (content.dataType !== "moveObject") {
770
+ throw new Error("not an object");
771
+ }
772
+ if (!isBurnLpEvent(content.type)) {
773
+ throw new Error("object at ".concat(content.fields.id, " is not a BurnLpEvent object"));
774
+ }
775
+ return BurnLpEvent.fromFieldsWithTypes(content);
776
+ };
777
+ BurnLpEvent.fetch = function (client, id) {
778
+ return __awaiter(this, void 0, void 0, function () {
779
+ var res;
780
+ var _a, _b;
781
+ return __generator(this, function (_c) {
782
+ switch (_c.label) {
783
+ case 0: return [4 /*yield*/, client.getObject({ id: id, options: { showBcs: true } })];
784
+ case 1:
785
+ res = _c.sent();
786
+ if (res.error) {
787
+ throw new Error("error fetching BurnLpEvent object at id ".concat(id, ": ").concat(res.error.code));
788
+ }
789
+ 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)) {
790
+ throw new Error("object at id ".concat(id, " is not a BurnLpEvent object"));
791
+ }
792
+ return [2 /*return*/, BurnLpEvent.fromBcs((0, bcs_1.fromB64)(res.data.bcs.bcsBytes))];
793
+ }
794
+ });
795
+ });
796
+ };
797
+ BurnLpEvent.$typeName = "0x4bcf9eade4480bcb9fcd3139ec8d22afda34b25af06092904fcccb06e1b8043c::lp_pool::BurnLpEvent";
798
+ BurnLpEvent.$numTypeParams = 0;
799
+ return BurnLpEvent;
800
+ }());
801
+ exports.BurnLpEvent = BurnLpEvent;
802
+ /* ============================== LiquidityPool =============================== */
803
+ function isLiquidityPool(type) {
804
+ type = (0, util_1.compressSuiType)(type);
805
+ return type === "0x4bcf9eade4480bcb9fcd3139ec8d22afda34b25af06092904fcccb06e1b8043c::lp_pool::LiquidityPool";
806
+ }
807
+ var LiquidityPool = /** @class */ (function () {
808
+ function LiquidityPool(typeArgs, fields) {
809
+ this.$typeName = LiquidityPool.$typeName;
810
+ this.$fullTypeName = util_1.composeSuiType.apply(void 0, __spreadArray([LiquidityPool.$typeName], __read(typeArgs), false));
811
+ this.$typeArgs = typeArgs;
812
+ this.id = fields.id;
813
+ this.index = fields.index;
814
+ this.lpTokenType = fields.lpTokenType;
815
+ this.liquidityTokens = fields.liquidityTokens;
816
+ this.tokenPools = fields.tokenPools;
817
+ this.poolInfo = fields.poolInfo;
818
+ this.u64Padding = fields.u64Padding;
819
+ this.bcsPadding = fields.bcsPadding;
820
+ }
821
+ LiquidityPool.reified = function () {
822
+ var _this = this;
823
+ return {
824
+ typeName: LiquidityPool.$typeName,
825
+ fullTypeName: util_1.composeSuiType.apply(void 0, __spreadArray([LiquidityPool.$typeName], [], false)),
826
+ typeArgs: [],
827
+ reifiedTypeArgs: [],
828
+ fromFields: function (fields) { return LiquidityPool.fromFields(fields); },
829
+ fromFieldsWithTypes: function (item) { return LiquidityPool.fromFieldsWithTypes(item); },
830
+ fromBcs: function (data) { return LiquidityPool.fromBcs(data); },
831
+ bcs: LiquidityPool.bcs,
832
+ fromJSONField: function (field) { return LiquidityPool.fromJSONField(field); },
833
+ fromJSON: function (json) { return LiquidityPool.fromJSON(json); },
834
+ fromSuiParsedData: function (content) { return LiquidityPool.fromSuiParsedData(content); },
835
+ fetch: function (client, id) { return __awaiter(_this, void 0, void 0, function () { return __generator(this, function (_a) {
836
+ return [2 /*return*/, LiquidityPool.fetch(client, id)];
837
+ }); }); },
838
+ new: function (fields) {
839
+ return new LiquidityPool([], fields);
840
+ },
841
+ kind: "StructClassReified",
842
+ };
843
+ };
844
+ Object.defineProperty(LiquidityPool, "r", {
845
+ get: function () {
846
+ return LiquidityPool.reified();
847
+ },
848
+ enumerable: false,
849
+ configurable: true
850
+ });
851
+ LiquidityPool.phantom = function () {
852
+ return (0, reified_1.phantom)(LiquidityPool.reified());
853
+ };
854
+ Object.defineProperty(LiquidityPool, "p", {
855
+ get: function () {
856
+ return LiquidityPool.phantom();
857
+ },
858
+ enumerable: false,
859
+ configurable: true
860
+ });
861
+ Object.defineProperty(LiquidityPool, "bcs", {
862
+ get: function () {
863
+ return bcs_1.bcs.struct("LiquidityPool", {
864
+ id: structs_2.UID.bcs,
865
+ index: bcs_1.bcs.u64(),
866
+ lp_token_type: structs_1.TypeName.bcs,
867
+ liquidity_tokens: bcs_1.bcs.vector(structs_1.TypeName.bcs),
868
+ token_pools: bcs_1.bcs.vector(TokenPool.bcs),
869
+ pool_info: LiquidityPoolInfo.bcs,
870
+ u64_padding: bcs_1.bcs.vector(bcs_1.bcs.u64()),
871
+ bcs_padding: bcs_1.bcs.vector(bcs_1.bcs.u8()),
872
+ });
873
+ },
874
+ enumerable: false,
875
+ configurable: true
876
+ });
877
+ LiquidityPool.fromFields = function (fields) {
878
+ return LiquidityPool.reified().new({
879
+ id: (0, reified_1.decodeFromFields)(structs_2.UID.reified(), fields.id),
880
+ index: (0, reified_1.decodeFromFields)("u64", fields.index),
881
+ lpTokenType: (0, reified_1.decodeFromFields)(structs_1.TypeName.reified(), fields.lp_token_type),
882
+ liquidityTokens: (0, reified_1.decodeFromFields)(reified.vector(structs_1.TypeName.reified()), fields.liquidity_tokens),
883
+ tokenPools: (0, reified_1.decodeFromFields)(reified.vector(TokenPool.reified()), fields.token_pools),
884
+ poolInfo: (0, reified_1.decodeFromFields)(LiquidityPoolInfo.reified(), fields.pool_info),
885
+ u64Padding: (0, reified_1.decodeFromFields)(reified.vector("u64"), fields.u64_padding),
886
+ bcsPadding: (0, reified_1.decodeFromFields)(reified.vector("u8"), fields.bcs_padding),
887
+ });
888
+ };
889
+ LiquidityPool.fromFieldsWithTypes = function (item) {
890
+ if (!isLiquidityPool(item.type)) {
891
+ throw new Error("not a LiquidityPool type");
892
+ }
893
+ return LiquidityPool.reified().new({
894
+ id: (0, reified_1.decodeFromFieldsWithTypes)(structs_2.UID.reified(), item.fields.id),
895
+ index: (0, reified_1.decodeFromFieldsWithTypes)("u64", item.fields.index),
896
+ lpTokenType: (0, reified_1.decodeFromFieldsWithTypes)(structs_1.TypeName.reified(), item.fields.lp_token_type),
897
+ liquidityTokens: (0, reified_1.decodeFromFieldsWithTypes)(reified.vector(structs_1.TypeName.reified()), item.fields.liquidity_tokens),
898
+ tokenPools: (0, reified_1.decodeFromFieldsWithTypes)(reified.vector(TokenPool.reified()), item.fields.token_pools),
899
+ poolInfo: (0, reified_1.decodeFromFieldsWithTypes)(LiquidityPoolInfo.reified(), item.fields.pool_info),
900
+ u64Padding: (0, reified_1.decodeFromFieldsWithTypes)(reified.vector("u64"), item.fields.u64_padding),
901
+ bcsPadding: (0, reified_1.decodeFromFieldsWithTypes)(reified.vector("u8"), item.fields.bcs_padding),
902
+ });
903
+ };
904
+ LiquidityPool.fromBcs = function (data) {
905
+ return LiquidityPool.fromFields(LiquidityPool.bcs.parse(data));
906
+ };
907
+ LiquidityPool.prototype.toJSONField = function () {
908
+ return {
909
+ id: this.id,
910
+ index: this.index.toString(),
911
+ lpTokenType: this.lpTokenType.toJSONField(),
912
+ liquidityTokens: (0, reified_1.fieldToJSON)("vector<0x1::type_name::TypeName>", this.liquidityTokens),
913
+ tokenPools: (0, reified_1.fieldToJSON)("vector<0x4bcf9eade4480bcb9fcd3139ec8d22afda34b25af06092904fcccb06e1b8043c::lp_pool::TokenPool>", this.tokenPools),
914
+ poolInfo: this.poolInfo.toJSONField(),
915
+ u64Padding: (0, reified_1.fieldToJSON)("vector<u64>", this.u64Padding),
916
+ bcsPadding: (0, reified_1.fieldToJSON)("vector<u8>", this.bcsPadding),
917
+ };
918
+ };
919
+ LiquidityPool.prototype.toJSON = function () {
920
+ return __assign({ $typeName: this.$typeName, $typeArgs: this.$typeArgs }, this.toJSONField());
921
+ };
922
+ LiquidityPool.fromJSONField = function (field) {
923
+ return LiquidityPool.reified().new({
924
+ id: (0, reified_1.decodeFromJSONField)(structs_2.UID.reified(), field.id),
925
+ index: (0, reified_1.decodeFromJSONField)("u64", field.index),
926
+ lpTokenType: (0, reified_1.decodeFromJSONField)(structs_1.TypeName.reified(), field.lpTokenType),
927
+ liquidityTokens: (0, reified_1.decodeFromJSONField)(reified.vector(structs_1.TypeName.reified()), field.liquidityTokens),
928
+ tokenPools: (0, reified_1.decodeFromJSONField)(reified.vector(TokenPool.reified()), field.tokenPools),
929
+ poolInfo: (0, reified_1.decodeFromJSONField)(LiquidityPoolInfo.reified(), field.poolInfo),
930
+ u64Padding: (0, reified_1.decodeFromJSONField)(reified.vector("u64"), field.u64Padding),
931
+ bcsPadding: (0, reified_1.decodeFromJSONField)(reified.vector("u8"), field.bcsPadding),
932
+ });
933
+ };
934
+ LiquidityPool.fromJSON = function (json) {
935
+ if (json.$typeName !== LiquidityPool.$typeName) {
936
+ throw new Error("not a WithTwoGenerics json object");
937
+ }
938
+ return LiquidityPool.fromJSONField(json);
939
+ };
940
+ LiquidityPool.fromSuiParsedData = function (content) {
941
+ if (content.dataType !== "moveObject") {
942
+ throw new Error("not an object");
943
+ }
944
+ if (!isLiquidityPool(content.type)) {
945
+ throw new Error("object at ".concat(content.fields.id, " is not a LiquidityPool object"));
946
+ }
947
+ return LiquidityPool.fromFieldsWithTypes(content);
948
+ };
949
+ LiquidityPool.fetch = function (client, id) {
950
+ return __awaiter(this, void 0, void 0, function () {
951
+ var res;
952
+ var _a, _b;
953
+ return __generator(this, function (_c) {
954
+ switch (_c.label) {
955
+ case 0: return [4 /*yield*/, client.getObject({ id: id, options: { showBcs: true } })];
956
+ case 1:
957
+ res = _c.sent();
958
+ if (res.error) {
959
+ throw new Error("error fetching LiquidityPool object at id ".concat(id, ": ").concat(res.error.code));
960
+ }
961
+ 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)) {
962
+ throw new Error("object at id ".concat(id, " is not a LiquidityPool object"));
963
+ }
964
+ return [2 /*return*/, LiquidityPool.fromBcs((0, bcs_1.fromB64)(res.data.bcs.bcsBytes))];
965
+ }
966
+ });
967
+ });
968
+ };
969
+ LiquidityPool.$typeName = "0x4bcf9eade4480bcb9fcd3139ec8d22afda34b25af06092904fcccb06e1b8043c::lp_pool::LiquidityPool";
970
+ LiquidityPool.$numTypeParams = 0;
971
+ return LiquidityPool;
972
+ }());
973
+ exports.LiquidityPool = LiquidityPool;
974
+ /* ============================== LiquidityPoolInfo =============================== */
975
+ function isLiquidityPoolInfo(type) {
976
+ type = (0, util_1.compressSuiType)(type);
977
+ return type === "0x4bcf9eade4480bcb9fcd3139ec8d22afda34b25af06092904fcccb06e1b8043c::lp_pool::LiquidityPoolInfo";
978
+ }
979
+ var LiquidityPoolInfo = /** @class */ (function () {
980
+ function LiquidityPoolInfo(typeArgs, fields) {
981
+ this.$typeName = LiquidityPoolInfo.$typeName;
982
+ this.$fullTypeName = util_1.composeSuiType.apply(void 0, __spreadArray([LiquidityPoolInfo.$typeName], __read(typeArgs), false));
983
+ this.$typeArgs = typeArgs;
984
+ this.lpTokenDecimal = fields.lpTokenDecimal;
985
+ this.totalShareSupply = fields.totalShareSupply;
986
+ this.tvlUsd = fields.tvlUsd;
987
+ this.isActive = fields.isActive;
988
+ }
989
+ LiquidityPoolInfo.reified = function () {
990
+ var _this = this;
991
+ return {
992
+ typeName: LiquidityPoolInfo.$typeName,
993
+ fullTypeName: util_1.composeSuiType.apply(void 0, __spreadArray([LiquidityPoolInfo.$typeName], [], false)),
994
+ typeArgs: [],
995
+ reifiedTypeArgs: [],
996
+ fromFields: function (fields) { return LiquidityPoolInfo.fromFields(fields); },
997
+ fromFieldsWithTypes: function (item) { return LiquidityPoolInfo.fromFieldsWithTypes(item); },
998
+ fromBcs: function (data) { return LiquidityPoolInfo.fromBcs(data); },
999
+ bcs: LiquidityPoolInfo.bcs,
1000
+ fromJSONField: function (field) { return LiquidityPoolInfo.fromJSONField(field); },
1001
+ fromJSON: function (json) { return LiquidityPoolInfo.fromJSON(json); },
1002
+ fromSuiParsedData: function (content) { return LiquidityPoolInfo.fromSuiParsedData(content); },
1003
+ fetch: function (client, id) { return __awaiter(_this, void 0, void 0, function () { return __generator(this, function (_a) {
1004
+ return [2 /*return*/, LiquidityPoolInfo.fetch(client, id)];
1005
+ }); }); },
1006
+ new: function (fields) {
1007
+ return new LiquidityPoolInfo([], fields);
1008
+ },
1009
+ kind: "StructClassReified",
1010
+ };
1011
+ };
1012
+ Object.defineProperty(LiquidityPoolInfo, "r", {
1013
+ get: function () {
1014
+ return LiquidityPoolInfo.reified();
1015
+ },
1016
+ enumerable: false,
1017
+ configurable: true
1018
+ });
1019
+ LiquidityPoolInfo.phantom = function () {
1020
+ return (0, reified_1.phantom)(LiquidityPoolInfo.reified());
1021
+ };
1022
+ Object.defineProperty(LiquidityPoolInfo, "p", {
1023
+ get: function () {
1024
+ return LiquidityPoolInfo.phantom();
1025
+ },
1026
+ enumerable: false,
1027
+ configurable: true
1028
+ });
1029
+ Object.defineProperty(LiquidityPoolInfo, "bcs", {
1030
+ get: function () {
1031
+ return bcs_1.bcs.struct("LiquidityPoolInfo", {
1032
+ lp_token_decimal: bcs_1.bcs.u64(),
1033
+ total_share_supply: bcs_1.bcs.u64(),
1034
+ tvl_usd: bcs_1.bcs.u64(),
1035
+ is_active: bcs_1.bcs.bool(),
1036
+ });
1037
+ },
1038
+ enumerable: false,
1039
+ configurable: true
1040
+ });
1041
+ LiquidityPoolInfo.fromFields = function (fields) {
1042
+ return LiquidityPoolInfo.reified().new({
1043
+ lpTokenDecimal: (0, reified_1.decodeFromFields)("u64", fields.lp_token_decimal),
1044
+ totalShareSupply: (0, reified_1.decodeFromFields)("u64", fields.total_share_supply),
1045
+ tvlUsd: (0, reified_1.decodeFromFields)("u64", fields.tvl_usd),
1046
+ isActive: (0, reified_1.decodeFromFields)("bool", fields.is_active),
1047
+ });
1048
+ };
1049
+ LiquidityPoolInfo.fromFieldsWithTypes = function (item) {
1050
+ if (!isLiquidityPoolInfo(item.type)) {
1051
+ throw new Error("not a LiquidityPoolInfo type");
1052
+ }
1053
+ return LiquidityPoolInfo.reified().new({
1054
+ lpTokenDecimal: (0, reified_1.decodeFromFieldsWithTypes)("u64", item.fields.lp_token_decimal),
1055
+ totalShareSupply: (0, reified_1.decodeFromFieldsWithTypes)("u64", item.fields.total_share_supply),
1056
+ tvlUsd: (0, reified_1.decodeFromFieldsWithTypes)("u64", item.fields.tvl_usd),
1057
+ isActive: (0, reified_1.decodeFromFieldsWithTypes)("bool", item.fields.is_active),
1058
+ });
1059
+ };
1060
+ LiquidityPoolInfo.fromBcs = function (data) {
1061
+ return LiquidityPoolInfo.fromFields(LiquidityPoolInfo.bcs.parse(data));
1062
+ };
1063
+ LiquidityPoolInfo.prototype.toJSONField = function () {
1064
+ return {
1065
+ lpTokenDecimal: this.lpTokenDecimal.toString(),
1066
+ totalShareSupply: this.totalShareSupply.toString(),
1067
+ tvlUsd: this.tvlUsd.toString(),
1068
+ isActive: this.isActive,
1069
+ };
1070
+ };
1071
+ LiquidityPoolInfo.prototype.toJSON = function () {
1072
+ return __assign({ $typeName: this.$typeName, $typeArgs: this.$typeArgs }, this.toJSONField());
1073
+ };
1074
+ LiquidityPoolInfo.fromJSONField = function (field) {
1075
+ return LiquidityPoolInfo.reified().new({
1076
+ lpTokenDecimal: (0, reified_1.decodeFromJSONField)("u64", field.lpTokenDecimal),
1077
+ totalShareSupply: (0, reified_1.decodeFromJSONField)("u64", field.totalShareSupply),
1078
+ tvlUsd: (0, reified_1.decodeFromJSONField)("u64", field.tvlUsd),
1079
+ isActive: (0, reified_1.decodeFromJSONField)("bool", field.isActive),
1080
+ });
1081
+ };
1082
+ LiquidityPoolInfo.fromJSON = function (json) {
1083
+ if (json.$typeName !== LiquidityPoolInfo.$typeName) {
1084
+ throw new Error("not a WithTwoGenerics json object");
1085
+ }
1086
+ return LiquidityPoolInfo.fromJSONField(json);
1087
+ };
1088
+ LiquidityPoolInfo.fromSuiParsedData = function (content) {
1089
+ if (content.dataType !== "moveObject") {
1090
+ throw new Error("not an object");
1091
+ }
1092
+ if (!isLiquidityPoolInfo(content.type)) {
1093
+ throw new Error("object at ".concat(content.fields.id, " is not a LiquidityPoolInfo object"));
1094
+ }
1095
+ return LiquidityPoolInfo.fromFieldsWithTypes(content);
1096
+ };
1097
+ LiquidityPoolInfo.fetch = function (client, id) {
1098
+ return __awaiter(this, void 0, void 0, function () {
1099
+ var res;
1100
+ var _a, _b;
1101
+ return __generator(this, function (_c) {
1102
+ switch (_c.label) {
1103
+ case 0: return [4 /*yield*/, client.getObject({ id: id, options: { showBcs: true } })];
1104
+ case 1:
1105
+ res = _c.sent();
1106
+ if (res.error) {
1107
+ throw new Error("error fetching LiquidityPoolInfo object at id ".concat(id, ": ").concat(res.error.code));
1108
+ }
1109
+ 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)) {
1110
+ throw new Error("object at id ".concat(id, " is not a LiquidityPoolInfo object"));
1111
+ }
1112
+ return [2 /*return*/, LiquidityPoolInfo.fromBcs((0, bcs_1.fromB64)(res.data.bcs.bcsBytes))];
1113
+ }
1114
+ });
1115
+ });
1116
+ };
1117
+ LiquidityPoolInfo.$typeName = "0x4bcf9eade4480bcb9fcd3139ec8d22afda34b25af06092904fcccb06e1b8043c::lp_pool::LiquidityPoolInfo";
1118
+ LiquidityPoolInfo.$numTypeParams = 0;
1119
+ return LiquidityPoolInfo;
1120
+ }());
1121
+ exports.LiquidityPoolInfo = LiquidityPoolInfo;
1122
+ /* ============================== MarginConfig =============================== */
1123
+ function isMarginConfig(type) {
1124
+ type = (0, util_1.compressSuiType)(type);
1125
+ return type === "0x4bcf9eade4480bcb9fcd3139ec8d22afda34b25af06092904fcccb06e1b8043c::lp_pool::MarginConfig";
1126
+ }
1127
+ var MarginConfig = /** @class */ (function () {
1128
+ function MarginConfig(typeArgs, fields) {
1129
+ this.$typeName = MarginConfig.$typeName;
1130
+ this.$fullTypeName = util_1.composeSuiType.apply(void 0, __spreadArray([MarginConfig.$typeName], __read(typeArgs), false));
1131
+ this.$typeArgs = typeArgs;
1132
+ this.basicBorrowRate0 = fields.basicBorrowRate0;
1133
+ this.basicBorrowRate1 = fields.basicBorrowRate1;
1134
+ this.basicBorrowRate2 = fields.basicBorrowRate2;
1135
+ this.utilizationThresholdBp0 = fields.utilizationThresholdBp0;
1136
+ this.utilizationThresholdBp1 = fields.utilizationThresholdBp1;
1137
+ this.borrowIntervalTsMs = fields.borrowIntervalTsMs;
1138
+ this.maxOrderReserveRatioBp = fields.maxOrderReserveRatioBp;
1139
+ this.u64Padding = fields.u64Padding;
1140
+ }
1141
+ MarginConfig.reified = function () {
1142
+ var _this = this;
1143
+ return {
1144
+ typeName: MarginConfig.$typeName,
1145
+ fullTypeName: util_1.composeSuiType.apply(void 0, __spreadArray([MarginConfig.$typeName], [], false)),
1146
+ typeArgs: [],
1147
+ reifiedTypeArgs: [],
1148
+ fromFields: function (fields) { return MarginConfig.fromFields(fields); },
1149
+ fromFieldsWithTypes: function (item) { return MarginConfig.fromFieldsWithTypes(item); },
1150
+ fromBcs: function (data) { return MarginConfig.fromBcs(data); },
1151
+ bcs: MarginConfig.bcs,
1152
+ fromJSONField: function (field) { return MarginConfig.fromJSONField(field); },
1153
+ fromJSON: function (json) { return MarginConfig.fromJSON(json); },
1154
+ fromSuiParsedData: function (content) { return MarginConfig.fromSuiParsedData(content); },
1155
+ fetch: function (client, id) { return __awaiter(_this, void 0, void 0, function () { return __generator(this, function (_a) {
1156
+ return [2 /*return*/, MarginConfig.fetch(client, id)];
1157
+ }); }); },
1158
+ new: function (fields) {
1159
+ return new MarginConfig([], fields);
1160
+ },
1161
+ kind: "StructClassReified",
1162
+ };
1163
+ };
1164
+ Object.defineProperty(MarginConfig, "r", {
1165
+ get: function () {
1166
+ return MarginConfig.reified();
1167
+ },
1168
+ enumerable: false,
1169
+ configurable: true
1170
+ });
1171
+ MarginConfig.phantom = function () {
1172
+ return (0, reified_1.phantom)(MarginConfig.reified());
1173
+ };
1174
+ Object.defineProperty(MarginConfig, "p", {
1175
+ get: function () {
1176
+ return MarginConfig.phantom();
1177
+ },
1178
+ enumerable: false,
1179
+ configurable: true
1180
+ });
1181
+ Object.defineProperty(MarginConfig, "bcs", {
1182
+ get: function () {
1183
+ return bcs_1.bcs.struct("MarginConfig", {
1184
+ basic_borrow_rate_0: bcs_1.bcs.u64(),
1185
+ basic_borrow_rate_1: bcs_1.bcs.u64(),
1186
+ basic_borrow_rate_2: bcs_1.bcs.u64(),
1187
+ utilization_threshold_bp_0: bcs_1.bcs.u64(),
1188
+ utilization_threshold_bp_1: bcs_1.bcs.u64(),
1189
+ borrow_interval_ts_ms: bcs_1.bcs.u64(),
1190
+ max_order_reserve_ratio_bp: bcs_1.bcs.u64(),
1191
+ u64_padding: bcs_1.bcs.vector(bcs_1.bcs.u64()),
1192
+ });
1193
+ },
1194
+ enumerable: false,
1195
+ configurable: true
1196
+ });
1197
+ MarginConfig.fromFields = function (fields) {
1198
+ return MarginConfig.reified().new({
1199
+ basicBorrowRate0: (0, reified_1.decodeFromFields)("u64", fields.basic_borrow_rate_0),
1200
+ basicBorrowRate1: (0, reified_1.decodeFromFields)("u64", fields.basic_borrow_rate_1),
1201
+ basicBorrowRate2: (0, reified_1.decodeFromFields)("u64", fields.basic_borrow_rate_2),
1202
+ utilizationThresholdBp0: (0, reified_1.decodeFromFields)("u64", fields.utilization_threshold_bp_0),
1203
+ utilizationThresholdBp1: (0, reified_1.decodeFromFields)("u64", fields.utilization_threshold_bp_1),
1204
+ borrowIntervalTsMs: (0, reified_1.decodeFromFields)("u64", fields.borrow_interval_ts_ms),
1205
+ maxOrderReserveRatioBp: (0, reified_1.decodeFromFields)("u64", fields.max_order_reserve_ratio_bp),
1206
+ u64Padding: (0, reified_1.decodeFromFields)(reified.vector("u64"), fields.u64_padding),
1207
+ });
1208
+ };
1209
+ MarginConfig.fromFieldsWithTypes = function (item) {
1210
+ if (!isMarginConfig(item.type)) {
1211
+ throw new Error("not a MarginConfig type");
1212
+ }
1213
+ return MarginConfig.reified().new({
1214
+ basicBorrowRate0: (0, reified_1.decodeFromFieldsWithTypes)("u64", item.fields.basic_borrow_rate_0),
1215
+ basicBorrowRate1: (0, reified_1.decodeFromFieldsWithTypes)("u64", item.fields.basic_borrow_rate_1),
1216
+ basicBorrowRate2: (0, reified_1.decodeFromFieldsWithTypes)("u64", item.fields.basic_borrow_rate_2),
1217
+ utilizationThresholdBp0: (0, reified_1.decodeFromFieldsWithTypes)("u64", item.fields.utilization_threshold_bp_0),
1218
+ utilizationThresholdBp1: (0, reified_1.decodeFromFieldsWithTypes)("u64", item.fields.utilization_threshold_bp_1),
1219
+ borrowIntervalTsMs: (0, reified_1.decodeFromFieldsWithTypes)("u64", item.fields.borrow_interval_ts_ms),
1220
+ maxOrderReserveRatioBp: (0, reified_1.decodeFromFieldsWithTypes)("u64", item.fields.max_order_reserve_ratio_bp),
1221
+ u64Padding: (0, reified_1.decodeFromFieldsWithTypes)(reified.vector("u64"), item.fields.u64_padding),
1222
+ });
1223
+ };
1224
+ MarginConfig.fromBcs = function (data) {
1225
+ return MarginConfig.fromFields(MarginConfig.bcs.parse(data));
1226
+ };
1227
+ MarginConfig.prototype.toJSONField = function () {
1228
+ return {
1229
+ basicBorrowRate0: this.basicBorrowRate0.toString(),
1230
+ basicBorrowRate1: this.basicBorrowRate1.toString(),
1231
+ basicBorrowRate2: this.basicBorrowRate2.toString(),
1232
+ utilizationThresholdBp0: this.utilizationThresholdBp0.toString(),
1233
+ utilizationThresholdBp1: this.utilizationThresholdBp1.toString(),
1234
+ borrowIntervalTsMs: this.borrowIntervalTsMs.toString(),
1235
+ maxOrderReserveRatioBp: this.maxOrderReserveRatioBp.toString(),
1236
+ u64Padding: (0, reified_1.fieldToJSON)("vector<u64>", this.u64Padding),
1237
+ };
1238
+ };
1239
+ MarginConfig.prototype.toJSON = function () {
1240
+ return __assign({ $typeName: this.$typeName, $typeArgs: this.$typeArgs }, this.toJSONField());
1241
+ };
1242
+ MarginConfig.fromJSONField = function (field) {
1243
+ return MarginConfig.reified().new({
1244
+ basicBorrowRate0: (0, reified_1.decodeFromJSONField)("u64", field.basicBorrowRate0),
1245
+ basicBorrowRate1: (0, reified_1.decodeFromJSONField)("u64", field.basicBorrowRate1),
1246
+ basicBorrowRate2: (0, reified_1.decodeFromJSONField)("u64", field.basicBorrowRate2),
1247
+ utilizationThresholdBp0: (0, reified_1.decodeFromJSONField)("u64", field.utilizationThresholdBp0),
1248
+ utilizationThresholdBp1: (0, reified_1.decodeFromJSONField)("u64", field.utilizationThresholdBp1),
1249
+ borrowIntervalTsMs: (0, reified_1.decodeFromJSONField)("u64", field.borrowIntervalTsMs),
1250
+ maxOrderReserveRatioBp: (0, reified_1.decodeFromJSONField)("u64", field.maxOrderReserveRatioBp),
1251
+ u64Padding: (0, reified_1.decodeFromJSONField)(reified.vector("u64"), field.u64Padding),
1252
+ });
1253
+ };
1254
+ MarginConfig.fromJSON = function (json) {
1255
+ if (json.$typeName !== MarginConfig.$typeName) {
1256
+ throw new Error("not a WithTwoGenerics json object");
1257
+ }
1258
+ return MarginConfig.fromJSONField(json);
1259
+ };
1260
+ MarginConfig.fromSuiParsedData = function (content) {
1261
+ if (content.dataType !== "moveObject") {
1262
+ throw new Error("not an object");
1263
+ }
1264
+ if (!isMarginConfig(content.type)) {
1265
+ throw new Error("object at ".concat(content.fields.id, " is not a MarginConfig object"));
1266
+ }
1267
+ return MarginConfig.fromFieldsWithTypes(content);
1268
+ };
1269
+ MarginConfig.fetch = function (client, id) {
1270
+ return __awaiter(this, void 0, void 0, function () {
1271
+ var res;
1272
+ var _a, _b;
1273
+ return __generator(this, function (_c) {
1274
+ switch (_c.label) {
1275
+ case 0: return [4 /*yield*/, client.getObject({ id: id, options: { showBcs: true } })];
1276
+ case 1:
1277
+ res = _c.sent();
1278
+ if (res.error) {
1279
+ throw new Error("error fetching MarginConfig object at id ".concat(id, ": ").concat(res.error.code));
1280
+ }
1281
+ 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)) {
1282
+ throw new Error("object at id ".concat(id, " is not a MarginConfig object"));
1283
+ }
1284
+ return [2 /*return*/, MarginConfig.fromBcs((0, bcs_1.fromB64)(res.data.bcs.bcsBytes))];
1285
+ }
1286
+ });
1287
+ });
1288
+ };
1289
+ MarginConfig.$typeName = "0x4bcf9eade4480bcb9fcd3139ec8d22afda34b25af06092904fcccb06e1b8043c::lp_pool::MarginConfig";
1290
+ MarginConfig.$numTypeParams = 0;
1291
+ return MarginConfig;
1292
+ }());
1293
+ exports.MarginConfig = MarginConfig;
1294
+ /* ============================== MintLpEvent =============================== */
1295
+ function isMintLpEvent(type) {
1296
+ type = (0, util_1.compressSuiType)(type);
1297
+ return type === "0x4bcf9eade4480bcb9fcd3139ec8d22afda34b25af06092904fcccb06e1b8043c::lp_pool::MintLpEvent";
1298
+ }
1299
+ var MintLpEvent = /** @class */ (function () {
1300
+ function MintLpEvent(typeArgs, fields) {
1301
+ this.$typeName = MintLpEvent.$typeName;
1302
+ this.$fullTypeName = util_1.composeSuiType.apply(void 0, __spreadArray([MintLpEvent.$typeName], __read(typeArgs), false));
1303
+ this.$typeArgs = typeArgs;
1304
+ this.sender = fields.sender;
1305
+ this.index = fields.index;
1306
+ this.liquidityTokenType = fields.liquidityTokenType;
1307
+ this.depositAmount = fields.depositAmount;
1308
+ this.depositAmountUsd = fields.depositAmountUsd;
1309
+ this.mintFeeUsd = fields.mintFeeUsd;
1310
+ this.lpTokenType = fields.lpTokenType;
1311
+ this.mintedLpAmount = fields.mintedLpAmount;
1312
+ this.u64Padding = fields.u64Padding;
1313
+ }
1314
+ MintLpEvent.reified = function () {
1315
+ var _this = this;
1316
+ return {
1317
+ typeName: MintLpEvent.$typeName,
1318
+ fullTypeName: util_1.composeSuiType.apply(void 0, __spreadArray([MintLpEvent.$typeName], [], false)),
1319
+ typeArgs: [],
1320
+ reifiedTypeArgs: [],
1321
+ fromFields: function (fields) { return MintLpEvent.fromFields(fields); },
1322
+ fromFieldsWithTypes: function (item) { return MintLpEvent.fromFieldsWithTypes(item); },
1323
+ fromBcs: function (data) { return MintLpEvent.fromBcs(data); },
1324
+ bcs: MintLpEvent.bcs,
1325
+ fromJSONField: function (field) { return MintLpEvent.fromJSONField(field); },
1326
+ fromJSON: function (json) { return MintLpEvent.fromJSON(json); },
1327
+ fromSuiParsedData: function (content) { return MintLpEvent.fromSuiParsedData(content); },
1328
+ fetch: function (client, id) { return __awaiter(_this, void 0, void 0, function () { return __generator(this, function (_a) {
1329
+ return [2 /*return*/, MintLpEvent.fetch(client, id)];
1330
+ }); }); },
1331
+ new: function (fields) {
1332
+ return new MintLpEvent([], fields);
1333
+ },
1334
+ kind: "StructClassReified",
1335
+ };
1336
+ };
1337
+ Object.defineProperty(MintLpEvent, "r", {
1338
+ get: function () {
1339
+ return MintLpEvent.reified();
1340
+ },
1341
+ enumerable: false,
1342
+ configurable: true
1343
+ });
1344
+ MintLpEvent.phantom = function () {
1345
+ return (0, reified_1.phantom)(MintLpEvent.reified());
1346
+ };
1347
+ Object.defineProperty(MintLpEvent, "p", {
1348
+ get: function () {
1349
+ return MintLpEvent.phantom();
1350
+ },
1351
+ enumerable: false,
1352
+ configurable: true
1353
+ });
1354
+ Object.defineProperty(MintLpEvent, "bcs", {
1355
+ get: function () {
1356
+ return bcs_1.bcs.struct("MintLpEvent", {
1357
+ sender: bcs_1.bcs.bytes(32).transform({ input: function (val) { return (0, bcs_1.fromHEX)(val); }, output: function (val) { return (0, bcs_1.toHEX)(val); } }),
1358
+ index: bcs_1.bcs.u64(),
1359
+ liquidity_token_type: structs_1.TypeName.bcs,
1360
+ deposit_amount: bcs_1.bcs.u64(),
1361
+ deposit_amount_usd: bcs_1.bcs.u64(),
1362
+ mint_fee_usd: bcs_1.bcs.u64(),
1363
+ lp_token_type: structs_1.TypeName.bcs,
1364
+ minted_lp_amount: bcs_1.bcs.u64(),
1365
+ u64_padding: bcs_1.bcs.vector(bcs_1.bcs.u64()),
1366
+ });
1367
+ },
1368
+ enumerable: false,
1369
+ configurable: true
1370
+ });
1371
+ MintLpEvent.fromFields = function (fields) {
1372
+ return MintLpEvent.reified().new({
1373
+ sender: (0, reified_1.decodeFromFields)("address", fields.sender),
1374
+ index: (0, reified_1.decodeFromFields)("u64", fields.index),
1375
+ liquidityTokenType: (0, reified_1.decodeFromFields)(structs_1.TypeName.reified(), fields.liquidity_token_type),
1376
+ depositAmount: (0, reified_1.decodeFromFields)("u64", fields.deposit_amount),
1377
+ depositAmountUsd: (0, reified_1.decodeFromFields)("u64", fields.deposit_amount_usd),
1378
+ mintFeeUsd: (0, reified_1.decodeFromFields)("u64", fields.mint_fee_usd),
1379
+ lpTokenType: (0, reified_1.decodeFromFields)(structs_1.TypeName.reified(), fields.lp_token_type),
1380
+ mintedLpAmount: (0, reified_1.decodeFromFields)("u64", fields.minted_lp_amount),
1381
+ u64Padding: (0, reified_1.decodeFromFields)(reified.vector("u64"), fields.u64_padding),
1382
+ });
1383
+ };
1384
+ MintLpEvent.fromFieldsWithTypes = function (item) {
1385
+ if (!isMintLpEvent(item.type)) {
1386
+ throw new Error("not a MintLpEvent type");
1387
+ }
1388
+ return MintLpEvent.reified().new({
1389
+ sender: (0, reified_1.decodeFromFieldsWithTypes)("address", item.fields.sender),
1390
+ index: (0, reified_1.decodeFromFieldsWithTypes)("u64", item.fields.index),
1391
+ liquidityTokenType: (0, reified_1.decodeFromFieldsWithTypes)(structs_1.TypeName.reified(), item.fields.liquidity_token_type),
1392
+ depositAmount: (0, reified_1.decodeFromFieldsWithTypes)("u64", item.fields.deposit_amount),
1393
+ depositAmountUsd: (0, reified_1.decodeFromFieldsWithTypes)("u64", item.fields.deposit_amount_usd),
1394
+ mintFeeUsd: (0, reified_1.decodeFromFieldsWithTypes)("u64", item.fields.mint_fee_usd),
1395
+ lpTokenType: (0, reified_1.decodeFromFieldsWithTypes)(structs_1.TypeName.reified(), item.fields.lp_token_type),
1396
+ mintedLpAmount: (0, reified_1.decodeFromFieldsWithTypes)("u64", item.fields.minted_lp_amount),
1397
+ u64Padding: (0, reified_1.decodeFromFieldsWithTypes)(reified.vector("u64"), item.fields.u64_padding),
1398
+ });
1399
+ };
1400
+ MintLpEvent.fromBcs = function (data) {
1401
+ return MintLpEvent.fromFields(MintLpEvent.bcs.parse(data));
1402
+ };
1403
+ MintLpEvent.prototype.toJSONField = function () {
1404
+ return {
1405
+ sender: this.sender,
1406
+ index: this.index.toString(),
1407
+ liquidityTokenType: this.liquidityTokenType.toJSONField(),
1408
+ depositAmount: this.depositAmount.toString(),
1409
+ depositAmountUsd: this.depositAmountUsd.toString(),
1410
+ mintFeeUsd: this.mintFeeUsd.toString(),
1411
+ lpTokenType: this.lpTokenType.toJSONField(),
1412
+ mintedLpAmount: this.mintedLpAmount.toString(),
1413
+ u64Padding: (0, reified_1.fieldToJSON)("vector<u64>", this.u64Padding),
1414
+ };
1415
+ };
1416
+ MintLpEvent.prototype.toJSON = function () {
1417
+ return __assign({ $typeName: this.$typeName, $typeArgs: this.$typeArgs }, this.toJSONField());
1418
+ };
1419
+ MintLpEvent.fromJSONField = function (field) {
1420
+ return MintLpEvent.reified().new({
1421
+ sender: (0, reified_1.decodeFromJSONField)("address", field.sender),
1422
+ index: (0, reified_1.decodeFromJSONField)("u64", field.index),
1423
+ liquidityTokenType: (0, reified_1.decodeFromJSONField)(structs_1.TypeName.reified(), field.liquidityTokenType),
1424
+ depositAmount: (0, reified_1.decodeFromJSONField)("u64", field.depositAmount),
1425
+ depositAmountUsd: (0, reified_1.decodeFromJSONField)("u64", field.depositAmountUsd),
1426
+ mintFeeUsd: (0, reified_1.decodeFromJSONField)("u64", field.mintFeeUsd),
1427
+ lpTokenType: (0, reified_1.decodeFromJSONField)(structs_1.TypeName.reified(), field.lpTokenType),
1428
+ mintedLpAmount: (0, reified_1.decodeFromJSONField)("u64", field.mintedLpAmount),
1429
+ u64Padding: (0, reified_1.decodeFromJSONField)(reified.vector("u64"), field.u64Padding),
1430
+ });
1431
+ };
1432
+ MintLpEvent.fromJSON = function (json) {
1433
+ if (json.$typeName !== MintLpEvent.$typeName) {
1434
+ throw new Error("not a WithTwoGenerics json object");
1435
+ }
1436
+ return MintLpEvent.fromJSONField(json);
1437
+ };
1438
+ MintLpEvent.fromSuiParsedData = function (content) {
1439
+ if (content.dataType !== "moveObject") {
1440
+ throw new Error("not an object");
1441
+ }
1442
+ if (!isMintLpEvent(content.type)) {
1443
+ throw new Error("object at ".concat(content.fields.id, " is not a MintLpEvent object"));
1444
+ }
1445
+ return MintLpEvent.fromFieldsWithTypes(content);
1446
+ };
1447
+ MintLpEvent.fetch = function (client, id) {
1448
+ return __awaiter(this, void 0, void 0, function () {
1449
+ var res;
1450
+ var _a, _b;
1451
+ return __generator(this, function (_c) {
1452
+ switch (_c.label) {
1453
+ case 0: return [4 /*yield*/, client.getObject({ id: id, options: { showBcs: true } })];
1454
+ case 1:
1455
+ res = _c.sent();
1456
+ if (res.error) {
1457
+ throw new Error("error fetching MintLpEvent object at id ".concat(id, ": ").concat(res.error.code));
1458
+ }
1459
+ 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)) {
1460
+ throw new Error("object at id ".concat(id, " is not a MintLpEvent object"));
1461
+ }
1462
+ return [2 /*return*/, MintLpEvent.fromBcs((0, bcs_1.fromB64)(res.data.bcs.bcsBytes))];
1463
+ }
1464
+ });
1465
+ });
1466
+ };
1467
+ MintLpEvent.$typeName = "0x4bcf9eade4480bcb9fcd3139ec8d22afda34b25af06092904fcccb06e1b8043c::lp_pool::MintLpEvent";
1468
+ MintLpEvent.$numTypeParams = 0;
1469
+ return MintLpEvent;
1470
+ }());
1471
+ exports.MintLpEvent = MintLpEvent;
1472
+ /* ============================== NewLiquidityPoolEvent =============================== */
1473
+ function isNewLiquidityPoolEvent(type) {
1474
+ type = (0, util_1.compressSuiType)(type);
1475
+ return type === "0x4bcf9eade4480bcb9fcd3139ec8d22afda34b25af06092904fcccb06e1b8043c::lp_pool::NewLiquidityPoolEvent";
1476
+ }
1477
+ var NewLiquidityPoolEvent = /** @class */ (function () {
1478
+ function NewLiquidityPoolEvent(typeArgs, fields) {
1479
+ this.$typeName = NewLiquidityPoolEvent.$typeName;
1480
+ this.$fullTypeName = util_1.composeSuiType.apply(void 0, __spreadArray([NewLiquidityPoolEvent.$typeName], __read(typeArgs), false));
1481
+ this.$typeArgs = typeArgs;
1482
+ this.sender = fields.sender;
1483
+ this.index = fields.index;
1484
+ this.lpTokenType = fields.lpTokenType;
1485
+ this.lpTokenDecimal = fields.lpTokenDecimal;
1486
+ this.u64Padding = fields.u64Padding;
1487
+ }
1488
+ NewLiquidityPoolEvent.reified = function () {
1489
+ var _this = this;
1490
+ return {
1491
+ typeName: NewLiquidityPoolEvent.$typeName,
1492
+ fullTypeName: util_1.composeSuiType.apply(void 0, __spreadArray([NewLiquidityPoolEvent.$typeName], [], false)),
1493
+ typeArgs: [],
1494
+ reifiedTypeArgs: [],
1495
+ fromFields: function (fields) { return NewLiquidityPoolEvent.fromFields(fields); },
1496
+ fromFieldsWithTypes: function (item) { return NewLiquidityPoolEvent.fromFieldsWithTypes(item); },
1497
+ fromBcs: function (data) { return NewLiquidityPoolEvent.fromBcs(data); },
1498
+ bcs: NewLiquidityPoolEvent.bcs,
1499
+ fromJSONField: function (field) { return NewLiquidityPoolEvent.fromJSONField(field); },
1500
+ fromJSON: function (json) { return NewLiquidityPoolEvent.fromJSON(json); },
1501
+ fromSuiParsedData: function (content) { return NewLiquidityPoolEvent.fromSuiParsedData(content); },
1502
+ fetch: function (client, id) { return __awaiter(_this, void 0, void 0, function () { return __generator(this, function (_a) {
1503
+ return [2 /*return*/, NewLiquidityPoolEvent.fetch(client, id)];
1504
+ }); }); },
1505
+ new: function (fields) {
1506
+ return new NewLiquidityPoolEvent([], fields);
1507
+ },
1508
+ kind: "StructClassReified",
1509
+ };
1510
+ };
1511
+ Object.defineProperty(NewLiquidityPoolEvent, "r", {
1512
+ get: function () {
1513
+ return NewLiquidityPoolEvent.reified();
1514
+ },
1515
+ enumerable: false,
1516
+ configurable: true
1517
+ });
1518
+ NewLiquidityPoolEvent.phantom = function () {
1519
+ return (0, reified_1.phantom)(NewLiquidityPoolEvent.reified());
1520
+ };
1521
+ Object.defineProperty(NewLiquidityPoolEvent, "p", {
1522
+ get: function () {
1523
+ return NewLiquidityPoolEvent.phantom();
1524
+ },
1525
+ enumerable: false,
1526
+ configurable: true
1527
+ });
1528
+ Object.defineProperty(NewLiquidityPoolEvent, "bcs", {
1529
+ get: function () {
1530
+ return bcs_1.bcs.struct("NewLiquidityPoolEvent", {
1531
+ sender: bcs_1.bcs.bytes(32).transform({ input: function (val) { return (0, bcs_1.fromHEX)(val); }, output: function (val) { return (0, bcs_1.toHEX)(val); } }),
1532
+ index: bcs_1.bcs.u64(),
1533
+ lp_token_type: structs_1.TypeName.bcs,
1534
+ lp_token_decimal: bcs_1.bcs.u64(),
1535
+ u64_padding: bcs_1.bcs.vector(bcs_1.bcs.u64()),
1536
+ });
1537
+ },
1538
+ enumerable: false,
1539
+ configurable: true
1540
+ });
1541
+ NewLiquidityPoolEvent.fromFields = function (fields) {
1542
+ return NewLiquidityPoolEvent.reified().new({
1543
+ sender: (0, reified_1.decodeFromFields)("address", fields.sender),
1544
+ index: (0, reified_1.decodeFromFields)("u64", fields.index),
1545
+ lpTokenType: (0, reified_1.decodeFromFields)(structs_1.TypeName.reified(), fields.lp_token_type),
1546
+ lpTokenDecimal: (0, reified_1.decodeFromFields)("u64", fields.lp_token_decimal),
1547
+ u64Padding: (0, reified_1.decodeFromFields)(reified.vector("u64"), fields.u64_padding),
1548
+ });
1549
+ };
1550
+ NewLiquidityPoolEvent.fromFieldsWithTypes = function (item) {
1551
+ if (!isNewLiquidityPoolEvent(item.type)) {
1552
+ throw new Error("not a NewLiquidityPoolEvent type");
1553
+ }
1554
+ return NewLiquidityPoolEvent.reified().new({
1555
+ sender: (0, reified_1.decodeFromFieldsWithTypes)("address", item.fields.sender),
1556
+ index: (0, reified_1.decodeFromFieldsWithTypes)("u64", item.fields.index),
1557
+ lpTokenType: (0, reified_1.decodeFromFieldsWithTypes)(structs_1.TypeName.reified(), item.fields.lp_token_type),
1558
+ lpTokenDecimal: (0, reified_1.decodeFromFieldsWithTypes)("u64", item.fields.lp_token_decimal),
1559
+ u64Padding: (0, reified_1.decodeFromFieldsWithTypes)(reified.vector("u64"), item.fields.u64_padding),
1560
+ });
1561
+ };
1562
+ NewLiquidityPoolEvent.fromBcs = function (data) {
1563
+ return NewLiquidityPoolEvent.fromFields(NewLiquidityPoolEvent.bcs.parse(data));
1564
+ };
1565
+ NewLiquidityPoolEvent.prototype.toJSONField = function () {
1566
+ return {
1567
+ sender: this.sender,
1568
+ index: this.index.toString(),
1569
+ lpTokenType: this.lpTokenType.toJSONField(),
1570
+ lpTokenDecimal: this.lpTokenDecimal.toString(),
1571
+ u64Padding: (0, reified_1.fieldToJSON)("vector<u64>", this.u64Padding),
1572
+ };
1573
+ };
1574
+ NewLiquidityPoolEvent.prototype.toJSON = function () {
1575
+ return __assign({ $typeName: this.$typeName, $typeArgs: this.$typeArgs }, this.toJSONField());
1576
+ };
1577
+ NewLiquidityPoolEvent.fromJSONField = function (field) {
1578
+ return NewLiquidityPoolEvent.reified().new({
1579
+ sender: (0, reified_1.decodeFromJSONField)("address", field.sender),
1580
+ index: (0, reified_1.decodeFromJSONField)("u64", field.index),
1581
+ lpTokenType: (0, reified_1.decodeFromJSONField)(structs_1.TypeName.reified(), field.lpTokenType),
1582
+ lpTokenDecimal: (0, reified_1.decodeFromJSONField)("u64", field.lpTokenDecimal),
1583
+ u64Padding: (0, reified_1.decodeFromJSONField)(reified.vector("u64"), field.u64Padding),
1584
+ });
1585
+ };
1586
+ NewLiquidityPoolEvent.fromJSON = function (json) {
1587
+ if (json.$typeName !== NewLiquidityPoolEvent.$typeName) {
1588
+ throw new Error("not a WithTwoGenerics json object");
1589
+ }
1590
+ return NewLiquidityPoolEvent.fromJSONField(json);
1591
+ };
1592
+ NewLiquidityPoolEvent.fromSuiParsedData = function (content) {
1593
+ if (content.dataType !== "moveObject") {
1594
+ throw new Error("not an object");
1595
+ }
1596
+ if (!isNewLiquidityPoolEvent(content.type)) {
1597
+ throw new Error("object at ".concat(content.fields.id, " is not a NewLiquidityPoolEvent object"));
1598
+ }
1599
+ return NewLiquidityPoolEvent.fromFieldsWithTypes(content);
1600
+ };
1601
+ NewLiquidityPoolEvent.fetch = function (client, id) {
1602
+ return __awaiter(this, void 0, void 0, function () {
1603
+ var res;
1604
+ var _a, _b;
1605
+ return __generator(this, function (_c) {
1606
+ switch (_c.label) {
1607
+ case 0: return [4 /*yield*/, client.getObject({ id: id, options: { showBcs: true } })];
1608
+ case 1:
1609
+ res = _c.sent();
1610
+ if (res.error) {
1611
+ throw new Error("error fetching NewLiquidityPoolEvent object at id ".concat(id, ": ").concat(res.error.code));
1612
+ }
1613
+ 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)) {
1614
+ throw new Error("object at id ".concat(id, " is not a NewLiquidityPoolEvent object"));
1615
+ }
1616
+ return [2 /*return*/, NewLiquidityPoolEvent.fromBcs((0, bcs_1.fromB64)(res.data.bcs.bcsBytes))];
1617
+ }
1618
+ });
1619
+ });
1620
+ };
1621
+ NewLiquidityPoolEvent.$typeName = "0x4bcf9eade4480bcb9fcd3139ec8d22afda34b25af06092904fcccb06e1b8043c::lp_pool::NewLiquidityPoolEvent";
1622
+ NewLiquidityPoolEvent.$numTypeParams = 0;
1623
+ return NewLiquidityPoolEvent;
1624
+ }());
1625
+ exports.NewLiquidityPoolEvent = NewLiquidityPoolEvent;
1626
+ /* ============================== Registry =============================== */
1627
+ function isRegistry(type) {
1628
+ type = (0, util_1.compressSuiType)(type);
1629
+ return type === "0x4bcf9eade4480bcb9fcd3139ec8d22afda34b25af06092904fcccb06e1b8043c::lp_pool::Registry";
1630
+ }
1631
+ var Registry = /** @class */ (function () {
1632
+ function Registry(typeArgs, fields) {
1633
+ this.$typeName = Registry.$typeName;
1634
+ this.$fullTypeName = util_1.composeSuiType.apply(void 0, __spreadArray([Registry.$typeName], __read(typeArgs), false));
1635
+ this.$typeArgs = typeArgs;
1636
+ this.id = fields.id;
1637
+ this.numPool = fields.numPool;
1638
+ this.liquidityPoolRegistry = fields.liquidityPoolRegistry;
1639
+ }
1640
+ Registry.reified = function () {
1641
+ var _this = this;
1642
+ return {
1643
+ typeName: Registry.$typeName,
1644
+ fullTypeName: util_1.composeSuiType.apply(void 0, __spreadArray([Registry.$typeName], [], false)),
1645
+ typeArgs: [],
1646
+ reifiedTypeArgs: [],
1647
+ fromFields: function (fields) { return Registry.fromFields(fields); },
1648
+ fromFieldsWithTypes: function (item) { return Registry.fromFieldsWithTypes(item); },
1649
+ fromBcs: function (data) { return Registry.fromBcs(data); },
1650
+ bcs: Registry.bcs,
1651
+ fromJSONField: function (field) { return Registry.fromJSONField(field); },
1652
+ fromJSON: function (json) { return Registry.fromJSON(json); },
1653
+ fromSuiParsedData: function (content) { return Registry.fromSuiParsedData(content); },
1654
+ fetch: function (client, id) { return __awaiter(_this, void 0, void 0, function () { return __generator(this, function (_a) {
1655
+ return [2 /*return*/, Registry.fetch(client, id)];
1656
+ }); }); },
1657
+ new: function (fields) {
1658
+ return new Registry([], fields);
1659
+ },
1660
+ kind: "StructClassReified",
1661
+ };
1662
+ };
1663
+ Object.defineProperty(Registry, "r", {
1664
+ get: function () {
1665
+ return Registry.reified();
1666
+ },
1667
+ enumerable: false,
1668
+ configurable: true
1669
+ });
1670
+ Registry.phantom = function () {
1671
+ return (0, reified_1.phantom)(Registry.reified());
1672
+ };
1673
+ Object.defineProperty(Registry, "p", {
1674
+ get: function () {
1675
+ return Registry.phantom();
1676
+ },
1677
+ enumerable: false,
1678
+ configurable: true
1679
+ });
1680
+ Object.defineProperty(Registry, "bcs", {
1681
+ get: function () {
1682
+ return bcs_1.bcs.struct("Registry", {
1683
+ id: structs_2.UID.bcs,
1684
+ num_pool: bcs_1.bcs.u64(),
1685
+ liquidity_pool_registry: structs_2.UID.bcs,
1686
+ });
1687
+ },
1688
+ enumerable: false,
1689
+ configurable: true
1690
+ });
1691
+ Registry.fromFields = function (fields) {
1692
+ return Registry.reified().new({
1693
+ id: (0, reified_1.decodeFromFields)(structs_2.UID.reified(), fields.id),
1694
+ numPool: (0, reified_1.decodeFromFields)("u64", fields.num_pool),
1695
+ liquidityPoolRegistry: (0, reified_1.decodeFromFields)(structs_2.UID.reified(), fields.liquidity_pool_registry),
1696
+ });
1697
+ };
1698
+ Registry.fromFieldsWithTypes = function (item) {
1699
+ if (!isRegistry(item.type)) {
1700
+ throw new Error("not a Registry type");
1701
+ }
1702
+ return Registry.reified().new({
1703
+ id: (0, reified_1.decodeFromFieldsWithTypes)(structs_2.UID.reified(), item.fields.id),
1704
+ numPool: (0, reified_1.decodeFromFieldsWithTypes)("u64", item.fields.num_pool),
1705
+ liquidityPoolRegistry: (0, reified_1.decodeFromFieldsWithTypes)(structs_2.UID.reified(), item.fields.liquidity_pool_registry),
1706
+ });
1707
+ };
1708
+ Registry.fromBcs = function (data) {
1709
+ return Registry.fromFields(Registry.bcs.parse(data));
1710
+ };
1711
+ Registry.prototype.toJSONField = function () {
1712
+ return {
1713
+ id: this.id,
1714
+ numPool: this.numPool.toString(),
1715
+ liquidityPoolRegistry: this.liquidityPoolRegistry,
1716
+ };
1717
+ };
1718
+ Registry.prototype.toJSON = function () {
1719
+ return __assign({ $typeName: this.$typeName, $typeArgs: this.$typeArgs }, this.toJSONField());
1720
+ };
1721
+ Registry.fromJSONField = function (field) {
1722
+ return Registry.reified().new({
1723
+ id: (0, reified_1.decodeFromJSONField)(structs_2.UID.reified(), field.id),
1724
+ numPool: (0, reified_1.decodeFromJSONField)("u64", field.numPool),
1725
+ liquidityPoolRegistry: (0, reified_1.decodeFromJSONField)(structs_2.UID.reified(), field.liquidityPoolRegistry),
1726
+ });
1727
+ };
1728
+ Registry.fromJSON = function (json) {
1729
+ if (json.$typeName !== Registry.$typeName) {
1730
+ throw new Error("not a WithTwoGenerics json object");
1731
+ }
1732
+ return Registry.fromJSONField(json);
1733
+ };
1734
+ Registry.fromSuiParsedData = function (content) {
1735
+ if (content.dataType !== "moveObject") {
1736
+ throw new Error("not an object");
1737
+ }
1738
+ if (!isRegistry(content.type)) {
1739
+ throw new Error("object at ".concat(content.fields.id, " is not a Registry object"));
1740
+ }
1741
+ return Registry.fromFieldsWithTypes(content);
1742
+ };
1743
+ Registry.fetch = function (client, id) {
1744
+ return __awaiter(this, void 0, void 0, function () {
1745
+ var res;
1746
+ var _a, _b;
1747
+ return __generator(this, function (_c) {
1748
+ switch (_c.label) {
1749
+ case 0: return [4 /*yield*/, client.getObject({ id: id, options: { showBcs: true } })];
1750
+ case 1:
1751
+ res = _c.sent();
1752
+ if (res.error) {
1753
+ throw new Error("error fetching Registry object at id ".concat(id, ": ").concat(res.error.code));
1754
+ }
1755
+ 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)) {
1756
+ throw new Error("object at id ".concat(id, " is not a Registry object"));
1757
+ }
1758
+ return [2 /*return*/, Registry.fromBcs((0, bcs_1.fromB64)(res.data.bcs.bcsBytes))];
1759
+ }
1760
+ });
1761
+ });
1762
+ };
1763
+ Registry.$typeName = "0x4bcf9eade4480bcb9fcd3139ec8d22afda34b25af06092904fcccb06e1b8043c::lp_pool::Registry";
1764
+ Registry.$numTypeParams = 0;
1765
+ return Registry;
1766
+ }());
1767
+ exports.Registry = Registry;
1768
+ /* ============================== ResumePoolEvent =============================== */
1769
+ function isResumePoolEvent(type) {
1770
+ type = (0, util_1.compressSuiType)(type);
1771
+ return type === "0x4bcf9eade4480bcb9fcd3139ec8d22afda34b25af06092904fcccb06e1b8043c::lp_pool::ResumePoolEvent";
1772
+ }
1773
+ var ResumePoolEvent = /** @class */ (function () {
1774
+ function ResumePoolEvent(typeArgs, fields) {
1775
+ this.$typeName = ResumePoolEvent.$typeName;
1776
+ this.$fullTypeName = util_1.composeSuiType.apply(void 0, __spreadArray([ResumePoolEvent.$typeName], __read(typeArgs), false));
1777
+ this.$typeArgs = typeArgs;
1778
+ this.sender = fields.sender;
1779
+ this.index = fields.index;
1780
+ this.u64Padding = fields.u64Padding;
1781
+ }
1782
+ ResumePoolEvent.reified = function () {
1783
+ var _this = this;
1784
+ return {
1785
+ typeName: ResumePoolEvent.$typeName,
1786
+ fullTypeName: util_1.composeSuiType.apply(void 0, __spreadArray([ResumePoolEvent.$typeName], [], false)),
1787
+ typeArgs: [],
1788
+ reifiedTypeArgs: [],
1789
+ fromFields: function (fields) { return ResumePoolEvent.fromFields(fields); },
1790
+ fromFieldsWithTypes: function (item) { return ResumePoolEvent.fromFieldsWithTypes(item); },
1791
+ fromBcs: function (data) { return ResumePoolEvent.fromBcs(data); },
1792
+ bcs: ResumePoolEvent.bcs,
1793
+ fromJSONField: function (field) { return ResumePoolEvent.fromJSONField(field); },
1794
+ fromJSON: function (json) { return ResumePoolEvent.fromJSON(json); },
1795
+ fromSuiParsedData: function (content) { return ResumePoolEvent.fromSuiParsedData(content); },
1796
+ fetch: function (client, id) { return __awaiter(_this, void 0, void 0, function () { return __generator(this, function (_a) {
1797
+ return [2 /*return*/, ResumePoolEvent.fetch(client, id)];
1798
+ }); }); },
1799
+ new: function (fields) {
1800
+ return new ResumePoolEvent([], fields);
1801
+ },
1802
+ kind: "StructClassReified",
1803
+ };
1804
+ };
1805
+ Object.defineProperty(ResumePoolEvent, "r", {
1806
+ get: function () {
1807
+ return ResumePoolEvent.reified();
1808
+ },
1809
+ enumerable: false,
1810
+ configurable: true
1811
+ });
1812
+ ResumePoolEvent.phantom = function () {
1813
+ return (0, reified_1.phantom)(ResumePoolEvent.reified());
1814
+ };
1815
+ Object.defineProperty(ResumePoolEvent, "p", {
1816
+ get: function () {
1817
+ return ResumePoolEvent.phantom();
1818
+ },
1819
+ enumerable: false,
1820
+ configurable: true
1821
+ });
1822
+ Object.defineProperty(ResumePoolEvent, "bcs", {
1823
+ get: function () {
1824
+ return bcs_1.bcs.struct("ResumePoolEvent", {
1825
+ sender: bcs_1.bcs.bytes(32).transform({ input: function (val) { return (0, bcs_1.fromHEX)(val); }, output: function (val) { return (0, bcs_1.toHEX)(val); } }),
1826
+ index: bcs_1.bcs.u64(),
1827
+ u64_padding: bcs_1.bcs.vector(bcs_1.bcs.u64()),
1828
+ });
1829
+ },
1830
+ enumerable: false,
1831
+ configurable: true
1832
+ });
1833
+ ResumePoolEvent.fromFields = function (fields) {
1834
+ return ResumePoolEvent.reified().new({
1835
+ sender: (0, reified_1.decodeFromFields)("address", fields.sender),
1836
+ index: (0, reified_1.decodeFromFields)("u64", fields.index),
1837
+ u64Padding: (0, reified_1.decodeFromFields)(reified.vector("u64"), fields.u64_padding),
1838
+ });
1839
+ };
1840
+ ResumePoolEvent.fromFieldsWithTypes = function (item) {
1841
+ if (!isResumePoolEvent(item.type)) {
1842
+ throw new Error("not a ResumePoolEvent type");
1843
+ }
1844
+ return ResumePoolEvent.reified().new({
1845
+ sender: (0, reified_1.decodeFromFieldsWithTypes)("address", item.fields.sender),
1846
+ index: (0, reified_1.decodeFromFieldsWithTypes)("u64", item.fields.index),
1847
+ u64Padding: (0, reified_1.decodeFromFieldsWithTypes)(reified.vector("u64"), item.fields.u64_padding),
1848
+ });
1849
+ };
1850
+ ResumePoolEvent.fromBcs = function (data) {
1851
+ return ResumePoolEvent.fromFields(ResumePoolEvent.bcs.parse(data));
1852
+ };
1853
+ ResumePoolEvent.prototype.toJSONField = function () {
1854
+ return {
1855
+ sender: this.sender,
1856
+ index: this.index.toString(),
1857
+ u64Padding: (0, reified_1.fieldToJSON)("vector<u64>", this.u64Padding),
1858
+ };
1859
+ };
1860
+ ResumePoolEvent.prototype.toJSON = function () {
1861
+ return __assign({ $typeName: this.$typeName, $typeArgs: this.$typeArgs }, this.toJSONField());
1862
+ };
1863
+ ResumePoolEvent.fromJSONField = function (field) {
1864
+ return ResumePoolEvent.reified().new({
1865
+ sender: (0, reified_1.decodeFromJSONField)("address", field.sender),
1866
+ index: (0, reified_1.decodeFromJSONField)("u64", field.index),
1867
+ u64Padding: (0, reified_1.decodeFromJSONField)(reified.vector("u64"), field.u64Padding),
1868
+ });
1869
+ };
1870
+ ResumePoolEvent.fromJSON = function (json) {
1871
+ if (json.$typeName !== ResumePoolEvent.$typeName) {
1872
+ throw new Error("not a WithTwoGenerics json object");
1873
+ }
1874
+ return ResumePoolEvent.fromJSONField(json);
1875
+ };
1876
+ ResumePoolEvent.fromSuiParsedData = function (content) {
1877
+ if (content.dataType !== "moveObject") {
1878
+ throw new Error("not an object");
1879
+ }
1880
+ if (!isResumePoolEvent(content.type)) {
1881
+ throw new Error("object at ".concat(content.fields.id, " is not a ResumePoolEvent object"));
1882
+ }
1883
+ return ResumePoolEvent.fromFieldsWithTypes(content);
1884
+ };
1885
+ ResumePoolEvent.fetch = function (client, id) {
1886
+ return __awaiter(this, void 0, void 0, function () {
1887
+ var res;
1888
+ var _a, _b;
1889
+ return __generator(this, function (_c) {
1890
+ switch (_c.label) {
1891
+ case 0: return [4 /*yield*/, client.getObject({ id: id, options: { showBcs: true } })];
1892
+ case 1:
1893
+ res = _c.sent();
1894
+ if (res.error) {
1895
+ throw new Error("error fetching ResumePoolEvent object at id ".concat(id, ": ").concat(res.error.code));
1896
+ }
1897
+ 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)) {
1898
+ throw new Error("object at id ".concat(id, " is not a ResumePoolEvent object"));
1899
+ }
1900
+ return [2 /*return*/, ResumePoolEvent.fromBcs((0, bcs_1.fromB64)(res.data.bcs.bcsBytes))];
1901
+ }
1902
+ });
1903
+ });
1904
+ };
1905
+ ResumePoolEvent.$typeName = "0x4bcf9eade4480bcb9fcd3139ec8d22afda34b25af06092904fcccb06e1b8043c::lp_pool::ResumePoolEvent";
1906
+ ResumePoolEvent.$numTypeParams = 0;
1907
+ return ResumePoolEvent;
1908
+ }());
1909
+ exports.ResumePoolEvent = ResumePoolEvent;
1910
+ /* ============================== ResumeTokenPoolEvent =============================== */
1911
+ function isResumeTokenPoolEvent(type) {
1912
+ type = (0, util_1.compressSuiType)(type);
1913
+ return type === "0x4bcf9eade4480bcb9fcd3139ec8d22afda34b25af06092904fcccb06e1b8043c::lp_pool::ResumeTokenPoolEvent";
1914
+ }
1915
+ var ResumeTokenPoolEvent = /** @class */ (function () {
1916
+ function ResumeTokenPoolEvent(typeArgs, fields) {
1917
+ this.$typeName = ResumeTokenPoolEvent.$typeName;
1918
+ this.$fullTypeName = util_1.composeSuiType.apply(void 0, __spreadArray([ResumeTokenPoolEvent.$typeName], __read(typeArgs), false));
1919
+ this.$typeArgs = typeArgs;
1920
+ this.sender = fields.sender;
1921
+ this.index = fields.index;
1922
+ this.liquidityToken = fields.liquidityToken;
1923
+ this.u64Padding = fields.u64Padding;
1924
+ }
1925
+ ResumeTokenPoolEvent.reified = function () {
1926
+ var _this = this;
1927
+ return {
1928
+ typeName: ResumeTokenPoolEvent.$typeName,
1929
+ fullTypeName: util_1.composeSuiType.apply(void 0, __spreadArray([ResumeTokenPoolEvent.$typeName], [], false)),
1930
+ typeArgs: [],
1931
+ reifiedTypeArgs: [],
1932
+ fromFields: function (fields) { return ResumeTokenPoolEvent.fromFields(fields); },
1933
+ fromFieldsWithTypes: function (item) { return ResumeTokenPoolEvent.fromFieldsWithTypes(item); },
1934
+ fromBcs: function (data) { return ResumeTokenPoolEvent.fromBcs(data); },
1935
+ bcs: ResumeTokenPoolEvent.bcs,
1936
+ fromJSONField: function (field) { return ResumeTokenPoolEvent.fromJSONField(field); },
1937
+ fromJSON: function (json) { return ResumeTokenPoolEvent.fromJSON(json); },
1938
+ fromSuiParsedData: function (content) { return ResumeTokenPoolEvent.fromSuiParsedData(content); },
1939
+ fetch: function (client, id) { return __awaiter(_this, void 0, void 0, function () { return __generator(this, function (_a) {
1940
+ return [2 /*return*/, ResumeTokenPoolEvent.fetch(client, id)];
1941
+ }); }); },
1942
+ new: function (fields) {
1943
+ return new ResumeTokenPoolEvent([], fields);
1944
+ },
1945
+ kind: "StructClassReified",
1946
+ };
1947
+ };
1948
+ Object.defineProperty(ResumeTokenPoolEvent, "r", {
1949
+ get: function () {
1950
+ return ResumeTokenPoolEvent.reified();
1951
+ },
1952
+ enumerable: false,
1953
+ configurable: true
1954
+ });
1955
+ ResumeTokenPoolEvent.phantom = function () {
1956
+ return (0, reified_1.phantom)(ResumeTokenPoolEvent.reified());
1957
+ };
1958
+ Object.defineProperty(ResumeTokenPoolEvent, "p", {
1959
+ get: function () {
1960
+ return ResumeTokenPoolEvent.phantom();
1961
+ },
1962
+ enumerable: false,
1963
+ configurable: true
1964
+ });
1965
+ Object.defineProperty(ResumeTokenPoolEvent, "bcs", {
1966
+ get: function () {
1967
+ return bcs_1.bcs.struct("ResumeTokenPoolEvent", {
1968
+ sender: bcs_1.bcs.bytes(32).transform({ input: function (val) { return (0, bcs_1.fromHEX)(val); }, output: function (val) { return (0, bcs_1.toHEX)(val); } }),
1969
+ index: bcs_1.bcs.u64(),
1970
+ liquidity_token: structs_1.TypeName.bcs,
1971
+ u64_padding: bcs_1.bcs.vector(bcs_1.bcs.u64()),
1972
+ });
1973
+ },
1974
+ enumerable: false,
1975
+ configurable: true
1976
+ });
1977
+ ResumeTokenPoolEvent.fromFields = function (fields) {
1978
+ return ResumeTokenPoolEvent.reified().new({
1979
+ sender: (0, reified_1.decodeFromFields)("address", fields.sender),
1980
+ index: (0, reified_1.decodeFromFields)("u64", fields.index),
1981
+ liquidityToken: (0, reified_1.decodeFromFields)(structs_1.TypeName.reified(), fields.liquidity_token),
1982
+ u64Padding: (0, reified_1.decodeFromFields)(reified.vector("u64"), fields.u64_padding),
1983
+ });
1984
+ };
1985
+ ResumeTokenPoolEvent.fromFieldsWithTypes = function (item) {
1986
+ if (!isResumeTokenPoolEvent(item.type)) {
1987
+ throw new Error("not a ResumeTokenPoolEvent type");
1988
+ }
1989
+ return ResumeTokenPoolEvent.reified().new({
1990
+ sender: (0, reified_1.decodeFromFieldsWithTypes)("address", item.fields.sender),
1991
+ index: (0, reified_1.decodeFromFieldsWithTypes)("u64", item.fields.index),
1992
+ liquidityToken: (0, reified_1.decodeFromFieldsWithTypes)(structs_1.TypeName.reified(), item.fields.liquidity_token),
1993
+ u64Padding: (0, reified_1.decodeFromFieldsWithTypes)(reified.vector("u64"), item.fields.u64_padding),
1994
+ });
1995
+ };
1996
+ ResumeTokenPoolEvent.fromBcs = function (data) {
1997
+ return ResumeTokenPoolEvent.fromFields(ResumeTokenPoolEvent.bcs.parse(data));
1998
+ };
1999
+ ResumeTokenPoolEvent.prototype.toJSONField = function () {
2000
+ return {
2001
+ sender: this.sender,
2002
+ index: this.index.toString(),
2003
+ liquidityToken: this.liquidityToken.toJSONField(),
2004
+ u64Padding: (0, reified_1.fieldToJSON)("vector<u64>", this.u64Padding),
2005
+ };
2006
+ };
2007
+ ResumeTokenPoolEvent.prototype.toJSON = function () {
2008
+ return __assign({ $typeName: this.$typeName, $typeArgs: this.$typeArgs }, this.toJSONField());
2009
+ };
2010
+ ResumeTokenPoolEvent.fromJSONField = function (field) {
2011
+ return ResumeTokenPoolEvent.reified().new({
2012
+ sender: (0, reified_1.decodeFromJSONField)("address", field.sender),
2013
+ index: (0, reified_1.decodeFromJSONField)("u64", field.index),
2014
+ liquidityToken: (0, reified_1.decodeFromJSONField)(structs_1.TypeName.reified(), field.liquidityToken),
2015
+ u64Padding: (0, reified_1.decodeFromJSONField)(reified.vector("u64"), field.u64Padding),
2016
+ });
2017
+ };
2018
+ ResumeTokenPoolEvent.fromJSON = function (json) {
2019
+ if (json.$typeName !== ResumeTokenPoolEvent.$typeName) {
2020
+ throw new Error("not a WithTwoGenerics json object");
2021
+ }
2022
+ return ResumeTokenPoolEvent.fromJSONField(json);
2023
+ };
2024
+ ResumeTokenPoolEvent.fromSuiParsedData = function (content) {
2025
+ if (content.dataType !== "moveObject") {
2026
+ throw new Error("not an object");
2027
+ }
2028
+ if (!isResumeTokenPoolEvent(content.type)) {
2029
+ throw new Error("object at ".concat(content.fields.id, " is not a ResumeTokenPoolEvent object"));
2030
+ }
2031
+ return ResumeTokenPoolEvent.fromFieldsWithTypes(content);
2032
+ };
2033
+ ResumeTokenPoolEvent.fetch = function (client, id) {
2034
+ return __awaiter(this, void 0, void 0, function () {
2035
+ var res;
2036
+ var _a, _b;
2037
+ return __generator(this, function (_c) {
2038
+ switch (_c.label) {
2039
+ case 0: return [4 /*yield*/, client.getObject({ id: id, options: { showBcs: true } })];
2040
+ case 1:
2041
+ res = _c.sent();
2042
+ if (res.error) {
2043
+ throw new Error("error fetching ResumeTokenPoolEvent object at id ".concat(id, ": ").concat(res.error.code));
2044
+ }
2045
+ 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)) {
2046
+ throw new Error("object at id ".concat(id, " is not a ResumeTokenPoolEvent object"));
2047
+ }
2048
+ return [2 /*return*/, ResumeTokenPoolEvent.fromBcs((0, bcs_1.fromB64)(res.data.bcs.bcsBytes))];
2049
+ }
2050
+ });
2051
+ });
2052
+ };
2053
+ ResumeTokenPoolEvent.$typeName = "0x4bcf9eade4480bcb9fcd3139ec8d22afda34b25af06092904fcccb06e1b8043c::lp_pool::ResumeTokenPoolEvent";
2054
+ ResumeTokenPoolEvent.$numTypeParams = 0;
2055
+ return ResumeTokenPoolEvent;
2056
+ }());
2057
+ exports.ResumeTokenPoolEvent = ResumeTokenPoolEvent;
2058
+ /* ============================== SpotConfig =============================== */
2059
+ function isSpotConfig(type) {
2060
+ type = (0, util_1.compressSuiType)(type);
2061
+ return type === "0x4bcf9eade4480bcb9fcd3139ec8d22afda34b25af06092904fcccb06e1b8043c::lp_pool::SpotConfig";
2062
+ }
2063
+ var SpotConfig = /** @class */ (function () {
2064
+ function SpotConfig(typeArgs, fields) {
2065
+ this.$typeName = SpotConfig.$typeName;
2066
+ this.$fullTypeName = util_1.composeSuiType.apply(void 0, __spreadArray([SpotConfig.$typeName], __read(typeArgs), false));
2067
+ this.$typeArgs = typeArgs;
2068
+ this.minDeposit = fields.minDeposit;
2069
+ this.maxCapacity = fields.maxCapacity;
2070
+ this.targetWeightBp = fields.targetWeightBp;
2071
+ this.basicMintFeeBp = fields.basicMintFeeBp;
2072
+ this.additionalMintFeeBp = fields.additionalMintFeeBp;
2073
+ this.basicBurnFeeBp = fields.basicBurnFeeBp;
2074
+ this.additionalBurnFeeBp = fields.additionalBurnFeeBp;
2075
+ this.swapFeeBp = fields.swapFeeBp;
2076
+ this.swapFeeProtocolShareBp = fields.swapFeeProtocolShareBp;
2077
+ this.u64Padding = fields.u64Padding;
2078
+ }
2079
+ SpotConfig.reified = function () {
2080
+ var _this = this;
2081
+ return {
2082
+ typeName: SpotConfig.$typeName,
2083
+ fullTypeName: util_1.composeSuiType.apply(void 0, __spreadArray([SpotConfig.$typeName], [], false)),
2084
+ typeArgs: [],
2085
+ reifiedTypeArgs: [],
2086
+ fromFields: function (fields) { return SpotConfig.fromFields(fields); },
2087
+ fromFieldsWithTypes: function (item) { return SpotConfig.fromFieldsWithTypes(item); },
2088
+ fromBcs: function (data) { return SpotConfig.fromBcs(data); },
2089
+ bcs: SpotConfig.bcs,
2090
+ fromJSONField: function (field) { return SpotConfig.fromJSONField(field); },
2091
+ fromJSON: function (json) { return SpotConfig.fromJSON(json); },
2092
+ fromSuiParsedData: function (content) { return SpotConfig.fromSuiParsedData(content); },
2093
+ fetch: function (client, id) { return __awaiter(_this, void 0, void 0, function () { return __generator(this, function (_a) {
2094
+ return [2 /*return*/, SpotConfig.fetch(client, id)];
2095
+ }); }); },
2096
+ new: function (fields) {
2097
+ return new SpotConfig([], fields);
2098
+ },
2099
+ kind: "StructClassReified",
2100
+ };
2101
+ };
2102
+ Object.defineProperty(SpotConfig, "r", {
2103
+ get: function () {
2104
+ return SpotConfig.reified();
2105
+ },
2106
+ enumerable: false,
2107
+ configurable: true
2108
+ });
2109
+ SpotConfig.phantom = function () {
2110
+ return (0, reified_1.phantom)(SpotConfig.reified());
2111
+ };
2112
+ Object.defineProperty(SpotConfig, "p", {
2113
+ get: function () {
2114
+ return SpotConfig.phantom();
2115
+ },
2116
+ enumerable: false,
2117
+ configurable: true
2118
+ });
2119
+ Object.defineProperty(SpotConfig, "bcs", {
2120
+ get: function () {
2121
+ return bcs_1.bcs.struct("SpotConfig", {
2122
+ min_deposit: bcs_1.bcs.u64(),
2123
+ max_capacity: bcs_1.bcs.u64(),
2124
+ target_weight_bp: bcs_1.bcs.u64(),
2125
+ basic_mint_fee_bp: bcs_1.bcs.u64(),
2126
+ additional_mint_fee_bp: bcs_1.bcs.u64(),
2127
+ basic_burn_fee_bp: bcs_1.bcs.u64(),
2128
+ additional_burn_fee_bp: bcs_1.bcs.u64(),
2129
+ swap_fee_bp: bcs_1.bcs.u64(),
2130
+ swap_fee_protocol_share_bp: bcs_1.bcs.u64(),
2131
+ u64_padding: bcs_1.bcs.vector(bcs_1.bcs.u64()),
2132
+ });
2133
+ },
2134
+ enumerable: false,
2135
+ configurable: true
2136
+ });
2137
+ SpotConfig.fromFields = function (fields) {
2138
+ return SpotConfig.reified().new({
2139
+ minDeposit: (0, reified_1.decodeFromFields)("u64", fields.min_deposit),
2140
+ maxCapacity: (0, reified_1.decodeFromFields)("u64", fields.max_capacity),
2141
+ targetWeightBp: (0, reified_1.decodeFromFields)("u64", fields.target_weight_bp),
2142
+ basicMintFeeBp: (0, reified_1.decodeFromFields)("u64", fields.basic_mint_fee_bp),
2143
+ additionalMintFeeBp: (0, reified_1.decodeFromFields)("u64", fields.additional_mint_fee_bp),
2144
+ basicBurnFeeBp: (0, reified_1.decodeFromFields)("u64", fields.basic_burn_fee_bp),
2145
+ additionalBurnFeeBp: (0, reified_1.decodeFromFields)("u64", fields.additional_burn_fee_bp),
2146
+ swapFeeBp: (0, reified_1.decodeFromFields)("u64", fields.swap_fee_bp),
2147
+ swapFeeProtocolShareBp: (0, reified_1.decodeFromFields)("u64", fields.swap_fee_protocol_share_bp),
2148
+ u64Padding: (0, reified_1.decodeFromFields)(reified.vector("u64"), fields.u64_padding),
2149
+ });
2150
+ };
2151
+ SpotConfig.fromFieldsWithTypes = function (item) {
2152
+ if (!isSpotConfig(item.type)) {
2153
+ throw new Error("not a SpotConfig type");
2154
+ }
2155
+ return SpotConfig.reified().new({
2156
+ minDeposit: (0, reified_1.decodeFromFieldsWithTypes)("u64", item.fields.min_deposit),
2157
+ maxCapacity: (0, reified_1.decodeFromFieldsWithTypes)("u64", item.fields.max_capacity),
2158
+ targetWeightBp: (0, reified_1.decodeFromFieldsWithTypes)("u64", item.fields.target_weight_bp),
2159
+ basicMintFeeBp: (0, reified_1.decodeFromFieldsWithTypes)("u64", item.fields.basic_mint_fee_bp),
2160
+ additionalMintFeeBp: (0, reified_1.decodeFromFieldsWithTypes)("u64", item.fields.additional_mint_fee_bp),
2161
+ basicBurnFeeBp: (0, reified_1.decodeFromFieldsWithTypes)("u64", item.fields.basic_burn_fee_bp),
2162
+ additionalBurnFeeBp: (0, reified_1.decodeFromFieldsWithTypes)("u64", item.fields.additional_burn_fee_bp),
2163
+ swapFeeBp: (0, reified_1.decodeFromFieldsWithTypes)("u64", item.fields.swap_fee_bp),
2164
+ swapFeeProtocolShareBp: (0, reified_1.decodeFromFieldsWithTypes)("u64", item.fields.swap_fee_protocol_share_bp),
2165
+ u64Padding: (0, reified_1.decodeFromFieldsWithTypes)(reified.vector("u64"), item.fields.u64_padding),
2166
+ });
2167
+ };
2168
+ SpotConfig.fromBcs = function (data) {
2169
+ return SpotConfig.fromFields(SpotConfig.bcs.parse(data));
2170
+ };
2171
+ SpotConfig.prototype.toJSONField = function () {
2172
+ return {
2173
+ minDeposit: this.minDeposit.toString(),
2174
+ maxCapacity: this.maxCapacity.toString(),
2175
+ targetWeightBp: this.targetWeightBp.toString(),
2176
+ basicMintFeeBp: this.basicMintFeeBp.toString(),
2177
+ additionalMintFeeBp: this.additionalMintFeeBp.toString(),
2178
+ basicBurnFeeBp: this.basicBurnFeeBp.toString(),
2179
+ additionalBurnFeeBp: this.additionalBurnFeeBp.toString(),
2180
+ swapFeeBp: this.swapFeeBp.toString(),
2181
+ swapFeeProtocolShareBp: this.swapFeeProtocolShareBp.toString(),
2182
+ u64Padding: (0, reified_1.fieldToJSON)("vector<u64>", this.u64Padding),
2183
+ };
2184
+ };
2185
+ SpotConfig.prototype.toJSON = function () {
2186
+ return __assign({ $typeName: this.$typeName, $typeArgs: this.$typeArgs }, this.toJSONField());
2187
+ };
2188
+ SpotConfig.fromJSONField = function (field) {
2189
+ return SpotConfig.reified().new({
2190
+ minDeposit: (0, reified_1.decodeFromJSONField)("u64", field.minDeposit),
2191
+ maxCapacity: (0, reified_1.decodeFromJSONField)("u64", field.maxCapacity),
2192
+ targetWeightBp: (0, reified_1.decodeFromJSONField)("u64", field.targetWeightBp),
2193
+ basicMintFeeBp: (0, reified_1.decodeFromJSONField)("u64", field.basicMintFeeBp),
2194
+ additionalMintFeeBp: (0, reified_1.decodeFromJSONField)("u64", field.additionalMintFeeBp),
2195
+ basicBurnFeeBp: (0, reified_1.decodeFromJSONField)("u64", field.basicBurnFeeBp),
2196
+ additionalBurnFeeBp: (0, reified_1.decodeFromJSONField)("u64", field.additionalBurnFeeBp),
2197
+ swapFeeBp: (0, reified_1.decodeFromJSONField)("u64", field.swapFeeBp),
2198
+ swapFeeProtocolShareBp: (0, reified_1.decodeFromJSONField)("u64", field.swapFeeProtocolShareBp),
2199
+ u64Padding: (0, reified_1.decodeFromJSONField)(reified.vector("u64"), field.u64Padding),
2200
+ });
2201
+ };
2202
+ SpotConfig.fromJSON = function (json) {
2203
+ if (json.$typeName !== SpotConfig.$typeName) {
2204
+ throw new Error("not a WithTwoGenerics json object");
2205
+ }
2206
+ return SpotConfig.fromJSONField(json);
2207
+ };
2208
+ SpotConfig.fromSuiParsedData = function (content) {
2209
+ if (content.dataType !== "moveObject") {
2210
+ throw new Error("not an object");
2211
+ }
2212
+ if (!isSpotConfig(content.type)) {
2213
+ throw new Error("object at ".concat(content.fields.id, " is not a SpotConfig object"));
2214
+ }
2215
+ return SpotConfig.fromFieldsWithTypes(content);
2216
+ };
2217
+ SpotConfig.fetch = function (client, id) {
2218
+ return __awaiter(this, void 0, void 0, function () {
2219
+ var res;
2220
+ var _a, _b;
2221
+ return __generator(this, function (_c) {
2222
+ switch (_c.label) {
2223
+ case 0: return [4 /*yield*/, client.getObject({ id: id, options: { showBcs: true } })];
2224
+ case 1:
2225
+ res = _c.sent();
2226
+ if (res.error) {
2227
+ throw new Error("error fetching SpotConfig object at id ".concat(id, ": ").concat(res.error.code));
2228
+ }
2229
+ 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)) {
2230
+ throw new Error("object at id ".concat(id, " is not a SpotConfig object"));
2231
+ }
2232
+ return [2 /*return*/, SpotConfig.fromBcs((0, bcs_1.fromB64)(res.data.bcs.bcsBytes))];
2233
+ }
2234
+ });
2235
+ });
2236
+ };
2237
+ SpotConfig.$typeName = "0x4bcf9eade4480bcb9fcd3139ec8d22afda34b25af06092904fcccb06e1b8043c::lp_pool::SpotConfig";
2238
+ SpotConfig.$numTypeParams = 0;
2239
+ return SpotConfig;
2240
+ }());
2241
+ exports.SpotConfig = SpotConfig;
2242
+ /* ============================== SuspendPoolEvent =============================== */
2243
+ function isSuspendPoolEvent(type) {
2244
+ type = (0, util_1.compressSuiType)(type);
2245
+ return type === "0x4bcf9eade4480bcb9fcd3139ec8d22afda34b25af06092904fcccb06e1b8043c::lp_pool::SuspendPoolEvent";
2246
+ }
2247
+ var SuspendPoolEvent = /** @class */ (function () {
2248
+ function SuspendPoolEvent(typeArgs, fields) {
2249
+ this.$typeName = SuspendPoolEvent.$typeName;
2250
+ this.$fullTypeName = util_1.composeSuiType.apply(void 0, __spreadArray([SuspendPoolEvent.$typeName], __read(typeArgs), false));
2251
+ this.$typeArgs = typeArgs;
2252
+ this.sender = fields.sender;
2253
+ this.index = fields.index;
2254
+ this.u64Padding = fields.u64Padding;
2255
+ }
2256
+ SuspendPoolEvent.reified = function () {
2257
+ var _this = this;
2258
+ return {
2259
+ typeName: SuspendPoolEvent.$typeName,
2260
+ fullTypeName: util_1.composeSuiType.apply(void 0, __spreadArray([SuspendPoolEvent.$typeName], [], false)),
2261
+ typeArgs: [],
2262
+ reifiedTypeArgs: [],
2263
+ fromFields: function (fields) { return SuspendPoolEvent.fromFields(fields); },
2264
+ fromFieldsWithTypes: function (item) { return SuspendPoolEvent.fromFieldsWithTypes(item); },
2265
+ fromBcs: function (data) { return SuspendPoolEvent.fromBcs(data); },
2266
+ bcs: SuspendPoolEvent.bcs,
2267
+ fromJSONField: function (field) { return SuspendPoolEvent.fromJSONField(field); },
2268
+ fromJSON: function (json) { return SuspendPoolEvent.fromJSON(json); },
2269
+ fromSuiParsedData: function (content) { return SuspendPoolEvent.fromSuiParsedData(content); },
2270
+ fetch: function (client, id) { return __awaiter(_this, void 0, void 0, function () { return __generator(this, function (_a) {
2271
+ return [2 /*return*/, SuspendPoolEvent.fetch(client, id)];
2272
+ }); }); },
2273
+ new: function (fields) {
2274
+ return new SuspendPoolEvent([], fields);
2275
+ },
2276
+ kind: "StructClassReified",
2277
+ };
2278
+ };
2279
+ Object.defineProperty(SuspendPoolEvent, "r", {
2280
+ get: function () {
2281
+ return SuspendPoolEvent.reified();
2282
+ },
2283
+ enumerable: false,
2284
+ configurable: true
2285
+ });
2286
+ SuspendPoolEvent.phantom = function () {
2287
+ return (0, reified_1.phantom)(SuspendPoolEvent.reified());
2288
+ };
2289
+ Object.defineProperty(SuspendPoolEvent, "p", {
2290
+ get: function () {
2291
+ return SuspendPoolEvent.phantom();
2292
+ },
2293
+ enumerable: false,
2294
+ configurable: true
2295
+ });
2296
+ Object.defineProperty(SuspendPoolEvent, "bcs", {
2297
+ get: function () {
2298
+ return bcs_1.bcs.struct("SuspendPoolEvent", {
2299
+ sender: bcs_1.bcs.bytes(32).transform({ input: function (val) { return (0, bcs_1.fromHEX)(val); }, output: function (val) { return (0, bcs_1.toHEX)(val); } }),
2300
+ index: bcs_1.bcs.u64(),
2301
+ u64_padding: bcs_1.bcs.vector(bcs_1.bcs.u64()),
2302
+ });
2303
+ },
2304
+ enumerable: false,
2305
+ configurable: true
2306
+ });
2307
+ SuspendPoolEvent.fromFields = function (fields) {
2308
+ return SuspendPoolEvent.reified().new({
2309
+ sender: (0, reified_1.decodeFromFields)("address", fields.sender),
2310
+ index: (0, reified_1.decodeFromFields)("u64", fields.index),
2311
+ u64Padding: (0, reified_1.decodeFromFields)(reified.vector("u64"), fields.u64_padding),
2312
+ });
2313
+ };
2314
+ SuspendPoolEvent.fromFieldsWithTypes = function (item) {
2315
+ if (!isSuspendPoolEvent(item.type)) {
2316
+ throw new Error("not a SuspendPoolEvent type");
2317
+ }
2318
+ return SuspendPoolEvent.reified().new({
2319
+ sender: (0, reified_1.decodeFromFieldsWithTypes)("address", item.fields.sender),
2320
+ index: (0, reified_1.decodeFromFieldsWithTypes)("u64", item.fields.index),
2321
+ u64Padding: (0, reified_1.decodeFromFieldsWithTypes)(reified.vector("u64"), item.fields.u64_padding),
2322
+ });
2323
+ };
2324
+ SuspendPoolEvent.fromBcs = function (data) {
2325
+ return SuspendPoolEvent.fromFields(SuspendPoolEvent.bcs.parse(data));
2326
+ };
2327
+ SuspendPoolEvent.prototype.toJSONField = function () {
2328
+ return {
2329
+ sender: this.sender,
2330
+ index: this.index.toString(),
2331
+ u64Padding: (0, reified_1.fieldToJSON)("vector<u64>", this.u64Padding),
2332
+ };
2333
+ };
2334
+ SuspendPoolEvent.prototype.toJSON = function () {
2335
+ return __assign({ $typeName: this.$typeName, $typeArgs: this.$typeArgs }, this.toJSONField());
2336
+ };
2337
+ SuspendPoolEvent.fromJSONField = function (field) {
2338
+ return SuspendPoolEvent.reified().new({
2339
+ sender: (0, reified_1.decodeFromJSONField)("address", field.sender),
2340
+ index: (0, reified_1.decodeFromJSONField)("u64", field.index),
2341
+ u64Padding: (0, reified_1.decodeFromJSONField)(reified.vector("u64"), field.u64Padding),
2342
+ });
2343
+ };
2344
+ SuspendPoolEvent.fromJSON = function (json) {
2345
+ if (json.$typeName !== SuspendPoolEvent.$typeName) {
2346
+ throw new Error("not a WithTwoGenerics json object");
2347
+ }
2348
+ return SuspendPoolEvent.fromJSONField(json);
2349
+ };
2350
+ SuspendPoolEvent.fromSuiParsedData = function (content) {
2351
+ if (content.dataType !== "moveObject") {
2352
+ throw new Error("not an object");
2353
+ }
2354
+ if (!isSuspendPoolEvent(content.type)) {
2355
+ throw new Error("object at ".concat(content.fields.id, " is not a SuspendPoolEvent object"));
2356
+ }
2357
+ return SuspendPoolEvent.fromFieldsWithTypes(content);
2358
+ };
2359
+ SuspendPoolEvent.fetch = function (client, id) {
2360
+ return __awaiter(this, void 0, void 0, function () {
2361
+ var res;
2362
+ var _a, _b;
2363
+ return __generator(this, function (_c) {
2364
+ switch (_c.label) {
2365
+ case 0: return [4 /*yield*/, client.getObject({ id: id, options: { showBcs: true } })];
2366
+ case 1:
2367
+ res = _c.sent();
2368
+ if (res.error) {
2369
+ throw new Error("error fetching SuspendPoolEvent object at id ".concat(id, ": ").concat(res.error.code));
2370
+ }
2371
+ 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)) {
2372
+ throw new Error("object at id ".concat(id, " is not a SuspendPoolEvent object"));
2373
+ }
2374
+ return [2 /*return*/, SuspendPoolEvent.fromBcs((0, bcs_1.fromB64)(res.data.bcs.bcsBytes))];
2375
+ }
2376
+ });
2377
+ });
2378
+ };
2379
+ SuspendPoolEvent.$typeName = "0x4bcf9eade4480bcb9fcd3139ec8d22afda34b25af06092904fcccb06e1b8043c::lp_pool::SuspendPoolEvent";
2380
+ SuspendPoolEvent.$numTypeParams = 0;
2381
+ return SuspendPoolEvent;
2382
+ }());
2383
+ exports.SuspendPoolEvent = SuspendPoolEvent;
2384
+ /* ============================== SuspendTokenPoolEvent =============================== */
2385
+ function isSuspendTokenPoolEvent(type) {
2386
+ type = (0, util_1.compressSuiType)(type);
2387
+ return type === "0x4bcf9eade4480bcb9fcd3139ec8d22afda34b25af06092904fcccb06e1b8043c::lp_pool::SuspendTokenPoolEvent";
2388
+ }
2389
+ var SuspendTokenPoolEvent = /** @class */ (function () {
2390
+ function SuspendTokenPoolEvent(typeArgs, fields) {
2391
+ this.$typeName = SuspendTokenPoolEvent.$typeName;
2392
+ this.$fullTypeName = util_1.composeSuiType.apply(void 0, __spreadArray([SuspendTokenPoolEvent.$typeName], __read(typeArgs), false));
2393
+ this.$typeArgs = typeArgs;
2394
+ this.sender = fields.sender;
2395
+ this.index = fields.index;
2396
+ this.liquidityToken = fields.liquidityToken;
2397
+ this.u64Padding = fields.u64Padding;
2398
+ }
2399
+ SuspendTokenPoolEvent.reified = function () {
2400
+ var _this = this;
2401
+ return {
2402
+ typeName: SuspendTokenPoolEvent.$typeName,
2403
+ fullTypeName: util_1.composeSuiType.apply(void 0, __spreadArray([SuspendTokenPoolEvent.$typeName], [], false)),
2404
+ typeArgs: [],
2405
+ reifiedTypeArgs: [],
2406
+ fromFields: function (fields) { return SuspendTokenPoolEvent.fromFields(fields); },
2407
+ fromFieldsWithTypes: function (item) { return SuspendTokenPoolEvent.fromFieldsWithTypes(item); },
2408
+ fromBcs: function (data) { return SuspendTokenPoolEvent.fromBcs(data); },
2409
+ bcs: SuspendTokenPoolEvent.bcs,
2410
+ fromJSONField: function (field) { return SuspendTokenPoolEvent.fromJSONField(field); },
2411
+ fromJSON: function (json) { return SuspendTokenPoolEvent.fromJSON(json); },
2412
+ fromSuiParsedData: function (content) { return SuspendTokenPoolEvent.fromSuiParsedData(content); },
2413
+ fetch: function (client, id) { return __awaiter(_this, void 0, void 0, function () { return __generator(this, function (_a) {
2414
+ return [2 /*return*/, SuspendTokenPoolEvent.fetch(client, id)];
2415
+ }); }); },
2416
+ new: function (fields) {
2417
+ return new SuspendTokenPoolEvent([], fields);
2418
+ },
2419
+ kind: "StructClassReified",
2420
+ };
2421
+ };
2422
+ Object.defineProperty(SuspendTokenPoolEvent, "r", {
2423
+ get: function () {
2424
+ return SuspendTokenPoolEvent.reified();
2425
+ },
2426
+ enumerable: false,
2427
+ configurable: true
2428
+ });
2429
+ SuspendTokenPoolEvent.phantom = function () {
2430
+ return (0, reified_1.phantom)(SuspendTokenPoolEvent.reified());
2431
+ };
2432
+ Object.defineProperty(SuspendTokenPoolEvent, "p", {
2433
+ get: function () {
2434
+ return SuspendTokenPoolEvent.phantom();
2435
+ },
2436
+ enumerable: false,
2437
+ configurable: true
2438
+ });
2439
+ Object.defineProperty(SuspendTokenPoolEvent, "bcs", {
2440
+ get: function () {
2441
+ return bcs_1.bcs.struct("SuspendTokenPoolEvent", {
2442
+ sender: bcs_1.bcs.bytes(32).transform({ input: function (val) { return (0, bcs_1.fromHEX)(val); }, output: function (val) { return (0, bcs_1.toHEX)(val); } }),
2443
+ index: bcs_1.bcs.u64(),
2444
+ liquidity_token: structs_1.TypeName.bcs,
2445
+ u64_padding: bcs_1.bcs.vector(bcs_1.bcs.u64()),
2446
+ });
2447
+ },
2448
+ enumerable: false,
2449
+ configurable: true
2450
+ });
2451
+ SuspendTokenPoolEvent.fromFields = function (fields) {
2452
+ return SuspendTokenPoolEvent.reified().new({
2453
+ sender: (0, reified_1.decodeFromFields)("address", fields.sender),
2454
+ index: (0, reified_1.decodeFromFields)("u64", fields.index),
2455
+ liquidityToken: (0, reified_1.decodeFromFields)(structs_1.TypeName.reified(), fields.liquidity_token),
2456
+ u64Padding: (0, reified_1.decodeFromFields)(reified.vector("u64"), fields.u64_padding),
2457
+ });
2458
+ };
2459
+ SuspendTokenPoolEvent.fromFieldsWithTypes = function (item) {
2460
+ if (!isSuspendTokenPoolEvent(item.type)) {
2461
+ throw new Error("not a SuspendTokenPoolEvent type");
2462
+ }
2463
+ return SuspendTokenPoolEvent.reified().new({
2464
+ sender: (0, reified_1.decodeFromFieldsWithTypes)("address", item.fields.sender),
2465
+ index: (0, reified_1.decodeFromFieldsWithTypes)("u64", item.fields.index),
2466
+ liquidityToken: (0, reified_1.decodeFromFieldsWithTypes)(structs_1.TypeName.reified(), item.fields.liquidity_token),
2467
+ u64Padding: (0, reified_1.decodeFromFieldsWithTypes)(reified.vector("u64"), item.fields.u64_padding),
2468
+ });
2469
+ };
2470
+ SuspendTokenPoolEvent.fromBcs = function (data) {
2471
+ return SuspendTokenPoolEvent.fromFields(SuspendTokenPoolEvent.bcs.parse(data));
2472
+ };
2473
+ SuspendTokenPoolEvent.prototype.toJSONField = function () {
2474
+ return {
2475
+ sender: this.sender,
2476
+ index: this.index.toString(),
2477
+ liquidityToken: this.liquidityToken.toJSONField(),
2478
+ u64Padding: (0, reified_1.fieldToJSON)("vector<u64>", this.u64Padding),
2479
+ };
2480
+ };
2481
+ SuspendTokenPoolEvent.prototype.toJSON = function () {
2482
+ return __assign({ $typeName: this.$typeName, $typeArgs: this.$typeArgs }, this.toJSONField());
2483
+ };
2484
+ SuspendTokenPoolEvent.fromJSONField = function (field) {
2485
+ return SuspendTokenPoolEvent.reified().new({
2486
+ sender: (0, reified_1.decodeFromJSONField)("address", field.sender),
2487
+ index: (0, reified_1.decodeFromJSONField)("u64", field.index),
2488
+ liquidityToken: (0, reified_1.decodeFromJSONField)(structs_1.TypeName.reified(), field.liquidityToken),
2489
+ u64Padding: (0, reified_1.decodeFromJSONField)(reified.vector("u64"), field.u64Padding),
2490
+ });
2491
+ };
2492
+ SuspendTokenPoolEvent.fromJSON = function (json) {
2493
+ if (json.$typeName !== SuspendTokenPoolEvent.$typeName) {
2494
+ throw new Error("not a WithTwoGenerics json object");
2495
+ }
2496
+ return SuspendTokenPoolEvent.fromJSONField(json);
2497
+ };
2498
+ SuspendTokenPoolEvent.fromSuiParsedData = function (content) {
2499
+ if (content.dataType !== "moveObject") {
2500
+ throw new Error("not an object");
2501
+ }
2502
+ if (!isSuspendTokenPoolEvent(content.type)) {
2503
+ throw new Error("object at ".concat(content.fields.id, " is not a SuspendTokenPoolEvent object"));
2504
+ }
2505
+ return SuspendTokenPoolEvent.fromFieldsWithTypes(content);
2506
+ };
2507
+ SuspendTokenPoolEvent.fetch = function (client, id) {
2508
+ return __awaiter(this, void 0, void 0, function () {
2509
+ var res;
2510
+ var _a, _b;
2511
+ return __generator(this, function (_c) {
2512
+ switch (_c.label) {
2513
+ case 0: return [4 /*yield*/, client.getObject({ id: id, options: { showBcs: true } })];
2514
+ case 1:
2515
+ res = _c.sent();
2516
+ if (res.error) {
2517
+ throw new Error("error fetching SuspendTokenPoolEvent object at id ".concat(id, ": ").concat(res.error.code));
2518
+ }
2519
+ 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)) {
2520
+ throw new Error("object at id ".concat(id, " is not a SuspendTokenPoolEvent object"));
2521
+ }
2522
+ return [2 /*return*/, SuspendTokenPoolEvent.fromBcs((0, bcs_1.fromB64)(res.data.bcs.bcsBytes))];
2523
+ }
2524
+ });
2525
+ });
2526
+ };
2527
+ SuspendTokenPoolEvent.$typeName = "0x4bcf9eade4480bcb9fcd3139ec8d22afda34b25af06092904fcccb06e1b8043c::lp_pool::SuspendTokenPoolEvent";
2528
+ SuspendTokenPoolEvent.$numTypeParams = 0;
2529
+ return SuspendTokenPoolEvent;
2530
+ }());
2531
+ exports.SuspendTokenPoolEvent = SuspendTokenPoolEvent;
2532
+ /* ============================== SwapEvent =============================== */
2533
+ function isSwapEvent(type) {
2534
+ type = (0, util_1.compressSuiType)(type);
2535
+ return type === "0x4bcf9eade4480bcb9fcd3139ec8d22afda34b25af06092904fcccb06e1b8043c::lp_pool::SwapEvent";
2536
+ }
2537
+ var SwapEvent = /** @class */ (function () {
2538
+ function SwapEvent(typeArgs, fields) {
2539
+ this.$typeName = SwapEvent.$typeName;
2540
+ this.$fullTypeName = util_1.composeSuiType.apply(void 0, __spreadArray([SwapEvent.$typeName], __read(typeArgs), false));
2541
+ this.$typeArgs = typeArgs;
2542
+ this.sender = fields.sender;
2543
+ this.index = fields.index;
2544
+ this.fromTokenType = fields.fromTokenType;
2545
+ this.fromAmount = fields.fromAmount;
2546
+ this.toTokenType = fields.toTokenType;
2547
+ this.minToAmount = fields.minToAmount;
2548
+ this.actualToAmount = fields.actualToAmount;
2549
+ this.feeAmount = fields.feeAmount;
2550
+ this.feeAmountUsd = fields.feeAmountUsd;
2551
+ this.u64Padding = fields.u64Padding;
2552
+ }
2553
+ SwapEvent.reified = function () {
2554
+ var _this = this;
2555
+ return {
2556
+ typeName: SwapEvent.$typeName,
2557
+ fullTypeName: util_1.composeSuiType.apply(void 0, __spreadArray([SwapEvent.$typeName], [], false)),
2558
+ typeArgs: [],
2559
+ reifiedTypeArgs: [],
2560
+ fromFields: function (fields) { return SwapEvent.fromFields(fields); },
2561
+ fromFieldsWithTypes: function (item) { return SwapEvent.fromFieldsWithTypes(item); },
2562
+ fromBcs: function (data) { return SwapEvent.fromBcs(data); },
2563
+ bcs: SwapEvent.bcs,
2564
+ fromJSONField: function (field) { return SwapEvent.fromJSONField(field); },
2565
+ fromJSON: function (json) { return SwapEvent.fromJSON(json); },
2566
+ fromSuiParsedData: function (content) { return SwapEvent.fromSuiParsedData(content); },
2567
+ fetch: function (client, id) { return __awaiter(_this, void 0, void 0, function () { return __generator(this, function (_a) {
2568
+ return [2 /*return*/, SwapEvent.fetch(client, id)];
2569
+ }); }); },
2570
+ new: function (fields) {
2571
+ return new SwapEvent([], fields);
2572
+ },
2573
+ kind: "StructClassReified",
2574
+ };
2575
+ };
2576
+ Object.defineProperty(SwapEvent, "r", {
2577
+ get: function () {
2578
+ return SwapEvent.reified();
2579
+ },
2580
+ enumerable: false,
2581
+ configurable: true
2582
+ });
2583
+ SwapEvent.phantom = function () {
2584
+ return (0, reified_1.phantom)(SwapEvent.reified());
2585
+ };
2586
+ Object.defineProperty(SwapEvent, "p", {
2587
+ get: function () {
2588
+ return SwapEvent.phantom();
2589
+ },
2590
+ enumerable: false,
2591
+ configurable: true
2592
+ });
2593
+ Object.defineProperty(SwapEvent, "bcs", {
2594
+ get: function () {
2595
+ return bcs_1.bcs.struct("SwapEvent", {
2596
+ sender: bcs_1.bcs.bytes(32).transform({ input: function (val) { return (0, bcs_1.fromHEX)(val); }, output: function (val) { return (0, bcs_1.toHEX)(val); } }),
2597
+ index: bcs_1.bcs.u64(),
2598
+ from_token_type: structs_1.TypeName.bcs,
2599
+ from_amount: bcs_1.bcs.u64(),
2600
+ to_token_type: structs_1.TypeName.bcs,
2601
+ min_to_amount: bcs_1.bcs.u64(),
2602
+ actual_to_amount: bcs_1.bcs.u64(),
2603
+ fee_amount: bcs_1.bcs.u64(),
2604
+ fee_amount_usd: bcs_1.bcs.u64(),
2605
+ u64_padding: bcs_1.bcs.vector(bcs_1.bcs.u64()),
2606
+ });
2607
+ },
2608
+ enumerable: false,
2609
+ configurable: true
2610
+ });
2611
+ SwapEvent.fromFields = function (fields) {
2612
+ return SwapEvent.reified().new({
2613
+ sender: (0, reified_1.decodeFromFields)("address", fields.sender),
2614
+ index: (0, reified_1.decodeFromFields)("u64", fields.index),
2615
+ fromTokenType: (0, reified_1.decodeFromFields)(structs_1.TypeName.reified(), fields.from_token_type),
2616
+ fromAmount: (0, reified_1.decodeFromFields)("u64", fields.from_amount),
2617
+ toTokenType: (0, reified_1.decodeFromFields)(structs_1.TypeName.reified(), fields.to_token_type),
2618
+ minToAmount: (0, reified_1.decodeFromFields)("u64", fields.min_to_amount),
2619
+ actualToAmount: (0, reified_1.decodeFromFields)("u64", fields.actual_to_amount),
2620
+ feeAmount: (0, reified_1.decodeFromFields)("u64", fields.fee_amount),
2621
+ feeAmountUsd: (0, reified_1.decodeFromFields)("u64", fields.fee_amount_usd),
2622
+ u64Padding: (0, reified_1.decodeFromFields)(reified.vector("u64"), fields.u64_padding),
2623
+ });
2624
+ };
2625
+ SwapEvent.fromFieldsWithTypes = function (item) {
2626
+ if (!isSwapEvent(item.type)) {
2627
+ throw new Error("not a SwapEvent type");
2628
+ }
2629
+ return SwapEvent.reified().new({
2630
+ sender: (0, reified_1.decodeFromFieldsWithTypes)("address", item.fields.sender),
2631
+ index: (0, reified_1.decodeFromFieldsWithTypes)("u64", item.fields.index),
2632
+ fromTokenType: (0, reified_1.decodeFromFieldsWithTypes)(structs_1.TypeName.reified(), item.fields.from_token_type),
2633
+ fromAmount: (0, reified_1.decodeFromFieldsWithTypes)("u64", item.fields.from_amount),
2634
+ toTokenType: (0, reified_1.decodeFromFieldsWithTypes)(structs_1.TypeName.reified(), item.fields.to_token_type),
2635
+ minToAmount: (0, reified_1.decodeFromFieldsWithTypes)("u64", item.fields.min_to_amount),
2636
+ actualToAmount: (0, reified_1.decodeFromFieldsWithTypes)("u64", item.fields.actual_to_amount),
2637
+ feeAmount: (0, reified_1.decodeFromFieldsWithTypes)("u64", item.fields.fee_amount),
2638
+ feeAmountUsd: (0, reified_1.decodeFromFieldsWithTypes)("u64", item.fields.fee_amount_usd),
2639
+ u64Padding: (0, reified_1.decodeFromFieldsWithTypes)(reified.vector("u64"), item.fields.u64_padding),
2640
+ });
2641
+ };
2642
+ SwapEvent.fromBcs = function (data) {
2643
+ return SwapEvent.fromFields(SwapEvent.bcs.parse(data));
2644
+ };
2645
+ SwapEvent.prototype.toJSONField = function () {
2646
+ return {
2647
+ sender: this.sender,
2648
+ index: this.index.toString(),
2649
+ fromTokenType: this.fromTokenType.toJSONField(),
2650
+ fromAmount: this.fromAmount.toString(),
2651
+ toTokenType: this.toTokenType.toJSONField(),
2652
+ minToAmount: this.minToAmount.toString(),
2653
+ actualToAmount: this.actualToAmount.toString(),
2654
+ feeAmount: this.feeAmount.toString(),
2655
+ feeAmountUsd: this.feeAmountUsd.toString(),
2656
+ u64Padding: (0, reified_1.fieldToJSON)("vector<u64>", this.u64Padding),
2657
+ };
2658
+ };
2659
+ SwapEvent.prototype.toJSON = function () {
2660
+ return __assign({ $typeName: this.$typeName, $typeArgs: this.$typeArgs }, this.toJSONField());
2661
+ };
2662
+ SwapEvent.fromJSONField = function (field) {
2663
+ return SwapEvent.reified().new({
2664
+ sender: (0, reified_1.decodeFromJSONField)("address", field.sender),
2665
+ index: (0, reified_1.decodeFromJSONField)("u64", field.index),
2666
+ fromTokenType: (0, reified_1.decodeFromJSONField)(structs_1.TypeName.reified(), field.fromTokenType),
2667
+ fromAmount: (0, reified_1.decodeFromJSONField)("u64", field.fromAmount),
2668
+ toTokenType: (0, reified_1.decodeFromJSONField)(structs_1.TypeName.reified(), field.toTokenType),
2669
+ minToAmount: (0, reified_1.decodeFromJSONField)("u64", field.minToAmount),
2670
+ actualToAmount: (0, reified_1.decodeFromJSONField)("u64", field.actualToAmount),
2671
+ feeAmount: (0, reified_1.decodeFromJSONField)("u64", field.feeAmount),
2672
+ feeAmountUsd: (0, reified_1.decodeFromJSONField)("u64", field.feeAmountUsd),
2673
+ u64Padding: (0, reified_1.decodeFromJSONField)(reified.vector("u64"), field.u64Padding),
2674
+ });
2675
+ };
2676
+ SwapEvent.fromJSON = function (json) {
2677
+ if (json.$typeName !== SwapEvent.$typeName) {
2678
+ throw new Error("not a WithTwoGenerics json object");
2679
+ }
2680
+ return SwapEvent.fromJSONField(json);
2681
+ };
2682
+ SwapEvent.fromSuiParsedData = function (content) {
2683
+ if (content.dataType !== "moveObject") {
2684
+ throw new Error("not an object");
2685
+ }
2686
+ if (!isSwapEvent(content.type)) {
2687
+ throw new Error("object at ".concat(content.fields.id, " is not a SwapEvent object"));
2688
+ }
2689
+ return SwapEvent.fromFieldsWithTypes(content);
2690
+ };
2691
+ SwapEvent.fetch = function (client, id) {
2692
+ return __awaiter(this, void 0, void 0, function () {
2693
+ var res;
2694
+ var _a, _b;
2695
+ return __generator(this, function (_c) {
2696
+ switch (_c.label) {
2697
+ case 0: return [4 /*yield*/, client.getObject({ id: id, options: { showBcs: true } })];
2698
+ case 1:
2699
+ res = _c.sent();
2700
+ if (res.error) {
2701
+ throw new Error("error fetching SwapEvent object at id ".concat(id, ": ").concat(res.error.code));
2702
+ }
2703
+ 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)) {
2704
+ throw new Error("object at id ".concat(id, " is not a SwapEvent object"));
2705
+ }
2706
+ return [2 /*return*/, SwapEvent.fromBcs((0, bcs_1.fromB64)(res.data.bcs.bcsBytes))];
2707
+ }
2708
+ });
2709
+ });
2710
+ };
2711
+ SwapEvent.$typeName = "0x4bcf9eade4480bcb9fcd3139ec8d22afda34b25af06092904fcccb06e1b8043c::lp_pool::SwapEvent";
2712
+ SwapEvent.$numTypeParams = 0;
2713
+ return SwapEvent;
2714
+ }());
2715
+ exports.SwapEvent = SwapEvent;
2716
+ /* ============================== TokenPool =============================== */
2717
+ function isTokenPool(type) {
2718
+ type = (0, util_1.compressSuiType)(type);
2719
+ return type === "0x4bcf9eade4480bcb9fcd3139ec8d22afda34b25af06092904fcccb06e1b8043c::lp_pool::TokenPool";
2720
+ }
2721
+ var TokenPool = /** @class */ (function () {
2722
+ function TokenPool(typeArgs, fields) {
2723
+ this.$typeName = TokenPool.$typeName;
2724
+ this.$fullTypeName = util_1.composeSuiType.apply(void 0, __spreadArray([TokenPool.$typeName], __read(typeArgs), false));
2725
+ this.$typeArgs = typeArgs;
2726
+ this.tokenType = fields.tokenType;
2727
+ this.config = fields.config;
2728
+ this.state = fields.state;
2729
+ }
2730
+ TokenPool.reified = function () {
2731
+ var _this = this;
2732
+ return {
2733
+ typeName: TokenPool.$typeName,
2734
+ fullTypeName: util_1.composeSuiType.apply(void 0, __spreadArray([TokenPool.$typeName], [], false)),
2735
+ typeArgs: [],
2736
+ reifiedTypeArgs: [],
2737
+ fromFields: function (fields) { return TokenPool.fromFields(fields); },
2738
+ fromFieldsWithTypes: function (item) { return TokenPool.fromFieldsWithTypes(item); },
2739
+ fromBcs: function (data) { return TokenPool.fromBcs(data); },
2740
+ bcs: TokenPool.bcs,
2741
+ fromJSONField: function (field) { return TokenPool.fromJSONField(field); },
2742
+ fromJSON: function (json) { return TokenPool.fromJSON(json); },
2743
+ fromSuiParsedData: function (content) { return TokenPool.fromSuiParsedData(content); },
2744
+ fetch: function (client, id) { return __awaiter(_this, void 0, void 0, function () { return __generator(this, function (_a) {
2745
+ return [2 /*return*/, TokenPool.fetch(client, id)];
2746
+ }); }); },
2747
+ new: function (fields) {
2748
+ return new TokenPool([], fields);
2749
+ },
2750
+ kind: "StructClassReified",
2751
+ };
2752
+ };
2753
+ Object.defineProperty(TokenPool, "r", {
2754
+ get: function () {
2755
+ return TokenPool.reified();
2756
+ },
2757
+ enumerable: false,
2758
+ configurable: true
2759
+ });
2760
+ TokenPool.phantom = function () {
2761
+ return (0, reified_1.phantom)(TokenPool.reified());
2762
+ };
2763
+ Object.defineProperty(TokenPool, "p", {
2764
+ get: function () {
2765
+ return TokenPool.phantom();
2766
+ },
2767
+ enumerable: false,
2768
+ configurable: true
2769
+ });
2770
+ Object.defineProperty(TokenPool, "bcs", {
2771
+ get: function () {
2772
+ return bcs_1.bcs.struct("TokenPool", {
2773
+ token_type: structs_1.TypeName.bcs,
2774
+ config: Config.bcs,
2775
+ state: State.bcs,
2776
+ });
2777
+ },
2778
+ enumerable: false,
2779
+ configurable: true
2780
+ });
2781
+ TokenPool.fromFields = function (fields) {
2782
+ return TokenPool.reified().new({
2783
+ tokenType: (0, reified_1.decodeFromFields)(structs_1.TypeName.reified(), fields.token_type),
2784
+ config: (0, reified_1.decodeFromFields)(Config.reified(), fields.config),
2785
+ state: (0, reified_1.decodeFromFields)(State.reified(), fields.state),
2786
+ });
2787
+ };
2788
+ TokenPool.fromFieldsWithTypes = function (item) {
2789
+ if (!isTokenPool(item.type)) {
2790
+ throw new Error("not a TokenPool type");
2791
+ }
2792
+ return TokenPool.reified().new({
2793
+ tokenType: (0, reified_1.decodeFromFieldsWithTypes)(structs_1.TypeName.reified(), item.fields.token_type),
2794
+ config: (0, reified_1.decodeFromFieldsWithTypes)(Config.reified(), item.fields.config),
2795
+ state: (0, reified_1.decodeFromFieldsWithTypes)(State.reified(), item.fields.state),
2796
+ });
2797
+ };
2798
+ TokenPool.fromBcs = function (data) {
2799
+ return TokenPool.fromFields(TokenPool.bcs.parse(data));
2800
+ };
2801
+ TokenPool.prototype.toJSONField = function () {
2802
+ return {
2803
+ tokenType: this.tokenType.toJSONField(),
2804
+ config: this.config.toJSONField(),
2805
+ state: this.state.toJSONField(),
2806
+ };
2807
+ };
2808
+ TokenPool.prototype.toJSON = function () {
2809
+ return __assign({ $typeName: this.$typeName, $typeArgs: this.$typeArgs }, this.toJSONField());
2810
+ };
2811
+ TokenPool.fromJSONField = function (field) {
2812
+ return TokenPool.reified().new({
2813
+ tokenType: (0, reified_1.decodeFromJSONField)(structs_1.TypeName.reified(), field.tokenType),
2814
+ config: (0, reified_1.decodeFromJSONField)(Config.reified(), field.config),
2815
+ state: (0, reified_1.decodeFromJSONField)(State.reified(), field.state),
2816
+ });
2817
+ };
2818
+ TokenPool.fromJSON = function (json) {
2819
+ if (json.$typeName !== TokenPool.$typeName) {
2820
+ throw new Error("not a WithTwoGenerics json object");
2821
+ }
2822
+ return TokenPool.fromJSONField(json);
2823
+ };
2824
+ TokenPool.fromSuiParsedData = function (content) {
2825
+ if (content.dataType !== "moveObject") {
2826
+ throw new Error("not an object");
2827
+ }
2828
+ if (!isTokenPool(content.type)) {
2829
+ throw new Error("object at ".concat(content.fields.id, " is not a TokenPool object"));
2830
+ }
2831
+ return TokenPool.fromFieldsWithTypes(content);
2832
+ };
2833
+ TokenPool.fetch = function (client, id) {
2834
+ return __awaiter(this, void 0, void 0, function () {
2835
+ var res;
2836
+ var _a, _b;
2837
+ return __generator(this, function (_c) {
2838
+ switch (_c.label) {
2839
+ case 0: return [4 /*yield*/, client.getObject({ id: id, options: { showBcs: true } })];
2840
+ case 1:
2841
+ res = _c.sent();
2842
+ if (res.error) {
2843
+ throw new Error("error fetching TokenPool object at id ".concat(id, ": ").concat(res.error.code));
2844
+ }
2845
+ 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)) {
2846
+ throw new Error("object at id ".concat(id, " is not a TokenPool object"));
2847
+ }
2848
+ return [2 /*return*/, TokenPool.fromBcs((0, bcs_1.fromB64)(res.data.bcs.bcsBytes))];
2849
+ }
2850
+ });
2851
+ });
2852
+ };
2853
+ TokenPool.$typeName = "0x4bcf9eade4480bcb9fcd3139ec8d22afda34b25af06092904fcccb06e1b8043c::lp_pool::TokenPool";
2854
+ TokenPool.$numTypeParams = 0;
2855
+ return TokenPool;
2856
+ }());
2857
+ exports.TokenPool = TokenPool;
2858
+ /* ============================== UpdateBorrowInfoEvent =============================== */
2859
+ function isUpdateBorrowInfoEvent(type) {
2860
+ type = (0, util_1.compressSuiType)(type);
2861
+ return type === "0x4bcf9eade4480bcb9fcd3139ec8d22afda34b25af06092904fcccb06e1b8043c::lp_pool::UpdateBorrowInfoEvent";
2862
+ }
2863
+ var UpdateBorrowInfoEvent = /** @class */ (function () {
2864
+ function UpdateBorrowInfoEvent(typeArgs, fields) {
2865
+ this.$typeName = UpdateBorrowInfoEvent.$typeName;
2866
+ this.$fullTypeName = util_1.composeSuiType.apply(void 0, __spreadArray([UpdateBorrowInfoEvent.$typeName], __read(typeArgs), false));
2867
+ this.$typeArgs = typeArgs;
2868
+ this.index = fields.index;
2869
+ this.liquidityTokenType = fields.liquidityTokenType;
2870
+ this.previousBorrowTsMs = fields.previousBorrowTsMs;
2871
+ this.previousCumulativeBorrowRate = fields.previousCumulativeBorrowRate;
2872
+ this.borrowIntervalTsMs = fields.borrowIntervalTsMs;
2873
+ this.lastBorrowRateTsMs = fields.lastBorrowRateTsMs;
2874
+ this.lastCumulativeBorrowRate = fields.lastCumulativeBorrowRate;
2875
+ this.u64Padding = fields.u64Padding;
2876
+ }
2877
+ UpdateBorrowInfoEvent.reified = function () {
2878
+ var _this = this;
2879
+ return {
2880
+ typeName: UpdateBorrowInfoEvent.$typeName,
2881
+ fullTypeName: util_1.composeSuiType.apply(void 0, __spreadArray([UpdateBorrowInfoEvent.$typeName], [], false)),
2882
+ typeArgs: [],
2883
+ reifiedTypeArgs: [],
2884
+ fromFields: function (fields) { return UpdateBorrowInfoEvent.fromFields(fields); },
2885
+ fromFieldsWithTypes: function (item) { return UpdateBorrowInfoEvent.fromFieldsWithTypes(item); },
2886
+ fromBcs: function (data) { return UpdateBorrowInfoEvent.fromBcs(data); },
2887
+ bcs: UpdateBorrowInfoEvent.bcs,
2888
+ fromJSONField: function (field) { return UpdateBorrowInfoEvent.fromJSONField(field); },
2889
+ fromJSON: function (json) { return UpdateBorrowInfoEvent.fromJSON(json); },
2890
+ fromSuiParsedData: function (content) { return UpdateBorrowInfoEvent.fromSuiParsedData(content); },
2891
+ fetch: function (client, id) { return __awaiter(_this, void 0, void 0, function () { return __generator(this, function (_a) {
2892
+ return [2 /*return*/, UpdateBorrowInfoEvent.fetch(client, id)];
2893
+ }); }); },
2894
+ new: function (fields) {
2895
+ return new UpdateBorrowInfoEvent([], fields);
2896
+ },
2897
+ kind: "StructClassReified",
2898
+ };
2899
+ };
2900
+ Object.defineProperty(UpdateBorrowInfoEvent, "r", {
2901
+ get: function () {
2902
+ return UpdateBorrowInfoEvent.reified();
2903
+ },
2904
+ enumerable: false,
2905
+ configurable: true
2906
+ });
2907
+ UpdateBorrowInfoEvent.phantom = function () {
2908
+ return (0, reified_1.phantom)(UpdateBorrowInfoEvent.reified());
2909
+ };
2910
+ Object.defineProperty(UpdateBorrowInfoEvent, "p", {
2911
+ get: function () {
2912
+ return UpdateBorrowInfoEvent.phantom();
2913
+ },
2914
+ enumerable: false,
2915
+ configurable: true
2916
+ });
2917
+ Object.defineProperty(UpdateBorrowInfoEvent, "bcs", {
2918
+ get: function () {
2919
+ return bcs_1.bcs.struct("UpdateBorrowInfoEvent", {
2920
+ index: bcs_1.bcs.u64(),
2921
+ liquidity_token_type: structs_1.TypeName.bcs,
2922
+ previous_borrow_ts_ms: bcs_1.bcs.u64(),
2923
+ previous_cumulative_borrow_rate: bcs_1.bcs.u64(),
2924
+ borrow_interval_ts_ms: bcs_1.bcs.u64(),
2925
+ last_borrow_rate_ts_ms: bcs_1.bcs.u64(),
2926
+ last_cumulative_borrow_rate: bcs_1.bcs.u64(),
2927
+ u64_padding: bcs_1.bcs.vector(bcs_1.bcs.u64()),
2928
+ });
2929
+ },
2930
+ enumerable: false,
2931
+ configurable: true
2932
+ });
2933
+ UpdateBorrowInfoEvent.fromFields = function (fields) {
2934
+ return UpdateBorrowInfoEvent.reified().new({
2935
+ index: (0, reified_1.decodeFromFields)("u64", fields.index),
2936
+ liquidityTokenType: (0, reified_1.decodeFromFields)(structs_1.TypeName.reified(), fields.liquidity_token_type),
2937
+ previousBorrowTsMs: (0, reified_1.decodeFromFields)("u64", fields.previous_borrow_ts_ms),
2938
+ previousCumulativeBorrowRate: (0, reified_1.decodeFromFields)("u64", fields.previous_cumulative_borrow_rate),
2939
+ borrowIntervalTsMs: (0, reified_1.decodeFromFields)("u64", fields.borrow_interval_ts_ms),
2940
+ lastBorrowRateTsMs: (0, reified_1.decodeFromFields)("u64", fields.last_borrow_rate_ts_ms),
2941
+ lastCumulativeBorrowRate: (0, reified_1.decodeFromFields)("u64", fields.last_cumulative_borrow_rate),
2942
+ u64Padding: (0, reified_1.decodeFromFields)(reified.vector("u64"), fields.u64_padding),
2943
+ });
2944
+ };
2945
+ UpdateBorrowInfoEvent.fromFieldsWithTypes = function (item) {
2946
+ if (!isUpdateBorrowInfoEvent(item.type)) {
2947
+ throw new Error("not a UpdateBorrowInfoEvent type");
2948
+ }
2949
+ return UpdateBorrowInfoEvent.reified().new({
2950
+ index: (0, reified_1.decodeFromFieldsWithTypes)("u64", item.fields.index),
2951
+ liquidityTokenType: (0, reified_1.decodeFromFieldsWithTypes)(structs_1.TypeName.reified(), item.fields.liquidity_token_type),
2952
+ previousBorrowTsMs: (0, reified_1.decodeFromFieldsWithTypes)("u64", item.fields.previous_borrow_ts_ms),
2953
+ previousCumulativeBorrowRate: (0, reified_1.decodeFromFieldsWithTypes)("u64", item.fields.previous_cumulative_borrow_rate),
2954
+ borrowIntervalTsMs: (0, reified_1.decodeFromFieldsWithTypes)("u64", item.fields.borrow_interval_ts_ms),
2955
+ lastBorrowRateTsMs: (0, reified_1.decodeFromFieldsWithTypes)("u64", item.fields.last_borrow_rate_ts_ms),
2956
+ lastCumulativeBorrowRate: (0, reified_1.decodeFromFieldsWithTypes)("u64", item.fields.last_cumulative_borrow_rate),
2957
+ u64Padding: (0, reified_1.decodeFromFieldsWithTypes)(reified.vector("u64"), item.fields.u64_padding),
2958
+ });
2959
+ };
2960
+ UpdateBorrowInfoEvent.fromBcs = function (data) {
2961
+ return UpdateBorrowInfoEvent.fromFields(UpdateBorrowInfoEvent.bcs.parse(data));
2962
+ };
2963
+ UpdateBorrowInfoEvent.prototype.toJSONField = function () {
2964
+ return {
2965
+ index: this.index.toString(),
2966
+ liquidityTokenType: this.liquidityTokenType.toJSONField(),
2967
+ previousBorrowTsMs: this.previousBorrowTsMs.toString(),
2968
+ previousCumulativeBorrowRate: this.previousCumulativeBorrowRate.toString(),
2969
+ borrowIntervalTsMs: this.borrowIntervalTsMs.toString(),
2970
+ lastBorrowRateTsMs: this.lastBorrowRateTsMs.toString(),
2971
+ lastCumulativeBorrowRate: this.lastCumulativeBorrowRate.toString(),
2972
+ u64Padding: (0, reified_1.fieldToJSON)("vector<u64>", this.u64Padding),
2973
+ };
2974
+ };
2975
+ UpdateBorrowInfoEvent.prototype.toJSON = function () {
2976
+ return __assign({ $typeName: this.$typeName, $typeArgs: this.$typeArgs }, this.toJSONField());
2977
+ };
2978
+ UpdateBorrowInfoEvent.fromJSONField = function (field) {
2979
+ return UpdateBorrowInfoEvent.reified().new({
2980
+ index: (0, reified_1.decodeFromJSONField)("u64", field.index),
2981
+ liquidityTokenType: (0, reified_1.decodeFromJSONField)(structs_1.TypeName.reified(), field.liquidityTokenType),
2982
+ previousBorrowTsMs: (0, reified_1.decodeFromJSONField)("u64", field.previousBorrowTsMs),
2983
+ previousCumulativeBorrowRate: (0, reified_1.decodeFromJSONField)("u64", field.previousCumulativeBorrowRate),
2984
+ borrowIntervalTsMs: (0, reified_1.decodeFromJSONField)("u64", field.borrowIntervalTsMs),
2985
+ lastBorrowRateTsMs: (0, reified_1.decodeFromJSONField)("u64", field.lastBorrowRateTsMs),
2986
+ lastCumulativeBorrowRate: (0, reified_1.decodeFromJSONField)("u64", field.lastCumulativeBorrowRate),
2987
+ u64Padding: (0, reified_1.decodeFromJSONField)(reified.vector("u64"), field.u64Padding),
2988
+ });
2989
+ };
2990
+ UpdateBorrowInfoEvent.fromJSON = function (json) {
2991
+ if (json.$typeName !== UpdateBorrowInfoEvent.$typeName) {
2992
+ throw new Error("not a WithTwoGenerics json object");
2993
+ }
2994
+ return UpdateBorrowInfoEvent.fromJSONField(json);
2995
+ };
2996
+ UpdateBorrowInfoEvent.fromSuiParsedData = function (content) {
2997
+ if (content.dataType !== "moveObject") {
2998
+ throw new Error("not an object");
2999
+ }
3000
+ if (!isUpdateBorrowInfoEvent(content.type)) {
3001
+ throw new Error("object at ".concat(content.fields.id, " is not a UpdateBorrowInfoEvent object"));
3002
+ }
3003
+ return UpdateBorrowInfoEvent.fromFieldsWithTypes(content);
3004
+ };
3005
+ UpdateBorrowInfoEvent.fetch = function (client, id) {
3006
+ return __awaiter(this, void 0, void 0, function () {
3007
+ var res;
3008
+ var _a, _b;
3009
+ return __generator(this, function (_c) {
3010
+ switch (_c.label) {
3011
+ case 0: return [4 /*yield*/, client.getObject({ id: id, options: { showBcs: true } })];
3012
+ case 1:
3013
+ res = _c.sent();
3014
+ if (res.error) {
3015
+ throw new Error("error fetching UpdateBorrowInfoEvent object at id ".concat(id, ": ").concat(res.error.code));
3016
+ }
3017
+ 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)) {
3018
+ throw new Error("object at id ".concat(id, " is not a UpdateBorrowInfoEvent object"));
3019
+ }
3020
+ return [2 /*return*/, UpdateBorrowInfoEvent.fromBcs((0, bcs_1.fromB64)(res.data.bcs.bcsBytes))];
3021
+ }
3022
+ });
3023
+ });
3024
+ };
3025
+ UpdateBorrowInfoEvent.$typeName = "0x4bcf9eade4480bcb9fcd3139ec8d22afda34b25af06092904fcccb06e1b8043c::lp_pool::UpdateBorrowInfoEvent";
3026
+ UpdateBorrowInfoEvent.$numTypeParams = 0;
3027
+ return UpdateBorrowInfoEvent;
3028
+ }());
3029
+ exports.UpdateBorrowInfoEvent = UpdateBorrowInfoEvent;
3030
+ /* ============================== UpdateLiquidityValueEvent =============================== */
3031
+ function isUpdateLiquidityValueEvent(type) {
3032
+ type = (0, util_1.compressSuiType)(type);
3033
+ return type === "0x4bcf9eade4480bcb9fcd3139ec8d22afda34b25af06092904fcccb06e1b8043c::lp_pool::UpdateLiquidityValueEvent";
3034
+ }
3035
+ var UpdateLiquidityValueEvent = /** @class */ (function () {
3036
+ function UpdateLiquidityValueEvent(typeArgs, fields) {
3037
+ this.$typeName = UpdateLiquidityValueEvent.$typeName;
3038
+ this.$fullTypeName = util_1.composeSuiType.apply(void 0, __spreadArray([UpdateLiquidityValueEvent.$typeName], __read(typeArgs), false));
3039
+ this.$typeArgs = typeArgs;
3040
+ this.sender = fields.sender;
3041
+ this.index = fields.index;
3042
+ this.liquidityToken = fields.liquidityToken;
3043
+ this.price = fields.price;
3044
+ this.valueInUsd = fields.valueInUsd;
3045
+ this.lpPoolTvlUsd = fields.lpPoolTvlUsd;
3046
+ this.u64Padding = fields.u64Padding;
3047
+ }
3048
+ UpdateLiquidityValueEvent.reified = function () {
3049
+ var _this = this;
3050
+ return {
3051
+ typeName: UpdateLiquidityValueEvent.$typeName,
3052
+ fullTypeName: util_1.composeSuiType.apply(void 0, __spreadArray([UpdateLiquidityValueEvent.$typeName], [], false)),
3053
+ typeArgs: [],
3054
+ reifiedTypeArgs: [],
3055
+ fromFields: function (fields) { return UpdateLiquidityValueEvent.fromFields(fields); },
3056
+ fromFieldsWithTypes: function (item) { return UpdateLiquidityValueEvent.fromFieldsWithTypes(item); },
3057
+ fromBcs: function (data) { return UpdateLiquidityValueEvent.fromBcs(data); },
3058
+ bcs: UpdateLiquidityValueEvent.bcs,
3059
+ fromJSONField: function (field) { return UpdateLiquidityValueEvent.fromJSONField(field); },
3060
+ fromJSON: function (json) { return UpdateLiquidityValueEvent.fromJSON(json); },
3061
+ fromSuiParsedData: function (content) { return UpdateLiquidityValueEvent.fromSuiParsedData(content); },
3062
+ fetch: function (client, id) { return __awaiter(_this, void 0, void 0, function () { return __generator(this, function (_a) {
3063
+ return [2 /*return*/, UpdateLiquidityValueEvent.fetch(client, id)];
3064
+ }); }); },
3065
+ new: function (fields) {
3066
+ return new UpdateLiquidityValueEvent([], fields);
3067
+ },
3068
+ kind: "StructClassReified",
3069
+ };
3070
+ };
3071
+ Object.defineProperty(UpdateLiquidityValueEvent, "r", {
3072
+ get: function () {
3073
+ return UpdateLiquidityValueEvent.reified();
3074
+ },
3075
+ enumerable: false,
3076
+ configurable: true
3077
+ });
3078
+ UpdateLiquidityValueEvent.phantom = function () {
3079
+ return (0, reified_1.phantom)(UpdateLiquidityValueEvent.reified());
3080
+ };
3081
+ Object.defineProperty(UpdateLiquidityValueEvent, "p", {
3082
+ get: function () {
3083
+ return UpdateLiquidityValueEvent.phantom();
3084
+ },
3085
+ enumerable: false,
3086
+ configurable: true
3087
+ });
3088
+ Object.defineProperty(UpdateLiquidityValueEvent, "bcs", {
3089
+ get: function () {
3090
+ return bcs_1.bcs.struct("UpdateLiquidityValueEvent", {
3091
+ sender: bcs_1.bcs.bytes(32).transform({ input: function (val) { return (0, bcs_1.fromHEX)(val); }, output: function (val) { return (0, bcs_1.toHEX)(val); } }),
3092
+ index: bcs_1.bcs.u64(),
3093
+ liquidity_token: structs_1.TypeName.bcs,
3094
+ price: bcs_1.bcs.u64(),
3095
+ value_in_usd: bcs_1.bcs.u64(),
3096
+ lp_pool_tvl_usd: bcs_1.bcs.u64(),
3097
+ u64_padding: bcs_1.bcs.vector(bcs_1.bcs.u64()),
3098
+ });
3099
+ },
3100
+ enumerable: false,
3101
+ configurable: true
3102
+ });
3103
+ UpdateLiquidityValueEvent.fromFields = function (fields) {
3104
+ return UpdateLiquidityValueEvent.reified().new({
3105
+ sender: (0, reified_1.decodeFromFields)("address", fields.sender),
3106
+ index: (0, reified_1.decodeFromFields)("u64", fields.index),
3107
+ liquidityToken: (0, reified_1.decodeFromFields)(structs_1.TypeName.reified(), fields.liquidity_token),
3108
+ price: (0, reified_1.decodeFromFields)("u64", fields.price),
3109
+ valueInUsd: (0, reified_1.decodeFromFields)("u64", fields.value_in_usd),
3110
+ lpPoolTvlUsd: (0, reified_1.decodeFromFields)("u64", fields.lp_pool_tvl_usd),
3111
+ u64Padding: (0, reified_1.decodeFromFields)(reified.vector("u64"), fields.u64_padding),
3112
+ });
3113
+ };
3114
+ UpdateLiquidityValueEvent.fromFieldsWithTypes = function (item) {
3115
+ if (!isUpdateLiquidityValueEvent(item.type)) {
3116
+ throw new Error("not a UpdateLiquidityValueEvent type");
3117
+ }
3118
+ return UpdateLiquidityValueEvent.reified().new({
3119
+ sender: (0, reified_1.decodeFromFieldsWithTypes)("address", item.fields.sender),
3120
+ index: (0, reified_1.decodeFromFieldsWithTypes)("u64", item.fields.index),
3121
+ liquidityToken: (0, reified_1.decodeFromFieldsWithTypes)(structs_1.TypeName.reified(), item.fields.liquidity_token),
3122
+ price: (0, reified_1.decodeFromFieldsWithTypes)("u64", item.fields.price),
3123
+ valueInUsd: (0, reified_1.decodeFromFieldsWithTypes)("u64", item.fields.value_in_usd),
3124
+ lpPoolTvlUsd: (0, reified_1.decodeFromFieldsWithTypes)("u64", item.fields.lp_pool_tvl_usd),
3125
+ u64Padding: (0, reified_1.decodeFromFieldsWithTypes)(reified.vector("u64"), item.fields.u64_padding),
3126
+ });
3127
+ };
3128
+ UpdateLiquidityValueEvent.fromBcs = function (data) {
3129
+ return UpdateLiquidityValueEvent.fromFields(UpdateLiquidityValueEvent.bcs.parse(data));
3130
+ };
3131
+ UpdateLiquidityValueEvent.prototype.toJSONField = function () {
3132
+ return {
3133
+ sender: this.sender,
3134
+ index: this.index.toString(),
3135
+ liquidityToken: this.liquidityToken.toJSONField(),
3136
+ price: this.price.toString(),
3137
+ valueInUsd: this.valueInUsd.toString(),
3138
+ lpPoolTvlUsd: this.lpPoolTvlUsd.toString(),
3139
+ u64Padding: (0, reified_1.fieldToJSON)("vector<u64>", this.u64Padding),
3140
+ };
3141
+ };
3142
+ UpdateLiquidityValueEvent.prototype.toJSON = function () {
3143
+ return __assign({ $typeName: this.$typeName, $typeArgs: this.$typeArgs }, this.toJSONField());
3144
+ };
3145
+ UpdateLiquidityValueEvent.fromJSONField = function (field) {
3146
+ return UpdateLiquidityValueEvent.reified().new({
3147
+ sender: (0, reified_1.decodeFromJSONField)("address", field.sender),
3148
+ index: (0, reified_1.decodeFromJSONField)("u64", field.index),
3149
+ liquidityToken: (0, reified_1.decodeFromJSONField)(structs_1.TypeName.reified(), field.liquidityToken),
3150
+ price: (0, reified_1.decodeFromJSONField)("u64", field.price),
3151
+ valueInUsd: (0, reified_1.decodeFromJSONField)("u64", field.valueInUsd),
3152
+ lpPoolTvlUsd: (0, reified_1.decodeFromJSONField)("u64", field.lpPoolTvlUsd),
3153
+ u64Padding: (0, reified_1.decodeFromJSONField)(reified.vector("u64"), field.u64Padding),
3154
+ });
3155
+ };
3156
+ UpdateLiquidityValueEvent.fromJSON = function (json) {
3157
+ if (json.$typeName !== UpdateLiquidityValueEvent.$typeName) {
3158
+ throw new Error("not a WithTwoGenerics json object");
3159
+ }
3160
+ return UpdateLiquidityValueEvent.fromJSONField(json);
3161
+ };
3162
+ UpdateLiquidityValueEvent.fromSuiParsedData = function (content) {
3163
+ if (content.dataType !== "moveObject") {
3164
+ throw new Error("not an object");
3165
+ }
3166
+ if (!isUpdateLiquidityValueEvent(content.type)) {
3167
+ throw new Error("object at ".concat(content.fields.id, " is not a UpdateLiquidityValueEvent object"));
3168
+ }
3169
+ return UpdateLiquidityValueEvent.fromFieldsWithTypes(content);
3170
+ };
3171
+ UpdateLiquidityValueEvent.fetch = function (client, id) {
3172
+ return __awaiter(this, void 0, void 0, function () {
3173
+ var res;
3174
+ var _a, _b;
3175
+ return __generator(this, function (_c) {
3176
+ switch (_c.label) {
3177
+ case 0: return [4 /*yield*/, client.getObject({ id: id, options: { showBcs: true } })];
3178
+ case 1:
3179
+ res = _c.sent();
3180
+ if (res.error) {
3181
+ throw new Error("error fetching UpdateLiquidityValueEvent object at id ".concat(id, ": ").concat(res.error.code));
3182
+ }
3183
+ 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)) {
3184
+ throw new Error("object at id ".concat(id, " is not a UpdateLiquidityValueEvent object"));
3185
+ }
3186
+ return [2 /*return*/, UpdateLiquidityValueEvent.fromBcs((0, bcs_1.fromB64)(res.data.bcs.bcsBytes))];
3187
+ }
3188
+ });
3189
+ });
3190
+ };
3191
+ UpdateLiquidityValueEvent.$typeName = "0x4bcf9eade4480bcb9fcd3139ec8d22afda34b25af06092904fcccb06e1b8043c::lp_pool::UpdateLiquidityValueEvent";
3192
+ UpdateLiquidityValueEvent.$numTypeParams = 0;
3193
+ return UpdateLiquidityValueEvent;
3194
+ }());
3195
+ exports.UpdateLiquidityValueEvent = UpdateLiquidityValueEvent;
3196
+ /* ============================== UpdateMarginConfigEvent =============================== */
3197
+ function isUpdateMarginConfigEvent(type) {
3198
+ type = (0, util_1.compressSuiType)(type);
3199
+ return type === "0x4bcf9eade4480bcb9fcd3139ec8d22afda34b25af06092904fcccb06e1b8043c::lp_pool::UpdateMarginConfigEvent";
3200
+ }
3201
+ var UpdateMarginConfigEvent = /** @class */ (function () {
3202
+ function UpdateMarginConfigEvent(typeArgs, fields) {
3203
+ this.$typeName = UpdateMarginConfigEvent.$typeName;
3204
+ this.$fullTypeName = util_1.composeSuiType.apply(void 0, __spreadArray([UpdateMarginConfigEvent.$typeName], __read(typeArgs), false));
3205
+ this.$typeArgs = typeArgs;
3206
+ this.sender = fields.sender;
3207
+ this.index = fields.index;
3208
+ this.liquidityTokenType = fields.liquidityTokenType;
3209
+ this.previousMarginConfig = fields.previousMarginConfig;
3210
+ this.newMarginConfig = fields.newMarginConfig;
3211
+ this.u64Padding = fields.u64Padding;
3212
+ }
3213
+ UpdateMarginConfigEvent.reified = function () {
3214
+ var _this = this;
3215
+ return {
3216
+ typeName: UpdateMarginConfigEvent.$typeName,
3217
+ fullTypeName: util_1.composeSuiType.apply(void 0, __spreadArray([UpdateMarginConfigEvent.$typeName], [], false)),
3218
+ typeArgs: [],
3219
+ reifiedTypeArgs: [],
3220
+ fromFields: function (fields) { return UpdateMarginConfigEvent.fromFields(fields); },
3221
+ fromFieldsWithTypes: function (item) { return UpdateMarginConfigEvent.fromFieldsWithTypes(item); },
3222
+ fromBcs: function (data) { return UpdateMarginConfigEvent.fromBcs(data); },
3223
+ bcs: UpdateMarginConfigEvent.bcs,
3224
+ fromJSONField: function (field) { return UpdateMarginConfigEvent.fromJSONField(field); },
3225
+ fromJSON: function (json) { return UpdateMarginConfigEvent.fromJSON(json); },
3226
+ fromSuiParsedData: function (content) { return UpdateMarginConfigEvent.fromSuiParsedData(content); },
3227
+ fetch: function (client, id) { return __awaiter(_this, void 0, void 0, function () { return __generator(this, function (_a) {
3228
+ return [2 /*return*/, UpdateMarginConfigEvent.fetch(client, id)];
3229
+ }); }); },
3230
+ new: function (fields) {
3231
+ return new UpdateMarginConfigEvent([], fields);
3232
+ },
3233
+ kind: "StructClassReified",
3234
+ };
3235
+ };
3236
+ Object.defineProperty(UpdateMarginConfigEvent, "r", {
3237
+ get: function () {
3238
+ return UpdateMarginConfigEvent.reified();
3239
+ },
3240
+ enumerable: false,
3241
+ configurable: true
3242
+ });
3243
+ UpdateMarginConfigEvent.phantom = function () {
3244
+ return (0, reified_1.phantom)(UpdateMarginConfigEvent.reified());
3245
+ };
3246
+ Object.defineProperty(UpdateMarginConfigEvent, "p", {
3247
+ get: function () {
3248
+ return UpdateMarginConfigEvent.phantom();
3249
+ },
3250
+ enumerable: false,
3251
+ configurable: true
3252
+ });
3253
+ Object.defineProperty(UpdateMarginConfigEvent, "bcs", {
3254
+ get: function () {
3255
+ return bcs_1.bcs.struct("UpdateMarginConfigEvent", {
3256
+ sender: bcs_1.bcs.bytes(32).transform({ input: function (val) { return (0, bcs_1.fromHEX)(val); }, output: function (val) { return (0, bcs_1.toHEX)(val); } }),
3257
+ index: bcs_1.bcs.u64(),
3258
+ liquidity_token_type: structs_1.TypeName.bcs,
3259
+ previous_margin_config: MarginConfig.bcs,
3260
+ new_margin_config: MarginConfig.bcs,
3261
+ u64_padding: bcs_1.bcs.vector(bcs_1.bcs.u64()),
3262
+ });
3263
+ },
3264
+ enumerable: false,
3265
+ configurable: true
3266
+ });
3267
+ UpdateMarginConfigEvent.fromFields = function (fields) {
3268
+ return UpdateMarginConfigEvent.reified().new({
3269
+ sender: (0, reified_1.decodeFromFields)("address", fields.sender),
3270
+ index: (0, reified_1.decodeFromFields)("u64", fields.index),
3271
+ liquidityTokenType: (0, reified_1.decodeFromFields)(structs_1.TypeName.reified(), fields.liquidity_token_type),
3272
+ previousMarginConfig: (0, reified_1.decodeFromFields)(MarginConfig.reified(), fields.previous_margin_config),
3273
+ newMarginConfig: (0, reified_1.decodeFromFields)(MarginConfig.reified(), fields.new_margin_config),
3274
+ u64Padding: (0, reified_1.decodeFromFields)(reified.vector("u64"), fields.u64_padding),
3275
+ });
3276
+ };
3277
+ UpdateMarginConfigEvent.fromFieldsWithTypes = function (item) {
3278
+ if (!isUpdateMarginConfigEvent(item.type)) {
3279
+ throw new Error("not a UpdateMarginConfigEvent type");
3280
+ }
3281
+ return UpdateMarginConfigEvent.reified().new({
3282
+ sender: (0, reified_1.decodeFromFieldsWithTypes)("address", item.fields.sender),
3283
+ index: (0, reified_1.decodeFromFieldsWithTypes)("u64", item.fields.index),
3284
+ liquidityTokenType: (0, reified_1.decodeFromFieldsWithTypes)(structs_1.TypeName.reified(), item.fields.liquidity_token_type),
3285
+ previousMarginConfig: (0, reified_1.decodeFromFieldsWithTypes)(MarginConfig.reified(), item.fields.previous_margin_config),
3286
+ newMarginConfig: (0, reified_1.decodeFromFieldsWithTypes)(MarginConfig.reified(), item.fields.new_margin_config),
3287
+ u64Padding: (0, reified_1.decodeFromFieldsWithTypes)(reified.vector("u64"), item.fields.u64_padding),
3288
+ });
3289
+ };
3290
+ UpdateMarginConfigEvent.fromBcs = function (data) {
3291
+ return UpdateMarginConfigEvent.fromFields(UpdateMarginConfigEvent.bcs.parse(data));
3292
+ };
3293
+ UpdateMarginConfigEvent.prototype.toJSONField = function () {
3294
+ return {
3295
+ sender: this.sender,
3296
+ index: this.index.toString(),
3297
+ liquidityTokenType: this.liquidityTokenType.toJSONField(),
3298
+ previousMarginConfig: this.previousMarginConfig.toJSONField(),
3299
+ newMarginConfig: this.newMarginConfig.toJSONField(),
3300
+ u64Padding: (0, reified_1.fieldToJSON)("vector<u64>", this.u64Padding),
3301
+ };
3302
+ };
3303
+ UpdateMarginConfigEvent.prototype.toJSON = function () {
3304
+ return __assign({ $typeName: this.$typeName, $typeArgs: this.$typeArgs }, this.toJSONField());
3305
+ };
3306
+ UpdateMarginConfigEvent.fromJSONField = function (field) {
3307
+ return UpdateMarginConfigEvent.reified().new({
3308
+ sender: (0, reified_1.decodeFromJSONField)("address", field.sender),
3309
+ index: (0, reified_1.decodeFromJSONField)("u64", field.index),
3310
+ liquidityTokenType: (0, reified_1.decodeFromJSONField)(structs_1.TypeName.reified(), field.liquidityTokenType),
3311
+ previousMarginConfig: (0, reified_1.decodeFromJSONField)(MarginConfig.reified(), field.previousMarginConfig),
3312
+ newMarginConfig: (0, reified_1.decodeFromJSONField)(MarginConfig.reified(), field.newMarginConfig),
3313
+ u64Padding: (0, reified_1.decodeFromJSONField)(reified.vector("u64"), field.u64Padding),
3314
+ });
3315
+ };
3316
+ UpdateMarginConfigEvent.fromJSON = function (json) {
3317
+ if (json.$typeName !== UpdateMarginConfigEvent.$typeName) {
3318
+ throw new Error("not a WithTwoGenerics json object");
3319
+ }
3320
+ return UpdateMarginConfigEvent.fromJSONField(json);
3321
+ };
3322
+ UpdateMarginConfigEvent.fromSuiParsedData = function (content) {
3323
+ if (content.dataType !== "moveObject") {
3324
+ throw new Error("not an object");
3325
+ }
3326
+ if (!isUpdateMarginConfigEvent(content.type)) {
3327
+ throw new Error("object at ".concat(content.fields.id, " is not a UpdateMarginConfigEvent object"));
3328
+ }
3329
+ return UpdateMarginConfigEvent.fromFieldsWithTypes(content);
3330
+ };
3331
+ UpdateMarginConfigEvent.fetch = function (client, id) {
3332
+ return __awaiter(this, void 0, void 0, function () {
3333
+ var res;
3334
+ var _a, _b;
3335
+ return __generator(this, function (_c) {
3336
+ switch (_c.label) {
3337
+ case 0: return [4 /*yield*/, client.getObject({ id: id, options: { showBcs: true } })];
3338
+ case 1:
3339
+ res = _c.sent();
3340
+ if (res.error) {
3341
+ throw new Error("error fetching UpdateMarginConfigEvent object at id ".concat(id, ": ").concat(res.error.code));
3342
+ }
3343
+ 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)) {
3344
+ throw new Error("object at id ".concat(id, " is not a UpdateMarginConfigEvent object"));
3345
+ }
3346
+ return [2 /*return*/, UpdateMarginConfigEvent.fromBcs((0, bcs_1.fromB64)(res.data.bcs.bcsBytes))];
3347
+ }
3348
+ });
3349
+ });
3350
+ };
3351
+ UpdateMarginConfigEvent.$typeName = "0x4bcf9eade4480bcb9fcd3139ec8d22afda34b25af06092904fcccb06e1b8043c::lp_pool::UpdateMarginConfigEvent";
3352
+ UpdateMarginConfigEvent.$numTypeParams = 0;
3353
+ return UpdateMarginConfigEvent;
3354
+ }());
3355
+ exports.UpdateMarginConfigEvent = UpdateMarginConfigEvent;
3356
+ /* ============================== UpdateSpotConfigEvent =============================== */
3357
+ function isUpdateSpotConfigEvent(type) {
3358
+ type = (0, util_1.compressSuiType)(type);
3359
+ return type === "0x4bcf9eade4480bcb9fcd3139ec8d22afda34b25af06092904fcccb06e1b8043c::lp_pool::UpdateSpotConfigEvent";
3360
+ }
3361
+ var UpdateSpotConfigEvent = /** @class */ (function () {
3362
+ function UpdateSpotConfigEvent(typeArgs, fields) {
3363
+ this.$typeName = UpdateSpotConfigEvent.$typeName;
3364
+ this.$fullTypeName = util_1.composeSuiType.apply(void 0, __spreadArray([UpdateSpotConfigEvent.$typeName], __read(typeArgs), false));
3365
+ this.$typeArgs = typeArgs;
3366
+ this.sender = fields.sender;
3367
+ this.index = fields.index;
3368
+ this.liquidityTokenType = fields.liquidityTokenType;
3369
+ this.previousSpotConfig = fields.previousSpotConfig;
3370
+ this.newSpotConfig = fields.newSpotConfig;
3371
+ this.u64Padding = fields.u64Padding;
3372
+ }
3373
+ UpdateSpotConfigEvent.reified = function () {
3374
+ var _this = this;
3375
+ return {
3376
+ typeName: UpdateSpotConfigEvent.$typeName,
3377
+ fullTypeName: util_1.composeSuiType.apply(void 0, __spreadArray([UpdateSpotConfigEvent.$typeName], [], false)),
3378
+ typeArgs: [],
3379
+ reifiedTypeArgs: [],
3380
+ fromFields: function (fields) { return UpdateSpotConfigEvent.fromFields(fields); },
3381
+ fromFieldsWithTypes: function (item) { return UpdateSpotConfigEvent.fromFieldsWithTypes(item); },
3382
+ fromBcs: function (data) { return UpdateSpotConfigEvent.fromBcs(data); },
3383
+ bcs: UpdateSpotConfigEvent.bcs,
3384
+ fromJSONField: function (field) { return UpdateSpotConfigEvent.fromJSONField(field); },
3385
+ fromJSON: function (json) { return UpdateSpotConfigEvent.fromJSON(json); },
3386
+ fromSuiParsedData: function (content) { return UpdateSpotConfigEvent.fromSuiParsedData(content); },
3387
+ fetch: function (client, id) { return __awaiter(_this, void 0, void 0, function () { return __generator(this, function (_a) {
3388
+ return [2 /*return*/, UpdateSpotConfigEvent.fetch(client, id)];
3389
+ }); }); },
3390
+ new: function (fields) {
3391
+ return new UpdateSpotConfigEvent([], fields);
3392
+ },
3393
+ kind: "StructClassReified",
3394
+ };
3395
+ };
3396
+ Object.defineProperty(UpdateSpotConfigEvent, "r", {
3397
+ get: function () {
3398
+ return UpdateSpotConfigEvent.reified();
3399
+ },
3400
+ enumerable: false,
3401
+ configurable: true
3402
+ });
3403
+ UpdateSpotConfigEvent.phantom = function () {
3404
+ return (0, reified_1.phantom)(UpdateSpotConfigEvent.reified());
3405
+ };
3406
+ Object.defineProperty(UpdateSpotConfigEvent, "p", {
3407
+ get: function () {
3408
+ return UpdateSpotConfigEvent.phantom();
3409
+ },
3410
+ enumerable: false,
3411
+ configurable: true
3412
+ });
3413
+ Object.defineProperty(UpdateSpotConfigEvent, "bcs", {
3414
+ get: function () {
3415
+ return bcs_1.bcs.struct("UpdateSpotConfigEvent", {
3416
+ sender: bcs_1.bcs.bytes(32).transform({ input: function (val) { return (0, bcs_1.fromHEX)(val); }, output: function (val) { return (0, bcs_1.toHEX)(val); } }),
3417
+ index: bcs_1.bcs.u64(),
3418
+ liquidity_token_type: structs_1.TypeName.bcs,
3419
+ previous_spot_config: SpotConfig.bcs,
3420
+ new_spot_config: SpotConfig.bcs,
3421
+ u64_padding: bcs_1.bcs.vector(bcs_1.bcs.u64()),
3422
+ });
3423
+ },
3424
+ enumerable: false,
3425
+ configurable: true
3426
+ });
3427
+ UpdateSpotConfigEvent.fromFields = function (fields) {
3428
+ return UpdateSpotConfigEvent.reified().new({
3429
+ sender: (0, reified_1.decodeFromFields)("address", fields.sender),
3430
+ index: (0, reified_1.decodeFromFields)("u64", fields.index),
3431
+ liquidityTokenType: (0, reified_1.decodeFromFields)(structs_1.TypeName.reified(), fields.liquidity_token_type),
3432
+ previousSpotConfig: (0, reified_1.decodeFromFields)(SpotConfig.reified(), fields.previous_spot_config),
3433
+ newSpotConfig: (0, reified_1.decodeFromFields)(SpotConfig.reified(), fields.new_spot_config),
3434
+ u64Padding: (0, reified_1.decodeFromFields)(reified.vector("u64"), fields.u64_padding),
3435
+ });
3436
+ };
3437
+ UpdateSpotConfigEvent.fromFieldsWithTypes = function (item) {
3438
+ if (!isUpdateSpotConfigEvent(item.type)) {
3439
+ throw new Error("not a UpdateSpotConfigEvent type");
3440
+ }
3441
+ return UpdateSpotConfigEvent.reified().new({
3442
+ sender: (0, reified_1.decodeFromFieldsWithTypes)("address", item.fields.sender),
3443
+ index: (0, reified_1.decodeFromFieldsWithTypes)("u64", item.fields.index),
3444
+ liquidityTokenType: (0, reified_1.decodeFromFieldsWithTypes)(structs_1.TypeName.reified(), item.fields.liquidity_token_type),
3445
+ previousSpotConfig: (0, reified_1.decodeFromFieldsWithTypes)(SpotConfig.reified(), item.fields.previous_spot_config),
3446
+ newSpotConfig: (0, reified_1.decodeFromFieldsWithTypes)(SpotConfig.reified(), item.fields.new_spot_config),
3447
+ u64Padding: (0, reified_1.decodeFromFieldsWithTypes)(reified.vector("u64"), item.fields.u64_padding),
3448
+ });
3449
+ };
3450
+ UpdateSpotConfigEvent.fromBcs = function (data) {
3451
+ return UpdateSpotConfigEvent.fromFields(UpdateSpotConfigEvent.bcs.parse(data));
3452
+ };
3453
+ UpdateSpotConfigEvent.prototype.toJSONField = function () {
3454
+ return {
3455
+ sender: this.sender,
3456
+ index: this.index.toString(),
3457
+ liquidityTokenType: this.liquidityTokenType.toJSONField(),
3458
+ previousSpotConfig: this.previousSpotConfig.toJSONField(),
3459
+ newSpotConfig: this.newSpotConfig.toJSONField(),
3460
+ u64Padding: (0, reified_1.fieldToJSON)("vector<u64>", this.u64Padding),
3461
+ };
3462
+ };
3463
+ UpdateSpotConfigEvent.prototype.toJSON = function () {
3464
+ return __assign({ $typeName: this.$typeName, $typeArgs: this.$typeArgs }, this.toJSONField());
3465
+ };
3466
+ UpdateSpotConfigEvent.fromJSONField = function (field) {
3467
+ return UpdateSpotConfigEvent.reified().new({
3468
+ sender: (0, reified_1.decodeFromJSONField)("address", field.sender),
3469
+ index: (0, reified_1.decodeFromJSONField)("u64", field.index),
3470
+ liquidityTokenType: (0, reified_1.decodeFromJSONField)(structs_1.TypeName.reified(), field.liquidityTokenType),
3471
+ previousSpotConfig: (0, reified_1.decodeFromJSONField)(SpotConfig.reified(), field.previousSpotConfig),
3472
+ newSpotConfig: (0, reified_1.decodeFromJSONField)(SpotConfig.reified(), field.newSpotConfig),
3473
+ u64Padding: (0, reified_1.decodeFromJSONField)(reified.vector("u64"), field.u64Padding),
3474
+ });
3475
+ };
3476
+ UpdateSpotConfigEvent.fromJSON = function (json) {
3477
+ if (json.$typeName !== UpdateSpotConfigEvent.$typeName) {
3478
+ throw new Error("not a WithTwoGenerics json object");
3479
+ }
3480
+ return UpdateSpotConfigEvent.fromJSONField(json);
3481
+ };
3482
+ UpdateSpotConfigEvent.fromSuiParsedData = function (content) {
3483
+ if (content.dataType !== "moveObject") {
3484
+ throw new Error("not an object");
3485
+ }
3486
+ if (!isUpdateSpotConfigEvent(content.type)) {
3487
+ throw new Error("object at ".concat(content.fields.id, " is not a UpdateSpotConfigEvent object"));
3488
+ }
3489
+ return UpdateSpotConfigEvent.fromFieldsWithTypes(content);
3490
+ };
3491
+ UpdateSpotConfigEvent.fetch = function (client, id) {
3492
+ return __awaiter(this, void 0, void 0, function () {
3493
+ var res;
3494
+ var _a, _b;
3495
+ return __generator(this, function (_c) {
3496
+ switch (_c.label) {
3497
+ case 0: return [4 /*yield*/, client.getObject({ id: id, options: { showBcs: true } })];
3498
+ case 1:
3499
+ res = _c.sent();
3500
+ if (res.error) {
3501
+ throw new Error("error fetching UpdateSpotConfigEvent object at id ".concat(id, ": ").concat(res.error.code));
3502
+ }
3503
+ 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)) {
3504
+ throw new Error("object at id ".concat(id, " is not a UpdateSpotConfigEvent object"));
3505
+ }
3506
+ return [2 /*return*/, UpdateSpotConfigEvent.fromBcs((0, bcs_1.fromB64)(res.data.bcs.bcsBytes))];
3507
+ }
3508
+ });
3509
+ });
3510
+ };
3511
+ UpdateSpotConfigEvent.$typeName = "0x4bcf9eade4480bcb9fcd3139ec8d22afda34b25af06092904fcccb06e1b8043c::lp_pool::UpdateSpotConfigEvent";
3512
+ UpdateSpotConfigEvent.$numTypeParams = 0;
3513
+ return UpdateSpotConfigEvent;
3514
+ }());
3515
+ exports.UpdateSpotConfigEvent = UpdateSpotConfigEvent;