Commit Graph

13 Commits

Author SHA1 Message Date
Georgios Konstantopoulos 5f292670fc
docs: add more docs (#130) 2020-12-31 21:08:12 +02:00
Georgios Konstantopoulos 3a2fd3e814
Returning a `PendingTransaction` after sending a tx (#107)
* 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
2020-12-17 13:26:01 +02:00
Georgios Konstantopoulos eb26915081
feat: allow encoding/decoding function data (#90)
* 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
2020-10-29 09:48:24 +02:00
Georgios Konstantopoulos 2d51c523ba
feature: Middleware Architecture (#65)
* feat: convert Provider to Middleware trait

* feat: move gas oracle to middleware crate

* feat: move signer to middleware crate

* feat: add nonce manager middleware and test stacking

* refactor: convert generic middleware jsonrpc type to associated type

* feat: move ethers-contract to middleware arch

* test(provider): make tests pass

* test(middleware): move middleware tests from signer

* test: fix ethers examples

* fix(contract): make tests compile

* chore: fix clippy

* feat: deduplicate trait delegation

* refactor(signer): deduplicate tx signing logic across signers

* fix doctests

* fix: examples, celo tests and ci
2020-09-25 00:33:09 +03:00
Rohit Narurkar 516b431a48
add support for gas estimate and calldata from ContractCall (#53)
* add support for gas estimate and calldata from ContractCall

* fix celo tests for get_block and get_tx
2020-08-12 11:35:33 +03:00
Georgios Konstantopoulos 41998d6d2d
fix(tokens): make token decoding abiencoderv2 friendly 2020-07-03 18:51:19 +03:00
Georgios Konstantopoulos 1cfbc7b3c3
Replace contract client references with Arc (#35)
* 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.
2020-06-22 11:44:08 +03:00
Georgios Konstantopoulos 1a47e933ae
feat(signers): implement Serde and make Wallet API smaller (#20)
* feat(signers): implement Serde and make API smaller

* fix: add abigen as a dev-dependency feature
2020-06-17 09:38:04 +03:00
Georgios Konstantopoulos 79b21b9ea0
add pending tx type to wait for tx confirmations (#11)
* feat: add pending tx type

* feat(pending-txs): implement the full state machine

* tests(ethers): fix transfer eth example

* feat: use the pending transaction struct when deploying a contract

* ci: skip the pending tx test

* chore: fix doctests
2020-06-15 15:40:06 +03:00
Georgios Konstantopoulos 030fc671fe
docs(contract): expand contract docs 2020-06-10 21:20:47 +03:00
Georgios Konstantopoulos e051cffe47
contract: allow connecting to many clients/addresses 2020-06-02 13:36:29 +03:00
Georgios Konstantopoulos 6bd3c41bd0
contract: simplify errors and generics 2020-06-02 02:15:33 +03:00
Georgios Konstantopoulos cd4914d37f
refactor: pull crates to root dir 2020-06-01 21:24:22 +03:00