Polkadart API
We have two different ways to interact with the Polkadot or Polkadot based chains, through the Polkadart API and the network-specific APIs that are generated by the Polkadart CLI.
In this section, we will focus on the Polkadart API. If you are interested in the network-specific APIs, you can find them in the Blockchain API section.
Installation
The Polkadart API is available in the main package polkadart
which provides tools to connect and interact with the Polkadot or Polkadot based chains. It abstracts the complexities of the network protocols and offers straightforward APIs.
Add the following to your pubspec.yaml
file:
Get the dependencies by running:
Sample usage
This will print the following output:
The Polkadart APIs are static and do not change between different networks. They provide the most common functionalities that are shared across all networks.