Documentation
¶
Index ¶
- func NewAccountFromString(mnemonic string) (account *fio.Account, err error)
- type Hd
- func (hd Hd) KeyAt(index int) (*eos.KeyBag, error)
- func (hd Hd) Keys(keys int) (*eos.KeyBag, error)
- func (hd Hd) Len() int
- func (hd Hd) PubKeyAt(index int) (*ecc.PublicKey, error)
- func (hd Hd) PubKeys(count int) ([]*ecc.PublicKey, error)
- func (hd Hd) Quiz(count int) (questions []HdQuiz, err error)
- func (hd Hd) String() string
- func (hd Hd) Xpriv() (string, error)
- func (hd Hd) Xpub() (string, error)
- type HdQuiz
- type KeosClient
- type KeosKeys
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func NewAccountFromString ¶
NewAccountFromString returns a fio.Account from the first key derived, this is a shortcut for getting the first key as an account.
Types ¶
type Hd ¶
type Hd struct {
// contains filtered or unexported fields
}
Hd is an HD Wallet with BIP39 mnemonic phrase based on a BIP32 derivation path. Note: FIO uses m/44'/235'/0
func NewHdFromString ¶
NewHdFromString verifies a mnemonic string and creates a Hd containing a HD Wallet
func NewRandomHd ¶
NewRandomHd builds a new Hd with a specific word count (12, 15, 18, 21, or 24,) longer is better
func (Hd) Keys ¶
Keys provides a keybag with the requested number of keys, use KeyAt for a single key
func (Hd) Quiz ¶
Quiz generates a number of randomized quiz questions, if less than one is provided, it uses hd.Len()/3
type HdQuiz ¶
type HdQuiz struct { Description string Check func(s string) bool // function confirming correct answer // contains filtered or unexported fields }
HdQuiz is used for prompting a user to confirm the mnemonic phrase by providing a description of which word to provide and a function to validate their answer
type KeosClient ¶
type KeosClient struct { BaseUrl string HttpClient *http.Client Socket string Keys map[string]KeosKeys `json:"-"` Wallet string // contains filtered or unexported fields }
func NewKeosClient ¶
func NewKeosClient(keosUrl string, socket string) *KeosClient
NewKeosClient provides a connection to keosd. It allows either a Unix socket or a TCP connection.
func (*KeosClient) GetKeys ¶
func (k *KeosClient) GetKeys(nodeosApi *fio.API) error
GetKeys populates the list of keys stored in the wallet
func (*KeosClient) PrintKeys ¶
func (k *KeosClient) PrintKeys() string
PrintKeys provides a human readable list of keys in a wallet
func (KeosClient) Start ¶
func (k KeosClient) Start(noKeosd bool) error
Start attempts to launch the keosd process by spawning clio