Skip to content

Commit 982f542

Browse files
committed
feat: return all main root feeds
1 parent abaebdd commit 982f542

File tree

1 file changed

+15
-0
lines changed

1 file changed

+15
-0
lines changed

src/redstone/api.ts

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -527,10 +527,25 @@ export class RedstoneApi {
527527
},
528528
{},
529529
);
530+
531+
const allMain_Root = st1_MainFeedsUnsafe.reduce<Record<Address, Address>>(
532+
(acc, p, index) => {
533+
const token = allTokens[index][1];
534+
535+
if (!p.error && typeof p.result === "object" && p.result[4] === false) {
536+
const [priceFeed] = p.result;
537+
acc[token] = priceFeed;
538+
}
539+
return acc;
540+
},
541+
{},
542+
);
543+
530544
return {
531545
main: mainPFData,
532546
reserve: reservePFData,
533547
allReserve,
548+
allMain_Root,
534549
};
535550
};
536551

0 commit comments

Comments
 (0)