We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent e27af6e commit c44c97eCopy full SHA for c44c97e
src/sdk/market/MarketRegister.ts
@@ -196,7 +196,17 @@ export class MarketRegister extends SDKConstruct {
196
return market;
197
}
198
199
- throw new Error(`cannot find price oracle ${address}`);
+ throw new Error(`cannot find market for price oracle ${address}`);
200
+ }
201
+
202
+ public async findByPool(address: Address): Promise<MarketSuite> {
203
+ const addr = address.toLowerCase();
204
+ for (const market of this.markets) {
205
+ if (market.pool.pool.address.toLowerCase() === addr) {
206
+ return market;
207
208
209
+ throw new Error(`cannot find market for pool ${address}`);
210
211
212
public get marketsMap() {
0 commit comments