Skip to content
This repository has been 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

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

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%