@typus/typus-perp-sdk 1.1.29 → 1.1.30-codegen

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