|
1 | 1 | //! Sentry REST API documentation
|
2 | 2 | //!
|
| 3 | +//! This module includes the documentation for all routes of the `Sentry` |
| 4 | +//! REST API and the corresponding requests, responses and parameters. |
3 | 5 | //!
|
4 | 6 | //! All routes are listed below. Here is an overview and links to all of them:
|
5 | 7 | //! - [Channel](#channel) routes
|
|
236 | 238 | #![doc = include_str!("../../primitives/examples/channel_pay_request.rs")]
|
237 | 239 | //! ```
|
238 | 240 | //!
|
239 |
| -//! |
240 | 241 | //! #### GET `/v5/channel/:id/get-leaf
|
241 | 242 | //!
|
242 | 243 | //! This route gets the latest approved state ([`NewState`]/[`ApproveState`] pair),
|
243 |
| -//! and finds the given `spender`/`earner` in the balances tree, and produce a merkle proof for it. |
| 244 | +//! finds the given `spender` or `earner` in the balances tree and produces a Merkle proof for it. |
244 | 245 | //! This is useful for the Platform to verify if a spender leaf really exists.
|
245 | 246 | //!
|
246 | 247 | //! The route is handled by [`channel::get_leaf()`].
|
247 | 248 | //!
|
248 |
| -//! Example Spender: |
| 249 | +//! Response: [`GetLeafResponse`](primitives::sentry::GetLeafResponse) |
249 | 250 | //!
|
250 |
| -//! `/get-leaf/spender/0xDd589B43793934EF6Ad266067A0d1D4896b0dff0` |
| 251 | +//! ##### Routes: |
251 | 252 | //!
|
252 |
| -//! Example Earner: |
| 253 | +//! - GET `/v5/channel/:id/get-leaf/spender/:addr` |
| 254 | +//! - GET `/v5/channel/:id/get-leaf/earner/:addr` |
253 | 255 | //!
|
254 |
| -//! `/get-leaf/earner/0xE882ebF439207a70dDcCb39E13CA8506c9F45fD9` |
| 256 | +//! ##### Examples: |
255 | 257 | //!
|
256 |
| -//! Response: [`GetLeafResponse`](primitives::sentry::GetLeafResponse) |
| 258 | +//! URI for retrieving leaf of a Spender: |
257 | 259 | //!
|
258 |
| -//! ##### Examples: |
| 260 | +//! `/v5/channel/0xf147fa3f1c5e5e06d359c15aa082442cc3e0380f306306022d1e9047c565a0f9/get-leaf/spender/0xDd589B43793934EF6Ad266067A0d1D4896b0dff0` |
| 261 | +//! |
| 262 | +//! URI for retrieving leaf of an Earner: |
| 263 | +//! |
| 264 | +//! `/v5/channel/0xf147fa3f1c5e5e06d359c15aa082442cc3e0380f306306022d1e9047c565a0f9/get-leaf/earner/0xE882ebF439207a70dDcCb39E13CA8506c9F45fD9` |
259 | 265 | //!
|
260 | 266 | //! Response:
|
261 | 267 | //!
|
262 | 268 | //! ```
|
263 |
| -#![doc = include_str!("../../primitives/examples/spender_response.rs")] |
| 269 | +#![doc = include_str!("../../primitives/examples/get_leaf_response.rs")] |
264 | 270 | //! ```
|
265 | 271 | //!
|
266 |
| -//! #### Subroutes: |
267 |
| -//! - GET `/v5/channel/:id/get-leaf/spender` |
268 |
| -//! - GET `/v5/channel/:id/get-leaf/earner` |
269 |
| -//! |
270 |
| -//! This module includes all routes for `Sentry` and the documentation of each Request/Response. |
271 |
| -//! |
272 | 272 | //! #### POST `/v5/channel/dummy-deposit` (auth required)
|
273 | 273 | //!
|
274 | 274 | //! Set a deposit for a Channel and depositor (the authenticated address) in the Dummy adapter.
|
|
0 commit comments