UNPKG

@node-dlc/messaging

Version:
116 lines (115 loc) 3.27 kB
/// <reference types="node" /> import { MessageType } from '../MessageType'; import { IDlcMessage } from './DlcMessage'; export declare abstract class PayoutCurvePiece { static deserialize(buf: Buffer): PolynomialPayoutCurvePiece | HyperbolaPayoutCurvePiece; abstract type: number; abstract length: bigint; abstract toJSON(): PolynomialPayoutCurvePieceJSON | HyperbolaPayoutCurvePieceJSON; abstract serialize(): Buffer; } /** * PolynomialPayoutCurvePiece */ export declare class PolynomialPayoutCurvePiece extends PayoutCurvePiece implements IDlcMessage { static type: MessageType; /** * Deserializes an polynomial_payout_curve_piece message * @param buf */ static deserialize(buf: Buffer): PolynomialPayoutCurvePiece; /** * The type for polynomial_payout_curve_piece message. polynomial_payout_curve_piece = ??? */ type: MessageType; length: bigint; points: IPoint[]; /** * Converts polynomial_payout_curve_piece to JSON */ toJSON(): PolynomialPayoutCurvePieceJSON; /** * Serializes the polynomial_payout_curve_piece message into a Buffer */ serialize(): Buffer; } /** * HyperbolaPayoutCurvePiece */ export declare class HyperbolaPayoutCurvePiece extends PayoutCurvePiece implements IDlcMessage { static type: MessageType; /** * Deserializes an hyperbola_payout_curve_piece message * @param buf */ static deserialize(buf: Buffer): HyperbolaPayoutCurvePiece; /** * The type for hyperbola_payout_curve_piece message. hyperbola_payout_curve_piece = ??? */ type: MessageType; length: bigint; usePositivePiece: boolean; translateOutcomeSign: boolean; translateOutcome: bigint; translateOutcomeExtraPrecision: number; translatePayoutSign: boolean; translatePayout: bigint; translatePayoutExtraPrecision: number; aSign: boolean; a: bigint; aExtraPrecision: number; bSign: boolean; b: bigint; bExtraPrecision: number; cSign: boolean; c: bigint; cExtraPrecision: number; dSign: boolean; d: bigint; dExtraPrecision: number; /** * Converts hyperbola_payout_curve_piece to JSON */ toJSON(): HyperbolaPayoutCurvePieceJSON; /** * Serializes the hyperbola_payout_curve_piece message into a Buffer */ serialize(): Buffer; } interface IPoint { eventOutcome: bigint; outcomePayout: bigint; extraPrecision: number; } interface IPointJSON { eventOutcome: number; outcomePayout: number; extraPrecision: number; } export interface PolynomialPayoutCurvePieceJSON { type: number; points: IPointJSON[]; } export interface HyperbolaPayoutCurvePieceJSON { type: number; usePositivePiece: boolean; translateOutcomeSign: boolean; translateOutcome: number; translateOutcomeExtraPrecision: number; translatePayoutSign: boolean; translatePayout: number; translatePayoutExtraPrecision: number; aSign: boolean; a: number; aExtraPrecision: number; bSign: boolean; b: number; bExtraPrecision: number; cSign: boolean; c: number; cExtraPrecision: number; dSign: boolean; d: number; dExtraPrecision: number; } export {};