Skip to content

Commit

Permalink
FNS protos - add taker order in stream update oneof (#2021)
Browse files Browse the repository at this point in the history
  • Loading branch information
jonfung-dydx authored Aug 5, 2024
1 parent 9608e19 commit 403fc9b
Show file tree
Hide file tree
Showing 3 changed files with 215 additions and 120 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;
takerOrder?: StreamTakerOrder;
/** 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?: StreamTakerOrderSDKType;
/** Block height of the update. */

block_height: number;
Expand Down Expand Up @@ -1284,6 +1286,7 @@ function createBaseStreamUpdate(): StreamUpdate {
return {
orderbookUpdate: undefined,
orderFill: undefined,
takerOrder: 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.takerOrder !== undefined) {
StreamTakerOrder.encode(message.takerOrder, 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.takerOrder = StreamTakerOrder.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.takerOrder = object.takerOrder !== undefined && object.takerOrder !== null ? StreamTakerOrder.fromPartial(object.takerOrder) : 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;
StreamTakerOrder taker_order = 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 403fc9b

Please sign in to comment.