Folks Feed Oracle
  • Introduction
  • FOLKS FEED ORACLE
    • Overview
    • Server
    • Provider
    • Smart contract
  • Developers
    • Introduction
    • SDK
      • Python
      • PyTEAL
    • Contract
    • Feeds
  • OTHERS
    • Socials
    • Brand assets
    • Make a request
    • Glossary
Powered by GitBook
On this page
  1. Developers
  2. SDK

PyTEAL

The oracle app id may change in the future, we will keep the same data structure for reading prices.

Just a simple subroutine for integration into ASC1:

ARC-4 Compliant Subroutine:

@Subroutine(TealType.uint64)
def get_asset_price(folks_feed_oracle: abi.Application, asa_id: abi.Asset):
    asa_info = App.globalGetEx(folks_feed_oracle.application_id(), Itob(asa_id.asset_id()))
    return Seq(asa_info, Assert(asa_info.hasValue()), ExtractUint64(asa_info.value(), Int(0)))
PreviousPythonNextContract

Last updated 2 years ago