Skip to content

Commit

Permalink
Add xdrFormat parameter to all applicable RPC endpoint inputs (#1367)
Browse files Browse the repository at this point in the history
  • Loading branch information
Shaptic authored Mar 7, 2025
1 parent 87feb33 commit 7b940f3
Show file tree
Hide file tree
Showing 7 changed files with 72 additions and 16 deletions.
3 changes: 3 additions & 0 deletions openrpc/src/stellar-rpc/methods/getLedgerEntries.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,9 @@
"params": [
{
"$ref": "#/components/contentDescriptors/LedgerKeys"
},
{
"$ref": "#/components/contentDescriptors/Format"
}
],
"result": {
Expand Down
3 changes: 3 additions & 0 deletions openrpc/src/stellar-rpc/methods/getLedgers.json
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,9 @@
},
{
"$ref": "#/components/contentDescriptors/TransactionsPagination"
},
{
"$ref": "#/components/contentDescriptors/Format"
}
],
"result": {
Expand Down
3 changes: 3 additions & 0 deletions openrpc/src/stellar-rpc/methods/getTransaction.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,9 @@
"params": [
{
"$ref": "#/components/contentDescriptors/TransactionHash"
},
{
"$ref": "#/components/contentDescriptors/Format"
}
],
"result": {
Expand Down
3 changes: 3 additions & 0 deletions openrpc/src/stellar-rpc/methods/getTransactions.json
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,9 @@
},
{
"$ref": "#/components/contentDescriptors/TransactionsPagination"
},
{
"$ref": "#/components/contentDescriptors/Format"
}
],
"result": {
Expand Down
3 changes: 3 additions & 0 deletions openrpc/src/stellar-rpc/methods/simulateTransaction.json
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,9 @@
},
{
"$ref": "#/components/contentDescriptors/ResourceConfig"
},
{
"$ref": "#/components/contentDescriptors/Format"
}
],
"result": {
Expand Down
6 changes: 1 addition & 5 deletions openrpc/src/stellar-rpc/schemas/Format.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,6 @@
"Format": {
"title": "xdrFormat",
"type": "string",
"oneOf": [
{ "name": "json", "type": "string"},
{ "name": "base64", "type": "string"}
],
"description": "A string which indicates whether the response should be decoded to json or return the base64 encoded xdr strings."
"description": "Specifies whether XDR should be encoded as Base64 (default or 'base64') or JSON ('json')."
}
}
67 changes: 56 additions & 11 deletions static/stellar-rpc.openrpc.json
Original file line number Diff line number Diff line change
Expand Up @@ -138,17 +138,7 @@
"schema": {
"title": "xdrFormat",
"type": "string",
"oneOf": [
{
"name": "json",
"type": "string"
},
{
"name": "base64",
"type": "string"
}
],
"description": "A string which indicates whether the response should be decoded to json or return the base64 encoded xdr strings."
"description": "Specifies whether XDR should be encoded as Base64 (default or 'base64') or JSON ('json')."
}
}
],
Expand Down Expand Up @@ -707,6 +697,17 @@
"description": "Ledger key, serialized as a base64 string, corresponding to an existing ledger entry you wish to retrieve."
}
}
},
{
"name": "xdrFormat",
"summary": "chooses a response format for XDR fields: 'json' or 'base64'",
"required": false,
"description": "Lets the user choose the format in which the response should be returned - either as unpacked JSON or as base64-encoded XDR strings. Note that you should not rely on any schema for the JSON, as it will change when the underlying XDR changes.",
"schema": {
"title": "xdrFormat",
"type": "string",
"description": "Specifies whether XDR should be encoded as Base64 (default or 'base64') or JSON ('json')."
}
}
],
"result": {
Expand Down Expand Up @@ -883,6 +884,17 @@
}
}
}
},
{
"name": "xdrFormat",
"summary": "chooses a response format for XDR fields: 'json' or 'base64'",
"required": false,
"description": "Lets the user choose the format in which the response should be returned - either as unpacked JSON or as base64-encoded XDR strings. Note that you should not rely on any schema for the JSON, as it will change when the underlying XDR changes.",
"schema": {
"title": "xdrFormat",
"type": "string",
"description": "Specifies whether XDR should be encoded as Base64 (default or 'base64') or JSON ('json')."
}
}
],
"result": {
Expand Down Expand Up @@ -1074,6 +1086,17 @@
"pattern": "^[a-f\\d]{64}$",
"description": "Transaction hash (as a hex-encoded string)"
}
},
{
"name": "xdrFormat",
"summary": "chooses a response format for XDR fields: 'json' or 'base64'",
"required": false,
"description": "Lets the user choose the format in which the response should be returned - either as unpacked JSON or as base64-encoded XDR strings. Note that you should not rely on any schema for the JSON, as it will change when the underlying XDR changes.",
"schema": {
"title": "xdrFormat",
"type": "string",
"description": "Specifies whether XDR should be encoded as Base64 (default or 'base64') or JSON ('json')."
}
}
],
"result": {
Expand Down Expand Up @@ -1271,6 +1294,17 @@
}
}
}
},
{
"name": "xdrFormat",
"summary": "chooses a response format for XDR fields: 'json' or 'base64'",
"required": false,
"description": "Lets the user choose the format in which the response should be returned - either as unpacked JSON or as base64-encoded XDR strings. Note that you should not rely on any schema for the JSON, as it will change when the underlying XDR changes.",
"schema": {
"title": "xdrFormat",
"type": "string",
"description": "Specifies whether XDR should be encoded as Base64 (default or 'base64') or JSON ('json')."
}
}
],
"result": {
Expand Down Expand Up @@ -1797,6 +1831,17 @@
}
}
}
},
{
"name": "xdrFormat",
"summary": "chooses a response format for XDR fields: 'json' or 'base64'",
"required": false,
"description": "Lets the user choose the format in which the response should be returned - either as unpacked JSON or as base64-encoded XDR strings. Note that you should not rely on any schema for the JSON, as it will change when the underlying XDR changes.",
"schema": {
"title": "xdrFormat",
"type": "string",
"description": "Specifies whether XDR should be encoded as Base64 (default or 'base64') or JSON ('json')."
}
}
],
"result": {
Expand Down

0 comments on commit 7b940f3

Please sign in to comment.