@sei-js/create-sei 0.0.2 → 0.0.4

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/.yarn/install-state.gz +0 -0
  2. package/CHANGELOG.md +12 -0
  3. package/README.md +16 -25
  4. package/biome.json +8 -0
  5. package/dist/main.js +10 -60
  6. package/dist/templates/next-template/.eslintrc.json +3 -0
  7. package/dist/templates/next-template/package.json +30 -0
  8. package/dist/templates/next-template/src/app/components/Homepage/Examples.tsx +257 -0
  9. package/dist/templates/next-template/src/app/components/Homepage/Homepage.css +154 -0
  10. package/dist/templates/{next-wagmi-template → next-template}/src/app/components/Homepage/Homepage.tsx +10 -36
  11. package/{templates/next-wagmi-template → dist/templates/next-template}/src/app/components/Web3Provider.tsx +29 -28
  12. package/dist/templates/next-template/src/app/components/index.ts +2 -0
  13. package/dist/templates/{next-wagmi-template → next-template}/src/app/constants/chain.ts +2 -2
  14. package/dist/templates/next-template/src/app/constants/index.ts +1 -0
  15. package/dist/templates/next-template/src/app/index.css +184 -0
  16. package/dist/templates/next-template/src/app/layout.tsx +21 -0
  17. package/dist/templates/next-template/src/app/page.tsx +21 -0
  18. package/dist/templates/next-template/tsconfig.json +26 -0
  19. package/dist/templates/vite-template/.eslintrc.cjs +11 -0
  20. package/dist/templates/vite-template/package.json +33 -0
  21. package/dist/templates/vite-template/src/App.tsx +21 -0
  22. package/dist/templates/vite-template/src/components/Homepage/Examples.tsx +255 -0
  23. package/dist/templates/vite-template/src/components/Homepage/Homepage.css +154 -0
  24. package/dist/templates/vite-template/src/components/Homepage/Homepage.tsx +81 -0
  25. package/{templates/vite-wagmi-template → dist/templates/vite-template}/src/components/Web3Provider.tsx +29 -28
  26. package/dist/templates/{vite-wagmi-template → vite-template}/src/constants/chain.ts +1 -1
  27. package/dist/templates/vite-template/src/constants/index.ts +1 -0
  28. package/dist/templates/vite-template/src/index.css +183 -0
  29. package/dist/templates/vite-template/src/main.tsx +12 -0
  30. package/dist/templates/vite-template/tsconfig.app.json +25 -0
  31. package/dist/templates/vite-template/tsconfig.json +11 -0
  32. package/dist/templates/vite-template/tsconfig.node.json +14 -0
  33. package/dist/templates/vite-template/vite.config.ts +10 -0
  34. package/package.json +1 -1
  35. package/src/main.ts +26 -87
  36. package/templates/next-template/.eslintrc.json +3 -0
  37. package/templates/next-template/package.json +30 -0
  38. package/templates/next-template/src/app/components/Homepage/Examples.tsx +257 -0
  39. package/templates/next-template/src/app/components/Homepage/Homepage.css +154 -0
  40. package/templates/{next-wagmi-template → next-template}/src/app/components/Homepage/Homepage.tsx +10 -36
  41. package/{dist/templates/next-wagmi-template → templates/next-template}/src/app/components/Web3Provider.tsx +29 -28
  42. package/templates/next-template/src/app/components/index.ts +2 -0
  43. package/templates/{next-wagmi-template → next-template}/src/app/constants/chain.ts +2 -2
  44. package/templates/next-template/src/app/constants/index.ts +1 -0
  45. package/templates/next-template/src/app/index.css +184 -0
  46. package/templates/next-template/src/app/layout.tsx +21 -0
  47. package/templates/next-template/src/app/page.tsx +21 -0
  48. package/templates/next-template/tsconfig.json +26 -0
  49. package/templates/vite-template/.eslintrc.cjs +11 -0
  50. package/templates/vite-template/package.json +33 -0
  51. package/templates/vite-template/src/App.tsx +21 -0
  52. package/templates/vite-template/src/components/Homepage/Examples.tsx +255 -0
  53. package/templates/vite-template/src/components/Homepage/Homepage.css +154 -0
  54. package/templates/vite-template/src/components/Homepage/Homepage.tsx +81 -0
  55. package/{dist/templates/vite-wagmi-template → templates/vite-template}/src/components/Web3Provider.tsx +29 -28
  56. package/templates/{vite-wagmi-template → vite-template}/src/constants/chain.ts +1 -1
  57. package/templates/vite-template/src/constants/index.ts +1 -0
  58. package/templates/vite-template/src/index.css +183 -0
  59. package/templates/vite-template/src/main.tsx +12 -0
  60. package/templates/vite-template/tsconfig.app.json +25 -0
  61. package/templates/vite-template/tsconfig.json +11 -0
  62. package/templates/vite-template/tsconfig.node.json +14 -0
  63. package/templates/vite-template/vite.config.ts +10 -0
  64. package/tsconfig.json +18 -28
  65. package/dist/templates/next-cosmos-template/.eslintrc.json +0 -3
  66. package/dist/templates/next-cosmos-template/README.md +0 -60
  67. package/dist/templates/next-cosmos-template/next.config.mjs +0 -14
  68. package/dist/templates/next-cosmos-template/package.json +0 -31
  69. package/dist/templates/next-cosmos-template/public/next.svg +0 -1
  70. package/dist/templates/next-cosmos-template/public/vercel.svg +0 -1
  71. package/dist/templates/next-cosmos-template/src/app/components/Homepage/Examples.tsx +0 -177
  72. package/dist/templates/next-cosmos-template/src/app/components/Homepage/Homepage.css +0 -156
  73. package/dist/templates/next-cosmos-template/src/app/components/Homepage/Homepage.tsx +0 -110
  74. package/dist/templates/next-cosmos-template/src/app/components/WalletConnectButton/WalletConnectButton.tsx +0 -26
  75. package/dist/templates/next-cosmos-template/src/app/components/Web3Provider.tsx +0 -39
  76. package/dist/templates/next-cosmos-template/src/app/components/index.ts +0 -3
  77. package/dist/templates/next-cosmos-template/src/app/constants/chain.ts +0 -16
  78. package/dist/templates/next-cosmos-template/src/app/constants/index.ts +0 -1
  79. package/dist/templates/next-cosmos-template/src/app/index.css +0 -171
  80. package/dist/templates/next-cosmos-template/src/app/layout.tsx +0 -21
  81. package/dist/templates/next-cosmos-template/src/app/page.tsx +0 -17
  82. package/dist/templates/next-cosmos-template/tsconfig.json +0 -26
  83. package/dist/templates/next-cosmos-template/yarn.lock +0 -9814
  84. package/dist/templates/next-wagmi-template/.eslintrc.json +0 -3
  85. package/dist/templates/next-wagmi-template/package.json +0 -30
  86. package/dist/templates/next-wagmi-template/src/app/components/Homepage/Examples.tsx +0 -271
  87. package/dist/templates/next-wagmi-template/src/app/components/Homepage/Homepage.css +0 -156
  88. package/dist/templates/next-wagmi-template/src/app/components/index.ts +0 -2
  89. package/dist/templates/next-wagmi-template/src/app/constants/index.ts +0 -1
  90. package/dist/templates/next-wagmi-template/src/app/index.css +0 -171
  91. package/dist/templates/next-wagmi-template/src/app/layout.tsx +0 -21
  92. package/dist/templates/next-wagmi-template/src/app/page.tsx +0 -21
  93. package/dist/templates/next-wagmi-template/tsconfig.json +0 -26
  94. package/dist/templates/vite-cosmos-template/.eslintrc.cjs +0 -18
  95. package/dist/templates/vite-cosmos-template/README.md +0 -72
  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/src/App.tsx +0 -16
  99. package/dist/templates/vite-cosmos-template/src/components/Homepage/Examples.tsx +0 -177
  100. package/dist/templates/vite-cosmos-template/src/components/Homepage/Homepage.css +0 -156
  101. package/dist/templates/vite-cosmos-template/src/components/Homepage/Homepage.tsx +0 -102
  102. package/dist/templates/vite-cosmos-template/src/components/WalletConnectButton/WalletConnectButton.tsx +0 -26
  103. package/dist/templates/vite-cosmos-template/src/components/Web3Provider.tsx +0 -45
  104. package/dist/templates/vite-cosmos-template/src/components/index.ts +0 -4
  105. package/dist/templates/vite-cosmos-template/src/constants/chain.ts +0 -16
  106. package/dist/templates/vite-cosmos-template/src/constants/index.ts +0 -1
  107. package/dist/templates/vite-cosmos-template/src/index.css +0 -171
  108. package/dist/templates/vite-cosmos-template/src/main.tsx +0 -12
  109. package/dist/templates/vite-cosmos-template/tsconfig.app.json +0 -27
  110. package/dist/templates/vite-cosmos-template/tsconfig.json +0 -11
  111. package/dist/templates/vite-cosmos-template/tsconfig.node.json +0 -14
  112. package/dist/templates/vite-cosmos-template/vite.config.ts +0 -7
  113. package/dist/templates/vite-cosmos-template/yarn.lock +0 -9323
  114. package/dist/templates/vite-wagmi-template/.eslintrc.cjs +0 -18
  115. package/dist/templates/vite-wagmi-template/package.json +0 -33
  116. package/dist/templates/vite-wagmi-template/src/App.tsx +0 -22
  117. package/dist/templates/vite-wagmi-template/src/components/Homepage/Examples.tsx +0 -269
  118. package/dist/templates/vite-wagmi-template/src/components/Homepage/Homepage.css +0 -156
  119. package/dist/templates/vite-wagmi-template/src/components/Homepage/Homepage.tsx +0 -106
  120. package/dist/templates/vite-wagmi-template/src/constants/index.ts +0 -1
  121. package/dist/templates/vite-wagmi-template/src/index.css +0 -170
  122. package/dist/templates/vite-wagmi-template/src/main.tsx +0 -12
  123. package/dist/templates/vite-wagmi-template/tsconfig.app.json +0 -27
  124. package/dist/templates/vite-wagmi-template/tsconfig.json +0 -11
  125. package/dist/templates/vite-wagmi-template/tsconfig.node.json +0 -14
  126. package/dist/templates/vite-wagmi-template/vite.config.ts +0 -10
  127. package/templates/next-cosmos-template/.eslintrc.json +0 -3
  128. package/templates/next-cosmos-template/README.md +0 -60
  129. package/templates/next-cosmos-template/next-env.d.ts +0 -5
  130. package/templates/next-cosmos-template/next.config.mjs +0 -14
  131. package/templates/next-cosmos-template/package.json +0 -31
  132. package/templates/next-cosmos-template/public/next.svg +0 -1
  133. package/templates/next-cosmos-template/public/sei-logotype.svg +0 -15
  134. package/templates/next-cosmos-template/public/vercel.svg +0 -1
  135. package/templates/next-cosmos-template/src/app/components/Homepage/Examples.tsx +0 -177
  136. package/templates/next-cosmos-template/src/app/components/Homepage/Homepage.css +0 -156
  137. package/templates/next-cosmos-template/src/app/components/Homepage/Homepage.tsx +0 -110
  138. package/templates/next-cosmos-template/src/app/components/WalletConnectButton/WalletConnectButton.tsx +0 -26
  139. package/templates/next-cosmos-template/src/app/components/Web3Provider.tsx +0 -39
  140. package/templates/next-cosmos-template/src/app/components/index.ts +0 -3
  141. package/templates/next-cosmos-template/src/app/constants/chain.ts +0 -16
  142. package/templates/next-cosmos-template/src/app/constants/index.ts +0 -1
  143. package/templates/next-cosmos-template/src/app/favicon.ico +0 -0
  144. package/templates/next-cosmos-template/src/app/index.css +0 -171
  145. package/templates/next-cosmos-template/src/app/layout.tsx +0 -21
  146. package/templates/next-cosmos-template/src/app/page.tsx +0 -17
  147. package/templates/next-cosmos-template/tsconfig.json +0 -26
  148. package/templates/next-cosmos-template/yarn.lock +0 -9814
  149. package/templates/next-wagmi-template/.eslintrc.json +0 -3
  150. package/templates/next-wagmi-template/next-env.d.ts +0 -5
  151. package/templates/next-wagmi-template/package.json +0 -30
  152. package/templates/next-wagmi-template/public/sei-logotype.svg +0 -15
  153. package/templates/next-wagmi-template/src/app/components/Homepage/Examples.tsx +0 -271
  154. package/templates/next-wagmi-template/src/app/components/Homepage/Homepage.css +0 -156
  155. package/templates/next-wagmi-template/src/app/components/index.ts +0 -2
  156. package/templates/next-wagmi-template/src/app/constants/index.ts +0 -1
  157. package/templates/next-wagmi-template/src/app/favicon.ico +0 -0
  158. package/templates/next-wagmi-template/src/app/index.css +0 -171
  159. package/templates/next-wagmi-template/src/app/layout.tsx +0 -21
  160. package/templates/next-wagmi-template/src/app/page.tsx +0 -21
  161. package/templates/next-wagmi-template/tsconfig.json +0 -26
  162. package/templates/vite-cosmos-template/.eslintrc.cjs +0 -18
  163. package/templates/vite-cosmos-template/README.md +0 -72
  164. package/templates/vite-cosmos-template/favicon.ico +0 -0
  165. package/templates/vite-cosmos-template/index.html +0 -16
  166. package/templates/vite-cosmos-template/package.json +0 -35
  167. package/templates/vite-cosmos-template/public/sei-logotype.svg +0 -15
  168. package/templates/vite-cosmos-template/src/App.tsx +0 -16
  169. package/templates/vite-cosmos-template/src/assets/react.svg +0 -1
  170. package/templates/vite-cosmos-template/src/components/Homepage/Examples.tsx +0 -177
  171. package/templates/vite-cosmos-template/src/components/Homepage/Homepage.css +0 -156
  172. package/templates/vite-cosmos-template/src/components/Homepage/Homepage.tsx +0 -102
  173. package/templates/vite-cosmos-template/src/components/WalletConnectButton/WalletConnectButton.tsx +0 -26
  174. package/templates/vite-cosmos-template/src/components/Web3Provider.tsx +0 -45
  175. package/templates/vite-cosmos-template/src/components/index.ts +0 -4
  176. package/templates/vite-cosmos-template/src/constants/chain.ts +0 -16
  177. package/templates/vite-cosmos-template/src/constants/index.ts +0 -1
  178. package/templates/vite-cosmos-template/src/index.css +0 -171
  179. package/templates/vite-cosmos-template/src/main.tsx +0 -12
  180. package/templates/vite-cosmos-template/src/vite-env.d.ts +0 -1
  181. package/templates/vite-cosmos-template/tsconfig.app.json +0 -27
  182. package/templates/vite-cosmos-template/tsconfig.json +0 -11
  183. package/templates/vite-cosmos-template/tsconfig.node.json +0 -14
  184. package/templates/vite-cosmos-template/vite.config.ts +0 -7
  185. package/templates/vite-cosmos-template/yarn.lock +0 -9323
  186. package/templates/vite-wagmi-template/.eslintrc.cjs +0 -18
  187. package/templates/vite-wagmi-template/favicon.ico +0 -0
  188. package/templates/vite-wagmi-template/package.json +0 -33
  189. package/templates/vite-wagmi-template/public/sei-logotype.svg +0 -15
  190. package/templates/vite-wagmi-template/src/App.tsx +0 -22
  191. package/templates/vite-wagmi-template/src/assets/react.svg +0 -1
  192. package/templates/vite-wagmi-template/src/components/Homepage/Examples.tsx +0 -269
  193. package/templates/vite-wagmi-template/src/components/Homepage/Homepage.css +0 -156
  194. package/templates/vite-wagmi-template/src/components/Homepage/Homepage.tsx +0 -106
  195. package/templates/vite-wagmi-template/src/constants/index.ts +0 -1
  196. package/templates/vite-wagmi-template/src/index.css +0 -170
  197. package/templates/vite-wagmi-template/src/main.tsx +0 -12
  198. package/templates/vite-wagmi-template/src/vite-env.d.ts +0 -1
  199. package/templates/vite-wagmi-template/tsconfig.app.json +0 -27
  200. package/templates/vite-wagmi-template/tsconfig.json +0 -11
  201. package/templates/vite-wagmi-template/tsconfig.node.json +0 -14
  202. package/templates/vite-wagmi-template/vite.config.ts +0 -10
  203. /package/dist/templates/{next-wagmi-template → next-template}/README.md +0 -0
  204. /package/dist/templates/{next-cosmos-template → next-template}/next-env.d.ts +0 -0
  205. /package/dist/templates/{next-wagmi-template → next-template}/next.config.mjs +0 -0
  206. /package/dist/templates/{next-cosmos-template → next-template}/public/sei-logotype.svg +0 -0
  207. /package/dist/templates/{next-cosmos-template → next-template}/src/app/favicon.ico +0 -0
  208. /package/dist/templates/{next-wagmi-template → next-template}/yarn.lock +0 -0
  209. /package/dist/templates/{vite-wagmi-template → vite-template}/README.md +0 -0
  210. /package/dist/templates/{next-wagmi-template/src/app → vite-template}/favicon.ico +0 -0
  211. /package/dist/templates/{vite-wagmi-template → vite-template}/index.html +0 -0
  212. /package/dist/templates/{next-wagmi-template → vite-template}/public/sei-logotype.svg +0 -0
  213. /package/dist/templates/{vite-cosmos-template → vite-template}/src/assets/react.svg +0 -0
  214. /package/dist/templates/{vite-cosmos-template → vite-template}/src/vite-env.d.ts +0 -0
  215. /package/dist/templates/{vite-wagmi-template → vite-template}/yarn.lock +0 -0
  216. /package/templates/{next-wagmi-template → next-template}/README.md +0 -0
  217. /package/{dist/templates/next-wagmi-template → templates/next-template}/next-env.d.ts +0 -0
  218. /package/templates/{next-wagmi-template → next-template}/next.config.mjs +0 -0
  219. /package/{dist/templates/vite-cosmos-template → templates/next-template}/public/sei-logotype.svg +0 -0
  220. /package/{dist/templates/vite-cosmos-template → templates/next-template/src/app}/favicon.ico +0 -0
  221. /package/templates/{next-wagmi-template → next-template}/yarn.lock +0 -0
  222. /package/templates/{vite-wagmi-template → vite-template}/README.md +0 -0
  223. /package/{dist/templates/vite-wagmi-template → templates/vite-template}/favicon.ico +0 -0
  224. /package/templates/{vite-wagmi-template → vite-template}/index.html +0 -0
  225. /package/{dist/templates/vite-wagmi-template → templates/vite-template}/public/sei-logotype.svg +0 -0
  226. /package/{dist/templates/vite-wagmi-template → templates/vite-template}/src/assets/react.svg +0 -0
  227. /package/{dist/templates/vite-wagmi-template → templates/vite-template}/src/vite-env.d.ts +0 -0
  228. /package/templates/{vite-wagmi-template → vite-template}/yarn.lock +0 -0
@@ -0,0 +1,154 @@
1
+ #root {
2
+ display: flex;
3
+ flex-direction: column;
4
+ min-height: 100vh;
5
+ }
6
+ .app {
7
+ width: 100%;
8
+ height: 100%;
9
+ }
10
+
11
+ .logo {
12
+ width: 20%;
13
+ align-self: center;
14
+ }
15
+
16
+ .container {
17
+ margin: 0 auto;
18
+ display: flex;
19
+ flex-direction: column;
20
+ gap: 3rem;
21
+ width: 100%;
22
+ padding: 1rem;
23
+ height: -webkit-fill-available;
24
+ flex-grow: 1;
25
+ justify-content: center;
26
+ }
27
+
28
+ .grid {
29
+ width: 100%;
30
+ display: grid;
31
+ grid-template-columns: repeat(1, 1fr);
32
+ gap: 1rem;
33
+ }
34
+ .grid.docs {
35
+ grid-template-columns: repeat(1, 1fr);
36
+ }
37
+
38
+ .card {
39
+ width: 100%;
40
+ padding: 1.5em;
41
+ border-radius: 1rem;
42
+ background: var(--card);
43
+ color: var(--card-foreground);
44
+ box-shadow: 0px 4px 6px 0px rgba(0, 0, 0, 0.09);
45
+ }
46
+
47
+ .card.secondary {
48
+ background: transparent;
49
+ border: 1px solid var(--border);
50
+ box-shadow: none;
51
+ }
52
+ .card.intro {
53
+ display: flex;
54
+ flex-direction: column;
55
+ gap: 1rem;
56
+ justify-content: space-between;
57
+ align-items: flex-start;
58
+ }
59
+ .card-header {
60
+ display: flex;
61
+ flex-direction: column;
62
+ justify-content: space-between;
63
+ gap: 0.25rem;
64
+ }
65
+ .card-body {
66
+ display: flex;
67
+ flex-direction: column;
68
+ justify-content: space-between;
69
+ margin: 1.5rem 0;
70
+ }
71
+
72
+ .card-footer {
73
+ display: flex;
74
+ flex-direction: row;
75
+ gap: 0.5rem;
76
+ }
77
+
78
+ .card__title {
79
+ font-size: 1.15rem;
80
+ font-weight: 600;
81
+ }
82
+ .content-background {
83
+ overflow: hidden;
84
+ background: #fafaf9;
85
+ border-radius: 4rem;
86
+ padding: 0 1rem;
87
+ height: 3.5rem;
88
+ display: flex;
89
+ align-items: center;
90
+ }
91
+
92
+ .wallet-address {
93
+ text-wrap: anywhere;
94
+ line-break: anywhere;
95
+ }
96
+
97
+ .space-between {
98
+ justify-content: space-between;
99
+ gap: 1rem;
100
+ }
101
+
102
+ .hide-on-mobile {
103
+ display: none;
104
+ }
105
+
106
+ .hide-on-desktop {
107
+ display: block;
108
+ }
109
+
110
+ .external-link {
111
+ display: inline-flex;
112
+ gap: 0.25rem;
113
+ }
114
+
115
+ .get-started {
116
+ text-align: center;
117
+ }
118
+
119
+ .wallet-connect {
120
+ display: flex;
121
+ gap: 1rem;
122
+ align-items: center;
123
+ }
124
+
125
+ @media (min-width: 768px) {
126
+ .card.intro {
127
+ grid-column: span 2;
128
+ flex-direction: row;
129
+ align-items: center;
130
+ }
131
+ .hide-on-mobile {
132
+ display: block;
133
+ }
134
+ .hide-on-desktop {
135
+ display: none;
136
+ }
137
+
138
+ .container {
139
+ max-width: 96rem;
140
+ padding: 2rem;
141
+ }
142
+ .grid {
143
+ grid-template-columns: repeat(2, 1fr);
144
+ }
145
+ .grid.docs {
146
+ grid-template-columns: repeat(2, 1fr);
147
+ }
148
+ }
149
+
150
+ @media (min-width: 1024px) {
151
+ .container {
152
+ max-width: 80rem;
153
+ }
154
+ }
@@ -0,0 +1,81 @@
1
+ import { ConnectButton } from '@rainbow-me/rainbowkit';
2
+ import Examples from './Examples';
3
+ import './Homepage.css';
4
+
5
+ type HelpItem = {
6
+ title: string;
7
+ description: string;
8
+ link: string;
9
+ };
10
+
11
+ const renderHelpItem = ({ title, description, link }: HelpItem) => (
12
+ <div className="card secondary">
13
+ <div className="card-header">
14
+ <p className="card__title">
15
+ <a href={link} target="_blank" rel="noopener noreferrer" className="external-link">
16
+ {title} {externalIcon}
17
+ </a>
18
+ </p>
19
+ <small className="card__description">{description}</small>
20
+ </div>
21
+ </div>
22
+ );
23
+
24
+ const helpItems: HelpItem[] = [
25
+ {
26
+ title: 'Sei Docs',
27
+ description: 'Find in-depth information about Sei.',
28
+ link: 'https://docs.sei.io/'
29
+ },
30
+ {
31
+ title: 'Wagmi',
32
+ description: "Learn about Wagmi and it's hooks for chain interaction.",
33
+ link: 'https://wagmi.sh/'
34
+ },
35
+ {
36
+ title: 'Viem',
37
+ description: 'Interact with Sei using Viem modules + Wagmi.',
38
+ link: 'https://viem.sh/'
39
+ },
40
+ {
41
+ title: 'EVM JSON-RPC API',
42
+ description: 'Learn about the EVM api available on Sei.',
43
+ link: 'https://ethereum.org/en/developers/docs/apis/json-rpc/'
44
+ }
45
+ ];
46
+
47
+ const externalIcon = (
48
+ <svg width="16" height="16" viewBox="0 0 16 16" fill="none" xmlns="http://www.w3.org/2000/svg">
49
+ <path
50
+ d="M12 8.66667V12.6667C12 13.0203 11.8595 13.3594 11.6095 13.6095C11.3594 13.8595 11.0203 14 10.6667 14H3.33333C2.97971 14 2.64057 13.8595 2.39052 13.6095C2.14048 13.3594 2 13.0203 2 12.6667V5.33333C2 4.97971 2.14048 4.64057 2.39052 4.39052C2.64057 4.14048 2.97971 4 3.33333 4H7.33333"
51
+ stroke="#9F1239"
52
+ strokeWidth="1.33333"
53
+ strokeLinecap="round"
54
+ strokeLinejoin="round"
55
+ />
56
+ <path d="M10 2H14V6" stroke="#9F1239" strokeWidth="1.33333" strokeLinecap="round" strokeLinejoin="round" />
57
+ <path d="M6.66663 9.33333L14 2" stroke="#9F1239" strokeWidth="1.33333" strokeLinecap="round" strokeLinejoin="round" />
58
+ </svg>
59
+ );
60
+
61
+ function Homepage() {
62
+ return (
63
+ <div className="container">
64
+ <img src="sei-logotype.svg" className="logo" alt="SEI logotype" />
65
+ <div className="card intro">
66
+ <div className="card-header">
67
+ <p className="card__title">Wallet address</p>
68
+ <small className="card__description">Connect wallet to see your address and balance</small>
69
+ </div>
70
+ <ConnectButton />
71
+ </div>
72
+ <Examples />
73
+ <div className="get-started">
74
+ Get started by editing <code>src/App.tsx</code>
75
+ </div>
76
+ <div className="grid docs">{helpItems.map((item, _) => renderHelpItem(item))}</div>
77
+ </div>
78
+ );
79
+ }
80
+
81
+ export default Homepage;
@@ -15,18 +15,18 @@ interface Web3ProviderProps {
15
15
  }
16
16
 
17
17
  const connectors = connectorsForWallets(
18
- [
19
- {
20
- groupName: 'Recommended',
21
- wallets: [metaMaskWallet],
22
- },
23
- ],
24
- {
25
- appName: '<YOUR_APPNAME_HERE>',
26
- projectId: "<YOUR_ID_HERE>",
27
- }
28
- );
29
-
18
+ [
19
+ {
20
+ groupName: 'Recommended',
21
+ wallets: [metaMaskWallet]
22
+ }
23
+ ],
24
+ {
25
+ appName: '<YOUR_APPNAME_HERE>',
26
+ projectId: '<YOUR_ID_HERE>'
27
+ }
28
+ );
29
+
30
30
  function Web3Provider({ children }: Web3ProviderProps) {
31
31
  // Buffer polyfill
32
32
  if (typeof window !== 'undefined') {
@@ -48,22 +48,23 @@ function Web3Provider({ children }: Web3ProviderProps) {
48
48
  return (
49
49
  <WagmiProvider config={config}>
50
50
  <QueryClientProvider client={queryClient}>
51
- <RainbowKitProvider
52
- theme={lightTheme({
53
- accentColor: '#7e1914',
54
- accentColorForeground: 'white',
55
- borderRadius: 'medium',
56
- fontStack: 'system',
57
- })}
58
- appInfo={{
59
- appName: '<APP-NAME-HERE>',
60
- learnMoreUrl: 'https://www.docs.sei.io/user-guides/wallet-setup'
61
- }}
62
- modalSize='compact'
63
- initialChain={chainConfig.id}>
64
- {children}
65
- </RainbowKitProvider>
66
- </QueryClientProvider>
51
+ <RainbowKitProvider
52
+ theme={lightTheme({
53
+ accentColor: '#7e1914',
54
+ accentColorForeground: 'white',
55
+ borderRadius: 'medium',
56
+ fontStack: 'system'
57
+ })}
58
+ appInfo={{
59
+ appName: '<APP-NAME-HERE>',
60
+ learnMoreUrl: 'https://www.docs.sei.io/user-guides/wallet-setup'
61
+ }}
62
+ modalSize="compact"
63
+ initialChain={chainConfig.id}
64
+ >
65
+ {children}
66
+ </RainbowKitProvider>
67
+ </QueryClientProvider>
67
68
  </WagmiProvider>
68
69
  );
69
70
  }
@@ -3,4 +3,4 @@ import { seiDevnet } from 'viem/chains';
3
3
  // Set your selected chain here
4
4
  // To point to mainnet, use sei.
5
5
  // To point to testnet, use seiTestnet.
6
- export const selectedChain = seiDevnet
6
+ export const selectedChain = seiDevnet;
@@ -0,0 +1 @@
1
+ export * from './chain';
@@ -0,0 +1,183 @@
1
+ /*
2
+ 1. Use a more-intuitive box-sizing model.
3
+ */
4
+ *,
5
+ *::before,
6
+ *::after {
7
+ box-sizing: border-box;
8
+ }
9
+ /*
10
+ 2. Remove default margin
11
+ */
12
+ * {
13
+ margin: 0;
14
+ }
15
+ /*
16
+ Typographic tweaks!
17
+ 3. Add accessible line-height
18
+ 4. Improve text rendering
19
+ */
20
+ body {
21
+ line-height: 1.5;
22
+ -webkit-font-smoothing: antialiased;
23
+ }
24
+ /*
25
+ 5. Improve media defaults
26
+ */
27
+ img,
28
+ picture,
29
+ video,
30
+ canvas,
31
+ svg {
32
+ display: block;
33
+ max-width: 100%;
34
+ }
35
+ /*
36
+ 6. Remove built-in form typography styles
37
+ */
38
+ input,
39
+ button,
40
+ textarea,
41
+ select {
42
+ font: inherit;
43
+ }
44
+ /*
45
+ 7. Avoid text overflows
46
+ */
47
+ p,
48
+ h1,
49
+ h2,
50
+ h3,
51
+ h4,
52
+ h5,
53
+ h6 {
54
+ overflow-wrap: break-word;
55
+ line-height: 1;
56
+ }
57
+ /*
58
+ 8. Create a root stacking context
59
+ */
60
+ #root,
61
+ #__next {
62
+ isolation: isolate;
63
+ }
64
+
65
+ :root {
66
+ font-family: Inter, system-ui, Avenir, Helvetica, Arial, sans-serif;
67
+ line-height: 1.5;
68
+ font-weight: 400;
69
+
70
+ color-scheme: light dark;
71
+ color: #000;
72
+ background: var(--background);
73
+
74
+ font-synthesis: none;
75
+ text-rendering: optimizeLegibility;
76
+ -webkit-font-smoothing: antialiased;
77
+ -moz-osx-font-smoothing: grayscale;
78
+
79
+ --primary-color: #9f1239;
80
+ --primary-color-hover: #7f0a2e;
81
+ --background: linear-gradient(180deg, #f5f5f4 0%, #fff 100%);
82
+ --border: #d6d3d1;
83
+ --card: #fff;
84
+ --card-foreground: #242424;
85
+ }
86
+
87
+ a {
88
+ font-weight: 500;
89
+ color: var(--primary-color);
90
+ text-decoration: inherit;
91
+ }
92
+ a:hover {
93
+ color: var(--primary-color-hover);
94
+ }
95
+
96
+ body {
97
+ margin: 0;
98
+ padding: 0;
99
+ }
100
+
101
+ h1 {
102
+ font-size: 3.2em;
103
+ line-height: 1;
104
+ }
105
+ code {
106
+ font-family: source-code-pro, Menlo, Monaco, Consolas, "Courier New", monospace;
107
+ display: inline-flex;
108
+ border-radius: 4px;
109
+ padding: 0.1rem 0.4rem;
110
+ background-color: #d7cccc;
111
+ color: var(--card-foreground);
112
+ }
113
+
114
+ button {
115
+ border-radius: 4rem;
116
+ border: 1px solid transparent;
117
+ padding: 0.6em 1.2em;
118
+ font-size: 1em;
119
+ font-weight: 500;
120
+ font-family: inherit;
121
+ background-color: #cec9c1;
122
+ cursor: pointer;
123
+ transition: all 0.25s ease;
124
+ color: black;
125
+ }
126
+ button:hover {
127
+ background-color: #b5afa7;
128
+ }
129
+
130
+ button:disabled {
131
+ filter: grayscale(1) opacity(0.5);
132
+ color: rgb(56, 55, 55);
133
+ pointer-events: none;
134
+ }
135
+
136
+ button.primary {
137
+ background-color: var(--primary-color);
138
+ }
139
+ button.outline {
140
+ background-color: transparent;
141
+ border: 1px solid var(--border);
142
+ }
143
+
144
+ button.primary:hover {
145
+ background-color: var(--primary-color-hover);
146
+ }
147
+
148
+ button.secondary {
149
+ background-color: #000;
150
+ color: black;
151
+ }
152
+
153
+ button.secondary:hover {
154
+ background-color: #2b2b2b;
155
+ }
156
+
157
+ button:active {
158
+ transform: translateY(1px);
159
+ }
160
+
161
+ button.small {
162
+ padding: 0.4em 0.8em;
163
+ font-size: 0.8em;
164
+ }
165
+
166
+ button:focus-visible {
167
+ outline: 4px auto -webkit-focus-ring-color;
168
+ outline-offset: 4px;
169
+ }
170
+
171
+ .header {
172
+ width: 100%;
173
+ height: 4rem;
174
+ padding: 0 1%;
175
+ display: flex;
176
+ align-items: center;
177
+ justify-content: right;
178
+ background-color: transparent;
179
+ border-bottom: 1px solid var(--border);
180
+ position: sticky;
181
+ top: 0;
182
+ background: #f5f5f4;
183
+ }
@@ -0,0 +1,12 @@
1
+ import React from 'react';
2
+ import ReactDOM from 'react-dom/client';
3
+ import App from './App.tsx';
4
+ import Web3Provider from './components/Web3Provider.tsx';
5
+
6
+ ReactDOM.createRoot(document.getElementById('root')!).render(
7
+ <React.StrictMode>
8
+ <Web3Provider>
9
+ <App />
10
+ </Web3Provider>
11
+ </React.StrictMode>
12
+ );
@@ -0,0 +1,25 @@
1
+ {
2
+ "compilerOptions": {
3
+ "composite": true,
4
+ "tsBuildInfoFile": "./node_modules/.tmp/tsconfig.app.tsbuildinfo",
5
+ "target": "ES2020",
6
+ "useDefineForClassFields": true,
7
+ "lib": ["ES2020", "DOM", "DOM.Iterable"],
8
+ "module": "ESNext",
9
+ "skipLibCheck": true,
10
+
11
+ "moduleResolution": "bundler",
12
+ "allowImportingTsExtensions": true,
13
+ "resolveJsonModule": true,
14
+ "isolatedModules": true,
15
+ "moduleDetection": "force",
16
+ "noEmit": true,
17
+ "jsx": "react-jsx",
18
+
19
+ "strict": true,
20
+ "noUnusedLocals": true,
21
+ "noUnusedParameters": true,
22
+ "noFallthroughCasesInSwitch": true
23
+ },
24
+ "include": ["src"]
25
+ }
@@ -0,0 +1,11 @@
1
+ {
2
+ "files": [],
3
+ "references": [
4
+ {
5
+ "path": "./tsconfig.app.json"
6
+ },
7
+ {
8
+ "path": "./tsconfig.node.json"
9
+ }
10
+ ]
11
+ }
@@ -0,0 +1,14 @@
1
+ {
2
+ "compilerOptions": {
3
+ "composite": true,
4
+ "tsBuildInfoFile": "./node_modules/.tmp/tsconfig.node.tsbuildinfo",
5
+ "skipLibCheck": true,
6
+ "module": "ESNext",
7
+ "moduleResolution": "bundler",
8
+ "allowSyntheticDefaultImports": true,
9
+ "allowImportingTsExtensions": true,
10
+ "strict": true,
11
+ "noEmit": true
12
+ },
13
+ "include": ["vite.config.ts"]
14
+ }
@@ -0,0 +1,10 @@
1
+ import { defineConfig } from 'vite';
2
+ import react from '@vitejs/plugin-react';
3
+
4
+ // https://vitejs.dev/config/
5
+ export default defineConfig({
6
+ plugins: [react()],
7
+ optimizeDeps: {
8
+ exclude: ['js-big-decimal']
9
+ }
10
+ });
package/tsconfig.json CHANGED
@@ -1,29 +1,19 @@
1
1
  {
2
- "extends": "../../tsconfig.base.json",
3
- "exclude": [
4
- "node_modules",
5
- "dist",
6
- "test"
7
- ],
8
- "compilerOptions": {
9
- "outDir": "./dist",
10
- "target": "ES2020",
11
- "useDefineForClassFields": true,
12
- "lib": [
13
- "ES2020",
14
- "DOM",
15
- "DOM.Iterable"
16
- ],
17
- "module": "ESNext",
18
- "skipLibCheck": true,
19
- "isolatedModules": true,
20
- "jsx": "react-jsx",
21
- "strict": true,
22
- "noUnusedLocals": true,
23
- "noUnusedParameters": true,
24
- "noFallthroughCasesInSwitch": true
25
- },
26
- "include": [
27
- "src",
28
- ],
29
- }
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
+ }
@@ -1,3 +0,0 @@
1
- {
2
- "extends": "next/core-web-vitals"
3
- }
@@ -1,60 +0,0 @@
1
- # Next-Cosmos Sei App Template
2
-
3
- This repo provides a basic framework for an application that interacts with Sei via Cosmos endpoints.
4
-
5
- ## Getting Started
6
-
7
- Install dependencies by running
8
- ```bash
9
- npm install
10
- #or
11
- yarn
12
- ```
13
-
14
- Then, run the development server:
15
-
16
- ```bash
17
- npm run dev
18
- # or
19
- yarn dev
20
- ```
21
-
22
- Open [http://localhost:3000](http://localhost:3000) with your browser to see the result.
23
-
24
- You can start editing the page by modifying `src/app/page.tsx`. The page auto-updates as you edit the file.
25
-
26
- ## Repository Basics
27
- This repository includes basic features that allow you to connect to a wallet and use the wallet to interact with the chain.
28
-
29
- Additionally, basic examples and links to documentation are provided on the example homepage in `src/app/components/Homepage`.
30
-
31
- ### Web3 Provider
32
- This component is a Sei specific wrapper around CosmosKit Provider that should wrap the application. Wrapping the application in this provider will enable it to access hooks in CosmosKit. These hooks are enable connection to a wallet and interaction with the chain.
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
- ### Wallet Connect Button
37
- This component provides an interface to connect your wallet to the application. It utilizies CosmosKit's hooks and modal.
38
-
39
- To customize the wallet connect button or connection logic, you can modify the `src/app/components/WalletConnectButton.tsx` component.
40
-
41
- ### Changing the Chain
42
- This application connects to the arctic-1 devnet by default
43
-
44
- To change the chain the app connects to, edit the `selectedChain` variable in the `chain.ts` file in `src/app/constants`
45
-
46
- ## Learn More
47
-
48
- ### Next.js
49
- To learn more about Next.js, take a look at the following resources:
50
-
51
- - [Next.js Documentation](https://nextjs.org/docs) - learn about Next.js features and API.
52
- - [Learn Next.js](https://nextjs.org/learn) - an interactive Next.js tutorial.
53
-
54
- You can check out [the Next.js GitHub repository](https://github.com/vercel/next.js/) - your feedback and contributions are welcome!
55
-
56
- ## Deploy on Vercel
57
-
58
- 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.
59
-
60
- Check out our [Next.js deployment documentation](https://nextjs.org/docs/deployment) for more details.