@injectivelabs/sdk-ts 1.16.13 → 1.16.15

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 (27) hide show
  1. package/dist/cjs/core/modules/distribution/index.d.ts +2 -1
  2. package/dist/cjs/core/modules/distribution/index.js +3 -1
  3. package/dist/cjs/core/modules/distribution/msgs/MsgFundCommunityPool.d.ts +39 -0
  4. package/dist/cjs/core/modules/distribution/msgs/MsgFundCommunityPool.js +65 -0
  5. package/dist/cjs/core/modules/exchange/index.d.ts +3 -1
  6. package/dist/cjs/core/modules/exchange/index.js +5 -1
  7. package/dist/cjs/core/modules/exchange/msgs/MsgUpdateDerivativeMarketV2.d.ts +92 -0
  8. package/dist/cjs/core/modules/exchange/msgs/MsgUpdateDerivativeMarketV2.js +106 -0
  9. package/dist/cjs/core/modules/exchange/msgs/MsgUpdateSpotMarketV2.d.ts +74 -0
  10. package/dist/cjs/core/modules/exchange/msgs/MsgUpdateSpotMarketV2.js +97 -0
  11. package/dist/cjs/core/modules/msgs.d.ts +52 -41
  12. package/dist/cjs/core/tx/api/TxGrpcApi.js +4 -1
  13. package/dist/cjs/core/tx/eip712/maps.js +4 -0
  14. package/dist/esm/core/modules/distribution/index.d.ts +2 -1
  15. package/dist/esm/core/modules/distribution/index.js +2 -1
  16. package/dist/esm/core/modules/distribution/msgs/MsgFundCommunityPool.d.ts +39 -0
  17. package/dist/esm/core/modules/distribution/msgs/MsgFundCommunityPool.js +59 -0
  18. package/dist/esm/core/modules/exchange/index.d.ts +3 -1
  19. package/dist/esm/core/modules/exchange/index.js +3 -1
  20. package/dist/esm/core/modules/exchange/msgs/MsgUpdateDerivativeMarketV2.d.ts +92 -0
  21. package/dist/esm/core/modules/exchange/msgs/MsgUpdateDerivativeMarketV2.js +100 -0
  22. package/dist/esm/core/modules/exchange/msgs/MsgUpdateSpotMarketV2.d.ts +74 -0
  23. package/dist/esm/core/modules/exchange/msgs/MsgUpdateSpotMarketV2.js +91 -0
  24. package/dist/esm/core/modules/msgs.d.ts +52 -41
  25. package/dist/esm/core/tx/api/TxGrpcApi.js +4 -1
  26. package/dist/esm/core/tx/eip712/maps.js +4 -0
  27. package/package.json +6 -6
@@ -1,3 +1,4 @@
1
+ import MsgFundCommunityPool from './msgs/MsgFundCommunityPool.js';
1
2
  import MsgWithdrawDelegatorReward from './msgs/MsgWithdrawDelegatorReward.js';
2
3
  import MsgWithdrawValidatorCommission from './msgs/MsgWithdrawValidatorCommission.js';
3
- export { MsgWithdrawDelegatorReward, MsgWithdrawValidatorCommission };
4
+ export { MsgFundCommunityPool, MsgWithdrawDelegatorReward, MsgWithdrawValidatorCommission, };
@@ -3,7 +3,9 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
3
3
  return (mod && mod.__esModule) ? mod : { "default": mod };
4
4
  };
5
5
  Object.defineProperty(exports, "__esModule", { value: true });
6
- exports.MsgWithdrawValidatorCommission = exports.MsgWithdrawDelegatorReward = void 0;
6
+ exports.MsgWithdrawValidatorCommission = exports.MsgWithdrawDelegatorReward = exports.MsgFundCommunityPool = void 0;
7
+ const MsgFundCommunityPool_js_1 = __importDefault(require("./msgs/MsgFundCommunityPool.js"));
8
+ exports.MsgFundCommunityPool = MsgFundCommunityPool_js_1.default;
7
9
  const MsgWithdrawDelegatorReward_js_1 = __importDefault(require("./msgs/MsgWithdrawDelegatorReward.js"));
8
10
  exports.MsgWithdrawDelegatorReward = MsgWithdrawDelegatorReward_js_1.default;
9
11
  const MsgWithdrawValidatorCommission_js_1 = __importDefault(require("./msgs/MsgWithdrawValidatorCommission.js"));
@@ -0,0 +1,39 @@
1
+ import { CosmosBaseV1Beta1Coin, CosmosDistributionV1Beta1Tx } from '@injectivelabs/core-proto-ts';
2
+ import { MsgBase } from '../../MsgBase.js';
3
+ import type { Coin } from '@injectivelabs/ts-types';
4
+ export declare namespace MsgFundCommunityPool {
5
+ interface Params {
6
+ amount: Coin[];
7
+ depositor: string;
8
+ }
9
+ type Proto = CosmosDistributionV1Beta1Tx.MsgFundCommunityPool;
10
+ }
11
+ /**
12
+ * @category Messages
13
+ */
14
+ export default class MsgFundCommunityPool extends MsgBase<MsgFundCommunityPool.Params, MsgFundCommunityPool.Proto> {
15
+ static fromJSON(params: MsgFundCommunityPool.Params): MsgFundCommunityPool;
16
+ toProto(): CosmosDistributionV1Beta1Tx.MsgFundCommunityPool;
17
+ toData(): {
18
+ amount: CosmosBaseV1Beta1Coin.Coin[];
19
+ depositor: string;
20
+ '@type': string;
21
+ };
22
+ toAmino(): {
23
+ type: string;
24
+ value: {
25
+ amount: CosmosBaseV1Beta1Coin.Coin[];
26
+ depositor: string;
27
+ };
28
+ };
29
+ toWeb3Gw(): {
30
+ amount: CosmosBaseV1Beta1Coin.Coin[];
31
+ depositor: string;
32
+ '@type': string;
33
+ };
34
+ toDirectSign(): {
35
+ type: string;
36
+ message: CosmosDistributionV1Beta1Tx.MsgFundCommunityPool;
37
+ };
38
+ toBinary(): Uint8Array;
39
+ }
@@ -0,0 +1,65 @@
1
+ "use strict";
2
+ var __importDefault = (this && this.__importDefault) || function (mod) {
3
+ return (mod && mod.__esModule) ? mod : { "default": mod };
4
+ };
5
+ Object.defineProperty(exports, "__esModule", { value: true });
6
+ const snakecase_keys_1 = __importDefault(require("snakecase-keys"));
7
+ const core_proto_ts_1 = require("@injectivelabs/core-proto-ts");
8
+ const MsgBase_js_1 = require("../../MsgBase.js");
9
+ /**
10
+ * @category Messages
11
+ */
12
+ class MsgFundCommunityPool extends MsgBase_js_1.MsgBase {
13
+ static fromJSON(params) {
14
+ return new MsgFundCommunityPool(params);
15
+ }
16
+ toProto() {
17
+ const { params } = this;
18
+ const message = core_proto_ts_1.CosmosDistributionV1Beta1Tx.MsgFundCommunityPool.create();
19
+ message.depositor = params.depositor;
20
+ const coins = params.amount.map((amount) => {
21
+ const coin = core_proto_ts_1.CosmosBaseV1Beta1Coin.Coin.create();
22
+ coin.denom = amount.denom;
23
+ coin.amount = amount.amount;
24
+ return coin;
25
+ });
26
+ message.amount = coins;
27
+ return core_proto_ts_1.CosmosDistributionV1Beta1Tx.MsgFundCommunityPool.fromPartial(message);
28
+ }
29
+ toData() {
30
+ const proto = this.toProto();
31
+ return {
32
+ '@type': '/cosmos.distribution.v1beta1.MsgFundCommunityPool',
33
+ ...proto,
34
+ };
35
+ }
36
+ toAmino() {
37
+ const proto = this.toProto();
38
+ const message = {
39
+ ...(0, snakecase_keys_1.default)(proto),
40
+ };
41
+ return {
42
+ type: 'cosmos-sdk/MsgFundCommunityPool',
43
+ value: message,
44
+ };
45
+ }
46
+ toWeb3Gw() {
47
+ const amino = this.toAmino();
48
+ const { value } = amino;
49
+ return {
50
+ '@type': '/cosmos.distribution.v1beta1.MsgFundCommunityPool',
51
+ ...value,
52
+ };
53
+ }
54
+ toDirectSign() {
55
+ const proto = this.toProto();
56
+ return {
57
+ type: '/cosmos.distribution.v1beta1.MsgFundCommunityPool',
58
+ message: proto,
59
+ };
60
+ }
61
+ toBinary() {
62
+ return core_proto_ts_1.CosmosDistributionV1Beta1Tx.MsgFundCommunityPool.encode(this.toProto()).finish();
63
+ }
64
+ }
65
+ exports.default = MsgFundCommunityPool;
@@ -7,6 +7,7 @@ import MsgExternalTransfer from './msgs/MsgExternalTransfer.js';
7
7
  import MsgBatchUpdateOrders from './msgs/MsgBatchUpdateOrders.js';
8
8
  import MsgLiquidatePosition from './msgs/MsgLiquidatePosition.js';
9
9
  import MsgReclaimLockedFunds from './msgs/MsgReclaimLockedFunds.js';
10
+ import MsgUpdateSpotMarketV2 from './msgs/MsgUpdateSpotMarketV2.js';
10
11
  import MsgCreateSpotLimitOrder from './msgs/MsgCreateSpotLimitOrder.js';
11
12
  import MsgAuthorizeStakeGrants from './msgs/MsgAuthorizeStakeGrants.js';
12
13
  import MsgBatchCancelSpotOrders from './msgs/MsgBatchCancelSpotOrders.js';
@@ -14,6 +15,7 @@ import MsgCancelDerivativeOrder from './msgs/MsgCancelDerivativeOrder.js';
14
15
  import MsgCreateSpotMarketOrder from './msgs/MsgCreateSpotMarketOrder.js';
15
16
  import MsgIncreasePositionMargin from './msgs/MsgIncreasePositionMargin.js';
16
17
  import MsgInstantSpotMarketLaunch from './msgs/MsgInstantSpotMarketLaunch.js';
18
+ import MsgUpdateDerivativeMarketV2 from './msgs/MsgUpdateDerivativeMarketV2.js';
17
19
  import MsgCancelBinaryOptionsOrder from './msgs/MsgCancelBinaryOptionsOrder.js';
18
20
  import MsgCreateDerivativeLimitOrder from './msgs/MsgCreateDerivativeLimitOrder.js';
19
21
  import MsgBatchCancelDerivativeOrders from './msgs/MsgBatchCancelDerivativeOrders.js';
@@ -24,5 +26,5 @@ import MsgBatchCancelBinaryOptionsOrders from './msgs/MsgBatchCancelBinaryOption
24
26
  import MsgCreateBinaryOptionsMarketOrder from './msgs/MsgCreateBinaryOptionsMarketOrder.js';
25
27
  import MsgSetDelegationTransferReceivers from './msgs/MsgSetDelegationTransferReceivers.js';
26
28
  import MsgInstantBinaryOptionsMarketLaunch from './msgs/MsgInstantBinaryOptionsMarketLaunch.js';
27
- export { MsgDeposit, MsgWithdraw, MsgSignData, MsgRewardsOptOut, MsgCancelSpotOrder, MsgExternalTransfer, MsgLiquidatePosition, MsgBatchUpdateOrders, MsgReclaimLockedFunds, MsgAuthorizeStakeGrants, MsgCreateSpotLimitOrder, MsgCancelDerivativeOrder, MsgBatchCancelSpotOrders, MsgCreateSpotMarketOrder, MsgIncreasePositionMargin, MsgInstantSpotMarketLaunch, MsgCancelBinaryOptionsOrder, MsgCreateDerivativeLimitOrder, MsgCreateDerivativeMarketOrder, MsgBatchCancelDerivativeOrders, MsgCreateBinaryOptionsLimitOrder, MsgAdminUpdateBinaryOptionsMarket, MsgCreateBinaryOptionsMarketOrder, MsgBatchCancelBinaryOptionsOrders, MsgSetDelegationTransferReceivers, MsgInstantBinaryOptionsMarketLaunch, };
29
+ export { MsgDeposit, MsgWithdraw, MsgSignData, MsgRewardsOptOut, MsgCancelSpotOrder, MsgExternalTransfer, MsgLiquidatePosition, MsgBatchUpdateOrders, MsgUpdateSpotMarketV2, MsgReclaimLockedFunds, MsgAuthorizeStakeGrants, MsgCreateSpotLimitOrder, MsgCancelDerivativeOrder, MsgBatchCancelSpotOrders, MsgCreateSpotMarketOrder, MsgIncreasePositionMargin, MsgInstantSpotMarketLaunch, MsgCancelBinaryOptionsOrder, MsgUpdateDerivativeMarketV2, MsgCreateDerivativeLimitOrder, MsgCreateDerivativeMarketOrder, MsgBatchCancelDerivativeOrders, MsgCreateBinaryOptionsLimitOrder, MsgAdminUpdateBinaryOptionsMarket, MsgCreateBinaryOptionsMarketOrder, MsgBatchCancelBinaryOptionsOrders, MsgSetDelegationTransferReceivers, MsgInstantBinaryOptionsMarketLaunch, };
28
30
  export * from './utils/index.js';
@@ -17,7 +17,7 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
17
17
  return (mod && mod.__esModule) ? mod : { "default": mod };
18
18
  };
19
19
  Object.defineProperty(exports, "__esModule", { value: true });
20
- exports.MsgInstantBinaryOptionsMarketLaunch = exports.MsgSetDelegationTransferReceivers = exports.MsgBatchCancelBinaryOptionsOrders = exports.MsgCreateBinaryOptionsMarketOrder = exports.MsgAdminUpdateBinaryOptionsMarket = exports.MsgCreateBinaryOptionsLimitOrder = exports.MsgBatchCancelDerivativeOrders = exports.MsgCreateDerivativeMarketOrder = exports.MsgCreateDerivativeLimitOrder = exports.MsgCancelBinaryOptionsOrder = exports.MsgInstantSpotMarketLaunch = exports.MsgIncreasePositionMargin = exports.MsgCreateSpotMarketOrder = exports.MsgBatchCancelSpotOrders = exports.MsgCancelDerivativeOrder = exports.MsgCreateSpotLimitOrder = exports.MsgAuthorizeStakeGrants = exports.MsgReclaimLockedFunds = exports.MsgBatchUpdateOrders = exports.MsgLiquidatePosition = exports.MsgExternalTransfer = exports.MsgCancelSpotOrder = exports.MsgRewardsOptOut = exports.MsgSignData = exports.MsgWithdraw = exports.MsgDeposit = void 0;
20
+ exports.MsgInstantBinaryOptionsMarketLaunch = exports.MsgSetDelegationTransferReceivers = exports.MsgBatchCancelBinaryOptionsOrders = exports.MsgCreateBinaryOptionsMarketOrder = exports.MsgAdminUpdateBinaryOptionsMarket = exports.MsgCreateBinaryOptionsLimitOrder = exports.MsgBatchCancelDerivativeOrders = exports.MsgCreateDerivativeMarketOrder = exports.MsgCreateDerivativeLimitOrder = exports.MsgUpdateDerivativeMarketV2 = exports.MsgCancelBinaryOptionsOrder = exports.MsgInstantSpotMarketLaunch = exports.MsgIncreasePositionMargin = exports.MsgCreateSpotMarketOrder = exports.MsgBatchCancelSpotOrders = exports.MsgCancelDerivativeOrder = exports.MsgCreateSpotLimitOrder = exports.MsgAuthorizeStakeGrants = exports.MsgReclaimLockedFunds = exports.MsgUpdateSpotMarketV2 = exports.MsgBatchUpdateOrders = exports.MsgLiquidatePosition = exports.MsgExternalTransfer = exports.MsgCancelSpotOrder = exports.MsgRewardsOptOut = exports.MsgSignData = exports.MsgWithdraw = exports.MsgDeposit = void 0;
21
21
  const MsgDeposit_js_1 = __importDefault(require("./msgs/MsgDeposit.js"));
22
22
  exports.MsgDeposit = MsgDeposit_js_1.default;
23
23
  const MsgSignData_js_1 = __importDefault(require("./msgs/MsgSignData.js"));
@@ -36,6 +36,8 @@ const MsgLiquidatePosition_js_1 = __importDefault(require("./msgs/MsgLiquidatePo
36
36
  exports.MsgLiquidatePosition = MsgLiquidatePosition_js_1.default;
37
37
  const MsgReclaimLockedFunds_js_1 = __importDefault(require("./msgs/MsgReclaimLockedFunds.js"));
38
38
  exports.MsgReclaimLockedFunds = MsgReclaimLockedFunds_js_1.default;
39
+ const MsgUpdateSpotMarketV2_js_1 = __importDefault(require("./msgs/MsgUpdateSpotMarketV2.js"));
40
+ exports.MsgUpdateSpotMarketV2 = MsgUpdateSpotMarketV2_js_1.default;
39
41
  const MsgCreateSpotLimitOrder_js_1 = __importDefault(require("./msgs/MsgCreateSpotLimitOrder.js"));
40
42
  exports.MsgCreateSpotLimitOrder = MsgCreateSpotLimitOrder_js_1.default;
41
43
  const MsgAuthorizeStakeGrants_js_1 = __importDefault(require("./msgs/MsgAuthorizeStakeGrants.js"));
@@ -50,6 +52,8 @@ const MsgIncreasePositionMargin_js_1 = __importDefault(require("./msgs/MsgIncrea
50
52
  exports.MsgIncreasePositionMargin = MsgIncreasePositionMargin_js_1.default;
51
53
  const MsgInstantSpotMarketLaunch_js_1 = __importDefault(require("./msgs/MsgInstantSpotMarketLaunch.js"));
52
54
  exports.MsgInstantSpotMarketLaunch = MsgInstantSpotMarketLaunch_js_1.default;
55
+ const MsgUpdateDerivativeMarketV2_js_1 = __importDefault(require("./msgs/MsgUpdateDerivativeMarketV2.js"));
56
+ exports.MsgUpdateDerivativeMarketV2 = MsgUpdateDerivativeMarketV2_js_1.default;
53
57
  const MsgCancelBinaryOptionsOrder_js_1 = __importDefault(require("./msgs/MsgCancelBinaryOptionsOrder.js"));
54
58
  exports.MsgCancelBinaryOptionsOrder = MsgCancelBinaryOptionsOrder_js_1.default;
55
59
  const MsgCreateDerivativeLimitOrder_js_1 = __importDefault(require("./msgs/MsgCreateDerivativeLimitOrder.js"));
@@ -0,0 +1,92 @@
1
+ import { InjectiveExchangeV2Tx } from '@injectivelabs/core-proto-ts';
2
+ import { MsgBase } from '../../MsgBase.js';
3
+ export declare namespace MsgUpdateDerivativeMarketV2 {
4
+ interface Params {
5
+ admin: string;
6
+ marketId: string;
7
+ newTicker?: string;
8
+ newMinNotional?: string;
9
+ newMinPriceTickSize?: string;
10
+ newMinQuantityTickSize?: string;
11
+ newInitialMarginRatio?: string;
12
+ newMaintenanceMarginRatio?: string;
13
+ newReduceMarginRatio?: string;
14
+ }
15
+ type Proto = InjectiveExchangeV2Tx.MsgUpdateDerivativeMarket;
16
+ }
17
+ /**
18
+ * @category Messages
19
+ */
20
+ export default class MsgUpdateDerivativeMarketV2 extends MsgBase<MsgUpdateDerivativeMarketV2.Params, MsgUpdateDerivativeMarketV2.Proto> {
21
+ static fromJSON(params: MsgUpdateDerivativeMarketV2.Params): MsgUpdateDerivativeMarketV2;
22
+ toProto(): InjectiveExchangeV2Tx.MsgUpdateDerivativeMarket;
23
+ toData(): {
24
+ admin: string;
25
+ marketId: string;
26
+ newTicker: string;
27
+ newMinPriceTickSize: string;
28
+ newMinQuantityTickSize: string;
29
+ newMinNotional: string;
30
+ newInitialMarginRatio: string;
31
+ newMaintenanceMarginRatio: string;
32
+ newReduceMarginRatio: string;
33
+ '@type': string;
34
+ };
35
+ toAmino(): {
36
+ type: string;
37
+ value: {
38
+ admin: string;
39
+ market_id: string;
40
+ new_ticker: string;
41
+ new_min_price_tick_size: string;
42
+ new_min_quantity_tick_size: string;
43
+ new_min_notional: string;
44
+ new_initial_margin_ratio: string;
45
+ new_maintenance_margin_ratio: string;
46
+ new_reduce_margin_ratio: string;
47
+ };
48
+ };
49
+ toWeb3Gw(): {
50
+ admin: string;
51
+ market_id: string;
52
+ new_ticker: string;
53
+ new_min_price_tick_size: string;
54
+ new_min_quantity_tick_size: string;
55
+ new_min_notional: string;
56
+ new_initial_margin_ratio: string;
57
+ new_maintenance_margin_ratio: string;
58
+ new_reduce_margin_ratio: string;
59
+ '@type': string;
60
+ };
61
+ toEip712(): {
62
+ type: string;
63
+ value: {
64
+ admin: string;
65
+ market_id: string;
66
+ new_ticker: string;
67
+ new_min_price_tick_size: string;
68
+ new_min_quantity_tick_size: string;
69
+ new_min_notional: string;
70
+ new_initial_margin_ratio: string;
71
+ new_maintenance_margin_ratio: string;
72
+ new_reduce_margin_ratio: string;
73
+ };
74
+ };
75
+ toEip712V2(): {
76
+ new_min_price_tick_size: string;
77
+ new_min_quantity_tick_size: string;
78
+ new_min_notional: string;
79
+ new_initial_margin_ratio: string;
80
+ new_maintenance_margin_ratio: string;
81
+ new_reduce_margin_ratio: string;
82
+ admin: string;
83
+ market_id: string;
84
+ new_ticker: string;
85
+ '@type': string;
86
+ };
87
+ toDirectSign(): {
88
+ type: string;
89
+ message: InjectiveExchangeV2Tx.MsgUpdateDerivativeMarket;
90
+ };
91
+ toBinary(): Uint8Array;
92
+ }
@@ -0,0 +1,106 @@
1
+ "use strict";
2
+ var __importDefault = (this && this.__importDefault) || function (mod) {
3
+ return (mod && mod.__esModule) ? mod : { "default": mod };
4
+ };
5
+ Object.defineProperty(exports, "__esModule", { value: true });
6
+ const snakecase_keys_1 = __importDefault(require("snakecase-keys"));
7
+ const utils_1 = require("@injectivelabs/utils");
8
+ const core_proto_ts_1 = require("@injectivelabs/core-proto-ts");
9
+ const MsgBase_js_1 = require("../../MsgBase.js");
10
+ const numbers_js_1 = require("../../../../utils/numbers.js");
11
+ const createMessage = (params) => {
12
+ const message = core_proto_ts_1.InjectiveExchangeV2Tx.MsgUpdateDerivativeMarket.create();
13
+ message.admin = params.admin;
14
+ message.marketId = params.marketId;
15
+ message.newTicker = params.newTicker || '';
16
+ message.newMinNotional = params.newMinNotional || '0';
17
+ message.newMinPriceTickSize = params.newMinPriceTickSize || '0';
18
+ message.newMinQuantityTickSize = params.newMinQuantityTickSize || '0';
19
+ message.newInitialMarginRatio = params.newInitialMarginRatio || '0';
20
+ message.newMaintenanceMarginRatio = params.newMaintenanceMarginRatio || '0';
21
+ message.newReduceMarginRatio = params.newReduceMarginRatio || '0';
22
+ return core_proto_ts_1.InjectiveExchangeV2Tx.MsgUpdateDerivativeMarket.fromPartial(message);
23
+ };
24
+ /**
25
+ * @category Messages
26
+ */
27
+ class MsgUpdateDerivativeMarketV2 extends MsgBase_js_1.MsgBase {
28
+ static fromJSON(params) {
29
+ return new MsgUpdateDerivativeMarketV2(params);
30
+ }
31
+ toProto() {
32
+ const { params: initialParams } = this;
33
+ const params = {
34
+ ...initialParams,
35
+ newMinNotional: (0, utils_1.toChainFormat)(initialParams.newMinNotional || '0').toFixed(),
36
+ newMinQuantityTickSize: (0, utils_1.toChainFormat)(initialParams.newMinQuantityTickSize || '0').toFixed(),
37
+ newMinPriceTickSize: (0, utils_1.toChainFormat)(initialParams.newMinPriceTickSize || '0').toFixed(),
38
+ newInitialMarginRatio: (0, utils_1.toChainFormat)(initialParams.newInitialMarginRatio || '0').toFixed(),
39
+ newMaintenanceMarginRatio: (0, utils_1.toChainFormat)(initialParams.newMaintenanceMarginRatio || '0').toFixed(),
40
+ newReduceMarginRatio: (0, utils_1.toChainFormat)(initialParams.newReduceMarginRatio || '0').toFixed(),
41
+ };
42
+ return createMessage(params);
43
+ }
44
+ toData() {
45
+ const proto = this.toProto();
46
+ return {
47
+ '@type': '/injective.exchange.v2.MsgUpdateDerivativeMarket',
48
+ ...proto,
49
+ };
50
+ }
51
+ toAmino() {
52
+ const { params } = this;
53
+ const msg = createMessage(params);
54
+ const message = {
55
+ ...(0, snakecase_keys_1.default)(msg),
56
+ };
57
+ return {
58
+ type: 'exchange/MsgUpdateDerivativeMarket',
59
+ value: message,
60
+ };
61
+ }
62
+ toWeb3Gw() {
63
+ const amino = this.toAmino();
64
+ const { value } = amino;
65
+ return {
66
+ '@type': '/injective.exchange.v2.MsgUpdateDerivativeMarket',
67
+ ...value,
68
+ };
69
+ }
70
+ toEip712() {
71
+ const amino = this.toAmino();
72
+ const { type, value } = amino;
73
+ const messageAdjusted = {
74
+ ...value,
75
+ };
76
+ return {
77
+ type,
78
+ value: messageAdjusted,
79
+ };
80
+ }
81
+ toEip712V2() {
82
+ const { params } = this;
83
+ const web3gw = this.toWeb3Gw();
84
+ const messageAdjusted = {
85
+ ...web3gw,
86
+ new_min_price_tick_size: (0, numbers_js_1.numberToCosmosSdkDecString)(params.newMinPriceTickSize || '0'),
87
+ new_min_quantity_tick_size: (0, numbers_js_1.numberToCosmosSdkDecString)(params.newMinQuantityTickSize || '0'),
88
+ new_min_notional: (0, numbers_js_1.numberToCosmosSdkDecString)(params.newMinNotional || '0'),
89
+ new_initial_margin_ratio: (0, numbers_js_1.numberToCosmosSdkDecString)(params.newInitialMarginRatio || '0'),
90
+ new_maintenance_margin_ratio: (0, numbers_js_1.numberToCosmosSdkDecString)(params.newMaintenanceMarginRatio || '0'),
91
+ new_reduce_margin_ratio: (0, numbers_js_1.numberToCosmosSdkDecString)(params.newReduceMarginRatio || '0'),
92
+ };
93
+ return messageAdjusted;
94
+ }
95
+ toDirectSign() {
96
+ const proto = this.toProto();
97
+ return {
98
+ type: '/injective.exchange.v2.MsgUpdateDerivativeMarket',
99
+ message: proto,
100
+ };
101
+ }
102
+ toBinary() {
103
+ return core_proto_ts_1.InjectiveExchangeV2Tx.MsgUpdateDerivativeMarket.encode(this.toProto()).finish();
104
+ }
105
+ }
106
+ exports.default = MsgUpdateDerivativeMarketV2;
@@ -0,0 +1,74 @@
1
+ import { InjectiveExchangeV2Tx } from '@injectivelabs/core-proto-ts';
2
+ import { MsgBase } from '../../MsgBase.js';
3
+ export declare namespace MsgUpdateSpotMarketV2 {
4
+ interface Params {
5
+ admin: string;
6
+ marketId: string;
7
+ newTicker?: string;
8
+ newMinNotional?: string;
9
+ newMinPriceTickSize?: string;
10
+ newMinQuantityTickSize?: string;
11
+ }
12
+ type Proto = InjectiveExchangeV2Tx.MsgUpdateSpotMarket;
13
+ }
14
+ /**
15
+ * @category Messages
16
+ */
17
+ export default class MsgUpdateSpotMarketV2 extends MsgBase<MsgUpdateSpotMarketV2.Params, MsgUpdateSpotMarketV2.Proto> {
18
+ static fromJSON(params: MsgUpdateSpotMarketV2.Params): MsgUpdateSpotMarketV2;
19
+ toProto(): InjectiveExchangeV2Tx.MsgUpdateSpotMarket;
20
+ toData(): {
21
+ admin: string;
22
+ marketId: string;
23
+ newTicker: string;
24
+ newMinPriceTickSize: string;
25
+ newMinQuantityTickSize: string;
26
+ newMinNotional: string;
27
+ '@type': string;
28
+ };
29
+ toAmino(): {
30
+ type: string;
31
+ value: {
32
+ admin: string;
33
+ market_id: string;
34
+ new_ticker: string;
35
+ new_min_price_tick_size: string;
36
+ new_min_quantity_tick_size: string;
37
+ new_min_notional: string;
38
+ };
39
+ };
40
+ toWeb3Gw(): {
41
+ admin: string;
42
+ market_id: string;
43
+ new_ticker: string;
44
+ new_min_price_tick_size: string;
45
+ new_min_quantity_tick_size: string;
46
+ new_min_notional: string;
47
+ '@type': string;
48
+ };
49
+ toEip712(): {
50
+ type: string;
51
+ value: {
52
+ admin: string;
53
+ market_id: string;
54
+ new_ticker: string;
55
+ new_min_price_tick_size: string;
56
+ new_min_quantity_tick_size: string;
57
+ new_min_notional: string;
58
+ };
59
+ };
60
+ toEip712V2(): {
61
+ new_min_price_tick_size: string;
62
+ new_min_quantity_tick_size: string;
63
+ new_min_notional: string;
64
+ admin: string;
65
+ market_id: string;
66
+ new_ticker: string;
67
+ '@type': string;
68
+ };
69
+ toDirectSign(): {
70
+ type: string;
71
+ message: InjectiveExchangeV2Tx.MsgUpdateSpotMarket;
72
+ };
73
+ toBinary(): Uint8Array;
74
+ }
@@ -0,0 +1,97 @@
1
+ "use strict";
2
+ var __importDefault = (this && this.__importDefault) || function (mod) {
3
+ return (mod && mod.__esModule) ? mod : { "default": mod };
4
+ };
5
+ Object.defineProperty(exports, "__esModule", { value: true });
6
+ const snakecase_keys_1 = __importDefault(require("snakecase-keys"));
7
+ const utils_1 = require("@injectivelabs/utils");
8
+ const core_proto_ts_1 = require("@injectivelabs/core-proto-ts");
9
+ const MsgBase_js_1 = require("../../MsgBase.js");
10
+ const numbers_js_1 = require("../../../../utils/numbers.js");
11
+ const createMessage = (params) => {
12
+ const message = core_proto_ts_1.InjectiveExchangeV2Tx.MsgUpdateSpotMarket.create();
13
+ message.admin = params.admin;
14
+ message.marketId = params.marketId;
15
+ message.newTicker = params.newTicker || '';
16
+ message.newMinNotional = params.newMinNotional || '0';
17
+ message.newMinPriceTickSize = params.newMinPriceTickSize || '0';
18
+ message.newMinQuantityTickSize = params.newMinQuantityTickSize || '0';
19
+ return core_proto_ts_1.InjectiveExchangeV2Tx.MsgUpdateSpotMarket.fromPartial(message);
20
+ };
21
+ /**
22
+ * @category Messages
23
+ */
24
+ class MsgUpdateSpotMarketV2 extends MsgBase_js_1.MsgBase {
25
+ static fromJSON(params) {
26
+ return new MsgUpdateSpotMarketV2(params);
27
+ }
28
+ toProto() {
29
+ const { params: initialParams } = this;
30
+ const params = {
31
+ ...initialParams,
32
+ newMinNotional: (0, utils_1.toChainFormat)(initialParams.newMinNotional || '0').toFixed(),
33
+ newMinQuantityTickSize: (0, utils_1.toChainFormat)(initialParams.newMinQuantityTickSize || '0').toFixed(),
34
+ newMinPriceTickSize: (0, utils_1.toChainFormat)(initialParams.newMinPriceTickSize || '0').toFixed(),
35
+ };
36
+ return createMessage(params);
37
+ }
38
+ toData() {
39
+ const proto = this.toProto();
40
+ return {
41
+ '@type': '/injective.exchange.v2.MsgUpdateSpotMarket',
42
+ ...proto,
43
+ };
44
+ }
45
+ toAmino() {
46
+ const { params } = this;
47
+ const msg = createMessage(params);
48
+ const message = {
49
+ ...(0, snakecase_keys_1.default)(msg),
50
+ };
51
+ return {
52
+ type: 'exchange/MsgUpdateSpotMarket',
53
+ value: message,
54
+ };
55
+ }
56
+ toWeb3Gw() {
57
+ const amino = this.toAmino();
58
+ const { value } = amino;
59
+ return {
60
+ '@type': '/injective.exchange.v2.MsgUpdateSpotMarket',
61
+ ...value,
62
+ };
63
+ }
64
+ toEip712() {
65
+ const amino = this.toAmino();
66
+ const { type, value } = amino;
67
+ const messageAdjusted = {
68
+ ...value,
69
+ };
70
+ return {
71
+ type,
72
+ value: messageAdjusted,
73
+ };
74
+ }
75
+ toEip712V2() {
76
+ const { params } = this;
77
+ const web3gw = this.toWeb3Gw();
78
+ const messageAdjusted = {
79
+ ...web3gw,
80
+ new_min_price_tick_size: (0, numbers_js_1.numberToCosmosSdkDecString)(params.newMinPriceTickSize || '0'),
81
+ new_min_quantity_tick_size: (0, numbers_js_1.numberToCosmosSdkDecString)(params.newMinQuantityTickSize || '0'),
82
+ new_min_notional: (0, numbers_js_1.numberToCosmosSdkDecString)(params.newMinNotional || '0'),
83
+ };
84
+ return messageAdjusted;
85
+ }
86
+ toDirectSign() {
87
+ const proto = this.toProto();
88
+ return {
89
+ type: '/injective.exchange.v2.MsgUpdateSpotMarket',
90
+ message: proto,
91
+ };
92
+ }
93
+ toBinary() {
94
+ return core_proto_ts_1.InjectiveExchangeV2Tx.MsgUpdateSpotMarket.encode(this.toProto()).finish();
95
+ }
96
+ }
97
+ exports.default = MsgUpdateSpotMarketV2;