@@ -37,19 +37,6 @@ import { Transaction } from './Transaction';
3737import { TransactionInfo } from './TransactionInfo' ;
3838import { TransactionType } from './TransactionType' ;
3939import { TransactionVersion } from './TransactionVersion' ;
40- import { MosaicDefinitionTransactionBuilder } from '../../infrastructure/catbuffer/MosaicDefinitionTransactionBuilder' ;
41- import { SignatureDto } from '../../infrastructure/catbuffer/SignatureDto' ;
42- import { KeyDto } from '../../infrastructure/catbuffer/KeyDto' ;
43- import { EntityTypeDto } from '../../infrastructure/catbuffer/EntityTypeDto' ;
44- import { AmountDto } from '../../infrastructure/catbuffer/AmountDto' ;
45- import { TimestampDto } from '../../infrastructure/catbuffer/TimestampDto' ;
46- import { MosaicNonceDto } from '../../infrastructure/catbuffer/MosaicNonceDto' ;
47- import { MosaicIdDto } from '../../infrastructure/catbuffer/MosaicIdDto' ;
48- import { MosaicFlagsDto } from '../../infrastructure/catbuffer/MosaicFlagsDto' ;
49- import { MosaicFlags } from '../mosaic/MosaicFlag' ;
50- import { BlockDurationDto } from '../../infrastructure/catbuffer/BlockDurationDto' ;
51- import { Convert } from '../../core/format' ;
52- import { GeneratorUtils } from '../../infrastructure/catbuffer/GeneratorUtils' ;
5340
5441/**
5542 * Before a mosaic can be created or transferred, a corresponding definition of the mosaic has to be created and published to the network.
@@ -212,4 +199,25 @@ export class MosaicDefinitionTransaction extends Transaction {
212199 ) ;
213200 return transactionBuilder . serialize ( ) ;
214201 }
202+
203+ /**
204+ * @internal
205+ * @returns {Uint8Array }
206+ */
207+ protected generateEmbeddedBytes ( ) : Uint8Array {
208+ const signerBuffer = new Uint8Array ( 32 ) ;
209+
210+ const transactionBuilder = new EmbeddedMosaicDefinitionTransactionBuilder (
211+ new KeyDto ( signerBuffer ) ,
212+ this . versionToDTO ( ) ,
213+ TransactionType . MOSAIC_DEFINITION . valueOf ( ) ,
214+ new MosaicNonceDto ( this . getMosaicNonceIntValue ( ) ) ,
215+ new MosaicIdDto ( this . mosaicId . id . toDTO ( ) ) ,
216+ this . getMosaicFlagValue ( ) ,
217+ this . mosaicProperties . divisibility ,
218+ new BlockDurationDto ( this . mosaicProperties . duration ?
219+ this . mosaicProperties . duration . toDTO ( ) : [ ] ) ,
220+ ) ;
221+ return transactionBuilder . serialize ( ) ;
222+ }
215223}
0 commit comments