├── .babelrc ├── .eslintignore ├── .eslintrc.json ├── .gitignore ├── Dockerfile ├── LICENSE ├── README.md ├── next-env.d.ts ├── next.config.js ├── package-lock.json ├── package.json ├── postcss.config.js ├── public ├── blockchain (3).gif ├── crypto-camera.png ├── crypto-creation.png ├── crypto-minting.png ├── crypto-trading.png ├── favicon.ico ├── infinite-loader.gif ├── introNft.png ├── logo.svg ├── moneyNft.png ├── next.svg ├── nft-bannerrr.png ├── nft-free-depositphotos-bgremover.png ├── nft-logo.png ├── nft.ico ├── nft2.png ├── nft4.png ├── nft_L-depositphotos-bgremover.png ├── nftfooter.png ├── shopping-shop.gif ├── social-media-influencer.gif ├── solana-love.gif ├── solana.png ├── thirteen.svg ├── vercel.svg ├── web-address-registration.gif └── zyro-image.png ├── scaffold-desktop.png ├── scaffold-mobile.png ├── src ├── components │ ├── AddressForm.tsx │ ├── AppBar.tsx │ ├── CheckAnother.tsx │ ├── ContentContainer.tsx │ ├── FetchCandyMachine.tsx │ ├── FetchNft.tsx │ ├── FetchRandomNft.tsx │ ├── FetchRariableNfts.tsx │ ├── Footer.tsx │ ├── GetRandomNft.tsx │ ├── Heading.tsx │ ├── Info.tsx │ ├── NetworkSwitcher.tsx │ ├── Notification.tsx │ ├── RequestAirdrop.tsx │ └── SolunoGame.tsx ├── contexts │ ├── AutoConnectProvider.tsx │ ├── ContextProvider.tsx │ └── NetworkConfigurationProvider.tsx ├── hooks │ └── useQueryContext.tsx ├── models │ └── types.ts ├── pages │ ├── _app.tsx │ ├── _document.tsx │ ├── api │ │ ├── hello.ts │ │ └── products.json │ ├── candymachine.tsx │ ├── checkwallet.tsx │ ├── display.tsx │ ├── explore.tsx │ ├── index.tsx │ └── soluno.tsx ├── stores │ ├── useNotificationStore.tsx │ └── useUserSOLBalanceStore.tsx ├── styles │ ├── AddressForm.module.css │ ├── custom.module.css │ ├── diamond.module.css │ └── globals.css ├── utils │ ├── explorer.ts │ └── notifications.tsx └── views │ ├── candymachine │ └── index.tsx │ ├── checkwallet │ └── index.tsx │ ├── display │ └── index.tsx │ ├── explore │ └── index.tsx │ ├── home │ ├── index.tsx │ └── infinite-loader.gif │ ├── index.tsx │ └── soluno │ └── index.tsx ├── tailwind.config.js └── tsconfig.json /.babelrc: -------------------------------------------------------------------------------- 1 | { "presets": ["next/babel"] } 2 | -------------------------------------------------------------------------------- /.eslintignore: -------------------------------------------------------------------------------- 1 | node_modules 2 | __generated__ -------------------------------------------------------------------------------- /.eslintrc.json: -------------------------------------------------------------------------------- 1 | { 2 | "extends": ["next/core-web-vitals", "next/babel"] 3 | } 4 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | # See https://help.github.com/articles/ignoring-files/ for more about ignoring files. 2 | commands.sh 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 | 27 | # local env files 28 | .env.local 29 | .env.development.local 30 | .env.test.local 31 | .env.production.local 32 | 33 | # vercel 34 | .vercel 35 | 36 | # typescript 37 | *.tsbuildinfo 38 | 39 | # logs 40 | *.log -------------------------------------------------------------------------------- /Dockerfile: -------------------------------------------------------------------------------- 1 | FROM node:12-alpine 2 | 3 | WORKDIR /opt/app 4 | 5 | ENV NODE_ENV production 6 | 7 | COPY package*.json ./ 8 | 9 | RUN npm ci 10 | 11 | COPY . /opt/app 12 | 13 | RUN npm install --dev && npm run build 14 | 15 | CMD [ "npm", "start" ] -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | Apache License 2 | Version 2.0, January 2004 3 | http://www.apache.org/licenses/ 4 | 5 | TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION 6 | 7 | 1. Definitions. 8 | 9 | "License" shall mean the terms and conditions for use, reproduction, 10 | and distribution as defined by Sections 1 through 9 of this document. 11 | 12 | "Licensor" shall mean the copyright owner or entity authorized by 13 | the copyright owner that is granting the License. 14 | 15 | "Legal Entity" shall mean the union of the acting entity and all 16 | other entities that control, are controlled by, or are under common 17 | control with that entity. For the purposes of this definition, 18 | "control" means (i) the power, direct or indirect, to cause the 19 | direction or management of such entity, whether by contract or 20 | otherwise, or (ii) ownership of fifty percent (50%) or more of the 21 | outstanding shares, or (iii) beneficial ownership of such entity. 22 | 23 | "You" (or "Your") shall mean an individual or Legal Entity 24 | exercising permissions granted by this License. 25 | 26 | "Source" form shall mean the preferred form for making modifications, 27 | including but not limited to software source code, documentation 28 | source, and configuration files. 29 | 30 | "Object" form shall mean any form resulting from mechanical 31 | transformation or translation of a Source form, including but 32 | not limited to compiled object code, generated documentation, 33 | and conversions to other media types. 34 | 35 | "Work" shall mean the work of authorship, whether in Source or 36 | Object form, made available under the License, as indicated by a 37 | copyright notice that is included in or attached to the work 38 | (an example is provided in the Appendix below). 39 | 40 | "Derivative Works" shall mean any work, whether in Source or Object 41 | form, that is based on (or derived from) the Work and for which the 42 | editorial revisions, annotations, elaborations, or other modifications 43 | represent, as a whole, an original work of authorship. For the purposes 44 | of this License, Derivative Works shall not include works that remain 45 | separable from, or merely link (or bind by name) to the interfaces of, 46 | the Work and Derivative Works thereof. 47 | 48 | "Contribution" shall mean any work of authorship, including 49 | the original version of the Work and any modifications or additions 50 | to that Work or Derivative Works thereof, that is intentionally 51 | submitted to Licensor for inclusion in the Work by the copyright owner 52 | or by an individual or Legal Entity authorized to submit on behalf of 53 | the copyright owner. For the purposes of this definition, "submitted" 54 | means any form of electronic, verbal, or written communication sent 55 | to the Licensor or its representatives, including but not limited to 56 | communication on electronic mailing lists, source code control systems, 57 | and issue tracking systems that are managed by, or on behalf of, the 58 | Licensor for the purpose of discussing and improving the Work, but 59 | excluding communication that is conspicuously marked or otherwise 60 | designated in writing by the copyright owner as "Not a Contribution." 61 | 62 | "Contributor" shall mean Licensor and any individual or Legal Entity 63 | on behalf of whom a Contribution has been received by Licensor and 64 | subsequently incorporated within the Work. 65 | 66 | 2. Grant of Copyright License. Subject to the terms and conditions of 67 | this License, each Contributor hereby grants to You a perpetual, 68 | worldwide, non-exclusive, no-charge, royalty-free, irrevocable 69 | copyright license to reproduce, prepare Derivative Works of, 70 | publicly display, publicly perform, sublicense, and distribute the 71 | Work and such Derivative Works in Source or Object form. 72 | 73 | 3. Grant of Patent License. Subject to the terms and conditions of 74 | this License, each Contributor hereby grants to You a perpetual, 75 | worldwide, non-exclusive, no-charge, royalty-free, irrevocable 76 | (except as stated in this section) patent license to make, have made, 77 | use, offer to sell, sell, import, and otherwise transfer the Work, 78 | where such license applies only to those patent claims licensable 79 | by such Contributor that are necessarily infringed by their 80 | Contribution(s) alone or by combination of their Contribution(s) 81 | with the Work to which such Contribution(s) was submitted. If You 82 | institute patent litigation against any entity (including a 83 | cross-claim or counterclaim in a lawsuit) alleging that the Work 84 | or a Contribution incorporated within the Work constitutes direct 85 | or contributory patent infringement, then any patent licenses 86 | granted to You under this License for that Work shall terminate 87 | as of the date such litigation is filed. 88 | 89 | 4. Redistribution. You may reproduce and distribute copies of the 90 | Work or Derivative Works thereof in any medium, with or without 91 | modifications, and in Source or Object form, provided that You 92 | meet the following conditions: 93 | 94 | (a) You must give any other recipients of the Work or 95 | Derivative Works a copy of this License; and 96 | 97 | (b) You must cause any modified files to carry prominent notices 98 | stating that You changed the files; and 99 | 100 | (c) You must retain, in the Source form of any Derivative Works 101 | that You distribute, all copyright, patent, trademark, and 102 | attribution notices from the Source form of the Work, 103 | excluding those notices that do not pertain to any part of 104 | the Derivative Works; and 105 | 106 | (d) If the Work includes a "NOTICE" text file as part of its 107 | distribution, then any Derivative Works that You distribute must 108 | include a readable copy of the attribution notices contained 109 | within such NOTICE file, excluding those notices that do not 110 | pertain to any part of the Derivative Works, in at least one 111 | of the following places: within a NOTICE text file distributed 112 | as part of the Derivative Works; within the Source form or 113 | documentation, if provided along with the Derivative Works; or, 114 | within a display generated by the Derivative Works, if and 115 | wherever such third-party notices normally appear. The contents 116 | of the NOTICE file are for informational purposes only and 117 | do not modify the License. You may add Your own attribution 118 | notices within Derivative Works that You distribute, alongside 119 | or as an addendum to the NOTICE text from the Work, provided 120 | that such additional attribution notices cannot be construed 121 | as modifying the License. 122 | 123 | You may add Your own copyright statement to Your modifications and 124 | may provide additional or different license terms and conditions 125 | for use, reproduction, or distribution of Your modifications, or 126 | for any such Derivative Works as a whole, provided Your use, 127 | reproduction, and distribution of the Work otherwise complies with 128 | the conditions stated in this License. 129 | 130 | 5. Submission of Contributions. Unless You explicitly state otherwise, 131 | any Contribution intentionally submitted for inclusion in the Work 132 | by You to the Licensor shall be under the terms and conditions of 133 | this License, without any additional terms or conditions. 134 | Notwithstanding the above, nothing herein shall supersede or modify 135 | the terms of any separate license agreement you may have executed 136 | with Licensor regarding such Contributions. 137 | 138 | 6. Trademarks. This License does not grant permission to use the trade 139 | names, trademarks, service marks, or product names of the Licensor, 140 | except as required for reasonable and customary use in describing the 141 | origin of the Work and reproducing the content of the NOTICE file. 142 | 143 | 7. Disclaimer of Warranty. Unless required by applicable law or 144 | agreed to in writing, Licensor provides the Work (and each 145 | Contributor provides its Contributions) on an "AS IS" BASIS, 146 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 147 | implied, including, without limitation, any warranties or conditions 148 | of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A 149 | PARTICULAR PURPOSE. You are solely responsible for determining the 150 | appropriateness of using or redistributing the Work and assume any 151 | risks associated with Your exercise of permissions under this License. 152 | 153 | 8. Limitation of Liability. In no event and under no legal theory, 154 | whether in tort (including negligence), contract, or otherwise, 155 | unless required by applicable law (such as deliberate and grossly 156 | negligent acts) or agreed to in writing, shall any Contributor be 157 | liable to You for damages, including any direct, indirect, special, 158 | incidental, or consequential damages of any character arising as a 159 | result of this License or out of the use or inability to use the 160 | Work (including but not limited to damages for loss of goodwill, 161 | work stoppage, computer failure or malfunction, or any and all 162 | other commercial damages or losses), even if such Contributor 163 | has been advised of the possibility of such damages. 164 | 165 | 9. Accepting Warranty or Additional Liability. While redistributing 166 | the Work or Derivative Works thereof, You may choose to offer, 167 | and charge a fee for, acceptance of support, warranty, indemnity, 168 | or other liability obligations and/or rights consistent with this 169 | License. However, in accepting such obligations, You may act only 170 | on Your own behalf and on Your sole responsibility, not on behalf 171 | of any other Contributor, and only if You agree to indemnify, 172 | defend, and hold each Contributor harmless for any liability 173 | incurred by, or claims asserted against, such Contributor by reason 174 | of your accepting any such warranty or additional liability. 175 | 176 | END OF TERMS AND CONDITIONS 177 | 178 | APPENDIX: How to apply the Apache License to your work. 179 | 180 | To apply the Apache License to your work, attach the following 181 | boilerplate notice, with the fields enclosed by brackets "[]" 182 | replaced with your own identifying information. (Don't include 183 | the brackets!) The text should be enclosed in the appropriate 184 | comment syntax for the file format. We also recommend that a 185 | file or class name and description of purpose be included on the 186 | same "printed page" as the copyright notice for easier 187 | identification within third-party archives. 188 | 189 | Copyright [yyyy] [name of copyright owner] 190 | 191 | Licensed under the Apache License, Version 2.0 (the "License"); 192 | you may not use this file except in compliance with the License. 193 | You may obtain a copy of the License at 194 | 195 | http://www.apache.org/licenses/LICENSE-2.0 196 | 197 | Unless required by applicable law or agreed to in writing, software 198 | distributed under the License is distributed on an "AS IS" BASIS, 199 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 200 | See the License for the specific language governing permissions and 201 | limitations under the License. 202 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | ## Solana Nft Marketplace (FinalProjectSolana) [![](https://img.shields.io/badge/nftmarketsolana-blueviolet?style=for-the-badge)](https://nftmarketsolana.vercel.app/) 2 | * ## :dart: ${\color{green}In\ this\ project\ you\ have\ to\ know:}$ 3 | 4 |
5 | 6 | Next 7 | 8 | 9 | 10 |
11 | 12 | --- 13 | 14 | * ## 🛠 ${\color{green}Install\ dependencies}$ 15 | 16 | ```ruby 17 | npm install @metaplex-foundation/js 18 | npm install @solana/wallet-adapter-base 19 | npm install @solana/wallet-adapter-react-ui 20 | npm install @tailwindcss/typography 21 | npm install typewriter-effect 22 | npm install @solana/web3.js 23 | 24 | ``` 25 | 26 | Responsive | Desktop 27 | :-------------------------:|:-------------------------: 28 | ![image](https://user-images.githubusercontent.com/109158340/211107037-ed5e8c13-731d-4e08-8a66-62cc34ea7406.png) | ![image](https://user-images.githubusercontent.com/109158340/211107207-1049b8d5-74cd-465a-8c0d-136db1cf8a94.png) 29 | 30 | 31 | * ## ☝ ${\color{green}With\ this\ App}$ 🚀 32 | 33 | Solana | NftMarketplace 34 | :-------------------------:|:-------------------------: 35 | ![image](https://user-images.githubusercontent.com/109158340/211107853-76da87a3-7d72-48b4-a359-1d33ddd6bc2d.png) | ![image](https://user-images.githubusercontent.com/109158340/211110422-6cd99080-3fd9-4b50-8811-2ce0c023eb47.png) 36 | 37 | ![image](https://user-images.githubusercontent.com/109158340/211157024-2b45fcfd-5ad0-4a89-bcf9-2bafabb0330b.png) 38 | 39 | --- 40 | * ## 📝 ${\color{green}Let's\ start}$ 41 | To run this repo : 42 | ``` 43 | npm install 44 | ``` 45 | or 46 | ``` 47 | yarn install 48 | ``` 49 | >__Warning__ Please be sure that you install all dependencies! 50 | 51 | And write in your terminal : 52 | 53 | ``` 54 | npm run dev 55 | ``` 56 | 57 | And have fun 🎉 58 | 59 | * ## ☕ ${\color{green}Let's\ scroll\ through\ the\ pages}$ 60 | 61 | > [![](https://img.shields.io/badge/CheckWallet-blueviolet?style=for-the-badge)](https://nftmarketsolana.vercel.app/checkwallet) 62 | * ### 👀 ${With\ this\ page\ you\ can\ learn\ your\ balance\ and\ airdrop\ to\ your\ account.}$ 63 | ![image](https://user-images.githubusercontent.com/109158340/211146778-c8001894-13c7-4013-a10a-2e8d85b44bdc.png) 64 | --- 65 | > [![](https://img.shields.io/badge/DisplayNfts-blueviolet?style=for-the-badge)](https://nftmarketsolana.vercel.app/display) 66 | * ### 🛠 ${If\ you\ have\ Nfts\ in\ your\ account\ this\ page\ displays\ your\ all\ nfts\ automaticly.}$ 67 | ![image](https://user-images.githubusercontent.com/109158340/211146824-b87dd13c-de20-499d-9a6b-a90120f0510b.png) 68 | --- 69 | > [![](https://img.shields.io/badge/Explore-blueviolet?style=for-the-badge)](https://nftmarketsolana.vercel.app/explore) 70 | * ### ✨ ${Explore !!!\ You\ can\ explore\ and\ filter\ Nfts\ by\ names.}$ 71 | ![image](https://user-images.githubusercontent.com/109158340/211187603-9dad12f4-1de1-4535-a82b-c3d0173fb8b0.png) 72 | --- 73 | > [![](https://img.shields.io/badge/CandyMachineNfts-blueviolet?style=for-the-badge)](https://nftmarketsolana.vercel.app/candymachine) 74 | * ### 🍭 ${If\ you\ have\ cany\ machine\ addres\ you\ can\ easily\ get\ your\ nfts\ from\ candy\ machine.}$ 75 | > If you have no address you can try with mine : 76 | ``` 77 | 2uE3z1PKT9EERK1pkxBt1pzmtmJXdFqYM2pMzwHUVHTy 78 | ``` 79 | ![image](https://user-images.githubusercontent.com/109158340/211147092-68ec1f79-c64f-4bd8-96b4-50e8ed55ed9c.png) 80 | 81 | 82 | 83 | 84 | 85 | 86 | 87 | 88 | 89 | 90 | -------------------------------------------------------------------------------- /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 | -------------------------------------------------------------------------------- /next.config.js: -------------------------------------------------------------------------------- 1 | /** @type {import('next').NextConfig} */ 2 | const nextConfig = { 3 | reactStrictMode: true, 4 | } 5 | 6 | module.exports = nextConfig 7 | -------------------------------------------------------------------------------- /package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "solana-dapp-next", 3 | "version": "0.1.0", 4 | "license": "MIT", 5 | "private": false, 6 | "scripts": { 7 | "dev": "next dev", 8 | "build": "next build", 9 | "start": "next start", 10 | "lint": "next lint" 11 | }, 12 | "dependencies": { 13 | "@emotion/react": "^11.10.5", 14 | "@emotion/styled": "^11.10.5", 15 | "@heroicons/react": "^1.0.5", 16 | "@metaplex-foundation/js": "^0.15.0", 17 | "@mui/material": "^5.11.3", 18 | "@solana/wallet-adapter-base": "^0.9.3", 19 | "@solana/wallet-adapter-react": "^0.15.3", 20 | "@solana/wallet-adapter-react-ui": "^0.9.5", 21 | "@solana/wallet-adapter-wallets": "^0.15.3", 22 | "@solana/web3.js": "^1.53.0", 23 | "@tailwindcss/typography": "^0.5.0", 24 | "daisyui": "^1.24.3", 25 | "immer": "^9.0.12", 26 | "next": "12.0.8", 27 | "next-compose-plugins": "^2.2.1", 28 | "next-transpile-modules": "^9.0.0", 29 | "react": "17.0.2", 30 | "react-dom": "17.0.2", 31 | "typewriter-effect": "^2.19.0", 32 | "zustand": "^3.6.9" 33 | }, 34 | "devDependencies": { 35 | "@types/node": "17.0.10", 36 | "@types/react": "17.0.38", 37 | "autoprefixer": "^10.4.2", 38 | "eslint": "8.7.0", 39 | "eslint-config-next": "12.0.8", 40 | "postcss": "^8.4.5", 41 | "tailwindcss": "^3.0.15", 42 | "typescript": "4.5.4" 43 | } 44 | } 45 | -------------------------------------------------------------------------------- /postcss.config.js: -------------------------------------------------------------------------------- 1 | module.exports = { 2 | plugins: { 3 | tailwindcss: {}, 4 | autoprefixer: {}, 5 | }, 6 | } 7 | -------------------------------------------------------------------------------- /public/blockchain (3).gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rust-trust/solana-nftMarketplace/8ff728298b38f39b3770580cee2f3183d13bcc7a/public/blockchain (3).gif -------------------------------------------------------------------------------- /public/crypto-camera.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rust-trust/solana-nftMarketplace/8ff728298b38f39b3770580cee2f3183d13bcc7a/public/crypto-camera.png -------------------------------------------------------------------------------- /public/crypto-creation.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rust-trust/solana-nftMarketplace/8ff728298b38f39b3770580cee2f3183d13bcc7a/public/crypto-creation.png -------------------------------------------------------------------------------- /public/crypto-minting.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rust-trust/solana-nftMarketplace/8ff728298b38f39b3770580cee2f3183d13bcc7a/public/crypto-minting.png -------------------------------------------------------------------------------- /public/crypto-trading.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rust-trust/solana-nftMarketplace/8ff728298b38f39b3770580cee2f3183d13bcc7a/public/crypto-trading.png -------------------------------------------------------------------------------- /public/favicon.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rust-trust/solana-nftMarketplace/8ff728298b38f39b3770580cee2f3183d13bcc7a/public/favicon.ico -------------------------------------------------------------------------------- /public/infinite-loader.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rust-trust/solana-nftMarketplace/8ff728298b38f39b3770580cee2f3183d13bcc7a/public/infinite-loader.gif -------------------------------------------------------------------------------- /public/introNft.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rust-trust/solana-nftMarketplace/8ff728298b38f39b3770580cee2f3183d13bcc7a/public/introNft.png -------------------------------------------------------------------------------- /public/logo.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | -------------------------------------------------------------------------------- /public/moneyNft.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rust-trust/solana-nftMarketplace/8ff728298b38f39b3770580cee2f3183d13bcc7a/public/moneyNft.png -------------------------------------------------------------------------------- /public/next.svg: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /public/nft-bannerrr.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rust-trust/solana-nftMarketplace/8ff728298b38f39b3770580cee2f3183d13bcc7a/public/nft-bannerrr.png -------------------------------------------------------------------------------- /public/nft-free-depositphotos-bgremover.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rust-trust/solana-nftMarketplace/8ff728298b38f39b3770580cee2f3183d13bcc7a/public/nft-free-depositphotos-bgremover.png -------------------------------------------------------------------------------- /public/nft-logo.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rust-trust/solana-nftMarketplace/8ff728298b38f39b3770580cee2f3183d13bcc7a/public/nft-logo.png -------------------------------------------------------------------------------- /public/nft.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rust-trust/solana-nftMarketplace/8ff728298b38f39b3770580cee2f3183d13bcc7a/public/nft.ico -------------------------------------------------------------------------------- /public/nft2.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rust-trust/solana-nftMarketplace/8ff728298b38f39b3770580cee2f3183d13bcc7a/public/nft2.png -------------------------------------------------------------------------------- /public/nft4.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rust-trust/solana-nftMarketplace/8ff728298b38f39b3770580cee2f3183d13bcc7a/public/nft4.png -------------------------------------------------------------------------------- /public/nft_L-depositphotos-bgremover.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rust-trust/solana-nftMarketplace/8ff728298b38f39b3770580cee2f3183d13bcc7a/public/nft_L-depositphotos-bgremover.png -------------------------------------------------------------------------------- /public/nftfooter.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rust-trust/solana-nftMarketplace/8ff728298b38f39b3770580cee2f3183d13bcc7a/public/nftfooter.png -------------------------------------------------------------------------------- /public/shopping-shop.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rust-trust/solana-nftMarketplace/8ff728298b38f39b3770580cee2f3183d13bcc7a/public/shopping-shop.gif -------------------------------------------------------------------------------- /public/social-media-influencer.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rust-trust/solana-nftMarketplace/8ff728298b38f39b3770580cee2f3183d13bcc7a/public/social-media-influencer.gif -------------------------------------------------------------------------------- /public/solana-love.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rust-trust/solana-nftMarketplace/8ff728298b38f39b3770580cee2f3183d13bcc7a/public/solana-love.gif -------------------------------------------------------------------------------- /public/solana.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rust-trust/solana-nftMarketplace/8ff728298b38f39b3770580cee2f3183d13bcc7a/public/solana.png -------------------------------------------------------------------------------- /public/thirteen.svg: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /public/vercel.svg: -------------------------------------------------------------------------------- 1 | 3 | 4 | -------------------------------------------------------------------------------- /public/web-address-registration.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rust-trust/solana-nftMarketplace/8ff728298b38f39b3770580cee2f3183d13bcc7a/public/web-address-registration.gif -------------------------------------------------------------------------------- /public/zyro-image.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rust-trust/solana-nftMarketplace/8ff728298b38f39b3770580cee2f3183d13bcc7a/public/zyro-image.png -------------------------------------------------------------------------------- /scaffold-desktop.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rust-trust/solana-nftMarketplace/8ff728298b38f39b3770580cee2f3183d13bcc7a/scaffold-desktop.png -------------------------------------------------------------------------------- /scaffold-mobile.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rust-trust/solana-nftMarketplace/8ff728298b38f39b3770580cee2f3183d13bcc7a/scaffold-mobile.png -------------------------------------------------------------------------------- /src/components/AddressForm.tsx: -------------------------------------------------------------------------------- 1 | import React, { ChangeEvent, FormEvent, useState } from 'react'; 2 | import styles from '../styles/AddressForm.module.css' 3 | 4 | function AddressForm(props: { handler: (address: string) => void }) { 5 | 6 | const [values, setValues] = useState({ 7 | address: '', 8 | }); 9 | 10 | const handleSubmit = (e: FormEvent) => { 11 | e.preventDefault(); 12 | props.handler(values.address) 13 | }; 14 | 15 | const handleAddressInputChange = (event: ChangeEvent) => { 16 | event.persist(); 17 | setValues((values) => ({ 18 | ...values, 19 | address: event.target.value, 20 | })); 21 | }; 22 | 23 | return ( 24 |
25 |
26 | 35 |
36 | 37 | 43 |
44 |
45 | ); 46 | } 47 | 48 | export default AddressForm; -------------------------------------------------------------------------------- /src/components/AppBar.tsx: -------------------------------------------------------------------------------- 1 | import { FC } from "react" 2 | import Link from "next/link" 3 | import { WalletMultiButton } from "@solana/wallet-adapter-react-ui" 4 | import { useAutoConnect } from "../contexts/AutoConnectProvider" 5 | import NetworkSwitcher from "./NetworkSwitcher" 6 | import SolLogo from "../../public/nft4.png" 7 | import styles from "../styles/custom.module.css" 8 | 9 | export const AppBar: FC = (props) => { 10 | const { autoConnect, setAutoConnect } = useAutoConnect() 11 | 12 | return ( 13 |
14 | {/* NavBar / Header */} 15 |
16 |
17 | 32 | 33 |
34 | 35 | 42 | 43 | 47 | 51 | 55 | 59 | 63 | 67 | 71 | 72 | 73 | 74 |
75 |
76 | 77 | {/* Nav Links */} 78 |
79 |
80 | 81 | Home 82 | 83 | 84 | Check Wallet 85 | 86 | 87 | Display NFT 88 | 89 | 90 | Explore 91 | 92 | 93 | Candy Machine 94 | 95 | 96 | SolUNO 97 | 98 |
99 |
100 | 101 | {/* Wallet & Settings */} 102 |
103 | 104 | 105 |
106 |
107 | 114 | 120 | 126 | 127 |
128 |
    132 |
  • 133 |
    134 | 143 | 144 | 145 |
    146 |
  • 147 |
148 |
149 |
150 |
151 | {props.children} 152 |
153 | ) 154 | } 155 | -------------------------------------------------------------------------------- /src/components/CheckAnother.tsx: -------------------------------------------------------------------------------- 1 | 2 | import { useState } from 'react' 3 | import styles from '../styles/AddressForm.module.css' 4 | import AddressForm from '../components/AddressForm' 5 | import * as Web3 from '@solana/web3.js' 6 | 7 | const CheckAnother = () => { 8 | const [balance, setBalance] = useState(0) 9 | const [address, setAddress] = useState('') 10 | const [isExecutable, setIsExecutable] = useState(false); 11 | 12 | //This will validate that whatever you pass in is actually a Solana address 13 | const addressSubmittedHandler = (address: string) => { 14 | try { 15 | setAddress(address) 16 | const key = new Web3.PublicKey(address) 17 | const connection = new Web3.Connection(Web3.clusterApiUrl('devnet')) 18 | 19 | connection.getBalance(key).then(balance => { 20 | setBalance(balance / Web3.LAMPORTS_PER_SOL) 21 | }) 22 | 23 | connection.getAccountInfo(key).then(info => { 24 | setIsExecutable(info?.executable ?? false); 25 | }) 26 | } catch (error) { 27 | setAddress('') 28 | setBalance(0) 29 | alert(error) 30 | } 31 | } 32 | 33 | return ( 34 |
35 |
36 |
37 |

38 | Check Your Wallet 39 |

40 | 41 | 42 |

{`Address: ${address}`}

43 |

{`Balance: ${balance} SOL`}

44 |

{`Is it executable? ${isExecutable ? 'Yep' : 'Nope'}`}

45 |
46 |
47 | 48 |
49 | 50 | ) 51 | } 52 | 53 | export default CheckAnother -------------------------------------------------------------------------------- /src/components/ContentContainer.tsx: -------------------------------------------------------------------------------- 1 | import { FC } from "react" 2 | import Link from "next/link" 3 | export const ContentContainer: FC = (props) => { 4 | return ( 5 |
6 | {/*
*/} 7 | 8 |
{props.children}
9 | 10 | {/* SideBar / Drawer */} 11 |
12 | 13 | 49 |
50 |
51 | ) 52 | } 53 | -------------------------------------------------------------------------------- /src/components/FetchCandyMachine.tsx: -------------------------------------------------------------------------------- 1 | import { useConnection } from "@solana/wallet-adapter-react" 2 | import { PublicKey } from "@solana/web3.js" 3 | import { Metaplex } from "@metaplex-foundation/js" 4 | import { FC, useEffect, useState } from "react" 5 | import styles from "../styles/custom.module.css" 6 | 7 | export const FetchCandyMachine: FC = () => { 8 | const [candyMachineAddress, setCandyMachineAddress] = useState( 9 | null 10 | ) 11 | const [candyMachineData, setCandyMachineData] = useState(null) 12 | const [pageItems, setPageItems] = useState(null) 13 | const [page, setPage] = useState(1) 14 | 15 | const { connection } = useConnection() 16 | const metaplex = Metaplex.make(connection) 17 | 18 | // fetch candymachine by address 19 | const fetchCandyMachine = async () => { 20 | // reset page to 1 21 | setPage(1) 22 | 23 | // fetch candymachine data 24 | try { 25 | const candyMachine = await metaplex 26 | .candyMachines() 27 | .findByAddress({ address: new PublicKey(candyMachineAddress) }) 28 | .run() 29 | 30 | setCandyMachineData(candyMachine) 31 | } catch (e) { 32 | alert("Please submit a valid CMv2 address.") 33 | } 34 | } 35 | 36 | // paging 37 | const getPage = async (page, perPage) => { 38 | const pageItems = candyMachineData.items.slice( 39 | (page - 1) * perPage, 40 | page * perPage 41 | ) 42 | 43 | // fetch metadata of NFTs for page 44 | let nftData = [] 45 | for (let i = 0; i < pageItems.length; i++) { 46 | let fetchResult = await fetch(pageItems[i].uri) 47 | let json = await fetchResult.json() 48 | nftData.push(json) 49 | console.log(nftData); 50 | 51 | } 52 | console.log(nftData) 53 | // set state 54 | setPageItems(nftData) 55 | } 56 | 57 | // previous page 58 | const prev = async () => { 59 | if (page - 1 < 1) { 60 | setPage(1) 61 | } else { 62 | setPage(page - 1) 63 | } 64 | } 65 | 66 | // next page 67 | const next = async () => { 68 | setPage(page + 1) 69 | } 70 | 71 | // fetch placeholder candy machine on load 72 | useEffect(() => { 73 | fetchCandyMachine() 74 | }, []) 75 | 76 | // fetch metadata for NFTs when page or candy machine changes 77 | useEffect(() => { 78 | if (!candyMachineData) { 79 | return 80 | } 81 | getPage(page, 3) 82 | }, [candyMachineData, page]) 83 | 84 | return ( 85 |
86 | setCandyMachineAddress(e.target.value)} 91 | /> 92 | 98 | 99 | {candyMachineData && ( 100 |
101 |
    Candy Machine Address: {candyMachineData.address.toString()}
102 |
103 | )} 104 | 105 | {pageItems && ( 106 |
107 |
108 | {pageItems.map((nft) => ( 109 |
110 |
111 | {nft.name} 116 |
117 |
{nft.name}
118 |
119 |
120 |
121 | ))} 122 |
123 | 129 | 135 |
136 | )} 137 |
138 | ) 139 | } 140 | -------------------------------------------------------------------------------- /src/components/FetchNft.tsx: -------------------------------------------------------------------------------- 1 | import { useConnection, useWallet } from "@solana/wallet-adapter-react" 2 | import { Metaplex, walletAdapterIdentity } from "@metaplex-foundation/js" 3 | import { FC, useEffect, useState } from "react" 4 | import styles from "../styles/custom.module.css" 5 | 6 | export const FetchNft: FC = () => { 7 | const [nftData, setNftData] = useState(null) 8 | 9 | const { connection } = useConnection() 10 | const wallet = useWallet() 11 | const metaplex = Metaplex.make(connection).use(walletAdapterIdentity(wallet)) 12 | 13 | // fetch nfts 14 | const fetchNfts = async () => { 15 | if (!wallet.connected) { 16 | return 17 | } 18 | 19 | // fetch NFTs for connected wallet 20 | const nfts = await metaplex 21 | .nfts() 22 | .findAllByOwner({ owner: wallet.publicKey }) 23 | .run() 24 | 25 | // fetch off chain metadata for each NFT 26 | let nftData = [] 27 | for (let i = 0; i < nfts.length; i++) { 28 | let fetchResult = await fetch(nfts[i].uri) 29 | let json = await fetchResult.json() 30 | nftData.push(json) 31 | } 32 | 33 | // set state 34 | setNftData(nftData) 35 | } 36 | 37 | // fetch nfts when connected wallet changes 38 | useEffect(() => { 39 | fetchNfts() 40 | }, [wallet]) 41 | 42 | return ( 43 |
44 | {nftData && ( 45 |
46 | {nftData.map((nft) => ( 47 |
48 | 49 |
50 |
51 | {nft.name} 56 |
57 |
58 |
59 |
60 |
{nft.name}
61 | 62 |
63 |
64 |
65 |
66 | {/*
{nft?.blockchain}
*/} 67 | 68 |
69 |
70 | 71 |
72 | 78 |
79 | 80 |
81 |
82 |
83 | ))} 84 |
85 | )} 86 |
87 | ) 88 | } 89 | 90 | -------------------------------------------------------------------------------- /src/components/FetchRandomNft.tsx: -------------------------------------------------------------------------------- 1 | import { FC, useEffect, useState } from "react" 2 | import styles from "../styles/custom.module.css" 3 | import axios from "axios"; 4 | 5 | export const FetchRandomNft: FC = () => { 6 | 7 | const [address, setAddress] = useState(null); 8 | const [nfts, setNfts] = useState([]); 9 | const [pageItems, setPageItems] = useState(null) 10 | const [page, setPage] = useState(1) 11 | 12 | // 41xhAz1SqXPLRMVC4ZjDs6yh92T88w8rrquDNy6fqbPc 13 | // 7TXr6pVsMVEjXk92wsVpQZkRjKD6KQx7a5kEkZjFd6h9 14 | // DSwfRF1jhhu6HpSuzaig1G19kzP73PfLZBPLofkw6fLD 15 | // GoLMLLR6iSUrA6KsCrFh7f45Uq5EHFQ3p8RmzPoUH9mb 16 | 17 | async function getNftData(user_id){ 18 | const {data: user} = await axios( 19 | "https://jsonplaceholder.typicode.com/users/" + user_id 20 | ); 21 | 22 | const {data: post} = await axios( 23 | "https://jsonplaceholder.typicode.com/posts?userId=" + user_id 24 | ); 25 | 26 | user.post = post 27 | 28 | console.log(user); 29 | } 30 | 31 | 32 | 33 | 34 | 35 | // useEffect(() => { 36 | // getNftData(); 37 | // }, [address]); 38 | 39 | 40 | 41 | return ( 42 |
43 | 44 | 45 | 46 |
47 | 48 | 49 | ) 50 | } 51 | -------------------------------------------------------------------------------- /src/components/FetchRariableNfts.tsx: -------------------------------------------------------------------------------- 1 | import { FC, useEffect, useState } from "react" 2 | import styles from "../styles/custom.module.css" 3 | 4 | export const FetchRariableNfts: FC = () => { 5 | 6 | const [address, setAddress] = useState(null); 7 | const [nfts, setNfts] = useState([]); 8 | const [pageItems, setPageItems] = useState(null) 9 | const [page, setPage] = useState(1) 10 | 11 | // 41xhAz1SqXPLRMVC4ZjDs6yh92T88w8rrquDNy6fqbPc 12 | // 7TXr6pVsMVEjXk92wsVpQZkRjKD6KQx7a5kEkZjFd6h9 13 | // DSwfRF1jhhu6HpSuzaig1G19kzP73PfLZBPLofkw6fLD 14 | // GoLMLLR6iSUrA6KsCrFh7f45Uq5EHFQ3p8RmzPoUH9mb 15 | 16 | const getNftData = async () => { 17 | const response = await fetch( 18 | 19 | " https://api.rarible.org/v0.1/items/byCollection?collection=SOLANA:DSwfRF1jhhu6HpSuzaig1G19kzP73PfLZBPLofkw6fLD" 20 | ); 21 | const data = await response.json(); 22 | setNfts(data.items); 23 | console.log(data); 24 | }; 25 | 26 | useEffect(() => { 27 | getNftData(); 28 | }, [address]); 29 | 30 | 31 | 32 | return ( 33 |
34 | 35 |
36 | {nfts.map((nft) => ( 37 |
38 |
39 | {nft?.meta?.name} 44 |
45 |
46 |
47 |
48 |
{nft?.meta?.name}
49 | 50 |
51 |
52 |
53 |
54 |
{nft?.blockchain}
55 | 56 |
57 |
58 | 59 |
60 | 66 | {/*
67 |
68 | 74 |
75 |
76 |
77 |
{nft?.blockchain}
78 | 79 |
80 |
81 | 82 | 83 |
*/} 84 | 85 | 86 |
87 | 88 |
89 |
90 | ))} 91 |
92 | 93 |
94 | 95 | 96 | ) 97 | } 98 | -------------------------------------------------------------------------------- /src/components/Footer.tsx: -------------------------------------------------------------------------------- 1 | import { FC } from 'react'; 2 | import styles from "../styles/custom.module.css" 3 | import SolLogo from "../../public/nft4.png" 4 | 5 | export const Footer: FC = () => { 6 | return ( 7 |
8 | 55 |
56 | ); 57 | }; 58 | -------------------------------------------------------------------------------- /src/components/GetRandomNft.tsx: -------------------------------------------------------------------------------- 1 | import React from 'react' 2 | import { useEffect, useState } from "react"; 3 | 4 | // https://api.rarible.org/v0.1/items/byOwner/?owner=ETHEREUM:0x4765273c477c2dc484da4f1984639e943adccfeb 5 | const GetRandomNft = () => { 6 | 7 | const [nfts, setNfts] = useState([]); 8 | const [address, setAddress] = useState(null); 9 | 10 | const getNftData = async () => { 11 | const response = await fetch( 12 | " https://api.rarible.org/v0.1/items/byOwner/?owner=ETHEREUM:0x4765273c477c2dc484da4f1984639e943adccfeb" 13 | ); 14 | const data = await response.json(); 15 | setNfts(data.items); 16 | console.log(data); 17 | }; 18 | 19 | useEffect(() => { 20 | getNftData(); 21 | }, [address]); 22 | 23 | // const randomNft = data[Math.floor(Math.random() * data.length)]; 24 | return ( 25 |
26 | 29 |
30 | 31 |
32 |
33 | ) 34 | } 35 | export default GetRandomNft 36 | -------------------------------------------------------------------------------- /src/components/Heading.tsx: -------------------------------------------------------------------------------- 1 | import React from "react"; 2 | import styles from "../styles/custom.module.css" 3 | 4 | function Heading({ title }) { 5 | return ( 6 |
7 |

{title}

8 |
9 |
10 | ); 11 | } 12 | 13 | export default Heading; -------------------------------------------------------------------------------- /src/components/Info.tsx: -------------------------------------------------------------------------------- 1 | import React from "react"; 2 | import infoimage from "../../public/nft2.png"; 3 | import styles from "../styles/diamond.module.css" 4 | import Heading from "./Heading"; 5 | // Collectible items, Music and media, Gaming,Sports Moments 6 | // className=" text-center mt-2 w-80 h-1 border-0 bg-white ml-50 " 7 | 8 | const Info = () => { 9 | return ( 10 |
11 | 12 | 13 |
14 |
15 |
16 |
17 | < img src={infoimage.src} alt="" className={styles.leftImage} /> 18 |
19 | 20 | 21 |
22 |
23 | 24 | 25 |
26 |
27 | 28 |
29 | 30 |
31 |
32 | diamond1 37 |
38 |
39 | diamond1 44 |
45 |
46 | diamond1 51 |
52 |
53 | diamond1 58 |
59 | 60 | 61 |
62 |
63 |
64 | 65 |
66 |
67 |
68 | 69 | 70 | ); 71 | }; 72 | 73 | export default Info; 74 | -------------------------------------------------------------------------------- /src/components/NetworkSwitcher.tsx: -------------------------------------------------------------------------------- 1 | import { FC } from 'react'; 2 | import dynamic from 'next/dynamic'; 3 | import { useNetworkConfiguration } from '../contexts/NetworkConfigurationProvider'; 4 | 5 | const NetworkSwitcher: FC = () => { 6 | const { networkConfiguration, setNetworkConfiguration } = useNetworkConfiguration(); 7 | 8 | console.log(networkConfiguration); 9 | 10 | return ( 11 | 23 | ); 24 | }; 25 | 26 | export default dynamic(() => Promise.resolve(NetworkSwitcher), { 27 | ssr: false 28 | }) -------------------------------------------------------------------------------- /src/components/Notification.tsx: -------------------------------------------------------------------------------- 1 | import { useEffect, useState } from 'react' 2 | import { 3 | CheckCircleIcon, 4 | InformationCircleIcon, 5 | XCircleIcon, 6 | } from '@heroicons/react/outline' 7 | import { XIcon } from '@heroicons/react/solid' 8 | import useNotificationStore from '../stores/useNotificationStore' 9 | import { useConnection } from '@solana/wallet-adapter-react'; 10 | import { getExplorerUrl } from '../utils/explorer' 11 | import { useNetworkConfiguration } from 'contexts/NetworkConfigurationProvider'; 12 | 13 | const NotificationList = () => { 14 | const { notifications, set: setNotificationStore } = useNotificationStore( 15 | (s) => s 16 | ) 17 | 18 | const reversedNotifications = [...notifications].reverse() 19 | 20 | return ( 21 |
24 |
25 | {reversedNotifications.map((n, idx) => ( 26 | { 33 | setNotificationStore((state: any) => { 34 | const reversedIndex = reversedNotifications.length - 1 - idx; 35 | state.notifications = [ 36 | ...notifications.slice(0, reversedIndex), 37 | ...notifications.slice(reversedIndex + 1), 38 | ]; 39 | }); 40 | }} 41 | /> 42 | ))} 43 |
44 |
45 | ); 46 | } 47 | 48 | const Notification = ({ type, message, description, txid, onHide }) => { 49 | const { connection } = useConnection(); 50 | const { networkConfiguration } = useNetworkConfiguration(); 51 | 52 | // TODO: we dont have access to the network or endpoint here.. 53 | // getExplorerUrl(connection., txid, 'tx') 54 | // Either a provider, context, and or wallet adapter related pro/contx need updated 55 | 56 | 57 | useEffect(() => { 58 | const id = setTimeout(() => { 59 | onHide() 60 | }, 8000); 61 | 62 | return () => { 63 | clearInterval(id); 64 | }; 65 | }, [onHide]); 66 | 67 | return ( 68 |
71 |
72 |
73 |
74 | {type === 'success' ? ( 75 | 76 | ) : null} 77 | {type === 'info' && } 78 | {type === 'error' && ( 79 | 80 | )} 81 |
82 |
83 |
{message}
84 | {description ? ( 85 |

{description}

86 | ) : null} 87 | {txid ? ( 88 | 102 | ) : null} 103 |
104 |
105 | 112 |
113 |
114 |
115 |
116 | ) 117 | } 118 | 119 | export default NotificationList 120 | -------------------------------------------------------------------------------- /src/components/RequestAirdrop.tsx: -------------------------------------------------------------------------------- 1 | import { useConnection, useWallet } from '@solana/wallet-adapter-react'; 2 | import { LAMPORTS_PER_SOL, TransactionSignature } from '@solana/web3.js'; 3 | import { FC, useCallback } from 'react'; 4 | import { notify } from "../utils/notifications"; 5 | import useUserSOLBalanceStore from '../stores/useUserSOLBalanceStore'; 6 | 7 | export const RequestAirdrop: FC = () => { 8 | const { connection } = useConnection(); 9 | const { publicKey } = useWallet(); 10 | const { getUserSOLBalance } = useUserSOLBalanceStore(); 11 | 12 | const onClick = useCallback(async () => { 13 | if (!publicKey) { 14 | console.log('error', 'Wallet not connected!'); 15 | notify({ type: 'error', message: 'error', description: 'Wallet not connected!' }); 16 | return; 17 | } 18 | 19 | let signature: TransactionSignature = ''; 20 | 21 | try { 22 | signature = await connection.requestAirdrop(publicKey, LAMPORTS_PER_SOL); 23 | await connection.confirmTransaction(signature, 'confirmed'); 24 | notify({ type: 'success', message: 'Airdrop successful!', txid: signature }); 25 | 26 | getUserSOLBalance(publicKey, connection); 27 | } catch (error: any) { 28 | notify({ type: 'error', message: `Airdrop failed!`, description: error?.message, txid: signature }); 29 | console.log('error', `Airdrop failed! ${error?.message}`, signature); 30 | } 31 | }, [publicKey, connection, getUserSOLBalance]); 32 | 33 | return ( 34 |
35 | 41 |
42 | ); 43 | }; 44 | 45 | -------------------------------------------------------------------------------- /src/components/SolunoGame.tsx: -------------------------------------------------------------------------------- 1 | import React from 'react' 2 | import Link from "next/link" 3 | import GetNftData from "../components/GetRandomNft" 4 | 5 | function SolunoGame() { 6 | return ( 7 |
8 |
9 |
10 |
11 | 12 | 13 |
14 |
15 | 16 | 22 | 28 | 29 |
30 | 31 |
32 |
33 |
34 | ) 35 | } 36 | 37 | export default SolunoGame -------------------------------------------------------------------------------- /src/contexts/AutoConnectProvider.tsx: -------------------------------------------------------------------------------- 1 | import { useLocalStorage } from '@solana/wallet-adapter-react'; 2 | import { createContext, FC, ReactNode, useContext } from 'react'; 3 | 4 | export interface AutoConnectContextState { 5 | autoConnect: boolean; 6 | setAutoConnect(autoConnect: boolean): void; 7 | } 8 | 9 | export const AutoConnectContext = createContext({} as AutoConnectContextState); 10 | 11 | export function useAutoConnect(): AutoConnectContextState { 12 | return useContext(AutoConnectContext); 13 | } 14 | 15 | export const AutoConnectProvider: FC<{ children: ReactNode }> = ({ children }) => { 16 | // TODO: fix auto connect to actual reconnect on refresh/other. 17 | // TODO: make switch/slider settings 18 | // const [autoConnect, setAutoConnect] = useLocalStorage('autoConnect', false); 19 | const [autoConnect, setAutoConnect] = useLocalStorage('autoConnect', true); 20 | 21 | return ( 22 | {children} 23 | ); 24 | }; 25 | -------------------------------------------------------------------------------- /src/contexts/ContextProvider.tsx: -------------------------------------------------------------------------------- 1 | import { WalletAdapterNetwork, WalletError } from '@solana/wallet-adapter-base'; 2 | import { ConnectionProvider, WalletProvider } from '@solana/wallet-adapter-react'; 3 | import { WalletModalProvider as ReactUIWalletModalProvider } from '@solana/wallet-adapter-react-ui'; 4 | import { 5 | PhantomWalletAdapter, 6 | SolflareWalletAdapter, 7 | SolletExtensionWalletAdapter, 8 | SolletWalletAdapter, 9 | TorusWalletAdapter, 10 | // LedgerWalletAdapter, 11 | // SlopeWalletAdapter, 12 | } from '@solana/wallet-adapter-wallets'; 13 | import { Cluster, clusterApiUrl } from '@solana/web3.js'; 14 | import { FC, ReactNode, useCallback, useMemo } from 'react'; 15 | import { AutoConnectProvider, useAutoConnect } from './AutoConnectProvider'; 16 | import { notify } from "../utils/notifications"; 17 | import { NetworkConfigurationProvider, useNetworkConfiguration } from './NetworkConfigurationProvider'; 18 | 19 | const WalletContextProvider: FC<{ children: ReactNode }> = ({ children }) => { 20 | const { autoConnect } = useAutoConnect(); 21 | const { networkConfiguration } = useNetworkConfiguration(); 22 | const network = networkConfiguration as WalletAdapterNetwork; 23 | const endpoint = useMemo(() => clusterApiUrl(network), [network]); 24 | 25 | console.log(network); 26 | 27 | const wallets = useMemo( 28 | () => [ 29 | new PhantomWalletAdapter(), 30 | new SolflareWalletAdapter(), 31 | new SolletWalletAdapter({ network }), 32 | new SolletExtensionWalletAdapter({ network }), 33 | new TorusWalletAdapter(), 34 | // new LedgerWalletAdapter(), 35 | // new SlopeWalletAdapter(), 36 | ], 37 | [network] 38 | ); 39 | 40 | const onError = useCallback( 41 | (error: WalletError) => { 42 | notify({ type: 'error', message: error.message ? `${error.name}: ${error.message}` : error.name }); 43 | console.error(error); 44 | }, 45 | [] 46 | ); 47 | 48 | return ( 49 | // TODO: updates needed for updating and referencing endpoint: wallet adapter rework 50 | 51 | 52 | {children} 53 | 54 | 55 | ); 56 | }; 57 | 58 | export const ContextProvider: FC<{ children: ReactNode }> = ({ children }) => { 59 | return ( 60 | <> 61 | 62 | 63 | {children} 64 | 65 | 66 | 67 | ); 68 | }; 69 | -------------------------------------------------------------------------------- /src/contexts/NetworkConfigurationProvider.tsx: -------------------------------------------------------------------------------- 1 | import { useLocalStorage } from '@solana/wallet-adapter-react'; 2 | import { createContext, FC, ReactNode, useContext } from 'react'; 3 | 4 | 5 | export interface NetworkConfigurationState { 6 | networkConfiguration: string; 7 | setNetworkConfiguration(networkConfiguration: string): void; 8 | } 9 | 10 | export const NetworkConfigurationContext = createContext({} as NetworkConfigurationState); 11 | 12 | export function useNetworkConfiguration(): NetworkConfigurationState { 13 | return useContext(NetworkConfigurationContext); 14 | } 15 | 16 | export const NetworkConfigurationProvider: FC<{ children: ReactNode }> = ({ children }) => { 17 | const [networkConfiguration, setNetworkConfiguration] = useLocalStorage("network", "devnet"); 18 | 19 | return ( 20 | {children} 21 | ); 22 | }; -------------------------------------------------------------------------------- /src/hooks/useQueryContext.tsx: -------------------------------------------------------------------------------- 1 | import { useRouter } from 'next/router' 2 | import { EndpointTypes } from '../models/types' 3 | 4 | export default function useQueryContext() { 5 | const router = useRouter() 6 | const { cluster } = router.query 7 | 8 | const endpoint = cluster ? (cluster as EndpointTypes) : 'mainnet' 9 | const hasClusterOption = endpoint !== 'mainnet' 10 | const fmtUrlWithCluster = (url) => { 11 | if (hasClusterOption) { 12 | const mark = url.includes('?') ? '&' : '?' 13 | return decodeURIComponent(`${url}${mark}cluster=${endpoint}`) 14 | } 15 | return url 16 | } 17 | 18 | return { 19 | fmtUrlWithCluster, 20 | } 21 | } 22 | -------------------------------------------------------------------------------- /src/models/types.ts: -------------------------------------------------------------------------------- 1 | export type EndpointTypes = 'mainnet' | 'devnet' | 'localnet' 2 | -------------------------------------------------------------------------------- /src/pages/_app.tsx: -------------------------------------------------------------------------------- 1 | import { AppProps } from 'next/app'; 2 | import Head from 'next/head'; 3 | import { FC } from 'react'; 4 | import { ContextProvider } from '../contexts/ContextProvider'; 5 | import { AppBar } from '../components/AppBar'; 6 | import { ContentContainer } from '../components/ContentContainer'; 7 | import { Footer } from '../components/Footer'; 8 | import Notifications from '../components/Notification' 9 | 10 | require('@solana/wallet-adapter-react-ui/styles.css'); 11 | require('../styles/globals.css'); 12 | 13 | const App: FC = ({ Component, pageProps }) => { 14 | return ( 15 | <> 16 | 17 | Nft Marketplace 18 | 19 | 20 | 21 |
22 | 23 | 24 | 25 | 26 | 27 |
28 |
29 |
30 | 31 | ); 32 | }; 33 | 34 | export default App; 35 | -------------------------------------------------------------------------------- /src/pages/_document.tsx: -------------------------------------------------------------------------------- 1 | import Document, { DocumentContext, Head, Html, Main, NextScript } from 'next/document' 2 | 3 | class MyDocument extends Document { 4 | static async getInitialProps(ctx: DocumentContext) { 5 | const initialProps = await Document.getInitialProps(ctx) 6 | 7 | return initialProps 8 | } 9 | 10 | render() { 11 | return ( 12 | 13 | 14 | 15 | 16 | 17 |
18 | 19 | 20 | 21 | ); 22 | } 23 | } 24 | 25 | export default MyDocument; 26 | -------------------------------------------------------------------------------- /src/pages/api/hello.ts: -------------------------------------------------------------------------------- 1 | // Next.js API route support: https://nextjs.org/docs/api-routes/introduction 2 | import type { NextApiRequest, NextApiResponse } from 'next' 3 | 4 | type Data = { 5 | name: string 6 | } 7 | 8 | export default function handler( 9 | req: NextApiRequest, 10 | res: NextApiResponse 11 | ) { 12 | res.status(200).json({ name: 'John Doe' }) 13 | } 14 | -------------------------------------------------------------------------------- /src/pages/api/products.json: -------------------------------------------------------------------------------- 1 | [ 2 | { 3 | "id": 1, 4 | "name": "PortraitRed", 5 | "price": "0.1", 6 | "description": "Get these portraits creating with SkretchAI for only $0.01! ", 7 | "image_url": "https://user-images.githubusercontent.com/109158340/211199134-e6a00ae3-ce3c-42dc-b02a-9636fc55a3e0.png", 8 | "filename": "nfts", 9 | "hash": "QmfCpzU6gsiR7vW9DsbkSnDPjoCzN5bdW2YtX9C2XGb2En" 10 | }, 11 | { 12 | "id": 2, 13 | "name": "PortraitThoughtful", 14 | "price": "1.1", 15 | "image_url": "https://user-images.githubusercontent.com/109158340/211199291-7b84c5cf-b3e8-4b0c-9547-58b69ef0cb03.png", 16 | "description": "Get these portraits creating with SkretchAI for only $1.1!" 17 | }, 18 | { 19 | "id": 3, 20 | "name": "PortraitSpace", 21 | "price": "0.999", 22 | "image_url": "https://user-images.githubusercontent.com/109158340/211199411-24a5e1a4-0acc-45fc-9e27-db774bde978a.png", 23 | "description": "A Portrait from space. " 24 | }, 25 | { 26 | "id": 4, 27 | "name": "PortraitHypnosis", 28 | "price": "1.00", 29 | "image_url": "https://user-images.githubusercontent.com/109158340/211199664-7c8f7ec4-b27e-4755-a84a-92a59ee0e2f6.png", 30 | "description": "Hypnotized woman portrait" 31 | }, 32 | { 33 | "id": 5, 34 | "name": "PortraitBlack", 35 | "price": "1.1", 36 | "image_url": "https://user-images.githubusercontent.com/109158340/211199808-905c16ed-1415-48d2-8e3b-1c4aca28503b.png", 37 | "description": "A woman with closed eyes from SkretchAI." 38 | } 39 | ] -------------------------------------------------------------------------------- /src/pages/candymachine.tsx: -------------------------------------------------------------------------------- 1 | import type { NextPage } from "next" 2 | import Head from "next/head" 3 | import { CandyMachineView } from "../views" 4 | 5 | const CandyMachine: NextPage = (props) => { 6 | return ( 7 |
8 | 9 | Nft Marketplace 10 | 11 | 12 | 13 |
14 | ) 15 | } 16 | 17 | export default CandyMachine 18 | -------------------------------------------------------------------------------- /src/pages/checkwallet.tsx: -------------------------------------------------------------------------------- 1 | import type { NextPage } from "next"; 2 | import Head from "next/head"; 3 | import { CheckWalletView } from "../views"; 4 | 5 | const CheckWallet: NextPage = (props) => { 6 | return ( 7 |
8 | 9 | NFT Marketplace 10 | 14 | 15 | 16 |
17 | ); 18 | }; 19 | 20 | export default CheckWallet; 21 | -------------------------------------------------------------------------------- /src/pages/display.tsx: -------------------------------------------------------------------------------- 1 | import type { NextPage } from "next" 2 | import Head from "next/head" 3 | import { DisplayView } from "../views" 4 | 5 | const Display: NextPage = (props) => { 6 | return ( 7 |
8 | 9 | Nft Marketplace 10 | 11 | 12 | 13 |
14 | ) 15 | } 16 | 17 | export default Display 18 | -------------------------------------------------------------------------------- /src/pages/explore.tsx: -------------------------------------------------------------------------------- 1 | import type { NextPage } from "next" 2 | import Head from "next/head" 3 | import { ExploreView } from "../views" 4 | 5 | const Explore: NextPage = (props) => { 6 | return ( 7 |
8 | 9 | Nft Marketplace 10 | 11 | 12 | 13 |
14 | ) 15 | } 16 | 17 | export default Explore 18 | -------------------------------------------------------------------------------- /src/pages/index.tsx: -------------------------------------------------------------------------------- 1 | import type { NextPage } from "next"; 2 | import Head from "next/head"; 3 | import Info from "../components/Info" 4 | 5 | import { HomeView } from "../views"; 6 | 7 | const Home: NextPage = (props) => { 8 | return ( 9 |
10 | 11 | NFT Marketplace 12 | 16 | 17 | 18 | 19 | 20 |
21 | ); 22 | }; 23 | 24 | export default Home; 25 | -------------------------------------------------------------------------------- /src/pages/soluno.tsx: -------------------------------------------------------------------------------- 1 | import type { NextPage } from "next" 2 | import Head from "next/head" 3 | import { SolUnoView } from "../views" 4 | 5 | const SolUno: NextPage = (props) => { 6 | return ( 7 |
8 | 9 | Nft Marketplace 10 | 11 | 12 | 13 |
14 | ) 15 | } 16 | 17 | export default SolUno 18 | -------------------------------------------------------------------------------- /src/stores/useNotificationStore.tsx: -------------------------------------------------------------------------------- 1 | import create, { State } from "zustand"; 2 | import produce from "immer"; 3 | 4 | interface NotificationStore extends State { 5 | notifications: Array<{ 6 | type: string 7 | message: string 8 | description?: string 9 | txid?: string 10 | }> 11 | set: (x: any) => void 12 | } 13 | 14 | const useNotificationStore = create((set, _get) => ({ 15 | notifications: [], 16 | set: (fn) => set(produce(fn)), 17 | })) 18 | 19 | export default useNotificationStore 20 | -------------------------------------------------------------------------------- /src/stores/useUserSOLBalanceStore.tsx: -------------------------------------------------------------------------------- 1 | import create, { State } from 'zustand' 2 | import { Connection, PublicKey, LAMPORTS_PER_SOL } from '@solana/web3.js' 3 | 4 | interface UserSOLBalanceStore extends State { 5 | balance: number; 6 | getUserSOLBalance: (publicKey: PublicKey, connection: Connection) => void 7 | } 8 | 9 | const useUserSOLBalanceStore = create((set, _get) => ({ 10 | balance: 0, 11 | getUserSOLBalance: async (publicKey, connection) => { 12 | let balance = 0; 13 | try { 14 | balance = await connection.getBalance( 15 | publicKey, 16 | 'confirmed' 17 | ); 18 | balance = balance / LAMPORTS_PER_SOL; 19 | } catch (e) { 20 | console.log(`error getting balance: `, e); 21 | } 22 | set((s) => { 23 | s.balance = balance; 24 | console.log(`balance updated, `, balance); 25 | }) 26 | }, 27 | })); 28 | 29 | export default useUserSOLBalanceStore; -------------------------------------------------------------------------------- /src/styles/AddressForm.module.css: -------------------------------------------------------------------------------- 1 | .input { 2 | background: #0b8eca; 3 | } 4 | 5 | .formField { 6 | margin: 10px 0 10px 0; 7 | min-width: 500px; 8 | padding: 15px; 9 | font-size: 16px; 10 | border: 0; 11 | font-family: "Roboto", sans-serif; 12 | color:rgb(67, 50, 228); 13 | } 14 | 15 | 16 | 17 | 18 | -------------------------------------------------------------------------------- /src/styles/custom.module.css: -------------------------------------------------------------------------------- 1 | .gridNFT { 2 | display: grid; 3 | grid-template-columns: repeat(3, 1fr); 4 | grid-gap: 0.5em; 5 | } 6 | 7 | 8 | 9 | .innerwrapper{ 10 | background:rgb(65, 144, 201) ; 11 | padding: 2px; 12 | border-radius: 18px; 13 | 14 | } 15 | .content{ 16 | background-color: rgb(196, 148, 214); 17 | border-radius: 18px; 18 | padding: 10px; 19 | 20 | 21 | } 22 | .content:hover .imgnft{ 23 | transform: scale(1.05); 24 | border-radius:1rem ; 25 | 26 | } 27 | 28 | 29 | .imgnft{ 30 | height: 300px; 31 | margin: auto; 32 | border-radius: 18px; 33 | 34 | } 35 | 36 | .nftinfoname{ 37 | /* font-size: 18px; 38 | font-weight: 400; 39 | color: aqua; 40 | display: end; 41 | padding-top: 0.5rem; */ 42 | font-size: 14px; 43 | font-weight: bold; 44 | background: linear-gradient(-45deg, #a80a66, #07c6df, #e2084a); 45 | background-clip: text; 46 | -webkit-text-stroke: 4px transparent; 47 | -webkit-text-fill-color: black; 48 | 49 | } 50 | 51 | .infinite { 52 | margin-left: auto; 53 | margin-right: auto; 54 | width:50%; 55 | text-align: center; 56 | } 57 | 58 | 59 | .container { 60 | position: relative; 61 | text-align: center; 62 | color: white; 63 | 64 | } 65 | .intronft{ 66 | width:60%; 67 | text-align: center; 68 | /* margin-top: 2rem; */ 69 | margin-left: auto; 70 | margin-right: auto; 71 | 72 | } 73 | /* Centered text */ 74 | .centered { 75 | position: absolute; 76 | top: 50%; 77 | left: 50%; 78 | transform: translate(-50%, -50%); 79 | } 80 | .sologo{ 81 | width: 20%; 82 | 83 | } 84 | .sologo1{ 85 | width: 11%; 86 | 87 | 88 | } 89 | .Myhead { 90 | display: flex; 91 | margin-bottom: 3rem; 92 | flex-direction: column; 93 | justify-content: center; 94 | align-items: center; 95 | 96 | 97 | } 98 | 99 | 100 | .Myborders { 101 | margin-top: 0.5rem; 102 | width: 30rem; 103 | height: 0.25rem; 104 | border-width: 0; 105 | background-color: rgb(233, 179, 188); 106 | 107 | } 108 | 109 | -------------------------------------------------------------------------------- /src/styles/diamond.module.css: -------------------------------------------------------------------------------- 1 | 2 | 3 | .infoPart3 { 4 | margin-top: 22rem; 5 | margin-right: 3rem; 6 | padding: 3rem; 7 | position: relative; 8 | /* display: flex; */ 9 | flex: 1; 10 | } 11 | .leftImage{ 12 | margin-left: 0%; 13 | padding-top: 5rem; 14 | width: 90%; 15 | 16 | } 17 | 18 | .infoRightDiamond { 19 | display: flex; 20 | flex-wrap: wrap; 21 | transform: rotate(45deg); 22 | -webkit-transform: rotate(45deg); 23 | -moz-transform: rotate(45deg); 24 | -ms-transform: rotate(45deg); 25 | -o-transform: rotate(45deg); 26 | } 27 | 28 | .infoRightDiamondItem { 29 | height: 180px; 30 | width: 190px; 31 | overflow: hidden; 32 | transform: rotate(-45deg); 33 | cursor: pointer; 34 | margin: 6px; 35 | border: 3px solid rgb(4, 188, 212); 36 | border-radius: 2rem; 37 | -webkit-border-radius: 2rem; 38 | -moz-border-radius: 2rem; 39 | -ms-border-radius: 2rem; 40 | -o-border-radius: 2rem; 41 | 42 | } 43 | 44 | .infoRightDiamondItemImg { 45 | margin: 0%; 46 | /* height: 20px; */ 47 | object-fit: contain; 48 | display: block; 49 | border-radius: 2rem; 50 | -webkit-border-radius: 2rem; 51 | -moz-border-radius: 2rem; 52 | -ms-border-radius: 2rem; 53 | -o-border-radius: 2rem; 54 | 55 | } 56 | 57 | /* .infoRightBg { 58 | height:500px; 59 | width:500px; 60 | background-color: rgb(19, 11, 32); 61 | filter: blur(160.58px); 62 | position: absolute; 63 | z-index: -99; 64 | left: 50%; 65 | top: 50%; 66 | transform: translate(-50%); 67 | -webkit-transform: translate(-50%); 68 | -moz-transform: translate(-50%); 69 | -ms-transform: translate(-50%); 70 | -o-transform: translate(-50%); 71 | -webkit-filter: blur(160.58px); 72 | } */ 73 | .Myborders { 74 | margin-top: 0.5rem; 75 | width: 20rem; 76 | height: 0.25rem; 77 | border-width: 0; 78 | background-color: rgb(233, 179, 188); 79 | text-align: center; 80 | 81 | } 82 | -------------------------------------------------------------------------------- /src/styles/globals.css: -------------------------------------------------------------------------------- 1 | @tailwind base; 2 | @tailwind components; 3 | @tailwind utilities; 4 | 5 | html, 6 | body { 7 | padding: 0; 8 | margin: 0; 9 | font-family: -apple-system, BlinkMacSystemFont, Segoe UI, Roboto, Oxygen, 10 | Ubuntu, Cantarell, Fira Sans, Droid Sans, Helvetica Neue, sans-serif; 11 | background: rgb(152,6,242); 12 | background: linear-gradient(90deg, rgba(152,6,242,1) 0%, rgba(196,49,12,1) 55%, rgba(130,214,206,1) 100%); 13 | } 14 | 15 | a { 16 | color: inherit; 17 | text-decoration: none; 18 | } 19 | 20 | * { 21 | box-sizing: border-box; 22 | } 23 | 24 | /* example: override wallet button style */ 25 | .wallet-adapter-button:not([disabled]):hover { 26 | background-color: #707070; 27 | } 28 | 29 | img { 30 | width: 250px; 31 | } 32 | 33 | .bg-neutral { 34 | --tw-bg-opacity: 1; 35 | /* background-color: hsla(var(--n) / var(--tw-bg-opacity)); */ 36 | background: rgb(44,3,94); 37 | background: linear-gradient(90deg, rgba(44,3,94,1) 0%, rgba(196,49,12,1) 55%, rgba(11,11,40,1) 100%); 38 | } 39 | .bg-base-100 { 40 | --tw-bg-opacity: 1; 41 | background: rgb(44,3,94); 42 | background: linear-gradient(90deg, rgba(44,3,94,1) 0%, rgba(196,49,12,1) 55%, rgba(11,11,40,1) 100%); 43 | } 44 | 45 | -------------------------------------------------------------------------------- /src/utils/explorer.ts: -------------------------------------------------------------------------------- 1 | import { PublicKey, Transaction } from '@solana/web3.js' 2 | import base58 from 'bs58' 3 | 4 | export function getExplorerUrl( 5 | endpoint: string, 6 | viewTypeOrItemAddress: 'inspector' | PublicKey | string, 7 | itemType = 'address' // | 'tx' | 'block' 8 | ) { 9 | const getClusterUrlParam = () => { 10 | let cluster = '' 11 | if (endpoint === 'localnet') { 12 | cluster = `custom&customUrl=${encodeURIComponent( 13 | 'http://127.0.0.1:8899' 14 | )}` 15 | } else if (endpoint === 'https://api.devnet.solana.com') { 16 | cluster = 'devnet' 17 | } 18 | 19 | return cluster ? `?cluster=${cluster}` : '' 20 | } 21 | 22 | return `https://explorer.solana.com/${itemType}/${viewTypeOrItemAddress}${getClusterUrlParam()}` 23 | } -------------------------------------------------------------------------------- /src/utils/notifications.tsx: -------------------------------------------------------------------------------- 1 | import useNotificationStore from "../stores/useNotificationStore"; 2 | 3 | export function notify(newNotification: { 4 | type?: string 5 | message: string 6 | description?: string 7 | txid?: string 8 | }) { 9 | const { 10 | notifications, 11 | set: setNotificationStore, 12 | } = useNotificationStore.getState() 13 | 14 | setNotificationStore((state: { notifications: any[] }) => { 15 | state.notifications = [ 16 | ...notifications, 17 | { type: 'success', ...newNotification }, 18 | ] 19 | }) 20 | } 21 | -------------------------------------------------------------------------------- /src/views/candymachine/index.tsx: -------------------------------------------------------------------------------- 1 | import { FC } from "react" 2 | import { FetchCandyMachine } from "../../components/FetchCandyMachine" 3 | 4 | export const CandyMachineView: FC = ({}) => { 5 | return ( 6 |
7 |
8 |

9 | Candy Machine 10 |

11 | {/* CONTENT GOES HERE */} 12 |
13 | 14 |
15 |
16 |
17 | ) 18 | } 19 | -------------------------------------------------------------------------------- /src/views/checkwallet/index.tsx: -------------------------------------------------------------------------------- 1 | // Next, React 2 | import { FC, useEffect, useState } from "react" 3 | import Link from "next/link" 4 | 5 | // Wallet 6 | import { useWallet, useConnection } from "@solana/wallet-adapter-react" 7 | 8 | // Components 9 | import { RequestAirdrop } from "../../components/RequestAirdrop" 10 | import pkg from "../../../package.json" 11 | 12 | // Store 13 | import useUserSOLBalanceStore from "../../stores/useUserSOLBalanceStore" 14 | import CheckAnother from "../../components/CheckAnother" 15 | 16 | export const CheckWalletView : FC = ({}) => { 17 | const wallet = useWallet() 18 | const { connection } = useConnection() 19 | 20 | const balance = useUserSOLBalanceStore((s) => s.balance) 21 | const { getUserSOLBalance } = useUserSOLBalanceStore() 22 | 23 | useEffect(() => { 24 | if (wallet.publicKey) { 25 | console.log(wallet.publicKey.toBase58()) 26 | getUserSOLBalance(wallet.publicKey, connection) 27 | } 28 | }, [wallet.publicKey, connection, getUserSOLBalance]) 29 | 30 | return ( 31 |
32 |
33 | 34 | 35 |
36 | 37 | 38 | {/* {wallet.publicKey &&

Public Key: {wallet.publicKey.toBase58()}

} */} 39 | {wallet &&

SOL Balance: {(balance || 0).toLocaleString()}

} 40 |
41 |
42 |
43 | ) 44 | } 45 | -------------------------------------------------------------------------------- /src/views/display/index.tsx: -------------------------------------------------------------------------------- 1 | import { FC } from "react" 2 | import { FetchNft } from "../../components/FetchNft" 3 | 4 | export const DisplayView: FC = ({}) => { 5 | return ( 6 |
7 |
8 |

9 | NFTs 10 |

11 | {/* CONTENT GOES HERE */} 12 |
13 | 14 |
15 |
16 |
17 | ) 18 | } 19 | -------------------------------------------------------------------------------- /src/views/explore/index.tsx: -------------------------------------------------------------------------------- 1 | import { FC } from "react" 2 | import { FetchRariableNfts } from "../../components/FetchRariableNfts" 3 | 4 | 5 | 6 | export const ExploreView: FC = ({ }) => { 7 | return ( 8 | 9 |
10 |
11 |

12 | Explore Solana Nfts With Rarible 13 |

14 | 15 | {/* CONTENT GOES HERE */} 16 |
17 | 18 |
19 |
20 |
21 | ) 22 | } 23 | -------------------------------------------------------------------------------- /src/views/home/index.tsx: -------------------------------------------------------------------------------- 1 | // Next, React 2 | import { FC, useEffect, useState } from "react" 3 | import Link from "next/link" 4 | 5 | // Wallet 6 | import { useWallet, useConnection } from "@solana/wallet-adapter-react" 7 | 8 | // Store 9 | import useUserSOLBalanceStore from "../../stores/useUserSOLBalanceStore" 10 | import styles from "../../styles/custom.module.css" 11 | import Typewriter from "typewriter-effect"; 12 | import Infinite from "./infinite-loader.gif"; 13 | import IntroNft from "../../../public/nft-free-depositphotos-bgremover.png"; 14 | 15 | 16 | 17 | export const HomeView: FC = ({ }) => { 18 | const wallet = useWallet() 19 | const { connection } = useConnection() 20 | 21 | const balance = useUserSOLBalanceStore((s) => s.balance) 22 | const { getUserSOLBalance } = useUserSOLBalanceStore() 23 | 24 | useEffect(() => { 25 | if (wallet.publicKey) { 26 | console.log(wallet.publicKey.toBase58()) 27 | getUserSOLBalance(wallet.publicKey, connection) 28 | } 29 | }, [wallet.publicKey, connection, getUserSOLBalance]) 30 | 31 | return ( 32 |
33 | 34 |
35 |
36 |
37 |

38 | Welcome to Solana{" "} 39 | 40 | { 46 | typewriter 47 | .typeString("World!") 48 | .pauseFor(2000) 49 | .deleteAll() 50 | .typeString("Explore, Create or Buy") 51 | .pauseFor(2000) 52 | .deleteAll() 53 | .start(); 54 | }} 55 | /> 56 | 57 |

58 |
59 | 60 |
61 | 67 | 73 | 74 |
75 |
76 |
77 |
78 | ) 79 | } 80 | -------------------------------------------------------------------------------- /src/views/home/infinite-loader.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rust-trust/solana-nftMarketplace/8ff728298b38f39b3770580cee2f3183d13bcc7a/src/views/home/infinite-loader.gif -------------------------------------------------------------------------------- /src/views/index.tsx: -------------------------------------------------------------------------------- 1 | export { HomeView } from "./home" 2 | export { DisplayView } from "./display" 3 | export { CandyMachineView } from "./candymachine" 4 | export { ExploreView } from "./explore" 5 | export { CheckWalletView } from "./checkwallet" 6 | export { SolUnoView } from "./soluno" 7 | 8 | -------------------------------------------------------------------------------- /src/views/soluno/index.tsx: -------------------------------------------------------------------------------- 1 | import { FC } from "react" 2 | import { FetchRandomNft } from "../../components/FetchRandomNft" 3 | import SolunoGame from "../../components/SolunoGame" 4 | 5 | 6 | export const SolUnoView: FC = ({ }) => { 7 | return ( 8 | 9 |
10 |
11 |

12 | Play SolUNO 13 |

14 | 15 | {/* CONTENT GOES HERE */} 16 |
17 | 18 | 19 |
20 |
21 |
22 | ) 23 | } 24 | -------------------------------------------------------------------------------- /tailwind.config.js: -------------------------------------------------------------------------------- 1 | module.exports = { 2 | mode: "jit", 3 | content: ["./src/**/*.{js,jsx,ts,tsx}"], 4 | darkMode: "media", 5 | theme: { 6 | extend: {}, 7 | }, 8 | plugins: [ 9 | require('daisyui'), 10 | require("@tailwindcss/typography") 11 | ], 12 | daisyui: { 13 | styled: true, 14 | // TODO: Theme needs works 15 | themes: [ 16 | { 17 | 'solana': { /* your theme name */ 18 | fontFamily: { 19 | display: ['PT Mono, monospace'], 20 | body: ['Inter, sans-serif'], 21 | }, 22 | 'primary': '#2a2a2a', /* Primary color */ 23 | 'primary-focus': '#9945FF', /* Primary color - focused */ 24 | 'primary-content': '#ffffff', /* Foreground content color to use on primary color */ 25 | 26 | 'secondary': '#f6d860', /* Secondary color */ 27 | 'secondary-focus': '#f3cc30', /* Secondary color - focused */ 28 | 'secondary-content': '#ffffff', /* Foreground content color to use on secondary color */ 29 | 30 | 'accent': '#33a382', /* Accent color */ 31 | 'accent-focus': '#2aa79b', /* Accent color - focused */ 32 | 'accent-content': '#ffffff', /* Foreground content color to use on accent color */ 33 | 34 | 'neutral': '#2b2b2b', /* Neutral color */ 35 | 'neutral-focus': '#2a2e37', /* Neutral color - focused */ 36 | 'neutral-content': '#ffffff', /* Foreground content color to use on neutral color */ 37 | 38 | 'base-100': '#181818', /* Base color of page, used for blank backgrounds */ 39 | 'base-200': '#35363a', /* Base color, a little darker */ 40 | 'base-300': '#222222', /* Base color, even more darker */ 41 | 'base-content': '#f9fafb', /* Foreground content color to use on base color */ 42 | 43 | 'info': '#2094f3', /* Info */ 44 | 'success': '#009485', /* Success */ 45 | 'warning': '#ff9900', /* Warning */ 46 | 'error': '#ff5724', /* Error */ 47 | }, 48 | }, 49 | // backup themes: 50 | // 'dark', 51 | // 'synthwave' 52 | ], 53 | base: true, 54 | utils: true, 55 | logs: true, 56 | rtl: false, 57 | }, 58 | } -------------------------------------------------------------------------------- /tsconfig.json: -------------------------------------------------------------------------------- 1 | { 2 | "compilerOptions": { 3 | "baseUrl": "./src", 4 | "target": "es6", 5 | "lib": ["dom", "dom.iterable", "esnext"], 6 | "allowJs": true, 7 | "skipLibCheck": true, 8 | "strict": false, 9 | "strictNullChecks": false, 10 | "forceConsistentCasingInFileNames": true, 11 | "noEmit": true, 12 | "esModuleInterop": true, 13 | "module": "esnext", 14 | "moduleResolution": "node", 15 | "resolveJsonModule": true, 16 | "isolatedModules": true, 17 | "jsx": "preserve", 18 | "incremental": true 19 | }, 20 | "include": ["next-env.d.ts", "**/*.ts", "**/*.tsx"], 21 | "exclude": ["node_modules", ".next",], 22 | "ts-node": { 23 | "require": ["tsconfig-paths/register"], 24 | "compilerOptions": { 25 | "module": "commonjs" 26 | } 27 | } 28 | } 29 | --------------------------------------------------------------------------------