Documentation
¶
Overview ¶
Package btcgateway pkg/btcgateway/gateway.go c4-app-wallet translating them to an Electrum backend, so a Skywire visor can provide the in-browser BTC wallet its chain data (balance / utxos / history / fee / broadcast). The wallet keeps keys, address derivation and signing entirely client-side (skycoin-lite WASM) — only these chain queries cross the mesh.
The Electrum connection is dialed via an optional DialFunc, so the visor can reach an ssl:// Electrum server through skysocks/dmsg over the mesh (nil dial = clearnet, for a native visor that already has egress). This is what lets BTC "just work" in the browser wallet without per-port dmsg forwarding — a raw ssl://host:port electrum URL is enough.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type DialFunc ¶
DialFunc routes the Electrum TCP connection over a custom transport (e.g. skysocks-client-lite for clearnet, or a dmsg stream). nil = stdlib clearnet.
type Gateway ¶
type Gateway struct {
// contains filtered or unexported fields
}
Gateway is an /v1/btc/* HTTP handler backed by Electrum. Backends are cached per Electrum server URL because Electrum connections are long-lived.
func (*Gateway) ServeHTTP ¶
func (g *Gateway) ServeHTTP(w http.ResponseWriter, r *http.Request)
ServeHTTP dispatches /v1/btc/{balance,utxos,history,fee,send}. The Electrum server URL comes from the X-Skywire-Btc-Backend header (the wallet shim sets it from localStorage['skywire-btc-backend']); addresses come from ?addrs=.