v0.1.7
This commit is contained in:
parent
13c2636e00
commit
61dfa18277
|
@ -1,6 +1,6 @@
|
|||
{
|
||||
"name": "@blockworks-foundation/mango-feeds",
|
||||
"version": "0.1.6",
|
||||
"version": "0.1.7",
|
||||
"description": "Typescript Client for mango-feeds.",
|
||||
"repository": "https://github.com/blockworks-foundation/mango-feeds",
|
||||
"author": {
|
||||
|
|
|
@ -61,15 +61,29 @@ interface OrderbookL3Checkpoint {
|
|||
}
|
||||
|
||||
function isOrderbookL2Checkpoint(obj: any): obj is OrderbookL2Checkpoint {
|
||||
return obj.bids !== undefined && obj.asks !== undefined && obj.bids.every((bid: any) => bid.length() == 2) && obj.asks.every((ask: any) => ask.length() == 2);
|
||||
return (
|
||||
obj.bids !== undefined &&
|
||||
obj.asks !== undefined &&
|
||||
obj.bids.every((bid: any) => bid.length() == 2) &&
|
||||
obj.asks.every((ask: any) => ask.length() == 2)
|
||||
);
|
||||
}
|
||||
|
||||
function isOrderbookL3Checkpoint(obj: any): obj is OrderbookL3Checkpoint {
|
||||
return obj.bids !== undefined && obj.asks !== undefined && obj.bids.every((order: any) => isOrder(order)) && obj.asks.every((order: any) => isOrder(order));
|
||||
return (
|
||||
obj.bids !== undefined &&
|
||||
obj.asks !== undefined &&
|
||||
obj.bids.every((order: any) => isOrder(order)) &&
|
||||
obj.asks.every((order: any) => isOrder(order))
|
||||
);
|
||||
}
|
||||
|
||||
function isOrder(obj: any): obj is Order {
|
||||
return obj.price !== undefined && obj.quantity !== undefined && obj.ownerPubkey !== undefined;
|
||||
return (
|
||||
obj.price !== undefined &&
|
||||
obj.quantity !== undefined &&
|
||||
obj.ownerPubkey !== undefined
|
||||
);
|
||||
}
|
||||
|
||||
export class OrderbookFeed extends ReconnectingWebsocketFeed {
|
||||
|
|
Loading…
Reference in New Issue