Get Hedhog updates in your inbox
New releases, fresh recipes, and breaking changes — no spam.
LMS Submodule
bitcode-wallets
Virtual currency (Bitcode) wallets for learners with a credit/debit transaction ledger. Bitcodes are awarded primarily through Achievements.
Source path: libraries/lms/src/bitcode-wallet
Module file: bitcode-wallet.module.ts
Introduction
Each wallet is a one-to-one ledger tied to a `person`, holding a running balance built from individual credit/debit transactions rather than a single mutable number — every change to a student's Bitcode balance is recorded as its own auditable row with a type, amount, and optional description. The admin-facing `BitcodeWalletController` (`/lms/bitcode-wallets`) covers wallet CRUD and lets an operator post manual transactions directly.
A second, self-service path exists outside this submodule's own controller: the Platforma student portal exposes `GET /lms/platforma/bitcodes/wallet` and `POST /lms/platforma/bitcodes/transactions`, letting an authenticated student view their own wallet and create their own transactions using a dedicated `CreateCurrentBitcodeWalletTransactionDto` (which adds an optional `source` field not present on the admin DTO, for tagging where a self-service credit originated). An `UpdateBitcodeWalletTransactionDto` also exists in source but has no controller route anywhere in the codebase — individual transactions can be created but never edited or listed on their own; the wallet's transaction history is presumably surfaced as part of the wallet-detail response instead.
HTTP Endpoints
6 endpoints
Paginated wallet list, searchable by person name.
- Query
- page, pageSize, search
Gets a wallet including its transaction history.
- Params
- id (int)
Creates a wallet for a person.
Body
| Field | Type | Required | Notes |
|---|---|---|---|
| personId | number | yes | Min 1 |
Updates the person linked to a wallet.
- Params
- id (int)
Body
| Field | Type | Required | Notes |
|---|---|---|---|
| personId | number | no | Min 1 |
Deletes a wallet; 204 No Content.
- Params
- id (int)
Records a credit or debit transaction on the wallet.
- Params
- id (int, wallet id)
Body
| Field | Type | Required | Notes |
|---|---|---|---|
| type | 'credit' | 'debit' | yes | — |
| amount | number | yes | Min 1 |
| description | string | null | no | Max 2000 chars |
MCP Tools
Named tools callable by AI models via the Model Context Protocol (MCP).
lms.bitcode-wallet.listLists LMS BitCode wallets with optional pagination and search by person name
lms.bitcode-wallet.getReturns a single BitCode wallet by ID including its transaction history
lms.bitcode-wallet.createCreates a new BitCode wallet for a person
lms.bitcode-wallet.updateUpdates the person linked to a BitCode wallet
lms.bitcode-wallet.deleteDeletes a BitCode wallet by ID
lms.bitcode-wallet.create-transactionCreates a credit or debit transaction on a BitCode wallet