Files
api/packages/api-provider
2017-12-07 21:15:02 +00:00
..
2017-12-03 17:34:15 +01:00
2017-12-01 20:57:16 +01:00
2017-11-28 18:03:48 +01:00
2017-12-07 21:15:02 +00:00
2017-12-01 20:57:16 +01:00

dependency devDependency

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

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);