Skip to main content

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


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

lightecho_stellar_oracle-2.0.0.tar.gz (7.7 kB view details)

Uploaded Source

Built Distribution

lightecho_stellar_oracle-2.0.0-py3-none-any.whl (7.8 kB view details)

Uploaded Python 3

File details

Details for the file lightecho_stellar_oracle-2.0.0.tar.gz.

File metadata

  • Download URL: lightecho_stellar_oracle-2.0.0.tar.gz
  • Upload date:
  • Size: 7.7 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/1.7.1 CPython/3.12.4 Linux/6.10.3-200.fc40.x86_64

File hashes

Hashes for lightecho_stellar_oracle-2.0.0.tar.gz
Algorithm Hash digest
SHA256 d55e2a54397e2241084eb8463f9919c21899e794632d70ef880cedb3447cfbeb
MD5 2543a44050c931bb20e73ea0fd7f7450
BLAKE2b-256 cea731d7f00604486a83483bd65539334371ffcb8404d1b3c5f49c8a8555a02d

See more details on using hashes here.

File details

Details for the file lightecho_stellar_oracle-2.0.0-py3-none-any.whl.

File metadata

File hashes

Hashes for lightecho_stellar_oracle-2.0.0-py3-none-any.whl
Algorithm Hash digest
SHA256 da9a53636fcce893bcfa6e609a14d73b620ae4a880fa2a99938ae0ef91295a91
MD5 31dc15061ea175f03841a86c31844a5d
BLAKE2b-256 4eb3e85c0ce8ca5165eb144110a4e7e13042880408a854359e0429a7c6f4fcd4

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page