Documentation ¶
Index ¶
- Constants
- func NewAccountCache(keyStoreDir string, password string) (*accountCache, error)
- type CryptedNode
- type DbStore
- func (dbStore *DbStore) ExportKey(auth string) ([]*accountTypes.Node, error)
- func (db *DbStore) GetKey(addr crypto.CommonAddress, auth string) (*accountTypes.Node, error)
- func (dbStore *DbStore) JoinPath(filename string) string
- func (dbStore *DbStore) StoreKey(key *accountTypes.Node, auth string) error
- type FileStore
- type Wallet
- func (wallet *Wallet) Close()
- func (wallet *Wallet) DumpPrivateKey(addr *crypto.CommonAddress) (*secp256k1.PrivateKey, error)
- func (wallet *Wallet) GetAccountByAddress(addr *crypto.CommonAddress) (*accountTypes.Node, error)
- func (wallet *Wallet) GetAccountByPubkey(pubkey *secp256k1.PublicKey) (*accountTypes.Node, error)
- func (wallet *Wallet) IsLock() bool
- func (wallet *Wallet) IsOpen() bool
- func (wallet *Wallet) ListAddress() ([]*crypto.CommonAddress, error)
- func (wallet *Wallet) Lock() error
- func (wallet *Wallet) NewAccount() (*accountTypes.Node, error)
- func (wallet *Wallet) Open(password string) error
- func (wallet *Wallet) UnLock(password string) error
Constants ¶
View Source
const ( RPERMISSION = iota //read WPERMISSION //write )
View Source
const ( LOCKED = iota //locked UNLOCKED //unlocked )
Variables ¶
This section is empty.
Functions ¶
func NewAccountCache ¶
NewAccountCache receive an path and password as argument path refer to the file that contain all key password used to decrypto content in key file
Types ¶
type CryptedNode ¶
type CryptedNode struct { CryptoPrivateKey []byte `json:"cryptoPrivateKey"` PrivateKey *secp256k1.PrivateKey `json:"-"` ChainId common.ChainIdType `json:"chainId"` ChainCode []byte `json:"chainCode"` Key []byte `json:"-"` Iv []byte `json:"iv"` }
func (*CryptedNode) DeCrypt ¶
func (cryptedNode *CryptedNode) DeCrypt() *accountTypes.Node
func (*CryptedNode) EnCrypt ¶
func (cryptedNode *CryptedNode) EnCrypt()
type DbStore ¶
type DbStore struct {
// contains filtered or unexported fields
}
DbStore use leveldb as the storegae
func NewDbStore ¶
func (*DbStore) ExportKey ¶
func (dbStore *DbStore) ExportKey(auth string) ([]*accountTypes.Node, error)
ExportKey export all key in db by password
func (*DbStore) GetKey ¶
func (db *DbStore) GetKey(addr crypto.CommonAddress, auth string) (*accountTypes.Node, error)
GetKey read key in db
type FileStore ¶
type FileStore struct {
// contains filtered or unexported fields
}
func NewFileStore ¶
func (FileStore) ExportKey ¶
func (fs FileStore) ExportKey(auth string) ([]*accountTypes.Node, error)
ExportKey export all key in file by password
func (FileStore) GetKey ¶
func (fs FileStore) GetKey(addr *crypto.CommonAddress, auth string) (*accountTypes.Node, error)
GetKey read key in file
type Wallet ¶
type Wallet struct {
// contains filtered or unexported fields
}
func NewWallet ¶
func NewWallet(config *accountTypes.Config, chainId common.ChainIdType) (*Wallet, error)
func (*Wallet) DumpPrivateKey ¶
func (wallet *Wallet) DumpPrivateKey(addr *crypto.CommonAddress) (*secp256k1.PrivateKey, error)
func (*Wallet) GetAccountByAddress ¶
func (wallet *Wallet) GetAccountByAddress(addr *crypto.CommonAddress) (*accountTypes.Node, error)
func (*Wallet) GetAccountByPubkey ¶
func (*Wallet) ListAddress ¶
func (wallet *Wallet) ListAddress() ([]*crypto.CommonAddress, error)
func (*Wallet) NewAccount ¶
func (wallet *Wallet) NewAccount() (*accountTypes.Node, error)
Click to show internal directories.
Click to hide internal directories.