* feat(providers): return a PendingTransaction from send_tx calls
* feat(providers): expose the internal provider to all middlewares
* fix(middleware): use the returned PendingTx instead of using a hash
* fix(contract): use the pending tx returned value
Note1: To support that, we need to clone the tx when sending in order to make lifetimes work out
Note2: Multicall does not support that feature
* fix(ethers): adjust examples
* chore: fix provider test
* chore: fix celo test
BREAKING CHANGE
* fix(block): fix block decoding from ws
* feat(pubsub): add pubsub traits and sub stream
Also use DeserializeOwned alias
* feat(transports): add notification type
* feat(ws): rewrite Ws for subscription support
* feat(provider): add eth_subscribe
* fix(celo): disable some celo tests due to ganache incompatibilities
* test(rinkeby): fix flaky test
* feat(contract): WS subscription bindings (#101)
* feat(middleware): add subscriptions to middleware methods
* feat(contract): add subscribe method to contracts
* feat: allow encoding/decoding function data
* feat: allow decoding event data
* feat: human readable abi
inspired from https://blog.ricmoo.com/human-readable-contract-abis-in-ethers-js-141902f4d917
* test: add event / fn decoding tests
* chore: fix clippy
* feat(abigen): allow providing args in human readable format
* refactor: extract minimal features of Contract into BaseContract
* refactor: move BaseContract to own file
* chore: ensure celo test passes
* chore: fix clippy
Co-authored-by: Georgios Konstantopoulos <me@gakonst.com>
* feat: support for txpool API
* feat: add a geth spawner test helper
* fix(txpool): use TxRequest instead of new data struct
The `raw` field is no longer present in latest geth's response.
* fix(txpool): use proper api response format
ref: https://github.com/ethereum/go-ethereum/pull/21720
Also add a Geth test
* ci: install geth 1.9.23
Co-authored-by: Rohit Narurkar <rohit.narurkar@protonmail.com>
* fix(signers): make Signer send by blocking on Ledger calls
* fix(providers): use Arc in WS impl to allow cloning
* feat(middleware): add geometric gas price escalator
* test(middleware): ensure that we can still stack everything up
* fix(middleware): default to tokio/async-std
* chore: fix clippy
* docs(middleware): add docs and rename middlewares
* chore: fix doctests
* feat: add linear gas escalator
https://github.com/makerdao/pymaker/blob/master/tests/test_gas.py\#L107https://github.com/makerdao/pymaker/blob/master/pymaker/gas.py\#L129
* feat: add constructors to gas escalators
* feat: convert signing to k256
* fix: pass pre-hashed message to sig verification
* feat: wrap the hash to a Digest implementation
* refactor: cleanup and move digest impl to separate file
* chore: adjust abigen tests due to rust update
* test: add byte equality test between ethers-rs / web3.js signatures
* fix(keys): use 512 blocks for sha256
Co-authored-by: Rohit Narurkar <rohit.narurkar@protonmail.com>
Co-authored-by: Alex Vlasov <alex.m.vlasov@gmail.com>
* feat: ledger support
Adds support for Ledger Nano S Eth app (v1.3.7)
- sign message
- sign transaction
- get addresses
- get app version
* fix: fix eth docstring
* fix: take into account EIP155
* feat: convert Signer to async
* feat: implement Signer for Ledger
* ci: run celo-only tests explicitly
This is done to avoid using --all-features
* fix: remove async from with_signer
* chore: fix doctests
* fix: add Send/Sync to SignerError
* ci: update etherscan key
* test: disable etherscan abigen tests temporarily
* fix(BREAKING): return Option for txs/receipts/blocks
Otherwise if a user asks for a transaction hash or block that does not exist yet they'll get an Error
* test: ensure that unmined txs return None receipts
* test: fix remaining tests
* chore: re-enable sparkpool gas oracle
* chore: fix celo tests
* fix: run the non-existing data against infura
* fix: fix etherscan gas oracle tests
* feat: first stab at a NonceManager
* test: adjust the test
* fix: reset nonce if nonce manager errors
* feat: make nonce manager opt in
* fix: add read-only nonce call
* feat: improve http provider errors
* feat: convert to Atomic datatypes
* refactor: move to own file
* chore: remove tokio dep
* fix: improve nonce retry logic readability
* fix: use other privkey to avoid nonce races with other tests
* (feat) gas oracle support
* (refactor) make a separate module | fix clippy warning
* add gas oracle to client using dynamic dispatch
* fix doc build in multicall module
* gas oracle returns U256
* support gas price fetching from client
* avoid querying for unsupported gas categories
* changes based on PR review
* add support for gasnow API, refactor gwei to wei
* Implement Multicall functionality for batched calls
* Documentation, some modifications as suggested in the review
* (Abigen) handle single input arg and set output irrespective of mutability
* implement send functionality and allow clearing calls
* Fix detokenization, dont require pre-processing anymore
* panic when more than supported number of calls are pushed
* add doc for panics in case of add_call
* (multicall) eth_balance support, update bindings
* refactor: move multicall to its own directory
* fix: add infura api key
* ci: ensure CI runs on PRs from forks
* test(multicall): re-use aggregate call
* contract: make multicall docs compile and remove redundant clones
* ci: add public etherscan API key so that forks don't get rate limited
* chore: adjust test contract naming
Co-authored-by: Georgios Konstantopoulos <me@gakonst.com>
* test(tokens): ensure nested tuples tokenize properly
* test(contract): add failing test with 2 args
This happens because the args are serialized as Token::Tuple, while instead they should be just a vector
* fix(tokens): add token flattening method to fix non-nested tuples
* fix: do not export the flatten function
* feat(provider): allow specifying a default polling interval param
This parameter is going to be used for all subsequent client calls by default. It can still be overriden with the internal
`interval` calls
* feat(contract): replace reference to Client with Arc
* feat(abigen): adjusts codegen to use Arcs
* fix(ethers): adjust examples to new apis
* fix(provider): return TxHash instead of PendingTransaction on tx submission
Returning a PendingTransaction allowed us to have nice ethers.js-like syntax where you submit
a transaction and then can immediately await it. Unfortunately, now that we use Arcs and not lifetimes
this meant that we would need to bind the function call in a variable, and then await on it, which is pretty
bad UX.
To fix this, we revert back to returning a TxHash and introduce a convenience method on the provider and the
contract which takes a tx_hash and returns a PendingTransaction object. The syntax ends up being slightly
more verbose (although more explicit), but the issue is fixed.
* fix: relax trait bounds on JsonRpcClient
* refactor(provider): move http client to separate dir
* feat(provider): add initial Websocket support over Stream/Sink + Tungstenite
* test(provider): add websocket test
* feat(provider): add convenience method using tokio/async-std behind a feature flag
* test(provider): add websocket ssl test
* feat(provider): add TLS websockets for tokio/async-std
* docs(provider): add websocket docs / examples
* fix(provider): make tokio an optional dep