create-dubhe 1.2.0-pre.53 → 1.2.0-pre.55
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.
- package/dist/cli.js +2 -2
- package/dist/cli.js.map +1 -1
- package/package.json +2 -2
- package/templates/101/sui-template/docker-compose.yml +34 -0
- package/templates/101/sui-template/mprocs.yaml +2 -2
- package/templates/101/sui-template/package.json +2 -2
- package/templates/101/sui-template/packages/client/src/app/dubhe/useContract.ts +2 -1
- package/templates/101/sui-template/packages/client/src/app/page.tsx +2 -3
- package/templates/101/sui-template/packages/contracts/deployment.ts +2 -2
- package/templates/101/sui-template/packages/contracts/docker-compose.yml +10 -5
- package/templates/101/sui-template/packages/contracts/dubhe.config.json +2 -2
- package/templates/101/sui-template/packages/contracts/metadata.json +72 -42
- package/templates/101/sui-template/packages/contracts/package.json +1 -10
- package/templates/101/sui-template/packages/contracts/src/counter/Move.lock +9 -3
- package/templates/101/sui-template/packages/contracts/src/dubhe/sources/codegen/dapp_key.move +4 -0
- package/templates/101/sui-template/packages/contracts/src/dubhe/sources/codegen/errors.move +56 -0
- package/templates/101/sui-template/packages/contracts/src/dubhe/sources/codegen/genesis.move +15 -4
- package/templates/101/sui-template/packages/contracts/src/dubhe/sources/codegen/init_test.move +4 -2
- package/templates/101/sui-template/packages/contracts/src/dubhe/sources/codegen/resources/asset_account.move +2 -43
- package/templates/101/sui-template/packages/contracts/src/dubhe/sources/codegen/resources/asset_metadata.move +2 -235
- package/templates/101/sui-template/packages/contracts/src/dubhe/sources/codegen/resources/asset_pools.move +2 -106
- package/templates/101/sui-template/packages/contracts/src/dubhe/sources/codegen/resources/bridge_config.move +2 -55
- package/templates/101/sui-template/packages/contracts/src/dubhe/sources/codegen/resources/bridge_deposit.move +2 -61
- package/templates/101/sui-template/packages/contracts/src/dubhe/sources/codegen/resources/bridge_withdraw.move +2 -76
- package/templates/101/sui-template/packages/contracts/src/dubhe/sources/codegen/resources/dapp_fee_config.move +208 -0
- package/templates/101/sui-template/packages/contracts/src/dubhe/sources/codegen/resources/dapp_fee_state.move +335 -0
- package/templates/101/sui-template/packages/contracts/src/dubhe/sources/codegen/resources/dapp_metadata.move +470 -0
- package/templates/101/sui-template/packages/contracts/src/dubhe/sources/codegen/resources/dubhe_asset_id.move +2 -1
- package/templates/101/sui-template/packages/contracts/src/dubhe/sources/codegen/resources/dubhe_config.move +2 -76
- package/templates/101/sui-template/packages/contracts/src/dubhe/sources/codegen/resources/wrapper_assets.move +2 -1
- package/templates/101/sui-template/packages/contracts/src/dubhe/sources/core/dapp_service.move +22 -132
- package/templates/101/sui-template/packages/contracts/src/dubhe/sources/core/dapp_store.move +167 -278
- package/templates/101/sui-template/packages/contracts/src/dubhe/sources/core/table_metadata.move +0 -12
- package/templates/101/sui-template/packages/contracts/src/dubhe/sources/scripts/deploy_hook.move +7 -0
- package/templates/101/sui-template/packages/contracts/src/dubhe/sources/systems/bridge.move +4 -3
- package/templates/101/sui-template/packages/contracts/src/dubhe/sources/systems/dapp_system.move +339 -0
- package/templates/101/sui-template/packages/contracts/src/dubhe/sources/systems/dubhe.move +5 -4
- package/templates/101/sui-template/packages/contracts/src/dubhe/sources/systems/gov.move +4 -3
- package/templates/101/sui-template/packages/contracts/src/dubhe/sources/systems/wrapper.move +4 -3
- package/templates/101/sui-template/packages/contracts/src/dubhe/sources/tests/bridge.move +55 -55
- package/templates/101/sui-template/packages/contracts/src/dubhe/sources/tests/dex.move +420 -420
- package/templates/101/sui-template/packages/contracts/src/dubhe/sources/tests/math.move +11 -11
- package/templates/101/sui-template/packages/contracts/src/dubhe/sources/tests/wrapper.move +49 -49
- package/templates/101/sui-template/packages/contracts/src/dubhe/sources/utils/type_info.move +1 -1
- package/templates/contract/sui-template/package.json +2 -2
- package/templates/contract/sui-template/src/dubhe/sources/codegen/dapp_key.move +4 -0
- package/templates/contract/sui-template/src/dubhe/sources/codegen/errors.move +56 -0
- package/templates/contract/sui-template/src/dubhe/sources/codegen/genesis.move +15 -4
- package/templates/contract/sui-template/src/dubhe/sources/codegen/init_test.move +4 -2
- package/templates/contract/sui-template/src/dubhe/sources/codegen/resources/asset_account.move +2 -43
- package/templates/contract/sui-template/src/dubhe/sources/codegen/resources/asset_metadata.move +2 -235
- package/templates/contract/sui-template/src/dubhe/sources/codegen/resources/asset_pools.move +2 -106
- package/templates/contract/sui-template/src/dubhe/sources/codegen/resources/bridge_config.move +2 -55
- package/templates/contract/sui-template/src/dubhe/sources/codegen/resources/bridge_deposit.move +2 -61
- package/templates/contract/sui-template/src/dubhe/sources/codegen/resources/bridge_withdraw.move +2 -76
- package/templates/contract/sui-template/src/dubhe/sources/codegen/resources/dapp_fee_config.move +208 -0
- package/templates/contract/sui-template/src/dubhe/sources/codegen/resources/dapp_fee_state.move +335 -0
- package/templates/contract/sui-template/src/dubhe/sources/codegen/resources/dapp_metadata.move +470 -0
- package/templates/contract/sui-template/src/dubhe/sources/codegen/resources/dubhe_asset_id.move +2 -1
- package/templates/contract/sui-template/src/dubhe/sources/codegen/resources/dubhe_config.move +2 -76
- package/templates/contract/sui-template/src/dubhe/sources/codegen/resources/wrapper_assets.move +2 -1
- package/templates/contract/sui-template/src/dubhe/sources/core/dapp_service.move +22 -132
- package/templates/contract/sui-template/src/dubhe/sources/core/dapp_store.move +167 -278
- package/templates/contract/sui-template/src/dubhe/sources/core/table_metadata.move +0 -12
- package/templates/contract/sui-template/src/dubhe/sources/scripts/deploy_hook.move +7 -0
- package/templates/contract/sui-template/src/dubhe/sources/systems/bridge.move +4 -3
- package/templates/contract/sui-template/src/dubhe/sources/systems/dapp_system.move +339 -0
- package/templates/contract/sui-template/src/dubhe/sources/systems/dubhe.move +5 -4
- package/templates/contract/sui-template/src/dubhe/sources/systems/gov.move +4 -3
- package/templates/contract/sui-template/src/dubhe/sources/systems/wrapper.move +4 -3
- package/templates/contract/sui-template/src/dubhe/sources/tests/bridge.move +55 -55
- package/templates/contract/sui-template/src/dubhe/sources/tests/dex.move +420 -420
- package/templates/contract/sui-template/src/dubhe/sources/tests/math.move +11 -11
- package/templates/contract/sui-template/src/dubhe/sources/tests/wrapper.move +49 -49
- package/templates/contract/sui-template/src/dubhe/sources/utils/type_info.move +1 -1
- package/templates/nextjs/sui-template/docker-compose.yml +34 -0
- package/templates/nextjs/sui-template/mprocs.yaml +2 -2
- package/templates/nextjs/sui-template/package.json +2 -2
- package/templates/nextjs/sui-template/packages/client/package.json +1 -1
- package/templates/nextjs/sui-template/packages/client/src/app/dubhe/useContract.ts +3 -8
- package/templates/nextjs/sui-template/packages/client/src/app/page.tsx +14 -19
- package/templates/nextjs/sui-template/packages/contracts/deployment.ts +2 -2
- package/templates/nextjs/sui-template/packages/contracts/docker-compose.yml +10 -5
- package/templates/nextjs/sui-template/packages/contracts/dubhe.config.json +8 -4
- package/templates/nextjs/sui-template/packages/contracts/metadata.json +72 -42
- package/templates/nextjs/sui-template/packages/contracts/package.json +1 -10
- package/templates/nextjs/sui-template/packages/contracts/src/counter/Move.lock +6 -3
- package/templates/nextjs/sui-template/packages/contracts/src/dubhe/sources/codegen/dapp_key.move +4 -0
- package/templates/nextjs/sui-template/packages/contracts/src/dubhe/sources/codegen/errors.move +56 -0
- package/templates/nextjs/sui-template/packages/contracts/src/dubhe/sources/codegen/genesis.move +15 -4
- package/templates/nextjs/sui-template/packages/contracts/src/dubhe/sources/codegen/init_test.move +4 -2
- package/templates/nextjs/sui-template/packages/contracts/src/dubhe/sources/codegen/resources/asset_account.move +2 -43
- package/templates/nextjs/sui-template/packages/contracts/src/dubhe/sources/codegen/resources/asset_metadata.move +2 -235
- package/templates/nextjs/sui-template/packages/contracts/src/dubhe/sources/codegen/resources/asset_pools.move +2 -106
- package/templates/nextjs/sui-template/packages/contracts/src/dubhe/sources/codegen/resources/bridge_config.move +2 -55
- package/templates/nextjs/sui-template/packages/contracts/src/dubhe/sources/codegen/resources/bridge_deposit.move +2 -61
- package/templates/nextjs/sui-template/packages/contracts/src/dubhe/sources/codegen/resources/bridge_withdraw.move +2 -76
- package/templates/nextjs/sui-template/packages/contracts/src/dubhe/sources/codegen/resources/dapp_fee_config.move +208 -0
- package/templates/nextjs/sui-template/packages/contracts/src/dubhe/sources/codegen/resources/dapp_fee_state.move +335 -0
- package/templates/nextjs/sui-template/packages/contracts/src/dubhe/sources/codegen/resources/dapp_metadata.move +470 -0
- package/templates/nextjs/sui-template/packages/contracts/src/dubhe/sources/codegen/resources/dubhe_asset_id.move +2 -1
- package/templates/nextjs/sui-template/packages/contracts/src/dubhe/sources/codegen/resources/dubhe_config.move +2 -76
- package/templates/nextjs/sui-template/packages/contracts/src/dubhe/sources/codegen/resources/wrapper_assets.move +2 -1
- package/templates/nextjs/sui-template/packages/contracts/src/dubhe/sources/core/dapp_service.move +22 -132
- package/templates/nextjs/sui-template/packages/contracts/src/dubhe/sources/core/dapp_store.move +167 -278
- package/templates/nextjs/sui-template/packages/contracts/src/dubhe/sources/core/table_metadata.move +0 -12
- package/templates/nextjs/sui-template/packages/contracts/src/dubhe/sources/scripts/deploy_hook.move +7 -0
- package/templates/nextjs/sui-template/packages/contracts/src/dubhe/sources/systems/bridge.move +4 -3
- package/templates/nextjs/sui-template/packages/contracts/src/dubhe/sources/systems/dapp_system.move +339 -0
- package/templates/nextjs/sui-template/packages/contracts/src/dubhe/sources/systems/dubhe.move +5 -4
- package/templates/nextjs/sui-template/packages/contracts/src/dubhe/sources/systems/gov.move +4 -3
- package/templates/nextjs/sui-template/packages/contracts/src/dubhe/sources/systems/wrapper.move +4 -3
- package/templates/nextjs/sui-template/packages/contracts/src/dubhe/sources/tests/bridge.move +55 -55
- package/templates/nextjs/sui-template/packages/contracts/src/dubhe/sources/tests/dex.move +420 -420
- package/templates/nextjs/sui-template/packages/contracts/src/dubhe/sources/tests/math.move +11 -11
- package/templates/nextjs/sui-template/packages/contracts/src/dubhe/sources/tests/wrapper.move +49 -49
- package/templates/nextjs/sui-template/packages/contracts/src/dubhe/sources/utils/type_info.move +1 -1
- package/templates/101/sui-template/packages/contracts/src/counter/.history/sui_localnet/0xad3da7b0681b16830878dd908fb30418da7d86871c445866174aee28e45850d6.json +0 -873
- package/templates/101/sui-template/packages/contracts/src/counter/.history/sui_localnet/latest.json +0 -20
- package/templates/101/sui-template/packages/contracts/src/dubhe/sources/core/dapp_fee_state.move +0 -82
- package/templates/101/sui-template/packages/contracts/src/dubhe/sources/core/dapp_metadata.move +0 -123
- package/templates/101/sui-template/packages/contracts/src/dubhe/sources/systems/fee.move +0 -16
- package/templates/contract/sui-template/src/dubhe/sources/core/dapp_fee_state.move +0 -82
- package/templates/contract/sui-template/src/dubhe/sources/core/dapp_metadata.move +0 -123
- package/templates/contract/sui-template/src/dubhe/sources/systems/fee.move +0 -16
- package/templates/nextjs/sui-template/packages/contracts/src/counter/.history/sui_localnet/0x02a530d486eddbe0484e21149fcd6906fe24fc888041b0bda3557c5d43724b41.json +0 -896
- package/templates/nextjs/sui-template/packages/contracts/src/counter/.history/sui_localnet/0x7cfa3a40bb178065d636ae842c0009a950870f413abf8649dd130c2398c896ce.json +0 -896
- package/templates/nextjs/sui-template/packages/contracts/src/counter/.history/sui_localnet/latest.json +0 -19
- package/templates/nextjs/sui-template/packages/contracts/src/dubhe/sources/core/dapp_fee_state.move +0 -82
- package/templates/nextjs/sui-template/packages/contracts/src/dubhe/sources/core/dapp_metadata.move +0 -123
- package/templates/nextjs/sui-template/packages/contracts/src/dubhe/sources/systems/fee.move +0 -16
package/dist/cli.js
CHANGED
|
@@ -62,7 +62,7 @@ var CHAINS = [
|
|
|
62
62
|
// package.json
|
|
63
63
|
var package_default = {
|
|
64
64
|
name: "create-dubhe",
|
|
65
|
-
version: "1.2.0-pre.
|
|
65
|
+
version: "1.2.0-pre.55",
|
|
66
66
|
type: "module",
|
|
67
67
|
license: "MIT",
|
|
68
68
|
author: "team@obelisk.build",
|
|
@@ -89,7 +89,7 @@ var package_default = {
|
|
|
89
89
|
access: "public"
|
|
90
90
|
},
|
|
91
91
|
engines: {
|
|
92
|
-
node: "
|
|
92
|
+
node: ">=22.0.0"
|
|
93
93
|
},
|
|
94
94
|
repository: {
|
|
95
95
|
type: "git",
|
package/dist/cli.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/bin/cli.ts","../src/config/chains.ts","../package.json","../src/exists.ts"],"sourcesContent":["import { fileURLToPath } from 'node:url';\nimport fs from 'node:fs/promises';\nimport path from 'node:path';\nimport glob from 'fast-glob';\nimport yargsInteractive from 'yargs-interactive';\nimport { CHAINS } from '../config/chains';\nimport packageJson from '../../package.json';\nimport { exists } from '../exists';\n\nconst __filename = fileURLToPath(import.meta.url);\nconst __dirname = path.dirname(__filename);\n\nconst cwd = process.cwd();\n\nconst defaultTargetDir = 'dubhe-template-project';\n\nconst init = async () => {\n // Prepare chain options\n const chainChoices = CHAINS.map(({ title, description, value }) => ({\n name: `${title} - ${description}`,\n value\n }));\n\n // Step 1: Choose project name and chain\n const firstStep = await yargsInteractive()\n .usage('$0 [args]')\n .interactive({\n interactive: { default: true },\n projectName: {\n describe: 'Name your project',\n type: 'input'\n },\n chain: {\n describe: 'Pick your chain',\n type: 'list',\n choices: chainChoices.map((c) => c.value)\n },\n dubheVersion: {\n describe: 'The version of Dubhe packages to use, defaults to latest',\n type: 'input',\n default: packageJson.version\n }\n });\n\n const { projectName, chain, dubheVersion } = firstStep;\n if (!projectName) throw new Error('No project name provided.');\n\n // Get available templates based on the selected chain\n const selectedChain = CHAINS.find((c) => c.value === chain);\n if (!selectedChain) {\n throw new Error('Invalid chain selection');\n }\n\n // Prepare platform options\n const platformChoices = selectedChain.supportedTemplates.map(({ title, description, value }) => ({\n name: `${title} - ${description}`,\n value\n }));\n\n // Step 2: Choose platform\n const secondStep = await yargsInteractive()\n .usage('$0 [args]')\n .interactive({\n interactive: { default: true },\n platform: {\n describe: 'Pick your platform',\n type: 'list',\n choices: platformChoices.map((c) => c.value)\n }\n });\n\n const { platform } = secondStep;\n\n const selectedTemplate = selectedChain.supportedTemplates.find((t) => t.value === platform);\n if (!selectedTemplate) {\n throw new Error('Invalid platform selection');\n }\n\n const pkgInfo = pkgFromUserAgent(process.env.npm_config_user_agent);\n const pkgManager = pkgInfo ? pkgInfo.name : 'npm';\n\n const sourceDir = path.join(\n __dirname,\n '..',\n 'templates',\n selectedTemplate.path.replace('{chain}', chain)\n );\n\n if (!(await exists(sourceDir))) {\n throw new Error(`Template directory not found: ${sourceDir}`);\n }\n\n const destDir = path.join(process.cwd(), projectName);\n if (await exists(destDir)) {\n throw new Error(`Target directory \"${destDir}\" already exists.`);\n }\n\n const files = await glob('**/*', { cwd: sourceDir, dot: true });\n\n for (const filename of files) {\n const sourceFile = path.join(sourceDir, filename);\n const destFile = path.join(destDir, filename);\n\n await fs.mkdir(path.dirname(destFile), { recursive: true });\n\n if (/package\\.json$/.test(sourceFile)) {\n const source = await fs.readFile(sourceFile, 'utf-8');\n await fs.writeFile(destFile, source.replaceAll(/{{dubhe-version}}/g, dubheVersion), 'utf-8');\n } else if (/\\.gitignore_$/.test(sourceFile)) {\n await fs.copyFile(sourceFile, destFile.replace(/_$/, ''));\n } else {\n await fs.copyFile(sourceFile, destFile);\n }\n }\n\n const cdProjectName = path.relative(cwd, destDir);\n\n const styles = {\n success: '\\x1b[32m%s\\x1b[0m',\n info: '\\x1b[36m%s\\x1b[0m',\n command: '\\x1b[33m%s\\x1b[0m',\n separator: '\\x1b[90m%s\\x1b[0m'\n };\n\n console.log('\\n' + '='.repeat(60));\n console.log(styles.success, '🎉 Project creation successful!');\n console.log(styles.info, `📁 Project location: ${destDir}`);\n console.log(styles.separator, '-'.repeat(60));\n console.log(styles.info, 'Next steps:\\n');\n\n if (destDir !== cwd) {\n console.log(\n styles.command,\n ` cd ${cdProjectName.includes(' ') ? `\"${cdProjectName}\"` : cdProjectName}`\n );\n }\n\n const actualTemplate = selectedTemplate.value;\n\n switch (actualTemplate) {\n case '101':\n case 'web':\n console.log(styles.command, ` ${pkgManager} install`);\n console.log(styles.command, ` ${pkgManager} dubhe doctor`);\n console.log(styles.command, ` ${pkgManager} run dev`);\n break;\n case 'contract':\n console.log(styles.command, ` ${pkgManager} install`);\n console.log(styles.command, ` ${pkgManager} dubhe doctor`);\n break;\n }\n\n console.log(styles.separator, '\\n' + '='.repeat(60) + '\\n');\n};\n\nfunction pkgFromUserAgent(userAgent: string | undefined) {\n if (!userAgent) return undefined;\n const pkgSpec = userAgent.split(' ')[0];\n const pkgSpecArr = pkgSpec.split('/');\n return {\n name: pkgSpecArr[0],\n version: pkgSpecArr[1]\n };\n}\n\ninit().catch((e) => {\n console.error(e);\n});\n","interface Template {\n title: string;\n description: string;\n value: string;\n path: string;\n}\n\ninterface Chain {\n title: string;\n description: string;\n value: string;\n supportedTemplates: Template[];\n}\n\nconst TEMPLATES = {\n QUICK_START: {\n title: '101',\n description: 'Quick start',\n value: '101',\n path: '101/{chain}-template'\n },\n WEB: {\n title: 'Web',\n description: 'Web template',\n value: 'web',\n path: 'nextjs/{chain}-template'\n },\n CONTRACT: {\n title: 'Contract',\n description: 'Contract template',\n value: 'contract',\n path: 'contract/{chain}-template'\n }\n} as const;\n\nexport const CHAINS: Chain[] = [\n {\n title: 'sui',\n description: 'Sui',\n value: 'sui',\n supportedTemplates: [TEMPLATES.QUICK_START, TEMPLATES.WEB, TEMPLATES.CONTRACT]\n },\n {\n title: 'aptos',\n description: 'Aptos',\n value: 'aptos',\n supportedTemplates: [TEMPLATES.QUICK_START, TEMPLATES.WEB, TEMPLATES.CONTRACT]\n },\n {\n title: 'rooch',\n description: 'Rooch',\n value: 'rooch',\n supportedTemplates: [TEMPLATES.QUICK_START]\n },\n {\n title: 'initia',\n description: 'Initia',\n value: 'initia',\n supportedTemplates: [TEMPLATES.QUICK_START]\n },\n {\n title: 'movement',\n description: 'Movement',\n value: 'movement',\n supportedTemplates: [TEMPLATES.QUICK_START]\n }\n];\n","{\n \"name\": \"create-dubhe\",\n \"version\": \"1.2.0-pre.53\",\n \"type\": \"module\",\n \"license\": \"MIT\",\n \"author\": \"team@obelisk.build\",\n \"bin\": \"bin/cli.js\",\n \"files\": [\n \"bin\",\n \"dist\",\n \"templates\"\n ],\n \"scripts\": {\n \"dev\": \"tsup --watch\",\n \"build\": \"pnpm run build:js\",\n \"build:js\": \"tsup && pnpm run copy-templates\",\n \"clean\": \"pnpm run clean:js\",\n \"clean:js\": \"shx rm -rf dist\",\n \"copy-templates\": \"tsx ./scripts/copy-templates.ts\",\n \"cocos-js-build\": \"cd cocos-lib-builder && npm i && browserify aptos.js -p esmify > ../templates/cocos/aptos-template/assets/lib/dubhe.js && browserify sui.js -p esmify > ../templates/cocos/sui-template/assets/lib/dubhe.js\",\n \"format\": \"prettier --write .\",\n \"format:check\": \"prettier --check .\",\n \"type-check\": \"tsc --noEmit\",\n \"validate\": \"pnpm format:check && pnpm type-check\"\n },\n \"publishConfig\": {\n \"access\": \"public\"\n },\n \"engines\": {\n \"node\": \"^18.16.0\"\n },\n \"repository\": {\n \"type\": \"git\",\n \"url\": \"https://github.com/0xobelisk/dubhe.git\"\n },\n \"dependencies\": {\n \"browser-resolve\": \"^2.0.0\",\n \"browser-sync\": \"^2.29.3\",\n \"fast-glob\": \"^3.3.3\",\n \"yargs-interactive\": \"^3.0.1\"\n },\n \"devDependencies\": {\n \"@types/yargs-interactive\": \"^2.1.6\",\n \"@types/cross-spawn\": \"^6.0.2\",\n \"@types/minimist\": \"^1.2.2\",\n \"@types/prompts\": \"^2.4.3\",\n \"cross-spawn\": \"^7.0.3\",\n \"kolorist\": \"^1.7.0\",\n \"prompts\": \"^2.4.2\",\n \"tsc\": \"^2.0.4\",\n \"esmify\": \"^2.1.1\",\n \"browserify\": \"^17.0.0\",\n \"eslint\": \"^8.56.0\",\n \"eslint-config-prettier\": \"^9.1.0\",\n \"prettier\": \"3.3.3\"\n }\n}\n","import fs from \"node:fs/promises\";\n\nexport async function exists(path: string) {\n try {\n await fs.access(path);\n return true;\n } catch {\n return false;\n }\n}\n"],"mappings":";AAAA,SAAS,qBAAqB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,OAAO,WAAW,IAAI,OAAO,EAAE,CAAC;AAC5C,UAAQ,IAAI,OAAO,MAAM,eAAe;AAExC,MAAI,YAAY,KAAK;AACnB,YAAQ;AAAA,MACN,OAAO;AAAA,MACP,QAAQ,cAAc,SAAS,GAAG,IAAI,IAAI,aAAa,MAAM,aAAa;AAAA,IAC5E;AAAA,EACF;AAEA,QAAM,iBAAiB,iBAAiB;AAExC,UAAQ,gBAAgB;AAAA,IACtB,KAAK;AAAA,IACL,KAAK;AACH,cAAQ,IAAI,OAAO,SAAS,KAAK,UAAU,UAAU;AACrD,cAAQ,IAAI,OAAO,SAAS,KAAK,UAAU,eAAe;AAC1D,cAAQ,IAAI,OAAO,SAAS,KAAK,UAAU,UAAU;AACrD;AAAA,IACF,KAAK;AACH,cAAQ,IAAI,OAAO,SAAS,KAAK,UAAU,UAAU;AACrD,cAAQ,IAAI,OAAO,SAAS,KAAK,UAAU,eAAe;AAC1D;AAAA,EACJ;AAEA,UAAQ,IAAI,OAAO,WAAW,OAAO,IAAI,OAAO,EAAE,IAAI,IAAI;AAC5D;AAEA,SAAS,iBAAiB,WAA+B;AACvD,MAAI,CAAC,UAAW,QAAO;AACvB,QAAM,UAAU,UAAU,MAAM,GAAG,EAAE,CAAC;AACtC,QAAM,aAAa,QAAQ,MAAM,GAAG;AACpC,SAAO;AAAA,IACL,MAAM,WAAW,CAAC;AAAA,IAClB,SAAS,WAAW,CAAC;AAAA,EACvB;AACF;AAEA,KAAK,EAAE,MAAM,CAAC,MAAM;AAClB,UAAQ,MAAM,CAAC;AACjB,CAAC;","names":["fs","path","fs"]}
|
|
1
|
+
{"version":3,"sources":["../src/bin/cli.ts","../src/config/chains.ts","../package.json","../src/exists.ts"],"sourcesContent":["import { fileURLToPath } from 'node:url';\nimport fs from 'node:fs/promises';\nimport path from 'node:path';\nimport glob from 'fast-glob';\nimport yargsInteractive from 'yargs-interactive';\nimport { CHAINS } from '../config/chains';\nimport packageJson from '../../package.json';\nimport { exists } from '../exists';\n\nconst __filename = fileURLToPath(import.meta.url);\nconst __dirname = path.dirname(__filename);\n\nconst cwd = process.cwd();\n\nconst defaultTargetDir = 'dubhe-template-project';\n\nconst init = async () => {\n // Prepare chain options\n const chainChoices = CHAINS.map(({ title, description, value }) => ({\n name: `${title} - ${description}`,\n value\n }));\n\n // Step 1: Choose project name and chain\n const firstStep = await yargsInteractive()\n .usage('$0 [args]')\n .interactive({\n interactive: { default: true },\n projectName: {\n describe: 'Name your project',\n type: 'input'\n },\n chain: {\n describe: 'Pick your chain',\n type: 'list',\n choices: chainChoices.map((c) => c.value)\n },\n dubheVersion: {\n describe: 'The version of Dubhe packages to use, defaults to latest',\n type: 'input',\n default: packageJson.version\n }\n });\n\n const { projectName, chain, dubheVersion } = firstStep;\n if (!projectName) throw new Error('No project name provided.');\n\n // Get available templates based on the selected chain\n const selectedChain = CHAINS.find((c) => c.value === chain);\n if (!selectedChain) {\n throw new Error('Invalid chain selection');\n }\n\n // Prepare platform options\n const platformChoices = selectedChain.supportedTemplates.map(({ title, description, value }) => ({\n name: `${title} - ${description}`,\n value\n }));\n\n // Step 2: Choose platform\n const secondStep = await yargsInteractive()\n .usage('$0 [args]')\n .interactive({\n interactive: { default: true },\n platform: {\n describe: 'Pick your platform',\n type: 'list',\n choices: platformChoices.map((c) => c.value)\n }\n });\n\n const { platform } = secondStep;\n\n const selectedTemplate = selectedChain.supportedTemplates.find((t) => t.value === platform);\n if (!selectedTemplate) {\n throw new Error('Invalid platform selection');\n }\n\n const pkgInfo = pkgFromUserAgent(process.env.npm_config_user_agent);\n const pkgManager = pkgInfo ? pkgInfo.name : 'npm';\n\n const sourceDir = path.join(\n __dirname,\n '..',\n 'templates',\n selectedTemplate.path.replace('{chain}', chain)\n );\n\n if (!(await exists(sourceDir))) {\n throw new Error(`Template directory not found: ${sourceDir}`);\n }\n\n const destDir = path.join(process.cwd(), projectName);\n if (await exists(destDir)) {\n throw new Error(`Target directory \"${destDir}\" already exists.`);\n }\n\n const files = await glob('**/*', { cwd: sourceDir, dot: true });\n\n for (const filename of files) {\n const sourceFile = path.join(sourceDir, filename);\n const destFile = path.join(destDir, filename);\n\n await fs.mkdir(path.dirname(destFile), { recursive: true });\n\n if (/package\\.json$/.test(sourceFile)) {\n const source = await fs.readFile(sourceFile, 'utf-8');\n await fs.writeFile(destFile, source.replaceAll(/{{dubhe-version}}/g, dubheVersion), 'utf-8');\n } else if (/\\.gitignore_$/.test(sourceFile)) {\n await fs.copyFile(sourceFile, destFile.replace(/_$/, ''));\n } else {\n await fs.copyFile(sourceFile, destFile);\n }\n }\n\n const cdProjectName = path.relative(cwd, destDir);\n\n const styles = {\n success: '\\x1b[32m%s\\x1b[0m',\n info: '\\x1b[36m%s\\x1b[0m',\n command: '\\x1b[33m%s\\x1b[0m',\n separator: '\\x1b[90m%s\\x1b[0m'\n };\n\n console.log('\\n' + '='.repeat(60));\n console.log(styles.success, '🎉 Project creation successful!');\n console.log(styles.info, `📁 Project location: ${destDir}`);\n console.log(styles.separator, '-'.repeat(60));\n console.log(styles.info, 'Next steps:\\n');\n\n if (destDir !== cwd) {\n console.log(\n styles.command,\n ` cd ${cdProjectName.includes(' ') ? `\"${cdProjectName}\"` : cdProjectName}`\n );\n }\n\n const actualTemplate = selectedTemplate.value;\n\n switch (actualTemplate) {\n case '101':\n case 'web':\n console.log(styles.command, ` ${pkgManager} install`);\n console.log(styles.command, ` ${pkgManager} dubhe doctor`);\n console.log(styles.command, ` ${pkgManager} run dev`);\n break;\n case 'contract':\n console.log(styles.command, ` ${pkgManager} install`);\n console.log(styles.command, ` ${pkgManager} dubhe doctor`);\n break;\n }\n\n console.log(styles.separator, '\\n' + '='.repeat(60) + '\\n');\n};\n\nfunction pkgFromUserAgent(userAgent: string | undefined) {\n if (!userAgent) return undefined;\n const pkgSpec = userAgent.split(' ')[0];\n const pkgSpecArr = pkgSpec.split('/');\n return {\n name: pkgSpecArr[0],\n version: pkgSpecArr[1]\n };\n}\n\ninit().catch((e) => {\n console.error(e);\n});\n","interface Template {\n title: string;\n description: string;\n value: string;\n path: string;\n}\n\ninterface Chain {\n title: string;\n description: string;\n value: string;\n supportedTemplates: Template[];\n}\n\nconst TEMPLATES = {\n QUICK_START: {\n title: '101',\n description: 'Quick start',\n value: '101',\n path: '101/{chain}-template'\n },\n WEB: {\n title: 'Web',\n description: 'Web template',\n value: 'web',\n path: 'nextjs/{chain}-template'\n },\n CONTRACT: {\n title: 'Contract',\n description: 'Contract template',\n value: 'contract',\n path: 'contract/{chain}-template'\n }\n} as const;\n\nexport const CHAINS: Chain[] = [\n {\n title: 'sui',\n description: 'Sui',\n value: 'sui',\n supportedTemplates: [TEMPLATES.QUICK_START, TEMPLATES.WEB, TEMPLATES.CONTRACT]\n },\n {\n title: 'aptos',\n description: 'Aptos',\n value: 'aptos',\n supportedTemplates: [TEMPLATES.QUICK_START, TEMPLATES.WEB, TEMPLATES.CONTRACT]\n },\n {\n title: 'rooch',\n description: 'Rooch',\n value: 'rooch',\n supportedTemplates: [TEMPLATES.QUICK_START]\n },\n {\n title: 'initia',\n description: 'Initia',\n value: 'initia',\n supportedTemplates: [TEMPLATES.QUICK_START]\n },\n {\n title: 'movement',\n description: 'Movement',\n value: 'movement',\n supportedTemplates: [TEMPLATES.QUICK_START]\n }\n];\n","{\n \"name\": \"create-dubhe\",\n \"version\": \"1.2.0-pre.55\",\n \"type\": \"module\",\n \"license\": \"MIT\",\n \"author\": \"team@obelisk.build\",\n \"bin\": \"bin/cli.js\",\n \"files\": [\n \"bin\",\n \"dist\",\n \"templates\"\n ],\n \"scripts\": {\n \"dev\": \"tsup --watch\",\n \"build\": \"pnpm run build:js\",\n \"build:js\": \"tsup && pnpm run copy-templates\",\n \"clean\": \"pnpm run clean:js\",\n \"clean:js\": \"shx rm -rf dist\",\n \"copy-templates\": \"tsx ./scripts/copy-templates.ts\",\n \"cocos-js-build\": \"cd cocos-lib-builder && npm i && browserify aptos.js -p esmify > ../templates/cocos/aptos-template/assets/lib/dubhe.js && browserify sui.js -p esmify > ../templates/cocos/sui-template/assets/lib/dubhe.js\",\n \"format\": \"prettier --write .\",\n \"format:check\": \"prettier --check .\",\n \"type-check\": \"tsc --noEmit\",\n \"validate\": \"pnpm format:check && pnpm type-check\"\n },\n \"publishConfig\": {\n \"access\": \"public\"\n },\n \"engines\": {\n \"node\": \">=22.0.0\"\n },\n \"repository\": {\n \"type\": \"git\",\n \"url\": \"https://github.com/0xobelisk/dubhe.git\"\n },\n \"dependencies\": {\n \"browser-resolve\": \"^2.0.0\",\n \"browser-sync\": \"^2.29.3\",\n \"fast-glob\": \"^3.3.3\",\n \"yargs-interactive\": \"^3.0.1\"\n },\n \"devDependencies\": {\n \"@types/yargs-interactive\": \"^2.1.6\",\n \"@types/cross-spawn\": \"^6.0.2\",\n \"@types/minimist\": \"^1.2.2\",\n \"@types/prompts\": \"^2.4.3\",\n \"cross-spawn\": \"^7.0.3\",\n \"kolorist\": \"^1.7.0\",\n \"prompts\": \"^2.4.2\",\n \"tsc\": \"^2.0.4\",\n \"esmify\": \"^2.1.1\",\n \"browserify\": \"^17.0.0\",\n \"eslint\": \"^8.56.0\",\n \"eslint-config-prettier\": \"^9.1.0\",\n \"prettier\": \"3.3.3\"\n }\n}\n","import fs from \"node:fs/promises\";\n\nexport async function exists(path: string) {\n try {\n await fs.access(path);\n return true;\n } catch {\n return false;\n }\n}\n"],"mappings":";AAAA,SAAS,qBAAqB;AAC9B,OAAOA,SAAQ;AACf,OAAO,UAAU;AACjB,OAAO,UAAU;AACjB,OAAO,sBAAsB;;;ACU7B,IAAM,YAAY;AAAA,EAChB,aAAa;AAAA,IACX,OAAO;AAAA,IACP,aAAa;AAAA,IACb,OAAO;AAAA,IACP,MAAM;AAAA,EACR;AAAA,EACA,KAAK;AAAA,IACH,OAAO;AAAA,IACP,aAAa;AAAA,IACb,OAAO;AAAA,IACP,MAAM;AAAA,EACR;AAAA,EACA,UAAU;AAAA,IACR,OAAO;AAAA,IACP,aAAa;AAAA,IACb,OAAO;AAAA,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,IAAI,OAAO,SAAS,KAAK,UAAU,eAAe;AAC1D,cAAQ,IAAI,OAAO,SAAS,KAAK,UAAU,UAAU;AACrD;AAAA,IACF,KAAK;AACH,cAAQ,IAAI,OAAO,SAAS,KAAK,UAAU,UAAU;AACrD,cAAQ,IAAI,OAAO,SAAS,KAAK,UAAU,eAAe;AAC1D;AAAA,EACJ;AAEA,UAAQ,IAAI,OAAO,WAAW,OAAO,IAAI,OAAO,EAAE,IAAI,IAAI;AAC5D;AAEA,SAAS,iBAAiB,WAA+B;AACvD,MAAI,CAAC,UAAW,QAAO;AACvB,QAAM,UAAU,UAAU,MAAM,GAAG,EAAE,CAAC;AACtC,QAAM,aAAa,QAAQ,MAAM,GAAG;AACpC,SAAO;AAAA,IACL,MAAM,WAAW,CAAC;AAAA,IAClB,SAAS,WAAW,CAAC;AAAA,EACvB;AACF;AAEA,KAAK,EAAE,MAAM,CAAC,MAAM;AAClB,UAAQ,MAAM,CAAC;AACjB,CAAC;","names":["fs","path","fs"]}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "create-dubhe",
|
|
3
|
-
"version": "1.2.0-pre.
|
|
3
|
+
"version": "1.2.0-pre.55",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"author": "team@obelisk.build",
|
|
@@ -14,7 +14,7 @@
|
|
|
14
14
|
"access": "public"
|
|
15
15
|
},
|
|
16
16
|
"engines": {
|
|
17
|
-
"node": "
|
|
17
|
+
"node": ">=22.0.0"
|
|
18
18
|
},
|
|
19
19
|
"repository": {
|
|
20
20
|
"type": "git",
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
services:
|
|
2
|
+
postgres:
|
|
3
|
+
image: 'postgres:13'
|
|
4
|
+
environment:
|
|
5
|
+
POSTGRES_USER: postgres
|
|
6
|
+
POSTGRES_PASSWORD: postgres
|
|
7
|
+
POSTGRES_DB: postgres
|
|
8
|
+
ports:
|
|
9
|
+
- '127.0.0.1:5432:5432'
|
|
10
|
+
volumes:
|
|
11
|
+
- ./.data/postgres:/var/lib/postgresql/data
|
|
12
|
+
restart: always
|
|
13
|
+
healthcheck:
|
|
14
|
+
test: ['CMD-SHELL', 'pg_isready -U postgres']
|
|
15
|
+
interval: 10s
|
|
16
|
+
timeout: 5s
|
|
17
|
+
retries: 5
|
|
18
|
+
|
|
19
|
+
graphql-server:
|
|
20
|
+
build: ./packages/contracts
|
|
21
|
+
ports:
|
|
22
|
+
- '4000:4000'
|
|
23
|
+
environment:
|
|
24
|
+
- DATABASE_URL=postgresql://postgres:postgres@postgres:5432/postgres
|
|
25
|
+
depends_on:
|
|
26
|
+
postgres:
|
|
27
|
+
condition: service_healthy
|
|
28
|
+
restart: always
|
|
29
|
+
command: npx @0xobelisk/graphql-server start
|
|
30
|
+
healthcheck:
|
|
31
|
+
test: ['CMD', 'wget', '-qO-', 'http://127.0.0.1:4000/health']
|
|
32
|
+
interval: 10s
|
|
33
|
+
timeout: 5s
|
|
34
|
+
retries: 5
|
|
@@ -4,8 +4,8 @@ procs:
|
|
|
4
4
|
cwd: packages/client
|
|
5
5
|
shell: pnpm dubhe wait --localnet && pnpm prod:localnet && pnpm dev
|
|
6
6
|
graphql:
|
|
7
|
-
cwd:
|
|
8
|
-
shell: rm -rf .data/postgres && docker-compose up --remove-orphans
|
|
7
|
+
cwd: .
|
|
8
|
+
shell: docker-compose down && rm -rf .data/postgres && docker-compose up --remove-orphans
|
|
9
9
|
contracts:
|
|
10
10
|
cwd: packages/contracts
|
|
11
11
|
shell: pnpm dubhe wait --localnet && pnpm setup:localnet
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { NETWORK, PACKAGE_ID } from 'contracts/deployment';
|
|
1
|
+
import { NETWORK, PACKAGE_ID, DUBHE_SCHEMA_ID } from 'contracts/deployment';
|
|
2
2
|
import dubheMetadata from 'contracts/dubhe.config.json';
|
|
3
3
|
import metadata from 'contracts/metadata.json';
|
|
4
4
|
import { Dubhe, SuiMoveNormalizedModules } from '@0xobelisk/sui-client';
|
|
@@ -60,6 +60,7 @@ export function useContract() {
|
|
|
60
60
|
metadata,
|
|
61
61
|
network: NETWORK,
|
|
62
62
|
packageId: PACKAGE_ID,
|
|
63
|
+
dubheSchemaId: DUBHE_SCHEMA_ID,
|
|
63
64
|
address
|
|
64
65
|
}),
|
|
65
66
|
[contract, graphqlClient, ecsWorld, address]
|
|
@@ -4,7 +4,6 @@ import { Transaction, TransactionResult } from '@0xobelisk/sui-client';
|
|
|
4
4
|
import { useEffect, useState } from 'react';
|
|
5
5
|
import { useAtom } from 'jotai';
|
|
6
6
|
import { Value } from '@/app/state';
|
|
7
|
-
import { DUBHE_SCHEMA_ID } from '../../../contracts/deployment';
|
|
8
7
|
import { toast } from 'sonner';
|
|
9
8
|
import { useContract } from './dubhe/useContract';
|
|
10
9
|
|
|
@@ -35,7 +34,7 @@ export default function Home() {
|
|
|
35
34
|
const [resourceQueryLoading, setResourceQueryLoading] = useState(false);
|
|
36
35
|
const [tableQueryLoading, setTableQueryLoading] = useState(false);
|
|
37
36
|
|
|
38
|
-
const { contract, graphqlClient, ecsWorld, network,
|
|
37
|
+
const { contract, graphqlClient, ecsWorld, network, address, dubheSchemaId } = useContract();
|
|
39
38
|
|
|
40
39
|
/**
|
|
41
40
|
* Discover available tables and components
|
|
@@ -268,7 +267,7 @@ export default function Home() {
|
|
|
268
267
|
const tx = new Transaction();
|
|
269
268
|
(await contract.tx.counter_system.inc({
|
|
270
269
|
tx,
|
|
271
|
-
params: [tx.object(
|
|
270
|
+
params: [tx.object(dubheSchemaId), tx.pure.u32(1)],
|
|
272
271
|
isRaw: true
|
|
273
272
|
})) as TransactionResult;
|
|
274
273
|
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
type NetworkType = 'testnet' | 'mainnet' | 'devnet' | 'localnet';
|
|
2
2
|
|
|
3
3
|
export const NETWORK: NetworkType = 'localnet';
|
|
4
|
-
export const PACKAGE_ID = '
|
|
5
|
-
export const DUBHE_SCHEMA_ID = '
|
|
4
|
+
export const PACKAGE_ID = '0x0ca6c2ae2524851fa389c3213435a0c835d08e21c4ecd9c08decfd3d5635f45c';
|
|
5
|
+
export const DUBHE_SCHEMA_ID = '0xf6ba619c2f5aab287194c6c57c82b20686333b5422d350943972a1cedb1e0f40';
|
|
@@ -10,6 +10,11 @@ services:
|
|
|
10
10
|
volumes:
|
|
11
11
|
- .data/postgres:/var/lib/postgresql/data
|
|
12
12
|
restart: always
|
|
13
|
+
healthcheck:
|
|
14
|
+
test: ['CMD-SHELL', 'pg_isready -U postgres']
|
|
15
|
+
interval: 10s
|
|
16
|
+
timeout: 5s
|
|
17
|
+
retries: 5
|
|
13
18
|
|
|
14
19
|
graphql-server:
|
|
15
20
|
build: .
|
|
@@ -18,12 +23,12 @@ services:
|
|
|
18
23
|
environment:
|
|
19
24
|
- DATABASE_URL=postgresql://postgres:postgres@postgres:5432/postgres
|
|
20
25
|
depends_on:
|
|
21
|
-
|
|
26
|
+
postgres:
|
|
27
|
+
condition: service_healthy
|
|
22
28
|
restart: always
|
|
23
29
|
command: npx @0xobelisk/graphql-server start
|
|
24
30
|
healthcheck:
|
|
25
31
|
test: ['CMD', 'wget', '-qO-', 'http://127.0.0.1:4000/health']
|
|
26
|
-
interval:
|
|
27
|
-
timeout:
|
|
28
|
-
retries:
|
|
29
|
-
start_period: 10s
|
|
32
|
+
interval: 10s
|
|
33
|
+
timeout: 5s
|
|
34
|
+
retries: 5
|
|
@@ -44,6 +44,6 @@
|
|
|
44
44
|
}
|
|
45
45
|
],
|
|
46
46
|
"enums": [],
|
|
47
|
-
"package_id": "
|
|
48
|
-
"start_checkpoint": "
|
|
47
|
+
"package_id": "0x0ca6c2ae2524851fa389c3213435a0c835d08e21c4ecd9c08decfd3d5635f45c",
|
|
48
|
+
"start_checkpoint": "141"
|
|
49
49
|
}
|
|
@@ -1,15 +1,15 @@
|
|
|
1
1
|
{
|
|
2
2
|
"counter0": {
|
|
3
3
|
"fileFormatVersion": 6,
|
|
4
|
-
"address": "
|
|
4
|
+
"address": "0xca6c2ae2524851fa389c3213435a0c835d08e21c4ecd9c08decfd3d5635f45c",
|
|
5
5
|
"name": "counter0",
|
|
6
6
|
"friends": [
|
|
7
7
|
{
|
|
8
|
-
"address": "
|
|
8
|
+
"address": "0xca6c2ae2524851fa389c3213435a0c835d08e21c4ecd9c08decfd3d5635f45c",
|
|
9
9
|
"name": "counter_system"
|
|
10
10
|
},
|
|
11
11
|
{
|
|
12
|
-
"address": "
|
|
12
|
+
"address": "0xca6c2ae2524851fa389c3213435a0c835d08e21c4ecd9c08decfd3d5635f45c",
|
|
13
13
|
"name": "genesis"
|
|
14
14
|
}
|
|
15
15
|
],
|
|
@@ -23,7 +23,7 @@
|
|
|
23
23
|
{
|
|
24
24
|
"MutableReference": {
|
|
25
25
|
"Struct": {
|
|
26
|
-
"address": "
|
|
26
|
+
"address": "0xf2427d420dfd1b8a25346f40948d1779b171832ea8eb425d1eb4453eafd7a542",
|
|
27
27
|
"module": "dapp_service",
|
|
28
28
|
"name": "DappHub",
|
|
29
29
|
"typeArguments": []
|
|
@@ -42,7 +42,7 @@
|
|
|
42
42
|
{
|
|
43
43
|
"Reference": {
|
|
44
44
|
"Struct": {
|
|
45
|
-
"address": "
|
|
45
|
+
"address": "0xf2427d420dfd1b8a25346f40948d1779b171832ea8eb425d1eb4453eafd7a542",
|
|
46
46
|
"module": "dapp_service",
|
|
47
47
|
"name": "DappHub",
|
|
48
48
|
"typeArguments": []
|
|
@@ -61,7 +61,7 @@
|
|
|
61
61
|
{
|
|
62
62
|
"Reference": {
|
|
63
63
|
"Struct": {
|
|
64
|
-
"address": "
|
|
64
|
+
"address": "0xf2427d420dfd1b8a25346f40948d1779b171832ea8eb425d1eb4453eafd7a542",
|
|
65
65
|
"module": "dapp_service",
|
|
66
66
|
"name": "DappHub",
|
|
67
67
|
"typeArguments": []
|
|
@@ -143,7 +143,7 @@
|
|
|
143
143
|
{
|
|
144
144
|
"Reference": {
|
|
145
145
|
"Struct": {
|
|
146
|
-
"address": "
|
|
146
|
+
"address": "0xf2427d420dfd1b8a25346f40948d1779b171832ea8eb425d1eb4453eafd7a542",
|
|
147
147
|
"module": "dapp_service",
|
|
148
148
|
"name": "DappHub",
|
|
149
149
|
"typeArguments": []
|
|
@@ -164,7 +164,7 @@
|
|
|
164
164
|
{
|
|
165
165
|
"MutableReference": {
|
|
166
166
|
"Struct": {
|
|
167
|
-
"address": "
|
|
167
|
+
"address": "0xf2427d420dfd1b8a25346f40948d1779b171832ea8eb425d1eb4453eafd7a542",
|
|
168
168
|
"module": "dapp_service",
|
|
169
169
|
"name": "DappHub",
|
|
170
170
|
"typeArguments": []
|
|
@@ -192,7 +192,7 @@
|
|
|
192
192
|
{
|
|
193
193
|
"MutableReference": {
|
|
194
194
|
"Struct": {
|
|
195
|
-
"address": "
|
|
195
|
+
"address": "0xf2427d420dfd1b8a25346f40948d1779b171832ea8eb425d1eb4453eafd7a542",
|
|
196
196
|
"module": "dapp_service",
|
|
197
197
|
"name": "DappHub",
|
|
198
198
|
"typeArguments": []
|
|
@@ -207,15 +207,15 @@
|
|
|
207
207
|
},
|
|
208
208
|
"counter1": {
|
|
209
209
|
"fileFormatVersion": 6,
|
|
210
|
-
"address": "
|
|
210
|
+
"address": "0xca6c2ae2524851fa389c3213435a0c835d08e21c4ecd9c08decfd3d5635f45c",
|
|
211
211
|
"name": "counter1",
|
|
212
212
|
"friends": [
|
|
213
213
|
{
|
|
214
|
-
"address": "
|
|
214
|
+
"address": "0xca6c2ae2524851fa389c3213435a0c835d08e21c4ecd9c08decfd3d5635f45c",
|
|
215
215
|
"name": "counter_system"
|
|
216
216
|
},
|
|
217
217
|
{
|
|
218
|
-
"address": "
|
|
218
|
+
"address": "0xca6c2ae2524851fa389c3213435a0c835d08e21c4ecd9c08decfd3d5635f45c",
|
|
219
219
|
"name": "genesis"
|
|
220
220
|
}
|
|
221
221
|
],
|
|
@@ -229,7 +229,7 @@
|
|
|
229
229
|
{
|
|
230
230
|
"MutableReference": {
|
|
231
231
|
"Struct": {
|
|
232
|
-
"address": "
|
|
232
|
+
"address": "0xf2427d420dfd1b8a25346f40948d1779b171832ea8eb425d1eb4453eafd7a542",
|
|
233
233
|
"module": "dapp_service",
|
|
234
234
|
"name": "DappHub",
|
|
235
235
|
"typeArguments": []
|
|
@@ -263,7 +263,7 @@
|
|
|
263
263
|
{
|
|
264
264
|
"Reference": {
|
|
265
265
|
"Struct": {
|
|
266
|
-
"address": "
|
|
266
|
+
"address": "0xf2427d420dfd1b8a25346f40948d1779b171832ea8eb425d1eb4453eafd7a542",
|
|
267
267
|
"module": "dapp_service",
|
|
268
268
|
"name": "DappHub",
|
|
269
269
|
"typeArguments": []
|
|
@@ -347,7 +347,7 @@
|
|
|
347
347
|
{
|
|
348
348
|
"Reference": {
|
|
349
349
|
"Struct": {
|
|
350
|
-
"address": "
|
|
350
|
+
"address": "0xf2427d420dfd1b8a25346f40948d1779b171832ea8eb425d1eb4453eafd7a542",
|
|
351
351
|
"module": "dapp_service",
|
|
352
352
|
"name": "DappHub",
|
|
353
353
|
"typeArguments": []
|
|
@@ -368,7 +368,7 @@
|
|
|
368
368
|
{
|
|
369
369
|
"MutableReference": {
|
|
370
370
|
"Struct": {
|
|
371
|
-
"address": "
|
|
371
|
+
"address": "0xf2427d420dfd1b8a25346f40948d1779b171832ea8eb425d1eb4453eafd7a542",
|
|
372
372
|
"module": "dapp_service",
|
|
373
373
|
"name": "DappHub",
|
|
374
374
|
"typeArguments": []
|
|
@@ -396,7 +396,7 @@
|
|
|
396
396
|
{
|
|
397
397
|
"MutableReference": {
|
|
398
398
|
"Struct": {
|
|
399
|
-
"address": "
|
|
399
|
+
"address": "0xf2427d420dfd1b8a25346f40948d1779b171832ea8eb425d1eb4453eafd7a542",
|
|
400
400
|
"module": "dapp_service",
|
|
401
401
|
"name": "DappHub",
|
|
402
402
|
"typeArguments": []
|
|
@@ -412,15 +412,15 @@
|
|
|
412
412
|
},
|
|
413
413
|
"counter2": {
|
|
414
414
|
"fileFormatVersion": 6,
|
|
415
|
-
"address": "
|
|
415
|
+
"address": "0xca6c2ae2524851fa389c3213435a0c835d08e21c4ecd9c08decfd3d5635f45c",
|
|
416
416
|
"name": "counter2",
|
|
417
417
|
"friends": [
|
|
418
418
|
{
|
|
419
|
-
"address": "
|
|
419
|
+
"address": "0xca6c2ae2524851fa389c3213435a0c835d08e21c4ecd9c08decfd3d5635f45c",
|
|
420
420
|
"name": "counter_system"
|
|
421
421
|
},
|
|
422
422
|
{
|
|
423
|
-
"address": "
|
|
423
|
+
"address": "0xca6c2ae2524851fa389c3213435a0c835d08e21c4ecd9c08decfd3d5635f45c",
|
|
424
424
|
"name": "genesis"
|
|
425
425
|
}
|
|
426
426
|
],
|
|
@@ -434,7 +434,7 @@
|
|
|
434
434
|
{
|
|
435
435
|
"MutableReference": {
|
|
436
436
|
"Struct": {
|
|
437
|
-
"address": "
|
|
437
|
+
"address": "0xf2427d420dfd1b8a25346f40948d1779b171832ea8eb425d1eb4453eafd7a542",
|
|
438
438
|
"module": "dapp_service",
|
|
439
439
|
"name": "DappHub",
|
|
440
440
|
"typeArguments": []
|
|
@@ -467,7 +467,7 @@
|
|
|
467
467
|
{
|
|
468
468
|
"Reference": {
|
|
469
469
|
"Struct": {
|
|
470
|
-
"address": "
|
|
470
|
+
"address": "0xf2427d420dfd1b8a25346f40948d1779b171832ea8eb425d1eb4453eafd7a542",
|
|
471
471
|
"module": "dapp_service",
|
|
472
472
|
"name": "DappHub",
|
|
473
473
|
"typeArguments": []
|
|
@@ -485,7 +485,7 @@
|
|
|
485
485
|
{
|
|
486
486
|
"Reference": {
|
|
487
487
|
"Struct": {
|
|
488
|
-
"address": "
|
|
488
|
+
"address": "0xf2427d420dfd1b8a25346f40948d1779b171832ea8eb425d1eb4453eafd7a542",
|
|
489
489
|
"module": "dapp_service",
|
|
490
490
|
"name": "DappHub",
|
|
491
491
|
"typeArguments": []
|
|
@@ -503,7 +503,7 @@
|
|
|
503
503
|
{
|
|
504
504
|
"Reference": {
|
|
505
505
|
"Struct": {
|
|
506
|
-
"address": "
|
|
506
|
+
"address": "0xf2427d420dfd1b8a25346f40948d1779b171832ea8eb425d1eb4453eafd7a542",
|
|
507
507
|
"module": "dapp_service",
|
|
508
508
|
"name": "DappHub",
|
|
509
509
|
"typeArguments": []
|
|
@@ -586,7 +586,7 @@
|
|
|
586
586
|
{
|
|
587
587
|
"Reference": {
|
|
588
588
|
"Struct": {
|
|
589
|
-
"address": "
|
|
589
|
+
"address": "0xf2427d420dfd1b8a25346f40948d1779b171832ea8eb425d1eb4453eafd7a542",
|
|
590
590
|
"module": "dapp_service",
|
|
591
591
|
"name": "DappHub",
|
|
592
592
|
"typeArguments": []
|
|
@@ -606,7 +606,7 @@
|
|
|
606
606
|
{
|
|
607
607
|
"MutableReference": {
|
|
608
608
|
"Struct": {
|
|
609
|
-
"address": "
|
|
609
|
+
"address": "0xf2427d420dfd1b8a25346f40948d1779b171832ea8eb425d1eb4453eafd7a542",
|
|
610
610
|
"module": "dapp_service",
|
|
611
611
|
"name": "DappHub",
|
|
612
612
|
"typeArguments": []
|
|
@@ -634,7 +634,7 @@
|
|
|
634
634
|
{
|
|
635
635
|
"MutableReference": {
|
|
636
636
|
"Struct": {
|
|
637
|
-
"address": "
|
|
637
|
+
"address": "0xf2427d420dfd1b8a25346f40948d1779b171832ea8eb425d1eb4453eafd7a542",
|
|
638
638
|
"module": "dapp_service",
|
|
639
639
|
"name": "DappHub",
|
|
640
640
|
"typeArguments": []
|
|
@@ -649,7 +649,7 @@
|
|
|
649
649
|
},
|
|
650
650
|
"counter_system": {
|
|
651
651
|
"fileFormatVersion": 6,
|
|
652
|
-
"address": "
|
|
652
|
+
"address": "0xca6c2ae2524851fa389c3213435a0c835d08e21c4ecd9c08decfd3d5635f45c",
|
|
653
653
|
"name": "counter_system",
|
|
654
654
|
"friends": [],
|
|
655
655
|
"structs": {},
|
|
@@ -662,7 +662,7 @@
|
|
|
662
662
|
{
|
|
663
663
|
"MutableReference": {
|
|
664
664
|
"Struct": {
|
|
665
|
-
"address": "
|
|
665
|
+
"address": "0xf2427d420dfd1b8a25346f40948d1779b171832ea8eb425d1eb4453eafd7a542",
|
|
666
666
|
"module": "dapp_service",
|
|
667
667
|
"name": "DappHub",
|
|
668
668
|
"typeArguments": []
|
|
@@ -687,23 +687,23 @@
|
|
|
687
687
|
},
|
|
688
688
|
"dapp_key": {
|
|
689
689
|
"fileFormatVersion": 6,
|
|
690
|
-
"address": "
|
|
690
|
+
"address": "0xca6c2ae2524851fa389c3213435a0c835d08e21c4ecd9c08decfd3d5635f45c",
|
|
691
691
|
"name": "dapp_key",
|
|
692
692
|
"friends": [
|
|
693
693
|
{
|
|
694
|
-
"address": "
|
|
694
|
+
"address": "0xca6c2ae2524851fa389c3213435a0c835d08e21c4ecd9c08decfd3d5635f45c",
|
|
695
695
|
"name": "counter0"
|
|
696
696
|
},
|
|
697
697
|
{
|
|
698
|
-
"address": "
|
|
698
|
+
"address": "0xca6c2ae2524851fa389c3213435a0c835d08e21c4ecd9c08decfd3d5635f45c",
|
|
699
699
|
"name": "counter1"
|
|
700
700
|
},
|
|
701
701
|
{
|
|
702
|
-
"address": "
|
|
702
|
+
"address": "0xca6c2ae2524851fa389c3213435a0c835d08e21c4ecd9c08decfd3d5635f45c",
|
|
703
703
|
"name": "counter2"
|
|
704
704
|
},
|
|
705
705
|
{
|
|
706
|
-
"address": "
|
|
706
|
+
"address": "0xca6c2ae2524851fa389c3213435a0c835d08e21c4ecd9c08decfd3d5635f45c",
|
|
707
707
|
"name": "genesis"
|
|
708
708
|
}
|
|
709
709
|
],
|
|
@@ -733,7 +733,7 @@
|
|
|
733
733
|
"return": [
|
|
734
734
|
{
|
|
735
735
|
"Struct": {
|
|
736
|
-
"address": "
|
|
736
|
+
"address": "0xca6c2ae2524851fa389c3213435a0c835d08e21c4ecd9c08decfd3d5635f45c",
|
|
737
737
|
"module": "dapp_key",
|
|
738
738
|
"name": "DappKey",
|
|
739
739
|
"typeArguments": []
|
|
@@ -770,11 +770,11 @@
|
|
|
770
770
|
},
|
|
771
771
|
"deploy_hook": {
|
|
772
772
|
"fileFormatVersion": 6,
|
|
773
|
-
"address": "
|
|
773
|
+
"address": "0xca6c2ae2524851fa389c3213435a0c835d08e21c4ecd9c08decfd3d5635f45c",
|
|
774
774
|
"name": "deploy_hook",
|
|
775
775
|
"friends": [
|
|
776
776
|
{
|
|
777
|
-
"address": "
|
|
777
|
+
"address": "0xca6c2ae2524851fa389c3213435a0c835d08e21c4ecd9c08decfd3d5635f45c",
|
|
778
778
|
"name": "genesis"
|
|
779
779
|
}
|
|
780
780
|
],
|
|
@@ -788,7 +788,7 @@
|
|
|
788
788
|
{
|
|
789
789
|
"MutableReference": {
|
|
790
790
|
"Struct": {
|
|
791
|
-
"address": "
|
|
791
|
+
"address": "0xf2427d420dfd1b8a25346f40948d1779b171832ea8eb425d1eb4453eafd7a542",
|
|
792
792
|
"module": "dapp_service",
|
|
793
793
|
"name": "DappHub",
|
|
794
794
|
"typeArguments": []
|
|
@@ -812,7 +812,7 @@
|
|
|
812
812
|
},
|
|
813
813
|
"errors": {
|
|
814
814
|
"fileFormatVersion": 6,
|
|
815
|
-
"address": "
|
|
815
|
+
"address": "0xca6c2ae2524851fa389c3213435a0c835d08e21c4ecd9c08decfd3d5635f45c",
|
|
816
816
|
"name": "errors",
|
|
817
817
|
"friends": [],
|
|
818
818
|
"structs": {},
|
|
@@ -830,7 +830,7 @@
|
|
|
830
830
|
},
|
|
831
831
|
"genesis": {
|
|
832
832
|
"fileFormatVersion": 6,
|
|
833
|
-
"address": "
|
|
833
|
+
"address": "0xca6c2ae2524851fa389c3213435a0c835d08e21c4ecd9c08decfd3d5635f45c",
|
|
834
834
|
"name": "genesis",
|
|
835
835
|
"friends": [],
|
|
836
836
|
"structs": {},
|
|
@@ -843,7 +843,7 @@
|
|
|
843
843
|
{
|
|
844
844
|
"MutableReference": {
|
|
845
845
|
"Struct": {
|
|
846
|
-
"address": "
|
|
846
|
+
"address": "0xf2427d420dfd1b8a25346f40948d1779b171832ea8eb425d1eb4453eafd7a542",
|
|
847
847
|
"module": "dapp_service",
|
|
848
848
|
"name": "DappHub",
|
|
849
849
|
"typeArguments": []
|
|
@@ -872,12 +872,42 @@
|
|
|
872
872
|
}
|
|
873
873
|
],
|
|
874
874
|
"return": []
|
|
875
|
+
},
|
|
876
|
+
"upgrade": {
|
|
877
|
+
"visibility": "Friend",
|
|
878
|
+
"isEntry": false,
|
|
879
|
+
"typeParameters": [],
|
|
880
|
+
"parameters": [
|
|
881
|
+
{
|
|
882
|
+
"MutableReference": {
|
|
883
|
+
"Struct": {
|
|
884
|
+
"address": "0xf2427d420dfd1b8a25346f40948d1779b171832ea8eb425d1eb4453eafd7a542",
|
|
885
|
+
"module": "dapp_service",
|
|
886
|
+
"name": "DappHub",
|
|
887
|
+
"typeArguments": []
|
|
888
|
+
}
|
|
889
|
+
}
|
|
890
|
+
},
|
|
891
|
+
"Address",
|
|
892
|
+
"U32",
|
|
893
|
+
{
|
|
894
|
+
"MutableReference": {
|
|
895
|
+
"Struct": {
|
|
896
|
+
"address": "0x2",
|
|
897
|
+
"module": "tx_context",
|
|
898
|
+
"name": "TxContext",
|
|
899
|
+
"typeArguments": []
|
|
900
|
+
}
|
|
901
|
+
}
|
|
902
|
+
}
|
|
903
|
+
],
|
|
904
|
+
"return": []
|
|
875
905
|
}
|
|
876
906
|
}
|
|
877
907
|
},
|
|
878
908
|
"migrate": {
|
|
879
909
|
"fileFormatVersion": 6,
|
|
880
|
-
"address": "
|
|
910
|
+
"address": "0xca6c2ae2524851fa389c3213435a0c835d08e21c4ecd9c08decfd3d5635f45c",
|
|
881
911
|
"name": "migrate",
|
|
882
912
|
"friends": [],
|
|
883
913
|
"structs": {},
|
|
@@ -3,12 +3,10 @@
|
|
|
3
3
|
"version": "1.0.0",
|
|
4
4
|
"scripts": {
|
|
5
5
|
"// Utility Commands": "----------------",
|
|
6
|
-
"lint": "next lint",
|
|
7
|
-
"lint:fix": "next lint --fix",
|
|
8
6
|
"format": "prettier --write .",
|
|
9
7
|
"format:check": "prettier --check .",
|
|
10
8
|
"type-check": "tsc --noEmit",
|
|
11
|
-
"validate": "pnpm
|
|
9
|
+
"validate": "pnpm format:check && pnpm type-check",
|
|
12
10
|
"start:localnet": "pnpm dubhe node",
|
|
13
11
|
"faucet": "pnpm dubhe faucet --network",
|
|
14
12
|
"deploy": "pnpm dubhe publish --network",
|
|
@@ -31,10 +29,6 @@
|
|
|
31
29
|
"@0xobelisk/sui-client": "{{dubhe-version}}",
|
|
32
30
|
"@0xobelisk/sui-common": "{{dubhe-version}}",
|
|
33
31
|
"dotenv": "^16.4.5",
|
|
34
|
-
"jotai": "^1.7.2",
|
|
35
|
-
"next": "15.1.6",
|
|
36
|
-
"react": "^19.0.0",
|
|
37
|
-
"react-dom": "^19.0.0",
|
|
38
32
|
"sonner": "^1.5.0",
|
|
39
33
|
"viem": "2.21.19"
|
|
40
34
|
},
|
|
@@ -43,10 +37,7 @@
|
|
|
43
37
|
"mprocs": "^0.7.1",
|
|
44
38
|
"@eslint/eslintrc": "^3",
|
|
45
39
|
"@types/node": "^18",
|
|
46
|
-
"@types/react": "^19",
|
|
47
|
-
"@types/react-dom": "^19",
|
|
48
40
|
"eslint": "^8.56.0",
|
|
49
|
-
"eslint-config-next": "15.1.6",
|
|
50
41
|
"eslint-config-prettier": "^9.1.0",
|
|
51
42
|
"postcss": "^8",
|
|
52
43
|
"prettier": "3.3.3",
|