Skip to content

Commit 7dd37e6

Browse files
committed
Clean up path_find formatting
1 parent 3347fc9 commit 7dd37e6

File tree

2 files changed

+16
-257
lines changed

2 files changed

+16
-257
lines changed

_api-examples/path_find/create-followup.json

Lines changed: 1 addition & 226 deletions
Original file line numberDiff line numberDiff line change
@@ -1,231 +1,6 @@
11
{
22
"alternatives": [
3-
{
4-
"paths_computed": [
5-
[
6-
{
7-
"currency": "USD",
8-
"issuer": "rKiCet8SdvWxPXnAgYarFUXMh1zCPz432Y",
9-
"type": 48
10-
},
11-
{
12-
"account": "rKiCet8SdvWxPXnAgYarFUXMh1zCPz432Y",
13-
"type": 1
14-
},
15-
{
16-
"account": "rLzpfEnrB2Ro2LtaGd6Af7znRqGxULc4rW",
17-
"type": 1
18-
}
19-
],
20-
[
21-
{
22-
"currency": "USD",
23-
"issuer": "rKiCet8SdvWxPXnAgYarFUXMh1zCPz432Y",
24-
"type": 48
25-
},
26-
{
27-
"account": "rKiCet8SdvWxPXnAgYarFUXMh1zCPz432Y",
28-
"type": 1
29-
},
30-
{
31-
"account": "rQhbp2h133vD3TJGWkNY5zePHKQUq6vSVm",
32-
"type": 1
33-
}
34-
],
35-
[
36-
{
37-
"currency": "USD",
38-
"issuer": "rvYAfWj5gh67oV6fW32ZzP3Aw4Eubs59B",
39-
"type": 48
40-
}
41-
],
42-
[
43-
{
44-
"currency": "USD",
45-
"issuer": "rhub8VRN55s94qWKDv6jmDy1pUykJzF3wq",
46-
"type": 48
47-
},
48-
{
49-
"currency": "USD",
50-
"issuer": "rvYAfWj5gh67oV6fW32ZzP3Aw4Eubs59B",
51-
"type": 48
52-
}
53-
]
54-
],
55-
"source_amount": "390"
56-
},
57-
{
58-
"paths_computed": [
59-
[
60-
{
61-
"account": "razqQKzJRdB4UxFPWf5NEpEG3WMkmwgcXA",
62-
"type": 1
63-
},
64-
{
65-
"currency": "CNY",
66-
"issuer": "rKiCet8SdvWxPXnAgYarFUXMh1zCPz432Y",
67-
"type": 48
68-
},
69-
{
70-
"currency": "USD",
71-
"issuer": "rvYAfWj5gh67oV6fW32ZzP3Aw4Eubs59B",
72-
"type": 48
73-
}
74-
],
75-
[
76-
{
77-
"account": "razqQKzJRdB4UxFPWf5NEpEG3WMkmwgcXA",
78-
"type": 1
79-
},
80-
{
81-
"currency": "XRP",
82-
"type": 16
83-
},
84-
{
85-
"currency": "USD",
86-
"issuer": "rKiCet8SdvWxPXnAgYarFUXMh1zCPz432Y",
87-
"type": 48
88-
},
89-
{
90-
"account": "rKiCet8SdvWxPXnAgYarFUXMh1zCPz432Y",
91-
"type": 1
92-
},
93-
{
94-
"account": "rLzpfEnrB2Ro2LtaGd6Af7znRqGxULc4rW",
95-
"type": 1
96-
}
97-
],
98-
[
99-
{
100-
"account": "razqQKzJRdB4UxFPWf5NEpEG3WMkmwgcXA",
101-
"type": 1
102-
},
103-
{
104-
"currency": "XRP",
105-
"type": 16
106-
},
107-
{
108-
"currency": "USD",
109-
"issuer": "rKiCet8SdvWxPXnAgYarFUXMh1zCPz432Y",
110-
"type": 48
111-
},
112-
{
113-
"account": "rKiCet8SdvWxPXnAgYarFUXMh1zCPz432Y",
114-
"type": 1
115-
},
116-
{
117-
"account": "rQhbp2h133vD3TJGWkNY5zePHKQUq6vSVm",
118-
"type": 1
119-
}
120-
],
121-
[
122-
{
123-
"account": "razqQKzJRdB4UxFPWf5NEpEG3WMkmwgcXA",
124-
"type": 1
125-
},
126-
{
127-
"currency": "XRP",
128-
"type": 16
129-
},
130-
{
131-
"currency": "USD",
132-
"issuer": "rvYAfWj5gh67oV6fW32ZzP3Aw4Eubs59B",
133-
"type": 48
134-
}
135-
]
136-
],
137-
"source_amount": {
138-
"currency": "CNY",
139-
"issuer": "r9cZA1mLK5R5Am25ArfXFmqgNwjZgnfk59",
140-
"value": "0.01032463561687775"
141-
}
142-
},
143-
{
144-
"paths_computed": [
145-
[
146-
{
147-
"account": "rvYAfWj5gh67oV6fW32ZzP3Aw4Eubs59B",
148-
"type": 1
149-
},
150-
{
151-
"currency": "524C555344000000000000000000000000000000",
152-
"issuer": "rMxCKbEDwqr76QuheSUMdEGf4B9xJ8m5De",
153-
"type": 48
154-
},
155-
{
156-
"currency": "USD",
157-
"issuer": "rvYAfWj5gh67oV6fW32ZzP3Aw4Eubs59B",
158-
"type": 48
159-
}
160-
],
161-
[
162-
{
163-
"account": "rvYAfWj5gh67oV6fW32ZzP3Aw4Eubs59B",
164-
"type": 1
165-
},
166-
{
167-
"currency": "XRP",
168-
"type": 16
169-
},
170-
{
171-
"currency": "USD",
172-
"issuer": "rKiCet8SdvWxPXnAgYarFUXMh1zCPz432Y",
173-
"type": 48
174-
},
175-
{
176-
"account": "rKiCet8SdvWxPXnAgYarFUXMh1zCPz432Y",
177-
"type": 1
178-
},
179-
{
180-
"account": "rLzpfEnrB2Ro2LtaGd6Af7znRqGxULc4rW",
181-
"type": 1
182-
}
183-
],
184-
[
185-
{
186-
"account": "rvYAfWj5gh67oV6fW32ZzP3Aw4Eubs59B",
187-
"type": 1
188-
},
189-
{
190-
"currency": "XRP",
191-
"type": 16
192-
},
193-
{
194-
"currency": "USD",
195-
"issuer": "rKiCet8SdvWxPXnAgYarFUXMh1zCPz432Y",
196-
"type": 48
197-
},
198-
{
199-
"account": "rKiCet8SdvWxPXnAgYarFUXMh1zCPz432Y",
200-
"type": 1
201-
},
202-
{
203-
"account": "rQhbp2h133vD3TJGWkNY5zePHKQUq6vSVm",
204-
"type": 1
205-
}
206-
],
207-
[
208-
{
209-
"account": "rvYAfWj5gh67oV6fW32ZzP3Aw4Eubs59B",
210-
"type": 1
211-
},
212-
{
213-
"currency": "XRP",
214-
"type": 16
215-
},
216-
{
217-
"currency": "USD",
218-
"issuer": "rvYAfWj5gh67oV6fW32ZzP3Aw4Eubs59B",
219-
"type": 48
220-
}
221-
]
222-
],
223-
"source_amount": {
224-
"currency": "EUR",
225-
"issuer": "r9cZA1mLK5R5Am25ArfXFmqgNwjZgnfk59",
226-
"value": "0.0009149684656896759"
227-
}
228-
}
3+
// ... paths omitted from this example; same format as the initial response ...
2294
],
2305
"destination_account": "r9cZA1mLK5R5Am25ArfXFmqgNwjZgnfk59",
2316
"destination_amount": {

docs/references/http-websocket-apis/public-api-methods/path-and-order-book-methods/path_find.md

Lines changed: 15 additions & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -59,9 +59,8 @@ The request includes the following parameters:
5959
| `destination_account` | String - [Address][] | Yes | The account to find a path to. (In other words, the account that would receive a payment.) |
6060
| `destination_amount` | [Currency Amount][] | Yes | How much the destination account would receive. **Special case:** You can specify `"-1"` (for XRP) or provide -1 as the contents of the `value` field (for tokens). This requests a path to deliver as much as possible, while spending no more than the amount specified in `send_max` (if provided). |
6161
| `domain` | String - [Hash][] | No | The ledger entry ID of a permissioned domain. If provided, only return paths that use the corresponding [permissioned DEX](../../../../concepts/tokens/decentralized-exchange/permissioned-dexes.md). {% amendment-disclaimer name="PermissionedDEX" /%} |
62-
| `paths` | Array | No | Array of arrays of objects, representing [payment paths](../../../../concepts/tokens/fungible-tokens/paths.md) to check.
63-
| `send_max` | [Currency Amount][] | No | Maximum amount that would be spent. Not compatible with `source_currencies`. |
64-
You can use this to keep updated on changes to particular paths you already know about, or to check the overall cost to make a payment along a certain path. |
62+
| `paths` | Array | No | Array of arrays of objects, representing [payment paths](../../../../concepts/tokens/fungible-tokens/paths.md) to check. You can use this to keep updated on changes to particular paths you already know about, or to check the overall cost to make a payment along a certain path. |
63+
| `send_max` | [Currency Amount][] | No | Maximum amount that would be spent. Not compatible with `source_currencies`. |
6564

6665
The server also recognizes the following fields, but the results of using them are not guaranteed: `source_currencies`, `bridges`. These fields should be considered reserved for future use.
6766

@@ -79,21 +78,21 @@ An example of a successful response:
7978

8079
The initial response follows the [standard format](../../api-conventions/response-formatting.md), with a successful result containing the following fields:
8180

82-
| Field | Type | Description |
83-
|:----------------------|:-----------------|:----------------------------------|
84-
| `alternatives` | Array | Array of objects with suggested [paths](../../../../concepts/tokens/fungible-tokens/paths.md) to take, as described below. If empty, then no paths were found connecting the source and destination accounts. |
85-
| `destination_account` | String | Unique address of the account that would receive a transaction. |
86-
| `destination_amount` | String or Object | [Currency Amount][] that the destination would receive in a transaction. |
87-
| `source_account` | String | Unique address that would send a transaction. |
88-
| `full_reply` | Boolean | If `false`, this is the result of an incomplete search. A later reply may have a better path. If `true`, then this is the best path found. (It is still theoretically possible that a better path could exist, but `rippled` won't find it.) Until you close the pathfinding request, `rippled` continues to send updates each time a new ledger closes. |
81+
| Field | Type | Description |
82+
|:----------------------|:---------------------|:----------------------------------|
83+
| `alternatives` | Array | Array of objects with suggested [paths](../../../../concepts/tokens/fungible-tokens/paths.md) to take, as described below. If empty, then no paths were found connecting the source and destination accounts. |
84+
| `destination_account` | String - [Address][] | The account that would receive a transaction. |
85+
| `destination_amount` | [Currency Amount][] | How much the destination would receive in a transaction. |
86+
| `source_account` | String - [Address][] | The account that would send a transaction. |
87+
| `full_reply` | Boolean | If `false`, this is the result of an incomplete search. A later reply may have a better path. If `true`, then this is the best path found. (It is still theoretically possible that a better path could exist, but `rippled` won't find it.) Until you close the pathfinding request, `rippled` continues to send updates each time a new ledger closes. |
8988

9089
Each element in the `alternatives` array is an object that represents a path from one possible source currency (held by the initiating account) to the destination account and currency. This object has the following fields:
9190

92-
| Field | Type | Description |
93-
|:---------------------|:-----------------|:---------------------------------------|
94-
| `paths_computed` | Array | Array of arrays of objects defining [payment paths](../../../../concepts/tokens/fungible-tokens/paths.md) |
95-
| `source_amount` | String or Object | [Currency Amount][] that the source would have to send along this path for the destination to receive the desired amount. |
96-
| `destination_amount` | String or Object | _(May be omitted)_ [Currency Amount][] that the destination would receive along this path. Only included if the `destination_amount` from the request was the "-1" special case. |
91+
| Field | Type | Description |
92+
|:---------------------|:--------------------|:---------------------------------------|
93+
| `paths_computed` | Array | Array of arrays of objects defining [payment paths](../../../../concepts/tokens/fungible-tokens/paths.md) |
94+
| `source_amount` | [Currency Amount][] | How much the source would have to send along this path for the destination to receive the desired amount. |
95+
| `destination_amount` | [Currency Amount][] | _(May be omitted)_ How much the destination would receive along this path. Only included if the `destination_amount` from the request was the "-1" special case. |
9796

9897
### Possible Errors
9998

@@ -112,22 +111,7 @@ Here is an example of an asynchronous follow-up from a path_find create request:
112111
{% tabs %}
113112

114113
{% tab label="WebSocket" %}
115-
```json
116-
{
117-
"id": 1,
118-
"type": "path_find",
119-
"alternatives": [
120-
/* paths omitted from this example; same format as the initial response */
121-
],
122-
"destination_account": "r9cZA1mLK5R5Am25ArfXFmqgNwjZgnfk59",
123-
"destination_amount": {
124-
"currency": "USD",
125-
"issuer": "rvYAfWj5gh67oV6fW32ZzP3Aw4Eubs59B",
126-
"value": "0.001"
127-
},
128-
"source_account": "r9cZA1mLK5R5Am25ArfXFmqgNwjZgnfk59"
129-
}
130-
```
114+
{% code-snippet file="/_api-examples/path_find/create-followup.json" /%}
131115
{% /tab %}
132116

133117
{% /tabs %}

0 commit comments

Comments
 (0)