diff --git a/.editorconfig b/.editorconfig new file mode 100644 index 00000000..63131714 --- /dev/null +++ b/.editorconfig @@ -0,0 +1,13 @@ +root = true + +[*.{ts,tsx,json,js,jsx}] +end_of_line = lf +charset = utf-8 +trim_trailing_whitespace = true +insert_final_newline = true +indent_style = space +indent_size = 2 + +[*.md] +trim_trailing_whitespace = true +insert_final_newline = true \ No newline at end of file diff --git a/.env.example b/.env.example new file mode 100644 index 00000000..80be7f7e --- /dev/null +++ b/.env.example @@ -0,0 +1,14 @@ +# Basic +NEXT_PUBLIC_SITE_TITLE=WasmSwap +NEXT_PUBLIC_LOGO_URL=/crab.png + +# Chain +NEXT_PUBLIC_CHAIN_ID=lucina +NEXT_PUBLIC_CHAIN_NAME=Juno +NEXT_PUBLIC_CHAIN_BECH32_PREFIX=juno +NEXT_PUBLIC_CHAIN_RPC_ENDPOINT=https://rpc-juno.itastakers.com/ +NEXT_PUBLIC_CHAIN_REST_ENDPOINT=https://lcd-juno.itastakers.com/ +NEXT_PUBLIC_STAKING_DENOM="ujuno" + +# Contracts +NEXT_PUBLIC_AMM_CONTRACT_ADDRESS=juno1mvtl25cganft5ae9rcrqt7nz3ktvwz88m76eds diff --git a/.eslintrc b/.eslintrc new file mode 100644 index 00000000..97a2bb84 --- /dev/null +++ b/.eslintrc @@ -0,0 +1,3 @@ +{ + "extends": ["next", "next/core-web-vitals"] +} diff --git a/.gitignore b/.gitignore new file mode 100644 index 00000000..ea1cbd7d --- /dev/null +++ b/.gitignore @@ -0,0 +1,60 @@ +# See https://help.github.com/articles/ignoring-files/ for more about ignoring files. + +# dependencies +/node_modules +/.pnp +.pnp.js + +# testing +/coverage + +# next.js +/.next/ +/out/ + +# production +/build + +# misc +.DS_Store +*.pem + +# debug +npm-debug.log* +yarn-debug.log* +yarn-error.log* + +# local env files +.env +.env.local +.env.development.local +.env.test.local +.env.production.local + +# vercel +.vercel + +# emacs +*~ +\#*\# +/.emacs.desktop +/.emacs.desktop.lock +*.elc +auto-save-list +tramp +.\#* +.log + +# vim +# swap +[._]*.s[a-v][a-z] +[._]*.sw[a-p] +[._]s[a-v][a-z] +[._]sw[a-p] +# session +Session.vim +# temporary +.netrwhist +*~ +# auto-generated tag files +tags diff --git a/.prettierignore b/.prettierignore new file mode 100644 index 00000000..5c51653d --- /dev/null +++ b/.prettierignore @@ -0,0 +1,4 @@ +node_modules +**/.next/** +**/_next/** +**/dist/** diff --git a/.prettierrc.json b/.prettierrc.json new file mode 100644 index 00000000..043b0cd7 --- /dev/null +++ b/.prettierrc.json @@ -0,0 +1,7 @@ +{ + "semi": false, + "trailingComma": "es5", + "singleQuote": true, + "tabWidth": 2, + "useTabs": false +} diff --git a/README.md b/README.md new file mode 100644 index 00000000..384991c9 --- /dev/null +++ b/README.md @@ -0,0 +1,34 @@ +This is a [Next.js](https://nextjs.org/) project bootstrapped with [`create-next-app`](https://github.com/vercel/next.js/tree/canary/packages/create-next-app). + +## Getting Started + +First, run the development server: + +```bash +npm run dev +# or +yarn dev +``` + +Open [http://localhost:3000](http://localhost:3000) with your browser to see the result. + +You can start editing the page by modifying `pages/index.tsx`. The page auto-updates as you edit the file. + +[API routes](https://nextjs.org/docs/api-routes/introduction) can be accessed on [http://localhost:3000/api/hello](http://localhost:3000/api/hello). This endpoint can be edited in `pages/api/hello.tsx`. + +The `pages/api` directory is mapped to `/api/*`. Files in this directory are treated as [API routes](https://nextjs.org/docs/api-routes/introduction) instead of React pages. + +## Learn More + +To learn more about Next.js, take a look at the following resources: + +- [Next.js Documentation](https://nextjs.org/docs) - learn about Next.js features and API. +- [Learn Next.js](https://nextjs.org/learn) - an interactive Next.js tutorial. + +You can check out [the Next.js GitHub repository](https://github.com/vercel/next.js/) - your feedback and contributions are welcome! + +## Deploy on Vercel + +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. + +Check out our [Next.js deployment documentation](https://nextjs.org/docs/deployment) for more details. diff --git a/components/Layout.tsx b/components/Layout.tsx new file mode 100644 index 00000000..2d765942 --- /dev/null +++ b/components/Layout.tsx @@ -0,0 +1,21 @@ +import React, { useState } from 'react' +import { useAppContext } from 'contexts/app' +import Nav from './Nav' + +export default function Layout({ children }) { + const { address, connectWallet } = useAppContext() + + return ( + <> +