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

command_router.go

TEXT FILE

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

Download / RawBack to folder
Go · 28 lines
1package examples
2
3import (
4	"errors"
5	"regexp"
6	"strconv"
7	"strings"
8)
9
10type SendCommand struct {
11	AmountSat int64
12	Address   string
13}
14
15var sendPattern = regexp.MustCompile(`(?i)^@send ([1-9][0-9]*) sats to (tb1[023456789acdefghjklmnpqrstuvwxyz]{8,87})$`)
16
17func ParseTestnetSend(input string) (SendCommand, error) {
18	m := sendPattern.FindStringSubmatch(strings.TrimSpace(input))
19	if m == nil {
20		return SendCommand{}, errors.New("expected @send <positive integer> sats to <testnet bech32 address>")
21	}
22	n, e := strconv.ParseInt(m[1], 10, 64)
23	if e != nil {
24		return SendCommand{}, e
25	}
26	// Syntax screening only: the Engine must perform full address and network validation.
27	return SendCommand{AmountSat: n, Address: m[2]}, nil
28}
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