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.1.0.tar.gz
Algorithm | Hash digest | |
---|---|---|
SHA256 | f7d10bf46f411aa14cea04e99cfe635740959d6ced35364cc57d5b433956fbcc |
|
MD5 | cb4805ba7c38fa03bfd7fae32325fd10 |
|
BLAKE2b-256 | 7c24ccab1ecf04c7c270fb922c8dd4249f5214a83fc13af961e8646f7d625c65 |
Close
Hashes for lightecho_stellar_oracle-1.1.0-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 21639f9ef31feee29dbcdb2298f0e099b558bf1295db6edeea0dd4310342e190 |
|
MD5 | e8d1d7ce496cfae7c207a2841c30bb5a |
|
BLAKE2b-256 | 93a7d89412b838aa3b4a04139e99488f97437f10573c29786eb0d1bc6e6cdd42 |