diff --git a/.env.local.default b/.env.local.default deleted file mode 100644 index 1817fff..0000000 --- a/.env.local.default +++ /dev/null @@ -1,11 +0,0 @@ -# ~~~ -NEXT_PUBLIC_GOOGLE_ANALYTICS_ID=GA_TEST_1234567890 - -# See https://www.coinbase.com/developer-platform/products/base-node -NEXT_PUBLIC_CDP_API_KEY="CDP_API_KEY_1234567890" - -# ~~~ -NEXT_PUBLIC_ENVIRONMENT=localhost - -# See https://cloud.walletconnect.com/ -NEXT_PUBLIC_WC_PROJECT_ID="TEST_1234567890" diff --git a/.env.local.example b/.env.local.example deleted file mode 100644 index 846e244..0000000 --- a/.env.local.example +++ /dev/null @@ -1,11 +0,0 @@ -# ~~~ -NEXT_PUBLIC_GOOGLE_ANALYTICS_ID= - -# See https://www.coinbase.com/developer-platform/products/base-node -NEXT_PUBLIC_CDP_API_KEY="GET_FROM_COINBASE_DEVELOPER_PLATFORM" - -# ~~~ -NEXT_PUBLIC_ENVIRONMENT=localhost - -# See https://cloud.walletconnect.com/ -NEXT_PUBLIC_WC_PROJECT_ID="GET_FROM_WALLET_CONNECT" diff --git a/.env.test b/.env.test deleted file mode 100644 index 1817fff..0000000 --- a/.env.test +++ /dev/null @@ -1,11 +0,0 @@ -# ~~~ -NEXT_PUBLIC_GOOGLE_ANALYTICS_ID=GA_TEST_1234567890 - -# See https://www.coinbase.com/developer-platform/products/base-node -NEXT_PUBLIC_CDP_API_KEY="CDP_API_KEY_1234567890" - -# ~~~ -NEXT_PUBLIC_ENVIRONMENT=localhost - -# See https://cloud.walletconnect.com/ -NEXT_PUBLIC_WC_PROJECT_ID="TEST_1234567890" diff --git a/.gitignore b/.gitignore index 22b16f3..d57f822 100644 --- a/.gitignore +++ b/.gitignore @@ -23,7 +23,7 @@ yarn-debug.log* yarn-error.log* # local env files -.env*.local +.env # vercel .vercel diff --git a/README.md b/README.md index 17ed35a..e02585e 100644 --- a/README.md +++ b/README.md @@ -1,17 +1,9 @@ -

- - - OnchainKit logo vibes - -

-# Onchain App Template +# Token Machine Template An Onchain App Template build with [OnchainKit](https://onchainkit.xyz), and ready to be deployed to Vercel. -Play with it live on https://onchain-app-template.vercel.app - -Have fun! ⛵️ +The template is a simple swap app made with the OnchainKit [Swap component](https://onchainkit.xyz/docs/swap/swap).
@@ -36,7 +28,10 @@ NEXT_PUBLIC_WC_PROJECT_ID="GET_FROM_WALLET_CONNECT" ```sh # Install bun in case you don't have it -bun curl -fsSL | bash +curl -fsSL https://bun.sh/install | bash # for macOS, Linux, and WSL +# to install a specific version +curl -fsSL https://bun.sh/install | bash -s "bun-v1.0.0" + # Install packages bun i @@ -54,4 +49,4 @@ bun run dev ## License -This project is licensed under the MIT License - see the [LICENSE.md](LICENSE.md) file for details \ No newline at end of file +This project is licensed under the MIT License - see the [LICENSE.md](LICENSE.md) file for details diff --git a/public/favicon.png b/public/favicon.png new file mode 100644 index 0000000..8fa46d4 Binary files /dev/null and b/public/favicon.png differ diff --git a/public/token-community.png b/public/token-community.png new file mode 100644 index 0000000..b06c753 Binary files /dev/null and b/public/token-community.png differ diff --git a/src/app/layout.tsx b/src/app/layout.tsx index 42dc42b..2fccd13 100644 --- a/src/app/layout.tsx +++ b/src/app/layout.tsx @@ -19,10 +19,10 @@ export const viewport = { }; export const metadata: Metadata = { - title: 'Onchain App Template', + title: 'Community Swap', description: 'Built with OnchainKit', openGraph: { - title: 'Onchain App Template', + title: 'Community Swap', description: 'Built with OnchainKit', images: [`${NEXT_PUBLIC_URL}/vibes/vibes-19.png`], }, diff --git a/src/app/page.tsx b/src/app/page.tsx index 1e2fa78..b779084 100644 --- a/src/app/page.tsx +++ b/src/app/page.tsx @@ -2,22 +2,28 @@ import Footer from 'src/components/Footer'; import TransactionWrapper from 'src/components/TransactionWrapper'; import WalletWrapper from 'src/components/WalletWrapper'; -import { ONCHAINKIT_LINK } from 'src/links'; -import OnchainkitSvg from 'src/svg/OnchainkitSvg'; +import { COMMUNITY_LINK } from 'src/links'; +import OnchainkitSvg from 'src/svg/CommunitySvg'; import { useAccount } from 'wagmi'; import LoginButton from '../components/LoginButton'; import SignupButton from '../components/SignupButton'; +import SwapWrapper from 'src/components/SwapWrapper'; +import Image from 'next/image'; +import meetMochi from '../images/meet-mochi.png'; export default function Page() { const { address } = useAccount(); return (
+
+
+
@@ -29,24 +35,18 @@ export default function Page() {
-
-
-
-

- npm install @coinbase/onchainkit -

-
+
+
+ Welcome to Mochi +
+
+

The cutest cat community

+
+
+
- {address ? ( - - ) : ( - - )}
); -} +} \ No newline at end of file diff --git a/src/components/Footer.tsx b/src/components/Footer.tsx index f8f4cc5..3ace9c3 100644 --- a/src/components/Footer.tsx +++ b/src/components/Footer.tsx @@ -4,33 +4,33 @@ import { DISCORD_LINK, FIGMA_LINK, GITHUB_LINK, - ONCHAINKIT_LINK, + COMMUNITY_LINK, TWITTER_LINK, } from 'src/links'; import ArrowSvg from 'src/svg/ArrowSvg'; const docLinks = [ - { href: ONCHAINKIT_LINK, title: 'Docs' }, + { href: COMMUNITY_LINK, title: '$MOCHI' }, { href: GITHUB_LINK, title: 'Github' }, { href: DISCORD_LINK, title: 'Discord' }, - { href: FIGMA_LINK, title: 'Figma' }, + // { href: FIGMA_LINK, title: 'Figma' }, { href: TWITTER_LINK, title: 'X' }, ]; export default function Footer() { return ( -
+
@@ -52,4 +52,4 @@ export default function Footer() {
); -} +} \ No newline at end of file diff --git a/src/components/SwapWrapper.tsx b/src/components/SwapWrapper.tsx new file mode 100644 index 0000000..8592185 --- /dev/null +++ b/src/components/SwapWrapper.tsx @@ -0,0 +1,64 @@ +'use client'; +import { useCallback } from 'react'; +import { Name } from '@coinbase/onchainkit/identity'; +import { + Swap, + SwapAmountInput, + SwapToggleButton, + SwapButton, + SwapMessage +} from '@coinbase/onchainkit/swap'; +import { Wallet, ConnectWallet } from '@coinbase/onchainkit/wallet'; +import { useAccount, useSendTransaction } from 'wagmi'; +import type { Token } from '@coinbase/onchainkit/token'; + +export default function SwapComponents() { + const { address } = useAccount(); + const { sendTransaction } = useSendTransaction(); + + const ETHToken: Token = { + address: "", + chainId: 8453, + decimals: 10, + name: "Ethereum", + symbol: "ETH", + image: "https://dynamic-assets.coinbase.com/dbb4b4983bde81309ddab83eb598358eb44375b930b94687ebe38bc22e52c3b2125258ffb8477a5ef22e33d6bd72e32a506c391caa13af64c00e46613c3e5806/asset_icons/4113b082d21cc5fab17fc8f2d19fb996165bcce635e6900f7fc2d57c4ef33ae9.png" + }; + + const MochiToken: Token = { + address: "0xf6e932ca12afa26665dc4dde7e27be02a7c02e50", + chainId: 8453, + decimals: 6, + name: "Mochi", + symbol: "MOCHI", + image: "https://s2.coinmarketcap.com/static/img/coins/64x64/28478.png" + }; + + const swappableTokens: Token[] = [ETHToken, MochiToken]; + + return ( + address ? ( + + + + + + + + ) : ( + + + + ) + ); +} \ No newline at end of file diff --git a/src/components/WalletWrapper.tsx b/src/components/WalletWrapper.tsx index 7005e65..703e379 100644 --- a/src/components/WalletWrapper.tsx +++ b/src/components/WalletWrapper.tsx @@ -43,7 +43,7 @@ export default function WalletWrapper({ - Go to Wallet Dashboard + Wallet diff --git a/src/images/meet-mochi.png b/src/images/meet-mochi.png new file mode 100644 index 0000000..ef4fb62 Binary files /dev/null and b/src/images/meet-mochi.png differ diff --git a/src/links.ts b/src/links.ts index 421c66d..ef1273e 100644 --- a/src/links.ts +++ b/src/links.ts @@ -1,6 +1,6 @@ export const DISCORD_LINK = 'https://discord.gg/wTJ7besU'; export const FIGMA_LINK = 'https://www.figma.com/community/file/1370194397345450683/onchainkit'; -export const GITHUB_LINK = 'https://github.com/coinbase/onchainkit'; -export const ONCHAINKIT_LINK = 'https://onchainkit.xyz'; -export const TWITTER_LINK = 'https://x.com/Onchainkit'; +export const GITHUB_LINK = 'https://github.com/fakepixels/token-machine'; +export const COMMUNITY_LINK = 'https://mochithecatcoin.com/'; +export const TWITTER_LINK = 'https://x.com/mochi_token'; diff --git a/src/svg/CommunitySvg.tsx b/src/svg/CommunitySvg.tsx new file mode 100644 index 0000000..9c3ce68 --- /dev/null +++ b/src/svg/CommunitySvg.tsx @@ -0,0 +1,14 @@ +export default function CommunitySvg() { + return ( + + Community + + + ); +} diff --git a/tsconfig.json b/tsconfig.json index 697ba86..3835058 100644 --- a/tsconfig.json +++ b/tsconfig.json @@ -1,7 +1,11 @@ { "compilerOptions": { "target": "es2020", - "lib": ["dom", "dom.iterable", "esnext"], + "lib": [ + "dom", + "dom.iterable", + "esnext" + ], "allowJs": true, "skipLibCheck": true, "strict": true, @@ -11,7 +15,7 @@ "moduleResolution": "bundler", "resolveJsonModule": true, "isolatedModules": true, - "jsx": "react-jsx", + "jsx": "preserve", "incremental": true, "plugins": [ { @@ -20,6 +24,13 @@ ], "baseUrl": "." }, - "include": ["next-env.d.ts", "**/*.ts", "**/*.tsx", ".next/types/**/*.ts"], - "exclude": ["node_modules"] + "include": [ + "next-env.d.ts", + "**/*.ts", + "**/*.tsx", + ".next/types/**/*.ts" + ], + "exclude": [ + "node_modules" + ] }