@injectivelabs/sdk-ts 1.16.14 → 1.16.16

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 (45) hide show
  1. package/dist/cjs/client/indexer/grpc_stream/IndexerGrpcArchiverStream.d.ts +18 -0
  2. package/dist/cjs/client/indexer/grpc_stream/IndexerGrpcArchiverStream.js +38 -0
  3. package/dist/cjs/client/indexer/grpc_stream/index.d.ts +1 -0
  4. package/dist/cjs/client/indexer/grpc_stream/index.js +1 -0
  5. package/dist/cjs/client/indexer/transformers/IndexerArchiverStreamTransformer.d.ts +11 -0
  6. package/dist/cjs/client/indexer/transformers/IndexerArchiverStreamTransformer.js +21 -0
  7. package/dist/cjs/client/indexer/transformers/IndexerGrpcArchiverTransformer.d.ts +2 -1
  8. package/dist/cjs/client/indexer/transformers/IndexerGrpcArchiverTransformer.js +8 -0
  9. package/dist/cjs/client/indexer/transformers/index.d.ts +2 -1
  10. package/dist/cjs/client/indexer/transformers/index.js +2 -1
  11. package/dist/cjs/client/indexer/types/archiver.d.ts +7 -0
  12. package/dist/cjs/core/modules/distribution/index.d.ts +2 -1
  13. package/dist/cjs/core/modules/distribution/index.js +3 -1
  14. package/dist/cjs/core/modules/distribution/msgs/MsgFundCommunityPool.d.ts +39 -0
  15. package/dist/cjs/core/modules/distribution/msgs/MsgFundCommunityPool.js +65 -0
  16. package/dist/cjs/core/modules/exchange/index.d.ts +2 -1
  17. package/dist/cjs/core/modules/exchange/index.js +3 -1
  18. package/dist/cjs/core/modules/exchange/msgs/MsgUpdateDerivativeMarketV2.d.ts +92 -0
  19. package/dist/cjs/core/modules/exchange/msgs/MsgUpdateDerivativeMarketV2.js +106 -0
  20. package/dist/cjs/core/modules/exchange/msgs/MsgUpdateSpotMarketV2.js +0 -1
  21. package/dist/cjs/core/modules/msgs.d.ts +52 -42
  22. package/dist/cjs/core/tx/eip712/maps.js +2 -0
  23. package/dist/esm/client/indexer/grpc_stream/IndexerGrpcArchiverStream.d.ts +18 -0
  24. package/dist/esm/client/indexer/grpc_stream/IndexerGrpcArchiverStream.js +34 -0
  25. package/dist/esm/client/indexer/grpc_stream/index.d.ts +1 -0
  26. package/dist/esm/client/indexer/grpc_stream/index.js +1 -0
  27. package/dist/esm/client/indexer/transformers/IndexerArchiverStreamTransformer.d.ts +11 -0
  28. package/dist/esm/client/indexer/transformers/IndexerArchiverStreamTransformer.js +17 -0
  29. package/dist/esm/client/indexer/transformers/IndexerGrpcArchiverTransformer.d.ts +2 -1
  30. package/dist/esm/client/indexer/transformers/IndexerGrpcArchiverTransformer.js +8 -0
  31. package/dist/esm/client/indexer/transformers/index.d.ts +2 -1
  32. package/dist/esm/client/indexer/transformers/index.js +2 -1
  33. package/dist/esm/client/indexer/types/archiver.d.ts +7 -0
  34. package/dist/esm/core/modules/distribution/index.d.ts +2 -1
  35. package/dist/esm/core/modules/distribution/index.js +2 -1
  36. package/dist/esm/core/modules/distribution/msgs/MsgFundCommunityPool.d.ts +39 -0
  37. package/dist/esm/core/modules/distribution/msgs/MsgFundCommunityPool.js +59 -0
  38. package/dist/esm/core/modules/exchange/index.d.ts +2 -1
  39. package/dist/esm/core/modules/exchange/index.js +2 -1
  40. package/dist/esm/core/modules/exchange/msgs/MsgUpdateDerivativeMarketV2.d.ts +92 -0
  41. package/dist/esm/core/modules/exchange/msgs/MsgUpdateDerivativeMarketV2.js +100 -0
  42. package/dist/esm/core/modules/exchange/msgs/MsgUpdateSpotMarketV2.js +0 -1
  43. package/dist/esm/core/modules/msgs.d.ts +52 -42
  44. package/dist/esm/core/tx/eip712/maps.js +2 -0
  45. package/package.json +6 -6
@@ -0,0 +1,18 @@
1
+ import { InjectiveArchiverRpc } from '@injectivelabs/indexer-proto-ts';
2
+ import { IndexerArchiverStreamTransformer } from '../transformers/index.js';
3
+ import type { Subscription } from 'rxjs';
4
+ import type { StreamStatusResponse } from '../types/index.js';
5
+ export type SpotAverageEntriesStreamCallback = (response: ReturnType<typeof IndexerArchiverStreamTransformer.spotAverageEntriesStreamCallback>) => void;
6
+ /**
7
+ * @category Indexer Grpc Stream
8
+ */
9
+ export declare class IndexerGrpcArchiverStream {
10
+ protected client: InjectiveArchiverRpc.InjectiveArchiverRPCClientImpl;
11
+ constructor(endpoint: string);
12
+ streamSpotAverageEntries({ account, callback, onEndCallback, onStatusCallback, }: {
13
+ account: string;
14
+ callback: SpotAverageEntriesStreamCallback;
15
+ onEndCallback?: (status?: StreamStatusResponse) => void;
16
+ onStatusCallback?: (status: StreamStatusResponse) => void;
17
+ }): Subscription;
18
+ }
@@ -0,0 +1,38 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.IndexerGrpcArchiverStream = void 0;
4
+ const indexer_proto_ts_1 = require("@injectivelabs/indexer-proto-ts");
5
+ const index_js_1 = require("../transformers/index.js");
6
+ const BaseIndexerGrpcWebConsumer_js_1 = require("../../base/BaseIndexerGrpcWebConsumer.js");
7
+ /**
8
+ * @category Indexer Grpc Stream
9
+ */
10
+ class IndexerGrpcArchiverStream {
11
+ client;
12
+ constructor(endpoint) {
13
+ this.client = new indexer_proto_ts_1.InjectiveArchiverRpc.InjectiveArchiverRPCClientImpl((0, BaseIndexerGrpcWebConsumer_js_1.getGrpcIndexerWebImpl)(endpoint));
14
+ }
15
+ streamSpotAverageEntries({ account, callback, onEndCallback, onStatusCallback, }) {
16
+ const request = indexer_proto_ts_1.InjectiveArchiverRpc.StreamSpotAverageEntriesRequest.create();
17
+ request.account = account;
18
+ const subscription = this.client
19
+ .StreamSpotAverageEntries(request)
20
+ .subscribe({
21
+ next(response) {
22
+ callback(index_js_1.IndexerArchiverStreamTransformer.spotAverageEntriesStreamCallback(response));
23
+ },
24
+ error(err) {
25
+ if (onStatusCallback) {
26
+ onStatusCallback(err);
27
+ }
28
+ },
29
+ complete() {
30
+ if (onEndCallback) {
31
+ onEndCallback();
32
+ }
33
+ },
34
+ });
35
+ return subscription;
36
+ }
37
+ }
38
+ exports.IndexerGrpcArchiverStream = IndexerGrpcArchiverStream;
@@ -4,6 +4,7 @@ export * from './IndexerGrpcOracleStream.js';
4
4
  export * from './IndexerGrpcAccountStream.js';
5
5
  export * from './IndexerGrpcAuctionStream.js';
6
6
  export * from './IndexerGrpcTradingStream.js';
7
+ export * from './IndexerGrpcArchiverStream.js';
7
8
  export * from './IndexerGrpcExplorerStream.js';
8
9
  export * from './IndexerGrpcDerivativesStream.js';
9
10
  export * from './IndexerGrpcAccountPortfolioStream.js';
@@ -20,6 +20,7 @@ __exportStar(require("./IndexerGrpcOracleStream.js"), exports);
20
20
  __exportStar(require("./IndexerGrpcAccountStream.js"), exports);
21
21
  __exportStar(require("./IndexerGrpcAuctionStream.js"), exports);
22
22
  __exportStar(require("./IndexerGrpcTradingStream.js"), exports);
23
+ __exportStar(require("./IndexerGrpcArchiverStream.js"), exports);
23
24
  __exportStar(require("./IndexerGrpcExplorerStream.js"), exports);
24
25
  __exportStar(require("./IndexerGrpcDerivativesStream.js"), exports);
25
26
  __exportStar(require("./IndexerGrpcAccountPortfolioStream.js"), exports);
@@ -0,0 +1,11 @@
1
+ import type { InjectiveArchiverRpc } from '@injectivelabs/indexer-proto-ts';
2
+ /**
3
+ * @category Indexer Stream Transformer
4
+ */
5
+ export declare class IndexerArchiverStreamTransformer {
6
+ static spotAverageEntriesStreamCallback: (response: InjectiveArchiverRpc.StreamSpotAverageEntriesResponse) => {
7
+ averageEntry: import("../index.js").SpotAverageEntry | undefined;
8
+ operation: "update";
9
+ timestamp: string;
10
+ };
11
+ }
@@ -0,0 +1,21 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.IndexerArchiverStreamTransformer = void 0;
4
+ const index_js_1 = require("../../../types/index.js");
5
+ const IndexerGrpcArchiverTransformer_js_1 = require("./IndexerGrpcArchiverTransformer.js");
6
+ /**
7
+ * @category Indexer Stream Transformer
8
+ */
9
+ class IndexerArchiverStreamTransformer {
10
+ static spotAverageEntriesStreamCallback = (response) => {
11
+ const averageEntry = response.averageEntry;
12
+ return {
13
+ averageEntry: averageEntry
14
+ ? IndexerGrpcArchiverTransformer_js_1.IndexerGrpcArchiverTransformer.grpcSpotAverageEntryToSpotAverageEntry(averageEntry)
15
+ : undefined,
16
+ operation: index_js_1.StreamOperation.Update,
17
+ timestamp: response.timestamp,
18
+ };
19
+ };
20
+ }
21
+ exports.IndexerArchiverStreamTransformer = IndexerArchiverStreamTransformer;
@@ -1,5 +1,5 @@
1
1
  import type { InjectiveArchiverRpc } from '@injectivelabs/indexer-proto-ts';
2
- import type { AccountStats, DenomHolders, HistoricalRPNL, LeaderboardRow, PnlLeaderboard, VolLeaderboard, HistoricalBalance, HistoricalVolumes } from '../types/archiver.js';
2
+ import type { AccountStats, DenomHolders, HistoricalRPNL, LeaderboardRow, PnlLeaderboard, VolLeaderboard, SpotAverageEntry, HistoricalBalance, HistoricalVolumes } from '../types/archiver.js';
3
3
  /**
4
4
  * @category Indexer Grpc Transformer
5
5
  */
@@ -17,4 +17,5 @@ export declare class IndexerGrpcArchiverTransformer {
17
17
  static grpcVolLeaderboardFixedResolutionResponseToVolLeaderboard(response: InjectiveArchiverRpc.VolLeaderboardFixedResolutionResponse): VolLeaderboard;
18
18
  static grpcDenomHoldersResponseToDenomHolders(response: InjectiveArchiverRpc.DenomHoldersResponse): DenomHolders;
19
19
  static grpcAccountStatsResponseToAccountStats(response: InjectiveArchiverRpc.AccountStatsResponse): AccountStats;
20
+ static grpcSpotAverageEntryToSpotAverageEntry(averageEntry: InjectiveArchiverRpc.SpotAverageEntry): SpotAverageEntry;
20
21
  }
@@ -105,5 +105,13 @@ class IndexerGrpcArchiverTransformer {
105
105
  volume: response.volume,
106
106
  };
107
107
  }
108
+ static grpcSpotAverageEntryToSpotAverageEntry(averageEntry) {
109
+ return {
110
+ marketId: averageEntry.marketId,
111
+ averageEntryPrice: averageEntry.averageEntryPrice,
112
+ quantity: averageEntry.quantity,
113
+ usdValue: averageEntry.usdValue,
114
+ };
115
+ }
108
116
  }
109
117
  exports.IndexerGrpcArchiverTransformer = IndexerGrpcArchiverTransformer;
@@ -7,13 +7,14 @@ export * from './IndexerGrpcAccountTransformer.js';
7
7
  export * from './IndexerGrpcAuctionTransformer.js';
8
8
  export * from './IndexerGrpcArchiverTransformer.js';
9
9
  export * from './IndexerGrpcExplorerTransformer.js';
10
+ export * from './IndexerGrpcReferralTransformer.js';
10
11
  export * from './IndexerOracleStreamTransformer.js';
11
12
  export * from './IndexerRestExplorerTransformer.js';
12
13
  export * from './IndexerAccountStreamTransformer.js';
13
14
  export * from './IndexerAuctionStreamTransformer.js';
15
+ export * from './IndexerArchiverStreamTransformer.js';
14
16
  export * from './IndexerExplorerStreamTransformer.js';
15
17
  export * from './IndexerGrpcDerivativeTransformer.js';
16
- export * from './IndexerGrpcReferralTransformer.js';
17
18
  export * from './IndexerGrpcMitoStreamTransformer.js';
18
19
  export * from './IndexerAccountPortfolioTransformer.js';
19
20
  export * from './IndexerDerivativeStreamTransformer.js';
@@ -23,13 +23,14 @@ __exportStar(require("./IndexerGrpcAccountTransformer.js"), exports);
23
23
  __exportStar(require("./IndexerGrpcAuctionTransformer.js"), exports);
24
24
  __exportStar(require("./IndexerGrpcArchiverTransformer.js"), exports);
25
25
  __exportStar(require("./IndexerGrpcExplorerTransformer.js"), exports);
26
+ __exportStar(require("./IndexerGrpcReferralTransformer.js"), exports);
26
27
  __exportStar(require("./IndexerOracleStreamTransformer.js"), exports);
27
28
  __exportStar(require("./IndexerRestExplorerTransformer.js"), exports);
28
29
  __exportStar(require("./IndexerAccountStreamTransformer.js"), exports);
29
30
  __exportStar(require("./IndexerAuctionStreamTransformer.js"), exports);
31
+ __exportStar(require("./IndexerArchiverStreamTransformer.js"), exports);
30
32
  __exportStar(require("./IndexerExplorerStreamTransformer.js"), exports);
31
33
  __exportStar(require("./IndexerGrpcDerivativeTransformer.js"), exports);
32
- __exportStar(require("./IndexerGrpcReferralTransformer.js"), exports);
33
34
  __exportStar(require("./IndexerGrpcMitoStreamTransformer.js"), exports);
34
35
  __exportStar(require("./IndexerAccountPortfolioTransformer.js"), exports);
35
36
  __exportStar(require("./IndexerDerivativeStreamTransformer.js"), exports);
@@ -42,9 +42,16 @@ export interface AccountStats {
42
42
  pnl: number;
43
43
  volume: number;
44
44
  }
45
+ export interface SpotAverageEntry {
46
+ marketId: string;
47
+ averageEntryPrice: string;
48
+ quantity: string;
49
+ usdValue: string;
50
+ }
45
51
  export type GrpcHistoricalRPNL = InjectiveArchiverRpc.HistoricalRPNL;
46
52
  export type GrpcLeaderboardRow = InjectiveArchiverRpc.LeaderboardRow;
47
53
  export type GrpcDenomHolders = InjectiveArchiverRpc.DenomHoldersResponse;
54
+ export type GrpcSpotAverageEntry = InjectiveArchiverRpc.SpotAverageEntry;
48
55
  export type GrpcHistoricalBalance = InjectiveArchiverRpc.HistoricalBalance;
49
56
  export type GrpcHistoricalVolumes = InjectiveArchiverRpc.HistoricalVolumes;
50
57
  export type GrpcPnlLeaderboard = InjectiveArchiverRpc.PnlLeaderboardResponse | InjectiveArchiverRpc.PnlLeaderboardFixedResolutionResponse;
@@ -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;
@@ -15,6 +15,7 @@ import MsgCancelDerivativeOrder from './msgs/MsgCancelDerivativeOrder.js';
15
15
  import MsgCreateSpotMarketOrder from './msgs/MsgCreateSpotMarketOrder.js';
16
16
  import MsgIncreasePositionMargin from './msgs/MsgIncreasePositionMargin.js';
17
17
  import MsgInstantSpotMarketLaunch from './msgs/MsgInstantSpotMarketLaunch.js';
18
+ import MsgUpdateDerivativeMarketV2 from './msgs/MsgUpdateDerivativeMarketV2.js';
18
19
  import MsgCancelBinaryOptionsOrder from './msgs/MsgCancelBinaryOptionsOrder.js';
19
20
  import MsgCreateDerivativeLimitOrder from './msgs/MsgCreateDerivativeLimitOrder.js';
20
21
  import MsgBatchCancelDerivativeOrders from './msgs/MsgBatchCancelDerivativeOrders.js';
@@ -25,5 +26,5 @@ import MsgBatchCancelBinaryOptionsOrders from './msgs/MsgBatchCancelBinaryOption
25
26
  import MsgCreateBinaryOptionsMarketOrder from './msgs/MsgCreateBinaryOptionsMarketOrder.js';
26
27
  import MsgSetDelegationTransferReceivers from './msgs/MsgSetDelegationTransferReceivers.js';
27
28
  import MsgInstantBinaryOptionsMarketLaunch from './msgs/MsgInstantBinaryOptionsMarketLaunch.js';
28
- export { MsgDeposit, MsgWithdraw, MsgSignData, MsgRewardsOptOut, MsgCancelSpotOrder, MsgExternalTransfer, MsgLiquidatePosition, MsgBatchUpdateOrders, MsgUpdateSpotMarketV2, 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, };
29
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.MsgUpdateSpotMarketV2 = 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"));
@@ -52,6 +52,8 @@ const MsgIncreasePositionMargin_js_1 = __importDefault(require("./msgs/MsgIncrea
52
52
  exports.MsgIncreasePositionMargin = MsgIncreasePositionMargin_js_1.default;
53
53
  const MsgInstantSpotMarketLaunch_js_1 = __importDefault(require("./msgs/MsgInstantSpotMarketLaunch.js"));
54
54
  exports.MsgInstantSpotMarketLaunch = MsgInstantSpotMarketLaunch_js_1.default;
55
+ const MsgUpdateDerivativeMarketV2_js_1 = __importDefault(require("./msgs/MsgUpdateDerivativeMarketV2.js"));
56
+ exports.MsgUpdateDerivativeMarketV2 = MsgUpdateDerivativeMarketV2_js_1.default;
55
57
  const MsgCancelBinaryOptionsOrder_js_1 = __importDefault(require("./msgs/MsgCancelBinaryOptionsOrder.js"));
56
58
  exports.MsgCancelBinaryOptionsOrder = MsgCancelBinaryOptionsOrder_js_1.default;
57
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;
@@ -27,7 +27,6 @@ class MsgUpdateSpotMarketV2 extends MsgBase_js_1.MsgBase {
27
27
  }
28
28
  toProto() {
29
29
  const { params: initialParams } = this;
30
- console.log({ initialParams });
31
30
  const params = {
32
31
  ...initialParams,
33
32
  newMinNotional: (0, utils_1.toChainFormat)(initialParams.newMinNotional || '0').toFixed(),