Documentation ¶
Index ¶
- func GetKeystoreAddress(path string) (string, error)
- type Account
- func (acc *Account) Addr() string
- func (acc *Account) AddrType() types.Address
- func (acc *Account) PrivateKey() *crypto.PrivateKey
- func (acc *Account) PubKeyHash() []byte
- func (acc *Account) PublicKey() []byte
- func (acc *Account) SaveWithPassphrase(passphrase string) error
- func (acc *Account) Sign(messageHash *crypto.HashType) (*crypto.Signature, error)
- func (acc *Account) UnlockWithPassphrase(passphrase string) error
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func GetKeystoreAddress ¶
GetKeystoreAddress gets the address info from a keystore json file
Types ¶
type Account ¶
Account offers method to operate ecdsa keys stored in a keystore file path
func NewAccountFromFile ¶
NewAccountFromFile create account from file.
func (*Account) PrivateKey ¶
func (acc *Account) PrivateKey() *crypto.PrivateKey
PrivateKey returns the accounts private key in compressed byte format
func (*Account) PubKeyHash ¶
PubKeyHash returns Public Key Hash of the account
func (*Account) SaveWithPassphrase ¶
SaveWithPassphrase save account with passphrase
func (*Account) Sign ¶
Sign calculates an ECDSA signature of messageHash using privateKey. returns error if account is locked or sign process failed
func (*Account) UnlockWithPassphrase ¶
UnlockWithPassphrase unlocks an account and generate its private key
Click to show internal directories.
Click to hide internal directories.