Files
api/packages/rpc-provider/README.md
T
Jaco Greeff a4fc2c51e8 API documentation (#253)
* Remove badges from READMEs (used inside docs)

* Expand intro

* Intro and examples for ApiRx

* examples -> examples-rpc

* Update intros with expanded example

* Don't nest subscriptions
2018-10-11 15:27:00 +02:00

725 B

@polkadot/rpc-provider

Generic transport providers to handle the transport of method calls to and from Polkadot clients from applications interacting with it. Generally, unless you are operating at a low-level and taking care of encoding and decoding of parameters/results, it won't be directly used. API interfaces building on top these providers can support various transports with the same underlying interfaces.

Usage

Installation -

yarn add @polkadot/rpc-provider

Initialisation -

import WsProvider from '@polkadot/rpc-provider/ws';

const provider = new WsProvider('http://127.0.0.1:9944');
const version = await provider.send('client_version', []);

console.log('clientVersion', version);