carbon-js-sdk 0.8.8 → 0.8.9-beta.1
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/lib/codec/Switcheo/carbon/book/book.d.ts +2 -2
- package/lib/codec/Switcheo/carbon/book/book.js +18 -18
- package/lib/codec/Switcheo/carbon/book/event.d.ts +2 -2
- package/lib/codec/Switcheo/carbon/book/event.js +18 -18
- package/lib/codec/Switcheo/carbon/book/legacy.d.ts +1 -1
- package/lib/codec/Switcheo/carbon/book/legacy.js +9 -9
- package/lib/codec/Switcheo/carbon/book/query.d.ts +3 -3
- package/lib/codec/Switcheo/carbon/book/query.js +27 -27
- package/lib/codec/Switcheo/carbon/broker/amm.d.ts +5 -3
- package/lib/codec/Switcheo/carbon/broker/amm.js +74 -31
- package/lib/codec/Switcheo/carbon/broker/candlestick.d.ts +1 -1
- package/lib/codec/Switcheo/carbon/broker/candlestick.js +9 -9
- package/lib/codec/Switcheo/carbon/broker/event.d.ts +1 -1
- package/lib/codec/Switcheo/carbon/broker/event.js +9 -9
- package/lib/codec/Switcheo/carbon/broker/query.d.ts +3 -3
- package/lib/codec/Switcheo/carbon/broker/query.js +27 -27
- package/lib/codec/Switcheo/carbon/broker/tx.d.ts +1 -1
- package/lib/codec/Switcheo/carbon/broker/tx.js +9 -9
- package/lib/codec/Switcheo/carbon/ccm/export.d.ts +2 -2
- package/lib/codec/Switcheo/carbon/ccm/export.js +6 -3
- package/lib/codec/Switcheo/carbon/ccm/genesis.d.ts +1 -1
- package/lib/codec/Switcheo/carbon/ccm/genesis.js +6 -6
- package/lib/codec/Switcheo/carbon/ccm/params.d.ts +30 -0
- package/lib/codec/Switcheo/carbon/ccm/params.js +107 -0
- package/lib/codec/Switcheo/carbon/ccm/query.d.ts +32 -2
- package/lib/codec/Switcheo/carbon/ccm/query.js +88 -1
- package/lib/codec/Switcheo/carbon/ccm/tx.d.ts +3 -7
- package/lib/codec/Switcheo/carbon/ccm/tx.js +8 -6
- package/lib/codec/Switcheo/carbon/cdp/export.d.ts +1 -1
- package/lib/codec/Switcheo/carbon/cdp/export.js +5 -4
- package/lib/codec/Switcheo/carbon/cdp/params.d.ts +20 -0
- package/lib/codec/Switcheo/carbon/cdp/params.js +196 -1
- package/lib/codec/Switcheo/carbon/cdp/tx.d.ts +3 -7
- package/lib/codec/Switcheo/carbon/cdp/tx.js +7 -5
- package/lib/codec/Switcheo/carbon/coin/token.d.ts +2 -2
- package/lib/codec/Switcheo/carbon/coin/token.js +18 -18
- package/lib/codec/Switcheo/carbon/erc20/export.d.ts +1 -1
- package/lib/codec/Switcheo/carbon/erc20/export.js +4 -3
- package/lib/codec/Switcheo/carbon/erc20/genesis.d.ts +1 -17
- package/lib/codec/Switcheo/carbon/erc20/genesis.js +7 -65
- package/lib/codec/Switcheo/carbon/erc20/params.d.ts +37 -0
- package/lib/codec/Switcheo/carbon/erc20/params.js +133 -0
- package/lib/codec/Switcheo/carbon/erc20/query.d.ts +1 -1
- package/lib/codec/Switcheo/carbon/erc20/query.js +6 -6
- package/lib/codec/Switcheo/carbon/erc20/tx.d.ts +3 -6
- package/lib/codec/Switcheo/carbon/erc20/tx.js +8 -6
- package/lib/codec/Switcheo/carbon/evmcontract/export.d.ts +2 -2
- package/lib/codec/Switcheo/carbon/evmcontract/export.js +2 -3
- package/lib/codec/Switcheo/carbon/evmcontract/params.d.ts +10 -0
- package/lib/codec/Switcheo/carbon/evmcontract/params.js +50 -1
- package/lib/codec/Switcheo/carbon/evmcontract/tx.d.ts +3 -29
- package/lib/codec/Switcheo/carbon/evmcontract/tx.js +8 -106
- package/lib/codec/Switcheo/carbon/insurance/tx.d.ts +1 -1
- package/lib/codec/Switcheo/carbon/insurance/tx.js +9 -9
- package/lib/codec/Switcheo/carbon/leverage/event.d.ts +1 -1
- package/lib/codec/Switcheo/carbon/leverage/event.js +9 -9
- package/lib/codec/Switcheo/carbon/leverage/leverage.d.ts +1 -1
- package/lib/codec/Switcheo/carbon/leverage/leverage.js +9 -9
- package/lib/codec/Switcheo/carbon/leverage/query.d.ts +1 -1
- package/lib/codec/Switcheo/carbon/leverage/query.js +9 -9
- package/lib/codec/Switcheo/carbon/leverage/tx.d.ts +1 -1
- package/lib/codec/Switcheo/carbon/leverage/tx.js +9 -9
- package/lib/codec/Switcheo/carbon/liquidation/event.d.ts +23 -0
- package/lib/codec/Switcheo/carbon/liquidation/event.js +154 -0
- package/lib/codec/Switcheo/carbon/liquidation/export.d.ts +1 -0
- package/lib/codec/Switcheo/carbon/liquidation/export.js +3 -1
- package/lib/codec/Switcheo/carbon/liquidation/outstanding_position.d.ts +1 -1
- package/lib/codec/Switcheo/carbon/liquidation/outstanding_position.js +9 -9
- package/lib/codec/Switcheo/carbon/liquidation/query.d.ts +1 -1
- package/lib/codec/Switcheo/carbon/liquidation/query.js +9 -9
- package/lib/codec/Switcheo/carbon/liquiditypool/export.d.ts +2 -1
- package/lib/codec/Switcheo/carbon/liquiditypool/export.js +6 -4
- package/lib/codec/Switcheo/carbon/liquiditypool/genesis.d.ts +2 -1
- package/lib/codec/Switcheo/carbon/liquiditypool/genesis.js +7 -6
- package/lib/codec/Switcheo/carbon/liquiditypool/liquiditypool.d.ts +2 -13
- package/lib/codec/Switcheo/carbon/liquiditypool/liquiditypool.js +33 -85
- package/lib/codec/Switcheo/carbon/liquiditypool/params.d.ts +30 -0
- package/lib/codec/Switcheo/carbon/liquiditypool/params.js +149 -0
- package/lib/codec/Switcheo/carbon/liquiditypool/query.d.ts +2 -1
- package/lib/codec/Switcheo/carbon/liquiditypool/query.js +6 -5
- package/lib/codec/Switcheo/carbon/liquiditypool/tx.d.ts +4 -8
- package/lib/codec/Switcheo/carbon/liquiditypool/tx.js +35 -33
- package/lib/codec/Switcheo/carbon/market/event.d.ts +1 -1
- package/lib/codec/Switcheo/carbon/market/event.js +13 -11
- package/lib/codec/Switcheo/carbon/market/export.d.ts +3 -2
- package/lib/codec/Switcheo/carbon/market/export.js +9 -3
- package/lib/codec/Switcheo/carbon/market/genesis.d.ts +2 -1
- package/lib/codec/Switcheo/carbon/market/genesis.js +6 -5
- package/lib/codec/Switcheo/carbon/market/market.d.ts +1 -38
- package/lib/codec/Switcheo/carbon/market/market.js +9 -400
- package/lib/codec/Switcheo/carbon/market/params.d.ts +83 -0
- package/lib/codec/Switcheo/carbon/market/params.js +791 -0
- package/lib/codec/Switcheo/carbon/market/query.d.ts +3 -2
- package/lib/codec/Switcheo/carbon/market/query.js +19 -16
- package/lib/codec/Switcheo/carbon/market/tx.d.ts +51 -8
- package/lib/codec/Switcheo/carbon/market/tx.js +245 -6
- package/lib/codec/Switcheo/carbon/marketstats/marketstats.d.ts +1 -1
- package/lib/codec/Switcheo/carbon/marketstats/marketstats.js +9 -9
- package/lib/codec/Switcheo/carbon/misc/trade.d.ts +1 -1
- package/lib/codec/Switcheo/carbon/misc/trade.js +9 -9
- package/lib/codec/Switcheo/carbon/oracle/export.d.ts +2 -1
- package/lib/codec/Switcheo/carbon/oracle/export.js +5 -3
- package/lib/codec/Switcheo/carbon/oracle/genesis.d.ts +2 -1
- package/lib/codec/Switcheo/carbon/oracle/genesis.js +6 -5
- package/lib/codec/Switcheo/carbon/oracle/oracle.d.ts +0 -20
- package/lib/codec/Switcheo/carbon/oracle/oracle.js +1 -176
- package/lib/codec/Switcheo/carbon/oracle/params.d.ts +45 -0
- package/lib/codec/Switcheo/carbon/oracle/params.js +362 -0
- package/lib/codec/Switcheo/carbon/oracle/query.d.ts +2 -1
- package/lib/codec/Switcheo/carbon/oracle/query.js +6 -5
- package/lib/codec/Switcheo/carbon/oracle/tx.d.ts +3 -7
- package/lib/codec/Switcheo/carbon/oracle/tx.js +8 -6
- package/lib/codec/Switcheo/carbon/order/export.d.ts +2 -1
- package/lib/codec/Switcheo/carbon/order/export.js +4 -2
- package/lib/codec/Switcheo/carbon/order/genesis.d.ts +3 -2
- package/lib/codec/Switcheo/carbon/order/genesis.js +15 -14
- package/lib/codec/Switcheo/carbon/order/order.d.ts +2 -12
- package/lib/codec/Switcheo/carbon/order/order.js +29 -57
- package/lib/codec/Switcheo/carbon/order/params.d.ts +28 -0
- package/lib/codec/Switcheo/carbon/order/params.js +109 -0
- package/lib/codec/Switcheo/carbon/order/query.d.ts +4 -3
- package/lib/codec/Switcheo/carbon/order/query.js +24 -23
- package/lib/codec/Switcheo/carbon/order/tx.d.ts +5 -9
- package/lib/codec/Switcheo/carbon/order/tx.js +26 -24
- package/lib/codec/Switcheo/carbon/perpspool/event.d.ts +1 -1
- package/lib/codec/Switcheo/carbon/perpspool/event.js +9 -9
- package/lib/codec/Switcheo/carbon/perpspool/export.d.ts +2 -2
- package/lib/codec/Switcheo/carbon/perpspool/export.js +3 -4
- package/lib/codec/Switcheo/carbon/perpspool/market.d.ts +1 -1
- package/lib/codec/Switcheo/carbon/perpspool/market.js +9 -9
- package/lib/codec/Switcheo/carbon/perpspool/params.d.ts +16 -0
- package/lib/codec/Switcheo/carbon/perpspool/params.js +175 -1
- package/lib/codec/Switcheo/carbon/perpspool/tx.d.ts +3 -33
- package/lib/codec/Switcheo/carbon/perpspool/tx.js +8 -173
- package/lib/codec/Switcheo/carbon/position/evm_hooks.d.ts +1 -1
- package/lib/codec/Switcheo/carbon/position/evm_hooks.js +9 -9
- package/lib/codec/Switcheo/carbon/position/position.d.ts +2 -2
- package/lib/codec/Switcheo/carbon/position/position.js +18 -18
- package/lib/codec/Switcheo/carbon/position/query.d.ts +2 -2
- package/lib/codec/Switcheo/carbon/position/query.js +18 -18
- package/lib/codec/Switcheo/carbon/position/tx.d.ts +1 -1
- package/lib/codec/Switcheo/carbon/position/tx.js +9 -9
- package/lib/codec/Switcheo/carbon/pricing/export.d.ts +3 -2
- package/lib/codec/Switcheo/carbon/pricing/export.js +6 -2
- package/lib/codec/Switcheo/carbon/pricing/genesis.d.ts +2 -1
- package/lib/codec/Switcheo/carbon/pricing/genesis.js +6 -5
- package/lib/codec/Switcheo/carbon/pricing/params.d.ts +35 -0
- package/lib/codec/Switcheo/carbon/pricing/params.js +212 -0
- package/lib/codec/Switcheo/carbon/pricing/pricing.d.ts +1 -16
- package/lib/codec/Switcheo/carbon/pricing/pricing.js +10 -109
- package/lib/codec/Switcheo/carbon/pricing/proposal.d.ts +1 -1
- package/lib/codec/Switcheo/carbon/pricing/proposal.js +9 -9
- package/lib/codec/Switcheo/carbon/pricing/query.d.ts +3 -2
- package/lib/codec/Switcheo/carbon/pricing/query.js +15 -14
- package/lib/codec/Switcheo/carbon/pricing/tx.d.ts +27 -7
- package/lib/codec/Switcheo/carbon/pricing/tx.js +121 -7
- package/lib/codec/Switcheo/carbon/subaccount/export.d.ts +2 -1
- package/lib/codec/Switcheo/carbon/subaccount/export.js +4 -2
- package/lib/codec/Switcheo/carbon/subaccount/genesis.d.ts +2 -1
- package/lib/codec/Switcheo/carbon/subaccount/genesis.js +6 -5
- package/lib/codec/Switcheo/carbon/subaccount/params.d.ts +29 -0
- package/lib/codec/Switcheo/carbon/subaccount/params.js +119 -0
- package/lib/codec/Switcheo/carbon/subaccount/query.d.ts +2 -1
- package/lib/codec/Switcheo/carbon/subaccount/query.js +6 -5
- package/lib/codec/Switcheo/carbon/subaccount/subaccount.d.ts +0 -11
- package/lib/codec/Switcheo/carbon/subaccount/subaccount.js +1 -54
- package/lib/codec/Switcheo/carbon/subaccount/tx.d.ts +3 -7
- package/lib/codec/Switcheo/carbon/subaccount/tx.js +8 -6
- package/lib/codec/index.d.ts +6 -4
- package/lib/codec/index.js +587 -247
- package/lib/modules/admin.d.ts +1 -1
- package/lib/modules/admin.js +1 -1
- package/lib/modules/leverage.d.ts +1 -1
- package/lib/modules/leverage.js +2 -2
- package/lib/modules/order.d.ts +3 -3
- package/lib/modules/order.js +4 -4
- package/lib/modules/position.d.ts +1 -1
- package/lib/modules/position.js +2 -2
- package/lib/util/tx.d.ts +6 -4
- package/package.json +1 -1
|
@@ -7,12 +7,12 @@ export interface OrderBookLevel {
|
|
|
7
7
|
orders: string[];
|
|
8
8
|
}
|
|
9
9
|
export interface OrderBook {
|
|
10
|
-
|
|
10
|
+
marketId: string;
|
|
11
11
|
asks: OrderBookLevel[];
|
|
12
12
|
bids: OrderBookLevel[];
|
|
13
13
|
}
|
|
14
14
|
export interface StopBook {
|
|
15
|
-
|
|
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 = {
|
|
85
|
+
const baseOrderBook = { marketId: "" };
|
|
86
86
|
exports.OrderBook = {
|
|
87
87
|
encode(message, writer = minimal_1.default.Writer.create()) {
|
|
88
|
-
if (message.
|
|
89
|
-
writer.uint32(10).string(message.
|
|
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.
|
|
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.
|
|
128
|
-
object.
|
|
129
|
-
? String(object.
|
|
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.
|
|
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.
|
|
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 = {
|
|
161
|
+
const baseStopBook = { marketId: "", trigger: "", stopType: "" };
|
|
162
162
|
exports.StopBook = {
|
|
163
163
|
encode(message, writer = minimal_1.default.Writer.create()) {
|
|
164
|
-
if (message.
|
|
165
|
-
writer.uint32(10).string(message.
|
|
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.
|
|
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.
|
|
216
|
-
object.
|
|
217
|
-
? String(object.
|
|
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.
|
|
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.
|
|
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
|
-
|
|
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
|
-
|
|
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
|
-
|
|
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.
|
|
20
|
-
writer.uint32(18).string(message.
|
|
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.
|
|
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.
|
|
62
|
-
object.
|
|
63
|
-
? String(object.
|
|
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.
|
|
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.
|
|
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 = {
|
|
147
|
+
const baseClearVirtualOrderBookEvent = { marketId: "" };
|
|
148
148
|
exports.ClearVirtualOrderBookEvent = {
|
|
149
149
|
encode(message, writer = minimal_1.default.Writer.create()) {
|
|
150
|
-
if (message.
|
|
151
|
-
writer.uint32(10).string(message.
|
|
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.
|
|
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.
|
|
175
|
-
object.
|
|
176
|
-
? String(object.
|
|
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.
|
|
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.
|
|
188
|
+
message.marketId = (_a = object.marketId) !== null && _a !== void 0 ? _a : "";
|
|
189
189
|
return message;
|
|
190
190
|
},
|
|
191
191
|
};
|
|
@@ -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
|
-
|
|
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.
|
|
21
|
-
writer.uint32(10).string(message.
|
|
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.
|
|
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.
|
|
72
|
-
object.
|
|
73
|
-
? String(object.
|
|
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.
|
|
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.
|
|
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
|
-
|
|
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
|
-
|
|
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
|
-
|
|
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 = {
|
|
13
|
+
const baseQueryImpactPriceRequest = { marketId: "", quoteAmount: "" };
|
|
14
14
|
exports.QueryImpactPriceRequest = {
|
|
15
15
|
encode(message, writer = minimal_1.default.Writer.create()) {
|
|
16
|
-
if (message.
|
|
17
|
-
writer.uint32(10).string(message.
|
|
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.
|
|
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.
|
|
47
|
-
object.
|
|
48
|
-
? String(object.
|
|
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.
|
|
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.
|
|
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 = {
|
|
146
|
+
const baseQueryGetBookRequest = { marketId: "" };
|
|
147
147
|
exports.QueryGetBookRequest = {
|
|
148
148
|
encode(message, writer = minimal_1.default.Writer.create()) {
|
|
149
|
-
if (message.
|
|
150
|
-
writer.uint32(10).string(message.
|
|
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.
|
|
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.
|
|
174
|
-
object.
|
|
175
|
-
? String(object.
|
|
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.
|
|
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.
|
|
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 = {
|
|
356
|
+
const baseQueryGetStopBookRequest = { marketId: "" };
|
|
357
357
|
exports.QueryGetStopBookRequest = {
|
|
358
358
|
encode(message, writer = minimal_1.default.Writer.create()) {
|
|
359
|
-
if (message.
|
|
360
|
-
writer.uint32(10).string(message.
|
|
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.
|
|
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.
|
|
384
|
-
object.
|
|
385
|
-
? String(object.
|
|
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.
|
|
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.
|
|
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
|
-
|
|
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
|
-
|
|
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
|
-
|
|
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
|