@injectivelabs/sdk-ts 1.19.4 → 1.19.6
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/cjs/{DirectEthSecp256k1Wallet-B47wfyu3.cjs → DirectEthSecp256k1Wallet-BWF4bTRg.cjs} +1 -1
- package/dist/cjs/{ExecArgNeptuneWithdraw-DJWhAi2w.cjs → ExecArgNeptuneWithdraw-DNeBN5p6.cjs} +1 -1
- package/dist/cjs/{MsgBase-B3DOk7mn.cjs → MsgBase-CAiwUyBz.cjs} +53 -1
- package/dist/cjs/{MsgSetDenomMetadata-CDhuDaSe.cjs → MsgSetDenomMetadata-LBaVHPTZ.cjs} +3145 -565
- package/dist/cjs/{QueryTradingStrategyContractTotalStrategies-BiIMpmJw.cjs → QueryTradingStrategyContractTotalStrategies-HVnqU1yl.cjs} +1 -1
- package/dist/cjs/{StreamManagerV2-DKU1HxNh.cjs → StreamManagerV2-XG-0fX_C.cjs} +4 -1
- package/dist/cjs/{accounts-CCczSIa8.cjs → accounts-Rcz0OUDn.cjs} +1 -1
- package/dist/cjs/client/chain.d.cts +1 -1
- package/dist/cjs/client/indexer.cjs +1 -1
- package/dist/cjs/client/indexer.d.cts +1 -1
- package/dist/cjs/client/wasm.cjs +3 -3
- package/dist/cjs/core/accounts.cjs +2 -2
- package/dist/cjs/core/accounts.d.cts +1 -1
- package/dist/cjs/core/modules.cjs +31 -5
- package/dist/cjs/core/modules.d.cts +2 -2
- package/dist/cjs/core/tx.cjs +4 -3
- package/dist/cjs/core/tx.d.cts +2 -2
- package/dist/cjs/cosmjs.cjs +4 -4
- package/dist/cjs/exports.cjs +4 -4
- package/dist/cjs/{index-VKrX1Enj.d.cts → index-DYNILG8y.d.cts} +4516 -1407
- package/dist/cjs/index.cjs +34 -7
- package/dist/cjs/index.d.cts +2 -2
- package/dist/cjs/{tx-D7F4nbJj.cjs → tx-BLPNQat_.cjs} +1 -1
- package/dist/cjs/utils.d.cts +1 -1
- package/dist/esm/{DirectEthSecp256k1Wallet-bZZ4bjk5.js → DirectEthSecp256k1Wallet-6nqAaBW9.js} +1 -1
- package/dist/esm/{ExecArgNeptuneWithdraw-DRCUYj-r.js → ExecArgNeptuneWithdraw-mI_hNm4-.js} +1 -1
- package/dist/esm/{MsgBase-De14KlFJ.js → MsgBase-CpH99FqH.js} +48 -2
- package/dist/esm/{MsgSetDenomMetadata-_b5Klju5.js → MsgSetDenomMetadata-CWhjd9Yp.js} +2871 -449
- package/dist/esm/{QueryTradingStrategyContractTotalStrategies-BhAe-C30.js → QueryTradingStrategyContractTotalStrategies-D6IBqS_q.js} +1 -1
- package/dist/esm/{StreamManagerV2-DrJDfnKY.js → StreamManagerV2-DSRSyzg6.js} +4 -1
- package/dist/esm/{accounts-B_eo5rUB.js → accounts-C3KF9pTp.js} +1 -1
- package/dist/esm/client/chain.d.ts +1 -1
- package/dist/esm/client/indexer.d.ts +1 -1
- package/dist/esm/client/indexer.js +1 -1
- package/dist/esm/client/wasm.js +3 -3
- package/dist/esm/core/accounts.d.ts +1 -1
- package/dist/esm/core/accounts.js +2 -2
- package/dist/esm/core/modules.d.ts +2 -2
- package/dist/esm/core/modules.js +6 -6
- package/dist/esm/core/tx.d.ts +2 -2
- package/dist/esm/core/tx.js +4 -4
- package/dist/esm/cosmjs.js +4 -4
- package/dist/esm/exports.js +4 -4
- package/dist/esm/{index-DFTOkhWv.d.ts → index-DvOw3RHi.d.ts} +4516 -1407
- package/dist/esm/index.d.ts +2 -2
- package/dist/esm/index.js +8 -8
- package/dist/esm/{tx-Cb1fEFK8.js → tx-QGNUs1B0.js} +1 -1
- package/dist/esm/utils.d.ts +1 -1
- package/package.json +5 -5
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
const require_chunk = require('./chunk-CbDLau6x.cjs');
|
|
2
2
|
const require_utils = require('./utils-Bfjw459k.cjs');
|
|
3
3
|
const require_defineProperty = require('./defineProperty-DAtJs5JQ.cjs');
|
|
4
|
-
const require_accounts = require('./accounts-
|
|
5
|
-
const require_MsgBase = require('./MsgBase-
|
|
4
|
+
const require_accounts = require('./accounts-Rcz0OUDn.cjs');
|
|
5
|
+
const require_MsgBase = require('./MsgBase-CAiwUyBz.cjs');
|
|
6
6
|
const require_ChainGrpcExchangeApi = require('./ChainGrpcExchangeApi-Ch1SgMjY.cjs');
|
|
7
|
-
const require_ExecArgNeptuneWithdraw = require('./ExecArgNeptuneWithdraw-
|
|
7
|
+
const require_ExecArgNeptuneWithdraw = require('./ExecArgNeptuneWithdraw-DNeBN5p6.cjs');
|
|
8
8
|
let viem = require("viem");
|
|
9
9
|
let __injectivelabs_utils = require("@injectivelabs/utils");
|
|
10
10
|
let __injectivelabs_exceptions = require("@injectivelabs/exceptions");
|
|
@@ -14,12 +14,16 @@ let __injectivelabs_core_proto_ts_v2_generated_cosmos_base_v1beta1_coin_pb = req
|
|
|
14
14
|
__injectivelabs_core_proto_ts_v2_generated_cosmos_base_v1beta1_coin_pb = require_chunk.__toESM(__injectivelabs_core_proto_ts_v2_generated_cosmos_base_v1beta1_coin_pb);
|
|
15
15
|
let __injectivelabs_core_proto_ts_v2_generated_injective_exchange_v1beta1_tx_pb = require("@injectivelabs/core-proto-ts-v2/generated/injective/exchange/v1beta1/tx_pb");
|
|
16
16
|
__injectivelabs_core_proto_ts_v2_generated_injective_exchange_v1beta1_tx_pb = require_chunk.__toESM(__injectivelabs_core_proto_ts_v2_generated_injective_exchange_v1beta1_tx_pb);
|
|
17
|
-
let __injectivelabs_core_proto_ts_v2_generated_injective_exchange_v1beta1_exchange_pb = require("@injectivelabs/core-proto-ts-v2/generated/injective/exchange/v1beta1/exchange_pb");
|
|
18
|
-
__injectivelabs_core_proto_ts_v2_generated_injective_exchange_v1beta1_exchange_pb = require_chunk.__toESM(__injectivelabs_core_proto_ts_v2_generated_injective_exchange_v1beta1_exchange_pb);
|
|
19
17
|
let __injectivelabs_core_proto_ts_v2_generated_injective_exchange_v2_tx_pb = require("@injectivelabs/core-proto-ts-v2/generated/injective/exchange/v2/tx_pb");
|
|
20
18
|
__injectivelabs_core_proto_ts_v2_generated_injective_exchange_v2_tx_pb = require_chunk.__toESM(__injectivelabs_core_proto_ts_v2_generated_injective_exchange_v2_tx_pb);
|
|
19
|
+
let __injectivelabs_core_proto_ts_v2_generated_injective_exchange_v1beta1_exchange_pb = require("@injectivelabs/core-proto-ts-v2/generated/injective/exchange/v1beta1/exchange_pb");
|
|
20
|
+
__injectivelabs_core_proto_ts_v2_generated_injective_exchange_v1beta1_exchange_pb = require_chunk.__toESM(__injectivelabs_core_proto_ts_v2_generated_injective_exchange_v1beta1_exchange_pb);
|
|
21
|
+
let __injectivelabs_core_proto_ts_v2_generated_injective_exchange_v2_order_pb = require("@injectivelabs/core-proto-ts-v2/generated/injective/exchange/v2/order_pb");
|
|
22
|
+
__injectivelabs_core_proto_ts_v2_generated_injective_exchange_v2_order_pb = require_chunk.__toESM(__injectivelabs_core_proto_ts_v2_generated_injective_exchange_v2_order_pb);
|
|
21
23
|
let __injectivelabs_core_proto_ts_v2_generated_injective_oracle_v1beta1_oracle_pb = require("@injectivelabs/core-proto-ts-v2/generated/injective/oracle/v1beta1/oracle_pb");
|
|
22
24
|
__injectivelabs_core_proto_ts_v2_generated_injective_oracle_v1beta1_oracle_pb = require_chunk.__toESM(__injectivelabs_core_proto_ts_v2_generated_injective_oracle_v1beta1_oracle_pb);
|
|
25
|
+
let __injectivelabs_core_proto_ts_v2_generated_injective_exchange_v2_market_pb = require("@injectivelabs/core-proto-ts-v2/generated/injective/exchange/v2/market_pb");
|
|
26
|
+
__injectivelabs_core_proto_ts_v2_generated_injective_exchange_v2_market_pb = require_chunk.__toESM(__injectivelabs_core_proto_ts_v2_generated_injective_exchange_v2_market_pb);
|
|
23
27
|
let __injectivelabs_networks = require("@injectivelabs/networks");
|
|
24
28
|
let __injectivelabs_core_proto_ts_v2_generated_cosmos_gov_v1_gov_pb = require("@injectivelabs/core-proto-ts-v2/generated/cosmos/gov/v1/gov_pb");
|
|
25
29
|
__injectivelabs_core_proto_ts_v2_generated_cosmos_gov_v1_gov_pb = require_chunk.__toESM(__injectivelabs_core_proto_ts_v2_generated_cosmos_gov_v1_gov_pb);
|
|
@@ -201,6 +205,171 @@ var MsgWithdraw = class MsgWithdraw extends require_MsgBase.MsgBase {
|
|
|
201
205
|
}
|
|
202
206
|
};
|
|
203
207
|
|
|
208
|
+
//#endregion
|
|
209
|
+
//#region src/core/modules/exchange/msgs/MsgDepositV2.ts
|
|
210
|
+
/**
|
|
211
|
+
* @category Messages
|
|
212
|
+
*/
|
|
213
|
+
var MsgDepositV2 = class MsgDepositV2 extends require_MsgBase.MsgBase {
|
|
214
|
+
static fromJSON(params) {
|
|
215
|
+
return new MsgDepositV2(params);
|
|
216
|
+
}
|
|
217
|
+
toProto() {
|
|
218
|
+
const { params } = this;
|
|
219
|
+
const amountCoin = __injectivelabs_core_proto_ts_v2_generated_cosmos_base_v1beta1_coin_pb.Coin.create({
|
|
220
|
+
denom: params.amount.denom,
|
|
221
|
+
amount: params.amount.amount
|
|
222
|
+
});
|
|
223
|
+
return __injectivelabs_core_proto_ts_v2_generated_injective_exchange_v2_tx_pb.MsgDeposit.create({
|
|
224
|
+
sender: params.injectiveAddress,
|
|
225
|
+
subaccountId: params.subaccountId,
|
|
226
|
+
amount: amountCoin
|
|
227
|
+
});
|
|
228
|
+
}
|
|
229
|
+
toData() {
|
|
230
|
+
const proto = this.toProto();
|
|
231
|
+
return {
|
|
232
|
+
"@type": "/injective.exchange.v2.MsgDeposit",
|
|
233
|
+
...proto
|
|
234
|
+
};
|
|
235
|
+
}
|
|
236
|
+
toAmino() {
|
|
237
|
+
const proto = this.toProto();
|
|
238
|
+
return {
|
|
239
|
+
type: "exchange/MsgDeposit",
|
|
240
|
+
value: {
|
|
241
|
+
sender: proto.sender,
|
|
242
|
+
subaccount_id: proto.subaccountId,
|
|
243
|
+
amount: proto.amount
|
|
244
|
+
}
|
|
245
|
+
};
|
|
246
|
+
}
|
|
247
|
+
toWeb3Gw() {
|
|
248
|
+
const { value } = this.toAmino();
|
|
249
|
+
return {
|
|
250
|
+
"@type": "/injective.exchange.v2.MsgDeposit",
|
|
251
|
+
...value
|
|
252
|
+
};
|
|
253
|
+
}
|
|
254
|
+
toDirectSign() {
|
|
255
|
+
return {
|
|
256
|
+
type: "/injective.exchange.v2.MsgDeposit",
|
|
257
|
+
message: this.toProto()
|
|
258
|
+
};
|
|
259
|
+
}
|
|
260
|
+
toBinary() {
|
|
261
|
+
return __injectivelabs_core_proto_ts_v2_generated_injective_exchange_v2_tx_pb.MsgDeposit.toBinary(this.toProto());
|
|
262
|
+
}
|
|
263
|
+
};
|
|
264
|
+
|
|
265
|
+
//#endregion
|
|
266
|
+
//#region src/core/modules/exchange/msgs/MsgSignDataV2.ts
|
|
267
|
+
/**
|
|
268
|
+
* @category Messages
|
|
269
|
+
*/
|
|
270
|
+
var MsgSignDataV2 = class MsgSignDataV2 extends require_MsgBase.MsgBase {
|
|
271
|
+
static fromJSON(params) {
|
|
272
|
+
return new MsgSignDataV2(params);
|
|
273
|
+
}
|
|
274
|
+
toProto() {
|
|
275
|
+
const { params } = this;
|
|
276
|
+
return __injectivelabs_core_proto_ts_v2_generated_injective_exchange_v2_tx_pb.MsgSignData.create({
|
|
277
|
+
signer: require_utils.hexToUint8Array(require_utils.getEthereumAddress(params.sender)),
|
|
278
|
+
data: require_utils.stringToUint8Array(require_utils.toUtf8(params.data))
|
|
279
|
+
});
|
|
280
|
+
}
|
|
281
|
+
toData() {
|
|
282
|
+
const proto = this.toProto();
|
|
283
|
+
return {
|
|
284
|
+
"@type": "/injective.exchange.v2.MsgSignData",
|
|
285
|
+
...proto
|
|
286
|
+
};
|
|
287
|
+
}
|
|
288
|
+
toAmino() {
|
|
289
|
+
const proto = this.toProto();
|
|
290
|
+
return {
|
|
291
|
+
type: "sign/MsgSignData",
|
|
292
|
+
value: {
|
|
293
|
+
signer: require_utils.uint8ArrayToHex(proto.signer),
|
|
294
|
+
data: require_utils.toUtf8(proto.data)
|
|
295
|
+
}
|
|
296
|
+
};
|
|
297
|
+
}
|
|
298
|
+
toWeb3Gw() {
|
|
299
|
+
const { value } = this.toAmino();
|
|
300
|
+
return {
|
|
301
|
+
"@type": "/injective.exchange.v2.MsgSignData",
|
|
302
|
+
...value
|
|
303
|
+
};
|
|
304
|
+
}
|
|
305
|
+
toDirectSign() {
|
|
306
|
+
return {
|
|
307
|
+
type: "/injective.exchange.v2.MsgSignData",
|
|
308
|
+
message: this.toProto()
|
|
309
|
+
};
|
|
310
|
+
}
|
|
311
|
+
toBinary() {
|
|
312
|
+
return __injectivelabs_core_proto_ts_v2_generated_injective_exchange_v2_tx_pb.MsgSignData.toBinary(this.toProto());
|
|
313
|
+
}
|
|
314
|
+
};
|
|
315
|
+
|
|
316
|
+
//#endregion
|
|
317
|
+
//#region src/core/modules/exchange/msgs/MsgWithdrawV2.ts
|
|
318
|
+
/**
|
|
319
|
+
* @category Messages
|
|
320
|
+
*/
|
|
321
|
+
var MsgWithdrawV2 = class MsgWithdrawV2 extends require_MsgBase.MsgBase {
|
|
322
|
+
static fromJSON(params) {
|
|
323
|
+
return new MsgWithdrawV2(params);
|
|
324
|
+
}
|
|
325
|
+
toProto() {
|
|
326
|
+
const { params } = this;
|
|
327
|
+
const amountCoin = __injectivelabs_core_proto_ts_v2_generated_cosmos_base_v1beta1_coin_pb.Coin.create({
|
|
328
|
+
denom: params.amount.denom,
|
|
329
|
+
amount: params.amount.amount
|
|
330
|
+
});
|
|
331
|
+
return __injectivelabs_core_proto_ts_v2_generated_injective_exchange_v2_tx_pb.MsgWithdraw.create({
|
|
332
|
+
sender: params.injectiveAddress,
|
|
333
|
+
subaccountId: params.subaccountId,
|
|
334
|
+
amount: amountCoin
|
|
335
|
+
});
|
|
336
|
+
}
|
|
337
|
+
toData() {
|
|
338
|
+
const proto = this.toProto();
|
|
339
|
+
return {
|
|
340
|
+
"@type": "/injective.exchange.v2.MsgWithdraw",
|
|
341
|
+
...proto
|
|
342
|
+
};
|
|
343
|
+
}
|
|
344
|
+
toAmino() {
|
|
345
|
+
const proto = this.toProto();
|
|
346
|
+
return {
|
|
347
|
+
type: "exchange/MsgWithdraw",
|
|
348
|
+
value: {
|
|
349
|
+
sender: proto.sender,
|
|
350
|
+
subaccount_id: proto.subaccountId,
|
|
351
|
+
amount: proto.amount
|
|
352
|
+
}
|
|
353
|
+
};
|
|
354
|
+
}
|
|
355
|
+
toWeb3Gw() {
|
|
356
|
+
const { value } = this.toAmino();
|
|
357
|
+
return {
|
|
358
|
+
"@type": "/injective.exchange.v2.MsgWithdraw",
|
|
359
|
+
...value
|
|
360
|
+
};
|
|
361
|
+
}
|
|
362
|
+
toDirectSign() {
|
|
363
|
+
return {
|
|
364
|
+
type: "/injective.exchange.v2.MsgWithdraw",
|
|
365
|
+
message: this.toProto()
|
|
366
|
+
};
|
|
367
|
+
}
|
|
368
|
+
toBinary() {
|
|
369
|
+
return __injectivelabs_core_proto_ts_v2_generated_injective_exchange_v2_tx_pb.MsgWithdraw.toBinary(this.toProto());
|
|
370
|
+
}
|
|
371
|
+
};
|
|
372
|
+
|
|
204
373
|
//#endregion
|
|
205
374
|
//#region src/core/modules/exchange/msgs/MsgRewardsOptOut.ts
|
|
206
375
|
/**
|
|
@@ -302,6 +471,50 @@ var MsgCancelSpotOrder = class MsgCancelSpotOrder extends require_MsgBase.MsgBas
|
|
|
302
471
|
}
|
|
303
472
|
};
|
|
304
473
|
|
|
474
|
+
//#endregion
|
|
475
|
+
//#region src/core/modules/exchange/msgs/MsgRewardsOptOutV2.ts
|
|
476
|
+
/**
|
|
477
|
+
* @category Messages
|
|
478
|
+
*/
|
|
479
|
+
var MsgRewardsOptOutV2 = class MsgRewardsOptOutV2 extends require_MsgBase.MsgBase {
|
|
480
|
+
static fromJSON(params) {
|
|
481
|
+
return new MsgRewardsOptOutV2(params);
|
|
482
|
+
}
|
|
483
|
+
toProto() {
|
|
484
|
+
const { params } = this;
|
|
485
|
+
return __injectivelabs_core_proto_ts_v2_generated_injective_exchange_v2_tx_pb.MsgRewardsOptOut.create({ sender: params.sender });
|
|
486
|
+
}
|
|
487
|
+
toData() {
|
|
488
|
+
const proto = this.toProto();
|
|
489
|
+
return {
|
|
490
|
+
"@type": "/injective.exchange.v2.MsgRewardsOptOut",
|
|
491
|
+
...proto
|
|
492
|
+
};
|
|
493
|
+
}
|
|
494
|
+
toAmino() {
|
|
495
|
+
return {
|
|
496
|
+
type: "exchange/MsgRewardsOptOut",
|
|
497
|
+
value: { sender: this.toProto().sender }
|
|
498
|
+
};
|
|
499
|
+
}
|
|
500
|
+
toWeb3Gw() {
|
|
501
|
+
const { value } = this.toAmino();
|
|
502
|
+
return {
|
|
503
|
+
"@type": "/injective.exchange.v2.MsgRewardsOptOut",
|
|
504
|
+
...value
|
|
505
|
+
};
|
|
506
|
+
}
|
|
507
|
+
toDirectSign() {
|
|
508
|
+
return {
|
|
509
|
+
type: "/injective.exchange.v2.MsgRewardsOptOut",
|
|
510
|
+
message: this.toProto()
|
|
511
|
+
};
|
|
512
|
+
}
|
|
513
|
+
toBinary() {
|
|
514
|
+
return __injectivelabs_core_proto_ts_v2_generated_injective_exchange_v2_tx_pb.MsgRewardsOptOut.toBinary(this.toProto());
|
|
515
|
+
}
|
|
516
|
+
};
|
|
517
|
+
|
|
305
518
|
//#endregion
|
|
306
519
|
//#region src/core/modules/exchange/msgs/MsgExternalTransfer.ts
|
|
307
520
|
/**
|
|
@@ -363,7 +576,7 @@ var MsgExternalTransfer = class MsgExternalTransfer extends require_MsgBase.MsgB
|
|
|
363
576
|
|
|
364
577
|
//#endregion
|
|
365
578
|
//#region src/core/modules/exchange/msgs/MsgBatchUpdateOrders.ts
|
|
366
|
-
const createSpotOrder = (args) => {
|
|
579
|
+
const createSpotOrder$1 = (args) => {
|
|
367
580
|
const orderInfo = __injectivelabs_core_proto_ts_v2_generated_injective_exchange_v1beta1_exchange_pb.OrderInfo.create({
|
|
368
581
|
subaccountId: args.subaccountId,
|
|
369
582
|
feeRecipient: args.feeRecipient,
|
|
@@ -378,7 +591,7 @@ const createSpotOrder = (args) => {
|
|
|
378
591
|
triggerPrice: args.triggerPrice
|
|
379
592
|
});
|
|
380
593
|
};
|
|
381
|
-
const createDerivativeOrder = (args) => {
|
|
594
|
+
const createDerivativeOrder$1 = (args) => {
|
|
382
595
|
const orderInfo = __injectivelabs_core_proto_ts_v2_generated_injective_exchange_v1beta1_exchange_pb.OrderInfo.create({
|
|
383
596
|
subaccountId: args.subaccountId,
|
|
384
597
|
feeRecipient: args.feeRecipient,
|
|
@@ -394,7 +607,7 @@ const createDerivativeOrder = (args) => {
|
|
|
394
607
|
triggerPrice: args.triggerPrice
|
|
395
608
|
});
|
|
396
609
|
};
|
|
397
|
-
const createBinaryOptionOrder = (args) => {
|
|
610
|
+
const createBinaryOptionOrder$1 = (args) => {
|
|
398
611
|
const orderInfo = __injectivelabs_core_proto_ts_v2_generated_injective_exchange_v1beta1_exchange_pb.OrderInfo.create({
|
|
399
612
|
subaccountId: args.subaccountId,
|
|
400
613
|
feeRecipient: args.feeRecipient,
|
|
@@ -410,7 +623,7 @@ const createBinaryOptionOrder = (args) => {
|
|
|
410
623
|
triggerPrice: args.triggerPrice
|
|
411
624
|
});
|
|
412
625
|
};
|
|
413
|
-
const createMsgAndCancelOrders = (params) => {
|
|
626
|
+
const createMsgAndCancelOrders$1 = (params) => {
|
|
414
627
|
const hasCancelAll = params.spotMarketIdsToCancelAll && params.spotMarketIdsToCancelAll.length > 0 || params.derivativeMarketIdsToCancelAll && params.derivativeMarketIdsToCancelAll.length > 0 || params.binaryOptionsMarketIdsToCancelAll && params.binaryOptionsMarketIdsToCancelAll.length > 0;
|
|
415
628
|
const message = __injectivelabs_core_proto_ts_v2_generated_injective_exchange_v1beta1_tx_pb.MsgBatchUpdateOrders.create({
|
|
416
629
|
sender: params.injectiveAddress,
|
|
@@ -454,7 +667,7 @@ var MsgBatchUpdateOrders = class MsgBatchUpdateOrders extends require_MsgBase.Ms
|
|
|
454
667
|
}
|
|
455
668
|
toProto() {
|
|
456
669
|
const { params } = this;
|
|
457
|
-
const message = createMsgAndCancelOrders(params);
|
|
670
|
+
const message = createMsgAndCancelOrders$1(params);
|
|
458
671
|
if (params.spotOrdersToCreate) message.spotOrdersToCreate = params.spotOrdersToCreate.map((args) => {
|
|
459
672
|
const paramsFromArgs = {
|
|
460
673
|
...args,
|
|
@@ -462,7 +675,7 @@ var MsgBatchUpdateOrders = class MsgBatchUpdateOrders extends require_MsgBase.Ms
|
|
|
462
675
|
triggerPrice: (0, __injectivelabs_utils.toChainFormat)(args.triggerPrice || 0).toFixed(),
|
|
463
676
|
quantity: (0, __injectivelabs_utils.toChainFormat)(args.quantity).toFixed()
|
|
464
677
|
};
|
|
465
|
-
return createSpotOrder({
|
|
678
|
+
return createSpotOrder$1({
|
|
466
679
|
...args,
|
|
467
680
|
...paramsFromArgs,
|
|
468
681
|
subaccountId: params.subaccountId
|
|
@@ -476,7 +689,7 @@ var MsgBatchUpdateOrders = class MsgBatchUpdateOrders extends require_MsgBase.Ms
|
|
|
476
689
|
triggerPrice: (0, __injectivelabs_utils.toChainFormat)(args.triggerPrice || 0).toFixed(),
|
|
477
690
|
quantity: (0, __injectivelabs_utils.toChainFormat)(args.quantity).toFixed()
|
|
478
691
|
};
|
|
479
|
-
return createDerivativeOrder({
|
|
692
|
+
return createDerivativeOrder$1({
|
|
480
693
|
...args,
|
|
481
694
|
...paramsFromArgs,
|
|
482
695
|
subaccountId: params.subaccountId
|
|
@@ -490,7 +703,7 @@ var MsgBatchUpdateOrders = class MsgBatchUpdateOrders extends require_MsgBase.Ms
|
|
|
490
703
|
triggerPrice: (0, __injectivelabs_utils.toChainFormat)(args.triggerPrice || 0).toFixed(),
|
|
491
704
|
quantity: (0, __injectivelabs_utils.toChainFormat)(args.quantity).toFixed()
|
|
492
705
|
};
|
|
493
|
-
return createBinaryOptionOrder({
|
|
706
|
+
return createBinaryOptionOrder$1({
|
|
494
707
|
...args,
|
|
495
708
|
...paramsFromArgs,
|
|
496
709
|
subaccountId: params.subaccountId
|
|
@@ -507,7 +720,7 @@ var MsgBatchUpdateOrders = class MsgBatchUpdateOrders extends require_MsgBase.Ms
|
|
|
507
720
|
}
|
|
508
721
|
toAmino() {
|
|
509
722
|
const { params } = this;
|
|
510
|
-
const message = createMsgAndCancelOrders(params);
|
|
723
|
+
const message = createMsgAndCancelOrders$1(params);
|
|
511
724
|
if (params.spotOrdersToCreate) message.spotOrdersToCreate = params.spotOrdersToCreate.map((args) => {
|
|
512
725
|
const paramsFromArgs = {
|
|
513
726
|
...args,
|
|
@@ -515,7 +728,7 @@ var MsgBatchUpdateOrders = class MsgBatchUpdateOrders extends require_MsgBase.Ms
|
|
|
515
728
|
triggerPrice: args.triggerPrice || "0",
|
|
516
729
|
quantity: args.quantity
|
|
517
730
|
};
|
|
518
|
-
return createSpotOrder({
|
|
731
|
+
return createSpotOrder$1({
|
|
519
732
|
...args,
|
|
520
733
|
...paramsFromArgs,
|
|
521
734
|
subaccountId: params.subaccountId
|
|
@@ -529,7 +742,7 @@ var MsgBatchUpdateOrders = class MsgBatchUpdateOrders extends require_MsgBase.Ms
|
|
|
529
742
|
triggerPrice: args.triggerPrice || "0",
|
|
530
743
|
quantity: args.quantity
|
|
531
744
|
};
|
|
532
|
-
return createDerivativeOrder({
|
|
745
|
+
return createDerivativeOrder$1({
|
|
533
746
|
...args,
|
|
534
747
|
...paramsFromArgs,
|
|
535
748
|
subaccountId: params.subaccountId
|
|
@@ -543,7 +756,7 @@ var MsgBatchUpdateOrders = class MsgBatchUpdateOrders extends require_MsgBase.Ms
|
|
|
543
756
|
triggerPrice: args.triggerPrice || "0",
|
|
544
757
|
quantity: args.quantity
|
|
545
758
|
};
|
|
546
|
-
return createBinaryOptionOrder({
|
|
759
|
+
return createBinaryOptionOrder$1({
|
|
547
760
|
...args,
|
|
548
761
|
...paramsFromArgs,
|
|
549
762
|
subaccountId: params.subaccountId
|
|
@@ -612,7 +825,7 @@ var MsgBatchUpdateOrders = class MsgBatchUpdateOrders extends require_MsgBase.Ms
|
|
|
612
825
|
|
|
613
826
|
//#endregion
|
|
614
827
|
//#region src/core/modules/exchange/msgs/MsgLiquidatePosition.ts
|
|
615
|
-
const createMessage$
|
|
828
|
+
const createMessage$12 = (params) => {
|
|
616
829
|
const message = __injectivelabs_core_proto_ts_v2_generated_injective_exchange_v1beta1_tx_pb.MsgLiquidatePosition.create({
|
|
617
830
|
sender: params.injectiveAddress,
|
|
618
831
|
subaccountId: params.subaccountId,
|
|
@@ -645,7 +858,7 @@ var MsgLiquidatePosition = class MsgLiquidatePosition extends require_MsgBase.Ms
|
|
|
645
858
|
}
|
|
646
859
|
toProto() {
|
|
647
860
|
const { params: initialParams } = this;
|
|
648
|
-
return createMessage$
|
|
861
|
+
return createMessage$12({
|
|
649
862
|
...initialParams,
|
|
650
863
|
order: initialParams.order ? {
|
|
651
864
|
...initialParams.order,
|
|
@@ -746,6 +959,65 @@ var MsgLiquidatePosition = class MsgLiquidatePosition extends require_MsgBase.Ms
|
|
|
746
959
|
}
|
|
747
960
|
};
|
|
748
961
|
|
|
962
|
+
//#endregion
|
|
963
|
+
//#region src/core/modules/exchange/msgs/MsgCancelSpotOrderV2.ts
|
|
964
|
+
/**
|
|
965
|
+
* @category Messages
|
|
966
|
+
* No toEip712/toEip712V2 override needed — spot cancel has no order_mask field, so base-class defaults (toAmino/toWeb3Gw) are correct.
|
|
967
|
+
*/
|
|
968
|
+
var MsgCancelSpotOrderV2 = class MsgCancelSpotOrderV2 extends require_MsgBase.MsgBase {
|
|
969
|
+
static fromJSON(params) {
|
|
970
|
+
return new MsgCancelSpotOrderV2(params);
|
|
971
|
+
}
|
|
972
|
+
toProto() {
|
|
973
|
+
const { params } = this;
|
|
974
|
+
if (!params.orderHash && !params.cid) throw new __injectivelabs_exceptions.GeneralException(/* @__PURE__ */ new Error("either orderHash or cid must be provided"));
|
|
975
|
+
return __injectivelabs_core_proto_ts_v2_generated_injective_exchange_v2_tx_pb.MsgCancelSpotOrder.create({
|
|
976
|
+
sender: params.injectiveAddress,
|
|
977
|
+
marketId: params.marketId,
|
|
978
|
+
subaccountId: params.subaccountId,
|
|
979
|
+
orderHash: params.orderHash || "",
|
|
980
|
+
cid: params.cid || ""
|
|
981
|
+
});
|
|
982
|
+
}
|
|
983
|
+
toData() {
|
|
984
|
+
const proto = this.toProto();
|
|
985
|
+
return {
|
|
986
|
+
"@type": "/injective.exchange.v2.MsgCancelSpotOrder",
|
|
987
|
+
...proto
|
|
988
|
+
};
|
|
989
|
+
}
|
|
990
|
+
toAmino() {
|
|
991
|
+
const proto = this.toProto();
|
|
992
|
+
return {
|
|
993
|
+
type: "exchange/MsgCancelSpotOrder",
|
|
994
|
+
value: {
|
|
995
|
+
sender: proto.sender,
|
|
996
|
+
market_id: proto.marketId,
|
|
997
|
+
subaccount_id: proto.subaccountId,
|
|
998
|
+
order_hash: proto.orderHash,
|
|
999
|
+
cid: proto.cid
|
|
1000
|
+
}
|
|
1001
|
+
};
|
|
1002
|
+
}
|
|
1003
|
+
toWeb3Gw() {
|
|
1004
|
+
const { value } = this.toAmino();
|
|
1005
|
+
return {
|
|
1006
|
+
"@type": "/injective.exchange.v2.MsgCancelSpotOrder",
|
|
1007
|
+
...value
|
|
1008
|
+
};
|
|
1009
|
+
}
|
|
1010
|
+
toDirectSign() {
|
|
1011
|
+
return {
|
|
1012
|
+
type: "/injective.exchange.v2.MsgCancelSpotOrder",
|
|
1013
|
+
message: this.toProto()
|
|
1014
|
+
};
|
|
1015
|
+
}
|
|
1016
|
+
toBinary() {
|
|
1017
|
+
return __injectivelabs_core_proto_ts_v2_generated_injective_exchange_v2_tx_pb.MsgCancelSpotOrder.toBinary(this.toProto());
|
|
1018
|
+
}
|
|
1019
|
+
};
|
|
1020
|
+
|
|
749
1021
|
//#endregion
|
|
750
1022
|
//#region src/core/modules/exchange/msgs/MsgReclaimLockedFunds.ts
|
|
751
1023
|
/**
|
|
@@ -803,7 +1075,7 @@ var MsgReclaimLockedFunds = class MsgReclaimLockedFunds extends require_MsgBase.
|
|
|
803
1075
|
|
|
804
1076
|
//#endregion
|
|
805
1077
|
//#region src/core/modules/exchange/msgs/MsgUpdateSpotMarketV2.ts
|
|
806
|
-
const createMessage$
|
|
1078
|
+
const createMessage$11 = (params) => {
|
|
807
1079
|
return __injectivelabs_core_proto_ts_v2_generated_injective_exchange_v2_tx_pb.MsgUpdateSpotMarket.create({
|
|
808
1080
|
admin: params.admin,
|
|
809
1081
|
marketId: params.marketId,
|
|
@@ -822,7 +1094,7 @@ var MsgUpdateSpotMarketV2 = class MsgUpdateSpotMarketV2 extends require_MsgBase.
|
|
|
822
1094
|
}
|
|
823
1095
|
toProto() {
|
|
824
1096
|
const { params: initialParams } = this;
|
|
825
|
-
return createMessage$
|
|
1097
|
+
return createMessage$11({
|
|
826
1098
|
...initialParams,
|
|
827
1099
|
newMinNotional: (0, __injectivelabs_utils.toChainFormat)(initialParams.newMinNotional || "0").toFixed(),
|
|
828
1100
|
newMinQuantityTickSize: (0, __injectivelabs_utils.toChainFormat)(initialParams.newMinQuantityTickSize || "0").toFixed(),
|
|
@@ -888,66 +1160,2257 @@ var MsgUpdateSpotMarketV2 = class MsgUpdateSpotMarketV2 extends require_MsgBase.
|
|
|
888
1160
|
};
|
|
889
1161
|
|
|
890
1162
|
//#endregion
|
|
891
|
-
//#region src/core/modules/exchange/msgs/
|
|
892
|
-
const createMessage$4 = (params) => {
|
|
893
|
-
return __injectivelabs_core_proto_ts_v2_generated_injective_exchange_v2_tx_pb.MsgCancelPostOnlyMode.create({ sender: params.sender });
|
|
894
|
-
};
|
|
1163
|
+
//#region src/core/modules/exchange/msgs/MsgExternalTransferV2.ts
|
|
895
1164
|
/**
|
|
896
1165
|
* @category Messages
|
|
897
1166
|
*/
|
|
898
|
-
var
|
|
1167
|
+
var MsgExternalTransferV2 = class MsgExternalTransferV2 extends require_MsgBase.MsgBase {
|
|
899
1168
|
static fromJSON(params) {
|
|
900
|
-
return new
|
|
1169
|
+
return new MsgExternalTransferV2(params);
|
|
901
1170
|
}
|
|
902
1171
|
toProto() {
|
|
903
|
-
const { params
|
|
904
|
-
|
|
1172
|
+
const { params } = this;
|
|
1173
|
+
const amountCoin = __injectivelabs_core_proto_ts_v2_generated_cosmos_base_v1beta1_coin_pb.Coin.create({
|
|
1174
|
+
denom: params.amount.denom,
|
|
1175
|
+
amount: params.amount.amount
|
|
1176
|
+
});
|
|
1177
|
+
return __injectivelabs_core_proto_ts_v2_generated_injective_exchange_v2_tx_pb.MsgExternalTransfer.create({
|
|
1178
|
+
sender: params.injectiveAddress,
|
|
1179
|
+
sourceSubaccountId: params.srcSubaccountId,
|
|
1180
|
+
destinationSubaccountId: params.dstSubaccountId,
|
|
1181
|
+
amount: amountCoin
|
|
1182
|
+
});
|
|
905
1183
|
}
|
|
906
1184
|
toData() {
|
|
907
1185
|
const proto = this.toProto();
|
|
908
1186
|
return {
|
|
909
|
-
"@type": "/injective.exchange.v2.
|
|
1187
|
+
"@type": "/injective.exchange.v2.MsgExternalTransfer",
|
|
910
1188
|
...proto
|
|
911
1189
|
};
|
|
912
1190
|
}
|
|
913
1191
|
toAmino() {
|
|
914
|
-
const
|
|
1192
|
+
const proto = this.toProto();
|
|
915
1193
|
return {
|
|
916
|
-
type: "exchange/
|
|
917
|
-
value: {
|
|
1194
|
+
type: "exchange/MsgExternalTransfer",
|
|
1195
|
+
value: {
|
|
1196
|
+
sender: proto.sender,
|
|
1197
|
+
source_subaccount_id: proto.sourceSubaccountId,
|
|
1198
|
+
destination_subaccount_id: proto.destinationSubaccountId,
|
|
1199
|
+
amount: proto.amount
|
|
1200
|
+
}
|
|
1201
|
+
};
|
|
1202
|
+
}
|
|
1203
|
+
toWeb3Gw() {
|
|
1204
|
+
const { value } = this.toAmino();
|
|
1205
|
+
return {
|
|
1206
|
+
"@type": "/injective.exchange.v2.MsgExternalTransfer",
|
|
1207
|
+
...value
|
|
1208
|
+
};
|
|
1209
|
+
}
|
|
1210
|
+
toDirectSign() {
|
|
1211
|
+
return {
|
|
1212
|
+
type: "/injective.exchange.v2.MsgExternalTransfer",
|
|
1213
|
+
message: this.toProto()
|
|
1214
|
+
};
|
|
1215
|
+
}
|
|
1216
|
+
toBinary() {
|
|
1217
|
+
return __injectivelabs_core_proto_ts_v2_generated_injective_exchange_v2_tx_pb.MsgExternalTransfer.toBinary(this.toProto());
|
|
1218
|
+
}
|
|
1219
|
+
};
|
|
1220
|
+
|
|
1221
|
+
//#endregion
|
|
1222
|
+
//#region src/core/modules/exchange/msgs/MsgBatchUpdateOrdersV2.ts
|
|
1223
|
+
const createSpotOrder = (args) => {
|
|
1224
|
+
const orderInfo = __injectivelabs_core_proto_ts_v2_generated_injective_exchange_v2_order_pb.OrderInfo.create({
|
|
1225
|
+
subaccountId: args.subaccountId,
|
|
1226
|
+
feeRecipient: args.feeRecipient,
|
|
1227
|
+
price: args.price,
|
|
1228
|
+
quantity: args.quantity,
|
|
1229
|
+
cid: args.cid
|
|
1230
|
+
});
|
|
1231
|
+
return __injectivelabs_core_proto_ts_v2_generated_injective_exchange_v2_order_pb.SpotOrder.create({
|
|
1232
|
+
marketId: args.marketId,
|
|
1233
|
+
orderType: args.orderType,
|
|
1234
|
+
orderInfo,
|
|
1235
|
+
triggerPrice: args.triggerPrice,
|
|
1236
|
+
expirationBlock: args.expirationBlock ? BigInt(args.expirationBlock) : BigInt(0)
|
|
1237
|
+
});
|
|
1238
|
+
};
|
|
1239
|
+
const createDerivativeOrder = (args) => {
|
|
1240
|
+
const orderInfo = __injectivelabs_core_proto_ts_v2_generated_injective_exchange_v2_order_pb.OrderInfo.create({
|
|
1241
|
+
subaccountId: args.subaccountId,
|
|
1242
|
+
feeRecipient: args.feeRecipient,
|
|
1243
|
+
price: args.price,
|
|
1244
|
+
quantity: args.quantity,
|
|
1245
|
+
cid: args.cid
|
|
1246
|
+
});
|
|
1247
|
+
return __injectivelabs_core_proto_ts_v2_generated_injective_exchange_v2_order_pb.DerivativeOrder.create({
|
|
1248
|
+
marketId: args.marketId,
|
|
1249
|
+
orderType: args.orderType,
|
|
1250
|
+
orderInfo,
|
|
1251
|
+
margin: args.margin,
|
|
1252
|
+
triggerPrice: args.triggerPrice,
|
|
1253
|
+
expirationBlock: args.expirationBlock ? BigInt(args.expirationBlock) : BigInt(0)
|
|
1254
|
+
});
|
|
1255
|
+
};
|
|
1256
|
+
const createBinaryOptionOrder = (args) => {
|
|
1257
|
+
const orderInfo = __injectivelabs_core_proto_ts_v2_generated_injective_exchange_v2_order_pb.OrderInfo.create({
|
|
1258
|
+
subaccountId: args.subaccountId,
|
|
1259
|
+
feeRecipient: args.feeRecipient,
|
|
1260
|
+
price: args.price,
|
|
1261
|
+
quantity: args.quantity,
|
|
1262
|
+
cid: args.cid
|
|
1263
|
+
});
|
|
1264
|
+
return __injectivelabs_core_proto_ts_v2_generated_injective_exchange_v2_order_pb.DerivativeOrder.create({
|
|
1265
|
+
marketId: args.marketId,
|
|
1266
|
+
orderType: args.orderType,
|
|
1267
|
+
orderInfo,
|
|
1268
|
+
margin: args.margin,
|
|
1269
|
+
triggerPrice: args.triggerPrice,
|
|
1270
|
+
expirationBlock: args.expirationBlock ? BigInt(args.expirationBlock) : BigInt(0)
|
|
1271
|
+
});
|
|
1272
|
+
};
|
|
1273
|
+
const buildSpotOrders = (orders, subaccountId, fmt, fmtOpt) => orders.map((args) => createSpotOrder({
|
|
1274
|
+
...args,
|
|
1275
|
+
price: fmt(args.price),
|
|
1276
|
+
triggerPrice: fmtOpt(args.triggerPrice),
|
|
1277
|
+
quantity: fmt(args.quantity),
|
|
1278
|
+
subaccountId
|
|
1279
|
+
}));
|
|
1280
|
+
const buildDerivativeOrders = (orders, subaccountId, fmt, fmtOpt) => orders.map((args) => createDerivativeOrder({
|
|
1281
|
+
...args,
|
|
1282
|
+
price: fmt(args.price),
|
|
1283
|
+
margin: fmt(args.margin),
|
|
1284
|
+
triggerPrice: fmtOpt(args.triggerPrice),
|
|
1285
|
+
quantity: fmt(args.quantity),
|
|
1286
|
+
subaccountId
|
|
1287
|
+
}));
|
|
1288
|
+
const buildBinaryOptionOrders = (orders, subaccountId, fmt, fmtOpt) => orders.map((args) => createBinaryOptionOrder({
|
|
1289
|
+
...args,
|
|
1290
|
+
price: fmt(args.price),
|
|
1291
|
+
margin: fmt(args.margin),
|
|
1292
|
+
triggerPrice: fmtOpt(args.triggerPrice),
|
|
1293
|
+
quantity: fmt(args.quantity),
|
|
1294
|
+
subaccountId
|
|
1295
|
+
}));
|
|
1296
|
+
const createMsgAndCancelOrders = (params) => {
|
|
1297
|
+
const hasCancelAll = params.spotMarketIdsToCancelAll && params.spotMarketIdsToCancelAll.length > 0 || params.derivativeMarketIdsToCancelAll && params.derivativeMarketIdsToCancelAll.length > 0 || params.binaryOptionsMarketIdsToCancelAll && params.binaryOptionsMarketIdsToCancelAll.length > 0;
|
|
1298
|
+
const message = __injectivelabs_core_proto_ts_v2_generated_injective_exchange_v2_tx_pb.MsgBatchUpdateOrders.create({
|
|
1299
|
+
sender: params.injectiveAddress,
|
|
1300
|
+
...hasCancelAll && { subaccountId: params.subaccountId }
|
|
1301
|
+
});
|
|
1302
|
+
if (params.spotMarketIdsToCancelAll && params.spotMarketIdsToCancelAll.length > 0) message.spotMarketIdsToCancelAll = params.spotMarketIdsToCancelAll;
|
|
1303
|
+
if (params.derivativeMarketIdsToCancelAll && params.derivativeMarketIdsToCancelAll.length > 0) message.derivativeMarketIdsToCancelAll = params.derivativeMarketIdsToCancelAll;
|
|
1304
|
+
if (params.binaryOptionsMarketIdsToCancelAll && params.binaryOptionsMarketIdsToCancelAll.length > 0) message.binaryOptionsMarketIdsToCancelAll = params.binaryOptionsMarketIdsToCancelAll;
|
|
1305
|
+
if (params.spotOrdersToCancel) message.spotOrdersToCancel = params.spotOrdersToCancel.map(({ marketId, subaccountId, orderHash, cid }) => {
|
|
1306
|
+
return __injectivelabs_core_proto_ts_v2_generated_injective_exchange_v2_tx_pb.OrderData.create({
|
|
1307
|
+
marketId,
|
|
1308
|
+
subaccountId,
|
|
1309
|
+
orderHash,
|
|
1310
|
+
cid
|
|
1311
|
+
});
|
|
1312
|
+
});
|
|
1313
|
+
if (params.derivativeOrdersToCancel) message.derivativeOrdersToCancel = params.derivativeOrdersToCancel.map(({ marketId, subaccountId, orderHash, cid }) => {
|
|
1314
|
+
return __injectivelabs_core_proto_ts_v2_generated_injective_exchange_v2_tx_pb.OrderData.create({
|
|
1315
|
+
marketId,
|
|
1316
|
+
subaccountId,
|
|
1317
|
+
orderHash,
|
|
1318
|
+
cid
|
|
1319
|
+
});
|
|
1320
|
+
});
|
|
1321
|
+
if (params.binaryOptionsOrdersToCancel) message.binaryOptionsOrdersToCancel = params.binaryOptionsOrdersToCancel.map(({ marketId, subaccountId, orderHash, cid }) => {
|
|
1322
|
+
return __injectivelabs_core_proto_ts_v2_generated_injective_exchange_v2_tx_pb.OrderData.create({
|
|
1323
|
+
marketId,
|
|
1324
|
+
subaccountId,
|
|
1325
|
+
orderHash,
|
|
1326
|
+
cid
|
|
1327
|
+
});
|
|
1328
|
+
});
|
|
1329
|
+
return message;
|
|
1330
|
+
};
|
|
1331
|
+
/**
|
|
1332
|
+
* @category Messages
|
|
1333
|
+
*/
|
|
1334
|
+
var MsgBatchUpdateOrdersV2 = class MsgBatchUpdateOrdersV2 extends require_MsgBase.MsgBase {
|
|
1335
|
+
static fromJSON(params) {
|
|
1336
|
+
return new MsgBatchUpdateOrdersV2(params);
|
|
1337
|
+
}
|
|
1338
|
+
toProto() {
|
|
1339
|
+
const { params } = this;
|
|
1340
|
+
const message = createMsgAndCancelOrders(params);
|
|
1341
|
+
const fmt = (v) => (0, __injectivelabs_utils.toChainFormat)(v).toFixed();
|
|
1342
|
+
const fmtOpt = (v) => (0, __injectivelabs_utils.toChainFormat)(v || 0).toFixed();
|
|
1343
|
+
if (params.spotOrdersToCreate) message.spotOrdersToCreate = buildSpotOrders(params.spotOrdersToCreate, params.subaccountId, fmt, fmtOpt);
|
|
1344
|
+
if (params.derivativeOrdersToCreate) message.derivativeOrdersToCreate = buildDerivativeOrders(params.derivativeOrdersToCreate, params.subaccountId, fmt, fmtOpt);
|
|
1345
|
+
if (params.binaryOptionsOrdersToCreate) message.binaryOptionsOrdersToCreate = buildBinaryOptionOrders(params.binaryOptionsOrdersToCreate, params.subaccountId, fmt, fmtOpt);
|
|
1346
|
+
if (params.spotMarketOrdersToCreate) message.spotMarketOrdersToCreate = buildSpotOrders(params.spotMarketOrdersToCreate, params.subaccountId, fmt, fmtOpt);
|
|
1347
|
+
if (params.derivativeMarketOrdersToCreate) message.derivativeMarketOrdersToCreate = buildDerivativeOrders(params.derivativeMarketOrdersToCreate, params.subaccountId, fmt, fmtOpt);
|
|
1348
|
+
if (params.binaryOptionsMarketOrdersToCreate) message.binaryOptionsMarketOrdersToCreate = buildBinaryOptionOrders(params.binaryOptionsMarketOrdersToCreate, params.subaccountId, fmt, fmtOpt);
|
|
1349
|
+
return message;
|
|
1350
|
+
}
|
|
1351
|
+
toData() {
|
|
1352
|
+
const proto = this.toProto();
|
|
1353
|
+
return {
|
|
1354
|
+
"@type": "/injective.exchange.v2.MsgBatchUpdateOrders",
|
|
1355
|
+
...proto
|
|
1356
|
+
};
|
|
1357
|
+
}
|
|
1358
|
+
toAmino() {
|
|
1359
|
+
const { params } = this;
|
|
1360
|
+
const message = createMsgAndCancelOrders(params);
|
|
1361
|
+
const fmt = (v) => v;
|
|
1362
|
+
const fmtOpt = (v) => v || "0";
|
|
1363
|
+
if (params.spotOrdersToCreate) message.spotOrdersToCreate = buildSpotOrders(params.spotOrdersToCreate, params.subaccountId, fmt, fmtOpt);
|
|
1364
|
+
if (params.derivativeOrdersToCreate) message.derivativeOrdersToCreate = buildDerivativeOrders(params.derivativeOrdersToCreate, params.subaccountId, fmt, fmtOpt);
|
|
1365
|
+
if (params.binaryOptionsOrdersToCreate) message.binaryOptionsOrdersToCreate = buildBinaryOptionOrders(params.binaryOptionsOrdersToCreate, params.subaccountId, fmt, fmtOpt);
|
|
1366
|
+
if (params.spotMarketOrdersToCreate) message.spotMarketOrdersToCreate = buildSpotOrders(params.spotMarketOrdersToCreate, params.subaccountId, fmt, fmtOpt);
|
|
1367
|
+
if (params.derivativeMarketOrdersToCreate) message.derivativeMarketOrdersToCreate = buildDerivativeOrders(params.derivativeMarketOrdersToCreate, params.subaccountId, fmt, fmtOpt);
|
|
1368
|
+
if (params.binaryOptionsMarketOrdersToCreate) message.binaryOptionsMarketOrdersToCreate = buildBinaryOptionOrders(params.binaryOptionsMarketOrdersToCreate, params.subaccountId, fmt, fmtOpt);
|
|
1369
|
+
const orderInfoToSnakeCase = (orderInfo) => ({
|
|
1370
|
+
subaccount_id: orderInfo.subaccountId,
|
|
1371
|
+
fee_recipient: orderInfo.feeRecipient,
|
|
1372
|
+
price: orderInfo.price,
|
|
1373
|
+
quantity: orderInfo.quantity,
|
|
1374
|
+
cid: orderInfo.cid
|
|
1375
|
+
});
|
|
1376
|
+
const spotOrderToSnakeCase = (order) => ({
|
|
1377
|
+
market_id: order.marketId,
|
|
1378
|
+
order_type: order.orderType,
|
|
1379
|
+
order_info: orderInfoToSnakeCase(order.orderInfo),
|
|
1380
|
+
trigger_price: order.triggerPrice,
|
|
1381
|
+
expiration_block: String(order.expirationBlock)
|
|
1382
|
+
});
|
|
1383
|
+
const derivativeOrderToSnakeCase = (order) => ({
|
|
1384
|
+
market_id: order.marketId,
|
|
1385
|
+
order_type: order.orderType,
|
|
1386
|
+
order_info: orderInfoToSnakeCase(order.orderInfo),
|
|
1387
|
+
margin: order.margin,
|
|
1388
|
+
trigger_price: order.triggerPrice,
|
|
1389
|
+
expiration_block: String(order.expirationBlock)
|
|
1390
|
+
});
|
|
1391
|
+
const orderDataToSnakeCase = (orderData) => ({
|
|
1392
|
+
market_id: orderData.marketId,
|
|
1393
|
+
subaccount_id: orderData.subaccountId,
|
|
1394
|
+
order_hash: orderData.orderHash,
|
|
1395
|
+
cid: orderData.cid
|
|
1396
|
+
});
|
|
1397
|
+
return {
|
|
1398
|
+
type: "exchange/MsgBatchUpdateOrders",
|
|
1399
|
+
value: {
|
|
1400
|
+
sender: message.sender,
|
|
1401
|
+
subaccount_id: message.subaccountId,
|
|
1402
|
+
spot_market_ids_to_cancel_all: message.spotMarketIdsToCancelAll,
|
|
1403
|
+
derivative_market_ids_to_cancel_all: message.derivativeMarketIdsToCancelAll,
|
|
1404
|
+
spot_orders_to_cancel: message.spotOrdersToCancel.map(orderDataToSnakeCase),
|
|
1405
|
+
derivative_orders_to_cancel: message.derivativeOrdersToCancel.map(orderDataToSnakeCase),
|
|
1406
|
+
spot_orders_to_create: message.spotOrdersToCreate.map(spotOrderToSnakeCase),
|
|
1407
|
+
derivative_orders_to_create: message.derivativeOrdersToCreate.map(derivativeOrderToSnakeCase),
|
|
1408
|
+
binary_options_orders_to_cancel: message.binaryOptionsOrdersToCancel.map(orderDataToSnakeCase),
|
|
1409
|
+
binary_options_market_ids_to_cancel_all: message.binaryOptionsMarketIdsToCancelAll,
|
|
1410
|
+
binary_options_orders_to_create: message.binaryOptionsOrdersToCreate.map(derivativeOrderToSnakeCase),
|
|
1411
|
+
spot_market_orders_to_create: message.spotMarketOrdersToCreate.map(spotOrderToSnakeCase),
|
|
1412
|
+
derivative_market_orders_to_create: message.derivativeMarketOrdersToCreate.map(derivativeOrderToSnakeCase),
|
|
1413
|
+
binary_options_market_orders_to_create: message.binaryOptionsMarketOrdersToCreate.map(derivativeOrderToSnakeCase)
|
|
1414
|
+
}
|
|
1415
|
+
};
|
|
1416
|
+
}
|
|
1417
|
+
toWeb3Gw() {
|
|
1418
|
+
const { value } = this.toAmino();
|
|
1419
|
+
return {
|
|
1420
|
+
"@type": "/injective.exchange.v2.MsgBatchUpdateOrders",
|
|
1421
|
+
...value
|
|
1422
|
+
};
|
|
1423
|
+
}
|
|
1424
|
+
toEip712() {
|
|
1425
|
+
var _msgValue$spot_market, _msgValue$derivative_, _msgValue$spot_orders, _msgValue$derivative_2, _msgValue$binary_opti, _msgValue$binary_opti2;
|
|
1426
|
+
const { params } = this;
|
|
1427
|
+
const { value, type } = this.toAmino();
|
|
1428
|
+
const spotOrderToEip712 = (order, args) => ({
|
|
1429
|
+
market_id: order.market_id,
|
|
1430
|
+
order_info: {
|
|
1431
|
+
subaccount_id: order.order_info.subaccount_id,
|
|
1432
|
+
fee_recipient: order.order_info.fee_recipient,
|
|
1433
|
+
price: (0, __injectivelabs_utils.toChainFormat)(args.price).toFixed(),
|
|
1434
|
+
quantity: (0, __injectivelabs_utils.toChainFormat)(args.quantity).toFixed(),
|
|
1435
|
+
cid: order.order_info.cid
|
|
1436
|
+
},
|
|
1437
|
+
order_type: order.order_type,
|
|
1438
|
+
trigger_price: (0, __injectivelabs_utils.toChainFormat)(args.triggerPrice || "0").toFixed()
|
|
1439
|
+
});
|
|
1440
|
+
const derivativeOrderToEip712 = (order, args) => ({
|
|
1441
|
+
market_id: order.market_id,
|
|
1442
|
+
order_info: {
|
|
1443
|
+
subaccount_id: order.order_info.subaccount_id,
|
|
1444
|
+
fee_recipient: order.order_info.fee_recipient,
|
|
1445
|
+
price: (0, __injectivelabs_utils.toChainFormat)(args.price).toFixed(),
|
|
1446
|
+
quantity: (0, __injectivelabs_utils.toChainFormat)(args.quantity).toFixed(),
|
|
1447
|
+
cid: order.order_info.cid
|
|
1448
|
+
},
|
|
1449
|
+
order_type: order.order_type,
|
|
1450
|
+
margin: (0, __injectivelabs_utils.toChainFormat)(args.margin).toFixed(),
|
|
1451
|
+
trigger_price: (0, __injectivelabs_utils.toChainFormat)(args.triggerPrice || "0").toFixed()
|
|
1452
|
+
});
|
|
1453
|
+
const msgValue = value;
|
|
1454
|
+
const hasCancelAll = params.spotMarketIdsToCancelAll && params.spotMarketIdsToCancelAll.length > 0 || params.derivativeMarketIdsToCancelAll && params.derivativeMarketIdsToCancelAll.length > 0 || params.binaryOptionsMarketIdsToCancelAll && params.binaryOptionsMarketIdsToCancelAll.length > 0;
|
|
1455
|
+
const result = { sender: msgValue.sender };
|
|
1456
|
+
if (hasCancelAll) result.subaccount_id = msgValue.subaccount_id;
|
|
1457
|
+
if (((_msgValue$spot_market = msgValue.spot_market_ids_to_cancel_all) === null || _msgValue$spot_market === void 0 ? void 0 : _msgValue$spot_market.length) > 0) result.spot_market_ids_to_cancel_all = msgValue.spot_market_ids_to_cancel_all;
|
|
1458
|
+
if (((_msgValue$derivative_ = msgValue.derivative_market_ids_to_cancel_all) === null || _msgValue$derivative_ === void 0 ? void 0 : _msgValue$derivative_.length) > 0) result.derivative_market_ids_to_cancel_all = msgValue.derivative_market_ids_to_cancel_all;
|
|
1459
|
+
if (((_msgValue$spot_orders = msgValue.spot_orders_to_cancel) === null || _msgValue$spot_orders === void 0 ? void 0 : _msgValue$spot_orders.length) > 0) result.spot_orders_to_cancel = msgValue.spot_orders_to_cancel;
|
|
1460
|
+
if (((_msgValue$derivative_2 = msgValue.derivative_orders_to_cancel) === null || _msgValue$derivative_2 === void 0 ? void 0 : _msgValue$derivative_2.length) > 0) result.derivative_orders_to_cancel = msgValue.derivative_orders_to_cancel;
|
|
1461
|
+
if (params.spotOrdersToCreate && params.spotOrdersToCreate.length > 0) result.spot_orders_to_create = params.spotOrdersToCreate.map((args, i) => spotOrderToEip712(msgValue.spot_orders_to_create[i], args));
|
|
1462
|
+
if (params.derivativeOrdersToCreate && params.derivativeOrdersToCreate.length > 0) result.derivative_orders_to_create = params.derivativeOrdersToCreate.map((args, i) => derivativeOrderToEip712(msgValue.derivative_orders_to_create[i], args));
|
|
1463
|
+
if (((_msgValue$binary_opti = msgValue.binary_options_orders_to_cancel) === null || _msgValue$binary_opti === void 0 ? void 0 : _msgValue$binary_opti.length) > 0) result.binary_options_orders_to_cancel = msgValue.binary_options_orders_to_cancel;
|
|
1464
|
+
if (((_msgValue$binary_opti2 = msgValue.binary_options_market_ids_to_cancel_all) === null || _msgValue$binary_opti2 === void 0 ? void 0 : _msgValue$binary_opti2.length) > 0) result.binary_options_market_ids_to_cancel_all = msgValue.binary_options_market_ids_to_cancel_all;
|
|
1465
|
+
if (params.binaryOptionsOrdersToCreate && params.binaryOptionsOrdersToCreate.length > 0) result.binary_options_orders_to_create = params.binaryOptionsOrdersToCreate.map((args, i) => derivativeOrderToEip712(msgValue.binary_options_orders_to_create[i], args));
|
|
1466
|
+
if (params.spotMarketOrdersToCreate && params.spotMarketOrdersToCreate.length > 0) result.spot_market_orders_to_create = params.spotMarketOrdersToCreate.map((args, i) => spotOrderToEip712(msgValue.spot_market_orders_to_create[i], args));
|
|
1467
|
+
if (params.derivativeMarketOrdersToCreate && params.derivativeMarketOrdersToCreate.length > 0) result.derivative_market_orders_to_create = params.derivativeMarketOrdersToCreate.map((args, i) => derivativeOrderToEip712(msgValue.derivative_market_orders_to_create[i], args));
|
|
1468
|
+
if (params.binaryOptionsMarketOrdersToCreate && params.binaryOptionsMarketOrdersToCreate.length > 0) result.binary_options_market_orders_to_create = params.binaryOptionsMarketOrdersToCreate.map((args, i) => derivativeOrderToEip712(msgValue.binary_options_market_orders_to_create[i], args));
|
|
1469
|
+
return {
|
|
1470
|
+
type,
|
|
1471
|
+
value: result
|
|
1472
|
+
};
|
|
1473
|
+
}
|
|
1474
|
+
toEip712Types() {
|
|
1475
|
+
const eip712 = this.toEip712();
|
|
1476
|
+
return require_MsgBase.patchOrderTypesWithExpirationBlock(require_MsgBase.objectKeysToEip712Types({
|
|
1477
|
+
object: eip712.value,
|
|
1478
|
+
messageType: eip712.type
|
|
1479
|
+
}), [
|
|
1480
|
+
"TypeSpotOrdersToCreate",
|
|
1481
|
+
"TypeDerivativeOrdersToCreate",
|
|
1482
|
+
"TypeBinaryOptionsOrdersToCreate",
|
|
1483
|
+
"TypeSpotMarketOrdersToCreate",
|
|
1484
|
+
"TypeDerivativeMarketOrdersToCreate",
|
|
1485
|
+
"TypeBinaryOptionsMarketOrdersToCreate"
|
|
1486
|
+
]);
|
|
1487
|
+
}
|
|
1488
|
+
toEip712V2() {
|
|
1489
|
+
var _web3gw$spot_market_i, _web3gw$derivative_ma, _web3gw$spot_orders_t, _web3gw$derivative_or, _web3gw$binary_option, _web3gw$binary_option2;
|
|
1490
|
+
const { params } = this;
|
|
1491
|
+
const web3gw = this.toWeb3Gw();
|
|
1492
|
+
const formatSpotOrderEip712 = (order, args) => ({
|
|
1493
|
+
market_id: order.market_id,
|
|
1494
|
+
order_info: {
|
|
1495
|
+
subaccount_id: order.order_info.subaccount_id,
|
|
1496
|
+
fee_recipient: order.order_info.fee_recipient,
|
|
1497
|
+
price: require_utils.numberToCosmosSdkDecString(args.price),
|
|
1498
|
+
quantity: require_utils.numberToCosmosSdkDecString(args.quantity),
|
|
1499
|
+
cid: order.order_info.cid
|
|
1500
|
+
},
|
|
1501
|
+
order_type: __injectivelabs_core_proto_ts_v2_generated_injective_exchange_v2_order_pb.OrderType[args.orderType],
|
|
1502
|
+
trigger_price: require_utils.numberToCosmosSdkDecString(args.triggerPrice || "0"),
|
|
1503
|
+
expiration_block: args.expirationBlock || "0"
|
|
1504
|
+
});
|
|
1505
|
+
const formatDerivativeOrderEip712 = (order, args) => ({
|
|
1506
|
+
market_id: order.market_id,
|
|
1507
|
+
order_info: {
|
|
1508
|
+
subaccount_id: order.order_info.subaccount_id,
|
|
1509
|
+
fee_recipient: order.order_info.fee_recipient,
|
|
1510
|
+
price: require_utils.numberToCosmosSdkDecString(args.price),
|
|
1511
|
+
quantity: require_utils.numberToCosmosSdkDecString(args.quantity),
|
|
1512
|
+
cid: order.order_info.cid
|
|
1513
|
+
},
|
|
1514
|
+
order_type: __injectivelabs_core_proto_ts_v2_generated_injective_exchange_v2_order_pb.OrderType[args.orderType],
|
|
1515
|
+
margin: require_utils.numberToCosmosSdkDecString(args.margin),
|
|
1516
|
+
trigger_price: require_utils.numberToCosmosSdkDecString(args.triggerPrice || "0"),
|
|
1517
|
+
expiration_block: args.expirationBlock || "0"
|
|
1518
|
+
});
|
|
1519
|
+
return {
|
|
1520
|
+
"@type": "/injective.exchange.v2.MsgBatchUpdateOrders",
|
|
1521
|
+
sender: web3gw.sender,
|
|
1522
|
+
subaccount_id: web3gw.subaccount_id,
|
|
1523
|
+
spot_market_ids_to_cancel_all: (_web3gw$spot_market_i = web3gw.spot_market_ids_to_cancel_all) !== null && _web3gw$spot_market_i !== void 0 ? _web3gw$spot_market_i : [],
|
|
1524
|
+
derivative_market_ids_to_cancel_all: (_web3gw$derivative_ma = web3gw.derivative_market_ids_to_cancel_all) !== null && _web3gw$derivative_ma !== void 0 ? _web3gw$derivative_ma : [],
|
|
1525
|
+
spot_orders_to_cancel: (_web3gw$spot_orders_t = web3gw.spot_orders_to_cancel) !== null && _web3gw$spot_orders_t !== void 0 ? _web3gw$spot_orders_t : [],
|
|
1526
|
+
derivative_orders_to_cancel: (_web3gw$derivative_or = web3gw.derivative_orders_to_cancel) !== null && _web3gw$derivative_or !== void 0 ? _web3gw$derivative_or : [],
|
|
1527
|
+
spot_orders_to_create: params.spotOrdersToCreate && params.spotOrdersToCreate.length > 0 ? params.spotOrdersToCreate.map((args, i) => formatSpotOrderEip712(web3gw.spot_orders_to_create[i], args)) : [],
|
|
1528
|
+
derivative_orders_to_create: params.derivativeOrdersToCreate && params.derivativeOrdersToCreate.length > 0 ? params.derivativeOrdersToCreate.map((args, i) => formatDerivativeOrderEip712(web3gw.derivative_orders_to_create[i], args)) : [],
|
|
1529
|
+
binary_options_orders_to_cancel: (_web3gw$binary_option = web3gw.binary_options_orders_to_cancel) !== null && _web3gw$binary_option !== void 0 ? _web3gw$binary_option : [],
|
|
1530
|
+
binary_options_market_ids_to_cancel_all: (_web3gw$binary_option2 = web3gw.binary_options_market_ids_to_cancel_all) !== null && _web3gw$binary_option2 !== void 0 ? _web3gw$binary_option2 : [],
|
|
1531
|
+
binary_options_orders_to_create: params.binaryOptionsOrdersToCreate && params.binaryOptionsOrdersToCreate.length > 0 ? params.binaryOptionsOrdersToCreate.map((args, i) => formatDerivativeOrderEip712(web3gw.binary_options_orders_to_create[i], args)) : [],
|
|
1532
|
+
spot_market_orders_to_create: params.spotMarketOrdersToCreate && params.spotMarketOrdersToCreate.length > 0 ? params.spotMarketOrdersToCreate.map((args, i) => formatSpotOrderEip712(web3gw.spot_market_orders_to_create[i], args)) : [],
|
|
1533
|
+
derivative_market_orders_to_create: params.derivativeMarketOrdersToCreate && params.derivativeMarketOrdersToCreate.length > 0 ? params.derivativeMarketOrdersToCreate.map((args, i) => formatDerivativeOrderEip712(web3gw.derivative_market_orders_to_create[i], args)) : [],
|
|
1534
|
+
binary_options_market_orders_to_create: params.binaryOptionsMarketOrdersToCreate && params.binaryOptionsMarketOrdersToCreate.length > 0 ? params.binaryOptionsMarketOrdersToCreate.map((args, i) => formatDerivativeOrderEip712(web3gw.binary_options_market_orders_to_create[i], args)) : []
|
|
1535
|
+
};
|
|
1536
|
+
}
|
|
1537
|
+
toDirectSign() {
|
|
1538
|
+
return {
|
|
1539
|
+
type: "/injective.exchange.v2.MsgBatchUpdateOrders",
|
|
1540
|
+
message: this.toProto()
|
|
1541
|
+
};
|
|
1542
|
+
}
|
|
1543
|
+
toBinary() {
|
|
1544
|
+
return __injectivelabs_core_proto_ts_v2_generated_injective_exchange_v2_tx_pb.MsgBatchUpdateOrders.toBinary(this.toProto());
|
|
1545
|
+
}
|
|
1546
|
+
};
|
|
1547
|
+
|
|
1548
|
+
//#endregion
|
|
1549
|
+
//#region src/core/modules/exchange/msgs/MsgLiquidatePositionV2.ts
|
|
1550
|
+
const createMessage$10 = (params) => {
|
|
1551
|
+
const message = __injectivelabs_core_proto_ts_v2_generated_injective_exchange_v2_tx_pb.MsgLiquidatePosition.create({
|
|
1552
|
+
sender: params.injectiveAddress,
|
|
1553
|
+
subaccountId: params.subaccountId,
|
|
1554
|
+
marketId: params.marketId
|
|
1555
|
+
});
|
|
1556
|
+
if (params.order) {
|
|
1557
|
+
const orderInfo = __injectivelabs_core_proto_ts_v2_generated_injective_exchange_v2_order_pb.OrderInfo.create({
|
|
1558
|
+
subaccountId: params.order.subaccountId,
|
|
1559
|
+
feeRecipient: params.order.feeRecipient,
|
|
1560
|
+
price: params.order.price,
|
|
1561
|
+
quantity: params.order.quantity,
|
|
1562
|
+
cid: params.order.cid || ""
|
|
1563
|
+
});
|
|
1564
|
+
message.order = __injectivelabs_core_proto_ts_v2_generated_injective_exchange_v2_order_pb.DerivativeOrder.create({
|
|
1565
|
+
marketId: params.order.marketId,
|
|
1566
|
+
margin: params.order.margin,
|
|
1567
|
+
orderInfo,
|
|
1568
|
+
orderType: params.order.orderType,
|
|
1569
|
+
triggerPrice: params.order.triggerPrice || "0",
|
|
1570
|
+
expirationBlock: params.order.expirationBlock ? BigInt(params.order.expirationBlock) : BigInt(0)
|
|
1571
|
+
});
|
|
1572
|
+
}
|
|
1573
|
+
return message;
|
|
1574
|
+
};
|
|
1575
|
+
/**
|
|
1576
|
+
* @category Messages
|
|
1577
|
+
*/
|
|
1578
|
+
var MsgLiquidatePositionV2 = class MsgLiquidatePositionV2 extends require_MsgBase.MsgBase {
|
|
1579
|
+
static fromJSON(params) {
|
|
1580
|
+
return new MsgLiquidatePositionV2(params);
|
|
1581
|
+
}
|
|
1582
|
+
toProto() {
|
|
1583
|
+
const { params: initialParams } = this;
|
|
1584
|
+
return createMessage$10({
|
|
1585
|
+
...initialParams,
|
|
1586
|
+
order: initialParams.order ? {
|
|
1587
|
+
...initialParams.order,
|
|
1588
|
+
price: (0, __injectivelabs_utils.toChainFormat)(initialParams.order.price).toFixed(),
|
|
1589
|
+
margin: (0, __injectivelabs_utils.toChainFormat)(initialParams.order.margin).toFixed(),
|
|
1590
|
+
triggerPrice: (0, __injectivelabs_utils.toChainFormat)(initialParams.order.triggerPrice || 0).toFixed(),
|
|
1591
|
+
quantity: (0, __injectivelabs_utils.toChainFormat)(initialParams.order.quantity).toFixed()
|
|
1592
|
+
} : void 0
|
|
1593
|
+
});
|
|
1594
|
+
}
|
|
1595
|
+
toData() {
|
|
1596
|
+
const proto = this.toProto();
|
|
1597
|
+
return {
|
|
1598
|
+
"@type": "/injective.exchange.v2.MsgLiquidatePosition",
|
|
1599
|
+
...proto
|
|
1600
|
+
};
|
|
1601
|
+
}
|
|
1602
|
+
toAmino() {
|
|
1603
|
+
const { params } = this;
|
|
1604
|
+
return {
|
|
1605
|
+
type: "exchange/MsgLiquidatePosition",
|
|
1606
|
+
value: {
|
|
1607
|
+
sender: params.injectiveAddress,
|
|
1608
|
+
subaccount_id: params.subaccountId,
|
|
1609
|
+
market_id: params.marketId,
|
|
1610
|
+
order: params.order ? {
|
|
1611
|
+
market_id: params.order.marketId,
|
|
1612
|
+
order_info: {
|
|
1613
|
+
subaccount_id: params.order.subaccountId,
|
|
1614
|
+
fee_recipient: params.order.feeRecipient,
|
|
1615
|
+
price: params.order.price,
|
|
1616
|
+
quantity: params.order.quantity,
|
|
1617
|
+
cid: params.order.cid || ""
|
|
1618
|
+
},
|
|
1619
|
+
order_type: params.order.orderType,
|
|
1620
|
+
margin: params.order.margin,
|
|
1621
|
+
trigger_price: params.order.triggerPrice || "0",
|
|
1622
|
+
expiration_block: params.order.expirationBlock || "0"
|
|
1623
|
+
} : void 0
|
|
1624
|
+
}
|
|
1625
|
+
};
|
|
1626
|
+
}
|
|
1627
|
+
toWeb3Gw() {
|
|
1628
|
+
const { value } = this.toAmino();
|
|
1629
|
+
return {
|
|
1630
|
+
"@type": "/injective.exchange.v2.MsgLiquidatePosition",
|
|
1631
|
+
...value
|
|
1632
|
+
};
|
|
1633
|
+
}
|
|
1634
|
+
toEip712V2() {
|
|
1635
|
+
const { params } = this;
|
|
1636
|
+
const web3gw = this.toWeb3Gw();
|
|
1637
|
+
const order = web3gw.order;
|
|
1638
|
+
return {
|
|
1639
|
+
...web3gw,
|
|
1640
|
+
order: params.order ? {
|
|
1641
|
+
...order,
|
|
1642
|
+
order_info: {
|
|
1643
|
+
...order === null || order === void 0 ? void 0 : order.order_info,
|
|
1644
|
+
price: require_utils.numberToCosmosSdkDecString(params.order.price),
|
|
1645
|
+
quantity: require_utils.numberToCosmosSdkDecString(params.order.quantity)
|
|
1646
|
+
},
|
|
1647
|
+
margin: require_utils.numberToCosmosSdkDecString(params.order.margin),
|
|
1648
|
+
trigger_price: require_utils.numberToCosmosSdkDecString(params.order.triggerPrice || "0"),
|
|
1649
|
+
order_type: __injectivelabs_core_proto_ts_v2_generated_injective_exchange_v2_order_pb.OrderType[params.order.orderType]
|
|
1650
|
+
} : null
|
|
1651
|
+
};
|
|
1652
|
+
}
|
|
1653
|
+
toEip712() {
|
|
1654
|
+
const { params } = this;
|
|
1655
|
+
const { value, type } = this.toAmino();
|
|
1656
|
+
const { expiration_block: _eb, ...orderWithoutExpiration } = value.order || {};
|
|
1657
|
+
return {
|
|
1658
|
+
type,
|
|
1659
|
+
value: {
|
|
1660
|
+
...value,
|
|
1661
|
+
order: params.order ? {
|
|
1662
|
+
...orderWithoutExpiration,
|
|
1663
|
+
order_info: {
|
|
1664
|
+
...orderWithoutExpiration === null || orderWithoutExpiration === void 0 ? void 0 : orderWithoutExpiration.order_info,
|
|
1665
|
+
price: (0, __injectivelabs_utils.toChainFormat)(params.order.price).toFixed(),
|
|
1666
|
+
quantity: (0, __injectivelabs_utils.toChainFormat)(params.order.quantity).toFixed()
|
|
1667
|
+
},
|
|
1668
|
+
margin: (0, __injectivelabs_utils.toChainFormat)(params.order.margin).toFixed(),
|
|
1669
|
+
trigger_price: (0, __injectivelabs_utils.toChainFormat)(params.order.triggerPrice || "0").toFixed()
|
|
1670
|
+
} : void 0
|
|
1671
|
+
}
|
|
1672
|
+
};
|
|
1673
|
+
}
|
|
1674
|
+
toEip712Types() {
|
|
1675
|
+
const eip712 = this.toEip712();
|
|
1676
|
+
return require_MsgBase.patchOrderTypesWithExpirationBlock(require_MsgBase.objectKeysToEip712Types({
|
|
1677
|
+
object: eip712.value,
|
|
1678
|
+
messageType: eip712.type
|
|
1679
|
+
}), ["TypeOrder"]);
|
|
1680
|
+
}
|
|
1681
|
+
toDirectSign() {
|
|
1682
|
+
return {
|
|
1683
|
+
type: "/injective.exchange.v2.MsgLiquidatePosition",
|
|
1684
|
+
message: this.toProto()
|
|
1685
|
+
};
|
|
1686
|
+
}
|
|
1687
|
+
toBinary() {
|
|
1688
|
+
return __injectivelabs_core_proto_ts_v2_generated_injective_exchange_v2_tx_pb.MsgLiquidatePosition.toBinary(this.toProto());
|
|
1689
|
+
}
|
|
1690
|
+
};
|
|
1691
|
+
|
|
1692
|
+
//#endregion
|
|
1693
|
+
//#region src/core/modules/exchange/msgs/MsgCancelPostOnlyModeV2.ts
|
|
1694
|
+
const createMessage$9 = (params) => {
|
|
1695
|
+
return __injectivelabs_core_proto_ts_v2_generated_injective_exchange_v2_tx_pb.MsgCancelPostOnlyMode.create({ sender: params.sender });
|
|
1696
|
+
};
|
|
1697
|
+
/**
|
|
1698
|
+
* @category Messages
|
|
1699
|
+
*/
|
|
1700
|
+
var MsgCancelPostOnlyModeV2 = class MsgCancelPostOnlyModeV2 extends require_MsgBase.MsgBase {
|
|
1701
|
+
static fromJSON(params) {
|
|
1702
|
+
return new MsgCancelPostOnlyModeV2(params);
|
|
1703
|
+
}
|
|
1704
|
+
toProto() {
|
|
1705
|
+
const { params: initialParams } = this;
|
|
1706
|
+
return createMessage$9({ ...initialParams });
|
|
1707
|
+
}
|
|
1708
|
+
toData() {
|
|
1709
|
+
const proto = this.toProto();
|
|
1710
|
+
return {
|
|
1711
|
+
"@type": "/injective.exchange.v2.MsgCancelPostOnlyMode",
|
|
1712
|
+
...proto
|
|
1713
|
+
};
|
|
1714
|
+
}
|
|
1715
|
+
toAmino() {
|
|
1716
|
+
const { params } = this;
|
|
1717
|
+
return {
|
|
1718
|
+
type: "exchange/MsgCancelPostOnlyMode",
|
|
1719
|
+
value: { sender: createMessage$9(params).sender }
|
|
1720
|
+
};
|
|
1721
|
+
}
|
|
1722
|
+
toWeb3Gw() {
|
|
1723
|
+
const { value } = this.toAmino();
|
|
1724
|
+
return {
|
|
1725
|
+
"@type": "/injective.exchange.v2.MsgCancelPostOnlyMode",
|
|
1726
|
+
...value
|
|
1727
|
+
};
|
|
1728
|
+
}
|
|
1729
|
+
toEip712() {
|
|
1730
|
+
const { type, value } = this.toAmino();
|
|
1731
|
+
return {
|
|
1732
|
+
type,
|
|
1733
|
+
value: { ...value }
|
|
1734
|
+
};
|
|
1735
|
+
}
|
|
1736
|
+
toEip712V2() {
|
|
1737
|
+
return { ...this.toWeb3Gw() };
|
|
1738
|
+
}
|
|
1739
|
+
toDirectSign() {
|
|
1740
|
+
return {
|
|
1741
|
+
type: "/injective.exchange.v2.MsgCancelPostOnlyMode",
|
|
1742
|
+
message: this.toProto()
|
|
1743
|
+
};
|
|
1744
|
+
}
|
|
1745
|
+
toBinary() {
|
|
1746
|
+
return __injectivelabs_core_proto_ts_v2_generated_injective_exchange_v2_tx_pb.MsgCancelPostOnlyMode.toBinary(this.toProto());
|
|
1747
|
+
}
|
|
1748
|
+
};
|
|
1749
|
+
|
|
1750
|
+
//#endregion
|
|
1751
|
+
//#region src/core/modules/exchange/msgs/MsgCreateSpotLimitOrder.ts
|
|
1752
|
+
const createLimitOrder$5 = (params) => {
|
|
1753
|
+
const orderInfo = __injectivelabs_core_proto_ts_v2_generated_injective_exchange_v1beta1_exchange_pb.OrderInfo.create({
|
|
1754
|
+
subaccountId: params.subaccountId,
|
|
1755
|
+
feeRecipient: params.feeRecipient,
|
|
1756
|
+
price: params.price,
|
|
1757
|
+
quantity: params.quantity,
|
|
1758
|
+
cid: params.cid || ""
|
|
1759
|
+
});
|
|
1760
|
+
const spotOrder = __injectivelabs_core_proto_ts_v2_generated_injective_exchange_v1beta1_exchange_pb.SpotOrder.create({
|
|
1761
|
+
marketId: params.marketId,
|
|
1762
|
+
orderInfo,
|
|
1763
|
+
orderType: params.orderType,
|
|
1764
|
+
triggerPrice: params.triggerPrice || "0"
|
|
1765
|
+
});
|
|
1766
|
+
return __injectivelabs_core_proto_ts_v2_generated_injective_exchange_v1beta1_tx_pb.MsgCreateSpotLimitOrder.create({
|
|
1767
|
+
sender: params.injectiveAddress,
|
|
1768
|
+
order: spotOrder
|
|
1769
|
+
});
|
|
1770
|
+
};
|
|
1771
|
+
/**
|
|
1772
|
+
* @category Messages
|
|
1773
|
+
*/
|
|
1774
|
+
var MsgCreateSpotLimitOrder = class MsgCreateSpotLimitOrder extends require_MsgBase.MsgBase {
|
|
1775
|
+
static fromJSON(params) {
|
|
1776
|
+
return new MsgCreateSpotLimitOrder(params);
|
|
1777
|
+
}
|
|
1778
|
+
toProto() {
|
|
1779
|
+
const { params: initialParams } = this;
|
|
1780
|
+
return createLimitOrder$5({
|
|
1781
|
+
...initialParams,
|
|
1782
|
+
price: (0, __injectivelabs_utils.toChainFormat)(initialParams.price).toFixed(),
|
|
1783
|
+
triggerPrice: (0, __injectivelabs_utils.toChainFormat)(initialParams.triggerPrice || 0).toFixed(),
|
|
1784
|
+
quantity: (0, __injectivelabs_utils.toChainFormat)(initialParams.quantity).toFixed()
|
|
1785
|
+
});
|
|
1786
|
+
}
|
|
1787
|
+
toData() {
|
|
1788
|
+
const proto = this.toProto();
|
|
1789
|
+
return {
|
|
1790
|
+
"@type": "/injective.exchange.v1beta1.MsgCreateSpotLimitOrder",
|
|
1791
|
+
...proto
|
|
1792
|
+
};
|
|
1793
|
+
}
|
|
1794
|
+
toAmino() {
|
|
1795
|
+
const { params } = this;
|
|
1796
|
+
return {
|
|
1797
|
+
type: "exchange/MsgCreateSpotLimitOrder",
|
|
1798
|
+
value: {
|
|
1799
|
+
sender: params.injectiveAddress,
|
|
1800
|
+
order: {
|
|
1801
|
+
market_id: params.marketId,
|
|
1802
|
+
order_info: {
|
|
1803
|
+
subaccount_id: params.subaccountId,
|
|
1804
|
+
fee_recipient: params.feeRecipient,
|
|
1805
|
+
price: params.price,
|
|
1806
|
+
quantity: params.quantity,
|
|
1807
|
+
cid: params.cid || ""
|
|
1808
|
+
},
|
|
1809
|
+
order_type: params.orderType,
|
|
1810
|
+
trigger_price: params.triggerPrice || "0"
|
|
1811
|
+
}
|
|
1812
|
+
}
|
|
1813
|
+
};
|
|
1814
|
+
}
|
|
1815
|
+
toWeb3Gw() {
|
|
1816
|
+
const { value } = this.toAmino();
|
|
1817
|
+
return {
|
|
1818
|
+
"@type": "/injective.exchange.v1beta1.MsgCreateSpotLimitOrder",
|
|
1819
|
+
...value
|
|
1820
|
+
};
|
|
1821
|
+
}
|
|
1822
|
+
toEip712V2() {
|
|
1823
|
+
const { params } = this;
|
|
1824
|
+
const web3gw = this.toWeb3Gw();
|
|
1825
|
+
const order = web3gw.order;
|
|
1826
|
+
return {
|
|
1827
|
+
...web3gw,
|
|
1828
|
+
order: {
|
|
1829
|
+
...order,
|
|
1830
|
+
order_info: {
|
|
1831
|
+
...order.order_info,
|
|
1832
|
+
price: require_utils.numberToCosmosSdkDecString(params.price),
|
|
1833
|
+
quantity: require_utils.numberToCosmosSdkDecString(params.quantity)
|
|
1834
|
+
},
|
|
1835
|
+
trigger_price: require_utils.numberToCosmosSdkDecString(params.triggerPrice || "0"),
|
|
1836
|
+
order_type: __injectivelabs_core_proto_ts_v2_generated_injective_exchange_v1beta1_exchange_pb.OrderType[params.orderType]
|
|
1837
|
+
}
|
|
1838
|
+
};
|
|
1839
|
+
}
|
|
1840
|
+
toEip712() {
|
|
1841
|
+
var _value$order;
|
|
1842
|
+
const { params } = this;
|
|
1843
|
+
const { value, type } = this.toAmino();
|
|
1844
|
+
return {
|
|
1845
|
+
type,
|
|
1846
|
+
value: {
|
|
1847
|
+
...value,
|
|
1848
|
+
order: {
|
|
1849
|
+
...value.order,
|
|
1850
|
+
order_info: {
|
|
1851
|
+
...(_value$order = value.order) === null || _value$order === void 0 ? void 0 : _value$order.order_info,
|
|
1852
|
+
price: (0, __injectivelabs_utils.toChainFormat)(params.price).toFixed(),
|
|
1853
|
+
quantity: (0, __injectivelabs_utils.toChainFormat)(params.quantity).toFixed()
|
|
1854
|
+
},
|
|
1855
|
+
trigger_price: (0, __injectivelabs_utils.toChainFormat)(params.triggerPrice || "0").toFixed()
|
|
1856
|
+
}
|
|
1857
|
+
}
|
|
1858
|
+
};
|
|
1859
|
+
}
|
|
1860
|
+
toDirectSign() {
|
|
1861
|
+
return {
|
|
1862
|
+
type: "/injective.exchange.v1beta1.MsgCreateSpotLimitOrder",
|
|
1863
|
+
message: this.toProto()
|
|
1864
|
+
};
|
|
1865
|
+
}
|
|
1866
|
+
toBinary() {
|
|
1867
|
+
return __injectivelabs_core_proto_ts_v2_generated_injective_exchange_v1beta1_tx_pb.MsgCreateSpotLimitOrder.toBinary(this.toProto());
|
|
1868
|
+
}
|
|
1869
|
+
};
|
|
1870
|
+
|
|
1871
|
+
//#endregion
|
|
1872
|
+
//#region src/core/modules/exchange/msgs/MsgAuthorizeStakeGrants.ts
|
|
1873
|
+
/**
|
|
1874
|
+
* @category Messages
|
|
1875
|
+
*/
|
|
1876
|
+
var MsgAuthorizeStakeGrants = class MsgAuthorizeStakeGrants extends require_MsgBase.MsgBase {
|
|
1877
|
+
static fromJSON(params) {
|
|
1878
|
+
return new MsgAuthorizeStakeGrants(params);
|
|
1879
|
+
}
|
|
1880
|
+
toProto() {
|
|
1881
|
+
const { params } = this;
|
|
1882
|
+
return __injectivelabs_core_proto_ts_v2_generated_injective_exchange_v1beta1_tx_pb.MsgAuthorizeStakeGrants.create({
|
|
1883
|
+
sender: params.injectiveAddress,
|
|
1884
|
+
grants: [{
|
|
1885
|
+
grantee: params.grantee,
|
|
1886
|
+
amount: params.amount
|
|
1887
|
+
}]
|
|
1888
|
+
});
|
|
1889
|
+
}
|
|
1890
|
+
toData() {
|
|
1891
|
+
const proto = this.toProto();
|
|
1892
|
+
return {
|
|
1893
|
+
"@type": "/injective.exchange.v1beta1.MsgAuthorizeStakeGrants",
|
|
1894
|
+
...proto
|
|
1895
|
+
};
|
|
1896
|
+
}
|
|
1897
|
+
toAmino() {
|
|
1898
|
+
const proto = this.toProto();
|
|
1899
|
+
return {
|
|
1900
|
+
type: "exchange/MsgAuthorizeStakeGrants",
|
|
1901
|
+
value: {
|
|
1902
|
+
sender: proto.sender,
|
|
1903
|
+
grants: proto.grants
|
|
1904
|
+
}
|
|
1905
|
+
};
|
|
1906
|
+
}
|
|
1907
|
+
toWeb3Gw() {
|
|
1908
|
+
const { value } = this.toAmino();
|
|
1909
|
+
return {
|
|
1910
|
+
"@type": "/injective.exchange.v1beta1.MsgAuthorizeStakeGrants",
|
|
1911
|
+
...value
|
|
1912
|
+
};
|
|
1913
|
+
}
|
|
1914
|
+
toDirectSign() {
|
|
1915
|
+
return {
|
|
1916
|
+
type: "/injective.exchange.v1beta1.MsgAuthorizeStakeGrants",
|
|
1917
|
+
message: this.toProto()
|
|
1918
|
+
};
|
|
1919
|
+
}
|
|
1920
|
+
toBinary() {
|
|
1921
|
+
return __injectivelabs_core_proto_ts_v2_generated_injective_exchange_v1beta1_tx_pb.MsgAuthorizeStakeGrants.toBinary(this.toProto());
|
|
1922
|
+
}
|
|
1923
|
+
};
|
|
1924
|
+
|
|
1925
|
+
//#endregion
|
|
1926
|
+
//#region src/core/modules/exchange/msgs/MsgReclaimLockedFundsV2.ts
|
|
1927
|
+
/**
|
|
1928
|
+
* @category Messages
|
|
1929
|
+
*/
|
|
1930
|
+
var MsgReclaimLockedFundsV2 = class MsgReclaimLockedFundsV2 extends require_MsgBase.MsgBase {
|
|
1931
|
+
static fromJSON(params) {
|
|
1932
|
+
return new MsgReclaimLockedFundsV2(params);
|
|
1933
|
+
}
|
|
1934
|
+
toProto() {
|
|
1935
|
+
const { params } = this;
|
|
1936
|
+
return __injectivelabs_core_proto_ts_v2_generated_injective_exchange_v2_tx_pb.MsgReclaimLockedFunds.create({
|
|
1937
|
+
sender: params.sender,
|
|
1938
|
+
lockedAccountPubKey: require_utils.base64ToUint8Array(params.lockedAccountPubKey),
|
|
1939
|
+
signature: params.signature
|
|
1940
|
+
});
|
|
1941
|
+
}
|
|
1942
|
+
toData() {
|
|
1943
|
+
const proto = this.toProto();
|
|
1944
|
+
return {
|
|
1945
|
+
"@type": "/injective.exchange.v2.MsgReclaimLockedFunds",
|
|
1946
|
+
...proto
|
|
1947
|
+
};
|
|
1948
|
+
}
|
|
1949
|
+
toAmino() {
|
|
1950
|
+
const proto = this.toProto();
|
|
1951
|
+
return {
|
|
1952
|
+
type: "exchange/MsgReclaimLockedFunds",
|
|
1953
|
+
value: {
|
|
1954
|
+
sender: proto.sender,
|
|
1955
|
+
lockedAccountPubKey: require_utils.uint8ArrayToBase64(proto.lockedAccountPubKey),
|
|
1956
|
+
signature: require_utils.uint8ArrayToBase64(proto.signature)
|
|
1957
|
+
}
|
|
1958
|
+
};
|
|
1959
|
+
}
|
|
1960
|
+
toWeb3Gw() {
|
|
1961
|
+
throw new __injectivelabs_exceptions.GeneralException(/* @__PURE__ */ new Error("EIP712 is not supported for MsgReclaimLockedFunds."));
|
|
1962
|
+
}
|
|
1963
|
+
toEip712() {
|
|
1964
|
+
throw new __injectivelabs_exceptions.GeneralException(/* @__PURE__ */ new Error("EIP712 is not supported for MsgReclaimLockedFunds."));
|
|
1965
|
+
}
|
|
1966
|
+
toEip712V2() {
|
|
1967
|
+
throw new __injectivelabs_exceptions.GeneralException(/* @__PURE__ */ new Error("EIP712 is not supported for MsgReclaimLockedFunds."));
|
|
1968
|
+
}
|
|
1969
|
+
toDirectSign() {
|
|
1970
|
+
return {
|
|
1971
|
+
type: "/injective.exchange.v2.MsgReclaimLockedFunds",
|
|
1972
|
+
message: this.toProto()
|
|
1973
|
+
};
|
|
1974
|
+
}
|
|
1975
|
+
toBinary() {
|
|
1976
|
+
return __injectivelabs_core_proto_ts_v2_generated_injective_exchange_v2_tx_pb.MsgReclaimLockedFunds.toBinary(this.toProto());
|
|
1977
|
+
}
|
|
1978
|
+
};
|
|
1979
|
+
|
|
1980
|
+
//#endregion
|
|
1981
|
+
//#region src/core/modules/exchange/msgs/MsgBatchCancelSpotOrders.ts
|
|
1982
|
+
/**
|
|
1983
|
+
* @category Messages
|
|
1984
|
+
*/
|
|
1985
|
+
var MsgBatchCancelSpotOrders = class MsgBatchCancelSpotOrders extends require_MsgBase.MsgBase {
|
|
1986
|
+
static fromJSON(params) {
|
|
1987
|
+
return new MsgBatchCancelSpotOrders(params);
|
|
1988
|
+
}
|
|
1989
|
+
toProto() {
|
|
1990
|
+
const { params } = this;
|
|
1991
|
+
const orderDataList = params.orders.map((order) => {
|
|
1992
|
+
return __injectivelabs_core_proto_ts_v2_generated_injective_exchange_v1beta1_tx_pb.OrderData.create({
|
|
1993
|
+
marketId: order.marketId,
|
|
1994
|
+
subaccountId: order.subaccountId,
|
|
1995
|
+
orderHash: order.orderHash || "",
|
|
1996
|
+
orderMask: order.orderMask || __injectivelabs_core_proto_ts_v2_generated_injective_exchange_v1beta1_exchange_pb.OrderMask.ANY,
|
|
1997
|
+
cid: order.cid || ""
|
|
1998
|
+
});
|
|
1999
|
+
});
|
|
2000
|
+
return __injectivelabs_core_proto_ts_v2_generated_injective_exchange_v1beta1_tx_pb.MsgBatchCancelSpotOrders.create({
|
|
2001
|
+
sender: params.injectiveAddress,
|
|
2002
|
+
data: orderDataList
|
|
2003
|
+
});
|
|
2004
|
+
}
|
|
2005
|
+
toData() {
|
|
2006
|
+
const proto = this.toProto();
|
|
2007
|
+
return {
|
|
2008
|
+
"@type": "/injective.exchange.v1beta1.MsgBatchCancelSpotOrders",
|
|
2009
|
+
...proto
|
|
2010
|
+
};
|
|
2011
|
+
}
|
|
2012
|
+
toAmino() {
|
|
2013
|
+
const proto = this.toProto();
|
|
2014
|
+
return {
|
|
2015
|
+
type: "exchange/MsgBatchCancelSpotOrders",
|
|
2016
|
+
value: {
|
|
2017
|
+
sender: proto.sender,
|
|
2018
|
+
data: proto.data.map((orderData) => ({
|
|
2019
|
+
market_id: orderData.marketId,
|
|
2020
|
+
subaccount_id: orderData.subaccountId,
|
|
2021
|
+
order_hash: orderData.orderHash,
|
|
2022
|
+
order_mask: orderData.orderMask,
|
|
2023
|
+
cid: orderData.cid
|
|
2024
|
+
}))
|
|
2025
|
+
}
|
|
2026
|
+
};
|
|
2027
|
+
}
|
|
2028
|
+
toWeb3Gw() {
|
|
2029
|
+
const { value } = this.toAmino();
|
|
2030
|
+
return {
|
|
2031
|
+
"@type": "/injective.exchange.v1beta1.MsgBatchCancelSpotOrders",
|
|
2032
|
+
...value
|
|
2033
|
+
};
|
|
2034
|
+
}
|
|
2035
|
+
toDirectSign() {
|
|
2036
|
+
return {
|
|
2037
|
+
type: "/injective.exchange.v1beta1.MsgBatchCancelSpotOrders",
|
|
2038
|
+
message: this.toProto()
|
|
2039
|
+
};
|
|
2040
|
+
}
|
|
2041
|
+
toBinary() {
|
|
2042
|
+
return __injectivelabs_core_proto_ts_v2_generated_injective_exchange_v1beta1_tx_pb.MsgBatchCancelSpotOrders.toBinary(this.toProto());
|
|
2043
|
+
}
|
|
2044
|
+
};
|
|
2045
|
+
|
|
2046
|
+
//#endregion
|
|
2047
|
+
//#region src/core/modules/exchange/msgs/MsgCancelDerivativeOrder.ts
|
|
2048
|
+
var MsgCancelDerivativeOrder = class MsgCancelDerivativeOrder extends require_MsgBase.MsgBase {
|
|
2049
|
+
static fromJSON(params) {
|
|
2050
|
+
return new MsgCancelDerivativeOrder(params);
|
|
2051
|
+
}
|
|
2052
|
+
toProto() {
|
|
2053
|
+
const { params } = this;
|
|
2054
|
+
return __injectivelabs_core_proto_ts_v2_generated_injective_exchange_v1beta1_tx_pb.MsgCancelDerivativeOrder.create({
|
|
2055
|
+
sender: params.injectiveAddress,
|
|
2056
|
+
marketId: params.marketId,
|
|
2057
|
+
subaccountId: params.subaccountId,
|
|
2058
|
+
orderHash: params.orderHash || "",
|
|
2059
|
+
orderMask: params.orderMask || __injectivelabs_core_proto_ts_v2_generated_injective_exchange_v1beta1_exchange_pb.OrderMask.ANY,
|
|
2060
|
+
cid: params.cid || ""
|
|
2061
|
+
});
|
|
2062
|
+
}
|
|
2063
|
+
toData() {
|
|
2064
|
+
const proto = this.toProto();
|
|
2065
|
+
return {
|
|
2066
|
+
"@type": "/injective.exchange.v1beta1.MsgCancelDerivativeOrder",
|
|
2067
|
+
...proto
|
|
2068
|
+
};
|
|
2069
|
+
}
|
|
2070
|
+
toAmino() {
|
|
2071
|
+
const proto = this.toProto();
|
|
2072
|
+
return {
|
|
2073
|
+
type: "exchange/MsgCancelDerivativeOrder",
|
|
2074
|
+
value: {
|
|
2075
|
+
sender: proto.sender,
|
|
2076
|
+
market_id: proto.marketId,
|
|
2077
|
+
subaccount_id: proto.subaccountId,
|
|
2078
|
+
order_hash: proto.orderHash,
|
|
2079
|
+
order_mask: proto.orderMask,
|
|
2080
|
+
cid: proto.cid
|
|
2081
|
+
}
|
|
2082
|
+
};
|
|
2083
|
+
}
|
|
2084
|
+
toWeb3Gw() {
|
|
2085
|
+
const { value } = this.toAmino();
|
|
2086
|
+
return {
|
|
2087
|
+
"@type": "/injective.exchange.v1beta1.MsgCancelDerivativeOrder",
|
|
2088
|
+
...value
|
|
2089
|
+
};
|
|
2090
|
+
}
|
|
2091
|
+
toDirectSign() {
|
|
2092
|
+
return {
|
|
2093
|
+
type: "/injective.exchange.v1beta1.MsgCancelDerivativeOrder",
|
|
2094
|
+
message: this.toProto()
|
|
2095
|
+
};
|
|
2096
|
+
}
|
|
2097
|
+
toBinary() {
|
|
2098
|
+
return __injectivelabs_core_proto_ts_v2_generated_injective_exchange_v1beta1_tx_pb.MsgCancelDerivativeOrder.toBinary(this.toProto());
|
|
2099
|
+
}
|
|
2100
|
+
};
|
|
2101
|
+
|
|
2102
|
+
//#endregion
|
|
2103
|
+
//#region src/core/modules/exchange/msgs/MsgCreateSpotMarketOrder.ts
|
|
2104
|
+
const createMarketOrder$5 = (params) => {
|
|
2105
|
+
const orderInfo = __injectivelabs_core_proto_ts_v2_generated_injective_exchange_v1beta1_exchange_pb.OrderInfo.create({
|
|
2106
|
+
subaccountId: params.subaccountId,
|
|
2107
|
+
feeRecipient: params.feeRecipient,
|
|
2108
|
+
price: params.price,
|
|
2109
|
+
quantity: params.quantity,
|
|
2110
|
+
cid: params.cid || ""
|
|
2111
|
+
});
|
|
2112
|
+
const spotOrder = __injectivelabs_core_proto_ts_v2_generated_injective_exchange_v1beta1_exchange_pb.SpotOrder.create({
|
|
2113
|
+
marketId: params.marketId,
|
|
2114
|
+
orderInfo,
|
|
2115
|
+
orderType: params.orderType,
|
|
2116
|
+
triggerPrice: params.triggerPrice || "0"
|
|
2117
|
+
});
|
|
2118
|
+
return __injectivelabs_core_proto_ts_v2_generated_injective_exchange_v1beta1_tx_pb.MsgCreateSpotMarketOrder.create({
|
|
2119
|
+
sender: params.injectiveAddress,
|
|
2120
|
+
order: spotOrder
|
|
2121
|
+
});
|
|
2122
|
+
};
|
|
2123
|
+
/**
|
|
2124
|
+
* @category Messages
|
|
2125
|
+
*/
|
|
2126
|
+
var MsgCreateSpotMarketOrder = class MsgCreateSpotMarketOrder extends require_MsgBase.MsgBase {
|
|
2127
|
+
static fromJSON(params) {
|
|
2128
|
+
return new MsgCreateSpotMarketOrder(params);
|
|
2129
|
+
}
|
|
2130
|
+
toProto() {
|
|
2131
|
+
const { params: initialParams } = this;
|
|
2132
|
+
return createMarketOrder$5({
|
|
2133
|
+
...initialParams,
|
|
2134
|
+
price: (0, __injectivelabs_utils.toChainFormat)(initialParams.price).toFixed(),
|
|
2135
|
+
triggerPrice: (0, __injectivelabs_utils.toChainFormat)(initialParams.triggerPrice || 0).toFixed(),
|
|
2136
|
+
quantity: (0, __injectivelabs_utils.toChainFormat)(initialParams.quantity).toFixed()
|
|
2137
|
+
});
|
|
2138
|
+
}
|
|
2139
|
+
toData() {
|
|
2140
|
+
const proto = this.toProto();
|
|
2141
|
+
return {
|
|
2142
|
+
"@type": "/injective.exchange.v1beta1.MsgCreateSpotMarketOrder",
|
|
2143
|
+
...proto
|
|
2144
|
+
};
|
|
2145
|
+
}
|
|
2146
|
+
toAmino() {
|
|
2147
|
+
const { params } = this;
|
|
2148
|
+
return {
|
|
2149
|
+
type: "exchange/MsgCreateSpotMarketOrder",
|
|
2150
|
+
value: {
|
|
2151
|
+
sender: params.injectiveAddress,
|
|
2152
|
+
order: {
|
|
2153
|
+
market_id: params.marketId,
|
|
2154
|
+
order_info: {
|
|
2155
|
+
subaccount_id: params.subaccountId,
|
|
2156
|
+
fee_recipient: params.feeRecipient,
|
|
2157
|
+
price: params.price,
|
|
2158
|
+
quantity: params.quantity,
|
|
2159
|
+
cid: params.cid || ""
|
|
2160
|
+
},
|
|
2161
|
+
order_type: params.orderType,
|
|
2162
|
+
trigger_price: params.triggerPrice || "0"
|
|
2163
|
+
}
|
|
2164
|
+
}
|
|
2165
|
+
};
|
|
2166
|
+
}
|
|
2167
|
+
toWeb3Gw() {
|
|
2168
|
+
const { value } = this.toAmino();
|
|
2169
|
+
return {
|
|
2170
|
+
"@type": "/injective.exchange.v1beta1.MsgCreateSpotMarketOrder",
|
|
2171
|
+
...value
|
|
2172
|
+
};
|
|
2173
|
+
}
|
|
2174
|
+
toEip712V2() {
|
|
2175
|
+
const { params } = this;
|
|
2176
|
+
const web3gw = this.toWeb3Gw();
|
|
2177
|
+
const order = web3gw.order;
|
|
2178
|
+
return {
|
|
2179
|
+
...web3gw,
|
|
2180
|
+
order: {
|
|
2181
|
+
...order,
|
|
2182
|
+
order_info: {
|
|
2183
|
+
...order.order_info,
|
|
2184
|
+
price: require_utils.numberToCosmosSdkDecString(params.price),
|
|
2185
|
+
quantity: require_utils.numberToCosmosSdkDecString(params.quantity)
|
|
2186
|
+
},
|
|
2187
|
+
trigger_price: require_utils.numberToCosmosSdkDecString(params.triggerPrice || "0"),
|
|
2188
|
+
order_type: __injectivelabs_core_proto_ts_v2_generated_injective_exchange_v1beta1_exchange_pb.OrderType[params.orderType]
|
|
2189
|
+
}
|
|
2190
|
+
};
|
|
2191
|
+
}
|
|
2192
|
+
toEip712() {
|
|
2193
|
+
var _value$order;
|
|
2194
|
+
const { params } = this;
|
|
2195
|
+
const { value, type } = this.toAmino();
|
|
2196
|
+
return {
|
|
2197
|
+
type,
|
|
2198
|
+
value: {
|
|
2199
|
+
...value,
|
|
2200
|
+
order: {
|
|
2201
|
+
...value.order,
|
|
2202
|
+
order_info: {
|
|
2203
|
+
...(_value$order = value.order) === null || _value$order === void 0 ? void 0 : _value$order.order_info,
|
|
2204
|
+
price: (0, __injectivelabs_utils.toChainFormat)(params.price).toFixed(),
|
|
2205
|
+
quantity: (0, __injectivelabs_utils.toChainFormat)(params.quantity).toFixed()
|
|
2206
|
+
},
|
|
2207
|
+
trigger_price: (0, __injectivelabs_utils.toChainFormat)(params.triggerPrice || "0").toFixed()
|
|
2208
|
+
}
|
|
2209
|
+
}
|
|
2210
|
+
};
|
|
2211
|
+
}
|
|
2212
|
+
toDirectSign() {
|
|
2213
|
+
return {
|
|
2214
|
+
type: "/injective.exchange.v1beta1.MsgCreateSpotMarketOrder",
|
|
2215
|
+
message: this.toProto()
|
|
2216
|
+
};
|
|
2217
|
+
}
|
|
2218
|
+
toBinary() {
|
|
2219
|
+
return __injectivelabs_core_proto_ts_v2_generated_injective_exchange_v1beta1_tx_pb.MsgCreateSpotMarketOrder.toBinary(this.toProto());
|
|
2220
|
+
}
|
|
2221
|
+
};
|
|
2222
|
+
|
|
2223
|
+
//#endregion
|
|
2224
|
+
//#region src/core/modules/exchange/msgs/MsgAuthorizeStakeGrantsV2.ts
|
|
2225
|
+
/**
|
|
2226
|
+
* @category Messages
|
|
2227
|
+
*/
|
|
2228
|
+
var MsgAuthorizeStakeGrantsV2 = class MsgAuthorizeStakeGrantsV2 extends require_MsgBase.MsgBase {
|
|
2229
|
+
static fromJSON(params) {
|
|
2230
|
+
return new MsgAuthorizeStakeGrantsV2(params);
|
|
2231
|
+
}
|
|
2232
|
+
toProto() {
|
|
2233
|
+
const { params } = this;
|
|
2234
|
+
return __injectivelabs_core_proto_ts_v2_generated_injective_exchange_v2_tx_pb.MsgAuthorizeStakeGrants.create({
|
|
2235
|
+
sender: params.injectiveAddress,
|
|
2236
|
+
grants: params.grants.map(({ grantee, amount }) => ({
|
|
2237
|
+
grantee,
|
|
2238
|
+
amount
|
|
2239
|
+
}))
|
|
2240
|
+
});
|
|
2241
|
+
}
|
|
2242
|
+
toData() {
|
|
2243
|
+
const proto = this.toProto();
|
|
2244
|
+
return {
|
|
2245
|
+
"@type": "/injective.exchange.v2.MsgAuthorizeStakeGrants",
|
|
2246
|
+
...proto
|
|
2247
|
+
};
|
|
2248
|
+
}
|
|
2249
|
+
toAmino() {
|
|
2250
|
+
const proto = this.toProto();
|
|
2251
|
+
return {
|
|
2252
|
+
type: "exchange/MsgAuthorizeStakeGrants",
|
|
2253
|
+
value: {
|
|
2254
|
+
sender: proto.sender,
|
|
2255
|
+
grants: proto.grants
|
|
2256
|
+
}
|
|
2257
|
+
};
|
|
2258
|
+
}
|
|
2259
|
+
toWeb3Gw() {
|
|
2260
|
+
const { value } = this.toAmino();
|
|
2261
|
+
return {
|
|
2262
|
+
"@type": "/injective.exchange.v2.MsgAuthorizeStakeGrants",
|
|
2263
|
+
...value
|
|
2264
|
+
};
|
|
2265
|
+
}
|
|
2266
|
+
toDirectSign() {
|
|
2267
|
+
return {
|
|
2268
|
+
type: "/injective.exchange.v2.MsgAuthorizeStakeGrants",
|
|
2269
|
+
message: this.toProto()
|
|
2270
|
+
};
|
|
2271
|
+
}
|
|
2272
|
+
toBinary() {
|
|
2273
|
+
return __injectivelabs_core_proto_ts_v2_generated_injective_exchange_v2_tx_pb.MsgAuthorizeStakeGrants.toBinary(this.toProto());
|
|
2274
|
+
}
|
|
2275
|
+
};
|
|
2276
|
+
|
|
2277
|
+
//#endregion
|
|
2278
|
+
//#region src/core/modules/exchange/msgs/MsgCreateSpotLimitOrderV2.ts
|
|
2279
|
+
const createLimitOrder$4 = (params) => {
|
|
2280
|
+
const orderInfo = __injectivelabs_core_proto_ts_v2_generated_injective_exchange_v2_order_pb.OrderInfo.create({
|
|
2281
|
+
subaccountId: params.subaccountId,
|
|
2282
|
+
feeRecipient: params.feeRecipient,
|
|
2283
|
+
price: params.price,
|
|
2284
|
+
quantity: params.quantity,
|
|
2285
|
+
cid: params.cid || ""
|
|
2286
|
+
});
|
|
2287
|
+
const spotOrder = __injectivelabs_core_proto_ts_v2_generated_injective_exchange_v2_order_pb.SpotOrder.create({
|
|
2288
|
+
marketId: params.marketId,
|
|
2289
|
+
orderInfo,
|
|
2290
|
+
orderType: params.orderType,
|
|
2291
|
+
triggerPrice: params.triggerPrice || "0",
|
|
2292
|
+
expirationBlock: params.expirationBlock ? BigInt(params.expirationBlock) : BigInt(0)
|
|
2293
|
+
});
|
|
2294
|
+
return __injectivelabs_core_proto_ts_v2_generated_injective_exchange_v2_tx_pb.MsgCreateSpotLimitOrder.create({
|
|
2295
|
+
sender: params.injectiveAddress,
|
|
2296
|
+
order: spotOrder
|
|
2297
|
+
});
|
|
2298
|
+
};
|
|
2299
|
+
/**
|
|
2300
|
+
* @category Messages
|
|
2301
|
+
*/
|
|
2302
|
+
var MsgCreateSpotLimitOrderV2 = class MsgCreateSpotLimitOrderV2 extends require_MsgBase.MsgBase {
|
|
2303
|
+
static fromJSON(params) {
|
|
2304
|
+
return new MsgCreateSpotLimitOrderV2(params);
|
|
2305
|
+
}
|
|
2306
|
+
toProto() {
|
|
2307
|
+
const { params: initialParams } = this;
|
|
2308
|
+
return createLimitOrder$4({
|
|
2309
|
+
...initialParams,
|
|
2310
|
+
price: (0, __injectivelabs_utils.toChainFormat)(initialParams.price).toFixed(),
|
|
2311
|
+
triggerPrice: (0, __injectivelabs_utils.toChainFormat)(initialParams.triggerPrice || 0).toFixed(),
|
|
2312
|
+
quantity: (0, __injectivelabs_utils.toChainFormat)(initialParams.quantity).toFixed()
|
|
2313
|
+
});
|
|
2314
|
+
}
|
|
2315
|
+
toData() {
|
|
2316
|
+
const proto = this.toProto();
|
|
2317
|
+
return {
|
|
2318
|
+
"@type": "/injective.exchange.v2.MsgCreateSpotLimitOrder",
|
|
2319
|
+
...proto
|
|
2320
|
+
};
|
|
2321
|
+
}
|
|
2322
|
+
toAmino() {
|
|
2323
|
+
const { params } = this;
|
|
2324
|
+
return {
|
|
2325
|
+
type: "exchange/MsgCreateSpotLimitOrder",
|
|
2326
|
+
value: {
|
|
2327
|
+
sender: params.injectiveAddress,
|
|
2328
|
+
order: {
|
|
2329
|
+
market_id: params.marketId,
|
|
2330
|
+
order_info: {
|
|
2331
|
+
subaccount_id: params.subaccountId,
|
|
2332
|
+
fee_recipient: params.feeRecipient,
|
|
2333
|
+
price: params.price,
|
|
2334
|
+
quantity: params.quantity,
|
|
2335
|
+
cid: params.cid || ""
|
|
2336
|
+
},
|
|
2337
|
+
order_type: params.orderType,
|
|
2338
|
+
trigger_price: params.triggerPrice || "0",
|
|
2339
|
+
expiration_block: params.expirationBlock || "0"
|
|
2340
|
+
}
|
|
2341
|
+
}
|
|
2342
|
+
};
|
|
2343
|
+
}
|
|
2344
|
+
toWeb3Gw() {
|
|
2345
|
+
const { value } = this.toAmino();
|
|
2346
|
+
return {
|
|
2347
|
+
"@type": "/injective.exchange.v2.MsgCreateSpotLimitOrder",
|
|
2348
|
+
...value
|
|
2349
|
+
};
|
|
2350
|
+
}
|
|
2351
|
+
toEip712V2() {
|
|
2352
|
+
const { params } = this;
|
|
2353
|
+
const web3gw = this.toWeb3Gw();
|
|
2354
|
+
const order = web3gw.order;
|
|
2355
|
+
return {
|
|
2356
|
+
...web3gw,
|
|
2357
|
+
order: {
|
|
2358
|
+
...order,
|
|
2359
|
+
order_info: {
|
|
2360
|
+
...order.order_info,
|
|
2361
|
+
price: require_utils.numberToCosmosSdkDecString(params.price),
|
|
2362
|
+
quantity: require_utils.numberToCosmosSdkDecString(params.quantity)
|
|
2363
|
+
},
|
|
2364
|
+
trigger_price: require_utils.numberToCosmosSdkDecString(params.triggerPrice || "0"),
|
|
2365
|
+
order_type: __injectivelabs_core_proto_ts_v2_generated_injective_exchange_v2_order_pb.OrderType[params.orderType]
|
|
2366
|
+
}
|
|
2367
|
+
};
|
|
2368
|
+
}
|
|
2369
|
+
toEip712() {
|
|
2370
|
+
const { params } = this;
|
|
2371
|
+
const { value, type } = this.toAmino();
|
|
2372
|
+
const { expiration_block: _eb, ...orderWithoutExpiration } = value.order || {};
|
|
2373
|
+
return {
|
|
2374
|
+
type,
|
|
2375
|
+
value: {
|
|
2376
|
+
...value,
|
|
2377
|
+
order: {
|
|
2378
|
+
...orderWithoutExpiration,
|
|
2379
|
+
order_info: {
|
|
2380
|
+
...orderWithoutExpiration === null || orderWithoutExpiration === void 0 ? void 0 : orderWithoutExpiration.order_info,
|
|
2381
|
+
price: (0, __injectivelabs_utils.toChainFormat)(params.price).toFixed(),
|
|
2382
|
+
quantity: (0, __injectivelabs_utils.toChainFormat)(params.quantity).toFixed()
|
|
2383
|
+
},
|
|
2384
|
+
trigger_price: (0, __injectivelabs_utils.toChainFormat)(params.triggerPrice || "0").toFixed()
|
|
2385
|
+
}
|
|
2386
|
+
}
|
|
2387
|
+
};
|
|
2388
|
+
}
|
|
2389
|
+
toDirectSign() {
|
|
2390
|
+
return {
|
|
2391
|
+
type: "/injective.exchange.v2.MsgCreateSpotLimitOrder",
|
|
2392
|
+
message: this.toProto()
|
|
2393
|
+
};
|
|
2394
|
+
}
|
|
2395
|
+
toBinary() {
|
|
2396
|
+
return __injectivelabs_core_proto_ts_v2_generated_injective_exchange_v2_tx_pb.MsgCreateSpotLimitOrder.toBinary(this.toProto());
|
|
2397
|
+
}
|
|
2398
|
+
};
|
|
2399
|
+
|
|
2400
|
+
//#endregion
|
|
2401
|
+
//#region src/core/modules/exchange/msgs/MsgInstantSpotMarketLaunch.ts
|
|
2402
|
+
const createMessage$8 = (params) => {
|
|
2403
|
+
return __injectivelabs_core_proto_ts_v2_generated_injective_exchange_v1beta1_tx_pb.MsgInstantSpotMarketLaunch.create({
|
|
2404
|
+
sender: params.proposer,
|
|
2405
|
+
ticker: params.market.ticker,
|
|
2406
|
+
baseDenom: params.market.baseDenom,
|
|
2407
|
+
quoteDenom: params.market.quoteDenom,
|
|
2408
|
+
minPriceTickSize: params.market.minPriceTickSize,
|
|
2409
|
+
minQuantityTickSize: params.market.minQuantityTickSize,
|
|
2410
|
+
minNotional: params.market.minNotional,
|
|
2411
|
+
baseDecimals: Number(params.market.baseDecimals),
|
|
2412
|
+
quoteDecimals: Number(params.market.quoteDecimals)
|
|
2413
|
+
});
|
|
2414
|
+
};
|
|
2415
|
+
/**
|
|
2416
|
+
* @category Messages
|
|
2417
|
+
*/
|
|
2418
|
+
var MsgInstantSpotMarketLaunch = class MsgInstantSpotMarketLaunch extends require_MsgBase.MsgBase {
|
|
2419
|
+
static fromJSON(params) {
|
|
2420
|
+
return new MsgInstantSpotMarketLaunch(params);
|
|
2421
|
+
}
|
|
2422
|
+
toProto() {
|
|
2423
|
+
const { params: initialParams } = this;
|
|
2424
|
+
return createMessage$8({
|
|
2425
|
+
...initialParams,
|
|
2426
|
+
market: {
|
|
2427
|
+
...initialParams.market,
|
|
2428
|
+
minPriceTickSize: (0, __injectivelabs_utils.toChainFormat)(initialParams.market.minPriceTickSize).toFixed(),
|
|
2429
|
+
minQuantityTickSize: (0, __injectivelabs_utils.toChainFormat)(initialParams.market.minQuantityTickSize).toFixed(),
|
|
2430
|
+
minNotional: (0, __injectivelabs_utils.toChainFormat)(initialParams.market.minNotional).toFixed()
|
|
2431
|
+
}
|
|
2432
|
+
});
|
|
2433
|
+
}
|
|
2434
|
+
toData() {
|
|
2435
|
+
const proto = this.toProto();
|
|
2436
|
+
return {
|
|
2437
|
+
"@type": "/injective.exchange.v1beta1.MsgInstantSpotMarketLaunch",
|
|
2438
|
+
...proto
|
|
2439
|
+
};
|
|
2440
|
+
}
|
|
2441
|
+
toAmino() {
|
|
2442
|
+
const { params } = this;
|
|
2443
|
+
return {
|
|
2444
|
+
type: "exchange/MsgInstantSpotMarketLaunch",
|
|
2445
|
+
value: {
|
|
2446
|
+
sender: params.proposer,
|
|
2447
|
+
ticker: params.market.ticker,
|
|
2448
|
+
base_denom: params.market.baseDenom,
|
|
2449
|
+
quote_denom: params.market.quoteDenom,
|
|
2450
|
+
min_price_tick_size: params.market.minPriceTickSize,
|
|
2451
|
+
min_quantity_tick_size: params.market.minQuantityTickSize,
|
|
2452
|
+
min_notional: params.market.minNotional,
|
|
2453
|
+
base_decimals: params.market.baseDecimals,
|
|
2454
|
+
quote_decimals: params.market.quoteDecimals
|
|
2455
|
+
}
|
|
2456
|
+
};
|
|
2457
|
+
}
|
|
2458
|
+
toWeb3Gw() {
|
|
2459
|
+
const { value } = this.toAmino();
|
|
2460
|
+
return {
|
|
2461
|
+
"@type": "/injective.exchange.v1beta1.MsgInstantSpotMarketLaunch",
|
|
2462
|
+
...value
|
|
2463
|
+
};
|
|
2464
|
+
}
|
|
2465
|
+
toEip712() {
|
|
2466
|
+
const { type, value } = this.toAmino();
|
|
2467
|
+
return {
|
|
2468
|
+
type,
|
|
2469
|
+
value: {
|
|
2470
|
+
...value,
|
|
2471
|
+
min_price_tick_size: (0, __injectivelabs_utils.toChainFormat)(value.min_price_tick_size).toFixed(),
|
|
2472
|
+
min_quantity_tick_size: (0, __injectivelabs_utils.toChainFormat)(value.min_quantity_tick_size).toFixed(),
|
|
2473
|
+
min_notional: (0, __injectivelabs_utils.toChainFormat)(value.min_notional).toFixed()
|
|
2474
|
+
}
|
|
2475
|
+
};
|
|
2476
|
+
}
|
|
2477
|
+
toEip712V2() {
|
|
2478
|
+
const { params } = this;
|
|
2479
|
+
return {
|
|
2480
|
+
...this.toWeb3Gw(),
|
|
2481
|
+
min_price_tick_size: require_utils.numberToCosmosSdkDecString(params.market.minPriceTickSize),
|
|
2482
|
+
min_quantity_tick_size: require_utils.numberToCosmosSdkDecString(params.market.minQuantityTickSize),
|
|
2483
|
+
min_notional: require_utils.numberToCosmosSdkDecString(params.market.minNotional)
|
|
2484
|
+
};
|
|
2485
|
+
}
|
|
2486
|
+
toDirectSign() {
|
|
2487
|
+
return {
|
|
2488
|
+
type: "/injective.exchange.v1beta1.MsgInstantSpotMarketLaunch",
|
|
2489
|
+
message: this.toProto()
|
|
2490
|
+
};
|
|
2491
|
+
}
|
|
2492
|
+
toBinary() {
|
|
2493
|
+
return __injectivelabs_core_proto_ts_v2_generated_injective_exchange_v1beta1_tx_pb.MsgInstantSpotMarketLaunch.toBinary(this.toProto());
|
|
2494
|
+
}
|
|
2495
|
+
};
|
|
2496
|
+
|
|
2497
|
+
//#endregion
|
|
2498
|
+
//#region src/core/modules/exchange/msgs/MsgCancelDerivativeOrderV2.ts
|
|
2499
|
+
/**
|
|
2500
|
+
* @category Messages
|
|
2501
|
+
*/
|
|
2502
|
+
var MsgCancelDerivativeOrderV2 = class MsgCancelDerivativeOrderV2 extends require_MsgBase.MsgBase {
|
|
2503
|
+
static fromJSON(params) {
|
|
2504
|
+
return new MsgCancelDerivativeOrderV2(params);
|
|
2505
|
+
}
|
|
2506
|
+
toProto() {
|
|
2507
|
+
const { params } = this;
|
|
2508
|
+
return __injectivelabs_core_proto_ts_v2_generated_injective_exchange_v2_tx_pb.MsgCancelDerivativeOrder.create({
|
|
2509
|
+
sender: params.injectiveAddress,
|
|
2510
|
+
marketId: params.marketId,
|
|
2511
|
+
subaccountId: params.subaccountId,
|
|
2512
|
+
orderHash: params.orderHash || "",
|
|
2513
|
+
orderMask: params.orderMask || __injectivelabs_core_proto_ts_v2_generated_injective_exchange_v2_order_pb.OrderMask.ANY,
|
|
2514
|
+
cid: params.cid || ""
|
|
2515
|
+
});
|
|
2516
|
+
}
|
|
2517
|
+
toData() {
|
|
2518
|
+
const proto = this.toProto();
|
|
2519
|
+
return {
|
|
2520
|
+
"@type": "/injective.exchange.v2.MsgCancelDerivativeOrder",
|
|
2521
|
+
...proto
|
|
2522
|
+
};
|
|
2523
|
+
}
|
|
2524
|
+
toAmino() {
|
|
2525
|
+
const proto = this.toProto();
|
|
2526
|
+
return {
|
|
2527
|
+
type: "exchange/MsgCancelDerivativeOrder",
|
|
2528
|
+
value: {
|
|
2529
|
+
sender: proto.sender,
|
|
2530
|
+
market_id: proto.marketId,
|
|
2531
|
+
subaccount_id: proto.subaccountId,
|
|
2532
|
+
order_hash: proto.orderHash,
|
|
2533
|
+
order_mask: proto.orderMask,
|
|
2534
|
+
cid: proto.cid
|
|
2535
|
+
}
|
|
2536
|
+
};
|
|
2537
|
+
}
|
|
2538
|
+
toWeb3Gw() {
|
|
2539
|
+
const { value } = this.toAmino();
|
|
2540
|
+
return {
|
|
2541
|
+
"@type": "/injective.exchange.v2.MsgCancelDerivativeOrder",
|
|
2542
|
+
...value
|
|
2543
|
+
};
|
|
2544
|
+
}
|
|
2545
|
+
toDirectSign() {
|
|
2546
|
+
return {
|
|
2547
|
+
type: "/injective.exchange.v2.MsgCancelDerivativeOrder",
|
|
2548
|
+
message: this.toProto()
|
|
2549
|
+
};
|
|
2550
|
+
}
|
|
2551
|
+
toBinary() {
|
|
2552
|
+
return __injectivelabs_core_proto_ts_v2_generated_injective_exchange_v2_tx_pb.MsgCancelDerivativeOrder.toBinary(this.toProto());
|
|
2553
|
+
}
|
|
2554
|
+
};
|
|
2555
|
+
|
|
2556
|
+
//#endregion
|
|
2557
|
+
//#region src/core/modules/exchange/msgs/MsgBatchCancelSpotOrdersV2.ts
|
|
2558
|
+
/**
|
|
2559
|
+
* @category Messages
|
|
2560
|
+
*/
|
|
2561
|
+
var MsgBatchCancelSpotOrdersV2 = class MsgBatchCancelSpotOrdersV2 extends require_MsgBase.MsgBase {
|
|
2562
|
+
static fromJSON(params) {
|
|
2563
|
+
return new MsgBatchCancelSpotOrdersV2(params);
|
|
2564
|
+
}
|
|
2565
|
+
toProto() {
|
|
2566
|
+
const { params } = this;
|
|
2567
|
+
const orderDataList = params.orders.map((order) => {
|
|
2568
|
+
return __injectivelabs_core_proto_ts_v2_generated_injective_exchange_v2_tx_pb.OrderData.create({
|
|
2569
|
+
marketId: order.marketId,
|
|
2570
|
+
subaccountId: order.subaccountId,
|
|
2571
|
+
orderHash: order.orderHash || "",
|
|
2572
|
+
orderMask: order.orderMask || __injectivelabs_core_proto_ts_v2_generated_injective_exchange_v2_order_pb.OrderMask.ANY,
|
|
2573
|
+
cid: order.cid || ""
|
|
2574
|
+
});
|
|
2575
|
+
});
|
|
2576
|
+
return __injectivelabs_core_proto_ts_v2_generated_injective_exchange_v2_tx_pb.MsgBatchCancelSpotOrders.create({
|
|
2577
|
+
sender: params.injectiveAddress,
|
|
2578
|
+
data: orderDataList
|
|
2579
|
+
});
|
|
2580
|
+
}
|
|
2581
|
+
toData() {
|
|
2582
|
+
const proto = this.toProto();
|
|
2583
|
+
return {
|
|
2584
|
+
"@type": "/injective.exchange.v2.MsgBatchCancelSpotOrders",
|
|
2585
|
+
...proto
|
|
2586
|
+
};
|
|
2587
|
+
}
|
|
2588
|
+
toAmino() {
|
|
2589
|
+
const proto = this.toProto();
|
|
2590
|
+
return {
|
|
2591
|
+
type: "exchange/MsgBatchCancelSpotOrders",
|
|
2592
|
+
value: {
|
|
2593
|
+
sender: proto.sender,
|
|
2594
|
+
data: proto.data.map((orderData) => ({
|
|
2595
|
+
market_id: orderData.marketId,
|
|
2596
|
+
subaccount_id: orderData.subaccountId,
|
|
2597
|
+
order_hash: orderData.orderHash,
|
|
2598
|
+
order_mask: orderData.orderMask,
|
|
2599
|
+
cid: orderData.cid
|
|
2600
|
+
}))
|
|
2601
|
+
}
|
|
2602
|
+
};
|
|
2603
|
+
}
|
|
2604
|
+
toWeb3Gw() {
|
|
2605
|
+
const { value } = this.toAmino();
|
|
2606
|
+
return {
|
|
2607
|
+
"@type": "/injective.exchange.v2.MsgBatchCancelSpotOrders",
|
|
2608
|
+
...value
|
|
2609
|
+
};
|
|
2610
|
+
}
|
|
2611
|
+
toDirectSign() {
|
|
2612
|
+
return {
|
|
2613
|
+
type: "/injective.exchange.v2.MsgBatchCancelSpotOrders",
|
|
2614
|
+
message: this.toProto()
|
|
2615
|
+
};
|
|
2616
|
+
}
|
|
2617
|
+
toBinary() {
|
|
2618
|
+
return __injectivelabs_core_proto_ts_v2_generated_injective_exchange_v2_tx_pb.MsgBatchCancelSpotOrders.toBinary(this.toProto());
|
|
2619
|
+
}
|
|
2620
|
+
};
|
|
2621
|
+
|
|
2622
|
+
//#endregion
|
|
2623
|
+
//#region src/core/modules/exchange/msgs/MsgCreateSpotMarketOrderV2.ts
|
|
2624
|
+
const createMarketOrder$4 = (params) => {
|
|
2625
|
+
const orderInfo = __injectivelabs_core_proto_ts_v2_generated_injective_exchange_v2_order_pb.OrderInfo.create({
|
|
2626
|
+
subaccountId: params.subaccountId,
|
|
2627
|
+
feeRecipient: params.feeRecipient,
|
|
2628
|
+
price: params.price,
|
|
2629
|
+
quantity: params.quantity,
|
|
2630
|
+
cid: params.cid || ""
|
|
2631
|
+
});
|
|
2632
|
+
const spotOrder = __injectivelabs_core_proto_ts_v2_generated_injective_exchange_v2_order_pb.SpotOrder.create({
|
|
2633
|
+
marketId: params.marketId,
|
|
2634
|
+
orderInfo,
|
|
2635
|
+
orderType: params.orderType,
|
|
2636
|
+
triggerPrice: params.triggerPrice || "0",
|
|
2637
|
+
expirationBlock: params.expirationBlock ? BigInt(params.expirationBlock) : BigInt(0)
|
|
2638
|
+
});
|
|
2639
|
+
return __injectivelabs_core_proto_ts_v2_generated_injective_exchange_v2_tx_pb.MsgCreateSpotMarketOrder.create({
|
|
2640
|
+
sender: params.injectiveAddress,
|
|
2641
|
+
order: spotOrder
|
|
2642
|
+
});
|
|
2643
|
+
};
|
|
2644
|
+
/**
|
|
2645
|
+
* @category Messages
|
|
2646
|
+
*/
|
|
2647
|
+
var MsgCreateSpotMarketOrderV2 = class MsgCreateSpotMarketOrderV2 extends require_MsgBase.MsgBase {
|
|
2648
|
+
static fromJSON(params) {
|
|
2649
|
+
return new MsgCreateSpotMarketOrderV2(params);
|
|
2650
|
+
}
|
|
2651
|
+
toProto() {
|
|
2652
|
+
const { params: initialParams } = this;
|
|
2653
|
+
return createMarketOrder$4({
|
|
2654
|
+
...initialParams,
|
|
2655
|
+
price: (0, __injectivelabs_utils.toChainFormat)(initialParams.price).toFixed(),
|
|
2656
|
+
triggerPrice: (0, __injectivelabs_utils.toChainFormat)(initialParams.triggerPrice || 0).toFixed(),
|
|
2657
|
+
quantity: (0, __injectivelabs_utils.toChainFormat)(initialParams.quantity).toFixed()
|
|
2658
|
+
});
|
|
2659
|
+
}
|
|
2660
|
+
toData() {
|
|
2661
|
+
const proto = this.toProto();
|
|
2662
|
+
return {
|
|
2663
|
+
"@type": "/injective.exchange.v2.MsgCreateSpotMarketOrder",
|
|
2664
|
+
...proto
|
|
2665
|
+
};
|
|
2666
|
+
}
|
|
2667
|
+
toAmino() {
|
|
2668
|
+
const { params } = this;
|
|
2669
|
+
return {
|
|
2670
|
+
type: "exchange/MsgCreateSpotMarketOrder",
|
|
2671
|
+
value: {
|
|
2672
|
+
sender: params.injectiveAddress,
|
|
2673
|
+
order: {
|
|
2674
|
+
market_id: params.marketId,
|
|
2675
|
+
order_info: {
|
|
2676
|
+
subaccount_id: params.subaccountId,
|
|
2677
|
+
fee_recipient: params.feeRecipient,
|
|
2678
|
+
price: params.price,
|
|
2679
|
+
quantity: params.quantity,
|
|
2680
|
+
cid: params.cid || ""
|
|
2681
|
+
},
|
|
2682
|
+
order_type: params.orderType,
|
|
2683
|
+
trigger_price: params.triggerPrice || "0",
|
|
2684
|
+
expiration_block: params.expirationBlock || "0"
|
|
2685
|
+
}
|
|
2686
|
+
}
|
|
2687
|
+
};
|
|
2688
|
+
}
|
|
2689
|
+
toWeb3Gw() {
|
|
2690
|
+
const { value } = this.toAmino();
|
|
2691
|
+
return {
|
|
2692
|
+
"@type": "/injective.exchange.v2.MsgCreateSpotMarketOrder",
|
|
2693
|
+
...value
|
|
2694
|
+
};
|
|
2695
|
+
}
|
|
2696
|
+
toEip712V2() {
|
|
2697
|
+
const { params } = this;
|
|
2698
|
+
const web3gw = this.toWeb3Gw();
|
|
2699
|
+
const order = web3gw.order;
|
|
2700
|
+
return {
|
|
2701
|
+
...web3gw,
|
|
2702
|
+
order: {
|
|
2703
|
+
...order,
|
|
2704
|
+
order_info: {
|
|
2705
|
+
...order.order_info,
|
|
2706
|
+
price: require_utils.numberToCosmosSdkDecString(params.price),
|
|
2707
|
+
quantity: require_utils.numberToCosmosSdkDecString(params.quantity)
|
|
2708
|
+
},
|
|
2709
|
+
trigger_price: require_utils.numberToCosmosSdkDecString(params.triggerPrice || "0"),
|
|
2710
|
+
order_type: __injectivelabs_core_proto_ts_v2_generated_injective_exchange_v2_order_pb.OrderType[params.orderType]
|
|
2711
|
+
}
|
|
2712
|
+
};
|
|
2713
|
+
}
|
|
2714
|
+
toEip712() {
|
|
2715
|
+
const { params } = this;
|
|
2716
|
+
const { value, type } = this.toAmino();
|
|
2717
|
+
const { expiration_block: _eb, ...orderWithoutExpiration } = value.order || {};
|
|
2718
|
+
return {
|
|
2719
|
+
type,
|
|
2720
|
+
value: {
|
|
2721
|
+
...value,
|
|
2722
|
+
order: {
|
|
2723
|
+
...orderWithoutExpiration,
|
|
2724
|
+
order_info: {
|
|
2725
|
+
...orderWithoutExpiration === null || orderWithoutExpiration === void 0 ? void 0 : orderWithoutExpiration.order_info,
|
|
2726
|
+
price: (0, __injectivelabs_utils.toChainFormat)(params.price).toFixed(),
|
|
2727
|
+
quantity: (0, __injectivelabs_utils.toChainFormat)(params.quantity).toFixed()
|
|
2728
|
+
},
|
|
2729
|
+
trigger_price: (0, __injectivelabs_utils.toChainFormat)(params.triggerPrice || "0").toFixed()
|
|
2730
|
+
}
|
|
2731
|
+
}
|
|
2732
|
+
};
|
|
2733
|
+
}
|
|
2734
|
+
toDirectSign() {
|
|
2735
|
+
return {
|
|
2736
|
+
type: "/injective.exchange.v2.MsgCreateSpotMarketOrder",
|
|
2737
|
+
message: this.toProto()
|
|
2738
|
+
};
|
|
2739
|
+
}
|
|
2740
|
+
toBinary() {
|
|
2741
|
+
return __injectivelabs_core_proto_ts_v2_generated_injective_exchange_v2_tx_pb.MsgCreateSpotMarketOrder.toBinary(this.toProto());
|
|
2742
|
+
}
|
|
2743
|
+
};
|
|
2744
|
+
|
|
2745
|
+
//#endregion
|
|
2746
|
+
//#region src/core/modules/exchange/msgs/MsgUpdateDerivativeMarketV2.ts
|
|
2747
|
+
const createMessage$7 = (params) => {
|
|
2748
|
+
return __injectivelabs_core_proto_ts_v2_generated_injective_exchange_v2_tx_pb.MsgUpdateDerivativeMarket.create({
|
|
2749
|
+
admin: params.admin,
|
|
2750
|
+
marketId: params.marketId,
|
|
2751
|
+
newTicker: params.newTicker || "",
|
|
2752
|
+
newMinNotional: params.newMinNotional || "0",
|
|
2753
|
+
newMinPriceTickSize: params.newMinPriceTickSize || "0",
|
|
2754
|
+
newMinQuantityTickSize: params.newMinQuantityTickSize || "0",
|
|
2755
|
+
newInitialMarginRatio: params.newInitialMarginRatio || "0",
|
|
2756
|
+
newMaintenanceMarginRatio: params.newMaintenanceMarginRatio || "0",
|
|
2757
|
+
newReduceMarginRatio: params.newReduceMarginRatio || "0"
|
|
2758
|
+
});
|
|
2759
|
+
};
|
|
2760
|
+
/**
|
|
2761
|
+
* @category Messages
|
|
2762
|
+
*/
|
|
2763
|
+
var MsgUpdateDerivativeMarketV2 = class MsgUpdateDerivativeMarketV2 extends require_MsgBase.MsgBase {
|
|
2764
|
+
static fromJSON(params) {
|
|
2765
|
+
return new MsgUpdateDerivativeMarketV2(params);
|
|
2766
|
+
}
|
|
2767
|
+
toProto() {
|
|
2768
|
+
const { params: initialParams } = this;
|
|
2769
|
+
return createMessage$7({
|
|
2770
|
+
...initialParams,
|
|
2771
|
+
newMinNotional: (0, __injectivelabs_utils.toChainFormat)(initialParams.newMinNotional || "0").toFixed(),
|
|
2772
|
+
newMinQuantityTickSize: (0, __injectivelabs_utils.toChainFormat)(initialParams.newMinQuantityTickSize || "0").toFixed(),
|
|
2773
|
+
newMinPriceTickSize: (0, __injectivelabs_utils.toChainFormat)(initialParams.newMinPriceTickSize || "0").toFixed(),
|
|
2774
|
+
newInitialMarginRatio: (0, __injectivelabs_utils.toChainFormat)(initialParams.newInitialMarginRatio || "0").toFixed(),
|
|
2775
|
+
newMaintenanceMarginRatio: (0, __injectivelabs_utils.toChainFormat)(initialParams.newMaintenanceMarginRatio || "0").toFixed(),
|
|
2776
|
+
newReduceMarginRatio: (0, __injectivelabs_utils.toChainFormat)(initialParams.newReduceMarginRatio || "0").toFixed()
|
|
2777
|
+
});
|
|
2778
|
+
}
|
|
2779
|
+
toData() {
|
|
2780
|
+
const proto = this.toProto();
|
|
2781
|
+
return {
|
|
2782
|
+
"@type": "/injective.exchange.v2.MsgUpdateDerivativeMarket",
|
|
2783
|
+
...proto
|
|
2784
|
+
};
|
|
2785
|
+
}
|
|
2786
|
+
toAmino() {
|
|
2787
|
+
const { params } = this;
|
|
2788
|
+
return {
|
|
2789
|
+
type: "exchange/MsgUpdateDerivativeMarket",
|
|
2790
|
+
value: {
|
|
2791
|
+
admin: params.admin,
|
|
2792
|
+
market_id: params.marketId,
|
|
2793
|
+
new_ticker: params.newTicker || "",
|
|
2794
|
+
new_min_notional: params.newMinNotional,
|
|
2795
|
+
new_min_price_tick_size: params.newMinPriceTickSize,
|
|
2796
|
+
new_min_quantity_tick_size: params.newMinQuantityTickSize,
|
|
2797
|
+
new_initial_margin_ratio: params.newInitialMarginRatio,
|
|
2798
|
+
new_maintenance_margin_ratio: params.newMaintenanceMarginRatio,
|
|
2799
|
+
new_reduce_margin_ratio: params.newReduceMarginRatio
|
|
2800
|
+
}
|
|
2801
|
+
};
|
|
2802
|
+
}
|
|
2803
|
+
toWeb3Gw() {
|
|
2804
|
+
const { value } = this.toAmino();
|
|
2805
|
+
return {
|
|
2806
|
+
"@type": "/injective.exchange.v2.MsgUpdateDerivativeMarket",
|
|
2807
|
+
...value
|
|
2808
|
+
};
|
|
2809
|
+
}
|
|
2810
|
+
toEip712() {
|
|
2811
|
+
const { type, value } = this.toAmino();
|
|
2812
|
+
return {
|
|
2813
|
+
type,
|
|
2814
|
+
value: { ...value }
|
|
2815
|
+
};
|
|
2816
|
+
}
|
|
2817
|
+
toEip712V2() {
|
|
2818
|
+
const { params } = this;
|
|
2819
|
+
return {
|
|
2820
|
+
"@type": "/injective.exchange.v2.MsgUpdateDerivativeMarket",
|
|
2821
|
+
admin: params.admin,
|
|
2822
|
+
market_id: params.marketId,
|
|
2823
|
+
new_ticker: params.newTicker || "",
|
|
2824
|
+
new_min_price_tick_size: require_utils.numberToCosmosSdkDecString(params.newMinPriceTickSize || "0"),
|
|
2825
|
+
new_min_quantity_tick_size: require_utils.numberToCosmosSdkDecString(params.newMinQuantityTickSize || "0"),
|
|
2826
|
+
new_min_notional: require_utils.numberToCosmosSdkDecString(params.newMinNotional || "0"),
|
|
2827
|
+
new_initial_margin_ratio: require_utils.numberToCosmosSdkDecString(params.newInitialMarginRatio || "0"),
|
|
2828
|
+
new_maintenance_margin_ratio: require_utils.numberToCosmosSdkDecString(params.newMaintenanceMarginRatio || "0"),
|
|
2829
|
+
new_reduce_margin_ratio: require_utils.numberToCosmosSdkDecString(params.newReduceMarginRatio || "0"),
|
|
2830
|
+
new_open_notional_cap: {}
|
|
2831
|
+
};
|
|
2832
|
+
}
|
|
2833
|
+
toDirectSign() {
|
|
2834
|
+
return {
|
|
2835
|
+
type: "/injective.exchange.v2.MsgUpdateDerivativeMarket",
|
|
2836
|
+
message: this.toProto()
|
|
2837
|
+
};
|
|
2838
|
+
}
|
|
2839
|
+
toBinary() {
|
|
2840
|
+
return __injectivelabs_core_proto_ts_v2_generated_injective_exchange_v2_tx_pb.MsgUpdateDerivativeMarket.toBinary(this.toProto());
|
|
2841
|
+
}
|
|
2842
|
+
};
|
|
2843
|
+
|
|
2844
|
+
//#endregion
|
|
2845
|
+
//#region src/core/modules/exchange/msgs/MsgCancelBinaryOptionsOrder.ts
|
|
2846
|
+
/**
|
|
2847
|
+
* @category Messages
|
|
2848
|
+
*/
|
|
2849
|
+
var MsgCancelBinaryOptionsOrder = class MsgCancelBinaryOptionsOrder extends require_MsgBase.MsgBase {
|
|
2850
|
+
static fromJSON(params) {
|
|
2851
|
+
return new MsgCancelBinaryOptionsOrder(params);
|
|
2852
|
+
}
|
|
2853
|
+
toProto() {
|
|
2854
|
+
const { params } = this;
|
|
2855
|
+
return __injectivelabs_core_proto_ts_v2_generated_injective_exchange_v1beta1_tx_pb.MsgCancelBinaryOptionsOrder.create({
|
|
2856
|
+
sender: params.injectiveAddress,
|
|
2857
|
+
marketId: params.marketId,
|
|
2858
|
+
subaccountId: params.subaccountId,
|
|
2859
|
+
orderHash: params.orderHash || "",
|
|
2860
|
+
orderMask: __injectivelabs_core_proto_ts_v2_generated_injective_exchange_v1beta1_exchange_pb.OrderMask.ANY,
|
|
2861
|
+
cid: params.cid || ""
|
|
2862
|
+
});
|
|
2863
|
+
}
|
|
2864
|
+
toData() {
|
|
2865
|
+
const proto = this.toProto();
|
|
2866
|
+
return {
|
|
2867
|
+
"@type": "/injective.exchange.v1beta1.MsgCancelBinaryOptionsOrder",
|
|
2868
|
+
...proto
|
|
2869
|
+
};
|
|
2870
|
+
}
|
|
2871
|
+
toAmino() {
|
|
2872
|
+
const proto = this.toProto();
|
|
2873
|
+
return {
|
|
2874
|
+
type: "exchange/MsgCancelBinaryOptionsOrder",
|
|
2875
|
+
value: {
|
|
2876
|
+
sender: proto.sender,
|
|
2877
|
+
market_id: proto.marketId,
|
|
2878
|
+
subaccount_id: proto.subaccountId,
|
|
2879
|
+
order_hash: proto.orderHash,
|
|
2880
|
+
order_mask: proto.orderMask,
|
|
2881
|
+
cid: proto.cid
|
|
2882
|
+
}
|
|
2883
|
+
};
|
|
2884
|
+
}
|
|
2885
|
+
toWeb3Gw() {
|
|
2886
|
+
const { value } = this.toAmino();
|
|
2887
|
+
return {
|
|
2888
|
+
"@type": "/injective.exchange.v1beta1.MsgCancelBinaryOptionsOrder",
|
|
2889
|
+
...value
|
|
2890
|
+
};
|
|
2891
|
+
}
|
|
2892
|
+
toDirectSign() {
|
|
2893
|
+
return {
|
|
2894
|
+
type: "/injective.exchange.v1beta1.MsgCancelBinaryOptionsOrder",
|
|
2895
|
+
message: this.toProto()
|
|
2896
|
+
};
|
|
2897
|
+
}
|
|
2898
|
+
toBinary() {
|
|
2899
|
+
return __injectivelabs_core_proto_ts_v2_generated_injective_exchange_v1beta1_tx_pb.MsgCancelBinaryOptionsOrder.toBinary(this.toProto());
|
|
2900
|
+
}
|
|
2901
|
+
};
|
|
2902
|
+
|
|
2903
|
+
//#endregion
|
|
2904
|
+
//#region src/core/modules/exchange/msgs/MsgIncreasePositionMarginV2.ts
|
|
2905
|
+
const createMessage$6 = (params) => {
|
|
2906
|
+
return __injectivelabs_core_proto_ts_v2_generated_injective_exchange_v2_tx_pb.MsgIncreasePositionMargin.create({
|
|
2907
|
+
sender: params.injectiveAddress,
|
|
2908
|
+
sourceSubaccountId: params.srcSubaccountId,
|
|
2909
|
+
destinationSubaccountId: params.dstSubaccountId,
|
|
2910
|
+
marketId: params.marketId,
|
|
2911
|
+
amount: params.amount
|
|
2912
|
+
});
|
|
2913
|
+
};
|
|
2914
|
+
/**
|
|
2915
|
+
* @category Messages
|
|
2916
|
+
*/
|
|
2917
|
+
var MsgIncreasePositionMarginV2 = class MsgIncreasePositionMarginV2 extends require_MsgBase.MsgBase {
|
|
2918
|
+
static fromJSON(params) {
|
|
2919
|
+
return new MsgIncreasePositionMarginV2(params);
|
|
2920
|
+
}
|
|
2921
|
+
toProto() {
|
|
2922
|
+
const { params: initialParams } = this;
|
|
2923
|
+
return createMessage$6({
|
|
2924
|
+
...initialParams,
|
|
2925
|
+
amount: (0, __injectivelabs_utils.toChainFormat)(initialParams.amount).toFixed()
|
|
2926
|
+
});
|
|
2927
|
+
}
|
|
2928
|
+
toData() {
|
|
2929
|
+
const proto = this.toProto();
|
|
2930
|
+
return {
|
|
2931
|
+
"@type": "/injective.exchange.v2.MsgIncreasePositionMargin",
|
|
2932
|
+
...proto
|
|
2933
|
+
};
|
|
2934
|
+
}
|
|
2935
|
+
toAmino() {
|
|
2936
|
+
const { params } = this;
|
|
2937
|
+
return {
|
|
2938
|
+
type: "exchange/MsgIncreasePositionMargin",
|
|
2939
|
+
value: {
|
|
2940
|
+
sender: params.injectiveAddress,
|
|
2941
|
+
source_subaccount_id: params.srcSubaccountId,
|
|
2942
|
+
destination_subaccount_id: params.dstSubaccountId,
|
|
2943
|
+
market_id: params.marketId,
|
|
2944
|
+
amount: params.amount
|
|
2945
|
+
}
|
|
2946
|
+
};
|
|
2947
|
+
}
|
|
2948
|
+
toWeb3Gw() {
|
|
2949
|
+
const { value } = this.toAmino();
|
|
2950
|
+
return {
|
|
2951
|
+
"@type": "/injective.exchange.v2.MsgIncreasePositionMargin",
|
|
2952
|
+
...value
|
|
2953
|
+
};
|
|
2954
|
+
}
|
|
2955
|
+
toEip712() {
|
|
2956
|
+
const { type, value } = this.toAmino();
|
|
2957
|
+
return {
|
|
2958
|
+
type,
|
|
2959
|
+
value: {
|
|
2960
|
+
...value,
|
|
2961
|
+
amount: (0, __injectivelabs_utils.toChainFormat)(value.amount).toFixed()
|
|
2962
|
+
}
|
|
2963
|
+
};
|
|
2964
|
+
}
|
|
2965
|
+
toEip712V2() {
|
|
2966
|
+
const { params } = this;
|
|
2967
|
+
return {
|
|
2968
|
+
...this.toWeb3Gw(),
|
|
2969
|
+
amount: require_utils.numberToCosmosSdkDecString(params.amount)
|
|
2970
|
+
};
|
|
2971
|
+
}
|
|
2972
|
+
toDirectSign() {
|
|
2973
|
+
return {
|
|
2974
|
+
type: "/injective.exchange.v2.MsgIncreasePositionMargin",
|
|
2975
|
+
message: this.toProto()
|
|
2976
|
+
};
|
|
2977
|
+
}
|
|
2978
|
+
toBinary() {
|
|
2979
|
+
return __injectivelabs_core_proto_ts_v2_generated_injective_exchange_v2_tx_pb.MsgIncreasePositionMargin.toBinary(this.toProto());
|
|
2980
|
+
}
|
|
2981
|
+
};
|
|
2982
|
+
|
|
2983
|
+
//#endregion
|
|
2984
|
+
//#region src/core/modules/exchange/msgs/MsgDecreasePositionMarginV2.ts
|
|
2985
|
+
const createMessage$5 = (params) => {
|
|
2986
|
+
return __injectivelabs_core_proto_ts_v2_generated_injective_exchange_v2_tx_pb.MsgDecreasePositionMargin.create({
|
|
2987
|
+
sender: params.injectiveAddress,
|
|
2988
|
+
sourceSubaccountId: params.srcSubaccountId,
|
|
2989
|
+
destinationSubaccountId: params.dstSubaccountId,
|
|
2990
|
+
marketId: params.marketId,
|
|
2991
|
+
amount: params.amount
|
|
2992
|
+
});
|
|
2993
|
+
};
|
|
2994
|
+
/**
|
|
2995
|
+
* @category Messages
|
|
2996
|
+
*/
|
|
2997
|
+
var MsgDecreasePositionMarginV2 = class MsgDecreasePositionMarginV2 extends require_MsgBase.MsgBase {
|
|
2998
|
+
static fromJSON(params) {
|
|
2999
|
+
return new MsgDecreasePositionMarginV2(params);
|
|
3000
|
+
}
|
|
3001
|
+
toProto() {
|
|
3002
|
+
const { params: initialParams } = this;
|
|
3003
|
+
return createMessage$5({
|
|
3004
|
+
...initialParams,
|
|
3005
|
+
amount: (0, __injectivelabs_utils.toChainFormat)(initialParams.amount).toFixed()
|
|
3006
|
+
});
|
|
3007
|
+
}
|
|
3008
|
+
toData() {
|
|
3009
|
+
const proto = this.toProto();
|
|
3010
|
+
return {
|
|
3011
|
+
"@type": "/injective.exchange.v2.MsgDecreasePositionMargin",
|
|
3012
|
+
...proto
|
|
3013
|
+
};
|
|
3014
|
+
}
|
|
3015
|
+
toAmino() {
|
|
3016
|
+
const { params } = this;
|
|
3017
|
+
return {
|
|
3018
|
+
type: "exchange/MsgDecreasePositionMargin",
|
|
3019
|
+
value: {
|
|
3020
|
+
sender: params.injectiveAddress,
|
|
3021
|
+
source_subaccount_id: params.srcSubaccountId,
|
|
3022
|
+
destination_subaccount_id: params.dstSubaccountId,
|
|
3023
|
+
market_id: params.marketId,
|
|
3024
|
+
amount: params.amount
|
|
3025
|
+
}
|
|
3026
|
+
};
|
|
3027
|
+
}
|
|
3028
|
+
toWeb3Gw() {
|
|
3029
|
+
const { value } = this.toAmino();
|
|
3030
|
+
return {
|
|
3031
|
+
"@type": "/injective.exchange.v2.MsgDecreasePositionMargin",
|
|
3032
|
+
...value
|
|
3033
|
+
};
|
|
3034
|
+
}
|
|
3035
|
+
toEip712() {
|
|
3036
|
+
const { type, value } = this.toAmino();
|
|
3037
|
+
return {
|
|
3038
|
+
type,
|
|
3039
|
+
value: {
|
|
3040
|
+
...value,
|
|
3041
|
+
amount: (0, __injectivelabs_utils.toChainFormat)(value.amount).toFixed()
|
|
3042
|
+
}
|
|
3043
|
+
};
|
|
3044
|
+
}
|
|
3045
|
+
toEip712V2() {
|
|
3046
|
+
const { params } = this;
|
|
3047
|
+
return {
|
|
3048
|
+
...this.toWeb3Gw(),
|
|
3049
|
+
amount: require_utils.numberToCosmosSdkDecString(params.amount)
|
|
3050
|
+
};
|
|
3051
|
+
}
|
|
3052
|
+
toDirectSign() {
|
|
3053
|
+
return {
|
|
3054
|
+
type: "/injective.exchange.v2.MsgDecreasePositionMargin",
|
|
3055
|
+
message: this.toProto()
|
|
3056
|
+
};
|
|
3057
|
+
}
|
|
3058
|
+
toBinary() {
|
|
3059
|
+
return __injectivelabs_core_proto_ts_v2_generated_injective_exchange_v2_tx_pb.MsgDecreasePositionMargin.toBinary(this.toProto());
|
|
3060
|
+
}
|
|
3061
|
+
};
|
|
3062
|
+
|
|
3063
|
+
//#endregion
|
|
3064
|
+
//#region src/core/modules/exchange/msgs/MsgInstantSpotMarketLaunchV2.ts
|
|
3065
|
+
const createMessage$4 = (params) => {
|
|
3066
|
+
return __injectivelabs_core_proto_ts_v2_generated_injective_exchange_v2_tx_pb.MsgInstantSpotMarketLaunch.create({
|
|
3067
|
+
sender: params.proposer,
|
|
3068
|
+
ticker: params.market.ticker,
|
|
3069
|
+
baseDenom: params.market.baseDenom,
|
|
3070
|
+
quoteDenom: params.market.quoteDenom,
|
|
3071
|
+
minPriceTickSize: params.market.minPriceTickSize,
|
|
3072
|
+
minQuantityTickSize: params.market.minQuantityTickSize,
|
|
3073
|
+
minNotional: params.market.minNotional,
|
|
3074
|
+
baseDecimals: Number(params.market.baseDecimals),
|
|
3075
|
+
quoteDecimals: Number(params.market.quoteDecimals)
|
|
3076
|
+
});
|
|
3077
|
+
};
|
|
3078
|
+
/**
|
|
3079
|
+
* @category Messages
|
|
3080
|
+
*/
|
|
3081
|
+
var MsgInstantSpotMarketLaunchV2 = class MsgInstantSpotMarketLaunchV2 extends require_MsgBase.MsgBase {
|
|
3082
|
+
static fromJSON(params) {
|
|
3083
|
+
return new MsgInstantSpotMarketLaunchV2(params);
|
|
3084
|
+
}
|
|
3085
|
+
toProto() {
|
|
3086
|
+
const { params: initialParams } = this;
|
|
3087
|
+
return createMessage$4({
|
|
3088
|
+
...initialParams,
|
|
3089
|
+
market: {
|
|
3090
|
+
...initialParams.market,
|
|
3091
|
+
minPriceTickSize: (0, __injectivelabs_utils.toChainFormat)(initialParams.market.minPriceTickSize).toFixed(),
|
|
3092
|
+
minQuantityTickSize: (0, __injectivelabs_utils.toChainFormat)(initialParams.market.minQuantityTickSize).toFixed(),
|
|
3093
|
+
minNotional: (0, __injectivelabs_utils.toChainFormat)(initialParams.market.minNotional).toFixed()
|
|
3094
|
+
}
|
|
3095
|
+
});
|
|
3096
|
+
}
|
|
3097
|
+
toData() {
|
|
3098
|
+
const proto = this.toProto();
|
|
3099
|
+
return {
|
|
3100
|
+
"@type": "/injective.exchange.v2.MsgInstantSpotMarketLaunch",
|
|
3101
|
+
...proto
|
|
3102
|
+
};
|
|
3103
|
+
}
|
|
3104
|
+
toAmino() {
|
|
3105
|
+
const { params } = this;
|
|
3106
|
+
return {
|
|
3107
|
+
type: "exchange/MsgInstantSpotMarketLaunch",
|
|
3108
|
+
value: {
|
|
3109
|
+
sender: params.proposer,
|
|
3110
|
+
ticker: params.market.ticker,
|
|
3111
|
+
base_denom: params.market.baseDenom,
|
|
3112
|
+
quote_denom: params.market.quoteDenom,
|
|
3113
|
+
min_price_tick_size: params.market.minPriceTickSize,
|
|
3114
|
+
min_quantity_tick_size: params.market.minQuantityTickSize,
|
|
3115
|
+
min_notional: params.market.minNotional,
|
|
3116
|
+
base_decimals: params.market.baseDecimals,
|
|
3117
|
+
quote_decimals: params.market.quoteDecimals
|
|
3118
|
+
}
|
|
3119
|
+
};
|
|
3120
|
+
}
|
|
3121
|
+
toWeb3Gw() {
|
|
3122
|
+
const { value } = this.toAmino();
|
|
3123
|
+
return {
|
|
3124
|
+
"@type": "/injective.exchange.v2.MsgInstantSpotMarketLaunch",
|
|
3125
|
+
...value
|
|
3126
|
+
};
|
|
3127
|
+
}
|
|
3128
|
+
toEip712() {
|
|
3129
|
+
const { type, value } = this.toAmino();
|
|
3130
|
+
return {
|
|
3131
|
+
type,
|
|
3132
|
+
value: {
|
|
3133
|
+
...value,
|
|
3134
|
+
min_price_tick_size: (0, __injectivelabs_utils.toChainFormat)(value.min_price_tick_size).toFixed(),
|
|
3135
|
+
min_quantity_tick_size: (0, __injectivelabs_utils.toChainFormat)(value.min_quantity_tick_size).toFixed(),
|
|
3136
|
+
min_notional: (0, __injectivelabs_utils.toChainFormat)(value.min_notional).toFixed()
|
|
3137
|
+
}
|
|
3138
|
+
};
|
|
3139
|
+
}
|
|
3140
|
+
toEip712V2() {
|
|
3141
|
+
const { params } = this;
|
|
3142
|
+
return {
|
|
3143
|
+
...this.toWeb3Gw(),
|
|
3144
|
+
min_price_tick_size: require_utils.numberToCosmosSdkDecString(params.market.minPriceTickSize),
|
|
3145
|
+
min_quantity_tick_size: require_utils.numberToCosmosSdkDecString(params.market.minQuantityTickSize),
|
|
3146
|
+
min_notional: require_utils.numberToCosmosSdkDecString(params.market.minNotional)
|
|
3147
|
+
};
|
|
3148
|
+
}
|
|
3149
|
+
toDirectSign() {
|
|
3150
|
+
return {
|
|
3151
|
+
type: "/injective.exchange.v2.MsgInstantSpotMarketLaunch",
|
|
3152
|
+
message: this.toProto()
|
|
3153
|
+
};
|
|
3154
|
+
}
|
|
3155
|
+
toBinary() {
|
|
3156
|
+
return __injectivelabs_core_proto_ts_v2_generated_injective_exchange_v2_tx_pb.MsgInstantSpotMarketLaunch.toBinary(this.toProto());
|
|
3157
|
+
}
|
|
3158
|
+
};
|
|
3159
|
+
|
|
3160
|
+
//#endregion
|
|
3161
|
+
//#region src/core/modules/exchange/msgs/MsgCreateDerivativeLimitOrder.ts
|
|
3162
|
+
const createLimitOrder$3 = (params) => {
|
|
3163
|
+
const orderInfo = __injectivelabs_core_proto_ts_v2_generated_injective_exchange_v1beta1_exchange_pb.OrderInfo.create({
|
|
3164
|
+
subaccountId: params.subaccountId,
|
|
3165
|
+
feeRecipient: params.feeRecipient,
|
|
3166
|
+
price: params.price,
|
|
3167
|
+
quantity: params.quantity,
|
|
3168
|
+
cid: params.cid || ""
|
|
3169
|
+
});
|
|
3170
|
+
const derivativeOrder = __injectivelabs_core_proto_ts_v2_generated_injective_exchange_v1beta1_exchange_pb.DerivativeOrder.create({
|
|
3171
|
+
marketId: params.marketId,
|
|
3172
|
+
orderInfo,
|
|
3173
|
+
orderType: params.orderType,
|
|
3174
|
+
margin: params.margin,
|
|
3175
|
+
triggerPrice: params.triggerPrice || "0"
|
|
3176
|
+
});
|
|
3177
|
+
return __injectivelabs_core_proto_ts_v2_generated_injective_exchange_v1beta1_tx_pb.MsgCreateDerivativeLimitOrder.create({
|
|
3178
|
+
sender: params.injectiveAddress,
|
|
3179
|
+
order: derivativeOrder
|
|
3180
|
+
});
|
|
3181
|
+
};
|
|
3182
|
+
/**
|
|
3183
|
+
* @category Messages
|
|
3184
|
+
*/
|
|
3185
|
+
var MsgCreateDerivativeLimitOrder = class MsgCreateDerivativeLimitOrder extends require_MsgBase.MsgBase {
|
|
3186
|
+
static fromJSON(params) {
|
|
3187
|
+
return new MsgCreateDerivativeLimitOrder(params);
|
|
3188
|
+
}
|
|
3189
|
+
toProto() {
|
|
3190
|
+
const { params: initialParams } = this;
|
|
3191
|
+
return createLimitOrder$3({
|
|
3192
|
+
...initialParams,
|
|
3193
|
+
price: (0, __injectivelabs_utils.toChainFormat)(initialParams.price).toFixed(),
|
|
3194
|
+
margin: (0, __injectivelabs_utils.toChainFormat)(initialParams.margin).toFixed(),
|
|
3195
|
+
triggerPrice: (0, __injectivelabs_utils.toChainFormat)(initialParams.triggerPrice || 0).toFixed(),
|
|
3196
|
+
quantity: (0, __injectivelabs_utils.toChainFormat)(initialParams.quantity).toFixed()
|
|
3197
|
+
});
|
|
3198
|
+
}
|
|
3199
|
+
toData() {
|
|
3200
|
+
const proto = this.toProto();
|
|
3201
|
+
return {
|
|
3202
|
+
"@type": "/injective.exchange.v1beta1.MsgCreateDerivativeLimitOrder",
|
|
3203
|
+
...proto
|
|
3204
|
+
};
|
|
3205
|
+
}
|
|
3206
|
+
toAmino() {
|
|
3207
|
+
const { params } = this;
|
|
3208
|
+
return {
|
|
3209
|
+
type: "exchange/MsgCreateDerivativeLimitOrder",
|
|
3210
|
+
value: {
|
|
3211
|
+
sender: params.injectiveAddress,
|
|
3212
|
+
order: {
|
|
3213
|
+
market_id: params.marketId,
|
|
3214
|
+
order_info: {
|
|
3215
|
+
subaccount_id: params.subaccountId,
|
|
3216
|
+
fee_recipient: params.feeRecipient,
|
|
3217
|
+
price: params.price,
|
|
3218
|
+
quantity: params.quantity,
|
|
3219
|
+
cid: params.cid || ""
|
|
3220
|
+
},
|
|
3221
|
+
order_type: params.orderType,
|
|
3222
|
+
margin: params.margin,
|
|
3223
|
+
trigger_price: params.triggerPrice || "0"
|
|
3224
|
+
}
|
|
3225
|
+
}
|
|
3226
|
+
};
|
|
3227
|
+
}
|
|
3228
|
+
toWeb3Gw() {
|
|
3229
|
+
const { value } = this.toAmino();
|
|
3230
|
+
return {
|
|
3231
|
+
"@type": "/injective.exchange.v1beta1.MsgCreateDerivativeLimitOrder",
|
|
3232
|
+
...value
|
|
3233
|
+
};
|
|
3234
|
+
}
|
|
3235
|
+
toEip712V2() {
|
|
3236
|
+
const { params } = this;
|
|
3237
|
+
const web3gw = this.toWeb3Gw();
|
|
3238
|
+
const order = web3gw.order;
|
|
3239
|
+
return {
|
|
3240
|
+
...web3gw,
|
|
3241
|
+
order: {
|
|
3242
|
+
...order,
|
|
3243
|
+
order_info: {
|
|
3244
|
+
...order.order_info,
|
|
3245
|
+
price: require_utils.numberToCosmosSdkDecString(params.price),
|
|
3246
|
+
quantity: require_utils.numberToCosmosSdkDecString(params.quantity)
|
|
3247
|
+
},
|
|
3248
|
+
margin: require_utils.numberToCosmosSdkDecString(params.margin),
|
|
3249
|
+
trigger_price: require_utils.numberToCosmosSdkDecString(params.triggerPrice || "0"),
|
|
3250
|
+
order_type: __injectivelabs_core_proto_ts_v2_generated_injective_exchange_v1beta1_exchange_pb.OrderType[params.orderType]
|
|
3251
|
+
}
|
|
3252
|
+
};
|
|
3253
|
+
}
|
|
3254
|
+
toEip712() {
|
|
3255
|
+
var _value$order;
|
|
3256
|
+
const { params } = this;
|
|
3257
|
+
const { value, type } = this.toAmino();
|
|
3258
|
+
return {
|
|
3259
|
+
type,
|
|
3260
|
+
value: {
|
|
3261
|
+
...value,
|
|
3262
|
+
order: {
|
|
3263
|
+
...value.order,
|
|
3264
|
+
order_info: {
|
|
3265
|
+
...(_value$order = value.order) === null || _value$order === void 0 ? void 0 : _value$order.order_info,
|
|
3266
|
+
price: (0, __injectivelabs_utils.toChainFormat)(params.price).toFixed(),
|
|
3267
|
+
quantity: (0, __injectivelabs_utils.toChainFormat)(params.quantity).toFixed()
|
|
3268
|
+
},
|
|
3269
|
+
margin: (0, __injectivelabs_utils.toChainFormat)(params.margin).toFixed(),
|
|
3270
|
+
trigger_price: (0, __injectivelabs_utils.toChainFormat)(params.triggerPrice || "0").toFixed()
|
|
3271
|
+
}
|
|
3272
|
+
}
|
|
3273
|
+
};
|
|
3274
|
+
}
|
|
3275
|
+
toDirectSign() {
|
|
3276
|
+
return {
|
|
3277
|
+
type: "/injective.exchange.v1beta1.MsgCreateDerivativeLimitOrder",
|
|
3278
|
+
message: this.toProto()
|
|
3279
|
+
};
|
|
3280
|
+
}
|
|
3281
|
+
toBinary() {
|
|
3282
|
+
return __injectivelabs_core_proto_ts_v2_generated_injective_exchange_v1beta1_tx_pb.MsgCreateDerivativeLimitOrder.toBinary(this.toProto());
|
|
3283
|
+
}
|
|
3284
|
+
};
|
|
3285
|
+
|
|
3286
|
+
//#endregion
|
|
3287
|
+
//#region src/core/modules/exchange/msgs/MsgCancelBinaryOptionsOrderV2.ts
|
|
3288
|
+
/**
|
|
3289
|
+
* @category Messages
|
|
3290
|
+
*/
|
|
3291
|
+
var MsgCancelBinaryOptionsOrderV2 = class MsgCancelBinaryOptionsOrderV2 extends require_MsgBase.MsgBase {
|
|
3292
|
+
static fromJSON(params) {
|
|
3293
|
+
return new MsgCancelBinaryOptionsOrderV2(params);
|
|
3294
|
+
}
|
|
3295
|
+
toProto() {
|
|
3296
|
+
const { params } = this;
|
|
3297
|
+
return __injectivelabs_core_proto_ts_v2_generated_injective_exchange_v2_tx_pb.MsgCancelBinaryOptionsOrder.create({
|
|
3298
|
+
sender: params.injectiveAddress,
|
|
3299
|
+
marketId: params.marketId,
|
|
3300
|
+
subaccountId: params.subaccountId,
|
|
3301
|
+
orderHash: params.orderHash || "",
|
|
3302
|
+
orderMask: params.orderMask || __injectivelabs_core_proto_ts_v2_generated_injective_exchange_v2_order_pb.OrderMask.ANY,
|
|
3303
|
+
cid: params.cid || ""
|
|
3304
|
+
});
|
|
3305
|
+
}
|
|
3306
|
+
toData() {
|
|
3307
|
+
const proto = this.toProto();
|
|
3308
|
+
return {
|
|
3309
|
+
"@type": "/injective.exchange.v2.MsgCancelBinaryOptionsOrder",
|
|
3310
|
+
...proto
|
|
3311
|
+
};
|
|
3312
|
+
}
|
|
3313
|
+
toAmino() {
|
|
3314
|
+
const proto = this.toProto();
|
|
3315
|
+
return {
|
|
3316
|
+
type: "exchange/MsgCancelBinaryOptionsOrder",
|
|
3317
|
+
value: {
|
|
3318
|
+
sender: proto.sender,
|
|
3319
|
+
market_id: proto.marketId,
|
|
3320
|
+
subaccount_id: proto.subaccountId,
|
|
3321
|
+
order_hash: proto.orderHash,
|
|
3322
|
+
order_mask: proto.orderMask,
|
|
3323
|
+
cid: proto.cid
|
|
3324
|
+
}
|
|
3325
|
+
};
|
|
3326
|
+
}
|
|
3327
|
+
toWeb3Gw() {
|
|
3328
|
+
const { value } = this.toAmino();
|
|
3329
|
+
return {
|
|
3330
|
+
"@type": "/injective.exchange.v2.MsgCancelBinaryOptionsOrder",
|
|
3331
|
+
...value
|
|
3332
|
+
};
|
|
3333
|
+
}
|
|
3334
|
+
toDirectSign() {
|
|
3335
|
+
return {
|
|
3336
|
+
type: "/injective.exchange.v2.MsgCancelBinaryOptionsOrder",
|
|
3337
|
+
message: this.toProto()
|
|
3338
|
+
};
|
|
3339
|
+
}
|
|
3340
|
+
toBinary() {
|
|
3341
|
+
return __injectivelabs_core_proto_ts_v2_generated_injective_exchange_v2_tx_pb.MsgCancelBinaryOptionsOrder.toBinary(this.toProto());
|
|
3342
|
+
}
|
|
3343
|
+
};
|
|
3344
|
+
|
|
3345
|
+
//#endregion
|
|
3346
|
+
//#region src/core/modules/exchange/msgs/MsgBatchCancelDerivativeOrders.ts
|
|
3347
|
+
/**
|
|
3348
|
+
* @category Messages
|
|
3349
|
+
*/
|
|
3350
|
+
var MsgBatchCancelDerivativeOrders = class MsgBatchCancelDerivativeOrders extends require_MsgBase.MsgBase {
|
|
3351
|
+
static fromJSON(params) {
|
|
3352
|
+
return new MsgBatchCancelDerivativeOrders(params);
|
|
3353
|
+
}
|
|
3354
|
+
toProto() {
|
|
3355
|
+
const { params } = this;
|
|
3356
|
+
const orderDataList = params.orders.map((order) => {
|
|
3357
|
+
return __injectivelabs_core_proto_ts_v2_generated_injective_exchange_v1beta1_tx_pb.OrderData.create({
|
|
3358
|
+
marketId: order.marketId,
|
|
3359
|
+
subaccountId: order.subaccountId,
|
|
3360
|
+
orderHash: order.orderHash || "",
|
|
3361
|
+
orderMask: order.orderMask || __injectivelabs_core_proto_ts_v2_generated_injective_exchange_v1beta1_exchange_pb.OrderMask.ANY,
|
|
3362
|
+
cid: order.cid || ""
|
|
3363
|
+
});
|
|
3364
|
+
});
|
|
3365
|
+
return __injectivelabs_core_proto_ts_v2_generated_injective_exchange_v1beta1_tx_pb.MsgBatchCancelDerivativeOrders.create({
|
|
3366
|
+
sender: params.injectiveAddress,
|
|
3367
|
+
data: orderDataList
|
|
3368
|
+
});
|
|
3369
|
+
}
|
|
3370
|
+
toData() {
|
|
3371
|
+
const proto = this.toProto();
|
|
3372
|
+
return {
|
|
3373
|
+
"@type": "/injective.exchange.v1beta1.MsgBatchCancelDerivativeOrders",
|
|
3374
|
+
...proto
|
|
918
3375
|
};
|
|
919
3376
|
}
|
|
920
|
-
|
|
921
|
-
const
|
|
3377
|
+
toAmino() {
|
|
3378
|
+
const proto = this.toProto();
|
|
922
3379
|
return {
|
|
923
|
-
|
|
924
|
-
|
|
3380
|
+
type: "exchange/MsgBatchCancelDerivativeOrders",
|
|
3381
|
+
value: {
|
|
3382
|
+
sender: proto.sender,
|
|
3383
|
+
data: proto.data.map((orderData) => ({
|
|
3384
|
+
market_id: orderData.marketId,
|
|
3385
|
+
subaccount_id: orderData.subaccountId,
|
|
3386
|
+
order_hash: orderData.orderHash,
|
|
3387
|
+
order_mask: orderData.orderMask,
|
|
3388
|
+
cid: orderData.cid
|
|
3389
|
+
}))
|
|
3390
|
+
}
|
|
925
3391
|
};
|
|
926
3392
|
}
|
|
927
|
-
|
|
928
|
-
const {
|
|
3393
|
+
toWeb3Gw() {
|
|
3394
|
+
const { value } = this.toAmino();
|
|
929
3395
|
return {
|
|
930
|
-
type,
|
|
931
|
-
|
|
3396
|
+
"@type": "/injective.exchange.v1beta1.MsgBatchCancelDerivativeOrders",
|
|
3397
|
+
...value
|
|
932
3398
|
};
|
|
933
3399
|
}
|
|
934
|
-
toEip712V2() {
|
|
935
|
-
return { ...this.toWeb3Gw() };
|
|
936
|
-
}
|
|
937
3400
|
toDirectSign() {
|
|
938
3401
|
return {
|
|
939
|
-
type: "/injective.exchange.
|
|
3402
|
+
type: "/injective.exchange.v1beta1.MsgBatchCancelDerivativeOrders",
|
|
940
3403
|
message: this.toProto()
|
|
941
3404
|
};
|
|
942
3405
|
}
|
|
943
3406
|
toBinary() {
|
|
944
|
-
return
|
|
3407
|
+
return __injectivelabs_core_proto_ts_v2_generated_injective_exchange_v1beta1_tx_pb.MsgBatchCancelDerivativeOrders.toBinary(this.toProto());
|
|
945
3408
|
}
|
|
946
3409
|
};
|
|
947
3410
|
|
|
948
3411
|
//#endregion
|
|
949
|
-
//#region src/core/modules/exchange/msgs/
|
|
950
|
-
const
|
|
3412
|
+
//#region src/core/modules/exchange/msgs/MsgCreateDerivativeMarketOrder.ts
|
|
3413
|
+
const createMarketOrder$3 = (params) => {
|
|
951
3414
|
const orderInfo = __injectivelabs_core_proto_ts_v2_generated_injective_exchange_v1beta1_exchange_pb.OrderInfo.create({
|
|
952
3415
|
subaccountId: params.subaccountId,
|
|
953
3416
|
feeRecipient: params.feeRecipient,
|
|
@@ -955,29 +3418,31 @@ const createLimitOrder$2 = (params) => {
|
|
|
955
3418
|
quantity: params.quantity,
|
|
956
3419
|
cid: params.cid || ""
|
|
957
3420
|
});
|
|
958
|
-
const
|
|
3421
|
+
const derivativeOrder = __injectivelabs_core_proto_ts_v2_generated_injective_exchange_v1beta1_exchange_pb.DerivativeOrder.create({
|
|
959
3422
|
marketId: params.marketId,
|
|
960
3423
|
orderInfo,
|
|
961
3424
|
orderType: params.orderType,
|
|
3425
|
+
margin: params.margin,
|
|
962
3426
|
triggerPrice: params.triggerPrice || "0"
|
|
963
3427
|
});
|
|
964
|
-
return __injectivelabs_core_proto_ts_v2_generated_injective_exchange_v1beta1_tx_pb.
|
|
3428
|
+
return __injectivelabs_core_proto_ts_v2_generated_injective_exchange_v1beta1_tx_pb.MsgCreateDerivativeMarketOrder.create({
|
|
965
3429
|
sender: params.injectiveAddress,
|
|
966
|
-
order:
|
|
3430
|
+
order: derivativeOrder
|
|
967
3431
|
});
|
|
968
3432
|
};
|
|
969
3433
|
/**
|
|
970
3434
|
* @category Messages
|
|
971
3435
|
*/
|
|
972
|
-
var
|
|
3436
|
+
var MsgCreateDerivativeMarketOrder = class MsgCreateDerivativeMarketOrder extends require_MsgBase.MsgBase {
|
|
973
3437
|
static fromJSON(params) {
|
|
974
|
-
return new
|
|
3438
|
+
return new MsgCreateDerivativeMarketOrder(params);
|
|
975
3439
|
}
|
|
976
3440
|
toProto() {
|
|
977
3441
|
const { params: initialParams } = this;
|
|
978
|
-
return
|
|
3442
|
+
return createMarketOrder$3({
|
|
979
3443
|
...initialParams,
|
|
980
3444
|
price: (0, __injectivelabs_utils.toChainFormat)(initialParams.price).toFixed(),
|
|
3445
|
+
margin: (0, __injectivelabs_utils.toChainFormat)(initialParams.margin).toFixed(),
|
|
981
3446
|
triggerPrice: (0, __injectivelabs_utils.toChainFormat)(initialParams.triggerPrice || 0).toFixed(),
|
|
982
3447
|
quantity: (0, __injectivelabs_utils.toChainFormat)(initialParams.quantity).toFixed()
|
|
983
3448
|
});
|
|
@@ -985,14 +3450,14 @@ var MsgCreateSpotLimitOrder = class MsgCreateSpotLimitOrder extends require_MsgB
|
|
|
985
3450
|
toData() {
|
|
986
3451
|
const proto = this.toProto();
|
|
987
3452
|
return {
|
|
988
|
-
"@type": "/injective.exchange.v1beta1.
|
|
3453
|
+
"@type": "/injective.exchange.v1beta1.MsgCreateDerivativeMarketOrder",
|
|
989
3454
|
...proto
|
|
990
3455
|
};
|
|
991
3456
|
}
|
|
992
3457
|
toAmino() {
|
|
993
3458
|
const { params } = this;
|
|
994
3459
|
return {
|
|
995
|
-
type: "exchange/
|
|
3460
|
+
type: "exchange/MsgCreateDerivativeMarketOrder",
|
|
996
3461
|
value: {
|
|
997
3462
|
sender: params.injectiveAddress,
|
|
998
3463
|
order: {
|
|
@@ -1005,6 +3470,7 @@ var MsgCreateSpotLimitOrder = class MsgCreateSpotLimitOrder extends require_MsgB
|
|
|
1005
3470
|
cid: params.cid || ""
|
|
1006
3471
|
},
|
|
1007
3472
|
order_type: params.orderType,
|
|
3473
|
+
margin: params.margin,
|
|
1008
3474
|
trigger_price: params.triggerPrice || "0"
|
|
1009
3475
|
}
|
|
1010
3476
|
}
|
|
@@ -1013,7 +3479,7 @@ var MsgCreateSpotLimitOrder = class MsgCreateSpotLimitOrder extends require_MsgB
|
|
|
1013
3479
|
toWeb3Gw() {
|
|
1014
3480
|
const { value } = this.toAmino();
|
|
1015
3481
|
return {
|
|
1016
|
-
"@type": "/injective.exchange.v1beta1.
|
|
3482
|
+
"@type": "/injective.exchange.v1beta1.MsgCreateDerivativeMarketOrder",
|
|
1017
3483
|
...value
|
|
1018
3484
|
};
|
|
1019
3485
|
}
|
|
@@ -1030,6 +3496,7 @@ var MsgCreateSpotLimitOrder = class MsgCreateSpotLimitOrder extends require_MsgB
|
|
|
1030
3496
|
price: require_utils.numberToCosmosSdkDecString(params.price),
|
|
1031
3497
|
quantity: require_utils.numberToCosmosSdkDecString(params.quantity)
|
|
1032
3498
|
},
|
|
3499
|
+
margin: require_utils.numberToCosmosSdkDecString(params.margin),
|
|
1033
3500
|
trigger_price: require_utils.numberToCosmosSdkDecString(params.triggerPrice || "0"),
|
|
1034
3501
|
order_type: __injectivelabs_core_proto_ts_v2_generated_injective_exchange_v1beta1_exchange_pb.OrderType[params.orderType]
|
|
1035
3502
|
}
|
|
@@ -1050,6 +3517,7 @@ var MsgCreateSpotLimitOrder = class MsgCreateSpotLimitOrder extends require_MsgB
|
|
|
1050
3517
|
price: (0, __injectivelabs_utils.toChainFormat)(params.price).toFixed(),
|
|
1051
3518
|
quantity: (0, __injectivelabs_utils.toChainFormat)(params.quantity).toFixed()
|
|
1052
3519
|
},
|
|
3520
|
+
margin: (0, __injectivelabs_utils.toChainFormat)(params.margin).toFixed(),
|
|
1053
3521
|
trigger_price: (0, __injectivelabs_utils.toChainFormat)(params.triggerPrice || "0").toFixed()
|
|
1054
3522
|
}
|
|
1055
3523
|
}
|
|
@@ -1057,224 +3525,371 @@ var MsgCreateSpotLimitOrder = class MsgCreateSpotLimitOrder extends require_MsgB
|
|
|
1057
3525
|
}
|
|
1058
3526
|
toDirectSign() {
|
|
1059
3527
|
return {
|
|
1060
|
-
type: "/injective.exchange.v1beta1.
|
|
3528
|
+
type: "/injective.exchange.v1beta1.MsgCreateDerivativeMarketOrder",
|
|
1061
3529
|
message: this.toProto()
|
|
1062
3530
|
};
|
|
1063
3531
|
}
|
|
1064
3532
|
toBinary() {
|
|
1065
|
-
return __injectivelabs_core_proto_ts_v2_generated_injective_exchange_v1beta1_tx_pb.
|
|
3533
|
+
return __injectivelabs_core_proto_ts_v2_generated_injective_exchange_v1beta1_tx_pb.MsgCreateDerivativeMarketOrder.toBinary(this.toProto());
|
|
1066
3534
|
}
|
|
1067
3535
|
};
|
|
1068
3536
|
|
|
1069
3537
|
//#endregion
|
|
1070
|
-
//#region src/core/modules/exchange/msgs/
|
|
3538
|
+
//#region src/core/modules/exchange/msgs/MsgCreateDerivativeLimitOrderV2.ts
|
|
3539
|
+
const createLimitOrder$2 = (params) => {
|
|
3540
|
+
const orderInfo = __injectivelabs_core_proto_ts_v2_generated_injective_exchange_v2_order_pb.OrderInfo.create({
|
|
3541
|
+
subaccountId: params.subaccountId,
|
|
3542
|
+
feeRecipient: params.feeRecipient,
|
|
3543
|
+
price: params.price,
|
|
3544
|
+
quantity: params.quantity,
|
|
3545
|
+
cid: params.cid || ""
|
|
3546
|
+
});
|
|
3547
|
+
const derivativeOrder = __injectivelabs_core_proto_ts_v2_generated_injective_exchange_v2_order_pb.DerivativeOrder.create({
|
|
3548
|
+
marketId: params.marketId,
|
|
3549
|
+
orderInfo,
|
|
3550
|
+
orderType: params.orderType,
|
|
3551
|
+
margin: params.margin,
|
|
3552
|
+
triggerPrice: params.triggerPrice || "0",
|
|
3553
|
+
expirationBlock: params.expirationBlock ? BigInt(params.expirationBlock) : BigInt(0)
|
|
3554
|
+
});
|
|
3555
|
+
return __injectivelabs_core_proto_ts_v2_generated_injective_exchange_v2_tx_pb.MsgCreateDerivativeLimitOrder.create({
|
|
3556
|
+
sender: params.injectiveAddress,
|
|
3557
|
+
order: derivativeOrder
|
|
3558
|
+
});
|
|
3559
|
+
};
|
|
1071
3560
|
/**
|
|
1072
3561
|
* @category Messages
|
|
1073
3562
|
*/
|
|
1074
|
-
var
|
|
3563
|
+
var MsgCreateDerivativeLimitOrderV2 = class MsgCreateDerivativeLimitOrderV2 extends require_MsgBase.MsgBase {
|
|
1075
3564
|
static fromJSON(params) {
|
|
1076
|
-
return new
|
|
3565
|
+
return new MsgCreateDerivativeLimitOrderV2(params);
|
|
1077
3566
|
}
|
|
1078
3567
|
toProto() {
|
|
1079
|
-
const { params } = this;
|
|
1080
|
-
return
|
|
1081
|
-
|
|
1082
|
-
|
|
1083
|
-
|
|
1084
|
-
|
|
1085
|
-
|
|
3568
|
+
const { params: initialParams } = this;
|
|
3569
|
+
return createLimitOrder$2({
|
|
3570
|
+
...initialParams,
|
|
3571
|
+
price: (0, __injectivelabs_utils.toChainFormat)(initialParams.price).toFixed(),
|
|
3572
|
+
margin: (0, __injectivelabs_utils.toChainFormat)(initialParams.margin).toFixed(),
|
|
3573
|
+
triggerPrice: (0, __injectivelabs_utils.toChainFormat)(initialParams.triggerPrice || 0).toFixed(),
|
|
3574
|
+
quantity: (0, __injectivelabs_utils.toChainFormat)(initialParams.quantity).toFixed()
|
|
1086
3575
|
});
|
|
1087
3576
|
}
|
|
1088
3577
|
toData() {
|
|
1089
3578
|
const proto = this.toProto();
|
|
1090
3579
|
return {
|
|
1091
|
-
"@type": "/injective.exchange.
|
|
3580
|
+
"@type": "/injective.exchange.v2.MsgCreateDerivativeLimitOrder",
|
|
1092
3581
|
...proto
|
|
1093
3582
|
};
|
|
1094
3583
|
}
|
|
1095
3584
|
toAmino() {
|
|
1096
|
-
const
|
|
3585
|
+
const { params } = this;
|
|
1097
3586
|
return {
|
|
1098
|
-
type: "exchange/
|
|
3587
|
+
type: "exchange/MsgCreateDerivativeLimitOrder",
|
|
1099
3588
|
value: {
|
|
1100
|
-
sender:
|
|
1101
|
-
|
|
3589
|
+
sender: params.injectiveAddress,
|
|
3590
|
+
order: {
|
|
3591
|
+
market_id: params.marketId,
|
|
3592
|
+
order_info: {
|
|
3593
|
+
subaccount_id: params.subaccountId,
|
|
3594
|
+
fee_recipient: params.feeRecipient,
|
|
3595
|
+
price: params.price,
|
|
3596
|
+
quantity: params.quantity,
|
|
3597
|
+
cid: params.cid || ""
|
|
3598
|
+
},
|
|
3599
|
+
order_type: params.orderType,
|
|
3600
|
+
margin: params.margin,
|
|
3601
|
+
trigger_price: params.triggerPrice || "0",
|
|
3602
|
+
expiration_block: params.expirationBlock || "0"
|
|
3603
|
+
}
|
|
1102
3604
|
}
|
|
1103
3605
|
};
|
|
1104
3606
|
}
|
|
1105
3607
|
toWeb3Gw() {
|
|
1106
3608
|
const { value } = this.toAmino();
|
|
1107
3609
|
return {
|
|
1108
|
-
"@type": "/injective.exchange.
|
|
3610
|
+
"@type": "/injective.exchange.v2.MsgCreateDerivativeLimitOrder",
|
|
1109
3611
|
...value
|
|
1110
3612
|
};
|
|
1111
3613
|
}
|
|
3614
|
+
toEip712V2() {
|
|
3615
|
+
const { params } = this;
|
|
3616
|
+
const web3gw = this.toWeb3Gw();
|
|
3617
|
+
const order = web3gw.order;
|
|
3618
|
+
return {
|
|
3619
|
+
...web3gw,
|
|
3620
|
+
order: {
|
|
3621
|
+
...order,
|
|
3622
|
+
order_info: {
|
|
3623
|
+
...order.order_info,
|
|
3624
|
+
price: require_utils.numberToCosmosSdkDecString(params.price),
|
|
3625
|
+
quantity: require_utils.numberToCosmosSdkDecString(params.quantity)
|
|
3626
|
+
},
|
|
3627
|
+
margin: require_utils.numberToCosmosSdkDecString(params.margin),
|
|
3628
|
+
trigger_price: require_utils.numberToCosmosSdkDecString(params.triggerPrice || "0"),
|
|
3629
|
+
order_type: __injectivelabs_core_proto_ts_v2_generated_injective_exchange_v2_order_pb.OrderType[params.orderType]
|
|
3630
|
+
}
|
|
3631
|
+
};
|
|
3632
|
+
}
|
|
3633
|
+
toEip712() {
|
|
3634
|
+
const { params } = this;
|
|
3635
|
+
const { value, type } = this.toAmino();
|
|
3636
|
+
const { expiration_block: _eb, ...orderWithoutExpiration } = value.order || {};
|
|
3637
|
+
return {
|
|
3638
|
+
type,
|
|
3639
|
+
value: {
|
|
3640
|
+
...value,
|
|
3641
|
+
order: {
|
|
3642
|
+
...orderWithoutExpiration,
|
|
3643
|
+
order_info: {
|
|
3644
|
+
...orderWithoutExpiration === null || orderWithoutExpiration === void 0 ? void 0 : orderWithoutExpiration.order_info,
|
|
3645
|
+
price: (0, __injectivelabs_utils.toChainFormat)(params.price).toFixed(),
|
|
3646
|
+
quantity: (0, __injectivelabs_utils.toChainFormat)(params.quantity).toFixed()
|
|
3647
|
+
},
|
|
3648
|
+
margin: (0, __injectivelabs_utils.toChainFormat)(params.margin).toFixed(),
|
|
3649
|
+
trigger_price: (0, __injectivelabs_utils.toChainFormat)(params.triggerPrice || "0").toFixed()
|
|
3650
|
+
}
|
|
3651
|
+
}
|
|
3652
|
+
};
|
|
3653
|
+
}
|
|
1112
3654
|
toDirectSign() {
|
|
1113
3655
|
return {
|
|
1114
|
-
type: "/injective.exchange.
|
|
3656
|
+
type: "/injective.exchange.v2.MsgCreateDerivativeLimitOrder",
|
|
1115
3657
|
message: this.toProto()
|
|
1116
3658
|
};
|
|
1117
3659
|
}
|
|
1118
3660
|
toBinary() {
|
|
1119
|
-
return
|
|
3661
|
+
return __injectivelabs_core_proto_ts_v2_generated_injective_exchange_v2_tx_pb.MsgCreateDerivativeLimitOrder.toBinary(this.toProto());
|
|
1120
3662
|
}
|
|
1121
3663
|
};
|
|
1122
3664
|
|
|
1123
3665
|
//#endregion
|
|
1124
|
-
//#region src/core/modules/exchange/msgs/
|
|
3666
|
+
//#region src/core/modules/exchange/msgs/MsgCreateBinaryOptionsLimitOrder.ts
|
|
3667
|
+
const createLimitOrder$1 = (params) => {
|
|
3668
|
+
const orderInfo = __injectivelabs_core_proto_ts_v2_generated_injective_exchange_v1beta1_exchange_pb.OrderInfo.create({
|
|
3669
|
+
subaccountId: params.subaccountId,
|
|
3670
|
+
feeRecipient: params.feeRecipient,
|
|
3671
|
+
price: params.price,
|
|
3672
|
+
quantity: params.quantity,
|
|
3673
|
+
cid: params.cid || ""
|
|
3674
|
+
});
|
|
3675
|
+
const derivativeOrder = __injectivelabs_core_proto_ts_v2_generated_injective_exchange_v1beta1_exchange_pb.DerivativeOrder.create({
|
|
3676
|
+
marketId: params.marketId,
|
|
3677
|
+
orderInfo,
|
|
3678
|
+
orderType: params.orderType,
|
|
3679
|
+
margin: params.margin,
|
|
3680
|
+
triggerPrice: params.triggerPrice || "0"
|
|
3681
|
+
});
|
|
3682
|
+
return __injectivelabs_core_proto_ts_v2_generated_injective_exchange_v1beta1_tx_pb.MsgCreateBinaryOptionsLimitOrder.create({
|
|
3683
|
+
sender: params.injectiveAddress,
|
|
3684
|
+
order: derivativeOrder
|
|
3685
|
+
});
|
|
3686
|
+
};
|
|
1125
3687
|
/**
|
|
1126
3688
|
* @category Messages
|
|
1127
3689
|
*/
|
|
1128
|
-
var
|
|
3690
|
+
var MsgCreateBinaryOptionsLimitOrder = class MsgCreateBinaryOptionsLimitOrder extends require_MsgBase.MsgBase {
|
|
1129
3691
|
static fromJSON(params) {
|
|
1130
|
-
return new
|
|
3692
|
+
return new MsgCreateBinaryOptionsLimitOrder(params);
|
|
1131
3693
|
}
|
|
1132
3694
|
toProto() {
|
|
1133
|
-
const { params } = this;
|
|
1134
|
-
|
|
1135
|
-
|
|
1136
|
-
|
|
1137
|
-
|
|
1138
|
-
|
|
1139
|
-
|
|
1140
|
-
cid: order.cid || ""
|
|
1141
|
-
});
|
|
1142
|
-
});
|
|
1143
|
-
return __injectivelabs_core_proto_ts_v2_generated_injective_exchange_v1beta1_tx_pb.MsgBatchCancelSpotOrders.create({
|
|
1144
|
-
sender: params.injectiveAddress,
|
|
1145
|
-
data: orderDataList
|
|
3695
|
+
const { params: initialParams } = this;
|
|
3696
|
+
return createLimitOrder$1({
|
|
3697
|
+
...initialParams,
|
|
3698
|
+
price: (0, __injectivelabs_utils.toChainFormat)(initialParams.price).toFixed(),
|
|
3699
|
+
margin: (0, __injectivelabs_utils.toChainFormat)(initialParams.margin).toFixed(),
|
|
3700
|
+
triggerPrice: (0, __injectivelabs_utils.toChainFormat)(initialParams.triggerPrice || 0).toFixed(),
|
|
3701
|
+
quantity: (0, __injectivelabs_utils.toChainFormat)(initialParams.quantity).toFixed()
|
|
1146
3702
|
});
|
|
1147
3703
|
}
|
|
1148
3704
|
toData() {
|
|
1149
3705
|
const proto = this.toProto();
|
|
1150
3706
|
return {
|
|
1151
|
-
"@type": "/injective.exchange.v1beta1.
|
|
3707
|
+
"@type": "/injective.exchange.v1beta1.MsgCreateBinaryOptionsLimitOrder",
|
|
1152
3708
|
...proto
|
|
1153
3709
|
};
|
|
1154
3710
|
}
|
|
1155
3711
|
toAmino() {
|
|
1156
|
-
const
|
|
3712
|
+
const { params } = this;
|
|
1157
3713
|
return {
|
|
1158
|
-
type: "exchange/
|
|
3714
|
+
type: "exchange/MsgCreateBinaryOptionsLimitOrder",
|
|
1159
3715
|
value: {
|
|
1160
|
-
sender:
|
|
1161
|
-
|
|
1162
|
-
market_id:
|
|
1163
|
-
|
|
1164
|
-
|
|
1165
|
-
|
|
1166
|
-
|
|
1167
|
-
|
|
3716
|
+
sender: params.injectiveAddress,
|
|
3717
|
+
order: {
|
|
3718
|
+
market_id: params.marketId,
|
|
3719
|
+
order_info: {
|
|
3720
|
+
subaccount_id: params.subaccountId,
|
|
3721
|
+
fee_recipient: params.feeRecipient,
|
|
3722
|
+
price: params.price,
|
|
3723
|
+
quantity: params.quantity,
|
|
3724
|
+
cid: params.cid || ""
|
|
3725
|
+
},
|
|
3726
|
+
order_type: params.orderType,
|
|
3727
|
+
margin: params.margin,
|
|
3728
|
+
trigger_price: params.triggerPrice || "0"
|
|
3729
|
+
}
|
|
3730
|
+
}
|
|
3731
|
+
};
|
|
3732
|
+
}
|
|
3733
|
+
toWeb3Gw() {
|
|
3734
|
+
const { value } = this.toAmino();
|
|
3735
|
+
return {
|
|
3736
|
+
"@type": "/injective.exchange.v1beta1.MsgCreateBinaryOptionsLimitOrder",
|
|
3737
|
+
...value
|
|
3738
|
+
};
|
|
3739
|
+
}
|
|
3740
|
+
toEip712V2() {
|
|
3741
|
+
const { params } = this;
|
|
3742
|
+
const web3gw = this.toWeb3Gw();
|
|
3743
|
+
const order = web3gw.order;
|
|
3744
|
+
return {
|
|
3745
|
+
...web3gw,
|
|
3746
|
+
order: {
|
|
3747
|
+
...order,
|
|
3748
|
+
order_info: {
|
|
3749
|
+
...order.order_info,
|
|
3750
|
+
price: require_utils.numberToCosmosSdkDecString(params.price),
|
|
3751
|
+
quantity: require_utils.numberToCosmosSdkDecString(params.quantity)
|
|
3752
|
+
},
|
|
3753
|
+
margin: require_utils.numberToCosmosSdkDecString(params.margin),
|
|
3754
|
+
trigger_price: require_utils.numberToCosmosSdkDecString(params.triggerPrice || "0"),
|
|
3755
|
+
order_type: __injectivelabs_core_proto_ts_v2_generated_injective_exchange_v1beta1_exchange_pb.OrderType[params.orderType]
|
|
1168
3756
|
}
|
|
1169
3757
|
};
|
|
1170
3758
|
}
|
|
1171
|
-
|
|
1172
|
-
|
|
3759
|
+
toEip712() {
|
|
3760
|
+
var _value$order;
|
|
3761
|
+
const { params } = this;
|
|
3762
|
+
const { value, type } = this.toAmino();
|
|
1173
3763
|
return {
|
|
1174
|
-
|
|
1175
|
-
|
|
3764
|
+
type,
|
|
3765
|
+
value: {
|
|
3766
|
+
...value,
|
|
3767
|
+
order: {
|
|
3768
|
+
...value.order,
|
|
3769
|
+
order_info: {
|
|
3770
|
+
...(_value$order = value.order) === null || _value$order === void 0 ? void 0 : _value$order.order_info,
|
|
3771
|
+
price: (0, __injectivelabs_utils.toChainFormat)(params.price).toFixed(),
|
|
3772
|
+
quantity: (0, __injectivelabs_utils.toChainFormat)(params.quantity).toFixed()
|
|
3773
|
+
},
|
|
3774
|
+
margin: (0, __injectivelabs_utils.toChainFormat)(params.margin).toFixed(),
|
|
3775
|
+
trigger_price: (0, __injectivelabs_utils.toChainFormat)(params.triggerPrice || "0").toFixed()
|
|
3776
|
+
}
|
|
3777
|
+
}
|
|
1176
3778
|
};
|
|
1177
3779
|
}
|
|
1178
3780
|
toDirectSign() {
|
|
1179
3781
|
return {
|
|
1180
|
-
type: "/injective.exchange.v1beta1.
|
|
3782
|
+
type: "/injective.exchange.v1beta1.MsgCreateBinaryOptionsLimitOrder",
|
|
1181
3783
|
message: this.toProto()
|
|
1182
3784
|
};
|
|
1183
3785
|
}
|
|
1184
3786
|
toBinary() {
|
|
1185
|
-
return __injectivelabs_core_proto_ts_v2_generated_injective_exchange_v1beta1_tx_pb.
|
|
3787
|
+
return __injectivelabs_core_proto_ts_v2_generated_injective_exchange_v1beta1_tx_pb.MsgCreateBinaryOptionsLimitOrder.toBinary(this.toProto());
|
|
1186
3788
|
}
|
|
1187
3789
|
};
|
|
1188
3790
|
|
|
1189
3791
|
//#endregion
|
|
1190
|
-
//#region src/core/modules/exchange/msgs/
|
|
1191
|
-
|
|
3792
|
+
//#region src/core/modules/exchange/msgs/MsgBatchCancelDerivativeOrdersV2.ts
|
|
3793
|
+
/**
|
|
3794
|
+
* @category Messages
|
|
3795
|
+
*/
|
|
3796
|
+
var MsgBatchCancelDerivativeOrdersV2 = class MsgBatchCancelDerivativeOrdersV2 extends require_MsgBase.MsgBase {
|
|
1192
3797
|
static fromJSON(params) {
|
|
1193
|
-
return new
|
|
3798
|
+
return new MsgBatchCancelDerivativeOrdersV2(params);
|
|
1194
3799
|
}
|
|
1195
3800
|
toProto() {
|
|
1196
3801
|
const { params } = this;
|
|
1197
|
-
|
|
3802
|
+
const orderDataList = params.orders.map((order) => {
|
|
3803
|
+
return __injectivelabs_core_proto_ts_v2_generated_injective_exchange_v2_tx_pb.OrderData.create({
|
|
3804
|
+
marketId: order.marketId,
|
|
3805
|
+
subaccountId: order.subaccountId,
|
|
3806
|
+
orderHash: order.orderHash || "",
|
|
3807
|
+
orderMask: order.orderMask || __injectivelabs_core_proto_ts_v2_generated_injective_exchange_v2_order_pb.OrderMask.ANY,
|
|
3808
|
+
cid: order.cid || ""
|
|
3809
|
+
});
|
|
3810
|
+
});
|
|
3811
|
+
return __injectivelabs_core_proto_ts_v2_generated_injective_exchange_v2_tx_pb.MsgBatchCancelDerivativeOrders.create({
|
|
1198
3812
|
sender: params.injectiveAddress,
|
|
1199
|
-
|
|
1200
|
-
subaccountId: params.subaccountId,
|
|
1201
|
-
orderHash: params.orderHash || "",
|
|
1202
|
-
orderMask: params.orderMask || __injectivelabs_core_proto_ts_v2_generated_injective_exchange_v1beta1_exchange_pb.OrderMask.ANY,
|
|
1203
|
-
cid: params.cid || ""
|
|
3813
|
+
data: orderDataList
|
|
1204
3814
|
});
|
|
1205
3815
|
}
|
|
1206
3816
|
toData() {
|
|
1207
3817
|
const proto = this.toProto();
|
|
1208
3818
|
return {
|
|
1209
|
-
"@type": "/injective.exchange.
|
|
3819
|
+
"@type": "/injective.exchange.v2.MsgBatchCancelDerivativeOrders",
|
|
1210
3820
|
...proto
|
|
1211
3821
|
};
|
|
1212
3822
|
}
|
|
1213
3823
|
toAmino() {
|
|
1214
3824
|
const proto = this.toProto();
|
|
1215
3825
|
return {
|
|
1216
|
-
type: "exchange/
|
|
3826
|
+
type: "exchange/MsgBatchCancelDerivativeOrders",
|
|
1217
3827
|
value: {
|
|
1218
3828
|
sender: proto.sender,
|
|
1219
|
-
|
|
1220
|
-
|
|
1221
|
-
|
|
1222
|
-
|
|
1223
|
-
|
|
3829
|
+
data: proto.data.map((orderData) => ({
|
|
3830
|
+
market_id: orderData.marketId,
|
|
3831
|
+
subaccount_id: orderData.subaccountId,
|
|
3832
|
+
order_hash: orderData.orderHash,
|
|
3833
|
+
order_mask: orderData.orderMask,
|
|
3834
|
+
cid: orderData.cid
|
|
3835
|
+
}))
|
|
1224
3836
|
}
|
|
1225
3837
|
};
|
|
1226
3838
|
}
|
|
1227
3839
|
toWeb3Gw() {
|
|
1228
3840
|
const { value } = this.toAmino();
|
|
1229
3841
|
return {
|
|
1230
|
-
"@type": "/injective.exchange.
|
|
3842
|
+
"@type": "/injective.exchange.v2.MsgBatchCancelDerivativeOrders",
|
|
1231
3843
|
...value
|
|
1232
3844
|
};
|
|
1233
3845
|
}
|
|
1234
3846
|
toDirectSign() {
|
|
1235
3847
|
return {
|
|
1236
|
-
type: "/injective.exchange.
|
|
3848
|
+
type: "/injective.exchange.v2.MsgBatchCancelDerivativeOrders",
|
|
1237
3849
|
message: this.toProto()
|
|
1238
3850
|
};
|
|
1239
3851
|
}
|
|
1240
3852
|
toBinary() {
|
|
1241
|
-
return
|
|
3853
|
+
return __injectivelabs_core_proto_ts_v2_generated_injective_exchange_v2_tx_pb.MsgBatchCancelDerivativeOrders.toBinary(this.toProto());
|
|
1242
3854
|
}
|
|
1243
3855
|
};
|
|
1244
3856
|
|
|
1245
3857
|
//#endregion
|
|
1246
|
-
//#region src/core/modules/exchange/msgs/
|
|
3858
|
+
//#region src/core/modules/exchange/msgs/MsgCreateDerivativeMarketOrderV2.ts
|
|
1247
3859
|
const createMarketOrder$2 = (params) => {
|
|
1248
|
-
const orderInfo =
|
|
3860
|
+
const orderInfo = __injectivelabs_core_proto_ts_v2_generated_injective_exchange_v2_order_pb.OrderInfo.create({
|
|
1249
3861
|
subaccountId: params.subaccountId,
|
|
1250
3862
|
feeRecipient: params.feeRecipient,
|
|
1251
3863
|
price: params.price,
|
|
1252
3864
|
quantity: params.quantity,
|
|
1253
3865
|
cid: params.cid || ""
|
|
1254
3866
|
});
|
|
1255
|
-
const
|
|
3867
|
+
const derivativeOrder = __injectivelabs_core_proto_ts_v2_generated_injective_exchange_v2_order_pb.DerivativeOrder.create({
|
|
1256
3868
|
marketId: params.marketId,
|
|
1257
3869
|
orderInfo,
|
|
1258
3870
|
orderType: params.orderType,
|
|
1259
|
-
|
|
3871
|
+
margin: params.margin,
|
|
3872
|
+
triggerPrice: params.triggerPrice || "0",
|
|
3873
|
+
expirationBlock: params.expirationBlock ? BigInt(params.expirationBlock) : BigInt(0)
|
|
1260
3874
|
});
|
|
1261
|
-
return
|
|
3875
|
+
return __injectivelabs_core_proto_ts_v2_generated_injective_exchange_v2_tx_pb.MsgCreateDerivativeMarketOrder.create({
|
|
1262
3876
|
sender: params.injectiveAddress,
|
|
1263
|
-
order:
|
|
3877
|
+
order: derivativeOrder
|
|
1264
3878
|
});
|
|
1265
3879
|
};
|
|
1266
3880
|
/**
|
|
1267
3881
|
* @category Messages
|
|
1268
3882
|
*/
|
|
1269
|
-
var
|
|
3883
|
+
var MsgCreateDerivativeMarketOrderV2 = class MsgCreateDerivativeMarketOrderV2 extends require_MsgBase.MsgBase {
|
|
1270
3884
|
static fromJSON(params) {
|
|
1271
|
-
return new
|
|
3885
|
+
return new MsgCreateDerivativeMarketOrderV2(params);
|
|
1272
3886
|
}
|
|
1273
3887
|
toProto() {
|
|
1274
3888
|
const { params: initialParams } = this;
|
|
1275
3889
|
return createMarketOrder$2({
|
|
1276
3890
|
...initialParams,
|
|
1277
3891
|
price: (0, __injectivelabs_utils.toChainFormat)(initialParams.price).toFixed(),
|
|
3892
|
+
margin: (0, __injectivelabs_utils.toChainFormat)(initialParams.margin).toFixed(),
|
|
1278
3893
|
triggerPrice: (0, __injectivelabs_utils.toChainFormat)(initialParams.triggerPrice || 0).toFixed(),
|
|
1279
3894
|
quantity: (0, __injectivelabs_utils.toChainFormat)(initialParams.quantity).toFixed()
|
|
1280
3895
|
});
|
|
@@ -1282,14 +3897,14 @@ var MsgCreateSpotMarketOrder = class MsgCreateSpotMarketOrder extends require_Ms
|
|
|
1282
3897
|
toData() {
|
|
1283
3898
|
const proto = this.toProto();
|
|
1284
3899
|
return {
|
|
1285
|
-
"@type": "/injective.exchange.
|
|
3900
|
+
"@type": "/injective.exchange.v2.MsgCreateDerivativeMarketOrder",
|
|
1286
3901
|
...proto
|
|
1287
3902
|
};
|
|
1288
3903
|
}
|
|
1289
3904
|
toAmino() {
|
|
1290
3905
|
const { params } = this;
|
|
1291
3906
|
return {
|
|
1292
|
-
type: "exchange/
|
|
3907
|
+
type: "exchange/MsgCreateDerivativeMarketOrder",
|
|
1293
3908
|
value: {
|
|
1294
3909
|
sender: params.injectiveAddress,
|
|
1295
3910
|
order: {
|
|
@@ -1302,7 +3917,9 @@ var MsgCreateSpotMarketOrder = class MsgCreateSpotMarketOrder extends require_Ms
|
|
|
1302
3917
|
cid: params.cid || ""
|
|
1303
3918
|
},
|
|
1304
3919
|
order_type: params.orderType,
|
|
1305
|
-
|
|
3920
|
+
margin: params.margin,
|
|
3921
|
+
trigger_price: params.triggerPrice || "0",
|
|
3922
|
+
expiration_block: params.expirationBlock || "0"
|
|
1306
3923
|
}
|
|
1307
3924
|
}
|
|
1308
3925
|
};
|
|
@@ -1310,7 +3927,7 @@ var MsgCreateSpotMarketOrder = class MsgCreateSpotMarketOrder extends require_Ms
|
|
|
1310
3927
|
toWeb3Gw() {
|
|
1311
3928
|
const { value } = this.toAmino();
|
|
1312
3929
|
return {
|
|
1313
|
-
"@type": "/injective.exchange.
|
|
3930
|
+
"@type": "/injective.exchange.v2.MsgCreateDerivativeMarketOrder",
|
|
1314
3931
|
...value
|
|
1315
3932
|
};
|
|
1316
3933
|
}
|
|
@@ -1327,26 +3944,28 @@ var MsgCreateSpotMarketOrder = class MsgCreateSpotMarketOrder extends require_Ms
|
|
|
1327
3944
|
price: require_utils.numberToCosmosSdkDecString(params.price),
|
|
1328
3945
|
quantity: require_utils.numberToCosmosSdkDecString(params.quantity)
|
|
1329
3946
|
},
|
|
3947
|
+
margin: require_utils.numberToCosmosSdkDecString(params.margin),
|
|
1330
3948
|
trigger_price: require_utils.numberToCosmosSdkDecString(params.triggerPrice || "0"),
|
|
1331
|
-
order_type:
|
|
3949
|
+
order_type: __injectivelabs_core_proto_ts_v2_generated_injective_exchange_v2_order_pb.OrderType[params.orderType]
|
|
1332
3950
|
}
|
|
1333
3951
|
};
|
|
1334
3952
|
}
|
|
1335
3953
|
toEip712() {
|
|
1336
|
-
var _value$order;
|
|
1337
3954
|
const { params } = this;
|
|
1338
3955
|
const { value, type } = this.toAmino();
|
|
3956
|
+
const { expiration_block: _eb, ...orderWithoutExpiration } = value.order || {};
|
|
1339
3957
|
return {
|
|
1340
3958
|
type,
|
|
1341
3959
|
value: {
|
|
1342
3960
|
...value,
|
|
1343
3961
|
order: {
|
|
1344
|
-
...
|
|
3962
|
+
...orderWithoutExpiration,
|
|
1345
3963
|
order_info: {
|
|
1346
|
-
...
|
|
3964
|
+
...orderWithoutExpiration === null || orderWithoutExpiration === void 0 ? void 0 : orderWithoutExpiration.order_info,
|
|
1347
3965
|
price: (0, __injectivelabs_utils.toChainFormat)(params.price).toFixed(),
|
|
1348
3966
|
quantity: (0, __injectivelabs_utils.toChainFormat)(params.quantity).toFixed()
|
|
1349
3967
|
},
|
|
3968
|
+
margin: (0, __injectivelabs_utils.toChainFormat)(params.margin).toFixed(),
|
|
1350
3969
|
trigger_price: (0, __injectivelabs_utils.toChainFormat)(params.triggerPrice || "0").toFixed()
|
|
1351
3970
|
}
|
|
1352
3971
|
}
|
|
@@ -1354,77 +3973,66 @@ var MsgCreateSpotMarketOrder = class MsgCreateSpotMarketOrder extends require_Ms
|
|
|
1354
3973
|
}
|
|
1355
3974
|
toDirectSign() {
|
|
1356
3975
|
return {
|
|
1357
|
-
type: "/injective.exchange.
|
|
3976
|
+
type: "/injective.exchange.v2.MsgCreateDerivativeMarketOrder",
|
|
1358
3977
|
message: this.toProto()
|
|
1359
3978
|
};
|
|
1360
3979
|
}
|
|
1361
3980
|
toBinary() {
|
|
1362
|
-
return
|
|
3981
|
+
return __injectivelabs_core_proto_ts_v2_generated_injective_exchange_v2_tx_pb.MsgCreateDerivativeMarketOrder.toBinary(this.toProto());
|
|
1363
3982
|
}
|
|
1364
3983
|
};
|
|
1365
3984
|
|
|
1366
3985
|
//#endregion
|
|
1367
|
-
//#region src/core/modules/exchange/msgs/
|
|
3986
|
+
//#region src/core/modules/exchange/msgs/MsgAdminUpdateBinaryOptionsMarket.ts
|
|
1368
3987
|
const createMessage$3 = (params) => {
|
|
1369
|
-
return __injectivelabs_core_proto_ts_v2_generated_injective_exchange_v1beta1_tx_pb.
|
|
1370
|
-
sender: params.
|
|
1371
|
-
|
|
1372
|
-
|
|
1373
|
-
|
|
1374
|
-
|
|
1375
|
-
|
|
1376
|
-
minNotional: params.market.minNotional,
|
|
1377
|
-
baseDecimals: Number(params.market.baseDecimals),
|
|
1378
|
-
quoteDecimals: Number(params.market.quoteDecimals)
|
|
3988
|
+
return __injectivelabs_core_proto_ts_v2_generated_injective_exchange_v1beta1_tx_pb.MsgAdminUpdateBinaryOptionsMarket.create({
|
|
3989
|
+
sender: params.sender,
|
|
3990
|
+
marketId: params.marketId,
|
|
3991
|
+
settlementPrice: params.settlementPrice,
|
|
3992
|
+
expirationTimestamp: BigInt(params.expirationTimestamp),
|
|
3993
|
+
settlementTimestamp: BigInt(params.settlementTimestamp),
|
|
3994
|
+
status: params.status
|
|
1379
3995
|
});
|
|
1380
3996
|
};
|
|
1381
3997
|
/**
|
|
1382
3998
|
* @category Messages
|
|
1383
3999
|
*/
|
|
1384
|
-
var
|
|
4000
|
+
var MsgAdminUpdateBinaryOptionsMarket = class MsgAdminUpdateBinaryOptionsMarket extends require_MsgBase.MsgBase {
|
|
1385
4001
|
static fromJSON(params) {
|
|
1386
|
-
return new
|
|
4002
|
+
return new MsgAdminUpdateBinaryOptionsMarket(params);
|
|
1387
4003
|
}
|
|
1388
4004
|
toProto() {
|
|
1389
4005
|
const { params: initialParams } = this;
|
|
1390
4006
|
return createMessage$3({
|
|
1391
4007
|
...initialParams,
|
|
1392
|
-
|
|
1393
|
-
...initialParams.market,
|
|
1394
|
-
minPriceTickSize: (0, __injectivelabs_utils.toChainFormat)(initialParams.market.minPriceTickSize).toFixed(),
|
|
1395
|
-
minQuantityTickSize: (0, __injectivelabs_utils.toChainFormat)(initialParams.market.minQuantityTickSize).toFixed(),
|
|
1396
|
-
minNotional: (0, __injectivelabs_utils.toChainFormat)(initialParams.market.minNotional).toFixed()
|
|
1397
|
-
}
|
|
4008
|
+
settlementPrice: (0, __injectivelabs_utils.toChainFormat)(initialParams.settlementPrice).toFixed()
|
|
1398
4009
|
});
|
|
1399
4010
|
}
|
|
1400
4011
|
toData() {
|
|
1401
4012
|
const proto = this.toProto();
|
|
1402
4013
|
return {
|
|
1403
|
-
"@type": "/injective.exchange.v1beta1.
|
|
4014
|
+
"@type": "/injective.exchange.v1beta1.MsgAdminUpdateBinaryOptionsMarket",
|
|
1404
4015
|
...proto
|
|
1405
4016
|
};
|
|
1406
4017
|
}
|
|
1407
4018
|
toAmino() {
|
|
1408
4019
|
const { params } = this;
|
|
1409
4020
|
return {
|
|
1410
|
-
type: "exchange/
|
|
4021
|
+
type: "exchange/MsgAdminUpdateBinaryOptionsMarket",
|
|
1411
4022
|
value: {
|
|
1412
|
-
sender: params.
|
|
1413
|
-
|
|
1414
|
-
|
|
1415
|
-
|
|
1416
|
-
|
|
1417
|
-
|
|
1418
|
-
min_notional: params.market.minNotional,
|
|
1419
|
-
base_decimals: params.market.baseDecimals,
|
|
1420
|
-
quote_decimals: params.market.quoteDecimals
|
|
4023
|
+
sender: params.sender,
|
|
4024
|
+
market_id: params.marketId,
|
|
4025
|
+
settlement_price: params.settlementPrice,
|
|
4026
|
+
expiration_timestamp: params.expirationTimestamp,
|
|
4027
|
+
settlement_timestamp: params.settlementTimestamp,
|
|
4028
|
+
status: params.status
|
|
1421
4029
|
}
|
|
1422
4030
|
};
|
|
1423
4031
|
}
|
|
1424
4032
|
toWeb3Gw() {
|
|
1425
4033
|
const { value } = this.toAmino();
|
|
1426
4034
|
return {
|
|
1427
|
-
"@type": "/injective.exchange.v1beta1.
|
|
4035
|
+
"@type": "/injective.exchange.v1beta1.MsgAdminUpdateBinaryOptionsMarket",
|
|
1428
4036
|
...value
|
|
1429
4037
|
};
|
|
1430
4038
|
}
|
|
@@ -1434,9 +4042,7 @@ var MsgInstantSpotMarketLaunch = class MsgInstantSpotMarketLaunch extends requir
|
|
|
1434
4042
|
type,
|
|
1435
4043
|
value: {
|
|
1436
4044
|
...value,
|
|
1437
|
-
|
|
1438
|
-
min_quantity_tick_size: (0, __injectivelabs_utils.toChainFormat)(value.min_quantity_tick_size).toFixed(),
|
|
1439
|
-
min_notional: (0, __injectivelabs_utils.toChainFormat)(value.min_notional).toFixed()
|
|
4045
|
+
settlement_price: (0, __injectivelabs_utils.toChainFormat)(value.settlement_price).toFixed()
|
|
1440
4046
|
}
|
|
1441
4047
|
};
|
|
1442
4048
|
}
|
|
@@ -1444,183 +4050,90 @@ var MsgInstantSpotMarketLaunch = class MsgInstantSpotMarketLaunch extends requir
|
|
|
1444
4050
|
const { params } = this;
|
|
1445
4051
|
return {
|
|
1446
4052
|
...this.toWeb3Gw(),
|
|
1447
|
-
|
|
1448
|
-
|
|
1449
|
-
min_notional: require_utils.numberToCosmosSdkDecString(params.market.minNotional)
|
|
1450
|
-
};
|
|
1451
|
-
}
|
|
1452
|
-
toDirectSign() {
|
|
1453
|
-
return {
|
|
1454
|
-
type: "/injective.exchange.v1beta1.MsgInstantSpotMarketLaunch",
|
|
1455
|
-
message: this.toProto()
|
|
1456
|
-
};
|
|
1457
|
-
}
|
|
1458
|
-
toBinary() {
|
|
1459
|
-
return __injectivelabs_core_proto_ts_v2_generated_injective_exchange_v1beta1_tx_pb.MsgInstantSpotMarketLaunch.toBinary(this.toProto());
|
|
1460
|
-
}
|
|
1461
|
-
};
|
|
1462
|
-
|
|
1463
|
-
//#endregion
|
|
1464
|
-
//#region src/core/modules/exchange/msgs/MsgUpdateDerivativeMarketV2.ts
|
|
1465
|
-
const createMessage$2 = (params) => {
|
|
1466
|
-
return __injectivelabs_core_proto_ts_v2_generated_injective_exchange_v2_tx_pb.MsgUpdateDerivativeMarket.create({
|
|
1467
|
-
admin: params.admin,
|
|
1468
|
-
marketId: params.marketId,
|
|
1469
|
-
newTicker: params.newTicker || "",
|
|
1470
|
-
newMinNotional: params.newMinNotional || "0",
|
|
1471
|
-
newMinPriceTickSize: params.newMinPriceTickSize || "0",
|
|
1472
|
-
newMinQuantityTickSize: params.newMinQuantityTickSize || "0",
|
|
1473
|
-
newInitialMarginRatio: params.newInitialMarginRatio || "0",
|
|
1474
|
-
newMaintenanceMarginRatio: params.newMaintenanceMarginRatio || "0",
|
|
1475
|
-
newReduceMarginRatio: params.newReduceMarginRatio || "0"
|
|
1476
|
-
});
|
|
1477
|
-
};
|
|
1478
|
-
/**
|
|
1479
|
-
* @category Messages
|
|
1480
|
-
*/
|
|
1481
|
-
var MsgUpdateDerivativeMarketV2 = class MsgUpdateDerivativeMarketV2 extends require_MsgBase.MsgBase {
|
|
1482
|
-
static fromJSON(params) {
|
|
1483
|
-
return new MsgUpdateDerivativeMarketV2(params);
|
|
1484
|
-
}
|
|
1485
|
-
toProto() {
|
|
1486
|
-
const { params: initialParams } = this;
|
|
1487
|
-
return createMessage$2({
|
|
1488
|
-
...initialParams,
|
|
1489
|
-
newMinNotional: (0, __injectivelabs_utils.toChainFormat)(initialParams.newMinNotional || "0").toFixed(),
|
|
1490
|
-
newMinQuantityTickSize: (0, __injectivelabs_utils.toChainFormat)(initialParams.newMinQuantityTickSize || "0").toFixed(),
|
|
1491
|
-
newMinPriceTickSize: (0, __injectivelabs_utils.toChainFormat)(initialParams.newMinPriceTickSize || "0").toFixed(),
|
|
1492
|
-
newInitialMarginRatio: (0, __injectivelabs_utils.toChainFormat)(initialParams.newInitialMarginRatio || "0").toFixed(),
|
|
1493
|
-
newMaintenanceMarginRatio: (0, __injectivelabs_utils.toChainFormat)(initialParams.newMaintenanceMarginRatio || "0").toFixed(),
|
|
1494
|
-
newReduceMarginRatio: (0, __injectivelabs_utils.toChainFormat)(initialParams.newReduceMarginRatio || "0").toFixed()
|
|
1495
|
-
});
|
|
1496
|
-
}
|
|
1497
|
-
toData() {
|
|
1498
|
-
const proto = this.toProto();
|
|
1499
|
-
return {
|
|
1500
|
-
"@type": "/injective.exchange.v2.MsgUpdateDerivativeMarket",
|
|
1501
|
-
...proto
|
|
1502
|
-
};
|
|
1503
|
-
}
|
|
1504
|
-
toAmino() {
|
|
1505
|
-
const { params } = this;
|
|
1506
|
-
return {
|
|
1507
|
-
type: "exchange/MsgUpdateDerivativeMarket",
|
|
1508
|
-
value: {
|
|
1509
|
-
admin: params.admin,
|
|
1510
|
-
market_id: params.marketId,
|
|
1511
|
-
new_ticker: params.newTicker || "",
|
|
1512
|
-
new_min_notional: params.newMinNotional,
|
|
1513
|
-
new_min_price_tick_size: params.newMinPriceTickSize,
|
|
1514
|
-
new_min_quantity_tick_size: params.newMinQuantityTickSize,
|
|
1515
|
-
new_initial_margin_ratio: params.newInitialMarginRatio,
|
|
1516
|
-
new_maintenance_margin_ratio: params.newMaintenanceMarginRatio,
|
|
1517
|
-
new_reduce_margin_ratio: params.newReduceMarginRatio
|
|
1518
|
-
}
|
|
1519
|
-
};
|
|
1520
|
-
}
|
|
1521
|
-
toWeb3Gw() {
|
|
1522
|
-
const { value } = this.toAmino();
|
|
1523
|
-
return {
|
|
1524
|
-
"@type": "/injective.exchange.v2.MsgUpdateDerivativeMarket",
|
|
1525
|
-
...value
|
|
1526
|
-
};
|
|
1527
|
-
}
|
|
1528
|
-
toEip712() {
|
|
1529
|
-
const { type, value } = this.toAmino();
|
|
1530
|
-
return {
|
|
1531
|
-
type,
|
|
1532
|
-
value: { ...value }
|
|
1533
|
-
};
|
|
1534
|
-
}
|
|
1535
|
-
toEip712V2() {
|
|
1536
|
-
const { params } = this;
|
|
1537
|
-
return {
|
|
1538
|
-
"@type": "/injective.exchange.v2.MsgUpdateDerivativeMarket",
|
|
1539
|
-
admin: params.admin,
|
|
1540
|
-
market_id: params.marketId,
|
|
1541
|
-
new_ticker: params.newTicker || "",
|
|
1542
|
-
new_min_price_tick_size: require_utils.numberToCosmosSdkDecString(params.newMinPriceTickSize || "0"),
|
|
1543
|
-
new_min_quantity_tick_size: require_utils.numberToCosmosSdkDecString(params.newMinQuantityTickSize || "0"),
|
|
1544
|
-
new_min_notional: require_utils.numberToCosmosSdkDecString(params.newMinNotional || "0"),
|
|
1545
|
-
new_initial_margin_ratio: require_utils.numberToCosmosSdkDecString(params.newInitialMarginRatio || "0"),
|
|
1546
|
-
new_maintenance_margin_ratio: require_utils.numberToCosmosSdkDecString(params.newMaintenanceMarginRatio || "0"),
|
|
1547
|
-
new_reduce_margin_ratio: require_utils.numberToCosmosSdkDecString(params.newReduceMarginRatio || "0"),
|
|
1548
|
-
new_open_notional_cap: {}
|
|
4053
|
+
settlement_price: require_utils.numberToCosmosSdkDecString(params.settlementPrice),
|
|
4054
|
+
status: __injectivelabs_core_proto_ts_v2_generated_injective_exchange_v1beta1_exchange_pb.MarketStatus[params.status]
|
|
1549
4055
|
};
|
|
1550
4056
|
}
|
|
1551
4057
|
toDirectSign() {
|
|
1552
4058
|
return {
|
|
1553
|
-
type: "/injective.exchange.
|
|
4059
|
+
type: "/injective.exchange.v1beta1.MsgAdminUpdateBinaryOptionsMarket",
|
|
1554
4060
|
message: this.toProto()
|
|
1555
4061
|
};
|
|
1556
4062
|
}
|
|
1557
4063
|
toBinary() {
|
|
1558
|
-
return
|
|
4064
|
+
return __injectivelabs_core_proto_ts_v2_generated_injective_exchange_v1beta1_tx_pb.MsgAdminUpdateBinaryOptionsMarket.toBinary(this.toProto());
|
|
1559
4065
|
}
|
|
1560
4066
|
};
|
|
1561
4067
|
|
|
1562
4068
|
//#endregion
|
|
1563
|
-
//#region src/core/modules/exchange/msgs/
|
|
4069
|
+
//#region src/core/modules/exchange/msgs/MsgBatchCancelBinaryOptionsOrders.ts
|
|
1564
4070
|
/**
|
|
1565
4071
|
* @category Messages
|
|
1566
4072
|
*/
|
|
1567
|
-
var
|
|
4073
|
+
var MsgBatchCancelBinaryOptionsOrders = class MsgBatchCancelBinaryOptionsOrders extends require_MsgBase.MsgBase {
|
|
1568
4074
|
static fromJSON(params) {
|
|
1569
|
-
return new
|
|
4075
|
+
return new MsgBatchCancelBinaryOptionsOrders(params);
|
|
1570
4076
|
}
|
|
1571
4077
|
toProto() {
|
|
1572
4078
|
const { params } = this;
|
|
1573
|
-
|
|
4079
|
+
const orderDataList = params.orders.map((order) => {
|
|
4080
|
+
return __injectivelabs_core_proto_ts_v2_generated_injective_exchange_v1beta1_tx_pb.OrderData.create({
|
|
4081
|
+
marketId: order.marketId,
|
|
4082
|
+
subaccountId: order.subaccountId,
|
|
4083
|
+
orderHash: order.orderHash || "",
|
|
4084
|
+
orderMask: __injectivelabs_core_proto_ts_v2_generated_injective_exchange_v1beta1_exchange_pb.OrderMask.ANY,
|
|
4085
|
+
cid: order.cid || ""
|
|
4086
|
+
});
|
|
4087
|
+
});
|
|
4088
|
+
return __injectivelabs_core_proto_ts_v2_generated_injective_exchange_v1beta1_tx_pb.MsgBatchCancelBinaryOptionsOrders.create({
|
|
1574
4089
|
sender: params.injectiveAddress,
|
|
1575
|
-
|
|
1576
|
-
subaccountId: params.subaccountId,
|
|
1577
|
-
orderHash: params.orderHash || "",
|
|
1578
|
-
orderMask: __injectivelabs_core_proto_ts_v2_generated_injective_exchange_v1beta1_exchange_pb.OrderMask.ANY,
|
|
1579
|
-
cid: params.cid || ""
|
|
4090
|
+
data: orderDataList
|
|
1580
4091
|
});
|
|
1581
4092
|
}
|
|
1582
4093
|
toData() {
|
|
1583
4094
|
const proto = this.toProto();
|
|
1584
4095
|
return {
|
|
1585
|
-
"@type": "/injective.exchange.v1beta1.
|
|
4096
|
+
"@type": "/injective.exchange.v1beta1.MsgBatchCancelBinaryOptionsOrders",
|
|
1586
4097
|
...proto
|
|
1587
4098
|
};
|
|
1588
4099
|
}
|
|
1589
4100
|
toAmino() {
|
|
1590
|
-
const
|
|
4101
|
+
const { params } = this;
|
|
1591
4102
|
return {
|
|
1592
|
-
type: "exchange/
|
|
4103
|
+
type: "exchange/MsgBatchCancelBinaryOptionsOrders",
|
|
1593
4104
|
value: {
|
|
1594
|
-
sender:
|
|
1595
|
-
|
|
1596
|
-
|
|
1597
|
-
|
|
1598
|
-
|
|
1599
|
-
|
|
4105
|
+
sender: params.injectiveAddress,
|
|
4106
|
+
data: params.orders.map((order) => ({
|
|
4107
|
+
market_id: order.marketId,
|
|
4108
|
+
subaccount_id: order.subaccountId,
|
|
4109
|
+
order_hash: order.orderHash,
|
|
4110
|
+
order_mask: order.orderMask,
|
|
4111
|
+
cid: order.cid
|
|
4112
|
+
}))
|
|
1600
4113
|
}
|
|
1601
4114
|
};
|
|
1602
4115
|
}
|
|
1603
4116
|
toWeb3Gw() {
|
|
1604
4117
|
const { value } = this.toAmino();
|
|
1605
4118
|
return {
|
|
1606
|
-
"@type": "/injective.exchange.v1beta1.
|
|
4119
|
+
"@type": "/injective.exchange.v1beta1.MsgBatchCancelBinaryOptionsOrders",
|
|
1607
4120
|
...value
|
|
1608
4121
|
};
|
|
1609
4122
|
}
|
|
1610
4123
|
toDirectSign() {
|
|
1611
4124
|
return {
|
|
1612
|
-
type: "/injective.exchange.v1beta1.
|
|
4125
|
+
type: "/injective.exchange.v1beta1.MsgBatchCancelBinaryOptionsOrders",
|
|
1613
4126
|
message: this.toProto()
|
|
1614
4127
|
};
|
|
1615
4128
|
}
|
|
1616
4129
|
toBinary() {
|
|
1617
|
-
return __injectivelabs_core_proto_ts_v2_generated_injective_exchange_v1beta1_tx_pb.
|
|
4130
|
+
return __injectivelabs_core_proto_ts_v2_generated_injective_exchange_v1beta1_tx_pb.MsgBatchCancelBinaryOptionsOrders.toBinary(this.toProto());
|
|
1618
4131
|
}
|
|
1619
4132
|
};
|
|
1620
4133
|
|
|
1621
4134
|
//#endregion
|
|
1622
|
-
//#region src/core/modules/exchange/msgs/
|
|
1623
|
-
const
|
|
4135
|
+
//#region src/core/modules/exchange/msgs/MsgCreateBinaryOptionsMarketOrder.ts
|
|
4136
|
+
const createMarketOrder$1 = (params) => {
|
|
1624
4137
|
const orderInfo = __injectivelabs_core_proto_ts_v2_generated_injective_exchange_v1beta1_exchange_pb.OrderInfo.create({
|
|
1625
4138
|
subaccountId: params.subaccountId,
|
|
1626
4139
|
feeRecipient: params.feeRecipient,
|
|
@@ -1635,7 +4148,7 @@ const createLimitOrder$1 = (params) => {
|
|
|
1635
4148
|
margin: params.margin,
|
|
1636
4149
|
triggerPrice: params.triggerPrice || "0"
|
|
1637
4150
|
});
|
|
1638
|
-
return __injectivelabs_core_proto_ts_v2_generated_injective_exchange_v1beta1_tx_pb.
|
|
4151
|
+
return __injectivelabs_core_proto_ts_v2_generated_injective_exchange_v1beta1_tx_pb.MsgCreateBinaryOptionsMarketOrder.create({
|
|
1639
4152
|
sender: params.injectiveAddress,
|
|
1640
4153
|
order: derivativeOrder
|
|
1641
4154
|
});
|
|
@@ -1643,13 +4156,13 @@ const createLimitOrder$1 = (params) => {
|
|
|
1643
4156
|
/**
|
|
1644
4157
|
* @category Messages
|
|
1645
4158
|
*/
|
|
1646
|
-
var
|
|
4159
|
+
var MsgCreateBinaryOptionsMarketOrder = class MsgCreateBinaryOptionsMarketOrder extends require_MsgBase.MsgBase {
|
|
1647
4160
|
static fromJSON(params) {
|
|
1648
|
-
return new
|
|
4161
|
+
return new MsgCreateBinaryOptionsMarketOrder(params);
|
|
1649
4162
|
}
|
|
1650
4163
|
toProto() {
|
|
1651
4164
|
const { params: initialParams } = this;
|
|
1652
|
-
return
|
|
4165
|
+
return createMarketOrder$1({
|
|
1653
4166
|
...initialParams,
|
|
1654
4167
|
price: (0, __injectivelabs_utils.toChainFormat)(initialParams.price).toFixed(),
|
|
1655
4168
|
margin: (0, __injectivelabs_utils.toChainFormat)(initialParams.margin).toFixed(),
|
|
@@ -1660,14 +4173,14 @@ var MsgCreateDerivativeLimitOrder = class MsgCreateDerivativeLimitOrder extends
|
|
|
1660
4173
|
toData() {
|
|
1661
4174
|
const proto = this.toProto();
|
|
1662
4175
|
return {
|
|
1663
|
-
"@type": "/injective.exchange.v1beta1.
|
|
4176
|
+
"@type": "/injective.exchange.v1beta1.MsgCreateBinaryOptionsMarketOrder",
|
|
1664
4177
|
...proto
|
|
1665
4178
|
};
|
|
1666
4179
|
}
|
|
1667
4180
|
toAmino() {
|
|
1668
4181
|
const { params } = this;
|
|
1669
4182
|
return {
|
|
1670
|
-
type: "exchange/
|
|
4183
|
+
type: "exchange/MsgCreateBinaryOptionsMarketOrder",
|
|
1671
4184
|
value: {
|
|
1672
4185
|
sender: params.injectiveAddress,
|
|
1673
4186
|
order: {
|
|
@@ -1689,7 +4202,7 @@ var MsgCreateDerivativeLimitOrder = class MsgCreateDerivativeLimitOrder extends
|
|
|
1689
4202
|
toWeb3Gw() {
|
|
1690
4203
|
const { value } = this.toAmino();
|
|
1691
4204
|
return {
|
|
1692
|
-
"@type": "/injective.exchange.v1beta1.
|
|
4205
|
+
"@type": "/injective.exchange.v1beta1.MsgCreateBinaryOptionsMarketOrder",
|
|
1693
4206
|
...value
|
|
1694
4207
|
};
|
|
1695
4208
|
}
|
|
@@ -1735,99 +4248,86 @@ var MsgCreateDerivativeLimitOrder = class MsgCreateDerivativeLimitOrder extends
|
|
|
1735
4248
|
}
|
|
1736
4249
|
toDirectSign() {
|
|
1737
4250
|
return {
|
|
1738
|
-
type: "/injective.exchange.v1beta1.
|
|
4251
|
+
type: "/injective.exchange.v1beta1.MsgCreateBinaryOptionsMarketOrder",
|
|
1739
4252
|
message: this.toProto()
|
|
1740
4253
|
};
|
|
1741
4254
|
}
|
|
1742
4255
|
toBinary() {
|
|
1743
|
-
return __injectivelabs_core_proto_ts_v2_generated_injective_exchange_v1beta1_tx_pb.
|
|
4256
|
+
return __injectivelabs_core_proto_ts_v2_generated_injective_exchange_v1beta1_tx_pb.MsgCreateBinaryOptionsMarketOrder.toBinary(this.toProto());
|
|
1744
4257
|
}
|
|
1745
4258
|
};
|
|
1746
4259
|
|
|
1747
4260
|
//#endregion
|
|
1748
|
-
//#region src/core/modules/exchange/msgs/
|
|
4261
|
+
//#region src/core/modules/exchange/msgs/MsgSetDelegationTransferReceivers.ts
|
|
1749
4262
|
/**
|
|
4263
|
+
* @deprecated no longer supported on chain
|
|
1750
4264
|
* @category Messages
|
|
1751
4265
|
*/
|
|
1752
|
-
var
|
|
4266
|
+
var MsgSetDelegationTransferReceivers = class MsgSetDelegationTransferReceivers extends require_MsgBase.MsgBase {
|
|
1753
4267
|
static fromJSON(params) {
|
|
1754
|
-
return new
|
|
4268
|
+
return new MsgSetDelegationTransferReceivers(params);
|
|
1755
4269
|
}
|
|
1756
4270
|
toProto() {
|
|
1757
4271
|
const { params } = this;
|
|
1758
|
-
|
|
1759
|
-
|
|
1760
|
-
|
|
1761
|
-
|
|
1762
|
-
orderHash: order.orderHash || "",
|
|
1763
|
-
orderMask: order.orderMask || __injectivelabs_core_proto_ts_v2_generated_injective_exchange_v1beta1_exchange_pb.OrderMask.ANY,
|
|
1764
|
-
cid: order.cid || ""
|
|
1765
|
-
});
|
|
1766
|
-
});
|
|
1767
|
-
return __injectivelabs_core_proto_ts_v2_generated_injective_exchange_v1beta1_tx_pb.MsgBatchCancelDerivativeOrders.create({
|
|
1768
|
-
sender: params.injectiveAddress,
|
|
1769
|
-
data: orderDataList
|
|
1770
|
-
});
|
|
4272
|
+
return {
|
|
4273
|
+
sender: params.sender,
|
|
4274
|
+
receivers: params.receivers
|
|
4275
|
+
};
|
|
1771
4276
|
}
|
|
1772
4277
|
toData() {
|
|
1773
4278
|
const proto = this.toProto();
|
|
1774
4279
|
return {
|
|
1775
|
-
"@type": "/injective.exchange.
|
|
4280
|
+
"@type": "/injective.exchange.v2.MsgSetDelegationTransferReceivers",
|
|
1776
4281
|
...proto
|
|
1777
4282
|
};
|
|
1778
4283
|
}
|
|
1779
4284
|
toAmino() {
|
|
1780
4285
|
const proto = this.toProto();
|
|
1781
4286
|
return {
|
|
1782
|
-
type: "exchange/
|
|
4287
|
+
type: "exchange/MsgSetDelegationTransferReceivers",
|
|
1783
4288
|
value: {
|
|
1784
4289
|
sender: proto.sender,
|
|
1785
|
-
|
|
1786
|
-
market_id: orderData.marketId,
|
|
1787
|
-
subaccount_id: orderData.subaccountId,
|
|
1788
|
-
order_hash: orderData.orderHash,
|
|
1789
|
-
order_mask: orderData.orderMask,
|
|
1790
|
-
cid: orderData.cid
|
|
1791
|
-
}))
|
|
4290
|
+
receivers: proto.receivers
|
|
1792
4291
|
}
|
|
1793
4292
|
};
|
|
1794
4293
|
}
|
|
1795
4294
|
toWeb3Gw() {
|
|
1796
4295
|
const { value } = this.toAmino();
|
|
1797
4296
|
return {
|
|
1798
|
-
"@type": "/injective.exchange.
|
|
4297
|
+
"@type": "/injective.exchange.v2.MsgSetDelegationTransferReceivers",
|
|
1799
4298
|
...value
|
|
1800
4299
|
};
|
|
1801
4300
|
}
|
|
1802
4301
|
toDirectSign() {
|
|
1803
4302
|
return {
|
|
1804
|
-
type: "/injective.exchange.
|
|
4303
|
+
type: "/injective.exchange.v2.MsgSetDelegationTransferReceivers",
|
|
1805
4304
|
message: this.toProto()
|
|
1806
4305
|
};
|
|
1807
4306
|
}
|
|
1808
4307
|
toBinary() {
|
|
1809
|
-
return
|
|
4308
|
+
return new Uint8Array(0);
|
|
1810
4309
|
}
|
|
1811
4310
|
};
|
|
1812
4311
|
|
|
1813
4312
|
//#endregion
|
|
1814
|
-
//#region src/core/modules/exchange/msgs/
|
|
1815
|
-
const
|
|
1816
|
-
const orderInfo =
|
|
4313
|
+
//#region src/core/modules/exchange/msgs/MsgCreateBinaryOptionsLimitOrderV2.ts
|
|
4314
|
+
const createLimitOrder = (params) => {
|
|
4315
|
+
const orderInfo = __injectivelabs_core_proto_ts_v2_generated_injective_exchange_v2_order_pb.OrderInfo.create({
|
|
1817
4316
|
subaccountId: params.subaccountId,
|
|
1818
4317
|
feeRecipient: params.feeRecipient,
|
|
1819
4318
|
price: params.price,
|
|
1820
4319
|
quantity: params.quantity,
|
|
1821
4320
|
cid: params.cid || ""
|
|
1822
4321
|
});
|
|
1823
|
-
const derivativeOrder =
|
|
4322
|
+
const derivativeOrder = __injectivelabs_core_proto_ts_v2_generated_injective_exchange_v2_order_pb.DerivativeOrder.create({
|
|
1824
4323
|
marketId: params.marketId,
|
|
1825
4324
|
orderInfo,
|
|
1826
4325
|
orderType: params.orderType,
|
|
1827
4326
|
margin: params.margin,
|
|
1828
|
-
triggerPrice: params.triggerPrice || "0"
|
|
4327
|
+
triggerPrice: params.triggerPrice || "0",
|
|
4328
|
+
expirationBlock: params.expirationBlock ? BigInt(params.expirationBlock) : BigInt(0)
|
|
1829
4329
|
});
|
|
1830
|
-
return
|
|
4330
|
+
return __injectivelabs_core_proto_ts_v2_generated_injective_exchange_v2_tx_pb.MsgCreateBinaryOptionsLimitOrder.create({
|
|
1831
4331
|
sender: params.injectiveAddress,
|
|
1832
4332
|
order: derivativeOrder
|
|
1833
4333
|
});
|
|
@@ -1835,13 +4335,13 @@ const createMarketOrder$1 = (params) => {
|
|
|
1835
4335
|
/**
|
|
1836
4336
|
* @category Messages
|
|
1837
4337
|
*/
|
|
1838
|
-
var
|
|
4338
|
+
var MsgCreateBinaryOptionsLimitOrderV2 = class MsgCreateBinaryOptionsLimitOrderV2 extends require_MsgBase.MsgBase {
|
|
1839
4339
|
static fromJSON(params) {
|
|
1840
|
-
return new
|
|
4340
|
+
return new MsgCreateBinaryOptionsLimitOrderV2(params);
|
|
1841
4341
|
}
|
|
1842
4342
|
toProto() {
|
|
1843
4343
|
const { params: initialParams } = this;
|
|
1844
|
-
return
|
|
4344
|
+
return createLimitOrder({
|
|
1845
4345
|
...initialParams,
|
|
1846
4346
|
price: (0, __injectivelabs_utils.toChainFormat)(initialParams.price).toFixed(),
|
|
1847
4347
|
margin: (0, __injectivelabs_utils.toChainFormat)(initialParams.margin).toFixed(),
|
|
@@ -1852,14 +4352,14 @@ var MsgCreateDerivativeMarketOrder = class MsgCreateDerivativeMarketOrder extend
|
|
|
1852
4352
|
toData() {
|
|
1853
4353
|
const proto = this.toProto();
|
|
1854
4354
|
return {
|
|
1855
|
-
"@type": "/injective.exchange.
|
|
4355
|
+
"@type": "/injective.exchange.v2.MsgCreateBinaryOptionsLimitOrder",
|
|
1856
4356
|
...proto
|
|
1857
4357
|
};
|
|
1858
4358
|
}
|
|
1859
4359
|
toAmino() {
|
|
1860
4360
|
const { params } = this;
|
|
1861
4361
|
return {
|
|
1862
|
-
type: "exchange/
|
|
4362
|
+
type: "exchange/MsgCreateBinaryOptionsLimitOrder",
|
|
1863
4363
|
value: {
|
|
1864
4364
|
sender: params.injectiveAddress,
|
|
1865
4365
|
order: {
|
|
@@ -1873,7 +4373,8 @@ var MsgCreateDerivativeMarketOrder = class MsgCreateDerivativeMarketOrder extend
|
|
|
1873
4373
|
},
|
|
1874
4374
|
order_type: params.orderType,
|
|
1875
4375
|
margin: params.margin,
|
|
1876
|
-
trigger_price: params.triggerPrice || "0"
|
|
4376
|
+
trigger_price: params.triggerPrice || "0",
|
|
4377
|
+
expiration_block: params.expirationBlock || "0"
|
|
1877
4378
|
}
|
|
1878
4379
|
}
|
|
1879
4380
|
};
|
|
@@ -1881,7 +4382,7 @@ var MsgCreateDerivativeMarketOrder = class MsgCreateDerivativeMarketOrder extend
|
|
|
1881
4382
|
toWeb3Gw() {
|
|
1882
4383
|
const { value } = this.toAmino();
|
|
1883
4384
|
return {
|
|
1884
|
-
"@type": "/injective.exchange.
|
|
4385
|
+
"@type": "/injective.exchange.v2.MsgCreateBinaryOptionsLimitOrder",
|
|
1885
4386
|
...value
|
|
1886
4387
|
};
|
|
1887
4388
|
}
|
|
@@ -1900,22 +4401,22 @@ var MsgCreateDerivativeMarketOrder = class MsgCreateDerivativeMarketOrder extend
|
|
|
1900
4401
|
},
|
|
1901
4402
|
margin: require_utils.numberToCosmosSdkDecString(params.margin),
|
|
1902
4403
|
trigger_price: require_utils.numberToCosmosSdkDecString(params.triggerPrice || "0"),
|
|
1903
|
-
order_type:
|
|
4404
|
+
order_type: __injectivelabs_core_proto_ts_v2_generated_injective_exchange_v2_order_pb.OrderType[params.orderType]
|
|
1904
4405
|
}
|
|
1905
4406
|
};
|
|
1906
4407
|
}
|
|
1907
4408
|
toEip712() {
|
|
1908
|
-
var _value$order;
|
|
1909
4409
|
const { params } = this;
|
|
1910
4410
|
const { value, type } = this.toAmino();
|
|
4411
|
+
const { expiration_block: _eb, ...orderWithoutExpiration } = value.order || {};
|
|
1911
4412
|
return {
|
|
1912
4413
|
type,
|
|
1913
4414
|
value: {
|
|
1914
4415
|
...value,
|
|
1915
4416
|
order: {
|
|
1916
|
-
...
|
|
4417
|
+
...orderWithoutExpiration,
|
|
1917
4418
|
order_info: {
|
|
1918
|
-
...
|
|
4419
|
+
...orderWithoutExpiration === null || orderWithoutExpiration === void 0 ? void 0 : orderWithoutExpiration.order_info,
|
|
1919
4420
|
price: (0, __injectivelabs_utils.toChainFormat)(params.price).toFixed(),
|
|
1920
4421
|
quantity: (0, __injectivelabs_utils.toChainFormat)(params.quantity).toFixed()
|
|
1921
4422
|
},
|
|
@@ -1927,145 +4428,135 @@ var MsgCreateDerivativeMarketOrder = class MsgCreateDerivativeMarketOrder extend
|
|
|
1927
4428
|
}
|
|
1928
4429
|
toDirectSign() {
|
|
1929
4430
|
return {
|
|
1930
|
-
type: "/injective.exchange.
|
|
4431
|
+
type: "/injective.exchange.v2.MsgCreateBinaryOptionsLimitOrder",
|
|
1931
4432
|
message: this.toProto()
|
|
1932
4433
|
};
|
|
1933
4434
|
}
|
|
1934
4435
|
toBinary() {
|
|
1935
|
-
return
|
|
4436
|
+
return __injectivelabs_core_proto_ts_v2_generated_injective_exchange_v2_tx_pb.MsgCreateBinaryOptionsLimitOrder.toBinary(this.toProto());
|
|
1936
4437
|
}
|
|
1937
4438
|
};
|
|
1938
4439
|
|
|
1939
4440
|
//#endregion
|
|
1940
|
-
//#region src/core/modules/exchange/msgs/
|
|
1941
|
-
const
|
|
1942
|
-
|
|
1943
|
-
|
|
1944
|
-
|
|
1945
|
-
|
|
1946
|
-
|
|
1947
|
-
|
|
1948
|
-
|
|
1949
|
-
|
|
1950
|
-
|
|
1951
|
-
|
|
1952
|
-
|
|
1953
|
-
|
|
1954
|
-
|
|
1955
|
-
|
|
1956
|
-
|
|
1957
|
-
|
|
1958
|
-
order: derivativeOrder
|
|
4441
|
+
//#region src/core/modules/exchange/msgs/MsgInstantBinaryOptionsMarketLaunch.ts
|
|
4442
|
+
const createMessage$2 = (params) => {
|
|
4443
|
+
return __injectivelabs_core_proto_ts_v2_generated_injective_exchange_v1beta1_tx_pb.MsgInstantBinaryOptionsMarketLaunch.create({
|
|
4444
|
+
sender: params.proposer,
|
|
4445
|
+
ticker: params.market.ticker,
|
|
4446
|
+
oracleSymbol: params.market.oracleSymbol,
|
|
4447
|
+
oracleProvider: params.market.oracleProvider,
|
|
4448
|
+
oracleType: params.market.oracleType,
|
|
4449
|
+
oracleScaleFactor: params.market.oracleScaleFactor,
|
|
4450
|
+
makerFeeRate: params.market.makerFeeRate,
|
|
4451
|
+
takerFeeRate: params.market.takerFeeRate,
|
|
4452
|
+
expirationTimestamp: BigInt(params.market.expirationTimestamp),
|
|
4453
|
+
settlementTimestamp: BigInt(params.market.settlementTimestamp),
|
|
4454
|
+
admin: params.market.admin,
|
|
4455
|
+
quoteDenom: params.market.quoteDenom,
|
|
4456
|
+
minPriceTickSize: params.market.minPriceTickSize,
|
|
4457
|
+
minQuantityTickSize: params.market.minQuantityTickSize,
|
|
4458
|
+
minNotional: params.market.minNotional
|
|
1959
4459
|
});
|
|
1960
4460
|
};
|
|
1961
4461
|
/**
|
|
1962
4462
|
* @category Messages
|
|
1963
4463
|
*/
|
|
1964
|
-
var
|
|
4464
|
+
var MsgInstantBinaryOptionsMarketLaunch = class MsgInstantBinaryOptionsMarketLaunch extends require_MsgBase.MsgBase {
|
|
1965
4465
|
static fromJSON(params) {
|
|
1966
|
-
return new
|
|
4466
|
+
return new MsgInstantBinaryOptionsMarketLaunch(params);
|
|
1967
4467
|
}
|
|
1968
4468
|
toProto() {
|
|
1969
4469
|
const { params: initialParams } = this;
|
|
1970
|
-
return
|
|
4470
|
+
return createMessage$2({
|
|
1971
4471
|
...initialParams,
|
|
1972
|
-
|
|
1973
|
-
|
|
1974
|
-
|
|
1975
|
-
|
|
4472
|
+
market: {
|
|
4473
|
+
...initialParams.market,
|
|
4474
|
+
minPriceTickSize: (0, __injectivelabs_utils.toChainFormat)(initialParams.market.minPriceTickSize).toFixed(),
|
|
4475
|
+
makerFeeRate: (0, __injectivelabs_utils.toChainFormat)(initialParams.market.makerFeeRate).toFixed(),
|
|
4476
|
+
takerFeeRate: (0, __injectivelabs_utils.toChainFormat)(initialParams.market.takerFeeRate).toFixed(),
|
|
4477
|
+
minQuantityTickSize: (0, __injectivelabs_utils.toChainFormat)(initialParams.market.minQuantityTickSize).toFixed(),
|
|
4478
|
+
minNotional: (0, __injectivelabs_utils.toChainFormat)(initialParams.market.minNotional).toFixed()
|
|
4479
|
+
}
|
|
1976
4480
|
});
|
|
1977
4481
|
}
|
|
1978
4482
|
toData() {
|
|
1979
4483
|
const proto = this.toProto();
|
|
1980
4484
|
return {
|
|
1981
|
-
"@type": "/injective.exchange.v1beta1.
|
|
4485
|
+
"@type": "/injective.exchange.v1beta1.MsgInstantBinaryOptionsMarketLaunch",
|
|
1982
4486
|
...proto
|
|
1983
4487
|
};
|
|
1984
4488
|
}
|
|
1985
4489
|
toAmino() {
|
|
1986
4490
|
const { params } = this;
|
|
1987
4491
|
return {
|
|
1988
|
-
type: "exchange/
|
|
4492
|
+
type: "exchange/MsgInstantBinaryOptionsMarketLaunch",
|
|
1989
4493
|
value: {
|
|
1990
|
-
sender: params.
|
|
1991
|
-
|
|
1992
|
-
|
|
1993
|
-
|
|
1994
|
-
|
|
1995
|
-
|
|
1996
|
-
|
|
1997
|
-
|
|
1998
|
-
|
|
1999
|
-
|
|
2000
|
-
|
|
2001
|
-
|
|
2002
|
-
|
|
2003
|
-
|
|
4494
|
+
sender: params.proposer,
|
|
4495
|
+
ticker: params.market.ticker,
|
|
4496
|
+
oracle_symbol: params.market.oracleSymbol,
|
|
4497
|
+
oracle_provider: params.market.oracleProvider,
|
|
4498
|
+
oracle_type: params.market.oracleType,
|
|
4499
|
+
oracle_scale_factor: params.market.oracleScaleFactor,
|
|
4500
|
+
maker_fee_rate: params.market.makerFeeRate,
|
|
4501
|
+
taker_fee_rate: params.market.takerFeeRate,
|
|
4502
|
+
expiration_timestamp: params.market.expirationTimestamp.toString(),
|
|
4503
|
+
settlement_timestamp: params.market.settlementTimestamp.toString(),
|
|
4504
|
+
admin: params.market.admin,
|
|
4505
|
+
quote_denom: params.market.quoteDenom,
|
|
4506
|
+
min_price_tick_size: params.market.minPriceTickSize,
|
|
4507
|
+
min_quantity_tick_size: params.market.minQuantityTickSize,
|
|
4508
|
+
min_notional: params.market.minNotional
|
|
2004
4509
|
}
|
|
2005
4510
|
};
|
|
2006
4511
|
}
|
|
2007
4512
|
toWeb3Gw() {
|
|
2008
4513
|
const { value } = this.toAmino();
|
|
2009
4514
|
return {
|
|
2010
|
-
"@type": "/injective.exchange.v1beta1.
|
|
4515
|
+
"@type": "/injective.exchange.v1beta1.MsgInstantBinaryOptionsMarketLaunch",
|
|
2011
4516
|
...value
|
|
2012
4517
|
};
|
|
2013
4518
|
}
|
|
2014
|
-
toEip712V2() {
|
|
2015
|
-
const { params } = this;
|
|
2016
|
-
const web3gw = this.toWeb3Gw();
|
|
2017
|
-
const order = web3gw.order;
|
|
2018
|
-
return {
|
|
2019
|
-
...web3gw,
|
|
2020
|
-
order: {
|
|
2021
|
-
...order,
|
|
2022
|
-
order_info: {
|
|
2023
|
-
...order.order_info,
|
|
2024
|
-
price: require_utils.numberToCosmosSdkDecString(params.price),
|
|
2025
|
-
quantity: require_utils.numberToCosmosSdkDecString(params.quantity)
|
|
2026
|
-
},
|
|
2027
|
-
margin: require_utils.numberToCosmosSdkDecString(params.margin),
|
|
2028
|
-
trigger_price: require_utils.numberToCosmosSdkDecString(params.triggerPrice || "0"),
|
|
2029
|
-
order_type: __injectivelabs_core_proto_ts_v2_generated_injective_exchange_v1beta1_exchange_pb.OrderType[params.orderType]
|
|
2030
|
-
}
|
|
2031
|
-
};
|
|
2032
|
-
}
|
|
2033
4519
|
toEip712() {
|
|
2034
|
-
|
|
2035
|
-
const { params } = this;
|
|
2036
|
-
const { value, type } = this.toAmino();
|
|
4520
|
+
const { type, value } = this.toAmino();
|
|
2037
4521
|
return {
|
|
2038
4522
|
type,
|
|
2039
4523
|
value: {
|
|
2040
4524
|
...value,
|
|
2041
|
-
|
|
2042
|
-
|
|
2043
|
-
|
|
2044
|
-
|
|
2045
|
-
|
|
2046
|
-
quantity: (0, __injectivelabs_utils.toChainFormat)(params.quantity).toFixed()
|
|
2047
|
-
},
|
|
2048
|
-
margin: (0, __injectivelabs_utils.toChainFormat)(params.margin).toFixed(),
|
|
2049
|
-
trigger_price: (0, __injectivelabs_utils.toChainFormat)(params.triggerPrice || "0").toFixed()
|
|
2050
|
-
}
|
|
4525
|
+
min_price_tick_size: (0, __injectivelabs_utils.toChainFormat)(value.min_price_tick_size).toFixed(),
|
|
4526
|
+
min_quantity_tick_size: (0, __injectivelabs_utils.toChainFormat)(value.min_quantity_tick_size).toFixed(),
|
|
4527
|
+
min_notional: (0, __injectivelabs_utils.toChainFormat)(value.min_notional).toFixed(),
|
|
4528
|
+
taker_fee_rate: (0, __injectivelabs_utils.toChainFormat)(value.taker_fee_rate).toFixed(),
|
|
4529
|
+
maker_fee_rate: (0, __injectivelabs_utils.toChainFormat)(value.maker_fee_rate).toFixed()
|
|
2051
4530
|
}
|
|
2052
4531
|
};
|
|
2053
4532
|
}
|
|
4533
|
+
toEip712V2() {
|
|
4534
|
+
const { params } = this;
|
|
4535
|
+
return {
|
|
4536
|
+
...this.toWeb3Gw(),
|
|
4537
|
+
min_price_tick_size: require_utils.numberToCosmosSdkDecString(params.market.minPriceTickSize),
|
|
4538
|
+
min_quantity_tick_size: require_utils.numberToCosmosSdkDecString(params.market.minQuantityTickSize),
|
|
4539
|
+
min_notional: require_utils.numberToCosmosSdkDecString(params.market.minNotional),
|
|
4540
|
+
taker_fee_rate: require_utils.numberToCosmosSdkDecString(params.market.takerFeeRate),
|
|
4541
|
+
maker_fee_rate: require_utils.numberToCosmosSdkDecString(params.market.makerFeeRate),
|
|
4542
|
+
oracle_type: __injectivelabs_core_proto_ts_v2_generated_injective_oracle_v1beta1_oracle_pb.OracleType[params.market.oracleType]
|
|
4543
|
+
};
|
|
4544
|
+
}
|
|
2054
4545
|
toDirectSign() {
|
|
2055
4546
|
return {
|
|
2056
|
-
type: "/injective.exchange.v1beta1.
|
|
4547
|
+
type: "/injective.exchange.v1beta1.MsgInstantBinaryOptionsMarketLaunch",
|
|
2057
4548
|
message: this.toProto()
|
|
2058
4549
|
};
|
|
2059
4550
|
}
|
|
2060
4551
|
toBinary() {
|
|
2061
|
-
return __injectivelabs_core_proto_ts_v2_generated_injective_exchange_v1beta1_tx_pb.
|
|
4552
|
+
return __injectivelabs_core_proto_ts_v2_generated_injective_exchange_v1beta1_tx_pb.MsgInstantBinaryOptionsMarketLaunch.toBinary(this.toProto());
|
|
2062
4553
|
}
|
|
2063
4554
|
};
|
|
2064
4555
|
|
|
2065
4556
|
//#endregion
|
|
2066
|
-
//#region src/core/modules/exchange/msgs/
|
|
4557
|
+
//#region src/core/modules/exchange/msgs/MsgAdminUpdateBinaryOptionsMarketV2.ts
|
|
2067
4558
|
const createMessage$1 = (params) => {
|
|
2068
|
-
return
|
|
4559
|
+
return __injectivelabs_core_proto_ts_v2_generated_injective_exchange_v2_tx_pb.MsgAdminUpdateBinaryOptionsMarket.create({
|
|
2069
4560
|
sender: params.sender,
|
|
2070
4561
|
marketId: params.marketId,
|
|
2071
4562
|
settlementPrice: params.settlementPrice,
|
|
@@ -2077,9 +4568,9 @@ const createMessage$1 = (params) => {
|
|
|
2077
4568
|
/**
|
|
2078
4569
|
* @category Messages
|
|
2079
4570
|
*/
|
|
2080
|
-
var
|
|
4571
|
+
var MsgAdminUpdateBinaryOptionsMarketV2 = class MsgAdminUpdateBinaryOptionsMarketV2 extends require_MsgBase.MsgBase {
|
|
2081
4572
|
static fromJSON(params) {
|
|
2082
|
-
return new
|
|
4573
|
+
return new MsgAdminUpdateBinaryOptionsMarketV2(params);
|
|
2083
4574
|
}
|
|
2084
4575
|
toProto() {
|
|
2085
4576
|
const { params: initialParams } = this;
|
|
@@ -2091,7 +4582,7 @@ var MsgAdminUpdateBinaryOptionsMarket = class MsgAdminUpdateBinaryOptionsMarket
|
|
|
2091
4582
|
toData() {
|
|
2092
4583
|
const proto = this.toProto();
|
|
2093
4584
|
return {
|
|
2094
|
-
"@type": "/injective.exchange.
|
|
4585
|
+
"@type": "/injective.exchange.v2.MsgAdminUpdateBinaryOptionsMarket",
|
|
2095
4586
|
...proto
|
|
2096
4587
|
};
|
|
2097
4588
|
}
|
|
@@ -2112,60 +4603,53 @@ var MsgAdminUpdateBinaryOptionsMarket = class MsgAdminUpdateBinaryOptionsMarket
|
|
|
2112
4603
|
toWeb3Gw() {
|
|
2113
4604
|
const { value } = this.toAmino();
|
|
2114
4605
|
return {
|
|
2115
|
-
"@type": "/injective.exchange.
|
|
4606
|
+
"@type": "/injective.exchange.v2.MsgAdminUpdateBinaryOptionsMarket",
|
|
2116
4607
|
...value
|
|
2117
4608
|
};
|
|
2118
4609
|
}
|
|
2119
4610
|
toEip712() {
|
|
2120
|
-
|
|
2121
|
-
return {
|
|
2122
|
-
type,
|
|
2123
|
-
value: {
|
|
2124
|
-
...value,
|
|
2125
|
-
settlement_price: (0, __injectivelabs_utils.toChainFormat)(value.settlement_price).toFixed()
|
|
2126
|
-
}
|
|
2127
|
-
};
|
|
4611
|
+
throw new __injectivelabs_exceptions.GeneralException(/* @__PURE__ */ new Error("EIP712 v1 is not supported for MsgAdminUpdateBinaryOptionsMarket, use toEip712V2 instead."));
|
|
2128
4612
|
}
|
|
2129
4613
|
toEip712V2() {
|
|
2130
4614
|
const { params } = this;
|
|
2131
4615
|
return {
|
|
2132
4616
|
...this.toWeb3Gw(),
|
|
2133
4617
|
settlement_price: require_utils.numberToCosmosSdkDecString(params.settlementPrice),
|
|
2134
|
-
status:
|
|
4618
|
+
status: __injectivelabs_core_proto_ts_v2_generated_injective_exchange_v2_market_pb.MarketStatus[params.status]
|
|
2135
4619
|
};
|
|
2136
4620
|
}
|
|
2137
4621
|
toDirectSign() {
|
|
2138
4622
|
return {
|
|
2139
|
-
type: "/injective.exchange.
|
|
4623
|
+
type: "/injective.exchange.v2.MsgAdminUpdateBinaryOptionsMarket",
|
|
2140
4624
|
message: this.toProto()
|
|
2141
4625
|
};
|
|
2142
4626
|
}
|
|
2143
4627
|
toBinary() {
|
|
2144
|
-
return
|
|
4628
|
+
return __injectivelabs_core_proto_ts_v2_generated_injective_exchange_v2_tx_pb.MsgAdminUpdateBinaryOptionsMarket.toBinary(this.toProto());
|
|
2145
4629
|
}
|
|
2146
4630
|
};
|
|
2147
4631
|
|
|
2148
4632
|
//#endregion
|
|
2149
|
-
//#region src/core/modules/exchange/msgs/
|
|
4633
|
+
//#region src/core/modules/exchange/msgs/MsgBatchCancelBinaryOptionsOrdersV2.ts
|
|
2150
4634
|
/**
|
|
2151
4635
|
* @category Messages
|
|
2152
4636
|
*/
|
|
2153
|
-
var
|
|
4637
|
+
var MsgBatchCancelBinaryOptionsOrdersV2 = class MsgBatchCancelBinaryOptionsOrdersV2 extends require_MsgBase.MsgBase {
|
|
2154
4638
|
static fromJSON(params) {
|
|
2155
|
-
return new
|
|
4639
|
+
return new MsgBatchCancelBinaryOptionsOrdersV2(params);
|
|
2156
4640
|
}
|
|
2157
4641
|
toProto() {
|
|
2158
4642
|
const { params } = this;
|
|
2159
4643
|
const orderDataList = params.orders.map((order) => {
|
|
2160
|
-
return
|
|
4644
|
+
return __injectivelabs_core_proto_ts_v2_generated_injective_exchange_v2_tx_pb.OrderData.create({
|
|
2161
4645
|
marketId: order.marketId,
|
|
2162
4646
|
subaccountId: order.subaccountId,
|
|
2163
4647
|
orderHash: order.orderHash || "",
|
|
2164
|
-
orderMask:
|
|
4648
|
+
orderMask: order.orderMask || __injectivelabs_core_proto_ts_v2_generated_injective_exchange_v2_order_pb.OrderMask.ANY,
|
|
2165
4649
|
cid: order.cid || ""
|
|
2166
4650
|
});
|
|
2167
4651
|
});
|
|
2168
|
-
return
|
|
4652
|
+
return __injectivelabs_core_proto_ts_v2_generated_injective_exchange_v2_tx_pb.MsgBatchCancelBinaryOptionsOrders.create({
|
|
2169
4653
|
sender: params.injectiveAddress,
|
|
2170
4654
|
data: orderDataList
|
|
2171
4655
|
});
|
|
@@ -2173,22 +4657,22 @@ var MsgBatchCancelBinaryOptionsOrders = class MsgBatchCancelBinaryOptionsOrders
|
|
|
2173
4657
|
toData() {
|
|
2174
4658
|
const proto = this.toProto();
|
|
2175
4659
|
return {
|
|
2176
|
-
"@type": "/injective.exchange.
|
|
4660
|
+
"@type": "/injective.exchange.v2.MsgBatchCancelBinaryOptionsOrders",
|
|
2177
4661
|
...proto
|
|
2178
4662
|
};
|
|
2179
4663
|
}
|
|
2180
4664
|
toAmino() {
|
|
2181
|
-
const
|
|
4665
|
+
const proto = this.toProto();
|
|
2182
4666
|
return {
|
|
2183
4667
|
type: "exchange/MsgBatchCancelBinaryOptionsOrders",
|
|
2184
4668
|
value: {
|
|
2185
|
-
sender:
|
|
2186
|
-
data:
|
|
2187
|
-
market_id:
|
|
2188
|
-
subaccount_id:
|
|
2189
|
-
order_hash:
|
|
2190
|
-
order_mask:
|
|
2191
|
-
cid:
|
|
4669
|
+
sender: proto.sender,
|
|
4670
|
+
data: proto.data.map((orderData) => ({
|
|
4671
|
+
market_id: orderData.marketId,
|
|
4672
|
+
subaccount_id: orderData.subaccountId,
|
|
4673
|
+
order_hash: orderData.orderHash,
|
|
4674
|
+
order_mask: orderData.orderMask,
|
|
4675
|
+
cid: orderData.cid
|
|
2192
4676
|
}))
|
|
2193
4677
|
}
|
|
2194
4678
|
};
|
|
@@ -2196,39 +4680,40 @@ var MsgBatchCancelBinaryOptionsOrders = class MsgBatchCancelBinaryOptionsOrders
|
|
|
2196
4680
|
toWeb3Gw() {
|
|
2197
4681
|
const { value } = this.toAmino();
|
|
2198
4682
|
return {
|
|
2199
|
-
"@type": "/injective.exchange.
|
|
4683
|
+
"@type": "/injective.exchange.v2.MsgBatchCancelBinaryOptionsOrders",
|
|
2200
4684
|
...value
|
|
2201
4685
|
};
|
|
2202
4686
|
}
|
|
2203
4687
|
toDirectSign() {
|
|
2204
4688
|
return {
|
|
2205
|
-
type: "/injective.exchange.
|
|
4689
|
+
type: "/injective.exchange.v2.MsgBatchCancelBinaryOptionsOrders",
|
|
2206
4690
|
message: this.toProto()
|
|
2207
4691
|
};
|
|
2208
4692
|
}
|
|
2209
4693
|
toBinary() {
|
|
2210
|
-
return
|
|
4694
|
+
return __injectivelabs_core_proto_ts_v2_generated_injective_exchange_v2_tx_pb.MsgBatchCancelBinaryOptionsOrders.toBinary(this.toProto());
|
|
2211
4695
|
}
|
|
2212
4696
|
};
|
|
2213
4697
|
|
|
2214
4698
|
//#endregion
|
|
2215
|
-
//#region src/core/modules/exchange/msgs/
|
|
4699
|
+
//#region src/core/modules/exchange/msgs/MsgCreateBinaryOptionsMarketOrderV2.ts
|
|
2216
4700
|
const createMarketOrder = (params) => {
|
|
2217
|
-
const orderInfo =
|
|
4701
|
+
const orderInfo = __injectivelabs_core_proto_ts_v2_generated_injective_exchange_v2_order_pb.OrderInfo.create({
|
|
2218
4702
|
subaccountId: params.subaccountId,
|
|
2219
4703
|
feeRecipient: params.feeRecipient,
|
|
2220
4704
|
price: params.price,
|
|
2221
4705
|
quantity: params.quantity,
|
|
2222
4706
|
cid: params.cid || ""
|
|
2223
4707
|
});
|
|
2224
|
-
const derivativeOrder =
|
|
4708
|
+
const derivativeOrder = __injectivelabs_core_proto_ts_v2_generated_injective_exchange_v2_order_pb.DerivativeOrder.create({
|
|
2225
4709
|
marketId: params.marketId,
|
|
2226
4710
|
orderInfo,
|
|
2227
4711
|
orderType: params.orderType,
|
|
2228
4712
|
margin: params.margin,
|
|
2229
|
-
triggerPrice: params.triggerPrice || "0"
|
|
4713
|
+
triggerPrice: params.triggerPrice || "0",
|
|
4714
|
+
expirationBlock: params.expirationBlock ? BigInt(params.expirationBlock) : BigInt(0)
|
|
2230
4715
|
});
|
|
2231
|
-
return
|
|
4716
|
+
return __injectivelabs_core_proto_ts_v2_generated_injective_exchange_v2_tx_pb.MsgCreateBinaryOptionsMarketOrder.create({
|
|
2232
4717
|
sender: params.injectiveAddress,
|
|
2233
4718
|
order: derivativeOrder
|
|
2234
4719
|
});
|
|
@@ -2236,9 +4721,9 @@ const createMarketOrder = (params) => {
|
|
|
2236
4721
|
/**
|
|
2237
4722
|
* @category Messages
|
|
2238
4723
|
*/
|
|
2239
|
-
var
|
|
4724
|
+
var MsgCreateBinaryOptionsMarketOrderV2 = class MsgCreateBinaryOptionsMarketOrderV2 extends require_MsgBase.MsgBase {
|
|
2240
4725
|
static fromJSON(params) {
|
|
2241
|
-
return new
|
|
4726
|
+
return new MsgCreateBinaryOptionsMarketOrderV2(params);
|
|
2242
4727
|
}
|
|
2243
4728
|
toProto() {
|
|
2244
4729
|
const { params: initialParams } = this;
|
|
@@ -2253,7 +4738,7 @@ var MsgCreateBinaryOptionsMarketOrder = class MsgCreateBinaryOptionsMarketOrder
|
|
|
2253
4738
|
toData() {
|
|
2254
4739
|
const proto = this.toProto();
|
|
2255
4740
|
return {
|
|
2256
|
-
"@type": "/injective.exchange.
|
|
4741
|
+
"@type": "/injective.exchange.v2.MsgCreateBinaryOptionsMarketOrder",
|
|
2257
4742
|
...proto
|
|
2258
4743
|
};
|
|
2259
4744
|
}
|
|
@@ -2274,7 +4759,8 @@ var MsgCreateBinaryOptionsMarketOrder = class MsgCreateBinaryOptionsMarketOrder
|
|
|
2274
4759
|
},
|
|
2275
4760
|
order_type: params.orderType,
|
|
2276
4761
|
margin: params.margin,
|
|
2277
|
-
trigger_price: params.triggerPrice || "0"
|
|
4762
|
+
trigger_price: params.triggerPrice || "0",
|
|
4763
|
+
expiration_block: params.expirationBlock || "0"
|
|
2278
4764
|
}
|
|
2279
4765
|
}
|
|
2280
4766
|
};
|
|
@@ -2282,7 +4768,7 @@ var MsgCreateBinaryOptionsMarketOrder = class MsgCreateBinaryOptionsMarketOrder
|
|
|
2282
4768
|
toWeb3Gw() {
|
|
2283
4769
|
const { value } = this.toAmino();
|
|
2284
4770
|
return {
|
|
2285
|
-
"@type": "/injective.exchange.
|
|
4771
|
+
"@type": "/injective.exchange.v2.MsgCreateBinaryOptionsMarketOrder",
|
|
2286
4772
|
...value
|
|
2287
4773
|
};
|
|
2288
4774
|
}
|
|
@@ -2301,22 +4787,22 @@ var MsgCreateBinaryOptionsMarketOrder = class MsgCreateBinaryOptionsMarketOrder
|
|
|
2301
4787
|
},
|
|
2302
4788
|
margin: require_utils.numberToCosmosSdkDecString(params.margin),
|
|
2303
4789
|
trigger_price: require_utils.numberToCosmosSdkDecString(params.triggerPrice || "0"),
|
|
2304
|
-
order_type:
|
|
4790
|
+
order_type: __injectivelabs_core_proto_ts_v2_generated_injective_exchange_v2_order_pb.OrderType[params.orderType]
|
|
2305
4791
|
}
|
|
2306
4792
|
};
|
|
2307
4793
|
}
|
|
2308
4794
|
toEip712() {
|
|
2309
|
-
var _value$order;
|
|
2310
4795
|
const { params } = this;
|
|
2311
4796
|
const { value, type } = this.toAmino();
|
|
4797
|
+
const { expiration_block: _eb, ...orderWithoutExpiration } = value.order || {};
|
|
2312
4798
|
return {
|
|
2313
4799
|
type,
|
|
2314
4800
|
value: {
|
|
2315
4801
|
...value,
|
|
2316
4802
|
order: {
|
|
2317
|
-
...
|
|
4803
|
+
...orderWithoutExpiration,
|
|
2318
4804
|
order_info: {
|
|
2319
|
-
...
|
|
4805
|
+
...orderWithoutExpiration === null || orderWithoutExpiration === void 0 ? void 0 : orderWithoutExpiration.order_info,
|
|
2320
4806
|
price: (0, __injectivelabs_utils.toChainFormat)(params.price).toFixed(),
|
|
2321
4807
|
quantity: (0, __injectivelabs_utils.toChainFormat)(params.quantity).toFixed()
|
|
2322
4808
|
},
|
|
@@ -2328,71 +4814,19 @@ var MsgCreateBinaryOptionsMarketOrder = class MsgCreateBinaryOptionsMarketOrder
|
|
|
2328
4814
|
}
|
|
2329
4815
|
toDirectSign() {
|
|
2330
4816
|
return {
|
|
2331
|
-
type: "/injective.exchange.
|
|
2332
|
-
message: this.toProto()
|
|
2333
|
-
};
|
|
2334
|
-
}
|
|
2335
|
-
toBinary() {
|
|
2336
|
-
return __injectivelabs_core_proto_ts_v2_generated_injective_exchange_v1beta1_tx_pb.MsgCreateBinaryOptionsMarketOrder.toBinary(this.toProto());
|
|
2337
|
-
}
|
|
2338
|
-
};
|
|
2339
|
-
|
|
2340
|
-
//#endregion
|
|
2341
|
-
//#region src/core/modules/exchange/msgs/MsgSetDelegationTransferReceivers.ts
|
|
2342
|
-
/**
|
|
2343
|
-
* @deprecated no longer supported on chain
|
|
2344
|
-
* @category Messages
|
|
2345
|
-
*/
|
|
2346
|
-
var MsgSetDelegationTransferReceivers = class MsgSetDelegationTransferReceivers extends require_MsgBase.MsgBase {
|
|
2347
|
-
static fromJSON(params) {
|
|
2348
|
-
return new MsgSetDelegationTransferReceivers(params);
|
|
2349
|
-
}
|
|
2350
|
-
toProto() {
|
|
2351
|
-
const { params } = this;
|
|
2352
|
-
return {
|
|
2353
|
-
sender: params.sender,
|
|
2354
|
-
receivers: params.receivers
|
|
2355
|
-
};
|
|
2356
|
-
}
|
|
2357
|
-
toData() {
|
|
2358
|
-
const proto = this.toProto();
|
|
2359
|
-
return {
|
|
2360
|
-
"@type": "/injective.exchange.v2.MsgSetDelegationTransferReceivers",
|
|
2361
|
-
...proto
|
|
2362
|
-
};
|
|
2363
|
-
}
|
|
2364
|
-
toAmino() {
|
|
2365
|
-
const proto = this.toProto();
|
|
2366
|
-
return {
|
|
2367
|
-
type: "exchange/MsgSetDelegationTransferReceivers",
|
|
2368
|
-
value: {
|
|
2369
|
-
sender: proto.sender,
|
|
2370
|
-
receivers: proto.receivers
|
|
2371
|
-
}
|
|
2372
|
-
};
|
|
2373
|
-
}
|
|
2374
|
-
toWeb3Gw() {
|
|
2375
|
-
const { value } = this.toAmino();
|
|
2376
|
-
return {
|
|
2377
|
-
"@type": "/injective.exchange.v2.MsgSetDelegationTransferReceivers",
|
|
2378
|
-
...value
|
|
2379
|
-
};
|
|
2380
|
-
}
|
|
2381
|
-
toDirectSign() {
|
|
2382
|
-
return {
|
|
2383
|
-
type: "/injective.exchange.v2.MsgSetDelegationTransferReceivers",
|
|
4817
|
+
type: "/injective.exchange.v2.MsgCreateBinaryOptionsMarketOrder",
|
|
2384
4818
|
message: this.toProto()
|
|
2385
4819
|
};
|
|
2386
4820
|
}
|
|
2387
4821
|
toBinary() {
|
|
2388
|
-
return
|
|
4822
|
+
return __injectivelabs_core_proto_ts_v2_generated_injective_exchange_v2_tx_pb.MsgCreateBinaryOptionsMarketOrder.toBinary(this.toProto());
|
|
2389
4823
|
}
|
|
2390
4824
|
};
|
|
2391
4825
|
|
|
2392
4826
|
//#endregion
|
|
2393
|
-
//#region src/core/modules/exchange/msgs/
|
|
4827
|
+
//#region src/core/modules/exchange/msgs/MsgInstantBinaryOptionsMarketLaunchV2.ts
|
|
2394
4828
|
const createMessage = (params) => {
|
|
2395
|
-
return
|
|
4829
|
+
return __injectivelabs_core_proto_ts_v2_generated_injective_exchange_v2_tx_pb.MsgInstantBinaryOptionsMarketLaunch.create({
|
|
2396
4830
|
sender: params.proposer,
|
|
2397
4831
|
ticker: params.market.ticker,
|
|
2398
4832
|
oracleSymbol: params.market.oracleSymbol,
|
|
@@ -2413,9 +4847,9 @@ const createMessage = (params) => {
|
|
|
2413
4847
|
/**
|
|
2414
4848
|
* @category Messages
|
|
2415
4849
|
*/
|
|
2416
|
-
var
|
|
4850
|
+
var MsgInstantBinaryOptionsMarketLaunchV2 = class MsgInstantBinaryOptionsMarketLaunchV2 extends require_MsgBase.MsgBase {
|
|
2417
4851
|
static fromJSON(params) {
|
|
2418
|
-
return new
|
|
4852
|
+
return new MsgInstantBinaryOptionsMarketLaunchV2(params);
|
|
2419
4853
|
}
|
|
2420
4854
|
toProto() {
|
|
2421
4855
|
const { params: initialParams } = this;
|
|
@@ -2434,7 +4868,7 @@ var MsgInstantBinaryOptionsMarketLaunch = class MsgInstantBinaryOptionsMarketLau
|
|
|
2434
4868
|
toData() {
|
|
2435
4869
|
const proto = this.toProto();
|
|
2436
4870
|
return {
|
|
2437
|
-
"@type": "/injective.exchange.
|
|
4871
|
+
"@type": "/injective.exchange.v2.MsgInstantBinaryOptionsMarketLaunch",
|
|
2438
4872
|
...proto
|
|
2439
4873
|
};
|
|
2440
4874
|
}
|
|
@@ -2464,23 +4898,12 @@ var MsgInstantBinaryOptionsMarketLaunch = class MsgInstantBinaryOptionsMarketLau
|
|
|
2464
4898
|
toWeb3Gw() {
|
|
2465
4899
|
const { value } = this.toAmino();
|
|
2466
4900
|
return {
|
|
2467
|
-
"@type": "/injective.exchange.
|
|
4901
|
+
"@type": "/injective.exchange.v2.MsgInstantBinaryOptionsMarketLaunch",
|
|
2468
4902
|
...value
|
|
2469
4903
|
};
|
|
2470
4904
|
}
|
|
2471
4905
|
toEip712() {
|
|
2472
|
-
|
|
2473
|
-
return {
|
|
2474
|
-
type,
|
|
2475
|
-
value: {
|
|
2476
|
-
...value,
|
|
2477
|
-
min_price_tick_size: (0, __injectivelabs_utils.toChainFormat)(value.min_price_tick_size).toFixed(),
|
|
2478
|
-
min_quantity_tick_size: (0, __injectivelabs_utils.toChainFormat)(value.min_quantity_tick_size).toFixed(),
|
|
2479
|
-
min_notional: (0, __injectivelabs_utils.toChainFormat)(value.min_notional).toFixed(),
|
|
2480
|
-
taker_fee_rate: (0, __injectivelabs_utils.toChainFormat)(value.taker_fee_rate).toFixed(),
|
|
2481
|
-
maker_fee_rate: (0, __injectivelabs_utils.toChainFormat)(value.maker_fee_rate).toFixed()
|
|
2482
|
-
}
|
|
2483
|
-
};
|
|
4906
|
+
throw new __injectivelabs_exceptions.GeneralException(/* @__PURE__ */ new Error("EIP712 v1 is not supported for MsgInstantBinaryOptionsMarketLaunch, use toEip712V2 instead."));
|
|
2484
4907
|
}
|
|
2485
4908
|
toEip712V2() {
|
|
2486
4909
|
const { params } = this;
|
|
@@ -2491,17 +4914,18 @@ var MsgInstantBinaryOptionsMarketLaunch = class MsgInstantBinaryOptionsMarketLau
|
|
|
2491
4914
|
min_notional: require_utils.numberToCosmosSdkDecString(params.market.minNotional),
|
|
2492
4915
|
taker_fee_rate: require_utils.numberToCosmosSdkDecString(params.market.takerFeeRate),
|
|
2493
4916
|
maker_fee_rate: require_utils.numberToCosmosSdkDecString(params.market.makerFeeRate),
|
|
2494
|
-
oracle_type: __injectivelabs_core_proto_ts_v2_generated_injective_oracle_v1beta1_oracle_pb.OracleType[params.market.oracleType]
|
|
4917
|
+
oracle_type: __injectivelabs_core_proto_ts_v2_generated_injective_oracle_v1beta1_oracle_pb.OracleType[params.market.oracleType],
|
|
4918
|
+
open_notional_cap: {}
|
|
2495
4919
|
};
|
|
2496
4920
|
}
|
|
2497
4921
|
toDirectSign() {
|
|
2498
4922
|
return {
|
|
2499
|
-
type: "/injective.exchange.
|
|
4923
|
+
type: "/injective.exchange.v2.MsgInstantBinaryOptionsMarketLaunch",
|
|
2500
4924
|
message: this.toProto()
|
|
2501
4925
|
};
|
|
2502
4926
|
}
|
|
2503
4927
|
toBinary() {
|
|
2504
|
-
return
|
|
4928
|
+
return __injectivelabs_core_proto_ts_v2_generated_injective_exchange_v2_tx_pb.MsgInstantBinaryOptionsMarketLaunch.toBinary(this.toProto());
|
|
2505
4929
|
}
|
|
2506
4930
|
};
|
|
2507
4931
|
|
|
@@ -8196,36 +10620,72 @@ Object.defineProperty(exports, 'MsgAdminUpdateBinaryOptionsMarket', {
|
|
|
8196
10620
|
return MsgAdminUpdateBinaryOptionsMarket;
|
|
8197
10621
|
}
|
|
8198
10622
|
});
|
|
10623
|
+
Object.defineProperty(exports, 'MsgAdminUpdateBinaryOptionsMarketV2', {
|
|
10624
|
+
enumerable: true,
|
|
10625
|
+
get: function () {
|
|
10626
|
+
return MsgAdminUpdateBinaryOptionsMarketV2;
|
|
10627
|
+
}
|
|
10628
|
+
});
|
|
8199
10629
|
Object.defineProperty(exports, 'MsgAuthorizeStakeGrants', {
|
|
8200
10630
|
enumerable: true,
|
|
8201
10631
|
get: function () {
|
|
8202
10632
|
return MsgAuthorizeStakeGrants;
|
|
8203
10633
|
}
|
|
8204
10634
|
});
|
|
10635
|
+
Object.defineProperty(exports, 'MsgAuthorizeStakeGrantsV2', {
|
|
10636
|
+
enumerable: true,
|
|
10637
|
+
get: function () {
|
|
10638
|
+
return MsgAuthorizeStakeGrantsV2;
|
|
10639
|
+
}
|
|
10640
|
+
});
|
|
8205
10641
|
Object.defineProperty(exports, 'MsgBatchCancelBinaryOptionsOrders', {
|
|
8206
10642
|
enumerable: true,
|
|
8207
10643
|
get: function () {
|
|
8208
10644
|
return MsgBatchCancelBinaryOptionsOrders;
|
|
8209
10645
|
}
|
|
8210
10646
|
});
|
|
10647
|
+
Object.defineProperty(exports, 'MsgBatchCancelBinaryOptionsOrdersV2', {
|
|
10648
|
+
enumerable: true,
|
|
10649
|
+
get: function () {
|
|
10650
|
+
return MsgBatchCancelBinaryOptionsOrdersV2;
|
|
10651
|
+
}
|
|
10652
|
+
});
|
|
8211
10653
|
Object.defineProperty(exports, 'MsgBatchCancelDerivativeOrders', {
|
|
8212
10654
|
enumerable: true,
|
|
8213
10655
|
get: function () {
|
|
8214
10656
|
return MsgBatchCancelDerivativeOrders;
|
|
8215
10657
|
}
|
|
8216
10658
|
});
|
|
10659
|
+
Object.defineProperty(exports, 'MsgBatchCancelDerivativeOrdersV2', {
|
|
10660
|
+
enumerable: true,
|
|
10661
|
+
get: function () {
|
|
10662
|
+
return MsgBatchCancelDerivativeOrdersV2;
|
|
10663
|
+
}
|
|
10664
|
+
});
|
|
8217
10665
|
Object.defineProperty(exports, 'MsgBatchCancelSpotOrders', {
|
|
8218
10666
|
enumerable: true,
|
|
8219
10667
|
get: function () {
|
|
8220
10668
|
return MsgBatchCancelSpotOrders;
|
|
8221
10669
|
}
|
|
8222
10670
|
});
|
|
10671
|
+
Object.defineProperty(exports, 'MsgBatchCancelSpotOrdersV2', {
|
|
10672
|
+
enumerable: true,
|
|
10673
|
+
get: function () {
|
|
10674
|
+
return MsgBatchCancelSpotOrdersV2;
|
|
10675
|
+
}
|
|
10676
|
+
});
|
|
8223
10677
|
Object.defineProperty(exports, 'MsgBatchUpdateOrders', {
|
|
8224
10678
|
enumerable: true,
|
|
8225
10679
|
get: function () {
|
|
8226
10680
|
return MsgBatchUpdateOrders;
|
|
8227
10681
|
}
|
|
8228
10682
|
});
|
|
10683
|
+
Object.defineProperty(exports, 'MsgBatchUpdateOrdersV2', {
|
|
10684
|
+
enumerable: true,
|
|
10685
|
+
get: function () {
|
|
10686
|
+
return MsgBatchUpdateOrdersV2;
|
|
10687
|
+
}
|
|
10688
|
+
});
|
|
8229
10689
|
Object.defineProperty(exports, 'MsgBeginRedelegate', {
|
|
8230
10690
|
enumerable: true,
|
|
8231
10691
|
get: function () {
|
|
@@ -8250,12 +10710,24 @@ Object.defineProperty(exports, 'MsgCancelBinaryOptionsOrder', {
|
|
|
8250
10710
|
return MsgCancelBinaryOptionsOrder;
|
|
8251
10711
|
}
|
|
8252
10712
|
});
|
|
10713
|
+
Object.defineProperty(exports, 'MsgCancelBinaryOptionsOrderV2', {
|
|
10714
|
+
enumerable: true,
|
|
10715
|
+
get: function () {
|
|
10716
|
+
return MsgCancelBinaryOptionsOrderV2;
|
|
10717
|
+
}
|
|
10718
|
+
});
|
|
8253
10719
|
Object.defineProperty(exports, 'MsgCancelDerivativeOrder', {
|
|
8254
10720
|
enumerable: true,
|
|
8255
10721
|
get: function () {
|
|
8256
10722
|
return MsgCancelDerivativeOrder;
|
|
8257
10723
|
}
|
|
8258
10724
|
});
|
|
10725
|
+
Object.defineProperty(exports, 'MsgCancelDerivativeOrderV2', {
|
|
10726
|
+
enumerable: true,
|
|
10727
|
+
get: function () {
|
|
10728
|
+
return MsgCancelDerivativeOrderV2;
|
|
10729
|
+
}
|
|
10730
|
+
});
|
|
8259
10731
|
Object.defineProperty(exports, 'MsgCancelPostOnlyModeV2', {
|
|
8260
10732
|
enumerable: true,
|
|
8261
10733
|
get: function () {
|
|
@@ -8268,6 +10740,12 @@ Object.defineProperty(exports, 'MsgCancelSpotOrder', {
|
|
|
8268
10740
|
return MsgCancelSpotOrder;
|
|
8269
10741
|
}
|
|
8270
10742
|
});
|
|
10743
|
+
Object.defineProperty(exports, 'MsgCancelSpotOrderV2', {
|
|
10744
|
+
enumerable: true,
|
|
10745
|
+
get: function () {
|
|
10746
|
+
return MsgCancelSpotOrderV2;
|
|
10747
|
+
}
|
|
10748
|
+
});
|
|
8271
10749
|
Object.defineProperty(exports, 'MsgCancelUnbondingDelegation', {
|
|
8272
10750
|
enumerable: true,
|
|
8273
10751
|
get: function () {
|
|
@@ -8292,12 +10770,24 @@ Object.defineProperty(exports, 'MsgCreateBinaryOptionsLimitOrder', {
|
|
|
8292
10770
|
return MsgCreateBinaryOptionsLimitOrder;
|
|
8293
10771
|
}
|
|
8294
10772
|
});
|
|
10773
|
+
Object.defineProperty(exports, 'MsgCreateBinaryOptionsLimitOrderV2', {
|
|
10774
|
+
enumerable: true,
|
|
10775
|
+
get: function () {
|
|
10776
|
+
return MsgCreateBinaryOptionsLimitOrderV2;
|
|
10777
|
+
}
|
|
10778
|
+
});
|
|
8295
10779
|
Object.defineProperty(exports, 'MsgCreateBinaryOptionsMarketOrder', {
|
|
8296
10780
|
enumerable: true,
|
|
8297
10781
|
get: function () {
|
|
8298
10782
|
return MsgCreateBinaryOptionsMarketOrder;
|
|
8299
10783
|
}
|
|
8300
10784
|
});
|
|
10785
|
+
Object.defineProperty(exports, 'MsgCreateBinaryOptionsMarketOrderV2', {
|
|
10786
|
+
enumerable: true,
|
|
10787
|
+
get: function () {
|
|
10788
|
+
return MsgCreateBinaryOptionsMarketOrderV2;
|
|
10789
|
+
}
|
|
10790
|
+
});
|
|
8301
10791
|
Object.defineProperty(exports, 'MsgCreateDenom', {
|
|
8302
10792
|
enumerable: true,
|
|
8303
10793
|
get: function () {
|
|
@@ -8310,12 +10800,24 @@ Object.defineProperty(exports, 'MsgCreateDerivativeLimitOrder', {
|
|
|
8310
10800
|
return MsgCreateDerivativeLimitOrder;
|
|
8311
10801
|
}
|
|
8312
10802
|
});
|
|
10803
|
+
Object.defineProperty(exports, 'MsgCreateDerivativeLimitOrderV2', {
|
|
10804
|
+
enumerable: true,
|
|
10805
|
+
get: function () {
|
|
10806
|
+
return MsgCreateDerivativeLimitOrderV2;
|
|
10807
|
+
}
|
|
10808
|
+
});
|
|
8313
10809
|
Object.defineProperty(exports, 'MsgCreateDerivativeMarketOrder', {
|
|
8314
10810
|
enumerable: true,
|
|
8315
10811
|
get: function () {
|
|
8316
10812
|
return MsgCreateDerivativeMarketOrder;
|
|
8317
10813
|
}
|
|
8318
10814
|
});
|
|
10815
|
+
Object.defineProperty(exports, 'MsgCreateDerivativeMarketOrderV2', {
|
|
10816
|
+
enumerable: true,
|
|
10817
|
+
get: function () {
|
|
10818
|
+
return MsgCreateDerivativeMarketOrderV2;
|
|
10819
|
+
}
|
|
10820
|
+
});
|
|
8319
10821
|
Object.defineProperty(exports, 'MsgCreateInsuranceFund', {
|
|
8320
10822
|
enumerable: true,
|
|
8321
10823
|
get: function () {
|
|
@@ -8340,18 +10842,36 @@ Object.defineProperty(exports, 'MsgCreateSpotLimitOrder', {
|
|
|
8340
10842
|
return MsgCreateSpotLimitOrder;
|
|
8341
10843
|
}
|
|
8342
10844
|
});
|
|
10845
|
+
Object.defineProperty(exports, 'MsgCreateSpotLimitOrderV2', {
|
|
10846
|
+
enumerable: true,
|
|
10847
|
+
get: function () {
|
|
10848
|
+
return MsgCreateSpotLimitOrderV2;
|
|
10849
|
+
}
|
|
10850
|
+
});
|
|
8343
10851
|
Object.defineProperty(exports, 'MsgCreateSpotMarketOrder', {
|
|
8344
10852
|
enumerable: true,
|
|
8345
10853
|
get: function () {
|
|
8346
10854
|
return MsgCreateSpotMarketOrder;
|
|
8347
10855
|
}
|
|
8348
10856
|
});
|
|
10857
|
+
Object.defineProperty(exports, 'MsgCreateSpotMarketOrderV2', {
|
|
10858
|
+
enumerable: true,
|
|
10859
|
+
get: function () {
|
|
10860
|
+
return MsgCreateSpotMarketOrderV2;
|
|
10861
|
+
}
|
|
10862
|
+
});
|
|
8349
10863
|
Object.defineProperty(exports, 'MsgCreateValidator', {
|
|
8350
10864
|
enumerable: true,
|
|
8351
10865
|
get: function () {
|
|
8352
10866
|
return MsgCreateValidator;
|
|
8353
10867
|
}
|
|
8354
10868
|
});
|
|
10869
|
+
Object.defineProperty(exports, 'MsgDecreasePositionMarginV2', {
|
|
10870
|
+
enumerable: true,
|
|
10871
|
+
get: function () {
|
|
10872
|
+
return MsgDecreasePositionMarginV2;
|
|
10873
|
+
}
|
|
10874
|
+
});
|
|
8355
10875
|
Object.defineProperty(exports, 'MsgDelegate', {
|
|
8356
10876
|
enumerable: true,
|
|
8357
10877
|
get: function () {
|
|
@@ -8370,6 +10890,12 @@ Object.defineProperty(exports, 'MsgDeposit$1', {
|
|
|
8370
10890
|
return MsgDeposit$1;
|
|
8371
10891
|
}
|
|
8372
10892
|
});
|
|
10893
|
+
Object.defineProperty(exports, 'MsgDepositV2', {
|
|
10894
|
+
enumerable: true,
|
|
10895
|
+
get: function () {
|
|
10896
|
+
return MsgDepositV2;
|
|
10897
|
+
}
|
|
10898
|
+
});
|
|
8373
10899
|
Object.defineProperty(exports, 'MsgEditValidator', {
|
|
8374
10900
|
enumerable: true,
|
|
8375
10901
|
get: function () {
|
|
@@ -8394,6 +10920,12 @@ Object.defineProperty(exports, 'MsgExternalTransfer', {
|
|
|
8394
10920
|
return MsgExternalTransfer;
|
|
8395
10921
|
}
|
|
8396
10922
|
});
|
|
10923
|
+
Object.defineProperty(exports, 'MsgExternalTransferV2', {
|
|
10924
|
+
enumerable: true,
|
|
10925
|
+
get: function () {
|
|
10926
|
+
return MsgExternalTransferV2;
|
|
10927
|
+
}
|
|
10928
|
+
});
|
|
8397
10929
|
Object.defineProperty(exports, 'MsgFundCommunityPool', {
|
|
8398
10930
|
enumerable: true,
|
|
8399
10931
|
get: function () {
|
|
@@ -8424,18 +10956,36 @@ Object.defineProperty(exports, 'MsgGrantWithAuthorization', {
|
|
|
8424
10956
|
return MsgGrantWithAuthorization;
|
|
8425
10957
|
}
|
|
8426
10958
|
});
|
|
10959
|
+
Object.defineProperty(exports, 'MsgIncreasePositionMarginV2', {
|
|
10960
|
+
enumerable: true,
|
|
10961
|
+
get: function () {
|
|
10962
|
+
return MsgIncreasePositionMarginV2;
|
|
10963
|
+
}
|
|
10964
|
+
});
|
|
8427
10965
|
Object.defineProperty(exports, 'MsgInstantBinaryOptionsMarketLaunch', {
|
|
8428
10966
|
enumerable: true,
|
|
8429
10967
|
get: function () {
|
|
8430
10968
|
return MsgInstantBinaryOptionsMarketLaunch;
|
|
8431
10969
|
}
|
|
8432
10970
|
});
|
|
10971
|
+
Object.defineProperty(exports, 'MsgInstantBinaryOptionsMarketLaunchV2', {
|
|
10972
|
+
enumerable: true,
|
|
10973
|
+
get: function () {
|
|
10974
|
+
return MsgInstantBinaryOptionsMarketLaunchV2;
|
|
10975
|
+
}
|
|
10976
|
+
});
|
|
8433
10977
|
Object.defineProperty(exports, 'MsgInstantSpotMarketLaunch', {
|
|
8434
10978
|
enumerable: true,
|
|
8435
10979
|
get: function () {
|
|
8436
10980
|
return MsgInstantSpotMarketLaunch;
|
|
8437
10981
|
}
|
|
8438
10982
|
});
|
|
10983
|
+
Object.defineProperty(exports, 'MsgInstantSpotMarketLaunchV2', {
|
|
10984
|
+
enumerable: true,
|
|
10985
|
+
get: function () {
|
|
10986
|
+
return MsgInstantSpotMarketLaunchV2;
|
|
10987
|
+
}
|
|
10988
|
+
});
|
|
8439
10989
|
Object.defineProperty(exports, 'MsgInstantiateContract', {
|
|
8440
10990
|
enumerable: true,
|
|
8441
10991
|
get: function () {
|
|
@@ -8448,6 +10998,12 @@ Object.defineProperty(exports, 'MsgLiquidatePosition', {
|
|
|
8448
10998
|
return MsgLiquidatePosition;
|
|
8449
10999
|
}
|
|
8450
11000
|
});
|
|
11001
|
+
Object.defineProperty(exports, 'MsgLiquidatePositionV2', {
|
|
11002
|
+
enumerable: true,
|
|
11003
|
+
get: function () {
|
|
11004
|
+
return MsgLiquidatePositionV2;
|
|
11005
|
+
}
|
|
11006
|
+
});
|
|
8451
11007
|
Object.defineProperty(exports, 'MsgMigrateContract', {
|
|
8452
11008
|
enumerable: true,
|
|
8453
11009
|
get: function () {
|
|
@@ -8478,6 +11034,12 @@ Object.defineProperty(exports, 'MsgReclaimLockedFunds', {
|
|
|
8478
11034
|
return MsgReclaimLockedFunds;
|
|
8479
11035
|
}
|
|
8480
11036
|
});
|
|
11037
|
+
Object.defineProperty(exports, 'MsgReclaimLockedFundsV2', {
|
|
11038
|
+
enumerable: true,
|
|
11039
|
+
get: function () {
|
|
11040
|
+
return MsgReclaimLockedFundsV2;
|
|
11041
|
+
}
|
|
11042
|
+
});
|
|
8481
11043
|
Object.defineProperty(exports, 'MsgRelayProviderPrices', {
|
|
8482
11044
|
enumerable: true,
|
|
8483
11045
|
get: function () {
|
|
@@ -8514,6 +11076,12 @@ Object.defineProperty(exports, 'MsgRewardsOptOut', {
|
|
|
8514
11076
|
return MsgRewardsOptOut;
|
|
8515
11077
|
}
|
|
8516
11078
|
});
|
|
11079
|
+
Object.defineProperty(exports, 'MsgRewardsOptOutV2', {
|
|
11080
|
+
enumerable: true,
|
|
11081
|
+
get: function () {
|
|
11082
|
+
return MsgRewardsOptOutV2;
|
|
11083
|
+
}
|
|
11084
|
+
});
|
|
8517
11085
|
Object.defineProperty(exports, 'MsgSend', {
|
|
8518
11086
|
enumerable: true,
|
|
8519
11087
|
get: function () {
|
|
@@ -8538,6 +11106,12 @@ Object.defineProperty(exports, 'MsgSetDenomMetadata', {
|
|
|
8538
11106
|
return MsgSetDenomMetadata;
|
|
8539
11107
|
}
|
|
8540
11108
|
});
|
|
11109
|
+
Object.defineProperty(exports, 'MsgSignDataV2', {
|
|
11110
|
+
enumerable: true,
|
|
11111
|
+
get: function () {
|
|
11112
|
+
return MsgSignDataV2;
|
|
11113
|
+
}
|
|
11114
|
+
});
|
|
8541
11115
|
Object.defineProperty(exports, 'MsgStoreCode', {
|
|
8542
11116
|
enumerable: true,
|
|
8543
11117
|
get: function () {
|
|
@@ -8670,6 +11244,12 @@ Object.defineProperty(exports, 'MsgWithdrawDelegatorReward', {
|
|
|
8670
11244
|
return MsgWithdrawDelegatorReward;
|
|
8671
11245
|
}
|
|
8672
11246
|
});
|
|
11247
|
+
Object.defineProperty(exports, 'MsgWithdrawV2', {
|
|
11248
|
+
enumerable: true,
|
|
11249
|
+
get: function () {
|
|
11250
|
+
return MsgWithdrawV2;
|
|
11251
|
+
}
|
|
11252
|
+
});
|
|
8673
11253
|
Object.defineProperty(exports, 'MsgWithdrawValidatorCommission', {
|
|
8674
11254
|
enumerable: true,
|
|
8675
11255
|
get: function () {
|