@@ -14,6 +14,7 @@ import { OpenAPI, ResponseSchema } from 'routing-controllers-openapi';
1414import { plainToClassFromExist } from 'class-transformer' ;
1515import { firefly } from '../clients/firefly' ;
1616import {
17+ FF_MESSAGES ,
1718 formatTemplate ,
1819 FormDataSchema ,
1920 getBroadcastMessageBody ,
@@ -85,8 +86,8 @@ export class TokensController {
8586 if ( body . messagingMethod ) {
8687 mintBody . message =
8788 body . messagingMethod === 'broadcast'
88- ? getBroadcastMessageBody ( body )
89- : getPrivateMessageBody ( body ) ;
89+ ? getBroadcastMessageBody ( body , undefined , FF_MESSAGES . TRANSFER_BROADCAST )
90+ : getPrivateMessageBody ( body , undefined , FF_MESSAGES . TRANSFER_PRIVATE ) ;
9091 }
9192 const transfer = await firefly . mintTokens ( mintBody ) ;
9293 return { type : 'token_transfer' , id : transfer . localId } ;
@@ -112,8 +113,8 @@ export class TokensController {
112113 if ( body . messagingMethod ) {
113114 mintBody . message =
114115 body . messagingMethod === 'broadcast'
115- ? getBroadcastMessageBody ( body , data . id )
116- : getPrivateMessageBody ( body , data . id ) ;
116+ ? getBroadcastMessageBody ( body , data . id , FF_MESSAGES . TRANSFER_BROADCAST )
117+ : getPrivateMessageBody ( body , data . id , FF_MESSAGES . TRANSFER_PRIVATE ) ;
117118 }
118119 const transfer = await firefly . mintTokens ( mintBody ) ;
119120 return { type : 'token_transfer' , id : transfer . localId } ;
@@ -133,8 +134,8 @@ export class TokensController {
133134 if ( body . messagingMethod ) {
134135 burnBody . message =
135136 body . messagingMethod === 'broadcast'
136- ? getBroadcastMessageBody ( body )
137- : getPrivateMessageBody ( body ) ;
137+ ? getBroadcastMessageBody ( body , undefined , FF_MESSAGES . TRANSFER_BROADCAST )
138+ : getPrivateMessageBody ( body , undefined , FF_MESSAGES . TRANSFER_PRIVATE ) ;
138139 }
139140 const transfer = await firefly . burnTokens ( burnBody ) ;
140141 return { type : 'token_transfer' , id : transfer . localId } ;
@@ -160,8 +161,8 @@ export class TokensController {
160161 if ( body . messagingMethod ) {
161162 burnBody . message =
162163 body . messagingMethod === 'broadcast'
163- ? getBroadcastMessageBody ( body , data . id )
164- : getPrivateMessageBody ( body , data . id ) ;
164+ ? getBroadcastMessageBody ( body , data . id , FF_MESSAGES . TRANSFER_BROADCAST )
165+ : getPrivateMessageBody ( body , data . id , FF_MESSAGES . TRANSFER_PRIVATE ) ;
165166 }
166167 const transfer = await firefly . burnTokens ( burnBody ) ;
167168 return { type : 'token_transfer' , id : transfer . localId } ;
@@ -182,8 +183,8 @@ export class TokensController {
182183 if ( body . messagingMethod ) {
183184 transferBody . message =
184185 body . messagingMethod === 'broadcast'
185- ? getBroadcastMessageBody ( body )
186- : getPrivateMessageBody ( body ) ;
186+ ? getBroadcastMessageBody ( body , undefined , FF_MESSAGES . TRANSFER_BROADCAST )
187+ : getPrivateMessageBody ( body , undefined , FF_MESSAGES . TRANSFER_PRIVATE ) ;
187188 }
188189 const transfer = await firefly . transferTokens ( transferBody ) ;
189190 return { type : 'token_transfer' , id : transfer . localId } ;
@@ -210,8 +211,8 @@ export class TokensController {
210211 if ( body . messagingMethod ) {
211212 transferBody . message =
212213 body . messagingMethod === 'broadcast'
213- ? getBroadcastMessageBody ( body , data . id )
214- : getPrivateMessageBody ( body , data . id ) ;
214+ ? getBroadcastMessageBody ( body , data . id , FF_MESSAGES . TRANSFER_BROADCAST )
215+ : getPrivateMessageBody ( body , data . id , FF_MESSAGES . TRANSFER_PRIVATE ) ;
215216 }
216217 const transfer = await firefly . transferTokens ( transferBody ) ;
217218 return { type : 'token_transfer' , id : transfer . localId } ;
0 commit comments