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.11.0.tar.gz
Algorithm | Hash digest | |
---|---|---|
SHA256 | f6b03ba11f0e2e926c17d8cf66ac70627e50b1e8ebfec575b47f6a614c5af856 |
|
MD5 | 54da90d79d473110d753e5ecc96490b4 |
|
BLAKE2b-256 | 40366b7277bb3c3c5d3940712e10d706af1f6250075337f63ed74c4335542d2a |
Close
Hashes for lightecho_stellar_oracle-0.11.0-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 3fa1e033d22f9b2f7afc805fe9e799578fc1e3840a04b7c85ef912542f8b3dca |
|
MD5 | 3537a80f1d3dbae45c3223dfbaff474b |
|
BLAKE2b-256 | 7b72a243451023025c8afaffe9d84abdb69f6302a0bb495a8be8d90026a04674 |