@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
@@ -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/basic-features/typescript for more information.
@@ -1,30 +0,0 @@
1
- {
2
- "name": "template-next-wagmi-sei-app",
3
- "version": "0.1.0",
4
- "private": true,
5
- "scripts": {
6
- "dev": "next dev",
7
- "build": "next build",
8
- "start": "next start",
9
- "lint": "next lint"
10
- },
11
- "dependencies": {
12
- "@rainbow-me/rainbowkit": "^2.1.2",
13
- "@sei-js/evm": "^1.2.0",
14
- "@tanstack/react-query": "^5.45.1",
15
- "encoding": "^0.1.13",
16
- "next": "14.2.4",
17
- "pino-pretty": "^11.2.1",
18
- "react": "^18",
19
- "react-dom": "^18",
20
- "viem": "^2.15.1",
21
- "wagmi": "^2.10.2"
22
- },
23
- "devDependencies": {
24
- "@types/node": "^20",
25
- "@types/react": "^18",
26
- "@types/react-dom": "^18",
27
- "eslint-config-next": "14.2.4",
28
- "typescript": "^5"
29
- }
30
- }
@@ -1,15 +0,0 @@
1
- <svg width="86" height="32" viewBox="0 0 86 32" fill="none" xmlns="http://www.w3.org/2000/svg">
2
- <g id="sei-logotype" clip-path="url(#clip0_1_53)">
3
- <path id="Vector" fill-rule="evenodd" clip-rule="evenodd" d="M15.8553 31.8727C20.5775 31.8727 24.8201 29.8188 27.7383 26.5556C26.3808 25.3758 24.3351 25.3041 22.8899 26.4702L22.6138 26.693C19.9677 28.8281 16.1121 28.5128 13.8481 25.9762C12.6133 24.5927 10.4986 24.4514 9.09076 25.6584L5.90753 28.3874C8.63393 30.5685 12.0923 31.8727 15.8553 31.8727ZM21.0223 24.1558C23.5427 22.1221 27.0852 22.195 29.5092 24.1592C30.9581 21.7586 31.7917 18.9448 31.7917 15.9363C31.7917 12.5934 30.7624 9.49098 29.0035 6.9285C27.8696 6.68701 26.6405 6.96905 25.7075 7.79581L25.442 8.03112C22.8973 10.2861 19.0312 10.1491 16.6526 7.71961C15.3553 6.39459 13.2362 6.35106 11.8856 7.62174L8.1813 11.1067L6.1435 8.94069L9.84784 5.45571C12.3779 3.07544 16.3473 3.15694 18.7775 5.63906C20.0473 6.936 22.1112 7.00916 23.4696 5.80535L23.7351 5.57004C24.5597 4.83932 25.5138 4.3467 26.5127 4.08762C23.6893 1.54648 19.9529 0 15.8553 0C7.76541 0 1.08344 6.02803 0.0559658 13.8374C2.51319 12.6583 5.54417 13.112 7.5477 15.1637C8.81252 16.4589 10.8491 16.5956 12.2757 15.4811L14.3469 13.863C16.9498 11.8295 20.6294 11.9279 23.1199 14.0978L27.1522 17.6109L25.1986 19.8531L21.1663 16.34C19.7502 15.1062 17.6579 15.0502 16.1777 16.2066L14.1066 17.8246C11.4855 19.8723 7.74378 19.6211 5.41997 17.2414C4.06868 15.8577 1.85863 15.8094 0.448196 17.1329L0 17.5534C0.335417 20.8819 1.69509 23.9081 3.75904 26.3121L7.15509 23.4006C9.79233 21.1396 13.7538 21.4042 16.0669 23.9959C17.2755 25.3501 19.3337 25.5184 20.7463 24.3786L21.0223 24.1558Z" fill="url(#paint0_linear_1_53)"/>
4
- <path id="Union" fill-rule="evenodd" clip-rule="evenodd" d="M85.5173 2.22307C85.5173 3.44217 84.5132 4.44614 83.2944 4.44614C82.0751 4.44614 81.071 3.44217 81.071 2.22307C81.071 0.968111 82.0751 0 83.2944 0C84.5132 0 85.5173 0.968111 85.5173 2.22307ZM85.0152 26.139H81.6448V8.60541H85.0152V26.139ZM43.2705 21.0474C43.2705 24.382 45.888 26.5692 50.0114 26.5692C54.1707 26.5692 57.039 24.4537 57.039 21.1191C57.039 18.5016 55.5692 17.1391 52.593 16.422L49.5095 15.669C47.7884 15.2388 46.9278 14.4499 46.9278 13.2667C46.9278 11.6532 48.1111 10.7209 50.2266 10.7209C52.2703 10.7209 53.4536 11.8324 53.5253 13.5894H56.7526C56.6809 10.2548 54.1707 8.10343 50.3341 8.10343C46.4617 8.10343 43.7367 10.1472 43.7367 13.3742C43.7367 15.9558 45.2067 17.4977 48.3262 18.2506L51.4098 18.9678C53.2385 19.4339 53.8122 20.151 53.8122 21.3343C53.8122 22.9478 52.4497 23.9159 50.0831 23.9159C47.8601 23.9159 46.4975 22.8402 46.4975 21.0474H43.2705ZM69.0593 26.5692C73.3981 26.5692 76.3382 24.4537 77.1989 20.6889H74.0436C73.4698 22.6968 71.749 23.7725 69.1311 23.7725C65.7965 23.7725 63.8605 21.7286 63.6094 18.0355L77.1631 17.9997V16.7447C77.1631 11.5456 73.9002 8.10343 68.9165 8.10343C63.8246 8.10343 60.3465 11.9042 60.3465 17.3901C60.3465 22.8402 63.8963 26.5692 69.0593 26.5692ZM68.9165 10.936C71.8925 10.936 73.7926 12.8723 73.7926 15.7766H63.6811C64.1115 12.693 65.9758 10.936 68.9165 10.936Z" fill="black"/>
5
- </g>
6
- <defs>
7
- <linearGradient id="paint0_linear_1_53" x1="15.8958" y1="2.37374e-07" x2="22.1762" y2="31.8667" gradientUnits="userSpaceOnUse">
8
- <stop stop-color="#780000"/>
9
- <stop offset="1" stop-color="#C1121F"/>
10
- </linearGradient>
11
- <clipPath id="clip0_1_53">
12
- <rect width="85.5172" height="32" fill="white"/>
13
- </clipPath>
14
- </defs>
15
- </svg>
@@ -1,257 +0,0 @@
1
- 'use client';
2
-
3
- import { BANK_PRECOMPILE_ABI, BANK_PRECOMPILE_ADDRESS, WASM_PRECOMPILE_ABI, WASM_PRECOMPILE_ADDRESS } from '@sei-js/evm';
4
- import { useState } from 'react';
5
- import { ReadContractParameters, formatEther, fromHex, parseEther, toHex } from 'viem';
6
- import { useAccount, usePublicClient, useWriteContract } from 'wagmi';
7
-
8
- import './Homepage.css';
9
-
10
- function Examples() {
11
- const [balance, setBalance] = useState('');
12
- const [supply, setSupply] = useState('');
13
- const [count, setCount] = useState(0);
14
-
15
- const publicClient = usePublicClient();
16
- const { address } = useAccount();
17
- const { writeContractAsync } = useWriteContract();
18
-
19
- const formatLargeSeiNumber = (num: string, decimals: number): string => {
20
- if (num.length > 10) {
21
- return (
22
- (Number(num) / 1000000 / 1000000000).toLocaleString(navigator.language, { minimumFractionDigits: decimals, maximumFractionDigits: decimals }) + ' B'
23
- );
24
- } else {
25
- return (Number(num) / 1000000).toLocaleString(navigator.language);
26
- }
27
- };
28
-
29
- const copyToClipboard = (text: string) => {
30
- try {
31
- navigator.clipboard.writeText(text);
32
- } catch (err) {
33
- console.error('Failed to copy text: ', err);
34
- } finally {
35
- alert('Copied to clipboard!');
36
- }
37
- };
38
-
39
- const renderAddressExample = () => {
40
- return (
41
- <div className="card">
42
- <div className="card-header">
43
- <p className="card__title">Wallet address</p>
44
- <small className="card__description">
45
- <a href="https://viem.sh/docs/clients/public.html" target="_blank">
46
- Viem Public Client
47
- </a>{' '}
48
- query example
49
- </small>
50
- </div>
51
- <div className="card-body">
52
- <div className="content-background space-between">
53
- {address ? (
54
- <div>
55
- <p className="card-footer">{address}</p>
56
- </div>
57
- ) : (
58
- <p> --- </p>
59
- )}
60
-
61
- <button className="small outline" onClick={() => copyToClipboard(address as string)}>
62
- Copy
63
- </button>
64
- </div>
65
- </div>
66
- <div className="card-footer"></div>
67
- </div>
68
- );
69
- };
70
-
71
- const getBalanceWagmi = async () => {
72
- if (!address || !publicClient) {
73
- return undefined;
74
- }
75
- const weiBalance = await publicClient.getBalance({ address });
76
- const seiBalance = formatEther(weiBalance);
77
- setBalance(seiBalance);
78
- };
79
-
80
- const renderBalanceExample = () => {
81
- return (
82
- <div className="card">
83
- <div className="card-header">
84
- <p className="card__title">Wallet balance</p>
85
- <small className="card__description">
86
- <a href="https://viem.sh/docs/clients/public.html" target="_blank">
87
- Viem Public Client
88
- </a>{' '}
89
- query example
90
- </small>
91
- </div>
92
- <div className="card-body">
93
- <div className="content-background space-between">
94
- <small>SEI</small>
95
- <p>{balance ? balance : '---'} SEI</p>
96
- </div>
97
- </div>
98
- <div className="card-footer">
99
- <button onClick={getBalanceWagmi}>Fetch balance</button>
100
- </div>
101
- </div>
102
- );
103
- };
104
-
105
- // Example of using precompiles to query native Sei modules.
106
- const getBankSupply = async () => {
107
- if (!publicClient) {
108
- return;
109
- }
110
-
111
- const params: ReadContractParameters = {
112
- address: BANK_PRECOMPILE_ADDRESS,
113
- abi: BANK_PRECOMPILE_ABI,
114
- functionName: 'supply',
115
- args: ['usei']
116
- };
117
- try {
118
- const response = (await publicClient.readContract(params)) as BigInt;
119
- const supply = formatLargeSeiNumber(response.toString(), 1);
120
- setSupply(supply);
121
- } catch (e) {
122
- console.log(e);
123
- }
124
- };
125
-
126
- const renderBankSupplyExample = () => {
127
- return (
128
- <div className="card">
129
- <div className="card-header">
130
- <p className="card__title">Total Sei supply</p>
131
- <small className="card__description">
132
- <a href="https://www.docs.sei.io/dev-interoperability/precompiles/bank" target="_blank">
133
- {' '}
134
- Bank precompile
135
- </a>{' '}
136
- example for querying native Sei modules
137
- </small>
138
- </div>
139
- <div className="card-body">
140
- <div className="content-background space-between">
141
- <small>SEI</small>
142
- <p>{supply}</p>
143
- </div>
144
- </div>
145
- <div className="card-footer">
146
- <button onClick={getBankSupply}>Fetch supply</button>
147
- </div>
148
- </div>
149
- );
150
- };
151
-
152
- // Fetch count of a CosmWasm Contract using WASM Precompile
153
- const fetchCount = async () => {
154
- if (!publicClient) {
155
- return;
156
- }
157
-
158
- const COUNTER_CONTRACT_ADDRESS = 'sei14hj2tavq8fpesdwxxcu44rty3hh90vhujrvcmstl4zr3txmfvw9sh9m79m';
159
-
160
- const queryMsg = toHex(JSON.stringify({ get_count: {} }));
161
-
162
- const params: ReadContractParameters = {
163
- address: WASM_PRECOMPILE_ADDRESS,
164
- abi: WASM_PRECOMPILE_ABI,
165
- functionName: 'query',
166
- args: [COUNTER_CONTRACT_ADDRESS, queryMsg]
167
- };
168
- try {
169
- const response = (await publicClient?.readContract(params)) as `0x${string}`;
170
- const { count } = JSON.parse(fromHex(response, 'string'));
171
- setCount(count);
172
- } catch (e) {
173
- console.log(e);
174
- }
175
- };
176
-
177
- // Fetch count of a CosmWasm Contract using WASM Precompile
178
- const incrementCounter = async () => {
179
- if (!address || !publicClient) {
180
- return;
181
- }
182
-
183
- const COUNTER_CONTRACT_ADDRESS = 'sei14hj2tavq8fpesdwxxcu44rty3hh90vhujrvcmstl4zr3txmfvw9sh9m79m';
184
-
185
- const execMsg = toHex(JSON.stringify({ increment: {} }));
186
- const coins = toHex('[]');
187
- const params = {
188
- account: address,
189
- address: WASM_PRECOMPILE_ADDRESS,
190
- abi: WASM_PRECOMPILE_ABI,
191
- functionName: 'execute',
192
- args: [COUNTER_CONTRACT_ADDRESS, execMsg, coins],
193
- value: parseEther('0')
194
- };
195
-
196
- try {
197
- const estimatedGas = await publicClient.estimateContractGas(params);
198
-
199
- // Call smart contract execute msg
200
- await writeContractAsync({ ...params, gas: estimatedGas });
201
-
202
- // Wait for 1 block to confirm transaction
203
- setTimeout(() => {}, 400);
204
- await fetchCount();
205
- } catch (error) {
206
- console.log(error);
207
- }
208
- };
209
-
210
- const renderCounterContractExample = () => {
211
- return (
212
- <div className="card">
213
- <div className="card-header">
214
- <p className="card__title">Smart contract interaction</p>
215
- <small>
216
- <a href="https://www.docs.sei.io/dev-interoperability/precompiles/cosmwasm" target="_blank">
217
- WASM Precompile
218
- </a>{' '}
219
- example of CosmWasm smart contract interaction
220
- </small>
221
- </div>
222
- <div className="card-body">
223
- <div className="content-background space-between">
224
- <small>Count</small>
225
- <p>{count}</p>
226
- <button className="small outline" onClick={incrementCounter}>
227
- Increase
228
- </button>
229
- </div>
230
- </div>
231
- <div className="card-footer">
232
- <button onClick={fetchCount}>Fetch count</button>
233
- </div>
234
- </div>
235
- );
236
- };
237
-
238
- return (
239
- <div className="container">
240
- <div className="grid">
241
- {/* First card */}
242
- {renderAddressExample()}
243
-
244
- {/* Second card */}
245
- {renderBalanceExample()}
246
-
247
- {/* Third card */}
248
- {renderBankSupplyExample()}
249
-
250
- {/* Fourth card */}
251
- {renderCounterContractExample()}
252
- </div>
253
- </div>
254
- );
255
- }
256
-
257
- export default Examples;
@@ -1,154 +0,0 @@
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
- }
@@ -1,87 +0,0 @@
1
- 'use client';
2
-
3
- import { ConnectButton } from '@rainbow-me/rainbowkit';
4
- import Examples from './Examples';
5
- import './Homepage.css';
6
-
7
- type HelpItem = {
8
- title: string;
9
- description: string;
10
- link: string;
11
- };
12
-
13
- const renderHelpItem = ({ title, description, link }: HelpItem) => (
14
- <div className="card secondary">
15
- <div className="card-header">
16
- <p className="card__title">
17
- <a href={link} target="_blank" rel="noopener noreferrer" className="external-link">
18
- {title} {externalIcon}
19
- </a>
20
- </p>
21
- <small className="card__description">{description}</small>
22
- </div>
23
- </div>
24
- );
25
-
26
- const helpItems: HelpItem[] = [
27
- {
28
- title: 'Sei Docs',
29
- description: 'Find in-depth information about Sei.',
30
- link: 'https://docs.sei.io/'
31
- },
32
- {
33
- title: 'Wagmi',
34
- description: "Learn about Wagmi and it's hooks for chain interaction.",
35
- link: 'https://wagmi.sh/'
36
- },
37
- {
38
- title: 'Viem',
39
- description: 'Interact with Sei using Viem modules + Wagmi.',
40
- link: 'https://viem.sh/'
41
- },
42
- {
43
- title: 'EVM JSON-RPC API',
44
- description: 'Learn about the EVM api available on Sei.',
45
- link: 'https://ethereum.org/en/developers/docs/apis/json-rpc/'
46
- }
47
- ];
48
-
49
- const externalIcon = (
50
- <svg width="16" height="16" viewBox="0 0 16 16" fill="none" xmlns="http://www.w3.org/2000/svg">
51
- <path
52
- 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"
53
- stroke="#9F1239"
54
- strokeWidth="1.33333"
55
- strokeLinecap="round"
56
- strokeLinejoin="round"
57
- />
58
- <path d="M10 2H14V6" stroke="#9F1239" strokeWidth="1.33333" strokeLinecap="round" strokeLinejoin="round" />
59
- <path d="M6.66663 9.33333L14 2" stroke="#9F1239" strokeWidth="1.33333" strokeLinecap="round" strokeLinejoin="round" />
60
- </svg>
61
- );
62
-
63
- function Homepage() {
64
- return (
65
- <div className="container">
66
- <img src="sei-logotype.svg" className="logo" alt="SEI logotype" />
67
- <div className="card intro">
68
- <div className="card-header">
69
- <p className="card__title">Wallet address</p>
70
- <small className="card__description">Connect wallet to see your address and balance</small>
71
- </div>
72
- <ConnectButton />
73
- </div>
74
- <Examples />
75
- <div className="get-started">
76
- Get started by editing <code>src/app/page.tsx</code>
77
- </div>
78
- <div className="grid docs">
79
- {helpItems.map((item, index) => (
80
- <div key={item.title}>{renderHelpItem(item)}</div>
81
- ))}
82
- </div>
83
- </div>
84
- );
85
- }
86
-
87
- export default Homepage;
@@ -1,74 +0,0 @@
1
- 'use client';
2
-
3
- import { RainbowKitProvider, connectorsForWallets, lightTheme } from '@rainbow-me/rainbowkit';
4
- import { metaMaskWallet } from '@rainbow-me/rainbowkit/wallets';
5
- import { Buffer } from 'buffer';
6
- import { ReactNode, useMemo } from 'react';
7
- import { WagmiProvider, createConfig, http } from 'wagmi';
8
-
9
- import '@rainbow-me/rainbowkit/styles.css';
10
- import { QueryClient, QueryClientProvider } from '@tanstack/react-query';
11
- import { selectedChain } from '../constants';
12
-
13
- const queryClient = new QueryClient();
14
-
15
- interface Web3ProviderProps {
16
- children: ReactNode;
17
- }
18
-
19
- const connectors = connectorsForWallets(
20
- [
21
- {
22
- groupName: 'Recommended',
23
- wallets: [metaMaskWallet]
24
- }
25
- ],
26
- {
27
- appName: '<YOUR_APPNAME_HERE>',
28
- projectId: '<YOUR_ID_HERE>'
29
- }
30
- );
31
-
32
- function Web3Provider({ children }: Web3ProviderProps) {
33
- // Buffer polyfill
34
- if (typeof window !== 'undefined') {
35
- window.Buffer = window.Buffer ?? Buffer;
36
- }
37
- const chainConfig = selectedChain;
38
- const config = useMemo(
39
- () =>
40
- createConfig({
41
- chains: [chainConfig],
42
- connectors,
43
- transports: {
44
- [chainConfig.id]: http()
45
- }
46
- }),
47
- [chainConfig]
48
- );
49
-
50
- return (
51
- <WagmiProvider config={config}>
52
- <QueryClientProvider client={queryClient}>
53
- <RainbowKitProvider
54
- theme={lightTheme({
55
- accentColor: '#7e1914',
56
- accentColorForeground: 'white',
57
- borderRadius: 'medium',
58
- fontStack: 'system'
59
- })}
60
- appInfo={{
61
- appName: '<APP-NAME-HERE>',
62
- learnMoreUrl: 'https://www.docs.sei.io/user-guides/wallet-setup'
63
- }}
64
- modalSize="compact"
65
- initialChain={chainConfig.id}
66
- >
67
- {children}
68
- </RainbowKitProvider>
69
- </QueryClientProvider>
70
- </WagmiProvider>
71
- );
72
- }
73
-
74
- export default Web3Provider;
@@ -1,2 +0,0 @@
1
- export * from './Homepage/Homepage';
2
- export * from './Web3Provider';
@@ -1,7 +0,0 @@
1
- // Set your selected chain here
2
- import { seiDevnet } from 'viem/chains';
3
-
4
- // Set your selected chain here
5
- // To point to mainnet, use sei.
6
- // To point to testnet, use seiTestnet.
7
- export const selectedChain = seiDevnet;
@@ -1 +0,0 @@
1
- export * from './chain';