Documentation ¶
Index ¶
- Constants
- func ClearBytes(arr []byte, len int)
- func DoubleHash(pwd []byte) []byte
- func GetBookkeepers() []keypair.PublicKey
- type Account
- type Client
- type ClientImpl
- func (cl *ClientImpl) AddContract(ct *contract.Contract) error
- func (cl *ClientImpl) ChangePassword(oldPassword []byte, newPassword []byte) bool
- func (cl *ClientImpl) ContainsAccount(pubKey keypair.PublicKey) bool
- func (cl *ClientImpl) CreateAccount(encrypt string) (*Account, error)
- func (cl *ClientImpl) CreateAccountByPrivateKey(privateKey []byte) (*Account, error)
- func (cl *ClientImpl) DecryptPrivateKey(prikey []byte) ([]byte, error)
- func (cl *ClientImpl) EncryptPrivateKey(prikey []byte) ([]byte, error)
- func (cl *ClientImpl) GetAccount(pubKey keypair.PublicKey) (*Account, error)
- func (cl *ClientImpl) GetAccountByProgramHash(programHash common.Address) *Account
- func (cl *ClientImpl) GetBookkeepers() ([]keypair.PublicKey, error)
- func (cl *ClientImpl) GetContract(programHash common.Address) *ct.Contract
- func (cl *ClientImpl) GetDefaultAccount() (*Account, error)
- func (cl *ClientImpl) LoadAccount() map[common.Address]*Account
- func (cl *ClientImpl) LoadContracts() map[common.Address]*ct.Contract
- func (cl *ClientImpl) SaveAccount(ac *Account) error
- func (cl *ClientImpl) Sign(context *ct.ContractContext) bool
- type ClientStore
- type FileData
- type FileStore
- func (cs *FileStore) BuildDatabase(path string)
- func (cs *FileStore) LoadAccountData(index int) ([]byte, []byte, error)
- func (cs *FileStore) LoadContractData(index int) ([]byte, []byte, []byte, error)
- func (cs *FileStore) LoadStoredData(name string) ([]byte, error)
- func (cs *FileStore) SaveAccountData(pubkeyhash []byte, prikeyenc []byte) error
- func (cs *FileStore) SaveContractData(ct *ct.Contract) error
- func (cs *FileStore) SaveStoredData(name string, value []byte) error
Constants ¶
View Source
const ( DEFAULT_BOOKKEEPER_COUNT = 4 WALLET_FILENAME = "wallet.dat" )
Variables ¶
This section is empty.
Functions ¶
func ClearBytes ¶
func DoubleHash ¶
func GetBookkeepers ¶
Types ¶
type Account ¶
type Account struct { PrivateKey keypair.PrivateKey PublicKey keypair.PublicKey Address common.Address }
func NewAccount ¶
func (*Account) PrivKey ¶
func (ac *Account) PrivKey() keypair.PrivateKey
type Client ¶
type ClientImpl ¶
type ClientImpl struct { FileStore // contains filtered or unexported fields }
func Create ¶
func Create(path string, encrypt string, passwordKey []byte) *ClientImpl
TODO: adjust contract folder structure
func Open ¶
func Open(path string, passwordKey []byte) *ClientImpl
func (*ClientImpl) AddContract ¶
func (cl *ClientImpl) AddContract(ct *contract.Contract) error
func (*ClientImpl) ChangePassword ¶
func (cl *ClientImpl) ChangePassword(oldPassword []byte, newPassword []byte) bool
func (*ClientImpl) ContainsAccount ¶
func (cl *ClientImpl) ContainsAccount(pubKey keypair.PublicKey) bool
func (*ClientImpl) CreateAccount ¶
func (cl *ClientImpl) CreateAccount(encrypt string) (*Account, error)
func (*ClientImpl) CreateAccountByPrivateKey ¶
func (cl *ClientImpl) CreateAccountByPrivateKey(privateKey []byte) (*Account, error)
func (*ClientImpl) DecryptPrivateKey ¶
func (cl *ClientImpl) DecryptPrivateKey(prikey []byte) ([]byte, error)
func (*ClientImpl) EncryptPrivateKey ¶
func (cl *ClientImpl) EncryptPrivateKey(prikey []byte) ([]byte, error)
func (*ClientImpl) GetAccount ¶
func (cl *ClientImpl) GetAccount(pubKey keypair.PublicKey) (*Account, error)
func (*ClientImpl) GetAccountByProgramHash ¶
func (cl *ClientImpl) GetAccountByProgramHash(programHash common.Address) *Account
func (*ClientImpl) GetBookkeepers ¶
func (cl *ClientImpl) GetBookkeepers() ([]keypair.PublicKey, error)
func (*ClientImpl) GetContract ¶
func (cl *ClientImpl) GetContract(programHash common.Address) *ct.Contract
func (*ClientImpl) GetDefaultAccount ¶
func (cl *ClientImpl) GetDefaultAccount() (*Account, error)
func (*ClientImpl) LoadAccount ¶
func (cl *ClientImpl) LoadAccount() map[common.Address]*Account
func (*ClientImpl) LoadContracts ¶
func (cl *ClientImpl) LoadContracts() map[common.Address]*ct.Contract
func (*ClientImpl) SaveAccount ¶
func (cl *ClientImpl) SaveAccount(ac *Account) error
func (*ClientImpl) Sign ¶
func (cl *ClientImpl) Sign(context *ct.ContractContext) bool
type ClientStore ¶
type FileStore ¶
type FileStore struct {
// contains filtered or unexported fields
}
func (*FileStore) BuildDatabase ¶
func (*FileStore) LoadAccountData ¶
func (*FileStore) LoadContractData ¶
func (*FileStore) SaveAccountData ¶
Click to show internal directories.
Click to hide internal directories.