Documentation
¶
Index ¶
- Constants
- func MustParseDerivationPath(path string) as.DerivationPath
- func NewMnemonic() (string, error)
- func NewSeedFromMnemonic(mnemonic string, password string) ([]byte, error)
- func ParseDerivationPath(path string) (as.DerivationPath, error)
- type Wallet
- func (w *Wallet) Accounts() []as.Account
- func (w *Wallet) Address(account as.Account) (as.Address, error)
- func (w *Wallet) Close() error
- func (w *Wallet) Contains(account as.Account) bool
- func (wallet *Wallet) CreateProposeForm(WalletToPropose string, Proposal string, Deadline int, Postscript string)
- func (wallet *Wallet) CreateWalletForm(Owners string, Threshold int) ([]byte, error)
- func (w *Wallet) Derive(path as.DerivationPath, pin bool) (as.Account, error)
- func (wallet *Wallet) MultiSignForm(Data string, Quorum int, Threshold int) (url.Values, error)
- func (w *Wallet) Open(password string) error
- func (w *Wallet) Path(account as.Account) (string, error)
- func (w *Wallet) PrivateKey(account as.Account) ([]byte, error)
- func (w *Wallet) PublicKey(account as.Account) ([]byte, error)
- func (w *Wallet) SendTokens(recipient string, amount decimal.Decimal) error
- func (w *Wallet) SignData(account as.Account, mimeType string, data []byte) ([]byte, error)
- func (w *Wallet) SignDataWithPassword(account as.Account, password, mimeType string, data []byte) ([]byte, error)
- func (w *Wallet) SignHash(account as.Account, hash []byte) ([]byte, error)
- func (w *Wallet) SignText(account as.Account, text []byte) ([]byte, error)
- func (w *Wallet) SignTextWithPassword(account as.Account, password string, text []byte) ([]byte, error)
- func (w *Wallet) Status() (string, error)
- func (w *Wallet) URL() as.URL
- func (w *Wallet) Unpin(account as.Account) error
Constants ¶
const BitSizeOfEntropy = 128
BitSizeOfEntropy can be {128, 256}.
Variables ¶
This section is empty.
Functions ¶
func MustParseDerivationPath ¶
func MustParseDerivationPath(path string) as.DerivationPath
MustParseDerivationPath parses the derivation path in string format into []uint32 but will panic if it can't parse it.
func NewMnemonic ¶
NewMnemonic returns a randomly generated BIP-39 mnemonic.
func NewSeedFromMnemonic ¶
NewSeedFromMnemonic returns a BIP-39 seed based on a BIP-39 mnemonic and password. DK = PBKDF2(PRF, Password, Salt, c, dkLen) and HMAC-SHA512
func ParseDerivationPath ¶
func ParseDerivationPath(path string) (as.DerivationPath, error)
! @todo [ ] ParseDerivationPath parses the derivation path in string format into []uint32.
Types ¶
type Wallet ¶
type Wallet struct {
// contains filtered or unexported fields
}
func NewWalletFromMnemonic ¶
NewWalletFromMnemonic returns a new wallet from a BIP-39 mnemonic.
func NewWalletFromSeed ¶
NewWalletFromSeed returns a new wallet from a BIP-39 seed.
func (*Wallet) Accounts ¶
Accounts implements accounts.Wallet, returning the list of accounts pinned to the wallet. If self-derivation was enabled, the account list is periodically expanded based on current chain state.
func (*Wallet) Contains ¶
Contains implements accounts.Wallet, returning whether a particular account is or is not pinned into this wallet instance.
func (*Wallet) CreateProposeForm ¶
func (*Wallet) CreateWalletForm ¶
func (*Wallet) Derive ¶
Derive implements accounts.Wallet, deriving a new account at the specific derivation path. If pin is set to true, the account will be added to the list of tracked accounts.
func (*Wallet) MultiSignForm ¶
func (*Wallet) PrivateKey ¶
PrivateKey returns the ECDSA private key of the account.