Documentation
¶
Index ¶
- Variables
- type Account
- func (acc Account) Address() keys.Address
- func (acc Account) Bytes() []byte
- func (t *Account) Data() serialize.Data
- func (acc *Account) FromBytes(msg []byte) *Account
- func (t *Account) NewDataInstance() serialize.Data
- func (t *Account) SetData(a interface{}) error
- func (acc Account) Sign(msg []byte) ([]byte, error)
- func (acc Account) String() string
- type AccountData
- type Wallet
- type WalletStore
- func (ws WalletStore) Accounts() []Account
- func (ws *WalletStore) Add(account Account) error
- func (ws WalletStore) Close()
- func (ws *WalletStore) Delete(account Account) error
- func (ws WalletStore) GetAccount(address keys.Address) (Account, error)
- func (ws WalletStore) SignWithAccountIndex(msg []byte, index int) (keys.PublicKey, []byte, error)
- func (ws WalletStore) SignWithAddress(msg []byte, address keys.Address) (keys.PublicKey, []byte, error)
Constants ¶
This section is empty.
Variables ¶
View Source
var ErrGetAccountByAddress = errors.New("account not found for address")
Functions ¶
This section is empty.
Types ¶
type Account ¶
type Account struct { Type chain.Type `json:"type"` Name string `json:"name"` PublicKey *keys.PublicKey `json:"publicKey"` PrivateKey *keys.PrivateKey `json:"privateKey"` }
func GenerateNewAccount ¶ added in v0.10.8
func NewAccount ¶
func (*Account) NewDataInstance ¶
type AccountData ¶
func (*AccountData) SerialTag ¶
func (ad *AccountData) SerialTag() string
type Wallet ¶
type Wallet interface { //returns the account that the wallet holds Accounts() []Account Add(Account) error Delete(Account) error GetAccount(address keys.Address) (Account, error) SignWithAccountIndex([]byte, int) (keys.PublicKey, []byte, error) SignWithAddress([]byte, keys.Address) (keys.PublicKey, []byte, error) Close() }
type WalletStore ¶
WalletStore keeps a session storage of accounts on the Full Node
func (WalletStore) Accounts ¶
func (ws WalletStore) Accounts() []Account
Accounts returns all the accounts in the wallet store
func (*WalletStore) Add ¶
func (ws *WalletStore) Add(account Account) error
func (WalletStore) Close ¶
func (ws WalletStore) Close()
func (*WalletStore) Delete ¶
func (ws *WalletStore) Delete(account Account) error
func (WalletStore) GetAccount ¶
func (ws WalletStore) GetAccount(address keys.Address) (Account, error)
func (WalletStore) SignWithAccountIndex ¶
func (WalletStore) SignWithAddress ¶
Click to show internal directories.
Click to hide internal directories.