@injectivelabs/sdk-ts 1.16.38-alpha.7 → 1.16.39-alpha.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (111) hide show
  1. package/dist/cjs/{AbacusGrpcApi-CPcvHSGO.cjs → AbacusGrpcApi-vcp-9fNL.cjs} +3 -4
  2. package/dist/cjs/{BaseGrpcConsumer-DMQaqFSp.cjs → BaseGrpcConsumer-DUwCngI6.cjs} +3 -5
  3. package/dist/cjs/{BaseIndexerGrpcConsumer-D59AAC32.cjs → BaseIndexerGrpcConsumer-BGLVnJtw.cjs} +1 -1
  4. package/dist/cjs/{BaseRestConsumer-BMg5WJUs.cjs → BaseRestConsumer-uSzCOit7.cjs} +1 -1
  5. package/dist/cjs/{ChainGrpcExchangeApi-DCsRisj6.cjs → ChainGrpcExchangeApi-BtyGj9nz.cjs} +5 -6
  6. package/dist/cjs/{ChainRestTendermintApi-BNs_2vnk.cjs → ChainRestTendermintApi-QfW64O3w.cjs} +5 -7
  7. package/dist/cjs/DirectEthSecp256k1Wallet-Ce0XprB8.cjs +504 -0
  8. package/dist/cjs/{ExecArgNeptuneWithdraw-BYsr_YZS.cjs → ExecArgNeptuneWithdraw-CeuqrSTj.cjs} +4 -5
  9. package/dist/cjs/{IndexerGrpcAccountPortfolioStream-CSMprkAY.cjs → IndexerGrpcAccountPortfolioStream-DeTA0ie2.cjs} +8 -42
  10. package/dist/cjs/{IndexerGrpcWeb3GwApi-BIr3Hwbi.cjs → IndexerGrpcWeb3GwApi-DqzAO5JM.cjs} +4 -6
  11. package/dist/cjs/{MsgBase-j6d43xmd.cjs → MsgBase-C8myBIBt.cjs} +2 -3
  12. package/dist/cjs/{MsgSetDenomMetadata-DuFDjHeL.cjs → MsgSetDenomMetadata-CUjKWcyf.cjs} +7 -10
  13. package/dist/cjs/{OLPGrpcApi-Djaxxijy.cjs → OLPGrpcApi-B9O9HcGv.cjs} +4 -5
  14. package/dist/cjs/{QueryTradingStrategyContractTotalStrategies-DyWBDiyP.cjs → QueryTradingStrategyContractTotalStrategies-1RXrn_In.cjs} +5 -7
  15. package/dist/cjs/{accounts-unRk4c29.cjs → accounts-B_5cqteA.cjs} +4 -8
  16. package/dist/cjs/{chain-BS877U9C.cjs → chain--FmH8auB.cjs} +7 -25
  17. package/dist/cjs/{chunk-Bpp2L4Dg.cjs → chunk-CbDLau6x.cjs} +0 -18
  18. package/dist/cjs/client/abacus.cjs +4 -4
  19. package/dist/cjs/client/chain.cjs +10 -10
  20. package/dist/cjs/client/chain.d.cts +4 -4
  21. package/dist/cjs/client/indexer.cjs +10 -10
  22. package/dist/cjs/client/indexer.d.cts +4 -4
  23. package/dist/cjs/client/olp.cjs +6 -6
  24. package/dist/cjs/client/wasm.cjs +12 -12
  25. package/dist/cjs/client/wasm.d.cts +1 -1
  26. package/dist/cjs/core/accounts.cjs +6 -6
  27. package/dist/cjs/core/accounts.d.cts +4 -4
  28. package/dist/cjs/core/modules.cjs +15 -15
  29. package/dist/cjs/core/modules.d.cts +4 -4
  30. package/dist/cjs/core/tx.cjs +13 -13
  31. package/dist/cjs/core/tx.d.cts +4 -4
  32. package/dist/cjs/cosmjs.cjs +13 -13
  33. package/dist/cjs/cosmjs.d.cts +1 -1
  34. package/dist/{esm/defineProperty-CzruKsm2.js → cjs/defineProperty-dyr5BsvG.cjs} +6 -13
  35. package/dist/cjs/exports.cjs +13 -13
  36. package/dist/cjs/exports.d.cts +1 -1
  37. package/dist/cjs/{grpc-C-7x6cuW.cjs → grpc-DQDVCGpY.cjs} +1 -1
  38. package/dist/cjs/{index-BgXYeCfD.d.cts → index-CgmCr8ts.d.cts} +73 -14
  39. package/dist/cjs/{index-BGwhqu5I.d.cts → index-D9dYfMKB.d.cts} +1 -1
  40. package/dist/cjs/{index-DBSaWTuH.d.cts → index-DTUuHT6M.d.cts} +12 -2
  41. package/dist/cjs/{index-DKC9clt6.d.cts → index-I5Egqq5b.d.cts} +1 -0
  42. package/dist/cjs/index-TIXd2pQW.d.cts +526 -0
  43. package/dist/cjs/index.cjs +23 -23
  44. package/dist/cjs/index.d.cts +4 -4
  45. package/dist/cjs/{service-hzR-hYHw.cjs → service-BsjIvzFh.cjs} +4 -7
  46. package/dist/cjs/service.cjs +6 -6
  47. package/dist/cjs/service.d.cts +2 -2
  48. package/dist/cjs/{time-1Q64wfFC.cjs → time-B4xLc27Y.cjs} +1 -1
  49. package/dist/cjs/{tx-BZY30pZm.cjs → tx-DJElgXtF.cjs} +7 -10
  50. package/dist/cjs/{types-BFutgyx8.cjs → types-NFV4P_J_.cjs} +1 -1
  51. package/dist/cjs/types.cjs +1 -1
  52. package/dist/cjs/types.d.cts +1 -1
  53. package/dist/cjs/{utils-ifRmri1e.cjs → utils-WpVZ-fdd.cjs} +1 -1
  54. package/dist/cjs/utils.cjs +4 -4
  55. package/dist/cjs/utils.d.cts +4 -4
  56. package/dist/esm/{AbacusGrpcApi-xNyiCXjn.js → AbacusGrpcApi-CXaVHTrN.js} +2 -3
  57. package/dist/esm/{BaseGrpcConsumer-Cc5ezIfr.js → BaseGrpcConsumer-DptVGP0n.js} +1 -3
  58. package/dist/esm/{BaseIndexerGrpcConsumer-DjtGs0W8.js → BaseIndexerGrpcConsumer-CjpUoGXy.js} +1 -1
  59. package/dist/esm/{ChainGrpcExchangeApi-D4Uybyiz.js → ChainGrpcExchangeApi-C2PzFFLo.js} +3 -4
  60. package/dist/esm/{ChainRestTendermintApi-C5cofYkP.js → ChainRestTendermintApi-iWnboboL.js} +2 -4
  61. package/dist/esm/DirectEthSecp256k1Wallet-CAfZOLTr.js +464 -0
  62. package/dist/esm/{ExecArgNeptuneWithdraw-BkCZWOME.js → ExecArgNeptuneWithdraw-DXyxip5k.js} +2 -3
  63. package/dist/esm/{IndexerGrpcAccountPortfolioStream-CgLdGwa5.js → IndexerGrpcAccountPortfolioStream-CxK8ZbH1.js} +4 -38
  64. package/dist/esm/{IndexerGrpcWeb3GwApi-qVGnoMy6.js → IndexerGrpcWeb3GwApi-C82holuJ.js} +2 -4
  65. package/dist/esm/{MsgBase-OGamT6XJ.js → MsgBase-ClDEgNaE.js} +1 -2
  66. package/dist/esm/{MsgSetDenomMetadata-B1HVd_O6.js → MsgSetDenomMetadata-CLNfOkCX.js} +5 -8
  67. package/dist/esm/{OLPGrpcApi-D0pJmL9i.js → OLPGrpcApi-CMwW7LXZ.js} +2 -3
  68. package/dist/esm/{QueryTradingStrategyContractTotalStrategies-RUxBNDn9.js → QueryTradingStrategyContractTotalStrategies-DX7c1RNU.js} +3 -5
  69. package/dist/esm/{accounts-D1GN74dn.js → accounts-CndkvfI1.js} +2 -6
  70. package/dist/esm/{chain-KF8t0C7n.js → chain-B93GTjUS.js} +3 -21
  71. package/dist/esm/client/abacus.js +3 -3
  72. package/dist/esm/client/chain.d.ts +6 -6
  73. package/dist/esm/client/chain.js +5 -5
  74. package/dist/esm/client/indexer.d.ts +6 -6
  75. package/dist/esm/client/indexer.js +5 -5
  76. package/dist/esm/client/olp.d.ts +1 -1
  77. package/dist/esm/client/olp.js +4 -4
  78. package/dist/esm/client/wasm.d.ts +1 -1
  79. package/dist/esm/client/wasm.js +8 -8
  80. package/dist/esm/core/accounts.d.ts +6 -6
  81. package/dist/esm/core/accounts.js +3 -3
  82. package/dist/esm/core/modules.d.ts +6 -6
  83. package/dist/esm/core/modules.js +11 -11
  84. package/dist/esm/core/tx.d.ts +6 -6
  85. package/dist/esm/core/tx.js +8 -8
  86. package/dist/esm/cosmjs.d.ts +2 -2
  87. package/dist/esm/cosmjs.js +9 -9
  88. package/dist/{cjs/defineProperty-BBcqvqIZ.cjs → esm/defineProperty-Bq6QU9Te.js} +1 -25
  89. package/dist/esm/exports.d.ts +2 -2
  90. package/dist/esm/exports.js +9 -9
  91. package/dist/esm/index-C2F9Arg9.d.ts +526 -0
  92. package/dist/esm/{index-DuQlC04N.d.ts → index-C6PuHZrB.d.ts} +1 -1
  93. package/dist/esm/{index-BAic4N_T.d.ts → index-CLxGUZEa.d.ts} +2 -1
  94. package/dist/esm/{index-6KuoWIQi.d.ts → index-CYZ4x_PW.d.ts} +14 -4
  95. package/dist/esm/{index-CFKPZxyQ.d.ts → index-wEDEFq5T.d.ts} +73 -14
  96. package/dist/esm/index.d.ts +6 -6
  97. package/dist/esm/index.js +17 -17
  98. package/dist/esm/{service-sskHnG4H.js → service-DsZ0vnDP.js} +1 -4
  99. package/dist/esm/service.d.ts +3 -3
  100. package/dist/esm/service.js +2 -2
  101. package/dist/esm/{tx-DoH3xC6B.js → tx-Ln3qU9h6.js} +5 -8
  102. package/dist/esm/{tx_pb-Tstq-hDa.d.ts → tx_pb-CkNP6PO3.d.ts} +3 -0
  103. package/dist/esm/types.d.ts +2 -2
  104. package/dist/esm/utils.d.ts +6 -6
  105. package/package.json +9 -9
  106. package/dist/cjs/DirectEthSecp256k1Wallet-Bl3o9Ar1.cjs +0 -19812
  107. package/dist/cjs/index-DclOPTKO.d.cts +0 -2907
  108. package/dist/esm/DirectEthSecp256k1Wallet-BshqoubF.js +0 -14280
  109. package/dist/esm/chunk-rbzn7kCS.js +0 -29
  110. package/dist/esm/index-CfLw0RYb.d.ts +0 -2907
  111. /package/dist/esm/{index-BX4aeJ6-.d.ts → index-DVu6y-o5.d.ts} +0 -0
@@ -1,6 +1,6 @@
1
- const require_chunk = require('./chunk-Bpp2L4Dg.cjs');
2
- const require_defineProperty = require('./defineProperty-BBcqvqIZ.cjs');
3
- const require_BaseGrpcConsumer = require('./BaseGrpcConsumer-DMQaqFSp.cjs');
1
+ const require_chunk = require('./chunk-CbDLau6x.cjs');
2
+ const require_defineProperty = require('./defineProperty-dyr5BsvG.cjs');
3
+ const require_BaseGrpcConsumer = require('./BaseGrpcConsumer-DUwCngI6.cjs');
4
4
  let __injectivelabs_exceptions = require("@injectivelabs/exceptions");
5
5
  let __injectivelabs_abacus_proto_ts_v2_generated_points_svc_pb = require("@injectivelabs/abacus-proto-ts-v2/generated/points_svc_pb");
6
6
  __injectivelabs_abacus_proto_ts_v2_generated_points_svc_pb = require_chunk.__toESM(__injectivelabs_abacus_proto_ts_v2_generated_points_svc_pb);
@@ -41,7 +41,6 @@ var AbacusGrpcTransformer = class {
41
41
 
42
42
  //#endregion
43
43
  //#region src/client/abacus/grpc/AbacusGrpcApi.ts
44
- require_defineProperty.init_defineProperty();
45
44
  var AbacusGrpcApi = class extends require_BaseGrpcConsumer.BaseGrpcConsumer {
46
45
  constructor(endpoint) {
47
46
  super(endpoint);
@@ -1,11 +1,10 @@
1
- const require_chunk = require('./chunk-Bpp2L4Dg.cjs');
2
- const require_defineProperty = require('./defineProperty-BBcqvqIZ.cjs');
3
- const require_grpc = require('./grpc-C-7x6cuW.cjs');
1
+ const require_chunk = require('./chunk-CbDLau6x.cjs');
2
+ const require_defineProperty = require('./defineProperty-dyr5BsvG.cjs');
3
+ const require_grpc = require('./grpc-DQDVCGpY.cjs');
4
4
  let __injectivelabs_exceptions = require("@injectivelabs/exceptions");
5
5
  let __protobuf_ts_runtime_rpc = require("@protobuf-ts/runtime-rpc");
6
6
 
7
7
  //#region src/client/base/GrpcWebRpcTransport.ts
8
- require_defineProperty.init_defineProperty();
9
8
  /**
10
9
  * GrpcWebRpcTransport provides a simple wrapper around GrpcWebFetchTransport
11
10
  * from @protobuf-ts/grpcweb-transport for use with protobuf-ts generated clients.
@@ -36,7 +35,6 @@ var GrpcWebRpcTransport = class {
36
35
 
37
36
  //#endregion
38
37
  //#region src/client/base/BaseGrpcConsumer.ts
39
- require_defineProperty.init_defineProperty();
40
38
  /**
41
39
  * BaseGrpcConsumer provides base functionality for all gRPC consumers.
42
40
  * It uses the GrpcWebRpcTransport with GrpcWebFetchTransport from @protobuf-ts/grpcweb-transport.
@@ -1,4 +1,4 @@
1
- const require_BaseGrpcConsumer = require('./BaseGrpcConsumer-DMQaqFSp.cjs');
1
+ const require_BaseGrpcConsumer = require('./BaseGrpcConsumer-DUwCngI6.cjs');
2
2
 
3
3
  //#region src/client/base/BaseIndexerGrpcConsumer.ts
4
4
  /**
@@ -1,4 +1,4 @@
1
- const require_chunk = require('./chunk-Bpp2L4Dg.cjs');
1
+ const require_chunk = require('./chunk-CbDLau6x.cjs');
2
2
  let __injectivelabs_utils = require("@injectivelabs/utils");
3
3
 
4
4
  //#region src/client/base/BaseRestConsumer.ts
@@ -1,8 +1,8 @@
1
- const require_chunk = require('./chunk-Bpp2L4Dg.cjs');
2
- const require_utils = require('./utils-ifRmri1e.cjs');
3
- const require_defineProperty = require('./defineProperty-BBcqvqIZ.cjs');
4
- const require_ChainRestTendermintApi = require('./ChainRestTendermintApi-BNs_2vnk.cjs');
5
- const require_BaseGrpcConsumer = require('./BaseGrpcConsumer-DMQaqFSp.cjs');
1
+ const require_chunk = require('./chunk-CbDLau6x.cjs');
2
+ const require_utils = require('./utils-WpVZ-fdd.cjs');
3
+ const require_defineProperty = require('./defineProperty-dyr5BsvG.cjs');
4
+ const require_ChainRestTendermintApi = require('./ChainRestTendermintApi-QfW64O3w.cjs');
5
+ const require_BaseGrpcConsumer = require('./BaseGrpcConsumer-DUwCngI6.cjs');
6
6
  let __injectivelabs_utils = require("@injectivelabs/utils");
7
7
  let __injectivelabs_core_proto_ts_v2_generated_injective_exchange_v1beta1_query_pb = require("@injectivelabs/core-proto-ts-v2/generated/injective/exchange/v1beta1/query_pb");
8
8
  __injectivelabs_core_proto_ts_v2_generated_injective_exchange_v1beta1_query_pb = require_chunk.__toESM(__injectivelabs_core_proto_ts_v2_generated_injective_exchange_v1beta1_query_pb);
@@ -256,7 +256,6 @@ var ChainGrpcExchangeTransformer = class ChainGrpcExchangeTransformer {
256
256
 
257
257
  //#endregion
258
258
  //#region src/client/chain/grpc/ChainGrpcExchangeApi.ts
259
- require_defineProperty.init_defineProperty();
260
259
  /**
261
260
  * @category Chain Grpc API
262
261
  */
@@ -1,8 +1,8 @@
1
- const require_chunk = require('./chunk-Bpp2L4Dg.cjs');
2
- const require_utils = require('./utils-ifRmri1e.cjs');
3
- const require_defineProperty = require('./defineProperty-BBcqvqIZ.cjs');
4
- const require_BaseGrpcConsumer = require('./BaseGrpcConsumer-DMQaqFSp.cjs');
5
- const require_BaseRestConsumer = require('./BaseRestConsumer-BMg5WJUs.cjs');
1
+ const require_chunk = require('./chunk-CbDLau6x.cjs');
2
+ const require_utils = require('./utils-WpVZ-fdd.cjs');
3
+ const require_defineProperty = require('./defineProperty-dyr5BsvG.cjs');
4
+ const require_BaseGrpcConsumer = require('./BaseGrpcConsumer-DUwCngI6.cjs');
5
+ const require_BaseRestConsumer = require('./BaseRestConsumer-uSzCOit7.cjs');
6
6
  let __injectivelabs_exceptions = require("@injectivelabs/exceptions");
7
7
  let __injectivelabs_core_proto_ts_v2_generated_injective_crypto_v1beta1_ethsecp256k1_keys_pb = require("@injectivelabs/core-proto-ts-v2/generated/injective/crypto/v1beta1/ethsecp256k1/keys_pb");
8
8
  __injectivelabs_core_proto_ts_v2_generated_injective_crypto_v1beta1_ethsecp256k1_keys_pb = require_chunk.__toESM(__injectivelabs_core_proto_ts_v2_generated_injective_crypto_v1beta1_ethsecp256k1_keys_pb);
@@ -104,7 +104,6 @@ var ChainGrpcAuthTransformer = class ChainGrpcAuthTransformer {
104
104
 
105
105
  //#endregion
106
106
  //#region src/client/chain/grpc/ChainGrpcAuthApi.ts
107
- require_defineProperty.init_defineProperty();
108
107
  /**
109
108
  * @category Chain Grpc API
110
109
  */
@@ -137,7 +136,6 @@ var ChainGrpcAuthApi = class extends require_BaseGrpcConsumer.BaseGrpcConsumer {
137
136
 
138
137
  //#endregion
139
138
  //#region src/client/chain/grpc/ChainGrpcTendermintApi.ts
140
- require_defineProperty.init_defineProperty();
141
139
  /**
142
140
  * @category Chain Grpc API
143
141
  */
@@ -0,0 +1,504 @@
1
+ const require_chunk = require('./chunk-CbDLau6x.cjs');
2
+ const require_utils = require('./utils-WpVZ-fdd.cjs');
3
+ const require_defineProperty = require('./defineProperty-dyr5BsvG.cjs');
4
+ const require_accounts = require('./accounts-B_5cqteA.cjs');
5
+ let __injectivelabs_core_proto_ts_v2_generated_cosmos_base_v1beta1_coin_pb = require("@injectivelabs/core-proto-ts-v2/generated/cosmos/base/v1beta1/coin_pb");
6
+ __injectivelabs_core_proto_ts_v2_generated_cosmos_base_v1beta1_coin_pb = require_chunk.__toESM(__injectivelabs_core_proto_ts_v2_generated_cosmos_base_v1beta1_coin_pb);
7
+ let __injectivelabs_core_proto_ts_v2_generated_injective_types_v1beta1_account_pb = require("@injectivelabs/core-proto-ts-v2/generated/injective/types/v1beta1/account_pb");
8
+ __injectivelabs_core_proto_ts_v2_generated_injective_types_v1beta1_account_pb = require_chunk.__toESM(__injectivelabs_core_proto_ts_v2_generated_injective_types_v1beta1_account_pb);
9
+ let __injectivelabs_core_proto_ts_v2_generated_ibc_core_client_v1_client_pb = require("@injectivelabs/core-proto-ts-v2/generated/ibc/core/client/v1/client_pb");
10
+ __injectivelabs_core_proto_ts_v2_generated_ibc_core_client_v1_client_pb = require_chunk.__toESM(__injectivelabs_core_proto_ts_v2_generated_ibc_core_client_v1_client_pb);
11
+ let __injectivelabs_core_proto_ts_v2_generated_ibc_applications_transfer_v1_tx_pb = require("@injectivelabs/core-proto-ts-v2/generated/ibc/applications/transfer/v1/tx_pb");
12
+ __injectivelabs_core_proto_ts_v2_generated_ibc_applications_transfer_v1_tx_pb = require_chunk.__toESM(__injectivelabs_core_proto_ts_v2_generated_ibc_applications_transfer_v1_tx_pb);
13
+ let cosmjs_types_ibc_applications_transfer_v1_tx = require("cosmjs-types/ibc/applications/transfer/v1/tx");
14
+ let __cosmjs_stargate = require("@cosmjs/stargate");
15
+ let __cosmjs_math = require("@cosmjs/math");
16
+ let __cosmjs_utils = require("@cosmjs/utils");
17
+ let cosmjs_types_cosmos_tx_v1beta1_tx = require("cosmjs-types/cosmos/tx/v1beta1/tx");
18
+ let __cosmjs_tendermint_rpc = require("@cosmjs/tendermint-rpc");
19
+ let cosmjs_types_cosmos_tx_signing_v1beta1_signing = require("cosmjs-types/cosmos/tx/signing/v1beta1/signing");
20
+ let cosmjs_types_cosmos_distribution_v1beta1_tx = require("cosmjs-types/cosmos/distribution/v1beta1/tx");
21
+ let cosmjs_types_cosmos_staking_v1beta1_tx = require("cosmjs-types/cosmos/staking/v1beta1/tx");
22
+ let __cosmjs_amino = require("@cosmjs/amino");
23
+ let __cosmjs_proto_signing = require("@cosmjs/proto-signing");
24
+
25
+ //#region src/core/modules/ibc/msgs/MsgTransferCosmjs.ts
26
+ /**
27
+ * @category Messages
28
+ *
29
+ * @deprecated use MsgTransfer with SIGN_DIRECT and a Cosmos wallet
30
+ */
31
+ var MsgTransferCosmjs = class MsgTransferCosmjs {
32
+ constructor(params) {
33
+ require_defineProperty._defineProperty(this, "params", void 0);
34
+ this.params = params;
35
+ }
36
+ static fromJSON(params) {
37
+ return new MsgTransferCosmjs(params);
38
+ }
39
+ toProto() {
40
+ const { params } = this;
41
+ const token = __injectivelabs_core_proto_ts_v2_generated_cosmos_base_v1beta1_coin_pb.Coin.create({
42
+ denom: params.amount.denom,
43
+ amount: params.amount.amount
44
+ });
45
+ const message = __injectivelabs_core_proto_ts_v2_generated_ibc_applications_transfer_v1_tx_pb.MsgTransfer.create({
46
+ sourcePort: params.port,
47
+ sourceChannel: params.channelId,
48
+ token,
49
+ sender: params.sender,
50
+ receiver: params.receiver
51
+ });
52
+ if (params.height) message.timeoutHeight = __injectivelabs_core_proto_ts_v2_generated_ibc_core_client_v1_client_pb.Height.create({
53
+ revisionHeight: BigInt(params.height.revisionHeight),
54
+ revisionNumber: BigInt(params.height.revisionNumber)
55
+ });
56
+ if (params.timeout) message.timeoutTimestamp = BigInt(params.timeout);
57
+ return cosmjs_types_ibc_applications_transfer_v1_tx.MsgTransfer.fromPartial({
58
+ sourcePort: message.sourcePort,
59
+ sourceChannel: message.sourceChannel,
60
+ token: message.token,
61
+ sender: message.sender,
62
+ receiver: message.receiver,
63
+ timeoutHeight: message.timeoutHeight ? {
64
+ revisionHeight: message.timeoutHeight.revisionHeight,
65
+ revisionNumber: message.timeoutHeight.revisionNumber
66
+ } : void 0,
67
+ timeoutTimestamp: message.timeoutTimestamp
68
+ });
69
+ }
70
+ toData() {
71
+ throw new Error("Method not implemented.");
72
+ }
73
+ toAmino() {
74
+ const { params } = this;
75
+ const message = cosmjs_types_ibc_applications_transfer_v1_tx.MsgTransfer.fromPartial({
76
+ sourcePort: params.port,
77
+ sourceChannel: params.channelId,
78
+ sender: params.sender,
79
+ receiver: params.receiver,
80
+ token: params.amount,
81
+ timeoutHeight: params.height ? {
82
+ revisionHeight: BigInt(params.height.revisionHeight),
83
+ revisionNumber: BigInt(params.height.revisionNumber)
84
+ } : void 0,
85
+ timeoutTimestamp: params.timeout ? BigInt(params.timeout) : void 0
86
+ });
87
+ return {
88
+ type: "/ibc.applications.transfer.v1.MsgTransfer",
89
+ value: {
90
+ ...message,
91
+ timeoutHeight: message.timeoutHeight ? {
92
+ revisionHeight: message.timeoutHeight.revisionHeight.toString(),
93
+ revisionNumber: message.timeoutHeight.revisionNumber.toString()
94
+ } : void 0,
95
+ timeoutTimestamp: message.timeoutTimestamp ? message.timeoutTimestamp.toString() : void 0
96
+ }
97
+ };
98
+ }
99
+ toWeb3Gw() {
100
+ const { value } = this.toAmino();
101
+ return {
102
+ "@type": "/ibc.applications.transfer.v1.MsgTransfer",
103
+ ...value
104
+ };
105
+ }
106
+ toDirectSign() {
107
+ return {
108
+ type: "/ibc.applications.transfer.v1.MsgTransfer",
109
+ message: this.toProto()
110
+ };
111
+ }
112
+ toBinary() {
113
+ return cosmjs_types_ibc_applications_transfer_v1_tx.MsgTransfer.encode(this.toProto()).finish();
114
+ }
115
+ };
116
+
117
+ //#endregion
118
+ //#region src/core/accounts/AccountParser.ts
119
+ const accountParser = (ethAccount) => {
120
+ const baseAccount = __injectivelabs_core_proto_ts_v2_generated_injective_types_v1beta1_account_pb.EthAccount.fromBinary(ethAccount.value).baseAccount;
121
+ const pubKey = baseAccount.pubKey;
122
+ return {
123
+ address: baseAccount.address,
124
+ pubkey: pubKey ? {
125
+ type: "/injective.crypto.v1beta1.ethsecp256k1.PubKey",
126
+ value: require_utils.uint8ArrayToBase64(pubKey.value)
127
+ } : null,
128
+ accountNumber: parseInt(baseAccount.accountNumber.toString(), 10),
129
+ sequence: parseInt(baseAccount.sequence.toString(), 10)
130
+ };
131
+ };
132
+
133
+ //#endregion
134
+ //#region src/core/stargate/StargateClient.ts
135
+ var StargateClient = class extends __cosmjs_stargate.StargateClient {
136
+ async getAccount(searchAddress) {
137
+ try {
138
+ const isInjective = (await this.getChainId()).startsWith("injective");
139
+ const account = await this.forceGetQueryClient().auth.account(searchAddress);
140
+ if (!account) return null;
141
+ if (isInjective) return accountParser(account);
142
+ return (0, __cosmjs_stargate.accountFromAny)(account);
143
+ } catch (error) {
144
+ if (/rpc error: code = NotFound/i.test(error.toString())) return null;
145
+ throw error;
146
+ }
147
+ }
148
+ };
149
+
150
+ //#endregion
151
+ //#region src/core/stargate/SigningStargateClient.ts
152
+ function createDefaultAminoConverters() {
153
+ return {
154
+ ...(0, __cosmjs_stargate.createAuthzAminoConverters)(),
155
+ ...(0, __cosmjs_stargate.createBankAminoConverters)(),
156
+ ...(0, __cosmjs_stargate.createDistributionAminoConverters)(),
157
+ ...(0, __cosmjs_stargate.createGovAminoConverters)(),
158
+ ...(0, __cosmjs_stargate.createStakingAminoConverters)(),
159
+ ...(0, __cosmjs_stargate.createIbcAminoConverters)(),
160
+ ...(0, __cosmjs_stargate.createFeegrantAminoConverters)(),
161
+ ...(0, __cosmjs_stargate.createVestingAminoConverters)()
162
+ };
163
+ }
164
+ var SigningStargateClient = class SigningStargateClient extends StargateClient {
165
+ /**
166
+ * Creates an instance by connecting to the given Tendermint RPC endpoint.
167
+ *
168
+ * For now this uses the Tendermint 0.34 client. If you need Tendermint 0.37
169
+ * support, see `createWithSigner`.
170
+ */
171
+ static async connectWithSigner(endpoint, signer, options = {}) {
172
+ const tmClient = await __cosmjs_tendermint_rpc.Tendermint37Client.connect(endpoint);
173
+ return SigningStargateClient.createWithSigner(tmClient, signer, options);
174
+ }
175
+ /**
176
+ * Creates an instance from a manually created Tendermint client.
177
+ * Use this to use `Tendermint37Client` instead of `Tendermint37Client`.
178
+ */
179
+ static async createWithSigner(tmClient, signer, options = {}) {
180
+ return new SigningStargateClient(tmClient, signer, options);
181
+ }
182
+ /**
183
+ * Creates a client in offline mode.
184
+ *
185
+ * This should only be used in niche cases where you know exactly what you're doing,
186
+ * e.g. when building an offline signing application.
187
+ *
188
+ * When you try to use online functionality with such a signer, an
189
+ * exception will be raised.
190
+ */
191
+ static async offline(signer, options = {}) {
192
+ return new SigningStargateClient(void 0, signer, options);
193
+ }
194
+ constructor(tmClient, signer, options) {
195
+ super(tmClient, options);
196
+ require_defineProperty._defineProperty(this, "registry", void 0);
197
+ require_defineProperty._defineProperty(this, "broadcastTimeoutMs", void 0);
198
+ require_defineProperty._defineProperty(this, "broadcastPollIntervalMs", void 0);
199
+ require_defineProperty._defineProperty(this, "signer", void 0);
200
+ require_defineProperty._defineProperty(this, "aminoTypes", void 0);
201
+ require_defineProperty._defineProperty(this, "gasPrice", void 0);
202
+ const { registry = new __cosmjs_proto_signing.Registry(__cosmjs_stargate.defaultRegistryTypes), aminoTypes = new __cosmjs_stargate.AminoTypes(createDefaultAminoConverters()) } = options;
203
+ this.registry = registry;
204
+ this.aminoTypes = aminoTypes;
205
+ this.signer = signer;
206
+ this.broadcastTimeoutMs = options.broadcastTimeoutMs;
207
+ this.broadcastPollIntervalMs = options.broadcastPollIntervalMs;
208
+ this.gasPrice = options.gasPrice;
209
+ }
210
+ async simulate(signerAddress, messages, memo) {
211
+ const anyMsgs = messages.map((m) => this.registry.encodeAsAny(m));
212
+ const accountFromSigner = (await this.signer.getAccounts()).find((account) => account.address === signerAddress);
213
+ if (!accountFromSigner) throw new Error("Failed to retrieve account from signer");
214
+ const pubkey = (0, __cosmjs_amino.encodeSecp256k1Pubkey)(accountFromSigner.pubkey);
215
+ const { sequence } = await this.getSequence(signerAddress);
216
+ const { gasInfo } = await this.forceGetQueryClient().tx.simulate(anyMsgs, memo, pubkey, sequence);
217
+ (0, __cosmjs_utils.assertDefined)(gasInfo);
218
+ return __cosmjs_math.Uint53.fromString(gasInfo.gasUsed.toString()).toNumber();
219
+ }
220
+ async sendTokens(senderAddress, recipientAddress, amount, fee, memo = "") {
221
+ const sendMsg = {
222
+ typeUrl: "/cosmos.bank.v1beta1.MsgSend",
223
+ value: {
224
+ fromAddress: senderAddress,
225
+ toAddress: recipientAddress,
226
+ amount: [...amount]
227
+ }
228
+ };
229
+ return this.signAndBroadcast(senderAddress, [sendMsg], fee, memo);
230
+ }
231
+ async delegateTokens(delegatorAddress, validatorAddress, amount, fee, memo = "") {
232
+ const delegateMsg = {
233
+ typeUrl: "/cosmos.staking.v1beta1.MsgDelegate",
234
+ value: cosmjs_types_cosmos_staking_v1beta1_tx.MsgDelegate.fromPartial({
235
+ delegatorAddress,
236
+ validatorAddress,
237
+ amount
238
+ })
239
+ };
240
+ return this.signAndBroadcast(delegatorAddress, [delegateMsg], fee, memo);
241
+ }
242
+ async undelegateTokens(delegatorAddress, validatorAddress, amount, fee, memo = "") {
243
+ const undelegateMsg = {
244
+ typeUrl: "/cosmos.staking.v1beta1.MsgUndelegate",
245
+ value: cosmjs_types_cosmos_staking_v1beta1_tx.MsgUndelegate.fromPartial({
246
+ delegatorAddress,
247
+ validatorAddress,
248
+ amount
249
+ })
250
+ };
251
+ return this.signAndBroadcast(delegatorAddress, [undelegateMsg], fee, memo);
252
+ }
253
+ async withdrawRewards(delegatorAddress, validatorAddress, fee, memo = "") {
254
+ const withdrawMsg = {
255
+ typeUrl: "/cosmos.distribution.v1beta1.MsgWithdrawDelegatorReward",
256
+ value: cosmjs_types_cosmos_distribution_v1beta1_tx.MsgWithdrawDelegatorReward.fromPartial({
257
+ delegatorAddress,
258
+ validatorAddress
259
+ })
260
+ };
261
+ return this.signAndBroadcast(delegatorAddress, [withdrawMsg], fee, memo);
262
+ }
263
+ async sendIbcTokens(senderAddress, recipientAddress, transferAmount, sourcePort, sourceChannel, timeoutHeight, timeoutTimestamp, fee, memo = "") {
264
+ const timeoutTimestampNanoseconds = timeoutTimestamp ? BigInt(timeoutTimestamp) * BigInt(1e9) : void 0;
265
+ const transferMsg = {
266
+ typeUrl: "/ibc.applications.transfer.v1.MsgTransfer",
267
+ value: cosmjs_types_ibc_applications_transfer_v1_tx.MsgTransfer.fromPartial({
268
+ sourcePort,
269
+ sourceChannel,
270
+ sender: senderAddress,
271
+ receiver: recipientAddress,
272
+ token: transferAmount,
273
+ timeoutHeight,
274
+ timeoutTimestamp: timeoutTimestampNanoseconds
275
+ })
276
+ };
277
+ return this.signAndBroadcast(senderAddress, [transferMsg], fee, memo);
278
+ }
279
+ async signAndBroadcast(signerAddress, messages, fee, memo = "") {
280
+ let usedFee;
281
+ if (fee == "auto" || typeof fee === "number") {
282
+ (0, __cosmjs_utils.assertDefined)(this.gasPrice, "Gas price must be set in the client options when auto gas is used.");
283
+ const gasEstimation = await this.simulate(signerAddress, messages, memo);
284
+ const multiplier = typeof fee === "number" ? fee : 1.3;
285
+ usedFee = (0, __cosmjs_stargate.calculateFee)(Math.round(gasEstimation * multiplier), this.gasPrice);
286
+ } else usedFee = fee;
287
+ const txRaw = await this.sign(signerAddress, messages, usedFee, memo);
288
+ const txBytes = cosmjs_types_cosmos_tx_v1beta1_tx.TxRaw.encode(txRaw).finish();
289
+ return this.broadcastTx(txBytes, this.broadcastTimeoutMs, this.broadcastPollIntervalMs);
290
+ }
291
+ /**
292
+ * Gets account number and sequence from the API, creates a sign doc,
293
+ * creates a single signature and assembles the signed transaction.
294
+ *
295
+ * The sign mode (SIGN_MODE_DIRECT or SIGN_MODE_LEGACY_AMINO_JSON) is determined by this client's signer.
296
+ *
297
+ * You can pass signer data (account number, sequence and chain ID) explicitly instead of querying them
298
+ * from the chain. This is needed when signing for a multisig account, but it also allows for offline signing
299
+ * (See the SigningStargateClient.offline constructor).
300
+ */
301
+ async sign(signerAddress, messages, fee, memo, explicitSignerData) {
302
+ let signerData;
303
+ if (explicitSignerData) signerData = explicitSignerData;
304
+ else {
305
+ const { accountNumber, sequence } = await this.getSequence(signerAddress);
306
+ signerData = {
307
+ accountNumber,
308
+ sequence,
309
+ chainId: await this.getChainId()
310
+ };
311
+ }
312
+ return (0, __cosmjs_proto_signing.isOfflineDirectSigner)(this.signer) ? this.signDirect(signerAddress, messages, fee, memo, signerData) : this.signAmino(signerAddress, messages, fee, memo, signerData);
313
+ }
314
+ async signAmino(signerAddress, messages, fee, memo, { accountNumber, sequence, chainId }) {
315
+ (0, __cosmjs_utils.assert)(!(0, __cosmjs_proto_signing.isOfflineDirectSigner)(this.signer));
316
+ const accountFromSigner = (await this.signer.getAccounts()).find((account) => account.address === signerAddress);
317
+ if (!accountFromSigner) throw new Error("Failed to retrieve account from signer");
318
+ const pubkey = chainId.startsWith("injective") ? require_accounts.getPublicKey({
319
+ chainId,
320
+ key: require_utils.uint8ArrayToBase64(accountFromSigner.pubkey)
321
+ }) : (0, __cosmjs_proto_signing.encodePubkey)((0, __cosmjs_amino.encodeSecp256k1Pubkey)(accountFromSigner.pubkey));
322
+ const signMode = cosmjs_types_cosmos_tx_signing_v1beta1_signing.SignMode.SIGN_MODE_LEGACY_AMINO_JSON;
323
+ const signDoc = (0, __cosmjs_amino.makeSignDoc)(messages.map((msg) => this.aminoTypes.toAmino(msg)), fee, chainId, memo, accountNumber, sequence);
324
+ const { signature, signed } = await this.signer.signAmino(signerAddress, signDoc);
325
+ const signedTxBodyEncodeObject = {
326
+ typeUrl: "/cosmos.tx.v1beta1.TxBody",
327
+ value: {
328
+ messages: signed.msgs.map((msg) => this.aminoTypes.fromAmino(msg)),
329
+ memo: signed.memo
330
+ }
331
+ };
332
+ const signedTxBodyBytes = this.registry.encode(signedTxBodyEncodeObject);
333
+ const signedGasLimit = __cosmjs_math.Int53.fromString(signed.fee.gas).toNumber();
334
+ const signedAuthInfoBytes = (0, __cosmjs_proto_signing.makeAuthInfoBytes)([{
335
+ pubkey,
336
+ sequence: __cosmjs_math.Int53.fromString(signed.sequence).toNumber()
337
+ }], signed.fee.amount, signedGasLimit, signed.fee.granter, signed.fee.payer, signMode);
338
+ return cosmjs_types_cosmos_tx_v1beta1_tx.TxRaw.fromPartial({
339
+ bodyBytes: signedTxBodyBytes,
340
+ authInfoBytes: signedAuthInfoBytes,
341
+ signatures: [require_utils.base64ToUint8Array(signature.signature)]
342
+ });
343
+ }
344
+ async signDirect(signerAddress, messages, fee, memo, { accountNumber, sequence, chainId }) {
345
+ (0, __cosmjs_utils.assert)((0, __cosmjs_proto_signing.isOfflineDirectSigner)(this.signer));
346
+ const accountFromSigner = (await this.signer.getAccounts()).find((account) => account.address === signerAddress);
347
+ if (!accountFromSigner) throw new Error("Failed to retrieve account from signer");
348
+ const pubkey = chainId.startsWith("injective") ? require_accounts.getPublicKey({
349
+ chainId,
350
+ key: require_utils.uint8ArrayToBase64(accountFromSigner.pubkey)
351
+ }) : (0, __cosmjs_proto_signing.encodePubkey)((0, __cosmjs_amino.encodeSecp256k1Pubkey)(accountFromSigner.pubkey));
352
+ const txBodyEncodeObject = {
353
+ typeUrl: "/cosmos.tx.v1beta1.TxBody",
354
+ value: {
355
+ messages,
356
+ memo
357
+ }
358
+ };
359
+ const txBodyBytes = this.registry.encode(txBodyEncodeObject);
360
+ const gasLimit = __cosmjs_math.Int53.fromString(fee.gas).toNumber();
361
+ const signDoc = (0, __cosmjs_proto_signing.makeSignDoc)(txBodyBytes, (0, __cosmjs_proto_signing.makeAuthInfoBytes)([{
362
+ pubkey,
363
+ sequence
364
+ }], fee.amount, gasLimit, fee.granter, fee.payer), chainId, accountNumber);
365
+ const { signature, signed } = await this.signer.signDirect(signerAddress, signDoc);
366
+ return cosmjs_types_cosmos_tx_v1beta1_tx.TxRaw.fromPartial({
367
+ bodyBytes: signed.bodyBytes,
368
+ authInfoBytes: signed.authInfoBytes,
369
+ signatures: [require_utils.base64ToUint8Array(signature.signature)]
370
+ });
371
+ }
372
+ };
373
+
374
+ //#endregion
375
+ //#region src/core/accounts/signers/EthSecp256k1Wallet.ts
376
+ var EthSecp256k1Wallet = class EthSecp256k1Wallet {
377
+ /**
378
+ * Creates a EthSecp256k1Wallet from the given private key
379
+ *
380
+ * @param privKey The private key.
381
+ * @param prefix The bech32 address prefix (human readable part). Defaults to "inj".
382
+ */
383
+ static async fromKey(privKey, prefix = "inj") {
384
+ return new EthSecp256k1Wallet(privKey, require_accounts.PrivateKey.fromHex(require_utils.uint8ArrayToHex(privKey)).toPublicKey().toPubKeyBytes(), prefix);
385
+ }
386
+ constructor(privKey, pubKey, prefix) {
387
+ require_defineProperty._defineProperty(this, "privateKey", void 0);
388
+ require_defineProperty._defineProperty(this, "publicKey", void 0);
389
+ require_defineProperty._defineProperty(this, "prefix", void 0);
390
+ this.privateKey = require_accounts.PrivateKey.fromHex(require_utils.uint8ArrayToHex(privKey));
391
+ this.publicKey = require_accounts.PublicKey.fromBytes(pubKey);
392
+ this.prefix = prefix;
393
+ }
394
+ get address() {
395
+ return this.publicKey.toAddress().toBech32(this.prefix);
396
+ }
397
+ async getAccounts() {
398
+ return [{
399
+ algo: "eth_secp256k1",
400
+ address: this.address,
401
+ pubkey: this.publicKey.toPubKeyBytes()
402
+ }];
403
+ }
404
+ async signAmino(signerAddress, signDoc) {
405
+ if (signerAddress !== this.address) throw new Error(`Address ${signerAddress} not found in wallet`);
406
+ const messageBytes = (0, __cosmjs_amino.serializeSignDoc)(signDoc);
407
+ const signature = await this.privateKey.sign(messageBytes);
408
+ return {
409
+ signed: signDoc,
410
+ signature: {
411
+ pub_key: {
412
+ type: "tendermint/PubKeyEthSecp256k1",
413
+ value: this.publicKey.toBase64()
414
+ },
415
+ signature: require_utils.uint8ArrayToBase64(signature)
416
+ }
417
+ };
418
+ }
419
+ };
420
+
421
+ //#endregion
422
+ //#region src/core/accounts/signers/DirectEthSecp256k1Wallet.ts
423
+ var DirectEthSecp256k1Wallet = class DirectEthSecp256k1Wallet {
424
+ /**
425
+ * Creates a DirectEthSecp256k1Wallet from the given private key
426
+ *
427
+ * @param privKey The private key.
428
+ * @param prefix The bech32 address prefix (human readable part). Defaults to "inj".
429
+ */
430
+ static async fromKey(privKey, prefix = "inj") {
431
+ return new DirectEthSecp256k1Wallet(privKey, require_accounts.PrivateKey.fromHex(require_utils.uint8ArrayToHex(privKey)).toPublicKey().toPubKeyBytes(), prefix);
432
+ }
433
+ constructor(privKey, pubKey, prefix) {
434
+ require_defineProperty._defineProperty(this, "privateKey", void 0);
435
+ require_defineProperty._defineProperty(this, "publicKey", void 0);
436
+ require_defineProperty._defineProperty(this, "prefix", void 0);
437
+ this.privateKey = require_accounts.PrivateKey.fromHex(require_utils.uint8ArrayToHex(privKey));
438
+ this.publicKey = require_accounts.PublicKey.fromBytes(pubKey);
439
+ this.prefix = prefix;
440
+ }
441
+ get address() {
442
+ return this.publicKey.toAddress().toBech32(this.prefix);
443
+ }
444
+ async getAccounts() {
445
+ return [{
446
+ algo: "eth_secp256k1",
447
+ address: this.address,
448
+ pubkey: this.publicKey.toPubKeyBytes()
449
+ }];
450
+ }
451
+ async signDirect(address, signDoc) {
452
+ const signBytes = (0, __cosmjs_proto_signing.makeSignBytes)(signDoc);
453
+ if (address !== this.address) throw new Error(`Address ${address} not found in wallet`);
454
+ const signature = await this.privateKey.sign(signBytes);
455
+ return {
456
+ signed: signDoc,
457
+ signature: {
458
+ pub_key: {
459
+ type: "tendermint/PubKeyEthSecp256k1",
460
+ value: this.publicKey.toBase64()
461
+ },
462
+ signature: require_utils.uint8ArrayToBase64(signature)
463
+ }
464
+ };
465
+ }
466
+ };
467
+
468
+ //#endregion
469
+ Object.defineProperty(exports, 'DirectEthSecp256k1Wallet', {
470
+ enumerable: true,
471
+ get: function () {
472
+ return DirectEthSecp256k1Wallet;
473
+ }
474
+ });
475
+ Object.defineProperty(exports, 'EthSecp256k1Wallet', {
476
+ enumerable: true,
477
+ get: function () {
478
+ return EthSecp256k1Wallet;
479
+ }
480
+ });
481
+ Object.defineProperty(exports, 'MsgTransferCosmjs', {
482
+ enumerable: true,
483
+ get: function () {
484
+ return MsgTransferCosmjs;
485
+ }
486
+ });
487
+ Object.defineProperty(exports, 'SigningStargateClient', {
488
+ enumerable: true,
489
+ get: function () {
490
+ return SigningStargateClient;
491
+ }
492
+ });
493
+ Object.defineProperty(exports, 'StargateClient', {
494
+ enumerable: true,
495
+ get: function () {
496
+ return StargateClient;
497
+ }
498
+ });
499
+ Object.defineProperty(exports, 'accountParser', {
500
+ enumerable: true,
501
+ get: function () {
502
+ return accountParser;
503
+ }
504
+ });
@@ -1,7 +1,7 @@
1
- const require_chunk = require('./chunk-Bpp2L4Dg.cjs');
2
- const require_utils = require('./utils-ifRmri1e.cjs');
3
- const require_defineProperty = require('./defineProperty-BBcqvqIZ.cjs');
4
- const require_MsgBase = require('./MsgBase-j6d43xmd.cjs');
1
+ const require_chunk = require('./chunk-CbDLau6x.cjs');
2
+ const require_utils = require('./utils-WpVZ-fdd.cjs');
3
+ const require_defineProperty = require('./defineProperty-dyr5BsvG.cjs');
4
+ const require_MsgBase = require('./MsgBase-C8myBIBt.cjs');
5
5
  let __injectivelabs_exceptions = require("@injectivelabs/exceptions");
6
6
  let snakecase_keys = require("snakecase-keys");
7
7
  snakecase_keys = require_chunk.__toESM(snakecase_keys);
@@ -9,7 +9,6 @@ let __injectivelabs_core_proto_ts_v2_generated_injective_wasmx_v1_tx_pb = requir
9
9
  __injectivelabs_core_proto_ts_v2_generated_injective_wasmx_v1_tx_pb = require_chunk.__toESM(__injectivelabs_core_proto_ts_v2_generated_injective_wasmx_v1_tx_pb);
10
10
 
11
11
  //#region src/core/modules/wasm/ExecArgBase.ts
12
- require_defineProperty.init_defineProperty();
13
12
  const dataToExecData = (action, data) => {
14
13
  return { [action]: data };
15
14
  };