[ CONVEX COMPONENT · STABLE · MIT ]
@vllnt/convex-wallet
Consumable balances and economy ledger with atomic spend and lazy regen
STABLE 0.1.0 · 2 GitHub stars
Package details
Install
The untagged install gets the latest stable version (0.1.0). The canary tag tracks main (0.1.1-canary.3b72732).
pnpm add @vllnt/convex-wallet
pnpm add @vllnt/convex-wallet@canaryRegister the component
Add it to your app’s convex/convex.config.ts, then run npx convex dev to generate the references.
import { defineApp } from "convex/server";
import wallet from "@vllnt/convex-wallet/convex.config";
const app = defineApp();
app.use(wallet);
export default app;Use it
Usage, options and examples are in the package README.
Downloads
- Last 7 days
- 13
- Since first publish
- 1,990
Downloads per week since 14 June 2026, oldest on the left. Weeks count back from 21 November 2026, so the first one may be shorter than seven days.
13 downloads in the last 7 days. 1,990 downloads since 14 June 2026. Source: npm, counted through 21 November 2026.
Show downloads per week as a table
| Week | Downloads |
|---|---|
| 14 June 2026 to 20 June 2026 | 543 |
| 21 June 2026 to 27 June 2026 | 17 |
| 28 June 2026 to 4 July 2026 | 23 |
| 5 July 2026 to 11 July 2026 | 21 |
| 12 July 2026 to 18 July 2026 | 12 |
| 19 July 2026 to 25 July 2026 | 5 |
| 26 July 2026 to 1 August 2026 | 7 |
| 2 August 2026 to 8 August 2026 | 8 |
| 9 August 2026 to 15 August 2026 | 15 |
| 16 August 2026 to 22 August 2026 | 8 |
| 23 August 2026 to 29 August 2026 | 5 |
| 30 August 2026 to 5 September 2026 | 657 |
| 6 September 2026 to 12 September 2026 | 96 |
| 13 September 2026 to 19 September 2026 | 16 |
| 20 September 2026 to 26 September 2026 | 9 |
| 27 September 2026 to 3 October 2026 | 58 |
| 4 October 2026 to 10 October 2026 | 42 |
| 11 October 2026 to 17 October 2026 | 35 |
| 18 October 2026 to 24 October 2026 | 25 |
| 25 October 2026 to 31 October 2026 | 182 |
| 1 November 2026 to 7 November 2026 | 126 |
| 8 November 2026 to 14 November 2026 | 67 |
| 15 November 2026 to 21 November 2026 | 13 |
Release history
Every release on a timeline, oldest on the left. A tall mark with its version is a stable release; a short mark is a canary build. The time axis is the one of the downloads chart, so a release stands above the week it shipped in.
1 stable release and 9 canary builds since 14 June 2026. Latest stable: 0.1.0 on 1 September 2026.
Show every release as a table
| Version | Kind | Published |
|---|---|---|
| 0.1.1-canary.3b72732 | canary | 31 October 2026 |
| 0.1.0 | stable | 1 September 2026 |
| 0.1.0-canary.89dde0e | canary | 1 September 2026 |
| 0.1.0-canary.520f224 | canary | 31 August 2026 |
| 0.1.0-canary.fb8ccba | canary | 31 August 2026 |
| 0.1.0-canary.e1b41ba | canary | 31 August 2026 |
| 0.1.0-canary.b5ca2bd | canary | 16 June 2026 |
| 0.1.0-canary.56b60b0 | canary | 16 June 2026 |
| 0.1.0-canary.3a56ec7 | canary | 16 June 2026 |
| 0.1.0-canary.6d92230 | canary | 14 June 2026 |
Changelog
The newest stable releases of @vllnt/convex-wallet, with the notes from its changelog.
0.1.0
Changed
- Treat Convex
_generatedoutput as CLI-owned, exclude it from formatting, and expose a dedicated codegen script. - Refresh all direct dependencies to their latest compatible releases for canary validation.
- Require
convex@^1.45.0and updateconvex-testto^0.0.56. - Bound ledger history reads to integer limits from 1 through 1000.
Breaking (relative to the 0.1.0 canaries)
historynow throwsINVALID_LIMITfor limits outside 1 through 1000 or for non-finite/non-integer values. Clamp explicit limits anddefaultHistoryLimitto this range before upgrading.
Fixed
-
Skip redundant balance patches when a failed spend or transfer did not advance regeneration.
-
Ledger delta correctness —
earnand the receiver leg oftransfernow record the actual balance change indelta, not the requested amount. When a credit is clamped bymax,deltaequals the real increase only. -
Regen config validation —
applyRegennow throwsINVALID_REGENwhenintervalMs,amount, orcapis non-finite or non-positive, preventing0 * Infinity = NaNfrom corruptinglastRegenAt. -
Regen below-stored guard —
applyRegennow ensures the projected balance is never reduced belowstored(fixes the case wherestored > regen.cappreviously silently destroyed funds).
Added
-
Idempotent spend —
spendnow accepts an optionalidempotencyKey. A replay of an already-recorded key returns the current balance without a second debit or ledger row, preventing double-charges on host retries. -
First release of
@vllnt/convex-wallet. -
Per-currency
maxceiling — credits clamp to it onearn,grant, and the receiver leg oftransfer. -
Internal hourly
pruneLedgercron (idempotent / at-least-once) that deletes ledger rows past the retention window and expires idempotency keys past the idempotency window; configurable windows on direct call.
Security / Fixed
- Amount guards (abuse) —
earn/grant/spend/transfernow reject non-finite or non-positive amounts withINVALID_AMOUNT. Closes a mint exploit where a negativespendcredited funds, and balance corruption fromNaN/Infinity. - Server-sourced time — the host no longer supplies
now; every mutation and query readsDate.now()server-side, so a forged/stale clock cannot drive extra regen. Removed the*Atexample wrappers. - Monotonic regen —
applyRegennever advances the regen pointer pastnowand treats a backwards/equal clock as a no-op (no over-regen, no rewind). - Per-
(subject, currency)idempotency — theby_idemindex is re-keyed to(subjectRef, currency, idempotencyKey)so a key reused across subjects or currencies is independent and no longer silently drops a legitimate grant. - Self-transfer guard —
transferwithfromRef === toRefreturnsSELF_TRANSFERinstead of debiting-then-crediting one row. - Regen-aware
balances()— the multi-currency overview now applies each currency's regen (via a client-passed map), matchingbalance()(no stale divergence).
Changed
- Failure results carry a typed
code(INSUFFICIENT|SELF_TRANSFER) instead of a free-textreason;reasonremains the human ledger note.
- Treat Convex
Licence
Released under the MIT licence. The full text is in the source repository.
[ PACKAGE ]
- Stable
- 0.1.0
- Canary
- 0.1.1-canary.3b72732
- GitHub stars
- 2 GitHub stars
- Licence
- MIT
- Issues
- Open an issue