@polkadot-api/json-rpc-provider-proxy

v0.0.1-1b18786bf7a435b650402172e6ed3ab27366aa0c.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>,
): JsonRpcProvider

The returned provider will buffer up every message until it can get the JsonRpcConnection, at which point it will send every message buffered.

npm i @polkadot-api/json-rpc-provider-proxy@0.0.1-1b18786bf7a435b650402172e6ed3ab27366aa0c.1.0

Metadata

  • MIT
  • Whatever
  • Josep M Sobrepere
  • released 1/4/2024

Downloads