Skip to content

Commit e27af6e

Browse files
committed
fix: add usesPriceFeed method to oracle
1 parent 91bf6d0 commit e27af6e

File tree

1 file changed

+11
-0
lines changed

1 file changed

+11
-0
lines changed

src/sdk/market/PriceOracleBaseContract.ts

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -180,6 +180,17 @@ export class PriceOracleBaseContract<abi extends Abi | readonly unknown[]>
180180
return result;
181181
}
182182

183+
/**
184+
* Returns true if oracle's price feed tree contains given price feed
185+
* @param priceFeed
186+
* @returns
187+
*/
188+
public usesPriceFeed(priceFeed: Address): boolean {
189+
return this.#priceFeedTree.some(
190+
node => node.baseParams.addr.toLowerCase() === priceFeed.toLowerCase(),
191+
);
192+
}
193+
183194
/**
184195
* Tries to convert amount of token into underlying of current market
185196
* @param token

0 commit comments

Comments
 (0)