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.2.0.tar.gz
Algorithm | Hash digest | |
---|---|---|
SHA256 | f7a30719d58f206cc8cb2f9832dbf47439823c46b4d05754903356223f18c771 |
|
MD5 | 2660bc063fcd51e3252afbba432ff376 |
|
BLAKE2b-256 | df79f9e2a213dd38f80c1322485579506ddece3c3dfd3b369e1088eeb2d2dfd0 |
Close
Hashes for lightecho_stellar_oracle-1.2.0-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | e69b24f13f0a6ee4b78330da6e2fc2ddc56759e1c939c7ad0f9723091dcfc946 |
|
MD5 | 28644905bc71703ef1bfa2b65bbfa9b3 |
|
BLAKE2b-256 | 000749ad08d8c590c134050d36275ea2de70ff1bc2c722f6d96caf0a7d4428a4 |