@injectivelabs/ws-price-oracle-proto-ts-v2 1.0.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
// @generated by protobuf-ts 2.11.1 with parameter add_pb_suffix
|
|
2
|
+
// @generated from protobuf file "goagen_api_oracle.proto" (package "injective.price.oracle.api.v1", syntax proto3)
|
|
3
|
+
// tslint:disable
|
|
4
|
+
//
|
|
5
|
+
// Code generated with goa, DO NOT EDIT.
|
|
6
|
+
//
|
|
7
|
+
// oracle protocol buffer definition
|
|
8
|
+
//
|
|
9
|
+
// Command:
|
|
10
|
+
// $ goa gen github.com/InjectiveLabs/injective-ws-price-oracle/api/design -o
|
|
11
|
+
// api
|
|
12
|
+
//
|
|
13
|
+
import type { RpcTransport } from "@protobuf-ts/runtime-rpc";
|
|
14
|
+
import type { ServiceInfo } from "@protobuf-ts/runtime-rpc";
|
|
15
|
+
import { Oracle } from "./goagen_api_oracle_pb";
|
|
16
|
+
import { stackIntercept } from "@protobuf-ts/runtime-rpc";
|
|
17
|
+
import type { StreamMarketsResponse } from "./goagen_api_oracle_pb";
|
|
18
|
+
import type { StreamMarketsRequest } from "./goagen_api_oracle_pb";
|
|
19
|
+
import type { ServerStreamingCall } from "@protobuf-ts/runtime-rpc";
|
|
20
|
+
import type { RpcOptions } from "@protobuf-ts/runtime-rpc";
|
|
21
|
+
/**
|
|
22
|
+
* MarketStream market oracle stream API.
|
|
23
|
+
*
|
|
24
|
+
* @generated from protobuf service injective.price.oracle.api.v1.Oracle
|
|
25
|
+
*/
|
|
26
|
+
export interface IOracleClient {
|
|
27
|
+
/**
|
|
28
|
+
* Streams current and live derivative market oracle prices.
|
|
29
|
+
*
|
|
30
|
+
* @generated from protobuf rpc: StreamMarkets
|
|
31
|
+
*/
|
|
32
|
+
streamMarkets(input: StreamMarketsRequest, options?: RpcOptions): ServerStreamingCall<StreamMarketsRequest, StreamMarketsResponse>;
|
|
33
|
+
}
|
|
34
|
+
/**
|
|
35
|
+
* MarketStream market oracle stream API.
|
|
36
|
+
*
|
|
37
|
+
* @generated from protobuf service injective.price.oracle.api.v1.Oracle
|
|
38
|
+
*/
|
|
39
|
+
export class OracleClient implements IOracleClient, ServiceInfo {
|
|
40
|
+
typeName = Oracle.typeName;
|
|
41
|
+
methods = Oracle.methods;
|
|
42
|
+
options = Oracle.options;
|
|
43
|
+
constructor(private readonly _transport: RpcTransport) {
|
|
44
|
+
}
|
|
45
|
+
/**
|
|
46
|
+
* Streams current and live derivative market oracle prices.
|
|
47
|
+
*
|
|
48
|
+
* @generated from protobuf rpc: StreamMarkets
|
|
49
|
+
*/
|
|
50
|
+
streamMarkets(input: StreamMarketsRequest, options?: RpcOptions): ServerStreamingCall<StreamMarketsRequest, StreamMarketsResponse> {
|
|
51
|
+
const method = this.methods[0], opt = this._transport.mergeOptions(options);
|
|
52
|
+
return stackIntercept<StreamMarketsRequest, StreamMarketsResponse>("serverStreaming", this._transport, method, opt, input);
|
|
53
|
+
}
|
|
54
|
+
}
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import { Oracle } from "./goagen_api_oracle_pb.js";
|
|
2
|
+
import { stackIntercept } from "@protobuf-ts/runtime-rpc";
|
|
3
|
+
class OracleClient {
|
|
4
|
+
constructor(_transport) {
|
|
5
|
+
this._transport = _transport;
|
|
6
|
+
this.typeName = Oracle.typeName;
|
|
7
|
+
this.methods = Oracle.methods;
|
|
8
|
+
this.options = Oracle.options;
|
|
9
|
+
}
|
|
10
|
+
/**
|
|
11
|
+
* Streams current and live derivative market oracle prices.
|
|
12
|
+
*
|
|
13
|
+
* @generated from protobuf rpc: StreamMarkets
|
|
14
|
+
*/
|
|
15
|
+
streamMarkets(input, options) {
|
|
16
|
+
const method = this.methods[0], opt = this._transport.mergeOptions(options);
|
|
17
|
+
return stackIntercept("serverStreaming", this._transport, method, opt, input);
|
|
18
|
+
}
|
|
19
|
+
}
|
|
20
|
+
export {
|
|
21
|
+
OracleClient
|
|
22
|
+
};
|
|
@@ -0,0 +1,516 @@
|
|
|
1
|
+
// @generated by protobuf-ts 2.11.1 with parameter add_pb_suffix
|
|
2
|
+
// @generated from protobuf file "goagen_api_oracle.proto" (package "injective.price.oracle.api.v1", syntax proto3)
|
|
3
|
+
// tslint:disable
|
|
4
|
+
//
|
|
5
|
+
// Code generated with goa, DO NOT EDIT.
|
|
6
|
+
//
|
|
7
|
+
// oracle protocol buffer definition
|
|
8
|
+
//
|
|
9
|
+
// Command:
|
|
10
|
+
// $ goa gen github.com/InjectiveLabs/injective-ws-price-oracle/api/design -o
|
|
11
|
+
// api
|
|
12
|
+
//
|
|
13
|
+
import { ServiceType } from "@protobuf-ts/runtime-rpc";
|
|
14
|
+
import type { BinaryWriteOptions } from "@protobuf-ts/runtime";
|
|
15
|
+
import type { IBinaryWriter } from "@protobuf-ts/runtime";
|
|
16
|
+
import { WireType } from "@protobuf-ts/runtime";
|
|
17
|
+
import type { BinaryReadOptions } from "@protobuf-ts/runtime";
|
|
18
|
+
import type { IBinaryReader } from "@protobuf-ts/runtime";
|
|
19
|
+
import { UnknownFieldHandler } from "@protobuf-ts/runtime";
|
|
20
|
+
import type { PartialMessage } from "@protobuf-ts/runtime";
|
|
21
|
+
import { reflectionMergePartial } from "@protobuf-ts/runtime";
|
|
22
|
+
import { MessageType } from "@protobuf-ts/runtime";
|
|
23
|
+
/**
|
|
24
|
+
* @generated from protobuf message injective.price.oracle.api.v1.StreamMarketsRequest
|
|
25
|
+
*/
|
|
26
|
+
export interface StreamMarketsRequest {
|
|
27
|
+
/**
|
|
28
|
+
* @generated from protobuf field: repeated string market_ids = 1
|
|
29
|
+
*/
|
|
30
|
+
marketIds: string[];
|
|
31
|
+
/**
|
|
32
|
+
* @generated from protobuf field: repeated string oracle_types = 2
|
|
33
|
+
*/
|
|
34
|
+
oracleTypes: string[];
|
|
35
|
+
/**
|
|
36
|
+
* @generated from protobuf field: optional bool include_inactive = 3
|
|
37
|
+
*/
|
|
38
|
+
includeInactive?: boolean;
|
|
39
|
+
}
|
|
40
|
+
/**
|
|
41
|
+
* @generated from protobuf message injective.price.oracle.api.v1.StreamMarketsResponse
|
|
42
|
+
*/
|
|
43
|
+
export interface StreamMarketsResponse {
|
|
44
|
+
/**
|
|
45
|
+
* @generated from protobuf field: string type = 1
|
|
46
|
+
*/
|
|
47
|
+
type: string;
|
|
48
|
+
/**
|
|
49
|
+
* @generated from protobuf field: optional string market_id = 2
|
|
50
|
+
*/
|
|
51
|
+
marketId?: string;
|
|
52
|
+
/**
|
|
53
|
+
* @generated from protobuf field: optional string market_ticker = 3
|
|
54
|
+
*/
|
|
55
|
+
marketTicker?: string;
|
|
56
|
+
/**
|
|
57
|
+
* @generated from protobuf field: optional string oracle_base = 4
|
|
58
|
+
*/
|
|
59
|
+
oracleBase?: string;
|
|
60
|
+
/**
|
|
61
|
+
* @generated from protobuf field: optional string oracle_quote = 5
|
|
62
|
+
*/
|
|
63
|
+
oracleQuote?: string;
|
|
64
|
+
/**
|
|
65
|
+
* @generated from protobuf field: optional string oracle_type = 6
|
|
66
|
+
*/
|
|
67
|
+
oracleType?: string;
|
|
68
|
+
/**
|
|
69
|
+
* @generated from protobuf field: optional sint32 oracle_scale_factor = 7
|
|
70
|
+
*/
|
|
71
|
+
oracleScaleFactor?: number;
|
|
72
|
+
/**
|
|
73
|
+
* @generated from protobuf field: optional bool active = 8
|
|
74
|
+
*/
|
|
75
|
+
active?: boolean;
|
|
76
|
+
/**
|
|
77
|
+
* @generated from protobuf field: optional string price = 9
|
|
78
|
+
*/
|
|
79
|
+
price?: string;
|
|
80
|
+
/**
|
|
81
|
+
* @generated from protobuf field: optional string timestamp = 10
|
|
82
|
+
*/
|
|
83
|
+
timestamp?: string;
|
|
84
|
+
/**
|
|
85
|
+
* @generated from protobuf field: optional string received_at = 11
|
|
86
|
+
*/
|
|
87
|
+
receivedAt?: string;
|
|
88
|
+
/**
|
|
89
|
+
* @generated from protobuf field: optional uint64 sequence = 12
|
|
90
|
+
*/
|
|
91
|
+
sequence?: bigint;
|
|
92
|
+
/**
|
|
93
|
+
* @generated from protobuf field: repeated injective.price.oracle.api.v1.MarketStreamLeg legs = 13
|
|
94
|
+
*/
|
|
95
|
+
legs: MarketStreamLeg[];
|
|
96
|
+
/**
|
|
97
|
+
* @generated from protobuf field: optional string verification_status = 14
|
|
98
|
+
*/
|
|
99
|
+
verificationStatus?: string;
|
|
100
|
+
/**
|
|
101
|
+
* @generated from protobuf field: injective.price.oracle.api.v1.MarketStreamRawPayload raw = 15
|
|
102
|
+
*/
|
|
103
|
+
raw?: MarketStreamRawPayload;
|
|
104
|
+
}
|
|
105
|
+
/**
|
|
106
|
+
* @generated from protobuf message injective.price.oracle.api.v1.MarketStreamLeg
|
|
107
|
+
*/
|
|
108
|
+
export interface MarketStreamLeg {
|
|
109
|
+
/**
|
|
110
|
+
* @generated from protobuf field: optional string oracle_type = 1
|
|
111
|
+
*/
|
|
112
|
+
oracleType?: string;
|
|
113
|
+
/**
|
|
114
|
+
* @generated from protobuf field: optional string base = 2
|
|
115
|
+
*/
|
|
116
|
+
base?: string;
|
|
117
|
+
/**
|
|
118
|
+
* @generated from protobuf field: optional string quote = 3
|
|
119
|
+
*/
|
|
120
|
+
quote?: string;
|
|
121
|
+
/**
|
|
122
|
+
* @generated from protobuf field: optional string price = 4
|
|
123
|
+
*/
|
|
124
|
+
price?: string;
|
|
125
|
+
/**
|
|
126
|
+
* @generated from protobuf field: optional string timestamp = 5
|
|
127
|
+
*/
|
|
128
|
+
timestamp?: string;
|
|
129
|
+
/**
|
|
130
|
+
* @generated from protobuf field: optional string source = 6
|
|
131
|
+
*/
|
|
132
|
+
source?: string;
|
|
133
|
+
}
|
|
134
|
+
/**
|
|
135
|
+
* @generated from protobuf message injective.price.oracle.api.v1.MarketStreamRawPayload
|
|
136
|
+
*/
|
|
137
|
+
export interface MarketStreamRawPayload {
|
|
138
|
+
/**
|
|
139
|
+
* @generated from protobuf field: optional string provider = 1
|
|
140
|
+
*/
|
|
141
|
+
provider?: string;
|
|
142
|
+
/**
|
|
143
|
+
* @generated from protobuf field: optional string feed_id = 2
|
|
144
|
+
*/
|
|
145
|
+
feedId?: string;
|
|
146
|
+
/**
|
|
147
|
+
* @generated from protobuf field: optional string encoding = 3
|
|
148
|
+
*/
|
|
149
|
+
encoding?: string;
|
|
150
|
+
/**
|
|
151
|
+
* @generated from protobuf field: optional string data = 4
|
|
152
|
+
*/
|
|
153
|
+
data?: string;
|
|
154
|
+
}
|
|
155
|
+
// @generated message type with reflection information, may provide speed optimized methods
|
|
156
|
+
class StreamMarketsRequest$Type extends MessageType<StreamMarketsRequest> {
|
|
157
|
+
constructor() {
|
|
158
|
+
super("injective.price.oracle.api.v1.StreamMarketsRequest", [
|
|
159
|
+
{ no: 1, name: "market_ids", kind: "scalar", repeat: 2 /*RepeatType.UNPACKED*/, T: 9 /*ScalarType.STRING*/ },
|
|
160
|
+
{ no: 2, name: "oracle_types", kind: "scalar", repeat: 2 /*RepeatType.UNPACKED*/, T: 9 /*ScalarType.STRING*/ },
|
|
161
|
+
{ no: 3, name: "include_inactive", kind: "scalar", opt: true, T: 8 /*ScalarType.BOOL*/ }
|
|
162
|
+
]);
|
|
163
|
+
}
|
|
164
|
+
create(value?: PartialMessage<StreamMarketsRequest>): StreamMarketsRequest {
|
|
165
|
+
const message = globalThis.Object.create((this.messagePrototype!));
|
|
166
|
+
message.marketIds = [];
|
|
167
|
+
message.oracleTypes = [];
|
|
168
|
+
if (value !== undefined)
|
|
169
|
+
reflectionMergePartial<StreamMarketsRequest>(this, message, value);
|
|
170
|
+
return message;
|
|
171
|
+
}
|
|
172
|
+
internalBinaryRead(reader: IBinaryReader, length: number, options: BinaryReadOptions, target?: StreamMarketsRequest): StreamMarketsRequest {
|
|
173
|
+
let message = target ?? this.create(), end = reader.pos + length;
|
|
174
|
+
while (reader.pos < end) {
|
|
175
|
+
let [fieldNo, wireType] = reader.tag();
|
|
176
|
+
switch (fieldNo) {
|
|
177
|
+
case /* repeated string market_ids */ 1:
|
|
178
|
+
message.marketIds.push(reader.string());
|
|
179
|
+
break;
|
|
180
|
+
case /* repeated string oracle_types */ 2:
|
|
181
|
+
message.oracleTypes.push(reader.string());
|
|
182
|
+
break;
|
|
183
|
+
case /* optional bool include_inactive */ 3:
|
|
184
|
+
message.includeInactive = reader.bool();
|
|
185
|
+
break;
|
|
186
|
+
default:
|
|
187
|
+
let u = options.readUnknownField;
|
|
188
|
+
if (u === "throw")
|
|
189
|
+
throw new globalThis.Error(`Unknown field ${fieldNo} (wire type ${wireType}) for ${this.typeName}`);
|
|
190
|
+
let d = reader.skip(wireType);
|
|
191
|
+
if (u !== false)
|
|
192
|
+
(u === true ? UnknownFieldHandler.onRead : u)(this.typeName, message, fieldNo, wireType, d);
|
|
193
|
+
}
|
|
194
|
+
}
|
|
195
|
+
return message;
|
|
196
|
+
}
|
|
197
|
+
internalBinaryWrite(message: StreamMarketsRequest, writer: IBinaryWriter, options: BinaryWriteOptions): IBinaryWriter {
|
|
198
|
+
/* repeated string market_ids = 1; */
|
|
199
|
+
for (let i = 0; i < message.marketIds.length; i++)
|
|
200
|
+
writer.tag(1, WireType.LengthDelimited).string(message.marketIds[i]);
|
|
201
|
+
/* repeated string oracle_types = 2; */
|
|
202
|
+
for (let i = 0; i < message.oracleTypes.length; i++)
|
|
203
|
+
writer.tag(2, WireType.LengthDelimited).string(message.oracleTypes[i]);
|
|
204
|
+
/* optional bool include_inactive = 3; */
|
|
205
|
+
if (message.includeInactive !== undefined)
|
|
206
|
+
writer.tag(3, WireType.Varint).bool(message.includeInactive);
|
|
207
|
+
let u = options.writeUnknownFields;
|
|
208
|
+
if (u !== false)
|
|
209
|
+
(u == true ? UnknownFieldHandler.onWrite : u)(this.typeName, message, writer);
|
|
210
|
+
return writer;
|
|
211
|
+
}
|
|
212
|
+
}
|
|
213
|
+
/**
|
|
214
|
+
* @generated MessageType for protobuf message injective.price.oracle.api.v1.StreamMarketsRequest
|
|
215
|
+
*/
|
|
216
|
+
export const StreamMarketsRequest = new StreamMarketsRequest$Type();
|
|
217
|
+
// @generated message type with reflection information, may provide speed optimized methods
|
|
218
|
+
class StreamMarketsResponse$Type extends MessageType<StreamMarketsResponse> {
|
|
219
|
+
constructor() {
|
|
220
|
+
super("injective.price.oracle.api.v1.StreamMarketsResponse", [
|
|
221
|
+
{ no: 1, name: "type", kind: "scalar", T: 9 /*ScalarType.STRING*/ },
|
|
222
|
+
{ no: 2, name: "market_id", kind: "scalar", opt: true, T: 9 /*ScalarType.STRING*/ },
|
|
223
|
+
{ no: 3, name: "market_ticker", kind: "scalar", opt: true, T: 9 /*ScalarType.STRING*/ },
|
|
224
|
+
{ no: 4, name: "oracle_base", kind: "scalar", opt: true, T: 9 /*ScalarType.STRING*/ },
|
|
225
|
+
{ no: 5, name: "oracle_quote", kind: "scalar", opt: true, T: 9 /*ScalarType.STRING*/ },
|
|
226
|
+
{ no: 6, name: "oracle_type", kind: "scalar", opt: true, T: 9 /*ScalarType.STRING*/ },
|
|
227
|
+
{ no: 7, name: "oracle_scale_factor", kind: "scalar", opt: true, T: 17 /*ScalarType.SINT32*/ },
|
|
228
|
+
{ no: 8, name: "active", kind: "scalar", opt: true, T: 8 /*ScalarType.BOOL*/ },
|
|
229
|
+
{ no: 9, name: "price", kind: "scalar", opt: true, T: 9 /*ScalarType.STRING*/ },
|
|
230
|
+
{ no: 10, name: "timestamp", kind: "scalar", opt: true, T: 9 /*ScalarType.STRING*/ },
|
|
231
|
+
{ no: 11, name: "received_at", kind: "scalar", opt: true, T: 9 /*ScalarType.STRING*/ },
|
|
232
|
+
{ no: 12, name: "sequence", kind: "scalar", opt: true, T: 4 /*ScalarType.UINT64*/, L: 0 /*LongType.BIGINT*/ },
|
|
233
|
+
{ no: 13, name: "legs", kind: "message", repeat: 2 /*RepeatType.UNPACKED*/, T: () => MarketStreamLeg },
|
|
234
|
+
{ no: 14, name: "verification_status", kind: "scalar", opt: true, T: 9 /*ScalarType.STRING*/ },
|
|
235
|
+
{ no: 15, name: "raw", kind: "message", T: () => MarketStreamRawPayload }
|
|
236
|
+
]);
|
|
237
|
+
}
|
|
238
|
+
create(value?: PartialMessage<StreamMarketsResponse>): StreamMarketsResponse {
|
|
239
|
+
const message = globalThis.Object.create((this.messagePrototype!));
|
|
240
|
+
message.type = "";
|
|
241
|
+
message.legs = [];
|
|
242
|
+
if (value !== undefined)
|
|
243
|
+
reflectionMergePartial<StreamMarketsResponse>(this, message, value);
|
|
244
|
+
return message;
|
|
245
|
+
}
|
|
246
|
+
internalBinaryRead(reader: IBinaryReader, length: number, options: BinaryReadOptions, target?: StreamMarketsResponse): StreamMarketsResponse {
|
|
247
|
+
let message = target ?? this.create(), end = reader.pos + length;
|
|
248
|
+
while (reader.pos < end) {
|
|
249
|
+
let [fieldNo, wireType] = reader.tag();
|
|
250
|
+
switch (fieldNo) {
|
|
251
|
+
case /* string type */ 1:
|
|
252
|
+
message.type = reader.string();
|
|
253
|
+
break;
|
|
254
|
+
case /* optional string market_id */ 2:
|
|
255
|
+
message.marketId = reader.string();
|
|
256
|
+
break;
|
|
257
|
+
case /* optional string market_ticker */ 3:
|
|
258
|
+
message.marketTicker = reader.string();
|
|
259
|
+
break;
|
|
260
|
+
case /* optional string oracle_base */ 4:
|
|
261
|
+
message.oracleBase = reader.string();
|
|
262
|
+
break;
|
|
263
|
+
case /* optional string oracle_quote */ 5:
|
|
264
|
+
message.oracleQuote = reader.string();
|
|
265
|
+
break;
|
|
266
|
+
case /* optional string oracle_type */ 6:
|
|
267
|
+
message.oracleType = reader.string();
|
|
268
|
+
break;
|
|
269
|
+
case /* optional sint32 oracle_scale_factor */ 7:
|
|
270
|
+
message.oracleScaleFactor = reader.sint32();
|
|
271
|
+
break;
|
|
272
|
+
case /* optional bool active */ 8:
|
|
273
|
+
message.active = reader.bool();
|
|
274
|
+
break;
|
|
275
|
+
case /* optional string price */ 9:
|
|
276
|
+
message.price = reader.string();
|
|
277
|
+
break;
|
|
278
|
+
case /* optional string timestamp */ 10:
|
|
279
|
+
message.timestamp = reader.string();
|
|
280
|
+
break;
|
|
281
|
+
case /* optional string received_at */ 11:
|
|
282
|
+
message.receivedAt = reader.string();
|
|
283
|
+
break;
|
|
284
|
+
case /* optional uint64 sequence */ 12:
|
|
285
|
+
message.sequence = reader.uint64().toBigInt();
|
|
286
|
+
break;
|
|
287
|
+
case /* repeated injective.price.oracle.api.v1.MarketStreamLeg legs */ 13:
|
|
288
|
+
message.legs.push(MarketStreamLeg.internalBinaryRead(reader, reader.uint32(), options));
|
|
289
|
+
break;
|
|
290
|
+
case /* optional string verification_status */ 14:
|
|
291
|
+
message.verificationStatus = reader.string();
|
|
292
|
+
break;
|
|
293
|
+
case /* injective.price.oracle.api.v1.MarketStreamRawPayload raw */ 15:
|
|
294
|
+
message.raw = MarketStreamRawPayload.internalBinaryRead(reader, reader.uint32(), options, message.raw);
|
|
295
|
+
break;
|
|
296
|
+
default:
|
|
297
|
+
let u = options.readUnknownField;
|
|
298
|
+
if (u === "throw")
|
|
299
|
+
throw new globalThis.Error(`Unknown field ${fieldNo} (wire type ${wireType}) for ${this.typeName}`);
|
|
300
|
+
let d = reader.skip(wireType);
|
|
301
|
+
if (u !== false)
|
|
302
|
+
(u === true ? UnknownFieldHandler.onRead : u)(this.typeName, message, fieldNo, wireType, d);
|
|
303
|
+
}
|
|
304
|
+
}
|
|
305
|
+
return message;
|
|
306
|
+
}
|
|
307
|
+
internalBinaryWrite(message: StreamMarketsResponse, writer: IBinaryWriter, options: BinaryWriteOptions): IBinaryWriter {
|
|
308
|
+
/* string type = 1; */
|
|
309
|
+
if (message.type !== "")
|
|
310
|
+
writer.tag(1, WireType.LengthDelimited).string(message.type);
|
|
311
|
+
/* optional string market_id = 2; */
|
|
312
|
+
if (message.marketId !== undefined)
|
|
313
|
+
writer.tag(2, WireType.LengthDelimited).string(message.marketId);
|
|
314
|
+
/* optional string market_ticker = 3; */
|
|
315
|
+
if (message.marketTicker !== undefined)
|
|
316
|
+
writer.tag(3, WireType.LengthDelimited).string(message.marketTicker);
|
|
317
|
+
/* optional string oracle_base = 4; */
|
|
318
|
+
if (message.oracleBase !== undefined)
|
|
319
|
+
writer.tag(4, WireType.LengthDelimited).string(message.oracleBase);
|
|
320
|
+
/* optional string oracle_quote = 5; */
|
|
321
|
+
if (message.oracleQuote !== undefined)
|
|
322
|
+
writer.tag(5, WireType.LengthDelimited).string(message.oracleQuote);
|
|
323
|
+
/* optional string oracle_type = 6; */
|
|
324
|
+
if (message.oracleType !== undefined)
|
|
325
|
+
writer.tag(6, WireType.LengthDelimited).string(message.oracleType);
|
|
326
|
+
/* optional sint32 oracle_scale_factor = 7; */
|
|
327
|
+
if (message.oracleScaleFactor !== undefined)
|
|
328
|
+
writer.tag(7, WireType.Varint).sint32(message.oracleScaleFactor);
|
|
329
|
+
/* optional bool active = 8; */
|
|
330
|
+
if (message.active !== undefined)
|
|
331
|
+
writer.tag(8, WireType.Varint).bool(message.active);
|
|
332
|
+
/* optional string price = 9; */
|
|
333
|
+
if (message.price !== undefined)
|
|
334
|
+
writer.tag(9, WireType.LengthDelimited).string(message.price);
|
|
335
|
+
/* optional string timestamp = 10; */
|
|
336
|
+
if (message.timestamp !== undefined)
|
|
337
|
+
writer.tag(10, WireType.LengthDelimited).string(message.timestamp);
|
|
338
|
+
/* optional string received_at = 11; */
|
|
339
|
+
if (message.receivedAt !== undefined)
|
|
340
|
+
writer.tag(11, WireType.LengthDelimited).string(message.receivedAt);
|
|
341
|
+
/* optional uint64 sequence = 12; */
|
|
342
|
+
if (message.sequence !== undefined)
|
|
343
|
+
writer.tag(12, WireType.Varint).uint64(message.sequence);
|
|
344
|
+
/* repeated injective.price.oracle.api.v1.MarketStreamLeg legs = 13; */
|
|
345
|
+
for (let i = 0; i < message.legs.length; i++)
|
|
346
|
+
MarketStreamLeg.internalBinaryWrite(message.legs[i], writer.tag(13, WireType.LengthDelimited).fork(), options).join();
|
|
347
|
+
/* optional string verification_status = 14; */
|
|
348
|
+
if (message.verificationStatus !== undefined)
|
|
349
|
+
writer.tag(14, WireType.LengthDelimited).string(message.verificationStatus);
|
|
350
|
+
/* injective.price.oracle.api.v1.MarketStreamRawPayload raw = 15; */
|
|
351
|
+
if (message.raw)
|
|
352
|
+
MarketStreamRawPayload.internalBinaryWrite(message.raw, writer.tag(15, WireType.LengthDelimited).fork(), options).join();
|
|
353
|
+
let u = options.writeUnknownFields;
|
|
354
|
+
if (u !== false)
|
|
355
|
+
(u == true ? UnknownFieldHandler.onWrite : u)(this.typeName, message, writer);
|
|
356
|
+
return writer;
|
|
357
|
+
}
|
|
358
|
+
}
|
|
359
|
+
/**
|
|
360
|
+
* @generated MessageType for protobuf message injective.price.oracle.api.v1.StreamMarketsResponse
|
|
361
|
+
*/
|
|
362
|
+
export const StreamMarketsResponse = new StreamMarketsResponse$Type();
|
|
363
|
+
// @generated message type with reflection information, may provide speed optimized methods
|
|
364
|
+
class MarketStreamLeg$Type extends MessageType<MarketStreamLeg> {
|
|
365
|
+
constructor() {
|
|
366
|
+
super("injective.price.oracle.api.v1.MarketStreamLeg", [
|
|
367
|
+
{ no: 1, name: "oracle_type", kind: "scalar", opt: true, T: 9 /*ScalarType.STRING*/ },
|
|
368
|
+
{ no: 2, name: "base", kind: "scalar", opt: true, T: 9 /*ScalarType.STRING*/ },
|
|
369
|
+
{ no: 3, name: "quote", kind: "scalar", opt: true, T: 9 /*ScalarType.STRING*/ },
|
|
370
|
+
{ no: 4, name: "price", kind: "scalar", opt: true, T: 9 /*ScalarType.STRING*/ },
|
|
371
|
+
{ no: 5, name: "timestamp", kind: "scalar", opt: true, T: 9 /*ScalarType.STRING*/ },
|
|
372
|
+
{ no: 6, name: "source", kind: "scalar", opt: true, T: 9 /*ScalarType.STRING*/ }
|
|
373
|
+
]);
|
|
374
|
+
}
|
|
375
|
+
create(value?: PartialMessage<MarketStreamLeg>): MarketStreamLeg {
|
|
376
|
+
const message = globalThis.Object.create((this.messagePrototype!));
|
|
377
|
+
if (value !== undefined)
|
|
378
|
+
reflectionMergePartial<MarketStreamLeg>(this, message, value);
|
|
379
|
+
return message;
|
|
380
|
+
}
|
|
381
|
+
internalBinaryRead(reader: IBinaryReader, length: number, options: BinaryReadOptions, target?: MarketStreamLeg): MarketStreamLeg {
|
|
382
|
+
let message = target ?? this.create(), end = reader.pos + length;
|
|
383
|
+
while (reader.pos < end) {
|
|
384
|
+
let [fieldNo, wireType] = reader.tag();
|
|
385
|
+
switch (fieldNo) {
|
|
386
|
+
case /* optional string oracle_type */ 1:
|
|
387
|
+
message.oracleType = reader.string();
|
|
388
|
+
break;
|
|
389
|
+
case /* optional string base */ 2:
|
|
390
|
+
message.base = reader.string();
|
|
391
|
+
break;
|
|
392
|
+
case /* optional string quote */ 3:
|
|
393
|
+
message.quote = reader.string();
|
|
394
|
+
break;
|
|
395
|
+
case /* optional string price */ 4:
|
|
396
|
+
message.price = reader.string();
|
|
397
|
+
break;
|
|
398
|
+
case /* optional string timestamp */ 5:
|
|
399
|
+
message.timestamp = reader.string();
|
|
400
|
+
break;
|
|
401
|
+
case /* optional string source */ 6:
|
|
402
|
+
message.source = reader.string();
|
|
403
|
+
break;
|
|
404
|
+
default:
|
|
405
|
+
let u = options.readUnknownField;
|
|
406
|
+
if (u === "throw")
|
|
407
|
+
throw new globalThis.Error(`Unknown field ${fieldNo} (wire type ${wireType}) for ${this.typeName}`);
|
|
408
|
+
let d = reader.skip(wireType);
|
|
409
|
+
if (u !== false)
|
|
410
|
+
(u === true ? UnknownFieldHandler.onRead : u)(this.typeName, message, fieldNo, wireType, d);
|
|
411
|
+
}
|
|
412
|
+
}
|
|
413
|
+
return message;
|
|
414
|
+
}
|
|
415
|
+
internalBinaryWrite(message: MarketStreamLeg, writer: IBinaryWriter, options: BinaryWriteOptions): IBinaryWriter {
|
|
416
|
+
/* optional string oracle_type = 1; */
|
|
417
|
+
if (message.oracleType !== undefined)
|
|
418
|
+
writer.tag(1, WireType.LengthDelimited).string(message.oracleType);
|
|
419
|
+
/* optional string base = 2; */
|
|
420
|
+
if (message.base !== undefined)
|
|
421
|
+
writer.tag(2, WireType.LengthDelimited).string(message.base);
|
|
422
|
+
/* optional string quote = 3; */
|
|
423
|
+
if (message.quote !== undefined)
|
|
424
|
+
writer.tag(3, WireType.LengthDelimited).string(message.quote);
|
|
425
|
+
/* optional string price = 4; */
|
|
426
|
+
if (message.price !== undefined)
|
|
427
|
+
writer.tag(4, WireType.LengthDelimited).string(message.price);
|
|
428
|
+
/* optional string timestamp = 5; */
|
|
429
|
+
if (message.timestamp !== undefined)
|
|
430
|
+
writer.tag(5, WireType.LengthDelimited).string(message.timestamp);
|
|
431
|
+
/* optional string source = 6; */
|
|
432
|
+
if (message.source !== undefined)
|
|
433
|
+
writer.tag(6, WireType.LengthDelimited).string(message.source);
|
|
434
|
+
let u = options.writeUnknownFields;
|
|
435
|
+
if (u !== false)
|
|
436
|
+
(u == true ? UnknownFieldHandler.onWrite : u)(this.typeName, message, writer);
|
|
437
|
+
return writer;
|
|
438
|
+
}
|
|
439
|
+
}
|
|
440
|
+
/**
|
|
441
|
+
* @generated MessageType for protobuf message injective.price.oracle.api.v1.MarketStreamLeg
|
|
442
|
+
*/
|
|
443
|
+
export const MarketStreamLeg = new MarketStreamLeg$Type();
|
|
444
|
+
// @generated message type with reflection information, may provide speed optimized methods
|
|
445
|
+
class MarketStreamRawPayload$Type extends MessageType<MarketStreamRawPayload> {
|
|
446
|
+
constructor() {
|
|
447
|
+
super("injective.price.oracle.api.v1.MarketStreamRawPayload", [
|
|
448
|
+
{ no: 1, name: "provider", kind: "scalar", opt: true, T: 9 /*ScalarType.STRING*/ },
|
|
449
|
+
{ no: 2, name: "feed_id", kind: "scalar", opt: true, T: 9 /*ScalarType.STRING*/ },
|
|
450
|
+
{ no: 3, name: "encoding", kind: "scalar", opt: true, T: 9 /*ScalarType.STRING*/ },
|
|
451
|
+
{ no: 4, name: "data", kind: "scalar", opt: true, T: 9 /*ScalarType.STRING*/ }
|
|
452
|
+
]);
|
|
453
|
+
}
|
|
454
|
+
create(value?: PartialMessage<MarketStreamRawPayload>): MarketStreamRawPayload {
|
|
455
|
+
const message = globalThis.Object.create((this.messagePrototype!));
|
|
456
|
+
if (value !== undefined)
|
|
457
|
+
reflectionMergePartial<MarketStreamRawPayload>(this, message, value);
|
|
458
|
+
return message;
|
|
459
|
+
}
|
|
460
|
+
internalBinaryRead(reader: IBinaryReader, length: number, options: BinaryReadOptions, target?: MarketStreamRawPayload): MarketStreamRawPayload {
|
|
461
|
+
let message = target ?? this.create(), end = reader.pos + length;
|
|
462
|
+
while (reader.pos < end) {
|
|
463
|
+
let [fieldNo, wireType] = reader.tag();
|
|
464
|
+
switch (fieldNo) {
|
|
465
|
+
case /* optional string provider */ 1:
|
|
466
|
+
message.provider = reader.string();
|
|
467
|
+
break;
|
|
468
|
+
case /* optional string feed_id */ 2:
|
|
469
|
+
message.feedId = reader.string();
|
|
470
|
+
break;
|
|
471
|
+
case /* optional string encoding */ 3:
|
|
472
|
+
message.encoding = reader.string();
|
|
473
|
+
break;
|
|
474
|
+
case /* optional string data */ 4:
|
|
475
|
+
message.data = reader.string();
|
|
476
|
+
break;
|
|
477
|
+
default:
|
|
478
|
+
let u = options.readUnknownField;
|
|
479
|
+
if (u === "throw")
|
|
480
|
+
throw new globalThis.Error(`Unknown field ${fieldNo} (wire type ${wireType}) for ${this.typeName}`);
|
|
481
|
+
let d = reader.skip(wireType);
|
|
482
|
+
if (u !== false)
|
|
483
|
+
(u === true ? UnknownFieldHandler.onRead : u)(this.typeName, message, fieldNo, wireType, d);
|
|
484
|
+
}
|
|
485
|
+
}
|
|
486
|
+
return message;
|
|
487
|
+
}
|
|
488
|
+
internalBinaryWrite(message: MarketStreamRawPayload, writer: IBinaryWriter, options: BinaryWriteOptions): IBinaryWriter {
|
|
489
|
+
/* optional string provider = 1; */
|
|
490
|
+
if (message.provider !== undefined)
|
|
491
|
+
writer.tag(1, WireType.LengthDelimited).string(message.provider);
|
|
492
|
+
/* optional string feed_id = 2; */
|
|
493
|
+
if (message.feedId !== undefined)
|
|
494
|
+
writer.tag(2, WireType.LengthDelimited).string(message.feedId);
|
|
495
|
+
/* optional string encoding = 3; */
|
|
496
|
+
if (message.encoding !== undefined)
|
|
497
|
+
writer.tag(3, WireType.LengthDelimited).string(message.encoding);
|
|
498
|
+
/* optional string data = 4; */
|
|
499
|
+
if (message.data !== undefined)
|
|
500
|
+
writer.tag(4, WireType.LengthDelimited).string(message.data);
|
|
501
|
+
let u = options.writeUnknownFields;
|
|
502
|
+
if (u !== false)
|
|
503
|
+
(u == true ? UnknownFieldHandler.onWrite : u)(this.typeName, message, writer);
|
|
504
|
+
return writer;
|
|
505
|
+
}
|
|
506
|
+
}
|
|
507
|
+
/**
|
|
508
|
+
* @generated MessageType for protobuf message injective.price.oracle.api.v1.MarketStreamRawPayload
|
|
509
|
+
*/
|
|
510
|
+
export const MarketStreamRawPayload = new MarketStreamRawPayload$Type();
|
|
511
|
+
/**
|
|
512
|
+
* @generated ServiceType for protobuf service injective.price.oracle.api.v1.Oracle
|
|
513
|
+
*/
|
|
514
|
+
export const Oracle = new ServiceType("injective.price.oracle.api.v1.Oracle", [
|
|
515
|
+
{ name: "StreamMarkets", serverStreaming: true, options: {}, I: StreamMarketsRequest, O: StreamMarketsResponse }
|
|
516
|
+
]);
|
|
@@ -0,0 +1,537 @@
|
|
|
1
|
+
import { ServiceType } from "@protobuf-ts/runtime-rpc";
|
|
2
|
+
import { WireType } from "@protobuf-ts/runtime";
|
|
3
|
+
import { UnknownFieldHandler } from "@protobuf-ts/runtime";
|
|
4
|
+
import { reflectionMergePartial } from "@protobuf-ts/runtime";
|
|
5
|
+
import { MessageType } from "@protobuf-ts/runtime";
|
|
6
|
+
class StreamMarketsRequest$Type extends MessageType {
|
|
7
|
+
constructor() {
|
|
8
|
+
super("injective.price.oracle.api.v1.StreamMarketsRequest", [
|
|
9
|
+
{
|
|
10
|
+
no: 1,
|
|
11
|
+
name: "market_ids",
|
|
12
|
+
kind: "scalar",
|
|
13
|
+
repeat: 2,
|
|
14
|
+
T: 9
|
|
15
|
+
/*ScalarType.STRING*/
|
|
16
|
+
},
|
|
17
|
+
{
|
|
18
|
+
no: 2,
|
|
19
|
+
name: "oracle_types",
|
|
20
|
+
kind: "scalar",
|
|
21
|
+
repeat: 2,
|
|
22
|
+
T: 9
|
|
23
|
+
/*ScalarType.STRING*/
|
|
24
|
+
},
|
|
25
|
+
{
|
|
26
|
+
no: 3,
|
|
27
|
+
name: "include_inactive",
|
|
28
|
+
kind: "scalar",
|
|
29
|
+
opt: true,
|
|
30
|
+
T: 8
|
|
31
|
+
/*ScalarType.BOOL*/
|
|
32
|
+
}
|
|
33
|
+
]);
|
|
34
|
+
}
|
|
35
|
+
create(value) {
|
|
36
|
+
const message = globalThis.Object.create(this.messagePrototype);
|
|
37
|
+
message.marketIds = [];
|
|
38
|
+
message.oracleTypes = [];
|
|
39
|
+
if (value !== void 0)
|
|
40
|
+
reflectionMergePartial(this, message, value);
|
|
41
|
+
return message;
|
|
42
|
+
}
|
|
43
|
+
internalBinaryRead(reader, length, options, target) {
|
|
44
|
+
let message = target ?? this.create(), end = reader.pos + length;
|
|
45
|
+
while (reader.pos < end) {
|
|
46
|
+
let [fieldNo, wireType] = reader.tag();
|
|
47
|
+
switch (fieldNo) {
|
|
48
|
+
case /* repeated string market_ids */
|
|
49
|
+
1:
|
|
50
|
+
message.marketIds.push(reader.string());
|
|
51
|
+
break;
|
|
52
|
+
case /* repeated string oracle_types */
|
|
53
|
+
2:
|
|
54
|
+
message.oracleTypes.push(reader.string());
|
|
55
|
+
break;
|
|
56
|
+
case /* optional bool include_inactive */
|
|
57
|
+
3:
|
|
58
|
+
message.includeInactive = reader.bool();
|
|
59
|
+
break;
|
|
60
|
+
default:
|
|
61
|
+
let u = options.readUnknownField;
|
|
62
|
+
if (u === "throw")
|
|
63
|
+
throw new globalThis.Error(`Unknown field ${fieldNo} (wire type ${wireType}) for ${this.typeName}`);
|
|
64
|
+
let d = reader.skip(wireType);
|
|
65
|
+
if (u !== false)
|
|
66
|
+
(u === true ? UnknownFieldHandler.onRead : u)(this.typeName, message, fieldNo, wireType, d);
|
|
67
|
+
}
|
|
68
|
+
}
|
|
69
|
+
return message;
|
|
70
|
+
}
|
|
71
|
+
internalBinaryWrite(message, writer, options) {
|
|
72
|
+
for (let i = 0; i < message.marketIds.length; i++)
|
|
73
|
+
writer.tag(1, WireType.LengthDelimited).string(message.marketIds[i]);
|
|
74
|
+
for (let i = 0; i < message.oracleTypes.length; i++)
|
|
75
|
+
writer.tag(2, WireType.LengthDelimited).string(message.oracleTypes[i]);
|
|
76
|
+
if (message.includeInactive !== void 0)
|
|
77
|
+
writer.tag(3, WireType.Varint).bool(message.includeInactive);
|
|
78
|
+
let u = options.writeUnknownFields;
|
|
79
|
+
if (u !== false)
|
|
80
|
+
(u == true ? UnknownFieldHandler.onWrite : u)(this.typeName, message, writer);
|
|
81
|
+
return writer;
|
|
82
|
+
}
|
|
83
|
+
}
|
|
84
|
+
const StreamMarketsRequest = new StreamMarketsRequest$Type();
|
|
85
|
+
class StreamMarketsResponse$Type extends MessageType {
|
|
86
|
+
constructor() {
|
|
87
|
+
super("injective.price.oracle.api.v1.StreamMarketsResponse", [
|
|
88
|
+
{
|
|
89
|
+
no: 1,
|
|
90
|
+
name: "type",
|
|
91
|
+
kind: "scalar",
|
|
92
|
+
T: 9
|
|
93
|
+
/*ScalarType.STRING*/
|
|
94
|
+
},
|
|
95
|
+
{
|
|
96
|
+
no: 2,
|
|
97
|
+
name: "market_id",
|
|
98
|
+
kind: "scalar",
|
|
99
|
+
opt: true,
|
|
100
|
+
T: 9
|
|
101
|
+
/*ScalarType.STRING*/
|
|
102
|
+
},
|
|
103
|
+
{
|
|
104
|
+
no: 3,
|
|
105
|
+
name: "market_ticker",
|
|
106
|
+
kind: "scalar",
|
|
107
|
+
opt: true,
|
|
108
|
+
T: 9
|
|
109
|
+
/*ScalarType.STRING*/
|
|
110
|
+
},
|
|
111
|
+
{
|
|
112
|
+
no: 4,
|
|
113
|
+
name: "oracle_base",
|
|
114
|
+
kind: "scalar",
|
|
115
|
+
opt: true,
|
|
116
|
+
T: 9
|
|
117
|
+
/*ScalarType.STRING*/
|
|
118
|
+
},
|
|
119
|
+
{
|
|
120
|
+
no: 5,
|
|
121
|
+
name: "oracle_quote",
|
|
122
|
+
kind: "scalar",
|
|
123
|
+
opt: true,
|
|
124
|
+
T: 9
|
|
125
|
+
/*ScalarType.STRING*/
|
|
126
|
+
},
|
|
127
|
+
{
|
|
128
|
+
no: 6,
|
|
129
|
+
name: "oracle_type",
|
|
130
|
+
kind: "scalar",
|
|
131
|
+
opt: true,
|
|
132
|
+
T: 9
|
|
133
|
+
/*ScalarType.STRING*/
|
|
134
|
+
},
|
|
135
|
+
{
|
|
136
|
+
no: 7,
|
|
137
|
+
name: "oracle_scale_factor",
|
|
138
|
+
kind: "scalar",
|
|
139
|
+
opt: true,
|
|
140
|
+
T: 17
|
|
141
|
+
/*ScalarType.SINT32*/
|
|
142
|
+
},
|
|
143
|
+
{
|
|
144
|
+
no: 8,
|
|
145
|
+
name: "active",
|
|
146
|
+
kind: "scalar",
|
|
147
|
+
opt: true,
|
|
148
|
+
T: 8
|
|
149
|
+
/*ScalarType.BOOL*/
|
|
150
|
+
},
|
|
151
|
+
{
|
|
152
|
+
no: 9,
|
|
153
|
+
name: "price",
|
|
154
|
+
kind: "scalar",
|
|
155
|
+
opt: true,
|
|
156
|
+
T: 9
|
|
157
|
+
/*ScalarType.STRING*/
|
|
158
|
+
},
|
|
159
|
+
{
|
|
160
|
+
no: 10,
|
|
161
|
+
name: "timestamp",
|
|
162
|
+
kind: "scalar",
|
|
163
|
+
opt: true,
|
|
164
|
+
T: 9
|
|
165
|
+
/*ScalarType.STRING*/
|
|
166
|
+
},
|
|
167
|
+
{
|
|
168
|
+
no: 11,
|
|
169
|
+
name: "received_at",
|
|
170
|
+
kind: "scalar",
|
|
171
|
+
opt: true,
|
|
172
|
+
T: 9
|
|
173
|
+
/*ScalarType.STRING*/
|
|
174
|
+
},
|
|
175
|
+
{
|
|
176
|
+
no: 12,
|
|
177
|
+
name: "sequence",
|
|
178
|
+
kind: "scalar",
|
|
179
|
+
opt: true,
|
|
180
|
+
T: 4,
|
|
181
|
+
L: 0
|
|
182
|
+
/*LongType.BIGINT*/
|
|
183
|
+
},
|
|
184
|
+
{ no: 13, name: "legs", kind: "message", repeat: 2, T: () => MarketStreamLeg },
|
|
185
|
+
{
|
|
186
|
+
no: 14,
|
|
187
|
+
name: "verification_status",
|
|
188
|
+
kind: "scalar",
|
|
189
|
+
opt: true,
|
|
190
|
+
T: 9
|
|
191
|
+
/*ScalarType.STRING*/
|
|
192
|
+
},
|
|
193
|
+
{ no: 15, name: "raw", kind: "message", T: () => MarketStreamRawPayload }
|
|
194
|
+
]);
|
|
195
|
+
}
|
|
196
|
+
create(value) {
|
|
197
|
+
const message = globalThis.Object.create(this.messagePrototype);
|
|
198
|
+
message.type = "";
|
|
199
|
+
message.legs = [];
|
|
200
|
+
if (value !== void 0)
|
|
201
|
+
reflectionMergePartial(this, message, value);
|
|
202
|
+
return message;
|
|
203
|
+
}
|
|
204
|
+
internalBinaryRead(reader, length, options, target) {
|
|
205
|
+
let message = target ?? this.create(), end = reader.pos + length;
|
|
206
|
+
while (reader.pos < end) {
|
|
207
|
+
let [fieldNo, wireType] = reader.tag();
|
|
208
|
+
switch (fieldNo) {
|
|
209
|
+
case /* string type */
|
|
210
|
+
1:
|
|
211
|
+
message.type = reader.string();
|
|
212
|
+
break;
|
|
213
|
+
case /* optional string market_id */
|
|
214
|
+
2:
|
|
215
|
+
message.marketId = reader.string();
|
|
216
|
+
break;
|
|
217
|
+
case /* optional string market_ticker */
|
|
218
|
+
3:
|
|
219
|
+
message.marketTicker = reader.string();
|
|
220
|
+
break;
|
|
221
|
+
case /* optional string oracle_base */
|
|
222
|
+
4:
|
|
223
|
+
message.oracleBase = reader.string();
|
|
224
|
+
break;
|
|
225
|
+
case /* optional string oracle_quote */
|
|
226
|
+
5:
|
|
227
|
+
message.oracleQuote = reader.string();
|
|
228
|
+
break;
|
|
229
|
+
case /* optional string oracle_type */
|
|
230
|
+
6:
|
|
231
|
+
message.oracleType = reader.string();
|
|
232
|
+
break;
|
|
233
|
+
case /* optional sint32 oracle_scale_factor */
|
|
234
|
+
7:
|
|
235
|
+
message.oracleScaleFactor = reader.sint32();
|
|
236
|
+
break;
|
|
237
|
+
case /* optional bool active */
|
|
238
|
+
8:
|
|
239
|
+
message.active = reader.bool();
|
|
240
|
+
break;
|
|
241
|
+
case /* optional string price */
|
|
242
|
+
9:
|
|
243
|
+
message.price = reader.string();
|
|
244
|
+
break;
|
|
245
|
+
case /* optional string timestamp */
|
|
246
|
+
10:
|
|
247
|
+
message.timestamp = reader.string();
|
|
248
|
+
break;
|
|
249
|
+
case /* optional string received_at */
|
|
250
|
+
11:
|
|
251
|
+
message.receivedAt = reader.string();
|
|
252
|
+
break;
|
|
253
|
+
case /* optional uint64 sequence */
|
|
254
|
+
12:
|
|
255
|
+
message.sequence = reader.uint64().toBigInt();
|
|
256
|
+
break;
|
|
257
|
+
case /* repeated injective.price.oracle.api.v1.MarketStreamLeg legs */
|
|
258
|
+
13:
|
|
259
|
+
message.legs.push(MarketStreamLeg.internalBinaryRead(reader, reader.uint32(), options));
|
|
260
|
+
break;
|
|
261
|
+
case /* optional string verification_status */
|
|
262
|
+
14:
|
|
263
|
+
message.verificationStatus = reader.string();
|
|
264
|
+
break;
|
|
265
|
+
case /* injective.price.oracle.api.v1.MarketStreamRawPayload raw */
|
|
266
|
+
15:
|
|
267
|
+
message.raw = MarketStreamRawPayload.internalBinaryRead(reader, reader.uint32(), options, message.raw);
|
|
268
|
+
break;
|
|
269
|
+
default:
|
|
270
|
+
let u = options.readUnknownField;
|
|
271
|
+
if (u === "throw")
|
|
272
|
+
throw new globalThis.Error(`Unknown field ${fieldNo} (wire type ${wireType}) for ${this.typeName}`);
|
|
273
|
+
let d = reader.skip(wireType);
|
|
274
|
+
if (u !== false)
|
|
275
|
+
(u === true ? UnknownFieldHandler.onRead : u)(this.typeName, message, fieldNo, wireType, d);
|
|
276
|
+
}
|
|
277
|
+
}
|
|
278
|
+
return message;
|
|
279
|
+
}
|
|
280
|
+
internalBinaryWrite(message, writer, options) {
|
|
281
|
+
if (message.type !== "")
|
|
282
|
+
writer.tag(1, WireType.LengthDelimited).string(message.type);
|
|
283
|
+
if (message.marketId !== void 0)
|
|
284
|
+
writer.tag(2, WireType.LengthDelimited).string(message.marketId);
|
|
285
|
+
if (message.marketTicker !== void 0)
|
|
286
|
+
writer.tag(3, WireType.LengthDelimited).string(message.marketTicker);
|
|
287
|
+
if (message.oracleBase !== void 0)
|
|
288
|
+
writer.tag(4, WireType.LengthDelimited).string(message.oracleBase);
|
|
289
|
+
if (message.oracleQuote !== void 0)
|
|
290
|
+
writer.tag(5, WireType.LengthDelimited).string(message.oracleQuote);
|
|
291
|
+
if (message.oracleType !== void 0)
|
|
292
|
+
writer.tag(6, WireType.LengthDelimited).string(message.oracleType);
|
|
293
|
+
if (message.oracleScaleFactor !== void 0)
|
|
294
|
+
writer.tag(7, WireType.Varint).sint32(message.oracleScaleFactor);
|
|
295
|
+
if (message.active !== void 0)
|
|
296
|
+
writer.tag(8, WireType.Varint).bool(message.active);
|
|
297
|
+
if (message.price !== void 0)
|
|
298
|
+
writer.tag(9, WireType.LengthDelimited).string(message.price);
|
|
299
|
+
if (message.timestamp !== void 0)
|
|
300
|
+
writer.tag(10, WireType.LengthDelimited).string(message.timestamp);
|
|
301
|
+
if (message.receivedAt !== void 0)
|
|
302
|
+
writer.tag(11, WireType.LengthDelimited).string(message.receivedAt);
|
|
303
|
+
if (message.sequence !== void 0)
|
|
304
|
+
writer.tag(12, WireType.Varint).uint64(message.sequence);
|
|
305
|
+
for (let i = 0; i < message.legs.length; i++)
|
|
306
|
+
MarketStreamLeg.internalBinaryWrite(message.legs[i], writer.tag(13, WireType.LengthDelimited).fork(), options).join();
|
|
307
|
+
if (message.verificationStatus !== void 0)
|
|
308
|
+
writer.tag(14, WireType.LengthDelimited).string(message.verificationStatus);
|
|
309
|
+
if (message.raw)
|
|
310
|
+
MarketStreamRawPayload.internalBinaryWrite(message.raw, writer.tag(15, WireType.LengthDelimited).fork(), options).join();
|
|
311
|
+
let u = options.writeUnknownFields;
|
|
312
|
+
if (u !== false)
|
|
313
|
+
(u == true ? UnknownFieldHandler.onWrite : u)(this.typeName, message, writer);
|
|
314
|
+
return writer;
|
|
315
|
+
}
|
|
316
|
+
}
|
|
317
|
+
const StreamMarketsResponse = new StreamMarketsResponse$Type();
|
|
318
|
+
class MarketStreamLeg$Type extends MessageType {
|
|
319
|
+
constructor() {
|
|
320
|
+
super("injective.price.oracle.api.v1.MarketStreamLeg", [
|
|
321
|
+
{
|
|
322
|
+
no: 1,
|
|
323
|
+
name: "oracle_type",
|
|
324
|
+
kind: "scalar",
|
|
325
|
+
opt: true,
|
|
326
|
+
T: 9
|
|
327
|
+
/*ScalarType.STRING*/
|
|
328
|
+
},
|
|
329
|
+
{
|
|
330
|
+
no: 2,
|
|
331
|
+
name: "base",
|
|
332
|
+
kind: "scalar",
|
|
333
|
+
opt: true,
|
|
334
|
+
T: 9
|
|
335
|
+
/*ScalarType.STRING*/
|
|
336
|
+
},
|
|
337
|
+
{
|
|
338
|
+
no: 3,
|
|
339
|
+
name: "quote",
|
|
340
|
+
kind: "scalar",
|
|
341
|
+
opt: true,
|
|
342
|
+
T: 9
|
|
343
|
+
/*ScalarType.STRING*/
|
|
344
|
+
},
|
|
345
|
+
{
|
|
346
|
+
no: 4,
|
|
347
|
+
name: "price",
|
|
348
|
+
kind: "scalar",
|
|
349
|
+
opt: true,
|
|
350
|
+
T: 9
|
|
351
|
+
/*ScalarType.STRING*/
|
|
352
|
+
},
|
|
353
|
+
{
|
|
354
|
+
no: 5,
|
|
355
|
+
name: "timestamp",
|
|
356
|
+
kind: "scalar",
|
|
357
|
+
opt: true,
|
|
358
|
+
T: 9
|
|
359
|
+
/*ScalarType.STRING*/
|
|
360
|
+
},
|
|
361
|
+
{
|
|
362
|
+
no: 6,
|
|
363
|
+
name: "source",
|
|
364
|
+
kind: "scalar",
|
|
365
|
+
opt: true,
|
|
366
|
+
T: 9
|
|
367
|
+
/*ScalarType.STRING*/
|
|
368
|
+
}
|
|
369
|
+
]);
|
|
370
|
+
}
|
|
371
|
+
create(value) {
|
|
372
|
+
const message = globalThis.Object.create(this.messagePrototype);
|
|
373
|
+
if (value !== void 0)
|
|
374
|
+
reflectionMergePartial(this, message, value);
|
|
375
|
+
return message;
|
|
376
|
+
}
|
|
377
|
+
internalBinaryRead(reader, length, options, target) {
|
|
378
|
+
let message = target ?? this.create(), end = reader.pos + length;
|
|
379
|
+
while (reader.pos < end) {
|
|
380
|
+
let [fieldNo, wireType] = reader.tag();
|
|
381
|
+
switch (fieldNo) {
|
|
382
|
+
case /* optional string oracle_type */
|
|
383
|
+
1:
|
|
384
|
+
message.oracleType = reader.string();
|
|
385
|
+
break;
|
|
386
|
+
case /* optional string base */
|
|
387
|
+
2:
|
|
388
|
+
message.base = reader.string();
|
|
389
|
+
break;
|
|
390
|
+
case /* optional string quote */
|
|
391
|
+
3:
|
|
392
|
+
message.quote = reader.string();
|
|
393
|
+
break;
|
|
394
|
+
case /* optional string price */
|
|
395
|
+
4:
|
|
396
|
+
message.price = reader.string();
|
|
397
|
+
break;
|
|
398
|
+
case /* optional string timestamp */
|
|
399
|
+
5:
|
|
400
|
+
message.timestamp = reader.string();
|
|
401
|
+
break;
|
|
402
|
+
case /* optional string source */
|
|
403
|
+
6:
|
|
404
|
+
message.source = reader.string();
|
|
405
|
+
break;
|
|
406
|
+
default:
|
|
407
|
+
let u = options.readUnknownField;
|
|
408
|
+
if (u === "throw")
|
|
409
|
+
throw new globalThis.Error(`Unknown field ${fieldNo} (wire type ${wireType}) for ${this.typeName}`);
|
|
410
|
+
let d = reader.skip(wireType);
|
|
411
|
+
if (u !== false)
|
|
412
|
+
(u === true ? UnknownFieldHandler.onRead : u)(this.typeName, message, fieldNo, wireType, d);
|
|
413
|
+
}
|
|
414
|
+
}
|
|
415
|
+
return message;
|
|
416
|
+
}
|
|
417
|
+
internalBinaryWrite(message, writer, options) {
|
|
418
|
+
if (message.oracleType !== void 0)
|
|
419
|
+
writer.tag(1, WireType.LengthDelimited).string(message.oracleType);
|
|
420
|
+
if (message.base !== void 0)
|
|
421
|
+
writer.tag(2, WireType.LengthDelimited).string(message.base);
|
|
422
|
+
if (message.quote !== void 0)
|
|
423
|
+
writer.tag(3, WireType.LengthDelimited).string(message.quote);
|
|
424
|
+
if (message.price !== void 0)
|
|
425
|
+
writer.tag(4, WireType.LengthDelimited).string(message.price);
|
|
426
|
+
if (message.timestamp !== void 0)
|
|
427
|
+
writer.tag(5, WireType.LengthDelimited).string(message.timestamp);
|
|
428
|
+
if (message.source !== void 0)
|
|
429
|
+
writer.tag(6, WireType.LengthDelimited).string(message.source);
|
|
430
|
+
let u = options.writeUnknownFields;
|
|
431
|
+
if (u !== false)
|
|
432
|
+
(u == true ? UnknownFieldHandler.onWrite : u)(this.typeName, message, writer);
|
|
433
|
+
return writer;
|
|
434
|
+
}
|
|
435
|
+
}
|
|
436
|
+
const MarketStreamLeg = new MarketStreamLeg$Type();
|
|
437
|
+
class MarketStreamRawPayload$Type extends MessageType {
|
|
438
|
+
constructor() {
|
|
439
|
+
super("injective.price.oracle.api.v1.MarketStreamRawPayload", [
|
|
440
|
+
{
|
|
441
|
+
no: 1,
|
|
442
|
+
name: "provider",
|
|
443
|
+
kind: "scalar",
|
|
444
|
+
opt: true,
|
|
445
|
+
T: 9
|
|
446
|
+
/*ScalarType.STRING*/
|
|
447
|
+
},
|
|
448
|
+
{
|
|
449
|
+
no: 2,
|
|
450
|
+
name: "feed_id",
|
|
451
|
+
kind: "scalar",
|
|
452
|
+
opt: true,
|
|
453
|
+
T: 9
|
|
454
|
+
/*ScalarType.STRING*/
|
|
455
|
+
},
|
|
456
|
+
{
|
|
457
|
+
no: 3,
|
|
458
|
+
name: "encoding",
|
|
459
|
+
kind: "scalar",
|
|
460
|
+
opt: true,
|
|
461
|
+
T: 9
|
|
462
|
+
/*ScalarType.STRING*/
|
|
463
|
+
},
|
|
464
|
+
{
|
|
465
|
+
no: 4,
|
|
466
|
+
name: "data",
|
|
467
|
+
kind: "scalar",
|
|
468
|
+
opt: true,
|
|
469
|
+
T: 9
|
|
470
|
+
/*ScalarType.STRING*/
|
|
471
|
+
}
|
|
472
|
+
]);
|
|
473
|
+
}
|
|
474
|
+
create(value) {
|
|
475
|
+
const message = globalThis.Object.create(this.messagePrototype);
|
|
476
|
+
if (value !== void 0)
|
|
477
|
+
reflectionMergePartial(this, message, value);
|
|
478
|
+
return message;
|
|
479
|
+
}
|
|
480
|
+
internalBinaryRead(reader, length, options, target) {
|
|
481
|
+
let message = target ?? this.create(), end = reader.pos + length;
|
|
482
|
+
while (reader.pos < end) {
|
|
483
|
+
let [fieldNo, wireType] = reader.tag();
|
|
484
|
+
switch (fieldNo) {
|
|
485
|
+
case /* optional string provider */
|
|
486
|
+
1:
|
|
487
|
+
message.provider = reader.string();
|
|
488
|
+
break;
|
|
489
|
+
case /* optional string feed_id */
|
|
490
|
+
2:
|
|
491
|
+
message.feedId = reader.string();
|
|
492
|
+
break;
|
|
493
|
+
case /* optional string encoding */
|
|
494
|
+
3:
|
|
495
|
+
message.encoding = reader.string();
|
|
496
|
+
break;
|
|
497
|
+
case /* optional string data */
|
|
498
|
+
4:
|
|
499
|
+
message.data = reader.string();
|
|
500
|
+
break;
|
|
501
|
+
default:
|
|
502
|
+
let u = options.readUnknownField;
|
|
503
|
+
if (u === "throw")
|
|
504
|
+
throw new globalThis.Error(`Unknown field ${fieldNo} (wire type ${wireType}) for ${this.typeName}`);
|
|
505
|
+
let d = reader.skip(wireType);
|
|
506
|
+
if (u !== false)
|
|
507
|
+
(u === true ? UnknownFieldHandler.onRead : u)(this.typeName, message, fieldNo, wireType, d);
|
|
508
|
+
}
|
|
509
|
+
}
|
|
510
|
+
return message;
|
|
511
|
+
}
|
|
512
|
+
internalBinaryWrite(message, writer, options) {
|
|
513
|
+
if (message.provider !== void 0)
|
|
514
|
+
writer.tag(1, WireType.LengthDelimited).string(message.provider);
|
|
515
|
+
if (message.feedId !== void 0)
|
|
516
|
+
writer.tag(2, WireType.LengthDelimited).string(message.feedId);
|
|
517
|
+
if (message.encoding !== void 0)
|
|
518
|
+
writer.tag(3, WireType.LengthDelimited).string(message.encoding);
|
|
519
|
+
if (message.data !== void 0)
|
|
520
|
+
writer.tag(4, WireType.LengthDelimited).string(message.data);
|
|
521
|
+
let u = options.writeUnknownFields;
|
|
522
|
+
if (u !== false)
|
|
523
|
+
(u == true ? UnknownFieldHandler.onWrite : u)(this.typeName, message, writer);
|
|
524
|
+
return writer;
|
|
525
|
+
}
|
|
526
|
+
}
|
|
527
|
+
const MarketStreamRawPayload = new MarketStreamRawPayload$Type();
|
|
528
|
+
const Oracle = new ServiceType("injective.price.oracle.api.v1.Oracle", [
|
|
529
|
+
{ name: "StreamMarkets", serverStreaming: true, options: {}, I: StreamMarketsRequest, O: StreamMarketsResponse }
|
|
530
|
+
]);
|
|
531
|
+
export {
|
|
532
|
+
MarketStreamLeg,
|
|
533
|
+
MarketStreamRawPayload,
|
|
534
|
+
Oracle,
|
|
535
|
+
StreamMarketsRequest,
|
|
536
|
+
StreamMarketsResponse
|
|
537
|
+
};
|
package/index.d.ts
ADDED
package/index.js
ADDED
package/package.json
ADDED
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@injectivelabs/ws-price-oracle-proto-ts-v2",
|
|
3
|
+
"version": "1.0.3",
|
|
4
|
+
"type": "module",
|
|
5
|
+
"main": "./index.js",
|
|
6
|
+
"types": "./index.d.ts",
|
|
7
|
+
"exports": {
|
|
8
|
+
".": {
|
|
9
|
+
"types": "./index.d.ts",
|
|
10
|
+
"import": "./index.js",
|
|
11
|
+
"default": "./index.js"
|
|
12
|
+
},
|
|
13
|
+
"./generated/*": {
|
|
14
|
+
"types": "./generated/*.d.ts",
|
|
15
|
+
"import": "./generated/*.js",
|
|
16
|
+
"default": "./generated/*.js"
|
|
17
|
+
},
|
|
18
|
+
"./generated/*.js": "./generated/*.js"
|
|
19
|
+
},
|
|
20
|
+
"files": [
|
|
21
|
+
"index.js",
|
|
22
|
+
"index.d.ts",
|
|
23
|
+
"generated"
|
|
24
|
+
],
|
|
25
|
+
"sideEffects": false,
|
|
26
|
+
"license": "Apache-2.0",
|
|
27
|
+
"repository": {
|
|
28
|
+
"type": "git",
|
|
29
|
+
"url": "https://github.com/InjectiveLabs/injective-ts"
|
|
30
|
+
},
|
|
31
|
+
"dependencies": {
|
|
32
|
+
"@protobuf-ts/runtime": "^2.11.1",
|
|
33
|
+
"@protobuf-ts/runtime-rpc": "^2.11.1",
|
|
34
|
+
"@protobuf-ts/grpcweb-transport": "^2.11.1"
|
|
35
|
+
}
|
|
36
|
+
}
|