@polkadot-api/json-rpc-provider-proxy
TypeScript icon, indicating that this package has built-in type declarations

0.1.0 • Public • Published

@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.

Readme

Keywords

none

Package Sidebar

Install

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

Weekly Downloads

37,348

Version

0.1.0

License

MIT

Unpacked Size

70.8 kB

Total Files

12

Last publish

Collaborators

  • voliva
  • josepot