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

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (249) hide show
  1. package/dist/src/api/sentio.js +604 -538
  2. package/dist/src/client.d.ts +27 -0
  3. package/dist/src/client.js +108 -0
  4. package/dist/src/fetch.d.ts +160 -34
  5. package/dist/src/fetch.js +365 -665
  6. package/dist/src/generated/typus_perp/admin.d.ts +117 -0
  7. package/dist/src/generated/typus_perp/admin.js +110 -0
  8. package/dist/src/generated/typus_perp/competition.d.ts +22 -0
  9. package/dist/src/generated/typus_perp/competition.js +58 -0
  10. package/dist/src/generated/typus_perp/deps/std/type_name.d.ts +17 -0
  11. package/dist/src/generated/typus_perp/deps/std/type_name.js +25 -0
  12. package/dist/src/generated/typus_perp/deps/sui/balance.d.ts +12 -0
  13. package/dist/src/generated/typus_perp/deps/sui/balance.js +20 -0
  14. package/dist/src/generated/typus_perp/deps/sui/object.d.ts +8 -0
  15. package/dist/src/generated/typus_perp/deps/sui/object.js +16 -0
  16. package/dist/src/generated/typus_perp/deps/sui/object_table.d.ts +19 -0
  17. package/dist/src/generated/typus_perp/deps/sui/object_table.js +59 -0
  18. package/dist/src/generated/typus_perp/deps/sui/vec_set.d.ts +18 -0
  19. package/dist/src/generated/typus_perp/deps/sui/vec_set.js +25 -0
  20. package/dist/src/generated/typus_perp/deps/typus/keyed_big_vector.d.ts +30 -0
  21. package/dist/src/generated/typus_perp/deps/typus/keyed_big_vector.js +67 -0
  22. package/dist/src/generated/typus_perp/deps/typus/linked_object_table.d.ts +32 -0
  23. package/dist/src/generated/typus_perp/deps/typus/linked_object_table.js +71 -0
  24. package/dist/src/generated/typus_perp/deps/typus_framework/vault.d.ts +23 -0
  25. package/dist/src/generated/typus_perp/deps/typus_framework/vault.js +61 -0
  26. package/dist/src/generated/typus_perp/escrow.d.ts +59 -0
  27. package/dist/src/generated/typus_perp/escrow.js +76 -0
  28. package/dist/src/generated/typus_perp/lending.d.ts +47 -0
  29. package/dist/src/generated/typus_perp/lending.js +50 -0
  30. package/dist/src/generated/typus_perp/lp_pool.d.ts +2327 -0
  31. package/dist/src/generated/typus_perp/lp_pool.js +1956 -0
  32. package/dist/src/generated/typus_perp/math.d.ts +95 -0
  33. package/dist/src/generated/typus_perp/math.js +97 -0
  34. package/dist/src/generated/typus_perp/position.d.ts +234 -0
  35. package/dist/src/generated/typus_perp/position.js +204 -0
  36. package/dist/src/generated/typus_perp/symbol.d.ts +18 -0
  37. package/dist/src/generated/typus_perp/symbol.js +55 -0
  38. package/dist/src/generated/typus_perp/tlp.d.ts +13 -0
  39. package/dist/src/generated/typus_perp/tlp.js +56 -0
  40. package/dist/src/generated/typus_perp/trading.d.ts +2486 -0
  41. package/dist/src/generated/typus_perp/trading.js +2476 -0
  42. package/dist/src/generated/typus_perp/treasury_caps.d.ts +13 -0
  43. package/dist/src/{_framework/init-loader.js → generated/typus_perp/treasury_caps.js} +17 -10
  44. package/dist/src/generated/typus_perp/user_account.d.ts +40 -0
  45. package/dist/src/generated/typus_perp/user_account.js +72 -0
  46. package/dist/src/generated/typus_stake_pool/admin.d.ts +100 -0
  47. package/dist/src/generated/typus_stake_pool/admin.js +91 -0
  48. package/dist/src/generated/typus_stake_pool/deps/std/type_name.d.ts +17 -0
  49. package/dist/src/generated/typus_stake_pool/deps/std/type_name.js +25 -0
  50. package/dist/src/generated/typus_stake_pool/deps/sui/object.d.ts +8 -0
  51. package/dist/src/generated/typus_stake_pool/deps/sui/object.js +16 -0
  52. package/dist/src/generated/typus_stake_pool/deps/sui/vec_map.d.ts +30 -0
  53. package/dist/src/generated/typus_stake_pool/deps/sui/vec_map.js +37 -0
  54. package/dist/src/generated/typus_stake_pool/deps/sui/vec_set.d.ts +18 -0
  55. package/dist/src/generated/typus_stake_pool/deps/sui/vec_set.js +25 -0
  56. package/dist/src/generated/typus_stake_pool/stake_pool.d.ts +1023 -0
  57. package/dist/src/generated/typus_stake_pool/stake_pool.js +918 -0
  58. package/dist/src/generated/utils/index.d.ts +11 -0
  59. package/dist/src/generated/utils/index.js +135 -0
  60. package/dist/src/grpc/graphql.d.ts +26 -0
  61. package/dist/src/grpc/graphql.js +126 -0
  62. package/dist/src/grpc/grpc.d.ts +1 -0
  63. package/dist/src/grpc/grpc.js +38 -0
  64. package/dist/src/grpc/ledgerService.js +64 -0
  65. package/dist/src/grpc/liveDataService.d.ts +0 -0
  66. package/dist/src/grpc/liveDataService.js +49 -0
  67. package/dist/src/index.d.ts +1 -4
  68. package/dist/src/index.js +21 -39
  69. package/dist/src/user/history.js +611 -680
  70. package/dist/src/user/order.d.ts +11 -11
  71. package/dist/src/user/order.js +171 -302
  72. package/dist/src/user/orderWithBidReceipt.d.ts +8 -5
  73. package/dist/src/user/orderWithBidReceipt.js +127 -225
  74. package/dist/src/user/tlp.d.ts +32 -23
  75. package/dist/src/user/tlp.js +316 -468
  76. package/package.json +12 -3
  77. package/dist/src/_dependencies/source/0x1/ascii/structs.d.ts +0 -92
  78. package/dist/src/_dependencies/source/0x1/ascii/structs.js +0 -398
  79. package/dist/src/_dependencies/source/0x1/index.d.ts +0 -3
  80. package/dist/src/_dependencies/source/0x1/index.js +0 -6
  81. package/dist/src/_dependencies/source/0x1/option/structs.d.ts +0 -52
  82. package/dist/src/_dependencies/source/0x1/option/structs.js +0 -271
  83. package/dist/src/_dependencies/source/0x1/string/structs.d.ts +0 -50
  84. package/dist/src/_dependencies/source/0x1/string/structs.js +0 -256
  85. package/dist/src/_dependencies/source/0x1/type-name/structs.d.ts +0 -53
  86. package/dist/src/_dependencies/source/0x1/type-name/structs.js +0 -223
  87. package/dist/src/_dependencies/source/0x2/bag/structs.d.ts +0 -61
  88. package/dist/src/_dependencies/source/0x2/bag/structs.js +0 -229
  89. package/dist/src/_dependencies/source/0x2/balance/structs.d.ts +0 -88
  90. package/dist/src/_dependencies/source/0x2/balance/structs.js +0 -386
  91. package/dist/src/_dependencies/source/0x2/coin/structs.d.ts +0 -460
  92. package/dist/src/_dependencies/source/0x2/coin/structs.js +0 -1247
  93. package/dist/src/_dependencies/source/0x2/index.d.ts +0 -3
  94. package/dist/src/_dependencies/source/0x2/index.js +0 -6
  95. package/dist/src/_dependencies/source/0x2/linked-table/structs.d.ts +0 -153
  96. package/dist/src/_dependencies/source/0x2/linked-table/structs.js +0 -438
  97. package/dist/src/_dependencies/source/0x2/object/structs.d.ts +0 -92
  98. package/dist/src/_dependencies/source/0x2/object/structs.js +0 -364
  99. package/dist/src/_dependencies/source/0x2/object-table/structs.d.ts +0 -61
  100. package/dist/src/_dependencies/source/0x2/object-table/structs.js +0 -248
  101. package/dist/src/_dependencies/source/0x2/sui/structs.d.ts +0 -46
  102. package/dist/src/_dependencies/source/0x2/sui/structs.js +0 -222
  103. package/dist/src/_dependencies/source/0x2/table/structs.d.ts +0 -61
  104. package/dist/src/_dependencies/source/0x2/table/structs.js +0 -248
  105. package/dist/src/_dependencies/source/0x2/table-vec/structs.d.ts +0 -68
  106. package/dist/src/_dependencies/source/0x2/table-vec/structs.js +0 -274
  107. package/dist/src/_dependencies/source/0x2/token/structs.d.ts +0 -449
  108. package/dist/src/_dependencies/source/0x2/token/structs.js +0 -1095
  109. package/dist/src/_dependencies/source/0x2/transfer-policy/structs.d.ts +0 -370
  110. package/dist/src/_dependencies/source/0x2/transfer-policy/structs.js +0 -1091
  111. package/dist/src/_dependencies/source/0x2/url/structs.d.ts +0 -53
  112. package/dist/src/_dependencies/source/0x2/url/structs.js +0 -223
  113. package/dist/src/_dependencies/source/0x2/vec-map/structs.d.ts +0 -111
  114. package/dist/src/_dependencies/source/0x2/vec-map/structs.js +0 -446
  115. package/dist/src/_dependencies/source/0x2/vec-set/structs.d.ts +0 -51
  116. package/dist/src/_dependencies/source/0x2/vec-set/structs.js +0 -270
  117. package/dist/src/_dependencies/source/0x4b0f4ee1a40ce37ec81c987cc4e76a665419e74b863319492fc7d26f708b835a/airdrop/structs.d.ts +0 -489
  118. package/dist/src/_dependencies/source/0x4b0f4ee1a40ce37ec81c987cc4e76a665419e74b863319492fc7d26f708b835a/airdrop/structs.js +0 -1084
  119. package/dist/src/_dependencies/source/0x4b0f4ee1a40ce37ec81c987cc4e76a665419e74b863319492fc7d26f708b835a/big-vector/structs.d.ts +0 -147
  120. package/dist/src/_dependencies/source/0x4b0f4ee1a40ce37ec81c987cc4e76a665419e74b863319492fc7d26f708b835a/big-vector/structs.js +0 -456
  121. package/dist/src/_dependencies/source/0x4b0f4ee1a40ce37ec81c987cc4e76a665419e74b863319492fc7d26f708b835a/critbit/structs.d.ts +0 -239
  122. package/dist/src/_dependencies/source/0x4b0f4ee1a40ce37ec81c987cc4e76a665419e74b863319492fc7d26f708b835a/critbit/structs.js +0 -653
  123. package/dist/src/_dependencies/source/0x4b0f4ee1a40ce37ec81c987cc4e76a665419e74b863319492fc7d26f708b835a/ecosystem/structs.d.ts +0 -405
  124. package/dist/src/_dependencies/source/0x4b0f4ee1a40ce37ec81c987cc4e76a665419e74b863319492fc7d26f708b835a/ecosystem/structs.js +0 -899
  125. package/dist/src/_dependencies/source/0x4b0f4ee1a40ce37ec81c987cc4e76a665419e74b863319492fc7d26f708b835a/index.d.ts +0 -8
  126. package/dist/src/_dependencies/source/0x4b0f4ee1a40ce37ec81c987cc4e76a665419e74b863319492fc7d26f708b835a/index.js +0 -11
  127. package/dist/src/_dependencies/source/0x4b0f4ee1a40ce37ec81c987cc4e76a665419e74b863319492fc7d26f708b835a/init.d.ts +0 -2
  128. package/dist/src/_dependencies/source/0x4b0f4ee1a40ce37ec81c987cc4e76a665419e74b863319492fc7d26f708b835a/init.js +0 -102
  129. package/dist/src/_dependencies/source/0x4b0f4ee1a40ce37ec81c987cc4e76a665419e74b863319492fc7d26f708b835a/keyed-big-vector/structs.d.ts +0 -227
  130. package/dist/src/_dependencies/source/0x4b0f4ee1a40ce37ec81c987cc4e76a665419e74b863319492fc7d26f708b835a/keyed-big-vector/structs.js +0 -632
  131. package/dist/src/_dependencies/source/0x4b0f4ee1a40ce37ec81c987cc4e76a665419e74b863319492fc7d26f708b835a/leaderboard/structs.d.ts +0 -699
  132. package/dist/src/_dependencies/source/0x4b0f4ee1a40ce37ec81c987cc4e76a665419e74b863319492fc7d26f708b835a/leaderboard/structs.js +0 -1459
  133. package/dist/src/_dependencies/source/0x4b0f4ee1a40ce37ec81c987cc4e76a665419e74b863319492fc7d26f708b835a/linked-object-table/structs.d.ts +0 -161
  134. package/dist/src/_dependencies/source/0x4b0f4ee1a40ce37ec81c987cc4e76a665419e74b863319492fc7d26f708b835a/linked-object-table/structs.js +0 -438
  135. package/dist/src/_dependencies/source/0x4b0f4ee1a40ce37ec81c987cc4e76a665419e74b863319492fc7d26f708b835a/linked-set/structs.d.ts +0 -147
  136. package/dist/src/_dependencies/source/0x4b0f4ee1a40ce37ec81c987cc4e76a665419e74b863319492fc7d26f708b835a/linked-set/structs.js +0 -430
  137. package/dist/src/_dependencies/source/0x4b0f4ee1a40ce37ec81c987cc4e76a665419e74b863319492fc7d26f708b835a/tails-staking/structs.d.ts +0 -1071
  138. package/dist/src/_dependencies/source/0x4b0f4ee1a40ce37ec81c987cc4e76a665419e74b863319492fc7d26f708b835a/tails-staking/structs.js +0 -2261
  139. package/dist/src/_dependencies/source/0x4b0f4ee1a40ce37ec81c987cc4e76a665419e74b863319492fc7d26f708b835a/tgld/structs.d.ts +0 -279
  140. package/dist/src/_dependencies/source/0x4b0f4ee1a40ce37ec81c987cc4e76a665419e74b863319492fc7d26f708b835a/tgld/structs.js +0 -733
  141. package/dist/src/_dependencies/source/0x4b0f4ee1a40ce37ec81c987cc4e76a665419e74b863319492fc7d26f708b835a/user/structs.d.ts +0 -328
  142. package/dist/src/_dependencies/source/0x4b0f4ee1a40ce37ec81c987cc4e76a665419e74b863319492fc7d26f708b835a/user/structs.js +0 -892
  143. package/dist/src/_dependencies/source/0xb4f25230ba74837d8299e92951306100c4a532e8c48cc3d8828abe9b91c8b274/authority/structs.d.ts +0 -88
  144. package/dist/src/_dependencies/source/0xb4f25230ba74837d8299e92951306100c4a532e8c48cc3d8828abe9b91c8b274/authority/structs.js +0 -263
  145. package/dist/src/_dependencies/source/0xb4f25230ba74837d8299e92951306100c4a532e8c48cc3d8828abe9b91c8b274/balance-pool/structs.d.ts +0 -347
  146. package/dist/src/_dependencies/source/0xb4f25230ba74837d8299e92951306100c4a532e8c48cc3d8828abe9b91c8b274/balance-pool/structs.js +0 -591
  147. package/dist/src/_dependencies/source/0xb4f25230ba74837d8299e92951306100c4a532e8c48cc3d8828abe9b91c8b274/big-vector/structs.d.ts +0 -73
  148. package/dist/src/_dependencies/source/0xb4f25230ba74837d8299e92951306100c4a532e8c48cc3d8828abe9b91c8b274/big-vector/structs.js +0 -258
  149. package/dist/src/_dependencies/source/0xb4f25230ba74837d8299e92951306100c4a532e8c48cc3d8828abe9b91c8b274/dutch/structs.d.ts +0 -876
  150. package/dist/src/_dependencies/source/0xb4f25230ba74837d8299e92951306100c4a532e8c48cc3d8828abe9b91c8b274/dutch/structs.js +0 -1721
  151. package/dist/src/_dependencies/source/0xb4f25230ba74837d8299e92951306100c4a532e8c48cc3d8828abe9b91c8b274/i64/structs.d.ts +0 -46
  152. package/dist/src/_dependencies/source/0xb4f25230ba74837d8299e92951306100c4a532e8c48cc3d8828abe9b91c8b274/i64/structs.js +0 -222
  153. package/dist/src/_dependencies/source/0xb4f25230ba74837d8299e92951306100c4a532e8c48cc3d8828abe9b91c8b274/index.d.ts +0 -3
  154. package/dist/src/_dependencies/source/0xb4f25230ba74837d8299e92951306100c4a532e8c48cc3d8828abe9b91c8b274/index.js +0 -6
  155. package/dist/src/_dependencies/source/0xb4f25230ba74837d8299e92951306100c4a532e8c48cc3d8828abe9b91c8b274/init.d.ts +0 -2
  156. package/dist/src/_dependencies/source/0xb4f25230ba74837d8299e92951306100c4a532e8c48cc3d8828abe9b91c8b274/init.js +0 -89
  157. package/dist/src/_dependencies/source/0xb4f25230ba74837d8299e92951306100c4a532e8c48cc3d8828abe9b91c8b274/linked-list/structs.d.ts +0 -155
  158. package/dist/src/_dependencies/source/0xb4f25230ba74837d8299e92951306100c4a532e8c48cc3d8828abe9b91c8b274/linked-list/structs.js +0 -444
  159. package/dist/src/_dependencies/source/0xb4f25230ba74837d8299e92951306100c4a532e8c48cc3d8828abe9b91c8b274/vault/structs.d.ts +0 -2386
  160. package/dist/src/_dependencies/source/0xb4f25230ba74837d8299e92951306100c4a532e8c48cc3d8828abe9b91c8b274/vault/structs.js +0 -4952
  161. package/dist/src/_dependencies/source/0xbd147bc7f12f38f175d78947a61364e8e077b9b188b00e7094bc0c3623162196/discount-mint/structs.d.ts +0 -446
  162. package/dist/src/_dependencies/source/0xbd147bc7f12f38f175d78947a61364e8e077b9b188b00e7094bc0c3623162196/discount-mint/structs.js +0 -844
  163. package/dist/src/_dependencies/source/0xbd147bc7f12f38f175d78947a61364e8e077b9b188b00e7094bc0c3623162196/index.d.ts +0 -6
  164. package/dist/src/_dependencies/source/0xbd147bc7f12f38f175d78947a61364e8e077b9b188b00e7094bc0c3623162196/index.js +0 -9
  165. package/dist/src/_dependencies/source/0xbd147bc7f12f38f175d78947a61364e8e077b9b188b00e7094bc0c3623162196/init.d.ts +0 -2
  166. package/dist/src/_dependencies/source/0xbd147bc7f12f38f175d78947a61364e8e077b9b188b00e7094bc0c3623162196/init.js +0 -69
  167. package/dist/src/_dependencies/source/0xbd147bc7f12f38f175d78947a61364e8e077b9b188b00e7094bc0c3623162196/royalty-rule/structs.d.ts +0 -94
  168. package/dist/src/_dependencies/source/0xbd147bc7f12f38f175d78947a61364e8e077b9b188b00e7094bc0c3623162196/royalty-rule/structs.js +0 -376
  169. package/dist/src/_dependencies/source/0xbd147bc7f12f38f175d78947a61364e8e077b9b188b00e7094bc0c3623162196/staking/structs.d.ts +0 -454
  170. package/dist/src/_dependencies/source/0xbd147bc7f12f38f175d78947a61364e8e077b9b188b00e7094bc0c3623162196/staking/structs.js +0 -881
  171. package/dist/src/_dependencies/source/0xbd147bc7f12f38f175d78947a61364e8e077b9b188b00e7094bc0c3623162196/table-vec/structs.d.ts +0 -68
  172. package/dist/src/_dependencies/source/0xbd147bc7f12f38f175d78947a61364e8e077b9b188b00e7094bc0c3623162196/table-vec/structs.js +0 -274
  173. package/dist/src/_dependencies/source/0xbd147bc7f12f38f175d78947a61364e8e077b9b188b00e7094bc0c3623162196/typus-nft/structs.d.ts +0 -1117
  174. package/dist/src/_dependencies/source/0xbd147bc7f12f38f175d78947a61364e8e077b9b188b00e7094bc0c3623162196/typus-nft/structs.js +0 -2387
  175. package/dist/src/_framework/init-loader.d.ts +0 -2
  176. package/dist/src/_framework/loader.d.ts +0 -17
  177. package/dist/src/_framework/loader.js +0 -108
  178. package/dist/src/_framework/reified.d.ts +0 -108
  179. package/dist/src/_framework/reified.js +0 -237
  180. package/dist/src/_framework/util.d.ts +0 -35
  181. package/dist/src/_framework/util.js +0 -396
  182. package/dist/src/_framework/vector.d.ts +0 -35
  183. package/dist/src/_framework/vector.js +0 -112
  184. package/dist/src/pyth.js +0 -1
  185. package/dist/src/typus_perp/admin/functions.d.ts +0 -59
  186. package/dist/src/typus_perp/admin/functions.js +0 -122
  187. package/dist/src/typus_perp/admin/structs.d.ts +0 -529
  188. package/dist/src/typus_perp/admin/structs.js +0 -1065
  189. package/dist/src/typus_perp/competition/functions.d.ts +0 -24
  190. package/dist/src/typus_perp/competition/functions.js +0 -38
  191. package/dist/src/typus_perp/competition/structs.d.ts +0 -92
  192. package/dist/src/typus_perp/competition/structs.js +0 -288
  193. package/dist/src/typus_perp/error/functions.d.ts +0 -73
  194. package/dist/src/typus_perp/error/functions.js +0 -363
  195. package/dist/src/typus_perp/escrow/functions.d.ts +0 -17
  196. package/dist/src/typus_perp/escrow/functions.js +0 -36
  197. package/dist/src/typus_perp/escrow/structs.d.ts +0 -172
  198. package/dist/src/typus_perp/escrow/structs.js +0 -324
  199. package/dist/src/typus_perp/index.d.ts +0 -1
  200. package/dist/src/typus_perp/index.js +0 -7
  201. package/dist/src/typus_perp/init.d.ts +0 -2
  202. package/dist/src/typus_perp/init.js +0 -118
  203. package/dist/src/typus_perp/lending/functions.d.ts +0 -15
  204. package/dist/src/typus_perp/lending/functions.js +0 -22
  205. package/dist/src/typus_perp/lp-pool/functions.d.ts +0 -460
  206. package/dist/src/typus_perp/lp-pool/functions.js +0 -732
  207. package/dist/src/typus_perp/lp-pool/structs.d.ts +0 -4268
  208. package/dist/src/typus_perp/lp-pool/structs.js +0 -6789
  209. package/dist/src/typus_perp/math/functions.d.ts +0 -29
  210. package/dist/src/typus_perp/math/functions.js +0 -61
  211. package/dist/src/typus_perp/position/functions.d.ts +0 -379
  212. package/dist/src/typus_perp/position/functions.js +0 -713
  213. package/dist/src/typus_perp/position/structs.d.ts +0 -1064
  214. package/dist/src/typus_perp/position/structs.js +0 -1450
  215. package/dist/src/typus_perp/symbol/functions.d.ts +0 -9
  216. package/dist/src/typus_perp/symbol/functions.js +0 -24
  217. package/dist/src/typus_perp/symbol/structs.d.ts +0 -81
  218. package/dist/src/typus_perp/symbol/structs.js +0 -235
  219. package/dist/src/typus_perp/tlp/functions.d.ts +0 -19
  220. package/dist/src/typus_perp/tlp/functions.js +0 -40
  221. package/dist/src/typus_perp/tlp/structs.d.ts +0 -97
  222. package/dist/src/typus_perp/tlp/structs.js +0 -365
  223. package/dist/src/typus_perp/token-interface/functions.d.ts +0 -11
  224. package/dist/src/typus_perp/token-interface/functions.js +0 -22
  225. package/dist/src/typus_perp/trading/functions.d.ts +0 -812
  226. package/dist/src/typus_perp/trading/functions.js +0 -1218
  227. package/dist/src/typus_perp/trading/structs.d.ts +0 -3613
  228. package/dist/src/typus_perp/trading/structs.js +0 -5813
  229. package/dist/src/typus_perp/treasury-caps/functions.d.ts +0 -9
  230. package/dist/src/typus_perp/treasury-caps/functions.js +0 -36
  231. package/dist/src/typus_perp/treasury-caps/structs.d.ts +0 -55
  232. package/dist/src/typus_perp/treasury-caps/structs.js +0 -223
  233. package/dist/src/typus_perp/user-account/functions.d.ts +0 -36
  234. package/dist/src/typus_perp/user-account/functions.js +0 -70
  235. package/dist/src/typus_perp/user-account/structs.d.ts +0 -168
  236. package/dist/src/typus_perp/user-account/structs.js +0 -448
  237. package/dist/src/typus_stake_pool/admin/functions.d.ts +0 -49
  238. package/dist/src/typus_stake_pool/admin/functions.js +0 -105
  239. package/dist/src/typus_stake_pool/admin/structs.d.ts +0 -413
  240. package/dist/src/typus_stake_pool/admin/structs.js +0 -789
  241. package/dist/src/typus_stake_pool/index.d.ts +0 -1
  242. package/dist/src/typus_stake_pool/index.js +0 -7
  243. package/dist/src/typus_stake_pool/init.d.ts +0 -2
  244. package/dist/src/typus_stake_pool/init.js +0 -69
  245. package/dist/src/typus_stake_pool/stake-pool/functions.d.ts +0 -229
  246. package/dist/src/typus_stake_pool/stake-pool/functions.js +0 -380
  247. package/dist/src/typus_stake_pool/stake-pool/structs.d.ts +0 -2477
  248. package/dist/src/typus_stake_pool/stake-pool/structs.js +0 -4653
  249. /package/dist/src/{pyth.d.ts → grpc/ledgerService.d.ts} +0 -0
@@ -1,1721 +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.UpdateAuctionConfig = exports.Terminate = exports.RemoveBid = exports.NewBid = exports.Delivery = exports.DUTCH = exports.Bid = exports.Auction = void 0;
109
- exports.isAuction = isAuction;
110
- exports.isBid = isBid;
111
- exports.isDUTCH = isDUTCH;
112
- exports.isDelivery = isDelivery;
113
- exports.isNewBid = isNewBid;
114
- exports.isRemoveBid = isRemoveBid;
115
- exports.isTerminate = isTerminate;
116
- exports.isUpdateAuctionConfig = isUpdateAuctionConfig;
117
- var reified = __importStar(require("../../../../_framework/reified"));
118
- var reified_1 = require("../../../../_framework/reified");
119
- var util_1 = require("../../../../_framework/util");
120
- var structs_1 = require("../../0x1/type-name/structs");
121
- var structs_2 = require("../../0x2/object/structs");
122
- var structs_3 = require("../big-vector/structs");
123
- var index_1 = require("../index");
124
- var bcs_1 = require("@mysten/sui/bcs");
125
- var utils_1 = require("@mysten/sui/utils");
126
- /* ============================== Auction =============================== */
127
- function isAuction(type) {
128
- type = (0, util_1.compressSuiType)(type);
129
- return type === "".concat(index_1.PKG_V1, "::dutch::Auction");
130
- }
131
- var Auction = /** @class */ (function () {
132
- function Auction(typeArgs, fields) {
133
- this.__StructClass = true;
134
- this.$typeName = Auction.$typeName;
135
- this.$isPhantom = Auction.$isPhantom;
136
- this.$fullTypeName = util_1.composeSuiType.apply(void 0, __spreadArray([Auction.$typeName], __read(typeArgs), false));
137
- this.$typeArgs = typeArgs;
138
- this.id = fields.id;
139
- this.index = fields.index;
140
- this.token = fields.token;
141
- this.startTsMs = fields.startTsMs;
142
- this.endTsMs = fields.endTsMs;
143
- this.size = fields.size;
144
- this.decaySpeed = fields.decaySpeed;
145
- this.initialPrice = fields.initialPrice;
146
- this.finalPrice = fields.finalPrice;
147
- this.feeBp = fields.feeBp;
148
- this.incentiveBp = fields.incentiveBp;
149
- this.tokenDecimal = fields.tokenDecimal;
150
- this.sizeDecimal = fields.sizeDecimal;
151
- this.totalBidSize = fields.totalBidSize;
152
- this.ableToRemoveBid = fields.ableToRemoveBid;
153
- this.bids = fields.bids;
154
- this.bidIndex = fields.bidIndex;
155
- }
156
- Auction.reified = function () {
157
- var _this = this;
158
- return {
159
- typeName: Auction.$typeName,
160
- fullTypeName: util_1.composeSuiType.apply(void 0, __spreadArray([Auction.$typeName], [], false)),
161
- typeArgs: [],
162
- isPhantom: Auction.$isPhantom,
163
- reifiedTypeArgs: [],
164
- fromFields: function (fields) { return Auction.fromFields(fields); },
165
- fromFieldsWithTypes: function (item) { return Auction.fromFieldsWithTypes(item); },
166
- fromBcs: function (data) { return Auction.fromBcs(data); },
167
- bcs: Auction.bcs,
168
- fromJSONField: function (field) { return Auction.fromJSONField(field); },
169
- fromJSON: function (json) { return Auction.fromJSON(json); },
170
- fromSuiParsedData: function (content) { return Auction.fromSuiParsedData(content); },
171
- fromSuiObjectData: function (content) { return Auction.fromSuiObjectData(content); },
172
- fetch: function (client, id) { return __awaiter(_this, void 0, void 0, function () { return __generator(this, function (_a) {
173
- return [2 /*return*/, Auction.fetch(client, id)];
174
- }); }); },
175
- new: function (fields) {
176
- return new Auction([], fields);
177
- },
178
- kind: "StructClassReified",
179
- };
180
- };
181
- Object.defineProperty(Auction, "r", {
182
- get: function () {
183
- return Auction.reified();
184
- },
185
- enumerable: false,
186
- configurable: true
187
- });
188
- Auction.phantom = function () {
189
- return (0, reified_1.phantom)(Auction.reified());
190
- };
191
- Object.defineProperty(Auction, "p", {
192
- get: function () {
193
- return Auction.phantom();
194
- },
195
- enumerable: false,
196
- configurable: true
197
- });
198
- Object.defineProperty(Auction, "bcs", {
199
- get: function () {
200
- return bcs_1.bcs.struct("Auction", {
201
- id: structs_2.UID.bcs,
202
- index: bcs_1.bcs.u64(),
203
- token: structs_1.TypeName.bcs,
204
- start_ts_ms: bcs_1.bcs.u64(),
205
- end_ts_ms: bcs_1.bcs.u64(),
206
- size: bcs_1.bcs.u64(),
207
- decay_speed: bcs_1.bcs.u64(),
208
- initial_price: bcs_1.bcs.u64(),
209
- final_price: bcs_1.bcs.u64(),
210
- fee_bp: bcs_1.bcs.u64(),
211
- incentive_bp: bcs_1.bcs.u64(),
212
- token_decimal: bcs_1.bcs.u64(),
213
- size_decimal: bcs_1.bcs.u64(),
214
- total_bid_size: bcs_1.bcs.u64(),
215
- able_to_remove_bid: bcs_1.bcs.bool(),
216
- bids: structs_3.BigVector.bcs,
217
- bid_index: bcs_1.bcs.u64(),
218
- });
219
- },
220
- enumerable: false,
221
- configurable: true
222
- });
223
- Auction.fromFields = function (fields) {
224
- return Auction.reified().new({
225
- id: (0, reified_1.decodeFromFields)(structs_2.UID.reified(), fields.id),
226
- index: (0, reified_1.decodeFromFields)("u64", fields.index),
227
- token: (0, reified_1.decodeFromFields)(structs_1.TypeName.reified(), fields.token),
228
- startTsMs: (0, reified_1.decodeFromFields)("u64", fields.start_ts_ms),
229
- endTsMs: (0, reified_1.decodeFromFields)("u64", fields.end_ts_ms),
230
- size: (0, reified_1.decodeFromFields)("u64", fields.size),
231
- decaySpeed: (0, reified_1.decodeFromFields)("u64", fields.decay_speed),
232
- initialPrice: (0, reified_1.decodeFromFields)("u64", fields.initial_price),
233
- finalPrice: (0, reified_1.decodeFromFields)("u64", fields.final_price),
234
- feeBp: (0, reified_1.decodeFromFields)("u64", fields.fee_bp),
235
- incentiveBp: (0, reified_1.decodeFromFields)("u64", fields.incentive_bp),
236
- tokenDecimal: (0, reified_1.decodeFromFields)("u64", fields.token_decimal),
237
- sizeDecimal: (0, reified_1.decodeFromFields)("u64", fields.size_decimal),
238
- totalBidSize: (0, reified_1.decodeFromFields)("u64", fields.total_bid_size),
239
- ableToRemoveBid: (0, reified_1.decodeFromFields)("bool", fields.able_to_remove_bid),
240
- bids: (0, reified_1.decodeFromFields)(structs_3.BigVector.reified(reified.phantom(Bid.reified())), fields.bids),
241
- bidIndex: (0, reified_1.decodeFromFields)("u64", fields.bid_index),
242
- });
243
- };
244
- Auction.fromFieldsWithTypes = function (item) {
245
- if (!isAuction(item.type)) {
246
- throw new Error("not a Auction type");
247
- }
248
- return Auction.reified().new({
249
- id: (0, reified_1.decodeFromFieldsWithTypes)(structs_2.UID.reified(), item.fields.id),
250
- index: (0, reified_1.decodeFromFieldsWithTypes)("u64", item.fields.index),
251
- token: (0, reified_1.decodeFromFieldsWithTypes)(structs_1.TypeName.reified(), item.fields.token),
252
- startTsMs: (0, reified_1.decodeFromFieldsWithTypes)("u64", item.fields.start_ts_ms),
253
- endTsMs: (0, reified_1.decodeFromFieldsWithTypes)("u64", item.fields.end_ts_ms),
254
- size: (0, reified_1.decodeFromFieldsWithTypes)("u64", item.fields.size),
255
- decaySpeed: (0, reified_1.decodeFromFieldsWithTypes)("u64", item.fields.decay_speed),
256
- initialPrice: (0, reified_1.decodeFromFieldsWithTypes)("u64", item.fields.initial_price),
257
- finalPrice: (0, reified_1.decodeFromFieldsWithTypes)("u64", item.fields.final_price),
258
- feeBp: (0, reified_1.decodeFromFieldsWithTypes)("u64", item.fields.fee_bp),
259
- incentiveBp: (0, reified_1.decodeFromFieldsWithTypes)("u64", item.fields.incentive_bp),
260
- tokenDecimal: (0, reified_1.decodeFromFieldsWithTypes)("u64", item.fields.token_decimal),
261
- sizeDecimal: (0, reified_1.decodeFromFieldsWithTypes)("u64", item.fields.size_decimal),
262
- totalBidSize: (0, reified_1.decodeFromFieldsWithTypes)("u64", item.fields.total_bid_size),
263
- ableToRemoveBid: (0, reified_1.decodeFromFieldsWithTypes)("bool", item.fields.able_to_remove_bid),
264
- bids: (0, reified_1.decodeFromFieldsWithTypes)(structs_3.BigVector.reified(reified.phantom(Bid.reified())), item.fields.bids),
265
- bidIndex: (0, reified_1.decodeFromFieldsWithTypes)("u64", item.fields.bid_index),
266
- });
267
- };
268
- Auction.fromBcs = function (data) {
269
- return Auction.fromFields(Auction.bcs.parse(data));
270
- };
271
- Auction.prototype.toJSONField = function () {
272
- return {
273
- id: this.id,
274
- index: this.index.toString(),
275
- token: this.token.toJSONField(),
276
- startTsMs: this.startTsMs.toString(),
277
- endTsMs: this.endTsMs.toString(),
278
- size: this.size.toString(),
279
- decaySpeed: this.decaySpeed.toString(),
280
- initialPrice: this.initialPrice.toString(),
281
- finalPrice: this.finalPrice.toString(),
282
- feeBp: this.feeBp.toString(),
283
- incentiveBp: this.incentiveBp.toString(),
284
- tokenDecimal: this.tokenDecimal.toString(),
285
- sizeDecimal: this.sizeDecimal.toString(),
286
- totalBidSize: this.totalBidSize.toString(),
287
- ableToRemoveBid: this.ableToRemoveBid,
288
- bids: this.bids.toJSONField(),
289
- bidIndex: this.bidIndex.toString(),
290
- };
291
- };
292
- Auction.prototype.toJSON = function () {
293
- return __assign({ $typeName: this.$typeName, $typeArgs: this.$typeArgs }, this.toJSONField());
294
- };
295
- Auction.fromJSONField = function (field) {
296
- return Auction.reified().new({
297
- id: (0, reified_1.decodeFromJSONField)(structs_2.UID.reified(), field.id),
298
- index: (0, reified_1.decodeFromJSONField)("u64", field.index),
299
- token: (0, reified_1.decodeFromJSONField)(structs_1.TypeName.reified(), field.token),
300
- startTsMs: (0, reified_1.decodeFromJSONField)("u64", field.startTsMs),
301
- endTsMs: (0, reified_1.decodeFromJSONField)("u64", field.endTsMs),
302
- size: (0, reified_1.decodeFromJSONField)("u64", field.size),
303
- decaySpeed: (0, reified_1.decodeFromJSONField)("u64", field.decaySpeed),
304
- initialPrice: (0, reified_1.decodeFromJSONField)("u64", field.initialPrice),
305
- finalPrice: (0, reified_1.decodeFromJSONField)("u64", field.finalPrice),
306
- feeBp: (0, reified_1.decodeFromJSONField)("u64", field.feeBp),
307
- incentiveBp: (0, reified_1.decodeFromJSONField)("u64", field.incentiveBp),
308
- tokenDecimal: (0, reified_1.decodeFromJSONField)("u64", field.tokenDecimal),
309
- sizeDecimal: (0, reified_1.decodeFromJSONField)("u64", field.sizeDecimal),
310
- totalBidSize: (0, reified_1.decodeFromJSONField)("u64", field.totalBidSize),
311
- ableToRemoveBid: (0, reified_1.decodeFromJSONField)("bool", field.ableToRemoveBid),
312
- bids: (0, reified_1.decodeFromJSONField)(structs_3.BigVector.reified(reified.phantom(Bid.reified())), field.bids),
313
- bidIndex: (0, reified_1.decodeFromJSONField)("u64", field.bidIndex),
314
- });
315
- };
316
- Auction.fromJSON = function (json) {
317
- if (json.$typeName !== Auction.$typeName) {
318
- throw new Error("not a WithTwoGenerics json object");
319
- }
320
- return Auction.fromJSONField(json);
321
- };
322
- Auction.fromSuiParsedData = function (content) {
323
- if (content.dataType !== "moveObject") {
324
- throw new Error("not an object");
325
- }
326
- if (!isAuction(content.type)) {
327
- throw new Error("object at ".concat(content.fields.id, " is not a Auction object"));
328
- }
329
- return Auction.fromFieldsWithTypes(content);
330
- };
331
- Auction.fromSuiObjectData = function (data) {
332
- if (data.bcs) {
333
- if (data.bcs.dataType !== "moveObject" || !isAuction(data.bcs.type)) {
334
- throw new Error("object at is not a Auction object");
335
- }
336
- return Auction.fromBcs((0, utils_1.fromB64)(data.bcs.bcsBytes));
337
- }
338
- if (data.content) {
339
- return Auction.fromSuiParsedData(data.content);
340
- }
341
- throw new Error("Both `bcs` and `content` fields are missing from the data. Include `showBcs` or `showContent` in the request.");
342
- };
343
- Auction.fetch = function (client, id) {
344
- return __awaiter(this, void 0, void 0, function () {
345
- var res;
346
- var _a, _b;
347
- return __generator(this, function (_c) {
348
- switch (_c.label) {
349
- case 0: return [4 /*yield*/, client.getObject({ id: id, options: { showBcs: true } })];
350
- case 1:
351
- res = _c.sent();
352
- if (res.error) {
353
- throw new Error("error fetching Auction object at id ".concat(id, ": ").concat(res.error.code));
354
- }
355
- if (((_b = (_a = res.data) === null || _a === void 0 ? void 0 : _a.bcs) === null || _b === void 0 ? void 0 : _b.dataType) !== "moveObject" || !isAuction(res.data.bcs.type)) {
356
- throw new Error("object at id ".concat(id, " is not a Auction object"));
357
- }
358
- return [2 /*return*/, Auction.fromSuiObjectData(res.data)];
359
- }
360
- });
361
- });
362
- };
363
- Auction.$typeName = "".concat(index_1.PKG_V1, "::dutch::Auction");
364
- Auction.$numTypeParams = 0;
365
- Auction.$isPhantom = [];
366
- return Auction;
367
- }());
368
- exports.Auction = Auction;
369
- /* ============================== Bid =============================== */
370
- function isBid(type) {
371
- type = (0, util_1.compressSuiType)(type);
372
- return type === "".concat(index_1.PKG_V1, "::dutch::Bid");
373
- }
374
- var Bid = /** @class */ (function () {
375
- function Bid(typeArgs, fields) {
376
- this.__StructClass = true;
377
- this.$typeName = Bid.$typeName;
378
- this.$isPhantom = Bid.$isPhantom;
379
- this.$fullTypeName = util_1.composeSuiType.apply(void 0, __spreadArray([Bid.$typeName], __read(typeArgs), false));
380
- this.$typeArgs = typeArgs;
381
- this.index = fields.index;
382
- this.bidder = fields.bidder;
383
- this.price = fields.price;
384
- this.size = fields.size;
385
- this.bidderBalance = fields.bidderBalance;
386
- this.incentiveBalance = fields.incentiveBalance;
387
- this.feeDiscount = fields.feeDiscount;
388
- this.tsMs = fields.tsMs;
389
- }
390
- Bid.reified = function () {
391
- var _this = this;
392
- return {
393
- typeName: Bid.$typeName,
394
- fullTypeName: util_1.composeSuiType.apply(void 0, __spreadArray([Bid.$typeName], [], false)),
395
- typeArgs: [],
396
- isPhantom: Bid.$isPhantom,
397
- reifiedTypeArgs: [],
398
- fromFields: function (fields) { return Bid.fromFields(fields); },
399
- fromFieldsWithTypes: function (item) { return Bid.fromFieldsWithTypes(item); },
400
- fromBcs: function (data) { return Bid.fromBcs(data); },
401
- bcs: Bid.bcs,
402
- fromJSONField: function (field) { return Bid.fromJSONField(field); },
403
- fromJSON: function (json) { return Bid.fromJSON(json); },
404
- fromSuiParsedData: function (content) { return Bid.fromSuiParsedData(content); },
405
- fromSuiObjectData: function (content) { return Bid.fromSuiObjectData(content); },
406
- fetch: function (client, id) { return __awaiter(_this, void 0, void 0, function () { return __generator(this, function (_a) {
407
- return [2 /*return*/, Bid.fetch(client, id)];
408
- }); }); },
409
- new: function (fields) {
410
- return new Bid([], fields);
411
- },
412
- kind: "StructClassReified",
413
- };
414
- };
415
- Object.defineProperty(Bid, "r", {
416
- get: function () {
417
- return Bid.reified();
418
- },
419
- enumerable: false,
420
- configurable: true
421
- });
422
- Bid.phantom = function () {
423
- return (0, reified_1.phantom)(Bid.reified());
424
- };
425
- Object.defineProperty(Bid, "p", {
426
- get: function () {
427
- return Bid.phantom();
428
- },
429
- enumerable: false,
430
- configurable: true
431
- });
432
- Object.defineProperty(Bid, "bcs", {
433
- get: function () {
434
- return bcs_1.bcs.struct("Bid", {
435
- index: bcs_1.bcs.u64(),
436
- bidder: bcs_1.bcs.bytes(32).transform({ input: function (val) { return (0, utils_1.fromHEX)(val); }, output: function (val) { return (0, utils_1.toHEX)(val); } }),
437
- price: bcs_1.bcs.u64(),
438
- size: bcs_1.bcs.u64(),
439
- bidder_balance: bcs_1.bcs.u64(),
440
- incentive_balance: bcs_1.bcs.u64(),
441
- fee_discount: bcs_1.bcs.u64(),
442
- ts_ms: bcs_1.bcs.u64(),
443
- });
444
- },
445
- enumerable: false,
446
- configurable: true
447
- });
448
- Bid.fromFields = function (fields) {
449
- return Bid.reified().new({
450
- index: (0, reified_1.decodeFromFields)("u64", fields.index),
451
- bidder: (0, reified_1.decodeFromFields)("address", fields.bidder),
452
- price: (0, reified_1.decodeFromFields)("u64", fields.price),
453
- size: (0, reified_1.decodeFromFields)("u64", fields.size),
454
- bidderBalance: (0, reified_1.decodeFromFields)("u64", fields.bidder_balance),
455
- incentiveBalance: (0, reified_1.decodeFromFields)("u64", fields.incentive_balance),
456
- feeDiscount: (0, reified_1.decodeFromFields)("u64", fields.fee_discount),
457
- tsMs: (0, reified_1.decodeFromFields)("u64", fields.ts_ms),
458
- });
459
- };
460
- Bid.fromFieldsWithTypes = function (item) {
461
- if (!isBid(item.type)) {
462
- throw new Error("not a Bid type");
463
- }
464
- return Bid.reified().new({
465
- index: (0, reified_1.decodeFromFieldsWithTypes)("u64", item.fields.index),
466
- bidder: (0, reified_1.decodeFromFieldsWithTypes)("address", item.fields.bidder),
467
- price: (0, reified_1.decodeFromFieldsWithTypes)("u64", item.fields.price),
468
- size: (0, reified_1.decodeFromFieldsWithTypes)("u64", item.fields.size),
469
- bidderBalance: (0, reified_1.decodeFromFieldsWithTypes)("u64", item.fields.bidder_balance),
470
- incentiveBalance: (0, reified_1.decodeFromFieldsWithTypes)("u64", item.fields.incentive_balance),
471
- feeDiscount: (0, reified_1.decodeFromFieldsWithTypes)("u64", item.fields.fee_discount),
472
- tsMs: (0, reified_1.decodeFromFieldsWithTypes)("u64", item.fields.ts_ms),
473
- });
474
- };
475
- Bid.fromBcs = function (data) {
476
- return Bid.fromFields(Bid.bcs.parse(data));
477
- };
478
- Bid.prototype.toJSONField = function () {
479
- return {
480
- index: this.index.toString(),
481
- bidder: this.bidder,
482
- price: this.price.toString(),
483
- size: this.size.toString(),
484
- bidderBalance: this.bidderBalance.toString(),
485
- incentiveBalance: this.incentiveBalance.toString(),
486
- feeDiscount: this.feeDiscount.toString(),
487
- tsMs: this.tsMs.toString(),
488
- };
489
- };
490
- Bid.prototype.toJSON = function () {
491
- return __assign({ $typeName: this.$typeName, $typeArgs: this.$typeArgs }, this.toJSONField());
492
- };
493
- Bid.fromJSONField = function (field) {
494
- return Bid.reified().new({
495
- index: (0, reified_1.decodeFromJSONField)("u64", field.index),
496
- bidder: (0, reified_1.decodeFromJSONField)("address", field.bidder),
497
- price: (0, reified_1.decodeFromJSONField)("u64", field.price),
498
- size: (0, reified_1.decodeFromJSONField)("u64", field.size),
499
- bidderBalance: (0, reified_1.decodeFromJSONField)("u64", field.bidderBalance),
500
- incentiveBalance: (0, reified_1.decodeFromJSONField)("u64", field.incentiveBalance),
501
- feeDiscount: (0, reified_1.decodeFromJSONField)("u64", field.feeDiscount),
502
- tsMs: (0, reified_1.decodeFromJSONField)("u64", field.tsMs),
503
- });
504
- };
505
- Bid.fromJSON = function (json) {
506
- if (json.$typeName !== Bid.$typeName) {
507
- throw new Error("not a WithTwoGenerics json object");
508
- }
509
- return Bid.fromJSONField(json);
510
- };
511
- Bid.fromSuiParsedData = function (content) {
512
- if (content.dataType !== "moveObject") {
513
- throw new Error("not an object");
514
- }
515
- if (!isBid(content.type)) {
516
- throw new Error("object at ".concat(content.fields.id, " is not a Bid object"));
517
- }
518
- return Bid.fromFieldsWithTypes(content);
519
- };
520
- Bid.fromSuiObjectData = function (data) {
521
- if (data.bcs) {
522
- if (data.bcs.dataType !== "moveObject" || !isBid(data.bcs.type)) {
523
- throw new Error("object at is not a Bid object");
524
- }
525
- return Bid.fromBcs((0, utils_1.fromB64)(data.bcs.bcsBytes));
526
- }
527
- if (data.content) {
528
- return Bid.fromSuiParsedData(data.content);
529
- }
530
- throw new Error("Both `bcs` and `content` fields are missing from the data. Include `showBcs` or `showContent` in the request.");
531
- };
532
- Bid.fetch = function (client, id) {
533
- return __awaiter(this, void 0, void 0, function () {
534
- var res;
535
- var _a, _b;
536
- return __generator(this, function (_c) {
537
- switch (_c.label) {
538
- case 0: return [4 /*yield*/, client.getObject({ id: id, options: { showBcs: true } })];
539
- case 1:
540
- res = _c.sent();
541
- if (res.error) {
542
- throw new Error("error fetching Bid object at id ".concat(id, ": ").concat(res.error.code));
543
- }
544
- if (((_b = (_a = res.data) === null || _a === void 0 ? void 0 : _a.bcs) === null || _b === void 0 ? void 0 : _b.dataType) !== "moveObject" || !isBid(res.data.bcs.type)) {
545
- throw new Error("object at id ".concat(id, " is not a Bid object"));
546
- }
547
- return [2 /*return*/, Bid.fromSuiObjectData(res.data)];
548
- }
549
- });
550
- });
551
- };
552
- Bid.$typeName = "".concat(index_1.PKG_V1, "::dutch::Bid");
553
- Bid.$numTypeParams = 0;
554
- Bid.$isPhantom = [];
555
- return Bid;
556
- }());
557
- exports.Bid = Bid;
558
- /* ============================== DUTCH =============================== */
559
- function isDUTCH(type) {
560
- type = (0, util_1.compressSuiType)(type);
561
- return type === "".concat(index_1.PKG_V1, "::dutch::DUTCH");
562
- }
563
- var DUTCH = /** @class */ (function () {
564
- function DUTCH(typeArgs, fields) {
565
- this.__StructClass = true;
566
- this.$typeName = DUTCH.$typeName;
567
- this.$isPhantom = DUTCH.$isPhantom;
568
- this.$fullTypeName = util_1.composeSuiType.apply(void 0, __spreadArray([DUTCH.$typeName], __read(typeArgs), false));
569
- this.$typeArgs = typeArgs;
570
- this.dummyField = fields.dummyField;
571
- }
572
- DUTCH.reified = function () {
573
- var _this = this;
574
- return {
575
- typeName: DUTCH.$typeName,
576
- fullTypeName: util_1.composeSuiType.apply(void 0, __spreadArray([DUTCH.$typeName], [], false)),
577
- typeArgs: [],
578
- isPhantom: DUTCH.$isPhantom,
579
- reifiedTypeArgs: [],
580
- fromFields: function (fields) { return DUTCH.fromFields(fields); },
581
- fromFieldsWithTypes: function (item) { return DUTCH.fromFieldsWithTypes(item); },
582
- fromBcs: function (data) { return DUTCH.fromBcs(data); },
583
- bcs: DUTCH.bcs,
584
- fromJSONField: function (field) { return DUTCH.fromJSONField(field); },
585
- fromJSON: function (json) { return DUTCH.fromJSON(json); },
586
- fromSuiParsedData: function (content) { return DUTCH.fromSuiParsedData(content); },
587
- fromSuiObjectData: function (content) { return DUTCH.fromSuiObjectData(content); },
588
- fetch: function (client, id) { return __awaiter(_this, void 0, void 0, function () { return __generator(this, function (_a) {
589
- return [2 /*return*/, DUTCH.fetch(client, id)];
590
- }); }); },
591
- new: function (fields) {
592
- return new DUTCH([], fields);
593
- },
594
- kind: "StructClassReified",
595
- };
596
- };
597
- Object.defineProperty(DUTCH, "r", {
598
- get: function () {
599
- return DUTCH.reified();
600
- },
601
- enumerable: false,
602
- configurable: true
603
- });
604
- DUTCH.phantom = function () {
605
- return (0, reified_1.phantom)(DUTCH.reified());
606
- };
607
- Object.defineProperty(DUTCH, "p", {
608
- get: function () {
609
- return DUTCH.phantom();
610
- },
611
- enumerable: false,
612
- configurable: true
613
- });
614
- Object.defineProperty(DUTCH, "bcs", {
615
- get: function () {
616
- return bcs_1.bcs.struct("DUTCH", {
617
- dummy_field: bcs_1.bcs.bool(),
618
- });
619
- },
620
- enumerable: false,
621
- configurable: true
622
- });
623
- DUTCH.fromFields = function (fields) {
624
- return DUTCH.reified().new({ dummyField: (0, reified_1.decodeFromFields)("bool", fields.dummy_field) });
625
- };
626
- DUTCH.fromFieldsWithTypes = function (item) {
627
- if (!isDUTCH(item.type)) {
628
- throw new Error("not a DUTCH type");
629
- }
630
- return DUTCH.reified().new({ dummyField: (0, reified_1.decodeFromFieldsWithTypes)("bool", item.fields.dummy_field) });
631
- };
632
- DUTCH.fromBcs = function (data) {
633
- return DUTCH.fromFields(DUTCH.bcs.parse(data));
634
- };
635
- DUTCH.prototype.toJSONField = function () {
636
- return {
637
- dummyField: this.dummyField,
638
- };
639
- };
640
- DUTCH.prototype.toJSON = function () {
641
- return __assign({ $typeName: this.$typeName, $typeArgs: this.$typeArgs }, this.toJSONField());
642
- };
643
- DUTCH.fromJSONField = function (field) {
644
- return DUTCH.reified().new({ dummyField: (0, reified_1.decodeFromJSONField)("bool", field.dummyField) });
645
- };
646
- DUTCH.fromJSON = function (json) {
647
- if (json.$typeName !== DUTCH.$typeName) {
648
- throw new Error("not a WithTwoGenerics json object");
649
- }
650
- return DUTCH.fromJSONField(json);
651
- };
652
- DUTCH.fromSuiParsedData = function (content) {
653
- if (content.dataType !== "moveObject") {
654
- throw new Error("not an object");
655
- }
656
- if (!isDUTCH(content.type)) {
657
- throw new Error("object at ".concat(content.fields.id, " is not a DUTCH object"));
658
- }
659
- return DUTCH.fromFieldsWithTypes(content);
660
- };
661
- DUTCH.fromSuiObjectData = function (data) {
662
- if (data.bcs) {
663
- if (data.bcs.dataType !== "moveObject" || !isDUTCH(data.bcs.type)) {
664
- throw new Error("object at is not a DUTCH object");
665
- }
666
- return DUTCH.fromBcs((0, utils_1.fromB64)(data.bcs.bcsBytes));
667
- }
668
- if (data.content) {
669
- return DUTCH.fromSuiParsedData(data.content);
670
- }
671
- throw new Error("Both `bcs` and `content` fields are missing from the data. Include `showBcs` or `showContent` in the request.");
672
- };
673
- DUTCH.fetch = function (client, id) {
674
- return __awaiter(this, void 0, void 0, function () {
675
- var res;
676
- var _a, _b;
677
- return __generator(this, function (_c) {
678
- switch (_c.label) {
679
- case 0: return [4 /*yield*/, client.getObject({ id: id, options: { showBcs: true } })];
680
- case 1:
681
- res = _c.sent();
682
- if (res.error) {
683
- throw new Error("error fetching DUTCH object at id ".concat(id, ": ").concat(res.error.code));
684
- }
685
- if (((_b = (_a = res.data) === null || _a === void 0 ? void 0 : _a.bcs) === null || _b === void 0 ? void 0 : _b.dataType) !== "moveObject" || !isDUTCH(res.data.bcs.type)) {
686
- throw new Error("object at id ".concat(id, " is not a DUTCH object"));
687
- }
688
- return [2 /*return*/, DUTCH.fromSuiObjectData(res.data)];
689
- }
690
- });
691
- });
692
- };
693
- DUTCH.$typeName = "".concat(index_1.PKG_V1, "::dutch::DUTCH");
694
- DUTCH.$numTypeParams = 0;
695
- DUTCH.$isPhantom = [];
696
- return DUTCH;
697
- }());
698
- exports.DUTCH = DUTCH;
699
- /* ============================== Delivery =============================== */
700
- function isDelivery(type) {
701
- type = (0, util_1.compressSuiType)(type);
702
- return type === "".concat(index_1.PKG_V1, "::dutch::Delivery");
703
- }
704
- var Delivery = /** @class */ (function () {
705
- function Delivery(typeArgs, fields) {
706
- this.__StructClass = true;
707
- this.$typeName = Delivery.$typeName;
708
- this.$isPhantom = Delivery.$isPhantom;
709
- this.$fullTypeName = util_1.composeSuiType.apply(void 0, __spreadArray([Delivery.$typeName], __read(typeArgs), false));
710
- this.$typeArgs = typeArgs;
711
- this.signer = fields.signer;
712
- this.index = fields.index;
713
- this.token = fields.token;
714
- this.price = fields.price;
715
- this.size = fields.size;
716
- this.bidderBidValue = fields.bidderBidValue;
717
- this.bidderFee = fields.bidderFee;
718
- this.incentiveBidValue = fields.incentiveBidValue;
719
- this.incentiveFee = fields.incentiveFee;
720
- }
721
- Delivery.reified = function () {
722
- var _this = this;
723
- return {
724
- typeName: Delivery.$typeName,
725
- fullTypeName: util_1.composeSuiType.apply(void 0, __spreadArray([Delivery.$typeName], [], false)),
726
- typeArgs: [],
727
- isPhantom: Delivery.$isPhantom,
728
- reifiedTypeArgs: [],
729
- fromFields: function (fields) { return Delivery.fromFields(fields); },
730
- fromFieldsWithTypes: function (item) { return Delivery.fromFieldsWithTypes(item); },
731
- fromBcs: function (data) { return Delivery.fromBcs(data); },
732
- bcs: Delivery.bcs,
733
- fromJSONField: function (field) { return Delivery.fromJSONField(field); },
734
- fromJSON: function (json) { return Delivery.fromJSON(json); },
735
- fromSuiParsedData: function (content) { return Delivery.fromSuiParsedData(content); },
736
- fromSuiObjectData: function (content) { return Delivery.fromSuiObjectData(content); },
737
- fetch: function (client, id) { return __awaiter(_this, void 0, void 0, function () { return __generator(this, function (_a) {
738
- return [2 /*return*/, Delivery.fetch(client, id)];
739
- }); }); },
740
- new: function (fields) {
741
- return new Delivery([], fields);
742
- },
743
- kind: "StructClassReified",
744
- };
745
- };
746
- Object.defineProperty(Delivery, "r", {
747
- get: function () {
748
- return Delivery.reified();
749
- },
750
- enumerable: false,
751
- configurable: true
752
- });
753
- Delivery.phantom = function () {
754
- return (0, reified_1.phantom)(Delivery.reified());
755
- };
756
- Object.defineProperty(Delivery, "p", {
757
- get: function () {
758
- return Delivery.phantom();
759
- },
760
- enumerable: false,
761
- configurable: true
762
- });
763
- Object.defineProperty(Delivery, "bcs", {
764
- get: function () {
765
- return bcs_1.bcs.struct("Delivery", {
766
- signer: bcs_1.bcs.bytes(32).transform({ input: function (val) { return (0, utils_1.fromHEX)(val); }, output: function (val) { return (0, utils_1.toHEX)(val); } }),
767
- index: bcs_1.bcs.u64(),
768
- token: structs_1.TypeName.bcs,
769
- price: bcs_1.bcs.u64(),
770
- size: bcs_1.bcs.u64(),
771
- bidder_bid_value: bcs_1.bcs.u64(),
772
- bidder_fee: bcs_1.bcs.u64(),
773
- incentive_bid_value: bcs_1.bcs.u64(),
774
- incentive_fee: bcs_1.bcs.u64(),
775
- });
776
- },
777
- enumerable: false,
778
- configurable: true
779
- });
780
- Delivery.fromFields = function (fields) {
781
- return Delivery.reified().new({
782
- signer: (0, reified_1.decodeFromFields)("address", fields.signer),
783
- index: (0, reified_1.decodeFromFields)("u64", fields.index),
784
- token: (0, reified_1.decodeFromFields)(structs_1.TypeName.reified(), fields.token),
785
- price: (0, reified_1.decodeFromFields)("u64", fields.price),
786
- size: (0, reified_1.decodeFromFields)("u64", fields.size),
787
- bidderBidValue: (0, reified_1.decodeFromFields)("u64", fields.bidder_bid_value),
788
- bidderFee: (0, reified_1.decodeFromFields)("u64", fields.bidder_fee),
789
- incentiveBidValue: (0, reified_1.decodeFromFields)("u64", fields.incentive_bid_value),
790
- incentiveFee: (0, reified_1.decodeFromFields)("u64", fields.incentive_fee),
791
- });
792
- };
793
- Delivery.fromFieldsWithTypes = function (item) {
794
- if (!isDelivery(item.type)) {
795
- throw new Error("not a Delivery type");
796
- }
797
- return Delivery.reified().new({
798
- signer: (0, reified_1.decodeFromFieldsWithTypes)("address", item.fields.signer),
799
- index: (0, reified_1.decodeFromFieldsWithTypes)("u64", item.fields.index),
800
- token: (0, reified_1.decodeFromFieldsWithTypes)(structs_1.TypeName.reified(), item.fields.token),
801
- price: (0, reified_1.decodeFromFieldsWithTypes)("u64", item.fields.price),
802
- size: (0, reified_1.decodeFromFieldsWithTypes)("u64", item.fields.size),
803
- bidderBidValue: (0, reified_1.decodeFromFieldsWithTypes)("u64", item.fields.bidder_bid_value),
804
- bidderFee: (0, reified_1.decodeFromFieldsWithTypes)("u64", item.fields.bidder_fee),
805
- incentiveBidValue: (0, reified_1.decodeFromFieldsWithTypes)("u64", item.fields.incentive_bid_value),
806
- incentiveFee: (0, reified_1.decodeFromFieldsWithTypes)("u64", item.fields.incentive_fee),
807
- });
808
- };
809
- Delivery.fromBcs = function (data) {
810
- return Delivery.fromFields(Delivery.bcs.parse(data));
811
- };
812
- Delivery.prototype.toJSONField = function () {
813
- return {
814
- signer: this.signer,
815
- index: this.index.toString(),
816
- token: this.token.toJSONField(),
817
- price: this.price.toString(),
818
- size: this.size.toString(),
819
- bidderBidValue: this.bidderBidValue.toString(),
820
- bidderFee: this.bidderFee.toString(),
821
- incentiveBidValue: this.incentiveBidValue.toString(),
822
- incentiveFee: this.incentiveFee.toString(),
823
- };
824
- };
825
- Delivery.prototype.toJSON = function () {
826
- return __assign({ $typeName: this.$typeName, $typeArgs: this.$typeArgs }, this.toJSONField());
827
- };
828
- Delivery.fromJSONField = function (field) {
829
- return Delivery.reified().new({
830
- signer: (0, reified_1.decodeFromJSONField)("address", field.signer),
831
- index: (0, reified_1.decodeFromJSONField)("u64", field.index),
832
- token: (0, reified_1.decodeFromJSONField)(structs_1.TypeName.reified(), field.token),
833
- price: (0, reified_1.decodeFromJSONField)("u64", field.price),
834
- size: (0, reified_1.decodeFromJSONField)("u64", field.size),
835
- bidderBidValue: (0, reified_1.decodeFromJSONField)("u64", field.bidderBidValue),
836
- bidderFee: (0, reified_1.decodeFromJSONField)("u64", field.bidderFee),
837
- incentiveBidValue: (0, reified_1.decodeFromJSONField)("u64", field.incentiveBidValue),
838
- incentiveFee: (0, reified_1.decodeFromJSONField)("u64", field.incentiveFee),
839
- });
840
- };
841
- Delivery.fromJSON = function (json) {
842
- if (json.$typeName !== Delivery.$typeName) {
843
- throw new Error("not a WithTwoGenerics json object");
844
- }
845
- return Delivery.fromJSONField(json);
846
- };
847
- Delivery.fromSuiParsedData = function (content) {
848
- if (content.dataType !== "moveObject") {
849
- throw new Error("not an object");
850
- }
851
- if (!isDelivery(content.type)) {
852
- throw new Error("object at ".concat(content.fields.id, " is not a Delivery object"));
853
- }
854
- return Delivery.fromFieldsWithTypes(content);
855
- };
856
- Delivery.fromSuiObjectData = function (data) {
857
- if (data.bcs) {
858
- if (data.bcs.dataType !== "moveObject" || !isDelivery(data.bcs.type)) {
859
- throw new Error("object at is not a Delivery object");
860
- }
861
- return Delivery.fromBcs((0, utils_1.fromB64)(data.bcs.bcsBytes));
862
- }
863
- if (data.content) {
864
- return Delivery.fromSuiParsedData(data.content);
865
- }
866
- throw new Error("Both `bcs` and `content` fields are missing from the data. Include `showBcs` or `showContent` in the request.");
867
- };
868
- Delivery.fetch = function (client, id) {
869
- return __awaiter(this, void 0, void 0, function () {
870
- var res;
871
- var _a, _b;
872
- return __generator(this, function (_c) {
873
- switch (_c.label) {
874
- case 0: return [4 /*yield*/, client.getObject({ id: id, options: { showBcs: true } })];
875
- case 1:
876
- res = _c.sent();
877
- if (res.error) {
878
- throw new Error("error fetching Delivery object at id ".concat(id, ": ").concat(res.error.code));
879
- }
880
- if (((_b = (_a = res.data) === null || _a === void 0 ? void 0 : _a.bcs) === null || _b === void 0 ? void 0 : _b.dataType) !== "moveObject" || !isDelivery(res.data.bcs.type)) {
881
- throw new Error("object at id ".concat(id, " is not a Delivery object"));
882
- }
883
- return [2 /*return*/, Delivery.fromSuiObjectData(res.data)];
884
- }
885
- });
886
- });
887
- };
888
- Delivery.$typeName = "".concat(index_1.PKG_V1, "::dutch::Delivery");
889
- Delivery.$numTypeParams = 0;
890
- Delivery.$isPhantom = [];
891
- return Delivery;
892
- }());
893
- exports.Delivery = Delivery;
894
- /* ============================== NewBid =============================== */
895
- function isNewBid(type) {
896
- type = (0, util_1.compressSuiType)(type);
897
- return type === "".concat(index_1.PKG_V1, "::dutch::NewBid");
898
- }
899
- var NewBid = /** @class */ (function () {
900
- function NewBid(typeArgs, fields) {
901
- this.__StructClass = true;
902
- this.$typeName = NewBid.$typeName;
903
- this.$isPhantom = NewBid.$isPhantom;
904
- this.$fullTypeName = util_1.composeSuiType.apply(void 0, __spreadArray([NewBid.$typeName], __read(typeArgs), false));
905
- this.$typeArgs = typeArgs;
906
- this.signer = fields.signer;
907
- this.index = fields.index;
908
- this.token = fields.token;
909
- this.bidIndex = fields.bidIndex;
910
- this.price = fields.price;
911
- this.size = fields.size;
912
- this.bidderBalance = fields.bidderBalance;
913
- this.incentiveBalance = fields.incentiveBalance;
914
- this.tsMs = fields.tsMs;
915
- }
916
- NewBid.reified = function () {
917
- var _this = this;
918
- return {
919
- typeName: NewBid.$typeName,
920
- fullTypeName: util_1.composeSuiType.apply(void 0, __spreadArray([NewBid.$typeName], [], false)),
921
- typeArgs: [],
922
- isPhantom: NewBid.$isPhantom,
923
- reifiedTypeArgs: [],
924
- fromFields: function (fields) { return NewBid.fromFields(fields); },
925
- fromFieldsWithTypes: function (item) { return NewBid.fromFieldsWithTypes(item); },
926
- fromBcs: function (data) { return NewBid.fromBcs(data); },
927
- bcs: NewBid.bcs,
928
- fromJSONField: function (field) { return NewBid.fromJSONField(field); },
929
- fromJSON: function (json) { return NewBid.fromJSON(json); },
930
- fromSuiParsedData: function (content) { return NewBid.fromSuiParsedData(content); },
931
- fromSuiObjectData: function (content) { return NewBid.fromSuiObjectData(content); },
932
- fetch: function (client, id) { return __awaiter(_this, void 0, void 0, function () { return __generator(this, function (_a) {
933
- return [2 /*return*/, NewBid.fetch(client, id)];
934
- }); }); },
935
- new: function (fields) {
936
- return new NewBid([], fields);
937
- },
938
- kind: "StructClassReified",
939
- };
940
- };
941
- Object.defineProperty(NewBid, "r", {
942
- get: function () {
943
- return NewBid.reified();
944
- },
945
- enumerable: false,
946
- configurable: true
947
- });
948
- NewBid.phantom = function () {
949
- return (0, reified_1.phantom)(NewBid.reified());
950
- };
951
- Object.defineProperty(NewBid, "p", {
952
- get: function () {
953
- return NewBid.phantom();
954
- },
955
- enumerable: false,
956
- configurable: true
957
- });
958
- Object.defineProperty(NewBid, "bcs", {
959
- get: function () {
960
- return bcs_1.bcs.struct("NewBid", {
961
- signer: bcs_1.bcs.bytes(32).transform({ input: function (val) { return (0, utils_1.fromHEX)(val); }, output: function (val) { return (0, utils_1.toHEX)(val); } }),
962
- index: bcs_1.bcs.u64(),
963
- token: structs_1.TypeName.bcs,
964
- bid_index: bcs_1.bcs.u64(),
965
- price: bcs_1.bcs.u64(),
966
- size: bcs_1.bcs.u64(),
967
- bidder_balance: bcs_1.bcs.u64(),
968
- incentive_balance: bcs_1.bcs.u64(),
969
- ts_ms: bcs_1.bcs.u64(),
970
- });
971
- },
972
- enumerable: false,
973
- configurable: true
974
- });
975
- NewBid.fromFields = function (fields) {
976
- return NewBid.reified().new({
977
- signer: (0, reified_1.decodeFromFields)("address", fields.signer),
978
- index: (0, reified_1.decodeFromFields)("u64", fields.index),
979
- token: (0, reified_1.decodeFromFields)(structs_1.TypeName.reified(), fields.token),
980
- bidIndex: (0, reified_1.decodeFromFields)("u64", fields.bid_index),
981
- price: (0, reified_1.decodeFromFields)("u64", fields.price),
982
- size: (0, reified_1.decodeFromFields)("u64", fields.size),
983
- bidderBalance: (0, reified_1.decodeFromFields)("u64", fields.bidder_balance),
984
- incentiveBalance: (0, reified_1.decodeFromFields)("u64", fields.incentive_balance),
985
- tsMs: (0, reified_1.decodeFromFields)("u64", fields.ts_ms),
986
- });
987
- };
988
- NewBid.fromFieldsWithTypes = function (item) {
989
- if (!isNewBid(item.type)) {
990
- throw new Error("not a NewBid type");
991
- }
992
- return NewBid.reified().new({
993
- signer: (0, reified_1.decodeFromFieldsWithTypes)("address", item.fields.signer),
994
- index: (0, reified_1.decodeFromFieldsWithTypes)("u64", item.fields.index),
995
- token: (0, reified_1.decodeFromFieldsWithTypes)(structs_1.TypeName.reified(), item.fields.token),
996
- bidIndex: (0, reified_1.decodeFromFieldsWithTypes)("u64", item.fields.bid_index),
997
- price: (0, reified_1.decodeFromFieldsWithTypes)("u64", item.fields.price),
998
- size: (0, reified_1.decodeFromFieldsWithTypes)("u64", item.fields.size),
999
- bidderBalance: (0, reified_1.decodeFromFieldsWithTypes)("u64", item.fields.bidder_balance),
1000
- incentiveBalance: (0, reified_1.decodeFromFieldsWithTypes)("u64", item.fields.incentive_balance),
1001
- tsMs: (0, reified_1.decodeFromFieldsWithTypes)("u64", item.fields.ts_ms),
1002
- });
1003
- };
1004
- NewBid.fromBcs = function (data) {
1005
- return NewBid.fromFields(NewBid.bcs.parse(data));
1006
- };
1007
- NewBid.prototype.toJSONField = function () {
1008
- return {
1009
- signer: this.signer,
1010
- index: this.index.toString(),
1011
- token: this.token.toJSONField(),
1012
- bidIndex: this.bidIndex.toString(),
1013
- price: this.price.toString(),
1014
- size: this.size.toString(),
1015
- bidderBalance: this.bidderBalance.toString(),
1016
- incentiveBalance: this.incentiveBalance.toString(),
1017
- tsMs: this.tsMs.toString(),
1018
- };
1019
- };
1020
- NewBid.prototype.toJSON = function () {
1021
- return __assign({ $typeName: this.$typeName, $typeArgs: this.$typeArgs }, this.toJSONField());
1022
- };
1023
- NewBid.fromJSONField = function (field) {
1024
- return NewBid.reified().new({
1025
- signer: (0, reified_1.decodeFromJSONField)("address", field.signer),
1026
- index: (0, reified_1.decodeFromJSONField)("u64", field.index),
1027
- token: (0, reified_1.decodeFromJSONField)(structs_1.TypeName.reified(), field.token),
1028
- bidIndex: (0, reified_1.decodeFromJSONField)("u64", field.bidIndex),
1029
- price: (0, reified_1.decodeFromJSONField)("u64", field.price),
1030
- size: (0, reified_1.decodeFromJSONField)("u64", field.size),
1031
- bidderBalance: (0, reified_1.decodeFromJSONField)("u64", field.bidderBalance),
1032
- incentiveBalance: (0, reified_1.decodeFromJSONField)("u64", field.incentiveBalance),
1033
- tsMs: (0, reified_1.decodeFromJSONField)("u64", field.tsMs),
1034
- });
1035
- };
1036
- NewBid.fromJSON = function (json) {
1037
- if (json.$typeName !== NewBid.$typeName) {
1038
- throw new Error("not a WithTwoGenerics json object");
1039
- }
1040
- return NewBid.fromJSONField(json);
1041
- };
1042
- NewBid.fromSuiParsedData = function (content) {
1043
- if (content.dataType !== "moveObject") {
1044
- throw new Error("not an object");
1045
- }
1046
- if (!isNewBid(content.type)) {
1047
- throw new Error("object at ".concat(content.fields.id, " is not a NewBid object"));
1048
- }
1049
- return NewBid.fromFieldsWithTypes(content);
1050
- };
1051
- NewBid.fromSuiObjectData = function (data) {
1052
- if (data.bcs) {
1053
- if (data.bcs.dataType !== "moveObject" || !isNewBid(data.bcs.type)) {
1054
- throw new Error("object at is not a NewBid object");
1055
- }
1056
- return NewBid.fromBcs((0, utils_1.fromB64)(data.bcs.bcsBytes));
1057
- }
1058
- if (data.content) {
1059
- return NewBid.fromSuiParsedData(data.content);
1060
- }
1061
- throw new Error("Both `bcs` and `content` fields are missing from the data. Include `showBcs` or `showContent` in the request.");
1062
- };
1063
- NewBid.fetch = function (client, id) {
1064
- return __awaiter(this, void 0, void 0, function () {
1065
- var res;
1066
- var _a, _b;
1067
- return __generator(this, function (_c) {
1068
- switch (_c.label) {
1069
- case 0: return [4 /*yield*/, client.getObject({ id: id, options: { showBcs: true } })];
1070
- case 1:
1071
- res = _c.sent();
1072
- if (res.error) {
1073
- throw new Error("error fetching NewBid object at id ".concat(id, ": ").concat(res.error.code));
1074
- }
1075
- if (((_b = (_a = res.data) === null || _a === void 0 ? void 0 : _a.bcs) === null || _b === void 0 ? void 0 : _b.dataType) !== "moveObject" || !isNewBid(res.data.bcs.type)) {
1076
- throw new Error("object at id ".concat(id, " is not a NewBid object"));
1077
- }
1078
- return [2 /*return*/, NewBid.fromSuiObjectData(res.data)];
1079
- }
1080
- });
1081
- });
1082
- };
1083
- NewBid.$typeName = "".concat(index_1.PKG_V1, "::dutch::NewBid");
1084
- NewBid.$numTypeParams = 0;
1085
- NewBid.$isPhantom = [];
1086
- return NewBid;
1087
- }());
1088
- exports.NewBid = NewBid;
1089
- /* ============================== RemoveBid =============================== */
1090
- function isRemoveBid(type) {
1091
- type = (0, util_1.compressSuiType)(type);
1092
- return type === "".concat(index_1.PKG_V1, "::dutch::RemoveBid");
1093
- }
1094
- var RemoveBid = /** @class */ (function () {
1095
- function RemoveBid(typeArgs, fields) {
1096
- this.__StructClass = true;
1097
- this.$typeName = RemoveBid.$typeName;
1098
- this.$isPhantom = RemoveBid.$isPhantom;
1099
- this.$fullTypeName = util_1.composeSuiType.apply(void 0, __spreadArray([RemoveBid.$typeName], __read(typeArgs), false));
1100
- this.$typeArgs = typeArgs;
1101
- this.signer = fields.signer;
1102
- this.index = fields.index;
1103
- this.token = fields.token;
1104
- this.bidIndex = fields.bidIndex;
1105
- this.price = fields.price;
1106
- this.size = fields.size;
1107
- this.bidderBalance = fields.bidderBalance;
1108
- this.incentiveBalance = fields.incentiveBalance;
1109
- this.feeDiscount = fields.feeDiscount;
1110
- this.tsMs = fields.tsMs;
1111
- }
1112
- RemoveBid.reified = function () {
1113
- var _this = this;
1114
- return {
1115
- typeName: RemoveBid.$typeName,
1116
- fullTypeName: util_1.composeSuiType.apply(void 0, __spreadArray([RemoveBid.$typeName], [], false)),
1117
- typeArgs: [],
1118
- isPhantom: RemoveBid.$isPhantom,
1119
- reifiedTypeArgs: [],
1120
- fromFields: function (fields) { return RemoveBid.fromFields(fields); },
1121
- fromFieldsWithTypes: function (item) { return RemoveBid.fromFieldsWithTypes(item); },
1122
- fromBcs: function (data) { return RemoveBid.fromBcs(data); },
1123
- bcs: RemoveBid.bcs,
1124
- fromJSONField: function (field) { return RemoveBid.fromJSONField(field); },
1125
- fromJSON: function (json) { return RemoveBid.fromJSON(json); },
1126
- fromSuiParsedData: function (content) { return RemoveBid.fromSuiParsedData(content); },
1127
- fromSuiObjectData: function (content) { return RemoveBid.fromSuiObjectData(content); },
1128
- fetch: function (client, id) { return __awaiter(_this, void 0, void 0, function () { return __generator(this, function (_a) {
1129
- return [2 /*return*/, RemoveBid.fetch(client, id)];
1130
- }); }); },
1131
- new: function (fields) {
1132
- return new RemoveBid([], fields);
1133
- },
1134
- kind: "StructClassReified",
1135
- };
1136
- };
1137
- Object.defineProperty(RemoveBid, "r", {
1138
- get: function () {
1139
- return RemoveBid.reified();
1140
- },
1141
- enumerable: false,
1142
- configurable: true
1143
- });
1144
- RemoveBid.phantom = function () {
1145
- return (0, reified_1.phantom)(RemoveBid.reified());
1146
- };
1147
- Object.defineProperty(RemoveBid, "p", {
1148
- get: function () {
1149
- return RemoveBid.phantom();
1150
- },
1151
- enumerable: false,
1152
- configurable: true
1153
- });
1154
- Object.defineProperty(RemoveBid, "bcs", {
1155
- get: function () {
1156
- return bcs_1.bcs.struct("RemoveBid", {
1157
- signer: bcs_1.bcs.bytes(32).transform({ input: function (val) { return (0, utils_1.fromHEX)(val); }, output: function (val) { return (0, utils_1.toHEX)(val); } }),
1158
- index: bcs_1.bcs.u64(),
1159
- token: structs_1.TypeName.bcs,
1160
- bid_index: bcs_1.bcs.u64(),
1161
- price: bcs_1.bcs.u64(),
1162
- size: bcs_1.bcs.u64(),
1163
- bidder_balance: bcs_1.bcs.u64(),
1164
- incentive_balance: bcs_1.bcs.u64(),
1165
- fee_discount: bcs_1.bcs.u64(),
1166
- ts_ms: bcs_1.bcs.u64(),
1167
- });
1168
- },
1169
- enumerable: false,
1170
- configurable: true
1171
- });
1172
- RemoveBid.fromFields = function (fields) {
1173
- return RemoveBid.reified().new({
1174
- signer: (0, reified_1.decodeFromFields)("address", fields.signer),
1175
- index: (0, reified_1.decodeFromFields)("u64", fields.index),
1176
- token: (0, reified_1.decodeFromFields)(structs_1.TypeName.reified(), fields.token),
1177
- bidIndex: (0, reified_1.decodeFromFields)("u64", fields.bid_index),
1178
- price: (0, reified_1.decodeFromFields)("u64", fields.price),
1179
- size: (0, reified_1.decodeFromFields)("u64", fields.size),
1180
- bidderBalance: (0, reified_1.decodeFromFields)("u64", fields.bidder_balance),
1181
- incentiveBalance: (0, reified_1.decodeFromFields)("u64", fields.incentive_balance),
1182
- feeDiscount: (0, reified_1.decodeFromFields)("u64", fields.fee_discount),
1183
- tsMs: (0, reified_1.decodeFromFields)("u64", fields.ts_ms),
1184
- });
1185
- };
1186
- RemoveBid.fromFieldsWithTypes = function (item) {
1187
- if (!isRemoveBid(item.type)) {
1188
- throw new Error("not a RemoveBid type");
1189
- }
1190
- return RemoveBid.reified().new({
1191
- signer: (0, reified_1.decodeFromFieldsWithTypes)("address", item.fields.signer),
1192
- index: (0, reified_1.decodeFromFieldsWithTypes)("u64", item.fields.index),
1193
- token: (0, reified_1.decodeFromFieldsWithTypes)(structs_1.TypeName.reified(), item.fields.token),
1194
- bidIndex: (0, reified_1.decodeFromFieldsWithTypes)("u64", item.fields.bid_index),
1195
- price: (0, reified_1.decodeFromFieldsWithTypes)("u64", item.fields.price),
1196
- size: (0, reified_1.decodeFromFieldsWithTypes)("u64", item.fields.size),
1197
- bidderBalance: (0, reified_1.decodeFromFieldsWithTypes)("u64", item.fields.bidder_balance),
1198
- incentiveBalance: (0, reified_1.decodeFromFieldsWithTypes)("u64", item.fields.incentive_balance),
1199
- feeDiscount: (0, reified_1.decodeFromFieldsWithTypes)("u64", item.fields.fee_discount),
1200
- tsMs: (0, reified_1.decodeFromFieldsWithTypes)("u64", item.fields.ts_ms),
1201
- });
1202
- };
1203
- RemoveBid.fromBcs = function (data) {
1204
- return RemoveBid.fromFields(RemoveBid.bcs.parse(data));
1205
- };
1206
- RemoveBid.prototype.toJSONField = function () {
1207
- return {
1208
- signer: this.signer,
1209
- index: this.index.toString(),
1210
- token: this.token.toJSONField(),
1211
- bidIndex: this.bidIndex.toString(),
1212
- price: this.price.toString(),
1213
- size: this.size.toString(),
1214
- bidderBalance: this.bidderBalance.toString(),
1215
- incentiveBalance: this.incentiveBalance.toString(),
1216
- feeDiscount: this.feeDiscount.toString(),
1217
- tsMs: this.tsMs.toString(),
1218
- };
1219
- };
1220
- RemoveBid.prototype.toJSON = function () {
1221
- return __assign({ $typeName: this.$typeName, $typeArgs: this.$typeArgs }, this.toJSONField());
1222
- };
1223
- RemoveBid.fromJSONField = function (field) {
1224
- return RemoveBid.reified().new({
1225
- signer: (0, reified_1.decodeFromJSONField)("address", field.signer),
1226
- index: (0, reified_1.decodeFromJSONField)("u64", field.index),
1227
- token: (0, reified_1.decodeFromJSONField)(structs_1.TypeName.reified(), field.token),
1228
- bidIndex: (0, reified_1.decodeFromJSONField)("u64", field.bidIndex),
1229
- price: (0, reified_1.decodeFromJSONField)("u64", field.price),
1230
- size: (0, reified_1.decodeFromJSONField)("u64", field.size),
1231
- bidderBalance: (0, reified_1.decodeFromJSONField)("u64", field.bidderBalance),
1232
- incentiveBalance: (0, reified_1.decodeFromJSONField)("u64", field.incentiveBalance),
1233
- feeDiscount: (0, reified_1.decodeFromJSONField)("u64", field.feeDiscount),
1234
- tsMs: (0, reified_1.decodeFromJSONField)("u64", field.tsMs),
1235
- });
1236
- };
1237
- RemoveBid.fromJSON = function (json) {
1238
- if (json.$typeName !== RemoveBid.$typeName) {
1239
- throw new Error("not a WithTwoGenerics json object");
1240
- }
1241
- return RemoveBid.fromJSONField(json);
1242
- };
1243
- RemoveBid.fromSuiParsedData = function (content) {
1244
- if (content.dataType !== "moveObject") {
1245
- throw new Error("not an object");
1246
- }
1247
- if (!isRemoveBid(content.type)) {
1248
- throw new Error("object at ".concat(content.fields.id, " is not a RemoveBid object"));
1249
- }
1250
- return RemoveBid.fromFieldsWithTypes(content);
1251
- };
1252
- RemoveBid.fromSuiObjectData = function (data) {
1253
- if (data.bcs) {
1254
- if (data.bcs.dataType !== "moveObject" || !isRemoveBid(data.bcs.type)) {
1255
- throw new Error("object at is not a RemoveBid object");
1256
- }
1257
- return RemoveBid.fromBcs((0, utils_1.fromB64)(data.bcs.bcsBytes));
1258
- }
1259
- if (data.content) {
1260
- return RemoveBid.fromSuiParsedData(data.content);
1261
- }
1262
- throw new Error("Both `bcs` and `content` fields are missing from the data. Include `showBcs` or `showContent` in the request.");
1263
- };
1264
- RemoveBid.fetch = function (client, id) {
1265
- return __awaiter(this, void 0, void 0, function () {
1266
- var res;
1267
- var _a, _b;
1268
- return __generator(this, function (_c) {
1269
- switch (_c.label) {
1270
- case 0: return [4 /*yield*/, client.getObject({ id: id, options: { showBcs: true } })];
1271
- case 1:
1272
- res = _c.sent();
1273
- if (res.error) {
1274
- throw new Error("error fetching RemoveBid object at id ".concat(id, ": ").concat(res.error.code));
1275
- }
1276
- if (((_b = (_a = res.data) === null || _a === void 0 ? void 0 : _a.bcs) === null || _b === void 0 ? void 0 : _b.dataType) !== "moveObject" || !isRemoveBid(res.data.bcs.type)) {
1277
- throw new Error("object at id ".concat(id, " is not a RemoveBid object"));
1278
- }
1279
- return [2 /*return*/, RemoveBid.fromSuiObjectData(res.data)];
1280
- }
1281
- });
1282
- });
1283
- };
1284
- RemoveBid.$typeName = "".concat(index_1.PKG_V1, "::dutch::RemoveBid");
1285
- RemoveBid.$numTypeParams = 0;
1286
- RemoveBid.$isPhantom = [];
1287
- return RemoveBid;
1288
- }());
1289
- exports.RemoveBid = RemoveBid;
1290
- /* ============================== Terminate =============================== */
1291
- function isTerminate(type) {
1292
- type = (0, util_1.compressSuiType)(type);
1293
- return type === "".concat(index_1.PKG_V1, "::dutch::Terminate");
1294
- }
1295
- var Terminate = /** @class */ (function () {
1296
- function Terminate(typeArgs, fields) {
1297
- this.__StructClass = true;
1298
- this.$typeName = Terminate.$typeName;
1299
- this.$isPhantom = Terminate.$isPhantom;
1300
- this.$fullTypeName = util_1.composeSuiType.apply(void 0, __spreadArray([Terminate.$typeName], __read(typeArgs), false));
1301
- this.$typeArgs = typeArgs;
1302
- this.signer = fields.signer;
1303
- this.index = fields.index;
1304
- this.token = fields.token;
1305
- }
1306
- Terminate.reified = function () {
1307
- var _this = this;
1308
- return {
1309
- typeName: Terminate.$typeName,
1310
- fullTypeName: util_1.composeSuiType.apply(void 0, __spreadArray([Terminate.$typeName], [], false)),
1311
- typeArgs: [],
1312
- isPhantom: Terminate.$isPhantom,
1313
- reifiedTypeArgs: [],
1314
- fromFields: function (fields) { return Terminate.fromFields(fields); },
1315
- fromFieldsWithTypes: function (item) { return Terminate.fromFieldsWithTypes(item); },
1316
- fromBcs: function (data) { return Terminate.fromBcs(data); },
1317
- bcs: Terminate.bcs,
1318
- fromJSONField: function (field) { return Terminate.fromJSONField(field); },
1319
- fromJSON: function (json) { return Terminate.fromJSON(json); },
1320
- fromSuiParsedData: function (content) { return Terminate.fromSuiParsedData(content); },
1321
- fromSuiObjectData: function (content) { return Terminate.fromSuiObjectData(content); },
1322
- fetch: function (client, id) { return __awaiter(_this, void 0, void 0, function () { return __generator(this, function (_a) {
1323
- return [2 /*return*/, Terminate.fetch(client, id)];
1324
- }); }); },
1325
- new: function (fields) {
1326
- return new Terminate([], fields);
1327
- },
1328
- kind: "StructClassReified",
1329
- };
1330
- };
1331
- Object.defineProperty(Terminate, "r", {
1332
- get: function () {
1333
- return Terminate.reified();
1334
- },
1335
- enumerable: false,
1336
- configurable: true
1337
- });
1338
- Terminate.phantom = function () {
1339
- return (0, reified_1.phantom)(Terminate.reified());
1340
- };
1341
- Object.defineProperty(Terminate, "p", {
1342
- get: function () {
1343
- return Terminate.phantom();
1344
- },
1345
- enumerable: false,
1346
- configurable: true
1347
- });
1348
- Object.defineProperty(Terminate, "bcs", {
1349
- get: function () {
1350
- return bcs_1.bcs.struct("Terminate", {
1351
- signer: bcs_1.bcs.bytes(32).transform({ input: function (val) { return (0, utils_1.fromHEX)(val); }, output: function (val) { return (0, utils_1.toHEX)(val); } }),
1352
- index: bcs_1.bcs.u64(),
1353
- token: structs_1.TypeName.bcs,
1354
- });
1355
- },
1356
- enumerable: false,
1357
- configurable: true
1358
- });
1359
- Terminate.fromFields = function (fields) {
1360
- return Terminate.reified().new({
1361
- signer: (0, reified_1.decodeFromFields)("address", fields.signer),
1362
- index: (0, reified_1.decodeFromFields)("u64", fields.index),
1363
- token: (0, reified_1.decodeFromFields)(structs_1.TypeName.reified(), fields.token),
1364
- });
1365
- };
1366
- Terminate.fromFieldsWithTypes = function (item) {
1367
- if (!isTerminate(item.type)) {
1368
- throw new Error("not a Terminate type");
1369
- }
1370
- return Terminate.reified().new({
1371
- signer: (0, reified_1.decodeFromFieldsWithTypes)("address", item.fields.signer),
1372
- index: (0, reified_1.decodeFromFieldsWithTypes)("u64", item.fields.index),
1373
- token: (0, reified_1.decodeFromFieldsWithTypes)(structs_1.TypeName.reified(), item.fields.token),
1374
- });
1375
- };
1376
- Terminate.fromBcs = function (data) {
1377
- return Terminate.fromFields(Terminate.bcs.parse(data));
1378
- };
1379
- Terminate.prototype.toJSONField = function () {
1380
- return {
1381
- signer: this.signer,
1382
- index: this.index.toString(),
1383
- token: this.token.toJSONField(),
1384
- };
1385
- };
1386
- Terminate.prototype.toJSON = function () {
1387
- return __assign({ $typeName: this.$typeName, $typeArgs: this.$typeArgs }, this.toJSONField());
1388
- };
1389
- Terminate.fromJSONField = function (field) {
1390
- return Terminate.reified().new({
1391
- signer: (0, reified_1.decodeFromJSONField)("address", field.signer),
1392
- index: (0, reified_1.decodeFromJSONField)("u64", field.index),
1393
- token: (0, reified_1.decodeFromJSONField)(structs_1.TypeName.reified(), field.token),
1394
- });
1395
- };
1396
- Terminate.fromJSON = function (json) {
1397
- if (json.$typeName !== Terminate.$typeName) {
1398
- throw new Error("not a WithTwoGenerics json object");
1399
- }
1400
- return Terminate.fromJSONField(json);
1401
- };
1402
- Terminate.fromSuiParsedData = function (content) {
1403
- if (content.dataType !== "moveObject") {
1404
- throw new Error("not an object");
1405
- }
1406
- if (!isTerminate(content.type)) {
1407
- throw new Error("object at ".concat(content.fields.id, " is not a Terminate object"));
1408
- }
1409
- return Terminate.fromFieldsWithTypes(content);
1410
- };
1411
- Terminate.fromSuiObjectData = function (data) {
1412
- if (data.bcs) {
1413
- if (data.bcs.dataType !== "moveObject" || !isTerminate(data.bcs.type)) {
1414
- throw new Error("object at is not a Terminate object");
1415
- }
1416
- return Terminate.fromBcs((0, utils_1.fromB64)(data.bcs.bcsBytes));
1417
- }
1418
- if (data.content) {
1419
- return Terminate.fromSuiParsedData(data.content);
1420
- }
1421
- throw new Error("Both `bcs` and `content` fields are missing from the data. Include `showBcs` or `showContent` in the request.");
1422
- };
1423
- Terminate.fetch = function (client, id) {
1424
- return __awaiter(this, void 0, void 0, function () {
1425
- var res;
1426
- var _a, _b;
1427
- return __generator(this, function (_c) {
1428
- switch (_c.label) {
1429
- case 0: return [4 /*yield*/, client.getObject({ id: id, options: { showBcs: true } })];
1430
- case 1:
1431
- res = _c.sent();
1432
- if (res.error) {
1433
- throw new Error("error fetching Terminate object at id ".concat(id, ": ").concat(res.error.code));
1434
- }
1435
- if (((_b = (_a = res.data) === null || _a === void 0 ? void 0 : _a.bcs) === null || _b === void 0 ? void 0 : _b.dataType) !== "moveObject" || !isTerminate(res.data.bcs.type)) {
1436
- throw new Error("object at id ".concat(id, " is not a Terminate object"));
1437
- }
1438
- return [2 /*return*/, Terminate.fromSuiObjectData(res.data)];
1439
- }
1440
- });
1441
- });
1442
- };
1443
- Terminate.$typeName = "".concat(index_1.PKG_V1, "::dutch::Terminate");
1444
- Terminate.$numTypeParams = 0;
1445
- Terminate.$isPhantom = [];
1446
- return Terminate;
1447
- }());
1448
- exports.Terminate = Terminate;
1449
- /* ============================== UpdateAuctionConfig =============================== */
1450
- function isUpdateAuctionConfig(type) {
1451
- type = (0, util_1.compressSuiType)(type);
1452
- return type === "".concat(index_1.PKG_V1, "::dutch::UpdateAuctionConfig");
1453
- }
1454
- var UpdateAuctionConfig = /** @class */ (function () {
1455
- function UpdateAuctionConfig(typeArgs, fields) {
1456
- this.__StructClass = true;
1457
- this.$typeName = UpdateAuctionConfig.$typeName;
1458
- this.$isPhantom = UpdateAuctionConfig.$isPhantom;
1459
- this.$fullTypeName = util_1.composeSuiType.apply(void 0, __spreadArray([UpdateAuctionConfig.$typeName], __read(typeArgs), false));
1460
- this.$typeArgs = typeArgs;
1461
- this.signer = fields.signer;
1462
- this.index = fields.index;
1463
- this.prevStartTsMs = fields.prevStartTsMs;
1464
- this.prevEndTsMs = fields.prevEndTsMs;
1465
- this.prevDecaySpeed = fields.prevDecaySpeed;
1466
- this.prevInitialPrice = fields.prevInitialPrice;
1467
- this.prevFinalPrice = fields.prevFinalPrice;
1468
- this.prevFeeBp = fields.prevFeeBp;
1469
- this.prevIncentiveBp = fields.prevIncentiveBp;
1470
- this.prevTokenDecimal = fields.prevTokenDecimal;
1471
- this.prevSizeDecimal = fields.prevSizeDecimal;
1472
- this.prevAbleToRemoveBid = fields.prevAbleToRemoveBid;
1473
- this.startTsMs = fields.startTsMs;
1474
- this.endTsMs = fields.endTsMs;
1475
- this.decaySpeed = fields.decaySpeed;
1476
- this.initialPrice = fields.initialPrice;
1477
- this.finalPrice = fields.finalPrice;
1478
- this.feeBp = fields.feeBp;
1479
- this.incentiveBp = fields.incentiveBp;
1480
- this.tokenDecimal = fields.tokenDecimal;
1481
- this.sizeDecimal = fields.sizeDecimal;
1482
- this.ableToRemoveBid = fields.ableToRemoveBid;
1483
- }
1484
- UpdateAuctionConfig.reified = function () {
1485
- var _this = this;
1486
- return {
1487
- typeName: UpdateAuctionConfig.$typeName,
1488
- fullTypeName: util_1.composeSuiType.apply(void 0, __spreadArray([UpdateAuctionConfig.$typeName], [], false)),
1489
- typeArgs: [],
1490
- isPhantom: UpdateAuctionConfig.$isPhantom,
1491
- reifiedTypeArgs: [],
1492
- fromFields: function (fields) { return UpdateAuctionConfig.fromFields(fields); },
1493
- fromFieldsWithTypes: function (item) { return UpdateAuctionConfig.fromFieldsWithTypes(item); },
1494
- fromBcs: function (data) { return UpdateAuctionConfig.fromBcs(data); },
1495
- bcs: UpdateAuctionConfig.bcs,
1496
- fromJSONField: function (field) { return UpdateAuctionConfig.fromJSONField(field); },
1497
- fromJSON: function (json) { return UpdateAuctionConfig.fromJSON(json); },
1498
- fromSuiParsedData: function (content) { return UpdateAuctionConfig.fromSuiParsedData(content); },
1499
- fromSuiObjectData: function (content) { return UpdateAuctionConfig.fromSuiObjectData(content); },
1500
- fetch: function (client, id) { return __awaiter(_this, void 0, void 0, function () { return __generator(this, function (_a) {
1501
- return [2 /*return*/, UpdateAuctionConfig.fetch(client, id)];
1502
- }); }); },
1503
- new: function (fields) {
1504
- return new UpdateAuctionConfig([], fields);
1505
- },
1506
- kind: "StructClassReified",
1507
- };
1508
- };
1509
- Object.defineProperty(UpdateAuctionConfig, "r", {
1510
- get: function () {
1511
- return UpdateAuctionConfig.reified();
1512
- },
1513
- enumerable: false,
1514
- configurable: true
1515
- });
1516
- UpdateAuctionConfig.phantom = function () {
1517
- return (0, reified_1.phantom)(UpdateAuctionConfig.reified());
1518
- };
1519
- Object.defineProperty(UpdateAuctionConfig, "p", {
1520
- get: function () {
1521
- return UpdateAuctionConfig.phantom();
1522
- },
1523
- enumerable: false,
1524
- configurable: true
1525
- });
1526
- Object.defineProperty(UpdateAuctionConfig, "bcs", {
1527
- get: function () {
1528
- return bcs_1.bcs.struct("UpdateAuctionConfig", {
1529
- signer: bcs_1.bcs.bytes(32).transform({ input: function (val) { return (0, utils_1.fromHEX)(val); }, output: function (val) { return (0, utils_1.toHEX)(val); } }),
1530
- index: bcs_1.bcs.u64(),
1531
- prev_start_ts_ms: bcs_1.bcs.u64(),
1532
- prev_end_ts_ms: bcs_1.bcs.u64(),
1533
- prev_decay_speed: bcs_1.bcs.u64(),
1534
- prev_initial_price: bcs_1.bcs.u64(),
1535
- prev_final_price: bcs_1.bcs.u64(),
1536
- prev_fee_bp: bcs_1.bcs.u64(),
1537
- prev_incentive_bp: bcs_1.bcs.u64(),
1538
- prev_token_decimal: bcs_1.bcs.u64(),
1539
- prev_size_decimal: bcs_1.bcs.u64(),
1540
- prev_able_to_remove_bid: bcs_1.bcs.bool(),
1541
- start_ts_ms: bcs_1.bcs.u64(),
1542
- end_ts_ms: bcs_1.bcs.u64(),
1543
- decay_speed: bcs_1.bcs.u64(),
1544
- initial_price: bcs_1.bcs.u64(),
1545
- final_price: bcs_1.bcs.u64(),
1546
- fee_bp: bcs_1.bcs.u64(),
1547
- incentive_bp: bcs_1.bcs.u64(),
1548
- token_decimal: bcs_1.bcs.u64(),
1549
- size_decimal: bcs_1.bcs.u64(),
1550
- able_to_remove_bid: bcs_1.bcs.bool(),
1551
- });
1552
- },
1553
- enumerable: false,
1554
- configurable: true
1555
- });
1556
- UpdateAuctionConfig.fromFields = function (fields) {
1557
- return UpdateAuctionConfig.reified().new({
1558
- signer: (0, reified_1.decodeFromFields)("address", fields.signer),
1559
- index: (0, reified_1.decodeFromFields)("u64", fields.index),
1560
- prevStartTsMs: (0, reified_1.decodeFromFields)("u64", fields.prev_start_ts_ms),
1561
- prevEndTsMs: (0, reified_1.decodeFromFields)("u64", fields.prev_end_ts_ms),
1562
- prevDecaySpeed: (0, reified_1.decodeFromFields)("u64", fields.prev_decay_speed),
1563
- prevInitialPrice: (0, reified_1.decodeFromFields)("u64", fields.prev_initial_price),
1564
- prevFinalPrice: (0, reified_1.decodeFromFields)("u64", fields.prev_final_price),
1565
- prevFeeBp: (0, reified_1.decodeFromFields)("u64", fields.prev_fee_bp),
1566
- prevIncentiveBp: (0, reified_1.decodeFromFields)("u64", fields.prev_incentive_bp),
1567
- prevTokenDecimal: (0, reified_1.decodeFromFields)("u64", fields.prev_token_decimal),
1568
- prevSizeDecimal: (0, reified_1.decodeFromFields)("u64", fields.prev_size_decimal),
1569
- prevAbleToRemoveBid: (0, reified_1.decodeFromFields)("bool", fields.prev_able_to_remove_bid),
1570
- startTsMs: (0, reified_1.decodeFromFields)("u64", fields.start_ts_ms),
1571
- endTsMs: (0, reified_1.decodeFromFields)("u64", fields.end_ts_ms),
1572
- decaySpeed: (0, reified_1.decodeFromFields)("u64", fields.decay_speed),
1573
- initialPrice: (0, reified_1.decodeFromFields)("u64", fields.initial_price),
1574
- finalPrice: (0, reified_1.decodeFromFields)("u64", fields.final_price),
1575
- feeBp: (0, reified_1.decodeFromFields)("u64", fields.fee_bp),
1576
- incentiveBp: (0, reified_1.decodeFromFields)("u64", fields.incentive_bp),
1577
- tokenDecimal: (0, reified_1.decodeFromFields)("u64", fields.token_decimal),
1578
- sizeDecimal: (0, reified_1.decodeFromFields)("u64", fields.size_decimal),
1579
- ableToRemoveBid: (0, reified_1.decodeFromFields)("bool", fields.able_to_remove_bid),
1580
- });
1581
- };
1582
- UpdateAuctionConfig.fromFieldsWithTypes = function (item) {
1583
- if (!isUpdateAuctionConfig(item.type)) {
1584
- throw new Error("not a UpdateAuctionConfig type");
1585
- }
1586
- return UpdateAuctionConfig.reified().new({
1587
- signer: (0, reified_1.decodeFromFieldsWithTypes)("address", item.fields.signer),
1588
- index: (0, reified_1.decodeFromFieldsWithTypes)("u64", item.fields.index),
1589
- prevStartTsMs: (0, reified_1.decodeFromFieldsWithTypes)("u64", item.fields.prev_start_ts_ms),
1590
- prevEndTsMs: (0, reified_1.decodeFromFieldsWithTypes)("u64", item.fields.prev_end_ts_ms),
1591
- prevDecaySpeed: (0, reified_1.decodeFromFieldsWithTypes)("u64", item.fields.prev_decay_speed),
1592
- prevInitialPrice: (0, reified_1.decodeFromFieldsWithTypes)("u64", item.fields.prev_initial_price),
1593
- prevFinalPrice: (0, reified_1.decodeFromFieldsWithTypes)("u64", item.fields.prev_final_price),
1594
- prevFeeBp: (0, reified_1.decodeFromFieldsWithTypes)("u64", item.fields.prev_fee_bp),
1595
- prevIncentiveBp: (0, reified_1.decodeFromFieldsWithTypes)("u64", item.fields.prev_incentive_bp),
1596
- prevTokenDecimal: (0, reified_1.decodeFromFieldsWithTypes)("u64", item.fields.prev_token_decimal),
1597
- prevSizeDecimal: (0, reified_1.decodeFromFieldsWithTypes)("u64", item.fields.prev_size_decimal),
1598
- prevAbleToRemoveBid: (0, reified_1.decodeFromFieldsWithTypes)("bool", item.fields.prev_able_to_remove_bid),
1599
- startTsMs: (0, reified_1.decodeFromFieldsWithTypes)("u64", item.fields.start_ts_ms),
1600
- endTsMs: (0, reified_1.decodeFromFieldsWithTypes)("u64", item.fields.end_ts_ms),
1601
- decaySpeed: (0, reified_1.decodeFromFieldsWithTypes)("u64", item.fields.decay_speed),
1602
- initialPrice: (0, reified_1.decodeFromFieldsWithTypes)("u64", item.fields.initial_price),
1603
- finalPrice: (0, reified_1.decodeFromFieldsWithTypes)("u64", item.fields.final_price),
1604
- feeBp: (0, reified_1.decodeFromFieldsWithTypes)("u64", item.fields.fee_bp),
1605
- incentiveBp: (0, reified_1.decodeFromFieldsWithTypes)("u64", item.fields.incentive_bp),
1606
- tokenDecimal: (0, reified_1.decodeFromFieldsWithTypes)("u64", item.fields.token_decimal),
1607
- sizeDecimal: (0, reified_1.decodeFromFieldsWithTypes)("u64", item.fields.size_decimal),
1608
- ableToRemoveBid: (0, reified_1.decodeFromFieldsWithTypes)("bool", item.fields.able_to_remove_bid),
1609
- });
1610
- };
1611
- UpdateAuctionConfig.fromBcs = function (data) {
1612
- return UpdateAuctionConfig.fromFields(UpdateAuctionConfig.bcs.parse(data));
1613
- };
1614
- UpdateAuctionConfig.prototype.toJSONField = function () {
1615
- return {
1616
- signer: this.signer,
1617
- index: this.index.toString(),
1618
- prevStartTsMs: this.prevStartTsMs.toString(),
1619
- prevEndTsMs: this.prevEndTsMs.toString(),
1620
- prevDecaySpeed: this.prevDecaySpeed.toString(),
1621
- prevInitialPrice: this.prevInitialPrice.toString(),
1622
- prevFinalPrice: this.prevFinalPrice.toString(),
1623
- prevFeeBp: this.prevFeeBp.toString(),
1624
- prevIncentiveBp: this.prevIncentiveBp.toString(),
1625
- prevTokenDecimal: this.prevTokenDecimal.toString(),
1626
- prevSizeDecimal: this.prevSizeDecimal.toString(),
1627
- prevAbleToRemoveBid: this.prevAbleToRemoveBid,
1628
- startTsMs: this.startTsMs.toString(),
1629
- endTsMs: this.endTsMs.toString(),
1630
- decaySpeed: this.decaySpeed.toString(),
1631
- initialPrice: this.initialPrice.toString(),
1632
- finalPrice: this.finalPrice.toString(),
1633
- feeBp: this.feeBp.toString(),
1634
- incentiveBp: this.incentiveBp.toString(),
1635
- tokenDecimal: this.tokenDecimal.toString(),
1636
- sizeDecimal: this.sizeDecimal.toString(),
1637
- ableToRemoveBid: this.ableToRemoveBid,
1638
- };
1639
- };
1640
- UpdateAuctionConfig.prototype.toJSON = function () {
1641
- return __assign({ $typeName: this.$typeName, $typeArgs: this.$typeArgs }, this.toJSONField());
1642
- };
1643
- UpdateAuctionConfig.fromJSONField = function (field) {
1644
- return UpdateAuctionConfig.reified().new({
1645
- signer: (0, reified_1.decodeFromJSONField)("address", field.signer),
1646
- index: (0, reified_1.decodeFromJSONField)("u64", field.index),
1647
- prevStartTsMs: (0, reified_1.decodeFromJSONField)("u64", field.prevStartTsMs),
1648
- prevEndTsMs: (0, reified_1.decodeFromJSONField)("u64", field.prevEndTsMs),
1649
- prevDecaySpeed: (0, reified_1.decodeFromJSONField)("u64", field.prevDecaySpeed),
1650
- prevInitialPrice: (0, reified_1.decodeFromJSONField)("u64", field.prevInitialPrice),
1651
- prevFinalPrice: (0, reified_1.decodeFromJSONField)("u64", field.prevFinalPrice),
1652
- prevFeeBp: (0, reified_1.decodeFromJSONField)("u64", field.prevFeeBp),
1653
- prevIncentiveBp: (0, reified_1.decodeFromJSONField)("u64", field.prevIncentiveBp),
1654
- prevTokenDecimal: (0, reified_1.decodeFromJSONField)("u64", field.prevTokenDecimal),
1655
- prevSizeDecimal: (0, reified_1.decodeFromJSONField)("u64", field.prevSizeDecimal),
1656
- prevAbleToRemoveBid: (0, reified_1.decodeFromJSONField)("bool", field.prevAbleToRemoveBid),
1657
- startTsMs: (0, reified_1.decodeFromJSONField)("u64", field.startTsMs),
1658
- endTsMs: (0, reified_1.decodeFromJSONField)("u64", field.endTsMs),
1659
- decaySpeed: (0, reified_1.decodeFromJSONField)("u64", field.decaySpeed),
1660
- initialPrice: (0, reified_1.decodeFromJSONField)("u64", field.initialPrice),
1661
- finalPrice: (0, reified_1.decodeFromJSONField)("u64", field.finalPrice),
1662
- feeBp: (0, reified_1.decodeFromJSONField)("u64", field.feeBp),
1663
- incentiveBp: (0, reified_1.decodeFromJSONField)("u64", field.incentiveBp),
1664
- tokenDecimal: (0, reified_1.decodeFromJSONField)("u64", field.tokenDecimal),
1665
- sizeDecimal: (0, reified_1.decodeFromJSONField)("u64", field.sizeDecimal),
1666
- ableToRemoveBid: (0, reified_1.decodeFromJSONField)("bool", field.ableToRemoveBid),
1667
- });
1668
- };
1669
- UpdateAuctionConfig.fromJSON = function (json) {
1670
- if (json.$typeName !== UpdateAuctionConfig.$typeName) {
1671
- throw new Error("not a WithTwoGenerics json object");
1672
- }
1673
- return UpdateAuctionConfig.fromJSONField(json);
1674
- };
1675
- UpdateAuctionConfig.fromSuiParsedData = function (content) {
1676
- if (content.dataType !== "moveObject") {
1677
- throw new Error("not an object");
1678
- }
1679
- if (!isUpdateAuctionConfig(content.type)) {
1680
- throw new Error("object at ".concat(content.fields.id, " is not a UpdateAuctionConfig object"));
1681
- }
1682
- return UpdateAuctionConfig.fromFieldsWithTypes(content);
1683
- };
1684
- UpdateAuctionConfig.fromSuiObjectData = function (data) {
1685
- if (data.bcs) {
1686
- if (data.bcs.dataType !== "moveObject" || !isUpdateAuctionConfig(data.bcs.type)) {
1687
- throw new Error("object at is not a UpdateAuctionConfig object");
1688
- }
1689
- return UpdateAuctionConfig.fromBcs((0, utils_1.fromB64)(data.bcs.bcsBytes));
1690
- }
1691
- if (data.content) {
1692
- return UpdateAuctionConfig.fromSuiParsedData(data.content);
1693
- }
1694
- throw new Error("Both `bcs` and `content` fields are missing from the data. Include `showBcs` or `showContent` in the request.");
1695
- };
1696
- UpdateAuctionConfig.fetch = function (client, id) {
1697
- return __awaiter(this, void 0, void 0, function () {
1698
- var res;
1699
- var _a, _b;
1700
- return __generator(this, function (_c) {
1701
- switch (_c.label) {
1702
- case 0: return [4 /*yield*/, client.getObject({ id: id, options: { showBcs: true } })];
1703
- case 1:
1704
- res = _c.sent();
1705
- if (res.error) {
1706
- throw new Error("error fetching UpdateAuctionConfig object at id ".concat(id, ": ").concat(res.error.code));
1707
- }
1708
- if (((_b = (_a = res.data) === null || _a === void 0 ? void 0 : _a.bcs) === null || _b === void 0 ? void 0 : _b.dataType) !== "moveObject" || !isUpdateAuctionConfig(res.data.bcs.type)) {
1709
- throw new Error("object at id ".concat(id, " is not a UpdateAuctionConfig object"));
1710
- }
1711
- return [2 /*return*/, UpdateAuctionConfig.fromSuiObjectData(res.data)];
1712
- }
1713
- });
1714
- });
1715
- };
1716
- UpdateAuctionConfig.$typeName = "".concat(index_1.PKG_V1, "::dutch::UpdateAuctionConfig");
1717
- UpdateAuctionConfig.$numTypeParams = 0;
1718
- UpdateAuctionConfig.$isPhantom = [];
1719
- return UpdateAuctionConfig;
1720
- }());
1721
- exports.UpdateAuctionConfig = UpdateAuctionConfig;