Skip to main content

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.

Metadata

Release files for lightecho_stellar_oracle 2.0.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for lightecho_stellar_oracle 2.0.0
File Size Uploaded
lightecho_stellar_oracle-2.0.0.tar.gz 7.7 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for lightecho_stellar_oracle 2.0.0
File Interpreter ABI Platform
lightecho_stellar_oracle-2.0.0-py3-none-any.whl Python 3 none any Details

Total release size: 15.5 kB

Release files / lightecho_stellar_oracle-2.0.0.tar.gz

Download URL lightecho_stellar_oracle-2.0.0.tar.gz
Size 7.7 kB
Tags Source
SHA-256 checksum
How to use checksums
d55e2a54397e2241084eb8463f9919c21899e794632d70ef880cedb3447cfbeb
BLAKE2b-256 checksum
How to use checksums
cea731d7f00604486a83483bd65539334371ffcb8404d1b3c5f49c8a8555a02d
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via poetry/1.7.1 CPython/3.12.4 Linux/6.10.3-200.fc40.x86_64

Release files / lightecho_stellar_oracle-2.0.0-py3-none-any.whl

Download URL lightecho_stellar_oracle-2.0.0-py3-none-any.whl
Size 7.8 kB
Tags Python 3
SHA-256 checksum
How to use checksums
da9a53636fcce893bcfa6e609a14d73b620ae4a880fa2a99938ae0ef91295a91
BLAKE2b-256 checksum
How to use checksums
4eb3e85c0ce8ca5165eb144110a4e7e13042880408a854359e0429a7c6f4fcd4
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via poetry/1.7.1 CPython/3.12.4 Linux/6.10.3-200.fc40.x86_64

Release history Release notifications | RSS feed

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page