1 | import { BinaryWriter, createSerializeWire, SerializableWire, SerializeWire } from '@neo-one/client-common-esnext-esm';
|
2 | import { BinaryReader, DeserializeWireBaseOptions, DeserializeWireOptions } from '@neo-one/node-core-esnext-esm';
|
3 | export interface FilterAddPayloadAdd {
|
4 | readonly data: Buffer;
|
5 | }
|
6 |
|
7 | export class FilterAddPayload implements SerializableWire<FilterAddPayload> {
|
8 | public static deserializeWireBase({ reader }: DeserializeWireBaseOptions): FilterAddPayload {
|
9 | const data = reader.readVarBytesLE(520);
|
10 |
|
11 | return new this({ data });
|
12 | }
|
13 |
|
14 | public static deserializeWire(options: DeserializeWireOptions): FilterAddPayload {
|
15 | return this.deserializeWireBase({
|
16 | context: options.context,
|
17 | reader: new BinaryReader(options.buffer),
|
18 | });
|
19 | }
|
20 |
|
21 | public readonly data: Buffer;
|
22 | public readonly serializeWire: SerializeWire = createSerializeWire(this.serializeWireBase.bind(this));
|
23 |
|
24 | public constructor({ data }: FilterAddPayloadAdd) {
|
25 | this.data = data;
|
26 | }
|
27 |
|
28 | public serializeWireBase(writer: BinaryWriter): void {
|
29 | writer.writeVarBytesLE(this.data);
|
30 | }
|
31 | }
|