Documentation ¶
Index ¶
- Constants
- Variables
- func DecodeToStruct(strc interface{}, s []byte) (err error)
- func EncodeToBytes(str interface{}) []byte
- type Accessor
- type Account
- type AccountType
- type Type
- type Wallet
- func (d *Wallet) Accounts() ([]Account, error)
- func (d *Wallet) ActiveAccount() (*Account, error)
- func (d *Wallet) AutoCreateEcdsaAccount() error
- func (d *Wallet) DBAccessor() *Accessor
- func (d *Wallet) DeleteActiveAccount() error
- func (d *Wallet) ImportECDSAAccount(pvtKeyStr string) error
- func (d *Wallet) SetActiveAccount(account Account) error
Constants ¶
View Source
const ( AccountTypeInvalid = AccountType(iota) AccountTypeNonCustodial AccountTypeCustodial )
View Source
const ( TypeCustodial = Type("Custodial") TypeNonCustodial = Type("NonCustodial") )
View Source
const MaxNumOfPasswdChars = 32
View Source
const (
PathAccounts = `/accounts`
)
View Source
const (
PathActiveAccount = `/activeAccount`
)
Variables ¶
View Source
var ( ErrInvalidCollectionPath = errors.New("collection path is not valid") ErrInvalidDocumentPath = errors.New("document path is not valid") )
View Source
var ( ErrDBIsClosed = errors.New("database is closed") ErrDBIsAlreadyOpen = errors.New("database is already open") ErrPasswordMismatch = errors.New("password mismatch") ErrPasswordInvalid = errors.New("password invalid") ErrPasswordNotSet = errors.New("password not set") ErrPasswdCannotBeEmpty = errors.New("password cannot be empty") ErrInvalidPathID = errors.New("path id is invalid") ErrInvalidPath = errors.New("invalid path") ErrInvalidAccount = errors.New("invalid account") )
Functions ¶
func DecodeToStruct ¶
DecodeToStruct strc is a pointer to a struct
func EncodeToBytes ¶
func EncodeToBytes(str interface{}) []byte
Types ¶
type Accessor ¶
type Accessor struct {
// contains filtered or unexported fields
}
func (*Accessor) DatabaseExists ¶
func (*Accessor) DatabasePath ¶
func (*Accessor) VerifyPassword ¶
VerifyPassword returns nil if password is correct else may return ErrPasswordMismatch or ErrPasswordInvalid or ErrPasswordNotSet
type Account ¶
type Account struct {
// contains filtered or unexported fields
}
func (*Account) Type ¶
func (a *Account) Type() AccountType
type AccountType ¶
type AccountType int
type Wallet ¶
type Wallet struct {
// contains filtered or unexported fields
}
func (*Wallet) ActiveAccount ¶
func (*Wallet) AutoCreateEcdsaAccount ¶
func (*Wallet) DBAccessor ¶
func (*Wallet) DeleteActiveAccount ¶
func (*Wallet) ImportECDSAAccount ¶
func (*Wallet) SetActiveAccount ¶
Click to show internal directories.
Click to hide internal directories.