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.10.0.tar.gz
Algorithm | Hash digest | |
---|---|---|
SHA256 | bb7f851dd8dd09d4daf399504fc3d64319cab1f45ab6dd0d2ec86d3cdd239884 |
|
MD5 | 1d3a31bf92db322f19acbd36d6f46397 |
|
BLAKE2b-256 | 1c6ad82b46afcf268aa4a9d2668ec468eec1ba90e2dcf4a4866ced5f0552edac |
Close
Hashes for lightecho_stellar_oracle-0.10.0-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | ea5819d85305223f30fffc09edfecc2246f1a6740182d8d823a5e4da71a248e7 |
|
MD5 | 9e231dcf96c22358d0d571e72bcccb68 |
|
BLAKE2b-256 | b0b49a5d1845ab9fc567764db766cd9153ec89acb0e5a265d5637e33f967d8bf |