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

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (249) hide show
  1. package/dist/src/api/sentio.js +604 -538
  2. package/dist/src/client.d.ts +27 -0
  3. package/dist/src/client.js +108 -0
  4. package/dist/src/fetch.d.ts +160 -34
  5. package/dist/src/fetch.js +365 -665
  6. package/dist/src/generated/typus_perp/admin.d.ts +117 -0
  7. package/dist/src/generated/typus_perp/admin.js +110 -0
  8. package/dist/src/generated/typus_perp/competition.d.ts +22 -0
  9. package/dist/src/generated/typus_perp/competition.js +58 -0
  10. package/dist/src/generated/typus_perp/deps/std/type_name.d.ts +17 -0
  11. package/dist/src/generated/typus_perp/deps/std/type_name.js +25 -0
  12. package/dist/src/generated/typus_perp/deps/sui/balance.d.ts +12 -0
  13. package/dist/src/generated/typus_perp/deps/sui/balance.js +20 -0
  14. package/dist/src/generated/typus_perp/deps/sui/object.d.ts +8 -0
  15. package/dist/src/generated/typus_perp/deps/sui/object.js +16 -0
  16. package/dist/src/generated/typus_perp/deps/sui/object_table.d.ts +19 -0
  17. package/dist/src/generated/typus_perp/deps/sui/object_table.js +59 -0
  18. package/dist/src/generated/typus_perp/deps/sui/vec_set.d.ts +18 -0
  19. package/dist/src/generated/typus_perp/deps/sui/vec_set.js +25 -0
  20. package/dist/src/generated/typus_perp/deps/typus/keyed_big_vector.d.ts +30 -0
  21. package/dist/src/generated/typus_perp/deps/typus/keyed_big_vector.js +67 -0
  22. package/dist/src/generated/typus_perp/deps/typus/linked_object_table.d.ts +32 -0
  23. package/dist/src/generated/typus_perp/deps/typus/linked_object_table.js +71 -0
  24. package/dist/src/generated/typus_perp/deps/typus_framework/vault.d.ts +23 -0
  25. package/dist/src/generated/typus_perp/deps/typus_framework/vault.js +61 -0
  26. package/dist/src/generated/typus_perp/escrow.d.ts +59 -0
  27. package/dist/src/generated/typus_perp/escrow.js +76 -0
  28. package/dist/src/generated/typus_perp/lending.d.ts +47 -0
  29. package/dist/src/generated/typus_perp/lending.js +50 -0
  30. package/dist/src/generated/typus_perp/lp_pool.d.ts +2327 -0
  31. package/dist/src/generated/typus_perp/lp_pool.js +1956 -0
  32. package/dist/src/generated/typus_perp/math.d.ts +95 -0
  33. package/dist/src/generated/typus_perp/math.js +97 -0
  34. package/dist/src/generated/typus_perp/position.d.ts +234 -0
  35. package/dist/src/generated/typus_perp/position.js +204 -0
  36. package/dist/src/generated/typus_perp/symbol.d.ts +18 -0
  37. package/dist/src/generated/typus_perp/symbol.js +55 -0
  38. package/dist/src/generated/typus_perp/tlp.d.ts +13 -0
  39. package/dist/src/generated/typus_perp/tlp.js +56 -0
  40. package/dist/src/generated/typus_perp/trading.d.ts +2486 -0
  41. package/dist/src/generated/typus_perp/trading.js +2476 -0
  42. package/dist/src/generated/typus_perp/treasury_caps.d.ts +13 -0
  43. package/dist/src/{_framework/init-loader.js → generated/typus_perp/treasury_caps.js} +17 -10
  44. package/dist/src/generated/typus_perp/user_account.d.ts +40 -0
  45. package/dist/src/generated/typus_perp/user_account.js +72 -0
  46. package/dist/src/generated/typus_stake_pool/admin.d.ts +100 -0
  47. package/dist/src/generated/typus_stake_pool/admin.js +91 -0
  48. package/dist/src/generated/typus_stake_pool/deps/std/type_name.d.ts +17 -0
  49. package/dist/src/generated/typus_stake_pool/deps/std/type_name.js +25 -0
  50. package/dist/src/generated/typus_stake_pool/deps/sui/object.d.ts +8 -0
  51. package/dist/src/generated/typus_stake_pool/deps/sui/object.js +16 -0
  52. package/dist/src/generated/typus_stake_pool/deps/sui/vec_map.d.ts +30 -0
  53. package/dist/src/generated/typus_stake_pool/deps/sui/vec_map.js +37 -0
  54. package/dist/src/generated/typus_stake_pool/deps/sui/vec_set.d.ts +18 -0
  55. package/dist/src/generated/typus_stake_pool/deps/sui/vec_set.js +25 -0
  56. package/dist/src/generated/typus_stake_pool/stake_pool.d.ts +1023 -0
  57. package/dist/src/generated/typus_stake_pool/stake_pool.js +918 -0
  58. package/dist/src/generated/utils/index.d.ts +11 -0
  59. package/dist/src/generated/utils/index.js +135 -0
  60. package/dist/src/grpc/graphql.d.ts +26 -0
  61. package/dist/src/grpc/graphql.js +126 -0
  62. package/dist/src/grpc/grpc.d.ts +1 -0
  63. package/dist/src/grpc/grpc.js +38 -0
  64. package/dist/src/grpc/ledgerService.js +64 -0
  65. package/dist/src/grpc/liveDataService.d.ts +0 -0
  66. package/dist/src/grpc/liveDataService.js +49 -0
  67. package/dist/src/index.d.ts +0 -4
  68. package/dist/src/index.js +20 -39
  69. package/dist/src/user/history.js +611 -680
  70. package/dist/src/user/order.d.ts +11 -11
  71. package/dist/src/user/order.js +171 -302
  72. package/dist/src/user/orderWithBidReceipt.d.ts +8 -6
  73. package/dist/src/user/orderWithBidReceipt.js +127 -226
  74. package/dist/src/user/tlp.d.ts +32 -23
  75. package/dist/src/user/tlp.js +316 -468
  76. package/package.json +44 -36
  77. package/dist/src/_dependencies/source/0x1/ascii/structs.d.ts +0 -88
  78. package/dist/src/_dependencies/source/0x1/ascii/structs.js +0 -398
  79. package/dist/src/_dependencies/source/0x1/index.d.ts +0 -3
  80. package/dist/src/_dependencies/source/0x1/index.js +0 -6
  81. package/dist/src/_dependencies/source/0x1/option/structs.d.ts +0 -50
  82. package/dist/src/_dependencies/source/0x1/option/structs.js +0 -271
  83. package/dist/src/_dependencies/source/0x1/string/structs.d.ts +0 -48
  84. package/dist/src/_dependencies/source/0x1/string/structs.js +0 -256
  85. package/dist/src/_dependencies/source/0x1/type-name/structs.d.ts +0 -49
  86. package/dist/src/_dependencies/source/0x1/type-name/structs.js +0 -223
  87. package/dist/src/_dependencies/source/0x2/bag/structs.d.ts +0 -54
  88. package/dist/src/_dependencies/source/0x2/bag/structs.js +0 -229
  89. package/dist/src/_dependencies/source/0x2/balance/structs.d.ts +0 -84
  90. package/dist/src/_dependencies/source/0x2/balance/structs.js +0 -386
  91. package/dist/src/_dependencies/source/0x2/coin/structs.d.ts +0 -406
  92. package/dist/src/_dependencies/source/0x2/coin/structs.js +0 -1247
  93. package/dist/src/_dependencies/source/0x2/index.d.ts +0 -3
  94. package/dist/src/_dependencies/source/0x2/index.js +0 -6
  95. package/dist/src/_dependencies/source/0x2/linked-table/structs.d.ts +0 -132
  96. package/dist/src/_dependencies/source/0x2/linked-table/structs.js +0 -438
  97. package/dist/src/_dependencies/source/0x2/object/structs.d.ts +0 -86
  98. package/dist/src/_dependencies/source/0x2/object/structs.js +0 -364
  99. package/dist/src/_dependencies/source/0x2/object-table/structs.d.ts +0 -54
  100. package/dist/src/_dependencies/source/0x2/object-table/structs.js +0 -248
  101. package/dist/src/_dependencies/source/0x2/sui/structs.d.ts +0 -44
  102. package/dist/src/_dependencies/source/0x2/sui/structs.js +0 -222
  103. package/dist/src/_dependencies/source/0x2/table/structs.d.ts +0 -54
  104. package/dist/src/_dependencies/source/0x2/table/structs.js +0 -248
  105. package/dist/src/_dependencies/source/0x2/table-vec/structs.d.ts +0 -59
  106. package/dist/src/_dependencies/source/0x2/table-vec/structs.js +0 -274
  107. package/dist/src/_dependencies/source/0x2/token/structs.d.ts +0 -421
  108. package/dist/src/_dependencies/source/0x2/token/structs.js +0 -1095
  109. package/dist/src/_dependencies/source/0x2/transfer-policy/structs.d.ts +0 -348
  110. package/dist/src/_dependencies/source/0x2/transfer-policy/structs.js +0 -1091
  111. package/dist/src/_dependencies/source/0x2/url/structs.d.ts +0 -49
  112. package/dist/src/_dependencies/source/0x2/url/structs.js +0 -223
  113. package/dist/src/_dependencies/source/0x2/vec-map/structs.d.ts +0 -106
  114. package/dist/src/_dependencies/source/0x2/vec-map/structs.js +0 -446
  115. package/dist/src/_dependencies/source/0x2/vec-set/structs.d.ts +0 -49
  116. package/dist/src/_dependencies/source/0x2/vec-set/structs.js +0 -270
  117. package/dist/src/_dependencies/source/0x4b0f4ee1a40ce37ec81c987cc4e76a665419e74b863319492fc7d26f708b835a/airdrop/structs.d.ts +0 -422
  118. package/dist/src/_dependencies/source/0x4b0f4ee1a40ce37ec81c987cc4e76a665419e74b863319492fc7d26f708b835a/airdrop/structs.js +0 -1084
  119. package/dist/src/_dependencies/source/0x4b0f4ee1a40ce37ec81c987cc4e76a665419e74b863319492fc7d26f708b835a/big-vector/structs.d.ts +0 -130
  120. package/dist/src/_dependencies/source/0x4b0f4ee1a40ce37ec81c987cc4e76a665419e74b863319492fc7d26f708b835a/big-vector/structs.js +0 -456
  121. package/dist/src/_dependencies/source/0x4b0f4ee1a40ce37ec81c987cc4e76a665419e74b863319492fc7d26f708b835a/critbit/structs.d.ts +0 -208
  122. package/dist/src/_dependencies/source/0x4b0f4ee1a40ce37ec81c987cc4e76a665419e74b863319492fc7d26f708b835a/critbit/structs.js +0 -653
  123. package/dist/src/_dependencies/source/0x4b0f4ee1a40ce37ec81c987cc4e76a665419e74b863319492fc7d26f708b835a/ecosystem/structs.d.ts +0 -362
  124. package/dist/src/_dependencies/source/0x4b0f4ee1a40ce37ec81c987cc4e76a665419e74b863319492fc7d26f708b835a/ecosystem/structs.js +0 -899
  125. package/dist/src/_dependencies/source/0x4b0f4ee1a40ce37ec81c987cc4e76a665419e74b863319492fc7d26f708b835a/index.d.ts +0 -8
  126. package/dist/src/_dependencies/source/0x4b0f4ee1a40ce37ec81c987cc4e76a665419e74b863319492fc7d26f708b835a/index.js +0 -11
  127. package/dist/src/_dependencies/source/0x4b0f4ee1a40ce37ec81c987cc4e76a665419e74b863319492fc7d26f708b835a/init.d.ts +0 -2
  128. package/dist/src/_dependencies/source/0x4b0f4ee1a40ce37ec81c987cc4e76a665419e74b863319492fc7d26f708b835a/init.js +0 -102
  129. package/dist/src/_dependencies/source/0x4b0f4ee1a40ce37ec81c987cc4e76a665419e74b863319492fc7d26f708b835a/keyed-big-vector/structs.d.ts +0 -202
  130. package/dist/src/_dependencies/source/0x4b0f4ee1a40ce37ec81c987cc4e76a665419e74b863319492fc7d26f708b835a/keyed-big-vector/structs.js +0 -632
  131. package/dist/src/_dependencies/source/0x4b0f4ee1a40ce37ec81c987cc4e76a665419e74b863319492fc7d26f708b835a/leaderboard/structs.d.ts +0 -600
  132. package/dist/src/_dependencies/source/0x4b0f4ee1a40ce37ec81c987cc4e76a665419e74b863319492fc7d26f708b835a/leaderboard/structs.js +0 -1459
  133. package/dist/src/_dependencies/source/0x4b0f4ee1a40ce37ec81c987cc4e76a665419e74b863319492fc7d26f708b835a/linked-object-table/structs.d.ts +0 -136
  134. package/dist/src/_dependencies/source/0x4b0f4ee1a40ce37ec81c987cc4e76a665419e74b863319492fc7d26f708b835a/linked-object-table/structs.js +0 -438
  135. package/dist/src/_dependencies/source/0x4b0f4ee1a40ce37ec81c987cc4e76a665419e74b863319492fc7d26f708b835a/linked-set/structs.d.ts +0 -127
  136. package/dist/src/_dependencies/source/0x4b0f4ee1a40ce37ec81c987cc4e76a665419e74b863319492fc7d26f708b835a/linked-set/structs.js +0 -430
  137. package/dist/src/_dependencies/source/0x4b0f4ee1a40ce37ec81c987cc4e76a665419e74b863319492fc7d26f708b835a/tails-staking/structs.d.ts +0 -957
  138. package/dist/src/_dependencies/source/0x4b0f4ee1a40ce37ec81c987cc4e76a665419e74b863319492fc7d26f708b835a/tails-staking/structs.js +0 -2261
  139. package/dist/src/_dependencies/source/0x4b0f4ee1a40ce37ec81c987cc4e76a665419e74b863319492fc7d26f708b835a/tgld/structs.d.ts +0 -244
  140. package/dist/src/_dependencies/source/0x4b0f4ee1a40ce37ec81c987cc4e76a665419e74b863319492fc7d26f708b835a/tgld/structs.js +0 -733
  141. package/dist/src/_dependencies/source/0x4b0f4ee1a40ce37ec81c987cc4e76a665419e74b863319492fc7d26f708b835a/user/structs.d.ts +0 -294
  142. package/dist/src/_dependencies/source/0x4b0f4ee1a40ce37ec81c987cc4e76a665419e74b863319492fc7d26f708b835a/user/structs.js +0 -892
  143. package/dist/src/_dependencies/source/0xb4f25230ba74837d8299e92951306100c4a532e8c48cc3d8828abe9b91c8b274/authority/structs.d.ts +0 -73
  144. package/dist/src/_dependencies/source/0xb4f25230ba74837d8299e92951306100c4a532e8c48cc3d8828abe9b91c8b274/authority/structs.js +0 -263
  145. package/dist/src/_dependencies/source/0xb4f25230ba74837d8299e92951306100c4a532e8c48cc3d8828abe9b91c8b274/balance-pool/structs.d.ts +0 -294
  146. package/dist/src/_dependencies/source/0xb4f25230ba74837d8299e92951306100c4a532e8c48cc3d8828abe9b91c8b274/balance-pool/structs.js +0 -591
  147. package/dist/src/_dependencies/source/0xb4f25230ba74837d8299e92951306100c4a532e8c48cc3d8828abe9b91c8b274/big-vector/structs.d.ts +0 -64
  148. package/dist/src/_dependencies/source/0xb4f25230ba74837d8299e92951306100c4a532e8c48cc3d8828abe9b91c8b274/big-vector/structs.js +0 -258
  149. package/dist/src/_dependencies/source/0xb4f25230ba74837d8299e92951306100c4a532e8c48cc3d8828abe9b91c8b274/dutch/structs.d.ts +0 -756
  150. package/dist/src/_dependencies/source/0xb4f25230ba74837d8299e92951306100c4a532e8c48cc3d8828abe9b91c8b274/dutch/structs.js +0 -1721
  151. package/dist/src/_dependencies/source/0xb4f25230ba74837d8299e92951306100c4a532e8c48cc3d8828abe9b91c8b274/i64/structs.d.ts +0 -44
  152. package/dist/src/_dependencies/source/0xb4f25230ba74837d8299e92951306100c4a532e8c48cc3d8828abe9b91c8b274/i64/structs.js +0 -222
  153. package/dist/src/_dependencies/source/0xb4f25230ba74837d8299e92951306100c4a532e8c48cc3d8828abe9b91c8b274/index.d.ts +0 -3
  154. package/dist/src/_dependencies/source/0xb4f25230ba74837d8299e92951306100c4a532e8c48cc3d8828abe9b91c8b274/index.js +0 -6
  155. package/dist/src/_dependencies/source/0xb4f25230ba74837d8299e92951306100c4a532e8c48cc3d8828abe9b91c8b274/init.d.ts +0 -2
  156. package/dist/src/_dependencies/source/0xb4f25230ba74837d8299e92951306100c4a532e8c48cc3d8828abe9b91c8b274/init.js +0 -89
  157. package/dist/src/_dependencies/source/0xb4f25230ba74837d8299e92951306100c4a532e8c48cc3d8828abe9b91c8b274/linked-list/structs.d.ts +0 -135
  158. package/dist/src/_dependencies/source/0xb4f25230ba74837d8299e92951306100c4a532e8c48cc3d8828abe9b91c8b274/linked-list/structs.js +0 -444
  159. package/dist/src/_dependencies/source/0xb4f25230ba74837d8299e92951306100c4a532e8c48cc3d8828abe9b91c8b274/vault/structs.d.ts +0 -2106
  160. package/dist/src/_dependencies/source/0xb4f25230ba74837d8299e92951306100c4a532e8c48cc3d8828abe9b91c8b274/vault/structs.js +0 -4952
  161. package/dist/src/_dependencies/source/0xbd147bc7f12f38f175d78947a61364e8e077b9b188b00e7094bc0c3623162196/discount-mint/structs.d.ts +0 -390
  162. package/dist/src/_dependencies/source/0xbd147bc7f12f38f175d78947a61364e8e077b9b188b00e7094bc0c3623162196/discount-mint/structs.js +0 -844
  163. package/dist/src/_dependencies/source/0xbd147bc7f12f38f175d78947a61364e8e077b9b188b00e7094bc0c3623162196/index.d.ts +0 -6
  164. package/dist/src/_dependencies/source/0xbd147bc7f12f38f175d78947a61364e8e077b9b188b00e7094bc0c3623162196/index.js +0 -9
  165. package/dist/src/_dependencies/source/0xbd147bc7f12f38f175d78947a61364e8e077b9b188b00e7094bc0c3623162196/init.d.ts +0 -2
  166. package/dist/src/_dependencies/source/0xbd147bc7f12f38f175d78947a61364e8e077b9b188b00e7094bc0c3623162196/init.js +0 -69
  167. package/dist/src/_dependencies/source/0xbd147bc7f12f38f175d78947a61364e8e077b9b188b00e7094bc0c3623162196/royalty-rule/structs.d.ts +0 -89
  168. package/dist/src/_dependencies/source/0xbd147bc7f12f38f175d78947a61364e8e077b9b188b00e7094bc0c3623162196/royalty-rule/structs.js +0 -376
  169. package/dist/src/_dependencies/source/0xbd147bc7f12f38f175d78947a61364e8e077b9b188b00e7094bc0c3623162196/staking/structs.d.ts +0 -386
  170. package/dist/src/_dependencies/source/0xbd147bc7f12f38f175d78947a61364e8e077b9b188b00e7094bc0c3623162196/staking/structs.js +0 -881
  171. package/dist/src/_dependencies/source/0xbd147bc7f12f38f175d78947a61364e8e077b9b188b00e7094bc0c3623162196/table-vec/structs.d.ts +0 -59
  172. package/dist/src/_dependencies/source/0xbd147bc7f12f38f175d78947a61364e8e077b9b188b00e7094bc0c3623162196/table-vec/structs.js +0 -274
  173. package/dist/src/_dependencies/source/0xbd147bc7f12f38f175d78947a61364e8e077b9b188b00e7094bc0c3623162196/typus-nft/structs.d.ts +0 -974
  174. package/dist/src/_dependencies/source/0xbd147bc7f12f38f175d78947a61364e8e077b9b188b00e7094bc0c3623162196/typus-nft/structs.js +0 -2387
  175. package/dist/src/_framework/init-loader.d.ts +0 -2
  176. package/dist/src/_framework/loader.d.ts +0 -17
  177. package/dist/src/_framework/loader.js +0 -108
  178. package/dist/src/_framework/reified.d.ts +0 -108
  179. package/dist/src/_framework/reified.js +0 -237
  180. package/dist/src/_framework/util.d.ts +0 -35
  181. package/dist/src/_framework/util.js +0 -396
  182. package/dist/src/_framework/vector.d.ts +0 -42
  183. package/dist/src/_framework/vector.js +0 -112
  184. package/dist/src/pyth.js +0 -1
  185. package/dist/src/typus_perp/admin/functions.d.ts +0 -59
  186. package/dist/src/typus_perp/admin/functions.js +0 -122
  187. package/dist/src/typus_perp/admin/structs.d.ts +0 -467
  188. package/dist/src/typus_perp/admin/structs.js +0 -1065
  189. package/dist/src/typus_perp/competition/functions.d.ts +0 -24
  190. package/dist/src/typus_perp/competition/functions.js +0 -38
  191. package/dist/src/typus_perp/competition/structs.d.ts +0 -80
  192. package/dist/src/typus_perp/competition/structs.js +0 -288
  193. package/dist/src/typus_perp/error/functions.d.ts +0 -73
  194. package/dist/src/typus_perp/error/functions.js +0 -363
  195. package/dist/src/typus_perp/escrow/functions.d.ts +0 -17
  196. package/dist/src/typus_perp/escrow/functions.js +0 -36
  197. package/dist/src/typus_perp/escrow/structs.d.ts +0 -160
  198. package/dist/src/typus_perp/escrow/structs.js +0 -324
  199. package/dist/src/typus_perp/index.d.ts +0 -1
  200. package/dist/src/typus_perp/index.js +0 -7
  201. package/dist/src/typus_perp/init.d.ts +0 -2
  202. package/dist/src/typus_perp/init.js +0 -118
  203. package/dist/src/typus_perp/lending/functions.d.ts +0 -15
  204. package/dist/src/typus_perp/lending/functions.js +0 -22
  205. package/dist/src/typus_perp/lp-pool/functions.d.ts +0 -460
  206. package/dist/src/typus_perp/lp-pool/functions.js +0 -732
  207. package/dist/src/typus_perp/lp-pool/structs.d.ts +0 -3705
  208. package/dist/src/typus_perp/lp-pool/structs.js +0 -6789
  209. package/dist/src/typus_perp/math/functions.d.ts +0 -29
  210. package/dist/src/typus_perp/math/functions.js +0 -61
  211. package/dist/src/typus_perp/position/functions.d.ts +0 -379
  212. package/dist/src/typus_perp/position/functions.js +0 -713
  213. package/dist/src/typus_perp/position/structs.d.ts +0 -905
  214. package/dist/src/typus_perp/position/structs.js +0 -1450
  215. package/dist/src/typus_perp/symbol/functions.d.ts +0 -9
  216. package/dist/src/typus_perp/symbol/functions.js +0 -24
  217. package/dist/src/typus_perp/symbol/structs.d.ts +0 -70
  218. package/dist/src/typus_perp/symbol/structs.js +0 -235
  219. package/dist/src/typus_perp/tlp/functions.d.ts +0 -19
  220. package/dist/src/typus_perp/tlp/functions.js +0 -40
  221. package/dist/src/typus_perp/tlp/structs.d.ts +0 -89
  222. package/dist/src/typus_perp/tlp/structs.js +0 -365
  223. package/dist/src/typus_perp/token-interface/functions.d.ts +0 -11
  224. package/dist/src/typus_perp/token-interface/functions.js +0 -22
  225. package/dist/src/typus_perp/trading/functions.d.ts +0 -812
  226. package/dist/src/typus_perp/trading/functions.js +0 -1218
  227. package/dist/src/typus_perp/trading/structs.d.ts +0 -3060
  228. package/dist/src/typus_perp/trading/structs.js +0 -5813
  229. package/dist/src/typus_perp/treasury-caps/functions.d.ts +0 -9
  230. package/dist/src/typus_perp/treasury-caps/functions.js +0 -36
  231. package/dist/src/typus_perp/treasury-caps/structs.d.ts +0 -49
  232. package/dist/src/typus_perp/treasury-caps/structs.js +0 -223
  233. package/dist/src/typus_perp/user-account/functions.d.ts +0 -36
  234. package/dist/src/typus_perp/user-account/functions.js +0 -70
  235. package/dist/src/typus_perp/user-account/structs.d.ts +0 -148
  236. package/dist/src/typus_perp/user-account/structs.js +0 -448
  237. package/dist/src/typus_stake_pool/admin/functions.d.ts +0 -49
  238. package/dist/src/typus_stake_pool/admin/functions.js +0 -105
  239. package/dist/src/typus_stake_pool/admin/structs.d.ts +0 -365
  240. package/dist/src/typus_stake_pool/admin/structs.js +0 -789
  241. package/dist/src/typus_stake_pool/index.d.ts +0 -1
  242. package/dist/src/typus_stake_pool/index.js +0 -7
  243. package/dist/src/typus_stake_pool/init.d.ts +0 -2
  244. package/dist/src/typus_stake_pool/init.js +0 -69
  245. package/dist/src/typus_stake_pool/stake-pool/functions.d.ts +0 -229
  246. package/dist/src/typus_stake_pool/stake-pool/functions.js +0 -380
  247. package/dist/src/typus_stake_pool/stake-pool/structs.d.ts +0 -2199
  248. package/dist/src/typus_stake_pool/stake-pool/structs.js +0 -4653
  249. /package/dist/src/{pyth.d.ts → grpc/ledgerService.d.ts} +0 -0
package/package.json CHANGED
@@ -1,38 +1,46 @@
1
1
  {
2
- "name": "@typus/typus-perp-sdk",
3
- "version": "1.1.30",
4
- "repository": "https://github.com/Typus-Lab/typus-perp-sdk.git",
5
- "author": "Typus",
6
- "description": "typus perp sdk",
7
- "license": "MIT",
8
- "dependencies": {
9
- "@typus/typus-sdk": "1.8.21"
10
- },
11
- "devDependencies": {
12
- "@types/bs58": "^4.0.1",
13
- "@types/camelcase-keys-deep": "^0.1.2",
14
- "@types/expect": "^24.3.0",
15
- "@types/mocha": "^10.0.1",
16
- "@types/rx": "^4.1.2",
17
- "prettier": "^3.0.0",
18
- "ts-node": "^10.9.2",
19
- "tsc-alias": "^1.8.10",
20
- "tsconfig-paths": "^4.2.0",
21
- "tslint": "^6.1.3",
22
- "tslint-config-prettier": "^1.18.0",
23
- "typescript": "^5.1.6"
24
- },
25
- "main": "dist/src/index.js",
26
- "types": "dist/src/index.d.ts",
27
- "files": [
28
- "dist"
29
- ],
30
- "scripts": {
31
- "build": "rm -rf dist && tsc -p tsconfig.build.json && tsc-alias"
32
- },
33
- "bugs": {
34
- "url": "https://github.com/Typus-Lab/typus-perp-sdk/issues"
35
- },
36
- "homepage": "https://github.com/Typus-Lab/typus-perp-sdk#readme",
37
- "packageManager": "yarn@4.10.3+sha512.c38cafb5c7bb273f3926d04e55e1d8c9dfa7d9c3ea1f36a4868fa028b9e5f72298f0b7f401ad5eb921749eb012eb1c3bb74bf7503df3ee43fd600d14a018266f"
2
+ "name": "@typus/typus-perp-sdk",
3
+ "version": "1.1.31-codegen",
4
+ "repository": "https://github.com/Typus-Lab/typus-perp-sdk.git",
5
+ "author": "Typus",
6
+ "description": "typus perp sdk",
7
+ "license": "MIT",
8
+ "dependencies": {
9
+ "@mysten/bcs": "1.9.2",
10
+ "@mysten/sui": "1.44.0",
11
+ "@typus/typus-sdk": "1.8.21"
12
+ },
13
+ "resolutions": {
14
+ "@mysten/bcs": "1.9.2",
15
+ "@mysten/sui": "1.44.0"
16
+ },
17
+ "devDependencies": {
18
+ "@types/bs58": "^4.0.1",
19
+ "@types/camelcase-keys-deep": "^0.1.2",
20
+ "@types/expect": "^24.3.0",
21
+ "@types/mocha": "^10.0.1",
22
+ "@types/node": "^24.10.1",
23
+ "@types/rx": "^4.1.2",
24
+ "axios": "^1.13.2",
25
+ "prettier": "^3.0.0",
26
+ "ts-node": "^10.9.2",
27
+ "tsc-alias": "^1.8.10",
28
+ "tsconfig-paths": "^4.2.0",
29
+ "tslint": "^6.1.3",
30
+ "tslint-config-prettier": "^1.18.0",
31
+ "typescript": "^5.1.6"
32
+ },
33
+ "main": "dist/src/index.js",
34
+ "types": "dist/src/index.d.ts",
35
+ "files": [
36
+ "dist"
37
+ ],
38
+ "scripts": {
39
+ "build": "rm -rf dist && tsc -p tsconfig.build.json && tsc-alias"
40
+ },
41
+ "bugs": {
42
+ "url": "https://github.com/Typus-Lab/typus-perp-sdk/issues"
43
+ },
44
+ "homepage": "https://github.com/Typus-Lab/typus-perp-sdk#readme",
45
+ "packageManager": "yarn@4.10.3+sha512.c38cafb5c7bb273f3926d04e55e1d8c9dfa7d9c3ea1f36a4868fa028b9e5f72298f0b7f401ad5eb921749eb012eb1c3bb74bf7503df3ee43fd600d14a018266f"
38
46
  }
@@ -1,88 +0,0 @@
1
- import * as reified from "../../../../_framework/reified";
2
- import { PhantomReified, Reified, StructClass, ToField, ToTypeStr } from "../../../../_framework/reified";
3
- import { FieldsWithTypes } from "../../../../_framework/util";
4
- import { Vector } from "../../../../_framework/vector";
5
- import { PKG_V13 } from "../index";
6
- import { SuiClient, SuiObjectData, SuiParsedData } from "@mysten/sui/client";
7
- export declare function isChar(type: string): boolean;
8
- export interface CharFields {
9
- byte: ToField<"u8">;
10
- }
11
- export type CharReified = Reified<Char, CharFields>;
12
- export declare class Char implements StructClass {
13
- __StructClass: true;
14
- static readonly $typeName = "0x1::ascii::Char";
15
- static readonly $numTypeParams = 0;
16
- static readonly $isPhantom: readonly [];
17
- readonly $typeName = "0x1::ascii::Char";
18
- readonly $fullTypeName: `${typeof PKG_V13}::ascii::Char`;
19
- readonly $typeArgs: [];
20
- readonly $isPhantom: readonly [];
21
- readonly byte: ToField<"u8">;
22
- private constructor();
23
- static reified(): CharReified;
24
- static get r(): reified.StructClassReified<Char, CharFields>;
25
- static phantom(): PhantomReified<ToTypeStr<Char>>;
26
- static get p(): reified.PhantomReified<"0x1::ascii::Char">;
27
- static get bcs(): import("@mysten/sui/bcs").BcsStruct<{
28
- byte: import("@mysten/sui/bcs").BcsType<number, number, "u8">;
29
- }, string>;
30
- static fromFields(fields: Record<string, any>): Char;
31
- static fromFieldsWithTypes(item: FieldsWithTypes): Char;
32
- static fromBcs(data: Uint8Array): Char;
33
- toJSONField(): {
34
- byte: number;
35
- };
36
- toJSON(): {
37
- byte: number;
38
- $typeName: string;
39
- $typeArgs: [];
40
- };
41
- static fromJSONField(field: any): Char;
42
- static fromJSON(json: Record<string, any>): Char;
43
- static fromSuiParsedData(content: SuiParsedData): Char;
44
- static fromSuiObjectData(data: SuiObjectData): Char;
45
- static fetch(client: SuiClient, id: string): Promise<Char>;
46
- }
47
- export declare function isString(type: string): boolean;
48
- export interface StringFields {
49
- bytes: ToField<Vector<"u8">>;
50
- }
51
- export type StringReified = Reified<String, StringFields>;
52
- export declare class String implements StructClass {
53
- __StructClass: true;
54
- static readonly $typeName = "0x1::ascii::String";
55
- static readonly $numTypeParams = 0;
56
- static readonly $isPhantom: readonly [];
57
- readonly $typeName = "0x1::ascii::String";
58
- readonly $fullTypeName: `${typeof PKG_V13}::ascii::String`;
59
- readonly $typeArgs: [];
60
- readonly $isPhantom: readonly [];
61
- readonly bytes: ToField<Vector<"u8">>;
62
- private constructor();
63
- static reified(): StringReified;
64
- static get r(): reified.StructClassReified<String, StringFields>;
65
- static phantom(): PhantomReified<ToTypeStr<String>>;
66
- static get p(): reified.PhantomReified<"0x1::ascii::String">;
67
- static get bcs(): import("@mysten/sui/bcs").BcsStruct<{
68
- bytes: import("@mysten/sui/bcs").BcsType<number[], Iterable<number> & {
69
- length: number;
70
- }, string>;
71
- }, string>;
72
- static fromFields(fields: Record<string, any>): String;
73
- static fromFieldsWithTypes(item: FieldsWithTypes): String;
74
- static fromBcs(data: Uint8Array): String;
75
- toJSONField(): {
76
- bytes: number[];
77
- };
78
- toJSON(): {
79
- bytes: number[];
80
- $typeName: string;
81
- $typeArgs: [];
82
- };
83
- static fromJSONField(field: any): String;
84
- static fromJSON(json: Record<string, any>): String;
85
- static fromSuiParsedData(content: SuiParsedData): String;
86
- static fromSuiObjectData(data: SuiObjectData): String;
87
- static fetch(client: SuiClient, id: string): Promise<String>;
88
- }
@@ -1,398 +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.String = exports.Char = void 0;
109
- exports.isChar = isChar;
110
- exports.isString = isString;
111
- var reified = __importStar(require("../../../../_framework/reified"));
112
- var reified_1 = require("../../../../_framework/reified");
113
- var util_1 = require("../../../../_framework/util");
114
- var index_1 = require("../index");
115
- var bcs_1 = require("@mysten/sui/bcs");
116
- var utils_1 = require("@mysten/sui/utils");
117
- /* ============================== Char =============================== */
118
- function isChar(type) {
119
- type = (0, util_1.compressSuiType)(type);
120
- return type === "".concat(index_1.PKG_V13, "::ascii::Char");
121
- }
122
- var Char = /** @class */ (function () {
123
- function Char(typeArgs, fields) {
124
- this.__StructClass = true;
125
- this.$typeName = Char.$typeName;
126
- this.$isPhantom = Char.$isPhantom;
127
- this.$fullTypeName = util_1.composeSuiType.apply(void 0, __spreadArray([Char.$typeName], __read(typeArgs), false));
128
- this.$typeArgs = typeArgs;
129
- this.byte = fields.byte;
130
- }
131
- Char.reified = function () {
132
- var _this = this;
133
- return {
134
- typeName: Char.$typeName,
135
- fullTypeName: util_1.composeSuiType.apply(void 0, __spreadArray([Char.$typeName], [], false)),
136
- typeArgs: [],
137
- isPhantom: Char.$isPhantom,
138
- reifiedTypeArgs: [],
139
- fromFields: function (fields) { return Char.fromFields(fields); },
140
- fromFieldsWithTypes: function (item) { return Char.fromFieldsWithTypes(item); },
141
- fromBcs: function (data) { return Char.fromBcs(data); },
142
- bcs: Char.bcs,
143
- fromJSONField: function (field) { return Char.fromJSONField(field); },
144
- fromJSON: function (json) { return Char.fromJSON(json); },
145
- fromSuiParsedData: function (content) { return Char.fromSuiParsedData(content); },
146
- fromSuiObjectData: function (content) { return Char.fromSuiObjectData(content); },
147
- fetch: function (client, id) { return __awaiter(_this, void 0, void 0, function () { return __generator(this, function (_a) {
148
- return [2 /*return*/, Char.fetch(client, id)];
149
- }); }); },
150
- new: function (fields) {
151
- return new Char([], fields);
152
- },
153
- kind: "StructClassReified",
154
- };
155
- };
156
- Object.defineProperty(Char, "r", {
157
- get: function () {
158
- return Char.reified();
159
- },
160
- enumerable: false,
161
- configurable: true
162
- });
163
- Char.phantom = function () {
164
- return (0, reified_1.phantom)(Char.reified());
165
- };
166
- Object.defineProperty(Char, "p", {
167
- get: function () {
168
- return Char.phantom();
169
- },
170
- enumerable: false,
171
- configurable: true
172
- });
173
- Object.defineProperty(Char, "bcs", {
174
- get: function () {
175
- return bcs_1.bcs.struct("Char", {
176
- byte: bcs_1.bcs.u8(),
177
- });
178
- },
179
- enumerable: false,
180
- configurable: true
181
- });
182
- Char.fromFields = function (fields) {
183
- return Char.reified().new({ byte: (0, reified_1.decodeFromFields)("u8", fields.byte) });
184
- };
185
- Char.fromFieldsWithTypes = function (item) {
186
- if (!isChar(item.type)) {
187
- throw new Error("not a Char type");
188
- }
189
- return Char.reified().new({ byte: (0, reified_1.decodeFromFieldsWithTypes)("u8", item.fields.byte) });
190
- };
191
- Char.fromBcs = function (data) {
192
- return Char.fromFields(Char.bcs.parse(data));
193
- };
194
- Char.prototype.toJSONField = function () {
195
- return {
196
- byte: this.byte,
197
- };
198
- };
199
- Char.prototype.toJSON = function () {
200
- return __assign({ $typeName: this.$typeName, $typeArgs: this.$typeArgs }, this.toJSONField());
201
- };
202
- Char.fromJSONField = function (field) {
203
- return Char.reified().new({ byte: (0, reified_1.decodeFromJSONField)("u8", field.byte) });
204
- };
205
- Char.fromJSON = function (json) {
206
- if (json.$typeName !== Char.$typeName) {
207
- throw new Error("not a WithTwoGenerics json object");
208
- }
209
- return Char.fromJSONField(json);
210
- };
211
- Char.fromSuiParsedData = function (content) {
212
- if (content.dataType !== "moveObject") {
213
- throw new Error("not an object");
214
- }
215
- if (!isChar(content.type)) {
216
- throw new Error("object at ".concat(content.fields.id, " is not a Char object"));
217
- }
218
- return Char.fromFieldsWithTypes(content);
219
- };
220
- Char.fromSuiObjectData = function (data) {
221
- if (data.bcs) {
222
- if (data.bcs.dataType !== "moveObject" || !isChar(data.bcs.type)) {
223
- throw new Error("object at is not a Char object");
224
- }
225
- return Char.fromBcs((0, utils_1.fromB64)(data.bcs.bcsBytes));
226
- }
227
- if (data.content) {
228
- return Char.fromSuiParsedData(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
- Char.fetch = function (client, 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 Char 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" || !isChar(res.data.bcs.type)) {
245
- throw new Error("object at id ".concat(id, " is not a Char object"));
246
- }
247
- return [2 /*return*/, Char.fromSuiObjectData(res.data)];
248
- }
249
- });
250
- });
251
- };
252
- Char.$typeName = "".concat(index_1.PKG_V13, "::ascii::Char");
253
- Char.$numTypeParams = 0;
254
- Char.$isPhantom = [];
255
- return Char;
256
- }());
257
- exports.Char = Char;
258
- /* ============================== String =============================== */
259
- function isString(type) {
260
- type = (0, util_1.compressSuiType)(type);
261
- return type === "".concat(index_1.PKG_V13, "::ascii::String");
262
- }
263
- var String = /** @class */ (function () {
264
- function String(typeArgs, fields) {
265
- this.__StructClass = true;
266
- this.$typeName = String.$typeName;
267
- this.$isPhantom = String.$isPhantom;
268
- this.$fullTypeName = util_1.composeSuiType.apply(void 0, __spreadArray([String.$typeName], __read(typeArgs), false));
269
- this.$typeArgs = typeArgs;
270
- this.bytes = fields.bytes;
271
- }
272
- String.reified = function () {
273
- var _this = this;
274
- return {
275
- typeName: String.$typeName,
276
- fullTypeName: util_1.composeSuiType.apply(void 0, __spreadArray([String.$typeName], [], false)),
277
- typeArgs: [],
278
- isPhantom: String.$isPhantom,
279
- reifiedTypeArgs: [],
280
- fromFields: function (fields) { return String.fromFields(fields); },
281
- fromFieldsWithTypes: function (item) { return String.fromFieldsWithTypes(item); },
282
- fromBcs: function (data) { return String.fromBcs(data); },
283
- bcs: String.bcs,
284
- fromJSONField: function (field) { return String.fromJSONField(field); },
285
- fromJSON: function (json) { return String.fromJSON(json); },
286
- fromSuiParsedData: function (content) { return String.fromSuiParsedData(content); },
287
- fromSuiObjectData: function (content) { return String.fromSuiObjectData(content); },
288
- fetch: function (client, id) { return __awaiter(_this, void 0, void 0, function () { return __generator(this, function (_a) {
289
- return [2 /*return*/, String.fetch(client, id)];
290
- }); }); },
291
- new: function (fields) {
292
- return new String([], fields);
293
- },
294
- kind: "StructClassReified",
295
- };
296
- };
297
- Object.defineProperty(String, "r", {
298
- get: function () {
299
- return String.reified();
300
- },
301
- enumerable: false,
302
- configurable: true
303
- });
304
- String.phantom = function () {
305
- return (0, reified_1.phantom)(String.reified());
306
- };
307
- Object.defineProperty(String, "p", {
308
- get: function () {
309
- return String.phantom();
310
- },
311
- enumerable: false,
312
- configurable: true
313
- });
314
- Object.defineProperty(String, "bcs", {
315
- get: function () {
316
- return bcs_1.bcs.struct("String", {
317
- bytes: bcs_1.bcs.vector(bcs_1.bcs.u8()),
318
- });
319
- },
320
- enumerable: false,
321
- configurable: true
322
- });
323
- String.fromFields = function (fields) {
324
- return String.reified().new({ bytes: (0, reified_1.decodeFromFields)(reified.vector("u8"), fields.bytes) });
325
- };
326
- String.fromFieldsWithTypes = function (item) {
327
- if (!isString(item.type)) {
328
- throw new Error("not a String type");
329
- }
330
- return String.reified().new({ bytes: (0, reified_1.decodeFromFieldsWithTypes)(reified.vector("u8"), item.fields.bytes) });
331
- };
332
- String.fromBcs = function (data) {
333
- return String.fromFields(String.bcs.parse(data));
334
- };
335
- String.prototype.toJSONField = function () {
336
- return {
337
- bytes: (0, reified_1.fieldToJSON)("vector<u8>", this.bytes),
338
- };
339
- };
340
- String.prototype.toJSON = function () {
341
- return __assign({ $typeName: this.$typeName, $typeArgs: this.$typeArgs }, this.toJSONField());
342
- };
343
- String.fromJSONField = function (field) {
344
- return String.reified().new({ bytes: (0, reified_1.decodeFromJSONField)(reified.vector("u8"), field.bytes) });
345
- };
346
- String.fromJSON = function (json) {
347
- if (json.$typeName !== String.$typeName) {
348
- throw new Error("not a WithTwoGenerics json object");
349
- }
350
- return String.fromJSONField(json);
351
- };
352
- String.fromSuiParsedData = function (content) {
353
- if (content.dataType !== "moveObject") {
354
- throw new Error("not an object");
355
- }
356
- if (!isString(content.type)) {
357
- throw new Error("object at ".concat(content.fields.id, " is not a String object"));
358
- }
359
- return String.fromFieldsWithTypes(content);
360
- };
361
- String.fromSuiObjectData = function (data) {
362
- if (data.bcs) {
363
- if (data.bcs.dataType !== "moveObject" || !isString(data.bcs.type)) {
364
- throw new Error("object at is not a String object");
365
- }
366
- return String.fromBcs((0, utils_1.fromB64)(data.bcs.bcsBytes));
367
- }
368
- if (data.content) {
369
- return String.fromSuiParsedData(data.content);
370
- }
371
- throw new Error("Both `bcs` and `content` fields are missing from the data. Include `showBcs` or `showContent` in the request.");
372
- };
373
- String.fetch = function (client, id) {
374
- return __awaiter(this, void 0, void 0, function () {
375
- var res;
376
- var _a, _b;
377
- return __generator(this, function (_c) {
378
- switch (_c.label) {
379
- case 0: return [4 /*yield*/, client.getObject({ id: id, options: { showBcs: true } })];
380
- case 1:
381
- res = _c.sent();
382
- if (res.error) {
383
- throw new Error("error fetching String object at id ".concat(id, ": ").concat(res.error.code));
384
- }
385
- if (((_b = (_a = res.data) === null || _a === void 0 ? void 0 : _a.bcs) === null || _b === void 0 ? void 0 : _b.dataType) !== "moveObject" || !isString(res.data.bcs.type)) {
386
- throw new Error("object at id ".concat(id, " is not a String object"));
387
- }
388
- return [2 /*return*/, String.fromSuiObjectData(res.data)];
389
- }
390
- });
391
- });
392
- };
393
- String.$typeName = "".concat(index_1.PKG_V13, "::ascii::String");
394
- String.$numTypeParams = 0;
395
- String.$isPhantom = [];
396
- return String;
397
- }());
398
- exports.String = String;
@@ -1,3 +0,0 @@
1
- export declare const PACKAGE_ID = "0x1";
2
- export declare const PUBLISHED_AT = "0x1";
3
- export declare const PKG_V13 = "0x1";
@@ -1,6 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.PKG_V13 = exports.PUBLISHED_AT = exports.PACKAGE_ID = void 0;
4
- exports.PACKAGE_ID = "0x1";
5
- exports.PUBLISHED_AT = "0x1";
6
- exports.PKG_V13 = "0x1";
@@ -1,50 +0,0 @@
1
- import * as reified from "../../../../_framework/reified";
2
- import { PhantomReified, Reified, StructClass, ToField, ToTypeArgument, ToTypeStr, TypeArgument } from "../../../../_framework/reified";
3
- import { FieldsWithTypes } from "../../../../_framework/util";
4
- import { Vector } from "../../../../_framework/vector";
5
- import { PKG_V13 } from "../index";
6
- import { BcsType } from "@mysten/sui/bcs";
7
- import { SuiClient, SuiObjectData, SuiParsedData } from "@mysten/sui/client";
8
- export declare function isOption(type: string): boolean;
9
- export interface OptionFields<Element extends TypeArgument> {
10
- vec: ToField<Vector<Element>>;
11
- }
12
- export type OptionReified<Element extends TypeArgument> = Reified<Option<Element>, OptionFields<Element>>;
13
- export declare class Option<Element extends TypeArgument> implements StructClass {
14
- __StructClass: true;
15
- static readonly $typeName = "0x1::option::Option";
16
- static readonly $numTypeParams = 1;
17
- static readonly $isPhantom: readonly [false];
18
- __inner: Element;
19
- readonly $typeName = "0x1::option::Option";
20
- readonly $fullTypeName: `${typeof PKG_V13}::option::Option<${ToTypeStr<Element>}>`;
21
- readonly $typeArgs: [ToTypeStr<Element>];
22
- readonly $isPhantom: readonly [false];
23
- readonly vec: ToField<Vector<Element>>;
24
- private constructor();
25
- static reified<Element extends Reified<TypeArgument, any>>(Element: Element): OptionReified<ToTypeArgument<Element>>;
26
- static get r(): typeof Option.reified;
27
- static phantom<Element extends Reified<TypeArgument, any>>(Element: Element): PhantomReified<ToTypeStr<Option<ToTypeArgument<Element>>>>;
28
- static get p(): typeof Option.phantom;
29
- static get bcs(): <Element extends BcsType<any>>(Element: Element) => import("@mysten/sui/bcs").BcsStruct<{
30
- vec: BcsType<import("@mysten/bcs").InferBcsType<Element>[], Iterable<import("@mysten/bcs").InferBcsInput<Element>> & {
31
- length: number;
32
- }, string>;
33
- }, string>;
34
- static fromFields<Element extends Reified<TypeArgument, any>>(typeArg: Element, fields: Record<string, any>): Option<ToTypeArgument<Element>>;
35
- static fromFieldsWithTypes<Element extends Reified<TypeArgument, any>>(typeArg: Element, item: FieldsWithTypes): Option<ToTypeArgument<Element>>;
36
- static fromBcs<Element extends Reified<TypeArgument, any>>(typeArg: Element, data: Uint8Array): Option<ToTypeArgument<Element>>;
37
- toJSONField(): {
38
- vec: reified.ToJSON<Element>[];
39
- };
40
- toJSON(): {
41
- vec: reified.ToJSON<Element>[];
42
- $typeName: string;
43
- $typeArgs: [reified.ToTypeStr<Element>];
44
- };
45
- static fromJSONField<Element extends Reified<TypeArgument, any>>(typeArg: Element, field: any): Option<ToTypeArgument<Element>>;
46
- static fromJSON<Element extends Reified<TypeArgument, any>>(typeArg: Element, json: Record<string, any>): Option<ToTypeArgument<Element>>;
47
- static fromSuiParsedData<Element extends Reified<TypeArgument, any>>(typeArg: Element, content: SuiParsedData): Option<ToTypeArgument<Element>>;
48
- static fromSuiObjectData<Element extends Reified<TypeArgument, any>>(typeArg: Element, data: SuiObjectData): Option<ToTypeArgument<Element>>;
49
- static fetch<Element extends Reified<TypeArgument, any>>(client: SuiClient, typeArg: Element, id: string): Promise<Option<ToTypeArgument<Element>>>;
50
- }