========
Nex Mint is a Solana program built with Anchor that demonstrates how to create and mint tokens using the SPL Token program. This project shows how to:
- Initialize a new token mint (with metadata)
- Create associated token accounts
- Mint tokens to a destination account
It also includes a complete test suite written in TypeScript using Anchor's testing framework.
- Token Initialization: Create a new SPL token mint with metadata.
- Minting: Mint new tokens to an associated token account.
- Anchor Framework: Simplified development, testing, and deployment of Solana programs.
- Comprehensive Testing: Automated tests ensure that the minting process works as expected.
Before you begin, make sure you have the following installed:
Clone the repository:
git clone https://github.com/anubhav-auth/nex-mint.git
cd nex-mint
Install dependencies:
yarn install
To build the program, run:
anchor build
This command compiles the Rust program located in the programs/nex-mint directory.
Run the test suite with:
anchor test
You should see output indicating a successful test run (e.g., "mints tokens successfully"). Note that you might see some Node.js warnings (e.g., regarding experimental features or module type); these can generally be ignored or resolved by updating your package.json as described below.
To deploy your program on a local validator, run:
anchor deploy
For deployment on Devnet or Mainnet, update your Anchor.toml with the appropriate provider endpoint and configuration.
-
programs/nex-mint/
Contains the Rust source code for your Solana program built with Anchor. -
tests/
Contains TypeScript tests for the program. These tests mint tokens and verify account balances. -
Anchor.toml
Anchor configuration file, which includes settings for your provider, wallet, and program ID. -
package.json
Contains your Node.js dependencies and scripts (e.g., for running tests).
-
Module Type Warning:
If you see a warning like "Module type of ... is not specified", add"type": "module"to yourpackage.json:{ "name": "nex-mint", "version": "1.0.0", "type": "module", ... } -
Experimental Warnings:
Node.js may warn about experimental features (e.g., type stripping). These warnings are generally safe to ignore during development.
Contributions are welcome! If you have suggestions or bug fixes, please open an issue or submit a pull request.
This project is licensed under the MIT License.