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.13.0.tar.gz
Algorithm | Hash digest | |
---|---|---|
SHA256 | da8a786b3180db0a003f52ac4bb562bde72f2c5455e890a8b253718f12a8d7b0 |
|
MD5 | 13d5b9e7f8914b17946a8610a5afb0ae |
|
BLAKE2b-256 | 5c6c39196bd47479d1a4879e3cc674a4767ebdd5d53a86c1a3de8a787bbfbf15 |
Close
Hashes for lightecho_stellar_oracle-1.13.0-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | eda468347412145144eb7596a57f61c5c80817e7d55e44f540e12d2bb54c44fb |
|
MD5 | bf0344e74dc6a8f9eff633c81d59f909 |
|
BLAKE2b-256 | 815f963918f86b04413b4574e1b128e4aaf9ab9e691cfa12306f6b251c42e845 |