This package provides functionality to fetch identities and search identities by address or any identity field from any Substrate chain implementing the identities pallet. It was developed for use in SubIdentity, a Substrate identity directory, and contains all therefore required methods and interfaces.
npm install
npm run build
npm run test
npm run lint
npm install @npmjs_tdsoftware/subidentity
Returns a Page of all identities of the chain of the provided wsProvider.
import { Identity, Page, getIdentities } from "@npmjs_tdsoftware/subidentity"
let wsProvider: string = "your-ws-provider"
let pageNumber = 1;
let limit = 10;
let page: Page<Identity> = await getIdentities(wsProvider, pageNumber, limit);
Returns a list of all identitites from a selected substrate based chain including their judgements.
import { Identity, getCompleteIdentities } from "@npmjs_tdsoftware/subidentity"
let wsProvider: string = "your-ws-provider"
let identities: Identity[] = await getCompleteIdentities(wsProvider);
Returns the balance of an account with given address from a given substrate based chain.
import { getAccountBalance, Balance } from "@npmjs_tdsoftware/subidentity"
let wsProvider: string = "your-ws-provider"
let address = "account-address";
let identity: Balance = await getAccountBalance(wsProvider, address);
Returns an identity of the chain of the provided wsProvider for the given address.
import { Identity, getIdentity } from "@npmjs_tdsoftware/subidentity"
let wsProvider: string = "your-ws-provider"
let address = "account-address";
let identity: Identity = await getIdentity(wsProvider, address);
Returns a Page of identities of the chain of the provided wsProvider fitting the search term.
import { Identity, Page, searchIdentities } from "@npmjs_tdsoftware/subidentity"
let wsProvider: string = "your-ws-provider"
let pageNumber = 1;
let limit = 10;
let query = "your-query-string";
let page: Page<Identity> = await searchIdentities(wsProvider, query, pageNumber, limit);
Returns true, if chain of provided wsProvider implements identity pallet.
import { implementsIdentityPallet } from "@npmjs_tdsoftware/subidentity"
let wsProvider = "your-ws-provider"
let isImplementingIdentityPallet = await implementsIdentityPallet(wsProvider);
Returns true, if the chain of provided wsProvider is running on archive mode.
import { isArchiveNode } from "@npmjs_tdsoftware/subidentity"
let wsProvider = "your-ws-provider"
let isMyNodeArchive = await isArchiveNode(wsProvider);
Returns the name of the chain of provided wsProvider.
import { getChainName } from "@npmjs_tdsoftware/subidentity"
let wsProvider = "your-ws-provider"
let chainName = await getChainName(wsProvider);
Returns the token symbol and decimals of the chain of provided wsProvider.
import { Token, getTokenDetails } from "@npmjs_tdsoftware/subidentity"
let wsProvider = "your-ws-provider"
let tokenDetails = await getTokenDetails(wsProvider);
Returns the chain status of the chain of provided wsProvider.
import { ChainStatus, getChainStatus } from "@npmjs_tdsoftware/subidentity"
let wsProvider = "your-ws-provider"
let chainStatus: ChainStatus = await getChainStatus(wsProvider);
Returns ApiPromise instance using the supplied wsProvider.
import { ApiPromise } from "@polkadot/api";
import { connectToWsProvider } from "@npmjs_tdsoftware/subidentity"
let wsProvider = "your-ws-provider"
let apiPromise: ApiPromise = await connectToWsProvider(wsProvider);
Apache License 2.0