@typus/typus-sdk 1.5.3 → 1.5.5-a

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