@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,14 +1,13 @@
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');
5
- const require_BaseIndexerGrpcConsumer = require('./BaseIndexerGrpcConsumer-BGLVnJtw.cjs');
4
+ const require_BaseGrpcConsumer = require('./BaseGrpcConsumer-hNH10qOJ.cjs');
5
+ const require_BaseIndexerGrpcConsumer = require('./BaseIndexerGrpcConsumer-E9xi3hs8.cjs');
6
6
  const require_BaseRestConsumer = require('./BaseRestConsumer-uSzCOit7.cjs');
7
- const require_IndexerGrpcWeb3GwApi = require('./IndexerGrpcWeb3GwApi-BgWT2tWK.cjs');
8
- const require_types = require('./types-NFV4P_J_.cjs');
7
+ const require_IndexerGrpcWeb3GwApi = require('./IndexerGrpcWeb3GwApi-C5AlN6KV.cjs');
8
+ const require_types = require('./types-BTuy007B.cjs');
9
9
  let __injectivelabs_utils = require("@injectivelabs/utils");
10
10
  let __injectivelabs_exceptions = require("@injectivelabs/exceptions");
11
- let __injectivelabs_ts_types = require("@injectivelabs/ts-types");
12
11
  let __injectivelabs_mito_proto_ts_v2_generated_goadesign_goagen_mito_api_pb_client = require("@injectivelabs/mito-proto-ts-v2/generated/goadesign_goagen_mito_api_pb.client");
13
12
  let __injectivelabs_mito_proto_ts_v2_generated_goadesign_goagen_mito_api_pb = require("@injectivelabs/mito-proto-ts-v2/generated/goadesign_goagen_mito_api_pb");
14
13
  __injectivelabs_mito_proto_ts_v2_generated_goadesign_goagen_mito_api_pb = require_chunk.__toESM(__injectivelabs_mito_proto_ts_v2_generated_goadesign_goagen_mito_api_pb);
@@ -54,6 +53,7 @@ let __injectivelabs_indexer_proto_ts_v2_generated_injective_portfolio_rpc_pb_cli
54
53
  let __injectivelabs_indexer_proto_ts_v2_generated_injective_insurance_rpc_pb = require("@injectivelabs/indexer-proto-ts-v2/generated/injective_insurance_rpc_pb");
55
54
  __injectivelabs_indexer_proto_ts_v2_generated_injective_insurance_rpc_pb = require_chunk.__toESM(__injectivelabs_indexer_proto_ts_v2_generated_injective_insurance_rpc_pb);
56
55
  let __injectivelabs_indexer_proto_ts_v2_generated_injective_insurance_rpc_pb_client = require("@injectivelabs/indexer-proto-ts-v2/generated/injective_insurance_rpc_pb.client");
56
+ let eventemitter3 = require("eventemitter3");
57
57
 
58
58
  //#region src/client/indexer/transformers/IndexerCommonTransformer.ts
59
59
  var IndexerCommonTransformer = class {
@@ -145,7 +145,7 @@ var IndexerGrpcMitoTransformer = class IndexerGrpcMitoTransformer {
145
145
  static portfolioResponseToPortfolio(portfolio) {
146
146
  return {
147
147
  pnl: portfolio.pnl,
148
- totalValue: typeof portfolio.totalValue === "bigint" ? Number(portfolio.totalValue) : portfolio.totalValue,
148
+ totalValue: require_utils.bigIntToNumber(portfolio.totalValue),
149
149
  updatedAt: Number(portfolio.pnlUpdatedAt),
150
150
  totalValueChartList: portfolio.totalValueChart.map(IndexerGrpcMitoTransformer.mitoPriceSnapshotToPriceSnapshot),
151
151
  pnlChartList: portfolio.pnlChart.map(IndexerGrpcMitoTransformer.mitoPriceSnapshotToPriceSnapshot)
@@ -154,7 +154,7 @@ var IndexerGrpcMitoTransformer = class IndexerGrpcMitoTransformer {
154
154
  static leaderboardResponseToLeaderboard(leaderboard) {
155
155
  return {
156
156
  epochId: leaderboard.epochId,
157
- snapshotBlock: typeof leaderboard.snapshotBlock === "bigint" ? leaderboard.snapshotBlock.toString() : leaderboard.snapshotBlock,
157
+ snapshotBlock: require_utils.bigIntToString(leaderboard.snapshotBlock),
158
158
  updatedAt: Number(leaderboard.updatedAt),
159
159
  entriesList: leaderboard.entries.map((entry) => ({
160
160
  address: entry.address,
@@ -245,25 +245,25 @@ var IndexerGrpcMitoTransformer = class IndexerGrpcMitoTransformer {
245
245
  stakedAmount: holder.stakedAmount,
246
246
  holderAddress: holder.holderAddress,
247
247
  lpAmountPercentage: holder.lpAmountPercentage,
248
- redemptionLockTime: typeof holder.redemptionLockTime === "bigint" ? holder.redemptionLockTime.toString() : holder.redemptionLockTime,
248
+ redemptionLockTime: require_utils.bigIntToString(holder.redemptionLockTime),
249
249
  updatedAt: Number(holder.updatedAt)
250
250
  };
251
251
  }
252
252
  static mitoMissionToMission(mission) {
253
253
  return {
254
254
  id: mission.id,
255
- points: typeof mission.points === "bigint" ? mission.points.toString() : mission.points,
255
+ points: require_utils.bigIntToString(mission.points),
256
256
  progress: mission.progress,
257
257
  expected: mission.expected,
258
258
  completed: mission.completed,
259
- accruedPoints: typeof mission.accruedPoints === "bigint" ? mission.accruedPoints.toString() : mission.accruedPoints,
259
+ accruedPoints: require_utils.bigIntToString(mission.accruedPoints),
260
260
  updatedAt: Number(mission.updatedAt)
261
261
  };
262
262
  }
263
263
  static mitoMissionLeaderboardEntryToMissionLeaderboardEntry(entry) {
264
264
  return {
265
265
  address: entry.address,
266
- accruedPoints: typeof entry.accruedPoints === "bigint" ? entry.accruedPoints.toString() : entry.accruedPoints
266
+ accruedPoints: require_utils.bigIntToString(entry.accruedPoints)
267
267
  };
268
268
  }
269
269
  static mitoIDOProgressToIDOProgress(progress) {
@@ -1312,15 +1312,15 @@ var IndexerGrpcExplorerTransformer = class IndexerGrpcExplorerTransformer {
1312
1312
  tokens: data.tokens,
1313
1313
  delegatorShares: data.delegatorShares,
1314
1314
  description: IndexerGrpcExplorerTransformer.grpcValidatorDescriptionToValidatorDescription(data.description),
1315
- unbondingHeight: typeof data.unbondingHeight === "bigint" ? Number(data.unbondingHeight) : parseInt(data.unbondingHeight, 10),
1315
+ unbondingHeight: require_utils.bigIntToNumber(data.unbondingHeight),
1316
1316
  unbondingTime: data.unbondingTime,
1317
1317
  commissionRate: data.commissionRate,
1318
1318
  commissionMaxRate: data.commissionMaxRate,
1319
1319
  commissionMaxChangeRate: data.commissionMaxChangeRate,
1320
1320
  commissionUpdateTime: data.commissionUpdateTime,
1321
- proposed: typeof data.proposed === "bigint" ? Number(data.proposed) : parseInt(data.proposed, 10),
1322
- signed: typeof data.signed === "bigint" ? Number(data.signed) : parseInt(data.signed, 10),
1323
- missed: typeof data.missed === "bigint" ? Number(data.missed) : parseInt(data.missed, 10),
1321
+ signed: require_utils.bigIntToNumber(data.signed),
1322
+ missed: require_utils.bigIntToNumber(data.missed),
1323
+ proposed: require_utils.bigIntToNumber(data.proposed),
1324
1324
  uptimePercentage: data.uptimePercentage,
1325
1325
  imageUrl: data.imageUrl,
1326
1326
  timestamp: data.timestamp,
@@ -1331,14 +1331,14 @@ var IndexerGrpcExplorerTransformer = class IndexerGrpcExplorerTransformer {
1331
1331
  static streamTxResponseToTxs(response) {
1332
1332
  return {
1333
1333
  id: response.id,
1334
- blockNumber: typeof response.blockNumber === "bigint" ? Number(response.blockNumber) : parseInt(response.blockNumber, 10),
1335
- blockTimestamp: response.blockTimestamp,
1336
1334
  hash: response.hash,
1337
- codespace: response.codespace,
1335
+ code: response.code,
1338
1336
  messages: response.messages,
1339
- txNumber: typeof response.txNumber === "bigint" ? Number(response.txNumber) : parseInt(response.txNumber, 10),
1340
1337
  errorLog: response.errorLog,
1341
- code: response.code
1338
+ codespace: response.codespace,
1339
+ blockTimestamp: response.blockTimestamp,
1340
+ txNumber: require_utils.bigIntToNumber(response.txNumber),
1341
+ blockNumber: require_utils.bigIntToNumber(response.blockNumber)
1342
1342
  };
1343
1343
  }
1344
1344
  static grpcGasFeeToGasFee(gasFee) {
@@ -1347,43 +1347,43 @@ var IndexerGrpcExplorerTransformer = class IndexerGrpcExplorerTransformer {
1347
1347
  amount: amount.amount,
1348
1348
  denom: amount.denom
1349
1349
  })),
1350
- gasLimit: typeof gasFee.gasLimit === "bigint" ? Number(gasFee.gasLimit) : parseInt(gasFee.gasLimit, 10),
1351
1350
  payer: gasFee.payer,
1352
- granter: gasFee.granter
1351
+ granter: gasFee.granter,
1352
+ gasLimit: require_utils.bigIntToNumber(gasFee.gasLimit)
1353
1353
  };
1354
1354
  }
1355
1355
  static grpcTransactionToBankMsgSendTransaction(tx) {
1356
1356
  const data = tx.data;
1357
1357
  const [message] = JSON.parse(require_utils.uint8ArrayToString(data.messages));
1358
1358
  return {
1359
- blockNumber: typeof data.blockNumber === "bigint" ? Number(data.blockNumber) : parseInt(data.blockNumber, 10),
1360
- blockTimestamp: data.blockTimestamp,
1361
1359
  hash: data.hash,
1362
- amount: message.value.amount[0].amount,
1363
- denom: message.value.amount[0].denom,
1364
1360
  sender: message.value.from_address,
1365
- receiver: message.value.to_address
1361
+ receiver: message.value.to_address,
1362
+ blockTimestamp: data.blockTimestamp,
1363
+ denom: message.value.amount[0].denom,
1364
+ amount: message.value.amount[0].amount,
1365
+ blockNumber: require_utils.bigIntToNumber(data.blockNumber)
1366
1366
  };
1367
1367
  }
1368
1368
  static grpcTransactionToTransaction(tx) {
1369
1369
  const data = tx.data;
1370
1370
  return {
1371
1371
  id: data.id,
1372
- blockNumber: typeof data.blockNumber === "bigint" ? Number(data.blockNumber) : parseInt(data.blockNumber, 10),
1373
- blockTimestamp: data.blockTimestamp,
1374
1372
  hash: data.hash,
1375
1373
  code: data.code,
1376
1374
  info: data.info,
1377
- gasWanted: typeof data.gasWanted === "bigint" ? Number(data.gasWanted) : parseInt(data.gasWanted, 10),
1378
- gasUsed: typeof data.gasUsed === "bigint" ? Number(data.gasUsed) : parseInt(data.gasUsed, 10),
1379
- codespace: data.codespace,
1380
1375
  data: data.data,
1381
- gasFee: IndexerGrpcExplorerTransformer.grpcGasFeeToGasFee(data.gasFee),
1382
1376
  txType: data.txType,
1377
+ codespace: data.codespace,
1378
+ blockTimestamp: data.blockTimestamp,
1379
+ gasUsed: require_utils.bigIntToNumber(data.gasUsed),
1380
+ gasWanted: require_utils.bigIntToNumber(data.gasWanted),
1381
+ blockNumber: require_utils.bigIntToNumber(data.blockNumber),
1382
+ gasFee: IndexerGrpcExplorerTransformer.grpcGasFeeToGasFee(data.gasFee),
1383
1383
  signatures: data.signatures.map((signature) => ({
1384
1384
  pubkey: signature.pubkey,
1385
1385
  address: signature.address,
1386
- sequence: typeof signature.sequence === "bigint" ? Number(signature.sequence) : parseInt(signature.sequence, 10),
1386
+ sequence: require_utils.bigIntToNumber(signature.sequence),
1387
1387
  signature: signature.signature
1388
1388
  })),
1389
1389
  events: data.events.map((event) => ({
@@ -1400,14 +1400,14 @@ var IndexerGrpcExplorerTransformer = class IndexerGrpcExplorerTransformer {
1400
1400
  const messages = JSON.parse(require_utils.uint8ArrayToString(tx.messages));
1401
1401
  return {
1402
1402
  ...tx,
1403
- gasWanted: typeof tx.gasWanted === "bigint" ? Number(tx.gasWanted) : parseInt(tx.gasWanted, 10),
1404
- gasUsed: typeof tx.gasUsed === "bigint" ? Number(tx.gasUsed) : parseInt(tx.gasUsed, 10),
1405
- blockNumber: typeof tx.blockNumber === "bigint" ? Number(tx.blockNumber) : parseInt(tx.blockNumber, 10),
1403
+ gasUsed: require_utils.bigIntToNumber(tx.gasUsed),
1404
+ gasWanted: require_utils.bigIntToNumber(tx.gasWanted),
1405
+ blockNumber: require_utils.bigIntToNumber(tx.blockNumber),
1406
1406
  signatures: tx.signatures.map((signature) => ({
1407
1407
  pubkey: signature.pubkey,
1408
1408
  address: signature.address,
1409
- sequence: typeof signature.sequence === "bigint" ? Number(signature.sequence) : parseInt(signature.sequence, 10),
1410
- signature: signature.signature
1409
+ signature: signature.signature,
1410
+ sequence: require_utils.bigIntToNumber(signature.sequence)
1411
1411
  })),
1412
1412
  gasFee: tx.gasFee ? IndexerGrpcExplorerTransformer.grpcGasFeeToGasFee(tx.gasFee) : {
1413
1413
  gasLimit: 0,
@@ -1427,26 +1427,26 @@ var IndexerGrpcExplorerTransformer = class IndexerGrpcExplorerTransformer {
1427
1427
  }
1428
1428
  static grpcBlockToBlock(block) {
1429
1429
  return {
1430
- height: typeof block.height === "bigint" ? Number(block.height) : parseInt(block.height, 10),
1431
- proposer: block.proposer,
1432
1430
  moniker: block.moniker,
1431
+ proposer: block.proposer,
1433
1432
  blockHash: block.blockHash,
1433
+ timestamp: block.timestamp,
1434
1434
  parentHash: block.parentHash,
1435
- numPreCommits: typeof block.numPreCommits === "bigint" ? Number(block.numPreCommits) : parseInt(block.numPreCommits, 10),
1436
- numTxs: typeof block.numTxs === "bigint" ? Number(block.numTxs) : parseInt(block.numTxs, 10),
1437
- timestamp: block.timestamp
1435
+ height: require_utils.bigIntToNumber(block.height),
1436
+ numTxs: require_utils.bigIntToNumber(block.numTxs),
1437
+ numPreCommits: require_utils.bigIntToNumber(block.numPreCommits)
1438
1438
  };
1439
1439
  }
1440
1440
  static grpcBlockToBlockWithTxs(block) {
1441
1441
  return {
1442
- height: typeof block.height === "bigint" ? Number(block.height) : parseInt(block.height, 10),
1443
- proposer: block.proposer,
1444
1442
  moniker: block.moniker,
1443
+ proposer: block.proposer,
1445
1444
  blockHash: block.blockHash,
1445
+ timestamp: block.timestamp,
1446
1446
  parentHash: block.parentHash,
1447
- numPreCommits: typeof block.numPreCommits === "bigint" ? Number(block.numPreCommits) : parseInt(block.numPreCommits, 10),
1448
- numTxs: typeof block.numTxs === "bigint" ? Number(block.numTxs) : parseInt(block.numTxs, 10),
1449
- timestamp: block.timestamp
1447
+ height: require_utils.bigIntToNumber(block.height),
1448
+ numTxs: require_utils.bigIntToNumber(block.numTxs),
1449
+ numPreCommits: require_utils.bigIntToNumber(block.numPreCommits)
1450
1450
  };
1451
1451
  }
1452
1452
  static grpcBlocksToBlocks(blocks) {
@@ -1466,88 +1466,88 @@ var IndexerGrpcExplorerTransformer = class IndexerGrpcExplorerTransformer {
1466
1466
  }
1467
1467
  static grpcValidatorUptimeToValidatorUptime(validatorUptime) {
1468
1468
  return {
1469
- blockNumber: typeof validatorUptime.blockNumber === "bigint" ? Number(validatorUptime.blockNumber) : parseInt(validatorUptime.blockNumber, 10),
1470
- status: validatorUptime.status
1469
+ status: validatorUptime.status,
1470
+ blockNumber: require_utils.bigIntToNumber(validatorUptime.blockNumber)
1471
1471
  };
1472
1472
  }
1473
1473
  static grpcValidatorSlashingEventToValidatorSlashingEvent(validatorUptime) {
1474
1474
  return {
1475
- blockNumber: typeof validatorUptime.blockNumber === "bigint" ? Number(validatorUptime.blockNumber) : parseInt(validatorUptime.blockNumber, 10),
1476
- blockTimestamp: validatorUptime.blockTimestamp,
1477
- address: validatorUptime.address,
1478
- power: typeof validatorUptime.power === "bigint" ? Number(validatorUptime.power) : parseInt(validatorUptime.power, 10),
1479
1475
  reason: validatorUptime.reason,
1480
1476
  jailed: validatorUptime.jailed,
1481
- missedBlocks: typeof validatorUptime.missedBlocks === "bigint" ? Number(validatorUptime.missedBlocks) : parseInt(validatorUptime.missedBlocks, 10)
1477
+ address: validatorUptime.address,
1478
+ power: require_utils.bigIntToNumber(validatorUptime.power),
1479
+ blockTimestamp: validatorUptime.blockTimestamp,
1480
+ blockNumber: require_utils.bigIntToNumber(validatorUptime.blockNumber),
1481
+ missedBlocks: require_utils.bigIntToNumber(validatorUptime.missedBlocks)
1482
1482
  };
1483
1483
  }
1484
1484
  static grpcIBCTransferTxToIBCTransferTx(grpcIBCTransferTx) {
1485
1485
  return {
1486
+ denom: grpcIBCTransferTx.denom,
1487
+ state: grpcIBCTransferTx.state,
1486
1488
  sender: grpcIBCTransferTx.sender,
1489
+ amount: grpcIBCTransferTx.amount,
1490
+ dataHex: grpcIBCTransferTx.dataHex,
1487
1491
  receiver: grpcIBCTransferTx.receiver,
1492
+ createdAt: grpcIBCTransferTx.createdAt,
1493
+ updatedAt: grpcIBCTransferTx.updatedAt,
1488
1494
  sourcePort: grpcIBCTransferTx.sourcePort,
1495
+ txHashesList: grpcIBCTransferTx.txHashes,
1489
1496
  sourceChannel: grpcIBCTransferTx.sourceChannel,
1497
+ timeoutHeight: grpcIBCTransferTx.timeoutHeight,
1490
1498
  destinationPort: grpcIBCTransferTx.destinationPort,
1491
1499
  destinationChannel: grpcIBCTransferTx.destinationChannel,
1492
- amount: grpcIBCTransferTx.amount,
1493
- denom: grpcIBCTransferTx.denom,
1494
- timeoutHeight: grpcIBCTransferTx.timeoutHeight,
1495
- timeoutTimestamp: typeof grpcIBCTransferTx.timeoutTimestamp === "bigint" ? Number(grpcIBCTransferTx.timeoutTimestamp) : parseInt(grpcIBCTransferTx.timeoutTimestamp, 10),
1496
- packetSequence: typeof grpcIBCTransferTx.packetSequence === "bigint" ? Number(grpcIBCTransferTx.packetSequence) : parseInt(grpcIBCTransferTx.packetSequence, 10),
1497
- dataHex: grpcIBCTransferTx.dataHex,
1498
- state: grpcIBCTransferTx.state,
1499
- txHashesList: grpcIBCTransferTx.txHashes,
1500
- createdAt: grpcIBCTransferTx.createdAt,
1501
- updatedAt: grpcIBCTransferTx.updatedAt
1500
+ packetSequence: require_utils.bigIntToNumber(grpcIBCTransferTx.packetSequence),
1501
+ timeoutTimestamp: require_utils.bigIntToNumber(grpcIBCTransferTx.timeoutTimestamp)
1502
1502
  };
1503
1503
  }
1504
1504
  static grpcPeggyDepositTx(grpcPeggyDepositTx) {
1505
1505
  return {
1506
- sender: grpcPeggyDepositTx.sender,
1507
- receiver: grpcPeggyDepositTx.receiver,
1508
- eventNonce: typeof grpcPeggyDepositTx.eventNonce === "bigint" ? Number(grpcPeggyDepositTx.eventNonce) : parseInt(grpcPeggyDepositTx.eventNonce, 10),
1509
- eventHeight: typeof grpcPeggyDepositTx.eventHeight === "bigint" ? Number(grpcPeggyDepositTx.eventHeight) : parseInt(grpcPeggyDepositTx.eventHeight, 10),
1510
- amount: grpcPeggyDepositTx.amount,
1511
1506
  denom: grpcPeggyDepositTx.denom,
1512
- orchestratorAddress: grpcPeggyDepositTx.orchestratorAddress,
1513
1507
  state: grpcPeggyDepositTx.state,
1508
+ sender: grpcPeggyDepositTx.sender,
1509
+ amount: grpcPeggyDepositTx.amount,
1510
+ receiver: grpcPeggyDepositTx.receiver,
1514
1511
  claimType: grpcPeggyDepositTx.claimType,
1515
- txHashesList: grpcPeggyDepositTx.txHashes,
1516
1512
  createdAt: grpcPeggyDepositTx.createdAt,
1517
- updatedAt: grpcPeggyDepositTx.updatedAt
1513
+ updatedAt: grpcPeggyDepositTx.updatedAt,
1514
+ txHashesList: grpcPeggyDepositTx.txHashes,
1515
+ eventNonce: require_utils.bigIntToNumber(grpcPeggyDepositTx.eventNonce),
1516
+ eventHeight: require_utils.bigIntToNumber(grpcPeggyDepositTx.eventHeight),
1517
+ orchestratorAddress: grpcPeggyDepositTx.orchestratorAddress
1518
1518
  };
1519
1519
  }
1520
1520
  static grpcPeggyWithdrawalTx(grpcPeggyWithdrawalTx) {
1521
1521
  return {
1522
+ denom: grpcPeggyWithdrawalTx.denom,
1523
+ state: grpcPeggyWithdrawalTx.state,
1522
1524
  sender: grpcPeggyWithdrawalTx.sender,
1523
- receiver: grpcPeggyWithdrawalTx.receiver,
1524
1525
  amount: grpcPeggyWithdrawalTx.amount,
1525
- denom: grpcPeggyWithdrawalTx.denom,
1526
+ receiver: grpcPeggyWithdrawalTx.receiver,
1526
1527
  bridgeFee: grpcPeggyWithdrawalTx.bridgeFee,
1527
- outgoingTxId: typeof grpcPeggyWithdrawalTx.outgoingTxId === "bigint" ? Number(grpcPeggyWithdrawalTx.outgoingTxId) : parseInt(grpcPeggyWithdrawalTx.outgoingTxId, 10),
1528
- batchTimeout: typeof grpcPeggyWithdrawalTx.batchTimeout === "bigint" ? Number(grpcPeggyWithdrawalTx.batchTimeout) : parseInt(grpcPeggyWithdrawalTx.batchTimeout, 10),
1529
- batchNonce: typeof grpcPeggyWithdrawalTx.batchNonce === "bigint" ? Number(grpcPeggyWithdrawalTx.batchNonce) : parseInt(grpcPeggyWithdrawalTx.batchNonce, 10),
1530
- eventNonce: typeof grpcPeggyWithdrawalTx.eventNonce === "bigint" ? Number(grpcPeggyWithdrawalTx.eventNonce) : parseInt(grpcPeggyWithdrawalTx.eventNonce, 10),
1531
- eventHeight: typeof grpcPeggyWithdrawalTx.eventHeight === "bigint" ? Number(grpcPeggyWithdrawalTx.eventHeight) : parseInt(grpcPeggyWithdrawalTx.eventHeight, 10),
1532
- orchestratorAddress: grpcPeggyWithdrawalTx.orchestratorAddress,
1533
- state: grpcPeggyWithdrawalTx.state,
1534
1528
  claimType: grpcPeggyWithdrawalTx.claimType,
1535
- txHashesList: grpcPeggyWithdrawalTx.txHashes,
1536
1529
  createdAt: grpcPeggyWithdrawalTx.createdAt,
1537
- updatedAt: grpcPeggyWithdrawalTx.updatedAt
1530
+ updatedAt: grpcPeggyWithdrawalTx.updatedAt,
1531
+ txHashesList: grpcPeggyWithdrawalTx.txHashes,
1532
+ batchNonce: require_utils.bigIntToNumber(grpcPeggyWithdrawalTx.batchNonce),
1533
+ eventNonce: require_utils.bigIntToNumber(grpcPeggyWithdrawalTx.eventNonce),
1534
+ eventHeight: require_utils.bigIntToNumber(grpcPeggyWithdrawalTx.eventHeight),
1535
+ orchestratorAddress: grpcPeggyWithdrawalTx.orchestratorAddress,
1536
+ outgoingTxId: require_utils.bigIntToNumber(grpcPeggyWithdrawalTx.outgoingTxId),
1537
+ batchTimeout: require_utils.bigIntToNumber(grpcPeggyWithdrawalTx.batchTimeout)
1538
1538
  };
1539
1539
  }
1540
1540
  static getExplorerStatsResponseToExplorerStats(response) {
1541
1541
  return {
1542
- assets: typeof response.assets === "bigint" ? response.assets.toString() : response.assets,
1543
- txsTotal: typeof response.txsTotal === "bigint" ? response.txsTotal.toString() : response.txsTotal,
1544
- addresses: typeof response.addresses === "bigint" ? response.addresses.toString() : response.addresses,
1545
- injSupply: typeof response.injSupply === "bigint" ? response.injSupply.toString() : response.injSupply,
1546
- txsInPast24Hours: typeof response.txs24H === "bigint" ? response.txs24H.toString() : response.txs24H,
1547
- txsInPast30Days: typeof response.txs30D === "bigint" ? response.txs30D.toString() : response.txs30D,
1548
- blockCountInPast24Hours: typeof response.blockCount24H === "bigint" ? response.blockCount24H.toString() : response.blockCount24H,
1549
- txsPerSecondInPast24Hours: typeof response.txsPs24H === "bigint" ? response.txsPs24H.toString() : response.txsPs24H,
1550
- txsPerSecondInPast100Blocks: typeof response.txsPs100B === "bigint" ? response.txsPs100B.toString() : response.txsPs100B
1542
+ assets: require_utils.bigIntToString(response.assets),
1543
+ txsTotal: require_utils.bigIntToString(response.txsTotal),
1544
+ addresses: require_utils.bigIntToString(response.addresses),
1545
+ injSupply: require_utils.bigIntToString(response.injSupply),
1546
+ txsInPast30Days: require_utils.bigIntToString(response.txs30D),
1547
+ txsInPast24Hours: require_utils.bigIntToString(response.txs24H),
1548
+ txsPerSecondInPast24Hours: require_utils.bigIntToString(response.txsPs24H),
1549
+ blockCountInPast24Hours: require_utils.bigIntToString(response.blockCount24H),
1550
+ txsPerSecondInPast100Blocks: require_utils.bigIntToString(response.txsPs100B)
1551
1551
  };
1552
1552
  }
1553
1553
  static getTxsV2ResponseToTxs(response) {
@@ -1566,7 +1566,7 @@ var IndexerGrpcExplorerTransformer = class IndexerGrpcExplorerTransformer {
1566
1566
  signature: signature.signature,
1567
1567
  sequence: (() => {
1568
1568
  try {
1569
- return typeof signature.sequence === "bigint" ? Number(signature.sequence) : parseInt(signature.sequence, 10);
1569
+ return require_utils.bigIntToNumber(signature.sequence);
1570
1570
  } catch (_unused3) {
1571
1571
  return 0;
1572
1572
  }
@@ -1574,12 +1574,12 @@ var IndexerGrpcExplorerTransformer = class IndexerGrpcExplorerTransformer {
1574
1574
  }));
1575
1575
  const claimIds = tx.claimIds.map((claimId) => {
1576
1576
  try {
1577
- return typeof claimId === "bigint" ? Number(claimId) : parseInt(claimId, 10);
1577
+ return require_utils.bigIntToNumber(claimId);
1578
1578
  } catch (_unused4) {
1579
1579
  return 0;
1580
1580
  }
1581
1581
  });
1582
- const blockNumber = typeof tx.blockNumber === "bigint" ? Number(tx.blockNumber) : parseInt(tx.blockNumber);
1582
+ const blockNumber = require_utils.bigIntToNumber(tx.blockNumber);
1583
1583
  return {
1584
1584
  logs,
1585
1585
  info: "",
@@ -1612,7 +1612,7 @@ var IndexerGrpcExplorerTransformer = class IndexerGrpcExplorerTransformer {
1612
1612
  };
1613
1613
  }
1614
1614
  static grpcAccountTxV2ToTransaction(tx) {
1615
- var _tx$gasFee, _tx$gasFee2, _tx$gasFee3, _tx$gasFee$gasLimit, _tx$gasFee4, _tx$gasFee$granter, _tx$gasFee5, _tx$gasFee$payer, _tx$gasFee6;
1615
+ var _tx$gasFee, _tx$gasFee2, _tx$gasFee$granter, _tx$gasFee3, _tx$gasFee$payer, _tx$gasFee4;
1616
1616
  return {
1617
1617
  id: tx.id,
1618
1618
  hash: tx.hash,
@@ -1625,27 +1625,27 @@ var IndexerGrpcExplorerTransformer = class IndexerGrpcExplorerTransformer {
1625
1625
  amount: amount.amount,
1626
1626
  denom: amount.denom
1627
1627
  })),
1628
- gasLimit: typeof ((_tx$gasFee2 = tx.gasFee) === null || _tx$gasFee2 === void 0 ? void 0 : _tx$gasFee2.gasLimit) === "bigint" ? Number((_tx$gasFee3 = tx.gasFee) === null || _tx$gasFee3 === void 0 ? void 0 : _tx$gasFee3.gasLimit) : parseInt((_tx$gasFee$gasLimit = (_tx$gasFee4 = tx.gasFee) === null || _tx$gasFee4 === void 0 ? void 0 : _tx$gasFee4.gasLimit) !== null && _tx$gasFee$gasLimit !== void 0 ? _tx$gasFee$gasLimit : "0", 10),
1629
- granter: (_tx$gasFee$granter = (_tx$gasFee5 = tx.gasFee) === null || _tx$gasFee5 === void 0 ? void 0 : _tx$gasFee5.granter) !== null && _tx$gasFee$granter !== void 0 ? _tx$gasFee$granter : "",
1630
- payer: (_tx$gasFee$payer = (_tx$gasFee6 = tx.gasFee) === null || _tx$gasFee6 === void 0 ? void 0 : _tx$gasFee6.payer) !== null && _tx$gasFee$payer !== void 0 ? _tx$gasFee$payer : ""
1628
+ gasLimit: require_utils.bigIntToNumber((_tx$gasFee2 = tx.gasFee) === null || _tx$gasFee2 === void 0 ? void 0 : _tx$gasFee2.gasLimit),
1629
+ granter: (_tx$gasFee$granter = (_tx$gasFee3 = tx.gasFee) === null || _tx$gasFee3 === void 0 ? void 0 : _tx$gasFee3.granter) !== null && _tx$gasFee$granter !== void 0 ? _tx$gasFee$granter : "",
1630
+ payer: (_tx$gasFee$payer = (_tx$gasFee4 = tx.gasFee) === null || _tx$gasFee4 === void 0 ? void 0 : _tx$gasFee4.payer) !== null && _tx$gasFee$payer !== void 0 ? _tx$gasFee$payer : ""
1631
1631
  },
1632
1632
  events: tx.events,
1633
1633
  errorLog: tx.errorLog,
1634
1634
  codespace: tx.codespace,
1635
- gasUsed: typeof tx.gasUsed === "bigint" ? Number(tx.gasUsed) : parseInt(tx.gasUsed, 10),
1635
+ gasUsed: require_utils.bigIntToNumber(tx.gasUsed),
1636
1636
  blockTimestamp: tx.blockTimestamp,
1637
- gasWanted: typeof tx.gasWanted === "bigint" ? Number(tx.gasWanted) : parseInt(tx.gasWanted, 10),
1638
- blockNumber: typeof tx.blockNumber === "bigint" ? Number(tx.blockNumber) : parseInt(tx.blockNumber, 10),
1637
+ gasWanted: require_utils.bigIntToNumber(tx.gasWanted),
1638
+ blockNumber: require_utils.bigIntToNumber(tx.blockNumber),
1639
1639
  signatures: tx.signatures.map((signature) => ({
1640
1640
  address: signature.address,
1641
1641
  pubkey: signature.pubkey,
1642
1642
  signature: signature.signature,
1643
- sequence: typeof signature.sequence === "bigint" ? Number(signature.sequence) : parseInt(signature.sequence, 10)
1643
+ sequence: require_utils.bigIntToNumber(signature.sequence)
1644
1644
  })),
1645
1645
  messages: transactionV2MessagesToMessagesNoThrow(tx.messages),
1646
1646
  logs: parseStringToObjectLikeNoThrow(tx.logs),
1647
1647
  data: "/" + require_utils.uint8ArrayToString(tx.data).split("/").pop(),
1648
- claimIds: tx.claimIds.map((claimId) => typeof claimId === "bigint" ? Number(claimId) : parseInt(claimId, 10))
1648
+ claimIds: tx.claimIds.map((claimId) => require_utils.bigIntToNumber(claimId))
1649
1649
  };
1650
1650
  }
1651
1651
  static getBlocksV2ResponseToBlocks(response) {
@@ -1661,9 +1661,9 @@ var IndexerGrpcExplorerTransformer = class IndexerGrpcExplorerTransformer {
1661
1661
  blockHash: block.blockHash,
1662
1662
  timestamp: block.timestamp,
1663
1663
  parentHash: block.parentHash,
1664
- height: typeof block.height === "bigint" ? Number(block.height) : parseInt(block.height, 10),
1665
- numTxs: typeof block.numTxs === "bigint" ? Number(block.numTxs) : parseInt(block.numTxs, 10),
1666
- numPreCommits: typeof block.numPreCommits === "bigint" ? Number(block.numPreCommits) : parseInt(block.numPreCommits, 10)
1664
+ height: require_utils.bigIntToNumber(block.height),
1665
+ numTxs: require_utils.bigIntToNumber(block.numTxs),
1666
+ numPreCommits: require_utils.bigIntToNumber(block.numPreCommits)
1667
1667
  };
1668
1668
  }
1669
1669
  static getContractTxsV2ResponseToContractTxs(response) {
@@ -1673,7 +1673,7 @@ var IndexerGrpcExplorerTransformer = class IndexerGrpcExplorerTransformer {
1673
1673
  };
1674
1674
  }
1675
1675
  static grpcContractTxV2ToTransaction(tx) {
1676
- var _tx$gasFee7;
1676
+ var _tx$gasFee5;
1677
1677
  return {
1678
1678
  messages: transactionV2MessagesToMessagesNoThrow(tx.messages),
1679
1679
  code: tx.code,
@@ -1681,18 +1681,18 @@ var IndexerGrpcExplorerTransformer = class IndexerGrpcExplorerTransformer {
1681
1681
  type: tx.txType,
1682
1682
  txHash: tx.hash,
1683
1683
  error_log: tx.errorLog,
1684
- height: typeof tx.blockNumber === "bigint" ? Number(tx.blockNumber) : parseInt(tx.blockNumber, 10),
1685
- tx_number: typeof tx.txNumber === "bigint" ? Number(tx.txNumber) : parseInt(tx.txNumber, 10),
1686
- time: typeof tx.blockUnixTimestamp === "bigint" ? Number(tx.blockUnixTimestamp) : parseInt(tx.blockUnixTimestamp, 10),
1684
+ height: require_utils.bigIntToNumber(tx.blockNumber),
1685
+ tx_number: require_utils.bigIntToNumber(tx.txNumber),
1686
+ time: require_utils.bigIntToNumber(tx.blockUnixTimestamp),
1687
1687
  amount: getContractTransactionV2Amount(tx),
1688
1688
  logs: JSON.parse(require_utils.uint8ArrayToString(tx.logs)),
1689
1689
  data: "/" + require_utils.uint8ArrayToString(tx.data).split("/").pop(),
1690
- fee: (0, __injectivelabs_utils.toHumanReadable)(((_tx$gasFee7 = tx.gasFee) === null || _tx$gasFee7 === void 0 || (_tx$gasFee7 = _tx$gasFee7.amount[0]) === null || _tx$gasFee7 === void 0 ? void 0 : _tx$gasFee7.amount) || "0"),
1690
+ fee: (0, __injectivelabs_utils.toHumanReadable)(((_tx$gasFee5 = tx.gasFee) === null || _tx$gasFee5 === void 0 || (_tx$gasFee5 = _tx$gasFee5.amount[0]) === null || _tx$gasFee5 === void 0 ? void 0 : _tx$gasFee5.amount) || "0"),
1691
1691
  signatures: tx.signatures.map((signature) => ({
1692
1692
  address: signature.address,
1693
1693
  pubkey: signature.pubkey,
1694
1694
  signature: signature.signature,
1695
- sequence: typeof signature.sequence === "bigint" ? Number(signature.sequence) : parseInt(signature.sequence, 10)
1695
+ sequence: require_utils.bigIntToNumber(signature.sequence)
1696
1696
  }))
1697
1697
  };
1698
1698
  }
@@ -1726,8 +1726,8 @@ var IndexerGrpcReferralTransformer = class {
1726
1726
  var IndexerOracleStreamTransformer = class {};
1727
1727
  require_defineProperty._defineProperty(IndexerOracleStreamTransformer, "pricesStreamCallback", (response) => ({
1728
1728
  price: response.price,
1729
- operation: require_types.StreamOperation.Update,
1730
- timestamp: typeof response.timestamp === "bigint" ? Number(response.timestamp) : parseInt(response.timestamp, 10)
1729
+ timestamp: require_utils.bigIntToNumber(response.timestamp),
1730
+ operation: require_types.StreamOperation.Update
1731
1731
  }));
1732
1732
  require_defineProperty._defineProperty(IndexerOracleStreamTransformer, "pricesByMarketsCallback", (response) => ({ ...response }));
1733
1733
 
@@ -1980,9 +1980,9 @@ require_defineProperty._defineProperty(IndexerAuctionStreamTransformer, "bidsStr
1980
1980
  bid: {
1981
1981
  bidder: response.bidder,
1982
1982
  bidAmount: response.bidAmount,
1983
- bidTimestamp: typeof response.timestamp === "bigint" ? Number(response.timestamp) : parseInt(response.timestamp, 10)
1983
+ bidTimestamp: require_utils.bigIntToNumber(response.timestamp)
1984
1984
  },
1985
- operation: __injectivelabs_ts_types.StreamOperation.Insert
1985
+ operation: require_types.StreamOperation.Insert
1986
1986
  }));
1987
1987
 
1988
1988
  //#endregion
@@ -2202,7 +2202,7 @@ require_defineProperty._defineProperty(IndexerArchiverStreamTransformer, "spotAv
2202
2202
  return {
2203
2203
  averageEntry: averageEntry ? IndexerGrpcArchiverTransformer.grpcSpotAverageEntryToSpotAverageEntry(averageEntry) : void 0,
2204
2204
  operation: require_types.StreamOperation.Update,
2205
- timestamp: typeof response.timestamp === "bigint" ? Number(response.timestamp) : response.timestamp
2205
+ timestamp: require_utils.bigIntToNumber(response.timestamp)
2206
2206
  };
2207
2207
  });
2208
2208
 
@@ -2228,7 +2228,7 @@ require_defineProperty._defineProperty(ExplorerStreamTransformer, "transactionsS
2228
2228
  //#endregion
2229
2229
  //#region src/client/indexer/transformers/IndexerGrpcDerivativeTransformer.ts
2230
2230
  const zeroPositionDelta = () => ({
2231
- tradeDirection: __injectivelabs_ts_types.TradeDirection.Buy,
2231
+ tradeDirection: require_types.TradeDirection.Buy,
2232
2232
  executionPrice: "0",
2233
2233
  executionQuantity: "0",
2234
2234
  executionMargin: "0"
@@ -2287,13 +2287,7 @@ var IndexerGrpcDerivativeTransformer = class IndexerGrpcDerivativeTransformer {
2287
2287
  const pagination = response.paging;
2288
2288
  return {
2289
2289
  orders: IndexerGrpcDerivativeTransformer.grpcOrdersToOrders(orders),
2290
- pagination: pagination ? {
2291
- to: pagination.to,
2292
- from: pagination.from,
2293
- total: Number(pagination.total),
2294
- countBySubaccount: pagination.countBySubaccount,
2295
- next: pagination.next
2296
- } : void 0
2290
+ pagination: require_utils.grpcPagingToPagingV2(pagination)
2297
2291
  };
2298
2292
  }
2299
2293
  static orderHistoryResponseToOrderHistory(response, isConditional) {
@@ -2301,13 +2295,7 @@ var IndexerGrpcDerivativeTransformer = class IndexerGrpcDerivativeTransformer {
2301
2295
  const pagination = response.paging;
2302
2296
  return {
2303
2297
  orderHistory: IndexerGrpcDerivativeTransformer.grpcOrderHistoryListToOrderHistoryList(orderHistory, isConditional),
2304
- pagination: pagination ? {
2305
- to: pagination.to,
2306
- from: pagination.from,
2307
- total: Number(pagination.total),
2308
- countBySubaccount: pagination.countBySubaccount,
2309
- next: pagination.next
2310
- } : void 0
2298
+ pagination: require_utils.grpcPagingToPagingV2(pagination)
2311
2299
  };
2312
2300
  }
2313
2301
  static positionsResponseToPositions(response) {
@@ -2315,13 +2303,7 @@ var IndexerGrpcDerivativeTransformer = class IndexerGrpcDerivativeTransformer {
2315
2303
  const pagination = response.paging;
2316
2304
  return {
2317
2305
  positions: IndexerGrpcDerivativeTransformer.grpcPositionsToPositions(positions),
2318
- pagination: pagination ? {
2319
- to: pagination.to,
2320
- from: pagination.from,
2321
- total: Number(pagination.total),
2322
- countBySubaccount: pagination.countBySubaccount,
2323
- next: pagination.next
2324
- } : void 0
2306
+ pagination: require_utils.grpcPagingToPagingV2(pagination)
2325
2307
  };
2326
2308
  }
2327
2309
  static positionsV2ResponseToPositionsV2(response) {
@@ -2329,13 +2311,7 @@ var IndexerGrpcDerivativeTransformer = class IndexerGrpcDerivativeTransformer {
2329
2311
  const pagination = response.paging;
2330
2312
  return {
2331
2313
  positions: IndexerGrpcDerivativeTransformer.grpcPositionsV2ToPositionsV2(positions),
2332
- pagination: pagination ? {
2333
- to: pagination.to,
2334
- from: pagination.from,
2335
- total: Number(pagination.total),
2336
- countBySubaccount: pagination.countBySubaccount,
2337
- next: pagination.next
2338
- } : void 0
2314
+ pagination: require_utils.grpcPagingToPagingV2(pagination)
2339
2315
  };
2340
2316
  }
2341
2317
  static tradesResponseToTrades(response) {
@@ -2343,13 +2319,7 @@ var IndexerGrpcDerivativeTransformer = class IndexerGrpcDerivativeTransformer {
2343
2319
  const pagination = response.paging;
2344
2320
  return {
2345
2321
  trades: IndexerGrpcDerivativeTransformer.grpcTradesToTrades(trades),
2346
- pagination: pagination ? {
2347
- to: pagination.to,
2348
- from: pagination.from,
2349
- total: Number(pagination.total),
2350
- countBySubaccount: pagination.countBySubaccount,
2351
- next: pagination.next
2352
- } : void 0
2322
+ pagination: require_utils.grpcPagingToPagingV2(pagination)
2353
2323
  };
2354
2324
  }
2355
2325
  static subaccountTradesListResponseToSubaccountTradesList(response) {
@@ -2361,13 +2331,7 @@ var IndexerGrpcDerivativeTransformer = class IndexerGrpcDerivativeTransformer {
2361
2331
  const pagination = response.paging;
2362
2332
  return {
2363
2333
  fundingPayments: IndexerGrpcDerivativeTransformer.grpcFundingPaymentsToFundingPayments(fundingPayments),
2364
- pagination: pagination ? {
2365
- to: pagination.to,
2366
- from: pagination.from,
2367
- total: Number(pagination.total),
2368
- countBySubaccount: pagination.countBySubaccount,
2369
- next: pagination.next
2370
- } : void 0
2334
+ pagination: require_utils.grpcPagingToPagingV2(pagination)
2371
2335
  };
2372
2336
  }
2373
2337
  static fundingRatesResponseToFundingRates(response) {
@@ -2375,13 +2339,7 @@ var IndexerGrpcDerivativeTransformer = class IndexerGrpcDerivativeTransformer {
2375
2339
  const pagination = response.paging;
2376
2340
  return {
2377
2341
  fundingRates: IndexerGrpcDerivativeTransformer.grpcFundingRatesToFundingRates(fundingRates),
2378
- pagination: pagination ? {
2379
- to: pagination.to,
2380
- from: pagination.from,
2381
- total: Number(pagination.total),
2382
- countBySubaccount: pagination.countBySubaccount,
2383
- next: pagination.next
2384
- } : void 0
2342
+ pagination: require_utils.grpcPagingToPagingV2(pagination)
2385
2343
  };
2386
2344
  }
2387
2345
  static orderbookV2ResponseToOrderbookV2(response) {
@@ -2414,13 +2372,7 @@ var IndexerGrpcDerivativeTransformer = class IndexerGrpcDerivativeTransformer {
2414
2372
  const pagination = response.paging;
2415
2373
  return {
2416
2374
  markets: IndexerGrpcDerivativeTransformer.grpcBinaryOptionsMarketsToBinaryOptionsMarkets(markets),
2417
- pagination: {
2418
- to: (pagination === null || pagination === void 0 ? void 0 : pagination.to) || 0,
2419
- from: (pagination === null || pagination === void 0 ? void 0 : pagination.from) || 0,
2420
- total: Number((pagination === null || pagination === void 0 ? void 0 : pagination.total) || 0),
2421
- countBySubaccount: Number((pagination === null || pagination === void 0 ? void 0 : pagination.countBySubaccount) || 0),
2422
- next: (pagination === null || pagination === void 0 ? void 0 : pagination.next) || []
2423
- }
2375
+ pagination: require_utils.grpcPagingToPagingV2(pagination)
2424
2376
  };
2425
2377
  }
2426
2378
  static binaryOptionsMarketsResponseToBinaryOptionsMarkets(response) {
@@ -2572,7 +2524,7 @@ var IndexerGrpcDerivativeTransformer = class IndexerGrpcDerivativeTransformer {
2572
2524
  };
2573
2525
  }
2574
2526
  static grpcOrderHistoryListToOrderHistoryList(orderHistory, isConditional) {
2575
- return (isConditional ? orderHistory : orderHistory.filter((order) => order.state !== __injectivelabs_ts_types.OrderState.Booked)).map((orderHistory$1) => IndexerGrpcDerivativeTransformer.grpcOrderHistoryToOrderHistory(orderHistory$1));
2527
+ return (isConditional ? orderHistory : orderHistory.filter((order) => order.state !== require_types.OrderState.Booked)).map((orderHistory$1) => IndexerGrpcDerivativeTransformer.grpcOrderHistoryToOrderHistory(orderHistory$1));
2576
2528
  }
2577
2529
  static grpcPositionToPosition(position) {
2578
2530
  return {
@@ -2601,7 +2553,11 @@ var IndexerGrpcDerivativeTransformer = class IndexerGrpcDerivativeTransformer {
2601
2553
  liquidationPrice: position.liquidationPrice,
2602
2554
  markPrice: position.markPrice,
2603
2555
  ticker: position.ticker,
2604
- updatedAt: Number(position.updatedAt)
2556
+ updatedAt: Number(position.updatedAt),
2557
+ fundingSum: position.fundingSum,
2558
+ fundingLast: position.fundingLast,
2559
+ cumulativeFundingEntry: position.cumulativeFundingEntry,
2560
+ effectiveCumulativeFundingEntry: position.effectiveCumulativeFundingEntry
2605
2561
  };
2606
2562
  }
2607
2563
  static grpcPositionsToPositions(positions) {
@@ -2888,11 +2844,12 @@ require_defineProperty._defineProperty(IndexerAccountPortfolioStreamTransformer,
2888
2844
  * @category Indexer Grpc API
2889
2845
  */
2890
2846
  var IndexerGrpcMitoApi = class extends require_BaseIndexerGrpcConsumer.BaseIndexerGrpcConsumer {
2891
- constructor(endpoint) {
2892
- super(endpoint);
2847
+ constructor(..._args) {
2848
+ super(..._args);
2893
2849
  require_defineProperty._defineProperty(this, "module", require_IndexerGrpcWeb3GwApi.IndexerModule.Mito);
2894
- require_defineProperty._defineProperty(this, "client", void 0);
2895
- this.client = new __injectivelabs_mito_proto_ts_v2_generated_goadesign_goagen_mito_api_pb_client.MitoAPIClient(this.transport);
2850
+ }
2851
+ get client() {
2852
+ return this.initClient(__injectivelabs_mito_proto_ts_v2_generated_goadesign_goagen_mito_api_pb_client.MitoAPIClient);
2896
2853
  }
2897
2854
  async fetchVault({ contractAddress, slug }) {
2898
2855
  const request = __injectivelabs_mito_proto_ts_v2_generated_goadesign_goagen_mito_api_pb.GetVaultRequest.create();
@@ -3076,11 +3033,12 @@ var IndexerGrpcMitoApi = class extends require_BaseIndexerGrpcConsumer.BaseIndex
3076
3033
  * @category Indexer Grpc API
3077
3034
  */
3078
3035
  var IndexerGrpcMetaApi = class extends require_BaseIndexerGrpcConsumer.BaseIndexerGrpcConsumer {
3079
- constructor(endpoint) {
3080
- super(endpoint);
3036
+ constructor(..._args) {
3037
+ super(..._args);
3081
3038
  require_defineProperty._defineProperty(this, "module", require_IndexerGrpcWeb3GwApi.IndexerModule.Meta);
3082
- require_defineProperty._defineProperty(this, "client", void 0);
3083
- this.client = new __injectivelabs_indexer_proto_ts_v2_generated_injective_meta_rpc_pb_client.InjectiveMetaRPCClient(this.transport);
3039
+ }
3040
+ get client() {
3041
+ return this.initClient(__injectivelabs_indexer_proto_ts_v2_generated_injective_meta_rpc_pb_client.InjectiveMetaRPCClient);
3084
3042
  }
3085
3043
  async fetchPing() {
3086
3044
  const request = __injectivelabs_indexer_proto_ts_v2_generated_injective_meta_rpc_pb.PingRequest.create();
@@ -3103,11 +3061,12 @@ var IndexerGrpcMetaApi = class extends require_BaseIndexerGrpcConsumer.BaseIndex
3103
3061
  * @category Indexer Grpc API
3104
3062
  */
3105
3063
  var IndexerGrpcSpotApi = class extends require_BaseIndexerGrpcConsumer.BaseIndexerGrpcConsumer {
3106
- constructor(endpoint) {
3107
- super(endpoint);
3064
+ constructor(..._args) {
3065
+ super(..._args);
3108
3066
  require_defineProperty._defineProperty(this, "module", require_IndexerGrpcWeb3GwApi.IndexerModule.Spot);
3109
- require_defineProperty._defineProperty(this, "client", void 0);
3110
- this.client = new __injectivelabs_indexer_proto_ts_v2_generated_injective_spot_exchange_rpc_pb_client.InjectiveSpotExchangeRPCClient(this.transport);
3067
+ }
3068
+ get client() {
3069
+ return this.initClient(__injectivelabs_indexer_proto_ts_v2_generated_injective_spot_exchange_rpc_pb_client.InjectiveSpotExchangeRPCClient);
3111
3070
  }
3112
3071
  async fetchMarkets(params) {
3113
3072
  const { baseDenom, marketStatus, quoteDenom, marketStatuses } = params || {};
@@ -3255,11 +3214,12 @@ var IndexerGrpcSpotApi = class extends require_BaseIndexerGrpcConsumer.BaseIndex
3255
3214
  * @category Indexer Grpc API
3256
3215
  */
3257
3216
  var IndexerGrpcOracleApi = class extends require_BaseIndexerGrpcConsumer.BaseIndexerGrpcConsumer {
3258
- constructor(endpoint) {
3259
- super(endpoint);
3217
+ constructor(..._args) {
3218
+ super(..._args);
3260
3219
  require_defineProperty._defineProperty(this, "module", require_IndexerGrpcWeb3GwApi.IndexerModule.Oracle);
3261
- require_defineProperty._defineProperty(this, "client", void 0);
3262
- this.client = new __injectivelabs_indexer_proto_ts_v2_generated_injective_oracle_rpc_pb_client.InjectiveOracleRPCClient(this.transport);
3220
+ }
3221
+ get client() {
3222
+ return this.initClient(__injectivelabs_indexer_proto_ts_v2_generated_injective_oracle_rpc_pb_client.InjectiveOracleRPCClient);
3263
3223
  }
3264
3224
  async fetchOracleList() {
3265
3225
  const request = __injectivelabs_indexer_proto_ts_v2_generated_injective_oracle_rpc_pb.OracleListRequest.create();
@@ -3295,11 +3255,12 @@ var IndexerGrpcOracleApi = class extends require_BaseIndexerGrpcConsumer.BaseInd
3295
3255
  * @category Indexer Grpc API
3296
3256
  */
3297
3257
  var IndexerGrpcAccountApi = class extends require_BaseIndexerGrpcConsumer.BaseIndexerGrpcConsumer {
3298
- constructor(endpoint) {
3299
- super(endpoint);
3258
+ constructor(..._args) {
3259
+ super(..._args);
3300
3260
  require_defineProperty._defineProperty(this, "module", require_IndexerGrpcWeb3GwApi.IndexerModule.Account);
3301
- require_defineProperty._defineProperty(this, "client", void 0);
3302
- this.client = new __injectivelabs_indexer_proto_ts_v2_generated_injective_accounts_rpc_pb_client.InjectiveAccountsRPCClient(this.transport);
3261
+ }
3262
+ get client() {
3263
+ return this.initClient(__injectivelabs_indexer_proto_ts_v2_generated_injective_accounts_rpc_pb_client.InjectiveAccountsRPCClient);
3303
3264
  }
3304
3265
  /**
3305
3266
  * @deprecated - use IndexerGrpcAccountPortfolioApi.fetchPortfolio instead
@@ -3367,11 +3328,12 @@ var IndexerGrpcAccountApi = class extends require_BaseIndexerGrpcConsumer.BaseIn
3367
3328
  * @category Indexer Grpc API
3368
3329
  */
3369
3330
  var IndexerGrpcAuctionApi = class extends require_BaseIndexerGrpcConsumer.BaseIndexerGrpcConsumer {
3370
- constructor(endpoint) {
3371
- super(endpoint);
3331
+ constructor(..._args) {
3332
+ super(..._args);
3372
3333
  require_defineProperty._defineProperty(this, "module", require_IndexerGrpcWeb3GwApi.IndexerModule.Auction);
3373
- require_defineProperty._defineProperty(this, "client", void 0);
3374
- this.client = new __injectivelabs_indexer_proto_ts_v2_generated_injective_auction_rpc_pb_client.InjectiveAuctionRPCClient(this.transport);
3334
+ }
3335
+ get client() {
3336
+ return this.initClient(__injectivelabs_indexer_proto_ts_v2_generated_injective_auction_rpc_pb_client.InjectiveAuctionRPCClient);
3375
3337
  }
3376
3338
  async fetchAuction(round) {
3377
3339
  const request = __injectivelabs_indexer_proto_ts_v2_generated_injective_auction_rpc_pb.AuctionEndpointRequest.create();
@@ -3428,11 +3390,12 @@ var IndexerGrpcAuctionApi = class extends require_BaseIndexerGrpcConsumer.BaseIn
3428
3390
  * @category Indexer Grpc API
3429
3391
  */
3430
3392
  var IndexerGrpcTradingApi = class extends require_BaseIndexerGrpcConsumer.BaseIndexerGrpcConsumer {
3431
- constructor(endpoint) {
3432
- super(endpoint);
3393
+ constructor(..._args) {
3394
+ super(..._args);
3433
3395
  require_defineProperty._defineProperty(this, "module", require_IndexerGrpcWeb3GwApi.IndexerModule.Trading);
3434
- require_defineProperty._defineProperty(this, "client", void 0);
3435
- this.client = new __injectivelabs_indexer_proto_ts_v2_generated_injective_trading_rpc_pb_client.InjectiveTradingRPCClient(this.transport);
3396
+ }
3397
+ get client() {
3398
+ return this.initClient(__injectivelabs_indexer_proto_ts_v2_generated_injective_trading_rpc_pb_client.InjectiveTradingRPCClient);
3436
3399
  }
3437
3400
  async fetchTradingStats() {
3438
3401
  const request = __injectivelabs_indexer_proto_ts_v2_generated_injective_trading_rpc_pb.GetTradingStatsRequest.create();
@@ -3465,11 +3428,12 @@ var IndexerGrpcTradingApi = class extends require_BaseIndexerGrpcConsumer.BaseIn
3465
3428
  * @category Indexer Grpc API
3466
3429
  */
3467
3430
  var IndexerGrpcExplorerApi = class extends require_BaseIndexerGrpcConsumer.BaseIndexerGrpcConsumer {
3468
- constructor(endpoint) {
3469
- super(endpoint);
3431
+ constructor(..._args) {
3432
+ super(..._args);
3470
3433
  require_defineProperty._defineProperty(this, "module", require_IndexerGrpcWeb3GwApi.IndexerModule.Explorer);
3471
- require_defineProperty._defineProperty(this, "client", void 0);
3472
- this.client = new __injectivelabs_indexer_proto_ts_v2_generated_injective_explorer_rpc_pb_client.InjectiveExplorerRPCClient(this.transport);
3434
+ }
3435
+ get client() {
3436
+ return this.initClient(__injectivelabs_indexer_proto_ts_v2_generated_injective_explorer_rpc_pb_client.InjectiveExplorerRPCClient);
3473
3437
  }
3474
3438
  async fetchTxByHash(hash, isEvmHash = false) {
3475
3439
  const request = __injectivelabs_indexer_proto_ts_v2_generated_injective_explorer_rpc_pb.GetTxByTxHashRequest.create();
@@ -3614,11 +3578,12 @@ var IndexerGrpcExplorerApi = class extends require_BaseIndexerGrpcConsumer.BaseI
3614
3578
  * @category Indexer Grpc API
3615
3579
  */
3616
3580
  var IndexerGrpcCampaignApi = class extends require_BaseIndexerGrpcConsumer.BaseIndexerGrpcConsumer {
3617
- constructor(endpoint) {
3618
- super(endpoint);
3581
+ constructor(..._args) {
3582
+ super(..._args);
3619
3583
  require_defineProperty._defineProperty(this, "module", require_IndexerGrpcWeb3GwApi.IndexerModule.Campaign);
3620
- require_defineProperty._defineProperty(this, "client", void 0);
3621
- this.client = new __injectivelabs_indexer_proto_ts_v2_generated_injective_campaign_rpc_pb_client.InjectiveCampaignRPCClient(this.transport);
3584
+ }
3585
+ get client() {
3586
+ return this.initClient(__injectivelabs_indexer_proto_ts_v2_generated_injective_campaign_rpc_pb_client.InjectiveCampaignRPCClient);
3622
3587
  }
3623
3588
  async fetchCampaign({ skip, limit, marketId, campaignId, accountAddress, contractAddress }) {
3624
3589
  const request = __injectivelabs_indexer_proto_ts_v2_generated_injective_campaign_rpc_pb.RankingRequest.create();
@@ -3685,11 +3650,12 @@ var IndexerGrpcCampaignApi = class extends require_BaseIndexerGrpcConsumer.BaseI
3685
3650
  * @category Indexer Grpc API
3686
3651
  */
3687
3652
  var IndexerGrpcArchiverApi = class extends require_BaseIndexerGrpcConsumer.BaseIndexerGrpcConsumer {
3688
- constructor(endpoint) {
3689
- super(endpoint);
3653
+ constructor(..._args) {
3654
+ super(..._args);
3690
3655
  require_defineProperty._defineProperty(this, "module", require_IndexerGrpcWeb3GwApi.IndexerModule.Archiver);
3691
- require_defineProperty._defineProperty(this, "client", void 0);
3692
- this.client = new __injectivelabs_indexer_proto_ts_v2_generated_injective_archiver_rpc_pb_client.InjectiveArchiverRPCClient(this.transport);
3656
+ }
3657
+ get client() {
3658
+ return this.initClient(__injectivelabs_indexer_proto_ts_v2_generated_injective_archiver_rpc_pb_client.InjectiveArchiverRPCClient);
3693
3659
  }
3694
3660
  async fetchHistoricalBalance({ account, resolution }) {
3695
3661
  const request = __injectivelabs_indexer_proto_ts_v2_generated_injective_archiver_rpc_pb.BalanceRequest.create();
@@ -3769,11 +3735,12 @@ var IndexerGrpcArchiverApi = class extends require_BaseIndexerGrpcConsumer.BaseI
3769
3735
  * @category Indexer Grpc API
3770
3736
  */
3771
3737
  var IndexerGrpcReferralApi = class extends require_BaseIndexerGrpcConsumer.BaseIndexerGrpcConsumer {
3772
- constructor(endpoint) {
3773
- super(endpoint);
3738
+ constructor(..._args) {
3739
+ super(..._args);
3774
3740
  require_defineProperty._defineProperty(this, "module", require_IndexerGrpcWeb3GwApi.IndexerModule.Referral);
3775
- require_defineProperty._defineProperty(this, "client", void 0);
3776
- this.client = new __injectivelabs_indexer_proto_ts_v2_generated_injective_referral_rpc_pb_client.InjectiveReferralRPCClient(this.transport);
3741
+ }
3742
+ get client() {
3743
+ return this.initClient(__injectivelabs_indexer_proto_ts_v2_generated_injective_referral_rpc_pb_client.InjectiveReferralRPCClient);
3777
3744
  }
3778
3745
  async fetchReferrerDetails(address) {
3779
3746
  const request = __injectivelabs_indexer_proto_ts_v2_generated_injective_referral_rpc_pb.GetReferrerDetailsRequest.create();
@@ -3801,11 +3768,12 @@ var IndexerGrpcReferralApi = class extends require_BaseIndexerGrpcConsumer.BaseI
3801
3768
  * @category Indexer Grpc API
3802
3769
  */
3803
3770
  var IndexerGrpcMegaVaultApi = class extends require_BaseIndexerGrpcConsumer.BaseIndexerGrpcConsumer {
3804
- constructor(endpoint) {
3805
- super(endpoint);
3771
+ constructor(..._args) {
3772
+ super(..._args);
3806
3773
  require_defineProperty._defineProperty(this, "module", require_IndexerGrpcWeb3GwApi.IndexerModule.MegaVault);
3807
- require_defineProperty._defineProperty(this, "client", void 0);
3808
- this.client = new __injectivelabs_indexer_proto_ts_v2_generated_injective_megavault_rpc_pb_client.InjectiveMegavaultRPCClient(this.transport);
3774
+ }
3775
+ get client() {
3776
+ return this.initClient(__injectivelabs_indexer_proto_ts_v2_generated_injective_megavault_rpc_pb_client.InjectiveMegavaultRPCClient);
3809
3777
  }
3810
3778
  async fetchVault({ vaultAddress }) {
3811
3779
  const request = __injectivelabs_indexer_proto_ts_v2_generated_injective_megavault_rpc_pb.GetVaultRequest.create();
@@ -3871,11 +3839,12 @@ var IndexerGrpcMegaVaultApi = class extends require_BaseIndexerGrpcConsumer.Base
3871
3839
  * @category Indexer Grpc API
3872
3840
  */
3873
3841
  var IndexerGrpcDerivativesApi = class extends require_BaseIndexerGrpcConsumer.BaseIndexerGrpcConsumer {
3874
- constructor(endpoint) {
3875
- super(endpoint);
3842
+ constructor(..._args) {
3843
+ super(..._args);
3876
3844
  require_defineProperty._defineProperty(this, "module", require_IndexerGrpcWeb3GwApi.IndexerModule.Derivatives);
3877
- require_defineProperty._defineProperty(this, "client", void 0);
3878
- this.client = new __injectivelabs_indexer_proto_ts_v2_generated_injective_derivative_exchange_rpc_pb_client.InjectiveDerivativeExchangeRPCClient(this.transport);
3845
+ }
3846
+ get client() {
3847
+ return this.initClient(__injectivelabs_indexer_proto_ts_v2_generated_injective_derivative_exchange_rpc_pb_client.InjectiveDerivativeExchangeRPCClient);
3879
3848
  }
3880
3849
  async fetchMarkets(params) {
3881
3850
  const { marketStatus, quoteDenom, marketStatuses } = params || {};
@@ -4086,11 +4055,12 @@ var IndexerGrpcDerivativesApi = class extends require_BaseIndexerGrpcConsumer.Ba
4086
4055
  * @category Indexer Grpc API
4087
4056
  */
4088
4057
  var IndexerGrpcAccountPortfolioApi = class extends require_BaseIndexerGrpcConsumer.BaseIndexerGrpcConsumer {
4089
- constructor(endpoint) {
4090
- super(endpoint);
4058
+ constructor(..._args) {
4059
+ super(..._args);
4091
4060
  require_defineProperty._defineProperty(this, "module", require_IndexerGrpcWeb3GwApi.IndexerModule.Portfolio);
4092
- require_defineProperty._defineProperty(this, "client", void 0);
4093
- this.client = new __injectivelabs_indexer_proto_ts_v2_generated_injective_portfolio_rpc_pb_client.InjectivePortfolioRPCClient(this.transport);
4061
+ }
4062
+ get client() {
4063
+ return this.initClient(__injectivelabs_indexer_proto_ts_v2_generated_injective_portfolio_rpc_pb_client.InjectivePortfolioRPCClient);
4094
4064
  }
4095
4065
  async fetchAccountPortfolio(address) {
4096
4066
  const request = __injectivelabs_indexer_proto_ts_v2_generated_injective_portfolio_rpc_pb.AccountPortfolioRequest.create();
@@ -4131,11 +4101,12 @@ var IndexerGrpcAccountPortfolioApi = class extends require_BaseIndexerGrpcConsum
4131
4101
  * @category Indexer Grpc API
4132
4102
  */
4133
4103
  var IndexerGrpcInsuranceFundApi = class extends require_BaseIndexerGrpcConsumer.BaseIndexerGrpcConsumer {
4134
- constructor(endpoint) {
4135
- super(endpoint);
4104
+ constructor(..._args) {
4105
+ super(..._args);
4136
4106
  require_defineProperty._defineProperty(this, "module", require_IndexerGrpcWeb3GwApi.IndexerModule.InsuranceFund);
4137
- require_defineProperty._defineProperty(this, "client", void 0);
4138
- this.client = new __injectivelabs_indexer_proto_ts_v2_generated_injective_insurance_rpc_pb_client.InjectiveInsuranceRPCClient(this.transport);
4107
+ }
4108
+ get client() {
4109
+ return this.initClient(__injectivelabs_indexer_proto_ts_v2_generated_injective_insurance_rpc_pb_client.InjectiveInsuranceRPCClient);
4139
4110
  }
4140
4111
  async fetchRedemptions({ denom, address, status }) {
4141
4112
  const request = __injectivelabs_indexer_proto_ts_v2_generated_injective_insurance_rpc_pb.RedemptionsRequest.create();
@@ -4632,7 +4603,7 @@ var IndexerRestLeaderboardChronosApi = class extends require_BaseRestConsumer.Ba
4632
4603
  };
4633
4604
 
4634
4605
  //#endregion
4635
- //#region src/client/indexer/grpc_stream/streamHelpers.ts
4606
+ //#region src/client/indexer/grpc_stream/stream/streamHelpers.ts
4636
4607
  /**
4637
4608
  * Creates a subscription wrapper for V2 streaming with proper cancellation support.
4638
4609
  *
@@ -4666,7 +4637,7 @@ function createStreamSubscription(stream, handleResponse, onEndCallback, onStatu
4666
4637
  }
4667
4638
 
4668
4639
  //#endregion
4669
- //#region src/client/indexer/grpc_stream/IndexerGrpcSpotStream.ts
4640
+ //#region src/client/indexer/grpc_stream/stream/IndexerGrpcSpotStream.ts
4670
4641
  /**
4671
4642
  * @category Indexer Grpc Stream
4672
4643
  * @description Provides streaming access to spot market data from Injective Indexer
@@ -4678,9 +4649,9 @@ var IndexerGrpcSpotStream = class {
4678
4649
  this.transport = new require_BaseGrpcConsumer.GrpcWebRpcTransport(endpoint, metadata);
4679
4650
  this.client = new __injectivelabs_indexer_proto_ts_v2_generated_injective_spot_exchange_rpc_pb_client.InjectiveSpotExchangeRPCClient(this.transport);
4680
4651
  }
4681
- /** @deprecated - use streamSpotOrderbookV2 */
4682
- streamSpotOrderbook(_args) {
4683
- throw new __injectivelabs_exceptions.GeneralException(/* @__PURE__ */ new Error("deprecated - use streamDerivativeOrderbookV2"));
4652
+ /** @deprecated - use streamOrderbookV2 */
4653
+ streamOrderbook(_args) {
4654
+ throw new __injectivelabs_exceptions.GeneralException(/* @__PURE__ */ new Error("deprecated - use streamOrderbookV2"));
4684
4655
  }
4685
4656
  /**
4686
4657
  * Stream spot orders
@@ -4693,7 +4664,7 @@ var IndexerGrpcSpotStream = class {
4693
4664
  * @param params.onStatusCallback - Called on stream errors
4694
4665
  * @returns Subscription object with unsubscribe method
4695
4666
  */
4696
- streamSpotOrders({ marketId, subaccountId, orderSide, callback, onEndCallback, onStatusCallback }) {
4667
+ streamOrders({ marketId, subaccountId, orderSide, callback, onEndCallback, onStatusCallback }) {
4697
4668
  if (typeof callback !== "function") throw new Error("callback must be a function");
4698
4669
  const request = __injectivelabs_indexer_proto_ts_v2_generated_injective_spot_exchange_rpc_pb.StreamOrdersRequest.create();
4699
4670
  if (marketId) request.marketId = marketId;
@@ -4717,7 +4688,7 @@ var IndexerGrpcSpotStream = class {
4717
4688
  * @param params.onStatusCallback - Called on stream errors
4718
4689
  * @returns Subscription object with unsubscribe method
4719
4690
  */
4720
- streamSpotOrderHistory({ marketId, subaccountId, orderTypes, executionTypes, direction, state, callback, onEndCallback, onStatusCallback }) {
4691
+ streamOrderHistory({ marketId, subaccountId, orderTypes, executionTypes, direction, state, callback, onEndCallback, onStatusCallback }) {
4721
4692
  if (typeof callback !== "function") throw new Error("callback must be a function");
4722
4693
  const request = __injectivelabs_indexer_proto_ts_v2_generated_injective_spot_exchange_rpc_pb.StreamOrdersHistoryRequest.create();
4723
4694
  if (subaccountId) request.subaccountId = subaccountId;
@@ -4745,7 +4716,7 @@ var IndexerGrpcSpotStream = class {
4745
4716
  * @param params.onStatusCallback - Called on stream errors
4746
4717
  * @returns Subscription object with unsubscribe method
4747
4718
  */
4748
- streamSpotTrades({ marketIds, marketId, subaccountIds, subaccountId, pagination, direction, executionSide, callback, onEndCallback, onStatusCallback }) {
4719
+ streamTrades({ marketIds, marketId, subaccountIds, subaccountId, pagination, direction, executionSide, callback, onEndCallback, onStatusCallback }) {
4749
4720
  if (typeof callback !== "function") throw new Error("callback must be a function");
4750
4721
  const request = __injectivelabs_indexer_proto_ts_v2_generated_injective_spot_exchange_rpc_pb.StreamTradesRequest.create();
4751
4722
  if (marketIds) request.marketIds = marketIds;
@@ -4771,7 +4742,7 @@ var IndexerGrpcSpotStream = class {
4771
4742
  * @param params.onStatusCallback - Called on stream errors
4772
4743
  * @returns Subscription object with unsubscribe method
4773
4744
  */
4774
- streamSpotMarket({ marketIds, callback, onEndCallback, onStatusCallback }) {
4745
+ streamMarkets({ marketIds, callback, onEndCallback, onStatusCallback }) {
4775
4746
  if (typeof callback !== "function") throw new Error("callback must be a function");
4776
4747
  const request = __injectivelabs_indexer_proto_ts_v2_generated_injective_spot_exchange_rpc_pb.StreamMarketsRequest.create();
4777
4748
  if (marketIds) request.marketIds = marketIds;
@@ -4788,7 +4759,7 @@ var IndexerGrpcSpotStream = class {
4788
4759
  * @param params.onStatusCallback - Called on stream errors
4789
4760
  * @returns Subscription object with unsubscribe method
4790
4761
  */
4791
- streamSpotOrderbookV2({ marketIds, callback, onEndCallback, onStatusCallback }) {
4762
+ streamOrderbooksV2({ marketIds, callback, onEndCallback, onStatusCallback }) {
4792
4763
  if (!marketIds || marketIds.length === 0) throw new Error("marketIds is required and cannot be empty");
4793
4764
  if (typeof callback !== "function") throw new Error("callback must be a function");
4794
4765
  const request = __injectivelabs_indexer_proto_ts_v2_generated_injective_spot_exchange_rpc_pb.StreamOrderbookV2Request.create();
@@ -4806,7 +4777,7 @@ var IndexerGrpcSpotStream = class {
4806
4777
  * @param params.onStatusCallback - Called on stream errors
4807
4778
  * @returns Subscription object with unsubscribe method
4808
4779
  */
4809
- streamSpotOrderbookUpdate({ marketIds, callback, onEndCallback, onStatusCallback }) {
4780
+ streamOrderbookUpdates({ marketIds, callback, onEndCallback, onStatusCallback }) {
4810
4781
  if (!marketIds || marketIds.length === 0) throw new Error("marketIds is required and cannot be empty");
4811
4782
  if (typeof callback !== "function") throw new Error("callback must be a function");
4812
4783
  const request = __injectivelabs_indexer_proto_ts_v2_generated_injective_spot_exchange_rpc_pb.StreamOrderbookUpdateRequest.create();
@@ -4818,7 +4789,7 @@ var IndexerGrpcSpotStream = class {
4818
4789
  };
4819
4790
 
4820
4791
  //#endregion
4821
- //#region src/client/indexer/grpc_stream/IndexerGrpcMitoStream.ts
4792
+ //#region src/client/indexer/grpc_stream/stream/IndexerGrpcMitoStream.ts
4822
4793
  /**
4823
4794
  * @category Indexer Grpc Stream
4824
4795
  * @description Provides streaming access to Mito vault data from Injective Indexer
@@ -4933,7 +4904,7 @@ var IndexerGrpcMitoStream = class {
4933
4904
  };
4934
4905
 
4935
4906
  //#endregion
4936
- //#region src/client/indexer/grpc_stream/IndexerGrpcOracleStream.ts
4907
+ //#region src/client/indexer/grpc_stream/stream/IndexerGrpcOracleStream.ts
4937
4908
  /**
4938
4909
  * @category Indexer Grpc Stream
4939
4910
  * @description Provides streaming access to oracle price data from Injective Indexer
@@ -4987,7 +4958,7 @@ var IndexerGrpcOracleStream = class {
4987
4958
  };
4988
4959
 
4989
4960
  //#endregion
4990
- //#region src/client/indexer/grpc_stream/IndexerGrpcAccountStream.ts
4961
+ //#region src/client/indexer/grpc_stream/stream/IndexerGrpcAccountStream.ts
4991
4962
  /**
4992
4963
  * @category Indexer Grpc Stream
4993
4964
  * @description Provides streaming access to account data from the Injective Indexer
@@ -5020,7 +4991,7 @@ var IndexerGrpcAccountStream = class {
5020
4991
  };
5021
4992
 
5022
4993
  //#endregion
5023
- //#region src/client/indexer/grpc_stream/IndexerGrpcAuctionStream.ts
4994
+ //#region src/client/indexer/grpc_stream/stream/IndexerGrpcAuctionStream.ts
5024
4995
  /**
5025
4996
  * @category Indexer Grpc Stream
5026
4997
  * @description Provides streaming access to auction data from Injective Indexer
@@ -5050,7 +5021,7 @@ var IndexerGrpcAuctionStream = class {
5050
5021
  };
5051
5022
 
5052
5023
  //#endregion
5053
- //#region src/client/indexer/grpc_stream/IndexerGrpcTradingStream.ts
5024
+ //#region src/client/indexer/grpc_stream/stream/IndexerGrpcTradingStream.ts
5054
5025
  /**
5055
5026
  * @category Indexer Grid Strategy Grpc Stream
5056
5027
  * @description Provides streaming access to grid strategy data from Injective Indexer
@@ -5085,7 +5056,7 @@ var IndexerGrpcTradingStream = class {
5085
5056
  };
5086
5057
 
5087
5058
  //#endregion
5088
- //#region src/client/indexer/grpc_stream/IndexerGrpcArchiverStream.ts
5059
+ //#region src/client/indexer/grpc_stream/stream/IndexerGrpcArchiverStream.ts
5089
5060
  /**
5090
5061
  * @category Indexer Grpc Stream
5091
5062
  * @description Provides streaming access to archiver data from Injective Indexer
@@ -5118,7 +5089,7 @@ var IndexerGrpcArchiverStream = class {
5118
5089
  };
5119
5090
 
5120
5091
  //#endregion
5121
- //#region src/client/indexer/grpc_stream/IndexerGrpcExplorerStream.ts
5092
+ //#region src/client/indexer/grpc_stream/stream/IndexerGrpcExplorerStream.ts
5122
5093
  /**
5123
5094
  * @category Indexer Grpc Stream
5124
5095
  * @description Provides streaming access to blockchain explorer data from Injective Indexer
@@ -5178,7 +5149,7 @@ var IndexerGrpcExplorerStream = class {
5178
5149
  };
5179
5150
 
5180
5151
  //#endregion
5181
- //#region src/client/indexer/grpc_stream/IndexerGrpcDerivativesStream.ts
5152
+ //#region src/client/indexer/grpc_stream/stream/IndexerGrpcDerivativesStream.ts
5182
5153
  /**
5183
5154
  * @category Indexer Grpc Stream
5184
5155
  * @description Provides streaming access to derivatives market data from Injective Indexer
@@ -5368,7 +5339,7 @@ var IndexerGrpcDerivativesStream = class {
5368
5339
  };
5369
5340
 
5370
5341
  //#endregion
5371
- //#region src/client/indexer/grpc_stream/IndexerGrpcAccountPortfolioStream.ts
5342
+ //#region src/client/indexer/grpc_stream/stream/IndexerGrpcAccountPortfolioStream.ts
5372
5343
  /**
5373
5344
  * @category Indexer Grpc Stream
5374
5345
  * @description Provides streaming access to account portfolio data from Injective Indexer
@@ -5405,129 +5376,1110 @@ var IndexerGrpcAccountPortfolioStream = class {
5405
5376
  };
5406
5377
 
5407
5378
  //#endregion
5408
- Object.defineProperty(exports, 'ExplorerStreamTransformer', {
5409
- enumerable: true,
5410
- get: function () {
5411
- return ExplorerStreamTransformer;
5412
- }
5413
- });
5414
- Object.defineProperty(exports, 'IndexerAccountPortfolioStreamTransformer', {
5415
- enumerable: true,
5416
- get: function () {
5417
- return IndexerAccountPortfolioStreamTransformer;
5418
- }
5419
- });
5420
- Object.defineProperty(exports, 'IndexerAccountStreamTransformer', {
5421
- enumerable: true,
5422
- get: function () {
5423
- return IndexerAccountStreamTransformer;
5424
- }
5425
- });
5426
- Object.defineProperty(exports, 'IndexerArchiverStreamTransformer', {
5427
- enumerable: true,
5428
- get: function () {
5429
- return IndexerArchiverStreamTransformer;
5430
- }
5431
- });
5432
- Object.defineProperty(exports, 'IndexerAuctionStreamTransformer', {
5433
- enumerable: true,
5434
- get: function () {
5435
- return IndexerAuctionStreamTransformer;
5436
- }
5437
- });
5438
- Object.defineProperty(exports, 'IndexerCampaignTransformer', {
5439
- enumerable: true,
5440
- get: function () {
5441
- return IndexerCampaignTransformer;
5442
- }
5443
- });
5444
- Object.defineProperty(exports, 'IndexerDerivativeStreamTransformer', {
5445
- enumerable: true,
5446
- get: function () {
5447
- return IndexerDerivativeStreamTransformer;
5448
- }
5449
- });
5450
- Object.defineProperty(exports, 'IndexerGrpcAccountApi', {
5451
- enumerable: true,
5452
- get: function () {
5453
- return IndexerGrpcAccountApi;
5454
- }
5455
- });
5456
- Object.defineProperty(exports, 'IndexerGrpcAccountPortfolioApi', {
5457
- enumerable: true,
5458
- get: function () {
5459
- return IndexerGrpcAccountPortfolioApi;
5460
- }
5461
- });
5462
- Object.defineProperty(exports, 'IndexerGrpcAccountPortfolioStream', {
5463
- enumerable: true,
5464
- get: function () {
5465
- return IndexerGrpcAccountPortfolioStream;
5466
- }
5467
- });
5468
- Object.defineProperty(exports, 'IndexerGrpcAccountPortfolioTransformer', {
5469
- enumerable: true,
5470
- get: function () {
5471
- return IndexerGrpcAccountPortfolioTransformer;
5472
- }
5473
- });
5474
- Object.defineProperty(exports, 'IndexerGrpcAccountStream', {
5475
- enumerable: true,
5476
- get: function () {
5477
- return IndexerGrpcAccountStream;
5478
- }
5479
- });
5480
- Object.defineProperty(exports, 'IndexerGrpcAccountTransformer', {
5481
- enumerable: true,
5482
- get: function () {
5483
- return IndexerGrpcAccountTransformer;
5484
- }
5485
- });
5486
- Object.defineProperty(exports, 'IndexerGrpcArchiverApi', {
5487
- enumerable: true,
5488
- get: function () {
5489
- return IndexerGrpcArchiverApi;
5490
- }
5491
- });
5492
- Object.defineProperty(exports, 'IndexerGrpcArchiverStream', {
5493
- enumerable: true,
5494
- get: function () {
5495
- return IndexerGrpcArchiverStream;
5496
- }
5497
- });
5498
- Object.defineProperty(exports, 'IndexerGrpcArchiverTransformer', {
5499
- enumerable: true,
5500
- get: function () {
5501
- return IndexerGrpcArchiverTransformer;
5502
- }
5503
- });
5504
- Object.defineProperty(exports, 'IndexerGrpcAuctionApi', {
5505
- enumerable: true,
5506
- get: function () {
5507
- return IndexerGrpcAuctionApi;
5508
- }
5509
- });
5510
- Object.defineProperty(exports, 'IndexerGrpcAuctionStream', {
5511
- enumerable: true,
5512
- get: function () {
5513
- return IndexerGrpcAuctionStream;
5514
- }
5515
- });
5516
- Object.defineProperty(exports, 'IndexerGrpcAuctionTransformer', {
5517
- enumerable: true,
5518
- get: function () {
5519
- return IndexerGrpcAuctionTransformer;
5520
- }
5521
- });
5522
- Object.defineProperty(exports, 'IndexerGrpcCampaignApi', {
5523
- enumerable: true,
5524
- get: function () {
5525
- return IndexerGrpcCampaignApi;
5526
- }
5527
- });
5528
- Object.defineProperty(exports, 'IndexerGrpcDerivativeTransformer', {
5529
- enumerable: true,
5530
- get: function () {
5379
+ //#region src/client/indexer/grpc_stream/stream/StreamManager.ts
5380
+ /**
5381
+ * StreamManager - Simple registry for managing multiple V1 stream subscriptions by key
5382
+ *
5383
+ * This is a lightweight utility for storing and canceling multiple V1 RxJS-based streams.
5384
+ * For V2 streams with advanced lifecycle management and retry logic, use StreamManagerV2.
5385
+ */
5386
+ var StreamManager = class {
5387
+ constructor() {
5388
+ require_defineProperty._defineProperty(this, "streams", /* @__PURE__ */ new Map());
5389
+ }
5390
+ set(stream, streamKey) {
5391
+ if (this.streams.has(streamKey)) throw new Error(`Stream ${streamKey} already exists`);
5392
+ this.streams.set(streamKey, stream);
5393
+ }
5394
+ get(streamKey) {
5395
+ if (!this.streams.has(streamKey)) throw new Error(`Stream ${streamKey} is not found`);
5396
+ return this.streams.get(streamKey);
5397
+ }
5398
+ exists(streamKey) {
5399
+ return this.streams.has(streamKey);
5400
+ }
5401
+ cancelAll() {
5402
+ this.streams.forEach((stream) => {
5403
+ stream.cancel();
5404
+ });
5405
+ this.streams = /* @__PURE__ */ new Map();
5406
+ }
5407
+ cancel(streamKey) {
5408
+ if (!this.streams.has(streamKey)) throw new Error(`Stream ${streamKey} is not found`);
5409
+ this.streams.get(streamKey).cancel();
5410
+ this.streams.delete(streamKey);
5411
+ }
5412
+ cancelIfExists(streamKey) {
5413
+ if (!this.streams.has(streamKey)) return;
5414
+ this.streams.get(streamKey).cancel();
5415
+ this.streams.delete(streamKey);
5416
+ }
5417
+ };
5418
+
5419
+ //#endregion
5420
+ //#region src/client/indexer/grpc_stream/streamV2/streamHelpersV2.ts
5421
+ /**
5422
+ * Extracts detailed error information from a gRPC/RpcError object.
5423
+ *
5424
+ * gRPC-web errors typically have these properties:
5425
+ * - code: gRPC status code (number)
5426
+ * - message: Error message
5427
+ * - name: 'RpcError'
5428
+ * - methodName: The RPC method that failed
5429
+ * - serviceName: The service name
5430
+ * - metadata: Response metadata/trailers
5431
+ */
5432
+ function extractGrpcError(error) {
5433
+ let code = require_types.GrpcStatusCode.UNKNOWN;
5434
+ let details = "Unknown stream error";
5435
+ let metadata = void 0;
5436
+ if (error && typeof error === "object") {
5437
+ if ("code" in error && typeof error.code === "number") code = error.code;
5438
+ if ("message" in error && typeof error.message === "string") details = error.message;
5439
+ else if ("details" in error && typeof error.details === "string") details = error.details;
5440
+ const errorObj = error;
5441
+ metadata = {
5442
+ originalError: error,
5443
+ ..."name" in errorObj && { errorName: errorObj.name },
5444
+ ..."methodName" in errorObj && { methodName: errorObj.methodName },
5445
+ ..."serviceName" in errorObj && { serviceName: errorObj.serviceName },
5446
+ ..."metadata" in errorObj && { grpcMetadata: errorObj.metadata }
5447
+ };
5448
+ } else if (error instanceof Error) {
5449
+ details = error.message;
5450
+ metadata = {
5451
+ originalError: error,
5452
+ stack: error.stack
5453
+ };
5454
+ }
5455
+ return {
5456
+ code,
5457
+ details,
5458
+ metadata
5459
+ };
5460
+ }
5461
+ /**
5462
+ * Creates an event-based subscription for StreamManager V2.
5463
+ * This emits 'error' and 'complete' events instead of using callbacks.
5464
+ *
5465
+ * Error Handling:
5466
+ * - gRPC errors are extracted with full metadata and emitted as 'error' events
5467
+ * - User callback errors are caught and emitted separately to distinguish from stream errors
5468
+ * - Aborted streams don't emit any events (clean shutdown)
5469
+ *
5470
+ * @param stream - The ServerStreamingCall from the V2 client
5471
+ * @param handleResponse - Callback to process each stream response
5472
+ * @returns StreamSubscription with event emitters for error/complete
5473
+ */
5474
+ function createStreamSubscriptionV2(stream, handleResponse) {
5475
+ const emitter = new eventemitter3.EventEmitter();
5476
+ const abortController = new AbortController();
5477
+ let hasEmittedTerminalEvent = false;
5478
+ const subscription = {
5479
+ unsubscribe: () => {
5480
+ abortController.abort();
5481
+ emitter.removeAllListeners();
5482
+ },
5483
+ on: (event, handler) => {
5484
+ emitter.on(event, handler);
5485
+ },
5486
+ off: (event, handler) => {
5487
+ emitter.off(event, handler);
5488
+ }
5489
+ };
5490
+ (async () => {
5491
+ try {
5492
+ for await (const response of stream.responses) {
5493
+ if (abortController.signal.aborted) return;
5494
+ try {
5495
+ handleResponse(response);
5496
+ } catch (callbackError) {
5497
+ if (!abortController.signal.aborted && !hasEmittedTerminalEvent) {
5498
+ hasEmittedTerminalEvent = true;
5499
+ const streamError = {
5500
+ code: require_types.GrpcStatusCode.INTERNAL,
5501
+ details: callbackError instanceof Error ? `Callback error: ${callbackError.message}` : "Callback error: Unknown",
5502
+ metadata: {
5503
+ type: "callback-error",
5504
+ originalError: callbackError,
5505
+ stack: callbackError instanceof Error ? callbackError.stack : void 0
5506
+ }
5507
+ };
5508
+ emitter.emit("error", streamError);
5509
+ }
5510
+ return;
5511
+ }
5512
+ }
5513
+ if (!abortController.signal.aborted && !hasEmittedTerminalEvent) {
5514
+ hasEmittedTerminalEvent = true;
5515
+ emitter.emit("complete");
5516
+ }
5517
+ } catch (error) {
5518
+ if (!abortController.signal.aborted && !hasEmittedTerminalEvent) {
5519
+ hasEmittedTerminalEvent = true;
5520
+ const streamError = extractGrpcError(error);
5521
+ emitter.emit("error", streamError);
5522
+ }
5523
+ }
5524
+ })();
5525
+ return subscription;
5526
+ }
5527
+
5528
+ //#endregion
5529
+ //#region src/client/indexer/grpc_stream/streamV2/IndexerGrpcSpotStreamV2.ts
5530
+ var IndexerGrpcSpotStreamV2 = class {
5531
+ constructor(endpoint, metadata) {
5532
+ require_defineProperty._defineProperty(this, "client", void 0);
5533
+ require_defineProperty._defineProperty(this, "transport", void 0);
5534
+ this.transport = new require_BaseGrpcConsumer.GrpcWebRpcTransport(endpoint, metadata);
5535
+ this.client = new __injectivelabs_indexer_proto_ts_v2_generated_injective_spot_exchange_rpc_pb_client.InjectiveSpotExchangeRPCClient(this.transport);
5536
+ }
5537
+ /**
5538
+ * Stream spot orderbook updates
5539
+ * @param params.marketIds - Array of market IDs to stream
5540
+ * @param params.callback - Called for each orderbook update
5541
+ * @returns StreamSubscription
5542
+ */
5543
+ streamOrderbookUpdates({ marketIds, callback }) {
5544
+ if (!marketIds || marketIds.length === 0) throw new Error("marketIds is required");
5545
+ if (typeof callback !== "function") throw new Error("callback must be a function");
5546
+ const request = __injectivelabs_indexer_proto_ts_v2_generated_injective_spot_exchange_rpc_pb.StreamOrderbookUpdateRequest.create();
5547
+ request.marketIds = marketIds;
5548
+ return createStreamSubscriptionV2(this.client.streamOrderbookUpdate(request), (response) => {
5549
+ callback(IndexerSpotStreamTransformer.orderbookUpdateStreamCallback(response));
5550
+ });
5551
+ }
5552
+ /**
5553
+ * Stream spot orders
5554
+ * @param params.marketId - Optional market ID to filter
5555
+ * @param params.subaccountId - Optional subaccount ID to filter
5556
+ * @param params.orderSide - Optional order side to filter
5557
+ * @param params.callback - Called for each order update
5558
+ * @returns StreamSubscription
5559
+ */
5560
+ streamOrders({ marketId, subaccountId, orderSide, callback }) {
5561
+ if (typeof callback !== "function") throw new Error("callback must be a function");
5562
+ const request = __injectivelabs_indexer_proto_ts_v2_generated_injective_spot_exchange_rpc_pb.StreamOrdersRequest.create();
5563
+ if (marketId) request.marketId = marketId;
5564
+ if (subaccountId) request.subaccountId = subaccountId;
5565
+ if (orderSide) request.orderSide = orderSide;
5566
+ return createStreamSubscriptionV2(this.client.streamOrders(request), (response) => {
5567
+ callback(IndexerSpotStreamTransformer.ordersStreamCallback(response));
5568
+ });
5569
+ }
5570
+ /**
5571
+ * Stream spot order history
5572
+ * @param params.subaccountId - Optional subaccount ID to filter
5573
+ * @param params.marketId - Optional market ID to filter
5574
+ * @param params.orderTypes - Optional order types to filter
5575
+ * @param params.direction - Optional direction to filter
5576
+ * @param params.state - Optional state to filter
5577
+ * @param params.executionTypes - Optional execution types to filter
5578
+ * @param params.callback - Called for each order history update
5579
+ * @returns StreamSubscription
5580
+ */
5581
+ streamOrderHistory({ subaccountId, marketId, orderTypes, direction, state, executionTypes, callback }) {
5582
+ if (typeof callback !== "function") throw new Error("callback must be a function");
5583
+ const request = __injectivelabs_indexer_proto_ts_v2_generated_injective_spot_exchange_rpc_pb.StreamOrdersHistoryRequest.create();
5584
+ if (subaccountId) request.subaccountId = subaccountId;
5585
+ if (marketId) request.marketId = marketId;
5586
+ if (orderTypes) request.orderTypes = orderTypes;
5587
+ if (direction) request.direction = direction;
5588
+ if (state) request.state = state;
5589
+ if (executionTypes) request.executionTypes = executionTypes;
5590
+ return createStreamSubscriptionV2(this.client.streamOrdersHistory(request), (response) => {
5591
+ callback(IndexerSpotStreamTransformer.orderHistoryStreamCallback(response));
5592
+ });
5593
+ }
5594
+ /**
5595
+ * Stream spot trades
5596
+ * @param params.marketId - Optional market ID to filter
5597
+ * @param params.marketIds - Optional array of market IDs to filter
5598
+ * @param params.subaccountId - Optional subaccount ID to filter
5599
+ * @param params.subaccountIds - Optional array of subaccount IDs to filter
5600
+ * @param params.executionSide - Optional execution side to filter
5601
+ * @param params.direction - Optional direction to filter
5602
+ * @param params.executionTypes - Optional execution types to filter
5603
+ * @param params.callback - Called for each trade update
5604
+ * @returns StreamSubscription
5605
+ */
5606
+ streamTrades({ marketId, marketIds, subaccountId, subaccountIds, executionSide, direction, executionTypes, callback }) {
5607
+ if (typeof callback !== "function") throw new Error("callback must be a function");
5608
+ const request = __injectivelabs_indexer_proto_ts_v2_generated_injective_spot_exchange_rpc_pb.StreamTradesRequest.create();
5609
+ if (marketId) request.marketId = marketId;
5610
+ if (marketIds) request.marketIds = marketIds;
5611
+ if (subaccountId) request.subaccountId = subaccountId;
5612
+ if (subaccountIds) request.subaccountIds = subaccountIds;
5613
+ if (executionSide) request.executionSide = executionSide;
5614
+ if (direction) request.direction = direction;
5615
+ if (executionTypes) request.executionTypes = executionTypes;
5616
+ return createStreamSubscriptionV2(this.client.streamTrades(request), (response) => {
5617
+ callback(IndexerSpotStreamTransformer.tradesStreamCallback(response));
5618
+ });
5619
+ }
5620
+ };
5621
+
5622
+ //#endregion
5623
+ //#region src/client/indexer/grpc_stream/streamV2/IndexerGrpcMitoStreamV2.ts
5624
+ var IndexerGrpcMitoStreamV2 = class {
5625
+ constructor(endpoint, metadata) {
5626
+ require_defineProperty._defineProperty(this, "client", void 0);
5627
+ require_defineProperty._defineProperty(this, "transport", void 0);
5628
+ this.transport = new require_BaseGrpcConsumer.GrpcWebRpcTransport(endpoint, metadata);
5629
+ this.client = new __injectivelabs_mito_proto_ts_v2_generated_goadesign_goagen_mito_api_pb_client.MitoAPIClient(this.transport);
5630
+ }
5631
+ /**
5632
+ * Stream vault transfers
5633
+ * @param params.vault - Optional vault address to filter
5634
+ * @param params.account - Optional account address to filter
5635
+ * @param params.callback - Called for each transfer update
5636
+ * @returns StreamSubscription
5637
+ */
5638
+ streamTransfers({ vault, account, callback }) {
5639
+ if (typeof callback !== "function") throw new Error("callback must be a function");
5640
+ const request = __injectivelabs_mito_proto_ts_v2_generated_goadesign_goagen_mito_api_pb.StreamTransfersRequest.create();
5641
+ if (vault) request.vault = vault;
5642
+ if (account) request.account = account;
5643
+ return createStreamSubscriptionV2(this.client.streamTransfers(request), (response) => {
5644
+ callback(IndexerGrpcMitoStreamTransformer.transfersStreamCallback(response));
5645
+ });
5646
+ }
5647
+ /**
5648
+ * Stream vault information
5649
+ * @param params.vault - Optional vault address to filter
5650
+ * @param params.callback - Called for each vault update
5651
+ * @returns StreamSubscription
5652
+ */
5653
+ streamVault({ vault, callback }) {
5654
+ if (typeof callback !== "function") throw new Error("callback must be a function");
5655
+ const request = __injectivelabs_mito_proto_ts_v2_generated_goadesign_goagen_mito_api_pb.StreamVaultRequest.create();
5656
+ if (vault) request.vault = vault;
5657
+ return createStreamSubscriptionV2(this.client.streamVault(request), (response) => {
5658
+ callback(IndexerGrpcMitoStreamTransformer.vaultStreamCallback(response));
5659
+ });
5660
+ }
5661
+ /**
5662
+ * Stream vault holder subscriptions
5663
+ * @param params.holderAddress - The holder address to stream subscriptions for
5664
+ * @param params.vaultAddress - Optional vault address to filter
5665
+ * @param params.stakingContractAddress - Optional staking contract address to filter
5666
+ * @param params.callback - Called for each subscription update
5667
+ * @returns StreamSubscription
5668
+ */
5669
+ streamVaultHolderSubscriptions({ holderAddress, vaultAddress, stakingContractAddress, callback }) {
5670
+ if (!holderAddress) throw new Error("holderAddress is required");
5671
+ if (typeof callback !== "function") throw new Error("callback must be a function");
5672
+ const request = __injectivelabs_mito_proto_ts_v2_generated_goadesign_goagen_mito_api_pb.StreamHolderSubscriptionRequest.create();
5673
+ request.holderAddress = holderAddress;
5674
+ if (vaultAddress) request.vaultAddress = vaultAddress;
5675
+ if (stakingContractAddress) request.stakingContractAddress = stakingContractAddress;
5676
+ return createStreamSubscriptionV2(this.client.streamHolderSubscription(request), (response) => {
5677
+ callback(IndexerGrpcMitoStreamTransformer.vaultHolderSubscriptionStreamCallback(response));
5678
+ });
5679
+ }
5680
+ /**
5681
+ * Stream staking rewards by account
5682
+ * @param params.staker - The staker address to stream rewards for
5683
+ * @param params.stakingContractAddress - The staking contract address
5684
+ * @param params.callback - Called for each reward update
5685
+ * @returns StreamSubscription
5686
+ */
5687
+ streamStakingRewardsByAccount({ staker, stakingContractAddress, callback }) {
5688
+ if (!staker) throw new Error("staker is required");
5689
+ if (!stakingContractAddress) throw new Error("stakingContractAddress is required");
5690
+ if (typeof callback !== "function") throw new Error("callback must be a function");
5691
+ const request = __injectivelabs_mito_proto_ts_v2_generated_goadesign_goagen_mito_api_pb.StreamStakingRewardByAccountRequest.create();
5692
+ request.staker = staker;
5693
+ request.stakingContractAddress = stakingContractAddress;
5694
+ return createStreamSubscriptionV2(this.client.streamStakingRewardByAccount(request), (response) => {
5695
+ callback(IndexerGrpcMitoStreamTransformer.stakingRewardByAccountStreamCallback(response));
5696
+ });
5697
+ }
5698
+ /**
5699
+ * Stream historical staking data
5700
+ * @param params.staker - The staker address to stream data for
5701
+ * @param params.stakingContractAddress - The staking contract address
5702
+ * @param params.callback - Called for each historical staking update
5703
+ * @returns StreamSubscription
5704
+ */
5705
+ streamHistoricalStaking({ staker, stakingContractAddress, callback }) {
5706
+ if (!staker) throw new Error("staker is required");
5707
+ if (!stakingContractAddress) throw new Error("stakingContractAddress is required");
5708
+ if (typeof callback !== "function") throw new Error("callback must be a function");
5709
+ const request = __injectivelabs_mito_proto_ts_v2_generated_goadesign_goagen_mito_api_pb.StreamHistoricalStakingRequest.create();
5710
+ request.staker = staker;
5711
+ request.stakingContractAddress = stakingContractAddress;
5712
+ return createStreamSubscriptionV2(this.client.streamHistoricalStaking(request), (response) => {
5713
+ callback(IndexerGrpcMitoStreamTransformer.historicalStakingStreamCallback(response));
5714
+ });
5715
+ }
5716
+ };
5717
+
5718
+ //#endregion
5719
+ //#region src/client/indexer/grpc_stream/streamV2/IndexerGrpcOracleStreamV2.ts
5720
+ var IndexerGrpcOracleStreamV2 = class {
5721
+ constructor(endpoint, metadata) {
5722
+ require_defineProperty._defineProperty(this, "client", void 0);
5723
+ require_defineProperty._defineProperty(this, "transport", void 0);
5724
+ this.transport = new require_BaseGrpcConsumer.GrpcWebRpcTransport(endpoint, metadata);
5725
+ this.client = new __injectivelabs_indexer_proto_ts_v2_generated_injective_oracle_rpc_pb_client.InjectiveOracleRPCClient(this.transport);
5726
+ }
5727
+ /**
5728
+ * Stream oracle price updates
5729
+ * @param params.oracleType - The oracle type to stream prices for
5730
+ * @param params.baseSymbol - Optional base symbol filter
5731
+ * @param params.quoteSymbol - Optional quote symbol filter
5732
+ * @param params.callback - Called for each price update
5733
+ * @returns StreamSubscription
5734
+ */
5735
+ streamOraclePrices({ oracleType, baseSymbol, quoteSymbol, callback }) {
5736
+ if (!oracleType) throw new Error("oracleType is required");
5737
+ if (typeof callback !== "function") throw new Error("callback must be a function");
5738
+ const request = __injectivelabs_indexer_proto_ts_v2_generated_injective_oracle_rpc_pb.StreamPricesRequest.create();
5739
+ if (baseSymbol) request.baseSymbol = baseSymbol;
5740
+ if (quoteSymbol) request.quoteSymbol = quoteSymbol;
5741
+ request.oracleType = oracleType;
5742
+ return createStreamSubscriptionV2(this.client.streamPrices(request), (response) => {
5743
+ callback(IndexerOracleStreamTransformer.pricesStreamCallback(response));
5744
+ });
5745
+ }
5746
+ /**
5747
+ * Stream oracle prices by markets
5748
+ * @param params.marketIds - Optional array of market IDs to filter
5749
+ * @param params.callback - Called for each price update
5750
+ * @returns StreamSubscription
5751
+ */
5752
+ streamOraclePricesByMarkets({ marketIds, callback }) {
5753
+ if (typeof callback !== "function") throw new Error("callback must be a function");
5754
+ const request = __injectivelabs_indexer_proto_ts_v2_generated_injective_oracle_rpc_pb.StreamPricesByMarketsRequest.create();
5755
+ if (marketIds) request.marketIds = marketIds;
5756
+ return createStreamSubscriptionV2(this.client.streamPricesByMarkets(request), (response) => {
5757
+ callback(IndexerOracleStreamTransformer.pricesByMarketsCallback(response));
5758
+ });
5759
+ }
5760
+ };
5761
+
5762
+ //#endregion
5763
+ //#region src/client/indexer/grpc_stream/streamV2/IndexerGrpcAccountStreamV2.ts
5764
+ var IndexerGrpcAccountStreamV2 = class {
5765
+ constructor(endpoint, metadata) {
5766
+ require_defineProperty._defineProperty(this, "client", void 0);
5767
+ require_defineProperty._defineProperty(this, "transport", void 0);
5768
+ this.transport = new require_BaseGrpcConsumer.GrpcWebRpcTransport(endpoint, metadata);
5769
+ this.client = new __injectivelabs_indexer_proto_ts_v2_generated_injective_accounts_rpc_pb_client.InjectiveAccountsRPCClient(this.transport);
5770
+ }
5771
+ /**
5772
+ * Stream subaccount balance updates
5773
+ * @param params.subaccountId - The subaccount ID to stream balance for
5774
+ * @param params.callback - Called for each balance update
5775
+ * @returns StreamSubscription
5776
+ */
5777
+ streamSubaccountBalance({ subaccountId, callback }) {
5778
+ if (!subaccountId) throw new Error("subaccountId is required");
5779
+ if (typeof callback !== "function") throw new Error("callback must be a function");
5780
+ const request = __injectivelabs_indexer_proto_ts_v2_generated_injective_accounts_rpc_pb.StreamSubaccountBalanceRequest.create();
5781
+ request.subaccountId = subaccountId;
5782
+ return createStreamSubscriptionV2(this.client.streamSubaccountBalance(request), (response) => {
5783
+ callback(IndexerAccountStreamTransformer.balanceStreamCallback(response));
5784
+ });
5785
+ }
5786
+ };
5787
+
5788
+ //#endregion
5789
+ //#region src/client/indexer/grpc_stream/streamV2/IndexerGrpcAuctionStreamV2.ts
5790
+ var IndexerGrpcAuctionStreamV2 = class {
5791
+ constructor(endpoint, metadata) {
5792
+ require_defineProperty._defineProperty(this, "client", void 0);
5793
+ require_defineProperty._defineProperty(this, "transport", void 0);
5794
+ this.transport = new require_BaseGrpcConsumer.GrpcWebRpcTransport(endpoint, metadata);
5795
+ this.client = new __injectivelabs_indexer_proto_ts_v2_generated_injective_auction_rpc_pb_client.InjectiveAuctionRPCClient(this.transport);
5796
+ }
5797
+ /**
5798
+ * Stream auction bids
5799
+ * @param params.callback - Called for each bid update
5800
+ * @returns StreamSubscription
5801
+ */
5802
+ streamBids({ callback }) {
5803
+ if (typeof callback !== "function") throw new Error("callback must be a function");
5804
+ const request = __injectivelabs_indexer_proto_ts_v2_generated_injective_auction_rpc_pb.StreamBidsRequest.create();
5805
+ return createStreamSubscriptionV2(this.client.streamBids(request), (response) => {
5806
+ callback(IndexerAuctionStreamTransformer.bidsStreamCallback(response));
5807
+ });
5808
+ }
5809
+ };
5810
+
5811
+ //#endregion
5812
+ //#region src/client/indexer/grpc_stream/streamV2/IndexerGrpcTradingStreamV2.ts
5813
+ var IndexerGrpcTradingStreamV2 = class {
5814
+ constructor(endpoint, metadata) {
5815
+ require_defineProperty._defineProperty(this, "client", void 0);
5816
+ require_defineProperty._defineProperty(this, "transport", void 0);
5817
+ this.transport = new require_BaseGrpcConsumer.GrpcWebRpcTransport(endpoint, metadata);
5818
+ this.client = new __injectivelabs_indexer_proto_ts_v2_generated_injective_trading_rpc_pb_client.InjectiveTradingRPCClient(this.transport);
5819
+ }
5820
+ /**
5821
+ * Stream grid strategies
5822
+ * @param params.marketId - Optional market ID to filter strategies
5823
+ * @param params.accountAddresses - Optional array of account addresses to filter
5824
+ * @param params.callback - Called for each strategy update
5825
+ * @returns StreamSubscription
5826
+ */
5827
+ streamGridStrategies({ marketId, accountAddresses, callback }) {
5828
+ if ((!accountAddresses || accountAddresses.length === 0) && !marketId) throw new Error("accountAddresses or marketId is required");
5829
+ if (typeof callback !== "function") throw new Error("callback must be a function");
5830
+ const request = __injectivelabs_indexer_proto_ts_v2_generated_injective_trading_rpc_pb.StreamStrategyRequest.create();
5831
+ if (accountAddresses) request.accountAddresses = accountAddresses;
5832
+ if (marketId) request.marketId = marketId;
5833
+ return createStreamSubscriptionV2(this.client.streamStrategy(request), (response) => {
5834
+ callback(response);
5835
+ });
5836
+ }
5837
+ };
5838
+
5839
+ //#endregion
5840
+ //#region src/client/indexer/grpc_stream/streamV2/IndexerGrpcArchiverStreamV2.ts
5841
+ var IndexerGrpcArchiverStreamV2 = class {
5842
+ constructor(endpoint, metadata) {
5843
+ require_defineProperty._defineProperty(this, "client", void 0);
5844
+ require_defineProperty._defineProperty(this, "transport", void 0);
5845
+ this.transport = new require_BaseGrpcConsumer.GrpcWebRpcTransport(endpoint, metadata);
5846
+ this.client = new __injectivelabs_indexer_proto_ts_v2_generated_injective_archiver_rpc_pb_client.InjectiveArchiverRPCClient(this.transport);
5847
+ }
5848
+ /**
5849
+ * Stream spot average entries
5850
+ * @param params.account - The account address to stream entries for
5851
+ * @param params.callback - Called for each average entry update
5852
+ * @returns StreamSubscription
5853
+ */
5854
+ streamSpotAverageEntries({ account, callback }) {
5855
+ if (!account) throw new Error("account is required");
5856
+ if (typeof callback !== "function") throw new Error("callback must be a function");
5857
+ const request = __injectivelabs_indexer_proto_ts_v2_generated_injective_archiver_rpc_pb.StreamSpotAverageEntriesRequest.create();
5858
+ request.account = account;
5859
+ return createStreamSubscriptionV2(this.client.streamSpotAverageEntries(request), (response) => {
5860
+ callback(IndexerArchiverStreamTransformer.spotAverageEntriesStreamCallback(response));
5861
+ });
5862
+ }
5863
+ };
5864
+
5865
+ //#endregion
5866
+ //#region src/client/indexer/grpc_stream/streamV2/IndexerGrpcExplorerStreamV2.ts
5867
+ var IndexerGrpcExplorerStreamV2 = class {
5868
+ constructor(endpoint, metadata) {
5869
+ require_defineProperty._defineProperty(this, "client", void 0);
5870
+ require_defineProperty._defineProperty(this, "transport", void 0);
5871
+ this.transport = new require_BaseGrpcConsumer.GrpcWebRpcTransport(endpoint, metadata);
5872
+ this.client = new __injectivelabs_indexer_proto_ts_v2_generated_injective_explorer_rpc_pb_client.InjectiveExplorerRPCClient(this.transport);
5873
+ }
5874
+ /**
5875
+ * Stream block updates
5876
+ * @param params.callback - Called for each block update
5877
+ * @returns StreamSubscription
5878
+ */
5879
+ streamBlocks({ callback }) {
5880
+ if (typeof callback !== "function") throw new Error("callback must be a function");
5881
+ const request = __injectivelabs_indexer_proto_ts_v2_generated_injective_explorer_rpc_pb.StreamBlocksRequest.create();
5882
+ return createStreamSubscriptionV2(this.client.streamBlocks(request), (response) => {
5883
+ callback(ExplorerStreamTransformer.blocksStreamCallback(response));
5884
+ });
5885
+ }
5886
+ /**
5887
+ * Stream blocks with transactions
5888
+ * @param params.callback - Called for each block with transactions update
5889
+ * @returns StreamSubscription
5890
+ */
5891
+ streamBlocksWithTxs({ callback }) {
5892
+ if (typeof callback !== "function") throw new Error("callback must be a function");
5893
+ const request = __injectivelabs_indexer_proto_ts_v2_generated_injective_explorer_rpc_pb.StreamBlocksRequest.create();
5894
+ return createStreamSubscriptionV2(this.client.streamBlocks(request), (response) => {
5895
+ callback(ExplorerStreamTransformer.blocksWithTxsStreamCallback(response));
5896
+ });
5897
+ }
5898
+ /**
5899
+ * Stream transaction updates
5900
+ * @param params.callback - Called for each transaction update
5901
+ * @returns StreamSubscription
5902
+ */
5903
+ streamTransactions({ callback }) {
5904
+ if (typeof callback !== "function") throw new Error("callback must be a function");
5905
+ const request = __injectivelabs_indexer_proto_ts_v2_generated_injective_explorer_rpc_pb.StreamTxsRequest.create();
5906
+ return createStreamSubscriptionV2(this.client.streamTxs(request), (response) => {
5907
+ callback(ExplorerStreamTransformer.transactionsStreamCallback(response));
5908
+ });
5909
+ }
5910
+ };
5911
+
5912
+ //#endregion
5913
+ //#region src/client/indexer/grpc_stream/streamV2/IndexerGrpcDerivativesStreamV2.ts
5914
+ var IndexerGrpcDerivativesStreamV2 = class {
5915
+ constructor(endpoint, metadata) {
5916
+ require_defineProperty._defineProperty(this, "client", void 0);
5917
+ require_defineProperty._defineProperty(this, "transport", void 0);
5918
+ this.transport = new require_BaseGrpcConsumer.GrpcWebRpcTransport(endpoint, metadata);
5919
+ this.client = new __injectivelabs_indexer_proto_ts_v2_generated_injective_derivative_exchange_rpc_pb_client.InjectiveDerivativeExchangeRPCClient(this.transport);
5920
+ }
5921
+ /**
5922
+ * Stream derivative orders
5923
+ * @param params.marketId - Optional market ID to filter
5924
+ * @param params.subaccountId - Optional subaccount ID to filter
5925
+ * @param params.orderSide - Optional order side to filter
5926
+ * @param params.callback - Called for each order update
5927
+ * @returns StreamSubscription
5928
+ */
5929
+ streamOrders({ marketId, subaccountId, orderSide, callback }) {
5930
+ if (typeof callback !== "function") throw new Error("callback must be a function");
5931
+ const request = __injectivelabs_indexer_proto_ts_v2_generated_injective_derivative_exchange_rpc_pb.StreamOrdersRequest.create();
5932
+ if (marketId) request.marketId = marketId;
5933
+ if (subaccountId) request.subaccountId = subaccountId;
5934
+ if (orderSide) request.orderSide = orderSide;
5935
+ return createStreamSubscriptionV2(this.client.streamOrders(request), (response) => {
5936
+ callback(IndexerDerivativeStreamTransformer.ordersStreamCallback(response));
5937
+ });
5938
+ }
5939
+ /**
5940
+ * Stream derivative order history
5941
+ * @param params.subaccountId - Optional subaccount ID to filter
5942
+ * @param params.marketId - Optional market ID to filter
5943
+ * @param params.orderTypes - Optional order types to filter
5944
+ * @param params.direction - Optional direction to filter
5945
+ * @param params.state - Optional state to filter
5946
+ * @param params.executionTypes - Optional execution types to filter
5947
+ * @param params.callback - Called for each order history update
5948
+ * @returns StreamSubscription
5949
+ */
5950
+ streamOrdersHistory({ subaccountId, marketId, orderTypes, direction, state, executionTypes, callback }) {
5951
+ if (typeof callback !== "function") throw new Error("callback must be a function");
5952
+ const request = __injectivelabs_indexer_proto_ts_v2_generated_injective_derivative_exchange_rpc_pb.StreamOrdersHistoryRequest.create();
5953
+ if (subaccountId) request.subaccountId = subaccountId;
5954
+ if (marketId) request.marketId = marketId;
5955
+ if (orderTypes) request.orderTypes = orderTypes;
5956
+ if (direction) request.direction = direction;
5957
+ if (state) request.state = state;
5958
+ if (executionTypes) request.executionTypes = executionTypes;
5959
+ return createStreamSubscriptionV2(this.client.streamOrdersHistory(request), (response) => {
5960
+ callback(IndexerDerivativeStreamTransformer.orderHistoryStreamCallback(response));
5961
+ });
5962
+ }
5963
+ /**
5964
+ * Stream derivative trades
5965
+ * @param params.marketId - Optional market ID to filter
5966
+ * @param params.marketIds - Optional array of market IDs to filter
5967
+ * @param params.subaccountId - Optional subaccount ID to filter
5968
+ * @param params.subaccountIds - Optional array of subaccount IDs to filter
5969
+ * @param params.executionSide - Optional execution side to filter
5970
+ * @param params.direction - Optional direction to filter
5971
+ * @param params.pagination - Optional pagination options
5972
+ * @param params.callback - Called for each trade update
5973
+ * @returns StreamSubscription
5974
+ */
5975
+ streamTrades({ marketIds, marketId, subaccountIds, subaccountId, executionSide, direction, pagination, callback }) {
5976
+ if (typeof callback !== "function") throw new Error("callback must be a function");
5977
+ const request = __injectivelabs_indexer_proto_ts_v2_generated_injective_derivative_exchange_rpc_pb.StreamTradesRequest.create();
5978
+ if (marketIds) request.marketIds = marketIds;
5979
+ if (marketId) request.marketId = marketId;
5980
+ if (subaccountIds) request.subaccountIds = subaccountIds;
5981
+ if (subaccountId) request.subaccountId = subaccountId;
5982
+ if (executionSide) request.executionSide = executionSide;
5983
+ if (direction) request.direction = direction;
5984
+ if (pagination) {
5985
+ if (pagination.skip !== void 0) request.skip = BigInt(pagination.skip);
5986
+ if (pagination.limit !== void 0) request.limit = pagination.limit;
5987
+ }
5988
+ return createStreamSubscriptionV2(this.client.streamTrades(request), (response) => {
5989
+ callback(IndexerDerivativeStreamTransformer.tradesStreamCallback(response));
5990
+ });
5991
+ }
5992
+ /**
5993
+ * Stream derivative positions
5994
+ * @param params.marketId - Optional market ID to filter
5995
+ * @param params.address - Optional address to filter
5996
+ * @param params.subaccountId - Optional subaccount ID to filter
5997
+ * @param params.callback - Called for each position update
5998
+ * @returns StreamSubscription
5999
+ */
6000
+ streamPositions({ marketId, address, subaccountId, callback }) {
6001
+ if (typeof callback !== "function") throw new Error("callback must be a function");
6002
+ const request = __injectivelabs_indexer_proto_ts_v2_generated_injective_derivative_exchange_rpc_pb.StreamPositionsRequest.create();
6003
+ if (marketId) request.marketId = marketId;
6004
+ if (address) request.accountAddress = address;
6005
+ if (subaccountId) request.subaccountId = subaccountId;
6006
+ return createStreamSubscriptionV2(this.client.streamPositions(request), (response) => {
6007
+ callback(IndexerDerivativeStreamTransformer.positionStreamCallback(response));
6008
+ });
6009
+ }
6010
+ /**
6011
+ * Stream derivative markets
6012
+ * @param params.marketIds - Optional array of market IDs to filter
6013
+ * @param params.callback - Called for each market update
6014
+ * @returns StreamSubscription
6015
+ */
6016
+ streamMarkets({ marketIds, callback }) {
6017
+ if (typeof callback !== "function") throw new Error("callback must be a function");
6018
+ const request = __injectivelabs_indexer_proto_ts_v2_generated_injective_derivative_exchange_rpc_pb.StreamMarketRequest.create();
6019
+ if (marketIds && marketIds.length) request.marketIds = marketIds;
6020
+ return createStreamSubscriptionV2(this.client.streamMarket(request), (response) => {
6021
+ callback(response);
6022
+ });
6023
+ }
6024
+ /**
6025
+ * Stream derivative orderbooks V2
6026
+ * @param params.marketIds - Array of market IDs to stream
6027
+ * @param params.callback - Called for each orderbook update
6028
+ * @returns StreamSubscription
6029
+ */
6030
+ streamOrderbooksV2({ marketIds, callback }) {
6031
+ if (!marketIds || marketIds.length === 0) throw new Error("marketIds is required and cannot be empty");
6032
+ if (typeof callback !== "function") throw new Error("callback must be a function");
6033
+ const request = __injectivelabs_indexer_proto_ts_v2_generated_injective_derivative_exchange_rpc_pb.StreamOrderbookV2Request.create();
6034
+ request.marketIds = marketIds;
6035
+ return createStreamSubscriptionV2(this.client.streamOrderbookV2(request), (response) => {
6036
+ callback(IndexerDerivativeStreamTransformer.orderbookV2StreamCallback(response));
6037
+ });
6038
+ }
6039
+ /**
6040
+ * Stream derivative orderbook updates
6041
+ * @param params.marketIds - Array of market IDs to stream
6042
+ * @param params.callback - Called for each orderbook update
6043
+ * @returns StreamSubscription
6044
+ */
6045
+ streamOrderbookUpdates({ marketIds, callback }) {
6046
+ if (!marketIds || marketIds.length === 0) throw new Error("marketIds is required and cannot be empty");
6047
+ if (typeof callback !== "function") throw new Error("callback must be a function");
6048
+ const request = __injectivelabs_indexer_proto_ts_v2_generated_injective_derivative_exchange_rpc_pb.StreamOrderbookUpdateRequest.create();
6049
+ request.marketIds = marketIds;
6050
+ return createStreamSubscriptionV2(this.client.streamOrderbookUpdate(request), (response) => {
6051
+ callback(IndexerDerivativeStreamTransformer.orderbookUpdateStreamCallback(response));
6052
+ });
6053
+ }
6054
+ /**
6055
+ * Stream derivative positions V2
6056
+ * @param params.marketId - Optional market ID to filter
6057
+ * @param params.address - Optional address to filter
6058
+ * @param params.subaccountId - Optional subaccount ID to filter
6059
+ * @param params.callback - Called for each position update
6060
+ * @returns StreamSubscription
6061
+ */
6062
+ streamPositionsV2({ marketId, address, subaccountId, callback }) {
6063
+ if (typeof callback !== "function") throw new Error("callback must be a function");
6064
+ const request = __injectivelabs_indexer_proto_ts_v2_generated_injective_derivative_exchange_rpc_pb.StreamPositionsV2Request.create();
6065
+ if (marketId) request.marketId = marketId;
6066
+ if (address) request.accountAddress = address;
6067
+ if (subaccountId) request.subaccountId = subaccountId;
6068
+ return createStreamSubscriptionV2(this.client.streamPositionsV2(request), (response) => {
6069
+ callback(IndexerDerivativeStreamTransformer.positionV2StreamCallback(response));
6070
+ });
6071
+ }
6072
+ };
6073
+
6074
+ //#endregion
6075
+ //#region src/client/indexer/grpc_stream/streamV2/IndexerGrpcAccountPortfolioStreamV2.ts
6076
+ var IndexerGrpcAccountPortfolioStreamV2 = class {
6077
+ constructor(endpoint, metadata) {
6078
+ require_defineProperty._defineProperty(this, "client", void 0);
6079
+ require_defineProperty._defineProperty(this, "transport", void 0);
6080
+ this.transport = new require_BaseGrpcConsumer.GrpcWebRpcTransport(endpoint, metadata);
6081
+ this.client = new __injectivelabs_indexer_proto_ts_v2_generated_injective_portfolio_rpc_pb_client.InjectivePortfolioRPCClient(this.transport);
6082
+ }
6083
+ /**
6084
+ * Stream account portfolio updates
6085
+ * @param params.accountAddress - The account address to stream portfolio for
6086
+ * @param params.subaccountId - Optional subaccount ID to filter
6087
+ * @param params.type - Optional portfolio type to filter
6088
+ * @param params.callback - Called for each portfolio update
6089
+ * @returns StreamSubscription
6090
+ */
6091
+ streamAccountPortfolio({ accountAddress, subaccountId, type, callback }) {
6092
+ if (!accountAddress) throw new Error("accountAddress is required");
6093
+ if (typeof callback !== "function") throw new Error("callback must be a function");
6094
+ const request = __injectivelabs_indexer_proto_ts_v2_generated_injective_portfolio_rpc_pb.StreamAccountPortfolioRequest.create();
6095
+ request.accountAddress = accountAddress;
6096
+ if (subaccountId) request.subaccountId = subaccountId;
6097
+ if (type) request.type = type;
6098
+ return createStreamSubscriptionV2(this.client.streamAccountPortfolio(request), (response) => {
6099
+ callback(IndexerAccountPortfolioStreamTransformer.accountPortfolioStreamCallback(response));
6100
+ });
6101
+ }
6102
+ };
6103
+
6104
+ //#endregion
6105
+ //#region src/client/indexer/grpc_stream/streamV2/StreamManagerV2.ts
6106
+ /**
6107
+ * Default retry configuration
6108
+ */
6109
+ const DEFAULT_RETRY_CONFIG = {
6110
+ enabled: true,
6111
+ maxAttempts: 5,
6112
+ initialDelayMs: 1e3,
6113
+ maxDelayMs: 3e4,
6114
+ backoffMultiplier: 2,
6115
+ persistent: true
6116
+ };
6117
+ /**
6118
+ * Maps gRPC status code to disconnect reason
6119
+ */
6120
+ function mapGrpcCodeToReason(code) {
6121
+ switch (code) {
6122
+ case require_types.GrpcStatusCode.CANCELLED: return require_types.StreamDisconnectReason.UserStopped;
6123
+ case require_types.GrpcStatusCode.UNAVAILABLE: return require_types.StreamDisconnectReason.NetworkError;
6124
+ case require_types.GrpcStatusCode.DEADLINE_EXCEEDED: return require_types.StreamDisconnectReason.Timeout;
6125
+ case require_types.GrpcStatusCode.UNAUTHENTICATED:
6126
+ case require_types.GrpcStatusCode.PERMISSION_DENIED: return require_types.StreamDisconnectReason.AuthenticationError;
6127
+ case require_types.GrpcStatusCode.RESOURCE_EXHAUSTED: return require_types.StreamDisconnectReason.RateLimited;
6128
+ case require_types.GrpcStatusCode.INVALID_ARGUMENT:
6129
+ case require_types.GrpcStatusCode.NOT_FOUND:
6130
+ case require_types.GrpcStatusCode.ALREADY_EXISTS:
6131
+ case require_types.GrpcStatusCode.OUT_OF_RANGE:
6132
+ case require_types.GrpcStatusCode.UNIMPLEMENTED:
6133
+ case require_types.GrpcStatusCode.FAILED_PRECONDITION: return require_types.StreamDisconnectReason.InvalidRequest;
6134
+ case require_types.GrpcStatusCode.UNKNOWN:
6135
+ case require_types.GrpcStatusCode.INTERNAL:
6136
+ case require_types.GrpcStatusCode.DATA_LOSS:
6137
+ case require_types.GrpcStatusCode.ABORTED:
6138
+ default: return require_types.StreamDisconnectReason.StreamError;
6139
+ }
6140
+ }
6141
+ /**
6142
+ * Determines if a disconnect reason should trigger a retry
6143
+ */
6144
+ function isRetryableReason(reason) {
6145
+ switch (reason) {
6146
+ case require_types.StreamDisconnectReason.NetworkError:
6147
+ case require_types.StreamDisconnectReason.Timeout:
6148
+ case require_types.StreamDisconnectReason.RateLimited:
6149
+ case require_types.StreamDisconnectReason.StreamError:
6150
+ case require_types.StreamDisconnectReason.StreamEnded: return true;
6151
+ case require_types.StreamDisconnectReason.UserStopped:
6152
+ case require_types.StreamDisconnectReason.MaxRetries:
6153
+ case require_types.StreamDisconnectReason.AuthenticationError:
6154
+ case require_types.StreamDisconnectReason.InvalidRequest: return false;
6155
+ default: return false;
6156
+ }
6157
+ }
6158
+ /**
6159
+ * StreamManagerV2 - Manages gRPC stream connections with automatic retry
6160
+ *
6161
+ * V2 Features:
6162
+ * - Event-based lifecycle (on/off methods)
6163
+ * - Automatic retry with exponential backoff
6164
+ * - Persistent retry mode
6165
+ * - Comprehensive gRPC error code mapping
6166
+ * - Distinguishes retryable vs non-retryable errors
6167
+ *
6168
+ */
6169
+ var StreamManagerV2 = class extends eventemitter3.EventEmitter {
6170
+ constructor(config) {
6171
+ super();
6172
+ require_defineProperty._defineProperty(this, "config", void 0);
6173
+ require_defineProperty._defineProperty(this, "state", require_types.StreamState.Idle);
6174
+ require_defineProperty._defineProperty(this, "subscription", null);
6175
+ require_defineProperty._defineProperty(this, "retryTimeoutId", null);
6176
+ require_defineProperty._defineProperty(this, "retryAttempt", 0);
6177
+ this.config = {
6178
+ id: config.id,
6179
+ streamFactory: config.streamFactory,
6180
+ onData: config.onData,
6181
+ retryConfig: {
6182
+ ...DEFAULT_RETRY_CONFIG,
6183
+ ...config.retryConfig
6184
+ }
6185
+ };
6186
+ const originalEmit = this.emit.bind(this);
6187
+ this.emit = ((event, ...args) => {
6188
+ if (event === require_types.StreamEvent.Data && args.length > 0) this.handleData(args[0]);
6189
+ return originalEmit(event, ...args);
6190
+ });
6191
+ }
6192
+ start() {
6193
+ if (this.state !== require_types.StreamState.Idle && this.state !== require_types.StreamState.Stopped) {
6194
+ this.emit(require_types.StreamEvent.Warn, { message: `Stream already started (state: ${this.state})` });
6195
+ return;
6196
+ }
6197
+ this.connect();
6198
+ }
6199
+ stop() {
6200
+ this.handleDisconnect(require_types.StreamDisconnectReason.UserStopped);
6201
+ }
6202
+ getId() {
6203
+ return this.config.id;
6204
+ }
6205
+ /**
6206
+ * Destroy the stream manager and clean up all resources
6207
+ * Call this when the stream manager is no longer needed
6208
+ */
6209
+ destroy() {
6210
+ this.stop();
6211
+ this.removeAllListeners();
6212
+ }
6213
+ getState() {
6214
+ return this.state;
6215
+ }
6216
+ updateState(newState) {
6217
+ const oldState = this.state;
6218
+ this.state = newState;
6219
+ this.emit(require_types.StreamEvent.StateChange, {
6220
+ from: oldState,
6221
+ to: newState
6222
+ });
6223
+ }
6224
+ clearSubscription() {
6225
+ if (!this.subscription) return;
6226
+ this.subscription.unsubscribe();
6227
+ this.subscription = null;
6228
+ }
6229
+ clearRetryTimeout() {
6230
+ if (!this.retryTimeoutId) return;
6231
+ clearTimeout(this.retryTimeoutId);
6232
+ this.retryTimeoutId = null;
6233
+ }
6234
+ calculateNextBackoff(reason) {
6235
+ const baseDelay = reason === require_types.StreamDisconnectReason.RateLimited ? Math.max(this.config.retryConfig.initialDelayMs, 5e3) : this.config.retryConfig.initialDelayMs;
6236
+ if (this.config.retryConfig.maxAttempts > 0 && this.retryAttempt >= this.config.retryConfig.maxAttempts) return this.config.retryConfig.persistent ? this.config.retryConfig.maxDelayMs : null;
6237
+ const nextBackoffDelay = baseDelay * Math.pow(this.config.retryConfig.backoffMultiplier, this.retryAttempt);
6238
+ return Math.min(nextBackoffDelay, this.config.retryConfig.maxDelayMs);
6239
+ }
6240
+ scheduleRetry(reason) {
6241
+ if (!this.config.retryConfig.enabled) return;
6242
+ const nextBackoff = this.calculateNextBackoff(reason);
6243
+ if (nextBackoff === null) {
6244
+ this.handleMaxRetriesReached();
6245
+ return;
6246
+ }
6247
+ this.retryTimeoutId = setTimeout(() => {
6248
+ this.retryAttempt++;
6249
+ this.emit(require_types.StreamEvent.Retry, {
6250
+ attempt: this.retryAttempt,
6251
+ delayMs: nextBackoff,
6252
+ nextBackoff: this.calculateNextBackoff(reason)
6253
+ });
6254
+ this.connect();
6255
+ }, nextBackoff);
6256
+ }
6257
+ handleMaxRetriesReached() {
6258
+ this.emit(require_types.StreamEvent.Error, { message: `Max retries (${this.config.retryConfig.maxAttempts}) reached` });
6259
+ this.handleDisconnect(require_types.StreamDisconnectReason.MaxRetries);
6260
+ }
6261
+ handleError(error) {
6262
+ const errorInfo = this.extractErrorInfo(error);
6263
+ this.emit(require_types.StreamEvent.Error, errorInfo);
6264
+ const reason = mapGrpcCodeToReason(error && typeof error === "object" && "code" in error ? error.code : require_types.GrpcStatusCode.UNKNOWN);
6265
+ this.handleDisconnect(reason);
6266
+ }
6267
+ /**
6268
+ * Handles incoming data - calls user callback
6269
+ * Called automatically when user emits 'data' event from streamFactory callback
6270
+ */
6271
+ handleData(response) {
6272
+ try {
6273
+ this.config.onData(response);
6274
+ } catch (error) {
6275
+ this.handleError(error);
6276
+ }
6277
+ }
6278
+ handleConnected(isReconnect) {
6279
+ this.updateState(require_types.StreamState.Connected);
6280
+ this.retryAttempt = 0;
6281
+ this.emit(require_types.StreamEvent.Connect, {
6282
+ isReconnect,
6283
+ attempt: 0
6284
+ });
6285
+ }
6286
+ handleDisconnect(reason) {
6287
+ this.clearSubscription();
6288
+ this.clearRetryTimeout();
6289
+ const willRetry = isRetryableReason(reason) && this.config.retryConfig.enabled;
6290
+ this.emit(require_types.StreamEvent.Disconnect, {
6291
+ reason,
6292
+ willRetry,
6293
+ attempt: this.retryAttempt
6294
+ });
6295
+ if (willRetry) {
6296
+ this.updateState(require_types.StreamState.Reconnecting);
6297
+ this.scheduleRetry(reason);
6298
+ } else this.updateState(require_types.StreamState.Stopped);
6299
+ }
6300
+ connect() {
6301
+ this.clearSubscription();
6302
+ const isReconnect = this.state === require_types.StreamState.Reconnecting;
6303
+ this.updateState(isReconnect ? require_types.StreamState.Reconnecting : require_types.StreamState.Connecting);
6304
+ try {
6305
+ this.subscription = this.config.streamFactory();
6306
+ this.subscription.on("error", (error) => {
6307
+ this.handleError(error);
6308
+ });
6309
+ this.subscription.on("complete", () => {
6310
+ this.handleDisconnect(require_types.StreamDisconnectReason.StreamEnded);
6311
+ });
6312
+ this.handleConnected(isReconnect);
6313
+ } catch (error) {
6314
+ this.handleError(error);
6315
+ }
6316
+ }
6317
+ /**
6318
+ * Extracts error message, code, and details from an error object
6319
+ */
6320
+ extractErrorInfo(error) {
6321
+ if (error && typeof error === "object" && "details" in error) return {
6322
+ message: error.details,
6323
+ code: error.code,
6324
+ details: error
6325
+ };
6326
+ const code = error && typeof error === "object" && "code" in error ? error.code : void 0;
6327
+ return {
6328
+ message: error instanceof Error ? error.message : "Unknown error",
6329
+ code,
6330
+ details: error instanceof Error ? error.stack : error
6331
+ };
6332
+ }
6333
+ };
6334
+
6335
+ //#endregion
6336
+ Object.defineProperty(exports, 'ExplorerStreamTransformer', {
6337
+ enumerable: true,
6338
+ get: function () {
6339
+ return ExplorerStreamTransformer;
6340
+ }
6341
+ });
6342
+ Object.defineProperty(exports, 'IndexerAccountPortfolioStreamTransformer', {
6343
+ enumerable: true,
6344
+ get: function () {
6345
+ return IndexerAccountPortfolioStreamTransformer;
6346
+ }
6347
+ });
6348
+ Object.defineProperty(exports, 'IndexerAccountStreamTransformer', {
6349
+ enumerable: true,
6350
+ get: function () {
6351
+ return IndexerAccountStreamTransformer;
6352
+ }
6353
+ });
6354
+ Object.defineProperty(exports, 'IndexerArchiverStreamTransformer', {
6355
+ enumerable: true,
6356
+ get: function () {
6357
+ return IndexerArchiverStreamTransformer;
6358
+ }
6359
+ });
6360
+ Object.defineProperty(exports, 'IndexerAuctionStreamTransformer', {
6361
+ enumerable: true,
6362
+ get: function () {
6363
+ return IndexerAuctionStreamTransformer;
6364
+ }
6365
+ });
6366
+ Object.defineProperty(exports, 'IndexerCampaignTransformer', {
6367
+ enumerable: true,
6368
+ get: function () {
6369
+ return IndexerCampaignTransformer;
6370
+ }
6371
+ });
6372
+ Object.defineProperty(exports, 'IndexerDerivativeStreamTransformer', {
6373
+ enumerable: true,
6374
+ get: function () {
6375
+ return IndexerDerivativeStreamTransformer;
6376
+ }
6377
+ });
6378
+ Object.defineProperty(exports, 'IndexerGrpcAccountApi', {
6379
+ enumerable: true,
6380
+ get: function () {
6381
+ return IndexerGrpcAccountApi;
6382
+ }
6383
+ });
6384
+ Object.defineProperty(exports, 'IndexerGrpcAccountPortfolioApi', {
6385
+ enumerable: true,
6386
+ get: function () {
6387
+ return IndexerGrpcAccountPortfolioApi;
6388
+ }
6389
+ });
6390
+ Object.defineProperty(exports, 'IndexerGrpcAccountPortfolioStream', {
6391
+ enumerable: true,
6392
+ get: function () {
6393
+ return IndexerGrpcAccountPortfolioStream;
6394
+ }
6395
+ });
6396
+ Object.defineProperty(exports, 'IndexerGrpcAccountPortfolioStreamV2', {
6397
+ enumerable: true,
6398
+ get: function () {
6399
+ return IndexerGrpcAccountPortfolioStreamV2;
6400
+ }
6401
+ });
6402
+ Object.defineProperty(exports, 'IndexerGrpcAccountPortfolioTransformer', {
6403
+ enumerable: true,
6404
+ get: function () {
6405
+ return IndexerGrpcAccountPortfolioTransformer;
6406
+ }
6407
+ });
6408
+ Object.defineProperty(exports, 'IndexerGrpcAccountStream', {
6409
+ enumerable: true,
6410
+ get: function () {
6411
+ return IndexerGrpcAccountStream;
6412
+ }
6413
+ });
6414
+ Object.defineProperty(exports, 'IndexerGrpcAccountStreamV2', {
6415
+ enumerable: true,
6416
+ get: function () {
6417
+ return IndexerGrpcAccountStreamV2;
6418
+ }
6419
+ });
6420
+ Object.defineProperty(exports, 'IndexerGrpcAccountTransformer', {
6421
+ enumerable: true,
6422
+ get: function () {
6423
+ return IndexerGrpcAccountTransformer;
6424
+ }
6425
+ });
6426
+ Object.defineProperty(exports, 'IndexerGrpcArchiverApi', {
6427
+ enumerable: true,
6428
+ get: function () {
6429
+ return IndexerGrpcArchiverApi;
6430
+ }
6431
+ });
6432
+ Object.defineProperty(exports, 'IndexerGrpcArchiverStream', {
6433
+ enumerable: true,
6434
+ get: function () {
6435
+ return IndexerGrpcArchiverStream;
6436
+ }
6437
+ });
6438
+ Object.defineProperty(exports, 'IndexerGrpcArchiverStreamV2', {
6439
+ enumerable: true,
6440
+ get: function () {
6441
+ return IndexerGrpcArchiverStreamV2;
6442
+ }
6443
+ });
6444
+ Object.defineProperty(exports, 'IndexerGrpcArchiverTransformer', {
6445
+ enumerable: true,
6446
+ get: function () {
6447
+ return IndexerGrpcArchiverTransformer;
6448
+ }
6449
+ });
6450
+ Object.defineProperty(exports, 'IndexerGrpcAuctionApi', {
6451
+ enumerable: true,
6452
+ get: function () {
6453
+ return IndexerGrpcAuctionApi;
6454
+ }
6455
+ });
6456
+ Object.defineProperty(exports, 'IndexerGrpcAuctionStream', {
6457
+ enumerable: true,
6458
+ get: function () {
6459
+ return IndexerGrpcAuctionStream;
6460
+ }
6461
+ });
6462
+ Object.defineProperty(exports, 'IndexerGrpcAuctionStreamV2', {
6463
+ enumerable: true,
6464
+ get: function () {
6465
+ return IndexerGrpcAuctionStreamV2;
6466
+ }
6467
+ });
6468
+ Object.defineProperty(exports, 'IndexerGrpcAuctionTransformer', {
6469
+ enumerable: true,
6470
+ get: function () {
6471
+ return IndexerGrpcAuctionTransformer;
6472
+ }
6473
+ });
6474
+ Object.defineProperty(exports, 'IndexerGrpcCampaignApi', {
6475
+ enumerable: true,
6476
+ get: function () {
6477
+ return IndexerGrpcCampaignApi;
6478
+ }
6479
+ });
6480
+ Object.defineProperty(exports, 'IndexerGrpcDerivativeTransformer', {
6481
+ enumerable: true,
6482
+ get: function () {
5531
6483
  return IndexerGrpcDerivativeTransformer;
5532
6484
  }
5533
6485
  });
@@ -5543,6 +6495,12 @@ Object.defineProperty(exports, 'IndexerGrpcDerivativesStream', {
5543
6495
  return IndexerGrpcDerivativesStream;
5544
6496
  }
5545
6497
  });
6498
+ Object.defineProperty(exports, 'IndexerGrpcDerivativesStreamV2', {
6499
+ enumerable: true,
6500
+ get: function () {
6501
+ return IndexerGrpcDerivativesStreamV2;
6502
+ }
6503
+ });
5546
6504
  Object.defineProperty(exports, 'IndexerGrpcExplorerApi', {
5547
6505
  enumerable: true,
5548
6506
  get: function () {
@@ -5555,6 +6513,12 @@ Object.defineProperty(exports, 'IndexerGrpcExplorerStream', {
5555
6513
  return IndexerGrpcExplorerStream;
5556
6514
  }
5557
6515
  });
6516
+ Object.defineProperty(exports, 'IndexerGrpcExplorerStreamV2', {
6517
+ enumerable: true,
6518
+ get: function () {
6519
+ return IndexerGrpcExplorerStreamV2;
6520
+ }
6521
+ });
5558
6522
  Object.defineProperty(exports, 'IndexerGrpcExplorerTransformer', {
5559
6523
  enumerable: true,
5560
6524
  get: function () {
@@ -5609,6 +6573,12 @@ Object.defineProperty(exports, 'IndexerGrpcMitoStreamTransformer', {
5609
6573
  return IndexerGrpcMitoStreamTransformer;
5610
6574
  }
5611
6575
  });
6576
+ Object.defineProperty(exports, 'IndexerGrpcMitoStreamV2', {
6577
+ enumerable: true,
6578
+ get: function () {
6579
+ return IndexerGrpcMitoStreamV2;
6580
+ }
6581
+ });
5612
6582
  Object.defineProperty(exports, 'IndexerGrpcMitoTransformer', {
5613
6583
  enumerable: true,
5614
6584
  get: function () {
@@ -5627,6 +6597,12 @@ Object.defineProperty(exports, 'IndexerGrpcOracleStream', {
5627
6597
  return IndexerGrpcOracleStream;
5628
6598
  }
5629
6599
  });
6600
+ Object.defineProperty(exports, 'IndexerGrpcOracleStreamV2', {
6601
+ enumerable: true,
6602
+ get: function () {
6603
+ return IndexerGrpcOracleStreamV2;
6604
+ }
6605
+ });
5630
6606
  Object.defineProperty(exports, 'IndexerGrpcOracleTransformer', {
5631
6607
  enumerable: true,
5632
6608
  get: function () {
@@ -5657,6 +6633,12 @@ Object.defineProperty(exports, 'IndexerGrpcSpotStream', {
5657
6633
  return IndexerGrpcSpotStream;
5658
6634
  }
5659
6635
  });
6636
+ Object.defineProperty(exports, 'IndexerGrpcSpotStreamV2', {
6637
+ enumerable: true,
6638
+ get: function () {
6639
+ return IndexerGrpcSpotStreamV2;
6640
+ }
6641
+ });
5660
6642
  Object.defineProperty(exports, 'IndexerGrpcSpotTransformer', {
5661
6643
  enumerable: true,
5662
6644
  get: function () {
@@ -5675,6 +6657,12 @@ Object.defineProperty(exports, 'IndexerGrpcTradingStream', {
5675
6657
  return IndexerGrpcTradingStream;
5676
6658
  }
5677
6659
  });
6660
+ Object.defineProperty(exports, 'IndexerGrpcTradingStreamV2', {
6661
+ enumerable: true,
6662
+ get: function () {
6663
+ return IndexerGrpcTradingStreamV2;
6664
+ }
6665
+ });
5678
6666
  Object.defineProperty(exports, 'IndexerOracleStreamTransformer', {
5679
6667
  enumerable: true,
5680
6668
  get: function () {
@@ -5722,4 +6710,28 @@ Object.defineProperty(exports, 'IndexerSpotStreamTransformer', {
5722
6710
  get: function () {
5723
6711
  return IndexerSpotStreamTransformer;
5724
6712
  }
6713
+ });
6714
+ Object.defineProperty(exports, 'StreamManager', {
6715
+ enumerable: true,
6716
+ get: function () {
6717
+ return StreamManager;
6718
+ }
6719
+ });
6720
+ Object.defineProperty(exports, 'StreamManagerV2', {
6721
+ enumerable: true,
6722
+ get: function () {
6723
+ return StreamManagerV2;
6724
+ }
6725
+ });
6726
+ Object.defineProperty(exports, 'createStreamSubscription', {
6727
+ enumerable: true,
6728
+ get: function () {
6729
+ return createStreamSubscription;
6730
+ }
6731
+ });
6732
+ Object.defineProperty(exports, 'createStreamSubscriptionV2', {
6733
+ enumerable: true,
6734
+ get: function () {
6735
+ return createStreamSubscriptionV2;
6736
+ }
5725
6737
  });