UNPKG

@substrate/api-sidecar

Version:

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

33 lines (32 loc) 1.76 kB
import { PalletsForeignAssetsService } from '../../services'; import AbstractController from '../AbstractController'; /** * GET asset information for all foreign assets. * * Query: * - (Optional)`at`: Block at which to retrieve runtime version information at. Block * identifier, as the block height or block hash. Defaults to most recent block. * - (Optional)`useRcBlock`: When set to 'true', uses the relay chain block specified in the 'at' parameter to determine corresponding Asset Hub block(s). Only supported for Asset Hub endpoints. * * `/pallets/foreign-assets` * Returns: * - When using `useRcBlock` parameter: An array of response objects, one for each Asset Hub block found * in the specified relay chain block. Returns empty array `[]` if no Asset Hub blocks found. * - When using `at` parameter or no query params: A single response object. * * Response object structure: * - `at`: Block number and hash at which the call was made. * - `items`: An array containing the `AssetDetails` and `AssetMetadata` of every foreign asset. * - `rcBlockNumber`: The relay chain block number used for the query. Only present when `useRcBlock` parameter is used. * - `ahTimestamp`: The Asset Hub block timestamp. Only present when `useRcBlock` parameter is used. * * Substrate References: * - Foreign Assets Pallet Instance in Kusama Asset Hub: https://github.com/paritytech/cumulus/blob/master/parachains/runtimes/assets/asset-hub-kusama/src/lib.rs#L295 */ export default class PalletsForeignAssetsController extends AbstractController<PalletsForeignAssetsService> { static controllerName: string; static requiredPallets: string[][]; constructor(api: string); protected initRoutes(): void; private getForeignAssets; }