2.0.0 - New features (e.g. stream_blocks) + various improvements
2.0.0 - New features (e.g. stream_blocks) + various improvements
- Fixed issue with reusing httpx.AsyncClient - now makes a fresh AsyncClient for each call, instead of re-using the same client for the instance (which causes issues).
- Methods which use AsyncClient - now use it in a context manager (async with)
- Added ability to adjust the configuration for HTTPX, including kwargs
timeout
andhttp2
, and master config dicthttpx_config
- Fixed
get_accounts
by addingkey_sbd
andkey_steem
attributes, which control whether balance keys are referred to by steem/sbd, hive/hbd, or something else. The attributes are auto-adjusted depending on yournetwork
choice, but you can also specify key_sbd/steem as kwargs to manually override it. - Added comments to every public method (afaik)
- Added new
stream_blocks
method, which allows you to stream newly produced blocks via an async generator, either using a block limit (stop after X blocks), or using thestop_streaming
method to abort an indefinite block stream. - Fixed HTTPError handling in json_call, so that it doesn't break if
.request
/.response
are missing from the exception. - Added
relative_head_block
method, which gets you the head block, and relative block numbers from the head based on thediffs
you specify (e.g.-100
will get you the block number 100 blocks before head). - Added relative block support to
get_blocks
, so you can query for e.g. 100 blocks before head until head. - Added
get_blocks_solo
which is similar toget_blocks
- it makes bulk RPC calls for getting blocks, but unlike get_blocks, it doesn't chunk the requests - it sends them only to a single node in one request. - Updated all
objects
fromDictable
to the modernDictDataClass
- Added
raw_data
field toAccount
- Added
hbd_balance
andsavings_hbd_balance
toAccount
, with a post init function to handle copying raw_data HBD balances into the SBD balance attributes if detected. - Overhauled unit tests
- Moved tests from
tests.py
intotests/
folder, withtest_appbase
andtest_legacy
modules - Converted the unit tests from class-based unit tests using the hacky
async_sync
decorator, to function-based unit tests which usepytest-asyncio
for more native and clean asyncio unit testing. - General cleanup of testing.
- Moved tests from
- Added a
Pipfile
for setting up a dev environment withpipenv
- Updated the requirements in setup.py + excluded tests files from the package
- Probably some other nice things which I forgot to mention :)