account

package
v0.0.0-...-83f9183 Latest Latest
Warning

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

Go to latest
Published: May 13, 2023 License: Unlicense Imports: 3 Imported by: 12

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type AccountService

type AccountService interface {
	GenerateFamilySeed(password string) (KeyType, Key, error)

	NewKeyFromSecret(string) (KeyType, Key, error)
	NewKeyFromBytes([]byte) (KeyType, Key, error)

	NewPublicFromHex(string) (KeyType, PublicKey, error)
	NewPublicFromBytes([]byte) (KeyType, PublicKey, error)

	NewAccountFromAddress(string) (KeyType, core.Address, error)
	NewAccountFromBytes([]byte) (KeyType, core.Address, error)
}

type Key

type Key interface {
	core.Textable
	core.Binariable

	Signable
	Verifiable

	GetPrivate() (PrivateKey, error)
	GetPublic() (PublicKey, error)
	GetAddress() (core.Address, error)
}

type KeyType

type KeyType uint16

func GetKeyTypeByName

func GetKeyTypeByName(name string) (KeyType, error)

func GetKeyTypes

func GetKeyTypes() []KeyType

func (KeyType) Create

func (t KeyType) Create() Key

func (KeyType) CreateWith

func (t KeyType) CreateWith(seed []byte) Key

func (KeyType) MarshalText

func (t KeyType) MarshalText() ([]byte, error)

func (KeyType) Register

func (t KeyType) Register(name string, f func(t KeyType, seed []byte) Key)

func (KeyType) String

func (t KeyType) String() string

func (*KeyType) UnmarshalText

func (t *KeyType) UnmarshalText(b []byte) error

type PrivateKey

type PrivateKey interface {
	core.Textable
	core.Binariable

	Signable

	GeneratePublic() (PublicKey, error)
	GetSecret() (string, error)
}

type PublicKey

type PublicKey interface {
	core.Textable
	core.Binariable

	Verifiable

	GenerateAddress() (core.Address, error)
}

type Signable

type Signable interface {
	Sign(hash core.Hash, msg []byte) (core.Signature, error)
}

type Verifiable

type Verifiable interface {
	Verify(hash core.Hash, msg []byte, signature core.Signature) (bool, error)
}

Jump to

Keyboard shortcuts

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