mirror of
https://github.com/RoboSats/robosats.git
synced 2024-12-13 19:06:26 +00:00
dynamically remove expired orders with nostr
This commit is contained in:
parent
ce4a96b9ca
commit
52b1b162d8
@ -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));
|
||||
};
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user