@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,400 @@
1
+ import * as reified from "../../../../_framework/reified";
2
+ import {PhantomReified, PhantomToTypeStr, PhantomTypeArgument, Reified, StructClass, ToField, ToPhantomTypeArgument, ToTypeStr, assertFieldsWithTypesArgsMatch, assertReifiedTypeArgsMatch, decodeFromFields, decodeFromFieldsWithTypes, decodeFromJSONField, extractType, phantom, ToTypeStr as ToPhantom} from "../../../../_framework/reified";
3
+ import {FieldsWithTypes, composeSuiType, compressSuiType} from "../../../../_framework/util";
4
+ import {TypeName} from "../../0x1/type-name/structs";
5
+ import {Balance} from "../balance/structs";
6
+ import {ID, UID} from "../object/structs";
7
+ import {SUI} from "../sui/structs";
8
+ import {VecSet} from "../vec-set/structs";
9
+ import {bcs, fromB64} from "@mysten/bcs";
10
+ import {SuiClient, SuiParsedData} from "@mysten/sui.js/client";
11
+
12
+ /* ============================== RuleKey =============================== */
13
+
14
+ export function isRuleKey(type: string): boolean { type = compressSuiType(type); return type.startsWith("0x2::transfer_policy::RuleKey<"); }
15
+
16
+ export interface RuleKeyFields<T extends PhantomTypeArgument> { dummyField: ToField<"bool"> }
17
+
18
+ export type RuleKeyReified<T extends PhantomTypeArgument> = Reified< RuleKey<T>, RuleKeyFields<T> >;
19
+
20
+ export class RuleKey<T extends PhantomTypeArgument> implements StructClass { static readonly $typeName = "0x2::transfer_policy::RuleKey"; static readonly $numTypeParams = 1;
21
+
22
+ readonly $typeName = RuleKey.$typeName;
23
+
24
+ readonly $fullTypeName: `0x2::transfer_policy::RuleKey<${PhantomToTypeStr<T>}>`;
25
+
26
+ readonly $typeArgs: [PhantomToTypeStr<T>];
27
+
28
+ readonly dummyField: ToField<"bool">
29
+
30
+ private constructor(typeArgs: [PhantomToTypeStr<T>], fields: RuleKeyFields<T>, ) { this.$fullTypeName = composeSuiType( RuleKey.$typeName, ...typeArgs ) as `0x2::transfer_policy::RuleKey<${PhantomToTypeStr<T>}>`; this.$typeArgs = typeArgs;
31
+
32
+ this.dummyField = fields.dummyField; }
33
+
34
+ static reified<T extends PhantomReified<PhantomTypeArgument>>( T: T ): RuleKeyReified<ToPhantomTypeArgument<T>> { return { typeName: RuleKey.$typeName, fullTypeName: composeSuiType( RuleKey.$typeName, ...[extractType(T)] ) as `0x2::transfer_policy::RuleKey<${PhantomToTypeStr<ToPhantomTypeArgument<T>>}>`, typeArgs: [ extractType(T) ] as [PhantomToTypeStr<ToPhantomTypeArgument<T>>], reifiedTypeArgs: [T], fromFields: (fields: Record<string, any>) => RuleKey.fromFields( T, fields, ), fromFieldsWithTypes: (item: FieldsWithTypes) => RuleKey.fromFieldsWithTypes( T, item, ), fromBcs: (data: Uint8Array) => RuleKey.fromBcs( T, data, ), bcs: RuleKey.bcs, fromJSONField: (field: any) => RuleKey.fromJSONField( T, field, ), fromJSON: (json: Record<string, any>) => RuleKey.fromJSON( T, json, ), fromSuiParsedData: (content: SuiParsedData) => RuleKey.fromSuiParsedData( T, content, ), fetch: async (client: SuiClient, id: string) => RuleKey.fetch( client, T, id, ), new: ( fields: RuleKeyFields<ToPhantomTypeArgument<T>>, ) => { return new RuleKey( [extractType(T)], fields ) }, kind: "StructClassReified", } }
35
+
36
+ static get r() { return RuleKey.reified }
37
+
38
+ static phantom<T extends PhantomReified<PhantomTypeArgument>>( T: T ): PhantomReified<ToTypeStr<RuleKey<ToPhantomTypeArgument<T>>>> { return phantom(RuleKey.reified( T )); } static get p() { return RuleKey.phantom }
39
+
40
+ static get bcs() { return bcs.struct("RuleKey", {
41
+
42
+ dummy_field: bcs.bool()
43
+
44
+ }) };
45
+
46
+ static fromFields<T extends PhantomReified<PhantomTypeArgument>>( typeArg: T, fields: Record<string, any> ): RuleKey<ToPhantomTypeArgument<T>> { return RuleKey.reified( typeArg, ).new( { dummyField: decodeFromFields("bool", fields.dummy_field) } ) }
47
+
48
+ static fromFieldsWithTypes<T extends PhantomReified<PhantomTypeArgument>>( typeArg: T, item: FieldsWithTypes ): RuleKey<ToPhantomTypeArgument<T>> { if (!isRuleKey(item.type)) { throw new Error("not a RuleKey type");
49
+
50
+ } assertFieldsWithTypesArgsMatch(item, [typeArg]);
51
+
52
+ return RuleKey.reified( typeArg, ).new( { dummyField: decodeFromFieldsWithTypes("bool", item.fields.dummy_field) } ) }
53
+
54
+ static fromBcs<T extends PhantomReified<PhantomTypeArgument>>( typeArg: T, data: Uint8Array ): RuleKey<ToPhantomTypeArgument<T>> { return RuleKey.fromFields( typeArg, RuleKey.bcs.parse(data) ) }
55
+
56
+ toJSONField() { return {
57
+
58
+ dummyField: this.dummyField,
59
+
60
+ } }
61
+
62
+ toJSON() { return { $typeName: this.$typeName, $typeArgs: this.$typeArgs, ...this.toJSONField() } }
63
+
64
+ static fromJSONField<T extends PhantomReified<PhantomTypeArgument>>( typeArg: T, field: any ): RuleKey<ToPhantomTypeArgument<T>> { return RuleKey.reified( typeArg, ).new( { dummyField: decodeFromJSONField("bool", field.dummyField) } ) }
65
+
66
+ static fromJSON<T extends PhantomReified<PhantomTypeArgument>>( typeArg: T, json: Record<string, any> ): RuleKey<ToPhantomTypeArgument<T>> { if (json.$typeName !== RuleKey.$typeName) { throw new Error("not a WithTwoGenerics json object") }; assertReifiedTypeArgsMatch( composeSuiType(RuleKey.$typeName, extractType(typeArg)), json.$typeArgs, [typeArg], )
67
+
68
+ return RuleKey.fromJSONField( typeArg, json, ) }
69
+
70
+ static fromSuiParsedData<T extends PhantomReified<PhantomTypeArgument>>( typeArg: T, content: SuiParsedData ): RuleKey<ToPhantomTypeArgument<T>> { if (content.dataType !== "moveObject") { throw new Error("not an object"); } if (!isRuleKey(content.type)) { throw new Error(`object at ${(content.fields as any).id} is not a RuleKey object`); } return RuleKey.fromFieldsWithTypes( typeArg, content ); }
71
+
72
+ static async fetch<T extends PhantomReified<PhantomTypeArgument>>( client: SuiClient, typeArg: T, id: string ): Promise<RuleKey<ToPhantomTypeArgument<T>>> { const res = await client.getObject({ id, options: { showBcs: true, }, }); if (res.error) { throw new Error(`error fetching RuleKey object at id ${id}: ${res.error.code}`); } if (res.data?.bcs?.dataType !== "moveObject" || !isRuleKey(res.data.bcs.type)) { throw new Error(`object at id ${id} is not a RuleKey object`); }
73
+ return RuleKey.fromBcs( typeArg, fromB64(res.data.bcs.bcsBytes) ); }
74
+
75
+ }
76
+
77
+ /* ============================== TransferPolicy =============================== */
78
+
79
+ export function isTransferPolicy(type: string): boolean { type = compressSuiType(type); return type.startsWith("0x2::transfer_policy::TransferPolicy<"); }
80
+
81
+ export interface TransferPolicyFields<T extends PhantomTypeArgument> { id: ToField<UID>; balance: ToField<Balance<ToPhantom<SUI>>>; rules: ToField<VecSet<TypeName>> }
82
+
83
+ export type TransferPolicyReified<T extends PhantomTypeArgument> = Reified< TransferPolicy<T>, TransferPolicyFields<T> >;
84
+
85
+ export class TransferPolicy<T extends PhantomTypeArgument> implements StructClass { static readonly $typeName = "0x2::transfer_policy::TransferPolicy"; static readonly $numTypeParams = 1;
86
+
87
+ readonly $typeName = TransferPolicy.$typeName;
88
+
89
+ readonly $fullTypeName: `0x2::transfer_policy::TransferPolicy<${PhantomToTypeStr<T>}>`;
90
+
91
+ readonly $typeArgs: [PhantomToTypeStr<T>];
92
+
93
+ readonly id: ToField<UID>; readonly balance: ToField<Balance<ToPhantom<SUI>>>; readonly rules: ToField<VecSet<TypeName>>
94
+
95
+ private constructor(typeArgs: [PhantomToTypeStr<T>], fields: TransferPolicyFields<T>, ) { this.$fullTypeName = composeSuiType( TransferPolicy.$typeName, ...typeArgs ) as `0x2::transfer_policy::TransferPolicy<${PhantomToTypeStr<T>}>`; this.$typeArgs = typeArgs;
96
+
97
+ this.id = fields.id;; this.balance = fields.balance;; this.rules = fields.rules; }
98
+
99
+ static reified<T extends PhantomReified<PhantomTypeArgument>>( T: T ): TransferPolicyReified<ToPhantomTypeArgument<T>> { return { typeName: TransferPolicy.$typeName, fullTypeName: composeSuiType( TransferPolicy.$typeName, ...[extractType(T)] ) as `0x2::transfer_policy::TransferPolicy<${PhantomToTypeStr<ToPhantomTypeArgument<T>>}>`, typeArgs: [ extractType(T) ] as [PhantomToTypeStr<ToPhantomTypeArgument<T>>], reifiedTypeArgs: [T], fromFields: (fields: Record<string, any>) => TransferPolicy.fromFields( T, fields, ), fromFieldsWithTypes: (item: FieldsWithTypes) => TransferPolicy.fromFieldsWithTypes( T, item, ), fromBcs: (data: Uint8Array) => TransferPolicy.fromBcs( T, data, ), bcs: TransferPolicy.bcs, fromJSONField: (field: any) => TransferPolicy.fromJSONField( T, field, ), fromJSON: (json: Record<string, any>) => TransferPolicy.fromJSON( T, json, ), fromSuiParsedData: (content: SuiParsedData) => TransferPolicy.fromSuiParsedData( T, content, ), fetch: async (client: SuiClient, id: string) => TransferPolicy.fetch( client, T, id, ), new: ( fields: TransferPolicyFields<ToPhantomTypeArgument<T>>, ) => { return new TransferPolicy( [extractType(T)], fields ) }, kind: "StructClassReified", } }
100
+
101
+ static get r() { return TransferPolicy.reified }
102
+
103
+ static phantom<T extends PhantomReified<PhantomTypeArgument>>( T: T ): PhantomReified<ToTypeStr<TransferPolicy<ToPhantomTypeArgument<T>>>> { return phantom(TransferPolicy.reified( T )); } static get p() { return TransferPolicy.phantom }
104
+
105
+ static get bcs() { return bcs.struct("TransferPolicy", {
106
+
107
+ id: UID.bcs, balance: Balance.bcs, rules: VecSet.bcs(TypeName.bcs)
108
+
109
+ }) };
110
+
111
+ static fromFields<T extends PhantomReified<PhantomTypeArgument>>( typeArg: T, fields: Record<string, any> ): TransferPolicy<ToPhantomTypeArgument<T>> { return TransferPolicy.reified( typeArg, ).new( { id: decodeFromFields(UID.reified(), fields.id), balance: decodeFromFields(Balance.reified(reified.phantom(SUI.reified())), fields.balance), rules: decodeFromFields(VecSet.reified(TypeName.reified()), fields.rules) } ) }
112
+
113
+ static fromFieldsWithTypes<T extends PhantomReified<PhantomTypeArgument>>( typeArg: T, item: FieldsWithTypes ): TransferPolicy<ToPhantomTypeArgument<T>> { if (!isTransferPolicy(item.type)) { throw new Error("not a TransferPolicy type");
114
+
115
+ } assertFieldsWithTypesArgsMatch(item, [typeArg]);
116
+
117
+ return TransferPolicy.reified( typeArg, ).new( { id: decodeFromFieldsWithTypes(UID.reified(), item.fields.id), balance: decodeFromFieldsWithTypes(Balance.reified(reified.phantom(SUI.reified())), item.fields.balance), rules: decodeFromFieldsWithTypes(VecSet.reified(TypeName.reified()), item.fields.rules) } ) }
118
+
119
+ static fromBcs<T extends PhantomReified<PhantomTypeArgument>>( typeArg: T, data: Uint8Array ): TransferPolicy<ToPhantomTypeArgument<T>> { return TransferPolicy.fromFields( typeArg, TransferPolicy.bcs.parse(data) ) }
120
+
121
+ toJSONField() { return {
122
+
123
+ id: this.id,balance: this.balance.toJSONField(),rules: this.rules.toJSONField(),
124
+
125
+ } }
126
+
127
+ toJSON() { return { $typeName: this.$typeName, $typeArgs: this.$typeArgs, ...this.toJSONField() } }
128
+
129
+ static fromJSONField<T extends PhantomReified<PhantomTypeArgument>>( typeArg: T, field: any ): TransferPolicy<ToPhantomTypeArgument<T>> { return TransferPolicy.reified( typeArg, ).new( { id: decodeFromJSONField(UID.reified(), field.id), balance: decodeFromJSONField(Balance.reified(reified.phantom(SUI.reified())), field.balance), rules: decodeFromJSONField(VecSet.reified(TypeName.reified()), field.rules) } ) }
130
+
131
+ static fromJSON<T extends PhantomReified<PhantomTypeArgument>>( typeArg: T, json: Record<string, any> ): TransferPolicy<ToPhantomTypeArgument<T>> { if (json.$typeName !== TransferPolicy.$typeName) { throw new Error("not a WithTwoGenerics json object") }; assertReifiedTypeArgsMatch( composeSuiType(TransferPolicy.$typeName, extractType(typeArg)), json.$typeArgs, [typeArg], )
132
+
133
+ return TransferPolicy.fromJSONField( typeArg, json, ) }
134
+
135
+ static fromSuiParsedData<T extends PhantomReified<PhantomTypeArgument>>( typeArg: T, content: SuiParsedData ): TransferPolicy<ToPhantomTypeArgument<T>> { if (content.dataType !== "moveObject") { throw new Error("not an object"); } if (!isTransferPolicy(content.type)) { throw new Error(`object at ${(content.fields as any).id} is not a TransferPolicy object`); } return TransferPolicy.fromFieldsWithTypes( typeArg, content ); }
136
+
137
+ static async fetch<T extends PhantomReified<PhantomTypeArgument>>( client: SuiClient, typeArg: T, id: string ): Promise<TransferPolicy<ToPhantomTypeArgument<T>>> { const res = await client.getObject({ id, options: { showBcs: true, }, }); if (res.error) { throw new Error(`error fetching TransferPolicy object at id ${id}: ${res.error.code}`); } if (res.data?.bcs?.dataType !== "moveObject" || !isTransferPolicy(res.data.bcs.type)) { throw new Error(`object at id ${id} is not a TransferPolicy object`); }
138
+ return TransferPolicy.fromBcs( typeArg, fromB64(res.data.bcs.bcsBytes) ); }
139
+
140
+ }
141
+
142
+ /* ============================== TransferPolicyCap =============================== */
143
+
144
+ export function isTransferPolicyCap(type: string): boolean { type = compressSuiType(type); return type.startsWith("0x2::transfer_policy::TransferPolicyCap<"); }
145
+
146
+ export interface TransferPolicyCapFields<T extends PhantomTypeArgument> { id: ToField<UID>; policyId: ToField<ID> }
147
+
148
+ export type TransferPolicyCapReified<T extends PhantomTypeArgument> = Reified< TransferPolicyCap<T>, TransferPolicyCapFields<T> >;
149
+
150
+ export class TransferPolicyCap<T extends PhantomTypeArgument> implements StructClass { static readonly $typeName = "0x2::transfer_policy::TransferPolicyCap"; static readonly $numTypeParams = 1;
151
+
152
+ readonly $typeName = TransferPolicyCap.$typeName;
153
+
154
+ readonly $fullTypeName: `0x2::transfer_policy::TransferPolicyCap<${PhantomToTypeStr<T>}>`;
155
+
156
+ readonly $typeArgs: [PhantomToTypeStr<T>];
157
+
158
+ readonly id: ToField<UID>; readonly policyId: ToField<ID>
159
+
160
+ private constructor(typeArgs: [PhantomToTypeStr<T>], fields: TransferPolicyCapFields<T>, ) { this.$fullTypeName = composeSuiType( TransferPolicyCap.$typeName, ...typeArgs ) as `0x2::transfer_policy::TransferPolicyCap<${PhantomToTypeStr<T>}>`; this.$typeArgs = typeArgs;
161
+
162
+ this.id = fields.id;; this.policyId = fields.policyId; }
163
+
164
+ static reified<T extends PhantomReified<PhantomTypeArgument>>( T: T ): TransferPolicyCapReified<ToPhantomTypeArgument<T>> { return { typeName: TransferPolicyCap.$typeName, fullTypeName: composeSuiType( TransferPolicyCap.$typeName, ...[extractType(T)] ) as `0x2::transfer_policy::TransferPolicyCap<${PhantomToTypeStr<ToPhantomTypeArgument<T>>}>`, typeArgs: [ extractType(T) ] as [PhantomToTypeStr<ToPhantomTypeArgument<T>>], reifiedTypeArgs: [T], fromFields: (fields: Record<string, any>) => TransferPolicyCap.fromFields( T, fields, ), fromFieldsWithTypes: (item: FieldsWithTypes) => TransferPolicyCap.fromFieldsWithTypes( T, item, ), fromBcs: (data: Uint8Array) => TransferPolicyCap.fromBcs( T, data, ), bcs: TransferPolicyCap.bcs, fromJSONField: (field: any) => TransferPolicyCap.fromJSONField( T, field, ), fromJSON: (json: Record<string, any>) => TransferPolicyCap.fromJSON( T, json, ), fromSuiParsedData: (content: SuiParsedData) => TransferPolicyCap.fromSuiParsedData( T, content, ), fetch: async (client: SuiClient, id: string) => TransferPolicyCap.fetch( client, T, id, ), new: ( fields: TransferPolicyCapFields<ToPhantomTypeArgument<T>>, ) => { return new TransferPolicyCap( [extractType(T)], fields ) }, kind: "StructClassReified", } }
165
+
166
+ static get r() { return TransferPolicyCap.reified }
167
+
168
+ static phantom<T extends PhantomReified<PhantomTypeArgument>>( T: T ): PhantomReified<ToTypeStr<TransferPolicyCap<ToPhantomTypeArgument<T>>>> { return phantom(TransferPolicyCap.reified( T )); } static get p() { return TransferPolicyCap.phantom }
169
+
170
+ static get bcs() { return bcs.struct("TransferPolicyCap", {
171
+
172
+ id: UID.bcs, policy_id: ID.bcs
173
+
174
+ }) };
175
+
176
+ static fromFields<T extends PhantomReified<PhantomTypeArgument>>( typeArg: T, fields: Record<string, any> ): TransferPolicyCap<ToPhantomTypeArgument<T>> { return TransferPolicyCap.reified( typeArg, ).new( { id: decodeFromFields(UID.reified(), fields.id), policyId: decodeFromFields(ID.reified(), fields.policy_id) } ) }
177
+
178
+ static fromFieldsWithTypes<T extends PhantomReified<PhantomTypeArgument>>( typeArg: T, item: FieldsWithTypes ): TransferPolicyCap<ToPhantomTypeArgument<T>> { if (!isTransferPolicyCap(item.type)) { throw new Error("not a TransferPolicyCap type");
179
+
180
+ } assertFieldsWithTypesArgsMatch(item, [typeArg]);
181
+
182
+ return TransferPolicyCap.reified( typeArg, ).new( { id: decodeFromFieldsWithTypes(UID.reified(), item.fields.id), policyId: decodeFromFieldsWithTypes(ID.reified(), item.fields.policy_id) } ) }
183
+
184
+ static fromBcs<T extends PhantomReified<PhantomTypeArgument>>( typeArg: T, data: Uint8Array ): TransferPolicyCap<ToPhantomTypeArgument<T>> { return TransferPolicyCap.fromFields( typeArg, TransferPolicyCap.bcs.parse(data) ) }
185
+
186
+ toJSONField() { return {
187
+
188
+ id: this.id,policyId: this.policyId,
189
+
190
+ } }
191
+
192
+ toJSON() { return { $typeName: this.$typeName, $typeArgs: this.$typeArgs, ...this.toJSONField() } }
193
+
194
+ static fromJSONField<T extends PhantomReified<PhantomTypeArgument>>( typeArg: T, field: any ): TransferPolicyCap<ToPhantomTypeArgument<T>> { return TransferPolicyCap.reified( typeArg, ).new( { id: decodeFromJSONField(UID.reified(), field.id), policyId: decodeFromJSONField(ID.reified(), field.policyId) } ) }
195
+
196
+ static fromJSON<T extends PhantomReified<PhantomTypeArgument>>( typeArg: T, json: Record<string, any> ): TransferPolicyCap<ToPhantomTypeArgument<T>> { if (json.$typeName !== TransferPolicyCap.$typeName) { throw new Error("not a WithTwoGenerics json object") }; assertReifiedTypeArgsMatch( composeSuiType(TransferPolicyCap.$typeName, extractType(typeArg)), json.$typeArgs, [typeArg], )
197
+
198
+ return TransferPolicyCap.fromJSONField( typeArg, json, ) }
199
+
200
+ static fromSuiParsedData<T extends PhantomReified<PhantomTypeArgument>>( typeArg: T, content: SuiParsedData ): TransferPolicyCap<ToPhantomTypeArgument<T>> { if (content.dataType !== "moveObject") { throw new Error("not an object"); } if (!isTransferPolicyCap(content.type)) { throw new Error(`object at ${(content.fields as any).id} is not a TransferPolicyCap object`); } return TransferPolicyCap.fromFieldsWithTypes( typeArg, content ); }
201
+
202
+ static async fetch<T extends PhantomReified<PhantomTypeArgument>>( client: SuiClient, typeArg: T, id: string ): Promise<TransferPolicyCap<ToPhantomTypeArgument<T>>> { const res = await client.getObject({ id, options: { showBcs: true, }, }); if (res.error) { throw new Error(`error fetching TransferPolicyCap object at id ${id}: ${res.error.code}`); } if (res.data?.bcs?.dataType !== "moveObject" || !isTransferPolicyCap(res.data.bcs.type)) { throw new Error(`object at id ${id} is not a TransferPolicyCap object`); }
203
+ return TransferPolicyCap.fromBcs( typeArg, fromB64(res.data.bcs.bcsBytes) ); }
204
+
205
+ }
206
+
207
+ /* ============================== TransferPolicyCreated =============================== */
208
+
209
+ export function isTransferPolicyCreated(type: string): boolean { type = compressSuiType(type); return type.startsWith("0x2::transfer_policy::TransferPolicyCreated<"); }
210
+
211
+ export interface TransferPolicyCreatedFields<T extends PhantomTypeArgument> { id: ToField<ID> }
212
+
213
+ export type TransferPolicyCreatedReified<T extends PhantomTypeArgument> = Reified< TransferPolicyCreated<T>, TransferPolicyCreatedFields<T> >;
214
+
215
+ export class TransferPolicyCreated<T extends PhantomTypeArgument> implements StructClass { static readonly $typeName = "0x2::transfer_policy::TransferPolicyCreated"; static readonly $numTypeParams = 1;
216
+
217
+ readonly $typeName = TransferPolicyCreated.$typeName;
218
+
219
+ readonly $fullTypeName: `0x2::transfer_policy::TransferPolicyCreated<${PhantomToTypeStr<T>}>`;
220
+
221
+ readonly $typeArgs: [PhantomToTypeStr<T>];
222
+
223
+ readonly id: ToField<ID>
224
+
225
+ private constructor(typeArgs: [PhantomToTypeStr<T>], fields: TransferPolicyCreatedFields<T>, ) { this.$fullTypeName = composeSuiType( TransferPolicyCreated.$typeName, ...typeArgs ) as `0x2::transfer_policy::TransferPolicyCreated<${PhantomToTypeStr<T>}>`; this.$typeArgs = typeArgs;
226
+
227
+ this.id = fields.id; }
228
+
229
+ static reified<T extends PhantomReified<PhantomTypeArgument>>( T: T ): TransferPolicyCreatedReified<ToPhantomTypeArgument<T>> { return { typeName: TransferPolicyCreated.$typeName, fullTypeName: composeSuiType( TransferPolicyCreated.$typeName, ...[extractType(T)] ) as `0x2::transfer_policy::TransferPolicyCreated<${PhantomToTypeStr<ToPhantomTypeArgument<T>>}>`, typeArgs: [ extractType(T) ] as [PhantomToTypeStr<ToPhantomTypeArgument<T>>], reifiedTypeArgs: [T], fromFields: (fields: Record<string, any>) => TransferPolicyCreated.fromFields( T, fields, ), fromFieldsWithTypes: (item: FieldsWithTypes) => TransferPolicyCreated.fromFieldsWithTypes( T, item, ), fromBcs: (data: Uint8Array) => TransferPolicyCreated.fromBcs( T, data, ), bcs: TransferPolicyCreated.bcs, fromJSONField: (field: any) => TransferPolicyCreated.fromJSONField( T, field, ), fromJSON: (json: Record<string, any>) => TransferPolicyCreated.fromJSON( T, json, ), fromSuiParsedData: (content: SuiParsedData) => TransferPolicyCreated.fromSuiParsedData( T, content, ), fetch: async (client: SuiClient, id: string) => TransferPolicyCreated.fetch( client, T, id, ), new: ( fields: TransferPolicyCreatedFields<ToPhantomTypeArgument<T>>, ) => { return new TransferPolicyCreated( [extractType(T)], fields ) }, kind: "StructClassReified", } }
230
+
231
+ static get r() { return TransferPolicyCreated.reified }
232
+
233
+ static phantom<T extends PhantomReified<PhantomTypeArgument>>( T: T ): PhantomReified<ToTypeStr<TransferPolicyCreated<ToPhantomTypeArgument<T>>>> { return phantom(TransferPolicyCreated.reified( T )); } static get p() { return TransferPolicyCreated.phantom }
234
+
235
+ static get bcs() { return bcs.struct("TransferPolicyCreated", {
236
+
237
+ id: ID.bcs
238
+
239
+ }) };
240
+
241
+ static fromFields<T extends PhantomReified<PhantomTypeArgument>>( typeArg: T, fields: Record<string, any> ): TransferPolicyCreated<ToPhantomTypeArgument<T>> { return TransferPolicyCreated.reified( typeArg, ).new( { id: decodeFromFields(ID.reified(), fields.id) } ) }
242
+
243
+ static fromFieldsWithTypes<T extends PhantomReified<PhantomTypeArgument>>( typeArg: T, item: FieldsWithTypes ): TransferPolicyCreated<ToPhantomTypeArgument<T>> { if (!isTransferPolicyCreated(item.type)) { throw new Error("not a TransferPolicyCreated type");
244
+
245
+ } assertFieldsWithTypesArgsMatch(item, [typeArg]);
246
+
247
+ return TransferPolicyCreated.reified( typeArg, ).new( { id: decodeFromFieldsWithTypes(ID.reified(), item.fields.id) } ) }
248
+
249
+ static fromBcs<T extends PhantomReified<PhantomTypeArgument>>( typeArg: T, data: Uint8Array ): TransferPolicyCreated<ToPhantomTypeArgument<T>> { return TransferPolicyCreated.fromFields( typeArg, TransferPolicyCreated.bcs.parse(data) ) }
250
+
251
+ toJSONField() { return {
252
+
253
+ id: this.id,
254
+
255
+ } }
256
+
257
+ toJSON() { return { $typeName: this.$typeName, $typeArgs: this.$typeArgs, ...this.toJSONField() } }
258
+
259
+ static fromJSONField<T extends PhantomReified<PhantomTypeArgument>>( typeArg: T, field: any ): TransferPolicyCreated<ToPhantomTypeArgument<T>> { return TransferPolicyCreated.reified( typeArg, ).new( { id: decodeFromJSONField(ID.reified(), field.id) } ) }
260
+
261
+ static fromJSON<T extends PhantomReified<PhantomTypeArgument>>( typeArg: T, json: Record<string, any> ): TransferPolicyCreated<ToPhantomTypeArgument<T>> { if (json.$typeName !== TransferPolicyCreated.$typeName) { throw new Error("not a WithTwoGenerics json object") }; assertReifiedTypeArgsMatch( composeSuiType(TransferPolicyCreated.$typeName, extractType(typeArg)), json.$typeArgs, [typeArg], )
262
+
263
+ return TransferPolicyCreated.fromJSONField( typeArg, json, ) }
264
+
265
+ static fromSuiParsedData<T extends PhantomReified<PhantomTypeArgument>>( typeArg: T, content: SuiParsedData ): TransferPolicyCreated<ToPhantomTypeArgument<T>> { if (content.dataType !== "moveObject") { throw new Error("not an object"); } if (!isTransferPolicyCreated(content.type)) { throw new Error(`object at ${(content.fields as any).id} is not a TransferPolicyCreated object`); } return TransferPolicyCreated.fromFieldsWithTypes( typeArg, content ); }
266
+
267
+ static async fetch<T extends PhantomReified<PhantomTypeArgument>>( client: SuiClient, typeArg: T, id: string ): Promise<TransferPolicyCreated<ToPhantomTypeArgument<T>>> { const res = await client.getObject({ id, options: { showBcs: true, }, }); if (res.error) { throw new Error(`error fetching TransferPolicyCreated object at id ${id}: ${res.error.code}`); } if (res.data?.bcs?.dataType !== "moveObject" || !isTransferPolicyCreated(res.data.bcs.type)) { throw new Error(`object at id ${id} is not a TransferPolicyCreated object`); }
268
+ return TransferPolicyCreated.fromBcs( typeArg, fromB64(res.data.bcs.bcsBytes) ); }
269
+
270
+ }
271
+
272
+ /* ============================== TransferPolicyDestroyed =============================== */
273
+
274
+ export function isTransferPolicyDestroyed(type: string): boolean { type = compressSuiType(type); return type.startsWith("0x2::transfer_policy::TransferPolicyDestroyed<"); }
275
+
276
+ export interface TransferPolicyDestroyedFields<T extends PhantomTypeArgument> { id: ToField<ID> }
277
+
278
+ export type TransferPolicyDestroyedReified<T extends PhantomTypeArgument> = Reified< TransferPolicyDestroyed<T>, TransferPolicyDestroyedFields<T> >;
279
+
280
+ export class TransferPolicyDestroyed<T extends PhantomTypeArgument> implements StructClass { static readonly $typeName = "0x2::transfer_policy::TransferPolicyDestroyed"; static readonly $numTypeParams = 1;
281
+
282
+ readonly $typeName = TransferPolicyDestroyed.$typeName;
283
+
284
+ readonly $fullTypeName: `0x2::transfer_policy::TransferPolicyDestroyed<${PhantomToTypeStr<T>}>`;
285
+
286
+ readonly $typeArgs: [PhantomToTypeStr<T>];
287
+
288
+ readonly id: ToField<ID>
289
+
290
+ private constructor(typeArgs: [PhantomToTypeStr<T>], fields: TransferPolicyDestroyedFields<T>, ) { this.$fullTypeName = composeSuiType( TransferPolicyDestroyed.$typeName, ...typeArgs ) as `0x2::transfer_policy::TransferPolicyDestroyed<${PhantomToTypeStr<T>}>`; this.$typeArgs = typeArgs;
291
+
292
+ this.id = fields.id; }
293
+
294
+ static reified<T extends PhantomReified<PhantomTypeArgument>>( T: T ): TransferPolicyDestroyedReified<ToPhantomTypeArgument<T>> { return { typeName: TransferPolicyDestroyed.$typeName, fullTypeName: composeSuiType( TransferPolicyDestroyed.$typeName, ...[extractType(T)] ) as `0x2::transfer_policy::TransferPolicyDestroyed<${PhantomToTypeStr<ToPhantomTypeArgument<T>>}>`, typeArgs: [ extractType(T) ] as [PhantomToTypeStr<ToPhantomTypeArgument<T>>], reifiedTypeArgs: [T], fromFields: (fields: Record<string, any>) => TransferPolicyDestroyed.fromFields( T, fields, ), fromFieldsWithTypes: (item: FieldsWithTypes) => TransferPolicyDestroyed.fromFieldsWithTypes( T, item, ), fromBcs: (data: Uint8Array) => TransferPolicyDestroyed.fromBcs( T, data, ), bcs: TransferPolicyDestroyed.bcs, fromJSONField: (field: any) => TransferPolicyDestroyed.fromJSONField( T, field, ), fromJSON: (json: Record<string, any>) => TransferPolicyDestroyed.fromJSON( T, json, ), fromSuiParsedData: (content: SuiParsedData) => TransferPolicyDestroyed.fromSuiParsedData( T, content, ), fetch: async (client: SuiClient, id: string) => TransferPolicyDestroyed.fetch( client, T, id, ), new: ( fields: TransferPolicyDestroyedFields<ToPhantomTypeArgument<T>>, ) => { return new TransferPolicyDestroyed( [extractType(T)], fields ) }, kind: "StructClassReified", } }
295
+
296
+ static get r() { return TransferPolicyDestroyed.reified }
297
+
298
+ static phantom<T extends PhantomReified<PhantomTypeArgument>>( T: T ): PhantomReified<ToTypeStr<TransferPolicyDestroyed<ToPhantomTypeArgument<T>>>> { return phantom(TransferPolicyDestroyed.reified( T )); } static get p() { return TransferPolicyDestroyed.phantom }
299
+
300
+ static get bcs() { return bcs.struct("TransferPolicyDestroyed", {
301
+
302
+ id: ID.bcs
303
+
304
+ }) };
305
+
306
+ static fromFields<T extends PhantomReified<PhantomTypeArgument>>( typeArg: T, fields: Record<string, any> ): TransferPolicyDestroyed<ToPhantomTypeArgument<T>> { return TransferPolicyDestroyed.reified( typeArg, ).new( { id: decodeFromFields(ID.reified(), fields.id) } ) }
307
+
308
+ static fromFieldsWithTypes<T extends PhantomReified<PhantomTypeArgument>>( typeArg: T, item: FieldsWithTypes ): TransferPolicyDestroyed<ToPhantomTypeArgument<T>> { if (!isTransferPolicyDestroyed(item.type)) { throw new Error("not a TransferPolicyDestroyed type");
309
+
310
+ } assertFieldsWithTypesArgsMatch(item, [typeArg]);
311
+
312
+ return TransferPolicyDestroyed.reified( typeArg, ).new( { id: decodeFromFieldsWithTypes(ID.reified(), item.fields.id) } ) }
313
+
314
+ static fromBcs<T extends PhantomReified<PhantomTypeArgument>>( typeArg: T, data: Uint8Array ): TransferPolicyDestroyed<ToPhantomTypeArgument<T>> { return TransferPolicyDestroyed.fromFields( typeArg, TransferPolicyDestroyed.bcs.parse(data) ) }
315
+
316
+ toJSONField() { return {
317
+
318
+ id: this.id,
319
+
320
+ } }
321
+
322
+ toJSON() { return { $typeName: this.$typeName, $typeArgs: this.$typeArgs, ...this.toJSONField() } }
323
+
324
+ static fromJSONField<T extends PhantomReified<PhantomTypeArgument>>( typeArg: T, field: any ): TransferPolicyDestroyed<ToPhantomTypeArgument<T>> { return TransferPolicyDestroyed.reified( typeArg, ).new( { id: decodeFromJSONField(ID.reified(), field.id) } ) }
325
+
326
+ static fromJSON<T extends PhantomReified<PhantomTypeArgument>>( typeArg: T, json: Record<string, any> ): TransferPolicyDestroyed<ToPhantomTypeArgument<T>> { if (json.$typeName !== TransferPolicyDestroyed.$typeName) { throw new Error("not a WithTwoGenerics json object") }; assertReifiedTypeArgsMatch( composeSuiType(TransferPolicyDestroyed.$typeName, extractType(typeArg)), json.$typeArgs, [typeArg], )
327
+
328
+ return TransferPolicyDestroyed.fromJSONField( typeArg, json, ) }
329
+
330
+ static fromSuiParsedData<T extends PhantomReified<PhantomTypeArgument>>( typeArg: T, content: SuiParsedData ): TransferPolicyDestroyed<ToPhantomTypeArgument<T>> { if (content.dataType !== "moveObject") { throw new Error("not an object"); } if (!isTransferPolicyDestroyed(content.type)) { throw new Error(`object at ${(content.fields as any).id} is not a TransferPolicyDestroyed object`); } return TransferPolicyDestroyed.fromFieldsWithTypes( typeArg, content ); }
331
+
332
+ static async fetch<T extends PhantomReified<PhantomTypeArgument>>( client: SuiClient, typeArg: T, id: string ): Promise<TransferPolicyDestroyed<ToPhantomTypeArgument<T>>> { const res = await client.getObject({ id, options: { showBcs: true, }, }); if (res.error) { throw new Error(`error fetching TransferPolicyDestroyed object at id ${id}: ${res.error.code}`); } if (res.data?.bcs?.dataType !== "moveObject" || !isTransferPolicyDestroyed(res.data.bcs.type)) { throw new Error(`object at id ${id} is not a TransferPolicyDestroyed object`); }
333
+ return TransferPolicyDestroyed.fromBcs( typeArg, fromB64(res.data.bcs.bcsBytes) ); }
334
+
335
+ }
336
+
337
+ /* ============================== TransferRequest =============================== */
338
+
339
+ export function isTransferRequest(type: string): boolean { type = compressSuiType(type); return type.startsWith("0x2::transfer_policy::TransferRequest<"); }
340
+
341
+ export interface TransferRequestFields<T extends PhantomTypeArgument> { item: ToField<ID>; paid: ToField<"u64">; from: ToField<ID>; receipts: ToField<VecSet<TypeName>> }
342
+
343
+ export type TransferRequestReified<T extends PhantomTypeArgument> = Reified< TransferRequest<T>, TransferRequestFields<T> >;
344
+
345
+ export class TransferRequest<T extends PhantomTypeArgument> implements StructClass { static readonly $typeName = "0x2::transfer_policy::TransferRequest"; static readonly $numTypeParams = 1;
346
+
347
+ readonly $typeName = TransferRequest.$typeName;
348
+
349
+ readonly $fullTypeName: `0x2::transfer_policy::TransferRequest<${PhantomToTypeStr<T>}>`;
350
+
351
+ readonly $typeArgs: [PhantomToTypeStr<T>];
352
+
353
+ readonly item: ToField<ID>; readonly paid: ToField<"u64">; readonly from: ToField<ID>; readonly receipts: ToField<VecSet<TypeName>>
354
+
355
+ private constructor(typeArgs: [PhantomToTypeStr<T>], fields: TransferRequestFields<T>, ) { this.$fullTypeName = composeSuiType( TransferRequest.$typeName, ...typeArgs ) as `0x2::transfer_policy::TransferRequest<${PhantomToTypeStr<T>}>`; this.$typeArgs = typeArgs;
356
+
357
+ this.item = fields.item;; this.paid = fields.paid;; this.from = fields.from;; this.receipts = fields.receipts; }
358
+
359
+ static reified<T extends PhantomReified<PhantomTypeArgument>>( T: T ): TransferRequestReified<ToPhantomTypeArgument<T>> { return { typeName: TransferRequest.$typeName, fullTypeName: composeSuiType( TransferRequest.$typeName, ...[extractType(T)] ) as `0x2::transfer_policy::TransferRequest<${PhantomToTypeStr<ToPhantomTypeArgument<T>>}>`, typeArgs: [ extractType(T) ] as [PhantomToTypeStr<ToPhantomTypeArgument<T>>], reifiedTypeArgs: [T], fromFields: (fields: Record<string, any>) => TransferRequest.fromFields( T, fields, ), fromFieldsWithTypes: (item: FieldsWithTypes) => TransferRequest.fromFieldsWithTypes( T, item, ), fromBcs: (data: Uint8Array) => TransferRequest.fromBcs( T, data, ), bcs: TransferRequest.bcs, fromJSONField: (field: any) => TransferRequest.fromJSONField( T, field, ), fromJSON: (json: Record<string, any>) => TransferRequest.fromJSON( T, json, ), fromSuiParsedData: (content: SuiParsedData) => TransferRequest.fromSuiParsedData( T, content, ), fetch: async (client: SuiClient, id: string) => TransferRequest.fetch( client, T, id, ), new: ( fields: TransferRequestFields<ToPhantomTypeArgument<T>>, ) => { return new TransferRequest( [extractType(T)], fields ) }, kind: "StructClassReified", } }
360
+
361
+ static get r() { return TransferRequest.reified }
362
+
363
+ static phantom<T extends PhantomReified<PhantomTypeArgument>>( T: T ): PhantomReified<ToTypeStr<TransferRequest<ToPhantomTypeArgument<T>>>> { return phantom(TransferRequest.reified( T )); } static get p() { return TransferRequest.phantom }
364
+
365
+ static get bcs() { return bcs.struct("TransferRequest", {
366
+
367
+ item: ID.bcs, paid: bcs.u64(), from: ID.bcs, receipts: VecSet.bcs(TypeName.bcs)
368
+
369
+ }) };
370
+
371
+ static fromFields<T extends PhantomReified<PhantomTypeArgument>>( typeArg: T, fields: Record<string, any> ): TransferRequest<ToPhantomTypeArgument<T>> { return TransferRequest.reified( typeArg, ).new( { item: decodeFromFields(ID.reified(), fields.item), paid: decodeFromFields("u64", fields.paid), from: decodeFromFields(ID.reified(), fields.from), receipts: decodeFromFields(VecSet.reified(TypeName.reified()), fields.receipts) } ) }
372
+
373
+ static fromFieldsWithTypes<T extends PhantomReified<PhantomTypeArgument>>( typeArg: T, item: FieldsWithTypes ): TransferRequest<ToPhantomTypeArgument<T>> { if (!isTransferRequest(item.type)) { throw new Error("not a TransferRequest type");
374
+
375
+ } assertFieldsWithTypesArgsMatch(item, [typeArg]);
376
+
377
+ return TransferRequest.reified( typeArg, ).new( { item: decodeFromFieldsWithTypes(ID.reified(), item.fields.item), paid: decodeFromFieldsWithTypes("u64", item.fields.paid), from: decodeFromFieldsWithTypes(ID.reified(), item.fields.from), receipts: decodeFromFieldsWithTypes(VecSet.reified(TypeName.reified()), item.fields.receipts) } ) }
378
+
379
+ static fromBcs<T extends PhantomReified<PhantomTypeArgument>>( typeArg: T, data: Uint8Array ): TransferRequest<ToPhantomTypeArgument<T>> { return TransferRequest.fromFields( typeArg, TransferRequest.bcs.parse(data) ) }
380
+
381
+ toJSONField() { return {
382
+
383
+ item: this.item,paid: this.paid.toString(),from: this.from,receipts: this.receipts.toJSONField(),
384
+
385
+ } }
386
+
387
+ toJSON() { return { $typeName: this.$typeName, $typeArgs: this.$typeArgs, ...this.toJSONField() } }
388
+
389
+ static fromJSONField<T extends PhantomReified<PhantomTypeArgument>>( typeArg: T, field: any ): TransferRequest<ToPhantomTypeArgument<T>> { return TransferRequest.reified( typeArg, ).new( { item: decodeFromJSONField(ID.reified(), field.item), paid: decodeFromJSONField("u64", field.paid), from: decodeFromJSONField(ID.reified(), field.from), receipts: decodeFromJSONField(VecSet.reified(TypeName.reified()), field.receipts) } ) }
390
+
391
+ static fromJSON<T extends PhantomReified<PhantomTypeArgument>>( typeArg: T, json: Record<string, any> ): TransferRequest<ToPhantomTypeArgument<T>> { if (json.$typeName !== TransferRequest.$typeName) { throw new Error("not a WithTwoGenerics json object") }; assertReifiedTypeArgsMatch( composeSuiType(TransferRequest.$typeName, extractType(typeArg)), json.$typeArgs, [typeArg], )
392
+
393
+ return TransferRequest.fromJSONField( typeArg, json, ) }
394
+
395
+ static fromSuiParsedData<T extends PhantomReified<PhantomTypeArgument>>( typeArg: T, content: SuiParsedData ): TransferRequest<ToPhantomTypeArgument<T>> { if (content.dataType !== "moveObject") { throw new Error("not an object"); } if (!isTransferRequest(content.type)) { throw new Error(`object at ${(content.fields as any).id} is not a TransferRequest object`); } return TransferRequest.fromFieldsWithTypes( typeArg, content ); }
396
+
397
+ static async fetch<T extends PhantomReified<PhantomTypeArgument>>( client: SuiClient, typeArg: T, id: string ): Promise<TransferRequest<ToPhantomTypeArgument<T>>> { const res = await client.getObject({ id, options: { showBcs: true, }, }); if (res.error) { throw new Error(`error fetching TransferRequest object at id ${id}: ${res.error.code}`); } if (res.data?.bcs?.dataType !== "moveObject" || !isTransferRequest(res.data.bcs.type)) { throw new Error(`object at id ${id} is not a TransferRequest object`); }
398
+ return TransferRequest.fromBcs( typeArg, fromB64(res.data.bcs.bcsBytes) ); }
399
+
400
+ }
@@ -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, fromHEX, toHEX} from "@mysten/bcs";
5
+ import {SuiClient, SuiParsedData} from "@mysten/sui.js/client";
6
+
7
+ /* ============================== TxContext =============================== */
8
+
9
+ export function isTxContext(type: string): boolean { type = compressSuiType(type); return type === "0x2::tx_context::TxContext"; }
10
+
11
+ export interface TxContextFields { sender: ToField<"address">; txHash: ToField<Vector<"u8">>; epoch: ToField<"u64">; epochTimestampMs: ToField<"u64">; idsCreated: ToField<"u64"> }
12
+
13
+ export type TxContextReified = Reified< TxContext, TxContextFields >;
14
+
15
+ export class TxContext implements StructClass { static readonly $typeName = "0x2::tx_context::TxContext"; static readonly $numTypeParams = 0;
16
+
17
+ readonly $typeName = TxContext.$typeName;
18
+
19
+ readonly $fullTypeName: "0x2::tx_context::TxContext";
20
+
21
+ readonly $typeArgs: [];
22
+
23
+ readonly sender: ToField<"address">; readonly txHash: ToField<Vector<"u8">>; readonly epoch: ToField<"u64">; readonly epochTimestampMs: ToField<"u64">; readonly idsCreated: ToField<"u64">
24
+
25
+ private constructor(typeArgs: [], fields: TxContextFields, ) { this.$fullTypeName = composeSuiType( TxContext.$typeName, ...typeArgs ) as "0x2::tx_context::TxContext"; this.$typeArgs = typeArgs;
26
+
27
+ this.sender = fields.sender;; this.txHash = fields.txHash;; this.epoch = fields.epoch;; this.epochTimestampMs = fields.epochTimestampMs;; this.idsCreated = fields.idsCreated; }
28
+
29
+ static reified( ): TxContextReified { return { typeName: TxContext.$typeName, fullTypeName: composeSuiType( TxContext.$typeName, ...[] ) as "0x2::tx_context::TxContext", typeArgs: [ ] as [], reifiedTypeArgs: [], fromFields: (fields: Record<string, any>) => TxContext.fromFields( fields, ), fromFieldsWithTypes: (item: FieldsWithTypes) => TxContext.fromFieldsWithTypes( item, ), fromBcs: (data: Uint8Array) => TxContext.fromBcs( data, ), bcs: TxContext.bcs, fromJSONField: (field: any) => TxContext.fromJSONField( field, ), fromJSON: (json: Record<string, any>) => TxContext.fromJSON( json, ), fromSuiParsedData: (content: SuiParsedData) => TxContext.fromSuiParsedData( content, ), fetch: async (client: SuiClient, id: string) => TxContext.fetch( client, id, ), new: ( fields: TxContextFields, ) => { return new TxContext( [], fields ) }, kind: "StructClassReified", } }
30
+
31
+ static get r() { return TxContext.reified() }
32
+
33
+ static phantom( ): PhantomReified<ToTypeStr<TxContext>> { return phantom(TxContext.reified( )); } static get p() { return TxContext.phantom() }
34
+
35
+ static get bcs() { return bcs.struct("TxContext", {
36
+
37
+ sender: bcs.bytes(32).transform({ input: (val: string) => fromHEX(val), output: (val: Uint8Array) => toHEX(val), }), tx_hash: bcs.vector(bcs.u8()), epoch: bcs.u64(), epoch_timestamp_ms: bcs.u64(), ids_created: bcs.u64()
38
+
39
+ }) };
40
+
41
+ static fromFields( fields: Record<string, any> ): TxContext { return TxContext.reified( ).new( { sender: decodeFromFields("address", fields.sender), txHash: decodeFromFields(reified.vector("u8"), fields.tx_hash), epoch: decodeFromFields("u64", fields.epoch), epochTimestampMs: decodeFromFields("u64", fields.epoch_timestamp_ms), idsCreated: decodeFromFields("u64", fields.ids_created) } ) }
42
+
43
+ static fromFieldsWithTypes( item: FieldsWithTypes ): TxContext { if (!isTxContext(item.type)) { throw new Error("not a TxContext type");
44
+
45
+ }
46
+
47
+ return TxContext.reified( ).new( { sender: decodeFromFieldsWithTypes("address", item.fields.sender), txHash: decodeFromFieldsWithTypes(reified.vector("u8"), item.fields.tx_hash), epoch: decodeFromFieldsWithTypes("u64", item.fields.epoch), epochTimestampMs: decodeFromFieldsWithTypes("u64", item.fields.epoch_timestamp_ms), idsCreated: decodeFromFieldsWithTypes("u64", item.fields.ids_created) } ) }
48
+
49
+ static fromBcs( data: Uint8Array ): TxContext { return TxContext.fromFields( TxContext.bcs.parse(data) ) }
50
+
51
+ toJSONField() { return {
52
+
53
+ sender: this.sender,txHash: fieldToJSON<Vector<"u8">>(`vector<u8>`, this.txHash),epoch: this.epoch.toString(),epochTimestampMs: this.epochTimestampMs.toString(),idsCreated: this.idsCreated.toString(),
54
+
55
+ } }
56
+
57
+ toJSON() { return { $typeName: this.$typeName, $typeArgs: this.$typeArgs, ...this.toJSONField() } }
58
+
59
+ static fromJSONField( field: any ): TxContext { return TxContext.reified( ).new( { sender: decodeFromJSONField("address", field.sender), txHash: decodeFromJSONField(reified.vector("u8"), field.txHash), epoch: decodeFromJSONField("u64", field.epoch), epochTimestampMs: decodeFromJSONField("u64", field.epochTimestampMs), idsCreated: decodeFromJSONField("u64", field.idsCreated) } ) }
60
+
61
+ static fromJSON( json: Record<string, any> ): TxContext { if (json.$typeName !== TxContext.$typeName) { throw new Error("not a WithTwoGenerics json object") };
62
+
63
+ return TxContext.fromJSONField( json, ) }
64
+
65
+ static fromSuiParsedData( content: SuiParsedData ): TxContext { if (content.dataType !== "moveObject") { throw new Error("not an object"); } if (!isTxContext(content.type)) { throw new Error(`object at ${(content.fields as any).id} is not a TxContext object`); } return TxContext.fromFieldsWithTypes( content ); }
66
+
67
+ static async fetch( client: SuiClient, id: string ): Promise<TxContext> { const res = await client.getObject({ id, options: { showBcs: true, }, }); if (res.error) { throw new Error(`error fetching TxContext object at id ${id}: ${res.error.code}`); } if (res.data?.bcs?.dataType !== "moveObject" || !isTxContext(res.data.bcs.type)) { throw new Error(`object at id ${id} is not a TxContext object`); }
68
+ return TxContext.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 "../../0x1/ascii/structs";
4
+ import {bcs, fromB64} from "@mysten/bcs";
5
+ import {SuiClient, SuiParsedData} from "@mysten/sui.js/client";
6
+
7
+ /* ============================== Url =============================== */
8
+
9
+ export function isUrl(type: string): boolean { type = compressSuiType(type); return type === "0x2::url::Url"; }
10
+
11
+ export interface UrlFields { url: ToField<String> }
12
+
13
+ export type UrlReified = Reified< Url, UrlFields >;
14
+
15
+ export class Url implements StructClass { static readonly $typeName = "0x2::url::Url"; static readonly $numTypeParams = 0;
16
+
17
+ readonly $typeName = Url.$typeName;
18
+
19
+ readonly $fullTypeName: "0x2::url::Url";
20
+
21
+ readonly $typeArgs: [];
22
+
23
+ readonly url: ToField<String>
24
+
25
+ private constructor(typeArgs: [], fields: UrlFields, ) { this.$fullTypeName = composeSuiType( Url.$typeName, ...typeArgs ) as "0x2::url::Url"; this.$typeArgs = typeArgs;
26
+
27
+ this.url = fields.url; }
28
+
29
+ static reified( ): UrlReified { return { typeName: Url.$typeName, fullTypeName: composeSuiType( Url.$typeName, ...[] ) as "0x2::url::Url", typeArgs: [ ] as [], reifiedTypeArgs: [], fromFields: (fields: Record<string, any>) => Url.fromFields( fields, ), fromFieldsWithTypes: (item: FieldsWithTypes) => Url.fromFieldsWithTypes( item, ), fromBcs: (data: Uint8Array) => Url.fromBcs( data, ), bcs: Url.bcs, fromJSONField: (field: any) => Url.fromJSONField( field, ), fromJSON: (json: Record<string, any>) => Url.fromJSON( json, ), fromSuiParsedData: (content: SuiParsedData) => Url.fromSuiParsedData( content, ), fetch: async (client: SuiClient, id: string) => Url.fetch( client, id, ), new: ( fields: UrlFields, ) => { return new Url( [], fields ) }, kind: "StructClassReified", } }
30
+
31
+ static get r() { return Url.reified() }
32
+
33
+ static phantom( ): PhantomReified<ToTypeStr<Url>> { return phantom(Url.reified( )); } static get p() { return Url.phantom() }
34
+
35
+ static get bcs() { return bcs.struct("Url", {
36
+
37
+ url: String.bcs
38
+
39
+ }) };
40
+
41
+ static fromFields( fields: Record<string, any> ): Url { return Url.reified( ).new( { url: decodeFromFields(String.reified(), fields.url) } ) }
42
+
43
+ static fromFieldsWithTypes( item: FieldsWithTypes ): Url { if (!isUrl(item.type)) { throw new Error("not a Url type");
44
+
45
+ }
46
+
47
+ return Url.reified( ).new( { url: decodeFromFieldsWithTypes(String.reified(), item.fields.url) } ) }
48
+
49
+ static fromBcs( data: Uint8Array ): Url { return Url.fromFields( Url.bcs.parse(data) ) }
50
+
51
+ toJSONField() { return {
52
+
53
+ url: this.url,
54
+
55
+ } }
56
+
57
+ toJSON() { return { $typeName: this.$typeName, $typeArgs: this.$typeArgs, ...this.toJSONField() } }
58
+
59
+ static fromJSONField( field: any ): Url { return Url.reified( ).new( { url: decodeFromJSONField(String.reified(), field.url) } ) }
60
+
61
+ static fromJSON( json: Record<string, any> ): Url { if (json.$typeName !== Url.$typeName) { throw new Error("not a WithTwoGenerics json object") };
62
+
63
+ return Url.fromJSONField( json, ) }
64
+
65
+ static fromSuiParsedData( content: SuiParsedData ): Url { if (content.dataType !== "moveObject") { throw new Error("not an object"); } if (!isUrl(content.type)) { throw new Error(`object at ${(content.fields as any).id} is not a Url object`); } return Url.fromFieldsWithTypes( content ); }
66
+
67
+ static async fetch( client: SuiClient, id: string ): Promise<Url> { const res = await client.getObject({ id, options: { showBcs: true, }, }); if (res.error) { throw new Error(`error fetching Url object at id ${id}: ${res.error.code}`); } if (res.data?.bcs?.dataType !== "moveObject" || !isUrl(res.data.bcs.type)) { throw new Error(`object at id ${id} is not a Url object`); }
68
+ return Url.fromBcs( fromB64(res.data.bcs.bcsBytes) ); }
69
+
70
+ }