@typus/typus-sdk 1.4.3-c → 1.4.3-e

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 (248) hide show
  1. package/package.json +10 -2
  2. package/src/_dependencies/source/0x1/ascii/structs.ts +135 -0
  3. package/src/_dependencies/source/0x1/bit-vector/structs.ts +70 -0
  4. package/src/_dependencies/source/0x1/fixed-point32/structs.ts +69 -0
  5. package/src/_dependencies/source/0x1/index.ts +1 -0
  6. package/src/_dependencies/source/0x1/init.ts +16 -0
  7. package/src/_dependencies/source/0x1/option/structs.ts +74 -0
  8. package/src/_dependencies/source/0x1/string/structs.ts +70 -0
  9. package/src/_dependencies/source/0x1/type-name/structs.ts +70 -0
  10. package/src/_dependencies/source/0x1d17058789bd1e1e79f1a92424519a88146f191f58a06cc4d9ab23d17d46ab73/index.ts +1 -0
  11. package/src/_dependencies/source/0x1d17058789bd1e1e79f1a92424519a88146f191f58a06cc4d9ab23d17d46ab73/init.ts +14 -0
  12. package/src/_dependencies/source/0x1d17058789bd1e1e79f1a92424519a88146f191f58a06cc4d9ab23d17d46ab73/oracle/structs.ts +203 -0
  13. package/src/_dependencies/source/0x1d17058789bd1e1e79f1a92424519a88146f191f58a06cc4d9ab23d17d46ab73/pyth-parser/structs.ts +317 -0
  14. package/src/_dependencies/source/0x1d17058789bd1e1e79f1a92424519a88146f191f58a06cc4d9ab23d17d46ab73/supra/structs.ts +69 -0
  15. package/src/_dependencies/source/0x1d17058789bd1e1e79f1a92424519a88146f191f58a06cc4d9ab23d17d46ab73/switchboard-feed-parser/structs.ts +69 -0
  16. package/src/_dependencies/source/0x2/authenticator-state/structs.ts +332 -0
  17. package/src/_dependencies/source/0x2/bag/structs.ts +70 -0
  18. package/src/_dependencies/source/0x2/balance/structs.ts +134 -0
  19. package/src/_dependencies/source/0x2/bcs/structs.ts +70 -0
  20. package/src/_dependencies/source/0x2/bls12381/structs.ts +264 -0
  21. package/src/_dependencies/source/0x2/borrow/structs.ts +138 -0
  22. package/src/_dependencies/source/0x2/clock/structs.ts +70 -0
  23. package/src/_dependencies/source/0x2/coin/structs.ts +400 -0
  24. package/src/_dependencies/source/0x2/deny-list/structs.ts +139 -0
  25. package/src/_dependencies/source/0x2/display/structs.ts +202 -0
  26. package/src/_dependencies/source/0x2/dynamic-field/structs.ts +70 -0
  27. package/src/_dependencies/source/0x2/dynamic-object-field/structs.ts +71 -0
  28. package/src/_dependencies/source/0x2/groth16/structs.ts +265 -0
  29. package/src/_dependencies/source/0x2/group-ops/structs.ts +70 -0
  30. package/src/_dependencies/source/0x2/index.ts +1 -0
  31. package/src/_dependencies/source/0x2/init.ts +125 -0
  32. package/src/_dependencies/source/0x2/kiosk/structs.ts +658 -0
  33. package/src/_dependencies/source/0x2/kiosk-extension/structs.ts +135 -0
  34. package/src/_dependencies/source/0x2/linked-table/structs.ts +136 -0
  35. package/src/_dependencies/source/0x2/object/structs.ts +134 -0
  36. package/src/_dependencies/source/0x2/object-bag/structs.ts +70 -0
  37. package/src/_dependencies/source/0x2/object-table/structs.ts +70 -0
  38. package/src/_dependencies/source/0x2/package/structs.ts +267 -0
  39. package/src/_dependencies/source/0x2/priority-queue/structs.ts +139 -0
  40. package/src/_dependencies/source/0x2/random/structs.ts +202 -0
  41. package/src/_dependencies/source/0x2/sui/structs.ts +69 -0
  42. package/src/_dependencies/source/0x2/table/structs.ts +70 -0
  43. package/src/_dependencies/source/0x2/table-vec/structs.ts +71 -0
  44. package/src/_dependencies/source/0x2/token/structs.ts +401 -0
  45. package/src/_dependencies/source/0x2/transfer/structs.ts +70 -0
  46. package/src/_dependencies/source/0x2/transfer-policy/structs.ts +400 -0
  47. package/src/_dependencies/source/0x2/tx-context/structs.ts +70 -0
  48. package/src/_dependencies/source/0x2/url/structs.ts +70 -0
  49. package/src/_dependencies/source/0x2/vec-map/structs.ts +135 -0
  50. package/src/_dependencies/source/0x2/vec-set/structs.ts +72 -0
  51. package/src/_dependencies/source/0x2/versioned/structs.ts +135 -0
  52. package/src/_dependencies/source/0x2/zklogin-verified-id/structs.ts +71 -0
  53. package/src/_dependencies/source/0x2/zklogin-verified-issuer/structs.ts +71 -0
  54. package/src/_dependencies/source/0x277f90d256d1015a78cad646db091bec451c5bbab834b9fb70bace7885b5c698/index.ts +1 -0
  55. package/src/_dependencies/source/0x277f90d256d1015a78cad646db091bec451c5bbab834b9fb70bace7885b5c698/init.ts +5 -0
  56. package/src/_dependencies/source/0x277f90d256d1015a78cad646db091bec451c5bbab834b9fb70bace7885b5c698/validator/structs.ts +70 -0
  57. package/src/_dependencies/source/0x2fdff17b86e34ab722c8ba5e63f0da070d9a4163705b3fdc6a95802cab40a72a/index.ts +1 -0
  58. package/src/_dependencies/source/0x2fdff17b86e34ab722c8ba5e63f0da070d9a4163705b3fdc6a95802cab40a72a/init.ts +8 -0
  59. package/src/_dependencies/source/0x2fdff17b86e34ab722c8ba5e63f0da070d9a4163705b3fdc6a95802cab40a72a/price-data-pull/structs.ts +69 -0
  60. package/src/_dependencies/source/0x2fdff17b86e34ab722c8ba5e63f0da070d9a4163705b3fdc6a95802cab40a72a/suprasvaluefeed/structs.ts +135 -0
  61. package/src/_dependencies/source/0x4213e12a2220f15f1837a76897110d2260786558169bd8d0847f21e9b551f277/airdrop/structs.ts +400 -0
  62. package/src/_dependencies/source/0x4213e12a2220f15f1837a76897110d2260786558169bd8d0847f21e9b551f277/big-vector/structs.ts +372 -0
  63. package/src/_dependencies/source/0x4213e12a2220f15f1837a76897110d2260786558169bd8d0847f21e9b551f277/critbit/structs.ts +205 -0
  64. package/src/_dependencies/source/0x4213e12a2220f15f1837a76897110d2260786558169bd8d0847f21e9b551f277/ecosystem/structs.ts +333 -0
  65. package/src/_dependencies/source/0x4213e12a2220f15f1837a76897110d2260786558169bd8d0847f21e9b551f277/index.ts +1 -0
  66. package/src/_dependencies/source/0x4213e12a2220f15f1837a76897110d2260786558169bd8d0847f21e9b551f277/init.ts +48 -0
  67. package/src/_dependencies/source/0x4213e12a2220f15f1837a76897110d2260786558169bd8d0847f21e9b551f277/leaderboard/structs.ts +465 -0
  68. package/src/_dependencies/source/0x4213e12a2220f15f1837a76897110d2260786558169bd8d0847f21e9b551f277/linked-object-table/structs.ts +136 -0
  69. package/src/_dependencies/source/0x4213e12a2220f15f1837a76897110d2260786558169bd8d0847f21e9b551f277/linked-set/structs.ts +140 -0
  70. package/src/_dependencies/source/0x4213e12a2220f15f1837a76897110d2260786558169bd8d0847f21e9b551f277/tgld/structs.ts +268 -0
  71. package/src/_dependencies/source/0x4213e12a2220f15f1837a76897110d2260786558169bd8d0847f21e9b551f277/user/structs.ts +332 -0
  72. package/src/_dependencies/source/0x5cfd0819411be98034cba544cbffab192c2c35674a05ff57f4f1c5042875b828/discount-mint/structs.ts +466 -0
  73. package/src/_dependencies/source/0x5cfd0819411be98034cba544cbffab192c2c35674a05ff57f4f1c5042875b828/index.ts +1 -0
  74. package/src/_dependencies/source/0x5cfd0819411be98034cba544cbffab192c2c35674a05ff57f4f1c5042875b828/init.ts +36 -0
  75. package/src/_dependencies/source/0x5cfd0819411be98034cba544cbffab192c2c35674a05ff57f4f1c5042875b828/royalty-rule/structs.ts +134 -0
  76. package/src/_dependencies/source/0x5cfd0819411be98034cba544cbffab192c2c35674a05ff57f4f1c5042875b828/staking/structs.ts +333 -0
  77. package/src/_dependencies/source/0x5cfd0819411be98034cba544cbffab192c2c35674a05ff57f4f1c5042875b828/table-vec/structs.ts +71 -0
  78. package/src/_dependencies/source/0x5cfd0819411be98034cba544cbffab192c2c35674a05ff57f4f1c5042875b828/typus-nft/structs.ts +856 -0
  79. package/src/_dependencies/source/0x6c9a394a43844fc09d9617bc8a8e775a4521f0e28e83de1da780d043a498671f/auto-bid/structs.ts +1049 -0
  80. package/src/_dependencies/source/0x6c9a394a43844fc09d9617bc8a8e775a4521f0e28e83de1da780d043a498671f/index.ts +1 -0
  81. package/src/_dependencies/source/0x6c9a394a43844fc09d9617bc8a8e775a4521f0e28e83de1da780d043a498671f/init.ts +104 -0
  82. package/src/_dependencies/source/0x6c9a394a43844fc09d9617bc8a8e775a4521f0e28e83de1da780d043a498671f/tails-staking/structs.ts +1054 -0
  83. package/src/_dependencies/source/0x6c9a394a43844fc09d9617bc8a8e775a4521f0e28e83de1da780d043a498671f/tds-authorized-entry/structs.ts +592 -0
  84. package/src/_dependencies/source/0x6c9a394a43844fc09d9617bc8a8e775a4521f0e28e83de1da780d043a498671f/tds-fee-pool-entry/structs.ts +461 -0
  85. package/src/_dependencies/source/0x6c9a394a43844fc09d9617bc8a8e775a4521f0e28e83de1da780d043a498671f/tds-registry-authorized-entry/structs.ts +592 -0
  86. package/src/_dependencies/source/0x6c9a394a43844fc09d9617bc8a8e775a4521f0e28e83de1da780d043a498671f/tds-view-function/structs.ts +69 -0
  87. package/src/_dependencies/source/0x6c9a394a43844fc09d9617bc8a8e775a4521f0e28e83de1da780d043a498671f/typus-dov-single/structs.ts +2351 -0
  88. package/src/_dependencies/source/0x7237ec8436ef7e927c45470db6db3a834dd84cf903aedee3844e847fe4805399/index.ts +1 -0
  89. package/src/_dependencies/source/0x7237ec8436ef7e927c45470db6db3a834dd84cf903aedee3844e847fe4805399/init.ts +3 -0
  90. package/src/_dependencies/source/0x908a10789a1a6953e0b73a997c10e3552f7ce4e2907afd00a334ed74bd973ded/authority/structs.ts +71 -0
  91. package/src/_dependencies/source/0x908a10789a1a6953e0b73a997c10e3552f7ce4e2907afd00a334ed74bd973ded/balance-pool/structs.ts +203 -0
  92. package/src/_dependencies/source/0x908a10789a1a6953e0b73a997c10e3552f7ce4e2907afd00a334ed74bd973ded/big-vector/structs.ts +70 -0
  93. package/src/_dependencies/source/0x908a10789a1a6953e0b73a997c10e3552f7ce4e2907afd00a334ed74bd973ded/dutch/structs.ts +528 -0
  94. package/src/_dependencies/source/0x908a10789a1a6953e0b73a997c10e3552f7ce4e2907afd00a334ed74bd973ded/i64/structs.ts +69 -0
  95. package/src/_dependencies/source/0x908a10789a1a6953e0b73a997c10e3552f7ce4e2907afd00a334ed74bd973ded/index.ts +1 -0
  96. package/src/_dependencies/source/0x908a10789a1a6953e0b73a997c10e3552f7ce4e2907afd00a334ed74bd973ded/init.ts +54 -0
  97. package/src/_dependencies/source/0x908a10789a1a6953e0b73a997c10e3552f7ce4e2907afd00a334ed74bd973ded/linked-list/structs.ts +136 -0
  98. package/src/_dependencies/source/0x908a10789a1a6953e0b73a997c10e3552f7ce4e2907afd00a334ed74bd973ded/vault/structs.ts +1829 -0
  99. package/src/_dependencies/source/0x98670585b87e06628ef2d7f7cb1e7bee8ada65b43b82997935225a7e6e21d18e/aggregator/structs.ts +398 -0
  100. package/src/_dependencies/source/0x98670585b87e06628ef2d7f7cb1e7bee8ada65b43b82997935225a7e6e21d18e/index.ts +1 -0
  101. package/src/_dependencies/source/0x98670585b87e06628ef2d7f7cb1e7bee8ada65b43b82997935225a7e6e21d18e/init.ts +18 -0
  102. package/src/_dependencies/source/0x98670585b87e06628ef2d7f7cb1e7bee8ada65b43b82997935225a7e6e21d18e/job/structs.ts +71 -0
  103. package/src/_dependencies/source/0x98670585b87e06628ef2d7f7cb1e7bee8ada65b43b82997935225a7e6e21d18e/math/structs.ts +69 -0
  104. package/src/_dependencies/source/0x98670585b87e06628ef2d7f7cb1e7bee8ada65b43b82997935225a7e6e21d18e/quote/structs.ts +71 -0
  105. package/src/_dependencies/source/0x98670585b87e06628ef2d7f7cb1e7bee8ada65b43b82997935225a7e6e21d18e/switchboard/structs.ts +70 -0
  106. package/src/_dependencies/source/0xbd8fc1947cf119350184107a3087e2dc27efefa0dd82e25a1f699069fe81a585/index.ts +1 -0
  107. package/src/_dependencies/source/0xbd8fc1947cf119350184107a3087e2dc27efefa0dd82e25a1f699069fe81a585/init.ts +11 -0
  108. package/src/_dependencies/source/0xbd8fc1947cf119350184107a3087e2dc27efefa0dd82e25a1f699069fe81a585/kiosk-lock-rule/structs.ts +134 -0
  109. package/src/_dependencies/source/0xbd8fc1947cf119350184107a3087e2dc27efefa0dd82e25a1f699069fe81a585/royalty-rule/structs.ts +134 -0
  110. package/src/_dependencies/source/0xbd8fc1947cf119350184107a3087e2dc27efefa0dd82e25a1f699069fe81a585/witness-rule/structs.ts +69 -0
  111. package/src/_dependencies/source/0xcc029e2810f17f9f43f52262f40026a71fbdca40ed3803ad2884994361910b7e/bytes20/structs.ts +70 -0
  112. package/src/_dependencies/source/0xcc029e2810f17f9f43f52262f40026a71fbdca40ed3803ad2884994361910b7e/bytes32/structs.ts +70 -0
  113. package/src/_dependencies/source/0xcc029e2810f17f9f43f52262f40026a71fbdca40ed3803ad2884994361910b7e/consumed-vaas/structs.ts +72 -0
  114. package/src/_dependencies/source/0xcc029e2810f17f9f43f52262f40026a71fbdca40ed3803ad2884994361910b7e/cursor/structs.ts +72 -0
  115. package/src/_dependencies/source/0xcc029e2810f17f9f43f52262f40026a71fbdca40ed3803ad2884994361910b7e/emitter/structs.ts +200 -0
  116. package/src/_dependencies/source/0xcc029e2810f17f9f43f52262f40026a71fbdca40ed3803ad2884994361910b7e/external-address/structs.ts +70 -0
  117. package/src/_dependencies/source/0xcc029e2810f17f9f43f52262f40026a71fbdca40ed3803ad2884994361910b7e/fee-collector/structs.ts +72 -0
  118. package/src/_dependencies/source/0xcc029e2810f17f9f43f52262f40026a71fbdca40ed3803ad2884994361910b7e/governance-message/structs.ts +137 -0
  119. package/src/_dependencies/source/0xcc029e2810f17f9f43f52262f40026a71fbdca40ed3803ad2884994361910b7e/guardian/structs.ts +70 -0
  120. package/src/_dependencies/source/0xcc029e2810f17f9f43f52262f40026a71fbdca40ed3803ad2884994361910b7e/guardian-set/structs.ts +71 -0
  121. package/src/_dependencies/source/0xcc029e2810f17f9f43f52262f40026a71fbdca40ed3803ad2884994361910b7e/guardian-signature/structs.ts +70 -0
  122. package/src/_dependencies/source/0xcc029e2810f17f9f43f52262f40026a71fbdca40ed3803ad2884994361910b7e/index.ts +1 -0
  123. package/src/_dependencies/source/0xcc029e2810f17f9f43f52262f40026a71fbdca40ed3803ad2884994361910b7e/init.ts +65 -0
  124. package/src/_dependencies/source/0xcc029e2810f17f9f43f52262f40026a71fbdca40ed3803ad2884994361910b7e/migrate/structs.ts +70 -0
  125. package/src/_dependencies/source/0xcc029e2810f17f9f43f52262f40026a71fbdca40ed3803ad2884994361910b7e/package-utils/structs.ts +266 -0
  126. package/src/_dependencies/source/0xcc029e2810f17f9f43f52262f40026a71fbdca40ed3803ad2884994361910b7e/publish-message/structs.ts +136 -0
  127. package/src/_dependencies/source/0xcc029e2810f17f9f43f52262f40026a71fbdca40ed3803ad2884994361910b7e/set/structs.ts +136 -0
  128. package/src/_dependencies/source/0xcc029e2810f17f9f43f52262f40026a71fbdca40ed3803ad2884994361910b7e/set-fee/structs.ts +134 -0
  129. package/src/_dependencies/source/0xcc029e2810f17f9f43f52262f40026a71fbdca40ed3803ad2884994361910b7e/setup/structs.ts +70 -0
  130. package/src/_dependencies/source/0xcc029e2810f17f9f43f52262f40026a71fbdca40ed3803ad2884994361910b7e/state/structs.ts +142 -0
  131. package/src/_dependencies/source/0xcc029e2810f17f9f43f52262f40026a71fbdca40ed3803ad2884994361910b7e/transfer-fee/structs.ts +134 -0
  132. package/src/_dependencies/source/0xcc029e2810f17f9f43f52262f40026a71fbdca40ed3803ad2884994361910b7e/update-guardian-set/structs.ts +201 -0
  133. package/src/_dependencies/source/0xcc029e2810f17f9f43f52262f40026a71fbdca40ed3803ad2884994361910b7e/upgrade-contract/structs.ts +201 -0
  134. package/src/_dependencies/source/0xcc029e2810f17f9f43f52262f40026a71fbdca40ed3803ad2884994361910b7e/vaa/structs.ts +72 -0
  135. package/src/_dependencies/source/0xcc029e2810f17f9f43f52262f40026a71fbdca40ed3803ad2884994361910b7e/version-control/structs.ts +134 -0
  136. package/src/_dependencies/source/0xe76d8a37d4132278a7a752183e90e04890b9e7d0f6657eadb68821609a2a56a3/batch-price-attestation/structs.ts +136 -0
  137. package/src/_dependencies/source/0xe76d8a37d4132278a7a752183e90e04890b9e7d0f6657eadb68821609a2a56a3/contract-upgrade/structs.ts +136 -0
  138. package/src/_dependencies/source/0xe76d8a37d4132278a7a752183e90e04890b9e7d0f6657eadb68821609a2a56a3/data-source/structs.ts +70 -0
  139. package/src/_dependencies/source/0xe76d8a37d4132278a7a752183e90e04890b9e7d0f6657eadb68821609a2a56a3/event/structs.ts +135 -0
  140. package/src/_dependencies/source/0xe76d8a37d4132278a7a752183e90e04890b9e7d0f6657eadb68821609a2a56a3/governance/structs.ts +71 -0
  141. package/src/_dependencies/source/0xe76d8a37d4132278a7a752183e90e04890b9e7d0f6657eadb68821609a2a56a3/governance-action/structs.ts +69 -0
  142. package/src/_dependencies/source/0xe76d8a37d4132278a7a752183e90e04890b9e7d0f6657eadb68821609a2a56a3/governance-instruction/structs.ts +71 -0
  143. package/src/_dependencies/source/0xe76d8a37d4132278a7a752183e90e04890b9e7d0f6657eadb68821609a2a56a3/hot-potato-vector/structs.ts +72 -0
  144. package/src/_dependencies/source/0xe76d8a37d4132278a7a752183e90e04890b9e7d0f6657eadb68821609a2a56a3/i64/structs.ts +69 -0
  145. package/src/_dependencies/source/0xe76d8a37d4132278a7a752183e90e04890b9e7d0f6657eadb68821609a2a56a3/index.ts +1 -0
  146. package/src/_dependencies/source/0xe76d8a37d4132278a7a752183e90e04890b9e7d0f6657eadb68821609a2a56a3/init.ts +59 -0
  147. package/src/_dependencies/source/0xe76d8a37d4132278a7a752183e90e04890b9e7d0f6657eadb68821609a2a56a3/migrate/structs.ts +70 -0
  148. package/src/_dependencies/source/0xe76d8a37d4132278a7a752183e90e04890b9e7d0f6657eadb68821609a2a56a3/price/structs.ts +70 -0
  149. package/src/_dependencies/source/0xe76d8a37d4132278a7a752183e90e04890b9e7d0f6657eadb68821609a2a56a3/price-feed/structs.ts +71 -0
  150. package/src/_dependencies/source/0xe76d8a37d4132278a7a752183e90e04890b9e7d0f6657eadb68821609a2a56a3/price-identifier/structs.ts +70 -0
  151. package/src/_dependencies/source/0xe76d8a37d4132278a7a752183e90e04890b9e7d0f6657eadb68821609a2a56a3/price-info/structs.ts +136 -0
  152. package/src/_dependencies/source/0xe76d8a37d4132278a7a752183e90e04890b9e7d0f6657eadb68821609a2a56a3/price-status/structs.ts +69 -0
  153. package/src/_dependencies/source/0xe76d8a37d4132278a7a752183e90e04890b9e7d0f6657eadb68821609a2a56a3/set/structs.ts +138 -0
  154. package/src/_dependencies/source/0xe76d8a37d4132278a7a752183e90e04890b9e7d0f6657eadb68821609a2a56a3/set-data-sources/structs.ts +71 -0
  155. package/src/_dependencies/source/0xe76d8a37d4132278a7a752183e90e04890b9e7d0f6657eadb68821609a2a56a3/set-fee-recipient/structs.ts +69 -0
  156. package/src/_dependencies/source/0xe76d8a37d4132278a7a752183e90e04890b9e7d0f6657eadb68821609a2a56a3/set-governance-data-source/structs.ts +70 -0
  157. package/src/_dependencies/source/0xe76d8a37d4132278a7a752183e90e04890b9e7d0f6657eadb68821609a2a56a3/set-stale-price-threshold/structs.ts +69 -0
  158. package/src/_dependencies/source/0xe76d8a37d4132278a7a752183e90e04890b9e7d0f6657eadb68821609a2a56a3/set-update-fee/structs.ts +69 -0
  159. package/src/_dependencies/source/0xe76d8a37d4132278a7a752183e90e04890b9e7d0f6657eadb68821609a2a56a3/setup/structs.ts +70 -0
  160. package/src/_dependencies/source/0xe76d8a37d4132278a7a752183e90e04890b9e7d0f6657eadb68821609a2a56a3/state/structs.ts +203 -0
  161. package/src/_dependencies/source/0xe76d8a37d4132278a7a752183e90e04890b9e7d0f6657eadb68821609a2a56a3/version-control/structs.ts +134 -0
  162. package/src/_framework/init-source.ts +39 -0
  163. package/src/_framework/loader.ts +69 -0
  164. package/src/_framework/reified.ts +442 -0
  165. package/src/_framework/util.ts +265 -0
  166. package/src/airdrop/authority-entry.ts +101 -0
  167. package/src/airdrop/index.ts +3 -0
  168. package/src/airdrop/user-entry.ts +24 -0
  169. package/src/airdrop/view-function.ts +36 -0
  170. package/src/auto-bid/index.ts +2 -0
  171. package/src/auto-bid/user-entry.ts +256 -0
  172. package/src/auto-bid/view-function.ts +285 -0
  173. package/src/constants/constant.ts +32 -0
  174. package/src/constants/index.ts +2 -0
  175. package/src/constants/token.ts +194 -0
  176. package/src/index.ts +11 -0
  177. package/src/leaderboard/authority-entry.ts +63 -0
  178. package/src/leaderboard/index.ts +2 -0
  179. package/src/leaderboard/view-function.ts +66 -0
  180. package/src/tails-exp-dice/api.ts +46 -0
  181. package/src/tails-exp-dice/fetch.ts +347 -0
  182. package/src/tails-exp-dice/index.ts +4 -0
  183. package/src/tails-exp-dice/user-entry.ts +241 -0
  184. package/src/tails-exp-dice/view-function.ts +111 -0
  185. package/src/tails-staking/authority-entry.ts +333 -0
  186. package/src/tails-staking/index.ts +3 -0
  187. package/src/tails-staking/user-entry.ts +401 -0
  188. package/src/tails-staking/view-function.ts +86 -0
  189. package/src/typus-dov-single-v2/entry/authority-entry.ts +171 -0
  190. package/src/typus-dov-single-v2/entry/index.ts +3 -0
  191. package/src/typus-dov-single-v2/entry/mfud-user-entry.ts +591 -0
  192. package/src/typus-dov-single-v2/entry/user-entry.ts +573 -0
  193. package/src/typus-dov-single-v2/function/bidding.ts +823 -0
  194. package/src/typus-dov-single-v2/function/index.ts +3 -0
  195. package/src/typus-dov-single-v2/function/token.ts +38 -0
  196. package/src/typus-dov-single-v2/function/vault.ts +24 -0
  197. package/src/typus-dov-single-v2/history/index.ts +2 -0
  198. package/src/typus-dov-single-v2/history/user-history.ts +929 -0
  199. package/src/typus-dov-single-v2/history/vault-history.ts +452 -0
  200. package/src/typus-dov-single-v2/index.ts +4 -0
  201. package/src/typus-dov-single-v2/view-function.ts +705 -0
  202. package/src/typus-nft/fetch.ts +428 -0
  203. package/src/typus-nft/index.ts +2 -0
  204. package/src/typus-nft/user-entry.ts +113 -0
  205. package/src/typus-perp/admin/functions.ts +141 -0
  206. package/src/typus-perp/admin/structs.ts +793 -0
  207. package/src/typus-perp/fetch.ts +253 -0
  208. package/src/typus-perp/index.ts +9 -0
  209. package/src/typus-perp/init.ts +96 -0
  210. package/src/typus-perp/lp-pool/functions.ts +694 -0
  211. package/src/typus-perp/lp-pool/structs.ts +3884 -0
  212. package/src/typus-perp/math/functions.ts +53 -0
  213. package/src/typus-perp/oracle/functions.ts +32 -0
  214. package/src/typus-perp/oracle/structs.ts +317 -0
  215. package/src/typus-perp/position/functions.ts +887 -0
  216. package/src/typus-perp/position/structs.ts +1637 -0
  217. package/src/typus-perp/readVec.ts +118 -0
  218. package/src/typus-perp/stake-pool/functions.ts +421 -0
  219. package/src/typus-perp/stake-pool/structs.ts +3873 -0
  220. package/src/typus-perp/symbol/functions.ts +24 -0
  221. package/src/typus-perp/symbol/structs.ts +165 -0
  222. package/src/typus-perp/tlp/functions.ts +50 -0
  223. package/src/typus-perp/tlp/structs.ts +287 -0
  224. package/src/typus-perp/token-interface/functions.ts +29 -0
  225. package/src/typus-perp/trading/functions.ts +1046 -0
  226. package/src/typus-perp/trading/structs.ts +4541 -0
  227. package/src/typus-perp/treasury-caps/functions.ts +36 -0
  228. package/src/typus-perp/treasury-caps/structs.ts +151 -0
  229. package/src/typus-perp/user/order.ts +221 -0
  230. package/src/typus-perp/user/orderWithBidReceipt.ts +176 -0
  231. package/src/typus-perp/user/tlp.ts +234 -0
  232. package/src/user/index.ts +1 -0
  233. package/src/user/view-function.ts +33 -0
  234. package/src/utils/.DS_Store +0 -0
  235. package/src/utils/api/defillama/index.ts +1 -0
  236. package/src/utils/api/defillama/tvl.ts +11 -0
  237. package/src/utils/api/index.ts +3 -0
  238. package/src/utils/api/price.ts +101 -0
  239. package/src/utils/api/sentio/index.ts +2 -0
  240. package/src/utils/api/sentio/leader-board.ts +259 -0
  241. package/src/utils/api/sentio/reward-generated.ts +392 -0
  242. package/src/utils/index.ts +5 -0
  243. package/src/utils/load_env.ts +5 -0
  244. package/src/utils/mint.ts +16 -0
  245. package/src/utils/pyth/constant.ts +71 -0
  246. package/src/utils/pyth/index.ts +2 -0
  247. package/src/utils/pyth/pythClient.ts +52 -0
  248. package/src/utils/tools.ts +38 -0
@@ -0,0 +1,203 @@
1
+ import {PhantomReified, Reified, StructClass, ToField, ToTypeStr, decodeFromFields, decodeFromFieldsWithTypes, decodeFromJSONField, fieldToJSON, phantom} from "../../../../_framework/reified";
2
+ import {FieldsWithTypes, composeSuiType, compressSuiType} from "../../../../_framework/util";
3
+ import {String} from "../../0x1/ascii/structs";
4
+ import {Option} from "../../0x1/option/structs";
5
+ import {TypeName} from "../../0x1/type-name/structs";
6
+ import {ID, UID} from "../../0x2/object/structs";
7
+ import {bcs, fromB64} from "@mysten/bcs";
8
+ import {SuiClient, SuiParsedData} from "@mysten/sui.js/client";
9
+
10
+ /* ============================== ManagerCap =============================== */
11
+
12
+ export function isManagerCap(type: string): boolean { type = compressSuiType(type); return type === "0x1d17058789bd1e1e79f1a92424519a88146f191f58a06cc4d9ab23d17d46ab73::oracle::ManagerCap"; }
13
+
14
+ export interface ManagerCapFields { id: ToField<UID> }
15
+
16
+ export type ManagerCapReified = Reified< ManagerCap, ManagerCapFields >;
17
+
18
+ export class ManagerCap implements StructClass { static readonly $typeName = "0x1d17058789bd1e1e79f1a92424519a88146f191f58a06cc4d9ab23d17d46ab73::oracle::ManagerCap"; static readonly $numTypeParams = 0;
19
+
20
+ readonly $typeName = ManagerCap.$typeName;
21
+
22
+ readonly $fullTypeName: "0x1d17058789bd1e1e79f1a92424519a88146f191f58a06cc4d9ab23d17d46ab73::oracle::ManagerCap";
23
+
24
+ readonly $typeArgs: [];
25
+
26
+ readonly id: ToField<UID>
27
+
28
+ private constructor(typeArgs: [], fields: ManagerCapFields, ) { this.$fullTypeName = composeSuiType( ManagerCap.$typeName, ...typeArgs ) as "0x1d17058789bd1e1e79f1a92424519a88146f191f58a06cc4d9ab23d17d46ab73::oracle::ManagerCap"; this.$typeArgs = typeArgs;
29
+
30
+ this.id = fields.id; }
31
+
32
+ static reified( ): ManagerCapReified { return { typeName: ManagerCap.$typeName, fullTypeName: composeSuiType( ManagerCap.$typeName, ...[] ) as "0x1d17058789bd1e1e79f1a92424519a88146f191f58a06cc4d9ab23d17d46ab73::oracle::ManagerCap", typeArgs: [ ] as [], reifiedTypeArgs: [], fromFields: (fields: Record<string, any>) => ManagerCap.fromFields( fields, ), fromFieldsWithTypes: (item: FieldsWithTypes) => ManagerCap.fromFieldsWithTypes( item, ), fromBcs: (data: Uint8Array) => ManagerCap.fromBcs( data, ), bcs: ManagerCap.bcs, fromJSONField: (field: any) => ManagerCap.fromJSONField( field, ), fromJSON: (json: Record<string, any>) => ManagerCap.fromJSON( json, ), fromSuiParsedData: (content: SuiParsedData) => ManagerCap.fromSuiParsedData( content, ), fetch: async (client: SuiClient, id: string) => ManagerCap.fetch( client, id, ), new: ( fields: ManagerCapFields, ) => { return new ManagerCap( [], fields ) }, kind: "StructClassReified", } }
33
+
34
+ static get r() { return ManagerCap.reified() }
35
+
36
+ static phantom( ): PhantomReified<ToTypeStr<ManagerCap>> { return phantom(ManagerCap.reified( )); } static get p() { return ManagerCap.phantom() }
37
+
38
+ static get bcs() { return bcs.struct("ManagerCap", {
39
+
40
+ id: UID.bcs
41
+
42
+ }) };
43
+
44
+ static fromFields( fields: Record<string, any> ): ManagerCap { return ManagerCap.reified( ).new( { id: decodeFromFields(UID.reified(), fields.id) } ) }
45
+
46
+ static fromFieldsWithTypes( item: FieldsWithTypes ): ManagerCap { if (!isManagerCap(item.type)) { throw new Error("not a ManagerCap type");
47
+
48
+ }
49
+
50
+ return ManagerCap.reified( ).new( { id: decodeFromFieldsWithTypes(UID.reified(), item.fields.id) } ) }
51
+
52
+ static fromBcs( data: Uint8Array ): ManagerCap { return ManagerCap.fromFields( ManagerCap.bcs.parse(data) ) }
53
+
54
+ toJSONField() { return {
55
+
56
+ id: this.id,
57
+
58
+ } }
59
+
60
+ toJSON() { return { $typeName: this.$typeName, $typeArgs: this.$typeArgs, ...this.toJSONField() } }
61
+
62
+ static fromJSONField( field: any ): ManagerCap { return ManagerCap.reified( ).new( { id: decodeFromJSONField(UID.reified(), field.id) } ) }
63
+
64
+ static fromJSON( json: Record<string, any> ): ManagerCap { if (json.$typeName !== ManagerCap.$typeName) { throw new Error("not a WithTwoGenerics json object") };
65
+
66
+ return ManagerCap.fromJSONField( json, ) }
67
+
68
+ static fromSuiParsedData( content: SuiParsedData ): ManagerCap { if (content.dataType !== "moveObject") { throw new Error("not an object"); } if (!isManagerCap(content.type)) { throw new Error(`object at ${(content.fields as any).id} is not a ManagerCap object`); } return ManagerCap.fromFieldsWithTypes( content ); }
69
+
70
+ static async fetch( client: SuiClient, id: string ): Promise<ManagerCap> { const res = await client.getObject({ id, options: { showBcs: true, }, }); if (res.error) { throw new Error(`error fetching ManagerCap object at id ${id}: ${res.error.code}`); } if (res.data?.bcs?.dataType !== "moveObject" || !isManagerCap(res.data.bcs.type)) { throw new Error(`object at id ${id} is not a ManagerCap object`); }
71
+ return ManagerCap.fromBcs( fromB64(res.data.bcs.bcsBytes) ); }
72
+
73
+ }
74
+
75
+ /* ============================== Oracle =============================== */
76
+
77
+ export function isOracle(type: string): boolean { type = compressSuiType(type); return type === "0x1d17058789bd1e1e79f1a92424519a88146f191f58a06cc4d9ab23d17d46ab73::oracle::Oracle"; }
78
+
79
+ export interface OracleFields { id: ToField<UID>; baseToken: ToField<String>; quoteToken: ToField<String>; baseTokenType: ToField<TypeName>; quoteTokenType: ToField<TypeName>; decimal: ToField<"u64">; price: ToField<"u64">; twapPrice: ToField<"u64">; tsMs: ToField<"u64">; epoch: ToField<"u64">; timeInterval: ToField<"u64">; switchboard: ToField<Option<ID>>; pyth: ToField<Option<ID>> }
80
+
81
+ export type OracleReified = Reified< Oracle, OracleFields >;
82
+
83
+ export class Oracle implements StructClass { static readonly $typeName = "0x1d17058789bd1e1e79f1a92424519a88146f191f58a06cc4d9ab23d17d46ab73::oracle::Oracle"; static readonly $numTypeParams = 0;
84
+
85
+ readonly $typeName = Oracle.$typeName;
86
+
87
+ readonly $fullTypeName: "0x1d17058789bd1e1e79f1a92424519a88146f191f58a06cc4d9ab23d17d46ab73::oracle::Oracle";
88
+
89
+ readonly $typeArgs: [];
90
+
91
+ readonly id: ToField<UID>; readonly baseToken: ToField<String>; readonly quoteToken: ToField<String>; readonly baseTokenType: ToField<TypeName>; readonly quoteTokenType: ToField<TypeName>; readonly decimal: ToField<"u64">; readonly price: ToField<"u64">; readonly twapPrice: ToField<"u64">; readonly tsMs: ToField<"u64">; readonly epoch: ToField<"u64">; readonly timeInterval: ToField<"u64">; readonly switchboard: ToField<Option<ID>>; readonly pyth: ToField<Option<ID>>
92
+
93
+ private constructor(typeArgs: [], fields: OracleFields, ) { this.$fullTypeName = composeSuiType( Oracle.$typeName, ...typeArgs ) as "0x1d17058789bd1e1e79f1a92424519a88146f191f58a06cc4d9ab23d17d46ab73::oracle::Oracle"; this.$typeArgs = typeArgs;
94
+
95
+ this.id = fields.id;; this.baseToken = fields.baseToken;; this.quoteToken = fields.quoteToken;; this.baseTokenType = fields.baseTokenType;; this.quoteTokenType = fields.quoteTokenType;; this.decimal = fields.decimal;; this.price = fields.price;; this.twapPrice = fields.twapPrice;; this.tsMs = fields.tsMs;; this.epoch = fields.epoch;; this.timeInterval = fields.timeInterval;; this.switchboard = fields.switchboard;; this.pyth = fields.pyth; }
96
+
97
+ static reified( ): OracleReified { return { typeName: Oracle.$typeName, fullTypeName: composeSuiType( Oracle.$typeName, ...[] ) as "0x1d17058789bd1e1e79f1a92424519a88146f191f58a06cc4d9ab23d17d46ab73::oracle::Oracle", typeArgs: [ ] as [], reifiedTypeArgs: [], fromFields: (fields: Record<string, any>) => Oracle.fromFields( fields, ), fromFieldsWithTypes: (item: FieldsWithTypes) => Oracle.fromFieldsWithTypes( item, ), fromBcs: (data: Uint8Array) => Oracle.fromBcs( data, ), bcs: Oracle.bcs, fromJSONField: (field: any) => Oracle.fromJSONField( field, ), fromJSON: (json: Record<string, any>) => Oracle.fromJSON( json, ), fromSuiParsedData: (content: SuiParsedData) => Oracle.fromSuiParsedData( content, ), fetch: async (client: SuiClient, id: string) => Oracle.fetch( client, id, ), new: ( fields: OracleFields, ) => { return new Oracle( [], fields ) }, kind: "StructClassReified", } }
98
+
99
+ static get r() { return Oracle.reified() }
100
+
101
+ static phantom( ): PhantomReified<ToTypeStr<Oracle>> { return phantom(Oracle.reified( )); } static get p() { return Oracle.phantom() }
102
+
103
+ static get bcs() { return bcs.struct("Oracle", {
104
+
105
+ id: UID.bcs, base_token: String.bcs, quote_token: String.bcs, base_token_type: TypeName.bcs, quote_token_type: TypeName.bcs, decimal: bcs.u64(), price: bcs.u64(), twap_price: bcs.u64(), ts_ms: bcs.u64(), epoch: bcs.u64(), time_interval: bcs.u64(), switchboard: Option.bcs(ID.bcs), pyth: Option.bcs(ID.bcs)
106
+
107
+ }) };
108
+
109
+ static fromFields( fields: Record<string, any> ): Oracle { return Oracle.reified( ).new( { id: decodeFromFields(UID.reified(), fields.id), baseToken: decodeFromFields(String.reified(), fields.base_token), quoteToken: decodeFromFields(String.reified(), fields.quote_token), baseTokenType: decodeFromFields(TypeName.reified(), fields.base_token_type), quoteTokenType: decodeFromFields(TypeName.reified(), fields.quote_token_type), decimal: decodeFromFields("u64", fields.decimal), price: decodeFromFields("u64", fields.price), twapPrice: decodeFromFields("u64", fields.twap_price), tsMs: decodeFromFields("u64", fields.ts_ms), epoch: decodeFromFields("u64", fields.epoch), timeInterval: decodeFromFields("u64", fields.time_interval), switchboard: decodeFromFields(Option.reified(ID.reified()), fields.switchboard), pyth: decodeFromFields(Option.reified(ID.reified()), fields.pyth) } ) }
110
+
111
+ static fromFieldsWithTypes( item: FieldsWithTypes ): Oracle { if (!isOracle(item.type)) { throw new Error("not a Oracle type");
112
+
113
+ }
114
+
115
+ return Oracle.reified( ).new( { id: decodeFromFieldsWithTypes(UID.reified(), item.fields.id), baseToken: decodeFromFieldsWithTypes(String.reified(), item.fields.base_token), quoteToken: decodeFromFieldsWithTypes(String.reified(), item.fields.quote_token), baseTokenType: decodeFromFieldsWithTypes(TypeName.reified(), item.fields.base_token_type), quoteTokenType: decodeFromFieldsWithTypes(TypeName.reified(), item.fields.quote_token_type), decimal: decodeFromFieldsWithTypes("u64", item.fields.decimal), price: decodeFromFieldsWithTypes("u64", item.fields.price), twapPrice: decodeFromFieldsWithTypes("u64", item.fields.twap_price), tsMs: decodeFromFieldsWithTypes("u64", item.fields.ts_ms), epoch: decodeFromFieldsWithTypes("u64", item.fields.epoch), timeInterval: decodeFromFieldsWithTypes("u64", item.fields.time_interval), switchboard: decodeFromFieldsWithTypes(Option.reified(ID.reified()), item.fields.switchboard), pyth: decodeFromFieldsWithTypes(Option.reified(ID.reified()), item.fields.pyth) } ) }
116
+
117
+ static fromBcs( data: Uint8Array ): Oracle { return Oracle.fromFields( Oracle.bcs.parse(data) ) }
118
+
119
+ toJSONField() { return {
120
+
121
+ id: this.id,baseToken: this.baseToken,quoteToken: this.quoteToken,baseTokenType: this.baseTokenType.toJSONField(),quoteTokenType: this.quoteTokenType.toJSONField(),decimal: this.decimal.toString(),price: this.price.toString(),twapPrice: this.twapPrice.toString(),tsMs: this.tsMs.toString(),epoch: this.epoch.toString(),timeInterval: this.timeInterval.toString(),switchboard: fieldToJSON<Option<ID>>(`0x1::option::Option<0x2::object::ID>`, this.switchboard),pyth: fieldToJSON<Option<ID>>(`0x1::option::Option<0x2::object::ID>`, this.pyth),
122
+
123
+ } }
124
+
125
+ toJSON() { return { $typeName: this.$typeName, $typeArgs: this.$typeArgs, ...this.toJSONField() } }
126
+
127
+ static fromJSONField( field: any ): Oracle { return Oracle.reified( ).new( { id: decodeFromJSONField(UID.reified(), field.id), baseToken: decodeFromJSONField(String.reified(), field.baseToken), quoteToken: decodeFromJSONField(String.reified(), field.quoteToken), baseTokenType: decodeFromJSONField(TypeName.reified(), field.baseTokenType), quoteTokenType: decodeFromJSONField(TypeName.reified(), field.quoteTokenType), decimal: decodeFromJSONField("u64", field.decimal), price: decodeFromJSONField("u64", field.price), twapPrice: decodeFromJSONField("u64", field.twapPrice), tsMs: decodeFromJSONField("u64", field.tsMs), epoch: decodeFromJSONField("u64", field.epoch), timeInterval: decodeFromJSONField("u64", field.timeInterval), switchboard: decodeFromJSONField(Option.reified(ID.reified()), field.switchboard), pyth: decodeFromJSONField(Option.reified(ID.reified()), field.pyth) } ) }
128
+
129
+ static fromJSON( json: Record<string, any> ): Oracle { if (json.$typeName !== Oracle.$typeName) { throw new Error("not a WithTwoGenerics json object") };
130
+
131
+ return Oracle.fromJSONField( json, ) }
132
+
133
+ static fromSuiParsedData( content: SuiParsedData ): Oracle { if (content.dataType !== "moveObject") { throw new Error("not an object"); } if (!isOracle(content.type)) { throw new Error(`object at ${(content.fields as any).id} is not a Oracle object`); } return Oracle.fromFieldsWithTypes( content ); }
134
+
135
+ static async fetch( client: SuiClient, id: string ): Promise<Oracle> { const res = await client.getObject({ id, options: { showBcs: true, }, }); if (res.error) { throw new Error(`error fetching Oracle object at id ${id}: ${res.error.code}`); } if (res.data?.bcs?.dataType !== "moveObject" || !isOracle(res.data.bcs.type)) { throw new Error(`object at id ${id} is not a Oracle object`); }
136
+ return Oracle.fromBcs( fromB64(res.data.bcs.bcsBytes) ); }
137
+
138
+ }
139
+
140
+ /* ============================== PriceEvent =============================== */
141
+
142
+ export function isPriceEvent(type: string): boolean { type = compressSuiType(type); return type === "0x1d17058789bd1e1e79f1a92424519a88146f191f58a06cc4d9ab23d17d46ab73::oracle::PriceEvent"; }
143
+
144
+ export interface PriceEventFields { id: ToField<ID>; price: ToField<"u64">; tsMs: ToField<"u64"> }
145
+
146
+ export type PriceEventReified = Reified< PriceEvent, PriceEventFields >;
147
+
148
+ export class PriceEvent implements StructClass { static readonly $typeName = "0x1d17058789bd1e1e79f1a92424519a88146f191f58a06cc4d9ab23d17d46ab73::oracle::PriceEvent"; static readonly $numTypeParams = 0;
149
+
150
+ readonly $typeName = PriceEvent.$typeName;
151
+
152
+ readonly $fullTypeName: "0x1d17058789bd1e1e79f1a92424519a88146f191f58a06cc4d9ab23d17d46ab73::oracle::PriceEvent";
153
+
154
+ readonly $typeArgs: [];
155
+
156
+ readonly id: ToField<ID>; readonly price: ToField<"u64">; readonly tsMs: ToField<"u64">
157
+
158
+ private constructor(typeArgs: [], fields: PriceEventFields, ) { this.$fullTypeName = composeSuiType( PriceEvent.$typeName, ...typeArgs ) as "0x1d17058789bd1e1e79f1a92424519a88146f191f58a06cc4d9ab23d17d46ab73::oracle::PriceEvent"; this.$typeArgs = typeArgs;
159
+
160
+ this.id = fields.id;; this.price = fields.price;; this.tsMs = fields.tsMs; }
161
+
162
+ static reified( ): PriceEventReified { return { typeName: PriceEvent.$typeName, fullTypeName: composeSuiType( PriceEvent.$typeName, ...[] ) as "0x1d17058789bd1e1e79f1a92424519a88146f191f58a06cc4d9ab23d17d46ab73::oracle::PriceEvent", typeArgs: [ ] as [], reifiedTypeArgs: [], fromFields: (fields: Record<string, any>) => PriceEvent.fromFields( fields, ), fromFieldsWithTypes: (item: FieldsWithTypes) => PriceEvent.fromFieldsWithTypes( item, ), fromBcs: (data: Uint8Array) => PriceEvent.fromBcs( data, ), bcs: PriceEvent.bcs, fromJSONField: (field: any) => PriceEvent.fromJSONField( field, ), fromJSON: (json: Record<string, any>) => PriceEvent.fromJSON( json, ), fromSuiParsedData: (content: SuiParsedData) => PriceEvent.fromSuiParsedData( content, ), fetch: async (client: SuiClient, id: string) => PriceEvent.fetch( client, id, ), new: ( fields: PriceEventFields, ) => { return new PriceEvent( [], fields ) }, kind: "StructClassReified", } }
163
+
164
+ static get r() { return PriceEvent.reified() }
165
+
166
+ static phantom( ): PhantomReified<ToTypeStr<PriceEvent>> { return phantom(PriceEvent.reified( )); } static get p() { return PriceEvent.phantom() }
167
+
168
+ static get bcs() { return bcs.struct("PriceEvent", {
169
+
170
+ id: ID.bcs, price: bcs.u64(), ts_ms: bcs.u64()
171
+
172
+ }) };
173
+
174
+ static fromFields( fields: Record<string, any> ): PriceEvent { return PriceEvent.reified( ).new( { id: decodeFromFields(ID.reified(), fields.id), price: decodeFromFields("u64", fields.price), tsMs: decodeFromFields("u64", fields.ts_ms) } ) }
175
+
176
+ static fromFieldsWithTypes( item: FieldsWithTypes ): PriceEvent { if (!isPriceEvent(item.type)) { throw new Error("not a PriceEvent type");
177
+
178
+ }
179
+
180
+ return PriceEvent.reified( ).new( { id: decodeFromFieldsWithTypes(ID.reified(), item.fields.id), price: decodeFromFieldsWithTypes("u64", item.fields.price), tsMs: decodeFromFieldsWithTypes("u64", item.fields.ts_ms) } ) }
181
+
182
+ static fromBcs( data: Uint8Array ): PriceEvent { return PriceEvent.fromFields( PriceEvent.bcs.parse(data) ) }
183
+
184
+ toJSONField() { return {
185
+
186
+ id: this.id,price: this.price.toString(),tsMs: this.tsMs.toString(),
187
+
188
+ } }
189
+
190
+ toJSON() { return { $typeName: this.$typeName, $typeArgs: this.$typeArgs, ...this.toJSONField() } }
191
+
192
+ static fromJSONField( field: any ): PriceEvent { return PriceEvent.reified( ).new( { id: decodeFromJSONField(ID.reified(), field.id), price: decodeFromJSONField("u64", field.price), tsMs: decodeFromJSONField("u64", field.tsMs) } ) }
193
+
194
+ static fromJSON( json: Record<string, any> ): PriceEvent { if (json.$typeName !== PriceEvent.$typeName) { throw new Error("not a WithTwoGenerics json object") };
195
+
196
+ return PriceEvent.fromJSONField( json, ) }
197
+
198
+ static fromSuiParsedData( content: SuiParsedData ): PriceEvent { if (content.dataType !== "moveObject") { throw new Error("not an object"); } if (!isPriceEvent(content.type)) { throw new Error(`object at ${(content.fields as any).id} is not a PriceEvent object`); } return PriceEvent.fromFieldsWithTypes( content ); }
199
+
200
+ static async fetch( client: SuiClient, id: string ): Promise<PriceEvent> { const res = await client.getObject({ id, options: { showBcs: true, }, }); if (res.error) { throw new Error(`error fetching PriceEvent object at id ${id}: ${res.error.code}`); } if (res.data?.bcs?.dataType !== "moveObject" || !isPriceEvent(res.data.bcs.type)) { throw new Error(`object at id ${id} is not a PriceEvent object`); }
201
+ return PriceEvent.fromBcs( fromB64(res.data.bcs.bcsBytes) ); }
202
+
203
+ }
@@ -0,0 +1,317 @@
1
+ import {
2
+ PhantomReified,
3
+ Reified,
4
+ StructClass,
5
+ ToField,
6
+ ToTypeStr,
7
+ decodeFromFields,
8
+ decodeFromFieldsWithTypes,
9
+ decodeFromJSONField,
10
+ phantom,
11
+ } from "../../../../_framework/reified";
12
+ import { FieldsWithTypes, composeSuiType, compressSuiType } from "../../../../_framework/util";
13
+ import { ID } from "../../0x2/object/structs";
14
+ import { bcs, fromB64 } from "@mysten/bcs";
15
+ import { SuiClient, SuiParsedData } from "@mysten/sui.js/client";
16
+
17
+ /* ============================== PythPrice =============================== */
18
+
19
+ export function isPythPrice(type: string): boolean {
20
+ type = compressSuiType(type);
21
+ return type === "0x1d17058789bd1e1e79f1a92424519a88146f191f58a06cc4d9ab23d17d46ab73::pyth_parser::PythPrice";
22
+ }
23
+
24
+ export interface PythPriceFields {
25
+ price: ToField<"u64">;
26
+ conf: ToField<"u64">;
27
+ timestamp: ToField<"u64">;
28
+ decimal: ToField<"u64">;
29
+ }
30
+
31
+ export type PythPriceReified = Reified<PythPrice, PythPriceFields>;
32
+
33
+ export class PythPrice implements StructClass {
34
+ static readonly $typeName = "0x1d17058789bd1e1e79f1a92424519a88146f191f58a06cc4d9ab23d17d46ab73::pyth_parser::PythPrice";
35
+ static readonly $numTypeParams = 0;
36
+
37
+ readonly $typeName = PythPrice.$typeName;
38
+
39
+ readonly $fullTypeName: "0x1d17058789bd1e1e79f1a92424519a88146f191f58a06cc4d9ab23d17d46ab73::pyth_parser::PythPrice";
40
+
41
+ readonly $typeArgs: [];
42
+
43
+ readonly price: ToField<"u64">;
44
+ readonly conf: ToField<"u64">;
45
+ readonly timestamp: ToField<"u64">;
46
+ readonly decimal: ToField<"u64">;
47
+
48
+ private constructor(typeArgs: [], fields: PythPriceFields) {
49
+ this.$fullTypeName = composeSuiType(
50
+ PythPrice.$typeName,
51
+ ...typeArgs
52
+ ) as "0x1d17058789bd1e1e79f1a92424519a88146f191f58a06cc4d9ab23d17d46ab73::pyth_parser::PythPrice";
53
+ this.$typeArgs = typeArgs;
54
+
55
+ this.price = fields.price;
56
+ this.conf = fields.conf;
57
+ this.timestamp = fields.timestamp;
58
+ this.decimal = fields.decimal;
59
+ }
60
+
61
+ static reified(): PythPriceReified {
62
+ return {
63
+ typeName: PythPrice.$typeName,
64
+ fullTypeName: composeSuiType(
65
+ PythPrice.$typeName,
66
+ ...[]
67
+ ) as "0x1d17058789bd1e1e79f1a92424519a88146f191f58a06cc4d9ab23d17d46ab73::pyth_parser::PythPrice",
68
+ typeArgs: [] as [],
69
+ reifiedTypeArgs: [],
70
+ fromFields: (fields: Record<string, any>) => PythPrice.fromFields(fields),
71
+ fromFieldsWithTypes: (item: FieldsWithTypes) => PythPrice.fromFieldsWithTypes(item),
72
+ fromBcs: (data: Uint8Array) => PythPrice.fromBcs(data),
73
+ bcs: PythPrice.bcs,
74
+ fromJSONField: (field: any) => PythPrice.fromJSONField(field),
75
+ fromJSON: (json: Record<string, any>) => PythPrice.fromJSON(json),
76
+ fromSuiParsedData: (content: SuiParsedData) => PythPrice.fromSuiParsedData(content),
77
+ fetch: async (client: SuiClient, id: string) => PythPrice.fetch(client, id),
78
+ new: (fields: PythPriceFields) => {
79
+ return new PythPrice([], fields);
80
+ },
81
+ kind: "StructClassReified",
82
+ };
83
+ }
84
+
85
+ static get r() {
86
+ return PythPrice.reified();
87
+ }
88
+
89
+ static phantom(): PhantomReified<ToTypeStr<PythPrice>> {
90
+ return phantom(PythPrice.reified());
91
+ }
92
+ static get p() {
93
+ return PythPrice.phantom();
94
+ }
95
+
96
+ static get bcs() {
97
+ return bcs.struct("PythPrice", {
98
+ price: bcs.u64(),
99
+ conf: bcs.u64(),
100
+ timestamp: bcs.u64(),
101
+ decimal: bcs.u64(),
102
+ });
103
+ }
104
+
105
+ static fromFields(fields: Record<string, any>): PythPrice {
106
+ return PythPrice.reified().new({
107
+ price: decodeFromFields("u64", fields.price),
108
+ conf: decodeFromFields("u64", fields.conf),
109
+ timestamp: decodeFromFields("u64", fields.timestamp),
110
+ decimal: decodeFromFields("u64", fields.decimal),
111
+ });
112
+ }
113
+
114
+ static fromFieldsWithTypes(item: FieldsWithTypes): PythPrice {
115
+ if (!isPythPrice(item.type)) {
116
+ throw new Error("not a PythPrice type");
117
+ }
118
+
119
+ return PythPrice.reified().new({
120
+ price: decodeFromFieldsWithTypes("u64", item.fields.price),
121
+ conf: decodeFromFieldsWithTypes("u64", item.fields.conf),
122
+ timestamp: decodeFromFieldsWithTypes("u64", item.fields.timestamp),
123
+ decimal: decodeFromFieldsWithTypes("u64", item.fields.decimal),
124
+ });
125
+ }
126
+
127
+ static fromBcs(data: Uint8Array): PythPrice {
128
+ return PythPrice.fromFields(PythPrice.bcs.parse(data));
129
+ }
130
+
131
+ toJSONField() {
132
+ return {
133
+ price: this.price.toString(),
134
+ conf: this.conf.toString(),
135
+ timestamp: this.timestamp.toString(),
136
+ decimal: this.decimal.toString(),
137
+ };
138
+ }
139
+
140
+ toJSON() {
141
+ return { $typeName: this.$typeName, $typeArgs: this.$typeArgs, ...this.toJSONField() };
142
+ }
143
+
144
+ static fromJSONField(field: any): PythPrice {
145
+ return PythPrice.reified().new({
146
+ price: decodeFromJSONField("u64", field.price),
147
+ conf: decodeFromJSONField("u64", field.conf),
148
+ timestamp: decodeFromJSONField("u64", field.timestamp),
149
+ decimal: decodeFromJSONField("u64", field.decimal),
150
+ });
151
+ }
152
+
153
+ static fromJSON(json: Record<string, any>): PythPrice {
154
+ if (json.$typeName !== PythPrice.$typeName) {
155
+ throw new Error("not a WithTwoGenerics json object");
156
+ }
157
+
158
+ return PythPrice.fromJSONField(json);
159
+ }
160
+
161
+ static fromSuiParsedData(content: SuiParsedData): PythPrice {
162
+ if (content.dataType !== "moveObject") {
163
+ throw new Error("not an object");
164
+ }
165
+ if (!isPythPrice(content.type)) {
166
+ throw new Error(`object at ${(content.fields as any).id} is not a PythPrice object`);
167
+ }
168
+ return PythPrice.fromFieldsWithTypes(content);
169
+ }
170
+
171
+ static async fetch(client: SuiClient, id: string): Promise<PythPrice> {
172
+ const res = await client.getObject({ id, options: { showBcs: true } });
173
+ if (res.error) {
174
+ throw new Error(`error fetching PythPrice object at id ${id}: ${res.error.code}`);
175
+ }
176
+ if (res.data?.bcs?.dataType !== "moveObject" || !isPythPrice(res.data.bcs.type)) {
177
+ throw new Error(`object at id ${id} is not a PythPrice object`);
178
+ }
179
+ return PythPrice.fromBcs(fromB64(res.data.bcs.bcsBytes));
180
+ }
181
+ }
182
+
183
+ /* ============================== PythPriceInfoObject =============================== */
184
+
185
+ export function isPythPriceInfoObject(type: string): boolean {
186
+ type = compressSuiType(type);
187
+ return type === "0x1d17058789bd1e1e79f1a92424519a88146f191f58a06cc4d9ab23d17d46ab73::pyth_parser::PythPriceInfoObject";
188
+ }
189
+
190
+ export interface PythPriceInfoObjectFields {
191
+ id: ToField<ID>;
192
+ }
193
+
194
+ export type PythPriceInfoObjectReified = Reified<PythPriceInfoObject, PythPriceInfoObjectFields>;
195
+
196
+ export class PythPriceInfoObject implements StructClass {
197
+ static readonly $typeName = "0x1d17058789bd1e1e79f1a92424519a88146f191f58a06cc4d9ab23d17d46ab73::pyth_parser::PythPriceInfoObject";
198
+ static readonly $numTypeParams = 0;
199
+
200
+ readonly $typeName = PythPriceInfoObject.$typeName;
201
+
202
+ readonly $fullTypeName: "0x1d17058789bd1e1e79f1a92424519a88146f191f58a06cc4d9ab23d17d46ab73::pyth_parser::PythPriceInfoObject";
203
+
204
+ readonly $typeArgs: [];
205
+
206
+ readonly id: ToField<ID>;
207
+
208
+ private constructor(typeArgs: [], fields: PythPriceInfoObjectFields) {
209
+ this.$fullTypeName = composeSuiType(
210
+ PythPriceInfoObject.$typeName,
211
+ ...typeArgs
212
+ ) as "0x1d17058789bd1e1e79f1a92424519a88146f191f58a06cc4d9ab23d17d46ab73::pyth_parser::PythPriceInfoObject";
213
+ this.$typeArgs = typeArgs;
214
+
215
+ this.id = fields.id;
216
+ }
217
+
218
+ static reified(): PythPriceInfoObjectReified {
219
+ return {
220
+ typeName: PythPriceInfoObject.$typeName,
221
+ fullTypeName: composeSuiType(
222
+ PythPriceInfoObject.$typeName,
223
+ ...[]
224
+ ) as "0x1d17058789bd1e1e79f1a92424519a88146f191f58a06cc4d9ab23d17d46ab73::pyth_parser::PythPriceInfoObject",
225
+ typeArgs: [] as [],
226
+ reifiedTypeArgs: [],
227
+ fromFields: (fields: Record<string, any>) => PythPriceInfoObject.fromFields(fields),
228
+ fromFieldsWithTypes: (item: FieldsWithTypes) => PythPriceInfoObject.fromFieldsWithTypes(item),
229
+ fromBcs: (data: Uint8Array) => PythPriceInfoObject.fromBcs(data),
230
+ bcs: PythPriceInfoObject.bcs,
231
+ fromJSONField: (field: any) => PythPriceInfoObject.fromJSONField(field),
232
+ fromJSON: (json: Record<string, any>) => PythPriceInfoObject.fromJSON(json),
233
+ fromSuiParsedData: (content: SuiParsedData) => PythPriceInfoObject.fromSuiParsedData(content),
234
+ fetch: async (client: SuiClient, id: string) => PythPriceInfoObject.fetch(client, id),
235
+ new: (fields: PythPriceInfoObjectFields) => {
236
+ return new PythPriceInfoObject([], fields);
237
+ },
238
+ kind: "StructClassReified",
239
+ };
240
+ }
241
+
242
+ static get r() {
243
+ return PythPriceInfoObject.reified();
244
+ }
245
+
246
+ static phantom(): PhantomReified<ToTypeStr<PythPriceInfoObject>> {
247
+ return phantom(PythPriceInfoObject.reified());
248
+ }
249
+ static get p() {
250
+ return PythPriceInfoObject.phantom();
251
+ }
252
+
253
+ static get bcs() {
254
+ return bcs.struct("PythPriceInfoObject", {
255
+ id: ID.bcs,
256
+ });
257
+ }
258
+
259
+ static fromFields(fields: Record<string, any>): PythPriceInfoObject {
260
+ return PythPriceInfoObject.reified().new({ id: decodeFromFields(ID.reified(), fields.id) });
261
+ }
262
+
263
+ static fromFieldsWithTypes(item: FieldsWithTypes): PythPriceInfoObject {
264
+ if (!isPythPriceInfoObject(item.type)) {
265
+ throw new Error("not a PythPriceInfoObject type");
266
+ }
267
+
268
+ return PythPriceInfoObject.reified().new({ id: decodeFromFieldsWithTypes(ID.reified(), item.fields.id) });
269
+ }
270
+
271
+ static fromBcs(data: Uint8Array): PythPriceInfoObject {
272
+ return PythPriceInfoObject.fromFields(PythPriceInfoObject.bcs.parse(data));
273
+ }
274
+
275
+ toJSONField() {
276
+ return {
277
+ id: this.id,
278
+ };
279
+ }
280
+
281
+ toJSON() {
282
+ return { $typeName: this.$typeName, $typeArgs: this.$typeArgs, ...this.toJSONField() };
283
+ }
284
+
285
+ static fromJSONField(field: any): PythPriceInfoObject {
286
+ return PythPriceInfoObject.reified().new({ id: decodeFromJSONField(ID.reified(), field.id) });
287
+ }
288
+
289
+ static fromJSON(json: Record<string, any>): PythPriceInfoObject {
290
+ if (json.$typeName !== PythPriceInfoObject.$typeName) {
291
+ throw new Error("not a WithTwoGenerics json object");
292
+ }
293
+
294
+ return PythPriceInfoObject.fromJSONField(json);
295
+ }
296
+
297
+ static fromSuiParsedData(content: SuiParsedData): PythPriceInfoObject {
298
+ if (content.dataType !== "moveObject") {
299
+ throw new Error("not an object");
300
+ }
301
+ if (!isPythPriceInfoObject(content.type)) {
302
+ throw new Error(`object at ${(content.fields as any).id} is not a PythPriceInfoObject object`);
303
+ }
304
+ return PythPriceInfoObject.fromFieldsWithTypes(content);
305
+ }
306
+
307
+ static async fetch(client: SuiClient, id: string): Promise<PythPriceInfoObject> {
308
+ const res = await client.getObject({ id, options: { showBcs: true } });
309
+ if (res.error) {
310
+ throw new Error(`error fetching PythPriceInfoObject object at id ${id}: ${res.error.code}`);
311
+ }
312
+ if (res.data?.bcs?.dataType !== "moveObject" || !isPythPriceInfoObject(res.data.bcs.type)) {
313
+ throw new Error(`object at id ${id} is not a PythPriceInfoObject object`);
314
+ }
315
+ return PythPriceInfoObject.fromBcs(fromB64(res.data.bcs.bcsBytes));
316
+ }
317
+ }
@@ -0,0 +1,69 @@
1
+ import {PhantomReified, Reified, StructClass, ToField, ToTypeStr, decodeFromFields, decodeFromFieldsWithTypes, decodeFromJSONField, phantom} from "../../../../_framework/reified";
2
+ import {FieldsWithTypes, composeSuiType, compressSuiType} from "../../../../_framework/util";
3
+ import {bcs, fromB64} from "@mysten/bcs";
4
+ import {SuiClient, SuiParsedData} from "@mysten/sui.js/client";
5
+
6
+ /* ============================== SupraPrice =============================== */
7
+
8
+ export function isSupraPrice(type: string): boolean { type = compressSuiType(type); return type === "0x6b5aa33a21d8b5cafbe8cff4dcb0d19909abc91ef289dc9a0b6d90f8fd1152d4::supra::SupraPrice"; }
9
+
10
+ export interface SupraPriceFields { pair: ToField<"u32">; price: ToField<"u128">; decimal: ToField<"u16">; timestamp: ToField<"u128">; round: ToField<"u64"> }
11
+
12
+ export type SupraPriceReified = Reified< SupraPrice, SupraPriceFields >;
13
+
14
+ export class SupraPrice implements StructClass { static readonly $typeName = "0x6b5aa33a21d8b5cafbe8cff4dcb0d19909abc91ef289dc9a0b6d90f8fd1152d4::supra::SupraPrice"; static readonly $numTypeParams = 0;
15
+
16
+ readonly $typeName = SupraPrice.$typeName;
17
+
18
+ readonly $fullTypeName: "0x6b5aa33a21d8b5cafbe8cff4dcb0d19909abc91ef289dc9a0b6d90f8fd1152d4::supra::SupraPrice";
19
+
20
+ readonly $typeArgs: [];
21
+
22
+ readonly pair: ToField<"u32">; readonly price: ToField<"u128">; readonly decimal: ToField<"u16">; readonly timestamp: ToField<"u128">; readonly round: ToField<"u64">
23
+
24
+ private constructor(typeArgs: [], fields: SupraPriceFields, ) { this.$fullTypeName = composeSuiType( SupraPrice.$typeName, ...typeArgs ) as "0x6b5aa33a21d8b5cafbe8cff4dcb0d19909abc91ef289dc9a0b6d90f8fd1152d4::supra::SupraPrice"; this.$typeArgs = typeArgs;
25
+
26
+ this.pair = fields.pair;; this.price = fields.price;; this.decimal = fields.decimal;; this.timestamp = fields.timestamp;; this.round = fields.round; }
27
+
28
+ static reified( ): SupraPriceReified { return { typeName: SupraPrice.$typeName, fullTypeName: composeSuiType( SupraPrice.$typeName, ...[] ) as "0x6b5aa33a21d8b5cafbe8cff4dcb0d19909abc91ef289dc9a0b6d90f8fd1152d4::supra::SupraPrice", typeArgs: [ ] as [], reifiedTypeArgs: [], fromFields: (fields: Record<string, any>) => SupraPrice.fromFields( fields, ), fromFieldsWithTypes: (item: FieldsWithTypes) => SupraPrice.fromFieldsWithTypes( item, ), fromBcs: (data: Uint8Array) => SupraPrice.fromBcs( data, ), bcs: SupraPrice.bcs, fromJSONField: (field: any) => SupraPrice.fromJSONField( field, ), fromJSON: (json: Record<string, any>) => SupraPrice.fromJSON( json, ), fromSuiParsedData: (content: SuiParsedData) => SupraPrice.fromSuiParsedData( content, ), fetch: async (client: SuiClient, id: string) => SupraPrice.fetch( client, id, ), new: ( fields: SupraPriceFields, ) => { return new SupraPrice( [], fields ) }, kind: "StructClassReified", } }
29
+
30
+ static get r() { return SupraPrice.reified() }
31
+
32
+ static phantom( ): PhantomReified<ToTypeStr<SupraPrice>> { return phantom(SupraPrice.reified( )); } static get p() { return SupraPrice.phantom() }
33
+
34
+ static get bcs() { return bcs.struct("SupraPrice", {
35
+
36
+ pair: bcs.u32(), price: bcs.u128(), decimal: bcs.u16(), timestamp: bcs.u128(), round: bcs.u64()
37
+
38
+ }) };
39
+
40
+ static fromFields( fields: Record<string, any> ): SupraPrice { return SupraPrice.reified( ).new( { pair: decodeFromFields("u32", fields.pair), price: decodeFromFields("u128", fields.price), decimal: decodeFromFields("u16", fields.decimal), timestamp: decodeFromFields("u128", fields.timestamp), round: decodeFromFields("u64", fields.round) } ) }
41
+
42
+ static fromFieldsWithTypes( item: FieldsWithTypes ): SupraPrice { if (!isSupraPrice(item.type)) { throw new Error("not a SupraPrice type");
43
+
44
+ }
45
+
46
+ return SupraPrice.reified( ).new( { pair: decodeFromFieldsWithTypes("u32", item.fields.pair), price: decodeFromFieldsWithTypes("u128", item.fields.price), decimal: decodeFromFieldsWithTypes("u16", item.fields.decimal), timestamp: decodeFromFieldsWithTypes("u128", item.fields.timestamp), round: decodeFromFieldsWithTypes("u64", item.fields.round) } ) }
47
+
48
+ static fromBcs( data: Uint8Array ): SupraPrice { return SupraPrice.fromFields( SupraPrice.bcs.parse(data) ) }
49
+
50
+ toJSONField() { return {
51
+
52
+ pair: this.pair,price: this.price.toString(),decimal: this.decimal,timestamp: this.timestamp.toString(),round: this.round.toString(),
53
+
54
+ } }
55
+
56
+ toJSON() { return { $typeName: this.$typeName, $typeArgs: this.$typeArgs, ...this.toJSONField() } }
57
+
58
+ static fromJSONField( field: any ): SupraPrice { return SupraPrice.reified( ).new( { pair: decodeFromJSONField("u32", field.pair), price: decodeFromJSONField("u128", field.price), decimal: decodeFromJSONField("u16", field.decimal), timestamp: decodeFromJSONField("u128", field.timestamp), round: decodeFromJSONField("u64", field.round) } ) }
59
+
60
+ static fromJSON( json: Record<string, any> ): SupraPrice { if (json.$typeName !== SupraPrice.$typeName) { throw new Error("not a WithTwoGenerics json object") };
61
+
62
+ return SupraPrice.fromJSONField( json, ) }
63
+
64
+ static fromSuiParsedData( content: SuiParsedData ): SupraPrice { if (content.dataType !== "moveObject") { throw new Error("not an object"); } if (!isSupraPrice(content.type)) { throw new Error(`object at ${(content.fields as any).id} is not a SupraPrice object`); } return SupraPrice.fromFieldsWithTypes( content ); }
65
+
66
+ static async fetch( client: SuiClient, id: string ): Promise<SupraPrice> { const res = await client.getObject({ id, options: { showBcs: true, }, }); if (res.error) { throw new Error(`error fetching SupraPrice object at id ${id}: ${res.error.code}`); } if (res.data?.bcs?.dataType !== "moveObject" || !isSupraPrice(res.data.bcs.type)) { throw new Error(`object at id ${id} is not a SupraPrice object`); }
67
+ return SupraPrice.fromBcs( fromB64(res.data.bcs.bcsBytes) ); }
68
+
69
+ }