UNPKG

@substrate/api-sidecar

Version:

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

59 lines (58 loc) 3.14 kB
import { PalletsAssetsService } from '../../services'; import AbstractController from '../AbstractController'; /** * GET asset information for a single asset. * * Paths: * - `assetId`: The identifier of the asset. * * 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/assets/:assetId/asset-info` * 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. * - `assetInfo`: All details concering an asset. * - `owner`: Owner of the assets privileges. * - `issuer`: The `AccountId` able to mint tokens. * - `admin`: The `AccountId` can that thaw tokens, force transfers and burn token from * any account. * - `freezer`: The `AccountId` that can freeze tokens. * - `supply`: The total supply across accounts. * - `deposit`: The balance deposited for this. This pays for the data stored. * - `minBalance`: The ED for virtual accounts. * - `isSufficient`: If `true`, then any account with this asset is given a provider reference. Otherwise, it * requires a consumer reference. * - `accounts`: The total number of accounts. * - `sufficients`: The total number of accounts for which is placed a self-sufficient reference. * - `approvals`: The total number of approvals. * - `isFrozen`: Whether the asset is frozen for non-admin transfers. * - `assetMetadata`: All metadata concerning an asset. * - `deposit`: The balance deposited for this metadata. This pays for the data * stored in this struct. * - `name`: The user friendly name of this asset. * - `symbol`: The ticker symbol for this asset. * - `decimals`: The number of decimals this asset uses to represent one unit. * - `isFrozen`: Whether the asset metadata may be changed by a non Force origin. * - `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: * - Assets Pallet: https://crates.parity.io/pallet_assets/index.html * - `AssetMetadata`: https://crates.parity.io/pallet_assets/struct.AssetMetadata.html * - `AssetDetails`: https://crates.parity.io/pallet_assets/struct.AssetDetails.html */ export default class PalletsAssetsController extends AbstractController<PalletsAssetsService> { static controllerName: string; static requiredPallets: string[][]; constructor(api: string); protected initRoutes(): void; private getAssetById; }