Python SDK for the Lightecho Stellar Oracle
Project description
Python SDK for the Lightecho Stellar Oracle
pip install lightecho_stellar_oracle
Example:
from lightecho_stellar_oracle import OracleClient, TESTNET_CONTRACT_XLM
from stellar_sdk.keypair import Keypair
oracle_client = OracleClient(
contract_id=TESTNET_CONTRACT_XLM,
signer=Keypair.from_secret("SAES4O3NXUE2CPIB7YH3O5ROAONADPZRXOEYFC4JPLNY6STOBM2RYLGH"),
network="testnet",
)
# list the assets
print(oracle_client.assets())
# show the base Currency
print(oracle_client.base())
# get the last price
tx_id, result = oracle_client.lastprice("other", "USD")
print(tx_id)
print(result)
# Printing the updated result
print(result)
#RESULT
#{'price': 0.11, 'timestamp': 1698240296}
For more information see https://github.com/bp-ventures/lightecho-stellar-oracle.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Close
Hashes for lightecho_stellar_oracle-0.12.0.tar.gz
Algorithm | Hash digest | |
---|---|---|
SHA256 | 464a6999e2aece841895d28c92991c0ba3248c491697a304a4bb29d8308e55bc |
|
MD5 | d5f53648344e1782ce055ae681824314 |
|
BLAKE2b-256 | 3d28ff3d328860d927bba790aa4c3a7f845bd5e2ef9fe6d8dcaf50b66c094d83 |
Close
Hashes for lightecho_stellar_oracle-0.12.0-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 6b5aed41b87b79853ae52f08560a375bbded409df0eae174972a3cd6abf462fe |
|
MD5 | 79ca95511a1aaf982e1a040a958446bf |
|
BLAKE2b-256 | 064ce35a948168273a30b0e9aeaac43b22fedb19b81ba34ea8f4aaf037c899b8 |