File tree Expand file tree Collapse file tree 4 files changed +19
-6
lines changed
create-invoice-form/src/lib/invoice
invoice-dashboard/src/utils Expand file tree Collapse file tree 4 files changed +19
-6
lines changed Original file line number Diff line number Diff line change 174174 </p >
175175 <p class =" invoice-section-title" >
176176 <span >Settlement Currency</span >
177- {currency ? ` ${currency ?.symbol } (${currency ?.network }) ` : " " }
177+ {currency ? ` ${currency ?.symbol } (${currency ?.network }) ` : " " }
178178 </p >
179179 <p class =" invoice-section-title" >
180180 <span >Invoice Type</span >
Original file line number Diff line number Diff line change @@ -34,6 +34,7 @@ export const getChainlinkRate = async (
3434 decimals : result . decimals . toString ( ) . length - 1 ,
3535 } ;
3636 } catch ( e ) {
37+ console . error ( 'Error fetching Chainlink rate:' , e ) ;
3738 return null ;
3839 }
3940} ;
Original file line number Diff line number Diff line change @@ -82,9 +82,9 @@ export const exportToPDF = async (
8282 </div>
8383
8484 <div style="margin-bottom: 20px;">
85- <strong>Payment Chain:</strong> ${ paymentCurrencies [ 0 ] ?. network || "-" } <br>
85+ <strong>Payment Chain:</strong> ${ paymentCurrencies . length > 0 ? paymentCurrencies [ 0 ] ?. network : "-" } <br>
8686 <strong>Invoice Currency:</strong> ${ invoice . currency || "-" } <br>
87- <strong>Settlement Currency:</strong> ${ paymentCurrencies [ 0 ] ?. symbol || "-" } <br>
87+ <strong>Settlement Currency:</strong> ${ paymentCurrencies . length > 0 ? paymentCurrencies [ 0 ] ?. symbol : "-" } <br>
8888 <strong>Invoice Type:</strong> Regular Invoice
8989 </div>
9090
Original file line number Diff line number Diff line change @@ -1163,17 +1163,29 @@ export const currencyConversionPairs = {
11631163 ] ,
11641164} ;
11651165
1166+
1167+ interface CurrencyConversionPair {
1168+ input : string ;
1169+ outputs : string [ ] ;
1170+ }
1171+
1172+ interface FormattedCurrencyConversionPair {
1173+ [ input : string ] : {
1174+ [ output : string ] : number ;
1175+ } ;
1176+ }
1177+
11661178/**
11671179 * Converts currency conversion pair to currency manager format
11681180 *
11691181 * @param currencyConversionPair
11701182 * @returns formatted currency conversion pair for currency manager
11711183 */
11721184
1173- export const convertToCurrencyManagerFormat = ( currencyConversionPair ) => {
1174- const result : any = { } ;
1185+ export const convertToCurrencyManagerFormat = ( currencyConversionPair : CurrencyConversionPair [ ] ) : FormattedCurrencyConversionPair => {
1186+ const result : FormattedCurrencyConversionPair = { } ;
11751187 for ( const pair of currencyConversionPair ) {
1176- const outputs : any = { } ;
1188+ const outputs : { [ output : string ] : number } = { } ;
11771189 for ( const output of pair . outputs ) {
11781190 outputs [ output ] = 1 ;
11791191 }
You can’t perform that action at this time.
0 commit comments