@typus/typus-perp-sdk 1.1.30-testnet → 1.1.31-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 -6
  73. package/dist/src/user/orderWithBidReceipt.js +127 -226
  74. package/dist/src/user/tlp.d.ts +32 -23
  75. package/dist/src/user/tlp.js +316 -468
  76. package/package.json +45 -37
  77. package/dist/src/_dependencies/source/0x1/ascii/structs.d.ts +0 -88
  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 -50
  82. package/dist/src/_dependencies/source/0x1/option/structs.js +0 -271
  83. package/dist/src/_dependencies/source/0x1/string/structs.d.ts +0 -48
  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 -49
  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 -54
  88. package/dist/src/_dependencies/source/0x2/bag/structs.js +0 -229
  89. package/dist/src/_dependencies/source/0x2/balance/structs.d.ts +0 -84
  90. package/dist/src/_dependencies/source/0x2/balance/structs.js +0 -386
  91. package/dist/src/_dependencies/source/0x2/coin/structs.d.ts +0 -406
  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 -132
  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 -86
  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 -54
  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 -44
  102. package/dist/src/_dependencies/source/0x2/sui/structs.js +0 -222
  103. package/dist/src/_dependencies/source/0x2/table/structs.d.ts +0 -54
  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 -59
  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 -421
  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 -348
  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 -49
  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 -106
  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 -49
  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 -422
  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 -130
  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 -208
  122. package/dist/src/_dependencies/source/0x4b0f4ee1a40ce37ec81c987cc4e76a665419e74b863319492fc7d26f708b835a/critbit/structs.js +0 -653
  123. package/dist/src/_dependencies/source/0x4b0f4ee1a40ce37ec81c987cc4e76a665419e74b863319492fc7d26f708b835a/ecosystem/structs.d.ts +0 -362
  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 -202
  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 -600
  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 -136
  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 -127
  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 -957
  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 -244
  140. package/dist/src/_dependencies/source/0x4b0f4ee1a40ce37ec81c987cc4e76a665419e74b863319492fc7d26f708b835a/tgld/structs.js +0 -733
  141. package/dist/src/_dependencies/source/0x4b0f4ee1a40ce37ec81c987cc4e76a665419e74b863319492fc7d26f708b835a/user/structs.d.ts +0 -294
  142. package/dist/src/_dependencies/source/0x4b0f4ee1a40ce37ec81c987cc4e76a665419e74b863319492fc7d26f708b835a/user/structs.js +0 -892
  143. package/dist/src/_dependencies/source/0xb4f25230ba74837d8299e92951306100c4a532e8c48cc3d8828abe9b91c8b274/authority/structs.d.ts +0 -73
  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 -294
  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 -64
  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 -756
  150. package/dist/src/_dependencies/source/0xb4f25230ba74837d8299e92951306100c4a532e8c48cc3d8828abe9b91c8b274/dutch/structs.js +0 -1721
  151. package/dist/src/_dependencies/source/0xb4f25230ba74837d8299e92951306100c4a532e8c48cc3d8828abe9b91c8b274/i64/structs.d.ts +0 -44
  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 -135
  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 -2106
  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 -390
  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 -89
  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 -386
  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 -59
  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 -974
  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 -42
  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 -467
  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 -80
  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 -160
  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 -3705
  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 -905
  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 -70
  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 -89
  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 -3060
  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 -49
  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 -148
  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 -365
  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 -2199
  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,1459 +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.TypusLeaderboardRegistry = exports.ScoreEvent = exports.RemoveLeaderboardEvent = exports.Leaderboard = exports.ExtendLeaderboardEvent = exports.DeductEvent = exports.DeactivateLeaderboardEvent = exports.ActivateLeaderboardEvent = void 0;
109
- exports.isActivateLeaderboardEvent = isActivateLeaderboardEvent;
110
- exports.isDeactivateLeaderboardEvent = isDeactivateLeaderboardEvent;
111
- exports.isDeductEvent = isDeductEvent;
112
- exports.isExtendLeaderboardEvent = isExtendLeaderboardEvent;
113
- exports.isLeaderboard = isLeaderboard;
114
- exports.isRemoveLeaderboardEvent = isRemoveLeaderboardEvent;
115
- exports.isScoreEvent = isScoreEvent;
116
- exports.isTypusLeaderboardRegistry = isTypusLeaderboardRegistry;
117
- var reified = __importStar(require("../../../../_framework/reified"));
118
- var reified_1 = require("../../../../_framework/reified");
119
- var util_1 = require("../../../../_framework/util");
120
- var structs_1 = require("../../0x1/ascii/structs");
121
- var structs_2 = require("../../0x2/object/structs");
122
- var structs_3 = require("../../0x2/table/structs");
123
- var structs_4 = require("../critbit/structs");
124
- var index_1 = require("../index");
125
- var structs_5 = require("../linked-set/structs");
126
- var bcs_1 = require("@mysten/sui/bcs");
127
- var utils_1 = require("@mysten/sui/utils");
128
- /* ============================== ActivateLeaderboardEvent =============================== */
129
- function isActivateLeaderboardEvent(type) {
130
- type = (0, util_1.compressSuiType)(type);
131
- return type === "".concat(index_1.PKG_V1, "::leaderboard::ActivateLeaderboardEvent");
132
- }
133
- var ActivateLeaderboardEvent = /** @class */ (function () {
134
- function ActivateLeaderboardEvent(typeArgs, fields) {
135
- this.__StructClass = true;
136
- this.$typeName = ActivateLeaderboardEvent.$typeName;
137
- this.$isPhantom = ActivateLeaderboardEvent.$isPhantom;
138
- this.$fullTypeName = util_1.composeSuiType.apply(void 0, __spreadArray([ActivateLeaderboardEvent.$typeName], __read(typeArgs), false));
139
- this.$typeArgs = typeArgs;
140
- this.key = fields.key;
141
- this.id = fields.id;
142
- this.log = fields.log;
143
- this.bcsPadding = fields.bcsPadding;
144
- }
145
- ActivateLeaderboardEvent.reified = function () {
146
- var _this = this;
147
- return {
148
- typeName: ActivateLeaderboardEvent.$typeName,
149
- fullTypeName: util_1.composeSuiType.apply(void 0, __spreadArray([ActivateLeaderboardEvent.$typeName], [], false)),
150
- typeArgs: [],
151
- isPhantom: ActivateLeaderboardEvent.$isPhantom,
152
- reifiedTypeArgs: [],
153
- fromFields: function (fields) { return ActivateLeaderboardEvent.fromFields(fields); },
154
- fromFieldsWithTypes: function (item) { return ActivateLeaderboardEvent.fromFieldsWithTypes(item); },
155
- fromBcs: function (data) { return ActivateLeaderboardEvent.fromBcs(data); },
156
- bcs: ActivateLeaderboardEvent.bcs,
157
- fromJSONField: function (field) { return ActivateLeaderboardEvent.fromJSONField(field); },
158
- fromJSON: function (json) { return ActivateLeaderboardEvent.fromJSON(json); },
159
- fromSuiParsedData: function (content) { return ActivateLeaderboardEvent.fromSuiParsedData(content); },
160
- fromSuiObjectData: function (content) { return ActivateLeaderboardEvent.fromSuiObjectData(content); },
161
- fetch: function (client, id) { return __awaiter(_this, void 0, void 0, function () { return __generator(this, function (_a) {
162
- return [2 /*return*/, ActivateLeaderboardEvent.fetch(client, id)];
163
- }); }); },
164
- new: function (fields) {
165
- return new ActivateLeaderboardEvent([], fields);
166
- },
167
- kind: "StructClassReified",
168
- };
169
- };
170
- Object.defineProperty(ActivateLeaderboardEvent, "r", {
171
- get: function () {
172
- return ActivateLeaderboardEvent.reified();
173
- },
174
- enumerable: false,
175
- configurable: true
176
- });
177
- ActivateLeaderboardEvent.phantom = function () {
178
- return (0, reified_1.phantom)(ActivateLeaderboardEvent.reified());
179
- };
180
- Object.defineProperty(ActivateLeaderboardEvent, "p", {
181
- get: function () {
182
- return ActivateLeaderboardEvent.phantom();
183
- },
184
- enumerable: false,
185
- configurable: true
186
- });
187
- Object.defineProperty(ActivateLeaderboardEvent, "bcs", {
188
- get: function () {
189
- return bcs_1.bcs.struct("ActivateLeaderboardEvent", {
190
- key: structs_1.String.bcs,
191
- id: bcs_1.bcs.bytes(32).transform({ input: function (val) { return (0, utils_1.fromHEX)(val); }, output: function (val) { return (0, utils_1.toHEX)(val); } }),
192
- log: bcs_1.bcs.vector(bcs_1.bcs.u64()),
193
- bcs_padding: bcs_1.bcs.vector(bcs_1.bcs.vector(bcs_1.bcs.u8())),
194
- });
195
- },
196
- enumerable: false,
197
- configurable: true
198
- });
199
- ActivateLeaderboardEvent.fromFields = function (fields) {
200
- return ActivateLeaderboardEvent.reified().new({
201
- key: (0, reified_1.decodeFromFields)(structs_1.String.reified(), fields.key),
202
- id: (0, reified_1.decodeFromFields)("address", fields.id),
203
- log: (0, reified_1.decodeFromFields)(reified.vector("u64"), fields.log),
204
- bcsPadding: (0, reified_1.decodeFromFields)(reified.vector(reified.vector("u8")), fields.bcs_padding),
205
- });
206
- };
207
- ActivateLeaderboardEvent.fromFieldsWithTypes = function (item) {
208
- if (!isActivateLeaderboardEvent(item.type)) {
209
- throw new Error("not a ActivateLeaderboardEvent type");
210
- }
211
- return ActivateLeaderboardEvent.reified().new({
212
- key: (0, reified_1.decodeFromFieldsWithTypes)(structs_1.String.reified(), item.fields.key),
213
- id: (0, reified_1.decodeFromFieldsWithTypes)("address", item.fields.id),
214
- log: (0, reified_1.decodeFromFieldsWithTypes)(reified.vector("u64"), item.fields.log),
215
- bcsPadding: (0, reified_1.decodeFromFieldsWithTypes)(reified.vector(reified.vector("u8")), item.fields.bcs_padding),
216
- });
217
- };
218
- ActivateLeaderboardEvent.fromBcs = function (data) {
219
- return ActivateLeaderboardEvent.fromFields(ActivateLeaderboardEvent.bcs.parse(data));
220
- };
221
- ActivateLeaderboardEvent.prototype.toJSONField = function () {
222
- return {
223
- key: this.key,
224
- id: this.id,
225
- log: (0, reified_1.fieldToJSON)("vector<u64>", this.log),
226
- bcsPadding: (0, reified_1.fieldToJSON)("vector<vector<u8>>", this.bcsPadding),
227
- };
228
- };
229
- ActivateLeaderboardEvent.prototype.toJSON = function () {
230
- return __assign({ $typeName: this.$typeName, $typeArgs: this.$typeArgs }, this.toJSONField());
231
- };
232
- ActivateLeaderboardEvent.fromJSONField = function (field) {
233
- return ActivateLeaderboardEvent.reified().new({
234
- key: (0, reified_1.decodeFromJSONField)(structs_1.String.reified(), field.key),
235
- id: (0, reified_1.decodeFromJSONField)("address", field.id),
236
- log: (0, reified_1.decodeFromJSONField)(reified.vector("u64"), field.log),
237
- bcsPadding: (0, reified_1.decodeFromJSONField)(reified.vector(reified.vector("u8")), field.bcsPadding),
238
- });
239
- };
240
- ActivateLeaderboardEvent.fromJSON = function (json) {
241
- if (json.$typeName !== ActivateLeaderboardEvent.$typeName) {
242
- throw new Error("not a WithTwoGenerics json object");
243
- }
244
- return ActivateLeaderboardEvent.fromJSONField(json);
245
- };
246
- ActivateLeaderboardEvent.fromSuiParsedData = function (content) {
247
- if (content.dataType !== "moveObject") {
248
- throw new Error("not an object");
249
- }
250
- if (!isActivateLeaderboardEvent(content.type)) {
251
- throw new Error("object at ".concat(content.fields.id, " is not a ActivateLeaderboardEvent object"));
252
- }
253
- return ActivateLeaderboardEvent.fromFieldsWithTypes(content);
254
- };
255
- ActivateLeaderboardEvent.fromSuiObjectData = function (data) {
256
- if (data.bcs) {
257
- if (data.bcs.dataType !== "moveObject" || !isActivateLeaderboardEvent(data.bcs.type)) {
258
- throw new Error("object at is not a ActivateLeaderboardEvent object");
259
- }
260
- return ActivateLeaderboardEvent.fromBcs((0, utils_1.fromB64)(data.bcs.bcsBytes));
261
- }
262
- if (data.content) {
263
- return ActivateLeaderboardEvent.fromSuiParsedData(data.content);
264
- }
265
- throw new Error("Both `bcs` and `content` fields are missing from the data. Include `showBcs` or `showContent` in the request.");
266
- };
267
- ActivateLeaderboardEvent.fetch = function (client, id) {
268
- return __awaiter(this, void 0, void 0, function () {
269
- var res;
270
- var _a, _b;
271
- return __generator(this, function (_c) {
272
- switch (_c.label) {
273
- case 0: return [4 /*yield*/, client.getObject({ id: id, options: { showBcs: true } })];
274
- case 1:
275
- res = _c.sent();
276
- if (res.error) {
277
- throw new Error("error fetching ActivateLeaderboardEvent object at id ".concat(id, ": ").concat(res.error.code));
278
- }
279
- if (((_b = (_a = res.data) === null || _a === void 0 ? void 0 : _a.bcs) === null || _b === void 0 ? void 0 : _b.dataType) !== "moveObject" || !isActivateLeaderboardEvent(res.data.bcs.type)) {
280
- throw new Error("object at id ".concat(id, " is not a ActivateLeaderboardEvent object"));
281
- }
282
- return [2 /*return*/, ActivateLeaderboardEvent.fromSuiObjectData(res.data)];
283
- }
284
- });
285
- });
286
- };
287
- ActivateLeaderboardEvent.$typeName = "".concat(index_1.PKG_V1, "::leaderboard::ActivateLeaderboardEvent");
288
- ActivateLeaderboardEvent.$numTypeParams = 0;
289
- ActivateLeaderboardEvent.$isPhantom = [];
290
- return ActivateLeaderboardEvent;
291
- }());
292
- exports.ActivateLeaderboardEvent = ActivateLeaderboardEvent;
293
- /* ============================== DeactivateLeaderboardEvent =============================== */
294
- function isDeactivateLeaderboardEvent(type) {
295
- type = (0, util_1.compressSuiType)(type);
296
- return type === "".concat(index_1.PKG_V1, "::leaderboard::DeactivateLeaderboardEvent");
297
- }
298
- var DeactivateLeaderboardEvent = /** @class */ (function () {
299
- function DeactivateLeaderboardEvent(typeArgs, fields) {
300
- this.__StructClass = true;
301
- this.$typeName = DeactivateLeaderboardEvent.$typeName;
302
- this.$isPhantom = DeactivateLeaderboardEvent.$isPhantom;
303
- this.$fullTypeName = util_1.composeSuiType.apply(void 0, __spreadArray([DeactivateLeaderboardEvent.$typeName], __read(typeArgs), false));
304
- this.$typeArgs = typeArgs;
305
- this.key = fields.key;
306
- this.id = fields.id;
307
- this.log = fields.log;
308
- this.bcsPadding = fields.bcsPadding;
309
- }
310
- DeactivateLeaderboardEvent.reified = function () {
311
- var _this = this;
312
- return {
313
- typeName: DeactivateLeaderboardEvent.$typeName,
314
- fullTypeName: util_1.composeSuiType.apply(void 0, __spreadArray([DeactivateLeaderboardEvent.$typeName], [], false)),
315
- typeArgs: [],
316
- isPhantom: DeactivateLeaderboardEvent.$isPhantom,
317
- reifiedTypeArgs: [],
318
- fromFields: function (fields) { return DeactivateLeaderboardEvent.fromFields(fields); },
319
- fromFieldsWithTypes: function (item) { return DeactivateLeaderboardEvent.fromFieldsWithTypes(item); },
320
- fromBcs: function (data) { return DeactivateLeaderboardEvent.fromBcs(data); },
321
- bcs: DeactivateLeaderboardEvent.bcs,
322
- fromJSONField: function (field) { return DeactivateLeaderboardEvent.fromJSONField(field); },
323
- fromJSON: function (json) { return DeactivateLeaderboardEvent.fromJSON(json); },
324
- fromSuiParsedData: function (content) { return DeactivateLeaderboardEvent.fromSuiParsedData(content); },
325
- fromSuiObjectData: function (content) { return DeactivateLeaderboardEvent.fromSuiObjectData(content); },
326
- fetch: function (client, id) { return __awaiter(_this, void 0, void 0, function () { return __generator(this, function (_a) {
327
- return [2 /*return*/, DeactivateLeaderboardEvent.fetch(client, id)];
328
- }); }); },
329
- new: function (fields) {
330
- return new DeactivateLeaderboardEvent([], fields);
331
- },
332
- kind: "StructClassReified",
333
- };
334
- };
335
- Object.defineProperty(DeactivateLeaderboardEvent, "r", {
336
- get: function () {
337
- return DeactivateLeaderboardEvent.reified();
338
- },
339
- enumerable: false,
340
- configurable: true
341
- });
342
- DeactivateLeaderboardEvent.phantom = function () {
343
- return (0, reified_1.phantom)(DeactivateLeaderboardEvent.reified());
344
- };
345
- Object.defineProperty(DeactivateLeaderboardEvent, "p", {
346
- get: function () {
347
- return DeactivateLeaderboardEvent.phantom();
348
- },
349
- enumerable: false,
350
- configurable: true
351
- });
352
- Object.defineProperty(DeactivateLeaderboardEvent, "bcs", {
353
- get: function () {
354
- return bcs_1.bcs.struct("DeactivateLeaderboardEvent", {
355
- key: structs_1.String.bcs,
356
- id: bcs_1.bcs.bytes(32).transform({ input: function (val) { return (0, utils_1.fromHEX)(val); }, output: function (val) { return (0, utils_1.toHEX)(val); } }),
357
- log: bcs_1.bcs.vector(bcs_1.bcs.u64()),
358
- bcs_padding: bcs_1.bcs.vector(bcs_1.bcs.vector(bcs_1.bcs.u8())),
359
- });
360
- },
361
- enumerable: false,
362
- configurable: true
363
- });
364
- DeactivateLeaderboardEvent.fromFields = function (fields) {
365
- return DeactivateLeaderboardEvent.reified().new({
366
- key: (0, reified_1.decodeFromFields)(structs_1.String.reified(), fields.key),
367
- id: (0, reified_1.decodeFromFields)("address", fields.id),
368
- log: (0, reified_1.decodeFromFields)(reified.vector("u64"), fields.log),
369
- bcsPadding: (0, reified_1.decodeFromFields)(reified.vector(reified.vector("u8")), fields.bcs_padding),
370
- });
371
- };
372
- DeactivateLeaderboardEvent.fromFieldsWithTypes = function (item) {
373
- if (!isDeactivateLeaderboardEvent(item.type)) {
374
- throw new Error("not a DeactivateLeaderboardEvent type");
375
- }
376
- return DeactivateLeaderboardEvent.reified().new({
377
- key: (0, reified_1.decodeFromFieldsWithTypes)(structs_1.String.reified(), item.fields.key),
378
- id: (0, reified_1.decodeFromFieldsWithTypes)("address", item.fields.id),
379
- log: (0, reified_1.decodeFromFieldsWithTypes)(reified.vector("u64"), item.fields.log),
380
- bcsPadding: (0, reified_1.decodeFromFieldsWithTypes)(reified.vector(reified.vector("u8")), item.fields.bcs_padding),
381
- });
382
- };
383
- DeactivateLeaderboardEvent.fromBcs = function (data) {
384
- return DeactivateLeaderboardEvent.fromFields(DeactivateLeaderboardEvent.bcs.parse(data));
385
- };
386
- DeactivateLeaderboardEvent.prototype.toJSONField = function () {
387
- return {
388
- key: this.key,
389
- id: this.id,
390
- log: (0, reified_1.fieldToJSON)("vector<u64>", this.log),
391
- bcsPadding: (0, reified_1.fieldToJSON)("vector<vector<u8>>", this.bcsPadding),
392
- };
393
- };
394
- DeactivateLeaderboardEvent.prototype.toJSON = function () {
395
- return __assign({ $typeName: this.$typeName, $typeArgs: this.$typeArgs }, this.toJSONField());
396
- };
397
- DeactivateLeaderboardEvent.fromJSONField = function (field) {
398
- return DeactivateLeaderboardEvent.reified().new({
399
- key: (0, reified_1.decodeFromJSONField)(structs_1.String.reified(), field.key),
400
- id: (0, reified_1.decodeFromJSONField)("address", field.id),
401
- log: (0, reified_1.decodeFromJSONField)(reified.vector("u64"), field.log),
402
- bcsPadding: (0, reified_1.decodeFromJSONField)(reified.vector(reified.vector("u8")), field.bcsPadding),
403
- });
404
- };
405
- DeactivateLeaderboardEvent.fromJSON = function (json) {
406
- if (json.$typeName !== DeactivateLeaderboardEvent.$typeName) {
407
- throw new Error("not a WithTwoGenerics json object");
408
- }
409
- return DeactivateLeaderboardEvent.fromJSONField(json);
410
- };
411
- DeactivateLeaderboardEvent.fromSuiParsedData = function (content) {
412
- if (content.dataType !== "moveObject") {
413
- throw new Error("not an object");
414
- }
415
- if (!isDeactivateLeaderboardEvent(content.type)) {
416
- throw new Error("object at ".concat(content.fields.id, " is not a DeactivateLeaderboardEvent object"));
417
- }
418
- return DeactivateLeaderboardEvent.fromFieldsWithTypes(content);
419
- };
420
- DeactivateLeaderboardEvent.fromSuiObjectData = function (data) {
421
- if (data.bcs) {
422
- if (data.bcs.dataType !== "moveObject" || !isDeactivateLeaderboardEvent(data.bcs.type)) {
423
- throw new Error("object at is not a DeactivateLeaderboardEvent object");
424
- }
425
- return DeactivateLeaderboardEvent.fromBcs((0, utils_1.fromB64)(data.bcs.bcsBytes));
426
- }
427
- if (data.content) {
428
- return DeactivateLeaderboardEvent.fromSuiParsedData(data.content);
429
- }
430
- throw new Error("Both `bcs` and `content` fields are missing from the data. Include `showBcs` or `showContent` in the request.");
431
- };
432
- DeactivateLeaderboardEvent.fetch = function (client, id) {
433
- return __awaiter(this, void 0, void 0, function () {
434
- var res;
435
- var _a, _b;
436
- return __generator(this, function (_c) {
437
- switch (_c.label) {
438
- case 0: return [4 /*yield*/, client.getObject({ id: id, options: { showBcs: true } })];
439
- case 1:
440
- res = _c.sent();
441
- if (res.error) {
442
- throw new Error("error fetching DeactivateLeaderboardEvent object at id ".concat(id, ": ").concat(res.error.code));
443
- }
444
- if (((_b = (_a = res.data) === null || _a === void 0 ? void 0 : _a.bcs) === null || _b === void 0 ? void 0 : _b.dataType) !== "moveObject" || !isDeactivateLeaderboardEvent(res.data.bcs.type)) {
445
- throw new Error("object at id ".concat(id, " is not a DeactivateLeaderboardEvent object"));
446
- }
447
- return [2 /*return*/, DeactivateLeaderboardEvent.fromSuiObjectData(res.data)];
448
- }
449
- });
450
- });
451
- };
452
- DeactivateLeaderboardEvent.$typeName = "".concat(index_1.PKG_V1, "::leaderboard::DeactivateLeaderboardEvent");
453
- DeactivateLeaderboardEvent.$numTypeParams = 0;
454
- DeactivateLeaderboardEvent.$isPhantom = [];
455
- return DeactivateLeaderboardEvent;
456
- }());
457
- exports.DeactivateLeaderboardEvent = DeactivateLeaderboardEvent;
458
- /* ============================== DeductEvent =============================== */
459
- function isDeductEvent(type) {
460
- type = (0, util_1.compressSuiType)(type);
461
- return type === "".concat(index_1.PKG_V5, "::leaderboard::DeductEvent");
462
- }
463
- var DeductEvent = /** @class */ (function () {
464
- function DeductEvent(typeArgs, fields) {
465
- this.__StructClass = true;
466
- this.$typeName = DeductEvent.$typeName;
467
- this.$isPhantom = DeductEvent.$isPhantom;
468
- this.$fullTypeName = util_1.composeSuiType.apply(void 0, __spreadArray([DeductEvent.$typeName], __read(typeArgs), false));
469
- this.$typeArgs = typeArgs;
470
- this.key = fields.key;
471
- this.id = fields.id;
472
- this.user = fields.user;
473
- this.log = fields.log;
474
- this.bcsPadding = fields.bcsPadding;
475
- }
476
- DeductEvent.reified = function () {
477
- var _this = this;
478
- return {
479
- typeName: DeductEvent.$typeName,
480
- fullTypeName: util_1.composeSuiType.apply(void 0, __spreadArray([DeductEvent.$typeName], [], false)),
481
- typeArgs: [],
482
- isPhantom: DeductEvent.$isPhantom,
483
- reifiedTypeArgs: [],
484
- fromFields: function (fields) { return DeductEvent.fromFields(fields); },
485
- fromFieldsWithTypes: function (item) { return DeductEvent.fromFieldsWithTypes(item); },
486
- fromBcs: function (data) { return DeductEvent.fromBcs(data); },
487
- bcs: DeductEvent.bcs,
488
- fromJSONField: function (field) { return DeductEvent.fromJSONField(field); },
489
- fromJSON: function (json) { return DeductEvent.fromJSON(json); },
490
- fromSuiParsedData: function (content) { return DeductEvent.fromSuiParsedData(content); },
491
- fromSuiObjectData: function (content) { return DeductEvent.fromSuiObjectData(content); },
492
- fetch: function (client, id) { return __awaiter(_this, void 0, void 0, function () { return __generator(this, function (_a) {
493
- return [2 /*return*/, DeductEvent.fetch(client, id)];
494
- }); }); },
495
- new: function (fields) {
496
- return new DeductEvent([], fields);
497
- },
498
- kind: "StructClassReified",
499
- };
500
- };
501
- Object.defineProperty(DeductEvent, "r", {
502
- get: function () {
503
- return DeductEvent.reified();
504
- },
505
- enumerable: false,
506
- configurable: true
507
- });
508
- DeductEvent.phantom = function () {
509
- return (0, reified_1.phantom)(DeductEvent.reified());
510
- };
511
- Object.defineProperty(DeductEvent, "p", {
512
- get: function () {
513
- return DeductEvent.phantom();
514
- },
515
- enumerable: false,
516
- configurable: true
517
- });
518
- Object.defineProperty(DeductEvent, "bcs", {
519
- get: function () {
520
- return bcs_1.bcs.struct("DeductEvent", {
521
- key: structs_1.String.bcs,
522
- id: bcs_1.bcs.bytes(32).transform({ input: function (val) { return (0, utils_1.fromHEX)(val); }, output: function (val) { return (0, utils_1.toHEX)(val); } }),
523
- 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); } }),
524
- log: bcs_1.bcs.vector(bcs_1.bcs.u64()),
525
- bcs_padding: bcs_1.bcs.vector(bcs_1.bcs.vector(bcs_1.bcs.u8())),
526
- });
527
- },
528
- enumerable: false,
529
- configurable: true
530
- });
531
- DeductEvent.fromFields = function (fields) {
532
- return DeductEvent.reified().new({
533
- key: (0, reified_1.decodeFromFields)(structs_1.String.reified(), fields.key),
534
- id: (0, reified_1.decodeFromFields)("address", fields.id),
535
- user: (0, reified_1.decodeFromFields)("address", fields.user),
536
- log: (0, reified_1.decodeFromFields)(reified.vector("u64"), fields.log),
537
- bcsPadding: (0, reified_1.decodeFromFields)(reified.vector(reified.vector("u8")), fields.bcs_padding),
538
- });
539
- };
540
- DeductEvent.fromFieldsWithTypes = function (item) {
541
- if (!isDeductEvent(item.type)) {
542
- throw new Error("not a DeductEvent type");
543
- }
544
- return DeductEvent.reified().new({
545
- key: (0, reified_1.decodeFromFieldsWithTypes)(structs_1.String.reified(), item.fields.key),
546
- id: (0, reified_1.decodeFromFieldsWithTypes)("address", item.fields.id),
547
- user: (0, reified_1.decodeFromFieldsWithTypes)("address", item.fields.user),
548
- log: (0, reified_1.decodeFromFieldsWithTypes)(reified.vector("u64"), item.fields.log),
549
- bcsPadding: (0, reified_1.decodeFromFieldsWithTypes)(reified.vector(reified.vector("u8")), item.fields.bcs_padding),
550
- });
551
- };
552
- DeductEvent.fromBcs = function (data) {
553
- return DeductEvent.fromFields(DeductEvent.bcs.parse(data));
554
- };
555
- DeductEvent.prototype.toJSONField = function () {
556
- return {
557
- key: this.key,
558
- id: this.id,
559
- user: this.user,
560
- log: (0, reified_1.fieldToJSON)("vector<u64>", this.log),
561
- bcsPadding: (0, reified_1.fieldToJSON)("vector<vector<u8>>", this.bcsPadding),
562
- };
563
- };
564
- DeductEvent.prototype.toJSON = function () {
565
- return __assign({ $typeName: this.$typeName, $typeArgs: this.$typeArgs }, this.toJSONField());
566
- };
567
- DeductEvent.fromJSONField = function (field) {
568
- return DeductEvent.reified().new({
569
- key: (0, reified_1.decodeFromJSONField)(structs_1.String.reified(), field.key),
570
- id: (0, reified_1.decodeFromJSONField)("address", field.id),
571
- user: (0, reified_1.decodeFromJSONField)("address", field.user),
572
- log: (0, reified_1.decodeFromJSONField)(reified.vector("u64"), field.log),
573
- bcsPadding: (0, reified_1.decodeFromJSONField)(reified.vector(reified.vector("u8")), field.bcsPadding),
574
- });
575
- };
576
- DeductEvent.fromJSON = function (json) {
577
- if (json.$typeName !== DeductEvent.$typeName) {
578
- throw new Error("not a WithTwoGenerics json object");
579
- }
580
- return DeductEvent.fromJSONField(json);
581
- };
582
- DeductEvent.fromSuiParsedData = function (content) {
583
- if (content.dataType !== "moveObject") {
584
- throw new Error("not an object");
585
- }
586
- if (!isDeductEvent(content.type)) {
587
- throw new Error("object at ".concat(content.fields.id, " is not a DeductEvent object"));
588
- }
589
- return DeductEvent.fromFieldsWithTypes(content);
590
- };
591
- DeductEvent.fromSuiObjectData = function (data) {
592
- if (data.bcs) {
593
- if (data.bcs.dataType !== "moveObject" || !isDeductEvent(data.bcs.type)) {
594
- throw new Error("object at is not a DeductEvent object");
595
- }
596
- return DeductEvent.fromBcs((0, utils_1.fromB64)(data.bcs.bcsBytes));
597
- }
598
- if (data.content) {
599
- return DeductEvent.fromSuiParsedData(data.content);
600
- }
601
- throw new Error("Both `bcs` and `content` fields are missing from the data. Include `showBcs` or `showContent` in the request.");
602
- };
603
- DeductEvent.fetch = function (client, id) {
604
- return __awaiter(this, void 0, void 0, function () {
605
- var res;
606
- var _a, _b;
607
- return __generator(this, function (_c) {
608
- switch (_c.label) {
609
- case 0: return [4 /*yield*/, client.getObject({ id: id, options: { showBcs: true } })];
610
- case 1:
611
- res = _c.sent();
612
- if (res.error) {
613
- throw new Error("error fetching DeductEvent object at id ".concat(id, ": ").concat(res.error.code));
614
- }
615
- if (((_b = (_a = res.data) === null || _a === void 0 ? void 0 : _a.bcs) === null || _b === void 0 ? void 0 : _b.dataType) !== "moveObject" || !isDeductEvent(res.data.bcs.type)) {
616
- throw new Error("object at id ".concat(id, " is not a DeductEvent object"));
617
- }
618
- return [2 /*return*/, DeductEvent.fromSuiObjectData(res.data)];
619
- }
620
- });
621
- });
622
- };
623
- DeductEvent.$typeName = "".concat(index_1.PKG_V5, "::leaderboard::DeductEvent");
624
- DeductEvent.$numTypeParams = 0;
625
- DeductEvent.$isPhantom = [];
626
- return DeductEvent;
627
- }());
628
- exports.DeductEvent = DeductEvent;
629
- /* ============================== ExtendLeaderboardEvent =============================== */
630
- function isExtendLeaderboardEvent(type) {
631
- type = (0, util_1.compressSuiType)(type);
632
- return type === "".concat(index_1.PKG_V1, "::leaderboard::ExtendLeaderboardEvent");
633
- }
634
- var ExtendLeaderboardEvent = /** @class */ (function () {
635
- function ExtendLeaderboardEvent(typeArgs, fields) {
636
- this.__StructClass = true;
637
- this.$typeName = ExtendLeaderboardEvent.$typeName;
638
- this.$isPhantom = ExtendLeaderboardEvent.$isPhantom;
639
- this.$fullTypeName = util_1.composeSuiType.apply(void 0, __spreadArray([ExtendLeaderboardEvent.$typeName], __read(typeArgs), false));
640
- this.$typeArgs = typeArgs;
641
- this.key = fields.key;
642
- this.id = fields.id;
643
- this.log = fields.log;
644
- this.bcsPadding = fields.bcsPadding;
645
- }
646
- ExtendLeaderboardEvent.reified = function () {
647
- var _this = this;
648
- return {
649
- typeName: ExtendLeaderboardEvent.$typeName,
650
- fullTypeName: util_1.composeSuiType.apply(void 0, __spreadArray([ExtendLeaderboardEvent.$typeName], [], false)),
651
- typeArgs: [],
652
- isPhantom: ExtendLeaderboardEvent.$isPhantom,
653
- reifiedTypeArgs: [],
654
- fromFields: function (fields) { return ExtendLeaderboardEvent.fromFields(fields); },
655
- fromFieldsWithTypes: function (item) { return ExtendLeaderboardEvent.fromFieldsWithTypes(item); },
656
- fromBcs: function (data) { return ExtendLeaderboardEvent.fromBcs(data); },
657
- bcs: ExtendLeaderboardEvent.bcs,
658
- fromJSONField: function (field) { return ExtendLeaderboardEvent.fromJSONField(field); },
659
- fromJSON: function (json) { return ExtendLeaderboardEvent.fromJSON(json); },
660
- fromSuiParsedData: function (content) { return ExtendLeaderboardEvent.fromSuiParsedData(content); },
661
- fromSuiObjectData: function (content) { return ExtendLeaderboardEvent.fromSuiObjectData(content); },
662
- fetch: function (client, id) { return __awaiter(_this, void 0, void 0, function () { return __generator(this, function (_a) {
663
- return [2 /*return*/, ExtendLeaderboardEvent.fetch(client, id)];
664
- }); }); },
665
- new: function (fields) {
666
- return new ExtendLeaderboardEvent([], fields);
667
- },
668
- kind: "StructClassReified",
669
- };
670
- };
671
- Object.defineProperty(ExtendLeaderboardEvent, "r", {
672
- get: function () {
673
- return ExtendLeaderboardEvent.reified();
674
- },
675
- enumerable: false,
676
- configurable: true
677
- });
678
- ExtendLeaderboardEvent.phantom = function () {
679
- return (0, reified_1.phantom)(ExtendLeaderboardEvent.reified());
680
- };
681
- Object.defineProperty(ExtendLeaderboardEvent, "p", {
682
- get: function () {
683
- return ExtendLeaderboardEvent.phantom();
684
- },
685
- enumerable: false,
686
- configurable: true
687
- });
688
- Object.defineProperty(ExtendLeaderboardEvent, "bcs", {
689
- get: function () {
690
- return bcs_1.bcs.struct("ExtendLeaderboardEvent", {
691
- key: structs_1.String.bcs,
692
- id: bcs_1.bcs.bytes(32).transform({ input: function (val) { return (0, utils_1.fromHEX)(val); }, output: function (val) { return (0, utils_1.toHEX)(val); } }),
693
- log: bcs_1.bcs.vector(bcs_1.bcs.u64()),
694
- bcs_padding: bcs_1.bcs.vector(bcs_1.bcs.vector(bcs_1.bcs.u8())),
695
- });
696
- },
697
- enumerable: false,
698
- configurable: true
699
- });
700
- ExtendLeaderboardEvent.fromFields = function (fields) {
701
- return ExtendLeaderboardEvent.reified().new({
702
- key: (0, reified_1.decodeFromFields)(structs_1.String.reified(), fields.key),
703
- id: (0, reified_1.decodeFromFields)("address", fields.id),
704
- log: (0, reified_1.decodeFromFields)(reified.vector("u64"), fields.log),
705
- bcsPadding: (0, reified_1.decodeFromFields)(reified.vector(reified.vector("u8")), fields.bcs_padding),
706
- });
707
- };
708
- ExtendLeaderboardEvent.fromFieldsWithTypes = function (item) {
709
- if (!isExtendLeaderboardEvent(item.type)) {
710
- throw new Error("not a ExtendLeaderboardEvent type");
711
- }
712
- return ExtendLeaderboardEvent.reified().new({
713
- key: (0, reified_1.decodeFromFieldsWithTypes)(structs_1.String.reified(), item.fields.key),
714
- id: (0, reified_1.decodeFromFieldsWithTypes)("address", item.fields.id),
715
- log: (0, reified_1.decodeFromFieldsWithTypes)(reified.vector("u64"), item.fields.log),
716
- bcsPadding: (0, reified_1.decodeFromFieldsWithTypes)(reified.vector(reified.vector("u8")), item.fields.bcs_padding),
717
- });
718
- };
719
- ExtendLeaderboardEvent.fromBcs = function (data) {
720
- return ExtendLeaderboardEvent.fromFields(ExtendLeaderboardEvent.bcs.parse(data));
721
- };
722
- ExtendLeaderboardEvent.prototype.toJSONField = function () {
723
- return {
724
- key: this.key,
725
- id: this.id,
726
- log: (0, reified_1.fieldToJSON)("vector<u64>", this.log),
727
- bcsPadding: (0, reified_1.fieldToJSON)("vector<vector<u8>>", this.bcsPadding),
728
- };
729
- };
730
- ExtendLeaderboardEvent.prototype.toJSON = function () {
731
- return __assign({ $typeName: this.$typeName, $typeArgs: this.$typeArgs }, this.toJSONField());
732
- };
733
- ExtendLeaderboardEvent.fromJSONField = function (field) {
734
- return ExtendLeaderboardEvent.reified().new({
735
- key: (0, reified_1.decodeFromJSONField)(structs_1.String.reified(), field.key),
736
- id: (0, reified_1.decodeFromJSONField)("address", field.id),
737
- log: (0, reified_1.decodeFromJSONField)(reified.vector("u64"), field.log),
738
- bcsPadding: (0, reified_1.decodeFromJSONField)(reified.vector(reified.vector("u8")), field.bcsPadding),
739
- });
740
- };
741
- ExtendLeaderboardEvent.fromJSON = function (json) {
742
- if (json.$typeName !== ExtendLeaderboardEvent.$typeName) {
743
- throw new Error("not a WithTwoGenerics json object");
744
- }
745
- return ExtendLeaderboardEvent.fromJSONField(json);
746
- };
747
- ExtendLeaderboardEvent.fromSuiParsedData = function (content) {
748
- if (content.dataType !== "moveObject") {
749
- throw new Error("not an object");
750
- }
751
- if (!isExtendLeaderboardEvent(content.type)) {
752
- throw new Error("object at ".concat(content.fields.id, " is not a ExtendLeaderboardEvent object"));
753
- }
754
- return ExtendLeaderboardEvent.fromFieldsWithTypes(content);
755
- };
756
- ExtendLeaderboardEvent.fromSuiObjectData = function (data) {
757
- if (data.bcs) {
758
- if (data.bcs.dataType !== "moveObject" || !isExtendLeaderboardEvent(data.bcs.type)) {
759
- throw new Error("object at is not a ExtendLeaderboardEvent object");
760
- }
761
- return ExtendLeaderboardEvent.fromBcs((0, utils_1.fromB64)(data.bcs.bcsBytes));
762
- }
763
- if (data.content) {
764
- return ExtendLeaderboardEvent.fromSuiParsedData(data.content);
765
- }
766
- throw new Error("Both `bcs` and `content` fields are missing from the data. Include `showBcs` or `showContent` in the request.");
767
- };
768
- ExtendLeaderboardEvent.fetch = function (client, id) {
769
- return __awaiter(this, void 0, void 0, function () {
770
- var res;
771
- var _a, _b;
772
- return __generator(this, function (_c) {
773
- switch (_c.label) {
774
- case 0: return [4 /*yield*/, client.getObject({ id: id, options: { showBcs: true } })];
775
- case 1:
776
- res = _c.sent();
777
- if (res.error) {
778
- throw new Error("error fetching ExtendLeaderboardEvent object at id ".concat(id, ": ").concat(res.error.code));
779
- }
780
- if (((_b = (_a = res.data) === null || _a === void 0 ? void 0 : _a.bcs) === null || _b === void 0 ? void 0 : _b.dataType) !== "moveObject" || !isExtendLeaderboardEvent(res.data.bcs.type)) {
781
- throw new Error("object at id ".concat(id, " is not a ExtendLeaderboardEvent object"));
782
- }
783
- return [2 /*return*/, ExtendLeaderboardEvent.fromSuiObjectData(res.data)];
784
- }
785
- });
786
- });
787
- };
788
- ExtendLeaderboardEvent.$typeName = "".concat(index_1.PKG_V1, "::leaderboard::ExtendLeaderboardEvent");
789
- ExtendLeaderboardEvent.$numTypeParams = 0;
790
- ExtendLeaderboardEvent.$isPhantom = [];
791
- return ExtendLeaderboardEvent;
792
- }());
793
- exports.ExtendLeaderboardEvent = ExtendLeaderboardEvent;
794
- /* ============================== Leaderboard =============================== */
795
- function isLeaderboard(type) {
796
- type = (0, util_1.compressSuiType)(type);
797
- return type === "".concat(index_1.PKG_V1, "::leaderboard::Leaderboard");
798
- }
799
- var Leaderboard = /** @class */ (function () {
800
- function Leaderboard(typeArgs, fields) {
801
- this.__StructClass = true;
802
- this.$typeName = Leaderboard.$typeName;
803
- this.$isPhantom = Leaderboard.$isPhantom;
804
- this.$fullTypeName = util_1.composeSuiType.apply(void 0, __spreadArray([Leaderboard.$typeName], __read(typeArgs), false));
805
- this.$typeArgs = typeArgs;
806
- this.id = fields.id;
807
- this.startTsMs = fields.startTsMs;
808
- this.endTsMs = fields.endTsMs;
809
- this.score = fields.score;
810
- this.ranking = fields.ranking;
811
- }
812
- Leaderboard.reified = function () {
813
- var _this = this;
814
- return {
815
- typeName: Leaderboard.$typeName,
816
- fullTypeName: util_1.composeSuiType.apply(void 0, __spreadArray([Leaderboard.$typeName], [], false)),
817
- typeArgs: [],
818
- isPhantom: Leaderboard.$isPhantom,
819
- reifiedTypeArgs: [],
820
- fromFields: function (fields) { return Leaderboard.fromFields(fields); },
821
- fromFieldsWithTypes: function (item) { return Leaderboard.fromFieldsWithTypes(item); },
822
- fromBcs: function (data) { return Leaderboard.fromBcs(data); },
823
- bcs: Leaderboard.bcs,
824
- fromJSONField: function (field) { return Leaderboard.fromJSONField(field); },
825
- fromJSON: function (json) { return Leaderboard.fromJSON(json); },
826
- fromSuiParsedData: function (content) { return Leaderboard.fromSuiParsedData(content); },
827
- fromSuiObjectData: function (content) { return Leaderboard.fromSuiObjectData(content); },
828
- fetch: function (client, id) { return __awaiter(_this, void 0, void 0, function () { return __generator(this, function (_a) {
829
- return [2 /*return*/, Leaderboard.fetch(client, id)];
830
- }); }); },
831
- new: function (fields) {
832
- return new Leaderboard([], fields);
833
- },
834
- kind: "StructClassReified",
835
- };
836
- };
837
- Object.defineProperty(Leaderboard, "r", {
838
- get: function () {
839
- return Leaderboard.reified();
840
- },
841
- enumerable: false,
842
- configurable: true
843
- });
844
- Leaderboard.phantom = function () {
845
- return (0, reified_1.phantom)(Leaderboard.reified());
846
- };
847
- Object.defineProperty(Leaderboard, "p", {
848
- get: function () {
849
- return Leaderboard.phantom();
850
- },
851
- enumerable: false,
852
- configurable: true
853
- });
854
- Object.defineProperty(Leaderboard, "bcs", {
855
- get: function () {
856
- return bcs_1.bcs.struct("Leaderboard", {
857
- id: structs_2.UID.bcs,
858
- start_ts_ms: bcs_1.bcs.u64(),
859
- end_ts_ms: bcs_1.bcs.u64(),
860
- score: structs_3.Table.bcs,
861
- ranking: structs_4.CritbitTree.bcs(structs_5.LinkedSet.bcs(bcs_1.bcs.bytes(32).transform({ input: function (val) { return (0, utils_1.fromHEX)(val); }, output: function (val) { return (0, utils_1.toHEX)(val); } }))),
862
- });
863
- },
864
- enumerable: false,
865
- configurable: true
866
- });
867
- Leaderboard.fromFields = function (fields) {
868
- return Leaderboard.reified().new({
869
- id: (0, reified_1.decodeFromFields)(structs_2.UID.reified(), fields.id),
870
- startTsMs: (0, reified_1.decodeFromFields)("u64", fields.start_ts_ms),
871
- endTsMs: (0, reified_1.decodeFromFields)("u64", fields.end_ts_ms),
872
- score: (0, reified_1.decodeFromFields)(structs_3.Table.reified(reified.phantom("address"), reified.phantom("u64")), fields.score),
873
- ranking: (0, reified_1.decodeFromFields)(structs_4.CritbitTree.reified(structs_5.LinkedSet.reified("address")), fields.ranking),
874
- });
875
- };
876
- Leaderboard.fromFieldsWithTypes = function (item) {
877
- if (!isLeaderboard(item.type)) {
878
- throw new Error("not a Leaderboard type");
879
- }
880
- return Leaderboard.reified().new({
881
- id: (0, reified_1.decodeFromFieldsWithTypes)(structs_2.UID.reified(), item.fields.id),
882
- startTsMs: (0, reified_1.decodeFromFieldsWithTypes)("u64", item.fields.start_ts_ms),
883
- endTsMs: (0, reified_1.decodeFromFieldsWithTypes)("u64", item.fields.end_ts_ms),
884
- score: (0, reified_1.decodeFromFieldsWithTypes)(structs_3.Table.reified(reified.phantom("address"), reified.phantom("u64")), item.fields.score),
885
- ranking: (0, reified_1.decodeFromFieldsWithTypes)(structs_4.CritbitTree.reified(structs_5.LinkedSet.reified("address")), item.fields.ranking),
886
- });
887
- };
888
- Leaderboard.fromBcs = function (data) {
889
- return Leaderboard.fromFields(Leaderboard.bcs.parse(data));
890
- };
891
- Leaderboard.prototype.toJSONField = function () {
892
- return {
893
- id: this.id,
894
- startTsMs: this.startTsMs.toString(),
895
- endTsMs: this.endTsMs.toString(),
896
- score: this.score.toJSONField(),
897
- ranking: this.ranking.toJSONField(),
898
- };
899
- };
900
- Leaderboard.prototype.toJSON = function () {
901
- return __assign({ $typeName: this.$typeName, $typeArgs: this.$typeArgs }, this.toJSONField());
902
- };
903
- Leaderboard.fromJSONField = function (field) {
904
- return Leaderboard.reified().new({
905
- id: (0, reified_1.decodeFromJSONField)(structs_2.UID.reified(), field.id),
906
- startTsMs: (0, reified_1.decodeFromJSONField)("u64", field.startTsMs),
907
- endTsMs: (0, reified_1.decodeFromJSONField)("u64", field.endTsMs),
908
- score: (0, reified_1.decodeFromJSONField)(structs_3.Table.reified(reified.phantom("address"), reified.phantom("u64")), field.score),
909
- ranking: (0, reified_1.decodeFromJSONField)(structs_4.CritbitTree.reified(structs_5.LinkedSet.reified("address")), field.ranking),
910
- });
911
- };
912
- Leaderboard.fromJSON = function (json) {
913
- if (json.$typeName !== Leaderboard.$typeName) {
914
- throw new Error("not a WithTwoGenerics json object");
915
- }
916
- return Leaderboard.fromJSONField(json);
917
- };
918
- Leaderboard.fromSuiParsedData = function (content) {
919
- if (content.dataType !== "moveObject") {
920
- throw new Error("not an object");
921
- }
922
- if (!isLeaderboard(content.type)) {
923
- throw new Error("object at ".concat(content.fields.id, " is not a Leaderboard object"));
924
- }
925
- return Leaderboard.fromFieldsWithTypes(content);
926
- };
927
- Leaderboard.fromSuiObjectData = function (data) {
928
- if (data.bcs) {
929
- if (data.bcs.dataType !== "moveObject" || !isLeaderboard(data.bcs.type)) {
930
- throw new Error("object at is not a Leaderboard object");
931
- }
932
- return Leaderboard.fromBcs((0, utils_1.fromB64)(data.bcs.bcsBytes));
933
- }
934
- if (data.content) {
935
- return Leaderboard.fromSuiParsedData(data.content);
936
- }
937
- throw new Error("Both `bcs` and `content` fields are missing from the data. Include `showBcs` or `showContent` in the request.");
938
- };
939
- Leaderboard.fetch = function (client, id) {
940
- return __awaiter(this, void 0, void 0, function () {
941
- var res;
942
- var _a, _b;
943
- return __generator(this, function (_c) {
944
- switch (_c.label) {
945
- case 0: return [4 /*yield*/, client.getObject({ id: id, options: { showBcs: true } })];
946
- case 1:
947
- res = _c.sent();
948
- if (res.error) {
949
- throw new Error("error fetching Leaderboard object at id ".concat(id, ": ").concat(res.error.code));
950
- }
951
- if (((_b = (_a = res.data) === null || _a === void 0 ? void 0 : _a.bcs) === null || _b === void 0 ? void 0 : _b.dataType) !== "moveObject" || !isLeaderboard(res.data.bcs.type)) {
952
- throw new Error("object at id ".concat(id, " is not a Leaderboard object"));
953
- }
954
- return [2 /*return*/, Leaderboard.fromSuiObjectData(res.data)];
955
- }
956
- });
957
- });
958
- };
959
- Leaderboard.$typeName = "".concat(index_1.PKG_V1, "::leaderboard::Leaderboard");
960
- Leaderboard.$numTypeParams = 0;
961
- Leaderboard.$isPhantom = [];
962
- return Leaderboard;
963
- }());
964
- exports.Leaderboard = Leaderboard;
965
- /* ============================== RemoveLeaderboardEvent =============================== */
966
- function isRemoveLeaderboardEvent(type) {
967
- type = (0, util_1.compressSuiType)(type);
968
- return type === "".concat(index_1.PKG_V1, "::leaderboard::RemoveLeaderboardEvent");
969
- }
970
- var RemoveLeaderboardEvent = /** @class */ (function () {
971
- function RemoveLeaderboardEvent(typeArgs, fields) {
972
- this.__StructClass = true;
973
- this.$typeName = RemoveLeaderboardEvent.$typeName;
974
- this.$isPhantom = RemoveLeaderboardEvent.$isPhantom;
975
- this.$fullTypeName = util_1.composeSuiType.apply(void 0, __spreadArray([RemoveLeaderboardEvent.$typeName], __read(typeArgs), false));
976
- this.$typeArgs = typeArgs;
977
- this.key = fields.key;
978
- this.id = fields.id;
979
- this.log = fields.log;
980
- this.bcsPadding = fields.bcsPadding;
981
- }
982
- RemoveLeaderboardEvent.reified = function () {
983
- var _this = this;
984
- return {
985
- typeName: RemoveLeaderboardEvent.$typeName,
986
- fullTypeName: util_1.composeSuiType.apply(void 0, __spreadArray([RemoveLeaderboardEvent.$typeName], [], false)),
987
- typeArgs: [],
988
- isPhantom: RemoveLeaderboardEvent.$isPhantom,
989
- reifiedTypeArgs: [],
990
- fromFields: function (fields) { return RemoveLeaderboardEvent.fromFields(fields); },
991
- fromFieldsWithTypes: function (item) { return RemoveLeaderboardEvent.fromFieldsWithTypes(item); },
992
- fromBcs: function (data) { return RemoveLeaderboardEvent.fromBcs(data); },
993
- bcs: RemoveLeaderboardEvent.bcs,
994
- fromJSONField: function (field) { return RemoveLeaderboardEvent.fromJSONField(field); },
995
- fromJSON: function (json) { return RemoveLeaderboardEvent.fromJSON(json); },
996
- fromSuiParsedData: function (content) { return RemoveLeaderboardEvent.fromSuiParsedData(content); },
997
- fromSuiObjectData: function (content) { return RemoveLeaderboardEvent.fromSuiObjectData(content); },
998
- fetch: function (client, id) { return __awaiter(_this, void 0, void 0, function () { return __generator(this, function (_a) {
999
- return [2 /*return*/, RemoveLeaderboardEvent.fetch(client, id)];
1000
- }); }); },
1001
- new: function (fields) {
1002
- return new RemoveLeaderboardEvent([], fields);
1003
- },
1004
- kind: "StructClassReified",
1005
- };
1006
- };
1007
- Object.defineProperty(RemoveLeaderboardEvent, "r", {
1008
- get: function () {
1009
- return RemoveLeaderboardEvent.reified();
1010
- },
1011
- enumerable: false,
1012
- configurable: true
1013
- });
1014
- RemoveLeaderboardEvent.phantom = function () {
1015
- return (0, reified_1.phantom)(RemoveLeaderboardEvent.reified());
1016
- };
1017
- Object.defineProperty(RemoveLeaderboardEvent, "p", {
1018
- get: function () {
1019
- return RemoveLeaderboardEvent.phantom();
1020
- },
1021
- enumerable: false,
1022
- configurable: true
1023
- });
1024
- Object.defineProperty(RemoveLeaderboardEvent, "bcs", {
1025
- get: function () {
1026
- return bcs_1.bcs.struct("RemoveLeaderboardEvent", {
1027
- key: structs_1.String.bcs,
1028
- id: bcs_1.bcs.bytes(32).transform({ input: function (val) { return (0, utils_1.fromHEX)(val); }, output: function (val) { return (0, utils_1.toHEX)(val); } }),
1029
- log: bcs_1.bcs.vector(bcs_1.bcs.u64()),
1030
- bcs_padding: bcs_1.bcs.vector(bcs_1.bcs.vector(bcs_1.bcs.u8())),
1031
- });
1032
- },
1033
- enumerable: false,
1034
- configurable: true
1035
- });
1036
- RemoveLeaderboardEvent.fromFields = function (fields) {
1037
- return RemoveLeaderboardEvent.reified().new({
1038
- key: (0, reified_1.decodeFromFields)(structs_1.String.reified(), fields.key),
1039
- id: (0, reified_1.decodeFromFields)("address", fields.id),
1040
- log: (0, reified_1.decodeFromFields)(reified.vector("u64"), fields.log),
1041
- bcsPadding: (0, reified_1.decodeFromFields)(reified.vector(reified.vector("u8")), fields.bcs_padding),
1042
- });
1043
- };
1044
- RemoveLeaderboardEvent.fromFieldsWithTypes = function (item) {
1045
- if (!isRemoveLeaderboardEvent(item.type)) {
1046
- throw new Error("not a RemoveLeaderboardEvent type");
1047
- }
1048
- return RemoveLeaderboardEvent.reified().new({
1049
- key: (0, reified_1.decodeFromFieldsWithTypes)(structs_1.String.reified(), item.fields.key),
1050
- id: (0, reified_1.decodeFromFieldsWithTypes)("address", item.fields.id),
1051
- log: (0, reified_1.decodeFromFieldsWithTypes)(reified.vector("u64"), item.fields.log),
1052
- bcsPadding: (0, reified_1.decodeFromFieldsWithTypes)(reified.vector(reified.vector("u8")), item.fields.bcs_padding),
1053
- });
1054
- };
1055
- RemoveLeaderboardEvent.fromBcs = function (data) {
1056
- return RemoveLeaderboardEvent.fromFields(RemoveLeaderboardEvent.bcs.parse(data));
1057
- };
1058
- RemoveLeaderboardEvent.prototype.toJSONField = function () {
1059
- return {
1060
- key: this.key,
1061
- id: this.id,
1062
- log: (0, reified_1.fieldToJSON)("vector<u64>", this.log),
1063
- bcsPadding: (0, reified_1.fieldToJSON)("vector<vector<u8>>", this.bcsPadding),
1064
- };
1065
- };
1066
- RemoveLeaderboardEvent.prototype.toJSON = function () {
1067
- return __assign({ $typeName: this.$typeName, $typeArgs: this.$typeArgs }, this.toJSONField());
1068
- };
1069
- RemoveLeaderboardEvent.fromJSONField = function (field) {
1070
- return RemoveLeaderboardEvent.reified().new({
1071
- key: (0, reified_1.decodeFromJSONField)(structs_1.String.reified(), field.key),
1072
- id: (0, reified_1.decodeFromJSONField)("address", field.id),
1073
- log: (0, reified_1.decodeFromJSONField)(reified.vector("u64"), field.log),
1074
- bcsPadding: (0, reified_1.decodeFromJSONField)(reified.vector(reified.vector("u8")), field.bcsPadding),
1075
- });
1076
- };
1077
- RemoveLeaderboardEvent.fromJSON = function (json) {
1078
- if (json.$typeName !== RemoveLeaderboardEvent.$typeName) {
1079
- throw new Error("not a WithTwoGenerics json object");
1080
- }
1081
- return RemoveLeaderboardEvent.fromJSONField(json);
1082
- };
1083
- RemoveLeaderboardEvent.fromSuiParsedData = function (content) {
1084
- if (content.dataType !== "moveObject") {
1085
- throw new Error("not an object");
1086
- }
1087
- if (!isRemoveLeaderboardEvent(content.type)) {
1088
- throw new Error("object at ".concat(content.fields.id, " is not a RemoveLeaderboardEvent object"));
1089
- }
1090
- return RemoveLeaderboardEvent.fromFieldsWithTypes(content);
1091
- };
1092
- RemoveLeaderboardEvent.fromSuiObjectData = function (data) {
1093
- if (data.bcs) {
1094
- if (data.bcs.dataType !== "moveObject" || !isRemoveLeaderboardEvent(data.bcs.type)) {
1095
- throw new Error("object at is not a RemoveLeaderboardEvent object");
1096
- }
1097
- return RemoveLeaderboardEvent.fromBcs((0, utils_1.fromB64)(data.bcs.bcsBytes));
1098
- }
1099
- if (data.content) {
1100
- return RemoveLeaderboardEvent.fromSuiParsedData(data.content);
1101
- }
1102
- throw new Error("Both `bcs` and `content` fields are missing from the data. Include `showBcs` or `showContent` in the request.");
1103
- };
1104
- RemoveLeaderboardEvent.fetch = function (client, id) {
1105
- return __awaiter(this, void 0, void 0, function () {
1106
- var res;
1107
- var _a, _b;
1108
- return __generator(this, function (_c) {
1109
- switch (_c.label) {
1110
- case 0: return [4 /*yield*/, client.getObject({ id: id, options: { showBcs: true } })];
1111
- case 1:
1112
- res = _c.sent();
1113
- if (res.error) {
1114
- throw new Error("error fetching RemoveLeaderboardEvent object at id ".concat(id, ": ").concat(res.error.code));
1115
- }
1116
- if (((_b = (_a = res.data) === null || _a === void 0 ? void 0 : _a.bcs) === null || _b === void 0 ? void 0 : _b.dataType) !== "moveObject" || !isRemoveLeaderboardEvent(res.data.bcs.type)) {
1117
- throw new Error("object at id ".concat(id, " is not a RemoveLeaderboardEvent object"));
1118
- }
1119
- return [2 /*return*/, RemoveLeaderboardEvent.fromSuiObjectData(res.data)];
1120
- }
1121
- });
1122
- });
1123
- };
1124
- RemoveLeaderboardEvent.$typeName = "".concat(index_1.PKG_V1, "::leaderboard::RemoveLeaderboardEvent");
1125
- RemoveLeaderboardEvent.$numTypeParams = 0;
1126
- RemoveLeaderboardEvent.$isPhantom = [];
1127
- return RemoveLeaderboardEvent;
1128
- }());
1129
- exports.RemoveLeaderboardEvent = RemoveLeaderboardEvent;
1130
- /* ============================== ScoreEvent =============================== */
1131
- function isScoreEvent(type) {
1132
- type = (0, util_1.compressSuiType)(type);
1133
- return type === "".concat(index_1.PKG_V1, "::leaderboard::ScoreEvent");
1134
- }
1135
- var ScoreEvent = /** @class */ (function () {
1136
- function ScoreEvent(typeArgs, fields) {
1137
- this.__StructClass = true;
1138
- this.$typeName = ScoreEvent.$typeName;
1139
- this.$isPhantom = ScoreEvent.$isPhantom;
1140
- this.$fullTypeName = util_1.composeSuiType.apply(void 0, __spreadArray([ScoreEvent.$typeName], __read(typeArgs), false));
1141
- this.$typeArgs = typeArgs;
1142
- this.key = fields.key;
1143
- this.id = fields.id;
1144
- this.user = fields.user;
1145
- this.log = fields.log;
1146
- this.bcsPadding = fields.bcsPadding;
1147
- }
1148
- ScoreEvent.reified = function () {
1149
- var _this = this;
1150
- return {
1151
- typeName: ScoreEvent.$typeName,
1152
- fullTypeName: util_1.composeSuiType.apply(void 0, __spreadArray([ScoreEvent.$typeName], [], false)),
1153
- typeArgs: [],
1154
- isPhantom: ScoreEvent.$isPhantom,
1155
- reifiedTypeArgs: [],
1156
- fromFields: function (fields) { return ScoreEvent.fromFields(fields); },
1157
- fromFieldsWithTypes: function (item) { return ScoreEvent.fromFieldsWithTypes(item); },
1158
- fromBcs: function (data) { return ScoreEvent.fromBcs(data); },
1159
- bcs: ScoreEvent.bcs,
1160
- fromJSONField: function (field) { return ScoreEvent.fromJSONField(field); },
1161
- fromJSON: function (json) { return ScoreEvent.fromJSON(json); },
1162
- fromSuiParsedData: function (content) { return ScoreEvent.fromSuiParsedData(content); },
1163
- fromSuiObjectData: function (content) { return ScoreEvent.fromSuiObjectData(content); },
1164
- fetch: function (client, id) { return __awaiter(_this, void 0, void 0, function () { return __generator(this, function (_a) {
1165
- return [2 /*return*/, ScoreEvent.fetch(client, id)];
1166
- }); }); },
1167
- new: function (fields) {
1168
- return new ScoreEvent([], fields);
1169
- },
1170
- kind: "StructClassReified",
1171
- };
1172
- };
1173
- Object.defineProperty(ScoreEvent, "r", {
1174
- get: function () {
1175
- return ScoreEvent.reified();
1176
- },
1177
- enumerable: false,
1178
- configurable: true
1179
- });
1180
- ScoreEvent.phantom = function () {
1181
- return (0, reified_1.phantom)(ScoreEvent.reified());
1182
- };
1183
- Object.defineProperty(ScoreEvent, "p", {
1184
- get: function () {
1185
- return ScoreEvent.phantom();
1186
- },
1187
- enumerable: false,
1188
- configurable: true
1189
- });
1190
- Object.defineProperty(ScoreEvent, "bcs", {
1191
- get: function () {
1192
- return bcs_1.bcs.struct("ScoreEvent", {
1193
- key: structs_1.String.bcs,
1194
- id: bcs_1.bcs.bytes(32).transform({ input: function (val) { return (0, utils_1.fromHEX)(val); }, output: function (val) { return (0, utils_1.toHEX)(val); } }),
1195
- 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); } }),
1196
- log: bcs_1.bcs.vector(bcs_1.bcs.u64()),
1197
- bcs_padding: bcs_1.bcs.vector(bcs_1.bcs.vector(bcs_1.bcs.u8())),
1198
- });
1199
- },
1200
- enumerable: false,
1201
- configurable: true
1202
- });
1203
- ScoreEvent.fromFields = function (fields) {
1204
- return ScoreEvent.reified().new({
1205
- key: (0, reified_1.decodeFromFields)(structs_1.String.reified(), fields.key),
1206
- id: (0, reified_1.decodeFromFields)("address", fields.id),
1207
- user: (0, reified_1.decodeFromFields)("address", fields.user),
1208
- log: (0, reified_1.decodeFromFields)(reified.vector("u64"), fields.log),
1209
- bcsPadding: (0, reified_1.decodeFromFields)(reified.vector(reified.vector("u8")), fields.bcs_padding),
1210
- });
1211
- };
1212
- ScoreEvent.fromFieldsWithTypes = function (item) {
1213
- if (!isScoreEvent(item.type)) {
1214
- throw new Error("not a ScoreEvent type");
1215
- }
1216
- return ScoreEvent.reified().new({
1217
- key: (0, reified_1.decodeFromFieldsWithTypes)(structs_1.String.reified(), item.fields.key),
1218
- id: (0, reified_1.decodeFromFieldsWithTypes)("address", item.fields.id),
1219
- user: (0, reified_1.decodeFromFieldsWithTypes)("address", item.fields.user),
1220
- log: (0, reified_1.decodeFromFieldsWithTypes)(reified.vector("u64"), item.fields.log),
1221
- bcsPadding: (0, reified_1.decodeFromFieldsWithTypes)(reified.vector(reified.vector("u8")), item.fields.bcs_padding),
1222
- });
1223
- };
1224
- ScoreEvent.fromBcs = function (data) {
1225
- return ScoreEvent.fromFields(ScoreEvent.bcs.parse(data));
1226
- };
1227
- ScoreEvent.prototype.toJSONField = function () {
1228
- return {
1229
- key: this.key,
1230
- id: this.id,
1231
- user: this.user,
1232
- log: (0, reified_1.fieldToJSON)("vector<u64>", this.log),
1233
- bcsPadding: (0, reified_1.fieldToJSON)("vector<vector<u8>>", this.bcsPadding),
1234
- };
1235
- };
1236
- ScoreEvent.prototype.toJSON = function () {
1237
- return __assign({ $typeName: this.$typeName, $typeArgs: this.$typeArgs }, this.toJSONField());
1238
- };
1239
- ScoreEvent.fromJSONField = function (field) {
1240
- return ScoreEvent.reified().new({
1241
- key: (0, reified_1.decodeFromJSONField)(structs_1.String.reified(), field.key),
1242
- id: (0, reified_1.decodeFromJSONField)("address", field.id),
1243
- user: (0, reified_1.decodeFromJSONField)("address", field.user),
1244
- log: (0, reified_1.decodeFromJSONField)(reified.vector("u64"), field.log),
1245
- bcsPadding: (0, reified_1.decodeFromJSONField)(reified.vector(reified.vector("u8")), field.bcsPadding),
1246
- });
1247
- };
1248
- ScoreEvent.fromJSON = function (json) {
1249
- if (json.$typeName !== ScoreEvent.$typeName) {
1250
- throw new Error("not a WithTwoGenerics json object");
1251
- }
1252
- return ScoreEvent.fromJSONField(json);
1253
- };
1254
- ScoreEvent.fromSuiParsedData = function (content) {
1255
- if (content.dataType !== "moveObject") {
1256
- throw new Error("not an object");
1257
- }
1258
- if (!isScoreEvent(content.type)) {
1259
- throw new Error("object at ".concat(content.fields.id, " is not a ScoreEvent object"));
1260
- }
1261
- return ScoreEvent.fromFieldsWithTypes(content);
1262
- };
1263
- ScoreEvent.fromSuiObjectData = function (data) {
1264
- if (data.bcs) {
1265
- if (data.bcs.dataType !== "moveObject" || !isScoreEvent(data.bcs.type)) {
1266
- throw new Error("object at is not a ScoreEvent object");
1267
- }
1268
- return ScoreEvent.fromBcs((0, utils_1.fromB64)(data.bcs.bcsBytes));
1269
- }
1270
- if (data.content) {
1271
- return ScoreEvent.fromSuiParsedData(data.content);
1272
- }
1273
- throw new Error("Both `bcs` and `content` fields are missing from the data. Include `showBcs` or `showContent` in the request.");
1274
- };
1275
- ScoreEvent.fetch = function (client, id) {
1276
- return __awaiter(this, void 0, void 0, function () {
1277
- var res;
1278
- var _a, _b;
1279
- return __generator(this, function (_c) {
1280
- switch (_c.label) {
1281
- case 0: return [4 /*yield*/, client.getObject({ id: id, options: { showBcs: true } })];
1282
- case 1:
1283
- res = _c.sent();
1284
- if (res.error) {
1285
- throw new Error("error fetching ScoreEvent object at id ".concat(id, ": ").concat(res.error.code));
1286
- }
1287
- if (((_b = (_a = res.data) === null || _a === void 0 ? void 0 : _a.bcs) === null || _b === void 0 ? void 0 : _b.dataType) !== "moveObject" || !isScoreEvent(res.data.bcs.type)) {
1288
- throw new Error("object at id ".concat(id, " is not a ScoreEvent object"));
1289
- }
1290
- return [2 /*return*/, ScoreEvent.fromSuiObjectData(res.data)];
1291
- }
1292
- });
1293
- });
1294
- };
1295
- ScoreEvent.$typeName = "".concat(index_1.PKG_V1, "::leaderboard::ScoreEvent");
1296
- ScoreEvent.$numTypeParams = 0;
1297
- ScoreEvent.$isPhantom = [];
1298
- return ScoreEvent;
1299
- }());
1300
- exports.ScoreEvent = ScoreEvent;
1301
- /* ============================== TypusLeaderboardRegistry =============================== */
1302
- function isTypusLeaderboardRegistry(type) {
1303
- type = (0, util_1.compressSuiType)(type);
1304
- return type === "".concat(index_1.PKG_V1, "::leaderboard::TypusLeaderboardRegistry");
1305
- }
1306
- var TypusLeaderboardRegistry = /** @class */ (function () {
1307
- function TypusLeaderboardRegistry(typeArgs, fields) {
1308
- this.__StructClass = true;
1309
- this.$typeName = TypusLeaderboardRegistry.$typeName;
1310
- this.$isPhantom = TypusLeaderboardRegistry.$isPhantom;
1311
- this.$fullTypeName = util_1.composeSuiType.apply(void 0, __spreadArray([TypusLeaderboardRegistry.$typeName], __read(typeArgs), false));
1312
- this.$typeArgs = typeArgs;
1313
- this.id = fields.id;
1314
- this.activeLeaderboardRegistry = fields.activeLeaderboardRegistry;
1315
- this.inactiveLeaderboardRegistry = fields.inactiveLeaderboardRegistry;
1316
- }
1317
- TypusLeaderboardRegistry.reified = function () {
1318
- var _this = this;
1319
- return {
1320
- typeName: TypusLeaderboardRegistry.$typeName,
1321
- fullTypeName: util_1.composeSuiType.apply(void 0, __spreadArray([TypusLeaderboardRegistry.$typeName], [], false)),
1322
- typeArgs: [],
1323
- isPhantom: TypusLeaderboardRegistry.$isPhantom,
1324
- reifiedTypeArgs: [],
1325
- fromFields: function (fields) { return TypusLeaderboardRegistry.fromFields(fields); },
1326
- fromFieldsWithTypes: function (item) { return TypusLeaderboardRegistry.fromFieldsWithTypes(item); },
1327
- fromBcs: function (data) { return TypusLeaderboardRegistry.fromBcs(data); },
1328
- bcs: TypusLeaderboardRegistry.bcs,
1329
- fromJSONField: function (field) { return TypusLeaderboardRegistry.fromJSONField(field); },
1330
- fromJSON: function (json) { return TypusLeaderboardRegistry.fromJSON(json); },
1331
- fromSuiParsedData: function (content) { return TypusLeaderboardRegistry.fromSuiParsedData(content); },
1332
- fromSuiObjectData: function (content) { return TypusLeaderboardRegistry.fromSuiObjectData(content); },
1333
- fetch: function (client, id) { return __awaiter(_this, void 0, void 0, function () { return __generator(this, function (_a) {
1334
- return [2 /*return*/, TypusLeaderboardRegistry.fetch(client, id)];
1335
- }); }); },
1336
- new: function (fields) {
1337
- return new TypusLeaderboardRegistry([], fields);
1338
- },
1339
- kind: "StructClassReified",
1340
- };
1341
- };
1342
- Object.defineProperty(TypusLeaderboardRegistry, "r", {
1343
- get: function () {
1344
- return TypusLeaderboardRegistry.reified();
1345
- },
1346
- enumerable: false,
1347
- configurable: true
1348
- });
1349
- TypusLeaderboardRegistry.phantom = function () {
1350
- return (0, reified_1.phantom)(TypusLeaderboardRegistry.reified());
1351
- };
1352
- Object.defineProperty(TypusLeaderboardRegistry, "p", {
1353
- get: function () {
1354
- return TypusLeaderboardRegistry.phantom();
1355
- },
1356
- enumerable: false,
1357
- configurable: true
1358
- });
1359
- Object.defineProperty(TypusLeaderboardRegistry, "bcs", {
1360
- get: function () {
1361
- return bcs_1.bcs.struct("TypusLeaderboardRegistry", {
1362
- id: structs_2.UID.bcs,
1363
- active_leaderboard_registry: structs_2.UID.bcs,
1364
- inactive_leaderboard_registry: structs_2.UID.bcs,
1365
- });
1366
- },
1367
- enumerable: false,
1368
- configurable: true
1369
- });
1370
- TypusLeaderboardRegistry.fromFields = function (fields) {
1371
- return TypusLeaderboardRegistry.reified().new({
1372
- id: (0, reified_1.decodeFromFields)(structs_2.UID.reified(), fields.id),
1373
- activeLeaderboardRegistry: (0, reified_1.decodeFromFields)(structs_2.UID.reified(), fields.active_leaderboard_registry),
1374
- inactiveLeaderboardRegistry: (0, reified_1.decodeFromFields)(structs_2.UID.reified(), fields.inactive_leaderboard_registry),
1375
- });
1376
- };
1377
- TypusLeaderboardRegistry.fromFieldsWithTypes = function (item) {
1378
- if (!isTypusLeaderboardRegistry(item.type)) {
1379
- throw new Error("not a TypusLeaderboardRegistry type");
1380
- }
1381
- return TypusLeaderboardRegistry.reified().new({
1382
- id: (0, reified_1.decodeFromFieldsWithTypes)(structs_2.UID.reified(), item.fields.id),
1383
- activeLeaderboardRegistry: (0, reified_1.decodeFromFieldsWithTypes)(structs_2.UID.reified(), item.fields.active_leaderboard_registry),
1384
- inactiveLeaderboardRegistry: (0, reified_1.decodeFromFieldsWithTypes)(structs_2.UID.reified(), item.fields.inactive_leaderboard_registry),
1385
- });
1386
- };
1387
- TypusLeaderboardRegistry.fromBcs = function (data) {
1388
- return TypusLeaderboardRegistry.fromFields(TypusLeaderboardRegistry.bcs.parse(data));
1389
- };
1390
- TypusLeaderboardRegistry.prototype.toJSONField = function () {
1391
- return {
1392
- id: this.id,
1393
- activeLeaderboardRegistry: this.activeLeaderboardRegistry,
1394
- inactiveLeaderboardRegistry: this.inactiveLeaderboardRegistry,
1395
- };
1396
- };
1397
- TypusLeaderboardRegistry.prototype.toJSON = function () {
1398
- return __assign({ $typeName: this.$typeName, $typeArgs: this.$typeArgs }, this.toJSONField());
1399
- };
1400
- TypusLeaderboardRegistry.fromJSONField = function (field) {
1401
- return TypusLeaderboardRegistry.reified().new({
1402
- id: (0, reified_1.decodeFromJSONField)(structs_2.UID.reified(), field.id),
1403
- activeLeaderboardRegistry: (0, reified_1.decodeFromJSONField)(structs_2.UID.reified(), field.activeLeaderboardRegistry),
1404
- inactiveLeaderboardRegistry: (0, reified_1.decodeFromJSONField)(structs_2.UID.reified(), field.inactiveLeaderboardRegistry),
1405
- });
1406
- };
1407
- TypusLeaderboardRegistry.fromJSON = function (json) {
1408
- if (json.$typeName !== TypusLeaderboardRegistry.$typeName) {
1409
- throw new Error("not a WithTwoGenerics json object");
1410
- }
1411
- return TypusLeaderboardRegistry.fromJSONField(json);
1412
- };
1413
- TypusLeaderboardRegistry.fromSuiParsedData = function (content) {
1414
- if (content.dataType !== "moveObject") {
1415
- throw new Error("not an object");
1416
- }
1417
- if (!isTypusLeaderboardRegistry(content.type)) {
1418
- throw new Error("object at ".concat(content.fields.id, " is not a TypusLeaderboardRegistry object"));
1419
- }
1420
- return TypusLeaderboardRegistry.fromFieldsWithTypes(content);
1421
- };
1422
- TypusLeaderboardRegistry.fromSuiObjectData = function (data) {
1423
- if (data.bcs) {
1424
- if (data.bcs.dataType !== "moveObject" || !isTypusLeaderboardRegistry(data.bcs.type)) {
1425
- throw new Error("object at is not a TypusLeaderboardRegistry object");
1426
- }
1427
- return TypusLeaderboardRegistry.fromBcs((0, utils_1.fromB64)(data.bcs.bcsBytes));
1428
- }
1429
- if (data.content) {
1430
- return TypusLeaderboardRegistry.fromSuiParsedData(data.content);
1431
- }
1432
- throw new Error("Both `bcs` and `content` fields are missing from the data. Include `showBcs` or `showContent` in the request.");
1433
- };
1434
- TypusLeaderboardRegistry.fetch = function (client, id) {
1435
- return __awaiter(this, void 0, void 0, function () {
1436
- var res;
1437
- var _a, _b;
1438
- return __generator(this, function (_c) {
1439
- switch (_c.label) {
1440
- case 0: return [4 /*yield*/, client.getObject({ id: id, options: { showBcs: true } })];
1441
- case 1:
1442
- res = _c.sent();
1443
- if (res.error) {
1444
- throw new Error("error fetching TypusLeaderboardRegistry object at id ".concat(id, ": ").concat(res.error.code));
1445
- }
1446
- if (((_b = (_a = res.data) === null || _a === void 0 ? void 0 : _a.bcs) === null || _b === void 0 ? void 0 : _b.dataType) !== "moveObject" || !isTypusLeaderboardRegistry(res.data.bcs.type)) {
1447
- throw new Error("object at id ".concat(id, " is not a TypusLeaderboardRegistry object"));
1448
- }
1449
- return [2 /*return*/, TypusLeaderboardRegistry.fromSuiObjectData(res.data)];
1450
- }
1451
- });
1452
- });
1453
- };
1454
- TypusLeaderboardRegistry.$typeName = "".concat(index_1.PKG_V1, "::leaderboard::TypusLeaderboardRegistry");
1455
- TypusLeaderboardRegistry.$numTypeParams = 0;
1456
- TypusLeaderboardRegistry.$isPhantom = [];
1457
- return TypusLeaderboardRegistry;
1458
- }());
1459
- exports.TypusLeaderboardRegistry = TypusLeaderboardRegistry;