Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

FNS protos - add taker order in stream update oneof #2021

Merged
merged 2 commits into from
Aug 5, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

just to make sure - is this schema backwards compatible?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Since this is emitted in fns only, no need for it to be backwards compatible?


// 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
Loading