Documentation ¶
Overview ¶
* Copyright (C) 2019 The TesraSupernet Authors * This file is part of The TesraSupernet library. * * The TesraSupernet 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 TesraSupernet 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 TesraSupernet. If not, see <http://www.gnu.org/licenses/>.
* Copyright (C) 2019 The TesraSupernet Authors * This file is part of The TesraSupernet library. * * The TesraSupernet 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 TesraSupernet 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 TesraSupernet. If not, see <http://www.gnu.org/licenses/>.
Index ¶
- Constants
- func GetAccountIndexKey(index uint32) []byte
- func GetAccountKey(address string) []byte
- func GetNextAccountIndexKey() []byte
- func GetWalletAccountNumberKey() []byte
- func GetWalletExtraKey() []byte
- func GetWalletInitKey() []byte
- func GetWalletNameKey() []byte
- func GetWalletScryptKey() []byte
- func GetWalletVersionKey() []byte
- type WalletStore
- func (this *WalletStore) AddAccountData(accData *account.AccountData) (bool, error)
- func (this *WalletStore) GetAccountAddress(index uint32) (string, error)
- func (this *WalletStore) GetAccountByAddress(address string, passwd []byte) (*account.Account, error)
- func (this *WalletStore) GetAccountDataByAddress(address string) (*account.AccountData, error)
- func (this *WalletStore) GetAccountDataByIndex(index uint32) (*account.AccountData, error)
- func (this *WalletStore) GetAccountNumber() (uint32, error)
- func (this *WalletStore) GetNextAccountIndex() uint32
- func (this *WalletStore) IsAccountExist(address string) (bool, error)
- func (this *WalletStore) NewAccountData(typeCode keypair.KeyType, curveCode byte, sigScheme s.SignatureScheme, ...) (*account.AccountData, error)
Constants ¶
const ( DEFAULT_WALLET_NAME = "TWallet" WALLET_VERSION = "0.1" WALLET_INIT_DATA = "walletStore" )
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 GetAccountKey ¶
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 (*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)