This is the backend API for managing KRC20 tokens and transactions. It provides endpoints for fetching token data, updating databases, and uploading token logos.
- Fetch mint totals and transactions for tokens
- Update database for all tokens or specific tickers
- Upload and serve token logos
- Retrieve price data for tokens
- Check API health
-
Clone the repository:
git clone https://github.com/argonmining/krc20-backend.git cd krc20-backend
-
Install dependencies:
npm install
-
Set up environment variables:
Create a
.env
file in the root directory and add the necessary environment variables. Example:DATABASE_URL=your_database_url PORT=3000 PRICE_UPDATE_INTERVAL=15
-
Generate Prisma client:
npm run prisma:generate
-
Build the project:
npm run build
-
Start the server:
npm start
-
For development:
npm run dev
Refer to the OpenAPI Specification for detailed information about the available endpoints and their usage.
- GET /api/mint-Totals: Retrieve mint totals for all tokens.
- GET /api/transactions: Get transactions for a specific token.
- POST /api/{ticker}/upload-logo: Upload a new logo for a specific token and update the database.
Contributions are welcome! Please open an issue or submit a pull request for any improvements or bug fixes.
This project is licensed under the ISC License.