@zoguxprotocol/proto 0.1.7 → 0.1.9

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.
@@ -1,11 +1,14 @@
1
1
  import { Rpc } from "../../helpers";
2
2
  import * as _m0 from "protobufjs/minimal";
3
- import { MsgUpdateSpotFeeTiers, MsgUpdateSpotFeeTiersResponse } from "./tx";
3
+ import { MsgUpdateSpotFeeTiers, MsgUpdateSpotFeeTiersResponse, MsgCreateSpotMarket, MsgCreateSpotMarketResponse } from "./tx";
4
4
  /** Msg defines the Msg service. */
5
5
 
6
6
  export interface Msg {
7
7
  /** UpdateSpotFeeTiers updates the SpotFeeTiers in state. */
8
8
  updateSpotFeeTiers(request: MsgUpdateSpotFeeTiers): Promise<MsgUpdateSpotFeeTiersResponse>;
9
+ /** CreateSpotMarket creates a new spot market via governance. */
10
+
11
+ createSpotMarket(request: MsgCreateSpotMarket): Promise<MsgCreateSpotMarketResponse>;
9
12
  }
10
13
  export class MsgClientImpl implements Msg {
11
14
  private readonly rpc: Rpc;
@@ -13,6 +16,7 @@ export class MsgClientImpl implements Msg {
13
16
  constructor(rpc: Rpc) {
14
17
  this.rpc = rpc;
15
18
  this.updateSpotFeeTiers = this.updateSpotFeeTiers.bind(this);
19
+ this.createSpotMarket = this.createSpotMarket.bind(this);
16
20
  }
17
21
 
18
22
  updateSpotFeeTiers(request: MsgUpdateSpotFeeTiers): Promise<MsgUpdateSpotFeeTiersResponse> {
@@ -21,4 +25,10 @@ export class MsgClientImpl implements Msg {
21
25
  return promise.then(data => MsgUpdateSpotFeeTiersResponse.decode(new _m0.Reader(data)));
22
26
  }
23
27
 
28
+ createSpotMarket(request: MsgCreateSpotMarket): Promise<MsgCreateSpotMarketResponse> {
29
+ const data = MsgCreateSpotMarket.encode(request).finish();
30
+ const promise = this.rpc.request("zogux.spots.Msg", "CreateSpotMarket", data);
31
+ return promise.then(data => MsgCreateSpotMarketResponse.decode(new _m0.Reader(data)));
32
+ }
33
+
24
34
  }
@@ -1,4 +1,5 @@
1
1
  import { SpotFeeTier, SpotFeeTierSDKType } from "./fee_tier";
2
+ import { SpotMarketParams, SpotMarketParamsSDKType } from "./market";
2
3
  import * as _m0 from "protobufjs/minimal";
3
4
  import { DeepPartial } from "../../helpers";
4
5
  /** MsgUpdateSpotFeeTiers is the Msg/UpdateSpotFeeTiers request type. */
@@ -27,6 +28,26 @@ export interface MsgUpdateSpotFeeTiersResponse {}
27
28
  */
28
29
 
29
30
  export interface MsgUpdateSpotFeeTiersResponseSDKType {}
31
+ /** MsgCreateSpotMarket is a message used by x/gov to create a new spot market. */
32
+
33
+ export interface MsgCreateSpotMarket {
34
+ authority: string;
35
+ /** Parameters for the new spot market. */
36
+
37
+ params?: SpotMarketParams;
38
+ }
39
+ /** MsgCreateSpotMarket is a message used by x/gov to create a new spot market. */
40
+
41
+ export interface MsgCreateSpotMarketSDKType {
42
+ authority: string;
43
+ params?: SpotMarketParamsSDKType;
44
+ }
45
+ /** MsgCreateSpotMarketResponse defines the CreateSpotMarket response type. */
46
+
47
+ export interface MsgCreateSpotMarketResponse {}
48
+ /** MsgCreateSpotMarketResponse defines the CreateSpotMarket response type. */
49
+
50
+ export interface MsgCreateSpotMarketResponseSDKType {}
30
51
 
31
52
  function createBaseMsgUpdateSpotFeeTiers(): MsgUpdateSpotFeeTiers {
32
53
  return {
@@ -115,4 +136,93 @@ export const MsgUpdateSpotFeeTiersResponse = {
115
136
  return message;
116
137
  }
117
138
 
139
+ };
140
+
141
+ function createBaseMsgCreateSpotMarket(): MsgCreateSpotMarket {
142
+ return {
143
+ authority: "",
144
+ params: undefined
145
+ };
146
+ }
147
+
148
+ export const MsgCreateSpotMarket = {
149
+ encode(message: MsgCreateSpotMarket, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer {
150
+ if (message.authority !== "") {
151
+ writer.uint32(10).string(message.authority);
152
+ }
153
+
154
+ if (message.params !== undefined) {
155
+ SpotMarketParams.encode(message.params, writer.uint32(18).fork()).ldelim();
156
+ }
157
+
158
+ return writer;
159
+ },
160
+
161
+ decode(input: _m0.Reader | Uint8Array, length?: number): MsgCreateSpotMarket {
162
+ const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input);
163
+ let end = length === undefined ? reader.len : reader.pos + length;
164
+ const message = createBaseMsgCreateSpotMarket();
165
+
166
+ while (reader.pos < end) {
167
+ const tag = reader.uint32();
168
+
169
+ switch (tag >>> 3) {
170
+ case 1:
171
+ message.authority = reader.string();
172
+ break;
173
+
174
+ case 2:
175
+ message.params = SpotMarketParams.decode(reader, reader.uint32());
176
+ break;
177
+
178
+ default:
179
+ reader.skipType(tag & 7);
180
+ break;
181
+ }
182
+ }
183
+
184
+ return message;
185
+ },
186
+
187
+ fromPartial(object: DeepPartial<MsgCreateSpotMarket>): MsgCreateSpotMarket {
188
+ const message = createBaseMsgCreateSpotMarket();
189
+ message.authority = object.authority ?? "";
190
+ message.params = object.params !== undefined && object.params !== null ? SpotMarketParams.fromPartial(object.params) : undefined;
191
+ return message;
192
+ }
193
+
194
+ };
195
+
196
+ function createBaseMsgCreateSpotMarketResponse(): MsgCreateSpotMarketResponse {
197
+ return {};
198
+ }
199
+
200
+ export const MsgCreateSpotMarketResponse = {
201
+ encode(_: MsgCreateSpotMarketResponse, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer {
202
+ return writer;
203
+ },
204
+
205
+ decode(input: _m0.Reader | Uint8Array, length?: number): MsgCreateSpotMarketResponse {
206
+ const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input);
207
+ let end = length === undefined ? reader.len : reader.pos + length;
208
+ const message = createBaseMsgCreateSpotMarketResponse();
209
+
210
+ while (reader.pos < end) {
211
+ const tag = reader.uint32();
212
+
213
+ switch (tag >>> 3) {
214
+ default:
215
+ reader.skipType(tag & 7);
216
+ break;
217
+ }
218
+ }
219
+
220
+ return message;
221
+ },
222
+
223
+ fromPartial(_: DeepPartial<MsgCreateSpotMarketResponse>): MsgCreateSpotMarketResponse {
224
+ const message = createBaseMsgCreateSpotMarketResponse();
225
+ return message;
226
+ }
227
+
118
228
  };
@@ -33,6 +33,9 @@ export interface BlockStats_Fill {
33
33
  */
34
34
 
35
35
  affiliateFeeGeneratedQuantums: Long;
36
+ /** Whether this is a perpetual fill or not. */
37
+
38
+ isPerpetual: boolean;
36
39
  }
37
40
  /** Fill records data about a fill on this block. */
38
41
 
@@ -41,6 +44,7 @@ export interface BlockStats_FillSDKType {
41
44
  maker: string;
42
45
  notional: Long;
43
46
  affiliate_fee_generated_quantums: Long;
47
+ is_perpetual: boolean;
44
48
  }
45
49
  /** StatsMetadata stores metadata for the x/stats module */
46
50
 
@@ -86,13 +90,21 @@ export interface EpochStats_UserWithStatsSDKType {
86
90
  /** GlobalStats stores global stats for the rolling window (default 30d). */
87
91
 
88
92
  export interface GlobalStats {
89
- /** Notional USDC traded in quantums */
93
+ /** Notional USDC traded in quantums (Aggregate) */
90
94
  notionalTraded: Long;
95
+ /** Notional USDC traded in quantums (Perpetual only) */
96
+
97
+ perpetualNotionalTraded: Long;
98
+ /** Notional USDC traded in quantums (Spot only) */
99
+
100
+ spotNotionalTraded: Long;
91
101
  }
92
102
  /** GlobalStats stores global stats for the rolling window (default 30d). */
93
103
 
94
104
  export interface GlobalStatsSDKType {
95
105
  notional_traded: Long;
106
+ perpetual_notional_traded: Long;
107
+ spot_notional_traded: Long;
96
108
  }
97
109
  /**
98
110
  * UserStats stores stats for a User. This is the sum of all stats for a user in
@@ -100,11 +112,23 @@ export interface GlobalStatsSDKType {
100
112
  */
101
113
 
102
114
  export interface UserStats {
103
- /** Taker USDC in quantums */
115
+ /** Taker USDC in quantums (Aggregate) */
104
116
  takerNotional: Long;
105
- /** Maker USDC in quantums */
117
+ /** Maker USDC in quantums (Aggregate) */
106
118
 
107
119
  makerNotional: Long;
120
+ /** Taker USDC in quantums (Perpetual only) */
121
+
122
+ takerPerpetualNotional: Long;
123
+ /** Maker USDC in quantums (Perpetual only) */
124
+
125
+ makerPerpetualNotional: Long;
126
+ /** Taker USDC in quantums (Spot only) */
127
+
128
+ takerSpotNotional: Long;
129
+ /** Maker USDC in quantums (Spot only) */
130
+
131
+ makerSpotNotional: Long;
108
132
  /** Affiliate revenue generated in quantums with this user being a referee */
109
133
 
110
134
  affiliate_30dRevenueGeneratedQuantums: Long;
@@ -120,6 +144,10 @@ export interface UserStats {
120
144
  export interface UserStatsSDKType {
121
145
  taker_notional: Long;
122
146
  maker_notional: Long;
147
+ taker_perpetual_notional: Long;
148
+ maker_perpetual_notional: Long;
149
+ taker_spot_notional: Long;
150
+ maker_spot_notional: Long;
123
151
  affiliate_30d_revenue_generated_quantums: Long;
124
152
  affiliate_30d_referred_volume_quote_quantums: Long;
125
153
  }
@@ -192,7 +220,8 @@ function createBaseBlockStats_Fill(): BlockStats_Fill {
192
220
  taker: "",
193
221
  maker: "",
194
222
  notional: Long.UZERO,
195
- affiliateFeeGeneratedQuantums: Long.UZERO
223
+ affiliateFeeGeneratedQuantums: Long.UZERO,
224
+ isPerpetual: false
196
225
  };
197
226
  }
198
227
 
@@ -214,6 +243,10 @@ export const BlockStats_Fill = {
214
243
  writer.uint32(32).uint64(message.affiliateFeeGeneratedQuantums);
215
244
  }
216
245
 
246
+ if (message.isPerpetual === true) {
247
+ writer.uint32(40).bool(message.isPerpetual);
248
+ }
249
+
217
250
  return writer;
218
251
  },
219
252
 
@@ -242,6 +275,10 @@ export const BlockStats_Fill = {
242
275
  message.affiliateFeeGeneratedQuantums = (reader.uint64() as Long);
243
276
  break;
244
277
 
278
+ case 5:
279
+ message.isPerpetual = reader.bool();
280
+ break;
281
+
245
282
  default:
246
283
  reader.skipType(tag & 7);
247
284
  break;
@@ -257,6 +294,7 @@ export const BlockStats_Fill = {
257
294
  message.maker = object.maker ?? "";
258
295
  message.notional = object.notional !== undefined && object.notional !== null ? Long.fromValue(object.notional) : Long.UZERO;
259
296
  message.affiliateFeeGeneratedQuantums = object.affiliateFeeGeneratedQuantums !== undefined && object.affiliateFeeGeneratedQuantums !== null ? Long.fromValue(object.affiliateFeeGeneratedQuantums) : Long.UZERO;
297
+ message.isPerpetual = object.isPerpetual ?? false;
260
298
  return message;
261
299
  }
262
300
 
@@ -419,7 +457,9 @@ export const EpochStats_UserWithStats = {
419
457
 
420
458
  function createBaseGlobalStats(): GlobalStats {
421
459
  return {
422
- notionalTraded: Long.UZERO
460
+ notionalTraded: Long.UZERO,
461
+ perpetualNotionalTraded: Long.UZERO,
462
+ spotNotionalTraded: Long.UZERO
423
463
  };
424
464
  }
425
465
 
@@ -429,6 +469,14 @@ export const GlobalStats = {
429
469
  writer.uint32(8).uint64(message.notionalTraded);
430
470
  }
431
471
 
472
+ if (!message.perpetualNotionalTraded.isZero()) {
473
+ writer.uint32(16).uint64(message.perpetualNotionalTraded);
474
+ }
475
+
476
+ if (!message.spotNotionalTraded.isZero()) {
477
+ writer.uint32(24).uint64(message.spotNotionalTraded);
478
+ }
479
+
432
480
  return writer;
433
481
  },
434
482
 
@@ -445,6 +493,14 @@ export const GlobalStats = {
445
493
  message.notionalTraded = (reader.uint64() as Long);
446
494
  break;
447
495
 
496
+ case 2:
497
+ message.perpetualNotionalTraded = (reader.uint64() as Long);
498
+ break;
499
+
500
+ case 3:
501
+ message.spotNotionalTraded = (reader.uint64() as Long);
502
+ break;
503
+
448
504
  default:
449
505
  reader.skipType(tag & 7);
450
506
  break;
@@ -457,6 +513,8 @@ export const GlobalStats = {
457
513
  fromPartial(object: DeepPartial<GlobalStats>): GlobalStats {
458
514
  const message = createBaseGlobalStats();
459
515
  message.notionalTraded = object.notionalTraded !== undefined && object.notionalTraded !== null ? Long.fromValue(object.notionalTraded) : Long.UZERO;
516
+ message.perpetualNotionalTraded = object.perpetualNotionalTraded !== undefined && object.perpetualNotionalTraded !== null ? Long.fromValue(object.perpetualNotionalTraded) : Long.UZERO;
517
+ message.spotNotionalTraded = object.spotNotionalTraded !== undefined && object.spotNotionalTraded !== null ? Long.fromValue(object.spotNotionalTraded) : Long.UZERO;
460
518
  return message;
461
519
  }
462
520
 
@@ -466,6 +524,10 @@ function createBaseUserStats(): UserStats {
466
524
  return {
467
525
  takerNotional: Long.UZERO,
468
526
  makerNotional: Long.UZERO,
527
+ takerPerpetualNotional: Long.UZERO,
528
+ makerPerpetualNotional: Long.UZERO,
529
+ takerSpotNotional: Long.UZERO,
530
+ makerSpotNotional: Long.UZERO,
469
531
  affiliate_30dRevenueGeneratedQuantums: Long.UZERO,
470
532
  affiliate_30dReferredVolumeQuoteQuantums: Long.UZERO
471
533
  };
@@ -481,6 +543,22 @@ export const UserStats = {
481
543
  writer.uint32(16).uint64(message.makerNotional);
482
544
  }
483
545
 
546
+ if (!message.takerPerpetualNotional.isZero()) {
547
+ writer.uint32(40).uint64(message.takerPerpetualNotional);
548
+ }
549
+
550
+ if (!message.makerPerpetualNotional.isZero()) {
551
+ writer.uint32(48).uint64(message.makerPerpetualNotional);
552
+ }
553
+
554
+ if (!message.takerSpotNotional.isZero()) {
555
+ writer.uint32(56).uint64(message.takerSpotNotional);
556
+ }
557
+
558
+ if (!message.makerSpotNotional.isZero()) {
559
+ writer.uint32(64).uint64(message.makerSpotNotional);
560
+ }
561
+
484
562
  if (!message.affiliate_30dRevenueGeneratedQuantums.isZero()) {
485
563
  writer.uint32(24).uint64(message.affiliate_30dRevenueGeneratedQuantums);
486
564
  }
@@ -509,6 +587,22 @@ export const UserStats = {
509
587
  message.makerNotional = (reader.uint64() as Long);
510
588
  break;
511
589
 
590
+ case 5:
591
+ message.takerPerpetualNotional = (reader.uint64() as Long);
592
+ break;
593
+
594
+ case 6:
595
+ message.makerPerpetualNotional = (reader.uint64() as Long);
596
+ break;
597
+
598
+ case 7:
599
+ message.takerSpotNotional = (reader.uint64() as Long);
600
+ break;
601
+
602
+ case 8:
603
+ message.makerSpotNotional = (reader.uint64() as Long);
604
+ break;
605
+
512
606
  case 3:
513
607
  message.affiliate_30dRevenueGeneratedQuantums = (reader.uint64() as Long);
514
608
  break;
@@ -530,6 +624,10 @@ export const UserStats = {
530
624
  const message = createBaseUserStats();
531
625
  message.takerNotional = object.takerNotional !== undefined && object.takerNotional !== null ? Long.fromValue(object.takerNotional) : Long.UZERO;
532
626
  message.makerNotional = object.makerNotional !== undefined && object.makerNotional !== null ? Long.fromValue(object.makerNotional) : Long.UZERO;
627
+ message.takerPerpetualNotional = object.takerPerpetualNotional !== undefined && object.takerPerpetualNotional !== null ? Long.fromValue(object.takerPerpetualNotional) : Long.UZERO;
628
+ message.makerPerpetualNotional = object.makerPerpetualNotional !== undefined && object.makerPerpetualNotional !== null ? Long.fromValue(object.makerPerpetualNotional) : Long.UZERO;
629
+ message.takerSpotNotional = object.takerSpotNotional !== undefined && object.takerSpotNotional !== null ? Long.fromValue(object.takerSpotNotional) : Long.UZERO;
630
+ message.makerSpotNotional = object.makerSpotNotional !== undefined && object.makerSpotNotional !== null ? Long.fromValue(object.makerSpotNotional) : Long.UZERO;
533
631
  message.affiliate_30dRevenueGeneratedQuantums = object.affiliate_30dRevenueGeneratedQuantums !== undefined && object.affiliate_30dRevenueGeneratedQuantums !== null ? Long.fromValue(object.affiliate_30dRevenueGeneratedQuantums) : Long.UZERO;
534
632
  message.affiliate_30dReferredVolumeQuoteQuantums = object.affiliate_30dReferredVolumeQuoteQuantums !== undefined && object.affiliate_30dReferredVolumeQuoteQuantums !== null ? Long.fromValue(object.affiliate_30dReferredVolumeQuoteQuantums) : Long.UZERO;
535
633
  return message;
@@ -1,8 +1,9 @@
1
1
  import * as _m0 from "protobufjs/minimal";
2
2
  import { DeepPartial } from "../../helpers";
3
3
  /**
4
- * SpotAssetLocked tracks locked funds for pending spot orders for a specific asset.
5
- * This is used to ensure users have sufficient balance when placing limit orders.
4
+ * SpotAssetLocked tracks locked funds for pending spot orders for a specific
5
+ * asset. This is used to ensure users have sufficient balance when placing
6
+ * limit orders.
6
7
  */
7
8
 
8
9
  export interface SpotAssetLocked {
@@ -17,8 +18,9 @@ export interface SpotAssetLocked {
17
18
  quantumsLocked: Uint8Array;
18
19
  }
19
20
  /**
20
- * SpotAssetLocked tracks locked funds for pending spot orders for a specific asset.
21
- * This is used to ensure users have sufficient balance when placing limit orders.
21
+ * SpotAssetLocked tracks locked funds for pending spot orders for a specific
22
+ * asset. This is used to ensure users have sufficient balance when placing
23
+ * limit orders.
22
24
  */
23
25
 
24
26
  export interface SpotAssetLockedSDKType {
@@ -5,8 +5,9 @@ import { MsgRecoverySpotBalance, MsgRecoverySpotBalanceResponse } from "./tx";
5
5
 
6
6
  export interface Msg {
7
7
  /**
8
- * RecoverySpotBalance is an admin function to recover spot balance discrepancies.
9
- * This should only be called by authorized admin/governance addresses.
8
+ * RecoverySpotBalance is an admin function to recover spot balance
9
+ * discrepancies. This should only be called by authorized admin/governance
10
+ * addresses.
10
11
  */
11
12
  recoverySpotBalance(request: MsgRecoverySpotBalance): Promise<MsgRecoverySpotBalanceResponse>;
12
13
  }
@@ -1,10 +1,16 @@
1
1
  import { SubaccountId, SubaccountIdSDKType } from "./subaccount";
2
2
  import * as _m0 from "protobufjs/minimal";
3
3
  import { DeepPartial } from "../../helpers";
4
- /** MsgRecoverySpotBalance is the request type for recovering spot balance discrepancies. */
4
+ /**
5
+ * MsgRecoverySpotBalance is the request type for recovering spot balance
6
+ * discrepancies.
7
+ */
5
8
 
6
9
  export interface MsgRecoverySpotBalance {
7
- /** Authority is the address authorized to execute this message (typically governance). */
10
+ /**
11
+ * Authority is the address authorized to execute this message (typically
12
+ * governance).
13
+ */
8
14
  authority: string;
9
15
  /** SubaccountId identifies the subaccount to recover. */
10
16
 
@@ -13,13 +19,16 @@ export interface MsgRecoverySpotBalance {
13
19
 
14
20
  assetId: number;
15
21
  /**
16
- * DeltaAmount is the amount to add (positive) or subtract (negative) to recover the balance.
17
- * This is a string representation of a big.Int.
22
+ * DeltaAmount is the amount to add (positive) or subtract (negative) to
23
+ * recover the balance. This is a string representation of a big.Int.
18
24
  */
19
25
 
20
26
  deltaAmount: string;
21
27
  }
22
- /** MsgRecoverySpotBalance is the request type for recovering spot balance discrepancies. */
28
+ /**
29
+ * MsgRecoverySpotBalance is the request type for recovering spot balance
30
+ * discrepancies.
31
+ */
23
32
 
24
33
  export interface MsgRecoverySpotBalanceSDKType {
25
34
  authority: string;
@@ -27,10 +36,16 @@ export interface MsgRecoverySpotBalanceSDKType {
27
36
  asset_id: number;
28
37
  delta_amount: string;
29
38
  }
30
- /** MsgRecoverySpotBalanceResponse is the response type for MsgRecoverySpotBalance. */
39
+ /**
40
+ * MsgRecoverySpotBalanceResponse is the response type for
41
+ * MsgRecoverySpotBalance.
42
+ */
31
43
 
32
44
  export interface MsgRecoverySpotBalanceResponse {}
33
- /** MsgRecoverySpotBalanceResponse is the response type for MsgRecoverySpotBalance. */
45
+ /**
46
+ * MsgRecoverySpotBalanceResponse is the response type for
47
+ * MsgRecoverySpotBalance.
48
+ */
34
49
 
35
50
  export interface MsgRecoverySpotBalanceResponseSDKType {}
36
51