Module

Network.Ethereum.Web3

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

Re-exports from Network.Ethereum.Web3.Contract

#EventAction Source

data EventAction

Represents a flag to continue or discontinue listening to the filter

Constructors

Instances

#call Source

call :: forall a b e p. Method a => IsAsyncProvider p => ABIEncoding b => Address -> Maybe Address -> CallMode -> a -> Web3 p e b

Constant call given contract 'Address' in mode and given input data

#sendTx Source

sendTx :: forall a u e p. Method a => IsAsyncProvider p => EtherUnit u => Maybe Address -> Address -> u -> a -> Web3 p e HexString

Send a transaction for given contract 'Address', value and input data

#event Source

event :: forall a e p. IsAsyncProvider p => EventFilter a => Address -> (a -> ReaderT Change (Web3 p e) EventAction) -> Web3 p e (Fiber (eth :: ETH | e) Unit)

Start listening to events eminating from the given address and caught by the filter, using the handler to process the data and decide whether to continue

Re-exports from Network.Ethereum.Web3.Provider

#Provider Source

data Provider :: Type

Represents a connection to an ethereum client

#Metamask Source

data Metamask

Used only in the browser

Instances

#IsAsyncProvider Source

class IsAsyncProvider p  where

Members

Instances

#runWeb3 Source

runWeb3 :: forall a e p. Proxy p -> Web3 p e a -> Aff (eth :: ETH | e) a

Run an asynchronous ETH action

#httpProvider Source

httpProvider :: forall e. String -> Eff e Provider

Connect to an ethereum client at a given address, eg "http://localhost:8545"

#forkWeb3' Source

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

Fork an asynchronous ETH action inside Web3 monad

#forkWeb3 Source

forkWeb3 :: forall a e p. Proxy p -> Web3 p e a -> Aff (eth :: ETH | e) (Fiber (eth :: ETH | e) a)

Fork an asynchronous ETH action

Re-exports from Network.Ethereum.Web3.Solidity

#Vector Source

newtype Vector n a

Represents a statically sized vector of length n

Instances

#UIntN Source

newtype UIntN n

Represents a statically sized unsigned integer of size n

Instances

#N9 Source

type N9 = S N8

#N8 Source

type N8 = S N7

#N7 Source

type N7 = S N6

#N6 Source

type N6 = S N5

#N5 Source

type N5 = S N4

#N4 Source

type N4 = S N3

#N3 Source

type N3 = S N2

#N2 Source

type N2 = S N1

#N1 Source

type N1 = S N0

#N0 Source

type N0 = Z

#IntN Source

newtype IntN n

Represents a statically sized signed integer of size n bytes

Instances

#BytesN Source

newtype BytesN n

Instances

#vCons Source

vCons :: forall n a. a -> Vector n a -> Vector (S n) a

Dependently typed cons

#unIntN Source

unIntN :: forall n. KnownSize n => IntN n -> BigNumber

Access the raw underlying integer

#unBytesN Source

unBytesN :: forall n. KnownSize n => BytesN n -> ByteString

Access the underlying raw bytestring

#uIntNFromBigNumber Source

uIntNFromBigNumber :: forall n. KnownSize n => BigNumber -> Maybe (UIntN n)

Attempt to coerce an unsigned integer into a statically sized one

#toVector Source

toVector :: forall n a. KnownNat n => Array a -> Maybe (Vector n a)

Attempt to coerce an array into a statically sized array

#nilVector Source

nilVector :: forall a. Vector Z a

Array of length 0

#intNFromBigNumber Source

intNFromBigNumber :: forall n. KnownSize n => BigNumber -> Maybe (IntN n)

Attempt to coerce an signed BigNumber into a statically sized one

#fromByteString Source

fromByteString :: forall n. KnownSize n => ByteString -> Maybe (BytesN n)

Attempt to coerce a bytestring into one of the appropriate size

#(:<) Source

Operator alias for Network.Ethereum.Web3.Solidity.Vector.vCons (right-associative / precedence 6)

#type (:&) Source

Operator alias for Network.Ethereum.Web3.Solidity.Size.NumCons (right-associative / precedence 6)

Re-exports from Network.Ethereum.Web3.Types

#Wei Source

data Wei

Instances

#Web3 Source

newtype Web3 p e a

A monad for asynchronous Web3 actions

Instances

#Value Source

newtype Value a

Ether value in denomination a

Instances

#Transaction Source

newtype Transaction

Constructors

Instances

#Szabo Source

data Szabo

Szabo unit type

Instances

#Shannon Source

data Shannon

Shannon unit type

Instances

#Radix Source

newtype Radix

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

#Lovelace Source

data Lovelace

Lovelace unit type

Instances

#KEther Source

data KEther

KEther unit type

Instances

#HexString Source

newtype HexString

Represents a base16, utf8 encoded bytestring

Instances

#Finney Source

data Finney

Finney unit type

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

#Ether Source

data Ether

Ether unit type

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

#Babbage Source

data Babbage

Babbage unit type

Instances

#Address Source

newtype Address

Represents and Ethereum address, which is a 20 byte HexString

Instances

#embed Source

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

#fromWei Source

fromWei :: forall a. EtherUnit a => BigNumber -> a

#sha3 Source

sha3 :: forall a. SHA3 a => a -> HexString

#toWei Source

toWei :: forall a. EtherUnit a => a -> BigNumber

#unsafeToInt Source

unsafeToInt :: BigNumber -> Int

Unsafely coerce a BigNumber to an Int.

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

#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

#toAscii Source

toAscii :: HexString -> String

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

#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

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

#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

#hexadecimal Source

hexadecimal :: Radix

The base-16 system.

#hexLength Source

hexLength :: HexString -> Int

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

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

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

#defaultFilter Source

#decimal Source

decimal :: Radix

The base-10 system.

#convert Source

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

Convert between two denominations

#binary Source

binary :: Radix

The base-2 system.

#asSigned Source

asSigned :: forall a. a -> Signed a

Coerce a value into a positive signed value

#(>-) 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)