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.37.0.tar.gz
Algorithm | Hash digest | |
---|---|---|
SHA256 | a7d7a2fce7ab8b6b9d5419d608b2d32ecf6d400062b7b7717afb27b8cc96e39b |
|
MD5 | 3fe2d65d12e0835387a92d9aeb229f2b |
|
BLAKE2b-256 | 48a1ca7e4fde1f6ade44186fd3496f267884d675520a2c351942e70e9c916add |
Close
Hashes for lightecho_stellar_oracle-0.37.0-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | add50b1f1fe27c07a89669b05450a6cdcdcb8cf65e30a80eab9eb1c64134a3da |
|
MD5 | b36833c8c7a91061ee21252d44fa13f2 |
|
BLAKE2b-256 | bfa49ce66d2869c5288ee156d8c2bcca6e2d7b3de2f9d0afd6162abb08b73972 |