-
Notifications
You must be signed in to change notification settings - Fork 109
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[CT-1320] proto for FNS price updates (#2586)
- Loading branch information
Showing
12 changed files
with
1,198 additions
and
339 deletions.
There are no files selected for viewing
362 changes: 182 additions & 180 deletions
362
indexer/packages/v4-protos/src/codegen/dydxprotocol/bundle.ts
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
92 changes: 92 additions & 0 deletions
92
indexer/packages/v4-protos/src/codegen/dydxprotocol/prices/streaming.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,92 @@ | ||
import { MarketPrice, MarketPriceSDKType } from "./market_price"; | ||
import * as _m0 from "protobufjs/minimal"; | ||
import { DeepPartial } from "../../helpers"; | ||
/** StreamPriceUpdate provides information on a price update. */ | ||
|
||
export interface StreamPriceUpdate { | ||
/** The `Id` of the `Market`. */ | ||
marketId: number; | ||
/** The updated price. */ | ||
|
||
price?: MarketPrice; | ||
/** Snapshot indicates if the response is from a snapshot of the price. */ | ||
|
||
snapshot: boolean; | ||
} | ||
/** StreamPriceUpdate provides information on a price update. */ | ||
|
||
export interface StreamPriceUpdateSDKType { | ||
/** The `Id` of the `Market`. */ | ||
market_id: number; | ||
/** The updated price. */ | ||
|
||
price?: MarketPriceSDKType; | ||
/** Snapshot indicates if the response is from a snapshot of the price. */ | ||
|
||
snapshot: boolean; | ||
} | ||
|
||
function createBaseStreamPriceUpdate(): StreamPriceUpdate { | ||
return { | ||
marketId: 0, | ||
price: undefined, | ||
snapshot: false | ||
}; | ||
} | ||
|
||
export const StreamPriceUpdate = { | ||
encode(message: StreamPriceUpdate, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { | ||
if (message.marketId !== 0) { | ||
writer.uint32(8).uint32(message.marketId); | ||
} | ||
|
||
if (message.price !== undefined) { | ||
MarketPrice.encode(message.price, writer.uint32(18).fork()).ldelim(); | ||
} | ||
|
||
if (message.snapshot === true) { | ||
writer.uint32(24).bool(message.snapshot); | ||
} | ||
|
||
return writer; | ||
}, | ||
|
||
decode(input: _m0.Reader | Uint8Array, length?: number): StreamPriceUpdate { | ||
const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); | ||
let end = length === undefined ? reader.len : reader.pos + length; | ||
const message = createBaseStreamPriceUpdate(); | ||
|
||
while (reader.pos < end) { | ||
const tag = reader.uint32(); | ||
|
||
switch (tag >>> 3) { | ||
case 1: | ||
message.marketId = reader.uint32(); | ||
break; | ||
|
||
case 2: | ||
message.price = MarketPrice.decode(reader, reader.uint32()); | ||
break; | ||
|
||
case 3: | ||
message.snapshot = reader.bool(); | ||
break; | ||
|
||
default: | ||
reader.skipType(tag & 7); | ||
break; | ||
} | ||
} | ||
|
||
return message; | ||
}, | ||
|
||
fromPartial(object: DeepPartial<StreamPriceUpdate>): StreamPriceUpdate { | ||
const message = createBaseStreamPriceUpdate(); | ||
message.marketId = object.marketId ?? 0; | ||
message.price = object.price !== undefined && object.price !== null ? MarketPrice.fromPartial(object.price) : undefined; | ||
message.snapshot = object.snapshot ?? false; | ||
return message; | ||
} | ||
|
||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,3 @@ | ||
import * as _129 from "./gogo"; | ||
export const gogoproto = { ..._129 | ||
import * as _130 from "./gogo"; | ||
export const gogoproto = { ..._130 | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,16 +1,16 @@ | ||
import * as _130 from "./api/annotations"; | ||
import * as _131 from "./api/http"; | ||
import * as _132 from "./protobuf/descriptor"; | ||
import * as _133 from "./protobuf/duration"; | ||
import * as _134 from "./protobuf/timestamp"; | ||
import * as _135 from "./protobuf/any"; | ||
import * as _131 from "./api/annotations"; | ||
import * as _132 from "./api/http"; | ||
import * as _133 from "./protobuf/descriptor"; | ||
import * as _134 from "./protobuf/duration"; | ||
import * as _135 from "./protobuf/timestamp"; | ||
import * as _136 from "./protobuf/any"; | ||
export namespace google { | ||
export const api = { ..._130, | ||
..._131 | ||
export const api = { ..._131, | ||
..._132 | ||
}; | ||
export const protobuf = { ..._132, | ||
..._133, | ||
export const protobuf = { ..._133, | ||
..._134, | ||
..._135 | ||
..._135, | ||
..._136 | ||
}; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
syntax = "proto3"; | ||
package dydxprotocol.prices; | ||
|
||
import "gogoproto/gogo.proto"; | ||
import "dydxprotocol/prices/market_price.proto"; | ||
|
||
option go_package = "github.com/dydxprotocol/v4-chain/protocol/x/prices/types"; | ||
|
||
// StreamPriceUpdate provides information on a price update. | ||
message StreamPriceUpdate { | ||
// The `Id` of the `Market`. | ||
uint32 market_id = 1; | ||
|
||
// The updated price. | ||
MarketPrice price = 2 [ (gogoproto.nullable) = false ]; | ||
|
||
// Snapshot indicates if the response is from a snapshot of the price. | ||
bool snapshot = 3; | ||
} |
Oops, something went wrong.