Skip to content

Commit 2a23773

Browse files
committed
2.0.0 - Major objects overhaul, fixes, + full market support
- Overhauled all objects in `privex.steemengine.objects` - converted to dataclasses using `DictDataClass`, with various dynamic properties allowing querying related data via `SteemEngineToken`. Every single object was refactored, so I'm not going to go into details on each class that was refactored. - Added several new objects to `privex.steemengine.objects` - as dataclasses using `DictDataClass`. - Added `SteemEngineToken.native_coin` and `SteemEngineToken.native_token`, to track the native market symbol of the network, e.g. `SWAP.HIVE` / `STEEMP`. - Added new method `SteemEngineToken.place_order` which allows placing orders on the Steem/Hive Engine market, returning the `SEPlacedOrder` dictclass object, which allows easily referencing the Steem/Hive Engine transaction object, and the trades which fulfilled the order. - Rebased exceptions in `privex.steemengine.exceptions` to use base class `SteemEngineException` - Added new exceptions `NoResults` and `NoSteemEngineInstance` - Added `r_cache` caching to various methods in `SteemEngineToken` for data which doesn't change often. - Changed default indexes to `[]` (empty list) for query methods in SteemEngineToken, as a lot of indexes do not work on HiveEngine. - Refactored the base functionality of `order_history` into `query_order_history` to simplify non-symbol queries in other methods - Added new methods `SteemEngineToken.find_fulfilled_sells`, `SteemEngineToken.find_fulfilled_buys`, and `SteemEngineToken.find_fulfilled` which query using the new `sellTxId` / `buyTxId` keys - Some improvements to the unit tests - Various other small changes
1 parent 1bf8bbb commit 2a23773

File tree

7 files changed

+722
-203
lines changed

7 files changed

+722
-203
lines changed

.gitignore

+1
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@ __pycache__
44
.idea
55
.vscode
66
.pytest_cache
7+
.env
78

89
# PyPi build files
910
build

privex/steemengine/SteemEngineToken.py

+246-40
Large diffs are not rendered by default.

privex/steemengine/__init__.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
import sys
33
from privex.steemengine.SteemEngineToken import SteemEngineToken
44
from privex.steemengine.SteemEngineHistory import SteemEngineHistory
5-
from privex.steemengine.objects import Token, TokenMetadata, SEBalance, SETransaction, ObjBase
5+
from privex.steemengine.objects import *
66

77
name = 'steemengine'
88

privex/steemengine/exceptions.py

+15-6
Original file line numberDiff line numberDiff line change
@@ -37,17 +37,26 @@
3737
"""
3838

3939

40-
class TokenNotFound(BaseException):
40+
class SteemEngineException(Exception):
41+
"""Base exception for all :mod:`privex.steemengine` exceptions"""
42+
43+
44+
class TokenNotFound(SteemEngineException):
4145
"""The token requested doesn't exist"""
42-
pass
4346

4447

45-
class AccountNotFound(BaseException):
48+
class AccountNotFound(SteemEngineException):
4649
"""The Steem account requested doesn't exist"""
47-
pass
4850

4951

50-
class NotEnoughBalance(BaseException):
52+
class NotEnoughBalance(SteemEngineException):
5153
"""Not enough token/steem/sbd balance for this operation"""
52-
pass
54+
55+
56+
class NoResults(SteemEngineException):
57+
"""The server returned an empty response such as ``None`` ..."""
58+
59+
60+
class NoSteemEngineInstance(SteemEngineException):
61+
"""Raised when :attr:`._seng_instance` on a :class:`.SteemEngineInstanceInject` based object is ``None``"""
5362

0 commit comments

Comments
 (0)