create-dubhe 0.1.2 → 0.1.5

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 (123) hide show
  1. package/package.json +1 -1
  2. package/template/101/sui-template/.prettierrc +7 -7
  3. package/template/101/sui-template/README.md +8 -9
  4. package/template/101/sui-template/contracts/counter/.history/sui_localnet/latest.json +11 -0
  5. package/template/101/sui-template/contracts/counter/Move.lock +45 -0
  6. package/template/101/sui-template/dubhe.config.ts +11 -11
  7. package/template/101/sui-template/eslint.config.mjs +14 -0
  8. package/template/101/sui-template/next.config.ts +7 -0
  9. package/template/101/sui-template/package.json +23 -40
  10. package/template/101/sui-template/pnpm-lock.yaml +8133 -0
  11. package/template/101/sui-template/postcss.config.mjs +8 -0
  12. package/template/101/sui-template/src/app/favicon.ico +0 -0
  13. package/template/101/sui-template/src/app/globals.css +21 -0
  14. package/template/101/sui-template/src/app/layout.tsx +34 -0
  15. package/template/101/sui-template/src/app/page.tsx +106 -0
  16. package/template/101/sui-template/src/app/state/index.tsx +5 -0
  17. package/template/101/sui-template/src/chain/config.ts +2 -2
  18. package/template/101/sui-template/tailwind.config.ts +18 -0
  19. package/template/101/sui-template/tsconfig.json +11 -8
  20. package/template/contract/sui-template/package.json +1 -1
  21. package/template/nextjs/sui-template/.prettierrc +7 -7
  22. package/template/nextjs/sui-template/README.md +8 -8
  23. package/template/nextjs/sui-template/contracts/counter/.history/sui_localnet/latest.json +11 -0
  24. package/template/nextjs/sui-template/contracts/counter/Move.lock +52 -0
  25. package/template/nextjs/sui-template/contracts/counter/Move.toml +1 -1
  26. package/template/nextjs/sui-template/dubhe.config.ts +11 -11
  27. package/template/nextjs/sui-template/eslint.config.mjs +14 -0
  28. package/template/nextjs/sui-template/next.config.mjs +5 -0
  29. package/template/nextjs/sui-template/package.json +25 -41
  30. package/template/nextjs/sui-template/pnpm-lock.yaml +9002 -0
  31. package/template/nextjs/sui-template/postcss.config.mjs +8 -0
  32. package/template/nextjs/sui-template/src/app/favicon.ico +0 -0
  33. package/template/nextjs/sui-template/src/app/globals.css +21 -0
  34. package/template/nextjs/sui-template/src/app/layout.tsx +35 -0
  35. package/template/nextjs/sui-template/src/app/page.tsx +151 -0
  36. package/template/nextjs/sui-template/src/{pages/_app.tsx → app/providers.tsx} +6 -12
  37. package/template/nextjs/sui-template/src/app/state/index.tsx +5 -0
  38. package/template/nextjs/sui-template/src/chain/config.ts +3 -3
  39. package/template/nextjs/sui-template/tailwind.config.ts +18 -0
  40. package/template/nextjs/sui-template/tsconfig.json +13 -15
  41. package/template/101/sui-template/.dockerignore +0 -7
  42. package/template/101/sui-template/.eslintrc.json +0 -3
  43. package/template/101/sui-template/Dockerfile +0 -52
  44. package/template/101/sui-template/LICENSE +0 -674
  45. package/template/101/sui-template/jest.config.ts +0 -17
  46. package/template/101/sui-template/next-env.d.ts +0 -5
  47. package/template/101/sui-template/next-i18next.config.js +0 -6
  48. package/template/101/sui-template/next.config.js +0 -15
  49. package/template/101/sui-template/postcss.config.js +0 -6
  50. package/template/101/sui-template/public/discord.svg +0 -9
  51. package/template/101/sui-template/public/fail.svg +0 -12
  52. package/template/101/sui-template/public/favicon.ico +0 -0
  53. package/template/101/sui-template/public/locales/de/common.json +0 -8
  54. package/template/101/sui-template/public/locales/de/footer.json +0 -3
  55. package/template/101/sui-template/public/locales/de/second-page.json +0 -5
  56. package/template/101/sui-template/public/locales/en/common.json +0 -8
  57. package/template/101/sui-template/public/locales/en/footer.json +0 -3
  58. package/template/101/sui-template/public/locales/en/second-page.json +0 -5
  59. package/template/101/sui-template/public/locales/zn/common.json +0 -8
  60. package/template/101/sui-template/public/locales/zn/footer.json +0 -3
  61. package/template/101/sui-template/public/locales/zn/second-page.json +0 -5
  62. package/template/101/sui-template/public/logo.svg +0 -1
  63. package/template/101/sui-template/public/medium.svg +0 -9
  64. package/template/101/sui-template/public/successful.svg +0 -11
  65. package/template/101/sui-template/public/telegram.svg +0 -9
  66. package/template/101/sui-template/public/twitter.svg +0 -9
  67. package/template/101/sui-template/src/css/font-awesome.css +0 -2337
  68. package/template/101/sui-template/src/css/font-awesome.min.css +0 -4
  69. package/template/101/sui-template/src/fonts/FontAwesome.otf +0 -0
  70. package/template/101/sui-template/src/fonts/fontawesome-webfont.eot +0 -0
  71. package/template/101/sui-template/src/fonts/fontawesome-webfont.svg +0 -2671
  72. package/template/101/sui-template/src/fonts/fontawesome-webfont.ttf +0 -0
  73. package/template/101/sui-template/src/fonts/fontawesome-webfont.woff +0 -0
  74. package/template/101/sui-template/src/fonts/fontawesome-webfont.woff2 +0 -0
  75. package/template/101/sui-template/src/jotai/index.tsx +0 -12
  76. package/template/101/sui-template/src/pages/_app.tsx +0 -15
  77. package/template/101/sui-template/src/pages/home/index.tsx +0 -117
  78. package/template/101/sui-template/src/pages/index.tsx +0 -12
  79. package/template/101/sui-template/tailwind.config.js +0 -56
  80. package/template/nextjs/sui-template/.dockerignore +0 -7
  81. package/template/nextjs/sui-template/.eslintrc.json +0 -3
  82. package/template/nextjs/sui-template/Dockerfile +0 -52
  83. package/template/nextjs/sui-template/LICENSE +0 -674
  84. package/template/nextjs/sui-template/jest.config.ts +0 -17
  85. package/template/nextjs/sui-template/next-env.d.ts +0 -5
  86. package/template/nextjs/sui-template/next-i18next.config.js +0 -6
  87. package/template/nextjs/sui-template/next.config.js +0 -15
  88. package/template/nextjs/sui-template/postcss.config.js +0 -6
  89. package/template/nextjs/sui-template/public/discord.svg +0 -9
  90. package/template/nextjs/sui-template/public/fail.svg +0 -12
  91. package/template/nextjs/sui-template/public/favicon.ico +0 -0
  92. package/template/nextjs/sui-template/public/locales/de/common.json +0 -8
  93. package/template/nextjs/sui-template/public/locales/de/footer.json +0 -3
  94. package/template/nextjs/sui-template/public/locales/de/second-page.json +0 -5
  95. package/template/nextjs/sui-template/public/locales/en/common.json +0 -8
  96. package/template/nextjs/sui-template/public/locales/en/footer.json +0 -3
  97. package/template/nextjs/sui-template/public/locales/en/second-page.json +0 -5
  98. package/template/nextjs/sui-template/public/locales/zn/common.json +0 -8
  99. package/template/nextjs/sui-template/public/locales/zn/footer.json +0 -3
  100. package/template/nextjs/sui-template/public/locales/zn/second-page.json +0 -5
  101. package/template/nextjs/sui-template/public/logo.svg +0 -1
  102. package/template/nextjs/sui-template/public/medium.svg +0 -9
  103. package/template/nextjs/sui-template/public/successful.svg +0 -11
  104. package/template/nextjs/sui-template/public/telegram.svg +0 -9
  105. package/template/nextjs/sui-template/public/twitter.svg +0 -9
  106. package/template/nextjs/sui-template/src/components/Animation.tsx +0 -80
  107. package/template/nextjs/sui-template/src/components/Container.tsx +0 -11
  108. package/template/nextjs/sui-template/src/components/footer/index.tsx +0 -138
  109. package/template/nextjs/sui-template/src/components/head/index.tsx +0 -14
  110. package/template/nextjs/sui-template/src/components/header/index.tsx +0 -173
  111. package/template/nextjs/sui-template/src/components/pop_up_box/index.tsx +0 -149
  112. package/template/nextjs/sui-template/src/css/font-awesome.css +0 -2337
  113. package/template/nextjs/sui-template/src/css/font-awesome.min.css +0 -4
  114. package/template/nextjs/sui-template/src/fonts/FontAwesome.otf +0 -0
  115. package/template/nextjs/sui-template/src/fonts/fontawesome-webfont.eot +0 -0
  116. package/template/nextjs/sui-template/src/fonts/fontawesome-webfont.svg +0 -2671
  117. package/template/nextjs/sui-template/src/fonts/fontawesome-webfont.ttf +0 -0
  118. package/template/nextjs/sui-template/src/fonts/fontawesome-webfont.woff +0 -0
  119. package/template/nextjs/sui-template/src/fonts/fontawesome-webfont.woff2 +0 -0
  120. package/template/nextjs/sui-template/src/jotai/index.tsx +0 -13
  121. package/template/nextjs/sui-template/src/pages/home/index.tsx +0 -172
  122. package/template/nextjs/sui-template/src/pages/index.tsx +0 -15
  123. package/template/nextjs/sui-template/tailwind.config.js +0 -56
@@ -0,0 +1,8 @@
1
+ /** @type {import('postcss-load-config').Config} */
2
+ const config = {
3
+ plugins: {
4
+ tailwindcss: {},
5
+ },
6
+ };
7
+
8
+ export default config;
@@ -0,0 +1,21 @@
1
+ @tailwind base;
2
+ @tailwind components;
3
+ @tailwind utilities;
4
+
5
+ :root {
6
+ --background: #ffffff;
7
+ --foreground: #171717;
8
+ }
9
+
10
+ @media (prefers-color-scheme: dark) {
11
+ :root {
12
+ --background: #0a0a0a;
13
+ --foreground: #ededed;
14
+ }
15
+ }
16
+
17
+ body {
18
+ color: var(--foreground);
19
+ background: var(--background);
20
+ font-family: Arial, Helvetica, sans-serif;
21
+ }
@@ -0,0 +1,34 @@
1
+ import type { Metadata } from 'next';
2
+ import { Geist, Geist_Mono } from 'next/font/google';
3
+ import { Toaster } from 'sonner';
4
+ import './globals.css';
5
+
6
+ const geistSans = Geist({
7
+ variable: '--font-geist-sans',
8
+ subsets: ['latin'],
9
+ });
10
+
11
+ const geistMono = Geist_Mono({
12
+ variable: '--font-geist-mono',
13
+ subsets: ['latin'],
14
+ });
15
+
16
+ export const metadata: Metadata = {
17
+ title: 'sui 101 template',
18
+ description: 'Generated by create dubhe',
19
+ };
20
+
21
+ export default function RootLayout({
22
+ children,
23
+ }: Readonly<{
24
+ children: React.ReactNode;
25
+ }>) {
26
+ return (
27
+ <html lang="en" suppressHydrationWarning>
28
+ <body className={`${geistSans.variable} ${geistMono.variable} antialiased`} suppressHydrationWarning>
29
+ <Toaster />
30
+ {children}
31
+ </body>
32
+ </html>
33
+ );
34
+ }
@@ -0,0 +1,106 @@
1
+ 'use client';
2
+
3
+ import { loadMetadata, Dubhe, Transaction, TransactionResult } from '@0xobelisk/sui-client';
4
+ import { useEffect, useState } from 'react';
5
+ import { useAtom } from 'jotai';
6
+ import { Value } from '@/app/state';
7
+ import { SCHEMA_ID, NETWORK, PACKAGE_ID } from '@/chain/config';
8
+ import { PRIVATEKEY } from '@/chain/key';
9
+ import { toast } from 'sonner';
10
+
11
+ export default function Home() {
12
+ const [value, setValue] = useAtom(Value);
13
+ const [loading, setLoading] = useState(false);
14
+
15
+ /**
16
+ * Fetches the current value of the counter contract
17
+ */
18
+ const queryCounterValue = async () => {
19
+ const metadata = await loadMetadata(NETWORK, PACKAGE_ID);
20
+ const dubhe = new Dubhe({
21
+ networkType: NETWORK,
22
+ packageId: PACKAGE_ID,
23
+ metadata: metadata,
24
+ });
25
+ const tx = new Transaction();
26
+ const counterValue = await dubhe.state({
27
+ tx,
28
+ schema: 'value', // schema name in dubhe.config.ts
29
+ params: [tx.object(SCHEMA_ID)],
30
+ });
31
+ console.log('Counter value:', counterValue);
32
+ setValue(counterValue[0]);
33
+ };
34
+
35
+ /**
36
+ * Increments the counter value
37
+ */
38
+ const incrementCounter = async () => {
39
+ setLoading(true);
40
+ const metadata = await loadMetadata(NETWORK, PACKAGE_ID);
41
+ const dubhe = new Dubhe({
42
+ networkType: NETWORK,
43
+ packageId: PACKAGE_ID,
44
+ metadata: metadata,
45
+ secretKey: PRIVATEKEY,
46
+ });
47
+ const tx = new Transaction();
48
+ (await dubhe.tx.counter_system.inc({
49
+ tx,
50
+ params: [tx.object(SCHEMA_ID), tx.pure.u32(1)],
51
+ isRaw: true,
52
+ })) as TransactionResult;
53
+ await dubhe.signAndSendTxn({
54
+ tx,
55
+ onSuccess: async result => {
56
+ setTimeout(async () => {
57
+ await queryCounterValue();
58
+ toast('Transaction Successful', {
59
+ description: new Date().toUTCString(),
60
+ action: {
61
+ label: 'Check in Explorer',
62
+ onClick: () => window.open(dubhe.getTxExplorerUrl(result.digest), '_blank'),
63
+ },
64
+ });
65
+ }, 200);
66
+
67
+ // await dubhe.waitForTransaction(result.digest);
68
+ },
69
+ onError: error => {
70
+ console.error('Transaction failed:', error);
71
+ toast.error('Transaction failed. Please try again.');
72
+ },
73
+ });
74
+
75
+ setLoading(false);
76
+ };
77
+
78
+ useEffect(() => {
79
+ queryCounterValue();
80
+ }, []);
81
+
82
+ return (
83
+ <div className="grid grid-rows-[20px_1fr_20px] items-center justify-items-center min-h-screen p-8 pb-20 gap-16 sm:p-20 font-[family-name:var(--font-geist-sans)]">
84
+ <main className="flex flex-col gap-8 row-start-2 items-center sm:items-start">
85
+ <div className="max-w-7xl mx-auto text-center py-12 px-4 sm:px-6 lg:py-16 lg:px-8 flex-6">
86
+ <div className="flex flex-col gap-6 mt-12">
87
+ <div className="flex flex-col gap-4">
88
+ You account already have some sui from {NETWORK}
89
+ <div className="flex flex-col gap-6 text-2xl text-green-600 mt-6 ">Counter: {value}</div>
90
+ <div className="flex flex-col gap-6">
91
+ <button
92
+ type="button"
93
+ className="mx-auto px-5 py-3 border border-transparent text-base font-medium rounded-md text-white bg-indigo-600 hover:bg-indigo-700"
94
+ onClick={() => incrementCounter()}
95
+ disabled={loading}
96
+ >
97
+ {loading ? 'Processing...' : 'Increment'}
98
+ </button>
99
+ </div>
100
+ </div>
101
+ </div>
102
+ </div>
103
+ </main>
104
+ </div>
105
+ );
106
+ }
@@ -0,0 +1,5 @@
1
+ import { atom } from 'jotai';
2
+
3
+ const Value = atom<string | number>(0);
4
+
5
+ export { Value };
@@ -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 = '0xf1cdba68447a4a47d193c8811ef99b3188946bcd53ed168140e53749b479c040'
5
- export const SCHEMA_ID = '0xbdd117bc0bea2691077ea632353a0cf9d9732c9a636ff77684ffca5f94bca5f9'
4
+ export const PACKAGE_ID = '0xa96e1ead575c35025ab76cb0ecb0e51f80ed566a65dd21f2d72385139ef3b706';
5
+ export const SCHEMA_ID = '0xdf69aa5e8df208ab3d3382a55fefd60ab38cd63f7996493a257e828868054697';
@@ -0,0 +1,18 @@
1
+ import type { Config } from 'tailwindcss';
2
+
3
+ export default {
4
+ content: [
5
+ './src/pages/**/*.{js,ts,jsx,tsx,mdx}',
6
+ './src/components/**/*.{js,ts,jsx,tsx,mdx}',
7
+ './src/app/**/*.{js,ts,jsx,tsx,mdx}',
8
+ ],
9
+ theme: {
10
+ extend: {
11
+ colors: {
12
+ background: 'var(--background)',
13
+ foreground: 'var(--foreground)',
14
+ },
15
+ },
16
+ },
17
+ plugins: [],
18
+ } satisfies Config;
@@ -1,11 +1,6 @@
1
1
  {
2
- "ts-node": {
3
- "compilerOptions": {
4
- "module": "CommonJS"
5
- }
6
- },
7
2
  "compilerOptions": {
8
- "target": "es6",
3
+ "target": "ES2017",
9
4
  "lib": ["dom", "dom.iterable", "esnext"],
10
5
  "allowJs": true,
11
6
  "skipLibCheck": true,
@@ -18,8 +13,16 @@
18
13
  "resolveJsonModule": true,
19
14
  "isolatedModules": true,
20
15
  "jsx": "preserve",
21
- "incremental": true
16
+ "incremental": true,
17
+ "plugins": [
18
+ {
19
+ "name": "next"
20
+ }
21
+ ],
22
+ "paths": {
23
+ "@/*": ["./src/*"]
24
+ }
22
25
  },
23
- "include": ["next-env.d.ts", "**/*.ts", "**/*.tsx"],
26
+ "include": ["next-env.d.ts", "**/*.ts", "**/*.tsx", ".next/types/**/*.ts"],
24
27
  "exclude": ["node_modules"]
25
28
  }
@@ -16,7 +16,7 @@
16
16
  },
17
17
  "dependencies": {
18
18
  "@0xobelisk/sui-cli": "^1.1.0",
19
- "@0xobelisk/sui-client": "^1.1.1",
19
+ "@0xobelisk/sui-client": "^1.1.2",
20
20
  "@0xobelisk/sui-common": "^1.1.0",
21
21
  "@0xobelisk/sui-indexer": "^1.1.3",
22
22
  "dotenv": "^16.4.5",
@@ -1,8 +1,8 @@
1
1
  {
2
- "printWidth": 120,
3
- "tabWidth": 2,
4
- "singleQuote": true,
5
- "trailingComma": "all",
6
- "semi": true,
7
- "arrowParens": "avoid"
8
- }
2
+ "printWidth": 120,
3
+ "tabWidth": 2,
4
+ "singleQuote": true,
5
+ "trailingComma": "all",
6
+ "semi": true,
7
+ "arrowParens": "avoid"
8
+ }
@@ -1,13 +1,13 @@
1
1
  ## How to use
2
2
  ```bash
3
- 1 install sui <https://docs.sui.io/build/install>
4
- 2 cd dubhe-nextjs-template folder
5
- 3 pnpm install
6
- 4 open new window && npm run localnode
7
- 4 open new window && npm run start-template
8
- 5 set WorldId:<value> to src/chain/config.ts
9
- 6 set PackageId:<value> to src/chain/config.ts
10
- 7 npm run dev
3
+ 1. install sui <https://docs.sui.io/build/install>
4
+ 2. cd dubhe-nextjs-template folder
5
+ 3. pnpm install
6
+ 4. open new window && pnpm start:localnet
7
+ 5. open new window && pnpm dev
11
8
  ```
12
9
 
10
+ Environment: node.js (v18.20.0+) ([download](https://nodejs.org/en/download/))
11
+ > Please use `node -v` check your node version
12
+
13
13
  Deploy it to the cloud with [Vercel](https://vercel.com/new?utm_source=github&utm_medium=readme&utm_campaign=next-example) ([Documentation](https://nextjs.org/docs/deployment)).
@@ -0,0 +1,11 @@
1
+ {
2
+ "projectName": "counter",
3
+ "network": "localnet",
4
+ "packageId": "0x6c0d1a23aefeb10bb53837dd23463420dd7c4edce6f762882ae75ea16cbd702c",
5
+ "schemaId": "0xe60a62fb4c195d3867b33ca55d536c84373c66caa603c9ace0013a5a1a86de64",
6
+ "schemas": {
7
+ "value": "StorageValue<u32>"
8
+ },
9
+ "upgradeCap": "0x8960f2dda0055be2f9ac520792f80ba993e6939480f72d809a57f5a8babac868",
10
+ "version": 1
11
+ }
@@ -0,0 +1,52 @@
1
+ # @generated by Move, please check-in and do not edit manually.
2
+
3
+ [move]
4
+ version = 3
5
+ manifest_digest = "B09B7C9C87825CC9EF77E81A3D5E85A0AB14105BE3BE2E197372D755B02AC46E"
6
+ deps_digest = "3C4103934B1E040BB6B23F1D610B4EF9F2F1166A50A104EADCF77467C004C600"
7
+ dependencies = [
8
+ { id = "Dubhe", name = "Dubhe" },
9
+ { id = "Sui", name = "Sui" },
10
+ ]
11
+
12
+ [[move.package]]
13
+ id = "Dubhe"
14
+ source = { local = "../dubhe-framework" }
15
+
16
+ dependencies = [
17
+ { id = "Sui", name = "Sui" },
18
+ ]
19
+
20
+ [[move.package]]
21
+ id = "MoveStdlib"
22
+ source = { git = "https://github.com/MystenLabs/sui.git", rev = "mainnet-v1.38.3", subdir = "crates/sui-framework/packages/move-stdlib" }
23
+
24
+ [[move.package]]
25
+ id = "Sui"
26
+ source = { git = "https://github.com/MystenLabs/sui.git", rev = "mainnet-v1.38.3", subdir = "crates/sui-framework/packages/sui-framework" }
27
+
28
+ dependencies = [
29
+ { id = "MoveStdlib", name = "MoveStdlib" },
30
+ ]
31
+
32
+ [move.toolchain-version]
33
+ compiler-version = "1.38.3"
34
+ edition = "2024"
35
+ flavor = "sui"
36
+
37
+
38
+
39
+
40
+
41
+
42
+
43
+
44
+
45
+
46
+
47
+
48
+ [env.localnet]
49
+ chain-id = "735df0b0"
50
+ original-published-id = "0x6c0d1a23aefeb10bb53837dd23463420dd7c4edce6f762882ae75ea16cbd702c"
51
+ latest-published-id = "0x6c0d1a23aefeb10bb53837dd23463420dd7c4edce6f762882ae75ea16cbd702c"
52
+ published-version = "1"
@@ -5,7 +5,7 @@ edition = "2024"
5
5
 
6
6
  [dependencies]
7
7
  Sui = { git = "https://github.com/MystenLabs/sui.git", subdir = "crates/sui-framework/packages/sui-framework", rev = "mainnet-v1.38.3" }
8
- Dubhe = { git = "https://github.com/0xobelisk/dubhe-framework.git", rev = "dubhe-testnet-v1.1.0" }
8
+ Dubhe = { local = "../dubhe-framework" }
9
9
 
10
10
  [addresses]
11
11
  sui = "0x2"
@@ -1,15 +1,15 @@
1
1
  import { DubheConfig } from '@0xobelisk/sui-common';
2
2
 
3
3
  export const dubheConfig = {
4
- name: 'counter',
5
- description: 'counter contract',
6
- schemas: {
7
- value: 'StorageValue<u32>',
8
- },
9
- events: {
10
- Increment: { value: 'u32' },
11
- },
12
- errors: {
13
- InvalidIncrement: "Number can't be incremented, must be more than 0",
14
- }
4
+ name: 'counter',
5
+ description: 'counter contract',
6
+ schemas: {
7
+ value: 'StorageValue<u32>',
8
+ },
9
+ events: {
10
+ Increment: { value: 'u32' },
11
+ },
12
+ errors: {
13
+ InvalidIncrement: "Number can't be incremented, must be more than 0",
14
+ },
15
15
  } as DubheConfig;
@@ -0,0 +1,14 @@
1
+ import { dirname } from 'path';
2
+ import { fileURLToPath } from 'url';
3
+ import { FlatCompat } from '@eslint/eslintrc';
4
+
5
+ const __filename = fileURLToPath(import.meta.url);
6
+ const __dirname = dirname(__filename);
7
+
8
+ const compat = new FlatCompat({
9
+ baseDirectory: __dirname,
10
+ });
11
+
12
+ const eslintConfig = [...compat.extends('next/core-web-vitals', 'next/typescript')];
13
+
14
+ export default eslintConfig;
@@ -0,0 +1,5 @@
1
+ /** @type {import('next').NextConfig} */
2
+ const nextConfig = {
3
+ };
4
+
5
+ export default nextConfig;
@@ -1,15 +1,22 @@
1
1
  {
2
2
  "name": "dubhe-nextjs-template",
3
3
  "version": "1.0.0",
4
- "description": "Simple starter template",
4
+ "description": "Simple dubhe sui nextjs template",
5
+ "type": "module",
5
6
  "scripts": {
6
7
  "// Utility Commands": "----------------",
8
+ "lint": "next lint",
9
+ "lint:fix": "next lint --fix",
10
+ "format": "prettier --write .",
11
+ "format:check": "prettier --check .",
12
+ "type-check": "tsc --noEmit",
13
+ "validate": "pnpm lint && pnpm format:check && pnpm type-check",
7
14
  "start:localnet": "pnpm dubhe node",
8
15
  "faucet": "pnpm dubhe faucet --network",
9
16
  "deploy": "pnpm dubhe publish --network",
10
17
  "upgrade": "pnpm dubhe upgrade --network",
11
18
  "schema:gen": "pnpm dubhe schemagen",
12
- "account:gen": "pnpm dubhe generate-key",
19
+ "account:gen": "pnpm dubhe generate-key --output-ts-path ./src/chain/key.ts",
13
20
  "indexer:sqlite": "pnpm sqlite-indexer --force-regenesis --network",
14
21
  "check-balance": "pnpm dubhe check-balance --network",
15
22
  "config:store": "pnpm dubhe config-store --output-ts-path ./src/chain/config.ts --network",
@@ -30,51 +37,28 @@
30
37
  },
31
38
  "dependencies": {
32
39
  "@0xobelisk/sui-cli": "^1.1.0",
33
- "@0xobelisk/sui-client": "^1.1.1",
40
+ "@0xobelisk/sui-client": "^1.1.2",
34
41
  "@0xobelisk/sui-common": "^1.1.0",
35
42
  "@0xobelisk/sui-indexer": "^1.1.3",
36
43
  "@mysten/dapp-kit": "0.14.46",
37
- "@mysten/sui": "1.19.0",
38
- "dotenv": "^16.4.5",
39
44
  "@tanstack/react-query": "^5.17.19",
40
- "clsx": "^1.2.1",
41
- "framer-motion": "^10.12.16",
45
+ "dotenv": "^16.4.5",
42
46
  "jotai": "^1.7.2",
43
- "next": "^12.1.6",
44
- "next-i18next": "^11.0.0",
45
- "react": "18.1.0",
46
- "react-dom": "18.1.0",
47
- "react-select": "^5.4.0",
48
- "swiper": "^9.2.4",
49
- "sonner": "^1.5.0",
50
- "chalk": "^4.1.2"
47
+ "next": "^15.1.1",
48
+ "react": "^19.0.0",
49
+ "react-dom": "^19.0.0",
50
+ "sonner": "^1.5.0"
51
51
  },
52
52
  "devDependencies": {
53
- "@headlessui/react": "^1.7.15",
54
- "@heroicons/react": "^2.0.18",
55
- "@tailwindcss/aspect-ratio": "^0.4.2",
56
- "@tailwindcss/forms": "^0.5.3",
57
- "@tailwindcss/line-clamp": "^0.4.4",
58
- "@tailwindcss/typography": "^0.5.9",
59
- "@testing-library/jest-dom": "^5.16.5",
60
- "@testing-library/react": "^14.0.0",
61
- "@testing-library/user-event": "^14.4.3",
62
- "@types/jest": "^29.5.2",
63
- "@types/node": "18.16.16",
64
- "@types/react": "18.2.8",
65
- "@types/react-dom": "18.2.4",
66
- "autoprefixer": "^10.4.14",
67
- "eslint": "^8.41.0",
68
- "eslint-config-next": "13.4.4",
69
- "jest": "^29.5.0",
70
- "jest-css-modules-transform": "^4.4.2",
71
- "postcss": "^8.4.24",
72
- "prettier": "^2.8.8",
73
- "prop-types": "^15.8.1",
74
- "tailwind-scrollbar": "^2.1.0",
75
- "tailwindcss": "^3.2.4",
76
- "ts-jest": "^29.1.0",
77
- "ts-node": "^10.9.1",
78
- "typescript": "5.1.6"
53
+ "@eslint/eslintrc": "^3",
54
+ "@types/node": "^18",
55
+ "@types/react": "^18.3.3",
56
+ "@types/react-dom": "^18.3.0",
57
+ "eslint": "^9",
58
+ "eslint-config-next": "15.1.6",
59
+ "postcss": "^8",
60
+ "prettier": "^3.2.2",
61
+ "tailwindcss": "^3.4.1",
62
+ "typescript": "^5.7.2"
79
63
  }
80
64
  }