@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,1247 +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 __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
14
- function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
15
- return new (P || (P = Promise))(function (resolve, reject) {
16
- function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
17
- function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
18
- function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
19
- step((generator = generator.apply(thisArg, _arguments || [])).next());
20
- });
21
- };
22
- var __generator = (this && this.__generator) || function (thisArg, body) {
23
- 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);
24
- return g.next = verb(0), g["throw"] = verb(1), g["return"] = verb(2), typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g;
25
- function verb(n) { return function (v) { return step([n, v]); }; }
26
- function step(op) {
27
- if (f) throw new TypeError("Generator is already executing.");
28
- while (g && (g = 0, op[0] && (_ = 0)), _) try {
29
- 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;
30
- if (y = 0, t) op = [op[0] & 2, t.value];
31
- switch (op[0]) {
32
- case 0: case 1: t = op; break;
33
- case 4: _.label++; return { value: op[1], done: false };
34
- case 5: _.label++; y = op[1]; op = [0]; continue;
35
- case 7: op = _.ops.pop(); _.trys.pop(); continue;
36
- default:
37
- if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }
38
- if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }
39
- if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }
40
- if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }
41
- if (t[2]) _.ops.pop();
42
- _.trys.pop(); continue;
43
- }
44
- op = body.call(thisArg, _);
45
- } catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }
46
- if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };
47
- }
48
- };
49
- var __read = (this && this.__read) || function (o, n) {
50
- var m = typeof Symbol === "function" && o[Symbol.iterator];
51
- if (!m) return o;
52
- var i = m.call(o), r, ar = [], e;
53
- try {
54
- while ((n === void 0 || n-- > 0) && !(r = i.next()).done) ar.push(r.value);
55
- }
56
- catch (error) { e = { error: error }; }
57
- finally {
58
- try {
59
- if (r && !r.done && (m = i["return"])) m.call(i);
60
- }
61
- finally { if (e) throw e.error; }
62
- }
63
- return ar;
64
- };
65
- var __spreadArray = (this && this.__spreadArray) || function (to, from, pack) {
66
- if (pack || arguments.length === 2) for (var i = 0, l = from.length, ar; i < l; i++) {
67
- if (ar || !(i in from)) {
68
- if (!ar) ar = Array.prototype.slice.call(from, 0, i);
69
- ar[i] = from[i];
70
- }
71
- }
72
- return to.concat(ar || Array.prototype.slice.call(from));
73
- };
74
- Object.defineProperty(exports, "__esModule", { value: true });
75
- exports.TreasuryCap = exports.RegulatedCoinMetadata = exports.DenyCapV2 = exports.DenyCap = exports.CurrencyCreated = exports.CoinMetadata = exports.Coin = void 0;
76
- exports.isCoin = isCoin;
77
- exports.isCoinMetadata = isCoinMetadata;
78
- exports.isCurrencyCreated = isCurrencyCreated;
79
- exports.isDenyCap = isDenyCap;
80
- exports.isDenyCapV2 = isDenyCapV2;
81
- exports.isRegulatedCoinMetadata = isRegulatedCoinMetadata;
82
- exports.isTreasuryCap = isTreasuryCap;
83
- var reified_1 = require("../../../../_framework/reified");
84
- var util_1 = require("../../../../_framework/util");
85
- var structs_1 = require("../../0x1/ascii/structs");
86
- var structs_2 = require("../../0x1/option/structs");
87
- var structs_3 = require("../../0x1/string/structs");
88
- var structs_4 = require("../balance/structs");
89
- var index_1 = require("../index");
90
- var structs_5 = require("../object/structs");
91
- var structs_6 = require("../url/structs");
92
- var bcs_1 = require("@mysten/sui/bcs");
93
- var utils_1 = require("@mysten/sui/utils");
94
- /* ============================== Coin =============================== */
95
- function isCoin(type) {
96
- type = (0, util_1.compressSuiType)(type);
97
- return type.startsWith("".concat(index_1.PKG_V26, "::coin::Coin") + "<");
98
- }
99
- var Coin = /** @class */ (function () {
100
- function Coin(typeArgs, fields) {
101
- this.__StructClass = true;
102
- this.$typeName = Coin.$typeName;
103
- this.$isPhantom = Coin.$isPhantom;
104
- this.$fullTypeName = util_1.composeSuiType.apply(void 0, __spreadArray([Coin.$typeName], __read(typeArgs), false));
105
- this.$typeArgs = typeArgs;
106
- this.id = fields.id;
107
- this.balance = fields.balance;
108
- }
109
- Coin.reified = function (T) {
110
- var _this = this;
111
- return {
112
- typeName: Coin.$typeName,
113
- fullTypeName: util_1.composeSuiType.apply(void 0, __spreadArray([Coin.$typeName], [(0, reified_1.extractType)(T)], false)),
114
- typeArgs: [(0, reified_1.extractType)(T)],
115
- isPhantom: Coin.$isPhantom,
116
- reifiedTypeArgs: [T],
117
- fromFields: function (fields) { return Coin.fromFields(T, fields); },
118
- fromFieldsWithTypes: function (item) { return Coin.fromFieldsWithTypes(T, item); },
119
- fromBcs: function (data) { return Coin.fromBcs(T, data); },
120
- bcs: Coin.bcs,
121
- fromJSONField: function (field) { return Coin.fromJSONField(T, field); },
122
- fromJSON: function (json) { return Coin.fromJSON(T, json); },
123
- fromSuiParsedData: function (content) { return Coin.fromSuiParsedData(T, content); },
124
- fromSuiObjectData: function (content) { return Coin.fromSuiObjectData(T, content); },
125
- fetch: function (client, id) { return __awaiter(_this, void 0, void 0, function () { return __generator(this, function (_a) {
126
- return [2 /*return*/, Coin.fetch(client, T, id)];
127
- }); }); },
128
- new: function (fields) {
129
- return new Coin([(0, reified_1.extractType)(T)], fields);
130
- },
131
- kind: "StructClassReified",
132
- };
133
- };
134
- Object.defineProperty(Coin, "r", {
135
- get: function () {
136
- return Coin.reified;
137
- },
138
- enumerable: false,
139
- configurable: true
140
- });
141
- Coin.phantom = function (T) {
142
- return (0, reified_1.phantom)(Coin.reified(T));
143
- };
144
- Object.defineProperty(Coin, "p", {
145
- get: function () {
146
- return Coin.phantom;
147
- },
148
- enumerable: false,
149
- configurable: true
150
- });
151
- Object.defineProperty(Coin, "bcs", {
152
- get: function () {
153
- return bcs_1.bcs.struct("Coin", {
154
- id: structs_5.UID.bcs,
155
- balance: structs_4.Balance.bcs,
156
- });
157
- },
158
- enumerable: false,
159
- configurable: true
160
- });
161
- Coin.fromFields = function (typeArg, fields) {
162
- return Coin.reified(typeArg).new({
163
- id: (0, reified_1.decodeFromFields)(structs_5.UID.reified(), fields.id),
164
- balance: (0, reified_1.decodeFromFields)(structs_4.Balance.reified(typeArg), fields.balance),
165
- });
166
- };
167
- Coin.fromFieldsWithTypes = function (typeArg, item) {
168
- if (!isCoin(item.type)) {
169
- throw new Error("not a Coin type");
170
- }
171
- (0, reified_1.assertFieldsWithTypesArgsMatch)(item, [typeArg]);
172
- return Coin.reified(typeArg).new({
173
- id: (0, reified_1.decodeFromFieldsWithTypes)(structs_5.UID.reified(), item.fields.id),
174
- balance: (0, reified_1.decodeFromFieldsWithTypes)(structs_4.Balance.reified(typeArg), item.fields.balance),
175
- });
176
- };
177
- Coin.fromBcs = function (typeArg, data) {
178
- return Coin.fromFields(typeArg, Coin.bcs.parse(data));
179
- };
180
- Coin.prototype.toJSONField = function () {
181
- return {
182
- id: this.id,
183
- balance: this.balance.toJSONField(),
184
- };
185
- };
186
- Coin.prototype.toJSON = function () {
187
- return __assign({ $typeName: this.$typeName, $typeArgs: this.$typeArgs }, this.toJSONField());
188
- };
189
- Coin.fromJSONField = function (typeArg, field) {
190
- return Coin.reified(typeArg).new({
191
- id: (0, reified_1.decodeFromJSONField)(structs_5.UID.reified(), field.id),
192
- balance: (0, reified_1.decodeFromJSONField)(structs_4.Balance.reified(typeArg), field.balance),
193
- });
194
- };
195
- Coin.fromJSON = function (typeArg, json) {
196
- if (json.$typeName !== Coin.$typeName) {
197
- throw new Error("not a WithTwoGenerics json object");
198
- }
199
- (0, reified_1.assertReifiedTypeArgsMatch)((0, util_1.composeSuiType)(Coin.$typeName, (0, reified_1.extractType)(typeArg)), json.$typeArgs, [typeArg]);
200
- return Coin.fromJSONField(typeArg, json);
201
- };
202
- Coin.fromSuiParsedData = function (typeArg, content) {
203
- if (content.dataType !== "moveObject") {
204
- throw new Error("not an object");
205
- }
206
- if (!isCoin(content.type)) {
207
- throw new Error("object at ".concat(content.fields.id, " is not a Coin object"));
208
- }
209
- return Coin.fromFieldsWithTypes(typeArg, content);
210
- };
211
- Coin.fromSuiObjectData = function (typeArg, data) {
212
- if (data.bcs) {
213
- if (data.bcs.dataType !== "moveObject" || !isCoin(data.bcs.type)) {
214
- throw new Error("object at is not a Coin object");
215
- }
216
- var gotTypeArgs = (0, util_1.parseTypeName)(data.bcs.type).typeArgs;
217
- if (gotTypeArgs.length !== 1) {
218
- throw new Error("type argument mismatch: expected 1 type argument but got '".concat(gotTypeArgs.length, "'"));
219
- }
220
- var gotTypeArg = (0, util_1.compressSuiType)(gotTypeArgs[0]);
221
- var expectedTypeArg = (0, util_1.compressSuiType)((0, reified_1.extractType)(typeArg));
222
- if (gotTypeArg !== (0, util_1.compressSuiType)((0, reified_1.extractType)(typeArg))) {
223
- throw new Error("type argument mismatch: expected '".concat(expectedTypeArg, "' but got '").concat(gotTypeArg, "'"));
224
- }
225
- return Coin.fromBcs(typeArg, (0, utils_1.fromB64)(data.bcs.bcsBytes));
226
- }
227
- if (data.content) {
228
- return Coin.fromSuiParsedData(typeArg, data.content);
229
- }
230
- throw new Error("Both `bcs` and `content` fields are missing from the data. Include `showBcs` or `showContent` in the request.");
231
- };
232
- Coin.fetch = function (client, typeArg, id) {
233
- return __awaiter(this, void 0, void 0, function () {
234
- var res;
235
- var _a, _b;
236
- return __generator(this, function (_c) {
237
- switch (_c.label) {
238
- case 0: return [4 /*yield*/, client.getObject({ id: id, options: { showBcs: true } })];
239
- case 1:
240
- res = _c.sent();
241
- if (res.error) {
242
- throw new Error("error fetching Coin object at id ".concat(id, ": ").concat(res.error.code));
243
- }
244
- if (((_b = (_a = res.data) === null || _a === void 0 ? void 0 : _a.bcs) === null || _b === void 0 ? void 0 : _b.dataType) !== "moveObject" || !isCoin(res.data.bcs.type)) {
245
- throw new Error("object at id ".concat(id, " is not a Coin object"));
246
- }
247
- return [2 /*return*/, Coin.fromSuiObjectData(typeArg, res.data)];
248
- }
249
- });
250
- });
251
- };
252
- Coin.$typeName = "".concat(index_1.PKG_V26, "::coin::Coin");
253
- Coin.$numTypeParams = 1;
254
- Coin.$isPhantom = [true];
255
- return Coin;
256
- }());
257
- exports.Coin = Coin;
258
- /* ============================== CoinMetadata =============================== */
259
- function isCoinMetadata(type) {
260
- type = (0, util_1.compressSuiType)(type);
261
- return type.startsWith("".concat(index_1.PKG_V26, "::coin::CoinMetadata") + "<");
262
- }
263
- var CoinMetadata = /** @class */ (function () {
264
- function CoinMetadata(typeArgs, fields) {
265
- this.__StructClass = true;
266
- this.$typeName = CoinMetadata.$typeName;
267
- this.$isPhantom = CoinMetadata.$isPhantom;
268
- this.$fullTypeName = util_1.composeSuiType.apply(void 0, __spreadArray([CoinMetadata.$typeName], __read(typeArgs), false));
269
- this.$typeArgs = typeArgs;
270
- this.id = fields.id;
271
- this.decimals = fields.decimals;
272
- this.name = fields.name;
273
- this.symbol = fields.symbol;
274
- this.description = fields.description;
275
- this.iconUrl = fields.iconUrl;
276
- }
277
- CoinMetadata.reified = function (T) {
278
- var _this = this;
279
- return {
280
- typeName: CoinMetadata.$typeName,
281
- fullTypeName: util_1.composeSuiType.apply(void 0, __spreadArray([CoinMetadata.$typeName], [(0, reified_1.extractType)(T)], false)),
282
- typeArgs: [(0, reified_1.extractType)(T)],
283
- isPhantom: CoinMetadata.$isPhantom,
284
- reifiedTypeArgs: [T],
285
- fromFields: function (fields) { return CoinMetadata.fromFields(T, fields); },
286
- fromFieldsWithTypes: function (item) { return CoinMetadata.fromFieldsWithTypes(T, item); },
287
- fromBcs: function (data) { return CoinMetadata.fromBcs(T, data); },
288
- bcs: CoinMetadata.bcs,
289
- fromJSONField: function (field) { return CoinMetadata.fromJSONField(T, field); },
290
- fromJSON: function (json) { return CoinMetadata.fromJSON(T, json); },
291
- fromSuiParsedData: function (content) { return CoinMetadata.fromSuiParsedData(T, content); },
292
- fromSuiObjectData: function (content) { return CoinMetadata.fromSuiObjectData(T, content); },
293
- fetch: function (client, id) { return __awaiter(_this, void 0, void 0, function () { return __generator(this, function (_a) {
294
- return [2 /*return*/, CoinMetadata.fetch(client, T, id)];
295
- }); }); },
296
- new: function (fields) {
297
- return new CoinMetadata([(0, reified_1.extractType)(T)], fields);
298
- },
299
- kind: "StructClassReified",
300
- };
301
- };
302
- Object.defineProperty(CoinMetadata, "r", {
303
- get: function () {
304
- return CoinMetadata.reified;
305
- },
306
- enumerable: false,
307
- configurable: true
308
- });
309
- CoinMetadata.phantom = function (T) {
310
- return (0, reified_1.phantom)(CoinMetadata.reified(T));
311
- };
312
- Object.defineProperty(CoinMetadata, "p", {
313
- get: function () {
314
- return CoinMetadata.phantom;
315
- },
316
- enumerable: false,
317
- configurable: true
318
- });
319
- Object.defineProperty(CoinMetadata, "bcs", {
320
- get: function () {
321
- return bcs_1.bcs.struct("CoinMetadata", {
322
- id: structs_5.UID.bcs,
323
- decimals: bcs_1.bcs.u8(),
324
- name: structs_3.String.bcs,
325
- symbol: structs_1.String.bcs,
326
- description: structs_3.String.bcs,
327
- icon_url: structs_2.Option.bcs(structs_6.Url.bcs),
328
- });
329
- },
330
- enumerable: false,
331
- configurable: true
332
- });
333
- CoinMetadata.fromFields = function (typeArg, fields) {
334
- return CoinMetadata.reified(typeArg).new({
335
- id: (0, reified_1.decodeFromFields)(structs_5.UID.reified(), fields.id),
336
- decimals: (0, reified_1.decodeFromFields)("u8", fields.decimals),
337
- name: (0, reified_1.decodeFromFields)(structs_3.String.reified(), fields.name),
338
- symbol: (0, reified_1.decodeFromFields)(structs_1.String.reified(), fields.symbol),
339
- description: (0, reified_1.decodeFromFields)(structs_3.String.reified(), fields.description),
340
- iconUrl: (0, reified_1.decodeFromFields)(structs_2.Option.reified(structs_6.Url.reified()), fields.icon_url),
341
- });
342
- };
343
- CoinMetadata.fromFieldsWithTypes = function (typeArg, item) {
344
- if (!isCoinMetadata(item.type)) {
345
- throw new Error("not a CoinMetadata type");
346
- }
347
- (0, reified_1.assertFieldsWithTypesArgsMatch)(item, [typeArg]);
348
- return CoinMetadata.reified(typeArg).new({
349
- id: (0, reified_1.decodeFromFieldsWithTypes)(structs_5.UID.reified(), item.fields.id),
350
- decimals: (0, reified_1.decodeFromFieldsWithTypes)("u8", item.fields.decimals),
351
- name: (0, reified_1.decodeFromFieldsWithTypes)(structs_3.String.reified(), item.fields.name),
352
- symbol: (0, reified_1.decodeFromFieldsWithTypes)(structs_1.String.reified(), item.fields.symbol),
353
- description: (0, reified_1.decodeFromFieldsWithTypes)(structs_3.String.reified(), item.fields.description),
354
- iconUrl: (0, reified_1.decodeFromFieldsWithTypes)(structs_2.Option.reified(structs_6.Url.reified()), item.fields.icon_url),
355
- });
356
- };
357
- CoinMetadata.fromBcs = function (typeArg, data) {
358
- return CoinMetadata.fromFields(typeArg, CoinMetadata.bcs.parse(data));
359
- };
360
- CoinMetadata.prototype.toJSONField = function () {
361
- return {
362
- id: this.id,
363
- decimals: this.decimals,
364
- name: this.name,
365
- symbol: this.symbol,
366
- description: this.description,
367
- iconUrl: (0, reified_1.fieldToJSON)("".concat(structs_2.Option.$typeName, "<").concat(structs_6.Url.$typeName, ">"), this.iconUrl),
368
- };
369
- };
370
- CoinMetadata.prototype.toJSON = function () {
371
- return __assign({ $typeName: this.$typeName, $typeArgs: this.$typeArgs }, this.toJSONField());
372
- };
373
- CoinMetadata.fromJSONField = function (typeArg, field) {
374
- return CoinMetadata.reified(typeArg).new({
375
- id: (0, reified_1.decodeFromJSONField)(structs_5.UID.reified(), field.id),
376
- decimals: (0, reified_1.decodeFromJSONField)("u8", field.decimals),
377
- name: (0, reified_1.decodeFromJSONField)(structs_3.String.reified(), field.name),
378
- symbol: (0, reified_1.decodeFromJSONField)(structs_1.String.reified(), field.symbol),
379
- description: (0, reified_1.decodeFromJSONField)(structs_3.String.reified(), field.description),
380
- iconUrl: (0, reified_1.decodeFromJSONField)(structs_2.Option.reified(structs_6.Url.reified()), field.iconUrl),
381
- });
382
- };
383
- CoinMetadata.fromJSON = function (typeArg, json) {
384
- if (json.$typeName !== CoinMetadata.$typeName) {
385
- throw new Error("not a WithTwoGenerics json object");
386
- }
387
- (0, reified_1.assertReifiedTypeArgsMatch)((0, util_1.composeSuiType)(CoinMetadata.$typeName, (0, reified_1.extractType)(typeArg)), json.$typeArgs, [typeArg]);
388
- return CoinMetadata.fromJSONField(typeArg, json);
389
- };
390
- CoinMetadata.fromSuiParsedData = function (typeArg, content) {
391
- if (content.dataType !== "moveObject") {
392
- throw new Error("not an object");
393
- }
394
- if (!isCoinMetadata(content.type)) {
395
- throw new Error("object at ".concat(content.fields.id, " is not a CoinMetadata object"));
396
- }
397
- return CoinMetadata.fromFieldsWithTypes(typeArg, content);
398
- };
399
- CoinMetadata.fromSuiObjectData = function (typeArg, data) {
400
- if (data.bcs) {
401
- if (data.bcs.dataType !== "moveObject" || !isCoinMetadata(data.bcs.type)) {
402
- throw new Error("object at is not a CoinMetadata object");
403
- }
404
- var gotTypeArgs = (0, util_1.parseTypeName)(data.bcs.type).typeArgs;
405
- if (gotTypeArgs.length !== 1) {
406
- throw new Error("type argument mismatch: expected 1 type argument but got '".concat(gotTypeArgs.length, "'"));
407
- }
408
- var gotTypeArg = (0, util_1.compressSuiType)(gotTypeArgs[0]);
409
- var expectedTypeArg = (0, util_1.compressSuiType)((0, reified_1.extractType)(typeArg));
410
- if (gotTypeArg !== (0, util_1.compressSuiType)((0, reified_1.extractType)(typeArg))) {
411
- throw new Error("type argument mismatch: expected '".concat(expectedTypeArg, "' but got '").concat(gotTypeArg, "'"));
412
- }
413
- return CoinMetadata.fromBcs(typeArg, (0, utils_1.fromB64)(data.bcs.bcsBytes));
414
- }
415
- if (data.content) {
416
- return CoinMetadata.fromSuiParsedData(typeArg, data.content);
417
- }
418
- throw new Error("Both `bcs` and `content` fields are missing from the data. Include `showBcs` or `showContent` in the request.");
419
- };
420
- CoinMetadata.fetch = function (client, typeArg, id) {
421
- return __awaiter(this, void 0, void 0, function () {
422
- var res;
423
- var _a, _b;
424
- return __generator(this, function (_c) {
425
- switch (_c.label) {
426
- case 0: return [4 /*yield*/, client.getObject({ id: id, options: { showBcs: true } })];
427
- case 1:
428
- res = _c.sent();
429
- if (res.error) {
430
- throw new Error("error fetching CoinMetadata object at id ".concat(id, ": ").concat(res.error.code));
431
- }
432
- if (((_b = (_a = res.data) === null || _a === void 0 ? void 0 : _a.bcs) === null || _b === void 0 ? void 0 : _b.dataType) !== "moveObject" || !isCoinMetadata(res.data.bcs.type)) {
433
- throw new Error("object at id ".concat(id, " is not a CoinMetadata object"));
434
- }
435
- return [2 /*return*/, CoinMetadata.fromSuiObjectData(typeArg, res.data)];
436
- }
437
- });
438
- });
439
- };
440
- CoinMetadata.$typeName = "".concat(index_1.PKG_V26, "::coin::CoinMetadata");
441
- CoinMetadata.$numTypeParams = 1;
442
- CoinMetadata.$isPhantom = [true];
443
- return CoinMetadata;
444
- }());
445
- exports.CoinMetadata = CoinMetadata;
446
- /* ============================== CurrencyCreated =============================== */
447
- function isCurrencyCreated(type) {
448
- type = (0, util_1.compressSuiType)(type);
449
- return type.startsWith("".concat(index_1.PKG_V26, "::coin::CurrencyCreated") + "<");
450
- }
451
- var CurrencyCreated = /** @class */ (function () {
452
- function CurrencyCreated(typeArgs, fields) {
453
- this.__StructClass = true;
454
- this.$typeName = CurrencyCreated.$typeName;
455
- this.$isPhantom = CurrencyCreated.$isPhantom;
456
- this.$fullTypeName = util_1.composeSuiType.apply(void 0, __spreadArray([CurrencyCreated.$typeName], __read(typeArgs), false));
457
- this.$typeArgs = typeArgs;
458
- this.decimals = fields.decimals;
459
- }
460
- CurrencyCreated.reified = function (T) {
461
- var _this = this;
462
- return {
463
- typeName: CurrencyCreated.$typeName,
464
- fullTypeName: util_1.composeSuiType.apply(void 0, __spreadArray([CurrencyCreated.$typeName], [(0, reified_1.extractType)(T)], false)),
465
- typeArgs: [(0, reified_1.extractType)(T)],
466
- isPhantom: CurrencyCreated.$isPhantom,
467
- reifiedTypeArgs: [T],
468
- fromFields: function (fields) { return CurrencyCreated.fromFields(T, fields); },
469
- fromFieldsWithTypes: function (item) { return CurrencyCreated.fromFieldsWithTypes(T, item); },
470
- fromBcs: function (data) { return CurrencyCreated.fromBcs(T, data); },
471
- bcs: CurrencyCreated.bcs,
472
- fromJSONField: function (field) { return CurrencyCreated.fromJSONField(T, field); },
473
- fromJSON: function (json) { return CurrencyCreated.fromJSON(T, json); },
474
- fromSuiParsedData: function (content) { return CurrencyCreated.fromSuiParsedData(T, content); },
475
- fromSuiObjectData: function (content) { return CurrencyCreated.fromSuiObjectData(T, content); },
476
- fetch: function (client, id) { return __awaiter(_this, void 0, void 0, function () { return __generator(this, function (_a) {
477
- return [2 /*return*/, CurrencyCreated.fetch(client, T, id)];
478
- }); }); },
479
- new: function (fields) {
480
- return new CurrencyCreated([(0, reified_1.extractType)(T)], fields);
481
- },
482
- kind: "StructClassReified",
483
- };
484
- };
485
- Object.defineProperty(CurrencyCreated, "r", {
486
- get: function () {
487
- return CurrencyCreated.reified;
488
- },
489
- enumerable: false,
490
- configurable: true
491
- });
492
- CurrencyCreated.phantom = function (T) {
493
- return (0, reified_1.phantom)(CurrencyCreated.reified(T));
494
- };
495
- Object.defineProperty(CurrencyCreated, "p", {
496
- get: function () {
497
- return CurrencyCreated.phantom;
498
- },
499
- enumerable: false,
500
- configurable: true
501
- });
502
- Object.defineProperty(CurrencyCreated, "bcs", {
503
- get: function () {
504
- return bcs_1.bcs.struct("CurrencyCreated", {
505
- decimals: bcs_1.bcs.u8(),
506
- });
507
- },
508
- enumerable: false,
509
- configurable: true
510
- });
511
- CurrencyCreated.fromFields = function (typeArg, fields) {
512
- return CurrencyCreated.reified(typeArg).new({ decimals: (0, reified_1.decodeFromFields)("u8", fields.decimals) });
513
- };
514
- CurrencyCreated.fromFieldsWithTypes = function (typeArg, item) {
515
- if (!isCurrencyCreated(item.type)) {
516
- throw new Error("not a CurrencyCreated type");
517
- }
518
- (0, reified_1.assertFieldsWithTypesArgsMatch)(item, [typeArg]);
519
- return CurrencyCreated.reified(typeArg).new({ decimals: (0, reified_1.decodeFromFieldsWithTypes)("u8", item.fields.decimals) });
520
- };
521
- CurrencyCreated.fromBcs = function (typeArg, data) {
522
- return CurrencyCreated.fromFields(typeArg, CurrencyCreated.bcs.parse(data));
523
- };
524
- CurrencyCreated.prototype.toJSONField = function () {
525
- return {
526
- decimals: this.decimals,
527
- };
528
- };
529
- CurrencyCreated.prototype.toJSON = function () {
530
- return __assign({ $typeName: this.$typeName, $typeArgs: this.$typeArgs }, this.toJSONField());
531
- };
532
- CurrencyCreated.fromJSONField = function (typeArg, field) {
533
- return CurrencyCreated.reified(typeArg).new({ decimals: (0, reified_1.decodeFromJSONField)("u8", field.decimals) });
534
- };
535
- CurrencyCreated.fromJSON = function (typeArg, json) {
536
- if (json.$typeName !== CurrencyCreated.$typeName) {
537
- throw new Error("not a WithTwoGenerics json object");
538
- }
539
- (0, reified_1.assertReifiedTypeArgsMatch)((0, util_1.composeSuiType)(CurrencyCreated.$typeName, (0, reified_1.extractType)(typeArg)), json.$typeArgs, [typeArg]);
540
- return CurrencyCreated.fromJSONField(typeArg, json);
541
- };
542
- CurrencyCreated.fromSuiParsedData = function (typeArg, content) {
543
- if (content.dataType !== "moveObject") {
544
- throw new Error("not an object");
545
- }
546
- if (!isCurrencyCreated(content.type)) {
547
- throw new Error("object at ".concat(content.fields.id, " is not a CurrencyCreated object"));
548
- }
549
- return CurrencyCreated.fromFieldsWithTypes(typeArg, content);
550
- };
551
- CurrencyCreated.fromSuiObjectData = function (typeArg, data) {
552
- if (data.bcs) {
553
- if (data.bcs.dataType !== "moveObject" || !isCurrencyCreated(data.bcs.type)) {
554
- throw new Error("object at is not a CurrencyCreated object");
555
- }
556
- var gotTypeArgs = (0, util_1.parseTypeName)(data.bcs.type).typeArgs;
557
- if (gotTypeArgs.length !== 1) {
558
- throw new Error("type argument mismatch: expected 1 type argument but got '".concat(gotTypeArgs.length, "'"));
559
- }
560
- var gotTypeArg = (0, util_1.compressSuiType)(gotTypeArgs[0]);
561
- var expectedTypeArg = (0, util_1.compressSuiType)((0, reified_1.extractType)(typeArg));
562
- if (gotTypeArg !== (0, util_1.compressSuiType)((0, reified_1.extractType)(typeArg))) {
563
- throw new Error("type argument mismatch: expected '".concat(expectedTypeArg, "' but got '").concat(gotTypeArg, "'"));
564
- }
565
- return CurrencyCreated.fromBcs(typeArg, (0, utils_1.fromB64)(data.bcs.bcsBytes));
566
- }
567
- if (data.content) {
568
- return CurrencyCreated.fromSuiParsedData(typeArg, data.content);
569
- }
570
- throw new Error("Both `bcs` and `content` fields are missing from the data. Include `showBcs` or `showContent` in the request.");
571
- };
572
- CurrencyCreated.fetch = function (client, typeArg, id) {
573
- return __awaiter(this, void 0, void 0, function () {
574
- var res;
575
- var _a, _b;
576
- return __generator(this, function (_c) {
577
- switch (_c.label) {
578
- case 0: return [4 /*yield*/, client.getObject({ id: id, options: { showBcs: true } })];
579
- case 1:
580
- res = _c.sent();
581
- if (res.error) {
582
- throw new Error("error fetching CurrencyCreated object at id ".concat(id, ": ").concat(res.error.code));
583
- }
584
- if (((_b = (_a = res.data) === null || _a === void 0 ? void 0 : _a.bcs) === null || _b === void 0 ? void 0 : _b.dataType) !== "moveObject" || !isCurrencyCreated(res.data.bcs.type)) {
585
- throw new Error("object at id ".concat(id, " is not a CurrencyCreated object"));
586
- }
587
- return [2 /*return*/, CurrencyCreated.fromSuiObjectData(typeArg, res.data)];
588
- }
589
- });
590
- });
591
- };
592
- CurrencyCreated.$typeName = "".concat(index_1.PKG_V26, "::coin::CurrencyCreated");
593
- CurrencyCreated.$numTypeParams = 1;
594
- CurrencyCreated.$isPhantom = [true];
595
- return CurrencyCreated;
596
- }());
597
- exports.CurrencyCreated = CurrencyCreated;
598
- /* ============================== DenyCap =============================== */
599
- function isDenyCap(type) {
600
- type = (0, util_1.compressSuiType)(type);
601
- return type.startsWith("".concat(index_1.PKG_V26, "::coin::DenyCap") + "<");
602
- }
603
- var DenyCap = /** @class */ (function () {
604
- function DenyCap(typeArgs, fields) {
605
- this.__StructClass = true;
606
- this.$typeName = DenyCap.$typeName;
607
- this.$isPhantom = DenyCap.$isPhantom;
608
- this.$fullTypeName = util_1.composeSuiType.apply(void 0, __spreadArray([DenyCap.$typeName], __read(typeArgs), false));
609
- this.$typeArgs = typeArgs;
610
- this.id = fields.id;
611
- }
612
- DenyCap.reified = function (T) {
613
- var _this = this;
614
- return {
615
- typeName: DenyCap.$typeName,
616
- fullTypeName: util_1.composeSuiType.apply(void 0, __spreadArray([DenyCap.$typeName], [(0, reified_1.extractType)(T)], false)),
617
- typeArgs: [(0, reified_1.extractType)(T)],
618
- isPhantom: DenyCap.$isPhantom,
619
- reifiedTypeArgs: [T],
620
- fromFields: function (fields) { return DenyCap.fromFields(T, fields); },
621
- fromFieldsWithTypes: function (item) { return DenyCap.fromFieldsWithTypes(T, item); },
622
- fromBcs: function (data) { return DenyCap.fromBcs(T, data); },
623
- bcs: DenyCap.bcs,
624
- fromJSONField: function (field) { return DenyCap.fromJSONField(T, field); },
625
- fromJSON: function (json) { return DenyCap.fromJSON(T, json); },
626
- fromSuiParsedData: function (content) { return DenyCap.fromSuiParsedData(T, content); },
627
- fromSuiObjectData: function (content) { return DenyCap.fromSuiObjectData(T, content); },
628
- fetch: function (client, id) { return __awaiter(_this, void 0, void 0, function () { return __generator(this, function (_a) {
629
- return [2 /*return*/, DenyCap.fetch(client, T, id)];
630
- }); }); },
631
- new: function (fields) {
632
- return new DenyCap([(0, reified_1.extractType)(T)], fields);
633
- },
634
- kind: "StructClassReified",
635
- };
636
- };
637
- Object.defineProperty(DenyCap, "r", {
638
- get: function () {
639
- return DenyCap.reified;
640
- },
641
- enumerable: false,
642
- configurable: true
643
- });
644
- DenyCap.phantom = function (T) {
645
- return (0, reified_1.phantom)(DenyCap.reified(T));
646
- };
647
- Object.defineProperty(DenyCap, "p", {
648
- get: function () {
649
- return DenyCap.phantom;
650
- },
651
- enumerable: false,
652
- configurable: true
653
- });
654
- Object.defineProperty(DenyCap, "bcs", {
655
- get: function () {
656
- return bcs_1.bcs.struct("DenyCap", {
657
- id: structs_5.UID.bcs,
658
- });
659
- },
660
- enumerable: false,
661
- configurable: true
662
- });
663
- DenyCap.fromFields = function (typeArg, fields) {
664
- return DenyCap.reified(typeArg).new({ id: (0, reified_1.decodeFromFields)(structs_5.UID.reified(), fields.id) });
665
- };
666
- DenyCap.fromFieldsWithTypes = function (typeArg, item) {
667
- if (!isDenyCap(item.type)) {
668
- throw new Error("not a DenyCap type");
669
- }
670
- (0, reified_1.assertFieldsWithTypesArgsMatch)(item, [typeArg]);
671
- return DenyCap.reified(typeArg).new({ id: (0, reified_1.decodeFromFieldsWithTypes)(structs_5.UID.reified(), item.fields.id) });
672
- };
673
- DenyCap.fromBcs = function (typeArg, data) {
674
- return DenyCap.fromFields(typeArg, DenyCap.bcs.parse(data));
675
- };
676
- DenyCap.prototype.toJSONField = function () {
677
- return {
678
- id: this.id,
679
- };
680
- };
681
- DenyCap.prototype.toJSON = function () {
682
- return __assign({ $typeName: this.$typeName, $typeArgs: this.$typeArgs }, this.toJSONField());
683
- };
684
- DenyCap.fromJSONField = function (typeArg, field) {
685
- return DenyCap.reified(typeArg).new({ id: (0, reified_1.decodeFromJSONField)(structs_5.UID.reified(), field.id) });
686
- };
687
- DenyCap.fromJSON = function (typeArg, json) {
688
- if (json.$typeName !== DenyCap.$typeName) {
689
- throw new Error("not a WithTwoGenerics json object");
690
- }
691
- (0, reified_1.assertReifiedTypeArgsMatch)((0, util_1.composeSuiType)(DenyCap.$typeName, (0, reified_1.extractType)(typeArg)), json.$typeArgs, [typeArg]);
692
- return DenyCap.fromJSONField(typeArg, json);
693
- };
694
- DenyCap.fromSuiParsedData = function (typeArg, content) {
695
- if (content.dataType !== "moveObject") {
696
- throw new Error("not an object");
697
- }
698
- if (!isDenyCap(content.type)) {
699
- throw new Error("object at ".concat(content.fields.id, " is not a DenyCap object"));
700
- }
701
- return DenyCap.fromFieldsWithTypes(typeArg, content);
702
- };
703
- DenyCap.fromSuiObjectData = function (typeArg, data) {
704
- if (data.bcs) {
705
- if (data.bcs.dataType !== "moveObject" || !isDenyCap(data.bcs.type)) {
706
- throw new Error("object at is not a DenyCap object");
707
- }
708
- var gotTypeArgs = (0, util_1.parseTypeName)(data.bcs.type).typeArgs;
709
- if (gotTypeArgs.length !== 1) {
710
- throw new Error("type argument mismatch: expected 1 type argument but got '".concat(gotTypeArgs.length, "'"));
711
- }
712
- var gotTypeArg = (0, util_1.compressSuiType)(gotTypeArgs[0]);
713
- var expectedTypeArg = (0, util_1.compressSuiType)((0, reified_1.extractType)(typeArg));
714
- if (gotTypeArg !== (0, util_1.compressSuiType)((0, reified_1.extractType)(typeArg))) {
715
- throw new Error("type argument mismatch: expected '".concat(expectedTypeArg, "' but got '").concat(gotTypeArg, "'"));
716
- }
717
- return DenyCap.fromBcs(typeArg, (0, utils_1.fromB64)(data.bcs.bcsBytes));
718
- }
719
- if (data.content) {
720
- return DenyCap.fromSuiParsedData(typeArg, data.content);
721
- }
722
- throw new Error("Both `bcs` and `content` fields are missing from the data. Include `showBcs` or `showContent` in the request.");
723
- };
724
- DenyCap.fetch = function (client, typeArg, id) {
725
- return __awaiter(this, void 0, void 0, function () {
726
- var res;
727
- var _a, _b;
728
- return __generator(this, function (_c) {
729
- switch (_c.label) {
730
- case 0: return [4 /*yield*/, client.getObject({ id: id, options: { showBcs: true } })];
731
- case 1:
732
- res = _c.sent();
733
- if (res.error) {
734
- throw new Error("error fetching DenyCap object at id ".concat(id, ": ").concat(res.error.code));
735
- }
736
- if (((_b = (_a = res.data) === null || _a === void 0 ? void 0 : _a.bcs) === null || _b === void 0 ? void 0 : _b.dataType) !== "moveObject" || !isDenyCap(res.data.bcs.type)) {
737
- throw new Error("object at id ".concat(id, " is not a DenyCap object"));
738
- }
739
- return [2 /*return*/, DenyCap.fromSuiObjectData(typeArg, res.data)];
740
- }
741
- });
742
- });
743
- };
744
- DenyCap.$typeName = "".concat(index_1.PKG_V26, "::coin::DenyCap");
745
- DenyCap.$numTypeParams = 1;
746
- DenyCap.$isPhantom = [true];
747
- return DenyCap;
748
- }());
749
- exports.DenyCap = DenyCap;
750
- /* ============================== DenyCapV2 =============================== */
751
- function isDenyCapV2(type) {
752
- type = (0, util_1.compressSuiType)(type);
753
- return type.startsWith("".concat(index_1.PKG_V26, "::coin::DenyCapV2") + "<");
754
- }
755
- var DenyCapV2 = /** @class */ (function () {
756
- function DenyCapV2(typeArgs, fields) {
757
- this.__StructClass = true;
758
- this.$typeName = DenyCapV2.$typeName;
759
- this.$isPhantom = DenyCapV2.$isPhantom;
760
- this.$fullTypeName = util_1.composeSuiType.apply(void 0, __spreadArray([DenyCapV2.$typeName], __read(typeArgs), false));
761
- this.$typeArgs = typeArgs;
762
- this.id = fields.id;
763
- this.allowGlobalPause = fields.allowGlobalPause;
764
- }
765
- DenyCapV2.reified = function (T) {
766
- var _this = this;
767
- return {
768
- typeName: DenyCapV2.$typeName,
769
- fullTypeName: util_1.composeSuiType.apply(void 0, __spreadArray([DenyCapV2.$typeName], [(0, reified_1.extractType)(T)], false)),
770
- typeArgs: [(0, reified_1.extractType)(T)],
771
- isPhantom: DenyCapV2.$isPhantom,
772
- reifiedTypeArgs: [T],
773
- fromFields: function (fields) { return DenyCapV2.fromFields(T, fields); },
774
- fromFieldsWithTypes: function (item) { return DenyCapV2.fromFieldsWithTypes(T, item); },
775
- fromBcs: function (data) { return DenyCapV2.fromBcs(T, data); },
776
- bcs: DenyCapV2.bcs,
777
- fromJSONField: function (field) { return DenyCapV2.fromJSONField(T, field); },
778
- fromJSON: function (json) { return DenyCapV2.fromJSON(T, json); },
779
- fromSuiParsedData: function (content) { return DenyCapV2.fromSuiParsedData(T, content); },
780
- fromSuiObjectData: function (content) { return DenyCapV2.fromSuiObjectData(T, content); },
781
- fetch: function (client, id) { return __awaiter(_this, void 0, void 0, function () { return __generator(this, function (_a) {
782
- return [2 /*return*/, DenyCapV2.fetch(client, T, id)];
783
- }); }); },
784
- new: function (fields) {
785
- return new DenyCapV2([(0, reified_1.extractType)(T)], fields);
786
- },
787
- kind: "StructClassReified",
788
- };
789
- };
790
- Object.defineProperty(DenyCapV2, "r", {
791
- get: function () {
792
- return DenyCapV2.reified;
793
- },
794
- enumerable: false,
795
- configurable: true
796
- });
797
- DenyCapV2.phantom = function (T) {
798
- return (0, reified_1.phantom)(DenyCapV2.reified(T));
799
- };
800
- Object.defineProperty(DenyCapV2, "p", {
801
- get: function () {
802
- return DenyCapV2.phantom;
803
- },
804
- enumerable: false,
805
- configurable: true
806
- });
807
- Object.defineProperty(DenyCapV2, "bcs", {
808
- get: function () {
809
- return bcs_1.bcs.struct("DenyCapV2", {
810
- id: structs_5.UID.bcs,
811
- allow_global_pause: bcs_1.bcs.bool(),
812
- });
813
- },
814
- enumerable: false,
815
- configurable: true
816
- });
817
- DenyCapV2.fromFields = function (typeArg, fields) {
818
- return DenyCapV2.reified(typeArg).new({
819
- id: (0, reified_1.decodeFromFields)(structs_5.UID.reified(), fields.id),
820
- allowGlobalPause: (0, reified_1.decodeFromFields)("bool", fields.allow_global_pause),
821
- });
822
- };
823
- DenyCapV2.fromFieldsWithTypes = function (typeArg, item) {
824
- if (!isDenyCapV2(item.type)) {
825
- throw new Error("not a DenyCapV2 type");
826
- }
827
- (0, reified_1.assertFieldsWithTypesArgsMatch)(item, [typeArg]);
828
- return DenyCapV2.reified(typeArg).new({
829
- id: (0, reified_1.decodeFromFieldsWithTypes)(structs_5.UID.reified(), item.fields.id),
830
- allowGlobalPause: (0, reified_1.decodeFromFieldsWithTypes)("bool", item.fields.allow_global_pause),
831
- });
832
- };
833
- DenyCapV2.fromBcs = function (typeArg, data) {
834
- return DenyCapV2.fromFields(typeArg, DenyCapV2.bcs.parse(data));
835
- };
836
- DenyCapV2.prototype.toJSONField = function () {
837
- return {
838
- id: this.id,
839
- allowGlobalPause: this.allowGlobalPause,
840
- };
841
- };
842
- DenyCapV2.prototype.toJSON = function () {
843
- return __assign({ $typeName: this.$typeName, $typeArgs: this.$typeArgs }, this.toJSONField());
844
- };
845
- DenyCapV2.fromJSONField = function (typeArg, field) {
846
- return DenyCapV2.reified(typeArg).new({
847
- id: (0, reified_1.decodeFromJSONField)(structs_5.UID.reified(), field.id),
848
- allowGlobalPause: (0, reified_1.decodeFromJSONField)("bool", field.allowGlobalPause),
849
- });
850
- };
851
- DenyCapV2.fromJSON = function (typeArg, json) {
852
- if (json.$typeName !== DenyCapV2.$typeName) {
853
- throw new Error("not a WithTwoGenerics json object");
854
- }
855
- (0, reified_1.assertReifiedTypeArgsMatch)((0, util_1.composeSuiType)(DenyCapV2.$typeName, (0, reified_1.extractType)(typeArg)), json.$typeArgs, [typeArg]);
856
- return DenyCapV2.fromJSONField(typeArg, json);
857
- };
858
- DenyCapV2.fromSuiParsedData = function (typeArg, content) {
859
- if (content.dataType !== "moveObject") {
860
- throw new Error("not an object");
861
- }
862
- if (!isDenyCapV2(content.type)) {
863
- throw new Error("object at ".concat(content.fields.id, " is not a DenyCapV2 object"));
864
- }
865
- return DenyCapV2.fromFieldsWithTypes(typeArg, content);
866
- };
867
- DenyCapV2.fromSuiObjectData = function (typeArg, data) {
868
- if (data.bcs) {
869
- if (data.bcs.dataType !== "moveObject" || !isDenyCapV2(data.bcs.type)) {
870
- throw new Error("object at is not a DenyCapV2 object");
871
- }
872
- var gotTypeArgs = (0, util_1.parseTypeName)(data.bcs.type).typeArgs;
873
- if (gotTypeArgs.length !== 1) {
874
- throw new Error("type argument mismatch: expected 1 type argument but got '".concat(gotTypeArgs.length, "'"));
875
- }
876
- var gotTypeArg = (0, util_1.compressSuiType)(gotTypeArgs[0]);
877
- var expectedTypeArg = (0, util_1.compressSuiType)((0, reified_1.extractType)(typeArg));
878
- if (gotTypeArg !== (0, util_1.compressSuiType)((0, reified_1.extractType)(typeArg))) {
879
- throw new Error("type argument mismatch: expected '".concat(expectedTypeArg, "' but got '").concat(gotTypeArg, "'"));
880
- }
881
- return DenyCapV2.fromBcs(typeArg, (0, utils_1.fromB64)(data.bcs.bcsBytes));
882
- }
883
- if (data.content) {
884
- return DenyCapV2.fromSuiParsedData(typeArg, data.content);
885
- }
886
- throw new Error("Both `bcs` and `content` fields are missing from the data. Include `showBcs` or `showContent` in the request.");
887
- };
888
- DenyCapV2.fetch = function (client, typeArg, id) {
889
- return __awaiter(this, void 0, void 0, function () {
890
- var res;
891
- var _a, _b;
892
- return __generator(this, function (_c) {
893
- switch (_c.label) {
894
- case 0: return [4 /*yield*/, client.getObject({ id: id, options: { showBcs: true } })];
895
- case 1:
896
- res = _c.sent();
897
- if (res.error) {
898
- throw new Error("error fetching DenyCapV2 object at id ".concat(id, ": ").concat(res.error.code));
899
- }
900
- if (((_b = (_a = res.data) === null || _a === void 0 ? void 0 : _a.bcs) === null || _b === void 0 ? void 0 : _b.dataType) !== "moveObject" || !isDenyCapV2(res.data.bcs.type)) {
901
- throw new Error("object at id ".concat(id, " is not a DenyCapV2 object"));
902
- }
903
- return [2 /*return*/, DenyCapV2.fromSuiObjectData(typeArg, res.data)];
904
- }
905
- });
906
- });
907
- };
908
- DenyCapV2.$typeName = "".concat(index_1.PKG_V26, "::coin::DenyCapV2");
909
- DenyCapV2.$numTypeParams = 1;
910
- DenyCapV2.$isPhantom = [true];
911
- return DenyCapV2;
912
- }());
913
- exports.DenyCapV2 = DenyCapV2;
914
- /* ============================== RegulatedCoinMetadata =============================== */
915
- function isRegulatedCoinMetadata(type) {
916
- type = (0, util_1.compressSuiType)(type);
917
- return type.startsWith("".concat(index_1.PKG_V26, "::coin::RegulatedCoinMetadata") + "<");
918
- }
919
- var RegulatedCoinMetadata = /** @class */ (function () {
920
- function RegulatedCoinMetadata(typeArgs, fields) {
921
- this.__StructClass = true;
922
- this.$typeName = RegulatedCoinMetadata.$typeName;
923
- this.$isPhantom = RegulatedCoinMetadata.$isPhantom;
924
- this.$fullTypeName = util_1.composeSuiType.apply(void 0, __spreadArray([RegulatedCoinMetadata.$typeName], __read(typeArgs), false));
925
- this.$typeArgs = typeArgs;
926
- this.id = fields.id;
927
- this.coinMetadataObject = fields.coinMetadataObject;
928
- this.denyCapObject = fields.denyCapObject;
929
- }
930
- RegulatedCoinMetadata.reified = function (T) {
931
- var _this = this;
932
- return {
933
- typeName: RegulatedCoinMetadata.$typeName,
934
- fullTypeName: util_1.composeSuiType.apply(void 0, __spreadArray([RegulatedCoinMetadata.$typeName], [(0, reified_1.extractType)(T)], false)),
935
- typeArgs: [(0, reified_1.extractType)(T)],
936
- isPhantom: RegulatedCoinMetadata.$isPhantom,
937
- reifiedTypeArgs: [T],
938
- fromFields: function (fields) { return RegulatedCoinMetadata.fromFields(T, fields); },
939
- fromFieldsWithTypes: function (item) { return RegulatedCoinMetadata.fromFieldsWithTypes(T, item); },
940
- fromBcs: function (data) { return RegulatedCoinMetadata.fromBcs(T, data); },
941
- bcs: RegulatedCoinMetadata.bcs,
942
- fromJSONField: function (field) { return RegulatedCoinMetadata.fromJSONField(T, field); },
943
- fromJSON: function (json) { return RegulatedCoinMetadata.fromJSON(T, json); },
944
- fromSuiParsedData: function (content) { return RegulatedCoinMetadata.fromSuiParsedData(T, content); },
945
- fromSuiObjectData: function (content) { return RegulatedCoinMetadata.fromSuiObjectData(T, content); },
946
- fetch: function (client, id) { return __awaiter(_this, void 0, void 0, function () { return __generator(this, function (_a) {
947
- return [2 /*return*/, RegulatedCoinMetadata.fetch(client, T, id)];
948
- }); }); },
949
- new: function (fields) {
950
- return new RegulatedCoinMetadata([(0, reified_1.extractType)(T)], fields);
951
- },
952
- kind: "StructClassReified",
953
- };
954
- };
955
- Object.defineProperty(RegulatedCoinMetadata, "r", {
956
- get: function () {
957
- return RegulatedCoinMetadata.reified;
958
- },
959
- enumerable: false,
960
- configurable: true
961
- });
962
- RegulatedCoinMetadata.phantom = function (T) {
963
- return (0, reified_1.phantom)(RegulatedCoinMetadata.reified(T));
964
- };
965
- Object.defineProperty(RegulatedCoinMetadata, "p", {
966
- get: function () {
967
- return RegulatedCoinMetadata.phantom;
968
- },
969
- enumerable: false,
970
- configurable: true
971
- });
972
- Object.defineProperty(RegulatedCoinMetadata, "bcs", {
973
- get: function () {
974
- return bcs_1.bcs.struct("RegulatedCoinMetadata", {
975
- id: structs_5.UID.bcs,
976
- coin_metadata_object: structs_5.ID.bcs,
977
- deny_cap_object: structs_5.ID.bcs,
978
- });
979
- },
980
- enumerable: false,
981
- configurable: true
982
- });
983
- RegulatedCoinMetadata.fromFields = function (typeArg, fields) {
984
- return RegulatedCoinMetadata.reified(typeArg).new({
985
- id: (0, reified_1.decodeFromFields)(structs_5.UID.reified(), fields.id),
986
- coinMetadataObject: (0, reified_1.decodeFromFields)(structs_5.ID.reified(), fields.coin_metadata_object),
987
- denyCapObject: (0, reified_1.decodeFromFields)(structs_5.ID.reified(), fields.deny_cap_object),
988
- });
989
- };
990
- RegulatedCoinMetadata.fromFieldsWithTypes = function (typeArg, item) {
991
- if (!isRegulatedCoinMetadata(item.type)) {
992
- throw new Error("not a RegulatedCoinMetadata type");
993
- }
994
- (0, reified_1.assertFieldsWithTypesArgsMatch)(item, [typeArg]);
995
- return RegulatedCoinMetadata.reified(typeArg).new({
996
- id: (0, reified_1.decodeFromFieldsWithTypes)(structs_5.UID.reified(), item.fields.id),
997
- coinMetadataObject: (0, reified_1.decodeFromFieldsWithTypes)(structs_5.ID.reified(), item.fields.coin_metadata_object),
998
- denyCapObject: (0, reified_1.decodeFromFieldsWithTypes)(structs_5.ID.reified(), item.fields.deny_cap_object),
999
- });
1000
- };
1001
- RegulatedCoinMetadata.fromBcs = function (typeArg, data) {
1002
- return RegulatedCoinMetadata.fromFields(typeArg, RegulatedCoinMetadata.bcs.parse(data));
1003
- };
1004
- RegulatedCoinMetadata.prototype.toJSONField = function () {
1005
- return {
1006
- id: this.id,
1007
- coinMetadataObject: this.coinMetadataObject,
1008
- denyCapObject: this.denyCapObject,
1009
- };
1010
- };
1011
- RegulatedCoinMetadata.prototype.toJSON = function () {
1012
- return __assign({ $typeName: this.$typeName, $typeArgs: this.$typeArgs }, this.toJSONField());
1013
- };
1014
- RegulatedCoinMetadata.fromJSONField = function (typeArg, field) {
1015
- return RegulatedCoinMetadata.reified(typeArg).new({
1016
- id: (0, reified_1.decodeFromJSONField)(structs_5.UID.reified(), field.id),
1017
- coinMetadataObject: (0, reified_1.decodeFromJSONField)(structs_5.ID.reified(), field.coinMetadataObject),
1018
- denyCapObject: (0, reified_1.decodeFromJSONField)(structs_5.ID.reified(), field.denyCapObject),
1019
- });
1020
- };
1021
- RegulatedCoinMetadata.fromJSON = function (typeArg, json) {
1022
- if (json.$typeName !== RegulatedCoinMetadata.$typeName) {
1023
- throw new Error("not a WithTwoGenerics json object");
1024
- }
1025
- (0, reified_1.assertReifiedTypeArgsMatch)((0, util_1.composeSuiType)(RegulatedCoinMetadata.$typeName, (0, reified_1.extractType)(typeArg)), json.$typeArgs, [typeArg]);
1026
- return RegulatedCoinMetadata.fromJSONField(typeArg, json);
1027
- };
1028
- RegulatedCoinMetadata.fromSuiParsedData = function (typeArg, content) {
1029
- if (content.dataType !== "moveObject") {
1030
- throw new Error("not an object");
1031
- }
1032
- if (!isRegulatedCoinMetadata(content.type)) {
1033
- throw new Error("object at ".concat(content.fields.id, " is not a RegulatedCoinMetadata object"));
1034
- }
1035
- return RegulatedCoinMetadata.fromFieldsWithTypes(typeArg, content);
1036
- };
1037
- RegulatedCoinMetadata.fromSuiObjectData = function (typeArg, data) {
1038
- if (data.bcs) {
1039
- if (data.bcs.dataType !== "moveObject" || !isRegulatedCoinMetadata(data.bcs.type)) {
1040
- throw new Error("object at is not a RegulatedCoinMetadata object");
1041
- }
1042
- var gotTypeArgs = (0, util_1.parseTypeName)(data.bcs.type).typeArgs;
1043
- if (gotTypeArgs.length !== 1) {
1044
- throw new Error("type argument mismatch: expected 1 type argument but got '".concat(gotTypeArgs.length, "'"));
1045
- }
1046
- var gotTypeArg = (0, util_1.compressSuiType)(gotTypeArgs[0]);
1047
- var expectedTypeArg = (0, util_1.compressSuiType)((0, reified_1.extractType)(typeArg));
1048
- if (gotTypeArg !== (0, util_1.compressSuiType)((0, reified_1.extractType)(typeArg))) {
1049
- throw new Error("type argument mismatch: expected '".concat(expectedTypeArg, "' but got '").concat(gotTypeArg, "'"));
1050
- }
1051
- return RegulatedCoinMetadata.fromBcs(typeArg, (0, utils_1.fromB64)(data.bcs.bcsBytes));
1052
- }
1053
- if (data.content) {
1054
- return RegulatedCoinMetadata.fromSuiParsedData(typeArg, data.content);
1055
- }
1056
- throw new Error("Both `bcs` and `content` fields are missing from the data. Include `showBcs` or `showContent` in the request.");
1057
- };
1058
- RegulatedCoinMetadata.fetch = function (client, typeArg, id) {
1059
- return __awaiter(this, void 0, void 0, function () {
1060
- var res;
1061
- var _a, _b;
1062
- return __generator(this, function (_c) {
1063
- switch (_c.label) {
1064
- case 0: return [4 /*yield*/, client.getObject({ id: id, options: { showBcs: true } })];
1065
- case 1:
1066
- res = _c.sent();
1067
- if (res.error) {
1068
- throw new Error("error fetching RegulatedCoinMetadata object at id ".concat(id, ": ").concat(res.error.code));
1069
- }
1070
- if (((_b = (_a = res.data) === null || _a === void 0 ? void 0 : _a.bcs) === null || _b === void 0 ? void 0 : _b.dataType) !== "moveObject" || !isRegulatedCoinMetadata(res.data.bcs.type)) {
1071
- throw new Error("object at id ".concat(id, " is not a RegulatedCoinMetadata object"));
1072
- }
1073
- return [2 /*return*/, RegulatedCoinMetadata.fromSuiObjectData(typeArg, res.data)];
1074
- }
1075
- });
1076
- });
1077
- };
1078
- RegulatedCoinMetadata.$typeName = "".concat(index_1.PKG_V26, "::coin::RegulatedCoinMetadata");
1079
- RegulatedCoinMetadata.$numTypeParams = 1;
1080
- RegulatedCoinMetadata.$isPhantom = [true];
1081
- return RegulatedCoinMetadata;
1082
- }());
1083
- exports.RegulatedCoinMetadata = RegulatedCoinMetadata;
1084
- /* ============================== TreasuryCap =============================== */
1085
- function isTreasuryCap(type) {
1086
- type = (0, util_1.compressSuiType)(type);
1087
- return type.startsWith("".concat(index_1.PKG_V26, "::coin::TreasuryCap") + "<");
1088
- }
1089
- var TreasuryCap = /** @class */ (function () {
1090
- function TreasuryCap(typeArgs, fields) {
1091
- this.__StructClass = true;
1092
- this.$typeName = TreasuryCap.$typeName;
1093
- this.$isPhantom = TreasuryCap.$isPhantom;
1094
- this.$fullTypeName = util_1.composeSuiType.apply(void 0, __spreadArray([TreasuryCap.$typeName], __read(typeArgs), false));
1095
- this.$typeArgs = typeArgs;
1096
- this.id = fields.id;
1097
- this.totalSupply = fields.totalSupply;
1098
- }
1099
- TreasuryCap.reified = function (T) {
1100
- var _this = this;
1101
- return {
1102
- typeName: TreasuryCap.$typeName,
1103
- fullTypeName: util_1.composeSuiType.apply(void 0, __spreadArray([TreasuryCap.$typeName], [(0, reified_1.extractType)(T)], false)),
1104
- typeArgs: [(0, reified_1.extractType)(T)],
1105
- isPhantom: TreasuryCap.$isPhantom,
1106
- reifiedTypeArgs: [T],
1107
- fromFields: function (fields) { return TreasuryCap.fromFields(T, fields); },
1108
- fromFieldsWithTypes: function (item) { return TreasuryCap.fromFieldsWithTypes(T, item); },
1109
- fromBcs: function (data) { return TreasuryCap.fromBcs(T, data); },
1110
- bcs: TreasuryCap.bcs,
1111
- fromJSONField: function (field) { return TreasuryCap.fromJSONField(T, field); },
1112
- fromJSON: function (json) { return TreasuryCap.fromJSON(T, json); },
1113
- fromSuiParsedData: function (content) { return TreasuryCap.fromSuiParsedData(T, content); },
1114
- fromSuiObjectData: function (content) { return TreasuryCap.fromSuiObjectData(T, content); },
1115
- fetch: function (client, id) { return __awaiter(_this, void 0, void 0, function () { return __generator(this, function (_a) {
1116
- return [2 /*return*/, TreasuryCap.fetch(client, T, id)];
1117
- }); }); },
1118
- new: function (fields) {
1119
- return new TreasuryCap([(0, reified_1.extractType)(T)], fields);
1120
- },
1121
- kind: "StructClassReified",
1122
- };
1123
- };
1124
- Object.defineProperty(TreasuryCap, "r", {
1125
- get: function () {
1126
- return TreasuryCap.reified;
1127
- },
1128
- enumerable: false,
1129
- configurable: true
1130
- });
1131
- TreasuryCap.phantom = function (T) {
1132
- return (0, reified_1.phantom)(TreasuryCap.reified(T));
1133
- };
1134
- Object.defineProperty(TreasuryCap, "p", {
1135
- get: function () {
1136
- return TreasuryCap.phantom;
1137
- },
1138
- enumerable: false,
1139
- configurable: true
1140
- });
1141
- Object.defineProperty(TreasuryCap, "bcs", {
1142
- get: function () {
1143
- return bcs_1.bcs.struct("TreasuryCap", {
1144
- id: structs_5.UID.bcs,
1145
- total_supply: structs_4.Supply.bcs,
1146
- });
1147
- },
1148
- enumerable: false,
1149
- configurable: true
1150
- });
1151
- TreasuryCap.fromFields = function (typeArg, fields) {
1152
- return TreasuryCap.reified(typeArg).new({
1153
- id: (0, reified_1.decodeFromFields)(structs_5.UID.reified(), fields.id),
1154
- totalSupply: (0, reified_1.decodeFromFields)(structs_4.Supply.reified(typeArg), fields.total_supply),
1155
- });
1156
- };
1157
- TreasuryCap.fromFieldsWithTypes = function (typeArg, item) {
1158
- if (!isTreasuryCap(item.type)) {
1159
- throw new Error("not a TreasuryCap type");
1160
- }
1161
- (0, reified_1.assertFieldsWithTypesArgsMatch)(item, [typeArg]);
1162
- return TreasuryCap.reified(typeArg).new({
1163
- id: (0, reified_1.decodeFromFieldsWithTypes)(structs_5.UID.reified(), item.fields.id),
1164
- totalSupply: (0, reified_1.decodeFromFieldsWithTypes)(structs_4.Supply.reified(typeArg), item.fields.total_supply),
1165
- });
1166
- };
1167
- TreasuryCap.fromBcs = function (typeArg, data) {
1168
- return TreasuryCap.fromFields(typeArg, TreasuryCap.bcs.parse(data));
1169
- };
1170
- TreasuryCap.prototype.toJSONField = function () {
1171
- return {
1172
- id: this.id,
1173
- totalSupply: this.totalSupply.toJSONField(),
1174
- };
1175
- };
1176
- TreasuryCap.prototype.toJSON = function () {
1177
- return __assign({ $typeName: this.$typeName, $typeArgs: this.$typeArgs }, this.toJSONField());
1178
- };
1179
- TreasuryCap.fromJSONField = function (typeArg, field) {
1180
- return TreasuryCap.reified(typeArg).new({
1181
- id: (0, reified_1.decodeFromJSONField)(structs_5.UID.reified(), field.id),
1182
- totalSupply: (0, reified_1.decodeFromJSONField)(structs_4.Supply.reified(typeArg), field.totalSupply),
1183
- });
1184
- };
1185
- TreasuryCap.fromJSON = function (typeArg, json) {
1186
- if (json.$typeName !== TreasuryCap.$typeName) {
1187
- throw new Error("not a WithTwoGenerics json object");
1188
- }
1189
- (0, reified_1.assertReifiedTypeArgsMatch)((0, util_1.composeSuiType)(TreasuryCap.$typeName, (0, reified_1.extractType)(typeArg)), json.$typeArgs, [typeArg]);
1190
- return TreasuryCap.fromJSONField(typeArg, json);
1191
- };
1192
- TreasuryCap.fromSuiParsedData = function (typeArg, content) {
1193
- if (content.dataType !== "moveObject") {
1194
- throw new Error("not an object");
1195
- }
1196
- if (!isTreasuryCap(content.type)) {
1197
- throw new Error("object at ".concat(content.fields.id, " is not a TreasuryCap object"));
1198
- }
1199
- return TreasuryCap.fromFieldsWithTypes(typeArg, content);
1200
- };
1201
- TreasuryCap.fromSuiObjectData = function (typeArg, data) {
1202
- if (data.bcs) {
1203
- if (data.bcs.dataType !== "moveObject" || !isTreasuryCap(data.bcs.type)) {
1204
- throw new Error("object at is not a TreasuryCap object");
1205
- }
1206
- var gotTypeArgs = (0, util_1.parseTypeName)(data.bcs.type).typeArgs;
1207
- if (gotTypeArgs.length !== 1) {
1208
- throw new Error("type argument mismatch: expected 1 type argument but got '".concat(gotTypeArgs.length, "'"));
1209
- }
1210
- var gotTypeArg = (0, util_1.compressSuiType)(gotTypeArgs[0]);
1211
- var expectedTypeArg = (0, util_1.compressSuiType)((0, reified_1.extractType)(typeArg));
1212
- if (gotTypeArg !== (0, util_1.compressSuiType)((0, reified_1.extractType)(typeArg))) {
1213
- throw new Error("type argument mismatch: expected '".concat(expectedTypeArg, "' but got '").concat(gotTypeArg, "'"));
1214
- }
1215
- return TreasuryCap.fromBcs(typeArg, (0, utils_1.fromB64)(data.bcs.bcsBytes));
1216
- }
1217
- if (data.content) {
1218
- return TreasuryCap.fromSuiParsedData(typeArg, data.content);
1219
- }
1220
- throw new Error("Both `bcs` and `content` fields are missing from the data. Include `showBcs` or `showContent` in the request.");
1221
- };
1222
- TreasuryCap.fetch = function (client, typeArg, id) {
1223
- return __awaiter(this, void 0, void 0, function () {
1224
- var res;
1225
- var _a, _b;
1226
- return __generator(this, function (_c) {
1227
- switch (_c.label) {
1228
- case 0: return [4 /*yield*/, client.getObject({ id: id, options: { showBcs: true } })];
1229
- case 1:
1230
- res = _c.sent();
1231
- if (res.error) {
1232
- throw new Error("error fetching TreasuryCap object at id ".concat(id, ": ").concat(res.error.code));
1233
- }
1234
- if (((_b = (_a = res.data) === null || _a === void 0 ? void 0 : _a.bcs) === null || _b === void 0 ? void 0 : _b.dataType) !== "moveObject" || !isTreasuryCap(res.data.bcs.type)) {
1235
- throw new Error("object at id ".concat(id, " is not a TreasuryCap object"));
1236
- }
1237
- return [2 /*return*/, TreasuryCap.fromSuiObjectData(typeArg, res.data)];
1238
- }
1239
- });
1240
- });
1241
- };
1242
- TreasuryCap.$typeName = "".concat(index_1.PKG_V26, "::coin::TreasuryCap");
1243
- TreasuryCap.$numTypeParams = 1;
1244
- TreasuryCap.$isPhantom = [true];
1245
- return TreasuryCap;
1246
- }());
1247
- exports.TreasuryCap = TreasuryCap;