@typus/typus-perp-sdk 1.1.32-type-test → 1.1.33

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 (253) hide show
  1. package/dist/src/api/sentio.d.ts +5 -5
  2. package/dist/src/api/sentio.js +690 -541
  3. package/dist/src/client.d.ts +28 -0
  4. package/dist/src/client.js +171 -0
  5. package/dist/src/fetch.d.ts +554 -36
  6. package/dist/src/fetch.js +545 -661
  7. package/dist/src/generated/typus_perp/admin.d.ts +274 -0
  8. package/dist/src/generated/typus_perp/admin.js +321 -0
  9. package/dist/src/generated/typus_perp/competition.d.ts +60 -0
  10. package/dist/src/generated/typus_perp/competition.js +104 -0
  11. package/dist/src/generated/typus_perp/deps/std/type_name.d.ts +17 -0
  12. package/dist/src/generated/typus_perp/deps/std/type_name.js +25 -0
  13. package/dist/src/generated/typus_perp/deps/sui/balance.d.ts +12 -0
  14. package/dist/src/generated/typus_perp/deps/sui/balance.js +20 -0
  15. package/dist/src/generated/typus_perp/deps/sui/object.d.ts +8 -0
  16. package/dist/src/generated/typus_perp/deps/sui/object.js +16 -0
  17. package/dist/src/generated/typus_perp/deps/sui/object_table.d.ts +19 -0
  18. package/dist/src/generated/typus_perp/deps/sui/object_table.js +59 -0
  19. package/dist/src/generated/typus_perp/deps/sui/table.d.ts +31 -0
  20. package/dist/src/generated/typus_perp/deps/sui/table.js +71 -0
  21. package/dist/src/generated/typus_perp/deps/sui/vec_set.d.ts +18 -0
  22. package/dist/src/generated/typus_perp/deps/sui/vec_set.js +25 -0
  23. package/dist/src/generated/typus_perp/deps/typus/keyed_big_vector.d.ts +30 -0
  24. package/dist/src/generated/typus_perp/deps/typus/keyed_big_vector.js +67 -0
  25. package/dist/src/generated/typus_perp/deps/typus/linked_object_table.d.ts +32 -0
  26. package/dist/src/generated/typus_perp/deps/typus/linked_object_table.js +71 -0
  27. package/dist/src/generated/typus_perp/deps/typus_framework/vault.d.ts +15 -0
  28. package/dist/src/{_framework/init-loader.js → generated/typus_perp/deps/typus_framework/vault.js} +18 -10
  29. package/dist/src/generated/typus_perp/error.d.ts +443 -0
  30. package/dist/src/generated/typus_perp/error.js +788 -0
  31. package/dist/src/generated/typus_perp/escrow.d.ts +109 -0
  32. package/dist/src/generated/typus_perp/escrow.js +139 -0
  33. package/dist/src/generated/typus_perp/lp_pool.d.ts +1853 -0
  34. package/dist/src/generated/typus_perp/lp_pool.js +1483 -0
  35. package/dist/src/generated/typus_perp/math.d.ts +95 -0
  36. package/dist/src/generated/typus_perp/math.js +97 -0
  37. package/dist/src/generated/typus_perp/position.d.ts +1251 -0
  38. package/dist/src/generated/typus_perp/position.js +1393 -0
  39. package/dist/src/generated/typus_perp/profit_vault.d.ts +272 -0
  40. package/dist/src/generated/typus_perp/profit_vault.js +321 -0
  41. package/dist/src/generated/typus_perp/symbol.d.ts +47 -0
  42. package/dist/src/generated/typus_perp/symbol.js +97 -0
  43. package/dist/src/generated/typus_perp/trading.d.ts +2134 -0
  44. package/dist/src/generated/typus_perp/trading.js +2050 -0
  45. package/dist/src/generated/typus_perp/treasury_caps.d.ts +44 -0
  46. package/dist/src/generated/typus_perp/treasury_caps.js +92 -0
  47. package/dist/src/generated/typus_perp/user_account.d.ts +146 -0
  48. package/dist/src/generated/typus_perp/user_account.js +221 -0
  49. package/dist/src/generated/typus_stake_pool/admin.d.ts +218 -0
  50. package/dist/src/generated/typus_stake_pool/admin.js +247 -0
  51. package/dist/src/generated/typus_stake_pool/deps/std/type_name.d.ts +17 -0
  52. package/dist/src/generated/typus_stake_pool/deps/std/type_name.js +25 -0
  53. package/dist/src/generated/typus_stake_pool/deps/sui/object.d.ts +8 -0
  54. package/dist/src/generated/typus_stake_pool/deps/sui/object.js +16 -0
  55. package/dist/src/generated/typus_stake_pool/deps/sui/vec_map.d.ts +30 -0
  56. package/dist/src/generated/typus_stake_pool/deps/sui/vec_map.js +37 -0
  57. package/dist/src/generated/typus_stake_pool/deps/sui/vec_set.d.ts +18 -0
  58. package/dist/src/generated/typus_stake_pool/deps/sui/vec_set.js +25 -0
  59. package/dist/src/generated/typus_stake_pool/stake_pool.d.ts +1038 -0
  60. package/dist/src/generated/typus_stake_pool/stake_pool.js +938 -0
  61. package/dist/src/generated/utils/index.d.ts +11 -0
  62. package/dist/src/generated/utils/index.js +138 -0
  63. package/dist/src/grpc/graphql.d.ts +26 -0
  64. package/dist/src/grpc/graphql.js +126 -0
  65. package/dist/src/grpc/grpc.d.ts +1 -0
  66. package/dist/src/grpc/grpc.js +38 -0
  67. package/dist/src/grpc/ledgerService.js +64 -0
  68. package/dist/src/grpc/liveDataService.d.ts +0 -0
  69. package/dist/src/grpc/liveDataService.js +49 -0
  70. package/dist/src/index.d.ts +2 -8
  71. package/dist/src/index.js +30 -56
  72. package/dist/src/user/history.d.ts +1 -1
  73. package/dist/src/user/history.js +649 -679
  74. package/dist/src/user/order.d.ts +21 -11
  75. package/dist/src/user/order.js +204 -301
  76. package/dist/src/user/orderWithBidReceipt.d.ts +17 -6
  77. package/dist/src/user/orderWithBidReceipt.js +164 -224
  78. package/dist/src/user/tlp.d.ts +25 -25
  79. package/dist/src/user/tlp.js +317 -468
  80. package/package.json +12 -3
  81. package/dist/src/_dependencies/source/0x1/ascii/structs.d.ts +0 -88
  82. package/dist/src/_dependencies/source/0x1/ascii/structs.js +0 -398
  83. package/dist/src/_dependencies/source/0x1/index.d.ts +0 -3
  84. package/dist/src/_dependencies/source/0x1/index.js +0 -6
  85. package/dist/src/_dependencies/source/0x1/option/structs.d.ts +0 -50
  86. package/dist/src/_dependencies/source/0x1/option/structs.js +0 -271
  87. package/dist/src/_dependencies/source/0x1/string/structs.d.ts +0 -48
  88. package/dist/src/_dependencies/source/0x1/string/structs.js +0 -256
  89. package/dist/src/_dependencies/source/0x1/type-name/structs.d.ts +0 -49
  90. package/dist/src/_dependencies/source/0x1/type-name/structs.js +0 -223
  91. package/dist/src/_dependencies/source/0x2/bag/structs.d.ts +0 -54
  92. package/dist/src/_dependencies/source/0x2/bag/structs.js +0 -229
  93. package/dist/src/_dependencies/source/0x2/balance/structs.d.ts +0 -84
  94. package/dist/src/_dependencies/source/0x2/balance/structs.js +0 -386
  95. package/dist/src/_dependencies/source/0x2/coin/structs.d.ts +0 -406
  96. package/dist/src/_dependencies/source/0x2/coin/structs.js +0 -1247
  97. package/dist/src/_dependencies/source/0x2/index.d.ts +0 -3
  98. package/dist/src/_dependencies/source/0x2/index.js +0 -6
  99. package/dist/src/_dependencies/source/0x2/linked-table/structs.d.ts +0 -132
  100. package/dist/src/_dependencies/source/0x2/linked-table/structs.js +0 -438
  101. package/dist/src/_dependencies/source/0x2/object/structs.d.ts +0 -86
  102. package/dist/src/_dependencies/source/0x2/object/structs.js +0 -364
  103. package/dist/src/_dependencies/source/0x2/object-table/structs.d.ts +0 -54
  104. package/dist/src/_dependencies/source/0x2/object-table/structs.js +0 -248
  105. package/dist/src/_dependencies/source/0x2/sui/structs.d.ts +0 -44
  106. package/dist/src/_dependencies/source/0x2/sui/structs.js +0 -222
  107. package/dist/src/_dependencies/source/0x2/table/structs.d.ts +0 -54
  108. package/dist/src/_dependencies/source/0x2/table/structs.js +0 -248
  109. package/dist/src/_dependencies/source/0x2/table-vec/structs.d.ts +0 -59
  110. package/dist/src/_dependencies/source/0x2/table-vec/structs.js +0 -274
  111. package/dist/src/_dependencies/source/0x2/token/structs.d.ts +0 -421
  112. package/dist/src/_dependencies/source/0x2/token/structs.js +0 -1095
  113. package/dist/src/_dependencies/source/0x2/transfer-policy/structs.d.ts +0 -348
  114. package/dist/src/_dependencies/source/0x2/transfer-policy/structs.js +0 -1091
  115. package/dist/src/_dependencies/source/0x2/url/structs.d.ts +0 -49
  116. package/dist/src/_dependencies/source/0x2/url/structs.js +0 -223
  117. package/dist/src/_dependencies/source/0x2/vec-map/structs.d.ts +0 -106
  118. package/dist/src/_dependencies/source/0x2/vec-map/structs.js +0 -446
  119. package/dist/src/_dependencies/source/0x2/vec-set/structs.d.ts +0 -49
  120. package/dist/src/_dependencies/source/0x2/vec-set/structs.js +0 -270
  121. package/dist/src/_dependencies/source/0x4b0f4ee1a40ce37ec81c987cc4e76a665419e74b863319492fc7d26f708b835a/airdrop/structs.d.ts +0 -422
  122. package/dist/src/_dependencies/source/0x4b0f4ee1a40ce37ec81c987cc4e76a665419e74b863319492fc7d26f708b835a/airdrop/structs.js +0 -1084
  123. package/dist/src/_dependencies/source/0x4b0f4ee1a40ce37ec81c987cc4e76a665419e74b863319492fc7d26f708b835a/big-vector/structs.d.ts +0 -130
  124. package/dist/src/_dependencies/source/0x4b0f4ee1a40ce37ec81c987cc4e76a665419e74b863319492fc7d26f708b835a/big-vector/structs.js +0 -456
  125. package/dist/src/_dependencies/source/0x4b0f4ee1a40ce37ec81c987cc4e76a665419e74b863319492fc7d26f708b835a/critbit/structs.d.ts +0 -208
  126. package/dist/src/_dependencies/source/0x4b0f4ee1a40ce37ec81c987cc4e76a665419e74b863319492fc7d26f708b835a/critbit/structs.js +0 -653
  127. package/dist/src/_dependencies/source/0x4b0f4ee1a40ce37ec81c987cc4e76a665419e74b863319492fc7d26f708b835a/ecosystem/structs.d.ts +0 -362
  128. package/dist/src/_dependencies/source/0x4b0f4ee1a40ce37ec81c987cc4e76a665419e74b863319492fc7d26f708b835a/ecosystem/structs.js +0 -899
  129. package/dist/src/_dependencies/source/0x4b0f4ee1a40ce37ec81c987cc4e76a665419e74b863319492fc7d26f708b835a/index.d.ts +0 -8
  130. package/dist/src/_dependencies/source/0x4b0f4ee1a40ce37ec81c987cc4e76a665419e74b863319492fc7d26f708b835a/index.js +0 -11
  131. package/dist/src/_dependencies/source/0x4b0f4ee1a40ce37ec81c987cc4e76a665419e74b863319492fc7d26f708b835a/init.d.ts +0 -2
  132. package/dist/src/_dependencies/source/0x4b0f4ee1a40ce37ec81c987cc4e76a665419e74b863319492fc7d26f708b835a/init.js +0 -102
  133. package/dist/src/_dependencies/source/0x4b0f4ee1a40ce37ec81c987cc4e76a665419e74b863319492fc7d26f708b835a/keyed-big-vector/structs.d.ts +0 -202
  134. package/dist/src/_dependencies/source/0x4b0f4ee1a40ce37ec81c987cc4e76a665419e74b863319492fc7d26f708b835a/keyed-big-vector/structs.js +0 -632
  135. package/dist/src/_dependencies/source/0x4b0f4ee1a40ce37ec81c987cc4e76a665419e74b863319492fc7d26f708b835a/leaderboard/structs.d.ts +0 -600
  136. package/dist/src/_dependencies/source/0x4b0f4ee1a40ce37ec81c987cc4e76a665419e74b863319492fc7d26f708b835a/leaderboard/structs.js +0 -1459
  137. package/dist/src/_dependencies/source/0x4b0f4ee1a40ce37ec81c987cc4e76a665419e74b863319492fc7d26f708b835a/linked-object-table/structs.d.ts +0 -136
  138. package/dist/src/_dependencies/source/0x4b0f4ee1a40ce37ec81c987cc4e76a665419e74b863319492fc7d26f708b835a/linked-object-table/structs.js +0 -438
  139. package/dist/src/_dependencies/source/0x4b0f4ee1a40ce37ec81c987cc4e76a665419e74b863319492fc7d26f708b835a/linked-set/structs.d.ts +0 -127
  140. package/dist/src/_dependencies/source/0x4b0f4ee1a40ce37ec81c987cc4e76a665419e74b863319492fc7d26f708b835a/linked-set/structs.js +0 -430
  141. package/dist/src/_dependencies/source/0x4b0f4ee1a40ce37ec81c987cc4e76a665419e74b863319492fc7d26f708b835a/tails-staking/structs.d.ts +0 -957
  142. package/dist/src/_dependencies/source/0x4b0f4ee1a40ce37ec81c987cc4e76a665419e74b863319492fc7d26f708b835a/tails-staking/structs.js +0 -2261
  143. package/dist/src/_dependencies/source/0x4b0f4ee1a40ce37ec81c987cc4e76a665419e74b863319492fc7d26f708b835a/tgld/structs.d.ts +0 -244
  144. package/dist/src/_dependencies/source/0x4b0f4ee1a40ce37ec81c987cc4e76a665419e74b863319492fc7d26f708b835a/tgld/structs.js +0 -733
  145. package/dist/src/_dependencies/source/0x4b0f4ee1a40ce37ec81c987cc4e76a665419e74b863319492fc7d26f708b835a/user/structs.d.ts +0 -294
  146. package/dist/src/_dependencies/source/0x4b0f4ee1a40ce37ec81c987cc4e76a665419e74b863319492fc7d26f708b835a/user/structs.js +0 -892
  147. package/dist/src/_dependencies/source/0xb4f25230ba74837d8299e92951306100c4a532e8c48cc3d8828abe9b91c8b274/authority/structs.d.ts +0 -73
  148. package/dist/src/_dependencies/source/0xb4f25230ba74837d8299e92951306100c4a532e8c48cc3d8828abe9b91c8b274/authority/structs.js +0 -263
  149. package/dist/src/_dependencies/source/0xb4f25230ba74837d8299e92951306100c4a532e8c48cc3d8828abe9b91c8b274/balance-pool/structs.d.ts +0 -294
  150. package/dist/src/_dependencies/source/0xb4f25230ba74837d8299e92951306100c4a532e8c48cc3d8828abe9b91c8b274/balance-pool/structs.js +0 -591
  151. package/dist/src/_dependencies/source/0xb4f25230ba74837d8299e92951306100c4a532e8c48cc3d8828abe9b91c8b274/big-vector/structs.d.ts +0 -64
  152. package/dist/src/_dependencies/source/0xb4f25230ba74837d8299e92951306100c4a532e8c48cc3d8828abe9b91c8b274/big-vector/structs.js +0 -258
  153. package/dist/src/_dependencies/source/0xb4f25230ba74837d8299e92951306100c4a532e8c48cc3d8828abe9b91c8b274/dutch/structs.d.ts +0 -756
  154. package/dist/src/_dependencies/source/0xb4f25230ba74837d8299e92951306100c4a532e8c48cc3d8828abe9b91c8b274/dutch/structs.js +0 -1721
  155. package/dist/src/_dependencies/source/0xb4f25230ba74837d8299e92951306100c4a532e8c48cc3d8828abe9b91c8b274/i64/structs.d.ts +0 -44
  156. package/dist/src/_dependencies/source/0xb4f25230ba74837d8299e92951306100c4a532e8c48cc3d8828abe9b91c8b274/i64/structs.js +0 -222
  157. package/dist/src/_dependencies/source/0xb4f25230ba74837d8299e92951306100c4a532e8c48cc3d8828abe9b91c8b274/index.d.ts +0 -3
  158. package/dist/src/_dependencies/source/0xb4f25230ba74837d8299e92951306100c4a532e8c48cc3d8828abe9b91c8b274/index.js +0 -6
  159. package/dist/src/_dependencies/source/0xb4f25230ba74837d8299e92951306100c4a532e8c48cc3d8828abe9b91c8b274/init.d.ts +0 -2
  160. package/dist/src/_dependencies/source/0xb4f25230ba74837d8299e92951306100c4a532e8c48cc3d8828abe9b91c8b274/init.js +0 -89
  161. package/dist/src/_dependencies/source/0xb4f25230ba74837d8299e92951306100c4a532e8c48cc3d8828abe9b91c8b274/linked-list/structs.d.ts +0 -135
  162. package/dist/src/_dependencies/source/0xb4f25230ba74837d8299e92951306100c4a532e8c48cc3d8828abe9b91c8b274/linked-list/structs.js +0 -444
  163. package/dist/src/_dependencies/source/0xb4f25230ba74837d8299e92951306100c4a532e8c48cc3d8828abe9b91c8b274/vault/structs.d.ts +0 -2106
  164. package/dist/src/_dependencies/source/0xb4f25230ba74837d8299e92951306100c4a532e8c48cc3d8828abe9b91c8b274/vault/structs.js +0 -4952
  165. package/dist/src/_dependencies/source/0xbd147bc7f12f38f175d78947a61364e8e077b9b188b00e7094bc0c3623162196/discount-mint/structs.d.ts +0 -390
  166. package/dist/src/_dependencies/source/0xbd147bc7f12f38f175d78947a61364e8e077b9b188b00e7094bc0c3623162196/discount-mint/structs.js +0 -844
  167. package/dist/src/_dependencies/source/0xbd147bc7f12f38f175d78947a61364e8e077b9b188b00e7094bc0c3623162196/index.d.ts +0 -6
  168. package/dist/src/_dependencies/source/0xbd147bc7f12f38f175d78947a61364e8e077b9b188b00e7094bc0c3623162196/index.js +0 -9
  169. package/dist/src/_dependencies/source/0xbd147bc7f12f38f175d78947a61364e8e077b9b188b00e7094bc0c3623162196/init.d.ts +0 -2
  170. package/dist/src/_dependencies/source/0xbd147bc7f12f38f175d78947a61364e8e077b9b188b00e7094bc0c3623162196/init.js +0 -69
  171. package/dist/src/_dependencies/source/0xbd147bc7f12f38f175d78947a61364e8e077b9b188b00e7094bc0c3623162196/royalty-rule/structs.d.ts +0 -89
  172. package/dist/src/_dependencies/source/0xbd147bc7f12f38f175d78947a61364e8e077b9b188b00e7094bc0c3623162196/royalty-rule/structs.js +0 -376
  173. package/dist/src/_dependencies/source/0xbd147bc7f12f38f175d78947a61364e8e077b9b188b00e7094bc0c3623162196/staking/structs.d.ts +0 -386
  174. package/dist/src/_dependencies/source/0xbd147bc7f12f38f175d78947a61364e8e077b9b188b00e7094bc0c3623162196/staking/structs.js +0 -881
  175. package/dist/src/_dependencies/source/0xbd147bc7f12f38f175d78947a61364e8e077b9b188b00e7094bc0c3623162196/table-vec/structs.d.ts +0 -59
  176. package/dist/src/_dependencies/source/0xbd147bc7f12f38f175d78947a61364e8e077b9b188b00e7094bc0c3623162196/table-vec/structs.js +0 -274
  177. package/dist/src/_dependencies/source/0xbd147bc7f12f38f175d78947a61364e8e077b9b188b00e7094bc0c3623162196/typus-nft/structs.d.ts +0 -974
  178. package/dist/src/_dependencies/source/0xbd147bc7f12f38f175d78947a61364e8e077b9b188b00e7094bc0c3623162196/typus-nft/structs.js +0 -2387
  179. package/dist/src/_framework/init-loader.d.ts +0 -2
  180. package/dist/src/_framework/loader.d.ts +0 -17
  181. package/dist/src/_framework/loader.js +0 -108
  182. package/dist/src/_framework/reified.d.ts +0 -108
  183. package/dist/src/_framework/reified.js +0 -237
  184. package/dist/src/_framework/util.d.ts +0 -35
  185. package/dist/src/_framework/util.js +0 -396
  186. package/dist/src/_framework/vector.d.ts +0 -42
  187. package/dist/src/_framework/vector.js +0 -112
  188. package/dist/src/pyth.js +0 -1
  189. package/dist/src/typus_perp/admin/functions.d.ts +0 -59
  190. package/dist/src/typus_perp/admin/functions.js +0 -122
  191. package/dist/src/typus_perp/admin/structs.d.ts +0 -467
  192. package/dist/src/typus_perp/admin/structs.js +0 -1065
  193. package/dist/src/typus_perp/competition/functions.d.ts +0 -24
  194. package/dist/src/typus_perp/competition/functions.js +0 -38
  195. package/dist/src/typus_perp/competition/structs.d.ts +0 -80
  196. package/dist/src/typus_perp/competition/structs.js +0 -288
  197. package/dist/src/typus_perp/error/functions.d.ts +0 -73
  198. package/dist/src/typus_perp/error/functions.js +0 -363
  199. package/dist/src/typus_perp/escrow/functions.d.ts +0 -17
  200. package/dist/src/typus_perp/escrow/functions.js +0 -36
  201. package/dist/src/typus_perp/escrow/structs.d.ts +0 -160
  202. package/dist/src/typus_perp/escrow/structs.js +0 -324
  203. package/dist/src/typus_perp/index.d.ts +0 -1
  204. package/dist/src/typus_perp/index.js +0 -7
  205. package/dist/src/typus_perp/init.d.ts +0 -2
  206. package/dist/src/typus_perp/init.js +0 -118
  207. package/dist/src/typus_perp/lending/functions.d.ts +0 -15
  208. package/dist/src/typus_perp/lending/functions.js +0 -22
  209. package/dist/src/typus_perp/lp-pool/functions.d.ts +0 -460
  210. package/dist/src/typus_perp/lp-pool/functions.js +0 -732
  211. package/dist/src/typus_perp/lp-pool/structs.d.ts +0 -3705
  212. package/dist/src/typus_perp/lp-pool/structs.js +0 -6789
  213. package/dist/src/typus_perp/math/functions.d.ts +0 -29
  214. package/dist/src/typus_perp/math/functions.js +0 -61
  215. package/dist/src/typus_perp/position/functions.d.ts +0 -379
  216. package/dist/src/typus_perp/position/functions.js +0 -713
  217. package/dist/src/typus_perp/position/structs.d.ts +0 -905
  218. package/dist/src/typus_perp/position/structs.js +0 -1450
  219. package/dist/src/typus_perp/symbol/functions.d.ts +0 -9
  220. package/dist/src/typus_perp/symbol/functions.js +0 -24
  221. package/dist/src/typus_perp/symbol/structs.d.ts +0 -70
  222. package/dist/src/typus_perp/symbol/structs.js +0 -235
  223. package/dist/src/typus_perp/tlp/functions.d.ts +0 -19
  224. package/dist/src/typus_perp/tlp/functions.js +0 -40
  225. package/dist/src/typus_perp/tlp/structs.d.ts +0 -121
  226. package/dist/src/typus_perp/tlp/structs.js +0 -416
  227. package/dist/src/typus_perp/token-interface/functions.d.ts +0 -11
  228. package/dist/src/typus_perp/token-interface/functions.js +0 -22
  229. package/dist/src/typus_perp/trading/functions.d.ts +0 -812
  230. package/dist/src/typus_perp/trading/functions.js +0 -1218
  231. package/dist/src/typus_perp/trading/structs.d.ts +0 -3060
  232. package/dist/src/typus_perp/trading/structs.js +0 -5813
  233. package/dist/src/typus_perp/treasury-caps/functions.d.ts +0 -9
  234. package/dist/src/typus_perp/treasury-caps/functions.js +0 -36
  235. package/dist/src/typus_perp/treasury-caps/structs.d.ts +0 -49
  236. package/dist/src/typus_perp/treasury-caps/structs.js +0 -223
  237. package/dist/src/typus_perp/user-account/functions.d.ts +0 -36
  238. package/dist/src/typus_perp/user-account/functions.js +0 -70
  239. package/dist/src/typus_perp/user-account/structs.d.ts +0 -148
  240. package/dist/src/typus_perp/user-account/structs.js +0 -448
  241. package/dist/src/typus_stake_pool/admin/functions.d.ts +0 -49
  242. package/dist/src/typus_stake_pool/admin/functions.js +0 -105
  243. package/dist/src/typus_stake_pool/admin/structs.d.ts +0 -365
  244. package/dist/src/typus_stake_pool/admin/structs.js +0 -789
  245. package/dist/src/typus_stake_pool/index.d.ts +0 -1
  246. package/dist/src/typus_stake_pool/index.js +0 -7
  247. package/dist/src/typus_stake_pool/init.d.ts +0 -2
  248. package/dist/src/typus_stake_pool/init.js +0 -69
  249. package/dist/src/typus_stake_pool/stake-pool/functions.d.ts +0 -229
  250. package/dist/src/typus_stake_pool/stake-pool/functions.js +0 -380
  251. package/dist/src/typus_stake_pool/stake-pool/structs.d.ts +0 -2199
  252. package/dist/src/typus_stake_pool/stake-pool/structs.js +0 -4653
  253. /package/dist/src/{pyth.d.ts → grpc/ledgerService.d.ts} +0 -0
@@ -1,1065 +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.Version = exports.SendFeeEvent = exports.PutInsuranceFundEvent = exports.ProtocolFeeEvent = exports.FeePool = exports.FeeInfo = void 0;
109
- exports.isFeeInfo = isFeeInfo;
110
- exports.isFeePool = isFeePool;
111
- exports.isProtocolFeeEvent = isProtocolFeeEvent;
112
- exports.isPutInsuranceFundEvent = isPutInsuranceFundEvent;
113
- exports.isSendFeeEvent = isSendFeeEvent;
114
- exports.isVersion = isVersion;
115
- var reified = __importStar(require("../../_framework/reified"));
116
- var structs_1 = require("../../_dependencies/source/0x1/type-name/structs");
117
- var structs_2 = require("../../_dependencies/source/0x2/object/structs");
118
- var structs_3 = require("../../_dependencies/source/0x2/vec-set/structs");
119
- var reified_1 = require("../../_framework/reified");
120
- var util_1 = require("../../_framework/util");
121
- var index_1 = require("../index");
122
- var bcs_1 = require("@mysten/sui/bcs");
123
- var utils_1 = require("@mysten/sui/utils");
124
- /* ============================== FeeInfo =============================== */
125
- function isFeeInfo(type) {
126
- type = (0, util_1.compressSuiType)(type);
127
- return type === "".concat(index_1.PKG_V1, "::admin::FeeInfo");
128
- }
129
- var FeeInfo = /** @class */ (function () {
130
- function FeeInfo(typeArgs, fields) {
131
- this.__StructClass = true;
132
- this.$typeName = FeeInfo.$typeName;
133
- this.$isPhantom = FeeInfo.$isPhantom;
134
- this.$fullTypeName = util_1.composeSuiType.apply(void 0, __spreadArray([FeeInfo.$typeName], __read(typeArgs), false));
135
- this.$typeArgs = typeArgs;
136
- this.token = fields.token;
137
- this.value = fields.value;
138
- }
139
- FeeInfo.reified = function () {
140
- var _this = this;
141
- return {
142
- typeName: FeeInfo.$typeName,
143
- fullTypeName: util_1.composeSuiType.apply(void 0, __spreadArray([FeeInfo.$typeName], [], false)),
144
- typeArgs: [],
145
- isPhantom: FeeInfo.$isPhantom,
146
- reifiedTypeArgs: [],
147
- fromFields: function (fields) { return FeeInfo.fromFields(fields); },
148
- fromFieldsWithTypes: function (item) { return FeeInfo.fromFieldsWithTypes(item); },
149
- fromBcs: function (data) { return FeeInfo.fromBcs(data); },
150
- bcs: FeeInfo.bcs,
151
- fromJSONField: function (field) { return FeeInfo.fromJSONField(field); },
152
- fromJSON: function (json) { return FeeInfo.fromJSON(json); },
153
- fromSuiParsedData: function (content) { return FeeInfo.fromSuiParsedData(content); },
154
- fromSuiObjectData: function (content) { return FeeInfo.fromSuiObjectData(content); },
155
- fetch: function (client, id) { return __awaiter(_this, void 0, void 0, function () { return __generator(this, function (_a) {
156
- return [2 /*return*/, FeeInfo.fetch(client, id)];
157
- }); }); },
158
- new: function (fields) {
159
- return new FeeInfo([], fields);
160
- },
161
- kind: "StructClassReified",
162
- };
163
- };
164
- Object.defineProperty(FeeInfo, "r", {
165
- get: function () {
166
- return FeeInfo.reified();
167
- },
168
- enumerable: false,
169
- configurable: true
170
- });
171
- FeeInfo.phantom = function () {
172
- return (0, reified_1.phantom)(FeeInfo.reified());
173
- };
174
- Object.defineProperty(FeeInfo, "p", {
175
- get: function () {
176
- return FeeInfo.phantom();
177
- },
178
- enumerable: false,
179
- configurable: true
180
- });
181
- Object.defineProperty(FeeInfo, "bcs", {
182
- get: function () {
183
- return bcs_1.bcs.struct("FeeInfo", {
184
- token: structs_1.TypeName.bcs,
185
- value: bcs_1.bcs.u64(),
186
- });
187
- },
188
- enumerable: false,
189
- configurable: true
190
- });
191
- FeeInfo.fromFields = function (fields) {
192
- return FeeInfo.reified().new({
193
- token: (0, reified_1.decodeFromFields)(structs_1.TypeName.reified(), fields.token),
194
- value: (0, reified_1.decodeFromFields)("u64", fields.value),
195
- });
196
- };
197
- FeeInfo.fromFieldsWithTypes = function (item) {
198
- if (!isFeeInfo(item.type)) {
199
- throw new Error("not a FeeInfo type");
200
- }
201
- return FeeInfo.reified().new({
202
- token: (0, reified_1.decodeFromFieldsWithTypes)(structs_1.TypeName.reified(), item.fields.token),
203
- value: (0, reified_1.decodeFromFieldsWithTypes)("u64", item.fields.value),
204
- });
205
- };
206
- FeeInfo.fromBcs = function (data) {
207
- return FeeInfo.fromFields(FeeInfo.bcs.parse(data));
208
- };
209
- FeeInfo.prototype.toJSONField = function () {
210
- return {
211
- token: this.token.toJSONField(),
212
- value: this.value.toString(),
213
- };
214
- };
215
- FeeInfo.prototype.toJSON = function () {
216
- return __assign({ $typeName: this.$typeName, $typeArgs: this.$typeArgs }, this.toJSONField());
217
- };
218
- FeeInfo.fromJSONField = function (field) {
219
- return FeeInfo.reified().new({
220
- token: (0, reified_1.decodeFromJSONField)(structs_1.TypeName.reified(), field.token),
221
- value: (0, reified_1.decodeFromJSONField)("u64", field.value),
222
- });
223
- };
224
- FeeInfo.fromJSON = function (json) {
225
- if (json.$typeName !== FeeInfo.$typeName) {
226
- throw new Error("not a WithTwoGenerics json object");
227
- }
228
- return FeeInfo.fromJSONField(json);
229
- };
230
- FeeInfo.fromSuiParsedData = function (content) {
231
- if (content.dataType !== "moveObject") {
232
- throw new Error("not an object");
233
- }
234
- if (!isFeeInfo(content.type)) {
235
- throw new Error("object at ".concat(content.fields.id, " is not a FeeInfo object"));
236
- }
237
- return FeeInfo.fromFieldsWithTypes(content);
238
- };
239
- FeeInfo.fromSuiObjectData = function (data) {
240
- if (data.bcs) {
241
- if (data.bcs.dataType !== "moveObject" || !isFeeInfo(data.bcs.type)) {
242
- throw new Error("object at is not a FeeInfo object");
243
- }
244
- return FeeInfo.fromBcs((0, utils_1.fromB64)(data.bcs.bcsBytes));
245
- }
246
- if (data.content) {
247
- return FeeInfo.fromSuiParsedData(data.content);
248
- }
249
- throw new Error("Both `bcs` and `content` fields are missing from the data. Include `showBcs` or `showContent` in the request.");
250
- };
251
- FeeInfo.fetch = function (client, id) {
252
- return __awaiter(this, void 0, void 0, function () {
253
- var res;
254
- var _a, _b;
255
- return __generator(this, function (_c) {
256
- switch (_c.label) {
257
- case 0: return [4 /*yield*/, client.getObject({ id: id, options: { showBcs: true } })];
258
- case 1:
259
- res = _c.sent();
260
- if (res.error) {
261
- throw new Error("error fetching FeeInfo object at id ".concat(id, ": ").concat(res.error.code));
262
- }
263
- if (((_b = (_a = res.data) === null || _a === void 0 ? void 0 : _a.bcs) === null || _b === void 0 ? void 0 : _b.dataType) !== "moveObject" || !isFeeInfo(res.data.bcs.type)) {
264
- throw new Error("object at id ".concat(id, " is not a FeeInfo object"));
265
- }
266
- return [2 /*return*/, FeeInfo.fromSuiObjectData(res.data)];
267
- }
268
- });
269
- });
270
- };
271
- FeeInfo.$typeName = "".concat(index_1.PKG_V1, "::admin::FeeInfo");
272
- FeeInfo.$numTypeParams = 0;
273
- FeeInfo.$isPhantom = [];
274
- return FeeInfo;
275
- }());
276
- exports.FeeInfo = FeeInfo;
277
- /* ============================== FeePool =============================== */
278
- function isFeePool(type) {
279
- type = (0, util_1.compressSuiType)(type);
280
- return type === "".concat(index_1.PKG_V1, "::admin::FeePool");
281
- }
282
- var FeePool = /** @class */ (function () {
283
- function FeePool(typeArgs, fields) {
284
- this.__StructClass = true;
285
- this.$typeName = FeePool.$typeName;
286
- this.$isPhantom = FeePool.$isPhantom;
287
- this.$fullTypeName = util_1.composeSuiType.apply(void 0, __spreadArray([FeePool.$typeName], __read(typeArgs), false));
288
- this.$typeArgs = typeArgs;
289
- this.id = fields.id;
290
- this.feeInfos = fields.feeInfos;
291
- }
292
- FeePool.reified = function () {
293
- var _this = this;
294
- return {
295
- typeName: FeePool.$typeName,
296
- fullTypeName: util_1.composeSuiType.apply(void 0, __spreadArray([FeePool.$typeName], [], false)),
297
- typeArgs: [],
298
- isPhantom: FeePool.$isPhantom,
299
- reifiedTypeArgs: [],
300
- fromFields: function (fields) { return FeePool.fromFields(fields); },
301
- fromFieldsWithTypes: function (item) { return FeePool.fromFieldsWithTypes(item); },
302
- fromBcs: function (data) { return FeePool.fromBcs(data); },
303
- bcs: FeePool.bcs,
304
- fromJSONField: function (field) { return FeePool.fromJSONField(field); },
305
- fromJSON: function (json) { return FeePool.fromJSON(json); },
306
- fromSuiParsedData: function (content) { return FeePool.fromSuiParsedData(content); },
307
- fromSuiObjectData: function (content) { return FeePool.fromSuiObjectData(content); },
308
- fetch: function (client, id) { return __awaiter(_this, void 0, void 0, function () { return __generator(this, function (_a) {
309
- return [2 /*return*/, FeePool.fetch(client, id)];
310
- }); }); },
311
- new: function (fields) {
312
- return new FeePool([], fields);
313
- },
314
- kind: "StructClassReified",
315
- };
316
- };
317
- Object.defineProperty(FeePool, "r", {
318
- get: function () {
319
- return FeePool.reified();
320
- },
321
- enumerable: false,
322
- configurable: true
323
- });
324
- FeePool.phantom = function () {
325
- return (0, reified_1.phantom)(FeePool.reified());
326
- };
327
- Object.defineProperty(FeePool, "p", {
328
- get: function () {
329
- return FeePool.phantom();
330
- },
331
- enumerable: false,
332
- configurable: true
333
- });
334
- Object.defineProperty(FeePool, "bcs", {
335
- get: function () {
336
- return bcs_1.bcs.struct("FeePool", {
337
- id: structs_2.UID.bcs,
338
- fee_infos: bcs_1.bcs.vector(FeeInfo.bcs),
339
- });
340
- },
341
- enumerable: false,
342
- configurable: true
343
- });
344
- FeePool.fromFields = function (fields) {
345
- return FeePool.reified().new({
346
- id: (0, reified_1.decodeFromFields)(structs_2.UID.reified(), fields.id),
347
- feeInfos: (0, reified_1.decodeFromFields)(reified.vector(FeeInfo.reified()), fields.fee_infos),
348
- });
349
- };
350
- FeePool.fromFieldsWithTypes = function (item) {
351
- if (!isFeePool(item.type)) {
352
- throw new Error("not a FeePool type");
353
- }
354
- return FeePool.reified().new({
355
- id: (0, reified_1.decodeFromFieldsWithTypes)(structs_2.UID.reified(), item.fields.id),
356
- feeInfos: (0, reified_1.decodeFromFieldsWithTypes)(reified.vector(FeeInfo.reified()), item.fields.fee_infos),
357
- });
358
- };
359
- FeePool.fromBcs = function (data) {
360
- return FeePool.fromFields(FeePool.bcs.parse(data));
361
- };
362
- FeePool.prototype.toJSONField = function () {
363
- return {
364
- id: this.id,
365
- feeInfos: (0, reified_1.fieldToJSON)("vector<".concat(FeeInfo.$typeName, ">"), this.feeInfos),
366
- };
367
- };
368
- FeePool.prototype.toJSON = function () {
369
- return __assign({ $typeName: this.$typeName, $typeArgs: this.$typeArgs }, this.toJSONField());
370
- };
371
- FeePool.fromJSONField = function (field) {
372
- return FeePool.reified().new({
373
- id: (0, reified_1.decodeFromJSONField)(structs_2.UID.reified(), field.id),
374
- feeInfos: (0, reified_1.decodeFromJSONField)(reified.vector(FeeInfo.reified()), field.feeInfos),
375
- });
376
- };
377
- FeePool.fromJSON = function (json) {
378
- if (json.$typeName !== FeePool.$typeName) {
379
- throw new Error("not a WithTwoGenerics json object");
380
- }
381
- return FeePool.fromJSONField(json);
382
- };
383
- FeePool.fromSuiParsedData = function (content) {
384
- if (content.dataType !== "moveObject") {
385
- throw new Error("not an object");
386
- }
387
- if (!isFeePool(content.type)) {
388
- throw new Error("object at ".concat(content.fields.id, " is not a FeePool object"));
389
- }
390
- return FeePool.fromFieldsWithTypes(content);
391
- };
392
- FeePool.fromSuiObjectData = function (data) {
393
- if (data.bcs) {
394
- if (data.bcs.dataType !== "moveObject" || !isFeePool(data.bcs.type)) {
395
- throw new Error("object at is not a FeePool object");
396
- }
397
- return FeePool.fromBcs((0, utils_1.fromB64)(data.bcs.bcsBytes));
398
- }
399
- if (data.content) {
400
- return FeePool.fromSuiParsedData(data.content);
401
- }
402
- throw new Error("Both `bcs` and `content` fields are missing from the data. Include `showBcs` or `showContent` in the request.");
403
- };
404
- FeePool.fetch = function (client, id) {
405
- return __awaiter(this, void 0, void 0, function () {
406
- var res;
407
- var _a, _b;
408
- return __generator(this, function (_c) {
409
- switch (_c.label) {
410
- case 0: return [4 /*yield*/, client.getObject({ id: id, options: { showBcs: true } })];
411
- case 1:
412
- res = _c.sent();
413
- if (res.error) {
414
- throw new Error("error fetching FeePool object at id ".concat(id, ": ").concat(res.error.code));
415
- }
416
- if (((_b = (_a = res.data) === null || _a === void 0 ? void 0 : _a.bcs) === null || _b === void 0 ? void 0 : _b.dataType) !== "moveObject" || !isFeePool(res.data.bcs.type)) {
417
- throw new Error("object at id ".concat(id, " is not a FeePool object"));
418
- }
419
- return [2 /*return*/, FeePool.fromSuiObjectData(res.data)];
420
- }
421
- });
422
- });
423
- };
424
- FeePool.$typeName = "".concat(index_1.PKG_V1, "::admin::FeePool");
425
- FeePool.$numTypeParams = 0;
426
- FeePool.$isPhantom = [];
427
- return FeePool;
428
- }());
429
- exports.FeePool = FeePool;
430
- /* ============================== ProtocolFeeEvent =============================== */
431
- function isProtocolFeeEvent(type) {
432
- type = (0, util_1.compressSuiType)(type);
433
- return type === "".concat(index_1.PKG_V1, "::admin::ProtocolFeeEvent");
434
- }
435
- var ProtocolFeeEvent = /** @class */ (function () {
436
- function ProtocolFeeEvent(typeArgs, fields) {
437
- this.__StructClass = true;
438
- this.$typeName = ProtocolFeeEvent.$typeName;
439
- this.$isPhantom = ProtocolFeeEvent.$isPhantom;
440
- this.$fullTypeName = util_1.composeSuiType.apply(void 0, __spreadArray([ProtocolFeeEvent.$typeName], __read(typeArgs), false));
441
- this.$typeArgs = typeArgs;
442
- this.token = fields.token;
443
- this.amount = fields.amount;
444
- }
445
- ProtocolFeeEvent.reified = function () {
446
- var _this = this;
447
- return {
448
- typeName: ProtocolFeeEvent.$typeName,
449
- fullTypeName: util_1.composeSuiType.apply(void 0, __spreadArray([ProtocolFeeEvent.$typeName], [], false)),
450
- typeArgs: [],
451
- isPhantom: ProtocolFeeEvent.$isPhantom,
452
- reifiedTypeArgs: [],
453
- fromFields: function (fields) { return ProtocolFeeEvent.fromFields(fields); },
454
- fromFieldsWithTypes: function (item) { return ProtocolFeeEvent.fromFieldsWithTypes(item); },
455
- fromBcs: function (data) { return ProtocolFeeEvent.fromBcs(data); },
456
- bcs: ProtocolFeeEvent.bcs,
457
- fromJSONField: function (field) { return ProtocolFeeEvent.fromJSONField(field); },
458
- fromJSON: function (json) { return ProtocolFeeEvent.fromJSON(json); },
459
- fromSuiParsedData: function (content) { return ProtocolFeeEvent.fromSuiParsedData(content); },
460
- fromSuiObjectData: function (content) { return ProtocolFeeEvent.fromSuiObjectData(content); },
461
- fetch: function (client, id) { return __awaiter(_this, void 0, void 0, function () { return __generator(this, function (_a) {
462
- return [2 /*return*/, ProtocolFeeEvent.fetch(client, id)];
463
- }); }); },
464
- new: function (fields) {
465
- return new ProtocolFeeEvent([], fields);
466
- },
467
- kind: "StructClassReified",
468
- };
469
- };
470
- Object.defineProperty(ProtocolFeeEvent, "r", {
471
- get: function () {
472
- return ProtocolFeeEvent.reified();
473
- },
474
- enumerable: false,
475
- configurable: true
476
- });
477
- ProtocolFeeEvent.phantom = function () {
478
- return (0, reified_1.phantom)(ProtocolFeeEvent.reified());
479
- };
480
- Object.defineProperty(ProtocolFeeEvent, "p", {
481
- get: function () {
482
- return ProtocolFeeEvent.phantom();
483
- },
484
- enumerable: false,
485
- configurable: true
486
- });
487
- Object.defineProperty(ProtocolFeeEvent, "bcs", {
488
- get: function () {
489
- return bcs_1.bcs.struct("ProtocolFeeEvent", {
490
- token: structs_1.TypeName.bcs,
491
- amount: bcs_1.bcs.u64(),
492
- });
493
- },
494
- enumerable: false,
495
- configurable: true
496
- });
497
- ProtocolFeeEvent.fromFields = function (fields) {
498
- return ProtocolFeeEvent.reified().new({
499
- token: (0, reified_1.decodeFromFields)(structs_1.TypeName.reified(), fields.token),
500
- amount: (0, reified_1.decodeFromFields)("u64", fields.amount),
501
- });
502
- };
503
- ProtocolFeeEvent.fromFieldsWithTypes = function (item) {
504
- if (!isProtocolFeeEvent(item.type)) {
505
- throw new Error("not a ProtocolFeeEvent type");
506
- }
507
- return ProtocolFeeEvent.reified().new({
508
- token: (0, reified_1.decodeFromFieldsWithTypes)(structs_1.TypeName.reified(), item.fields.token),
509
- amount: (0, reified_1.decodeFromFieldsWithTypes)("u64", item.fields.amount),
510
- });
511
- };
512
- ProtocolFeeEvent.fromBcs = function (data) {
513
- return ProtocolFeeEvent.fromFields(ProtocolFeeEvent.bcs.parse(data));
514
- };
515
- ProtocolFeeEvent.prototype.toJSONField = function () {
516
- return {
517
- token: this.token.toJSONField(),
518
- amount: this.amount.toString(),
519
- };
520
- };
521
- ProtocolFeeEvent.prototype.toJSON = function () {
522
- return __assign({ $typeName: this.$typeName, $typeArgs: this.$typeArgs }, this.toJSONField());
523
- };
524
- ProtocolFeeEvent.fromJSONField = function (field) {
525
- return ProtocolFeeEvent.reified().new({
526
- token: (0, reified_1.decodeFromJSONField)(structs_1.TypeName.reified(), field.token),
527
- amount: (0, reified_1.decodeFromJSONField)("u64", field.amount),
528
- });
529
- };
530
- ProtocolFeeEvent.fromJSON = function (json) {
531
- if (json.$typeName !== ProtocolFeeEvent.$typeName) {
532
- throw new Error("not a WithTwoGenerics json object");
533
- }
534
- return ProtocolFeeEvent.fromJSONField(json);
535
- };
536
- ProtocolFeeEvent.fromSuiParsedData = function (content) {
537
- if (content.dataType !== "moveObject") {
538
- throw new Error("not an object");
539
- }
540
- if (!isProtocolFeeEvent(content.type)) {
541
- throw new Error("object at ".concat(content.fields.id, " is not a ProtocolFeeEvent object"));
542
- }
543
- return ProtocolFeeEvent.fromFieldsWithTypes(content);
544
- };
545
- ProtocolFeeEvent.fromSuiObjectData = function (data) {
546
- if (data.bcs) {
547
- if (data.bcs.dataType !== "moveObject" || !isProtocolFeeEvent(data.bcs.type)) {
548
- throw new Error("object at is not a ProtocolFeeEvent object");
549
- }
550
- return ProtocolFeeEvent.fromBcs((0, utils_1.fromB64)(data.bcs.bcsBytes));
551
- }
552
- if (data.content) {
553
- return ProtocolFeeEvent.fromSuiParsedData(data.content);
554
- }
555
- throw new Error("Both `bcs` and `content` fields are missing from the data. Include `showBcs` or `showContent` in the request.");
556
- };
557
- ProtocolFeeEvent.fetch = function (client, id) {
558
- return __awaiter(this, void 0, void 0, function () {
559
- var res;
560
- var _a, _b;
561
- return __generator(this, function (_c) {
562
- switch (_c.label) {
563
- case 0: return [4 /*yield*/, client.getObject({ id: id, options: { showBcs: true } })];
564
- case 1:
565
- res = _c.sent();
566
- if (res.error) {
567
- throw new Error("error fetching ProtocolFeeEvent object at id ".concat(id, ": ").concat(res.error.code));
568
- }
569
- if (((_b = (_a = res.data) === null || _a === void 0 ? void 0 : _a.bcs) === null || _b === void 0 ? void 0 : _b.dataType) !== "moveObject" || !isProtocolFeeEvent(res.data.bcs.type)) {
570
- throw new Error("object at id ".concat(id, " is not a ProtocolFeeEvent object"));
571
- }
572
- return [2 /*return*/, ProtocolFeeEvent.fromSuiObjectData(res.data)];
573
- }
574
- });
575
- });
576
- };
577
- ProtocolFeeEvent.$typeName = "".concat(index_1.PKG_V1, "::admin::ProtocolFeeEvent");
578
- ProtocolFeeEvent.$numTypeParams = 0;
579
- ProtocolFeeEvent.$isPhantom = [];
580
- return ProtocolFeeEvent;
581
- }());
582
- exports.ProtocolFeeEvent = ProtocolFeeEvent;
583
- /* ============================== PutInsuranceFundEvent =============================== */
584
- function isPutInsuranceFundEvent(type) {
585
- type = (0, util_1.compressSuiType)(type);
586
- return type === "".concat(index_1.PKG_V1, "::admin::PutInsuranceFundEvent");
587
- }
588
- var PutInsuranceFundEvent = /** @class */ (function () {
589
- function PutInsuranceFundEvent(typeArgs, fields) {
590
- this.__StructClass = true;
591
- this.$typeName = PutInsuranceFundEvent.$typeName;
592
- this.$isPhantom = PutInsuranceFundEvent.$isPhantom;
593
- this.$fullTypeName = util_1.composeSuiType.apply(void 0, __spreadArray([PutInsuranceFundEvent.$typeName], __read(typeArgs), false));
594
- this.$typeArgs = typeArgs;
595
- this.token = fields.token;
596
- this.amount = fields.amount;
597
- }
598
- PutInsuranceFundEvent.reified = function () {
599
- var _this = this;
600
- return {
601
- typeName: PutInsuranceFundEvent.$typeName,
602
- fullTypeName: util_1.composeSuiType.apply(void 0, __spreadArray([PutInsuranceFundEvent.$typeName], [], false)),
603
- typeArgs: [],
604
- isPhantom: PutInsuranceFundEvent.$isPhantom,
605
- reifiedTypeArgs: [],
606
- fromFields: function (fields) { return PutInsuranceFundEvent.fromFields(fields); },
607
- fromFieldsWithTypes: function (item) { return PutInsuranceFundEvent.fromFieldsWithTypes(item); },
608
- fromBcs: function (data) { return PutInsuranceFundEvent.fromBcs(data); },
609
- bcs: PutInsuranceFundEvent.bcs,
610
- fromJSONField: function (field) { return PutInsuranceFundEvent.fromJSONField(field); },
611
- fromJSON: function (json) { return PutInsuranceFundEvent.fromJSON(json); },
612
- fromSuiParsedData: function (content) { return PutInsuranceFundEvent.fromSuiParsedData(content); },
613
- fromSuiObjectData: function (content) { return PutInsuranceFundEvent.fromSuiObjectData(content); },
614
- fetch: function (client, id) { return __awaiter(_this, void 0, void 0, function () { return __generator(this, function (_a) {
615
- return [2 /*return*/, PutInsuranceFundEvent.fetch(client, id)];
616
- }); }); },
617
- new: function (fields) {
618
- return new PutInsuranceFundEvent([], fields);
619
- },
620
- kind: "StructClassReified",
621
- };
622
- };
623
- Object.defineProperty(PutInsuranceFundEvent, "r", {
624
- get: function () {
625
- return PutInsuranceFundEvent.reified();
626
- },
627
- enumerable: false,
628
- configurable: true
629
- });
630
- PutInsuranceFundEvent.phantom = function () {
631
- return (0, reified_1.phantom)(PutInsuranceFundEvent.reified());
632
- };
633
- Object.defineProperty(PutInsuranceFundEvent, "p", {
634
- get: function () {
635
- return PutInsuranceFundEvent.phantom();
636
- },
637
- enumerable: false,
638
- configurable: true
639
- });
640
- Object.defineProperty(PutInsuranceFundEvent, "bcs", {
641
- get: function () {
642
- return bcs_1.bcs.struct("PutInsuranceFundEvent", {
643
- token: structs_1.TypeName.bcs,
644
- amount: bcs_1.bcs.u64(),
645
- });
646
- },
647
- enumerable: false,
648
- configurable: true
649
- });
650
- PutInsuranceFundEvent.fromFields = function (fields) {
651
- return PutInsuranceFundEvent.reified().new({
652
- token: (0, reified_1.decodeFromFields)(structs_1.TypeName.reified(), fields.token),
653
- amount: (0, reified_1.decodeFromFields)("u64", fields.amount),
654
- });
655
- };
656
- PutInsuranceFundEvent.fromFieldsWithTypes = function (item) {
657
- if (!isPutInsuranceFundEvent(item.type)) {
658
- throw new Error("not a PutInsuranceFundEvent type");
659
- }
660
- return PutInsuranceFundEvent.reified().new({
661
- token: (0, reified_1.decodeFromFieldsWithTypes)(structs_1.TypeName.reified(), item.fields.token),
662
- amount: (0, reified_1.decodeFromFieldsWithTypes)("u64", item.fields.amount),
663
- });
664
- };
665
- PutInsuranceFundEvent.fromBcs = function (data) {
666
- return PutInsuranceFundEvent.fromFields(PutInsuranceFundEvent.bcs.parse(data));
667
- };
668
- PutInsuranceFundEvent.prototype.toJSONField = function () {
669
- return {
670
- token: this.token.toJSONField(),
671
- amount: this.amount.toString(),
672
- };
673
- };
674
- PutInsuranceFundEvent.prototype.toJSON = function () {
675
- return __assign({ $typeName: this.$typeName, $typeArgs: this.$typeArgs }, this.toJSONField());
676
- };
677
- PutInsuranceFundEvent.fromJSONField = function (field) {
678
- return PutInsuranceFundEvent.reified().new({
679
- token: (0, reified_1.decodeFromJSONField)(structs_1.TypeName.reified(), field.token),
680
- amount: (0, reified_1.decodeFromJSONField)("u64", field.amount),
681
- });
682
- };
683
- PutInsuranceFundEvent.fromJSON = function (json) {
684
- if (json.$typeName !== PutInsuranceFundEvent.$typeName) {
685
- throw new Error("not a WithTwoGenerics json object");
686
- }
687
- return PutInsuranceFundEvent.fromJSONField(json);
688
- };
689
- PutInsuranceFundEvent.fromSuiParsedData = function (content) {
690
- if (content.dataType !== "moveObject") {
691
- throw new Error("not an object");
692
- }
693
- if (!isPutInsuranceFundEvent(content.type)) {
694
- throw new Error("object at ".concat(content.fields.id, " is not a PutInsuranceFundEvent object"));
695
- }
696
- return PutInsuranceFundEvent.fromFieldsWithTypes(content);
697
- };
698
- PutInsuranceFundEvent.fromSuiObjectData = function (data) {
699
- if (data.bcs) {
700
- if (data.bcs.dataType !== "moveObject" || !isPutInsuranceFundEvent(data.bcs.type)) {
701
- throw new Error("object at is not a PutInsuranceFundEvent object");
702
- }
703
- return PutInsuranceFundEvent.fromBcs((0, utils_1.fromB64)(data.bcs.bcsBytes));
704
- }
705
- if (data.content) {
706
- return PutInsuranceFundEvent.fromSuiParsedData(data.content);
707
- }
708
- throw new Error("Both `bcs` and `content` fields are missing from the data. Include `showBcs` or `showContent` in the request.");
709
- };
710
- PutInsuranceFundEvent.fetch = function (client, id) {
711
- return __awaiter(this, void 0, void 0, function () {
712
- var res;
713
- var _a, _b;
714
- return __generator(this, function (_c) {
715
- switch (_c.label) {
716
- case 0: return [4 /*yield*/, client.getObject({ id: id, options: { showBcs: true } })];
717
- case 1:
718
- res = _c.sent();
719
- if (res.error) {
720
- throw new Error("error fetching PutInsuranceFundEvent object at id ".concat(id, ": ").concat(res.error.code));
721
- }
722
- if (((_b = (_a = res.data) === null || _a === void 0 ? void 0 : _a.bcs) === null || _b === void 0 ? void 0 : _b.dataType) !== "moveObject" || !isPutInsuranceFundEvent(res.data.bcs.type)) {
723
- throw new Error("object at id ".concat(id, " is not a PutInsuranceFundEvent object"));
724
- }
725
- return [2 /*return*/, PutInsuranceFundEvent.fromSuiObjectData(res.data)];
726
- }
727
- });
728
- });
729
- };
730
- PutInsuranceFundEvent.$typeName = "".concat(index_1.PKG_V1, "::admin::PutInsuranceFundEvent");
731
- PutInsuranceFundEvent.$numTypeParams = 0;
732
- PutInsuranceFundEvent.$isPhantom = [];
733
- return PutInsuranceFundEvent;
734
- }());
735
- exports.PutInsuranceFundEvent = PutInsuranceFundEvent;
736
- /* ============================== SendFeeEvent =============================== */
737
- function isSendFeeEvent(type) {
738
- type = (0, util_1.compressSuiType)(type);
739
- return type === "".concat(index_1.PKG_V1, "::admin::SendFeeEvent");
740
- }
741
- var SendFeeEvent = /** @class */ (function () {
742
- function SendFeeEvent(typeArgs, fields) {
743
- this.__StructClass = true;
744
- this.$typeName = SendFeeEvent.$typeName;
745
- this.$isPhantom = SendFeeEvent.$isPhantom;
746
- this.$fullTypeName = util_1.composeSuiType.apply(void 0, __spreadArray([SendFeeEvent.$typeName], __read(typeArgs), false));
747
- this.$typeArgs = typeArgs;
748
- this.token = fields.token;
749
- this.amount = fields.amount;
750
- }
751
- SendFeeEvent.reified = function () {
752
- var _this = this;
753
- return {
754
- typeName: SendFeeEvent.$typeName,
755
- fullTypeName: util_1.composeSuiType.apply(void 0, __spreadArray([SendFeeEvent.$typeName], [], false)),
756
- typeArgs: [],
757
- isPhantom: SendFeeEvent.$isPhantom,
758
- reifiedTypeArgs: [],
759
- fromFields: function (fields) { return SendFeeEvent.fromFields(fields); },
760
- fromFieldsWithTypes: function (item) { return SendFeeEvent.fromFieldsWithTypes(item); },
761
- fromBcs: function (data) { return SendFeeEvent.fromBcs(data); },
762
- bcs: SendFeeEvent.bcs,
763
- fromJSONField: function (field) { return SendFeeEvent.fromJSONField(field); },
764
- fromJSON: function (json) { return SendFeeEvent.fromJSON(json); },
765
- fromSuiParsedData: function (content) { return SendFeeEvent.fromSuiParsedData(content); },
766
- fromSuiObjectData: function (content) { return SendFeeEvent.fromSuiObjectData(content); },
767
- fetch: function (client, id) { return __awaiter(_this, void 0, void 0, function () { return __generator(this, function (_a) {
768
- return [2 /*return*/, SendFeeEvent.fetch(client, id)];
769
- }); }); },
770
- new: function (fields) {
771
- return new SendFeeEvent([], fields);
772
- },
773
- kind: "StructClassReified",
774
- };
775
- };
776
- Object.defineProperty(SendFeeEvent, "r", {
777
- get: function () {
778
- return SendFeeEvent.reified();
779
- },
780
- enumerable: false,
781
- configurable: true
782
- });
783
- SendFeeEvent.phantom = function () {
784
- return (0, reified_1.phantom)(SendFeeEvent.reified());
785
- };
786
- Object.defineProperty(SendFeeEvent, "p", {
787
- get: function () {
788
- return SendFeeEvent.phantom();
789
- },
790
- enumerable: false,
791
- configurable: true
792
- });
793
- Object.defineProperty(SendFeeEvent, "bcs", {
794
- get: function () {
795
- return bcs_1.bcs.struct("SendFeeEvent", {
796
- token: structs_1.TypeName.bcs,
797
- amount: bcs_1.bcs.u64(),
798
- });
799
- },
800
- enumerable: false,
801
- configurable: true
802
- });
803
- SendFeeEvent.fromFields = function (fields) {
804
- return SendFeeEvent.reified().new({
805
- token: (0, reified_1.decodeFromFields)(structs_1.TypeName.reified(), fields.token),
806
- amount: (0, reified_1.decodeFromFields)("u64", fields.amount),
807
- });
808
- };
809
- SendFeeEvent.fromFieldsWithTypes = function (item) {
810
- if (!isSendFeeEvent(item.type)) {
811
- throw new Error("not a SendFeeEvent type");
812
- }
813
- return SendFeeEvent.reified().new({
814
- token: (0, reified_1.decodeFromFieldsWithTypes)(structs_1.TypeName.reified(), item.fields.token),
815
- amount: (0, reified_1.decodeFromFieldsWithTypes)("u64", item.fields.amount),
816
- });
817
- };
818
- SendFeeEvent.fromBcs = function (data) {
819
- return SendFeeEvent.fromFields(SendFeeEvent.bcs.parse(data));
820
- };
821
- SendFeeEvent.prototype.toJSONField = function () {
822
- return {
823
- token: this.token.toJSONField(),
824
- amount: this.amount.toString(),
825
- };
826
- };
827
- SendFeeEvent.prototype.toJSON = function () {
828
- return __assign({ $typeName: this.$typeName, $typeArgs: this.$typeArgs }, this.toJSONField());
829
- };
830
- SendFeeEvent.fromJSONField = function (field) {
831
- return SendFeeEvent.reified().new({
832
- token: (0, reified_1.decodeFromJSONField)(structs_1.TypeName.reified(), field.token),
833
- amount: (0, reified_1.decodeFromJSONField)("u64", field.amount),
834
- });
835
- };
836
- SendFeeEvent.fromJSON = function (json) {
837
- if (json.$typeName !== SendFeeEvent.$typeName) {
838
- throw new Error("not a WithTwoGenerics json object");
839
- }
840
- return SendFeeEvent.fromJSONField(json);
841
- };
842
- SendFeeEvent.fromSuiParsedData = function (content) {
843
- if (content.dataType !== "moveObject") {
844
- throw new Error("not an object");
845
- }
846
- if (!isSendFeeEvent(content.type)) {
847
- throw new Error("object at ".concat(content.fields.id, " is not a SendFeeEvent object"));
848
- }
849
- return SendFeeEvent.fromFieldsWithTypes(content);
850
- };
851
- SendFeeEvent.fromSuiObjectData = function (data) {
852
- if (data.bcs) {
853
- if (data.bcs.dataType !== "moveObject" || !isSendFeeEvent(data.bcs.type)) {
854
- throw new Error("object at is not a SendFeeEvent object");
855
- }
856
- return SendFeeEvent.fromBcs((0, utils_1.fromB64)(data.bcs.bcsBytes));
857
- }
858
- if (data.content) {
859
- return SendFeeEvent.fromSuiParsedData(data.content);
860
- }
861
- throw new Error("Both `bcs` and `content` fields are missing from the data. Include `showBcs` or `showContent` in the request.");
862
- };
863
- SendFeeEvent.fetch = function (client, id) {
864
- return __awaiter(this, void 0, void 0, function () {
865
- var res;
866
- var _a, _b;
867
- return __generator(this, function (_c) {
868
- switch (_c.label) {
869
- case 0: return [4 /*yield*/, client.getObject({ id: id, options: { showBcs: true } })];
870
- case 1:
871
- res = _c.sent();
872
- if (res.error) {
873
- throw new Error("error fetching SendFeeEvent object at id ".concat(id, ": ").concat(res.error.code));
874
- }
875
- if (((_b = (_a = res.data) === null || _a === void 0 ? void 0 : _a.bcs) === null || _b === void 0 ? void 0 : _b.dataType) !== "moveObject" || !isSendFeeEvent(res.data.bcs.type)) {
876
- throw new Error("object at id ".concat(id, " is not a SendFeeEvent object"));
877
- }
878
- return [2 /*return*/, SendFeeEvent.fromSuiObjectData(res.data)];
879
- }
880
- });
881
- });
882
- };
883
- SendFeeEvent.$typeName = "".concat(index_1.PKG_V1, "::admin::SendFeeEvent");
884
- SendFeeEvent.$numTypeParams = 0;
885
- SendFeeEvent.$isPhantom = [];
886
- return SendFeeEvent;
887
- }());
888
- exports.SendFeeEvent = SendFeeEvent;
889
- /* ============================== Version =============================== */
890
- function isVersion(type) {
891
- type = (0, util_1.compressSuiType)(type);
892
- return type === "".concat(index_1.PKG_V1, "::admin::Version");
893
- }
894
- var Version = /** @class */ (function () {
895
- function Version(typeArgs, fields) {
896
- this.__StructClass = true;
897
- this.$typeName = Version.$typeName;
898
- this.$isPhantom = Version.$isPhantom;
899
- this.$fullTypeName = util_1.composeSuiType.apply(void 0, __spreadArray([Version.$typeName], __read(typeArgs), false));
900
- this.$typeArgs = typeArgs;
901
- this.id = fields.id;
902
- this.value = fields.value;
903
- this.feePool = fields.feePool;
904
- this.liquidatorFeePool = fields.liquidatorFeePool;
905
- this.authority = fields.authority;
906
- this.u64Padding = fields.u64Padding;
907
- }
908
- Version.reified = function () {
909
- var _this = this;
910
- return {
911
- typeName: Version.$typeName,
912
- fullTypeName: util_1.composeSuiType.apply(void 0, __spreadArray([Version.$typeName], [], false)),
913
- typeArgs: [],
914
- isPhantom: Version.$isPhantom,
915
- reifiedTypeArgs: [],
916
- fromFields: function (fields) { return Version.fromFields(fields); },
917
- fromFieldsWithTypes: function (item) { return Version.fromFieldsWithTypes(item); },
918
- fromBcs: function (data) { return Version.fromBcs(data); },
919
- bcs: Version.bcs,
920
- fromJSONField: function (field) { return Version.fromJSONField(field); },
921
- fromJSON: function (json) { return Version.fromJSON(json); },
922
- fromSuiParsedData: function (content) { return Version.fromSuiParsedData(content); },
923
- fromSuiObjectData: function (content) { return Version.fromSuiObjectData(content); },
924
- fetch: function (client, id) { return __awaiter(_this, void 0, void 0, function () { return __generator(this, function (_a) {
925
- return [2 /*return*/, Version.fetch(client, id)];
926
- }); }); },
927
- new: function (fields) {
928
- return new Version([], fields);
929
- },
930
- kind: "StructClassReified",
931
- };
932
- };
933
- Object.defineProperty(Version, "r", {
934
- get: function () {
935
- return Version.reified();
936
- },
937
- enumerable: false,
938
- configurable: true
939
- });
940
- Version.phantom = function () {
941
- return (0, reified_1.phantom)(Version.reified());
942
- };
943
- Object.defineProperty(Version, "p", {
944
- get: function () {
945
- return Version.phantom();
946
- },
947
- enumerable: false,
948
- configurable: true
949
- });
950
- Object.defineProperty(Version, "bcs", {
951
- get: function () {
952
- return bcs_1.bcs.struct("Version", {
953
- id: structs_2.UID.bcs,
954
- value: bcs_1.bcs.u64(),
955
- fee_pool: FeePool.bcs,
956
- liquidator_fee_pool: FeePool.bcs,
957
- authority: structs_3.VecSet.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); } })),
958
- u64_padding: bcs_1.bcs.vector(bcs_1.bcs.u64()),
959
- });
960
- },
961
- enumerable: false,
962
- configurable: true
963
- });
964
- Version.fromFields = function (fields) {
965
- return Version.reified().new({
966
- id: (0, reified_1.decodeFromFields)(structs_2.UID.reified(), fields.id),
967
- value: (0, reified_1.decodeFromFields)("u64", fields.value),
968
- feePool: (0, reified_1.decodeFromFields)(FeePool.reified(), fields.fee_pool),
969
- liquidatorFeePool: (0, reified_1.decodeFromFields)(FeePool.reified(), fields.liquidator_fee_pool),
970
- authority: (0, reified_1.decodeFromFields)(structs_3.VecSet.reified("address"), fields.authority),
971
- u64Padding: (0, reified_1.decodeFromFields)(reified.vector("u64"), fields.u64_padding),
972
- });
973
- };
974
- Version.fromFieldsWithTypes = function (item) {
975
- if (!isVersion(item.type)) {
976
- throw new Error("not a Version type");
977
- }
978
- return Version.reified().new({
979
- id: (0, reified_1.decodeFromFieldsWithTypes)(structs_2.UID.reified(), item.fields.id),
980
- value: (0, reified_1.decodeFromFieldsWithTypes)("u64", item.fields.value),
981
- feePool: (0, reified_1.decodeFromFieldsWithTypes)(FeePool.reified(), item.fields.fee_pool),
982
- liquidatorFeePool: (0, reified_1.decodeFromFieldsWithTypes)(FeePool.reified(), item.fields.liquidator_fee_pool),
983
- authority: (0, reified_1.decodeFromFieldsWithTypes)(structs_3.VecSet.reified("address"), item.fields.authority),
984
- u64Padding: (0, reified_1.decodeFromFieldsWithTypes)(reified.vector("u64"), item.fields.u64_padding),
985
- });
986
- };
987
- Version.fromBcs = function (data) {
988
- return Version.fromFields(Version.bcs.parse(data));
989
- };
990
- Version.prototype.toJSONField = function () {
991
- return {
992
- id: this.id,
993
- value: this.value.toString(),
994
- feePool: this.feePool.toJSONField(),
995
- liquidatorFeePool: this.liquidatorFeePool.toJSONField(),
996
- authority: this.authority.toJSONField(),
997
- u64Padding: (0, reified_1.fieldToJSON)("vector<u64>", this.u64Padding),
998
- };
999
- };
1000
- Version.prototype.toJSON = function () {
1001
- return __assign({ $typeName: this.$typeName, $typeArgs: this.$typeArgs }, this.toJSONField());
1002
- };
1003
- Version.fromJSONField = function (field) {
1004
- return Version.reified().new({
1005
- id: (0, reified_1.decodeFromJSONField)(structs_2.UID.reified(), field.id),
1006
- value: (0, reified_1.decodeFromJSONField)("u64", field.value),
1007
- feePool: (0, reified_1.decodeFromJSONField)(FeePool.reified(), field.feePool),
1008
- liquidatorFeePool: (0, reified_1.decodeFromJSONField)(FeePool.reified(), field.liquidatorFeePool),
1009
- authority: (0, reified_1.decodeFromJSONField)(structs_3.VecSet.reified("address"), field.authority),
1010
- u64Padding: (0, reified_1.decodeFromJSONField)(reified.vector("u64"), field.u64Padding),
1011
- });
1012
- };
1013
- Version.fromJSON = function (json) {
1014
- if (json.$typeName !== Version.$typeName) {
1015
- throw new Error("not a WithTwoGenerics json object");
1016
- }
1017
- return Version.fromJSONField(json);
1018
- };
1019
- Version.fromSuiParsedData = function (content) {
1020
- if (content.dataType !== "moveObject") {
1021
- throw new Error("not an object");
1022
- }
1023
- if (!isVersion(content.type)) {
1024
- throw new Error("object at ".concat(content.fields.id, " is not a Version object"));
1025
- }
1026
- return Version.fromFieldsWithTypes(content);
1027
- };
1028
- Version.fromSuiObjectData = function (data) {
1029
- if (data.bcs) {
1030
- if (data.bcs.dataType !== "moveObject" || !isVersion(data.bcs.type)) {
1031
- throw new Error("object at is not a Version object");
1032
- }
1033
- return Version.fromBcs((0, utils_1.fromB64)(data.bcs.bcsBytes));
1034
- }
1035
- if (data.content) {
1036
- return Version.fromSuiParsedData(data.content);
1037
- }
1038
- throw new Error("Both `bcs` and `content` fields are missing from the data. Include `showBcs` or `showContent` in the request.");
1039
- };
1040
- Version.fetch = function (client, id) {
1041
- return __awaiter(this, void 0, void 0, function () {
1042
- var res;
1043
- var _a, _b;
1044
- return __generator(this, function (_c) {
1045
- switch (_c.label) {
1046
- case 0: return [4 /*yield*/, client.getObject({ id: id, options: { showBcs: true } })];
1047
- case 1:
1048
- res = _c.sent();
1049
- if (res.error) {
1050
- throw new Error("error fetching Version object at id ".concat(id, ": ").concat(res.error.code));
1051
- }
1052
- if (((_b = (_a = res.data) === null || _a === void 0 ? void 0 : _a.bcs) === null || _b === void 0 ? void 0 : _b.dataType) !== "moveObject" || !isVersion(res.data.bcs.type)) {
1053
- throw new Error("object at id ".concat(id, " is not a Version object"));
1054
- }
1055
- return [2 /*return*/, Version.fromSuiObjectData(res.data)];
1056
- }
1057
- });
1058
- });
1059
- };
1060
- Version.$typeName = "".concat(index_1.PKG_V1, "::admin::Version");
1061
- Version.$numTypeParams = 0;
1062
- Version.$isPhantom = [];
1063
- return Version;
1064
- }());
1065
- exports.Version = Version;