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, LeftModule a r, RightModule a r) <= Algebra a r  where

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

#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

#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.

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

#toSelector Source

toSelector :: String -> HexString

convert a string representing a type signature into a selector

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

#Web3 Source

newtype Web3 e a

A monad for asynchronous Web3 actions

Constructors

Instances

#TransactionReceipt Source

newtype TransactionReceipt

Constructors

Instances

#Transaction Source

newtype Transaction

Constructors

Instances

#SyncStatus Source

newtype SyncStatus

Constructors

Instances

#Signed Source

data Signed a

Represents values that can be either positive or negative.

Constructors

Instances

#Sign Source

data Sign

Constructors

Instances

#RpcError Source

newtype RpcError

Constructors

Instances

#Response Source

newtype Response a

Constructors

Instances

#Request Source

#MethodName Source

type MethodName = String

Web3 RPC

#HexString Source

#FilterId Source

newtype FilterId

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

Instances

#Filter Source

newtype Filter

Low-level event filter data structure

Instances

#FalseOrObject Source

newtype FalseOrObject a

Newtype wrapper around Maybe to handle cases where Web3 passes back either false or some data type

Constructors

Instances

#EventAction Source

data EventAction

EventAction Represents a flag to continue or discontinue listening to the filter

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

#ChainCursor Source

data ChainCursor

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

Constructors

Instances

#CallError Source

data CallError

Constructors

Instances

#Block Source

newtype Block

Constructors

Instances

#Address Source

newtype Address

Represents and Ethereum address, which is a 20 byte HexString

Instances

#throwWeb3 Source

throwWeb3 :: forall a e. Error -> Web3 e a

#runWeb3 Source

runWeb3 :: forall a e. Provider -> Web3 e a -> Aff (eth :: ETH | e) (Either Web3Error a)

Run an asynchronous ETH action

#hexLength Source

hexLength :: HexString -> Int

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

#forkWeb3' Source

forkWeb3' :: forall a e. Web3 e a -> Web3 e (Fiber (eth :: ETH | e) (Either Web3Error a))

Fork an asynchronous ETH action inside Web3 monad

#forkWeb3 Source

forkWeb3 :: forall a e. Provider -> Web3 e a -> Aff (eth :: ETH | e) (Fiber (eth :: ETH | e) (Either Web3Error a))

Fork an asynchronous ETH action

#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.