Skip to content

Commit

Permalink
add script to get flow in usd
Browse files Browse the repository at this point in the history
  • Loading branch information
bjartek committed Aug 6, 2024
1 parent c6321c2 commit 212c533
Showing 1 changed file with 15 additions and 0 deletions.
15 changes: 15 additions & 0 deletions scripts/getFlowToUSD.cdc
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
import "PublicPriceOracle"

access(all) fun main():UFix64? {

let feeds = PublicPriceOracle.getAllSupportedOracles()
for address in feeds.keys {

let name= feeds[address]
if name=="FLOW/USD" {
return PublicPriceOracle.getLatestPrice(oracleAddr: address)
}

}
return nil
}

0 comments on commit 212c533

Please sign in to comment.