/
MessageResponse.ts
36 lines (29 loc) · 1017 Bytes
/
MessageResponse.ts
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
import { Expose, Type } from "class-transformer";
import { Moment } from "moment";
import { Address } from "../crypto/Address";
import { AddressToClass, AddressToPlain, ChainObjectToClass, ChainObjectToPlain, MomentToClass, MomentToPlain } from "../net/adapter/TypeAdapters";
import { ChainObject } from "./ChainObject";
import { MessageReceiver } from "./MessageReceiver";
export class MessageResponse {
@ChainObjectToPlain
@ChainObjectToClass
@Expose({ name: "id" })
public id: ChainObject;
@MomentToPlain
@MomentToClass
@Expose({ name: "created" })
public created: Moment;
@ChainObjectToPlain
@ChainObjectToClass
@Expose({ name: "sender" })
public sender: ChainObject;
@AddressToPlain
@AddressToClass
@Expose({ name: "sender_pubkey" })
public senderAddress?: Address;
@Type(() => MessageReceiver)
@Expose({ name: "receivers_data" })
public receiversData: MessageReceiver[];
@Expose({ name: "text" })
public text: string;
}