Skip to content

Latest commit

 

History

History
39 lines (31 loc) · 876 Bytes

File metadata and controls

39 lines (31 loc) · 876 Bytes

plug-api-types

CircleCI

Type definitions for the Plug blockchain runtime.
These should be injected into an API session from @polkadot/api in order to connect and transact with a Plug chain.

Add as dependency

// package.json
{ 
  "dependencies": {
    "@plugnet/plug-api-types": "git+https://github.com/plugblockchain/plug-api-types.git#1.0.0-rc2"
  }
}
import {ApiPromise, WsProvider} from '@polkadot/api';
import PlugRuntimeTypes from '@plugnet/plug-api-types';

async function main() {
  const provider = new WsProvider('ws://example.com:9944');
  const api = await ApiPromise.create({ 
    provider,
    types: PlugRuntimeTypes,
  });

  //...

}

Build

To build the package for distribution run:

tsc