Documentation ¶
Index ¶
- Constants
- func GetBookKeepers(account *Account) []*crypto.PubKey
- type Account
- type AccountData
- type HeaderData
- type VaultStore
- type Wallet
- type WalletData
- type WalletImpl
- func (w *WalletImpl) ChangePassword(oldPassword []byte, newPassword []byte) bool
- func (w *WalletImpl) CreateAccount(privateKey []byte) error
- func (w *WalletImpl) GetAccount(pubKey *crypto.PubKey) (*Account, error)
- func (w *WalletImpl) GetContract() (*ct.Contract, error)
- func (w *WalletImpl) GetDefaultAccount() (*Account, error)
- func (w *WalletImpl) GetUnspent() (map[Uint256][]*transaction.UTXOUnspent, error)
- func (w *WalletImpl) Sign(context *ct.ContractContext) error
- type WalletStore
Constants ¶
View Source
const ( WalletIVLength = 16 WalletMasterKeyLength = 32 WalletFileName = "wallet.dat" )
View Source
const (
WalletStoreVersion = "0.0.1"
)
Variables ¶
This section is empty.
Functions ¶
func GetBookKeepers ¶
Types ¶
type AccountData ¶
type HeaderData ¶
type VaultStore ¶
type VaultStore interface {
GetUnspentsFromProgramHash(programHash Uint160) (map[Uint256][]*transaction.UTXOUnspent, error)
}
var Store VaultStore
type Wallet ¶
type Wallet interface { Sign(context *ct.ContractContext) error GetAccount(pubKey *crypto.PubKey) (*Account, error) GetDefaultAccount() (*Account, error) GetUnspent() (map[Uint256][]*transaction.UTXOUnspent, error) }
type WalletData ¶
type WalletData struct { HeaderData AccountData }
type WalletImpl ¶
type WalletImpl struct { *WalletStore // contains filtered or unexported fields }
func NewWallet ¶
func NewWallet(path string, password []byte, needAccount bool) (*WalletImpl, error)
func OpenWallet ¶
func OpenWallet(path string, password []byte) (*WalletImpl, error)
func RecoverWallet ¶
func RecoverWallet(path string, password []byte, privateKeyHex string) (*WalletImpl, error)
func (*WalletImpl) ChangePassword ¶
func (w *WalletImpl) ChangePassword(oldPassword []byte, newPassword []byte) bool
func (*WalletImpl) CreateAccount ¶
func (w *WalletImpl) CreateAccount(privateKey []byte) error
func (*WalletImpl) GetAccount ¶
func (w *WalletImpl) GetAccount(pubKey *crypto.PubKey) (*Account, error)
func (*WalletImpl) GetContract ¶
func (w *WalletImpl) GetContract() (*ct.Contract, error)
func (*WalletImpl) GetDefaultAccount ¶
func (w *WalletImpl) GetDefaultAccount() (*Account, error)
func (*WalletImpl) GetUnspent ¶
func (w *WalletImpl) GetUnspent() (map[Uint256][]*transaction.UTXOUnspent, error)
func (*WalletImpl) Sign ¶
func (w *WalletImpl) Sign(context *ct.ContractContext) error
type WalletStore ¶
type WalletStore struct { sync.RWMutex Path string Data WalletData }
func LoadStore ¶
func LoadStore(fullPath string) (*WalletStore, error)
func NewStore ¶
func NewStore(fullPath string) (*WalletStore, error)
func (*WalletStore) SaveAccountData ¶
func (s *WalletStore) SaveAccountData(programHash []byte, encryptedPrivateKey []byte, contract []byte) error
func (*WalletStore) SaveBasicData ¶
func (s *WalletStore) SaveBasicData(version, iv, masterKey, passwordHash []byte) error
Click to show internal directories.
Click to hide internal directories.