
Security News
Deno 2.4 Brings Back deno bundle, Improves Dependency Management and Observability
Deno 2.4 brings back bundling, improves dependency updates and telemetry, and makes the runtime more practical for real-world JavaScript projects.
This is a simple Python library to access THORChain nodes. It is asynchronous and uses aiohttp.
v.0.1.0 breaking changes:
v.0.0.21 is hotfix. Port 1317 was disabled, so it is an emergency upgrade to save this lib. More news will be later...
python -m pip install git+https://github.com/tirinox/aiothornode
The following code is quite self-documenting:
import random
from aiothornode.connector import *
from aiothornode.env import *
import asyncio
import aiohttp
def delim():
print('-' * 100)
async def main():
env = MAINNET.copy()
# env = ThorEnvironment(...) # custom
async with aiohttp.ClientSession() as session:
connector = ThorConnector(env, session)
genesis = await connector.query_genesis()
print(f'Chain ID = {genesis["chain_id"]}')
delim()
chains = await connector.query_chain_info()
chains = list(chains.values())
print('Chain info:', chains)
delim()
print('Tendermint Block:')
tender_block = await connector.query_tendermint_block_raw(100001)
block_header = tender_block['result']['block']['header']
print(f'{block_header["height"] = } and {block_header["time"] = }')
delim()
constants = await connector.query_constants()
print(f'Constants: {constants}')
delim()
mimir = await connector.query_mimir()
mimir_1 = mimir.get('MINIMUMBONDINRUNE')
print(f'Mimir: {mimir}, MINIMUMBONDINRUNE = {mimir_1}')
delim()
queue = await connector.query_queue()
print(f'Queue: {queue}')
delim()
node_accounts = await connector.query_node_accounts(consensus=False)
print(f'Example node account: {random.sample(node_accounts, 1)[0]}')
delim()
pool = await connector.query_pool('BNB.BUSD-BD1', height=8218339)
print(pool)
delim()
pools = await connector.query_pools()
print(pools[0])
print(f'Total {len(pools)} pools')
delim()
bank = await connector.query_balance('thor1dheycdevq39qlkxs2a6wuuzyn4aqxhve4qxtxt')
print(f'Balance of {bank.address} is {bank.runes_float} Rune')
delim()
if __name__ == '__main__':
asyncio.run(main())
Install PyTest and an async plugin for it:
pip install pytest
pip install pytest-asyncio
Then run
pytest test
FAQs
THORChain node connection library for Python
We found that aiothornode demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
Deno 2.4 brings back bundling, improves dependency updates and telemetry, and makes the runtime more practical for real-world JavaScript projects.
Security News
CVEForecast.org uses machine learning to project a record-breaking surge in vulnerability disclosures in 2025.
Security News
Browserslist-rs now uses static data to reduce binary size by over 1MB, improving memory use and performance for Rust-based frontend tools.