@injectivelabs/sdk-ts 1.20.51 → 1.20.53

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (111) hide show
  1. package/dist/cjs/{AbacusGrpcApi-DwBUuoqV.cjs → AbacusGrpcApi-DexBiQxy.cjs} +1 -1
  2. package/dist/cjs/{BaseGrpcConsumer-Ppsh5NLZ.cjs → BaseGrpcConsumer-C1mk2V_9.cjs} +2 -2
  3. package/dist/cjs/{BaseIndexerGrpcConsumer-BYur8R3D.cjs → BaseIndexerGrpcConsumer-DVa_aYMU.cjs} +1 -1
  4. package/dist/cjs/{ChainGrpcExchangeApi-Cxcph7iG.cjs → ChainGrpcExchangeApi-CYPPc8yS.cjs} +3 -3
  5. package/dist/cjs/{ChainRestTendermintApi-lBt4Bo9-.cjs → ChainRestTendermintApi-BfE-2rtB.cjs} +2 -2
  6. package/dist/cjs/{SocialTradingGrpcApi-UXcBw3hy.cjs → ChartsTradingViewGrpcApi-BYuTrxWO.cjs} +187 -1
  7. package/dist/cjs/{DirectEthSecp256k1Wallet-DBw-GssU.cjs → DirectEthSecp256k1Wallet-KzazWAat.cjs} +1 -1
  8. package/dist/cjs/{ExecArgNeptuneWithdraw-DyJyZke3.cjs → ExecArgNeptuneWithdraw-C8xXDAvE.cjs} +2 -2
  9. package/dist/cjs/{IndexerGrpcWeb3GwApi-Du3x0BEl.cjs → IndexerGrpcWeb3GwApi-CPixqm9l.cjs} +2 -2
  10. package/dist/cjs/{MsgSetDenomMetadata-CJO2AZPg.cjs → MsgSetDenomMetadata-Bzu3UDR7.cjs} +6 -6
  11. package/dist/cjs/{OLPGrpcApi-B4Nk34KA.cjs → OLPGrpcApi-DMzqzTp-.cjs} +1 -1
  12. package/dist/cjs/{QueryTradingStrategyContractTotalStrategies-DKD7pQUB.cjs → QueryTradingStrategyContractTotalStrategies-XOXsMgT9.cjs} +2 -2
  13. package/dist/cjs/{StreamManagerV2-DRXlho03.cjs → StreamManagerV2-dDz3sHWi.cjs} +5 -5
  14. package/dist/cjs/{TcAbacusGrpcApi-CozYaZlH.cjs → TcAbacusGrpcApi-By_xt_w-.cjs} +6 -2
  15. package/dist/cjs/{accounts-Bhuko7RT.cjs → accounts-CEEO_tAS.cjs} +3 -3
  16. package/dist/cjs/{chain-DFYBhsui.cjs → chain-Vaqb4Vrm.cjs} +4 -4
  17. package/dist/cjs/client/abacus.cjs +4 -4
  18. package/dist/cjs/client/chain.cjs +9 -9
  19. package/dist/cjs/client/chain.d.cts +3 -3
  20. package/dist/cjs/client/indexer.cjs +9 -9
  21. package/dist/cjs/client/indexer.d.cts +3 -3
  22. package/dist/cjs/client/olp.cjs +5 -5
  23. package/dist/cjs/client/platformServices.cjs +7 -5
  24. package/dist/cjs/client/platformServices.d.cts +2 -2
  25. package/dist/cjs/client/tcAbacus.cjs +4 -4
  26. package/dist/cjs/client/tcAbacus.d.cts +1 -1
  27. package/dist/cjs/client/wasm.cjs +12 -12
  28. package/dist/cjs/core/accounts.cjs +7 -6
  29. package/dist/cjs/core/accounts.d.cts +3 -3
  30. package/dist/cjs/core/modules.cjs +15 -15
  31. package/dist/cjs/core/modules.d.cts +3 -3
  32. package/dist/cjs/core/tx.cjs +12 -12
  33. package/dist/cjs/core/tx.d.cts +3 -3
  34. package/dist/cjs/cosmjs.cjs +13 -13
  35. package/dist/cjs/exports.cjs +13 -13
  36. package/dist/cjs/{index-Bml8CUoG.d.cts → index-BADdhB_k.d.cts} +405 -2
  37. package/dist/cjs/{index-BejQEqGF.d.cts → index-CCRCRvKd.d.cts} +6 -2
  38. package/dist/cjs/{index-BRi1PZdd.d.cts → index-He9ky3uA.d.cts} +19 -1
  39. package/dist/cjs/index.cjs +28 -24
  40. package/dist/cjs/index.d.cts +4 -4
  41. package/dist/cjs/{service-DAfIXxMj.cjs → service-UQHM4Fa_.cjs} +2 -2
  42. package/dist/cjs/service.cjs +6 -6
  43. package/dist/cjs/{tx-BbHKcjZg.cjs → tx-DHI9sPwo.cjs} +27 -13
  44. package/dist/cjs/types/light.cjs +1 -1
  45. package/dist/cjs/types.cjs +1 -1
  46. package/dist/cjs/utils/address.cjs +1 -1
  47. package/dist/cjs/utils/light.cjs +2 -2
  48. package/dist/cjs/{utils-CIqMZQ2o.cjs → utils-SKHr0NOv.cjs} +96 -0
  49. package/dist/cjs/utils.cjs +7 -4
  50. package/dist/cjs/utils.d.cts +4 -4
  51. package/dist/esm/{AbacusGrpcApi-BIHq_AVs.js → AbacusGrpcApi-CLdXH5bZ.js} +1 -1
  52. package/dist/esm/{BaseGrpcConsumer-DEDRwnCk.js → BaseGrpcConsumer-B2qNaBaq.js} +2 -2
  53. package/dist/esm/{BaseIndexerGrpcConsumer-DkRSQkU9.js → BaseIndexerGrpcConsumer-DKboflD4.js} +1 -1
  54. package/dist/esm/{ChainGrpcExchangeApi-TO68UPsx.js → ChainGrpcExchangeApi-AvCJkW7O.js} +3 -3
  55. package/dist/esm/{ChainRestTendermintApi-BnJPMbSU.js → ChainRestTendermintApi-CXHeGWjk.js} +2 -2
  56. package/dist/esm/{SocialTradingGrpcApi-Bax2F760.js → ChartsTradingViewGrpcApi-DDUNU_IX.js} +174 -2
  57. package/dist/esm/{DirectEthSecp256k1Wallet-D3DNBjSy.js → DirectEthSecp256k1Wallet-X82EheqC.js} +1 -1
  58. package/dist/esm/{ExecArgNeptuneWithdraw-BM5u-FxH.js → ExecArgNeptuneWithdraw-BzyfMVSe.js} +2 -2
  59. package/dist/esm/{IndexerGrpcWeb3GwApi-Dzaq-nAM.js → IndexerGrpcWeb3GwApi-DAMdV0I4.js} +2 -2
  60. package/dist/esm/{MsgSetDenomMetadata-DGzlaIXS.js → MsgSetDenomMetadata-CLenywd3.js} +6 -6
  61. package/dist/esm/{OLPGrpcApi-BaeWd600.js → OLPGrpcApi-CFbYM2qH.js} +1 -1
  62. package/dist/esm/{QueryTradingStrategyContractTotalStrategies-B3eiQdnj.js → QueryTradingStrategyContractTotalStrategies-D8-dSDkE.js} +2 -2
  63. package/dist/esm/{StreamManagerV2-Dnq2AWna.js → StreamManagerV2-DkBlluoc.js} +5 -5
  64. package/dist/esm/{TcAbacusGrpcApi-g-zwwExV.js → TcAbacusGrpcApi-l8vyZCck.js} +6 -2
  65. package/dist/esm/{accounts-bOFI_1wE.js → accounts-CSXPhB6W.js} +3 -3
  66. package/dist/esm/{chain-Jr63sBTP.js → chain-B1k6xknc.js} +4 -4
  67. package/dist/esm/client/abacus.js +4 -4
  68. package/dist/esm/client/chain.d.ts +3 -3
  69. package/dist/esm/client/chain.js +9 -9
  70. package/dist/esm/client/indexer.d.ts +3 -3
  71. package/dist/esm/client/indexer.js +9 -9
  72. package/dist/esm/client/olp.js +5 -5
  73. package/dist/esm/client/platformServices.d.ts +2 -2
  74. package/dist/esm/client/platformServices.js +5 -5
  75. package/dist/esm/client/tcAbacus.d.ts +1 -1
  76. package/dist/esm/client/tcAbacus.js +4 -4
  77. package/dist/esm/client/wasm.js +12 -12
  78. package/dist/esm/core/accounts.d.ts +3 -3
  79. package/dist/esm/core/accounts.js +7 -6
  80. package/dist/esm/core/modules.d.ts +3 -3
  81. package/dist/esm/core/modules.js +15 -15
  82. package/dist/esm/core/tx.d.ts +3 -3
  83. package/dist/esm/core/tx.js +12 -12
  84. package/dist/esm/cosmjs.js +13 -13
  85. package/dist/esm/exports.js +13 -13
  86. package/dist/esm/{index-uEknWjpx.d.ts → index-Bq0LFse7.d.ts} +19 -1
  87. package/dist/esm/{index-DNARB9NC.d.ts → index-D6Zm6NwF.d.ts} +6 -2
  88. package/dist/esm/{index-tgSyqu1L.d.ts → index-DMei-AO6.d.ts} +405 -2
  89. package/dist/esm/index.d.ts +4 -4
  90. package/dist/esm/index.js +24 -24
  91. package/dist/esm/{service-ByVrhiMR.js → service-BJtGNIsI.js} +2 -2
  92. package/dist/esm/service.js +6 -6
  93. package/dist/esm/{tx-BxMH4W6J.js → tx-CVLB4qip.js} +27 -13
  94. package/dist/esm/types/light.js +1 -1
  95. package/dist/esm/types.js +1 -1
  96. package/dist/esm/utils/address.js +1 -1
  97. package/dist/esm/utils/light.js +2 -2
  98. package/dist/esm/{utils-BvlndkVI.js → utils-gwPCLHN6.js} +85 -1
  99. package/dist/esm/utils.d.ts +4 -4
  100. package/dist/esm/utils.js +6 -5
  101. package/package.json +7 -7
  102. /package/dist/cjs/{MsgBase-BrhVMws0.cjs → MsgBase-BqZWKNPE.cjs} +0 -0
  103. /package/dist/cjs/{address-light-C_a6b8yF.cjs → address-light-DUoYqdPQ.cjs} +0 -0
  104. /package/dist/cjs/{coins-DRrEtaSG.cjs → coins-DBj8089z.cjs} +0 -0
  105. /package/dist/cjs/{grpc-3Z8ffFdZ.cjs → grpc-D_3PKEFB.cjs} +0 -0
  106. /package/dist/cjs/{light-CrajlUvd.cjs → light-zeGviAVI.cjs} +0 -0
  107. /package/dist/esm/{MsgBase-CmMIxNsl.js → MsgBase-BQlZFcm-.js} +0 -0
  108. /package/dist/esm/{address-light-B2JvY3Or.js → address-light-CwLNB73Y.js} +0 -0
  109. /package/dist/esm/{coins-MO-ob9NV.js → coins-DTdsvmX2.js} +0 -0
  110. /package/dist/esm/{grpc-D2EQHGkK.js → grpc-CSo1TcHx.js} +0 -0
  111. /package/dist/esm/{light-BBrX6IRm.js → light-BUFhVek8.js} +0 -0
@@ -1,5 +1,6 @@
1
1
  const require_chunk = require('./chunk-CbDLau6x.cjs');
2
2
  const require_encoding_light = require('./encoding-light-D96nxVLW.cjs');
3
+ const require_light = require('./light-zeGviAVI.cjs');
3
4
  let viem = require("viem");
4
5
  let __injectivelabs_utils = require("@injectivelabs/utils");
5
6
  let __noble_curves_secp256k1 = require("@noble/curves/secp256k1");
@@ -52,6 +53,89 @@ const protobufTimestampToUnixMs = (timestamp) => {
52
53
 
53
54
  //#endregion
54
55
  //#region src/utils/msgs.ts
56
+ const fixedExchangeGas = {
57
+ MsgCreateDerivativeLimitOrder: {
58
+ gas: 33e4,
59
+ postOnlyGas: 37e4,
60
+ hasOrder: true
61
+ },
62
+ MsgCreateDerivativeMarketOrder: {
63
+ gas: 31e4,
64
+ hasOrder: true
65
+ },
66
+ MsgCancelDerivativeOrder: { gas: 2e5 },
67
+ MsgCreateSpotLimitOrder: {
68
+ gas: 3e5,
69
+ postOnlyGas: 33e4,
70
+ hasOrder: true
71
+ },
72
+ MsgCreateSpotMarketOrder: {
73
+ gas: 3e5,
74
+ hasOrder: true
75
+ },
76
+ MsgCancelSpotOrder: { gas: 185e3 },
77
+ MsgCreateBinaryOptionsLimitOrder: {
78
+ gas: 33e4,
79
+ postOnlyGas: 37e4,
80
+ hasOrder: true
81
+ },
82
+ MsgCreateBinaryOptionsMarketOrder: {
83
+ gas: 31e4,
84
+ hasOrder: true
85
+ },
86
+ MsgCancelBinaryOptionsOrder: { gas: 2e5 },
87
+ MsgDeposit: { gas: 33e4 },
88
+ MsgWithdraw: { gas: 32e4 },
89
+ MsgSubaccountTransfer: { gas: 22e4 },
90
+ MsgExternalTransfer: { gas: 3e5 },
91
+ MsgIncreasePositionMargin: { gas: 185e3 },
92
+ MsgDecreasePositionMargin: { gas: 2e5 }
93
+ };
94
+ const fixedExchangeType = /^\/injective\.exchange\.v(?:1beta1|2)\.(Msg\w+)$/;
95
+ const postOnlyOrderTypes = new Set([require_light.OrderTypeMap.BUY_PO, require_light.OrderTypeMap.SELL_PO]);
96
+ const isRecord = (value) => typeof value === "object" && value !== null;
97
+ const getExchangeOrder = (message) => {
98
+ if (!isRecord(message) || !isRecord(message.order)) return;
99
+ const { orderType, expirationBlock } = message.order;
100
+ if (typeof orderType !== "number" || expirationBlock !== void 0 && typeof expirationBlock !== "bigint") return;
101
+ return {
102
+ orderType,
103
+ expirationBlock
104
+ };
105
+ };
106
+ const isFixedExchangeMessage = (messageType) => Object.prototype.hasOwnProperty.call(fixedExchangeGas, messageType);
107
+ const getFixedGasLimitBasedOnMessage = (msgs) => {
108
+ const messages = Array.isArray(msgs) ? msgs : [msgs];
109
+ if (!messages.length) return;
110
+ let gas = 0;
111
+ for (const msg of messages) {
112
+ var _order$expirationBloc;
113
+ const directSign = msg.toDirectSign();
114
+ const match = directSign.type.match(fixedExchangeType);
115
+ const messageType = match === null || match === void 0 ? void 0 : match[1];
116
+ if (!messageType || !isFixedExchangeMessage(messageType)) return;
117
+ const policy = fixedExchangeGas[messageType];
118
+ const order = "hasOrder" in policy ? getExchangeOrder(directSign.message) : void 0;
119
+ if ("hasOrder" in policy && !order) return;
120
+ const baseGas = (order === null || order === void 0 ? void 0 : order.orderType) !== void 0 && postOnlyOrderTypes.has(order.orderType) && "postOnlyGas" in policy ? policy.postOnlyGas : policy.gas;
121
+ const hasExpirationBlock = ((_order$expirationBloc = order === null || order === void 0 ? void 0 : order.expirationBlock) !== null && _order$expirationBloc !== void 0 ? _order$expirationBloc : 0n) > 0n;
122
+ gas += hasExpirationBlock ? baseGas + baseGas / 10 : baseGas;
123
+ }
124
+ return gas;
125
+ };
126
+ const getGasOptionsBasedOnMessage = ({ msgs, gas, simulateTx, useFixedGas = false }) => {
127
+ var _ref;
128
+ const messages = Array.isArray(msgs) ? msgs : [msgs];
129
+ const explicitGas = gas || void 0;
130
+ const fixedGasLimit = useFixedGas && explicitGas === void 0 ? getFixedGasLimitBasedOnMessage(messages) : void 0;
131
+ const gasLimit = (_ref = explicitGas !== null && explicitGas !== void 0 ? explicitGas : fixedGasLimit) !== null && _ref !== void 0 ? _ref : getGasPriceBasedOnMessage(messages);
132
+ const estimateGas = simulateTx && (!useFixedGas || explicitGas === void 0 && fixedGasLimit === void 0);
133
+ return {
134
+ gas: gasLimit.toString(),
135
+ gasLimit,
136
+ estimateGas
137
+ };
138
+ };
55
139
  const getGasPriceBasedOnMessage = (msgs) => {
56
140
  const messages = Array.isArray(msgs) ? msgs : [msgs];
57
141
  const messageType = messages[0].toDirectSign().type;
@@ -1190,6 +1274,18 @@ Object.defineProperty(exports, 'getErrorMessage', {
1190
1274
  return getErrorMessage;
1191
1275
  }
1192
1276
  });
1277
+ Object.defineProperty(exports, 'getFixedGasLimitBasedOnMessage', {
1278
+ enumerable: true,
1279
+ get: function () {
1280
+ return getFixedGasLimitBasedOnMessage;
1281
+ }
1282
+ });
1283
+ Object.defineProperty(exports, 'getGasOptionsBasedOnMessage', {
1284
+ enumerable: true,
1285
+ get: function () {
1286
+ return getGasOptionsBasedOnMessage;
1287
+ }
1288
+ });
1193
1289
  Object.defineProperty(exports, 'getGasPriceBasedOnMessage', {
1194
1290
  enumerable: true,
1195
1291
  get: function () {
@@ -1,10 +1,11 @@
1
1
  const require_chunk = require('./chunk-CbDLau6x.cjs');
2
2
  const require_encoding_light = require('./encoding-light-D96nxVLW.cjs');
3
3
  const require_constants = require('./constants-tPGACRGC.cjs');
4
- const require_utils = require('./utils-CIqMZQ2o.cjs');
5
- const require_grpc = require('./grpc-3Z8ffFdZ.cjs');
6
- const require_coins = require('./coins-DRrEtaSG.cjs');
7
- const require_address_light = require('./address-light-C_a6b8yF.cjs');
4
+ const require_utils = require('./utils-SKHr0NOv.cjs');
5
+ require('./light-zeGviAVI.cjs');
6
+ const require_grpc = require('./grpc-D_3PKEFB.cjs');
7
+ const require_coins = require('./coins-DBj8089z.cjs');
8
+ const require_address_light = require('./address-light-DUoYqdPQ.cjs');
8
9
  let __protobuf_ts_grpcweb_transport = require("@protobuf-ts/grpcweb-transport");
9
10
  let __injectivelabs_utils = require("@injectivelabs/utils");
10
11
 
@@ -68,6 +69,8 @@ exports.getDerivativeMarketTensMultiplier = require_utils.getDerivativeMarketTen
68
69
  exports.getErrorMessage = require_utils.getErrorMessage;
69
70
  exports.getEthereumAddress = require_address_light.getEthereumAddress;
70
71
  exports.getExactDecimalsFromNumber = __injectivelabs_utils.getExactDecimalsFromNumber;
72
+ exports.getFixedGasLimitBasedOnMessage = require_utils.getFixedGasLimitBasedOnMessage;
73
+ exports.getGasOptionsBasedOnMessage = require_utils.getGasOptionsBasedOnMessage;
71
74
  exports.getGasPriceBasedOnMessage = require_utils.getGasPriceBasedOnMessage;
72
75
  exports.getGrpcWebTransport = require_grpc.getGrpcWebTransport;
73
76
  exports.getInjectiveAddress = require_address_light.getInjectiveAddress;
@@ -1,7 +1,7 @@
1
1
  import "./tx_pb-DSDGNMKS.cjs";
2
2
  import "./index-BpbO2phm.cjs";
3
3
  import "./light-B-3BDUJ7.cjs";
4
- import { $d as derivativeMarginFromChainMargin, $f as messageHash, Af as bigIntReplacer, Bd as getChecksumAddress, Bf as isServerSide, Cf as spotPriceFromChainPriceToFixed, Df as spotQuantityFromChainQuantityToFixed, Ef as spotQuantityFromChainQuantity, Fd as grpcPagingToPaging, Ff as hexToNumber, Gd as amountToCosmosSdkDecAmount, Gf as sortObjectByKeysWithReduce, Hd as getDerivativeMarketTensMultiplier, Hf as protoObjectToJson, Id as grpcPagingToPagingV2, If as isBrowser, Jd as denomAmountFromChainDenomAmountToFixed, Jf as TypedDataUtilsSanitizeData, Kd as cosmosSdkDecToBigNumber, Kf as SignTypedDataVersionV4, Ld as pageRequestToGrpcPageRequestV2, Lf as isJsonString, Md as fetchAllWithPagination, Mf as bigIntToString, Nd as fetchAllWithTokenPagination, Nf as getErrorMessage, Of as spotQuantityToChainQuantity, Pd as grpcPaginationToPagination, Pf as grpcCoinToUiCoin, Qd as denomAmountToGrpcChainDenomAmount, Qf as hashToHex, Rd as paginationRequestFromPagination, Rf as isNode, Sf as spotPriceFromChainPrice, Tf as spotPriceToChainPriceToFixed, Ud as getSpotMarketDecimals, Uf as safeBigIntStringify, Vd as getDerivativeMarketDecimals, Vf as objectToJson, Wd as getSpotMarketTensMultiplier, Wf as sortObjectByKeys, Xd as denomAmountToChainDenomAmount, Xf as decompressPubKey, Yd as denomAmountFromGrpcChainDenomAmount, Yf as TypedMessageV4, Zd as denomAmountToChainDenomAmountToFixed, Zf as domainHash, _f as getExactDecimalsFromNumber, af as derivativePriceToChainPrice, ap as ripemd160, bS as GrpcWebFetchTransport, bf as isNumber, cf as derivativeQuantityFromChainQuantityToFixed, cp as ofacList, df as formatAmountToAllowableAmount, dp as makeTimeoutTimestamp, ef as derivativeMarginFromChainMarginToFixed, ep as privateKeyHashToPublicKey, ff as formatAmountToAllowableDecimals, fp as makeTimeoutTimestampInNs, gf as formatPriceToAllowablePrice, hf as formatPriceToAllowableDecimals, hp as protobufTimestampToUnixSeconds, if as derivativePriceFromChainPriceToFixed, ip as publicKeyToAddress, jd as recoverTypedSignaturePubKey, jf as bigIntToNumber, kf as spotQuantityToChainQuantityToFixed, lf as derivativeQuantityToChainQuantity, lp as getGrpcWebTransport, mf as formatNumberToAllowableTensMultiplier, mp as protobufTimestampToUnixMs, nf as derivativeMarginToChainMarginToFixed, np as privateKeyToPublicKey, of as derivativePriceToChainPriceToFixed, op as sanitizeTypedData, pf as formatNumberToAllowableDecimals, pp as protobufTimestampToDate, qd as denomAmountFromChainDenomAmount, qf as TypedDataUtilsHashStruct, rf as derivativePriceFromChainPrice, rp as privateKeyToPublicKeyBase64, sf as derivativeQuantityFromChainQuantity, sp as sha256, tf as derivativeMarginToChainMargin, tp as privateKeyHashToPublicKeyBase64, uf as derivativeQuantityToChainQuantityToFixed, up as getGasPriceBasedOnMessage, vf as getSignificantDecimalsFromNumber, wf as spotPriceToChainPrice, xf as numberToCosmosSdkDecString, yf as getTensMultiplier, zd as paginationUint8ArrayToString, zf as isReactNative } from "./index-BRi1PZdd.cjs";
4
+ import { $d as derivativeMarginFromChainMargin, $f as messageHash, Af as bigIntReplacer, Bd as getChecksumAddress, Bf as isServerSide, Cf as spotPriceFromChainPriceToFixed, Df as spotQuantityFromChainQuantityToFixed, Ef as spotQuantityFromChainQuantity, Fd as grpcPagingToPaging, Ff as hexToNumber, Gd as amountToCosmosSdkDecAmount, Gf as sortObjectByKeysWithReduce, Hd as getDerivativeMarketTensMultiplier, Hf as protoObjectToJson, Id as grpcPagingToPagingV2, If as isBrowser, Jd as denomAmountFromChainDenomAmountToFixed, Jf as TypedDataUtilsSanitizeData, Kd as cosmosSdkDecToBigNumber, Kf as SignTypedDataVersionV4, Ld as pageRequestToGrpcPageRequestV2, Lf as isJsonString, Md as fetchAllWithPagination, Mf as bigIntToString, Nd as fetchAllWithTokenPagination, Nf as getErrorMessage, Of as spotQuantityToChainQuantity, Pd as grpcPaginationToPagination, Pf as grpcCoinToUiCoin, Qd as denomAmountToGrpcChainDenomAmount, Qf as hashToHex, Rd as paginationRequestFromPagination, Rf as isNode, SS as GrpcWebFetchTransport, Sf as spotPriceFromChainPrice, Tf as spotPriceToChainPriceToFixed, Ud as getSpotMarketDecimals, Uf as safeBigIntStringify, Vd as getDerivativeMarketDecimals, Vf as objectToJson, Wd as getSpotMarketTensMultiplier, Wf as sortObjectByKeys, Xd as denomAmountToChainDenomAmount, Xf as decompressPubKey, Yd as denomAmountFromGrpcChainDenomAmount, Yf as TypedMessageV4, Zd as denomAmountToChainDenomAmountToFixed, Zf as domainHash, _f as getExactDecimalsFromNumber, _p as protobufTimestampToUnixSeconds, af as derivativePriceToChainPrice, ap as ripemd160, bf as isNumber, cf as derivativeQuantityFromChainQuantityToFixed, cp as ofacList, df as formatAmountToAllowableAmount, dp as getGasOptionsBasedOnMessage, ef as derivativeMarginFromChainMarginToFixed, ep as privateKeyHashToPublicKey, ff as formatAmountToAllowableDecimals, fp as getGasPriceBasedOnMessage, gf as formatPriceToAllowablePrice, gp as protobufTimestampToUnixMs, hf as formatPriceToAllowableDecimals, hp as protobufTimestampToDate, if as derivativePriceFromChainPriceToFixed, ip as publicKeyToAddress, jd as recoverTypedSignaturePubKey, jf as bigIntToNumber, kf as spotQuantityToChainQuantityToFixed, lf as derivativeQuantityToChainQuantity, lp as getGrpcWebTransport, mf as formatNumberToAllowableTensMultiplier, mp as makeTimeoutTimestampInNs, nf as derivativeMarginToChainMarginToFixed, np as privateKeyToPublicKey, of as derivativePriceToChainPriceToFixed, op as sanitizeTypedData, pf as formatNumberToAllowableDecimals, pp as makeTimeoutTimestamp, qd as denomAmountFromChainDenomAmount, qf as TypedDataUtilsHashStruct, rf as derivativePriceFromChainPrice, rp as privateKeyToPublicKeyBase64, sf as derivativeQuantityFromChainQuantity, sp as sha256, tf as derivativeMarginToChainMargin, tp as privateKeyHashToPublicKeyBase64, uf as derivativeQuantityToChainQuantityToFixed, up as getFixedGasLimitBasedOnMessage, vf as getSignificantDecimalsFromNumber, wf as spotPriceToChainPrice, xf as numberToCosmosSdkDecString, yf as getTensMultiplier, zd as paginationUint8ArrayToString, zf as isReactNative } from "./index-He9ky3uA.cjs";
5
5
  import "./BaseGrpcConsumer-Cet1W6Kq.cjs";
6
6
  import "./index-C7RKR121.cjs";
7
7
  import "./index-CSZ8iAjq.cjs";
@@ -10,7 +10,7 @@ import { a as getEthereumAddress, c as getSubaccountId, d as removeHexPrefix, i
10
10
  import { a as fromBase64, c as hexToBuff, d as toBase64, f as toUtf8, h as uint8ArrayToString, i as concatUint8Arrays, l as hexToUint8Array, m as uint8ArrayToHex, n as base64ToUtf8, o as fromUtf8, p as uint8ArrayToBase64, r as binaryToBase64, s as hexToBase64, t as base64ToUint8Array, u as stringToUint8Array } from "./encoding-light-D-6m9tHO.cjs";
11
11
  import { a as BECH32_PUBKEY_CONS_PREFIX, i as BECH32_PUBKEY_ACC_PREFIX, n as BECH32_ADDR_CONS_PREFIX, o as BECH32_PUBKEY_VAL_PREFIX, r as BECH32_ADDR_VAL_PREFIX, s as DEFAULT_DERIVATION_PATH, t as BECH32_ADDR_ACC_PREFIX } from "./constants-DQTrjP5R.cjs";
12
12
  import "./index-C5x1GjO5.cjs";
13
- import "./index-BejQEqGF.cjs";
14
- import "./index-Bml8CUoG.cjs";
13
+ import "./index-CCRCRvKd.cjs";
14
+ import "./index-BADdhB_k.cjs";
15
15
  import "./index-Ch7IIzzg.cjs";
16
- export { BECH32_ADDR_ACC_PREFIX, BECH32_ADDR_CONS_PREFIX, BECH32_ADDR_VAL_PREFIX, BECH32_PUBKEY_ACC_PREFIX, BECH32_PUBKEY_CONS_PREFIX, BECH32_PUBKEY_VAL_PREFIX, DEFAULT_DERIVATION_PATH, GrpcWebFetchTransport, SignTypedDataVersionV4, TypedDataUtilsHashStruct, TypedDataUtilsSanitizeData, TypedMessageV4, addHexPrefix, amountToCosmosSdkDecAmount, base64ToUint8Array, base64ToUtf8, bigIntReplacer, bigIntToNumber, bigIntToString, binaryToBase64, bytesToHex, concatUint8Arrays, cosmosSdkDecToBigNumber, decompressPubKey, denomAmountFromChainDenomAmount, denomAmountFromChainDenomAmountToFixed, denomAmountFromGrpcChainDenomAmount, denomAmountToChainDenomAmount, denomAmountToChainDenomAmountToFixed, denomAmountToGrpcChainDenomAmount, derivativeMarginFromChainMargin, derivativeMarginFromChainMarginToFixed, derivativeMarginToChainMargin, derivativeMarginToChainMarginToFixed, derivativePriceFromChainPrice, derivativePriceFromChainPriceToFixed, derivativePriceToChainPrice, derivativePriceToChainPriceToFixed, derivativeQuantityFromChainQuantity, derivativeQuantityFromChainQuantityToFixed, derivativeQuantityToChainQuantity, derivativeQuantityToChainQuantityToFixed, domainHash, fetchAllWithPagination, fetchAllWithTokenPagination, formatAmountToAllowableAmount, formatAmountToAllowableDecimals, formatNumberToAllowableDecimals, formatNumberToAllowableTensMultiplier, formatPriceToAllowableDecimals, formatPriceToAllowablePrice, fromBase64, fromUtf8, getAddressFromInjectiveAddress, getChecksumAddress, getDefaultSubaccountId, getDerivativeMarketDecimals, getDerivativeMarketTensMultiplier, getErrorMessage, getEthereumAddress, getExactDecimalsFromNumber, getGasPriceBasedOnMessage, getGrpcWebTransport, getInjectiveAddress, getInjectiveAddressFromSubaccountId, getSignificantDecimalsFromNumber, getSpotMarketDecimals, getSpotMarketTensMultiplier, getSubaccountId, getTensMultiplier, grpcCoinToUiCoin, grpcPaginationToPagination, grpcPagingToPaging, grpcPagingToPagingV2, hashToHex, hexToBase64, hexToBuff, hexToBytes, hexToNumber, hexToUint8Array, isBrowser, isCw20ContractAddress, isJsonString, isNode, isNumber, isReactNative, isServerSide, makeTimeoutTimestamp, makeTimeoutTimestampInNs, messageHash, numberToCosmosSdkDecString, objectToJson, ofacList, pageRequestToGrpcPageRequestV2, paginationRequestFromPagination, paginationUint8ArrayToString, parseCoins, privateKeyHashToPublicKey, privateKeyHashToPublicKeyBase64, privateKeyToPublicKey, privateKeyToPublicKeyBase64, protoObjectToJson, protobufTimestampToDate, protobufTimestampToUnixMs, protobufTimestampToUnixSeconds, publicKeyToAddress, recoverTypedSignaturePubKey, removeHexPrefix, ripemd160, safeBigIntStringify, sanitizeTypedData, sha256, sortObjectByKeys, sortObjectByKeysWithReduce, spotPriceFromChainPrice, spotPriceFromChainPriceToFixed, spotPriceToChainPrice, spotPriceToChainPriceToFixed, spotQuantityFromChainQuantity, spotQuantityFromChainQuantityToFixed, spotQuantityToChainQuantity, spotQuantityToChainQuantityToFixed, stringToUint8Array, toBase64, toUtf8, uint8ArrayToBase64, uint8ArrayToHex, uint8ArrayToString };
16
+ export { BECH32_ADDR_ACC_PREFIX, BECH32_ADDR_CONS_PREFIX, BECH32_ADDR_VAL_PREFIX, BECH32_PUBKEY_ACC_PREFIX, BECH32_PUBKEY_CONS_PREFIX, BECH32_PUBKEY_VAL_PREFIX, DEFAULT_DERIVATION_PATH, GrpcWebFetchTransport, SignTypedDataVersionV4, TypedDataUtilsHashStruct, TypedDataUtilsSanitizeData, TypedMessageV4, addHexPrefix, amountToCosmosSdkDecAmount, base64ToUint8Array, base64ToUtf8, bigIntReplacer, bigIntToNumber, bigIntToString, binaryToBase64, bytesToHex, concatUint8Arrays, cosmosSdkDecToBigNumber, decompressPubKey, denomAmountFromChainDenomAmount, denomAmountFromChainDenomAmountToFixed, denomAmountFromGrpcChainDenomAmount, denomAmountToChainDenomAmount, denomAmountToChainDenomAmountToFixed, denomAmountToGrpcChainDenomAmount, derivativeMarginFromChainMargin, derivativeMarginFromChainMarginToFixed, derivativeMarginToChainMargin, derivativeMarginToChainMarginToFixed, derivativePriceFromChainPrice, derivativePriceFromChainPriceToFixed, derivativePriceToChainPrice, derivativePriceToChainPriceToFixed, derivativeQuantityFromChainQuantity, derivativeQuantityFromChainQuantityToFixed, derivativeQuantityToChainQuantity, derivativeQuantityToChainQuantityToFixed, domainHash, fetchAllWithPagination, fetchAllWithTokenPagination, formatAmountToAllowableAmount, formatAmountToAllowableDecimals, formatNumberToAllowableDecimals, formatNumberToAllowableTensMultiplier, formatPriceToAllowableDecimals, formatPriceToAllowablePrice, fromBase64, fromUtf8, getAddressFromInjectiveAddress, getChecksumAddress, getDefaultSubaccountId, getDerivativeMarketDecimals, getDerivativeMarketTensMultiplier, getErrorMessage, getEthereumAddress, getExactDecimalsFromNumber, getFixedGasLimitBasedOnMessage, getGasOptionsBasedOnMessage, getGasPriceBasedOnMessage, getGrpcWebTransport, getInjectiveAddress, getInjectiveAddressFromSubaccountId, getSignificantDecimalsFromNumber, getSpotMarketDecimals, getSpotMarketTensMultiplier, getSubaccountId, getTensMultiplier, grpcCoinToUiCoin, grpcPaginationToPagination, grpcPagingToPaging, grpcPagingToPagingV2, hashToHex, hexToBase64, hexToBuff, hexToBytes, hexToNumber, hexToUint8Array, isBrowser, isCw20ContractAddress, isJsonString, isNode, isNumber, isReactNative, isServerSide, makeTimeoutTimestamp, makeTimeoutTimestampInNs, messageHash, numberToCosmosSdkDecString, objectToJson, ofacList, pageRequestToGrpcPageRequestV2, paginationRequestFromPagination, paginationUint8ArrayToString, parseCoins, privateKeyHashToPublicKey, privateKeyHashToPublicKeyBase64, privateKeyToPublicKey, privateKeyToPublicKeyBase64, protoObjectToJson, protobufTimestampToDate, protobufTimestampToUnixMs, protobufTimestampToUnixSeconds, publicKeyToAddress, recoverTypedSignaturePubKey, removeHexPrefix, ripemd160, safeBigIntStringify, sanitizeTypedData, sha256, sortObjectByKeys, sortObjectByKeysWithReduce, spotPriceFromChainPrice, spotPriceFromChainPriceToFixed, spotPriceToChainPrice, spotPriceToChainPriceToFixed, spotQuantityFromChainQuantity, spotQuantityFromChainQuantityToFixed, spotQuantityToChainQuantity, spotQuantityToChainQuantityToFixed, stringToUint8Array, toBase64, toUtf8, uint8ArrayToBase64, uint8ArrayToHex, uint8ArrayToString };
@@ -1,5 +1,5 @@
1
1
  import { t as _defineProperty } from "./defineProperty-BwBXXd7t.js";
2
- import { t as BaseGrpcConsumer } from "./BaseGrpcConsumer-DEDRwnCk.js";
2
+ import { t as BaseGrpcConsumer } from "./BaseGrpcConsumer-B2qNaBaq.js";
3
3
  import { IndexerErrorModule } from "@injectivelabs/exceptions";
4
4
  import * as PointsSvcPb from "@injectivelabs/abacus-proto-ts-v2/generated/points_svc_pb";
5
5
  import { PointsSvcClient } from "@injectivelabs/abacus-proto-ts-v2/generated/points_svc_pb.client";
@@ -1,6 +1,6 @@
1
1
  import { t as _defineProperty } from "./defineProperty-BwBXXd7t.js";
2
- import { n as getGrpcWebTransport } from "./grpc-D2EQHGkK.js";
3
- import { i as GrpcStatusCode } from "./light-BBrX6IRm.js";
2
+ import { i as GrpcStatusCode } from "./light-BUFhVek8.js";
3
+ import { n as getGrpcWebTransport } from "./grpc-CSo1TcHx.js";
4
4
  import { GrpcUnaryRequestException, TransactionException, UnspecifiedErrorCode, grpcErrorCodeToErrorCode } from "@injectivelabs/exceptions";
5
5
  import { RpcError } from "@protobuf-ts/runtime-rpc";
6
6
 
@@ -1,4 +1,4 @@
1
- import { t as BaseGrpcConsumer } from "./BaseGrpcConsumer-DEDRwnCk.js";
1
+ import { t as BaseGrpcConsumer } from "./BaseGrpcConsumer-B2qNaBaq.js";
2
2
 
3
3
  //#region src/client/base/BaseIndexerGrpcConsumer.ts
4
4
  /**
@@ -1,7 +1,7 @@
1
1
  import { t as _defineProperty } from "./defineProperty-BwBXXd7t.js";
2
- import { b as denomAmountFromGrpcChainDenomAmount } from "./utils-BvlndkVI.js";
3
- import { o as ChainModule } from "./ChainRestTendermintApi-BnJPMbSU.js";
4
- import { t as BaseGrpcConsumer } from "./BaseGrpcConsumer-DEDRwnCk.js";
2
+ import { b as denomAmountFromGrpcChainDenomAmount } from "./utils-gwPCLHN6.js";
3
+ import { o as ChainModule } from "./ChainRestTendermintApi-CXHeGWjk.js";
4
+ import { t as BaseGrpcConsumer } from "./BaseGrpcConsumer-B2qNaBaq.js";
5
5
  import { toHumanReadable } from "@injectivelabs/utils";
6
6
  import * as InjectiveExchangeV1Beta1QueryPb from "@injectivelabs/core-proto-ts-v2/generated/injective/exchange/v1beta1/query_pb";
7
7
  import { QueryClient } from "@injectivelabs/core-proto-ts-v2/generated/injective/exchange/v1beta1/query_pb.client";
@@ -1,7 +1,7 @@
1
1
  import { h as uint8ArrayToString, p as uint8ArrayToBase64 } from "./encoding-light-BpntDob-.js";
2
2
  import { t as _defineProperty } from "./defineProperty-BwBXXd7t.js";
3
- import { u as ChainGrpcCommonTransformer } from "./utils-BvlndkVI.js";
4
- import { t as BaseGrpcConsumer } from "./BaseGrpcConsumer-DEDRwnCk.js";
3
+ import { u as ChainGrpcCommonTransformer } from "./utils-gwPCLHN6.js";
4
+ import { t as BaseGrpcConsumer } from "./BaseGrpcConsumer-B2qNaBaq.js";
5
5
  import { t as BaseRestConsumer } from "./BaseRestConsumer-BjN9JApr.js";
6
6
  import { ChainErrorModule, HttpRequestException, UnspecifiedErrorCode } from "@injectivelabs/exceptions";
7
7
  import * as InjectiveCryptoV1Beta1Ethsecp256k1KeysPb from "@injectivelabs/core-proto-ts-v2/generated/injective/crypto/v1beta1/ethsecp256k1/keys_pb";
@@ -1,7 +1,11 @@
1
1
  import { t as _defineProperty } from "./defineProperty-BwBXXd7t.js";
2
- import { t as BaseGrpcConsumer } from "./BaseGrpcConsumer-DEDRwnCk.js";
2
+ import { t as BaseGrpcConsumer } from "./BaseGrpcConsumer-B2qNaBaq.js";
3
+ import * as PlatformServicesArchiverPb from "@injectivelabs/platform-services-proto-ts-v2/generated/goagen_api_injective_archiver_rpc_pb";
4
+ import { InjectiveArchiverRPCClient } from "@injectivelabs/platform-services-proto-ts-v2/generated/goagen_api_injective_archiver_rpc_pb.client";
3
5
  import * as PlatformServicesPositionsPb from "@injectivelabs/platform-services-proto-ts-v2/generated/goagen_api_positions_service_pb";
4
6
  import { PositionsServiceClient } from "@injectivelabs/platform-services-proto-ts-v2/generated/goagen_api_positions_service_pb.client";
7
+ import * as PlatformServicesChartsPb from "@injectivelabs/platform-services-proto-ts-v2/generated/goagen_api_charts_trading_view_service_pb";
8
+ import { ChartsTradingViewServiceClient } from "@injectivelabs/platform-services-proto-ts-v2/generated/goagen_api_charts_trading_view_service_pb.client";
5
9
 
6
10
  //#region src/client/platformServices/transformers/index.ts
7
11
  var PlatformServicesGrpcPositionsTransformer = class PlatformServicesGrpcPositionsTransformer {
@@ -10,6 +14,7 @@ var PlatformServicesGrpcPositionsTransformer = class PlatformServicesGrpcPositio
10
14
  return {
11
15
  id: position.id,
12
16
  pnl: position.pnl,
17
+ pnlUsd: position.pnlUsd,
13
18
  fees: position.fees,
14
19
  side: position.side,
15
20
  state: position.state,
@@ -46,6 +51,7 @@ var PlatformServicesGrpcPositionsTransformer = class PlatformServicesGrpcPositio
46
51
  static grpcPositionTradeToPositionTrade(trade) {
47
52
  return {
48
53
  pnl: trade.pnl,
54
+ pnlUsd: trade.pnlUsd,
49
55
  amount: trade.amount,
50
56
  timestamp: trade.timestamp,
51
57
  eventType: trade.eventType,
@@ -127,6 +133,141 @@ var PlatformServicesGrpcPositionsTransformer = class PlatformServicesGrpcPositio
127
133
  };
128
134
  }
129
135
  };
136
+ var PlatformServicesGrpcChartsTransformer = class {
137
+ static grpcMarketHistoryToMarketHistory(response) {
138
+ return {
139
+ s: response.s,
140
+ t: response.t,
141
+ o: response.o,
142
+ h: response.h,
143
+ l: response.l,
144
+ c: response.c,
145
+ v: response.v
146
+ };
147
+ }
148
+ static grpcMarketSummaryToMarketSummary(summary) {
149
+ return {
150
+ open: summary.open,
151
+ high: summary.high,
152
+ low: summary.low,
153
+ volume: summary.volume,
154
+ price: summary.price,
155
+ change: summary.change,
156
+ marketId: summary.marketId
157
+ };
158
+ }
159
+ };
160
+ var PlatformServicesGrpcArchiverTransformer = class PlatformServicesGrpcArchiverTransformer {
161
+ static grpcHistoricalDetailedBalanceToHistoricalDetailedBalance(balance) {
162
+ return {
163
+ spot: balance.spot,
164
+ perp: balance.perp,
165
+ staking: balance.staking
166
+ };
167
+ }
168
+ static grpcHistoricalBalanceToHistoricalBalance(balance) {
169
+ return {
170
+ t: balance.t,
171
+ v: balance.v,
172
+ dv: balance.dv.map(PlatformServicesGrpcArchiverTransformer.grpcHistoricalDetailedBalanceToHistoricalDetailedBalance)
173
+ };
174
+ }
175
+ static grpcBalanceToBalance(response) {
176
+ return { historicalBalance: response.historicalBalance ? PlatformServicesGrpcArchiverTransformer.grpcHistoricalBalanceToHistoricalBalance(response.historicalBalance) : void 0 };
177
+ }
178
+ static grpcAccountStatsToAccountStats(response) {
179
+ return {
180
+ pnl: response.pnl,
181
+ stake: response.stake,
182
+ volume: response.volume,
183
+ account: response.account
184
+ };
185
+ }
186
+ static grpcHistoricalDetailedPnlToHistoricalDetailedPnl(pnl) {
187
+ return {
188
+ rpnl: pnl.rpnl,
189
+ upnl: pnl.upnl
190
+ };
191
+ }
192
+ static grpcHistoricalRpnlToHistoricalRpnl(rpnl) {
193
+ return {
194
+ t: rpnl.t,
195
+ v: rpnl.v,
196
+ dv: rpnl.dv.map(PlatformServicesGrpcArchiverTransformer.grpcHistoricalDetailedPnlToHistoricalDetailedPnl)
197
+ };
198
+ }
199
+ static grpcRpnlToRpnl(response) {
200
+ return { historicalRpnl: response.historicalRpnl ? PlatformServicesGrpcArchiverTransformer.grpcHistoricalRpnlToHistoricalRpnl(response.historicalRpnl) : void 0 };
201
+ }
202
+ static grpcPriceLevelToPriceLevel(price) {
203
+ return {
204
+ price: price.price,
205
+ quantity: price.quantity,
206
+ timestamp: price.timestamp.toString()
207
+ };
208
+ }
209
+ static grpcHistoricalTradeToHistoricalTrade(trade) {
210
+ return {
211
+ cid: trade.cid,
212
+ fee: trade.fee,
213
+ flags: trade.flags,
214
+ account: trade.account,
215
+ tradeId: trade.tradeId,
216
+ marketId: trade.marketId,
217
+ usdValue: trade.usdValue,
218
+ fundingRate: trade.fundingRate,
219
+ marketType: trade.marketType,
220
+ executionSide: trade.executionSide,
221
+ feeRecipient: trade.feeRecipient,
222
+ subaccountId: trade.subaccountId,
223
+ tradeDirection: trade.tradeDirection,
224
+ executionType: trade.executionType,
225
+ executedAt: trade.executedAt.toString(),
226
+ executedHeight: trade.executedHeight.toString(),
227
+ price: trade.price ? PlatformServicesGrpcArchiverTransformer.grpcPriceLevelToPriceLevel(trade.price) : void 0
228
+ };
229
+ }
230
+ static grpcHistoricalTradesToHistoricalTrades(response) {
231
+ return {
232
+ next: response.next,
233
+ lastHeight: response.lastHeight.toString(),
234
+ lastTime: response.lastTime.toString(),
235
+ trades: response.trades.map(PlatformServicesGrpcArchiverTransformer.grpcHistoricalTradeToHistoricalTrade)
236
+ };
237
+ }
238
+ };
239
+
240
+ //#endregion
241
+ //#region src/client/platformServices/grpc/ArchiverGrpcApi.ts
242
+ var ArchiverGrpcApi = class extends BaseGrpcConsumer {
243
+ constructor(..._args) {
244
+ super(..._args);
245
+ _defineProperty(this, "module", "platform-services");
246
+ }
247
+ get client() {
248
+ return this.initClient(InjectiveArchiverRPCClient);
249
+ }
250
+ async fetchBalance(params) {
251
+ const request = PlatformServicesArchiverPb.BalanceRequest.create(params);
252
+ const response = await this.executeGrpcCall(request, this.client.balance.bind(this.client));
253
+ return PlatformServicesGrpcArchiverTransformer.grpcBalanceToBalance(response);
254
+ }
255
+ async fetchAccountStats(params) {
256
+ const request = PlatformServicesArchiverPb.AccountStatsRequest.create(params);
257
+ const response = await this.executeGrpcCall(request, this.client.accountStats.bind(this.client));
258
+ return PlatformServicesGrpcArchiverTransformer.grpcAccountStatsToAccountStats(response);
259
+ }
260
+ async fetchRpnl(params) {
261
+ const request = PlatformServicesArchiverPb.RpnlRequest.create(params);
262
+ const response = await this.executeGrpcCall(request, this.client.rpnl.bind(this.client));
263
+ return PlatformServicesGrpcArchiverTransformer.grpcRpnlToRpnl(response);
264
+ }
265
+ async fetchHistoricalTrades(params) {
266
+ const request = PlatformServicesArchiverPb.HistoricalTradesRequest.create(params);
267
+ const response = await this.executeGrpcCall(request, this.client.historicalTrades.bind(this.client));
268
+ return PlatformServicesGrpcArchiverTransformer.grpcHistoricalTradesToHistoricalTrades(response);
269
+ }
270
+ };
130
271
 
131
272
  //#endregion
132
273
  //#region src/client/platformServices/grpc/SocialTradingGrpcApi.ts
@@ -212,4 +353,35 @@ var SocialTradingGrpcApi = class extends BaseGrpcConsumer {
212
353
  };
213
354
 
214
355
  //#endregion
215
- export { SocialTradingGrpcApi as t };
356
+ //#region src/client/platformServices/grpc/ChartsTradingViewGrpcApi.ts
357
+ var ChartsTradingViewGrpcApi = class extends BaseGrpcConsumer {
358
+ constructor(..._args) {
359
+ super(..._args);
360
+ _defineProperty(this, "module", "platform-services");
361
+ }
362
+ get client() {
363
+ return this.initClient(ChartsTradingViewServiceClient);
364
+ }
365
+ async fetchDerivativeMarketHistory(params) {
366
+ const request = PlatformServicesChartsPb.DerivativeMarketHistoryRequest.create(params);
367
+ const response = await this.executeGrpcCall(request, this.client.derivativeMarketHistory.bind(this.client));
368
+ return PlatformServicesGrpcChartsTransformer.grpcMarketHistoryToMarketHistory(response);
369
+ }
370
+ async fetchSpotMarketHistory(params) {
371
+ const request = PlatformServicesChartsPb.SpotMarketHistoryRequest.create(params);
372
+ const response = await this.executeGrpcCall(request, this.client.spotMarketHistory.bind(this.client));
373
+ return PlatformServicesGrpcChartsTransformer.grpcMarketHistoryToMarketHistory(response);
374
+ }
375
+ async fetchSpotMarketSummary(params) {
376
+ const request = PlatformServicesChartsPb.SpotMarketSummaryRequest.create(params);
377
+ const response = await this.executeGrpcCall(request, this.client.spotMarketSummary.bind(this.client));
378
+ return PlatformServicesGrpcChartsTransformer.grpcMarketSummaryToMarketSummary(response);
379
+ }
380
+ async fetchAllSpotMarketSummaries(params) {
381
+ const request = PlatformServicesChartsPb.AllSpotMarketSummaryRequest.create(params);
382
+ return (await this.executeGrpcCall(request, this.client.allSpotMarketSummary.bind(this.client))).field.map(PlatformServicesGrpcChartsTransformer.grpcMarketSummaryToMarketSummary);
383
+ }
384
+ };
385
+
386
+ //#endregion
387
+ export { SocialTradingGrpcApi as n, ArchiverGrpcApi as r, ChartsTradingViewGrpcApi as t };
@@ -1,6 +1,6 @@
1
1
  import { m as uint8ArrayToHex, p as uint8ArrayToBase64, t as base64ToUint8Array } from "./encoding-light-BpntDob-.js";
2
2
  import { t as _defineProperty } from "./defineProperty-BwBXXd7t.js";
3
- import { F as PublicKey, k as getPublicKey, n as PrivateKey } from "./accounts-bOFI_1wE.js";
3
+ import { F as PublicKey, k as getPublicKey, n as PrivateKey } from "./accounts-CSXPhB6W.js";
4
4
  import * as CosmosBaseV1Beta1CoinPb from "@injectivelabs/core-proto-ts-v2/generated/cosmos/base/v1beta1/coin_pb";
5
5
  import * as InjectiveTypesV1Beta1AccountPb from "@injectivelabs/core-proto-ts-v2/generated/injective/types/v1beta1/account_pb";
6
6
  import * as IbcCoreClientV1ClientPb from "@injectivelabs/core-proto-ts-v2/generated/ibc/core/client/v1/client_pb";
@@ -1,7 +1,7 @@
1
1
  import { d as toBase64, o as fromUtf8 } from "./encoding-light-BpntDob-.js";
2
2
  import { t as _defineProperty } from "./defineProperty-BwBXXd7t.js";
3
- import { kt as safeBigIntStringify } from "./utils-BvlndkVI.js";
4
- import { t as MsgBase } from "./MsgBase-CmMIxNsl.js";
3
+ import { kt as safeBigIntStringify } from "./utils-gwPCLHN6.js";
4
+ import { t as MsgBase } from "./MsgBase-BQlZFcm-.js";
5
5
  import { GeneralException } from "@injectivelabs/exceptions";
6
6
  import * as InjectiveWasmxV1TxPb from "@injectivelabs/core-proto-ts-v2/generated/injective/wasmx/v1/tx_pb";
7
7
 
@@ -1,7 +1,7 @@
1
1
  import { m as uint8ArrayToHex, t as base64ToUint8Array, u as stringToUint8Array } from "./encoding-light-BpntDob-.js";
2
2
  import { t as _defineProperty } from "./defineProperty-BwBXXd7t.js";
3
- import { kt as safeBigIntStringify, t as recoverTypedSignaturePubKey } from "./utils-BvlndkVI.js";
4
- import { t as BaseIndexerGrpcConsumer } from "./BaseIndexerGrpcConsumer-DkRSQkU9.js";
3
+ import { kt as safeBigIntStringify, t as recoverTypedSignaturePubKey } from "./utils-gwPCLHN6.js";
4
+ import { t as BaseIndexerGrpcConsumer } from "./BaseIndexerGrpcConsumer-DKboflD4.js";
5
5
  import * as CosmosTxV1Beta1TxPb from "@injectivelabs/core-proto-ts-v2/generated/cosmos/tx/v1beta1/tx_pb";
6
6
  import { DEFAULT_BRIDGE_FEE_DENOM, DEFAULT_BRIDGE_FEE_PRICE, DEFAULT_EXCHANGE_LIMIT, DEFAULT_GAS_LIMIT } from "@injectivelabs/utils";
7
7
  import { ErrorType, IndexerErrorModule, TransactionException, UnspecifiedErrorCode } from "@injectivelabs/exceptions";
@@ -1,11 +1,11 @@
1
1
  import { f as toUtf8, i as concatUint8Arrays, l as hexToUint8Array, m as uint8ArrayToHex, o as fromUtf8, p as uint8ArrayToBase64, r as binaryToBase64, t as base64ToUint8Array, u as stringToUint8Array } from "./encoding-light-BpntDob-.js";
2
2
  import { t as _defineProperty } from "./defineProperty-BwBXXd7t.js";
3
- import { I as Address, j as createAny } from "./accounts-bOFI_1wE.js";
4
- import { K as numberToCosmosSdkDecString, at as domainHash, kt as safeBigIntStringify, st as messageHash, vt as bigIntToString } from "./utils-BvlndkVI.js";
5
- import { a as getEthereumAddress } from "./address-light-B2JvY3Or.js";
6
- import { a as objectKeysToEip712Types, n as prepareSignBytes, o as patchOrderTypesWithExpirationBlock, t as MsgBase } from "./MsgBase-CmMIxNsl.js";
7
- import { t as ChainGrpcExchangeApi } from "./ChainGrpcExchangeApi-TO68UPsx.js";
8
- import { a as dataToExecData$1, i as ExecArgBase } from "./ExecArgNeptuneWithdraw-BM5u-FxH.js";
3
+ import { I as Address, j as createAny } from "./accounts-CSXPhB6W.js";
4
+ import { K as numberToCosmosSdkDecString, at as domainHash, kt as safeBigIntStringify, st as messageHash, vt as bigIntToString } from "./utils-gwPCLHN6.js";
5
+ import { a as getEthereumAddress } from "./address-light-CwLNB73Y.js";
6
+ import { a as objectKeysToEip712Types, n as prepareSignBytes, o as patchOrderTypesWithExpirationBlock, t as MsgBase } from "./MsgBase-BQlZFcm-.js";
7
+ import { t as ChainGrpcExchangeApi } from "./ChainGrpcExchangeApi-AvCJkW7O.js";
8
+ import { a as dataToExecData$1, i as ExecArgBase } from "./ExecArgNeptuneWithdraw-BzyfMVSe.js";
9
9
  import { keccak256 } from "viem";
10
10
  import { BigNumber, DEFAULT_BRIDGE_FEE_AMOUNT, DEFAULT_BRIDGE_FEE_DENOM, toBigNumber, toChainFormat, toPascalCase } from "@injectivelabs/utils";
11
11
  import { GeneralException } from "@injectivelabs/exceptions";
@@ -1,5 +1,5 @@
1
1
  import { t as _defineProperty } from "./defineProperty-BwBXXd7t.js";
2
- import { t as BaseIndexerGrpcConsumer } from "./BaseIndexerGrpcConsumer-DkRSQkU9.js";
2
+ import { t as BaseIndexerGrpcConsumer } from "./BaseIndexerGrpcConsumer-DKboflD4.js";
3
3
  import { IndexerErrorModule } from "@injectivelabs/exceptions";
4
4
  import * as DmmPb from "@injectivelabs/olp-proto-ts-v2/generated/goagen_olp_injective_dmm_v2_pb";
5
5
  import { InjectiveDmmV2Client } from "@injectivelabs/olp-proto-ts-v2/generated/goagen_olp_injective_dmm_v2_pb.client";
@@ -1,7 +1,7 @@
1
1
  import { a as fromBase64, d as toBase64, f as toUtf8, r as binaryToBase64 } from "./encoding-light-BpntDob-.js";
2
2
  import { t as _defineProperty } from "./defineProperty-BwBXXd7t.js";
3
- import { g as ChainGrpcWasmApi } from "./chain-Jr63sBTP.js";
4
- import { n as MsgExecuteContractCompat, r as ExecArgNeptuneDeposit, t as ExecArgNeptuneWithdraw } from "./ExecArgNeptuneWithdraw-BM5u-FxH.js";
3
+ import { g as ChainGrpcWasmApi } from "./chain-B1k6xknc.js";
4
+ import { n as MsgExecuteContractCompat, r as ExecArgNeptuneDeposit, t as ExecArgNeptuneWithdraw } from "./ExecArgNeptuneWithdraw-BzyfMVSe.js";
5
5
  import { GeneralException } from "@injectivelabs/exceptions";
6
6
  import { Network, getNetworkEndpoints, isMainnet } from "@injectivelabs/networks";
7
7
 
@@ -1,12 +1,12 @@
1
1
  import { h as uint8ArrayToString } from "./encoding-light-BpntDob-.js";
2
2
  import { t as _defineProperty } from "./defineProperty-BwBXXd7t.js";
3
- import { Ct as isJsonString, _t as bigIntToNumber, o as grpcPagingToPagingV2, r as fetchAllWithTokenPagination, vt as bigIntToString } from "./utils-BvlndkVI.js";
4
- import { d as StreamDisconnectReason, f as StreamEvent, g as TradeDirection, h as TokenVerification, i as GrpcStatusCode, l as OrderState, m as TokenType, p as StreamOperation } from "./light-BBrX6IRm.js";
3
+ import { Ct as isJsonString, _t as bigIntToNumber, o as grpcPagingToPagingV2, r as fetchAllWithTokenPagination, vt as bigIntToString } from "./utils-gwPCLHN6.js";
4
+ import { d as StreamDisconnectReason, f as StreamEvent, g as TradeDirection, h as TokenVerification, i as GrpcStatusCode, l as OrderState, m as TokenType, p as StreamOperation } from "./light-BUFhVek8.js";
5
5
  import { t as StreamState } from "./stream-AVOxjM-h.js";
6
- import { n as GrpcWebRpcTransport } from "./BaseGrpcConsumer-DEDRwnCk.js";
7
- import { t as BaseIndexerGrpcConsumer } from "./BaseIndexerGrpcConsumer-DkRSQkU9.js";
6
+ import { n as GrpcWebRpcTransport } from "./BaseGrpcConsumer-B2qNaBaq.js";
7
+ import { t as BaseIndexerGrpcConsumer } from "./BaseIndexerGrpcConsumer-DKboflD4.js";
8
8
  import { t as BaseRestConsumer } from "./BaseRestConsumer-BjN9JApr.js";
9
- import { f as GrpcDecodeError, m as WsState, p as WsDisconnectReason, r as IndexerModule } from "./IndexerGrpcWeb3GwApi-Dzaq-nAM.js";
9
+ import { f as GrpcDecodeError, m as WsState, p as WsDisconnectReason, r as IndexerModule } from "./IndexerGrpcWeb3GwApi-DAMdV0I4.js";
10
10
  import { BigNumber, toBigNumber, toHumanReadable } from "@injectivelabs/utils";
11
11
  import { GeneralException, HttpRequestException, UnspecifiedErrorCode } from "@injectivelabs/exceptions";
12
12
  import * as InjectiveRFQExchangeRpcPb from "@injectivelabs/indexer-proto-ts-v2/generated/injective_rfq_rpc_pb";
@@ -1,5 +1,5 @@
1
1
  import { t as _defineProperty } from "./defineProperty-BwBXXd7t.js";
2
- import { t as BaseGrpcConsumer } from "./BaseGrpcConsumer-DEDRwnCk.js";
2
+ import { t as BaseGrpcConsumer } from "./BaseGrpcConsumer-B2qNaBaq.js";
3
3
  import { IndexerErrorModule } from "@injectivelabs/exceptions";
4
4
  import * as TcAbacusPb from "@injectivelabs/tc-abacus-proto-ts-v2/generated/injective_tc_abacus_rpc_pb";
5
5
  import { InjectiveTCAbacusRPCClient } from "@injectivelabs/tc-abacus-proto-ts-v2/generated/injective_tc_abacus_rpc_pb.client";
@@ -184,11 +184,15 @@ var TcAbacusGrpcApi = class extends BaseGrpcConsumer {
184
184
  const response = await this.executeGrpcCall(request, this.client.getReferrerElegibility.bind(this.client));
185
185
  return TcAbacusGrpcTransformer.grpcReferrerEligibilityToReferrerEligibility(response);
186
186
  }
187
- async createReferrerCode(address, code) {
187
+ async createReferrerCode(address, code, params) {
188
+ const { signature, expiresAt, evmChainId } = params || {};
188
189
  const request = TcAbacusPb.CreateReferrerCodeRequest.create({
189
190
  code,
190
191
  address
191
192
  });
193
+ if (signature) request.signature = signature;
194
+ if (expiresAt !== void 0) request.expiresAt = BigInt(expiresAt);
195
+ if (evmChainId !== void 0) request.evmChainId = BigInt(evmChainId);
192
196
  return await this.executeGrpcCall(request, this.client.createReferrerCode.bind(this.client));
193
197
  }
194
198
  async setReferrerCategory(address, category) {
@@ -1,9 +1,9 @@
1
1
  import { f as toUtf8, l as hexToUint8Array, m as uint8ArrayToHex, p as uint8ArrayToBase64, t as base64ToUint8Array, u as stringToUint8Array } from "./encoding-light-BpntDob-.js";
2
2
  import { i as BECH32_PUBKEY_ACC_PREFIX, n as BECH32_ADDR_CONS_PREFIX, r as BECH32_ADDR_VAL_PREFIX, s as DEFAULT_DERIVATION_PATH, t as BECH32_ADDR_ACC_PREFIX } from "./constants-J9ftgKqC.js";
3
3
  import { t as _defineProperty } from "./defineProperty-BwBXXd7t.js";
4
- import { K as numberToCosmosSdkDecString, it as decompressPubKey, kt as safeBigIntStringify, rt as TypedDataUtilsSanitizeData, t as recoverTypedSignaturePubKey } from "./utils-BvlndkVI.js";
5
- import { a as getEthereumAddress, o as getInjectiveAddress } from "./address-light-B2JvY3Or.js";
6
- import { t as MsgBase } from "./MsgBase-CmMIxNsl.js";
4
+ import { K as numberToCosmosSdkDecString, it as decompressPubKey, kt as safeBigIntStringify, rt as TypedDataUtilsSanitizeData, t as recoverTypedSignaturePubKey } from "./utils-gwPCLHN6.js";
5
+ import { a as getEthereumAddress, o as getInjectiveAddress } from "./address-light-CwLNB73Y.js";
6
+ import { t as MsgBase } from "./MsgBase-BQlZFcm-.js";
7
7
  import * as CosmosTxV1Beta1TxPb from "@injectivelabs/core-proto-ts-v2/generated/cosmos/tx/v1beta1/tx_pb";
8
8
  import { hashTypedData, keccak256, toBytes } from "viem";
9
9
  import { DEFAULT_GAS_LIMIT, getDefaultStdFee, getStdFee, toBigNumber, toChainFormat } from "@injectivelabs/utils";
@@ -1,9 +1,9 @@
1
1
  import { d as toBase64, h as uint8ArrayToString, o as fromUtf8, p as uint8ArrayToBase64, t as base64ToUint8Array } from "./encoding-light-BpntDob-.js";
2
2
  import { t as _defineProperty } from "./defineProperty-BwBXXd7t.js";
3
- import { It as protobufTimestampToDate, Rt as protobufTimestampToUnixSeconds, b as denomAmountFromGrpcChainDenomAmount, n as fetchAllWithPagination, u as ChainGrpcCommonTransformer, vt as bigIntToString } from "./utils-BvlndkVI.js";
4
- import { n as bytesToHex } from "./address-light-B2JvY3Or.js";
5
- import { o as ChainModule, p as BondStatus } from "./ChainRestTendermintApi-BnJPMbSU.js";
6
- import { t as BaseGrpcConsumer } from "./BaseGrpcConsumer-DEDRwnCk.js";
3
+ import { Bt as protobufTimestampToUnixSeconds, Rt as protobufTimestampToDate, b as denomAmountFromGrpcChainDenomAmount, n as fetchAllWithPagination, u as ChainGrpcCommonTransformer, vt as bigIntToString } from "./utils-gwPCLHN6.js";
4
+ import { n as bytesToHex } from "./address-light-CwLNB73Y.js";
5
+ import { o as ChainModule, p as BondStatus } from "./ChainRestTendermintApi-CXHeGWjk.js";
6
+ import { t as BaseGrpcConsumer } from "./BaseGrpcConsumer-B2qNaBaq.js";
7
7
  import { t as BaseRestConsumer } from "./BaseRestConsumer-BjN9JApr.js";
8
8
  import { toBigNumber, toHumanReadable } from "@injectivelabs/utils";
9
9
  import { ErrorType, GeneralException, HttpRequestException, UnspecifiedErrorCode } from "@injectivelabs/exceptions";
@@ -1,8 +1,8 @@
1
1
  import "../defineProperty-BwBXXd7t.js";
2
- import "../grpc-D2EQHGkK.js";
3
- import "../light-BBrX6IRm.js";
2
+ import "../light-BUFhVek8.js";
3
+ import "../grpc-CSo1TcHx.js";
4
4
  import "../stream-AVOxjM-h.js";
5
- import "../BaseGrpcConsumer-DEDRwnCk.js";
6
- import { t as AbacusGrpcApi } from "../AbacusGrpcApi-BIHq_AVs.js";
5
+ import "../BaseGrpcConsumer-B2qNaBaq.js";
6
+ import { t as AbacusGrpcApi } from "../AbacusGrpcApi-CLdXH5bZ.js";
7
7
 
8
8
  export { AbacusGrpcApi };