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.7.0.tar.gz
Algorithm | Hash digest | |
---|---|---|
SHA256 | d07a7c5fc1fc5b952be870fda7b53326dfd944853bc16747540fb88c9a237ad2 |
|
MD5 | 15d8443e7f51164846757207403064af |
|
BLAKE2b-256 | 55bbf17b9901846ed1816b74b9306db044b3b8e35be3e57bbbb3d64a162d1355 |
Close
Hashes for lightecho_stellar_oracle-1.7.0-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | b8e0f798f1f6cae1988e4a8e6b50569f38d8db1a8c8738707c1ab7b83f043617 |
|
MD5 | ff1bd147c4726a96867546d6795e54e5 |
|
BLAKE2b-256 | 41c9f4f698e5e26703ad5ea30559389cbd61ce28dde0e79b8b3f9b4b3d43ead4 |