@typus/typus-sdk 1.4.3-d → 1.4.3-f

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