Install Native API
@therootnetwork/api
A utility package that complements the @polkadot/api
to connect and interact with the Root Network node.
Install
Usage
Create an API instance
Use
api
instance to interact with node
API
function getApiOptions()
function getApiOptions()
Returns an ApiOptions
object that contains necessary types and RPC methods to connect The Root Network.
function getPublicProvider(network: NetworkName, useWsProvider?: boolean)
function getPublicProvider(network: NetworkName, useWsProvider?: boolean)
Returns a provider
instance of either WsProvider
or HttpProvider
that connects to TRN mainnet "root"
or testnet "porcini"
.
Last updated