import { AnyU8a, IExtrinsicEra } from '../../types'; import BN from 'bn.js'; import Enum from '../../codec/Enum'; import Tuple from '../../codec/Tuple'; import U8a from '../../codec/U8a'; import U64 from '../U64'; interface MortalMethod { current: number; period: number; } /** * @name ImmortalEra * @description * The ImmortalEra for an extrinsic */ export declare class ImmortalEra extends U8a { constructor(value?: AnyU8a); } /** * @name MortalEra * @description * The MortalEra for an extrinsic, indicating period and phase */ export declare class MortalEra extends Tuple { constructor(value?: MortalMethod | Uint8Array | number[] | string); private static decodeMortalEra; private static decodeMortalObject; private static decodeMortalU8a; /** * @description Encoded length for mortals occupy 2 bytes, different from the actual Tuple since it is encoded. This is a shortcut fro `toU8a().length` */ readonly encodedLength: number; /** * @description The period of this Mortal wraps as a [[U64]] */ readonly period: U64; /** * @description The phase of this Mortal wraps as a [[U64]] */ readonly phase: U64; /** * @description Returns a JSON representation of the actual value */ toJSON(): any; /** * @description Encodes the value as a Uint8Array as per the parity-codec specifications * @param isBare true when the value has none of the type-specific prefixes (internal) * Period and phase are encoded: * - The period of validity from the block hash found in the signing material. * - The phase in the period that this transaction's lifetime begins (and, importantly, * implies which block hash is included in the signature material). If the `period` is * greater than 1 << 12, then it will be a factor of the times greater than 1<<12 that * `period` is. */ toU8a(isBare?: boolean): Uint8Array; /** * @description Get the block number of the start of the era whose properties this object describes that `current` belongs to. */ birth(current: BN | number): number; /** * @description Get the block number of the first block at which the era has ended. */ death(current: BN | number): number; /** * @description convert the number to binary and get the trailing zero's. */ private getTrailingZeros; } /** * @name ExtrinsicEra * @description * The era for an extrinsic, indicating either a mortal or immortal extrinsic */ export default class ExtrinsicEra extends Enum implements IExtrinsicEra { constructor(value?: any); private static decodeExtrinsicEra; /** * @description Overide the encoded length method */ readonly encodedLength: number; /** * @description Returns the item as a [[ImmortalEra]] */ readonly asImmortalEra: ImmortalEra; /** * @description Returns the item as a [[MortalEra]] */ readonly asMortalEra: MortalEra; /** * @description `true` if Immortal */ readonly isImmortalEra: boolean; /** * @description `true` if Mortal */ readonly isMortalEra: boolean; /** * @description Encodes the value as a Uint8Array as per the parity-codec specifications * @param isBare true when the value has none of the type-specific prefixes (internal) */ toU8a(isBare?: boolean): Uint8Array; } export {};