Skip to content

Commit

Permalink
update script
Browse files Browse the repository at this point in the history
  • Loading branch information
bjartek committed Jul 24, 2024
1 parent e84e439 commit ec99139
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 1 deletion.
1 change: 0 additions & 1 deletion scripts/getFlowToUSD.cdc
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@ access(all) fun main():UFix64? {
for address in feeds.keys {

let name= feeds[address]
// let name = feeds[address]
if name=="FLOW/USD" {
return PublicPriceOracle.getLatestPrice(oracleAddr: address)
}
Expand Down
13 changes: 13 additions & 0 deletions scripts/getProfileTest.cdc
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
//❯ flow scripts execute scripts/getProfileTest.cdc 0x70df6ccc9632a4dd -n migrationnetimport
import "Profile"

access(all) fun main(address: Address) : AnyStruct {
var wallets = getAccount(address).capabilities.borrow<&{Profile.Public}>(Profile.publicPath)?.getWallets() ?? []

for wallet in wallets {
if wallet.name == "USDC" {
return wallet.balance.id
}
}
return nil
}

0 comments on commit ec99139

Please sign in to comment.