Installation & Initialization
Install the Ternoa-js package
The Ternos-js npm library can be found here.
Prerequisites: NodeJS v.14+ & NPM
Install the latest stable version of the ternoa-js library in your existing project by running:
This package provides TypeScript types, but you will need TypeScript version 4.2 or higher to use them properly.
You can test out our upcoming features in our Alpha or Release candidate versions. These versions aren't stable and might contain some technical errors. @alpha versions are for internal and testing only whereas @rc releases tend to be the closest to its production version.
You can check out our version list over npm. Installing a specific version is as easy as replacing the @1.6.0-rc0
with your desired version:
API Initialization
To initialize the library, add the following code to your dApp:
Once the Ternoa-JS library is initialized, you will be able to use all the powerful NFT FRAMEs designed by Ternoa to build your dApps.
The default network used is Alphanet. To connect to the Mainnet network it is as simple as passing the desired WSS endpoint:
That's it! You're ready to build your dApp on Ternoa.
Accessing the Ternoa API
Ternoa SDK provides a powerful function named getRawApi()
to interact with the API. If the API is connected, it will be directly returned. You can use it all throughout your development experience to access passed data, subscribe to blockchain events, and access real-time blockchain info outside of extrinsics, constants, or queries.
Last updated