Repository navigation
Add the bank plugin base, card records and spending limits - #24
Merged
Merged
Conversation
IAmJSD
added this pull request to stack #29
October 19, 2026 15:34
IAmJSD
force-pushed
the
bank/1-core
branch
2 times, most recently
from
October 19, 2026 21:28
1b562ef to
c9f8eca
Compare
The groundwork for giving nibblets money to spend. `@nibblet/bank` is the contract every bank plugin (a card issuer, a crypto treasury) fulfils, with a loader and the logic they share: budgets, and wallet keys derived from a treasury secret so none is ever stored. The protocol gains cards, card files and per-asset spending limits; the database gains a `cards` table and `nibblets.spending_limits`. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01KGXXQcj3hZN2jiB6As6kk5
An open card could still all be spent, so it now counts in full whenever it was made. Before, a daily limit only counted today's cards, so cards left open from earlier days could pile up past it. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Part 1 of 7 in the bank stack: virtual cards and crypto wallets for nibblets.
What this adds
@nibblet/bank: theBankPlugincontract every bank fulfils (issue,find,reveal,inspect,close,balance), a loader that turns plugins on from the server's environment, and the logic plugins share:BankErrorfor messages that are safe to showpending → open → closing → closedspendingLimitson each nibblet, which only the person sets; none means no cardscardstable andnibblets.spending_limits(migration0010_bank).Stack
card_request/card_list/card_killtools, and the runner writing card filesScreenshots
From #28's UI, in the mock server (
?mock=1): the per-currency limits this adds, which only the person sets.Review fixes
Checks
pnpm format:check,pnpm -r typecheckandpnpm testpass on this branch on its own.Generated by Claude Code