You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Defines the `last-trade-index` action used to retrieve the user's last `trade_index`.
4
+
5
+
## Request
6
+
7
+
Client sends a Gift wrap Nostr event to Mostro with the following rumor's content. The request sends a `null` payload to indicate that the client is querying for the last trade index.
8
+
9
+
```json
10
+
{
11
+
"restore": {
12
+
"version": 1,
13
+
"action": "last-trade-index",
14
+
"payload": null
15
+
}
16
+
}
17
+
```
18
+
19
+
## Response
20
+
21
+
Mostro responds with the user's last trade index as a u32 directly in the `trade_index` field. If the user has never created a trade, the value SHOULD be `1`.
22
+
23
+
```json
24
+
{
25
+
"restore": {
26
+
"version": 1,
27
+
"action": "last-trade-index",
28
+
"trade_index": 42,
29
+
"payload": null
30
+
}
31
+
}
32
+
```
33
+
34
+
### Fields
35
+
36
+
*`restore.version`: Protocol version. Current is `1`.
37
+
*`restore.action`: Must be `last-trade-index`.
38
+
*`restore.trade_index` (response): u32 representing the last `trade_index` for the user. `1` if none.
39
+
*`restore.payload` (response): Must be `null`.
40
+
41
+
## Example
42
+
43
+
Client requests the last trade index and receives `7`, meaning the next trade the client creates SHOULD use `trade_index = 8`.
0 commit comments