mirror of
https://github.com/Chia-Network/chia-blockchain.git
synced 2024-11-13 12:09:25 +03:00
c6637455b3
* Added sorting functionality to /get_transactions * Added comment about reversals * Add determinism and clean up reversal * Change default back to 50
13 lines
379 B
Python
13 lines
379 B
Python
import enum
|
|
|
|
|
|
class SortKey(enum.Enum):
|
|
CONFIRMED_AT_HEIGHT = "order by confirmed_at_height {ASC}"
|
|
RELEVANCE = "order by confirmed {ASC}, confirmed_at_height {DESC}, created_at_time {DESC}"
|
|
|
|
def ascending(self) -> str:
|
|
return self.value.format(ASC="ASC", DESC="DESC")
|
|
|
|
def descending(self) -> str:
|
|
return self.value.format(ASC="DESC", DESC="ASC")
|