Skip to content

[ 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).

terminal
pnpm add @vllnt/convex-wallet
pnpm add @vllnt/convex-wallet@canary

Register the component

Add it to your app’s convex/convex.config.ts, then run npx convex dev to generate the references.

convex/convex.config.ts
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.

Read the 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
WeekDownloads
14 June 2026 to 20 June 2026543
21 June 2026 to 27 June 202617
28 June 2026 to 4 July 202623
5 July 2026 to 11 July 202621
12 July 2026 to 18 July 202612
19 July 2026 to 25 July 20265
26 July 2026 to 1 August 20267
2 August 2026 to 8 August 20268
9 August 2026 to 15 August 202615
16 August 2026 to 22 August 20268
23 August 2026 to 29 August 20265
30 August 2026 to 5 September 2026657
6 September 2026 to 12 September 202696
13 September 2026 to 19 September 202616
20 September 2026 to 26 September 20269
27 September 2026 to 3 October 202658
4 October 2026 to 10 October 202642
11 October 2026 to 17 October 202635
18 October 2026 to 24 October 202625
25 October 2026 to 31 October 2026182
1 November 2026 to 7 November 2026126
8 November 2026 to 14 November 202667
15 November 2026 to 21 November 202613

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
VersionKindPublished
0.1.1-canary.3b72732canary31 October 2026
0.1.0stable1 September 2026
0.1.0-canary.89dde0ecanary1 September 2026
0.1.0-canary.520f224canary31 August 2026
0.1.0-canary.fb8ccbacanary31 August 2026
0.1.0-canary.e1b41bacanary31 August 2026
0.1.0-canary.b5ca2bdcanary16 June 2026
0.1.0-canary.56b60b0canary16 June 2026
0.1.0-canary.3a56ec7canary16 June 2026
0.1.0-canary.6d92230canary14 June 2026

Changelog

The newest stable releases of @vllnt/convex-wallet, with the notes from its changelog.

  1. 0.1.0

    Changed
    • Treat Convex _generated output 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.0 and update convex-test to ^0.0.56.
    • Bound ledger history reads to integer limits from 1 through 1000.
    Breaking (relative to the 0.1.0 canaries)
    • history now throws INVALID_LIMIT for limits outside 1 through 1000 or for non-finite/non-integer values. Clamp explicit limits and defaultHistoryLimit to this range before upgrading.
    Fixed
    • Skip redundant balance patches when a failed spend or transfer did not advance regeneration.

    • Ledger delta correctness — earn and the receiver leg of transfer now record the actual balance change in delta, not the requested amount. When a credit is clamped by max, delta equals the real increase only.

    • Regen config validation — applyRegen now throws INVALID_REGEN when intervalMs, amount, or cap is non-finite or non-positive, preventing 0 * Infinity = NaN from corrupting lastRegenAt.

    • Regen below-stored guard — applyRegen now ensures the projected balance is never reduced below stored (fixes the case where stored > regen.cap previously silently destroyed funds).

    Added
    • Idempotent spend — spend now accepts an optional idempotencyKey. 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 max ceiling — credits clamp to it on earn, grant, and the receiver leg of transfer.

    • Internal hourly pruneLedger cron (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 / transfer now reject non-finite or non-positive amounts with INVALID_AMOUNT. Closes a mint exploit where a negative spend credited funds, and balance corruption from NaN / Infinity.
    • Server-sourced time — the host no longer supplies now; every mutation and query reads Date.now() server-side, so a forged/stale clock cannot drive extra regen. Removed the *At example wrappers.
    • Monotonic regen — applyRegen never advances the regen pointer past now and treats a backwards/equal clock as a no-op (no over-regen, no rewind).
    • Per-(subject, currency) idempotency — the by_idem index 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 — transfer with fromRef === toRef returns SELF_TRANSFER instead of debiting-then-crediting one row.
    • Regen-aware balances() — the multi-currency overview now applies each currency's regen (via a client-passed map), matching balance() (no stale divergence).
    Changed
    • Failure results carry a typed code (INSUFFICIENT | SELF_TRANSFER) instead of a free-text reason; reason remains the human ledger note.
All releases of @vllnt/convex-wallet
Stable releases
RSSAtomJSON Feed
Canary builds
RSSAtomJSON Feed

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

Theme