Skip to content

Commit

Permalink
add taker order status in oneof for stream update
Browse files Browse the repository at this point in the history
  • Loading branch information
jonfung-dydx committed Aug 5, 2024
1 parent 9608e19 commit 9dd97a5
Show file tree
Hide file tree
Showing 3 changed files with 217 additions and 122 deletions.
18 changes: 15 additions & 3 deletions indexer/packages/v4-protos/src/codegen/dydxprotocol/clob/query.ts
Original file line number Diff line number Diff line change
Expand Up @@ -287,6 +287,7 @@ export interface StreamOrderbookUpdatesResponseSDKType {
export interface StreamUpdate {
orderbookUpdate?: StreamOrderbookUpdate;
orderFill?: StreamOrderbookFill;
takerOrderStatus?: StreamTakerOrderStatus;
/** Block height of the update. */

blockHeight: number;
Expand All @@ -302,6 +303,7 @@ export interface StreamUpdate {
export interface StreamUpdateSDKType {
orderbook_update?: StreamOrderbookUpdateSDKType;
order_fill?: StreamOrderbookFillSDKType;
taker_order_status?: StreamTakerOrderStatusSDKType;
/** Block height of the update. */

block_height: number;
Expand Down Expand Up @@ -1284,6 +1286,7 @@ function createBaseStreamUpdate(): StreamUpdate {
return {
orderbookUpdate: undefined,
orderFill: undefined,
takerOrderStatus: undefined,
blockHeight: 0,
execMode: 0
};
Expand All @@ -1299,12 +1302,16 @@ export const StreamUpdate = {
StreamOrderbookFill.encode(message.orderFill, writer.uint32(18).fork()).ldelim();
}

if (message.takerOrderStatus !== undefined) {
StreamTakerOrderStatus.encode(message.takerOrderStatus, writer.uint32(26).fork()).ldelim();
}

if (message.blockHeight !== 0) {
writer.uint32(24).uint32(message.blockHeight);
writer.uint32(32).uint32(message.blockHeight);
}

if (message.execMode !== 0) {
writer.uint32(32).uint32(message.execMode);
writer.uint32(40).uint32(message.execMode);
}

return writer;
Expand All @@ -1328,10 +1335,14 @@ export const StreamUpdate = {
break;

case 3:
message.blockHeight = reader.uint32();
message.takerOrderStatus = StreamTakerOrderStatus.decode(reader, reader.uint32());
break;

case 4:
message.blockHeight = reader.uint32();
break;

case 5:
message.execMode = reader.uint32();
break;

Expand All @@ -1348,6 +1359,7 @@ export const StreamUpdate = {
const message = createBaseStreamUpdate();
message.orderbookUpdate = object.orderbookUpdate !== undefined && object.orderbookUpdate !== null ? StreamOrderbookUpdate.fromPartial(object.orderbookUpdate) : undefined;
message.orderFill = object.orderFill !== undefined && object.orderFill !== null ? StreamOrderbookFill.fromPartial(object.orderFill) : undefined;
message.takerOrderStatus = object.takerOrderStatus !== undefined && object.takerOrderStatus !== null ? StreamTakerOrderStatus.fromPartial(object.takerOrderStatus) : undefined;
message.blockHeight = object.blockHeight ?? 0;
message.execMode = object.execMode ?? 0;
return message;
Expand Down
7 changes: 4 additions & 3 deletions proto/dydxprotocol/clob/query.proto
Original file line number Diff line number Diff line change
Expand Up @@ -178,17 +178,18 @@ message StreamOrderbookUpdatesResponse {
// GRPC stream.
message StreamUpdate {
// Contains one of an StreamOrderbookUpdate,
// StreamOrderbookFill.
// StreamOrderbookFill, StreamTakerOrderStatus.
oneof update_message {
StreamOrderbookUpdate orderbook_update = 1;
StreamOrderbookFill order_fill = 2;
StreamTakerOrderStatus taker_order_status = 3;
}

// Block height of the update.
uint32 block_height = 3;
uint32 block_height = 4;

// Exec mode of the update.
uint32 exec_mode = 4;
uint32 exec_mode = 5;
}

// StreamOrderbookUpdate provides information on an orderbook update. Used in
Expand Down
Loading

0 comments on commit 9dd97a5

Please sign in to comment.