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

Python

PreviousSDKNextPyTEAL

Last updated 2 years ago

The Python SDK allows the integration of FFO into yours off-chain applications:

Example:

Install folks-feed-python-sdk :

pip install git+https://github.com/Folks-Feed-Oracle/folks-feed-python-sdk

Initialize FolksFeedClient:

from folksfeedsdk.folks_feed_client import FolksFeedClient
from folksfeedsdk.constants import TestnetAssetId,ORACLE_TESTNET_ID
from folksfeedsdk.models.asset_info import AssetInfo
from algosdk.v2client.algod import AlgodClient

algod_client = `YOUR ALGOD CLIENT`

ffo_client = FolksFeedClient(algod_client, ORACLE_TESTNET_ID)

Get the asset info (you can find all supported asset feed in constants.py) :

algo_info: AssetInfo = ffo_client.get_asset_info(TestnetAssetId.ALGO)
{
 "asset_name": "ALGO",
 "latest_timestamp": 1668076515,
 "price": 0.28967205,
 "price_threshold": 1.0,
 "raw_price": 28967205
}
GitHub - Folks-Feed-Oracle/folks-feed-python-sdkGitHub
Logo