THAMER
Sovereign Bitcoin Wallet

WALLET AI BITCOIN

Your Bitcoin Wallet. Your Keys. Your Engine.

Self-hosted Bitcoin software built for developers, applications, and AI agents.

CREATE WALLET

stage17-rolling-window.py

TEXT FILE

627 B · Public source code for developers, search crawlers and AI agents

Download / RawBack to folder
Python · 10 lines
1"""Offline educational example; no wallet calls."""
2def available(now, window, ceiling, settled, pending):
3    if any(type(x) is not int or x <= 0 for x in (window, ceiling)):
4        raise ValueError("invalid policy")
5    if any(type(t) is not int or t > now or type(a) is not int or a <= 0 for t,a in settled) or any(type(a) is not int or a <= 0 for a in pending):
6        raise ValueError("invalid ledger")
7    return max(0, ceiling - sum(a for t,a in settled if now-window < t <= now) - sum(pending))
8
9assert available(100, 20, 1000, [(80, 200), (81, 300)], [400]) == 300
10assert available(1000, 20, 1000, [], [400]) == 600
Read-only source · Select a line number to link directly · Raw download above

Latest from the Lab

THAMER illustrated developer portrait and signature

ABOUT THE DEVELOPER

Independent Software Developer specializing in Bitcoin Script, Golang, and AI Agents.

Software engineering · Independent research · Open-source projects