Skip to content

Commit b88b421

Browse files
authored
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.
1 parent 2d6faac commit b88b421

35 files changed

+1763
-465
lines changed

.github/workflows/codeql.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ jobs:
3232
go-version: 1.22
3333
- run: rustup update
3434
- uses: stellar/actions/rust-cache@main
35-
- run: make build-libpreflight
35+
- run: make build-libs
3636

3737
# Initializes the CodeQL tools for scanning.
3838
- name: Initialize CodeQL

.github/workflows/golang.yml

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -30,15 +30,11 @@ jobs:
3030
- name: Build libpreflight
3131
run: |
3232
rustup update
33-
make build-libpreflight
33+
make build-libs
3434
3535
- name: Run golangci-lint
3636
uses: golangci/golangci-lint-action@a4f60bb28d35aeee14e6880718e0c85ff1882e64 # version v6.0.1
3737
with:
3838
version: v1.59.1 # this is the golangci-lint version
3939
github-token: ${{ secrets.GITHUB_TOKEN }}
4040
only-new-issues: true
41-
42-
43-
44-

.github/workflows/soroban-rpc.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ jobs:
3131
- uses: ./.github/actions/setup-go
3232
- run: rustup update
3333
- uses: stellar/actions/rust-cache@main
34-
- run: make build-libpreflight
34+
- run: make build-libs
3535
- run: go test -race -timeout 25m ./cmd/soroban-rpc/...
3636

3737
build:
@@ -79,7 +79,7 @@ jobs:
7979
rustup target add ${{ matrix.rust_target }}
8080
rustup update
8181
- uses: stellar/actions/rust-cache@main
82-
- run: make build-libpreflight
82+
- run: make build-libs
8383
env:
8484
CARGO_BUILD_TARGET: ${{ matrix.rust_target }}
8585

@@ -168,7 +168,7 @@ jobs:
168168
169169
- run: rustup update
170170
- uses: stellar/actions/rust-cache@main
171-
- run: make build-libpreflight
171+
- run: make build-libs
172172

173173
- name: Run Soroban RPC Integration Tests
174174
run: |

0 commit comments

Comments
 (0)