Simple app to verify Solana NFTs on a discord server. It consists of two parts which are React Web3 App and a discord bot written with DiscordJS. The react app can be used seperately without the discord bot if preferred.
This app is built with Moralis and its SOLANA API to handle the authentication, get the user's NFTs and to get the metadata of the NFTs to do the verification. You need to sign up to Moralis, set up a server and get your Application ID
and Server URL
which are totally free to do. You can follow these instructions.
You need to create a discord application from discord's developer portal, invite your bot to your server and get the Bot's secret token. How to get your token.
First install the dependencies
npm run install-all
then you can run the app concurrently with
npm run dev
or to run the discord bot and the UI seperately you can run
npm start
in both directories seperately.
Then run the following command from discord to open up an interaction for your users to verify their NFTs
!verifyNFT
Change the name of .env.example
file into .env
and fill in the fields.
REACT_APP_MORALIS_APP_ID=<Your Moraliss APP_ID>
REACT_APP_MORALIS_SERVER_URL=<Your Moralis Server URL>
{
"updateAuthority": "<updateAuthority of the nft to be verified>",
"network" : "<mainnet or devnet>"
"discordURL": <URL of discord server> (eg. http://localhost:9090/)
}
Change the name of .env.example
file into .env
and fill in the fields.
TOKEN=<Bot TOKEN>
APP_URL=<URL of React App> (eg. http://localhost:3000/)
CHANNEL_NAME=<Name of the discord channel where verified user's will be announced with their NFTs>
Currently this app uses only one updateAuthority to check if an NFT is from a certain collection. However, some collections may have more than one updateAuthority. Therefore, to be able to use this app in production if your collection requires more than one updateAuthority, you have the following options:
- You can change a few lines of codes to compare more than one updateAuthority. You may have to gather all of those update authorities of a collection. If you are verifying your own nft collection you already have them.
- If you have the candyMachineID of the collection you can use Solana-Web3.js Library to get all NFTs from a certain collection with the candyMachineID. This may help.
There may be some bugs and there are many things that could be improved and features that could be added. Please feel free to fork the repository and send pull requests or open up issues.