Python
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-sdkInitialize 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
}
Last updated