Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var ErrorInvalidTypeSpecified = errors.New("Invalid account type specified.")
View Source
var ErrorNameCollision = errors.New("Account with name already exists.")
View Source
var ErrorNoEncryptedKeyFound = errors.New("No encrypted key found.")
View Source
var ErrorNoPrivateKeySet = errors.New("No private key is set.")
View Source
var ErrorNoSaltSetError = errors.New("No salt is set.")
Functions ¶
Types ¶
type Account ¶
type Account struct {
Encrypted string `json:"encrypted"`
Salt string `json:"salt"`
Name string `json:"name"`
PrivateKey string `json:"-" datastore:"-"`
PublicKey string `json:"-"`
Address string `json:"address,omitempty"`
// Can this account be withdrawn from? This is on the org.
Withdrawable bool `json:"-"`
Deleted bool `json:"-"`
Type blockchains.Type `json:"type"`
CreatedAt time.Time `json:"createdAt,omitempty"`
// Ignore these, this is deprecated
TestNetAddress string `json:"-"`
AddressBackup string `json:"-"`
}
type Wallet ¶
func (*Wallet) CreateAccount ¶
func (w *Wallet) CreateAccount(name string, typ blockchains.Type, withPassword []byte) (*Account, error)
Create a new Account, saves if wallet is created
type WalletHolder ¶
type WalletHolder struct {
WalletId string `json:"walletId"`
Wallet *Wallet `json:"wallet,omitempty" datastore:"-"`
}
func (*WalletHolder) GetOrCreateWallet ¶
func (w *WalletHolder) GetOrCreateWallet(db *datastore.Datastore) (*Wallet, error)
func (*WalletHolder) LoadWallet ¶
func (w *WalletHolder) LoadWallet(db *datastore.Datastore) error
Click to show internal directories.
Click to hide internal directories.