From 44c9e7cd11d79fb80d4895c754be4ea9c9d154c5 Mon Sep 17 00:00:00 2001 From: arkanoider <113362043+arkanoider@users.noreply.github.com> Date: Sat, 16 Aug 2025 23:53:37 +0200 Subject: [PATCH 1/3] chore: updated restore message --- src/restore_session.md | 76 ++++++++++++++++++++++-------------------- 1 file changed, 40 insertions(+), 36 deletions(-) diff --git a/src/restore_session.md b/src/restore_session.md index e5ab61b..f836a81 100644 --- a/src/restore_session.md +++ b/src/restore_session.md @@ -11,7 +11,7 @@ Client sends a Gift wrap Nostr event to Mostro with the following rumor's conten "restore": { "version": 1, "action": "restore-session", - "payload": null + "payload": "restore_request" } } ``` @@ -26,31 +26,33 @@ Mostro will respond with a message containing all non-finalized orders (e.g., st "version": 1, "action": "restore-session", "payload": { - "orders": [ - { - "id": "", - "trade_index": 1, - "status": "pending" - }, - { - "id": "", - "trade_index": 2, - "status": "active" - }, - { - "id": "", - "trade_index": 3, - "status": "fiat-sent" - } - ], - "disputes": [ - { - "dispute_id": "", - "order_id": "", - "trade_index": 4, - "status": "initiated" - } - ] + "restore_data": { + "orders": [ + { + "id": "", + "trade_index": 1, + "status": "pending" + }, + { + "id": "", + "trade_index": 2, + "status": "active" + }, + { + "id": "", + "trade_index": 3, + "status": "fiat-sent" + } + ], + "disputes": [ + { + "dispute_id": "", + "order_id": "", + "trade_index": 4, + "status": "initiated" + } + ] + } } } } @@ -69,7 +71,7 @@ A user has the following: * One `active` order (trade index 3) * One active dispute (trade index 4) -When switching to desktop, after restoring the mnemonic, the client sends `restore-session` and receives: +When switching to desktop, after restoring the mnemonic, the client sends `restore-session` with `restore_request` payload and receives: ```json { @@ -77,15 +79,17 @@ When switching to desktop, after restoring the mnemonic, the client sends `resto "version": 1, "action": "restore-session", "payload": { - "orders": [ - { "id": "abc-123", "trade_index": 1, "status": "pending" }, - { "id": "def-456", "trade_index": 2, "status": "pending" }, - { "id": "ghi-789", "trade_index": 3, "status": "active" }, - { "id": "xyz-999", "trade_index": 4, "status": "dispute" } - ], - "disputes": [ - { "dispute_id": "dis-001", "order_id": "xyz-999", "trade_index": 4, "status": "initiated" } - ] + "restore_data" : { + "orders": [ + { "id": "abc-123", "trade_index": 1, "status": "pending" }, + { "id": "def-456", "trade_index": 2, "status": "pending" }, + { "id": "ghi-789", "trade_index": 3, "status": "active" }, + { "id": "xyz-999", "trade_index": 4, "status": "dispute" } + ], + "disputes": [ + { "dispute_id": "dis-001", "order_id": "xyz-999", "trade_index": 4, "status": "initiated" } + ] + } } } } From 94765918895e7d0f7e03e5f82d66ddf215ceaa92 Mon Sep 17 00:00:00 2001 From: arkanoider <113362043+arkanoider@users.noreply.github.com> Date: Sun, 17 Aug 2025 10:40:22 +0200 Subject: [PATCH 2/3] Update src/restore_session.md Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com> --- src/restore_session.md | 33 +++++---------------------------- 1 file changed, 5 insertions(+), 28 deletions(-) diff --git a/src/restore_session.md b/src/restore_session.md index f836a81..b39b10c 100644 --- a/src/restore_session.md +++ b/src/restore_session.md @@ -26,34 +26,11 @@ Mostro will respond with a message containing all non-finalized orders (e.g., st "version": 1, "action": "restore-session", "payload": { - "restore_data": { - "orders": [ - { - "id": "", - "trade_index": 1, - "status": "pending" - }, - { - "id": "", - "trade_index": 2, - "status": "active" - }, - { - "id": "", - "trade_index": 3, - "status": "fiat-sent" - } - ], - "disputes": [ - { - "dispute_id": "", - "order_id": "", - "trade_index": 4, - "status": "initiated" - } - ] - } - } +### Fields + +* `payload.restore_data`: Wrapper object that contains the session recovery data. +* `payload.restore_data.orders`: An array of active or ongoing orders with their `id`, `trade_index`, and current `status`. +* `payload.restore_data.disputes`: An array of ongoing disputes with `dispute_id`, the associated `order_id`, and `trade_index`. } } ``` From e64b5b1f5946428d94b30d49e10939dd85b84576 Mon Sep 17 00:00:00 2001 From: arkanoider Date: Sun, 17 Aug 2025 10:53:56 +0200 Subject: [PATCH 3/3] chore: fix on restore session markdown protocol document --- src/restore_session.md | 42 ++++++++++++++++++++++++++++++++---------- 1 file changed, 32 insertions(+), 10 deletions(-) diff --git a/src/restore_session.md b/src/restore_session.md index b39b10c..b9e3101 100644 --- a/src/restore_session.md +++ b/src/restore_session.md @@ -11,7 +11,7 @@ Client sends a Gift wrap Nostr event to Mostro with the following rumor's conten "restore": { "version": 1, "action": "restore-session", - "payload": "restore_request" + "payload": null } } ``` @@ -26,11 +26,34 @@ Mostro will respond with a message containing all non-finalized orders (e.g., st "version": 1, "action": "restore-session", "payload": { -### Fields - -* `payload.restore_data`: Wrapper object that contains the session recovery data. -* `payload.restore_data.orders`: An array of active or ongoing orders with their `id`, `trade_index`, and current `status`. -* `payload.restore_data.disputes`: An array of ongoing disputes with `dispute_id`, the associated `order_id`, and `trade_index`. + "restore_data": { + "orders": [ + { + "id": "", + "trade_index": 1, + "status": "pending" + }, + { + "id": "", + "trade_index": 2, + "status": "active" + }, + { + "id": "", + "trade_index": 3, + "status": "fiat-sent" + } + ], + "disputes": [ + { + "dispute_id": "", + "order_id": "", + "trade_index": 4, + "status": "initiated" + } + ] + } + } } } ``` @@ -38,7 +61,7 @@ Mostro will respond with a message containing all non-finalized orders (e.g., st ### Fields * `orders`: An array of active or ongoing orders with their `id`, `trade_index`, and current `status`. -* `disputes`: An array of ongoing disputes with `dispute_id`, the associated `order_id`, and `trade_index`. +* `disputes`: An array of ongoing disputes with `dispute_id`, the associated `order_id`, and `trade_index` and current `status` of the dispute. ## Example Use Case @@ -48,7 +71,7 @@ A user has the following: * One `active` order (trade index 3) * One active dispute (trade index 4) -When switching to desktop, after restoring the mnemonic, the client sends `restore-session` with `restore_request` payload and receives: +When switching to desktop, after restoring the mnemonic, the client sends `restore-session` and receives: ```json { @@ -56,7 +79,7 @@ When switching to desktop, after restoring the mnemonic, the client sends `resto "version": 1, "action": "restore-session", "payload": { - "restore_data" : { + "restore_data": { "orders": [ { "id": "abc-123", "trade_index": 1, "status": "pending" }, { "id": "def-456", "trade_index": 2, "status": "pending" }, @@ -71,4 +94,3 @@ When switching to desktop, after restoring the mnemonic, the client sends `resto } } ``` -