carbon-js-sdk 0.8.8 → 0.8.9-beta.2

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.
Files changed (184) hide show
  1. package/lib/codec/Switcheo/carbon/book/book.d.ts +2 -2
  2. package/lib/codec/Switcheo/carbon/book/book.js +18 -18
  3. package/lib/codec/Switcheo/carbon/book/event.d.ts +2 -2
  4. package/lib/codec/Switcheo/carbon/book/event.js +18 -18
  5. package/lib/codec/Switcheo/carbon/book/legacy.d.ts +1 -1
  6. package/lib/codec/Switcheo/carbon/book/legacy.js +9 -9
  7. package/lib/codec/Switcheo/carbon/book/query.d.ts +3 -3
  8. package/lib/codec/Switcheo/carbon/book/query.js +27 -27
  9. package/lib/codec/Switcheo/carbon/broker/amm.d.ts +5 -3
  10. package/lib/codec/Switcheo/carbon/broker/amm.js +74 -31
  11. package/lib/codec/Switcheo/carbon/broker/candlestick.d.ts +1 -1
  12. package/lib/codec/Switcheo/carbon/broker/candlestick.js +9 -9
  13. package/lib/codec/Switcheo/carbon/broker/event.d.ts +1 -1
  14. package/lib/codec/Switcheo/carbon/broker/event.js +9 -9
  15. package/lib/codec/Switcheo/carbon/broker/query.d.ts +3 -3
  16. package/lib/codec/Switcheo/carbon/broker/query.js +27 -27
  17. package/lib/codec/Switcheo/carbon/broker/tx.d.ts +1 -1
  18. package/lib/codec/Switcheo/carbon/broker/tx.js +9 -9
  19. package/lib/codec/Switcheo/carbon/ccm/export.d.ts +2 -2
  20. package/lib/codec/Switcheo/carbon/ccm/export.js +6 -3
  21. package/lib/codec/Switcheo/carbon/ccm/genesis.d.ts +1 -1
  22. package/lib/codec/Switcheo/carbon/ccm/genesis.js +6 -6
  23. package/lib/codec/Switcheo/carbon/ccm/params.d.ts +30 -0
  24. package/lib/codec/Switcheo/carbon/ccm/params.js +107 -0
  25. package/lib/codec/Switcheo/carbon/ccm/query.d.ts +32 -2
  26. package/lib/codec/Switcheo/carbon/ccm/query.js +88 -1
  27. package/lib/codec/Switcheo/carbon/ccm/tx.d.ts +3 -7
  28. package/lib/codec/Switcheo/carbon/ccm/tx.js +8 -6
  29. package/lib/codec/Switcheo/carbon/cdp/export.d.ts +1 -1
  30. package/lib/codec/Switcheo/carbon/cdp/export.js +5 -4
  31. package/lib/codec/Switcheo/carbon/cdp/params.d.ts +20 -0
  32. package/lib/codec/Switcheo/carbon/cdp/params.js +196 -1
  33. package/lib/codec/Switcheo/carbon/cdp/tx.d.ts +3 -7
  34. package/lib/codec/Switcheo/carbon/cdp/tx.js +7 -5
  35. package/lib/codec/Switcheo/carbon/coin/token.d.ts +2 -2
  36. package/lib/codec/Switcheo/carbon/coin/token.js +18 -18
  37. package/lib/codec/Switcheo/carbon/erc20/export.d.ts +1 -1
  38. package/lib/codec/Switcheo/carbon/erc20/export.js +4 -3
  39. package/lib/codec/Switcheo/carbon/erc20/genesis.d.ts +1 -17
  40. package/lib/codec/Switcheo/carbon/erc20/genesis.js +7 -65
  41. package/lib/codec/Switcheo/carbon/erc20/params.d.ts +37 -0
  42. package/lib/codec/Switcheo/carbon/erc20/params.js +133 -0
  43. package/lib/codec/Switcheo/carbon/erc20/query.d.ts +1 -1
  44. package/lib/codec/Switcheo/carbon/erc20/query.js +6 -6
  45. package/lib/codec/Switcheo/carbon/erc20/tx.d.ts +3 -6
  46. package/lib/codec/Switcheo/carbon/erc20/tx.js +8 -6
  47. package/lib/codec/Switcheo/carbon/evmcontract/export.d.ts +2 -2
  48. package/lib/codec/Switcheo/carbon/evmcontract/export.js +2 -3
  49. package/lib/codec/Switcheo/carbon/evmcontract/params.d.ts +10 -0
  50. package/lib/codec/Switcheo/carbon/evmcontract/params.js +50 -1
  51. package/lib/codec/Switcheo/carbon/evmcontract/tx.d.ts +3 -29
  52. package/lib/codec/Switcheo/carbon/evmcontract/tx.js +8 -106
  53. package/lib/codec/Switcheo/carbon/insurance/tx.d.ts +1 -1
  54. package/lib/codec/Switcheo/carbon/insurance/tx.js +9 -9
  55. package/lib/codec/Switcheo/carbon/leverage/event.d.ts +1 -1
  56. package/lib/codec/Switcheo/carbon/leverage/event.js +9 -9
  57. package/lib/codec/Switcheo/carbon/leverage/leverage.d.ts +1 -1
  58. package/lib/codec/Switcheo/carbon/leverage/leverage.js +9 -9
  59. package/lib/codec/Switcheo/carbon/leverage/query.d.ts +1 -1
  60. package/lib/codec/Switcheo/carbon/leverage/query.js +9 -9
  61. package/lib/codec/Switcheo/carbon/leverage/tx.d.ts +1 -1
  62. package/lib/codec/Switcheo/carbon/leverage/tx.js +9 -9
  63. package/lib/codec/Switcheo/carbon/liquidation/event.d.ts +23 -0
  64. package/lib/codec/Switcheo/carbon/liquidation/event.js +154 -0
  65. package/lib/codec/Switcheo/carbon/liquidation/export.d.ts +1 -0
  66. package/lib/codec/Switcheo/carbon/liquidation/export.js +3 -1
  67. package/lib/codec/Switcheo/carbon/liquidation/outstanding_position.d.ts +1 -1
  68. package/lib/codec/Switcheo/carbon/liquidation/outstanding_position.js +9 -9
  69. package/lib/codec/Switcheo/carbon/liquidation/query.d.ts +1 -1
  70. package/lib/codec/Switcheo/carbon/liquidation/query.js +9 -9
  71. package/lib/codec/Switcheo/carbon/liquiditypool/export.d.ts +2 -1
  72. package/lib/codec/Switcheo/carbon/liquiditypool/export.js +6 -4
  73. package/lib/codec/Switcheo/carbon/liquiditypool/genesis.d.ts +2 -1
  74. package/lib/codec/Switcheo/carbon/liquiditypool/genesis.js +7 -6
  75. package/lib/codec/Switcheo/carbon/liquiditypool/liquiditypool.d.ts +2 -13
  76. package/lib/codec/Switcheo/carbon/liquiditypool/liquiditypool.js +33 -85
  77. package/lib/codec/Switcheo/carbon/liquiditypool/params.d.ts +30 -0
  78. package/lib/codec/Switcheo/carbon/liquiditypool/params.js +149 -0
  79. package/lib/codec/Switcheo/carbon/liquiditypool/query.d.ts +2 -1
  80. package/lib/codec/Switcheo/carbon/liquiditypool/query.js +6 -5
  81. package/lib/codec/Switcheo/carbon/liquiditypool/tx.d.ts +4 -8
  82. package/lib/codec/Switcheo/carbon/liquiditypool/tx.js +35 -33
  83. package/lib/codec/Switcheo/carbon/market/event.d.ts +1 -1
  84. package/lib/codec/Switcheo/carbon/market/event.js +13 -11
  85. package/lib/codec/Switcheo/carbon/market/export.d.ts +3 -2
  86. package/lib/codec/Switcheo/carbon/market/export.js +9 -3
  87. package/lib/codec/Switcheo/carbon/market/genesis.d.ts +2 -1
  88. package/lib/codec/Switcheo/carbon/market/genesis.js +6 -5
  89. package/lib/codec/Switcheo/carbon/market/market.d.ts +1 -38
  90. package/lib/codec/Switcheo/carbon/market/market.js +9 -400
  91. package/lib/codec/Switcheo/carbon/market/params.d.ts +83 -0
  92. package/lib/codec/Switcheo/carbon/market/params.js +791 -0
  93. package/lib/codec/Switcheo/carbon/market/query.d.ts +3 -2
  94. package/lib/codec/Switcheo/carbon/market/query.js +19 -16
  95. package/lib/codec/Switcheo/carbon/market/tx.d.ts +51 -8
  96. package/lib/codec/Switcheo/carbon/market/tx.js +245 -6
  97. package/lib/codec/Switcheo/carbon/marketstats/marketstats.d.ts +1 -1
  98. package/lib/codec/Switcheo/carbon/marketstats/marketstats.js +9 -9
  99. package/lib/codec/Switcheo/carbon/misc/trade.d.ts +1 -1
  100. package/lib/codec/Switcheo/carbon/misc/trade.js +9 -9
  101. package/lib/codec/Switcheo/carbon/oracle/export.d.ts +2 -1
  102. package/lib/codec/Switcheo/carbon/oracle/export.js +5 -3
  103. package/lib/codec/Switcheo/carbon/oracle/genesis.d.ts +2 -1
  104. package/lib/codec/Switcheo/carbon/oracle/genesis.js +6 -5
  105. package/lib/codec/Switcheo/carbon/oracle/oracle.d.ts +0 -20
  106. package/lib/codec/Switcheo/carbon/oracle/oracle.js +1 -176
  107. package/lib/codec/Switcheo/carbon/oracle/params.d.ts +45 -0
  108. package/lib/codec/Switcheo/carbon/oracle/params.js +362 -0
  109. package/lib/codec/Switcheo/carbon/oracle/query.d.ts +2 -1
  110. package/lib/codec/Switcheo/carbon/oracle/query.js +6 -5
  111. package/lib/codec/Switcheo/carbon/oracle/tx.d.ts +3 -7
  112. package/lib/codec/Switcheo/carbon/oracle/tx.js +8 -6
  113. package/lib/codec/Switcheo/carbon/order/export.d.ts +2 -1
  114. package/lib/codec/Switcheo/carbon/order/export.js +4 -2
  115. package/lib/codec/Switcheo/carbon/order/genesis.d.ts +3 -2
  116. package/lib/codec/Switcheo/carbon/order/genesis.js +15 -14
  117. package/lib/codec/Switcheo/carbon/order/order.d.ts +2 -12
  118. package/lib/codec/Switcheo/carbon/order/order.js +29 -57
  119. package/lib/codec/Switcheo/carbon/order/params.d.ts +28 -0
  120. package/lib/codec/Switcheo/carbon/order/params.js +109 -0
  121. package/lib/codec/Switcheo/carbon/order/query.d.ts +4 -3
  122. package/lib/codec/Switcheo/carbon/order/query.js +24 -23
  123. package/lib/codec/Switcheo/carbon/order/tx.d.ts +5 -9
  124. package/lib/codec/Switcheo/carbon/order/tx.js +26 -24
  125. package/lib/codec/Switcheo/carbon/perpspool/event.d.ts +1 -1
  126. package/lib/codec/Switcheo/carbon/perpspool/event.js +9 -9
  127. package/lib/codec/Switcheo/carbon/perpspool/export.d.ts +2 -2
  128. package/lib/codec/Switcheo/carbon/perpspool/export.js +3 -4
  129. package/lib/codec/Switcheo/carbon/perpspool/market.d.ts +1 -1
  130. package/lib/codec/Switcheo/carbon/perpspool/market.js +9 -9
  131. package/lib/codec/Switcheo/carbon/perpspool/params.d.ts +16 -0
  132. package/lib/codec/Switcheo/carbon/perpspool/params.js +175 -1
  133. package/lib/codec/Switcheo/carbon/perpspool/tx.d.ts +3 -33
  134. package/lib/codec/Switcheo/carbon/perpspool/tx.js +8 -173
  135. package/lib/codec/Switcheo/carbon/position/evm_hooks.d.ts +1 -1
  136. package/lib/codec/Switcheo/carbon/position/evm_hooks.js +9 -9
  137. package/lib/codec/Switcheo/carbon/position/position.d.ts +2 -2
  138. package/lib/codec/Switcheo/carbon/position/position.js +18 -18
  139. package/lib/codec/Switcheo/carbon/position/query.d.ts +2 -2
  140. package/lib/codec/Switcheo/carbon/position/query.js +18 -18
  141. package/lib/codec/Switcheo/carbon/position/tx.d.ts +1 -1
  142. package/lib/codec/Switcheo/carbon/position/tx.js +9 -9
  143. package/lib/codec/Switcheo/carbon/pricing/export.d.ts +3 -2
  144. package/lib/codec/Switcheo/carbon/pricing/export.js +6 -2
  145. package/lib/codec/Switcheo/carbon/pricing/genesis.d.ts +2 -1
  146. package/lib/codec/Switcheo/carbon/pricing/genesis.js +6 -5
  147. package/lib/codec/Switcheo/carbon/pricing/params.d.ts +35 -0
  148. package/lib/codec/Switcheo/carbon/pricing/params.js +212 -0
  149. package/lib/codec/Switcheo/carbon/pricing/pricing.d.ts +1 -16
  150. package/lib/codec/Switcheo/carbon/pricing/pricing.js +10 -109
  151. package/lib/codec/Switcheo/carbon/pricing/proposal.d.ts +1 -1
  152. package/lib/codec/Switcheo/carbon/pricing/proposal.js +9 -9
  153. package/lib/codec/Switcheo/carbon/pricing/query.d.ts +3 -2
  154. package/lib/codec/Switcheo/carbon/pricing/query.js +15 -14
  155. package/lib/codec/Switcheo/carbon/pricing/tx.d.ts +27 -7
  156. package/lib/codec/Switcheo/carbon/pricing/tx.js +121 -7
  157. package/lib/codec/Switcheo/carbon/subaccount/export.d.ts +2 -1
  158. package/lib/codec/Switcheo/carbon/subaccount/export.js +4 -2
  159. package/lib/codec/Switcheo/carbon/subaccount/genesis.d.ts +2 -1
  160. package/lib/codec/Switcheo/carbon/subaccount/genesis.js +6 -5
  161. package/lib/codec/Switcheo/carbon/subaccount/params.d.ts +29 -0
  162. package/lib/codec/Switcheo/carbon/subaccount/params.js +119 -0
  163. package/lib/codec/Switcheo/carbon/subaccount/query.d.ts +2 -1
  164. package/lib/codec/Switcheo/carbon/subaccount/query.js +6 -5
  165. package/lib/codec/Switcheo/carbon/subaccount/subaccount.d.ts +0 -11
  166. package/lib/codec/Switcheo/carbon/subaccount/subaccount.js +1 -54
  167. package/lib/codec/Switcheo/carbon/subaccount/tx.d.ts +3 -7
  168. package/lib/codec/Switcheo/carbon/subaccount/tx.js +8 -6
  169. package/lib/codec/index.d.ts +6 -4
  170. package/lib/codec/index.js +563 -223
  171. package/lib/modules/admin.d.ts +1 -1
  172. package/lib/modules/admin.js +1 -1
  173. package/lib/modules/leverage.d.ts +1 -1
  174. package/lib/modules/leverage.js +2 -2
  175. package/lib/modules/order.d.ts +3 -3
  176. package/lib/modules/order.js +4 -4
  177. package/lib/modules/position.d.ts +1 -1
  178. package/lib/modules/position.js +2 -2
  179. package/lib/util/eip712.js +1 -0
  180. package/lib/util/tx.d.ts +6 -4
  181. package/lib/websocket/channel.js +24 -24
  182. package/lib/websocket/models.d.ts +6 -6
  183. package/lib/websocket/types.d.ts +17 -17
  184. package/package.json +1 -1
@@ -7,12 +7,12 @@ export interface OrderBookLevel {
7
7
  orders: string[];
8
8
  }
9
9
  export interface OrderBook {
10
- market: string;
10
+ marketId: string;
11
11
  asks: OrderBookLevel[];
12
12
  bids: OrderBookLevel[];
13
13
  }
14
14
  export interface StopBook {
15
- market: string;
15
+ marketId: string;
16
16
  asks: StopOrder[];
17
17
  bids: StopOrder[];
18
18
  trigger: string;
@@ -82,11 +82,11 @@ exports.OrderBookLevel = {
82
82
  return message;
83
83
  },
84
84
  };
85
- const baseOrderBook = { market: "" };
85
+ const baseOrderBook = { marketId: "" };
86
86
  exports.OrderBook = {
87
87
  encode(message, writer = minimal_1.default.Writer.create()) {
88
- if (message.market !== "") {
89
- writer.uint32(10).string(message.market);
88
+ if (message.marketId !== "") {
89
+ writer.uint32(10).string(message.marketId);
90
90
  }
91
91
  for (const v of message.asks) {
92
92
  exports.OrderBookLevel.encode(v, writer.uint32(18).fork()).ldelim();
@@ -106,7 +106,7 @@ exports.OrderBook = {
106
106
  const tag = reader.uint32();
107
107
  switch (tag >>> 3) {
108
108
  case 1:
109
- message.market = reader.string();
109
+ message.marketId = reader.string();
110
110
  break;
111
111
  case 2:
112
112
  message.asks.push(exports.OrderBookLevel.decode(reader, reader.uint32()));
@@ -124,9 +124,9 @@ exports.OrderBook = {
124
124
  fromJSON(object) {
125
125
  var _a, _b;
126
126
  const message = Object.assign({}, baseOrderBook);
127
- message.market =
128
- object.market !== undefined && object.market !== null
129
- ? String(object.market)
127
+ message.marketId =
128
+ object.marketId !== undefined && object.marketId !== null
129
+ ? String(object.marketId)
130
130
  : "";
131
131
  message.asks = ((_a = object.asks) !== null && _a !== void 0 ? _a : []).map((e) => exports.OrderBookLevel.fromJSON(e));
132
132
  message.bids = ((_b = object.bids) !== null && _b !== void 0 ? _b : []).map((e) => exports.OrderBookLevel.fromJSON(e));
@@ -134,7 +134,7 @@ exports.OrderBook = {
134
134
  },
135
135
  toJSON(message) {
136
136
  const obj = {};
137
- message.market !== undefined && (obj.market = message.market);
137
+ message.marketId !== undefined && (obj.marketId = message.marketId);
138
138
  if (message.asks) {
139
139
  obj.asks = message.asks.map((e) => e ? exports.OrderBookLevel.toJSON(e) : undefined);
140
140
  }
@@ -152,17 +152,17 @@ exports.OrderBook = {
152
152
  fromPartial(object) {
153
153
  var _a, _b, _c;
154
154
  const message = Object.assign({}, baseOrderBook);
155
- message.market = (_a = object.market) !== null && _a !== void 0 ? _a : "";
155
+ message.marketId = (_a = object.marketId) !== null && _a !== void 0 ? _a : "";
156
156
  message.asks = ((_b = object.asks) !== null && _b !== void 0 ? _b : []).map((e) => exports.OrderBookLevel.fromPartial(e));
157
157
  message.bids = ((_c = object.bids) !== null && _c !== void 0 ? _c : []).map((e) => exports.OrderBookLevel.fromPartial(e));
158
158
  return message;
159
159
  },
160
160
  };
161
- const baseStopBook = { market: "", trigger: "", stopType: "" };
161
+ const baseStopBook = { marketId: "", trigger: "", stopType: "" };
162
162
  exports.StopBook = {
163
163
  encode(message, writer = minimal_1.default.Writer.create()) {
164
- if (message.market !== "") {
165
- writer.uint32(10).string(message.market);
164
+ if (message.marketId !== "") {
165
+ writer.uint32(10).string(message.marketId);
166
166
  }
167
167
  for (const v of message.asks) {
168
168
  exports.StopOrder.encode(v, writer.uint32(18).fork()).ldelim();
@@ -188,7 +188,7 @@ exports.StopBook = {
188
188
  const tag = reader.uint32();
189
189
  switch (tag >>> 3) {
190
190
  case 1:
191
- message.market = reader.string();
191
+ message.marketId = reader.string();
192
192
  break;
193
193
  case 2:
194
194
  message.asks.push(exports.StopOrder.decode(reader, reader.uint32()));
@@ -212,9 +212,9 @@ exports.StopBook = {
212
212
  fromJSON(object) {
213
213
  var _a, _b;
214
214
  const message = Object.assign({}, baseStopBook);
215
- message.market =
216
- object.market !== undefined && object.market !== null
217
- ? String(object.market)
215
+ message.marketId =
216
+ object.marketId !== undefined && object.marketId !== null
217
+ ? String(object.marketId)
218
218
  : "";
219
219
  message.asks = ((_a = object.asks) !== null && _a !== void 0 ? _a : []).map((e) => exports.StopOrder.fromJSON(e));
220
220
  message.bids = ((_b = object.bids) !== null && _b !== void 0 ? _b : []).map((e) => exports.StopOrder.fromJSON(e));
@@ -230,7 +230,7 @@ exports.StopBook = {
230
230
  },
231
231
  toJSON(message) {
232
232
  const obj = {};
233
- message.market !== undefined && (obj.market = message.market);
233
+ message.marketId !== undefined && (obj.marketId = message.marketId);
234
234
  if (message.asks) {
235
235
  obj.asks = message.asks.map((e) => (e ? exports.StopOrder.toJSON(e) : undefined));
236
236
  }
@@ -250,7 +250,7 @@ exports.StopBook = {
250
250
  fromPartial(object) {
251
251
  var _a, _b, _c, _d, _e;
252
252
  const message = Object.assign({}, baseStopBook);
253
- message.market = (_a = object.market) !== null && _a !== void 0 ? _a : "";
253
+ message.marketId = (_a = object.marketId) !== null && _a !== void 0 ? _a : "";
254
254
  message.asks = ((_b = object.asks) !== null && _b !== void 0 ? _b : []).map((e) => exports.StopOrder.fromPartial(e));
255
255
  message.bids = ((_c = object.bids) !== null && _c !== void 0 ? _c : []).map((e) => exports.StopOrder.fromPartial(e));
256
256
  message.trigger = (_d = object.trigger) !== null && _d !== void 0 ? _d : "";
@@ -2,7 +2,7 @@ import Long from "long";
2
2
  import _m0 from "protobufjs/minimal";
3
3
  export declare const protobufPackage = "Switcheo.carbon.book";
4
4
  export interface OrderBookEvent {
5
- market: string;
5
+ marketId: string;
6
6
  side: string;
7
7
  price: string;
8
8
  quantity: string;
@@ -11,7 +11,7 @@ export interface VirtualOrderBookEvent {
11
11
  book?: OrderBookEvent;
12
12
  }
13
13
  export interface ClearVirtualOrderBookEvent {
14
- market: string;
14
+ marketId: string;
15
15
  }
16
16
  export declare const OrderBookEvent: {
17
17
  encode(message: OrderBookEvent, writer?: _m0.Writer): _m0.Writer;
@@ -9,15 +9,15 @@ const long_1 = __importDefault(require("long"));
9
9
  const minimal_1 = __importDefault(require("protobufjs/minimal"));
10
10
  exports.protobufPackage = "Switcheo.carbon.book";
11
11
  const baseOrderBookEvent = {
12
- market: "",
12
+ marketId: "",
13
13
  side: "",
14
14
  price: "",
15
15
  quantity: "",
16
16
  };
17
17
  exports.OrderBookEvent = {
18
18
  encode(message, writer = minimal_1.default.Writer.create()) {
19
- if (message.market !== "") {
20
- writer.uint32(18).string(message.market);
19
+ if (message.marketId !== "") {
20
+ writer.uint32(18).string(message.marketId);
21
21
  }
22
22
  if (message.side !== "") {
23
23
  writer.uint32(26).string(message.side);
@@ -38,7 +38,7 @@ exports.OrderBookEvent = {
38
38
  const tag = reader.uint32();
39
39
  switch (tag >>> 3) {
40
40
  case 2:
41
- message.market = reader.string();
41
+ message.marketId = reader.string();
42
42
  break;
43
43
  case 3:
44
44
  message.side = reader.string();
@@ -58,9 +58,9 @@ exports.OrderBookEvent = {
58
58
  },
59
59
  fromJSON(object) {
60
60
  const message = Object.assign({}, baseOrderBookEvent);
61
- message.market =
62
- object.market !== undefined && object.market !== null
63
- ? String(object.market)
61
+ message.marketId =
62
+ object.marketId !== undefined && object.marketId !== null
63
+ ? String(object.marketId)
64
64
  : "";
65
65
  message.side =
66
66
  object.side !== undefined && object.side !== null
@@ -78,7 +78,7 @@ exports.OrderBookEvent = {
78
78
  },
79
79
  toJSON(message) {
80
80
  const obj = {};
81
- message.market !== undefined && (obj.market = message.market);
81
+ message.marketId !== undefined && (obj.marketId = message.marketId);
82
82
  message.side !== undefined && (obj.side = message.side);
83
83
  message.price !== undefined && (obj.price = message.price);
84
84
  message.quantity !== undefined && (obj.quantity = message.quantity);
@@ -87,7 +87,7 @@ exports.OrderBookEvent = {
87
87
  fromPartial(object) {
88
88
  var _a, _b, _c, _d;
89
89
  const message = Object.assign({}, baseOrderBookEvent);
90
- message.market = (_a = object.market) !== null && _a !== void 0 ? _a : "";
90
+ message.marketId = (_a = object.marketId) !== null && _a !== void 0 ? _a : "";
91
91
  message.side = (_b = object.side) !== null && _b !== void 0 ? _b : "";
92
92
  message.price = (_c = object.price) !== null && _c !== void 0 ? _c : "";
93
93
  message.quantity = (_d = object.quantity) !== null && _d !== void 0 ? _d : "";
@@ -144,11 +144,11 @@ exports.VirtualOrderBookEvent = {
144
144
  return message;
145
145
  },
146
146
  };
147
- const baseClearVirtualOrderBookEvent = { market: "" };
147
+ const baseClearVirtualOrderBookEvent = { marketId: "" };
148
148
  exports.ClearVirtualOrderBookEvent = {
149
149
  encode(message, writer = minimal_1.default.Writer.create()) {
150
- if (message.market !== "") {
151
- writer.uint32(10).string(message.market);
150
+ if (message.marketId !== "") {
151
+ writer.uint32(10).string(message.marketId);
152
152
  }
153
153
  return writer;
154
154
  },
@@ -160,7 +160,7 @@ exports.ClearVirtualOrderBookEvent = {
160
160
  const tag = reader.uint32();
161
161
  switch (tag >>> 3) {
162
162
  case 1:
163
- message.market = reader.string();
163
+ message.marketId = reader.string();
164
164
  break;
165
165
  default:
166
166
  reader.skipType(tag & 7);
@@ -171,21 +171,21 @@ exports.ClearVirtualOrderBookEvent = {
171
171
  },
172
172
  fromJSON(object) {
173
173
  const message = Object.assign({}, baseClearVirtualOrderBookEvent);
174
- message.market =
175
- object.market !== undefined && object.market !== null
176
- ? String(object.market)
174
+ message.marketId =
175
+ object.marketId !== undefined && object.marketId !== null
176
+ ? String(object.marketId)
177
177
  : "";
178
178
  return message;
179
179
  },
180
180
  toJSON(message) {
181
181
  const obj = {};
182
- message.market !== undefined && (obj.market = message.market);
182
+ message.marketId !== undefined && (obj.marketId = message.marketId);
183
183
  return obj;
184
184
  },
185
185
  fromPartial(object) {
186
186
  var _a;
187
187
  const message = Object.assign({}, baseClearVirtualOrderBookEvent);
188
- message.market = (_a = object.market) !== null && _a !== void 0 ? _a : "";
188
+ message.marketId = (_a = object.marketId) !== null && _a !== void 0 ? _a : "";
189
189
  return message;
190
190
  },
191
191
  };
@@ -2,7 +2,7 @@ import Long from "long";
2
2
  import _m0 from "protobufjs/minimal";
3
3
  export declare const protobufPackage = "Switcheo.carbon.book";
4
4
  export interface StopbookV2320 {
5
- market: string;
5
+ marketId: string;
6
6
  asks: string[];
7
7
  bids: string[];
8
8
  trigger: string;
@@ -9,7 +9,7 @@ const long_1 = __importDefault(require("long"));
9
9
  const minimal_1 = __importDefault(require("protobufjs/minimal"));
10
10
  exports.protobufPackage = "Switcheo.carbon.book";
11
11
  const baseStopbookV2320 = {
12
- market: "",
12
+ marketId: "",
13
13
  asks: "",
14
14
  bids: "",
15
15
  trigger: "",
@@ -17,8 +17,8 @@ const baseStopbookV2320 = {
17
17
  };
18
18
  exports.StopbookV2320 = {
19
19
  encode(message, writer = minimal_1.default.Writer.create()) {
20
- if (message.market !== "") {
21
- writer.uint32(10).string(message.market);
20
+ if (message.marketId !== "") {
21
+ writer.uint32(10).string(message.marketId);
22
22
  }
23
23
  for (const v of message.asks) {
24
24
  writer.uint32(18).string(v);
@@ -44,7 +44,7 @@ exports.StopbookV2320 = {
44
44
  const tag = reader.uint32();
45
45
  switch (tag >>> 3) {
46
46
  case 1:
47
- message.market = reader.string();
47
+ message.marketId = reader.string();
48
48
  break;
49
49
  case 2:
50
50
  message.asks.push(reader.string());
@@ -68,9 +68,9 @@ exports.StopbookV2320 = {
68
68
  fromJSON(object) {
69
69
  var _a, _b;
70
70
  const message = Object.assign({}, baseStopbookV2320);
71
- message.market =
72
- object.market !== undefined && object.market !== null
73
- ? String(object.market)
71
+ message.marketId =
72
+ object.marketId !== undefined && object.marketId !== null
73
+ ? String(object.marketId)
74
74
  : "";
75
75
  message.asks = ((_a = object.asks) !== null && _a !== void 0 ? _a : []).map((e) => String(e));
76
76
  message.bids = ((_b = object.bids) !== null && _b !== void 0 ? _b : []).map((e) => String(e));
@@ -86,7 +86,7 @@ exports.StopbookV2320 = {
86
86
  },
87
87
  toJSON(message) {
88
88
  const obj = {};
89
- message.market !== undefined && (obj.market = message.market);
89
+ message.marketId !== undefined && (obj.marketId = message.marketId);
90
90
  if (message.asks) {
91
91
  obj.asks = message.asks.map((e) => e);
92
92
  }
@@ -106,7 +106,7 @@ exports.StopbookV2320 = {
106
106
  fromPartial(object) {
107
107
  var _a, _b, _c, _d, _e;
108
108
  const message = Object.assign({}, baseStopbookV2320);
109
- message.market = (_a = object.market) !== null && _a !== void 0 ? _a : "";
109
+ message.marketId = (_a = object.marketId) !== null && _a !== void 0 ? _a : "";
110
110
  message.asks = ((_b = object.asks) !== null && _b !== void 0 ? _b : []).map((e) => e);
111
111
  message.bids = ((_c = object.bids) !== null && _c !== void 0 ? _c : []).map((e) => e);
112
112
  message.trigger = (_d = object.trigger) !== null && _d !== void 0 ? _d : "";
@@ -4,7 +4,7 @@ import { OrderBook, StopBook } from "./book";
4
4
  import { PageRequest, PageResponse } from "../../../cosmos/base/query/v1beta1/pagination";
5
5
  export declare const protobufPackage = "Switcheo.carbon.book";
6
6
  export interface QueryImpactPriceRequest {
7
- market: string;
7
+ marketId: string;
8
8
  quoteAmount: string;
9
9
  }
10
10
  export interface QueryImpactPriceResponse {
@@ -14,7 +14,7 @@ export interface QueryImpactPriceResponse {
14
14
  }
15
15
  /** this line is used by starport scaffolding # 3 */
16
16
  export interface QueryGetBookRequest {
17
- market: string;
17
+ marketId: string;
18
18
  }
19
19
  export interface QueryGetBookResponse {
20
20
  book?: OrderBook;
@@ -27,7 +27,7 @@ export interface QueryAllBookResponse {
27
27
  pagination?: PageResponse;
28
28
  }
29
29
  export interface QueryGetStopBookRequest {
30
- market: string;
30
+ marketId: string;
31
31
  }
32
32
  export interface QueryGetStopBookResponse {
33
33
  books: StopBook[];
@@ -10,11 +10,11 @@ const minimal_1 = __importDefault(require("protobufjs/minimal"));
10
10
  const book_1 = require("./book");
11
11
  const pagination_1 = require("../../../cosmos/base/query/v1beta1/pagination");
12
12
  exports.protobufPackage = "Switcheo.carbon.book";
13
- const baseQueryImpactPriceRequest = { market: "", quoteAmount: "" };
13
+ const baseQueryImpactPriceRequest = { marketId: "", quoteAmount: "" };
14
14
  exports.QueryImpactPriceRequest = {
15
15
  encode(message, writer = minimal_1.default.Writer.create()) {
16
- if (message.market !== "") {
17
- writer.uint32(10).string(message.market);
16
+ if (message.marketId !== "") {
17
+ writer.uint32(10).string(message.marketId);
18
18
  }
19
19
  if (message.quoteAmount !== "") {
20
20
  writer.uint32(18).string(message.quoteAmount);
@@ -29,7 +29,7 @@ exports.QueryImpactPriceRequest = {
29
29
  const tag = reader.uint32();
30
30
  switch (tag >>> 3) {
31
31
  case 1:
32
- message.market = reader.string();
32
+ message.marketId = reader.string();
33
33
  break;
34
34
  case 2:
35
35
  message.quoteAmount = reader.string();
@@ -43,9 +43,9 @@ exports.QueryImpactPriceRequest = {
43
43
  },
44
44
  fromJSON(object) {
45
45
  const message = Object.assign({}, baseQueryImpactPriceRequest);
46
- message.market =
47
- object.market !== undefined && object.market !== null
48
- ? String(object.market)
46
+ message.marketId =
47
+ object.marketId !== undefined && object.marketId !== null
48
+ ? String(object.marketId)
49
49
  : "";
50
50
  message.quoteAmount =
51
51
  object.quoteAmount !== undefined && object.quoteAmount !== null
@@ -55,7 +55,7 @@ exports.QueryImpactPriceRequest = {
55
55
  },
56
56
  toJSON(message) {
57
57
  const obj = {};
58
- message.market !== undefined && (obj.market = message.market);
58
+ message.marketId !== undefined && (obj.marketId = message.marketId);
59
59
  message.quoteAmount !== undefined &&
60
60
  (obj.quoteAmount = message.quoteAmount);
61
61
  return obj;
@@ -63,7 +63,7 @@ exports.QueryImpactPriceRequest = {
63
63
  fromPartial(object) {
64
64
  var _a, _b;
65
65
  const message = Object.assign({}, baseQueryImpactPriceRequest);
66
- message.market = (_a = object.market) !== null && _a !== void 0 ? _a : "";
66
+ message.marketId = (_a = object.marketId) !== null && _a !== void 0 ? _a : "";
67
67
  message.quoteAmount = (_b = object.quoteAmount) !== null && _b !== void 0 ? _b : "";
68
68
  return message;
69
69
  },
@@ -143,11 +143,11 @@ exports.QueryImpactPriceResponse = {
143
143
  return message;
144
144
  },
145
145
  };
146
- const baseQueryGetBookRequest = { market: "" };
146
+ const baseQueryGetBookRequest = { marketId: "" };
147
147
  exports.QueryGetBookRequest = {
148
148
  encode(message, writer = minimal_1.default.Writer.create()) {
149
- if (message.market !== "") {
150
- writer.uint32(10).string(message.market);
149
+ if (message.marketId !== "") {
150
+ writer.uint32(10).string(message.marketId);
151
151
  }
152
152
  return writer;
153
153
  },
@@ -159,7 +159,7 @@ exports.QueryGetBookRequest = {
159
159
  const tag = reader.uint32();
160
160
  switch (tag >>> 3) {
161
161
  case 1:
162
- message.market = reader.string();
162
+ message.marketId = reader.string();
163
163
  break;
164
164
  default:
165
165
  reader.skipType(tag & 7);
@@ -170,21 +170,21 @@ exports.QueryGetBookRequest = {
170
170
  },
171
171
  fromJSON(object) {
172
172
  const message = Object.assign({}, baseQueryGetBookRequest);
173
- message.market =
174
- object.market !== undefined && object.market !== null
175
- ? String(object.market)
173
+ message.marketId =
174
+ object.marketId !== undefined && object.marketId !== null
175
+ ? String(object.marketId)
176
176
  : "";
177
177
  return message;
178
178
  },
179
179
  toJSON(message) {
180
180
  const obj = {};
181
- message.market !== undefined && (obj.market = message.market);
181
+ message.marketId !== undefined && (obj.marketId = message.marketId);
182
182
  return obj;
183
183
  },
184
184
  fromPartial(object) {
185
185
  var _a;
186
186
  const message = Object.assign({}, baseQueryGetBookRequest);
187
- message.market = (_a = object.market) !== null && _a !== void 0 ? _a : "";
187
+ message.marketId = (_a = object.marketId) !== null && _a !== void 0 ? _a : "";
188
188
  return message;
189
189
  },
190
190
  };
@@ -353,11 +353,11 @@ exports.QueryAllBookResponse = {
353
353
  return message;
354
354
  },
355
355
  };
356
- const baseQueryGetStopBookRequest = { market: "" };
356
+ const baseQueryGetStopBookRequest = { marketId: "" };
357
357
  exports.QueryGetStopBookRequest = {
358
358
  encode(message, writer = minimal_1.default.Writer.create()) {
359
- if (message.market !== "") {
360
- writer.uint32(10).string(message.market);
359
+ if (message.marketId !== "") {
360
+ writer.uint32(10).string(message.marketId);
361
361
  }
362
362
  return writer;
363
363
  },
@@ -369,7 +369,7 @@ exports.QueryGetStopBookRequest = {
369
369
  const tag = reader.uint32();
370
370
  switch (tag >>> 3) {
371
371
  case 1:
372
- message.market = reader.string();
372
+ message.marketId = reader.string();
373
373
  break;
374
374
  default:
375
375
  reader.skipType(tag & 7);
@@ -380,21 +380,21 @@ exports.QueryGetStopBookRequest = {
380
380
  },
381
381
  fromJSON(object) {
382
382
  const message = Object.assign({}, baseQueryGetStopBookRequest);
383
- message.market =
384
- object.market !== undefined && object.market !== null
385
- ? String(object.market)
383
+ message.marketId =
384
+ object.marketId !== undefined && object.marketId !== null
385
+ ? String(object.marketId)
386
386
  : "";
387
387
  return message;
388
388
  },
389
389
  toJSON(message) {
390
390
  const obj = {};
391
- message.market !== undefined && (obj.market = message.market);
391
+ message.marketId !== undefined && (obj.marketId = message.marketId);
392
392
  return obj;
393
393
  },
394
394
  fromPartial(object) {
395
395
  var _a;
396
396
  const message = Object.assign({}, baseQueryGetStopBookRequest);
397
- message.market = (_a = object.market) !== null && _a !== void 0 ? _a : "";
397
+ message.marketId = (_a = object.marketId) !== null && _a !== void 0 ? _a : "";
398
398
  return message;
399
399
  },
400
400
  };
@@ -4,7 +4,7 @@ export declare const protobufPackage = "Switcheo.carbon.broker";
4
4
  /** SpotAmm exists when there is a quote on the orderbook */
5
5
  export interface SpotAmm {
6
6
  poolId: Long;
7
- market: string;
7
+ marketId: string;
8
8
  reservesHash: Uint8Array;
9
9
  /**
10
10
  * TODO: change to reserved after being used for migration
@@ -17,12 +17,14 @@ export interface SpotAmm {
17
17
  export interface PerpsAmm {
18
18
  poolId: Long;
19
19
  quotingHash: Uint8Array;
20
- lastQuotedAt: Long;
20
+ /** TODO: depreceate uint64 var */
21
+ legacyLastQuotedAt: Long;
21
22
  markets: PerpsMarketAmm[];
23
+ lastQuotedAt?: Date;
22
24
  }
23
25
  /** PerpsMarketAmm exists when it is active or when there's orders or open position */
24
26
  export interface PerpsMarketAmm {
25
- market: string;
27
+ marketId: string;
26
28
  /**
27
29
  * TODO: change to reserved after being used for migration
28
30
  * reserved 2; // used to be orders, but deprecated