Skip to content

Commit 7442d5e

Browse files
intelliotBronek
authored andcommitted
docs: clean up API-CHANGELOG.md (XRPLF#5064)
Move the newest information to the top, i.e., use reverse chronological order within each of the two sections ("API Versions" and "XRP Ledger server versions")
1 parent 9eca277 commit 7442d5e

File tree

1 file changed

+74
-88
lines changed

1 file changed

+74
-88
lines changed

API-CHANGELOG.md

+74-88
Original file line numberDiff line numberDiff line change
@@ -8,23 +8,86 @@ The API version controls the API behavior you see. This includes what properties
88

99
For a log of breaking changes, see the **API Version [number]** headings. In general, breaking changes are associated with a particular API Version number. For non-breaking changes, scroll to the **XRP Ledger version [x.y.z]** headings. Non-breaking changes are associated with a particular XRP Ledger (`rippled`) release.
1010

11-
## API Version 1
11+
## API Version 2
12+
13+
API version 2 is available in `rippled` version 2.0.0 and later. To use this API, clients specify `"api_version" : 2` in each request.
14+
15+
#### Removed methods
1216

13-
This version is supported by all `rippled` versions. At time of writing, it is the default API version, used when no `api_version` is specified. When a new API version is introduced, the command line interface will default to the latest API version. The command line is intended for ad-hoc usage by humans, not programs or automated scripts. The command line is not meant for use in production code.
17+
In API version 2, the following deprecated methods are no longer available: (https://github.com/XRPLF/rippled/pull/4759)
18+
19+
- `tx_history` - Instead, use other methods such as `account_tx` or `ledger` with the `transactions` field set to `true`.
20+
- `ledger_header` - Instead, use the `ledger` method.
1421

15-
### Idiosyncrasies
22+
#### Modifications to JSON transaction element in V2
23+
24+
In API version 2, JSON elements for transaction output have been changed and made consistent for all methods which output transactions. (https://github.com/XRPLF/rippled/pull/4775)
25+
This helps to unify the JSON serialization format of transactions. (https://github.com/XRPLF/clio/issues/722, https://github.com/XRPLF/rippled/issues/4727)
26+
27+
- JSON transaction element is named `tx_json`
28+
- Binary transaction element is named `tx_blob`
29+
- JSON transaction metadata element is named `meta`
30+
- Binary transaction metadata element is named `meta_blob`
1631

17-
#### V1 account_info response
32+
Additionally, these elements are now consistently available next to `tx_json` (i.e. sibling elements), where possible:
1833

19-
In [the response to the `account_info` command](https://xrpl.org/account_info.html#response-format), there is `account_data` - which is supposed to be an `AccountRoot` object - and `signer_lists` is returned in this object. However, the docs say that `signer_lists` should be at the root level of the reponse.
34+
- `hash` - Transaction ID. This data was stored inside transaction output in API version 1, but in API version 2 is a sibling element.
35+
- `ledger_index` - Ledger index (only set on validated ledgers)
36+
- `ledger_hash` - Ledger hash (only set on closed or validated ledgers)
37+
- `close_time_iso` - Ledger close time expressed in ISO 8601 time format (only set on validated ledgers)
38+
- `validated` - Bool element set to `true` if the transaction is in a validated ledger, otherwise `false`
2039

21-
It makes sense for `signer_lists` to be at the root level because signer lists are not part of the AccountRoot object. (First reported in [xrpl-dev-portal#938](https://github.com/XRPLF/xrpl-dev-portal/issues/938).)
40+
This change affects the following methods:
2241

23-
In `api_version: 2`, the `signer_lists` field [will be moved](#modifications-to-account_info-response-in-v2) to the root level of the account_info response. (https://github.com/XRPLF/rippled/pull/3770)
42+
- `tx` - Transaction data moved into element `tx_json` (was inline inside `result`) or, if binary output was requested, moved from `tx` to `tx_blob`. Renamed binary transaction metadata element (if it was requested) from `meta` to `meta_blob`. Changed location of `hash` and added new elements
43+
- `account_tx` - Renamed transaction element from `tx` to `tx_json`. Renamed binary transaction metadata element (if it was requested) from `meta` to `meta_blob`. Changed location of `hash` and added new elements
44+
- `transaction_entry` - Renamed transaction metadata element from `metadata` to `meta`. Changed location of `hash` and added new elements
45+
- `subscribe` - Renamed transaction element from `transaction` to `tx_json`. Changed location of `hash` and added new elements
46+
- `sign`, `sign_for`, `submit` and `submit_multisigned` - Changed location of `hash` element.
2447

25-
#### server_info - network_id
48+
#### Modification to `Payment` transaction JSON schema
2649

27-
The `network_id` field was added in the `server_info` response in version 1.5.0 (2019), but it is not returned in [reporting mode](https://xrpl.org/rippled-server-modes.html#reporting-mode).
50+
When reading Payments, the `Amount` field should generally **not** be used. Instead, use [delivered_amount](https://xrpl.org/partial-payments.html#the-delivered_amount-field) to see the amount that the Payment delivered. To clarify its meaning, the `Amount` field is being renamed to `DeliverMax`. (https://github.com/XRPLF/rippled/pull/4733)
51+
52+
- In `Payment` transaction type, JSON RPC field `Amount` is renamed to `DeliverMax`. To enable smooth client transition, `Amount` is still handled, as described below: (https://github.com/XRPLF/rippled/pull/4733)
53+
- On JSON RPC input (e.g. `submit_multisigned` etc. methods), `Amount` is recognized as an alias to `DeliverMax` for both API version 1 and version 2 clients.
54+
- On JSON RPC input, submitting both `Amount` and `DeliverMax` fields is allowed _only_ if they are identical; otherwise such input is rejected with `rpcINVALID_PARAMS` error.
55+
- On JSON RPC output (e.g. `subscribe`, `account_tx` etc. methods), `DeliverMax` is present in both API version 1 and version 2.
56+
- On JSON RPC output, `Amount` is only present in API version 1 and _not_ in version 2.
57+
58+
#### Modifications to account_info response
59+
60+
- `signer_lists` is returned in the root of the response. (In API version 1, it was nested under `account_data`.) (https://github.com/XRPLF/rippled/pull/3770)
61+
- When using an invalid `signer_lists` value, the API now returns an "invalidParams" error. (https://github.com/XRPLF/rippled/pull/4585)
62+
- (`signer_lists` must be a boolean. In API version 1, strings were accepted and may return a normal response - i.e. as if `signer_lists` were `true`.)
63+
64+
#### Modifications to [account_tx](https://xrpl.org/account_tx.html#account_tx) response
65+
66+
- Using `ledger_index_min`, `ledger_index_max`, and `ledger_index` returns `invalidParams` because if you use `ledger_index_min` or `ledger_index_max`, then it does not make sense to also specify `ledger_index`. In API version 1, no error was returned. (https://github.com/XRPLF/rippled/pull/4571)
67+
- The same applies for `ledger_index_min`, `ledger_index_max`, and `ledger_hash`. (https://github.com/XRPLF/rippled/issues/4545#issuecomment-1565065579)
68+
- Using a `ledger_index_min` or `ledger_index_max` beyond the range of ledgers that the server has:
69+
- returns `lgrIdxMalformed` in API version 2. Previously, in API version 1, no error was returned. (https://github.com/XRPLF/rippled/issues/4288)
70+
- Attempting to use a non-boolean value (such as a string) for the `binary` or `forward` parameters returns `invalidParams` (`rpcINVALID_PARAMS`). Previously, in API version 1, no error was returned. (https://github.com/XRPLF/rippled/pull/4620)
71+
72+
#### Modifications to [noripple_check](https://xrpl.org/noripple_check.html#noripple_check) response
73+
74+
- Attempting to use a non-boolean value (such as a string) for the `transactions` parameter returns `invalidParams` (`rpcINVALID_PARAMS`). Previously, in API version 1, no error was returned. (https://github.com/XRPLF/rippled/pull/4620)
75+
76+
## API Version 1
77+
78+
This version is supported by all `rippled` versions. For WebSocket and HTTP JSON-RPC requests, it is currently the default API version used when no `api_version` is specified.
79+
80+
The [commandline](https://xrpl.org/docs/references/http-websocket-apis/api-conventions/request-formatting/#commandline-format) always uses the latest API version. The command line is intended for ad-hoc usage by humans, not programs or automated scripts. The command line is not meant for use in production code.
81+
82+
### Inconsistency: server_info - network_id
83+
84+
The `network_id` field was added in the `server_info` response in version 1.5.0 (2019), but it is not returned in [reporting mode](https://xrpl.org/rippled-server-modes.html#reporting-mode). However, use of reporting mode is now discouraged, in favor of using [Clio](https://github.com/XRPLF/clio) instead.
85+
86+
## XRP Ledger server version 2.2.0
87+
88+
The following is a non-breaking addition to the API.
89+
90+
- The `feature` method now has a non-admin mode for users. (It was previously only available to admin connections.) The method returns an updated list of amendments, including their names and other information. ([#4781](https://github.com/XRPLF/rippled/pull/4781))
2891

2992
### Breaking change in 2.3
3093

@@ -36,27 +99,15 @@ Admins can still attempt to retrieve old ledgers with the `ledger_request` RPC.
3699

37100
- `book_changes`: Returns a `validated` field in its response, which was missing in prior versions.
38101

39-
### Additions in 2.2
40-
41-
Additions are intended to be non-breaking (because they are purely additive).
42-
43-
- `feature`: A non-admin mode that uses the same formatting as admin RPC, but hides potentially-sensitive data.
44-
45-
### Additions in 2.0
46-
47-
Additions are intended to be non-breaking (because they are purely additive).
102+
The following additions are non-breaking (because they are purely additive).
48103

49104
- `server_definitions`: A new RPC that generates a `definitions.json`-like output that can be used in XRPL libraries.
50105
- In `Payment` transactions, `DeliverMax` has been added. This is a replacement for the `Amount` field, which should not be used. Typically, the `delivered_amount` (in transaction metadata) should be used. To ease the transition, `DeliverMax` is present regardless of API version, since adding a field is non-breaking.
51106
- API version 2 has been moved from beta to supported, meaning that it is generally available (regardless of the `beta_rpc_api` setting).
52107

53108
## XRP Ledger server version 1.12.0
54109

55-
[Version 1.12.0](https://github.com/XRPLF/rippled/releases/tag/1.12.0) was released on Sep 6, 2023.
56-
57-
### Additions in 1.12
58-
59-
Additions are intended to be non-breaking (because they are purely additive).
110+
[Version 1.12.0](https://github.com/XRPLF/rippled/releases/tag/1.12.0) was released on Sep 6, 2023. The following additions are non-breaking (because they are purely additive).
60111

61112
- `server_info`: Added `ports`, an array which advertises the RPC and WebSocket ports. This information is also included in the `/crawl` endpoint (which calls `server_info` internally). `grpc` and `peer` ports are also included. (https://github.com/XRPLF/rippled/pull/4427)
62113
- `ports` contains objects, each containing a `port` for the listening port (a number string), and a `protocol` array listing the supported protocols on that port.
@@ -133,71 +184,6 @@ was released on Mar 14, 2023.
133184
removed from the [ledger subscription stream](https://xrpl.org/subscribe.html#ledger-stream), because it will no longer
134185
have any meaning.
135186

136-
## API Version 2
137-
138-
API version 2 is introduced in `rippled` version 2.0. Users can request it explicitly by specifying `"api_version" : 2`.
139-
140-
#### Removed methods
141-
142-
In API version 2, the following deprecated methods are no longer available: (https://github.com/XRPLF/rippled/pull/4759)
143-
144-
- `tx_history` - Instead, use other methods such as `account_tx` or `ledger` with the `transactions` field set to `true`.
145-
- `ledger_header` - Instead, use the `ledger` method.
146-
147-
#### Modifications to JSON transaction element in V2
148-
149-
In API version 2, JSON elements for transaction output have been changed and made consistent for all methods which output transactions. (https://github.com/XRPLF/rippled/pull/4775)
150-
This helps to unify the JSON serialization format of transactions. (https://github.com/XRPLF/clio/issues/722, https://github.com/XRPLF/rippled/issues/4727)
151-
152-
- JSON transaction element is named `tx_json`
153-
- Binary transaction element is named `tx_blob`
154-
- JSON transaction metadata element is named `meta`
155-
- Binary transaction metadata element is named `meta_blob`
156-
157-
Additionally, these elements are now consistently available next to `tx_json` (i.e. sibling elements), where possible:
158-
159-
- `hash` - Transaction ID. This data was stored inside transaction output in API version 1, but in API version 2 is a sibling element.
160-
- `ledger_index` - Ledger index (only set on validated ledgers)
161-
- `ledger_hash` - Ledger hash (only set on closed or validated ledgers)
162-
- `close_time_iso` - Ledger close time expressed in ISO 8601 time format (only set on validated ledgers)
163-
- `validated` - Bool element set to `true` if the transaction is in a validated ledger, otherwise `false`
164-
165-
This change affects the following methods:
166-
167-
- `tx` - Transaction data moved into element `tx_json` (was inline inside `result`) or, if binary output was requested, moved from `tx` to `tx_blob`. Renamed binary transaction metadata element (if it was requested) from `meta` to `meta_blob`. Changed location of `hash` and added new elements
168-
- `account_tx` - Renamed transaction element from `tx` to `tx_json`. Renamed binary transaction metadata element (if it was requested) from `meta` to `meta_blob`. Changed location of `hash` and added new elements
169-
- `transaction_entry` - Renamed transaction metadata element from `metadata` to `meta`. Changed location of `hash` and added new elements
170-
- `subscribe` - Renamed transaction element from `transaction` to `tx_json`. Changed location of `hash` and added new elements
171-
- `sign`, `sign_for`, `submit` and `submit_multisigned` - Changed location of `hash` element.
172-
173-
#### Modification to `Payment` transaction JSON schema
174-
175-
When reading Payments, the `Amount` field should generally **not** be used. Instead, use [delivered_amount](https://xrpl.org/partial-payments.html#the-delivered_amount-field) to see the amount that the Payment delivered. To clarify its meaning, the `Amount` field is being renamed to `DeliverMax`. (https://github.com/XRPLF/rippled/pull/4733)
176-
177-
- In `Payment` transaction type, JSON RPC field `Amount` is renamed to `DeliverMax`. To enable smooth client transition, `Amount` is still handled, as described below: (https://github.com/XRPLF/rippled/pull/4733)
178-
- On JSON RPC input (e.g. `submit_multisigned` etc. methods), `Amount` is recognized as an alias to `DeliverMax` for both API version 1 and version 2 clients.
179-
- On JSON RPC input, submitting both `Amount` and `DeliverMax` fields is allowed _only_ if they are identical; otherwise such input is rejected with `rpcINVALID_PARAMS` error.
180-
- On JSON RPC output (e.g. `subscribe`, `account_tx` etc. methods), `DeliverMax` is present in both API version 1 and version 2.
181-
- On JSON RPC output, `Amount` is only present in API version 1 and _not_ in version 2.
182-
183-
#### Modifications to account_info response
184-
185-
- `signer_lists` is returned in the root of the response. In API version 1, it was nested under `account_data`. (https://github.com/XRPLF/rippled/pull/3770)
186-
- When using an invalid `signer_lists` value, the API now returns an "invalidParams" error. (https://github.com/XRPLF/rippled/pull/4585)
187-
- (`signer_lists` must be a boolean. In API version 1, strings were accepted and may return a normal response - i.e. as if `signer_lists` were `true`.)
188-
189-
#### Modifications to [account_tx](https://xrpl.org/account_tx.html#account_tx) response
190-
191-
- Using `ledger_index_min`, `ledger_index_max`, and `ledger_index` returns `invalidParams` because if you use `ledger_index_min` or `ledger_index_max`, then it does not make sense to also specify `ledger_index`. In API version 1, no error was returned. (https://github.com/XRPLF/rippled/pull/4571)
192-
- The same applies for `ledger_index_min`, `ledger_index_max`, and `ledger_hash`. (https://github.com/XRPLF/rippled/issues/4545#issuecomment-1565065579)
193-
- Using a `ledger_index_min` or `ledger_index_max` beyond the range of ledgers that the server has:
194-
- returns `lgrIdxMalformed` in API version 2. Previously, in API version 1, no error was returned. (https://github.com/XRPLF/rippled/issues/4288)
195-
- Attempting to use a non-boolean value (such as a string) for the `binary` or `forward` parameters returns `invalidParams` (`rpcINVALID_PARAMS`). Previously, in API version 1, no error was returned. (https://github.com/XRPLF/rippled/pull/4620)
196-
197-
#### Modifications to [noripple_check](https://xrpl.org/noripple_check.html#noripple_check) response
198-
199-
- Attempting to use a non-boolean value (such as a string) for the `transactions` parameter returns `invalidParams` (`rpcINVALID_PARAMS`). Previously, in API version 1, no error was returned. (https://github.com/XRPLF/rippled/pull/4620)
200-
201187
# Unit tests for API changes
202188

203189
The following information is useful to developers contributing to this project:

0 commit comments

Comments
 (0)