@injectivelabs/sdk-ts 1.20.67 → 1.21.0-alpha.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (110) hide show
  1. package/README.md +25 -0
  2. package/dist/cjs/{BaseGrpcConsumer-DVDjYQks.d.cts → BaseGrpcConsumer-CRYBdXm9.d.cts} +1 -1
  3. package/dist/cjs/{ChainGrpcExchangeApi-DEoO0jhR.cjs → ChainGrpcExchangeApi-D2diaVMC.cjs} +2 -73
  4. package/dist/cjs/{ChainRestTendermintApi-BkHzZIRZ.cjs → ChainRestTendermintApi-BSGN-XV3.cjs} +2 -2
  5. package/dist/cjs/{DirectEthSecp256k1Wallet-DfvrKuF8.cjs → DirectEthSecp256k1Wallet-CsOHUTrG.cjs} +1 -1
  6. package/dist/cjs/{ExecArgNeptuneWithdraw-BJHAQJlT.cjs → ExecArgNeptuneWithdraw-CHK2kF7l.cjs} +2 -2
  7. package/dist/cjs/{IndexerGrpcWeb3GwApi-C9VUHKOj.cjs → IndexerGrpcWeb3GwApi-BaCa4M1S.cjs} +4 -2
  8. package/dist/cjs/{MsgBase-jNBijPHQ.cjs → MsgBase-Dt0pa34P.cjs} +93 -36
  9. package/dist/cjs/{MsgSetDenomMetadata-Did-0k6O.cjs → MsgSetDenomMetadata-BKnmW-f2.cjs} +3361 -4248
  10. package/dist/cjs/{QueryTradingStrategyContractTotalStrategies-B3pcJep3.cjs → QueryTradingStrategyContractTotalStrategies-BiIzwy-H.cjs} +2 -2
  11. package/dist/cjs/{StreamManagerV2-DRWQ5QH0.cjs → StreamManagerV2-DftPsZ02.cjs} +2 -2
  12. package/dist/cjs/{accounts-BeV7wTTf.cjs → accounts-C6QIpAkP.cjs} +22 -2
  13. package/dist/cjs/{chain-B3HLDM4b.cjs → chain-D4Z7pAD0.cjs} +120 -206
  14. package/dist/cjs/client/abacus.d.cts +5 -5
  15. package/dist/cjs/client/chain.cjs +4 -5
  16. package/dist/cjs/client/chain.d.cts +12 -12
  17. package/dist/cjs/client/indexer.cjs +3 -3
  18. package/dist/cjs/client/indexer.d.cts +12 -12
  19. package/dist/cjs/client/olp.d.cts +5 -5
  20. package/dist/cjs/client/platformServices.d.cts +5 -5
  21. package/dist/cjs/client/tcAbacus.d.cts +5 -5
  22. package/dist/cjs/client/wasm.cjs +7 -7
  23. package/dist/cjs/client/wasm.d.cts +4 -4
  24. package/dist/cjs/core/accounts.cjs +3 -3
  25. package/dist/cjs/core/accounts.d.cts +11 -11
  26. package/dist/cjs/core/modules.cjs +15 -23
  27. package/dist/cjs/core/modules.d.cts +12 -12
  28. package/dist/cjs/core/tx.cjs +7 -6
  29. package/dist/cjs/core/tx.d.cts +12 -12
  30. package/dist/cjs/cosmjs.cjs +7 -7
  31. package/dist/cjs/cosmjs.d.cts +2 -2
  32. package/dist/cjs/exports.cjs +7 -7
  33. package/dist/cjs/exports.d.cts +2 -2
  34. package/dist/cjs/{index-BtwpJOwb.d.cts → index-5s92DIT3.d.cts} +1 -1
  35. package/dist/{esm/index-B4-RPlmi.d.ts → cjs/index-B7LT8B2g.d.cts} +25673 -26257
  36. package/dist/cjs/{index-CfGvB4c1.d.cts → index-BNqPdwIL.d.cts} +1 -1
  37. package/dist/cjs/{index-iLM1noAM.d.cts → index-ByaAgMci.d.cts} +1 -1
  38. package/dist/{esm/index-CTEvW2RT.d.ts → cjs/index-CBEIfBLI.d.cts} +34 -84
  39. package/dist/{esm/index--I7NYLY5.d.ts → cjs/index-CKFM2Zot.d.cts} +35 -350
  40. package/dist/cjs/{index-Beskv_ry.d.cts → index-CcNtmgW5.d.cts} +2 -2
  41. package/dist/cjs/{index-Bv-5dlo_.d.cts → index-DzI7PClu.d.cts} +1 -1
  42. package/dist/cjs/{index-CY06tllr.d.cts → index-fb-zX9fQ.d.cts} +1 -1
  43. package/dist/cjs/index.cjs +19 -27
  44. package/dist/cjs/index.d.cts +12 -12
  45. package/dist/{esm/light-BFGvKXwS.d.ts → cjs/light-Dyi8qJP_.d.cts} +3 -0
  46. package/dist/cjs/proto/cosmos-tx.d.cts +1 -1
  47. package/dist/cjs/service.cjs +1 -1
  48. package/dist/cjs/service.d.cts +4 -4
  49. package/dist/cjs/{tx-C8efeicO.cjs → tx-U8W1g3W8.cjs} +4 -4
  50. package/dist/cjs/{tx_pb-DSDGNMKS.d.cts → tx_pb-rX24LEP1.d.cts} +58 -107
  51. package/dist/cjs/types/light.d.cts +1 -1
  52. package/dist/cjs/types.d.cts +3 -3
  53. package/dist/cjs/{utils-DZoXzNOj.cjs → utils-CjlVVckg.cjs} +14 -24
  54. package/dist/cjs/utils.cjs +1 -1
  55. package/dist/cjs/utils.d.cts +11 -11
  56. package/dist/esm/{BaseGrpcConsumer-DzOno3EM.d.ts → BaseGrpcConsumer-BfhC9A-3.d.ts} +1 -1
  57. package/dist/esm/{ChainGrpcExchangeApi-N27wNM6N.js → ChainGrpcExchangeApi-YNNZqhBt.js} +2 -73
  58. package/dist/esm/{ChainRestTendermintApi-CfvwCl2L.js → ChainRestTendermintApi-DGLg38SO.js} +2 -2
  59. package/dist/esm/{DirectEthSecp256k1Wallet-Cq8NYHKd.js → DirectEthSecp256k1Wallet-mXW_mPaC.js} +1 -1
  60. package/dist/esm/{ExecArgNeptuneWithdraw-BRrsGhPy.js → ExecArgNeptuneWithdraw-CpaH5nlc.js} +2 -2
  61. package/dist/esm/{IndexerGrpcWeb3GwApi-CG_ZevUX.js → IndexerGrpcWeb3GwApi-BaQI4k4D.js} +4 -2
  62. package/dist/esm/{MsgBase-BC3GNddA.js → MsgBase-D3okqFzc.js} +88 -37
  63. package/dist/esm/{MsgSetDenomMetadata-B7IN-5j2.js → MsgSetDenomMetadata-snSM4b_f.js} +900 -1738
  64. package/dist/esm/{QueryTradingStrategyContractTotalStrategies-DNbF4zfF.js → QueryTradingStrategyContractTotalStrategies-C5T8K9t0.js} +2 -2
  65. package/dist/esm/{StreamManagerV2-IyJuIDxz.js → StreamManagerV2-DayR_Wxb.js} +2 -2
  66. package/dist/esm/{accounts-D2h6m8BF.js → accounts-BNTm8lj5.js} +22 -2
  67. package/dist/esm/{chain-cb8a0SyE.js → chain-Bx2cRWCa.js} +141 -220
  68. package/dist/esm/client/abacus.d.ts +5 -5
  69. package/dist/esm/client/chain.d.ts +12 -12
  70. package/dist/esm/client/chain.js +5 -5
  71. package/dist/esm/client/indexer.d.ts +12 -12
  72. package/dist/esm/client/indexer.js +3 -3
  73. package/dist/esm/client/olp.d.ts +5 -5
  74. package/dist/esm/client/platformServices.d.ts +5 -5
  75. package/dist/esm/client/tcAbacus.d.ts +5 -5
  76. package/dist/esm/client/wasm.d.ts +4 -4
  77. package/dist/esm/client/wasm.js +7 -7
  78. package/dist/esm/core/accounts.d.ts +11 -11
  79. package/dist/esm/core/accounts.js +3 -3
  80. package/dist/esm/core/modules.d.ts +12 -12
  81. package/dist/esm/core/modules.js +10 -10
  82. package/dist/esm/core/tx.d.ts +12 -12
  83. package/dist/esm/core/tx.js +7 -7
  84. package/dist/esm/cosmjs.d.ts +2 -2
  85. package/dist/esm/cosmjs.js +7 -7
  86. package/dist/esm/exports.d.ts +2 -2
  87. package/dist/esm/exports.js +7 -7
  88. package/dist/esm/{index-DG-I0T6b.d.ts → index-BLlbbiGL.d.ts} +1 -1
  89. package/dist/{cjs/index-B8XGu-SI.d.cts → esm/index-BeikP7Cq.d.ts} +35 -350
  90. package/dist/esm/{index-B2tw9CHl.d.ts → index-CQGymzVV.d.ts} +1 -1
  91. package/dist/esm/{index-BtOljr6v.d.ts → index-DhhaPvLx.d.ts} +1 -1
  92. package/dist/{cjs/index-4IPdy0bE.d.cts → esm/index-DjAbTs6N.d.ts} +34 -84
  93. package/dist/{cjs/index-Zlg1uSyt.d.cts → esm/index-DyuSCKzD.d.ts} +25673 -26257
  94. package/dist/esm/{index-CJxCX4wl.d.ts → index-KPxccQ6b.d.ts} +1 -1
  95. package/dist/esm/{index-BHELcAAg.d.ts → index-SCzTXWme.d.ts} +2 -2
  96. package/dist/esm/{index-OpqhooKr.d.ts → index-c0wEF5XN.d.ts} +1 -1
  97. package/dist/esm/index.d.ts +12 -12
  98. package/dist/esm/index.js +13 -13
  99. package/dist/{cjs/light-B-3BDUJ7.d.cts → esm/light-cJI0PSqu.d.ts} +3 -0
  100. package/dist/esm/proto/cosmos-tx.d.ts +1 -1
  101. package/dist/esm/service.d.ts +4 -4
  102. package/dist/esm/service.js +1 -1
  103. package/dist/esm/{tx-C9bEwXA1.js → tx-COcI7kYx.js} +4 -4
  104. package/dist/esm/{tx_pb-Blty6MDM.d.ts → tx_pb-pR8s8ZkE.d.ts} +58 -107
  105. package/dist/esm/types/light.d.ts +1 -1
  106. package/dist/esm/types.d.ts +3 -3
  107. package/dist/esm/{utils-Cs0fKB6M.js → utils-Bprop_i9.js} +14 -24
  108. package/dist/esm/utils.d.ts +11 -11
  109. package/dist/esm/utils.js +1 -1
  110. package/package.json +6 -6
@@ -1,11 +1,12 @@
1
1
  import { f as toUtf8, i as concatUint8Arrays, l as hexToUint8Array, m as uint8ArrayToHex, o as fromUtf8, p as uint8ArrayToBase64, r as binaryToBase64, t as base64ToUint8Array, u as stringToUint8Array } from "./encoding-light-BpntDob-.js";
2
2
  import { t as _defineProperty } from "./defineProperty-BwBXXd7t.js";
3
- import { I as Address, j as createAny } from "./accounts-D2h6m8BF.js";
4
- import { J as numberToCosmosSdkDecString, bt as bigIntToString, jt as safeBigIntStringify, lt as messageHash, st as domainHash } from "./utils-Cs0fKB6M.js";
3
+ import { I as Address, j as createAny } from "./accounts-BNTm8lj5.js";
4
+ import { J as numberToCosmosSdkDecString, bt as bigIntToString, jt as safeBigIntStringify, lt as messageHash, st as domainHash } from "./utils-Bprop_i9.js";
5
+ import { s as OracleTypeMap } from "./light-BUFhVek8.js";
5
6
  import { a as getEthereumAddress } from "./address-light-CwLNB73Y.js";
6
- import { a as objectKeysToEip712Types, n as prepareSignBytes, o as patchOrderTypesWithExpirationBlock, t as MsgBase } from "./MsgBase-BC3GNddA.js";
7
- import { t as ChainGrpcExchangeApi } from "./ChainGrpcExchangeApi-N27wNM6N.js";
8
- import { a as dataToExecData$1, i as ExecArgBase } from "./ExecArgNeptuneWithdraw-BRrsGhPy.js";
7
+ import { i as graftEip712Types, n as prepareSignBytes, o as objectKeysToEip712Types, s as patchOrderTypesWithExpirationBlock, t as MsgBase } from "./MsgBase-D3okqFzc.js";
8
+ import { t as ChainGrpcExchangeApi } from "./ChainGrpcExchangeApi-YNNZqhBt.js";
9
+ import { a as dataToExecData$1, i as ExecArgBase } from "./ExecArgNeptuneWithdraw-CpaH5nlc.js";
9
10
  import { keccak256 } from "viem";
10
11
  import { BigNumber, DEFAULT_BRIDGE_FEE_AMOUNT, DEFAULT_BRIDGE_FEE_DENOM, toBigNumber, toChainFormat, toPascalCase } from "@injectivelabs/utils";
11
12
  import { GeneralException } from "@injectivelabs/exceptions";
@@ -13,15 +14,16 @@ import * as GoogleProtobufAnyPbPb from "@injectivelabs/core-proto-ts-v2/generate
13
14
  import * as CosmosBaseV1Beta1CoinPb from "@injectivelabs/core-proto-ts-v2/generated/cosmos/base/v1beta1/coin_pb";
14
15
  import * as InjectiveExchangeV1Beta1TxPb from "@injectivelabs/core-proto-ts-v2/generated/injective/exchange/v1beta1/tx_pb";
15
16
  import * as InjectiveExchangeV2TxPb from "@injectivelabs/core-proto-ts-v2/generated/injective/exchange/v2/tx_pb";
17
+ import { ScalarType } from "@protobuf-ts/runtime";
16
18
  import * as InjectiveExchangeV1Beta1ExchangePb from "@injectivelabs/core-proto-ts-v2/generated/injective/exchange/v1beta1/exchange_pb";
17
19
  import * as InjectiveExchangeV2OrderPb from "@injectivelabs/core-proto-ts-v2/generated/injective/exchange/v2/order_pb";
18
20
  import * as InjectiveExchangeV2ProposalPb from "@injectivelabs/core-proto-ts-v2/generated/injective/exchange/v2/proposal_pb";
21
+ import { ReferencePriceSource } from "@injectivelabs/core-proto-ts-v2/generated/injective/exchange/v2/market_pb";
19
22
  import * as InjectiveExchangeV2ExchangePb from "@injectivelabs/core-proto-ts-v2/generated/injective/exchange/v2/exchange_pb";
20
- import * as InjectiveOracleV1Beta1OraclePb from "@injectivelabs/core-proto-ts-v2/generated/injective/oracle/v1beta1/oracle_pb";
21
- import * as InjectiveExchangeV2MarketPb from "@injectivelabs/core-proto-ts-v2/generated/injective/exchange/v2/market_pb";
22
23
  import { getNetworkEndpoints } from "@injectivelabs/networks";
23
24
  import * as CosmosGovV1GovPb from "@injectivelabs/core-proto-ts-v2/generated/cosmos/gov/v1/gov_pb";
24
25
  import * as CosmwasmWasmV1TypesPb from "@injectivelabs/core-proto-ts-v2/generated/cosmwasm/wasm/v1/types_pb";
26
+ import * as InjectiveOracleV1Beta1OraclePb from "@injectivelabs/core-proto-ts-v2/generated/injective/oracle/v1beta1/oracle_pb";
25
27
  import * as InjectivePermissionsV1Beta1PermissionsPb from "@injectivelabs/core-proto-ts-v2/generated/injective/permissions/v1beta1/permissions_pb";
26
28
  import * as CosmosAuthzV1Beta1AuthzPb from "@injectivelabs/core-proto-ts-v2/generated/cosmos/authz/v1beta1/authz_pb";
27
29
  import * as CosmosGovV1TxPb from "@injectivelabs/core-proto-ts-v2/generated/cosmos/gov/v1/tx_pb";
@@ -168,6 +170,138 @@ var MsgWithdraw = class MsgWithdraw extends MsgBase {
168
170
  }
169
171
  };
170
172
 
173
+ //#endregion
174
+ //#region src/core/tx/amino/toAminoJson.ts
175
+ const LONG_SCALARS = new Set([
176
+ ScalarType.INT64,
177
+ ScalarType.UINT64,
178
+ ScalarType.FIXED64,
179
+ ScalarType.SFIXED64,
180
+ ScalarType.SINT64
181
+ ]);
182
+ const UNSUPPORTED_MESSAGE_OPTIONS = ["amino.message_encoding"];
183
+ const UNSUPPORTED_FIELD_OPTIONS = ["amino.field_name"];
184
+ const SUPPORTED_FIELD_ENCODINGS = ["legacy_coins"];
185
+ const UNSUPPORTED_SCALARS = ["cosmos.Dec"];
186
+ const assertSupported = (type, field) => {
187
+ var _field$options, _field$options3, _field$options4;
188
+ const encoding = field === null || field === void 0 || (_field$options = field.options) === null || _field$options === void 0 ? void 0 : _field$options["amino.encoding"];
189
+ const unsupported = field ? [
190
+ ...UNSUPPORTED_FIELD_OPTIONS.filter((o) => {
191
+ var _field$options2;
192
+ return (_field$options2 = field.options) === null || _field$options2 === void 0 ? void 0 : _field$options2[o];
193
+ }),
194
+ ...encoding && !SUPPORTED_FIELD_ENCODINGS.includes(encoding) ? [`amino.encoding=${encoding}`] : [],
195
+ ...UNSUPPORTED_SCALARS.includes((_field$options3 = field.options) === null || _field$options3 === void 0 ? void 0 : _field$options3["cosmos_proto.scalar"]) ? [`cosmos_proto.scalar=${(_field$options4 = field.options) === null || _field$options4 === void 0 ? void 0 : _field$options4["cosmos_proto.scalar"]}`] : []
196
+ ] : UNSUPPORTED_MESSAGE_OPTIONS.filter((o) => {
197
+ var _type$options;
198
+ return (_type$options = type.options) === null || _type$options === void 0 ? void 0 : _type$options[o];
199
+ });
200
+ if (unsupported.length > 0) throw new GeneralException(/* @__PURE__ */ new Error(`toAminoJson: ${type.typeName}${field ? `.${field.name}` : ""} uses unsupported amino option(s) ${unsupported.join(", ")}`));
201
+ };
202
+ const ANY_TYPE_NAME = "google.protobuf.Any";
203
+ const UNSUPPORTED_WELL_KNOWN = new Set(["google.protobuf.Timestamp", "google.protobuf.Duration"]);
204
+ /** Checks the entire schema, including fields absent from the current value. */
205
+ const assertAminoJsonSupported = (type, seen = /* @__PURE__ */ new Set()) => {
206
+ if (seen.has(type.typeName)) return;
207
+ seen.add(type.typeName);
208
+ assertSupported(type);
209
+ if (UNSUPPORTED_WELL_KNOWN.has(type.typeName)) throw new GeneralException(/* @__PURE__ */ new Error(`toAminoJson: ${type.typeName} is not supported`));
210
+ for (const field of type.fields) {
211
+ assertSupported(type, field);
212
+ if (field.kind === "map") throw new GeneralException(/* @__PURE__ */ new Error(`toAminoJson: map fields are not supported (${field.name})`));
213
+ if (field.kind === "message") assertAminoJsonSupported(field.T(), seen);
214
+ }
215
+ };
216
+ const toUpperCamel = (name) => name.split("_").map((part) => part.charAt(0).toUpperCase() + part.slice(1)).join("");
217
+ const isZeroScalar = (field, value) => {
218
+ if (field.kind !== "scalar" && field.kind !== "enum") return false;
219
+ if (value === void 0 || value === null) return true;
220
+ if (field.kind === "scalar" && field.T === ScalarType.BOOL) return value === false;
221
+ if (field.kind === "scalar" && field.T === ScalarType.BYTES) return value.length === 0;
222
+ if (typeof value === "string") return field.kind === "scalar" && LONG_SCALARS.has(field.T) ? value === "0" : value === "";
223
+ return value === 0 || value === 0n;
224
+ };
225
+ const encodeScalar = (field, value) => {
226
+ var _field$options5;
227
+ if (field.kind === "enum") return value;
228
+ if (((_field$options5 = field.options) === null || _field$options5 === void 0 ? void 0 : _field$options5["cosmos_proto.scalar"]) === "cosmos.Int") return value === "" || value === void 0 ? "0" : value;
229
+ const type = field.kind === "scalar" ? field.T : void 0;
230
+ if (type !== void 0 && LONG_SCALARS.has(type)) return String(value);
231
+ if (type === ScalarType.BYTES) return uint8ArrayToBase64(value);
232
+ return value;
233
+ };
234
+ const encodeValue = (field, value, anyTypes) => {
235
+ if (field.kind === "message") {
236
+ const type = field.T();
237
+ if (type.typeName === ANY_TYPE_NAME) return encodeAny(value, anyTypes);
238
+ return encodeMessage(type, value, anyTypes);
239
+ }
240
+ return encodeScalar(field, value);
241
+ };
242
+ const encodeAny = (any, anyTypes) => {
243
+ const type = anyTypes[any.typeUrl];
244
+ if (!type) throw new GeneralException(/* @__PURE__ */ new Error(`toAminoJson: unknown Any type ${any.typeUrl}`));
245
+ return toAminoJson(type, type.fromBinary(any.value), anyTypes);
246
+ };
247
+ const encodeMessage = (type, message, anyTypes) => {
248
+ const output = {};
249
+ const oneofsWritten = /* @__PURE__ */ new Set();
250
+ for (const field of type.fields) {
251
+ var _field$options6;
252
+ const dontOmitEmpty = ((_field$options6 = field.options) === null || _field$options6 === void 0 ? void 0 : _field$options6["amino.dont_omitempty"]) === true;
253
+ if (field.oneof) {
254
+ var _field$options7;
255
+ const oneof = message[field.oneof];
256
+ const wrapperKey = toUpperCamel(field.oneof);
257
+ if (!oneof || oneof.oneofKind === void 0) {
258
+ if (!oneofsWritten.has(field.oneof)) {
259
+ output[wrapperKey] = null;
260
+ oneofsWritten.add(field.oneof);
261
+ }
262
+ continue;
263
+ }
264
+ if (oneof.oneofKind !== field.localName) continue;
265
+ output[wrapperKey] = {
266
+ type: (_field$options7 = field.options) === null || _field$options7 === void 0 ? void 0 : _field$options7["amino.oneof_name"],
267
+ value: { [field.name]: encodeValue(field, oneof[field.localName], anyTypes) }
268
+ };
269
+ continue;
270
+ }
271
+ const value = message[field.localName];
272
+ if (field.repeat) {
273
+ if (!value || value.length === 0) {
274
+ if (dontOmitEmpty) output[field.name] = [];
275
+ continue;
276
+ }
277
+ output[field.name] = value.map((v) => encodeValue(field, v, anyTypes));
278
+ continue;
279
+ }
280
+ if (field.kind === "message") {
281
+ if (value === void 0 || value === null) {
282
+ if (dontOmitEmpty) throw new GeneralException(/* @__PURE__ */ new Error(`toAminoJson: ${type.typeName}.${field.name} is dont_omitempty but unset`));
283
+ continue;
284
+ }
285
+ } else if (isZeroScalar(field, value) && !dontOmitEmpty) continue;
286
+ output[field.name] = encodeValue(field, value, anyTypes);
287
+ }
288
+ return output;
289
+ };
290
+ const checkedTypes = /* @__PURE__ */ new WeakSet();
291
+ /** amino-json of a top-level (signable) message: `{ type: <amino.name>, value }` */
292
+ const toAminoJson = (type, message, anyTypes = {}) => {
293
+ const aminoName = type.options["amino.name"];
294
+ if (typeof aminoName !== "string") throw new GeneralException(/* @__PURE__ */ new Error(`toAminoJson: ${type.typeName} has no amino.name`));
295
+ if (!checkedTypes.has(type)) {
296
+ assertAminoJsonSupported(type);
297
+ checkedTypes.add(type);
298
+ }
299
+ return {
300
+ type: aminoName,
301
+ value: encodeMessage(type, message, anyTypes)
302
+ };
303
+ };
304
+
171
305
  //#endregion
172
306
  //#region src/core/modules/exchange/msgs/MsgDepositV2.ts
173
307
  /**
@@ -197,9 +331,12 @@ var MsgDepositV2 = class MsgDepositV2 extends MsgBase {
197
331
  };
198
332
  }
199
333
  toAmino() {
334
+ return toAminoJson(InjectiveExchangeV2TxPb.MsgDeposit, this.toProto());
335
+ }
336
+ toAminoRaw() {
200
337
  const proto = this.toProto();
201
338
  return {
202
- type: "exchange/MsgDeposit",
339
+ type: "exchange/v2/MsgDeposit",
203
340
  value: {
204
341
  sender: proto.sender,
205
342
  subaccount_id: proto.subaccountId,
@@ -208,7 +345,7 @@ var MsgDepositV2 = class MsgDepositV2 extends MsgBase {
208
345
  };
209
346
  }
210
347
  toWeb3Gw() {
211
- const { value } = this.toAmino();
348
+ const { value } = this.toAminoRaw();
212
349
  return {
213
350
  "@type": "/injective.exchange.v2.MsgDeposit",
214
351
  ...value
@@ -305,9 +442,12 @@ var MsgWithdrawV2 = class MsgWithdrawV2 extends MsgBase {
305
442
  };
306
443
  }
307
444
  toAmino() {
445
+ return toAminoJson(InjectiveExchangeV2TxPb.MsgWithdraw, this.toProto());
446
+ }
447
+ toAminoRaw() {
308
448
  const proto = this.toProto();
309
449
  return {
310
- type: "exchange/MsgWithdraw",
450
+ type: "exchange/v2/MsgWithdraw",
311
451
  value: {
312
452
  sender: proto.sender,
313
453
  subaccount_id: proto.subaccountId,
@@ -316,7 +456,7 @@ var MsgWithdrawV2 = class MsgWithdrawV2 extends MsgBase {
316
456
  };
317
457
  }
318
458
  toWeb3Gw() {
319
- const { value } = this.toAmino();
459
+ const { value } = this.toAminoRaw();
320
460
  return {
321
461
  "@type": "/injective.exchange.v2.MsgWithdraw",
322
462
  ...value
@@ -333,50 +473,6 @@ var MsgWithdrawV2 = class MsgWithdrawV2 extends MsgBase {
333
473
  }
334
474
  };
335
475
 
336
- //#endregion
337
- //#region src/core/modules/exchange/msgs/MsgRewardsOptOut.ts
338
- /**
339
- * @category Messages
340
- */
341
- var MsgRewardsOptOut = class MsgRewardsOptOut extends MsgBase {
342
- static fromJSON(params) {
343
- return new MsgRewardsOptOut(params);
344
- }
345
- toProto() {
346
- const { params } = this;
347
- return InjectiveExchangeV1Beta1TxPb.MsgRewardsOptOut.create({ sender: params.sender });
348
- }
349
- toData() {
350
- const proto = this.toProto();
351
- return {
352
- "@type": "/injective.exchange.v1beta1.MsgRewardsOptOut",
353
- ...proto
354
- };
355
- }
356
- toAmino() {
357
- return {
358
- type: "exchange/MsgRewardsOptOut",
359
- value: { sender: this.toProto().sender }
360
- };
361
- }
362
- toWeb3Gw() {
363
- const { value } = this.toAmino();
364
- return {
365
- "@type": "/injective.exchange.v1beta1.MsgRewardsOptOut",
366
- ...value
367
- };
368
- }
369
- toDirectSign() {
370
- return {
371
- type: "/injective.exchange.v1beta1.MsgRewardsOptOut",
372
- message: this.toProto()
373
- };
374
- }
375
- toBinary() {
376
- return InjectiveExchangeV1Beta1TxPb.MsgRewardsOptOut.toBinary(this.toProto());
377
- }
378
- };
379
-
380
476
  //#endregion
381
477
  //#region src/core/modules/exchange/msgs/MsgCancelSpotOrder.ts
382
478
  /**
@@ -434,50 +530,6 @@ var MsgCancelSpotOrder = class MsgCancelSpotOrder extends MsgBase {
434
530
  }
435
531
  };
436
532
 
437
- //#endregion
438
- //#region src/core/modules/exchange/msgs/MsgRewardsOptOutV2.ts
439
- /**
440
- * @category Messages
441
- */
442
- var MsgRewardsOptOutV2 = class MsgRewardsOptOutV2 extends MsgBase {
443
- static fromJSON(params) {
444
- return new MsgRewardsOptOutV2(params);
445
- }
446
- toProto() {
447
- const { params } = this;
448
- return InjectiveExchangeV2TxPb.MsgRewardsOptOut.create({ sender: params.sender });
449
- }
450
- toData() {
451
- const proto = this.toProto();
452
- return {
453
- "@type": "/injective.exchange.v2.MsgRewardsOptOut",
454
- ...proto
455
- };
456
- }
457
- toAmino() {
458
- return {
459
- type: "exchange/MsgRewardsOptOut",
460
- value: { sender: this.toProto().sender }
461
- };
462
- }
463
- toWeb3Gw() {
464
- const { value } = this.toAmino();
465
- return {
466
- "@type": "/injective.exchange.v2.MsgRewardsOptOut",
467
- ...value
468
- };
469
- }
470
- toDirectSign() {
471
- return {
472
- type: "/injective.exchange.v2.MsgRewardsOptOut",
473
- message: this.toProto()
474
- };
475
- }
476
- toBinary() {
477
- return InjectiveExchangeV2TxPb.MsgRewardsOptOut.toBinary(this.toProto());
478
- }
479
- };
480
-
481
533
  //#endregion
482
534
  //#region src/core/modules/exchange/msgs/MsgExternalTransfer.ts
483
535
  /**
@@ -563,9 +615,12 @@ var MsgOffsetPositionV2 = class MsgOffsetPositionV2 extends MsgBase {
563
615
  };
564
616
  }
565
617
  toAmino() {
618
+ return toAminoJson(InjectiveExchangeV2TxPb.MsgOffsetPosition, this.toProto());
619
+ }
620
+ toAminoRaw() {
566
621
  const proto = this.toProto();
567
622
  return {
568
- type: "exchange/MsgOffsetPosition",
623
+ type: "exchange/v2/MsgOffsetPosition",
569
624
  value: {
570
625
  sender: proto.sender,
571
626
  subaccount_id: proto.subaccountId,
@@ -575,7 +630,7 @@ var MsgOffsetPositionV2 = class MsgOffsetPositionV2 extends MsgBase {
575
630
  };
576
631
  }
577
632
  toWeb3Gw() {
578
- const { value } = this.toAmino();
633
+ const { value } = this.toAminoRaw();
579
634
  return {
580
635
  "@type": "/injective.exchange.v2.MsgOffsetPosition",
581
636
  ...value
@@ -592,6 +647,19 @@ var MsgOffsetPositionV2 = class MsgOffsetPositionV2 extends MsgBase {
592
647
  }
593
648
  };
594
649
 
650
+ //#endregion
651
+ //#region src/core/modules/exchange/msgs/utils/binaryOptions.ts
652
+ /**
653
+ * Fails loudly for JS callers that still pass the retired binary-options batch fields. This
654
+ * guard can go in a later major release. The empty `binary_options_*` fields it protects in the
655
+ * signing payload cannot: they stay while core's MsgBatchUpdateOrders schema defines them.
656
+ */
657
+ const assertNoBinaryOptionsOrders = (params) => {
658
+ var _legacy$binaryOptions, _legacy$binaryOptions2, _legacy$binaryOptions3, _legacy$binaryOptions4;
659
+ const legacy = params;
660
+ if (((_legacy$binaryOptions = legacy.binaryOptionsOrdersToCancel) === null || _legacy$binaryOptions === void 0 ? void 0 : _legacy$binaryOptions.length) || ((_legacy$binaryOptions2 = legacy.binaryOptionsMarketIdsToCancelAll) === null || _legacy$binaryOptions2 === void 0 ? void 0 : _legacy$binaryOptions2.length) || ((_legacy$binaryOptions3 = legacy.binaryOptionsOrdersToCreate) === null || _legacy$binaryOptions3 === void 0 ? void 0 : _legacy$binaryOptions3.length) || ((_legacy$binaryOptions4 = legacy.binaryOptionsMarketOrdersToCreate) === null || _legacy$binaryOptions4 === void 0 ? void 0 : _legacy$binaryOptions4.length)) throw new GeneralException(/* @__PURE__ */ new Error("Binary options operations have been removed in v1.21"));
661
+ };
662
+
595
663
  //#endregion
596
664
  //#region src/core/modules/exchange/msgs/MsgBatchUpdateOrders.ts
597
665
  const createSpotOrder$1 = (args) => {
@@ -625,31 +693,15 @@ const createDerivativeOrder$1 = (args) => {
625
693
  triggerPrice: args.triggerPrice
626
694
  });
627
695
  };
628
- const createBinaryOptionOrder$1 = (args) => {
629
- const orderInfo = InjectiveExchangeV1Beta1ExchangePb.OrderInfo.create({
630
- subaccountId: args.subaccountId,
631
- feeRecipient: args.feeRecipient,
632
- price: args.price,
633
- quantity: args.quantity,
634
- cid: args.cid
635
- });
636
- return InjectiveExchangeV1Beta1ExchangePb.DerivativeOrder.create({
637
- marketId: args.marketId,
638
- orderType: args.orderType,
639
- orderInfo,
640
- margin: args.margin,
641
- triggerPrice: args.triggerPrice
642
- });
643
- };
644
696
  const createMsgAndCancelOrders$1 = (params) => {
645
- const hasCancelAll = params.spotMarketIdsToCancelAll && params.spotMarketIdsToCancelAll.length > 0 || params.derivativeMarketIdsToCancelAll && params.derivativeMarketIdsToCancelAll.length > 0 || params.binaryOptionsMarketIdsToCancelAll && params.binaryOptionsMarketIdsToCancelAll.length > 0;
697
+ assertNoBinaryOptionsOrders(params);
698
+ const hasCancelAll = params.spotMarketIdsToCancelAll && params.spotMarketIdsToCancelAll.length > 0 || params.derivativeMarketIdsToCancelAll && params.derivativeMarketIdsToCancelAll.length > 0;
646
699
  const message = InjectiveExchangeV1Beta1TxPb.MsgBatchUpdateOrders.create({
647
700
  sender: params.injectiveAddress,
648
701
  ...hasCancelAll && { subaccountId: params.subaccountId }
649
702
  });
650
703
  if (params.spotMarketIdsToCancelAll && params.spotMarketIdsToCancelAll.length > 0) message.spotMarketIdsToCancelAll = params.spotMarketIdsToCancelAll;
651
704
  if (params.derivativeMarketIdsToCancelAll && params.derivativeMarketIdsToCancelAll.length > 0) message.derivativeMarketIdsToCancelAll = params.derivativeMarketIdsToCancelAll;
652
- if (params.binaryOptionsMarketIdsToCancelAll && params.binaryOptionsMarketIdsToCancelAll.length > 0) message.binaryOptionsMarketIdsToCancelAll = params.binaryOptionsMarketIdsToCancelAll;
653
705
  if (params.spotOrdersToCancel) message.spotOrdersToCancel = params.spotOrdersToCancel.map(({ marketId, subaccountId, orderHash, cid }) => {
654
706
  return InjectiveExchangeV1Beta1TxPb.OrderData.create({
655
707
  marketId,
@@ -666,14 +718,6 @@ const createMsgAndCancelOrders$1 = (params) => {
666
718
  cid
667
719
  });
668
720
  });
669
- if (params.binaryOptionsOrdersToCancel) message.binaryOptionsOrdersToCancel = params.binaryOptionsOrdersToCancel.map(({ marketId, subaccountId, orderHash, cid }) => {
670
- return InjectiveExchangeV1Beta1TxPb.OrderData.create({
671
- marketId,
672
- subaccountId,
673
- orderHash,
674
- cid
675
- });
676
- });
677
721
  return message;
678
722
  };
679
723
  /**
@@ -713,20 +757,6 @@ var MsgBatchUpdateOrders = class MsgBatchUpdateOrders extends MsgBase {
713
757
  subaccountId: params.subaccountId
714
758
  });
715
759
  });
716
- if (params.binaryOptionsOrdersToCreate) message.binaryOptionsOrdersToCreate = params.binaryOptionsOrdersToCreate.map((args) => {
717
- const paramsFromArgs = {
718
- ...args,
719
- price: toChainFormat(args.price).toFixed(),
720
- margin: toChainFormat(args.margin).toFixed(),
721
- triggerPrice: toChainFormat(args.triggerPrice || 0).toFixed(),
722
- quantity: toChainFormat(args.quantity).toFixed()
723
- };
724
- return createBinaryOptionOrder$1({
725
- ...args,
726
- ...paramsFromArgs,
727
- subaccountId: params.subaccountId
728
- });
729
- });
730
760
  return message;
731
761
  }
732
762
  toData() {
@@ -766,20 +796,6 @@ var MsgBatchUpdateOrders = class MsgBatchUpdateOrders extends MsgBase {
766
796
  subaccountId: params.subaccountId
767
797
  });
768
798
  });
769
- if (params.binaryOptionsOrdersToCreate) message.binaryOptionsOrdersToCreate = params.binaryOptionsOrdersToCreate.map((args) => {
770
- const paramsFromArgs = {
771
- ...args,
772
- price: args.price,
773
- margin: args.margin,
774
- triggerPrice: args.triggerPrice || "0",
775
- quantity: args.quantity
776
- };
777
- return createBinaryOptionOrder$1({
778
- ...args,
779
- ...paramsFromArgs,
780
- subaccountId: params.subaccountId
781
- });
782
- });
783
799
  const orderInfoToSnakeCase = (orderInfo) => ({
784
800
  subaccount_id: orderInfo.subaccountId,
785
801
  fee_recipient: orderInfo.feeRecipient,
@@ -813,13 +829,13 @@ var MsgBatchUpdateOrders = class MsgBatchUpdateOrders extends MsgBase {
813
829
  subaccount_id: message.subaccountId,
814
830
  spot_market_ids_to_cancel_all: message.spotMarketIdsToCancelAll,
815
831
  derivative_market_ids_to_cancel_all: message.derivativeMarketIdsToCancelAll,
816
- binary_options_market_ids_to_cancel_all: message.binaryOptionsMarketIdsToCancelAll,
832
+ binary_options_market_ids_to_cancel_all: [],
817
833
  spot_orders_to_cancel: message.spotOrdersToCancel.map(orderDataToSnakeCase),
818
834
  derivative_orders_to_cancel: message.derivativeOrdersToCancel.map(orderDataToSnakeCase),
819
- binary_options_orders_to_cancel: message.binaryOptionsOrdersToCancel.map(orderDataToSnakeCase),
835
+ binary_options_orders_to_cancel: [],
820
836
  spot_orders_to_create: message.spotOrdersToCreate.map(spotOrderToSnakeCase),
821
837
  derivative_orders_to_create: message.derivativeOrdersToCreate.map(derivativeOrderToSnakeCase),
822
- binary_options_orders_to_create: message.binaryOptionsOrdersToCreate.map(derivativeOrderToSnakeCase)
838
+ binary_options_orders_to_create: []
823
839
  }
824
840
  };
825
841
  }
@@ -843,7 +859,7 @@ var MsgBatchUpdateOrders = class MsgBatchUpdateOrders extends MsgBase {
843
859
 
844
860
  //#endregion
845
861
  //#region src/core/modules/exchange/msgs/MsgLiquidatePosition.ts
846
- const createMessage$12 = (params) => {
862
+ const createMessage$8 = (params) => {
847
863
  const message = InjectiveExchangeV1Beta1TxPb.MsgLiquidatePosition.create({
848
864
  sender: params.injectiveAddress,
849
865
  subaccountId: params.subaccountId,
@@ -876,7 +892,7 @@ var MsgLiquidatePosition = class MsgLiquidatePosition extends MsgBase {
876
892
  }
877
893
  toProto() {
878
894
  const { params: initialParams } = this;
879
- return createMessage$12({
895
+ return createMessage$8({
880
896
  ...initialParams,
881
897
  order: initialParams.order ? {
882
898
  ...initialParams.order,
@@ -1006,9 +1022,12 @@ var MsgCancelSpotOrderV2 = class MsgCancelSpotOrderV2 extends MsgBase {
1006
1022
  };
1007
1023
  }
1008
1024
  toAmino() {
1025
+ return toAminoJson(InjectiveExchangeV2TxPb.MsgCancelSpotOrder, this.toProto());
1026
+ }
1027
+ toAminoRaw() {
1009
1028
  const proto = this.toProto();
1010
1029
  return {
1011
- type: "exchange/MsgCancelSpotOrder",
1030
+ type: "exchange/v2/MsgCancelSpotOrder",
1012
1031
  value: {
1013
1032
  sender: proto.sender,
1014
1033
  market_id: proto.marketId,
@@ -1019,7 +1038,7 @@ var MsgCancelSpotOrderV2 = class MsgCancelSpotOrderV2 extends MsgBase {
1019
1038
  };
1020
1039
  }
1021
1040
  toWeb3Gw() {
1022
- const { value } = this.toAmino();
1041
+ const { value } = this.toAminoRaw();
1023
1042
  return {
1024
1043
  "@type": "/injective.exchange.v2.MsgCancelSpotOrder",
1025
1044
  ...value
@@ -1091,16 +1110,21 @@ var MsgReclaimLockedFunds = class MsgReclaimLockedFunds extends MsgBase {
1091
1110
  }
1092
1111
  };
1093
1112
 
1113
+ //#endregion
1114
+ //#region src/core/modules/exchange/msgs/utils/legacyDec.ts
1115
+ /** params are human-readable, the proto stores LegacyDec (the value scaled by 1e18) */
1116
+ const toLegacyDec = (value) => toChainFormat(value || "0").toFixed();
1117
+
1094
1118
  //#endregion
1095
1119
  //#region src/core/modules/exchange/msgs/MsgUpdateSpotMarketV2.ts
1096
- const createMessage$11 = (params) => {
1120
+ const createMessage$7 = (params) => {
1097
1121
  return InjectiveExchangeV2TxPb.MsgUpdateSpotMarket.create({
1098
1122
  admin: params.admin,
1099
1123
  marketId: params.marketId,
1100
1124
  newTicker: params.newTicker || "",
1101
- newMinNotional: params.newMinNotional || "0",
1102
- newMinPriceTickSize: params.newMinPriceTickSize || "0",
1103
- newMinQuantityTickSize: params.newMinQuantityTickSize || "0"
1125
+ newMinNotional: toLegacyDec(params.newMinNotional),
1126
+ newMinPriceTickSize: toLegacyDec(params.newMinPriceTickSize),
1127
+ newMinQuantityTickSize: toLegacyDec(params.newMinQuantityTickSize)
1104
1128
  });
1105
1129
  };
1106
1130
  /**
@@ -1111,7 +1135,7 @@ var MsgUpdateSpotMarketV2 = class MsgUpdateSpotMarketV2 extends MsgBase {
1111
1135
  return new MsgUpdateSpotMarketV2(params);
1112
1136
  }
1113
1137
  toProto() {
1114
- return createMessage$11(this.params);
1138
+ return createMessage$7(this.params);
1115
1139
  }
1116
1140
  toData() {
1117
1141
  const proto = this.toProto();
@@ -1121,9 +1145,12 @@ var MsgUpdateSpotMarketV2 = class MsgUpdateSpotMarketV2 extends MsgBase {
1121
1145
  };
1122
1146
  }
1123
1147
  toAmino() {
1148
+ return toAminoJson(InjectiveExchangeV2TxPb.MsgUpdateSpotMarket, this.toProto());
1149
+ }
1150
+ toAminoRaw() {
1124
1151
  const { params } = this;
1125
1152
  return {
1126
- type: "exchange/MsgUpdateSpotMarket",
1153
+ type: "exchange/v2/MsgUpdateSpotMarket",
1127
1154
  value: {
1128
1155
  admin: params.admin,
1129
1156
  market_id: params.marketId,
@@ -1135,19 +1162,12 @@ var MsgUpdateSpotMarketV2 = class MsgUpdateSpotMarketV2 extends MsgBase {
1135
1162
  };
1136
1163
  }
1137
1164
  toWeb3Gw() {
1138
- const { value } = this.toAmino();
1165
+ const { value } = this.toAminoRaw();
1139
1166
  return {
1140
1167
  "@type": "/injective.exchange.v2.MsgUpdateSpotMarket",
1141
1168
  ...value
1142
1169
  };
1143
1170
  }
1144
- toEip712() {
1145
- const { type, value } = this.toAmino();
1146
- return {
1147
- type,
1148
- value: { ...value }
1149
- };
1150
- }
1151
1171
  toEip712V2() {
1152
1172
  const { params } = this;
1153
1173
  return {
@@ -1170,6 +1190,7 @@ var MsgUpdateSpotMarketV2 = class MsgUpdateSpotMarketV2 extends MsgBase {
1170
1190
  return InjectiveExchangeV2TxPb.MsgUpdateSpotMarket.toBinary(this.toProto());
1171
1191
  }
1172
1192
  };
1193
+ _defineProperty(MsgUpdateSpotMarketV2, "eip712V1Supported", false);
1173
1194
 
1174
1195
  //#endregion
1175
1196
  //#region src/core/modules/exchange/msgs/MsgExternalTransferV2.ts
@@ -1201,9 +1222,12 @@ var MsgExternalTransferV2 = class MsgExternalTransferV2 extends MsgBase {
1201
1222
  };
1202
1223
  }
1203
1224
  toAmino() {
1225
+ return toAminoJson(InjectiveExchangeV2TxPb.MsgExternalTransfer, this.toProto());
1226
+ }
1227
+ toAminoRaw() {
1204
1228
  const proto = this.toProto();
1205
1229
  return {
1206
- type: "exchange/MsgExternalTransfer",
1230
+ type: "exchange/v2/MsgExternalTransfer",
1207
1231
  value: {
1208
1232
  sender: proto.sender,
1209
1233
  source_subaccount_id: proto.sourceSubaccountId,
@@ -1213,7 +1237,7 @@ var MsgExternalTransferV2 = class MsgExternalTransferV2 extends MsgBase {
1213
1237
  };
1214
1238
  }
1215
1239
  toWeb3Gw() {
1216
- const { value } = this.toAmino();
1240
+ const { value } = this.toAminoRaw();
1217
1241
  return {
1218
1242
  "@type": "/injective.exchange.v2.MsgExternalTransfer",
1219
1243
  ...value
@@ -1251,9 +1275,12 @@ var MsgUpdateSwapParamsV2 = class MsgUpdateSwapParamsV2 extends MsgBase {
1251
1275
  };
1252
1276
  }
1253
1277
  toAmino() {
1278
+ return toAminoJson(InjectiveExchangeV2TxPb.MsgUpdateSwapParams, this.toProto());
1279
+ }
1280
+ toAminoRaw() {
1254
1281
  const { params } = this;
1255
1282
  return {
1256
- type: "exchange/MsgUpdateSwapParams",
1283
+ type: "exchange/v2/MsgUpdateSwapParams",
1257
1284
  value: {
1258
1285
  sender: params.sender,
1259
1286
  swap_params: {
@@ -1264,30 +1291,24 @@ var MsgUpdateSwapParamsV2 = class MsgUpdateSwapParamsV2 extends MsgBase {
1264
1291
  };
1265
1292
  }
1266
1293
  toWeb3Gw() {
1267
- const { value } = this.toAmino();
1294
+ const { value } = this.toAminoRaw();
1268
1295
  return {
1269
1296
  "@type": "/injective.exchange.v2.MsgUpdateSwapParams",
1270
1297
  ...value
1271
1298
  };
1272
1299
  }
1273
- toEip712() {
1274
- const { type, value } = this.toAmino();
1275
- return {
1276
- type,
1277
- value
1278
- };
1279
- }
1280
1300
  toEip712V2() {
1281
1301
  return this.toWeb3Gw();
1282
1302
  }
1283
1303
  toEip712Types() {
1304
+ var _this$params$swapPara;
1284
1305
  return new Map([["TypeSwapParams", [{
1285
1306
  name: "enabled",
1286
1307
  type: "bool"
1287
- }, {
1308
+ }, ...((_this$params$swapPara = this.params.swapParams.allowedMarkets) === null || _this$params$swapPara === void 0 ? void 0 : _this$params$swapPara.length) ? [{
1288
1309
  name: "allowed_markets",
1289
1310
  type: "string[]"
1290
- }]], ["MsgValue", [{
1311
+ }] : []]], ["MsgValue", [{
1291
1312
  name: "sender",
1292
1313
  type: "string"
1293
1314
  }, {
@@ -1341,23 +1362,6 @@ const createDerivativeOrder = (args) => {
1341
1362
  expirationBlock: args.expirationBlock ? BigInt(args.expirationBlock) : BigInt(0)
1342
1363
  });
1343
1364
  };
1344
- const createBinaryOptionOrder = (args) => {
1345
- const orderInfo = InjectiveExchangeV2OrderPb.OrderInfo.create({
1346
- subaccountId: args.subaccountId,
1347
- feeRecipient: args.feeRecipient,
1348
- price: args.price,
1349
- quantity: args.quantity,
1350
- cid: args.cid
1351
- });
1352
- return InjectiveExchangeV2OrderPb.DerivativeOrder.create({
1353
- marketId: args.marketId,
1354
- orderType: args.orderType,
1355
- orderInfo,
1356
- margin: args.margin,
1357
- triggerPrice: args.triggerPrice,
1358
- expirationBlock: args.expirationBlock ? BigInt(args.expirationBlock) : BigInt(0)
1359
- });
1360
- };
1361
1365
  const buildSpotOrders = (orders, subaccountId, fmt, fmtOpt) => orders.map((args) => createSpotOrder({
1362
1366
  ...args,
1363
1367
  price: fmt(args.price),
@@ -1373,23 +1377,15 @@ const buildDerivativeOrders = (orders, subaccountId, fmt, fmtOpt) => orders.map(
1373
1377
  quantity: fmt(args.quantity),
1374
1378
  subaccountId
1375
1379
  }));
1376
- const buildBinaryOptionOrders = (orders, subaccountId, fmt, fmtOpt) => orders.map((args) => createBinaryOptionOrder({
1377
- ...args,
1378
- price: fmt(args.price),
1379
- margin: fmt(args.margin),
1380
- triggerPrice: fmtOpt(args.triggerPrice),
1381
- quantity: fmt(args.quantity),
1382
- subaccountId
1383
- }));
1384
1380
  const createMsgAndCancelOrders = (params) => {
1385
- const hasCancelAll = params.spotMarketIdsToCancelAll && params.spotMarketIdsToCancelAll.length > 0 || params.derivativeMarketIdsToCancelAll && params.derivativeMarketIdsToCancelAll.length > 0 || params.binaryOptionsMarketIdsToCancelAll && params.binaryOptionsMarketIdsToCancelAll.length > 0;
1381
+ assertNoBinaryOptionsOrders(params);
1382
+ const hasCancelAll = params.spotMarketIdsToCancelAll && params.spotMarketIdsToCancelAll.length > 0 || params.derivativeMarketIdsToCancelAll && params.derivativeMarketIdsToCancelAll.length > 0;
1386
1383
  const message = InjectiveExchangeV2TxPb.MsgBatchUpdateOrders.create({
1387
1384
  sender: params.injectiveAddress,
1388
1385
  ...hasCancelAll && { subaccountId: params.subaccountId }
1389
1386
  });
1390
1387
  if (params.spotMarketIdsToCancelAll && params.spotMarketIdsToCancelAll.length > 0) message.spotMarketIdsToCancelAll = params.spotMarketIdsToCancelAll;
1391
1388
  if (params.derivativeMarketIdsToCancelAll && params.derivativeMarketIdsToCancelAll.length > 0) message.derivativeMarketIdsToCancelAll = params.derivativeMarketIdsToCancelAll;
1392
- if (params.binaryOptionsMarketIdsToCancelAll && params.binaryOptionsMarketIdsToCancelAll.length > 0) message.binaryOptionsMarketIdsToCancelAll = params.binaryOptionsMarketIdsToCancelAll;
1393
1389
  if (params.spotOrdersToCancel) message.spotOrdersToCancel = params.spotOrdersToCancel.map(({ marketId, subaccountId, orderHash, cid }) => {
1394
1390
  return InjectiveExchangeV2TxPb.OrderData.create({
1395
1391
  marketId,
@@ -1406,14 +1402,6 @@ const createMsgAndCancelOrders = (params) => {
1406
1402
  cid
1407
1403
  });
1408
1404
  });
1409
- if (params.binaryOptionsOrdersToCancel) message.binaryOptionsOrdersToCancel = params.binaryOptionsOrdersToCancel.map(({ marketId, subaccountId, orderHash, cid }) => {
1410
- return InjectiveExchangeV2TxPb.OrderData.create({
1411
- marketId,
1412
- subaccountId,
1413
- orderHash,
1414
- cid
1415
- });
1416
- });
1417
1405
  return message;
1418
1406
  };
1419
1407
  /**
@@ -1430,10 +1418,8 @@ var MsgBatchUpdateOrdersV2 = class MsgBatchUpdateOrdersV2 extends MsgBase {
1430
1418
  const fmtOpt = (v) => toChainFormat(v || 0).toFixed();
1431
1419
  if (params.spotOrdersToCreate) message.spotOrdersToCreate = buildSpotOrders(params.spotOrdersToCreate, params.subaccountId, fmt, fmtOpt);
1432
1420
  if (params.derivativeOrdersToCreate) message.derivativeOrdersToCreate = buildDerivativeOrders(params.derivativeOrdersToCreate, params.subaccountId, fmt, fmtOpt);
1433
- if (params.binaryOptionsOrdersToCreate) message.binaryOptionsOrdersToCreate = buildBinaryOptionOrders(params.binaryOptionsOrdersToCreate, params.subaccountId, fmt, fmtOpt);
1434
1421
  if (params.spotMarketOrdersToCreate) message.spotMarketOrdersToCreate = buildSpotOrders(params.spotMarketOrdersToCreate, params.subaccountId, fmt, fmtOpt);
1435
1422
  if (params.derivativeMarketOrdersToCreate) message.derivativeMarketOrdersToCreate = buildDerivativeOrders(params.derivativeMarketOrdersToCreate, params.subaccountId, fmt, fmtOpt);
1436
- if (params.binaryOptionsMarketOrdersToCreate) message.binaryOptionsMarketOrdersToCreate = buildBinaryOptionOrders(params.binaryOptionsMarketOrdersToCreate, params.subaccountId, fmt, fmtOpt);
1437
1423
  return message;
1438
1424
  }
1439
1425
  toData() {
@@ -1444,16 +1430,17 @@ var MsgBatchUpdateOrdersV2 = class MsgBatchUpdateOrdersV2 extends MsgBase {
1444
1430
  };
1445
1431
  }
1446
1432
  toAmino() {
1433
+ return toAminoJson(InjectiveExchangeV2TxPb.MsgBatchUpdateOrders, this.toProto());
1434
+ }
1435
+ toAminoRaw() {
1447
1436
  const { params } = this;
1448
1437
  const message = createMsgAndCancelOrders(params);
1449
1438
  const fmt = (v) => v;
1450
1439
  const fmtOpt = (v) => v || "0";
1451
1440
  if (params.spotOrdersToCreate) message.spotOrdersToCreate = buildSpotOrders(params.spotOrdersToCreate, params.subaccountId, fmt, fmtOpt);
1452
1441
  if (params.derivativeOrdersToCreate) message.derivativeOrdersToCreate = buildDerivativeOrders(params.derivativeOrdersToCreate, params.subaccountId, fmt, fmtOpt);
1453
- if (params.binaryOptionsOrdersToCreate) message.binaryOptionsOrdersToCreate = buildBinaryOptionOrders(params.binaryOptionsOrdersToCreate, params.subaccountId, fmt, fmtOpt);
1454
1442
  if (params.spotMarketOrdersToCreate) message.spotMarketOrdersToCreate = buildSpotOrders(params.spotMarketOrdersToCreate, params.subaccountId, fmt, fmtOpt);
1455
1443
  if (params.derivativeMarketOrdersToCreate) message.derivativeMarketOrdersToCreate = buildDerivativeOrders(params.derivativeMarketOrdersToCreate, params.subaccountId, fmt, fmtOpt);
1456
- if (params.binaryOptionsMarketOrdersToCreate) message.binaryOptionsMarketOrdersToCreate = buildBinaryOptionOrders(params.binaryOptionsMarketOrdersToCreate, params.subaccountId, fmt, fmtOpt);
1457
1444
  const orderInfoToSnakeCase = (orderInfo) => ({
1458
1445
  subaccount_id: orderInfo.subaccountId,
1459
1446
  fee_recipient: orderInfo.feeRecipient,
@@ -1483,7 +1470,7 @@ var MsgBatchUpdateOrdersV2 = class MsgBatchUpdateOrdersV2 extends MsgBase {
1483
1470
  cid: orderData.cid
1484
1471
  });
1485
1472
  return {
1486
- type: "exchange/MsgBatchUpdateOrders",
1473
+ type: "exchange/v2/MsgBatchUpdateOrders",
1487
1474
  value: {
1488
1475
  sender: message.sender,
1489
1476
  subaccount_id: message.subaccountId,
@@ -1493,72 +1480,22 @@ var MsgBatchUpdateOrdersV2 = class MsgBatchUpdateOrdersV2 extends MsgBase {
1493
1480
  derivative_orders_to_cancel: message.derivativeOrdersToCancel.map(orderDataToSnakeCase),
1494
1481
  spot_orders_to_create: message.spotOrdersToCreate.map(spotOrderToSnakeCase),
1495
1482
  derivative_orders_to_create: message.derivativeOrdersToCreate.map(derivativeOrderToSnakeCase),
1496
- binary_options_orders_to_cancel: message.binaryOptionsOrdersToCancel.map(orderDataToSnakeCase),
1497
- binary_options_market_ids_to_cancel_all: message.binaryOptionsMarketIdsToCancelAll,
1498
- binary_options_orders_to_create: message.binaryOptionsOrdersToCreate.map(derivativeOrderToSnakeCase),
1483
+ binary_options_orders_to_cancel: [],
1484
+ binary_options_market_ids_to_cancel_all: [],
1485
+ binary_options_orders_to_create: [],
1499
1486
  spot_market_orders_to_create: message.spotMarketOrdersToCreate.map(spotOrderToSnakeCase),
1500
1487
  derivative_market_orders_to_create: message.derivativeMarketOrdersToCreate.map(derivativeOrderToSnakeCase),
1501
- binary_options_market_orders_to_create: message.binaryOptionsMarketOrdersToCreate.map(derivativeOrderToSnakeCase)
1488
+ binary_options_market_orders_to_create: []
1502
1489
  }
1503
1490
  };
1504
1491
  }
1505
1492
  toWeb3Gw() {
1506
- const { value } = this.toAmino();
1493
+ const { value } = this.toAminoRaw();
1507
1494
  return {
1508
1495
  "@type": "/injective.exchange.v2.MsgBatchUpdateOrders",
1509
1496
  ...value
1510
1497
  };
1511
1498
  }
1512
- toEip712() {
1513
- var _msgValue$spot_market, _msgValue$derivative_, _msgValue$spot_orders, _msgValue$derivative_2, _msgValue$binary_opti, _msgValue$binary_opti2;
1514
- const { params } = this;
1515
- const { value, type } = this.toAmino();
1516
- const spotOrderToEip712 = (order, args) => ({
1517
- market_id: order.market_id,
1518
- order_info: {
1519
- subaccount_id: order.order_info.subaccount_id,
1520
- fee_recipient: order.order_info.fee_recipient,
1521
- price: toChainFormat(args.price).toFixed(),
1522
- quantity: toChainFormat(args.quantity).toFixed(),
1523
- cid: order.order_info.cid
1524
- },
1525
- order_type: order.order_type,
1526
- trigger_price: toChainFormat(args.triggerPrice || "0").toFixed()
1527
- });
1528
- const derivativeOrderToEip712 = (order, args) => ({
1529
- market_id: order.market_id,
1530
- order_info: {
1531
- subaccount_id: order.order_info.subaccount_id,
1532
- fee_recipient: order.order_info.fee_recipient,
1533
- price: toChainFormat(args.price).toFixed(),
1534
- quantity: toChainFormat(args.quantity).toFixed(),
1535
- cid: order.order_info.cid
1536
- },
1537
- order_type: order.order_type,
1538
- margin: toChainFormat(args.margin).toFixed(),
1539
- trigger_price: toChainFormat(args.triggerPrice || "0").toFixed()
1540
- });
1541
- const msgValue = value;
1542
- const hasCancelAll = params.spotMarketIdsToCancelAll && params.spotMarketIdsToCancelAll.length > 0 || params.derivativeMarketIdsToCancelAll && params.derivativeMarketIdsToCancelAll.length > 0 || params.binaryOptionsMarketIdsToCancelAll && params.binaryOptionsMarketIdsToCancelAll.length > 0;
1543
- const result = { sender: msgValue.sender };
1544
- if (hasCancelAll) result.subaccount_id = msgValue.subaccount_id;
1545
- 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;
1546
- 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;
1547
- 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;
1548
- 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;
1549
- 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));
1550
- 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));
1551
- 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;
1552
- 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;
1553
- 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));
1554
- 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));
1555
- 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));
1556
- 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));
1557
- return {
1558
- type,
1559
- value: result
1560
- };
1561
- }
1562
1499
  toEip712Types() {
1563
1500
  const eip712 = this.toEip712();
1564
1501
  return patchOrderTypesWithExpirationBlock(objectKeysToEip712Types({
@@ -1567,14 +1504,12 @@ var MsgBatchUpdateOrdersV2 = class MsgBatchUpdateOrdersV2 extends MsgBase {
1567
1504
  }), [
1568
1505
  "TypeSpotOrdersToCreate",
1569
1506
  "TypeDerivativeOrdersToCreate",
1570
- "TypeBinaryOptionsOrdersToCreate",
1571
1507
  "TypeSpotMarketOrdersToCreate",
1572
- "TypeDerivativeMarketOrdersToCreate",
1573
- "TypeBinaryOptionsMarketOrdersToCreate"
1508
+ "TypeDerivativeMarketOrdersToCreate"
1574
1509
  ]);
1575
1510
  }
1576
1511
  toEip712V2() {
1577
- var _web3gw$spot_market_i, _web3gw$derivative_ma, _web3gw$spot_orders_t, _web3gw$derivative_or, _web3gw$binary_option, _web3gw$binary_option2;
1512
+ var _web3gw$spot_market_i, _web3gw$derivative_ma, _web3gw$spot_orders_t, _web3gw$derivative_or;
1578
1513
  const { params } = this;
1579
1514
  const web3gw = this.toWeb3Gw();
1580
1515
  const formatSpotOrderEip712 = (order, args) => ({
@@ -1614,12 +1549,12 @@ var MsgBatchUpdateOrdersV2 = class MsgBatchUpdateOrdersV2 extends MsgBase {
1614
1549
  derivative_orders_to_cancel: (_web3gw$derivative_or = web3gw.derivative_orders_to_cancel) !== null && _web3gw$derivative_or !== void 0 ? _web3gw$derivative_or : [],
1615
1550
  spot_orders_to_create: params.spotOrdersToCreate && params.spotOrdersToCreate.length > 0 ? params.spotOrdersToCreate.map((args, i) => formatSpotOrderEip712(web3gw.spot_orders_to_create[i], args)) : [],
1616
1551
  derivative_orders_to_create: params.derivativeOrdersToCreate && params.derivativeOrdersToCreate.length > 0 ? params.derivativeOrdersToCreate.map((args, i) => formatDerivativeOrderEip712(web3gw.derivative_orders_to_create[i], args)) : [],
1617
- binary_options_orders_to_cancel: (_web3gw$binary_option = web3gw.binary_options_orders_to_cancel) !== null && _web3gw$binary_option !== void 0 ? _web3gw$binary_option : [],
1618
- 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 : [],
1619
- 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)) : [],
1552
+ binary_options_orders_to_cancel: [],
1553
+ binary_options_market_ids_to_cancel_all: [],
1554
+ binary_options_orders_to_create: [],
1620
1555
  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)) : [],
1621
1556
  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)) : [],
1622
- 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)) : []
1557
+ binary_options_market_orders_to_create: []
1623
1558
  };
1624
1559
  }
1625
1560
  toDirectSign() {
@@ -1635,7 +1570,7 @@ var MsgBatchUpdateOrdersV2 = class MsgBatchUpdateOrdersV2 extends MsgBase {
1635
1570
 
1636
1571
  //#endregion
1637
1572
  //#region src/core/modules/exchange/msgs/MsgLiquidatePositionV2.ts
1638
- const createMessage$10 = (params) => {
1573
+ const createMessage$6 = (params) => {
1639
1574
  const message = InjectiveExchangeV2TxPb.MsgLiquidatePosition.create({
1640
1575
  sender: params.injectiveAddress,
1641
1576
  subaccountId: params.subaccountId,
@@ -1669,7 +1604,7 @@ var MsgLiquidatePositionV2 = class MsgLiquidatePositionV2 extends MsgBase {
1669
1604
  }
1670
1605
  toProto() {
1671
1606
  const { params: initialParams } = this;
1672
- return createMessage$10({
1607
+ return createMessage$6({
1673
1608
  ...initialParams,
1674
1609
  order: initialParams.order ? {
1675
1610
  ...initialParams.order,
@@ -1688,9 +1623,12 @@ var MsgLiquidatePositionV2 = class MsgLiquidatePositionV2 extends MsgBase {
1688
1623
  };
1689
1624
  }
1690
1625
  toAmino() {
1626
+ return toAminoJson(InjectiveExchangeV2TxPb.MsgLiquidatePosition, this.toProto());
1627
+ }
1628
+ toAminoRaw() {
1691
1629
  const { params } = this;
1692
1630
  return {
1693
- type: "exchange/MsgLiquidatePosition",
1631
+ type: "exchange/v2/MsgLiquidatePosition",
1694
1632
  value: {
1695
1633
  sender: params.injectiveAddress,
1696
1634
  subaccount_id: params.subaccountId,
@@ -1713,7 +1651,7 @@ var MsgLiquidatePositionV2 = class MsgLiquidatePositionV2 extends MsgBase {
1713
1651
  };
1714
1652
  }
1715
1653
  toWeb3Gw() {
1716
- const { value } = this.toAmino();
1654
+ const { value } = this.toAminoRaw();
1717
1655
  return {
1718
1656
  "@type": "/injective.exchange.v2.MsgLiquidatePosition",
1719
1657
  ...value
@@ -1738,27 +1676,6 @@ var MsgLiquidatePositionV2 = class MsgLiquidatePositionV2 extends MsgBase {
1738
1676
  } : null
1739
1677
  };
1740
1678
  }
1741
- toEip712() {
1742
- const { params } = this;
1743
- const { value, type } = this.toAmino();
1744
- const { expiration_block: _eb, ...orderWithoutExpiration } = value.order || {};
1745
- return {
1746
- type,
1747
- value: {
1748
- ...value,
1749
- order: params.order ? {
1750
- ...orderWithoutExpiration,
1751
- order_info: {
1752
- ...orderWithoutExpiration === null || orderWithoutExpiration === void 0 ? void 0 : orderWithoutExpiration.order_info,
1753
- price: toChainFormat(params.order.price).toFixed(),
1754
- quantity: toChainFormat(params.order.quantity).toFixed()
1755
- },
1756
- margin: toChainFormat(params.order.margin).toFixed(),
1757
- trigger_price: toChainFormat(params.order.triggerPrice || "0").toFixed()
1758
- } : void 0
1759
- }
1760
- };
1761
- }
1762
1679
  toEip712Types() {
1763
1680
  const eip712 = this.toEip712();
1764
1681
  return patchOrderTypesWithExpirationBlock(objectKeysToEip712Types({
@@ -1779,7 +1696,7 @@ var MsgLiquidatePositionV2 = class MsgLiquidatePositionV2 extends MsgBase {
1779
1696
 
1780
1697
  //#endregion
1781
1698
  //#region src/core/modules/exchange/msgs/MsgCancelPostOnlyModeV2.ts
1782
- const createMessage$9 = (params) => {
1699
+ const createMessage$5 = (params) => {
1783
1700
  return InjectiveExchangeV2TxPb.MsgCancelPostOnlyMode.create({ sender: params.sender });
1784
1701
  };
1785
1702
  /**
@@ -1791,7 +1708,7 @@ var MsgCancelPostOnlyModeV2 = class MsgCancelPostOnlyModeV2 extends MsgBase {
1791
1708
  }
1792
1709
  toProto() {
1793
1710
  const { params: initialParams } = this;
1794
- return createMessage$9({ ...initialParams });
1711
+ return createMessage$5({ ...initialParams });
1795
1712
  }
1796
1713
  toData() {
1797
1714
  const proto = this.toProto();
@@ -1801,26 +1718,22 @@ var MsgCancelPostOnlyModeV2 = class MsgCancelPostOnlyModeV2 extends MsgBase {
1801
1718
  };
1802
1719
  }
1803
1720
  toAmino() {
1721
+ return toAminoJson(InjectiveExchangeV2TxPb.MsgCancelPostOnlyMode, this.toProto());
1722
+ }
1723
+ toAminoRaw() {
1804
1724
  const { params } = this;
1805
1725
  return {
1806
- type: "exchange/MsgCancelPostOnlyMode",
1807
- value: { sender: createMessage$9(params).sender }
1726
+ type: "exchange/v2/MsgCancelPostOnlyMode",
1727
+ value: { sender: createMessage$5(params).sender }
1808
1728
  };
1809
1729
  }
1810
1730
  toWeb3Gw() {
1811
- const { value } = this.toAmino();
1731
+ const { value } = this.toAminoRaw();
1812
1732
  return {
1813
1733
  "@type": "/injective.exchange.v2.MsgCancelPostOnlyMode",
1814
1734
  ...value
1815
1735
  };
1816
1736
  }
1817
- toEip712() {
1818
- const { type, value } = this.toAmino();
1819
- return {
1820
- type,
1821
- value: { ...value }
1822
- };
1823
- }
1824
1737
  toEip712V2() {
1825
1738
  return { ...this.toWeb3Gw() };
1826
1739
  }
@@ -1861,9 +1774,12 @@ var MsgSubaccountTransferV2 = class MsgSubaccountTransferV2 extends MsgBase {
1861
1774
  };
1862
1775
  }
1863
1776
  toAmino() {
1777
+ return toAminoJson(InjectiveExchangeV2TxPb.MsgSubaccountTransfer, this.toProto());
1778
+ }
1779
+ toAminoRaw() {
1864
1780
  const proto = this.toProto();
1865
1781
  return {
1866
- type: "exchange/MsgSubaccountTransfer",
1782
+ type: "exchange/v2/MsgSubaccountTransfer",
1867
1783
  value: {
1868
1784
  sender: proto.sender,
1869
1785
  source_subaccount_id: proto.sourceSubaccountId,
@@ -1873,7 +1789,7 @@ var MsgSubaccountTransferV2 = class MsgSubaccountTransferV2 extends MsgBase {
1873
1789
  };
1874
1790
  }
1875
1791
  toWeb3Gw() {
1876
- const { value } = this.toAmino();
1792
+ const { value } = this.toAminoRaw();
1877
1793
  return {
1878
1794
  "@type": "/injective.exchange.v2.MsgSubaccountTransfer",
1879
1795
  ...value
@@ -1892,7 +1808,7 @@ var MsgSubaccountTransferV2 = class MsgSubaccountTransferV2 extends MsgBase {
1892
1808
 
1893
1809
  //#endregion
1894
1810
  //#region src/core/modules/exchange/msgs/MsgCreateSpotLimitOrder.ts
1895
- const createLimitOrder$5 = (params) => {
1811
+ const createLimitOrder$3 = (params) => {
1896
1812
  const orderInfo = InjectiveExchangeV1Beta1ExchangePb.OrderInfo.create({
1897
1813
  subaccountId: params.subaccountId,
1898
1814
  feeRecipient: params.feeRecipient,
@@ -1920,7 +1836,7 @@ var MsgCreateSpotLimitOrder = class MsgCreateSpotLimitOrder extends MsgBase {
1920
1836
  }
1921
1837
  toProto() {
1922
1838
  const { params: initialParams } = this;
1923
- return createLimitOrder$5({
1839
+ return createLimitOrder$3({
1924
1840
  ...initialParams,
1925
1841
  price: toChainFormat(initialParams.price).toFixed(),
1926
1842
  triggerPrice: toChainFormat(initialParams.triggerPrice || 0).toFixed(),
@@ -2090,9 +2006,12 @@ var MsgReclaimLockedFundsV2 = class MsgReclaimLockedFundsV2 extends MsgBase {
2090
2006
  };
2091
2007
  }
2092
2008
  toAmino() {
2009
+ return toAminoJson(InjectiveExchangeV2TxPb.MsgReclaimLockedFunds, this.toProto());
2010
+ }
2011
+ toAminoRaw() {
2093
2012
  const proto = this.toProto();
2094
2013
  return {
2095
- type: "exchange/MsgReclaimLockedFunds",
2014
+ type: "exchange/v2/MsgReclaimLockedFunds",
2096
2015
  value: {
2097
2016
  sender: proto.sender,
2098
2017
  lockedAccountPubKey: uint8ArrayToBase64(proto.lockedAccountPubKey),
@@ -2101,23 +2020,12 @@ var MsgReclaimLockedFundsV2 = class MsgReclaimLockedFundsV2 extends MsgBase {
2101
2020
  };
2102
2021
  }
2103
2022
  toWeb3Gw() {
2104
- const { value } = this.toAmino();
2023
+ const { value } = this.toAminoRaw();
2105
2024
  return {
2106
2025
  "@type": "/injective.exchange.v2.MsgReclaimLockedFunds",
2107
2026
  ...value
2108
2027
  };
2109
2028
  }
2110
- toEip712() {
2111
- const proto = this.toProto();
2112
- return {
2113
- type: "exchange/MsgReclaimLockedFunds",
2114
- value: {
2115
- sender: proto.sender,
2116
- lockedAccountPubKey: Array.from(proto.lockedAccountPubKey),
2117
- signature: Array.from(proto.signature)
2118
- }
2119
- };
2120
- }
2121
2029
  toEip712Types() {
2122
2030
  const map = /* @__PURE__ */ new Map();
2123
2031
  map.set("MsgValue", [
@@ -2171,9 +2079,12 @@ var MsgActivateStakeGrantV2 = class MsgActivateStakeGrantV2 extends MsgBase {
2171
2079
  };
2172
2080
  }
2173
2081
  toAmino() {
2082
+ return toAminoJson(InjectiveExchangeV2TxPb.MsgActivateStakeGrant, this.toProto());
2083
+ }
2084
+ toAminoRaw() {
2174
2085
  const proto = this.toProto();
2175
2086
  return {
2176
- type: "exchange/MsgActivateStakeGrant",
2087
+ type: "exchange/v2/MsgActivateStakeGrant",
2177
2088
  value: {
2178
2089
  sender: proto.sender,
2179
2090
  granter: proto.granter
@@ -2181,7 +2092,7 @@ var MsgActivateStakeGrantV2 = class MsgActivateStakeGrantV2 extends MsgBase {
2181
2092
  };
2182
2093
  }
2183
2094
  toWeb3Gw() {
2184
- const { value } = this.toAmino();
2095
+ const { value } = this.toAminoRaw();
2185
2096
  return {
2186
2097
  "@type": "/injective.exchange.v2.MsgActivateStakeGrant",
2187
2098
  ...value
@@ -2322,7 +2233,7 @@ var MsgCancelDerivativeOrder = class MsgCancelDerivativeOrder extends MsgBase {
2322
2233
 
2323
2234
  //#endregion
2324
2235
  //#region src/core/modules/exchange/msgs/MsgCreateSpotMarketOrder.ts
2325
- const createMarketOrder$5 = (params) => {
2236
+ const createMarketOrder$3 = (params) => {
2326
2237
  const orderInfo = InjectiveExchangeV1Beta1ExchangePb.OrderInfo.create({
2327
2238
  subaccountId: params.subaccountId,
2328
2239
  feeRecipient: params.feeRecipient,
@@ -2350,7 +2261,7 @@ var MsgCreateSpotMarketOrder = class MsgCreateSpotMarketOrder extends MsgBase {
2350
2261
  }
2351
2262
  toProto() {
2352
2263
  const { params: initialParams } = this;
2353
- return createMarketOrder$5({
2264
+ return createMarketOrder$3({
2354
2265
  ...initialParams,
2355
2266
  price: toChainFormat(initialParams.price).toFixed(),
2356
2267
  triggerPrice: toChainFormat(initialParams.triggerPrice || 0).toFixed(),
@@ -2468,9 +2379,12 @@ var MsgAuthorizeStakeGrantsV2 = class MsgAuthorizeStakeGrantsV2 extends MsgBase
2468
2379
  };
2469
2380
  }
2470
2381
  toAmino() {
2382
+ return toAminoJson(InjectiveExchangeV2TxPb.MsgAuthorizeStakeGrants, this.toProto());
2383
+ }
2384
+ toAminoRaw() {
2471
2385
  const proto = this.toProto();
2472
2386
  return {
2473
- type: "exchange/MsgAuthorizeStakeGrants",
2387
+ type: "exchange/v2/MsgAuthorizeStakeGrants",
2474
2388
  value: {
2475
2389
  sender: proto.sender,
2476
2390
  grants: proto.grants
@@ -2478,7 +2392,7 @@ var MsgAuthorizeStakeGrantsV2 = class MsgAuthorizeStakeGrantsV2 extends MsgBase
2478
2392
  };
2479
2393
  }
2480
2394
  toWeb3Gw() {
2481
- const { value } = this.toAmino();
2395
+ const { value } = this.toAminoRaw();
2482
2396
  return {
2483
2397
  "@type": "/injective.exchange.v2.MsgAuthorizeStakeGrants",
2484
2398
  ...value
@@ -2497,7 +2411,7 @@ var MsgAuthorizeStakeGrantsV2 = class MsgAuthorizeStakeGrantsV2 extends MsgBase
2497
2411
 
2498
2412
  //#endregion
2499
2413
  //#region src/core/modules/exchange/msgs/MsgCreateSpotLimitOrderV2.ts
2500
- const createLimitOrder$4 = (params) => {
2414
+ const createLimitOrder$2 = (params) => {
2501
2415
  const orderInfo = InjectiveExchangeV2OrderPb.OrderInfo.create({
2502
2416
  subaccountId: params.subaccountId,
2503
2417
  feeRecipient: params.feeRecipient,
@@ -2526,7 +2440,7 @@ var MsgCreateSpotLimitOrderV2 = class MsgCreateSpotLimitOrderV2 extends MsgBase
2526
2440
  }
2527
2441
  toProto() {
2528
2442
  const { params: initialParams } = this;
2529
- return createLimitOrder$4({
2443
+ return createLimitOrder$2({
2530
2444
  ...initialParams,
2531
2445
  price: toChainFormat(initialParams.price).toFixed(),
2532
2446
  triggerPrice: toChainFormat(initialParams.triggerPrice || 0).toFixed(),
@@ -2541,9 +2455,12 @@ var MsgCreateSpotLimitOrderV2 = class MsgCreateSpotLimitOrderV2 extends MsgBase
2541
2455
  };
2542
2456
  }
2543
2457
  toAmino() {
2458
+ return toAminoJson(InjectiveExchangeV2TxPb.MsgCreateSpotLimitOrder, this.toProto());
2459
+ }
2460
+ toAminoRaw() {
2544
2461
  const { params } = this;
2545
2462
  return {
2546
- type: "exchange/MsgCreateSpotLimitOrder",
2463
+ type: "exchange/v2/MsgCreateSpotLimitOrder",
2547
2464
  value: {
2548
2465
  sender: params.injectiveAddress,
2549
2466
  order: {
@@ -2563,7 +2480,7 @@ var MsgCreateSpotLimitOrderV2 = class MsgCreateSpotLimitOrderV2 extends MsgBase
2563
2480
  };
2564
2481
  }
2565
2482
  toWeb3Gw() {
2566
- const { value } = this.toAmino();
2483
+ const { value } = this.toAminoRaw();
2567
2484
  return {
2568
2485
  "@type": "/injective.exchange.v2.MsgCreateSpotLimitOrder",
2569
2486
  ...value
@@ -2587,26 +2504,6 @@ var MsgCreateSpotLimitOrderV2 = class MsgCreateSpotLimitOrderV2 extends MsgBase
2587
2504
  }
2588
2505
  };
2589
2506
  }
2590
- toEip712() {
2591
- const { params } = this;
2592
- const { value, type } = this.toAmino();
2593
- const { expiration_block: _eb, ...orderWithoutExpiration } = value.order || {};
2594
- return {
2595
- type,
2596
- value: {
2597
- ...value,
2598
- order: {
2599
- ...orderWithoutExpiration,
2600
- order_info: {
2601
- ...orderWithoutExpiration === null || orderWithoutExpiration === void 0 ? void 0 : orderWithoutExpiration.order_info,
2602
- price: toChainFormat(params.price).toFixed(),
2603
- quantity: toChainFormat(params.quantity).toFixed()
2604
- },
2605
- trigger_price: toChainFormat(params.triggerPrice || "0").toFixed()
2606
- }
2607
- }
2608
- };
2609
- }
2610
2507
  toDirectSign() {
2611
2508
  return {
2612
2509
  type: "/injective.exchange.v2.MsgCreateSpotLimitOrder",
@@ -2642,9 +2539,12 @@ var MsgActivatePostOnlyModeV2 = class MsgActivatePostOnlyModeV2 extends MsgBase
2642
2539
  };
2643
2540
  }
2644
2541
  toAmino() {
2542
+ return toAminoJson(InjectiveExchangeV2TxPb.MsgActivatePostOnlyMode, this.toProto());
2543
+ }
2544
+ toAminoRaw() {
2645
2545
  const proto = this.toProto();
2646
2546
  return {
2647
- type: "exchange/MsgActivatePostOnlyMode",
2547
+ type: "exchange/v2/MsgActivatePostOnlyMode",
2648
2548
  value: {
2649
2549
  sender: proto.sender,
2650
2550
  blocks_amount: proto.blocksAmount
@@ -2652,7 +2552,7 @@ var MsgActivatePostOnlyModeV2 = class MsgActivatePostOnlyModeV2 extends MsgBase
2652
2552
  };
2653
2553
  }
2654
2554
  toWeb3Gw() {
2655
- const { value } = this.toAmino();
2555
+ const { value } = this.toAminoRaw();
2656
2556
  return {
2657
2557
  "@type": "/injective.exchange.v2.MsgActivatePostOnlyMode",
2658
2558
  ...value
@@ -2682,7 +2582,7 @@ var MsgActivatePostOnlyModeV2 = class MsgActivatePostOnlyModeV2 extends MsgBase
2682
2582
 
2683
2583
  //#endregion
2684
2584
  //#region src/core/modules/exchange/msgs/MsgInstantSpotMarketLaunch.ts
2685
- const createMessage$8 = (params) => {
2585
+ const createMessage$4 = (params) => {
2686
2586
  return InjectiveExchangeV1Beta1TxPb.MsgInstantSpotMarketLaunch.create({
2687
2587
  sender: params.proposer,
2688
2588
  ticker: params.market.ticker,
@@ -2704,7 +2604,7 @@ var MsgInstantSpotMarketLaunch = class MsgInstantSpotMarketLaunch extends MsgBas
2704
2604
  }
2705
2605
  toProto() {
2706
2606
  const { params: initialParams } = this;
2707
- return createMessage$8({
2607
+ return createMessage$4({
2708
2608
  ...initialParams,
2709
2609
  market: {
2710
2610
  ...initialParams.market,
@@ -2805,9 +2705,12 @@ var MsgCancelDerivativeOrderV2 = class MsgCancelDerivativeOrderV2 extends MsgBas
2805
2705
  };
2806
2706
  }
2807
2707
  toAmino() {
2708
+ return toAminoJson(InjectiveExchangeV2TxPb.MsgCancelDerivativeOrder, this.toProto());
2709
+ }
2710
+ toAminoRaw() {
2808
2711
  const proto = this.toProto();
2809
2712
  return {
2810
- type: "exchange/MsgCancelDerivativeOrder",
2713
+ type: "exchange/v2/MsgCancelDerivativeOrder",
2811
2714
  value: {
2812
2715
  sender: proto.sender,
2813
2716
  market_id: proto.marketId,
@@ -2819,7 +2722,7 @@ var MsgCancelDerivativeOrderV2 = class MsgCancelDerivativeOrderV2 extends MsgBas
2819
2722
  };
2820
2723
  }
2821
2724
  toWeb3Gw() {
2822
- const { value } = this.toAmino();
2725
+ const { value } = this.toAminoRaw();
2823
2726
  return {
2824
2727
  "@type": "/injective.exchange.v2.MsgCancelDerivativeOrder",
2825
2728
  ...value
@@ -2869,9 +2772,12 @@ var MsgBatchCancelSpotOrdersV2 = class MsgBatchCancelSpotOrdersV2 extends MsgBas
2869
2772
  };
2870
2773
  }
2871
2774
  toAmino() {
2775
+ return toAminoJson(InjectiveExchangeV2TxPb.MsgBatchCancelSpotOrders, this.toProto());
2776
+ }
2777
+ toAminoRaw() {
2872
2778
  const proto = this.toProto();
2873
2779
  return {
2874
- type: "exchange/MsgBatchCancelSpotOrders",
2780
+ type: "exchange/v2/MsgBatchCancelSpotOrders",
2875
2781
  value: {
2876
2782
  sender: proto.sender,
2877
2783
  data: proto.data.map((orderData) => ({
@@ -2885,7 +2791,7 @@ var MsgBatchCancelSpotOrdersV2 = class MsgBatchCancelSpotOrdersV2 extends MsgBas
2885
2791
  };
2886
2792
  }
2887
2793
  toWeb3Gw() {
2888
- const { value } = this.toAmino();
2794
+ const { value } = this.toAminoRaw();
2889
2795
  return {
2890
2796
  "@type": "/injective.exchange.v2.MsgBatchCancelSpotOrders",
2891
2797
  ...value
@@ -2904,7 +2810,7 @@ var MsgBatchCancelSpotOrdersV2 = class MsgBatchCancelSpotOrdersV2 extends MsgBas
2904
2810
 
2905
2811
  //#endregion
2906
2812
  //#region src/core/modules/exchange/msgs/MsgCreateSpotMarketOrderV2.ts
2907
- const createMarketOrder$4 = (params) => {
2813
+ const createMarketOrder$2 = (params) => {
2908
2814
  const orderInfo = InjectiveExchangeV2OrderPb.OrderInfo.create({
2909
2815
  subaccountId: params.subaccountId,
2910
2816
  feeRecipient: params.feeRecipient,
@@ -2933,7 +2839,7 @@ var MsgCreateSpotMarketOrderV2 = class MsgCreateSpotMarketOrderV2 extends MsgBas
2933
2839
  }
2934
2840
  toProto() {
2935
2841
  const { params: initialParams } = this;
2936
- return createMarketOrder$4({
2842
+ return createMarketOrder$2({
2937
2843
  ...initialParams,
2938
2844
  price: toChainFormat(initialParams.price).toFixed(),
2939
2845
  triggerPrice: toChainFormat(initialParams.triggerPrice || 0).toFixed(),
@@ -2948,9 +2854,12 @@ var MsgCreateSpotMarketOrderV2 = class MsgCreateSpotMarketOrderV2 extends MsgBas
2948
2854
  };
2949
2855
  }
2950
2856
  toAmino() {
2857
+ return toAminoJson(InjectiveExchangeV2TxPb.MsgCreateSpotMarketOrder, this.toProto());
2858
+ }
2859
+ toAminoRaw() {
2951
2860
  const { params } = this;
2952
2861
  return {
2953
- type: "exchange/MsgCreateSpotMarketOrder",
2862
+ type: "exchange/v2/MsgCreateSpotMarketOrder",
2954
2863
  value: {
2955
2864
  sender: params.injectiveAddress,
2956
2865
  order: {
@@ -2970,7 +2879,7 @@ var MsgCreateSpotMarketOrderV2 = class MsgCreateSpotMarketOrderV2 extends MsgBas
2970
2879
  };
2971
2880
  }
2972
2881
  toWeb3Gw() {
2973
- const { value } = this.toAmino();
2882
+ const { value } = this.toAminoRaw();
2974
2883
  return {
2975
2884
  "@type": "/injective.exchange.v2.MsgCreateSpotMarketOrder",
2976
2885
  ...value
@@ -2994,26 +2903,6 @@ var MsgCreateSpotMarketOrderV2 = class MsgCreateSpotMarketOrderV2 extends MsgBas
2994
2903
  }
2995
2904
  };
2996
2905
  }
2997
- toEip712() {
2998
- const { params } = this;
2999
- const { value, type } = this.toAmino();
3000
- const { expiration_block: _eb, ...orderWithoutExpiration } = value.order || {};
3001
- return {
3002
- type,
3003
- value: {
3004
- ...value,
3005
- order: {
3006
- ...orderWithoutExpiration,
3007
- order_info: {
3008
- ...orderWithoutExpiration === null || orderWithoutExpiration === void 0 ? void 0 : orderWithoutExpiration.order_info,
3009
- price: toChainFormat(params.price).toFixed(),
3010
- quantity: toChainFormat(params.quantity).toFixed()
3011
- },
3012
- trigger_price: toChainFormat(params.triggerPrice || "0").toFixed()
3013
- }
3014
- }
3015
- };
3016
- }
3017
2906
  toDirectSign() {
3018
2907
  return {
3019
2908
  type: "/injective.exchange.v2.MsgCreateSpotMarketOrder",
@@ -3025,8 +2914,31 @@ var MsgCreateSpotMarketOrderV2 = class MsgCreateSpotMarketOrderV2 extends MsgBas
3025
2914
  }
3026
2915
  };
3027
2916
 
2917
+ //#endregion
2918
+ //#region src/core/modules/exchange/msgs/utils/referencePriceGateConfig.ts
2919
+ const REFERENCE_PRICE_SOURCE_PREFIX = "REFERENCE_PRICE_SOURCE_";
2920
+ /**
2921
+ * proto-JSON shape (web3gw / EIP712 V2): enum as its full proto name, `null` when unset
2922
+ */
2923
+ const toReferencePriceGateConfig = (config) => config ? {
2924
+ reference_price_source: `${REFERENCE_PRICE_SOURCE_PREFIX}${ReferencePriceSource[config.referencePriceSource]}`,
2925
+ reference_window_seconds: config.referenceWindowSeconds,
2926
+ max_open_deviation_bps: config.maxOpenDeviationBps
2927
+ } : null;
2928
+
3028
2929
  //#endregion
3029
2930
  //#region src/core/modules/exchange/msgs/utils/openNotionalCap.ts
2931
+ /**
2932
+ * The proto stores the capped value as a LegacyDec, i.e. the human-readable value
2933
+ * scaled by 1e18 (same conversion the V2 order msgs apply to prices in toProto)
2934
+ */
2935
+ const openNotionalCapToChainFormat = (openNotionalCap) => openNotionalCap.cap.oneofKind === "capped" ? { cap: {
2936
+ oneofKind: "capped",
2937
+ capped: { value: toChainFormat(openNotionalCap.cap.capped.value).toFixed() }
2938
+ } } : openNotionalCap;
2939
+ /**
2940
+ * proto-JSON shape (web3gw / EIP712 V2): `{ capped: { value } }` or `{ uncapped: {} }`
2941
+ */
3030
2942
  const toOpenNotionalCap$1 = (openNotionalCap, formatValue = (value) => value) => {
3031
2943
  if (!openNotionalCap) return;
3032
2944
  const { cap } = openNotionalCap;
@@ -3039,20 +2951,21 @@ const toOpenNotionalCap$1 = (openNotionalCap, formatValue = (value) => value) =>
3039
2951
  //#endregion
3040
2952
  //#region src/core/modules/exchange/msgs/MsgUpdateDerivativeMarketV2.ts
3041
2953
  const defaultCrossMarginEligibility = InjectiveExchangeV2ProposalPb.CrossMarginEligibility.CM_ELIGIBILITY_UNSPECIFIED;
3042
- const createMessage$7 = (params) => {
2954
+ const createMessage$3 = (params) => {
3043
2955
  var _params$crossMarginEl;
3044
2956
  return InjectiveExchangeV2TxPb.MsgUpdateDerivativeMarket.create({
3045
2957
  admin: params.admin,
3046
2958
  marketId: params.marketId,
3047
2959
  newTicker: params.newTicker || "",
3048
- newMinNotional: params.newMinNotional || "0",
3049
- newMinPriceTickSize: params.newMinPriceTickSize || "0",
3050
- newMinQuantityTickSize: params.newMinQuantityTickSize || "0",
3051
- newInitialMarginRatio: params.newInitialMarginRatio || "0",
3052
- newMaintenanceMarginRatio: params.newMaintenanceMarginRatio || "0",
3053
- newReduceMarginRatio: params.newReduceMarginRatio || "0",
3054
- ...params.newOpenNotionalCap && { newOpenNotionalCap: params.newOpenNotionalCap },
3055
- crossMarginEligibility: (_params$crossMarginEl = params.crossMarginEligibility) !== null && _params$crossMarginEl !== void 0 ? _params$crossMarginEl : defaultCrossMarginEligibility
2960
+ newMinNotional: toLegacyDec(params.newMinNotional),
2961
+ newMinPriceTickSize: toLegacyDec(params.newMinPriceTickSize),
2962
+ newMinQuantityTickSize: toLegacyDec(params.newMinQuantityTickSize),
2963
+ newInitialMarginRatio: toLegacyDec(params.newInitialMarginRatio),
2964
+ newMaintenanceMarginRatio: toLegacyDec(params.newMaintenanceMarginRatio),
2965
+ newReduceMarginRatio: toLegacyDec(params.newReduceMarginRatio),
2966
+ ...params.newOpenNotionalCap && { newOpenNotionalCap: openNotionalCapToChainFormat(params.newOpenNotionalCap) },
2967
+ crossMarginEligibility: (_params$crossMarginEl = params.crossMarginEligibility) !== null && _params$crossMarginEl !== void 0 ? _params$crossMarginEl : defaultCrossMarginEligibility,
2968
+ ...params.newReferencePriceGateConfig && { newReferencePriceGateConfig: params.newReferencePriceGateConfig }
3056
2969
  });
3057
2970
  };
3058
2971
  /**
@@ -3063,7 +2976,7 @@ var MsgUpdateDerivativeMarketV2 = class MsgUpdateDerivativeMarketV2 extends MsgB
3063
2976
  return new MsgUpdateDerivativeMarketV2(params);
3064
2977
  }
3065
2978
  toProto() {
3066
- return createMessage$7(this.params);
2979
+ return createMessage$3(this.params);
3067
2980
  }
3068
2981
  toData() {
3069
2982
  const proto = this.toProto();
@@ -3073,10 +2986,13 @@ var MsgUpdateDerivativeMarketV2 = class MsgUpdateDerivativeMarketV2 extends MsgB
3073
2986
  };
3074
2987
  }
3075
2988
  toAmino() {
2989
+ return toAminoJson(InjectiveExchangeV2TxPb.MsgUpdateDerivativeMarket, this.toProto());
2990
+ }
2991
+ toAminoRaw() {
3076
2992
  var _params$crossMarginEl2;
3077
2993
  const { params } = this;
3078
2994
  return {
3079
- type: "exchange/MsgUpdateDerivativeMarket",
2995
+ type: "exchange/v2/MsgUpdateDerivativeMarket",
3080
2996
  value: {
3081
2997
  admin: params.admin,
3082
2998
  market_id: params.marketId,
@@ -3088,24 +3004,18 @@ var MsgUpdateDerivativeMarketV2 = class MsgUpdateDerivativeMarketV2 extends MsgB
3088
3004
  new_maintenance_margin_ratio: params.newMaintenanceMarginRatio,
3089
3005
  new_reduce_margin_ratio: params.newReduceMarginRatio,
3090
3006
  ...params.newOpenNotionalCap && { new_open_notional_cap: toOpenNotionalCap$1(params.newOpenNotionalCap) },
3091
- cross_margin_eligibility: (_params$crossMarginEl2 = params.crossMarginEligibility) !== null && _params$crossMarginEl2 !== void 0 ? _params$crossMarginEl2 : defaultCrossMarginEligibility
3007
+ cross_margin_eligibility: (_params$crossMarginEl2 = params.crossMarginEligibility) !== null && _params$crossMarginEl2 !== void 0 ? _params$crossMarginEl2 : defaultCrossMarginEligibility,
3008
+ ...params.newReferencePriceGateConfig && { new_reference_price_gate_config: toReferencePriceGateConfig(params.newReferencePriceGateConfig) }
3092
3009
  }
3093
3010
  };
3094
3011
  }
3095
3012
  toWeb3Gw() {
3096
- const { value } = this.toAmino();
3013
+ const { value } = this.toAminoRaw();
3097
3014
  return {
3098
3015
  "@type": "/injective.exchange.v2.MsgUpdateDerivativeMarket",
3099
3016
  ...value
3100
3017
  };
3101
3018
  }
3102
- toEip712() {
3103
- const { type, value } = this.toAmino();
3104
- return {
3105
- type,
3106
- value: { ...value }
3107
- };
3108
- }
3109
3019
  toEip712V2() {
3110
3020
  var _toOpenNotionalCap, _params$crossMarginEl3;
3111
3021
  const { params } = this;
@@ -3121,7 +3031,8 @@ var MsgUpdateDerivativeMarketV2 = class MsgUpdateDerivativeMarketV2 extends MsgB
3121
3031
  new_maintenance_margin_ratio: numberToCosmosSdkDecString(params.newMaintenanceMarginRatio || "0"),
3122
3032
  new_reduce_margin_ratio: numberToCosmosSdkDecString(params.newReduceMarginRatio || "0"),
3123
3033
  new_open_notional_cap: (_toOpenNotionalCap = toOpenNotionalCap$1(params.newOpenNotionalCap, numberToCosmosSdkDecString)) !== null && _toOpenNotionalCap !== void 0 ? _toOpenNotionalCap : {},
3124
- cross_margin_eligibility: InjectiveExchangeV2ProposalPb.CrossMarginEligibility[(_params$crossMarginEl3 = params.crossMarginEligibility) !== null && _params$crossMarginEl3 !== void 0 ? _params$crossMarginEl3 : defaultCrossMarginEligibility]
3034
+ cross_margin_eligibility: InjectiveExchangeV2ProposalPb.CrossMarginEligibility[(_params$crossMarginEl3 = params.crossMarginEligibility) !== null && _params$crossMarginEl3 !== void 0 ? _params$crossMarginEl3 : defaultCrossMarginEligibility],
3035
+ new_reference_price_gate_config: toReferencePriceGateConfig(params.newReferencePriceGateConfig)
3125
3036
  };
3126
3037
  }
3127
3038
  toDirectSign() {
@@ -3134,69 +3045,11 @@ var MsgUpdateDerivativeMarketV2 = class MsgUpdateDerivativeMarketV2 extends MsgB
3134
3045
  return InjectiveExchangeV2TxPb.MsgUpdateDerivativeMarket.toBinary(this.toProto());
3135
3046
  }
3136
3047
  };
3137
-
3138
- //#endregion
3139
- //#region src/core/modules/exchange/msgs/MsgCancelBinaryOptionsOrder.ts
3140
- /**
3141
- * @category Messages
3142
- */
3143
- var MsgCancelBinaryOptionsOrder = class MsgCancelBinaryOptionsOrder extends MsgBase {
3144
- static fromJSON(params) {
3145
- return new MsgCancelBinaryOptionsOrder(params);
3146
- }
3147
- toProto() {
3148
- const { params } = this;
3149
- return InjectiveExchangeV1Beta1TxPb.MsgCancelBinaryOptionsOrder.create({
3150
- sender: params.injectiveAddress,
3151
- marketId: params.marketId,
3152
- subaccountId: params.subaccountId,
3153
- orderHash: params.orderHash || "",
3154
- orderMask: InjectiveExchangeV1Beta1ExchangePb.OrderMask.ANY,
3155
- cid: params.cid || ""
3156
- });
3157
- }
3158
- toData() {
3159
- const proto = this.toProto();
3160
- return {
3161
- "@type": "/injective.exchange.v1beta1.MsgCancelBinaryOptionsOrder",
3162
- ...proto
3163
- };
3164
- }
3165
- toAmino() {
3166
- const proto = this.toProto();
3167
- return {
3168
- type: "exchange/MsgCancelBinaryOptionsOrder",
3169
- value: {
3170
- sender: proto.sender,
3171
- market_id: proto.marketId,
3172
- subaccount_id: proto.subaccountId,
3173
- order_hash: proto.orderHash,
3174
- order_mask: proto.orderMask,
3175
- cid: proto.cid
3176
- }
3177
- };
3178
- }
3179
- toWeb3Gw() {
3180
- const { value } = this.toAmino();
3181
- return {
3182
- "@type": "/injective.exchange.v1beta1.MsgCancelBinaryOptionsOrder",
3183
- ...value
3184
- };
3185
- }
3186
- toDirectSign() {
3187
- return {
3188
- type: "/injective.exchange.v1beta1.MsgCancelBinaryOptionsOrder",
3189
- message: this.toProto()
3190
- };
3191
- }
3192
- toBinary() {
3193
- return InjectiveExchangeV1Beta1TxPb.MsgCancelBinaryOptionsOrder.toBinary(this.toProto());
3194
- }
3195
- };
3048
+ _defineProperty(MsgUpdateDerivativeMarketV2, "eip712V1Supported", false);
3196
3049
 
3197
3050
  //#endregion
3198
3051
  //#region src/core/modules/exchange/msgs/MsgIncreasePositionMarginV2.ts
3199
- const createMessage$6 = (params) => {
3052
+ const createMessage$2 = (params) => {
3200
3053
  return InjectiveExchangeV2TxPb.MsgIncreasePositionMargin.create({
3201
3054
  sender: params.injectiveAddress,
3202
3055
  sourceSubaccountId: params.srcSubaccountId,
@@ -3214,7 +3067,7 @@ var MsgIncreasePositionMarginV2 = class MsgIncreasePositionMarginV2 extends MsgB
3214
3067
  }
3215
3068
  toProto() {
3216
3069
  const { params: initialParams } = this;
3217
- return createMessage$6({
3070
+ return createMessage$2({
3218
3071
  ...initialParams,
3219
3072
  amount: toChainFormat(initialParams.amount).toFixed()
3220
3073
  });
@@ -3227,9 +3080,12 @@ var MsgIncreasePositionMarginV2 = class MsgIncreasePositionMarginV2 extends MsgB
3227
3080
  };
3228
3081
  }
3229
3082
  toAmino() {
3083
+ return toAminoJson(InjectiveExchangeV2TxPb.MsgIncreasePositionMargin, this.toProto());
3084
+ }
3085
+ toAminoRaw() {
3230
3086
  const { params } = this;
3231
3087
  return {
3232
- type: "exchange/MsgIncreasePositionMargin",
3088
+ type: "exchange/v2/MsgIncreasePositionMargin",
3233
3089
  value: {
3234
3090
  sender: params.injectiveAddress,
3235
3091
  source_subaccount_id: params.srcSubaccountId,
@@ -3240,22 +3096,12 @@ var MsgIncreasePositionMarginV2 = class MsgIncreasePositionMarginV2 extends MsgB
3240
3096
  };
3241
3097
  }
3242
3098
  toWeb3Gw() {
3243
- const { value } = this.toAmino();
3099
+ const { value } = this.toAminoRaw();
3244
3100
  return {
3245
3101
  "@type": "/injective.exchange.v2.MsgIncreasePositionMargin",
3246
3102
  ...value
3247
3103
  };
3248
3104
  }
3249
- toEip712() {
3250
- const { type, value } = this.toAmino();
3251
- return {
3252
- type,
3253
- value: {
3254
- ...value,
3255
- amount: toChainFormat(value.amount).toFixed()
3256
- }
3257
- };
3258
- }
3259
3105
  toEip712V2() {
3260
3106
  const { params } = this;
3261
3107
  return {
@@ -3273,10 +3119,11 @@ var MsgIncreasePositionMarginV2 = class MsgIncreasePositionMarginV2 extends MsgB
3273
3119
  return InjectiveExchangeV2TxPb.MsgIncreasePositionMargin.toBinary(this.toProto());
3274
3120
  }
3275
3121
  };
3122
+ _defineProperty(MsgIncreasePositionMarginV2, "eip712V1Supported", false);
3276
3123
 
3277
3124
  //#endregion
3278
3125
  //#region src/core/modules/exchange/msgs/MsgDecreasePositionMarginV2.ts
3279
- const createMessage$5 = (params) => {
3126
+ const createMessage$1 = (params) => {
3280
3127
  return InjectiveExchangeV2TxPb.MsgDecreasePositionMargin.create({
3281
3128
  sender: params.injectiveAddress,
3282
3129
  sourceSubaccountId: params.srcSubaccountId,
@@ -3294,7 +3141,7 @@ var MsgDecreasePositionMarginV2 = class MsgDecreasePositionMarginV2 extends MsgB
3294
3141
  }
3295
3142
  toProto() {
3296
3143
  const { params: initialParams } = this;
3297
- return createMessage$5({
3144
+ return createMessage$1({
3298
3145
  ...initialParams,
3299
3146
  amount: toChainFormat(initialParams.amount).toFixed()
3300
3147
  });
@@ -3307,9 +3154,12 @@ var MsgDecreasePositionMarginV2 = class MsgDecreasePositionMarginV2 extends MsgB
3307
3154
  };
3308
3155
  }
3309
3156
  toAmino() {
3157
+ return toAminoJson(InjectiveExchangeV2TxPb.MsgDecreasePositionMargin, this.toProto());
3158
+ }
3159
+ toAminoRaw() {
3310
3160
  const { params } = this;
3311
3161
  return {
3312
- type: "exchange/MsgDecreasePositionMargin",
3162
+ type: "exchange/v2/MsgDecreasePositionMargin",
3313
3163
  value: {
3314
3164
  sender: params.injectiveAddress,
3315
3165
  source_subaccount_id: params.srcSubaccountId,
@@ -3320,22 +3170,12 @@ var MsgDecreasePositionMarginV2 = class MsgDecreasePositionMarginV2 extends MsgB
3320
3170
  };
3321
3171
  }
3322
3172
  toWeb3Gw() {
3323
- const { value } = this.toAmino();
3173
+ const { value } = this.toAminoRaw();
3324
3174
  return {
3325
3175
  "@type": "/injective.exchange.v2.MsgDecreasePositionMargin",
3326
3176
  ...value
3327
3177
  };
3328
3178
  }
3329
- toEip712() {
3330
- const { type, value } = this.toAmino();
3331
- return {
3332
- type,
3333
- value: {
3334
- ...value,
3335
- amount: toChainFormat(value.amount).toFixed()
3336
- }
3337
- };
3338
- }
3339
3179
  toEip712V2() {
3340
3180
  const { params } = this;
3341
3181
  return {
@@ -3353,18 +3193,19 @@ var MsgDecreasePositionMarginV2 = class MsgDecreasePositionMarginV2 extends MsgB
3353
3193
  return InjectiveExchangeV2TxPb.MsgDecreasePositionMargin.toBinary(this.toProto());
3354
3194
  }
3355
3195
  };
3196
+ _defineProperty(MsgDecreasePositionMarginV2, "eip712V1Supported", false);
3356
3197
 
3357
3198
  //#endregion
3358
3199
  //#region src/core/modules/exchange/msgs/MsgInstantSpotMarketLaunchV2.ts
3359
- const createMessage$4 = (params) => {
3200
+ const createMessage = (params) => {
3360
3201
  return InjectiveExchangeV2TxPb.MsgInstantSpotMarketLaunch.create({
3361
3202
  sender: params.proposer,
3362
3203
  ticker: params.market.ticker,
3363
3204
  baseDenom: params.market.baseDenom,
3364
3205
  quoteDenom: params.market.quoteDenom,
3365
- minPriceTickSize: params.market.minPriceTickSize,
3366
- minQuantityTickSize: params.market.minQuantityTickSize,
3367
- minNotional: params.market.minNotional,
3206
+ minPriceTickSize: toLegacyDec(params.market.minPriceTickSize),
3207
+ minQuantityTickSize: toLegacyDec(params.market.minQuantityTickSize),
3208
+ minNotional: toLegacyDec(params.market.minNotional),
3368
3209
  baseDecimals: Number(params.market.baseDecimals),
3369
3210
  quoteDecimals: Number(params.market.quoteDecimals)
3370
3211
  });
@@ -3377,7 +3218,7 @@ var MsgInstantSpotMarketLaunchV2 = class MsgInstantSpotMarketLaunchV2 extends Ms
3377
3218
  return new MsgInstantSpotMarketLaunchV2(params);
3378
3219
  }
3379
3220
  toProto() {
3380
- return createMessage$4(this.params);
3221
+ return createMessage(this.params);
3381
3222
  }
3382
3223
  toData() {
3383
3224
  const proto = this.toProto();
@@ -3387,9 +3228,12 @@ var MsgInstantSpotMarketLaunchV2 = class MsgInstantSpotMarketLaunchV2 extends Ms
3387
3228
  };
3388
3229
  }
3389
3230
  toAmino() {
3231
+ return toAminoJson(InjectiveExchangeV2TxPb.MsgInstantSpotMarketLaunch, this.toProto());
3232
+ }
3233
+ toAminoRaw() {
3390
3234
  const { params } = this;
3391
3235
  return {
3392
- type: "exchange/MsgInstantSpotMarketLaunch",
3236
+ type: "exchange/v2/MsgInstantSpotMarketLaunch",
3393
3237
  value: {
3394
3238
  sender: params.proposer,
3395
3239
  ticker: params.market.ticker,
@@ -3404,24 +3248,12 @@ var MsgInstantSpotMarketLaunchV2 = class MsgInstantSpotMarketLaunchV2 extends Ms
3404
3248
  };
3405
3249
  }
3406
3250
  toWeb3Gw() {
3407
- const { value } = this.toAmino();
3251
+ const { value } = this.toAminoRaw();
3408
3252
  return {
3409
3253
  "@type": "/injective.exchange.v2.MsgInstantSpotMarketLaunch",
3410
3254
  ...value
3411
3255
  };
3412
3256
  }
3413
- toEip712() {
3414
- const { type, value } = this.toAmino();
3415
- return {
3416
- type,
3417
- value: {
3418
- ...value,
3419
- min_price_tick_size: toChainFormat(value.min_price_tick_size).toFixed(),
3420
- min_quantity_tick_size: toChainFormat(value.min_quantity_tick_size).toFixed(),
3421
- min_notional: toChainFormat(value.min_notional).toFixed()
3422
- }
3423
- };
3424
- }
3425
3257
  toEip712V2() {
3426
3258
  const { params } = this;
3427
3259
  return {
@@ -3441,6 +3273,7 @@ var MsgInstantSpotMarketLaunchV2 = class MsgInstantSpotMarketLaunchV2 extends Ms
3441
3273
  return InjectiveExchangeV2TxPb.MsgInstantSpotMarketLaunch.toBinary(this.toProto());
3442
3274
  }
3443
3275
  };
3276
+ _defineProperty(MsgInstantSpotMarketLaunchV2, "eip712V1Supported", false);
3444
3277
 
3445
3278
  //#endregion
3446
3279
  //#region src/core/modules/exchange/msgs/MsgLiquidateCrossMarginPoolV2.ts
@@ -3452,11 +3285,13 @@ var MsgLiquidateCrossMarginPoolV2 = class MsgLiquidateCrossMarginPoolV2 extends
3452
3285
  return new MsgLiquidateCrossMarginPoolV2(params);
3453
3286
  }
3454
3287
  toProto() {
3288
+ var _params$rfqAction;
3455
3289
  const { params } = this;
3456
3290
  return InjectiveExchangeV2TxPb.MsgLiquidateCrossMarginPool.create({
3457
3291
  sender: params.sender,
3458
3292
  subaccountId: params.subaccountId,
3459
- quoteDenom: params.quoteDenom
3293
+ quoteDenom: params.quoteDenom,
3294
+ rfqAction: (_params$rfqAction = params.rfqAction) !== null && _params$rfqAction !== void 0 ? _params$rfqAction : ""
3460
3295
  });
3461
3296
  }
3462
3297
  toData() {
@@ -3467,21 +3302,27 @@ var MsgLiquidateCrossMarginPoolV2 = class MsgLiquidateCrossMarginPoolV2 extends
3467
3302
  };
3468
3303
  }
3469
3304
  toAmino() {
3305
+ return toAminoJson(InjectiveExchangeV2TxPb.MsgLiquidateCrossMarginPool, this.toProto());
3306
+ }
3307
+ toAminoRaw() {
3470
3308
  const proto = this.toProto();
3471
3309
  return {
3472
- type: "exchange/MsgLiquidateCrossMarginPool",
3310
+ type: "exchange/v2/MsgLiquidateCrossMarginPool",
3473
3311
  value: {
3474
3312
  sender: proto.sender,
3475
3313
  subaccount_id: proto.subaccountId,
3476
- quote_denom: proto.quoteDenom
3314
+ quote_denom: proto.quoteDenom,
3315
+ ...proto.rfqAction && { rfq_action: proto.rfqAction }
3477
3316
  }
3478
3317
  };
3479
3318
  }
3480
3319
  toWeb3Gw() {
3481
- const { value } = this.toAmino();
3320
+ var _this$params$rfqActio;
3321
+ const { value } = this.toAminoRaw();
3482
3322
  return {
3483
3323
  "@type": "/injective.exchange.v2.MsgLiquidateCrossMarginPool",
3484
- ...value
3324
+ ...value,
3325
+ rfq_action: (_this$params$rfqActio = this.params.rfqAction) !== null && _this$params$rfqActio !== void 0 ? _this$params$rfqActio : ""
3485
3326
  };
3486
3327
  }
3487
3328
  toDirectSign() {
@@ -3497,7 +3338,7 @@ var MsgLiquidateCrossMarginPoolV2 = class MsgLiquidateCrossMarginPoolV2 extends
3497
3338
 
3498
3339
  //#endregion
3499
3340
  //#region src/core/modules/exchange/msgs/MsgCreateDerivativeLimitOrder.ts
3500
- const createLimitOrder$3 = (params) => {
3341
+ const createLimitOrder$1 = (params) => {
3501
3342
  const orderInfo = InjectiveExchangeV1Beta1ExchangePb.OrderInfo.create({
3502
3343
  subaccountId: params.subaccountId,
3503
3344
  feeRecipient: params.feeRecipient,
@@ -3526,7 +3367,7 @@ var MsgCreateDerivativeLimitOrder = class MsgCreateDerivativeLimitOrder extends
3526
3367
  }
3527
3368
  toProto() {
3528
3369
  const { params: initialParams } = this;
3529
- return createLimitOrder$3({
3370
+ return createLimitOrder$1({
3530
3371
  ...initialParams,
3531
3372
  price: toChainFormat(initialParams.price).toFixed(),
3532
3373
  margin: toChainFormat(initialParams.margin).toFixed(),
@@ -3622,133 +3463,74 @@ var MsgCreateDerivativeLimitOrder = class MsgCreateDerivativeLimitOrder extends
3622
3463
  };
3623
3464
 
3624
3465
  //#endregion
3625
- //#region src/core/modules/exchange/msgs/MsgCancelBinaryOptionsOrderV2.ts
3466
+ //#region src/core/modules/exchange/msgs/MsgBatchCancelDerivativeOrders.ts
3626
3467
  /**
3627
3468
  * @category Messages
3628
3469
  */
3629
- var MsgCancelBinaryOptionsOrderV2 = class MsgCancelBinaryOptionsOrderV2 extends MsgBase {
3470
+ var MsgBatchCancelDerivativeOrders = class MsgBatchCancelDerivativeOrders extends MsgBase {
3630
3471
  static fromJSON(params) {
3631
- return new MsgCancelBinaryOptionsOrderV2(params);
3472
+ return new MsgBatchCancelDerivativeOrders(params);
3632
3473
  }
3633
3474
  toProto() {
3634
3475
  const { params } = this;
3635
- return InjectiveExchangeV2TxPb.MsgCancelBinaryOptionsOrder.create({
3476
+ const orderDataList = params.orders.map((order) => {
3477
+ return InjectiveExchangeV1Beta1TxPb.OrderData.create({
3478
+ marketId: order.marketId,
3479
+ subaccountId: order.subaccountId,
3480
+ orderHash: order.orderHash || "",
3481
+ orderMask: order.orderMask || InjectiveExchangeV1Beta1ExchangePb.OrderMask.ANY,
3482
+ cid: order.cid || ""
3483
+ });
3484
+ });
3485
+ return InjectiveExchangeV1Beta1TxPb.MsgBatchCancelDerivativeOrders.create({
3636
3486
  sender: params.injectiveAddress,
3637
- marketId: params.marketId,
3638
- subaccountId: params.subaccountId,
3639
- orderHash: params.orderHash || "",
3640
- orderMask: params.orderMask || InjectiveExchangeV2OrderPb.OrderMask.ANY,
3641
- cid: params.cid || ""
3487
+ data: orderDataList
3642
3488
  });
3643
3489
  }
3644
3490
  toData() {
3645
3491
  const proto = this.toProto();
3646
3492
  return {
3647
- "@type": "/injective.exchange.v2.MsgCancelBinaryOptionsOrder",
3493
+ "@type": "/injective.exchange.v1beta1.MsgBatchCancelDerivativeOrders",
3648
3494
  ...proto
3649
3495
  };
3650
3496
  }
3651
3497
  toAmino() {
3652
3498
  const proto = this.toProto();
3653
3499
  return {
3654
- type: "exchange/MsgCancelBinaryOptionsOrder",
3500
+ type: "exchange/MsgBatchCancelDerivativeOrders",
3655
3501
  value: {
3656
3502
  sender: proto.sender,
3657
- market_id: proto.marketId,
3658
- subaccount_id: proto.subaccountId,
3659
- order_hash: proto.orderHash,
3660
- order_mask: proto.orderMask,
3661
- cid: proto.cid
3503
+ data: proto.data.map((orderData) => ({
3504
+ market_id: orderData.marketId,
3505
+ subaccount_id: orderData.subaccountId,
3506
+ order_hash: orderData.orderHash,
3507
+ order_mask: orderData.orderMask,
3508
+ cid: orderData.cid
3509
+ }))
3662
3510
  }
3663
3511
  };
3664
3512
  }
3665
3513
  toWeb3Gw() {
3666
3514
  const { value } = this.toAmino();
3667
3515
  return {
3668
- "@type": "/injective.exchange.v2.MsgCancelBinaryOptionsOrder",
3516
+ "@type": "/injective.exchange.v1beta1.MsgBatchCancelDerivativeOrders",
3669
3517
  ...value
3670
3518
  };
3671
3519
  }
3672
3520
  toDirectSign() {
3673
3521
  return {
3674
- type: "/injective.exchange.v2.MsgCancelBinaryOptionsOrder",
3522
+ type: "/injective.exchange.v1beta1.MsgBatchCancelDerivativeOrders",
3675
3523
  message: this.toProto()
3676
3524
  };
3677
3525
  }
3678
3526
  toBinary() {
3679
- return InjectiveExchangeV2TxPb.MsgCancelBinaryOptionsOrder.toBinary(this.toProto());
3680
- }
3681
- };
3682
-
3683
- //#endregion
3684
- //#region src/core/modules/exchange/msgs/MsgBatchCancelDerivativeOrders.ts
3685
- /**
3686
- * @category Messages
3687
- */
3688
- var MsgBatchCancelDerivativeOrders = class MsgBatchCancelDerivativeOrders extends MsgBase {
3689
- static fromJSON(params) {
3690
- return new MsgBatchCancelDerivativeOrders(params);
3691
- }
3692
- toProto() {
3693
- const { params } = this;
3694
- const orderDataList = params.orders.map((order) => {
3695
- return InjectiveExchangeV1Beta1TxPb.OrderData.create({
3696
- marketId: order.marketId,
3697
- subaccountId: order.subaccountId,
3698
- orderHash: order.orderHash || "",
3699
- orderMask: order.orderMask || InjectiveExchangeV1Beta1ExchangePb.OrderMask.ANY,
3700
- cid: order.cid || ""
3701
- });
3702
- });
3703
- return InjectiveExchangeV1Beta1TxPb.MsgBatchCancelDerivativeOrders.create({
3704
- sender: params.injectiveAddress,
3705
- data: orderDataList
3706
- });
3707
- }
3708
- toData() {
3709
- const proto = this.toProto();
3710
- return {
3711
- "@type": "/injective.exchange.v1beta1.MsgBatchCancelDerivativeOrders",
3712
- ...proto
3713
- };
3714
- }
3715
- toAmino() {
3716
- const proto = this.toProto();
3717
- return {
3718
- type: "exchange/MsgBatchCancelDerivativeOrders",
3719
- value: {
3720
- sender: proto.sender,
3721
- data: proto.data.map((orderData) => ({
3722
- market_id: orderData.marketId,
3723
- subaccount_id: orderData.subaccountId,
3724
- order_hash: orderData.orderHash,
3725
- order_mask: orderData.orderMask,
3726
- cid: orderData.cid
3727
- }))
3728
- }
3729
- };
3730
- }
3731
- toWeb3Gw() {
3732
- const { value } = this.toAmino();
3733
- return {
3734
- "@type": "/injective.exchange.v1beta1.MsgBatchCancelDerivativeOrders",
3735
- ...value
3736
- };
3737
- }
3738
- toDirectSign() {
3739
- return {
3740
- type: "/injective.exchange.v1beta1.MsgBatchCancelDerivativeOrders",
3741
- message: this.toProto()
3742
- };
3743
- }
3744
- toBinary() {
3745
- return InjectiveExchangeV1Beta1TxPb.MsgBatchCancelDerivativeOrders.toBinary(this.toProto());
3527
+ return InjectiveExchangeV1Beta1TxPb.MsgBatchCancelDerivativeOrders.toBinary(this.toProto());
3746
3528
  }
3747
3529
  };
3748
3530
 
3749
3531
  //#endregion
3750
3532
  //#region src/core/modules/exchange/msgs/MsgCreateDerivativeMarketOrder.ts
3751
- const createMarketOrder$3 = (params) => {
3533
+ const createMarketOrder$1 = (params) => {
3752
3534
  const orderInfo = InjectiveExchangeV1Beta1ExchangePb.OrderInfo.create({
3753
3535
  subaccountId: params.subaccountId,
3754
3536
  feeRecipient: params.feeRecipient,
@@ -3777,7 +3559,7 @@ var MsgCreateDerivativeMarketOrder = class MsgCreateDerivativeMarketOrder extend
3777
3559
  }
3778
3560
  toProto() {
3779
3561
  const { params: initialParams } = this;
3780
- return createMarketOrder$3({
3562
+ return createMarketOrder$1({
3781
3563
  ...initialParams,
3782
3564
  price: toChainFormat(initialParams.price).toFixed(),
3783
3565
  margin: toChainFormat(initialParams.margin).toFixed(),
@@ -3874,7 +3656,7 @@ var MsgCreateDerivativeMarketOrder = class MsgCreateDerivativeMarketOrder extend
3874
3656
 
3875
3657
  //#endregion
3876
3658
  //#region src/core/modules/exchange/msgs/MsgCreateDerivativeLimitOrderV2.ts
3877
- const createLimitOrder$2 = (params) => {
3659
+ const createLimitOrder = (params) => {
3878
3660
  const orderInfo = InjectiveExchangeV2OrderPb.OrderInfo.create({
3879
3661
  subaccountId: params.subaccountId,
3880
3662
  feeRecipient: params.feeRecipient,
@@ -3904,7 +3686,7 @@ var MsgCreateDerivativeLimitOrderV2 = class MsgCreateDerivativeLimitOrderV2 exte
3904
3686
  }
3905
3687
  toProto() {
3906
3688
  const { params: initialParams } = this;
3907
- return createLimitOrder$2({
3689
+ return createLimitOrder({
3908
3690
  ...initialParams,
3909
3691
  price: toChainFormat(initialParams.price).toFixed(),
3910
3692
  margin: toChainFormat(initialParams.margin).toFixed(),
@@ -3920,9 +3702,12 @@ var MsgCreateDerivativeLimitOrderV2 = class MsgCreateDerivativeLimitOrderV2 exte
3920
3702
  };
3921
3703
  }
3922
3704
  toAmino() {
3705
+ return toAminoJson(InjectiveExchangeV2TxPb.MsgCreateDerivativeLimitOrder, this.toProto());
3706
+ }
3707
+ toAminoRaw() {
3923
3708
  const { params } = this;
3924
3709
  return {
3925
- type: "exchange/MsgCreateDerivativeLimitOrder",
3710
+ type: "exchange/v2/MsgCreateDerivativeLimitOrder",
3926
3711
  value: {
3927
3712
  sender: params.injectiveAddress,
3928
3713
  order: {
@@ -3943,7 +3728,7 @@ var MsgCreateDerivativeLimitOrderV2 = class MsgCreateDerivativeLimitOrderV2 exte
3943
3728
  };
3944
3729
  }
3945
3730
  toWeb3Gw() {
3946
- const { value } = this.toAmino();
3731
+ const { value } = this.toAminoRaw();
3947
3732
  return {
3948
3733
  "@type": "/injective.exchange.v2.MsgCreateDerivativeLimitOrder",
3949
3734
  ...value
@@ -3968,27 +3753,6 @@ var MsgCreateDerivativeLimitOrderV2 = class MsgCreateDerivativeLimitOrderV2 exte
3968
3753
  }
3969
3754
  };
3970
3755
  }
3971
- toEip712() {
3972
- const { params } = this;
3973
- const { value, type } = this.toAmino();
3974
- const { expiration_block: _eb, ...orderWithoutExpiration } = value.order || {};
3975
- return {
3976
- type,
3977
- value: {
3978
- ...value,
3979
- order: {
3980
- ...orderWithoutExpiration,
3981
- order_info: {
3982
- ...orderWithoutExpiration === null || orderWithoutExpiration === void 0 ? void 0 : orderWithoutExpiration.order_info,
3983
- price: toChainFormat(params.price).toFixed(),
3984
- quantity: toChainFormat(params.quantity).toFixed()
3985
- },
3986
- margin: toChainFormat(params.margin).toFixed(),
3987
- trigger_price: toChainFormat(params.triggerPrice || "0").toFixed()
3988
- }
3989
- }
3990
- };
3991
- }
3992
3756
  toDirectSign() {
3993
3757
  return {
3994
3758
  type: "/injective.exchange.v2.MsgCreateDerivativeLimitOrder",
@@ -4000,132 +3764,6 @@ var MsgCreateDerivativeLimitOrderV2 = class MsgCreateDerivativeLimitOrderV2 exte
4000
3764
  }
4001
3765
  };
4002
3766
 
4003
- //#endregion
4004
- //#region src/core/modules/exchange/msgs/MsgCreateBinaryOptionsLimitOrder.ts
4005
- const createLimitOrder$1 = (params) => {
4006
- const orderInfo = InjectiveExchangeV1Beta1ExchangePb.OrderInfo.create({
4007
- subaccountId: params.subaccountId,
4008
- feeRecipient: params.feeRecipient,
4009
- price: params.price,
4010
- quantity: params.quantity,
4011
- cid: params.cid || ""
4012
- });
4013
- const derivativeOrder = InjectiveExchangeV1Beta1ExchangePb.DerivativeOrder.create({
4014
- marketId: params.marketId,
4015
- orderInfo,
4016
- orderType: params.orderType,
4017
- margin: params.margin,
4018
- triggerPrice: params.triggerPrice || "0"
4019
- });
4020
- return InjectiveExchangeV1Beta1TxPb.MsgCreateBinaryOptionsLimitOrder.create({
4021
- sender: params.injectiveAddress,
4022
- order: derivativeOrder
4023
- });
4024
- };
4025
- /**
4026
- * @category Messages
4027
- */
4028
- var MsgCreateBinaryOptionsLimitOrder = class MsgCreateBinaryOptionsLimitOrder extends MsgBase {
4029
- static fromJSON(params) {
4030
- return new MsgCreateBinaryOptionsLimitOrder(params);
4031
- }
4032
- toProto() {
4033
- const { params: initialParams } = this;
4034
- return createLimitOrder$1({
4035
- ...initialParams,
4036
- price: toChainFormat(initialParams.price).toFixed(),
4037
- margin: toChainFormat(initialParams.margin).toFixed(),
4038
- triggerPrice: toChainFormat(initialParams.triggerPrice || 0).toFixed(),
4039
- quantity: toChainFormat(initialParams.quantity).toFixed()
4040
- });
4041
- }
4042
- toData() {
4043
- const proto = this.toProto();
4044
- return {
4045
- "@type": "/injective.exchange.v1beta1.MsgCreateBinaryOptionsLimitOrder",
4046
- ...proto
4047
- };
4048
- }
4049
- toAmino() {
4050
- const { params } = this;
4051
- return {
4052
- type: "exchange/MsgCreateBinaryOptionsLimitOrder",
4053
- value: {
4054
- sender: params.injectiveAddress,
4055
- order: {
4056
- market_id: params.marketId,
4057
- order_info: {
4058
- subaccount_id: params.subaccountId,
4059
- fee_recipient: params.feeRecipient,
4060
- price: params.price,
4061
- quantity: params.quantity,
4062
- cid: params.cid || ""
4063
- },
4064
- order_type: params.orderType,
4065
- margin: params.margin,
4066
- trigger_price: params.triggerPrice || "0"
4067
- }
4068
- }
4069
- };
4070
- }
4071
- toWeb3Gw() {
4072
- const { value } = this.toAmino();
4073
- return {
4074
- "@type": "/injective.exchange.v1beta1.MsgCreateBinaryOptionsLimitOrder",
4075
- ...value
4076
- };
4077
- }
4078
- toEip712V2() {
4079
- const { params } = this;
4080
- const web3gw = this.toWeb3Gw();
4081
- const order = web3gw.order;
4082
- return {
4083
- ...web3gw,
4084
- order: {
4085
- ...order,
4086
- order_info: {
4087
- ...order.order_info,
4088
- price: numberToCosmosSdkDecString(params.price),
4089
- quantity: numberToCosmosSdkDecString(params.quantity)
4090
- },
4091
- margin: numberToCosmosSdkDecString(params.margin),
4092
- trigger_price: numberToCosmosSdkDecString(params.triggerPrice || "0"),
4093
- order_type: InjectiveExchangeV1Beta1ExchangePb.OrderType[params.orderType]
4094
- }
4095
- };
4096
- }
4097
- toEip712() {
4098
- var _value$order;
4099
- const { params } = this;
4100
- const { value, type } = this.toAmino();
4101
- return {
4102
- type,
4103
- value: {
4104
- ...value,
4105
- order: {
4106
- ...value.order,
4107
- order_info: {
4108
- ...(_value$order = value.order) === null || _value$order === void 0 ? void 0 : _value$order.order_info,
4109
- price: toChainFormat(params.price).toFixed(),
4110
- quantity: toChainFormat(params.quantity).toFixed()
4111
- },
4112
- margin: toChainFormat(params.margin).toFixed(),
4113
- trigger_price: toChainFormat(params.triggerPrice || "0").toFixed()
4114
- }
4115
- }
4116
- };
4117
- }
4118
- toDirectSign() {
4119
- return {
4120
- type: "/injective.exchange.v1beta1.MsgCreateBinaryOptionsLimitOrder",
4121
- message: this.toProto()
4122
- };
4123
- }
4124
- toBinary() {
4125
- return InjectiveExchangeV1Beta1TxPb.MsgCreateBinaryOptionsLimitOrder.toBinary(this.toProto());
4126
- }
4127
- };
4128
-
4129
3767
  //#endregion
4130
3768
  //#region src/core/modules/exchange/msgs/MsgBatchCancelDerivativeOrdersV2.ts
4131
3769
  /**
@@ -4159,9 +3797,12 @@ var MsgBatchCancelDerivativeOrdersV2 = class MsgBatchCancelDerivativeOrdersV2 ex
4159
3797
  };
4160
3798
  }
4161
3799
  toAmino() {
3800
+ return toAminoJson(InjectiveExchangeV2TxPb.MsgBatchCancelDerivativeOrders, this.toProto());
3801
+ }
3802
+ toAminoRaw() {
4162
3803
  const proto = this.toProto();
4163
3804
  return {
4164
- type: "exchange/MsgBatchCancelDerivativeOrders",
3805
+ type: "exchange/v2/MsgBatchCancelDerivativeOrders",
4165
3806
  value: {
4166
3807
  sender: proto.sender,
4167
3808
  data: proto.data.map((orderData) => ({
@@ -4175,7 +3816,7 @@ var MsgBatchCancelDerivativeOrdersV2 = class MsgBatchCancelDerivativeOrdersV2 ex
4175
3816
  };
4176
3817
  }
4177
3818
  toWeb3Gw() {
4178
- const { value } = this.toAmino();
3819
+ const { value } = this.toAminoRaw();
4179
3820
  return {
4180
3821
  "@type": "/injective.exchange.v2.MsgBatchCancelDerivativeOrders",
4181
3822
  ...value
@@ -4194,7 +3835,7 @@ var MsgBatchCancelDerivativeOrdersV2 = class MsgBatchCancelDerivativeOrdersV2 ex
4194
3835
 
4195
3836
  //#endregion
4196
3837
  //#region src/core/modules/exchange/msgs/MsgCreateDerivativeMarketOrderV2.ts
4197
- const createMarketOrder$2 = (params) => {
3838
+ const createMarketOrder = (params) => {
4198
3839
  const orderInfo = InjectiveExchangeV2OrderPb.OrderInfo.create({
4199
3840
  subaccountId: params.subaccountId,
4200
3841
  feeRecipient: params.feeRecipient,
@@ -4224,7 +3865,7 @@ var MsgCreateDerivativeMarketOrderV2 = class MsgCreateDerivativeMarketOrderV2 ex
4224
3865
  }
4225
3866
  toProto() {
4226
3867
  const { params: initialParams } = this;
4227
- return createMarketOrder$2({
3868
+ return createMarketOrder({
4228
3869
  ...initialParams,
4229
3870
  price: toChainFormat(initialParams.price).toFixed(),
4230
3871
  margin: toChainFormat(initialParams.margin).toFixed(),
@@ -4240,9 +3881,12 @@ var MsgCreateDerivativeMarketOrderV2 = class MsgCreateDerivativeMarketOrderV2 ex
4240
3881
  };
4241
3882
  }
4242
3883
  toAmino() {
3884
+ return toAminoJson(InjectiveExchangeV2TxPb.MsgCreateDerivativeMarketOrder, this.toProto());
3885
+ }
3886
+ toAminoRaw() {
4243
3887
  const { params } = this;
4244
3888
  return {
4245
- type: "exchange/MsgCreateDerivativeMarketOrder",
3889
+ type: "exchange/v2/MsgCreateDerivativeMarketOrder",
4246
3890
  value: {
4247
3891
  sender: params.injectiveAddress,
4248
3892
  order: {
@@ -4263,7 +3907,7 @@ var MsgCreateDerivativeMarketOrderV2 = class MsgCreateDerivativeMarketOrderV2 ex
4263
3907
  };
4264
3908
  }
4265
3909
  toWeb3Gw() {
4266
- const { value } = this.toAmino();
3910
+ const { value } = this.toAminoRaw();
4267
3911
  return {
4268
3912
  "@type": "/injective.exchange.v2.MsgCreateDerivativeMarketOrder",
4269
3913
  ...value
@@ -4288,27 +3932,6 @@ var MsgCreateDerivativeMarketOrderV2 = class MsgCreateDerivativeMarketOrderV2 ex
4288
3932
  }
4289
3933
  };
4290
3934
  }
4291
- toEip712() {
4292
- const { params } = this;
4293
- const { value, type } = this.toAmino();
4294
- const { expiration_block: _eb, ...orderWithoutExpiration } = value.order || {};
4295
- return {
4296
- type,
4297
- value: {
4298
- ...value,
4299
- order: {
4300
- ...orderWithoutExpiration,
4301
- order_info: {
4302
- ...orderWithoutExpiration === null || orderWithoutExpiration === void 0 ? void 0 : orderWithoutExpiration.order_info,
4303
- price: toChainFormat(params.price).toFixed(),
4304
- quantity: toChainFormat(params.quantity).toFixed()
4305
- },
4306
- margin: toChainFormat(params.margin).toFixed(),
4307
- trigger_price: toChainFormat(params.triggerPrice || "0").toFixed()
4308
- }
4309
- }
4310
- };
4311
- }
4312
3935
  toDirectSign() {
4313
3936
  return {
4314
3937
  type: "/injective.exchange.v2.MsgCreateDerivativeMarketOrder",
@@ -4353,9 +3976,12 @@ var MsgUpdateSubaccountRiskProfileV2 = class MsgUpdateSubaccountRiskProfileV2 ex
4353
3976
  };
4354
3977
  }
4355
3978
  toAmino() {
3979
+ return toAminoJson(InjectiveExchangeV2TxPb.MsgUpdateSubaccountRiskProfile, this.toProto());
3980
+ }
3981
+ toAminoRaw() {
4356
3982
  const proto = this.toProto();
4357
3983
  return {
4358
- type: "exchange/MsgUpdateSubaccountRiskProfile",
3984
+ type: "exchange/v2/MsgUpdateSubaccountRiskProfile",
4359
3985
  value: {
4360
3986
  sender: proto.sender,
4361
3987
  subaccount_id: proto.subaccountId,
@@ -4364,7 +3990,7 @@ var MsgUpdateSubaccountRiskProfileV2 = class MsgUpdateSubaccountRiskProfileV2 ex
4364
3990
  };
4365
3991
  }
4366
3992
  toWeb3Gw() {
4367
- const { value } = this.toAmino();
3993
+ const { value } = this.toAminoRaw();
4368
3994
  return {
4369
3995
  "@type": "/injective.exchange.v2.MsgUpdateSubaccountRiskProfile",
4370
3996
  ...value
@@ -4377,29 +4003,22 @@ var MsgUpdateSubaccountRiskProfileV2 = class MsgUpdateSubaccountRiskProfileV2 ex
4377
4003
  risk_profile: riskProfileToWeb3Gw(params.riskProfile, true)
4378
4004
  };
4379
4005
  }
4380
- toEip712() {
4381
- const { value, type } = this.toAmino();
4382
- const riskProfile = value.risk_profile;
4383
- return {
4384
- type,
4385
- value: {
4386
- ...value,
4387
- risk_profile: {
4388
- mode: riskProfile.mode,
4389
- reservation_policy: riskProfile.reservation_policy
4390
- }
4391
- }
4392
- };
4393
- }
4394
4006
  toEip712Types() {
4395
4007
  const map = /* @__PURE__ */ new Map();
4396
- map.set("TypeRiskProfile", [{
4397
- name: "mode",
4398
- type: "int32"
4399
- }, {
4400
- name: "reservation_policy",
4401
- type: "int32"
4402
- }]);
4008
+ map.set("TypeRiskProfile", [
4009
+ {
4010
+ name: "mode",
4011
+ type: "int32"
4012
+ },
4013
+ {
4014
+ name: "reservation_policy",
4015
+ type: "int32"
4016
+ },
4017
+ ...this.params.riskProfile.creditLineId ? [{
4018
+ name: "credit_line_id",
4019
+ type: "string"
4020
+ }] : []
4021
+ ]);
4403
4022
  map.set("MsgValue", [
4404
4023
  {
4405
4024
  name: "sender",
@@ -4428,941 +4047,149 @@ var MsgUpdateSubaccountRiskProfileV2 = class MsgUpdateSubaccountRiskProfileV2 ex
4428
4047
  };
4429
4048
 
4430
4049
  //#endregion
4431
- //#region src/core/modules/exchange/msgs/MsgAdminUpdateBinaryOptionsMarket.ts
4432
- const createMessage$3 = (params) => {
4433
- return InjectiveExchangeV1Beta1TxPb.MsgAdminUpdateBinaryOptionsMarket.create({
4434
- sender: params.sender,
4435
- marketId: params.marketId,
4436
- settlementPrice: params.settlementPrice,
4437
- expirationTimestamp: BigInt(params.expirationTimestamp),
4438
- settlementTimestamp: BigInt(params.settlementTimestamp),
4439
- status: params.status
4440
- });
4441
- };
4050
+ //#region src/core/modules/typeUrl.ts
4051
+ /** `/<proto type name>`: the type URL of a message */
4052
+ const toTypeUrl = (type) => `/${type.typeName}`;
4053
+
4054
+ //#endregion
4055
+ //#region src/core/modules/exchange/msgs/MsgUpdateSubaccountMarketRiskModeV2.ts
4442
4056
  /**
4057
+ * Pins (or unpins) the margin mode of one derivative market for a subaccount.
4058
+ *
4443
4059
  * @category Messages
4444
4060
  */
4445
- var MsgAdminUpdateBinaryOptionsMarket = class MsgAdminUpdateBinaryOptionsMarket extends MsgBase {
4061
+ var MsgUpdateSubaccountMarketRiskModeV2 = class MsgUpdateSubaccountMarketRiskModeV2 extends MsgBase {
4446
4062
  static fromJSON(params) {
4447
- return new MsgAdminUpdateBinaryOptionsMarket(params);
4063
+ return new MsgUpdateSubaccountMarketRiskModeV2(params);
4448
4064
  }
4449
4065
  toProto() {
4450
- const { params: initialParams } = this;
4451
- return createMessage$3({
4452
- ...initialParams,
4453
- settlementPrice: toChainFormat(initialParams.settlementPrice).toFixed()
4454
- });
4455
- }
4456
- toData() {
4457
- const proto = this.toProto();
4458
- return {
4459
- "@type": "/injective.exchange.v1beta1.MsgAdminUpdateBinaryOptionsMarket",
4460
- ...proto
4461
- };
4462
- }
4463
- toAmino() {
4464
- const { params } = this;
4465
- return {
4466
- type: "exchange/MsgAdminUpdateBinaryOptionsMarket",
4467
- value: {
4468
- sender: params.sender,
4469
- market_id: params.marketId,
4470
- settlement_price: params.settlementPrice,
4471
- expiration_timestamp: params.expirationTimestamp,
4472
- settlement_timestamp: params.settlementTimestamp,
4473
- status: params.status
4474
- }
4475
- };
4476
- }
4477
- toWeb3Gw() {
4478
- const { value } = this.toAmino();
4479
- return {
4480
- "@type": "/injective.exchange.v1beta1.MsgAdminUpdateBinaryOptionsMarket",
4481
- ...value
4482
- };
4483
- }
4484
- toEip712() {
4485
- const { type, value } = this.toAmino();
4486
- return {
4487
- type,
4488
- value: {
4489
- ...value,
4490
- settlement_price: toChainFormat(value.settlement_price).toFixed()
4491
- }
4492
- };
4493
- }
4494
- toEip712V2() {
4495
- const { params } = this;
4496
- return {
4497
- ...this.toWeb3Gw(),
4498
- settlement_price: numberToCosmosSdkDecString(params.settlementPrice),
4499
- status: InjectiveExchangeV1Beta1ExchangePb.MarketStatus[params.status]
4500
- };
4501
- }
4502
- toDirectSign() {
4503
- return {
4504
- type: "/injective.exchange.v1beta1.MsgAdminUpdateBinaryOptionsMarket",
4505
- message: this.toProto()
4506
- };
4507
- }
4508
- toBinary() {
4509
- return InjectiveExchangeV1Beta1TxPb.MsgAdminUpdateBinaryOptionsMarket.toBinary(this.toProto());
4510
- }
4511
- };
4512
-
4513
- //#endregion
4514
- //#region src/core/modules/exchange/msgs/MsgBatchCancelBinaryOptionsOrders.ts
4515
- /**
4516
- * @category Messages
4517
- */
4518
- var MsgBatchCancelBinaryOptionsOrders = class MsgBatchCancelBinaryOptionsOrders extends MsgBase {
4519
- static fromJSON(params) {
4520
- return new MsgBatchCancelBinaryOptionsOrders(params);
4521
- }
4522
- toProto() {
4523
- const { params } = this;
4524
- const orderDataList = params.orders.map((order) => {
4525
- return InjectiveExchangeV1Beta1TxPb.OrderData.create({
4526
- marketId: order.marketId,
4527
- subaccountId: order.subaccountId,
4528
- orderHash: order.orderHash || "",
4529
- orderMask: InjectiveExchangeV1Beta1ExchangePb.OrderMask.ANY,
4530
- cid: order.cid || ""
4531
- });
4532
- });
4533
- return InjectiveExchangeV1Beta1TxPb.MsgBatchCancelBinaryOptionsOrders.create({
4534
- sender: params.injectiveAddress,
4535
- data: orderDataList
4536
- });
4537
- }
4538
- toData() {
4539
- const proto = this.toProto();
4540
- return {
4541
- "@type": "/injective.exchange.v1beta1.MsgBatchCancelBinaryOptionsOrders",
4542
- ...proto
4543
- };
4544
- }
4545
- toAmino() {
4546
- const { params } = this;
4547
- return {
4548
- type: "exchange/MsgBatchCancelBinaryOptionsOrders",
4549
- value: {
4550
- sender: params.injectiveAddress,
4551
- data: params.orders.map((order) => ({
4552
- market_id: order.marketId,
4553
- subaccount_id: order.subaccountId,
4554
- order_hash: order.orderHash,
4555
- order_mask: order.orderMask,
4556
- cid: order.cid
4557
- }))
4558
- }
4559
- };
4560
- }
4561
- toWeb3Gw() {
4562
- const { value } = this.toAmino();
4563
- return {
4564
- "@type": "/injective.exchange.v1beta1.MsgBatchCancelBinaryOptionsOrders",
4565
- ...value
4566
- };
4567
- }
4568
- toDirectSign() {
4569
- return {
4570
- type: "/injective.exchange.v1beta1.MsgBatchCancelBinaryOptionsOrders",
4571
- message: this.toProto()
4572
- };
4573
- }
4574
- toBinary() {
4575
- return InjectiveExchangeV1Beta1TxPb.MsgBatchCancelBinaryOptionsOrders.toBinary(this.toProto());
4576
- }
4577
- };
4578
-
4579
- //#endregion
4580
- //#region src/core/modules/exchange/msgs/MsgCreateBinaryOptionsMarketOrder.ts
4581
- const createMarketOrder$1 = (params) => {
4582
- const orderInfo = InjectiveExchangeV1Beta1ExchangePb.OrderInfo.create({
4583
- subaccountId: params.subaccountId,
4584
- feeRecipient: params.feeRecipient,
4585
- price: params.price,
4586
- quantity: params.quantity,
4587
- cid: params.cid || ""
4588
- });
4589
- const derivativeOrder = InjectiveExchangeV1Beta1ExchangePb.DerivativeOrder.create({
4590
- marketId: params.marketId,
4591
- orderInfo,
4592
- orderType: params.orderType,
4593
- margin: params.margin,
4594
- triggerPrice: params.triggerPrice || "0"
4595
- });
4596
- return InjectiveExchangeV1Beta1TxPb.MsgCreateBinaryOptionsMarketOrder.create({
4597
- sender: params.injectiveAddress,
4598
- order: derivativeOrder
4599
- });
4600
- };
4601
- /**
4602
- * @category Messages
4603
- */
4604
- var MsgCreateBinaryOptionsMarketOrder = class MsgCreateBinaryOptionsMarketOrder extends MsgBase {
4605
- static fromJSON(params) {
4606
- return new MsgCreateBinaryOptionsMarketOrder(params);
4607
- }
4608
- toProto() {
4609
- const { params: initialParams } = this;
4610
- return createMarketOrder$1({
4611
- ...initialParams,
4612
- price: toChainFormat(initialParams.price).toFixed(),
4613
- margin: toChainFormat(initialParams.margin).toFixed(),
4614
- triggerPrice: toChainFormat(initialParams.triggerPrice || 0).toFixed(),
4615
- quantity: toChainFormat(initialParams.quantity).toFixed()
4616
- });
4617
- }
4618
- toData() {
4619
- const proto = this.toProto();
4620
- return {
4621
- "@type": "/injective.exchange.v1beta1.MsgCreateBinaryOptionsMarketOrder",
4622
- ...proto
4623
- };
4624
- }
4625
- toAmino() {
4626
- const { params } = this;
4627
- return {
4628
- type: "exchange/MsgCreateBinaryOptionsMarketOrder",
4629
- value: {
4630
- sender: params.injectiveAddress,
4631
- order: {
4632
- market_id: params.marketId,
4633
- order_info: {
4634
- subaccount_id: params.subaccountId,
4635
- fee_recipient: params.feeRecipient,
4636
- price: params.price,
4637
- quantity: params.quantity,
4638
- cid: params.cid || ""
4639
- },
4640
- order_type: params.orderType,
4641
- margin: params.margin,
4642
- trigger_price: params.triggerPrice || "0"
4643
- }
4644
- }
4645
- };
4646
- }
4647
- toWeb3Gw() {
4648
- const { value } = this.toAmino();
4649
- return {
4650
- "@type": "/injective.exchange.v1beta1.MsgCreateBinaryOptionsMarketOrder",
4651
- ...value
4652
- };
4653
- }
4654
- toEip712V2() {
4655
- const { params } = this;
4656
- const web3gw = this.toWeb3Gw();
4657
- const order = web3gw.order;
4658
- return {
4659
- ...web3gw,
4660
- order: {
4661
- ...order,
4662
- order_info: {
4663
- ...order.order_info,
4664
- price: numberToCosmosSdkDecString(params.price),
4665
- quantity: numberToCosmosSdkDecString(params.quantity)
4666
- },
4667
- margin: numberToCosmosSdkDecString(params.margin),
4668
- trigger_price: numberToCosmosSdkDecString(params.triggerPrice || "0"),
4669
- order_type: InjectiveExchangeV1Beta1ExchangePb.OrderType[params.orderType]
4670
- }
4671
- };
4672
- }
4673
- toEip712() {
4674
- var _value$order;
4675
- const { params } = this;
4676
- const { value, type } = this.toAmino();
4677
- return {
4678
- type,
4679
- value: {
4680
- ...value,
4681
- order: {
4682
- ...value.order,
4683
- order_info: {
4684
- ...(_value$order = value.order) === null || _value$order === void 0 ? void 0 : _value$order.order_info,
4685
- price: toChainFormat(params.price).toFixed(),
4686
- quantity: toChainFormat(params.quantity).toFixed()
4687
- },
4688
- margin: toChainFormat(params.margin).toFixed(),
4689
- trigger_price: toChainFormat(params.triggerPrice || "0").toFixed()
4690
- }
4691
- }
4692
- };
4693
- }
4694
- toDirectSign() {
4695
- return {
4696
- type: "/injective.exchange.v1beta1.MsgCreateBinaryOptionsMarketOrder",
4697
- message: this.toProto()
4698
- };
4699
- }
4700
- toBinary() {
4701
- return InjectiveExchangeV1Beta1TxPb.MsgCreateBinaryOptionsMarketOrder.toBinary(this.toProto());
4702
- }
4703
- };
4704
-
4705
- //#endregion
4706
- //#region src/core/modules/exchange/msgs/MsgCreateBinaryOptionsLimitOrderV2.ts
4707
- const createLimitOrder = (params) => {
4708
- const orderInfo = InjectiveExchangeV2OrderPb.OrderInfo.create({
4709
- subaccountId: params.subaccountId,
4710
- feeRecipient: params.feeRecipient,
4711
- price: params.price,
4712
- quantity: params.quantity,
4713
- cid: params.cid || ""
4714
- });
4715
- const derivativeOrder = InjectiveExchangeV2OrderPb.DerivativeOrder.create({
4716
- marketId: params.marketId,
4717
- orderInfo,
4718
- orderType: params.orderType,
4719
- margin: params.margin,
4720
- triggerPrice: params.triggerPrice || "0",
4721
- expirationBlock: params.expirationBlock ? BigInt(params.expirationBlock) : BigInt(0)
4722
- });
4723
- return InjectiveExchangeV2TxPb.MsgCreateBinaryOptionsLimitOrder.create({
4724
- sender: params.injectiveAddress,
4725
- order: derivativeOrder
4726
- });
4727
- };
4728
- /**
4729
- * @category Messages
4730
- */
4731
- var MsgCreateBinaryOptionsLimitOrderV2 = class MsgCreateBinaryOptionsLimitOrderV2 extends MsgBase {
4732
- static fromJSON(params) {
4733
- return new MsgCreateBinaryOptionsLimitOrderV2(params);
4734
- }
4735
- toProto() {
4736
- const { params: initialParams } = this;
4737
- return createLimitOrder({
4738
- ...initialParams,
4739
- price: toChainFormat(initialParams.price).toFixed(),
4740
- margin: toChainFormat(initialParams.margin).toFixed(),
4741
- triggerPrice: toChainFormat(initialParams.triggerPrice || 0).toFixed(),
4742
- quantity: toChainFormat(initialParams.quantity).toFixed()
4743
- });
4744
- }
4745
- toData() {
4746
- const proto = this.toProto();
4747
- return {
4748
- "@type": "/injective.exchange.v2.MsgCreateBinaryOptionsLimitOrder",
4749
- ...proto
4750
- };
4751
- }
4752
- toAmino() {
4753
- const { params } = this;
4754
- return {
4755
- type: "exchange/MsgCreateBinaryOptionsLimitOrder",
4756
- value: {
4757
- sender: params.injectiveAddress,
4758
- order: {
4759
- market_id: params.marketId,
4760
- order_info: {
4761
- subaccount_id: params.subaccountId,
4762
- fee_recipient: params.feeRecipient,
4763
- price: params.price,
4764
- quantity: params.quantity,
4765
- cid: params.cid || ""
4766
- },
4767
- order_type: params.orderType,
4768
- margin: params.margin,
4769
- trigger_price: params.triggerPrice || "0",
4770
- expiration_block: params.expirationBlock || "0"
4771
- }
4772
- }
4773
- };
4774
- }
4775
- toWeb3Gw() {
4776
- const { value } = this.toAmino();
4777
- return {
4778
- "@type": "/injective.exchange.v2.MsgCreateBinaryOptionsLimitOrder",
4779
- ...value
4780
- };
4781
- }
4782
- toEip712V2() {
4783
- const { params } = this;
4784
- const web3gw = this.toWeb3Gw();
4785
- const order = web3gw.order;
4786
- return {
4787
- ...web3gw,
4788
- order: {
4789
- ...order,
4790
- order_info: {
4791
- ...order.order_info,
4792
- price: numberToCosmosSdkDecString(params.price),
4793
- quantity: numberToCosmosSdkDecString(params.quantity)
4794
- },
4795
- margin: numberToCosmosSdkDecString(params.margin),
4796
- trigger_price: numberToCosmosSdkDecString(params.triggerPrice || "0"),
4797
- order_type: InjectiveExchangeV2OrderPb.OrderType[params.orderType]
4798
- }
4799
- };
4800
- }
4801
- toEip712() {
4802
- const { params } = this;
4803
- const { value, type } = this.toAmino();
4804
- const { expiration_block: _eb, ...orderWithoutExpiration } = value.order || {};
4805
- return {
4806
- type,
4807
- value: {
4808
- ...value,
4809
- order: {
4810
- ...orderWithoutExpiration,
4811
- order_info: {
4812
- ...orderWithoutExpiration === null || orderWithoutExpiration === void 0 ? void 0 : orderWithoutExpiration.order_info,
4813
- price: toChainFormat(params.price).toFixed(),
4814
- quantity: toChainFormat(params.quantity).toFixed()
4815
- },
4816
- margin: toChainFormat(params.margin).toFixed(),
4817
- trigger_price: toChainFormat(params.triggerPrice || "0").toFixed()
4818
- }
4819
- }
4820
- };
4821
- }
4822
- toDirectSign() {
4823
- return {
4824
- type: "/injective.exchange.v2.MsgCreateBinaryOptionsLimitOrder",
4825
- message: this.toProto()
4826
- };
4827
- }
4828
- toBinary() {
4829
- return InjectiveExchangeV2TxPb.MsgCreateBinaryOptionsLimitOrder.toBinary(this.toProto());
4830
- }
4831
- };
4832
-
4833
- //#endregion
4834
- //#region src/core/modules/exchange/msgs/MsgSetDelegationTransferReceiversV2.ts
4835
- /**
4836
- * @deprecated Delegation transfer receiver support was removed. This message is kept for backward compatibility.
4837
- * @category Messages
4838
- */
4839
- var MsgSetDelegationTransferReceiversV2 = class MsgSetDelegationTransferReceiversV2 extends MsgBase {
4840
- static fromJSON(params) {
4841
- return new MsgSetDelegationTransferReceiversV2(params);
4842
- }
4843
- toProto() {
4844
- const { params } = this;
4845
- return InjectiveExchangeV2TxPb.MsgSetDelegationTransferReceivers.create({
4846
- sender: params.sender,
4847
- receivers: params.receivers
4848
- });
4849
- }
4850
- toData() {
4851
- const proto = this.toProto();
4852
- return {
4853
- "@type": "/injective.exchange.v2.MsgSetDelegationTransferReceivers",
4854
- ...proto
4855
- };
4856
- }
4857
- toAmino() {
4858
- const proto = this.toProto();
4859
- return {
4860
- type: "exchange/MsgSetDelegationTransferReceivers",
4861
- value: {
4862
- sender: proto.sender,
4863
- receivers: proto.receivers
4864
- }
4865
- };
4866
- }
4867
- toWeb3Gw() {
4868
- const { value } = this.toAmino();
4869
- return {
4870
- "@type": "/injective.exchange.v2.MsgSetDelegationTransferReceivers",
4871
- ...value
4872
- };
4873
- }
4874
- toDirectSign() {
4875
- return {
4876
- type: "/injective.exchange.v2.MsgSetDelegationTransferReceivers",
4877
- message: this.toProto()
4878
- };
4879
- }
4880
- toBinary() {
4881
- return InjectiveExchangeV2TxPb.MsgSetDelegationTransferReceivers.toBinary(this.toProto());
4882
- }
4883
- };
4884
-
4885
- //#endregion
4886
- //#region src/core/modules/exchange/msgs/MsgInstantBinaryOptionsMarketLaunch.ts
4887
- const createMessage$2 = (params) => {
4888
- return InjectiveExchangeV1Beta1TxPb.MsgInstantBinaryOptionsMarketLaunch.create({
4889
- sender: params.proposer,
4890
- ticker: params.market.ticker,
4891
- oracleSymbol: params.market.oracleSymbol,
4892
- oracleProvider: params.market.oracleProvider,
4893
- oracleType: params.market.oracleType,
4894
- oracleScaleFactor: params.market.oracleScaleFactor,
4895
- makerFeeRate: params.market.makerFeeRate,
4896
- takerFeeRate: params.market.takerFeeRate,
4897
- expirationTimestamp: BigInt(params.market.expirationTimestamp),
4898
- settlementTimestamp: BigInt(params.market.settlementTimestamp),
4899
- admin: params.market.admin,
4900
- quoteDenom: params.market.quoteDenom,
4901
- minPriceTickSize: params.market.minPriceTickSize,
4902
- minQuantityTickSize: params.market.minQuantityTickSize,
4903
- minNotional: params.market.minNotional
4904
- });
4905
- };
4906
- /**
4907
- * @category Messages
4908
- */
4909
- var MsgInstantBinaryOptionsMarketLaunch = class MsgInstantBinaryOptionsMarketLaunch extends MsgBase {
4910
- static fromJSON(params) {
4911
- return new MsgInstantBinaryOptionsMarketLaunch(params);
4912
- }
4913
- toProto() {
4914
- const { params: initialParams } = this;
4915
- return createMessage$2({
4916
- ...initialParams,
4917
- market: {
4918
- ...initialParams.market,
4919
- minPriceTickSize: toChainFormat(initialParams.market.minPriceTickSize).toFixed(),
4920
- makerFeeRate: toChainFormat(initialParams.market.makerFeeRate).toFixed(),
4921
- takerFeeRate: toChainFormat(initialParams.market.takerFeeRate).toFixed(),
4922
- minQuantityTickSize: toChainFormat(initialParams.market.minQuantityTickSize).toFixed(),
4923
- minNotional: toChainFormat(initialParams.market.minNotional).toFixed()
4924
- }
4925
- });
4926
- }
4927
- toData() {
4928
- const proto = this.toProto();
4929
- return {
4930
- "@type": "/injective.exchange.v1beta1.MsgInstantBinaryOptionsMarketLaunch",
4931
- ...proto
4932
- };
4933
- }
4934
- toAmino() {
4935
- const { params } = this;
4936
- return {
4937
- type: "exchange/MsgInstantBinaryOptionsMarketLaunch",
4938
- value: {
4939
- sender: params.proposer,
4940
- ticker: params.market.ticker,
4941
- oracle_symbol: params.market.oracleSymbol,
4942
- oracle_provider: params.market.oracleProvider,
4943
- oracle_type: params.market.oracleType,
4944
- oracle_scale_factor: params.market.oracleScaleFactor,
4945
- maker_fee_rate: params.market.makerFeeRate,
4946
- taker_fee_rate: params.market.takerFeeRate,
4947
- expiration_timestamp: params.market.expirationTimestamp.toString(),
4948
- settlement_timestamp: params.market.settlementTimestamp.toString(),
4949
- admin: params.market.admin,
4950
- quote_denom: params.market.quoteDenom,
4951
- min_price_tick_size: params.market.minPriceTickSize,
4952
- min_quantity_tick_size: params.market.minQuantityTickSize,
4953
- min_notional: params.market.minNotional
4954
- }
4955
- };
4956
- }
4957
- toWeb3Gw() {
4958
- const { value } = this.toAmino();
4959
- return {
4960
- "@type": "/injective.exchange.v1beta1.MsgInstantBinaryOptionsMarketLaunch",
4961
- ...value
4962
- };
4963
- }
4964
- toEip712() {
4965
- const { type, value } = this.toAmino();
4966
- return {
4967
- type,
4968
- value: {
4969
- ...value,
4970
- min_price_tick_size: toChainFormat(value.min_price_tick_size).toFixed(),
4971
- min_quantity_tick_size: toChainFormat(value.min_quantity_tick_size).toFixed(),
4972
- min_notional: toChainFormat(value.min_notional).toFixed(),
4973
- taker_fee_rate: toChainFormat(value.taker_fee_rate).toFixed(),
4974
- maker_fee_rate: toChainFormat(value.maker_fee_rate).toFixed()
4975
- }
4976
- };
4977
- }
4978
- toEip712V2() {
4979
- const { params } = this;
4980
- return {
4981
- ...this.toWeb3Gw(),
4982
- min_price_tick_size: numberToCosmosSdkDecString(params.market.minPriceTickSize),
4983
- min_quantity_tick_size: numberToCosmosSdkDecString(params.market.minQuantityTickSize),
4984
- min_notional: numberToCosmosSdkDecString(params.market.minNotional),
4985
- taker_fee_rate: numberToCosmosSdkDecString(params.market.takerFeeRate),
4986
- maker_fee_rate: numberToCosmosSdkDecString(params.market.makerFeeRate),
4987
- oracle_type: InjectiveOracleV1Beta1OraclePb.OracleType[params.market.oracleType]
4988
- };
4989
- }
4990
- toDirectSign() {
4991
- return {
4992
- type: "/injective.exchange.v1beta1.MsgInstantBinaryOptionsMarketLaunch",
4993
- message: this.toProto()
4994
- };
4995
- }
4996
- toBinary() {
4997
- return InjectiveExchangeV1Beta1TxPb.MsgInstantBinaryOptionsMarketLaunch.toBinary(this.toProto());
4998
- }
4999
- };
5000
-
5001
- //#endregion
5002
- //#region src/core/modules/exchange/msgs/MsgAdminUpdateBinaryOptionsMarketV2.ts
5003
- const createMessage$1 = (params) => {
5004
- return InjectiveExchangeV2TxPb.MsgAdminUpdateBinaryOptionsMarket.create({
5005
- sender: params.sender,
5006
- marketId: params.marketId,
5007
- settlementPrice: params.settlementPrice,
5008
- expirationTimestamp: BigInt(params.expirationTimestamp),
5009
- settlementTimestamp: BigInt(params.settlementTimestamp),
5010
- status: params.status
5011
- });
5012
- };
5013
- /**
5014
- * @category Messages
5015
- */
5016
- var MsgAdminUpdateBinaryOptionsMarketV2 = class MsgAdminUpdateBinaryOptionsMarketV2 extends MsgBase {
5017
- static fromJSON(params) {
5018
- return new MsgAdminUpdateBinaryOptionsMarketV2(params);
5019
- }
5020
- toProto() {
5021
- const { params: initialParams } = this;
5022
- return createMessage$1({
5023
- ...initialParams,
5024
- settlementPrice: toChainFormat(initialParams.settlementPrice).toFixed()
4066
+ const { params } = this;
4067
+ return InjectiveExchangeV2TxPb.MsgUpdateSubaccountMarketRiskMode.create({
4068
+ sender: params.sender,
4069
+ subaccountId: params.subaccountId,
4070
+ marketId: params.marketId,
4071
+ mode: params.mode
5025
4072
  });
5026
4073
  }
5027
4074
  toData() {
5028
4075
  const proto = this.toProto();
5029
4076
  return {
5030
- "@type": "/injective.exchange.v2.MsgAdminUpdateBinaryOptionsMarket",
4077
+ "@type": toTypeUrl(InjectiveExchangeV2TxPb.MsgUpdateSubaccountMarketRiskMode),
5031
4078
  ...proto
5032
4079
  };
5033
4080
  }
5034
4081
  toAmino() {
5035
- const { params } = this;
4082
+ return toAminoJson(InjectiveExchangeV2TxPb.MsgUpdateSubaccountMarketRiskMode, this.toProto());
4083
+ }
4084
+ toAminoRaw() {
4085
+ const proto = this.toProto();
5036
4086
  return {
5037
- type: "exchange/MsgAdminUpdateBinaryOptionsMarket",
4087
+ type: "exchange/v2/MsgUpdateSubaccountMarketRiskMode",
5038
4088
  value: {
5039
- sender: params.sender,
5040
- market_id: params.marketId,
5041
- settlement_price: params.settlementPrice,
5042
- expiration_timestamp: params.expirationTimestamp,
5043
- settlement_timestamp: params.settlementTimestamp,
5044
- status: params.status
4089
+ sender: proto.sender,
4090
+ subaccount_id: proto.subaccountId,
4091
+ market_id: proto.marketId,
4092
+ mode: proto.mode
5045
4093
  }
5046
4094
  };
5047
4095
  }
5048
4096
  toWeb3Gw() {
5049
- const { value } = this.toAmino();
4097
+ const { value } = this.toAminoRaw();
5050
4098
  return {
5051
- "@type": "/injective.exchange.v2.MsgAdminUpdateBinaryOptionsMarket",
4099
+ "@type": toTypeUrl(InjectiveExchangeV2TxPb.MsgUpdateSubaccountMarketRiskMode),
5052
4100
  ...value
5053
4101
  };
5054
4102
  }
5055
- toEip712() {
5056
- throw new GeneralException(/* @__PURE__ */ new Error("EIP712 v1 is not supported for MsgAdminUpdateBinaryOptionsMarket, use toEip712V2 instead."));
5057
- }
5058
4103
  toEip712V2() {
5059
- const { params } = this;
5060
4104
  return {
5061
4105
  ...this.toWeb3Gw(),
5062
- settlement_price: numberToCosmosSdkDecString(params.settlementPrice),
5063
- status: InjectiveExchangeV2MarketPb.MarketStatus[params.status]
5064
- };
5065
- }
5066
- toDirectSign() {
5067
- return {
5068
- type: "/injective.exchange.v2.MsgAdminUpdateBinaryOptionsMarket",
5069
- message: this.toProto()
5070
- };
5071
- }
5072
- toBinary() {
5073
- return InjectiveExchangeV2TxPb.MsgAdminUpdateBinaryOptionsMarket.toBinary(this.toProto());
5074
- }
5075
- };
5076
-
5077
- //#endregion
5078
- //#region src/core/modules/exchange/msgs/MsgBatchCancelBinaryOptionsOrdersV2.ts
5079
- /**
5080
- * @category Messages
5081
- */
5082
- var MsgBatchCancelBinaryOptionsOrdersV2 = class MsgBatchCancelBinaryOptionsOrdersV2 extends MsgBase {
5083
- static fromJSON(params) {
5084
- return new MsgBatchCancelBinaryOptionsOrdersV2(params);
5085
- }
5086
- toProto() {
5087
- const { params } = this;
5088
- const orderDataList = params.orders.map((order) => {
5089
- return InjectiveExchangeV2TxPb.OrderData.create({
5090
- marketId: order.marketId,
5091
- subaccountId: order.subaccountId,
5092
- orderHash: order.orderHash || "",
5093
- orderMask: order.orderMask || InjectiveExchangeV2OrderPb.OrderMask.ANY,
5094
- cid: order.cid || ""
5095
- });
5096
- });
5097
- return InjectiveExchangeV2TxPb.MsgBatchCancelBinaryOptionsOrders.create({
5098
- sender: params.injectiveAddress,
5099
- data: orderDataList
5100
- });
5101
- }
5102
- toData() {
5103
- const proto = this.toProto();
5104
- return {
5105
- "@type": "/injective.exchange.v2.MsgBatchCancelBinaryOptionsOrders",
5106
- ...proto
4106
+ mode: `RISK_MODE_${InjectiveExchangeV2ExchangePb.RiskMode[this.params.mode]}`
5107
4107
  };
5108
4108
  }
5109
- toAmino() {
5110
- const proto = this.toProto();
5111
- return {
5112
- type: "exchange/MsgBatchCancelBinaryOptionsOrders",
5113
- value: {
5114
- sender: proto.sender,
5115
- data: proto.data.map((orderData) => ({
5116
- market_id: orderData.marketId,
5117
- subaccount_id: orderData.subaccountId,
5118
- order_hash: orderData.orderHash,
5119
- order_mask: orderData.orderMask,
5120
- cid: orderData.cid
5121
- }))
4109
+ toEip712Types() {
4110
+ return (/* @__PURE__ */ new Map()).set("MsgValue", [
4111
+ {
4112
+ name: "sender",
4113
+ type: "string"
4114
+ },
4115
+ {
4116
+ name: "subaccount_id",
4117
+ type: "string"
4118
+ },
4119
+ {
4120
+ name: "market_id",
4121
+ type: "string"
4122
+ },
4123
+ {
4124
+ name: "mode",
4125
+ type: "int32"
5122
4126
  }
5123
- };
5124
- }
5125
- toWeb3Gw() {
5126
- const { value } = this.toAmino();
5127
- return {
5128
- "@type": "/injective.exchange.v2.MsgBatchCancelBinaryOptionsOrders",
5129
- ...value
5130
- };
4127
+ ]);
5131
4128
  }
5132
4129
  toDirectSign() {
4130
+ const proto = this.toProto();
5133
4131
  return {
5134
- type: "/injective.exchange.v2.MsgBatchCancelBinaryOptionsOrders",
5135
- message: this.toProto()
4132
+ type: toTypeUrl(InjectiveExchangeV2TxPb.MsgUpdateSubaccountMarketRiskMode),
4133
+ message: proto
5136
4134
  };
5137
4135
  }
5138
4136
  toBinary() {
5139
- return InjectiveExchangeV2TxPb.MsgBatchCancelBinaryOptionsOrders.toBinary(this.toProto());
4137
+ return InjectiveExchangeV2TxPb.MsgUpdateSubaccountMarketRiskMode.toBinary(this.toProto());
5140
4138
  }
5141
4139
  };
5142
4140
 
5143
4141
  //#endregion
5144
- //#region src/core/modules/exchange/msgs/MsgCreateBinaryOptionsMarketOrderV2.ts
5145
- const createMarketOrder = (params) => {
5146
- const orderInfo = InjectiveExchangeV2OrderPb.OrderInfo.create({
5147
- subaccountId: params.subaccountId,
5148
- feeRecipient: params.feeRecipient,
5149
- price: params.price,
5150
- quantity: params.quantity,
5151
- cid: params.cid || ""
5152
- });
5153
- const derivativeOrder = InjectiveExchangeV2OrderPb.DerivativeOrder.create({
5154
- marketId: params.marketId,
5155
- orderInfo,
5156
- orderType: params.orderType,
5157
- margin: params.margin,
5158
- triggerPrice: params.triggerPrice || "0",
5159
- expirationBlock: params.expirationBlock ? BigInt(params.expirationBlock) : BigInt(0)
5160
- });
5161
- return InjectiveExchangeV2TxPb.MsgCreateBinaryOptionsMarketOrder.create({
5162
- sender: params.injectiveAddress,
5163
- order: derivativeOrder
5164
- });
5165
- };
4142
+ //#region src/core/modules/exchange/msgs/MsgSetDelegationTransferReceiversV2.ts
5166
4143
  /**
4144
+ * @deprecated Delegation transfer receiver support was removed. This message is kept for backward compatibility.
5167
4145
  * @category Messages
5168
4146
  */
5169
- var MsgCreateBinaryOptionsMarketOrderV2 = class MsgCreateBinaryOptionsMarketOrderV2 extends MsgBase {
4147
+ var MsgSetDelegationTransferReceiversV2 = class MsgSetDelegationTransferReceiversV2 extends MsgBase {
5170
4148
  static fromJSON(params) {
5171
- return new MsgCreateBinaryOptionsMarketOrderV2(params);
4149
+ return new MsgSetDelegationTransferReceiversV2(params);
5172
4150
  }
5173
4151
  toProto() {
5174
- const { params: initialParams } = this;
5175
- return createMarketOrder({
5176
- ...initialParams,
5177
- price: toChainFormat(initialParams.price).toFixed(),
5178
- margin: toChainFormat(initialParams.margin).toFixed(),
5179
- triggerPrice: toChainFormat(initialParams.triggerPrice || 0).toFixed(),
5180
- quantity: toChainFormat(initialParams.quantity).toFixed()
4152
+ const { params } = this;
4153
+ return InjectiveExchangeV2TxPb.MsgSetDelegationTransferReceivers.create({
4154
+ sender: params.sender,
4155
+ receivers: params.receivers
5181
4156
  });
5182
4157
  }
5183
4158
  toData() {
5184
4159
  const proto = this.toProto();
5185
4160
  return {
5186
- "@type": "/injective.exchange.v2.MsgCreateBinaryOptionsMarketOrder",
4161
+ "@type": "/injective.exchange.v2.MsgSetDelegationTransferReceivers",
5187
4162
  ...proto
5188
4163
  };
5189
4164
  }
5190
4165
  toAmino() {
5191
- const { params } = this;
5192
- return {
5193
- type: "exchange/MsgCreateBinaryOptionsMarketOrder",
5194
- value: {
5195
- sender: params.injectiveAddress,
5196
- order: {
5197
- market_id: params.marketId,
5198
- order_info: {
5199
- subaccount_id: params.subaccountId,
5200
- fee_recipient: params.feeRecipient,
5201
- price: params.price,
5202
- quantity: params.quantity,
5203
- cid: params.cid || ""
5204
- },
5205
- order_type: params.orderType,
5206
- margin: params.margin,
5207
- trigger_price: params.triggerPrice || "0",
5208
- expiration_block: params.expirationBlock || "0"
5209
- }
5210
- }
5211
- };
5212
- }
5213
- toWeb3Gw() {
5214
- const { value } = this.toAmino();
5215
- return {
5216
- "@type": "/injective.exchange.v2.MsgCreateBinaryOptionsMarketOrder",
5217
- ...value
5218
- };
5219
- }
5220
- toEip712V2() {
5221
- const { params } = this;
5222
- const web3gw = this.toWeb3Gw();
5223
- const order = web3gw.order;
5224
- return {
5225
- ...web3gw,
5226
- order: {
5227
- ...order,
5228
- order_info: {
5229
- ...order.order_info,
5230
- price: numberToCosmosSdkDecString(params.price),
5231
- quantity: numberToCosmosSdkDecString(params.quantity)
5232
- },
5233
- margin: numberToCosmosSdkDecString(params.margin),
5234
- trigger_price: numberToCosmosSdkDecString(params.triggerPrice || "0"),
5235
- order_type: InjectiveExchangeV2OrderPb.OrderType[params.orderType]
5236
- }
5237
- };
5238
- }
5239
- toEip712() {
5240
- const { params } = this;
5241
- const { value, type } = this.toAmino();
5242
- const { expiration_block: _eb, ...orderWithoutExpiration } = value.order || {};
5243
- return {
5244
- type,
5245
- value: {
5246
- ...value,
5247
- order: {
5248
- ...orderWithoutExpiration,
5249
- order_info: {
5250
- ...orderWithoutExpiration === null || orderWithoutExpiration === void 0 ? void 0 : orderWithoutExpiration.order_info,
5251
- price: toChainFormat(params.price).toFixed(),
5252
- quantity: toChainFormat(params.quantity).toFixed()
5253
- },
5254
- margin: toChainFormat(params.margin).toFixed(),
5255
- trigger_price: toChainFormat(params.triggerPrice || "0").toFixed()
5256
- }
5257
- }
5258
- };
5259
- }
5260
- toDirectSign() {
5261
- return {
5262
- type: "/injective.exchange.v2.MsgCreateBinaryOptionsMarketOrder",
5263
- message: this.toProto()
5264
- };
5265
- }
5266
- toBinary() {
5267
- return InjectiveExchangeV2TxPb.MsgCreateBinaryOptionsMarketOrder.toBinary(this.toProto());
5268
- }
5269
- };
5270
-
5271
- //#endregion
5272
- //#region src/core/modules/exchange/msgs/MsgInstantBinaryOptionsMarketLaunchV2.ts
5273
- const createMessage = (params) => {
5274
- return InjectiveExchangeV2TxPb.MsgInstantBinaryOptionsMarketLaunch.create({
5275
- sender: params.proposer,
5276
- ticker: params.market.ticker,
5277
- oracleSymbol: params.market.oracleSymbol,
5278
- oracleProvider: params.market.oracleProvider,
5279
- oracleType: params.market.oracleType,
5280
- oracleScaleFactor: params.market.oracleScaleFactor,
5281
- makerFeeRate: params.market.makerFeeRate,
5282
- takerFeeRate: params.market.takerFeeRate,
5283
- expirationTimestamp: BigInt(params.market.expirationTimestamp),
5284
- settlementTimestamp: BigInt(params.market.settlementTimestamp),
5285
- admin: params.market.admin,
5286
- quoteDenom: params.market.quoteDenom,
5287
- minPriceTickSize: params.market.minPriceTickSize,
5288
- minQuantityTickSize: params.market.minQuantityTickSize,
5289
- minNotional: params.market.minNotional,
5290
- ...params.market.openNotionalCap && { openNotionalCap: params.market.openNotionalCap }
5291
- });
5292
- };
5293
- /**
5294
- * @category Messages
5295
- */
5296
- var MsgInstantBinaryOptionsMarketLaunchV2 = class MsgInstantBinaryOptionsMarketLaunchV2 extends MsgBase {
5297
- static fromJSON(params) {
5298
- return new MsgInstantBinaryOptionsMarketLaunchV2(params);
5299
- }
5300
- toProto() {
5301
- return createMessage(this.params);
4166
+ return toAminoJson(InjectiveExchangeV2TxPb.MsgSetDelegationTransferReceivers, this.toProto());
5302
4167
  }
5303
- toData() {
4168
+ toAminoRaw() {
5304
4169
  const proto = this.toProto();
5305
4170
  return {
5306
- "@type": "/injective.exchange.v2.MsgInstantBinaryOptionsMarketLaunch",
5307
- ...proto
5308
- };
5309
- }
5310
- toAmino() {
5311
- const { params } = this;
5312
- return {
5313
- type: "exchange/MsgInstantBinaryOptionsMarketLaunch",
4171
+ type: "exchange/v2/MsgSetDelegationTransferReceivers",
5314
4172
  value: {
5315
- sender: params.proposer,
5316
- ticker: params.market.ticker,
5317
- oracle_symbol: params.market.oracleSymbol,
5318
- oracle_provider: params.market.oracleProvider,
5319
- oracle_type: params.market.oracleType,
5320
- oracle_scale_factor: params.market.oracleScaleFactor,
5321
- maker_fee_rate: params.market.makerFeeRate,
5322
- taker_fee_rate: params.market.takerFeeRate,
5323
- expiration_timestamp: params.market.expirationTimestamp.toString(),
5324
- settlement_timestamp: params.market.settlementTimestamp.toString(),
5325
- admin: params.market.admin,
5326
- quote_denom: params.market.quoteDenom,
5327
- min_price_tick_size: params.market.minPriceTickSize,
5328
- min_quantity_tick_size: params.market.minQuantityTickSize,
5329
- min_notional: params.market.minNotional,
5330
- ...params.market.openNotionalCap && { open_notional_cap: toOpenNotionalCap$1(params.market.openNotionalCap) }
4173
+ sender: proto.sender,
4174
+ receivers: proto.receivers
5331
4175
  }
5332
4176
  };
5333
4177
  }
5334
4178
  toWeb3Gw() {
5335
- const { value } = this.toAmino();
5336
- return {
5337
- "@type": "/injective.exchange.v2.MsgInstantBinaryOptionsMarketLaunch",
5338
- ...value
5339
- };
5340
- }
5341
- toEip712() {
5342
- throw new GeneralException(/* @__PURE__ */ new Error("EIP712 v1 is not supported for MsgInstantBinaryOptionsMarketLaunch, use toEip712V2 instead."));
5343
- }
5344
- toEip712V2() {
5345
- var _toOpenNotionalCap;
5346
- const { params } = this;
4179
+ const { value } = this.toAminoRaw();
5347
4180
  return {
5348
- ...this.toWeb3Gw(),
5349
- min_price_tick_size: numberToCosmosSdkDecString(params.market.minPriceTickSize),
5350
- min_quantity_tick_size: numberToCosmosSdkDecString(params.market.minQuantityTickSize),
5351
- min_notional: numberToCosmosSdkDecString(params.market.minNotional),
5352
- taker_fee_rate: numberToCosmosSdkDecString(params.market.takerFeeRate),
5353
- maker_fee_rate: numberToCosmosSdkDecString(params.market.makerFeeRate),
5354
- oracle_type: InjectiveOracleV1Beta1OraclePb.OracleType[params.market.oracleType],
5355
- open_notional_cap: (_toOpenNotionalCap = toOpenNotionalCap$1(params.market.openNotionalCap, numberToCosmosSdkDecString)) !== null && _toOpenNotionalCap !== void 0 ? _toOpenNotionalCap : {}
4181
+ "@type": "/injective.exchange.v2.MsgSetDelegationTransferReceivers",
4182
+ ...value
5356
4183
  };
5357
4184
  }
5358
4185
  toDirectSign() {
5359
4186
  return {
5360
- type: "/injective.exchange.v2.MsgInstantBinaryOptionsMarketLaunch",
4187
+ type: "/injective.exchange.v2.MsgSetDelegationTransferReceivers",
5361
4188
  message: this.toProto()
5362
4189
  };
5363
4190
  }
5364
4191
  toBinary() {
5365
- return InjectiveExchangeV2TxPb.MsgInstantBinaryOptionsMarketLaunch.toBinary(this.toProto());
4192
+ return InjectiveExchangeV2TxPb.MsgSetDelegationTransferReceivers.toBinary(this.toProto());
5366
4193
  }
5367
4194
  };
5368
4195
 
@@ -5890,6 +4717,12 @@ var MsgSubmitGenericProposal = class MsgSubmitGenericProposal extends MsgBase {
5890
4717
  ...proto
5891
4718
  };
5892
4719
  }
4720
+ /** the first message's schema stands for all of them, as arrays are typed by their first entry */
4721
+ toEip712Types() {
4722
+ const [first] = this.params.messages;
4723
+ const types = super.toEip712Types();
4724
+ return first ? graftEip712Types(types, "TypeMessagesValue", first.toEip712Types()) : types;
4725
+ }
5893
4726
  toAmino() {
5894
4727
  const { params } = this;
5895
4728
  const proto = this.toProto();
@@ -5926,6 +4759,13 @@ var MsgSubmitGenericProposal = class MsgSubmitGenericProposal extends MsgBase {
5926
4759
  value: messageAdjusted
5927
4760
  };
5928
4761
  }
4762
+ /** each inner message formats its own EIP712 v2 values (e.g. LegacyDec decimals) */
4763
+ toEip712V2() {
4764
+ return {
4765
+ ...this.toWeb3Gw(),
4766
+ messages: this.params.messages.map((msg) => msg.toEip712V2())
4767
+ };
4768
+ }
5929
4769
  toDirectSign() {
5930
4770
  return {
5931
4771
  type: "/cosmos.gov.v1.MsgSubmitProposal",
@@ -6190,9 +5030,16 @@ var MsgGrantProviderPrivilegeProposal = class MsgGrantProviderPrivilegeProposal
6190
5030
  }
6191
5031
  };
6192
5032
 
5033
+ //#endregion
5034
+ //#region src/core/modules/oracle/utils.ts
5035
+ const validateOracleType = (oracleType) => {
5036
+ if (oracleType === OracleTypeMap.PriceFeed || oracleType === OracleTypeMap.Coinbase || oracleType === OracleTypeMap.Stork) throw new GeneralException(/* @__PURE__ */ new Error(`Oracle ${OracleTypeMap[oracleType]} has been removed in core v1.21`));
5037
+ };
5038
+
6193
5039
  //#endregion
6194
5040
  //#region src/core/modules/gov/msgs/MsgSubmitProposalPerpetualMarketLaunch.ts
6195
5041
  const createPerpetualMarketLaunch$1 = (params) => {
5042
+ validateOracleType(params.market.oracleType);
6196
5043
  const content = {
6197
5044
  title: params.market.title,
6198
5045
  description: params.market.description,
@@ -6545,11 +5392,19 @@ const openNotionalCapValue = (value) => {
6545
5392
  if (typeof value !== "string" || !/^\d+(\.\d+)?$/.test(value)) throw new Error("openNotionalCap must be a non-negative decimal string");
6546
5393
  return value;
6547
5394
  };
5395
+ const toOpenNotionalCapProto = (value) => ({ cap: value === void 0 ? {
5396
+ oneofKind: "uncapped",
5397
+ uncapped: {}
5398
+ } : {
5399
+ oneofKind: "capped",
5400
+ capped: { value }
5401
+ } });
6548
5402
  const toOpenNotionalCap = (value, formatValue = (value$1) => value$1) => {
6549
5403
  const cap = openNotionalCapValue(value);
6550
5404
  return cap === void 0 ? { uncapped: {} } : { capped: { value: formatValue(cap) } };
6551
5405
  };
6552
5406
  const createPerpetualMarketLaunch = (params) => {
5407
+ validateOracleType(params.market.oracleType);
6553
5408
  const openNotionalCap = openNotionalCapValue(params.market.openNotionalCap);
6554
5409
  const content = {
6555
5410
  title: params.market.title,
@@ -6568,14 +5423,9 @@ const createPerpetualMarketLaunch = (params) => {
6568
5423
  minQuantityTickSize: params.market.minQuantityTickSize,
6569
5424
  minNotional: params.market.minNotional,
6570
5425
  reduceMarginRatio: params.market.reduceMarginRatio,
6571
- openNotionalCap: { cap: openNotionalCap === void 0 ? {
6572
- oneofKind: "uncapped",
6573
- uncapped: {}
6574
- } : {
6575
- oneofKind: "capped",
6576
- capped: { value: openNotionalCap }
6577
- } },
6578
- crossMarginEligibility: params.market.crossMarginEligible
5426
+ openNotionalCap: toOpenNotionalCapProto(openNotionalCap),
5427
+ crossMarginEligible: params.market.crossMarginEligible,
5428
+ ...params.market.syntheticTradeFeeRate && { syntheticTradeFeeRate: params.market.syntheticTradeFeeRate }
6579
5429
  };
6580
5430
  if (params.market.adminInfo) content.adminInfo = {
6581
5431
  admin: params.market.adminInfo.admin,
@@ -6606,7 +5456,7 @@ var MsgSubmitProposalPerpetualMarketLaunchV2 = class MsgSubmitProposalPerpetualM
6606
5456
  minNotional: toChainFormat(initialParams.market.minNotional).toFixed(),
6607
5457
  openNotionalCap: openNotionalCap === void 0 ? void 0 : toChainFormat(openNotionalCap).toFixed(),
6608
5458
  reduceMarginRatio: toChainFormat(initialParams.market.reduceMarginRatio).toFixed(),
6609
- crossMarginEligibility: initialParams.market.crossMarginEligible
5459
+ syntheticTradeFeeRate: initialParams.market.syntheticTradeFeeRate ? toChainFormat(initialParams.market.syntheticTradeFeeRate).toFixed() : void 0
6610
5460
  }
6611
5461
  };
6612
5462
  const depositParams = CosmosBaseV1Beta1CoinPb.Coin.create({
@@ -6631,13 +5481,16 @@ var MsgSubmitProposalPerpetualMarketLaunchV2 = class MsgSubmitProposalPerpetualM
6631
5481
  };
6632
5482
  }
6633
5483
  toAmino() {
5484
+ return toAminoJson(CosmosGovV1Beta1TxPb.MsgSubmitProposal, this.toProto(), { "/injective.exchange.v2.PerpetualMarketLaunchProposal": InjectiveExchangeV2ProposalPb.PerpetualMarketLaunchProposal });
5485
+ }
5486
+ toAminoRaw() {
6634
5487
  const { params } = this;
6635
5488
  const content = createPerpetualMarketLaunch(params);
6636
5489
  return {
6637
5490
  type: "cosmos-sdk/MsgSubmitProposal",
6638
5491
  value: {
6639
5492
  content: {
6640
- type: "exchange/PerpetualMarketLaunchProposal",
5493
+ type: "exchange/v2/PerpetualMarketLaunchProposal",
6641
5494
  value: {
6642
5495
  title: content.title,
6643
5496
  description: content.description,
@@ -6657,7 +5510,8 @@ var MsgSubmitProposalPerpetualMarketLaunchV2 = class MsgSubmitProposalPerpetualM
6657
5510
  admin_info: content.adminInfo || null,
6658
5511
  reduce_margin_ratio: content.reduceMarginRatio,
6659
5512
  open_notional_cap: toOpenNotionalCap(params.market.openNotionalCap),
6660
- cross_margin_eligible: content.crossMarginEligible
5513
+ cross_margin_eligible: content.crossMarginEligible,
5514
+ ...content.syntheticTradeFeeRate && { synthetic_trade_fee_rate: content.syntheticTradeFeeRate }
6661
5515
  }
6662
5516
  },
6663
5517
  initial_deposit: [{
@@ -6669,7 +5523,7 @@ var MsgSubmitProposalPerpetualMarketLaunchV2 = class MsgSubmitProposalPerpetualM
6669
5523
  };
6670
5524
  }
6671
5525
  toWeb3Gw() {
6672
- const { value } = this.toAmino();
5526
+ const { value } = this.toAminoRaw();
6673
5527
  const messageWithProposalType = {
6674
5528
  ...value,
6675
5529
  content: {
@@ -6682,32 +5536,6 @@ var MsgSubmitProposalPerpetualMarketLaunchV2 = class MsgSubmitProposalPerpetualM
6682
5536
  ...messageWithProposalType
6683
5537
  };
6684
5538
  }
6685
- toEip712() {
6686
- const { params } = this;
6687
- const { value, type } = this.toAmino();
6688
- return {
6689
- type,
6690
- value: {
6691
- ...value,
6692
- content: {
6693
- type: "exchange/PerpetualMarketLaunchProposal",
6694
- value: {
6695
- ...value.content.value,
6696
- initial_margin_ratio: toChainFormat(params.market.initialMarginRatio).toFixed(),
6697
- maintenance_margin_ratio: toChainFormat(params.market.maintenanceMarginRatio).toFixed(),
6698
- maker_fee_rate: toChainFormat(params.market.makerFeeRate).toFixed(),
6699
- taker_fee_rate: toChainFormat(params.market.takerFeeRate).toFixed(),
6700
- min_price_tick_size: toChainFormat(params.market.minPriceTickSize).toFixed(),
6701
- min_notional: toChainFormat(params.market.minNotional).toFixed(),
6702
- min_quantity_tick_size: toChainFormat(params.market.minQuantityTickSize).toFixed(),
6703
- reduce_margin_ratio: toChainFormat(params.market.reduceMarginRatio).toFixed(),
6704
- open_notional_cap: toOpenNotionalCap(params.market.openNotionalCap, (value$1) => toChainFormat(value$1).toFixed()),
6705
- cross_margin_eligible: params.market.crossMarginEligible
6706
- }
6707
- }
6708
- }
6709
- };
6710
- }
6711
5539
  toEip712V2() {
6712
5540
  const { params } = this;
6713
5541
  const web3gw = this.toWeb3Gw();
@@ -6731,7 +5559,8 @@ var MsgSubmitProposalPerpetualMarketLaunchV2 = class MsgSubmitProposalPerpetualM
6731
5559
  admin_info: adminInfo,
6732
5560
  reduce_margin_ratio: numberToCosmosSdkDecString(params.market.reduceMarginRatio),
6733
5561
  open_notional_cap: toOpenNotionalCap(params.market.openNotionalCap, numberToCosmosSdkDecString),
6734
- cross_margin_eligible: params.market.crossMarginEligible
5562
+ cross_margin_eligible: params.market.crossMarginEligible,
5563
+ synthetic_trade_fee_rate: params.market.syntheticTradeFeeRate ? numberToCosmosSdkDecString(params.market.syntheticTradeFeeRate) : null
6735
5564
  }
6736
5565
  };
6737
5566
  }
@@ -6745,10 +5574,12 @@ var MsgSubmitProposalPerpetualMarketLaunchV2 = class MsgSubmitProposalPerpetualM
6745
5574
  return CosmosGovV1Beta1TxPb.MsgSubmitProposal.toBinary(this.toProto());
6746
5575
  }
6747
5576
  };
5577
+ _defineProperty(MsgSubmitProposalPerpetualMarketLaunchV2, "eip712V1Supported", false);
6748
5578
 
6749
5579
  //#endregion
6750
5580
  //#region src/core/modules/gov/msgs/MsgSubmitProposalExpiryFuturesMarketLaunch.ts
6751
5581
  const createExpiryFuturesMarketLaunch = (params) => {
5582
+ validateOracleType(params.market.oracleType);
6752
5583
  const content = {
6753
5584
  title: params.market.title,
6754
5585
  description: params.market.description,
@@ -8190,17 +7021,30 @@ var MsgExec = class MsgExec extends MsgBase {
8190
7021
  ...proto
8191
7022
  };
8192
7023
  }
8193
- toAmino() {
7024
+ compose(child) {
8194
7025
  const { params } = this;
8195
7026
  const msgs = Array.isArray(params.msgs) ? params.msgs : [params.msgs];
8196
7027
  return {
8197
7028
  type: "cosmos-sdk/MsgExec",
8198
7029
  value: {
8199
7030
  grantee: params.grantee,
8200
- msgs: msgs.map((msg) => msg.toEip712())
7031
+ msgs: msgs.map(child)
8201
7032
  }
8202
7033
  };
8203
7034
  }
7035
+ toAmino() {
7036
+ return this.compose((msg) => msg.toAmino());
7037
+ }
7038
+ /** the first message's schema stands for all of them, as arrays are typed by their first entry */
7039
+ toEip712Types() {
7040
+ const { msgs } = this.params;
7041
+ const [first] = Array.isArray(msgs) ? msgs : [msgs];
7042
+ const types = super.toEip712Types();
7043
+ return first ? graftEip712Types(types, "TypeMsgsValue", first.toEip712Types()) : types;
7044
+ }
7045
+ toEip712() {
7046
+ return this.compose((msg) => msg.toEip712());
7047
+ }
8204
7048
  toEip712V2() {
8205
7049
  const { params } = this;
8206
7050
  const msgs = Array.isArray(params.msgs) ? params.msgs : [params.msgs];
@@ -8908,6 +7752,7 @@ var MsgCreateRateLimit = class MsgCreateRateLimit extends MsgBase {
8908
7752
  toProto() {
8909
7753
  var _this$params$absolute;
8910
7754
  const { params } = this;
7755
+ validateOracleType(params.tokenOracleType);
8911
7756
  return InjectivePeggyV1MsgsPb.MsgCreateRateLimit.create({
8912
7757
  authority: params.authority,
8913
7758
  tokenAddress: params.tokenAddress,
@@ -8929,6 +7774,7 @@ var MsgCreateRateLimit = class MsgCreateRateLimit extends MsgBase {
8929
7774
  toAmino() {
8930
7775
  var _this$params$absolute2;
8931
7776
  const { params } = this;
7777
+ validateOracleType(params.tokenOracleType);
8932
7778
  return {
8933
7779
  type: "peggy/MsgCreateRateLimit",
8934
7780
  value: {
@@ -8983,6 +7829,7 @@ var MsgUpdateRateLimit = class MsgUpdateRateLimit extends MsgBase {
8983
7829
  }
8984
7830
  toProto() {
8985
7831
  const { params } = this;
7832
+ validateOracleType(params.newTokenOracleType);
8986
7833
  return InjectivePeggyV1MsgsPb.MsgUpdateRateLimit.create({
8987
7834
  authority: params.injectiveAddress,
8988
7835
  tokenAddress: params.tokenAddress,
@@ -9001,6 +7848,7 @@ var MsgUpdateRateLimit = class MsgUpdateRateLimit extends MsgBase {
9001
7848
  }
9002
7849
  toAmino() {
9003
7850
  const { params } = this;
7851
+ validateOracleType(params.newTokenOracleType);
9004
7852
  return {
9005
7853
  type: "peggy/MsgUpdateRateLimit",
9006
7854
  value: {
@@ -10003,6 +8851,8 @@ var MsgCreateInsuranceFund = class MsgCreateInsuranceFund extends MsgBase {
10003
8851
  }
10004
8852
  toProto() {
10005
8853
  const { params } = this;
8854
+ if (params.fund.expiry === -2) throw new GeneralException(/* @__PURE__ */ new Error("Binary options insurance funds have been removed in v1.21"));
8855
+ validateOracleType(params.fund.oracleType);
10006
8856
  const coin = CosmosBaseV1Beta1CoinPb.Coin.create({
10007
8857
  denom: params.deposit.denom,
10008
8858
  amount: params.deposit.amount
@@ -10066,6 +8916,308 @@ var MsgCreateInsuranceFund = class MsgCreateInsuranceFund extends MsgBase {
10066
8916
  }
10067
8917
  };
10068
8918
 
8919
+ //#endregion
8920
+ //#region src/core/modules/insurance/msgs/MsgRequestConsolidatedRedemption.ts
8921
+ /**
8922
+ * @category Messages
8923
+ */
8924
+ var MsgRequestConsolidatedRedemption = class MsgRequestConsolidatedRedemption extends MsgBase {
8925
+ static fromJSON(params) {
8926
+ return new MsgRequestConsolidatedRedemption(params);
8927
+ }
8928
+ toProto() {
8929
+ const { params } = this;
8930
+ return InjectiveInsuranceV1Beta1TxPb.MsgRequestConsolidatedRedemption.create({
8931
+ sender: params.injectiveAddress,
8932
+ poolDenom: params.poolDenom,
8933
+ shares: CosmosBaseV1Beta1CoinPb.Coin.create({
8934
+ denom: params.amount.denom,
8935
+ amount: params.amount.amount
8936
+ })
8937
+ });
8938
+ }
8939
+ toData() {
8940
+ const proto = this.toProto();
8941
+ return {
8942
+ "@type": toTypeUrl(InjectiveInsuranceV1Beta1TxPb.MsgRequestConsolidatedRedemption),
8943
+ ...proto
8944
+ };
8945
+ }
8946
+ toAmino() {
8947
+ return toAminoJson(InjectiveInsuranceV1Beta1TxPb.MsgRequestConsolidatedRedemption, this.toProto());
8948
+ }
8949
+ toAminoRaw() {
8950
+ const proto = this.toProto();
8951
+ return {
8952
+ type: "insurance/MsgRequestConsolidatedRedemption",
8953
+ value: {
8954
+ sender: proto.sender,
8955
+ pool_denom: proto.poolDenom,
8956
+ shares: proto.shares
8957
+ }
8958
+ };
8959
+ }
8960
+ toWeb3Gw() {
8961
+ const { value } = this.toAminoRaw();
8962
+ return {
8963
+ "@type": toTypeUrl(InjectiveInsuranceV1Beta1TxPb.MsgRequestConsolidatedRedemption),
8964
+ ...value
8965
+ };
8966
+ }
8967
+ toDirectSign() {
8968
+ const proto = this.toProto();
8969
+ return {
8970
+ type: toTypeUrl(InjectiveInsuranceV1Beta1TxPb.MsgRequestConsolidatedRedemption),
8971
+ message: proto
8972
+ };
8973
+ }
8974
+ toBinary() {
8975
+ return InjectiveInsuranceV1Beta1TxPb.MsgRequestConsolidatedRedemption.toBinary(this.toProto());
8976
+ }
8977
+ };
8978
+
8979
+ //#endregion
8980
+ //#region src/core/modules/insurance/msgs/MsgCreateConsolidatedInsurancePool.ts
8981
+ /**
8982
+ * @category Messages
8983
+ */
8984
+ var MsgCreateConsolidatedInsurancePool = class MsgCreateConsolidatedInsurancePool extends MsgBase {
8985
+ static fromJSON(params) {
8986
+ return new MsgCreateConsolidatedInsurancePool(params);
8987
+ }
8988
+ toProto() {
8989
+ const { params } = this;
8990
+ return InjectiveInsuranceV1Beta1TxPb.MsgCreateConsolidatedInsurancePool.create({
8991
+ authority: params.authority,
8992
+ depositDenom: params.depositDenom,
8993
+ quoteDecimals: params.quoteDecimals,
8994
+ maxDrawPerMarket: params.maxDrawPerMarket,
8995
+ redemptionNoticePeriodSeconds: BigInt(params.redemptionNoticePeriodSeconds)
8996
+ });
8997
+ }
8998
+ toData() {
8999
+ const proto = this.toProto();
9000
+ return {
9001
+ "@type": toTypeUrl(InjectiveInsuranceV1Beta1TxPb.MsgCreateConsolidatedInsurancePool),
9002
+ ...proto
9003
+ };
9004
+ }
9005
+ toAmino() {
9006
+ return toAminoJson(InjectiveInsuranceV1Beta1TxPb.MsgCreateConsolidatedInsurancePool, this.toProto());
9007
+ }
9008
+ toAminoRaw() {
9009
+ const proto = this.toProto();
9010
+ return {
9011
+ type: "insurance/MsgCreateConsolidatedInsurancePool",
9012
+ value: {
9013
+ authority: proto.authority,
9014
+ deposit_denom: proto.depositDenom,
9015
+ quote_decimals: proto.quoteDecimals,
9016
+ max_draw_per_market: proto.maxDrawPerMarket,
9017
+ redemption_notice_period_seconds: proto.redemptionNoticePeriodSeconds.toString()
9018
+ }
9019
+ };
9020
+ }
9021
+ toWeb3Gw() {
9022
+ const { value } = this.toAminoRaw();
9023
+ return {
9024
+ "@type": toTypeUrl(InjectiveInsuranceV1Beta1TxPb.MsgCreateConsolidatedInsurancePool),
9025
+ ...value
9026
+ };
9027
+ }
9028
+ toDirectSign() {
9029
+ const proto = this.toProto();
9030
+ return {
9031
+ type: toTypeUrl(InjectiveInsuranceV1Beta1TxPb.MsgCreateConsolidatedInsurancePool),
9032
+ message: proto
9033
+ };
9034
+ }
9035
+ toBinary() {
9036
+ return InjectiveInsuranceV1Beta1TxPb.MsgCreateConsolidatedInsurancePool.toBinary(this.toProto());
9037
+ }
9038
+ };
9039
+ _defineProperty(MsgCreateConsolidatedInsurancePool, "eip712V1Supported", false);
9040
+
9041
+ //#endregion
9042
+ //#region src/core/modules/insurance/msgs/MsgUpdateConsolidatedInsurancePolicy.ts
9043
+ /**
9044
+ * Changes the draw cap of one market enrolled in a consolidated insurance pool.
9045
+ *
9046
+ * @category Messages
9047
+ */
9048
+ var MsgUpdateConsolidatedInsurancePolicy = class MsgUpdateConsolidatedInsurancePolicy extends MsgBase {
9049
+ static fromJSON(params) {
9050
+ return new MsgUpdateConsolidatedInsurancePolicy(params);
9051
+ }
9052
+ toProto() {
9053
+ const { params } = this;
9054
+ return InjectiveInsuranceV1Beta1TxPb.MsgUpdateConsolidatedInsurancePolicy.create({
9055
+ authority: params.authority,
9056
+ marketId: params.marketId,
9057
+ maxDraw: params.maxDraw
9058
+ });
9059
+ }
9060
+ toData() {
9061
+ const proto = this.toProto();
9062
+ return {
9063
+ "@type": toTypeUrl(InjectiveInsuranceV1Beta1TxPb.MsgUpdateConsolidatedInsurancePolicy),
9064
+ ...proto
9065
+ };
9066
+ }
9067
+ toAmino() {
9068
+ return toAminoJson(InjectiveInsuranceV1Beta1TxPb.MsgUpdateConsolidatedInsurancePolicy, this.toProto());
9069
+ }
9070
+ toAminoRaw() {
9071
+ const proto = this.toProto();
9072
+ return {
9073
+ type: "insurance/MsgUpdateConsolidatedInsurancePolicy",
9074
+ value: {
9075
+ authority: proto.authority,
9076
+ market_id: proto.marketId,
9077
+ max_draw: proto.maxDraw
9078
+ }
9079
+ };
9080
+ }
9081
+ toWeb3Gw() {
9082
+ const { value } = this.toAminoRaw();
9083
+ return {
9084
+ "@type": toTypeUrl(InjectiveInsuranceV1Beta1TxPb.MsgUpdateConsolidatedInsurancePolicy),
9085
+ ...value
9086
+ };
9087
+ }
9088
+ toDirectSign() {
9089
+ const proto = this.toProto();
9090
+ return {
9091
+ type: toTypeUrl(InjectiveInsuranceV1Beta1TxPb.MsgUpdateConsolidatedInsurancePolicy),
9092
+ message: proto
9093
+ };
9094
+ }
9095
+ toBinary() {
9096
+ return InjectiveInsuranceV1Beta1TxPb.MsgUpdateConsolidatedInsurancePolicy.toBinary(this.toProto());
9097
+ }
9098
+ };
9099
+ _defineProperty(MsgUpdateConsolidatedInsurancePolicy, "eip712V1Supported", false);
9100
+
9101
+ //#endregion
9102
+ //#region src/core/modules/insurance/msgs/MsgSetConsolidatedInsurancePoolPause.ts
9103
+ /**
9104
+ * Pauses or resumes insurance payouts of a consolidated pool (not a trading halt).
9105
+ *
9106
+ * @category Messages
9107
+ */
9108
+ var MsgSetConsolidatedInsurancePoolPause = class MsgSetConsolidatedInsurancePoolPause extends MsgBase {
9109
+ static fromJSON(params) {
9110
+ return new MsgSetConsolidatedInsurancePoolPause(params);
9111
+ }
9112
+ toProto() {
9113
+ const { params } = this;
9114
+ return InjectiveInsuranceV1Beta1TxPb.MsgSetConsolidatedInsurancePoolPause.create({
9115
+ authority: params.authority,
9116
+ depositDenom: params.depositDenom,
9117
+ paused: params.paused
9118
+ });
9119
+ }
9120
+ toData() {
9121
+ const proto = this.toProto();
9122
+ return {
9123
+ "@type": toTypeUrl(InjectiveInsuranceV1Beta1TxPb.MsgSetConsolidatedInsurancePoolPause),
9124
+ ...proto
9125
+ };
9126
+ }
9127
+ toAmino() {
9128
+ return toAminoJson(InjectiveInsuranceV1Beta1TxPb.MsgSetConsolidatedInsurancePoolPause, this.toProto());
9129
+ }
9130
+ toAminoRaw() {
9131
+ const proto = this.toProto();
9132
+ return {
9133
+ type: "insurance/MsgSetConsolidatedInsurancePoolPause",
9134
+ value: {
9135
+ authority: proto.authority,
9136
+ deposit_denom: proto.depositDenom,
9137
+ paused: proto.paused
9138
+ }
9139
+ };
9140
+ }
9141
+ toWeb3Gw() {
9142
+ const { value } = this.toAminoRaw();
9143
+ return {
9144
+ "@type": toTypeUrl(InjectiveInsuranceV1Beta1TxPb.MsgSetConsolidatedInsurancePoolPause),
9145
+ ...value
9146
+ };
9147
+ }
9148
+ toDirectSign() {
9149
+ const proto = this.toProto();
9150
+ return {
9151
+ type: toTypeUrl(InjectiveInsuranceV1Beta1TxPb.MsgSetConsolidatedInsurancePoolPause),
9152
+ message: proto
9153
+ };
9154
+ }
9155
+ toBinary() {
9156
+ return InjectiveInsuranceV1Beta1TxPb.MsgSetConsolidatedInsurancePoolPause.toBinary(this.toProto());
9157
+ }
9158
+ };
9159
+
9160
+ //#endregion
9161
+ //#region src/core/modules/insurance/msgs/MsgUnderwriteConsolidatedInsurancePool.ts
9162
+ /**
9163
+ * @category Messages
9164
+ */
9165
+ var MsgUnderwriteConsolidatedInsurancePool = class MsgUnderwriteConsolidatedInsurancePool extends MsgBase {
9166
+ static fromJSON(params) {
9167
+ return new MsgUnderwriteConsolidatedInsurancePool(params);
9168
+ }
9169
+ toProto() {
9170
+ const { params } = this;
9171
+ return InjectiveInsuranceV1Beta1TxPb.MsgUnderwriteConsolidatedInsurancePool.create({
9172
+ sender: params.injectiveAddress,
9173
+ deposit: CosmosBaseV1Beta1CoinPb.Coin.create({
9174
+ denom: params.amount.denom,
9175
+ amount: params.amount.amount
9176
+ }),
9177
+ minSharesOut: params.minSharesOut
9178
+ });
9179
+ }
9180
+ toData() {
9181
+ const proto = this.toProto();
9182
+ return {
9183
+ "@type": toTypeUrl(InjectiveInsuranceV1Beta1TxPb.MsgUnderwriteConsolidatedInsurancePool),
9184
+ ...proto
9185
+ };
9186
+ }
9187
+ toAmino() {
9188
+ return toAminoJson(InjectiveInsuranceV1Beta1TxPb.MsgUnderwriteConsolidatedInsurancePool, this.toProto());
9189
+ }
9190
+ toAminoRaw() {
9191
+ const proto = this.toProto();
9192
+ return {
9193
+ type: "insurance/MsgUnderwriteConsolidatedInsurancePool",
9194
+ value: {
9195
+ sender: proto.sender,
9196
+ deposit: proto.deposit,
9197
+ min_shares_out: proto.minSharesOut
9198
+ }
9199
+ };
9200
+ }
9201
+ toWeb3Gw() {
9202
+ const { value } = this.toAminoRaw();
9203
+ return {
9204
+ "@type": toTypeUrl(InjectiveInsuranceV1Beta1TxPb.MsgUnderwriteConsolidatedInsurancePool),
9205
+ ...value
9206
+ };
9207
+ }
9208
+ toDirectSign() {
9209
+ const proto = this.toProto();
9210
+ return {
9211
+ type: toTypeUrl(InjectiveInsuranceV1Beta1TxPb.MsgUnderwriteConsolidatedInsurancePool),
9212
+ message: proto
9213
+ };
9214
+ }
9215
+ toBinary() {
9216
+ return InjectiveInsuranceV1Beta1TxPb.MsgUnderwriteConsolidatedInsurancePool.toBinary(this.toProto());
9217
+ }
9218
+ };
9219
+ _defineProperty(MsgUnderwriteConsolidatedInsurancePool, "eip712V1Supported", false);
9220
+
10069
9221
  //#endregion
10070
9222
  //#region src/core/modules/permissions/msgs/MsgClaimVoucher.ts
10071
9223
  /**
@@ -10130,6 +9282,7 @@ var MsgUpdateParams = class MsgUpdateParams extends MsgBase {
10130
9282
  const { params } = this;
10131
9283
  const messageParams = InjectivePermissionsV1Beta1ParamsPb.Params.create({
10132
9284
  contractHookMaxGas: BigInt(params.params.wasmHookQueryMaxGas),
9285
+ ownerBlacklistQueryMaxGas: BigInt(params.params.ownerBlacklistQueryMaxGas),
10133
9286
  deprecatedEnforcedRestrictionsContracts: params.params.deprecatedEnforcedRestrictionsContracts || [],
10134
9287
  enforcedRestrictionsEvmContracts: (params.params.enforcedRestrictionsEvmContracts || []).map((c) => InjectivePermissionsV1Beta1ParamsPb.EnforcedRestrictionsEVMContract.create({
10135
9288
  contractAddress: c.contractAddress,
@@ -10152,7 +9305,7 @@ var MsgUpdateParams = class MsgUpdateParams extends MsgBase {
10152
9305
  };
10153
9306
  }
10154
9307
  toAmino() {
10155
- var _proto$params, _proto$params2, _proto$params3;
9308
+ var _proto$params, _proto$params2, _proto$params3, _proto$params4;
10156
9309
  const proto = this.toProto();
10157
9310
  return {
10158
9311
  type: "permissions/MsgUpdateParams",
@@ -10167,7 +9320,8 @@ var MsgUpdateParams = class MsgUpdateParams extends MsgBase {
10167
9320
  unpause_event_signature: c.unpauseEventSignature,
10168
9321
  blacklist_event_signature: c.blacklistEventSignature,
10169
9322
  unblacklist_event_signature: c.unblacklistEventSignature
10170
- }))
9323
+ })),
9324
+ owner_blacklist_query_max_gas: ((_proto$params4 = proto.params) === null || _proto$params4 === void 0 ? void 0 : _proto$params4.ownerBlacklistQueryMaxGas.toString()) || "0"
10171
9325
  }
10172
9326
  }
10173
9327
  };
@@ -10451,6 +9605,7 @@ var MsgUpdateNamespace = class MsgUpdateNamespace extends MsgBase {
10451
9605
  throw new GeneralException(/* @__PURE__ */ new Error("EIP712_v1 is not supported for MsgUpdateNamespace. Please use EIP712_v2"));
10452
9606
  }
10453
9607
  toEip712V2() {
9608
+ var _web3gw$wasm_hook, _web3gw$evm_hook, _web3gw$evm_post_hook;
10454
9609
  const web3gw = this.toWeb3Gw();
10455
9610
  const policyStatuses = (web3gw.policy_statuses || []).map((policyStatus) => ({
10456
9611
  ...policyStatus,
@@ -10461,9 +9616,16 @@ var MsgUpdateNamespace = class MsgUpdateNamespace extends MsgBase {
10461
9616
  action: InjectivePermissionsV1Beta1PermissionsPb.Action[policyManagerCapability.action]
10462
9617
  }));
10463
9618
  return {
10464
- ...web3gw,
9619
+ "@type": web3gw["@type"],
9620
+ sender: web3gw.sender,
9621
+ denom: web3gw.denom,
9622
+ wasm_hook: (_web3gw$wasm_hook = web3gw.wasm_hook) !== null && _web3gw$wasm_hook !== void 0 ? _web3gw$wasm_hook : null,
9623
+ role_permissions: web3gw.role_permissions,
9624
+ role_managers: web3gw.role_managers,
10465
9625
  policy_statuses: policyStatuses,
10466
- policy_manager_capabilities: policyManagerCapabilities
9626
+ policy_manager_capabilities: policyManagerCapabilities,
9627
+ evm_hook: (_web3gw$evm_hook = web3gw.evm_hook) !== null && _web3gw$evm_hook !== void 0 ? _web3gw$evm_hook : null,
9628
+ evm_post_hook: (_web3gw$evm_post_hook = web3gw.evm_post_hook) !== null && _web3gw$evm_post_hook !== void 0 ? _web3gw$evm_post_hook : null
10467
9629
  };
10468
9630
  }
10469
9631
  toDirectSign() {
@@ -11122,4 +10284,4 @@ var MsgSetDenomMetadata = class MsgSetDenomMetadata extends MsgBase {
11122
10284
  };
11123
10285
 
11124
10286
  //#endregion
11125
- export { ExecArgRemoveGridStrategy as $, MsgInstantSpotMarketLaunchV2 as $t, MsgCreateRateLimit as A, MsgExternalTransfer as An, MsgDeposit as At, msgsOrMsgExecMsgs as B, MsgCreateBinaryOptionsMarketOrder as Bt, MsgEditValidator as C, MsgExternalTransferV2 as Cn, MsgSubmitProposalPerpetualMarketLaunchV2 as Ct, MsgRelayProviderPrices as D, MsgLiquidatePosition as Dn, MsgSubmitProposalSpotMarketLaunch as Dt, MsgBid as E, MsgCancelSpotOrderV2 as En, MsgGrantProviderPrivilegeProposal as Et, GenericAuthorization as F, MsgSignDataV2 as Fn, MsgBatchCancelBinaryOptionsOrdersV2 as Ft, ExecArgCW20AdapterRedeemAndTransfer as G, MsgBatchCancelDerivativeOrdersV2 as Gt, GrantAuthorizationType as H, MsgAdminUpdateBinaryOptionsMarket as Ht, MsgGrantWithAuthorization as I, MsgDepositV2 as In, MsgAdminUpdateBinaryOptionsMarketV2 as It, ExecArgCreateSpotGridStrategy as J, MsgCreateDerivativeMarketOrder as Jt, ExecPrivilegedArgVaultSubscribe as K, MsgCreateBinaryOptionsLimitOrder as Kt, MsgRevoke as L, MsgWithdraw as Ln, MsgInstantBinaryOptionsMarketLaunch as Lt, MsgCreateTokenPair as M, MsgCancelSpotOrder as Mn, OrderHashManager as Mt, ContractExecutionCompatAuthorization as N, MsgRewardsOptOut as Nn, MsgInstantBinaryOptionsMarketLaunchV2 as Nt, MsgRemoveRateLimit as O, MsgBatchUpdateOrders as On, MsgSubmitGenericProposal as Ot, ContractExecutionAuthorization as P, MsgWithdrawV2 as Pn, MsgCreateBinaryOptionsMarketOrderV2 as Pt, MsgPrivilegedExecuteContract as Q, MsgLiquidateCrossMarginPoolV2 as Qt, MsgGrant as R, MsgDeposit$1 as Rn, MsgSetDelegationTransferReceiversV2 as Rt, MsgBeginRedelegate as S, MsgUpdateSwapParamsV2 as Sn, MsgSubmitProposalExpiryFuturesMarketLaunch as St, MsgDelegate as T, MsgReclaimLockedFunds as Tn, MsgSubmitProposalPerpetualMarketLaunch as Tt, ExecPrivilegedArgOffChainVaultSubscribe as U, MsgUpdateSubaccountRiskProfileV2 as Ut, MsgExec as V, MsgBatchCancelBinaryOptionsOrders as Vt, ExecPrivilegedArgOffChainVaultRedeem as W, MsgCreateDerivativeMarketOrderV2 as Wt, ExitType as X, MsgCancelBinaryOptionsOrderV2 as Xt, ExecArgCreatePerpGridStrategy as Y, MsgBatchCancelDerivativeOrders as Yt, StrategyType as Z, MsgCreateDerivativeLimitOrder as Zt, MsgRevokeAllowance as _, MsgCreateSpotLimitOrder as _n, MsgStoreCode as _t, MsgBurn as a, MsgBatchCancelSpotOrdersV2 as an, ExecArgCreateCampaign as at, MsgTransferDelegation as b, MsgLiquidatePositionV2 as bn, MsgTransfer as bt, MsgFundCommunityPool as c, MsgActivatePostOnlyModeV2 as cn, MsgInstantiateContract as ct, MsgCreateNamespace as d, MsgCreateSpotMarketOrder as dn, ExecArgCreateRound as dt, MsgDecreasePositionMarginV2 as en, ExecArgIncreaseAllowance as et, MsgUpdateParams as f, MsgCancelDerivativeOrder as fn, ExecArgSubmitVaa as ft, MsgUnderwrite as g, MsgAuthorizeStakeGrants as gn, MsgUpdateAdmin as gt, MsgRequestRedemption as h, MsgReclaimLockedFundsV2 as hn, ExecArgCW20Send as ht, MsgMint as i, MsgCreateSpotMarketOrderV2 as in, ExecArgSwapExactOutput as it, MsgSendToEth as j, MsgRewardsOptOutV2 as jn, MsgVote as jt, MsgUpdateRateLimit as k, MsgOffsetPositionV2 as kn, MsgSubmitTextProposal as kt, MsgUpdateActorRoles as l, MsgCreateSpotLimitOrderV2 as ln, ExecArgFundCampaign as lt, MsgCreateInsuranceFund as m, MsgActivateStakeGrantV2 as mn, MsgExecuteContract as mt, MsgCreateDenom as n, MsgCancelBinaryOptionsOrder as nn, ExecArgUpdateGridConfig as nt, MsgWithdrawValidatorCommission as o, MsgCancelDerivativeOrderV2 as on, ExecArgSwapMinOutput as ot, MsgClaimVoucher as p, MsgBatchCancelSpotOrders as pn, MsgMigrateContract as pt, ExecPrivilegedArgVaultRedeem as q, MsgCreateDerivativeLimitOrderV2 as qt, MsgChangeAdmin as r, MsgUpdateDerivativeMarketV2 as rn, ExecArgInitiateTransfer as rt, MsgWithdrawDelegatorReward as s, MsgInstantSpotMarketLaunch as sn, ExecArgDepositTokens as st, MsgSetDenomMetadata as t, MsgIncreasePositionMarginV2 as tn, MsgUpdateInstantiateConfig as tt, MsgUpdateNamespace as u, MsgAuthorizeStakeGrantsV2 as un, ExecArgCW20Transfer as ut, MsgGrantAllowance as v, MsgSubaccountTransferV2 as vn, MsgMultiSend as vt, MsgUndelegate as w, MsgUpdateSpotMarketV2 as wn, MsgSubmitProposalSpotMarketParamUpdate as wt, MsgCreateValidator as x, MsgBatchUpdateOrdersV2 as xn, ProposalDecomposer as xt, MsgCancelUnbondingDelegation as y, MsgCancelPostOnlyModeV2 as yn, MsgSend as yt, getGenericAuthorizationFromMessageType as z, MsgCreateBinaryOptionsLimitOrderV2 as zt };
10287
+ export { ExecArgCreateSpotGridStrategy as $, MsgBatchCancelSpotOrdersV2 as $t, MsgDelegate as A, MsgDeposit$1 as An, MsgSubmitProposalPerpetualMarketLaunch as At, GenericAuthorization as B, MsgUpdateSubaccountRiskProfileV2 as Bt, MsgGrantAllowance as C, MsgOffsetPositionV2 as Cn, MsgMultiSend as Ct, MsgBeginRedelegate as D, MsgSignDataV2 as Dn, MsgSubmitProposalExpiryFuturesMarketLaunch as Dt, MsgCreateValidator as E, MsgWithdrawV2 as En, ProposalDecomposer as Et, MsgCreateRateLimit as F, MsgDeposit as Ft, msgsOrMsgExecMsgs as G, MsgBatchCancelDerivativeOrders as Gt, MsgRevoke as H, MsgBatchCancelDerivativeOrdersV2 as Ht, MsgSendToEth as I, MsgVote as It, ExecPrivilegedArgOffChainVaultSubscribe as J, MsgInstantSpotMarketLaunchV2 as Jt, MsgExec as K, MsgCreateDerivativeLimitOrder as Kt, MsgCreateTokenPair as L, OrderHashManager as Lt, MsgRelayProviderPrices as M, MsgSubmitProposalSpotMarketLaunch as Mt, MsgRemoveRateLimit as N, MsgSubmitGenericProposal as Nt, MsgEditValidator as O, MsgDepositV2 as On, MsgSubmitProposalPerpetualMarketLaunchV2 as Ot, MsgUpdateRateLimit as P, MsgSubmitTextProposal as Pt, ExecPrivilegedArgVaultRedeem as Q, MsgCreateSpotMarketOrderV2 as Qt, ContractExecutionCompatAuthorization as R, MsgSetDelegationTransferReceiversV2 as Rt, MsgRevokeAllowance as S, MsgBatchUpdateOrders as Sn, MsgStoreCode as St, MsgTransferDelegation as T, MsgCancelSpotOrder as Tn, MsgTransfer as Tt, MsgGrant as U, MsgCreateDerivativeLimitOrderV2 as Ut, MsgGrantWithAuthorization as V, MsgCreateDerivativeMarketOrderV2 as Vt, getGenericAuthorizationFromMessageType as W, MsgCreateDerivativeMarketOrder as Wt, ExecArgCW20AdapterRedeemAndTransfer as X, MsgIncreasePositionMarginV2 as Xt, ExecPrivilegedArgOffChainVaultRedeem as Y, MsgDecreasePositionMarginV2 as Yt, ExecPrivilegedArgVaultSubscribe as Z, MsgUpdateDerivativeMarketV2 as Zt, MsgCreateConsolidatedInsurancePool as _, MsgExternalTransferV2 as _n, ExecArgSubmitVaa as _t, MsgBurn as a, MsgCreateSpotMarketOrder as an, ExecArgIncreaseAllowance as at, MsgRequestRedemption as b, MsgCancelSpotOrderV2 as bn, ExecArgCW20Send as bt, MsgFundCommunityPool as c, MsgActivateStakeGrantV2 as cn, ExecArgInitiateTransfer as ct, MsgCreateNamespace as d, MsgCreateSpotLimitOrder as dn, ExecArgSwapMinOutput as dt, MsgCancelDerivativeOrderV2 as en, ExecArgCreatePerpGridStrategy as et, MsgUpdateParams as f, MsgSubaccountTransferV2 as fn, ExecArgDepositTokens as ft, MsgUpdateConsolidatedInsurancePolicy as g, MsgUpdateSwapParamsV2 as gn, ExecArgCreateRound as gt, MsgSetConsolidatedInsurancePoolPause as h, MsgBatchUpdateOrdersV2 as hn, ExecArgCW20Transfer as ht, MsgMint as i, MsgAuthorizeStakeGrantsV2 as in, ExecArgRemoveGridStrategy as it, MsgBid as j, MsgGrantProviderPrivilegeProposal as jt, MsgUndelegate as k, MsgWithdraw as kn, MsgSubmitProposalSpotMarketParamUpdate as kt, MsgUpdateActorRoles as l, MsgReclaimLockedFundsV2 as ln, ExecArgSwapExactOutput as lt, MsgUnderwriteConsolidatedInsurancePool as m, MsgLiquidatePositionV2 as mn, ExecArgFundCampaign as mt, MsgCreateDenom as n, MsgActivatePostOnlyModeV2 as nn, StrategyType as nt, MsgWithdrawValidatorCommission as o, MsgCancelDerivativeOrder as on, MsgUpdateInstantiateConfig as ot, MsgClaimVoucher as p, MsgCancelPostOnlyModeV2 as pn, MsgInstantiateContract as pt, GrantAuthorizationType as q, MsgLiquidateCrossMarginPoolV2 as qt, MsgChangeAdmin as r, MsgCreateSpotLimitOrderV2 as rn, MsgPrivilegedExecuteContract as rt, MsgWithdrawDelegatorReward as s, MsgBatchCancelSpotOrders as sn, ExecArgUpdateGridConfig as st, MsgSetDenomMetadata as t, MsgInstantSpotMarketLaunch as tn, ExitType as tt, MsgUpdateNamespace as u, MsgAuthorizeStakeGrants as un, ExecArgCreateCampaign as ut, MsgRequestConsolidatedRedemption as v, MsgUpdateSpotMarketV2 as vn, MsgMigrateContract as vt, MsgCancelUnbondingDelegation as w, MsgExternalTransfer as wn, MsgSend as wt, MsgUnderwrite as x, MsgLiquidatePosition as xn, MsgUpdateAdmin as xt, MsgCreateInsuranceFund as y, MsgReclaimLockedFunds as yn, MsgExecuteContract as yt, ContractExecutionAuthorization as z, MsgUpdateSubaccountMarketRiskModeV2 as zt };