ethersign

package
v0.0.0-...-10d2874 Latest Latest
Warning

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

Go to latest
Published: Aug 18, 2020 License: MIT Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var BlackHoleAddress = Address("0x0000000000000000000000000000000000000000")

BlackHoleAddress is 0x0000000000000000000000000000000000000000

Functions

func IsHexAddress

func IsHexAddress(s string) bool

func IsHexSignature

func IsHexSignature(s string) bool

func Keccak256

func Keccak256(data []byte) []byte

func ToEthSignedMessageHash

func ToEthSignedMessageHash(message []byte) []byte

Types

type Address

type Address string

func ParseAddress

func ParseAddress(address string) (Address, error)

func ParseAddressMust

func ParseAddressMust(address string) Address

func RecoveryByCrypto

func RecoveryByCrypto(hash []byte, sig Signature) (Address, error)

func (Address) Address

func (a Address) Address() common.Address

func (Address) IsBlackHole

func (a Address) IsBlackHole() bool

func (Address) String

func (a Address) String() string

type Signature

type Signature []byte

func ParseSignature

func ParseSignature(signature string) (Signature, error)

func ParseSignatureMust

func ParseSignatureMust(signature string) Signature

func (Signature) Bytes

func (s Signature) Bytes() []byte

func (Signature) String

func (s Signature) String() string

type Signer

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

func NewSigner

func NewSigner(key *ecdsa.PrivateKey) (*Signer, error)

func NewSignerFromHex

func NewSignerFromHex(hex string) (*Signer, error)

func (*Signer) Address

func (s *Signer) Address() Address

func (*Signer) EthereumSign

func (s *Signer) EthereumSign(msg []byte) (Signature, error)

func (*Signer) Public

func (s *Signer) Public() ecdsa.PublicKey

Jump to

Keyboard shortcuts

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