JSPM

@polkadot/api

0.2.2
  • ESM via JSPM
  • ES Module Entrypoint
  • Export Map
  • Keywords
  • License
  • Repository URL
  • TypeScript Types
  • README
  • Created
  • Published
  • Downloads 145524
  • Score
    100M100P100Q147186F
  • License ISC

A JavaScript wrapper for the Polkadot JsonRPC interface

Package Exports

  • @polkadot/api

This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (@polkadot/api) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.

Readme

Polkadot JavaScript API

Build Status Coverage Status Dependency Status devDependency Status

Introduction

Warning - currently this does not actually do all that much, it is an attempt to put into code some thoughts about how to maintain the endpoints.

Usage

Installation -

npm install --save @polkadot/api

Initialisation -

import Api from '@polkadot/api';

const provider = new Api.HttpProvider('http://127.0.0.1:9933');
const api = new Api(provider);

Making calls -

api.chain
  .getHeader('0x1234567890')
  .then((header) => console.log(header))
  .catch((error) => console.error(error));

Available methods

For a list of currently exposed methods, see the @polkadot/jsonrpc repository.