Introduction
The Mercury Core Economy Service provides a blockchain-inspired ledger system for managing user balances, transactions, and currency operations. As the code says: “imagine a blockchain but without the blocks or the chain.”Base URL
The Economy Service runs on port 2009:Currency System
The economy uses a micro-unit based currency system:- Micro: 1 (smallest unit)
- Milli: 1,000 micro
- Unit: 1,000,000 micro (standard unit)
- Kilo: 1,000 units
- Mega: 1,000,000 units
- Giga: 1,000,000,000 units
- Tera: 1,000,000,000,000 units
uint64 integers in micro units. For example, 10000000 represents 10.000000 unit.
Stipend System
Users can claim a stipend once every 12 hours:- Stipend Amount: 10 units (10,000,000 micro)
- Cooldown: 12 hours (43,200,000 milliseconds)
Available Endpoints
Balance Operations
GET /balance/{id}- Get user balanceGET /currentStipend- Get current stipend amountPOST /stipend/{id}- Claim stipend for user
Transaction Operations
POST /transact- Create a transaction between usersGET /transactions/{id}- Get transaction history for a userGET /transactions- Get all transactions (admin only)
Currency Operations
POST /mint- Create new currency (admin only)POST /burn- Destroy currency (admin only)
Transaction Types
The ledger supports three types of events:- Transaction: Transfer currency between users
- Mint: Create new currency for a user
- Burn: Destroy currency from a user
Error Responses
All endpoints return standard HTTP status codes:200 OK- Successful operation400 Bad Request- Invalid input or validation error500 Internal Server Error- Server error