updatePrice

As its explained in the WhitePaper , your price is pushed to each dataBlock, and it will be expired every 10 seconds, so we recoment every validator set their price update every 10 seconds maxium for a better price setup.

import FlowPricesOracle from 0x0510d2fd5ef24ae0

transaction(newPrice: UFix64,cryptoSymbol: String) {

  prepare(acct: AuthAccount) {
    let validatorRef = acct.getCapability(FlowPricesOracle.validatorPrivatePath).borrow<&AnyResource{FlowPricesOracle.validatorInterface}>() ?? panic("coould not borrow validator reference")
    validatorRef.updatePrice(cryptoSymbol: cryptoSymbol, value: newPrice)
  }

  execute {
    
  }
}

Last updated