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.10.0.tar.gz
Algorithm | Hash digest | |
---|---|---|
SHA256 | 2bb91bb77f0d5ac4bcd75f672549ce81b2ca91aa5f14b1a2947b4ddd9b22f4f3 |
|
MD5 | c9f6c3e45a988578934464733159f812 |
|
BLAKE2b-256 | d19835580aad1ba64ba5217b9c55d122e361785cf3b6b7c505549a41f384e665 |
Close
Hashes for lightecho_stellar_oracle-1.10.0-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 93a18bcd340efc2b2d76b7c9e89527a546ba5b20c733a7d337c1f5d6d10cff26 |
|
MD5 | 2495292b9a3031ff7b01c45f6d80904b |
|
BLAKE2b-256 | 23926f459fa2acfef67aafd1c6c2cbe7edd95aeb8f5f952c37b77f10f963967c |