├── .env.example ├── .gitignore ├── LICENSE ├── README.md ├── package.json ├── public ├── favicon.ico ├── index.html ├── logo192.png ├── logo512.png ├── manifest.json └── robots.txt ├── pull_request_template.md ├── src ├── App.css ├── App.test.tsx ├── App.tsx ├── Home.tsx ├── candy-machine.ts ├── index.css ├── index.tsx ├── logo.svg ├── react-app-env.d.ts ├── reportWebVitals.ts └── setupTests.ts ├── tsconfig.json └── yarn.lock /.env.example: -------------------------------------------------------------------------------- 1 | REACT_APP_CANDY_MACHINE_CONFIG= 2 | REACT_APP_CANDY_MACHINE_ID= 3 | REACT_APP_TREASURY_ADDRESS= 4 | REACT_APP_CANDY_START_DATE= 5 | 6 | REACT_APP_SOLANA_NETWORK=devnet 7 | REACT_APP_SOLANA_RPC_HOST=https://explorer-api.devnet.solana.com 8 | 9 | REACT_APP_SECRET_KEY= 10 | REACT_APP_API_URL= 11 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | # See https://help.github.com/articles/ignoring-files/ for more about ignoring files. 2 | 3 | # dependencies 4 | /node_modules 5 | /.pnp 6 | .pnp.js 7 | 8 | # testing 9 | /coverage 10 | 11 | # production 12 | /build 13 | 14 | # misc 15 | .DS_Store 16 | .env.local 17 | .env.development.local 18 | .env.test.local 19 | .env.production.local 20 | 21 | npm-debug.log* 22 | yarn-debug.log* 23 | yarn-error.log* 24 | .env 25 | .env.* 26 | !.env.example 27 | -------------------------------------------------------------------------------- /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 | limitations under the License. 203 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | 2 | # Candy-Machine-Mint 3 | ## full video tutorial can be found here by a generous contributor ❤️: https://www.youtube.com/watch?v=SivKM48-Tt0 4 | 5 | This repo is built on top the Exiled apes Candy_Machine_Mint_Site example with added whitelist functionality 6 | ## BEFORE YOU START 7 | # Visit https://github.com/CryptoOutcasts/Whitelist_API and follow the steps to get your whitelist API setup and then continue here. 8 | ## Getting Set Up 9 | 10 | ### Prerequisites 11 | 12 | * Ensure you have recent versions of both `node` and `yarn` installed. 13 | 14 | * Follow the instructions [here](https://docs.solana.com/cli/install-solana-cli-tools) to install the Solana Command Line Toolkit. 15 | 16 | * Follow the instructions [here](https://hackmd.io/@levicook/HJcDneEWF) to install the Metaplex Command Line Utility. 17 | * Installing the Command Line Package is currently an advanced task that will be simplified eventually. 18 | 19 | ### Installation 20 | 21 | 1. Fork the project, then clone down. Example: 22 | ``` 23 | git clone https://github.com/CryptoOutcasts/Candy_Machine_Whitelist_Site.git 24 | ``` 25 | 2. Install dependencies 26 | ``` 27 | yarn install 28 | ``` 29 | 4. Define your environment variables using the instructions below, and start up the server with `npm start`. 30 | 31 | #### Environment Variables 32 | 33 | To run the project, first rename the `.env.example` file at the root directory to `.env` and update the following variables: 34 | 35 | ``` 36 | REACT_APP_CANDY_MACHINE_CONFIG=__PLACEHOLDER__ 37 | ``` 38 | 39 | This is a Solana account address. You can get the value for this from the `.cache/temp` file. This file is created when you run the `metaplex upload` command in terminal. 40 | 41 | ``` 42 | REACT_APP_CANDY_MACHINE_ID=__PLACEHOLDER__ 43 | ``` 44 | 45 | Same as above; this is a Solana account address. You can get the value for this from the `./cache/temp` file. This file is created when you run the `metaplex upload` command in terminal. 46 | 47 | ``` 48 | REACT_APP_TREASURY_ADDRESS=__PLACEHOLDER__ 49 | ``` 50 | 51 | This the Solana address that receives the funds gathered during the minting process. More docs coming as we can test this. 52 | 53 | ``` 54 | REACT_APP_CANDY_START_DATE=__PLACEHOLDER__ 55 | ``` 56 | 57 | This is a unix time stamp that configures when your mint will be open. 58 | 59 | ``` 60 | REACT_APP_SOLANA_NETWORK=devnet 61 | ``` 62 | 63 | This identifies the Solana network you want to connect to. Options are `devnet`, `testnet`, and `mainnet`. 64 | 65 | ``` 66 | REACT_APP_SOLANA_RPC_HOST=https://explorer-api.devnet.solana.com 67 | ``` 68 | 69 | This identifies the RPC server your web app will access the Solana network through. 70 | 71 | ``` 72 | REACT_APP_API_URL==https://myherokuproject.herokuapp.com 73 | ``` 74 | 75 | This should be the url of your API either from heroku or any other hosting services you choose 76 | ### REFERENCE: https://github.com/CryptoOutcasts/Whitelist_API 77 | ### Please do not add a forward slash to the end of the url. just like the example 78 | 79 | ``` 80 | REACT_APP_SECRET_KEY=__PLACEHOLDER__ 81 | ``` 82 | This should be the API key you defined as the Environmental variable .env in the API repo 83 | ### REFERENCE https://github.com/CryptoOutcasts/Whitelist_API 84 | 85 | 86 | 3. build the project using 87 | ``` 88 | yarn build 89 | ``` 90 | 91 | 92 | 4. Start the app ! 93 | ``` 94 | yarn start 95 | ``` 96 | 97 | 98 | 99 | 100 | 101 | 102 | 103 | 104 | 105 | # Getting Started with Create React App 106 | 107 | This project was bootstrapped with [Create React App](https://github.com/facebook/create-react-app). 108 | 109 | ## Available Scripts 110 | 111 | In the project directory, you can run: 112 | 113 | ### `yarn start` 114 | 115 | Runs the app in the development mode.\ 116 | Open [http://localhost:3000](http://localhost:3000) to view it in the browser. 117 | 118 | The page will reload if you make edits.\ 119 | You will also see any lint errors in the console. 120 | 121 | ### `yarn test` 122 | 123 | Launches the test runner in the interactive watch mode.\ 124 | See the section about [running tests](https://facebook.github.io/create-react-app/docs/running-tests) for more information. 125 | 126 | ### `yarn build` 127 | 128 | Builds the app for production to the `build` folder.\ 129 | It correctly bundles React in production mode and optimizes the build for the best performance. 130 | 131 | The build is minified and the filenames include the hashes.\ 132 | Your app is ready to be deployed! 133 | 134 | See the section about [deployment](https://facebook.github.io/create-react-app/docs/deployment) for more information. 135 | 136 | ### `yarn eject` 137 | 138 | **Note: this is a one-way operation. Once you `eject`, you can’t go back!** 139 | 140 | If you aren’t satisfied with the build tool and configuration choices, you can `eject` at any time. This command will remove the single build dependency from your project. 141 | 142 | Instead, it will copy all the configuration files and the transitive dependencies (webpack, Babel, ESLint, etc) right into your project so you have full control over them. All of the commands except `eject` will still work, but they will point to the copied scripts so you can tweak them. At this point you’re on your own. 143 | 144 | You don’t have to ever use `eject`. The curated feature set is suitable for small and middle deployments, and you shouldn’t feel obligated to use this feature. However we understand that this tool wouldn’t be useful if you couldn’t customize it when you are ready for it. 145 | 146 | ## Learn More 147 | 148 | You can learn more in the [Create React App documentation](https://facebook.github.io/create-react-app/docs/getting-started). 149 | 150 | To learn React, check out the [React documentation](https://reactjs.org/). 151 | -------------------------------------------------------------------------------- /package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "candy-machine-mint", 3 | "version": "0.1.0", 4 | "private": true, 5 | "dependencies": { 6 | "@material-ui/core": "^4.12.3", 7 | "@material-ui/icons": "^4.11.2", 8 | "@material-ui/lab": "^4.0.0-alpha.60", 9 | "@project-serum/anchor": "^0.14.0", 10 | "@solana/spl-token": "^0.1.8", 11 | "@solana/wallet-adapter-base": "^0.5.2", 12 | "@solana/wallet-adapter-material-ui": "^0.11.0", 13 | "@solana/wallet-adapter-react": "^0.11.0", 14 | "@solana/wallet-adapter-wallets": "^0.9.0", 15 | "@solana/web3.js": "^1.27.0", 16 | "@testing-library/jest-dom": "^5.11.4", 17 | "@testing-library/react": "^11.1.0", 18 | "@testing-library/user-event": "^12.1.10", 19 | "@types/jest": "^26.0.15", 20 | "@types/node": "^12.0.0", 21 | "@types/react": "^17.0.0", 22 | "@types/react-dom": "^17.0.0", 23 | "react": "^17.0.2", 24 | "react-countdown": "^2.3.2", 25 | "react-dom": "^17.0.2", 26 | "react-scripts": "4.0.3", 27 | "styled-components": "^5.3.1", 28 | "typescript": "^4.1.2", 29 | "web-vitals": "^1.0.1" 30 | }, 31 | "scripts": { 32 | "start": "react-scripts start", 33 | "build": "react-scripts build", 34 | "test": "react-scripts test", 35 | "eject": "react-scripts eject" 36 | }, 37 | "eslintConfig": { 38 | "extends": [ 39 | "react-app", 40 | "react-app/jest" 41 | ] 42 | }, 43 | "browserslist": { 44 | "production": [ 45 | ">0.2%", 46 | "not dead", 47 | "not op_mini all" 48 | ], 49 | "development": [ 50 | "last 1 chrome version", 51 | "last 1 firefox version", 52 | "last 1 safari version" 53 | ] 54 | }, 55 | "devDependencies": { 56 | "@types/styled-components": "^5.1.14" 57 | } 58 | } 59 | -------------------------------------------------------------------------------- /public/favicon.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CryptoOutcasts/Candy_Machine_Whitelist_Site/4bcfe2522e550d1cb9c49455b465fd846599a6b0/public/favicon.ico -------------------------------------------------------------------------------- /public/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 12 | 13 | 17 | 18 | 27 | React App 28 | 29 | 30 | 31 |
32 | 42 | 43 | 44 | -------------------------------------------------------------------------------- /public/logo192.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CryptoOutcasts/Candy_Machine_Whitelist_Site/4bcfe2522e550d1cb9c49455b465fd846599a6b0/public/logo192.png -------------------------------------------------------------------------------- /public/logo512.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CryptoOutcasts/Candy_Machine_Whitelist_Site/4bcfe2522e550d1cb9c49455b465fd846599a6b0/public/logo512.png -------------------------------------------------------------------------------- /public/manifest.json: -------------------------------------------------------------------------------- 1 | { 2 | "short_name": "React App", 3 | "name": "Create React App Sample", 4 | "icons": [ 5 | { 6 | "src": "favicon.ico", 7 | "sizes": "64x64 32x32 24x24 16x16", 8 | "type": "image/x-icon" 9 | }, 10 | { 11 | "src": "logo192.png", 12 | "type": "image/png", 13 | "sizes": "192x192" 14 | }, 15 | { 16 | "src": "logo512.png", 17 | "type": "image/png", 18 | "sizes": "512x512" 19 | } 20 | ], 21 | "start_url": ".", 22 | "display": "standalone", 23 | "theme_color": "#000000", 24 | "background_color": "#ffffff" 25 | } 26 | -------------------------------------------------------------------------------- /public/robots.txt: -------------------------------------------------------------------------------- 1 | # https://www.robotstxt.org/robotstxt.html 2 | User-agent: * 3 | Disallow: 4 | -------------------------------------------------------------------------------- /pull_request_template.md: -------------------------------------------------------------------------------- 1 | # Description 2 | 3 | Please include a summary of the change and which issue is fixed. Please also include relevant motivation and context. List any dependencies that are required for this change. 4 | 5 | Please mark relevant issues as closed/resolved here. 6 | 7 | Please include a screenshot of relevant change if helpful. 8 | 9 | ## Type of change 10 | 11 | Please delete options that are not relevant. 12 | 13 | - [ ] Bug fix 14 | - [ ] New feature 15 | - [ ] Refactor 16 | - [ ] Documentation 17 | 18 | ## How Has This Been Tested? 19 | Please describe the tests that you ran to verify your changes. Provide instructions so we can reproduce. Please also list any relevant details for your test configuration. 20 | 21 | - [ ] Developer Tools 22 | - [ ] Cypress 23 | - [ ] CI 24 | -------------------------------------------------------------------------------- /src/App.css: -------------------------------------------------------------------------------- 1 | *{ 2 | margin-left: auto; 3 | margin-right: auto; 4 | text-align: center; 5 | } -------------------------------------------------------------------------------- /src/App.test.tsx: -------------------------------------------------------------------------------- 1 | import React from 'react'; 2 | import { render, screen } from '@testing-library/react'; 3 | import App from './App'; 4 | 5 | test('renders learn react link', () => { 6 | render(); 7 | const linkElement = screen.getByText(/learn react/i); 8 | expect(linkElement).toBeInTheDocument(); 9 | }); 10 | -------------------------------------------------------------------------------- /src/App.tsx: -------------------------------------------------------------------------------- 1 | import "./App.css"; 2 | import { useMemo } from "react"; 3 | 4 | import Home from "./Home"; 5 | 6 | import * as anchor from "@project-serum/anchor"; 7 | import { clusterApiUrl } from "@solana/web3.js"; 8 | import { WalletAdapterNetwork } from "@solana/wallet-adapter-base"; 9 | import { 10 | getPhantomWallet, 11 | getSlopeWallet, 12 | getSolflareWallet, 13 | getSolletWallet, 14 | getSolletExtensionWallet, 15 | } from "@solana/wallet-adapter-wallets"; 16 | 17 | import { 18 | ConnectionProvider, 19 | WalletProvider, 20 | } from "@solana/wallet-adapter-react"; 21 | 22 | import { WalletDialogProvider } from "@solana/wallet-adapter-material-ui"; 23 | import { createTheme, ThemeProvider } from "@material-ui/core"; 24 | 25 | const treasury = new anchor.web3.PublicKey( 26 | process.env.REACT_APP_TREASURY_ADDRESS! 27 | ); 28 | 29 | const config = new anchor.web3.PublicKey( 30 | process.env.REACT_APP_CANDY_MACHINE_CONFIG! 31 | ); 32 | 33 | const candyMachineId = new anchor.web3.PublicKey( 34 | process.env.REACT_APP_CANDY_MACHINE_ID! 35 | ); 36 | 37 | const network = process.env.REACT_APP_SOLANA_NETWORK as WalletAdapterNetwork; 38 | 39 | const rpcHost = process.env.REACT_APP_SOLANA_RPC_HOST!; 40 | const connection = new anchor.web3.Connection(rpcHost); 41 | 42 | const startDateSeed = parseInt(process.env.REACT_APP_CANDY_START_DATE!, 10); 43 | 44 | const txTimeout = 30000; // milliseconds (confirm this works for your project) 45 | 46 | const theme = createTheme({ 47 | palette: { 48 | type: 'dark', 49 | }, 50 | overrides: { 51 | MuiButtonBase: { 52 | root: { 53 | justifyContent: 'flex-start', 54 | }, 55 | }, 56 | MuiButton: { 57 | root: { 58 | textTransform: undefined, 59 | padding: '12px 16px', 60 | }, 61 | startIcon: { 62 | marginRight: 8, 63 | }, 64 | endIcon: { 65 | marginLeft: 8, 66 | }, 67 | }, 68 | }, 69 | }); 70 | 71 | const App = () => { 72 | const endpoint = useMemo(() => clusterApiUrl(network), []); 73 | 74 | const wallets = useMemo( 75 | () => [ 76 | getPhantomWallet(), 77 | getSlopeWallet(), 78 | getSolflareWallet(), 79 | getSolletWallet({ network }), 80 | getSolletExtensionWallet({ network }) 81 | ], 82 | [] 83 | ); 84 | 85 | return ( 86 | <> 87 | 88 | 89 | 90 | 91 | 99 | 100 | 101 | 102 | 103 | 104 | ); 105 | }; 106 | 107 | export default App; 108 | -------------------------------------------------------------------------------- /src/Home.tsx: -------------------------------------------------------------------------------- 1 | import { useEffect, useState } from "react"; 2 | import styled from "styled-components"; 3 | import Countdown from "react-countdown"; 4 | import { Button, CircularProgress, Snackbar } from "@material-ui/core"; 5 | import Alert from "@material-ui/lab/Alert"; 6 | 7 | import * as anchor from "@project-serum/anchor"; 8 | 9 | import { LAMPORTS_PER_SOL } from "@solana/web3.js"; 10 | 11 | import { useAnchorWallet } from "@solana/wallet-adapter-react"; 12 | import { WalletDialogButton } from "@solana/wallet-adapter-material-ui"; 13 | 14 | import { 15 | CandyMachine, 16 | awaitTransactionSignatureConfirmation, 17 | getCandyMachineState, 18 | mintOneToken, 19 | shortenAddress, 20 | } from "./candy-machine"; 21 | 22 | const ConnectButton = styled(WalletDialogButton)``; 23 | 24 | const CounterText = styled.span``; // add your styles here 25 | 26 | const MintContainer = styled.div``; // add your styles here 27 | 28 | const MintButton = styled(Button)``; // add your styles here 29 | 30 | export interface HomeProps { 31 | candyMachineId: anchor.web3.PublicKey; 32 | config: anchor.web3.PublicKey; 33 | connection: anchor.web3.Connection; 34 | startDate: number; 35 | treasury: anchor.web3.PublicKey; 36 | txTimeout: number; 37 | } 38 | 39 | const Home = (props: HomeProps) => { 40 | const [api_url, setUrl] = useState(process.env.REACT_APP_API_URL) 41 | const [balance, setBalance] = useState(); 42 | const [isActive, setIsActive] = useState(false); // true when countdown completes 43 | const [isSoldOut, setIsSoldOut] = useState(false); // true when items remaining is zero 44 | const [isMinting, setIsMinting] = useState(false); // true when user got to press MINT 45 | const [isWhitelisted, SetWhitelisted] = useState(false); 46 | 47 | const [itemsAvailable, setItemsAvailable] = useState(0); 48 | const [itemsRedeemed, setItemsRedeemed] = useState(0); 49 | const [itemsRemaining, setItemsRemaining] = useState(0); 50 | 51 | const [alertState, setAlertState] = useState({ 52 | open: false, 53 | message: "", 54 | severity: undefined, 55 | }); 56 | 57 | const [startDate, setStartDate] = useState(new Date(props.startDate)); 58 | 59 | const wallet = useAnchorWallet(); 60 | const [candyMachine, setCandyMachine] = useState(); 61 | const refreshCandyMachineState = () => { 62 | (async () => { 63 | if (!wallet) return; 64 | 65 | const { 66 | candyMachine, 67 | goLiveDate, 68 | itemsAvailable, 69 | itemsRemaining, 70 | itemsRedeemed, 71 | } = await getCandyMachineState( 72 | wallet as anchor.Wallet, 73 | props.candyMachineId, 74 | props.connection 75 | ); 76 | 77 | setItemsAvailable(itemsAvailable); 78 | setItemsRemaining(itemsRemaining); 79 | setItemsRedeemed(itemsRedeemed); 80 | 81 | setIsSoldOut(itemsRemaining === 0); 82 | setStartDate(goLiveDate); 83 | setCandyMachine(candyMachine); 84 | 85 | })(); 86 | }; 87 | 88 | const onMint = async () => { 89 | try { 90 | let res = await fetch(`${api_url}/whitelisted/member/${(wallet as anchor.Wallet).publicKey.toString()}`, {method: "GET"}) 91 | const res_json = await res.json() 92 | const res_num = await JSON.parse(JSON.stringify(res_json)).reserve //The number of reserves the user has left 93 | if(!isWhitelisted){ 94 | throw new Error("You are not whitelisted"); 95 | } 96 | if(res_num - 1 < 0){ 97 | console.log("confirmed") 98 | throw new Error("Not enough reserves"); 99 | } 100 | setIsMinting(true); 101 | if (wallet && candyMachine?.program) { 102 | const mintTxId = await mintOneToken( 103 | candyMachine, 104 | props.config, 105 | wallet.publicKey, 106 | props.treasury 107 | ); 108 | 109 | const status = await awaitTransactionSignatureConfirmation( 110 | mintTxId, 111 | props.txTimeout, 112 | props.connection, 113 | "singleGossip", 114 | false 115 | ); 116 | 117 | if (!status?.err) { 118 | setAlertState({ 119 | open: true, 120 | message: "Congratulations! Mint succeeded!", 121 | severity: "success", 122 | }); 123 | const to_send = await JSON.stringify({"reserve": res_num-1}) 124 | await fetch(`${api_url}/whitelisted/update/${(wallet as anchor.Wallet).publicKey.toString()}/${process.env.REACT_APP_SECRET_KEY}`, { 125 | method: "PUT", 126 | headers: { 127 | 'Content-Type': 'application/json', 128 | }, 129 | body: to_send}) 130 | console.log("Updated Reserves for user") 131 | 132 | } else { 133 | setAlertState({ 134 | open: true, 135 | message: "Mint failed! Please try again!", 136 | severity: "error", 137 | }); 138 | } 139 | } 140 | } catch (error: any) { 141 | // TODO: blech: 142 | let message = error.message || "Minting failed! Please try again!"; 143 | if (!error.message) { 144 | if (error.message.indexOf("0x138")) { 145 | } else if (error.message.indexOf("0x137")) { 146 | message = `SOLD OUT!`; 147 | } else if (error.message.indexOf("0x135")) { 148 | message = `Insufficient funds to mint. Please fund your wallet.`; 149 | } 150 | } else { 151 | if (error.code === 311) { 152 | message = `SOLD OUT!`; 153 | setIsSoldOut(true); 154 | } else if (error.code === 312) { 155 | message = `Minting period hasn't started yet.`; 156 | } else if (error.message === "You are not whitelisted"){ 157 | message = error.message; 158 | } else if (error.message === "Not enough reserves"){ 159 | message = error.message 160 | } 161 | } 162 | 163 | setAlertState({ 164 | open: true, 165 | message, 166 | severity: "error", 167 | }); 168 | } finally { 169 | if (wallet) { 170 | const balance = await props.connection.getBalance(wallet.publicKey); 171 | setBalance(balance / LAMPORTS_PER_SOL); 172 | } 173 | setIsMinting(false); 174 | refreshCandyMachineState(); 175 | } 176 | }; 177 | 178 | useEffect(() => { 179 | (async () => { 180 | if (wallet) { 181 | const balance = await props.connection.getBalance(wallet.publicKey); 182 | setBalance(balance / LAMPORTS_PER_SOL); 183 | const data = await fetch(`${api_url}/whitelisted/member/${(wallet as anchor.Wallet).publicKey.toString()}`) 184 | if(data.status.toString() !== "404"){ 185 | SetWhitelisted(true) 186 | } 187 | else{ 188 | console.log("not found") 189 | } 190 | } 191 | })(); 192 | }, [wallet, props.connection]); 193 | 194 | useEffect(refreshCandyMachineState, [ 195 | wallet, 196 | props.candyMachineId, 197 | props.connection, 198 | ]); 199 | 200 | return ( 201 |
202 | {wallet && ( 203 |

Wallet {shortenAddress(wallet.publicKey.toBase58() || "")}

204 | )} 205 | 206 | {wallet &&

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

} 207 | 208 | {wallet &&

Total Available: {itemsAvailable}

} 209 | 210 | {wallet &&

Redeemed: {itemsRedeemed}

} 211 | 212 | {wallet &&

Remaining: {itemsRemaining}

} 213 | 214 | 215 | {!wallet ? ( 216 | Connect Wallet 217 | ) : ( 218 | 223 | {isSoldOut ? ( 224 | "SOLD OUT" 225 | ) : isActive ? ( 226 | isMinting ? ( 227 | 228 | ) : ( 229 | "MINT" 230 | ) 231 | ) : ( 232 | completed && setIsActive(true)} 235 | onComplete={() => setIsActive(true)} 236 | renderer={renderCounter} 237 | /> 238 | )} 239 | 240 | )} 241 | 242 | 243 | setAlertState({ ...alertState, open: false })} 247 | > 248 | setAlertState({ ...alertState, open: false })} 250 | severity={alertState.severity} 251 | > 252 | {alertState.message} 253 | 254 | 255 |
256 | ); 257 | }; 258 | 259 | interface AlertState { 260 | open: boolean; 261 | message: string; 262 | severity: "success" | "info" | "warning" | "error" | undefined; 263 | } 264 | 265 | const renderCounter = ({ days, hours, minutes, seconds, completed }: any) => { 266 | return ( 267 | 268 | {hours + (days || 0) * 24} hours, {minutes} minutes, {seconds} seconds 269 | 270 | ); 271 | }; 272 | 273 | export default Home; 274 | -------------------------------------------------------------------------------- /src/candy-machine.ts: -------------------------------------------------------------------------------- 1 | import * as anchor from "@project-serum/anchor"; 2 | 3 | import { 4 | MintLayout, 5 | TOKEN_PROGRAM_ID, 6 | Token, 7 | } from "@solana/spl-token"; 8 | 9 | export const CANDY_MACHINE_PROGRAM = new anchor.web3.PublicKey( 10 | "cndyAnrLdpjq1Ssp1z8xxDsB8dxe7u4HL5Nxi2K5WXZ" 11 | ); 12 | 13 | const SPL_ASSOCIATED_TOKEN_ACCOUNT_PROGRAM_ID = new anchor.web3.PublicKey( 14 | "ATokenGPvbdGVxr1b2hvZbsiqW5xWH25efTNsLJA8knL" 15 | ); 16 | 17 | const TOKEN_METADATA_PROGRAM_ID = new anchor.web3.PublicKey( 18 | "metaqbxxUerdq28cj1RbAWkYQm3ybzjb6a8bt518x1s" 19 | ); 20 | 21 | export interface CandyMachine { 22 | id: anchor.web3.PublicKey, 23 | connection: anchor.web3.Connection; 24 | program: anchor.Program; 25 | } 26 | 27 | interface CandyMachineState { 28 | candyMachine: CandyMachine; 29 | itemsAvailable: number; 30 | itemsRedeemed: number; 31 | itemsRemaining: number; 32 | goLiveDate: Date, 33 | } 34 | 35 | export const awaitTransactionSignatureConfirmation = async ( 36 | txid: anchor.web3.TransactionSignature, 37 | timeout: number, 38 | connection: anchor.web3.Connection, 39 | commitment: anchor.web3.Commitment = "recent", 40 | queryStatus = false 41 | ): Promise => { 42 | let done = false; 43 | let status: anchor.web3.SignatureStatus | null | void = { 44 | slot: 0, 45 | confirmations: 0, 46 | err: null, 47 | }; 48 | let subId = 0; 49 | status = await new Promise(async (resolve, reject) => { 50 | setTimeout(() => { 51 | if (done) { 52 | return; 53 | } 54 | done = true; 55 | console.log("Rejecting for timeout..."); 56 | reject({ timeout: true }); 57 | }, timeout); 58 | try { 59 | subId = connection.onSignature( 60 | txid, 61 | (result: any, context: any) => { 62 | done = true; 63 | status = { 64 | err: result.err, 65 | slot: context.slot, 66 | confirmations: 0, 67 | }; 68 | if (result.err) { 69 | console.log("Rejected via websocket", result.err); 70 | reject(status); 71 | } else { 72 | console.log("Resolved via websocket", result); 73 | resolve(status); 74 | } 75 | }, 76 | commitment 77 | ); 78 | } catch (e) { 79 | done = true; 80 | console.error("WS error in setup", txid, e); 81 | } 82 | while (!done && queryStatus) { 83 | // eslint-disable-next-line no-loop-func 84 | (async () => { 85 | try { 86 | const signatureStatuses = await connection.getSignatureStatuses([ 87 | txid, 88 | ]); 89 | status = signatureStatuses && signatureStatuses.value[0]; 90 | if (!done) { 91 | if (!status) { 92 | console.log("REST null result for", txid, status); 93 | } else if (status.err) { 94 | console.log("REST error for", txid, status); 95 | done = true; 96 | reject(status.err); 97 | } else if (!status.confirmations) { 98 | console.log("REST no confirmations for", txid, status); 99 | } else { 100 | console.log("REST confirmation for", txid, status); 101 | done = true; 102 | resolve(status); 103 | } 104 | } 105 | } catch (e) { 106 | if (!done) { 107 | console.log("REST connection error: txid", txid, e); 108 | } 109 | } 110 | })(); 111 | await sleep(2000); 112 | } 113 | }); 114 | 115 | //@ts-ignore 116 | if (connection._signatureSubscriptions[subId]) { 117 | connection.removeSignatureListener(subId); 118 | } 119 | done = true; 120 | console.log("Returning status", status); 121 | return status; 122 | } 123 | 124 | /* export */ const createAssociatedTokenAccountInstruction = ( 125 | associatedTokenAddress: anchor.web3.PublicKey, 126 | payer: anchor.web3.PublicKey, 127 | walletAddress: anchor.web3.PublicKey, 128 | splTokenMintAddress: anchor.web3.PublicKey 129 | ) => { 130 | const keys = [ 131 | { pubkey: payer, isSigner: true, isWritable: true }, 132 | { pubkey: associatedTokenAddress, isSigner: false, isWritable: true }, 133 | { pubkey: walletAddress, isSigner: false, isWritable: false }, 134 | { pubkey: splTokenMintAddress, isSigner: false, isWritable: false }, 135 | { 136 | pubkey: anchor.web3.SystemProgram.programId, 137 | isSigner: false, 138 | isWritable: false, 139 | }, 140 | { pubkey: TOKEN_PROGRAM_ID, isSigner: false, isWritable: false }, 141 | { 142 | pubkey: anchor.web3.SYSVAR_RENT_PUBKEY, 143 | isSigner: false, 144 | isWritable: false, 145 | }, 146 | ]; 147 | return new anchor.web3.TransactionInstruction({ 148 | keys, 149 | programId: SPL_ASSOCIATED_TOKEN_ACCOUNT_PROGRAM_ID, 150 | data: Buffer.from([]), 151 | }); 152 | } 153 | 154 | export const getCandyMachineState = async ( 155 | anchorWallet: anchor.Wallet, 156 | candyMachineId: anchor.web3.PublicKey, 157 | connection: anchor.web3.Connection, 158 | ): Promise => { 159 | const provider = new anchor.Provider(connection, anchorWallet, { 160 | preflightCommitment: "recent", 161 | }); 162 | 163 | const idl = await anchor.Program.fetchIdl( 164 | CANDY_MACHINE_PROGRAM, 165 | provider 166 | ); 167 | 168 | const program = new anchor.Program(idl, CANDY_MACHINE_PROGRAM, provider); 169 | const candyMachine = { 170 | id: candyMachineId, 171 | connection, 172 | program, 173 | } 174 | 175 | const state: any = await program.account.candyMachine.fetch(candyMachineId); 176 | 177 | const itemsAvailable = state.data.itemsAvailable.toNumber(); 178 | const itemsRedeemed = state.itemsRedeemed.toNumber(); 179 | const itemsRemaining = itemsAvailable - itemsRedeemed; 180 | 181 | let goLiveDate = state.data.goLiveDate.toNumber(); 182 | goLiveDate = new Date(goLiveDate * 1000); 183 | 184 | console.log({ 185 | itemsAvailable, 186 | itemsRedeemed, 187 | itemsRemaining, 188 | goLiveDate, 189 | }) 190 | 191 | return { 192 | candyMachine, 193 | itemsAvailable, 194 | itemsRedeemed, 195 | itemsRemaining, 196 | goLiveDate, 197 | }; 198 | } 199 | 200 | const getMasterEdition = async ( 201 | mint: anchor.web3.PublicKey 202 | ): Promise => { 203 | return ( 204 | await anchor.web3.PublicKey.findProgramAddress( 205 | [ 206 | Buffer.from("metadata"), 207 | TOKEN_METADATA_PROGRAM_ID.toBuffer(), 208 | mint.toBuffer(), 209 | Buffer.from("edition"), 210 | ], 211 | TOKEN_METADATA_PROGRAM_ID 212 | ) 213 | )[0]; 214 | }; 215 | 216 | const getMetadata = async ( 217 | mint: anchor.web3.PublicKey 218 | ): Promise => { 219 | return ( 220 | await anchor.web3.PublicKey.findProgramAddress( 221 | [ 222 | Buffer.from("metadata"), 223 | TOKEN_METADATA_PROGRAM_ID.toBuffer(), 224 | mint.toBuffer(), 225 | ], 226 | TOKEN_METADATA_PROGRAM_ID 227 | ) 228 | )[0]; 229 | }; 230 | 231 | const getTokenWallet = async ( 232 | wallet: anchor.web3.PublicKey, 233 | mint: anchor.web3.PublicKey 234 | ) => { 235 | return ( 236 | await anchor.web3.PublicKey.findProgramAddress( 237 | [wallet.toBuffer(), TOKEN_PROGRAM_ID.toBuffer(), mint.toBuffer()], 238 | SPL_ASSOCIATED_TOKEN_ACCOUNT_PROGRAM_ID 239 | ) 240 | )[0]; 241 | }; 242 | 243 | export const mintOneToken = async ( 244 | candyMachine: CandyMachine, 245 | config: anchor.web3.PublicKey, // feels like this should be part of candyMachine? 246 | payer: anchor.web3.PublicKey, 247 | treasury: anchor.web3.PublicKey, 248 | ): Promise => { 249 | const mint = anchor.web3.Keypair.generate(); 250 | const token = await getTokenWallet(payer, mint.publicKey); 251 | const { connection, program } = candyMachine; 252 | const metadata = await getMetadata(mint.publicKey); 253 | const masterEdition = await getMasterEdition(mint.publicKey); 254 | 255 | const rent = await connection.getMinimumBalanceForRentExemption( 256 | MintLayout.span 257 | ); 258 | 259 | return await program.rpc.mintNft({ 260 | accounts: { 261 | config, 262 | candyMachine: candyMachine.id, 263 | payer: payer, 264 | wallet: treasury, 265 | mint: mint.publicKey, 266 | metadata, 267 | masterEdition, 268 | mintAuthority: payer, 269 | updateAuthority: payer, 270 | tokenMetadataProgram: TOKEN_METADATA_PROGRAM_ID, 271 | tokenProgram: TOKEN_PROGRAM_ID, 272 | systemProgram: anchor.web3.SystemProgram.programId, 273 | rent: anchor.web3.SYSVAR_RENT_PUBKEY, 274 | clock: anchor.web3.SYSVAR_CLOCK_PUBKEY, 275 | }, 276 | signers: [mint], 277 | instructions: [ 278 | anchor.web3.SystemProgram.createAccount({ 279 | fromPubkey: payer, 280 | newAccountPubkey: mint.publicKey, 281 | space: MintLayout.span, 282 | lamports: rent, 283 | programId: TOKEN_PROGRAM_ID, 284 | }), 285 | Token.createInitMintInstruction( 286 | TOKEN_PROGRAM_ID, 287 | mint.publicKey, 288 | 0, 289 | payer, 290 | payer 291 | ), 292 | createAssociatedTokenAccountInstruction( 293 | token, 294 | payer, 295 | payer, 296 | mint.publicKey 297 | ), 298 | Token.createMintToInstruction( 299 | TOKEN_PROGRAM_ID, 300 | mint.publicKey, 301 | token, 302 | payer, 303 | [], 304 | 1 305 | ), 306 | ], 307 | }); 308 | } 309 | 310 | export const shortenAddress = (address: string, chars = 4): string => { 311 | return `${address.slice(0, chars)}...${address.slice(-chars)}`; 312 | }; 313 | 314 | const sleep = (ms: number): Promise => { 315 | return new Promise((resolve) => setTimeout(resolve, ms)); 316 | } -------------------------------------------------------------------------------- /src/index.css: -------------------------------------------------------------------------------- 1 | body { 2 | margin: 0; 3 | font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', 'Oxygen', 4 | 'Ubuntu', 'Cantarell', 'Fira Sans', 'Droid Sans', 'Helvetica Neue', 5 | sans-serif; 6 | -webkit-font-smoothing: antialiased; 7 | -moz-osx-font-smoothing: grayscale; 8 | background-color: #303030; 9 | color: #FFFFFF; 10 | } 11 | 12 | code { 13 | font-family: source-code-pro, Menlo, Monaco, Consolas, 'Courier New', 14 | monospace; 15 | } 16 | -------------------------------------------------------------------------------- /src/index.tsx: -------------------------------------------------------------------------------- 1 | import React from 'react'; 2 | import ReactDOM from 'react-dom'; 3 | import './index.css'; 4 | import App from './App'; 5 | import reportWebVitals from './reportWebVitals'; 6 | 7 | ReactDOM.render( 8 | 9 | 10 | , 11 | document.getElementById('root') 12 | ); 13 | 14 | // If you want to start measuring performance in your app, pass a function 15 | // to log results (for example: reportWebVitals(console.log)) 16 | // or send to an analytics endpoint. Learn more: https://bit.ly/CRA-vitals 17 | reportWebVitals(); 18 | -------------------------------------------------------------------------------- /src/logo.svg: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /src/react-app-env.d.ts: -------------------------------------------------------------------------------- 1 | /// 2 | -------------------------------------------------------------------------------- /src/reportWebVitals.ts: -------------------------------------------------------------------------------- 1 | import { ReportHandler } from 'web-vitals'; 2 | 3 | const reportWebVitals = (onPerfEntry?: ReportHandler) => { 4 | if (onPerfEntry && onPerfEntry instanceof Function) { 5 | import('web-vitals').then(({ getCLS, getFID, getFCP, getLCP, getTTFB }) => { 6 | getCLS(onPerfEntry); 7 | getFID(onPerfEntry); 8 | getFCP(onPerfEntry); 9 | getLCP(onPerfEntry); 10 | getTTFB(onPerfEntry); 11 | }); 12 | } 13 | }; 14 | 15 | export default reportWebVitals; 16 | -------------------------------------------------------------------------------- /src/setupTests.ts: -------------------------------------------------------------------------------- 1 | // jest-dom adds custom jest matchers for asserting on DOM nodes. 2 | // allows you to do things like: 3 | // expect(element).toHaveTextContent(/react/i) 4 | // learn more: https://github.com/testing-library/jest-dom 5 | import '@testing-library/jest-dom'; 6 | -------------------------------------------------------------------------------- /tsconfig.json: -------------------------------------------------------------------------------- 1 | { 2 | "compilerOptions": { 3 | "target": "es5", 4 | "lib": [ 5 | "dom", 6 | "dom.iterable", 7 | "esnext" 8 | ], 9 | "allowJs": true, 10 | "skipLibCheck": true, 11 | "esModuleInterop": true, 12 | "allowSyntheticDefaultImports": true, 13 | "strict": true, 14 | "forceConsistentCasingInFileNames": true, 15 | "noFallthroughCasesInSwitch": true, 16 | "module": "esnext", 17 | "moduleResolution": "node", 18 | "resolveJsonModule": true, 19 | "isolatedModules": true, 20 | "noEmit": true, 21 | "jsx": "react-jsx" 22 | }, 23 | "include": [ 24 | "src" 25 | ] 26 | } 27 | --------------------------------------------------------------------------------