Module

Network.Ethereum.Web3.Types

Package
purescript-web3
Repository
f-o-a-m/purescript-web3

Re-exports from Network.Ethereum.Web3.Types.BigNumber

#Radix Source

newtype Radix

The number of unique digits (including zero) used to represent integers in a specific base.

#Algebra Source

class (Ring r, Ring a) <= Algebra r a  where

Class for embedding one ring inside another. Used mostly for coercing numerical values to BigNumber types. The emedding ring is refered to as the subalgebra. The embedding is assumed to be a ring homomorphism, and a is an r-bimodule under lmul and rmul.

Members

Instances

#unsafeToInt Source

unsafeToInt :: BigNumber -> Int

Unsafely coerce a BigNumber to an Int.

#toTwosComplement Source

toTwosComplement :: BigNumber -> BigNumber

Take the twos complement of a BigNumer

#toString Source

toString :: Radix -> BigNumber -> String

Convert a Big number into a string in the given base

#rsub Source

rsub :: forall a r. Algebra r a => a -> r -> a

Subtract a subalgebra value on the right

#rmul Source

rmul :: forall a r. Algebra r a => a -> r -> a

Multiply a subalgebra value on the right

#radd Source

radd :: forall a r. Algebra r a => a -> r -> a

Add a subalgebra value on the right

#pow Source

pow :: BigNumber -> Int -> BigNumber

Exponentiate a BigNumber

#parseBigNumber Source

parseBigNumber :: Radix -> String -> Maybe BigNumber

Convert a string in the given base to a BigNumber

#lsub Source

lsub :: forall a r. Algebra r a => r -> a -> a

#lmul Source

lmul :: forall a r. Algebra r a => r -> a -> a

Multiply a subalgebra value on the left

#ladd Source

ladd :: forall a r. Algebra r a => r -> a -> a

Add a subalgebra value on the left

#hexadecimal Source

hexadecimal :: Radix

The base-16 system.

#floor Source

floor :: Number -> Int

Convert a Number to an Int, by taking the closest integer equal to or less than the argument. Values outside the Int range are clamped, NaN and Infinity values return 0.

#decimal Source

decimal :: Radix

The base-10 system.

#binary Source

binary :: Radix

The base-2 system.

#(>-) Source

Operator alias for Network.Ethereum.Web3.Types.BigNumber.lsub (left-associative / precedence 6)

#(>+) Source

Operator alias for Network.Ethereum.Web3.Types.BigNumber.ladd (left-associative / precedence 6)

#(>*) Source

Operator alias for Network.Ethereum.Web3.Types.BigNumber.lmul (left-associative / precedence 7)

#(-<) Source

Operator alias for Network.Ethereum.Web3.Types.BigNumber.rsub (right-associative / precedence 6)

#(+<) Source

Operator alias for Network.Ethereum.Web3.Types.BigNumber.radd (right-associative / precedence 6)

#(*<) Source

Operator alias for Network.Ethereum.Web3.Types.BigNumber.rmul (right-associative / precedence 7)

Re-exports from Network.Ethereum.Web3.Types.EtherUnit

#Wei Source

data Wei

Instances

#Value Source

newtype Value a

Ether value in denomination a

Instances

#Szabo Source

data Szabo

Szabo unit type

Instances

#Shannon Source

data Shannon

Shannon unit type

Instances

#Lovelace Source

data Lovelace

Lovelace unit type

Instances

#KEther Source

data KEther

KEther unit type

Instances

#Finney Source

data Finney

Finney unit type

Instances

#Ether Source

data Ether

Ether unit type

Instances

#Babbage Source

data Babbage

Babbage unit type

Instances

#EtherUnit Source

class EtherUnit a  where

Useful for converting to and from the base denomination Wei

Members

Instances

#mkValue Source

mkValue :: forall a. EtherUnitSpec a => BigNumber -> Value a

Convert a big number into value, first using floor function to take the integer part

#convert Source

convert :: forall b a. EtherUnit a => EtherUnit b => a -> b

Convert between two denominations

Re-exports from Network.Ethereum.Web3.Types.Sha3

#SHA3 Source

class SHA3 a  where

A class for things which you can hash. Mostly used as a utility for calculating selectors and event topics

Members

Instances

Re-exports from Network.Ethereum.Web3.Types.Types

#Web3 Source

newtype Web3 p e a

A monad for asynchronous Web3 actions

Constructors

Instances

#Transaction Source

newtype Transaction

Constructors

Instances

#Signed Source

data Signed a

Represents values that can be either positive or negative.

Constructors

Instances

#Sign Source

data Sign

Constructors

Instances

#HexString Source

newtype HexString

Represents a base16, utf8 encoded bytestring

Instances

#FilterId Source

newtype FilterId

Used by the ethereum client to identify the filter you are querying

Constructors

Instances

#Filter Source

newtype Filter

Low-level event filter data structure

Constructors

Instances

#ETH Source

data ETH :: Effect

Instances

#Change Source

newtype Change

Changes pulled by low-level call 'eth_getFilterChanges', 'eth_getLogs', and 'eth_getFilterLogs'

Constructors

Instances

#CallMode Source

data CallMode

Refers to a particular block time, used when making calls, transactions, or watching for events.

Constructors

Instances

#Block Source

newtype Block

Constructors

Instances

#Address Source

newtype Address

Represents and Ethereum address, which is a 20 byte HexString

Instances

#hexLength Source

hexLength :: HexString -> Int

Compute the length of the hex string, which is twice the number of bytes it represents

#defaultFilter Source

#asSigned Source

asSigned :: forall a. a -> Signed a

Coerce a value into a positive signed value

Re-exports from Network.Ethereum.Web3.Types.Utils

#toUtf8 Source

toUtf8 :: HexString -> String

Takes a hex string and produces the corresponding UTF8-decoded string. This breaks at the first null octet, following the web3 function toUft8.

#toAscii Source

toAscii :: HexString -> String

Takes a hex string and produces the corresponding ASCII decoded string.

#padRightSigned Source

padRightSigned :: Signed HexString -> HexString

Pad a Signed HexString on the right until it has length 0 mod 64.

#padRight Source

padRight :: HexString -> HexString

Pad a HexString on the right with 0's until it has length 0 mod 64.

#padLeftSigned Source

padLeftSigned :: Signed HexString -> HexString

Pad a Signed HexString on the left until it has length == 0 mod 64.

#padLeft Source

padLeft :: HexString -> HexString

Pad a HexString on the left with '0's until it has length == 0 mod 64.

#getPadLength Source

getPadLength :: Int -> Int

Computes the number of 0s needed to pad a bytestring of the input length

#fromUtf8 Source

fromUtf8 :: String -> HexString

Get the 'HexString' corresponding to the UTF8 encoding.

#fromAscii Source

fromAscii :: String -> HexString

Get the 'HexString' corresponding to the ASCII encoding.