account

package
v1.0.1 Latest Latest
Warning

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

Go to latest
Published: Oct 12, 2020 License: MIT Imports: 8 Imported by: 0

Documentation

Index

Constants

View Source
const (
	NebulaIdLength        = 32
	EthereumAddressLength = 20
	WavesAddressLength    = 26
)

Variables

View Source
var (
	ErrInvalidChainType = errors.New("invalid chain type")
	ErrParseChainType   = errors.New("invalid parse chain type")
)

Functions

func Sign

func Sign(privKey crypto.PrivKey, msg []byte) ([]byte, error)

func StringToPrivKey

func StringToPrivKey(value string, chainType ChainType) ([]byte, error)

Types

type ChainType

type ChainType byte
const (
	Ethereum ChainType = iota
	Waves
)

func ParseChainType

func ParseChainType(chainType string) (ChainType, error)

func (ChainType) String

func (ch ChainType) String() string

type ConsulPubKey

type ConsulPubKey ed25519.PubKeyEd25519

func HexToValidatorPubKey

func HexToValidatorPubKey(hex string) (ConsulPubKey, error)

type LedgerValidator

type LedgerValidator struct {
	PrivKey crypto.PrivKey
	PubKey  ConsulPubKey
}

type NebulaId

type NebulaId [NebulaIdLength]byte

func BytesToNebulaId

func BytesToNebulaId(value []byte) NebulaId

func StringToNebulaId

func StringToNebulaId(address string, chainType ChainType) (NebulaId, error)

func (NebulaId) ToBytes

func (id NebulaId) ToBytes(chainType ChainType) []byte

func (NebulaId) ToString

func (id NebulaId) ToString(chainType ChainType) string

type OraclesPubKey

type OraclesPubKey [33]byte

func BytesToOraclePubKey

func BytesToOraclePubKey(value []byte, chainType ChainType) OraclesPubKey

func StringToOraclePubKey

func StringToOraclePubKey(value string, chainType ChainType) (OraclesPubKey, error)

func (*OraclesPubKey) ToBytes

func (pubKey *OraclesPubKey) ToBytes(chainType ChainType) []byte

func (*OraclesPubKey) ToString

func (pubKey *OraclesPubKey) ToString(chainType ChainType) string

Jump to

Keyboard shortcuts

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