UNPKG

@npmjs_tdsoftware/subidentity

Version:

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 contai

38 lines (37 loc) 1.44 kB
import { ApiPromise } from "@polkadot/api"; import { ChainStatus } from "./types/ChainStatus"; import { Token } from "./types/Token"; export declare const apiPromises: { [wsAddress: string]: ApiPromise; }; /** * connect to wsProvider * @param wsAddress Network endpoint URL * @returns ApiPromise instance using the supplied provider * @throws Error when the initial connection fails */ export declare function connectToWsProvider(wsAddress: string): Promise<ApiPromise>; /** * check if the node of provided wsProvider is running on archive mode * @param wsAddress Network end point URL * @returns true if node is running in archive mode */ export declare const isArchiveNode: (wsAddress: string) => Promise<boolean>; /** * fetch chain name from a selected substrate based chain * @param wsAddress Network end point URL * @returns name of the requested chain */ export declare const getChainName: (wsAddress: string) => Promise<string>; /** * fetch Token details of a selected substrate based chain * @param wsAddress Network end point URL * @returns token symbol and decimals of the requested chain */ export declare const getTokenDetails: (wsAddress: string) => Promise<Token>; /** * fetch chain status from a selected substrate based chain * @param wsAddress Network end point URL * @returns chainStatus of the requested chain */ export declare const getChainStatus: (wsAddress: string) => Promise<ChainStatus>;