UNPKG

@node-dlc/messaging

Version:
82 lines (81 loc) 3.04 kB
/// <reference types="node" /> import { IOrderOfferJSON, OrderOffer } from './OrderOffer'; /** * Order negotiation fields for order contract negotiation. * Follows the same pattern as NegotiationFields with Single and Disjoint variants. */ export declare abstract class OrderNegotiationFields { static deserialize(buf: Buffer): OrderNegotiationFields; /** * Creates OrderNegotiationFields from JSON data * @param json JSON object representing order negotiation fields */ static fromJSON(json: any): OrderNegotiationFields; abstract variant: 'Single' | 'Disjoint'; abstract discriminator: number; abstract serialize(): Buffer; abstract toJSON(): IOrderNegotiationFieldsJSON; } /** * Order negotiation fields for contract based on a single event (basic/empty). */ export declare class SingleOrderNegotiationFields extends OrderNegotiationFields { /** * Creates a SingleOrderNegotiationFields from JSON data * @param json JSON object representing single order negotiation fields */ static fromJSON(json: any): SingleOrderNegotiationFields; /** * Deserializes single order negotiation fields * @param buf */ static deserialize(buf: Buffer): SingleOrderNegotiationFields; variant: "Single"; discriminator: number; /** * Converts single order negotiation fields to JSON */ toJSON(): ISingleOrderNegotiationFieldsJSON; /** * Serializes the single order negotiation fields into a Buffer */ serialize(): Buffer; } /** * Order negotiation fields for contract based on multiple events. */ export declare class DisjointOrderNegotiationFields extends OrderNegotiationFields { /** * Creates a DisjointOrderNegotiationFields from JSON data * @param json JSON object representing disjoint order negotiation fields */ static fromJSON(json: any): DisjointOrderNegotiationFields; /** * Deserializes disjoint order negotiation fields * @param buf */ static deserialize(buf: Buffer): DisjointOrderNegotiationFields; variant: "Disjoint"; discriminator: number; orderOffer: OrderOffer; /** * Converts disjoint order negotiation fields to JSON */ toJSON(): IDisjointOrderNegotiationFieldsJSON; /** * Serializes the disjoint order negotiation fields into a Buffer */ serialize(): Buffer; } export type IOrderNegotiationFieldsJSON = ISingleOrderNegotiationFieldsJSON | IDisjointOrderNegotiationFieldsJSON; export interface ISingleOrderNegotiationFieldsJSON { variant: 'Single'; } export interface IDisjointOrderNegotiationFieldsJSON { variant: 'Disjoint'; orderOffer: IOrderOfferJSON; } export declare const OrderNegotiationFieldsV0: typeof SingleOrderNegotiationFields; export declare const OrderNegotiationFieldsV1: typeof DisjointOrderNegotiationFields; export type IOrderNegotiationFieldsV0JSON = ISingleOrderNegotiationFieldsJSON; export type IOrderNegotiationFieldsV1JSON = IDisjointOrderNegotiationFieldsJSON;