Documentation ¶
Overview ¶
* Copyright (C) 2018 The DNA Authors * This file is part of The DNA library. * * The DNA 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 DNA 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 DNA. If not, see <http://www.gnu.org/licenses/>.
* Copyright (C) 2018 The DNA Authors * This file is part of The DNA library. * * The DNA 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 DNA 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 DNA. If not, see <http://www.gnu.org/licenses/>.
Index ¶
- Constants
- func GetAccountIndexKey(index uint32) []byte
- func GetAccountKey(address string) []byte
- func GetExecutorAccountNumberKey() []byte
- func GetExecutorExtraKey() []byte
- func GetExecutorInitKey() []byte
- func GetExecutorNameKey() []byte
- func GetExecutorScryptKey() []byte
- func GetExecutorVersionKey() []byte
- func GetNextAccountIndexKey() []byte
- type ExecutorStore
- func (this *ExecutorStore) AddAccountData(accData *account.AccountData) (bool, error)
- func (this *ExecutorStore) GetAccountAddress(index uint32) (string, error)
- func (this *ExecutorStore) GetAccountByAddress(address string, passwd []byte) (*account.Account, error)
- func (this *ExecutorStore) GetAccountDataByAddress(address string) (*account.AccountData, error)
- func (this *ExecutorStore) GetAccountDataByIndex(index uint32) (*account.AccountData, error)
- func (this *ExecutorStore) GetAccountNumber() (uint32, error)
- func (this *ExecutorStore) GetNextAccountIndex() uint32
- func (this *ExecutorStore) IsAccountExist(address string) (bool, error)
- func (this *ExecutorStore) NewAccountData(typeCode keypair.KeyType, curveCode byte, sigScheme s.SignatureScheme, ...) (*account.AccountData, error)
Constants ¶
const ( DEFAULT_WALLET_NAME = "MyExecutor" WALLET_VERSION = "1.1" WALLET_INIT_DATA = "executorStore" )
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 GetExecutorAccountNumberKey ¶
func GetExecutorAccountNumberKey() []byte
func GetExecutorExtraKey ¶
func GetExecutorExtraKey() []byte
func GetExecutorInitKey ¶
func GetExecutorInitKey() []byte
func GetExecutorNameKey ¶
func GetExecutorNameKey() []byte
func GetExecutorScryptKey ¶
func GetExecutorScryptKey() []byte
func GetExecutorVersionKey ¶
func GetExecutorVersionKey() []byte
func GetNextAccountIndexKey ¶
func GetNextAccountIndexKey() []byte
Types ¶
type ExecutorStore ¶
type ExecutorStore struct { ExecutorName string ExecutorVersion string ExecutorScrypt *keypair.ScryptParam ExecutorExtra string // contains filtered or unexported fields }
func NewExecutorStore ¶
func NewExecutorStore(path string) (*ExecutorStore, error)
func (*ExecutorStore) AddAccountData ¶
func (this *ExecutorStore) AddAccountData(accData *account.AccountData) (bool, error)
func (*ExecutorStore) GetAccountAddress ¶
func (this *ExecutorStore) GetAccountAddress(index uint32) (string, error)
func (*ExecutorStore) GetAccountByAddress ¶
func (*ExecutorStore) GetAccountDataByAddress ¶
func (this *ExecutorStore) GetAccountDataByAddress(address string) (*account.AccountData, error)
func (*ExecutorStore) GetAccountDataByIndex ¶
func (this *ExecutorStore) GetAccountDataByIndex(index uint32) (*account.AccountData, error)
func (*ExecutorStore) GetAccountNumber ¶
func (this *ExecutorStore) GetAccountNumber() (uint32, error)
func (*ExecutorStore) GetNextAccountIndex ¶
func (this *ExecutorStore) GetNextAccountIndex() uint32
func (*ExecutorStore) IsAccountExist ¶
func (this *ExecutorStore) IsAccountExist(address string) (bool, error)
func (*ExecutorStore) NewAccountData ¶
func (this *ExecutorStore) NewAccountData(typeCode keypair.KeyType, curveCode byte, sigScheme s.SignatureScheme, passwd []byte) (*account.AccountData, error)