web3-ethereum 1.0.1.0 → 1.1.0.0
raw patch · 6 files changed
+155/−78 lines, 6 filesdep ~OneTupledep ~aesondep ~basePVP ok
version bump matches the API change (PVP)
Dependency ranges changed: OneTuple, aeson, base, bytestring, data-default, exceptions, generics-sop, jsonrpc-tinyclient, machines, memory, memory-hexstring, microlens, microlens-aeson, mtl, relapse, tagged, template-haskell, text, transformers, vinyl, web3-crypto, web3-solidity
API changes (from Hackage documentation)
- Network.Ethereum.Account.Internal: updateReceipt :: JsonRpc m => TxReceipt -> m TxReceipt
- Network.Ethereum.Account.LocalKey: instance Data.Default.Class.Default Network.Ethereum.Account.LocalKey.LocalKey
- Network.Ethereum.Account.Personal: instance Data.Default.Class.Default Network.Ethereum.Account.Personal.Personal
- Network.Ethereum.Api.Types: [blockTotalDifficulty] :: BlockT tx -> !Quantity
- Network.Ethereum.Api.Types: instance Data.Default.Class.Default Network.Ethereum.Api.Types.Call
- Network.Ethereum.Ens.PublicResolver: instance Data.Default.Class.Default (Network.Ethereum.Api.Types.Filter Network.Ethereum.Ens.PublicResolver.ABIChanged)
- Network.Ethereum.Ens.PublicResolver: instance Data.Default.Class.Default (Network.Ethereum.Api.Types.Filter Network.Ethereum.Ens.PublicResolver.AddrChanged)
- Network.Ethereum.Ens.PublicResolver: instance Data.Default.Class.Default (Network.Ethereum.Api.Types.Filter Network.Ethereum.Ens.PublicResolver.ContentChanged)
- Network.Ethereum.Ens.PublicResolver: instance Data.Default.Class.Default (Network.Ethereum.Api.Types.Filter Network.Ethereum.Ens.PublicResolver.NameChanged)
- Network.Ethereum.Ens.PublicResolver: instance Data.Default.Class.Default (Network.Ethereum.Api.Types.Filter Network.Ethereum.Ens.PublicResolver.PubkeyChanged)
- Network.Ethereum.Ens.Registry: instance Data.Default.Class.Default (Network.Ethereum.Api.Types.Filter Network.Ethereum.Ens.Registry.NewOwner)
- Network.Ethereum.Ens.Registry: instance Data.Default.Class.Default (Network.Ethereum.Api.Types.Filter Network.Ethereum.Ens.Registry.NewResolver)
- Network.Ethereum.Ens.Registry: instance Data.Default.Class.Default (Network.Ethereum.Api.Types.Filter Network.Ethereum.Ens.Registry.NewTTL)
- Network.Ethereum.Ens.Registry: instance Data.Default.Class.Default (Network.Ethereum.Api.Types.Filter Network.Ethereum.Ens.Registry.Transfer)
+ Network.Ethereum.Account.LocalKey: instance Data.Default.Internal.Default Network.Ethereum.Account.LocalKey.LocalKey
+ Network.Ethereum.Account.Personal: instance Data.Default.Internal.Default Network.Ethereum.Account.Personal.Personal
+ Network.Ethereum.Api.Eth: chainId :: JsonRpc m => m Quantity
+ Network.Ethereum.Api.Eth: feeHistory :: JsonRpc m => Quantity -> DefaultBlock -> [Double] -> m FeeHistory
+ Network.Ethereum.Api.Types: Byte :: Word8 -> Byte
+ Network.Ethereum.Api.Types: FeeHistory :: [Quantity] -> [Quantity] -> [Rational] -> [Rational] -> Quantity -> [[Quantity]] -> FeeHistory
+ Network.Ethereum.Api.Types: [blobGasPrice] :: TxReceipt -> !Maybe Quantity
+ Network.Ethereum.Api.Types: [feeHistoryBaseFeePerBlobGas] :: FeeHistory -> [Quantity]
+ Network.Ethereum.Api.Types: [feeHistoryBaseFeePerGas] :: FeeHistory -> [Quantity]
+ Network.Ethereum.Api.Types: [feeHistoryBlobGasUsedRatio] :: FeeHistory -> [Rational]
+ Network.Ethereum.Api.Types: [feeHistoryGasUsedRatio] :: FeeHistory -> [Rational]
+ Network.Ethereum.Api.Types: [feeHistoryOldestBlock] :: FeeHistory -> Quantity
+ Network.Ethereum.Api.Types: [feeHistoryReward] :: FeeHistory -> [[Quantity]]
+ Network.Ethereum.Api.Types: [receiptBlobGasUsed] :: TxReceipt -> !Maybe Quantity
+ Network.Ethereum.Api.Types: [receiptEffectiveGasPrice] :: TxReceipt -> !Quantity
+ Network.Ethereum.Api.Types: [receiptFrom] :: TxReceipt -> !Address
+ Network.Ethereum.Api.Types: [receiptRoot] :: TxReceipt -> !Maybe HexString
+ Network.Ethereum.Api.Types: [receiptTo] :: TxReceipt -> !Maybe Address
+ Network.Ethereum.Api.Types: [receiptType] :: TxReceipt -> !Maybe Byte
+ Network.Ethereum.Api.Types: [unByte] :: Byte -> Word8
+ Network.Ethereum.Api.Types: data FeeHistory
+ Network.Ethereum.Api.Types: instance Data.Aeson.Types.FromJSON.FromJSON Network.Ethereum.Api.Types.Byte
+ Network.Ethereum.Api.Types: instance Data.Aeson.Types.FromJSON.FromJSON Network.Ethereum.Api.Types.FeeHistory
+ Network.Ethereum.Api.Types: instance Data.Aeson.Types.ToJSON.ToJSON Network.Ethereum.Api.Types.Byte
+ Network.Ethereum.Api.Types: instance Data.Aeson.Types.ToJSON.ToJSON Network.Ethereum.Api.Types.FeeHistory
+ Network.Ethereum.Api.Types: instance Data.Default.Internal.Default Network.Ethereum.Api.Types.Call
+ Network.Ethereum.Api.Types: instance Data.String.IsString Network.Ethereum.Api.Types.Byte
+ Network.Ethereum.Api.Types: instance GHC.Classes.Eq Network.Ethereum.Api.Types.Byte
+ Network.Ethereum.Api.Types: instance GHC.Classes.Ord Network.Ethereum.Api.Types.Byte
+ Network.Ethereum.Api.Types: instance GHC.Enum.Enum Network.Ethereum.Api.Types.Byte
+ Network.Ethereum.Api.Types: instance GHC.Generics.Generic Network.Ethereum.Api.Types.Byte
+ Network.Ethereum.Api.Types: instance GHC.Generics.Generic Network.Ethereum.Api.Types.FeeHistory
+ Network.Ethereum.Api.Types: instance GHC.Num.Num Network.Ethereum.Api.Types.Byte
+ Network.Ethereum.Api.Types: instance GHC.Real.Integral Network.Ethereum.Api.Types.Byte
+ Network.Ethereum.Api.Types: instance GHC.Real.Real Network.Ethereum.Api.Types.Byte
+ Network.Ethereum.Api.Types: instance GHC.Show.Show Network.Ethereum.Api.Types.Byte
+ Network.Ethereum.Api.Types: instance GHC.Show.Show Network.Ethereum.Api.Types.FeeHistory
+ Network.Ethereum.Api.Types: newtype Byte
+ Network.Ethereum.Ens.PublicResolver: instance Data.Default.Internal.Default (Network.Ethereum.Api.Types.Filter Network.Ethereum.Ens.PublicResolver.ABIChanged)
+ Network.Ethereum.Ens.PublicResolver: instance Data.Default.Internal.Default (Network.Ethereum.Api.Types.Filter Network.Ethereum.Ens.PublicResolver.AddrChanged)
+ Network.Ethereum.Ens.PublicResolver: instance Data.Default.Internal.Default (Network.Ethereum.Api.Types.Filter Network.Ethereum.Ens.PublicResolver.ContentChanged)
+ Network.Ethereum.Ens.PublicResolver: instance Data.Default.Internal.Default (Network.Ethereum.Api.Types.Filter Network.Ethereum.Ens.PublicResolver.NameChanged)
+ Network.Ethereum.Ens.PublicResolver: instance Data.Default.Internal.Default (Network.Ethereum.Api.Types.Filter Network.Ethereum.Ens.PublicResolver.PubkeyChanged)
+ Network.Ethereum.Ens.Registry: instance Data.Default.Internal.Default (Network.Ethereum.Api.Types.Filter Network.Ethereum.Ens.Registry.NewOwner)
+ Network.Ethereum.Ens.Registry: instance Data.Default.Internal.Default (Network.Ethereum.Api.Types.Filter Network.Ethereum.Ens.Registry.NewResolver)
+ Network.Ethereum.Ens.Registry: instance Data.Default.Internal.Default (Network.Ethereum.Api.Types.Filter Network.Ethereum.Ens.Registry.NewTTL)
+ Network.Ethereum.Ens.Registry: instance Data.Default.Internal.Default (Network.Ethereum.Api.Types.Filter Network.Ethereum.Ens.Registry.Transfer)
- Network.Ethereum.Account: account :: Lens' (CallParam p) p
+ Network.Ethereum.Account: account :: forall p f. Functor f => (p -> f p) -> CallParam p -> f (CallParam p)
- Network.Ethereum.Account: block :: Lens' (CallParam p) DefaultBlock
+ Network.Ethereum.Account: block :: forall p f. Functor f => (DefaultBlock -> f DefaultBlock) -> CallParam p -> f (CallParam p)
- Network.Ethereum.Account: call :: (Account a t, JsonRpc m, Method args, AbiGet result) => args -> t m result
+ Network.Ethereum.Account: call :: forall (m :: Type -> Type) args result. (Account a t, JsonRpc m, Method args, AbiGet result) => args -> t m result
- Network.Ethereum.Account: class MonadTrans t => Account a t | t -> a
+ Network.Ethereum.Account: class MonadTrans t => Account a (t :: Type -> Type -> Type -> Type) | t -> a
- Network.Ethereum.Account: gasLimit :: Lens' (CallParam p) Integer
+ Network.Ethereum.Account: gasLimit :: forall p f. Functor f => (Integer -> f Integer) -> CallParam p -> f (CallParam p)
- Network.Ethereum.Account: send :: (Account a t, JsonRpc m, Method args) => args -> t m (Either HexString TxReceipt)
+ Network.Ethereum.Account: send :: forall (m :: Type -> Type) args. (Account a t, JsonRpc m, Method args) => args -> t m (Either HexString TxReceipt)
- Network.Ethereum.Account: timeout :: Lens' (CallParam p) (Maybe Int)
+ Network.Ethereum.Account: timeout :: forall p f. Functor f => (Maybe Int -> f (Maybe Int)) -> CallParam p -> f (CallParam p)
- Network.Ethereum.Account: to :: Lens' (CallParam p) Address
+ Network.Ethereum.Account: to :: forall p f. Functor f => (Address -> f Address) -> CallParam p -> f (CallParam p)
- Network.Ethereum.Account: withParam :: Account p (AccountT p) => (CallParam p -> CallParam p) -> AccountT p m a -> AccountT p m a
+ Network.Ethereum.Account: withParam :: forall p (m :: Type -> Type) a. Account p (AccountT p) => (CallParam p -> CallParam p) -> AccountT p m a -> AccountT p m a
- Network.Ethereum.Account.Class: call :: (Account a t, JsonRpc m, Method args, AbiGet result) => args -> t m result
+ Network.Ethereum.Account.Class: call :: forall (m :: Type -> Type) args result. (Account a t, JsonRpc m, Method args, AbiGet result) => args -> t m result
- Network.Ethereum.Account.Class: class MonadTrans t => Account a t | t -> a
+ Network.Ethereum.Account.Class: class MonadTrans t => Account a (t :: Type -> Type -> Type -> Type) | t -> a
- Network.Ethereum.Account.Class: send :: (Account a t, JsonRpc m, Method args) => args -> t m (Either HexString TxReceipt)
+ Network.Ethereum.Account.Class: send :: forall (m :: Type -> Type) args. (Account a t, JsonRpc m, Method args) => args -> t m (Either HexString TxReceipt)
- Network.Ethereum.Account.Internal: AccountT :: StateT (CallParam p) m a -> AccountT p m a
+ Network.Ethereum.Account.Internal: AccountT :: StateT (CallParam p) m a -> AccountT p (m :: Type -> Type) a
- Network.Ethereum.Account.Internal: [runAccountT] :: AccountT p m a -> StateT (CallParam p) m a
+ Network.Ethereum.Account.Internal: [runAccountT] :: AccountT p (m :: Type -> Type) a -> StateT (CallParam p) m a
- Network.Ethereum.Account.Internal: account :: Lens' (CallParam p) p
+ Network.Ethereum.Account.Internal: account :: forall p f. Functor f => (p -> f p) -> CallParam p -> f (CallParam p)
- Network.Ethereum.Account.Internal: block :: Lens' (CallParam p) DefaultBlock
+ Network.Ethereum.Account.Internal: block :: forall p f. Functor f => (DefaultBlock -> f DefaultBlock) -> CallParam p -> f (CallParam p)
- Network.Ethereum.Account.Internal: gasLimit :: Lens' (CallParam p) Integer
+ Network.Ethereum.Account.Internal: gasLimit :: forall p f. Functor f => (Integer -> f Integer) -> CallParam p -> f (CallParam p)
- Network.Ethereum.Account.Internal: newtype AccountT p m a
+ Network.Ethereum.Account.Internal: newtype AccountT p (m :: Type -> Type) a
- Network.Ethereum.Account.Internal: timeout :: Lens' (CallParam p) (Maybe Int)
+ Network.Ethereum.Account.Internal: timeout :: forall p f. Functor f => (Maybe Int -> f (Maybe Int)) -> CallParam p -> f (CallParam p)
- Network.Ethereum.Account.Internal: to :: Lens' (CallParam p) Address
+ Network.Ethereum.Account.Internal: to :: forall p f. Functor f => (Address -> f Address) -> CallParam p -> f (CallParam p)
- Network.Ethereum.Account.Internal: withParam :: Account p (AccountT p) => (CallParam p -> CallParam p) -> AccountT p m a -> AccountT p m a
+ Network.Ethereum.Account.Internal: withParam :: forall p (m :: Type -> Type) a. Account p (AccountT p) => (CallParam p -> CallParam p) -> AccountT p m a -> AccountT p m a
- Network.Ethereum.Account.Safe: safeSend :: (Account p t, JsonRpc m, Method args, Monad (t m)) => Integer -> args -> t m (Either HexString TxReceipt)
+ Network.Ethereum.Account.Safe: safeSend :: forall p t (m :: Type -> Type) args. (Account p t, JsonRpc m, Method args, Monad (t m)) => Integer -> args -> t m (Either HexString TxReceipt)
- Network.Ethereum.Api.Types: Block :: !Maybe Quantity -> !Maybe HexString -> !HexString -> !Maybe HexString -> !HexString -> !Maybe HexString -> !HexString -> !HexString -> !Maybe HexString -> !Address -> !Quantity -> !Quantity -> !HexString -> !Quantity -> !Quantity -> !Quantity -> !Quantity -> ![tx] -> ![HexString] -> BlockT tx
+ Network.Ethereum.Api.Types: Block :: !Maybe Quantity -> !Maybe HexString -> !HexString -> !Maybe HexString -> !HexString -> !Maybe HexString -> !HexString -> !HexString -> !Maybe HexString -> !Address -> !Maybe Quantity -> !HexString -> !Quantity -> !Quantity -> !Quantity -> !Quantity -> ![tx] -> ![HexString] -> BlockT tx
- Network.Ethereum.Api.Types: TxReceipt :: !HexString -> !Quantity -> !Maybe HexString -> !Maybe Quantity -> !Quantity -> !Quantity -> !Maybe Address -> ![Change] -> !HexString -> !Maybe Quantity -> TxReceipt
+ Network.Ethereum.Api.Types: TxReceipt :: !Maybe Byte -> !HexString -> !Quantity -> !HexString -> !Quantity -> !Address -> !Maybe Address -> !Quantity -> !Quantity -> !Maybe Quantity -> !Maybe Address -> ![Change] -> !HexString -> !Maybe HexString -> !Maybe Quantity -> !Quantity -> !Maybe Quantity -> TxReceipt
- Network.Ethereum.Api.Types: [blockDifficulty] :: BlockT tx -> !Quantity
+ Network.Ethereum.Api.Types: [blockDifficulty] :: BlockT tx -> !Maybe Quantity
- Network.Ethereum.Api.Types: [receiptBlockHash] :: TxReceipt -> !Maybe HexString
+ Network.Ethereum.Api.Types: [receiptBlockHash] :: TxReceipt -> !HexString
- Network.Ethereum.Api.Types: [receiptBlockNumber] :: TxReceipt -> !Maybe Quantity
+ Network.Ethereum.Api.Types: [receiptBlockNumber] :: TxReceipt -> !Quantity
- Network.Ethereum.Contract: new :: (Account p t, JsonRpc m, Method a, Monad (t m)) => a -> t m (Either HexString (Maybe Address))
+ Network.Ethereum.Contract: new :: forall p t (m :: Type -> Type) a. (Account p t, JsonRpc m, Method a, Monad (t m)) => a -> t m (Either HexString (Maybe Address))
- Network.Ethereum.Contract.Event.MultiFilter: [:?] :: Filter e -> MultiFilter es -> MultiFilter (e ': es)
+ Network.Ethereum.Contract.Event.MultiFilter: [:?] :: forall e (es1 :: [Type]). Filter e -> MultiFilter es1 -> MultiFilter (e ': es1)
- Network.Ethereum.Contract.Event.MultiFilter: [NilFilters] :: MultiFilter '[]
+ Network.Ethereum.Contract.Event.MultiFilter: [NilFilters] :: MultiFilter ('[] :: [Type])
- Network.Ethereum.Contract.Event.MultiFilter: data MultiFilter (es :: [*])
+ Network.Ethereum.Contract.Event.MultiFilter: data MultiFilter (es :: [Type])
- Network.Ethereum.Contract.Event.MultiFilter: data () => Rec (a :: u -> Type) (b :: [u])
+ Network.Ethereum.Contract.Event.MultiFilter: data Rec (a :: u -> Type) (b :: [u])
- Network.Ethereum.Contract.Event.MultiFilter: minEndBlock :: MultiFilter es -> DefaultBlock
+ Network.Ethereum.Contract.Event.MultiFilter: minEndBlock :: forall (es :: [Type]). MultiFilter es -> DefaultBlock
- Network.Ethereum.Contract.Event.MultiFilter: minStartBlock :: MultiFilter es -> DefaultBlock
+ Network.Ethereum.Contract.Event.MultiFilter: minStartBlock :: forall (es :: [Type]). MultiFilter es -> DefaultBlock
- Network.Ethereum.Contract.Event.MultiFilter: modifyMultiFilter :: (forall e. Filter e -> Filter e) -> MultiFilter es -> MultiFilter es
+ Network.Ethereum.Contract.Event.MultiFilter: modifyMultiFilter :: forall (es :: [Type]). (forall e. () => Filter e -> Filter e) -> MultiFilter es -> MultiFilter es
- Network.Ethereum.Contract.Event.MultiFilter: multiEvent :: (PollFilters es, QueryAllLogs es, MapHandlers m es (WithChange es), RPureConstrained HasLogIndex (WithChange es), RecApplicative (WithChange es), JsonRpc m) => MultiFilter es -> Handlers es (ReaderT Change m EventAction) -> m ()
+ Network.Ethereum.Contract.Event.MultiFilter: multiEvent :: forall (es :: [Type]) m. (PollFilters es, QueryAllLogs es, MapHandlers m es (WithChange es), RPureConstrained HasLogIndex (WithChange es), RecApplicative (WithChange es), JsonRpc m) => MultiFilter es -> Handlers es (ReaderT Change m EventAction) -> m ()
- Network.Ethereum.Contract.Event.MultiFilter: multiEventMany :: (PollFilters es, QueryAllLogs es, MapHandlers m es (WithChange es), RPureConstrained HasLogIndex (WithChange es), RecApplicative (WithChange es), JsonRpc m) => MultiFilter es -> Integer -> Handlers es (ReaderT Change m EventAction) -> m ()
+ Network.Ethereum.Contract.Event.MultiFilter: multiEventMany :: forall (es :: [Type]) m. (PollFilters es, QueryAllLogs es, MapHandlers m es (WithChange es), RPureConstrained HasLogIndex (WithChange es), RecApplicative (WithChange es), JsonRpc m) => MultiFilter es -> Integer -> Handlers es (ReaderT Change m EventAction) -> m ()
- Network.Ethereum.Contract.Event.MultiFilter: multiEventManyNoFilter :: (QueryAllLogs es, MapHandlers m es (WithChange es), RPureConstrained HasLogIndex (WithChange es), RecApplicative (WithChange es), JsonRpc m) => MultiFilter es -> Integer -> Handlers es (ReaderT Change m EventAction) -> m ()
+ Network.Ethereum.Contract.Event.MultiFilter: multiEventManyNoFilter :: forall (es :: [Type]) m. (QueryAllLogs es, MapHandlers m es (WithChange es), RPureConstrained HasLogIndex (WithChange es), RecApplicative (WithChange es), JsonRpc m) => MultiFilter es -> Integer -> Handlers es (ReaderT Change m EventAction) -> m ()
- Network.Ethereum.Contract.Event.MultiFilter: multiEventNoFilter :: (QueryAllLogs es, MapHandlers m es (WithChange es), RPureConstrained HasLogIndex (WithChange es), RecApplicative (WithChange es), JsonRpc m) => MultiFilter es -> Handlers es (ReaderT Change m EventAction) -> m ()
+ Network.Ethereum.Contract.Event.MultiFilter: multiEventNoFilter :: forall (es :: [Type]) m. (QueryAllLogs es, MapHandlers m es (WithChange es), RPureConstrained HasLogIndex (WithChange es), RecApplicative (WithChange es), JsonRpc m) => MultiFilter es -> Handlers es (ReaderT Change m EventAction) -> m ()
- Network.Ethereum.Contract.Event.MultiFilter: newtype () => Handler b a
+ Network.Ethereum.Contract.Event.MultiFilter: newtype Handler b a
- Network.Ethereum.Ens: resolve :: (JsonRpc m, Account p (AccountT p)) => ByteString -> AccountT p m Address
+ Network.Ethereum.Ens: resolve :: forall (m :: Type -> Type) p. (JsonRpc m, Account p (AccountT p)) => ByteString -> AccountT p m Address
- Network.Ethereum.Ens.PublicResolver: aBI :: (JsonRpc m_aYjF, Account a_aYjD t_aYjE, Functor (t_aYjE m_aYjF)) => BytesN 32 -> UIntN 256 -> t_aYjE m_aYjF (UIntN 256, Bytes)
+ Network.Ethereum.Ens.PublicResolver: aBI :: forall (m :: Type -> Type) a t. (JsonRpc m, Account a t, Functor (t m)) => BytesN 32 -> UIntN 256 -> t m (UIntN 256, Bytes)
- Network.Ethereum.Ens.PublicResolver: addr :: (JsonRpc m_aYjJ, Account a_aYjH t_aYjI, Functor (t_aYjI m_aYjJ)) => BytesN 32 -> t_aYjI m_aYjJ Address
+ Network.Ethereum.Ens.PublicResolver: addr :: forall (m :: Type -> Type) a t. (JsonRpc m, Account a t, Functor (t m)) => BytesN 32 -> t m Address
- Network.Ethereum.Ens.PublicResolver: content :: (JsonRpc m_aYjN, Account a_aYjL t_aYjM, Functor (t_aYjM m_aYjN)) => BytesN 32 -> t_aYjM m_aYjN (BytesN 32)
+ Network.Ethereum.Ens.PublicResolver: content :: forall (m :: Type -> Type) a t. (JsonRpc m, Account a t, Functor (t m)) => BytesN 32 -> t m (BytesN 32)
- Network.Ethereum.Ens.PublicResolver: name :: (JsonRpc m_aYjR, Account a_aYjP t_aYjQ, Functor (t_aYjQ m_aYjR)) => BytesN 32 -> t_aYjQ m_aYjR Text
+ Network.Ethereum.Ens.PublicResolver: name :: forall (m :: Type -> Type) a t. (JsonRpc m, Account a t, Functor (t m)) => BytesN 32 -> t m Text
- Network.Ethereum.Ens.PublicResolver: pubkey :: (JsonRpc m_aYjV, Account a_aYjT t_aYjU, Functor (t_aYjU m_aYjV)) => BytesN 32 -> t_aYjU m_aYjV (BytesN 32, BytesN 32)
+ Network.Ethereum.Ens.PublicResolver: pubkey :: forall (m :: Type -> Type) a t. (JsonRpc m, Account a t, Functor (t m)) => BytesN 32 -> t m (BytesN 32, BytesN 32)
- Network.Ethereum.Ens.PublicResolver: setABI :: (JsonRpc m_aYk1, Account a_aYjZ t_aYk0, Functor (t_aYk0 m_aYk1)) => BytesN 32 -> UIntN 256 -> Bytes -> t_aYk0 m_aYk1 (Either HexString TxReceipt)
+ Network.Ethereum.Ens.PublicResolver: setABI :: forall (m :: Type -> Type) a t. (JsonRpc m, Account a t, Functor (t m)) => BytesN 32 -> UIntN 256 -> Bytes -> t m (Either HexString TxReceipt)
- Network.Ethereum.Ens.PublicResolver: setAddr :: (JsonRpc m_aYk6, Account a_aYk4 t_aYk5, Functor (t_aYk5 m_aYk6)) => BytesN 32 -> Address -> t_aYk5 m_aYk6 (Either HexString TxReceipt)
+ Network.Ethereum.Ens.PublicResolver: setAddr :: forall (m :: Type -> Type) a t. (JsonRpc m, Account a t, Functor (t m)) => BytesN 32 -> Address -> t m (Either HexString TxReceipt)
- Network.Ethereum.Ens.PublicResolver: setContent :: (JsonRpc m_aYkb, Account a_aYk9 t_aYka, Functor (t_aYka m_aYkb)) => BytesN 32 -> BytesN 32 -> t_aYka m_aYkb (Either HexString TxReceipt)
+ Network.Ethereum.Ens.PublicResolver: setContent :: forall (m :: Type -> Type) a t. (JsonRpc m, Account a t, Functor (t m)) => BytesN 32 -> BytesN 32 -> t m (Either HexString TxReceipt)
- Network.Ethereum.Ens.PublicResolver: setName :: (JsonRpc m_aYkg, Account a_aYke t_aYkf, Functor (t_aYkf m_aYkg)) => BytesN 32 -> Text -> t_aYkf m_aYkg (Either HexString TxReceipt)
+ Network.Ethereum.Ens.PublicResolver: setName :: forall (m :: Type -> Type) a t. (JsonRpc m, Account a t, Functor (t m)) => BytesN 32 -> Text -> t m (Either HexString TxReceipt)
- Network.Ethereum.Ens.PublicResolver: setPubkey :: (JsonRpc m_aYkm, Account a_aYkk t_aYkl, Functor (t_aYkl m_aYkm)) => BytesN 32 -> BytesN 32 -> BytesN 32 -> t_aYkl m_aYkm (Either HexString TxReceipt)
+ Network.Ethereum.Ens.PublicResolver: setPubkey :: forall (m :: Type -> Type) a t. (JsonRpc m, Account a t, Functor (t m)) => BytesN 32 -> BytesN 32 -> BytesN 32 -> t m (Either HexString TxReceipt)
- Network.Ethereum.Ens.PublicResolver: supportsInterface :: (JsonRpc m_aYkq, Account a_aYko t_aYkp, Functor (t_aYkp m_aYkq)) => BytesN 4 -> t_aYkp m_aYkq Bool
+ Network.Ethereum.Ens.PublicResolver: supportsInterface :: forall (m :: Type -> Type) a t. (JsonRpc m, Account a t, Functor (t m)) => BytesN 4 -> t m Bool
- Network.Ethereum.Ens.Registry: owner :: (JsonRpc m_aVlL, Account a_aVlJ t_aVlK, Functor (t_aVlK m_aVlL)) => BytesN 32 -> t_aVlK m_aVlL Address
+ Network.Ethereum.Ens.Registry: owner :: forall (m :: Type -> Type) a t. (JsonRpc m, Account a t, Functor (t m)) => BytesN 32 -> t m Address
- Network.Ethereum.Ens.Registry: resolver :: (JsonRpc m_aVlP, Account a_aVlN t_aVlO, Functor (t_aVlO m_aVlP)) => BytesN 32 -> t_aVlO m_aVlP Address
+ Network.Ethereum.Ens.Registry: resolver :: forall (m :: Type -> Type) a t. (JsonRpc m, Account a t, Functor (t m)) => BytesN 32 -> t m Address
- Network.Ethereum.Ens.Registry: setOwner :: (JsonRpc m_aVlU, Account a_aVlS t_aVlT, Functor (t_aVlT m_aVlU)) => BytesN 32 -> Address -> t_aVlT m_aVlU (Either HexString TxReceipt)
+ Network.Ethereum.Ens.Registry: setOwner :: forall (m :: Type -> Type) a t. (JsonRpc m, Account a t, Functor (t m)) => BytesN 32 -> Address -> t m (Either HexString TxReceipt)
- Network.Ethereum.Ens.Registry: setResolver :: (JsonRpc m_aVlZ, Account a_aVlX t_aVlY, Functor (t_aVlY m_aVlZ)) => BytesN 32 -> Address -> t_aVlY m_aVlZ (Either HexString TxReceipt)
+ Network.Ethereum.Ens.Registry: setResolver :: forall (m :: Type -> Type) a t. (JsonRpc m, Account a t, Functor (t m)) => BytesN 32 -> Address -> t m (Either HexString TxReceipt)
- Network.Ethereum.Ens.Registry: setSubnodeOwner :: (JsonRpc m_aVm5, Account a_aVm3 t_aVm4, Functor (t_aVm4 m_aVm5)) => BytesN 32 -> BytesN 32 -> Address -> t_aVm4 m_aVm5 (Either HexString TxReceipt)
+ Network.Ethereum.Ens.Registry: setSubnodeOwner :: forall (m :: Type -> Type) a t. (JsonRpc m, Account a t, Functor (t m)) => BytesN 32 -> BytesN 32 -> Address -> t m (Either HexString TxReceipt)
- Network.Ethereum.Ens.Registry: setTTL :: (JsonRpc m_aVma, Account a_aVm8 t_aVm9, Functor (t_aVm9 m_aVma)) => BytesN 32 -> UIntN 64 -> t_aVm9 m_aVma (Either HexString TxReceipt)
+ Network.Ethereum.Ens.Registry: setTTL :: forall (m :: Type -> Type) a t. (JsonRpc m, Account a t, Functor (t m)) => BytesN 32 -> UIntN 64 -> t m (Either HexString TxReceipt)
- Network.Ethereum.Ens.Registry: ttl :: (JsonRpc m_aVme, Account a_aVmc t_aVmd, Functor (t_aVmd m_aVme)) => BytesN 32 -> t_aVmd m_aVme (UIntN 64)
+ Network.Ethereum.Ens.Registry: ttl :: forall (m :: Type -> Type) a t. (JsonRpc m, Account a t, Functor (t m)) => BytesN 32 -> t m (UIntN 64)
Files
- LICENSE +1/−1
- src/Network/Ethereum/Account/Internal.hs +1/−6
- src/Network/Ethereum/Account/Safe.hs +6/−12
- src/Network/Ethereum/Api/Eth.hs +23/−5
- src/Network/Ethereum/Api/Types.hs +78/−8
- web3-ethereum.cabal +46/−46
LICENSE view
@@ -186,7 +186,7 @@ same "printed page" as the copyright notice for easier identification within third-party archives. -Copyright 2016-2021 Aleksandr Krupenkin +Copyright 2016-2026 Aleksandr Krupenkin Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License.
src/Network/Ethereum/Account/Internal.hs view
@@ -33,7 +33,7 @@ import qualified Network.Ethereum.Api.Eth as Eth (getTransactionReceipt) import Network.Ethereum.Api.Types (Call (..), DefaultBlock (Latest),- TxReceipt (receiptTransactionHash))+ TxReceipt) import Network.Ethereum.Unit (Unit (..)) import Network.JsonRpc.TinyClient (JsonRpc) @@ -139,8 +139,3 @@ getReceipt' :: JsonRpc m => HexString -> m TxReceipt getReceipt' = fmap (fromRight undefined) . getReceipt Nothing--updateReceipt :: JsonRpc m => TxReceipt -> m TxReceipt-{-# INLINE updateReceipt #-}--- No timeout, because we update the receipt of an already processed transaction.-updateReceipt = getReceipt' . receiptTransactionHash
src/Network/Ethereum/Account/Safe.hs view
@@ -20,7 +20,6 @@ import Data.ByteArray.HexString (HexString) import Network.Ethereum.Account.Class (Account (send))-import Network.Ethereum.Account.Internal (updateReceipt) import qualified Network.Ethereum.Api.Eth as Eth import Network.Ethereum.Api.Types (TxReceipt (receiptBlockNumber)) import Network.Ethereum.Contract.Method (Method)@@ -42,17 +41,12 @@ Left tx -> return $ Left tx Right receipt -> Right <$> f receipt - waiting receipt =- case receiptBlockNumber receipt of- Nothing -> do- liftIO $ threadDelay 1000000- waiting =<< updateReceipt receipt- Just bn -> do- current <- Eth.blockNumber- if current - bn >= fromInteger b- then return receipt- else do liftIO $ threadDelay 1000000- waiting receipt+ waiting receipt = do+ current <- Eth.blockNumber+ if current - receiptBlockNumber receipt >= fromInteger b+ then return receipt+ else do liftIO $ threadDelay 1000000+ waiting receipt -- | Count block confirmation to keep secure -- According to Vitalik post
src/Network/Ethereum/Api/Eth.hs view
@@ -18,11 +18,20 @@ import Data.ByteArray.HexString (HexString) import Data.Solidity.Prim.Address (Address) import Data.Text (Text)-import Network.Ethereum.Api.Types (Block, BlockT, Call, Change,- DefaultBlock, Filter, Quantity,- SyncingState, Transaction,- TxReceipt)-import Network.JsonRpc.TinyClient (JsonRpc (..))+import Network.Ethereum.Api.Types+ ( Block+ , BlockT+ , Call+ , Change+ , DefaultBlock+ , FeeHistory+ , Filter+ , Quantity+ , SyncingState+ , Transaction+ , TxReceipt+ )+import Network.JsonRpc.TinyClient (JsonRpc(..)) -- | Returns the current ethereum protocol version. protocolVersion :: JsonRpc m => m Text@@ -146,6 +155,10 @@ {-# INLINE estimateGas #-} estimateGas = remote "eth_estimateGas" +-- | Returns transaction base fee per gas and effective priority fee per gas for the requested/supported block range.+feeHistory :: (JsonRpc m) => Quantity -> DefaultBlock -> [Double] -> m FeeHistory+feeHistory = remote "eth_feeHistory"+ -- | Returns information about a block by hash with only hashes of the transactions in it. getBlockByHashLite :: JsonRpc m => HexString -> m (Maybe (BlockT HexString)) {-# INLINE getBlockByHashLite #-}@@ -257,3 +270,8 @@ submitHashrate :: JsonRpc m => HexString -> HexString -> m Bool {-# INLINE submitHashrate #-} submitHashrate = remote "eth_submitHashrate"++-- | Returns the chain ID of the current network.+chainId :: JsonRpc m => m Quantity+{-# INLINE chainId #-}+chainId = remote "eth_chainId"
src/Network/Ethereum/Api/Types.hs view
@@ -32,6 +32,7 @@ import qualified Data.Text.Lazy.Builder as B (toLazyText) import qualified Data.Text.Lazy.Builder.Int as B (hexadecimal) import qualified Data.Text.Read as R (decimal, hexadecimal)+import Data.Word (Word8) import GHC.Generics (Generic) import Lens.Micro (_head, over) @@ -74,6 +75,43 @@ _ -> fail $ "Quantity " ++ show v <> " is not valid hex" parseJSON _ = fail "Quantity should be a JSON String" +-- | Type representing a Byte in Web3 JSON RPC docs ("#/components/schemas/byte")+--+-- The encoding is similar to Quantity, encoding as hex string.+newtype Byte = Byte { unByte :: Word8 }+ deriving (Num, Real, Integral, Enum, Eq, Ord, Generic)++instance Show Byte where+ show = show . unByte++instance IsString Byte where+ fromString ('0' : 'x' : hex) =+ case R.hexadecimal (T.pack hex) of+ Right (x, "")+ | toInteger (minBound :: Word8) <= x && x <= toInteger (maxBound :: Word8) -> Byte (fromInteger x)+ | otherwise -> error ("Byte " ++ show hex ++ "is not within bounds")+ _ -> error ("Byte " ++ show hex ++ " is not valid hex")++ fromString num =+ case R.decimal (T.pack num) of+ Right (x, "")+ | toInteger (minBound :: Word8) <= x && x <= toInteger (maxBound :: Word8) -> Byte (fromInteger x)+ | otherwise -> error ("Byte " ++ show num ++ "is not within bounds")+ _ -> error ("Byte " ++ show num ++ " is not valid decimal")++instance ToJSON Byte where+ toJSON (Byte x) =+ let hexValue = B.toLazyText (B.hexadecimal x)+ in toJSON ("0x" <> hexValue)++instance FromJSON Byte where+ parseJSON (String v) =+ case R.hexadecimal v of+ Right (x, "") -> return (Byte x)+ _ -> fail $ "Byte " ++ show v <> " is not valid hex"+ parseJSON _ = fail "Byte should be a JSON String"++ -- | An object with sync status data. data SyncActive = SyncActive { syncStartingBlock :: !Quantity@@ -194,26 +232,40 @@ -- | The Receipt of a Transaction data TxReceipt = TxReceipt- { receiptTransactionHash :: !HexString+ { receiptType :: !(Maybe Byte)+ -- ^ BYTE - type of the transaction 0x00 for legacy transactions, 0x01 EIP-2930, 0x02 EIP-1559+ , receiptTransactionHash :: !HexString -- ^ DATA, 32 Bytes - hash of the transaction. , receiptTransactionIndex :: !Quantity -- ^ QUANTITY - index of the transaction.- , receiptBlockHash :: !(Maybe HexString)- -- ^ DATA, 32 Bytes - hash of the block where this transaction was in. null when its pending.- , receiptBlockNumber :: !(Maybe Quantity)- -- ^ QUANTITY - block number where this transaction was in. null when its pending.+ , receiptBlockHash :: !HexString+ -- ^ DATA, 32 Bytes - hash of the block where this transaction was in. + , receiptBlockNumber :: !Quantity+ -- ^ QUANTITY - block number where this transaction was in.+ , receiptFrom :: !Address+ -- ^ DATA, 20 Bytes - the address of the sender+ , receiptTo :: !(Maybe Address)+ -- ^ DATA, 20 Bytes - The address of the receiver. null when the transaction is a contract creation transaction. , receiptCumulativeGasUsed :: !Quantity -- ^ QUANTITY - The total amount of gas used when this transaction was executed in the block. , receiptGasUsed :: !Quantity -- ^ QUANTITY - The amount of gas used by this specific transaction alone.+ , receiptBlobGasUsed :: !(Maybe Quantity)+ -- ^ QUANTITY - The amount of blob gas used for this specific transaction. Only specified for blob transactions as defined by EIP-4844. , receiptContractAddress :: !(Maybe Address) -- ^ DATA, 20 Bytes - The contract address created, if the transaction was a contract creation, otherwise null. , receiptLogs :: ![Change] -- ^ Array - Array of log objects, which this transaction generated. , receiptLogsBloom :: !HexString -- ^ DATA, 256 Bytes - Bloom filter for light clients to quickly retrieve related logs.+ , receiptRoot :: !(Maybe HexString)+ -- ^ DATA, 32 Bytes - The post-transaction state root. Only specified for transactions included before the Byzantium upgrade. , receiptStatus :: !(Maybe Quantity) -- ^ QUANTITY either 1 (success) or 0 (failure)+ , receiptEffectiveGasPrice :: !Quantity+ -- ^ QUANTITY - The actual value per gas deducted from the sender's account. Before EIP-1559, this is equal to the transaction's gas price. After, it is equal to baseFeePerGas + min(maxFeePerGas - baseFeePerGas, maxPriorityFeePerGas).+ , blobGasPrice :: !(Maybe Quantity)+ -- ^ QUANTITY - The actual value per gas deducted from the sender's account for blob gas. Only specified for blob transactions as defined by EIP-4844. } deriving (Show, Generic) @@ -277,10 +329,8 @@ -- ^ DATA, 32 Bytes - the root of the receipts trie of the block. , blockMiner :: !Address -- ^ DATA, 20 Bytes - the address of the beneficiary to whom the mining rewards were given.- , blockDifficulty :: !Quantity+ , blockDifficulty :: !(Maybe Quantity) -- ^ QUANTITY - integer of the difficulty for this block.- , blockTotalDifficulty :: !Quantity- -- ^ QUANTITY - integer of the total difficulty of the chain until this block. , blockExtraData :: !HexString -- ^ DATA - the "extra data" field of this block. , blockSize :: !Quantity@@ -300,3 +350,23 @@ $(deriveJSON (defaultOptions { fieldLabelModifier = over _head toLower . drop 5 }) ''BlockT)++-- | Fee History information+data FeeHistory+ = FeeHistory+ { feeHistoryBaseFeePerBlobGas :: [Quantity]+ -- ^ array of block base fees per blob gas.+ , feeHistoryBaseFeePerGas :: [Quantity]+ -- ^ Array of block base fees per gas.+ , feeHistoryBlobGasUsedRatio :: [Rational]+ -- ^ Array of block base fees per blob gas.+ , feeHistoryGasUsedRatio :: [Rational]+ -- ^ Array of block gas used ratios.+ , feeHistoryOldestBlock :: Quantity+ -- ^ QUANTITY - lowest number block of returned range.+ , feeHistoryReward :: [[Quantity]]+ -- ^ Two-dimensional array of effective priority fees per gas at the requested block percentiles.+ }+ deriving (Generic, Show)++$(deriveJSON defaultOptions{fieldLabelModifier = over _head toLower . drop 10} ''FeeHistory)
web3-ethereum.cabal view
@@ -1,9 +1,9 @@ cabal-version: 1.12 name: web3-ethereum-version: 1.0.1.0+version: 1.1.0.0 license: Apache-2.0 license-file: LICENSE-copyright: (c) Aleksandr Krupenkin 2016-2024+copyright: (c) Aleksandr Krupenkin 2016-2026 maintainer: mail@akru.me author: Aleksandr Krupenkin homepage: https://github.com/airalab/hs-web3#readme@@ -60,29 +60,29 @@ -Wunused-foralls -Wtabs build-depends:- OneTuple >0.2 && <0.5,- aeson >1.2 && <2.2,+ OneTuple >=0.2 && <0.5,+ aeson >=1.2 && <2.3, aeson-casing >=0.2 && <0.3,- base >4.11 && <4.19,- bytestring >0.10 && <0.12,- data-default >0.7 && <0.8,- exceptions >0.8 && <0.11,- generics-sop >0.3 && <0.6,- jsonrpc-tinyclient >=1.0 && <1.1,- machines >0.6 && <0.8,- memory >0.14 && <0.19,- memory-hexstring >=1.0 && <1.1,- microlens >0.4 && <0.5,- microlens-aeson >2.2 && <2.6,- mtl >2.2 && <2.4,- relapse >=1.0 && <2.0,- tagged >0.8 && <0.9,- template-haskell >2.11 && <2.21,- text >1.2 && <2.1,- transformers >0.5 && <0.7,- vinyl >0.5 && <0.15,- web3-crypto >=1.0 && <1.1,- web3-solidity >=1.0 && <1.1+ base >=4.11 && <4.21,+ bytestring >=0.10 && <0.13,+ data-default >=0.7 && <0.9,+ exceptions >=0.8 && <0.11,+ generics-sop >=0.3 && <0.6,+ jsonrpc-tinyclient >=1.0 && <1.2,+ machines >=0.6 && <0.8,+ memory >=0.14 && <0.19,+ memory-hexstring >=1.0 && <1.2,+ microlens >=0.4 && <0.5,+ microlens-aeson >=2.2 && <2.6,+ mtl >=2.2 && <2.4,+ relapse >=1.0 && <1.1,+ tagged >=0.8 && <0.9,+ template-haskell >=2.11 && <2.23,+ text >=1.2 && <2.2,+ transformers >=0.5 && <0.7,+ vinyl >=0.5 && <0.15,+ web3-crypto >=1.0 && <1.2,+ web3-solidity >=1.0 && <1.2 test-suite tests type: exitcode-stdio-1.0@@ -133,30 +133,30 @@ -Wunused-foralls -Wtabs -threaded -rtsopts -with-rtsopts=-N build-depends:- OneTuple >0.2 && <0.5,- aeson >1.2 && <2.2,+ OneTuple >=0.2 && <0.5,+ aeson >=1.2 && <2.3, aeson-casing >=0.2 && <0.3,- base >4.11 && <4.19,- bytestring >0.10 && <0.12,- data-default >0.7 && <0.8,- exceptions >0.8 && <0.11,- generics-sop >0.3 && <0.6,+ base >=4.11 && <4.21,+ bytestring >=0.10 && <0.13,+ data-default >=0.7 && <0.9,+ exceptions >=0.8 && <0.11,+ generics-sop >=0.3 && <0.6, hspec >=2.4.4 && <2.12, hspec-contrib >=0.4.0 && <0.6, hspec-discover >=2.4.4 && <2.12, hspec-expectations >=0.8.2 && <0.9,- jsonrpc-tinyclient >=1.0 && <1.1,- machines >0.6 && <0.8,- memory >0.14 && <0.19,- memory-hexstring >=1.0 && <1.1,- microlens >0.4 && <0.5,- microlens-aeson >2.2 && <2.6,- mtl >2.2 && <2.4,- relapse >=1.0 && <2.0,- tagged >0.8 && <0.9,- template-haskell >2.11 && <2.21,- text >1.2 && <2.1,- transformers >0.5 && <0.7,- vinyl >0.5 && <0.15,- web3-crypto >=1.0 && <1.1,- web3-solidity >=1.0 && <1.1+ jsonrpc-tinyclient >=1.0 && <1.2,+ machines >=0.6 && <0.8,+ memory >=0.14 && <0.19,+ memory-hexstring >=1.0 && <1.2,+ microlens >=0.4 && <0.5,+ microlens-aeson >=2.2 && <2.6,+ mtl >=2.2 && <2.4,+ relapse >=1.0 && <1.1,+ tagged >=0.8 && <0.9,+ template-haskell >=2.11 && <2.23,+ text >=1.2 && <2.2,+ transformers >=0.5 && <0.7,+ vinyl >=0.5 && <0.15,+ web3-crypto >=1.0 && <1.2,+ web3-solidity >=1.0 && <1.2