Skip to main content

@therootnetwork/api

A utility package that complements the @polkadot/api to connect and interact with the Root Network node.

Install

Usage

  1. Create an API instance
  1. Use api instance to interact with node

API

function getApiOptions()

Returns an ApiOptions object that contains necessary types and RPC methods to connect The Root Network.

function getPublicProvider(network: NetworkName, useWsProvider?: boolean)

Returns a provider instance of either WsProvider or HttpProvider that connects to TRN mainnet "root" or testnet "porcini".