@sei-js/create-sei 0.0.3 → 1.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 (228) hide show
  1. package/.rsyncignore +13 -0
  2. package/CHANGELOG.md +12 -0
  3. package/dist/extensions/precompiles/package.json +44 -0
  4. package/dist/extensions/precompiles/src/components/default/index.tsx +201 -0
  5. package/dist/main.js +46 -78
  6. package/dist/main.test.js +34 -0
  7. package/dist/templates/next-template/.env.example +8 -0
  8. package/dist/templates/next-template/.nvmrc +1 -0
  9. package/dist/templates/next-template/biome.json +48 -0
  10. package/{templates/next-cosmos-template → dist/templates/next-template}/next-env.d.ts +1 -1
  11. package/dist/templates/next-template/package.json +44 -0
  12. package/dist/templates/next-template/postcss.config.mjs +6 -0
  13. package/dist/templates/next-template/src/app/development/page.tsx +260 -0
  14. package/dist/templates/next-template/src/app/globals.css +14 -0
  15. package/dist/templates/next-template/src/app/layout.tsx +30 -0
  16. package/dist/templates/next-template/src/app/page.tsx +10 -0
  17. package/dist/templates/next-template/src/app/resources/page.tsx +175 -0
  18. package/dist/templates/next-template/src/app/resources/resources.ts +56 -0
  19. package/dist/templates/next-template/src/components/default/examples.ts +63 -0
  20. package/dist/templates/next-template/src/components/default/index.tsx +402 -0
  21. package/dist/templates/next-template/src/components/index.ts +3 -0
  22. package/dist/templates/next-template/src/components/landing/index.tsx +107 -0
  23. package/dist/templates/next-template/src/components/providers/index.ts +1 -0
  24. package/dist/templates/next-template/src/components/providers/providers.tsx +89 -0
  25. package/dist/templates/next-template/src/components/shell/index.ts +1 -0
  26. package/dist/templates/next-template/src/components/shell/shell.tsx +87 -0
  27. package/dist/templates/next-template/tailwind.config.js +17 -0
  28. package/{templates/next-cosmos-template → dist/templates/next-template}/tsconfig.json +2 -1
  29. package/extensions/precompiles/package.json +44 -0
  30. package/extensions/precompiles/src/components/default/index.tsx +201 -0
  31. package/jest.config.js +14 -0
  32. package/package.json +10 -5
  33. package/src/main.test.ts +38 -0
  34. package/src/main.ts +51 -90
  35. package/templates/next-template/.env.example +8 -0
  36. package/templates/next-template/.nvmrc +1 -0
  37. package/templates/next-template/biome.json +48 -0
  38. package/templates/{next-wagmi-template → next-template}/next-env.d.ts +1 -1
  39. package/templates/next-template/package.json +44 -0
  40. package/templates/next-template/postcss.config.mjs +6 -0
  41. package/templates/next-template/src/app/development/page.tsx +260 -0
  42. package/templates/next-template/src/app/globals.css +14 -0
  43. package/templates/next-template/src/app/layout.tsx +30 -0
  44. package/templates/next-template/src/app/page.tsx +10 -0
  45. package/templates/next-template/src/app/resources/page.tsx +175 -0
  46. package/templates/next-template/src/app/resources/resources.ts +56 -0
  47. package/templates/next-template/src/components/default/examples.ts +63 -0
  48. package/templates/next-template/src/components/default/index.tsx +402 -0
  49. package/templates/next-template/src/components/index.ts +3 -0
  50. package/templates/next-template/src/components/landing/index.tsx +107 -0
  51. package/templates/next-template/src/components/providers/index.ts +1 -0
  52. package/templates/next-template/src/components/providers/providers.tsx +89 -0
  53. package/templates/next-template/src/components/shell/index.ts +1 -0
  54. package/templates/next-template/src/components/shell/shell.tsx +87 -0
  55. package/templates/next-template/tailwind.config.js +17 -0
  56. package/{dist/templates/next-cosmos-template → templates/next-template}/tsconfig.json +2 -1
  57. package/tsconfig.json +1 -7
  58. package/.yarn/install-state.gz +0 -0
  59. package/dist/templates/next-cosmos-template/README.md +0 -60
  60. package/dist/templates/next-cosmos-template/next-env.d.ts +0 -5
  61. package/dist/templates/next-cosmos-template/next.config.mjs +0 -14
  62. package/dist/templates/next-cosmos-template/package.json +0 -31
  63. package/dist/templates/next-cosmos-template/public/next.svg +0 -1
  64. package/dist/templates/next-cosmos-template/public/sei-logotype.svg +0 -15
  65. package/dist/templates/next-cosmos-template/public/vercel.svg +0 -1
  66. package/dist/templates/next-cosmos-template/src/app/components/Homepage/Examples.tsx +0 -168
  67. package/dist/templates/next-cosmos-template/src/app/components/Homepage/Homepage.css +0 -154
  68. package/dist/templates/next-cosmos-template/src/app/components/Homepage/Homepage.tsx +0 -83
  69. package/dist/templates/next-cosmos-template/src/app/components/WalletConnectButton/WalletConnectButton.tsx +0 -18
  70. package/dist/templates/next-cosmos-template/src/app/components/Web3Provider.tsx +0 -35
  71. package/dist/templates/next-cosmos-template/src/app/components/index.ts +0 -3
  72. package/dist/templates/next-cosmos-template/src/app/constants/chain.ts +0 -16
  73. package/dist/templates/next-cosmos-template/src/app/constants/index.ts +0 -1
  74. package/dist/templates/next-cosmos-template/src/app/index.css +0 -184
  75. package/dist/templates/next-cosmos-template/src/app/layout.tsx +0 -21
  76. package/dist/templates/next-cosmos-template/src/app/page.tsx +0 -17
  77. package/dist/templates/next-cosmos-template/yarn.lock +0 -9814
  78. package/dist/templates/next-wagmi-template/next-env.d.ts +0 -5
  79. package/dist/templates/next-wagmi-template/package.json +0 -30
  80. package/dist/templates/next-wagmi-template/public/sei-logotype.svg +0 -15
  81. package/dist/templates/next-wagmi-template/src/app/components/Homepage/Examples.tsx +0 -257
  82. package/dist/templates/next-wagmi-template/src/app/components/Homepage/Homepage.css +0 -154
  83. package/dist/templates/next-wagmi-template/src/app/components/Homepage/Homepage.tsx +0 -87
  84. package/dist/templates/next-wagmi-template/src/app/components/Web3Provider.tsx +0 -74
  85. package/dist/templates/next-wagmi-template/src/app/components/index.ts +0 -2
  86. package/dist/templates/next-wagmi-template/src/app/constants/chain.ts +0 -7
  87. package/dist/templates/next-wagmi-template/src/app/constants/index.ts +0 -1
  88. package/dist/templates/next-wagmi-template/src/app/index.css +0 -184
  89. package/dist/templates/next-wagmi-template/src/app/layout.tsx +0 -21
  90. package/dist/templates/next-wagmi-template/src/app/page.tsx +0 -21
  91. package/dist/templates/next-wagmi-template/tsconfig.json +0 -26
  92. package/dist/templates/next-wagmi-template/yarn.lock +0 -4809
  93. package/dist/templates/vite-cosmos-template/.eslintrc.cjs +0 -11
  94. package/dist/templates/vite-cosmos-template/README.md +0 -72
  95. package/dist/templates/vite-cosmos-template/favicon.ico +0 -0
  96. package/dist/templates/vite-cosmos-template/index.html +0 -16
  97. package/dist/templates/vite-cosmos-template/package.json +0 -35
  98. package/dist/templates/vite-cosmos-template/public/sei-logotype.svg +0 -15
  99. package/dist/templates/vite-cosmos-template/src/App.tsx +0 -15
  100. package/dist/templates/vite-cosmos-template/src/assets/react.svg +0 -1
  101. package/dist/templates/vite-cosmos-template/src/components/Homepage/Examples.tsx +0 -168
  102. package/dist/templates/vite-cosmos-template/src/components/Homepage/Homepage.css +0 -154
  103. package/dist/templates/vite-cosmos-template/src/components/Homepage/Homepage.tsx +0 -77
  104. package/dist/templates/vite-cosmos-template/src/components/WalletConnectButton/WalletConnectButton.tsx +0 -18
  105. package/dist/templates/vite-cosmos-template/src/components/Web3Provider.tsx +0 -41
  106. package/dist/templates/vite-cosmos-template/src/components/index.ts +0 -4
  107. package/dist/templates/vite-cosmos-template/src/constants/chain.ts +0 -16
  108. package/dist/templates/vite-cosmos-template/src/constants/index.ts +0 -1
  109. package/dist/templates/vite-cosmos-template/src/index.css +0 -184
  110. package/dist/templates/vite-cosmos-template/src/main.tsx +0 -12
  111. package/dist/templates/vite-cosmos-template/src/vite-env.d.ts +0 -1
  112. package/dist/templates/vite-cosmos-template/tsconfig.app.json +0 -25
  113. package/dist/templates/vite-cosmos-template/tsconfig.json +0 -11
  114. package/dist/templates/vite-cosmos-template/tsconfig.node.json +0 -14
  115. package/dist/templates/vite-cosmos-template/vite.config.ts +0 -7
  116. package/dist/templates/vite-cosmos-template/yarn.lock +0 -9323
  117. package/dist/templates/vite-wagmi-template/.eslintrc.cjs +0 -11
  118. package/dist/templates/vite-wagmi-template/README.md +0 -72
  119. package/dist/templates/vite-wagmi-template/favicon.ico +0 -0
  120. package/dist/templates/vite-wagmi-template/index.html +0 -12
  121. package/dist/templates/vite-wagmi-template/package.json +0 -33
  122. package/dist/templates/vite-wagmi-template/public/sei-logotype.svg +0 -15
  123. package/dist/templates/vite-wagmi-template/src/App.tsx +0 -21
  124. package/dist/templates/vite-wagmi-template/src/assets/react.svg +0 -1
  125. package/dist/templates/vite-wagmi-template/src/components/Homepage/Examples.tsx +0 -255
  126. package/dist/templates/vite-wagmi-template/src/components/Homepage/Homepage.css +0 -154
  127. package/dist/templates/vite-wagmi-template/src/components/Homepage/Homepage.tsx +0 -81
  128. package/dist/templates/vite-wagmi-template/src/components/Web3Provider.tsx +0 -72
  129. package/dist/templates/vite-wagmi-template/src/constants/chain.ts +0 -6
  130. package/dist/templates/vite-wagmi-template/src/constants/index.ts +0 -1
  131. package/dist/templates/vite-wagmi-template/src/index.css +0 -183
  132. package/dist/templates/vite-wagmi-template/src/main.tsx +0 -12
  133. package/dist/templates/vite-wagmi-template/src/vite-env.d.ts +0 -1
  134. package/dist/templates/vite-wagmi-template/tsconfig.app.json +0 -25
  135. package/dist/templates/vite-wagmi-template/tsconfig.json +0 -11
  136. package/dist/templates/vite-wagmi-template/tsconfig.node.json +0 -14
  137. package/dist/templates/vite-wagmi-template/vite.config.ts +0 -10
  138. package/dist/templates/vite-wagmi-template/yarn.lock +0 -4603
  139. package/templates/next-cosmos-template/.eslintrc.json +0 -3
  140. package/templates/next-cosmos-template/README.md +0 -60
  141. package/templates/next-cosmos-template/next.config.mjs +0 -14
  142. package/templates/next-cosmos-template/package.json +0 -31
  143. package/templates/next-cosmos-template/public/next.svg +0 -1
  144. package/templates/next-cosmos-template/public/sei-logotype.svg +0 -15
  145. package/templates/next-cosmos-template/public/vercel.svg +0 -1
  146. package/templates/next-cosmos-template/src/app/components/Homepage/Examples.tsx +0 -168
  147. package/templates/next-cosmos-template/src/app/components/Homepage/Homepage.css +0 -154
  148. package/templates/next-cosmos-template/src/app/components/Homepage/Homepage.tsx +0 -83
  149. package/templates/next-cosmos-template/src/app/components/WalletConnectButton/WalletConnectButton.tsx +0 -18
  150. package/templates/next-cosmos-template/src/app/components/Web3Provider.tsx +0 -35
  151. package/templates/next-cosmos-template/src/app/components/index.ts +0 -3
  152. package/templates/next-cosmos-template/src/app/constants/chain.ts +0 -16
  153. package/templates/next-cosmos-template/src/app/constants/index.ts +0 -1
  154. package/templates/next-cosmos-template/src/app/favicon.ico +0 -0
  155. package/templates/next-cosmos-template/src/app/index.css +0 -184
  156. package/templates/next-cosmos-template/src/app/layout.tsx +0 -21
  157. package/templates/next-cosmos-template/src/app/page.tsx +0 -17
  158. package/templates/next-cosmos-template/yarn.lock +0 -9814
  159. package/templates/next-wagmi-template/.eslintrc.json +0 -3
  160. package/templates/next-wagmi-template/package.json +0 -30
  161. package/templates/next-wagmi-template/public/sei-logotype.svg +0 -15
  162. package/templates/next-wagmi-template/src/app/components/Homepage/Examples.tsx +0 -257
  163. package/templates/next-wagmi-template/src/app/components/Homepage/Homepage.css +0 -154
  164. package/templates/next-wagmi-template/src/app/components/Homepage/Homepage.tsx +0 -87
  165. package/templates/next-wagmi-template/src/app/components/Web3Provider.tsx +0 -74
  166. package/templates/next-wagmi-template/src/app/components/index.ts +0 -2
  167. package/templates/next-wagmi-template/src/app/constants/chain.ts +0 -7
  168. package/templates/next-wagmi-template/src/app/constants/index.ts +0 -1
  169. package/templates/next-wagmi-template/src/app/favicon.ico +0 -0
  170. package/templates/next-wagmi-template/src/app/index.css +0 -184
  171. package/templates/next-wagmi-template/src/app/layout.tsx +0 -21
  172. package/templates/next-wagmi-template/src/app/page.tsx +0 -21
  173. package/templates/next-wagmi-template/tsconfig.json +0 -26
  174. package/templates/next-wagmi-template/yarn.lock +0 -4809
  175. package/templates/vite-cosmos-template/.eslintrc.cjs +0 -11
  176. package/templates/vite-cosmos-template/README.md +0 -72
  177. package/templates/vite-cosmos-template/favicon.ico +0 -0
  178. package/templates/vite-cosmos-template/index.html +0 -16
  179. package/templates/vite-cosmos-template/package.json +0 -35
  180. package/templates/vite-cosmos-template/public/sei-logotype.svg +0 -15
  181. package/templates/vite-cosmos-template/src/App.tsx +0 -15
  182. package/templates/vite-cosmos-template/src/assets/react.svg +0 -1
  183. package/templates/vite-cosmos-template/src/components/Homepage/Examples.tsx +0 -168
  184. package/templates/vite-cosmos-template/src/components/Homepage/Homepage.css +0 -154
  185. package/templates/vite-cosmos-template/src/components/Homepage/Homepage.tsx +0 -77
  186. package/templates/vite-cosmos-template/src/components/WalletConnectButton/WalletConnectButton.tsx +0 -18
  187. package/templates/vite-cosmos-template/src/components/Web3Provider.tsx +0 -41
  188. package/templates/vite-cosmos-template/src/components/index.ts +0 -4
  189. package/templates/vite-cosmos-template/src/constants/chain.ts +0 -16
  190. package/templates/vite-cosmos-template/src/constants/index.ts +0 -1
  191. package/templates/vite-cosmos-template/src/index.css +0 -184
  192. package/templates/vite-cosmos-template/src/main.tsx +0 -12
  193. package/templates/vite-cosmos-template/src/vite-env.d.ts +0 -1
  194. package/templates/vite-cosmos-template/tsconfig.app.json +0 -25
  195. package/templates/vite-cosmos-template/tsconfig.json +0 -11
  196. package/templates/vite-cosmos-template/tsconfig.node.json +0 -14
  197. package/templates/vite-cosmos-template/vite.config.ts +0 -7
  198. package/templates/vite-cosmos-template/yarn.lock +0 -9323
  199. package/templates/vite-wagmi-template/.eslintrc.cjs +0 -11
  200. package/templates/vite-wagmi-template/README.md +0 -72
  201. package/templates/vite-wagmi-template/favicon.ico +0 -0
  202. package/templates/vite-wagmi-template/index.html +0 -12
  203. package/templates/vite-wagmi-template/package.json +0 -33
  204. package/templates/vite-wagmi-template/public/sei-logotype.svg +0 -15
  205. package/templates/vite-wagmi-template/src/App.tsx +0 -21
  206. package/templates/vite-wagmi-template/src/assets/react.svg +0 -1
  207. package/templates/vite-wagmi-template/src/components/Homepage/Examples.tsx +0 -255
  208. package/templates/vite-wagmi-template/src/components/Homepage/Homepage.css +0 -154
  209. package/templates/vite-wagmi-template/src/components/Homepage/Homepage.tsx +0 -81
  210. package/templates/vite-wagmi-template/src/components/Web3Provider.tsx +0 -72
  211. package/templates/vite-wagmi-template/src/constants/chain.ts +0 -6
  212. package/templates/vite-wagmi-template/src/constants/index.ts +0 -1
  213. package/templates/vite-wagmi-template/src/index.css +0 -183
  214. package/templates/vite-wagmi-template/src/main.tsx +0 -12
  215. package/templates/vite-wagmi-template/src/vite-env.d.ts +0 -1
  216. package/templates/vite-wagmi-template/tsconfig.app.json +0 -25
  217. package/templates/vite-wagmi-template/tsconfig.json +0 -11
  218. package/templates/vite-wagmi-template/tsconfig.node.json +0 -14
  219. package/templates/vite-wagmi-template/vite.config.ts +0 -10
  220. package/templates/vite-wagmi-template/yarn.lock +0 -4603
  221. /package/dist/templates/{next-cosmos-template → next-template}/.eslintrc.json +0 -0
  222. /package/dist/templates/{next-wagmi-template → next-template}/README.md +0 -0
  223. /package/dist/templates/{next-wagmi-template → next-template}/next.config.mjs +0 -0
  224. /package/dist/templates/{next-cosmos-template/src/app → next-template/public}/favicon.ico +0 -0
  225. /package/{dist/templates/next-wagmi-template → templates/next-template}/.eslintrc.json +0 -0
  226. /package/templates/{next-wagmi-template → next-template}/README.md +0 -0
  227. /package/templates/{next-wagmi-template → next-template}/next.config.mjs +0 -0
  228. /package/{dist/templates/next-wagmi-template/src/app → templates/next-template/public}/favicon.ico +0 -0
@@ -0,0 +1,402 @@
1
+ 'use client';
2
+
3
+ import { CodeHighlight } from '@mantine/code-highlight';
4
+ import {
5
+ ActionIcon,
6
+ Alert,
7
+ Badge,
8
+ Button,
9
+ Card,
10
+ Code,
11
+ Collapse,
12
+ Container,
13
+ Flex,
14
+ Group,
15
+ Loader,
16
+ Paper,
17
+ Stack,
18
+ Text,
19
+ TextInput,
20
+ ThemeIcon,
21
+ Title,
22
+ } from '@mantine/core';
23
+ import { notifications } from '@mantine/notifications';
24
+ import { IconBulb, IconChevronDown, IconChevronUp, IconCoins, IconCopy, IconLogout, IconSend, IconWallet } from '@tabler/icons-react';
25
+ import { useState } from 'react';
26
+ import { formatEther, parseEther } from 'viem';
27
+ import { useAccount, useDisconnect, usePublicClient, useSendTransaction, useWaitForTransactionReceipt } from 'wagmi';
28
+ import { balanceCodeExample, transactionCodeExample, walletCodeExample } from './examples';
29
+
30
+ function Examples() {
31
+ const [balance, setBalance] = useState('');
32
+ const [recipient, setRecipient] = useState('');
33
+ const [amount, setAmount] = useState('');
34
+
35
+ // Code visibility toggles
36
+ const [showWalletCode, setShowWalletCode] = useState(false);
37
+ const [showBalanceCode, setShowBalanceCode] = useState(false);
38
+ const [showTransactionCode, setShowTransactionCode] = useState(false);
39
+
40
+ const publicClient = usePublicClient();
41
+ const { address, isConnected } = useAccount();
42
+ const { disconnect } = useDisconnect();
43
+
44
+ // Transaction hooks
45
+ const { data: hash, sendTransaction, isPending } = useSendTransaction();
46
+ const { isLoading: isConfirming, isSuccess: isConfirmed } = useWaitForTransactionReceipt({
47
+ hash,
48
+ });
49
+
50
+ const copyToClipboard = (text: string) => {
51
+ try {
52
+ navigator.clipboard.writeText(text).then(() => {
53
+ notifications.show({
54
+ title: 'Copied!',
55
+ message: 'Code copied to clipboard',
56
+ color: 'green',
57
+ });
58
+ });
59
+ } catch (err) {
60
+ console.error('Failed to copy text: ', err);
61
+ notifications.show({
62
+ title: 'Error',
63
+ message: 'Failed to copy to clipboard',
64
+ color: 'red',
65
+ });
66
+ }
67
+ };
68
+
69
+ const getBalanceWagmi = async () => {
70
+ if (!address || !publicClient) {
71
+ return undefined;
72
+ }
73
+ const weiBalance = await publicClient.getBalance({ address });
74
+ const seiBalance = formatEther(weiBalance);
75
+ setBalance(seiBalance);
76
+ };
77
+
78
+ const sendSei = async () => {
79
+ if (!recipient || !amount) {
80
+ notifications.show({
81
+ title: 'Missing Information',
82
+ message: 'Please enter recipient address and amount',
83
+ color: 'orange',
84
+ });
85
+ return;
86
+ }
87
+
88
+ try {
89
+ sendTransaction({
90
+ to: recipient as `0x${string}`,
91
+ value: parseEther(amount),
92
+ });
93
+ } catch (error) {
94
+ console.error('Transaction error:', error);
95
+ notifications.show({
96
+ title: 'Transaction Error',
97
+ message: 'Failed to send transaction',
98
+ color: 'red',
99
+ });
100
+ }
101
+ };
102
+
103
+ return (
104
+ <Container size="xl" py="xl" pos="relative">
105
+ <Stack gap="xl">
106
+ {/* Header */}
107
+ <div>
108
+ <Group gap="md" align="center" mb="lg">
109
+ <ThemeIcon size={48} radius="md" c="blue" variant="light">
110
+ <IconBulb size={24} />
111
+ </ThemeIcon>
112
+ <div>
113
+ <Title order={1} fw={700} c="gray.9">
114
+ Interactive Examples
115
+ </Title>
116
+ <Text size="lg" c="gray.6" mt={4}>
117
+ Common blockchain development patterns with live code examples
118
+ </Text>
119
+ </div>
120
+ </Group>
121
+ </div>
122
+
123
+ {/* Wallet Connection Info */}
124
+ <Card shadow="xs" p="lg" radius="md" withBorder>
125
+ <Stack gap="md">
126
+ <Flex justify="space-between" align="flex-start">
127
+ <Stack gap="xs">
128
+ <Group gap="md">
129
+ <ThemeIcon size={40} radius="md" color="blue" variant="light">
130
+ <IconWallet size={20} />
131
+ </ThemeIcon>
132
+ <Title order={4} fw={600} c="gray.9">
133
+ Connected Wallet
134
+ </Title>
135
+ </Group>
136
+ <Text size="sm" c="gray.6">
137
+ Access wallet information using Wagmi's useAccount hook
138
+ </Text>
139
+ </Stack>
140
+ <Badge color="blue" variant="light" size="md" radius="md">
141
+ address
142
+ </Badge>
143
+ </Flex>
144
+ <Paper p="md" radius="md" withBorder bg="gray.0">
145
+ <Text size="xs" fw={500} c="gray.6">
146
+ Wallet Address
147
+ </Text>
148
+ <Flex justify="space-between" align="center">
149
+ <Code bg="white" p="xs">
150
+ {address || 'No wallet connected'}
151
+ </Code>
152
+ {isConnected && address && (
153
+ <Group gap="xs">
154
+ <ActionIcon variant="light" color="blue" size="sm" radius="md" onClick={() => copyToClipboard(address)} aria-label="Copy address">
155
+ <IconCopy size={14} />
156
+ </ActionIcon>
157
+ <ActionIcon variant="light" color="red" size="sm" radius="md" onClick={() => disconnect()} aria-label="Disconnect wallet">
158
+ <IconLogout size={14} />
159
+ </ActionIcon>
160
+ </Group>
161
+ )}
162
+ </Flex>
163
+ </Paper>
164
+
165
+ <Group justify="space-between" align="center" mt="sm">
166
+ <Button
167
+ variant="subtle"
168
+ color="gray"
169
+ size="sm"
170
+ radius="md"
171
+ leftSection={showWalletCode ? <IconChevronUp size={14} /> : <IconChevronDown size={14} />}
172
+ onClick={() => setShowWalletCode(!showWalletCode)}
173
+ >
174
+ {showWalletCode ? 'Hide' : 'View'} Implementation
175
+ </Button>
176
+ {showWalletCode && (
177
+ <ActionIcon variant="subtle" color="gray" size="sm" radius="md" onClick={() => copyToClipboard(walletCodeExample)}>
178
+ <IconCopy size={14} />
179
+ </ActionIcon>
180
+ )}
181
+ </Group>
182
+
183
+ <Collapse in={showWalletCode}>
184
+ <Paper mt="sm" p="md" bg="gray.0" radius="md" withBorder>
185
+ <CodeHighlight code={walletCodeExample} language="tsx" withCopyButton={false} expandCodeLabel="" collapseCodeLabel="" />
186
+ </Paper>
187
+ </Collapse>
188
+ </Stack>
189
+ </Card>
190
+
191
+ <Stack gap="lg">
192
+ {/* Balance Example */}
193
+ <Card shadow="xs" p="lg" radius="md" withBorder>
194
+ <Stack gap="md">
195
+ <Flex justify="space-between" align="flex-start">
196
+ <Stack gap="xs">
197
+ <Flex align="center" gap="md">
198
+ <ThemeIcon size={40} radius="md" color="green" variant="light">
199
+ <IconCoins size={20} />
200
+ </ThemeIcon>
201
+ <Title order={3} size="h3" fw={600}>
202
+ Wallet Balance
203
+ </Title>
204
+ </Flex>
205
+ <Text size="sm" c="gray.6">
206
+ Query your wallet's SEI balance using Wagmi's usePublicClient hook
207
+ </Text>
208
+ </Stack>
209
+ <Badge color="green" variant="light" size="md" radius="md">
210
+ balance
211
+ </Badge>
212
+ </Flex>
213
+ <Paper p="md" radius="md" withBorder bg="gray.0">
214
+ <Text size="xs" fw={500} c="gray.6">
215
+ Current Balance
216
+ </Text>
217
+ <Flex justify="space-between" align="center">
218
+ <Flex align="baseline" gap="xs">
219
+ {balance ? (
220
+ <>
221
+ <Text fw={700} size="xl" c="gray.9" ff="monospace">
222
+ {Number.parseFloat(balance).toFixed(4)}
223
+ </Text>
224
+ <Text size="sm" c="gray.6" fw={500}>
225
+ SEI
226
+ </Text>
227
+ </>
228
+ ) : (
229
+ <Paper px="sm" py={4} radius="md" withBorder bg="white">
230
+ <Flex align="baseline" gap="xs">
231
+ <Text fw={700} size="xl" c="gray.5" ff="monospace">
232
+ —
233
+ </Text>
234
+ <Text size="sm" c="gray.6" fw={500}>
235
+ SEI
236
+ </Text>
237
+ </Flex>
238
+ </Paper>
239
+ )}
240
+ </Flex>
241
+ <Button
242
+ onClick={getBalanceWagmi}
243
+ disabled={!address}
244
+ size="sm"
245
+ radius="md"
246
+ variant="light"
247
+ color="green"
248
+ leftSection={<IconCoins size={14} />}
249
+ >
250
+ {balance ? 'Refresh' : 'Check Balance'}
251
+ </Button>
252
+ </Flex>
253
+ </Paper>
254
+
255
+ <Group justify="space-between" align="center" mt="sm">
256
+ <Button
257
+ variant="subtle"
258
+ color="gray"
259
+ size="sm"
260
+ radius="md"
261
+ leftSection={showBalanceCode ? <IconChevronUp size={14} /> : <IconChevronDown size={14} />}
262
+ onClick={() => setShowBalanceCode(!showBalanceCode)}
263
+ >
264
+ {showBalanceCode ? 'Hide' : 'View'} Implementation
265
+ </Button>
266
+ {showBalanceCode && (
267
+ <ActionIcon variant="subtle" color="gray" size="sm" radius="md" onClick={() => copyToClipboard(balanceCodeExample)}>
268
+ <IconCopy size={14} />
269
+ </ActionIcon>
270
+ )}
271
+ </Group>
272
+
273
+ <Collapse in={showBalanceCode}>
274
+ <Paper mt="sm" p="md" bg="gray.0" radius="md" withBorder>
275
+ <CodeHighlight code={balanceCodeExample} language="tsx" withCopyButton={false} expandCodeLabel="" collapseCodeLabel="" />
276
+ </Paper>
277
+ </Collapse>
278
+ </Stack>
279
+ </Card>
280
+
281
+ {/* Transaction Example */}
282
+ <Card shadow="xs" p="lg" radius="md" withBorder>
283
+ <Stack gap="md">
284
+ <Flex direction="row" justify="space-between" align="flex-start">
285
+ <Stack gap="xs">
286
+ <Flex direction="row" align="center" gap="md" mb="md">
287
+ <ThemeIcon size={40} radius="md" color="blue" variant="light">
288
+ <IconSend size={20} />
289
+ </ThemeIcon>
290
+ <Title order={3} size="h3" fw={600} c="gray.9">
291
+ Send Transaction
292
+ </Title>
293
+ </Flex>
294
+ <Text c="gray.6" size="sm" maw={400}>
295
+ Send SEI tokens using Wagmi's transaction hooks with real-time status
296
+ </Text>
297
+ </Stack>
298
+ <Badge color="blue" variant="light" size="md" radius="md">
299
+ transfer
300
+ </Badge>
301
+ </Flex>
302
+ <Paper p="md" radius="md" withBorder bg="gray.0">
303
+ <Flex align="flex-end" gap="sm">
304
+ <Flex flex={1} direction="column">
305
+ <Text size="xs" fw={500} c="gray.6" mb={4}>
306
+ Recipient Address
307
+ </Text>
308
+ <TextInput placeholder="0x..." value={recipient} onChange={(e) => setRecipient(e.currentTarget.value)} radius="md" size="md" />
309
+ </Flex>
310
+ <Flex w={128} direction="column">
311
+ <Text size="xs" fw={500} c="gray.6" mb={4}>
312
+ Amount
313
+ </Text>
314
+ <TextInput
315
+ placeholder="0.1"
316
+ value={amount}
317
+ onChange={(e) => setAmount(e.currentTarget.value)}
318
+ radius="md"
319
+ size="md"
320
+ rightSection={
321
+ <Text size="xs" c="gray.6" fw={500} pr="xs">
322
+ SEI
323
+ </Text>
324
+ }
325
+ />
326
+ </Flex>
327
+ <Button
328
+ onClick={sendSei}
329
+ disabled={isPending || !address || !recipient || !amount}
330
+ size="md"
331
+ radius="md"
332
+ variant="light"
333
+ color="blue"
334
+ px="sm"
335
+ >
336
+ {isPending ? <Loader size={16} /> : <IconSend size={16} />}
337
+ </Button>
338
+ </Flex>
339
+ </Paper>
340
+
341
+ {hash && (
342
+ <Alert color="blue" variant="light" radius="md" py={4}>
343
+ <Stack gap={4}>
344
+ <Text size="xs" fw={600}>
345
+ Transaction Hash
346
+ </Text>
347
+ <Code>{hash}</Code>
348
+ </Stack>
349
+ </Alert>
350
+ )}
351
+
352
+ {isConfirming && (
353
+ <Alert color="yellow" variant="light" radius="md" py={4}>
354
+ <Group gap="xs">
355
+ <Loader size={14} />
356
+ <Text size="xs" fw={500}>
357
+ Waiting for confirmation...
358
+ </Text>
359
+ </Group>
360
+ </Alert>
361
+ )}
362
+
363
+ {isConfirmed && (
364
+ <Alert color="green" variant="light" radius="md" py={4}>
365
+ <Text size="xs" fw={600}>
366
+ ✅ Transaction confirmed!
367
+ </Text>
368
+ </Alert>
369
+ )}
370
+
371
+ <Group justify="space-between" align="center" mt={8}>
372
+ <Button
373
+ variant="subtle"
374
+ color="gray"
375
+ size="sm"
376
+ radius="xl"
377
+ leftSection={showTransactionCode ? <IconChevronUp size={14} /> : <IconChevronDown size={14} />}
378
+ onClick={() => setShowTransactionCode(!showTransactionCode)}
379
+ >
380
+ {showTransactionCode ? 'Hide' : 'View'} Implementation
381
+ </Button>
382
+ {showTransactionCode && (
383
+ <ActionIcon variant="subtle" color="gray" size="sm" radius="xl" onClick={() => copyToClipboard(transactionCodeExample)}>
384
+ <IconCopy size={14} />
385
+ </ActionIcon>
386
+ )}
387
+ </Group>
388
+
389
+ <Collapse in={showTransactionCode}>
390
+ <Paper mt="sm" p="md" bg="gray.0" radius="md" withBorder>
391
+ <CodeHighlight code={transactionCodeExample} language="tsx" withCopyButton={false} expandCodeLabel="" collapseCodeLabel="" />
392
+ </Paper>
393
+ </Collapse>
394
+ </Stack>
395
+ </Card>
396
+ </Stack>
397
+ </Stack>
398
+ </Container>
399
+ );
400
+ }
401
+
402
+ export default Examples;
@@ -0,0 +1,3 @@
1
+ export { default as Default } from './default';
2
+ export { default as Landing } from './landing';
3
+ export { default as Shell } from './shell';
@@ -0,0 +1,107 @@
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 variant="light" color="blue" style={{ backgroundColor: 'rgb(239 246 255)', color: 'rgb(29 78 216)', border: '1px solid rgb(191 219 254)' }}>
25
+ Next.js 14
26
+ </Badge>
27
+ <Badge
28
+ variant="light"
29
+ color="violet"
30
+ style={{ backgroundColor: 'rgb(250 245 255)', color: 'rgb(109 40 217)', border: '1px solid rgb(196 181 253)' }}
31
+ >
32
+ Mantine UI
33
+ </Badge>
34
+ <Badge variant="light" color="cyan" style={{ backgroundColor: 'rgb(236 254 255)', color: 'rgb(14 116 144)', border: '1px solid rgb(165 243 252)' }}>
35
+ Tailwind CSS
36
+ </Badge>
37
+ <Badge variant="light" color="yellow" style={{ backgroundColor: 'rgb(254 249 195)', color: 'rgb(161 98 7)', border: '1px solid rgb(254 240 138)' }}>
38
+ Biome
39
+ </Badge>
40
+ <Badge
41
+ variant="light"
42
+ color="orange"
43
+ style={{ backgroundColor: 'rgb(255 247 237)', color: 'rgb(194 65 12)', border: '1px solid rgb(254 215 170)' }}
44
+ >
45
+ RainbowKit
46
+ </Badge>
47
+ <Badge variant="light" color="teal" style={{ backgroundColor: 'rgb(240 253 250)', color: 'rgb(15 118 110)', border: '1px solid rgb(153 246 228)' }}>
48
+ Wagmi + Viem
49
+ </Badge>
50
+ <Badge variant="light" color="dark" style={{ backgroundColor: 'rgb(249 250 251)', color: 'rgb(17 24 39)', border: '1px solid rgb(209 213 219)' }}>
51
+ Vercel
52
+ </Badge>
53
+ </Group>
54
+ </Stack>
55
+
56
+ {/* Primary Call to Action - Connect Wallet */}
57
+ <Card
58
+ withBorder
59
+ radius="xl"
60
+ p="xl"
61
+ bg="gradient-to-r from-blue-50 to-purple-50"
62
+ w="100%"
63
+ maw={600}
64
+ style={{ border: '2px solid var(--mantine-color-blue-2)' }}
65
+ >
66
+ <Stack gap="lg" align="center" ta="center">
67
+ <ThemeIcon size={64} radius="xl" color="blue" variant="light">
68
+ <IconRocket size={32} />
69
+ </ThemeIcon>
70
+ <Stack gap="sm" align="center">
71
+ <Text fw={700} size="xl" c="blue.8">
72
+ Connect Your Wallet to Get Started
73
+ </Text>
74
+ <Text size="md" c="dimmed" maw={400}>
75
+ Explore interactive examples and see real-time Sei interactions
76
+ </Text>
77
+ </Stack>
78
+ <ConnectButton />
79
+ </Stack>
80
+ </Card>
81
+
82
+ {/* Development Tip */}
83
+ <Card withBorder radius="md" p="md" bg="gray.0" maw={600}>
84
+ <Text size="xs" c="dimmed" ta="center">
85
+ 💡 <strong>Development Tip:</strong> Start by exploring the examples in the connected app, then customize{' '}
86
+ <Code>src/components/default/index.tsx</Code> to build your unique dApp features.
87
+ </Text>
88
+ </Card>
89
+
90
+ {/* Quick Links */}
91
+ <Stack gap="sm" w="100%" maw={600} mt="xl">
92
+ <Text fw={600} size="sm" ta="center" c="gray.7" mb="xs">
93
+ Quick Links
94
+ </Text>
95
+ <Group gap="md" grow>
96
+ <Button component={Link} href="/resources" variant="light" color="gray" size="sm" leftSection={<IconBook size={16} />} style={{ flex: 1 }}>
97
+ Developer Resources
98
+ </Button>
99
+ <Button component={Link} href="/development" variant="light" color="gray" size="sm" leftSection={<IconCode size={16} />} style={{ flex: 1 }}>
100
+ Continue Development
101
+ </Button>
102
+ </Group>
103
+ </Stack>
104
+ </Stack>
105
+ </Container>
106
+ );
107
+ }
@@ -0,0 +1 @@
1
+ export { default as Providers } from './providers';
@@ -0,0 +1,89 @@
1
+ 'use client';
2
+
3
+ import { MantineProvider } from '@mantine/core';
4
+ import { Notifications } from '@mantine/notifications';
5
+ import { RainbowKitProvider, connectorsForWallets, lightTheme } 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 { http, WagmiProvider, createConfig } from 'wagmi';
10
+
11
+ import '@rainbow-me/rainbowkit/styles.css';
12
+ import { sei, seiDevnet, seiTestnet } from 'viem/chains';
13
+
14
+ const queryClient = new QueryClient();
15
+
16
+ const connectors = connectorsForWallets(
17
+ [
18
+ {
19
+ groupName: 'Recommended',
20
+ wallets: [metaMaskWallet],
21
+ },
22
+ ],
23
+ {
24
+ appName: 'Sei dApp',
25
+ projectId: process.env.NEXT_PUBLIC_WALLETCONNECT_PROJECT_ID || 'your-project-id',
26
+ }
27
+ );
28
+
29
+ interface ProvidersProps {
30
+ children: ReactNode;
31
+ }
32
+
33
+ export default function Providers({ children }: ProvidersProps) {
34
+ // Chain selection via environment variable, defaults to sei mainnet
35
+ const getSelectedChain = () => {
36
+ const chainName = process.env.NEXT_PUBLIC_CHAIN || 'mainnet';
37
+ switch (chainName.toLowerCase()) {
38
+ case 'testnet':
39
+ return seiTestnet;
40
+ case 'devnet':
41
+ return seiDevnet;
42
+ default:
43
+ return sei;
44
+ }
45
+ };
46
+
47
+ const chain = getSelectedChain();
48
+
49
+ const config = useMemo(
50
+ () =>
51
+ createConfig({
52
+ chains: [chain],
53
+ connectors,
54
+ transports: {
55
+ [sei.id]: http(),
56
+ [seiTestnet.id]: http(),
57
+ [seiDevnet.id]: http(),
58
+ },
59
+ ssr: true,
60
+ }),
61
+ [chain]
62
+ );
63
+
64
+ return (
65
+ <WagmiProvider config={config}>
66
+ <QueryClientProvider client={queryClient}>
67
+ <MantineProvider defaultColorScheme="light">
68
+ <Notifications />
69
+ <RainbowKitProvider
70
+ theme={lightTheme({
71
+ accentColor: '#9E1F19',
72
+ accentColorForeground: 'white',
73
+ borderRadius: 'medium',
74
+ fontStack: 'system',
75
+ })}
76
+ appInfo={{
77
+ appName: 'Sei dApp',
78
+ learnMoreUrl: 'https://docs.sei.io/learn/wallets',
79
+ }}
80
+ modalSize="compact"
81
+ initialChain={chain.id}
82
+ >
83
+ {children}
84
+ </RainbowKitProvider>
85
+ </MantineProvider>
86
+ </QueryClientProvider>
87
+ </WagmiProvider>
88
+ );
89
+ }
@@ -0,0 +1 @@
1
+ export { default } from './shell';