create-dubhe 1.2.0-pre.98 → 2.0.0

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 (361) hide show
  1. package/dist/cli.js +1 -1
  2. package/dist/cli.js.map +1 -1
  3. package/package.json +16 -16
  4. package/templates/101/sui-template/docker-compose.testnet.yml +73 -0
  5. package/templates/101/sui-template/packages/client/src/app/page.tsx +545 -41
  6. package/templates/101/sui-template/packages/client/src/app/providers.tsx +12 -4
  7. package/templates/101/sui-template/packages/contracts/Pub.localnet.toml +4 -4
  8. package/templates/101/sui-template/packages/contracts/counter.lock.json +20 -0
  9. package/templates/101/sui-template/packages/contracts/deployment.ts +8 -3
  10. package/templates/101/sui-template/packages/contracts/dubhe.config.json +59 -13
  11. package/templates/101/sui-template/packages/contracts/dubhe.config.ts +1 -4
  12. package/templates/101/sui-template/packages/contracts/metadata.json +1015 -68
  13. package/templates/101/sui-template/packages/contracts/package.json +7 -4
  14. package/templates/101/sui-template/packages/contracts/src/counter/sources/codegen/dapp_key.move +45 -31
  15. package/templates/101/sui-template/packages/contracts/src/counter/sources/codegen/error.move +8 -0
  16. package/templates/101/sui-template/packages/contracts/src/counter/sources/codegen/genesis.move +30 -13
  17. package/templates/101/sui-template/packages/contracts/src/counter/sources/codegen/init_test.move +19 -14
  18. package/templates/101/sui-template/packages/contracts/src/counter/sources/codegen/resources/counter2.move +198 -0
  19. package/templates/101/sui-template/packages/contracts/src/counter/sources/codegen/resources/counter2withkey.move +90 -0
  20. package/templates/101/sui-template/packages/contracts/src/counter/sources/codegen/resources/value.move +30 -20
  21. package/templates/101/sui-template/packages/contracts/src/counter/sources/codegen/user_storage_init.move +26 -0
  22. package/templates/101/sui-template/packages/contracts/src/counter/sources/scripts/deploy_hook.move +6 -11
  23. package/templates/101/sui-template/packages/contracts/src/counter/sources/systems/counter.move +23 -11
  24. package/templates/101/sui-template/packages/contracts/src/counter/sources/tests/counter.move +15 -14
  25. package/templates/101/sui-template/packages/contracts/src/dubhe/Move.lock +33 -30
  26. package/templates/101/sui-template/packages/contracts/src/dubhe/Move.toml +8 -3
  27. package/templates/101/sui-template/packages/contracts/src/dubhe/sources/codegen/dapp_key.move +45 -31
  28. package/templates/101/sui-template/packages/contracts/src/dubhe/sources/codegen/error.move +170 -0
  29. package/templates/101/sui-template/packages/contracts/src/dubhe/sources/codegen/genesis.move +16 -13
  30. package/templates/101/sui-template/packages/contracts/src/dubhe/sources/codegen/init_test.move +8 -14
  31. package/templates/101/sui-template/packages/contracts/src/dubhe/sources/core/account_key.move +1 -3
  32. package/templates/101/sui-template/packages/contracts/src/dubhe/sources/core/dapp_service.move +1776 -137
  33. package/templates/101/sui-template/packages/contracts/src/dubhe/sources/core/data_key.move +1 -20
  34. package/templates/101/sui-template/packages/contracts/src/dubhe/sources/core/events.move +864 -25
  35. package/templates/101/sui-template/packages/contracts/src/dubhe/sources/scripts/deploy_hook.move +15 -16
  36. package/templates/101/sui-template/packages/contracts/src/dubhe/sources/scripts/migrate.move +0 -3
  37. package/templates/101/sui-template/packages/contracts/src/dubhe/sources/systems/address_system.move +25 -17
  38. package/templates/101/sui-template/packages/contracts/src/dubhe/sources/systems/dapp_system.move +2802 -343
  39. package/templates/101/sui-template/packages/contracts/src/dubhe/sources/systems/utils.move +1 -1
  40. package/templates/101/sui-template/packages/contracts/src/dubhe/sources/tests/address.move +173 -55
  41. package/templates/101/sui-template/packages/contracts/src/dubhe/sources/tests/dapp_test.move +769 -0
  42. package/templates/101/sui-template/packages/contracts/src/dubhe/sources/tests/fee_test.move +2965 -0
  43. package/templates/101/sui-template/packages/contracts/src/dubhe/sources/tests/integration_test.move +303 -0
  44. package/templates/101/sui-template/packages/contracts/src/dubhe/sources/tests/listing_test.move +1422 -0
  45. package/templates/101/sui-template/packages/contracts/src/dubhe/sources/tests/scene_session_test.move +269 -0
  46. package/templates/101/sui-template/packages/contracts/src/dubhe/sources/tests/session_test.move +624 -0
  47. package/templates/101/sui-template/packages/contracts/src/dubhe/sources/tests/storage_test.move +700 -0
  48. package/templates/101/sui-template/packages/contracts/src/dubhe/sources/tests/typed_object_test.move +177 -0
  49. package/templates/101/sui-template/packages/contracts/src/dubhe/sources/tests/typed_scene_test.move +452 -0
  50. package/templates/101/sui-template/packages/contracts/src/dubhe/sources/tests/user_storage_test.move +160 -0
  51. package/templates/101/sui-template/packages/contracts/src/dubhe/sources/utils/math.move +4 -3
  52. package/templates/101/sui-template/packages/contracts/src/dubhe/sources/utils/type_info.move +2 -2
  53. package/templates/contract/sui-template/dubhe.config.ts +0 -1
  54. package/templates/contract/sui-template/package.json +3 -3
  55. package/templates/contract/sui-template/src/dubhe/Move.lock +33 -30
  56. package/templates/contract/sui-template/src/dubhe/Move.toml +8 -3
  57. package/templates/contract/sui-template/src/dubhe/sources/codegen/dapp_key.move +45 -31
  58. package/templates/contract/sui-template/src/dubhe/sources/codegen/error.move +170 -0
  59. package/templates/contract/sui-template/src/dubhe/sources/codegen/genesis.move +16 -13
  60. package/templates/contract/sui-template/src/dubhe/sources/codegen/init_test.move +8 -14
  61. package/templates/contract/sui-template/src/dubhe/sources/core/account_key.move +1 -3
  62. package/templates/contract/sui-template/src/dubhe/sources/core/dapp_service.move +1776 -137
  63. package/templates/contract/sui-template/src/dubhe/sources/core/data_key.move +1 -20
  64. package/templates/contract/sui-template/src/dubhe/sources/core/events.move +864 -25
  65. package/templates/contract/sui-template/src/dubhe/sources/scripts/deploy_hook.move +15 -16
  66. package/templates/contract/sui-template/src/dubhe/sources/scripts/migrate.move +0 -3
  67. package/templates/contract/sui-template/src/dubhe/sources/systems/address_system.move +25 -17
  68. package/templates/contract/sui-template/src/dubhe/sources/systems/dapp_system.move +2802 -343
  69. package/templates/contract/sui-template/src/dubhe/sources/systems/utils.move +1 -1
  70. package/templates/contract/sui-template/src/dubhe/sources/tests/address.move +173 -55
  71. package/templates/contract/sui-template/src/dubhe/sources/tests/dapp_test.move +769 -0
  72. package/templates/contract/sui-template/src/dubhe/sources/tests/fee_test.move +2965 -0
  73. package/templates/contract/sui-template/src/dubhe/sources/tests/integration_test.move +303 -0
  74. package/templates/contract/sui-template/src/dubhe/sources/tests/listing_test.move +1422 -0
  75. package/templates/contract/sui-template/src/dubhe/sources/tests/scene_session_test.move +269 -0
  76. package/templates/contract/sui-template/src/dubhe/sources/tests/session_test.move +624 -0
  77. package/templates/contract/sui-template/src/dubhe/sources/tests/storage_test.move +700 -0
  78. package/templates/contract/sui-template/src/dubhe/sources/tests/typed_object_test.move +177 -0
  79. package/templates/contract/sui-template/src/dubhe/sources/tests/typed_scene_test.move +452 -0
  80. package/templates/contract/sui-template/src/dubhe/sources/tests/user_storage_test.move +160 -0
  81. package/templates/contract/sui-template/src/dubhe/sources/utils/math.move +4 -3
  82. package/templates/contract/sui-template/src/dubhe/sources/utils/type_info.move +2 -2
  83. package/templates/contract/sui-template/src/template/Move.toml +12 -0
  84. package/templates/contract/sui-template/src/template/sources/codegen/dapp_key.move +47 -0
  85. package/templates/contract/sui-template/src/template/sources/codegen/genesis.move +34 -0
  86. package/templates/contract/sui-template/src/template/sources/codegen/init_test.move +23 -0
  87. package/templates/contract/sui-template/src/template/sources/codegen/user_storage_init.move +27 -0
  88. package/templates/contract/sui-template/src/template/sources/scripts/deploy_hook.move +13 -0
  89. package/templates/contract/sui-template/src/template/sources/scripts/migrate.move +7 -0
  90. package/templates/nextjs/sui-card-duel/.gitignore_ +51 -0
  91. package/templates/nextjs/sui-card-duel/README.md +213 -0
  92. package/templates/nextjs/sui-card-duel/docker-compose.yml +34 -0
  93. package/templates/nextjs/sui-card-duel/mprocs.yaml +17 -0
  94. package/templates/nextjs/sui-card-duel/package.json +43 -0
  95. package/templates/nextjs/sui-card-duel/packages/client/.gitignore_ +48 -0
  96. package/templates/nextjs/sui-card-duel/packages/client/.prettierignore +1 -0
  97. package/templates/nextjs/sui-card-duel/packages/client/.prettierrc.json +8 -0
  98. package/templates/nextjs/sui-card-duel/packages/client/eslint.config.mjs +22 -0
  99. package/templates/nextjs/sui-card-duel/packages/client/next.config.mjs +8 -0
  100. package/templates/nextjs/sui-card-duel/packages/client/package.json +47 -0
  101. package/templates/nextjs/sui-card-duel/packages/client/postcss.config.mjs +8 -0
  102. package/templates/nextjs/sui-card-duel/packages/client/src/app/admin/ArenaPanel.tsx +307 -0
  103. package/templates/nextjs/sui-card-duel/packages/client/src/app/admin/page.tsx +622 -0
  104. package/templates/nextjs/sui-card-duel/packages/client/src/app/brawl/[id]/page.tsx +559 -0
  105. package/templates/nextjs/sui-card-duel/packages/client/src/app/collection/page.tsx +202 -0
  106. package/templates/nextjs/sui-card-duel/packages/client/src/app/components/CardView.tsx +66 -0
  107. package/templates/nextjs/sui-card-duel/packages/client/src/app/components/GameShell.tsx +294 -0
  108. package/templates/nextjs/sui-card-duel/packages/client/src/app/components/icons.tsx +101 -0
  109. package/templates/nextjs/sui-card-duel/packages/client/src/app/duel/[id]/page.tsx +477 -0
  110. package/templates/nextjs/sui-card-duel/packages/client/src/app/favicon.ico +0 -0
  111. package/templates/nextjs/sui-card-duel/packages/client/src/app/globals.css +85 -0
  112. package/templates/nextjs/sui-card-duel/packages/client/src/app/hooks/useGame.ts +313 -0
  113. package/templates/nextjs/sui-card-duel/packages/client/src/app/layout.tsx +24 -0
  114. package/templates/nextjs/sui-card-duel/packages/client/src/app/leaderboard/page.tsx +123 -0
  115. package/templates/nextjs/sui-card-duel/packages/client/src/app/lib/game.ts +77 -0
  116. package/templates/nextjs/sui-card-duel/packages/client/src/app/lib/scenes.ts +226 -0
  117. package/templates/nextjs/sui-card-duel/packages/client/src/app/market/page.tsx +418 -0
  118. package/templates/nextjs/sui-card-duel/packages/client/src/app/page.tsx +427 -0
  119. package/templates/nextjs/sui-card-duel/packages/client/src/app/providers.tsx +69 -0
  120. package/templates/nextjs/sui-card-duel/packages/client/tailwind.config.ts +21 -0
  121. package/templates/nextjs/sui-card-duel/packages/client/tsconfig.json +30 -0
  122. package/templates/nextjs/sui-card-duel/packages/contracts/.gitignore_ +51 -0
  123. package/templates/nextjs/sui-card-duel/packages/contracts/.prettierignore +1 -0
  124. package/templates/nextjs/sui-card-duel/packages/contracts/.prettierrc.json +8 -0
  125. package/templates/nextjs/sui-card-duel/packages/contracts/Dockerfile +5 -0
  126. package/templates/nextjs/sui-card-duel/packages/contracts/Pub.localnet.toml +13 -0
  127. package/templates/nextjs/sui-card-duel/packages/contracts/card_duel.lock.json +66 -0
  128. package/templates/nextjs/sui-card-duel/packages/contracts/docker-compose.yml +34 -0
  129. package/templates/nextjs/sui-card-duel/packages/contracts/dubhe.config.ts +150 -0
  130. package/templates/nextjs/sui-card-duel/packages/contracts/logs/combined.log +31383 -0
  131. package/templates/nextjs/sui-card-duel/packages/contracts/package.json +49 -0
  132. package/templates/nextjs/sui-card-duel/packages/contracts/scripts/config.ts +17 -0
  133. package/templates/nextjs/sui-card-duel/packages/contracts/scripts/e2e-brawl.ts +270 -0
  134. package/templates/nextjs/sui-card-duel/packages/contracts/scripts/e2e-duel.ts +272 -0
  135. package/templates/nextjs/sui-card-duel/packages/contracts/scripts/e2e-lobby.ts +177 -0
  136. package/templates/nextjs/sui-card-duel/packages/contracts/scripts/e2e-market.ts +219 -0
  137. package/templates/nextjs/sui-card-duel/packages/contracts/scripts/e2e-session.ts +342 -0
  138. package/templates/nextjs/sui-card-duel/packages/contracts/scripts/query-dapp-revenue.ts +95 -0
  139. package/templates/nextjs/sui-card-duel/packages/contracts/scripts/seed.ts +92 -0
  140. package/templates/nextjs/sui-card-duel/packages/contracts/scripts/withdraw-dapp-revenue.ts +56 -0
  141. package/templates/nextjs/sui-card-duel/packages/contracts/src/card_duel/Move.toml +15 -0
  142. package/templates/nextjs/sui-card-duel/packages/contracts/src/card_duel/sources/codegen/dapp_key.move +46 -0
  143. package/templates/nextjs/sui-card-duel/packages/contracts/src/card_duel/sources/codegen/enums/card_kind.move +47 -0
  144. package/templates/nextjs/sui-card-duel/packages/contracts/src/card_duel/sources/codegen/enums/match_state.move +37 -0
  145. package/templates/nextjs/sui-card-duel/packages/contracts/src/card_duel/sources/codegen/enums/rarity.move +37 -0
  146. package/templates/nextjs/sui-card-duel/packages/contracts/src/card_duel/sources/codegen/error.move +126 -0
  147. package/templates/nextjs/sui-card-duel/packages/contracts/src/card_duel/sources/codegen/genesis.move +33 -0
  148. package/templates/nextjs/sui-card-duel/packages/contracts/src/card_duel/sources/codegen/init_test.move +23 -0
  149. package/templates/nextjs/sui-card-duel/packages/contracts/src/card_duel/sources/codegen/objects/arena.move +137 -0
  150. package/templates/nextjs/sui-card-duel/packages/contracts/src/card_duel/sources/codegen/permits/brawl_permit.move +125 -0
  151. package/templates/nextjs/sui-card-duel/packages/contracts/src/card_duel/sources/codegen/permits/duel_permit.move +125 -0
  152. package/templates/nextjs/sui-card-duel/packages/contracts/src/card_duel/sources/codegen/resources/battle_state.move +255 -0
  153. package/templates/nextjs/sui-card-duel/packages/contracts/src/card_duel/sources/codegen/resources/card.move +282 -0
  154. package/templates/nextjs/sui-card-duel/packages/contracts/src/card_duel/sources/codegen/resources/deck.move +64 -0
  155. package/templates/nextjs/sui-card-duel/packages/contracts/src/card_duel/sources/codegen/resources/game_config.move +267 -0
  156. package/templates/nextjs/sui-card-duel/packages/contracts/src/card_duel/sources/codegen/resources/gold.move +205 -0
  157. package/templates/nextjs/sui-card-duel/packages/contracts/src/card_duel/sources/codegen/resources/profile.move +255 -0
  158. package/templates/nextjs/sui-card-duel/packages/contracts/src/card_duel/sources/codegen/scenes/brawl.move +313 -0
  159. package/templates/nextjs/sui-card-duel/packages/contracts/src/card_duel/sources/codegen/scenes/duel.move +313 -0
  160. package/templates/nextjs/sui-card-duel/packages/contracts/src/card_duel/sources/codegen/user_storage_init.move +26 -0
  161. package/templates/nextjs/sui-card-duel/packages/contracts/src/card_duel/sources/scripts/deploy_hook.move +32 -0
  162. package/templates/nextjs/sui-card-duel/packages/contracts/src/card_duel/sources/scripts/migrate.move +7 -0
  163. package/templates/nextjs/sui-card-duel/packages/contracts/src/card_duel/sources/systems/arena_system.move +57 -0
  164. package/templates/nextjs/sui-card-duel/packages/contracts/src/card_duel/sources/systems/brawl_system.move +559 -0
  165. package/templates/nextjs/sui-card-duel/packages/contracts/src/card_duel/sources/systems/card_system.move +146 -0
  166. package/templates/nextjs/sui-card-duel/packages/contracts/src/card_duel/sources/systems/duel_system.move +515 -0
  167. package/templates/nextjs/sui-card-duel/packages/contracts/src/card_duel/sources/systems/market_system.move +115 -0
  168. package/templates/nextjs/sui-card-duel/packages/contracts/src/card_duel/sources/systems/player_system.move +37 -0
  169. package/templates/nextjs/sui-card-duel/packages/contracts/src/card_duel/sources/tests/brawl_tests.move +385 -0
  170. package/templates/nextjs/sui-card-duel/packages/contracts/src/card_duel/sources/tests/duel_tests.move +656 -0
  171. package/templates/nextjs/sui-card-duel/packages/contracts/src/card_duel/sources/tests/test_helpers.move +31 -0
  172. package/templates/nextjs/sui-card-duel/packages/contracts/sui-indexer-schema.graphql +5973 -0
  173. package/templates/nextjs/sui-card-duel/pnpm-workspace.yaml +2 -0
  174. package/templates/nextjs/sui-farm/.gitignore_ +51 -0
  175. package/templates/nextjs/sui-farm/README.md +15 -0
  176. package/templates/nextjs/sui-farm/UPGRADE_NOTES.md +97 -0
  177. package/templates/nextjs/sui-farm/docker-compose.yml +34 -0
  178. package/templates/nextjs/sui-farm/mprocs.yaml +17 -0
  179. package/templates/nextjs/sui-farm/package.json +43 -0
  180. package/templates/nextjs/sui-farm/packages/client/.gitignore_ +48 -0
  181. package/templates/nextjs/sui-farm/packages/client/.prettierignore +1 -0
  182. package/templates/nextjs/sui-farm/packages/client/.prettierrc.json +8 -0
  183. package/templates/nextjs/sui-farm/packages/client/eslint.config.mjs +22 -0
  184. package/templates/nextjs/sui-farm/packages/client/next.config.mjs +8 -0
  185. package/templates/nextjs/sui-farm/packages/client/package.json +47 -0
  186. package/templates/nextjs/sui-farm/packages/client/postcss.config.mjs +8 -0
  187. package/templates/nextjs/sui-farm/packages/client/src/app/admin/page.tsx +618 -0
  188. package/templates/nextjs/sui-farm/packages/client/src/app/components/FarmLand.tsx +526 -0
  189. package/templates/nextjs/sui-farm/packages/client/src/app/components/FarmPlotCard.tsx +215 -0
  190. package/templates/nextjs/sui-farm/packages/client/src/app/components/PetAvatar.tsx +868 -0
  191. package/templates/nextjs/sui-farm/packages/client/src/app/components/PetPanel.tsx +1360 -0
  192. package/templates/nextjs/sui-farm/packages/client/src/app/components/PlantModal.tsx +147 -0
  193. package/templates/nextjs/sui-farm/packages/client/src/app/components/ProxyCard.tsx +684 -0
  194. package/templates/nextjs/sui-farm/packages/client/src/app/components/RanchLand.tsx +822 -0
  195. package/templates/nextjs/sui-farm/packages/client/src/app/components/ResourceHUD.tsx +125 -0
  196. package/templates/nextjs/sui-farm/packages/client/src/app/components/ShopPanel.tsx +232 -0
  197. package/templates/nextjs/sui-farm/packages/client/src/app/components/icons/GameIcons.tsx +574 -0
  198. package/templates/nextjs/sui-farm/packages/client/src/app/favicon.ico +0 -0
  199. package/templates/nextjs/sui-farm/packages/client/src/app/globals.css +423 -0
  200. package/templates/nextjs/sui-farm/packages/client/src/app/hooks/useWorldPermitId.ts +66 -0
  201. package/templates/nextjs/sui-farm/packages/client/src/app/layout.tsx +23 -0
  202. package/templates/nextjs/sui-farm/packages/client/src/app/leaderboard/page.tsx +185 -0
  203. package/templates/nextjs/sui-farm/packages/client/src/app/lib/crops.ts +97 -0
  204. package/templates/nextjs/sui-farm/packages/client/src/app/market/page.tsx +763 -0
  205. package/templates/nextjs/sui-farm/packages/client/src/app/page.tsx +1173 -0
  206. package/templates/nextjs/sui-farm/packages/client/src/app/providers.tsx +69 -0
  207. package/templates/nextjs/sui-farm/packages/client/src/app/state/index.tsx +5 -0
  208. package/templates/nextjs/sui-farm/packages/client/tailwind.config.ts +25 -0
  209. package/templates/nextjs/sui-farm/packages/client/tsconfig.json +30 -0
  210. package/templates/nextjs/sui-farm/packages/contracts/.gitignore_ +51 -0
  211. package/templates/nextjs/sui-farm/packages/contracts/.prettierignore +1 -0
  212. package/templates/nextjs/sui-farm/packages/contracts/.prettierrc.json +8 -0
  213. package/templates/nextjs/sui-farm/packages/contracts/Dockerfile +5 -0
  214. package/templates/nextjs/sui-farm/packages/contracts/Pub.localnet.toml +13 -0
  215. package/templates/nextjs/sui-farm/packages/contracts/counter.lock.json +14 -0
  216. package/templates/nextjs/sui-farm/packages/contracts/docker-compose.yml +34 -0
  217. package/templates/nextjs/sui-farm/packages/contracts/dubhe.config.ts +178 -0
  218. package/templates/nextjs/sui-farm/packages/contracts/harvest.lock.json +120 -0
  219. package/templates/nextjs/sui-farm/packages/contracts/package.json +48 -0
  220. package/templates/nextjs/sui-farm/packages/contracts/scripts/config.ts +17 -0
  221. package/templates/nextjs/sui-farm/packages/contracts/scripts/query-dapp-revenue.ts +95 -0
  222. package/templates/nextjs/sui-farm/packages/contracts/scripts/read-permit.ts +72 -0
  223. package/templates/nextjs/sui-farm/packages/contracts/scripts/seed.ts +85 -0
  224. package/templates/nextjs/sui-farm/packages/contracts/scripts/withdraw-dapp-revenue.ts +56 -0
  225. package/templates/nextjs/sui-farm/packages/contracts/src/counter/Move.toml +14 -0
  226. package/templates/nextjs/sui-farm/packages/contracts/src/counter/sources/codegen/dapp_key.move +31 -0
  227. package/templates/nextjs/sui-farm/packages/contracts/src/counter/sources/codegen/error.move +10 -0
  228. package/templates/nextjs/sui-farm/packages/contracts/src/counter/sources/codegen/genesis.move +33 -0
  229. package/templates/nextjs/sui-farm/packages/contracts/src/counter/sources/codegen/init_test.move +23 -0
  230. package/templates/nextjs/sui-farm/packages/contracts/src/counter/sources/codegen/resources/counter1.move +64 -0
  231. package/templates/nextjs/sui-farm/packages/contracts/src/counter/sources/codegen/resources/counter2.move +70 -0
  232. package/templates/nextjs/sui-farm/packages/contracts/src/counter/sources/codegen/user_storage_init.move +26 -0
  233. package/templates/nextjs/sui-farm/packages/contracts/src/counter/sources/scripts/deploy_hook.move +8 -0
  234. package/templates/nextjs/sui-farm/packages/contracts/src/counter/sources/scripts/migrate.move +8 -0
  235. package/templates/nextjs/sui-farm/packages/contracts/src/counter/sources/systems/counter.move +13 -0
  236. package/templates/nextjs/sui-farm/packages/contracts/src/counter/sources/tests/counter.move +28 -0
  237. package/templates/nextjs/sui-farm/packages/contracts/src/harvest/Move.toml +14 -0
  238. package/templates/nextjs/sui-farm/packages/contracts/src/harvest/sources/codegen/dapp_key.move +46 -0
  239. package/templates/nextjs/sui-farm/packages/contracts/src/harvest/sources/codegen/enums/crop_type.move +47 -0
  240. package/templates/nextjs/sui-farm/packages/contracts/src/harvest/sources/codegen/enums/egg_type.move +42 -0
  241. package/templates/nextjs/sui-farm/packages/contracts/src/harvest/sources/codegen/enums/pet_rarity.move +37 -0
  242. package/templates/nextjs/sui-farm/packages/contracts/src/harvest/sources/codegen/enums/pet_species.move +52 -0
  243. package/templates/nextjs/sui-farm/packages/contracts/src/harvest/sources/codegen/error.move +110 -0
  244. package/templates/nextjs/sui-farm/packages/contracts/src/harvest/sources/codegen/genesis.move +33 -0
  245. package/templates/nextjs/sui-farm/packages/contracts/src/harvest/sources/codegen/init_test.move +23 -0
  246. package/templates/nextjs/sui-farm/packages/contracts/src/harvest/sources/codegen/permits/world.move +125 -0
  247. package/templates/nextjs/sui-farm/packages/contracts/src/harvest/sources/codegen/resources/carrot.move +136 -0
  248. package/templates/nextjs/sui-farm/packages/contracts/src/harvest/sources/codegen/resources/carrot_seed.move +80 -0
  249. package/templates/nextjs/sui-farm/packages/contracts/src/harvest/sources/codegen/resources/common_egg.move +136 -0
  250. package/templates/nextjs/sui-farm/packages/contracts/src/harvest/sources/codegen/resources/corn.move +136 -0
  251. package/templates/nextjs/sui-farm/packages/contracts/src/harvest/sources/codegen/resources/corn_seed.move +80 -0
  252. package/templates/nextjs/sui-farm/packages/contracts/src/harvest/sources/codegen/resources/crow_charges.move +162 -0
  253. package/templates/nextjs/sui-farm/packages/contracts/src/harvest/sources/codegen/resources/crow_damage.move +207 -0
  254. package/templates/nextjs/sui-farm/packages/contracts/src/harvest/sources/codegen/resources/farm_plot.move +261 -0
  255. package/templates/nextjs/sui-farm/packages/contracts/src/harvest/sources/codegen/resources/gold.move +80 -0
  256. package/templates/nextjs/sui-farm/packages/contracts/src/harvest/sources/codegen/resources/pet.move +467 -0
  257. package/templates/nextjs/sui-farm/packages/contracts/src/harvest/sources/codegen/resources/pet_config.move +372 -0
  258. package/templates/nextjs/sui-farm/packages/contracts/src/harvest/sources/codegen/resources/pet_hatch.move +162 -0
  259. package/templates/nextjs/sui-farm/packages/contracts/src/harvest/sources/codegen/resources/pet_slot_index.move +83 -0
  260. package/templates/nextjs/sui-farm/packages/contracts/src/harvest/sources/codegen/resources/pet_slots.move +64 -0
  261. package/templates/nextjs/sui-farm/packages/contracts/src/harvest/sources/codegen/resources/profile.move +162 -0
  262. package/templates/nextjs/sui-farm/packages/contracts/src/harvest/sources/codegen/resources/pumpkin.move +136 -0
  263. package/templates/nextjs/sui-farm/packages/contracts/src/harvest/sources/codegen/resources/pumpkin_seed.move +80 -0
  264. package/templates/nextjs/sui-farm/packages/contracts/src/harvest/sources/codegen/resources/rare_egg.move +136 -0
  265. package/templates/nextjs/sui-farm/packages/contracts/src/harvest/sources/codegen/resources/scarecrow.move +64 -0
  266. package/templates/nextjs/sui-farm/packages/contracts/src/harvest/sources/codegen/resources/season_config.move +197 -0
  267. package/templates/nextjs/sui-farm/packages/contracts/src/harvest/sources/codegen/resources/season_stats.move +64 -0
  268. package/templates/nextjs/sui-farm/packages/contracts/src/harvest/sources/codegen/resources/seasonal_egg.move +136 -0
  269. package/templates/nextjs/sui-farm/packages/contracts/src/harvest/sources/codegen/resources/shop_config.move +267 -0
  270. package/templates/nextjs/sui-farm/packages/contracts/src/harvest/sources/codegen/resources/trophy.move +245 -0
  271. package/templates/nextjs/sui-farm/packages/contracts/src/harvest/sources/codegen/resources/wheat.move +136 -0
  272. package/templates/nextjs/sui-farm/packages/contracts/src/harvest/sources/codegen/resources/wheat_seed.move +80 -0
  273. package/templates/nextjs/sui-farm/packages/contracts/src/harvest/sources/codegen/resources/world_permit_id.move +64 -0
  274. package/templates/nextjs/sui-farm/packages/contracts/src/harvest/sources/codegen/user_storage_init.move +26 -0
  275. package/templates/nextjs/sui-farm/packages/contracts/src/harvest/sources/scripts/deploy_hook.move +45 -0
  276. package/templates/nextjs/sui-farm/packages/contracts/src/harvest/sources/scripts/migrate.move +7 -0
  277. package/templates/nextjs/sui-farm/packages/contracts/src/harvest/sources/systems/crow_system.move +96 -0
  278. package/templates/nextjs/sui-farm/packages/contracts/src/harvest/sources/systems/farm_system.move +182 -0
  279. package/templates/nextjs/sui-farm/packages/contracts/src/harvest/sources/systems/market_system.move +172 -0
  280. package/templates/nextjs/sui-farm/packages/contracts/src/harvest/sources/systems/pet_system.move +495 -0
  281. package/templates/nextjs/sui-farm/packages/contracts/src/harvest/sources/systems/season_system.move +70 -0
  282. package/templates/nextjs/sui-farm/packages/contracts/src/harvest/sources/systems/shop_system.move +112 -0
  283. package/templates/nextjs/sui-farm/packages/contracts/src/harvest/sources/systems/world_system.move +34 -0
  284. package/templates/nextjs/sui-farm/packages/contracts/src/harvest/sources/tests/farm_tests.move +1192 -0
  285. package/templates/nextjs/sui-farm/pnpm-workspace.yaml +2 -0
  286. package/templates/nextjs/sui-template/packages/client/src/app/components/ProxyCard.tsx +683 -0
  287. package/templates/nextjs/sui-template/packages/client/src/app/page.tsx +510 -5
  288. package/templates/nextjs/sui-template/packages/client/src/app/providers.tsx +13 -5
  289. package/templates/nextjs/sui-template/packages/contracts/Pub.localnet.toml +4 -4
  290. package/templates/nextjs/sui-template/packages/contracts/counter.lock.json +14 -0
  291. package/templates/nextjs/sui-template/packages/contracts/deployment.ts +8 -3
  292. package/templates/nextjs/sui-template/packages/contracts/dubhe.config.json +9 -9
  293. package/templates/nextjs/sui-template/packages/contracts/dubhe.config.ts +0 -4
  294. package/templates/nextjs/sui-template/packages/contracts/metadata.json +180 -124
  295. package/templates/nextjs/sui-template/packages/contracts/package.json +8 -4
  296. package/templates/nextjs/sui-template/packages/contracts/src/counter/Move.toml +4 -0
  297. package/templates/nextjs/sui-template/packages/contracts/src/counter/sources/codegen/dapp_key.move +45 -31
  298. package/templates/nextjs/sui-template/packages/contracts/src/counter/sources/codegen/error.move +10 -0
  299. package/templates/nextjs/sui-template/packages/contracts/src/counter/sources/codegen/genesis.move +30 -13
  300. package/templates/nextjs/sui-template/packages/contracts/src/counter/sources/codegen/init_test.move +19 -14
  301. package/templates/nextjs/sui-template/packages/contracts/src/counter/sources/codegen/resources/counter1.move +30 -20
  302. package/templates/nextjs/sui-template/packages/contracts/src/counter/sources/codegen/resources/counter2.move +35 -24
  303. package/templates/nextjs/sui-template/packages/contracts/src/counter/sources/codegen/user_storage_init.move +26 -0
  304. package/templates/nextjs/sui-template/packages/contracts/src/counter/sources/scripts/deploy_hook.move +6 -10
  305. package/templates/nextjs/sui-template/packages/contracts/src/counter/sources/systems/counter.move +7 -20
  306. package/templates/nextjs/sui-template/packages/contracts/src/counter/sources/tests/counter.move +14 -27
  307. package/templates/nextjs/sui-template/packages/contracts/src/dubhe/Move.lock +33 -30
  308. package/templates/nextjs/sui-template/packages/contracts/src/dubhe/Move.toml +8 -3
  309. package/templates/nextjs/sui-template/packages/contracts/src/dubhe/sources/codegen/dapp_key.move +45 -31
  310. package/templates/nextjs/sui-template/packages/contracts/src/dubhe/sources/codegen/error.move +170 -0
  311. package/templates/nextjs/sui-template/packages/contracts/src/dubhe/sources/codegen/genesis.move +16 -13
  312. package/templates/nextjs/sui-template/packages/contracts/src/dubhe/sources/codegen/init_test.move +8 -14
  313. package/templates/nextjs/sui-template/packages/contracts/src/dubhe/sources/core/account_key.move +1 -3
  314. package/templates/nextjs/sui-template/packages/contracts/src/dubhe/sources/core/dapp_service.move +1776 -137
  315. package/templates/nextjs/sui-template/packages/contracts/src/dubhe/sources/core/data_key.move +1 -20
  316. package/templates/nextjs/sui-template/packages/contracts/src/dubhe/sources/core/events.move +864 -25
  317. package/templates/nextjs/sui-template/packages/contracts/src/dubhe/sources/scripts/deploy_hook.move +15 -16
  318. package/templates/nextjs/sui-template/packages/contracts/src/dubhe/sources/scripts/migrate.move +0 -3
  319. package/templates/nextjs/sui-template/packages/contracts/src/dubhe/sources/systems/address_system.move +25 -17
  320. package/templates/nextjs/sui-template/packages/contracts/src/dubhe/sources/systems/dapp_system.move +2802 -343
  321. package/templates/nextjs/sui-template/packages/contracts/src/dubhe/sources/systems/utils.move +1 -1
  322. package/templates/nextjs/sui-template/packages/contracts/src/dubhe/sources/tests/address.move +173 -55
  323. package/templates/nextjs/sui-template/packages/contracts/src/dubhe/sources/tests/dapp_test.move +769 -0
  324. package/templates/nextjs/sui-template/packages/contracts/src/dubhe/sources/tests/fee_test.move +2965 -0
  325. package/templates/nextjs/sui-template/packages/contracts/src/dubhe/sources/tests/integration_test.move +303 -0
  326. package/templates/nextjs/sui-template/packages/contracts/src/dubhe/sources/tests/listing_test.move +1422 -0
  327. package/templates/nextjs/sui-template/packages/contracts/src/dubhe/sources/tests/scene_session_test.move +269 -0
  328. package/templates/nextjs/sui-template/packages/contracts/src/dubhe/sources/tests/session_test.move +624 -0
  329. package/templates/nextjs/sui-template/packages/contracts/src/dubhe/sources/tests/storage_test.move +700 -0
  330. package/templates/nextjs/sui-template/packages/contracts/src/dubhe/sources/tests/typed_object_test.move +177 -0
  331. package/templates/nextjs/sui-template/packages/contracts/src/dubhe/sources/tests/typed_scene_test.move +452 -0
  332. package/templates/nextjs/sui-template/packages/contracts/src/dubhe/sources/tests/user_storage_test.move +160 -0
  333. package/templates/nextjs/sui-template/packages/contracts/src/dubhe/sources/utils/math.move +4 -3
  334. package/templates/nextjs/sui-template/packages/contracts/src/dubhe/sources/utils/type_info.move +2 -2
  335. package/templates/101/sui-template/packages/contracts/src/counter/Move.lock +0 -41
  336. package/templates/101/sui-template/packages/contracts/src/counter/Published.toml +0 -9
  337. package/templates/101/sui-template/packages/contracts/src/counter/sources/codegen/errors.move +0 -12
  338. package/templates/101/sui-template/packages/contracts/src/dubhe/sources/codegen/errors.move +0 -140
  339. package/templates/101/sui-template/packages/contracts/src/dubhe/sources/codegen/resources/dapp_fee_config.move +0 -186
  340. package/templates/101/sui-template/packages/contracts/src/dubhe/sources/codegen/resources/dapp_fee_state.move +0 -306
  341. package/templates/101/sui-template/packages/contracts/src/dubhe/sources/codegen/resources/dapp_metadata.move +0 -396
  342. package/templates/101/sui-template/packages/contracts/src/dubhe/sources/codegen/resources/dubhe_config.move +0 -246
  343. package/templates/101/sui-template/packages/contracts/src/dubhe/sources/core/dapp_store.move +0 -29
  344. package/templates/101/sui-template/packages/contracts/src/dubhe/sources/systems/session_system.move +0 -44
  345. package/templates/contract/sui-template/src/dubhe/sources/codegen/errors.move +0 -140
  346. package/templates/contract/sui-template/src/dubhe/sources/codegen/resources/dapp_fee_config.move +0 -186
  347. package/templates/contract/sui-template/src/dubhe/sources/codegen/resources/dapp_fee_state.move +0 -306
  348. package/templates/contract/sui-template/src/dubhe/sources/codegen/resources/dapp_metadata.move +0 -396
  349. package/templates/contract/sui-template/src/dubhe/sources/codegen/resources/dubhe_config.move +0 -246
  350. package/templates/contract/sui-template/src/dubhe/sources/core/dapp_store.move +0 -29
  351. package/templates/contract/sui-template/src/dubhe/sources/systems/session_system.move +0 -44
  352. package/templates/nextjs/sui-template/packages/contracts/src/counter/Move.lock +0 -47
  353. package/templates/nextjs/sui-template/packages/contracts/src/counter/Published.toml +0 -9
  354. package/templates/nextjs/sui-template/packages/contracts/src/counter/sources/codegen/errors.move +0 -12
  355. package/templates/nextjs/sui-template/packages/contracts/src/dubhe/sources/codegen/errors.move +0 -140
  356. package/templates/nextjs/sui-template/packages/contracts/src/dubhe/sources/codegen/resources/dapp_fee_config.move +0 -186
  357. package/templates/nextjs/sui-template/packages/contracts/src/dubhe/sources/codegen/resources/dapp_fee_state.move +0 -306
  358. package/templates/nextjs/sui-template/packages/contracts/src/dubhe/sources/codegen/resources/dapp_metadata.move +0 -396
  359. package/templates/nextjs/sui-template/packages/contracts/src/dubhe/sources/codegen/resources/dubhe_config.move +0 -246
  360. package/templates/nextjs/sui-template/packages/contracts/src/dubhe/sources/core/dapp_store.move +0 -29
  361. package/templates/nextjs/sui-template/packages/contracts/src/dubhe/sources/systems/session_system.move +0 -44
@@ -1,5 +1,10 @@
1
1
  type NetworkType = 'testnet' | 'mainnet' | 'devnet' | 'localnet';
2
2
 
3
- export const NETWORK: NetworkType = 'localnet';
4
- export const PACKAGE_ID = '0x24897b01c7d0431530d402e4df375350de372976363fe017206a265881f7b936';
5
- export const DUBHE_SCHEMA_ID = '0x2ab2ccf03d090f06932debbb5659fefb07073a03e978d819db0676653486527b';
3
+ export const Network: NetworkType = 'localnet';
4
+ export const PackageId = '0xf9ed1eb340feef0c9c576450fea9895c94b00d636f329cbb618809afad30b1e9';
5
+ export const DappHubId = '0xa5993c7c817169d64272e8b2537c225e59724fcd9165107c95d0154d5e756e9f';
6
+ export const DappStorageId = '0x0142b62a6dd1d38c6129e61a3dfc19e455ffb435a65e7b46204543c4edc48063';
7
+
8
+ // Published package ID of the dubhe framework — required for proxy operations.
9
+ export const FrameworkPackageId: string | undefined =
10
+ '0x954337de6806ee3122d2c6058af41ff4749aa92f8cad1d6963647b6f19f22101';
@@ -1,5 +1,4 @@
1
1
  {
2
- "components": [],
3
2
  "resources": [
4
3
  {
5
4
  "counter1": {
@@ -47,19 +46,19 @@
47
46
  "base_fee": "u256"
48
47
  },
49
48
  {
50
- "byte_fee": "u256"
49
+ "bytes_fee": "u256"
51
50
  },
52
51
  {
53
52
  "free_credit": "u256"
54
53
  },
55
54
  {
56
- "total_bytes_size": "u256"
55
+ "credit_pool": "u256"
57
56
  },
58
57
  {
59
- "total_recharged": "u256"
58
+ "total_settled": "u256"
60
59
  },
61
60
  {
62
- "total_paid": "u256"
61
+ "suspended": "bool"
63
62
  }
64
63
  ],
65
64
  "keys": [
@@ -70,8 +69,9 @@
70
69
  }
71
70
  ],
72
71
  "enums": [],
73
- "original_package_id": "0x24897b01c7d0431530d402e4df375350de372976363fe017206a265881f7b936",
74
- "dubhe_object_id": "0x2ab2ccf03d090f06932debbb5659fefb07073a03e978d819db0676653486527b",
75
- "original_dubhe_package_id": "0x0998156fb668348852da7b22e650d80633490e17bb48db8b7c609e310ab16583",
76
- "start_checkpoint": "151"
72
+ "original_package_id": "0xf9ed1eb340feef0c9c576450fea9895c94b00d636f329cbb618809afad30b1e9",
73
+ "dubhe_object_id": "0xa5993c7c817169d64272e8b2537c225e59724fcd9165107c95d0154d5e756e9f",
74
+ "original_dubhe_package_id": "0x954337de6806ee3122d2c6058af41ff4749aa92f8cad1d6963647b6f19f22101",
75
+ "start_checkpoint": "152",
76
+ "dapp_storage_id": "0x0142b62a6dd1d38c6129e61a3dfc19e455ffb435a65e7b46204543c4edc48063"
77
77
  }
@@ -3,10 +3,6 @@ import { defineConfig } from '@0xobelisk/sui-common';
3
3
  export const dubheConfig = defineConfig({
4
4
  name: 'counter',
5
5
  description: 'counter contract',
6
- components: {
7
- // counter0: {},
8
- // counter1: 'u32'
9
- },
10
6
  resources: {
11
7
  counter1: 'u32',
12
8
  counter2: {
@@ -1,11 +1,11 @@
1
1
  {
2
2
  "counter1": {
3
3
  "fileFormatVersion": 6,
4
- "address": "0x24897b01c7d0431530d402e4df375350de372976363fe017206a265881f7b936",
4
+ "address": "0xf9ed1eb340feef0c9c576450fea9895c94b00d636f329cbb618809afad30b1e9",
5
5
  "name": "counter1",
6
6
  "friends": [
7
7
  {
8
- "address": "0x24897b01c7d0431530d402e4df375350de372976363fe017206a265881f7b936",
8
+ "address": "0xf9ed1eb340feef0c9c576450fea9895c94b00d636f329cbb618809afad30b1e9",
9
9
  "name": "counter_system"
10
10
  }
11
11
  ],
@@ -19,19 +19,21 @@
19
19
  {
20
20
  "MutableReference": {
21
21
  "Struct": {
22
- "address": "0x998156fb668348852da7b22e650d80633490e17bb48db8b7c609e310ab16583",
22
+ "address": "0x954337de6806ee3122d2c6058af41ff4749aa92f8cad1d6963647b6f19f22101",
23
23
  "module": "dapp_service",
24
- "name": "DappHub",
24
+ "name": "UserStorage",
25
25
  "typeArguments": []
26
26
  }
27
27
  }
28
28
  },
29
29
  {
30
- "Struct": {
31
- "address": "0x1",
32
- "module": "ascii",
33
- "name": "String",
34
- "typeArguments": []
30
+ "Reference": {
31
+ "Struct": {
32
+ "address": "0x2",
33
+ "module": "tx_context",
34
+ "name": "TxContext",
35
+ "typeArguments": []
36
+ }
35
37
  }
36
38
  }
37
39
  ],
@@ -52,7 +54,7 @@
52
54
  }
53
55
  ]
54
56
  },
55
- "get": {
57
+ "ensure_has": {
56
58
  "visibility": "Public",
57
59
  "isEntry": false,
58
60
  "typeParameters": [],
@@ -60,19 +62,47 @@
60
62
  {
61
63
  "Reference": {
62
64
  "Struct": {
63
- "address": "0x998156fb668348852da7b22e650d80633490e17bb48db8b7c609e310ab16583",
65
+ "address": "0x954337de6806ee3122d2c6058af41ff4749aa92f8cad1d6963647b6f19f22101",
64
66
  "module": "dapp_service",
65
- "name": "DappHub",
67
+ "name": "UserStorage",
66
68
  "typeArguments": []
67
69
  }
68
70
  }
69
- },
71
+ }
72
+ ],
73
+ "return": []
74
+ },
75
+ "ensure_has_not": {
76
+ "visibility": "Public",
77
+ "isEntry": false,
78
+ "typeParameters": [],
79
+ "parameters": [
70
80
  {
71
- "Struct": {
72
- "address": "0x1",
73
- "module": "ascii",
74
- "name": "String",
75
- "typeArguments": []
81
+ "Reference": {
82
+ "Struct": {
83
+ "address": "0x954337de6806ee3122d2c6058af41ff4749aa92f8cad1d6963647b6f19f22101",
84
+ "module": "dapp_service",
85
+ "name": "UserStorage",
86
+ "typeArguments": []
87
+ }
88
+ }
89
+ }
90
+ ],
91
+ "return": []
92
+ },
93
+ "get": {
94
+ "visibility": "Public",
95
+ "isEntry": false,
96
+ "typeParameters": [],
97
+ "parameters": [
98
+ {
99
+ "Reference": {
100
+ "Struct": {
101
+ "address": "0x954337de6806ee3122d2c6058af41ff4749aa92f8cad1d6963647b6f19f22101",
102
+ "module": "dapp_service",
103
+ "name": "UserStorage",
104
+ "typeArguments": []
105
+ }
76
106
  }
77
107
  }
78
108
  ],
@@ -88,20 +118,12 @@
88
118
  {
89
119
  "Reference": {
90
120
  "Struct": {
91
- "address": "0x998156fb668348852da7b22e650d80633490e17bb48db8b7c609e310ab16583",
121
+ "address": "0x954337de6806ee3122d2c6058af41ff4749aa92f8cad1d6963647b6f19f22101",
92
122
  "module": "dapp_service",
93
- "name": "DappHub",
123
+ "name": "UserStorage",
94
124
  "typeArguments": []
95
125
  }
96
126
  }
97
- },
98
- {
99
- "Struct": {
100
- "address": "0x1",
101
- "module": "ascii",
102
- "name": "String",
103
- "typeArguments": []
104
- }
105
127
  }
106
128
  ],
107
129
  "return": [
@@ -116,21 +138,13 @@
116
138
  {
117
139
  "MutableReference": {
118
140
  "Struct": {
119
- "address": "0x998156fb668348852da7b22e650d80633490e17bb48db8b7c609e310ab16583",
141
+ "address": "0x954337de6806ee3122d2c6058af41ff4749aa92f8cad1d6963647b6f19f22101",
120
142
  "module": "dapp_service",
121
- "name": "DappHub",
143
+ "name": "UserStorage",
122
144
  "typeArguments": []
123
145
  }
124
146
  }
125
147
  },
126
- {
127
- "Struct": {
128
- "address": "0x1",
129
- "module": "ascii",
130
- "name": "String",
131
- "typeArguments": []
132
- }
133
- },
134
148
  "U32",
135
149
  {
136
150
  "MutableReference": {
@@ -149,14 +163,9 @@
149
163
  },
150
164
  "counter2": {
151
165
  "fileFormatVersion": 6,
152
- "address": "0x24897b01c7d0431530d402e4df375350de372976363fe017206a265881f7b936",
166
+ "address": "0xf9ed1eb340feef0c9c576450fea9895c94b00d636f329cbb618809afad30b1e9",
153
167
  "name": "counter2",
154
- "friends": [
155
- {
156
- "address": "0x24897b01c7d0431530d402e4df375350de372976363fe017206a265881f7b936",
157
- "name": "counter_system"
158
- }
159
- ],
168
+ "friends": [],
160
169
  "structs": {},
161
170
  "exposedFunctions": {
162
171
  "delete": {
@@ -167,22 +176,24 @@
167
176
  {
168
177
  "MutableReference": {
169
178
  "Struct": {
170
- "address": "0x998156fb668348852da7b22e650d80633490e17bb48db8b7c609e310ab16583",
179
+ "address": "0x954337de6806ee3122d2c6058af41ff4749aa92f8cad1d6963647b6f19f22101",
171
180
  "module": "dapp_service",
172
- "name": "DappHub",
181
+ "name": "UserStorage",
173
182
  "typeArguments": []
174
183
  }
175
184
  }
176
185
  },
186
+ "U64",
177
187
  {
178
- "Struct": {
179
- "address": "0x1",
180
- "module": "ascii",
181
- "name": "String",
182
- "typeArguments": []
188
+ "Reference": {
189
+ "Struct": {
190
+ "address": "0x2",
191
+ "module": "tx_context",
192
+ "name": "TxContext",
193
+ "typeArguments": []
194
+ }
183
195
  }
184
- },
185
- "U64"
196
+ }
186
197
  ],
187
198
  "return": []
188
199
  },
@@ -209,21 +220,13 @@
209
220
  {
210
221
  "Reference": {
211
222
  "Struct": {
212
- "address": "0x998156fb668348852da7b22e650d80633490e17bb48db8b7c609e310ab16583",
223
+ "address": "0x954337de6806ee3122d2c6058af41ff4749aa92f8cad1d6963647b6f19f22101",
213
224
  "module": "dapp_service",
214
- "name": "DappHub",
225
+ "name": "UserStorage",
215
226
  "typeArguments": []
216
227
  }
217
228
  }
218
229
  },
219
- {
220
- "Struct": {
221
- "address": "0x1",
222
- "module": "ascii",
223
- "name": "String",
224
- "typeArguments": []
225
- }
226
- },
227
230
  "U64"
228
231
  ],
229
232
  "return": []
@@ -236,21 +239,13 @@
236
239
  {
237
240
  "Reference": {
238
241
  "Struct": {
239
- "address": "0x998156fb668348852da7b22e650d80633490e17bb48db8b7c609e310ab16583",
242
+ "address": "0x954337de6806ee3122d2c6058af41ff4749aa92f8cad1d6963647b6f19f22101",
240
243
  "module": "dapp_service",
241
- "name": "DappHub",
244
+ "name": "UserStorage",
242
245
  "typeArguments": []
243
246
  }
244
247
  }
245
248
  },
246
- {
247
- "Struct": {
248
- "address": "0x1",
249
- "module": "ascii",
250
- "name": "String",
251
- "typeArguments": []
252
- }
253
- },
254
249
  "U64"
255
250
  ],
256
251
  "return": []
@@ -263,21 +258,13 @@
263
258
  {
264
259
  "Reference": {
265
260
  "Struct": {
266
- "address": "0x998156fb668348852da7b22e650d80633490e17bb48db8b7c609e310ab16583",
261
+ "address": "0x954337de6806ee3122d2c6058af41ff4749aa92f8cad1d6963647b6f19f22101",
267
262
  "module": "dapp_service",
268
- "name": "DappHub",
263
+ "name": "UserStorage",
269
264
  "typeArguments": []
270
265
  }
271
266
  }
272
267
  },
273
- {
274
- "Struct": {
275
- "address": "0x1",
276
- "module": "ascii",
277
- "name": "String",
278
- "typeArguments": []
279
- }
280
- },
281
268
  "U64"
282
269
  ],
283
270
  "return": [
@@ -292,21 +279,13 @@
292
279
  {
293
280
  "Reference": {
294
281
  "Struct": {
295
- "address": "0x998156fb668348852da7b22e650d80633490e17bb48db8b7c609e310ab16583",
282
+ "address": "0x954337de6806ee3122d2c6058af41ff4749aa92f8cad1d6963647b6f19f22101",
296
283
  "module": "dapp_service",
297
- "name": "DappHub",
284
+ "name": "UserStorage",
298
285
  "typeArguments": []
299
286
  }
300
287
  }
301
288
  },
302
- {
303
- "Struct": {
304
- "address": "0x1",
305
- "module": "ascii",
306
- "name": "String",
307
- "typeArguments": []
308
- }
309
- },
310
289
  "U64"
311
290
  ],
312
291
  "return": [
@@ -321,21 +300,13 @@
321
300
  {
322
301
  "MutableReference": {
323
302
  "Struct": {
324
- "address": "0x998156fb668348852da7b22e650d80633490e17bb48db8b7c609e310ab16583",
303
+ "address": "0x954337de6806ee3122d2c6058af41ff4749aa92f8cad1d6963647b6f19f22101",
325
304
  "module": "dapp_service",
326
- "name": "DappHub",
305
+ "name": "UserStorage",
327
306
  "typeArguments": []
328
307
  }
329
308
  }
330
309
  },
331
- {
332
- "Struct": {
333
- "address": "0x1",
334
- "module": "ascii",
335
- "name": "String",
336
- "typeArguments": []
337
- }
338
- },
339
310
  "U64",
340
311
  "U32",
341
312
  {
@@ -355,7 +326,7 @@
355
326
  },
356
327
  "counter_system": {
357
328
  "fileFormatVersion": 6,
358
- "address": "0x24897b01c7d0431530d402e4df375350de372976363fe017206a265881f7b936",
329
+ "address": "0xf9ed1eb340feef0c9c576450fea9895c94b00d636f329cbb618809afad30b1e9",
359
330
  "name": "counter_system",
360
331
  "friends": [],
361
332
  "structs": {},
@@ -368,9 +339,9 @@
368
339
  {
369
340
  "MutableReference": {
370
341
  "Struct": {
371
- "address": "0x998156fb668348852da7b22e650d80633490e17bb48db8b7c609e310ab16583",
342
+ "address": "0x954337de6806ee3122d2c6058af41ff4749aa92f8cad1d6963647b6f19f22101",
372
343
  "module": "dapp_service",
373
- "name": "DappHub",
344
+ "name": "UserStorage",
374
345
  "typeArguments": []
375
346
  }
376
347
  }
@@ -393,19 +364,19 @@
393
364
  },
394
365
  "dapp_key": {
395
366
  "fileFormatVersion": 6,
396
- "address": "0x24897b01c7d0431530d402e4df375350de372976363fe017206a265881f7b936",
367
+ "address": "0xf9ed1eb340feef0c9c576450fea9895c94b00d636f329cbb618809afad30b1e9",
397
368
  "name": "dapp_key",
398
369
  "friends": [
399
370
  {
400
- "address": "0x24897b01c7d0431530d402e4df375350de372976363fe017206a265881f7b936",
371
+ "address": "0xf9ed1eb340feef0c9c576450fea9895c94b00d636f329cbb618809afad30b1e9",
401
372
  "name": "counter1"
402
373
  },
403
374
  {
404
- "address": "0x24897b01c7d0431530d402e4df375350de372976363fe017206a265881f7b936",
375
+ "address": "0xf9ed1eb340feef0c9c576450fea9895c94b00d636f329cbb618809afad30b1e9",
405
376
  "name": "counter2"
406
377
  },
407
378
  {
408
- "address": "0x24897b01c7d0431530d402e4df375350de372976363fe017206a265881f7b936",
379
+ "address": "0xf9ed1eb340feef0c9c576450fea9895c94b00d636f329cbb618809afad30b1e9",
409
380
  "name": "genesis"
410
381
  }
411
382
  ],
@@ -468,7 +439,7 @@
468
439
  "return": [
469
440
  {
470
441
  "Struct": {
471
- "address": "0x24897b01c7d0431530d402e4df375350de372976363fe017206a265881f7b936",
442
+ "address": "0xf9ed1eb340feef0c9c576450fea9895c94b00d636f329cbb618809afad30b1e9",
472
443
  "module": "dapp_key",
473
444
  "name": "DappKey",
474
445
  "typeArguments": []
@@ -505,11 +476,11 @@
505
476
  },
506
477
  "deploy_hook": {
507
478
  "fileFormatVersion": 6,
508
- "address": "0x24897b01c7d0431530d402e4df375350de372976363fe017206a265881f7b936",
479
+ "address": "0xf9ed1eb340feef0c9c576450fea9895c94b00d636f329cbb618809afad30b1e9",
509
480
  "name": "deploy_hook",
510
481
  "friends": [
511
482
  {
512
- "address": "0x24897b01c7d0431530d402e4df375350de372976363fe017206a265881f7b936",
483
+ "address": "0xf9ed1eb340feef0c9c576450fea9895c94b00d636f329cbb618809afad30b1e9",
513
484
  "name": "genesis"
514
485
  }
515
486
  ],
@@ -523,9 +494,9 @@
523
494
  {
524
495
  "MutableReference": {
525
496
  "Struct": {
526
- "address": "0x998156fb668348852da7b22e650d80633490e17bb48db8b7c609e310ab16583",
497
+ "address": "0x954337de6806ee3122d2c6058af41ff4749aa92f8cad1d6963647b6f19f22101",
527
498
  "module": "dapp_service",
528
- "name": "DappHub",
499
+ "name": "DappStorage",
529
500
  "typeArguments": []
530
501
  }
531
502
  }
@@ -545,14 +516,14 @@
545
516
  }
546
517
  }
547
518
  },
548
- "errors": {
519
+ "error": {
549
520
  "fileFormatVersion": 6,
550
- "address": "0x24897b01c7d0431530d402e4df375350de372976363fe017206a265881f7b936",
551
- "name": "errors",
521
+ "address": "0xf9ed1eb340feef0c9c576450fea9895c94b00d636f329cbb618809afad30b1e9",
522
+ "name": "error",
552
523
  "friends": [],
553
524
  "structs": {},
554
525
  "exposedFunctions": {
555
- "invalid_increment_error": {
526
+ "invalid_increment": {
556
527
  "visibility": "Public",
557
528
  "isEntry": false,
558
529
  "typeParameters": [],
@@ -565,20 +536,58 @@
565
536
  },
566
537
  "genesis": {
567
538
  "fileFormatVersion": 6,
568
- "address": "0x24897b01c7d0431530d402e4df375350de372976363fe017206a265881f7b936",
539
+ "address": "0xf9ed1eb340feef0c9c576450fea9895c94b00d636f329cbb618809afad30b1e9",
569
540
  "name": "genesis",
570
541
  "friends": [],
571
542
  "structs": {},
572
543
  "exposedFunctions": {
544
+ "migrate": {
545
+ "visibility": "Friend",
546
+ "isEntry": false,
547
+ "typeParameters": [],
548
+ "parameters": [
549
+ {
550
+ "MutableReference": {
551
+ "Struct": {
552
+ "address": "0x954337de6806ee3122d2c6058af41ff4749aa92f8cad1d6963647b6f19f22101",
553
+ "module": "dapp_service",
554
+ "name": "DappHub",
555
+ "typeArguments": []
556
+ }
557
+ }
558
+ },
559
+ {
560
+ "MutableReference": {
561
+ "Struct": {
562
+ "address": "0x954337de6806ee3122d2c6058af41ff4749aa92f8cad1d6963647b6f19f22101",
563
+ "module": "dapp_service",
564
+ "name": "DappStorage",
565
+ "typeArguments": []
566
+ }
567
+ }
568
+ },
569
+ {
570
+ "MutableReference": {
571
+ "Struct": {
572
+ "address": "0x2",
573
+ "module": "tx_context",
574
+ "name": "TxContext",
575
+ "typeArguments": []
576
+ }
577
+ }
578
+ }
579
+ ],
580
+ "return": []
581
+ },
573
582
  "run": {
574
583
  "visibility": "Public",
575
- "isEntry": true,
584
+ "isEntry": false,
576
585
  "typeParameters": [],
577
586
  "parameters": [
578
587
  {
579
588
  "MutableReference": {
580
589
  "Struct": {
581
- "address": "0x998156fb668348852da7b22e650d80633490e17bb48db8b7c609e310ab16583",
590
+ "address": "0x954337de6806ee3122d2c6058af41ff4749aa92f8cad1d6963647b6f19f22101",
582
591
  "module": "dapp_service",
583
592
  "name": "DappHub",
584
593
  "typeArguments": []
@@ -612,7 +621,7 @@
612
621
  },
613
622
  "migrate": {
614
623
  "fileFormatVersion": 6,
615
- "address": "0x24897b01c7d0431530d402e4df375350de372976363fe017206a265881f7b936",
624
+ "address": "0xf9ed1eb340feef0c9c576450fea9895c94b00d636f329cbb618809afad30b1e9",
616
625
  "name": "migrate",
617
626
  "friends": [],
618
627
  "structs": {},
@@ -627,5 +636,52 @@
627
636
  ]
628
637
  }
629
638
  }
639
+ },
640
+ "user_storage_init": {
641
+ "fileFormatVersion": 6,
642
+ "address": "0xf9ed1eb340feef0c9c576450fea9895c94b00d636f329cbb618809afad30b1e9",
643
+ "name": "user_storage_init",
644
+ "friends": [],
645
+ "structs": {},
646
+ "exposedFunctions": {
647
+ "init_user_storage": {
648
+ "visibility": "Public",
649
+ "isEntry": true,
650
+ "typeParameters": [],
651
+ "parameters": [
652
+ {
653
+ "Reference": {
654
+ "Struct": {
655
+ "address": "0x954337de6806ee3122d2c6058af41ff4749aa92f8cad1d6963647b6f19f22101",
656
+ "module": "dapp_service",
657
+ "name": "DappHub",
658
+ "typeArguments": []
659
+ }
660
+ }
661
+ },
662
+ {
663
+ "MutableReference": {
664
+ "Struct": {
665
+ "address": "0x954337de6806ee3122d2c6058af41ff4749aa92f8cad1d6963647b6f19f22101",
666
+ "module": "dapp_service",
667
+ "name": "DappStorage",
668
+ "typeArguments": []
669
+ }
670
+ }
671
+ },
672
+ {
673
+ "MutableReference": {
674
+ "Struct": {
675
+ "address": "0x2",
676
+ "module": "tx_context",
677
+ "name": "TxContext",
678
+ "typeArguments": []
679
+ }
680
+ }
681
+ }
682
+ ],
683
+ "return": []
684
+ }
685
+ }
630
686
  }
631
687
  }
@@ -7,18 +7,22 @@
7
7
  "// Utility Commands": "----------------",
8
8
  "account:gen": "pnpm dubhe generate-key",
9
9
  "check-balance": "pnpm dubhe check-balance --network",
10
- "config:store": "pnpm dubhe config-store --output-ts-path ./deployment.ts --network",
10
+ "config:store": "pnpm dubhe store-config --output-ts-path ./deployment.ts --network",
11
11
  "deploy": "pnpm dubhe publish --network",
12
12
  "faucet": "pnpm dubhe faucet --network",
13
13
  "format": "prettier --write .",
14
14
  "format:check": "prettier --check .",
15
+ "generate": "pnpm dubhe generate",
15
16
  "graphql": "docker-compose up --remove-orphans",
16
17
  "indexer": "dubhe-indexer --database-url postgres://postgres:postgres@localhost:5432/postgres --checkpoint-url .chk --config-json dubhe.config.json",
18
+ "indexer:mainnet": "dubhe-indexer --database-url postgres://postgres:postgres@localhost:5432/postgres --checkpoint-url https://checkpoints.mainnet.sui.io --config-json dubhe.config.json",
19
+ "indexer:testnet": "dubhe-indexer --database-url postgres://postgres:postgres@localhost:5432/postgres --checkpoint-url https://checkpoints.testnet.sui.io --config-json dubhe.config.json",
17
20
  "prod:localnet": "pnpm config:store localnet && pnpm run indexer",
18
- "prod:testnet": "pnpm config:store testnet && pnpm run indexer",
19
- "schemagen": "pnpm dubhe schemagen",
21
+ "prod:mainnet": "pnpm config:store mainnet && pnpm run indexer:mainnet",
22
+ "prod:testnet": "pnpm config:store testnet && pnpm run indexer:testnet",
20
23
  "setup:localnet": "pnpm account:gen && pnpm faucet localnet && pnpm run deploy localnet && pnpm run config:store localnet && pnpm run indexer --force",
21
- "setup:testnet": "pnpm account:gen && pnpm check-balance testnet && pnpm run deploy testnet && pnpm run config:store testnet && pnpm run indexer --force",
24
+ "setup:mainnet": "pnpm account:gen && pnpm check-balance mainnet && pnpm run deploy mainnet && pnpm run config:store mainnet && pnpm run indexer:mainnet --force",
25
+ "setup:testnet": "pnpm account:gen && pnpm check-balance testnet && pnpm run deploy testnet && pnpm run config:store testnet && pnpm run indexer:testnet --force",
22
26
  "start:localnet": "pnpm dubhe node",
23
27
  "type-check": "tsc --noEmit",
24
28
  "upgrade": "pnpm dubhe upgrade --network",
@@ -8,3 +8,7 @@ Dubhe = { local = "../dubhe" }
8
8
 
9
9
  [addresses]
10
10
  counter = "0x0"
11
+
12
+ [environments]
13
+ testnet = "4c78adac"
14
+ mainnet = "35834a8a"