Skip to content

Commit

Permalink
2.0.0 - Major objects overhaul, fixes, + full market support
Browse files Browse the repository at this point in the history
 - 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
  • Loading branch information
Someguy123 committed Jun 27, 2020
1 parent 1bf8bbb commit 2a23773
Show file tree
Hide file tree
Showing 7 changed files with 722 additions and 203 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ __pycache__
.idea
.vscode
.pytest_cache
.env

# PyPi build files
build
Expand Down
286 changes: 246 additions & 40 deletions privex/steemengine/SteemEngineToken.py

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion privex/steemengine/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
import sys
from privex.steemengine.SteemEngineToken import SteemEngineToken
from privex.steemengine.SteemEngineHistory import SteemEngineHistory
from privex.steemengine.objects import Token, TokenMetadata, SEBalance, SETransaction, ObjBase
from privex.steemengine.objects import *

name = 'steemengine'

Expand Down
21 changes: 15 additions & 6 deletions privex/steemengine/exceptions.py
Original file line number Diff line number Diff line change
Expand Up @@ -37,17 +37,26 @@
"""


class TokenNotFound(BaseException):
class SteemEngineException(Exception):
"""Base exception for all :mod:`privex.steemengine` exceptions"""


class TokenNotFound(SteemEngineException):
"""The token requested doesn't exist"""
pass


class AccountNotFound(BaseException):
class AccountNotFound(SteemEngineException):
"""The Steem account requested doesn't exist"""
pass


class NotEnoughBalance(BaseException):
class NotEnoughBalance(SteemEngineException):
"""Not enough token/steem/sbd balance for this operation"""
pass


class NoResults(SteemEngineException):
"""The server returned an empty response such as ``None`` ..."""


class NoSteemEngineInstance(SteemEngineException):
"""Raised when :attr:`._seng_instance` on a :class:`.SteemEngineInstanceInject` based object is ``None``"""

Loading

0 comments on commit 2a23773

Please sign in to comment.