Documentation
¶
Index ¶
- Constants
- type Config
- type Network
- type Wallet
- func (s *Wallet) Address() *btcutil.AddressPubKey
- func (s *Wallet) AddressHex() string
- func (s *Wallet) Derive(index interface{}) (*Wallet, error)
- func (s *Wallet) ExtendedPublicKey() (string, error)
- func (s *Wallet) Mnemonic() string
- func (s *Wallet) Path() string
- func (s *Wallet) PrivateKey() (string, error)
- func (s *Wallet) PublicKey() *btcec.PublicKey
- func (s *Wallet) ValidateAddress(address string) (bool, error)
Constants ¶
const ( NetworkMainnet Network = "mainnet" NetworkTestnet Network = "testnet" ErrInvalidMnemonic = "mnemonic is required" ErrUnsupportedNet = "unsupported network type: choose either 'mainnet' or 'testnet'" ErrInvalidPath = "failed to parse derivation path" ErrKeyDerivation = "failed to derive key" ErrIndexNegative = "index cannot be negative" ErrUnsupportedIndex = "unsupported index type" )
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Network ¶
type Network string
Network represents the type of blockchain network the wallet operates on. It can either be "mainnet" for the production Bitcoin network or "testnet" for the test Bitcoin network, allowing for separate configurations and behaviors for each network.
type Wallet ¶
type Wallet struct {
// contains filtered or unexported fields
}
Wallet represents an HD wallet.
func (*Wallet) Address ¶
func (s *Wallet) Address() *btcutil.AddressPubKey
Address returns the Bitcoin P2PKH address (AddressPubKey) associated with the wallet's public key. This address is in the native format of the btcutil library.
func (*Wallet) AddressHex ¶
AddressHex returns the Bitcoin address in its encoded hexadecimal string format. This is a human-readable format used for transactions and sharing the address.
func (*Wallet) ExtendedPublicKey ¶
ExtendedPublicKey returns the wallet's extended public key (xpub).
func (*Wallet) PrivateKey ¶
PrivateKey returns the private key associated with the wallet in WIF (Wallet Import Format).