Documentation ¶
Index ¶
- Constants
- 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 WalletKeyStore
- func (wks *WalletKeyStore) Add(account Account) error
- func (wks *WalletKeyStore) Close()
- func (wks *WalletKeyStore) Delete(address keys.Address) error
- func (wks *WalletKeyStore) GetAccount(address keys.Address) (Account, error)
- func (wks *WalletKeyStore) KeyExists(address keys.Address) bool
- func (wks *WalletKeyStore) ListAddresses() ([]keys.Address, error)
- func (wks *WalletKeyStore) Open(address keys.Address, passphrase string) bool
- func (wks *WalletKeyStore) SignWithAddress(data []byte, address keys.Address) (keys.PublicKey, []byte, error)
- func (wks *WalletKeyStore) VerifyPassphrase(address keys.Address, passphrase string) (bool, error)
- type WalletStore
- func (ws WalletStore) Accounts() []Account
- func (ws *WalletStore) Add(account Account) error
- func (ws WalletStore) Close() error
- 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 ¶
View Source
const ( STATUS_OPEN = 44 STATUS_CLOSED = 45 SESSION_TIMEOUT = 30 )
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() error }
type WalletKeyStore ¶ added in v0.14.0
type WalletKeyStore struct {
// contains filtered or unexported fields
}
WalletKeyStore keeps a session storage of accounts on the Full Node
func NewWalletKeyStore ¶ added in v0.14.0
func NewWalletKeyStore(path string) (*WalletKeyStore, error)
func (*WalletKeyStore) Add ¶ added in v0.14.0
func (wks *WalletKeyStore) Add(account Account) error
func (*WalletKeyStore) Close ¶ added in v0.14.0
func (wks *WalletKeyStore) Close()
func (*WalletKeyStore) Delete ¶ added in v0.14.0
func (wks *WalletKeyStore) Delete(address keys.Address) error
func (*WalletKeyStore) GetAccount ¶ added in v0.14.0
func (wks *WalletKeyStore) GetAccount(address keys.Address) (Account, error)
func (*WalletKeyStore) KeyExists ¶ added in v0.14.0
func (wks *WalletKeyStore) KeyExists(address keys.Address) bool
func (*WalletKeyStore) ListAddresses ¶ added in v0.14.0
func (wks *WalletKeyStore) ListAddresses() ([]keys.Address, error)
func (*WalletKeyStore) Open ¶ added in v0.14.0
func (wks *WalletKeyStore) Open(address keys.Address, passphrase string) bool
func (*WalletKeyStore) SignWithAddress ¶ added in v0.14.0
func (*WalletKeyStore) VerifyPassphrase ¶ added in v0.14.0
type WalletStore ¶
WalletStore keeps a sessionClose 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() error
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.