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.22.0.tar.gz
Algorithm | Hash digest | |
---|---|---|
SHA256 | 49dd1a79cb83c9c60173fc3437f4ae089cd0b7cb5386cd5bd4c756b1699664e1 |
|
MD5 | 544d01c741e9ff484561dea7362eb849 |
|
BLAKE2b-256 | ff1e6181e5983f298b938bce0c2c08b67add3bcb2ee20ca4b1834cae219f0e29 |
Close
Hashes for lightecho_stellar_oracle-0.22.0-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 117c215c94b9ba0bcf7ee2a95d67141b556214031e4ef59d2104add72dafe933 |
|
MD5 | f0dca2779626162405dd2e9cfcb5dfaf |
|
BLAKE2b-256 | ce27413dad27d3a15c5f086d7b2453a784cb60fe366fd57602819ca024cf154b |