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.8.0.tar.gz
Algorithm | Hash digest | |
---|---|---|
SHA256 | d12fd4416767bc579c70e7fb2c62da6e4e63d748eeff0a19c6899f8f85b152d5 |
|
MD5 | 698f68e47cdd867b898d051f248d0ae1 |
|
BLAKE2b-256 | 86105588fdccc7240d4d162940ba60c750cc62494ea4dbe28daec130a06b0f76 |
Close
Hashes for lightecho_stellar_oracle-1.8.0-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 04b62e8c0beea1eb6e071e3f0e72ef455f8975e44df9a607c72029788a2ef1ea |
|
MD5 | 6da4c3d1229096bcafd370364daba033 |
|
BLAKE2b-256 | 306be4e1c17cd588455c9d4460eaefa7700969b4efdb436dcd3dcceea2e657ac |