store

package
v0.6.1 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jan 21, 2020 License: LGPL-3.0 Imports: 12 Imported by: 0

Documentation

Overview

* Copyright (C) 2018 The ontology Authors * This file is part of The ontology library. * * The ontology is free software: you can redistribute it and/or modify * it under the terms of the GNU Lesser General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. * * The ontology is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public License * along with The ontology. If not, see <http://www.gnu.org/licenses/>.

* Copyright (C) 2018 The ontology Authors * This file is part of The ontology library. * * The ontology is free software: you can redistribute it and/or modify * it under the terms of the GNU Lesser General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. * * The ontology is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public License * along with The ontology. If not, see <http://www.gnu.org/licenses/>.

Index

Constants

View Source
const (
	DEFAULT_WALLET_NAME = "MyWallet"
	WALLET_VERSION      = "1.1"
	WALLET_INIT_DATA    = "walletStore"
)
View Source
const (
	WALLET_INIT_PREFIX               = 0x00
	WALLET_NAME_PREFIX               = 0x01
	WALLET_VERSION_PREFIX            = 0x02
	WALLET_SCRYPT_PREFIX             = 0x03
	WALLET_NEXT_ACCOUNT_INDEX_PREFIX = 0x04
	WALLET_ACCOUNT_INDEX_PREFIX      = 0x05
	WALLET_ACCOUNT_PREFIX            = 0x06
	WALLET_EXTRA_PREFIX              = 0x07
	WALLET_ACCOUNT_NUMBER            = 0x08
)

Variables

This section is empty.

Functions

func GetAccountIndexKey

func GetAccountIndexKey(index uint32) []byte

func GetAccountKey

func GetAccountKey(address string) []byte

func GetNextAccountIndexKey

func GetNextAccountIndexKey() []byte

func GetWalletAccountNumberKey

func GetWalletAccountNumberKey() []byte

func GetWalletExtraKey

func GetWalletExtraKey() []byte

func GetWalletInitKey

func GetWalletInitKey() []byte

func GetWalletNameKey

func GetWalletNameKey() []byte

func GetWalletScryptKey

func GetWalletScryptKey() []byte

func GetWalletVersionKey

func GetWalletVersionKey() []byte

Types

type WalletStore

type WalletStore struct {
	WalletName    string
	WalletVersion string
	WalletScrypt  *keypair.ScryptParam
	WalletExtra   string
	// contains filtered or unexported fields
}

func NewWalletStore

func NewWalletStore(path string) (*WalletStore, error)

func (*WalletStore) AddAccountData

func (this *WalletStore) AddAccountData(accData *account.AccountData) (bool, error)

func (*WalletStore) GetAccountAddress

func (this *WalletStore) GetAccountAddress(index uint32) (string, error)

func (*WalletStore) GetAccountByAddress

func (this *WalletStore) GetAccountByAddress(address string, passwd []byte) (*account.Account, error)

func (*WalletStore) GetAccountDataByAddress

func (this *WalletStore) GetAccountDataByAddress(address string) (*account.AccountData, error)

func (*WalletStore) GetAccountDataByIndex

func (this *WalletStore) GetAccountDataByIndex(index uint32) (*account.AccountData, error)

func (*WalletStore) GetAccountNumber

func (this *WalletStore) GetAccountNumber() (uint32, error)

func (*WalletStore) GetNextAccountIndex

func (this *WalletStore) GetNextAccountIndex() uint32

func (*WalletStore) IsAccountExist

func (this *WalletStore) IsAccountExist(address string) (bool, error)

func (*WalletStore) NewAccountData

func (this *WalletStore) NewAccountData(typeCode keypair.KeyType, curveCode byte, sigScheme s.SignatureScheme, passwd []byte) (*account.AccountData, error)

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL