Module

Network.Ethereum.Web3

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

Re-exports from Network.Ethereum.Web3.Contract

#EventFilter Source

class EventFilter a  where

Members

#call Source

call :: forall selector a b e. CallMethod selector a b => IsSymbol selector => TransactionOptions NoPay -> ChainCursor -> Tagged (SProxy selector) a -> Web3 e (Either CallError b)

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

#sendTx Source

sendTx :: forall selector a u e. TxMethod selector a => EtherUnit (Value u) => IsSymbol selector => TransactionOptions u -> Tagged (SProxy selector) a -> Web3 e HexString

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

#event' Source

event' :: forall ni i a e. DecodeEvent i ni a => Filter -> Int -> (a -> ReaderT Change (Web3 e) EventAction) -> Web3 e Unit

Takes a Filter and a handler, as well as a windowSize. It runs the handler over the eventLogs using reduceEventStream. If no TerminateEvent is thrown, it then transitions to polling.

#event Source

event :: forall ni i a e. DecodeEvent i ni a => Filter -> (a -> ReaderT Change (Web3 e) EventAction) -> Web3 e Unit

run event' one block at a time.

#deployContract Source

deployContract :: forall t e rep a. Generic a rep => GenericABIEncode rep => TransactionOptions NoPay -> HexString -> Tagged t a -> Web3 e HexString

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

#unUIntN Source

unUIntN :: forall n. KnownSize n => UIntN n -> BigNumber

Access the raw underlying unsigned integer

#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

#fromData Source

fromData :: forall a. ABIDecode a => HexString -> Either ParseError a

Parse encoded value, droping the leading 0x

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

#Finney Source

data Finney

Finney unit type

Instances

#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

#EventAction Source

data EventAction

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

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

#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

#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 a r. Algebra a r => 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.

#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

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

#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

#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

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

#Provider Source

data Provider :: Type

Represents a connection to an ethereum client

#metamaskProvider Source

metamaskProvider :: forall e. Eff (exception :: EXCEPTION | e) Provider

Produces reference to Metamas provider

#httpProvider Source

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

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