order status subscriptions
This commit is contained in:
23
order.js
Normal file
23
order.js
Normal file
@@ -0,0 +1,23 @@
|
||||
import {redis, vaultOpenOrders} from "./cache.js";
|
||||
|
||||
|
||||
export function subVaultOrders( socket, chainId, vault ) {
|
||||
vaultOpenOrders.get(chainId, vault).then(async (orderIndexes)=>{
|
||||
for( const orderIndex of JSON.parse(orderIndexes) ) {
|
||||
// there is a race condition here since we need multiple queries to get the complete order status,
|
||||
// so we diligently check for nulls and exclude such an order, since it was deleted and no longer active.
|
||||
const status = orderStatus( chainId, vault, orderIndex )
|
||||
if( status != null ) {
|
||||
|
||||
}
|
||||
}
|
||||
})
|
||||
}
|
||||
|
||||
export function unsubVaultOrders( socket, chainId, vault ) {
|
||||
|
||||
}
|
||||
|
||||
export function orderStatus( chainId, vault, orderIndex ) {
|
||||
|
||||
}
|
||||
Reference in New Issue
Block a user