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

0.2.4 • 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

56,571

Version

0.2.4

License

MIT

Unpacked Size

31.7 kB

Total Files

14

Last publish

Collaborators

  • voliva
  • josepot