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.16.0.tar.gz
Algorithm | Hash digest | |
---|---|---|
SHA256 | 196c72a4ff2f91ddaf88b279c7b4bcf9b3295223ce3754993743445fc1d63868 |
|
MD5 | 9fbdcf00421fa3897ad8e981c3bbcb0d |
|
BLAKE2b-256 | 2b58be1d760308dc1796c351baffabbe08be1c0bf7344bc6bb7cc944d8dcf855 |
Close
Hashes for lightecho_stellar_oracle-1.16.0-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 6e1e91a09ec780135d1065a7ba65ba039d2ca8b32a8e89768426c92909d47f76 |
|
MD5 | 8a6909a6f6ca0399a7aa9a62434d296d |
|
BLAKE2b-256 | 9076c29ecb839ce2d15f8f9e3c227a9ecf9ff685d47bc836e213e7f9ccf1f887 |