Skip to content
M3rcena edited this page Nov 1, 2026 · 4 revisions

๐Ÿช™ Welcome to @m3rcena/eco Documentation

Welcome to the official documentation for @m3rcena/eco โ€” the ultimate enterprise-grade Discord.js v14 economy, banking, progression, and casino engine.


๐ŸŒŸ What is @m3rcena/eco?

@m3rcena/eco brings real-world macroeconomic mechanics to Discord bots. Instead of a trivial wallet/bank counter, @m3rcena/eco provides a comprehensive financial ecosystem:

  • ๐Ÿฆ Advanced Banking & Vaults: 7 upgradeable vault tiers with daily compound interest and robbery protection.
  • ๐Ÿ’ณ FICO Credit Scoring (300โ€“850): Mathematical credit algorithm evaluating loan repayment history, credit utilization, and debt defaults.
  • ๐Ÿ“œ Collateralized Bank Loans: 4 borrowing tiers with dynamic interest rates, payment schedules, and debt collection consequences.
  • โšก Municipal Utility Bills: Realistic electricity, water, and property maintenance bills generated dynamically.
  • ๐Ÿ›๏ธ Progressive Wealth Taxes: Progressive tax brackets (2%โ€“8%) with high-stakes tax evasion mechanics and audits.
  • ๐Ÿ’ผ Dynamic Career Tracks: 10 professional tiers, work shifts, promotion criteria, and hourly wage scaling.
  • ๐Ÿฌ Backpack Inventory & Enterprises: Dynamic item store, inventory management, and passive income businesses.
  • ๐ŸŽฐ Next-Gen Casino Suite: Discord Components V2 interactive Blackjack, Slots, Roulette, Crash, Coinflip, and Dice.
  • ๐Ÿ“ˆ Simulated Stock Market: Live market simulator with bull/bear cycles and Rust-powered (@napi-rs/canvas) candlestick charts.
  • ๐Ÿšจ Syndicate Multiplayer Heists: Cooperative crew-based bank robberies with roles (Hacker, Driver, Muscle, Infiltrator).
  • ๐Ÿพ Companion Pets & Foraging: Adopt pets, level loyalty, feed them, and send on foraging expeditions.
  • ๐ŸŒ‰ First-Class Bridge Integration: Native EcoBridgeRouter connects seamlessly with @m3rcena/bridge for web dashboards.
  • ๐Ÿ’พ Native SQLite & Prisma Handlers: Built-in zero-config local SQLite (node:sqlite) and auto-migrating Prisma ORM storage.

๐Ÿš€ Quick Navigation

Guide Description
๐Ÿ—๏ธ Architecture & Database Handlers SQLite, Prisma auto-migration, SQL table definitions, options, and storage adapters.
๐Ÿฆ Real Economy & Banking Vault tiers, compound interest, credit score calculation, loans, bills, taxes, and audits.
๐Ÿ’ผ Careers, Shop & Businesses Work shifts, promotions, backpack items, inventory trading, and passive income enterprises.
๐ŸŽฐ Next-Gen Casino Suite Discord Components V2 Blackjack, Roulette, Slots, Crash, Coinflip, and Dice.
๐Ÿ“ˆ Stocks, Heists & Pets Simulated stock exchange, candlestick chart generator, multiplayer bank heists, pets, and crates.
๐ŸŒ‰ Dashboard Bridge Integration Connecting @m3rcena/eco to @m3rcena/bridge and web dashboards.
๐ŸŽฎ Weky Minigames Integration Automated payouts, win streaks, PvP coin wagers, and tournament prizes with @m3rcena/weky.

๐Ÿ“ฆ Installation

npm install @m3rcena/eco @m3rcena/bridge discord.js

System Requirements

  • Node.js: >= 22.0.0
  • Discord.js: ^14.0.0
  • TypeScript: >= 5.0

โšก 60-Second Quickstart

import { Client, GatewayIntentBits } from "discord.js";
import { EcoManager, EcoProfileUI, EcoShopUI } from "@m3rcena/eco";

const client = new Client({
  intents: [GatewayIntentBits.Guilds, GatewayIntentBits.GuildMessages, GatewayIntentBits.MessageContent],
});

// 1. Initialize Eco Manager with zero-config SQLite
export const eco = new EcoManager({
  currencySymbol: "๐Ÿช™",
  currencyName: "Coins",
  embedColor: "#F1C40F",
  database: "sqlite", // Automatically creates ./eco.sqlite with tables & indexes
});

// 2. Slash Command / Message Example
client.on("messageCreate", async (message) => {
  if (message.author.bot) return;

  if (message.content === "!profile") {
    // Render native Components V2 profile passport
    return new EcoProfileUI(eco, { context: message }).start();
  }

  if (message.content === "!work") {
    const shift = await eco.work(message.author.id, message.guildId ?? undefined);
    if (!shift.success) return message.reply("โณ On cooldown!");
    return message.reply(`๐Ÿ’ผ Completed shift as **${shift.jobTitle}** and earned **๐Ÿช™ ${shift.earned.toLocaleString()}**! (+${shift.xp} XP)`);
  }

  if (message.content === "!shop") {
    return new EcoShopUI(eco, { context: message }).start();
  }
});

client.login(process.env.DISCORD_TOKEN);

Clone this wiki locally