dynamically remove expired orders with nostr

This commit is contained in:
koalasat 2024-11-26 12:31:06 +01:00
parent ce4a96b9ca
commit 52b1b162d8
No known key found for this signature in database
GPG Key ID: 2F7F61C6146AB157

View File

@ -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));
};
}