π°Get the native balance of a Signer
In this section we'll learn how to get the native balance for a Signer using polkadot.js API
Checking the native balance of a Substrate address using Polkadot API
const wsProvider = new WsProvider("wss://rpc.polkadot.io");
const api = await ApiPromise.create({ provider: wsProvider });
const substrateAddress = ""
let balance = await api.query.system.account(substrateAddress);
As you can see, the wsProvider
is defining the chain on which the native balance will be fetched.
Last updated