Data Formats
XDR Format
In the Stellar network, transactions are encoded using a standardized protocol called External Data Representation (XDR).
In RPC, you will encounter XDR when simulating and sending transactions, as well as when retrieving transactions, ledgers, and ledger entries.
By default, RPC will return all XDR attributes as the machine-readable base64-encoded string. XDR-encoded response fields are usually suffixed with Xdr
. You can decode this XDR in the Stellar Lab’s XDR page.
JSON Format
All RPC endpoints which return encoded XDR fields accept the xdrFormat
attribute. This allows a client to change the response format to JSON, ultimately making it more human-readable. Note that you should not rely on any schema for the JSON, as it will change when the underlying XDR changes.
In the event that a json
output format is requested, response fields suffixed with Xdr
will be omitted and replaced with their Json
suffixed counterparts.
{
// xdrFormat = 'base64'
"resultMetaXdr": "AAAAAwAAAAAAAAACAAAAAwAWuFYAAAAAAAAAAEBQYAimx5waQHaAptKgy2a/IAHMSe96ETt5wiMOSpKXAAAAF0JZ4rAAACHUAAekYwAAAAAAAAAAAAAAAAAAAAABAAAAAAAAAAAAAAEAAAAAAAAAAAAAAAAAAAAAAAAAAgAAAAAAAAAAAAAAAAAAAAMAAAAAABa4VAAAAABnyjD0AAAAAAAAAAEAFrhWAAAAAAAAAABAUGAIpsecGkB2gKbSoMtmvyABzEnvehE7ecIjDkqSlwAAABdCWeKwAAAh1AAHpGQAAAAAAAAAAAAAAAAAAAAAAQAAAAAAAAAAAAABAAAAAAAAAAAAAAAAAAAAAAAAAAIAAAAAAAAAAAAAAAAAAAADAAAAAAAWuFYAAAAAZ8ow/gAAAAAAAAAAAAAAAAAAAAA=",
// xdrFormat = 'json'
"resultMetaJson": {
"tx": {
"tx": {
"source_account": "GCW2NGRNWISFIXSGCBXPU23GDBAMHIOQOWO52LZWEWNELRC4XDQMDWNT",
"fee": 100,
"seq_num": 58248347706520,
"cond": {
"time": {
"min_time": 0,
"max_time": 1741309515
}
},
"memo": {
"text": "6764203ea0bcd7058f922d32"
},
"operations": [
{
"source_account": null,
"body": {
"payment": {
"destination": "GBZA3UPYFIFXXPH4QPQSFL73TZND7MEN744BLU4DPBR4T2XS526PRRN2",
"asset": "native",
"amount": 635808330
}
}
}
],
"ext": "v0"
},
"signatures": [
{
"hint": "5cb8e0c1",
"signature": "cfcfc8192be1448b6c1e06265bd89b7375fdd818927f5167071d1e4f383522e6968771c91272fc248b4984f3f8c3ea7089396ab63c5dc557a45130c307f1840a"
}
]
}
}
}