You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository has been archived by the owner on Oct 19, 2024. It is now read-only.
Is your feature request related to a problem? Please describe.
So far, we're adding plugins to the Client / Provider by adding optional variables (e.g. Signer, ENS, Gas Oracle, Nonce Manager). Instead, we could have a trait Client which would require implementing all JSON-RPC methods. Then, each time you want to write a plug-in, you would implement the method you need (e.g. for ENS methods, you'd resolve to/from from names to addresses) and then you'd pass the data to the same function in the next level (e.g. self.inner.send_transaction). This seems straightforward to do with 2 exceptions
It is cumbersome to have to re-implement every trait method when creating wrapper structs. It'd be nice if we can have some smart way (e.g. a macro) which does trait delegation. Unfortuntely, due to using
Error handling: We cannot have a variant in a thiserror like InnerError(#[from] I::Error) because it potentially allows for a recursive type.
Describe the solution you'd like
A middleware-based architecture for sending RPC requests which allows creating new middleware wrappers "easily", ideally w/o having to write a lot of boilerplate which does delegation to each inner layer manually.
Is your feature request related to a problem? Please describe.
So far, we're adding plugins to the
Client
/Provider
by adding optional variables (e.g. Signer, ENS, Gas Oracle, Nonce Manager). Instead, we could have atrait Client
which would require implementing all JSON-RPC methods. Then, each time you want to write a plug-in, you would implement the method you need (e.g. for ENS methods, you'd resolveto
/from
from names to addresses) and then you'd pass the data to the same function in the next level (e.g.self.inner.send_transaction
). This seems straightforward to do with 2 exceptionsInnerError(#[from] I::Error)
because it potentially allows for a recursive type.Describe the solution you'd like
A middleware-based architecture for sending RPC requests which allows creating new middleware wrappers "easily", ideally w/o having to write a lot of boilerplate which does delegation to each inner layer manually.
Then, we'd be able to do:
...and so on
Describe alternatives you've considered
So far, I've tried implementing this here: #65.
The text was updated successfully, but these errors were encountered: