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.6.0.tar.gz
Algorithm | Hash digest | |
---|---|---|
SHA256 | 90fb69077c3c2991fa54bc2afe8ea643b74ad46a1111d300865622666c0bec5d |
|
MD5 | e4fe3302e2185b48fb06f955f8258bee |
|
BLAKE2b-256 | 7ef50aaf4fce42278d1fec024ad8811bf8bdec69b2159bec9d77c5dd380a4515 |
Close
Hashes for lightecho_stellar_oracle-1.6.0-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | bd35255701c3056bbd25282b952baea6bba4270315b966f563a2805fcffc8c97 |
|
MD5 | 5c34e1cd9161b44cdfea53c39d661fbe |
|
BLAKE2b-256 | 51eb6da5a885ce1377c8b9f68adaff5642fbd12ed97cdfbc7f40c4fe2f9fc89c |