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-1.5.1.tar.gz
Algorithm | Hash digest | |
---|---|---|
SHA256 | 80cae67d57462bc556a9019201b0f0516c8204a5afc388ad7cf56e16a9840566 |
|
MD5 | fc4c93bf768431cf5c29c080022a995e |
|
BLAKE2b-256 | 9bc5d7eec91bb43552227f539428f6df8a9613799eefdfefabfff76e1d2d750c |
Close
Hashes for lightecho_stellar_oracle-1.5.1-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | be7852ffa105fc50325672bc977f288262529fe7a714fbeeaf47a567f56a5dd4 |
|
MD5 | 8b82cf8651c344813f10b53961a61908 |
|
BLAKE2b-256 | 032f7fb57f923695d7c82a59d1e0d5c633a65ed462659650a361d2b96d732ce4 |