File tree Expand file tree Collapse file tree 3 files changed +29
-2
lines changed Expand file tree Collapse file tree 3 files changed +29
-2
lines changed Original file line number Diff line number Diff line change 1717import { crypto } from 'nem2-library' ;
1818import { PublicAccount } from '../account/PublicAccount' ;
1919import { Message } from './Message' ;
20+ import { MessageType } from './MessageType' ;
2021import { PlainMessage } from './PlainMessage' ;
2122
2223/**
@@ -28,7 +29,7 @@ export class EncryptedMessage extends Message {
2829
2930 constructor ( payload : string ,
3031 recipientPublicAccount ?: PublicAccount ) {
31- super ( 1 , payload ) ;
32+ super ( MessageType . EncryptedMessage , payload ) ;
3233 this . recipientPublicAccount = recipientPublicAccount ;
3334 }
3435
Original file line number Diff line number Diff line change 1+ /*
2+ * Copyright 2018 NEM
3+ *
4+ * Licensed under the Apache License, Version 2.0 (the "License");
5+ * you may not use this file except in compliance with the License.
6+ * You may obtain a copy of the License at
7+ *
8+ * http://www.apache.org/licenses/LICENSE-2.0
9+ *
10+ * Unless required by applicable law or agreed to in writing, software
11+ * distributed under the License is distributed on an "AS IS" BASIS,
12+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13+ * See the License for the specific language governing permissions and
14+ * limitations under the License.
15+ */
16+
17+ /**
18+ * The supply type. Supported supply types are:
19+ * 0: Increase in supply.
20+ * 1: Decrease in supply.
21+ */
22+ export enum MessageType {
23+ PlainMessage = 0 ,
24+ EncryptedMessage = 1 ,
25+ }
Original file line number Diff line number Diff line change 1515 */
1616
1717import { Message } from './Message' ;
18+ import { MessageType } from './MessageType' ;
1819
1920/**
2021 * The plain message model defines a plain string. When sending it to the network we transform the payload to hex-string.
@@ -40,7 +41,7 @@ export class PlainMessage extends Message {
4041 * @param payload
4142 */
4243 constructor ( payload : string ) {
43- super ( 0 , payload ) ;
44+ super ( MessageType . PlainMessage , payload ) ;
4445 }
4546
4647}
You can’t perform that action at this time.
0 commit comments