Skip to main content

Plugin Decentralized Oracle Price Feed Python Package

Project description

Plugin Feeds : Python Package

Install

pip install py-plugin-feeds

Example to pull the price CIFI/USDT

from web3 import HTTPProvider, Web3
from py_plugin_feeds import get_token_price

def main():
    json_rpc_url = "https://rpc-amoy.polygon.technology"
    pair = "CIFI/USDT"
    web3 = Web3(HTTPProvider(json_rpc_url))
    web3.middleware_onion.clear()
    result= get_token_price(web3,pair,"latestAnswer")
    print("result:::",result)

if __name__ == "__main__":
    main()

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

py_plugin_feeds-1.0.1.tar.gz (3.0 kB view hashes)

Uploaded Source

Built Distribution

py_plugin_feeds-1.0.1-py3-none-any.whl (3.1 kB view hashes)

Uploaded Python 3

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page