├── .github └── dependabot.yml ├── contracts ├── .eslintignore ├── .eslintrc.js ├── .gitignore ├── LICENSE ├── README.md ├── foundry.toml ├── hardhat.config.ts ├── package.json ├── tsconfig.json └── yarn.lock ├── readme.md └── web ├── .gitignore ├── CHANGELOG.md ├── README.md ├── next-env.d.ts ├── next.config.js ├── package.json ├── postcss.config.js ├── src ├── app │ ├── layout.tsx │ ├── page.tsx │ ├── providers.tsx │ └── welcome.tsx ├── styles │ └── global.css └── wagmi.ts ├── tailwind.config.js ├── tsconfig.json └── yarn.lock /.github/dependabot.yml: -------------------------------------------------------------------------------- 1 | version: 2 2 | updates: 3 | - package-ecosystem: "npm" 4 | directories: 5 | - "/web" 6 | - "/contracts" 7 | schedule: 8 | interval: "daily" 9 | commit-message: 10 | prefix: "dependabot: " 11 | labels: 12 | - "dependencies" 13 | allow: 14 | - dependency-name: "@zetachain/toolkit" 15 | - dependency-name: "@zetachain/universalkit" 16 | -------------------------------------------------------------------------------- /contracts/.eslintignore: -------------------------------------------------------------------------------- 1 | .yarn 2 | artifacts 3 | cache 4 | coverage 5 | node_modules 6 | typechain-types -------------------------------------------------------------------------------- /contracts/.eslintrc.js: -------------------------------------------------------------------------------- 1 | const path = require("path"); 2 | 3 | /** 4 | * @type {import("eslint").Linter.Config} 5 | */ 6 | module.exports = { 7 | env: { 8 | browser: false, 9 | es2021: true, 10 | mocha: true, 11 | node: true, 12 | }, 13 | extends: ["plugin:prettier/recommended"], 14 | parser: "@typescript-eslint/parser", 15 | parserOptions: { 16 | ecmaVersion: 12, 17 | }, 18 | plugins: [ 19 | "@typescript-eslint", 20 | "prettier", 21 | "simple-import-sort", 22 | "sort-keys-fix", 23 | "typescript-sort-keys", 24 | ], 25 | rules: { 26 | "@typescript-eslint/sort-type-union-intersection-members": "error", 27 | camelcase: "off", 28 | "simple-import-sort/exports": "error", 29 | "simple-import-sort/imports": "error", 30 | "sort-keys-fix/sort-keys-fix": "error", 31 | "typescript-sort-keys/interface": "error", 32 | "typescript-sort-keys/string-enum": "error", 33 | }, 34 | settings: { 35 | "import/parsers": { 36 | "@typescript-eslint/parser": [".js", ".jsx", ".ts", ".tsx", ".d.ts"], 37 | }, 38 | "import/resolver": { 39 | node: { 40 | extensions: [".js", ".jsx", ".ts", ".tsx", ".d.ts"], 41 | }, 42 | typescript: { 43 | project: path.join(__dirname, "tsconfig.json"), 44 | }, 45 | }, 46 | }, 47 | }; 48 | -------------------------------------------------------------------------------- /contracts/.gitignore: -------------------------------------------------------------------------------- 1 | node_modules 2 | .env 3 | coverage 4 | coverage.json 5 | typechain 6 | typechain-types 7 | 8 | # Hardhat files 9 | cache 10 | artifacts 11 | 12 | # Foundry files 13 | out 14 | cache_forge 15 | 16 | access_token -------------------------------------------------------------------------------- /contracts/LICENSE: -------------------------------------------------------------------------------- 1 | MIT License 2 | 3 | Copyright (c) 2023 ZetaChain 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | SOFTWARE. 22 | -------------------------------------------------------------------------------- /contracts/README.md: -------------------------------------------------------------------------------- 1 | # ZetaChain Contracts Template 2 | 3 | ## Getting Started 4 | 5 | Install dependencies: 6 | 7 | ``` 8 | yarn 9 | ``` 10 | 11 | ## Next Steps 12 | 13 | Ready to dive in? Follow our [**🚀 smart contract 14 | tutorials**](https://www.zetachain.com/docs/developers/tutorials/intro/) to 15 | start building universal app contracts. 16 | -------------------------------------------------------------------------------- /contracts/foundry.toml: -------------------------------------------------------------------------------- 1 | [profile.default] 2 | src = 'contracts' 3 | out = 'out' 4 | viaIR = true 5 | libs = ['node_modules', 'lib'] 6 | test = 'test' 7 | cache_path = 'cache_forge' -------------------------------------------------------------------------------- /contracts/hardhat.config.ts: -------------------------------------------------------------------------------- 1 | import "@nomicfoundation/hardhat-toolbox"; 2 | import "@zetachain/toolkit/tasks"; 3 | 4 | import { getHardhatConfigNetworks } from "@zetachain/networks"; 5 | import { HardhatUserConfig } from "hardhat/config"; 6 | 7 | const config: HardhatUserConfig = { 8 | networks: { 9 | ...getHardhatConfigNetworks(), 10 | }, 11 | solidity: "0.8.7", 12 | }; 13 | 14 | export default config; 15 | -------------------------------------------------------------------------------- /contracts/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "example-template", 3 | "version": "1.0.0", 4 | "description": "", 5 | "main": "index.js", 6 | "scripts": { 7 | "test": "echo \"Error: no test specified\" && exit 1", 8 | "lint:fix": "npx eslint . --ext .js,.ts --fix", 9 | "lint": "npx eslint . --ext .js,.ts" 10 | }, 11 | "keywords": [], 12 | "author": "", 13 | "license": "ISC", 14 | "devDependencies": { 15 | "@ethersproject/abi": "^5.4.7", 16 | "@ethersproject/providers": "^5.4.7", 17 | "@nomicfoundation/hardhat-chai-matchers": "^1.0.0", 18 | "@nomicfoundation/hardhat-foundry": "^1.1.2", 19 | "@nomicfoundation/hardhat-network-helpers": "^1.0.0", 20 | "@nomicfoundation/hardhat-toolbox": "^2.0.0", 21 | "@nomiclabs/hardhat-ethers": "^2.0.0", 22 | "@nomiclabs/hardhat-etherscan": "^3.0.0", 23 | "@typechain/ethers-v5": "^10.1.0", 24 | "@typechain/hardhat": "^6.1.2", 25 | "@types/chai": "^4.2.0", 26 | "@types/mocha": ">=9.1.0", 27 | "@types/node": ">=12.0.0", 28 | "@typescript-eslint/eslint-plugin": "^5.59.9", 29 | "@typescript-eslint/parser": "^5.59.9", 30 | "@zetachain/toolkit": "^10.0.0", 31 | "axios": "^1.3.6", 32 | "chai": "^4.2.0", 33 | "dotenv": "^16.0.3", 34 | "envfile": "^6.18.0", 35 | "eslint": "^8.42.0", 36 | "eslint-config-prettier": "^8.8.0", 37 | "eslint-import-resolver-typescript": "^3.5.5", 38 | "eslint-plugin-import": "^2.27.5", 39 | "eslint-plugin-prettier": "^4.2.1", 40 | "eslint-plugin-simple-import-sort": "^10.0.0", 41 | "eslint-plugin-sort-keys-fix": "^1.1.2", 42 | "eslint-plugin-typescript-sort-keys": "^2.3.0", 43 | "ethers": "^5.4.7", 44 | "hardhat": "^2.17.2", 45 | "hardhat-gas-reporter": "^1.0.8", 46 | "prettier": "^2.8.8", 47 | "solidity-coverage": "^0.8.0", 48 | "ts-node": ">=8.0.0", 49 | "typechain": "^8.1.0", 50 | "typescript": ">=4.5.0" 51 | }, 52 | "packageManager": "yarn@1.22.21+sha1.1959a18351b811cdeedbd484a8f86c3cc3bbaf72" 53 | } 54 | -------------------------------------------------------------------------------- /contracts/tsconfig.json: -------------------------------------------------------------------------------- 1 | { 2 | "compilerOptions": { 3 | "module": "nodenext", 4 | "moduleResolution": "nodenext", 5 | "esModuleInterop": true, 6 | "forceConsistentCasingInFileNames": true, 7 | "strict": true, 8 | "skipLibCheck": true, 9 | "resolveJsonModule": true 10 | } 11 | } 12 | -------------------------------------------------------------------------------- /readme.md: -------------------------------------------------------------------------------- 1 | # ZetaChain Template 2 | 3 | > [!WARNING] 4 | > The template has been deprecated, please, check out the [zeta-chain/examples-contracts](https://github.com/zeta-chain/example-contracts) repo for up-to-date examples and templates. 5 | 6 | [ZetaChain](https://www.zetachain.com) is a blockchain for [universal 7 | apps](https://www.zetachain.com/docs/developers/apps/intro/) that span across 8 | any blockchain, from Ethereum and Cosmos to Bitcoin and beyond. 9 | 10 | This template is designed to help developers quickly set up and build universal 11 | applications on ZetaChain, providing a structured starting point with 12 | pre-configured tools and libraries.Our templates and tools are designed to give 13 | you a great developer experience, so you can focus more on building and less on 14 | setup. 15 | 16 | # Prerequisites 17 | 18 | - Node.js 19 | - `npm` or `yarn` 20 | 21 | ## Getting Started 22 | 23 | ``` 24 | git clone https://github.com/zeta-chain/template 25 | ``` 26 | 27 | ## Project Structure 28 | 29 | ### Contracts 30 | 31 | The [`contracts`](contracts) directory contains a smart contract template that 32 | uses Solidity and Hardhat and is compatible with Foundry. The contracts template 33 | leverages [`@zetachain/toolkit`](https://github.com/zeta-chain/toolkit) for 34 | helpers, tools, and tasks. 35 | 36 | Ready to dive in? Follow our [**🚀 smart contract 37 | tutorials**](https://www.zetachain.com/docs/developers/tutorials/intro/) to 38 | start building universal app contracts. 39 | 40 | ### Web 41 | 42 | The [`web`](web) directory contains a web template that uses Next.js, 43 | RainbowKit, and Wagmi. The web template utilizes the 44 | [`@zetachain/universalkit`](https://github.com/zeta-chain/universalkit) 45 | component library. 46 | 47 | To kick off your web app development, check out our [**🌎 frontend 48 | tutorials**](https://www.zetachain.com/docs/developers/frontend/universalkit/). 49 | 50 | ## Contributing 51 | 52 | We welcome contributions to improve this template! Please fork the repository 53 | and submit a pull request. 54 | -------------------------------------------------------------------------------- /web/.gitignore: -------------------------------------------------------------------------------- 1 | # See https://help.github.com/articles/ignoring-files/ for more about ignoring files. 2 | 3 | # dependencies 4 | /node_modules 5 | /.pnp 6 | .pnp.js 7 | 8 | # testing 9 | /coverage 10 | 11 | # next.js 12 | /.next/ 13 | /out/ 14 | 15 | # production 16 | /build 17 | 18 | # misc 19 | .DS_Store 20 | *.pem 21 | 22 | # debug 23 | npm-debug.log* 24 | yarn-debug.log* 25 | yarn-error.log* 26 | .pnpm-debug.log* 27 | 28 | # local env files 29 | .env.local 30 | .env.development.local 31 | .env.test.local 32 | .env.production.local 33 | 34 | # vercel 35 | .vercel 36 | 37 | # typescript 38 | *.tsbuildinfo -------------------------------------------------------------------------------- /web/CHANGELOG.md: -------------------------------------------------------------------------------- 1 | # with-next-app 2 | 3 | ## 0.0.40 4 | 5 | ### Patch Changes 6 | 7 | - Updated dependencies [23e33b9] 8 | - Updated dependencies [d81935c] 9 | - Updated dependencies [7b00be5] 10 | - Updated dependencies [001a0a9] 11 | - @rainbow-me/rainbowkit@2.1.3 12 | 13 | ## 0.0.39 14 | 15 | ### Patch Changes 16 | 17 | - Updated dependencies [2180ddd] 18 | - Updated dependencies [fea278a] 19 | - @rainbow-me/rainbowkit@2.1.2 20 | 21 | ## 0.0.38 22 | 23 | ### Patch Changes 24 | 25 | - Updated dependencies [725a376] 26 | - Updated dependencies [9be5452] 27 | - @rainbow-me/rainbowkit@2.1.1 28 | 29 | ## 0.0.37 30 | 31 | ### Patch Changes 32 | 33 | - Updated dependencies [90d6931] 34 | - Updated dependencies [82153ed] 35 | - @rainbow-me/rainbowkit@2.1.0 36 | 37 | ## 0.0.36 38 | 39 | ### Patch Changes 40 | 41 | - Updated dependencies [8841891] 42 | - @rainbow-me/rainbowkit@2.0.8 43 | 44 | ## 0.0.35 45 | 46 | ### Patch Changes 47 | 48 | - Updated dependencies [af4ea4e] 49 | - Updated dependencies [f0b3b25] 50 | - @rainbow-me/rainbowkit@2.0.7 51 | 52 | ## 0.0.34 53 | 54 | ### Patch Changes 55 | 56 | - Updated dependencies [7ab6e50] 57 | - Updated dependencies [515498f] 58 | - @rainbow-me/rainbowkit@2.0.6 59 | 60 | ## 0.0.33 61 | 62 | ### Patch Changes 63 | 64 | - Updated dependencies [81ba812] 65 | - Updated dependencies [fc4d7e1] 66 | - Updated dependencies [1a0f209] 67 | - Updated dependencies [b11118f] 68 | - Updated dependencies [4dd1e45] 69 | - Updated dependencies [ec41346] 70 | - @rainbow-me/rainbowkit@2.0.5 71 | 72 | ## 0.0.32 73 | 74 | ### Patch Changes 75 | 76 | - Updated dependencies [77dcec3] 77 | - Updated dependencies [6c240ba] 78 | - Updated dependencies [34419b5] 79 | - Updated dependencies [5c60239] 80 | - @rainbow-me/rainbowkit@2.0.4 81 | 82 | ## 0.0.31 83 | 84 | ### Patch Changes 85 | 86 | - c837995: Updated the following packages: 87 | - wagmi to `^2.5.11` 88 | - viem to `^2.8.12` 89 | - @tanstack/react-query to `^5.28.4` 90 | - typescript to `5.4.2` 91 | - Updated dependencies [b80e8fa] 92 | - Updated dependencies [985b80b] 93 | - Updated dependencies [b25db9a] 94 | - @rainbow-me/rainbowkit@2.0.3 95 | 96 | ## 0.0.30 97 | 98 | ### Patch Changes 99 | 100 | - 6982833: Updated the following packages: 101 | 102 | - `next` to `^14.1.3` 103 | - `eslint-config-next` to `^14.1.3` 104 | - `@types/react` to `^18.2.64` 105 | - `@types/react` to `^18.2.64` 106 | 107 | - Updated dependencies [524d7a0] 108 | - Updated dependencies [2f637e4] 109 | - Updated dependencies [c021746] 110 | - Updated dependencies [df572f1] 111 | - @rainbow-me/rainbowkit@2.0.2 112 | 113 | ## 0.0.29 114 | 115 | ### Patch Changes 116 | 117 | - d623428: Updated the following packages: 118 | - wagmi to `^2.5.7` 119 | - viem to `^2.7.12` 120 | - @tanstack/react-query to `^5.22.2` 121 | - Updated dependencies [5149dbd] 122 | - Updated dependencies [1e7d3f4] 123 | - Updated dependencies [c16541a] 124 | - Updated dependencies [dbca966] 125 | - Updated dependencies [f69c0e1] 126 | - Updated dependencies [bb56562] 127 | - Updated dependencies [1a08977] 128 | - @rainbow-me/rainbowkit@2.0.1 129 | 130 | ## 0.0.28 131 | 132 | ### Patch Changes 133 | 134 | - Updated dependencies [aa0269e] 135 | - @rainbow-me/rainbowkit@2.0.0 136 | 137 | ## 0.0.27 138 | 139 | ### Patch Changes 140 | 141 | - Updated dependencies [33a8266] 142 | - @rainbow-me/rainbowkit@1.3.6 143 | 144 | ## 0.0.26 145 | 146 | ### Patch Changes 147 | 148 | - Updated dependencies [2b0c7b3] 149 | - @rainbow-me/rainbowkit@1.3.5 150 | 151 | ## 0.0.25 152 | 153 | ### Patch Changes 154 | 155 | - Updated dependencies [c0a644a] 156 | - Updated dependencies [41616b9] 157 | - Updated dependencies [cf4955f] 158 | - Updated dependencies [e5f5f03] 159 | - Updated dependencies [c0bd68e] 160 | - Updated dependencies [a79609b] 161 | - @rainbow-me/rainbowkit@1.3.4 162 | 163 | ## 0.0.24 164 | 165 | ### Patch Changes 166 | 167 | - Updated dependencies [24b5a88] 168 | - Updated dependencies [7565fb2] 169 | - Updated dependencies [5a184e9] 170 | - @rainbow-me/rainbowkit@1.3.3 171 | 172 | ## 0.0.23 173 | 174 | ### Patch Changes 175 | 176 | - Updated dependencies [7ba94f48] 177 | - @rainbow-me/rainbowkit@1.3.2 178 | 179 | ## 0.0.22 180 | 181 | ### Patch Changes 182 | 183 | - Updated dependencies [3feab0e6] 184 | - Updated dependencies [c9a8e469] 185 | - Updated dependencies [dba51779] 186 | - @rainbow-me/rainbowkit@1.3.1 187 | 188 | ## 0.0.21 189 | 190 | ### Patch Changes 191 | 192 | - Updated dependencies [9ce75a65] 193 | - @rainbow-me/rainbowkit@1.3.0 194 | 195 | ## 0.0.20 196 | 197 | ### Patch Changes 198 | 199 | - Updated dependencies [74ead9df] 200 | - Updated dependencies [94dce820] 201 | - Updated dependencies [39d81e93] 202 | - @rainbow-me/rainbowkit@1.2.1 203 | 204 | ## 0.0.19 205 | 206 | ### Patch Changes 207 | 208 | - Updated dependencies [ef64a229] 209 | - @rainbow-me/rainbowkit@1.2.0 210 | 211 | ## 0.0.18 212 | 213 | ### Patch Changes 214 | 215 | - Updated dependencies [9f68c300] 216 | - Updated dependencies [3f595c12] 217 | - Updated dependencies [e2075b31] 218 | - @rainbow-me/rainbowkit@1.1.4 219 | 220 | ## 0.0.17 221 | 222 | ### Patch Changes 223 | 224 | - Updated dependencies [02e796c0] 225 | - Updated dependencies [efb8566e] 226 | - Updated dependencies [4b7a44c8] 227 | - Updated dependencies [2c8abbb2] 228 | - Updated dependencies [e41103fb] 229 | - Updated dependencies [b0022aea] 230 | - @rainbow-me/rainbowkit@1.1.3 231 | 232 | ## 0.0.16 233 | 234 | ### Patch Changes 235 | 236 | - Updated dependencies [6cbd9a57] 237 | - Updated dependencies [7d978605] 238 | - Updated dependencies [b2b69dcd] 239 | - @rainbow-me/rainbowkit@1.1.2 240 | 241 | ## 0.0.15 242 | 243 | ### Patch Changes 244 | 245 | - Updated dependencies [b60e335c] 246 | - @rainbow-me/rainbowkit@1.1.1 247 | 248 | ## 0.0.14 249 | 250 | ### Patch Changes 251 | 252 | - Updated dependencies [b37f5d68] 253 | - @rainbow-me/rainbowkit@1.1.0 254 | 255 | ## 0.0.13 256 | 257 | ### Patch Changes 258 | 259 | - Updated dependencies [5b8d8219] 260 | - Updated dependencies [fb9405a4] 261 | - Updated dependencies [7643e706] 262 | - Updated dependencies [252f02e8] 263 | - @rainbow-me/rainbowkit@1.0.12 264 | 265 | ## 0.0.12 266 | 267 | ### Patch Changes 268 | 269 | - Updated dependencies [118dfe11] 270 | - @rainbow-me/rainbowkit@1.0.11 271 | 272 | ## 0.0.11 273 | 274 | ### Patch Changes 275 | 276 | - Updated dependencies [a129cb04] 277 | - @rainbow-me/rainbowkit@1.0.10 278 | 279 | ## 0.0.10 280 | 281 | ### Patch Changes 282 | 283 | - Updated dependencies [42a0c3e5] 284 | - Updated dependencies [67933ed5] 285 | - Updated dependencies [e7ae2571] 286 | - Updated dependencies [c434ca7a] 287 | - Updated dependencies [ad1f860e] 288 | - Updated dependencies [60968a5f] 289 | - Updated dependencies [7b31af24] 290 | - @rainbow-me/rainbowkit@1.0.9 291 | 292 | ## 0.0.9 293 | 294 | ### Patch Changes 295 | 296 | - Updated dependencies [eb319f3] 297 | - @rainbow-me/rainbowkit@1.0.8 298 | 299 | ## 0.0.8 300 | 301 | ### Patch Changes 302 | 303 | - Updated dependencies [f1e98e84] 304 | - Updated dependencies [d303a3b9] 305 | - @rainbow-me/rainbowkit@1.0.7 306 | 307 | ## 0.0.7 308 | 309 | ### Patch Changes 310 | 311 | - Updated dependencies [dc3cd10b] 312 | - Updated dependencies [c251d55d] 313 | - Updated dependencies [d5b3bd19] 314 | - Updated dependencies [66e84239] 315 | - Updated dependencies [1b4f142e] 316 | - Updated dependencies [e089ab98] 317 | - @rainbow-me/rainbowkit@1.0.6 318 | 319 | ## 0.0.6 320 | 321 | ### Patch Changes 322 | 323 | - Updated dependencies [08e3f4c] 324 | - Updated dependencies [cb3614e] 325 | - Updated dependencies [53d96bc] 326 | - Updated dependencies [bfab830] 327 | - @rainbow-me/rainbowkit@1.0.5 328 | 329 | ## 0.0.5 330 | 331 | ### Patch Changes 332 | 333 | - Updated dependencies [6d361b4] 334 | - @rainbow-me/rainbowkit@1.0.4 335 | 336 | ## 0.0.4 337 | 338 | ### Patch Changes 339 | 340 | - Updated dependencies [d00c777] 341 | - @rainbow-me/rainbowkit@1.0.3 342 | 343 | ## 0.0.3 344 | 345 | ### Patch Changes 346 | 347 | - Updated dependencies [e2b1072] 348 | - Updated dependencies [e2b1072] 349 | - @rainbow-me/rainbowkit@1.0.2 350 | 351 | ## 0.0.2 352 | 353 | ### Patch Changes 354 | 355 | - Updated dependencies [9432a2f] 356 | - Updated dependencies [b2c66ff] 357 | - Updated dependencies [bcb3d18] 358 | - @rainbow-me/rainbowkit@1.0.1 359 | 360 | ## 0.0.1 361 | 362 | ### Patch Changes 363 | 364 | - Updated dependencies [9838acf] 365 | - @rainbow-me/rainbowkit@0.12.0 366 | -------------------------------------------------------------------------------- /web/README.md: -------------------------------------------------------------------------------- 1 | # ZetaChain Web Template 2 | 3 | ## Getting Started 4 | 5 | Install dependencies: 6 | 7 | ``` 8 | yarn 9 | ``` 10 | 11 | ## Next Steps 12 | 13 | To kick off your web app development, check out our [**🌎 frontend 14 | tutorials**](https://www.zetachain.com/docs/developers/web/universalkit/). 15 | -------------------------------------------------------------------------------- /web/next-env.d.ts: -------------------------------------------------------------------------------- 1 | /// 2 | /// 3 | 4 | // NOTE: This file should not be edited 5 | // see https://nextjs.org/docs/basic-features/typescript for more information. 6 | -------------------------------------------------------------------------------- /web/next.config.js: -------------------------------------------------------------------------------- 1 | /** @type {import('next').NextConfig} */ 2 | const nextConfig = { 3 | reactStrictMode: true, 4 | webpack: (config, { dev }) => { 5 | if (!dev) { 6 | config.optimization.minimize = false; 7 | } 8 | config.externals.push("pino-pretty", "lokijs", "encoding"); 9 | return config; 10 | }, 11 | }; 12 | 13 | module.exports = nextConfig; 14 | -------------------------------------------------------------------------------- /web/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "next-template", 3 | "private": true, 4 | "version": "0.0.40", 5 | "scripts": { 6 | "dev": "next dev", 7 | "build": "next build", 8 | "start": "next start" 9 | }, 10 | "dependencies": { 11 | "@rainbow-me/rainbowkit": "^2.1.3", 12 | "@tanstack/react-query": "^5.28.4", 13 | "@zetachain/universalkit": "^2.0.0", 14 | "autoprefixer": "^10.4.19", 15 | "next": "^14.2.3", 16 | "next-themes": "^0.3.0", 17 | "react": "^18.3.0", 18 | "react-dom": "^18.3.0", 19 | "tailwindcss": "^3.4.6", 20 | "viem": "2.9.31", 21 | "wagmi": "^2.10.10" 22 | }, 23 | "devDependencies": { 24 | "@types/react": "^18.3.0", 25 | "next": "^14.2.3", 26 | "typescript": "5.4.2" 27 | }, 28 | "engines": { 29 | "node": ">=18.0.0" 30 | }, 31 | "packageManager": "yarn@1.22.21+sha1.1959a18351b811cdeedbd484a8f86c3cc3bbaf72" 32 | } 33 | -------------------------------------------------------------------------------- /web/postcss.config.js: -------------------------------------------------------------------------------- 1 | module.exports = { 2 | plugins: { 3 | tailwindcss: {}, 4 | autoprefixer: {}, 5 | }, 6 | }; 7 | -------------------------------------------------------------------------------- /web/src/app/layout.tsx: -------------------------------------------------------------------------------- 1 | import "../styles/global.css"; 2 | import "@rainbow-me/rainbowkit/styles.css"; 3 | import { Providers } from "./providers"; 4 | 5 | const RootLayout = ({ children }: { children: React.ReactNode }) => { 6 | return ( 7 | 8 | 9 | {children} 10 | 11 | 12 | ); 13 | }; 14 | 15 | export default RootLayout; 16 | -------------------------------------------------------------------------------- /web/src/app/page.tsx: -------------------------------------------------------------------------------- 1 | "use client"; 2 | 3 | import { ConnectButton } from "@rainbow-me/rainbowkit"; 4 | import { ConnectBitcoin } from "@zetachain/universalkit"; 5 | import { Welcome } from "./welcome"; 6 | 7 | const Page = () => { 8 | return ( 9 |
10 |
11 | 12 | 13 |
14 | 15 |
16 |
{/* Add components here */}
17 |
18 |
19 | ); 20 | }; 21 | 22 | export default Page; 23 | -------------------------------------------------------------------------------- /web/src/app/providers.tsx: -------------------------------------------------------------------------------- 1 | "use client"; 2 | 3 | import { useState, useEffect } from "react"; 4 | import { QueryClient, QueryClientProvider } from "@tanstack/react-query"; 5 | import { WagmiProvider, useChainId, useWalletClient } from "wagmi"; 6 | import { 7 | RainbowKitProvider, 8 | darkTheme, 9 | lightTheme, 10 | } from "@rainbow-me/rainbowkit"; 11 | import { UniversalKitProvider } from "@zetachain/universalkit"; 12 | import { config } from "../wagmi"; 13 | import { useTheme, ThemeProvider as NextThemesProvider } from "next-themes"; 14 | 15 | const queryClient = new QueryClient(); 16 | 17 | const ThemeProvider = ({ children }: { children: React.ReactNode }) => { 18 | const { theme } = useTheme(); 19 | const rainbowKitTheme = theme === "dark" ? darkTheme() : lightTheme(); 20 | 21 | return ( 22 | {children} 23 | ); 24 | }; 25 | 26 | const WagmiWrapper = ({ children }: { children: React.ReactNode }) => { 27 | return ( 28 | 29 | {children} 30 | 31 | ); 32 | }; 33 | 34 | export const Providers = ({ children }: { children: React.ReactNode }) => { 35 | const [mounted, setMounted] = useState(false); 36 | 37 | useEffect(() => { 38 | setMounted(true); 39 | }, []); 40 | 41 | if (!mounted) return null; 42 | 43 | return ( 44 | 45 | 46 | 52 | 53 | {children} 54 | 55 | 56 | 57 | 58 | ); 59 | }; 60 | -------------------------------------------------------------------------------- /web/src/app/welcome.tsx: -------------------------------------------------------------------------------- 1 | import Link from "next/link"; 2 | import { useTheme } from "next-themes"; 3 | 4 | export const Welcome = () => { 5 | const { theme } = useTheme(); 6 | 7 | return ( 8 |
9 |
10 |
11 |
12 |
13 |
14 | 15 |
16 |
17 |
from
18 |
19 | 20 |
21 |
22 |
23 | A robust ZetaChain component library of ready to use React 24 | components that lets you build user interfaces for universal 25 | apps. 26 |
27 |
28 |
29 |
30 | {theme === "dark" ? : } 31 |
32 |
33 |
34 | 40 |
41 |
42 | 43 |
44 |
45 |
46 |
47 | Get Started 48 |
49 |
50 | Learn about universal apps 51 |
52 |
53 |
54 | 55 |
56 | 57 | 63 |
64 |
65 | 66 |
67 |
68 |
69 |
70 | Documentation 71 |
72 |
73 | Explore components 74 |
75 |
76 |
77 | 78 |
79 | 80 | 86 |
87 |
88 | 89 |
90 |
91 |
92 |
93 | Discord 94 |
95 |
96 | Join a thriving community 97 |
98 |
99 |
100 | 101 |
102 | 103 |
104 |
105 |
106 | ); 107 | }; 108 | 109 | const HeroLight = () => { 110 | return ( 111 | 118 | 126 | 132 | 140 | 147 | 154 | 161 | 168 | 175 | 181 | 185 | 192 | 199 | 206 | 210 | 217 | 221 | 229 | 233 | 240 | 244 | 245 | 253 | 259 | 266 | 273 | 280 | 287 | 293 | 300 | 307 | 314 | 321 | 328 | 335 | 343 | 349 | 350 | 351 | 352 | 353 | 354 | 358 | 362 | 370 | 376 | 382 | 390 | 397 | 404 | 410 | 417 | 424 | 428 | 432 | 436 | 440 | 446 | 452 | 453 | ); 454 | }; 455 | 456 | const HeroDark = () => { 457 | return ( 458 | 465 | 473 | 479 | 487 | 494 | 501 | 508 | 515 | 522 | 528 | 532 | 539 | 545 | 552 | 556 | 563 | 567 | 575 | 579 | 586 | 590 | 591 | 598 | 604 | 611 | 618 | 625 | 632 | 638 | 645 | 652 | 659 | 666 | 673 | 680 | 688 | 694 | 695 | 696 | 697 | 698 | 699 | 703 | 707 | 715 | 721 | 727 | 735 | 741 | 747 | 753 | 760 | 767 | 771 | 775 | 779 | 783 | 789 | 795 | 796 | ); 797 | }; 798 | 799 | const Logo = () => { 800 | return ( 801 | 808 | 812 | 813 | ); 814 | }; 815 | 816 | const ZetaChain = () => { 817 | return ( 818 | 825 | 831 | 832 | ); 833 | }; 834 | 835 | const IconCircles = () => { 836 | return ( 837 | 844 | 845 | 846 | 847 | 853 | 854 | ); 855 | }; 856 | 857 | const IconArrow = () => { 858 | return ( 859 | 866 | 872 | 873 | ); 874 | }; 875 | 876 | const IconDoc = () => { 877 | return ( 878 | 885 | 886 | 890 | 897 | 904 | 911 | 915 | 916 | ); 917 | }; 918 | 919 | const IconDiscord = () => { 920 | return ( 921 | 928 | 929 | 933 | 934 | ); 935 | }; 936 | -------------------------------------------------------------------------------- /web/src/styles/global.css: -------------------------------------------------------------------------------- 1 | @tailwind base; 2 | @tailwind components; 3 | @tailwind utilities; 4 | 5 | body { 6 | margin: 0; 7 | font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "Roboto", "Oxygen", 8 | "Ubuntu", "Cantarell", "Fira Sans", "Droid Sans", "Helvetica Neue", 9 | sans-serif; 10 | -webkit-font-smoothing: antialiased; 11 | -moz-osx-font-smoothing: grayscale; 12 | } 13 | -------------------------------------------------------------------------------- /web/src/wagmi.ts: -------------------------------------------------------------------------------- 1 | import { getDefaultConfig } from "@rainbow-me/rainbowkit"; 2 | import { bscTestnet, sepolia, zetachainAthensTestnet } from "wagmi/chains"; 3 | 4 | export const config = getDefaultConfig({ 5 | appName: "RainbowKit demo", 6 | projectId: "YOUR_PROJECT_ID", 7 | chains: [sepolia, bscTestnet, zetachainAthensTestnet], 8 | }); 9 | -------------------------------------------------------------------------------- /web/tailwind.config.js: -------------------------------------------------------------------------------- 1 | /** @type {import('tailwindcss').Config} */ 2 | module.exports = { 3 | darkMode: ["class"], 4 | content: [ 5 | "./pages/**/*.{ts,tsx}", 6 | "./components/**/*.{ts,tsx}", 7 | "./app/**/*.{ts,tsx}", 8 | "./src/**/*.{ts,tsx}", 9 | ], 10 | prefix: "", 11 | theme: { 12 | container: { 13 | center: true, 14 | padding: "2rem", 15 | screens: { 16 | "2xl": "1400px", 17 | }, 18 | }, 19 | extend: { 20 | scale: { 21 | 1025: "1.025", 22 | }, 23 | fontFamily: { 24 | rounded: ["SFRounded", "ui-rounded", "SF Pro Rounded", "sans-serif"], 25 | }, 26 | boxShadow: { 27 | rainbowkit: "0px 4px 12px rgba(0, 0, 0, 0.1)", 28 | xl: "0 20px 25px -5px rgb(0 0 0 / 0.1), 0 8px 10px -6px rgb(0 0 0 / 0.1);", 29 | "2xl": "0 10px 50px -12px rgb(0 0 0 / 0.25);", 30 | "zeta-xl": 31 | "0px 18px 28px 0px rgba(9, 30, 66, 0.10), 0px 0px 1px 0px rgba(9, 30, 66, 0.20)", 32 | }, 33 | colors: { 34 | bitcoin: "#f89414", 35 | zeta: { 36 | green: { 37 | 50: "#00DDA5", 38 | 100: "#00BC8D", 39 | 200: "#00A87D", 40 | 300: "#005741", 41 | 400: "#008462", 42 | 500: "#007457", 43 | 600: "#00664C", 44 | 700: "#005741", 45 | 800: "#004937", 46 | 900: "#003D2D", 47 | }, 48 | mauve: { 49 | 100: "#FF5AF1", 50 | 300: "#E34ED6", 51 | 500: "#C241B6", 52 | 700: "#A03595", 53 | 900: "#521A4D", 54 | }, 55 | blue: { 56 | 100: "#00D5FF", 57 | 300: "#00C6EE", 58 | 500: "#00B8DD", 59 | 700: "#00A5C6", 60 | 900: "#006579", 61 | }, 62 | orange: { 63 | 100: "#FFAB00", 64 | 300: "#F4A400", 65 | 500: "#EB9E00", 66 | 700: "#D99200", 67 | 900: "#B87C00", 68 | }, 69 | lime: { 70 | 100: "#EFFFDE", 71 | 500: "#C4FF8A", 72 | 700: "#B0FF61", 73 | 900: "#9AEA4A", 74 | }, 75 | sand: { 76 | 100: "#F7F3EC", 77 | }, 78 | grey: { 79 | 50: "#FFFFFF", 80 | 100: "#EFF1F4", 81 | 200: "#E5E8EC", 82 | 300: "#A9ACB0", 83 | 400: "#696E75", 84 | 500: "#3C4146", 85 | 600: "#2D3237", 86 | 700: "#1F2328", 87 | 800: "#15191E", 88 | 900: "#000000", 89 | }, 90 | }, 91 | rainbowkit: { 92 | dark: "#1a1b1f", 93 | secondary: "#24262a", 94 | profileAction: "rgba(224, 232, 255, 0.1)", 95 | }, 96 | border: "hsl(var(--border))", 97 | input: "hsl(var(--input))", 98 | ring: "hsl(var(--ring))", 99 | background: "hsl(var(--background))", 100 | foreground: "hsl(var(--foreground))", 101 | primary: { 102 | DEFAULT: "hsl(var(--primary))", 103 | foreground: "hsl(var(--primary-foreground))", 104 | }, 105 | secondary: { 106 | DEFAULT: "hsl(var(--secondary))", 107 | foreground: "hsl(var(--secondary-foreground))", 108 | }, 109 | destructive: { 110 | DEFAULT: "hsl(var(--destructive))", 111 | foreground: "hsl(var(--destructive-foreground))", 112 | }, 113 | muted: { 114 | DEFAULT: "hsl(var(--muted))", 115 | foreground: "hsl(var(--muted-foreground))", 116 | }, 117 | accent: { 118 | DEFAULT: "hsl(var(--accent))", 119 | foreground: "hsl(var(--accent-foreground))", 120 | }, 121 | popover: { 122 | DEFAULT: "hsl(var(--popover))", 123 | foreground: "hsl(var(--popover-foreground))", 124 | }, 125 | card: { 126 | DEFAULT: "hsl(var(--card))", 127 | foreground: "hsl(var(--card-foreground))", 128 | }, 129 | }, 130 | borderRadius: { 131 | lg: "var(--radius)", 132 | md: "calc(var(--radius) - 2px)", 133 | sm: "calc(var(--radius) - 4px)", 134 | }, 135 | keyframes: { 136 | "accordion-down": { 137 | from: { height: "0" }, 138 | to: { height: "var(--radix-accordion-content-height)" }, 139 | }, 140 | "accordion-up": { 141 | from: { height: "var(--radix-accordion-content-height)" }, 142 | to: { height: "0" }, 143 | }, 144 | }, 145 | animation: { 146 | "accordion-down": "accordion-down 0.2s ease-out", 147 | "accordion-up": "accordion-up 0.2s ease-out", 148 | }, 149 | }, 150 | }, 151 | plugins: [require("tailwindcss-animate")], 152 | }; 153 | -------------------------------------------------------------------------------- /web/tsconfig.json: -------------------------------------------------------------------------------- 1 | { 2 | "compilerOptions": { 3 | "target": "es5", 4 | "lib": ["dom", "dom.iterable", "esnext"], 5 | "allowJs": true, 6 | "skipLibCheck": true, 7 | "strict": true, 8 | "forceConsistentCasingInFileNames": true, 9 | "noEmit": true, 10 | "esModuleInterop": true, 11 | "module": "esnext", 12 | "moduleResolution": "node", 13 | "resolveJsonModule": true, 14 | "isolatedModules": true, 15 | "jsx": "preserve", 16 | "incremental": true, 17 | "plugins": [ 18 | { 19 | "name": "next" 20 | } 21 | ] 22 | }, 23 | "include": ["next-env.d.ts", "**/*.ts", "**/*.tsx", ".next/types/**/*.ts"], 24 | "exclude": ["node_modules"] 25 | } 26 | --------------------------------------------------------------------------------