mirror of
https://github.com/RoboSats/robosats.git
synced 2024-12-13 19:06:26 +00:00
Merge pull request #1635 from RoboSats/remove-expired-orders-with-nostr
Dynamically remove expired orders with nostr
This commit is contained in:
commit
cf260113ee
@ -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',
|
||||
'subscribeBookSuccess',
|
||||
{
|
||||
authors,
|
||||
kinds: [38383],
|
||||
'#s': ['success', 'canceled', 'in-progress'],
|
||||
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