UNPKG

@node-dlc/messaging

Version:
48 lines (47 loc) 1.27 kB
/// <reference types="node" /> import { MessageType } from '../MessageType'; import { IDlcMessage } from './DlcMessage'; /** * RoundingIntervals V0 */ export declare class RoundingIntervalsV0 implements IDlcMessage { static type: MessageType; /** * Deserializes an rounding_intervals_v0 tlv * @param buf */ static deserialize(buf: Buffer): RoundingIntervalsV0; /** * The type for rounding_intervals_v0 tlv. rounding_intervals_v0 = 42788 */ type: MessageType; length: bigint; intervals: IInterval[]; /** * Validates correctness of all fields in the message * https://github.com/discreetlogcontracts/dlcspecs/blob/master/NumericOutcome.md#requirements * @throws Will throw an error if validation fails */ validate(): void; /** * Converts rounding_intervals_v0 to JSON */ toJSON(): IRoundingIntervalsV0JSON; /** * Serializes the rounding_intervals_v0 tlv into a Buffer */ serialize(): Buffer; } interface IInterval { beginInterval: bigint; roundingMod: bigint; } interface IIntervalJSON { beginInterval: number; roundingMod: number; } export interface IRoundingIntervalsV0JSON { type: number; intervals: IIntervalJSON[]; } export {};