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.26.0.tar.gz
Algorithm | Hash digest | |
---|---|---|
SHA256 | 9b8392d3bb95e825732a5ee79df653cb9fd12a5329f21721ec3eef2633eb605e |
|
MD5 | 33706f80684ddabd6793497237d3faa3 |
|
BLAKE2b-256 | 4562964c592b324cccfda0c3cf6fb46d4986894764d64b818d8385ec06458d5f |
Close
Hashes for lightecho_stellar_oracle-0.26.0-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | e68eabdd01a7aff1f3e2250dae2972bfc79ed609fa089cf951cfe193ce53e4b3 |
|
MD5 | 0a289054e879706e7feb7278a8e0f4a1 |
|
BLAKE2b-256 | 7c600aeef5794d0a06a64958248571b7c69f3f09660d2739175b30c50f8cc155 |