Module

Network.Ethereum.Core.Signatures

Package
purescript-eth-core
Repository
f-o-a-m/purescript-eth-core

#PrivateKey Source

newtype PrivateKey

Opaque PrivateKey type

Instances

#PublicKey Source

newtype PublicKey

Opaque PublicKey type

Instances

#unPublicKey Source

unPublicKey :: PublicKey -> HexString

Get the underlying HexString representation of a PublicKey.

#mkPublicKey Source

mkPublicKey :: HexString -> Maybe PublicKey

Attempt to construct a PublicKey from a HexString

#unPrivateKey Source

unPrivateKey :: PrivateKey -> HexString

Get the underlying HexString representation of a PrivateKey

#Address Source

newtype Address

Represents and Ethereum address, which is a 20 byte HexString

Instances

#privateToPublic Source

privateToPublic :: PrivateKey -> PublicKey

Produce the PublicKey for the corresponding PrivateKey.

#privateToAddress Source

privateToAddress :: PrivateKey -> Address

Produce the Address corresponding to the PrivateKey.

#publicToAddress Source

publicToAddress :: PublicKey -> Address

Produce the Address corresponding to the PublicKey

#Signature Source

newtype Signature

Constructors

Instances

#signMessage Source

signMessage :: PrivateKey -> ByteString -> Signature

Sign the message with a PrivateKey

#recoverSender Source

recoverSender :: ByteString -> Signature -> PublicKey

Recover the sender of the message from the Signature.

#ChainId Source

newtype ChainId

Used in Ethereum to prevent replay attacks

Constructors

Instances

#addChainIdOffset Source

addChainIdOffset :: ChainId -> Signature -> Signature

Add the ChainId offset to the Signature v parameter.

#removeChainIdOffset Source

removeChainIdOffset :: ChainId -> Signature -> Signature

Remove the ChainId offset from the Signature v parameter.