Versions in this module Expand all Collapse all v1 v1.0.0 Apr 12, 2019 Changes in this version + const AccountValueIndex + const AddressIndexStartValue + const CloseWallet + const DefaultAccountValue + const DefaultDerivedPath + const DefaultDerivedPathLength + const EstablishWallet + const HardenedKeyStart + const KDF + const MaxSeedBytes + const MinSeedBytes + const RecommendedSeedLen + const RestoreWallet + const SymmetricAlgMode + const SymmetricAlgType + const SyncAccountNumber + const WalletDefaultName + const WalletDefaultPath + const WalletEntropyLength + const WalletLightScryptN + const WalletLightScryptP + const WalletMacCipherLen + const WalletStandardScryptN + const WalletStandardScryptP + const WalletscryptDKLen + const WalletscryptR + var DipperinChainCfg = DPChainCfg + var ErrBadChecksum = errors.New("bad extended key checksum") + var ErrDeriveBeyondMaxDepth = errors.New(...) + var ErrDeriveHardFromPublic = errors.New(...) + var ErrInvalidChild = errors.New("the extended key at this index is invalid") + var ErrInvalidKeyLen = errors.New(...) + var ErrInvalidSeedLen = fmt.Errorf(..., MinSeedBytes * 8, MaxSeedBytes * 8) + var ErrNotPrivExtKey = errors.New(...) + var ErrUnusableSeed = errors.New("unusable seed") + func AesDecryptCBC(iv []byte, key []byte, cipherText []byte) (plaintext []byte, err error) + func AesEncryptCBC(iv []byte, key []byte, plaintext []byte) (cipherText []byte, err error) + func CheckDerivedPathValid(path accounts.DerivationPath) (bool, error) + func CheckPassword(password string) (err error) + func CheckWalletPath(path string) (err error) + func ClearSensitiveData(sensitiveData interface{}) + func DecryptWalletContent(walletCipher WalletCipher, iv []byte, sysKey EncryptKey) (walletPlain []byte, err error) + func GenerateMnemonic(bitSize int) (mnemonic string, err error) + func GenerateSeed(length uint8) ([]byte, error) + func GetAccountFromExtendedKey(keyData *ExtendedKey) (account accounts.Account, err error) + func Hash160(buf []byte) []byte + func PathExists(path string) (bool, error) + type DPChainCfg struct + HDPrivateKeyID [4]byte + HDPublicKeyID [4]byte + type EncryptKey struct + func GenSymKeyFromPassword(password string, kdfPara KDFParameter) (sysKey EncryptKey, err error) + type EncryptParameter struct + type ExtendedKey struct + func NewExtendedKey(version, key, chainCode, parentFP []byte, depth uint8, childNum uint32, ...) *ExtendedKey + func NewKeyFromString(key string) (*ExtendedKey, error) + func NewMaster(seed []byte, net *DPChainCfg) (*ExtendedKey, error) + func (k *ExtendedKey) Child(i uint32) (*ExtendedKey, error) + func (k *ExtendedKey) Depth() uint8 + func (k *ExtendedKey) ECPrivKey() (*btcec.PrivateKey, error) + func (k *ExtendedKey) ECPubKey() (*btcec.PublicKey, error) + func (k *ExtendedKey) IsPrivate() bool + func (k *ExtendedKey) Neuter() (*ExtendedKey, error) + func (k *ExtendedKey) ParentFingerprint() uint32 + func (k *ExtendedKey) String() string + func (k *ExtendedKey) Zero() + type ExtendedKeyJson struct + ChainCode []byte + ChildNum uint32 + Depth uint8 + IsPrivate bool + Key []byte + ParentFP []byte + PubKey []byte + Version []byte + type KDFParameter struct + KDF string + KDFParams map[string]interface{} + type SoftWallet struct + Identifier accounts.WalletIdentifier + func NewSoftWallet() (*SoftWallet, error) + func (w *SoftWallet) Accounts() ([]accounts.Account, error) + func (w *SoftWallet) Close() error + func (w *SoftWallet) Contains(account accounts.Account) (bool, error) + func (w *SoftWallet) Derive(path accounts.DerivationPath, save bool) (accounts.Account, error) + func (w *SoftWallet) Establish(path, name, password, passPhrase string) (string, error) + func (w *SoftWallet) Evaluate(account accounts.Account, seed []byte) (index [32]byte, proof []byte, err error) + func (w *SoftWallet) GetAddressNonce(address common.Address) (nonce uint64, err error) + func (w *SoftWallet) GetPKFromAddress(account accounts.Account) (*ecdsa.PublicKey, error) + func (w *SoftWallet) GetSKFromAddress(address common.Address) (*ecdsa.PrivateKey, error) + func (w *SoftWallet) GetWalletIdentifier() (accounts.WalletIdentifier, error) + func (w *SoftWallet) Open(path, name, password string) error + func (w *SoftWallet) PaddingAddressNonce(GetAddressRelatedInfo accounts.AddressInfoReader) (err error) + func (w *SoftWallet) RestoreWallet(path, name, password, passPhrase, mnemonic string, ...) (err error) + func (w *SoftWallet) SelfDerive(base accounts.DerivationPath) error + func (w *SoftWallet) SetAddressNonce(address common.Address, nonce uint64) (err error) + func (w *SoftWallet) SignHash(account accounts.Account, hash []byte) ([]byte, error) + func (w *SoftWallet) SignTx(account accounts.Account, tx *model.Transaction, chainID *big.Int) (*model.Transaction, error) + func (w *SoftWallet) Status() (string, error) + type SymmetricAlgorithm struct + AlgType string + IV [symmetricEncryptLen]byte + ModeType string + type WalletCipher struct + Cipher string + MacCipher string + func CalWalletCipher(walletInfo WalletInfo, iv []byte, sysKey EncryptKey) (walletCipher WalletCipher, err error) + func EncryptWalletContent(walletPlain []byte, iv []byte, sysKey EncryptKey) (walletCipher WalletCipher, err error) + type WalletFileContent struct + type WalletInfo struct + Accounts []accounts.Account + Balances map[common.Address]*big.Int + DerivedPathIndex map[uint32]uint32 + ExtendKeys map[common.Address]ExtendedKey + Nonce map[common.Address]uint64 + Paths map[common.Address]accounts.DerivationPath + Seed []byte + func NewHdWalletInfo() (info *WalletInfo) + func (w *WalletInfo) GenerateKeyFromSeedAndPath(derivedPath string, index uint32) (derivedKey *ExtendedKey, Path accounts.DerivationPath, err error) + func (w *WalletInfo) GetAddressNonce(address common.Address) (nonce uint64, err error) + func (w *WalletInfo) HdWalletInfoDecodeJson(decodeData []byte) (err error) + func (w *WalletInfo) PaddingAddressNonce(GetAddressRelatedInfo accounts.AddressInfoReader) (err error) + func (w *WalletInfo) SetAddressNonce(address common.Address, nonce uint64) (err error) + func (w WalletInfo) HdWalletInfoEncodeJson() (encodeData []byte, err error) + type WalletInfoJson struct + Accounts []accounts.Account + Balances map[string]*big.Int + DerivedPathIndex map[uint32]uint32 + ExtendKeys map[string]ExtendedKeyJson + Nonce map[string]uint64 + Paths map[string]accounts.DerivationPath + Seed []byte + func NewHdWalletInfoJson() (jsonInfo *WalletInfoJson) + type WalletPlaintext struct