Versions in this module Expand all Collapse all v0 v0.13.8 Aug 6, 2024 Changes in this version + const KeyStoreScheme + const LightScryptN + const LightScryptP + const StandardScryptN + const StandardScryptP + var ErrAccountAlreadyExists = errors.New("account already exists") + var ErrDecrypt = errors.New("could not decrypt key with given password") + var ErrLocked = accounts.NewAuthNeededError("password or unlock") + var ErrNoMatch = errors.New("no key for given address or file") + var KeyStoreType = reflect.TypeOf(&KeyStore{}) + func DecryptDataV3(cryptoJson CryptoJSON, auth string) ([]byte, error) + func EncryptKey(key *Key, auth string, scryptN, scryptP int) ([]byte, error) + func StoreKey(dir, auth string, scryptN, scryptP int) (accounts.Account, error) + type AmbiguousAddrError struct + Addr common.Address + Matches []accounts.Account + func (err *AmbiguousAddrError) Error() string + type CryptoJSON struct + Cipher string + CipherParams cipherparamsJSON + CipherText string + KDF string + KDFParams map[string]interface{} + MAC string + func EncryptDataV3(data, auth []byte, scryptN, scryptP int) (CryptoJSON, error) + type Key struct + Address common.Address + Id uuid.UUID + PrivateKey *ecdsa.PrivateKey + func DecryptKey(keyjson []byte, auth string) (*Key, error) + func NewKey(rand io.Reader) (*Key, error) + func NewKeyForDirectICAP(rand io.Reader) *Key + func NewKeyFromECDSA(privateKeyECDSA *ecdsa.PrivateKey) *Key + func (k *Key) MarshalJSON() (j []byte, err error) + func (k *Key) UnmarshalJSON(j []byte) (err error) + type KeyStore struct + func NewKeyStore(keydir string, scryptN, scryptP int) *KeyStore + func NewPlaintextKeyStore(keydir string) *KeyStore + func (ks *KeyStore) Accounts() []accounts.Account + func (ks *KeyStore) Delete(a accounts.Account, passphrase string) error + func (ks *KeyStore) Export(a accounts.Account, passphrase, newPassphrase string) (keyJSON []byte, err error) + func (ks *KeyStore) Find(a accounts.Account) (accounts.Account, error) + func (ks *KeyStore) HasAddress(addr common.Address) bool + func (ks *KeyStore) Import(keyJSON []byte, passphrase, newPassphrase string) (accounts.Account, error) + func (ks *KeyStore) ImportECDSA(priv *ecdsa.PrivateKey, passphrase string) (accounts.Account, error) + func (ks *KeyStore) ImportPreSaleKey(keyJSON []byte, passphrase string) (accounts.Account, error) + func (ks *KeyStore) Lock(addr common.Address) error + func (ks *KeyStore) NewAccount(passphrase string) (accounts.Account, error) + func (ks *KeyStore) SignHash(a accounts.Account, hash []byte) ([]byte, error) + func (ks *KeyStore) SignHashWithPassphrase(a accounts.Account, passphrase string, hash []byte) (signature []byte, err error) + func (ks *KeyStore) SignTx(a accounts.Account, tx *types.Transaction, chainID *big.Int) (*types.Transaction, error) + func (ks *KeyStore) SignTxWithPassphrase(a accounts.Account, passphrase string, tx *types.Transaction, chainID *big.Int) (*types.Transaction, error) + func (ks *KeyStore) Subscribe(sink chan<- accounts.WalletEvent) event.Subscription + func (ks *KeyStore) TimedUnlock(a accounts.Account, passphrase string, timeout time.Duration) error + func (ks *KeyStore) Unlock(a accounts.Account, passphrase string) error + func (ks *KeyStore) Update(a accounts.Account, passphrase, newPassphrase string) error + func (ks *KeyStore) Wallets() []accounts.Wallet