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

example.py

TEXT FILE

1.3 KB · Public source code for developers, search crawlers and AI agents

Download / RawBack to folder
Python · 38 lines
1# SPDX-License-Identifier: 0BSD
2import json
3import re
4
5
6def unique_object(pairs):
7    result = {}
8    for key, value in pairs:
9        if key in result:
10            raise ValueError("duplicate JSON key")
11        result[key] = value
12    return result
13
14
15def parse_sats(text):
16    if not re.fullmatch(r"[1-9][0-9]{0,15}", text):
17        raise ValueError("invalid integer sats")
18    return int(text)
19
20
21def validate(candidate):
22    if type(candidate) is not dict or set(candidate) != {"invoice_id", "amount_sat", "network"}:
23        raise ValueError("invalid invoice shape")
24    if type(candidate["invoice_id"]) is not str or not re.fullmatch(r"[A-Za-z0-9_-]{1,64}", candidate["invoice_id"]):
25        raise ValueError("invalid invoice identifier")
26    amount = candidate["amount_sat"]
27    if type(amount) is not int or not 1 <= amount <= 100000:
28        raise ValueError("outside illustrative review limit")
29    if candidate["network"] != "test":
30        raise ValueError("Testnet only")
31    return {"invoice": dict(candidate), "status": "review_required"}
32
33
34def extract(driver):
35    from selenium.webdriver.common.by import By
36    return {"invoice_id": driver.find_element(By.ID, "invoice-id").text,
37            "amount_sat": parse_sats(driver.find_element(By.ID, "amount-sat").text),
38            "network": driver.find_element(By.ID, "network").text}
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