UNPKG

@substrate/api-sidecar

Version:

REST service that makes it easy to interact with blockchain nodes built using Substrate's FRAME framework.

30 lines (29 loc) 1.41 kB
import { BN } from '@polkadot/util'; import { ISidecarConfig } from 'src/types/sidecar-config'; import AbstractController from '../controllers/AbstractController'; import { AbstractService } from '../services/AbstractService'; import { ControllerConfig } from '../types/chains-config'; export declare const specToControllerMap: { [x: string]: ControllerConfig; }; export declare const assetHubSpecNames: Set<string>; export declare const assetHubToBabe: Record<string, { epochDuration: BN; genesisSlot: BN; slotDurationMs: BN; }>; /** * Return an array of instantiated controller instances based off of a `specName`. * * @param api ApiPromise to inject into controllers * @param specName spacName of the chain to get controllers and options for */ export declare function getControllersForSpec(specName: string, withRC: boolean): AbstractController<AbstractService>[]; /** * Return an array of instantiated controller instances based off of a `specName`. * @param pallets pallets available to define controllers * @param api ApiPromise to inject into controllers * @param specName specName of chain to get options */ export declare const getControllersByPallets: (specName: string, pallets: string[]) => AbstractController<AbstractService>[]; export declare const getControllers: (config: ISidecarConfig, specName: string, pallets: string[]) => AbstractController<AbstractService>[];