@node-dlc/messaging
Version:
DLC Messaging Protocol
101 lines (100 loc) • 3.3 kB
TypeScript
/// <reference types="node" />
import { MessageType } from '../MessageType';
import { IDlcMessage } from './DlcMessage';
import { RoundingIntervalsV0 } from './RoundingIntervalsV0';
import { IRoundingIntervalsV0JSON } from './RoundingIntervalsV0';
export declare abstract class NegotiationFields {
static deserialize(buf: Buffer): NegotiationFieldsV0 | NegotiationFieldsV1 | NegotiationFieldsV2;
abstract type: number;
abstract length: bigint;
abstract toJSON(): INegotiationFieldsV0JSON | INegotiationFieldsV1JSON | INegotiationFieldsV2JSON;
abstract serialize(): Buffer;
}
/**
* NegotiationFields V0 contains preferences of the accepter of a DLC
* which are taken into account during DLC construction.
*/
export declare class NegotiationFieldsV0 extends NegotiationFields implements IDlcMessage {
static type: MessageType;
/**
* Deserializes an negotiation_fields_v0 message
* @param buf
*/
static deserialize(buf: Buffer): NegotiationFieldsV0;
/**
* The type for negotiation_fields_v0 message. negotiation_fields_v0 = 55334
*/
type: MessageType;
length: bigint;
/**
* Converts negotiation_fields_v0 to JSON
*/
toJSON(): INegotiationFieldsV0JSON;
/**
* Serializes the negotiation_fields_v0 message into a Buffer
*/
serialize(): Buffer;
}
/**
* NegotiationFields V1 contains preferences of the acceptor of a DLC
* which are taken into account during DLC construction.
*/
export declare class NegotiationFieldsV1 extends NegotiationFields implements IDlcMessage {
static type: MessageType;
/**
* Deserializes an negotiation_fields_v1 message
* @param buf
*/
static deserialize(buf: Buffer): NegotiationFieldsV1;
/**
* The type for negotiation_fields_v1 message. negotiation_fields_v1 = 55336
*/
type: MessageType;
length: bigint;
roundingIntervals: RoundingIntervalsV0;
/**
* Converts negotiation_fields_v1 to JSON
*/
toJSON(): INegotiationFieldsV1JSON;
/**
* Serializes the negotiation_fields_v1 message into a Buffer
*/
serialize(): Buffer;
}
/**
* NegotiationFields V2 contains preferences of the acceptor of a DLC
* which are taken into account during DLC construction.
*/
export declare class NegotiationFieldsV2 extends NegotiationFields implements IDlcMessage {
static type: MessageType;
/**
* Deserializes an negotiation_fields_v1 message
* @param buf
*/
static deserialize(buf: Buffer): NegotiationFieldsV2;
/**
* The type for negotiation_fields_v2 message. negotiation_fields_v2 = 55346
*/
type: MessageType;
length: bigint;
negotiationFieldsList: NegotiationFields[];
/**
* Converts negotiation_fields_v2 to JSON
*/
toJSON(): INegotiationFieldsV2JSON;
/**
* Serializes the negotiation_fields_v2 message into a Buffer
*/
serialize(): Buffer;
}
export interface INegotiationFieldsV0JSON {
type: number;
}
export interface INegotiationFieldsV1JSON {
type: number;
roundingIntervals: IRoundingIntervalsV0JSON;
}
export interface INegotiationFieldsV2JSON {
type: number;
negotiationFieldsList: INegotiationFieldsV0JSON[] | INegotiationFieldsV1JSON[] | INegotiationFieldsV2JSON[];
}