Module

Network.Ethereum.Web3.Solidity

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

Re-exports from Data.ByteString

Re-exports from Network.Ethereum.Types

#BigNumber

data BigNumber :: Type

Large Integer, needed for handling numbers of up to 32 bytes

Instances

  • Show BigNumber
  • Eq BigNumber
  • Ord BigNumber
  • Semiring BigNumber
  • Ring BigNumber
  • LeftModule BigNumber Int
  • RightModule BigNumber Int
  • Algebra BigNumber Int
  • Decode BigNumber
  • ReadForeign BigNumber
  • WriteForeign BigNumber
  • Encode BigNumber
  • DecodeJson BigNumber
  • EncodeJson BigNumber

#Address

newtype Address

Represents and Ethereum address, which is a 20 byte HexString

Instances

  • Show Address
  • Eq Address
  • Ord Address
  • Encode Address
  • Decode Address
  • DecodeJson Address
  • EncodeJson Address
  • ReadForeign Address
  • WriteForeign Address

Re-exports from Network.Ethereum.Web3.Solidity.AbiEncoding

#ABIEncode Source

class ABIEncode a  where

Class representing values that have an encoding and decoding instance to/from a solidity type.

Members

Instances

#fromData Source

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

Parse encoded value, droping the leading 0x

Re-exports from Network.Ethereum.Web3.Solidity.Bytes

#BytesN Source

newtype BytesN (n :: DigitList)

See module Network.Ethereum.Web3.Solidity.Sizes for some predefined sizes.

Instances

#update Source

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

#unBytesN Source

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

Access the underlying raw bytestring

#proxyBytesN Source

proxyBytesN :: forall n. KnownSize n => BytesN n

#fromByteString Source

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

Attempt to coerce a bytestring into one of the appropriate size. See module Network.Ethereum.Web3.Solidity.Sizes for some predefined sizes.

Re-exports from Network.Ethereum.Web3.Solidity.Event

#DecodeEvent Source

class (IndexedEvent a b c) <= DecodeEvent a b c | c -> a b where

Members

Instances

#IndexedEvent Source

class IndexedEvent a b c | c -> a b where

Members

Re-exports from Network.Ethereum.Web3.Solidity.Generic

#ArgsToRowListProxy Source

class ArgsToRowListProxy args (l :: RowList) | args -> l, l -> args

Instances

#GenericABIDecode Source

class GenericABIDecode a 

A class for decoding generically composed datatypes from their abi encoding

Instances

#GenericABIEncode Source

class GenericABIEncode a 

A class for encoding generically composed datatypes to their abi encoding

Instances

#RecordFieldsIso Source

class RecordFieldsIso args fields rowList | args -> rowList, rowList -> args fields where

Members

Instances

#genericToRecordFields Source

genericToRecordFields :: forall name a l fields args. RecordFieldsIso args fields l => Generic a (Constructor name args) => a -> Record fields

#genericFromRecordFields Source

genericFromRecordFields :: forall name a l fields args. RecordFieldsIso args fields l => Generic a (Constructor name args) => Record fields -> a

#genericFromData Source

genericFromData :: forall rep a. Generic a rep => GenericABIDecode rep => HexString -> Either ParseError a

#genericABIEncode Source

genericABIEncode :: forall rep a. Generic a rep => GenericABIEncode rep => a -> HexString

Encode a generic type into its abi encoding, works only for types of the form Constructor name (Product (Argument a1) (Product ... (Argument an)))

#genericABIDecode Source

genericABIDecode :: forall rep a. Generic a rep => GenericABIDecode rep => Parser String a

Encode a generic type into its abi encoding, works only for types of the form Constructor name (Product (Argument a1) (Product ... (Argument an)))

Re-exports from Network.Ethereum.Web3.Solidity.Int

#IntN Source

newtype IntN (n :: DigitList)

Represents a statically sized signed integer of size n bytes. See module Network.Ethereum.Web3.Solidity.Sizes for some predefined sizes.

Instances

#unIntN Source

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

Access the raw underlying integer

#intNFromBigNumber Source

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

Attempt to coerce an signed BigNumber into a statically sized one. See module Network.Ethereum.Web3.Solidity.Sizes for some predefined sizes.

Re-exports from Network.Ethereum.Web3.Solidity.Size

#DOne Source

data DOne :: Digit -> DigitList

Instances

#DLProxy Source

data DLProxy (d :: DigitList)

For types of kind Type there is already Type.Proxy. this is basicity the same thing but for types of kind DigitList. Documentation of Type.Proxy module has motivation for why would one need a Proxy for some type which we will not cover here.

Constructors

#DCons Source

data DCons :: Digit -> DigitList -> DigitList

Instances

#ByteSize Source

class (KnownSize n) <= ByteSize n 

ByteSize is empty class, if there is instance of ByteSize for some number it means there is solidity type bytes of that size specific number in like bytes1, bytes2 ... bytes32

Instances

#Inc Source

class Inc (input :: DigitList) (output :: DigitList) | input -> output

This is like inc but in type-level for DigitList, it computes increment of it's input. It could be used like this for example:

cons :: forall a n nInc. Inc n nInc => a -> Vector n a -> Vector nInc a
uncons :: forall a n nDec. Inc nDec n => Vector n a -> { head :: a, tail :: Vector nDec a }

see Network.Ethereum.Web3.Solidity.Vector

Instances

#IntSize Source

class (KnownSize n) <= IntSize n 

IntSize is empty class, if there is instance of IntSize for some number it means there is solidity type int of that size specific number in like int16, int24 ... int256

Instances

#KnownSize Source

class KnownSize (d :: DigitList)  where

Members

  • sizeVal :: DLProxy d -> Int

    Given proxy of a Digit returns a number it represents

    1995 == sizeVal (DLProxy :: DLProxy (D1 :& D9 :& D9 :% D5))
    

Instances

#type (:&) Source

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

#type (:%) Source

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

Re-exports from Network.Ethereum.Web3.Solidity.Tuple

#Tuple9 Source

data Tuple9 a b c d e f g h i

Constructors

Instances

#Tuple8 Source

data Tuple8 a b c d e f g h

Constructors

Instances

#Tuple7 Source

data Tuple7 a b c d e f g

Constructors

Instances

#Tuple6 Source

data Tuple6 a b c d e f

Constructors

Instances

#Tuple5 Source

data Tuple5 a b c d e

Constructors

Instances

#Tuple4 Source

data Tuple4 a b c d

Constructors

Instances

#Tuple3 Source

data Tuple3 a b c

Constructors

Instances

#Tuple2 Source

data Tuple2 a b

Constructors

Instances

#Tuple16 Source

data Tuple16 a b c d e f g h i j k l m n o p

Constructors

  • Tuple16 a b c d e f g h i j k l m n o p

Instances

#Tuple15 Source

data Tuple15 a b c d e f g h i j k l m n o

Constructors

  • Tuple15 a b c d e f g h i j k l m n o

Instances

#Tuple14 Source

data Tuple14 a b c d e f g h i j k l m n

Constructors

  • Tuple14 a b c d e f g h i j k l m n

Instances

#Tuple13 Source

data Tuple13 a b c d e f g h i j k l m

Constructors

Instances

#Tuple12 Source

data Tuple12 a b c d e f g h i j k l

Constructors

Instances

#Tuple11 Source

data Tuple11 a b c d e f g h i j k

Constructors

Instances

#Tuple10 Source

data Tuple10 a b c d e f g h i j

Constructors

Instances

#Tuple1 Source

newtype Tuple1 a

Constructors

Instances

#Tuple0 Source

data Tuple0

Constructors

Instances

#uncurry9 Source

uncurry9 :: forall j i h g f e d c b a. (a -> b -> c -> d -> e -> f -> g -> h -> i -> j) -> Tuple9 a b c d e f g h i -> j

#uncurry8 Source

uncurry8 :: forall i h g f e d c b a. (a -> b -> c -> d -> e -> f -> g -> h -> i) -> Tuple8 a b c d e f g h -> i

#uncurry7 Source

uncurry7 :: forall h g f e d c b a. (a -> b -> c -> d -> e -> f -> g -> h) -> Tuple7 a b c d e f g -> h

#uncurry6 Source

uncurry6 :: forall g f e d c b a. (a -> b -> c -> d -> e -> f -> g) -> Tuple6 a b c d e f -> g

#uncurry5 Source

uncurry5 :: forall f e d c b a. (a -> b -> c -> d -> e -> f) -> Tuple5 a b c d e -> f

#uncurry4 Source

uncurry4 :: forall e d c b a. (a -> b -> c -> d -> e) -> Tuple4 a b c d -> e

#uncurry3 Source

uncurry3 :: forall d c b a. (a -> b -> c -> d) -> Tuple3 a b c -> d

#uncurry2 Source

uncurry2 :: forall c b a. (a -> b -> c) -> Tuple2 a b -> c

#uncurry16 Source

uncurry16 :: forall q p o n m l k j i h g f e d c b a. (a -> b -> c -> d -> e -> f -> g -> h -> i -> j -> k -> l -> m -> n -> o -> p -> q) -> Tuple16 a b c d e f g h i j k l m n o p -> q

#uncurry15 Source

uncurry15 :: forall p o n m l k j i h g f e d c b a. (a -> b -> c -> d -> e -> f -> g -> h -> i -> j -> k -> l -> m -> n -> o -> p) -> Tuple15 a b c d e f g h i j k l m n o -> p

#uncurry14 Source

uncurry14 :: forall o n m l k j i h g f e d c b a. (a -> b -> c -> d -> e -> f -> g -> h -> i -> j -> k -> l -> m -> n -> o) -> Tuple14 a b c d e f g h i j k l m n -> o

#uncurry13 Source

uncurry13 :: forall n m l k j i h g f e d c b a. (a -> b -> c -> d -> e -> f -> g -> h -> i -> j -> k -> l -> m -> n) -> Tuple13 a b c d e f g h i j k l m -> n

#uncurry12 Source

uncurry12 :: forall m l k j i h g f e d c b a. (a -> b -> c -> d -> e -> f -> g -> h -> i -> j -> k -> l -> m) -> Tuple12 a b c d e f g h i j k l -> m

#uncurry11 Source

uncurry11 :: forall l k j i h g f e d c b a. (a -> b -> c -> d -> e -> f -> g -> h -> i -> j -> k -> l) -> Tuple11 a b c d e f g h i j k -> l

#uncurry10 Source

uncurry10 :: forall k j i h g f e d c b a. (a -> b -> c -> d -> e -> f -> g -> h -> i -> j -> k) -> Tuple10 a b c d e f g h i j -> k

#uncurry1 Source

uncurry1 :: forall b a. (a -> b) -> Tuple1 a -> b

#unTuple1 Source

unTuple1 :: forall a. Tuple1 a -> a

#curry9 Source

curry9 :: forall j i h g f e d c b a. (Tuple9 a b c d e f g h i -> j) -> a -> b -> c -> d -> e -> f -> g -> h -> i -> j

#curry8 Source

curry8 :: forall i h g f e d c b a. (Tuple8 a b c d e f g h -> i) -> a -> b -> c -> d -> e -> f -> g -> h -> i

#curry7 Source

curry7 :: forall h g f e d c b a. (Tuple7 a b c d e f g -> h) -> a -> b -> c -> d -> e -> f -> g -> h

#curry6 Source

curry6 :: forall g f e d c b a. (Tuple6 a b c d e f -> g) -> a -> b -> c -> d -> e -> f -> g

#curry5 Source

curry5 :: forall f e d c b a. (Tuple5 a b c d e -> f) -> a -> b -> c -> d -> e -> f

#curry4 Source

curry4 :: forall e d c b a. (Tuple4 a b c d -> e) -> a -> b -> c -> d -> e

#curry3 Source

curry3 :: forall d c b a. (Tuple3 a b c -> d) -> a -> b -> c -> d

#curry2 Source

curry2 :: forall c b a. (Tuple2 a b -> c) -> a -> b -> c

#curry16 Source

curry16 :: forall q p o n m l k j i h g f e d c b a. (Tuple16 a b c d e f g h i j k l m n o p -> q) -> a -> b -> c -> d -> e -> f -> g -> h -> i -> j -> k -> l -> m -> n -> o -> p -> q

#curry15 Source

curry15 :: forall p o n m l k j i h g f e d c b a. (Tuple15 a b c d e f g h i j k l m n o -> p) -> a -> b -> c -> d -> e -> f -> g -> h -> i -> j -> k -> l -> m -> n -> o -> p

#curry14 Source

curry14 :: forall o n m l k j i h g f e d c b a. (Tuple14 a b c d e f g h i j k l m n -> o) -> a -> b -> c -> d -> e -> f -> g -> h -> i -> j -> k -> l -> m -> n -> o

#curry13 Source

curry13 :: forall n m l k j i h g f e d c b a. (Tuple13 a b c d e f g h i j k l m -> n) -> a -> b -> c -> d -> e -> f -> g -> h -> i -> j -> k -> l -> m -> n

#curry12 Source

curry12 :: forall m l k j i h g f e d c b a. (Tuple12 a b c d e f g h i j k l -> m) -> a -> b -> c -> d -> e -> f -> g -> h -> i -> j -> k -> l -> m

#curry11 Source

curry11 :: forall l k j i h g f e d c b a. (Tuple11 a b c d e f g h i j k -> l) -> a -> b -> c -> d -> e -> f -> g -> h -> i -> j -> k -> l

#curry10 Source

curry10 :: forall k j i h g f e d c b a. (Tuple10 a b c d e f g h i j -> k) -> a -> b -> c -> d -> e -> f -> g -> h -> i -> j -> k

#curry1 Source

curry1 :: forall b a. (Tuple1 a -> b) -> a -> b

Re-exports from Network.Ethereum.Web3.Solidity.UInt

#UIntN Source

newtype UIntN (n :: DigitList)

Represents a statically sized unsigned integer of size n. See module Network.Ethereum.Web3.Solidity.Sizes for some predefined sizes.

Instances

#unUIntN Source

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

Access the raw underlying unsigned integer

#uIntNFromBigNumber Source

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

Attempt to coerce an unsigned integer into a statically sized one. See module Network.Ethereum.Web3.Solidity.Sizes for some predefined sizes.

Re-exports from Network.Ethereum.Web3.Solidity.Vector

#Vector Source

newtype Vector (n :: DigitList) a

Represents a statically sized vector of length n. See module Network.Ethereum.Web3.Solidity.Sizes for some predefined sizes.

Instances

#vectorLength Source

vectorLength :: forall n a. KnownSize n => Vector n a -> Int

Get the length of a statically sized vector

#vCons Source

vCons :: forall nInc n a. Inc n nInc => a -> Vector n a -> Vector nInc a

Dependently typed cons

#unVector Source

unVector :: forall n a. Vector n a -> Array a

Access the underlying array

#toVector Source

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

Attempt to coerce an array into a statically sized array. See module Network.Ethereum.Web3.Solidity.Sizes for some predefined sizes.

#nilVector Source

nilVector :: forall a. Vector (DOne D0) a

Array of length 0

#(:<) Source

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