0.0.1-a4e5d344419ad46b8efc4a9cf5f71cf7a035eb76.1.0 • Published 2 years ago
@polkadot-api/json-rpc-provider-proxy v0.0.1-a4e5d344419ad46b8efc4a9cf5f71cf7a035eb76.1.0
@polkadot-api/json-rpc-provider-proxy
This package exports getSyncProvider, a function to create JsonRpcProviders that will act as if the connection happen synchronously.
export type AsyncJsonRpcProvider = (
onMessage: (message: string) => void,
onHalt: () => void,
) => JsonRpcConnection
function getSyncProvider(
input: () => Promise<AsyncJsonRpcProvider>,
): JsonRpcProviderThe returned provider will buffer up every message until it can get the JsonRpcConnection, at which point it will send every message buffered.