1- import type { Abi , Hex } from "viem" ;
1+ import type { Abi } from "viem" ;
22
33import { ilpPriceFeedAbi } from "../../abi" ;
44import type { PriceFeedTreeNode } from "../../base" ;
55import { BaseContract } from "../../base" ;
66import type { GearboxSDK } from "../../GearboxSDK" ;
77import type { PriceFeedState } from "../../state" ;
8- import { bytes32ToString } from "../../utils" ;
98import { PriceFeedRef } from "./PriceFeedRef" ;
109import type { IPriceFeedContract , PriceFeedContractType } from "./types" ;
1110
@@ -25,23 +24,18 @@ export abstract class AbstractPriceFeedContract<
2524 * True if the contract deployed at this address implements IUpdatablePriceFeed interface
2625 */
2726 public readonly updatable : boolean ;
28- public readonly priceFeedType : PriceFeedContractType ;
2927 public readonly decimals : number ;
3028 public readonly underlyingPriceFeeds : PriceFeedRef [ ] ;
3129 public hasLowerBoundCap = false ;
3230
3331 constructor ( sdk : GearboxSDK , args : PriceFeedConstructorArgs < abi > ) {
34- const priceFeedType = bytes32ToString (
35- args . baseParams . contractType as Hex ,
36- ) as PriceFeedContractType ;
3732 super ( sdk , {
3833 abi : args . abi ,
3934 address : args . baseParams . addr ,
4035 name : args . name ,
41- contractType : priceFeedType ,
36+ contractType : args . baseParams . contractType ,
4237 version : Number ( args . baseParams . version ) ,
4338 } ) ;
44- this . priceFeedType = priceFeedType ;
4539 this . decimals = args . decimals ;
4640 this . updatable = args . updatable ;
4741 this . underlyingPriceFeeds = args . underlyingFeeds . map (
@@ -50,6 +44,10 @@ export abstract class AbstractPriceFeedContract<
5044 ) ;
5145 }
5246
47+ public get priceFeedType ( ) : PriceFeedContractType {
48+ return this . contractType as PriceFeedContractType ;
49+ }
50+
5351 public abstract get state ( ) : Omit < PriceFeedState , "stalenessPeriod" > ;
5452
5553 async currentLowerBound ( ) : Promise < bigint > {
0 commit comments