@typus/typus-perp-sdk 1.1.28-testnet-autobid → 1.1.29-codegen

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 (249) hide show
  1. package/dist/src/api/sentio.js +604 -538
  2. package/dist/src/client.d.ts +27 -0
  3. package/dist/src/client.js +108 -0
  4. package/dist/src/fetch.d.ts +160 -34
  5. package/dist/src/fetch.js +365 -665
  6. package/dist/src/generated/typus_perp/admin.d.ts +117 -0
  7. package/dist/src/generated/typus_perp/admin.js +110 -0
  8. package/dist/src/generated/typus_perp/competition.d.ts +22 -0
  9. package/dist/src/generated/typus_perp/competition.js +58 -0
  10. package/dist/src/generated/typus_perp/deps/std/type_name.d.ts +17 -0
  11. package/dist/src/generated/typus_perp/deps/std/type_name.js +25 -0
  12. package/dist/src/generated/typus_perp/deps/sui/balance.d.ts +12 -0
  13. package/dist/src/generated/typus_perp/deps/sui/balance.js +20 -0
  14. package/dist/src/generated/typus_perp/deps/sui/object.d.ts +8 -0
  15. package/dist/src/generated/typus_perp/deps/sui/object.js +16 -0
  16. package/dist/src/generated/typus_perp/deps/sui/object_table.d.ts +19 -0
  17. package/dist/src/generated/typus_perp/deps/sui/object_table.js +59 -0
  18. package/dist/src/generated/typus_perp/deps/sui/vec_set.d.ts +18 -0
  19. package/dist/src/generated/typus_perp/deps/sui/vec_set.js +25 -0
  20. package/dist/src/generated/typus_perp/deps/typus/keyed_big_vector.d.ts +30 -0
  21. package/dist/src/generated/typus_perp/deps/typus/keyed_big_vector.js +67 -0
  22. package/dist/src/generated/typus_perp/deps/typus/linked_object_table.d.ts +32 -0
  23. package/dist/src/generated/typus_perp/deps/typus/linked_object_table.js +71 -0
  24. package/dist/src/generated/typus_perp/deps/typus_framework/vault.d.ts +23 -0
  25. package/dist/src/generated/typus_perp/deps/typus_framework/vault.js +61 -0
  26. package/dist/src/generated/typus_perp/escrow.d.ts +59 -0
  27. package/dist/src/generated/typus_perp/escrow.js +76 -0
  28. package/dist/src/generated/typus_perp/lending.d.ts +47 -0
  29. package/dist/src/generated/typus_perp/lending.js +50 -0
  30. package/dist/src/generated/typus_perp/lp_pool.d.ts +2327 -0
  31. package/dist/src/generated/typus_perp/lp_pool.js +1956 -0
  32. package/dist/src/generated/typus_perp/math.d.ts +95 -0
  33. package/dist/src/generated/typus_perp/math.js +97 -0
  34. package/dist/src/generated/typus_perp/position.d.ts +234 -0
  35. package/dist/src/generated/typus_perp/position.js +204 -0
  36. package/dist/src/generated/typus_perp/symbol.d.ts +18 -0
  37. package/dist/src/generated/typus_perp/symbol.js +55 -0
  38. package/dist/src/generated/typus_perp/tlp.d.ts +13 -0
  39. package/dist/src/generated/typus_perp/tlp.js +56 -0
  40. package/dist/src/generated/typus_perp/trading.d.ts +2486 -0
  41. package/dist/src/generated/typus_perp/trading.js +2476 -0
  42. package/dist/src/generated/typus_perp/treasury_caps.d.ts +13 -0
  43. package/dist/src/{_framework/init-loader.js → generated/typus_perp/treasury_caps.js} +17 -10
  44. package/dist/src/generated/typus_perp/user_account.d.ts +40 -0
  45. package/dist/src/generated/typus_perp/user_account.js +72 -0
  46. package/dist/src/generated/typus_stake_pool/admin.d.ts +100 -0
  47. package/dist/src/generated/typus_stake_pool/admin.js +91 -0
  48. package/dist/src/generated/typus_stake_pool/deps/std/type_name.d.ts +17 -0
  49. package/dist/src/generated/typus_stake_pool/deps/std/type_name.js +25 -0
  50. package/dist/src/generated/typus_stake_pool/deps/sui/object.d.ts +8 -0
  51. package/dist/src/generated/typus_stake_pool/deps/sui/object.js +16 -0
  52. package/dist/src/generated/typus_stake_pool/deps/sui/vec_map.d.ts +30 -0
  53. package/dist/src/generated/typus_stake_pool/deps/sui/vec_map.js +37 -0
  54. package/dist/src/generated/typus_stake_pool/deps/sui/vec_set.d.ts +18 -0
  55. package/dist/src/generated/typus_stake_pool/deps/sui/vec_set.js +25 -0
  56. package/dist/src/generated/typus_stake_pool/stake_pool.d.ts +1023 -0
  57. package/dist/src/generated/typus_stake_pool/stake_pool.js +918 -0
  58. package/dist/src/generated/utils/index.d.ts +11 -0
  59. package/dist/src/generated/utils/index.js +135 -0
  60. package/dist/src/grpc/graphql.d.ts +26 -0
  61. package/dist/src/grpc/graphql.js +126 -0
  62. package/dist/src/grpc/grpc.d.ts +1 -0
  63. package/dist/src/grpc/grpc.js +38 -0
  64. package/dist/src/grpc/ledgerService.js +64 -0
  65. package/dist/src/grpc/liveDataService.d.ts +0 -0
  66. package/dist/src/grpc/liveDataService.js +49 -0
  67. package/dist/src/index.d.ts +0 -4
  68. package/dist/src/index.js +20 -39
  69. package/dist/src/user/history.js +611 -680
  70. package/dist/src/user/order.d.ts +11 -11
  71. package/dist/src/user/order.js +171 -302
  72. package/dist/src/user/orderWithBidReceipt.d.ts +8 -5
  73. package/dist/src/user/orderWithBidReceipt.js +127 -225
  74. package/dist/src/user/tlp.d.ts +32 -23
  75. package/dist/src/user/tlp.js +316 -468
  76. package/package.json +13 -4
  77. package/dist/src/_dependencies/source/0x1/ascii/structs.d.ts +0 -92
  78. package/dist/src/_dependencies/source/0x1/ascii/structs.js +0 -398
  79. package/dist/src/_dependencies/source/0x1/index.d.ts +0 -3
  80. package/dist/src/_dependencies/source/0x1/index.js +0 -6
  81. package/dist/src/_dependencies/source/0x1/option/structs.d.ts +0 -52
  82. package/dist/src/_dependencies/source/0x1/option/structs.js +0 -271
  83. package/dist/src/_dependencies/source/0x1/string/structs.d.ts +0 -50
  84. package/dist/src/_dependencies/source/0x1/string/structs.js +0 -256
  85. package/dist/src/_dependencies/source/0x1/type-name/structs.d.ts +0 -53
  86. package/dist/src/_dependencies/source/0x1/type-name/structs.js +0 -223
  87. package/dist/src/_dependencies/source/0x2/bag/structs.d.ts +0 -61
  88. package/dist/src/_dependencies/source/0x2/bag/structs.js +0 -229
  89. package/dist/src/_dependencies/source/0x2/balance/structs.d.ts +0 -88
  90. package/dist/src/_dependencies/source/0x2/balance/structs.js +0 -386
  91. package/dist/src/_dependencies/source/0x2/coin/structs.d.ts +0 -460
  92. package/dist/src/_dependencies/source/0x2/coin/structs.js +0 -1247
  93. package/dist/src/_dependencies/source/0x2/index.d.ts +0 -3
  94. package/dist/src/_dependencies/source/0x2/index.js +0 -6
  95. package/dist/src/_dependencies/source/0x2/linked-table/structs.d.ts +0 -153
  96. package/dist/src/_dependencies/source/0x2/linked-table/structs.js +0 -438
  97. package/dist/src/_dependencies/source/0x2/object/structs.d.ts +0 -92
  98. package/dist/src/_dependencies/source/0x2/object/structs.js +0 -364
  99. package/dist/src/_dependencies/source/0x2/object-table/structs.d.ts +0 -61
  100. package/dist/src/_dependencies/source/0x2/object-table/structs.js +0 -248
  101. package/dist/src/_dependencies/source/0x2/sui/structs.d.ts +0 -46
  102. package/dist/src/_dependencies/source/0x2/sui/structs.js +0 -222
  103. package/dist/src/_dependencies/source/0x2/table/structs.d.ts +0 -61
  104. package/dist/src/_dependencies/source/0x2/table/structs.js +0 -248
  105. package/dist/src/_dependencies/source/0x2/table-vec/structs.d.ts +0 -68
  106. package/dist/src/_dependencies/source/0x2/table-vec/structs.js +0 -274
  107. package/dist/src/_dependencies/source/0x2/token/structs.d.ts +0 -449
  108. package/dist/src/_dependencies/source/0x2/token/structs.js +0 -1095
  109. package/dist/src/_dependencies/source/0x2/transfer-policy/structs.d.ts +0 -370
  110. package/dist/src/_dependencies/source/0x2/transfer-policy/structs.js +0 -1091
  111. package/dist/src/_dependencies/source/0x2/url/structs.d.ts +0 -53
  112. package/dist/src/_dependencies/source/0x2/url/structs.js +0 -223
  113. package/dist/src/_dependencies/source/0x2/vec-map/structs.d.ts +0 -111
  114. package/dist/src/_dependencies/source/0x2/vec-map/structs.js +0 -446
  115. package/dist/src/_dependencies/source/0x2/vec-set/structs.d.ts +0 -51
  116. package/dist/src/_dependencies/source/0x2/vec-set/structs.js +0 -270
  117. package/dist/src/_dependencies/source/0x4b0f4ee1a40ce37ec81c987cc4e76a665419e74b863319492fc7d26f708b835a/airdrop/structs.d.ts +0 -489
  118. package/dist/src/_dependencies/source/0x4b0f4ee1a40ce37ec81c987cc4e76a665419e74b863319492fc7d26f708b835a/airdrop/structs.js +0 -1084
  119. package/dist/src/_dependencies/source/0x4b0f4ee1a40ce37ec81c987cc4e76a665419e74b863319492fc7d26f708b835a/big-vector/structs.d.ts +0 -147
  120. package/dist/src/_dependencies/source/0x4b0f4ee1a40ce37ec81c987cc4e76a665419e74b863319492fc7d26f708b835a/big-vector/structs.js +0 -456
  121. package/dist/src/_dependencies/source/0x4b0f4ee1a40ce37ec81c987cc4e76a665419e74b863319492fc7d26f708b835a/critbit/structs.d.ts +0 -239
  122. package/dist/src/_dependencies/source/0x4b0f4ee1a40ce37ec81c987cc4e76a665419e74b863319492fc7d26f708b835a/critbit/structs.js +0 -653
  123. package/dist/src/_dependencies/source/0x4b0f4ee1a40ce37ec81c987cc4e76a665419e74b863319492fc7d26f708b835a/ecosystem/structs.d.ts +0 -405
  124. package/dist/src/_dependencies/source/0x4b0f4ee1a40ce37ec81c987cc4e76a665419e74b863319492fc7d26f708b835a/ecosystem/structs.js +0 -899
  125. package/dist/src/_dependencies/source/0x4b0f4ee1a40ce37ec81c987cc4e76a665419e74b863319492fc7d26f708b835a/index.d.ts +0 -8
  126. package/dist/src/_dependencies/source/0x4b0f4ee1a40ce37ec81c987cc4e76a665419e74b863319492fc7d26f708b835a/index.js +0 -11
  127. package/dist/src/_dependencies/source/0x4b0f4ee1a40ce37ec81c987cc4e76a665419e74b863319492fc7d26f708b835a/init.d.ts +0 -2
  128. package/dist/src/_dependencies/source/0x4b0f4ee1a40ce37ec81c987cc4e76a665419e74b863319492fc7d26f708b835a/init.js +0 -102
  129. package/dist/src/_dependencies/source/0x4b0f4ee1a40ce37ec81c987cc4e76a665419e74b863319492fc7d26f708b835a/keyed-big-vector/structs.d.ts +0 -227
  130. package/dist/src/_dependencies/source/0x4b0f4ee1a40ce37ec81c987cc4e76a665419e74b863319492fc7d26f708b835a/keyed-big-vector/structs.js +0 -632
  131. package/dist/src/_dependencies/source/0x4b0f4ee1a40ce37ec81c987cc4e76a665419e74b863319492fc7d26f708b835a/leaderboard/structs.d.ts +0 -699
  132. package/dist/src/_dependencies/source/0x4b0f4ee1a40ce37ec81c987cc4e76a665419e74b863319492fc7d26f708b835a/leaderboard/structs.js +0 -1459
  133. package/dist/src/_dependencies/source/0x4b0f4ee1a40ce37ec81c987cc4e76a665419e74b863319492fc7d26f708b835a/linked-object-table/structs.d.ts +0 -161
  134. package/dist/src/_dependencies/source/0x4b0f4ee1a40ce37ec81c987cc4e76a665419e74b863319492fc7d26f708b835a/linked-object-table/structs.js +0 -438
  135. package/dist/src/_dependencies/source/0x4b0f4ee1a40ce37ec81c987cc4e76a665419e74b863319492fc7d26f708b835a/linked-set/structs.d.ts +0 -147
  136. package/dist/src/_dependencies/source/0x4b0f4ee1a40ce37ec81c987cc4e76a665419e74b863319492fc7d26f708b835a/linked-set/structs.js +0 -430
  137. package/dist/src/_dependencies/source/0x4b0f4ee1a40ce37ec81c987cc4e76a665419e74b863319492fc7d26f708b835a/tails-staking/structs.d.ts +0 -1071
  138. package/dist/src/_dependencies/source/0x4b0f4ee1a40ce37ec81c987cc4e76a665419e74b863319492fc7d26f708b835a/tails-staking/structs.js +0 -2261
  139. package/dist/src/_dependencies/source/0x4b0f4ee1a40ce37ec81c987cc4e76a665419e74b863319492fc7d26f708b835a/tgld/structs.d.ts +0 -279
  140. package/dist/src/_dependencies/source/0x4b0f4ee1a40ce37ec81c987cc4e76a665419e74b863319492fc7d26f708b835a/tgld/structs.js +0 -733
  141. package/dist/src/_dependencies/source/0x4b0f4ee1a40ce37ec81c987cc4e76a665419e74b863319492fc7d26f708b835a/user/structs.d.ts +0 -328
  142. package/dist/src/_dependencies/source/0x4b0f4ee1a40ce37ec81c987cc4e76a665419e74b863319492fc7d26f708b835a/user/structs.js +0 -892
  143. package/dist/src/_dependencies/source/0xb4f25230ba74837d8299e92951306100c4a532e8c48cc3d8828abe9b91c8b274/authority/structs.d.ts +0 -88
  144. package/dist/src/_dependencies/source/0xb4f25230ba74837d8299e92951306100c4a532e8c48cc3d8828abe9b91c8b274/authority/structs.js +0 -263
  145. package/dist/src/_dependencies/source/0xb4f25230ba74837d8299e92951306100c4a532e8c48cc3d8828abe9b91c8b274/balance-pool/structs.d.ts +0 -347
  146. package/dist/src/_dependencies/source/0xb4f25230ba74837d8299e92951306100c4a532e8c48cc3d8828abe9b91c8b274/balance-pool/structs.js +0 -591
  147. package/dist/src/_dependencies/source/0xb4f25230ba74837d8299e92951306100c4a532e8c48cc3d8828abe9b91c8b274/big-vector/structs.d.ts +0 -73
  148. package/dist/src/_dependencies/source/0xb4f25230ba74837d8299e92951306100c4a532e8c48cc3d8828abe9b91c8b274/big-vector/structs.js +0 -258
  149. package/dist/src/_dependencies/source/0xb4f25230ba74837d8299e92951306100c4a532e8c48cc3d8828abe9b91c8b274/dutch/structs.d.ts +0 -876
  150. package/dist/src/_dependencies/source/0xb4f25230ba74837d8299e92951306100c4a532e8c48cc3d8828abe9b91c8b274/dutch/structs.js +0 -1721
  151. package/dist/src/_dependencies/source/0xb4f25230ba74837d8299e92951306100c4a532e8c48cc3d8828abe9b91c8b274/i64/structs.d.ts +0 -46
  152. package/dist/src/_dependencies/source/0xb4f25230ba74837d8299e92951306100c4a532e8c48cc3d8828abe9b91c8b274/i64/structs.js +0 -222
  153. package/dist/src/_dependencies/source/0xb4f25230ba74837d8299e92951306100c4a532e8c48cc3d8828abe9b91c8b274/index.d.ts +0 -3
  154. package/dist/src/_dependencies/source/0xb4f25230ba74837d8299e92951306100c4a532e8c48cc3d8828abe9b91c8b274/index.js +0 -6
  155. package/dist/src/_dependencies/source/0xb4f25230ba74837d8299e92951306100c4a532e8c48cc3d8828abe9b91c8b274/init.d.ts +0 -2
  156. package/dist/src/_dependencies/source/0xb4f25230ba74837d8299e92951306100c4a532e8c48cc3d8828abe9b91c8b274/init.js +0 -89
  157. package/dist/src/_dependencies/source/0xb4f25230ba74837d8299e92951306100c4a532e8c48cc3d8828abe9b91c8b274/linked-list/structs.d.ts +0 -155
  158. package/dist/src/_dependencies/source/0xb4f25230ba74837d8299e92951306100c4a532e8c48cc3d8828abe9b91c8b274/linked-list/structs.js +0 -444
  159. package/dist/src/_dependencies/source/0xb4f25230ba74837d8299e92951306100c4a532e8c48cc3d8828abe9b91c8b274/vault/structs.d.ts +0 -2386
  160. package/dist/src/_dependencies/source/0xb4f25230ba74837d8299e92951306100c4a532e8c48cc3d8828abe9b91c8b274/vault/structs.js +0 -4952
  161. package/dist/src/_dependencies/source/0xbd147bc7f12f38f175d78947a61364e8e077b9b188b00e7094bc0c3623162196/discount-mint/structs.d.ts +0 -446
  162. package/dist/src/_dependencies/source/0xbd147bc7f12f38f175d78947a61364e8e077b9b188b00e7094bc0c3623162196/discount-mint/structs.js +0 -844
  163. package/dist/src/_dependencies/source/0xbd147bc7f12f38f175d78947a61364e8e077b9b188b00e7094bc0c3623162196/index.d.ts +0 -6
  164. package/dist/src/_dependencies/source/0xbd147bc7f12f38f175d78947a61364e8e077b9b188b00e7094bc0c3623162196/index.js +0 -9
  165. package/dist/src/_dependencies/source/0xbd147bc7f12f38f175d78947a61364e8e077b9b188b00e7094bc0c3623162196/init.d.ts +0 -2
  166. package/dist/src/_dependencies/source/0xbd147bc7f12f38f175d78947a61364e8e077b9b188b00e7094bc0c3623162196/init.js +0 -69
  167. package/dist/src/_dependencies/source/0xbd147bc7f12f38f175d78947a61364e8e077b9b188b00e7094bc0c3623162196/royalty-rule/structs.d.ts +0 -94
  168. package/dist/src/_dependencies/source/0xbd147bc7f12f38f175d78947a61364e8e077b9b188b00e7094bc0c3623162196/royalty-rule/structs.js +0 -376
  169. package/dist/src/_dependencies/source/0xbd147bc7f12f38f175d78947a61364e8e077b9b188b00e7094bc0c3623162196/staking/structs.d.ts +0 -454
  170. package/dist/src/_dependencies/source/0xbd147bc7f12f38f175d78947a61364e8e077b9b188b00e7094bc0c3623162196/staking/structs.js +0 -881
  171. package/dist/src/_dependencies/source/0xbd147bc7f12f38f175d78947a61364e8e077b9b188b00e7094bc0c3623162196/table-vec/structs.d.ts +0 -68
  172. package/dist/src/_dependencies/source/0xbd147bc7f12f38f175d78947a61364e8e077b9b188b00e7094bc0c3623162196/table-vec/structs.js +0 -274
  173. package/dist/src/_dependencies/source/0xbd147bc7f12f38f175d78947a61364e8e077b9b188b00e7094bc0c3623162196/typus-nft/structs.d.ts +0 -1117
  174. package/dist/src/_dependencies/source/0xbd147bc7f12f38f175d78947a61364e8e077b9b188b00e7094bc0c3623162196/typus-nft/structs.js +0 -2387
  175. package/dist/src/_framework/init-loader.d.ts +0 -2
  176. package/dist/src/_framework/loader.d.ts +0 -17
  177. package/dist/src/_framework/loader.js +0 -108
  178. package/dist/src/_framework/reified.d.ts +0 -108
  179. package/dist/src/_framework/reified.js +0 -237
  180. package/dist/src/_framework/util.d.ts +0 -35
  181. package/dist/src/_framework/util.js +0 -396
  182. package/dist/src/_framework/vector.d.ts +0 -35
  183. package/dist/src/_framework/vector.js +0 -112
  184. package/dist/src/pyth.js +0 -1
  185. package/dist/src/typus_perp/admin/functions.d.ts +0 -59
  186. package/dist/src/typus_perp/admin/functions.js +0 -122
  187. package/dist/src/typus_perp/admin/structs.d.ts +0 -529
  188. package/dist/src/typus_perp/admin/structs.js +0 -1065
  189. package/dist/src/typus_perp/competition/functions.d.ts +0 -24
  190. package/dist/src/typus_perp/competition/functions.js +0 -38
  191. package/dist/src/typus_perp/competition/structs.d.ts +0 -92
  192. package/dist/src/typus_perp/competition/structs.js +0 -288
  193. package/dist/src/typus_perp/error/functions.d.ts +0 -73
  194. package/dist/src/typus_perp/error/functions.js +0 -363
  195. package/dist/src/typus_perp/escrow/functions.d.ts +0 -17
  196. package/dist/src/typus_perp/escrow/functions.js +0 -36
  197. package/dist/src/typus_perp/escrow/structs.d.ts +0 -172
  198. package/dist/src/typus_perp/escrow/structs.js +0 -324
  199. package/dist/src/typus_perp/index.d.ts +0 -1
  200. package/dist/src/typus_perp/index.js +0 -7
  201. package/dist/src/typus_perp/init.d.ts +0 -2
  202. package/dist/src/typus_perp/init.js +0 -118
  203. package/dist/src/typus_perp/lending/functions.d.ts +0 -15
  204. package/dist/src/typus_perp/lending/functions.js +0 -22
  205. package/dist/src/typus_perp/lp-pool/functions.d.ts +0 -460
  206. package/dist/src/typus_perp/lp-pool/functions.js +0 -732
  207. package/dist/src/typus_perp/lp-pool/structs.d.ts +0 -4268
  208. package/dist/src/typus_perp/lp-pool/structs.js +0 -6789
  209. package/dist/src/typus_perp/math/functions.d.ts +0 -29
  210. package/dist/src/typus_perp/math/functions.js +0 -61
  211. package/dist/src/typus_perp/position/functions.d.ts +0 -379
  212. package/dist/src/typus_perp/position/functions.js +0 -713
  213. package/dist/src/typus_perp/position/structs.d.ts +0 -1064
  214. package/dist/src/typus_perp/position/structs.js +0 -1450
  215. package/dist/src/typus_perp/symbol/functions.d.ts +0 -9
  216. package/dist/src/typus_perp/symbol/functions.js +0 -24
  217. package/dist/src/typus_perp/symbol/structs.d.ts +0 -81
  218. package/dist/src/typus_perp/symbol/structs.js +0 -235
  219. package/dist/src/typus_perp/tlp/functions.d.ts +0 -19
  220. package/dist/src/typus_perp/tlp/functions.js +0 -40
  221. package/dist/src/typus_perp/tlp/structs.d.ts +0 -97
  222. package/dist/src/typus_perp/tlp/structs.js +0 -365
  223. package/dist/src/typus_perp/token-interface/functions.d.ts +0 -11
  224. package/dist/src/typus_perp/token-interface/functions.js +0 -22
  225. package/dist/src/typus_perp/trading/functions.d.ts +0 -812
  226. package/dist/src/typus_perp/trading/functions.js +0 -1218
  227. package/dist/src/typus_perp/trading/structs.d.ts +0 -3613
  228. package/dist/src/typus_perp/trading/structs.js +0 -5813
  229. package/dist/src/typus_perp/treasury-caps/functions.d.ts +0 -9
  230. package/dist/src/typus_perp/treasury-caps/functions.js +0 -36
  231. package/dist/src/typus_perp/treasury-caps/structs.d.ts +0 -55
  232. package/dist/src/typus_perp/treasury-caps/structs.js +0 -223
  233. package/dist/src/typus_perp/user-account/functions.d.ts +0 -36
  234. package/dist/src/typus_perp/user-account/functions.js +0 -70
  235. package/dist/src/typus_perp/user-account/structs.d.ts +0 -168
  236. package/dist/src/typus_perp/user-account/structs.js +0 -448
  237. package/dist/src/typus_stake_pool/admin/functions.d.ts +0 -49
  238. package/dist/src/typus_stake_pool/admin/functions.js +0 -105
  239. package/dist/src/typus_stake_pool/admin/structs.d.ts +0 -413
  240. package/dist/src/typus_stake_pool/admin/structs.js +0 -789
  241. package/dist/src/typus_stake_pool/index.d.ts +0 -1
  242. package/dist/src/typus_stake_pool/index.js +0 -7
  243. package/dist/src/typus_stake_pool/init.d.ts +0 -2
  244. package/dist/src/typus_stake_pool/init.js +0 -69
  245. package/dist/src/typus_stake_pool/stake-pool/functions.d.ts +0 -229
  246. package/dist/src/typus_stake_pool/stake-pool/functions.js +0 -380
  247. package/dist/src/typus_stake_pool/stake-pool/structs.d.ts +0 -2477
  248. package/dist/src/typus_stake_pool/stake-pool/structs.js +0 -4653
  249. /package/dist/src/{pyth.d.ts → grpc/ledgerService.d.ts} +0 -0
@@ -1,2261 +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 () {
30
- var ownKeys = function(o) {
31
- ownKeys = Object.getOwnPropertyNames || function (o) {
32
- var ar = [];
33
- for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
34
- return ar;
35
- };
36
- return ownKeys(o);
37
- };
38
- return function (mod) {
39
- if (mod && mod.__esModule) return mod;
40
- var result = {};
41
- if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
42
- __setModuleDefault(result, mod);
43
- return result;
44
- };
45
- })();
46
- var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
47
- function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
48
- return new (P || (P = Promise))(function (resolve, reject) {
49
- function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
50
- function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
51
- function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
52
- step((generator = generator.apply(thisArg, _arguments || [])).next());
53
- });
54
- };
55
- var __generator = (this && this.__generator) || function (thisArg, body) {
56
- var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g = Object.create((typeof Iterator === "function" ? Iterator : Object).prototype);
57
- return g.next = verb(0), g["throw"] = verb(1), g["return"] = verb(2), typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g;
58
- function verb(n) { return function (v) { return step([n, v]); }; }
59
- function step(op) {
60
- if (f) throw new TypeError("Generator is already executing.");
61
- while (g && (g = 0, op[0] && (_ = 0)), _) try {
62
- if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;
63
- if (y = 0, t) op = [op[0] & 2, t.value];
64
- switch (op[0]) {
65
- case 0: case 1: t = op; break;
66
- case 4: _.label++; return { value: op[1], done: false };
67
- case 5: _.label++; y = op[1]; op = [0]; continue;
68
- case 7: op = _.ops.pop(); _.trys.pop(); continue;
69
- default:
70
- if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }
71
- if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }
72
- if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }
73
- if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }
74
- if (t[2]) _.ops.pop();
75
- _.trys.pop(); continue;
76
- }
77
- op = body.call(thisArg, _);
78
- } catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }
79
- if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };
80
- }
81
- };
82
- var __read = (this && this.__read) || function (o, n) {
83
- var m = typeof Symbol === "function" && o[Symbol.iterator];
84
- if (!m) return o;
85
- var i = m.call(o), r, ar = [], e;
86
- try {
87
- while ((n === void 0 || n-- > 0) && !(r = i.next()).done) ar.push(r.value);
88
- }
89
- catch (error) { e = { error: error }; }
90
- finally {
91
- try {
92
- if (r && !r.done && (m = i["return"])) m.call(i);
93
- }
94
- finally { if (e) throw e.error; }
95
- }
96
- return ar;
97
- };
98
- var __spreadArray = (this && this.__spreadArray) || function (to, from, pack) {
99
- if (pack || arguments.length === 2) for (var i = 0, l = from.length, ar; i < l; i++) {
100
- if (ar || !(i in from)) {
101
- if (!ar) ar = Array.prototype.slice.call(from, 0, i);
102
- ar[i] = from[i];
103
- }
104
- }
105
- return to.concat(ar || Array.prototype.slice.call(from));
106
- };
107
- Object.defineProperty(exports, "__esModule", { value: true });
108
- exports.UpdateTailsStakingRegistryConfigEvent = exports.UnstakeTailsEvent = exports.TransferTailsEvent = exports.TailsStakingRegistry = exports.StakingInfo = exports.StakeTailsEvent = exports.SetProfitSharingEvent = exports.RemoveProfitSharingEvent = exports.LevelUpEvent = exports.ExpUpEvent = exports.ExpDownEvent = exports.DailySignUpEvent = exports.ClaimProfitSharingEvent = void 0;
109
- exports.isClaimProfitSharingEvent = isClaimProfitSharingEvent;
110
- exports.isDailySignUpEvent = isDailySignUpEvent;
111
- exports.isExpDownEvent = isExpDownEvent;
112
- exports.isExpUpEvent = isExpUpEvent;
113
- exports.isLevelUpEvent = isLevelUpEvent;
114
- exports.isRemoveProfitSharingEvent = isRemoveProfitSharingEvent;
115
- exports.isSetProfitSharingEvent = isSetProfitSharingEvent;
116
- exports.isStakeTailsEvent = isStakeTailsEvent;
117
- exports.isStakingInfo = isStakingInfo;
118
- exports.isTailsStakingRegistry = isTailsStakingRegistry;
119
- exports.isTransferTailsEvent = isTransferTailsEvent;
120
- exports.isUnstakeTailsEvent = isUnstakeTailsEvent;
121
- exports.isUpdateTailsStakingRegistryConfigEvent = isUpdateTailsStakingRegistryConfigEvent;
122
- var reified = __importStar(require("../../../../_framework/reified"));
123
- var reified_1 = require("../../../../_framework/reified");
124
- var util_1 = require("../../../../_framework/util");
125
- var structs_1 = require("../../0x1/type-name/structs");
126
- var structs_2 = require("../../0x2/bag/structs");
127
- var structs_3 = require("../../0x2/object-table/structs");
128
- var structs_4 = require("../../0x2/object/structs");
129
- var structs_5 = require("../../0x2/transfer-policy/structs");
130
- var structs_6 = require("../../0xbd147bc7f12f38f175d78947a61364e8e077b9b188b00e7094bc0c3623162196/typus-nft/structs");
131
- var structs_7 = require("../big-vector/structs");
132
- var index_1 = require("../index");
133
- var bcs_1 = require("@mysten/sui/bcs");
134
- var utils_1 = require("@mysten/sui/utils");
135
- /* ============================== ClaimProfitSharingEvent =============================== */
136
- function isClaimProfitSharingEvent(type) {
137
- type = (0, util_1.compressSuiType)(type);
138
- return type === "".concat(index_1.PKG_V3, "::tails_staking::ClaimProfitSharingEvent");
139
- }
140
- var ClaimProfitSharingEvent = /** @class */ (function () {
141
- function ClaimProfitSharingEvent(typeArgs, fields) {
142
- this.__StructClass = true;
143
- this.$typeName = ClaimProfitSharingEvent.$typeName;
144
- this.$isPhantom = ClaimProfitSharingEvent.$isPhantom;
145
- this.$fullTypeName = util_1.composeSuiType.apply(void 0, __spreadArray([ClaimProfitSharingEvent.$typeName], __read(typeArgs), false));
146
- this.$typeArgs = typeArgs;
147
- this.tails = fields.tails;
148
- this.profitAsset = fields.profitAsset;
149
- this.log = fields.log;
150
- this.bcsPadding = fields.bcsPadding;
151
- }
152
- ClaimProfitSharingEvent.reified = function () {
153
- var _this = this;
154
- return {
155
- typeName: ClaimProfitSharingEvent.$typeName,
156
- fullTypeName: util_1.composeSuiType.apply(void 0, __spreadArray([ClaimProfitSharingEvent.$typeName], [], false)),
157
- typeArgs: [],
158
- isPhantom: ClaimProfitSharingEvent.$isPhantom,
159
- reifiedTypeArgs: [],
160
- fromFields: function (fields) { return ClaimProfitSharingEvent.fromFields(fields); },
161
- fromFieldsWithTypes: function (item) { return ClaimProfitSharingEvent.fromFieldsWithTypes(item); },
162
- fromBcs: function (data) { return ClaimProfitSharingEvent.fromBcs(data); },
163
- bcs: ClaimProfitSharingEvent.bcs,
164
- fromJSONField: function (field) { return ClaimProfitSharingEvent.fromJSONField(field); },
165
- fromJSON: function (json) { return ClaimProfitSharingEvent.fromJSON(json); },
166
- fromSuiParsedData: function (content) { return ClaimProfitSharingEvent.fromSuiParsedData(content); },
167
- fromSuiObjectData: function (content) { return ClaimProfitSharingEvent.fromSuiObjectData(content); },
168
- fetch: function (client, id) { return __awaiter(_this, void 0, void 0, function () { return __generator(this, function (_a) {
169
- return [2 /*return*/, ClaimProfitSharingEvent.fetch(client, id)];
170
- }); }); },
171
- new: function (fields) {
172
- return new ClaimProfitSharingEvent([], fields);
173
- },
174
- kind: "StructClassReified",
175
- };
176
- };
177
- Object.defineProperty(ClaimProfitSharingEvent, "r", {
178
- get: function () {
179
- return ClaimProfitSharingEvent.reified();
180
- },
181
- enumerable: false,
182
- configurable: true
183
- });
184
- ClaimProfitSharingEvent.phantom = function () {
185
- return (0, reified_1.phantom)(ClaimProfitSharingEvent.reified());
186
- };
187
- Object.defineProperty(ClaimProfitSharingEvent, "p", {
188
- get: function () {
189
- return ClaimProfitSharingEvent.phantom();
190
- },
191
- enumerable: false,
192
- configurable: true
193
- });
194
- Object.defineProperty(ClaimProfitSharingEvent, "bcs", {
195
- get: function () {
196
- return bcs_1.bcs.struct("ClaimProfitSharingEvent", {
197
- tails: bcs_1.bcs.vector(bcs_1.bcs.u64()),
198
- profit_asset: structs_1.TypeName.bcs,
199
- log: bcs_1.bcs.vector(bcs_1.bcs.u64()),
200
- bcs_padding: bcs_1.bcs.vector(bcs_1.bcs.vector(bcs_1.bcs.u8())),
201
- });
202
- },
203
- enumerable: false,
204
- configurable: true
205
- });
206
- ClaimProfitSharingEvent.fromFields = function (fields) {
207
- return ClaimProfitSharingEvent.reified().new({
208
- tails: (0, reified_1.decodeFromFields)(reified.vector("u64"), fields.tails),
209
- profitAsset: (0, reified_1.decodeFromFields)(structs_1.TypeName.reified(), fields.profit_asset),
210
- log: (0, reified_1.decodeFromFields)(reified.vector("u64"), fields.log),
211
- bcsPadding: (0, reified_1.decodeFromFields)(reified.vector(reified.vector("u8")), fields.bcs_padding),
212
- });
213
- };
214
- ClaimProfitSharingEvent.fromFieldsWithTypes = function (item) {
215
- if (!isClaimProfitSharingEvent(item.type)) {
216
- throw new Error("not a ClaimProfitSharingEvent type");
217
- }
218
- return ClaimProfitSharingEvent.reified().new({
219
- tails: (0, reified_1.decodeFromFieldsWithTypes)(reified.vector("u64"), item.fields.tails),
220
- profitAsset: (0, reified_1.decodeFromFieldsWithTypes)(structs_1.TypeName.reified(), item.fields.profit_asset),
221
- log: (0, reified_1.decodeFromFieldsWithTypes)(reified.vector("u64"), item.fields.log),
222
- bcsPadding: (0, reified_1.decodeFromFieldsWithTypes)(reified.vector(reified.vector("u8")), item.fields.bcs_padding),
223
- });
224
- };
225
- ClaimProfitSharingEvent.fromBcs = function (data) {
226
- return ClaimProfitSharingEvent.fromFields(ClaimProfitSharingEvent.bcs.parse(data));
227
- };
228
- ClaimProfitSharingEvent.prototype.toJSONField = function () {
229
- return {
230
- tails: (0, reified_1.fieldToJSON)("vector<u64>", this.tails),
231
- profitAsset: this.profitAsset.toJSONField(),
232
- log: (0, reified_1.fieldToJSON)("vector<u64>", this.log),
233
- bcsPadding: (0, reified_1.fieldToJSON)("vector<vector<u8>>", this.bcsPadding),
234
- };
235
- };
236
- ClaimProfitSharingEvent.prototype.toJSON = function () {
237
- return __assign({ $typeName: this.$typeName, $typeArgs: this.$typeArgs }, this.toJSONField());
238
- };
239
- ClaimProfitSharingEvent.fromJSONField = function (field) {
240
- return ClaimProfitSharingEvent.reified().new({
241
- tails: (0, reified_1.decodeFromJSONField)(reified.vector("u64"), field.tails),
242
- profitAsset: (0, reified_1.decodeFromJSONField)(structs_1.TypeName.reified(), field.profitAsset),
243
- log: (0, reified_1.decodeFromJSONField)(reified.vector("u64"), field.log),
244
- bcsPadding: (0, reified_1.decodeFromJSONField)(reified.vector(reified.vector("u8")), field.bcsPadding),
245
- });
246
- };
247
- ClaimProfitSharingEvent.fromJSON = function (json) {
248
- if (json.$typeName !== ClaimProfitSharingEvent.$typeName) {
249
- throw new Error("not a WithTwoGenerics json object");
250
- }
251
- return ClaimProfitSharingEvent.fromJSONField(json);
252
- };
253
- ClaimProfitSharingEvent.fromSuiParsedData = function (content) {
254
- if (content.dataType !== "moveObject") {
255
- throw new Error("not an object");
256
- }
257
- if (!isClaimProfitSharingEvent(content.type)) {
258
- throw new Error("object at ".concat(content.fields.id, " is not a ClaimProfitSharingEvent object"));
259
- }
260
- return ClaimProfitSharingEvent.fromFieldsWithTypes(content);
261
- };
262
- ClaimProfitSharingEvent.fromSuiObjectData = function (data) {
263
- if (data.bcs) {
264
- if (data.bcs.dataType !== "moveObject" || !isClaimProfitSharingEvent(data.bcs.type)) {
265
- throw new Error("object at is not a ClaimProfitSharingEvent object");
266
- }
267
- return ClaimProfitSharingEvent.fromBcs((0, utils_1.fromB64)(data.bcs.bcsBytes));
268
- }
269
- if (data.content) {
270
- return ClaimProfitSharingEvent.fromSuiParsedData(data.content);
271
- }
272
- throw new Error("Both `bcs` and `content` fields are missing from the data. Include `showBcs` or `showContent` in the request.");
273
- };
274
- ClaimProfitSharingEvent.fetch = function (client, id) {
275
- return __awaiter(this, void 0, void 0, function () {
276
- var res;
277
- var _a, _b;
278
- return __generator(this, function (_c) {
279
- switch (_c.label) {
280
- case 0: return [4 /*yield*/, client.getObject({ id: id, options: { showBcs: true } })];
281
- case 1:
282
- res = _c.sent();
283
- if (res.error) {
284
- throw new Error("error fetching ClaimProfitSharingEvent object at id ".concat(id, ": ").concat(res.error.code));
285
- }
286
- if (((_b = (_a = res.data) === null || _a === void 0 ? void 0 : _a.bcs) === null || _b === void 0 ? void 0 : _b.dataType) !== "moveObject" || !isClaimProfitSharingEvent(res.data.bcs.type)) {
287
- throw new Error("object at id ".concat(id, " is not a ClaimProfitSharingEvent object"));
288
- }
289
- return [2 /*return*/, ClaimProfitSharingEvent.fromSuiObjectData(res.data)];
290
- }
291
- });
292
- });
293
- };
294
- ClaimProfitSharingEvent.$typeName = "".concat(index_1.PKG_V3, "::tails_staking::ClaimProfitSharingEvent");
295
- ClaimProfitSharingEvent.$numTypeParams = 0;
296
- ClaimProfitSharingEvent.$isPhantom = [];
297
- return ClaimProfitSharingEvent;
298
- }());
299
- exports.ClaimProfitSharingEvent = ClaimProfitSharingEvent;
300
- /* ============================== DailySignUpEvent =============================== */
301
- function isDailySignUpEvent(type) {
302
- type = (0, util_1.compressSuiType)(type);
303
- return type === "".concat(index_1.PKG_V3, "::tails_staking::DailySignUpEvent");
304
- }
305
- var DailySignUpEvent = /** @class */ (function () {
306
- function DailySignUpEvent(typeArgs, fields) {
307
- this.__StructClass = true;
308
- this.$typeName = DailySignUpEvent.$typeName;
309
- this.$isPhantom = DailySignUpEvent.$isPhantom;
310
- this.$fullTypeName = util_1.composeSuiType.apply(void 0, __spreadArray([DailySignUpEvent.$typeName], __read(typeArgs), false));
311
- this.$typeArgs = typeArgs;
312
- this.tails = fields.tails;
313
- this.log = fields.log;
314
- this.bcsPadding = fields.bcsPadding;
315
- }
316
- DailySignUpEvent.reified = function () {
317
- var _this = this;
318
- return {
319
- typeName: DailySignUpEvent.$typeName,
320
- fullTypeName: util_1.composeSuiType.apply(void 0, __spreadArray([DailySignUpEvent.$typeName], [], false)),
321
- typeArgs: [],
322
- isPhantom: DailySignUpEvent.$isPhantom,
323
- reifiedTypeArgs: [],
324
- fromFields: function (fields) { return DailySignUpEvent.fromFields(fields); },
325
- fromFieldsWithTypes: function (item) { return DailySignUpEvent.fromFieldsWithTypes(item); },
326
- fromBcs: function (data) { return DailySignUpEvent.fromBcs(data); },
327
- bcs: DailySignUpEvent.bcs,
328
- fromJSONField: function (field) { return DailySignUpEvent.fromJSONField(field); },
329
- fromJSON: function (json) { return DailySignUpEvent.fromJSON(json); },
330
- fromSuiParsedData: function (content) { return DailySignUpEvent.fromSuiParsedData(content); },
331
- fromSuiObjectData: function (content) { return DailySignUpEvent.fromSuiObjectData(content); },
332
- fetch: function (client, id) { return __awaiter(_this, void 0, void 0, function () { return __generator(this, function (_a) {
333
- return [2 /*return*/, DailySignUpEvent.fetch(client, id)];
334
- }); }); },
335
- new: function (fields) {
336
- return new DailySignUpEvent([], fields);
337
- },
338
- kind: "StructClassReified",
339
- };
340
- };
341
- Object.defineProperty(DailySignUpEvent, "r", {
342
- get: function () {
343
- return DailySignUpEvent.reified();
344
- },
345
- enumerable: false,
346
- configurable: true
347
- });
348
- DailySignUpEvent.phantom = function () {
349
- return (0, reified_1.phantom)(DailySignUpEvent.reified());
350
- };
351
- Object.defineProperty(DailySignUpEvent, "p", {
352
- get: function () {
353
- return DailySignUpEvent.phantom();
354
- },
355
- enumerable: false,
356
- configurable: true
357
- });
358
- Object.defineProperty(DailySignUpEvent, "bcs", {
359
- get: function () {
360
- return bcs_1.bcs.struct("DailySignUpEvent", {
361
- tails: bcs_1.bcs.vector(bcs_1.bcs.u64()),
362
- log: bcs_1.bcs.vector(bcs_1.bcs.u64()),
363
- bcs_padding: bcs_1.bcs.vector(bcs_1.bcs.vector(bcs_1.bcs.u8())),
364
- });
365
- },
366
- enumerable: false,
367
- configurable: true
368
- });
369
- DailySignUpEvent.fromFields = function (fields) {
370
- return DailySignUpEvent.reified().new({
371
- tails: (0, reified_1.decodeFromFields)(reified.vector("u64"), fields.tails),
372
- log: (0, reified_1.decodeFromFields)(reified.vector("u64"), fields.log),
373
- bcsPadding: (0, reified_1.decodeFromFields)(reified.vector(reified.vector("u8")), fields.bcs_padding),
374
- });
375
- };
376
- DailySignUpEvent.fromFieldsWithTypes = function (item) {
377
- if (!isDailySignUpEvent(item.type)) {
378
- throw new Error("not a DailySignUpEvent type");
379
- }
380
- return DailySignUpEvent.reified().new({
381
- tails: (0, reified_1.decodeFromFieldsWithTypes)(reified.vector("u64"), item.fields.tails),
382
- log: (0, reified_1.decodeFromFieldsWithTypes)(reified.vector("u64"), item.fields.log),
383
- bcsPadding: (0, reified_1.decodeFromFieldsWithTypes)(reified.vector(reified.vector("u8")), item.fields.bcs_padding),
384
- });
385
- };
386
- DailySignUpEvent.fromBcs = function (data) {
387
- return DailySignUpEvent.fromFields(DailySignUpEvent.bcs.parse(data));
388
- };
389
- DailySignUpEvent.prototype.toJSONField = function () {
390
- return {
391
- tails: (0, reified_1.fieldToJSON)("vector<u64>", this.tails),
392
- log: (0, reified_1.fieldToJSON)("vector<u64>", this.log),
393
- bcsPadding: (0, reified_1.fieldToJSON)("vector<vector<u8>>", this.bcsPadding),
394
- };
395
- };
396
- DailySignUpEvent.prototype.toJSON = function () {
397
- return __assign({ $typeName: this.$typeName, $typeArgs: this.$typeArgs }, this.toJSONField());
398
- };
399
- DailySignUpEvent.fromJSONField = function (field) {
400
- return DailySignUpEvent.reified().new({
401
- tails: (0, reified_1.decodeFromJSONField)(reified.vector("u64"), field.tails),
402
- log: (0, reified_1.decodeFromJSONField)(reified.vector("u64"), field.log),
403
- bcsPadding: (0, reified_1.decodeFromJSONField)(reified.vector(reified.vector("u8")), field.bcsPadding),
404
- });
405
- };
406
- DailySignUpEvent.fromJSON = function (json) {
407
- if (json.$typeName !== DailySignUpEvent.$typeName) {
408
- throw new Error("not a WithTwoGenerics json object");
409
- }
410
- return DailySignUpEvent.fromJSONField(json);
411
- };
412
- DailySignUpEvent.fromSuiParsedData = function (content) {
413
- if (content.dataType !== "moveObject") {
414
- throw new Error("not an object");
415
- }
416
- if (!isDailySignUpEvent(content.type)) {
417
- throw new Error("object at ".concat(content.fields.id, " is not a DailySignUpEvent object"));
418
- }
419
- return DailySignUpEvent.fromFieldsWithTypes(content);
420
- };
421
- DailySignUpEvent.fromSuiObjectData = function (data) {
422
- if (data.bcs) {
423
- if (data.bcs.dataType !== "moveObject" || !isDailySignUpEvent(data.bcs.type)) {
424
- throw new Error("object at is not a DailySignUpEvent object");
425
- }
426
- return DailySignUpEvent.fromBcs((0, utils_1.fromB64)(data.bcs.bcsBytes));
427
- }
428
- if (data.content) {
429
- return DailySignUpEvent.fromSuiParsedData(data.content);
430
- }
431
- throw new Error("Both `bcs` and `content` fields are missing from the data. Include `showBcs` or `showContent` in the request.");
432
- };
433
- DailySignUpEvent.fetch = function (client, id) {
434
- return __awaiter(this, void 0, void 0, function () {
435
- var res;
436
- var _a, _b;
437
- return __generator(this, function (_c) {
438
- switch (_c.label) {
439
- case 0: return [4 /*yield*/, client.getObject({ id: id, options: { showBcs: true } })];
440
- case 1:
441
- res = _c.sent();
442
- if (res.error) {
443
- throw new Error("error fetching DailySignUpEvent object at id ".concat(id, ": ").concat(res.error.code));
444
- }
445
- if (((_b = (_a = res.data) === null || _a === void 0 ? void 0 : _a.bcs) === null || _b === void 0 ? void 0 : _b.dataType) !== "moveObject" || !isDailySignUpEvent(res.data.bcs.type)) {
446
- throw new Error("object at id ".concat(id, " is not a DailySignUpEvent object"));
447
- }
448
- return [2 /*return*/, DailySignUpEvent.fromSuiObjectData(res.data)];
449
- }
450
- });
451
- });
452
- };
453
- DailySignUpEvent.$typeName = "".concat(index_1.PKG_V3, "::tails_staking::DailySignUpEvent");
454
- DailySignUpEvent.$numTypeParams = 0;
455
- DailySignUpEvent.$isPhantom = [];
456
- return DailySignUpEvent;
457
- }());
458
- exports.DailySignUpEvent = DailySignUpEvent;
459
- /* ============================== ExpDownEvent =============================== */
460
- function isExpDownEvent(type) {
461
- type = (0, util_1.compressSuiType)(type);
462
- return type === "".concat(index_1.PKG_V6, "::tails_staking::ExpDownEvent");
463
- }
464
- var ExpDownEvent = /** @class */ (function () {
465
- function ExpDownEvent(typeArgs, fields) {
466
- this.__StructClass = true;
467
- this.$typeName = ExpDownEvent.$typeName;
468
- this.$isPhantom = ExpDownEvent.$isPhantom;
469
- this.$fullTypeName = util_1.composeSuiType.apply(void 0, __spreadArray([ExpDownEvent.$typeName], __read(typeArgs), false));
470
- this.$typeArgs = typeArgs;
471
- this.tails = fields.tails;
472
- this.log = fields.log;
473
- this.bcsPadding = fields.bcsPadding;
474
- }
475
- ExpDownEvent.reified = function () {
476
- var _this = this;
477
- return {
478
- typeName: ExpDownEvent.$typeName,
479
- fullTypeName: util_1.composeSuiType.apply(void 0, __spreadArray([ExpDownEvent.$typeName], [], false)),
480
- typeArgs: [],
481
- isPhantom: ExpDownEvent.$isPhantom,
482
- reifiedTypeArgs: [],
483
- fromFields: function (fields) { return ExpDownEvent.fromFields(fields); },
484
- fromFieldsWithTypes: function (item) { return ExpDownEvent.fromFieldsWithTypes(item); },
485
- fromBcs: function (data) { return ExpDownEvent.fromBcs(data); },
486
- bcs: ExpDownEvent.bcs,
487
- fromJSONField: function (field) { return ExpDownEvent.fromJSONField(field); },
488
- fromJSON: function (json) { return ExpDownEvent.fromJSON(json); },
489
- fromSuiParsedData: function (content) { return ExpDownEvent.fromSuiParsedData(content); },
490
- fromSuiObjectData: function (content) { return ExpDownEvent.fromSuiObjectData(content); },
491
- fetch: function (client, id) { return __awaiter(_this, void 0, void 0, function () { return __generator(this, function (_a) {
492
- return [2 /*return*/, ExpDownEvent.fetch(client, id)];
493
- }); }); },
494
- new: function (fields) {
495
- return new ExpDownEvent([], fields);
496
- },
497
- kind: "StructClassReified",
498
- };
499
- };
500
- Object.defineProperty(ExpDownEvent, "r", {
501
- get: function () {
502
- return ExpDownEvent.reified();
503
- },
504
- enumerable: false,
505
- configurable: true
506
- });
507
- ExpDownEvent.phantom = function () {
508
- return (0, reified_1.phantom)(ExpDownEvent.reified());
509
- };
510
- Object.defineProperty(ExpDownEvent, "p", {
511
- get: function () {
512
- return ExpDownEvent.phantom();
513
- },
514
- enumerable: false,
515
- configurable: true
516
- });
517
- Object.defineProperty(ExpDownEvent, "bcs", {
518
- get: function () {
519
- return bcs_1.bcs.struct("ExpDownEvent", {
520
- tails: bcs_1.bcs.bytes(32).transform({ input: function (val) { return (0, utils_1.fromHEX)(val); }, output: function (val) { return (0, utils_1.toHEX)(val); } }),
521
- log: bcs_1.bcs.vector(bcs_1.bcs.u64()),
522
- bcs_padding: bcs_1.bcs.vector(bcs_1.bcs.vector(bcs_1.bcs.u8())),
523
- });
524
- },
525
- enumerable: false,
526
- configurable: true
527
- });
528
- ExpDownEvent.fromFields = function (fields) {
529
- return ExpDownEvent.reified().new({
530
- tails: (0, reified_1.decodeFromFields)("address", fields.tails),
531
- log: (0, reified_1.decodeFromFields)(reified.vector("u64"), fields.log),
532
- bcsPadding: (0, reified_1.decodeFromFields)(reified.vector(reified.vector("u8")), fields.bcs_padding),
533
- });
534
- };
535
- ExpDownEvent.fromFieldsWithTypes = function (item) {
536
- if (!isExpDownEvent(item.type)) {
537
- throw new Error("not a ExpDownEvent type");
538
- }
539
- return ExpDownEvent.reified().new({
540
- tails: (0, reified_1.decodeFromFieldsWithTypes)("address", item.fields.tails),
541
- log: (0, reified_1.decodeFromFieldsWithTypes)(reified.vector("u64"), item.fields.log),
542
- bcsPadding: (0, reified_1.decodeFromFieldsWithTypes)(reified.vector(reified.vector("u8")), item.fields.bcs_padding),
543
- });
544
- };
545
- ExpDownEvent.fromBcs = function (data) {
546
- return ExpDownEvent.fromFields(ExpDownEvent.bcs.parse(data));
547
- };
548
- ExpDownEvent.prototype.toJSONField = function () {
549
- return {
550
- tails: this.tails,
551
- log: (0, reified_1.fieldToJSON)("vector<u64>", this.log),
552
- bcsPadding: (0, reified_1.fieldToJSON)("vector<vector<u8>>", this.bcsPadding),
553
- };
554
- };
555
- ExpDownEvent.prototype.toJSON = function () {
556
- return __assign({ $typeName: this.$typeName, $typeArgs: this.$typeArgs }, this.toJSONField());
557
- };
558
- ExpDownEvent.fromJSONField = function (field) {
559
- return ExpDownEvent.reified().new({
560
- tails: (0, reified_1.decodeFromJSONField)("address", field.tails),
561
- log: (0, reified_1.decodeFromJSONField)(reified.vector("u64"), field.log),
562
- bcsPadding: (0, reified_1.decodeFromJSONField)(reified.vector(reified.vector("u8")), field.bcsPadding),
563
- });
564
- };
565
- ExpDownEvent.fromJSON = function (json) {
566
- if (json.$typeName !== ExpDownEvent.$typeName) {
567
- throw new Error("not a WithTwoGenerics json object");
568
- }
569
- return ExpDownEvent.fromJSONField(json);
570
- };
571
- ExpDownEvent.fromSuiParsedData = function (content) {
572
- if (content.dataType !== "moveObject") {
573
- throw new Error("not an object");
574
- }
575
- if (!isExpDownEvent(content.type)) {
576
- throw new Error("object at ".concat(content.fields.id, " is not a ExpDownEvent object"));
577
- }
578
- return ExpDownEvent.fromFieldsWithTypes(content);
579
- };
580
- ExpDownEvent.fromSuiObjectData = function (data) {
581
- if (data.bcs) {
582
- if (data.bcs.dataType !== "moveObject" || !isExpDownEvent(data.bcs.type)) {
583
- throw new Error("object at is not a ExpDownEvent object");
584
- }
585
- return ExpDownEvent.fromBcs((0, utils_1.fromB64)(data.bcs.bcsBytes));
586
- }
587
- if (data.content) {
588
- return ExpDownEvent.fromSuiParsedData(data.content);
589
- }
590
- throw new Error("Both `bcs` and `content` fields are missing from the data. Include `showBcs` or `showContent` in the request.");
591
- };
592
- ExpDownEvent.fetch = function (client, id) {
593
- return __awaiter(this, void 0, void 0, function () {
594
- var res;
595
- var _a, _b;
596
- return __generator(this, function (_c) {
597
- switch (_c.label) {
598
- case 0: return [4 /*yield*/, client.getObject({ id: id, options: { showBcs: true } })];
599
- case 1:
600
- res = _c.sent();
601
- if (res.error) {
602
- throw new Error("error fetching ExpDownEvent object at id ".concat(id, ": ").concat(res.error.code));
603
- }
604
- if (((_b = (_a = res.data) === null || _a === void 0 ? void 0 : _a.bcs) === null || _b === void 0 ? void 0 : _b.dataType) !== "moveObject" || !isExpDownEvent(res.data.bcs.type)) {
605
- throw new Error("object at id ".concat(id, " is not a ExpDownEvent object"));
606
- }
607
- return [2 /*return*/, ExpDownEvent.fromSuiObjectData(res.data)];
608
- }
609
- });
610
- });
611
- };
612
- ExpDownEvent.$typeName = "".concat(index_1.PKG_V6, "::tails_staking::ExpDownEvent");
613
- ExpDownEvent.$numTypeParams = 0;
614
- ExpDownEvent.$isPhantom = [];
615
- return ExpDownEvent;
616
- }());
617
- exports.ExpDownEvent = ExpDownEvent;
618
- /* ============================== ExpUpEvent =============================== */
619
- function isExpUpEvent(type) {
620
- type = (0, util_1.compressSuiType)(type);
621
- return type === "".concat(index_1.PKG_V3, "::tails_staking::ExpUpEvent");
622
- }
623
- var ExpUpEvent = /** @class */ (function () {
624
- function ExpUpEvent(typeArgs, fields) {
625
- this.__StructClass = true;
626
- this.$typeName = ExpUpEvent.$typeName;
627
- this.$isPhantom = ExpUpEvent.$isPhantom;
628
- this.$fullTypeName = util_1.composeSuiType.apply(void 0, __spreadArray([ExpUpEvent.$typeName], __read(typeArgs), false));
629
- this.$typeArgs = typeArgs;
630
- this.tails = fields.tails;
631
- this.log = fields.log;
632
- this.bcsPadding = fields.bcsPadding;
633
- }
634
- ExpUpEvent.reified = function () {
635
- var _this = this;
636
- return {
637
- typeName: ExpUpEvent.$typeName,
638
- fullTypeName: util_1.composeSuiType.apply(void 0, __spreadArray([ExpUpEvent.$typeName], [], false)),
639
- typeArgs: [],
640
- isPhantom: ExpUpEvent.$isPhantom,
641
- reifiedTypeArgs: [],
642
- fromFields: function (fields) { return ExpUpEvent.fromFields(fields); },
643
- fromFieldsWithTypes: function (item) { return ExpUpEvent.fromFieldsWithTypes(item); },
644
- fromBcs: function (data) { return ExpUpEvent.fromBcs(data); },
645
- bcs: ExpUpEvent.bcs,
646
- fromJSONField: function (field) { return ExpUpEvent.fromJSONField(field); },
647
- fromJSON: function (json) { return ExpUpEvent.fromJSON(json); },
648
- fromSuiParsedData: function (content) { return ExpUpEvent.fromSuiParsedData(content); },
649
- fromSuiObjectData: function (content) { return ExpUpEvent.fromSuiObjectData(content); },
650
- fetch: function (client, id) { return __awaiter(_this, void 0, void 0, function () { return __generator(this, function (_a) {
651
- return [2 /*return*/, ExpUpEvent.fetch(client, id)];
652
- }); }); },
653
- new: function (fields) {
654
- return new ExpUpEvent([], fields);
655
- },
656
- kind: "StructClassReified",
657
- };
658
- };
659
- Object.defineProperty(ExpUpEvent, "r", {
660
- get: function () {
661
- return ExpUpEvent.reified();
662
- },
663
- enumerable: false,
664
- configurable: true
665
- });
666
- ExpUpEvent.phantom = function () {
667
- return (0, reified_1.phantom)(ExpUpEvent.reified());
668
- };
669
- Object.defineProperty(ExpUpEvent, "p", {
670
- get: function () {
671
- return ExpUpEvent.phantom();
672
- },
673
- enumerable: false,
674
- configurable: true
675
- });
676
- Object.defineProperty(ExpUpEvent, "bcs", {
677
- get: function () {
678
- return bcs_1.bcs.struct("ExpUpEvent", {
679
- tails: bcs_1.bcs.bytes(32).transform({ input: function (val) { return (0, utils_1.fromHEX)(val); }, output: function (val) { return (0, utils_1.toHEX)(val); } }),
680
- log: bcs_1.bcs.vector(bcs_1.bcs.u64()),
681
- bcs_padding: bcs_1.bcs.vector(bcs_1.bcs.vector(bcs_1.bcs.u8())),
682
- });
683
- },
684
- enumerable: false,
685
- configurable: true
686
- });
687
- ExpUpEvent.fromFields = function (fields) {
688
- return ExpUpEvent.reified().new({
689
- tails: (0, reified_1.decodeFromFields)("address", fields.tails),
690
- log: (0, reified_1.decodeFromFields)(reified.vector("u64"), fields.log),
691
- bcsPadding: (0, reified_1.decodeFromFields)(reified.vector(reified.vector("u8")), fields.bcs_padding),
692
- });
693
- };
694
- ExpUpEvent.fromFieldsWithTypes = function (item) {
695
- if (!isExpUpEvent(item.type)) {
696
- throw new Error("not a ExpUpEvent type");
697
- }
698
- return ExpUpEvent.reified().new({
699
- tails: (0, reified_1.decodeFromFieldsWithTypes)("address", item.fields.tails),
700
- log: (0, reified_1.decodeFromFieldsWithTypes)(reified.vector("u64"), item.fields.log),
701
- bcsPadding: (0, reified_1.decodeFromFieldsWithTypes)(reified.vector(reified.vector("u8")), item.fields.bcs_padding),
702
- });
703
- };
704
- ExpUpEvent.fromBcs = function (data) {
705
- return ExpUpEvent.fromFields(ExpUpEvent.bcs.parse(data));
706
- };
707
- ExpUpEvent.prototype.toJSONField = function () {
708
- return {
709
- tails: this.tails,
710
- log: (0, reified_1.fieldToJSON)("vector<u64>", this.log),
711
- bcsPadding: (0, reified_1.fieldToJSON)("vector<vector<u8>>", this.bcsPadding),
712
- };
713
- };
714
- ExpUpEvent.prototype.toJSON = function () {
715
- return __assign({ $typeName: this.$typeName, $typeArgs: this.$typeArgs }, this.toJSONField());
716
- };
717
- ExpUpEvent.fromJSONField = function (field) {
718
- return ExpUpEvent.reified().new({
719
- tails: (0, reified_1.decodeFromJSONField)("address", field.tails),
720
- log: (0, reified_1.decodeFromJSONField)(reified.vector("u64"), field.log),
721
- bcsPadding: (0, reified_1.decodeFromJSONField)(reified.vector(reified.vector("u8")), field.bcsPadding),
722
- });
723
- };
724
- ExpUpEvent.fromJSON = function (json) {
725
- if (json.$typeName !== ExpUpEvent.$typeName) {
726
- throw new Error("not a WithTwoGenerics json object");
727
- }
728
- return ExpUpEvent.fromJSONField(json);
729
- };
730
- ExpUpEvent.fromSuiParsedData = function (content) {
731
- if (content.dataType !== "moveObject") {
732
- throw new Error("not an object");
733
- }
734
- if (!isExpUpEvent(content.type)) {
735
- throw new Error("object at ".concat(content.fields.id, " is not a ExpUpEvent object"));
736
- }
737
- return ExpUpEvent.fromFieldsWithTypes(content);
738
- };
739
- ExpUpEvent.fromSuiObjectData = function (data) {
740
- if (data.bcs) {
741
- if (data.bcs.dataType !== "moveObject" || !isExpUpEvent(data.bcs.type)) {
742
- throw new Error("object at is not a ExpUpEvent object");
743
- }
744
- return ExpUpEvent.fromBcs((0, utils_1.fromB64)(data.bcs.bcsBytes));
745
- }
746
- if (data.content) {
747
- return ExpUpEvent.fromSuiParsedData(data.content);
748
- }
749
- throw new Error("Both `bcs` and `content` fields are missing from the data. Include `showBcs` or `showContent` in the request.");
750
- };
751
- ExpUpEvent.fetch = function (client, id) {
752
- return __awaiter(this, void 0, void 0, function () {
753
- var res;
754
- var _a, _b;
755
- return __generator(this, function (_c) {
756
- switch (_c.label) {
757
- case 0: return [4 /*yield*/, client.getObject({ id: id, options: { showBcs: true } })];
758
- case 1:
759
- res = _c.sent();
760
- if (res.error) {
761
- throw new Error("error fetching ExpUpEvent object at id ".concat(id, ": ").concat(res.error.code));
762
- }
763
- if (((_b = (_a = res.data) === null || _a === void 0 ? void 0 : _a.bcs) === null || _b === void 0 ? void 0 : _b.dataType) !== "moveObject" || !isExpUpEvent(res.data.bcs.type)) {
764
- throw new Error("object at id ".concat(id, " is not a ExpUpEvent object"));
765
- }
766
- return [2 /*return*/, ExpUpEvent.fromSuiObjectData(res.data)];
767
- }
768
- });
769
- });
770
- };
771
- ExpUpEvent.$typeName = "".concat(index_1.PKG_V3, "::tails_staking::ExpUpEvent");
772
- ExpUpEvent.$numTypeParams = 0;
773
- ExpUpEvent.$isPhantom = [];
774
- return ExpUpEvent;
775
- }());
776
- exports.ExpUpEvent = ExpUpEvent;
777
- /* ============================== LevelUpEvent =============================== */
778
- function isLevelUpEvent(type) {
779
- type = (0, util_1.compressSuiType)(type);
780
- return type === "".concat(index_1.PKG_V3, "::tails_staking::LevelUpEvent");
781
- }
782
- var LevelUpEvent = /** @class */ (function () {
783
- function LevelUpEvent(typeArgs, fields) {
784
- this.__StructClass = true;
785
- this.$typeName = LevelUpEvent.$typeName;
786
- this.$isPhantom = LevelUpEvent.$isPhantom;
787
- this.$fullTypeName = util_1.composeSuiType.apply(void 0, __spreadArray([LevelUpEvent.$typeName], __read(typeArgs), false));
788
- this.$typeArgs = typeArgs;
789
- this.tails = fields.tails;
790
- this.log = fields.log;
791
- this.bcsPadding = fields.bcsPadding;
792
- }
793
- LevelUpEvent.reified = function () {
794
- var _this = this;
795
- return {
796
- typeName: LevelUpEvent.$typeName,
797
- fullTypeName: util_1.composeSuiType.apply(void 0, __spreadArray([LevelUpEvent.$typeName], [], false)),
798
- typeArgs: [],
799
- isPhantom: LevelUpEvent.$isPhantom,
800
- reifiedTypeArgs: [],
801
- fromFields: function (fields) { return LevelUpEvent.fromFields(fields); },
802
- fromFieldsWithTypes: function (item) { return LevelUpEvent.fromFieldsWithTypes(item); },
803
- fromBcs: function (data) { return LevelUpEvent.fromBcs(data); },
804
- bcs: LevelUpEvent.bcs,
805
- fromJSONField: function (field) { return LevelUpEvent.fromJSONField(field); },
806
- fromJSON: function (json) { return LevelUpEvent.fromJSON(json); },
807
- fromSuiParsedData: function (content) { return LevelUpEvent.fromSuiParsedData(content); },
808
- fromSuiObjectData: function (content) { return LevelUpEvent.fromSuiObjectData(content); },
809
- fetch: function (client, id) { return __awaiter(_this, void 0, void 0, function () { return __generator(this, function (_a) {
810
- return [2 /*return*/, LevelUpEvent.fetch(client, id)];
811
- }); }); },
812
- new: function (fields) {
813
- return new LevelUpEvent([], fields);
814
- },
815
- kind: "StructClassReified",
816
- };
817
- };
818
- Object.defineProperty(LevelUpEvent, "r", {
819
- get: function () {
820
- return LevelUpEvent.reified();
821
- },
822
- enumerable: false,
823
- configurable: true
824
- });
825
- LevelUpEvent.phantom = function () {
826
- return (0, reified_1.phantom)(LevelUpEvent.reified());
827
- };
828
- Object.defineProperty(LevelUpEvent, "p", {
829
- get: function () {
830
- return LevelUpEvent.phantom();
831
- },
832
- enumerable: false,
833
- configurable: true
834
- });
835
- Object.defineProperty(LevelUpEvent, "bcs", {
836
- get: function () {
837
- return bcs_1.bcs.struct("LevelUpEvent", {
838
- tails: bcs_1.bcs.bytes(32).transform({ input: function (val) { return (0, utils_1.fromHEX)(val); }, output: function (val) { return (0, utils_1.toHEX)(val); } }),
839
- log: bcs_1.bcs.vector(bcs_1.bcs.u64()),
840
- bcs_padding: bcs_1.bcs.vector(bcs_1.bcs.vector(bcs_1.bcs.u8())),
841
- });
842
- },
843
- enumerable: false,
844
- configurable: true
845
- });
846
- LevelUpEvent.fromFields = function (fields) {
847
- return LevelUpEvent.reified().new({
848
- tails: (0, reified_1.decodeFromFields)("address", fields.tails),
849
- log: (0, reified_1.decodeFromFields)(reified.vector("u64"), fields.log),
850
- bcsPadding: (0, reified_1.decodeFromFields)(reified.vector(reified.vector("u8")), fields.bcs_padding),
851
- });
852
- };
853
- LevelUpEvent.fromFieldsWithTypes = function (item) {
854
- if (!isLevelUpEvent(item.type)) {
855
- throw new Error("not a LevelUpEvent type");
856
- }
857
- return LevelUpEvent.reified().new({
858
- tails: (0, reified_1.decodeFromFieldsWithTypes)("address", item.fields.tails),
859
- log: (0, reified_1.decodeFromFieldsWithTypes)(reified.vector("u64"), item.fields.log),
860
- bcsPadding: (0, reified_1.decodeFromFieldsWithTypes)(reified.vector(reified.vector("u8")), item.fields.bcs_padding),
861
- });
862
- };
863
- LevelUpEvent.fromBcs = function (data) {
864
- return LevelUpEvent.fromFields(LevelUpEvent.bcs.parse(data));
865
- };
866
- LevelUpEvent.prototype.toJSONField = function () {
867
- return {
868
- tails: this.tails,
869
- log: (0, reified_1.fieldToJSON)("vector<u64>", this.log),
870
- bcsPadding: (0, reified_1.fieldToJSON)("vector<vector<u8>>", this.bcsPadding),
871
- };
872
- };
873
- LevelUpEvent.prototype.toJSON = function () {
874
- return __assign({ $typeName: this.$typeName, $typeArgs: this.$typeArgs }, this.toJSONField());
875
- };
876
- LevelUpEvent.fromJSONField = function (field) {
877
- return LevelUpEvent.reified().new({
878
- tails: (0, reified_1.decodeFromJSONField)("address", field.tails),
879
- log: (0, reified_1.decodeFromJSONField)(reified.vector("u64"), field.log),
880
- bcsPadding: (0, reified_1.decodeFromJSONField)(reified.vector(reified.vector("u8")), field.bcsPadding),
881
- });
882
- };
883
- LevelUpEvent.fromJSON = function (json) {
884
- if (json.$typeName !== LevelUpEvent.$typeName) {
885
- throw new Error("not a WithTwoGenerics json object");
886
- }
887
- return LevelUpEvent.fromJSONField(json);
888
- };
889
- LevelUpEvent.fromSuiParsedData = function (content) {
890
- if (content.dataType !== "moveObject") {
891
- throw new Error("not an object");
892
- }
893
- if (!isLevelUpEvent(content.type)) {
894
- throw new Error("object at ".concat(content.fields.id, " is not a LevelUpEvent object"));
895
- }
896
- return LevelUpEvent.fromFieldsWithTypes(content);
897
- };
898
- LevelUpEvent.fromSuiObjectData = function (data) {
899
- if (data.bcs) {
900
- if (data.bcs.dataType !== "moveObject" || !isLevelUpEvent(data.bcs.type)) {
901
- throw new Error("object at is not a LevelUpEvent object");
902
- }
903
- return LevelUpEvent.fromBcs((0, utils_1.fromB64)(data.bcs.bcsBytes));
904
- }
905
- if (data.content) {
906
- return LevelUpEvent.fromSuiParsedData(data.content);
907
- }
908
- throw new Error("Both `bcs` and `content` fields are missing from the data. Include `showBcs` or `showContent` in the request.");
909
- };
910
- LevelUpEvent.fetch = function (client, id) {
911
- return __awaiter(this, void 0, void 0, function () {
912
- var res;
913
- var _a, _b;
914
- return __generator(this, function (_c) {
915
- switch (_c.label) {
916
- case 0: return [4 /*yield*/, client.getObject({ id: id, options: { showBcs: true } })];
917
- case 1:
918
- res = _c.sent();
919
- if (res.error) {
920
- throw new Error("error fetching LevelUpEvent object at id ".concat(id, ": ").concat(res.error.code));
921
- }
922
- if (((_b = (_a = res.data) === null || _a === void 0 ? void 0 : _a.bcs) === null || _b === void 0 ? void 0 : _b.dataType) !== "moveObject" || !isLevelUpEvent(res.data.bcs.type)) {
923
- throw new Error("object at id ".concat(id, " is not a LevelUpEvent object"));
924
- }
925
- return [2 /*return*/, LevelUpEvent.fromSuiObjectData(res.data)];
926
- }
927
- });
928
- });
929
- };
930
- LevelUpEvent.$typeName = "".concat(index_1.PKG_V3, "::tails_staking::LevelUpEvent");
931
- LevelUpEvent.$numTypeParams = 0;
932
- LevelUpEvent.$isPhantom = [];
933
- return LevelUpEvent;
934
- }());
935
- exports.LevelUpEvent = LevelUpEvent;
936
- /* ============================== RemoveProfitSharingEvent =============================== */
937
- function isRemoveProfitSharingEvent(type) {
938
- type = (0, util_1.compressSuiType)(type);
939
- return type === "".concat(index_1.PKG_V3, "::tails_staking::RemoveProfitSharingEvent");
940
- }
941
- var RemoveProfitSharingEvent = /** @class */ (function () {
942
- function RemoveProfitSharingEvent(typeArgs, fields) {
943
- this.__StructClass = true;
944
- this.$typeName = RemoveProfitSharingEvent.$typeName;
945
- this.$isPhantom = RemoveProfitSharingEvent.$isPhantom;
946
- this.$fullTypeName = util_1.composeSuiType.apply(void 0, __spreadArray([RemoveProfitSharingEvent.$typeName], __read(typeArgs), false));
947
- this.$typeArgs = typeArgs;
948
- this.token = fields.token;
949
- this.log = fields.log;
950
- this.bcsPadding = fields.bcsPadding;
951
- }
952
- RemoveProfitSharingEvent.reified = function () {
953
- var _this = this;
954
- return {
955
- typeName: RemoveProfitSharingEvent.$typeName,
956
- fullTypeName: util_1.composeSuiType.apply(void 0, __spreadArray([RemoveProfitSharingEvent.$typeName], [], false)),
957
- typeArgs: [],
958
- isPhantom: RemoveProfitSharingEvent.$isPhantom,
959
- reifiedTypeArgs: [],
960
- fromFields: function (fields) { return RemoveProfitSharingEvent.fromFields(fields); },
961
- fromFieldsWithTypes: function (item) { return RemoveProfitSharingEvent.fromFieldsWithTypes(item); },
962
- fromBcs: function (data) { return RemoveProfitSharingEvent.fromBcs(data); },
963
- bcs: RemoveProfitSharingEvent.bcs,
964
- fromJSONField: function (field) { return RemoveProfitSharingEvent.fromJSONField(field); },
965
- fromJSON: function (json) { return RemoveProfitSharingEvent.fromJSON(json); },
966
- fromSuiParsedData: function (content) { return RemoveProfitSharingEvent.fromSuiParsedData(content); },
967
- fromSuiObjectData: function (content) { return RemoveProfitSharingEvent.fromSuiObjectData(content); },
968
- fetch: function (client, id) { return __awaiter(_this, void 0, void 0, function () { return __generator(this, function (_a) {
969
- return [2 /*return*/, RemoveProfitSharingEvent.fetch(client, id)];
970
- }); }); },
971
- new: function (fields) {
972
- return new RemoveProfitSharingEvent([], fields);
973
- },
974
- kind: "StructClassReified",
975
- };
976
- };
977
- Object.defineProperty(RemoveProfitSharingEvent, "r", {
978
- get: function () {
979
- return RemoveProfitSharingEvent.reified();
980
- },
981
- enumerable: false,
982
- configurable: true
983
- });
984
- RemoveProfitSharingEvent.phantom = function () {
985
- return (0, reified_1.phantom)(RemoveProfitSharingEvent.reified());
986
- };
987
- Object.defineProperty(RemoveProfitSharingEvent, "p", {
988
- get: function () {
989
- return RemoveProfitSharingEvent.phantom();
990
- },
991
- enumerable: false,
992
- configurable: true
993
- });
994
- Object.defineProperty(RemoveProfitSharingEvent, "bcs", {
995
- get: function () {
996
- return bcs_1.bcs.struct("RemoveProfitSharingEvent", {
997
- token: structs_1.TypeName.bcs,
998
- log: bcs_1.bcs.vector(bcs_1.bcs.u64()),
999
- bcs_padding: bcs_1.bcs.vector(bcs_1.bcs.vector(bcs_1.bcs.u8())),
1000
- });
1001
- },
1002
- enumerable: false,
1003
- configurable: true
1004
- });
1005
- RemoveProfitSharingEvent.fromFields = function (fields) {
1006
- return RemoveProfitSharingEvent.reified().new({
1007
- token: (0, reified_1.decodeFromFields)(structs_1.TypeName.reified(), fields.token),
1008
- log: (0, reified_1.decodeFromFields)(reified.vector("u64"), fields.log),
1009
- bcsPadding: (0, reified_1.decodeFromFields)(reified.vector(reified.vector("u8")), fields.bcs_padding),
1010
- });
1011
- };
1012
- RemoveProfitSharingEvent.fromFieldsWithTypes = function (item) {
1013
- if (!isRemoveProfitSharingEvent(item.type)) {
1014
- throw new Error("not a RemoveProfitSharingEvent type");
1015
- }
1016
- return RemoveProfitSharingEvent.reified().new({
1017
- token: (0, reified_1.decodeFromFieldsWithTypes)(structs_1.TypeName.reified(), item.fields.token),
1018
- log: (0, reified_1.decodeFromFieldsWithTypes)(reified.vector("u64"), item.fields.log),
1019
- bcsPadding: (0, reified_1.decodeFromFieldsWithTypes)(reified.vector(reified.vector("u8")), item.fields.bcs_padding),
1020
- });
1021
- };
1022
- RemoveProfitSharingEvent.fromBcs = function (data) {
1023
- return RemoveProfitSharingEvent.fromFields(RemoveProfitSharingEvent.bcs.parse(data));
1024
- };
1025
- RemoveProfitSharingEvent.prototype.toJSONField = function () {
1026
- return {
1027
- token: this.token.toJSONField(),
1028
- log: (0, reified_1.fieldToJSON)("vector<u64>", this.log),
1029
- bcsPadding: (0, reified_1.fieldToJSON)("vector<vector<u8>>", this.bcsPadding),
1030
- };
1031
- };
1032
- RemoveProfitSharingEvent.prototype.toJSON = function () {
1033
- return __assign({ $typeName: this.$typeName, $typeArgs: this.$typeArgs }, this.toJSONField());
1034
- };
1035
- RemoveProfitSharingEvent.fromJSONField = function (field) {
1036
- return RemoveProfitSharingEvent.reified().new({
1037
- token: (0, reified_1.decodeFromJSONField)(structs_1.TypeName.reified(), field.token),
1038
- log: (0, reified_1.decodeFromJSONField)(reified.vector("u64"), field.log),
1039
- bcsPadding: (0, reified_1.decodeFromJSONField)(reified.vector(reified.vector("u8")), field.bcsPadding),
1040
- });
1041
- };
1042
- RemoveProfitSharingEvent.fromJSON = function (json) {
1043
- if (json.$typeName !== RemoveProfitSharingEvent.$typeName) {
1044
- throw new Error("not a WithTwoGenerics json object");
1045
- }
1046
- return RemoveProfitSharingEvent.fromJSONField(json);
1047
- };
1048
- RemoveProfitSharingEvent.fromSuiParsedData = function (content) {
1049
- if (content.dataType !== "moveObject") {
1050
- throw new Error("not an object");
1051
- }
1052
- if (!isRemoveProfitSharingEvent(content.type)) {
1053
- throw new Error("object at ".concat(content.fields.id, " is not a RemoveProfitSharingEvent object"));
1054
- }
1055
- return RemoveProfitSharingEvent.fromFieldsWithTypes(content);
1056
- };
1057
- RemoveProfitSharingEvent.fromSuiObjectData = function (data) {
1058
- if (data.bcs) {
1059
- if (data.bcs.dataType !== "moveObject" || !isRemoveProfitSharingEvent(data.bcs.type)) {
1060
- throw new Error("object at is not a RemoveProfitSharingEvent object");
1061
- }
1062
- return RemoveProfitSharingEvent.fromBcs((0, utils_1.fromB64)(data.bcs.bcsBytes));
1063
- }
1064
- if (data.content) {
1065
- return RemoveProfitSharingEvent.fromSuiParsedData(data.content);
1066
- }
1067
- throw new Error("Both `bcs` and `content` fields are missing from the data. Include `showBcs` or `showContent` in the request.");
1068
- };
1069
- RemoveProfitSharingEvent.fetch = function (client, id) {
1070
- return __awaiter(this, void 0, void 0, function () {
1071
- var res;
1072
- var _a, _b;
1073
- return __generator(this, function (_c) {
1074
- switch (_c.label) {
1075
- case 0: return [4 /*yield*/, client.getObject({ id: id, options: { showBcs: true } })];
1076
- case 1:
1077
- res = _c.sent();
1078
- if (res.error) {
1079
- throw new Error("error fetching RemoveProfitSharingEvent object at id ".concat(id, ": ").concat(res.error.code));
1080
- }
1081
- if (((_b = (_a = res.data) === null || _a === void 0 ? void 0 : _a.bcs) === null || _b === void 0 ? void 0 : _b.dataType) !== "moveObject" || !isRemoveProfitSharingEvent(res.data.bcs.type)) {
1082
- throw new Error("object at id ".concat(id, " is not a RemoveProfitSharingEvent object"));
1083
- }
1084
- return [2 /*return*/, RemoveProfitSharingEvent.fromSuiObjectData(res.data)];
1085
- }
1086
- });
1087
- });
1088
- };
1089
- RemoveProfitSharingEvent.$typeName = "".concat(index_1.PKG_V3, "::tails_staking::RemoveProfitSharingEvent");
1090
- RemoveProfitSharingEvent.$numTypeParams = 0;
1091
- RemoveProfitSharingEvent.$isPhantom = [];
1092
- return RemoveProfitSharingEvent;
1093
- }());
1094
- exports.RemoveProfitSharingEvent = RemoveProfitSharingEvent;
1095
- /* ============================== SetProfitSharingEvent =============================== */
1096
- function isSetProfitSharingEvent(type) {
1097
- type = (0, util_1.compressSuiType)(type);
1098
- return type === "".concat(index_1.PKG_V3, "::tails_staking::SetProfitSharingEvent");
1099
- }
1100
- var SetProfitSharingEvent = /** @class */ (function () {
1101
- function SetProfitSharingEvent(typeArgs, fields) {
1102
- this.__StructClass = true;
1103
- this.$typeName = SetProfitSharingEvent.$typeName;
1104
- this.$isPhantom = SetProfitSharingEvent.$isPhantom;
1105
- this.$fullTypeName = util_1.composeSuiType.apply(void 0, __spreadArray([SetProfitSharingEvent.$typeName], __read(typeArgs), false));
1106
- this.$typeArgs = typeArgs;
1107
- this.token = fields.token;
1108
- this.levelProfits = fields.levelProfits;
1109
- this.levelCounts = fields.levelCounts;
1110
- this.log = fields.log;
1111
- this.bcsPadding = fields.bcsPadding;
1112
- }
1113
- SetProfitSharingEvent.reified = function () {
1114
- var _this = this;
1115
- return {
1116
- typeName: SetProfitSharingEvent.$typeName,
1117
- fullTypeName: util_1.composeSuiType.apply(void 0, __spreadArray([SetProfitSharingEvent.$typeName], [], false)),
1118
- typeArgs: [],
1119
- isPhantom: SetProfitSharingEvent.$isPhantom,
1120
- reifiedTypeArgs: [],
1121
- fromFields: function (fields) { return SetProfitSharingEvent.fromFields(fields); },
1122
- fromFieldsWithTypes: function (item) { return SetProfitSharingEvent.fromFieldsWithTypes(item); },
1123
- fromBcs: function (data) { return SetProfitSharingEvent.fromBcs(data); },
1124
- bcs: SetProfitSharingEvent.bcs,
1125
- fromJSONField: function (field) { return SetProfitSharingEvent.fromJSONField(field); },
1126
- fromJSON: function (json) { return SetProfitSharingEvent.fromJSON(json); },
1127
- fromSuiParsedData: function (content) { return SetProfitSharingEvent.fromSuiParsedData(content); },
1128
- fromSuiObjectData: function (content) { return SetProfitSharingEvent.fromSuiObjectData(content); },
1129
- fetch: function (client, id) { return __awaiter(_this, void 0, void 0, function () { return __generator(this, function (_a) {
1130
- return [2 /*return*/, SetProfitSharingEvent.fetch(client, id)];
1131
- }); }); },
1132
- new: function (fields) {
1133
- return new SetProfitSharingEvent([], fields);
1134
- },
1135
- kind: "StructClassReified",
1136
- };
1137
- };
1138
- Object.defineProperty(SetProfitSharingEvent, "r", {
1139
- get: function () {
1140
- return SetProfitSharingEvent.reified();
1141
- },
1142
- enumerable: false,
1143
- configurable: true
1144
- });
1145
- SetProfitSharingEvent.phantom = function () {
1146
- return (0, reified_1.phantom)(SetProfitSharingEvent.reified());
1147
- };
1148
- Object.defineProperty(SetProfitSharingEvent, "p", {
1149
- get: function () {
1150
- return SetProfitSharingEvent.phantom();
1151
- },
1152
- enumerable: false,
1153
- configurable: true
1154
- });
1155
- Object.defineProperty(SetProfitSharingEvent, "bcs", {
1156
- get: function () {
1157
- return bcs_1.bcs.struct("SetProfitSharingEvent", {
1158
- token: structs_1.TypeName.bcs,
1159
- level_profits: bcs_1.bcs.vector(bcs_1.bcs.u64()),
1160
- level_counts: bcs_1.bcs.vector(bcs_1.bcs.u64()),
1161
- log: bcs_1.bcs.vector(bcs_1.bcs.u64()),
1162
- bcs_padding: bcs_1.bcs.vector(bcs_1.bcs.vector(bcs_1.bcs.u8())),
1163
- });
1164
- },
1165
- enumerable: false,
1166
- configurable: true
1167
- });
1168
- SetProfitSharingEvent.fromFields = function (fields) {
1169
- return SetProfitSharingEvent.reified().new({
1170
- token: (0, reified_1.decodeFromFields)(structs_1.TypeName.reified(), fields.token),
1171
- levelProfits: (0, reified_1.decodeFromFields)(reified.vector("u64"), fields.level_profits),
1172
- levelCounts: (0, reified_1.decodeFromFields)(reified.vector("u64"), fields.level_counts),
1173
- log: (0, reified_1.decodeFromFields)(reified.vector("u64"), fields.log),
1174
- bcsPadding: (0, reified_1.decodeFromFields)(reified.vector(reified.vector("u8")), fields.bcs_padding),
1175
- });
1176
- };
1177
- SetProfitSharingEvent.fromFieldsWithTypes = function (item) {
1178
- if (!isSetProfitSharingEvent(item.type)) {
1179
- throw new Error("not a SetProfitSharingEvent type");
1180
- }
1181
- return SetProfitSharingEvent.reified().new({
1182
- token: (0, reified_1.decodeFromFieldsWithTypes)(structs_1.TypeName.reified(), item.fields.token),
1183
- levelProfits: (0, reified_1.decodeFromFieldsWithTypes)(reified.vector("u64"), item.fields.level_profits),
1184
- levelCounts: (0, reified_1.decodeFromFieldsWithTypes)(reified.vector("u64"), item.fields.level_counts),
1185
- log: (0, reified_1.decodeFromFieldsWithTypes)(reified.vector("u64"), item.fields.log),
1186
- bcsPadding: (0, reified_1.decodeFromFieldsWithTypes)(reified.vector(reified.vector("u8")), item.fields.bcs_padding),
1187
- });
1188
- };
1189
- SetProfitSharingEvent.fromBcs = function (data) {
1190
- return SetProfitSharingEvent.fromFields(SetProfitSharingEvent.bcs.parse(data));
1191
- };
1192
- SetProfitSharingEvent.prototype.toJSONField = function () {
1193
- return {
1194
- token: this.token.toJSONField(),
1195
- levelProfits: (0, reified_1.fieldToJSON)("vector<u64>", this.levelProfits),
1196
- levelCounts: (0, reified_1.fieldToJSON)("vector<u64>", this.levelCounts),
1197
- log: (0, reified_1.fieldToJSON)("vector<u64>", this.log),
1198
- bcsPadding: (0, reified_1.fieldToJSON)("vector<vector<u8>>", this.bcsPadding),
1199
- };
1200
- };
1201
- SetProfitSharingEvent.prototype.toJSON = function () {
1202
- return __assign({ $typeName: this.$typeName, $typeArgs: this.$typeArgs }, this.toJSONField());
1203
- };
1204
- SetProfitSharingEvent.fromJSONField = function (field) {
1205
- return SetProfitSharingEvent.reified().new({
1206
- token: (0, reified_1.decodeFromJSONField)(structs_1.TypeName.reified(), field.token),
1207
- levelProfits: (0, reified_1.decodeFromJSONField)(reified.vector("u64"), field.levelProfits),
1208
- levelCounts: (0, reified_1.decodeFromJSONField)(reified.vector("u64"), field.levelCounts),
1209
- log: (0, reified_1.decodeFromJSONField)(reified.vector("u64"), field.log),
1210
- bcsPadding: (0, reified_1.decodeFromJSONField)(reified.vector(reified.vector("u8")), field.bcsPadding),
1211
- });
1212
- };
1213
- SetProfitSharingEvent.fromJSON = function (json) {
1214
- if (json.$typeName !== SetProfitSharingEvent.$typeName) {
1215
- throw new Error("not a WithTwoGenerics json object");
1216
- }
1217
- return SetProfitSharingEvent.fromJSONField(json);
1218
- };
1219
- SetProfitSharingEvent.fromSuiParsedData = function (content) {
1220
- if (content.dataType !== "moveObject") {
1221
- throw new Error("not an object");
1222
- }
1223
- if (!isSetProfitSharingEvent(content.type)) {
1224
- throw new Error("object at ".concat(content.fields.id, " is not a SetProfitSharingEvent object"));
1225
- }
1226
- return SetProfitSharingEvent.fromFieldsWithTypes(content);
1227
- };
1228
- SetProfitSharingEvent.fromSuiObjectData = function (data) {
1229
- if (data.bcs) {
1230
- if (data.bcs.dataType !== "moveObject" || !isSetProfitSharingEvent(data.bcs.type)) {
1231
- throw new Error("object at is not a SetProfitSharingEvent object");
1232
- }
1233
- return SetProfitSharingEvent.fromBcs((0, utils_1.fromB64)(data.bcs.bcsBytes));
1234
- }
1235
- if (data.content) {
1236
- return SetProfitSharingEvent.fromSuiParsedData(data.content);
1237
- }
1238
- throw new Error("Both `bcs` and `content` fields are missing from the data. Include `showBcs` or `showContent` in the request.");
1239
- };
1240
- SetProfitSharingEvent.fetch = function (client, id) {
1241
- return __awaiter(this, void 0, void 0, function () {
1242
- var res;
1243
- var _a, _b;
1244
- return __generator(this, function (_c) {
1245
- switch (_c.label) {
1246
- case 0: return [4 /*yield*/, client.getObject({ id: id, options: { showBcs: true } })];
1247
- case 1:
1248
- res = _c.sent();
1249
- if (res.error) {
1250
- throw new Error("error fetching SetProfitSharingEvent object at id ".concat(id, ": ").concat(res.error.code));
1251
- }
1252
- if (((_b = (_a = res.data) === null || _a === void 0 ? void 0 : _a.bcs) === null || _b === void 0 ? void 0 : _b.dataType) !== "moveObject" || !isSetProfitSharingEvent(res.data.bcs.type)) {
1253
- throw new Error("object at id ".concat(id, " is not a SetProfitSharingEvent object"));
1254
- }
1255
- return [2 /*return*/, SetProfitSharingEvent.fromSuiObjectData(res.data)];
1256
- }
1257
- });
1258
- });
1259
- };
1260
- SetProfitSharingEvent.$typeName = "".concat(index_1.PKG_V3, "::tails_staking::SetProfitSharingEvent");
1261
- SetProfitSharingEvent.$numTypeParams = 0;
1262
- SetProfitSharingEvent.$isPhantom = [];
1263
- return SetProfitSharingEvent;
1264
- }());
1265
- exports.SetProfitSharingEvent = SetProfitSharingEvent;
1266
- /* ============================== StakeTailsEvent =============================== */
1267
- function isStakeTailsEvent(type) {
1268
- type = (0, util_1.compressSuiType)(type);
1269
- return type === "".concat(index_1.PKG_V3, "::tails_staking::StakeTailsEvent");
1270
- }
1271
- var StakeTailsEvent = /** @class */ (function () {
1272
- function StakeTailsEvent(typeArgs, fields) {
1273
- this.__StructClass = true;
1274
- this.$typeName = StakeTailsEvent.$typeName;
1275
- this.$isPhantom = StakeTailsEvent.$isPhantom;
1276
- this.$fullTypeName = util_1.composeSuiType.apply(void 0, __spreadArray([StakeTailsEvent.$typeName], __read(typeArgs), false));
1277
- this.$typeArgs = typeArgs;
1278
- this.tails = fields.tails;
1279
- this.log = fields.log;
1280
- this.bcsPadding = fields.bcsPadding;
1281
- }
1282
- StakeTailsEvent.reified = function () {
1283
- var _this = this;
1284
- return {
1285
- typeName: StakeTailsEvent.$typeName,
1286
- fullTypeName: util_1.composeSuiType.apply(void 0, __spreadArray([StakeTailsEvent.$typeName], [], false)),
1287
- typeArgs: [],
1288
- isPhantom: StakeTailsEvent.$isPhantom,
1289
- reifiedTypeArgs: [],
1290
- fromFields: function (fields) { return StakeTailsEvent.fromFields(fields); },
1291
- fromFieldsWithTypes: function (item) { return StakeTailsEvent.fromFieldsWithTypes(item); },
1292
- fromBcs: function (data) { return StakeTailsEvent.fromBcs(data); },
1293
- bcs: StakeTailsEvent.bcs,
1294
- fromJSONField: function (field) { return StakeTailsEvent.fromJSONField(field); },
1295
- fromJSON: function (json) { return StakeTailsEvent.fromJSON(json); },
1296
- fromSuiParsedData: function (content) { return StakeTailsEvent.fromSuiParsedData(content); },
1297
- fromSuiObjectData: function (content) { return StakeTailsEvent.fromSuiObjectData(content); },
1298
- fetch: function (client, id) { return __awaiter(_this, void 0, void 0, function () { return __generator(this, function (_a) {
1299
- return [2 /*return*/, StakeTailsEvent.fetch(client, id)];
1300
- }); }); },
1301
- new: function (fields) {
1302
- return new StakeTailsEvent([], fields);
1303
- },
1304
- kind: "StructClassReified",
1305
- };
1306
- };
1307
- Object.defineProperty(StakeTailsEvent, "r", {
1308
- get: function () {
1309
- return StakeTailsEvent.reified();
1310
- },
1311
- enumerable: false,
1312
- configurable: true
1313
- });
1314
- StakeTailsEvent.phantom = function () {
1315
- return (0, reified_1.phantom)(StakeTailsEvent.reified());
1316
- };
1317
- Object.defineProperty(StakeTailsEvent, "p", {
1318
- get: function () {
1319
- return StakeTailsEvent.phantom();
1320
- },
1321
- enumerable: false,
1322
- configurable: true
1323
- });
1324
- Object.defineProperty(StakeTailsEvent, "bcs", {
1325
- get: function () {
1326
- return bcs_1.bcs.struct("StakeTailsEvent", {
1327
- tails: bcs_1.bcs.bytes(32).transform({ input: function (val) { return (0, utils_1.fromHEX)(val); }, output: function (val) { return (0, utils_1.toHEX)(val); } }),
1328
- log: bcs_1.bcs.vector(bcs_1.bcs.u64()),
1329
- bcs_padding: bcs_1.bcs.vector(bcs_1.bcs.vector(bcs_1.bcs.u8())),
1330
- });
1331
- },
1332
- enumerable: false,
1333
- configurable: true
1334
- });
1335
- StakeTailsEvent.fromFields = function (fields) {
1336
- return StakeTailsEvent.reified().new({
1337
- tails: (0, reified_1.decodeFromFields)("address", fields.tails),
1338
- log: (0, reified_1.decodeFromFields)(reified.vector("u64"), fields.log),
1339
- bcsPadding: (0, reified_1.decodeFromFields)(reified.vector(reified.vector("u8")), fields.bcs_padding),
1340
- });
1341
- };
1342
- StakeTailsEvent.fromFieldsWithTypes = function (item) {
1343
- if (!isStakeTailsEvent(item.type)) {
1344
- throw new Error("not a StakeTailsEvent type");
1345
- }
1346
- return StakeTailsEvent.reified().new({
1347
- tails: (0, reified_1.decodeFromFieldsWithTypes)("address", item.fields.tails),
1348
- log: (0, reified_1.decodeFromFieldsWithTypes)(reified.vector("u64"), item.fields.log),
1349
- bcsPadding: (0, reified_1.decodeFromFieldsWithTypes)(reified.vector(reified.vector("u8")), item.fields.bcs_padding),
1350
- });
1351
- };
1352
- StakeTailsEvent.fromBcs = function (data) {
1353
- return StakeTailsEvent.fromFields(StakeTailsEvent.bcs.parse(data));
1354
- };
1355
- StakeTailsEvent.prototype.toJSONField = function () {
1356
- return {
1357
- tails: this.tails,
1358
- log: (0, reified_1.fieldToJSON)("vector<u64>", this.log),
1359
- bcsPadding: (0, reified_1.fieldToJSON)("vector<vector<u8>>", this.bcsPadding),
1360
- };
1361
- };
1362
- StakeTailsEvent.prototype.toJSON = function () {
1363
- return __assign({ $typeName: this.$typeName, $typeArgs: this.$typeArgs }, this.toJSONField());
1364
- };
1365
- StakeTailsEvent.fromJSONField = function (field) {
1366
- return StakeTailsEvent.reified().new({
1367
- tails: (0, reified_1.decodeFromJSONField)("address", field.tails),
1368
- log: (0, reified_1.decodeFromJSONField)(reified.vector("u64"), field.log),
1369
- bcsPadding: (0, reified_1.decodeFromJSONField)(reified.vector(reified.vector("u8")), field.bcsPadding),
1370
- });
1371
- };
1372
- StakeTailsEvent.fromJSON = function (json) {
1373
- if (json.$typeName !== StakeTailsEvent.$typeName) {
1374
- throw new Error("not a WithTwoGenerics json object");
1375
- }
1376
- return StakeTailsEvent.fromJSONField(json);
1377
- };
1378
- StakeTailsEvent.fromSuiParsedData = function (content) {
1379
- if (content.dataType !== "moveObject") {
1380
- throw new Error("not an object");
1381
- }
1382
- if (!isStakeTailsEvent(content.type)) {
1383
- throw new Error("object at ".concat(content.fields.id, " is not a StakeTailsEvent object"));
1384
- }
1385
- return StakeTailsEvent.fromFieldsWithTypes(content);
1386
- };
1387
- StakeTailsEvent.fromSuiObjectData = function (data) {
1388
- if (data.bcs) {
1389
- if (data.bcs.dataType !== "moveObject" || !isStakeTailsEvent(data.bcs.type)) {
1390
- throw new Error("object at is not a StakeTailsEvent object");
1391
- }
1392
- return StakeTailsEvent.fromBcs((0, utils_1.fromB64)(data.bcs.bcsBytes));
1393
- }
1394
- if (data.content) {
1395
- return StakeTailsEvent.fromSuiParsedData(data.content);
1396
- }
1397
- throw new Error("Both `bcs` and `content` fields are missing from the data. Include `showBcs` or `showContent` in the request.");
1398
- };
1399
- StakeTailsEvent.fetch = function (client, id) {
1400
- return __awaiter(this, void 0, void 0, function () {
1401
- var res;
1402
- var _a, _b;
1403
- return __generator(this, function (_c) {
1404
- switch (_c.label) {
1405
- case 0: return [4 /*yield*/, client.getObject({ id: id, options: { showBcs: true } })];
1406
- case 1:
1407
- res = _c.sent();
1408
- if (res.error) {
1409
- throw new Error("error fetching StakeTailsEvent object at id ".concat(id, ": ").concat(res.error.code));
1410
- }
1411
- if (((_b = (_a = res.data) === null || _a === void 0 ? void 0 : _a.bcs) === null || _b === void 0 ? void 0 : _b.dataType) !== "moveObject" || !isStakeTailsEvent(res.data.bcs.type)) {
1412
- throw new Error("object at id ".concat(id, " is not a StakeTailsEvent object"));
1413
- }
1414
- return [2 /*return*/, StakeTailsEvent.fromSuiObjectData(res.data)];
1415
- }
1416
- });
1417
- });
1418
- };
1419
- StakeTailsEvent.$typeName = "".concat(index_1.PKG_V3, "::tails_staking::StakeTailsEvent");
1420
- StakeTailsEvent.$numTypeParams = 0;
1421
- StakeTailsEvent.$isPhantom = [];
1422
- return StakeTailsEvent;
1423
- }());
1424
- exports.StakeTailsEvent = StakeTailsEvent;
1425
- /* ============================== StakingInfo =============================== */
1426
- function isStakingInfo(type) {
1427
- type = (0, util_1.compressSuiType)(type);
1428
- return type === "".concat(index_1.PKG_V3, "::tails_staking::StakingInfo");
1429
- }
1430
- var StakingInfo = /** @class */ (function () {
1431
- function StakingInfo(typeArgs, fields) {
1432
- this.__StructClass = true;
1433
- this.$typeName = StakingInfo.$typeName;
1434
- this.$isPhantom = StakingInfo.$isPhantom;
1435
- this.$fullTypeName = util_1.composeSuiType.apply(void 0, __spreadArray([StakingInfo.$typeName], __read(typeArgs), false));
1436
- this.$typeArgs = typeArgs;
1437
- this.user = fields.user;
1438
- this.tails = fields.tails;
1439
- this.profits = fields.profits;
1440
- this.u64Padding = fields.u64Padding;
1441
- }
1442
- StakingInfo.reified = function () {
1443
- var _this = this;
1444
- return {
1445
- typeName: StakingInfo.$typeName,
1446
- fullTypeName: util_1.composeSuiType.apply(void 0, __spreadArray([StakingInfo.$typeName], [], false)),
1447
- typeArgs: [],
1448
- isPhantom: StakingInfo.$isPhantom,
1449
- reifiedTypeArgs: [],
1450
- fromFields: function (fields) { return StakingInfo.fromFields(fields); },
1451
- fromFieldsWithTypes: function (item) { return StakingInfo.fromFieldsWithTypes(item); },
1452
- fromBcs: function (data) { return StakingInfo.fromBcs(data); },
1453
- bcs: StakingInfo.bcs,
1454
- fromJSONField: function (field) { return StakingInfo.fromJSONField(field); },
1455
- fromJSON: function (json) { return StakingInfo.fromJSON(json); },
1456
- fromSuiParsedData: function (content) { return StakingInfo.fromSuiParsedData(content); },
1457
- fromSuiObjectData: function (content) { return StakingInfo.fromSuiObjectData(content); },
1458
- fetch: function (client, id) { return __awaiter(_this, void 0, void 0, function () { return __generator(this, function (_a) {
1459
- return [2 /*return*/, StakingInfo.fetch(client, id)];
1460
- }); }); },
1461
- new: function (fields) {
1462
- return new StakingInfo([], fields);
1463
- },
1464
- kind: "StructClassReified",
1465
- };
1466
- };
1467
- Object.defineProperty(StakingInfo, "r", {
1468
- get: function () {
1469
- return StakingInfo.reified();
1470
- },
1471
- enumerable: false,
1472
- configurable: true
1473
- });
1474
- StakingInfo.phantom = function () {
1475
- return (0, reified_1.phantom)(StakingInfo.reified());
1476
- };
1477
- Object.defineProperty(StakingInfo, "p", {
1478
- get: function () {
1479
- return StakingInfo.phantom();
1480
- },
1481
- enumerable: false,
1482
- configurable: true
1483
- });
1484
- Object.defineProperty(StakingInfo, "bcs", {
1485
- get: function () {
1486
- return bcs_1.bcs.struct("StakingInfo", {
1487
- user: bcs_1.bcs.bytes(32).transform({ input: function (val) { return (0, utils_1.fromHEX)(val); }, output: function (val) { return (0, utils_1.toHEX)(val); } }),
1488
- tails: bcs_1.bcs.vector(bcs_1.bcs.u64()),
1489
- profits: bcs_1.bcs.vector(bcs_1.bcs.u64()),
1490
- u64_padding: bcs_1.bcs.vector(bcs_1.bcs.u64()),
1491
- });
1492
- },
1493
- enumerable: false,
1494
- configurable: true
1495
- });
1496
- StakingInfo.fromFields = function (fields) {
1497
- return StakingInfo.reified().new({
1498
- user: (0, reified_1.decodeFromFields)("address", fields.user),
1499
- tails: (0, reified_1.decodeFromFields)(reified.vector("u64"), fields.tails),
1500
- profits: (0, reified_1.decodeFromFields)(reified.vector("u64"), fields.profits),
1501
- u64Padding: (0, reified_1.decodeFromFields)(reified.vector("u64"), fields.u64_padding),
1502
- });
1503
- };
1504
- StakingInfo.fromFieldsWithTypes = function (item) {
1505
- if (!isStakingInfo(item.type)) {
1506
- throw new Error("not a StakingInfo type");
1507
- }
1508
- return StakingInfo.reified().new({
1509
- user: (0, reified_1.decodeFromFieldsWithTypes)("address", item.fields.user),
1510
- tails: (0, reified_1.decodeFromFieldsWithTypes)(reified.vector("u64"), item.fields.tails),
1511
- profits: (0, reified_1.decodeFromFieldsWithTypes)(reified.vector("u64"), item.fields.profits),
1512
- u64Padding: (0, reified_1.decodeFromFieldsWithTypes)(reified.vector("u64"), item.fields.u64_padding),
1513
- });
1514
- };
1515
- StakingInfo.fromBcs = function (data) {
1516
- return StakingInfo.fromFields(StakingInfo.bcs.parse(data));
1517
- };
1518
- StakingInfo.prototype.toJSONField = function () {
1519
- return {
1520
- user: this.user,
1521
- tails: (0, reified_1.fieldToJSON)("vector<u64>", this.tails),
1522
- profits: (0, reified_1.fieldToJSON)("vector<u64>", this.profits),
1523
- u64Padding: (0, reified_1.fieldToJSON)("vector<u64>", this.u64Padding),
1524
- };
1525
- };
1526
- StakingInfo.prototype.toJSON = function () {
1527
- return __assign({ $typeName: this.$typeName, $typeArgs: this.$typeArgs }, this.toJSONField());
1528
- };
1529
- StakingInfo.fromJSONField = function (field) {
1530
- return StakingInfo.reified().new({
1531
- user: (0, reified_1.decodeFromJSONField)("address", field.user),
1532
- tails: (0, reified_1.decodeFromJSONField)(reified.vector("u64"), field.tails),
1533
- profits: (0, reified_1.decodeFromJSONField)(reified.vector("u64"), field.profits),
1534
- u64Padding: (0, reified_1.decodeFromJSONField)(reified.vector("u64"), field.u64Padding),
1535
- });
1536
- };
1537
- StakingInfo.fromJSON = function (json) {
1538
- if (json.$typeName !== StakingInfo.$typeName) {
1539
- throw new Error("not a WithTwoGenerics json object");
1540
- }
1541
- return StakingInfo.fromJSONField(json);
1542
- };
1543
- StakingInfo.fromSuiParsedData = function (content) {
1544
- if (content.dataType !== "moveObject") {
1545
- throw new Error("not an object");
1546
- }
1547
- if (!isStakingInfo(content.type)) {
1548
- throw new Error("object at ".concat(content.fields.id, " is not a StakingInfo object"));
1549
- }
1550
- return StakingInfo.fromFieldsWithTypes(content);
1551
- };
1552
- StakingInfo.fromSuiObjectData = function (data) {
1553
- if (data.bcs) {
1554
- if (data.bcs.dataType !== "moveObject" || !isStakingInfo(data.bcs.type)) {
1555
- throw new Error("object at is not a StakingInfo object");
1556
- }
1557
- return StakingInfo.fromBcs((0, utils_1.fromB64)(data.bcs.bcsBytes));
1558
- }
1559
- if (data.content) {
1560
- return StakingInfo.fromSuiParsedData(data.content);
1561
- }
1562
- throw new Error("Both `bcs` and `content` fields are missing from the data. Include `showBcs` or `showContent` in the request.");
1563
- };
1564
- StakingInfo.fetch = function (client, id) {
1565
- return __awaiter(this, void 0, void 0, function () {
1566
- var res;
1567
- var _a, _b;
1568
- return __generator(this, function (_c) {
1569
- switch (_c.label) {
1570
- case 0: return [4 /*yield*/, client.getObject({ id: id, options: { showBcs: true } })];
1571
- case 1:
1572
- res = _c.sent();
1573
- if (res.error) {
1574
- throw new Error("error fetching StakingInfo object at id ".concat(id, ": ").concat(res.error.code));
1575
- }
1576
- if (((_b = (_a = res.data) === null || _a === void 0 ? void 0 : _a.bcs) === null || _b === void 0 ? void 0 : _b.dataType) !== "moveObject" || !isStakingInfo(res.data.bcs.type)) {
1577
- throw new Error("object at id ".concat(id, " is not a StakingInfo object"));
1578
- }
1579
- return [2 /*return*/, StakingInfo.fromSuiObjectData(res.data)];
1580
- }
1581
- });
1582
- });
1583
- };
1584
- StakingInfo.$typeName = "".concat(index_1.PKG_V3, "::tails_staking::StakingInfo");
1585
- StakingInfo.$numTypeParams = 0;
1586
- StakingInfo.$isPhantom = [];
1587
- return StakingInfo;
1588
- }());
1589
- exports.StakingInfo = StakingInfo;
1590
- /* ============================== TailsStakingRegistry =============================== */
1591
- function isTailsStakingRegistry(type) {
1592
- type = (0, util_1.compressSuiType)(type);
1593
- return type === "".concat(index_1.PKG_V3, "::tails_staking::TailsStakingRegistry");
1594
- }
1595
- var TailsStakingRegistry = /** @class */ (function () {
1596
- function TailsStakingRegistry(typeArgs, fields) {
1597
- this.__StructClass = true;
1598
- this.$typeName = TailsStakingRegistry.$typeName;
1599
- this.$isPhantom = TailsStakingRegistry.$isPhantom;
1600
- this.$fullTypeName = util_1.composeSuiType.apply(void 0, __spreadArray([TailsStakingRegistry.$typeName], __read(typeArgs), false));
1601
- this.$typeArgs = typeArgs;
1602
- this.id = fields.id;
1603
- this.config = fields.config;
1604
- this.tailsManagerCap = fields.tailsManagerCap;
1605
- this.tails = fields.tails;
1606
- this.tailsMetadata = fields.tailsMetadata;
1607
- this.stakingInfos = fields.stakingInfos;
1608
- this.profitAssets = fields.profitAssets;
1609
- this.transferPolicy = fields.transferPolicy;
1610
- }
1611
- TailsStakingRegistry.reified = function () {
1612
- var _this = this;
1613
- return {
1614
- typeName: TailsStakingRegistry.$typeName,
1615
- fullTypeName: util_1.composeSuiType.apply(void 0, __spreadArray([TailsStakingRegistry.$typeName], [], false)),
1616
- typeArgs: [],
1617
- isPhantom: TailsStakingRegistry.$isPhantom,
1618
- reifiedTypeArgs: [],
1619
- fromFields: function (fields) { return TailsStakingRegistry.fromFields(fields); },
1620
- fromFieldsWithTypes: function (item) { return TailsStakingRegistry.fromFieldsWithTypes(item); },
1621
- fromBcs: function (data) { return TailsStakingRegistry.fromBcs(data); },
1622
- bcs: TailsStakingRegistry.bcs,
1623
- fromJSONField: function (field) { return TailsStakingRegistry.fromJSONField(field); },
1624
- fromJSON: function (json) { return TailsStakingRegistry.fromJSON(json); },
1625
- fromSuiParsedData: function (content) { return TailsStakingRegistry.fromSuiParsedData(content); },
1626
- fromSuiObjectData: function (content) { return TailsStakingRegistry.fromSuiObjectData(content); },
1627
- fetch: function (client, id) { return __awaiter(_this, void 0, void 0, function () { return __generator(this, function (_a) {
1628
- return [2 /*return*/, TailsStakingRegistry.fetch(client, id)];
1629
- }); }); },
1630
- new: function (fields) {
1631
- return new TailsStakingRegistry([], fields);
1632
- },
1633
- kind: "StructClassReified",
1634
- };
1635
- };
1636
- Object.defineProperty(TailsStakingRegistry, "r", {
1637
- get: function () {
1638
- return TailsStakingRegistry.reified();
1639
- },
1640
- enumerable: false,
1641
- configurable: true
1642
- });
1643
- TailsStakingRegistry.phantom = function () {
1644
- return (0, reified_1.phantom)(TailsStakingRegistry.reified());
1645
- };
1646
- Object.defineProperty(TailsStakingRegistry, "p", {
1647
- get: function () {
1648
- return TailsStakingRegistry.phantom();
1649
- },
1650
- enumerable: false,
1651
- configurable: true
1652
- });
1653
- Object.defineProperty(TailsStakingRegistry, "bcs", {
1654
- get: function () {
1655
- return bcs_1.bcs.struct("TailsStakingRegistry", {
1656
- id: structs_4.UID.bcs,
1657
- config: bcs_1.bcs.vector(bcs_1.bcs.u64()),
1658
- tails_manager_cap: structs_6.ManagerCap.bcs,
1659
- tails: structs_3.ObjectTable.bcs,
1660
- tails_metadata: structs_2.Bag.bcs,
1661
- staking_infos: structs_7.BigVector.bcs,
1662
- profit_assets: bcs_1.bcs.vector(structs_1.TypeName.bcs),
1663
- transfer_policy: structs_5.TransferPolicy.bcs,
1664
- });
1665
- },
1666
- enumerable: false,
1667
- configurable: true
1668
- });
1669
- TailsStakingRegistry.fromFields = function (fields) {
1670
- return TailsStakingRegistry.reified().new({
1671
- id: (0, reified_1.decodeFromFields)(structs_4.UID.reified(), fields.id),
1672
- config: (0, reified_1.decodeFromFields)(reified.vector("u64"), fields.config),
1673
- tailsManagerCap: (0, reified_1.decodeFromFields)(structs_6.ManagerCap.reified(), fields.tails_manager_cap),
1674
- tails: (0, reified_1.decodeFromFields)(structs_3.ObjectTable.reified(reified.phantom("address"), reified.phantom(structs_6.Tails.reified())), fields.tails),
1675
- tailsMetadata: (0, reified_1.decodeFromFields)(structs_2.Bag.reified(), fields.tails_metadata),
1676
- stakingInfos: (0, reified_1.decodeFromFields)(structs_7.BigVector.reified(), fields.staking_infos),
1677
- profitAssets: (0, reified_1.decodeFromFields)(reified.vector(structs_1.TypeName.reified()), fields.profit_assets),
1678
- transferPolicy: (0, reified_1.decodeFromFields)(structs_5.TransferPolicy.reified(reified.phantom(structs_6.Tails.reified())), fields.transfer_policy),
1679
- });
1680
- };
1681
- TailsStakingRegistry.fromFieldsWithTypes = function (item) {
1682
- if (!isTailsStakingRegistry(item.type)) {
1683
- throw new Error("not a TailsStakingRegistry type");
1684
- }
1685
- return TailsStakingRegistry.reified().new({
1686
- id: (0, reified_1.decodeFromFieldsWithTypes)(structs_4.UID.reified(), item.fields.id),
1687
- config: (0, reified_1.decodeFromFieldsWithTypes)(reified.vector("u64"), item.fields.config),
1688
- tailsManagerCap: (0, reified_1.decodeFromFieldsWithTypes)(structs_6.ManagerCap.reified(), item.fields.tails_manager_cap),
1689
- tails: (0, reified_1.decodeFromFieldsWithTypes)(structs_3.ObjectTable.reified(reified.phantom("address"), reified.phantom(structs_6.Tails.reified())), item.fields.tails),
1690
- tailsMetadata: (0, reified_1.decodeFromFieldsWithTypes)(structs_2.Bag.reified(), item.fields.tails_metadata),
1691
- stakingInfos: (0, reified_1.decodeFromFieldsWithTypes)(structs_7.BigVector.reified(), item.fields.staking_infos),
1692
- profitAssets: (0, reified_1.decodeFromFieldsWithTypes)(reified.vector(structs_1.TypeName.reified()), item.fields.profit_assets),
1693
- transferPolicy: (0, reified_1.decodeFromFieldsWithTypes)(structs_5.TransferPolicy.reified(reified.phantom(structs_6.Tails.reified())), item.fields.transfer_policy),
1694
- });
1695
- };
1696
- TailsStakingRegistry.fromBcs = function (data) {
1697
- return TailsStakingRegistry.fromFields(TailsStakingRegistry.bcs.parse(data));
1698
- };
1699
- TailsStakingRegistry.prototype.toJSONField = function () {
1700
- return {
1701
- id: this.id,
1702
- config: (0, reified_1.fieldToJSON)("vector<u64>", this.config),
1703
- tailsManagerCap: this.tailsManagerCap.toJSONField(),
1704
- tails: this.tails.toJSONField(),
1705
- tailsMetadata: this.tailsMetadata.toJSONField(),
1706
- stakingInfos: this.stakingInfos.toJSONField(),
1707
- profitAssets: (0, reified_1.fieldToJSON)("vector<".concat(structs_1.TypeName.$typeName, ">"), this.profitAssets),
1708
- transferPolicy: this.transferPolicy.toJSONField(),
1709
- };
1710
- };
1711
- TailsStakingRegistry.prototype.toJSON = function () {
1712
- return __assign({ $typeName: this.$typeName, $typeArgs: this.$typeArgs }, this.toJSONField());
1713
- };
1714
- TailsStakingRegistry.fromJSONField = function (field) {
1715
- return TailsStakingRegistry.reified().new({
1716
- id: (0, reified_1.decodeFromJSONField)(structs_4.UID.reified(), field.id),
1717
- config: (0, reified_1.decodeFromJSONField)(reified.vector("u64"), field.config),
1718
- tailsManagerCap: (0, reified_1.decodeFromJSONField)(structs_6.ManagerCap.reified(), field.tailsManagerCap),
1719
- tails: (0, reified_1.decodeFromJSONField)(structs_3.ObjectTable.reified(reified.phantom("address"), reified.phantom(structs_6.Tails.reified())), field.tails),
1720
- tailsMetadata: (0, reified_1.decodeFromJSONField)(structs_2.Bag.reified(), field.tailsMetadata),
1721
- stakingInfos: (0, reified_1.decodeFromJSONField)(structs_7.BigVector.reified(), field.stakingInfos),
1722
- profitAssets: (0, reified_1.decodeFromJSONField)(reified.vector(structs_1.TypeName.reified()), field.profitAssets),
1723
- transferPolicy: (0, reified_1.decodeFromJSONField)(structs_5.TransferPolicy.reified(reified.phantom(structs_6.Tails.reified())), field.transferPolicy),
1724
- });
1725
- };
1726
- TailsStakingRegistry.fromJSON = function (json) {
1727
- if (json.$typeName !== TailsStakingRegistry.$typeName) {
1728
- throw new Error("not a WithTwoGenerics json object");
1729
- }
1730
- return TailsStakingRegistry.fromJSONField(json);
1731
- };
1732
- TailsStakingRegistry.fromSuiParsedData = function (content) {
1733
- if (content.dataType !== "moveObject") {
1734
- throw new Error("not an object");
1735
- }
1736
- if (!isTailsStakingRegistry(content.type)) {
1737
- throw new Error("object at ".concat(content.fields.id, " is not a TailsStakingRegistry object"));
1738
- }
1739
- return TailsStakingRegistry.fromFieldsWithTypes(content);
1740
- };
1741
- TailsStakingRegistry.fromSuiObjectData = function (data) {
1742
- if (data.bcs) {
1743
- if (data.bcs.dataType !== "moveObject" || !isTailsStakingRegistry(data.bcs.type)) {
1744
- throw new Error("object at is not a TailsStakingRegistry object");
1745
- }
1746
- return TailsStakingRegistry.fromBcs((0, utils_1.fromB64)(data.bcs.bcsBytes));
1747
- }
1748
- if (data.content) {
1749
- return TailsStakingRegistry.fromSuiParsedData(data.content);
1750
- }
1751
- throw new Error("Both `bcs` and `content` fields are missing from the data. Include `showBcs` or `showContent` in the request.");
1752
- };
1753
- TailsStakingRegistry.fetch = function (client, id) {
1754
- return __awaiter(this, void 0, void 0, function () {
1755
- var res;
1756
- var _a, _b;
1757
- return __generator(this, function (_c) {
1758
- switch (_c.label) {
1759
- case 0: return [4 /*yield*/, client.getObject({ id: id, options: { showBcs: true } })];
1760
- case 1:
1761
- res = _c.sent();
1762
- if (res.error) {
1763
- throw new Error("error fetching TailsStakingRegistry object at id ".concat(id, ": ").concat(res.error.code));
1764
- }
1765
- if (((_b = (_a = res.data) === null || _a === void 0 ? void 0 : _a.bcs) === null || _b === void 0 ? void 0 : _b.dataType) !== "moveObject" || !isTailsStakingRegistry(res.data.bcs.type)) {
1766
- throw new Error("object at id ".concat(id, " is not a TailsStakingRegistry object"));
1767
- }
1768
- return [2 /*return*/, TailsStakingRegistry.fromSuiObjectData(res.data)];
1769
- }
1770
- });
1771
- });
1772
- };
1773
- TailsStakingRegistry.$typeName = "".concat(index_1.PKG_V3, "::tails_staking::TailsStakingRegistry");
1774
- TailsStakingRegistry.$numTypeParams = 0;
1775
- TailsStakingRegistry.$isPhantom = [];
1776
- return TailsStakingRegistry;
1777
- }());
1778
- exports.TailsStakingRegistry = TailsStakingRegistry;
1779
- /* ============================== TransferTailsEvent =============================== */
1780
- function isTransferTailsEvent(type) {
1781
- type = (0, util_1.compressSuiType)(type);
1782
- return type === "".concat(index_1.PKG_V3, "::tails_staking::TransferTailsEvent");
1783
- }
1784
- var TransferTailsEvent = /** @class */ (function () {
1785
- function TransferTailsEvent(typeArgs, fields) {
1786
- this.__StructClass = true;
1787
- this.$typeName = TransferTailsEvent.$typeName;
1788
- this.$isPhantom = TransferTailsEvent.$isPhantom;
1789
- this.$fullTypeName = util_1.composeSuiType.apply(void 0, __spreadArray([TransferTailsEvent.$typeName], __read(typeArgs), false));
1790
- this.$typeArgs = typeArgs;
1791
- this.tails = fields.tails;
1792
- this.recipient = fields.recipient;
1793
- this.log = fields.log;
1794
- this.bcsPadding = fields.bcsPadding;
1795
- }
1796
- TransferTailsEvent.reified = function () {
1797
- var _this = this;
1798
- return {
1799
- typeName: TransferTailsEvent.$typeName,
1800
- fullTypeName: util_1.composeSuiType.apply(void 0, __spreadArray([TransferTailsEvent.$typeName], [], false)),
1801
- typeArgs: [],
1802
- isPhantom: TransferTailsEvent.$isPhantom,
1803
- reifiedTypeArgs: [],
1804
- fromFields: function (fields) { return TransferTailsEvent.fromFields(fields); },
1805
- fromFieldsWithTypes: function (item) { return TransferTailsEvent.fromFieldsWithTypes(item); },
1806
- fromBcs: function (data) { return TransferTailsEvent.fromBcs(data); },
1807
- bcs: TransferTailsEvent.bcs,
1808
- fromJSONField: function (field) { return TransferTailsEvent.fromJSONField(field); },
1809
- fromJSON: function (json) { return TransferTailsEvent.fromJSON(json); },
1810
- fromSuiParsedData: function (content) { return TransferTailsEvent.fromSuiParsedData(content); },
1811
- fromSuiObjectData: function (content) { return TransferTailsEvent.fromSuiObjectData(content); },
1812
- fetch: function (client, id) { return __awaiter(_this, void 0, void 0, function () { return __generator(this, function (_a) {
1813
- return [2 /*return*/, TransferTailsEvent.fetch(client, id)];
1814
- }); }); },
1815
- new: function (fields) {
1816
- return new TransferTailsEvent([], fields);
1817
- },
1818
- kind: "StructClassReified",
1819
- };
1820
- };
1821
- Object.defineProperty(TransferTailsEvent, "r", {
1822
- get: function () {
1823
- return TransferTailsEvent.reified();
1824
- },
1825
- enumerable: false,
1826
- configurable: true
1827
- });
1828
- TransferTailsEvent.phantom = function () {
1829
- return (0, reified_1.phantom)(TransferTailsEvent.reified());
1830
- };
1831
- Object.defineProperty(TransferTailsEvent, "p", {
1832
- get: function () {
1833
- return TransferTailsEvent.phantom();
1834
- },
1835
- enumerable: false,
1836
- configurable: true
1837
- });
1838
- Object.defineProperty(TransferTailsEvent, "bcs", {
1839
- get: function () {
1840
- return bcs_1.bcs.struct("TransferTailsEvent", {
1841
- tails: bcs_1.bcs.bytes(32).transform({ input: function (val) { return (0, utils_1.fromHEX)(val); }, output: function (val) { return (0, utils_1.toHEX)(val); } }),
1842
- recipient: bcs_1.bcs.bytes(32).transform({ input: function (val) { return (0, utils_1.fromHEX)(val); }, output: function (val) { return (0, utils_1.toHEX)(val); } }),
1843
- log: bcs_1.bcs.vector(bcs_1.bcs.u64()),
1844
- bcs_padding: bcs_1.bcs.vector(bcs_1.bcs.vector(bcs_1.bcs.u8())),
1845
- });
1846
- },
1847
- enumerable: false,
1848
- configurable: true
1849
- });
1850
- TransferTailsEvent.fromFields = function (fields) {
1851
- return TransferTailsEvent.reified().new({
1852
- tails: (0, reified_1.decodeFromFields)("address", fields.tails),
1853
- recipient: (0, reified_1.decodeFromFields)("address", fields.recipient),
1854
- log: (0, reified_1.decodeFromFields)(reified.vector("u64"), fields.log),
1855
- bcsPadding: (0, reified_1.decodeFromFields)(reified.vector(reified.vector("u8")), fields.bcs_padding),
1856
- });
1857
- };
1858
- TransferTailsEvent.fromFieldsWithTypes = function (item) {
1859
- if (!isTransferTailsEvent(item.type)) {
1860
- throw new Error("not a TransferTailsEvent type");
1861
- }
1862
- return TransferTailsEvent.reified().new({
1863
- tails: (0, reified_1.decodeFromFieldsWithTypes)("address", item.fields.tails),
1864
- recipient: (0, reified_1.decodeFromFieldsWithTypes)("address", item.fields.recipient),
1865
- log: (0, reified_1.decodeFromFieldsWithTypes)(reified.vector("u64"), item.fields.log),
1866
- bcsPadding: (0, reified_1.decodeFromFieldsWithTypes)(reified.vector(reified.vector("u8")), item.fields.bcs_padding),
1867
- });
1868
- };
1869
- TransferTailsEvent.fromBcs = function (data) {
1870
- return TransferTailsEvent.fromFields(TransferTailsEvent.bcs.parse(data));
1871
- };
1872
- TransferTailsEvent.prototype.toJSONField = function () {
1873
- return {
1874
- tails: this.tails,
1875
- recipient: this.recipient,
1876
- log: (0, reified_1.fieldToJSON)("vector<u64>", this.log),
1877
- bcsPadding: (0, reified_1.fieldToJSON)("vector<vector<u8>>", this.bcsPadding),
1878
- };
1879
- };
1880
- TransferTailsEvent.prototype.toJSON = function () {
1881
- return __assign({ $typeName: this.$typeName, $typeArgs: this.$typeArgs }, this.toJSONField());
1882
- };
1883
- TransferTailsEvent.fromJSONField = function (field) {
1884
- return TransferTailsEvent.reified().new({
1885
- tails: (0, reified_1.decodeFromJSONField)("address", field.tails),
1886
- recipient: (0, reified_1.decodeFromJSONField)("address", field.recipient),
1887
- log: (0, reified_1.decodeFromJSONField)(reified.vector("u64"), field.log),
1888
- bcsPadding: (0, reified_1.decodeFromJSONField)(reified.vector(reified.vector("u8")), field.bcsPadding),
1889
- });
1890
- };
1891
- TransferTailsEvent.fromJSON = function (json) {
1892
- if (json.$typeName !== TransferTailsEvent.$typeName) {
1893
- throw new Error("not a WithTwoGenerics json object");
1894
- }
1895
- return TransferTailsEvent.fromJSONField(json);
1896
- };
1897
- TransferTailsEvent.fromSuiParsedData = function (content) {
1898
- if (content.dataType !== "moveObject") {
1899
- throw new Error("not an object");
1900
- }
1901
- if (!isTransferTailsEvent(content.type)) {
1902
- throw new Error("object at ".concat(content.fields.id, " is not a TransferTailsEvent object"));
1903
- }
1904
- return TransferTailsEvent.fromFieldsWithTypes(content);
1905
- };
1906
- TransferTailsEvent.fromSuiObjectData = function (data) {
1907
- if (data.bcs) {
1908
- if (data.bcs.dataType !== "moveObject" || !isTransferTailsEvent(data.bcs.type)) {
1909
- throw new Error("object at is not a TransferTailsEvent object");
1910
- }
1911
- return TransferTailsEvent.fromBcs((0, utils_1.fromB64)(data.bcs.bcsBytes));
1912
- }
1913
- if (data.content) {
1914
- return TransferTailsEvent.fromSuiParsedData(data.content);
1915
- }
1916
- throw new Error("Both `bcs` and `content` fields are missing from the data. Include `showBcs` or `showContent` in the request.");
1917
- };
1918
- TransferTailsEvent.fetch = function (client, id) {
1919
- return __awaiter(this, void 0, void 0, function () {
1920
- var res;
1921
- var _a, _b;
1922
- return __generator(this, function (_c) {
1923
- switch (_c.label) {
1924
- case 0: return [4 /*yield*/, client.getObject({ id: id, options: { showBcs: true } })];
1925
- case 1:
1926
- res = _c.sent();
1927
- if (res.error) {
1928
- throw new Error("error fetching TransferTailsEvent object at id ".concat(id, ": ").concat(res.error.code));
1929
- }
1930
- if (((_b = (_a = res.data) === null || _a === void 0 ? void 0 : _a.bcs) === null || _b === void 0 ? void 0 : _b.dataType) !== "moveObject" || !isTransferTailsEvent(res.data.bcs.type)) {
1931
- throw new Error("object at id ".concat(id, " is not a TransferTailsEvent object"));
1932
- }
1933
- return [2 /*return*/, TransferTailsEvent.fromSuiObjectData(res.data)];
1934
- }
1935
- });
1936
- });
1937
- };
1938
- TransferTailsEvent.$typeName = "".concat(index_1.PKG_V3, "::tails_staking::TransferTailsEvent");
1939
- TransferTailsEvent.$numTypeParams = 0;
1940
- TransferTailsEvent.$isPhantom = [];
1941
- return TransferTailsEvent;
1942
- }());
1943
- exports.TransferTailsEvent = TransferTailsEvent;
1944
- /* ============================== UnstakeTailsEvent =============================== */
1945
- function isUnstakeTailsEvent(type) {
1946
- type = (0, util_1.compressSuiType)(type);
1947
- return type === "".concat(index_1.PKG_V3, "::tails_staking::UnstakeTailsEvent");
1948
- }
1949
- var UnstakeTailsEvent = /** @class */ (function () {
1950
- function UnstakeTailsEvent(typeArgs, fields) {
1951
- this.__StructClass = true;
1952
- this.$typeName = UnstakeTailsEvent.$typeName;
1953
- this.$isPhantom = UnstakeTailsEvent.$isPhantom;
1954
- this.$fullTypeName = util_1.composeSuiType.apply(void 0, __spreadArray([UnstakeTailsEvent.$typeName], __read(typeArgs), false));
1955
- this.$typeArgs = typeArgs;
1956
- this.tails = fields.tails;
1957
- this.log = fields.log;
1958
- this.bcsPadding = fields.bcsPadding;
1959
- }
1960
- UnstakeTailsEvent.reified = function () {
1961
- var _this = this;
1962
- return {
1963
- typeName: UnstakeTailsEvent.$typeName,
1964
- fullTypeName: util_1.composeSuiType.apply(void 0, __spreadArray([UnstakeTailsEvent.$typeName], [], false)),
1965
- typeArgs: [],
1966
- isPhantom: UnstakeTailsEvent.$isPhantom,
1967
- reifiedTypeArgs: [],
1968
- fromFields: function (fields) { return UnstakeTailsEvent.fromFields(fields); },
1969
- fromFieldsWithTypes: function (item) { return UnstakeTailsEvent.fromFieldsWithTypes(item); },
1970
- fromBcs: function (data) { return UnstakeTailsEvent.fromBcs(data); },
1971
- bcs: UnstakeTailsEvent.bcs,
1972
- fromJSONField: function (field) { return UnstakeTailsEvent.fromJSONField(field); },
1973
- fromJSON: function (json) { return UnstakeTailsEvent.fromJSON(json); },
1974
- fromSuiParsedData: function (content) { return UnstakeTailsEvent.fromSuiParsedData(content); },
1975
- fromSuiObjectData: function (content) { return UnstakeTailsEvent.fromSuiObjectData(content); },
1976
- fetch: function (client, id) { return __awaiter(_this, void 0, void 0, function () { return __generator(this, function (_a) {
1977
- return [2 /*return*/, UnstakeTailsEvent.fetch(client, id)];
1978
- }); }); },
1979
- new: function (fields) {
1980
- return new UnstakeTailsEvent([], fields);
1981
- },
1982
- kind: "StructClassReified",
1983
- };
1984
- };
1985
- Object.defineProperty(UnstakeTailsEvent, "r", {
1986
- get: function () {
1987
- return UnstakeTailsEvent.reified();
1988
- },
1989
- enumerable: false,
1990
- configurable: true
1991
- });
1992
- UnstakeTailsEvent.phantom = function () {
1993
- return (0, reified_1.phantom)(UnstakeTailsEvent.reified());
1994
- };
1995
- Object.defineProperty(UnstakeTailsEvent, "p", {
1996
- get: function () {
1997
- return UnstakeTailsEvent.phantom();
1998
- },
1999
- enumerable: false,
2000
- configurable: true
2001
- });
2002
- Object.defineProperty(UnstakeTailsEvent, "bcs", {
2003
- get: function () {
2004
- return bcs_1.bcs.struct("UnstakeTailsEvent", {
2005
- tails: bcs_1.bcs.bytes(32).transform({ input: function (val) { return (0, utils_1.fromHEX)(val); }, output: function (val) { return (0, utils_1.toHEX)(val); } }),
2006
- log: bcs_1.bcs.vector(bcs_1.bcs.u64()),
2007
- bcs_padding: bcs_1.bcs.vector(bcs_1.bcs.vector(bcs_1.bcs.u8())),
2008
- });
2009
- },
2010
- enumerable: false,
2011
- configurable: true
2012
- });
2013
- UnstakeTailsEvent.fromFields = function (fields) {
2014
- return UnstakeTailsEvent.reified().new({
2015
- tails: (0, reified_1.decodeFromFields)("address", fields.tails),
2016
- log: (0, reified_1.decodeFromFields)(reified.vector("u64"), fields.log),
2017
- bcsPadding: (0, reified_1.decodeFromFields)(reified.vector(reified.vector("u8")), fields.bcs_padding),
2018
- });
2019
- };
2020
- UnstakeTailsEvent.fromFieldsWithTypes = function (item) {
2021
- if (!isUnstakeTailsEvent(item.type)) {
2022
- throw new Error("not a UnstakeTailsEvent type");
2023
- }
2024
- return UnstakeTailsEvent.reified().new({
2025
- tails: (0, reified_1.decodeFromFieldsWithTypes)("address", item.fields.tails),
2026
- log: (0, reified_1.decodeFromFieldsWithTypes)(reified.vector("u64"), item.fields.log),
2027
- bcsPadding: (0, reified_1.decodeFromFieldsWithTypes)(reified.vector(reified.vector("u8")), item.fields.bcs_padding),
2028
- });
2029
- };
2030
- UnstakeTailsEvent.fromBcs = function (data) {
2031
- return UnstakeTailsEvent.fromFields(UnstakeTailsEvent.bcs.parse(data));
2032
- };
2033
- UnstakeTailsEvent.prototype.toJSONField = function () {
2034
- return {
2035
- tails: this.tails,
2036
- log: (0, reified_1.fieldToJSON)("vector<u64>", this.log),
2037
- bcsPadding: (0, reified_1.fieldToJSON)("vector<vector<u8>>", this.bcsPadding),
2038
- };
2039
- };
2040
- UnstakeTailsEvent.prototype.toJSON = function () {
2041
- return __assign({ $typeName: this.$typeName, $typeArgs: this.$typeArgs }, this.toJSONField());
2042
- };
2043
- UnstakeTailsEvent.fromJSONField = function (field) {
2044
- return UnstakeTailsEvent.reified().new({
2045
- tails: (0, reified_1.decodeFromJSONField)("address", field.tails),
2046
- log: (0, reified_1.decodeFromJSONField)(reified.vector("u64"), field.log),
2047
- bcsPadding: (0, reified_1.decodeFromJSONField)(reified.vector(reified.vector("u8")), field.bcsPadding),
2048
- });
2049
- };
2050
- UnstakeTailsEvent.fromJSON = function (json) {
2051
- if (json.$typeName !== UnstakeTailsEvent.$typeName) {
2052
- throw new Error("not a WithTwoGenerics json object");
2053
- }
2054
- return UnstakeTailsEvent.fromJSONField(json);
2055
- };
2056
- UnstakeTailsEvent.fromSuiParsedData = function (content) {
2057
- if (content.dataType !== "moveObject") {
2058
- throw new Error("not an object");
2059
- }
2060
- if (!isUnstakeTailsEvent(content.type)) {
2061
- throw new Error("object at ".concat(content.fields.id, " is not a UnstakeTailsEvent object"));
2062
- }
2063
- return UnstakeTailsEvent.fromFieldsWithTypes(content);
2064
- };
2065
- UnstakeTailsEvent.fromSuiObjectData = function (data) {
2066
- if (data.bcs) {
2067
- if (data.bcs.dataType !== "moveObject" || !isUnstakeTailsEvent(data.bcs.type)) {
2068
- throw new Error("object at is not a UnstakeTailsEvent object");
2069
- }
2070
- return UnstakeTailsEvent.fromBcs((0, utils_1.fromB64)(data.bcs.bcsBytes));
2071
- }
2072
- if (data.content) {
2073
- return UnstakeTailsEvent.fromSuiParsedData(data.content);
2074
- }
2075
- throw new Error("Both `bcs` and `content` fields are missing from the data. Include `showBcs` or `showContent` in the request.");
2076
- };
2077
- UnstakeTailsEvent.fetch = function (client, id) {
2078
- return __awaiter(this, void 0, void 0, function () {
2079
- var res;
2080
- var _a, _b;
2081
- return __generator(this, function (_c) {
2082
- switch (_c.label) {
2083
- case 0: return [4 /*yield*/, client.getObject({ id: id, options: { showBcs: true } })];
2084
- case 1:
2085
- res = _c.sent();
2086
- if (res.error) {
2087
- throw new Error("error fetching UnstakeTailsEvent object at id ".concat(id, ": ").concat(res.error.code));
2088
- }
2089
- if (((_b = (_a = res.data) === null || _a === void 0 ? void 0 : _a.bcs) === null || _b === void 0 ? void 0 : _b.dataType) !== "moveObject" || !isUnstakeTailsEvent(res.data.bcs.type)) {
2090
- throw new Error("object at id ".concat(id, " is not a UnstakeTailsEvent object"));
2091
- }
2092
- return [2 /*return*/, UnstakeTailsEvent.fromSuiObjectData(res.data)];
2093
- }
2094
- });
2095
- });
2096
- };
2097
- UnstakeTailsEvent.$typeName = "".concat(index_1.PKG_V3, "::tails_staking::UnstakeTailsEvent");
2098
- UnstakeTailsEvent.$numTypeParams = 0;
2099
- UnstakeTailsEvent.$isPhantom = [];
2100
- return UnstakeTailsEvent;
2101
- }());
2102
- exports.UnstakeTailsEvent = UnstakeTailsEvent;
2103
- /* ============================== UpdateTailsStakingRegistryConfigEvent =============================== */
2104
- function isUpdateTailsStakingRegistryConfigEvent(type) {
2105
- type = (0, util_1.compressSuiType)(type);
2106
- return type === "".concat(index_1.PKG_V3, "::tails_staking::UpdateTailsStakingRegistryConfigEvent");
2107
- }
2108
- var UpdateTailsStakingRegistryConfigEvent = /** @class */ (function () {
2109
- function UpdateTailsStakingRegistryConfigEvent(typeArgs, fields) {
2110
- this.__StructClass = true;
2111
- this.$typeName = UpdateTailsStakingRegistryConfigEvent.$typeName;
2112
- this.$isPhantom = UpdateTailsStakingRegistryConfigEvent.$isPhantom;
2113
- this.$fullTypeName = util_1.composeSuiType.apply(void 0, __spreadArray([UpdateTailsStakingRegistryConfigEvent.$typeName], __read(typeArgs), false));
2114
- this.$typeArgs = typeArgs;
2115
- this.index = fields.index;
2116
- this.log = fields.log;
2117
- this.bcsPadding = fields.bcsPadding;
2118
- }
2119
- UpdateTailsStakingRegistryConfigEvent.reified = function () {
2120
- var _this = this;
2121
- return {
2122
- typeName: UpdateTailsStakingRegistryConfigEvent.$typeName,
2123
- fullTypeName: util_1.composeSuiType.apply(void 0, __spreadArray([UpdateTailsStakingRegistryConfigEvent.$typeName], [], false)),
2124
- typeArgs: [],
2125
- isPhantom: UpdateTailsStakingRegistryConfigEvent.$isPhantom,
2126
- reifiedTypeArgs: [],
2127
- fromFields: function (fields) { return UpdateTailsStakingRegistryConfigEvent.fromFields(fields); },
2128
- fromFieldsWithTypes: function (item) { return UpdateTailsStakingRegistryConfigEvent.fromFieldsWithTypes(item); },
2129
- fromBcs: function (data) { return UpdateTailsStakingRegistryConfigEvent.fromBcs(data); },
2130
- bcs: UpdateTailsStakingRegistryConfigEvent.bcs,
2131
- fromJSONField: function (field) { return UpdateTailsStakingRegistryConfigEvent.fromJSONField(field); },
2132
- fromJSON: function (json) { return UpdateTailsStakingRegistryConfigEvent.fromJSON(json); },
2133
- fromSuiParsedData: function (content) { return UpdateTailsStakingRegistryConfigEvent.fromSuiParsedData(content); },
2134
- fromSuiObjectData: function (content) { return UpdateTailsStakingRegistryConfigEvent.fromSuiObjectData(content); },
2135
- fetch: function (client, id) { return __awaiter(_this, void 0, void 0, function () { return __generator(this, function (_a) {
2136
- return [2 /*return*/, UpdateTailsStakingRegistryConfigEvent.fetch(client, id)];
2137
- }); }); },
2138
- new: function (fields) {
2139
- return new UpdateTailsStakingRegistryConfigEvent([], fields);
2140
- },
2141
- kind: "StructClassReified",
2142
- };
2143
- };
2144
- Object.defineProperty(UpdateTailsStakingRegistryConfigEvent, "r", {
2145
- get: function () {
2146
- return UpdateTailsStakingRegistryConfigEvent.reified();
2147
- },
2148
- enumerable: false,
2149
- configurable: true
2150
- });
2151
- UpdateTailsStakingRegistryConfigEvent.phantom = function () {
2152
- return (0, reified_1.phantom)(UpdateTailsStakingRegistryConfigEvent.reified());
2153
- };
2154
- Object.defineProperty(UpdateTailsStakingRegistryConfigEvent, "p", {
2155
- get: function () {
2156
- return UpdateTailsStakingRegistryConfigEvent.phantom();
2157
- },
2158
- enumerable: false,
2159
- configurable: true
2160
- });
2161
- Object.defineProperty(UpdateTailsStakingRegistryConfigEvent, "bcs", {
2162
- get: function () {
2163
- return bcs_1.bcs.struct("UpdateTailsStakingRegistryConfigEvent", {
2164
- index: bcs_1.bcs.u64(),
2165
- log: bcs_1.bcs.vector(bcs_1.bcs.u64()),
2166
- bcs_padding: bcs_1.bcs.vector(bcs_1.bcs.vector(bcs_1.bcs.u8())),
2167
- });
2168
- },
2169
- enumerable: false,
2170
- configurable: true
2171
- });
2172
- UpdateTailsStakingRegistryConfigEvent.fromFields = function (fields) {
2173
- return UpdateTailsStakingRegistryConfigEvent.reified().new({
2174
- index: (0, reified_1.decodeFromFields)("u64", fields.index),
2175
- log: (0, reified_1.decodeFromFields)(reified.vector("u64"), fields.log),
2176
- bcsPadding: (0, reified_1.decodeFromFields)(reified.vector(reified.vector("u8")), fields.bcs_padding),
2177
- });
2178
- };
2179
- UpdateTailsStakingRegistryConfigEvent.fromFieldsWithTypes = function (item) {
2180
- if (!isUpdateTailsStakingRegistryConfigEvent(item.type)) {
2181
- throw new Error("not a UpdateTailsStakingRegistryConfigEvent type");
2182
- }
2183
- return UpdateTailsStakingRegistryConfigEvent.reified().new({
2184
- index: (0, reified_1.decodeFromFieldsWithTypes)("u64", item.fields.index),
2185
- log: (0, reified_1.decodeFromFieldsWithTypes)(reified.vector("u64"), item.fields.log),
2186
- bcsPadding: (0, reified_1.decodeFromFieldsWithTypes)(reified.vector(reified.vector("u8")), item.fields.bcs_padding),
2187
- });
2188
- };
2189
- UpdateTailsStakingRegistryConfigEvent.fromBcs = function (data) {
2190
- return UpdateTailsStakingRegistryConfigEvent.fromFields(UpdateTailsStakingRegistryConfigEvent.bcs.parse(data));
2191
- };
2192
- UpdateTailsStakingRegistryConfigEvent.prototype.toJSONField = function () {
2193
- return {
2194
- index: this.index.toString(),
2195
- log: (0, reified_1.fieldToJSON)("vector<u64>", this.log),
2196
- bcsPadding: (0, reified_1.fieldToJSON)("vector<vector<u8>>", this.bcsPadding),
2197
- };
2198
- };
2199
- UpdateTailsStakingRegistryConfigEvent.prototype.toJSON = function () {
2200
- return __assign({ $typeName: this.$typeName, $typeArgs: this.$typeArgs }, this.toJSONField());
2201
- };
2202
- UpdateTailsStakingRegistryConfigEvent.fromJSONField = function (field) {
2203
- return UpdateTailsStakingRegistryConfigEvent.reified().new({
2204
- index: (0, reified_1.decodeFromJSONField)("u64", field.index),
2205
- log: (0, reified_1.decodeFromJSONField)(reified.vector("u64"), field.log),
2206
- bcsPadding: (0, reified_1.decodeFromJSONField)(reified.vector(reified.vector("u8")), field.bcsPadding),
2207
- });
2208
- };
2209
- UpdateTailsStakingRegistryConfigEvent.fromJSON = function (json) {
2210
- if (json.$typeName !== UpdateTailsStakingRegistryConfigEvent.$typeName) {
2211
- throw new Error("not a WithTwoGenerics json object");
2212
- }
2213
- return UpdateTailsStakingRegistryConfigEvent.fromJSONField(json);
2214
- };
2215
- UpdateTailsStakingRegistryConfigEvent.fromSuiParsedData = function (content) {
2216
- if (content.dataType !== "moveObject") {
2217
- throw new Error("not an object");
2218
- }
2219
- if (!isUpdateTailsStakingRegistryConfigEvent(content.type)) {
2220
- throw new Error("object at ".concat(content.fields.id, " is not a UpdateTailsStakingRegistryConfigEvent object"));
2221
- }
2222
- return UpdateTailsStakingRegistryConfigEvent.fromFieldsWithTypes(content);
2223
- };
2224
- UpdateTailsStakingRegistryConfigEvent.fromSuiObjectData = function (data) {
2225
- if (data.bcs) {
2226
- if (data.bcs.dataType !== "moveObject" || !isUpdateTailsStakingRegistryConfigEvent(data.bcs.type)) {
2227
- throw new Error("object at is not a UpdateTailsStakingRegistryConfigEvent object");
2228
- }
2229
- return UpdateTailsStakingRegistryConfigEvent.fromBcs((0, utils_1.fromB64)(data.bcs.bcsBytes));
2230
- }
2231
- if (data.content) {
2232
- return UpdateTailsStakingRegistryConfigEvent.fromSuiParsedData(data.content);
2233
- }
2234
- throw new Error("Both `bcs` and `content` fields are missing from the data. Include `showBcs` or `showContent` in the request.");
2235
- };
2236
- UpdateTailsStakingRegistryConfigEvent.fetch = function (client, id) {
2237
- return __awaiter(this, void 0, void 0, function () {
2238
- var res;
2239
- var _a, _b;
2240
- return __generator(this, function (_c) {
2241
- switch (_c.label) {
2242
- case 0: return [4 /*yield*/, client.getObject({ id: id, options: { showBcs: true } })];
2243
- case 1:
2244
- res = _c.sent();
2245
- if (res.error) {
2246
- throw new Error("error fetching UpdateTailsStakingRegistryConfigEvent object at id ".concat(id, ": ").concat(res.error.code));
2247
- }
2248
- if (((_b = (_a = res.data) === null || _a === void 0 ? void 0 : _a.bcs) === null || _b === void 0 ? void 0 : _b.dataType) !== "moveObject" || !isUpdateTailsStakingRegistryConfigEvent(res.data.bcs.type)) {
2249
- throw new Error("object at id ".concat(id, " is not a UpdateTailsStakingRegistryConfigEvent object"));
2250
- }
2251
- return [2 /*return*/, UpdateTailsStakingRegistryConfigEvent.fromSuiObjectData(res.data)];
2252
- }
2253
- });
2254
- });
2255
- };
2256
- UpdateTailsStakingRegistryConfigEvent.$typeName = "".concat(index_1.PKG_V3, "::tails_staking::UpdateTailsStakingRegistryConfigEvent");
2257
- UpdateTailsStakingRegistryConfigEvent.$numTypeParams = 0;
2258
- UpdateTailsStakingRegistryConfigEvent.$isPhantom = [];
2259
- return UpdateTailsStakingRegistryConfigEvent;
2260
- }());
2261
- exports.UpdateTailsStakingRegistryConfigEvent = UpdateTailsStakingRegistryConfigEvent;