Socket
Book a DemoInstallSign in
Socket

@polkadot/api

Package Overview
Dependencies
Maintainers
1
Versions
3325
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@polkadot/api

A JavaScript wrapper for the Polkadot JsonRPC interface

Source
npmnpm
Version
0.2.4
Version published
Weekly downloads
115K
72.17%
Maintainers
1
Weekly downloads
 
Created
Source

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.

Keywords

Polkadot

FAQs

Package last updated on 18 Nov 2017

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts