@substrate/api-sidecar
Version:
REST service that makes it easy to interact with blockchain nodes built using Substrate's FRAME framework.
29 lines (28 loc) • 1.13 kB
TypeScript
import { ApiPromise } from '@polkadot/api';
export interface AssetHubInfo {
isAssetHub: boolean;
isAssetHubMigrated: boolean;
}
export declare class ApiPromiseRegistry {
private static _instancesBySpecName;
private static specNameToTypeMap;
private static _instancesByUrl;
static assetHubInfo: AssetHubInfo;
static setAssetHubInfo(info: AssetHubInfo): void;
/**
* Get the ApiPromise instance for the given spec name.
* @param specName The spec name to get the ApiPromise instance for.
* @returns The ApiPromise instance for the given spec name.
*/
static initApi(url: string, type?: 'relay' | 'assethub' | 'parachain'): Promise<ApiPromise>;
static getApi(specName: string): ApiPromise | undefined;
static getApiByUrl(url: string): ApiPromise | undefined;
static getTypeBySpecName(specName: string): string | undefined;
static getSpecNameByType(type: string): Set<string> | undefined;
static getApiByType(type: string): {
specName: string;
api: ApiPromise;
}[];
static getAllAvailableSpecNames(): string[];
static clear(): void;
}