Closed xJonathanLEI closed 2 months ago
Note: technically we can also implement a method that accepts only up to 32 requests but is truly type-safe by leveraging generic params. Something similar to:
let (block_number, count) =
provider.batch_requests(BlockNumberRequest, GetBlockTransactionCountRequest {...}).await.unwrap();
which would be much nicer for use cases where the request types are statically known at compile time.
Let's settle for this for now though.
Resolves #593. Supersedes #600.
Implements a type-safe version of the JSON-RPC batch request feature. Users can now do this:
and the underlying requests would be sent in the just one HTTP request.