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 XDC/USDT

from web3 import HTTPProvider, Web3
from py_plugin_feeds import get_token_price

def main():
    json_rpc_url = "https:/erpc.xinfin.network"
    pair = "XDC/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()

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()

Example to pull the price PLI/USDT

from web3 import HTTPProvider, Web3
from py_plugin_feeds import get_token_price

def main():
    json_rpc_url = "https:/erpc.xinfin.network"
    pair = "PLI/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()

Pairs available on XDC Mainnet

{
    "CIFI/USDT" : "0xf699C9049B3fF0983bBDCFc115f7E86687a17Ee4",
    "BTC/USDT" : "0x49CD12b8daa769b2fEc36C669b10a0f7bfd352E8",
    "ETH/USDT" : "0xD9B592729c7b7Cbed0A817d4bF2896aB83b01b9E",
    "PRNT/USD" : "0x3Ea54753e3Eb29ce0013C2eb9F57c636037c4f8f",
    "USTY/USD" : "0x607E64B7B72a861440190E3Df8B536CE6380879c",
    "EURS/USDC" : "0xEceC25C2bd99EA806A7aE3e84eDAC69a42a591fe",
    "PLI/USDT" : "0x8F5fcf7f9110A44AC2f55f1a2B6538Df75e4B24b",
    "WTK/USDT" : "0x08477Fab6cEa95df426e7DB1F9042d3BB1558e36",
    "CGO/USDT" : "0xf048DD8CF78504842ADe9af2b5b4c809DCDE819C",
    "FXD/USD" : "0x61Fe25F89FD88510d4de35a4e26BB545872f9F86",
    "XDC/USDT" : "0x896CC6fE8AD04dF9f481332606c445768e286076",
    "PLI/XDC" : "0xc0aD46d667f7d257617de5EDf725BC8059d16bB3",
    "GBEX/USDT" : "0x70d252A13784EA98cB5825c10a025311C4e5b4fe",
    "XSP/USDT" : "0x4A835d097E3432Eccf4F01Cc4cdB8Bb04cFa4Cd4",
    "XTT/USDT" : "0x6733871153Ea1e316dBf0c5193CabcB79840905B"
  }
  

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.6.tar.gz (8.4 kB view details)

Uploaded Source

Built Distribution

py_plugin_feeds-1.0.6-py3-none-any.whl (8.2 kB view details)

Uploaded Python 3

File details

Details for the file py_plugin_feeds-1.0.6.tar.gz.

File metadata

  • Download URL: py_plugin_feeds-1.0.6.tar.gz
  • Upload date:
  • Size: 8.4 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.1.0 CPython/3.12.4

File hashes

Hashes for py_plugin_feeds-1.0.6.tar.gz
Algorithm Hash digest
SHA256 887238fd072a590754cce8442638825ea936a85721367e4c3d36651e4e801a73
MD5 d620c08c69882aeb231d21dfecd63a3e
BLAKE2b-256 8ec1c60c4f9cb5ff1bf07f63725e3bd8be230b3d55aca02c7bbba6347be2b4ed

See more details on using hashes here.

Provenance

File details

Details for the file py_plugin_feeds-1.0.6-py3-none-any.whl.

File metadata

File hashes

Hashes for py_plugin_feeds-1.0.6-py3-none-any.whl
Algorithm Hash digest
SHA256 92e21dbecd1c7a6acc1e4262edc4df7a3baa8acc971b241032ad930c955b152f
MD5 8145231a5a312c32cc28e9174e00158f
BLAKE2b-256 7a5d4d4dec69fb25ac1eb39821ca7d971b6fb65c962f03e8118904b2d7451547

See more details on using hashes here.

Provenance

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