XDRΒΆ

XDR, also known as External Data Representation, is used throughout the Digital World network and protocol. The ledger, transactions, results, history, and even the messages passed between computers running digital-world-core are encoded using XDR.

digital_world_sdk.xdr module provides a complete ability to build and parse XDR.

This example shows how to parse XDR string into an XDR object.

 1"""
 2This example shows how to parse XDR string into an XDR object.
 3But please note that if you need to parse a transaction envelope,
 4please refer to `parse_transaction_envelope.py`
 5"""
 6
 7from digital_world_sdk.xdr import TransactionResult
 8
 9result_xdr = "AAAAAAAAAGQAAAAAAAAAAQAAAAAAAAADAAAAAAAAAAAAAAABAAAAAD/jlpBCTX53ogvts02Ryn5GjO6gx0qW3/3ARB+gOh/nAAAAADGRC/wAAAAAAAAAAU5VQwAAAAAAR74W04RzO2ryJo94Oi0FUs0KHIVQisRnpe9FWrqvumQAAAAAAEFWjwjgcksQkG4uAAAAAAAAAAAAAAAA"
10transaction_result = TransactionResult.from_xdr(result_xdr)
11print(transaction_result.fee_charged)
12print(transaction_result.result.code)