Documentation ¶
Index ¶
- type AppInput
- type Wallet
- type WalletBalance
- type WalletCLI
- type Wallets
- func (ws *Wallets) CreateWallet() (string, error)
- func (ws *Wallets) ExportWallet(filepath string) error
- func (ws *Wallets) GetAddresses() []string
- func (ws Wallets) GetWallet(address string) (Wallet, error)
- func (ws *Wallets) ImportWallet(filepath string) ([]string, error)
- func (ws *Wallets) LoadFromFile() error
- func (ws Wallets) SaveToFile() error
- type WalletsFile
- type WalletsFileRec
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Wallet ¶
type Wallet struct { PrivateKey ecdsa.PrivateKey PublicKey []byte }
Wallet stores private and public keys
func MakeWalletFromEncoded ¶
func (Wallet) GetPrivateKey ¶
func (w Wallet) GetPrivateKey() ecdsa.PrivateKey
Reurns private key of a wallet
func (Wallet) GetPrivateKeyEncoded ¶
Encode PrivateKey to string.
func (Wallet) GetPublicKeyEncoded ¶
Encode PubKey to string. We will use this for easy storing in a file
func (*Wallet) MakeWallet ¶
func (w *Wallet) MakeWallet()
MakeWallet creates Wallet. It generates new keys pair and assign to the object
func (Wallet) ValidateAddress ¶
ValidateAddress check if address is valid, has valid format
type WalletBalance ¶
type WalletCLI ¶
type WalletCLI struct { Input AppInput Node net.NodeAddr ConfigDir string Nodes []net.NodeAddr NodeCLI *nodeclient.NodeClient WalletsObj *Wallets NodeMode bool Logger *utils.LoggerMan }
func (*WalletCLI) ExecuteCommand ¶
Executes command based on input arguments
type Wallets ¶
type Wallets struct { ConfigDir string Wallets map[string]*Wallet Logger *utils.LoggerMan WalletsFile string }
Wallets stores a collection of wallets
func NewWallets ¶
func (*Wallets) CreateWallet ¶
CreateWallet adds a Wallet to Wallets
func (*Wallets) ExportWallet ¶
Export wallets to external file. It is just a copy of wallets file
func (*Wallets) GetAddresses ¶
GetAddresses returns an array of addresses stored in the wallet file
func (*Wallets) ImportWallet ¶
Import wallets from external file
func (*Wallets) LoadFromFile ¶
LoadFromFile loads wallets from the file
type WalletsFile ¶
type WalletsFile struct {
Wallets []WalletsFileRec
}