@sei-js/create-sei 1.0.1 → 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 (68) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +5 -4
  3. package/dist/extensions/precompiles/src/components/default/index.tsx +44 -51
  4. package/dist/main.js +112 -34
  5. package/dist/templates/next-template/.env.example +1 -1
  6. package/dist/templates/next-template/README.md +55 -27
  7. package/dist/templates/next-template/biome.json +3 -4
  8. package/dist/templates/next-template/gitignore +41 -0
  9. package/dist/templates/next-template/next.config.mjs +9 -6
  10. package/dist/templates/next-template/package.json +36 -27
  11. package/dist/templates/next-template/public/brand/powered-by-sei-light.png +0 -0
  12. package/dist/templates/next-template/public/brand/sei-lockup-light.svg +7 -0
  13. package/dist/templates/next-template/public/brand/sei-mark.png +0 -0
  14. package/dist/templates/next-template/src/app/development/page.tsx +29 -30
  15. package/dist/templates/next-template/src/app/favicon.ico/route.ts +3 -0
  16. package/dist/templates/next-template/src/app/globals.css +40 -3
  17. package/dist/templates/next-template/src/app/layout.tsx +14 -13
  18. package/dist/templates/next-template/src/app/page.tsx +3 -3
  19. package/dist/templates/next-template/src/app/resources/page.tsx +34 -51
  20. package/dist/templates/next-template/src/app/resources/resources.ts +19 -32
  21. package/dist/templates/next-template/src/components/default/examples.ts +4 -7
  22. package/dist/templates/next-template/src/components/default/index.tsx +46 -46
  23. package/dist/templates/next-template/src/components/index.ts +3 -3
  24. package/dist/templates/next-template/src/components/landing/index.tsx +19 -97
  25. package/dist/templates/next-template/src/components/providers/index.ts +1 -1
  26. package/dist/templates/next-template/src/components/providers/providers.tsx +19 -25
  27. package/dist/templates/next-template/src/components/shell/index.ts +1 -1
  28. package/dist/templates/next-template/src/components/shell/shell.tsx +14 -7
  29. package/dist/templates/next-template/src/theme.ts +1 -0
  30. package/package.json +20 -9
  31. package/.rsyncignore +0 -11
  32. package/CHANGELOG.md +0 -131
  33. package/biome.json +0 -8
  34. package/dist/extensions/precompiles/package.json +0 -44
  35. package/dist/main.test.js +0 -34
  36. package/dist/templates/next-template/public/favicon.ico +0 -0
  37. package/extensions/precompiles/package.json +0 -44
  38. package/extensions/precompiles/src/components/default/index.tsx +0 -201
  39. package/jest.config.js +0 -14
  40. package/src/main.test.ts +0 -38
  41. package/src/main.ts +0 -159
  42. package/templates/next-template/.env.example +0 -8
  43. package/templates/next-template/.eslintrc.json +0 -1
  44. package/templates/next-template/.nvmrc +0 -1
  45. package/templates/next-template/README.md +0 -54
  46. package/templates/next-template/biome.json +0 -56
  47. package/templates/next-template/next-env.d.ts +0 -5
  48. package/templates/next-template/next.config.mjs +0 -17
  49. package/templates/next-template/package.json +0 -46
  50. package/templates/next-template/postcss.config.mjs +0 -6
  51. package/templates/next-template/public/favicon.ico +0 -0
  52. package/templates/next-template/src/app/development/page.tsx +0 -260
  53. package/templates/next-template/src/app/globals.css +0 -16
  54. package/templates/next-template/src/app/layout.tsx +0 -30
  55. package/templates/next-template/src/app/page.tsx +0 -10
  56. package/templates/next-template/src/app/resources/page.tsx +0 -175
  57. package/templates/next-template/src/app/resources/resources.ts +0 -56
  58. package/templates/next-template/src/components/default/examples.ts +0 -63
  59. package/templates/next-template/src/components/default/index.tsx +0 -402
  60. package/templates/next-template/src/components/index.ts +0 -3
  61. package/templates/next-template/src/components/landing/index.tsx +0 -155
  62. package/templates/next-template/src/components/providers/index.ts +0 -1
  63. package/templates/next-template/src/components/providers/providers.tsx +0 -108
  64. package/templates/next-template/src/components/shell/index.ts +0 -1
  65. package/templates/next-template/src/components/shell/shell.tsx +0 -88
  66. package/templates/next-template/tailwind.config.js +0 -5
  67. package/templates/next-template/tsconfig.json +0 -27
  68. package/tsconfig.json +0 -19
@@ -1,54 +0,0 @@
1
- This is a [Next.js](https://nextjs.org/) project bootstrapped with [`create-next-app`](https://github.com/vercel/next.js/tree/canary/packages/create-next-app).
2
-
3
- ## Getting Started
4
-
5
- Install dependencies by running
6
- ```bash
7
- bun install
8
- ```
9
-
10
- Then, run the development server:
11
-
12
- ```bash
13
- bun run dev
14
- ```
15
-
16
- Open [http://localhost:3000](http://localhost:3000) with your browser to see the result.
17
-
18
- You can start editing the page by modifying `src/app/page.tsx`. The page auto-updates as you edit the file.
19
-
20
- This project uses [`next/font`](https://nextjs.org/docs/basic-features/font-optimization) to automatically optimize and load Inter, a custom Google Font.
21
-
22
- ## Repository Basics
23
- This repository includes basic features that allow you to connect to a wallet and use the wallet to interact with the chain.
24
-
25
- Additionally, basic examples and links to documentation are provided on the example homepage in `src/app/components/Homepage`.
26
-
27
- This repository uses helper methods from [@sei-js/evm/viem](https://github.com/sei-protocol/sei-js/tree/main/packages/evm/src/viem)
28
-
29
- ### Web3 Provider
30
- This component is a Sei specific wrapper around a Wagmi Provider that should wrap the application. Wrapping the application in this provider will enable it to access hooks in Wagmi. These hooks are enable connection to a wallet and interaction with the chain.
31
-
32
- In addition, this app uses [RainbowKit](https://www.rainbowkit.com/docs/wallet-button) which provides wallet connect functionality out of the box.
33
-
34
- To change the list of supported wallets, as well as connection configurations you can modify the `src/app/components/Web3Provider.tsx` component.
35
-
36
- ### Changing the Chain
37
- This application connects to the arctic-1 devnet by default, using chain configurations uploaded to viem.
38
-
39
- To change the chain the app connects to, edit the `selectedChain` variable in the `chain.ts` file in `src/app/constants`
40
-
41
- ## Learn More
42
-
43
- To learn more about Next.js, take a look at the following resources:
44
-
45
- - [Next.js Documentation](https://nextjs.org/docs) - learn about Next.js features and API.
46
- - [Learn Next.js](https://nextjs.org/learn) - an interactive Next.js tutorial.
47
-
48
- You can check out [the Next.js GitHub repository](https://github.com/vercel/next.js/) - your feedback and contributions are welcome!
49
-
50
- ## Deploy on Vercel
51
-
52
- The easiest way to deploy your Next.js app is to use the [Vercel Platform](https://vercel.com/new?utm_medium=default-template&filter=next.js&utm_source=create-next-app&utm_campaign=create-next-app-readme) from the creators of Next.js.
53
-
54
- Check out our [Next.js deployment documentation](https://nextjs.org/docs/deployment) for more details.
@@ -1,56 +0,0 @@
1
- {
2
- "$schema": "https://biomejs.dev/schemas/2.4.5/schema.json",
3
- "root": true,
4
- "assist": {
5
- "actions": {
6
- "source": {
7
- "organizeImports": "on"
8
- }
9
- }
10
- },
11
- "linter": {
12
- "enabled": true,
13
- "rules": {
14
- "recommended": true,
15
- "style": {
16
- "noNonNullAssertion": "off"
17
- },
18
- "suspicious": {
19
- "noExplicitAny": "off"
20
- }
21
- }
22
- },
23
- "formatter": {
24
- "enabled": true,
25
- "formatWithErrors": false,
26
- "indentStyle": "tab",
27
- "lineEnding": "lf",
28
- "lineWidth": 160
29
- },
30
- "javascript": {
31
- "formatter": {
32
- "jsxQuoteStyle": "double",
33
- "quoteProperties": "asNeeded",
34
- "trailingCommas": "es5",
35
- "semicolons": "always",
36
- "arrowParentheses": "always",
37
- "bracketSpacing": true,
38
- "bracketSameLine": false,
39
- "quoteStyle": "double"
40
- }
41
- },
42
- "css": {
43
- "parser": {
44
- "tailwindDirectives": true
45
- }
46
- },
47
- "json": {
48
- "formatter": {
49
- "trailingCommas": "none"
50
- }
51
- },
52
- "files": {
53
- "includes": ["src/**/*.ts", "src/**/*.tsx", "src/**/*.css", "*.json", "*.md"],
54
- "ignore": ["node_modules/**", "dist/**", ".next/**", ".yarn/**"]
55
- }
56
- }
@@ -1,5 +0,0 @@
1
- /// <reference types="next" />
2
- /// <reference types="next/image-types/global" />
3
-
4
- // NOTE: This file should not be edited
5
- // see https://nextjs.org/docs/app/api-reference/config/typescript for more information.
@@ -1,17 +0,0 @@
1
- /** @type {import('next').NextConfig} */
2
- const nextConfig = {
3
- eslint: {
4
- // Linting is handled by Biome — skip ESLint during builds.
5
- ignoreDuringBuilds: true,
6
- },
7
- images: {
8
- remotePatterns: [
9
- {
10
- protocol: "https",
11
- hostname: "cdn.sei.io",
12
- },
13
- ],
14
- },
15
- };
16
-
17
- export default nextConfig;
@@ -1,46 +0,0 @@
1
- {
2
- "name": "template-next-create-sei-app",
3
- "version": "0.1.0",
4
- "private": true,
5
- "scripts": {
6
- "dev": "next dev",
7
- "prebuild": "biome check .",
8
- "build": "next build",
9
- "start": "next start",
10
- "lint": "biome lint .",
11
- "lint:fix": "biome lint --write .",
12
- "format": "biome format --write .",
13
- "format:check": "biome format .",
14
- "check": "biome check .",
15
- "check:fix": "biome check --write .",
16
- "deploy": "vercel --prod"
17
- },
18
- "dependencies": {
19
- "@mantine/code-highlight": "^8.2.5",
20
- "@mantine/core": "^8.2.5",
21
- "@mantine/hooks": "^8.2.5",
22
- "@mantine/notifications": "^8.2.5",
23
- "@rainbow-me/rainbowkit": "^2.2.8",
24
- "@sei-js/precompiles": "^2.1.2",
25
- "@tabler/icons-react": "^3.34.1",
26
- "@tailwindcss/postcss": "^4.1.12",
27
- "@tanstack/react-query": "^5.85.3",
28
- "ethers": "^6.15.0",
29
- "next": "15.4.7",
30
- "pino-pretty": "^13.1.1",
31
- "postcss": "^8.4.45",
32
- "react": "^19.1.1",
33
- "react-dom": "^19.1.1",
34
- "tailwindcss": "^4.1.12",
35
- "viem": "^2.34.0",
36
- "wagmi": "^2.16.4"
37
- },
38
- "devDependencies": {
39
- "@biomejs/biome": "^2.4.5",
40
- "@types/node": "^24.3.0",
41
- "@types/react": "^19.1.10",
42
- "@types/react-dom": "^19.1.7",
43
- "autoprefixer": "^10.4.21",
44
- "typescript": "^5.9.2"
45
- }
46
- }
@@ -1,6 +0,0 @@
1
- const config = {
2
- plugins: {
3
- "@tailwindcss/postcss": {},
4
- },
5
- };
6
- export default config;
@@ -1,260 +0,0 @@
1
- 'use client';
2
-
3
- import { Shell } from '@/components';
4
- import { Button, Card, Code, Container, Group, Paper, Stack, Text, ThemeIcon, Title } from '@mantine/core';
5
- import { IconCode, IconExternalLink } from '@tabler/icons-react';
6
-
7
- export default function DevelopmentPage() {
8
- return (
9
- <Shell>
10
- <Container size="lg" py="xl">
11
- <Stack gap="xl">
12
- {/* Header */}
13
- <div>
14
- <Group gap="md" align="center" mb="lg">
15
- <ThemeIcon size={48} radius="md" c="purple" variant="light">
16
- <IconCode size={24} />
17
- </ThemeIcon>
18
- <div>
19
- <Title order={1} fw={700} c="gray.9">
20
- Continue Development
21
- </Title>
22
- <Text size="lg" c="gray.6" mt={4}>
23
- Build amazing dApps with the tools you already have
24
- </Text>
25
- </div>
26
- </Group>
27
- </div>
28
-
29
- {/* Development Stack Section */}
30
- <Card shadow="sm" padding="xl" radius="lg" withBorder>
31
- <Stack gap="lg">
32
- <Title order={2} size="h3" fw={600} c="gray.8">
33
- 🔧 Your Development Stack
34
- </Title>
35
- <Text c="gray.7">This template comes pre-configured with powerful tools for blockchain development:</Text>
36
- <Stack gap="sm">
37
- <Paper
38
- p="md"
39
- radius="md"
40
- bg="blue.0"
41
- withBorder
42
- component="a"
43
- href="https://wagmi.sh/react/getting-started"
44
- target="_blank"
45
- style={{ textDecoration: 'none', cursor: 'pointer' }}
46
- >
47
- <Group gap="sm" justify="space-between">
48
- <Group gap="sm">
49
- <Text fw={600} c="blue.8">
50
- Wagmi:
51
- </Text>
52
- <Text c="gray.7">React hooks for Ethereum - useAccount, useBalance, useSendTransaction, useContract</Text>
53
- </Group>
54
- <IconExternalLink size={16} color="var(--mantine-color-blue-8)" />
55
- </Group>
56
- </Paper>
57
- <Paper
58
- p="md"
59
- radius="md"
60
- bg="green.0"
61
- withBorder
62
- component="a"
63
- href="https://viem.sh/"
64
- target="_blank"
65
- style={{ textDecoration: 'none', cursor: 'pointer' }}
66
- >
67
- <Group gap="sm" justify="space-between">
68
- <Group gap="sm">
69
- <Text fw={600} c="green.8">
70
- Viem:
71
- </Text>
72
- <Text c="gray.7">TypeScript interface for Ethereum - formatEther, parseEther, contract interactions</Text>
73
- </Group>
74
- <IconExternalLink size={16} color="var(--mantine-color-green-8)" />
75
- </Group>
76
- </Paper>
77
- <Paper
78
- p="md"
79
- radius="md"
80
- bg="orange.0"
81
- withBorder
82
- component="a"
83
- href="https://www.rainbowkit.com/docs/introduction"
84
- target="_blank"
85
- style={{ textDecoration: 'none', cursor: 'pointer' }}
86
- >
87
- <Group gap="sm" justify="space-between">
88
- <Group gap="sm">
89
- <Text fw={600} c="orange.8">
90
- RainbowKit:
91
- </Text>
92
- <Text c="gray.7">Beautiful wallet connection UI with support for 100+ wallets</Text>
93
- </Group>
94
- <IconExternalLink size={16} color="var(--mantine-color-orange-8)" />
95
- </Group>
96
- </Paper>
97
- </Stack>
98
- </Stack>
99
- </Card>
100
-
101
- {/* Environment Variables Section */}
102
- <Card shadow="sm" padding="xl" radius="lg" withBorder>
103
- <Stack gap="lg">
104
- <Title order={2} size="h3" fw={600} c="gray.8">
105
- ⚙️ Network Configuration
106
- </Title>
107
- <Text c="gray.7">Control which Sei network your app connects to using environment variables:</Text>
108
- <Paper p="md" radius="md" bg="gray.0" withBorder>
109
- <Code block>
110
- {`# .env.local
111
- NEXT_PUBLIC_CHAIN=mainnet # Default: Sei Pacific-1
112
- # NEXT_PUBLIC_CHAIN=testnet # Sei Atlantic-2
113
- # NEXT_PUBLIC_CHAIN=devnet # Sei Devnet`}
114
- </Code>
115
- </Paper>
116
- <Text size="sm" c="gray.6">
117
- The chain selection logic is in <Code>src/components/providers/providers.tsx</Code>
118
- </Text>
119
- </Stack>
120
- </Card>
121
-
122
- {/* Custom Chain Section */}
123
- <Card shadow="sm" padding="xl" radius="lg" withBorder>
124
- <Stack gap="lg">
125
- <Title order={2} size="h3" fw={600} c="gray.8">
126
- 🔗 Custom Chain Configuration
127
- </Title>
128
- <Text c="gray.7">Need to connect to a custom Sei network or local development chain? Modify the chain configuration in the providers file:</Text>
129
- <Paper p="md" radius="md" bg="gray.0" withBorder>
130
- <Code block>
131
- {`// src/components/providers/providers.tsx
132
- import { defineChain } from 'viem'
133
-
134
- const customSeiChain = defineChain({
135
- id: 1234, // Your chain ID
136
- name: 'Custom Sei',
137
- nativeCurrency: { name: 'SEI', symbol: 'SEI', decimals: 18 },
138
- rpcUrls: {
139
- default: { http: ['http://localhost:8545'] }
140
- },
141
- blockExplorers: {
142
- default: { name: 'Explorer', url: 'https://explorer.example.com' }
143
- }
144
- })`}
145
- </Code>
146
- </Paper>
147
- </Stack>
148
- </Card>
149
-
150
- {/* Next Steps Section */}
151
- <Card shadow="sm" padding="xl" radius="lg" withBorder>
152
- <Stack gap="lg">
153
- <Title order={2} size="h3" fw={600} c="gray.8">
154
- 🚀 What's Next?
155
- </Title>
156
- <Text c="gray.7">You're all set to build! Here are some ideas to get you started:</Text>
157
- <Stack gap="sm">
158
- <Group gap="sm">
159
- <Text fw={600} c="purple.7">
160
- •
161
- </Text>
162
- <Text c="gray.7">
163
- Create smart contract interactions using <Code>useWriteContract</Code>
164
- </Text>
165
- </Group>
166
- <Group gap="sm">
167
- <Text fw={600} c="purple.7">
168
- •
169
- </Text>
170
- <Text c="gray.7">
171
- Build token swaps with <Code>useSimulateContract</Code> and <Code>useWaitForTransactionReceipt</Code>
172
- </Text>
173
- </Group>
174
- <Group gap="sm">
175
- <Text fw={600} c="purple.7">
176
- •
177
- </Text>
178
- <Text c="gray.7">
179
- Add ENS support with <Code>useEnsName</Code> and <Code>useEnsAvatar</Code>
180
- </Text>
181
- </Group>
182
- <Group gap="sm">
183
- <Text fw={600} c="purple.7">
184
- •
185
- </Text>
186
- <Text c="gray.7">Implement multi-chain support by extending the chain configuration</Text>
187
- </Group>
188
- <Group gap="sm">
189
- <Text fw={600} c="purple.7">
190
- •
191
- </Text>
192
- <Text c="gray.7">Add more Sei precompiles for advanced blockchain interactions</Text>
193
- </Group>
194
- </Stack>
195
- </Stack>
196
- </Card>
197
-
198
- {/* Resources Section */}
199
- <Card shadow="sm" padding="xl" radius="lg" withBorder>
200
- <Stack gap="lg">
201
- <Title order={2} size="h3" fw={600} c="gray.8">
202
- 📚 Resources & Documentation
203
- </Title>
204
- <Group gap="md" wrap="wrap">
205
- <Button
206
- component="a"
207
- href="https://wagmi.sh/react/getting-started"
208
- target="_blank"
209
- variant="light"
210
- c="blue"
211
- size="sm"
212
- radius="md"
213
- leftSection={<IconExternalLink size={14} />}
214
- >
215
- Wagmi Docs
216
- </Button>
217
- <Button
218
- component="a"
219
- href="https://viem.sh/"
220
- target="_blank"
221
- variant="light"
222
- c="green"
223
- size="sm"
224
- radius="md"
225
- leftSection={<IconExternalLink size={14} />}
226
- >
227
- Viem Docs
228
- </Button>
229
- <Button
230
- component="a"
231
- href="https://docs.sei.io/"
232
- target="_blank"
233
- variant="light"
234
- c="orange"
235
- size="sm"
236
- radius="md"
237
- leftSection={<IconExternalLink size={14} />}
238
- >
239
- Sei Docs
240
- </Button>
241
- <Button
242
- component="a"
243
- href="https://www.rainbowkit.com/docs/introduction"
244
- target="_blank"
245
- variant="light"
246
- c="purple"
247
- size="sm"
248
- radius="md"
249
- leftSection={<IconExternalLink size={14} />}
250
- >
251
- RainbowKit
252
- </Button>
253
- </Group>
254
- </Stack>
255
- </Card>
256
- </Stack>
257
- </Container>
258
- </Shell>
259
- );
260
- }
@@ -1,16 +0,0 @@
1
- @import "tailwindcss";
2
-
3
- @theme {
4
- --color-sei-red: #9e1f19;
5
- --color-sei-dark: #1a1a1a;
6
- }
7
-
8
- @layer base {
9
- html {
10
- @apply h-full;
11
- }
12
-
13
- body {
14
- @apply h-full bg-gray-50 text-gray-900 antialiased;
15
- }
16
- }
@@ -1,30 +0,0 @@
1
- import { Providers } from '@/components/providers';
2
- import { ColorSchemeScript } from '@mantine/core';
3
- import type { Metadata } from 'next';
4
- import { Inter } from 'next/font/google';
5
- import type { ReactNode } from 'react';
6
-
7
- import './globals.css';
8
- import '@mantine/core/styles.css';
9
- import '@mantine/notifications/styles.css';
10
-
11
- const inter = Inter({ subsets: ['latin'] });
12
-
13
- export const metadata: Metadata = {
14
- title: 'Sei Next App (Wagmi)',
15
- description: 'Generated by create sei app',
16
- };
17
-
18
- export default function RootLayout({ children }: Readonly<{ children: ReactNode }>) {
19
- return (
20
- <html lang="en" data-mantine-color-scheme="light">
21
- <head>
22
- <title>Sei Next App (Wagmi)</title>
23
- <ColorSchemeScript defaultColorScheme="light" />
24
- </head>
25
- <body className={inter.className}>
26
- <Providers>{children}</Providers>
27
- </body>
28
- </html>
29
- );
30
- }
@@ -1,10 +0,0 @@
1
- 'use client';
2
-
3
- import { Default, Landing, Shell } from '@/components';
4
- import { useAccount } from 'wagmi';
5
-
6
- export default function Home() {
7
- const { isConnected } = useAccount();
8
-
9
- return <Shell>{isConnected ? <Default /> : <Landing />}</Shell>;
10
- }