From 52b1b162d86b9e2d25acdcf22ee1744be9f0ca1d Mon Sep 17 00:00:00 2001 From: koalasat Date: Tue, 26 Nov 2024 12:31:06 +0100 Subject: [PATCH 1/3] dynamically remove expired orders with nostr --- frontend/src/services/RoboPool/index.ts | 19 +++++++++++++++++-- 1 file changed, 17 insertions(+), 2 deletions(-) diff --git a/frontend/src/services/RoboPool/index.ts b/frontend/src/services/RoboPool/index.ts index d6d6b4b7..abc0a06f 100644 --- a/frontend/src/services/RoboPool/index.ts +++ b/frontend/src/services/RoboPool/index.ts @@ -103,7 +103,21 @@ class RoboPool { .map((f) => f.nostrHexPubkey) .filter((item) => item !== undefined); - const request = ['REQ', 'subscribeBook', { authors, kinds: [38383], '#s': ['pending'] }]; + const requestPending = [ + 'REQ', + 'subscribeBookPending', + { authors, kinds: [38383], '#s': ['pending'] }, + ]; + const requestSuccess = [ + 'REQ', + 'subscribeBookSucess', + { + authors, + kinds: [38383], + '#s': ['success'], + since: Math.floor(new Date().getTime() / 1000), + }, + ]; this.messageHandlers.push((_url: string, messageEvent: MessageEvent) => { const jsonMessage = JSON.parse(messageEvent.data); @@ -113,7 +127,8 @@ class RoboPool { events.oneose(); } }); - this.sendMessage(JSON.stringify(request)); + this.sendMessage(JSON.stringify(requestPending)); + this.sendMessage(JSON.stringify(requestSuccess)); }; } From 62cafe5fa0dd1ac00c00dbba626301327661071c Mon Sep 17 00:00:00 2001 From: koalasat Date: Tue, 26 Nov 2024 12:34:36 +0100 Subject: [PATCH 2/3] Include other statuses --- frontend/src/services/RoboPool/index.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/frontend/src/services/RoboPool/index.ts b/frontend/src/services/RoboPool/index.ts index abc0a06f..c9b6a67b 100644 --- a/frontend/src/services/RoboPool/index.ts +++ b/frontend/src/services/RoboPool/index.ts @@ -114,7 +114,7 @@ class RoboPool { { authors, kinds: [38383], - '#s': ['success'], + '#s': ['success', 'canceled', 'in-progress'], since: Math.floor(new Date().getTime() / 1000), }, ]; From fa58a110ac76f2d895cb6e0fd560cdc739625f63 Mon Sep 17 00:00:00 2001 From: koalasat Date: Tue, 26 Nov 2024 12:36:55 +0100 Subject: [PATCH 3/3] Typo --- frontend/src/services/RoboPool/index.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/frontend/src/services/RoboPool/index.ts b/frontend/src/services/RoboPool/index.ts index c9b6a67b..1db0d8d3 100644 --- a/frontend/src/services/RoboPool/index.ts +++ b/frontend/src/services/RoboPool/index.ts @@ -110,7 +110,7 @@ class RoboPool { ]; const requestSuccess = [ 'REQ', - 'subscribeBookSucess', + 'subscribeBookSuccess', { authors, kinds: [38383],