npm.io
0.2.0 • Published 3 months ago

@polkadot-api/logs-provider

Licence
MIT
Version
0.2.0
Deps
1
Size
19 kB
Vulns
0
Weekly
0
Stars
155

@polkadot-api/logs-provider

This package exports a JsonRpcProvider enhancer to record logs of messages sent & received, and a provider that reads from these logs to replay existing sessions.

This can be useful to set up reproduction cases with a provider that behaves consistently.

withLogsRecorder

function withLogsRecorder(
  persistLog: (line: string) => void,
  provider: JsonRpcProvider,
): JsonRpcProvider

logsProvider

function logsProvider(logs: string[]): JsonRpcProvider