@@ -248,7 +248,14 @@ const buildDescription = (
248248
249249 const ageInDays = getUserAge ( user ) ;
250250
251- const firstLine = getOrderTitleMessage ( user , type , i18n ) ;
251+ const firstLine = getOrderTitleMessage (
252+ user ,
253+ type ,
254+ amount ,
255+ fiatCode ,
256+ priceFromAPI ,
257+ i18n ,
258+ ) ;
252259
253260 let description : string = `${ firstLine } \n` ;
254261 description += i18n . t ( 'for' ) + ` ${ currencyString } \n` ;
@@ -269,19 +276,34 @@ const buildDescription = (
269276const getOrderTitleMessage = (
270277 user : UserDocument ,
271278 type : string ,
279+ amount : number ,
280+ fiatCode : string ,
281+ priceFromAPI : boolean ,
272282 i18n : I18nContext ,
273283) => {
274284 const isSell = type === 'sell' ;
275285
286+ // For fixed orders we show the sats amount; for market/range orders
287+ // (priceFromAPI, amount === 0) the amount is omitted.
288+ const amountText = priceFromAPI ? '' : `${ numberFormat ( fiatCode , amount ) } ` ;
289+
276290 // Guard Clause: The user DOES want to show their name, we resolve and leave.
277291 if ( user . show_username ) {
278292 return isSell
279- ? i18n . t ( 'showusername_selling_sats' , { username : user . username } )
280- : i18n . t ( 'showusername_buying_sats' , { username : user . username } ) ;
293+ ? i18n . t ( 'showusername_selling_sats' , {
294+ username : user . username ,
295+ amount : amountText ,
296+ } )
297+ : i18n . t ( 'showusername_buying_sats' , {
298+ username : user . username ,
299+ amount : amountText ,
300+ } ) ;
281301 }
282302
283303 // The user DOES NOT want to show their name.
284- return isSell ? i18n . t ( 'selling_sats' ) : i18n . t ( 'buying_sats' ) ;
304+ return isSell
305+ ? i18n . t ( 'selling_sats' , { amount : amountText } )
306+ : i18n . t ( 'buying_sats' , { amount : amountText } ) ;
285307} ;
286308
287309const getOrder = async (
@@ -378,4 +400,10 @@ const getNewRangeOrderPayload = async (order: IOrder) => {
378400 }
379401} ;
380402
381- export { createOrder , getOrder , getOrders , getNewRangeOrderPayload } ;
403+ export {
404+ createOrder ,
405+ getOrder ,
406+ getOrders ,
407+ getNewRangeOrderPayload ,
408+ getOrderTitleMessage ,
409+ } ;
0 commit comments