@@ -22,6 +22,7 @@ import {MosaicId} from '../model/mosaic/MosaicId';
2222import { MosaicInfo } from '../model/mosaic/MosaicInfo' ;
2323import { MosaicNames } from '../model/mosaic/MosaicNames' ;
2424import { MosaicProperties } from '../model/mosaic/MosaicProperties' ;
25+ import { MosaicPropertyIdEnum } from '../model/mosaic/MosaicPropertyIdEnum' ;
2526import { NamespaceId } from '../model/namespace/NamespaceId' ;
2627import { UInt64 } from '../model/UInt64' ;
2728import { Http } from './Http' ;
@@ -60,18 +61,19 @@ export class MosaicHttp extends Http implements MosaicRepository {
6061 return this . getNetworkTypeObservable ( ) . pipe (
6162 mergeMap ( ( networkType ) => observableFrom (
6263 this . mosaicRoutesApi . getMosaic ( mosaicId . toHex ( ) ) ) . pipe ( map ( ( mosaicInfoDTO ) => {
63- return new MosaicInfo (
64- mosaicInfoDTO . meta . id ,
65- new MosaicId ( mosaicInfoDTO . mosaic . mosaicId ) ,
66- new UInt64 ( mosaicInfoDTO . mosaic . supply ) ,
67- new UInt64 ( mosaicInfoDTO . mosaic . height ) ,
68- PublicAccount . createFromPublicKey ( mosaicInfoDTO . mosaic . owner , networkType ) ,
69- mosaicInfoDTO . mosaic . revision ,
70- new MosaicProperties (
71- new UInt64 ( mosaicInfoDTO . mosaic . properties [ 0 ] . value ) ,
72- ( new UInt64 ( mosaicInfoDTO . mosaic . properties [ 1 ] . value ) ) . compact ( ) ,
73- ) ,
74- ) ;
64+ return new MosaicInfo (
65+ mosaicInfoDTO . meta . id ,
66+ new MosaicId ( mosaicInfoDTO . mosaic . mosaicId ) ,
67+ new UInt64 ( mosaicInfoDTO . mosaic . supply ) ,
68+ new UInt64 ( mosaicInfoDTO . mosaic . height ) ,
69+ PublicAccount . createFromPublicKey ( mosaicInfoDTO . mosaic . owner , networkType ) ,
70+ mosaicInfoDTO . mosaic . revision ,
71+ new MosaicProperties (
72+ new UInt64 ( mosaicInfoDTO . mosaic . properties [ MosaicPropertyIdEnum . MosaicFlags ] . value ) ,
73+ ( new UInt64 ( mosaicInfoDTO . mosaic . properties [ MosaicPropertyIdEnum . Divisibility ] . value ) ) . compact ( ) ,
74+ new UInt64 ( mosaicInfoDTO . mosaic . properties [ MosaicPropertyIdEnum . Duration ] . value ) ,
75+ ) ,
76+ ) ;
7577 } ) ) ) ) ;
7678 }
7779
@@ -96,8 +98,9 @@ export class MosaicHttp extends Http implements MosaicRepository {
9698 PublicAccount . createFromPublicKey ( mosaicInfoDTO . mosaic . owner , networkType ) ,
9799 mosaicInfoDTO . mosaic . revision ,
98100 new MosaicProperties (
99- new UInt64 ( mosaicInfoDTO . mosaic . properties [ 0 ] . value ) ,
100- ( new UInt64 ( mosaicInfoDTO . mosaic . properties [ 1 ] . value ) ) . compact ( ) ,
101+ new UInt64 ( mosaicInfoDTO . mosaic . properties [ MosaicPropertyIdEnum . MosaicFlags ] . value ) ,
102+ ( new UInt64 ( mosaicInfoDTO . mosaic . properties [ MosaicPropertyIdEnum . Divisibility ] . value ) ) . compact ( ) ,
103+ new UInt64 ( mosaicInfoDTO . mosaic . properties [ MosaicPropertyIdEnum . Duration ] . value ) ,
101104 ) ,
102105 ) ;
103106 } ) ;
0 commit comments