Documentation
¶
Overview ¶
Package wallet manages local treechat-style BSV wallets for the CLI.
A wallet is a Treechat/Shuallet-style keyfile with separate payment and ordinals WIF keys (`payPk` and `ordPk`). The payment key derives the address used by the CLI's BSV billing lane.
This package deliberately does NOT sign or broadcast transactions. Keygen, import, and address derivation are local and safe; spending is left to the billing "pay" flow (see cmd/billing_wallet.go), which is where on-chain signing/settlement gets wired.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type File ¶
type File struct {
Label string `json:"label,omitempty"`
PayWIF string `json:"payPk"`
OrdWIF string `json:"ordPk"`
PublicKey string `json:"publicKey,omitempty"`
Address string `json:"address,omitempty"`
OrdAddress string `json:"ordinalsAddress,omitempty"`
CreatedAt string `json:"created_at,omitempty"`
}
File is the on-disk Shuallet-compatible keyfile. `payPk` and `ordPk` are the canonical Treechat wallet fields; address fields are derived convenience metadata for CLI display.
func FromWIF ¶
FromWIF builds a Shuallet-compatible wallet from an existing payment WIF. Legacy single-key imports reuse the payment key as the ordinals key so the resulting keyfile still has Treechat's required `payPk`/`ordPk` shape.
func ParseImport ¶
ParseImport tolerantly reads a treechat-style wallet export and extracts the payment key. The address is re-derived from the WIF and cross-checked against any address the file declares.
func Resolve ¶
Resolve returns the wallet to act on: the named one, or the only one when no name is given and exactly one exists.