web3 v0.8.0.0 Release Notes
Release Date: 2018-10-26 // over 5 years ago-
๐ This release introduce changes in account system of library. Accounts is a big deal for any crypto(currency) library. Previously
hs-web3
support node managed accounts only. Currently library support three types of accounts:- 0๏ธโฃ Default account (node managed, typically first of accounts list, should be unlocked)
- Personal account (node managed accounts available via JSON-RPC
personal_*
API) - Local account (derived from secp256k1 private key and use JSON-RPC
sendRawTransaction
call)
Transaction sending code have a lot of changes too. Introduced
Account
typeclass inNetwork.Ethereum.Account
module that looks like:class MonadTrans t =\> Account a t | t -\> a where-- | Run computation with given account credentialswithAccount :: JsonRpc m =\> a -\> t m b -\> m b-- | Send transaction to contract, like a 'write' commandsend :: (JsonRpc m, Method args) =\> args -\> t m TxReceipt-- | Call constant method of contract, like a 'read' commandcall :: (JsonRpc m, Method args, AbiGet result) =\> args -\> t m result
This is mean that sending transaction from multiple accounts simultaneously using
withAccount
function is not a problem now.... = do withAccount () $ ... withAccount (Personal "0x..." "password") $ ...
Transaction parametrisation was too hard previously and forced to carry a lot of vars. Currently
withParam
function exported in account module use state monad for transaction parametrisation. It make code looks good and more powerful.withAccount () $-- Set transaction value withParam (value .~ halfBalance) $ do-- Send transaction to alice account withParam (to .~ alice) $ send ()-- Send transaction to bob account withParam (to .~ bob) $ send ()
๐ Finally in this release contract creation is supported via using truffle generated smart contract artifacts. Example available in tests.
โ Added
- ๐ Support for Ethereum cryptography
- Local private key transaction signer
- Generalized JSON-RPC monad for API methods
- ๐ Support for multiple transaction sending methods via one
Account
api - Monad based transaction sending parametrization
- 0๏ธโฃ Experimental support for solidity compiler (disabled by default)
- ๐ Support for Ethereum mainnet ENS resolver
- Contract typeclass with api/bytecode getters
- Contract typeclass TH generator
- Function for creating contracts
- Event single/multi filters
- HexString data type
- Personal api calls
- โ Address checksum
๐ Changed
- ๐ฆ package.yaml instead web3.cabal package descriptor
- ๐ Solidity related data types and codecs moved to Data.Solidity
- ๐ Solidity related parsers and compiler moved to Language.Solidity
- ๐ Modules in Network.Ethereum.Web3 moved to Network.Ethereum.Api
- fromWei/toWei from
Unit
typeclass now operates overIntegral
โ Removed
convert
function fromUnit
typeclass