Skip to content
This repository was archived by the owner on Jun 1, 2023. It is now read-only.

Promise and RxJS APIs around Polkadot and Substrate based chains via RPC calls. It is dynamically generated based on what the Substrate runtime provides in terms of metadata. Full documentation & examples available. This fork supports OpenRPC document generation.

License

Notifications You must be signed in to change notification settings

ProjectLibertyLabs/polkadot-js-openrpc

This branch is 24 commits ahead of, 881 commits behind polkadot-js/api:master.

Folders and files

NameName
Last commit message
Last commit date

Latest commit

e60292d · Jan 4, 2023
Dec 8, 2022
Mar 10, 2022
Oct 23, 2020
Dec 29, 2022
Nov 18, 2017
Jul 11, 2022
Dec 27, 2022
Jan 13, 2022
Nov 28, 2017
Apr 26, 2021
Jun 8, 2021
Jan 1, 2022
Mar 10, 2022
Dec 27, 2022
Feb 28, 2019
Dec 27, 2022
Nov 21, 2018
Jan 4, 2023
Dec 4, 2019
Jan 1, 2022
Aug 12, 2022
Apr 27, 2022
Dec 27, 2022
Jul 5, 2022
Jul 9, 2021
Dec 13, 2022
Aug 16, 2022
Jan 11, 2022
Jan 11, 2022
Dec 27, 2022

Repository files navigation

@polkadot/api

This library provides a clean wrapper around all the methods exposed by a Polkadot/Substrate network client and defines all the types exposed by a node. For complete documentation around the classes, interfaces and their use, visit the documentation portal.

If you are an existing user, please be sure to track the CHANGELOG and UPGRADING guides when changing versions.

tutorials

Looking for tutorials to get started? Look at examples for guides on how to use the API to make queries and submit transactions.

OpenRPC

This fork includes a modified typegen utility that can generate an OpenRPC document.

Setup

Create a folder for the output file(s):

mkdir output_directory

Install the project:

yarn install

Start up a node (if it isn't already running) and use it's IP address below:

Usage

yarn polkadot-types-from-chain --openrpc --endpoint ws://127.0.0.1:9944 --output FOLDER_THAT_MUST_ALREADY_EXIST

Note

To add support for additional complex types, you must:

  • Add a $ref mapping for each to the code in openrpc.ts:

['AccountId32', { $ref: '#/components/schemas/AccountId32' }],

  • Add an entry to the handlebars template openrpc.hbs for the new complex type:
  "components": {
    "schemas": {
      "AccountId32": {
        "title": "AccountId32",
        "description": "A 32-byte encoded account identifier used to identify accounts on the Polkadot network",
        "type": "string",
        "pattern": "^[a-fA-F0-9]{64}$"
      }
    }
  }

See also:

OpenRPC

handlebars

About

Promise and RxJS APIs around Polkadot and Substrate based chains via RPC calls. It is dynamically generated based on what the Substrate runtime provides in terms of metadata. Full documentation & examples available. This fork supports OpenRPC document generation.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • TypeScript 99.8%
  • Other 0.2%