@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.
- package/LICENSE +21 -0
- package/README.md +5 -4
- package/dist/extensions/precompiles/src/components/default/index.tsx +44 -51
- package/dist/main.js +112 -34
- package/dist/templates/next-template/.env.example +1 -1
- package/dist/templates/next-template/README.md +55 -27
- package/dist/templates/next-template/biome.json +3 -4
- package/dist/templates/next-template/gitignore +41 -0
- package/dist/templates/next-template/next.config.mjs +9 -6
- package/dist/templates/next-template/package.json +36 -27
- package/dist/templates/next-template/public/brand/powered-by-sei-light.png +0 -0
- package/dist/templates/next-template/public/brand/sei-lockup-light.svg +7 -0
- package/dist/templates/next-template/public/brand/sei-mark.png +0 -0
- package/dist/templates/next-template/src/app/development/page.tsx +29 -30
- package/dist/templates/next-template/src/app/favicon.ico/route.ts +3 -0
- package/dist/templates/next-template/src/app/globals.css +40 -3
- package/dist/templates/next-template/src/app/layout.tsx +14 -13
- package/dist/templates/next-template/src/app/page.tsx +3 -3
- package/dist/templates/next-template/src/app/resources/page.tsx +34 -51
- package/dist/templates/next-template/src/app/resources/resources.ts +19 -32
- package/dist/templates/next-template/src/components/default/examples.ts +4 -7
- package/dist/templates/next-template/src/components/default/index.tsx +46 -46
- package/dist/templates/next-template/src/components/index.ts +3 -3
- package/dist/templates/next-template/src/components/landing/index.tsx +19 -97
- package/dist/templates/next-template/src/components/providers/index.ts +1 -1
- package/dist/templates/next-template/src/components/providers/providers.tsx +19 -25
- package/dist/templates/next-template/src/components/shell/index.ts +1 -1
- package/dist/templates/next-template/src/components/shell/shell.tsx +14 -7
- package/dist/templates/next-template/src/theme.ts +1 -0
- package/package.json +20 -9
- package/.rsyncignore +0 -11
- package/CHANGELOG.md +0 -131
- package/biome.json +0 -8
- package/dist/extensions/precompiles/package.json +0 -44
- package/dist/main.test.js +0 -34
- package/dist/templates/next-template/public/favicon.ico +0 -0
- package/extensions/precompiles/package.json +0 -44
- package/extensions/precompiles/src/components/default/index.tsx +0 -201
- package/jest.config.js +0 -14
- package/src/main.test.ts +0 -38
- package/src/main.ts +0 -159
- package/templates/next-template/.env.example +0 -8
- package/templates/next-template/.eslintrc.json +0 -1
- package/templates/next-template/.nvmrc +0 -1
- package/templates/next-template/README.md +0 -54
- package/templates/next-template/biome.json +0 -56
- package/templates/next-template/next-env.d.ts +0 -5
- package/templates/next-template/next.config.mjs +0 -17
- package/templates/next-template/package.json +0 -46
- package/templates/next-template/postcss.config.mjs +0 -6
- package/templates/next-template/public/favicon.ico +0 -0
- package/templates/next-template/src/app/development/page.tsx +0 -260
- package/templates/next-template/src/app/globals.css +0 -16
- package/templates/next-template/src/app/layout.tsx +0 -30
- package/templates/next-template/src/app/page.tsx +0 -10
- package/templates/next-template/src/app/resources/page.tsx +0 -175
- package/templates/next-template/src/app/resources/resources.ts +0 -56
- package/templates/next-template/src/components/default/examples.ts +0 -63
- package/templates/next-template/src/components/default/index.tsx +0 -402
- package/templates/next-template/src/components/index.ts +0 -3
- package/templates/next-template/src/components/landing/index.tsx +0 -155
- package/templates/next-template/src/components/providers/index.ts +0 -1
- package/templates/next-template/src/components/providers/providers.tsx +0 -108
- package/templates/next-template/src/components/shell/index.ts +0 -1
- package/templates/next-template/src/components/shell/shell.tsx +0 -88
- package/templates/next-template/tailwind.config.js +0 -5
- package/templates/next-template/tsconfig.json +0 -27
- package/tsconfig.json +0 -19
|
@@ -1,155 +0,0 @@
|
|
|
1
|
-
'use client';
|
|
2
|
-
|
|
3
|
-
import { Badge, Button, Card, Code, Container, Group, Stack, Text, ThemeIcon, Title } from '@mantine/core';
|
|
4
|
-
import { ConnectButton } from '@rainbow-me/rainbowkit';
|
|
5
|
-
import { IconBook, IconCode, IconRocket } from '@tabler/icons-react';
|
|
6
|
-
import Link from 'next/link';
|
|
7
|
-
|
|
8
|
-
export default function Landing() {
|
|
9
|
-
return (
|
|
10
|
-
<Container size="md" py="xl">
|
|
11
|
-
<Stack gap="xl" align="center">
|
|
12
|
-
{/* Hero Section */}
|
|
13
|
-
<Stack gap="md" align="center" ta="center">
|
|
14
|
-
<Title order={1} size="h1" fw={700} c="gray.9">
|
|
15
|
-
Welcome to Your Sei dApp
|
|
16
|
-
</Title>
|
|
17
|
-
<Text size="lg" c="dimmed" maw={600}>
|
|
18
|
-
A production-ready starter template built with Next.js, Mantine UI, RainbowKit, Tailwind CSS, and Wagmi with easy deployment to Vercel. Everything
|
|
19
|
-
you need to build and run production-grade dApps on Sei.
|
|
20
|
-
</Text>
|
|
21
|
-
|
|
22
|
-
{/* Tech Stack Badges */}
|
|
23
|
-
<Group gap="xs" mt="sm">
|
|
24
|
-
<Badge
|
|
25
|
-
variant="light"
|
|
26
|
-
color="blue"
|
|
27
|
-
style={{
|
|
28
|
-
backgroundColor: 'rgb(239 246 255)',
|
|
29
|
-
color: 'rgb(29 78 216)',
|
|
30
|
-
border: '1px solid rgb(191 219 254)',
|
|
31
|
-
}}
|
|
32
|
-
>
|
|
33
|
-
Next.js 14
|
|
34
|
-
</Badge>
|
|
35
|
-
<Badge
|
|
36
|
-
variant="light"
|
|
37
|
-
color="violet"
|
|
38
|
-
style={{
|
|
39
|
-
backgroundColor: 'rgb(250 245 255)',
|
|
40
|
-
color: 'rgb(109 40 217)',
|
|
41
|
-
border: '1px solid rgb(196 181 253)',
|
|
42
|
-
}}
|
|
43
|
-
>
|
|
44
|
-
Mantine UI
|
|
45
|
-
</Badge>
|
|
46
|
-
<Badge
|
|
47
|
-
variant="light"
|
|
48
|
-
color="cyan"
|
|
49
|
-
style={{
|
|
50
|
-
backgroundColor: 'rgb(236 254 255)',
|
|
51
|
-
color: 'rgb(14 116 144)',
|
|
52
|
-
border: '1px solid rgb(165 243 252)',
|
|
53
|
-
}}
|
|
54
|
-
>
|
|
55
|
-
Tailwind CSS
|
|
56
|
-
</Badge>
|
|
57
|
-
<Badge
|
|
58
|
-
variant="light"
|
|
59
|
-
color="yellow"
|
|
60
|
-
style={{
|
|
61
|
-
backgroundColor: 'rgb(254 249 195)',
|
|
62
|
-
color: 'rgb(161 98 7)',
|
|
63
|
-
border: '1px solid rgb(254 240 138)',
|
|
64
|
-
}}
|
|
65
|
-
>
|
|
66
|
-
Biome
|
|
67
|
-
</Badge>
|
|
68
|
-
<Badge
|
|
69
|
-
variant="light"
|
|
70
|
-
color="orange"
|
|
71
|
-
style={{
|
|
72
|
-
backgroundColor: 'rgb(255 247 237)',
|
|
73
|
-
color: 'rgb(194 65 12)',
|
|
74
|
-
border: '1px solid rgb(254 215 170)',
|
|
75
|
-
}}
|
|
76
|
-
>
|
|
77
|
-
RainbowKit
|
|
78
|
-
</Badge>
|
|
79
|
-
<Badge
|
|
80
|
-
variant="light"
|
|
81
|
-
color="teal"
|
|
82
|
-
style={{
|
|
83
|
-
backgroundColor: 'rgb(240 253 250)',
|
|
84
|
-
color: 'rgb(15 118 110)',
|
|
85
|
-
border: '1px solid rgb(153 246 228)',
|
|
86
|
-
}}
|
|
87
|
-
>
|
|
88
|
-
Wagmi + Viem
|
|
89
|
-
</Badge>
|
|
90
|
-
<Badge
|
|
91
|
-
variant="light"
|
|
92
|
-
color="dark"
|
|
93
|
-
style={{
|
|
94
|
-
backgroundColor: 'rgb(249 250 251)',
|
|
95
|
-
color: 'rgb(17 24 39)',
|
|
96
|
-
border: '1px solid rgb(209 213 219)',
|
|
97
|
-
}}
|
|
98
|
-
>
|
|
99
|
-
Vercel
|
|
100
|
-
</Badge>
|
|
101
|
-
</Group>
|
|
102
|
-
</Stack>
|
|
103
|
-
|
|
104
|
-
{/* Primary Call to Action - Connect Wallet */}
|
|
105
|
-
<Card
|
|
106
|
-
withBorder
|
|
107
|
-
radius="xl"
|
|
108
|
-
p="xl"
|
|
109
|
-
bg="gradient-to-r from-blue-50 to-purple-50"
|
|
110
|
-
w="100%"
|
|
111
|
-
maw={600}
|
|
112
|
-
style={{ border: '2px solid var(--mantine-color-blue-2)' }}
|
|
113
|
-
>
|
|
114
|
-
<Stack gap="lg" align="center" ta="center">
|
|
115
|
-
<ThemeIcon size={64} radius="xl" color="blue" variant="light">
|
|
116
|
-
<IconRocket size={32} />
|
|
117
|
-
</ThemeIcon>
|
|
118
|
-
<Stack gap="sm" align="center">
|
|
119
|
-
<Text fw={700} size="xl" c="blue.8">
|
|
120
|
-
Connect Your Wallet to Get Started
|
|
121
|
-
</Text>
|
|
122
|
-
<Text size="md" c="dimmed" maw={400}>
|
|
123
|
-
Explore interactive examples and see real-time Sei interactions
|
|
124
|
-
</Text>
|
|
125
|
-
</Stack>
|
|
126
|
-
<ConnectButton />
|
|
127
|
-
</Stack>
|
|
128
|
-
</Card>
|
|
129
|
-
|
|
130
|
-
{/* Development Tip */}
|
|
131
|
-
<Card withBorder radius="md" p="md" bg="gray.0" maw={600}>
|
|
132
|
-
<Text size="xs" c="dimmed" ta="center">
|
|
133
|
-
💡 <strong>Development Tip:</strong> Start by exploring the examples in the connected app, then customize{' '}
|
|
134
|
-
<Code>src/components/default/index.tsx</Code> to build your unique dApp features.
|
|
135
|
-
</Text>
|
|
136
|
-
</Card>
|
|
137
|
-
|
|
138
|
-
{/* Quick Links */}
|
|
139
|
-
<Stack gap="sm" w="100%" maw={600} mt="xl">
|
|
140
|
-
<Text fw={600} size="sm" ta="center" c="gray.7" mb="xs">
|
|
141
|
-
Quick Links
|
|
142
|
-
</Text>
|
|
143
|
-
<Group gap="md" grow>
|
|
144
|
-
<Button component={Link} href="/resources" variant="light" color="gray" size="sm" leftSection={<IconBook size={16} />} style={{ flex: 1 }}>
|
|
145
|
-
Developer Resources
|
|
146
|
-
</Button>
|
|
147
|
-
<Button component={Link} href="/development" variant="light" color="gray" size="sm" leftSection={<IconCode size={16} />} style={{ flex: 1 }}>
|
|
148
|
-
Continue Development
|
|
149
|
-
</Button>
|
|
150
|
-
</Group>
|
|
151
|
-
</Stack>
|
|
152
|
-
</Stack>
|
|
153
|
-
</Container>
|
|
154
|
-
);
|
|
155
|
-
}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export { default as Providers } from './providers';
|
|
@@ -1,108 +0,0 @@
|
|
|
1
|
-
"use client";
|
|
2
|
-
|
|
3
|
-
import { MantineProvider } from "@mantine/core";
|
|
4
|
-
import { Notifications } from "@mantine/notifications";
|
|
5
|
-
import { connectorsForWallets, lightTheme, RainbowKitProvider } from "@rainbow-me/rainbowkit";
|
|
6
|
-
import { metaMaskWallet } from "@rainbow-me/rainbowkit/wallets";
|
|
7
|
-
import { QueryClient, QueryClientProvider } from "@tanstack/react-query";
|
|
8
|
-
import { type ReactNode, useMemo } from "react";
|
|
9
|
-
import { createConfig, http, WagmiProvider } from "wagmi";
|
|
10
|
-
|
|
11
|
-
import "@rainbow-me/rainbowkit/styles.css";
|
|
12
|
-
import { defineChain } from "viem";
|
|
13
|
-
import { sei, seiTestnet } from "viem/chains";
|
|
14
|
-
|
|
15
|
-
const seiDevnet = defineChain({
|
|
16
|
-
id: 713715,
|
|
17
|
-
name: "Sei Devnet",
|
|
18
|
-
nativeCurrency: { name: "Sei", symbol: "SEI", decimals: 18 },
|
|
19
|
-
rpcUrls: {
|
|
20
|
-
default: {
|
|
21
|
-
http: ["https://evm-rpc-arctic-1.sei-apis.com"],
|
|
22
|
-
},
|
|
23
|
-
},
|
|
24
|
-
blockExplorers: {
|
|
25
|
-
default: {
|
|
26
|
-
name: "Seitrace",
|
|
27
|
-
url: "https://seitrace.com",
|
|
28
|
-
},
|
|
29
|
-
},
|
|
30
|
-
testnet: true,
|
|
31
|
-
});
|
|
32
|
-
|
|
33
|
-
const queryClient = new QueryClient();
|
|
34
|
-
|
|
35
|
-
const connectors = connectorsForWallets(
|
|
36
|
-
[
|
|
37
|
-
{
|
|
38
|
-
groupName: "Recommended",
|
|
39
|
-
wallets: [metaMaskWallet],
|
|
40
|
-
},
|
|
41
|
-
],
|
|
42
|
-
{
|
|
43
|
-
appName: "Sei dApp",
|
|
44
|
-
projectId: process.env.NEXT_PUBLIC_WALLETCONNECT_PROJECT_ID || "your-project-id",
|
|
45
|
-
}
|
|
46
|
-
);
|
|
47
|
-
|
|
48
|
-
interface ProvidersProps {
|
|
49
|
-
children: ReactNode;
|
|
50
|
-
}
|
|
51
|
-
|
|
52
|
-
export default function Providers({ children }: ProvidersProps) {
|
|
53
|
-
// Chain selection via environment variable, defaults to sei mainnet
|
|
54
|
-
const getSelectedChain = () => {
|
|
55
|
-
const chainName = process.env.NEXT_PUBLIC_CHAIN || "mainnet";
|
|
56
|
-
switch (chainName.toLowerCase()) {
|
|
57
|
-
case "testnet":
|
|
58
|
-
return seiTestnet;
|
|
59
|
-
case "devnet":
|
|
60
|
-
return seiDevnet;
|
|
61
|
-
default:
|
|
62
|
-
return sei;
|
|
63
|
-
}
|
|
64
|
-
};
|
|
65
|
-
|
|
66
|
-
const chain = getSelectedChain();
|
|
67
|
-
|
|
68
|
-
const config = useMemo(
|
|
69
|
-
() =>
|
|
70
|
-
createConfig({
|
|
71
|
-
chains: [chain],
|
|
72
|
-
connectors,
|
|
73
|
-
transports: {
|
|
74
|
-
[sei.id]: http(),
|
|
75
|
-
[seiTestnet.id]: http(),
|
|
76
|
-
[seiDevnet.id]: http(),
|
|
77
|
-
},
|
|
78
|
-
ssr: true,
|
|
79
|
-
}),
|
|
80
|
-
[chain]
|
|
81
|
-
);
|
|
82
|
-
|
|
83
|
-
return (
|
|
84
|
-
<WagmiProvider config={config}>
|
|
85
|
-
<QueryClientProvider client={queryClient}>
|
|
86
|
-
<MantineProvider defaultColorScheme="light">
|
|
87
|
-
<Notifications />
|
|
88
|
-
<RainbowKitProvider
|
|
89
|
-
theme={lightTheme({
|
|
90
|
-
accentColor: "#9E1F19",
|
|
91
|
-
accentColorForeground: "white",
|
|
92
|
-
borderRadius: "medium",
|
|
93
|
-
fontStack: "system",
|
|
94
|
-
})}
|
|
95
|
-
appInfo={{
|
|
96
|
-
appName: "Sei dApp",
|
|
97
|
-
learnMoreUrl: "https://docs.sei.io/learn/wallets",
|
|
98
|
-
}}
|
|
99
|
-
modalSize="compact"
|
|
100
|
-
initialChain={chain.id}
|
|
101
|
-
>
|
|
102
|
-
{children}
|
|
103
|
-
</RainbowKitProvider>
|
|
104
|
-
</MantineProvider>
|
|
105
|
-
</QueryClientProvider>
|
|
106
|
-
</WagmiProvider>
|
|
107
|
-
);
|
|
108
|
-
}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export { default } from './shell';
|
|
@@ -1,88 +0,0 @@
|
|
|
1
|
-
"use client";
|
|
2
|
-
|
|
3
|
-
import { ActionIcon, AppShell, Container, Group } from "@mantine/core";
|
|
4
|
-
import { ConnectButton } from "@rainbow-me/rainbowkit";
|
|
5
|
-
import { IconBook, IconCode, IconLogout } from "@tabler/icons-react";
|
|
6
|
-
import Image from "next/image";
|
|
7
|
-
import Link from "next/link";
|
|
8
|
-
import type { PropsWithChildren } from "react";
|
|
9
|
-
import { useAccount, useDisconnect } from "wagmi";
|
|
10
|
-
|
|
11
|
-
export default function Shell({ children }: PropsWithChildren) {
|
|
12
|
-
const { address, isConnected } = useAccount();
|
|
13
|
-
const { disconnect } = useDisconnect();
|
|
14
|
-
|
|
15
|
-
return (
|
|
16
|
-
<AppShell header={{ height: 64 }} padding="md">
|
|
17
|
-
<AppShell.Header>
|
|
18
|
-
<Container size="xl" h="100%">
|
|
19
|
-
<Group justify="space-between" align="center" h="100%">
|
|
20
|
-
<Link href="/" aria-label="Sei">
|
|
21
|
-
<Image src="https://cdn.sei.io/assets/sei-icon.svg" alt="Sei" width={28} height={28} style={{ display: "block" }} />
|
|
22
|
-
</Link>
|
|
23
|
-
<Group align="center" gap="md">
|
|
24
|
-
<ActionIcon
|
|
25
|
-
component={Link}
|
|
26
|
-
href="/resources"
|
|
27
|
-
variant="light"
|
|
28
|
-
c="gray"
|
|
29
|
-
size="lg"
|
|
30
|
-
radius="md"
|
|
31
|
-
aria-label="View Resources"
|
|
32
|
-
style={{
|
|
33
|
-
transition: "all 0.2s ease",
|
|
34
|
-
"&:hover": {
|
|
35
|
-
transform: "translateY(-1px)",
|
|
36
|
-
boxShadow: "0 4px 12px rgba(0, 0, 0, 0.1)",
|
|
37
|
-
},
|
|
38
|
-
}}
|
|
39
|
-
>
|
|
40
|
-
<IconBook size={18} />
|
|
41
|
-
</ActionIcon>
|
|
42
|
-
<ActionIcon
|
|
43
|
-
component={Link}
|
|
44
|
-
href="/development"
|
|
45
|
-
variant="light"
|
|
46
|
-
c="gray"
|
|
47
|
-
size="lg"
|
|
48
|
-
radius="md"
|
|
49
|
-
aria-label="View Development Guide"
|
|
50
|
-
style={{
|
|
51
|
-
transition: "all 0.2s ease",
|
|
52
|
-
"&:hover": {
|
|
53
|
-
transform: "translateY(-1px)",
|
|
54
|
-
boxShadow: "0 4px 12px rgba(0, 0, 0, 0.1)",
|
|
55
|
-
},
|
|
56
|
-
}}
|
|
57
|
-
>
|
|
58
|
-
<IconCode size={18} />
|
|
59
|
-
</ActionIcon>
|
|
60
|
-
{isConnected && address ? (
|
|
61
|
-
<ActionIcon
|
|
62
|
-
variant="light"
|
|
63
|
-
c="red"
|
|
64
|
-
size="lg"
|
|
65
|
-
radius="md"
|
|
66
|
-
onClick={() => disconnect()}
|
|
67
|
-
aria-label="Disconnect Wallet"
|
|
68
|
-
style={{
|
|
69
|
-
transition: "all 0.2s ease",
|
|
70
|
-
"&:hover": {
|
|
71
|
-
transform: "translateY(-1px)",
|
|
72
|
-
boxShadow: "0 4px 12px rgba(0, 0, 0, 0.1)",
|
|
73
|
-
},
|
|
74
|
-
}}
|
|
75
|
-
>
|
|
76
|
-
<IconLogout size={18} />
|
|
77
|
-
</ActionIcon>
|
|
78
|
-
) : (
|
|
79
|
-
<ConnectButton showBalance={{ smallScreen: false, largeScreen: true }} />
|
|
80
|
-
)}
|
|
81
|
-
</Group>
|
|
82
|
-
</Group>
|
|
83
|
-
</Container>
|
|
84
|
-
</AppShell.Header>
|
|
85
|
-
<AppShell.Main>{children}</AppShell.Main>
|
|
86
|
-
</AppShell>
|
|
87
|
-
);
|
|
88
|
-
}
|
|
@@ -1,27 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"compilerOptions": {
|
|
3
|
-
"lib": ["dom", "dom.iterable", "esnext"],
|
|
4
|
-
"allowJs": true,
|
|
5
|
-
"skipLibCheck": true,
|
|
6
|
-
"strict": true,
|
|
7
|
-
"noEmit": true,
|
|
8
|
-
"esModuleInterop": true,
|
|
9
|
-
"module": "esnext",
|
|
10
|
-
"moduleResolution": "bundler",
|
|
11
|
-
"resolveJsonModule": true,
|
|
12
|
-
"isolatedModules": true,
|
|
13
|
-
"jsx": "preserve",
|
|
14
|
-
"incremental": true,
|
|
15
|
-
"plugins": [
|
|
16
|
-
{
|
|
17
|
-
"name": "next"
|
|
18
|
-
}
|
|
19
|
-
],
|
|
20
|
-
"paths": {
|
|
21
|
-
"@/*": ["./src/*"]
|
|
22
|
-
},
|
|
23
|
-
"target": "ES2017"
|
|
24
|
-
},
|
|
25
|
-
"include": ["next-env.d.ts", "**/*.ts", "**/*.tsx", ".next/types/**/*.ts"],
|
|
26
|
-
"exclude": ["node_modules"]
|
|
27
|
-
}
|
package/tsconfig.json
DELETED
|
@@ -1,19 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"extends": "../../tsconfig.base.json",
|
|
3
|
-
"exclude": ["node_modules", "dist", "test"],
|
|
4
|
-
"compilerOptions": {
|
|
5
|
-
"outDir": "./dist",
|
|
6
|
-
"target": "ES2020",
|
|
7
|
-
"useDefineForClassFields": true,
|
|
8
|
-
"lib": ["ES2020", "DOM", "DOM.Iterable"],
|
|
9
|
-
"module": "ESNext",
|
|
10
|
-
"skipLibCheck": true,
|
|
11
|
-
"isolatedModules": true,
|
|
12
|
-
"jsx": "react-jsx",
|
|
13
|
-
"strict": true,
|
|
14
|
-
"noUnusedLocals": true,
|
|
15
|
-
"noUnusedParameters": true,
|
|
16
|
-
"noFallthroughCasesInSwitch": true
|
|
17
|
-
},
|
|
18
|
-
"include": ["src"]
|
|
19
|
-
}
|