@substrate/api-sidecar
Version:
REST service that makes it easy to interact with blockchain nodes built using Substrate's FRAME framework.
45 lines (44 loc) • 2.07 kB
TypeScript
import { AccountsVestingInfoService } from '../../services';
import AbstractController from '../AbstractController';
/**
* GET vesting information for an address.
*
* Paths:
* - `address`: Address to query.
*
* Query params:
* - (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.
*
* 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.
* - `vesting`: Vesting schedule for an account.
* - `locked`: Number of tokens locked at start.
* - `perBlock`: Number of tokens that gets unlocked every block after `startingBlock`.
* - `startingBlock`: Starting block for unlocking(vesting).
* - `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 Reference:
* - Vesting Pallet: https://crates.parity.io/pallet_vesting/index.html
* - `VestingInfo`: https://crates.parity.io/pallet_vesting/struct.VestingInfo.html
*/
export default class AccountsVestingInfoController extends AbstractController<AccountsVestingInfoService> {
static controllerName: string;
static requiredPallets: string[][];
constructor(api: string);
protected initRoutes(): void;
/**
* Get vesting information for an account.
*
* @param req Express Request
* @param res Express Response
*/
private getAccountVestingInfo;
}