Documentation ¶
Index ¶
- func HashPubKey(pubKey []byte) []byte
- func ValidateAddress(address string) bool
- type Wallet
- type Wallets
- func (ws *Wallets) CreateDefaultWallet() string
- func (ws *Wallets) CreateWallet() string
- func (ws *Wallets) GetAddresses() []string
- func (ws *Wallets) GetDefaultWalletAddress() string
- func (ws Wallets) GetWallet(address string) Wallet
- func (ws *Wallets) LoadFromFile(nodeID string) error
- func (ws Wallets) SaveToFile(nodeID string)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func ValidateAddress ¶
ValidateAddress check if address if valid
Types ¶
type Wallet ¶
type Wallet struct { PrivateKey ecdsa.PrivateKey PublicKey []byte }
Wallet stores private and public keys
type Wallets ¶
Wallets stores a collection of wallets
func NewWallets ¶
NewWallets creates Wallets and fills it from a file if it exists
func (*Wallets) CreateDefaultWallet ¶
Create a default wallet for the node
func (*Wallets) CreateWallet ¶
CreateWallet adds a Wallet to Wallets
func (*Wallets) GetAddresses ¶
GetAddresses returns an array of addresses stored in the wallet file
func (*Wallets) GetDefaultWalletAddress ¶
func (*Wallets) LoadFromFile ¶
LoadFromFile loads wallets from the file
func (Wallets) SaveToFile ¶
SaveToFile saves wallets to a file
Click to show internal directories.
Click to hide internal directories.