Skip to content

anubhav-auth/nex-mint

Repository files navigation

========

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.

Features

  • 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.

Prerequisites

Before you begin, make sure you have the following installed:

Getting Started

Clone the repository:

git clone https://github.com/anubhav-auth/nex-mint.git
cd nex-mint

Install dependencies:

yarn install

Building the Program

To build the program, run:

anchor build

This command compiles the Rust program located in the programs/nex-mint directory.

Running Tests

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.

Deploying the Program

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.

Project Structure

  • 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).

Troubleshooting

  • Module Type Warning:
    If you see a warning like "Module type of ... is not specified", add "type": "module" to your package.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.

Contributing

Contributions are welcome! If you have suggestions or bug fixes, please open an issue or submit a pull request.

License

This project is licensed under the MIT License.

Acknowledgements


About

Nex Mint is a Solana program built with Anchor for creating and minting SPL tokens. It supports token initialization, associated accounts, and minting, with a full TypeScript test suite.

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors