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.20.0.tar.gz
Algorithm | Hash digest | |
---|---|---|
SHA256 | 7189af0c608c5465355f13c3237e70f91bcb1087d6a43894472b8d7a5b4e3846 |
|
MD5 | 18cefc4dab449834141fe629a84de5b9 |
|
BLAKE2b-256 | 1d9fdde124803f5df5c855bb8744790738c11d2d4df19118458af1ece0a566ae |
Close
Hashes for lightecho_stellar_oracle-0.20.0-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 454e835fa0fd4bf10d275147cf555ff39e868d4ffc0f6f3be9ba57f08abd4505 |
|
MD5 | b465c88ab718f3bde0ea1ed6e765598c |
|
BLAKE2b-256 | 4555b28d6304c2e79a8e5fc59e4f32121bc827a09d06aa5c80390593bce3f717 |