@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.13 kB
TypeScript
import type { u128, Vec } from '@polkadot/types';
import type { Compact, Option } from '@polkadot/types/codec';
import type { AccountId } from '@polkadot/types/interfaces/runtime';
import type { PalletStakingNominations, PalletStakingRewardDestination, PalletStakingUnlockChunk } from '@polkadot/types/lookup';
import { IAt } from '.';
export type ValidatorStatus = 'claimed' | 'unclaimed' | 'partially claimed' | 'undefined';
export type NominatorStatus = 'claimed' | 'unclaimed' | 'undefined';
export interface IEraStatus<T> {
era: number;
status: T;
}
export interface IStakingLedger {
stash: AccountId;
total: Compact<u128>;
active: Compact<u128>;
unlocking: Vec<PalletStakingUnlockChunk>;
claimedRewards?: IEraStatus<ValidatorStatus | NominatorStatus>[];
}
export interface IAccountStakingInfo {
at: IAt;
controller: AccountId;
rewardDestination: Option<PalletStakingRewardDestination>;
numSlashingSpans: number;
nominations: PalletStakingNominations | null;
staking: IStakingLedger | null;
rcBlockHash?: string;
rcBlockNumber?: string;
ahTimestamp?: string;
}