-
Notifications
You must be signed in to change notification settings - Fork 96
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Extend JSON-RPC transport capabilities for batch requests #593
Comments
Current approachThe @tcoratger idea is a correct approach, however we believe it could be simplified a bit more. Unless there is a specific reason/use case for introducing a new type like Implementation detailsFor now the function Improvement proposalAn improvement to this implementation is up for discussion and a separate issue. In essense, if we want to make a batch request of different RPC methods we need to implement enum of The general idea would be the following: SummaryIf the presented approach in the first 2 paragraphs is compatible with the lib, we already have the code working and we would like to share it in a new PR to be verified by the @xJonathanLEI |
Extend JSON-RPC Transport Capabilities for Batch Requests
Context
Currently, the
JsonRpcRequest
structure inhttps://github.com/xJonathanLEI/starknet-rs/blob/master/starknet-providers/src/jsonrpc/transports/http.rs
allows for making JSON-RPC requests with a specified method. To support the needs of various RPC services, it would be beneficial to extend the transport capabilities to handle batch requests. This can likely be achieved by improving the
JsonRpcTransport
trait.Proposed Changes
Enhance
JsonRpcTransport
Trait:JsonRpcTransport
trait to include a newsend_requests
method that facilitates sending requests in batch.Introduce
JsonRpcRequests
Type:JsonRpcRequests
, which is essentially a vector ofJsonRpcRequest
.The previous two points are suggestions only. Feel free to propose any other way to achieve the same goal in a better way.
Additional Resources
For more details on batch requests, refer to the associated documentation.
The text was updated successfully, but these errors were encountered: