@typus/typus-perp-sdk 1.0.0 → 1.0.3

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 (335) hide show
  1. package/dist/src/_framework/init-loader.js +4 -32
  2. package/dist/src/fetch.d.ts +10 -4
  3. package/dist/src/fetch.js +122 -110
  4. package/dist/src/index.d.ts +0 -2
  5. package/dist/src/index.js +0 -2
  6. package/dist/src/typus_perp/admin/structs.d.ts +66 -4
  7. package/dist/src/typus_perp/admin/structs.js +155 -1
  8. package/dist/src/typus_perp/error/functions.d.ts +4 -0
  9. package/dist/src/typus_perp/error/functions.js +16 -0
  10. package/dist/src/typus_perp/escrow/structs.d.ts +1 -1
  11. package/dist/src/typus_perp/index.js +4 -4
  12. package/dist/src/typus_perp/init.js +2 -2
  13. package/dist/src/typus_perp/lp-pool/structs.d.ts +26 -26
  14. package/dist/src/typus_perp/oracle/structs.d.ts +2 -2
  15. package/dist/src/typus_perp/position/functions.d.ts +3 -0
  16. package/dist/src/typus_perp/position/functions.js +7 -1
  17. package/dist/src/typus_perp/position/structs.d.ts +42 -164
  18. package/dist/src/typus_perp/position/structs.js +31 -209
  19. package/dist/src/typus_perp/symbol/structs.d.ts +1 -1
  20. package/dist/src/typus_perp/tlp/structs.d.ts +2 -2
  21. package/dist/src/typus_perp/trading/structs.d.ts +179 -139
  22. package/dist/src/typus_perp/trading/structs.js +227 -173
  23. package/dist/src/typus_perp/treasury-caps/structs.d.ts +1 -1
  24. package/dist/src/typus_stake_pool/admin/structs.d.ts +4 -4
  25. package/dist/src/typus_stake_pool/index.js +4 -4
  26. package/dist/src/typus_stake_pool/init.js +2 -2
  27. package/dist/src/typus_stake_pool/stake-pool/functions.d.ts +16 -16
  28. package/dist/src/typus_stake_pool/stake-pool/functions.js +28 -28
  29. package/dist/src/typus_stake_pool/stake-pool/structs.d.ts +202 -202
  30. package/dist/src/typus_stake_pool/stake-pool/structs.js +404 -404
  31. package/dist/src/user/history.js +98 -18
  32. package/dist/src/user/order.js +6 -0
  33. package/dist/src/user/orderWithBidReceipt.d.ts +2 -4
  34. package/dist/src/user/orderWithBidReceipt.js +3 -14
  35. package/package.json +2 -1
  36. package/dist/src/_dependencies/source/0x1/bit-vector/structs.d.ts +0 -56
  37. package/dist/src/_dependencies/source/0x1/bit-vector/structs.js +0 -268
  38. package/dist/src/_dependencies/source/0x1/fixed-point32/structs.d.ts +0 -46
  39. package/dist/src/_dependencies/source/0x1/fixed-point32/structs.js +0 -222
  40. package/dist/src/_dependencies/source/0x1/init.d.ts +0 -2
  41. package/dist/src/_dependencies/source/0x1/init.js +0 -55
  42. package/dist/src/_dependencies/source/0x1/uq32-32/structs.d.ts +0 -46
  43. package/dist/src/_dependencies/source/0x1/uq32-32/structs.js +0 -222
  44. package/dist/src/_dependencies/source/0x1/uq64-64/structs.d.ts +0 -46
  45. package/dist/src/_dependencies/source/0x1/uq64-64/structs.js +0 -222
  46. package/dist/src/_dependencies/source/0x1d17058789bd1e1e79f1a92424519a88146f191f58a06cc4d9ab23d17d46ab73/index.d.ts +0 -5
  47. package/dist/src/_dependencies/source/0x1d17058789bd1e1e79f1a92424519a88146f191f58a06cc4d9ab23d17d46ab73/index.js +0 -8
  48. package/dist/src/_dependencies/source/0x1d17058789bd1e1e79f1a92424519a88146f191f58a06cc4d9ab23d17d46ab73/init.d.ts +0 -2
  49. package/dist/src/_dependencies/source/0x1d17058789bd1e1e79f1a92424519a88146f191f58a06cc4d9ab23d17d46ab73/init.js +0 -50
  50. package/dist/src/_dependencies/source/0x1d17058789bd1e1e79f1a92424519a88146f191f58a06cc4d9ab23d17d46ab73/oracle/structs.d.ts +0 -350
  51. package/dist/src/_dependencies/source/0x1d17058789bd1e1e79f1a92424519a88146f191f58a06cc4d9ab23d17d46ab73/oracle/structs.js +0 -794
  52. package/dist/src/_dependencies/source/0x1d17058789bd1e1e79f1a92424519a88146f191f58a06cc4d9ab23d17d46ab73/pyth-parser/structs.d.ts +0 -111
  53. package/dist/src/_dependencies/source/0x1d17058789bd1e1e79f1a92424519a88146f191f58a06cc4d9ab23d17d46ab73/pyth-parser/structs.js +0 -389
  54. package/dist/src/_dependencies/source/0x1d17058789bd1e1e79f1a92424519a88146f191f58a06cc4d9ab23d17d46ab73/supra/structs.d.ts +0 -70
  55. package/dist/src/_dependencies/source/0x1d17058789bd1e1e79f1a92424519a88146f191f58a06cc4d9ab23d17d46ab73/supra/structs.js +0 -252
  56. package/dist/src/_dependencies/source/0x1d17058789bd1e1e79f1a92424519a88146f191f58a06cc4d9ab23d17d46ab73/switchboard-feed-parser/structs.d.ts +0 -70
  57. package/dist/src/_dependencies/source/0x1d17058789bd1e1e79f1a92424519a88146f191f58a06cc4d9ab23d17d46ab73/switchboard-feed-parser/structs.js +0 -252
  58. package/dist/src/_dependencies/source/0x2/authenticator-state/structs.d.ts +0 -464
  59. package/dist/src/_dependencies/source/0x2/authenticator-state/structs.js +0 -904
  60. package/dist/src/_dependencies/source/0x2/bag/structs.d.ts +0 -61
  61. package/dist/src/_dependencies/source/0x2/bag/structs.js +0 -229
  62. package/dist/src/_dependencies/source/0x2/balance/structs.d.ts +0 -88
  63. package/dist/src/_dependencies/source/0x2/balance/structs.js +0 -386
  64. package/dist/src/_dependencies/source/0x2/bcs/structs.d.ts +0 -50
  65. package/dist/src/_dependencies/source/0x2/bcs/structs.js +0 -256
  66. package/dist/src/_dependencies/source/0x2/bls12381/structs.d.ts +0 -214
  67. package/dist/src/_dependencies/source/0x2/bls12381/structs.js +0 -790
  68. package/dist/src/_dependencies/source/0x2/borrow/structs.d.ts +0 -113
  69. package/dist/src/_dependencies/source/0x2/borrow/structs.js +0 -398
  70. package/dist/src/_dependencies/source/0x2/clock/structs.d.ts +0 -61
  71. package/dist/src/_dependencies/source/0x2/clock/structs.js +0 -235
  72. package/dist/src/_dependencies/source/0x2/coin/structs.d.ts +0 -460
  73. package/dist/src/_dependencies/source/0x2/coin/structs.js +0 -1247
  74. package/dist/src/_dependencies/source/0x2/config/structs.d.ts +0 -179
  75. package/dist/src/_dependencies/source/0x2/config/structs.js +0 -567
  76. package/dist/src/_dependencies/source/0x2/deny-list/structs.d.ts +0 -430
  77. package/dist/src/_dependencies/source/0x2/deny-list/structs.js +0 -1166
  78. package/dist/src/_dependencies/source/0x2/display/structs.d.ts +0 -241
  79. package/dist/src/_dependencies/source/0x2/display/structs.js +0 -578
  80. package/dist/src/_dependencies/source/0x2/dynamic-field/structs.d.ts +0 -68
  81. package/dist/src/_dependencies/source/0x2/dynamic-field/structs.js +0 -256
  82. package/dist/src/_dependencies/source/0x2/dynamic-object-field/structs.d.ts +0 -47
  83. package/dist/src/_dependencies/source/0x2/dynamic-object-field/structs.js +0 -236
  84. package/dist/src/_dependencies/source/0x2/groth16/structs.d.ts +0 -204
  85. package/dist/src/_dependencies/source/0x2/groth16/structs.js +0 -706
  86. package/dist/src/_dependencies/source/0x2/group-ops/structs.d.ts +0 -50
  87. package/dist/src/_dependencies/source/0x2/group-ops/structs.js +0 -267
  88. package/dist/src/_dependencies/source/0x2/init.d.ts +0 -2
  89. package/dist/src/_dependencies/source/0x2/init.js +0 -171
  90. package/dist/src/_dependencies/source/0x2/kiosk/structs.d.ts +0 -606
  91. package/dist/src/_dependencies/source/0x2/kiosk/structs.js +0 -1719
  92. package/dist/src/_dependencies/source/0x2/kiosk-extension/structs.d.ts +0 -121
  93. package/dist/src/_dependencies/source/0x2/kiosk-extension/structs.js +0 -394
  94. package/dist/src/_dependencies/source/0x2/linked-table/structs.d.ts +0 -153
  95. package/dist/src/_dependencies/source/0x2/linked-table/structs.js +0 -438
  96. package/dist/src/_dependencies/source/0x2/object-bag/structs.d.ts +0 -61
  97. package/dist/src/_dependencies/source/0x2/object-bag/structs.js +0 -229
  98. package/dist/src/_dependencies/source/0x2/package/structs.d.ts +0 -280
  99. package/dist/src/_dependencies/source/0x2/package/structs.js +0 -762
  100. package/dist/src/_dependencies/source/0x2/priority-queue/structs.d.ts +0 -111
  101. package/dist/src/_dependencies/source/0x2/priority-queue/structs.js +0 -440
  102. package/dist/src/_dependencies/source/0x2/random/structs.d.ts +0 -204
  103. package/dist/src/_dependencies/source/0x2/random/structs.js +0 -596
  104. package/dist/src/_dependencies/source/0x2/sui/structs.d.ts +0 -46
  105. package/dist/src/_dependencies/source/0x2/sui/structs.js +0 -222
  106. package/dist/src/_dependencies/source/0x2/table/structs.d.ts +0 -61
  107. package/dist/src/_dependencies/source/0x2/table/structs.js +0 -248
  108. package/dist/src/_dependencies/source/0x2/table-vec/structs.d.ts +0 -68
  109. package/dist/src/_dependencies/source/0x2/table-vec/structs.js +0 -274
  110. package/dist/src/_dependencies/source/0x2/token/structs.d.ts +0 -449
  111. package/dist/src/_dependencies/source/0x2/token/structs.js +0 -1095
  112. package/dist/src/_dependencies/source/0x2/transfer/structs.d.ts +0 -57
  113. package/dist/src/_dependencies/source/0x2/transfer/structs.js +0 -246
  114. package/dist/src/_dependencies/source/0x2/transfer-policy/structs.d.ts +0 -370
  115. package/dist/src/_dependencies/source/0x2/transfer-policy/structs.js +0 -1091
  116. package/dist/src/_dependencies/source/0x2/tx-context/structs.d.ts +0 -74
  117. package/dist/src/_dependencies/source/0x2/tx-context/structs.js +0 -286
  118. package/dist/src/_dependencies/source/0x2/url/structs.d.ts +0 -53
  119. package/dist/src/_dependencies/source/0x2/url/structs.js +0 -223
  120. package/dist/src/_dependencies/source/0x2/versioned/structs.d.ts +0 -113
  121. package/dist/src/_dependencies/source/0x2/versioned/structs.js +0 -389
  122. package/dist/src/_dependencies/source/0x2/zklogin-verified-id/structs.d.ts +0 -110
  123. package/dist/src/_dependencies/source/0x2/zklogin-verified-id/structs.js +0 -260
  124. package/dist/src/_dependencies/source/0x2/zklogin-verified-issuer/structs.d.ts +0 -74
  125. package/dist/src/_dependencies/source/0x2/zklogin-verified-issuer/structs.js +0 -242
  126. package/dist/src/_dependencies/source/0x277f90d256d1015a78cad646db091bec451c5bbab834b9fb70bace7885b5c698/index.d.ts +0 -3
  127. package/dist/src/_dependencies/source/0x277f90d256d1015a78cad646db091bec451c5bbab834b9fb70bace7885b5c698/index.js +0 -6
  128. package/dist/src/_dependencies/source/0x277f90d256d1015a78cad646db091bec451c5bbab834b9fb70bace7885b5c698/init.d.ts +0 -2
  129. package/dist/src/_dependencies/source/0x277f90d256d1015a78cad646db091bec451c5bbab834b9fb70bace7885b5c698/init.js +0 -40
  130. package/dist/src/_dependencies/source/0x277f90d256d1015a78cad646db091bec451c5bbab834b9fb70bace7885b5c698/validator/structs.d.ts +0 -55
  131. package/dist/src/_dependencies/source/0x277f90d256d1015a78cad646db091bec451c5bbab834b9fb70bace7885b5c698/validator/structs.js +0 -223
  132. package/dist/src/_dependencies/source/0x2fdff17b86e34ab722c8ba5e63f0da070d9a4163705b3fdc6a95802cab40a72a/index.d.ts +0 -4
  133. package/dist/src/_dependencies/source/0x2fdff17b86e34ab722c8ba5e63f0da070d9a4163705b3fdc6a95802cab40a72a/index.js +0 -7
  134. package/dist/src/_dependencies/source/0x2fdff17b86e34ab722c8ba5e63f0da070d9a4163705b3fdc6a95802cab40a72a/init.d.ts +0 -2
  135. package/dist/src/_dependencies/source/0x2fdff17b86e34ab722c8ba5e63f0da070d9a4163705b3fdc6a95802cab40a72a/init.js +0 -43
  136. package/dist/src/_dependencies/source/0x2fdff17b86e34ab722c8ba5e63f0da070d9a4163705b3fdc6a95802cab40a72a/price-data-pull/structs.d.ts +0 -46
  137. package/dist/src/_dependencies/source/0x2fdff17b86e34ab722c8ba5e63f0da070d9a4163705b3fdc6a95802cab40a72a/price-data-pull/structs.js +0 -222
  138. package/dist/src/_dependencies/source/0x2fdff17b86e34ab722c8ba5e63f0da070d9a4163705b3fdc6a95802cab40a72a/suprasvaluefeed/structs.d.ts +0 -121
  139. package/dist/src/_dependencies/source/0x2fdff17b86e34ab722c8ba5e63f0da070d9a4163705b3fdc6a95802cab40a72a/suprasvaluefeed/structs.js +0 -395
  140. package/dist/src/_dependencies/source/0x4213e12a2220f15f1837a76897110d2260786558169bd8d0847f21e9b551f277/airdrop/structs.d.ts +0 -489
  141. package/dist/src/_dependencies/source/0x4213e12a2220f15f1837a76897110d2260786558169bd8d0847f21e9b551f277/airdrop/structs.js +0 -1084
  142. package/dist/src/_dependencies/source/0x4213e12a2220f15f1837a76897110d2260786558169bd8d0847f21e9b551f277/big-vector/structs.d.ts +0 -147
  143. package/dist/src/_dependencies/source/0x4213e12a2220f15f1837a76897110d2260786558169bd8d0847f21e9b551f277/big-vector/structs.js +0 -456
  144. package/dist/src/_dependencies/source/0x4213e12a2220f15f1837a76897110d2260786558169bd8d0847f21e9b551f277/critbit/structs.d.ts +0 -239
  145. package/dist/src/_dependencies/source/0x4213e12a2220f15f1837a76897110d2260786558169bd8d0847f21e9b551f277/critbit/structs.js +0 -653
  146. package/dist/src/_dependencies/source/0x4213e12a2220f15f1837a76897110d2260786558169bd8d0847f21e9b551f277/ecosystem/structs.d.ts +0 -405
  147. package/dist/src/_dependencies/source/0x4213e12a2220f15f1837a76897110d2260786558169bd8d0847f21e9b551f277/ecosystem/structs.js +0 -899
  148. package/dist/src/_dependencies/source/0x4213e12a2220f15f1837a76897110d2260786558169bd8d0847f21e9b551f277/init.d.ts +0 -2
  149. package/dist/src/_dependencies/source/0x4213e12a2220f15f1837a76897110d2260786558169bd8d0847f21e9b551f277/init.js +0 -102
  150. package/dist/src/_dependencies/source/0x4213e12a2220f15f1837a76897110d2260786558169bd8d0847f21e9b551f277/leaderboard/structs.d.ts +0 -699
  151. package/dist/src/_dependencies/source/0x4213e12a2220f15f1837a76897110d2260786558169bd8d0847f21e9b551f277/leaderboard/structs.js +0 -1459
  152. package/dist/src/_dependencies/source/0x4213e12a2220f15f1837a76897110d2260786558169bd8d0847f21e9b551f277/linked-set/structs.d.ts +0 -147
  153. package/dist/src/_dependencies/source/0x4213e12a2220f15f1837a76897110d2260786558169bd8d0847f21e9b551f277/linked-set/structs.js +0 -430
  154. package/dist/src/_dependencies/source/0x4213e12a2220f15f1837a76897110d2260786558169bd8d0847f21e9b551f277/tails-staking/structs.d.ts +0 -1071
  155. package/dist/src/_dependencies/source/0x4213e12a2220f15f1837a76897110d2260786558169bd8d0847f21e9b551f277/tails-staking/structs.js +0 -2261
  156. package/dist/src/_dependencies/source/0x4213e12a2220f15f1837a76897110d2260786558169bd8d0847f21e9b551f277/tgld/structs.d.ts +0 -279
  157. package/dist/src/_dependencies/source/0x4213e12a2220f15f1837a76897110d2260786558169bd8d0847f21e9b551f277/tgld/structs.js +0 -733
  158. package/dist/src/_dependencies/source/0x4213e12a2220f15f1837a76897110d2260786558169bd8d0847f21e9b551f277/user/structs.d.ts +0 -328
  159. package/dist/src/_dependencies/source/0x4213e12a2220f15f1837a76897110d2260786558169bd8d0847f21e9b551f277/user/structs.js +0 -892
  160. package/dist/src/_dependencies/source/0x5cfd0819411be98034cba544cbffab192c2c35674a05ff57f4f1c5042875b828/discount-mint/structs.d.ts +0 -628
  161. package/dist/src/_dependencies/source/0x5cfd0819411be98034cba544cbffab192c2c35674a05ff57f4f1c5042875b828/discount-mint/structs.js +0 -1324
  162. package/dist/src/_dependencies/source/0x5cfd0819411be98034cba544cbffab192c2c35674a05ff57f4f1c5042875b828/index.d.ts +0 -9
  163. package/dist/src/_dependencies/source/0x5cfd0819411be98034cba544cbffab192c2c35674a05ff57f4f1c5042875b828/index.js +0 -12
  164. package/dist/src/_dependencies/source/0x5cfd0819411be98034cba544cbffab192c2c35674a05ff57f4f1c5042875b828/init.d.ts +0 -2
  165. package/dist/src/_dependencies/source/0x5cfd0819411be98034cba544cbffab192c2c35674a05ff57f4f1c5042875b828/init.js +0 -72
  166. package/dist/src/_dependencies/source/0x5cfd0819411be98034cba544cbffab192c2c35674a05ff57f4f1c5042875b828/royalty-rule/structs.d.ts +0 -94
  167. package/dist/src/_dependencies/source/0x5cfd0819411be98034cba544cbffab192c2c35674a05ff57f4f1c5042875b828/royalty-rule/structs.js +0 -376
  168. package/dist/src/_dependencies/source/0x5cfd0819411be98034cba544cbffab192c2c35674a05ff57f4f1c5042875b828/staking/structs.d.ts +0 -454
  169. package/dist/src/_dependencies/source/0x5cfd0819411be98034cba544cbffab192c2c35674a05ff57f4f1c5042875b828/staking/structs.js +0 -881
  170. package/dist/src/_dependencies/source/0x5cfd0819411be98034cba544cbffab192c2c35674a05ff57f4f1c5042875b828/table-vec/structs.d.ts +0 -68
  171. package/dist/src/_dependencies/source/0x5cfd0819411be98034cba544cbffab192c2c35674a05ff57f4f1c5042875b828/table-vec/structs.js +0 -274
  172. package/dist/src/_dependencies/source/0x5cfd0819411be98034cba544cbffab192c2c35674a05ff57f4f1c5042875b828/typus-nft/structs.d.ts +0 -1117
  173. package/dist/src/_dependencies/source/0x5cfd0819411be98034cba544cbffab192c2c35674a05ff57f4f1c5042875b828/typus-nft/structs.js +0 -2387
  174. package/dist/src/_dependencies/source/0x6c9a394a43844fc09d9617bc8a8e775a4521f0e28e83de1da780d043a498671f/auto-bid/structs.d.ts +0 -1524
  175. package/dist/src/_dependencies/source/0x6c9a394a43844fc09d9617bc8a8e775a4521f0e28e83de1da780d043a498671f/auto-bid/structs.js +0 -3008
  176. package/dist/src/_dependencies/source/0x6c9a394a43844fc09d9617bc8a8e775a4521f0e28e83de1da780d043a498671f/index.d.ts +0 -10
  177. package/dist/src/_dependencies/source/0x6c9a394a43844fc09d9617bc8a8e775a4521f0e28e83de1da780d043a498671f/index.js +0 -13
  178. package/dist/src/_dependencies/source/0x6c9a394a43844fc09d9617bc8a8e775a4521f0e28e83de1da780d043a498671f/init.d.ts +0 -2
  179. package/dist/src/_dependencies/source/0x6c9a394a43844fc09d9617bc8a8e775a4521f0e28e83de1da780d043a498671f/init.js +0 -145
  180. package/dist/src/_dependencies/source/0x6c9a394a43844fc09d9617bc8a8e775a4521f0e28e83de1da780d043a498671f/tails-staking/structs.d.ts +0 -1267
  181. package/dist/src/_dependencies/source/0x6c9a394a43844fc09d9617bc8a8e775a4521f0e28e83de1da780d043a498671f/tails-staking/structs.js +0 -2820
  182. package/dist/src/_dependencies/source/0x6c9a394a43844fc09d9617bc8a8e775a4521f0e28e83de1da780d043a498671f/tds-authorized-entry/structs.d.ts +0 -1412
  183. package/dist/src/_dependencies/source/0x6c9a394a43844fc09d9617bc8a8e775a4521f0e28e83de1da780d043a498671f/tds-authorized-entry/structs.js +0 -1646
  184. package/dist/src/_dependencies/source/0x6c9a394a43844fc09d9617bc8a8e775a4521f0e28e83de1da780d043a498671f/tds-fee-pool-entry/structs.d.ts +0 -425
  185. package/dist/src/_dependencies/source/0x6c9a394a43844fc09d9617bc8a8e775a4521f0e28e83de1da780d043a498671f/tds-fee-pool-entry/structs.js +0 -1223
  186. package/dist/src/_dependencies/source/0x6c9a394a43844fc09d9617bc8a8e775a4521f0e28e83de1da780d043a498671f/tds-registry-authorized-entry/structs.d.ts +0 -1156
  187. package/dist/src/_dependencies/source/0x6c9a394a43844fc09d9617bc8a8e775a4521f0e28e83de1da780d043a498671f/tds-registry-authorized-entry/structs.js +0 -1828
  188. package/dist/src/_dependencies/source/0x6c9a394a43844fc09d9617bc8a8e775a4521f0e28e83de1da780d043a498671f/tds-view-function/structs.d.ts +0 -82
  189. package/dist/src/_dependencies/source/0x6c9a394a43844fc09d9617bc8a8e775a4521f0e28e83de1da780d043a498671f/tds-view-function/structs.js +0 -264
  190. package/dist/src/_dependencies/source/0x6c9a394a43844fc09d9617bc8a8e775a4521f0e28e83de1da780d043a498671f/typus-dov-single/structs.d.ts +0 -5022
  191. package/dist/src/_dependencies/source/0x6c9a394a43844fc09d9617bc8a8e775a4521f0e28e83de1da780d043a498671f/typus-dov-single/structs.js +0 -7585
  192. package/dist/src/_dependencies/source/0x7237ec8436ef7e927c45470db6db3a834dd84cf903aedee3844e847fe4805399/index.d.ts +0 -3
  193. package/dist/src/_dependencies/source/0x7237ec8436ef7e927c45470db6db3a834dd84cf903aedee3844e847fe4805399/index.js +0 -6
  194. package/dist/src/_dependencies/source/0x7237ec8436ef7e927c45470db6db3a834dd84cf903aedee3844e847fe4805399/init.d.ts +0 -2
  195. package/dist/src/_dependencies/source/0x7237ec8436ef7e927c45470db6db3a834dd84cf903aedee3844e847fe4805399/init.js +0 -4
  196. package/dist/src/_dependencies/source/0x908a10789a1a6953e0b73a997c10e3552f7ce4e2907afd00a334ed74bd973ded/authority/structs.d.ts +0 -88
  197. package/dist/src/_dependencies/source/0x908a10789a1a6953e0b73a997c10e3552f7ce4e2907afd00a334ed74bd973ded/authority/structs.js +0 -263
  198. package/dist/src/_dependencies/source/0x908a10789a1a6953e0b73a997c10e3552f7ce4e2907afd00a334ed74bd973ded/balance-pool/structs.d.ts +0 -347
  199. package/dist/src/_dependencies/source/0x908a10789a1a6953e0b73a997c10e3552f7ce4e2907afd00a334ed74bd973ded/balance-pool/structs.js +0 -591
  200. package/dist/src/_dependencies/source/0x908a10789a1a6953e0b73a997c10e3552f7ce4e2907afd00a334ed74bd973ded/big-vector/structs.d.ts +0 -73
  201. package/dist/src/_dependencies/source/0x908a10789a1a6953e0b73a997c10e3552f7ce4e2907afd00a334ed74bd973ded/big-vector/structs.js +0 -258
  202. package/dist/src/_dependencies/source/0x908a10789a1a6953e0b73a997c10e3552f7ce4e2907afd00a334ed74bd973ded/dutch/structs.d.ts +0 -876
  203. package/dist/src/_dependencies/source/0x908a10789a1a6953e0b73a997c10e3552f7ce4e2907afd00a334ed74bd973ded/dutch/structs.js +0 -1721
  204. package/dist/src/_dependencies/source/0x908a10789a1a6953e0b73a997c10e3552f7ce4e2907afd00a334ed74bd973ded/i64/structs.d.ts +0 -46
  205. package/dist/src/_dependencies/source/0x908a10789a1a6953e0b73a997c10e3552f7ce4e2907afd00a334ed74bd973ded/i64/structs.js +0 -222
  206. package/dist/src/_dependencies/source/0x908a10789a1a6953e0b73a997c10e3552f7ce4e2907afd00a334ed74bd973ded/init.d.ts +0 -2
  207. package/dist/src/_dependencies/source/0x908a10789a1a6953e0b73a997c10e3552f7ce4e2907afd00a334ed74bd973ded/init.js +0 -89
  208. package/dist/src/_dependencies/source/0x908a10789a1a6953e0b73a997c10e3552f7ce4e2907afd00a334ed74bd973ded/linked-list/structs.d.ts +0 -155
  209. package/dist/src/_dependencies/source/0x908a10789a1a6953e0b73a997c10e3552f7ce4e2907afd00a334ed74bd973ded/linked-list/structs.js +0 -444
  210. package/dist/src/_dependencies/source/0x98670585b87e06628ef2d7f7cb1e7bee8ada65b43b82997935225a7e6e21d18e/aggregator/structs.d.ts +0 -745
  211. package/dist/src/_dependencies/source/0x98670585b87e06628ef2d7f7cb1e7bee8ada65b43b82997935225a7e6e21d18e/aggregator/structs.js +0 -1221
  212. package/dist/src/_dependencies/source/0x98670585b87e06628ef2d7f7cb1e7bee8ada65b43b82997935225a7e6e21d18e/init.d.ts +0 -2
  213. package/dist/src/_dependencies/source/0x98670585b87e06628ef2d7f7cb1e7bee8ada65b43b82997935225a7e6e21d18e/init.js +0 -53
  214. package/dist/src/_dependencies/source/0x98670585b87e06628ef2d7f7cb1e7bee8ada65b43b82997935225a7e6e21d18e/job/structs.d.ts +0 -87
  215. package/dist/src/_dependencies/source/0x98670585b87e06628ef2d7f7cb1e7bee8ada65b43b82997935225a7e6e21d18e/job/structs.js +0 -287
  216. package/dist/src/_dependencies/source/0x98670585b87e06628ef2d7f7cb1e7bee8ada65b43b82997935225a7e6e21d18e/math/structs.d.ts +0 -58
  217. package/dist/src/_dependencies/source/0x98670585b87e06628ef2d7f7cb1e7bee8ada65b43b82997935225a7e6e21d18e/math/structs.js +0 -240
  218. package/dist/src/_dependencies/source/0x98670585b87e06628ef2d7f7cb1e7bee8ada65b43b82997935225a7e6e21d18e/quote/structs.d.ts +0 -121
  219. package/dist/src/_dependencies/source/0x98670585b87e06628ef2d7f7cb1e7bee8ada65b43b82997935225a7e6e21d18e/quote/structs.js +0 -323
  220. package/dist/src/_dependencies/source/0x98670585b87e06628ef2d7f7cb1e7bee8ada65b43b82997935225a7e6e21d18e/switchboard/structs.d.ts +0 -55
  221. package/dist/src/_dependencies/source/0x98670585b87e06628ef2d7f7cb1e7bee8ada65b43b82997935225a7e6e21d18e/switchboard/structs.js +0 -223
  222. package/dist/src/_dependencies/source/0xabf837e98c26087cba0883c0a7a28326b1fa3c5e1e2c5abdb486f9e8f594c837/batch-price-attestation/structs.d.ts +0 -289
  223. package/dist/src/_dependencies/source/0xabf837e98c26087cba0883c0a7a28326b1fa3c5e1e2c5abdb486f9e8f594c837/batch-price-attestation/structs.js +0 -453
  224. package/dist/src/_dependencies/source/0xabf837e98c26087cba0883c0a7a28326b1fa3c5e1e2c5abdb486f9e8f594c837/contract-upgrade/structs.d.ts +0 -114
  225. package/dist/src/_dependencies/source/0xabf837e98c26087cba0883c0a7a28326b1fa3c5e1e2c5abdb486f9e8f594c837/contract-upgrade/structs.js +0 -378
  226. package/dist/src/_dependencies/source/0xabf837e98c26087cba0883c0a7a28326b1fa3c5e1e2c5abdb486f9e8f594c837/data-source/structs.d.ts +0 -71
  227. package/dist/src/_dependencies/source/0xabf837e98c26087cba0883c0a7a28326b1fa3c5e1e2c5abdb486f9e8f594c837/data-source/structs.js +0 -235
  228. package/dist/src/_dependencies/source/0xabf837e98c26087cba0883c0a7a28326b1fa3c5e1e2c5abdb486f9e8f594c837/event/structs.d.ts +0 -209
  229. package/dist/src/_dependencies/source/0xabf837e98c26087cba0883c0a7a28326b1fa3c5e1e2c5abdb486f9e8f594c837/event/structs.js +0 -377
  230. package/dist/src/_dependencies/source/0xabf837e98c26087cba0883c0a7a28326b1fa3c5e1e2c5abdb486f9e8f594c837/governance/structs.d.ts +0 -73
  231. package/dist/src/_dependencies/source/0xabf837e98c26087cba0883c0a7a28326b1fa3c5e1e2c5abdb486f9e8f594c837/governance/structs.js +0 -275
  232. package/dist/src/_dependencies/source/0xabf837e98c26087cba0883c0a7a28326b1fa3c5e1e2c5abdb486f9e8f594c837/governance-action/structs.d.ts +0 -46
  233. package/dist/src/_dependencies/source/0xabf837e98c26087cba0883c0a7a28326b1fa3c5e1e2c5abdb486f9e8f594c837/governance-action/structs.js +0 -222
  234. package/dist/src/_dependencies/source/0xabf837e98c26087cba0883c0a7a28326b1fa3c5e1e2c5abdb486f9e8f594c837/governance-instruction/structs.d.ts +0 -77
  235. package/dist/src/_dependencies/source/0xabf837e98c26087cba0883c0a7a28326b1fa3c5e1e2c5abdb486f9e8f594c837/governance-instruction/structs.js +0 -281
  236. package/dist/src/_dependencies/source/0xabf837e98c26087cba0883c0a7a28326b1fa3c5e1e2c5abdb486f9e8f594c837/hot-potato-vector/structs.d.ts +0 -51
  237. package/dist/src/_dependencies/source/0xabf837e98c26087cba0883c0a7a28326b1fa3c5e1e2c5abdb486f9e8f594c837/hot-potato-vector/structs.js +0 -270
  238. package/dist/src/_dependencies/source/0xabf837e98c26087cba0883c0a7a28326b1fa3c5e1e2c5abdb486f9e8f594c837/i64/structs.d.ts +0 -52
  239. package/dist/src/_dependencies/source/0xabf837e98c26087cba0883c0a7a28326b1fa3c5e1e2c5abdb486f9e8f594c837/i64/structs.js +0 -234
  240. package/dist/src/_dependencies/source/0xabf837e98c26087cba0883c0a7a28326b1fa3c5e1e2c5abdb486f9e8f594c837/index.d.ts +0 -3
  241. package/dist/src/_dependencies/source/0xabf837e98c26087cba0883c0a7a28326b1fa3c5e1e2c5abdb486f9e8f594c837/index.js +0 -6
  242. package/dist/src/_dependencies/source/0xabf837e98c26087cba0883c0a7a28326b1fa3c5e1e2c5abdb486f9e8f594c837/init.d.ts +0 -2
  243. package/dist/src/_dependencies/source/0xabf837e98c26087cba0883c0a7a28326b1fa3c5e1e2c5abdb486f9e8f594c837/init.js +0 -95
  244. package/dist/src/_dependencies/source/0xabf837e98c26087cba0883c0a7a28326b1fa3c5e1e2c5abdb486f9e8f594c837/migrate/structs.d.ts +0 -51
  245. package/dist/src/_dependencies/source/0xabf837e98c26087cba0883c0a7a28326b1fa3c5e1e2c5abdb486f9e8f594c837/migrate/structs.js +0 -223
  246. package/dist/src/_dependencies/source/0xabf837e98c26087cba0883c0a7a28326b1fa3c5e1e2c5abdb486f9e8f594c837/price/structs.d.ts +0 -89
  247. package/dist/src/_dependencies/source/0xabf837e98c26087cba0883c0a7a28326b1fa3c5e1e2c5abdb486f9e8f594c837/price/structs.js +0 -247
  248. package/dist/src/_dependencies/source/0xabf837e98c26087cba0883c0a7a28326b1fa3c5e1e2c5abdb486f9e8f594c837/price-feed/structs.d.ts +0 -158
  249. package/dist/src/_dependencies/source/0xabf837e98c26087cba0883c0a7a28326b1fa3c5e1e2c5abdb486f9e8f594c837/price-feed/structs.js +0 -242
  250. package/dist/src/_dependencies/source/0xabf837e98c26087cba0883c0a7a28326b1fa3c5e1e2c5abdb486f9e8f594c837/price-identifier/structs.d.ts +0 -50
  251. package/dist/src/_dependencies/source/0xabf837e98c26087cba0883c0a7a28326b1fa3c5e1e2c5abdb486f9e8f594c837/price-identifier/structs.js +0 -256
  252. package/dist/src/_dependencies/source/0xabf837e98c26087cba0883c0a7a28326b1fa3c5e1e2c5abdb486f9e8f594c837/price-info/structs.d.ts +0 -360
  253. package/dist/src/_dependencies/source/0xabf837e98c26087cba0883c0a7a28326b1fa3c5e1e2c5abdb486f9e8f594c837/price-info/structs.js +0 -396
  254. package/dist/src/_dependencies/source/0xabf837e98c26087cba0883c0a7a28326b1fa3c5e1e2c5abdb486f9e8f594c837/price-status/structs.d.ts +0 -46
  255. package/dist/src/_dependencies/source/0xabf837e98c26087cba0883c0a7a28326b1fa3c5e1e2c5abdb486f9e8f594c837/price-status/structs.js +0 -222
  256. package/dist/src/_dependencies/source/0xabf837e98c26087cba0883c0a7a28326b1fa3c5e1e2c5abdb486f9e8f594c837/set/structs.d.ts +0 -120
  257. package/dist/src/_dependencies/source/0xabf837e98c26087cba0883c0a7a28326b1fa3c5e1e2c5abdb486f9e8f594c837/set/structs.js +0 -425
  258. package/dist/src/_dependencies/source/0xabf837e98c26087cba0883c0a7a28326b1fa3c5e1e2c5abdb486f9e8f594c837/set-data-sources/structs.d.ts +0 -81
  259. package/dist/src/_dependencies/source/0xabf837e98c26087cba0883c0a7a28326b1fa3c5e1e2c5abdb486f9e8f594c837/set-data-sources/structs.js +0 -257
  260. package/dist/src/_dependencies/source/0xabf837e98c26087cba0883c0a7a28326b1fa3c5e1e2c5abdb486f9e8f594c837/set-fee-recipient/structs.d.ts +0 -46
  261. package/dist/src/_dependencies/source/0xabf837e98c26087cba0883c0a7a28326b1fa3c5e1e2c5abdb486f9e8f594c837/set-fee-recipient/structs.js +0 -222
  262. package/dist/src/_dependencies/source/0xabf837e98c26087cba0883c0a7a28326b1fa3c5e1e2c5abdb486f9e8f594c837/set-governance-data-source/structs.d.ts +0 -77
  263. package/dist/src/_dependencies/source/0xabf837e98c26087cba0883c0a7a28326b1fa3c5e1e2c5abdb486f9e8f594c837/set-governance-data-source/structs.js +0 -241
  264. package/dist/src/_dependencies/source/0xabf837e98c26087cba0883c0a7a28326b1fa3c5e1e2c5abdb486f9e8f594c837/set-stale-price-threshold/structs.d.ts +0 -46
  265. package/dist/src/_dependencies/source/0xabf837e98c26087cba0883c0a7a28326b1fa3c5e1e2c5abdb486f9e8f594c837/set-stale-price-threshold/structs.js +0 -222
  266. package/dist/src/_dependencies/source/0xabf837e98c26087cba0883c0a7a28326b1fa3c5e1e2c5abdb486f9e8f594c837/set-update-fee/structs.d.ts +0 -52
  267. package/dist/src/_dependencies/source/0xabf837e98c26087cba0883c0a7a28326b1fa3c5e1e2c5abdb486f9e8f594c837/set-update-fee/structs.js +0 -234
  268. package/dist/src/_dependencies/source/0xabf837e98c26087cba0883c0a7a28326b1fa3c5e1e2c5abdb486f9e8f594c837/setup/structs.d.ts +0 -55
  269. package/dist/src/_dependencies/source/0xabf837e98c26087cba0883c0a7a28326b1fa3c5e1e2c5abdb486f9e8f594c837/setup/structs.js +0 -223
  270. package/dist/src/_dependencies/source/0xabf837e98c26087cba0883c0a7a28326b1fa3c5e1e2c5abdb486f9e8f594c837/state/structs.d.ts +0 -282
  271. package/dist/src/_dependencies/source/0xabf837e98c26087cba0883c0a7a28326b1fa3c5e1e2c5abdb486f9e8f594c837/state/structs.js +0 -560
  272. package/dist/src/_dependencies/source/0xabf837e98c26087cba0883c0a7a28326b1fa3c5e1e2c5abdb486f9e8f594c837/version-control/structs.d.ts +0 -130
  273. package/dist/src/_dependencies/source/0xabf837e98c26087cba0883c0a7a28326b1fa3c5e1e2c5abdb486f9e8f594c837/version-control/structs.js +0 -506
  274. package/dist/src/_dependencies/source/0xbd8fc1947cf119350184107a3087e2dc27efefa0dd82e25a1f699069fe81a585/index.d.ts +0 -3
  275. package/dist/src/_dependencies/source/0xbd8fc1947cf119350184107a3087e2dc27efefa0dd82e25a1f699069fe81a585/index.js +0 -6
  276. package/dist/src/_dependencies/source/0xbd8fc1947cf119350184107a3087e2dc27efefa0dd82e25a1f699069fe81a585/init.d.ts +0 -2
  277. package/dist/src/_dependencies/source/0xbd8fc1947cf119350184107a3087e2dc27efefa0dd82e25a1f699069fe81a585/init.js +0 -46
  278. package/dist/src/_dependencies/source/0xbd8fc1947cf119350184107a3087e2dc27efefa0dd82e25a1f699069fe81a585/kiosk-lock-rule/structs.d.ts +0 -88
  279. package/dist/src/_dependencies/source/0xbd8fc1947cf119350184107a3087e2dc27efefa0dd82e25a1f699069fe81a585/kiosk-lock-rule/structs.js +0 -364
  280. package/dist/src/_dependencies/source/0xbd8fc1947cf119350184107a3087e2dc27efefa0dd82e25a1f699069fe81a585/royalty-rule/structs.d.ts +0 -94
  281. package/dist/src/_dependencies/source/0xbd8fc1947cf119350184107a3087e2dc27efefa0dd82e25a1f699069fe81a585/royalty-rule/structs.js +0 -376
  282. package/dist/src/_dependencies/source/0xbd8fc1947cf119350184107a3087e2dc27efefa0dd82e25a1f699069fe81a585/witness-rule/structs.d.ts +0 -46
  283. package/dist/src/_dependencies/source/0xbd8fc1947cf119350184107a3087e2dc27efefa0dd82e25a1f699069fe81a585/witness-rule/structs.js +0 -233
  284. package/dist/src/_dependencies/source/0xf47329f4344f3bf0f8e436e2f7b485466cff300f12a166563995d3888c296a94/bytes20/structs.d.ts +0 -50
  285. package/dist/src/_dependencies/source/0xf47329f4344f3bf0f8e436e2f7b485466cff300f12a166563995d3888c296a94/bytes20/structs.js +0 -256
  286. package/dist/src/_dependencies/source/0xf47329f4344f3bf0f8e436e2f7b485466cff300f12a166563995d3888c296a94/bytes32/structs.d.ts +0 -50
  287. package/dist/src/_dependencies/source/0xf47329f4344f3bf0f8e436e2f7b485466cff300f12a166563995d3888c296a94/bytes32/structs.js +0 -256
  288. package/dist/src/_dependencies/source/0xf47329f4344f3bf0f8e436e2f7b485466cff300f12a166563995d3888c296a94/consumed-vaas/structs.d.ts +0 -77
  289. package/dist/src/_dependencies/source/0xf47329f4344f3bf0f8e436e2f7b485466cff300f12a166563995d3888c296a94/consumed-vaas/structs.js +0 -260
  290. package/dist/src/_dependencies/source/0xf47329f4344f3bf0f8e436e2f7b485466cff300f12a166563995d3888c296a94/cursor/structs.d.ts +0 -51
  291. package/dist/src/_dependencies/source/0xf47329f4344f3bf0f8e436e2f7b485466cff300f12a166563995d3888c296a94/cursor/structs.js +0 -270
  292. package/dist/src/_dependencies/source/0xf47329f4344f3bf0f8e436e2f7b485466cff300f12a166563995d3888c296a94/emitter/structs.d.ts +0 -153
  293. package/dist/src/_dependencies/source/0xf47329f4344f3bf0f8e436e2f7b485466cff300f12a166563995d3888c296a94/emitter/structs.js +0 -519
  294. package/dist/src/_dependencies/source/0xf47329f4344f3bf0f8e436e2f7b485466cff300f12a166563995d3888c296a94/external-address/structs.d.ts +0 -57
  295. package/dist/src/_dependencies/source/0xf47329f4344f3bf0f8e436e2f7b485466cff300f12a166563995d3888c296a94/external-address/structs.js +0 -223
  296. package/dist/src/_dependencies/source/0xf47329f4344f3bf0f8e436e2f7b485466cff300f12a166563995d3888c296a94/fee-collector/structs.d.ts +0 -63
  297. package/dist/src/_dependencies/source/0xf47329f4344f3bf0f8e436e2f7b485466cff300f12a166563995d3888c296a94/fee-collector/structs.js +0 -270
  298. package/dist/src/_dependencies/source/0xf47329f4344f3bf0f8e436e2f7b485466cff300f12a166563995d3888c296a94/governance-message/structs.d.ts +0 -168
  299. package/dist/src/_dependencies/source/0xf47329f4344f3bf0f8e436e2f7b485466cff300f12a166563995d3888c296a94/governance-message/structs.js +0 -470
  300. package/dist/src/_dependencies/source/0xf47329f4344f3bf0f8e436e2f7b485466cff300f12a166563995d3888c296a94/guardian/structs.d.ts +0 -57
  301. package/dist/src/_dependencies/source/0xf47329f4344f3bf0f8e436e2f7b485466cff300f12a166563995d3888c296a94/guardian/structs.js +0 -223
  302. package/dist/src/_dependencies/source/0xf47329f4344f3bf0f8e436e2f7b485466cff300f12a166563995d3888c296a94/guardian-set/structs.d.ts +0 -81
  303. package/dist/src/_dependencies/source/0xf47329f4344f3bf0f8e436e2f7b485466cff300f12a166563995d3888c296a94/guardian-set/structs.js +0 -275
  304. package/dist/src/_dependencies/source/0xf47329f4344f3bf0f8e436e2f7b485466cff300f12a166563995d3888c296a94/guardian-signature/structs.d.ts +0 -85
  305. package/dist/src/_dependencies/source/0xf47329f4344f3bf0f8e436e2f7b485466cff300f12a166563995d3888c296a94/guardian-signature/structs.js +0 -247
  306. package/dist/src/_dependencies/source/0xf47329f4344f3bf0f8e436e2f7b485466cff300f12a166563995d3888c296a94/index.d.ts +0 -3
  307. package/dist/src/_dependencies/source/0xf47329f4344f3bf0f8e436e2f7b485466cff300f12a166563995d3888c296a94/index.js +0 -6
  308. package/dist/src/_dependencies/source/0xf47329f4344f3bf0f8e436e2f7b485466cff300f12a166563995d3888c296a94/init.d.ts +0 -2
  309. package/dist/src/_dependencies/source/0xf47329f4344f3bf0f8e436e2f7b485466cff300f12a166563995d3888c296a94/init.js +0 -100
  310. package/dist/src/_dependencies/source/0xf47329f4344f3bf0f8e436e2f7b485466cff300f12a166563995d3888c296a94/migrate/structs.d.ts +0 -51
  311. package/dist/src/_dependencies/source/0xf47329f4344f3bf0f8e436e2f7b485466cff300f12a166563995d3888c296a94/migrate/structs.js +0 -223
  312. package/dist/src/_dependencies/source/0xf47329f4344f3bf0f8e436e2f7b485466cff300f12a166563995d3888c296a94/package-utils/structs.d.ts +0 -194
  313. package/dist/src/_dependencies/source/0xf47329f4344f3bf0f8e436e2f7b485466cff300f12a166563995d3888c296a94/package-utils/structs.js +0 -662
  314. package/dist/src/_dependencies/source/0xf47329f4344f3bf0f8e436e2f7b485466cff300f12a166563995d3888c296a94/publish-message/structs.d.ts +0 -151
  315. package/dist/src/_dependencies/source/0xf47329f4344f3bf0f8e436e2f7b485466cff300f12a166563995d3888c296a94/publish-message/structs.js +0 -459
  316. package/dist/src/_dependencies/source/0xf47329f4344f3bf0f8e436e2f7b485466cff300f12a166563995d3888c296a94/set/structs.d.ts +0 -110
  317. package/dist/src/_dependencies/source/0xf47329f4344f3bf0f8e436e2f7b485466cff300f12a166563995d3888c296a94/set/structs.js +0 -416
  318. package/dist/src/_dependencies/source/0xf47329f4344f3bf0f8e436e2f7b485466cff300f12a166563995d3888c296a94/set-fee/structs.d.ts +0 -88
  319. package/dist/src/_dependencies/source/0xf47329f4344f3bf0f8e436e2f7b485466cff300f12a166563995d3888c296a94/set-fee/structs.js +0 -364
  320. package/dist/src/_dependencies/source/0xf47329f4344f3bf0f8e436e2f7b485466cff300f12a166563995d3888c296a94/setup/structs.d.ts +0 -55
  321. package/dist/src/_dependencies/source/0xf47329f4344f3bf0f8e436e2f7b485466cff300f12a166563995d3888c296a94/setup/structs.js +0 -223
  322. package/dist/src/_dependencies/source/0xf47329f4344f3bf0f8e436e2f7b485466cff300f12a166563995d3888c296a94/state/structs.d.ts +0 -278
  323. package/dist/src/_dependencies/source/0xf47329f4344f3bf0f8e436e2f7b485466cff300f12a166563995d3888c296a94/state/structs.js +0 -459
  324. package/dist/src/_dependencies/source/0xf47329f4344f3bf0f8e436e2f7b485466cff300f12a166563995d3888c296a94/transfer-fee/structs.d.ts +0 -94
  325. package/dist/src/_dependencies/source/0xf47329f4344f3bf0f8e436e2f7b485466cff300f12a166563995d3888c296a94/transfer-fee/structs.js +0 -376
  326. package/dist/src/_dependencies/source/0xf47329f4344f3bf0f8e436e2f7b485466cff300f12a166563995d3888c296a94/update-guardian-set/structs.d.ts +0 -159
  327. package/dist/src/_dependencies/source/0xf47329f4344f3bf0f8e436e2f7b485466cff300f12a166563995d3888c296a94/update-guardian-set/structs.js +0 -553
  328. package/dist/src/_dependencies/source/0xf47329f4344f3bf0f8e436e2f7b485466cff300f12a166563995d3888c296a94/upgrade-contract/structs.d.ts +0 -156
  329. package/dist/src/_dependencies/source/0xf47329f4344f3bf0f8e436e2f7b485466cff300f12a166563995d3888c296a94/upgrade-contract/structs.js +0 -520
  330. package/dist/src/_dependencies/source/0xf47329f4344f3bf0f8e436e2f7b485466cff300f12a166563995d3888c296a94/vaa/structs.d.ts +0 -128
  331. package/dist/src/_dependencies/source/0xf47329f4344f3bf0f8e436e2f7b485466cff300f12a166563995d3888c296a94/vaa/structs.js +0 -312
  332. package/dist/src/_dependencies/source/0xf47329f4344f3bf0f8e436e2f7b485466cff300f12a166563995d3888c296a94/version-control/structs.d.ts +0 -88
  333. package/dist/src/_dependencies/source/0xf47329f4344f3bf0f8e436e2f7b485466cff300f12a166563995d3888c296a94/version-control/structs.js +0 -364
  334. package/dist/src/readVec.d.ts +0 -3
  335. package/dist/src/readVec.js +0 -118
@@ -1,3008 +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.WithdrawProfitEvent = exports.UpdateStrategyEvent = exports.StrategyV2 = exports.StrategyPoolV2 = exports.StrategyPool = exports.Strategy = exports.RemoveStrategyVaultEvent = exports.NewStrategyVaultEvent = exports.NewStrategySignalEvent = exports.NewStrategyPoolEvent = exports.NewStrategyEventV2 = exports.NewStrategyEvent = exports.CloseStrategyEventV2 = exports.CloseStrategyEvent = exports.AutoBidEvent = exports.AddAuthorutyEvent = void 0;
109
- exports.isAddAuthorutyEvent = isAddAuthorutyEvent;
110
- exports.isAutoBidEvent = isAutoBidEvent;
111
- exports.isCloseStrategyEvent = isCloseStrategyEvent;
112
- exports.isCloseStrategyEventV2 = isCloseStrategyEventV2;
113
- exports.isNewStrategyEvent = isNewStrategyEvent;
114
- exports.isNewStrategyEventV2 = isNewStrategyEventV2;
115
- exports.isNewStrategyPoolEvent = isNewStrategyPoolEvent;
116
- exports.isNewStrategySignalEvent = isNewStrategySignalEvent;
117
- exports.isNewStrategyVaultEvent = isNewStrategyVaultEvent;
118
- exports.isRemoveStrategyVaultEvent = isRemoveStrategyVaultEvent;
119
- exports.isStrategy = isStrategy;
120
- exports.isStrategyPool = isStrategyPool;
121
- exports.isStrategyPoolV2 = isStrategyPoolV2;
122
- exports.isStrategyV2 = isStrategyV2;
123
- exports.isUpdateStrategyEvent = isUpdateStrategyEvent;
124
- exports.isWithdrawProfitEvent = isWithdrawProfitEvent;
125
- var reified = __importStar(require("../../../../_framework/reified"));
126
- var reified_1 = require("../../../../_framework/reified");
127
- var util_1 = require("../../../../_framework/util");
128
- var structs_1 = require("../../0x2/object/structs");
129
- var structs_2 = require("../../0x2/table-vec/structs");
130
- var structs_3 = require("../../0x2/vec-map/structs");
131
- var structs_4 = require("../../0x908a10789a1a6953e0b73a997c10e3552f7ce4e2907afd00a334ed74bd973ded/vault/structs");
132
- var index_1 = require("../index");
133
- var bcs_1 = require("@mysten/sui/bcs");
134
- var utils_1 = require("@mysten/sui/utils");
135
- /* ============================== AddAuthorutyEvent =============================== */
136
- function isAddAuthorutyEvent(type) {
137
- type = (0, util_1.compressSuiType)(type);
138
- return type === "".concat(index_1.PKG_V1, "::auto_bid::AddAuthorutyEvent");
139
- }
140
- var AddAuthorutyEvent = /** @class */ (function () {
141
- function AddAuthorutyEvent(typeArgs, fields) {
142
- this.__StructClass = true;
143
- this.$typeName = AddAuthorutyEvent.$typeName;
144
- this.$isPhantom = AddAuthorutyEvent.$isPhantom;
145
- this.$fullTypeName = util_1.composeSuiType.apply(void 0, __spreadArray([AddAuthorutyEvent.$typeName], __read(typeArgs), false));
146
- this.$typeArgs = typeArgs;
147
- this.newAuthority = fields.newAuthority;
148
- this.signer = fields.signer;
149
- }
150
- AddAuthorutyEvent.reified = function () {
151
- var _this = this;
152
- return {
153
- typeName: AddAuthorutyEvent.$typeName,
154
- fullTypeName: util_1.composeSuiType.apply(void 0, __spreadArray([AddAuthorutyEvent.$typeName], [], false)),
155
- typeArgs: [],
156
- isPhantom: AddAuthorutyEvent.$isPhantom,
157
- reifiedTypeArgs: [],
158
- fromFields: function (fields) { return AddAuthorutyEvent.fromFields(fields); },
159
- fromFieldsWithTypes: function (item) { return AddAuthorutyEvent.fromFieldsWithTypes(item); },
160
- fromBcs: function (data) { return AddAuthorutyEvent.fromBcs(data); },
161
- bcs: AddAuthorutyEvent.bcs,
162
- fromJSONField: function (field) { return AddAuthorutyEvent.fromJSONField(field); },
163
- fromJSON: function (json) { return AddAuthorutyEvent.fromJSON(json); },
164
- fromSuiParsedData: function (content) { return AddAuthorutyEvent.fromSuiParsedData(content); },
165
- fromSuiObjectData: function (content) { return AddAuthorutyEvent.fromSuiObjectData(content); },
166
- fetch: function (client, id) { return __awaiter(_this, void 0, void 0, function () { return __generator(this, function (_a) {
167
- return [2 /*return*/, AddAuthorutyEvent.fetch(client, id)];
168
- }); }); },
169
- new: function (fields) {
170
- return new AddAuthorutyEvent([], fields);
171
- },
172
- kind: "StructClassReified",
173
- };
174
- };
175
- Object.defineProperty(AddAuthorutyEvent, "r", {
176
- get: function () {
177
- return AddAuthorutyEvent.reified();
178
- },
179
- enumerable: false,
180
- configurable: true
181
- });
182
- AddAuthorutyEvent.phantom = function () {
183
- return (0, reified_1.phantom)(AddAuthorutyEvent.reified());
184
- };
185
- Object.defineProperty(AddAuthorutyEvent, "p", {
186
- get: function () {
187
- return AddAuthorutyEvent.phantom();
188
- },
189
- enumerable: false,
190
- configurable: true
191
- });
192
- Object.defineProperty(AddAuthorutyEvent, "bcs", {
193
- get: function () {
194
- return bcs_1.bcs.struct("AddAuthorutyEvent", {
195
- new_authority: bcs_1.bcs.bytes(32).transform({ input: function (val) { return (0, utils_1.fromHEX)(val); }, output: function (val) { return (0, utils_1.toHEX)(val); } }),
196
- 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); } }),
197
- });
198
- },
199
- enumerable: false,
200
- configurable: true
201
- });
202
- AddAuthorutyEvent.fromFields = function (fields) {
203
- return AddAuthorutyEvent.reified().new({
204
- newAuthority: (0, reified_1.decodeFromFields)("address", fields.new_authority),
205
- signer: (0, reified_1.decodeFromFields)("address", fields.signer),
206
- });
207
- };
208
- AddAuthorutyEvent.fromFieldsWithTypes = function (item) {
209
- if (!isAddAuthorutyEvent(item.type)) {
210
- throw new Error("not a AddAuthorutyEvent type");
211
- }
212
- return AddAuthorutyEvent.reified().new({
213
- newAuthority: (0, reified_1.decodeFromFieldsWithTypes)("address", item.fields.new_authority),
214
- signer: (0, reified_1.decodeFromFieldsWithTypes)("address", item.fields.signer),
215
- });
216
- };
217
- AddAuthorutyEvent.fromBcs = function (data) {
218
- return AddAuthorutyEvent.fromFields(AddAuthorutyEvent.bcs.parse(data));
219
- };
220
- AddAuthorutyEvent.prototype.toJSONField = function () {
221
- return {
222
- newAuthority: this.newAuthority,
223
- signer: this.signer,
224
- };
225
- };
226
- AddAuthorutyEvent.prototype.toJSON = function () {
227
- return __assign({ $typeName: this.$typeName, $typeArgs: this.$typeArgs }, this.toJSONField());
228
- };
229
- AddAuthorutyEvent.fromJSONField = function (field) {
230
- return AddAuthorutyEvent.reified().new({
231
- newAuthority: (0, reified_1.decodeFromJSONField)("address", field.newAuthority),
232
- signer: (0, reified_1.decodeFromJSONField)("address", field.signer),
233
- });
234
- };
235
- AddAuthorutyEvent.fromJSON = function (json) {
236
- if (json.$typeName !== AddAuthorutyEvent.$typeName) {
237
- throw new Error("not a WithTwoGenerics json object");
238
- }
239
- return AddAuthorutyEvent.fromJSONField(json);
240
- };
241
- AddAuthorutyEvent.fromSuiParsedData = function (content) {
242
- if (content.dataType !== "moveObject") {
243
- throw new Error("not an object");
244
- }
245
- if (!isAddAuthorutyEvent(content.type)) {
246
- throw new Error("object at ".concat(content.fields.id, " is not a AddAuthorutyEvent object"));
247
- }
248
- return AddAuthorutyEvent.fromFieldsWithTypes(content);
249
- };
250
- AddAuthorutyEvent.fromSuiObjectData = function (data) {
251
- if (data.bcs) {
252
- if (data.bcs.dataType !== "moveObject" || !isAddAuthorutyEvent(data.bcs.type)) {
253
- throw new Error("object at is not a AddAuthorutyEvent object");
254
- }
255
- return AddAuthorutyEvent.fromBcs((0, utils_1.fromB64)(data.bcs.bcsBytes));
256
- }
257
- if (data.content) {
258
- return AddAuthorutyEvent.fromSuiParsedData(data.content);
259
- }
260
- throw new Error("Both `bcs` and `content` fields are missing from the data. Include `showBcs` or `showContent` in the request.");
261
- };
262
- AddAuthorutyEvent.fetch = function (client, id) {
263
- return __awaiter(this, void 0, void 0, function () {
264
- var res;
265
- var _a, _b;
266
- return __generator(this, function (_c) {
267
- switch (_c.label) {
268
- case 0: return [4 /*yield*/, client.getObject({ id: id, options: { showBcs: true } })];
269
- case 1:
270
- res = _c.sent();
271
- if (res.error) {
272
- throw new Error("error fetching AddAuthorutyEvent object at id ".concat(id, ": ").concat(res.error.code));
273
- }
274
- if (((_b = (_a = res.data) === null || _a === void 0 ? void 0 : _a.bcs) === null || _b === void 0 ? void 0 : _b.dataType) !== "moveObject" || !isAddAuthorutyEvent(res.data.bcs.type)) {
275
- throw new Error("object at id ".concat(id, " is not a AddAuthorutyEvent object"));
276
- }
277
- return [2 /*return*/, AddAuthorutyEvent.fromSuiObjectData(res.data)];
278
- }
279
- });
280
- });
281
- };
282
- AddAuthorutyEvent.$typeName = "".concat(index_1.PKG_V1, "::auto_bid::AddAuthorutyEvent");
283
- AddAuthorutyEvent.$numTypeParams = 0;
284
- AddAuthorutyEvent.$isPhantom = [];
285
- return AddAuthorutyEvent;
286
- }());
287
- exports.AddAuthorutyEvent = AddAuthorutyEvent;
288
- /* ============================== AutoBidEvent =============================== */
289
- function isAutoBidEvent(type) {
290
- type = (0, util_1.compressSuiType)(type);
291
- return type === "".concat(index_1.PKG_V1, "::auto_bid::AutoBidEvent");
292
- }
293
- var AutoBidEvent = /** @class */ (function () {
294
- function AutoBidEvent(typeArgs, fields) {
295
- this.__StructClass = true;
296
- this.$typeName = AutoBidEvent.$typeName;
297
- this.$isPhantom = AutoBidEvent.$isPhantom;
298
- this.$fullTypeName = util_1.composeSuiType.apply(void 0, __spreadArray([AutoBidEvent.$typeName], __read(typeArgs), false));
299
- this.$typeArgs = typeArgs;
300
- this.dummyField = fields.dummyField;
301
- }
302
- AutoBidEvent.reified = function () {
303
- var _this = this;
304
- return {
305
- typeName: AutoBidEvent.$typeName,
306
- fullTypeName: util_1.composeSuiType.apply(void 0, __spreadArray([AutoBidEvent.$typeName], [], false)),
307
- typeArgs: [],
308
- isPhantom: AutoBidEvent.$isPhantom,
309
- reifiedTypeArgs: [],
310
- fromFields: function (fields) { return AutoBidEvent.fromFields(fields); },
311
- fromFieldsWithTypes: function (item) { return AutoBidEvent.fromFieldsWithTypes(item); },
312
- fromBcs: function (data) { return AutoBidEvent.fromBcs(data); },
313
- bcs: AutoBidEvent.bcs,
314
- fromJSONField: function (field) { return AutoBidEvent.fromJSONField(field); },
315
- fromJSON: function (json) { return AutoBidEvent.fromJSON(json); },
316
- fromSuiParsedData: function (content) { return AutoBidEvent.fromSuiParsedData(content); },
317
- fromSuiObjectData: function (content) { return AutoBidEvent.fromSuiObjectData(content); },
318
- fetch: function (client, id) { return __awaiter(_this, void 0, void 0, function () { return __generator(this, function (_a) {
319
- return [2 /*return*/, AutoBidEvent.fetch(client, id)];
320
- }); }); },
321
- new: function (fields) {
322
- return new AutoBidEvent([], fields);
323
- },
324
- kind: "StructClassReified",
325
- };
326
- };
327
- Object.defineProperty(AutoBidEvent, "r", {
328
- get: function () {
329
- return AutoBidEvent.reified();
330
- },
331
- enumerable: false,
332
- configurable: true
333
- });
334
- AutoBidEvent.phantom = function () {
335
- return (0, reified_1.phantom)(AutoBidEvent.reified());
336
- };
337
- Object.defineProperty(AutoBidEvent, "p", {
338
- get: function () {
339
- return AutoBidEvent.phantom();
340
- },
341
- enumerable: false,
342
- configurable: true
343
- });
344
- Object.defineProperty(AutoBidEvent, "bcs", {
345
- get: function () {
346
- return bcs_1.bcs.struct("AutoBidEvent", {
347
- dummy_field: bcs_1.bcs.bool(),
348
- });
349
- },
350
- enumerable: false,
351
- configurable: true
352
- });
353
- AutoBidEvent.fromFields = function (fields) {
354
- return AutoBidEvent.reified().new({ dummyField: (0, reified_1.decodeFromFields)("bool", fields.dummy_field) });
355
- };
356
- AutoBidEvent.fromFieldsWithTypes = function (item) {
357
- if (!isAutoBidEvent(item.type)) {
358
- throw new Error("not a AutoBidEvent type");
359
- }
360
- return AutoBidEvent.reified().new({ dummyField: (0, reified_1.decodeFromFieldsWithTypes)("bool", item.fields.dummy_field) });
361
- };
362
- AutoBidEvent.fromBcs = function (data) {
363
- return AutoBidEvent.fromFields(AutoBidEvent.bcs.parse(data));
364
- };
365
- AutoBidEvent.prototype.toJSONField = function () {
366
- return {
367
- dummyField: this.dummyField,
368
- };
369
- };
370
- AutoBidEvent.prototype.toJSON = function () {
371
- return __assign({ $typeName: this.$typeName, $typeArgs: this.$typeArgs }, this.toJSONField());
372
- };
373
- AutoBidEvent.fromJSONField = function (field) {
374
- return AutoBidEvent.reified().new({ dummyField: (0, reified_1.decodeFromJSONField)("bool", field.dummyField) });
375
- };
376
- AutoBidEvent.fromJSON = function (json) {
377
- if (json.$typeName !== AutoBidEvent.$typeName) {
378
- throw new Error("not a WithTwoGenerics json object");
379
- }
380
- return AutoBidEvent.fromJSONField(json);
381
- };
382
- AutoBidEvent.fromSuiParsedData = function (content) {
383
- if (content.dataType !== "moveObject") {
384
- throw new Error("not an object");
385
- }
386
- if (!isAutoBidEvent(content.type)) {
387
- throw new Error("object at ".concat(content.fields.id, " is not a AutoBidEvent object"));
388
- }
389
- return AutoBidEvent.fromFieldsWithTypes(content);
390
- };
391
- AutoBidEvent.fromSuiObjectData = function (data) {
392
- if (data.bcs) {
393
- if (data.bcs.dataType !== "moveObject" || !isAutoBidEvent(data.bcs.type)) {
394
- throw new Error("object at is not a AutoBidEvent object");
395
- }
396
- return AutoBidEvent.fromBcs((0, utils_1.fromB64)(data.bcs.bcsBytes));
397
- }
398
- if (data.content) {
399
- return AutoBidEvent.fromSuiParsedData(data.content);
400
- }
401
- throw new Error("Both `bcs` and `content` fields are missing from the data. Include `showBcs` or `showContent` in the request.");
402
- };
403
- AutoBidEvent.fetch = function (client, id) {
404
- return __awaiter(this, void 0, void 0, function () {
405
- var res;
406
- var _a, _b;
407
- return __generator(this, function (_c) {
408
- switch (_c.label) {
409
- case 0: return [4 /*yield*/, client.getObject({ id: id, options: { showBcs: true } })];
410
- case 1:
411
- res = _c.sent();
412
- if (res.error) {
413
- throw new Error("error fetching AutoBidEvent object at id ".concat(id, ": ").concat(res.error.code));
414
- }
415
- if (((_b = (_a = res.data) === null || _a === void 0 ? void 0 : _a.bcs) === null || _b === void 0 ? void 0 : _b.dataType) !== "moveObject" || !isAutoBidEvent(res.data.bcs.type)) {
416
- throw new Error("object at id ".concat(id, " is not a AutoBidEvent object"));
417
- }
418
- return [2 /*return*/, AutoBidEvent.fromSuiObjectData(res.data)];
419
- }
420
- });
421
- });
422
- };
423
- AutoBidEvent.$typeName = "".concat(index_1.PKG_V1, "::auto_bid::AutoBidEvent");
424
- AutoBidEvent.$numTypeParams = 0;
425
- AutoBidEvent.$isPhantom = [];
426
- return AutoBidEvent;
427
- }());
428
- exports.AutoBidEvent = AutoBidEvent;
429
- /* ============================== CloseStrategyEvent =============================== */
430
- function isCloseStrategyEvent(type) {
431
- type = (0, util_1.compressSuiType)(type);
432
- return type === "".concat(index_1.PKG_V1, "::auto_bid::CloseStrategyEvent");
433
- }
434
- var CloseStrategyEvent = /** @class */ (function () {
435
- function CloseStrategyEvent(typeArgs, fields) {
436
- this.__StructClass = true;
437
- this.$typeName = CloseStrategyEvent.$typeName;
438
- this.$isPhantom = CloseStrategyEvent.$isPhantom;
439
- this.$fullTypeName = util_1.composeSuiType.apply(void 0, __spreadArray([CloseStrategyEvent.$typeName], __read(typeArgs), false));
440
- this.$typeArgs = typeArgs;
441
- this.vaultIndex = fields.vaultIndex;
442
- this.signalIndex = fields.signalIndex;
443
- this.user = fields.user;
444
- this.pricePercentage = fields.pricePercentage;
445
- this.size = fields.size;
446
- this.maxTimes = fields.maxTimes;
447
- this.targetRounds = fields.targetRounds;
448
- this.u64Padding = fields.u64Padding;
449
- this.bidTimes = fields.bidTimes;
450
- this.bidRound = fields.bidRound;
451
- this.bidTsMs = fields.bidTsMs;
452
- }
453
- CloseStrategyEvent.reified = function () {
454
- var _this = this;
455
- return {
456
- typeName: CloseStrategyEvent.$typeName,
457
- fullTypeName: util_1.composeSuiType.apply(void 0, __spreadArray([CloseStrategyEvent.$typeName], [], false)),
458
- typeArgs: [],
459
- isPhantom: CloseStrategyEvent.$isPhantom,
460
- reifiedTypeArgs: [],
461
- fromFields: function (fields) { return CloseStrategyEvent.fromFields(fields); },
462
- fromFieldsWithTypes: function (item) { return CloseStrategyEvent.fromFieldsWithTypes(item); },
463
- fromBcs: function (data) { return CloseStrategyEvent.fromBcs(data); },
464
- bcs: CloseStrategyEvent.bcs,
465
- fromJSONField: function (field) { return CloseStrategyEvent.fromJSONField(field); },
466
- fromJSON: function (json) { return CloseStrategyEvent.fromJSON(json); },
467
- fromSuiParsedData: function (content) { return CloseStrategyEvent.fromSuiParsedData(content); },
468
- fromSuiObjectData: function (content) { return CloseStrategyEvent.fromSuiObjectData(content); },
469
- fetch: function (client, id) { return __awaiter(_this, void 0, void 0, function () { return __generator(this, function (_a) {
470
- return [2 /*return*/, CloseStrategyEvent.fetch(client, id)];
471
- }); }); },
472
- new: function (fields) {
473
- return new CloseStrategyEvent([], fields);
474
- },
475
- kind: "StructClassReified",
476
- };
477
- };
478
- Object.defineProperty(CloseStrategyEvent, "r", {
479
- get: function () {
480
- return CloseStrategyEvent.reified();
481
- },
482
- enumerable: false,
483
- configurable: true
484
- });
485
- CloseStrategyEvent.phantom = function () {
486
- return (0, reified_1.phantom)(CloseStrategyEvent.reified());
487
- };
488
- Object.defineProperty(CloseStrategyEvent, "p", {
489
- get: function () {
490
- return CloseStrategyEvent.phantom();
491
- },
492
- enumerable: false,
493
- configurable: true
494
- });
495
- Object.defineProperty(CloseStrategyEvent, "bcs", {
496
- get: function () {
497
- return bcs_1.bcs.struct("CloseStrategyEvent", {
498
- vault_index: bcs_1.bcs.u64(),
499
- signal_index: bcs_1.bcs.u64(),
500
- user: bcs_1.bcs.bytes(32).transform({ input: function (val) { return (0, utils_1.fromHEX)(val); }, output: function (val) { return (0, utils_1.toHEX)(val); } }),
501
- price_percentage: bcs_1.bcs.u64(),
502
- size: bcs_1.bcs.u64(),
503
- max_times: bcs_1.bcs.u64(),
504
- target_rounds: bcs_1.bcs.vector(bcs_1.bcs.u64()),
505
- u64_padding: bcs_1.bcs.vector(bcs_1.bcs.u64()),
506
- bid_times: bcs_1.bcs.u64(),
507
- bid_round: bcs_1.bcs.u64(),
508
- bid_ts_ms: bcs_1.bcs.u64(),
509
- });
510
- },
511
- enumerable: false,
512
- configurable: true
513
- });
514
- CloseStrategyEvent.fromFields = function (fields) {
515
- return CloseStrategyEvent.reified().new({
516
- vaultIndex: (0, reified_1.decodeFromFields)("u64", fields.vault_index),
517
- signalIndex: (0, reified_1.decodeFromFields)("u64", fields.signal_index),
518
- user: (0, reified_1.decodeFromFields)("address", fields.user),
519
- pricePercentage: (0, reified_1.decodeFromFields)("u64", fields.price_percentage),
520
- size: (0, reified_1.decodeFromFields)("u64", fields.size),
521
- maxTimes: (0, reified_1.decodeFromFields)("u64", fields.max_times),
522
- targetRounds: (0, reified_1.decodeFromFields)(reified.vector("u64"), fields.target_rounds),
523
- u64Padding: (0, reified_1.decodeFromFields)(reified.vector("u64"), fields.u64_padding),
524
- bidTimes: (0, reified_1.decodeFromFields)("u64", fields.bid_times),
525
- bidRound: (0, reified_1.decodeFromFields)("u64", fields.bid_round),
526
- bidTsMs: (0, reified_1.decodeFromFields)("u64", fields.bid_ts_ms),
527
- });
528
- };
529
- CloseStrategyEvent.fromFieldsWithTypes = function (item) {
530
- if (!isCloseStrategyEvent(item.type)) {
531
- throw new Error("not a CloseStrategyEvent type");
532
- }
533
- return CloseStrategyEvent.reified().new({
534
- vaultIndex: (0, reified_1.decodeFromFieldsWithTypes)("u64", item.fields.vault_index),
535
- signalIndex: (0, reified_1.decodeFromFieldsWithTypes)("u64", item.fields.signal_index),
536
- user: (0, reified_1.decodeFromFieldsWithTypes)("address", item.fields.user),
537
- pricePercentage: (0, reified_1.decodeFromFieldsWithTypes)("u64", item.fields.price_percentage),
538
- size: (0, reified_1.decodeFromFieldsWithTypes)("u64", item.fields.size),
539
- maxTimes: (0, reified_1.decodeFromFieldsWithTypes)("u64", item.fields.max_times),
540
- targetRounds: (0, reified_1.decodeFromFieldsWithTypes)(reified.vector("u64"), item.fields.target_rounds),
541
- u64Padding: (0, reified_1.decodeFromFieldsWithTypes)(reified.vector("u64"), item.fields.u64_padding),
542
- bidTimes: (0, reified_1.decodeFromFieldsWithTypes)("u64", item.fields.bid_times),
543
- bidRound: (0, reified_1.decodeFromFieldsWithTypes)("u64", item.fields.bid_round),
544
- bidTsMs: (0, reified_1.decodeFromFieldsWithTypes)("u64", item.fields.bid_ts_ms),
545
- });
546
- };
547
- CloseStrategyEvent.fromBcs = function (data) {
548
- return CloseStrategyEvent.fromFields(CloseStrategyEvent.bcs.parse(data));
549
- };
550
- CloseStrategyEvent.prototype.toJSONField = function () {
551
- return {
552
- vaultIndex: this.vaultIndex.toString(),
553
- signalIndex: this.signalIndex.toString(),
554
- user: this.user,
555
- pricePercentage: this.pricePercentage.toString(),
556
- size: this.size.toString(),
557
- maxTimes: this.maxTimes.toString(),
558
- targetRounds: (0, reified_1.fieldToJSON)("vector<u64>", this.targetRounds),
559
- u64Padding: (0, reified_1.fieldToJSON)("vector<u64>", this.u64Padding),
560
- bidTimes: this.bidTimes.toString(),
561
- bidRound: this.bidRound.toString(),
562
- bidTsMs: this.bidTsMs.toString(),
563
- };
564
- };
565
- CloseStrategyEvent.prototype.toJSON = function () {
566
- return __assign({ $typeName: this.$typeName, $typeArgs: this.$typeArgs }, this.toJSONField());
567
- };
568
- CloseStrategyEvent.fromJSONField = function (field) {
569
- return CloseStrategyEvent.reified().new({
570
- vaultIndex: (0, reified_1.decodeFromJSONField)("u64", field.vaultIndex),
571
- signalIndex: (0, reified_1.decodeFromJSONField)("u64", field.signalIndex),
572
- user: (0, reified_1.decodeFromJSONField)("address", field.user),
573
- pricePercentage: (0, reified_1.decodeFromJSONField)("u64", field.pricePercentage),
574
- size: (0, reified_1.decodeFromJSONField)("u64", field.size),
575
- maxTimes: (0, reified_1.decodeFromJSONField)("u64", field.maxTimes),
576
- targetRounds: (0, reified_1.decodeFromJSONField)(reified.vector("u64"), field.targetRounds),
577
- u64Padding: (0, reified_1.decodeFromJSONField)(reified.vector("u64"), field.u64Padding),
578
- bidTimes: (0, reified_1.decodeFromJSONField)("u64", field.bidTimes),
579
- bidRound: (0, reified_1.decodeFromJSONField)("u64", field.bidRound),
580
- bidTsMs: (0, reified_1.decodeFromJSONField)("u64", field.bidTsMs),
581
- });
582
- };
583
- CloseStrategyEvent.fromJSON = function (json) {
584
- if (json.$typeName !== CloseStrategyEvent.$typeName) {
585
- throw new Error("not a WithTwoGenerics json object");
586
- }
587
- return CloseStrategyEvent.fromJSONField(json);
588
- };
589
- CloseStrategyEvent.fromSuiParsedData = function (content) {
590
- if (content.dataType !== "moveObject") {
591
- throw new Error("not an object");
592
- }
593
- if (!isCloseStrategyEvent(content.type)) {
594
- throw new Error("object at ".concat(content.fields.id, " is not a CloseStrategyEvent object"));
595
- }
596
- return CloseStrategyEvent.fromFieldsWithTypes(content);
597
- };
598
- CloseStrategyEvent.fromSuiObjectData = function (data) {
599
- if (data.bcs) {
600
- if (data.bcs.dataType !== "moveObject" || !isCloseStrategyEvent(data.bcs.type)) {
601
- throw new Error("object at is not a CloseStrategyEvent object");
602
- }
603
- return CloseStrategyEvent.fromBcs((0, utils_1.fromB64)(data.bcs.bcsBytes));
604
- }
605
- if (data.content) {
606
- return CloseStrategyEvent.fromSuiParsedData(data.content);
607
- }
608
- throw new Error("Both `bcs` and `content` fields are missing from the data. Include `showBcs` or `showContent` in the request.");
609
- };
610
- CloseStrategyEvent.fetch = function (client, id) {
611
- return __awaiter(this, void 0, void 0, function () {
612
- var res;
613
- var _a, _b;
614
- return __generator(this, function (_c) {
615
- switch (_c.label) {
616
- case 0: return [4 /*yield*/, client.getObject({ id: id, options: { showBcs: true } })];
617
- case 1:
618
- res = _c.sent();
619
- if (res.error) {
620
- throw new Error("error fetching CloseStrategyEvent object at id ".concat(id, ": ").concat(res.error.code));
621
- }
622
- if (((_b = (_a = res.data) === null || _a === void 0 ? void 0 : _a.bcs) === null || _b === void 0 ? void 0 : _b.dataType) !== "moveObject" || !isCloseStrategyEvent(res.data.bcs.type)) {
623
- throw new Error("object at id ".concat(id, " is not a CloseStrategyEvent object"));
624
- }
625
- return [2 /*return*/, CloseStrategyEvent.fromSuiObjectData(res.data)];
626
- }
627
- });
628
- });
629
- };
630
- CloseStrategyEvent.$typeName = "".concat(index_1.PKG_V1, "::auto_bid::CloseStrategyEvent");
631
- CloseStrategyEvent.$numTypeParams = 0;
632
- CloseStrategyEvent.$isPhantom = [];
633
- return CloseStrategyEvent;
634
- }());
635
- exports.CloseStrategyEvent = CloseStrategyEvent;
636
- /* ============================== CloseStrategyEventV2 =============================== */
637
- function isCloseStrategyEventV2(type) {
638
- type = (0, util_1.compressSuiType)(type);
639
- return type === "".concat(index_1.PKG_V1, "::auto_bid::CloseStrategyEventV2");
640
- }
641
- var CloseStrategyEventV2 = /** @class */ (function () {
642
- function CloseStrategyEventV2(typeArgs, fields) {
643
- this.__StructClass = true;
644
- this.$typeName = CloseStrategyEventV2.$typeName;
645
- this.$isPhantom = CloseStrategyEventV2.$isPhantom;
646
- this.$fullTypeName = util_1.composeSuiType.apply(void 0, __spreadArray([CloseStrategyEventV2.$typeName], __read(typeArgs), false));
647
- this.$typeArgs = typeArgs;
648
- this.vaultIndex = fields.vaultIndex;
649
- this.signalIndex = fields.signalIndex;
650
- this.user = fields.user;
651
- this.pricePercentage = fields.pricePercentage;
652
- this.size = fields.size;
653
- this.maxTimes = fields.maxTimes;
654
- this.targetRounds = fields.targetRounds;
655
- this.u64Padding = fields.u64Padding;
656
- this.bidTimes = fields.bidTimes;
657
- this.bidRound = fields.bidRound;
658
- this.bidTsMs = fields.bidTsMs;
659
- this.bidRounds = fields.bidRounds;
660
- this.accumulatedProfit = fields.accumulatedProfit;
661
- }
662
- CloseStrategyEventV2.reified = function () {
663
- var _this = this;
664
- return {
665
- typeName: CloseStrategyEventV2.$typeName,
666
- fullTypeName: util_1.composeSuiType.apply(void 0, __spreadArray([CloseStrategyEventV2.$typeName], [], false)),
667
- typeArgs: [],
668
- isPhantom: CloseStrategyEventV2.$isPhantom,
669
- reifiedTypeArgs: [],
670
- fromFields: function (fields) { return CloseStrategyEventV2.fromFields(fields); },
671
- fromFieldsWithTypes: function (item) { return CloseStrategyEventV2.fromFieldsWithTypes(item); },
672
- fromBcs: function (data) { return CloseStrategyEventV2.fromBcs(data); },
673
- bcs: CloseStrategyEventV2.bcs,
674
- fromJSONField: function (field) { return CloseStrategyEventV2.fromJSONField(field); },
675
- fromJSON: function (json) { return CloseStrategyEventV2.fromJSON(json); },
676
- fromSuiParsedData: function (content) { return CloseStrategyEventV2.fromSuiParsedData(content); },
677
- fromSuiObjectData: function (content) { return CloseStrategyEventV2.fromSuiObjectData(content); },
678
- fetch: function (client, id) { return __awaiter(_this, void 0, void 0, function () { return __generator(this, function (_a) {
679
- return [2 /*return*/, CloseStrategyEventV2.fetch(client, id)];
680
- }); }); },
681
- new: function (fields) {
682
- return new CloseStrategyEventV2([], fields);
683
- },
684
- kind: "StructClassReified",
685
- };
686
- };
687
- Object.defineProperty(CloseStrategyEventV2, "r", {
688
- get: function () {
689
- return CloseStrategyEventV2.reified();
690
- },
691
- enumerable: false,
692
- configurable: true
693
- });
694
- CloseStrategyEventV2.phantom = function () {
695
- return (0, reified_1.phantom)(CloseStrategyEventV2.reified());
696
- };
697
- Object.defineProperty(CloseStrategyEventV2, "p", {
698
- get: function () {
699
- return CloseStrategyEventV2.phantom();
700
- },
701
- enumerable: false,
702
- configurable: true
703
- });
704
- Object.defineProperty(CloseStrategyEventV2, "bcs", {
705
- get: function () {
706
- return bcs_1.bcs.struct("CloseStrategyEventV2", {
707
- vault_index: bcs_1.bcs.u64(),
708
- signal_index: bcs_1.bcs.u64(),
709
- user: bcs_1.bcs.bytes(32).transform({ input: function (val) { return (0, utils_1.fromHEX)(val); }, output: function (val) { return (0, utils_1.toHEX)(val); } }),
710
- price_percentage: bcs_1.bcs.u64(),
711
- size: bcs_1.bcs.u64(),
712
- max_times: bcs_1.bcs.u64(),
713
- target_rounds: bcs_1.bcs.vector(bcs_1.bcs.u64()),
714
- u64_padding: bcs_1.bcs.vector(bcs_1.bcs.u64()),
715
- bid_times: bcs_1.bcs.u64(),
716
- bid_round: bcs_1.bcs.u64(),
717
- bid_ts_ms: bcs_1.bcs.u64(),
718
- bid_rounds: bcs_1.bcs.vector(bcs_1.bcs.u64()),
719
- accumulated_profit: bcs_1.bcs.u64(),
720
- });
721
- },
722
- enumerable: false,
723
- configurable: true
724
- });
725
- CloseStrategyEventV2.fromFields = function (fields) {
726
- return CloseStrategyEventV2.reified().new({
727
- vaultIndex: (0, reified_1.decodeFromFields)("u64", fields.vault_index),
728
- signalIndex: (0, reified_1.decodeFromFields)("u64", fields.signal_index),
729
- user: (0, reified_1.decodeFromFields)("address", fields.user),
730
- pricePercentage: (0, reified_1.decodeFromFields)("u64", fields.price_percentage),
731
- size: (0, reified_1.decodeFromFields)("u64", fields.size),
732
- maxTimes: (0, reified_1.decodeFromFields)("u64", fields.max_times),
733
- targetRounds: (0, reified_1.decodeFromFields)(reified.vector("u64"), fields.target_rounds),
734
- u64Padding: (0, reified_1.decodeFromFields)(reified.vector("u64"), fields.u64_padding),
735
- bidTimes: (0, reified_1.decodeFromFields)("u64", fields.bid_times),
736
- bidRound: (0, reified_1.decodeFromFields)("u64", fields.bid_round),
737
- bidTsMs: (0, reified_1.decodeFromFields)("u64", fields.bid_ts_ms),
738
- bidRounds: (0, reified_1.decodeFromFields)(reified.vector("u64"), fields.bid_rounds),
739
- accumulatedProfit: (0, reified_1.decodeFromFields)("u64", fields.accumulated_profit),
740
- });
741
- };
742
- CloseStrategyEventV2.fromFieldsWithTypes = function (item) {
743
- if (!isCloseStrategyEventV2(item.type)) {
744
- throw new Error("not a CloseStrategyEventV2 type");
745
- }
746
- return CloseStrategyEventV2.reified().new({
747
- vaultIndex: (0, reified_1.decodeFromFieldsWithTypes)("u64", item.fields.vault_index),
748
- signalIndex: (0, reified_1.decodeFromFieldsWithTypes)("u64", item.fields.signal_index),
749
- user: (0, reified_1.decodeFromFieldsWithTypes)("address", item.fields.user),
750
- pricePercentage: (0, reified_1.decodeFromFieldsWithTypes)("u64", item.fields.price_percentage),
751
- size: (0, reified_1.decodeFromFieldsWithTypes)("u64", item.fields.size),
752
- maxTimes: (0, reified_1.decodeFromFieldsWithTypes)("u64", item.fields.max_times),
753
- targetRounds: (0, reified_1.decodeFromFieldsWithTypes)(reified.vector("u64"), item.fields.target_rounds),
754
- u64Padding: (0, reified_1.decodeFromFieldsWithTypes)(reified.vector("u64"), item.fields.u64_padding),
755
- bidTimes: (0, reified_1.decodeFromFieldsWithTypes)("u64", item.fields.bid_times),
756
- bidRound: (0, reified_1.decodeFromFieldsWithTypes)("u64", item.fields.bid_round),
757
- bidTsMs: (0, reified_1.decodeFromFieldsWithTypes)("u64", item.fields.bid_ts_ms),
758
- bidRounds: (0, reified_1.decodeFromFieldsWithTypes)(reified.vector("u64"), item.fields.bid_rounds),
759
- accumulatedProfit: (0, reified_1.decodeFromFieldsWithTypes)("u64", item.fields.accumulated_profit),
760
- });
761
- };
762
- CloseStrategyEventV2.fromBcs = function (data) {
763
- return CloseStrategyEventV2.fromFields(CloseStrategyEventV2.bcs.parse(data));
764
- };
765
- CloseStrategyEventV2.prototype.toJSONField = function () {
766
- return {
767
- vaultIndex: this.vaultIndex.toString(),
768
- signalIndex: this.signalIndex.toString(),
769
- user: this.user,
770
- pricePercentage: this.pricePercentage.toString(),
771
- size: this.size.toString(),
772
- maxTimes: this.maxTimes.toString(),
773
- targetRounds: (0, reified_1.fieldToJSON)("vector<u64>", this.targetRounds),
774
- u64Padding: (0, reified_1.fieldToJSON)("vector<u64>", this.u64Padding),
775
- bidTimes: this.bidTimes.toString(),
776
- bidRound: this.bidRound.toString(),
777
- bidTsMs: this.bidTsMs.toString(),
778
- bidRounds: (0, reified_1.fieldToJSON)("vector<u64>", this.bidRounds),
779
- accumulatedProfit: this.accumulatedProfit.toString(),
780
- };
781
- };
782
- CloseStrategyEventV2.prototype.toJSON = function () {
783
- return __assign({ $typeName: this.$typeName, $typeArgs: this.$typeArgs }, this.toJSONField());
784
- };
785
- CloseStrategyEventV2.fromJSONField = function (field) {
786
- return CloseStrategyEventV2.reified().new({
787
- vaultIndex: (0, reified_1.decodeFromJSONField)("u64", field.vaultIndex),
788
- signalIndex: (0, reified_1.decodeFromJSONField)("u64", field.signalIndex),
789
- user: (0, reified_1.decodeFromJSONField)("address", field.user),
790
- pricePercentage: (0, reified_1.decodeFromJSONField)("u64", field.pricePercentage),
791
- size: (0, reified_1.decodeFromJSONField)("u64", field.size),
792
- maxTimes: (0, reified_1.decodeFromJSONField)("u64", field.maxTimes),
793
- targetRounds: (0, reified_1.decodeFromJSONField)(reified.vector("u64"), field.targetRounds),
794
- u64Padding: (0, reified_1.decodeFromJSONField)(reified.vector("u64"), field.u64Padding),
795
- bidTimes: (0, reified_1.decodeFromJSONField)("u64", field.bidTimes),
796
- bidRound: (0, reified_1.decodeFromJSONField)("u64", field.bidRound),
797
- bidTsMs: (0, reified_1.decodeFromJSONField)("u64", field.bidTsMs),
798
- bidRounds: (0, reified_1.decodeFromJSONField)(reified.vector("u64"), field.bidRounds),
799
- accumulatedProfit: (0, reified_1.decodeFromJSONField)("u64", field.accumulatedProfit),
800
- });
801
- };
802
- CloseStrategyEventV2.fromJSON = function (json) {
803
- if (json.$typeName !== CloseStrategyEventV2.$typeName) {
804
- throw new Error("not a WithTwoGenerics json object");
805
- }
806
- return CloseStrategyEventV2.fromJSONField(json);
807
- };
808
- CloseStrategyEventV2.fromSuiParsedData = function (content) {
809
- if (content.dataType !== "moveObject") {
810
- throw new Error("not an object");
811
- }
812
- if (!isCloseStrategyEventV2(content.type)) {
813
- throw new Error("object at ".concat(content.fields.id, " is not a CloseStrategyEventV2 object"));
814
- }
815
- return CloseStrategyEventV2.fromFieldsWithTypes(content);
816
- };
817
- CloseStrategyEventV2.fromSuiObjectData = function (data) {
818
- if (data.bcs) {
819
- if (data.bcs.dataType !== "moveObject" || !isCloseStrategyEventV2(data.bcs.type)) {
820
- throw new Error("object at is not a CloseStrategyEventV2 object");
821
- }
822
- return CloseStrategyEventV2.fromBcs((0, utils_1.fromB64)(data.bcs.bcsBytes));
823
- }
824
- if (data.content) {
825
- return CloseStrategyEventV2.fromSuiParsedData(data.content);
826
- }
827
- throw new Error("Both `bcs` and `content` fields are missing from the data. Include `showBcs` or `showContent` in the request.");
828
- };
829
- CloseStrategyEventV2.fetch = function (client, id) {
830
- return __awaiter(this, void 0, void 0, function () {
831
- var res;
832
- var _a, _b;
833
- return __generator(this, function (_c) {
834
- switch (_c.label) {
835
- case 0: return [4 /*yield*/, client.getObject({ id: id, options: { showBcs: true } })];
836
- case 1:
837
- res = _c.sent();
838
- if (res.error) {
839
- throw new Error("error fetching CloseStrategyEventV2 object at id ".concat(id, ": ").concat(res.error.code));
840
- }
841
- if (((_b = (_a = res.data) === null || _a === void 0 ? void 0 : _a.bcs) === null || _b === void 0 ? void 0 : _b.dataType) !== "moveObject" || !isCloseStrategyEventV2(res.data.bcs.type)) {
842
- throw new Error("object at id ".concat(id, " is not a CloseStrategyEventV2 object"));
843
- }
844
- return [2 /*return*/, CloseStrategyEventV2.fromSuiObjectData(res.data)];
845
- }
846
- });
847
- });
848
- };
849
- CloseStrategyEventV2.$typeName = "".concat(index_1.PKG_V1, "::auto_bid::CloseStrategyEventV2");
850
- CloseStrategyEventV2.$numTypeParams = 0;
851
- CloseStrategyEventV2.$isPhantom = [];
852
- return CloseStrategyEventV2;
853
- }());
854
- exports.CloseStrategyEventV2 = CloseStrategyEventV2;
855
- /* ============================== NewStrategyEvent =============================== */
856
- function isNewStrategyEvent(type) {
857
- type = (0, util_1.compressSuiType)(type);
858
- return type === "".concat(index_1.PKG_V1, "::auto_bid::NewStrategyEvent");
859
- }
860
- var NewStrategyEvent = /** @class */ (function () {
861
- function NewStrategyEvent(typeArgs, fields) {
862
- this.__StructClass = true;
863
- this.$typeName = NewStrategyEvent.$typeName;
864
- this.$isPhantom = NewStrategyEvent.$isPhantom;
865
- this.$fullTypeName = util_1.composeSuiType.apply(void 0, __spreadArray([NewStrategyEvent.$typeName], __read(typeArgs), false));
866
- this.$typeArgs = typeArgs;
867
- this.vaultIndex = fields.vaultIndex;
868
- this.signalIndex = fields.signalIndex;
869
- this.user = fields.user;
870
- this.pricePercentage = fields.pricePercentage;
871
- this.size = fields.size;
872
- this.maxTimes = fields.maxTimes;
873
- this.targetRounds = fields.targetRounds;
874
- }
875
- NewStrategyEvent.reified = function () {
876
- var _this = this;
877
- return {
878
- typeName: NewStrategyEvent.$typeName,
879
- fullTypeName: util_1.composeSuiType.apply(void 0, __spreadArray([NewStrategyEvent.$typeName], [], false)),
880
- typeArgs: [],
881
- isPhantom: NewStrategyEvent.$isPhantom,
882
- reifiedTypeArgs: [],
883
- fromFields: function (fields) { return NewStrategyEvent.fromFields(fields); },
884
- fromFieldsWithTypes: function (item) { return NewStrategyEvent.fromFieldsWithTypes(item); },
885
- fromBcs: function (data) { return NewStrategyEvent.fromBcs(data); },
886
- bcs: NewStrategyEvent.bcs,
887
- fromJSONField: function (field) { return NewStrategyEvent.fromJSONField(field); },
888
- fromJSON: function (json) { return NewStrategyEvent.fromJSON(json); },
889
- fromSuiParsedData: function (content) { return NewStrategyEvent.fromSuiParsedData(content); },
890
- fromSuiObjectData: function (content) { return NewStrategyEvent.fromSuiObjectData(content); },
891
- fetch: function (client, id) { return __awaiter(_this, void 0, void 0, function () { return __generator(this, function (_a) {
892
- return [2 /*return*/, NewStrategyEvent.fetch(client, id)];
893
- }); }); },
894
- new: function (fields) {
895
- return new NewStrategyEvent([], fields);
896
- },
897
- kind: "StructClassReified",
898
- };
899
- };
900
- Object.defineProperty(NewStrategyEvent, "r", {
901
- get: function () {
902
- return NewStrategyEvent.reified();
903
- },
904
- enumerable: false,
905
- configurable: true
906
- });
907
- NewStrategyEvent.phantom = function () {
908
- return (0, reified_1.phantom)(NewStrategyEvent.reified());
909
- };
910
- Object.defineProperty(NewStrategyEvent, "p", {
911
- get: function () {
912
- return NewStrategyEvent.phantom();
913
- },
914
- enumerable: false,
915
- configurable: true
916
- });
917
- Object.defineProperty(NewStrategyEvent, "bcs", {
918
- get: function () {
919
- return bcs_1.bcs.struct("NewStrategyEvent", {
920
- vault_index: bcs_1.bcs.u64(),
921
- signal_index: bcs_1.bcs.u64(),
922
- user: bcs_1.bcs.bytes(32).transform({ input: function (val) { return (0, utils_1.fromHEX)(val); }, output: function (val) { return (0, utils_1.toHEX)(val); } }),
923
- price_percentage: bcs_1.bcs.u64(),
924
- size: bcs_1.bcs.u64(),
925
- max_times: bcs_1.bcs.u64(),
926
- target_rounds: bcs_1.bcs.vector(bcs_1.bcs.u64()),
927
- });
928
- },
929
- enumerable: false,
930
- configurable: true
931
- });
932
- NewStrategyEvent.fromFields = function (fields) {
933
- return NewStrategyEvent.reified().new({
934
- vaultIndex: (0, reified_1.decodeFromFields)("u64", fields.vault_index),
935
- signalIndex: (0, reified_1.decodeFromFields)("u64", fields.signal_index),
936
- user: (0, reified_1.decodeFromFields)("address", fields.user),
937
- pricePercentage: (0, reified_1.decodeFromFields)("u64", fields.price_percentage),
938
- size: (0, reified_1.decodeFromFields)("u64", fields.size),
939
- maxTimes: (0, reified_1.decodeFromFields)("u64", fields.max_times),
940
- targetRounds: (0, reified_1.decodeFromFields)(reified.vector("u64"), fields.target_rounds),
941
- });
942
- };
943
- NewStrategyEvent.fromFieldsWithTypes = function (item) {
944
- if (!isNewStrategyEvent(item.type)) {
945
- throw new Error("not a NewStrategyEvent type");
946
- }
947
- return NewStrategyEvent.reified().new({
948
- vaultIndex: (0, reified_1.decodeFromFieldsWithTypes)("u64", item.fields.vault_index),
949
- signalIndex: (0, reified_1.decodeFromFieldsWithTypes)("u64", item.fields.signal_index),
950
- user: (0, reified_1.decodeFromFieldsWithTypes)("address", item.fields.user),
951
- pricePercentage: (0, reified_1.decodeFromFieldsWithTypes)("u64", item.fields.price_percentage),
952
- size: (0, reified_1.decodeFromFieldsWithTypes)("u64", item.fields.size),
953
- maxTimes: (0, reified_1.decodeFromFieldsWithTypes)("u64", item.fields.max_times),
954
- targetRounds: (0, reified_1.decodeFromFieldsWithTypes)(reified.vector("u64"), item.fields.target_rounds),
955
- });
956
- };
957
- NewStrategyEvent.fromBcs = function (data) {
958
- return NewStrategyEvent.fromFields(NewStrategyEvent.bcs.parse(data));
959
- };
960
- NewStrategyEvent.prototype.toJSONField = function () {
961
- return {
962
- vaultIndex: this.vaultIndex.toString(),
963
- signalIndex: this.signalIndex.toString(),
964
- user: this.user,
965
- pricePercentage: this.pricePercentage.toString(),
966
- size: this.size.toString(),
967
- maxTimes: this.maxTimes.toString(),
968
- targetRounds: (0, reified_1.fieldToJSON)("vector<u64>", this.targetRounds),
969
- };
970
- };
971
- NewStrategyEvent.prototype.toJSON = function () {
972
- return __assign({ $typeName: this.$typeName, $typeArgs: this.$typeArgs }, this.toJSONField());
973
- };
974
- NewStrategyEvent.fromJSONField = function (field) {
975
- return NewStrategyEvent.reified().new({
976
- vaultIndex: (0, reified_1.decodeFromJSONField)("u64", field.vaultIndex),
977
- signalIndex: (0, reified_1.decodeFromJSONField)("u64", field.signalIndex),
978
- user: (0, reified_1.decodeFromJSONField)("address", field.user),
979
- pricePercentage: (0, reified_1.decodeFromJSONField)("u64", field.pricePercentage),
980
- size: (0, reified_1.decodeFromJSONField)("u64", field.size),
981
- maxTimes: (0, reified_1.decodeFromJSONField)("u64", field.maxTimes),
982
- targetRounds: (0, reified_1.decodeFromJSONField)(reified.vector("u64"), field.targetRounds),
983
- });
984
- };
985
- NewStrategyEvent.fromJSON = function (json) {
986
- if (json.$typeName !== NewStrategyEvent.$typeName) {
987
- throw new Error("not a WithTwoGenerics json object");
988
- }
989
- return NewStrategyEvent.fromJSONField(json);
990
- };
991
- NewStrategyEvent.fromSuiParsedData = function (content) {
992
- if (content.dataType !== "moveObject") {
993
- throw new Error("not an object");
994
- }
995
- if (!isNewStrategyEvent(content.type)) {
996
- throw new Error("object at ".concat(content.fields.id, " is not a NewStrategyEvent object"));
997
- }
998
- return NewStrategyEvent.fromFieldsWithTypes(content);
999
- };
1000
- NewStrategyEvent.fromSuiObjectData = function (data) {
1001
- if (data.bcs) {
1002
- if (data.bcs.dataType !== "moveObject" || !isNewStrategyEvent(data.bcs.type)) {
1003
- throw new Error("object at is not a NewStrategyEvent object");
1004
- }
1005
- return NewStrategyEvent.fromBcs((0, utils_1.fromB64)(data.bcs.bcsBytes));
1006
- }
1007
- if (data.content) {
1008
- return NewStrategyEvent.fromSuiParsedData(data.content);
1009
- }
1010
- throw new Error("Both `bcs` and `content` fields are missing from the data. Include `showBcs` or `showContent` in the request.");
1011
- };
1012
- NewStrategyEvent.fetch = function (client, id) {
1013
- return __awaiter(this, void 0, void 0, function () {
1014
- var res;
1015
- var _a, _b;
1016
- return __generator(this, function (_c) {
1017
- switch (_c.label) {
1018
- case 0: return [4 /*yield*/, client.getObject({ id: id, options: { showBcs: true } })];
1019
- case 1:
1020
- res = _c.sent();
1021
- if (res.error) {
1022
- throw new Error("error fetching NewStrategyEvent object at id ".concat(id, ": ").concat(res.error.code));
1023
- }
1024
- if (((_b = (_a = res.data) === null || _a === void 0 ? void 0 : _a.bcs) === null || _b === void 0 ? void 0 : _b.dataType) !== "moveObject" || !isNewStrategyEvent(res.data.bcs.type)) {
1025
- throw new Error("object at id ".concat(id, " is not a NewStrategyEvent object"));
1026
- }
1027
- return [2 /*return*/, NewStrategyEvent.fromSuiObjectData(res.data)];
1028
- }
1029
- });
1030
- });
1031
- };
1032
- NewStrategyEvent.$typeName = "".concat(index_1.PKG_V1, "::auto_bid::NewStrategyEvent");
1033
- NewStrategyEvent.$numTypeParams = 0;
1034
- NewStrategyEvent.$isPhantom = [];
1035
- return NewStrategyEvent;
1036
- }());
1037
- exports.NewStrategyEvent = NewStrategyEvent;
1038
- /* ============================== NewStrategyEventV2 =============================== */
1039
- function isNewStrategyEventV2(type) {
1040
- type = (0, util_1.compressSuiType)(type);
1041
- return type === "".concat(index_1.PKG_V1, "::auto_bid::NewStrategyEventV2");
1042
- }
1043
- var NewStrategyEventV2 = /** @class */ (function () {
1044
- function NewStrategyEventV2(typeArgs, fields) {
1045
- this.__StructClass = true;
1046
- this.$typeName = NewStrategyEventV2.$typeName;
1047
- this.$isPhantom = NewStrategyEventV2.$isPhantom;
1048
- this.$fullTypeName = util_1.composeSuiType.apply(void 0, __spreadArray([NewStrategyEventV2.$typeName], __read(typeArgs), false));
1049
- this.$typeArgs = typeArgs;
1050
- this.vaultIndex = fields.vaultIndex;
1051
- this.signalIndex = fields.signalIndex;
1052
- this.user = fields.user;
1053
- this.pricePercentage = fields.pricePercentage;
1054
- this.size = fields.size;
1055
- this.maxTimes = fields.maxTimes;
1056
- this.targetRounds = fields.targetRounds;
1057
- this.depositAmount = fields.depositAmount;
1058
- }
1059
- NewStrategyEventV2.reified = function () {
1060
- var _this = this;
1061
- return {
1062
- typeName: NewStrategyEventV2.$typeName,
1063
- fullTypeName: util_1.composeSuiType.apply(void 0, __spreadArray([NewStrategyEventV2.$typeName], [], false)),
1064
- typeArgs: [],
1065
- isPhantom: NewStrategyEventV2.$isPhantom,
1066
- reifiedTypeArgs: [],
1067
- fromFields: function (fields) { return NewStrategyEventV2.fromFields(fields); },
1068
- fromFieldsWithTypes: function (item) { return NewStrategyEventV2.fromFieldsWithTypes(item); },
1069
- fromBcs: function (data) { return NewStrategyEventV2.fromBcs(data); },
1070
- bcs: NewStrategyEventV2.bcs,
1071
- fromJSONField: function (field) { return NewStrategyEventV2.fromJSONField(field); },
1072
- fromJSON: function (json) { return NewStrategyEventV2.fromJSON(json); },
1073
- fromSuiParsedData: function (content) { return NewStrategyEventV2.fromSuiParsedData(content); },
1074
- fromSuiObjectData: function (content) { return NewStrategyEventV2.fromSuiObjectData(content); },
1075
- fetch: function (client, id) { return __awaiter(_this, void 0, void 0, function () { return __generator(this, function (_a) {
1076
- return [2 /*return*/, NewStrategyEventV2.fetch(client, id)];
1077
- }); }); },
1078
- new: function (fields) {
1079
- return new NewStrategyEventV2([], fields);
1080
- },
1081
- kind: "StructClassReified",
1082
- };
1083
- };
1084
- Object.defineProperty(NewStrategyEventV2, "r", {
1085
- get: function () {
1086
- return NewStrategyEventV2.reified();
1087
- },
1088
- enumerable: false,
1089
- configurable: true
1090
- });
1091
- NewStrategyEventV2.phantom = function () {
1092
- return (0, reified_1.phantom)(NewStrategyEventV2.reified());
1093
- };
1094
- Object.defineProperty(NewStrategyEventV2, "p", {
1095
- get: function () {
1096
- return NewStrategyEventV2.phantom();
1097
- },
1098
- enumerable: false,
1099
- configurable: true
1100
- });
1101
- Object.defineProperty(NewStrategyEventV2, "bcs", {
1102
- get: function () {
1103
- return bcs_1.bcs.struct("NewStrategyEventV2", {
1104
- vault_index: bcs_1.bcs.u64(),
1105
- signal_index: bcs_1.bcs.u64(),
1106
- user: bcs_1.bcs.bytes(32).transform({ input: function (val) { return (0, utils_1.fromHEX)(val); }, output: function (val) { return (0, utils_1.toHEX)(val); } }),
1107
- price_percentage: bcs_1.bcs.u64(),
1108
- size: bcs_1.bcs.u64(),
1109
- max_times: bcs_1.bcs.u64(),
1110
- target_rounds: bcs_1.bcs.vector(bcs_1.bcs.u64()),
1111
- deposit_amount: bcs_1.bcs.u64(),
1112
- });
1113
- },
1114
- enumerable: false,
1115
- configurable: true
1116
- });
1117
- NewStrategyEventV2.fromFields = function (fields) {
1118
- return NewStrategyEventV2.reified().new({
1119
- vaultIndex: (0, reified_1.decodeFromFields)("u64", fields.vault_index),
1120
- signalIndex: (0, reified_1.decodeFromFields)("u64", fields.signal_index),
1121
- user: (0, reified_1.decodeFromFields)("address", fields.user),
1122
- pricePercentage: (0, reified_1.decodeFromFields)("u64", fields.price_percentage),
1123
- size: (0, reified_1.decodeFromFields)("u64", fields.size),
1124
- maxTimes: (0, reified_1.decodeFromFields)("u64", fields.max_times),
1125
- targetRounds: (0, reified_1.decodeFromFields)(reified.vector("u64"), fields.target_rounds),
1126
- depositAmount: (0, reified_1.decodeFromFields)("u64", fields.deposit_amount),
1127
- });
1128
- };
1129
- NewStrategyEventV2.fromFieldsWithTypes = function (item) {
1130
- if (!isNewStrategyEventV2(item.type)) {
1131
- throw new Error("not a NewStrategyEventV2 type");
1132
- }
1133
- return NewStrategyEventV2.reified().new({
1134
- vaultIndex: (0, reified_1.decodeFromFieldsWithTypes)("u64", item.fields.vault_index),
1135
- signalIndex: (0, reified_1.decodeFromFieldsWithTypes)("u64", item.fields.signal_index),
1136
- user: (0, reified_1.decodeFromFieldsWithTypes)("address", item.fields.user),
1137
- pricePercentage: (0, reified_1.decodeFromFieldsWithTypes)("u64", item.fields.price_percentage),
1138
- size: (0, reified_1.decodeFromFieldsWithTypes)("u64", item.fields.size),
1139
- maxTimes: (0, reified_1.decodeFromFieldsWithTypes)("u64", item.fields.max_times),
1140
- targetRounds: (0, reified_1.decodeFromFieldsWithTypes)(reified.vector("u64"), item.fields.target_rounds),
1141
- depositAmount: (0, reified_1.decodeFromFieldsWithTypes)("u64", item.fields.deposit_amount),
1142
- });
1143
- };
1144
- NewStrategyEventV2.fromBcs = function (data) {
1145
- return NewStrategyEventV2.fromFields(NewStrategyEventV2.bcs.parse(data));
1146
- };
1147
- NewStrategyEventV2.prototype.toJSONField = function () {
1148
- return {
1149
- vaultIndex: this.vaultIndex.toString(),
1150
- signalIndex: this.signalIndex.toString(),
1151
- user: this.user,
1152
- pricePercentage: this.pricePercentage.toString(),
1153
- size: this.size.toString(),
1154
- maxTimes: this.maxTimes.toString(),
1155
- targetRounds: (0, reified_1.fieldToJSON)("vector<u64>", this.targetRounds),
1156
- depositAmount: this.depositAmount.toString(),
1157
- };
1158
- };
1159
- NewStrategyEventV2.prototype.toJSON = function () {
1160
- return __assign({ $typeName: this.$typeName, $typeArgs: this.$typeArgs }, this.toJSONField());
1161
- };
1162
- NewStrategyEventV2.fromJSONField = function (field) {
1163
- return NewStrategyEventV2.reified().new({
1164
- vaultIndex: (0, reified_1.decodeFromJSONField)("u64", field.vaultIndex),
1165
- signalIndex: (0, reified_1.decodeFromJSONField)("u64", field.signalIndex),
1166
- user: (0, reified_1.decodeFromJSONField)("address", field.user),
1167
- pricePercentage: (0, reified_1.decodeFromJSONField)("u64", field.pricePercentage),
1168
- size: (0, reified_1.decodeFromJSONField)("u64", field.size),
1169
- maxTimes: (0, reified_1.decodeFromJSONField)("u64", field.maxTimes),
1170
- targetRounds: (0, reified_1.decodeFromJSONField)(reified.vector("u64"), field.targetRounds),
1171
- depositAmount: (0, reified_1.decodeFromJSONField)("u64", field.depositAmount),
1172
- });
1173
- };
1174
- NewStrategyEventV2.fromJSON = function (json) {
1175
- if (json.$typeName !== NewStrategyEventV2.$typeName) {
1176
- throw new Error("not a WithTwoGenerics json object");
1177
- }
1178
- return NewStrategyEventV2.fromJSONField(json);
1179
- };
1180
- NewStrategyEventV2.fromSuiParsedData = function (content) {
1181
- if (content.dataType !== "moveObject") {
1182
- throw new Error("not an object");
1183
- }
1184
- if (!isNewStrategyEventV2(content.type)) {
1185
- throw new Error("object at ".concat(content.fields.id, " is not a NewStrategyEventV2 object"));
1186
- }
1187
- return NewStrategyEventV2.fromFieldsWithTypes(content);
1188
- };
1189
- NewStrategyEventV2.fromSuiObjectData = function (data) {
1190
- if (data.bcs) {
1191
- if (data.bcs.dataType !== "moveObject" || !isNewStrategyEventV2(data.bcs.type)) {
1192
- throw new Error("object at is not a NewStrategyEventV2 object");
1193
- }
1194
- return NewStrategyEventV2.fromBcs((0, utils_1.fromB64)(data.bcs.bcsBytes));
1195
- }
1196
- if (data.content) {
1197
- return NewStrategyEventV2.fromSuiParsedData(data.content);
1198
- }
1199
- throw new Error("Both `bcs` and `content` fields are missing from the data. Include `showBcs` or `showContent` in the request.");
1200
- };
1201
- NewStrategyEventV2.fetch = function (client, id) {
1202
- return __awaiter(this, void 0, void 0, function () {
1203
- var res;
1204
- var _a, _b;
1205
- return __generator(this, function (_c) {
1206
- switch (_c.label) {
1207
- case 0: return [4 /*yield*/, client.getObject({ id: id, options: { showBcs: true } })];
1208
- case 1:
1209
- res = _c.sent();
1210
- if (res.error) {
1211
- throw new Error("error fetching NewStrategyEventV2 object at id ".concat(id, ": ").concat(res.error.code));
1212
- }
1213
- if (((_b = (_a = res.data) === null || _a === void 0 ? void 0 : _a.bcs) === null || _b === void 0 ? void 0 : _b.dataType) !== "moveObject" || !isNewStrategyEventV2(res.data.bcs.type)) {
1214
- throw new Error("object at id ".concat(id, " is not a NewStrategyEventV2 object"));
1215
- }
1216
- return [2 /*return*/, NewStrategyEventV2.fromSuiObjectData(res.data)];
1217
- }
1218
- });
1219
- });
1220
- };
1221
- NewStrategyEventV2.$typeName = "".concat(index_1.PKG_V1, "::auto_bid::NewStrategyEventV2");
1222
- NewStrategyEventV2.$numTypeParams = 0;
1223
- NewStrategyEventV2.$isPhantom = [];
1224
- return NewStrategyEventV2;
1225
- }());
1226
- exports.NewStrategyEventV2 = NewStrategyEventV2;
1227
- /* ============================== NewStrategyPoolEvent =============================== */
1228
- function isNewStrategyPoolEvent(type) {
1229
- type = (0, util_1.compressSuiType)(type);
1230
- return type === "".concat(index_1.PKG_V1, "::auto_bid::NewStrategyPoolEvent");
1231
- }
1232
- var NewStrategyPoolEvent = /** @class */ (function () {
1233
- function NewStrategyPoolEvent(typeArgs, fields) {
1234
- this.__StructClass = true;
1235
- this.$typeName = NewStrategyPoolEvent.$typeName;
1236
- this.$isPhantom = NewStrategyPoolEvent.$isPhantom;
1237
- this.$fullTypeName = util_1.composeSuiType.apply(void 0, __spreadArray([NewStrategyPoolEvent.$typeName], __read(typeArgs), false));
1238
- this.$typeArgs = typeArgs;
1239
- this.id = fields.id;
1240
- this.signer = fields.signer;
1241
- }
1242
- NewStrategyPoolEvent.reified = function () {
1243
- var _this = this;
1244
- return {
1245
- typeName: NewStrategyPoolEvent.$typeName,
1246
- fullTypeName: util_1.composeSuiType.apply(void 0, __spreadArray([NewStrategyPoolEvent.$typeName], [], false)),
1247
- typeArgs: [],
1248
- isPhantom: NewStrategyPoolEvent.$isPhantom,
1249
- reifiedTypeArgs: [],
1250
- fromFields: function (fields) { return NewStrategyPoolEvent.fromFields(fields); },
1251
- fromFieldsWithTypes: function (item) { return NewStrategyPoolEvent.fromFieldsWithTypes(item); },
1252
- fromBcs: function (data) { return NewStrategyPoolEvent.fromBcs(data); },
1253
- bcs: NewStrategyPoolEvent.bcs,
1254
- fromJSONField: function (field) { return NewStrategyPoolEvent.fromJSONField(field); },
1255
- fromJSON: function (json) { return NewStrategyPoolEvent.fromJSON(json); },
1256
- fromSuiParsedData: function (content) { return NewStrategyPoolEvent.fromSuiParsedData(content); },
1257
- fromSuiObjectData: function (content) { return NewStrategyPoolEvent.fromSuiObjectData(content); },
1258
- fetch: function (client, id) { return __awaiter(_this, void 0, void 0, function () { return __generator(this, function (_a) {
1259
- return [2 /*return*/, NewStrategyPoolEvent.fetch(client, id)];
1260
- }); }); },
1261
- new: function (fields) {
1262
- return new NewStrategyPoolEvent([], fields);
1263
- },
1264
- kind: "StructClassReified",
1265
- };
1266
- };
1267
- Object.defineProperty(NewStrategyPoolEvent, "r", {
1268
- get: function () {
1269
- return NewStrategyPoolEvent.reified();
1270
- },
1271
- enumerable: false,
1272
- configurable: true
1273
- });
1274
- NewStrategyPoolEvent.phantom = function () {
1275
- return (0, reified_1.phantom)(NewStrategyPoolEvent.reified());
1276
- };
1277
- Object.defineProperty(NewStrategyPoolEvent, "p", {
1278
- get: function () {
1279
- return NewStrategyPoolEvent.phantom();
1280
- },
1281
- enumerable: false,
1282
- configurable: true
1283
- });
1284
- Object.defineProperty(NewStrategyPoolEvent, "bcs", {
1285
- get: function () {
1286
- return bcs_1.bcs.struct("NewStrategyPoolEvent", {
1287
- id: structs_1.ID.bcs,
1288
- 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); } }),
1289
- });
1290
- },
1291
- enumerable: false,
1292
- configurable: true
1293
- });
1294
- NewStrategyPoolEvent.fromFields = function (fields) {
1295
- return NewStrategyPoolEvent.reified().new({
1296
- id: (0, reified_1.decodeFromFields)(structs_1.ID.reified(), fields.id),
1297
- signer: (0, reified_1.decodeFromFields)("address", fields.signer),
1298
- });
1299
- };
1300
- NewStrategyPoolEvent.fromFieldsWithTypes = function (item) {
1301
- if (!isNewStrategyPoolEvent(item.type)) {
1302
- throw new Error("not a NewStrategyPoolEvent type");
1303
- }
1304
- return NewStrategyPoolEvent.reified().new({
1305
- id: (0, reified_1.decodeFromFieldsWithTypes)(structs_1.ID.reified(), item.fields.id),
1306
- signer: (0, reified_1.decodeFromFieldsWithTypes)("address", item.fields.signer),
1307
- });
1308
- };
1309
- NewStrategyPoolEvent.fromBcs = function (data) {
1310
- return NewStrategyPoolEvent.fromFields(NewStrategyPoolEvent.bcs.parse(data));
1311
- };
1312
- NewStrategyPoolEvent.prototype.toJSONField = function () {
1313
- return {
1314
- id: this.id,
1315
- signer: this.signer,
1316
- };
1317
- };
1318
- NewStrategyPoolEvent.prototype.toJSON = function () {
1319
- return __assign({ $typeName: this.$typeName, $typeArgs: this.$typeArgs }, this.toJSONField());
1320
- };
1321
- NewStrategyPoolEvent.fromJSONField = function (field) {
1322
- return NewStrategyPoolEvent.reified().new({
1323
- id: (0, reified_1.decodeFromJSONField)(structs_1.ID.reified(), field.id),
1324
- signer: (0, reified_1.decodeFromJSONField)("address", field.signer),
1325
- });
1326
- };
1327
- NewStrategyPoolEvent.fromJSON = function (json) {
1328
- if (json.$typeName !== NewStrategyPoolEvent.$typeName) {
1329
- throw new Error("not a WithTwoGenerics json object");
1330
- }
1331
- return NewStrategyPoolEvent.fromJSONField(json);
1332
- };
1333
- NewStrategyPoolEvent.fromSuiParsedData = function (content) {
1334
- if (content.dataType !== "moveObject") {
1335
- throw new Error("not an object");
1336
- }
1337
- if (!isNewStrategyPoolEvent(content.type)) {
1338
- throw new Error("object at ".concat(content.fields.id, " is not a NewStrategyPoolEvent object"));
1339
- }
1340
- return NewStrategyPoolEvent.fromFieldsWithTypes(content);
1341
- };
1342
- NewStrategyPoolEvent.fromSuiObjectData = function (data) {
1343
- if (data.bcs) {
1344
- if (data.bcs.dataType !== "moveObject" || !isNewStrategyPoolEvent(data.bcs.type)) {
1345
- throw new Error("object at is not a NewStrategyPoolEvent object");
1346
- }
1347
- return NewStrategyPoolEvent.fromBcs((0, utils_1.fromB64)(data.bcs.bcsBytes));
1348
- }
1349
- if (data.content) {
1350
- return NewStrategyPoolEvent.fromSuiParsedData(data.content);
1351
- }
1352
- throw new Error("Both `bcs` and `content` fields are missing from the data. Include `showBcs` or `showContent` in the request.");
1353
- };
1354
- NewStrategyPoolEvent.fetch = function (client, id) {
1355
- return __awaiter(this, void 0, void 0, function () {
1356
- var res;
1357
- var _a, _b;
1358
- return __generator(this, function (_c) {
1359
- switch (_c.label) {
1360
- case 0: return [4 /*yield*/, client.getObject({ id: id, options: { showBcs: true } })];
1361
- case 1:
1362
- res = _c.sent();
1363
- if (res.error) {
1364
- throw new Error("error fetching NewStrategyPoolEvent object at id ".concat(id, ": ").concat(res.error.code));
1365
- }
1366
- if (((_b = (_a = res.data) === null || _a === void 0 ? void 0 : _a.bcs) === null || _b === void 0 ? void 0 : _b.dataType) !== "moveObject" || !isNewStrategyPoolEvent(res.data.bcs.type)) {
1367
- throw new Error("object at id ".concat(id, " is not a NewStrategyPoolEvent object"));
1368
- }
1369
- return [2 /*return*/, NewStrategyPoolEvent.fromSuiObjectData(res.data)];
1370
- }
1371
- });
1372
- });
1373
- };
1374
- NewStrategyPoolEvent.$typeName = "".concat(index_1.PKG_V1, "::auto_bid::NewStrategyPoolEvent");
1375
- NewStrategyPoolEvent.$numTypeParams = 0;
1376
- NewStrategyPoolEvent.$isPhantom = [];
1377
- return NewStrategyPoolEvent;
1378
- }());
1379
- exports.NewStrategyPoolEvent = NewStrategyPoolEvent;
1380
- /* ============================== NewStrategySignalEvent =============================== */
1381
- function isNewStrategySignalEvent(type) {
1382
- type = (0, util_1.compressSuiType)(type);
1383
- return type === "".concat(index_1.PKG_V1, "::auto_bid::NewStrategySignalEvent");
1384
- }
1385
- var NewStrategySignalEvent = /** @class */ (function () {
1386
- function NewStrategySignalEvent(typeArgs, fields) {
1387
- this.__StructClass = true;
1388
- this.$typeName = NewStrategySignalEvent.$typeName;
1389
- this.$isPhantom = NewStrategySignalEvent.$isPhantom;
1390
- this.$fullTypeName = util_1.composeSuiType.apply(void 0, __spreadArray([NewStrategySignalEvent.$typeName], __read(typeArgs), false));
1391
- this.$typeArgs = typeArgs;
1392
- this.id = fields.id;
1393
- this.vaultIndex = fields.vaultIndex;
1394
- this.signalIndex = fields.signalIndex;
1395
- this.signer = fields.signer;
1396
- }
1397
- NewStrategySignalEvent.reified = function () {
1398
- var _this = this;
1399
- return {
1400
- typeName: NewStrategySignalEvent.$typeName,
1401
- fullTypeName: util_1.composeSuiType.apply(void 0, __spreadArray([NewStrategySignalEvent.$typeName], [], false)),
1402
- typeArgs: [],
1403
- isPhantom: NewStrategySignalEvent.$isPhantom,
1404
- reifiedTypeArgs: [],
1405
- fromFields: function (fields) { return NewStrategySignalEvent.fromFields(fields); },
1406
- fromFieldsWithTypes: function (item) { return NewStrategySignalEvent.fromFieldsWithTypes(item); },
1407
- fromBcs: function (data) { return NewStrategySignalEvent.fromBcs(data); },
1408
- bcs: NewStrategySignalEvent.bcs,
1409
- fromJSONField: function (field) { return NewStrategySignalEvent.fromJSONField(field); },
1410
- fromJSON: function (json) { return NewStrategySignalEvent.fromJSON(json); },
1411
- fromSuiParsedData: function (content) { return NewStrategySignalEvent.fromSuiParsedData(content); },
1412
- fromSuiObjectData: function (content) { return NewStrategySignalEvent.fromSuiObjectData(content); },
1413
- fetch: function (client, id) { return __awaiter(_this, void 0, void 0, function () { return __generator(this, function (_a) {
1414
- return [2 /*return*/, NewStrategySignalEvent.fetch(client, id)];
1415
- }); }); },
1416
- new: function (fields) {
1417
- return new NewStrategySignalEvent([], fields);
1418
- },
1419
- kind: "StructClassReified",
1420
- };
1421
- };
1422
- Object.defineProperty(NewStrategySignalEvent, "r", {
1423
- get: function () {
1424
- return NewStrategySignalEvent.reified();
1425
- },
1426
- enumerable: false,
1427
- configurable: true
1428
- });
1429
- NewStrategySignalEvent.phantom = function () {
1430
- return (0, reified_1.phantom)(NewStrategySignalEvent.reified());
1431
- };
1432
- Object.defineProperty(NewStrategySignalEvent, "p", {
1433
- get: function () {
1434
- return NewStrategySignalEvent.phantom();
1435
- },
1436
- enumerable: false,
1437
- configurable: true
1438
- });
1439
- Object.defineProperty(NewStrategySignalEvent, "bcs", {
1440
- get: function () {
1441
- return bcs_1.bcs.struct("NewStrategySignalEvent", {
1442
- id: structs_1.ID.bcs,
1443
- vault_index: bcs_1.bcs.u64(),
1444
- signal_index: bcs_1.bcs.u64(),
1445
- 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); } }),
1446
- });
1447
- },
1448
- enumerable: false,
1449
- configurable: true
1450
- });
1451
- NewStrategySignalEvent.fromFields = function (fields) {
1452
- return NewStrategySignalEvent.reified().new({
1453
- id: (0, reified_1.decodeFromFields)(structs_1.ID.reified(), fields.id),
1454
- vaultIndex: (0, reified_1.decodeFromFields)("u64", fields.vault_index),
1455
- signalIndex: (0, reified_1.decodeFromFields)("u64", fields.signal_index),
1456
- signer: (0, reified_1.decodeFromFields)("address", fields.signer),
1457
- });
1458
- };
1459
- NewStrategySignalEvent.fromFieldsWithTypes = function (item) {
1460
- if (!isNewStrategySignalEvent(item.type)) {
1461
- throw new Error("not a NewStrategySignalEvent type");
1462
- }
1463
- return NewStrategySignalEvent.reified().new({
1464
- id: (0, reified_1.decodeFromFieldsWithTypes)(structs_1.ID.reified(), item.fields.id),
1465
- vaultIndex: (0, reified_1.decodeFromFieldsWithTypes)("u64", item.fields.vault_index),
1466
- signalIndex: (0, reified_1.decodeFromFieldsWithTypes)("u64", item.fields.signal_index),
1467
- signer: (0, reified_1.decodeFromFieldsWithTypes)("address", item.fields.signer),
1468
- });
1469
- };
1470
- NewStrategySignalEvent.fromBcs = function (data) {
1471
- return NewStrategySignalEvent.fromFields(NewStrategySignalEvent.bcs.parse(data));
1472
- };
1473
- NewStrategySignalEvent.prototype.toJSONField = function () {
1474
- return {
1475
- id: this.id,
1476
- vaultIndex: this.vaultIndex.toString(),
1477
- signalIndex: this.signalIndex.toString(),
1478
- signer: this.signer,
1479
- };
1480
- };
1481
- NewStrategySignalEvent.prototype.toJSON = function () {
1482
- return __assign({ $typeName: this.$typeName, $typeArgs: this.$typeArgs }, this.toJSONField());
1483
- };
1484
- NewStrategySignalEvent.fromJSONField = function (field) {
1485
- return NewStrategySignalEvent.reified().new({
1486
- id: (0, reified_1.decodeFromJSONField)(structs_1.ID.reified(), field.id),
1487
- vaultIndex: (0, reified_1.decodeFromJSONField)("u64", field.vaultIndex),
1488
- signalIndex: (0, reified_1.decodeFromJSONField)("u64", field.signalIndex),
1489
- signer: (0, reified_1.decodeFromJSONField)("address", field.signer),
1490
- });
1491
- };
1492
- NewStrategySignalEvent.fromJSON = function (json) {
1493
- if (json.$typeName !== NewStrategySignalEvent.$typeName) {
1494
- throw new Error("not a WithTwoGenerics json object");
1495
- }
1496
- return NewStrategySignalEvent.fromJSONField(json);
1497
- };
1498
- NewStrategySignalEvent.fromSuiParsedData = function (content) {
1499
- if (content.dataType !== "moveObject") {
1500
- throw new Error("not an object");
1501
- }
1502
- if (!isNewStrategySignalEvent(content.type)) {
1503
- throw new Error("object at ".concat(content.fields.id, " is not a NewStrategySignalEvent object"));
1504
- }
1505
- return NewStrategySignalEvent.fromFieldsWithTypes(content);
1506
- };
1507
- NewStrategySignalEvent.fromSuiObjectData = function (data) {
1508
- if (data.bcs) {
1509
- if (data.bcs.dataType !== "moveObject" || !isNewStrategySignalEvent(data.bcs.type)) {
1510
- throw new Error("object at is not a NewStrategySignalEvent object");
1511
- }
1512
- return NewStrategySignalEvent.fromBcs((0, utils_1.fromB64)(data.bcs.bcsBytes));
1513
- }
1514
- if (data.content) {
1515
- return NewStrategySignalEvent.fromSuiParsedData(data.content);
1516
- }
1517
- throw new Error("Both `bcs` and `content` fields are missing from the data. Include `showBcs` or `showContent` in the request.");
1518
- };
1519
- NewStrategySignalEvent.fetch = function (client, id) {
1520
- return __awaiter(this, void 0, void 0, function () {
1521
- var res;
1522
- var _a, _b;
1523
- return __generator(this, function (_c) {
1524
- switch (_c.label) {
1525
- case 0: return [4 /*yield*/, client.getObject({ id: id, options: { showBcs: true } })];
1526
- case 1:
1527
- res = _c.sent();
1528
- if (res.error) {
1529
- throw new Error("error fetching NewStrategySignalEvent object at id ".concat(id, ": ").concat(res.error.code));
1530
- }
1531
- if (((_b = (_a = res.data) === null || _a === void 0 ? void 0 : _a.bcs) === null || _b === void 0 ? void 0 : _b.dataType) !== "moveObject" || !isNewStrategySignalEvent(res.data.bcs.type)) {
1532
- throw new Error("object at id ".concat(id, " is not a NewStrategySignalEvent object"));
1533
- }
1534
- return [2 /*return*/, NewStrategySignalEvent.fromSuiObjectData(res.data)];
1535
- }
1536
- });
1537
- });
1538
- };
1539
- NewStrategySignalEvent.$typeName = "".concat(index_1.PKG_V1, "::auto_bid::NewStrategySignalEvent");
1540
- NewStrategySignalEvent.$numTypeParams = 0;
1541
- NewStrategySignalEvent.$isPhantom = [];
1542
- return NewStrategySignalEvent;
1543
- }());
1544
- exports.NewStrategySignalEvent = NewStrategySignalEvent;
1545
- /* ============================== NewStrategyVaultEvent =============================== */
1546
- function isNewStrategyVaultEvent(type) {
1547
- type = (0, util_1.compressSuiType)(type);
1548
- return type === "".concat(index_1.PKG_V1, "::auto_bid::NewStrategyVaultEvent");
1549
- }
1550
- var NewStrategyVaultEvent = /** @class */ (function () {
1551
- function NewStrategyVaultEvent(typeArgs, fields) {
1552
- this.__StructClass = true;
1553
- this.$typeName = NewStrategyVaultEvent.$typeName;
1554
- this.$isPhantom = NewStrategyVaultEvent.$isPhantom;
1555
- this.$fullTypeName = util_1.composeSuiType.apply(void 0, __spreadArray([NewStrategyVaultEvent.$typeName], __read(typeArgs), false));
1556
- this.$typeArgs = typeArgs;
1557
- this.id = fields.id;
1558
- this.vaultIndex = fields.vaultIndex;
1559
- this.signer = fields.signer;
1560
- }
1561
- NewStrategyVaultEvent.reified = function () {
1562
- var _this = this;
1563
- return {
1564
- typeName: NewStrategyVaultEvent.$typeName,
1565
- fullTypeName: util_1.composeSuiType.apply(void 0, __spreadArray([NewStrategyVaultEvent.$typeName], [], false)),
1566
- typeArgs: [],
1567
- isPhantom: NewStrategyVaultEvent.$isPhantom,
1568
- reifiedTypeArgs: [],
1569
- fromFields: function (fields) { return NewStrategyVaultEvent.fromFields(fields); },
1570
- fromFieldsWithTypes: function (item) { return NewStrategyVaultEvent.fromFieldsWithTypes(item); },
1571
- fromBcs: function (data) { return NewStrategyVaultEvent.fromBcs(data); },
1572
- bcs: NewStrategyVaultEvent.bcs,
1573
- fromJSONField: function (field) { return NewStrategyVaultEvent.fromJSONField(field); },
1574
- fromJSON: function (json) { return NewStrategyVaultEvent.fromJSON(json); },
1575
- fromSuiParsedData: function (content) { return NewStrategyVaultEvent.fromSuiParsedData(content); },
1576
- fromSuiObjectData: function (content) { return NewStrategyVaultEvent.fromSuiObjectData(content); },
1577
- fetch: function (client, id) { return __awaiter(_this, void 0, void 0, function () { return __generator(this, function (_a) {
1578
- return [2 /*return*/, NewStrategyVaultEvent.fetch(client, id)];
1579
- }); }); },
1580
- new: function (fields) {
1581
- return new NewStrategyVaultEvent([], fields);
1582
- },
1583
- kind: "StructClassReified",
1584
- };
1585
- };
1586
- Object.defineProperty(NewStrategyVaultEvent, "r", {
1587
- get: function () {
1588
- return NewStrategyVaultEvent.reified();
1589
- },
1590
- enumerable: false,
1591
- configurable: true
1592
- });
1593
- NewStrategyVaultEvent.phantom = function () {
1594
- return (0, reified_1.phantom)(NewStrategyVaultEvent.reified());
1595
- };
1596
- Object.defineProperty(NewStrategyVaultEvent, "p", {
1597
- get: function () {
1598
- return NewStrategyVaultEvent.phantom();
1599
- },
1600
- enumerable: false,
1601
- configurable: true
1602
- });
1603
- Object.defineProperty(NewStrategyVaultEvent, "bcs", {
1604
- get: function () {
1605
- return bcs_1.bcs.struct("NewStrategyVaultEvent", {
1606
- id: structs_1.ID.bcs,
1607
- vault_index: bcs_1.bcs.u64(),
1608
- 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); } }),
1609
- });
1610
- },
1611
- enumerable: false,
1612
- configurable: true
1613
- });
1614
- NewStrategyVaultEvent.fromFields = function (fields) {
1615
- return NewStrategyVaultEvent.reified().new({
1616
- id: (0, reified_1.decodeFromFields)(structs_1.ID.reified(), fields.id),
1617
- vaultIndex: (0, reified_1.decodeFromFields)("u64", fields.vault_index),
1618
- signer: (0, reified_1.decodeFromFields)("address", fields.signer),
1619
- });
1620
- };
1621
- NewStrategyVaultEvent.fromFieldsWithTypes = function (item) {
1622
- if (!isNewStrategyVaultEvent(item.type)) {
1623
- throw new Error("not a NewStrategyVaultEvent type");
1624
- }
1625
- return NewStrategyVaultEvent.reified().new({
1626
- id: (0, reified_1.decodeFromFieldsWithTypes)(structs_1.ID.reified(), item.fields.id),
1627
- vaultIndex: (0, reified_1.decodeFromFieldsWithTypes)("u64", item.fields.vault_index),
1628
- signer: (0, reified_1.decodeFromFieldsWithTypes)("address", item.fields.signer),
1629
- });
1630
- };
1631
- NewStrategyVaultEvent.fromBcs = function (data) {
1632
- return NewStrategyVaultEvent.fromFields(NewStrategyVaultEvent.bcs.parse(data));
1633
- };
1634
- NewStrategyVaultEvent.prototype.toJSONField = function () {
1635
- return {
1636
- id: this.id,
1637
- vaultIndex: this.vaultIndex.toString(),
1638
- signer: this.signer,
1639
- };
1640
- };
1641
- NewStrategyVaultEvent.prototype.toJSON = function () {
1642
- return __assign({ $typeName: this.$typeName, $typeArgs: this.$typeArgs }, this.toJSONField());
1643
- };
1644
- NewStrategyVaultEvent.fromJSONField = function (field) {
1645
- return NewStrategyVaultEvent.reified().new({
1646
- id: (0, reified_1.decodeFromJSONField)(structs_1.ID.reified(), field.id),
1647
- vaultIndex: (0, reified_1.decodeFromJSONField)("u64", field.vaultIndex),
1648
- signer: (0, reified_1.decodeFromJSONField)("address", field.signer),
1649
- });
1650
- };
1651
- NewStrategyVaultEvent.fromJSON = function (json) {
1652
- if (json.$typeName !== NewStrategyVaultEvent.$typeName) {
1653
- throw new Error("not a WithTwoGenerics json object");
1654
- }
1655
- return NewStrategyVaultEvent.fromJSONField(json);
1656
- };
1657
- NewStrategyVaultEvent.fromSuiParsedData = function (content) {
1658
- if (content.dataType !== "moveObject") {
1659
- throw new Error("not an object");
1660
- }
1661
- if (!isNewStrategyVaultEvent(content.type)) {
1662
- throw new Error("object at ".concat(content.fields.id, " is not a NewStrategyVaultEvent object"));
1663
- }
1664
- return NewStrategyVaultEvent.fromFieldsWithTypes(content);
1665
- };
1666
- NewStrategyVaultEvent.fromSuiObjectData = function (data) {
1667
- if (data.bcs) {
1668
- if (data.bcs.dataType !== "moveObject" || !isNewStrategyVaultEvent(data.bcs.type)) {
1669
- throw new Error("object at is not a NewStrategyVaultEvent object");
1670
- }
1671
- return NewStrategyVaultEvent.fromBcs((0, utils_1.fromB64)(data.bcs.bcsBytes));
1672
- }
1673
- if (data.content) {
1674
- return NewStrategyVaultEvent.fromSuiParsedData(data.content);
1675
- }
1676
- throw new Error("Both `bcs` and `content` fields are missing from the data. Include `showBcs` or `showContent` in the request.");
1677
- };
1678
- NewStrategyVaultEvent.fetch = function (client, id) {
1679
- return __awaiter(this, void 0, void 0, function () {
1680
- var res;
1681
- var _a, _b;
1682
- return __generator(this, function (_c) {
1683
- switch (_c.label) {
1684
- case 0: return [4 /*yield*/, client.getObject({ id: id, options: { showBcs: true } })];
1685
- case 1:
1686
- res = _c.sent();
1687
- if (res.error) {
1688
- throw new Error("error fetching NewStrategyVaultEvent object at id ".concat(id, ": ").concat(res.error.code));
1689
- }
1690
- if (((_b = (_a = res.data) === null || _a === void 0 ? void 0 : _a.bcs) === null || _b === void 0 ? void 0 : _b.dataType) !== "moveObject" || !isNewStrategyVaultEvent(res.data.bcs.type)) {
1691
- throw new Error("object at id ".concat(id, " is not a NewStrategyVaultEvent object"));
1692
- }
1693
- return [2 /*return*/, NewStrategyVaultEvent.fromSuiObjectData(res.data)];
1694
- }
1695
- });
1696
- });
1697
- };
1698
- NewStrategyVaultEvent.$typeName = "".concat(index_1.PKG_V1, "::auto_bid::NewStrategyVaultEvent");
1699
- NewStrategyVaultEvent.$numTypeParams = 0;
1700
- NewStrategyVaultEvent.$isPhantom = [];
1701
- return NewStrategyVaultEvent;
1702
- }());
1703
- exports.NewStrategyVaultEvent = NewStrategyVaultEvent;
1704
- /* ============================== RemoveStrategyVaultEvent =============================== */
1705
- function isRemoveStrategyVaultEvent(type) {
1706
- type = (0, util_1.compressSuiType)(type);
1707
- return type === "".concat(index_1.PKG_V13, "::auto_bid::RemoveStrategyVaultEvent");
1708
- }
1709
- var RemoveStrategyVaultEvent = /** @class */ (function () {
1710
- function RemoveStrategyVaultEvent(typeArgs, fields) {
1711
- this.__StructClass = true;
1712
- this.$typeName = RemoveStrategyVaultEvent.$typeName;
1713
- this.$isPhantom = RemoveStrategyVaultEvent.$isPhantom;
1714
- this.$fullTypeName = util_1.composeSuiType.apply(void 0, __spreadArray([RemoveStrategyVaultEvent.$typeName], __read(typeArgs), false));
1715
- this.$typeArgs = typeArgs;
1716
- this.id = fields.id;
1717
- this.vaultIndex = fields.vaultIndex;
1718
- this.signer = fields.signer;
1719
- }
1720
- RemoveStrategyVaultEvent.reified = function () {
1721
- var _this = this;
1722
- return {
1723
- typeName: RemoveStrategyVaultEvent.$typeName,
1724
- fullTypeName: util_1.composeSuiType.apply(void 0, __spreadArray([RemoveStrategyVaultEvent.$typeName], [], false)),
1725
- typeArgs: [],
1726
- isPhantom: RemoveStrategyVaultEvent.$isPhantom,
1727
- reifiedTypeArgs: [],
1728
- fromFields: function (fields) { return RemoveStrategyVaultEvent.fromFields(fields); },
1729
- fromFieldsWithTypes: function (item) { return RemoveStrategyVaultEvent.fromFieldsWithTypes(item); },
1730
- fromBcs: function (data) { return RemoveStrategyVaultEvent.fromBcs(data); },
1731
- bcs: RemoveStrategyVaultEvent.bcs,
1732
- fromJSONField: function (field) { return RemoveStrategyVaultEvent.fromJSONField(field); },
1733
- fromJSON: function (json) { return RemoveStrategyVaultEvent.fromJSON(json); },
1734
- fromSuiParsedData: function (content) { return RemoveStrategyVaultEvent.fromSuiParsedData(content); },
1735
- fromSuiObjectData: function (content) { return RemoveStrategyVaultEvent.fromSuiObjectData(content); },
1736
- fetch: function (client, id) { return __awaiter(_this, void 0, void 0, function () { return __generator(this, function (_a) {
1737
- return [2 /*return*/, RemoveStrategyVaultEvent.fetch(client, id)];
1738
- }); }); },
1739
- new: function (fields) {
1740
- return new RemoveStrategyVaultEvent([], fields);
1741
- },
1742
- kind: "StructClassReified",
1743
- };
1744
- };
1745
- Object.defineProperty(RemoveStrategyVaultEvent, "r", {
1746
- get: function () {
1747
- return RemoveStrategyVaultEvent.reified();
1748
- },
1749
- enumerable: false,
1750
- configurable: true
1751
- });
1752
- RemoveStrategyVaultEvent.phantom = function () {
1753
- return (0, reified_1.phantom)(RemoveStrategyVaultEvent.reified());
1754
- };
1755
- Object.defineProperty(RemoveStrategyVaultEvent, "p", {
1756
- get: function () {
1757
- return RemoveStrategyVaultEvent.phantom();
1758
- },
1759
- enumerable: false,
1760
- configurable: true
1761
- });
1762
- Object.defineProperty(RemoveStrategyVaultEvent, "bcs", {
1763
- get: function () {
1764
- return bcs_1.bcs.struct("RemoveStrategyVaultEvent", {
1765
- id: structs_1.ID.bcs,
1766
- vault_index: bcs_1.bcs.u64(),
1767
- 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); } }),
1768
- });
1769
- },
1770
- enumerable: false,
1771
- configurable: true
1772
- });
1773
- RemoveStrategyVaultEvent.fromFields = function (fields) {
1774
- return RemoveStrategyVaultEvent.reified().new({
1775
- id: (0, reified_1.decodeFromFields)(structs_1.ID.reified(), fields.id),
1776
- vaultIndex: (0, reified_1.decodeFromFields)("u64", fields.vault_index),
1777
- signer: (0, reified_1.decodeFromFields)("address", fields.signer),
1778
- });
1779
- };
1780
- RemoveStrategyVaultEvent.fromFieldsWithTypes = function (item) {
1781
- if (!isRemoveStrategyVaultEvent(item.type)) {
1782
- throw new Error("not a RemoveStrategyVaultEvent type");
1783
- }
1784
- return RemoveStrategyVaultEvent.reified().new({
1785
- id: (0, reified_1.decodeFromFieldsWithTypes)(structs_1.ID.reified(), item.fields.id),
1786
- vaultIndex: (0, reified_1.decodeFromFieldsWithTypes)("u64", item.fields.vault_index),
1787
- signer: (0, reified_1.decodeFromFieldsWithTypes)("address", item.fields.signer),
1788
- });
1789
- };
1790
- RemoveStrategyVaultEvent.fromBcs = function (data) {
1791
- return RemoveStrategyVaultEvent.fromFields(RemoveStrategyVaultEvent.bcs.parse(data));
1792
- };
1793
- RemoveStrategyVaultEvent.prototype.toJSONField = function () {
1794
- return {
1795
- id: this.id,
1796
- vaultIndex: this.vaultIndex.toString(),
1797
- signer: this.signer,
1798
- };
1799
- };
1800
- RemoveStrategyVaultEvent.prototype.toJSON = function () {
1801
- return __assign({ $typeName: this.$typeName, $typeArgs: this.$typeArgs }, this.toJSONField());
1802
- };
1803
- RemoveStrategyVaultEvent.fromJSONField = function (field) {
1804
- return RemoveStrategyVaultEvent.reified().new({
1805
- id: (0, reified_1.decodeFromJSONField)(structs_1.ID.reified(), field.id),
1806
- vaultIndex: (0, reified_1.decodeFromJSONField)("u64", field.vaultIndex),
1807
- signer: (0, reified_1.decodeFromJSONField)("address", field.signer),
1808
- });
1809
- };
1810
- RemoveStrategyVaultEvent.fromJSON = function (json) {
1811
- if (json.$typeName !== RemoveStrategyVaultEvent.$typeName) {
1812
- throw new Error("not a WithTwoGenerics json object");
1813
- }
1814
- return RemoveStrategyVaultEvent.fromJSONField(json);
1815
- };
1816
- RemoveStrategyVaultEvent.fromSuiParsedData = function (content) {
1817
- if (content.dataType !== "moveObject") {
1818
- throw new Error("not an object");
1819
- }
1820
- if (!isRemoveStrategyVaultEvent(content.type)) {
1821
- throw new Error("object at ".concat(content.fields.id, " is not a RemoveStrategyVaultEvent object"));
1822
- }
1823
- return RemoveStrategyVaultEvent.fromFieldsWithTypes(content);
1824
- };
1825
- RemoveStrategyVaultEvent.fromSuiObjectData = function (data) {
1826
- if (data.bcs) {
1827
- if (data.bcs.dataType !== "moveObject" || !isRemoveStrategyVaultEvent(data.bcs.type)) {
1828
- throw new Error("object at is not a RemoveStrategyVaultEvent object");
1829
- }
1830
- return RemoveStrategyVaultEvent.fromBcs((0, utils_1.fromB64)(data.bcs.bcsBytes));
1831
- }
1832
- if (data.content) {
1833
- return RemoveStrategyVaultEvent.fromSuiParsedData(data.content);
1834
- }
1835
- throw new Error("Both `bcs` and `content` fields are missing from the data. Include `showBcs` or `showContent` in the request.");
1836
- };
1837
- RemoveStrategyVaultEvent.fetch = function (client, id) {
1838
- return __awaiter(this, void 0, void 0, function () {
1839
- var res;
1840
- var _a, _b;
1841
- return __generator(this, function (_c) {
1842
- switch (_c.label) {
1843
- case 0: return [4 /*yield*/, client.getObject({ id: id, options: { showBcs: true } })];
1844
- case 1:
1845
- res = _c.sent();
1846
- if (res.error) {
1847
- throw new Error("error fetching RemoveStrategyVaultEvent object at id ".concat(id, ": ").concat(res.error.code));
1848
- }
1849
- if (((_b = (_a = res.data) === null || _a === void 0 ? void 0 : _a.bcs) === null || _b === void 0 ? void 0 : _b.dataType) !== "moveObject" || !isRemoveStrategyVaultEvent(res.data.bcs.type)) {
1850
- throw new Error("object at id ".concat(id, " is not a RemoveStrategyVaultEvent object"));
1851
- }
1852
- return [2 /*return*/, RemoveStrategyVaultEvent.fromSuiObjectData(res.data)];
1853
- }
1854
- });
1855
- });
1856
- };
1857
- RemoveStrategyVaultEvent.$typeName = "".concat(index_1.PKG_V13, "::auto_bid::RemoveStrategyVaultEvent");
1858
- RemoveStrategyVaultEvent.$numTypeParams = 0;
1859
- RemoveStrategyVaultEvent.$isPhantom = [];
1860
- return RemoveStrategyVaultEvent;
1861
- }());
1862
- exports.RemoveStrategyVaultEvent = RemoveStrategyVaultEvent;
1863
- /* ============================== Strategy =============================== */
1864
- function isStrategy(type) {
1865
- type = (0, util_1.compressSuiType)(type);
1866
- return type === "".concat(index_1.PKG_V1, "::auto_bid::Strategy");
1867
- }
1868
- var Strategy = /** @class */ (function () {
1869
- function Strategy(typeArgs, fields) {
1870
- this.__StructClass = true;
1871
- this.$typeName = Strategy.$typeName;
1872
- this.$isPhantom = Strategy.$isPhantom;
1873
- this.$fullTypeName = util_1.composeSuiType.apply(void 0, __spreadArray([Strategy.$typeName], __read(typeArgs), false));
1874
- this.$typeArgs = typeArgs;
1875
- this.id = fields.id;
1876
- this.vaultIndex = fields.vaultIndex;
1877
- this.signalIndex = fields.signalIndex;
1878
- this.user = fields.user;
1879
- this.pricePercentage = fields.pricePercentage;
1880
- this.size = fields.size;
1881
- this.maxTimes = fields.maxTimes;
1882
- this.targetRounds = fields.targetRounds;
1883
- this.receipts = fields.receipts;
1884
- this.active = fields.active;
1885
- this.u64Padding = fields.u64Padding;
1886
- this.bidTimes = fields.bidTimes;
1887
- this.bidRound = fields.bidRound;
1888
- this.bidTsMs = fields.bidTsMs;
1889
- }
1890
- Strategy.reified = function () {
1891
- var _this = this;
1892
- return {
1893
- typeName: Strategy.$typeName,
1894
- fullTypeName: util_1.composeSuiType.apply(void 0, __spreadArray([Strategy.$typeName], [], false)),
1895
- typeArgs: [],
1896
- isPhantom: Strategy.$isPhantom,
1897
- reifiedTypeArgs: [],
1898
- fromFields: function (fields) { return Strategy.fromFields(fields); },
1899
- fromFieldsWithTypes: function (item) { return Strategy.fromFieldsWithTypes(item); },
1900
- fromBcs: function (data) { return Strategy.fromBcs(data); },
1901
- bcs: Strategy.bcs,
1902
- fromJSONField: function (field) { return Strategy.fromJSONField(field); },
1903
- fromJSON: function (json) { return Strategy.fromJSON(json); },
1904
- fromSuiParsedData: function (content) { return Strategy.fromSuiParsedData(content); },
1905
- fromSuiObjectData: function (content) { return Strategy.fromSuiObjectData(content); },
1906
- fetch: function (client, id) { return __awaiter(_this, void 0, void 0, function () { return __generator(this, function (_a) {
1907
- return [2 /*return*/, Strategy.fetch(client, id)];
1908
- }); }); },
1909
- new: function (fields) {
1910
- return new Strategy([], fields);
1911
- },
1912
- kind: "StructClassReified",
1913
- };
1914
- };
1915
- Object.defineProperty(Strategy, "r", {
1916
- get: function () {
1917
- return Strategy.reified();
1918
- },
1919
- enumerable: false,
1920
- configurable: true
1921
- });
1922
- Strategy.phantom = function () {
1923
- return (0, reified_1.phantom)(Strategy.reified());
1924
- };
1925
- Object.defineProperty(Strategy, "p", {
1926
- get: function () {
1927
- return Strategy.phantom();
1928
- },
1929
- enumerable: false,
1930
- configurable: true
1931
- });
1932
- Object.defineProperty(Strategy, "bcs", {
1933
- get: function () {
1934
- return bcs_1.bcs.struct("Strategy", {
1935
- id: structs_1.UID.bcs,
1936
- vault_index: bcs_1.bcs.u64(),
1937
- signal_index: bcs_1.bcs.u64(),
1938
- user: bcs_1.bcs.bytes(32).transform({ input: function (val) { return (0, utils_1.fromHEX)(val); }, output: function (val) { return (0, utils_1.toHEX)(val); } }),
1939
- price_percentage: bcs_1.bcs.u64(),
1940
- size: bcs_1.bcs.u64(),
1941
- max_times: bcs_1.bcs.u64(),
1942
- target_rounds: bcs_1.bcs.vector(bcs_1.bcs.u64()),
1943
- receipts: bcs_1.bcs.vector(structs_4.TypusBidReceipt.bcs),
1944
- active: bcs_1.bcs.bool(),
1945
- u64_padding: bcs_1.bcs.vector(bcs_1.bcs.u64()),
1946
- bid_times: bcs_1.bcs.u64(),
1947
- bid_round: bcs_1.bcs.u64(),
1948
- bid_ts_ms: bcs_1.bcs.u64(),
1949
- });
1950
- },
1951
- enumerable: false,
1952
- configurable: true
1953
- });
1954
- Strategy.fromFields = function (fields) {
1955
- return Strategy.reified().new({
1956
- id: (0, reified_1.decodeFromFields)(structs_1.UID.reified(), fields.id),
1957
- vaultIndex: (0, reified_1.decodeFromFields)("u64", fields.vault_index),
1958
- signalIndex: (0, reified_1.decodeFromFields)("u64", fields.signal_index),
1959
- user: (0, reified_1.decodeFromFields)("address", fields.user),
1960
- pricePercentage: (0, reified_1.decodeFromFields)("u64", fields.price_percentage),
1961
- size: (0, reified_1.decodeFromFields)("u64", fields.size),
1962
- maxTimes: (0, reified_1.decodeFromFields)("u64", fields.max_times),
1963
- targetRounds: (0, reified_1.decodeFromFields)(reified.vector("u64"), fields.target_rounds),
1964
- receipts: (0, reified_1.decodeFromFields)(reified.vector(structs_4.TypusBidReceipt.reified()), fields.receipts),
1965
- active: (0, reified_1.decodeFromFields)("bool", fields.active),
1966
- u64Padding: (0, reified_1.decodeFromFields)(reified.vector("u64"), fields.u64_padding),
1967
- bidTimes: (0, reified_1.decodeFromFields)("u64", fields.bid_times),
1968
- bidRound: (0, reified_1.decodeFromFields)("u64", fields.bid_round),
1969
- bidTsMs: (0, reified_1.decodeFromFields)("u64", fields.bid_ts_ms),
1970
- });
1971
- };
1972
- Strategy.fromFieldsWithTypes = function (item) {
1973
- if (!isStrategy(item.type)) {
1974
- throw new Error("not a Strategy type");
1975
- }
1976
- return Strategy.reified().new({
1977
- id: (0, reified_1.decodeFromFieldsWithTypes)(structs_1.UID.reified(), item.fields.id),
1978
- vaultIndex: (0, reified_1.decodeFromFieldsWithTypes)("u64", item.fields.vault_index),
1979
- signalIndex: (0, reified_1.decodeFromFieldsWithTypes)("u64", item.fields.signal_index),
1980
- user: (0, reified_1.decodeFromFieldsWithTypes)("address", item.fields.user),
1981
- pricePercentage: (0, reified_1.decodeFromFieldsWithTypes)("u64", item.fields.price_percentage),
1982
- size: (0, reified_1.decodeFromFieldsWithTypes)("u64", item.fields.size),
1983
- maxTimes: (0, reified_1.decodeFromFieldsWithTypes)("u64", item.fields.max_times),
1984
- targetRounds: (0, reified_1.decodeFromFieldsWithTypes)(reified.vector("u64"), item.fields.target_rounds),
1985
- receipts: (0, reified_1.decodeFromFieldsWithTypes)(reified.vector(structs_4.TypusBidReceipt.reified()), item.fields.receipts),
1986
- active: (0, reified_1.decodeFromFieldsWithTypes)("bool", item.fields.active),
1987
- u64Padding: (0, reified_1.decodeFromFieldsWithTypes)(reified.vector("u64"), item.fields.u64_padding),
1988
- bidTimes: (0, reified_1.decodeFromFieldsWithTypes)("u64", item.fields.bid_times),
1989
- bidRound: (0, reified_1.decodeFromFieldsWithTypes)("u64", item.fields.bid_round),
1990
- bidTsMs: (0, reified_1.decodeFromFieldsWithTypes)("u64", item.fields.bid_ts_ms),
1991
- });
1992
- };
1993
- Strategy.fromBcs = function (data) {
1994
- return Strategy.fromFields(Strategy.bcs.parse(data));
1995
- };
1996
- Strategy.prototype.toJSONField = function () {
1997
- return {
1998
- id: this.id,
1999
- vaultIndex: this.vaultIndex.toString(),
2000
- signalIndex: this.signalIndex.toString(),
2001
- user: this.user,
2002
- pricePercentage: this.pricePercentage.toString(),
2003
- size: this.size.toString(),
2004
- maxTimes: this.maxTimes.toString(),
2005
- targetRounds: (0, reified_1.fieldToJSON)("vector<u64>", this.targetRounds),
2006
- receipts: (0, reified_1.fieldToJSON)("vector<".concat(structs_4.TypusBidReceipt.$typeName, ">"), this.receipts),
2007
- active: this.active,
2008
- u64Padding: (0, reified_1.fieldToJSON)("vector<u64>", this.u64Padding),
2009
- bidTimes: this.bidTimes.toString(),
2010
- bidRound: this.bidRound.toString(),
2011
- bidTsMs: this.bidTsMs.toString(),
2012
- };
2013
- };
2014
- Strategy.prototype.toJSON = function () {
2015
- return __assign({ $typeName: this.$typeName, $typeArgs: this.$typeArgs }, this.toJSONField());
2016
- };
2017
- Strategy.fromJSONField = function (field) {
2018
- return Strategy.reified().new({
2019
- id: (0, reified_1.decodeFromJSONField)(structs_1.UID.reified(), field.id),
2020
- vaultIndex: (0, reified_1.decodeFromJSONField)("u64", field.vaultIndex),
2021
- signalIndex: (0, reified_1.decodeFromJSONField)("u64", field.signalIndex),
2022
- user: (0, reified_1.decodeFromJSONField)("address", field.user),
2023
- pricePercentage: (0, reified_1.decodeFromJSONField)("u64", field.pricePercentage),
2024
- size: (0, reified_1.decodeFromJSONField)("u64", field.size),
2025
- maxTimes: (0, reified_1.decodeFromJSONField)("u64", field.maxTimes),
2026
- targetRounds: (0, reified_1.decodeFromJSONField)(reified.vector("u64"), field.targetRounds),
2027
- receipts: (0, reified_1.decodeFromJSONField)(reified.vector(structs_4.TypusBidReceipt.reified()), field.receipts),
2028
- active: (0, reified_1.decodeFromJSONField)("bool", field.active),
2029
- u64Padding: (0, reified_1.decodeFromJSONField)(reified.vector("u64"), field.u64Padding),
2030
- bidTimes: (0, reified_1.decodeFromJSONField)("u64", field.bidTimes),
2031
- bidRound: (0, reified_1.decodeFromJSONField)("u64", field.bidRound),
2032
- bidTsMs: (0, reified_1.decodeFromJSONField)("u64", field.bidTsMs),
2033
- });
2034
- };
2035
- Strategy.fromJSON = function (json) {
2036
- if (json.$typeName !== Strategy.$typeName) {
2037
- throw new Error("not a WithTwoGenerics json object");
2038
- }
2039
- return Strategy.fromJSONField(json);
2040
- };
2041
- Strategy.fromSuiParsedData = function (content) {
2042
- if (content.dataType !== "moveObject") {
2043
- throw new Error("not an object");
2044
- }
2045
- if (!isStrategy(content.type)) {
2046
- throw new Error("object at ".concat(content.fields.id, " is not a Strategy object"));
2047
- }
2048
- return Strategy.fromFieldsWithTypes(content);
2049
- };
2050
- Strategy.fromSuiObjectData = function (data) {
2051
- if (data.bcs) {
2052
- if (data.bcs.dataType !== "moveObject" || !isStrategy(data.bcs.type)) {
2053
- throw new Error("object at is not a Strategy object");
2054
- }
2055
- return Strategy.fromBcs((0, utils_1.fromB64)(data.bcs.bcsBytes));
2056
- }
2057
- if (data.content) {
2058
- return Strategy.fromSuiParsedData(data.content);
2059
- }
2060
- throw new Error("Both `bcs` and `content` fields are missing from the data. Include `showBcs` or `showContent` in the request.");
2061
- };
2062
- Strategy.fetch = function (client, id) {
2063
- return __awaiter(this, void 0, void 0, function () {
2064
- var res;
2065
- var _a, _b;
2066
- return __generator(this, function (_c) {
2067
- switch (_c.label) {
2068
- case 0: return [4 /*yield*/, client.getObject({ id: id, options: { showBcs: true } })];
2069
- case 1:
2070
- res = _c.sent();
2071
- if (res.error) {
2072
- throw new Error("error fetching Strategy object at id ".concat(id, ": ").concat(res.error.code));
2073
- }
2074
- if (((_b = (_a = res.data) === null || _a === void 0 ? void 0 : _a.bcs) === null || _b === void 0 ? void 0 : _b.dataType) !== "moveObject" || !isStrategy(res.data.bcs.type)) {
2075
- throw new Error("object at id ".concat(id, " is not a Strategy object"));
2076
- }
2077
- return [2 /*return*/, Strategy.fromSuiObjectData(res.data)];
2078
- }
2079
- });
2080
- });
2081
- };
2082
- Strategy.$typeName = "".concat(index_1.PKG_V1, "::auto_bid::Strategy");
2083
- Strategy.$numTypeParams = 0;
2084
- Strategy.$isPhantom = [];
2085
- return Strategy;
2086
- }());
2087
- exports.Strategy = Strategy;
2088
- /* ============================== StrategyPool =============================== */
2089
- function isStrategyPool(type) {
2090
- type = (0, util_1.compressSuiType)(type);
2091
- return type === "".concat(index_1.PKG_V1, "::auto_bid::StrategyPool");
2092
- }
2093
- var StrategyPool = /** @class */ (function () {
2094
- function StrategyPool(typeArgs, fields) {
2095
- this.__StructClass = true;
2096
- this.$typeName = StrategyPool.$typeName;
2097
- this.$isPhantom = StrategyPool.$isPhantom;
2098
- this.$fullTypeName = util_1.composeSuiType.apply(void 0, __spreadArray([StrategyPool.$typeName], __read(typeArgs), false));
2099
- this.$typeArgs = typeArgs;
2100
- this.id = fields.id;
2101
- this.strategies = fields.strategies;
2102
- this.authority = fields.authority;
2103
- }
2104
- StrategyPool.reified = function () {
2105
- var _this = this;
2106
- return {
2107
- typeName: StrategyPool.$typeName,
2108
- fullTypeName: util_1.composeSuiType.apply(void 0, __spreadArray([StrategyPool.$typeName], [], false)),
2109
- typeArgs: [],
2110
- isPhantom: StrategyPool.$isPhantom,
2111
- reifiedTypeArgs: [],
2112
- fromFields: function (fields) { return StrategyPool.fromFields(fields); },
2113
- fromFieldsWithTypes: function (item) { return StrategyPool.fromFieldsWithTypes(item); },
2114
- fromBcs: function (data) { return StrategyPool.fromBcs(data); },
2115
- bcs: StrategyPool.bcs,
2116
- fromJSONField: function (field) { return StrategyPool.fromJSONField(field); },
2117
- fromJSON: function (json) { return StrategyPool.fromJSON(json); },
2118
- fromSuiParsedData: function (content) { return StrategyPool.fromSuiParsedData(content); },
2119
- fromSuiObjectData: function (content) { return StrategyPool.fromSuiObjectData(content); },
2120
- fetch: function (client, id) { return __awaiter(_this, void 0, void 0, function () { return __generator(this, function (_a) {
2121
- return [2 /*return*/, StrategyPool.fetch(client, id)];
2122
- }); }); },
2123
- new: function (fields) {
2124
- return new StrategyPool([], fields);
2125
- },
2126
- kind: "StructClassReified",
2127
- };
2128
- };
2129
- Object.defineProperty(StrategyPool, "r", {
2130
- get: function () {
2131
- return StrategyPool.reified();
2132
- },
2133
- enumerable: false,
2134
- configurable: true
2135
- });
2136
- StrategyPool.phantom = function () {
2137
- return (0, reified_1.phantom)(StrategyPool.reified());
2138
- };
2139
- Object.defineProperty(StrategyPool, "p", {
2140
- get: function () {
2141
- return StrategyPool.phantom();
2142
- },
2143
- enumerable: false,
2144
- configurable: true
2145
- });
2146
- Object.defineProperty(StrategyPool, "bcs", {
2147
- get: function () {
2148
- return bcs_1.bcs.struct("StrategyPool", {
2149
- id: structs_1.UID.bcs,
2150
- strategies: structs_3.VecMap.bcs(bcs_1.bcs.u64(), structs_3.VecMap.bcs(bcs_1.bcs.u64(), structs_2.TableVec.bcs)),
2151
- authority: bcs_1.bcs.vector(bcs_1.bcs.bytes(32).transform({ input: function (val) { return (0, utils_1.fromHEX)(val); }, output: function (val) { return (0, utils_1.toHEX)(val); } })),
2152
- });
2153
- },
2154
- enumerable: false,
2155
- configurable: true
2156
- });
2157
- StrategyPool.fromFields = function (fields) {
2158
- return StrategyPool.reified().new({
2159
- id: (0, reified_1.decodeFromFields)(structs_1.UID.reified(), fields.id),
2160
- strategies: (0, reified_1.decodeFromFields)(structs_3.VecMap.reified("u64", structs_3.VecMap.reified("u64", structs_2.TableVec.reified(reified.phantom(Strategy.reified())))), fields.strategies),
2161
- authority: (0, reified_1.decodeFromFields)(reified.vector("address"), fields.authority),
2162
- });
2163
- };
2164
- StrategyPool.fromFieldsWithTypes = function (item) {
2165
- if (!isStrategyPool(item.type)) {
2166
- throw new Error("not a StrategyPool type");
2167
- }
2168
- return StrategyPool.reified().new({
2169
- id: (0, reified_1.decodeFromFieldsWithTypes)(structs_1.UID.reified(), item.fields.id),
2170
- strategies: (0, reified_1.decodeFromFieldsWithTypes)(structs_3.VecMap.reified("u64", structs_3.VecMap.reified("u64", structs_2.TableVec.reified(reified.phantom(Strategy.reified())))), item.fields.strategies),
2171
- authority: (0, reified_1.decodeFromFieldsWithTypes)(reified.vector("address"), item.fields.authority),
2172
- });
2173
- };
2174
- StrategyPool.fromBcs = function (data) {
2175
- return StrategyPool.fromFields(StrategyPool.bcs.parse(data));
2176
- };
2177
- StrategyPool.prototype.toJSONField = function () {
2178
- return {
2179
- id: this.id,
2180
- strategies: this.strategies.toJSONField(),
2181
- authority: (0, reified_1.fieldToJSON)("vector<address>", this.authority),
2182
- };
2183
- };
2184
- StrategyPool.prototype.toJSON = function () {
2185
- return __assign({ $typeName: this.$typeName, $typeArgs: this.$typeArgs }, this.toJSONField());
2186
- };
2187
- StrategyPool.fromJSONField = function (field) {
2188
- return StrategyPool.reified().new({
2189
- id: (0, reified_1.decodeFromJSONField)(structs_1.UID.reified(), field.id),
2190
- strategies: (0, reified_1.decodeFromJSONField)(structs_3.VecMap.reified("u64", structs_3.VecMap.reified("u64", structs_2.TableVec.reified(reified.phantom(Strategy.reified())))), field.strategies),
2191
- authority: (0, reified_1.decodeFromJSONField)(reified.vector("address"), field.authority),
2192
- });
2193
- };
2194
- StrategyPool.fromJSON = function (json) {
2195
- if (json.$typeName !== StrategyPool.$typeName) {
2196
- throw new Error("not a WithTwoGenerics json object");
2197
- }
2198
- return StrategyPool.fromJSONField(json);
2199
- };
2200
- StrategyPool.fromSuiParsedData = function (content) {
2201
- if (content.dataType !== "moveObject") {
2202
- throw new Error("not an object");
2203
- }
2204
- if (!isStrategyPool(content.type)) {
2205
- throw new Error("object at ".concat(content.fields.id, " is not a StrategyPool object"));
2206
- }
2207
- return StrategyPool.fromFieldsWithTypes(content);
2208
- };
2209
- StrategyPool.fromSuiObjectData = function (data) {
2210
- if (data.bcs) {
2211
- if (data.bcs.dataType !== "moveObject" || !isStrategyPool(data.bcs.type)) {
2212
- throw new Error("object at is not a StrategyPool object");
2213
- }
2214
- return StrategyPool.fromBcs((0, utils_1.fromB64)(data.bcs.bcsBytes));
2215
- }
2216
- if (data.content) {
2217
- return StrategyPool.fromSuiParsedData(data.content);
2218
- }
2219
- throw new Error("Both `bcs` and `content` fields are missing from the data. Include `showBcs` or `showContent` in the request.");
2220
- };
2221
- StrategyPool.fetch = function (client, id) {
2222
- return __awaiter(this, void 0, void 0, function () {
2223
- var res;
2224
- var _a, _b;
2225
- return __generator(this, function (_c) {
2226
- switch (_c.label) {
2227
- case 0: return [4 /*yield*/, client.getObject({ id: id, options: { showBcs: true } })];
2228
- case 1:
2229
- res = _c.sent();
2230
- if (res.error) {
2231
- throw new Error("error fetching StrategyPool object at id ".concat(id, ": ").concat(res.error.code));
2232
- }
2233
- if (((_b = (_a = res.data) === null || _a === void 0 ? void 0 : _a.bcs) === null || _b === void 0 ? void 0 : _b.dataType) !== "moveObject" || !isStrategyPool(res.data.bcs.type)) {
2234
- throw new Error("object at id ".concat(id, " is not a StrategyPool object"));
2235
- }
2236
- return [2 /*return*/, StrategyPool.fromSuiObjectData(res.data)];
2237
- }
2238
- });
2239
- });
2240
- };
2241
- StrategyPool.$typeName = "".concat(index_1.PKG_V1, "::auto_bid::StrategyPool");
2242
- StrategyPool.$numTypeParams = 0;
2243
- StrategyPool.$isPhantom = [];
2244
- return StrategyPool;
2245
- }());
2246
- exports.StrategyPool = StrategyPool;
2247
- /* ============================== StrategyPoolV2 =============================== */
2248
- function isStrategyPoolV2(type) {
2249
- type = (0, util_1.compressSuiType)(type);
2250
- return type === "".concat(index_1.PKG_V1, "::auto_bid::StrategyPoolV2");
2251
- }
2252
- var StrategyPoolV2 = /** @class */ (function () {
2253
- function StrategyPoolV2(typeArgs, fields) {
2254
- this.__StructClass = true;
2255
- this.$typeName = StrategyPoolV2.$typeName;
2256
- this.$isPhantom = StrategyPoolV2.$isPhantom;
2257
- this.$fullTypeName = util_1.composeSuiType.apply(void 0, __spreadArray([StrategyPoolV2.$typeName], __read(typeArgs), false));
2258
- this.$typeArgs = typeArgs;
2259
- this.id = fields.id;
2260
- this.strategies = fields.strategies;
2261
- this.authority = fields.authority;
2262
- }
2263
- StrategyPoolV2.reified = function () {
2264
- var _this = this;
2265
- return {
2266
- typeName: StrategyPoolV2.$typeName,
2267
- fullTypeName: util_1.composeSuiType.apply(void 0, __spreadArray([StrategyPoolV2.$typeName], [], false)),
2268
- typeArgs: [],
2269
- isPhantom: StrategyPoolV2.$isPhantom,
2270
- reifiedTypeArgs: [],
2271
- fromFields: function (fields) { return StrategyPoolV2.fromFields(fields); },
2272
- fromFieldsWithTypes: function (item) { return StrategyPoolV2.fromFieldsWithTypes(item); },
2273
- fromBcs: function (data) { return StrategyPoolV2.fromBcs(data); },
2274
- bcs: StrategyPoolV2.bcs,
2275
- fromJSONField: function (field) { return StrategyPoolV2.fromJSONField(field); },
2276
- fromJSON: function (json) { return StrategyPoolV2.fromJSON(json); },
2277
- fromSuiParsedData: function (content) { return StrategyPoolV2.fromSuiParsedData(content); },
2278
- fromSuiObjectData: function (content) { return StrategyPoolV2.fromSuiObjectData(content); },
2279
- fetch: function (client, id) { return __awaiter(_this, void 0, void 0, function () { return __generator(this, function (_a) {
2280
- return [2 /*return*/, StrategyPoolV2.fetch(client, id)];
2281
- }); }); },
2282
- new: function (fields) {
2283
- return new StrategyPoolV2([], fields);
2284
- },
2285
- kind: "StructClassReified",
2286
- };
2287
- };
2288
- Object.defineProperty(StrategyPoolV2, "r", {
2289
- get: function () {
2290
- return StrategyPoolV2.reified();
2291
- },
2292
- enumerable: false,
2293
- configurable: true
2294
- });
2295
- StrategyPoolV2.phantom = function () {
2296
- return (0, reified_1.phantom)(StrategyPoolV2.reified());
2297
- };
2298
- Object.defineProperty(StrategyPoolV2, "p", {
2299
- get: function () {
2300
- return StrategyPoolV2.phantom();
2301
- },
2302
- enumerable: false,
2303
- configurable: true
2304
- });
2305
- Object.defineProperty(StrategyPoolV2, "bcs", {
2306
- get: function () {
2307
- return bcs_1.bcs.struct("StrategyPoolV2", {
2308
- id: structs_1.UID.bcs,
2309
- strategies: structs_3.VecMap.bcs(bcs_1.bcs.u64(), structs_3.VecMap.bcs(bcs_1.bcs.u64(), structs_2.TableVec.bcs)),
2310
- authority: bcs_1.bcs.vector(bcs_1.bcs.bytes(32).transform({ input: function (val) { return (0, utils_1.fromHEX)(val); }, output: function (val) { return (0, utils_1.toHEX)(val); } })),
2311
- });
2312
- },
2313
- enumerable: false,
2314
- configurable: true
2315
- });
2316
- StrategyPoolV2.fromFields = function (fields) {
2317
- return StrategyPoolV2.reified().new({
2318
- id: (0, reified_1.decodeFromFields)(structs_1.UID.reified(), fields.id),
2319
- strategies: (0, reified_1.decodeFromFields)(structs_3.VecMap.reified("u64", structs_3.VecMap.reified("u64", structs_2.TableVec.reified(reified.phantom(StrategyV2.reified())))), fields.strategies),
2320
- authority: (0, reified_1.decodeFromFields)(reified.vector("address"), fields.authority),
2321
- });
2322
- };
2323
- StrategyPoolV2.fromFieldsWithTypes = function (item) {
2324
- if (!isStrategyPoolV2(item.type)) {
2325
- throw new Error("not a StrategyPoolV2 type");
2326
- }
2327
- return StrategyPoolV2.reified().new({
2328
- id: (0, reified_1.decodeFromFieldsWithTypes)(structs_1.UID.reified(), item.fields.id),
2329
- strategies: (0, reified_1.decodeFromFieldsWithTypes)(structs_3.VecMap.reified("u64", structs_3.VecMap.reified("u64", structs_2.TableVec.reified(reified.phantom(StrategyV2.reified())))), item.fields.strategies),
2330
- authority: (0, reified_1.decodeFromFieldsWithTypes)(reified.vector("address"), item.fields.authority),
2331
- });
2332
- };
2333
- StrategyPoolV2.fromBcs = function (data) {
2334
- return StrategyPoolV2.fromFields(StrategyPoolV2.bcs.parse(data));
2335
- };
2336
- StrategyPoolV2.prototype.toJSONField = function () {
2337
- return {
2338
- id: this.id,
2339
- strategies: this.strategies.toJSONField(),
2340
- authority: (0, reified_1.fieldToJSON)("vector<address>", this.authority),
2341
- };
2342
- };
2343
- StrategyPoolV2.prototype.toJSON = function () {
2344
- return __assign({ $typeName: this.$typeName, $typeArgs: this.$typeArgs }, this.toJSONField());
2345
- };
2346
- StrategyPoolV2.fromJSONField = function (field) {
2347
- return StrategyPoolV2.reified().new({
2348
- id: (0, reified_1.decodeFromJSONField)(structs_1.UID.reified(), field.id),
2349
- strategies: (0, reified_1.decodeFromJSONField)(structs_3.VecMap.reified("u64", structs_3.VecMap.reified("u64", structs_2.TableVec.reified(reified.phantom(StrategyV2.reified())))), field.strategies),
2350
- authority: (0, reified_1.decodeFromJSONField)(reified.vector("address"), field.authority),
2351
- });
2352
- };
2353
- StrategyPoolV2.fromJSON = function (json) {
2354
- if (json.$typeName !== StrategyPoolV2.$typeName) {
2355
- throw new Error("not a WithTwoGenerics json object");
2356
- }
2357
- return StrategyPoolV2.fromJSONField(json);
2358
- };
2359
- StrategyPoolV2.fromSuiParsedData = function (content) {
2360
- if (content.dataType !== "moveObject") {
2361
- throw new Error("not an object");
2362
- }
2363
- if (!isStrategyPoolV2(content.type)) {
2364
- throw new Error("object at ".concat(content.fields.id, " is not a StrategyPoolV2 object"));
2365
- }
2366
- return StrategyPoolV2.fromFieldsWithTypes(content);
2367
- };
2368
- StrategyPoolV2.fromSuiObjectData = function (data) {
2369
- if (data.bcs) {
2370
- if (data.bcs.dataType !== "moveObject" || !isStrategyPoolV2(data.bcs.type)) {
2371
- throw new Error("object at is not a StrategyPoolV2 object");
2372
- }
2373
- return StrategyPoolV2.fromBcs((0, utils_1.fromB64)(data.bcs.bcsBytes));
2374
- }
2375
- if (data.content) {
2376
- return StrategyPoolV2.fromSuiParsedData(data.content);
2377
- }
2378
- throw new Error("Both `bcs` and `content` fields are missing from the data. Include `showBcs` or `showContent` in the request.");
2379
- };
2380
- StrategyPoolV2.fetch = function (client, id) {
2381
- return __awaiter(this, void 0, void 0, function () {
2382
- var res;
2383
- var _a, _b;
2384
- return __generator(this, function (_c) {
2385
- switch (_c.label) {
2386
- case 0: return [4 /*yield*/, client.getObject({ id: id, options: { showBcs: true } })];
2387
- case 1:
2388
- res = _c.sent();
2389
- if (res.error) {
2390
- throw new Error("error fetching StrategyPoolV2 object at id ".concat(id, ": ").concat(res.error.code));
2391
- }
2392
- if (((_b = (_a = res.data) === null || _a === void 0 ? void 0 : _a.bcs) === null || _b === void 0 ? void 0 : _b.dataType) !== "moveObject" || !isStrategyPoolV2(res.data.bcs.type)) {
2393
- throw new Error("object at id ".concat(id, " is not a StrategyPoolV2 object"));
2394
- }
2395
- return [2 /*return*/, StrategyPoolV2.fromSuiObjectData(res.data)];
2396
- }
2397
- });
2398
- });
2399
- };
2400
- StrategyPoolV2.$typeName = "".concat(index_1.PKG_V1, "::auto_bid::StrategyPoolV2");
2401
- StrategyPoolV2.$numTypeParams = 0;
2402
- StrategyPoolV2.$isPhantom = [];
2403
- return StrategyPoolV2;
2404
- }());
2405
- exports.StrategyPoolV2 = StrategyPoolV2;
2406
- /* ============================== StrategyV2 =============================== */
2407
- function isStrategyV2(type) {
2408
- type = (0, util_1.compressSuiType)(type);
2409
- return type === "".concat(index_1.PKG_V1, "::auto_bid::StrategyV2");
2410
- }
2411
- var StrategyV2 = /** @class */ (function () {
2412
- function StrategyV2(typeArgs, fields) {
2413
- this.__StructClass = true;
2414
- this.$typeName = StrategyV2.$typeName;
2415
- this.$isPhantom = StrategyV2.$isPhantom;
2416
- this.$fullTypeName = util_1.composeSuiType.apply(void 0, __spreadArray([StrategyV2.$typeName], __read(typeArgs), false));
2417
- this.$typeArgs = typeArgs;
2418
- this.id = fields.id;
2419
- this.vaultIndex = fields.vaultIndex;
2420
- this.signalIndex = fields.signalIndex;
2421
- this.user = fields.user;
2422
- this.pricePercentage = fields.pricePercentage;
2423
- this.size = fields.size;
2424
- this.maxTimes = fields.maxTimes;
2425
- this.targetRounds = fields.targetRounds;
2426
- this.receipts = fields.receipts;
2427
- this.active = fields.active;
2428
- this.u64Padding = fields.u64Padding;
2429
- this.bidTimes = fields.bidTimes;
2430
- this.bidRound = fields.bidRound;
2431
- this.bidTsMs = fields.bidTsMs;
2432
- this.bidRounds = fields.bidRounds;
2433
- this.accumulatedProfit = fields.accumulatedProfit;
2434
- }
2435
- StrategyV2.reified = function () {
2436
- var _this = this;
2437
- return {
2438
- typeName: StrategyV2.$typeName,
2439
- fullTypeName: util_1.composeSuiType.apply(void 0, __spreadArray([StrategyV2.$typeName], [], false)),
2440
- typeArgs: [],
2441
- isPhantom: StrategyV2.$isPhantom,
2442
- reifiedTypeArgs: [],
2443
- fromFields: function (fields) { return StrategyV2.fromFields(fields); },
2444
- fromFieldsWithTypes: function (item) { return StrategyV2.fromFieldsWithTypes(item); },
2445
- fromBcs: function (data) { return StrategyV2.fromBcs(data); },
2446
- bcs: StrategyV2.bcs,
2447
- fromJSONField: function (field) { return StrategyV2.fromJSONField(field); },
2448
- fromJSON: function (json) { return StrategyV2.fromJSON(json); },
2449
- fromSuiParsedData: function (content) { return StrategyV2.fromSuiParsedData(content); },
2450
- fromSuiObjectData: function (content) { return StrategyV2.fromSuiObjectData(content); },
2451
- fetch: function (client, id) { return __awaiter(_this, void 0, void 0, function () { return __generator(this, function (_a) {
2452
- return [2 /*return*/, StrategyV2.fetch(client, id)];
2453
- }); }); },
2454
- new: function (fields) {
2455
- return new StrategyV2([], fields);
2456
- },
2457
- kind: "StructClassReified",
2458
- };
2459
- };
2460
- Object.defineProperty(StrategyV2, "r", {
2461
- get: function () {
2462
- return StrategyV2.reified();
2463
- },
2464
- enumerable: false,
2465
- configurable: true
2466
- });
2467
- StrategyV2.phantom = function () {
2468
- return (0, reified_1.phantom)(StrategyV2.reified());
2469
- };
2470
- Object.defineProperty(StrategyV2, "p", {
2471
- get: function () {
2472
- return StrategyV2.phantom();
2473
- },
2474
- enumerable: false,
2475
- configurable: true
2476
- });
2477
- Object.defineProperty(StrategyV2, "bcs", {
2478
- get: function () {
2479
- return bcs_1.bcs.struct("StrategyV2", {
2480
- id: structs_1.UID.bcs,
2481
- vault_index: bcs_1.bcs.u64(),
2482
- signal_index: bcs_1.bcs.u64(),
2483
- user: bcs_1.bcs.bytes(32).transform({ input: function (val) { return (0, utils_1.fromHEX)(val); }, output: function (val) { return (0, utils_1.toHEX)(val); } }),
2484
- price_percentage: bcs_1.bcs.u64(),
2485
- size: bcs_1.bcs.u64(),
2486
- max_times: bcs_1.bcs.u64(),
2487
- target_rounds: bcs_1.bcs.vector(bcs_1.bcs.u64()),
2488
- receipts: bcs_1.bcs.vector(structs_4.TypusBidReceipt.bcs),
2489
- active: bcs_1.bcs.bool(),
2490
- u64_padding: bcs_1.bcs.vector(bcs_1.bcs.u64()),
2491
- bid_times: bcs_1.bcs.u64(),
2492
- bid_round: bcs_1.bcs.u64(),
2493
- bid_ts_ms: bcs_1.bcs.u64(),
2494
- bid_rounds: bcs_1.bcs.vector(bcs_1.bcs.u64()),
2495
- accumulated_profit: bcs_1.bcs.u64(),
2496
- });
2497
- },
2498
- enumerable: false,
2499
- configurable: true
2500
- });
2501
- StrategyV2.fromFields = function (fields) {
2502
- return StrategyV2.reified().new({
2503
- id: (0, reified_1.decodeFromFields)(structs_1.UID.reified(), fields.id),
2504
- vaultIndex: (0, reified_1.decodeFromFields)("u64", fields.vault_index),
2505
- signalIndex: (0, reified_1.decodeFromFields)("u64", fields.signal_index),
2506
- user: (0, reified_1.decodeFromFields)("address", fields.user),
2507
- pricePercentage: (0, reified_1.decodeFromFields)("u64", fields.price_percentage),
2508
- size: (0, reified_1.decodeFromFields)("u64", fields.size),
2509
- maxTimes: (0, reified_1.decodeFromFields)("u64", fields.max_times),
2510
- targetRounds: (0, reified_1.decodeFromFields)(reified.vector("u64"), fields.target_rounds),
2511
- receipts: (0, reified_1.decodeFromFields)(reified.vector(structs_4.TypusBidReceipt.reified()), fields.receipts),
2512
- active: (0, reified_1.decodeFromFields)("bool", fields.active),
2513
- u64Padding: (0, reified_1.decodeFromFields)(reified.vector("u64"), fields.u64_padding),
2514
- bidTimes: (0, reified_1.decodeFromFields)("u64", fields.bid_times),
2515
- bidRound: (0, reified_1.decodeFromFields)("u64", fields.bid_round),
2516
- bidTsMs: (0, reified_1.decodeFromFields)("u64", fields.bid_ts_ms),
2517
- bidRounds: (0, reified_1.decodeFromFields)(reified.vector("u64"), fields.bid_rounds),
2518
- accumulatedProfit: (0, reified_1.decodeFromFields)("u64", fields.accumulated_profit),
2519
- });
2520
- };
2521
- StrategyV2.fromFieldsWithTypes = function (item) {
2522
- if (!isStrategyV2(item.type)) {
2523
- throw new Error("not a StrategyV2 type");
2524
- }
2525
- return StrategyV2.reified().new({
2526
- id: (0, reified_1.decodeFromFieldsWithTypes)(structs_1.UID.reified(), item.fields.id),
2527
- vaultIndex: (0, reified_1.decodeFromFieldsWithTypes)("u64", item.fields.vault_index),
2528
- signalIndex: (0, reified_1.decodeFromFieldsWithTypes)("u64", item.fields.signal_index),
2529
- user: (0, reified_1.decodeFromFieldsWithTypes)("address", item.fields.user),
2530
- pricePercentage: (0, reified_1.decodeFromFieldsWithTypes)("u64", item.fields.price_percentage),
2531
- size: (0, reified_1.decodeFromFieldsWithTypes)("u64", item.fields.size),
2532
- maxTimes: (0, reified_1.decodeFromFieldsWithTypes)("u64", item.fields.max_times),
2533
- targetRounds: (0, reified_1.decodeFromFieldsWithTypes)(reified.vector("u64"), item.fields.target_rounds),
2534
- receipts: (0, reified_1.decodeFromFieldsWithTypes)(reified.vector(structs_4.TypusBidReceipt.reified()), item.fields.receipts),
2535
- active: (0, reified_1.decodeFromFieldsWithTypes)("bool", item.fields.active),
2536
- u64Padding: (0, reified_1.decodeFromFieldsWithTypes)(reified.vector("u64"), item.fields.u64_padding),
2537
- bidTimes: (0, reified_1.decodeFromFieldsWithTypes)("u64", item.fields.bid_times),
2538
- bidRound: (0, reified_1.decodeFromFieldsWithTypes)("u64", item.fields.bid_round),
2539
- bidTsMs: (0, reified_1.decodeFromFieldsWithTypes)("u64", item.fields.bid_ts_ms),
2540
- bidRounds: (0, reified_1.decodeFromFieldsWithTypes)(reified.vector("u64"), item.fields.bid_rounds),
2541
- accumulatedProfit: (0, reified_1.decodeFromFieldsWithTypes)("u64", item.fields.accumulated_profit),
2542
- });
2543
- };
2544
- StrategyV2.fromBcs = function (data) {
2545
- return StrategyV2.fromFields(StrategyV2.bcs.parse(data));
2546
- };
2547
- StrategyV2.prototype.toJSONField = function () {
2548
- return {
2549
- id: this.id,
2550
- vaultIndex: this.vaultIndex.toString(),
2551
- signalIndex: this.signalIndex.toString(),
2552
- user: this.user,
2553
- pricePercentage: this.pricePercentage.toString(),
2554
- size: this.size.toString(),
2555
- maxTimes: this.maxTimes.toString(),
2556
- targetRounds: (0, reified_1.fieldToJSON)("vector<u64>", this.targetRounds),
2557
- receipts: (0, reified_1.fieldToJSON)("vector<".concat(structs_4.TypusBidReceipt.$typeName, ">"), this.receipts),
2558
- active: this.active,
2559
- u64Padding: (0, reified_1.fieldToJSON)("vector<u64>", this.u64Padding),
2560
- bidTimes: this.bidTimes.toString(),
2561
- bidRound: this.bidRound.toString(),
2562
- bidTsMs: this.bidTsMs.toString(),
2563
- bidRounds: (0, reified_1.fieldToJSON)("vector<u64>", this.bidRounds),
2564
- accumulatedProfit: this.accumulatedProfit.toString(),
2565
- };
2566
- };
2567
- StrategyV2.prototype.toJSON = function () {
2568
- return __assign({ $typeName: this.$typeName, $typeArgs: this.$typeArgs }, this.toJSONField());
2569
- };
2570
- StrategyV2.fromJSONField = function (field) {
2571
- return StrategyV2.reified().new({
2572
- id: (0, reified_1.decodeFromJSONField)(structs_1.UID.reified(), field.id),
2573
- vaultIndex: (0, reified_1.decodeFromJSONField)("u64", field.vaultIndex),
2574
- signalIndex: (0, reified_1.decodeFromJSONField)("u64", field.signalIndex),
2575
- user: (0, reified_1.decodeFromJSONField)("address", field.user),
2576
- pricePercentage: (0, reified_1.decodeFromJSONField)("u64", field.pricePercentage),
2577
- size: (0, reified_1.decodeFromJSONField)("u64", field.size),
2578
- maxTimes: (0, reified_1.decodeFromJSONField)("u64", field.maxTimes),
2579
- targetRounds: (0, reified_1.decodeFromJSONField)(reified.vector("u64"), field.targetRounds),
2580
- receipts: (0, reified_1.decodeFromJSONField)(reified.vector(structs_4.TypusBidReceipt.reified()), field.receipts),
2581
- active: (0, reified_1.decodeFromJSONField)("bool", field.active),
2582
- u64Padding: (0, reified_1.decodeFromJSONField)(reified.vector("u64"), field.u64Padding),
2583
- bidTimes: (0, reified_1.decodeFromJSONField)("u64", field.bidTimes),
2584
- bidRound: (0, reified_1.decodeFromJSONField)("u64", field.bidRound),
2585
- bidTsMs: (0, reified_1.decodeFromJSONField)("u64", field.bidTsMs),
2586
- bidRounds: (0, reified_1.decodeFromJSONField)(reified.vector("u64"), field.bidRounds),
2587
- accumulatedProfit: (0, reified_1.decodeFromJSONField)("u64", field.accumulatedProfit),
2588
- });
2589
- };
2590
- StrategyV2.fromJSON = function (json) {
2591
- if (json.$typeName !== StrategyV2.$typeName) {
2592
- throw new Error("not a WithTwoGenerics json object");
2593
- }
2594
- return StrategyV2.fromJSONField(json);
2595
- };
2596
- StrategyV2.fromSuiParsedData = function (content) {
2597
- if (content.dataType !== "moveObject") {
2598
- throw new Error("not an object");
2599
- }
2600
- if (!isStrategyV2(content.type)) {
2601
- throw new Error("object at ".concat(content.fields.id, " is not a StrategyV2 object"));
2602
- }
2603
- return StrategyV2.fromFieldsWithTypes(content);
2604
- };
2605
- StrategyV2.fromSuiObjectData = function (data) {
2606
- if (data.bcs) {
2607
- if (data.bcs.dataType !== "moveObject" || !isStrategyV2(data.bcs.type)) {
2608
- throw new Error("object at is not a StrategyV2 object");
2609
- }
2610
- return StrategyV2.fromBcs((0, utils_1.fromB64)(data.bcs.bcsBytes));
2611
- }
2612
- if (data.content) {
2613
- return StrategyV2.fromSuiParsedData(data.content);
2614
- }
2615
- throw new Error("Both `bcs` and `content` fields are missing from the data. Include `showBcs` or `showContent` in the request.");
2616
- };
2617
- StrategyV2.fetch = function (client, id) {
2618
- return __awaiter(this, void 0, void 0, function () {
2619
- var res;
2620
- var _a, _b;
2621
- return __generator(this, function (_c) {
2622
- switch (_c.label) {
2623
- case 0: return [4 /*yield*/, client.getObject({ id: id, options: { showBcs: true } })];
2624
- case 1:
2625
- res = _c.sent();
2626
- if (res.error) {
2627
- throw new Error("error fetching StrategyV2 object at id ".concat(id, ": ").concat(res.error.code));
2628
- }
2629
- if (((_b = (_a = res.data) === null || _a === void 0 ? void 0 : _a.bcs) === null || _b === void 0 ? void 0 : _b.dataType) !== "moveObject" || !isStrategyV2(res.data.bcs.type)) {
2630
- throw new Error("object at id ".concat(id, " is not a StrategyV2 object"));
2631
- }
2632
- return [2 /*return*/, StrategyV2.fromSuiObjectData(res.data)];
2633
- }
2634
- });
2635
- });
2636
- };
2637
- StrategyV2.$typeName = "".concat(index_1.PKG_V1, "::auto_bid::StrategyV2");
2638
- StrategyV2.$numTypeParams = 0;
2639
- StrategyV2.$isPhantom = [];
2640
- return StrategyV2;
2641
- }());
2642
- exports.StrategyV2 = StrategyV2;
2643
- /* ============================== UpdateStrategyEvent =============================== */
2644
- function isUpdateStrategyEvent(type) {
2645
- type = (0, util_1.compressSuiType)(type);
2646
- return type === "".concat(index_1.PKG_V1, "::auto_bid::UpdateStrategyEvent");
2647
- }
2648
- var UpdateStrategyEvent = /** @class */ (function () {
2649
- function UpdateStrategyEvent(typeArgs, fields) {
2650
- this.__StructClass = true;
2651
- this.$typeName = UpdateStrategyEvent.$typeName;
2652
- this.$isPhantom = UpdateStrategyEvent.$isPhantom;
2653
- this.$fullTypeName = util_1.composeSuiType.apply(void 0, __spreadArray([UpdateStrategyEvent.$typeName], __read(typeArgs), false));
2654
- this.$typeArgs = typeArgs;
2655
- this.vaultIndex = fields.vaultIndex;
2656
- this.signalIndex = fields.signalIndex;
2657
- this.strategyIndex = fields.strategyIndex;
2658
- this.user = fields.user;
2659
- this.pricePercentage = fields.pricePercentage;
2660
- this.size = fields.size;
2661
- this.maxTimes = fields.maxTimes;
2662
- this.targetRounds = fields.targetRounds;
2663
- this.depositAmount = fields.depositAmount;
2664
- }
2665
- UpdateStrategyEvent.reified = function () {
2666
- var _this = this;
2667
- return {
2668
- typeName: UpdateStrategyEvent.$typeName,
2669
- fullTypeName: util_1.composeSuiType.apply(void 0, __spreadArray([UpdateStrategyEvent.$typeName], [], false)),
2670
- typeArgs: [],
2671
- isPhantom: UpdateStrategyEvent.$isPhantom,
2672
- reifiedTypeArgs: [],
2673
- fromFields: function (fields) { return UpdateStrategyEvent.fromFields(fields); },
2674
- fromFieldsWithTypes: function (item) { return UpdateStrategyEvent.fromFieldsWithTypes(item); },
2675
- fromBcs: function (data) { return UpdateStrategyEvent.fromBcs(data); },
2676
- bcs: UpdateStrategyEvent.bcs,
2677
- fromJSONField: function (field) { return UpdateStrategyEvent.fromJSONField(field); },
2678
- fromJSON: function (json) { return UpdateStrategyEvent.fromJSON(json); },
2679
- fromSuiParsedData: function (content) { return UpdateStrategyEvent.fromSuiParsedData(content); },
2680
- fromSuiObjectData: function (content) { return UpdateStrategyEvent.fromSuiObjectData(content); },
2681
- fetch: function (client, id) { return __awaiter(_this, void 0, void 0, function () { return __generator(this, function (_a) {
2682
- return [2 /*return*/, UpdateStrategyEvent.fetch(client, id)];
2683
- }); }); },
2684
- new: function (fields) {
2685
- return new UpdateStrategyEvent([], fields);
2686
- },
2687
- kind: "StructClassReified",
2688
- };
2689
- };
2690
- Object.defineProperty(UpdateStrategyEvent, "r", {
2691
- get: function () {
2692
- return UpdateStrategyEvent.reified();
2693
- },
2694
- enumerable: false,
2695
- configurable: true
2696
- });
2697
- UpdateStrategyEvent.phantom = function () {
2698
- return (0, reified_1.phantom)(UpdateStrategyEvent.reified());
2699
- };
2700
- Object.defineProperty(UpdateStrategyEvent, "p", {
2701
- get: function () {
2702
- return UpdateStrategyEvent.phantom();
2703
- },
2704
- enumerable: false,
2705
- configurable: true
2706
- });
2707
- Object.defineProperty(UpdateStrategyEvent, "bcs", {
2708
- get: function () {
2709
- return bcs_1.bcs.struct("UpdateStrategyEvent", {
2710
- vault_index: bcs_1.bcs.u64(),
2711
- signal_index: bcs_1.bcs.u64(),
2712
- strategy_index: bcs_1.bcs.u64(),
2713
- user: bcs_1.bcs.bytes(32).transform({ input: function (val) { return (0, utils_1.fromHEX)(val); }, output: function (val) { return (0, utils_1.toHEX)(val); } }),
2714
- price_percentage: bcs_1.bcs.u64(),
2715
- size: bcs_1.bcs.u64(),
2716
- max_times: bcs_1.bcs.u64(),
2717
- target_rounds: bcs_1.bcs.vector(bcs_1.bcs.u64()),
2718
- deposit_amount: bcs_1.bcs.u64(),
2719
- });
2720
- },
2721
- enumerable: false,
2722
- configurable: true
2723
- });
2724
- UpdateStrategyEvent.fromFields = function (fields) {
2725
- return UpdateStrategyEvent.reified().new({
2726
- vaultIndex: (0, reified_1.decodeFromFields)("u64", fields.vault_index),
2727
- signalIndex: (0, reified_1.decodeFromFields)("u64", fields.signal_index),
2728
- strategyIndex: (0, reified_1.decodeFromFields)("u64", fields.strategy_index),
2729
- user: (0, reified_1.decodeFromFields)("address", fields.user),
2730
- pricePercentage: (0, reified_1.decodeFromFields)("u64", fields.price_percentage),
2731
- size: (0, reified_1.decodeFromFields)("u64", fields.size),
2732
- maxTimes: (0, reified_1.decodeFromFields)("u64", fields.max_times),
2733
- targetRounds: (0, reified_1.decodeFromFields)(reified.vector("u64"), fields.target_rounds),
2734
- depositAmount: (0, reified_1.decodeFromFields)("u64", fields.deposit_amount),
2735
- });
2736
- };
2737
- UpdateStrategyEvent.fromFieldsWithTypes = function (item) {
2738
- if (!isUpdateStrategyEvent(item.type)) {
2739
- throw new Error("not a UpdateStrategyEvent type");
2740
- }
2741
- return UpdateStrategyEvent.reified().new({
2742
- vaultIndex: (0, reified_1.decodeFromFieldsWithTypes)("u64", item.fields.vault_index),
2743
- signalIndex: (0, reified_1.decodeFromFieldsWithTypes)("u64", item.fields.signal_index),
2744
- strategyIndex: (0, reified_1.decodeFromFieldsWithTypes)("u64", item.fields.strategy_index),
2745
- user: (0, reified_1.decodeFromFieldsWithTypes)("address", item.fields.user),
2746
- pricePercentage: (0, reified_1.decodeFromFieldsWithTypes)("u64", item.fields.price_percentage),
2747
- size: (0, reified_1.decodeFromFieldsWithTypes)("u64", item.fields.size),
2748
- maxTimes: (0, reified_1.decodeFromFieldsWithTypes)("u64", item.fields.max_times),
2749
- targetRounds: (0, reified_1.decodeFromFieldsWithTypes)(reified.vector("u64"), item.fields.target_rounds),
2750
- depositAmount: (0, reified_1.decodeFromFieldsWithTypes)("u64", item.fields.deposit_amount),
2751
- });
2752
- };
2753
- UpdateStrategyEvent.fromBcs = function (data) {
2754
- return UpdateStrategyEvent.fromFields(UpdateStrategyEvent.bcs.parse(data));
2755
- };
2756
- UpdateStrategyEvent.prototype.toJSONField = function () {
2757
- return {
2758
- vaultIndex: this.vaultIndex.toString(),
2759
- signalIndex: this.signalIndex.toString(),
2760
- strategyIndex: this.strategyIndex.toString(),
2761
- user: this.user,
2762
- pricePercentage: this.pricePercentage.toString(),
2763
- size: this.size.toString(),
2764
- maxTimes: this.maxTimes.toString(),
2765
- targetRounds: (0, reified_1.fieldToJSON)("vector<u64>", this.targetRounds),
2766
- depositAmount: this.depositAmount.toString(),
2767
- };
2768
- };
2769
- UpdateStrategyEvent.prototype.toJSON = function () {
2770
- return __assign({ $typeName: this.$typeName, $typeArgs: this.$typeArgs }, this.toJSONField());
2771
- };
2772
- UpdateStrategyEvent.fromJSONField = function (field) {
2773
- return UpdateStrategyEvent.reified().new({
2774
- vaultIndex: (0, reified_1.decodeFromJSONField)("u64", field.vaultIndex),
2775
- signalIndex: (0, reified_1.decodeFromJSONField)("u64", field.signalIndex),
2776
- strategyIndex: (0, reified_1.decodeFromJSONField)("u64", field.strategyIndex),
2777
- user: (0, reified_1.decodeFromJSONField)("address", field.user),
2778
- pricePercentage: (0, reified_1.decodeFromJSONField)("u64", field.pricePercentage),
2779
- size: (0, reified_1.decodeFromJSONField)("u64", field.size),
2780
- maxTimes: (0, reified_1.decodeFromJSONField)("u64", field.maxTimes),
2781
- targetRounds: (0, reified_1.decodeFromJSONField)(reified.vector("u64"), field.targetRounds),
2782
- depositAmount: (0, reified_1.decodeFromJSONField)("u64", field.depositAmount),
2783
- });
2784
- };
2785
- UpdateStrategyEvent.fromJSON = function (json) {
2786
- if (json.$typeName !== UpdateStrategyEvent.$typeName) {
2787
- throw new Error("not a WithTwoGenerics json object");
2788
- }
2789
- return UpdateStrategyEvent.fromJSONField(json);
2790
- };
2791
- UpdateStrategyEvent.fromSuiParsedData = function (content) {
2792
- if (content.dataType !== "moveObject") {
2793
- throw new Error("not an object");
2794
- }
2795
- if (!isUpdateStrategyEvent(content.type)) {
2796
- throw new Error("object at ".concat(content.fields.id, " is not a UpdateStrategyEvent object"));
2797
- }
2798
- return UpdateStrategyEvent.fromFieldsWithTypes(content);
2799
- };
2800
- UpdateStrategyEvent.fromSuiObjectData = function (data) {
2801
- if (data.bcs) {
2802
- if (data.bcs.dataType !== "moveObject" || !isUpdateStrategyEvent(data.bcs.type)) {
2803
- throw new Error("object at is not a UpdateStrategyEvent object");
2804
- }
2805
- return UpdateStrategyEvent.fromBcs((0, utils_1.fromB64)(data.bcs.bcsBytes));
2806
- }
2807
- if (data.content) {
2808
- return UpdateStrategyEvent.fromSuiParsedData(data.content);
2809
- }
2810
- throw new Error("Both `bcs` and `content` fields are missing from the data. Include `showBcs` or `showContent` in the request.");
2811
- };
2812
- UpdateStrategyEvent.fetch = function (client, id) {
2813
- return __awaiter(this, void 0, void 0, function () {
2814
- var res;
2815
- var _a, _b;
2816
- return __generator(this, function (_c) {
2817
- switch (_c.label) {
2818
- case 0: return [4 /*yield*/, client.getObject({ id: id, options: { showBcs: true } })];
2819
- case 1:
2820
- res = _c.sent();
2821
- if (res.error) {
2822
- throw new Error("error fetching UpdateStrategyEvent object at id ".concat(id, ": ").concat(res.error.code));
2823
- }
2824
- if (((_b = (_a = res.data) === null || _a === void 0 ? void 0 : _a.bcs) === null || _b === void 0 ? void 0 : _b.dataType) !== "moveObject" || !isUpdateStrategyEvent(res.data.bcs.type)) {
2825
- throw new Error("object at id ".concat(id, " is not a UpdateStrategyEvent object"));
2826
- }
2827
- return [2 /*return*/, UpdateStrategyEvent.fromSuiObjectData(res.data)];
2828
- }
2829
- });
2830
- });
2831
- };
2832
- UpdateStrategyEvent.$typeName = "".concat(index_1.PKG_V1, "::auto_bid::UpdateStrategyEvent");
2833
- UpdateStrategyEvent.$numTypeParams = 0;
2834
- UpdateStrategyEvent.$isPhantom = [];
2835
- return UpdateStrategyEvent;
2836
- }());
2837
- exports.UpdateStrategyEvent = UpdateStrategyEvent;
2838
- /* ============================== WithdrawProfitEvent =============================== */
2839
- function isWithdrawProfitEvent(type) {
2840
- type = (0, util_1.compressSuiType)(type);
2841
- return type === "".concat(index_1.PKG_V1, "::auto_bid::WithdrawProfitEvent");
2842
- }
2843
- var WithdrawProfitEvent = /** @class */ (function () {
2844
- function WithdrawProfitEvent(typeArgs, fields) {
2845
- this.__StructClass = true;
2846
- this.$typeName = WithdrawProfitEvent.$typeName;
2847
- this.$isPhantom = WithdrawProfitEvent.$isPhantom;
2848
- this.$fullTypeName = util_1.composeSuiType.apply(void 0, __spreadArray([WithdrawProfitEvent.$typeName], __read(typeArgs), false));
2849
- this.$typeArgs = typeArgs;
2850
- this.vaultIndex = fields.vaultIndex;
2851
- this.signalIndex = fields.signalIndex;
2852
- this.strategyIndex = fields.strategyIndex;
2853
- this.user = fields.user;
2854
- this.profit = fields.profit;
2855
- }
2856
- WithdrawProfitEvent.reified = function () {
2857
- var _this = this;
2858
- return {
2859
- typeName: WithdrawProfitEvent.$typeName,
2860
- fullTypeName: util_1.composeSuiType.apply(void 0, __spreadArray([WithdrawProfitEvent.$typeName], [], false)),
2861
- typeArgs: [],
2862
- isPhantom: WithdrawProfitEvent.$isPhantom,
2863
- reifiedTypeArgs: [],
2864
- fromFields: function (fields) { return WithdrawProfitEvent.fromFields(fields); },
2865
- fromFieldsWithTypes: function (item) { return WithdrawProfitEvent.fromFieldsWithTypes(item); },
2866
- fromBcs: function (data) { return WithdrawProfitEvent.fromBcs(data); },
2867
- bcs: WithdrawProfitEvent.bcs,
2868
- fromJSONField: function (field) { return WithdrawProfitEvent.fromJSONField(field); },
2869
- fromJSON: function (json) { return WithdrawProfitEvent.fromJSON(json); },
2870
- fromSuiParsedData: function (content) { return WithdrawProfitEvent.fromSuiParsedData(content); },
2871
- fromSuiObjectData: function (content) { return WithdrawProfitEvent.fromSuiObjectData(content); },
2872
- fetch: function (client, id) { return __awaiter(_this, void 0, void 0, function () { return __generator(this, function (_a) {
2873
- return [2 /*return*/, WithdrawProfitEvent.fetch(client, id)];
2874
- }); }); },
2875
- new: function (fields) {
2876
- return new WithdrawProfitEvent([], fields);
2877
- },
2878
- kind: "StructClassReified",
2879
- };
2880
- };
2881
- Object.defineProperty(WithdrawProfitEvent, "r", {
2882
- get: function () {
2883
- return WithdrawProfitEvent.reified();
2884
- },
2885
- enumerable: false,
2886
- configurable: true
2887
- });
2888
- WithdrawProfitEvent.phantom = function () {
2889
- return (0, reified_1.phantom)(WithdrawProfitEvent.reified());
2890
- };
2891
- Object.defineProperty(WithdrawProfitEvent, "p", {
2892
- get: function () {
2893
- return WithdrawProfitEvent.phantom();
2894
- },
2895
- enumerable: false,
2896
- configurable: true
2897
- });
2898
- Object.defineProperty(WithdrawProfitEvent, "bcs", {
2899
- get: function () {
2900
- return bcs_1.bcs.struct("WithdrawProfitEvent", {
2901
- vault_index: bcs_1.bcs.u64(),
2902
- signal_index: bcs_1.bcs.u64(),
2903
- strategy_index: bcs_1.bcs.u64(),
2904
- user: bcs_1.bcs.bytes(32).transform({ input: function (val) { return (0, utils_1.fromHEX)(val); }, output: function (val) { return (0, utils_1.toHEX)(val); } }),
2905
- profit: bcs_1.bcs.u64(),
2906
- });
2907
- },
2908
- enumerable: false,
2909
- configurable: true
2910
- });
2911
- WithdrawProfitEvent.fromFields = function (fields) {
2912
- return WithdrawProfitEvent.reified().new({
2913
- vaultIndex: (0, reified_1.decodeFromFields)("u64", fields.vault_index),
2914
- signalIndex: (0, reified_1.decodeFromFields)("u64", fields.signal_index),
2915
- strategyIndex: (0, reified_1.decodeFromFields)("u64", fields.strategy_index),
2916
- user: (0, reified_1.decodeFromFields)("address", fields.user),
2917
- profit: (0, reified_1.decodeFromFields)("u64", fields.profit),
2918
- });
2919
- };
2920
- WithdrawProfitEvent.fromFieldsWithTypes = function (item) {
2921
- if (!isWithdrawProfitEvent(item.type)) {
2922
- throw new Error("not a WithdrawProfitEvent type");
2923
- }
2924
- return WithdrawProfitEvent.reified().new({
2925
- vaultIndex: (0, reified_1.decodeFromFieldsWithTypes)("u64", item.fields.vault_index),
2926
- signalIndex: (0, reified_1.decodeFromFieldsWithTypes)("u64", item.fields.signal_index),
2927
- strategyIndex: (0, reified_1.decodeFromFieldsWithTypes)("u64", item.fields.strategy_index),
2928
- user: (0, reified_1.decodeFromFieldsWithTypes)("address", item.fields.user),
2929
- profit: (0, reified_1.decodeFromFieldsWithTypes)("u64", item.fields.profit),
2930
- });
2931
- };
2932
- WithdrawProfitEvent.fromBcs = function (data) {
2933
- return WithdrawProfitEvent.fromFields(WithdrawProfitEvent.bcs.parse(data));
2934
- };
2935
- WithdrawProfitEvent.prototype.toJSONField = function () {
2936
- return {
2937
- vaultIndex: this.vaultIndex.toString(),
2938
- signalIndex: this.signalIndex.toString(),
2939
- strategyIndex: this.strategyIndex.toString(),
2940
- user: this.user,
2941
- profit: this.profit.toString(),
2942
- };
2943
- };
2944
- WithdrawProfitEvent.prototype.toJSON = function () {
2945
- return __assign({ $typeName: this.$typeName, $typeArgs: this.$typeArgs }, this.toJSONField());
2946
- };
2947
- WithdrawProfitEvent.fromJSONField = function (field) {
2948
- return WithdrawProfitEvent.reified().new({
2949
- vaultIndex: (0, reified_1.decodeFromJSONField)("u64", field.vaultIndex),
2950
- signalIndex: (0, reified_1.decodeFromJSONField)("u64", field.signalIndex),
2951
- strategyIndex: (0, reified_1.decodeFromJSONField)("u64", field.strategyIndex),
2952
- user: (0, reified_1.decodeFromJSONField)("address", field.user),
2953
- profit: (0, reified_1.decodeFromJSONField)("u64", field.profit),
2954
- });
2955
- };
2956
- WithdrawProfitEvent.fromJSON = function (json) {
2957
- if (json.$typeName !== WithdrawProfitEvent.$typeName) {
2958
- throw new Error("not a WithTwoGenerics json object");
2959
- }
2960
- return WithdrawProfitEvent.fromJSONField(json);
2961
- };
2962
- WithdrawProfitEvent.fromSuiParsedData = function (content) {
2963
- if (content.dataType !== "moveObject") {
2964
- throw new Error("not an object");
2965
- }
2966
- if (!isWithdrawProfitEvent(content.type)) {
2967
- throw new Error("object at ".concat(content.fields.id, " is not a WithdrawProfitEvent object"));
2968
- }
2969
- return WithdrawProfitEvent.fromFieldsWithTypes(content);
2970
- };
2971
- WithdrawProfitEvent.fromSuiObjectData = function (data) {
2972
- if (data.bcs) {
2973
- if (data.bcs.dataType !== "moveObject" || !isWithdrawProfitEvent(data.bcs.type)) {
2974
- throw new Error("object at is not a WithdrawProfitEvent object");
2975
- }
2976
- return WithdrawProfitEvent.fromBcs((0, utils_1.fromB64)(data.bcs.bcsBytes));
2977
- }
2978
- if (data.content) {
2979
- return WithdrawProfitEvent.fromSuiParsedData(data.content);
2980
- }
2981
- throw new Error("Both `bcs` and `content` fields are missing from the data. Include `showBcs` or `showContent` in the request.");
2982
- };
2983
- WithdrawProfitEvent.fetch = function (client, id) {
2984
- return __awaiter(this, void 0, void 0, function () {
2985
- var res;
2986
- var _a, _b;
2987
- return __generator(this, function (_c) {
2988
- switch (_c.label) {
2989
- case 0: return [4 /*yield*/, client.getObject({ id: id, options: { showBcs: true } })];
2990
- case 1:
2991
- res = _c.sent();
2992
- if (res.error) {
2993
- throw new Error("error fetching WithdrawProfitEvent object at id ".concat(id, ": ").concat(res.error.code));
2994
- }
2995
- if (((_b = (_a = res.data) === null || _a === void 0 ? void 0 : _a.bcs) === null || _b === void 0 ? void 0 : _b.dataType) !== "moveObject" || !isWithdrawProfitEvent(res.data.bcs.type)) {
2996
- throw new Error("object at id ".concat(id, " is not a WithdrawProfitEvent object"));
2997
- }
2998
- return [2 /*return*/, WithdrawProfitEvent.fromSuiObjectData(res.data)];
2999
- }
3000
- });
3001
- });
3002
- };
3003
- WithdrawProfitEvent.$typeName = "".concat(index_1.PKG_V1, "::auto_bid::WithdrawProfitEvent");
3004
- WithdrawProfitEvent.$numTypeParams = 0;
3005
- WithdrawProfitEvent.$isPhantom = [];
3006
- return WithdrawProfitEvent;
3007
- }());
3008
- exports.WithdrawProfitEvent = WithdrawProfitEvent;