@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
55 lines (54 loc) • 2.42 kB
TypeScript
import "@polkadot/api-augment";
import { Page } from "./types/Page";
import { Identity } from "./types/Identity";
import { Balance } from "./types/Balance";
export declare const tokenSymbol: {
[wsAddress: string]: string;
};
/**
* check if chain of provided endpoint implements the identity pallet
* @param wsAddress Network end point URL
* @returns true if identity pallet is implemented
*/
export declare const implementsIdentityPallet: (wsAddress: string) => Promise<boolean>;
/**
* fetch identitites from a selected substrate based chain
* @param wsAddress Network end point URL
* @param page requested page number
* @param limit number of identity items per each page
* @throws TypeError when pagination details are invalid
* @returns requested page with identitites
*/
export declare const getIdentities: (wsAddress: string, page: number, limit: number) => Promise<Page<Identity>>;
/**
* fetch all identitites from a selected substrate based chain including their judgements
* @param wsAddress Network end point URL
* @throws Error when identity pallet is not implemented on selected substrate chain
*/
export declare const getCompleteIdentities: (wsAddress: string) => Promise<Identity[]>;
/**
* search for identitites in a selected substrate based chain
* @param wsAddress Network end point URL
* @param query search key
* @param page requested page number
* @param limit number of identity items per each page
* @throws TypeError when pagination details are invalid
* @returns requested page with identitites matching search query
*/
export declare const searchIdentities: (wsAddress: string, query: string, page: number, limit: number) => Promise<Page<Identity>>;
/**
* fetch an Identity from a selected substrate based chain and address
* @param wsAddress Network end point URL
* @param address
* @throws TypeError when an identity with the given address can not be fetched
* @returns requested Identitity
*/
export declare const getIdentity: (wsAddress: string, address: string) => Promise<Identity>;
/**
* fetch the balance of an account with given address from a given substrate based chain
* @param wsAddress Network end point URL
* @param address account address
* @throws Error when the balance for the given address could not be fetched
* @returns requested Balance
*/
export declare const getAccountBalance: (wsAddress: string, address: string) => Promise<Balance>;