@injectivelabs/indexer-proto-ts-v2 1.0.0
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.
- package/generated/event_provider_api_pb.client.d.ts +156 -0
- package/generated/event_provider_api_pb.client.js +76 -0
- package/generated/event_provider_api_pb.d.ts +1980 -0
- package/generated/event_provider_api_pb.js +1776 -0
- package/generated/health_pb.client.d.ts +53 -0
- package/generated/health_pb.client.js +22 -0
- package/generated/health_pb.d.ts +309 -0
- package/generated/health_pb.js +265 -0
- package/generated/injective_accounts_rpc_pb.client.d.ts +211 -0
- package/generated/injective_accounts_rpc_pb.client.js +105 -0
- package/generated/injective_accounts_rpc_pb.d.ts +5307 -0
- package/generated/injective_accounts_rpc_pb.js +4784 -0
- package/generated/injective_archiver_rpc_pb.client.d.ts +224 -0
- package/generated/injective_archiver_rpc_pb.client.js +112 -0
- package/generated/injective_archiver_rpc_pb.d.ts +2944 -0
- package/generated/injective_archiver_rpc_pb.js +2603 -0
- package/generated/injective_auction_rpc_pb.client.d.ts +190 -0
- package/generated/injective_auction_rpc_pb.client.js +94 -0
- package/generated/injective_auction_rpc_pb.d.ts +2131 -0
- package/generated/injective_auction_rpc_pb.js +1917 -0
- package/generated/injective_campaign_rpc_pb.client.d.ts +138 -0
- package/generated/injective_campaign_rpc_pb.client.js +67 -0
- package/generated/injective_campaign_rpc_pb.d.ts +2766 -0
- package/generated/injective_campaign_rpc_pb.js +2542 -0
- package/generated/injective_chart_rpc_pb.client.d.ts +159 -0
- package/generated/injective_chart_rpc_pb.client.js +78 -0
- package/generated/injective_chart_rpc_pb.d.ts +1840 -0
- package/generated/injective_chart_rpc_pb.js +1690 -0
- package/generated/injective_derivative_exchange_rpc_pb.client.d.ts +504 -0
- package/generated/injective_derivative_exchange_rpc_pb.client.js +259 -0
- package/generated/injective_derivative_exchange_rpc_pb.d.ts +9214 -0
- package/generated/injective_derivative_exchange_rpc_pb.js +8407 -0
- package/generated/injective_exchange_rpc_pb.client.d.ts +155 -0
- package/generated/injective_exchange_rpc_pb.client.js +76 -0
- package/generated/injective_exchange_rpc_pb.d.ts +1925 -0
- package/generated/injective_exchange_rpc_pb.js +1740 -0
- package/generated/injective_explorer_rpc_pb.client.d.ts +495 -0
- package/generated/injective_explorer_rpc_pb.client.js +255 -0
- package/generated/injective_explorer_rpc_pb.d.ts +9394 -0
- package/generated/injective_explorer_rpc_pb.js +8921 -0
- package/generated/injective_insurance_rpc_pb.client.d.ts +87 -0
- package/generated/injective_insurance_rpc_pb.client.js +40 -0
- package/generated/injective_insurance_rpc_pb.d.ts +904 -0
- package/generated/injective_insurance_rpc_pb.js +807 -0
- package/generated/injective_megavault_rpc_pb.client.d.ts +155 -0
- package/generated/injective_megavault_rpc_pb.client.js +76 -0
- package/generated/injective_megavault_rpc_pb.d.ts +3408 -0
- package/generated/injective_megavault_rpc_pb.js +3019 -0
- package/generated/injective_meta_rpc_pb.client.d.ts +124 -0
- package/generated/injective_meta_rpc_pb.client.js +59 -0
- package/generated/injective_meta_rpc_pb.d.ts +825 -0
- package/generated/injective_meta_rpc_pb.js +716 -0
- package/generated/injective_oracle_rpc_pb.client.d.ts +124 -0
- package/generated/injective_oracle_rpc_pb.client.js +59 -0
- package/generated/injective_oracle_rpc_pb.d.ts +1117 -0
- package/generated/injective_oracle_rpc_pb.js +987 -0
- package/generated/injective_portfolio_rpc_pb.client.d.ts +105 -0
- package/generated/injective_portfolio_rpc_pb.client.js +49 -0
- package/generated/injective_portfolio_rpc_pb.d.ts +1492 -0
- package/generated/injective_portfolio_rpc_pb.js +1314 -0
- package/generated/injective_referral_rpc_pb.client.d.ts +89 -0
- package/generated/injective_referral_rpc_pb.client.js +41 -0
- package/generated/injective_referral_rpc_pb.d.ts +575 -0
- package/generated/injective_referral_rpc_pb.js +497 -0
- package/generated/injective_rfqrpc_pb.client.d.ts +208 -0
- package/generated/injective_rfqrpc_pb.client.js +103 -0
- package/generated/injective_rfqrpc_pb.d.ts +2241 -0
- package/generated/injective_rfqrpc_pb.js +1940 -0
- package/generated/injective_spot_exchange_rpc_pb.client.d.ts +343 -0
- package/generated/injective_spot_exchange_rpc_pb.client.js +175 -0
- package/generated/injective_spot_exchange_rpc_pb.d.ts +5958 -0
- package/generated/injective_spot_exchange_rpc_pb.js +5426 -0
- package/generated/injective_trading_rpc_pb.client.d.ts +90 -0
- package/generated/injective_trading_rpc_pb.client.js +40 -0
- package/generated/injective_trading_rpc_pb.d.ts +1882 -0
- package/generated/injective_trading_rpc_pb.js +1754 -0
- package/index.d.ts +43 -0
- package/index.js +78 -0
- package/package.json +37 -0
|
@@ -0,0 +1,1754 @@
|
|
|
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 ListTradingStrategiesRequest$Type extends MessageType {
|
|
7
|
+
constructor() {
|
|
8
|
+
super("injective_trading_rpc.ListTradingStrategiesRequest", [
|
|
9
|
+
{
|
|
10
|
+
no: 1,
|
|
11
|
+
name: "state",
|
|
12
|
+
kind: "scalar",
|
|
13
|
+
T: 9
|
|
14
|
+
/*ScalarType.STRING*/
|
|
15
|
+
},
|
|
16
|
+
{
|
|
17
|
+
no: 2,
|
|
18
|
+
name: "market_id",
|
|
19
|
+
kind: "scalar",
|
|
20
|
+
T: 9
|
|
21
|
+
/*ScalarType.STRING*/
|
|
22
|
+
},
|
|
23
|
+
{
|
|
24
|
+
no: 3,
|
|
25
|
+
name: "subaccount_id",
|
|
26
|
+
kind: "scalar",
|
|
27
|
+
T: 9
|
|
28
|
+
/*ScalarType.STRING*/
|
|
29
|
+
},
|
|
30
|
+
{
|
|
31
|
+
no: 4,
|
|
32
|
+
name: "account_address",
|
|
33
|
+
kind: "scalar",
|
|
34
|
+
T: 9
|
|
35
|
+
/*ScalarType.STRING*/
|
|
36
|
+
},
|
|
37
|
+
{
|
|
38
|
+
no: 5,
|
|
39
|
+
name: "pending_execution",
|
|
40
|
+
kind: "scalar",
|
|
41
|
+
T: 8
|
|
42
|
+
/*ScalarType.BOOL*/
|
|
43
|
+
},
|
|
44
|
+
{
|
|
45
|
+
no: 6,
|
|
46
|
+
name: "start_time",
|
|
47
|
+
kind: "scalar",
|
|
48
|
+
T: 18,
|
|
49
|
+
L: 0
|
|
50
|
+
/*LongType.BIGINT*/
|
|
51
|
+
},
|
|
52
|
+
{
|
|
53
|
+
no: 7,
|
|
54
|
+
name: "end_time",
|
|
55
|
+
kind: "scalar",
|
|
56
|
+
T: 18,
|
|
57
|
+
L: 0
|
|
58
|
+
/*LongType.BIGINT*/
|
|
59
|
+
},
|
|
60
|
+
{
|
|
61
|
+
no: 8,
|
|
62
|
+
name: "limit",
|
|
63
|
+
kind: "scalar",
|
|
64
|
+
T: 17
|
|
65
|
+
/*ScalarType.SINT32*/
|
|
66
|
+
},
|
|
67
|
+
{
|
|
68
|
+
no: 9,
|
|
69
|
+
name: "skip",
|
|
70
|
+
kind: "scalar",
|
|
71
|
+
T: 4,
|
|
72
|
+
L: 0
|
|
73
|
+
/*LongType.BIGINT*/
|
|
74
|
+
},
|
|
75
|
+
{
|
|
76
|
+
no: 10,
|
|
77
|
+
name: "strategy_type",
|
|
78
|
+
kind: "scalar",
|
|
79
|
+
repeat: 2,
|
|
80
|
+
T: 9
|
|
81
|
+
/*ScalarType.STRING*/
|
|
82
|
+
},
|
|
83
|
+
{
|
|
84
|
+
no: 11,
|
|
85
|
+
name: "market_type",
|
|
86
|
+
kind: "scalar",
|
|
87
|
+
T: 9
|
|
88
|
+
/*ScalarType.STRING*/
|
|
89
|
+
},
|
|
90
|
+
{
|
|
91
|
+
no: 12,
|
|
92
|
+
name: "last_executed_time",
|
|
93
|
+
kind: "scalar",
|
|
94
|
+
T: 18,
|
|
95
|
+
L: 0
|
|
96
|
+
/*LongType.BIGINT*/
|
|
97
|
+
},
|
|
98
|
+
{
|
|
99
|
+
no: 13,
|
|
100
|
+
name: "with_tvl",
|
|
101
|
+
kind: "scalar",
|
|
102
|
+
T: 8
|
|
103
|
+
/*ScalarType.BOOL*/
|
|
104
|
+
},
|
|
105
|
+
{
|
|
106
|
+
no: 14,
|
|
107
|
+
name: "is_trailing_strategy",
|
|
108
|
+
kind: "scalar",
|
|
109
|
+
T: 8
|
|
110
|
+
/*ScalarType.BOOL*/
|
|
111
|
+
},
|
|
112
|
+
{
|
|
113
|
+
no: 15,
|
|
114
|
+
name: "with_performance",
|
|
115
|
+
kind: "scalar",
|
|
116
|
+
T: 8
|
|
117
|
+
/*ScalarType.BOOL*/
|
|
118
|
+
}
|
|
119
|
+
]);
|
|
120
|
+
}
|
|
121
|
+
create(value) {
|
|
122
|
+
const message = globalThis.Object.create(this.messagePrototype);
|
|
123
|
+
message.state = "";
|
|
124
|
+
message.marketId = "";
|
|
125
|
+
message.subaccountId = "";
|
|
126
|
+
message.accountAddress = "";
|
|
127
|
+
message.pendingExecution = false;
|
|
128
|
+
message.startTime = 0n;
|
|
129
|
+
message.endTime = 0n;
|
|
130
|
+
message.limit = 0;
|
|
131
|
+
message.skip = 0n;
|
|
132
|
+
message.strategyType = [];
|
|
133
|
+
message.marketType = "";
|
|
134
|
+
message.lastExecutedTime = 0n;
|
|
135
|
+
message.withTvl = false;
|
|
136
|
+
message.isTrailingStrategy = false;
|
|
137
|
+
message.withPerformance = false;
|
|
138
|
+
if (value !== void 0)
|
|
139
|
+
reflectionMergePartial(this, message, value);
|
|
140
|
+
return message;
|
|
141
|
+
}
|
|
142
|
+
internalBinaryRead(reader, length, options, target) {
|
|
143
|
+
let message = target ?? this.create(), end = reader.pos + length;
|
|
144
|
+
while (reader.pos < end) {
|
|
145
|
+
let [fieldNo, wireType] = reader.tag();
|
|
146
|
+
switch (fieldNo) {
|
|
147
|
+
case /* string state */
|
|
148
|
+
1:
|
|
149
|
+
message.state = reader.string();
|
|
150
|
+
break;
|
|
151
|
+
case /* string market_id */
|
|
152
|
+
2:
|
|
153
|
+
message.marketId = reader.string();
|
|
154
|
+
break;
|
|
155
|
+
case /* string subaccount_id */
|
|
156
|
+
3:
|
|
157
|
+
message.subaccountId = reader.string();
|
|
158
|
+
break;
|
|
159
|
+
case /* string account_address */
|
|
160
|
+
4:
|
|
161
|
+
message.accountAddress = reader.string();
|
|
162
|
+
break;
|
|
163
|
+
case /* bool pending_execution */
|
|
164
|
+
5:
|
|
165
|
+
message.pendingExecution = reader.bool();
|
|
166
|
+
break;
|
|
167
|
+
case /* sint64 start_time */
|
|
168
|
+
6:
|
|
169
|
+
message.startTime = reader.sint64().toBigInt();
|
|
170
|
+
break;
|
|
171
|
+
case /* sint64 end_time */
|
|
172
|
+
7:
|
|
173
|
+
message.endTime = reader.sint64().toBigInt();
|
|
174
|
+
break;
|
|
175
|
+
case /* sint32 limit */
|
|
176
|
+
8:
|
|
177
|
+
message.limit = reader.sint32();
|
|
178
|
+
break;
|
|
179
|
+
case /* uint64 skip */
|
|
180
|
+
9:
|
|
181
|
+
message.skip = reader.uint64().toBigInt();
|
|
182
|
+
break;
|
|
183
|
+
case /* repeated string strategy_type */
|
|
184
|
+
10:
|
|
185
|
+
message.strategyType.push(reader.string());
|
|
186
|
+
break;
|
|
187
|
+
case /* string market_type */
|
|
188
|
+
11:
|
|
189
|
+
message.marketType = reader.string();
|
|
190
|
+
break;
|
|
191
|
+
case /* sint64 last_executed_time */
|
|
192
|
+
12:
|
|
193
|
+
message.lastExecutedTime = reader.sint64().toBigInt();
|
|
194
|
+
break;
|
|
195
|
+
case /* bool with_tvl */
|
|
196
|
+
13:
|
|
197
|
+
message.withTvl = reader.bool();
|
|
198
|
+
break;
|
|
199
|
+
case /* bool is_trailing_strategy */
|
|
200
|
+
14:
|
|
201
|
+
message.isTrailingStrategy = reader.bool();
|
|
202
|
+
break;
|
|
203
|
+
case /* bool with_performance */
|
|
204
|
+
15:
|
|
205
|
+
message.withPerformance = reader.bool();
|
|
206
|
+
break;
|
|
207
|
+
default:
|
|
208
|
+
let u = options.readUnknownField;
|
|
209
|
+
if (u === "throw")
|
|
210
|
+
throw new globalThis.Error(`Unknown field ${fieldNo} (wire type ${wireType}) for ${this.typeName}`);
|
|
211
|
+
let d = reader.skip(wireType);
|
|
212
|
+
if (u !== false)
|
|
213
|
+
(u === true ? UnknownFieldHandler.onRead : u)(this.typeName, message, fieldNo, wireType, d);
|
|
214
|
+
}
|
|
215
|
+
}
|
|
216
|
+
return message;
|
|
217
|
+
}
|
|
218
|
+
internalBinaryWrite(message, writer, options) {
|
|
219
|
+
if (message.state !== "")
|
|
220
|
+
writer.tag(1, WireType.LengthDelimited).string(message.state);
|
|
221
|
+
if (message.marketId !== "")
|
|
222
|
+
writer.tag(2, WireType.LengthDelimited).string(message.marketId);
|
|
223
|
+
if (message.subaccountId !== "")
|
|
224
|
+
writer.tag(3, WireType.LengthDelimited).string(message.subaccountId);
|
|
225
|
+
if (message.accountAddress !== "")
|
|
226
|
+
writer.tag(4, WireType.LengthDelimited).string(message.accountAddress);
|
|
227
|
+
if (message.pendingExecution !== false)
|
|
228
|
+
writer.tag(5, WireType.Varint).bool(message.pendingExecution);
|
|
229
|
+
if (message.startTime !== 0n)
|
|
230
|
+
writer.tag(6, WireType.Varint).sint64(message.startTime);
|
|
231
|
+
if (message.endTime !== 0n)
|
|
232
|
+
writer.tag(7, WireType.Varint).sint64(message.endTime);
|
|
233
|
+
if (message.limit !== 0)
|
|
234
|
+
writer.tag(8, WireType.Varint).sint32(message.limit);
|
|
235
|
+
if (message.skip !== 0n)
|
|
236
|
+
writer.tag(9, WireType.Varint).uint64(message.skip);
|
|
237
|
+
for (let i = 0; i < message.strategyType.length; i++)
|
|
238
|
+
writer.tag(10, WireType.LengthDelimited).string(message.strategyType[i]);
|
|
239
|
+
if (message.marketType !== "")
|
|
240
|
+
writer.tag(11, WireType.LengthDelimited).string(message.marketType);
|
|
241
|
+
if (message.lastExecutedTime !== 0n)
|
|
242
|
+
writer.tag(12, WireType.Varint).sint64(message.lastExecutedTime);
|
|
243
|
+
if (message.withTvl !== false)
|
|
244
|
+
writer.tag(13, WireType.Varint).bool(message.withTvl);
|
|
245
|
+
if (message.isTrailingStrategy !== false)
|
|
246
|
+
writer.tag(14, WireType.Varint).bool(message.isTrailingStrategy);
|
|
247
|
+
if (message.withPerformance !== false)
|
|
248
|
+
writer.tag(15, WireType.Varint).bool(message.withPerformance);
|
|
249
|
+
let u = options.writeUnknownFields;
|
|
250
|
+
if (u !== false)
|
|
251
|
+
(u == true ? UnknownFieldHandler.onWrite : u)(this.typeName, message, writer);
|
|
252
|
+
return writer;
|
|
253
|
+
}
|
|
254
|
+
}
|
|
255
|
+
const ListTradingStrategiesRequest = new ListTradingStrategiesRequest$Type();
|
|
256
|
+
class ListTradingStrategiesResponse$Type extends MessageType {
|
|
257
|
+
constructor() {
|
|
258
|
+
super("injective_trading_rpc.ListTradingStrategiesResponse", [
|
|
259
|
+
{ no: 1, name: "strategies", kind: "message", repeat: 2, T: () => TradingStrategy },
|
|
260
|
+
{ no: 2, name: "paging", kind: "message", T: () => Paging }
|
|
261
|
+
]);
|
|
262
|
+
}
|
|
263
|
+
create(value) {
|
|
264
|
+
const message = globalThis.Object.create(this.messagePrototype);
|
|
265
|
+
message.strategies = [];
|
|
266
|
+
if (value !== void 0)
|
|
267
|
+
reflectionMergePartial(this, message, value);
|
|
268
|
+
return message;
|
|
269
|
+
}
|
|
270
|
+
internalBinaryRead(reader, length, options, target) {
|
|
271
|
+
let message = target ?? this.create(), end = reader.pos + length;
|
|
272
|
+
while (reader.pos < end) {
|
|
273
|
+
let [fieldNo, wireType] = reader.tag();
|
|
274
|
+
switch (fieldNo) {
|
|
275
|
+
case /* repeated injective_trading_rpc.TradingStrategy strategies */
|
|
276
|
+
1:
|
|
277
|
+
message.strategies.push(TradingStrategy.internalBinaryRead(reader, reader.uint32(), options));
|
|
278
|
+
break;
|
|
279
|
+
case /* injective_trading_rpc.Paging paging */
|
|
280
|
+
2:
|
|
281
|
+
message.paging = Paging.internalBinaryRead(reader, reader.uint32(), options, message.paging);
|
|
282
|
+
break;
|
|
283
|
+
default:
|
|
284
|
+
let u = options.readUnknownField;
|
|
285
|
+
if (u === "throw")
|
|
286
|
+
throw new globalThis.Error(`Unknown field ${fieldNo} (wire type ${wireType}) for ${this.typeName}`);
|
|
287
|
+
let d = reader.skip(wireType);
|
|
288
|
+
if (u !== false)
|
|
289
|
+
(u === true ? UnknownFieldHandler.onRead : u)(this.typeName, message, fieldNo, wireType, d);
|
|
290
|
+
}
|
|
291
|
+
}
|
|
292
|
+
return message;
|
|
293
|
+
}
|
|
294
|
+
internalBinaryWrite(message, writer, options) {
|
|
295
|
+
for (let i = 0; i < message.strategies.length; i++)
|
|
296
|
+
TradingStrategy.internalBinaryWrite(message.strategies[i], writer.tag(1, WireType.LengthDelimited).fork(), options).join();
|
|
297
|
+
if (message.paging)
|
|
298
|
+
Paging.internalBinaryWrite(message.paging, writer.tag(2, WireType.LengthDelimited).fork(), options).join();
|
|
299
|
+
let u = options.writeUnknownFields;
|
|
300
|
+
if (u !== false)
|
|
301
|
+
(u == true ? UnknownFieldHandler.onWrite : u)(this.typeName, message, writer);
|
|
302
|
+
return writer;
|
|
303
|
+
}
|
|
304
|
+
}
|
|
305
|
+
const ListTradingStrategiesResponse = new ListTradingStrategiesResponse$Type();
|
|
306
|
+
class TradingStrategy$Type extends MessageType {
|
|
307
|
+
constructor() {
|
|
308
|
+
super("injective_trading_rpc.TradingStrategy", [
|
|
309
|
+
{
|
|
310
|
+
no: 1,
|
|
311
|
+
name: "state",
|
|
312
|
+
kind: "scalar",
|
|
313
|
+
T: 9
|
|
314
|
+
/*ScalarType.STRING*/
|
|
315
|
+
},
|
|
316
|
+
{
|
|
317
|
+
no: 2,
|
|
318
|
+
name: "market_id",
|
|
319
|
+
kind: "scalar",
|
|
320
|
+
T: 9
|
|
321
|
+
/*ScalarType.STRING*/
|
|
322
|
+
},
|
|
323
|
+
{
|
|
324
|
+
no: 3,
|
|
325
|
+
name: "subaccount_id",
|
|
326
|
+
kind: "scalar",
|
|
327
|
+
T: 9
|
|
328
|
+
/*ScalarType.STRING*/
|
|
329
|
+
},
|
|
330
|
+
{
|
|
331
|
+
no: 4,
|
|
332
|
+
name: "account_address",
|
|
333
|
+
kind: "scalar",
|
|
334
|
+
T: 9
|
|
335
|
+
/*ScalarType.STRING*/
|
|
336
|
+
},
|
|
337
|
+
{
|
|
338
|
+
no: 5,
|
|
339
|
+
name: "contract_address",
|
|
340
|
+
kind: "scalar",
|
|
341
|
+
T: 9
|
|
342
|
+
/*ScalarType.STRING*/
|
|
343
|
+
},
|
|
344
|
+
{
|
|
345
|
+
no: 6,
|
|
346
|
+
name: "execution_price",
|
|
347
|
+
kind: "scalar",
|
|
348
|
+
T: 9
|
|
349
|
+
/*ScalarType.STRING*/
|
|
350
|
+
},
|
|
351
|
+
{
|
|
352
|
+
no: 7,
|
|
353
|
+
name: "base_quantity",
|
|
354
|
+
kind: "scalar",
|
|
355
|
+
T: 9
|
|
356
|
+
/*ScalarType.STRING*/
|
|
357
|
+
},
|
|
358
|
+
{
|
|
359
|
+
no: 20,
|
|
360
|
+
name: "quote_quantity",
|
|
361
|
+
kind: "scalar",
|
|
362
|
+
T: 9
|
|
363
|
+
/*ScalarType.STRING*/
|
|
364
|
+
},
|
|
365
|
+
{
|
|
366
|
+
no: 8,
|
|
367
|
+
name: "lower_bound",
|
|
368
|
+
kind: "scalar",
|
|
369
|
+
T: 9
|
|
370
|
+
/*ScalarType.STRING*/
|
|
371
|
+
},
|
|
372
|
+
{
|
|
373
|
+
no: 9,
|
|
374
|
+
name: "upper_bound",
|
|
375
|
+
kind: "scalar",
|
|
376
|
+
T: 9
|
|
377
|
+
/*ScalarType.STRING*/
|
|
378
|
+
},
|
|
379
|
+
{
|
|
380
|
+
no: 10,
|
|
381
|
+
name: "stop_loss",
|
|
382
|
+
kind: "scalar",
|
|
383
|
+
T: 9
|
|
384
|
+
/*ScalarType.STRING*/
|
|
385
|
+
},
|
|
386
|
+
{
|
|
387
|
+
no: 11,
|
|
388
|
+
name: "take_profit",
|
|
389
|
+
kind: "scalar",
|
|
390
|
+
T: 9
|
|
391
|
+
/*ScalarType.STRING*/
|
|
392
|
+
},
|
|
393
|
+
{
|
|
394
|
+
no: 12,
|
|
395
|
+
name: "swap_fee",
|
|
396
|
+
kind: "scalar",
|
|
397
|
+
T: 9
|
|
398
|
+
/*ScalarType.STRING*/
|
|
399
|
+
},
|
|
400
|
+
{
|
|
401
|
+
no: 17,
|
|
402
|
+
name: "base_deposit",
|
|
403
|
+
kind: "scalar",
|
|
404
|
+
T: 9
|
|
405
|
+
/*ScalarType.STRING*/
|
|
406
|
+
},
|
|
407
|
+
{
|
|
408
|
+
no: 18,
|
|
409
|
+
name: "quote_deposit",
|
|
410
|
+
kind: "scalar",
|
|
411
|
+
T: 9
|
|
412
|
+
/*ScalarType.STRING*/
|
|
413
|
+
},
|
|
414
|
+
{
|
|
415
|
+
no: 19,
|
|
416
|
+
name: "market_mid_price",
|
|
417
|
+
kind: "scalar",
|
|
418
|
+
T: 9
|
|
419
|
+
/*ScalarType.STRING*/
|
|
420
|
+
},
|
|
421
|
+
{
|
|
422
|
+
no: 21,
|
|
423
|
+
name: "subscription_quote_quantity",
|
|
424
|
+
kind: "scalar",
|
|
425
|
+
T: 9
|
|
426
|
+
/*ScalarType.STRING*/
|
|
427
|
+
},
|
|
428
|
+
{
|
|
429
|
+
no: 22,
|
|
430
|
+
name: "subscription_base_quantity",
|
|
431
|
+
kind: "scalar",
|
|
432
|
+
T: 9
|
|
433
|
+
/*ScalarType.STRING*/
|
|
434
|
+
},
|
|
435
|
+
{
|
|
436
|
+
no: 23,
|
|
437
|
+
name: "number_of_grid_levels",
|
|
438
|
+
kind: "scalar",
|
|
439
|
+
T: 9
|
|
440
|
+
/*ScalarType.STRING*/
|
|
441
|
+
},
|
|
442
|
+
{
|
|
443
|
+
no: 24,
|
|
444
|
+
name: "should_exit_with_quote_only",
|
|
445
|
+
kind: "scalar",
|
|
446
|
+
T: 8
|
|
447
|
+
/*ScalarType.BOOL*/
|
|
448
|
+
},
|
|
449
|
+
{
|
|
450
|
+
no: 25,
|
|
451
|
+
name: "stop_reason",
|
|
452
|
+
kind: "scalar",
|
|
453
|
+
T: 9
|
|
454
|
+
/*ScalarType.STRING*/
|
|
455
|
+
},
|
|
456
|
+
{
|
|
457
|
+
no: 26,
|
|
458
|
+
name: "pending_execution",
|
|
459
|
+
kind: "scalar",
|
|
460
|
+
T: 8
|
|
461
|
+
/*ScalarType.BOOL*/
|
|
462
|
+
},
|
|
463
|
+
{
|
|
464
|
+
no: 13,
|
|
465
|
+
name: "created_height",
|
|
466
|
+
kind: "scalar",
|
|
467
|
+
T: 18,
|
|
468
|
+
L: 0
|
|
469
|
+
/*LongType.BIGINT*/
|
|
470
|
+
},
|
|
471
|
+
{
|
|
472
|
+
no: 14,
|
|
473
|
+
name: "removed_height",
|
|
474
|
+
kind: "scalar",
|
|
475
|
+
T: 18,
|
|
476
|
+
L: 0
|
|
477
|
+
/*LongType.BIGINT*/
|
|
478
|
+
},
|
|
479
|
+
{
|
|
480
|
+
no: 15,
|
|
481
|
+
name: "created_at",
|
|
482
|
+
kind: "scalar",
|
|
483
|
+
T: 18,
|
|
484
|
+
L: 0
|
|
485
|
+
/*LongType.BIGINT*/
|
|
486
|
+
},
|
|
487
|
+
{
|
|
488
|
+
no: 16,
|
|
489
|
+
name: "updated_at",
|
|
490
|
+
kind: "scalar",
|
|
491
|
+
T: 18,
|
|
492
|
+
L: 0
|
|
493
|
+
/*LongType.BIGINT*/
|
|
494
|
+
},
|
|
495
|
+
{
|
|
496
|
+
no: 27,
|
|
497
|
+
name: "exit_type",
|
|
498
|
+
kind: "scalar",
|
|
499
|
+
T: 9
|
|
500
|
+
/*ScalarType.STRING*/
|
|
501
|
+
},
|
|
502
|
+
{ no: 28, name: "stop_loss_config", kind: "message", T: () => ExitConfig },
|
|
503
|
+
{ no: 29, name: "take_profit_config", kind: "message", T: () => ExitConfig },
|
|
504
|
+
{
|
|
505
|
+
no: 30,
|
|
506
|
+
name: "strategy_type",
|
|
507
|
+
kind: "scalar",
|
|
508
|
+
T: 9
|
|
509
|
+
/*ScalarType.STRING*/
|
|
510
|
+
},
|
|
511
|
+
{
|
|
512
|
+
no: 31,
|
|
513
|
+
name: "contract_version",
|
|
514
|
+
kind: "scalar",
|
|
515
|
+
T: 9
|
|
516
|
+
/*ScalarType.STRING*/
|
|
517
|
+
},
|
|
518
|
+
{
|
|
519
|
+
no: 32,
|
|
520
|
+
name: "contract_name",
|
|
521
|
+
kind: "scalar",
|
|
522
|
+
T: 9
|
|
523
|
+
/*ScalarType.STRING*/
|
|
524
|
+
},
|
|
525
|
+
{
|
|
526
|
+
no: 33,
|
|
527
|
+
name: "market_type",
|
|
528
|
+
kind: "scalar",
|
|
529
|
+
T: 9
|
|
530
|
+
/*ScalarType.STRING*/
|
|
531
|
+
},
|
|
532
|
+
{
|
|
533
|
+
no: 34,
|
|
534
|
+
name: "last_executed_at",
|
|
535
|
+
kind: "scalar",
|
|
536
|
+
T: 18,
|
|
537
|
+
L: 0
|
|
538
|
+
/*LongType.BIGINT*/
|
|
539
|
+
},
|
|
540
|
+
{
|
|
541
|
+
no: 35,
|
|
542
|
+
name: "trail_up_price",
|
|
543
|
+
kind: "scalar",
|
|
544
|
+
T: 9
|
|
545
|
+
/*ScalarType.STRING*/
|
|
546
|
+
},
|
|
547
|
+
{
|
|
548
|
+
no: 36,
|
|
549
|
+
name: "trail_down_price",
|
|
550
|
+
kind: "scalar",
|
|
551
|
+
T: 9
|
|
552
|
+
/*ScalarType.STRING*/
|
|
553
|
+
},
|
|
554
|
+
{
|
|
555
|
+
no: 37,
|
|
556
|
+
name: "trail_up_counter",
|
|
557
|
+
kind: "scalar",
|
|
558
|
+
T: 18,
|
|
559
|
+
L: 0
|
|
560
|
+
/*LongType.BIGINT*/
|
|
561
|
+
},
|
|
562
|
+
{
|
|
563
|
+
no: 38,
|
|
564
|
+
name: "trail_down_counter",
|
|
565
|
+
kind: "scalar",
|
|
566
|
+
T: 18,
|
|
567
|
+
L: 0
|
|
568
|
+
/*LongType.BIGINT*/
|
|
569
|
+
},
|
|
570
|
+
{
|
|
571
|
+
no: 39,
|
|
572
|
+
name: "tvl",
|
|
573
|
+
kind: "scalar",
|
|
574
|
+
T: 9
|
|
575
|
+
/*ScalarType.STRING*/
|
|
576
|
+
},
|
|
577
|
+
{
|
|
578
|
+
no: 40,
|
|
579
|
+
name: "pnl",
|
|
580
|
+
kind: "scalar",
|
|
581
|
+
T: 9
|
|
582
|
+
/*ScalarType.STRING*/
|
|
583
|
+
},
|
|
584
|
+
{
|
|
585
|
+
no: 41,
|
|
586
|
+
name: "pnl_perc",
|
|
587
|
+
kind: "scalar",
|
|
588
|
+
T: 9
|
|
589
|
+
/*ScalarType.STRING*/
|
|
590
|
+
},
|
|
591
|
+
{
|
|
592
|
+
no: 42,
|
|
593
|
+
name: "pnl_updated_at",
|
|
594
|
+
kind: "scalar",
|
|
595
|
+
T: 18,
|
|
596
|
+
L: 0
|
|
597
|
+
/*LongType.BIGINT*/
|
|
598
|
+
},
|
|
599
|
+
{
|
|
600
|
+
no: 43,
|
|
601
|
+
name: "performance",
|
|
602
|
+
kind: "scalar",
|
|
603
|
+
T: 9
|
|
604
|
+
/*ScalarType.STRING*/
|
|
605
|
+
},
|
|
606
|
+
{
|
|
607
|
+
no: 44,
|
|
608
|
+
name: "roi",
|
|
609
|
+
kind: "scalar",
|
|
610
|
+
T: 9
|
|
611
|
+
/*ScalarType.STRING*/
|
|
612
|
+
},
|
|
613
|
+
{
|
|
614
|
+
no: 45,
|
|
615
|
+
name: "initial_base_price",
|
|
616
|
+
kind: "scalar",
|
|
617
|
+
T: 9
|
|
618
|
+
/*ScalarType.STRING*/
|
|
619
|
+
},
|
|
620
|
+
{
|
|
621
|
+
no: 46,
|
|
622
|
+
name: "initial_quote_price",
|
|
623
|
+
kind: "scalar",
|
|
624
|
+
T: 9
|
|
625
|
+
/*ScalarType.STRING*/
|
|
626
|
+
},
|
|
627
|
+
{
|
|
628
|
+
no: 47,
|
|
629
|
+
name: "current_base_price",
|
|
630
|
+
kind: "scalar",
|
|
631
|
+
T: 9
|
|
632
|
+
/*ScalarType.STRING*/
|
|
633
|
+
},
|
|
634
|
+
{
|
|
635
|
+
no: 48,
|
|
636
|
+
name: "current_quote_price",
|
|
637
|
+
kind: "scalar",
|
|
638
|
+
T: 9
|
|
639
|
+
/*ScalarType.STRING*/
|
|
640
|
+
},
|
|
641
|
+
{
|
|
642
|
+
no: 49,
|
|
643
|
+
name: "final_base_price",
|
|
644
|
+
kind: "scalar",
|
|
645
|
+
T: 9
|
|
646
|
+
/*ScalarType.STRING*/
|
|
647
|
+
},
|
|
648
|
+
{
|
|
649
|
+
no: 50,
|
|
650
|
+
name: "final_quote_price",
|
|
651
|
+
kind: "scalar",
|
|
652
|
+
T: 9
|
|
653
|
+
/*ScalarType.STRING*/
|
|
654
|
+
},
|
|
655
|
+
{ no: 51, name: "final_data", kind: "message", T: () => StrategyFinalData },
|
|
656
|
+
{
|
|
657
|
+
no: 52,
|
|
658
|
+
name: "margin_ratio",
|
|
659
|
+
kind: "scalar",
|
|
660
|
+
T: 9
|
|
661
|
+
/*ScalarType.STRING*/
|
|
662
|
+
},
|
|
663
|
+
{
|
|
664
|
+
no: 53,
|
|
665
|
+
name: "lower_trailing_bound",
|
|
666
|
+
kind: "scalar",
|
|
667
|
+
T: 9
|
|
668
|
+
/*ScalarType.STRING*/
|
|
669
|
+
},
|
|
670
|
+
{
|
|
671
|
+
no: 54,
|
|
672
|
+
name: "upper_trailing_bound",
|
|
673
|
+
kind: "scalar",
|
|
674
|
+
T: 9
|
|
675
|
+
/*ScalarType.STRING*/
|
|
676
|
+
},
|
|
677
|
+
{
|
|
678
|
+
no: 55,
|
|
679
|
+
name: "new_upper_bound",
|
|
680
|
+
kind: "scalar",
|
|
681
|
+
T: 9
|
|
682
|
+
/*ScalarType.STRING*/
|
|
683
|
+
},
|
|
684
|
+
{
|
|
685
|
+
no: 56,
|
|
686
|
+
name: "new_lower_bound",
|
|
687
|
+
kind: "scalar",
|
|
688
|
+
T: 9
|
|
689
|
+
/*ScalarType.STRING*/
|
|
690
|
+
}
|
|
691
|
+
]);
|
|
692
|
+
}
|
|
693
|
+
create(value) {
|
|
694
|
+
const message = globalThis.Object.create(this.messagePrototype);
|
|
695
|
+
message.state = "";
|
|
696
|
+
message.marketId = "";
|
|
697
|
+
message.subaccountId = "";
|
|
698
|
+
message.accountAddress = "";
|
|
699
|
+
message.contractAddress = "";
|
|
700
|
+
message.executionPrice = "";
|
|
701
|
+
message.baseQuantity = "";
|
|
702
|
+
message.quoteQuantity = "";
|
|
703
|
+
message.lowerBound = "";
|
|
704
|
+
message.upperBound = "";
|
|
705
|
+
message.stopLoss = "";
|
|
706
|
+
message.takeProfit = "";
|
|
707
|
+
message.swapFee = "";
|
|
708
|
+
message.baseDeposit = "";
|
|
709
|
+
message.quoteDeposit = "";
|
|
710
|
+
message.marketMidPrice = "";
|
|
711
|
+
message.subscriptionQuoteQuantity = "";
|
|
712
|
+
message.subscriptionBaseQuantity = "";
|
|
713
|
+
message.numberOfGridLevels = "";
|
|
714
|
+
message.shouldExitWithQuoteOnly = false;
|
|
715
|
+
message.stopReason = "";
|
|
716
|
+
message.pendingExecution = false;
|
|
717
|
+
message.createdHeight = 0n;
|
|
718
|
+
message.removedHeight = 0n;
|
|
719
|
+
message.createdAt = 0n;
|
|
720
|
+
message.updatedAt = 0n;
|
|
721
|
+
message.exitType = "";
|
|
722
|
+
message.strategyType = "";
|
|
723
|
+
message.contractVersion = "";
|
|
724
|
+
message.contractName = "";
|
|
725
|
+
message.marketType = "";
|
|
726
|
+
message.lastExecutedAt = 0n;
|
|
727
|
+
message.trailUpPrice = "";
|
|
728
|
+
message.trailDownPrice = "";
|
|
729
|
+
message.trailUpCounter = 0n;
|
|
730
|
+
message.trailDownCounter = 0n;
|
|
731
|
+
message.tvl = "";
|
|
732
|
+
message.pnl = "";
|
|
733
|
+
message.pnlPerc = "";
|
|
734
|
+
message.pnlUpdatedAt = 0n;
|
|
735
|
+
message.performance = "";
|
|
736
|
+
message.roi = "";
|
|
737
|
+
message.initialBasePrice = "";
|
|
738
|
+
message.initialQuotePrice = "";
|
|
739
|
+
message.currentBasePrice = "";
|
|
740
|
+
message.currentQuotePrice = "";
|
|
741
|
+
message.finalBasePrice = "";
|
|
742
|
+
message.finalQuotePrice = "";
|
|
743
|
+
message.marginRatio = "";
|
|
744
|
+
message.lowerTrailingBound = "";
|
|
745
|
+
message.upperTrailingBound = "";
|
|
746
|
+
message.newUpperBound = "";
|
|
747
|
+
message.newLowerBound = "";
|
|
748
|
+
if (value !== void 0)
|
|
749
|
+
reflectionMergePartial(this, message, value);
|
|
750
|
+
return message;
|
|
751
|
+
}
|
|
752
|
+
internalBinaryRead(reader, length, options, target) {
|
|
753
|
+
let message = target ?? this.create(), end = reader.pos + length;
|
|
754
|
+
while (reader.pos < end) {
|
|
755
|
+
let [fieldNo, wireType] = reader.tag();
|
|
756
|
+
switch (fieldNo) {
|
|
757
|
+
case /* string state */
|
|
758
|
+
1:
|
|
759
|
+
message.state = reader.string();
|
|
760
|
+
break;
|
|
761
|
+
case /* string market_id */
|
|
762
|
+
2:
|
|
763
|
+
message.marketId = reader.string();
|
|
764
|
+
break;
|
|
765
|
+
case /* string subaccount_id */
|
|
766
|
+
3:
|
|
767
|
+
message.subaccountId = reader.string();
|
|
768
|
+
break;
|
|
769
|
+
case /* string account_address */
|
|
770
|
+
4:
|
|
771
|
+
message.accountAddress = reader.string();
|
|
772
|
+
break;
|
|
773
|
+
case /* string contract_address */
|
|
774
|
+
5:
|
|
775
|
+
message.contractAddress = reader.string();
|
|
776
|
+
break;
|
|
777
|
+
case /* string execution_price */
|
|
778
|
+
6:
|
|
779
|
+
message.executionPrice = reader.string();
|
|
780
|
+
break;
|
|
781
|
+
case /* string base_quantity */
|
|
782
|
+
7:
|
|
783
|
+
message.baseQuantity = reader.string();
|
|
784
|
+
break;
|
|
785
|
+
case /* string quote_quantity */
|
|
786
|
+
20:
|
|
787
|
+
message.quoteQuantity = reader.string();
|
|
788
|
+
break;
|
|
789
|
+
case /* string lower_bound */
|
|
790
|
+
8:
|
|
791
|
+
message.lowerBound = reader.string();
|
|
792
|
+
break;
|
|
793
|
+
case /* string upper_bound */
|
|
794
|
+
9:
|
|
795
|
+
message.upperBound = reader.string();
|
|
796
|
+
break;
|
|
797
|
+
case /* string stop_loss */
|
|
798
|
+
10:
|
|
799
|
+
message.stopLoss = reader.string();
|
|
800
|
+
break;
|
|
801
|
+
case /* string take_profit */
|
|
802
|
+
11:
|
|
803
|
+
message.takeProfit = reader.string();
|
|
804
|
+
break;
|
|
805
|
+
case /* string swap_fee */
|
|
806
|
+
12:
|
|
807
|
+
message.swapFee = reader.string();
|
|
808
|
+
break;
|
|
809
|
+
case /* string base_deposit */
|
|
810
|
+
17:
|
|
811
|
+
message.baseDeposit = reader.string();
|
|
812
|
+
break;
|
|
813
|
+
case /* string quote_deposit */
|
|
814
|
+
18:
|
|
815
|
+
message.quoteDeposit = reader.string();
|
|
816
|
+
break;
|
|
817
|
+
case /* string market_mid_price */
|
|
818
|
+
19:
|
|
819
|
+
message.marketMidPrice = reader.string();
|
|
820
|
+
break;
|
|
821
|
+
case /* string subscription_quote_quantity */
|
|
822
|
+
21:
|
|
823
|
+
message.subscriptionQuoteQuantity = reader.string();
|
|
824
|
+
break;
|
|
825
|
+
case /* string subscription_base_quantity */
|
|
826
|
+
22:
|
|
827
|
+
message.subscriptionBaseQuantity = reader.string();
|
|
828
|
+
break;
|
|
829
|
+
case /* string number_of_grid_levels */
|
|
830
|
+
23:
|
|
831
|
+
message.numberOfGridLevels = reader.string();
|
|
832
|
+
break;
|
|
833
|
+
case /* bool should_exit_with_quote_only */
|
|
834
|
+
24:
|
|
835
|
+
message.shouldExitWithQuoteOnly = reader.bool();
|
|
836
|
+
break;
|
|
837
|
+
case /* string stop_reason */
|
|
838
|
+
25:
|
|
839
|
+
message.stopReason = reader.string();
|
|
840
|
+
break;
|
|
841
|
+
case /* bool pending_execution */
|
|
842
|
+
26:
|
|
843
|
+
message.pendingExecution = reader.bool();
|
|
844
|
+
break;
|
|
845
|
+
case /* sint64 created_height */
|
|
846
|
+
13:
|
|
847
|
+
message.createdHeight = reader.sint64().toBigInt();
|
|
848
|
+
break;
|
|
849
|
+
case /* sint64 removed_height */
|
|
850
|
+
14:
|
|
851
|
+
message.removedHeight = reader.sint64().toBigInt();
|
|
852
|
+
break;
|
|
853
|
+
case /* sint64 created_at */
|
|
854
|
+
15:
|
|
855
|
+
message.createdAt = reader.sint64().toBigInt();
|
|
856
|
+
break;
|
|
857
|
+
case /* sint64 updated_at */
|
|
858
|
+
16:
|
|
859
|
+
message.updatedAt = reader.sint64().toBigInt();
|
|
860
|
+
break;
|
|
861
|
+
case /* string exit_type */
|
|
862
|
+
27:
|
|
863
|
+
message.exitType = reader.string();
|
|
864
|
+
break;
|
|
865
|
+
case /* injective_trading_rpc.ExitConfig stop_loss_config */
|
|
866
|
+
28:
|
|
867
|
+
message.stopLossConfig = ExitConfig.internalBinaryRead(reader, reader.uint32(), options, message.stopLossConfig);
|
|
868
|
+
break;
|
|
869
|
+
case /* injective_trading_rpc.ExitConfig take_profit_config */
|
|
870
|
+
29:
|
|
871
|
+
message.takeProfitConfig = ExitConfig.internalBinaryRead(reader, reader.uint32(), options, message.takeProfitConfig);
|
|
872
|
+
break;
|
|
873
|
+
case /* string strategy_type */
|
|
874
|
+
30:
|
|
875
|
+
message.strategyType = reader.string();
|
|
876
|
+
break;
|
|
877
|
+
case /* string contract_version */
|
|
878
|
+
31:
|
|
879
|
+
message.contractVersion = reader.string();
|
|
880
|
+
break;
|
|
881
|
+
case /* string contract_name */
|
|
882
|
+
32:
|
|
883
|
+
message.contractName = reader.string();
|
|
884
|
+
break;
|
|
885
|
+
case /* string market_type */
|
|
886
|
+
33:
|
|
887
|
+
message.marketType = reader.string();
|
|
888
|
+
break;
|
|
889
|
+
case /* sint64 last_executed_at */
|
|
890
|
+
34:
|
|
891
|
+
message.lastExecutedAt = reader.sint64().toBigInt();
|
|
892
|
+
break;
|
|
893
|
+
case /* string trail_up_price */
|
|
894
|
+
35:
|
|
895
|
+
message.trailUpPrice = reader.string();
|
|
896
|
+
break;
|
|
897
|
+
case /* string trail_down_price */
|
|
898
|
+
36:
|
|
899
|
+
message.trailDownPrice = reader.string();
|
|
900
|
+
break;
|
|
901
|
+
case /* sint64 trail_up_counter */
|
|
902
|
+
37:
|
|
903
|
+
message.trailUpCounter = reader.sint64().toBigInt();
|
|
904
|
+
break;
|
|
905
|
+
case /* sint64 trail_down_counter */
|
|
906
|
+
38:
|
|
907
|
+
message.trailDownCounter = reader.sint64().toBigInt();
|
|
908
|
+
break;
|
|
909
|
+
case /* string tvl */
|
|
910
|
+
39:
|
|
911
|
+
message.tvl = reader.string();
|
|
912
|
+
break;
|
|
913
|
+
case /* string pnl */
|
|
914
|
+
40:
|
|
915
|
+
message.pnl = reader.string();
|
|
916
|
+
break;
|
|
917
|
+
case /* string pnl_perc */
|
|
918
|
+
41:
|
|
919
|
+
message.pnlPerc = reader.string();
|
|
920
|
+
break;
|
|
921
|
+
case /* sint64 pnl_updated_at */
|
|
922
|
+
42:
|
|
923
|
+
message.pnlUpdatedAt = reader.sint64().toBigInt();
|
|
924
|
+
break;
|
|
925
|
+
case /* string performance */
|
|
926
|
+
43:
|
|
927
|
+
message.performance = reader.string();
|
|
928
|
+
break;
|
|
929
|
+
case /* string roi */
|
|
930
|
+
44:
|
|
931
|
+
message.roi = reader.string();
|
|
932
|
+
break;
|
|
933
|
+
case /* string initial_base_price */
|
|
934
|
+
45:
|
|
935
|
+
message.initialBasePrice = reader.string();
|
|
936
|
+
break;
|
|
937
|
+
case /* string initial_quote_price */
|
|
938
|
+
46:
|
|
939
|
+
message.initialQuotePrice = reader.string();
|
|
940
|
+
break;
|
|
941
|
+
case /* string current_base_price */
|
|
942
|
+
47:
|
|
943
|
+
message.currentBasePrice = reader.string();
|
|
944
|
+
break;
|
|
945
|
+
case /* string current_quote_price */
|
|
946
|
+
48:
|
|
947
|
+
message.currentQuotePrice = reader.string();
|
|
948
|
+
break;
|
|
949
|
+
case /* string final_base_price */
|
|
950
|
+
49:
|
|
951
|
+
message.finalBasePrice = reader.string();
|
|
952
|
+
break;
|
|
953
|
+
case /* string final_quote_price */
|
|
954
|
+
50:
|
|
955
|
+
message.finalQuotePrice = reader.string();
|
|
956
|
+
break;
|
|
957
|
+
case /* injective_trading_rpc.StrategyFinalData final_data */
|
|
958
|
+
51:
|
|
959
|
+
message.finalData = StrategyFinalData.internalBinaryRead(reader, reader.uint32(), options, message.finalData);
|
|
960
|
+
break;
|
|
961
|
+
case /* string margin_ratio */
|
|
962
|
+
52:
|
|
963
|
+
message.marginRatio = reader.string();
|
|
964
|
+
break;
|
|
965
|
+
case /* string lower_trailing_bound */
|
|
966
|
+
53:
|
|
967
|
+
message.lowerTrailingBound = reader.string();
|
|
968
|
+
break;
|
|
969
|
+
case /* string upper_trailing_bound */
|
|
970
|
+
54:
|
|
971
|
+
message.upperTrailingBound = reader.string();
|
|
972
|
+
break;
|
|
973
|
+
case /* string new_upper_bound */
|
|
974
|
+
55:
|
|
975
|
+
message.newUpperBound = reader.string();
|
|
976
|
+
break;
|
|
977
|
+
case /* string new_lower_bound */
|
|
978
|
+
56:
|
|
979
|
+
message.newLowerBound = reader.string();
|
|
980
|
+
break;
|
|
981
|
+
default:
|
|
982
|
+
let u = options.readUnknownField;
|
|
983
|
+
if (u === "throw")
|
|
984
|
+
throw new globalThis.Error(`Unknown field ${fieldNo} (wire type ${wireType}) for ${this.typeName}`);
|
|
985
|
+
let d = reader.skip(wireType);
|
|
986
|
+
if (u !== false)
|
|
987
|
+
(u === true ? UnknownFieldHandler.onRead : u)(this.typeName, message, fieldNo, wireType, d);
|
|
988
|
+
}
|
|
989
|
+
}
|
|
990
|
+
return message;
|
|
991
|
+
}
|
|
992
|
+
internalBinaryWrite(message, writer, options) {
|
|
993
|
+
if (message.state !== "")
|
|
994
|
+
writer.tag(1, WireType.LengthDelimited).string(message.state);
|
|
995
|
+
if (message.marketId !== "")
|
|
996
|
+
writer.tag(2, WireType.LengthDelimited).string(message.marketId);
|
|
997
|
+
if (message.subaccountId !== "")
|
|
998
|
+
writer.tag(3, WireType.LengthDelimited).string(message.subaccountId);
|
|
999
|
+
if (message.accountAddress !== "")
|
|
1000
|
+
writer.tag(4, WireType.LengthDelimited).string(message.accountAddress);
|
|
1001
|
+
if (message.contractAddress !== "")
|
|
1002
|
+
writer.tag(5, WireType.LengthDelimited).string(message.contractAddress);
|
|
1003
|
+
if (message.executionPrice !== "")
|
|
1004
|
+
writer.tag(6, WireType.LengthDelimited).string(message.executionPrice);
|
|
1005
|
+
if (message.baseQuantity !== "")
|
|
1006
|
+
writer.tag(7, WireType.LengthDelimited).string(message.baseQuantity);
|
|
1007
|
+
if (message.lowerBound !== "")
|
|
1008
|
+
writer.tag(8, WireType.LengthDelimited).string(message.lowerBound);
|
|
1009
|
+
if (message.upperBound !== "")
|
|
1010
|
+
writer.tag(9, WireType.LengthDelimited).string(message.upperBound);
|
|
1011
|
+
if (message.stopLoss !== "")
|
|
1012
|
+
writer.tag(10, WireType.LengthDelimited).string(message.stopLoss);
|
|
1013
|
+
if (message.takeProfit !== "")
|
|
1014
|
+
writer.tag(11, WireType.LengthDelimited).string(message.takeProfit);
|
|
1015
|
+
if (message.swapFee !== "")
|
|
1016
|
+
writer.tag(12, WireType.LengthDelimited).string(message.swapFee);
|
|
1017
|
+
if (message.createdHeight !== 0n)
|
|
1018
|
+
writer.tag(13, WireType.Varint).sint64(message.createdHeight);
|
|
1019
|
+
if (message.removedHeight !== 0n)
|
|
1020
|
+
writer.tag(14, WireType.Varint).sint64(message.removedHeight);
|
|
1021
|
+
if (message.createdAt !== 0n)
|
|
1022
|
+
writer.tag(15, WireType.Varint).sint64(message.createdAt);
|
|
1023
|
+
if (message.updatedAt !== 0n)
|
|
1024
|
+
writer.tag(16, WireType.Varint).sint64(message.updatedAt);
|
|
1025
|
+
if (message.baseDeposit !== "")
|
|
1026
|
+
writer.tag(17, WireType.LengthDelimited).string(message.baseDeposit);
|
|
1027
|
+
if (message.quoteDeposit !== "")
|
|
1028
|
+
writer.tag(18, WireType.LengthDelimited).string(message.quoteDeposit);
|
|
1029
|
+
if (message.marketMidPrice !== "")
|
|
1030
|
+
writer.tag(19, WireType.LengthDelimited).string(message.marketMidPrice);
|
|
1031
|
+
if (message.quoteQuantity !== "")
|
|
1032
|
+
writer.tag(20, WireType.LengthDelimited).string(message.quoteQuantity);
|
|
1033
|
+
if (message.subscriptionQuoteQuantity !== "")
|
|
1034
|
+
writer.tag(21, WireType.LengthDelimited).string(message.subscriptionQuoteQuantity);
|
|
1035
|
+
if (message.subscriptionBaseQuantity !== "")
|
|
1036
|
+
writer.tag(22, WireType.LengthDelimited).string(message.subscriptionBaseQuantity);
|
|
1037
|
+
if (message.numberOfGridLevels !== "")
|
|
1038
|
+
writer.tag(23, WireType.LengthDelimited).string(message.numberOfGridLevels);
|
|
1039
|
+
if (message.shouldExitWithQuoteOnly !== false)
|
|
1040
|
+
writer.tag(24, WireType.Varint).bool(message.shouldExitWithQuoteOnly);
|
|
1041
|
+
if (message.stopReason !== "")
|
|
1042
|
+
writer.tag(25, WireType.LengthDelimited).string(message.stopReason);
|
|
1043
|
+
if (message.pendingExecution !== false)
|
|
1044
|
+
writer.tag(26, WireType.Varint).bool(message.pendingExecution);
|
|
1045
|
+
if (message.exitType !== "")
|
|
1046
|
+
writer.tag(27, WireType.LengthDelimited).string(message.exitType);
|
|
1047
|
+
if (message.stopLossConfig)
|
|
1048
|
+
ExitConfig.internalBinaryWrite(message.stopLossConfig, writer.tag(28, WireType.LengthDelimited).fork(), options).join();
|
|
1049
|
+
if (message.takeProfitConfig)
|
|
1050
|
+
ExitConfig.internalBinaryWrite(message.takeProfitConfig, writer.tag(29, WireType.LengthDelimited).fork(), options).join();
|
|
1051
|
+
if (message.strategyType !== "")
|
|
1052
|
+
writer.tag(30, WireType.LengthDelimited).string(message.strategyType);
|
|
1053
|
+
if (message.contractVersion !== "")
|
|
1054
|
+
writer.tag(31, WireType.LengthDelimited).string(message.contractVersion);
|
|
1055
|
+
if (message.contractName !== "")
|
|
1056
|
+
writer.tag(32, WireType.LengthDelimited).string(message.contractName);
|
|
1057
|
+
if (message.marketType !== "")
|
|
1058
|
+
writer.tag(33, WireType.LengthDelimited).string(message.marketType);
|
|
1059
|
+
if (message.lastExecutedAt !== 0n)
|
|
1060
|
+
writer.tag(34, WireType.Varint).sint64(message.lastExecutedAt);
|
|
1061
|
+
if (message.trailUpPrice !== "")
|
|
1062
|
+
writer.tag(35, WireType.LengthDelimited).string(message.trailUpPrice);
|
|
1063
|
+
if (message.trailDownPrice !== "")
|
|
1064
|
+
writer.tag(36, WireType.LengthDelimited).string(message.trailDownPrice);
|
|
1065
|
+
if (message.trailUpCounter !== 0n)
|
|
1066
|
+
writer.tag(37, WireType.Varint).sint64(message.trailUpCounter);
|
|
1067
|
+
if (message.trailDownCounter !== 0n)
|
|
1068
|
+
writer.tag(38, WireType.Varint).sint64(message.trailDownCounter);
|
|
1069
|
+
if (message.tvl !== "")
|
|
1070
|
+
writer.tag(39, WireType.LengthDelimited).string(message.tvl);
|
|
1071
|
+
if (message.pnl !== "")
|
|
1072
|
+
writer.tag(40, WireType.LengthDelimited).string(message.pnl);
|
|
1073
|
+
if (message.pnlPerc !== "")
|
|
1074
|
+
writer.tag(41, WireType.LengthDelimited).string(message.pnlPerc);
|
|
1075
|
+
if (message.pnlUpdatedAt !== 0n)
|
|
1076
|
+
writer.tag(42, WireType.Varint).sint64(message.pnlUpdatedAt);
|
|
1077
|
+
if (message.performance !== "")
|
|
1078
|
+
writer.tag(43, WireType.LengthDelimited).string(message.performance);
|
|
1079
|
+
if (message.roi !== "")
|
|
1080
|
+
writer.tag(44, WireType.LengthDelimited).string(message.roi);
|
|
1081
|
+
if (message.initialBasePrice !== "")
|
|
1082
|
+
writer.tag(45, WireType.LengthDelimited).string(message.initialBasePrice);
|
|
1083
|
+
if (message.initialQuotePrice !== "")
|
|
1084
|
+
writer.tag(46, WireType.LengthDelimited).string(message.initialQuotePrice);
|
|
1085
|
+
if (message.currentBasePrice !== "")
|
|
1086
|
+
writer.tag(47, WireType.LengthDelimited).string(message.currentBasePrice);
|
|
1087
|
+
if (message.currentQuotePrice !== "")
|
|
1088
|
+
writer.tag(48, WireType.LengthDelimited).string(message.currentQuotePrice);
|
|
1089
|
+
if (message.finalBasePrice !== "")
|
|
1090
|
+
writer.tag(49, WireType.LengthDelimited).string(message.finalBasePrice);
|
|
1091
|
+
if (message.finalQuotePrice !== "")
|
|
1092
|
+
writer.tag(50, WireType.LengthDelimited).string(message.finalQuotePrice);
|
|
1093
|
+
if (message.finalData)
|
|
1094
|
+
StrategyFinalData.internalBinaryWrite(message.finalData, writer.tag(51, WireType.LengthDelimited).fork(), options).join();
|
|
1095
|
+
if (message.marginRatio !== "")
|
|
1096
|
+
writer.tag(52, WireType.LengthDelimited).string(message.marginRatio);
|
|
1097
|
+
if (message.lowerTrailingBound !== "")
|
|
1098
|
+
writer.tag(53, WireType.LengthDelimited).string(message.lowerTrailingBound);
|
|
1099
|
+
if (message.upperTrailingBound !== "")
|
|
1100
|
+
writer.tag(54, WireType.LengthDelimited).string(message.upperTrailingBound);
|
|
1101
|
+
if (message.newUpperBound !== "")
|
|
1102
|
+
writer.tag(55, WireType.LengthDelimited).string(message.newUpperBound);
|
|
1103
|
+
if (message.newLowerBound !== "")
|
|
1104
|
+
writer.tag(56, WireType.LengthDelimited).string(message.newLowerBound);
|
|
1105
|
+
let u = options.writeUnknownFields;
|
|
1106
|
+
if (u !== false)
|
|
1107
|
+
(u == true ? UnknownFieldHandler.onWrite : u)(this.typeName, message, writer);
|
|
1108
|
+
return writer;
|
|
1109
|
+
}
|
|
1110
|
+
}
|
|
1111
|
+
const TradingStrategy = new TradingStrategy$Type();
|
|
1112
|
+
class ExitConfig$Type extends MessageType {
|
|
1113
|
+
constructor() {
|
|
1114
|
+
super("injective_trading_rpc.ExitConfig", [
|
|
1115
|
+
{
|
|
1116
|
+
no: 1,
|
|
1117
|
+
name: "exit_type",
|
|
1118
|
+
kind: "scalar",
|
|
1119
|
+
T: 9
|
|
1120
|
+
/*ScalarType.STRING*/
|
|
1121
|
+
},
|
|
1122
|
+
{
|
|
1123
|
+
no: 2,
|
|
1124
|
+
name: "exit_price",
|
|
1125
|
+
kind: "scalar",
|
|
1126
|
+
T: 9
|
|
1127
|
+
/*ScalarType.STRING*/
|
|
1128
|
+
}
|
|
1129
|
+
]);
|
|
1130
|
+
}
|
|
1131
|
+
create(value) {
|
|
1132
|
+
const message = globalThis.Object.create(this.messagePrototype);
|
|
1133
|
+
message.exitType = "";
|
|
1134
|
+
message.exitPrice = "";
|
|
1135
|
+
if (value !== void 0)
|
|
1136
|
+
reflectionMergePartial(this, message, value);
|
|
1137
|
+
return message;
|
|
1138
|
+
}
|
|
1139
|
+
internalBinaryRead(reader, length, options, target) {
|
|
1140
|
+
let message = target ?? this.create(), end = reader.pos + length;
|
|
1141
|
+
while (reader.pos < end) {
|
|
1142
|
+
let [fieldNo, wireType] = reader.tag();
|
|
1143
|
+
switch (fieldNo) {
|
|
1144
|
+
case /* string exit_type */
|
|
1145
|
+
1:
|
|
1146
|
+
message.exitType = reader.string();
|
|
1147
|
+
break;
|
|
1148
|
+
case /* string exit_price */
|
|
1149
|
+
2:
|
|
1150
|
+
message.exitPrice = reader.string();
|
|
1151
|
+
break;
|
|
1152
|
+
default:
|
|
1153
|
+
let u = options.readUnknownField;
|
|
1154
|
+
if (u === "throw")
|
|
1155
|
+
throw new globalThis.Error(`Unknown field ${fieldNo} (wire type ${wireType}) for ${this.typeName}`);
|
|
1156
|
+
let d = reader.skip(wireType);
|
|
1157
|
+
if (u !== false)
|
|
1158
|
+
(u === true ? UnknownFieldHandler.onRead : u)(this.typeName, message, fieldNo, wireType, d);
|
|
1159
|
+
}
|
|
1160
|
+
}
|
|
1161
|
+
return message;
|
|
1162
|
+
}
|
|
1163
|
+
internalBinaryWrite(message, writer, options) {
|
|
1164
|
+
if (message.exitType !== "")
|
|
1165
|
+
writer.tag(1, WireType.LengthDelimited).string(message.exitType);
|
|
1166
|
+
if (message.exitPrice !== "")
|
|
1167
|
+
writer.tag(2, WireType.LengthDelimited).string(message.exitPrice);
|
|
1168
|
+
let u = options.writeUnknownFields;
|
|
1169
|
+
if (u !== false)
|
|
1170
|
+
(u == true ? UnknownFieldHandler.onWrite : u)(this.typeName, message, writer);
|
|
1171
|
+
return writer;
|
|
1172
|
+
}
|
|
1173
|
+
}
|
|
1174
|
+
const ExitConfig = new ExitConfig$Type();
|
|
1175
|
+
class StrategyFinalData$Type extends MessageType {
|
|
1176
|
+
constructor() {
|
|
1177
|
+
super("injective_trading_rpc.StrategyFinalData", [
|
|
1178
|
+
{
|
|
1179
|
+
no: 1,
|
|
1180
|
+
name: "initial_base_amount",
|
|
1181
|
+
kind: "scalar",
|
|
1182
|
+
T: 9
|
|
1183
|
+
/*ScalarType.STRING*/
|
|
1184
|
+
},
|
|
1185
|
+
{
|
|
1186
|
+
no: 2,
|
|
1187
|
+
name: "initial_quote_amount",
|
|
1188
|
+
kind: "scalar",
|
|
1189
|
+
T: 9
|
|
1190
|
+
/*ScalarType.STRING*/
|
|
1191
|
+
},
|
|
1192
|
+
{
|
|
1193
|
+
no: 3,
|
|
1194
|
+
name: "final_base_amount",
|
|
1195
|
+
kind: "scalar",
|
|
1196
|
+
T: 9
|
|
1197
|
+
/*ScalarType.STRING*/
|
|
1198
|
+
},
|
|
1199
|
+
{
|
|
1200
|
+
no: 4,
|
|
1201
|
+
name: "final_quote_amount",
|
|
1202
|
+
kind: "scalar",
|
|
1203
|
+
T: 9
|
|
1204
|
+
/*ScalarType.STRING*/
|
|
1205
|
+
},
|
|
1206
|
+
{
|
|
1207
|
+
no: 5,
|
|
1208
|
+
name: "initial_base_price",
|
|
1209
|
+
kind: "scalar",
|
|
1210
|
+
T: 9
|
|
1211
|
+
/*ScalarType.STRING*/
|
|
1212
|
+
},
|
|
1213
|
+
{
|
|
1214
|
+
no: 6,
|
|
1215
|
+
name: "initial_quote_price",
|
|
1216
|
+
kind: "scalar",
|
|
1217
|
+
T: 9
|
|
1218
|
+
/*ScalarType.STRING*/
|
|
1219
|
+
},
|
|
1220
|
+
{
|
|
1221
|
+
no: 7,
|
|
1222
|
+
name: "final_base_price",
|
|
1223
|
+
kind: "scalar",
|
|
1224
|
+
T: 9
|
|
1225
|
+
/*ScalarType.STRING*/
|
|
1226
|
+
},
|
|
1227
|
+
{
|
|
1228
|
+
no: 8,
|
|
1229
|
+
name: "final_quote_price",
|
|
1230
|
+
kind: "scalar",
|
|
1231
|
+
T: 9
|
|
1232
|
+
/*ScalarType.STRING*/
|
|
1233
|
+
}
|
|
1234
|
+
]);
|
|
1235
|
+
}
|
|
1236
|
+
create(value) {
|
|
1237
|
+
const message = globalThis.Object.create(this.messagePrototype);
|
|
1238
|
+
message.initialBaseAmount = "";
|
|
1239
|
+
message.initialQuoteAmount = "";
|
|
1240
|
+
message.finalBaseAmount = "";
|
|
1241
|
+
message.finalQuoteAmount = "";
|
|
1242
|
+
message.initialBasePrice = "";
|
|
1243
|
+
message.initialQuotePrice = "";
|
|
1244
|
+
message.finalBasePrice = "";
|
|
1245
|
+
message.finalQuotePrice = "";
|
|
1246
|
+
if (value !== void 0)
|
|
1247
|
+
reflectionMergePartial(this, message, value);
|
|
1248
|
+
return message;
|
|
1249
|
+
}
|
|
1250
|
+
internalBinaryRead(reader, length, options, target) {
|
|
1251
|
+
let message = target ?? this.create(), end = reader.pos + length;
|
|
1252
|
+
while (reader.pos < end) {
|
|
1253
|
+
let [fieldNo, wireType] = reader.tag();
|
|
1254
|
+
switch (fieldNo) {
|
|
1255
|
+
case /* string initial_base_amount */
|
|
1256
|
+
1:
|
|
1257
|
+
message.initialBaseAmount = reader.string();
|
|
1258
|
+
break;
|
|
1259
|
+
case /* string initial_quote_amount */
|
|
1260
|
+
2:
|
|
1261
|
+
message.initialQuoteAmount = reader.string();
|
|
1262
|
+
break;
|
|
1263
|
+
case /* string final_base_amount */
|
|
1264
|
+
3:
|
|
1265
|
+
message.finalBaseAmount = reader.string();
|
|
1266
|
+
break;
|
|
1267
|
+
case /* string final_quote_amount */
|
|
1268
|
+
4:
|
|
1269
|
+
message.finalQuoteAmount = reader.string();
|
|
1270
|
+
break;
|
|
1271
|
+
case /* string initial_base_price */
|
|
1272
|
+
5:
|
|
1273
|
+
message.initialBasePrice = reader.string();
|
|
1274
|
+
break;
|
|
1275
|
+
case /* string initial_quote_price */
|
|
1276
|
+
6:
|
|
1277
|
+
message.initialQuotePrice = reader.string();
|
|
1278
|
+
break;
|
|
1279
|
+
case /* string final_base_price */
|
|
1280
|
+
7:
|
|
1281
|
+
message.finalBasePrice = reader.string();
|
|
1282
|
+
break;
|
|
1283
|
+
case /* string final_quote_price */
|
|
1284
|
+
8:
|
|
1285
|
+
message.finalQuotePrice = reader.string();
|
|
1286
|
+
break;
|
|
1287
|
+
default:
|
|
1288
|
+
let u = options.readUnknownField;
|
|
1289
|
+
if (u === "throw")
|
|
1290
|
+
throw new globalThis.Error(`Unknown field ${fieldNo} (wire type ${wireType}) for ${this.typeName}`);
|
|
1291
|
+
let d = reader.skip(wireType);
|
|
1292
|
+
if (u !== false)
|
|
1293
|
+
(u === true ? UnknownFieldHandler.onRead : u)(this.typeName, message, fieldNo, wireType, d);
|
|
1294
|
+
}
|
|
1295
|
+
}
|
|
1296
|
+
return message;
|
|
1297
|
+
}
|
|
1298
|
+
internalBinaryWrite(message, writer, options) {
|
|
1299
|
+
if (message.initialBaseAmount !== "")
|
|
1300
|
+
writer.tag(1, WireType.LengthDelimited).string(message.initialBaseAmount);
|
|
1301
|
+
if (message.initialQuoteAmount !== "")
|
|
1302
|
+
writer.tag(2, WireType.LengthDelimited).string(message.initialQuoteAmount);
|
|
1303
|
+
if (message.finalBaseAmount !== "")
|
|
1304
|
+
writer.tag(3, WireType.LengthDelimited).string(message.finalBaseAmount);
|
|
1305
|
+
if (message.finalQuoteAmount !== "")
|
|
1306
|
+
writer.tag(4, WireType.LengthDelimited).string(message.finalQuoteAmount);
|
|
1307
|
+
if (message.initialBasePrice !== "")
|
|
1308
|
+
writer.tag(5, WireType.LengthDelimited).string(message.initialBasePrice);
|
|
1309
|
+
if (message.initialQuotePrice !== "")
|
|
1310
|
+
writer.tag(6, WireType.LengthDelimited).string(message.initialQuotePrice);
|
|
1311
|
+
if (message.finalBasePrice !== "")
|
|
1312
|
+
writer.tag(7, WireType.LengthDelimited).string(message.finalBasePrice);
|
|
1313
|
+
if (message.finalQuotePrice !== "")
|
|
1314
|
+
writer.tag(8, WireType.LengthDelimited).string(message.finalQuotePrice);
|
|
1315
|
+
let u = options.writeUnknownFields;
|
|
1316
|
+
if (u !== false)
|
|
1317
|
+
(u == true ? UnknownFieldHandler.onWrite : u)(this.typeName, message, writer);
|
|
1318
|
+
return writer;
|
|
1319
|
+
}
|
|
1320
|
+
}
|
|
1321
|
+
const StrategyFinalData = new StrategyFinalData$Type();
|
|
1322
|
+
class Paging$Type extends MessageType {
|
|
1323
|
+
constructor() {
|
|
1324
|
+
super("injective_trading_rpc.Paging", [
|
|
1325
|
+
{
|
|
1326
|
+
no: 1,
|
|
1327
|
+
name: "total",
|
|
1328
|
+
kind: "scalar",
|
|
1329
|
+
T: 18,
|
|
1330
|
+
L: 0
|
|
1331
|
+
/*LongType.BIGINT*/
|
|
1332
|
+
},
|
|
1333
|
+
{
|
|
1334
|
+
no: 2,
|
|
1335
|
+
name: "from",
|
|
1336
|
+
kind: "scalar",
|
|
1337
|
+
T: 17
|
|
1338
|
+
/*ScalarType.SINT32*/
|
|
1339
|
+
},
|
|
1340
|
+
{
|
|
1341
|
+
no: 3,
|
|
1342
|
+
name: "to",
|
|
1343
|
+
kind: "scalar",
|
|
1344
|
+
T: 17
|
|
1345
|
+
/*ScalarType.SINT32*/
|
|
1346
|
+
},
|
|
1347
|
+
{
|
|
1348
|
+
no: 4,
|
|
1349
|
+
name: "count_by_subaccount",
|
|
1350
|
+
kind: "scalar",
|
|
1351
|
+
T: 18,
|
|
1352
|
+
L: 0
|
|
1353
|
+
/*LongType.BIGINT*/
|
|
1354
|
+
},
|
|
1355
|
+
{
|
|
1356
|
+
no: 5,
|
|
1357
|
+
name: "next",
|
|
1358
|
+
kind: "scalar",
|
|
1359
|
+
repeat: 2,
|
|
1360
|
+
T: 9
|
|
1361
|
+
/*ScalarType.STRING*/
|
|
1362
|
+
}
|
|
1363
|
+
]);
|
|
1364
|
+
}
|
|
1365
|
+
create(value) {
|
|
1366
|
+
const message = globalThis.Object.create(this.messagePrototype);
|
|
1367
|
+
message.total = 0n;
|
|
1368
|
+
message.from = 0;
|
|
1369
|
+
message.to = 0;
|
|
1370
|
+
message.countBySubaccount = 0n;
|
|
1371
|
+
message.next = [];
|
|
1372
|
+
if (value !== void 0)
|
|
1373
|
+
reflectionMergePartial(this, message, value);
|
|
1374
|
+
return message;
|
|
1375
|
+
}
|
|
1376
|
+
internalBinaryRead(reader, length, options, target) {
|
|
1377
|
+
let message = target ?? this.create(), end = reader.pos + length;
|
|
1378
|
+
while (reader.pos < end) {
|
|
1379
|
+
let [fieldNo, wireType] = reader.tag();
|
|
1380
|
+
switch (fieldNo) {
|
|
1381
|
+
case /* sint64 total */
|
|
1382
|
+
1:
|
|
1383
|
+
message.total = reader.sint64().toBigInt();
|
|
1384
|
+
break;
|
|
1385
|
+
case /* sint32 from */
|
|
1386
|
+
2:
|
|
1387
|
+
message.from = reader.sint32();
|
|
1388
|
+
break;
|
|
1389
|
+
case /* sint32 to */
|
|
1390
|
+
3:
|
|
1391
|
+
message.to = reader.sint32();
|
|
1392
|
+
break;
|
|
1393
|
+
case /* sint64 count_by_subaccount */
|
|
1394
|
+
4:
|
|
1395
|
+
message.countBySubaccount = reader.sint64().toBigInt();
|
|
1396
|
+
break;
|
|
1397
|
+
case /* repeated string next */
|
|
1398
|
+
5:
|
|
1399
|
+
message.next.push(reader.string());
|
|
1400
|
+
break;
|
|
1401
|
+
default:
|
|
1402
|
+
let u = options.readUnknownField;
|
|
1403
|
+
if (u === "throw")
|
|
1404
|
+
throw new globalThis.Error(`Unknown field ${fieldNo} (wire type ${wireType}) for ${this.typeName}`);
|
|
1405
|
+
let d = reader.skip(wireType);
|
|
1406
|
+
if (u !== false)
|
|
1407
|
+
(u === true ? UnknownFieldHandler.onRead : u)(this.typeName, message, fieldNo, wireType, d);
|
|
1408
|
+
}
|
|
1409
|
+
}
|
|
1410
|
+
return message;
|
|
1411
|
+
}
|
|
1412
|
+
internalBinaryWrite(message, writer, options) {
|
|
1413
|
+
if (message.total !== 0n)
|
|
1414
|
+
writer.tag(1, WireType.Varint).sint64(message.total);
|
|
1415
|
+
if (message.from !== 0)
|
|
1416
|
+
writer.tag(2, WireType.Varint).sint32(message.from);
|
|
1417
|
+
if (message.to !== 0)
|
|
1418
|
+
writer.tag(3, WireType.Varint).sint32(message.to);
|
|
1419
|
+
if (message.countBySubaccount !== 0n)
|
|
1420
|
+
writer.tag(4, WireType.Varint).sint64(message.countBySubaccount);
|
|
1421
|
+
for (let i = 0; i < message.next.length; i++)
|
|
1422
|
+
writer.tag(5, WireType.LengthDelimited).string(message.next[i]);
|
|
1423
|
+
let u = options.writeUnknownFields;
|
|
1424
|
+
if (u !== false)
|
|
1425
|
+
(u == true ? UnknownFieldHandler.onWrite : u)(this.typeName, message, writer);
|
|
1426
|
+
return writer;
|
|
1427
|
+
}
|
|
1428
|
+
}
|
|
1429
|
+
const Paging = new Paging$Type();
|
|
1430
|
+
class GetTradingStatsRequest$Type extends MessageType {
|
|
1431
|
+
constructor() {
|
|
1432
|
+
super("injective_trading_rpc.GetTradingStatsRequest", []);
|
|
1433
|
+
}
|
|
1434
|
+
create(value) {
|
|
1435
|
+
const message = globalThis.Object.create(this.messagePrototype);
|
|
1436
|
+
if (value !== void 0)
|
|
1437
|
+
reflectionMergePartial(this, message, value);
|
|
1438
|
+
return message;
|
|
1439
|
+
}
|
|
1440
|
+
internalBinaryRead(reader, length, options, target) {
|
|
1441
|
+
let message = target ?? this.create(), end = reader.pos + length;
|
|
1442
|
+
while (reader.pos < end) {
|
|
1443
|
+
let [fieldNo, wireType] = reader.tag();
|
|
1444
|
+
switch (fieldNo) {
|
|
1445
|
+
default:
|
|
1446
|
+
let u = options.readUnknownField;
|
|
1447
|
+
if (u === "throw")
|
|
1448
|
+
throw new globalThis.Error(`Unknown field ${fieldNo} (wire type ${wireType}) for ${this.typeName}`);
|
|
1449
|
+
let d = reader.skip(wireType);
|
|
1450
|
+
if (u !== false)
|
|
1451
|
+
(u === true ? UnknownFieldHandler.onRead : u)(this.typeName, message, fieldNo, wireType, d);
|
|
1452
|
+
}
|
|
1453
|
+
}
|
|
1454
|
+
return message;
|
|
1455
|
+
}
|
|
1456
|
+
internalBinaryWrite(message, writer, options) {
|
|
1457
|
+
let u = options.writeUnknownFields;
|
|
1458
|
+
if (u !== false)
|
|
1459
|
+
(u == true ? UnknownFieldHandler.onWrite : u)(this.typeName, message, writer);
|
|
1460
|
+
return writer;
|
|
1461
|
+
}
|
|
1462
|
+
}
|
|
1463
|
+
const GetTradingStatsRequest = new GetTradingStatsRequest$Type();
|
|
1464
|
+
class GetTradingStatsResponse$Type extends MessageType {
|
|
1465
|
+
constructor() {
|
|
1466
|
+
super("injective_trading_rpc.GetTradingStatsResponse", [
|
|
1467
|
+
{
|
|
1468
|
+
no: 1,
|
|
1469
|
+
name: "active_trading_strategies",
|
|
1470
|
+
kind: "scalar",
|
|
1471
|
+
T: 4,
|
|
1472
|
+
L: 0
|
|
1473
|
+
/*LongType.BIGINT*/
|
|
1474
|
+
},
|
|
1475
|
+
{
|
|
1476
|
+
no: 2,
|
|
1477
|
+
name: "total_trading_strategies_created",
|
|
1478
|
+
kind: "scalar",
|
|
1479
|
+
T: 4,
|
|
1480
|
+
L: 0
|
|
1481
|
+
/*LongType.BIGINT*/
|
|
1482
|
+
},
|
|
1483
|
+
{
|
|
1484
|
+
no: 3,
|
|
1485
|
+
name: "total_tvl",
|
|
1486
|
+
kind: "scalar",
|
|
1487
|
+
T: 9
|
|
1488
|
+
/*ScalarType.STRING*/
|
|
1489
|
+
},
|
|
1490
|
+
{ no: 4, name: "markets", kind: "message", repeat: 2, T: () => Market }
|
|
1491
|
+
]);
|
|
1492
|
+
}
|
|
1493
|
+
create(value) {
|
|
1494
|
+
const message = globalThis.Object.create(this.messagePrototype);
|
|
1495
|
+
message.activeTradingStrategies = 0n;
|
|
1496
|
+
message.totalTradingStrategiesCreated = 0n;
|
|
1497
|
+
message.totalTvl = "";
|
|
1498
|
+
message.markets = [];
|
|
1499
|
+
if (value !== void 0)
|
|
1500
|
+
reflectionMergePartial(this, message, value);
|
|
1501
|
+
return message;
|
|
1502
|
+
}
|
|
1503
|
+
internalBinaryRead(reader, length, options, target) {
|
|
1504
|
+
let message = target ?? this.create(), end = reader.pos + length;
|
|
1505
|
+
while (reader.pos < end) {
|
|
1506
|
+
let [fieldNo, wireType] = reader.tag();
|
|
1507
|
+
switch (fieldNo) {
|
|
1508
|
+
case /* uint64 active_trading_strategies */
|
|
1509
|
+
1:
|
|
1510
|
+
message.activeTradingStrategies = reader.uint64().toBigInt();
|
|
1511
|
+
break;
|
|
1512
|
+
case /* uint64 total_trading_strategies_created */
|
|
1513
|
+
2:
|
|
1514
|
+
message.totalTradingStrategiesCreated = reader.uint64().toBigInt();
|
|
1515
|
+
break;
|
|
1516
|
+
case /* string total_tvl */
|
|
1517
|
+
3:
|
|
1518
|
+
message.totalTvl = reader.string();
|
|
1519
|
+
break;
|
|
1520
|
+
case /* repeated injective_trading_rpc.Market markets */
|
|
1521
|
+
4:
|
|
1522
|
+
message.markets.push(Market.internalBinaryRead(reader, reader.uint32(), options));
|
|
1523
|
+
break;
|
|
1524
|
+
default:
|
|
1525
|
+
let u = options.readUnknownField;
|
|
1526
|
+
if (u === "throw")
|
|
1527
|
+
throw new globalThis.Error(`Unknown field ${fieldNo} (wire type ${wireType}) for ${this.typeName}`);
|
|
1528
|
+
let d = reader.skip(wireType);
|
|
1529
|
+
if (u !== false)
|
|
1530
|
+
(u === true ? UnknownFieldHandler.onRead : u)(this.typeName, message, fieldNo, wireType, d);
|
|
1531
|
+
}
|
|
1532
|
+
}
|
|
1533
|
+
return message;
|
|
1534
|
+
}
|
|
1535
|
+
internalBinaryWrite(message, writer, options) {
|
|
1536
|
+
if (message.activeTradingStrategies !== 0n)
|
|
1537
|
+
writer.tag(1, WireType.Varint).uint64(message.activeTradingStrategies);
|
|
1538
|
+
if (message.totalTradingStrategiesCreated !== 0n)
|
|
1539
|
+
writer.tag(2, WireType.Varint).uint64(message.totalTradingStrategiesCreated);
|
|
1540
|
+
if (message.totalTvl !== "")
|
|
1541
|
+
writer.tag(3, WireType.LengthDelimited).string(message.totalTvl);
|
|
1542
|
+
for (let i = 0; i < message.markets.length; i++)
|
|
1543
|
+
Market.internalBinaryWrite(message.markets[i], writer.tag(4, WireType.LengthDelimited).fork(), options).join();
|
|
1544
|
+
let u = options.writeUnknownFields;
|
|
1545
|
+
if (u !== false)
|
|
1546
|
+
(u == true ? UnknownFieldHandler.onWrite : u)(this.typeName, message, writer);
|
|
1547
|
+
return writer;
|
|
1548
|
+
}
|
|
1549
|
+
}
|
|
1550
|
+
const GetTradingStatsResponse = new GetTradingStatsResponse$Type();
|
|
1551
|
+
class Market$Type extends MessageType {
|
|
1552
|
+
constructor() {
|
|
1553
|
+
super("injective_trading_rpc.Market", [
|
|
1554
|
+
{
|
|
1555
|
+
no: 1,
|
|
1556
|
+
name: "market_id",
|
|
1557
|
+
kind: "scalar",
|
|
1558
|
+
T: 9
|
|
1559
|
+
/*ScalarType.STRING*/
|
|
1560
|
+
},
|
|
1561
|
+
{
|
|
1562
|
+
no: 2,
|
|
1563
|
+
name: "active_trading_strategies",
|
|
1564
|
+
kind: "scalar",
|
|
1565
|
+
T: 4,
|
|
1566
|
+
L: 0
|
|
1567
|
+
/*LongType.BIGINT*/
|
|
1568
|
+
}
|
|
1569
|
+
]);
|
|
1570
|
+
}
|
|
1571
|
+
create(value) {
|
|
1572
|
+
const message = globalThis.Object.create(this.messagePrototype);
|
|
1573
|
+
message.marketId = "";
|
|
1574
|
+
message.activeTradingStrategies = 0n;
|
|
1575
|
+
if (value !== void 0)
|
|
1576
|
+
reflectionMergePartial(this, message, value);
|
|
1577
|
+
return message;
|
|
1578
|
+
}
|
|
1579
|
+
internalBinaryRead(reader, length, options, target) {
|
|
1580
|
+
let message = target ?? this.create(), end = reader.pos + length;
|
|
1581
|
+
while (reader.pos < end) {
|
|
1582
|
+
let [fieldNo, wireType] = reader.tag();
|
|
1583
|
+
switch (fieldNo) {
|
|
1584
|
+
case /* string market_id */
|
|
1585
|
+
1:
|
|
1586
|
+
message.marketId = reader.string();
|
|
1587
|
+
break;
|
|
1588
|
+
case /* uint64 active_trading_strategies */
|
|
1589
|
+
2:
|
|
1590
|
+
message.activeTradingStrategies = reader.uint64().toBigInt();
|
|
1591
|
+
break;
|
|
1592
|
+
default:
|
|
1593
|
+
let u = options.readUnknownField;
|
|
1594
|
+
if (u === "throw")
|
|
1595
|
+
throw new globalThis.Error(`Unknown field ${fieldNo} (wire type ${wireType}) for ${this.typeName}`);
|
|
1596
|
+
let d = reader.skip(wireType);
|
|
1597
|
+
if (u !== false)
|
|
1598
|
+
(u === true ? UnknownFieldHandler.onRead : u)(this.typeName, message, fieldNo, wireType, d);
|
|
1599
|
+
}
|
|
1600
|
+
}
|
|
1601
|
+
return message;
|
|
1602
|
+
}
|
|
1603
|
+
internalBinaryWrite(message, writer, options) {
|
|
1604
|
+
if (message.marketId !== "")
|
|
1605
|
+
writer.tag(1, WireType.LengthDelimited).string(message.marketId);
|
|
1606
|
+
if (message.activeTradingStrategies !== 0n)
|
|
1607
|
+
writer.tag(2, WireType.Varint).uint64(message.activeTradingStrategies);
|
|
1608
|
+
let u = options.writeUnknownFields;
|
|
1609
|
+
if (u !== false)
|
|
1610
|
+
(u == true ? UnknownFieldHandler.onWrite : u)(this.typeName, message, writer);
|
|
1611
|
+
return writer;
|
|
1612
|
+
}
|
|
1613
|
+
}
|
|
1614
|
+
const Market = new Market$Type();
|
|
1615
|
+
class StreamStrategyRequest$Type extends MessageType {
|
|
1616
|
+
constructor() {
|
|
1617
|
+
super("injective_trading_rpc.StreamStrategyRequest", [
|
|
1618
|
+
{
|
|
1619
|
+
no: 1,
|
|
1620
|
+
name: "account_addresses",
|
|
1621
|
+
kind: "scalar",
|
|
1622
|
+
repeat: 2,
|
|
1623
|
+
T: 9
|
|
1624
|
+
/*ScalarType.STRING*/
|
|
1625
|
+
},
|
|
1626
|
+
{
|
|
1627
|
+
no: 2,
|
|
1628
|
+
name: "market_id",
|
|
1629
|
+
kind: "scalar",
|
|
1630
|
+
T: 9
|
|
1631
|
+
/*ScalarType.STRING*/
|
|
1632
|
+
}
|
|
1633
|
+
]);
|
|
1634
|
+
}
|
|
1635
|
+
create(value) {
|
|
1636
|
+
const message = globalThis.Object.create(this.messagePrototype);
|
|
1637
|
+
message.accountAddresses = [];
|
|
1638
|
+
message.marketId = "";
|
|
1639
|
+
if (value !== void 0)
|
|
1640
|
+
reflectionMergePartial(this, message, value);
|
|
1641
|
+
return message;
|
|
1642
|
+
}
|
|
1643
|
+
internalBinaryRead(reader, length, options, target) {
|
|
1644
|
+
let message = target ?? this.create(), end = reader.pos + length;
|
|
1645
|
+
while (reader.pos < end) {
|
|
1646
|
+
let [fieldNo, wireType] = reader.tag();
|
|
1647
|
+
switch (fieldNo) {
|
|
1648
|
+
case /* repeated string account_addresses */
|
|
1649
|
+
1:
|
|
1650
|
+
message.accountAddresses.push(reader.string());
|
|
1651
|
+
break;
|
|
1652
|
+
case /* string market_id */
|
|
1653
|
+
2:
|
|
1654
|
+
message.marketId = reader.string();
|
|
1655
|
+
break;
|
|
1656
|
+
default:
|
|
1657
|
+
let u = options.readUnknownField;
|
|
1658
|
+
if (u === "throw")
|
|
1659
|
+
throw new globalThis.Error(`Unknown field ${fieldNo} (wire type ${wireType}) for ${this.typeName}`);
|
|
1660
|
+
let d = reader.skip(wireType);
|
|
1661
|
+
if (u !== false)
|
|
1662
|
+
(u === true ? UnknownFieldHandler.onRead : u)(this.typeName, message, fieldNo, wireType, d);
|
|
1663
|
+
}
|
|
1664
|
+
}
|
|
1665
|
+
return message;
|
|
1666
|
+
}
|
|
1667
|
+
internalBinaryWrite(message, writer, options) {
|
|
1668
|
+
for (let i = 0; i < message.accountAddresses.length; i++)
|
|
1669
|
+
writer.tag(1, WireType.LengthDelimited).string(message.accountAddresses[i]);
|
|
1670
|
+
if (message.marketId !== "")
|
|
1671
|
+
writer.tag(2, WireType.LengthDelimited).string(message.marketId);
|
|
1672
|
+
let u = options.writeUnknownFields;
|
|
1673
|
+
if (u !== false)
|
|
1674
|
+
(u == true ? UnknownFieldHandler.onWrite : u)(this.typeName, message, writer);
|
|
1675
|
+
return writer;
|
|
1676
|
+
}
|
|
1677
|
+
}
|
|
1678
|
+
const StreamStrategyRequest = new StreamStrategyRequest$Type();
|
|
1679
|
+
class StreamStrategyResponse$Type extends MessageType {
|
|
1680
|
+
constructor() {
|
|
1681
|
+
super("injective_trading_rpc.StreamStrategyResponse", [
|
|
1682
|
+
{ no: 1, name: "trading_strategy", kind: "message", T: () => TradingStrategy },
|
|
1683
|
+
{
|
|
1684
|
+
no: 2,
|
|
1685
|
+
name: "timestamp",
|
|
1686
|
+
kind: "scalar",
|
|
1687
|
+
T: 18,
|
|
1688
|
+
L: 0
|
|
1689
|
+
/*LongType.BIGINT*/
|
|
1690
|
+
}
|
|
1691
|
+
]);
|
|
1692
|
+
}
|
|
1693
|
+
create(value) {
|
|
1694
|
+
const message = globalThis.Object.create(this.messagePrototype);
|
|
1695
|
+
message.timestamp = 0n;
|
|
1696
|
+
if (value !== void 0)
|
|
1697
|
+
reflectionMergePartial(this, message, value);
|
|
1698
|
+
return message;
|
|
1699
|
+
}
|
|
1700
|
+
internalBinaryRead(reader, length, options, target) {
|
|
1701
|
+
let message = target ?? this.create(), end = reader.pos + length;
|
|
1702
|
+
while (reader.pos < end) {
|
|
1703
|
+
let [fieldNo, wireType] = reader.tag();
|
|
1704
|
+
switch (fieldNo) {
|
|
1705
|
+
case /* injective_trading_rpc.TradingStrategy trading_strategy */
|
|
1706
|
+
1:
|
|
1707
|
+
message.tradingStrategy = TradingStrategy.internalBinaryRead(reader, reader.uint32(), options, message.tradingStrategy);
|
|
1708
|
+
break;
|
|
1709
|
+
case /* sint64 timestamp */
|
|
1710
|
+
2:
|
|
1711
|
+
message.timestamp = reader.sint64().toBigInt();
|
|
1712
|
+
break;
|
|
1713
|
+
default:
|
|
1714
|
+
let u = options.readUnknownField;
|
|
1715
|
+
if (u === "throw")
|
|
1716
|
+
throw new globalThis.Error(`Unknown field ${fieldNo} (wire type ${wireType}) for ${this.typeName}`);
|
|
1717
|
+
let d = reader.skip(wireType);
|
|
1718
|
+
if (u !== false)
|
|
1719
|
+
(u === true ? UnknownFieldHandler.onRead : u)(this.typeName, message, fieldNo, wireType, d);
|
|
1720
|
+
}
|
|
1721
|
+
}
|
|
1722
|
+
return message;
|
|
1723
|
+
}
|
|
1724
|
+
internalBinaryWrite(message, writer, options) {
|
|
1725
|
+
if (message.tradingStrategy)
|
|
1726
|
+
TradingStrategy.internalBinaryWrite(message.tradingStrategy, writer.tag(1, WireType.LengthDelimited).fork(), options).join();
|
|
1727
|
+
if (message.timestamp !== 0n)
|
|
1728
|
+
writer.tag(2, WireType.Varint).sint64(message.timestamp);
|
|
1729
|
+
let u = options.writeUnknownFields;
|
|
1730
|
+
if (u !== false)
|
|
1731
|
+
(u == true ? UnknownFieldHandler.onWrite : u)(this.typeName, message, writer);
|
|
1732
|
+
return writer;
|
|
1733
|
+
}
|
|
1734
|
+
}
|
|
1735
|
+
const StreamStrategyResponse = new StreamStrategyResponse$Type();
|
|
1736
|
+
const InjectiveTradingRPC = new ServiceType("injective_trading_rpc.InjectiveTradingRPC", [
|
|
1737
|
+
{ name: "ListTradingStrategies", options: {}, I: ListTradingStrategiesRequest, O: ListTradingStrategiesResponse },
|
|
1738
|
+
{ name: "GetTradingStats", options: {}, I: GetTradingStatsRequest, O: GetTradingStatsResponse },
|
|
1739
|
+
{ name: "StreamStrategy", serverStreaming: true, options: {}, I: StreamStrategyRequest, O: StreamStrategyResponse }
|
|
1740
|
+
]);
|
|
1741
|
+
export {
|
|
1742
|
+
ExitConfig,
|
|
1743
|
+
GetTradingStatsRequest,
|
|
1744
|
+
GetTradingStatsResponse,
|
|
1745
|
+
InjectiveTradingRPC,
|
|
1746
|
+
ListTradingStrategiesRequest,
|
|
1747
|
+
ListTradingStrategiesResponse,
|
|
1748
|
+
Market,
|
|
1749
|
+
Paging,
|
|
1750
|
+
StrategyFinalData,
|
|
1751
|
+
StreamStrategyRequest,
|
|
1752
|
+
StreamStrategyResponse,
|
|
1753
|
+
TradingStrategy
|
|
1754
|
+
};
|