@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
package/package.json CHANGED
@@ -2,7 +2,7 @@
2
2
  "name": "@typus/typus-sdk",
3
3
  "author": "Typus",
4
4
  "description": "typus sdk",
5
- "version": "1.4.3-c",
5
+ "version": "1.4.3-e",
6
6
  "dependencies": {
7
7
  "@mysten/bcs": "^0.11.1",
8
8
  "@mysten/kiosk": "0.8.10",
@@ -77,8 +77,16 @@
77
77
  },
78
78
  "main": "dist/src/index.js",
79
79
  "files": [
80
- "dist"
80
+ "dist",
81
+ "src"
81
82
  ],
83
+ "exports": {
84
+ ".": {
85
+ "source": "./src/index.d.ts",
86
+ "require": "./dist/index.js",
87
+ "default": "./dist/index.js"
88
+ }
89
+ },
82
90
  "types": "dist/src/index.d.ts",
83
91
  "scripts": {
84
92
  "ts-node": "ts-node -r tsconfig-paths/register",
@@ -0,0 +1,135 @@
1
+ import * as reified from "../../../../_framework/reified";
2
+ import {PhantomReified, Reified, StructClass, ToField, ToTypeStr, Vector, decodeFromFields, decodeFromFieldsWithTypes, decodeFromJSONField, fieldToJSON, phantom} from "../../../../_framework/reified";
3
+ import {FieldsWithTypes, composeSuiType, compressSuiType} from "../../../../_framework/util";
4
+ import {bcs, fromB64} from "@mysten/bcs";
5
+ import {SuiClient, SuiParsedData} from "@mysten/sui.js/client";
6
+
7
+ /* ============================== Char =============================== */
8
+
9
+ export function isChar(type: string): boolean { type = compressSuiType(type); return type === "0x1::ascii::Char"; }
10
+
11
+ export interface CharFields { byte: ToField<"u8"> }
12
+
13
+ export type CharReified = Reified< Char, CharFields >;
14
+
15
+ export class Char implements StructClass { static readonly $typeName = "0x1::ascii::Char"; static readonly $numTypeParams = 0;
16
+
17
+ readonly $typeName = Char.$typeName;
18
+
19
+ readonly $fullTypeName: "0x1::ascii::Char";
20
+
21
+ readonly $typeArgs: [];
22
+
23
+ readonly byte: ToField<"u8">
24
+
25
+ private constructor(typeArgs: [], fields: CharFields, ) { this.$fullTypeName = composeSuiType( Char.$typeName, ...typeArgs ) as "0x1::ascii::Char"; this.$typeArgs = typeArgs;
26
+
27
+ this.byte = fields.byte; }
28
+
29
+ static reified( ): CharReified { return { typeName: Char.$typeName, fullTypeName: composeSuiType( Char.$typeName, ...[] ) as "0x1::ascii::Char", typeArgs: [ ] as [], reifiedTypeArgs: [], fromFields: (fields: Record<string, any>) => Char.fromFields( fields, ), fromFieldsWithTypes: (item: FieldsWithTypes) => Char.fromFieldsWithTypes( item, ), fromBcs: (data: Uint8Array) => Char.fromBcs( data, ), bcs: Char.bcs, fromJSONField: (field: any) => Char.fromJSONField( field, ), fromJSON: (json: Record<string, any>) => Char.fromJSON( json, ), fromSuiParsedData: (content: SuiParsedData) => Char.fromSuiParsedData( content, ), fetch: async (client: SuiClient, id: string) => Char.fetch( client, id, ), new: ( fields: CharFields, ) => { return new Char( [], fields ) }, kind: "StructClassReified", } }
30
+
31
+ static get r() { return Char.reified() }
32
+
33
+ static phantom( ): PhantomReified<ToTypeStr<Char>> { return phantom(Char.reified( )); } static get p() { return Char.phantom() }
34
+
35
+ static get bcs() { return bcs.struct("Char", {
36
+
37
+ byte: bcs.u8()
38
+
39
+ }) };
40
+
41
+ static fromFields( fields: Record<string, any> ): Char { return Char.reified( ).new( { byte: decodeFromFields("u8", fields.byte) } ) }
42
+
43
+ static fromFieldsWithTypes( item: FieldsWithTypes ): Char { if (!isChar(item.type)) { throw new Error("not a Char type");
44
+
45
+ }
46
+
47
+ return Char.reified( ).new( { byte: decodeFromFieldsWithTypes("u8", item.fields.byte) } ) }
48
+
49
+ static fromBcs( data: Uint8Array ): Char { return Char.fromFields( Char.bcs.parse(data) ) }
50
+
51
+ toJSONField() { return {
52
+
53
+ byte: this.byte,
54
+
55
+ } }
56
+
57
+ toJSON() { return { $typeName: this.$typeName, $typeArgs: this.$typeArgs, ...this.toJSONField() } }
58
+
59
+ static fromJSONField( field: any ): Char { return Char.reified( ).new( { byte: decodeFromJSONField("u8", field.byte) } ) }
60
+
61
+ static fromJSON( json: Record<string, any> ): Char { if (json.$typeName !== Char.$typeName) { throw new Error("not a WithTwoGenerics json object") };
62
+
63
+ return Char.fromJSONField( json, ) }
64
+
65
+ static fromSuiParsedData( content: SuiParsedData ): Char { if (content.dataType !== "moveObject") { throw new Error("not an object"); } if (!isChar(content.type)) { throw new Error(`object at ${(content.fields as any).id} is not a Char object`); } return Char.fromFieldsWithTypes( content ); }
66
+
67
+ static async fetch( client: SuiClient, id: string ): Promise<Char> { const res = await client.getObject({ id, options: { showBcs: true, }, }); if (res.error) { throw new Error(`error fetching Char object at id ${id}: ${res.error.code}`); } if (res.data?.bcs?.dataType !== "moveObject" || !isChar(res.data.bcs.type)) { throw new Error(`object at id ${id} is not a Char object`); }
68
+ return Char.fromBcs( fromB64(res.data.bcs.bcsBytes) ); }
69
+
70
+ }
71
+
72
+ /* ============================== String =============================== */
73
+
74
+ export function isString(type: string): boolean { type = compressSuiType(type); return type === "0x1::ascii::String"; }
75
+
76
+ export interface StringFields { bytes: ToField<Vector<"u8">> }
77
+
78
+ export type StringReified = Reified< String, StringFields >;
79
+
80
+ export class String implements StructClass { static readonly $typeName = "0x1::ascii::String"; static readonly $numTypeParams = 0;
81
+
82
+ readonly $typeName = String.$typeName;
83
+
84
+ readonly $fullTypeName: "0x1::ascii::String";
85
+
86
+ readonly $typeArgs: [];
87
+
88
+ readonly bytes: ToField<Vector<"u8">>
89
+
90
+ private constructor(typeArgs: [], fields: StringFields, ) { this.$fullTypeName = composeSuiType( String.$typeName, ...typeArgs ) as "0x1::ascii::String"; this.$typeArgs = typeArgs;
91
+
92
+ this.bytes = fields.bytes; }
93
+
94
+ static reified( ): StringReified { return { typeName: String.$typeName, fullTypeName: composeSuiType( String.$typeName, ...[] ) as "0x1::ascii::String", typeArgs: [ ] as [], reifiedTypeArgs: [], fromFields: (fields: Record<string, any>) => String.fromFields( fields, ), fromFieldsWithTypes: (item: FieldsWithTypes) => String.fromFieldsWithTypes( item, ), fromBcs: (data: Uint8Array) => String.fromBcs( data, ), bcs: String.bcs, fromJSONField: (field: any) => String.fromJSONField( field, ), fromJSON: (json: Record<string, any>) => String.fromJSON( json, ), fromSuiParsedData: (content: SuiParsedData) => String.fromSuiParsedData( content, ), fetch: async (client: SuiClient, id: string) => String.fetch( client, id, ), new: ( fields: StringFields, ) => { return new String( [], fields ) }, kind: "StructClassReified", } }
95
+
96
+ static get r() { return String.reified() }
97
+
98
+ static phantom( ): PhantomReified<ToTypeStr<String>> { return phantom(String.reified( )); } static get p() { return String.phantom() }
99
+
100
+ static get bcs() { return bcs.struct("String", {
101
+
102
+ bytes: bcs.vector(bcs.u8())
103
+
104
+ }) };
105
+
106
+ static fromFields( fields: Record<string, any> ): String { return String.reified( ).new( { bytes: decodeFromFields(reified.vector("u8"), fields.bytes) } ) }
107
+
108
+ static fromFieldsWithTypes( item: FieldsWithTypes ): String { if (!isString(item.type)) { throw new Error("not a String type");
109
+
110
+ }
111
+
112
+ return String.reified( ).new( { bytes: decodeFromFieldsWithTypes(reified.vector("u8"), item.fields.bytes) } ) }
113
+
114
+ static fromBcs( data: Uint8Array ): String { return String.fromFields( String.bcs.parse(data) ) }
115
+
116
+ toJSONField() { return {
117
+
118
+ bytes: fieldToJSON<Vector<"u8">>(`vector<u8>`, this.bytes),
119
+
120
+ } }
121
+
122
+ toJSON() { return { $typeName: this.$typeName, $typeArgs: this.$typeArgs, ...this.toJSONField() } }
123
+
124
+ static fromJSONField( field: any ): String { return String.reified( ).new( { bytes: decodeFromJSONField(reified.vector("u8"), field.bytes) } ) }
125
+
126
+ static fromJSON( json: Record<string, any> ): String { if (json.$typeName !== String.$typeName) { throw new Error("not a WithTwoGenerics json object") };
127
+
128
+ return String.fromJSONField( json, ) }
129
+
130
+ static fromSuiParsedData( content: SuiParsedData ): String { if (content.dataType !== "moveObject") { throw new Error("not an object"); } if (!isString(content.type)) { throw new Error(`object at ${(content.fields as any).id} is not a String object`); } return String.fromFieldsWithTypes( content ); }
131
+
132
+ static async fetch( client: SuiClient, id: string ): Promise<String> { const res = await client.getObject({ id, options: { showBcs: true, }, }); if (res.error) { throw new Error(`error fetching String object at id ${id}: ${res.error.code}`); } if (res.data?.bcs?.dataType !== "moveObject" || !isString(res.data.bcs.type)) { throw new Error(`object at id ${id} is not a String object`); }
133
+ return String.fromBcs( fromB64(res.data.bcs.bcsBytes) ); }
134
+
135
+ }
@@ -0,0 +1,70 @@
1
+ import * as reified from "../../../../_framework/reified";
2
+ import {PhantomReified, Reified, StructClass, ToField, ToTypeStr, Vector, decodeFromFields, decodeFromFieldsWithTypes, decodeFromJSONField, fieldToJSON, phantom} from "../../../../_framework/reified";
3
+ import {FieldsWithTypes, composeSuiType, compressSuiType} from "../../../../_framework/util";
4
+ import {bcs, fromB64} from "@mysten/bcs";
5
+ import {SuiClient, SuiParsedData} from "@mysten/sui.js/client";
6
+
7
+ /* ============================== BitVector =============================== */
8
+
9
+ export function isBitVector(type: string): boolean { type = compressSuiType(type); return type === "0x1::bit_vector::BitVector"; }
10
+
11
+ export interface BitVectorFields { length: ToField<"u64">; bitField: ToField<Vector<"bool">> }
12
+
13
+ export type BitVectorReified = Reified< BitVector, BitVectorFields >;
14
+
15
+ export class BitVector implements StructClass { static readonly $typeName = "0x1::bit_vector::BitVector"; static readonly $numTypeParams = 0;
16
+
17
+ readonly $typeName = BitVector.$typeName;
18
+
19
+ readonly $fullTypeName: "0x1::bit_vector::BitVector";
20
+
21
+ readonly $typeArgs: [];
22
+
23
+ readonly length: ToField<"u64">; readonly bitField: ToField<Vector<"bool">>
24
+
25
+ private constructor(typeArgs: [], fields: BitVectorFields, ) { this.$fullTypeName = composeSuiType( BitVector.$typeName, ...typeArgs ) as "0x1::bit_vector::BitVector"; this.$typeArgs = typeArgs;
26
+
27
+ this.length = fields.length;; this.bitField = fields.bitField; }
28
+
29
+ static reified( ): BitVectorReified { return { typeName: BitVector.$typeName, fullTypeName: composeSuiType( BitVector.$typeName, ...[] ) as "0x1::bit_vector::BitVector", typeArgs: [ ] as [], reifiedTypeArgs: [], fromFields: (fields: Record<string, any>) => BitVector.fromFields( fields, ), fromFieldsWithTypes: (item: FieldsWithTypes) => BitVector.fromFieldsWithTypes( item, ), fromBcs: (data: Uint8Array) => BitVector.fromBcs( data, ), bcs: BitVector.bcs, fromJSONField: (field: any) => BitVector.fromJSONField( field, ), fromJSON: (json: Record<string, any>) => BitVector.fromJSON( json, ), fromSuiParsedData: (content: SuiParsedData) => BitVector.fromSuiParsedData( content, ), fetch: async (client: SuiClient, id: string) => BitVector.fetch( client, id, ), new: ( fields: BitVectorFields, ) => { return new BitVector( [], fields ) }, kind: "StructClassReified", } }
30
+
31
+ static get r() { return BitVector.reified() }
32
+
33
+ static phantom( ): PhantomReified<ToTypeStr<BitVector>> { return phantom(BitVector.reified( )); } static get p() { return BitVector.phantom() }
34
+
35
+ static get bcs() { return bcs.struct("BitVector", {
36
+
37
+ length: bcs.u64(), bit_field: bcs.vector(bcs.bool())
38
+
39
+ }) };
40
+
41
+ static fromFields( fields: Record<string, any> ): BitVector { return BitVector.reified( ).new( { length: decodeFromFields("u64", fields.length), bitField: decodeFromFields(reified.vector("bool"), fields.bit_field) } ) }
42
+
43
+ static fromFieldsWithTypes( item: FieldsWithTypes ): BitVector { if (!isBitVector(item.type)) { throw new Error("not a BitVector type");
44
+
45
+ }
46
+
47
+ return BitVector.reified( ).new( { length: decodeFromFieldsWithTypes("u64", item.fields.length), bitField: decodeFromFieldsWithTypes(reified.vector("bool"), item.fields.bit_field) } ) }
48
+
49
+ static fromBcs( data: Uint8Array ): BitVector { return BitVector.fromFields( BitVector.bcs.parse(data) ) }
50
+
51
+ toJSONField() { return {
52
+
53
+ length: this.length.toString(),bitField: fieldToJSON<Vector<"bool">>(`vector<bool>`, this.bitField),
54
+
55
+ } }
56
+
57
+ toJSON() { return { $typeName: this.$typeName, $typeArgs: this.$typeArgs, ...this.toJSONField() } }
58
+
59
+ static fromJSONField( field: any ): BitVector { return BitVector.reified( ).new( { length: decodeFromJSONField("u64", field.length), bitField: decodeFromJSONField(reified.vector("bool"), field.bitField) } ) }
60
+
61
+ static fromJSON( json: Record<string, any> ): BitVector { if (json.$typeName !== BitVector.$typeName) { throw new Error("not a WithTwoGenerics json object") };
62
+
63
+ return BitVector.fromJSONField( json, ) }
64
+
65
+ static fromSuiParsedData( content: SuiParsedData ): BitVector { if (content.dataType !== "moveObject") { throw new Error("not an object"); } if (!isBitVector(content.type)) { throw new Error(`object at ${(content.fields as any).id} is not a BitVector object`); } return BitVector.fromFieldsWithTypes( content ); }
66
+
67
+ static async fetch( client: SuiClient, id: string ): Promise<BitVector> { const res = await client.getObject({ id, options: { showBcs: true, }, }); if (res.error) { throw new Error(`error fetching BitVector object at id ${id}: ${res.error.code}`); } if (res.data?.bcs?.dataType !== "moveObject" || !isBitVector(res.data.bcs.type)) { throw new Error(`object at id ${id} is not a BitVector object`); }
68
+ return BitVector.fromBcs( fromB64(res.data.bcs.bcsBytes) ); }
69
+
70
+ }
@@ -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
+ /* ============================== FixedPoint32 =============================== */
7
+
8
+ export function isFixedPoint32(type: string): boolean { type = compressSuiType(type); return type === "0x1::fixed_point32::FixedPoint32"; }
9
+
10
+ export interface FixedPoint32Fields { value: ToField<"u64"> }
11
+
12
+ export type FixedPoint32Reified = Reified< FixedPoint32, FixedPoint32Fields >;
13
+
14
+ export class FixedPoint32 implements StructClass { static readonly $typeName = "0x1::fixed_point32::FixedPoint32"; static readonly $numTypeParams = 0;
15
+
16
+ readonly $typeName = FixedPoint32.$typeName;
17
+
18
+ readonly $fullTypeName: "0x1::fixed_point32::FixedPoint32";
19
+
20
+ readonly $typeArgs: [];
21
+
22
+ readonly value: ToField<"u64">
23
+
24
+ private constructor(typeArgs: [], fields: FixedPoint32Fields, ) { this.$fullTypeName = composeSuiType( FixedPoint32.$typeName, ...typeArgs ) as "0x1::fixed_point32::FixedPoint32"; this.$typeArgs = typeArgs;
25
+
26
+ this.value = fields.value; }
27
+
28
+ static reified( ): FixedPoint32Reified { return { typeName: FixedPoint32.$typeName, fullTypeName: composeSuiType( FixedPoint32.$typeName, ...[] ) as "0x1::fixed_point32::FixedPoint32", typeArgs: [ ] as [], reifiedTypeArgs: [], fromFields: (fields: Record<string, any>) => FixedPoint32.fromFields( fields, ), fromFieldsWithTypes: (item: FieldsWithTypes) => FixedPoint32.fromFieldsWithTypes( item, ), fromBcs: (data: Uint8Array) => FixedPoint32.fromBcs( data, ), bcs: FixedPoint32.bcs, fromJSONField: (field: any) => FixedPoint32.fromJSONField( field, ), fromJSON: (json: Record<string, any>) => FixedPoint32.fromJSON( json, ), fromSuiParsedData: (content: SuiParsedData) => FixedPoint32.fromSuiParsedData( content, ), fetch: async (client: SuiClient, id: string) => FixedPoint32.fetch( client, id, ), new: ( fields: FixedPoint32Fields, ) => { return new FixedPoint32( [], fields ) }, kind: "StructClassReified", } }
29
+
30
+ static get r() { return FixedPoint32.reified() }
31
+
32
+ static phantom( ): PhantomReified<ToTypeStr<FixedPoint32>> { return phantom(FixedPoint32.reified( )); } static get p() { return FixedPoint32.phantom() }
33
+
34
+ static get bcs() { return bcs.struct("FixedPoint32", {
35
+
36
+ value: bcs.u64()
37
+
38
+ }) };
39
+
40
+ static fromFields( fields: Record<string, any> ): FixedPoint32 { return FixedPoint32.reified( ).new( { value: decodeFromFields("u64", fields.value) } ) }
41
+
42
+ static fromFieldsWithTypes( item: FieldsWithTypes ): FixedPoint32 { if (!isFixedPoint32(item.type)) { throw new Error("not a FixedPoint32 type");
43
+
44
+ }
45
+
46
+ return FixedPoint32.reified( ).new( { value: decodeFromFieldsWithTypes("u64", item.fields.value) } ) }
47
+
48
+ static fromBcs( data: Uint8Array ): FixedPoint32 { return FixedPoint32.fromFields( FixedPoint32.bcs.parse(data) ) }
49
+
50
+ toJSONField() { return {
51
+
52
+ value: this.value.toString(),
53
+
54
+ } }
55
+
56
+ toJSON() { return { $typeName: this.$typeName, $typeArgs: this.$typeArgs, ...this.toJSONField() } }
57
+
58
+ static fromJSONField( field: any ): FixedPoint32 { return FixedPoint32.reified( ).new( { value: decodeFromJSONField("u64", field.value) } ) }
59
+
60
+ static fromJSON( json: Record<string, any> ): FixedPoint32 { if (json.$typeName !== FixedPoint32.$typeName) { throw new Error("not a WithTwoGenerics json object") };
61
+
62
+ return FixedPoint32.fromJSONField( json, ) }
63
+
64
+ static fromSuiParsedData( content: SuiParsedData ): FixedPoint32 { if (content.dataType !== "moveObject") { throw new Error("not an object"); } if (!isFixedPoint32(content.type)) { throw new Error(`object at ${(content.fields as any).id} is not a FixedPoint32 object`); } return FixedPoint32.fromFieldsWithTypes( content ); }
65
+
66
+ static async fetch( client: SuiClient, id: string ): Promise<FixedPoint32> { const res = await client.getObject({ id, options: { showBcs: true, }, }); if (res.error) { throw new Error(`error fetching FixedPoint32 object at id ${id}: ${res.error.code}`); } if (res.data?.bcs?.dataType !== "moveObject" || !isFixedPoint32(res.data.bcs.type)) { throw new Error(`object at id ${id} is not a FixedPoint32 object`); }
67
+ return FixedPoint32.fromBcs( fromB64(res.data.bcs.bcsBytes) ); }
68
+
69
+ }
@@ -0,0 +1 @@
1
+ export const PACKAGE_ID = "0x1"; export const PUBLISHED_AT = "0x1";
@@ -0,0 +1,16 @@
1
+ import * as ascii from "./ascii/structs";
2
+ import * as bitVector from "./bit-vector/structs";
3
+ import * as fixedPoint32 from "./fixed-point32/structs";
4
+ import * as option from "./option/structs";
5
+ import * as string from "./string/structs";
6
+ import * as typeName from "./type-name/structs";
7
+ import {StructClassLoader} from "../../../_framework/loader";
8
+
9
+ export function registerClasses(loader: StructClassLoader) { loader.register(fixedPoint32.FixedPoint32);
10
+ loader.register(option.Option);
11
+ loader.register(ascii.Char);
12
+ loader.register(ascii.String);
13
+ loader.register(bitVector.BitVector);
14
+ loader.register(string.String);
15
+ loader.register(typeName.TypeName);
16
+ }
@@ -0,0 +1,74 @@
1
+ import * as reified from "../../../../_framework/reified";
2
+ import {PhantomReified, Reified, StructClass, ToField, ToTypeArgument, ToTypeStr, TypeArgument, Vector, assertFieldsWithTypesArgsMatch, assertReifiedTypeArgsMatch, decodeFromFields, decodeFromFieldsWithTypes, decodeFromJSONField, extractType, fieldToJSON, phantom, toBcs} from "../../../../_framework/reified";
3
+ import {FieldsWithTypes, composeSuiType, compressSuiType} from "../../../../_framework/util";
4
+ import {BcsType, bcs, fromB64} from "@mysten/bcs";
5
+ import {SuiClient, SuiParsedData} from "@mysten/sui.js/client";
6
+
7
+ /* ============================== Option =============================== */
8
+
9
+ export function isOption(type: string): boolean { type = compressSuiType(type); return type.startsWith("0x1::option::Option<"); }
10
+
11
+ export interface OptionFields<Element extends TypeArgument> { vec: ToField<Vector<Element>> }
12
+
13
+ export type OptionReified<Element extends TypeArgument> = Reified< Option<Element>, OptionFields<Element> >;
14
+
15
+ export class Option<Element extends TypeArgument> implements StructClass { static readonly $typeName = "0x1::option::Option"; static readonly $numTypeParams = 1;
16
+
17
+ __inner: Element = null as unknown as Element; // for type checking in reified.ts
18
+
19
+ ; readonly $typeName = Option.$typeName;
20
+
21
+ readonly $fullTypeName: `0x1::option::Option<${ToTypeStr<Element>}>`;
22
+
23
+ readonly $typeArgs: [ToTypeStr<Element>];
24
+
25
+ readonly vec: ToField<Vector<Element>>
26
+
27
+ private constructor(typeArgs: [ToTypeStr<Element>], fields: OptionFields<Element>, ) { this.$fullTypeName = composeSuiType( Option.$typeName, ...typeArgs ) as `0x1::option::Option<${ToTypeStr<Element>}>`; this.$typeArgs = typeArgs;
28
+
29
+ this.vec = fields.vec; }
30
+
31
+ static reified<Element extends Reified<TypeArgument, any>>( Element: Element ): OptionReified<ToTypeArgument<Element>> { return { typeName: Option.$typeName, fullTypeName: composeSuiType( Option.$typeName, ...[extractType(Element)] ) as `0x1::option::Option<${ToTypeStr<ToTypeArgument<Element>>}>`, typeArgs: [ extractType(Element) ] as [ToTypeStr<ToTypeArgument<Element>>], reifiedTypeArgs: [Element], fromFields: (fields: Record<string, any>) => Option.fromFields( Element, fields, ), fromFieldsWithTypes: (item: FieldsWithTypes) => Option.fromFieldsWithTypes( Element, item, ), fromBcs: (data: Uint8Array) => Option.fromBcs( Element, data, ), bcs: Option.bcs(toBcs(Element)), fromJSONField: (field: any) => Option.fromJSONField( Element, field, ), fromJSON: (json: Record<string, any>) => Option.fromJSON( Element, json, ), fromSuiParsedData: (content: SuiParsedData) => Option.fromSuiParsedData( Element, content, ), fetch: async (client: SuiClient, id: string) => Option.fetch( client, Element, id, ), new: ( fields: OptionFields<ToTypeArgument<Element>>, ) => { return new Option( [extractType(Element)], fields ) }, kind: "StructClassReified", } }
32
+
33
+ static get r() { return Option.reified }
34
+
35
+ static phantom<Element extends Reified<TypeArgument, any>>( Element: Element ): PhantomReified<ToTypeStr<Option<ToTypeArgument<Element>>>> { return phantom(Option.reified( Element )); } static get p() { return Option.phantom }
36
+
37
+ static get bcs() { return <Element extends BcsType<any>>(Element: Element) => bcs.struct(`Option<${Element.name}>`, {
38
+
39
+ vec: bcs.vector(Element)
40
+
41
+ }) };
42
+
43
+ static fromFields<Element extends Reified<TypeArgument, any>>( typeArg: Element, fields: Record<string, any> ): Option<ToTypeArgument<Element>> { return Option.reified( typeArg, ).new( { vec: decodeFromFields(reified.vector(typeArg), fields.vec) } ) }
44
+
45
+ static fromFieldsWithTypes<Element extends Reified<TypeArgument, any>>( typeArg: Element, item: FieldsWithTypes ): Option<ToTypeArgument<Element>> { if (!isOption(item.type)) { throw new Error("not a Option type");
46
+
47
+ } assertFieldsWithTypesArgsMatch(item, [typeArg]);
48
+
49
+ return Option.reified( typeArg, ).new( { vec: decodeFromFieldsWithTypes(reified.vector(typeArg), item.fields.vec) } ) }
50
+
51
+ static fromBcs<Element extends Reified<TypeArgument, any>>( typeArg: Element, data: Uint8Array ): Option<ToTypeArgument<Element>> { const typeArgs = [typeArg];
52
+
53
+ return Option.fromFields( typeArg, Option.bcs( toBcs(typeArgs[0]) ).parse(data) ) }
54
+
55
+ toJSONField() { return {
56
+
57
+ vec: fieldToJSON<Vector<Element>>(`vector<${this.$typeArgs[0]}>`, this.vec),
58
+
59
+ } }
60
+
61
+ toJSON() { return { $typeName: this.$typeName, $typeArgs: this.$typeArgs, ...this.toJSONField() } }
62
+
63
+ static fromJSONField<Element extends Reified<TypeArgument, any>>( typeArg: Element, field: any ): Option<ToTypeArgument<Element>> { return Option.reified( typeArg, ).new( { vec: decodeFromJSONField(reified.vector(typeArg), field.vec) } ) }
64
+
65
+ static fromJSON<Element extends Reified<TypeArgument, any>>( typeArg: Element, json: Record<string, any> ): Option<ToTypeArgument<Element>> { if (json.$typeName !== Option.$typeName) { throw new Error("not a WithTwoGenerics json object") }; assertReifiedTypeArgsMatch( composeSuiType(Option.$typeName, extractType(typeArg)), json.$typeArgs, [typeArg], )
66
+
67
+ return Option.fromJSONField( typeArg, json, ) }
68
+
69
+ static fromSuiParsedData<Element extends Reified<TypeArgument, any>>( typeArg: Element, content: SuiParsedData ): Option<ToTypeArgument<Element>> { if (content.dataType !== "moveObject") { throw new Error("not an object"); } if (!isOption(content.type)) { throw new Error(`object at ${(content.fields as any).id} is not a Option object`); } return Option.fromFieldsWithTypes( typeArg, content ); }
70
+
71
+ static async fetch<Element extends Reified<TypeArgument, any>>( client: SuiClient, typeArg: Element, id: string ): Promise<Option<ToTypeArgument<Element>>> { const res = await client.getObject({ id, options: { showBcs: true, }, }); if (res.error) { throw new Error(`error fetching Option object at id ${id}: ${res.error.code}`); } if (res.data?.bcs?.dataType !== "moveObject" || !isOption(res.data.bcs.type)) { throw new Error(`object at id ${id} is not a Option object`); }
72
+ return Option.fromBcs( typeArg, fromB64(res.data.bcs.bcsBytes) ); }
73
+
74
+ }
@@ -0,0 +1,70 @@
1
+ import * as reified from "../../../../_framework/reified";
2
+ import {PhantomReified, Reified, StructClass, ToField, ToTypeStr, Vector, decodeFromFields, decodeFromFieldsWithTypes, decodeFromJSONField, fieldToJSON, phantom} from "../../../../_framework/reified";
3
+ import {FieldsWithTypes, composeSuiType, compressSuiType} from "../../../../_framework/util";
4
+ import {bcs, fromB64} from "@mysten/bcs";
5
+ import {SuiClient, SuiParsedData} from "@mysten/sui.js/client";
6
+
7
+ /* ============================== String =============================== */
8
+
9
+ export function isString(type: string): boolean { type = compressSuiType(type); return type === "0x1::string::String"; }
10
+
11
+ export interface StringFields { bytes: ToField<Vector<"u8">> }
12
+
13
+ export type StringReified = Reified< String, StringFields >;
14
+
15
+ export class String implements StructClass { static readonly $typeName = "0x1::string::String"; static readonly $numTypeParams = 0;
16
+
17
+ readonly $typeName = String.$typeName;
18
+
19
+ readonly $fullTypeName: "0x1::string::String";
20
+
21
+ readonly $typeArgs: [];
22
+
23
+ readonly bytes: ToField<Vector<"u8">>
24
+
25
+ private constructor(typeArgs: [], fields: StringFields, ) { this.$fullTypeName = composeSuiType( String.$typeName, ...typeArgs ) as "0x1::string::String"; this.$typeArgs = typeArgs;
26
+
27
+ this.bytes = fields.bytes; }
28
+
29
+ static reified( ): StringReified { return { typeName: String.$typeName, fullTypeName: composeSuiType( String.$typeName, ...[] ) as "0x1::string::String", typeArgs: [ ] as [], reifiedTypeArgs: [], fromFields: (fields: Record<string, any>) => String.fromFields( fields, ), fromFieldsWithTypes: (item: FieldsWithTypes) => String.fromFieldsWithTypes( item, ), fromBcs: (data: Uint8Array) => String.fromBcs( data, ), bcs: String.bcs, fromJSONField: (field: any) => String.fromJSONField( field, ), fromJSON: (json: Record<string, any>) => String.fromJSON( json, ), fromSuiParsedData: (content: SuiParsedData) => String.fromSuiParsedData( content, ), fetch: async (client: SuiClient, id: string) => String.fetch( client, id, ), new: ( fields: StringFields, ) => { return new String( [], fields ) }, kind: "StructClassReified", } }
30
+
31
+ static get r() { return String.reified() }
32
+
33
+ static phantom( ): PhantomReified<ToTypeStr<String>> { return phantom(String.reified( )); } static get p() { return String.phantom() }
34
+
35
+ static get bcs() { return bcs.struct("String", {
36
+
37
+ bytes: bcs.vector(bcs.u8())
38
+
39
+ }) };
40
+
41
+ static fromFields( fields: Record<string, any> ): String { return String.reified( ).new( { bytes: decodeFromFields(reified.vector("u8"), fields.bytes) } ) }
42
+
43
+ static fromFieldsWithTypes( item: FieldsWithTypes ): String { if (!isString(item.type)) { throw new Error("not a String type");
44
+
45
+ }
46
+
47
+ return String.reified( ).new( { bytes: decodeFromFieldsWithTypes(reified.vector("u8"), item.fields.bytes) } ) }
48
+
49
+ static fromBcs( data: Uint8Array ): String { return String.fromFields( String.bcs.parse(data) ) }
50
+
51
+ toJSONField() { return {
52
+
53
+ bytes: fieldToJSON<Vector<"u8">>(`vector<u8>`, this.bytes),
54
+
55
+ } }
56
+
57
+ toJSON() { return { $typeName: this.$typeName, $typeArgs: this.$typeArgs, ...this.toJSONField() } }
58
+
59
+ static fromJSONField( field: any ): String { return String.reified( ).new( { bytes: decodeFromJSONField(reified.vector("u8"), field.bytes) } ) }
60
+
61
+ static fromJSON( json: Record<string, any> ): String { if (json.$typeName !== String.$typeName) { throw new Error("not a WithTwoGenerics json object") };
62
+
63
+ return String.fromJSONField( json, ) }
64
+
65
+ static fromSuiParsedData( content: SuiParsedData ): String { if (content.dataType !== "moveObject") { throw new Error("not an object"); } if (!isString(content.type)) { throw new Error(`object at ${(content.fields as any).id} is not a String object`); } return String.fromFieldsWithTypes( content ); }
66
+
67
+ static async fetch( client: SuiClient, id: string ): Promise<String> { const res = await client.getObject({ id, options: { showBcs: true, }, }); if (res.error) { throw new Error(`error fetching String object at id ${id}: ${res.error.code}`); } if (res.data?.bcs?.dataType !== "moveObject" || !isString(res.data.bcs.type)) { throw new Error(`object at id ${id} is not a String object`); }
68
+ return String.fromBcs( fromB64(res.data.bcs.bcsBytes) ); }
69
+
70
+ }
@@ -0,0 +1,70 @@
1
+ import {PhantomReified, Reified, StructClass, ToField, ToTypeStr, decodeFromFields, decodeFromFieldsWithTypes, decodeFromJSONField, phantom} from "../../../../_framework/reified";
2
+ import {FieldsWithTypes, composeSuiType, compressSuiType} from "../../../../_framework/util";
3
+ import {String} from "../ascii/structs";
4
+ import {bcs, fromB64} from "@mysten/bcs";
5
+ import {SuiClient, SuiParsedData} from "@mysten/sui.js/client";
6
+
7
+ /* ============================== TypeName =============================== */
8
+
9
+ export function isTypeName(type: string): boolean { type = compressSuiType(type); return type === "0x1::type_name::TypeName"; }
10
+
11
+ export interface TypeNameFields { name: ToField<String> }
12
+
13
+ export type TypeNameReified = Reified< TypeName, TypeNameFields >;
14
+
15
+ export class TypeName implements StructClass { static readonly $typeName = "0x1::type_name::TypeName"; static readonly $numTypeParams = 0;
16
+
17
+ readonly $typeName = TypeName.$typeName;
18
+
19
+ readonly $fullTypeName: "0x1::type_name::TypeName";
20
+
21
+ readonly $typeArgs: [];
22
+
23
+ readonly name: ToField<String>
24
+
25
+ private constructor(typeArgs: [], fields: TypeNameFields, ) { this.$fullTypeName = composeSuiType( TypeName.$typeName, ...typeArgs ) as "0x1::type_name::TypeName"; this.$typeArgs = typeArgs;
26
+
27
+ this.name = fields.name; }
28
+
29
+ static reified( ): TypeNameReified { return { typeName: TypeName.$typeName, fullTypeName: composeSuiType( TypeName.$typeName, ...[] ) as "0x1::type_name::TypeName", typeArgs: [ ] as [], reifiedTypeArgs: [], fromFields: (fields: Record<string, any>) => TypeName.fromFields( fields, ), fromFieldsWithTypes: (item: FieldsWithTypes) => TypeName.fromFieldsWithTypes( item, ), fromBcs: (data: Uint8Array) => TypeName.fromBcs( data, ), bcs: TypeName.bcs, fromJSONField: (field: any) => TypeName.fromJSONField( field, ), fromJSON: (json: Record<string, any>) => TypeName.fromJSON( json, ), fromSuiParsedData: (content: SuiParsedData) => TypeName.fromSuiParsedData( content, ), fetch: async (client: SuiClient, id: string) => TypeName.fetch( client, id, ), new: ( fields: TypeNameFields, ) => { return new TypeName( [], fields ) }, kind: "StructClassReified", } }
30
+
31
+ static get r() { return TypeName.reified() }
32
+
33
+ static phantom( ): PhantomReified<ToTypeStr<TypeName>> { return phantom(TypeName.reified( )); } static get p() { return TypeName.phantom() }
34
+
35
+ static get bcs() { return bcs.struct("TypeName", {
36
+
37
+ name: String.bcs
38
+
39
+ }) };
40
+
41
+ static fromFields( fields: Record<string, any> ): TypeName { return TypeName.reified( ).new( { name: decodeFromFields(String.reified(), fields.name) } ) }
42
+
43
+ static fromFieldsWithTypes( item: FieldsWithTypes ): TypeName { if (!isTypeName(item.type)) { throw new Error("not a TypeName type");
44
+
45
+ }
46
+
47
+ return TypeName.reified( ).new( { name: decodeFromFieldsWithTypes(String.reified(), item.fields.name) } ) }
48
+
49
+ static fromBcs( data: Uint8Array ): TypeName { return TypeName.fromFields( TypeName.bcs.parse(data) ) }
50
+
51
+ toJSONField() { return {
52
+
53
+ name: this.name,
54
+
55
+ } }
56
+
57
+ toJSON() { return { $typeName: this.$typeName, $typeArgs: this.$typeArgs, ...this.toJSONField() } }
58
+
59
+ static fromJSONField( field: any ): TypeName { return TypeName.reified( ).new( { name: decodeFromJSONField(String.reified(), field.name) } ) }
60
+
61
+ static fromJSON( json: Record<string, any> ): TypeName { if (json.$typeName !== TypeName.$typeName) { throw new Error("not a WithTwoGenerics json object") };
62
+
63
+ return TypeName.fromJSONField( json, ) }
64
+
65
+ static fromSuiParsedData( content: SuiParsedData ): TypeName { if (content.dataType !== "moveObject") { throw new Error("not an object"); } if (!isTypeName(content.type)) { throw new Error(`object at ${(content.fields as any).id} is not a TypeName object`); } return TypeName.fromFieldsWithTypes( content ); }
66
+
67
+ static async fetch( client: SuiClient, id: string ): Promise<TypeName> { const res = await client.getObject({ id, options: { showBcs: true, }, }); if (res.error) { throw new Error(`error fetching TypeName object at id ${id}: ${res.error.code}`); } if (res.data?.bcs?.dataType !== "moveObject" || !isTypeName(res.data.bcs.type)) { throw new Error(`object at id ${id} is not a TypeName object`); }
68
+ return TypeName.fromBcs( fromB64(res.data.bcs.bcsBytes) ); }
69
+
70
+ }
@@ -0,0 +1 @@
1
+ export const PACKAGE_ID = "0x1d17058789bd1e1e79f1a92424519a88146f191f58a06cc4d9ab23d17d46ab73"; export const PUBLISHED_AT = "0x71fbc7acaf513561dabdeb846e7dd5288108e56edb0b6de8d4999c4dfce21f66";
@@ -0,0 +1,14 @@
1
+ import * as oracle from "./oracle/structs";
2
+ import * as pythParser from "./pyth-parser/structs";
3
+ import * as supra from "./supra/structs";
4
+ import * as switchboardFeedParser from "./switchboard-feed-parser/structs";
5
+ import {StructClassLoader} from "../../../_framework/loader";
6
+
7
+ export function registerClasses(loader: StructClassLoader) { loader.register(switchboardFeedParser.AggregatorInfo);
8
+ loader.register(supra.SupraPrice);
9
+ loader.register(pythParser.PythPrice);
10
+ loader.register(pythParser.PythPriceInfoObject);
11
+ loader.register(oracle.ManagerCap);
12
+ loader.register(oracle.Oracle);
13
+ loader.register(oracle.PriceEvent);
14
+ }