@typus/typus-perp-sdk 1.1.32 → 1.1.34

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