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

client_test.go

TEXT FILE

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

Download / RawBack to folder
Go · 7 lines
1package client
2import("context";"net/http";"net/http/httptest";"testing";"strings")
3func TestClientPost(t *testing.T){
4 s:=httptest.NewServer(http.HandlerFunc(func(w http.ResponseWriter,r *http.Request){if r.URL.Path!="/api/v5/btc/wallet/balance"{t.Errorf("path: %s",r.URL.Path)};if r.Header.Get("X-BTC-KEY")!="test-only"{t.Error("missing test key")};w.Write([]byte(`{"ok":true,"result":{}}`))}));defer s.Close()
5 c:=Client{BaseURL:s.URL};got,err:=c.Post(context.Background(),"/api/v5/btc/wallet/balance",[]byte(`{}`),"test-only");if err!=nil||!strings.Contains(string(got),`"ok":true`){t.Fatalf("got=%s err=%v",got,err)}
6 if _,err=c.Post(context.Background(),"/admin",nil,"");err==nil{t.Fatal("expected rejection")}
7}
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