@injectivelabs/sdk-ts 1.17.2-alpha.9 → 1.17.3-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 (118) hide show
  1. package/dist/cjs/{AbacusGrpcApi-vcp-9fNL.cjs → AbacusGrpcApi-ieWvx9Pk.cjs} +6 -5
  2. package/dist/cjs/BaseGrpcConsumer-TjcGQpif.d.cts +89 -0
  3. package/dist/cjs/{BaseGrpcConsumer-DUwCngI6.cjs → BaseGrpcConsumer-hNH10qOJ.cjs} +69 -9
  4. package/dist/cjs/{BaseIndexerGrpcConsumer-BGLVnJtw.cjs → BaseIndexerGrpcConsumer-E9xi3hs8.cjs} +1 -1
  5. package/dist/cjs/{ChainGrpcExchangeApi-DLpkgEyg.cjs → ChainGrpcExchangeApi-C1v-xxCh.cjs} +8 -7
  6. package/dist/cjs/{ChainRestTendermintApi-BiZOeKcG.cjs → ChainRestTendermintApi-BtxXFstT.cjs} +12 -10
  7. package/dist/cjs/{DirectEthSecp256k1Wallet-CU18lti3.cjs → DirectEthSecp256k1Wallet-CIdxvYjL.cjs} +2 -2
  8. package/dist/cjs/{ExecArgNeptuneWithdraw-DOHeo3AJ.cjs → ExecArgNeptuneWithdraw-C-NQ72VM.cjs} +1 -1
  9. package/dist/cjs/{IndexerGrpcWeb3GwApi-BgWT2tWK.cjs → IndexerGrpcWeb3GwApi-C5AlN6KV.cjs} +9 -8
  10. package/dist/cjs/{MsgSetDenomMetadata-CUoGqV8P.cjs → MsgSetDenomMetadata-BHkIa3K_.cjs} +21 -10
  11. package/dist/cjs/{OLPGrpcApi-B9O9HcGv.cjs → OLPGrpcApi-D_o2P-SZ.cjs} +6 -5
  12. package/dist/cjs/{QueryTradingStrategyContractTotalStrategies-Bh8AXm4k.cjs → QueryTradingStrategyContractTotalStrategies-DY_tydyG.cjs} +5 -5
  13. package/dist/cjs/{IndexerGrpcAccountPortfolioStream-DO5_FF4l.cjs → StreamManagerV2-BxM7w64U.cjs} +1395 -383
  14. package/dist/cjs/{accounts-CXaUasU5.cjs → accounts-CHKUxDIf.cjs} +1 -1
  15. package/dist/cjs/{chain-Cs9sNuT1.cjs → chain-C_8R5bBd.cjs} +94 -76
  16. package/dist/cjs/client/abacus.cjs +2 -2
  17. package/dist/cjs/client/abacus.d.cts +4 -2
  18. package/dist/cjs/client/chain.cjs +5 -5
  19. package/dist/cjs/client/chain.d.cts +8 -9
  20. package/dist/cjs/client/indexer.cjs +74 -60
  21. package/dist/cjs/client/indexer.d.cts +9 -10
  22. package/dist/cjs/client/olp.cjs +3 -3
  23. package/dist/cjs/client/olp.d.cts +4 -2
  24. package/dist/cjs/client/wasm.cjs +7 -7
  25. package/dist/cjs/client/wasm.d.cts +3 -2
  26. package/dist/cjs/core/accounts.cjs +2 -2
  27. package/dist/cjs/core/accounts.d.cts +8 -9
  28. package/dist/cjs/core/modules.cjs +10 -10
  29. package/dist/cjs/core/modules.d.cts +8 -9
  30. package/dist/cjs/core/tx.cjs +7 -7
  31. package/dist/cjs/core/tx.d.cts +8 -9
  32. package/dist/cjs/cosmjs.cjs +8 -8
  33. package/dist/cjs/cosmjs.d.cts +2 -3
  34. package/dist/cjs/exports.cjs +8 -8
  35. package/dist/cjs/exports.d.cts +2 -3
  36. package/dist/{esm/index-aNMYd-s0.d.ts → cjs/index-1xa-4b0j.d.cts} +5 -5
  37. package/dist/cjs/{index-Cc4mqAsR.d.cts → index-B-ODtCMF.d.cts} +7 -7
  38. package/dist/{esm/index-DdGVE3_u.d.ts → cjs/index-Btix6ZFg.d.cts} +9 -14
  39. package/dist/{esm/index-qFCOVI7n.d.ts → cjs/index-ByWM_5hr.d.cts} +2 -3
  40. package/dist/cjs/{index-1Wy-0PTh.d.cts → index-D9jzqFzT.d.cts} +1043 -459
  41. package/dist/cjs/index-Dems0piS.d.cts +4026 -0
  42. package/dist/cjs/{index-Cc5Q73-y.d.cts → index-nMOqRjvi.d.cts} +1 -1
  43. package/dist/cjs/index.cjs +92 -70
  44. package/dist/cjs/index.d.cts +9 -10
  45. package/dist/cjs/{service-DcwwCSxu.cjs → service-BCLvTVy_.cjs} +2 -2
  46. package/dist/cjs/service.cjs +3 -3
  47. package/dist/cjs/service.d.cts +3 -4
  48. package/dist/cjs/{tx-Cn0j2SRh.cjs → tx-D3CYce5M.cjs} +11 -10
  49. package/dist/cjs/{tx_pb-tECSPcSB.d.cts → tx_pb-Wr-aZfKH.d.cts} +188 -7
  50. package/dist/cjs/{types-NFV4P_J_.cjs → types-BTuy007B.cjs} +135 -7
  51. package/dist/cjs/types.cjs +7 -1
  52. package/dist/cjs/types.d.cts +3 -4
  53. package/dist/cjs/{utils-V1uXtT51.cjs → utils-CDl812vv.cjs} +44 -8
  54. package/dist/cjs/utils.cjs +3 -1
  55. package/dist/cjs/utils.d.cts +9 -10
  56. package/dist/esm/{AbacusGrpcApi-CXaVHTrN.js → AbacusGrpcApi-4J7beM6Y.js} +6 -5
  57. package/dist/esm/{BaseGrpcConsumer-DptVGP0n.js → BaseGrpcConsumer-ByL34muR.js} +70 -10
  58. package/dist/esm/BaseGrpcConsumer-CQEK92MB.d.ts +89 -0
  59. package/dist/esm/{BaseIndexerGrpcConsumer-CjpUoGXy.js → BaseIndexerGrpcConsumer-CUx8BFq4.js} +1 -1
  60. package/dist/esm/{ChainGrpcExchangeApi-C-2XsVVs.js → ChainGrpcExchangeApi-BxTTr_-W.js} +8 -7
  61. package/dist/esm/{ChainRestTendermintApi-CMrAg0Zm.js → ChainRestTendermintApi-DpVPQNSn.js} +12 -10
  62. package/dist/esm/{DirectEthSecp256k1Wallet-a9KiF9fA.js → DirectEthSecp256k1Wallet-BqxC1b40.js} +2 -2
  63. package/dist/esm/{ExecArgNeptuneWithdraw-DEljIeLd.js → ExecArgNeptuneWithdraw-uLf3HttI.js} +1 -1
  64. package/dist/esm/{IndexerGrpcWeb3GwApi-CtUYowus.js → IndexerGrpcWeb3GwApi-BHz_bM42.js} +9 -8
  65. package/dist/esm/{MsgSetDenomMetadata-BhJMebO9.js → MsgSetDenomMetadata-hxd0v-JN.js} +21 -10
  66. package/dist/esm/{OLPGrpcApi-CMwW7LXZ.js → OLPGrpcApi-BNGEcbpR.js} +6 -5
  67. package/dist/esm/{QueryTradingStrategyContractTotalStrategies-7IjWZLsc.js → QueryTradingStrategyContractTotalStrategies-DqCEu1NJ.js} +5 -5
  68. package/dist/esm/{IndexerGrpcAccountPortfolioStream-3AGGiB1c.js → StreamManagerV2-Dp2D7FL4.js} +1191 -263
  69. package/dist/esm/{accounts-DFC9RYDH.js → accounts-C5HEaz0B.js} +1 -1
  70. package/dist/esm/{chain-phKWVf8c.js → chain-BGq_0n_H.js} +94 -76
  71. package/dist/esm/client/abacus.d.ts +4 -2
  72. package/dist/esm/client/abacus.js +2 -2
  73. package/dist/esm/client/chain.d.ts +8 -9
  74. package/dist/esm/client/chain.js +5 -5
  75. package/dist/esm/client/indexer.d.ts +9 -10
  76. package/dist/esm/client/indexer.js +7 -7
  77. package/dist/esm/client/olp.d.ts +4 -2
  78. package/dist/esm/client/olp.js +3 -3
  79. package/dist/esm/client/wasm.d.ts +3 -2
  80. package/dist/esm/client/wasm.js +7 -7
  81. package/dist/esm/core/accounts.d.ts +8 -9
  82. package/dist/esm/core/accounts.js +2 -2
  83. package/dist/esm/core/modules.d.ts +8 -9
  84. package/dist/esm/core/modules.js +10 -10
  85. package/dist/esm/core/tx.d.ts +8 -9
  86. package/dist/esm/core/tx.js +7 -7
  87. package/dist/esm/cosmjs.d.ts +2 -3
  88. package/dist/esm/cosmjs.js +8 -8
  89. package/dist/esm/exports.d.ts +2 -3
  90. package/dist/esm/exports.js +8 -8
  91. package/dist/{cjs/index-D4uWOVE5.d.cts → esm/index-BJg6-o6s.d.ts} +9 -14
  92. package/dist/esm/{index-BOKuUpVZ.d.ts → index-BqYLsIZe.d.ts} +1 -1
  93. package/dist/esm/{index-IV55OZfT.d.ts → index-BzG_rDxK.d.ts} +1057 -473
  94. package/dist/{cjs/index-B19YRG03.d.cts → esm/index-DXl4Xl74.d.ts} +2 -3
  95. package/dist/{cjs/index-CKBod1ba.d.cts → esm/index-DbxF8Vb3.d.ts} +5 -5
  96. package/dist/esm/index-ICIQoqaU.d.ts +4026 -0
  97. package/dist/esm/{index-DS6aJrL5.d.ts → index-T3rAmwhz.d.ts} +1 -1
  98. package/dist/esm/index.d.ts +9 -10
  99. package/dist/esm/index.js +18 -18
  100. package/dist/esm/{service-CoINtWpF.js → service-CnqMmybI.js} +2 -2
  101. package/dist/esm/service.d.ts +3 -4
  102. package/dist/esm/service.js +3 -3
  103. package/dist/esm/{tx-CcaVBSym.js → tx-Bgy5FhAu.js} +11 -10
  104. package/dist/esm/{tx_pb-TiSRD5ay.d.ts → tx_pb-DiV92WM9.d.ts} +188 -7
  105. package/dist/esm/types-68OuBiEQ.js +162 -0
  106. package/dist/esm/types.d.ts +3 -4
  107. package/dist/esm/types.js +2 -2
  108. package/dist/esm/{utils-DwGoPRTL.js → utils-BFBu_LnJ.js} +33 -9
  109. package/dist/esm/utils.d.ts +9 -10
  110. package/dist/esm/utils.js +2 -2
  111. package/package.json +11 -13
  112. package/dist/cjs/BaseGrpcConsumer-PDufF0fz.d.cts +0 -1829
  113. package/dist/cjs/any_pb-CP-3DVyl.d.cts +0 -187
  114. package/dist/cjs/index-Cqfc1ppG.d.cts +0 -2005
  115. package/dist/esm/BaseGrpcConsumer-BbvNzhrS.d.ts +0 -1829
  116. package/dist/esm/any_pb-B1YYUSUf.d.ts +0 -187
  117. package/dist/esm/index-B1R417vW.d.ts +0 -2005
  118. package/dist/esm/types-Cq0sRR6y.js +0 -70
@@ -1,6 +1,6 @@
1
1
  const require_chunk = require('./chunk-CbDLau6x.cjs');
2
2
  const require_defineProperty = require('./defineProperty-dyr5BsvG.cjs');
3
- const require_BaseGrpcConsumer = require('./BaseGrpcConsumer-DUwCngI6.cjs');
3
+ const require_BaseGrpcConsumer = require('./BaseGrpcConsumer-hNH10qOJ.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);
@@ -42,11 +42,12 @@ var AbacusGrpcTransformer = class {
42
42
  //#endregion
43
43
  //#region src/client/abacus/grpc/AbacusGrpcApi.ts
44
44
  var AbacusGrpcApi = class extends require_BaseGrpcConsumer.BaseGrpcConsumer {
45
- constructor(endpoint) {
46
- super(endpoint);
45
+ constructor(..._args) {
46
+ super(..._args);
47
47
  require_defineProperty._defineProperty(this, "module", __injectivelabs_exceptions.IndexerErrorModule.Abacus);
48
- require_defineProperty._defineProperty(this, "client", void 0);
49
- this.client = new __injectivelabs_abacus_proto_ts_v2_generated_points_svc_pb_client.PointsSvcClient(this.transport);
48
+ }
49
+ get client() {
50
+ return this.initClient(__injectivelabs_abacus_proto_ts_v2_generated_points_svc_pb_client.PointsSvcClient);
50
51
  }
51
52
  async fetchAccountLatestPoints(address) {
52
53
  const request = __injectivelabs_abacus_proto_ts_v2_generated_points_svc_pb.PointsLatestForAccountRequest.create({ accountAddress: address });
@@ -0,0 +1,89 @@
1
+ import { At as MethodInfo, Dt as DuplexStreamingCall, Et as UnaryCall, Ot as ClientStreamingCall, Tt as RpcTransport, f as GrpcWebTransportAdditionalOptions, kt as ServerStreamingCall, wt as RpcOptions } from "./index-Dems0piS.cjs";
2
+
3
+ //#region src/client/base/GrpcWebRpcTransport.d.ts
4
+
5
+ /**
6
+ * GrpcWebRpcTransport provides a simple wrapper around GrpcWebFetchTransport
7
+ * from @protobuf-ts/grpcweb-transport for use with protobuf-ts generated clients.
8
+ *
9
+ * This transport works in browser, Node.js, and React Native environments.
10
+ */
11
+ declare class GrpcWebRpcTransport implements RpcTransport {
12
+ private transport;
13
+ constructor(baseUrl: string, options?: GrpcWebTransportAdditionalOptions);
14
+ mergeOptions(options?: Partial<RpcOptions>): RpcOptions;
15
+ unary<I extends object, O extends object>(method: MethodInfo<I, O>, input: I, options: RpcOptions): UnaryCall<I, O>;
16
+ serverStreaming<I extends object, O extends object>(method: MethodInfo<I, O>, input: I, options: RpcOptions): ServerStreamingCall<I, O>;
17
+ clientStreaming<I extends object, O extends object>(method: MethodInfo<I, O>, options: RpcOptions): ClientStreamingCall<I, O>;
18
+ duplex<I extends object, O extends object>(method: MethodInfo<I, O>, options: RpcOptions): DuplexStreamingCall<I, O>;
19
+ }
20
+ //#endregion
21
+ //#region src/client/base/BaseGrpcConsumer.d.ts
22
+ /**
23
+ * BaseGrpcConsumer provides base functionality for all gRPC consumers.
24
+ * It uses the GrpcWebRpcTransport with GrpcWebFetchTransport from @protobuf-ts/grpcweb-transport.
25
+ */
26
+ declare class BaseGrpcConsumer {
27
+ protected transport: GrpcWebRpcTransport;
28
+ protected module: string;
29
+ protected metadata?: Record<string, string>;
30
+ protected endpoint: string;
31
+ protected options?: GrpcWebTransportAdditionalOptions;
32
+ private _client;
33
+ constructor(endpoint: string, options?: GrpcWebTransportAdditionalOptions);
34
+ setMetadata(map: Record<string, string>): this;
35
+ clearMetadata(): void;
36
+ getTransport(): GrpcWebRpcTransport;
37
+ /**
38
+ * Lazily initializes and returns the gRPC client.
39
+ * Call this from a getter in subclasses to avoid constructor boilerplate.
40
+ *
41
+ * @example
42
+ * private get client() {
43
+ * return this.initClient(MyGrpcClient)
44
+ * }
45
+ */
46
+ protected initClient<TClient>(ClientClass: new (transport: GrpcWebRpcTransport) => TClient): TClient;
47
+ /**
48
+ * Builds RpcOptions with metadata
49
+ */
50
+ protected getRpcOptions(): RpcOptions;
51
+ /**
52
+ * Retry a gRPC call with exponential backoff
53
+ */
54
+ protected retry<TResponse>(grpcCall: () => Promise<TResponse>, retries?: number, delay?: number): Promise<TResponse>;
55
+ /**
56
+ * Extracts the ABCI error code from a gRPC error message.
57
+ * Chain errors contain patterns like: {key:"ABCICode" value:"100"}
58
+ */
59
+ private getABCICodeFromMessage;
60
+ /**
61
+ * Extracts the codespace/module from a gRPC error message.
62
+ * Chain errors contain patterns like: {key:"Codespace" value:"exchange"}
63
+ */
64
+ private getCodespaceFromMessage;
65
+ /**
66
+ * Centralized error handler for gRPC calls.
67
+ * When the error contains chain error details (ABCI code and codespace),
68
+ * throws a TransactionException which will map the error to a user-friendly message.
69
+ * Otherwise throws a GrpcUnaryRequestException for generic gRPC errors.
70
+ */
71
+ protected handleGrpcError(e: unknown, context: string): never;
72
+ /**
73
+ * Generic wrapper for gRPC calls with retry and error handling
74
+ * Simplifies the common pattern of: retry -> await response -> handle errors
75
+ *
76
+ * Usage with explicit type parameter:
77
+ * ```typescript
78
+ * const response = await this.executeGrpcCall<QueryParamsRequest, QueryParamsResponse>(
79
+ * request,
80
+ * this.client.params.bind(this.client),
81
+ * )
82
+ * ```
83
+ * @template TRequest - The request message type
84
+ * @template TResponse - The response message type
85
+ */
86
+ protected executeGrpcCall<TRequest extends object = object, TResponse extends object = object>(request: TRequest, clientMethod: (req: TRequest, options?: RpcOptions) => UnaryCall<TRequest, TResponse>): Promise<TResponse>;
87
+ }
88
+ //#endregion
89
+ export { BaseGrpcConsumer as t };
@@ -40,17 +40,23 @@ var GrpcWebRpcTransport = class {
40
40
  * It uses the GrpcWebRpcTransport with GrpcWebFetchTransport from @protobuf-ts/grpcweb-transport.
41
41
  */
42
42
  var BaseGrpcConsumer = class {
43
- constructor(endpoint) {
43
+ constructor(endpoint, options) {
44
44
  require_defineProperty._defineProperty(this, "transport", void 0);
45
45
  require_defineProperty._defineProperty(this, "module", "");
46
46
  require_defineProperty._defineProperty(this, "metadata", void 0);
47
47
  require_defineProperty._defineProperty(this, "endpoint", void 0);
48
+ require_defineProperty._defineProperty(this, "options", void 0);
49
+ require_defineProperty._defineProperty(this, "_client", void 0);
48
50
  this.endpoint = endpoint;
49
- this.transport = new GrpcWebRpcTransport(endpoint, { headers: {} });
51
+ this.options = options;
52
+ this.transport = new GrpcWebRpcTransport(endpoint, options);
50
53
  }
51
54
  setMetadata(map) {
52
55
  this.metadata = map;
53
- this.transport = new GrpcWebRpcTransport(this.endpoint, { headers: this.metadata });
56
+ this.transport = new GrpcWebRpcTransport(this.endpoint, {
57
+ ...this.options,
58
+ meta: this.metadata
59
+ });
54
60
  return this;
55
61
  }
56
62
  clearMetadata() {
@@ -60,6 +66,19 @@ var BaseGrpcConsumer = class {
60
66
  return this.transport;
61
67
  }
62
68
  /**
69
+ * Lazily initializes and returns the gRPC client.
70
+ * Call this from a getter in subclasses to avoid constructor boilerplate.
71
+ *
72
+ * @example
73
+ * private get client() {
74
+ * return this.initClient(MyGrpcClient)
75
+ * }
76
+ */
77
+ initClient(ClientClass) {
78
+ if (!this._client) this._client = new ClientClass(this.transport);
79
+ return this._client;
80
+ }
81
+ /**
63
82
  * Builds RpcOptions with metadata
64
83
  */
65
84
  getRpcOptions() {
@@ -80,16 +99,57 @@ var BaseGrpcConsumer = class {
80
99
  return retryGrpcCall();
81
100
  }
82
101
  /**
83
- * Centralized error handler for gRPC calls
84
- * Converts RpcError to GrpcUnaryRequestException with proper error codes
102
+ * Extracts the ABCI error code from a gRPC error message.
103
+ * Chain errors contain patterns like: {key:"ABCICode" value:"100"}
104
+ */
105
+ getABCICodeFromMessage(message) {
106
+ const ABCICode = /{key:"ABCICode"[ \t]+value:"(.*?)"}/g.exec(message);
107
+ if (!ABCICode || ABCICode.length < 2) return;
108
+ return Number(ABCICode[1]);
109
+ }
110
+ /**
111
+ * Extracts the codespace/module from a gRPC error message.
112
+ * Chain errors contain patterns like: {key:"Codespace" value:"exchange"}
113
+ */
114
+ getCodespaceFromMessage(message) {
115
+ const codespace = /{key:"Codespace"[ \t]+value:"(.*?)"}/g.exec(message);
116
+ if (!codespace || codespace.length < 2) return;
117
+ return codespace[1];
118
+ }
119
+ /**
120
+ * Centralized error handler for gRPC calls.
121
+ * When the error contains chain error details (ABCI code and codespace),
122
+ * throws a TransactionException which will map the error to a user-friendly message.
123
+ * Otherwise throws a GrpcUnaryRequestException for generic gRPC errors.
85
124
  */
86
125
  handleGrpcError(e, context) {
87
- if (e instanceof __protobuf_ts_runtime_rpc.RpcError) throw new __injectivelabs_exceptions.GrpcUnaryRequestException(new Error(e.message), {
88
- code: (0, __injectivelabs_exceptions.grpcErrorCodeToErrorCode)(Number(e.code)),
126
+ if (e instanceof __protobuf_ts_runtime_rpc.RpcError) {
127
+ const message$1 = e.message;
128
+ const abciCode$1 = this.getABCICodeFromMessage(message$1);
129
+ const codespace$1 = this.getCodespaceFromMessage(message$1);
130
+ if (abciCode$1 && codespace$1) throw new __injectivelabs_exceptions.TransactionException(new Error(message$1), {
131
+ code: (0, __injectivelabs_exceptions.grpcErrorCodeToErrorCode)(Number(e.code)),
132
+ context,
133
+ contextModule: codespace$1,
134
+ contextCode: abciCode$1
135
+ });
136
+ throw new __injectivelabs_exceptions.GrpcUnaryRequestException(new Error(message$1), {
137
+ code: (0, __injectivelabs_exceptions.grpcErrorCodeToErrorCode)(Number(e.code)),
138
+ context,
139
+ contextModule: this.module
140
+ });
141
+ }
142
+ const error = e;
143
+ const message = (error === null || error === void 0 ? void 0 : error.message) || "";
144
+ const abciCode = this.getABCICodeFromMessage(message);
145
+ const codespace = this.getCodespaceFromMessage(message);
146
+ if (abciCode && codespace) throw new __injectivelabs_exceptions.TransactionException(error, {
147
+ code: __injectivelabs_exceptions.UnspecifiedErrorCode,
89
148
  context,
90
- contextModule: this.module
149
+ contextModule: codespace,
150
+ contextCode: abciCode
91
151
  });
92
- throw new __injectivelabs_exceptions.GrpcUnaryRequestException(e, {
152
+ throw new __injectivelabs_exceptions.GrpcUnaryRequestException(error, {
93
153
  code: __injectivelabs_exceptions.UnspecifiedErrorCode,
94
154
  context,
95
155
  contextModule: this.module
@@ -1,4 +1,4 @@
1
- const require_BaseGrpcConsumer = require('./BaseGrpcConsumer-DUwCngI6.cjs');
1
+ const require_BaseGrpcConsumer = require('./BaseGrpcConsumer-hNH10qOJ.cjs');
2
2
 
3
3
  //#region src/client/base/BaseIndexerGrpcConsumer.ts
4
4
  /**
@@ -1,8 +1,8 @@
1
1
  const require_chunk = require('./chunk-CbDLau6x.cjs');
2
- const require_utils = require('./utils-V1uXtT51.cjs');
2
+ const require_utils = require('./utils-CDl812vv.cjs');
3
3
  const require_defineProperty = require('./defineProperty-dyr5BsvG.cjs');
4
- const require_ChainRestTendermintApi = require('./ChainRestTendermintApi-BiZOeKcG.cjs');
5
- const require_BaseGrpcConsumer = require('./BaseGrpcConsumer-DUwCngI6.cjs');
4
+ const require_ChainRestTendermintApi = require('./ChainRestTendermintApi-BtxXFstT.cjs');
5
+ const require_BaseGrpcConsumer = require('./BaseGrpcConsumer-hNH10qOJ.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);
@@ -260,11 +260,12 @@ var ChainGrpcExchangeTransformer = class ChainGrpcExchangeTransformer {
260
260
  * @category Chain Grpc API
261
261
  */
262
262
  var ChainGrpcExchangeApi = class extends require_BaseGrpcConsumer.BaseGrpcConsumer {
263
- constructor(endpoint) {
264
- super(endpoint);
263
+ constructor(..._args) {
264
+ super(..._args);
265
265
  require_defineProperty._defineProperty(this, "module", require_ChainRestTendermintApi.ChainModule.Exchange);
266
- require_defineProperty._defineProperty(this, "client", void 0);
267
- this.client = new __injectivelabs_core_proto_ts_v2_generated_injective_exchange_v1beta1_query_pb_client.QueryClient(this.transport);
266
+ }
267
+ get client() {
268
+ return this.initClient(__injectivelabs_core_proto_ts_v2_generated_injective_exchange_v1beta1_query_pb_client.QueryClient);
268
269
  }
269
270
  async fetchModuleParams() {
270
271
  const request = __injectivelabs_core_proto_ts_v2_generated_injective_exchange_v1beta1_query_pb.QueryExchangeParamsRequest.create();
@@ -1,7 +1,7 @@
1
1
  const require_chunk = require('./chunk-CbDLau6x.cjs');
2
- const require_utils = require('./utils-V1uXtT51.cjs');
2
+ const require_utils = require('./utils-CDl812vv.cjs');
3
3
  const require_defineProperty = require('./defineProperty-dyr5BsvG.cjs');
4
- const require_BaseGrpcConsumer = require('./BaseGrpcConsumer-DUwCngI6.cjs');
4
+ const require_BaseGrpcConsumer = require('./BaseGrpcConsumer-hNH10qOJ.cjs');
5
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");
@@ -108,11 +108,12 @@ var ChainGrpcAuthTransformer = class ChainGrpcAuthTransformer {
108
108
  * @category Chain Grpc API
109
109
  */
110
110
  var ChainGrpcAuthApi = class extends require_BaseGrpcConsumer.BaseGrpcConsumer {
111
- constructor(endpoint) {
112
- super(endpoint);
111
+ constructor(..._args) {
112
+ super(..._args);
113
113
  require_defineProperty._defineProperty(this, "module", ChainModule.Auth);
114
- require_defineProperty._defineProperty(this, "client", void 0);
115
- this.client = new __injectivelabs_core_proto_ts_v2_generated_cosmos_auth_v1beta1_query_pb_client.QueryClient(this.transport);
114
+ }
115
+ get client() {
116
+ return this.initClient(__injectivelabs_core_proto_ts_v2_generated_cosmos_auth_v1beta1_query_pb_client.QueryClient);
116
117
  }
117
118
  async fetchModuleParams() {
118
119
  const request = __injectivelabs_core_proto_ts_v2_generated_cosmos_auth_v1beta1_query_pb.QueryParamsRequest.create();
@@ -140,11 +141,12 @@ var ChainGrpcAuthApi = class extends require_BaseGrpcConsumer.BaseGrpcConsumer {
140
141
  * @category Chain Grpc API
141
142
  */
142
143
  var ChainGrpcTendermintApi = class extends require_BaseGrpcConsumer.BaseGrpcConsumer {
143
- constructor(endpoint) {
144
- super(endpoint);
144
+ constructor(..._args) {
145
+ super(..._args);
145
146
  require_defineProperty._defineProperty(this, "module", ChainModule.Tendermint);
146
- require_defineProperty._defineProperty(this, "client", void 0);
147
- this.client = new __injectivelabs_core_proto_ts_v2_generated_cosmos_base_tendermint_v1beta1_query_pb_client.ServiceClient(this.transport);
147
+ }
148
+ get client() {
149
+ return this.initClient(__injectivelabs_core_proto_ts_v2_generated_cosmos_base_tendermint_v1beta1_query_pb_client.ServiceClient);
148
150
  }
149
151
  async fetchLatestBlock() {
150
152
  const request = __injectivelabs_core_proto_ts_v2_generated_cosmos_base_tendermint_v1beta1_query_pb.GetLatestBlockRequest.create();
@@ -1,7 +1,7 @@
1
1
  const require_chunk = require('./chunk-CbDLau6x.cjs');
2
- const require_utils = require('./utils-V1uXtT51.cjs');
2
+ const require_utils = require('./utils-CDl812vv.cjs');
3
3
  const require_defineProperty = require('./defineProperty-dyr5BsvG.cjs');
4
- const require_accounts = require('./accounts-CXaUasU5.cjs');
4
+ const require_accounts = require('./accounts-CHKUxDIf.cjs');
5
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
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
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");
@@ -1,5 +1,5 @@
1
1
  const require_chunk = require('./chunk-CbDLau6x.cjs');
2
- const require_utils = require('./utils-V1uXtT51.cjs');
2
+ const require_utils = require('./utils-CDl812vv.cjs');
3
3
  const require_defineProperty = require('./defineProperty-dyr5BsvG.cjs');
4
4
  const require_MsgBase = require('./MsgBase-DqOmzCyS.cjs');
5
5
  let __injectivelabs_exceptions = require("@injectivelabs/exceptions");
@@ -1,7 +1,7 @@
1
1
  const require_chunk = require('./chunk-CbDLau6x.cjs');
2
- const require_utils = require('./utils-V1uXtT51.cjs');
2
+ const require_utils = require('./utils-CDl812vv.cjs');
3
3
  const require_defineProperty = require('./defineProperty-dyr5BsvG.cjs');
4
- const require_BaseIndexerGrpcConsumer = require('./BaseIndexerGrpcConsumer-BGLVnJtw.cjs');
4
+ const require_BaseIndexerGrpcConsumer = require('./BaseIndexerGrpcConsumer-E9xi3hs8.cjs');
5
5
  let __injectivelabs_core_proto_ts_v2_generated_cosmos_tx_v1beta1_tx_pb = require("@injectivelabs/core-proto-ts-v2/generated/cosmos/tx/v1beta1/tx_pb");
6
6
  __injectivelabs_core_proto_ts_v2_generated_cosmos_tx_v1beta1_tx_pb = require_chunk.__toESM(__injectivelabs_core_proto_ts_v2_generated_cosmos_tx_v1beta1_tx_pb);
7
7
  let __injectivelabs_utils = require("@injectivelabs/utils");
@@ -79,11 +79,12 @@ const IndexerModule = { ...__injectivelabs_exceptions.IndexerErrorModule };
79
79
  * @deprecated use IndexerGrpcWeb3GwApi
80
80
  */
81
81
  var IndexerGrpcTransactionApi = class extends require_BaseIndexerGrpcConsumer.BaseIndexerGrpcConsumer {
82
- constructor(endpoint) {
83
- super(endpoint);
82
+ constructor(..._args) {
83
+ super(..._args);
84
84
  require_defineProperty._defineProperty(this, "module", IndexerModule.Transaction);
85
- require_defineProperty._defineProperty(this, "client", void 0);
86
- this.client = new __injectivelabs_indexer_proto_ts_v2_generated_injective_exchange_rpc_pb_client.InjectiveExchangeRPCClient(this.transport);
85
+ }
86
+ get client() {
87
+ return this.initClient(__injectivelabs_indexer_proto_ts_v2_generated_injective_exchange_rpc_pb_client.InjectiveExchangeRPCClient);
87
88
  }
88
89
  async prepareTxRequest(args) {
89
90
  const { address, chainId, message, memo, estimateGas = true, gasLimit = __injectivelabs_utils.DEFAULT_GAS_LIMIT, feeDenom = __injectivelabs_utils.DEFAULT_BRIDGE_FEE_DENOM, feePrice = __injectivelabs_utils.DEFAULT_BRIDGE_FEE_PRICE, timeoutHeight } = args;
@@ -188,8 +189,8 @@ var IndexerGrpcTransactionApi = class extends require_BaseIndexerGrpcConsumer.Ba
188
189
  * @category Indexer Grpc API
189
190
  */
190
191
  var IndexerGrpcWeb3GwApi = class extends IndexerGrpcTransactionApi {
191
- constructor(endpoint) {
192
- super(endpoint);
192
+ constructor(..._args) {
193
+ super(..._args);
193
194
  require_defineProperty._defineProperty(this, "module", IndexerModule.Web3Gw);
194
195
  }
195
196
  async prepareEip712Request({ address, chainId, message, memo, sequence, accountNumber, estimateGas = false, gasLimit = __injectivelabs_utils.DEFAULT_GAS_LIMIT, feeDenom = __injectivelabs_utils.DEFAULT_BRIDGE_FEE_DENOM, feePrice = __injectivelabs_utils.DEFAULT_BRIDGE_FEE_PRICE, timeoutHeight, eip712Version = "v1" }) {
@@ -1,10 +1,10 @@
1
1
  const require_chunk = require('./chunk-CbDLau6x.cjs');
2
- const require_utils = require('./utils-V1uXtT51.cjs');
2
+ const require_utils = require('./utils-CDl812vv.cjs');
3
3
  const require_defineProperty = require('./defineProperty-dyr5BsvG.cjs');
4
- const require_accounts = require('./accounts-CXaUasU5.cjs');
4
+ const require_accounts = require('./accounts-CHKUxDIf.cjs');
5
5
  const require_MsgBase = require('./MsgBase-DqOmzCyS.cjs');
6
- const require_ChainGrpcExchangeApi = require('./ChainGrpcExchangeApi-DLpkgEyg.cjs');
7
- const require_ExecArgNeptuneWithdraw = require('./ExecArgNeptuneWithdraw-DOHeo3AJ.cjs');
6
+ const require_ChainGrpcExchangeApi = require('./ChainGrpcExchangeApi-C1v-xxCh.cjs');
7
+ const require_ExecArgNeptuneWithdraw = require('./ExecArgNeptuneWithdraw-C-NQ72VM.cjs');
8
8
  let viem = require("viem");
9
9
  let __injectivelabs_utils = require("@injectivelabs/utils");
10
10
  let __injectivelabs_exceptions = require("@injectivelabs/exceptions");
@@ -409,13 +409,14 @@ const createBinaryOptionOrder = (args) => {
409
409
  });
410
410
  };
411
411
  const createMsgAndCancelOrders = (params) => {
412
+ const hasCancelAll = params.spotMarketIdsToCancelAll && params.spotMarketIdsToCancelAll.length > 0 || params.derivativeMarketIdsToCancelAll && params.derivativeMarketIdsToCancelAll.length > 0 || params.binaryOptionsMarketIdsToCancelAll && params.binaryOptionsMarketIdsToCancelAll.length > 0;
412
413
  const message = __injectivelabs_core_proto_ts_v2_generated_injective_exchange_v1beta1_tx_pb.MsgBatchUpdateOrders.create({
413
414
  sender: params.injectiveAddress,
414
- subaccountId: params.subaccountId
415
+ ...hasCancelAll && { subaccountId: params.subaccountId }
415
416
  });
416
- if (params.spotMarketIdsToCancelAll) message.spotMarketIdsToCancelAll = params.spotMarketIdsToCancelAll;
417
- if (params.derivativeMarketIdsToCancelAll) message.derivativeMarketIdsToCancelAll = params.derivativeMarketIdsToCancelAll;
418
- if (params.binaryOptionsMarketIdsToCancelAll) message.binaryOptionsMarketIdsToCancelAll = params.binaryOptionsMarketIdsToCancelAll;
417
+ if (params.spotMarketIdsToCancelAll && params.spotMarketIdsToCancelAll.length > 0) message.spotMarketIdsToCancelAll = params.spotMarketIdsToCancelAll;
418
+ if (params.derivativeMarketIdsToCancelAll && params.derivativeMarketIdsToCancelAll.length > 0) message.derivativeMarketIdsToCancelAll = params.derivativeMarketIdsToCancelAll;
419
+ if (params.binaryOptionsMarketIdsToCancelAll && params.binaryOptionsMarketIdsToCancelAll.length > 0) message.binaryOptionsMarketIdsToCancelAll = params.binaryOptionsMarketIdsToCancelAll;
419
420
  if (params.spotOrdersToCancel) message.spotOrdersToCancel = params.spotOrdersToCancel.map(({ marketId, subaccountId, orderHash, cid }) => {
420
421
  return __injectivelabs_core_proto_ts_v2_generated_injective_exchange_v1beta1_tx_pb.OrderData.create({
421
422
  marketId,
@@ -3896,7 +3897,7 @@ var MsgSubmitProposalExpiryFuturesMarketLaunch = class MsgSubmitProposalExpiryFu
3896
3897
  type: "exchange/ExpiryFuturesMarketLaunchProposal",
3897
3898
  value: {
3898
3899
  ...value.content.value,
3899
- expiry: params.market.expiry.toString(),
3900
+ expiry: require_utils.bigIntToString(params.market.expiry),
3900
3901
  initial_margin_ratio: (0, __injectivelabs_utils.toChainFormat)(params.market.initialMarginRatio).toFixed(),
3901
3902
  maintenance_margin_ratio: (0, __injectivelabs_utils.toChainFormat)(params.market.maintenanceMarginRatio).toFixed(),
3902
3903
  maker_fee_rate: (0, __injectivelabs_utils.toChainFormat)(params.market.makerFeeRate).toFixed(),
@@ -4081,6 +4082,16 @@ var MsgTransfer = class MsgTransfer extends require_MsgBase.MsgBase {
4081
4082
 
4082
4083
  //#endregion
4083
4084
  //#region src/core/modules/bank/msgs/MsgSend.ts
4085
+ /**
4086
+ * @category Messages
4087
+ }[]
4088
+ srcInjectiveAddress: string
4089
+ dstInjectiveAddress: string
4090
+ }
4091
+
4092
+ export type Proto = CosmosBankV1Beta1TxPb.MsgSend
4093
+ }
4094
+
4084
4095
  /**
4085
4096
  * @category Messages
4086
4097
  */
@@ -7133,7 +7144,7 @@ var MsgFundCommunityPool = class MsgFundCommunityPool extends require_MsgBase.Ms
7133
7144
  }
7134
7145
  toProto() {
7135
7146
  const { params } = this;
7136
- const coins = params.amount.map((amount) => {
7147
+ const coins = (Array.isArray(params.amount) ? params.amount : [params.amount]).map((amount) => {
7137
7148
  return __injectivelabs_core_proto_ts_v2_generated_cosmos_base_v1beta1_coin_pb.Coin.create({
7138
7149
  denom: amount.denom,
7139
7150
  amount: amount.amount
@@ -1,7 +1,7 @@
1
1
  const require_chunk = require('./chunk-CbDLau6x.cjs');
2
2
  const require_defineProperty = require('./defineProperty-dyr5BsvG.cjs');
3
3
  const require_time = require('./time-B4xLc27Y.cjs');
4
- const require_BaseIndexerGrpcConsumer = require('./BaseIndexerGrpcConsumer-BGLVnJtw.cjs');
4
+ const require_BaseIndexerGrpcConsumer = require('./BaseIndexerGrpcConsumer-E9xi3hs8.cjs');
5
5
  let __injectivelabs_exceptions = require("@injectivelabs/exceptions");
6
6
  let __injectivelabs_olp_proto_ts_v2_generated_dmm_pb = require("@injectivelabs/olp-proto-ts-v2/generated/dmm_pb");
7
7
  __injectivelabs_olp_proto_ts_v2_generated_dmm_pb = require_chunk.__toESM(__injectivelabs_olp_proto_ts_v2_generated_dmm_pb);
@@ -250,11 +250,12 @@ var DmmGrpcTransformer = class DmmGrpcTransformer {
250
250
  //#endregion
251
251
  //#region src/client/olp/grpc/OLPGrpcApi.ts
252
252
  var OLPGrpcApi = class extends require_BaseIndexerGrpcConsumer.BaseIndexerGrpcConsumer {
253
- constructor(endpoint) {
254
- super(endpoint);
253
+ constructor(..._args) {
254
+ super(..._args);
255
255
  require_defineProperty._defineProperty(this, "module", __injectivelabs_exceptions.IndexerErrorModule.OLP);
256
- require_defineProperty._defineProperty(this, "client", void 0);
257
- this.client = new __injectivelabs_olp_proto_ts_v2_generated_dmm_pb_client.InjectiveDmmV2RPCClient(this.transport);
256
+ }
257
+ get client() {
258
+ return this.initClient(__injectivelabs_olp_proto_ts_v2_generated_dmm_pb_client.InjectiveDmmV2RPCClient);
258
259
  }
259
260
  async fetchEpochs(status) {
260
261
  const request = __injectivelabs_olp_proto_ts_v2_generated_dmm_pb.GetEpochsRequest.create();
@@ -1,8 +1,8 @@
1
1
  const require_chunk = require('./chunk-CbDLau6x.cjs');
2
- const require_utils = require('./utils-V1uXtT51.cjs');
2
+ const require_utils = require('./utils-CDl812vv.cjs');
3
3
  const require_defineProperty = require('./defineProperty-dyr5BsvG.cjs');
4
- const require_chain = require('./chain-Cs9sNuT1.cjs');
5
- const require_ExecArgNeptuneWithdraw = require('./ExecArgNeptuneWithdraw-DOHeo3AJ.cjs');
4
+ const require_chain = require('./chain-C_8R5bBd.cjs');
5
+ const require_ExecArgNeptuneWithdraw = require('./ExecArgNeptuneWithdraw-C-NQ72VM.cjs');
6
6
  let __injectivelabs_exceptions = require("@injectivelabs/exceptions");
7
7
  let __injectivelabs_networks = require("@injectivelabs/networks");
8
8
 
@@ -141,11 +141,11 @@ var NeptuneService = class {
141
141
  * @param network The network to use (default: Mainnet).
142
142
  * @param endpoints Optional custom network endpoints.
143
143
  */
144
- constructor(network = __injectivelabs_networks.Network.MainnetSentry, endpoints) {
144
+ constructor(network = __injectivelabs_networks.Network.MainnetSentry, endpoints, options) {
145
145
  require_defineProperty._defineProperty(this, "client", void 0);
146
146
  require_defineProperty._defineProperty(this, "priceOracleContract", void 0);
147
147
  if (!(0, __injectivelabs_networks.isMainnet)(network)) throw new __injectivelabs_exceptions.GeneralException(/* @__PURE__ */ new Error("Please switch to mainnet network"));
148
- this.client = new require_chain.ChainGrpcWasmApi((endpoints || (0, __injectivelabs_networks.getNetworkEndpoints)(network)).grpc);
148
+ this.client = new require_chain.ChainGrpcWasmApi((endpoints || (0, __injectivelabs_networks.getNetworkEndpoints)(network)).grpc, options);
149
149
  this.priceOracleContract = NEPTUNE_PRICE_CONTRACT;
150
150
  }
151
151
  /**