@injectivelabs/sdk-ts 1.18.9 → 1.18.11
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.
- package/dist/cjs/{BaseGrpcConsumer-XU1gXJm6.d.cts → BaseGrpcConsumer-Ba4uw4ZN.d.cts} +1 -1
- package/dist/cjs/{StreamManagerV2-l-Prs2cZ.cjs → StreamManagerV2-DlTHwjnI.cjs} +303 -2
- package/dist/cjs/TcAbacusGrpcApi-QxfMHhQI.cjs +132 -0
- package/dist/cjs/client/abacus.d.cts +4 -4
- package/dist/cjs/client/chain.d.cts +9 -8
- package/dist/cjs/client/indexer.cjs +5 -1
- package/dist/cjs/client/indexer.d.cts +10 -9
- package/dist/cjs/client/olp.d.cts +4 -4
- package/dist/cjs/client/tcAbacus.cjs +6 -0
- package/dist/cjs/client/tcAbacus.d.cts +5 -0
- package/dist/cjs/client/wasm.d.cts +3 -3
- package/dist/cjs/core/accounts.d.cts +9 -8
- package/dist/cjs/core/modules.cjs +1 -1
- package/dist/cjs/core/modules.d.cts +9 -8
- package/dist/cjs/core/tx.cjs +1 -1
- package/dist/cjs/core/tx.d.cts +9 -8
- package/dist/cjs/cosmjs.cjs +2 -2
- package/dist/cjs/cosmjs.d.cts +2 -2
- package/dist/cjs/exports.cjs +2 -2
- package/dist/cjs/exports.d.cts +2 -2
- package/dist/cjs/{index--sK2-HcK.d.cts → index-4xdeGNK4.d.cts} +8 -1
- package/dist/cjs/{index-K2VD9zHZ.d.cts → index-BhsPcNn5.d.cts} +1 -1
- package/dist/cjs/{index-CW3Yxjjk.d.cts → index-CDEYM6Fs.d.cts} +1378 -265
- package/dist/cjs/{index-YxLQKJVw.d.cts → index-CgHU4RQF.d.cts} +1 -1
- package/dist/cjs/{index-DBRk7KBS.d.cts → index-Cur9wjzW.d.cts} +1 -1
- package/dist/cjs/index-D0D2Btyn.d.cts +65 -0
- package/dist/cjs/{index-r0RxGSzR.d.cts → index-DfJ_98xz.d.cts} +2 -2
- package/dist/cjs/{index-DkZCBLFW.d.cts → index-m48Rf9ow.d.cts} +1 -1
- package/dist/cjs/index.cjs +9 -3
- package/dist/cjs/index.d.cts +10 -9
- package/dist/cjs/{service-CuS8x3-T.cjs → service-D7PCdXqp.cjs} +12 -0
- package/dist/cjs/service.cjs +1 -1
- package/dist/cjs/service.d.cts +3 -3
- package/dist/cjs/types.d.cts +2 -2
- package/dist/cjs/utils.d.cts +9 -8
- package/dist/esm/{AbacusGrpcApi-DG807S_D.js → AbacusGrpcApi-Dh2A_RaD.js} +2 -2
- package/dist/esm/{BaseGrpcConsumer-lUDP-V1I.js → BaseGrpcConsumer-CsJHyzUs.js} +2 -2
- package/dist/esm/{BaseGrpcConsumer-CReMIR81.d.ts → BaseGrpcConsumer-DEH9Rq7m.d.ts} +1 -1
- package/dist/esm/{BaseIndexerGrpcConsumer-ByGqwnv0.js → BaseIndexerGrpcConsumer-B_zDF6-R.js} +1 -1
- package/dist/esm/{ChainGrpcExchangeApi-NAgOIabe.js → ChainGrpcExchangeApi-CnWi3kXP.js} +4 -4
- package/dist/esm/{ChainRestTendermintApi-B92SD57B.js → ChainRestTendermintApi-Duz8V3KK.js} +4 -4
- package/dist/esm/{DirectEthSecp256k1Wallet-B0yFLmu-.js → DirectEthSecp256k1Wallet-D-k0846W.js} +3 -3
- package/dist/esm/{ExecArgNeptuneWithdraw-DkvG3TrF.js → ExecArgNeptuneWithdraw-PqmStnen.js} +3 -3
- package/dist/esm/{IndexerGrpcWeb3GwApi-mj4kvjlu.js → IndexerGrpcWeb3GwApi-wVedW8ol.js} +3 -3
- package/dist/esm/{MsgBase-CbjK9owE.js → MsgBase-Cd9l1FGI.js} +1 -1
- package/dist/esm/{MsgSetDenomMetadata-CxTQAJII.js → MsgSetDenomMetadata-HLrc45ya.js} +6 -6
- package/dist/esm/{OLPGrpcApi-CYVKwBCj.js → OLPGrpcApi-ItkvGAWH.js} +2 -2
- package/dist/esm/{QueryTradingStrategyContractTotalStrategies-DIye8SrB.js → QueryTradingStrategyContractTotalStrategies-CDKtJs6H.js} +4 -4
- package/dist/esm/{StreamManagerV2-Bi2Lmzaw.js → StreamManagerV2-BbAZJdT5.js} +286 -10
- package/dist/esm/TcAbacusGrpcApi-DX8y2a33.js +125 -0
- package/dist/esm/{accounts-CltOgZyU.js → accounts-B_bymcv_.js} +3 -3
- package/dist/esm/{chain-BpdM-5x7.js → chain-cZz2uvOr.js} +5 -5
- package/dist/esm/client/abacus.d.ts +4 -4
- package/dist/esm/client/abacus.js +4 -4
- package/dist/esm/client/chain.d.ts +9 -8
- package/dist/esm/client/chain.js +8 -8
- package/dist/esm/client/indexer.d.ts +10 -9
- package/dist/esm/client/indexer.js +10 -10
- package/dist/esm/client/olp.d.ts +4 -4
- package/dist/esm/client/olp.js +5 -5
- package/dist/esm/client/tcAbacus.d.ts +5 -0
- package/dist/esm/client/tcAbacus.js +6 -0
- package/dist/esm/client/wasm.d.ts +3 -3
- package/dist/esm/client/wasm.js +11 -11
- package/dist/esm/core/accounts.d.ts +9 -8
- package/dist/esm/core/accounts.js +5 -5
- package/dist/esm/core/modules.d.ts +9 -8
- package/dist/esm/core/modules.js +14 -14
- package/dist/esm/core/tx.d.ts +9 -8
- package/dist/esm/core/tx.js +11 -11
- package/dist/esm/cosmjs.d.ts +2 -2
- package/dist/esm/cosmjs.js +12 -12
- package/dist/esm/exports.d.ts +2 -2
- package/dist/esm/exports.js +12 -12
- package/dist/esm/index-AiZDHh70.d.ts +65 -0
- package/dist/esm/{index-CzA8Vsvu.d.ts → index-C8crIAg1.d.ts} +1 -1
- package/dist/esm/{index-CyAnGzHK.d.ts → index-CZDITwmg.d.ts} +1 -1
- package/dist/esm/{index-Ct_nWHem.d.ts → index-CgoUDnJ_.d.ts} +1378 -265
- package/dist/esm/{index-2mDHsfhZ.d.ts → index-DKn53Idr.d.ts} +1 -1
- package/dist/esm/{index-C50cGGLl.d.ts → index-DQnG0Shp.d.ts} +1 -1
- package/dist/esm/{index-CSIVgVUj.d.ts → index-DhfsaTNU.d.ts} +8 -1
- package/dist/esm/{index-DCYNIH-b.d.ts → index-ECwAlIYI.d.ts} +2 -2
- package/dist/esm/index.d.ts +10 -9
- package/dist/esm/index.js +23 -22
- package/dist/esm/{service-B_wKHuhK.js → service-CuS3psRy.js} +15 -3
- package/dist/esm/service.d.ts +3 -3
- package/dist/esm/service.js +5 -5
- package/dist/esm/{tx-DMyI6qgw.js → tx-ByxSGpt3.js} +6 -6
- package/dist/esm/types.d.ts +2 -2
- package/dist/esm/types.js +1 -1
- package/dist/esm/utils.d.ts +9 -8
- package/dist/esm/utils.js +2 -2
- package/package.json +28 -7
- /package/dist/cjs/{DirectEthSecp256k1Wallet-BzOQi_Wj.cjs → DirectEthSecp256k1Wallet-L677kLZ7.cjs} +0 -0
- /package/dist/cjs/{tx-GyeN0ufS.cjs → tx-DD4X9BrB.cjs} +0 -0
- /package/dist/cjs/{tx_pb-DDTuVb3m.d.cts → tx_pb-BN7h9uqT.d.cts} +0 -0
- /package/dist/esm/{BaseRestConsumer-DTvorEHL.js → BaseRestConsumer-BySVL6Rh.js} +0 -0
- /package/dist/esm/{defineProperty-DuYPbdEg.js → defineProperty-HO0rQlTT.js} +0 -0
- /package/dist/esm/{grpc-C3eJiY2o.js → grpc-BJmNoike.js} +0 -0
- /package/dist/esm/{tx_pb-D8fPXRH8.d.ts → tx_pb-B9KzLX7v.d.ts} +0 -0
- /package/dist/esm/{types-Cf4oVv93.js → types-WE16qNvL.js} +0 -0
- /package/dist/esm/{utils-C2KjM4mQ.js → utils-XYJbh13N.js} +0 -0
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { O as denomAmountFromGrpcChainDenomAmount } from "./utils-
|
|
2
|
-
import { t as _defineProperty } from "./defineProperty-
|
|
3
|
-
import { o as ChainModule } from "./ChainRestTendermintApi-
|
|
4
|
-
import { t as BaseGrpcConsumer } from "./BaseGrpcConsumer-
|
|
1
|
+
import { O as denomAmountFromGrpcChainDenomAmount } from "./utils-XYJbh13N.js";
|
|
2
|
+
import { t as _defineProperty } from "./defineProperty-HO0rQlTT.js";
|
|
3
|
+
import { o as ChainModule } from "./ChainRestTendermintApi-Duz8V3KK.js";
|
|
4
|
+
import { t as BaseGrpcConsumer } from "./BaseGrpcConsumer-CsJHyzUs.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
|
-
import { $t as uint8ArrayToString, Zt as uint8ArrayToBase64, l as ChainGrpcCommonTransformer } from "./utils-
|
|
2
|
-
import { t as _defineProperty } from "./defineProperty-
|
|
3
|
-
import { t as BaseGrpcConsumer } from "./BaseGrpcConsumer-
|
|
4
|
-
import { t as BaseRestConsumer } from "./BaseRestConsumer-
|
|
1
|
+
import { $t as uint8ArrayToString, Zt as uint8ArrayToBase64, l as ChainGrpcCommonTransformer } from "./utils-XYJbh13N.js";
|
|
2
|
+
import { t as _defineProperty } from "./defineProperty-HO0rQlTT.js";
|
|
3
|
+
import { t as BaseGrpcConsumer } from "./BaseGrpcConsumer-CsJHyzUs.js";
|
|
4
|
+
import { t as BaseRestConsumer } from "./BaseRestConsumer-BySVL6Rh.js";
|
|
5
5
|
import { ChainErrorModule, HttpRequestException, UnspecifiedErrorCode } from "@injectivelabs/exceptions";
|
|
6
6
|
import * as InjectiveCryptoV1Beta1Ethsecp256k1KeysPb from "@injectivelabs/core-proto-ts-v2/generated/injective/crypto/v1beta1/ethsecp256k1/keys_pb";
|
|
7
7
|
import * as ExchangePb from "@injectivelabs/core-proto-ts-v2/generated/injective/exchange/v1beta1/exchange_pb";
|
package/dist/esm/{DirectEthSecp256k1Wallet-B0yFLmu-.js → DirectEthSecp256k1Wallet-D-k0846W.js}
RENAMED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { Qt as uint8ArrayToHex, Zt as uint8ArrayToBase64, zt as base64ToUint8Array } from "./utils-
|
|
2
|
-
import { t as _defineProperty } from "./defineProperty-
|
|
3
|
-
import { O as getPublicKey, P as PublicKey, n as PrivateKey } from "./accounts-
|
|
1
|
+
import { Qt as uint8ArrayToHex, Zt as uint8ArrayToBase64, zt as base64ToUint8Array } from "./utils-XYJbh13N.js";
|
|
2
|
+
import { t as _defineProperty } from "./defineProperty-HO0rQlTT.js";
|
|
3
|
+
import { O as getPublicKey, P as PublicKey, n as PrivateKey } from "./accounts-B_bymcv_.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,6 +1,6 @@
|
|
|
1
|
-
import { Wt as fromUtf8, Yt as toBase64, pn as safeBigIntStringify } from "./utils-
|
|
2
|
-
import { t as _defineProperty } from "./defineProperty-
|
|
3
|
-
import { t as MsgBase } from "./MsgBase-
|
|
1
|
+
import { Wt as fromUtf8, Yt as toBase64, pn as safeBigIntStringify } from "./utils-XYJbh13N.js";
|
|
2
|
+
import { t as _defineProperty } from "./defineProperty-HO0rQlTT.js";
|
|
3
|
+
import { t as MsgBase } from "./MsgBase-Cd9l1FGI.js";
|
|
4
4
|
import { GeneralException } from "@injectivelabs/exceptions";
|
|
5
5
|
import * as InjectiveWasmxV1TxPb from "@injectivelabs/core-proto-ts-v2/generated/injective/wasmx/v1/tx_pb";
|
|
6
6
|
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { Jt as stringToUint8Array, Qt as uint8ArrayToHex, pn as safeBigIntStringify, t as recoverTypedSignaturePubKey, zt as base64ToUint8Array } from "./utils-
|
|
2
|
-
import { t as _defineProperty } from "./defineProperty-
|
|
3
|
-
import { t as BaseIndexerGrpcConsumer } from "./BaseIndexerGrpcConsumer-
|
|
1
|
+
import { Jt as stringToUint8Array, Qt as uint8ArrayToHex, pn as safeBigIntStringify, t as recoverTypedSignaturePubKey, zt as base64ToUint8Array } from "./utils-XYJbh13N.js";
|
|
2
|
+
import { t as _defineProperty } from "./defineProperty-HO0rQlTT.js";
|
|
3
|
+
import { t as BaseIndexerGrpcConsumer } from "./BaseIndexerGrpcConsumer-B_zDF6-R.js";
|
|
4
4
|
import * as CosmosTxV1Beta1TxPb from "@injectivelabs/core-proto-ts-v2/generated/cosmos/tx/v1beta1/tx_pb";
|
|
5
5
|
import { DEFAULT_BRIDGE_FEE_DENOM, DEFAULT_BRIDGE_FEE_PRICE, DEFAULT_EXCHANGE_LIMIT, DEFAULT_GAS_LIMIT } from "@injectivelabs/utils";
|
|
6
6
|
import { ErrorType, IndexerErrorModule, TransactionException, UnspecifiedErrorCode } from "@injectivelabs/exceptions";
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { t as _defineProperty } from "./defineProperty-
|
|
1
|
+
import { t as _defineProperty } from "./defineProperty-HO0rQlTT.js";
|
|
2
2
|
import { snakeToPascal } from "@injectivelabs/utils";
|
|
3
3
|
import { GeneralException } from "@injectivelabs/exceptions";
|
|
4
4
|
import snakecaseKeys from "snakecase-keys";
|
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import { Ht as concatUint8Arrays, Vt as binaryToBase64, Wt as fromUtf8, Zt as uint8ArrayToBase64, et as numberToCosmosSdkDecString, ht as messageHash, nn as bigIntToString, pn as safeBigIntStringify, pt as domainHash, qt as hexToUint8Array, zt as base64ToUint8Array } from "./utils-
|
|
2
|
-
import { t as _defineProperty } from "./defineProperty-
|
|
3
|
-
import { A as createAny, F as Address } from "./accounts-
|
|
4
|
-
import { n as prepareSignBytes, t as MsgBase } from "./MsgBase-
|
|
5
|
-
import { t as ChainGrpcExchangeApi } from "./ChainGrpcExchangeApi-
|
|
6
|
-
import { a as dataToExecData$1, i as ExecArgBase } from "./ExecArgNeptuneWithdraw-
|
|
1
|
+
import { Ht as concatUint8Arrays, Vt as binaryToBase64, Wt as fromUtf8, Zt as uint8ArrayToBase64, et as numberToCosmosSdkDecString, ht as messageHash, nn as bigIntToString, pn as safeBigIntStringify, pt as domainHash, qt as hexToUint8Array, zt as base64ToUint8Array } from "./utils-XYJbh13N.js";
|
|
2
|
+
import { t as _defineProperty } from "./defineProperty-HO0rQlTT.js";
|
|
3
|
+
import { A as createAny, F as Address } from "./accounts-B_bymcv_.js";
|
|
4
|
+
import { n as prepareSignBytes, t as MsgBase } from "./MsgBase-Cd9l1FGI.js";
|
|
5
|
+
import { t as ChainGrpcExchangeApi } from "./ChainGrpcExchangeApi-CnWi3kXP.js";
|
|
6
|
+
import { a as dataToExecData$1, i as ExecArgBase } from "./ExecArgNeptuneWithdraw-PqmStnen.js";
|
|
7
7
|
import { keccak256 } from "viem";
|
|
8
8
|
import { BigNumber, DEFAULT_BRIDGE_FEE_AMOUNT, DEFAULT_BRIDGE_FEE_DENOM, toBigNumber, toChainFormat, toPascalCase } from "@injectivelabs/utils";
|
|
9
9
|
import { GeneralException } from "@injectivelabs/exceptions";
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { t as _defineProperty } from "./defineProperty-
|
|
2
|
-
import { t as BaseIndexerGrpcConsumer } from "./BaseIndexerGrpcConsumer-
|
|
1
|
+
import { t as _defineProperty } from "./defineProperty-HO0rQlTT.js";
|
|
2
|
+
import { t as BaseIndexerGrpcConsumer } from "./BaseIndexerGrpcConsumer-B_zDF6-R.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
|
-
import { Ut as fromBase64, Vt as binaryToBase64, Xt as toUtf8, Yt as toBase64 } from "./utils-
|
|
2
|
-
import { t as _defineProperty } from "./defineProperty-
|
|
3
|
-
import { h as ChainGrpcWasmApi } from "./chain-
|
|
4
|
-
import { n as MsgExecuteContractCompat, r as ExecArgNeptuneDeposit, t as ExecArgNeptuneWithdraw } from "./ExecArgNeptuneWithdraw-
|
|
1
|
+
import { Ut as fromBase64, Vt as binaryToBase64, Xt as toUtf8, Yt as toBase64 } from "./utils-XYJbh13N.js";
|
|
2
|
+
import { t as _defineProperty } from "./defineProperty-HO0rQlTT.js";
|
|
3
|
+
import { h as ChainGrpcWasmApi } from "./chain-cZz2uvOr.js";
|
|
4
|
+
import { n as MsgExecuteContractCompat, r as ExecArgNeptuneDeposit, t as ExecArgNeptuneWithdraw } from "./ExecArgNeptuneWithdraw-PqmStnen.js";
|
|
5
5
|
import { GeneralException } from "@injectivelabs/exceptions";
|
|
6
6
|
import { Network, getNetworkEndpoints, isMainnet } from "@injectivelabs/networks";
|
|
7
7
|
|
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
import { $t as uint8ArrayToString, a as grpcPagingToPagingV2, nn as bigIntToString, sn as isJsonString, tn as bigIntToNumber } from "./utils-
|
|
2
|
-
import { t as _defineProperty } from "./defineProperty-
|
|
3
|
-
import { n as GrpcWebRpcTransport } from "./BaseGrpcConsumer-
|
|
4
|
-
import { t as BaseIndexerGrpcConsumer } from "./BaseIndexerGrpcConsumer-
|
|
5
|
-
import { t as BaseRestConsumer } from "./BaseRestConsumer-
|
|
6
|
-
import { f as GrpcDecodeError, m as WsState, p as WsDisconnectReason, r as IndexerModule } from "./IndexerGrpcWeb3GwApi-
|
|
7
|
-
import { a as TradeDirection, c as GrpcStatusCode, d as StreamState, i as OrderState, l as StreamDisconnectReason, m as TokenVerification, p as TokenType, t as StreamOperation, u as StreamEvent } from "./types-
|
|
1
|
+
import { $t as uint8ArrayToString, a as grpcPagingToPagingV2, nn as bigIntToString, sn as isJsonString, tn as bigIntToNumber } from "./utils-XYJbh13N.js";
|
|
2
|
+
import { t as _defineProperty } from "./defineProperty-HO0rQlTT.js";
|
|
3
|
+
import { n as GrpcWebRpcTransport } from "./BaseGrpcConsumer-CsJHyzUs.js";
|
|
4
|
+
import { t as BaseIndexerGrpcConsumer } from "./BaseIndexerGrpcConsumer-B_zDF6-R.js";
|
|
5
|
+
import { t as BaseRestConsumer } from "./BaseRestConsumer-BySVL6Rh.js";
|
|
6
|
+
import { f as GrpcDecodeError, m as WsState, p as WsDisconnectReason, r as IndexerModule } from "./IndexerGrpcWeb3GwApi-wVedW8ol.js";
|
|
7
|
+
import { a as TradeDirection, c as GrpcStatusCode, d as StreamState, i as OrderState, l as StreamDisconnectReason, m as TokenVerification, p as TokenType, t as StreamOperation, u as StreamEvent } from "./types-WE16qNvL.js";
|
|
8
8
|
import { BigNumber, toBigNumber, toHumanReadable } from "@injectivelabs/utils";
|
|
9
9
|
import { GeneralException, HttpRequestException, UnspecifiedErrorCode } from "@injectivelabs/exceptions";
|
|
10
10
|
import * as InjectiveRFQExchangeRpcPb from "@injectivelabs/indexer-proto-ts-v2/generated/injective_rfq_rpc_pb";
|
|
@@ -37,6 +37,8 @@ import * as InjectiveDerivativeExchangeRpcPb from "@injectivelabs/indexer-proto-
|
|
|
37
37
|
import { InjectiveDerivativeExchangeRPCClient } from "@injectivelabs/indexer-proto-ts-v2/generated/injective_derivative_exchange_rpc_pb.client";
|
|
38
38
|
import * as InjectivePortfolioRpcPb from "@injectivelabs/indexer-proto-ts-v2/generated/injective_portfolio_rpc_pb";
|
|
39
39
|
import { InjectivePortfolioRPCClient } from "@injectivelabs/indexer-proto-ts-v2/generated/injective_portfolio_rpc_pb.client";
|
|
40
|
+
import * as InjectiveTCDerivativesRpcPb from "@injectivelabs/indexer-proto-ts-v2/generated/injective_tc_derivatives_rpc_pb";
|
|
41
|
+
import { InjectiveTCDerivativesRPCClient } from "@injectivelabs/indexer-proto-ts-v2/generated/injective_tc_derivatives_rpc_pb.client";
|
|
40
42
|
import * as InjectiveInsuranceRpcPb from "@injectivelabs/indexer-proto-ts-v2/generated/injective_insurance_rpc_pb";
|
|
41
43
|
import { InjectiveInsuranceRPCClient } from "@injectivelabs/indexer-proto-ts-v2/generated/injective_insurance_rpc_pb.client";
|
|
42
44
|
import { EventEmitter } from "eventemitter3";
|
|
@@ -3091,7 +3093,7 @@ _defineProperty(ExplorerStreamTransformer, "transactionsStreamCallback", (respon
|
|
|
3091
3093
|
|
|
3092
3094
|
//#endregion
|
|
3093
3095
|
//#region src/client/indexer/transformers/IndexerGrpcDerivativeTransformer.ts
|
|
3094
|
-
const zeroPositionDelta = () => ({
|
|
3096
|
+
const zeroPositionDelta$1 = () => ({
|
|
3095
3097
|
tradeDirection: TradeDirection.Buy,
|
|
3096
3098
|
executionPrice: "0",
|
|
3097
3099
|
executionQuantity: "0",
|
|
@@ -3432,7 +3434,7 @@ var IndexerGrpcDerivativeTransformer = class IndexerGrpcDerivativeTransformer {
|
|
|
3432
3434
|
}
|
|
3433
3435
|
static grpcTradeToTrade(trade) {
|
|
3434
3436
|
const positionDelta = trade.positionDelta;
|
|
3435
|
-
const mappedPositionDelta = positionDelta ? IndexerGrpcDerivativeTransformer.grpcPositionDeltaToPositionDelta(positionDelta) : zeroPositionDelta();
|
|
3437
|
+
const mappedPositionDelta = positionDelta ? IndexerGrpcDerivativeTransformer.grpcPositionDeltaToPositionDelta(positionDelta) : zeroPositionDelta$1();
|
|
3436
3438
|
return {
|
|
3437
3439
|
cid: trade.cid,
|
|
3438
3440
|
fee: trade.fee,
|
|
@@ -3687,6 +3689,179 @@ var IndexerGrpcInsuranceFundTransformer = class IndexerGrpcInsuranceFundTransfor
|
|
|
3687
3689
|
}
|
|
3688
3690
|
};
|
|
3689
3691
|
|
|
3692
|
+
//#endregion
|
|
3693
|
+
//#region src/client/indexer/transformers/IndexerGrpcTcDerivativesTransformer.ts
|
|
3694
|
+
const zeroPositionDelta = () => ({
|
|
3695
|
+
executionPrice: "0",
|
|
3696
|
+
executionMargin: "0",
|
|
3697
|
+
executionQuantity: "0",
|
|
3698
|
+
tradeDirection: TradeDirection.Buy
|
|
3699
|
+
});
|
|
3700
|
+
/**
|
|
3701
|
+
* @category Indexer Grpc Transformer
|
|
3702
|
+
*/
|
|
3703
|
+
var IndexerGrpcTcDerivativesTransformer = class IndexerGrpcTcDerivativesTransformer {
|
|
3704
|
+
static grpcPositionDeltaToPositionDelta(positionDelta) {
|
|
3705
|
+
return {
|
|
3706
|
+
tradeDirection: positionDelta.tradeDirection,
|
|
3707
|
+
executionPrice: positionDelta.executionPrice,
|
|
3708
|
+
executionMargin: positionDelta.executionMargin,
|
|
3709
|
+
executionQuantity: positionDelta.executionQuantity
|
|
3710
|
+
};
|
|
3711
|
+
}
|
|
3712
|
+
static grpcOrderHistoryToOrderHistory(order) {
|
|
3713
|
+
return {
|
|
3714
|
+
cid: order.cid,
|
|
3715
|
+
price: order.price,
|
|
3716
|
+
state: order.state,
|
|
3717
|
+
margin: order.margin,
|
|
3718
|
+
txHash: order.txHash,
|
|
3719
|
+
marketId: order.marketId,
|
|
3720
|
+
isActive: order.isActive,
|
|
3721
|
+
quantity: order.quantity,
|
|
3722
|
+
orderHash: order.orderHash,
|
|
3723
|
+
orderType: order.orderType,
|
|
3724
|
+
direction: order.direction,
|
|
3725
|
+
subaccountId: order.subaccountId,
|
|
3726
|
+
triggerPrice: order.triggerPrice,
|
|
3727
|
+
isReduceOnly: order.isReduceOnly,
|
|
3728
|
+
executionType: order.executionType,
|
|
3729
|
+
createdAt: Number(order.createdAt),
|
|
3730
|
+
updatedAt: Number(order.updatedAt),
|
|
3731
|
+
isConditional: order.isConditional,
|
|
3732
|
+
triggerAt: Number(order.triggerAt),
|
|
3733
|
+
filledQuantity: order.filledQuantity,
|
|
3734
|
+
placedOrderHash: order.placedOrderHash
|
|
3735
|
+
};
|
|
3736
|
+
}
|
|
3737
|
+
static grpcTradeToTrade(trade) {
|
|
3738
|
+
const positionDelta = trade.positionDelta;
|
|
3739
|
+
const mappedPositionDelta = positionDelta ? IndexerGrpcTcDerivativesTransformer.grpcPositionDeltaToPositionDelta(positionDelta) : zeroPositionDelta();
|
|
3740
|
+
return {
|
|
3741
|
+
fee: trade.fee,
|
|
3742
|
+
cid: trade.cid,
|
|
3743
|
+
pnl: trade.pnl,
|
|
3744
|
+
payout: trade.payout,
|
|
3745
|
+
tradeId: trade.tradeId,
|
|
3746
|
+
marketId: trade.marketId,
|
|
3747
|
+
orderHash: trade.orderHash,
|
|
3748
|
+
subaccountId: trade.subaccountId,
|
|
3749
|
+
feeRecipient: trade.feeRecipient,
|
|
3750
|
+
isLiquidation: trade.isLiquidation,
|
|
3751
|
+
executionSide: trade.executionSide,
|
|
3752
|
+
executedAt: Number(trade.executedAt),
|
|
3753
|
+
tradeExecutionType: trade.tradeExecutionType,
|
|
3754
|
+
...mappedPositionDelta
|
|
3755
|
+
};
|
|
3756
|
+
}
|
|
3757
|
+
static grpcPositionToPosition(position) {
|
|
3758
|
+
return {
|
|
3759
|
+
denom: position.denom,
|
|
3760
|
+
ticker: position.ticker,
|
|
3761
|
+
margin: position.margin,
|
|
3762
|
+
marketId: position.marketId,
|
|
3763
|
+
quantity: position.quantity,
|
|
3764
|
+
direction: position.direction,
|
|
3765
|
+
markPrice: position.markPrice,
|
|
3766
|
+
entryPrice: position.entryPrice,
|
|
3767
|
+
fundingSum: position.fundingSum,
|
|
3768
|
+
fundingLast: position.fundingLast,
|
|
3769
|
+
subaccountId: position.subaccountId,
|
|
3770
|
+
updatedAt: Number(position.updatedAt),
|
|
3771
|
+
liquidationPrice: position.liquidationPrice,
|
|
3772
|
+
cumulativeFundingEntry: position.cumulativeFundingEntry,
|
|
3773
|
+
effectiveCumulativeFundingEntry: position.effectiveCumulativeFundingEntry
|
|
3774
|
+
};
|
|
3775
|
+
}
|
|
3776
|
+
static grpcDerivativeLimitOrderToDerivativeLimitOrder(order) {
|
|
3777
|
+
return {
|
|
3778
|
+
price: order.price,
|
|
3779
|
+
state: order.state,
|
|
3780
|
+
margin: order.margin,
|
|
3781
|
+
marketId: order.marketId,
|
|
3782
|
+
quantity: order.quantity,
|
|
3783
|
+
orderHash: order.orderHash,
|
|
3784
|
+
orderSide: order.orderSide,
|
|
3785
|
+
orderType: order.orderType,
|
|
3786
|
+
subaccountId: order.subaccountId,
|
|
3787
|
+
isReduceOnly: order.isReduceOnly,
|
|
3788
|
+
triggerPrice: order.triggerPrice,
|
|
3789
|
+
feeRecipient: order.feeRecipient,
|
|
3790
|
+
createdAt: Number(order.createdAt),
|
|
3791
|
+
updatedAt: Number(order.updatedAt),
|
|
3792
|
+
isConditional: order.isConditional,
|
|
3793
|
+
triggerAt: Number(order.triggerAt),
|
|
3794
|
+
executionType: order.executionType,
|
|
3795
|
+
orderNumber: Number(order.orderNumber),
|
|
3796
|
+
placedOrderHash: order.placedOrderHash,
|
|
3797
|
+
unfilledQuantity: order.unfilledQuantity
|
|
3798
|
+
};
|
|
3799
|
+
}
|
|
3800
|
+
static ordersHistoryResponseToOrdersHistory(response) {
|
|
3801
|
+
return {
|
|
3802
|
+
orders: response.orders.map(IndexerGrpcTcDerivativesTransformer.grpcOrderHistoryToOrderHistory),
|
|
3803
|
+
next: response.next
|
|
3804
|
+
};
|
|
3805
|
+
}
|
|
3806
|
+
static ordersResponseToOrders(response) {
|
|
3807
|
+
return {
|
|
3808
|
+
next: response.next,
|
|
3809
|
+
orders: response.orders.map(IndexerGrpcTcDerivativesTransformer.grpcDerivativeLimitOrderToDerivativeLimitOrder)
|
|
3810
|
+
};
|
|
3811
|
+
}
|
|
3812
|
+
static tradesResponseToTrades(response) {
|
|
3813
|
+
return {
|
|
3814
|
+
trades: response.trades.map(IndexerGrpcTcDerivativesTransformer.grpcTradeToTrade),
|
|
3815
|
+
next: response.next
|
|
3816
|
+
};
|
|
3817
|
+
}
|
|
3818
|
+
static positionsResponseToPositions(response) {
|
|
3819
|
+
return {
|
|
3820
|
+
positions: response.positions.map(IndexerGrpcTcDerivativesTransformer.grpcPositionToPosition),
|
|
3821
|
+
next: response.next,
|
|
3822
|
+
total: response.total ? Number(response.total) : void 0
|
|
3823
|
+
};
|
|
3824
|
+
}
|
|
3825
|
+
};
|
|
3826
|
+
|
|
3827
|
+
//#endregion
|
|
3828
|
+
//#region src/client/indexer/transformers/IndexerTcDerivativesStreamTransformer.ts
|
|
3829
|
+
/**
|
|
3830
|
+
* @category Indexer Stream Transformer
|
|
3831
|
+
*/
|
|
3832
|
+
var IndexerTcDerivativesStreamTransformer = class {};
|
|
3833
|
+
_defineProperty(IndexerTcDerivativesStreamTransformer, "orderHistoryStreamCallback", (response) => {
|
|
3834
|
+
const order = response.order;
|
|
3835
|
+
return {
|
|
3836
|
+
operationType: response.operationType,
|
|
3837
|
+
timestamp: Number(response.timestamp),
|
|
3838
|
+
order: order ? IndexerGrpcTcDerivativesTransformer.grpcOrderHistoryToOrderHistory(order) : void 0
|
|
3839
|
+
};
|
|
3840
|
+
});
|
|
3841
|
+
_defineProperty(IndexerTcDerivativesStreamTransformer, "tradesStreamCallback", (response) => {
|
|
3842
|
+
const trade = response.trade;
|
|
3843
|
+
return {
|
|
3844
|
+
operationType: response.operationType,
|
|
3845
|
+
timestamp: Number(response.timestamp),
|
|
3846
|
+
trade: trade ? IndexerGrpcTcDerivativesTransformer.grpcTradeToTrade(trade) : void 0
|
|
3847
|
+
};
|
|
3848
|
+
});
|
|
3849
|
+
_defineProperty(IndexerTcDerivativesStreamTransformer, "positionsStreamCallback", (response) => {
|
|
3850
|
+
const position = response.position;
|
|
3851
|
+
return {
|
|
3852
|
+
timestamp: Number(response.timestamp),
|
|
3853
|
+
position: position ? IndexerGrpcTcDerivativesTransformer.grpcPositionToPosition(position) : void 0
|
|
3854
|
+
};
|
|
3855
|
+
});
|
|
3856
|
+
_defineProperty(IndexerTcDerivativesStreamTransformer, "ordersStreamCallback", (response) => {
|
|
3857
|
+
const order = response.order;
|
|
3858
|
+
return {
|
|
3859
|
+
operationType: response.operationType,
|
|
3860
|
+
timestamp: Number(response.timestamp),
|
|
3861
|
+
order: order ? IndexerGrpcTcDerivativesTransformer.grpcDerivativeLimitOrderToDerivativeLimitOrder(order) : void 0
|
|
3862
|
+
};
|
|
3863
|
+
});
|
|
3864
|
+
|
|
3690
3865
|
//#endregion
|
|
3691
3866
|
//#region src/client/indexer/transformers/IndexerAccountPortfolioStreamTransformer.ts
|
|
3692
3867
|
/**
|
|
@@ -5033,6 +5208,63 @@ var IndexerGrpcAccountPortfolioApi = class extends BaseIndexerGrpcConsumer {
|
|
|
5033
5208
|
}
|
|
5034
5209
|
};
|
|
5035
5210
|
|
|
5211
|
+
//#endregion
|
|
5212
|
+
//#region src/client/indexer/grpc/IndexerGrpcTcDerivativesApi.ts
|
|
5213
|
+
/**
|
|
5214
|
+
* @category Indexer Grpc API
|
|
5215
|
+
*/
|
|
5216
|
+
var IndexerGrpcTcDerivativesApi = class extends BaseIndexerGrpcConsumer {
|
|
5217
|
+
constructor(..._args) {
|
|
5218
|
+
super(..._args);
|
|
5219
|
+
_defineProperty(this, "module", IndexerModule.TcDerivatives);
|
|
5220
|
+
}
|
|
5221
|
+
get client() {
|
|
5222
|
+
return this.initClient(InjectiveTCDerivativesRPCClient);
|
|
5223
|
+
}
|
|
5224
|
+
async fetchOrdersHistory(params) {
|
|
5225
|
+
const { marketId, direction, perPage, token } = params || {};
|
|
5226
|
+
const request = InjectiveTCDerivativesRpcPb.OrdersHistoryRequest.create();
|
|
5227
|
+
if (marketId) request.marketIds = [marketId];
|
|
5228
|
+
if (direction) request.direction = direction;
|
|
5229
|
+
if (perPage) request.perPage = perPage;
|
|
5230
|
+
if (token) request.token = token;
|
|
5231
|
+
const response = await this.executeGrpcCall(request, this.client.ordersHistory.bind(this.client));
|
|
5232
|
+
return IndexerGrpcTcDerivativesTransformer.ordersHistoryResponseToOrdersHistory(response);
|
|
5233
|
+
}
|
|
5234
|
+
async fetchTradesHistory(params) {
|
|
5235
|
+
const { marketId, direction, perPage, token } = params || {};
|
|
5236
|
+
const request = InjectiveTCDerivativesRpcPb.TradesRequest.create();
|
|
5237
|
+
if (marketId) request.marketIds = [marketId];
|
|
5238
|
+
if (direction) request.direction = direction;
|
|
5239
|
+
if (perPage) request.perPage = perPage;
|
|
5240
|
+
if (token) request.token = token;
|
|
5241
|
+
const response = await this.executeGrpcCall(request, this.client.trades.bind(this.client));
|
|
5242
|
+
return IndexerGrpcTcDerivativesTransformer.tradesResponseToTrades(response);
|
|
5243
|
+
}
|
|
5244
|
+
async fetchPositions(params) {
|
|
5245
|
+
const { marketId, direction, perPage, token, accountAddress, withCount } = params || {};
|
|
5246
|
+
const request = InjectiveTCDerivativesRpcPb.PositionsRequest.create();
|
|
5247
|
+
if (marketId) request.marketIds = [marketId];
|
|
5248
|
+
if (direction) request.direction = direction;
|
|
5249
|
+
if (accountAddress) request.accountAddress = accountAddress;
|
|
5250
|
+
if (withCount !== void 0) request.withCount = withCount;
|
|
5251
|
+
if (perPage) request.perPage = perPage;
|
|
5252
|
+
if (token) request.token = token;
|
|
5253
|
+
const response = await this.executeGrpcCall(request, this.client.positions.bind(this.client));
|
|
5254
|
+
return IndexerGrpcTcDerivativesTransformer.positionsResponseToPositions(response);
|
|
5255
|
+
}
|
|
5256
|
+
async fetchOrders(params) {
|
|
5257
|
+
const { marketId, direction, perPage, token } = params || {};
|
|
5258
|
+
const request = InjectiveTCDerivativesRpcPb.OrdersRequest.create();
|
|
5259
|
+
if (marketId) request.marketIds = [marketId];
|
|
5260
|
+
if (direction) request.direction = direction;
|
|
5261
|
+
if (perPage) request.perPage = perPage;
|
|
5262
|
+
if (token) request.token = token;
|
|
5263
|
+
const response = await this.executeGrpcCall(request, this.client.orders.bind(this.client));
|
|
5264
|
+
return IndexerGrpcTcDerivativesTransformer.ordersResponseToOrders(response);
|
|
5265
|
+
}
|
|
5266
|
+
};
|
|
5267
|
+
|
|
5036
5268
|
//#endregion
|
|
5037
5269
|
//#region src/client/indexer/grpc/IndexerGrpcInsuranceFundApi.ts
|
|
5038
5270
|
/**
|
|
@@ -7045,6 +7277,50 @@ var IndexerGrpcDerivativesStreamV2 = class {
|
|
|
7045
7277
|
}
|
|
7046
7278
|
};
|
|
7047
7279
|
|
|
7280
|
+
//#endregion
|
|
7281
|
+
//#region src/client/indexer/grpc_stream/streamV2/IndexerGrpcTcDerivativesStreamV2.ts
|
|
7282
|
+
var IndexerGrpcTcDerivativesStreamV2 = class {
|
|
7283
|
+
constructor(endpoint, metadata) {
|
|
7284
|
+
_defineProperty(this, "client", void 0);
|
|
7285
|
+
_defineProperty(this, "transport", void 0);
|
|
7286
|
+
this.transport = new GrpcWebRpcTransport(endpoint, metadata);
|
|
7287
|
+
this.client = new InjectiveTCDerivativesRPCClient(this.transport);
|
|
7288
|
+
}
|
|
7289
|
+
streamOrdersHistory({ marketId, callback }) {
|
|
7290
|
+
if (typeof callback !== "function") throw new Error("callback must be a function");
|
|
7291
|
+
const request = InjectiveTCDerivativesRpcPb.StreamOrdersHistoryRequest.create();
|
|
7292
|
+
if (marketId) request.marketIds = [marketId];
|
|
7293
|
+
return createStreamSubscriptionV2(this.client.streamOrdersHistory(request), (response) => {
|
|
7294
|
+
callback(IndexerTcDerivativesStreamTransformer.orderHistoryStreamCallback(response));
|
|
7295
|
+
});
|
|
7296
|
+
}
|
|
7297
|
+
streamTrades({ marketId, callback }) {
|
|
7298
|
+
if (typeof callback !== "function") throw new Error("callback must be a function");
|
|
7299
|
+
const request = InjectiveTCDerivativesRpcPb.StreamTradesRequest.create();
|
|
7300
|
+
if (marketId) request.marketIds = [marketId];
|
|
7301
|
+
return createStreamSubscriptionV2(this.client.streamTrades(request), (response) => {
|
|
7302
|
+
callback(IndexerTcDerivativesStreamTransformer.tradesStreamCallback(response));
|
|
7303
|
+
});
|
|
7304
|
+
}
|
|
7305
|
+
streamPositions({ marketId, accountAddress, callback }) {
|
|
7306
|
+
if (typeof callback !== "function") throw new Error("callback must be a function");
|
|
7307
|
+
const request = InjectiveTCDerivativesRpcPb.StreamPositionsRequest.create();
|
|
7308
|
+
if (marketId) request.marketIds = [marketId];
|
|
7309
|
+
if (accountAddress) request.accountAddress = accountAddress;
|
|
7310
|
+
return createStreamSubscriptionV2(this.client.streamPositions(request), (response) => {
|
|
7311
|
+
callback(IndexerTcDerivativesStreamTransformer.positionsStreamCallback(response));
|
|
7312
|
+
});
|
|
7313
|
+
}
|
|
7314
|
+
streamOrders({ marketId, callback }) {
|
|
7315
|
+
if (typeof callback !== "function") throw new Error("callback must be a function");
|
|
7316
|
+
const request = InjectiveTCDerivativesRpcPb.StreamOrdersRequest.create();
|
|
7317
|
+
if (marketId) request.marketIds = [marketId];
|
|
7318
|
+
return createStreamSubscriptionV2(this.client.streamOrders(request), (response) => {
|
|
7319
|
+
callback(IndexerTcDerivativesStreamTransformer.ordersStreamCallback(response));
|
|
7320
|
+
});
|
|
7321
|
+
}
|
|
7322
|
+
};
|
|
7323
|
+
|
|
7048
7324
|
//#endregion
|
|
7049
7325
|
//#region src/client/indexer/grpc_stream/streamV2/IndexerGrpcAccountPortfolioStreamV2.ts
|
|
7050
7326
|
var IndexerGrpcAccountPortfolioStreamV2 = class {
|
|
@@ -7307,4 +7583,4 @@ var StreamManagerV2 = class extends EventEmitter {
|
|
|
7307
7583
|
};
|
|
7308
7584
|
|
|
7309
7585
|
//#endregion
|
|
7310
|
-
export {
|
|
7586
|
+
export { IndexerDerivativeStreamTransformer as $, IndexerRestSpotChronosApi as A, IndexerGrpcExplorerApi as B, IndexerGrpcOracleStream as C, IndexerGrpcRfqTransformer as Ct, IndexerRestLeaderboardChronosApi as D, createStreamSubscription as E, IndexerGrpcDerivativesApi as F, IndexerGrpcSpotApi as G, IndexerGrpcAuctionApi as H, IndexerGrpcMegaVaultApi as I, IndexerGrpcRFQApi as J, IndexerGrpcMetaApi as K, IndexerGrpcReferralApi as L, IndexerGrpcInsuranceFundApi as M, IndexerGrpcTcDerivativesApi as N, IndexerRestDerivativesChronosApi as O, IndexerGrpcAccountPortfolioApi as P, IndexerGrpcInsuranceFundTransformer as Q, IndexerGrpcArchiverApi as R, IndexerGrpcAccountStream as S, IndexerWsTakerStream as St, IndexerGrpcSpotStream as T, GrpcWebSocketCodec as Tt, IndexerGrpcAccountApi as U, IndexerGrpcTradingApi as V, IndexerGrpcOracleApi as W, IndexerTcDerivativesStreamTransformer as X, IndexerAccountPortfolioStreamTransformer as Y, IndexerGrpcTcDerivativesTransformer as Z, IndexerGrpcDerivativesStream as _, IndexerRfqStreamTransformer as _t, IndexerGrpcExplorerStreamV2 as a, IndexerGrpcMegaVaultTransformer as at, IndexerGrpcTradingStream as b, IndexerGrpcMitoTransformer as bt, IndexerGrpcAuctionStreamV2 as c, IndexerRestExplorerTransformer as ct, IndexerGrpcMitoStreamV2 as d, IndexerGrpcExplorerTransformer as dt, IndexerGrpcAccountPortfolioTransformer as et, IndexerGrpcSpotStreamV2 as f, IndexerGrpcArchiverTransformer as ft, IndexerGrpcAccountPortfolioStream as g, IndexerGrpcOracleTransformer as gt, StreamManager as h, IndexerSpotStreamTransformer as ht, IndexerGrpcDerivativesStreamV2 as i, IndexerArchiverStreamTransformer as it, IndexerRestExplorerApi as j, IndexerRestMarketChronosApi as k, IndexerGrpcAccountStreamV2 as l, IndexerOracleStreamTransformer as lt, createStreamSubscriptionV2 as m, IndexerGrpcAccountTransformer as mt, IndexerGrpcAccountPortfolioStreamV2 as n, IndexerGrpcDerivativeTransformer as nt, IndexerGrpcArchiverStreamV2 as o, IndexerAuctionStreamTransformer as ot, IndexerGrpcRfqStreamV2 as p, IndexerGrpcAuctionTransformer as pt, IndexerGrpcMitoApi as q, IndexerGrpcTcDerivativesStreamV2 as r, ExplorerStreamTransformer as rt, IndexerGrpcTradingStreamV2 as s, IndexerAccountStreamTransformer as st, StreamManagerV2 as t, IndexerGrpcMitoStreamTransformer as tt, IndexerGrpcOracleStreamV2 as u, IndexerGrpcReferralTransformer as ut, IndexerGrpcExplorerStream as v, IndexerCampaignTransformer as vt, IndexerGrpcMitoStream as w, GrpcWebSocketTransport as wt, IndexerGrpcAuctionStream as x, IndexerWsMakerStream as xt, IndexerGrpcArchiverStream as y, IndexerGrpcSpotTransformer as yt, IndexerGrpcCampaignApi as z };
|
|
@@ -0,0 +1,125 @@
|
|
|
1
|
+
import { t as _defineProperty } from "./defineProperty-HO0rQlTT.js";
|
|
2
|
+
import { t as BaseGrpcConsumer } from "./BaseGrpcConsumer-CsJHyzUs.js";
|
|
3
|
+
import { IndexerErrorModule } from "@injectivelabs/exceptions";
|
|
4
|
+
import * as TcAbacusPb from "@injectivelabs/tc-abacus-proto-ts-v2/generated/injective_tc_abacus_rpc_pb";
|
|
5
|
+
import { InjectiveTCAbacusRPCClient } from "@injectivelabs/tc-abacus-proto-ts-v2/generated/injective_tc_abacus_rpc_pb.client";
|
|
6
|
+
|
|
7
|
+
//#region src/client/tcAbacus/grpc/transformers/index.ts
|
|
8
|
+
var TcAbacusGrpcTransformer = class TcAbacusGrpcTransformer {
|
|
9
|
+
static grpcHealthCheckToHealthCheck(response) {
|
|
10
|
+
return {
|
|
11
|
+
uptime: response.uptime,
|
|
12
|
+
uptimeSeconds: response.uptimeSeconds
|
|
13
|
+
};
|
|
14
|
+
}
|
|
15
|
+
static grpcSnapshotPointsToSnapshotPoints(snapshot) {
|
|
16
|
+
return {
|
|
17
|
+
rank: snapshot.rank,
|
|
18
|
+
points: snapshot.points,
|
|
19
|
+
endTime: snapshot.endTime,
|
|
20
|
+
startTime: snapshot.startTime,
|
|
21
|
+
snapshotId: snapshot.snapshotId
|
|
22
|
+
};
|
|
23
|
+
}
|
|
24
|
+
static grpcAccountPointsToAccountPoints(response) {
|
|
25
|
+
return {
|
|
26
|
+
rank: response.rank,
|
|
27
|
+
address: response.address,
|
|
28
|
+
updatedAt: response.updatedAt,
|
|
29
|
+
nextCursor: response.nextCursor,
|
|
30
|
+
totalPoints: response.totalPoints,
|
|
31
|
+
snapshots: response.snapshots.map((snapshot) => TcAbacusGrpcTransformer.grpcSnapshotPointsToSnapshotPoints(snapshot))
|
|
32
|
+
};
|
|
33
|
+
}
|
|
34
|
+
static grpcAccountStatsToAccountStats(response) {
|
|
35
|
+
return {
|
|
36
|
+
cap: response.cap,
|
|
37
|
+
address: response.address,
|
|
38
|
+
last7DVolume: response.last7DVolume,
|
|
39
|
+
inviteeCount: response.inviteeCount,
|
|
40
|
+
allTimeVolume: response.allTimeVolume,
|
|
41
|
+
activeInviteeCount: response.activeInviteeCount
|
|
42
|
+
};
|
|
43
|
+
}
|
|
44
|
+
static grpcReferrerToReferrer(referrer) {
|
|
45
|
+
return {
|
|
46
|
+
cap: referrer.cap,
|
|
47
|
+
code: referrer.code,
|
|
48
|
+
address: referrer.address,
|
|
49
|
+
createdAt: referrer.createdAt,
|
|
50
|
+
height: referrer.height.toString()
|
|
51
|
+
};
|
|
52
|
+
}
|
|
53
|
+
static grpcListReferrersToListReferrers(response) {
|
|
54
|
+
return {
|
|
55
|
+
nextCursor: response.nextCursor,
|
|
56
|
+
referrers: response.referrers.map((referrer) => TcAbacusGrpcTransformer.grpcReferrerToReferrer(referrer))
|
|
57
|
+
};
|
|
58
|
+
}
|
|
59
|
+
static grpcReferrerInviteeToReferrerInvitee(invitee) {
|
|
60
|
+
return {
|
|
61
|
+
address: invitee.address,
|
|
62
|
+
createdAt: invitee.createdAt,
|
|
63
|
+
height: invitee.height.toString(),
|
|
64
|
+
referralPoints: invitee.referralPoints
|
|
65
|
+
};
|
|
66
|
+
}
|
|
67
|
+
static grpcAccountInviteesToAccountInvitees(response) {
|
|
68
|
+
return {
|
|
69
|
+
address: response.address,
|
|
70
|
+
nextCursor: response.nextCursor,
|
|
71
|
+
invitees: response.invitees.map((invitee) => TcAbacusGrpcTransformer.grpcReferrerInviteeToReferrerInvitee(invitee))
|
|
72
|
+
};
|
|
73
|
+
}
|
|
74
|
+
};
|
|
75
|
+
|
|
76
|
+
//#endregion
|
|
77
|
+
//#region src/client/tcAbacus/grpc/TcAbacusGrpcApi.ts
|
|
78
|
+
var TcAbacusGrpcApi = class extends BaseGrpcConsumer {
|
|
79
|
+
constructor(..._args) {
|
|
80
|
+
super(..._args);
|
|
81
|
+
_defineProperty(this, "module", IndexerErrorModule.Abacus);
|
|
82
|
+
}
|
|
83
|
+
get client() {
|
|
84
|
+
return this.initClient(InjectiveTCAbacusRPCClient);
|
|
85
|
+
}
|
|
86
|
+
async fetchHealthCheck() {
|
|
87
|
+
const request = TcAbacusPb.HealthCheckRequest.create({});
|
|
88
|
+
const response = await this.executeGrpcCall(request, this.client.healthCheck.bind(this.client));
|
|
89
|
+
return TcAbacusGrpcTransformer.grpcHealthCheckToHealthCheck(response);
|
|
90
|
+
}
|
|
91
|
+
async fetchAccountPoints(address, cursor, limit) {
|
|
92
|
+
const request = TcAbacusPb.GetAccountPointsRequest.create({
|
|
93
|
+
limit,
|
|
94
|
+
cursor,
|
|
95
|
+
address
|
|
96
|
+
});
|
|
97
|
+
const response = await this.executeGrpcCall(request, this.client.getAccountPoints.bind(this.client));
|
|
98
|
+
return TcAbacusGrpcTransformer.grpcAccountPointsToAccountPoints(response);
|
|
99
|
+
}
|
|
100
|
+
async fetchAccountStats(address) {
|
|
101
|
+
const request = TcAbacusPb.GetAccountStatsRequest.create({ address });
|
|
102
|
+
const response = await this.executeGrpcCall(request, this.client.getAccountStats.bind(this.client));
|
|
103
|
+
return TcAbacusGrpcTransformer.grpcAccountStatsToAccountStats(response);
|
|
104
|
+
}
|
|
105
|
+
async fetchReferrers(cursor, limit) {
|
|
106
|
+
const request = TcAbacusPb.ListReferrersRequest.create({
|
|
107
|
+
limit,
|
|
108
|
+
cursor
|
|
109
|
+
});
|
|
110
|
+
const response = await this.executeGrpcCall(request, this.client.listReferrers.bind(this.client));
|
|
111
|
+
return TcAbacusGrpcTransformer.grpcListReferrersToListReferrers(response);
|
|
112
|
+
}
|
|
113
|
+
async fetchAccountInvitees(address, cursor, limit) {
|
|
114
|
+
const request = TcAbacusPb.GetAccountInviteesRequest.create({
|
|
115
|
+
limit,
|
|
116
|
+
cursor,
|
|
117
|
+
address
|
|
118
|
+
});
|
|
119
|
+
const response = await this.executeGrpcCall(request, this.client.getAccountInvitees.bind(this.client));
|
|
120
|
+
return TcAbacusGrpcTransformer.grpcAccountInviteesToAccountInvitees(response);
|
|
121
|
+
}
|
|
122
|
+
};
|
|
123
|
+
|
|
124
|
+
//#endregion
|
|
125
|
+
export { TcAbacusGrpcApi as t };
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { Ft as BECH32_PUBKEY_ACC_PREFIX, Jt as stringToUint8Array, Mt as BECH32_ADDR_ACC_PREFIX, Nt as BECH32_ADDR_CONS_PREFIX, Pt as BECH32_ADDR_VAL_PREFIX, Qt as uint8ArrayToHex, Rt as DEFAULT_DERIVATION_PATH, Xt as toUtf8, Zt as uint8ArrayToBase64, dt as TypedDataUtilsSanitizeData, et as numberToCosmosSdkDecString, ft as decompressPubKey, h as getInjectiveAddress, m as getEthereumAddress, pn as safeBigIntStringify, qt as hexToUint8Array, t as recoverTypedSignaturePubKey, zt as base64ToUint8Array } from "./utils-
|
|
2
|
-
import { t as _defineProperty } from "./defineProperty-
|
|
3
|
-
import { t as MsgBase } from "./MsgBase-
|
|
1
|
+
import { Ft as BECH32_PUBKEY_ACC_PREFIX, Jt as stringToUint8Array, Mt as BECH32_ADDR_ACC_PREFIX, Nt as BECH32_ADDR_CONS_PREFIX, Pt as BECH32_ADDR_VAL_PREFIX, Qt as uint8ArrayToHex, Rt as DEFAULT_DERIVATION_PATH, Xt as toUtf8, Zt as uint8ArrayToBase64, dt as TypedDataUtilsSanitizeData, et as numberToCosmosSdkDecString, ft as decompressPubKey, h as getInjectiveAddress, m as getEthereumAddress, pn as safeBigIntStringify, qt as hexToUint8Array, t as recoverTypedSignaturePubKey, zt as base64ToUint8Array } from "./utils-XYJbh13N.js";
|
|
2
|
+
import { t as _defineProperty } from "./defineProperty-HO0rQlTT.js";
|
|
3
|
+
import { t as MsgBase } from "./MsgBase-Cd9l1FGI.js";
|
|
4
4
|
import * as CosmosTxV1Beta1TxPb from "@injectivelabs/core-proto-ts-v2/generated/cosmos/tx/v1beta1/tx_pb";
|
|
5
5
|
import { hashTypedData, keccak256, toBytes } from "viem";
|
|
6
6
|
import { DEFAULT_GAS_LIMIT, getDefaultStdFee, getStdFee, toBigNumber, toChainFormat } from "@injectivelabs/utils";
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import { $t as uint8ArrayToString, O as denomAmountFromGrpcChainDenomAmount, Wt as fromUtf8, Yt as toBase64, Zt as uint8ArrayToBase64, jt as protobufTimestampToUnixSeconds, kt as protobufTimestampToDate, l as ChainGrpcCommonTransformer, n as fetchAllWithPagination, nn as bigIntToString, zt as base64ToUint8Array } from "./utils-
|
|
2
|
-
import { t as _defineProperty } from "./defineProperty-
|
|
3
|
-
import { o as ChainModule, p as BondStatus } from "./ChainRestTendermintApi-
|
|
4
|
-
import { t as BaseGrpcConsumer } from "./BaseGrpcConsumer-
|
|
5
|
-
import { t as BaseRestConsumer } from "./BaseRestConsumer-
|
|
1
|
+
import { $t as uint8ArrayToString, O as denomAmountFromGrpcChainDenomAmount, Wt as fromUtf8, Yt as toBase64, Zt as uint8ArrayToBase64, jt as protobufTimestampToUnixSeconds, kt as protobufTimestampToDate, l as ChainGrpcCommonTransformer, n as fetchAllWithPagination, nn as bigIntToString, zt as base64ToUint8Array } from "./utils-XYJbh13N.js";
|
|
2
|
+
import { t as _defineProperty } from "./defineProperty-HO0rQlTT.js";
|
|
3
|
+
import { o as ChainModule, p as BondStatus } from "./ChainRestTendermintApi-Duz8V3KK.js";
|
|
4
|
+
import { t as BaseGrpcConsumer } from "./BaseGrpcConsumer-CsJHyzUs.js";
|
|
5
|
+
import { t as BaseRestConsumer } from "./BaseRestConsumer-BySVL6Rh.js";
|
|
6
6
|
import { toBigNumber, toHumanReadable } from "@injectivelabs/utils";
|
|
7
7
|
import { ErrorType, GeneralException, HttpRequestException, UnspecifiedErrorCode } from "@injectivelabs/exceptions";
|
|
8
8
|
import * as CosmosAuthzV1Beta1AuthzPb from "@injectivelabs/core-proto-ts-v2/generated/cosmos/authz/v1beta1/authz_pb";
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import "../tx_pb-
|
|
2
|
-
import "../index-
|
|
3
|
-
import "../BaseGrpcConsumer-
|
|
4
|
-
import { n as PointsStatsRow, r as AbacusGrpcApi, t as PointsLatestResponse } from "../index-
|
|
1
|
+
import "../tx_pb-B9KzLX7v.js";
|
|
2
|
+
import "../index-C8crIAg1.js";
|
|
3
|
+
import "../BaseGrpcConsumer-DEH9Rq7m.js";
|
|
4
|
+
import { n as PointsStatsRow, r as AbacusGrpcApi, t as PointsLatestResponse } from "../index-DKn53Idr.js";
|
|
5
5
|
export { AbacusGrpcApi, PointsLatestResponse, PointsStatsRow };
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import "../defineProperty-
|
|
2
|
-
import "../grpc-
|
|
3
|
-
import "../BaseGrpcConsumer-
|
|
4
|
-
import { t as AbacusGrpcApi } from "../AbacusGrpcApi-
|
|
1
|
+
import "../defineProperty-HO0rQlTT.js";
|
|
2
|
+
import "../grpc-BJmNoike.js";
|
|
3
|
+
import "../BaseGrpcConsumer-CsJHyzUs.js";
|
|
4
|
+
import { t as AbacusGrpcApi } from "../AbacusGrpcApi-Dh2A_RaD.js";
|
|
5
5
|
|
|
6
6
|
export { AbacusGrpcApi };
|