@@ -31,16 +31,16 @@ export function isNullAddress(tokenAddr: Address): boolean {
3131
3232export function bigIntToBigDecimal (
3333 quantity : BigInt ,
34- decimals : i32 = constants . DEFAULT_DECIMALS . toI32 ( ) ,
34+ decimals : i32 = constants . DEFAULT_DECIMALS . toI32 ( )
3535) : BigDecimal {
3636 return quantity . divDecimal (
37- constants . BIGINT_TEN . pow ( decimals as u8 ) . toBigDecimal ( ) ,
37+ constants . BIGINT_TEN . pow ( decimals as u8 ) . toBigDecimal ( )
3838 ) ;
3939}
4040
4141export function readValue < T > (
4242 callResult : ethereum . CallResult < T > ,
43- defaultValue : T ,
43+ defaultValue : T
4444) : T {
4545 return callResult . reverted ? defaultValue : callResult . value ;
4646}
@@ -57,7 +57,7 @@ export function getTokenDecimals(tokenAddr: Address): BigInt {
5757
5858 const decimals = readValue < BigInt > (
5959 tokenContract . try_decimals ( ) ,
60- constants . DEFAULT_DECIMALS ,
60+ constants . DEFAULT_DECIMALS
6161 ) ;
6262
6363 return decimals ;
@@ -68,7 +68,7 @@ export function getTokenSupply(tokenAddr: Address): BigInt {
6868
6969 const totalSupply = readValue < BigInt > (
7070 tokenContract . try_totalSupply ( ) ,
71- constants . BIGINT_ONE ,
71+ constants . BIGINT_ONE
7272 ) ;
7373
7474 return totalSupply ;
@@ -137,7 +137,7 @@ function pairwiseDiffOfPrices(prices: CustomPriceType[]): BigDecimal[] {
137137
138138export function kClosestPrices (
139139 k : i32 ,
140- prices : CustomPriceType [ ] ,
140+ prices : CustomPriceType [ ]
141141) : CustomPriceType [ ] {
142142 // sort by USD prices
143143 const pricesSorted = sortByPrices ( prices ) ;
@@ -176,6 +176,6 @@ export function averagePrice(prices: CustomPriceType[]): CustomPriceType {
176176
177177 return CustomPriceType . initialize (
178178 summationUSDPrice . div ( new BigDecimal ( BigInt . fromI32 ( prices . length as i32 ) ) ) ,
179- constants . DEFAULT_USDC_DECIMALS ,
179+ constants . DEFAULT_USDC_DECIMALS
180180 ) ;
181181}
0 commit comments