Configuration object for the RPC backend.
Optional
endpoint?: string(Optional) The specific endpoint path to append to the base URL.
Optional
serialization?: SerializationLayer(Optional) Custom serialization layer to use for RPC communication of type SerializationLayer
.
The base URL of the RPC server.
A Layer instance that provides the configured RPC client.
FetchHttpClient.layer
for HTTP transport using the Fetch API.RpcSerialization.layerNdjson
for NDJSON serialization.
Creates an RPC backend layer using HTTP protocol.
This function constructs a layered RPC client configured to communicate with a remote endpoint over HTTP. It uses the Fetch API for HTTP requests and NDJSON for request/response serialization by default, but you can use a custom serialization layer from
RpcSerialization
.NOTE: Make sure that, if you use a custom serialization layer, it is compatible with the RPC server you are communicating with. This means, you most likely want to modify the getServerLayers function invocation to use the same serialization layer!