account

package
v1.0.0 Latest Latest
Warning

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

Go to latest
Published: May 22, 2019 License: Apache-2.0 Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Account

type Account interface {
	// Address returns the IoTeX address
	Address() string
	// PrivateKey returns the embedded private key interface
	PrivateKey() crypto.PrivateKey
	// PublicKey returns the embedded public key interface
	PublicKey() crypto.PublicKey
	// Sign signs the message using the private key
	Sign([]byte) ([]byte, error)
	// Verify verifies the message using the public key
	Verify([]byte, []byte) bool
	// Zero zeroes the private key data
	Zero()
}

Account is a user account

func HexStringToAccount

func HexStringToAccount(privateKey string) (Account, error)

HexStringToAccount generates an account from private key string

func NewAccount

func NewAccount() (Account, error)

NewAccount generates a new account

func PrivateKeyToAccount

func PrivateKeyToAccount(key crypto.PrivateKey) (Account, error)

PrivateKeyToAccount generates an account from an existing private key interface

type Accounts

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

Accounts type

func NewAccounts

func NewAccounts() *Accounts

NewAccounts return Accounts instance

func (*Accounts) AddAccount

func (acts *Accounts) AddAccount(acc Account) error

AddAccount add an account

func (*Accounts) Create

func (acts *Accounts) Create() (Account, error)

Create new account

func (*Accounts) GetAccount

func (acts *Accounts) GetAccount(addr string) (Account, error)

GetAccount by address

func (*Accounts) RemoveAccount

func (acts *Accounts) RemoveAccount(addr string)

RemoveAccount removes an account

Jump to

Keyboard shortcuts

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