@typus/typus-perp-sdk 1.1.32-codegen-exp3 → 1.1.32-testnet-exp1

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/_dependencies/source/0x1/ascii/structs.d.ts +88 -0
  2. package/dist/src/_dependencies/source/0x1/ascii/structs.js +398 -0
  3. package/dist/src/_dependencies/source/0x1/index.d.ts +3 -0
  4. package/dist/src/_dependencies/source/0x1/index.js +6 -0
  5. package/dist/src/_dependencies/source/0x1/option/structs.d.ts +50 -0
  6. package/dist/src/_dependencies/source/0x1/option/structs.js +271 -0
  7. package/dist/src/_dependencies/source/0x1/string/structs.d.ts +48 -0
  8. package/dist/src/_dependencies/source/0x1/string/structs.js +256 -0
  9. package/dist/src/_dependencies/source/0x1/type-name/structs.d.ts +49 -0
  10. package/dist/src/_dependencies/source/0x1/type-name/structs.js +223 -0
  11. package/dist/src/_dependencies/source/0x2/bag/structs.d.ts +54 -0
  12. package/dist/src/_dependencies/source/0x2/bag/structs.js +229 -0
  13. package/dist/src/_dependencies/source/0x2/balance/structs.d.ts +84 -0
  14. package/dist/src/_dependencies/source/0x2/balance/structs.js +386 -0
  15. package/dist/src/_dependencies/source/0x2/coin/structs.d.ts +406 -0
  16. package/dist/src/_dependencies/source/0x2/coin/structs.js +1247 -0
  17. package/dist/src/_dependencies/source/0x2/index.d.ts +3 -0
  18. package/dist/src/_dependencies/source/0x2/index.js +6 -0
  19. package/dist/src/_dependencies/source/0x2/linked-table/structs.d.ts +132 -0
  20. package/dist/src/_dependencies/source/0x2/linked-table/structs.js +438 -0
  21. package/dist/src/_dependencies/source/0x2/object/structs.d.ts +86 -0
  22. package/dist/src/_dependencies/source/0x2/object/structs.js +364 -0
  23. package/dist/src/_dependencies/source/0x2/object-table/structs.d.ts +54 -0
  24. package/dist/src/_dependencies/source/0x2/object-table/structs.js +248 -0
  25. package/dist/src/_dependencies/source/0x2/sui/structs.d.ts +44 -0
  26. package/dist/src/_dependencies/source/0x2/sui/structs.js +222 -0
  27. package/dist/src/_dependencies/source/0x2/table/structs.d.ts +54 -0
  28. package/dist/src/_dependencies/source/0x2/table/structs.js +248 -0
  29. package/dist/src/_dependencies/source/0x2/table-vec/structs.d.ts +59 -0
  30. package/dist/src/_dependencies/source/0x2/table-vec/structs.js +274 -0
  31. package/dist/src/_dependencies/source/0x2/token/structs.d.ts +421 -0
  32. package/dist/src/_dependencies/source/0x2/token/structs.js +1095 -0
  33. package/dist/src/_dependencies/source/0x2/transfer-policy/structs.d.ts +348 -0
  34. package/dist/src/_dependencies/source/0x2/transfer-policy/structs.js +1091 -0
  35. package/dist/src/_dependencies/source/0x2/url/structs.d.ts +49 -0
  36. package/dist/src/_dependencies/source/0x2/url/structs.js +223 -0
  37. package/dist/src/_dependencies/source/0x2/vec-map/structs.d.ts +106 -0
  38. package/dist/src/_dependencies/source/0x2/vec-map/structs.js +446 -0
  39. package/dist/src/_dependencies/source/0x2/vec-set/structs.d.ts +49 -0
  40. package/dist/src/_dependencies/source/0x2/vec-set/structs.js +270 -0
  41. package/dist/src/_dependencies/source/0x4b0f4ee1a40ce37ec81c987cc4e76a665419e74b863319492fc7d26f708b835a/airdrop/structs.d.ts +422 -0
  42. package/dist/src/_dependencies/source/0x4b0f4ee1a40ce37ec81c987cc4e76a665419e74b863319492fc7d26f708b835a/airdrop/structs.js +1084 -0
  43. package/dist/src/_dependencies/source/0x4b0f4ee1a40ce37ec81c987cc4e76a665419e74b863319492fc7d26f708b835a/big-vector/structs.d.ts +130 -0
  44. package/dist/src/_dependencies/source/0x4b0f4ee1a40ce37ec81c987cc4e76a665419e74b863319492fc7d26f708b835a/big-vector/structs.js +456 -0
  45. package/dist/src/_dependencies/source/0x4b0f4ee1a40ce37ec81c987cc4e76a665419e74b863319492fc7d26f708b835a/critbit/structs.d.ts +208 -0
  46. package/dist/src/_dependencies/source/0x4b0f4ee1a40ce37ec81c987cc4e76a665419e74b863319492fc7d26f708b835a/critbit/structs.js +653 -0
  47. package/dist/src/_dependencies/source/0x4b0f4ee1a40ce37ec81c987cc4e76a665419e74b863319492fc7d26f708b835a/ecosystem/structs.d.ts +362 -0
  48. package/dist/src/_dependencies/source/0x4b0f4ee1a40ce37ec81c987cc4e76a665419e74b863319492fc7d26f708b835a/ecosystem/structs.js +899 -0
  49. package/dist/src/_dependencies/source/0x4b0f4ee1a40ce37ec81c987cc4e76a665419e74b863319492fc7d26f708b835a/index.d.ts +8 -0
  50. package/dist/src/_dependencies/source/0x4b0f4ee1a40ce37ec81c987cc4e76a665419e74b863319492fc7d26f708b835a/index.js +11 -0
  51. package/dist/src/_dependencies/source/0x4b0f4ee1a40ce37ec81c987cc4e76a665419e74b863319492fc7d26f708b835a/init.d.ts +2 -0
  52. package/dist/src/_dependencies/source/0x4b0f4ee1a40ce37ec81c987cc4e76a665419e74b863319492fc7d26f708b835a/init.js +102 -0
  53. package/dist/src/_dependencies/source/0x4b0f4ee1a40ce37ec81c987cc4e76a665419e74b863319492fc7d26f708b835a/keyed-big-vector/structs.d.ts +202 -0
  54. package/dist/src/_dependencies/source/0x4b0f4ee1a40ce37ec81c987cc4e76a665419e74b863319492fc7d26f708b835a/keyed-big-vector/structs.js +632 -0
  55. package/dist/src/_dependencies/source/0x4b0f4ee1a40ce37ec81c987cc4e76a665419e74b863319492fc7d26f708b835a/leaderboard/structs.d.ts +600 -0
  56. package/dist/src/_dependencies/source/0x4b0f4ee1a40ce37ec81c987cc4e76a665419e74b863319492fc7d26f708b835a/leaderboard/structs.js +1459 -0
  57. package/dist/src/_dependencies/source/0x4b0f4ee1a40ce37ec81c987cc4e76a665419e74b863319492fc7d26f708b835a/linked-object-table/structs.d.ts +136 -0
  58. package/dist/src/_dependencies/source/0x4b0f4ee1a40ce37ec81c987cc4e76a665419e74b863319492fc7d26f708b835a/linked-object-table/structs.js +438 -0
  59. package/dist/src/_dependencies/source/0x4b0f4ee1a40ce37ec81c987cc4e76a665419e74b863319492fc7d26f708b835a/linked-set/structs.d.ts +127 -0
  60. package/dist/src/_dependencies/source/0x4b0f4ee1a40ce37ec81c987cc4e76a665419e74b863319492fc7d26f708b835a/linked-set/structs.js +430 -0
  61. package/dist/src/_dependencies/source/0x4b0f4ee1a40ce37ec81c987cc4e76a665419e74b863319492fc7d26f708b835a/tails-staking/structs.d.ts +957 -0
  62. package/dist/src/_dependencies/source/0x4b0f4ee1a40ce37ec81c987cc4e76a665419e74b863319492fc7d26f708b835a/tails-staking/structs.js +2261 -0
  63. package/dist/src/_dependencies/source/0x4b0f4ee1a40ce37ec81c987cc4e76a665419e74b863319492fc7d26f708b835a/tgld/structs.d.ts +244 -0
  64. package/dist/src/_dependencies/source/0x4b0f4ee1a40ce37ec81c987cc4e76a665419e74b863319492fc7d26f708b835a/tgld/structs.js +733 -0
  65. package/dist/src/_dependencies/source/0x4b0f4ee1a40ce37ec81c987cc4e76a665419e74b863319492fc7d26f708b835a/user/structs.d.ts +294 -0
  66. package/dist/src/_dependencies/source/0x4b0f4ee1a40ce37ec81c987cc4e76a665419e74b863319492fc7d26f708b835a/user/structs.js +892 -0
  67. package/dist/src/_dependencies/source/0xb4f25230ba74837d8299e92951306100c4a532e8c48cc3d8828abe9b91c8b274/authority/structs.d.ts +73 -0
  68. package/dist/src/_dependencies/source/0xb4f25230ba74837d8299e92951306100c4a532e8c48cc3d8828abe9b91c8b274/authority/structs.js +263 -0
  69. package/dist/src/_dependencies/source/0xb4f25230ba74837d8299e92951306100c4a532e8c48cc3d8828abe9b91c8b274/balance-pool/structs.d.ts +294 -0
  70. package/dist/src/_dependencies/source/0xb4f25230ba74837d8299e92951306100c4a532e8c48cc3d8828abe9b91c8b274/balance-pool/structs.js +591 -0
  71. package/dist/src/_dependencies/source/0xb4f25230ba74837d8299e92951306100c4a532e8c48cc3d8828abe9b91c8b274/big-vector/structs.d.ts +64 -0
  72. package/dist/src/_dependencies/source/0xb4f25230ba74837d8299e92951306100c4a532e8c48cc3d8828abe9b91c8b274/big-vector/structs.js +258 -0
  73. package/dist/src/_dependencies/source/0xb4f25230ba74837d8299e92951306100c4a532e8c48cc3d8828abe9b91c8b274/dutch/structs.d.ts +756 -0
  74. package/dist/src/_dependencies/source/0xb4f25230ba74837d8299e92951306100c4a532e8c48cc3d8828abe9b91c8b274/dutch/structs.js +1721 -0
  75. package/dist/src/_dependencies/source/0xb4f25230ba74837d8299e92951306100c4a532e8c48cc3d8828abe9b91c8b274/i64/structs.d.ts +44 -0
  76. package/dist/src/_dependencies/source/0xb4f25230ba74837d8299e92951306100c4a532e8c48cc3d8828abe9b91c8b274/i64/structs.js +222 -0
  77. package/dist/src/_dependencies/source/0xb4f25230ba74837d8299e92951306100c4a532e8c48cc3d8828abe9b91c8b274/index.d.ts +3 -0
  78. package/dist/src/_dependencies/source/0xb4f25230ba74837d8299e92951306100c4a532e8c48cc3d8828abe9b91c8b274/index.js +6 -0
  79. package/dist/src/_dependencies/source/0xb4f25230ba74837d8299e92951306100c4a532e8c48cc3d8828abe9b91c8b274/init.d.ts +2 -0
  80. package/dist/src/_dependencies/source/0xb4f25230ba74837d8299e92951306100c4a532e8c48cc3d8828abe9b91c8b274/init.js +89 -0
  81. package/dist/src/_dependencies/source/0xb4f25230ba74837d8299e92951306100c4a532e8c48cc3d8828abe9b91c8b274/linked-list/structs.d.ts +135 -0
  82. package/dist/src/_dependencies/source/0xb4f25230ba74837d8299e92951306100c4a532e8c48cc3d8828abe9b91c8b274/linked-list/structs.js +444 -0
  83. package/dist/src/_dependencies/source/0xb4f25230ba74837d8299e92951306100c4a532e8c48cc3d8828abe9b91c8b274/vault/structs.d.ts +2106 -0
  84. package/dist/src/_dependencies/source/0xb4f25230ba74837d8299e92951306100c4a532e8c48cc3d8828abe9b91c8b274/vault/structs.js +4952 -0
  85. package/dist/src/_dependencies/source/0xbd147bc7f12f38f175d78947a61364e8e077b9b188b00e7094bc0c3623162196/discount-mint/structs.d.ts +390 -0
  86. package/dist/src/_dependencies/source/0xbd147bc7f12f38f175d78947a61364e8e077b9b188b00e7094bc0c3623162196/discount-mint/structs.js +844 -0
  87. package/dist/src/_dependencies/source/0xbd147bc7f12f38f175d78947a61364e8e077b9b188b00e7094bc0c3623162196/index.d.ts +6 -0
  88. package/dist/src/_dependencies/source/0xbd147bc7f12f38f175d78947a61364e8e077b9b188b00e7094bc0c3623162196/index.js +9 -0
  89. package/dist/src/_dependencies/source/0xbd147bc7f12f38f175d78947a61364e8e077b9b188b00e7094bc0c3623162196/init.d.ts +2 -0
  90. package/dist/src/_dependencies/source/0xbd147bc7f12f38f175d78947a61364e8e077b9b188b00e7094bc0c3623162196/init.js +69 -0
  91. package/dist/src/_dependencies/source/0xbd147bc7f12f38f175d78947a61364e8e077b9b188b00e7094bc0c3623162196/royalty-rule/structs.d.ts +89 -0
  92. package/dist/src/_dependencies/source/0xbd147bc7f12f38f175d78947a61364e8e077b9b188b00e7094bc0c3623162196/royalty-rule/structs.js +376 -0
  93. package/dist/src/_dependencies/source/0xbd147bc7f12f38f175d78947a61364e8e077b9b188b00e7094bc0c3623162196/staking/structs.d.ts +386 -0
  94. package/dist/src/_dependencies/source/0xbd147bc7f12f38f175d78947a61364e8e077b9b188b00e7094bc0c3623162196/staking/structs.js +881 -0
  95. package/dist/src/_dependencies/source/0xbd147bc7f12f38f175d78947a61364e8e077b9b188b00e7094bc0c3623162196/table-vec/structs.d.ts +59 -0
  96. package/dist/src/_dependencies/source/0xbd147bc7f12f38f175d78947a61364e8e077b9b188b00e7094bc0c3623162196/table-vec/structs.js +274 -0
  97. package/dist/src/_dependencies/source/0xbd147bc7f12f38f175d78947a61364e8e077b9b188b00e7094bc0c3623162196/typus-nft/structs.d.ts +974 -0
  98. package/dist/src/_dependencies/source/0xbd147bc7f12f38f175d78947a61364e8e077b9b188b00e7094bc0c3623162196/typus-nft/structs.js +2387 -0
  99. package/dist/src/_framework/init-loader.d.ts +2 -0
  100. package/dist/src/{generated/typus_perp/treasury_caps.js → _framework/init-loader.js} +10 -17
  101. package/dist/src/_framework/loader.d.ts +17 -0
  102. package/dist/src/_framework/loader.js +108 -0
  103. package/dist/src/_framework/reified.d.ts +108 -0
  104. package/dist/src/_framework/reified.js +237 -0
  105. package/dist/src/_framework/util.d.ts +35 -0
  106. package/dist/src/_framework/util.js +396 -0
  107. package/dist/src/_framework/vector.d.ts +42 -0
  108. package/dist/src/_framework/vector.js +112 -0
  109. package/dist/src/api/sentio.js +538 -604
  110. package/dist/src/fetch.d.ts +36 -577
  111. package/dist/src/fetch.js +665 -367
  112. package/dist/src/index.d.ts +4 -0
  113. package/dist/src/index.js +39 -20
  114. package/dist/src/pyth.js +1 -0
  115. package/dist/src/typus_perp/admin/functions.d.ts +59 -0
  116. package/dist/src/typus_perp/admin/functions.js +122 -0
  117. package/dist/src/typus_perp/admin/structs.d.ts +467 -0
  118. package/dist/src/typus_perp/admin/structs.js +1065 -0
  119. package/dist/src/typus_perp/competition/functions.d.ts +24 -0
  120. package/dist/src/typus_perp/competition/functions.js +38 -0
  121. package/dist/src/typus_perp/competition/structs.d.ts +80 -0
  122. package/dist/src/typus_perp/competition/structs.js +288 -0
  123. package/dist/src/typus_perp/error/functions.d.ts +73 -0
  124. package/dist/src/typus_perp/error/functions.js +363 -0
  125. package/dist/src/typus_perp/escrow/functions.d.ts +17 -0
  126. package/dist/src/typus_perp/escrow/functions.js +36 -0
  127. package/dist/src/typus_perp/escrow/structs.d.ts +160 -0
  128. package/dist/src/typus_perp/escrow/structs.js +324 -0
  129. package/dist/src/typus_perp/index.d.ts +1 -0
  130. package/dist/src/typus_perp/index.js +7 -0
  131. package/dist/src/typus_perp/init.d.ts +2 -0
  132. package/dist/src/typus_perp/init.js +118 -0
  133. package/dist/src/typus_perp/lending/functions.d.ts +15 -0
  134. package/dist/src/typus_perp/lending/functions.js +22 -0
  135. package/dist/src/typus_perp/lp-pool/functions.d.ts +460 -0
  136. package/dist/src/typus_perp/lp-pool/functions.js +732 -0
  137. package/dist/src/typus_perp/lp-pool/structs.d.ts +3705 -0
  138. package/dist/src/typus_perp/lp-pool/structs.js +6789 -0
  139. package/dist/src/typus_perp/math/functions.d.ts +29 -0
  140. package/dist/src/typus_perp/math/functions.js +61 -0
  141. package/dist/src/typus_perp/position/functions.d.ts +379 -0
  142. package/dist/src/typus_perp/position/functions.js +713 -0
  143. package/dist/src/typus_perp/position/structs.d.ts +905 -0
  144. package/dist/src/typus_perp/position/structs.js +1450 -0
  145. package/dist/src/typus_perp/symbol/functions.d.ts +9 -0
  146. package/dist/src/typus_perp/symbol/functions.js +24 -0
  147. package/dist/src/typus_perp/symbol/structs.d.ts +70 -0
  148. package/dist/src/typus_perp/symbol/structs.js +235 -0
  149. package/dist/src/typus_perp/tlp/functions.d.ts +19 -0
  150. package/dist/src/typus_perp/tlp/functions.js +40 -0
  151. package/dist/src/typus_perp/tlp/structs.d.ts +89 -0
  152. package/dist/src/typus_perp/tlp/structs.js +365 -0
  153. package/dist/src/typus_perp/token-interface/functions.d.ts +11 -0
  154. package/dist/src/typus_perp/token-interface/functions.js +22 -0
  155. package/dist/src/typus_perp/trading/functions.d.ts +812 -0
  156. package/dist/src/typus_perp/trading/functions.js +1218 -0
  157. package/dist/src/typus_perp/trading/structs.d.ts +3060 -0
  158. package/dist/src/typus_perp/trading/structs.js +5813 -0
  159. package/dist/src/typus_perp/treasury-caps/functions.d.ts +9 -0
  160. package/dist/src/typus_perp/treasury-caps/functions.js +36 -0
  161. package/dist/src/typus_perp/treasury-caps/structs.d.ts +49 -0
  162. package/dist/src/typus_perp/treasury-caps/structs.js +223 -0
  163. package/dist/src/typus_perp/user-account/functions.d.ts +36 -0
  164. package/dist/src/typus_perp/user-account/functions.js +70 -0
  165. package/dist/src/typus_perp/user-account/structs.d.ts +148 -0
  166. package/dist/src/typus_perp/user-account/structs.js +448 -0
  167. package/dist/src/typus_stake_pool/admin/functions.d.ts +49 -0
  168. package/dist/src/typus_stake_pool/admin/functions.js +105 -0
  169. package/dist/src/typus_stake_pool/admin/structs.d.ts +365 -0
  170. package/dist/src/typus_stake_pool/admin/structs.js +789 -0
  171. package/dist/src/typus_stake_pool/index.d.ts +1 -0
  172. package/dist/src/typus_stake_pool/index.js +7 -0
  173. package/dist/src/typus_stake_pool/init.d.ts +2 -0
  174. package/dist/src/typus_stake_pool/init.js +69 -0
  175. package/dist/src/typus_stake_pool/stake-pool/functions.d.ts +229 -0
  176. package/dist/src/typus_stake_pool/stake-pool/functions.js +380 -0
  177. package/dist/src/typus_stake_pool/stake-pool/structs.d.ts +2199 -0
  178. package/dist/src/typus_stake_pool/stake-pool/structs.js +4653 -0
  179. package/dist/src/user/history.js +685 -614
  180. package/dist/src/user/order.d.ts +11 -16
  181. package/dist/src/user/order.js +302 -171
  182. package/dist/src/user/orderWithBidReceipt.d.ts +6 -8
  183. package/dist/src/user/orderWithBidReceipt.js +225 -127
  184. package/dist/src/user/tlp.d.ts +24 -25
  185. package/dist/src/user/tlp.js +468 -317
  186. package/package.json +3 -11
  187. package/dist/src/client.d.ts +0 -27
  188. package/dist/src/client.js +0 -108
  189. package/dist/src/generated/typus_perp/admin.d.ts +0 -117
  190. package/dist/src/generated/typus_perp/admin.js +0 -110
  191. package/dist/src/generated/typus_perp/competition.d.ts +0 -22
  192. package/dist/src/generated/typus_perp/competition.js +0 -58
  193. package/dist/src/generated/typus_perp/deps/std/type_name.d.ts +0 -17
  194. package/dist/src/generated/typus_perp/deps/std/type_name.js +0 -25
  195. package/dist/src/generated/typus_perp/deps/sui/balance.d.ts +0 -12
  196. package/dist/src/generated/typus_perp/deps/sui/balance.js +0 -20
  197. package/dist/src/generated/typus_perp/deps/sui/object.d.ts +0 -8
  198. package/dist/src/generated/typus_perp/deps/sui/object.js +0 -16
  199. package/dist/src/generated/typus_perp/deps/sui/object_table.d.ts +0 -19
  200. package/dist/src/generated/typus_perp/deps/sui/object_table.js +0 -59
  201. package/dist/src/generated/typus_perp/deps/sui/vec_set.d.ts +0 -18
  202. package/dist/src/generated/typus_perp/deps/sui/vec_set.js +0 -25
  203. package/dist/src/generated/typus_perp/deps/typus/keyed_big_vector.d.ts +0 -30
  204. package/dist/src/generated/typus_perp/deps/typus/keyed_big_vector.js +0 -67
  205. package/dist/src/generated/typus_perp/deps/typus/linked_object_table.d.ts +0 -32
  206. package/dist/src/generated/typus_perp/deps/typus/linked_object_table.js +0 -71
  207. package/dist/src/generated/typus_perp/deps/typus_framework/vault.d.ts +0 -23
  208. package/dist/src/generated/typus_perp/deps/typus_framework/vault.js +0 -61
  209. package/dist/src/generated/typus_perp/escrow.d.ts +0 -59
  210. package/dist/src/generated/typus_perp/escrow.js +0 -76
  211. package/dist/src/generated/typus_perp/lending.d.ts +0 -47
  212. package/dist/src/generated/typus_perp/lending.js +0 -50
  213. package/dist/src/generated/typus_perp/lp_pool.d.ts +0 -2327
  214. package/dist/src/generated/typus_perp/lp_pool.js +0 -1956
  215. package/dist/src/generated/typus_perp/math.d.ts +0 -95
  216. package/dist/src/generated/typus_perp/math.js +0 -97
  217. package/dist/src/generated/typus_perp/position.d.ts +0 -234
  218. package/dist/src/generated/typus_perp/position.js +0 -204
  219. package/dist/src/generated/typus_perp/symbol.d.ts +0 -18
  220. package/dist/src/generated/typus_perp/symbol.js +0 -55
  221. package/dist/src/generated/typus_perp/tlp.d.ts +0 -13
  222. package/dist/src/generated/typus_perp/tlp.js +0 -56
  223. package/dist/src/generated/typus_perp/trading.d.ts +0 -2486
  224. package/dist/src/generated/typus_perp/trading.js +0 -2476
  225. package/dist/src/generated/typus_perp/treasury_caps.d.ts +0 -13
  226. package/dist/src/generated/typus_perp/user_account.d.ts +0 -40
  227. package/dist/src/generated/typus_perp/user_account.js +0 -72
  228. package/dist/src/generated/typus_stake_pool/admin.d.ts +0 -234
  229. package/dist/src/generated/typus_stake_pool/admin.js +0 -272
  230. package/dist/src/generated/typus_stake_pool/deps/std/type_name.d.ts +0 -17
  231. package/dist/src/generated/typus_stake_pool/deps/std/type_name.js +0 -25
  232. package/dist/src/generated/typus_stake_pool/deps/sui/object.d.ts +0 -8
  233. package/dist/src/generated/typus_stake_pool/deps/sui/object.js +0 -16
  234. package/dist/src/generated/typus_stake_pool/deps/sui/vec_map.d.ts +0 -30
  235. package/dist/src/generated/typus_stake_pool/deps/sui/vec_map.js +0 -37
  236. package/dist/src/generated/typus_stake_pool/deps/sui/vec_set.d.ts +0 -18
  237. package/dist/src/generated/typus_stake_pool/deps/sui/vec_set.js +0 -25
  238. package/dist/src/generated/typus_stake_pool/stake_pool.d.ts +0 -986
  239. package/dist/src/generated/typus_stake_pool/stake_pool.js +0 -874
  240. package/dist/src/generated/utils/index.d.ts +0 -11
  241. package/dist/src/generated/utils/index.js +0 -135
  242. package/dist/src/grpc/graphql.d.ts +0 -26
  243. package/dist/src/grpc/graphql.js +0 -126
  244. package/dist/src/grpc/grpc.d.ts +0 -1
  245. package/dist/src/grpc/grpc.js +0 -38
  246. package/dist/src/grpc/ledgerService.js +0 -64
  247. package/dist/src/grpc/liveDataService.d.ts +0 -0
  248. package/dist/src/grpc/liveDataService.js +0 -49
  249. /package/dist/src/{grpc/ledgerService.d.ts → pyth.d.ts} +0 -0
@@ -0,0 +1,844 @@
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.Pool = exports.MintRequestEvent = exports.MintRequest = exports.DiscountEventV3 = void 0;
109
+ exports.isDiscountEventV3 = isDiscountEventV3;
110
+ exports.isMintRequest = isMintRequest;
111
+ exports.isMintRequestEvent = isMintRequestEvent;
112
+ exports.isPool = isPool;
113
+ var reified = __importStar(require("../../../../_framework/reified"));
114
+ var reified_1 = require("../../../../_framework/reified");
115
+ var util_1 = require("../../../../_framework/util");
116
+ var structs_1 = require("../../0x2/balance/structs");
117
+ var structs_2 = require("../../0x2/coin/structs");
118
+ var structs_3 = require("../../0x2/object/structs");
119
+ var structs_4 = require("../../0x2/sui/structs");
120
+ var structs_5 = require("../../0x2/table-vec/structs");
121
+ var index_1 = require("../index");
122
+ var structs_6 = require("../typus-nft/structs");
123
+ var bcs_1 = require("@mysten/sui/bcs");
124
+ var utils_1 = require("@mysten/sui/utils");
125
+ /* ============================== DiscountEventV3 =============================== */
126
+ function isDiscountEventV3(type) {
127
+ type = (0, util_1.compressSuiType)(type);
128
+ return type === "".concat(index_1.PKG_V8, "::discount_mint::DiscountEventV3");
129
+ }
130
+ var DiscountEventV3 = /** @class */ (function () {
131
+ function DiscountEventV3(typeArgs, fields) {
132
+ this.__StructClass = true;
133
+ this.$typeName = DiscountEventV3.$typeName;
134
+ this.$isPhantom = DiscountEventV3.$isPhantom;
135
+ this.$fullTypeName = util_1.composeSuiType.apply(void 0, __spreadArray([DiscountEventV3.$typeName], __read(typeArgs), false));
136
+ this.$typeArgs = typeArgs;
137
+ this.pool = fields.pool;
138
+ this.price = fields.price;
139
+ this.discountPct = fields.discountPct;
140
+ this.discountPrice = fields.discountPrice;
141
+ this.user = fields.user;
142
+ this.vrfInput = fields.vrfInput;
143
+ this.level = fields.level;
144
+ }
145
+ DiscountEventV3.reified = function () {
146
+ var _this = this;
147
+ return {
148
+ typeName: DiscountEventV3.$typeName,
149
+ fullTypeName: util_1.composeSuiType.apply(void 0, __spreadArray([DiscountEventV3.$typeName], [], false)),
150
+ typeArgs: [],
151
+ isPhantom: DiscountEventV3.$isPhantom,
152
+ reifiedTypeArgs: [],
153
+ fromFields: function (fields) { return DiscountEventV3.fromFields(fields); },
154
+ fromFieldsWithTypes: function (item) { return DiscountEventV3.fromFieldsWithTypes(item); },
155
+ fromBcs: function (data) { return DiscountEventV3.fromBcs(data); },
156
+ bcs: DiscountEventV3.bcs,
157
+ fromJSONField: function (field) { return DiscountEventV3.fromJSONField(field); },
158
+ fromJSON: function (json) { return DiscountEventV3.fromJSON(json); },
159
+ fromSuiParsedData: function (content) { return DiscountEventV3.fromSuiParsedData(content); },
160
+ fromSuiObjectData: function (content) { return DiscountEventV3.fromSuiObjectData(content); },
161
+ fetch: function (client, id) { return __awaiter(_this, void 0, void 0, function () { return __generator(this, function (_a) {
162
+ return [2 /*return*/, DiscountEventV3.fetch(client, id)];
163
+ }); }); },
164
+ new: function (fields) {
165
+ return new DiscountEventV3([], fields);
166
+ },
167
+ kind: "StructClassReified",
168
+ };
169
+ };
170
+ Object.defineProperty(DiscountEventV3, "r", {
171
+ get: function () {
172
+ return DiscountEventV3.reified();
173
+ },
174
+ enumerable: false,
175
+ configurable: true
176
+ });
177
+ DiscountEventV3.phantom = function () {
178
+ return (0, reified_1.phantom)(DiscountEventV3.reified());
179
+ };
180
+ Object.defineProperty(DiscountEventV3, "p", {
181
+ get: function () {
182
+ return DiscountEventV3.phantom();
183
+ },
184
+ enumerable: false,
185
+ configurable: true
186
+ });
187
+ Object.defineProperty(DiscountEventV3, "bcs", {
188
+ get: function () {
189
+ return bcs_1.bcs.struct("DiscountEventV3", {
190
+ pool: structs_3.ID.bcs,
191
+ price: bcs_1.bcs.u64(),
192
+ discount_pct: bcs_1.bcs.u64(),
193
+ discount_price: bcs_1.bcs.u64(),
194
+ 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); } }),
195
+ vrf_input: bcs_1.bcs.vector(bcs_1.bcs.u8()),
196
+ level: bcs_1.bcs.u64(),
197
+ });
198
+ },
199
+ enumerable: false,
200
+ configurable: true
201
+ });
202
+ DiscountEventV3.fromFields = function (fields) {
203
+ return DiscountEventV3.reified().new({
204
+ pool: (0, reified_1.decodeFromFields)(structs_3.ID.reified(), fields.pool),
205
+ price: (0, reified_1.decodeFromFields)("u64", fields.price),
206
+ discountPct: (0, reified_1.decodeFromFields)("u64", fields.discount_pct),
207
+ discountPrice: (0, reified_1.decodeFromFields)("u64", fields.discount_price),
208
+ user: (0, reified_1.decodeFromFields)("address", fields.user),
209
+ vrfInput: (0, reified_1.decodeFromFields)(reified.vector("u8"), fields.vrf_input),
210
+ level: (0, reified_1.decodeFromFields)("u64", fields.level),
211
+ });
212
+ };
213
+ DiscountEventV3.fromFieldsWithTypes = function (item) {
214
+ if (!isDiscountEventV3(item.type)) {
215
+ throw new Error("not a DiscountEventV3 type");
216
+ }
217
+ return DiscountEventV3.reified().new({
218
+ pool: (0, reified_1.decodeFromFieldsWithTypes)(structs_3.ID.reified(), item.fields.pool),
219
+ price: (0, reified_1.decodeFromFieldsWithTypes)("u64", item.fields.price),
220
+ discountPct: (0, reified_1.decodeFromFieldsWithTypes)("u64", item.fields.discount_pct),
221
+ discountPrice: (0, reified_1.decodeFromFieldsWithTypes)("u64", item.fields.discount_price),
222
+ user: (0, reified_1.decodeFromFieldsWithTypes)("address", item.fields.user),
223
+ vrfInput: (0, reified_1.decodeFromFieldsWithTypes)(reified.vector("u8"), item.fields.vrf_input),
224
+ level: (0, reified_1.decodeFromFieldsWithTypes)("u64", item.fields.level),
225
+ });
226
+ };
227
+ DiscountEventV3.fromBcs = function (data) {
228
+ return DiscountEventV3.fromFields(DiscountEventV3.bcs.parse(data));
229
+ };
230
+ DiscountEventV3.prototype.toJSONField = function () {
231
+ return {
232
+ pool: this.pool,
233
+ price: this.price.toString(),
234
+ discountPct: this.discountPct.toString(),
235
+ discountPrice: this.discountPrice.toString(),
236
+ user: this.user,
237
+ vrfInput: (0, reified_1.fieldToJSON)("vector<u8>", this.vrfInput),
238
+ level: this.level.toString(),
239
+ };
240
+ };
241
+ DiscountEventV3.prototype.toJSON = function () {
242
+ return __assign({ $typeName: this.$typeName, $typeArgs: this.$typeArgs }, this.toJSONField());
243
+ };
244
+ DiscountEventV3.fromJSONField = function (field) {
245
+ return DiscountEventV3.reified().new({
246
+ pool: (0, reified_1.decodeFromJSONField)(structs_3.ID.reified(), field.pool),
247
+ price: (0, reified_1.decodeFromJSONField)("u64", field.price),
248
+ discountPct: (0, reified_1.decodeFromJSONField)("u64", field.discountPct),
249
+ discountPrice: (0, reified_1.decodeFromJSONField)("u64", field.discountPrice),
250
+ user: (0, reified_1.decodeFromJSONField)("address", field.user),
251
+ vrfInput: (0, reified_1.decodeFromJSONField)(reified.vector("u8"), field.vrfInput),
252
+ level: (0, reified_1.decodeFromJSONField)("u64", field.level),
253
+ });
254
+ };
255
+ DiscountEventV3.fromJSON = function (json) {
256
+ if (json.$typeName !== DiscountEventV3.$typeName) {
257
+ throw new Error("not a WithTwoGenerics json object");
258
+ }
259
+ return DiscountEventV3.fromJSONField(json);
260
+ };
261
+ DiscountEventV3.fromSuiParsedData = function (content) {
262
+ if (content.dataType !== "moveObject") {
263
+ throw new Error("not an object");
264
+ }
265
+ if (!isDiscountEventV3(content.type)) {
266
+ throw new Error("object at ".concat(content.fields.id, " is not a DiscountEventV3 object"));
267
+ }
268
+ return DiscountEventV3.fromFieldsWithTypes(content);
269
+ };
270
+ DiscountEventV3.fromSuiObjectData = function (data) {
271
+ if (data.bcs) {
272
+ if (data.bcs.dataType !== "moveObject" || !isDiscountEventV3(data.bcs.type)) {
273
+ throw new Error("object at is not a DiscountEventV3 object");
274
+ }
275
+ return DiscountEventV3.fromBcs((0, utils_1.fromB64)(data.bcs.bcsBytes));
276
+ }
277
+ if (data.content) {
278
+ return DiscountEventV3.fromSuiParsedData(data.content);
279
+ }
280
+ throw new Error("Both `bcs` and `content` fields are missing from the data. Include `showBcs` or `showContent` in the request.");
281
+ };
282
+ DiscountEventV3.fetch = function (client, id) {
283
+ return __awaiter(this, void 0, void 0, function () {
284
+ var res;
285
+ var _a, _b;
286
+ return __generator(this, function (_c) {
287
+ switch (_c.label) {
288
+ case 0: return [4 /*yield*/, client.getObject({ id: id, options: { showBcs: true } })];
289
+ case 1:
290
+ res = _c.sent();
291
+ if (res.error) {
292
+ throw new Error("error fetching DiscountEventV3 object at id ".concat(id, ": ").concat(res.error.code));
293
+ }
294
+ if (((_b = (_a = res.data) === null || _a === void 0 ? void 0 : _a.bcs) === null || _b === void 0 ? void 0 : _b.dataType) !== "moveObject" || !isDiscountEventV3(res.data.bcs.type)) {
295
+ throw new Error("object at id ".concat(id, " is not a DiscountEventV3 object"));
296
+ }
297
+ return [2 /*return*/, DiscountEventV3.fromSuiObjectData(res.data)];
298
+ }
299
+ });
300
+ });
301
+ };
302
+ DiscountEventV3.$typeName = "".concat(index_1.PKG_V8, "::discount_mint::DiscountEventV3");
303
+ DiscountEventV3.$numTypeParams = 0;
304
+ DiscountEventV3.$isPhantom = [];
305
+ return DiscountEventV3;
306
+ }());
307
+ exports.DiscountEventV3 = DiscountEventV3;
308
+ /* ============================== MintRequest =============================== */
309
+ function isMintRequest(type) {
310
+ type = (0, util_1.compressSuiType)(type);
311
+ return type === "".concat(index_1.PKG_V8, "::discount_mint::MintRequest");
312
+ }
313
+ var MintRequest = /** @class */ (function () {
314
+ function MintRequest(typeArgs, fields) {
315
+ this.__StructClass = true;
316
+ this.$typeName = MintRequest.$typeName;
317
+ this.$isPhantom = MintRequest.$isPhantom;
318
+ this.$fullTypeName = util_1.composeSuiType.apply(void 0, __spreadArray([MintRequest.$typeName], __read(typeArgs), false));
319
+ this.$typeArgs = typeArgs;
320
+ this.user = fields.user;
321
+ this.coin = fields.coin;
322
+ this.vrfInput = fields.vrfInput;
323
+ }
324
+ MintRequest.reified = function () {
325
+ var _this = this;
326
+ return {
327
+ typeName: MintRequest.$typeName,
328
+ fullTypeName: util_1.composeSuiType.apply(void 0, __spreadArray([MintRequest.$typeName], [], false)),
329
+ typeArgs: [],
330
+ isPhantom: MintRequest.$isPhantom,
331
+ reifiedTypeArgs: [],
332
+ fromFields: function (fields) { return MintRequest.fromFields(fields); },
333
+ fromFieldsWithTypes: function (item) { return MintRequest.fromFieldsWithTypes(item); },
334
+ fromBcs: function (data) { return MintRequest.fromBcs(data); },
335
+ bcs: MintRequest.bcs,
336
+ fromJSONField: function (field) { return MintRequest.fromJSONField(field); },
337
+ fromJSON: function (json) { return MintRequest.fromJSON(json); },
338
+ fromSuiParsedData: function (content) { return MintRequest.fromSuiParsedData(content); },
339
+ fromSuiObjectData: function (content) { return MintRequest.fromSuiObjectData(content); },
340
+ fetch: function (client, id) { return __awaiter(_this, void 0, void 0, function () { return __generator(this, function (_a) {
341
+ return [2 /*return*/, MintRequest.fetch(client, id)];
342
+ }); }); },
343
+ new: function (fields) {
344
+ return new MintRequest([], fields);
345
+ },
346
+ kind: "StructClassReified",
347
+ };
348
+ };
349
+ Object.defineProperty(MintRequest, "r", {
350
+ get: function () {
351
+ return MintRequest.reified();
352
+ },
353
+ enumerable: false,
354
+ configurable: true
355
+ });
356
+ MintRequest.phantom = function () {
357
+ return (0, reified_1.phantom)(MintRequest.reified());
358
+ };
359
+ Object.defineProperty(MintRequest, "p", {
360
+ get: function () {
361
+ return MintRequest.phantom();
362
+ },
363
+ enumerable: false,
364
+ configurable: true
365
+ });
366
+ Object.defineProperty(MintRequest, "bcs", {
367
+ get: function () {
368
+ return bcs_1.bcs.struct("MintRequest", {
369
+ 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); } }),
370
+ coin: structs_2.Coin.bcs,
371
+ vrf_input: bcs_1.bcs.vector(bcs_1.bcs.u8()),
372
+ });
373
+ },
374
+ enumerable: false,
375
+ configurable: true
376
+ });
377
+ MintRequest.fromFields = function (fields) {
378
+ return MintRequest.reified().new({
379
+ user: (0, reified_1.decodeFromFields)("address", fields.user),
380
+ coin: (0, reified_1.decodeFromFields)(structs_2.Coin.reified(reified.phantom(structs_4.SUI.reified())), fields.coin),
381
+ vrfInput: (0, reified_1.decodeFromFields)(reified.vector("u8"), fields.vrf_input),
382
+ });
383
+ };
384
+ MintRequest.fromFieldsWithTypes = function (item) {
385
+ if (!isMintRequest(item.type)) {
386
+ throw new Error("not a MintRequest type");
387
+ }
388
+ return MintRequest.reified().new({
389
+ user: (0, reified_1.decodeFromFieldsWithTypes)("address", item.fields.user),
390
+ coin: (0, reified_1.decodeFromFieldsWithTypes)(structs_2.Coin.reified(reified.phantom(structs_4.SUI.reified())), item.fields.coin),
391
+ vrfInput: (0, reified_1.decodeFromFieldsWithTypes)(reified.vector("u8"), item.fields.vrf_input),
392
+ });
393
+ };
394
+ MintRequest.fromBcs = function (data) {
395
+ return MintRequest.fromFields(MintRequest.bcs.parse(data));
396
+ };
397
+ MintRequest.prototype.toJSONField = function () {
398
+ return {
399
+ user: this.user,
400
+ coin: this.coin.toJSONField(),
401
+ vrfInput: (0, reified_1.fieldToJSON)("vector<u8>", this.vrfInput),
402
+ };
403
+ };
404
+ MintRequest.prototype.toJSON = function () {
405
+ return __assign({ $typeName: this.$typeName, $typeArgs: this.$typeArgs }, this.toJSONField());
406
+ };
407
+ MintRequest.fromJSONField = function (field) {
408
+ return MintRequest.reified().new({
409
+ user: (0, reified_1.decodeFromJSONField)("address", field.user),
410
+ coin: (0, reified_1.decodeFromJSONField)(structs_2.Coin.reified(reified.phantom(structs_4.SUI.reified())), field.coin),
411
+ vrfInput: (0, reified_1.decodeFromJSONField)(reified.vector("u8"), field.vrfInput),
412
+ });
413
+ };
414
+ MintRequest.fromJSON = function (json) {
415
+ if (json.$typeName !== MintRequest.$typeName) {
416
+ throw new Error("not a WithTwoGenerics json object");
417
+ }
418
+ return MintRequest.fromJSONField(json);
419
+ };
420
+ MintRequest.fromSuiParsedData = function (content) {
421
+ if (content.dataType !== "moveObject") {
422
+ throw new Error("not an object");
423
+ }
424
+ if (!isMintRequest(content.type)) {
425
+ throw new Error("object at ".concat(content.fields.id, " is not a MintRequest object"));
426
+ }
427
+ return MintRequest.fromFieldsWithTypes(content);
428
+ };
429
+ MintRequest.fromSuiObjectData = function (data) {
430
+ if (data.bcs) {
431
+ if (data.bcs.dataType !== "moveObject" || !isMintRequest(data.bcs.type)) {
432
+ throw new Error("object at is not a MintRequest object");
433
+ }
434
+ return MintRequest.fromBcs((0, utils_1.fromB64)(data.bcs.bcsBytes));
435
+ }
436
+ if (data.content) {
437
+ return MintRequest.fromSuiParsedData(data.content);
438
+ }
439
+ throw new Error("Both `bcs` and `content` fields are missing from the data. Include `showBcs` or `showContent` in the request.");
440
+ };
441
+ MintRequest.fetch = function (client, id) {
442
+ return __awaiter(this, void 0, void 0, function () {
443
+ var res;
444
+ var _a, _b;
445
+ return __generator(this, function (_c) {
446
+ switch (_c.label) {
447
+ case 0: return [4 /*yield*/, client.getObject({ id: id, options: { showBcs: true } })];
448
+ case 1:
449
+ res = _c.sent();
450
+ if (res.error) {
451
+ throw new Error("error fetching MintRequest object at id ".concat(id, ": ").concat(res.error.code));
452
+ }
453
+ if (((_b = (_a = res.data) === null || _a === void 0 ? void 0 : _a.bcs) === null || _b === void 0 ? void 0 : _b.dataType) !== "moveObject" || !isMintRequest(res.data.bcs.type)) {
454
+ throw new Error("object at id ".concat(id, " is not a MintRequest object"));
455
+ }
456
+ return [2 /*return*/, MintRequest.fromSuiObjectData(res.data)];
457
+ }
458
+ });
459
+ });
460
+ };
461
+ MintRequest.$typeName = "".concat(index_1.PKG_V8, "::discount_mint::MintRequest");
462
+ MintRequest.$numTypeParams = 0;
463
+ MintRequest.$isPhantom = [];
464
+ return MintRequest;
465
+ }());
466
+ exports.MintRequest = MintRequest;
467
+ /* ============================== MintRequestEvent =============================== */
468
+ function isMintRequestEvent(type) {
469
+ type = (0, util_1.compressSuiType)(type);
470
+ return type === "".concat(index_1.PKG_V8, "::discount_mint::MintRequestEvent");
471
+ }
472
+ var MintRequestEvent = /** @class */ (function () {
473
+ function MintRequestEvent(typeArgs, fields) {
474
+ this.__StructClass = true;
475
+ this.$typeName = MintRequestEvent.$typeName;
476
+ this.$isPhantom = MintRequestEvent.$isPhantom;
477
+ this.$fullTypeName = util_1.composeSuiType.apply(void 0, __spreadArray([MintRequestEvent.$typeName], __read(typeArgs), false));
478
+ this.$typeArgs = typeArgs;
479
+ this.user = fields.user;
480
+ this.vrfInput = fields.vrfInput;
481
+ this.remaining = fields.remaining;
482
+ this.seed = fields.seed;
483
+ }
484
+ MintRequestEvent.reified = function () {
485
+ var _this = this;
486
+ return {
487
+ typeName: MintRequestEvent.$typeName,
488
+ fullTypeName: util_1.composeSuiType.apply(void 0, __spreadArray([MintRequestEvent.$typeName], [], false)),
489
+ typeArgs: [],
490
+ isPhantom: MintRequestEvent.$isPhantom,
491
+ reifiedTypeArgs: [],
492
+ fromFields: function (fields) { return MintRequestEvent.fromFields(fields); },
493
+ fromFieldsWithTypes: function (item) { return MintRequestEvent.fromFieldsWithTypes(item); },
494
+ fromBcs: function (data) { return MintRequestEvent.fromBcs(data); },
495
+ bcs: MintRequestEvent.bcs,
496
+ fromJSONField: function (field) { return MintRequestEvent.fromJSONField(field); },
497
+ fromJSON: function (json) { return MintRequestEvent.fromJSON(json); },
498
+ fromSuiParsedData: function (content) { return MintRequestEvent.fromSuiParsedData(content); },
499
+ fromSuiObjectData: function (content) { return MintRequestEvent.fromSuiObjectData(content); },
500
+ fetch: function (client, id) { return __awaiter(_this, void 0, void 0, function () { return __generator(this, function (_a) {
501
+ return [2 /*return*/, MintRequestEvent.fetch(client, id)];
502
+ }); }); },
503
+ new: function (fields) {
504
+ return new MintRequestEvent([], fields);
505
+ },
506
+ kind: "StructClassReified",
507
+ };
508
+ };
509
+ Object.defineProperty(MintRequestEvent, "r", {
510
+ get: function () {
511
+ return MintRequestEvent.reified();
512
+ },
513
+ enumerable: false,
514
+ configurable: true
515
+ });
516
+ MintRequestEvent.phantom = function () {
517
+ return (0, reified_1.phantom)(MintRequestEvent.reified());
518
+ };
519
+ Object.defineProperty(MintRequestEvent, "p", {
520
+ get: function () {
521
+ return MintRequestEvent.phantom();
522
+ },
523
+ enumerable: false,
524
+ configurable: true
525
+ });
526
+ Object.defineProperty(MintRequestEvent, "bcs", {
527
+ get: function () {
528
+ return bcs_1.bcs.struct("MintRequestEvent", {
529
+ 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); } }),
530
+ vrf_input: bcs_1.bcs.vector(bcs_1.bcs.u8()),
531
+ remaining: bcs_1.bcs.u64(),
532
+ seed: bcs_1.bcs.u64(),
533
+ });
534
+ },
535
+ enumerable: false,
536
+ configurable: true
537
+ });
538
+ MintRequestEvent.fromFields = function (fields) {
539
+ return MintRequestEvent.reified().new({
540
+ user: (0, reified_1.decodeFromFields)("address", fields.user),
541
+ vrfInput: (0, reified_1.decodeFromFields)(reified.vector("u8"), fields.vrf_input),
542
+ remaining: (0, reified_1.decodeFromFields)("u64", fields.remaining),
543
+ seed: (0, reified_1.decodeFromFields)("u64", fields.seed),
544
+ });
545
+ };
546
+ MintRequestEvent.fromFieldsWithTypes = function (item) {
547
+ if (!isMintRequestEvent(item.type)) {
548
+ throw new Error("not a MintRequestEvent type");
549
+ }
550
+ return MintRequestEvent.reified().new({
551
+ user: (0, reified_1.decodeFromFieldsWithTypes)("address", item.fields.user),
552
+ vrfInput: (0, reified_1.decodeFromFieldsWithTypes)(reified.vector("u8"), item.fields.vrf_input),
553
+ remaining: (0, reified_1.decodeFromFieldsWithTypes)("u64", item.fields.remaining),
554
+ seed: (0, reified_1.decodeFromFieldsWithTypes)("u64", item.fields.seed),
555
+ });
556
+ };
557
+ MintRequestEvent.fromBcs = function (data) {
558
+ return MintRequestEvent.fromFields(MintRequestEvent.bcs.parse(data));
559
+ };
560
+ MintRequestEvent.prototype.toJSONField = function () {
561
+ return {
562
+ user: this.user,
563
+ vrfInput: (0, reified_1.fieldToJSON)("vector<u8>", this.vrfInput),
564
+ remaining: this.remaining.toString(),
565
+ seed: this.seed.toString(),
566
+ };
567
+ };
568
+ MintRequestEvent.prototype.toJSON = function () {
569
+ return __assign({ $typeName: this.$typeName, $typeArgs: this.$typeArgs }, this.toJSONField());
570
+ };
571
+ MintRequestEvent.fromJSONField = function (field) {
572
+ return MintRequestEvent.reified().new({
573
+ user: (0, reified_1.decodeFromJSONField)("address", field.user),
574
+ vrfInput: (0, reified_1.decodeFromJSONField)(reified.vector("u8"), field.vrfInput),
575
+ remaining: (0, reified_1.decodeFromJSONField)("u64", field.remaining),
576
+ seed: (0, reified_1.decodeFromJSONField)("u64", field.seed),
577
+ });
578
+ };
579
+ MintRequestEvent.fromJSON = function (json) {
580
+ if (json.$typeName !== MintRequestEvent.$typeName) {
581
+ throw new Error("not a WithTwoGenerics json object");
582
+ }
583
+ return MintRequestEvent.fromJSONField(json);
584
+ };
585
+ MintRequestEvent.fromSuiParsedData = function (content) {
586
+ if (content.dataType !== "moveObject") {
587
+ throw new Error("not an object");
588
+ }
589
+ if (!isMintRequestEvent(content.type)) {
590
+ throw new Error("object at ".concat(content.fields.id, " is not a MintRequestEvent object"));
591
+ }
592
+ return MintRequestEvent.fromFieldsWithTypes(content);
593
+ };
594
+ MintRequestEvent.fromSuiObjectData = function (data) {
595
+ if (data.bcs) {
596
+ if (data.bcs.dataType !== "moveObject" || !isMintRequestEvent(data.bcs.type)) {
597
+ throw new Error("object at is not a MintRequestEvent object");
598
+ }
599
+ return MintRequestEvent.fromBcs((0, utils_1.fromB64)(data.bcs.bcsBytes));
600
+ }
601
+ if (data.content) {
602
+ return MintRequestEvent.fromSuiParsedData(data.content);
603
+ }
604
+ throw new Error("Both `bcs` and `content` fields are missing from the data. Include `showBcs` or `showContent` in the request.");
605
+ };
606
+ MintRequestEvent.fetch = function (client, id) {
607
+ return __awaiter(this, void 0, void 0, function () {
608
+ var res;
609
+ var _a, _b;
610
+ return __generator(this, function (_c) {
611
+ switch (_c.label) {
612
+ case 0: return [4 /*yield*/, client.getObject({ id: id, options: { showBcs: true } })];
613
+ case 1:
614
+ res = _c.sent();
615
+ if (res.error) {
616
+ throw new Error("error fetching MintRequestEvent object at id ".concat(id, ": ").concat(res.error.code));
617
+ }
618
+ if (((_b = (_a = res.data) === null || _a === void 0 ? void 0 : _a.bcs) === null || _b === void 0 ? void 0 : _b.dataType) !== "moveObject" || !isMintRequestEvent(res.data.bcs.type)) {
619
+ throw new Error("object at id ".concat(id, " is not a MintRequestEvent object"));
620
+ }
621
+ return [2 /*return*/, MintRequestEvent.fromSuiObjectData(res.data)];
622
+ }
623
+ });
624
+ });
625
+ };
626
+ MintRequestEvent.$typeName = "".concat(index_1.PKG_V8, "::discount_mint::MintRequestEvent");
627
+ MintRequestEvent.$numTypeParams = 0;
628
+ MintRequestEvent.$isPhantom = [];
629
+ return MintRequestEvent;
630
+ }());
631
+ exports.MintRequestEvent = MintRequestEvent;
632
+ /* ============================== Pool =============================== */
633
+ function isPool(type) {
634
+ type = (0, util_1.compressSuiType)(type);
635
+ return type === "".concat(index_1.PKG_V8, "::discount_mint::Pool");
636
+ }
637
+ var Pool = /** @class */ (function () {
638
+ function Pool(typeArgs, fields) {
639
+ this.__StructClass = true;
640
+ this.$typeName = Pool.$typeName;
641
+ this.$isPhantom = Pool.$isPhantom;
642
+ this.$fullTypeName = util_1.composeSuiType.apply(void 0, __spreadArray([Pool.$typeName], __read(typeArgs), false));
643
+ this.$typeArgs = typeArgs;
644
+ this.id = fields.id;
645
+ this.num = fields.num;
646
+ this.price = fields.price;
647
+ this.startMs = fields.startMs;
648
+ this.endMs = fields.endMs;
649
+ this.authority = fields.authority;
650
+ this.publicKey = fields.publicKey;
651
+ this.discountPcts = fields.discountPcts;
652
+ this.isLive = fields.isLive;
653
+ this.balance = fields.balance;
654
+ this.tails = fields.tails;
655
+ this.requests = fields.requests;
656
+ }
657
+ Pool.reified = function () {
658
+ var _this = this;
659
+ return {
660
+ typeName: Pool.$typeName,
661
+ fullTypeName: util_1.composeSuiType.apply(void 0, __spreadArray([Pool.$typeName], [], false)),
662
+ typeArgs: [],
663
+ isPhantom: Pool.$isPhantom,
664
+ reifiedTypeArgs: [],
665
+ fromFields: function (fields) { return Pool.fromFields(fields); },
666
+ fromFieldsWithTypes: function (item) { return Pool.fromFieldsWithTypes(item); },
667
+ fromBcs: function (data) { return Pool.fromBcs(data); },
668
+ bcs: Pool.bcs,
669
+ fromJSONField: function (field) { return Pool.fromJSONField(field); },
670
+ fromJSON: function (json) { return Pool.fromJSON(json); },
671
+ fromSuiParsedData: function (content) { return Pool.fromSuiParsedData(content); },
672
+ fromSuiObjectData: function (content) { return Pool.fromSuiObjectData(content); },
673
+ fetch: function (client, id) { return __awaiter(_this, void 0, void 0, function () { return __generator(this, function (_a) {
674
+ return [2 /*return*/, Pool.fetch(client, id)];
675
+ }); }); },
676
+ new: function (fields) {
677
+ return new Pool([], fields);
678
+ },
679
+ kind: "StructClassReified",
680
+ };
681
+ };
682
+ Object.defineProperty(Pool, "r", {
683
+ get: function () {
684
+ return Pool.reified();
685
+ },
686
+ enumerable: false,
687
+ configurable: true
688
+ });
689
+ Pool.phantom = function () {
690
+ return (0, reified_1.phantom)(Pool.reified());
691
+ };
692
+ Object.defineProperty(Pool, "p", {
693
+ get: function () {
694
+ return Pool.phantom();
695
+ },
696
+ enumerable: false,
697
+ configurable: true
698
+ });
699
+ Object.defineProperty(Pool, "bcs", {
700
+ get: function () {
701
+ return bcs_1.bcs.struct("Pool", {
702
+ id: structs_3.UID.bcs,
703
+ num: bcs_1.bcs.u64(),
704
+ price: bcs_1.bcs.u64(),
705
+ start_ms: bcs_1.bcs.u64(),
706
+ end_ms: bcs_1.bcs.u64(),
707
+ authority: bcs_1.bcs.bytes(32).transform({ input: function (val) { return (0, utils_1.fromHEX)(val); }, output: function (val) { return (0, utils_1.toHEX)(val); } }),
708
+ public_key: bcs_1.bcs.vector(bcs_1.bcs.u8()),
709
+ discount_pcts: bcs_1.bcs.vector(bcs_1.bcs.u64()),
710
+ is_live: bcs_1.bcs.bool(),
711
+ balance: structs_1.Balance.bcs,
712
+ tails: structs_5.TableVec.bcs,
713
+ requests: bcs_1.bcs.vector(MintRequest.bcs),
714
+ });
715
+ },
716
+ enumerable: false,
717
+ configurable: true
718
+ });
719
+ Pool.fromFields = function (fields) {
720
+ return Pool.reified().new({
721
+ id: (0, reified_1.decodeFromFields)(structs_3.UID.reified(), fields.id),
722
+ num: (0, reified_1.decodeFromFields)("u64", fields.num),
723
+ price: (0, reified_1.decodeFromFields)("u64", fields.price),
724
+ startMs: (0, reified_1.decodeFromFields)("u64", fields.start_ms),
725
+ endMs: (0, reified_1.decodeFromFields)("u64", fields.end_ms),
726
+ authority: (0, reified_1.decodeFromFields)("address", fields.authority),
727
+ publicKey: (0, reified_1.decodeFromFields)(reified.vector("u8"), fields.public_key),
728
+ discountPcts: (0, reified_1.decodeFromFields)(reified.vector("u64"), fields.discount_pcts),
729
+ isLive: (0, reified_1.decodeFromFields)("bool", fields.is_live),
730
+ balance: (0, reified_1.decodeFromFields)(structs_1.Balance.reified(reified.phantom(structs_4.SUI.reified())), fields.balance),
731
+ tails: (0, reified_1.decodeFromFields)(structs_5.TableVec.reified(reified.phantom(structs_6.Tails.reified())), fields.tails),
732
+ requests: (0, reified_1.decodeFromFields)(reified.vector(MintRequest.reified()), fields.requests),
733
+ });
734
+ };
735
+ Pool.fromFieldsWithTypes = function (item) {
736
+ if (!isPool(item.type)) {
737
+ throw new Error("not a Pool type");
738
+ }
739
+ return Pool.reified().new({
740
+ id: (0, reified_1.decodeFromFieldsWithTypes)(structs_3.UID.reified(), item.fields.id),
741
+ num: (0, reified_1.decodeFromFieldsWithTypes)("u64", item.fields.num),
742
+ price: (0, reified_1.decodeFromFieldsWithTypes)("u64", item.fields.price),
743
+ startMs: (0, reified_1.decodeFromFieldsWithTypes)("u64", item.fields.start_ms),
744
+ endMs: (0, reified_1.decodeFromFieldsWithTypes)("u64", item.fields.end_ms),
745
+ authority: (0, reified_1.decodeFromFieldsWithTypes)("address", item.fields.authority),
746
+ publicKey: (0, reified_1.decodeFromFieldsWithTypes)(reified.vector("u8"), item.fields.public_key),
747
+ discountPcts: (0, reified_1.decodeFromFieldsWithTypes)(reified.vector("u64"), item.fields.discount_pcts),
748
+ isLive: (0, reified_1.decodeFromFieldsWithTypes)("bool", item.fields.is_live),
749
+ balance: (0, reified_1.decodeFromFieldsWithTypes)(structs_1.Balance.reified(reified.phantom(structs_4.SUI.reified())), item.fields.balance),
750
+ tails: (0, reified_1.decodeFromFieldsWithTypes)(structs_5.TableVec.reified(reified.phantom(structs_6.Tails.reified())), item.fields.tails),
751
+ requests: (0, reified_1.decodeFromFieldsWithTypes)(reified.vector(MintRequest.reified()), item.fields.requests),
752
+ });
753
+ };
754
+ Pool.fromBcs = function (data) {
755
+ return Pool.fromFields(Pool.bcs.parse(data));
756
+ };
757
+ Pool.prototype.toJSONField = function () {
758
+ return {
759
+ id: this.id,
760
+ num: this.num.toString(),
761
+ price: this.price.toString(),
762
+ startMs: this.startMs.toString(),
763
+ endMs: this.endMs.toString(),
764
+ authority: this.authority,
765
+ publicKey: (0, reified_1.fieldToJSON)("vector<u8>", this.publicKey),
766
+ discountPcts: (0, reified_1.fieldToJSON)("vector<u64>", this.discountPcts),
767
+ isLive: this.isLive,
768
+ balance: this.balance.toJSONField(),
769
+ tails: this.tails.toJSONField(),
770
+ requests: (0, reified_1.fieldToJSON)("vector<".concat(MintRequest.$typeName, ">"), this.requests),
771
+ };
772
+ };
773
+ Pool.prototype.toJSON = function () {
774
+ return __assign({ $typeName: this.$typeName, $typeArgs: this.$typeArgs }, this.toJSONField());
775
+ };
776
+ Pool.fromJSONField = function (field) {
777
+ return Pool.reified().new({
778
+ id: (0, reified_1.decodeFromJSONField)(structs_3.UID.reified(), field.id),
779
+ num: (0, reified_1.decodeFromJSONField)("u64", field.num),
780
+ price: (0, reified_1.decodeFromJSONField)("u64", field.price),
781
+ startMs: (0, reified_1.decodeFromJSONField)("u64", field.startMs),
782
+ endMs: (0, reified_1.decodeFromJSONField)("u64", field.endMs),
783
+ authority: (0, reified_1.decodeFromJSONField)("address", field.authority),
784
+ publicKey: (0, reified_1.decodeFromJSONField)(reified.vector("u8"), field.publicKey),
785
+ discountPcts: (0, reified_1.decodeFromJSONField)(reified.vector("u64"), field.discountPcts),
786
+ isLive: (0, reified_1.decodeFromJSONField)("bool", field.isLive),
787
+ balance: (0, reified_1.decodeFromJSONField)(structs_1.Balance.reified(reified.phantom(structs_4.SUI.reified())), field.balance),
788
+ tails: (0, reified_1.decodeFromJSONField)(structs_5.TableVec.reified(reified.phantom(structs_6.Tails.reified())), field.tails),
789
+ requests: (0, reified_1.decodeFromJSONField)(reified.vector(MintRequest.reified()), field.requests),
790
+ });
791
+ };
792
+ Pool.fromJSON = function (json) {
793
+ if (json.$typeName !== Pool.$typeName) {
794
+ throw new Error("not a WithTwoGenerics json object");
795
+ }
796
+ return Pool.fromJSONField(json);
797
+ };
798
+ Pool.fromSuiParsedData = function (content) {
799
+ if (content.dataType !== "moveObject") {
800
+ throw new Error("not an object");
801
+ }
802
+ if (!isPool(content.type)) {
803
+ throw new Error("object at ".concat(content.fields.id, " is not a Pool object"));
804
+ }
805
+ return Pool.fromFieldsWithTypes(content);
806
+ };
807
+ Pool.fromSuiObjectData = function (data) {
808
+ if (data.bcs) {
809
+ if (data.bcs.dataType !== "moveObject" || !isPool(data.bcs.type)) {
810
+ throw new Error("object at is not a Pool object");
811
+ }
812
+ return Pool.fromBcs((0, utils_1.fromB64)(data.bcs.bcsBytes));
813
+ }
814
+ if (data.content) {
815
+ return Pool.fromSuiParsedData(data.content);
816
+ }
817
+ throw new Error("Both `bcs` and `content` fields are missing from the data. Include `showBcs` or `showContent` in the request.");
818
+ };
819
+ Pool.fetch = function (client, id) {
820
+ return __awaiter(this, void 0, void 0, function () {
821
+ var res;
822
+ var _a, _b;
823
+ return __generator(this, function (_c) {
824
+ switch (_c.label) {
825
+ case 0: return [4 /*yield*/, client.getObject({ id: id, options: { showBcs: true } })];
826
+ case 1:
827
+ res = _c.sent();
828
+ if (res.error) {
829
+ throw new Error("error fetching Pool object at id ".concat(id, ": ").concat(res.error.code));
830
+ }
831
+ if (((_b = (_a = res.data) === null || _a === void 0 ? void 0 : _a.bcs) === null || _b === void 0 ? void 0 : _b.dataType) !== "moveObject" || !isPool(res.data.bcs.type)) {
832
+ throw new Error("object at id ".concat(id, " is not a Pool object"));
833
+ }
834
+ return [2 /*return*/, Pool.fromSuiObjectData(res.data)];
835
+ }
836
+ });
837
+ });
838
+ };
839
+ Pool.$typeName = "".concat(index_1.PKG_V8, "::discount_mint::Pool");
840
+ Pool.$numTypeParams = 0;
841
+ Pool.$isPhantom = [];
842
+ return Pool;
843
+ }());
844
+ exports.Pool = Pool;