Files
api/packages/api-provider/README.md
T
Jaco Greeff e8ccc9aa79 Move to lerna repo (#19)
* Pull api-* packages into lerna repo

* Bootstrap with hoist

* Update jest alias config

* Add api-jsonrpc

* Pull in jsonrpc

* Update badges

* Don't hoist, use workspaces

* .eslintrc to root

* Cleanups, build from root

* Shorthand commands

* Update to @polkadot/dev 0.9.1

* Update description
2017-11-28 18:03:48 +01:00

26 lines
1.1 KiB
Markdown

[![Dependency Status](https://david-dm.org/polkadot-js/api.svg?path=packages/api-provider)](https://david-dm.org/polkadot-js/api?path=packages/api-provider)
[![devDependency Status](https://david-dm.org/polkadot-js/api/dev-status.svg?path=packages/api-provider)](https://david-dm.org/polkadot-js/api?path=packages/api-provider#info=devDependencies)
# @polkadot/api-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 -
```
npm install --save @polkadot/api-provider
```
Initialisation -
```js
import HttpProvider from '@polkadot/api-provider/http';
const provider = new HttpProvider('http://127.0.0.1:9933');
const version = await provider.send('client_version', []);
console.log('clientVersion', version);
```