coreum-js 2.19.0 → 2.20.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/dist/main/coreum/dex/v1/cosmos/cosmos-sdk/proto/cosmos/msg/v1/msg.d.ts +1 -0
- package/dist/main/coreum/dex/v1/cosmos/cosmos-sdk/proto/cosmos/msg/v1/msg.js +10 -0
- package/dist/main/coreum/dex/v1/event.js +8 -28
- package/dist/main/coreum/dex/v1/genesis.d.ts +2 -1
- package/dist/main/coreum/dex/v1/genesis.js +57 -14
- package/dist/main/coreum/dex/v1/order.d.ts +3 -23
- package/dist/main/coreum/dex/v1/order.js +27 -205
- package/dist/main/coreum/dex/v1/params.d.ts +5 -3
- package/dist/main/coreum/dex/v1/params.js +25 -7
- package/dist/main/coreum/dex/v1/query.d.ts +2 -2
- package/dist/main/coreum/dex/v1/query.js +48 -48
- package/dist/main/coreum/dex/v1/tx.d.ts +1 -1
- package/dist/main/coreum/dex/v1/tx.js +31 -45
- package/dist/module/coreum/dex/v1/cosmos/cosmos-sdk/proto/cosmos/msg/v1/msg.d.ts +1 -0
- package/dist/module/coreum/dex/v1/cosmos/cosmos-sdk/proto/cosmos/msg/v1/msg.js +7 -0
- package/dist/module/coreum/dex/v1/event.js +8 -28
- package/dist/module/coreum/dex/v1/genesis.d.ts +2 -1
- package/dist/module/coreum/dex/v1/genesis.js +51 -8
- package/dist/module/coreum/dex/v1/order.d.ts +3 -23
- package/dist/module/coreum/dex/v1/order.js +14 -192
- package/dist/module/coreum/dex/v1/params.d.ts +5 -3
- package/dist/module/coreum/dex/v1/params.js +23 -5
- package/dist/module/coreum/dex/v1/query.d.ts +2 -2
- package/dist/module/coreum/dex/v1/query.js +13 -13
- package/dist/module/coreum/dex/v1/tx.d.ts +1 -1
- package/dist/module/coreum/dex/v1/tx.js +17 -31
- package/package.json +1 -1
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
// Code generated by protoc-gen-ts_proto. DO NOT EDIT.
|
|
2
2
|
// versions:
|
|
3
|
-
// protoc-gen-ts_proto v2.
|
|
4
|
-
// protoc
|
|
3
|
+
// protoc-gen-ts_proto v2.7.0
|
|
4
|
+
// protoc v6.32.0
|
|
5
5
|
// source: coreum-protos/dex/event.proto
|
|
6
6
|
/* eslint-disable */
|
|
7
7
|
import { BinaryReader, BinaryWriter } from "@bufbuild/protobuf/wire";
|
|
@@ -166,12 +166,8 @@ export const EventOrderReduced = {
|
|
|
166
166
|
creator: isSet(object.creator) ? globalThis.String(object.creator) : "",
|
|
167
167
|
id: isSet(object.id) ? globalThis.String(object.id) : "",
|
|
168
168
|
sequence: isSet(object.sequence) ? globalThis.Number(object.sequence) : 0,
|
|
169
|
-
sentCoin: isSet(object.sentCoin)
|
|
170
|
-
|
|
171
|
-
: "",
|
|
172
|
-
receivedCoin: isSet(object.receivedCoin)
|
|
173
|
-
? globalThis.String(object.receivedCoin)
|
|
174
|
-
: "",
|
|
169
|
+
sentCoin: isSet(object.sentCoin) ? globalThis.String(object.sentCoin) : "",
|
|
170
|
+
receivedCoin: isSet(object.receivedCoin) ? globalThis.String(object.receivedCoin) : "",
|
|
175
171
|
};
|
|
176
172
|
},
|
|
177
173
|
toJSON(message) {
|
|
@@ -207,13 +203,7 @@ export const EventOrderReduced = {
|
|
|
207
203
|
},
|
|
208
204
|
};
|
|
209
205
|
function createBaseEventOrderCreated() {
|
|
210
|
-
return {
|
|
211
|
-
creator: "",
|
|
212
|
-
id: "",
|
|
213
|
-
sequence: 0,
|
|
214
|
-
remainingBaseQuantity: "",
|
|
215
|
-
remainingSpendableBalance: "",
|
|
216
|
-
};
|
|
206
|
+
return { creator: "", id: "", sequence: 0, remainingBaseQuantity: "", remainingSpendableBalance: "" };
|
|
217
207
|
}
|
|
218
208
|
export const EventOrderCreated = {
|
|
219
209
|
encode(message, writer = new BinaryWriter()) {
|
|
@@ -289,9 +279,7 @@ export const EventOrderCreated = {
|
|
|
289
279
|
creator: isSet(object.creator) ? globalThis.String(object.creator) : "",
|
|
290
280
|
id: isSet(object.id) ? globalThis.String(object.id) : "",
|
|
291
281
|
sequence: isSet(object.sequence) ? globalThis.Number(object.sequence) : 0,
|
|
292
|
-
remainingBaseQuantity: isSet(object.remainingBaseQuantity)
|
|
293
|
-
? globalThis.String(object.remainingBaseQuantity)
|
|
294
|
-
: "",
|
|
282
|
+
remainingBaseQuantity: isSet(object.remainingBaseQuantity) ? globalThis.String(object.remainingBaseQuantity) : "",
|
|
295
283
|
remainingSpendableBalance: isSet(object.remainingSpendableBalance)
|
|
296
284
|
? globalThis.String(object.remainingSpendableBalance)
|
|
297
285
|
: "",
|
|
@@ -330,13 +318,7 @@ export const EventOrderCreated = {
|
|
|
330
318
|
},
|
|
331
319
|
};
|
|
332
320
|
function createBaseEventOrderClosed() {
|
|
333
|
-
return {
|
|
334
|
-
creator: "",
|
|
335
|
-
id: "",
|
|
336
|
-
sequence: 0,
|
|
337
|
-
remainingBaseQuantity: "",
|
|
338
|
-
remainingSpendableBalance: "",
|
|
339
|
-
};
|
|
321
|
+
return { creator: "", id: "", sequence: 0, remainingBaseQuantity: "", remainingSpendableBalance: "" };
|
|
340
322
|
}
|
|
341
323
|
export const EventOrderClosed = {
|
|
342
324
|
encode(message, writer = new BinaryWriter()) {
|
|
@@ -412,9 +394,7 @@ export const EventOrderClosed = {
|
|
|
412
394
|
creator: isSet(object.creator) ? globalThis.String(object.creator) : "",
|
|
413
395
|
id: isSet(object.id) ? globalThis.String(object.id) : "",
|
|
414
396
|
sequence: isSet(object.sequence) ? globalThis.Number(object.sequence) : 0,
|
|
415
|
-
remainingBaseQuantity: isSet(object.remainingBaseQuantity)
|
|
416
|
-
? globalThis.String(object.remainingBaseQuantity)
|
|
417
|
-
: "",
|
|
397
|
+
remainingBaseQuantity: isSet(object.remainingBaseQuantity) ? globalThis.String(object.remainingBaseQuantity) : "",
|
|
418
398
|
remainingSpendableBalance: isSet(object.remainingSpendableBalance)
|
|
419
399
|
? globalThis.String(object.remainingSpendableBalance)
|
|
420
400
|
: "",
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { BinaryReader, BinaryWriter } from "
|
|
1
|
+
import { BinaryReader, BinaryWriter } from "@bufbuild/protobuf/wire";
|
|
2
2
|
import { Order, OrderBookData } from "./order";
|
|
3
3
|
import { Params } from "./params";
|
|
4
4
|
export declare const protobufPackage = "coreum.dex.v1";
|
|
@@ -11,6 +11,7 @@ export interface GenesisState {
|
|
|
11
11
|
/** order_sequence is current order sequence; */
|
|
12
12
|
orderSequence: number;
|
|
13
13
|
accountsDenomsOrdersCounts: AccountDenomOrdersCount[];
|
|
14
|
+
reservedOrderIds: Uint8Array[];
|
|
14
15
|
}
|
|
15
16
|
/** OrderBookDataWithID is a order book data with it's corresponding ID. */
|
|
16
17
|
export interface OrderBookDataWithID {
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
// Code generated by protoc-gen-ts_proto. DO NOT EDIT.
|
|
2
2
|
// versions:
|
|
3
|
-
// protoc-gen-ts_proto v2.
|
|
4
|
-
// protoc
|
|
3
|
+
// protoc-gen-ts_proto v2.7.0
|
|
4
|
+
// protoc v6.32.0
|
|
5
5
|
// source: coreum-protos/dex/genesis.proto
|
|
6
6
|
/* eslint-disable */
|
|
7
|
-
import { BinaryReader, BinaryWriter } from "
|
|
7
|
+
import { BinaryReader, BinaryWriter } from "@bufbuild/protobuf/wire";
|
|
8
8
|
import { Order, OrderBookData } from "./order";
|
|
9
9
|
import { Params } from "./params";
|
|
10
10
|
export const protobufPackage = "coreum.dex.v1";
|
|
@@ -15,24 +15,28 @@ function createBaseGenesisState() {
|
|
|
15
15
|
orders: [],
|
|
16
16
|
orderSequence: 0,
|
|
17
17
|
accountsDenomsOrdersCounts: [],
|
|
18
|
+
reservedOrderIds: [],
|
|
18
19
|
};
|
|
19
20
|
}
|
|
20
21
|
export const GenesisState = {
|
|
21
22
|
encode(message, writer = new BinaryWriter()) {
|
|
22
23
|
if (message.params !== undefined) {
|
|
23
|
-
Params.encode(message.params, writer.uint32(10).fork()).
|
|
24
|
+
Params.encode(message.params, writer.uint32(10).fork()).join();
|
|
24
25
|
}
|
|
25
26
|
for (const v of message.orderBooks) {
|
|
26
|
-
OrderBookDataWithID.encode(v, writer.uint32(18).fork()).
|
|
27
|
+
OrderBookDataWithID.encode(v, writer.uint32(18).fork()).join();
|
|
27
28
|
}
|
|
28
29
|
for (const v of message.orders) {
|
|
29
|
-
Order.encode(v, writer.uint32(26).fork()).
|
|
30
|
+
Order.encode(v, writer.uint32(26).fork()).join();
|
|
30
31
|
}
|
|
31
32
|
if (message.orderSequence !== 0) {
|
|
32
33
|
writer.uint32(32).uint64(message.orderSequence);
|
|
33
34
|
}
|
|
34
35
|
for (const v of message.accountsDenomsOrdersCounts) {
|
|
35
|
-
AccountDenomOrdersCount.encode(v, writer.uint32(42).fork()).
|
|
36
|
+
AccountDenomOrdersCount.encode(v, writer.uint32(42).fork()).join();
|
|
37
|
+
}
|
|
38
|
+
for (const v of message.reservedOrderIds) {
|
|
39
|
+
writer.uint32(50).bytes(v);
|
|
36
40
|
}
|
|
37
41
|
return writer;
|
|
38
42
|
},
|
|
@@ -78,6 +82,13 @@ export const GenesisState = {
|
|
|
78
82
|
message.accountsDenomsOrdersCounts.push(AccountDenomOrdersCount.decode(reader, reader.uint32()));
|
|
79
83
|
continue;
|
|
80
84
|
}
|
|
85
|
+
case 6: {
|
|
86
|
+
if (tag !== 50) {
|
|
87
|
+
break;
|
|
88
|
+
}
|
|
89
|
+
message.reservedOrderIds.push(reader.bytes());
|
|
90
|
+
continue;
|
|
91
|
+
}
|
|
81
92
|
}
|
|
82
93
|
if ((tag & 7) === 4 || tag === 0) {
|
|
83
94
|
break;
|
|
@@ -101,6 +112,9 @@ export const GenesisState = {
|
|
|
101
112
|
accountsDenomsOrdersCounts: globalThis.Array.isArray(object?.accountsDenomsOrdersCounts)
|
|
102
113
|
? object.accountsDenomsOrdersCounts.map((e) => AccountDenomOrdersCount.fromJSON(e))
|
|
103
114
|
: [],
|
|
115
|
+
reservedOrderIds: globalThis.Array.isArray(object?.reservedOrderIds)
|
|
116
|
+
? object.reservedOrderIds.map((e) => bytesFromBase64(e))
|
|
117
|
+
: [],
|
|
104
118
|
};
|
|
105
119
|
},
|
|
106
120
|
toJSON(message) {
|
|
@@ -120,6 +134,9 @@ export const GenesisState = {
|
|
|
120
134
|
if (message.accountsDenomsOrdersCounts?.length) {
|
|
121
135
|
obj.accountsDenomsOrdersCounts = message.accountsDenomsOrdersCounts.map((e) => AccountDenomOrdersCount.toJSON(e));
|
|
122
136
|
}
|
|
137
|
+
if (message.reservedOrderIds?.length) {
|
|
138
|
+
obj.reservedOrderIds = message.reservedOrderIds.map((e) => base64FromBytes(e));
|
|
139
|
+
}
|
|
123
140
|
return obj;
|
|
124
141
|
},
|
|
125
142
|
create(base) {
|
|
@@ -137,6 +154,7 @@ export const GenesisState = {
|
|
|
137
154
|
message.orderSequence = object.orderSequence ?? 0;
|
|
138
155
|
message.accountsDenomsOrdersCounts =
|
|
139
156
|
object.accountsDenomsOrdersCounts?.map((e) => AccountDenomOrdersCount.fromPartial(e)) || [];
|
|
157
|
+
message.reservedOrderIds = object.reservedOrderIds?.map((e) => e) || [];
|
|
140
158
|
return message;
|
|
141
159
|
},
|
|
142
160
|
};
|
|
@@ -149,7 +167,7 @@ export const OrderBookDataWithID = {
|
|
|
149
167
|
writer.uint32(8).uint32(message.id);
|
|
150
168
|
}
|
|
151
169
|
if (message.data !== undefined) {
|
|
152
|
-
OrderBookData.encode(message.data, writer.uint32(18).fork()).
|
|
170
|
+
OrderBookData.encode(message.data, writer.uint32(18).fork()).join();
|
|
153
171
|
}
|
|
154
172
|
return writer;
|
|
155
173
|
},
|
|
@@ -300,6 +318,31 @@ export const AccountDenomOrdersCount = {
|
|
|
300
318
|
return message;
|
|
301
319
|
},
|
|
302
320
|
};
|
|
321
|
+
function bytesFromBase64(b64) {
|
|
322
|
+
if (globalThis.Buffer) {
|
|
323
|
+
return Uint8Array.from(globalThis.Buffer.from(b64, "base64"));
|
|
324
|
+
}
|
|
325
|
+
else {
|
|
326
|
+
const bin = globalThis.atob(b64);
|
|
327
|
+
const arr = new Uint8Array(bin.length);
|
|
328
|
+
for (let i = 0; i < bin.length; ++i) {
|
|
329
|
+
arr[i] = bin.charCodeAt(i);
|
|
330
|
+
}
|
|
331
|
+
return arr;
|
|
332
|
+
}
|
|
333
|
+
}
|
|
334
|
+
function base64FromBytes(arr) {
|
|
335
|
+
if (globalThis.Buffer) {
|
|
336
|
+
return globalThis.Buffer.from(arr).toString("base64");
|
|
337
|
+
}
|
|
338
|
+
else {
|
|
339
|
+
const bin = [];
|
|
340
|
+
arr.forEach((byte) => {
|
|
341
|
+
bin.push(globalThis.String.fromCharCode(byte));
|
|
342
|
+
});
|
|
343
|
+
return globalThis.btoa(bin.join(""));
|
|
344
|
+
}
|
|
345
|
+
}
|
|
303
346
|
function longToNumber(int64) {
|
|
304
347
|
const num = globalThis.Number(int64.toString());
|
|
305
348
|
if (num > globalThis.Number.MAX_SAFE_INTEGER) {
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { BinaryReader, BinaryWriter } from "
|
|
2
|
-
import { Coin } from "
|
|
1
|
+
import { BinaryReader, BinaryWriter } from "@bufbuild/protobuf/wire";
|
|
2
|
+
import { Coin } from "./cosmos/cosmos-sdk/proto/cosmos/base/v1beta1/coin";
|
|
3
3
|
export declare const protobufPackage = "coreum.dex.v1";
|
|
4
4
|
/** Side is order side. */
|
|
5
5
|
export declare enum Side {
|
|
@@ -45,7 +45,7 @@ export declare function timeInForceToJSON(object: TimeInForce): string;
|
|
|
45
45
|
/** GoodTil is a good til order settings. */
|
|
46
46
|
export interface GoodTil {
|
|
47
47
|
/** good_til_block_height means that order remains active until a specific blockchain block height is reached. */
|
|
48
|
-
goodTilBlockHeight: number
|
|
48
|
+
goodTilBlockHeight: number;
|
|
49
49
|
/** good_til_block_time means that order remains active until a specific blockchain block time is reached. */
|
|
50
50
|
goodTilBlockTime: Date | undefined;
|
|
51
51
|
}
|
|
@@ -114,25 +114,6 @@ export interface OrderBookData {
|
|
|
114
114
|
/** quote_denom is quote order book denom */
|
|
115
115
|
quoteDenom: string;
|
|
116
116
|
}
|
|
117
|
-
/** OrderBookRecord is a single order book record, it combines both key and value from the store. */
|
|
118
|
-
export interface OrderBookRecord {
|
|
119
|
-
/** order_book_id is order book ID. */
|
|
120
|
-
orderBookId: number;
|
|
121
|
-
/** side is order side. */
|
|
122
|
-
side: Side;
|
|
123
|
-
/** price is order book record price. */
|
|
124
|
-
price: string;
|
|
125
|
-
/** order_sequence is order sequence. */
|
|
126
|
-
orderSequence: number;
|
|
127
|
-
/** order ID provided by the creator. */
|
|
128
|
-
orderId: string;
|
|
129
|
-
/** account_number is account number which corresponds the order creator. */
|
|
130
|
-
accountNumber: number;
|
|
131
|
-
/** remaining_base_quantity - is remaining quantity of base denom which user wants to sell or buy. */
|
|
132
|
-
remainingBaseQuantity: string;
|
|
133
|
-
/** remaining_spendable_balance - is balance up to which user wants to spend to execute the order. */
|
|
134
|
-
remainingSpendableBalance: string;
|
|
135
|
-
}
|
|
136
117
|
/** OrderBookRecordData is a single order book record used for the store. */
|
|
137
118
|
export interface OrderBookRecordData {
|
|
138
119
|
/** order ID provided by the creator. */
|
|
@@ -149,7 +130,6 @@ export declare const CancelGoodTil: MessageFns<CancelGoodTil>;
|
|
|
149
130
|
export declare const Order: MessageFns<Order>;
|
|
150
131
|
export declare const OrderData: MessageFns<OrderData>;
|
|
151
132
|
export declare const OrderBookData: MessageFns<OrderBookData>;
|
|
152
|
-
export declare const OrderBookRecord: MessageFns<OrderBookRecord>;
|
|
153
133
|
export declare const OrderBookRecordData: MessageFns<OrderBookRecordData>;
|
|
154
134
|
type Builtin = Date | Function | Uint8Array | string | number | boolean | undefined;
|
|
155
135
|
export type DeepPartial<T> = T extends Builtin ? T : T extends globalThis.Array<infer U> ? globalThis.Array<DeepPartial<U>> : T extends ReadonlyArray<infer U> ? ReadonlyArray<DeepPartial<U>> : T extends {} ? {
|
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
// Code generated by protoc-gen-ts_proto. DO NOT EDIT.
|
|
2
2
|
// versions:
|
|
3
|
-
// protoc-gen-ts_proto v2.
|
|
4
|
-
// protoc
|
|
3
|
+
// protoc-gen-ts_proto v2.7.0
|
|
4
|
+
// protoc v6.32.0
|
|
5
5
|
// source: coreum-protos/dex/order.proto
|
|
6
6
|
/* eslint-disable */
|
|
7
|
-
import { BinaryReader, BinaryWriter } from "
|
|
8
|
-
import { Coin } from "
|
|
9
|
-
import { Timestamp } from "
|
|
7
|
+
import { BinaryReader, BinaryWriter } from "@bufbuild/protobuf/wire";
|
|
8
|
+
import { Coin } from "./cosmos/cosmos-sdk/proto/cosmos/base/v1beta1/coin";
|
|
9
|
+
import { Timestamp } from "./google/protobuf/timestamp";
|
|
10
10
|
export const protobufPackage = "coreum.dex.v1";
|
|
11
11
|
/** Side is order side. */
|
|
12
12
|
export var Side;
|
|
@@ -150,7 +150,7 @@ export const GoodTil = {
|
|
|
150
150
|
writer.uint32(8).uint64(message.goodTilBlockHeight);
|
|
151
151
|
}
|
|
152
152
|
if (message.goodTilBlockTime !== undefined) {
|
|
153
|
-
Timestamp.encode(toTimestamp(message.goodTilBlockTime), writer.uint32(18).fork()).
|
|
153
|
+
Timestamp.encode(toTimestamp(message.goodTilBlockTime), writer.uint32(18).fork()).join();
|
|
154
154
|
}
|
|
155
155
|
return writer;
|
|
156
156
|
},
|
|
@@ -337,13 +337,13 @@ export const Order = {
|
|
|
337
337
|
writer.uint32(90).string(message.remainingSpendableBalance);
|
|
338
338
|
}
|
|
339
339
|
if (message.goodTil !== undefined) {
|
|
340
|
-
GoodTil.encode(message.goodTil, writer.uint32(98).fork()).
|
|
340
|
+
GoodTil.encode(message.goodTil, writer.uint32(98).fork()).join();
|
|
341
341
|
}
|
|
342
342
|
if (message.timeInForce !== 0) {
|
|
343
343
|
writer.uint32(104).int32(message.timeInForce);
|
|
344
344
|
}
|
|
345
345
|
if (message.reserve !== undefined) {
|
|
346
|
-
Coin.encode(message.reserve, writer.uint32(114).fork()).
|
|
346
|
+
Coin.encode(message.reserve, writer.uint32(114).fork()).join();
|
|
347
347
|
}
|
|
348
348
|
return writer;
|
|
349
349
|
},
|
|
@@ -597,10 +597,10 @@ export const OrderData = {
|
|
|
597
597
|
writer.uint32(40).int32(message.side);
|
|
598
598
|
}
|
|
599
599
|
if (message.goodTil !== undefined) {
|
|
600
|
-
GoodTil.encode(message.goodTil, writer.uint32(50).fork()).
|
|
600
|
+
GoodTil.encode(message.goodTil, writer.uint32(50).fork()).join();
|
|
601
601
|
}
|
|
602
602
|
if (message.reserve !== undefined) {
|
|
603
|
-
Coin.encode(message.reserve, writer.uint32(58).fork()).
|
|
603
|
+
Coin.encode(message.reserve, writer.uint32(58).fork()).join();
|
|
604
604
|
}
|
|
605
605
|
return writer;
|
|
606
606
|
},
|
|
@@ -805,183 +805,6 @@ export const OrderBookData = {
|
|
|
805
805
|
return message;
|
|
806
806
|
},
|
|
807
807
|
};
|
|
808
|
-
function createBaseOrderBookRecord() {
|
|
809
|
-
return {
|
|
810
|
-
orderBookId: 0,
|
|
811
|
-
side: 0,
|
|
812
|
-
price: "",
|
|
813
|
-
orderSequence: 0,
|
|
814
|
-
orderId: "",
|
|
815
|
-
accountNumber: 0,
|
|
816
|
-
remainingBaseQuantity: "",
|
|
817
|
-
remainingSpendableBalance: "",
|
|
818
|
-
};
|
|
819
|
-
}
|
|
820
|
-
export const OrderBookRecord = {
|
|
821
|
-
encode(message, writer = new BinaryWriter()) {
|
|
822
|
-
if (message.orderBookId !== 0) {
|
|
823
|
-
writer.uint32(8).uint32(message.orderBookId);
|
|
824
|
-
}
|
|
825
|
-
if (message.side !== 0) {
|
|
826
|
-
writer.uint32(16).int32(message.side);
|
|
827
|
-
}
|
|
828
|
-
if (message.price !== "") {
|
|
829
|
-
writer.uint32(26).string(message.price);
|
|
830
|
-
}
|
|
831
|
-
if (message.orderSequence !== 0) {
|
|
832
|
-
writer.uint32(32).uint64(message.orderSequence);
|
|
833
|
-
}
|
|
834
|
-
if (message.orderId !== "") {
|
|
835
|
-
writer.uint32(42).string(message.orderId);
|
|
836
|
-
}
|
|
837
|
-
if (message.accountNumber !== 0) {
|
|
838
|
-
writer.uint32(48).uint64(message.accountNumber);
|
|
839
|
-
}
|
|
840
|
-
if (message.remainingBaseQuantity !== "") {
|
|
841
|
-
writer.uint32(58).string(message.remainingBaseQuantity);
|
|
842
|
-
}
|
|
843
|
-
if (message.remainingSpendableBalance !== "") {
|
|
844
|
-
writer.uint32(66).string(message.remainingSpendableBalance);
|
|
845
|
-
}
|
|
846
|
-
return writer;
|
|
847
|
-
},
|
|
848
|
-
decode(input, length) {
|
|
849
|
-
const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
|
|
850
|
-
let end = length === undefined ? reader.len : reader.pos + length;
|
|
851
|
-
const message = createBaseOrderBookRecord();
|
|
852
|
-
while (reader.pos < end) {
|
|
853
|
-
const tag = reader.uint32();
|
|
854
|
-
switch (tag >>> 3) {
|
|
855
|
-
case 1: {
|
|
856
|
-
if (tag !== 8) {
|
|
857
|
-
break;
|
|
858
|
-
}
|
|
859
|
-
message.orderBookId = reader.uint32();
|
|
860
|
-
continue;
|
|
861
|
-
}
|
|
862
|
-
case 2: {
|
|
863
|
-
if (tag !== 16) {
|
|
864
|
-
break;
|
|
865
|
-
}
|
|
866
|
-
message.side = reader.int32();
|
|
867
|
-
continue;
|
|
868
|
-
}
|
|
869
|
-
case 3: {
|
|
870
|
-
if (tag !== 26) {
|
|
871
|
-
break;
|
|
872
|
-
}
|
|
873
|
-
message.price = reader.string();
|
|
874
|
-
continue;
|
|
875
|
-
}
|
|
876
|
-
case 4: {
|
|
877
|
-
if (tag !== 32) {
|
|
878
|
-
break;
|
|
879
|
-
}
|
|
880
|
-
message.orderSequence = longToNumber(reader.uint64());
|
|
881
|
-
continue;
|
|
882
|
-
}
|
|
883
|
-
case 5: {
|
|
884
|
-
if (tag !== 42) {
|
|
885
|
-
break;
|
|
886
|
-
}
|
|
887
|
-
message.orderId = reader.string();
|
|
888
|
-
continue;
|
|
889
|
-
}
|
|
890
|
-
case 6: {
|
|
891
|
-
if (tag !== 48) {
|
|
892
|
-
break;
|
|
893
|
-
}
|
|
894
|
-
message.accountNumber = longToNumber(reader.uint64());
|
|
895
|
-
continue;
|
|
896
|
-
}
|
|
897
|
-
case 7: {
|
|
898
|
-
if (tag !== 58) {
|
|
899
|
-
break;
|
|
900
|
-
}
|
|
901
|
-
message.remainingBaseQuantity = reader.string();
|
|
902
|
-
continue;
|
|
903
|
-
}
|
|
904
|
-
case 8: {
|
|
905
|
-
if (tag !== 66) {
|
|
906
|
-
break;
|
|
907
|
-
}
|
|
908
|
-
message.remainingSpendableBalance = reader.string();
|
|
909
|
-
continue;
|
|
910
|
-
}
|
|
911
|
-
}
|
|
912
|
-
if ((tag & 7) === 4 || tag === 0) {
|
|
913
|
-
break;
|
|
914
|
-
}
|
|
915
|
-
reader.skip(tag & 7);
|
|
916
|
-
}
|
|
917
|
-
return message;
|
|
918
|
-
},
|
|
919
|
-
fromJSON(object) {
|
|
920
|
-
return {
|
|
921
|
-
orderBookId: isSet(object.orderBookId)
|
|
922
|
-
? globalThis.Number(object.orderBookId)
|
|
923
|
-
: 0,
|
|
924
|
-
side: isSet(object.side) ? sideFromJSON(object.side) : 0,
|
|
925
|
-
price: isSet(object.price) ? globalThis.String(object.price) : "",
|
|
926
|
-
orderSequence: isSet(object.orderSequence)
|
|
927
|
-
? globalThis.Number(object.orderSequence)
|
|
928
|
-
: 0,
|
|
929
|
-
orderId: isSet(object.orderId) ? globalThis.String(object.orderId) : "",
|
|
930
|
-
accountNumber: isSet(object.accountNumber)
|
|
931
|
-
? globalThis.Number(object.accountNumber)
|
|
932
|
-
: 0,
|
|
933
|
-
remainingBaseQuantity: isSet(object.remainingBaseQuantity)
|
|
934
|
-
? globalThis.String(object.remainingBaseQuantity)
|
|
935
|
-
: "",
|
|
936
|
-
remainingSpendableBalance: isSet(object.remainingSpendableBalance)
|
|
937
|
-
? globalThis.String(object.remainingSpendableBalance)
|
|
938
|
-
: "",
|
|
939
|
-
};
|
|
940
|
-
},
|
|
941
|
-
toJSON(message) {
|
|
942
|
-
const obj = {};
|
|
943
|
-
if (message.orderBookId !== 0) {
|
|
944
|
-
obj.orderBookId = Math.round(message.orderBookId);
|
|
945
|
-
}
|
|
946
|
-
if (message.side !== 0) {
|
|
947
|
-
obj.side = sideToJSON(message.side);
|
|
948
|
-
}
|
|
949
|
-
if (message.price !== "") {
|
|
950
|
-
obj.price = message.price;
|
|
951
|
-
}
|
|
952
|
-
if (message.orderSequence !== 0) {
|
|
953
|
-
obj.orderSequence = Math.round(message.orderSequence);
|
|
954
|
-
}
|
|
955
|
-
if (message.orderId !== "") {
|
|
956
|
-
obj.orderId = message.orderId;
|
|
957
|
-
}
|
|
958
|
-
if (message.accountNumber !== 0) {
|
|
959
|
-
obj.accountNumber = Math.round(message.accountNumber);
|
|
960
|
-
}
|
|
961
|
-
if (message.remainingBaseQuantity !== "") {
|
|
962
|
-
obj.remainingBaseQuantity = message.remainingBaseQuantity;
|
|
963
|
-
}
|
|
964
|
-
if (message.remainingSpendableBalance !== "") {
|
|
965
|
-
obj.remainingSpendableBalance = message.remainingSpendableBalance;
|
|
966
|
-
}
|
|
967
|
-
return obj;
|
|
968
|
-
},
|
|
969
|
-
create(base) {
|
|
970
|
-
return OrderBookRecord.fromPartial(base ?? {});
|
|
971
|
-
},
|
|
972
|
-
fromPartial(object) {
|
|
973
|
-
const message = createBaseOrderBookRecord();
|
|
974
|
-
message.orderBookId = object.orderBookId ?? 0;
|
|
975
|
-
message.side = object.side ?? 0;
|
|
976
|
-
message.price = object.price ?? "";
|
|
977
|
-
message.orderSequence = object.orderSequence ?? 0;
|
|
978
|
-
message.orderId = object.orderId ?? "";
|
|
979
|
-
message.accountNumber = object.accountNumber ?? 0;
|
|
980
|
-
message.remainingBaseQuantity = object.remainingBaseQuantity ?? "";
|
|
981
|
-
message.remainingSpendableBalance = object.remainingSpendableBalance ?? "";
|
|
982
|
-
return message;
|
|
983
|
-
},
|
|
984
|
-
};
|
|
985
808
|
function createBaseOrderBookRecordData() {
|
|
986
809
|
return {
|
|
987
810
|
orderId: "",
|
|
@@ -1094,13 +917,12 @@ export const OrderBookRecordData = {
|
|
|
1094
917
|
function toTimestamp(date) {
|
|
1095
918
|
const seconds = Math.trunc(date.getTime() / 1_000);
|
|
1096
919
|
const nanos = (date.getTime() % 1_000) * 1_000_000;
|
|
1097
|
-
return { seconds
|
|
920
|
+
return { seconds, nanos };
|
|
1098
921
|
}
|
|
1099
922
|
function fromTimestamp(t) {
|
|
1100
|
-
|
|
1101
|
-
|
|
1102
|
-
|
|
1103
|
-
return new Date(Number(millis));
|
|
923
|
+
let millis = (t.seconds || 0) * 1_000;
|
|
924
|
+
millis += (t.nanos || 0) / 1_000_000;
|
|
925
|
+
return new globalThis.Date(millis);
|
|
1104
926
|
}
|
|
1105
927
|
function fromJsonTimestamp(o) {
|
|
1106
928
|
if (o instanceof globalThis.Date) {
|
|
@@ -1,12 +1,14 @@
|
|
|
1
|
-
import { BinaryReader, BinaryWriter } from "
|
|
2
|
-
import { Coin } from "
|
|
1
|
+
import { BinaryReader, BinaryWriter } from "@bufbuild/protobuf/wire";
|
|
2
|
+
import { Coin } from "./cosmos/cosmos-sdk/proto/cosmos/base/v1beta1/coin";
|
|
3
3
|
export declare const protobufPackage = "coreum.dex.v1";
|
|
4
4
|
/** Params keeps gov manageable parameters. */
|
|
5
5
|
export interface Params {
|
|
6
6
|
/** default_unified_ref_amount is the default approximate amount you need to buy 1USD, used to for tokens without custom value */
|
|
7
7
|
defaultUnifiedRefAmount: string;
|
|
8
|
-
/** price_tick_exponent is the exponent used
|
|
8
|
+
/** price_tick_exponent is the exponent used in price tick calculation formula */
|
|
9
9
|
priceTickExponent: number;
|
|
10
|
+
/** quantity_step_exponent is the exponent used in quantity step calculation formula */
|
|
11
|
+
quantityStepExponent: number;
|
|
10
12
|
/** max_orders_per_denom is the maximum number of orders per denom the user can have */
|
|
11
13
|
maxOrdersPerDenom: number;
|
|
12
14
|
/** order_reserve is the reserve required to save the order in the order book */
|
|
@@ -1,16 +1,17 @@
|
|
|
1
1
|
// Code generated by protoc-gen-ts_proto. DO NOT EDIT.
|
|
2
2
|
// versions:
|
|
3
|
-
// protoc-gen-ts_proto v2.
|
|
4
|
-
// protoc
|
|
3
|
+
// protoc-gen-ts_proto v2.7.0
|
|
4
|
+
// protoc v6.32.0
|
|
5
5
|
// source: coreum-protos/dex/params.proto
|
|
6
6
|
/* eslint-disable */
|
|
7
|
-
import { BinaryReader, BinaryWriter } from "
|
|
8
|
-
import { Coin } from "
|
|
7
|
+
import { BinaryReader, BinaryWriter } from "@bufbuild/protobuf/wire";
|
|
8
|
+
import { Coin } from "./cosmos/cosmos-sdk/proto/cosmos/base/v1beta1/coin";
|
|
9
9
|
export const protobufPackage = "coreum.dex.v1";
|
|
10
10
|
function createBaseParams() {
|
|
11
11
|
return {
|
|
12
12
|
defaultUnifiedRefAmount: "",
|
|
13
13
|
priceTickExponent: 0,
|
|
14
|
+
quantityStepExponent: 0,
|
|
14
15
|
maxOrdersPerDenom: 0,
|
|
15
16
|
orderReserve: undefined,
|
|
16
17
|
};
|
|
@@ -23,11 +24,14 @@ export const Params = {
|
|
|
23
24
|
if (message.priceTickExponent !== 0) {
|
|
24
25
|
writer.uint32(16).int32(message.priceTickExponent);
|
|
25
26
|
}
|
|
27
|
+
if (message.quantityStepExponent !== 0) {
|
|
28
|
+
writer.uint32(40).int32(message.quantityStepExponent);
|
|
29
|
+
}
|
|
26
30
|
if (message.maxOrdersPerDenom !== 0) {
|
|
27
31
|
writer.uint32(24).uint64(message.maxOrdersPerDenom);
|
|
28
32
|
}
|
|
29
33
|
if (message.orderReserve !== undefined) {
|
|
30
|
-
Coin.encode(message.orderReserve, writer.uint32(34).fork()).
|
|
34
|
+
Coin.encode(message.orderReserve, writer.uint32(34).fork()).join();
|
|
31
35
|
}
|
|
32
36
|
return writer;
|
|
33
37
|
},
|
|
@@ -52,6 +56,13 @@ export const Params = {
|
|
|
52
56
|
message.priceTickExponent = reader.int32();
|
|
53
57
|
continue;
|
|
54
58
|
}
|
|
59
|
+
case 5: {
|
|
60
|
+
if (tag !== 40) {
|
|
61
|
+
break;
|
|
62
|
+
}
|
|
63
|
+
message.quantityStepExponent = reader.int32();
|
|
64
|
+
continue;
|
|
65
|
+
}
|
|
55
66
|
case 3: {
|
|
56
67
|
if (tag !== 24) {
|
|
57
68
|
break;
|
|
@@ -82,6 +93,9 @@ export const Params = {
|
|
|
82
93
|
priceTickExponent: isSet(object.priceTickExponent)
|
|
83
94
|
? globalThis.Number(object.priceTickExponent)
|
|
84
95
|
: 0,
|
|
96
|
+
quantityStepExponent: isSet(object.quantityStepExponent)
|
|
97
|
+
? globalThis.Number(object.quantityStepExponent)
|
|
98
|
+
: 0,
|
|
85
99
|
maxOrdersPerDenom: isSet(object.maxOrdersPerDenom)
|
|
86
100
|
? globalThis.Number(object.maxOrdersPerDenom)
|
|
87
101
|
: 0,
|
|
@@ -98,6 +112,9 @@ export const Params = {
|
|
|
98
112
|
if (message.priceTickExponent !== 0) {
|
|
99
113
|
obj.priceTickExponent = Math.round(message.priceTickExponent);
|
|
100
114
|
}
|
|
115
|
+
if (message.quantityStepExponent !== 0) {
|
|
116
|
+
obj.quantityStepExponent = Math.round(message.quantityStepExponent);
|
|
117
|
+
}
|
|
101
118
|
if (message.maxOrdersPerDenom !== 0) {
|
|
102
119
|
obj.maxOrdersPerDenom = Math.round(message.maxOrdersPerDenom);
|
|
103
120
|
}
|
|
@@ -113,6 +130,7 @@ export const Params = {
|
|
|
113
130
|
const message = createBaseParams();
|
|
114
131
|
message.defaultUnifiedRefAmount = object.defaultUnifiedRefAmount ?? "";
|
|
115
132
|
message.priceTickExponent = object.priceTickExponent ?? 0;
|
|
133
|
+
message.quantityStepExponent = object.quantityStepExponent ?? 0;
|
|
116
134
|
message.maxOrdersPerDenom = object.maxOrdersPerDenom ?? 0;
|
|
117
135
|
message.orderReserve =
|
|
118
136
|
object.orderReserve !== undefined && object.orderReserve !== null
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { BinaryReader, BinaryWriter } from "
|
|
2
|
-
import { PageRequest, PageResponse } from "
|
|
1
|
+
import { BinaryReader, BinaryWriter } from "@bufbuild/protobuf/wire";
|
|
2
|
+
import { PageRequest, PageResponse } from "./cosmos/cosmos-sdk/proto/cosmos/base/query/v1beta1/pagination";
|
|
3
3
|
import { Order, OrderBookData, Side } from "./order";
|
|
4
4
|
import { Params } from "./params";
|
|
5
5
|
export declare const protobufPackage = "coreum.dex.v1";
|