account

package
v0.5.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Feb 10, 2021 License: Apache-2.0 Imports: 23 Imported by: 0

Documentation

Index

Constants

View Source
const (
	UserAccountIndex = -1
)

Variables

This section is empty.

Functions

func CreateRandomKeyPair

func CreateRandomKeyPair(now int64) (*ecdsa.PrivateKey, error)

Types

type Account

type Account struct {
	// contains filtered or unexported fields
}

func New

func New(logger logging.Logger) *Account

func (*Account) Authorise

func (a *Account) Authorise(password string) bool

func (*Account) CreateCollectionAccount

func (a *Account) CreateCollectionAccount(accountId int, passPhrase string, createCollection bool) error

func (*Account) CreatePodAccount

func (a *Account) CreatePodAccount(accountId int, passPhrase string, createPod bool) error

func (*Account) CreateUserAccount

func (a *Account) CreateUserAccount(passPhrase, mnemonic string) (string, string, error)

func (*Account) DeletePodAccount

func (a *Account) DeletePodAccount(accountId int)

func (*Account) GetAddress

func (a *Account) GetAddress(index int) utils.Address

func (*Account) GetEmptyAccountInfo

func (a *Account) GetEmptyAccountInfo() *Info

func (*Account) GetPodAccountInfo

func (a *Account) GetPodAccountInfo(index int) (*Info, error)

func (*Account) GetUserAccountInfo

func (a *Account) GetUserAccountInfo() *Info

func (*Account) GetUserPrivateKey

func (a *Account) GetUserPrivateKey(index int) *ecdsa.PrivateKey

func (*Account) LoadUserAccount

func (a *Account) LoadUserAccount(passPhrase, encryptedMnemonic string) error

type Info

type Info struct {
	// contains filtered or unexported fields
}

func (*Info) GetAddress

func (ai *Info) GetAddress() utils.Address

func (*Info) GetPrivateKey

func (ai *Info) GetPrivateKey() *ecdsa.PrivateKey

func (*Info) GetPublicKey

func (ai *Info) GetPublicKey() *ecdsa.PublicKey

func (*Info) IsReadOnlyPod

func (a *Info) IsReadOnlyPod() bool

func (*Info) SetAddress

func (ai *Info) SetAddress(addr utils.Address)

type Wallet

type Wallet struct {
	// contains filtered or unexported fields
}

func NewWallet

func NewWallet(mnemonic string) *Wallet

func (*Wallet) CreateAccount

func (w *Wallet) CreateAccount(walletPath string, plainMnemonic string) (accounts.Account, error)

func (*Wallet) LoadMnemonicAndCreateRootAccount

func (w *Wallet) LoadMnemonicAndCreateRootAccount(mnemonic string) (accounts.Account, string, error)

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL