UNPKG

@test-org122/hypernet-core

Version:

Hypernet Core. Represents the SDK for running the Hypernet Protocol.

17 lines (13 loc) 388 B
import { EMessageType } from "@interfaces/types"; import "reflect-metadata"; import { Transform, Type } from "class-transformer"; export class MessagePayload { @Transform((input) => EMessageType[input.value]) public type: EMessageType; @Type(() => String) public data: string; constructor(type: EMessageType, data: string) { this.type = type; this.data = data; } }