walletcap
Spend limits for AI agent wallets: a per-payment cap and a rolling budget (say $150 in any 24 hours) per wallet, counted in one SQLite file that every process on the host opens. A restart, a second replica or another key doesn't start the count again, and the npm package walletcap counts in the same file, by the same SQL.
$ pip install walletcap # Python 3.11+, no dependencies
$ walletcap set --wallet 0xYourAgentWallet --per-payment 50 --per-day 150
from walletcap import open_budget
budget = open_budget(agent_address)
with budget.pay("$12.50") as payment: # refused past $150 in any 24 hours
payment.tx = send_usdc(payee, "12.50")
- The owner creates the budget once with
walletcap set, oropen_owner().set_limits(...). Opening never creates one unlesscreate=Trueis passed, which is for demos. - If the block raises, the payment may still have left, so it stays held, noted unknown, until
its owner checks the chain and voids it.
raise NotSent(...)inside the block says it never left. budget.hold(amount, id=..., settles_within=timedelta(minutes=5))returns aHoldtosettle(tx=...),void()ornote()yourself. One id is one payment, and only the hold that took it can move it; a voided id can't be held again.- Errors:
BudgetRefused(code,brief),BudgetUnavailable,UsageError, andPaymentNotRecorded, which shares no base with the others: don't pay again. None is aValueError. async with budget.pay(...)andacheck,ahold,astatus,aholdsandahistorywait for another process's lock in a worker thread, not on the event loop. If the task is cancelled while it waits, the hold the thread takes is voided.- Amounts are dollars: strings (
"$12.50"),Decimals, floats and ints (whole dollars). What comes back isMicros, a micro-dollar amount thatto_microsreads as micro-dollars. Its arithmetic returns aMicrosor raisesTypeError:remaining // 2works,remaining + 1doesn't, since a bare number would be read as dollars. - The owner's command,
walletcaporpython -m walletcap:status,set,freeze,unfreeze,history,holds,void <id>,void --all-unknown --older-than 24handsettle <id> --tx <hash>.
The ledger's rule is SQL that ships inside the package (walletcap/spec/schema.sql), the same
file the npm package runs. Source, docs and the threat model:
https://github.com/coriolislabs/WalletCap
Apache-2.0. Copyright 2026 Coriolis Labs Inc.
Metadata
Release files for walletcap 0.4.1
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| walletcap-0.4.1.tar.gz | 51.7 kB | With provenance | Details for walletcap-0.4.1.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| walletcap-0.4.1-py3-none-any.whl | Python 3 | none | any | Details for walletcap-0.4.1-py3-none-any.whl |
Total release size: 107.9 kB
Release files / walletcap-0.4.1.tar.gz
| Download URL | walletcap-0.4.1.tar.gz |
|---|---|
| Size | 51.7 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
d5d491b3de32716198f9878356391429fdcf4fa80e0d2538a4c7688176760873
|
|
BLAKE2b-256 checksum How to use checksums |
4b5430826c5bf23cd3da9f96468c65efb04a3eb3b234248b179ca89e892a873b
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.16
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Nov 7, 2026.
Transparency logRelease files / walletcap-0.4.1-py3-none-any.whl
| Download URL | walletcap-0.4.1-py3-none-any.whl |
|---|---|
| Size | 56.2 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
272bd8f1101962ea0c03c0380b99586169512e361fc347e2e5a939bb038012c8
|
|
BLAKE2b-256 checksum How to use checksums |
c21d351de411f3d3490013659eb22e495508a8147f39ee55812a1e0f036823ae
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.16
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Nov 7, 2026.
Transparency logSecurity for walletcap 0.4.1
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
Full provenance
Both files in this release have been uploaded with provenance metadata.
Attestation for walletcap-0.4.1.tar.gz
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Nov 7, 2026.
Transparency logA note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.