@injectivelabs/sdk-ts 1.15.43 → 1.16.1-alpha.1

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 (69) hide show
  1. package/dist/cjs/client/chain/grpc/ChainGrpcPeggyApi.d.ts +2 -2
  2. package/dist/cjs/client/chain/grpc/ChainGrpcPeggyApi.js +3 -3
  3. package/dist/cjs/client/chain/grpc/ChainGrpcTendermintApi.d.ts +2 -2
  4. package/dist/cjs/client/chain/grpc/ChainGrpcWasmXApi.d.ts +3 -3
  5. package/dist/cjs/client/chain/grpc/ChainGrpcWasmXApi.js +5 -5
  6. package/dist/cjs/client/chain/transformers/ChainGrpcPeggyTransformer.d.ts +2 -2
  7. package/dist/cjs/client/indexer/grpc/IndexerGrpcTransactionApi.d.ts +3 -3
  8. package/dist/cjs/client/indexer/grpc/IndexerGrpcWeb3GwApi.d.ts +2 -2
  9. package/dist/cjs/core/accounts/PrivateKey.d.ts +2 -2
  10. package/dist/cjs/core/accounts/PrivateKey.js +17 -17
  11. package/dist/cjs/core/modules/authz/msgs/authorizations/ContractExecutionCompatAuthorization.d.ts +2 -2
  12. package/dist/cjs/core/modules/authz/msgs/authorizations/ContractExecutionCompatAuthorization.js +3 -3
  13. package/dist/cjs/core/modules/gov/index.d.ts +3 -2
  14. package/dist/cjs/core/modules/gov/index.js +3 -1
  15. package/dist/cjs/core/modules/gov/msgs/MsgSubmitProposalPerpetualMarketLaunchV2.d.ts +88 -0
  16. package/dist/cjs/core/modules/gov/msgs/MsgSubmitProposalPerpetualMarketLaunchV2.js +174 -0
  17. package/dist/cjs/core/modules/peggy/msgs/MsgSendToEth.d.ts +4 -4
  18. package/dist/cjs/core/modules/peggy/msgs/MsgSendToEth.js +3 -3
  19. package/dist/cjs/core/modules/wasm/msgs/MsgExecuteContract.d.ts +1 -0
  20. package/dist/cjs/core/modules/wasm/msgs/MsgExecuteContract.js +3 -7
  21. package/dist/cjs/core/modules/wasm/msgs/MsgExecuteContractCompat.d.ts +5 -5
  22. package/dist/cjs/core/modules/wasm/msgs/MsgExecuteContractCompat.js +3 -3
  23. package/dist/cjs/core/tx/api/TxGrpcApi.d.ts +2 -2
  24. package/dist/cjs/core/tx/broadcaster/MsgBroadcasterWithPk.d.ts +5 -5
  25. package/dist/cjs/core/tx/broadcaster/MsgBroadcasterWithPk.js +6 -7
  26. package/dist/cjs/core/tx/eip712/eip712.d.ts +5 -5
  27. package/dist/cjs/core/tx/eip712/eip712.js +4 -4
  28. package/dist/cjs/core/tx/eip712/utils.d.ts +3 -3
  29. package/dist/cjs/core/tx/eip712/utils.js +4 -4
  30. package/dist/cjs/core/tx/utils/tx.d.ts +3 -3
  31. package/dist/cjs/core/tx/utils/tx.js +2 -2
  32. package/dist/cjs/utils/grpc.d.ts +1 -1
  33. package/dist/cjs/utils/pagination.d.ts +1 -1
  34. package/dist/cjs/utils/pagination.js +5 -12
  35. package/dist/esm/client/chain/grpc/ChainGrpcPeggyApi.d.ts +2 -2
  36. package/dist/esm/client/chain/grpc/ChainGrpcPeggyApi.js +4 -4
  37. package/dist/esm/client/chain/grpc/ChainGrpcTendermintApi.d.ts +2 -2
  38. package/dist/esm/client/chain/grpc/ChainGrpcWasmXApi.d.ts +3 -3
  39. package/dist/esm/client/chain/grpc/ChainGrpcWasmXApi.js +6 -6
  40. package/dist/esm/client/chain/transformers/ChainGrpcPeggyTransformer.d.ts +2 -2
  41. package/dist/esm/client/indexer/grpc/IndexerGrpcTransactionApi.d.ts +3 -3
  42. package/dist/esm/client/indexer/grpc/IndexerGrpcWeb3GwApi.d.ts +2 -2
  43. package/dist/esm/core/accounts/PrivateKey.d.ts +2 -2
  44. package/dist/esm/core/accounts/PrivateKey.js +17 -17
  45. package/dist/esm/core/modules/authz/msgs/authorizations/ContractExecutionCompatAuthorization.d.ts +2 -2
  46. package/dist/esm/core/modules/authz/msgs/authorizations/ContractExecutionCompatAuthorization.js +4 -4
  47. package/dist/esm/core/modules/gov/index.d.ts +3 -2
  48. package/dist/esm/core/modules/gov/index.js +2 -1
  49. package/dist/esm/core/modules/gov/msgs/MsgSubmitProposalPerpetualMarketLaunchV2.d.ts +88 -0
  50. package/dist/esm/core/modules/gov/msgs/MsgSubmitProposalPerpetualMarketLaunchV2.js +168 -0
  51. package/dist/esm/core/modules/peggy/msgs/MsgSendToEth.d.ts +4 -4
  52. package/dist/esm/core/modules/peggy/msgs/MsgSendToEth.js +4 -4
  53. package/dist/esm/core/modules/wasm/msgs/MsgExecuteContract.d.ts +1 -0
  54. package/dist/esm/core/modules/wasm/msgs/MsgExecuteContract.js +3 -7
  55. package/dist/esm/core/modules/wasm/msgs/MsgExecuteContractCompat.d.ts +5 -5
  56. package/dist/esm/core/modules/wasm/msgs/MsgExecuteContractCompat.js +4 -4
  57. package/dist/esm/core/tx/api/TxGrpcApi.d.ts +2 -2
  58. package/dist/esm/core/tx/broadcaster/MsgBroadcasterWithPk.d.ts +5 -5
  59. package/dist/esm/core/tx/broadcaster/MsgBroadcasterWithPk.js +6 -7
  60. package/dist/esm/core/tx/eip712/eip712.d.ts +5 -5
  61. package/dist/esm/core/tx/eip712/eip712.js +5 -5
  62. package/dist/esm/core/tx/eip712/utils.d.ts +3 -3
  63. package/dist/esm/core/tx/eip712/utils.js +4 -4
  64. package/dist/esm/core/tx/utils/tx.d.ts +3 -3
  65. package/dist/esm/core/tx/utils/tx.js +2 -2
  66. package/dist/esm/utils/grpc.d.ts +1 -1
  67. package/dist/esm/utils/pagination.d.ts +1 -1
  68. package/dist/esm/utils/pagination.js +5 -12
  69. package/package.json +10 -14
@@ -1,11 +1,11 @@
1
- import { InjectivePeggyV1Beta1Query } from '@injectivelabs/core-proto-ts';
1
+ import { InjectivePeggyV1Query } from '@injectivelabs/core-proto-ts';
2
2
  import BaseGrpcConsumer from '../../base/BaseGrpcConsumer.js';
3
3
  /**
4
4
  * @category Chain Grpc API
5
5
  */
6
6
  export declare class ChainGrpcPeggyApi extends BaseGrpcConsumer {
7
7
  protected module: string;
8
- protected client: InjectivePeggyV1Beta1Query.QueryClientImpl;
8
+ protected client: InjectivePeggyV1Query.QueryClientImpl;
9
9
  constructor(endpoint: string);
10
10
  fetchModuleParams(): Promise<import("../types/peggy.js").PeggyModuleParams>;
11
11
  }
@@ -17,16 +17,16 @@ class ChainGrpcPeggyApi extends BaseGrpcConsumer_js_1.default {
17
17
  client;
18
18
  constructor(endpoint) {
19
19
  super(endpoint);
20
- this.client = new core_proto_ts_1.InjectivePeggyV1Beta1Query.QueryClientImpl(this.getGrpcWebImpl(endpoint));
20
+ this.client = new core_proto_ts_1.InjectivePeggyV1Query.QueryClientImpl(this.getGrpcWebImpl(endpoint));
21
21
  }
22
22
  async fetchModuleParams() {
23
- const request = core_proto_ts_1.InjectivePeggyV1Beta1Query.QueryParamsRequest.create();
23
+ const request = core_proto_ts_1.InjectivePeggyV1Query.QueryParamsRequest.create();
24
24
  try {
25
25
  const response = await this.retry(() => this.client.Params(request, this.metadata));
26
26
  return index_js_2.ChainGrpcPeggyTransformer.moduleParamsResponseToModuleParams(response);
27
27
  }
28
28
  catch (e) {
29
- if (e instanceof core_proto_ts_1.InjectivePeggyV1Beta1Query.GrpcWebError) {
29
+ if (e instanceof core_proto_ts_1.InjectivePeggyV1Query.GrpcWebError) {
30
30
  throw new exceptions_1.GrpcUnaryRequestException(new Error(e.toString()), {
31
31
  code: (0, exceptions_1.grpcErrorCodeToErrorCode)(e.code),
32
32
  context: 'Params',
@@ -7,6 +7,6 @@ export declare class ChainGrpcTendermintApi extends BaseGrpcConsumer {
7
7
  protected module: string;
8
8
  protected client: CosmosBaseTendermintV1Beta1Query.ServiceClientImpl;
9
9
  constructor(endpoint: string);
10
- fetchLatestBlock(): Promise<import("@injectivelabs/core-proto-ts/cjs/cosmos/base/tendermint/v1beta1/types.js").Block | import("@injectivelabs/core-proto-ts/cjs/tendermint/types/block.js").Block | undefined>;
11
- fetchBlock(height: number | string): Promise<import("@injectivelabs/core-proto-ts/cjs/cosmos/base/tendermint/v1beta1/types.js").Block | import("@injectivelabs/core-proto-ts/cjs/tendermint/types/block.js").Block | undefined>;
10
+ fetchLatestBlock(): Promise<import("@injectivelabs/core-proto-ts/cjs/cosmos/base/tendermint/v1beta1/types.js").Block | import("@injectivelabs/core-proto-ts/cjs/cometbft/types/v1/block.js").Block | undefined>;
11
+ fetchBlock(height: number | string): Promise<import("@injectivelabs/core-proto-ts/cjs/cosmos/base/tendermint/v1beta1/types.js").Block | import("@injectivelabs/core-proto-ts/cjs/cometbft/types/v1/block.js").Block | undefined>;
12
12
  }
@@ -1,12 +1,12 @@
1
- import { InjectiveWasmxV1Beta1Query } from '@injectivelabs/core-proto-ts';
1
+ import { InjectiveWasmxV1Query } from '@injectivelabs/core-proto-ts';
2
2
  import BaseGrpcConsumer from '../../base/BaseGrpcConsumer.js';
3
3
  /**
4
4
  * @category Chain Grpc API
5
5
  */
6
6
  export declare class ChainGrpcWasmXApi extends BaseGrpcConsumer {
7
7
  protected module: string;
8
- protected client: InjectiveWasmxV1Beta1Query.QueryClientImpl;
8
+ protected client: InjectiveWasmxV1Query.QueryClientImpl;
9
9
  constructor(endpoint: string);
10
- fetchModuleParams(): Promise<InjectiveWasmxV1Beta1Query.QueryWasmxParamsResponse>;
10
+ fetchModuleParams(): Promise<InjectiveWasmxV1Query.QueryWasmxParamsResponse>;
11
11
  fetchModuleState(): Promise<import("@injectivelabs/core-proto-ts/cjs/injective/wasmx/v1/genesis.js").GenesisState | undefined>;
12
12
  }
@@ -16,16 +16,16 @@ class ChainGrpcWasmXApi extends BaseGrpcConsumer_js_1.default {
16
16
  client;
17
17
  constructor(endpoint) {
18
18
  super(endpoint);
19
- this.client = new core_proto_ts_1.InjectiveWasmxV1Beta1Query.QueryClientImpl(this.getGrpcWebImpl(endpoint));
19
+ this.client = new core_proto_ts_1.InjectiveWasmxV1Query.QueryClientImpl(this.getGrpcWebImpl(endpoint));
20
20
  }
21
21
  async fetchModuleParams() {
22
- const request = core_proto_ts_1.InjectiveWasmxV1Beta1Query.QueryWasmxParamsRequest.create();
22
+ const request = core_proto_ts_1.InjectiveWasmxV1Query.QueryWasmxParamsRequest.create();
23
23
  try {
24
24
  const response = await this.retry(() => this.client.WasmxParams(request, this.metadata));
25
25
  return response;
26
26
  }
27
27
  catch (e) {
28
- if (e instanceof core_proto_ts_1.InjectiveWasmxV1Beta1Query.GrpcWebError) {
28
+ if (e instanceof core_proto_ts_1.InjectiveWasmxV1Query.GrpcWebError) {
29
29
  throw new exceptions_1.GrpcUnaryRequestException(new Error(e.toString()), {
30
30
  code: (0, exceptions_1.grpcErrorCodeToErrorCode)(e.code),
31
31
  context: 'WasmxParams',
@@ -40,13 +40,13 @@ class ChainGrpcWasmXApi extends BaseGrpcConsumer_js_1.default {
40
40
  }
41
41
  }
42
42
  async fetchModuleState() {
43
- const request = core_proto_ts_1.InjectiveWasmxV1Beta1Query.QueryModuleStateRequest.create();
43
+ const request = core_proto_ts_1.InjectiveWasmxV1Query.QueryModuleStateRequest.create();
44
44
  try {
45
45
  const response = await this.retry(() => this.client.WasmxModuleState(request, this.metadata));
46
46
  return response.state; /* TODO */
47
47
  }
48
48
  catch (e) {
49
- if (e instanceof core_proto_ts_1.InjectiveWasmxV1Beta1Query.GrpcWebError) {
49
+ if (e instanceof core_proto_ts_1.InjectiveWasmxV1Query.GrpcWebError) {
50
50
  throw new exceptions_1.GrpcUnaryRequestException(new Error(e.toString()), {
51
51
  code: (0, exceptions_1.grpcErrorCodeToErrorCode)(e.code),
52
52
  context: 'WasmxModuleState',
@@ -1,8 +1,8 @@
1
1
  import { PeggyModuleParams } from '../types/peggy.js';
2
- import { InjectivePeggyV1Beta1Query } from '@injectivelabs/core-proto-ts';
2
+ import { InjectivePeggyV1Query } from '@injectivelabs/core-proto-ts';
3
3
  /**
4
4
  * @category Chain Grpc Transformer
5
5
  */
6
6
  export declare class ChainGrpcPeggyTransformer {
7
- static moduleParamsResponseToModuleParams(response: InjectivePeggyV1Beta1Query.QueryParamsResponse): PeggyModuleParams;
7
+ static moduleParamsResponseToModuleParams(response: InjectivePeggyV1Query.QueryParamsResponse): PeggyModuleParams;
8
8
  }
@@ -1,10 +1,10 @@
1
- import { AccountAddress, EthereumChainId } from '@injectivelabs/ts-types';
1
+ import { AccountAddress, EvmChainId } from '@injectivelabs/ts-types';
2
2
  import { InjectiveExchangeRpc } from '@injectivelabs/indexer-proto-ts';
3
3
  import { CosmosTxV1Beta1Tx } from '@injectivelabs/core-proto-ts';
4
4
  import BaseGrpcConsumer from '../../base/BaseIndexerGrpcConsumer.js';
5
5
  interface PrepareTxArgs {
6
6
  address: AccountAddress;
7
- chainId: EthereumChainId;
7
+ chainId: EvmChainId;
8
8
  message: any;
9
9
  estimateGas?: boolean;
10
10
  gasLimit?: number;
@@ -41,7 +41,7 @@ export declare class IndexerGrpcTransactionApi extends BaseGrpcConsumer {
41
41
  */
42
42
  broadcastTxRequest({ signature, chainId, message, txResponse, }: {
43
43
  signature: string;
44
- chainId: EthereumChainId;
44
+ chainId: EvmChainId;
45
45
  useCorrectEIP712Hash?: boolean;
46
46
  txResponse: InjectiveExchangeRpc.PrepareTxResponse;
47
47
  message: Record<string, any>;
@@ -1,4 +1,4 @@
1
- import { AccountAddress, EthereumChainId } from '@injectivelabs/ts-types';
1
+ import { AccountAddress, EvmChainId } from '@injectivelabs/ts-types';
2
2
  import { InjectiveExchangeRpc } from '@injectivelabs/indexer-proto-ts';
3
3
  import { IndexerGrpcTransactionApi } from './IndexerGrpcTransactionApi.js';
4
4
  /**
@@ -9,7 +9,7 @@ export declare class IndexerGrpcWeb3GwApi extends IndexerGrpcTransactionApi {
9
9
  constructor(endpoint: string);
10
10
  prepareEip712Request({ address, chainId, message, memo, sequence, accountNumber, estimateGas, gasLimit, feeDenom, feePrice, timeoutHeight, eip712Version, }: {
11
11
  address: AccountAddress;
12
- chainId: EthereumChainId;
12
+ chainId: EvmChainId;
13
13
  message: any;
14
14
  estimateGas?: boolean;
15
15
  gasLimit?: number;
@@ -1,6 +1,6 @@
1
- import { PublicKey } from './PublicKey.js';
2
- import { Address } from './Address.js';
3
1
  import { CosmosTxV1Beta1Tx } from '@injectivelabs/core-proto-ts';
2
+ import { Address } from './Address.js';
3
+ import { PublicKey } from './PublicKey.js';
4
4
  /**
5
5
  * Class for wrapping SigningKey that is used for signature creation and public key derivation.
6
6
  *
@@ -4,19 +4,19 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
4
4
  };
5
5
  Object.defineProperty(exports, "__esModule", { value: true });
6
6
  exports.PrivateKey = void 0;
7
- const bip39_1 = require("bip39");
8
- const ethers_1 = require("ethers");
9
7
  const secp256k1_1 = __importDefault(require("secp256k1"));
10
8
  const keccak256_1 = __importDefault(require("keccak256"));
11
- const PublicKey_js_1 = require("./PublicKey.js");
12
- const Address_js_1 = require("./Address.js");
9
+ const bip39_1 = require("bip39");
10
+ const core_proto_ts_1 = require("@injectivelabs/core-proto-ts");
11
+ const exceptions_1 = require("@injectivelabs/exceptions");
12
+ const ts_types_1 = require("@injectivelabs/ts-types");
13
+ const ethers_1 = require("ethers");
13
14
  const eth_sig_util_1 = require("@metamask/eth-sig-util");
14
15
  const index_js_1 = require("../../utils/index.js");
15
- const core_proto_ts_1 = require("@injectivelabs/core-proto-ts");
16
+ const Address_js_1 = require("./Address.js");
17
+ const PublicKey_js_1 = require("./PublicKey.js");
16
18
  const tx_js_1 = require("../tx/utils/tx.js");
17
19
  const index_js_2 = require("../tx/eip712/index.js");
18
- const exceptions_1 = require("@injectivelabs/exceptions");
19
- const ts_types_1 = require("@injectivelabs/ts-types");
20
20
  /**
21
21
  * Class for wrapping SigningKey that is used for signature creation and public key derivation.
22
22
  *
@@ -266,31 +266,31 @@ class PrivateKey {
266
266
  const getChainIds = () => {
267
267
  if (!body.extensionOptions.length) {
268
268
  return {
269
- ethereumChainId: ts_types_1.EthereumChainId.Mainnet,
270
269
  chainId: ts_types_1.ChainId.Mainnet,
270
+ EvmChainId: ts_types_1.EvmChainId.Mainnet,
271
271
  };
272
272
  }
273
273
  const extension = body.extensionOptions.find((extension) => extension.typeUrl.includes('ExtensionOptionsWeb3Tx'));
274
274
  if (!extension) {
275
275
  return {
276
- ethereumChainId: ts_types_1.EthereumChainId.Mainnet,
277
276
  chainId: ts_types_1.ChainId.Mainnet,
277
+ EvmChainId: ts_types_1.EvmChainId.Mainnet,
278
278
  };
279
279
  }
280
280
  const decodedExtension = core_proto_ts_1.InjectiveTypesV1Beta1TxExt.ExtensionOptionsWeb3Tx.decode(extension.value);
281
- const ethereumChainId = Number(decodedExtension.typedDataChainID);
281
+ const evmChainId = Number(decodedExtension.typedDataChainID);
282
282
  return {
283
- ethereumChainId: ethereumChainId,
283
+ evmChainId: ts_types_1.EvmChainId,
284
284
  chainId: [
285
- ts_types_1.EthereumChainId.Goerli,
286
- ts_types_1.EthereumChainId.Kovan,
287
- ts_types_1.EthereumChainId.Sepolia,
288
- ].includes(ethereumChainId)
285
+ ts_types_1.EvmChainId.Kovan,
286
+ ts_types_1.EvmChainId.Goerli,
287
+ ts_types_1.EvmChainId.Sepolia,
288
+ ].includes(evmChainId)
289
289
  ? ts_types_1.ChainId.Testnet
290
290
  : ts_types_1.ChainId.Mainnet,
291
291
  };
292
292
  };
293
- const { ethereumChainId, chainId } = getChainIds();
293
+ const { evmChainId, chainId } = getChainIds();
294
294
  const [signerInfo] = authInfo.signerInfos;
295
295
  const [signature] = signatures;
296
296
  const [msg] = body.messages;
@@ -305,7 +305,7 @@ class PrivateKey {
305
305
  timeoutHeight: body.timeoutHeight.toString(),
306
306
  chainId,
307
307
  },
308
- ethereumChainId,
308
+ evmChainId: evmChainId,
309
309
  });
310
310
  return this.verifySignature({
311
311
  eip712: eip712TypedData,
@@ -1,5 +1,5 @@
1
1
  import { Coin } from '@injectivelabs/ts-types';
2
- import { GoogleProtobufAny, InjectiveWasmxV1Beta1Authz } from '@injectivelabs/core-proto-ts';
2
+ import { GoogleProtobufAny, InjectiveWasmxV1Authz } from '@injectivelabs/core-proto-ts';
3
3
  import { BaseAuthorization } from './Base.js';
4
4
  export declare namespace ContractExecutionCompatAuthorization {
5
5
  interface Params {
@@ -13,7 +13,7 @@ export declare namespace ContractExecutionCompatAuthorization {
13
13
  };
14
14
  }
15
15
  type Any = GoogleProtobufAny.Any;
16
- type Proto = InjectiveWasmxV1Beta1Authz.ContractExecutionCompatAuthorization;
16
+ type Proto = InjectiveWasmxV1Authz.ContractExecutionCompatAuthorization;
17
17
  type Amino = Object;
18
18
  }
19
19
  /**
@@ -11,7 +11,7 @@ class ContractExecutionCompatAuthorization extends Base_js_1.BaseAuthorization {
11
11
  }
12
12
  toAny() {
13
13
  const { params } = this;
14
- const authorization = core_proto_ts_1.InjectiveWasmxV1Beta1Authz.ContractExecutionCompatAuthorization.create();
14
+ const authorization = core_proto_ts_1.InjectiveWasmxV1Authz.ContractExecutionCompatAuthorization.create();
15
15
  const grant = core_proto_ts_1.CosmwasmWasmV1Authz.ContractGrant.create();
16
16
  grant.contract = params.contract;
17
17
  if (params.limit) {
@@ -62,11 +62,11 @@ class ContractExecutionCompatAuthorization extends Base_js_1.BaseAuthorization {
62
62
  const any = core_proto_ts_1.GoogleProtobufAny.Any.create();
63
63
  any.typeUrl = '/injective.wasmx.v1.ContractExecutionCompatAuthorization';
64
64
  any.value =
65
- core_proto_ts_1.InjectiveWasmxV1Beta1Authz.ContractExecutionCompatAuthorization.encode(authorization).finish();
65
+ core_proto_ts_1.InjectiveWasmxV1Authz.ContractExecutionCompatAuthorization.encode(authorization).finish();
66
66
  return any;
67
67
  }
68
68
  toProto() {
69
- const authorization = core_proto_ts_1.InjectiveWasmxV1Beta1Authz.ContractExecutionCompatAuthorization.decode(this.toAny().value);
69
+ const authorization = core_proto_ts_1.InjectiveWasmxV1Authz.ContractExecutionCompatAuthorization.decode(this.toAny().value);
70
70
  return authorization;
71
71
  }
72
72
  toAmino() {
@@ -6,7 +6,8 @@ import MsgSubmitProposalSpotMarketLaunch from './msgs/MsgSubmitProposalSpotMarke
6
6
  import MsgSubmitProposalPerpetualMarketLaunch from './msgs/MsgSubmitProposalPerpetualMarketLaunch.js';
7
7
  import MsgSubmitProposalSpotMarketParamUpdate from './msgs/MsgSubmitProposalSpotMarketParamUpdate.js';
8
8
  import MsgSubmitProposalExpiryFuturesMarketLaunch from './msgs/MsgSubmitProposalExpiryFuturesMarketLaunch.js';
9
- export type MsgSubmitProposal = MsgSubmitTextProposal | MsgSubmitGenericProposal | MsgSubmitProposalSpotMarketLaunch | MsgSubmitProposalPerpetualMarketLaunch | MsgSubmitProposalSpotMarketParamUpdate | MsgSubmitProposalExpiryFuturesMarketLaunch;
10
- export { MsgSubmitTextProposal, MsgSubmitGenericProposal, MsgSubmitProposalSpotMarketLaunch, MsgSubmitProposalPerpetualMarketLaunch, MsgSubmitProposalSpotMarketParamUpdate, MsgSubmitProposalExpiryFuturesMarketLaunch, };
9
+ import MsgSubmitProposalPerpetualMarketLaunchV2 from './msgs/MsgSubmitProposalPerpetualMarketLaunchV2.js';
10
+ export type MsgSubmitProposal = MsgSubmitTextProposal | MsgSubmitGenericProposal | MsgSubmitProposalSpotMarketLaunch | MsgSubmitProposalPerpetualMarketLaunch | MsgSubmitProposalSpotMarketParamUpdate | MsgSubmitProposalPerpetualMarketLaunchV2 | MsgSubmitProposalExpiryFuturesMarketLaunch;
11
+ export { MsgSubmitTextProposal, MsgSubmitGenericProposal, MsgSubmitProposalSpotMarketLaunch, MsgSubmitProposalPerpetualMarketLaunch, MsgSubmitProposalSpotMarketParamUpdate, MsgSubmitProposalPerpetualMarketLaunchV2, MsgSubmitProposalExpiryFuturesMarketLaunch, };
11
12
  export * from './ProposalContentDecomposer.js';
12
13
  export { MsgVote, MsgGovDeposit };
@@ -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.MsgGovDeposit = exports.MsgVote = exports.MsgSubmitProposalExpiryFuturesMarketLaunch = exports.MsgSubmitProposalSpotMarketParamUpdate = exports.MsgSubmitProposalPerpetualMarketLaunch = exports.MsgSubmitProposalSpotMarketLaunch = exports.MsgSubmitGenericProposal = exports.MsgSubmitTextProposal = void 0;
20
+ exports.MsgGovDeposit = exports.MsgVote = exports.MsgSubmitProposalExpiryFuturesMarketLaunch = exports.MsgSubmitProposalPerpetualMarketLaunchV2 = exports.MsgSubmitProposalSpotMarketParamUpdate = exports.MsgSubmitProposalPerpetualMarketLaunch = exports.MsgSubmitProposalSpotMarketLaunch = exports.MsgSubmitGenericProposal = exports.MsgSubmitTextProposal = void 0;
21
21
  const MsgVote_js_1 = __importDefault(require("./msgs/MsgVote.js"));
22
22
  exports.MsgVote = MsgVote_js_1.default;
23
23
  const MsgDeposit_js_1 = __importDefault(require("./msgs/MsgDeposit.js"));
@@ -34,4 +34,6 @@ const MsgSubmitProposalSpotMarketParamUpdate_js_1 = __importDefault(require("./m
34
34
  exports.MsgSubmitProposalSpotMarketParamUpdate = MsgSubmitProposalSpotMarketParamUpdate_js_1.default;
35
35
  const MsgSubmitProposalExpiryFuturesMarketLaunch_js_1 = __importDefault(require("./msgs/MsgSubmitProposalExpiryFuturesMarketLaunch.js"));
36
36
  exports.MsgSubmitProposalExpiryFuturesMarketLaunch = MsgSubmitProposalExpiryFuturesMarketLaunch_js_1.default;
37
+ const MsgSubmitProposalPerpetualMarketLaunchV2_js_1 = __importDefault(require("./msgs/MsgSubmitProposalPerpetualMarketLaunchV2.js"));
38
+ exports.MsgSubmitProposalPerpetualMarketLaunchV2 = MsgSubmitProposalPerpetualMarketLaunchV2_js_1.default;
37
39
  __exportStar(require("./ProposalContentDecomposer.js"), exports);
@@ -0,0 +1,88 @@
1
+ import { GoogleProtobufAny, CosmosGovV1Beta1Tx, CosmosBaseV1Beta1Coin, InjectiveOracleV1Beta1Oracle } from '@injectivelabs/core-proto-ts';
2
+ import { SnakeCaseKeys } from 'snakecase-keys';
3
+ import { MsgBase } from '../../MsgBase.js';
4
+ export declare namespace MsgSubmitProposalPerpetualMarketLaunchV2 {
5
+ interface Params {
6
+ market: {
7
+ title: string;
8
+ description: string;
9
+ ticker: string;
10
+ quoteDenom: string;
11
+ oracleBase: string;
12
+ oracleQuote: string;
13
+ oracleScaleFactor: number;
14
+ oracleType: InjectiveOracleV1Beta1Oracle.OracleType;
15
+ initialMarginRatio: string;
16
+ maintenanceMarginRatio: string;
17
+ makerFeeRate: string;
18
+ takerFeeRate: string;
19
+ minPriceTickSize: string;
20
+ minQuantityTickSize: string;
21
+ minNotional: string;
22
+ reduceMarginRatio: string;
23
+ adminInfo?: {
24
+ admin: string;
25
+ adminPermissions: number;
26
+ };
27
+ };
28
+ proposer: string;
29
+ deposit: {
30
+ amount: string;
31
+ denom: string;
32
+ };
33
+ }
34
+ type Proto = CosmosGovV1Beta1Tx.MsgSubmitProposal;
35
+ type Object = Omit<CosmosGovV1Beta1Tx.MsgSubmitProposal, 'content'> & {
36
+ content: {
37
+ type_url: string;
38
+ value: any;
39
+ };
40
+ };
41
+ }
42
+ /**
43
+ * @category Messages
44
+ */
45
+ export default class MsgSubmitProposalPerpetualMarketLaunchV2 extends MsgBase<MsgSubmitProposalPerpetualMarketLaunchV2.Params, MsgSubmitProposalPerpetualMarketLaunchV2.Proto, MsgSubmitProposalPerpetualMarketLaunchV2.Object> {
46
+ static fromJSON(params: MsgSubmitProposalPerpetualMarketLaunchV2.Params): MsgSubmitProposalPerpetualMarketLaunchV2;
47
+ toProto(): CosmosGovV1Beta1Tx.MsgSubmitProposal;
48
+ toData(): {
49
+ content: GoogleProtobufAny.Any | undefined;
50
+ initialDeposit: CosmosBaseV1Beta1Coin.Coin[];
51
+ proposer: string;
52
+ '@type': string;
53
+ };
54
+ toAmino(): {
55
+ type: string;
56
+ value: SnakeCaseKeys<MsgSubmitProposalPerpetualMarketLaunchV2.Object>;
57
+ };
58
+ toWeb3Gw(): {
59
+ initial_deposit: {
60
+ denom: string;
61
+ amount: string;
62
+ }[];
63
+ proposer: string;
64
+ content: {
65
+ type_url: string;
66
+ value: any;
67
+ };
68
+ '@type': string;
69
+ };
70
+ toEip712(): {
71
+ type: string;
72
+ value: SnakeCaseKeys<MsgSubmitProposalPerpetualMarketLaunchV2.Object>;
73
+ };
74
+ toEip712V2(): {
75
+ content: any;
76
+ initial_deposit: {
77
+ denom: string;
78
+ amount: string;
79
+ }[];
80
+ proposer: string;
81
+ '@type': string;
82
+ };
83
+ toDirectSign(): {
84
+ type: string;
85
+ message: CosmosGovV1Beta1Tx.MsgSubmitProposal;
86
+ };
87
+ toBinary(): Uint8Array;
88
+ }
@@ -0,0 +1,174 @@
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 core_proto_ts_1 = require("@injectivelabs/core-proto-ts");
7
+ const snakecase_keys_1 = __importDefault(require("snakecase-keys"));
8
+ const MsgBase_js_1 = require("../../MsgBase.js");
9
+ const numbers_js_1 = require("../../../../utils/numbers.js");
10
+ const createPerpetualMarketLaunch = (params) => {
11
+ const content = core_proto_ts_1.InjectiveExchangeV2Proposal.PerpetualMarketLaunchProposal.create();
12
+ content.title = params.market.title;
13
+ content.description = params.market.description;
14
+ content.ticker = params.market.ticker;
15
+ content.quoteDenom = params.market.quoteDenom;
16
+ content.oracleBase = params.market.oracleBase;
17
+ content.oracleQuote = params.market.oracleQuote;
18
+ content.oracleScaleFactor = params.market.oracleScaleFactor;
19
+ content.oracleType = params.market.oracleType;
20
+ content.initialMarginRatio = params.market.initialMarginRatio;
21
+ content.maintenanceMarginRatio = params.market.maintenanceMarginRatio;
22
+ content.makerFeeRate = params.market.makerFeeRate;
23
+ content.takerFeeRate = params.market.takerFeeRate;
24
+ content.minPriceTickSize = params.market.minPriceTickSize;
25
+ content.minQuantityTickSize = params.market.minQuantityTickSize;
26
+ content.minNotional = params.market.minNotional;
27
+ content.reduceMarginRatio = params.market.reduceMarginRatio;
28
+ if (params.market.adminInfo) {
29
+ const adminInfo = core_proto_ts_1.InjectiveExchangeV2Proposal.AdminInfo.create();
30
+ adminInfo.admin = params.market.adminInfo.admin;
31
+ adminInfo.adminPermissions = params.market.adminInfo.adminPermissions;
32
+ content.adminInfo = adminInfo;
33
+ }
34
+ return core_proto_ts_1.InjectiveExchangeV2Proposal.PerpetualMarketLaunchProposal.fromPartial(content);
35
+ };
36
+ /**
37
+ * @category Messages
38
+ */
39
+ class MsgSubmitProposalPerpetualMarketLaunchV2 extends MsgBase_js_1.MsgBase {
40
+ static fromJSON(params) {
41
+ return new MsgSubmitProposalPerpetualMarketLaunchV2(params);
42
+ }
43
+ toProto() {
44
+ const { params: initialParams } = this;
45
+ const params = {
46
+ ...initialParams,
47
+ market: {
48
+ ...initialParams.market,
49
+ initialMarginRatio: (0, numbers_js_1.amountToCosmosSdkDecAmount)(initialParams.market.initialMarginRatio).toFixed(),
50
+ maintenanceMarginRatio: (0, numbers_js_1.amountToCosmosSdkDecAmount)(initialParams.market.maintenanceMarginRatio).toFixed(),
51
+ makerFeeRate: (0, numbers_js_1.amountToCosmosSdkDecAmount)(initialParams.market.makerFeeRate).toFixed(),
52
+ takerFeeRate: (0, numbers_js_1.amountToCosmosSdkDecAmount)(initialParams.market.takerFeeRate).toFixed(),
53
+ minQuantityTickSize: (0, numbers_js_1.amountToCosmosSdkDecAmount)(initialParams.market.minQuantityTickSize).toFixed(),
54
+ minNotional: (0, numbers_js_1.amountToCosmosSdkDecAmount)(initialParams.market.minNotional).toFixed(),
55
+ reduceMarginRatio: (0, numbers_js_1.amountToCosmosSdkDecAmount)(initialParams.market.reduceMarginRatio).toFixed(),
56
+ },
57
+ };
58
+ const depositParams = core_proto_ts_1.CosmosBaseV1Beta1Coin.Coin.create();
59
+ depositParams.denom = params.deposit.denom;
60
+ depositParams.amount = params.deposit.amount;
61
+ const contentAny = core_proto_ts_1.GoogleProtobufAny.Any.create();
62
+ contentAny.typeUrl =
63
+ '/injective.exchange.v1beta1.PerpetualMarketLaunchProposal';
64
+ contentAny.value =
65
+ core_proto_ts_1.InjectiveExchangeV2Proposal.PerpetualMarketLaunchProposal.encode(createPerpetualMarketLaunch(params)).finish();
66
+ const message = core_proto_ts_1.CosmosGovV1Beta1Tx.MsgSubmitProposal.create();
67
+ message.content = contentAny;
68
+ message.initialDeposit = [depositParams];
69
+ message.proposer = params.proposer;
70
+ return core_proto_ts_1.CosmosGovV1Beta1Tx.MsgSubmitProposal.fromPartial(message);
71
+ }
72
+ toData() {
73
+ const proto = this.toProto();
74
+ return {
75
+ '@type': '/cosmos.gov.v1beta1.MsgSubmitProposal',
76
+ ...proto,
77
+ };
78
+ }
79
+ toAmino() {
80
+ const { params } = this;
81
+ const content = createPerpetualMarketLaunch(params);
82
+ const messageWithProposalType = (0, snakecase_keys_1.default)({
83
+ content: {
84
+ type: 'exchange/PerpetualMarketLaunchProposal',
85
+ value: content,
86
+ },
87
+ initial_deposit: [
88
+ {
89
+ denom: params.deposit.denom,
90
+ amount: params.deposit.amount,
91
+ },
92
+ ],
93
+ proposer: params.proposer,
94
+ });
95
+ return {
96
+ type: 'cosmos-sdk/MsgSubmitProposal',
97
+ value: messageWithProposalType,
98
+ };
99
+ }
100
+ toWeb3Gw() {
101
+ const amino = this.toAmino();
102
+ const { value } = amino;
103
+ const messageWithProposalType = {
104
+ ...value,
105
+ content: {
106
+ '@type': '/injective.exchange.v1beta1.PerpetualMarketLaunchProposal',
107
+ ...value.content.value,
108
+ },
109
+ };
110
+ return {
111
+ '@type': '/cosmos.gov.v1beta1.MsgSubmitProposal',
112
+ ...messageWithProposalType,
113
+ };
114
+ }
115
+ toEip712() {
116
+ const { params } = this;
117
+ const amino = this.toAmino();
118
+ const { value, type } = amino;
119
+ const messageAdjusted = {
120
+ ...value,
121
+ content: {
122
+ type: 'exchange/PerpetualMarketLaunchProposal',
123
+ value: {
124
+ ...value.content.value,
125
+ initial_margin_ratio: (0, numbers_js_1.amountToCosmosSdkDecAmount)(params.market.initialMarginRatio).toFixed(),
126
+ maintenance_margin_ratio: (0, numbers_js_1.amountToCosmosSdkDecAmount)(params.market.maintenanceMarginRatio).toFixed(),
127
+ maker_fee_rate: (0, numbers_js_1.amountToCosmosSdkDecAmount)(params.market.makerFeeRate).toFixed(),
128
+ taker_fee_rate: (0, numbers_js_1.amountToCosmosSdkDecAmount)(params.market.takerFeeRate).toFixed(),
129
+ min_price_tick_size: (0, numbers_js_1.amountToCosmosSdkDecAmount)(params.market.minPriceTickSize).toFixed(),
130
+ min_notional: (0, numbers_js_1.amountToCosmosSdkDecAmount)(params.market.minNotional).toFixed(),
131
+ min_quantity_tick_size: (0, numbers_js_1.amountToCosmosSdkDecAmount)(params.market.minQuantityTickSize).toFixed(),
132
+ reduce_margin_ratio: (0, numbers_js_1.amountToCosmosSdkDecAmount)(params.market.reduceMarginRatio).toFixed(),
133
+ },
134
+ },
135
+ };
136
+ return {
137
+ type,
138
+ value: messageAdjusted,
139
+ };
140
+ }
141
+ toEip712V2() {
142
+ const { params } = this;
143
+ const web3gw = this.toWeb3Gw();
144
+ const content = web3gw.content;
145
+ const messageAdjusted = {
146
+ ...web3gw,
147
+ content: {
148
+ ...content,
149
+ oracle_type: core_proto_ts_1.InjectiveOracleV1Beta1Oracle.oracleTypeToJSON(content.oracle_type),
150
+ initial_margin_ratio: (0, numbers_js_1.numberToCosmosSdkDecString)(params.market.initialMarginRatio),
151
+ maintenance_margin_ratio: (0, numbers_js_1.numberToCosmosSdkDecString)(params.market.maintenanceMarginRatio),
152
+ maker_fee_rate: (0, numbers_js_1.numberToCosmosSdkDecString)(params.market.makerFeeRate),
153
+ taker_fee_rate: (0, numbers_js_1.numberToCosmosSdkDecString)(params.market.takerFeeRate),
154
+ min_price_tick_size: (0, numbers_js_1.numberToCosmosSdkDecString)(params.market.minPriceTickSize),
155
+ min_notional: (0, numbers_js_1.numberToCosmosSdkDecString)(params.market.minNotional),
156
+ min_quantity_tick_size: (0, numbers_js_1.numberToCosmosSdkDecString)(params.market.minQuantityTickSize),
157
+ admin_info: content.admin_info || null,
158
+ reduce_margin_ratio: (0, numbers_js_1.numberToCosmosSdkDecString)(params.market.reduceMarginRatio),
159
+ },
160
+ };
161
+ return messageAdjusted;
162
+ }
163
+ toDirectSign() {
164
+ const proto = this.toProto();
165
+ return {
166
+ type: '/cosmos.gov.v1beta1.MsgSubmitProposal',
167
+ message: proto,
168
+ };
169
+ }
170
+ toBinary() {
171
+ return core_proto_ts_1.CosmosGovV1Beta1Tx.MsgSubmitProposal.encode(this.toProto()).finish();
172
+ }
173
+ }
174
+ exports.default = MsgSubmitProposalPerpetualMarketLaunchV2;
@@ -1,5 +1,5 @@
1
1
  import { MsgBase } from '../../MsgBase.js';
2
- import { CosmosBaseV1Beta1Coin, InjectivePeggyV1Beta1Msgs } from '@injectivelabs/core-proto-ts';
2
+ import { InjectivePeggyV1Msgs, CosmosBaseV1Beta1Coin } from '@injectivelabs/core-proto-ts';
3
3
  export declare namespace MsgSendToEth {
4
4
  interface Params {
5
5
  amount: {
@@ -13,14 +13,14 @@ export declare namespace MsgSendToEth {
13
13
  address: string;
14
14
  injectiveAddress: string;
15
15
  }
16
- type Proto = InjectivePeggyV1Beta1Msgs.MsgSendToEth;
16
+ type Proto = InjectivePeggyV1Msgs.MsgSendToEth;
17
17
  }
18
18
  /**
19
19
  * @category Messages
20
20
  */
21
21
  export default class MsgSendToEth extends MsgBase<MsgSendToEth.Params, MsgSendToEth.Proto> {
22
22
  static fromJSON(params: MsgSendToEth.Params): MsgSendToEth;
23
- toProto(): InjectivePeggyV1Beta1Msgs.MsgSendToEth;
23
+ toProto(): InjectivePeggyV1Msgs.MsgSendToEth;
24
24
  toData(): {
25
25
  sender: string;
26
26
  ethDest: string;
@@ -46,7 +46,7 @@ export default class MsgSendToEth extends MsgBase<MsgSendToEth.Params, MsgSendTo
46
46
  };
47
47
  toDirectSign(): {
48
48
  type: string;
49
- message: InjectivePeggyV1Beta1Msgs.MsgSendToEth;
49
+ message: InjectivePeggyV1Msgs.MsgSendToEth;
50
50
  };
51
51
  toBinary(): Uint8Array;
52
52
  }
@@ -26,12 +26,12 @@ class MsgSendToEth extends MsgBase_js_1.MsgBase {
26
26
  bridgeFee.amount = params.bridgeFee
27
27
  ? params.bridgeFee.amount
28
28
  : utils_1.DEFAULT_BRIDGE_FEE_AMOUNT;
29
- const message = core_proto_ts_1.InjectivePeggyV1Beta1Msgs.MsgSendToEth.create();
29
+ const message = core_proto_ts_1.InjectivePeggyV1Msgs.MsgSendToEth.create();
30
30
  message.sender = params.injectiveAddress;
31
31
  message.ethDest = params.address;
32
32
  message.amount = coinAmount;
33
33
  message.bridgeFee = bridgeFee;
34
- return core_proto_ts_1.InjectivePeggyV1Beta1Msgs.MsgSendToEth.fromPartial(message);
34
+ return core_proto_ts_1.InjectivePeggyV1Msgs.MsgSendToEth.fromPartial(message);
35
35
  }
36
36
  toData() {
37
37
  const proto = this.toProto();
@@ -66,7 +66,7 @@ class MsgSendToEth extends MsgBase_js_1.MsgBase {
66
66
  };
67
67
  }
68
68
  toBinary() {
69
- return core_proto_ts_1.InjectivePeggyV1Beta1Msgs.MsgSendToEth.encode(this.toProto()).finish();
69
+ return core_proto_ts_1.InjectivePeggyV1Msgs.MsgSendToEth.encode(this.toProto()).finish();
70
70
  }
71
71
  }
72
72
  exports.default = MsgSendToEth;
@@ -53,6 +53,7 @@ export default class MsgExecuteContract extends MsgBase<MsgExecuteContract.Param
53
53
  msg: any;
54
54
  '@type': string;
55
55
  };
56
+ toEip712(): never;
56
57
  toDirectSign(): {
57
58
  type: string;
58
59
  message: CosmwasmWasmV1Tx.MsgExecuteContract;