add comment usage get_order_book_changes

This commit is contained in:
Riku
2023-04-18 11:29:13 +02:00
parent 2150095bb7
commit 01febf201c

View File

@@ -186,6 +186,11 @@ async def main() -> int:
balance_changes = get_balance_changes(result.result["meta"])
print(f"Balance Changes:\n{pprint.pformat(balance_changes)}")
# For educational purposes the transaction metadata is analyzed manually in the
# following section. However, there is also a get_order_book_changes(metadata)
# utility function available in the xrpl library, which is generally the easier
# and preferred choice for parsing the metadata and computing orderbook changes.
# Helper to convert an XRPL amount to a string for display
def amt_str(amt) -> str:
if isinstance(amt, str):