Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Support JSON output for XDR structures across all endpoints.
Add support for base64-encoded XDR fields to be returned as unpacked JSON. # Details The following endpoints have a new, optional request parameter, `xdrFormat?: ""|"base64"|"json"`: * `getTransaction` * `getTransactions` * `getLedgerEntry` * `getLedgerEntries` * `getEvents` * `sendTransaction` * `simulateTransaction` When omitted, the behavior does not change and we encode fields as base64. # New Response Fields There are new field names for the JSONified versions of XDR structures. Any field with an `Xdr` suffix (e.g., `resultXdr` in `getTransaction()`) will be replaced with one that has a `Json` suffix (e.g., `resultJson`) that is a JSON object verbosely and completely describing the XDR structure. Certain XDR-encoded fields do not have an `Xdr` suffix, but those also have a `*Json` equivalent and are listed below: * _getEvents_: `topic` -> `topicJson`, `value` -> `valueJson` * _getLedgerEntries_: `key` -> `keyJson`, `xdr` -> `dataJson` * _getLedgerEntry_: `xdr` -> `entryJson` * _simulateTransaction_: `transactionData`, `events`, `results.auth`, `restorePreamble.transactionData`, `stateChanges.key|before|after` all have a `Json` suffix, and `results.xdr` is now `results.returnValueJson` Closes #124.
- Loading branch information