A Solana-based backend service for TokenMill, providing token management, staking, and vesting functionality.
TokenMill Backend is an Express.js server that interfaces with the TokenMill Solana program, providing REST API endpoints for:
- Token creation and management
- Market operations
- Staking functionality
- Vesting schedules
- Configuration management
- Node.js (v16 or higher)
- npm or yarn
- Solana CLI tools
- A Solana wallet with some SOL for transactions
- Clone the repository:
git clone <repository-url>
cd token-mill-be- Install dependencies:
npm install- Create a
.envfile in the root directory:
RPC_URL=https://api.devnet.solana.com
PROGRAM_ID=JoeaRXgtME3jAoz5WuFXGEndfv4NPH9nBxsLq44hk9JStart the development server:
npm run devBuild the project:
npm run buildPOST /api/config- Create a new TokenMill configuration- Required body:
{ authority, protocolFeeRecipient, protocolFeeShare, referralFeeShare }
- Required body:
POST /api/quote-token-badge- Get token badge quotePOST /api/tokens- Create a new token- Required body: Token creation parameters
POST /api/markets- Create a new market- Required body: Market creation parameters
POST /api/stake- Create a new staking position- Required body: Staking parameters
POST /api/vesting- Create a new vesting schedule- Required body: Vesting schedule parameters
POST /api/vesting/:marketAddress/claim- Claim vested tokens- Required params: marketAddress
- Required body: Claim parameters
POST /api/swap- Excutes swap using swap authority- `POST /api/free-market - Unlocks the market
token-mill-be/
├── src/
│ ├── idl/ # Solana program interface definitions
│ ├── types/ # TypeScript type definitions
│ ├── utils/ # Utility functions and classes
│ └── index.ts # Main application entry point
├── dist/ # Compiled JavaScript output
├── .env # Environment variables
└── package.json
@coral-xyz/anchor- Solana development framework@solana/web3.js- Solana web3 library@solana/spl-token- SPL Token program interactionsexpress- Web server frameworktypescript- Type support- Additional utilities:
big.js,bn.js,bs58,dotenv
- Fork the repository
- Create your feature branch (
git checkout -b feature/amazing-feature) - Commit your changes (
git commit -m 'Add some amazing feature') - Push to the branch (
git push origin feature/amazing-feature) - Open a Pull Request
ISC License
For support, please open an issue in the repository or contact the maintainers.