@injectivelabs/sdk-ts 1.20.40 → 1.20.41
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-BoWkMu4k.d.cts → BaseGrpcConsumer-CdK49BN-.d.cts} +1 -1
- package/dist/cjs/{ChainGrpcExchangeApi-O9bXA4Wp.cjs → ChainGrpcExchangeApi-CId-6M-5.cjs} +6 -1
- package/dist/cjs/{MsgSetDenomMetadata-BoViAtb-.cjs → MsgSetDenomMetadata-B3DybiHv.cjs} +1 -1
- package/dist/cjs/{QueryTradingStrategyContractTotalStrategies-vAGgibz4.cjs → QueryTradingStrategyContractTotalStrategies-CFnjo4KE.cjs} +1 -1
- package/dist/cjs/{chain-71Y9o8in.cjs → chain-BQSlc71m.cjs} +974 -0
- package/dist/cjs/client/abacus.d.cts +3 -3
- package/dist/cjs/client/chain.cjs +4 -2
- package/dist/cjs/client/chain.d.cts +10 -10
- package/dist/cjs/client/indexer.d.cts +9 -9
- package/dist/cjs/client/olp.d.cts +3 -3
- package/dist/cjs/client/platformServices.d.cts +3 -3
- package/dist/cjs/client/tcAbacus.d.cts +3 -3
- package/dist/cjs/client/wasm.cjs +3 -3
- package/dist/cjs/client/wasm.d.cts +2 -2
- package/dist/cjs/core/accounts.d.cts +9 -9
- package/dist/cjs/core/modules.cjs +2 -2
- package/dist/cjs/core/modules.d.cts +9 -9
- package/dist/cjs/core/tx.d.cts +9 -9
- package/dist/cjs/{index-BgG-Ygmg.d.cts → index-BD_sjZdM.d.cts} +22277 -17750
- package/dist/cjs/{index-Bi_QOX1c.d.cts → index-BR56GmK7.d.cts} +1 -1
- package/dist/cjs/{index-B674D7pD.d.cts → index-B_IiQ_8l.d.cts} +72 -1
- package/dist/cjs/{index-DuSabiqc.d.cts → index-COHrq5cC.d.cts} +1 -1
- package/dist/cjs/{index-BZDon-tA.d.cts → index-D-B0a_XJ.d.cts} +1 -1
- package/dist/cjs/{index-B5gFsbnp.d.cts → index-DZETSzfT.d.cts} +1 -1
- package/dist/cjs/{index-C9A-6Kpk.d.cts → index-DZmLd0jv.d.cts} +1 -1
- package/dist/cjs/{index-CiWsZ0Bw.d.cts → index-Dv0XARBE.d.cts} +1 -1
- package/dist/cjs/index.cjs +6 -4
- package/dist/cjs/index.d.cts +10 -10
- package/dist/cjs/service.d.cts +2 -2
- package/dist/cjs/types.d.cts +1 -1
- package/dist/cjs/utils.d.cts +9 -9
- package/dist/esm/{BaseGrpcConsumer-B-As45Rt.d.ts → BaseGrpcConsumer-ZV4ntv99.d.ts} +1 -1
- package/dist/esm/{ChainGrpcExchangeApi-CBjh2YW3.js → ChainGrpcExchangeApi-CKX1iMn5.js} +6 -1
- package/dist/esm/{MsgSetDenomMetadata-CgV0fs9N.js → MsgSetDenomMetadata-cLEp9FNe.js} +1 -1
- package/dist/esm/{QueryTradingStrategyContractTotalStrategies-DqjBo_5G.js → QueryTradingStrategyContractTotalStrategies-BpCTIlKQ.js} +1 -1
- package/dist/esm/{chain-lwkNu_TP.js → chain-CN3u6aoh.js} +970 -9
- package/dist/esm/client/abacus.d.ts +3 -3
- package/dist/esm/client/chain.d.ts +10 -10
- package/dist/esm/client/chain.js +3 -3
- package/dist/esm/client/indexer.d.ts +9 -9
- package/dist/esm/client/olp.d.ts +3 -3
- package/dist/esm/client/platformServices.d.ts +3 -3
- package/dist/esm/client/tcAbacus.d.ts +3 -3
- package/dist/esm/client/wasm.d.ts +2 -2
- package/dist/esm/client/wasm.js +3 -3
- package/dist/esm/core/accounts.d.ts +9 -9
- package/dist/esm/core/modules.d.ts +9 -9
- package/dist/esm/core/modules.js +2 -2
- package/dist/esm/core/tx.d.ts +9 -9
- package/dist/esm/{index-npjAvTgI.d.ts → index-B4b_ZIR4.d.ts} +1 -1
- package/dist/esm/{index-CWDs9PX_.d.ts → index-BOgOcIyP.d.ts} +1 -1
- package/dist/esm/{index-RFuIuhwk.d.ts → index-BmHizv7B.d.ts} +1 -1
- package/dist/esm/{index-B0keqriy.d.ts → index-By1aye_R.d.ts} +1 -1
- package/dist/esm/{index-3oRwOCmE.d.ts → index-DjdeHPw_.d.ts} +22277 -17750
- package/dist/esm/{index-D8HsSSPt.d.ts → index-DoFZGNtu.d.ts} +72 -1
- package/dist/esm/{index-CMEOc5cJ.d.ts → index-PjSrVBs0.d.ts} +1 -1
- package/dist/esm/{index-BX0RYyak.d.ts → index-m5131rZQ.d.ts} +1 -1
- package/dist/esm/index.d.ts +10 -10
- package/dist/esm/index.js +5 -5
- package/dist/esm/service.d.ts +2 -2
- package/dist/esm/types.d.ts +1 -1
- package/dist/esm/utils.d.ts +9 -9
- package/package.json +5 -5
|
@@ -1,6 +1,7 @@
|
|
|
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
3
|
import { Ft as protobufTimestampToDate, Lt as protobufTimestampToUnixSeconds, _t as bigIntToString, l as ChainGrpcCommonTransformer, n as fetchAllWithPagination, y as denomAmountFromGrpcChainDenomAmount } from "./utils-BPuX8T_g.js";
|
|
4
|
+
import { n as bytesToHex } from "./address-light-B2JvY3Or.js";
|
|
4
5
|
import { o as ChainModule, p as BondStatus } from "./ChainRestTendermintApi-bwqA_ww1.js";
|
|
5
6
|
import { t as BaseGrpcConsumer } from "./BaseGrpcConsumer-DEDRwnCk.js";
|
|
6
7
|
import { t as BaseRestConsumer } from "./BaseRestConsumer-BjN9JApr.js";
|
|
@@ -35,14 +36,16 @@ import * as InjectiveAuctionV1Beta1QueryPb from "@injectivelabs/core-proto-ts-v2
|
|
|
35
36
|
import { QueryClient as QueryClient$12 } from "@injectivelabs/core-proto-ts-v2/generated/injective/auction/v1beta1/query_pb.client";
|
|
36
37
|
import * as CosmosStakingV1Beta1QueryPb from "@injectivelabs/core-proto-ts-v2/generated/cosmos/staking/v1beta1/query_pb";
|
|
37
38
|
import { QueryClient as QueryClient$13 } from "@injectivelabs/core-proto-ts-v2/generated/cosmos/staking/v1beta1/query_pb.client";
|
|
39
|
+
import * as InjectiveExchangeV2QueryPb from "@injectivelabs/core-proto-ts-v2/generated/injective/exchange/v2/query_pb";
|
|
40
|
+
import { QueryClient as QueryClient$14 } from "@injectivelabs/core-proto-ts-v2/generated/injective/exchange/v2/query_pb.client";
|
|
38
41
|
import * as InjectivePermissionsV1Beta1QueryPb from "@injectivelabs/core-proto-ts-v2/generated/injective/permissions/v1beta1/query_pb";
|
|
39
|
-
import { QueryClient as QueryClient$
|
|
42
|
+
import { QueryClient as QueryClient$15 } from "@injectivelabs/core-proto-ts-v2/generated/injective/permissions/v1beta1/query_pb.client";
|
|
40
43
|
import * as CosmosDistributionV1Beta1QueryPb from "@injectivelabs/core-proto-ts-v2/generated/cosmos/distribution/v1beta1/query_pb";
|
|
41
|
-
import { QueryClient as QueryClient$
|
|
44
|
+
import { QueryClient as QueryClient$16 } from "@injectivelabs/core-proto-ts-v2/generated/cosmos/distribution/v1beta1/query_pb.client";
|
|
42
45
|
import * as InjectiveTokenFactoryV1Beta1QueryPb from "@injectivelabs/core-proto-ts-v2/generated/injective/tokenfactory/v1beta1/query_pb";
|
|
43
|
-
import { QueryClient as QueryClient$
|
|
46
|
+
import { QueryClient as QueryClient$17 } from "@injectivelabs/core-proto-ts-v2/generated/injective/tokenfactory/v1beta1/query_pb.client";
|
|
44
47
|
import * as InjectiveInsuranceV1Beta1QueryPb from "@injectivelabs/core-proto-ts-v2/generated/injective/insurance/v1beta1/query_pb";
|
|
45
|
-
import { QueryClient as QueryClient$
|
|
48
|
+
import { QueryClient as QueryClient$18 } from "@injectivelabs/core-proto-ts-v2/generated/injective/insurance/v1beta1/query_pb.client";
|
|
46
49
|
import { StatusCodes } from "http-status-codes";
|
|
47
50
|
|
|
48
51
|
//#region src/client/chain/transformers/ChainGrpcGovTransformer.ts
|
|
@@ -831,6 +834,546 @@ var ChainGrpcStakingTransformer = class ChainGrpcStakingTransformer {
|
|
|
831
834
|
}
|
|
832
835
|
};
|
|
833
836
|
|
|
837
|
+
//#endregion
|
|
838
|
+
//#region src/client/chain/transformers/ChainGrpcExchangeTransformerV2.ts
|
|
839
|
+
/**
|
|
840
|
+
* @category Chain Grpc Transformer
|
|
841
|
+
*/
|
|
842
|
+
var ChainGrpcExchangeTransformerV2 = class ChainGrpcExchangeTransformerV2 {
|
|
843
|
+
static moduleStateResponseToModuleState(response) {
|
|
844
|
+
if (!response.state) throw new Error("Exchange module state not found in response");
|
|
845
|
+
return response.state;
|
|
846
|
+
}
|
|
847
|
+
static moduleParamsResponseToParams(response) {
|
|
848
|
+
const params = response.params;
|
|
849
|
+
return {
|
|
850
|
+
spotMarketInstantListingFee: params.spotMarketInstantListingFee,
|
|
851
|
+
derivativeMarketInstantListingFee: params.derivativeMarketInstantListingFee,
|
|
852
|
+
defaultSpotMakerFeeRate: params.defaultSpotMakerFeeRate,
|
|
853
|
+
defaultSpotTakerFeeRate: params.defaultSpotTakerFeeRate,
|
|
854
|
+
defaultDerivativeMakerFeeRate: params.defaultDerivativeMakerFeeRate,
|
|
855
|
+
defaultDerivativeTakerFeeRate: params.defaultDerivativeTakerFeeRate,
|
|
856
|
+
defaultInitialMarginRatio: params.defaultInitialMarginRatio,
|
|
857
|
+
defaultMaintenanceMarginRatio: params.defaultMaintenanceMarginRatio,
|
|
858
|
+
defaultFundingInterval: Number(params.defaultFundingInterval),
|
|
859
|
+
fundingMultiple: Number(params.fundingMultiple),
|
|
860
|
+
relayerFeeShareRate: params.relayerFeeShareRate,
|
|
861
|
+
defaultHourlyFundingRateCap: params.defaultHourlyFundingRateCap,
|
|
862
|
+
defaultHourlyInterestRate: params.defaultHourlyInterestRate,
|
|
863
|
+
maxDerivativeOrderSideCount: params.maxDerivativeOrderSideCount,
|
|
864
|
+
injRewardStakedRequirementThreshold: params.injRewardStakedRequirementThreshold,
|
|
865
|
+
tradingRewardsVestingDuration: Number(params.tradingRewardsVestingDuration),
|
|
866
|
+
liquidatorRewardShareRate: params.liquidatorRewardShareRate,
|
|
867
|
+
binaryOptionsMarketInstantListingFee: params.binaryOptionsMarketInstantListingFee,
|
|
868
|
+
atomicMarketOrderAccessLevel: params.atomicMarketOrderAccessLevel.toString(),
|
|
869
|
+
spotAtomicMarketOrderFeeMultiplier: params.spotAtomicMarketOrderFeeMultiplier,
|
|
870
|
+
derivativeAtomicMarketOrderFeeMultiplier: params.derivativeAtomicMarketOrderFeeMultiplier,
|
|
871
|
+
binaryOptionsAtomicMarketOrderFeeMultiplier: params.binaryOptionsAtomicMarketOrderFeeMultiplier,
|
|
872
|
+
minimalProtocolFeeRate: params.minimalProtocolFeeRate,
|
|
873
|
+
isInstantDerivativeMarketLaunchEnabled: params.isInstantDerivativeMarketLaunchEnabled,
|
|
874
|
+
postOnlyModeHeightThreshold: params.postOnlyModeHeightThreshold.toString(),
|
|
875
|
+
marginDecreasePriceTimestampThresholdSeconds: params.marginDecreasePriceTimestampThresholdSeconds.toString(),
|
|
876
|
+
exchangeAdmins: params.exchangeAdmins
|
|
877
|
+
};
|
|
878
|
+
}
|
|
879
|
+
static feeDiscountScheduleResponseToFeeDiscountSchedule(response) {
|
|
880
|
+
const schedule = response.feeDiscountSchedule;
|
|
881
|
+
return {
|
|
882
|
+
bucketCount: Number(schedule.bucketCount),
|
|
883
|
+
bucketDuration: Number(schedule.bucketDuration),
|
|
884
|
+
quoteDenomsList: schedule.quoteDenoms,
|
|
885
|
+
tierInfosList: schedule.tierInfos.map(ChainGrpcExchangeTransformerV2.grpcFeeDiscountTierInfoToFeeDiscountTierInfo).filter((info) => info !== void 0),
|
|
886
|
+
disqualifiedMarketIdsList: schedule.disqualifiedMarketIds
|
|
887
|
+
};
|
|
888
|
+
}
|
|
889
|
+
static feeDiscountAccountInfoResponseToFeeDiscountAccountInfo(response) {
|
|
890
|
+
return {
|
|
891
|
+
tierLevel: Number(response.tierLevel),
|
|
892
|
+
accountInfo: ChainGrpcExchangeTransformerV2.grpcFeeDiscountTierInfoToFeeDiscountTierInfo(response.accountInfo),
|
|
893
|
+
accountTtl: ChainGrpcExchangeTransformerV2.grpcFeeDiscountTierTTLToFeeDiscountTierTTL(response.accountTtl)
|
|
894
|
+
};
|
|
895
|
+
}
|
|
896
|
+
static grpcFeeDiscountTierInfoToFeeDiscountTierInfo(info) {
|
|
897
|
+
var _info$volume;
|
|
898
|
+
return info ? {
|
|
899
|
+
makerDiscountRate: info.makerDiscountRate,
|
|
900
|
+
takerDiscountRate: info.takerDiscountRate,
|
|
901
|
+
stakedAmount: info.stakedAmount,
|
|
902
|
+
volume: (_info$volume = info.volume) !== null && _info$volume !== void 0 ? _info$volume : "0"
|
|
903
|
+
} : void 0;
|
|
904
|
+
}
|
|
905
|
+
static grpcFeeDiscountTierTTLToFeeDiscountTierTTL(info) {
|
|
906
|
+
return info ? {
|
|
907
|
+
tier: Number(info.tier),
|
|
908
|
+
ttlTimestamp: Number(info.ttlTimestamp)
|
|
909
|
+
} : void 0;
|
|
910
|
+
}
|
|
911
|
+
static grpcPointsMultiplierToPointsMultiplier(point) {
|
|
912
|
+
return {
|
|
913
|
+
makerPointsMultiplier: point.makerPointsMultiplier,
|
|
914
|
+
takerPointsMultiplier: point.takerPointsMultiplier
|
|
915
|
+
};
|
|
916
|
+
}
|
|
917
|
+
static grpcTradingRewardCampaignBoostInfoToTradingRewardCampaignBoostInfo(info) {
|
|
918
|
+
return info ? {
|
|
919
|
+
boostedSpotMarketIdsList: info.boostedSpotMarketIds,
|
|
920
|
+
spotMarketMultipliersList: info.spotMarketMultipliers.map(ChainGrpcExchangeTransformerV2.grpcPointsMultiplierToPointsMultiplier),
|
|
921
|
+
boostedDerivativeMarketIdsList: info.boostedDerivativeMarketIds,
|
|
922
|
+
derivativeMarketMultipliersList: info.derivativeMarketMultipliers.map(ChainGrpcExchangeTransformerV2.grpcPointsMultiplierToPointsMultiplier)
|
|
923
|
+
} : void 0;
|
|
924
|
+
}
|
|
925
|
+
static grpcTradingRewardCampaignInfoToTradingRewardCampaignInfo(info) {
|
|
926
|
+
return info ? {
|
|
927
|
+
campaignDurationSeconds: Number(info.campaignDurationSeconds),
|
|
928
|
+
quoteDenomsList: info.quoteDenoms,
|
|
929
|
+
tradingRewardBoostInfo: ChainGrpcExchangeTransformerV2.grpcTradingRewardCampaignBoostInfoToTradingRewardCampaignBoostInfo(info.tradingRewardBoostInfo),
|
|
930
|
+
disqualifiedMarketIdsList: info.disqualifiedMarketIds
|
|
931
|
+
} : void 0;
|
|
932
|
+
}
|
|
933
|
+
static grpcCampaignRewardPoolToCampaignRewardPool(pool) {
|
|
934
|
+
return {
|
|
935
|
+
startTimestamp: Number(pool.startTimestamp),
|
|
936
|
+
maxCampaignRewardsList: pool.maxCampaignRewards.map((coin) => ({
|
|
937
|
+
amount: coin.amount,
|
|
938
|
+
denom: coin.denom
|
|
939
|
+
}))
|
|
940
|
+
};
|
|
941
|
+
}
|
|
942
|
+
static tradingRewardsCampaignResponseToTradingRewardsCampaign(response) {
|
|
943
|
+
return {
|
|
944
|
+
tradingRewardCampaignInfo: ChainGrpcExchangeTransformerV2.grpcTradingRewardCampaignInfoToTradingRewardCampaignInfo(response.tradingRewardCampaignInfo),
|
|
945
|
+
tradingRewardPoolCampaignScheduleList: response.tradingRewardPoolCampaignSchedule.map(ChainGrpcExchangeTransformerV2.grpcCampaignRewardPoolToCampaignRewardPool),
|
|
946
|
+
pendingTradingRewardPoolCampaignScheduleList: response.pendingTradingRewardPoolCampaignSchedule.map(ChainGrpcExchangeTransformerV2.grpcCampaignRewardPoolToCampaignRewardPool),
|
|
947
|
+
totalTradeRewardPoints: response.totalTradeRewardPoints,
|
|
948
|
+
pendingTotalTradeRewardPointsList: response.pendingTotalTradeRewardPoints
|
|
949
|
+
};
|
|
950
|
+
}
|
|
951
|
+
static isOptedOutOfRewardsResponseToIsOptedOutOfRewards(response) {
|
|
952
|
+
return { isOptedOut: response.isOptedOut };
|
|
953
|
+
}
|
|
954
|
+
static activeStakeGrantResponseToActiveStakeGrant(response) {
|
|
955
|
+
if (!response.grant || !response.effectiveGrant) throw new Error("Active stake grant not found in response");
|
|
956
|
+
return {
|
|
957
|
+
grant: response.grant,
|
|
958
|
+
effectiveGrant: response.effectiveGrant
|
|
959
|
+
};
|
|
960
|
+
}
|
|
961
|
+
static denomDecimalsResponseToDenomDecimals(response) {
|
|
962
|
+
return response.denomDecimals.map((item) => ({
|
|
963
|
+
denom: item.denom,
|
|
964
|
+
decimals: item.decimals.toString()
|
|
965
|
+
}));
|
|
966
|
+
}
|
|
967
|
+
static denomMinNotionalsResponseToDenomMinNotionals(response) {
|
|
968
|
+
return response.denomMinNotionals.map((item) => ({
|
|
969
|
+
denom: item.denom,
|
|
970
|
+
minNotional: item.minNotional
|
|
971
|
+
}));
|
|
972
|
+
}
|
|
973
|
+
static l3OrderbookResponseToOrderbook(response) {
|
|
974
|
+
return {
|
|
975
|
+
bids: response.bids.map((order) => ({
|
|
976
|
+
price: order.price,
|
|
977
|
+
quantity: order.quantity,
|
|
978
|
+
orderHash: order.orderHash,
|
|
979
|
+
subaccountId: order.subaccountId
|
|
980
|
+
})),
|
|
981
|
+
asks: response.asks.map((order) => ({
|
|
982
|
+
price: order.price,
|
|
983
|
+
quantity: order.quantity,
|
|
984
|
+
orderHash: order.orderHash,
|
|
985
|
+
subaccountId: order.subaccountId
|
|
986
|
+
})),
|
|
987
|
+
sequence: Number(response.seq)
|
|
988
|
+
};
|
|
989
|
+
}
|
|
990
|
+
static orderbookResponseToOrderbook(response) {
|
|
991
|
+
return {
|
|
992
|
+
buys: response.buysPriceLevel.map(ChainGrpcExchangeTransformerV2.grpcLevelToOrderbookLevel),
|
|
993
|
+
sells: response.sellsPriceLevel.map(ChainGrpcExchangeTransformerV2.grpcLevelToOrderbookLevel),
|
|
994
|
+
sequence: Number(response.seq)
|
|
995
|
+
};
|
|
996
|
+
}
|
|
997
|
+
static grpcLevelToOrderbookLevel(level) {
|
|
998
|
+
return {
|
|
999
|
+
price: level.p,
|
|
1000
|
+
quantity: level.q
|
|
1001
|
+
};
|
|
1002
|
+
}
|
|
1003
|
+
static grpcTrimmedSpotLimitOrderToOrder(order) {
|
|
1004
|
+
return {
|
|
1005
|
+
price: order.price,
|
|
1006
|
+
quantity: order.quantity,
|
|
1007
|
+
fillable: order.fillable,
|
|
1008
|
+
isBuy: order.isBuy,
|
|
1009
|
+
orderHash: order.orderHash,
|
|
1010
|
+
cid: order.cid
|
|
1011
|
+
};
|
|
1012
|
+
}
|
|
1013
|
+
static grpcTrimmedDerivativeLimitOrderToOrder(order) {
|
|
1014
|
+
return {
|
|
1015
|
+
...ChainGrpcExchangeTransformerV2.grpcTrimmedSpotLimitOrderToOrder(order),
|
|
1016
|
+
margin: order.margin
|
|
1017
|
+
};
|
|
1018
|
+
}
|
|
1019
|
+
static spotOrdersResponseToOrders(response) {
|
|
1020
|
+
return { orders: response.orders.map(ChainGrpcExchangeTransformerV2.grpcTrimmedSpotLimitOrderToOrder) };
|
|
1021
|
+
}
|
|
1022
|
+
static derivativeOrdersResponseToOrders(response) {
|
|
1023
|
+
return { orders: response.orders.map(ChainGrpcExchangeTransformerV2.grpcTrimmedDerivativeLimitOrderToOrder) };
|
|
1024
|
+
}
|
|
1025
|
+
static grpcSubaccountOrderDataToOrderData(data) {
|
|
1026
|
+
return {
|
|
1027
|
+
order: data.order ? {
|
|
1028
|
+
price: data.order.price,
|
|
1029
|
+
quantity: data.order.quantity,
|
|
1030
|
+
isReduceOnly: data.order.isReduceOnly,
|
|
1031
|
+
cid: data.order.cid
|
|
1032
|
+
} : void 0,
|
|
1033
|
+
orderHash: bytesToHex(data.orderHash)
|
|
1034
|
+
};
|
|
1035
|
+
}
|
|
1036
|
+
static subaccountOrdersResponseToOrders(response) {
|
|
1037
|
+
return {
|
|
1038
|
+
buyOrders: response.buyOrders.map(ChainGrpcExchangeTransformerV2.grpcSubaccountOrderDataToOrderData),
|
|
1039
|
+
sellOrders: response.sellOrders.map(ChainGrpcExchangeTransformerV2.grpcSubaccountOrderDataToOrderData)
|
|
1040
|
+
};
|
|
1041
|
+
}
|
|
1042
|
+
static crossMarginPoolSnapshotResponseToCrossMarginPoolSnapshot(response) {
|
|
1043
|
+
return {
|
|
1044
|
+
quoteDenom: response.quoteDenom,
|
|
1045
|
+
quoteBalance: response.quoteBalance,
|
|
1046
|
+
positionMarginTotal: response.positionMarginTotal,
|
|
1047
|
+
unrealizedPnl: response.unrealizedPnl,
|
|
1048
|
+
unrealizedPnlEffective: response.unrealizedPnlEffective,
|
|
1049
|
+
equityAdmission: response.equityAdmission,
|
|
1050
|
+
equityLiquidation: response.equityLiquidation,
|
|
1051
|
+
initialMarginTotal: response.initialMarginTotal,
|
|
1052
|
+
maintenanceMarginTotal: response.maintenanceMarginTotal,
|
|
1053
|
+
initialMarginWithOrdersTotal: response.initialMarginWithOrdersTotal,
|
|
1054
|
+
entryLossTotal: response.entryLossTotal,
|
|
1055
|
+
feeReserveTotal: response.feeReserveTotal,
|
|
1056
|
+
orderLockRequirement: response.orderLockRequirement,
|
|
1057
|
+
positiveUpnlHaircutRate: response.positiveUpnlHaircutRate,
|
|
1058
|
+
healthFactor: response.healthFactor
|
|
1059
|
+
};
|
|
1060
|
+
}
|
|
1061
|
+
static tradeRewardPointsResponseToTradeRewardPoints(response) {
|
|
1062
|
+
return { accountTradeRewardPoints: response.accountTradeRewardPoints };
|
|
1063
|
+
}
|
|
1064
|
+
static openInterestResponseToOpenInterest(response) {
|
|
1065
|
+
return { amount: response.amount ? {
|
|
1066
|
+
marketId: response.amount.marketId,
|
|
1067
|
+
balance: response.amount.balance
|
|
1068
|
+
} : void 0 };
|
|
1069
|
+
}
|
|
1070
|
+
static subaccountDepositsResponseToSubaccountDeposits(response) {
|
|
1071
|
+
return { deposits: Object.fromEntries(Object.entries(response.deposits).map(([denom, deposit]) => [denom, {
|
|
1072
|
+
availableBalance: deposit.availableBalance,
|
|
1073
|
+
totalBalance: deposit.totalBalance
|
|
1074
|
+
}])) };
|
|
1075
|
+
}
|
|
1076
|
+
static subaccountDepositResponseToSubaccountDeposit(response) {
|
|
1077
|
+
return { deposits: response.deposits ? {
|
|
1078
|
+
availableBalance: response.deposits.availableBalance,
|
|
1079
|
+
totalBalance: response.deposits.totalBalance
|
|
1080
|
+
} : void 0 };
|
|
1081
|
+
}
|
|
1082
|
+
static aggregateVolumeResponseToAggregateVolume(response) {
|
|
1083
|
+
return { aggregateVolumes: response.aggregateVolumes.map(ChainGrpcExchangeTransformerV2.grpcMarketVolumeToMarketVolume) };
|
|
1084
|
+
}
|
|
1085
|
+
static aggregateVolumesResponseToAggregateVolumes(response) {
|
|
1086
|
+
return {
|
|
1087
|
+
aggregateAccountVolumes: response.aggregateAccountVolumes.map((record) => ({
|
|
1088
|
+
account: record.account,
|
|
1089
|
+
marketVolumes: record.marketVolumes.map(ChainGrpcExchangeTransformerV2.grpcMarketVolumeToMarketVolume)
|
|
1090
|
+
})),
|
|
1091
|
+
aggregateMarketVolumes: response.aggregateMarketVolumes.map(ChainGrpcExchangeTransformerV2.grpcMarketVolumeToMarketVolume)
|
|
1092
|
+
};
|
|
1093
|
+
}
|
|
1094
|
+
static aggregateMarketVolumeResponseToAggregateMarketVolume(response) {
|
|
1095
|
+
return { volume: response.volume ? {
|
|
1096
|
+
makerVolume: response.volume.makerVolume,
|
|
1097
|
+
takerVolume: response.volume.takerVolume
|
|
1098
|
+
} : void 0 };
|
|
1099
|
+
}
|
|
1100
|
+
static aggregateMarketVolumesResponseToAggregateMarketVolumes(response) {
|
|
1101
|
+
return { volumes: response.volumes.map(ChainGrpcExchangeTransformerV2.grpcMarketVolumeToMarketVolume) };
|
|
1102
|
+
}
|
|
1103
|
+
static midPriceAndTobResponseToMidPriceAndTob(response) {
|
|
1104
|
+
return {
|
|
1105
|
+
midPrice: response.midPrice,
|
|
1106
|
+
bestBuyPrice: response.bestBuyPrice,
|
|
1107
|
+
bestSellPrice: response.bestSellPrice
|
|
1108
|
+
};
|
|
1109
|
+
}
|
|
1110
|
+
static derivativeMarketAddressResponseToDerivativeMarketAddress(response) {
|
|
1111
|
+
return {
|
|
1112
|
+
address: response.address,
|
|
1113
|
+
subaccountId: response.subaccountId
|
|
1114
|
+
};
|
|
1115
|
+
}
|
|
1116
|
+
static grpcMarketVolumeToMarketVolume(marketVolume) {
|
|
1117
|
+
return {
|
|
1118
|
+
marketId: marketVolume.marketId,
|
|
1119
|
+
volume: marketVolume.volume ? {
|
|
1120
|
+
makerVolume: marketVolume.volume.makerVolume,
|
|
1121
|
+
takerVolume: marketVolume.volume.takerVolume
|
|
1122
|
+
} : void 0
|
|
1123
|
+
};
|
|
1124
|
+
}
|
|
1125
|
+
static spotMarketsResponseToSpotMarkets(response) {
|
|
1126
|
+
return response.markets.map(ChainGrpcExchangeTransformerV2.grpcSpotMarketToSpotMarket);
|
|
1127
|
+
}
|
|
1128
|
+
static grpcSpotMarketToSpotMarket(market) {
|
|
1129
|
+
return {
|
|
1130
|
+
marketId: market.marketId,
|
|
1131
|
+
marketStatus: market.status.toString(),
|
|
1132
|
+
ticker: market.ticker,
|
|
1133
|
+
baseDenom: market.baseDenom,
|
|
1134
|
+
quoteDenom: market.quoteDenom,
|
|
1135
|
+
makerFeeRate: market.makerFeeRate,
|
|
1136
|
+
quoteToken: void 0,
|
|
1137
|
+
baseToken: void 0,
|
|
1138
|
+
takerFeeRate: market.takerFeeRate,
|
|
1139
|
+
serviceProviderFee: "",
|
|
1140
|
+
minPriceTickSize: Number(market.minPriceTickSize),
|
|
1141
|
+
minQuantityTickSize: Number(market.minQuantityTickSize),
|
|
1142
|
+
minNotional: Number(market.minNotional)
|
|
1143
|
+
};
|
|
1144
|
+
}
|
|
1145
|
+
static fullSpotMarketsResponseToSpotMarkets(response) {
|
|
1146
|
+
return response.markets.map(ChainGrpcExchangeTransformerV2.grpcFullSpotMarketToSpotMarket);
|
|
1147
|
+
}
|
|
1148
|
+
static grpcFullSpotMarketToSpotMarket(market) {
|
|
1149
|
+
return ChainGrpcExchangeTransformerV2.grpcSpotMarketToSpotMarket(market.market);
|
|
1150
|
+
}
|
|
1151
|
+
static derivativeMarketsResponseToDerivativeMarkets(response) {
|
|
1152
|
+
return response.markets.map(ChainGrpcExchangeTransformerV2.grpcFullDerivativeMarketToDerivativeMarket);
|
|
1153
|
+
}
|
|
1154
|
+
static grpcFullDerivativeMarketToDerivativeMarket(market) {
|
|
1155
|
+
var _market$info, _perpetualMarketInfo$, _perpetualMarketInfo$2, _perpetualMarketInfo$3, _perpetualMarketInfo$4;
|
|
1156
|
+
const marketInfo = market.market;
|
|
1157
|
+
const perpetualMarketInfo = ((_market$info = market.info) === null || _market$info === void 0 ? void 0 : _market$info.oneofKind) === "perpetualInfo" ? market.info.perpetualInfo.marketInfo : void 0;
|
|
1158
|
+
return {
|
|
1159
|
+
oracleType: marketInfo.oracleType.toString(),
|
|
1160
|
+
marketId: marketInfo.marketId,
|
|
1161
|
+
marketStatus: marketInfo.status.toString(),
|
|
1162
|
+
ticker: marketInfo.ticker,
|
|
1163
|
+
quoteDenom: marketInfo.quoteDenom,
|
|
1164
|
+
makerFeeRate: marketInfo.makerFeeRate,
|
|
1165
|
+
takerFeeRate: marketInfo.takerFeeRate,
|
|
1166
|
+
serviceProviderFee: "",
|
|
1167
|
+
quoteToken: void 0,
|
|
1168
|
+
minPriceTickSize: Number(marketInfo.minPriceTickSize),
|
|
1169
|
+
minQuantityTickSize: Number(marketInfo.minQuantityTickSize),
|
|
1170
|
+
minNotional: Number(marketInfo.minNotional),
|
|
1171
|
+
reduceMarginRatio: marketInfo.reduceMarginRatio,
|
|
1172
|
+
initialMarginRatio: marketInfo.initialMarginRatio,
|
|
1173
|
+
maintenanceMarginRatio: marketInfo.maintenanceMarginRatio,
|
|
1174
|
+
isPerpetual: marketInfo.isPerpetual,
|
|
1175
|
+
oracleBase: marketInfo.oracleBase,
|
|
1176
|
+
oracleQuote: marketInfo.oracleQuote,
|
|
1177
|
+
oracleScaleFactor: marketInfo.oracleScaleFactor,
|
|
1178
|
+
perpetualMarketInfo: {
|
|
1179
|
+
hourlyFundingRateCap: (_perpetualMarketInfo$ = perpetualMarketInfo === null || perpetualMarketInfo === void 0 ? void 0 : perpetualMarketInfo.hourlyFundingRateCap) !== null && _perpetualMarketInfo$ !== void 0 ? _perpetualMarketInfo$ : "0",
|
|
1180
|
+
hourlyInterestRate: (_perpetualMarketInfo$2 = perpetualMarketInfo === null || perpetualMarketInfo === void 0 ? void 0 : perpetualMarketInfo.hourlyInterestRate) !== null && _perpetualMarketInfo$2 !== void 0 ? _perpetualMarketInfo$2 : "0",
|
|
1181
|
+
nextFundingTimestamp: Number((_perpetualMarketInfo$3 = perpetualMarketInfo === null || perpetualMarketInfo === void 0 ? void 0 : perpetualMarketInfo.nextFundingTimestamp) !== null && _perpetualMarketInfo$3 !== void 0 ? _perpetualMarketInfo$3 : 0),
|
|
1182
|
+
fundingInterval: Number((_perpetualMarketInfo$4 = perpetualMarketInfo === null || perpetualMarketInfo === void 0 ? void 0 : perpetualMarketInfo.fundingInterval) !== null && _perpetualMarketInfo$4 !== void 0 ? _perpetualMarketInfo$4 : 0)
|
|
1183
|
+
}
|
|
1184
|
+
};
|
|
1185
|
+
}
|
|
1186
|
+
static subaccountRiskProfileResponseToSubaccountRiskProfile(response) {
|
|
1187
|
+
return {
|
|
1188
|
+
profile: response.profile ? {
|
|
1189
|
+
mode: response.profile.mode,
|
|
1190
|
+
reservationPolicy: response.profile.reservationPolicy,
|
|
1191
|
+
creditLineId: response.profile.creditLineId
|
|
1192
|
+
} : void 0,
|
|
1193
|
+
isDefault: response.isDefault
|
|
1194
|
+
};
|
|
1195
|
+
}
|
|
1196
|
+
static positionsResponseToPositions(response) {
|
|
1197
|
+
return response.state.map(ChainGrpcExchangeTransformerV2.grpcDerivativePositionToDerivativePosition);
|
|
1198
|
+
}
|
|
1199
|
+
static positionsInMarketResponseToPositions(response) {
|
|
1200
|
+
return { state: response.state.map(ChainGrpcExchangeTransformerV2.grpcDerivativePositionToDerivativePosition) };
|
|
1201
|
+
}
|
|
1202
|
+
static grpcDerivativePositionToDerivativePosition(position) {
|
|
1203
|
+
return {
|
|
1204
|
+
subaccountId: position.subaccountId,
|
|
1205
|
+
marketId: position.marketId,
|
|
1206
|
+
position: position.position ? {
|
|
1207
|
+
islong: position.position.isLong,
|
|
1208
|
+
quantity: position.position.quantity,
|
|
1209
|
+
entryPrice: position.position.entryPrice,
|
|
1210
|
+
margin: position.position.margin,
|
|
1211
|
+
cumulativeFundingEntry: position.position.cumulativeFundingEntry
|
|
1212
|
+
} : void 0
|
|
1213
|
+
};
|
|
1214
|
+
}
|
|
1215
|
+
static effectivePositionResponseToEffectivePosition(response) {
|
|
1216
|
+
return {
|
|
1217
|
+
state: response.state ? {
|
|
1218
|
+
isLong: response.state.isLong,
|
|
1219
|
+
quantity: response.state.quantity,
|
|
1220
|
+
entryPrice: response.state.entryPrice,
|
|
1221
|
+
effectiveMargin: response.state.effectiveMargin
|
|
1222
|
+
} : void 0,
|
|
1223
|
+
riskMode: response.riskMode
|
|
1224
|
+
};
|
|
1225
|
+
}
|
|
1226
|
+
static positionInMarketResponseToPositionInMarket(response) {
|
|
1227
|
+
return {
|
|
1228
|
+
state: response.state ? {
|
|
1229
|
+
islong: response.state.isLong,
|
|
1230
|
+
quantity: response.state.quantity,
|
|
1231
|
+
entryPrice: response.state.entryPrice,
|
|
1232
|
+
margin: response.state.margin,
|
|
1233
|
+
cumulativeFundingEntry: response.state.cumulativeFundingEntry
|
|
1234
|
+
} : void 0,
|
|
1235
|
+
riskMode: response.riskMode
|
|
1236
|
+
};
|
|
1237
|
+
}
|
|
1238
|
+
static perpetualMarketInfoResponseToPerpetualMarketInfo(response) {
|
|
1239
|
+
return { info: response.info ? {
|
|
1240
|
+
marketId: response.info.marketId,
|
|
1241
|
+
hourlyFundingRateCap: response.info.hourlyFundingRateCap,
|
|
1242
|
+
hourlyInterestRate: response.info.hourlyInterestRate,
|
|
1243
|
+
nextFundingTimestamp: Number(response.info.nextFundingTimestamp),
|
|
1244
|
+
fundingInterval: Number(response.info.fundingInterval)
|
|
1245
|
+
} : void 0 };
|
|
1246
|
+
}
|
|
1247
|
+
static expiryFuturesMarketInfoResponseToExpiryFuturesMarketInfo(response) {
|
|
1248
|
+
return { info: response.info ? {
|
|
1249
|
+
marketId: response.info.marketId,
|
|
1250
|
+
expirationTimestamp: Number(response.info.expirationTimestamp),
|
|
1251
|
+
twapStartTimestamp: Number(response.info.twapStartTimestamp),
|
|
1252
|
+
expirationTwapStartPriceCumulative: response.info.expirationTwapStartPriceCumulative,
|
|
1253
|
+
settlementPrice: response.info.settlementPrice,
|
|
1254
|
+
expirationTwapStartBaseCumulativePrice: response.info.expirationTwapStartBaseCumulativePrice,
|
|
1255
|
+
expirationTwapStartQuoteCumulativePrice: response.info.expirationTwapStartQuoteCumulativePrice
|
|
1256
|
+
} : void 0 };
|
|
1257
|
+
}
|
|
1258
|
+
static perpetualMarketFundingResponseToPerpetualMarketFunding(response) {
|
|
1259
|
+
return { state: response.state ? {
|
|
1260
|
+
cumulativeFunding: response.state.cumulativeFunding,
|
|
1261
|
+
cumulativePrice: response.state.cumulativePrice,
|
|
1262
|
+
lastTimestamp: Number(response.state.lastTimestamp)
|
|
1263
|
+
} : void 0 };
|
|
1264
|
+
}
|
|
1265
|
+
static feeDiscountTierStatisticsResponseToFeeDiscountTierStatistics(response) {
|
|
1266
|
+
return { statistics: response.statistics.map((statistic) => ({
|
|
1267
|
+
tier: Number(statistic.tier),
|
|
1268
|
+
count: Number(statistic.count)
|
|
1269
|
+
})) };
|
|
1270
|
+
}
|
|
1271
|
+
static historicalTradeRecordsResponseToHistoricalTradeRecords(response) {
|
|
1272
|
+
return { tradeRecords: response.tradeRecords.map((records) => ({
|
|
1273
|
+
marketId: records.marketId,
|
|
1274
|
+
latestTradeRecords: records.latestTradeRecords.map(ChainGrpcExchangeTransformerV2.grpcTradeRecordToTradeRecord)
|
|
1275
|
+
})) };
|
|
1276
|
+
}
|
|
1277
|
+
static grpcTradeRecordToTradeRecord(record) {
|
|
1278
|
+
return {
|
|
1279
|
+
timestamp: Number(record.timestamp),
|
|
1280
|
+
price: record.price,
|
|
1281
|
+
quantity: record.quantity
|
|
1282
|
+
};
|
|
1283
|
+
}
|
|
1284
|
+
static grantAuthorizationsResponseToGrantAuthorizations(response) {
|
|
1285
|
+
return {
|
|
1286
|
+
totalGrantAmount: response.totalGrantAmount,
|
|
1287
|
+
grants: response.grants.map((grant) => ({
|
|
1288
|
+
grantee: grant.grantee,
|
|
1289
|
+
amount: grant.amount
|
|
1290
|
+
}))
|
|
1291
|
+
};
|
|
1292
|
+
}
|
|
1293
|
+
static marketBalanceResponseToMarketBalance(response) {
|
|
1294
|
+
return { balance: response.balance ? {
|
|
1295
|
+
marketId: response.balance.marketId,
|
|
1296
|
+
balance: response.balance.balance
|
|
1297
|
+
} : void 0 };
|
|
1298
|
+
}
|
|
1299
|
+
static derivativeConditionalOrdersResponseToDerivativeConditionalOrders(response) {
|
|
1300
|
+
return { orders: response.orders.map((order) => ({
|
|
1301
|
+
price: order.price,
|
|
1302
|
+
quantity: order.quantity,
|
|
1303
|
+
margin: order.margin,
|
|
1304
|
+
triggerPrice: order.triggerPrice,
|
|
1305
|
+
isBuy: order.isBuy,
|
|
1306
|
+
isLimit: order.isLimit,
|
|
1307
|
+
orderHash: order.orderHash,
|
|
1308
|
+
cid: order.cid
|
|
1309
|
+
})) };
|
|
1310
|
+
}
|
|
1311
|
+
static subaccountOrderMetadataResponseToSubaccountOrderMetadata(response) {
|
|
1312
|
+
return { metadata: response.metadata.map((item) => ({
|
|
1313
|
+
marketId: item.marketId,
|
|
1314
|
+
isBuy: item.isBuy,
|
|
1315
|
+
metadata: item.metadata ? {
|
|
1316
|
+
vanillaLimitOrderCount: item.metadata.vanillaLimitOrderCount,
|
|
1317
|
+
reduceOnlyLimitOrderCount: item.metadata.reduceOnlyLimitOrderCount,
|
|
1318
|
+
aggregateReduceOnlyQuantity: item.metadata.aggregateReduceOnlyQuantity,
|
|
1319
|
+
aggregateVanillaQuantity: item.metadata.aggregateVanillaQuantity,
|
|
1320
|
+
vanillaConditionalOrderCount: item.metadata.vanillaConditionalOrderCount,
|
|
1321
|
+
reduceOnlyConditionalOrderCount: item.metadata.reduceOnlyConditionalOrderCount
|
|
1322
|
+
} : void 0
|
|
1323
|
+
})) };
|
|
1324
|
+
}
|
|
1325
|
+
static binaryOptionsMarketsResponseToBinaryOptionsMarkets(response) {
|
|
1326
|
+
return { markets: response.markets.map((market) => ({
|
|
1327
|
+
ticker: market.ticker,
|
|
1328
|
+
oracleSymbol: market.oracleSymbol,
|
|
1329
|
+
oracleProvider: market.oracleProvider,
|
|
1330
|
+
oracleType: market.oracleType,
|
|
1331
|
+
oracleScaleFactor: market.oracleScaleFactor,
|
|
1332
|
+
expirationTimestamp: Number(market.expirationTimestamp),
|
|
1333
|
+
settlementTimestamp: Number(market.settlementTimestamp),
|
|
1334
|
+
admin: market.admin,
|
|
1335
|
+
quoteDenom: market.quoteDenom,
|
|
1336
|
+
marketId: market.marketId,
|
|
1337
|
+
makerFeeRate: market.makerFeeRate,
|
|
1338
|
+
takerFeeRate: market.takerFeeRate,
|
|
1339
|
+
relayerFeeShareRate: market.relayerFeeShareRate,
|
|
1340
|
+
status: market.status,
|
|
1341
|
+
minPriceTickSize: market.minPriceTickSize,
|
|
1342
|
+
minQuantityTickSize: market.minQuantityTickSize,
|
|
1343
|
+
settlementPrice: market.settlementPrice,
|
|
1344
|
+
minNotional: market.minNotional,
|
|
1345
|
+
adminPermissions: market.adminPermissions,
|
|
1346
|
+
quoteDecimals: market.quoteDecimals,
|
|
1347
|
+
openNotionalCap: market.openNotionalCap && market.openNotionalCap.cap.oneofKind !== void 0 ? {
|
|
1348
|
+
type: market.openNotionalCap.cap.oneofKind === "capped" ? "capped" : "uncapped",
|
|
1349
|
+
value: market.openNotionalCap.cap.oneofKind === "capped" ? market.openNotionalCap.cap.capped.value : void 0
|
|
1350
|
+
} : void 0,
|
|
1351
|
+
hasDisabledMinimalProtocolFee: market.hasDisabledMinimalProtocolFee,
|
|
1352
|
+
forcePausedInfo: market.forcePausedInfo ? {
|
|
1353
|
+
reason: market.forcePausedInfo.reason,
|
|
1354
|
+
markPriceAtPausing: market.forcePausedInfo.markPriceAtPausing
|
|
1355
|
+
} : void 0
|
|
1356
|
+
})) };
|
|
1357
|
+
}
|
|
1358
|
+
static marketVolatilityResponseToMarketVolatility(response) {
|
|
1359
|
+
return {
|
|
1360
|
+
volatility: response.volatility,
|
|
1361
|
+
historyMetadata: response.historyMetadata ? {
|
|
1362
|
+
groupCount: response.historyMetadata.groupCount,
|
|
1363
|
+
recordsSampleSize: response.historyMetadata.recordsSampleSize,
|
|
1364
|
+
mean: response.historyMetadata.mean,
|
|
1365
|
+
twap: response.historyMetadata.twap,
|
|
1366
|
+
firstTimestamp: Number(response.historyMetadata.firstTimestamp),
|
|
1367
|
+
lastTimestamp: Number(response.historyMetadata.lastTimestamp),
|
|
1368
|
+
minPrice: response.historyMetadata.minPrice,
|
|
1369
|
+
maxPrice: response.historyMetadata.maxPrice,
|
|
1370
|
+
medianPrice: response.historyMetadata.medianPrice
|
|
1371
|
+
} : void 0,
|
|
1372
|
+
rawHistory: response.rawHistory.map(ChainGrpcExchangeTransformerV2.grpcTradeRecordToTradeRecord)
|
|
1373
|
+
};
|
|
1374
|
+
}
|
|
1375
|
+
};
|
|
1376
|
+
|
|
834
1377
|
//#endregion
|
|
835
1378
|
//#region src/client/chain/transformers/ChainGrpcPermissionsTransformer.ts
|
|
836
1379
|
/**
|
|
@@ -1804,6 +2347,424 @@ var ChainGrpcStakingApi = class extends BaseGrpcConsumer {
|
|
|
1804
2347
|
}
|
|
1805
2348
|
};
|
|
1806
2349
|
|
|
2350
|
+
//#endregion
|
|
2351
|
+
//#region src/client/chain/grpc/ChainGrpcExchangeApiV2.ts
|
|
2352
|
+
/**
|
|
2353
|
+
* @category Chain Grpc API
|
|
2354
|
+
*/
|
|
2355
|
+
var ChainGrpcExchangeApiV2 = class extends BaseGrpcConsumer {
|
|
2356
|
+
constructor(..._args) {
|
|
2357
|
+
super(..._args);
|
|
2358
|
+
_defineProperty(this, "module", ChainModule.Exchange);
|
|
2359
|
+
}
|
|
2360
|
+
get client() {
|
|
2361
|
+
return this.initClient(QueryClient$14);
|
|
2362
|
+
}
|
|
2363
|
+
async fetchModuleParams() {
|
|
2364
|
+
const request = InjectiveExchangeV2QueryPb.QueryExchangeParamsRequest.create();
|
|
2365
|
+
const response = await this.executeGrpcCall(request, this.client.queryExchangeParams.bind(this.client));
|
|
2366
|
+
return ChainGrpcExchangeTransformerV2.moduleParamsResponseToParams(response);
|
|
2367
|
+
}
|
|
2368
|
+
async fetchModuleState() {
|
|
2369
|
+
const request = InjectiveExchangeV2QueryPb.QueryModuleStateRequest.create();
|
|
2370
|
+
const response = await this.executeGrpcCall(request, this.client.exchangeModuleState.bind(this.client));
|
|
2371
|
+
return ChainGrpcExchangeTransformerV2.moduleStateResponseToModuleState(response);
|
|
2372
|
+
}
|
|
2373
|
+
async fetchFeeDiscountSchedule() {
|
|
2374
|
+
const request = InjectiveExchangeV2QueryPb.QueryFeeDiscountScheduleRequest.create();
|
|
2375
|
+
const response = await this.executeGrpcCall(request, this.client.feeDiscountSchedule.bind(this.client));
|
|
2376
|
+
return ChainGrpcExchangeTransformerV2.feeDiscountScheduleResponseToFeeDiscountSchedule(response);
|
|
2377
|
+
}
|
|
2378
|
+
async fetchFeeDiscountAccountInfo(injectiveAddress) {
|
|
2379
|
+
const request = InjectiveExchangeV2QueryPb.QueryFeeDiscountAccountInfoRequest.create();
|
|
2380
|
+
request.account = injectiveAddress;
|
|
2381
|
+
const response = await this.executeGrpcCall(request, this.client.feeDiscountAccountInfo.bind(this.client));
|
|
2382
|
+
return ChainGrpcExchangeTransformerV2.feeDiscountAccountInfoResponseToFeeDiscountAccountInfo(response);
|
|
2383
|
+
}
|
|
2384
|
+
async fetchTradingRewardsCampaign() {
|
|
2385
|
+
const request = InjectiveExchangeV2QueryPb.QueryTradeRewardCampaignRequest.create();
|
|
2386
|
+
const response = await this.executeGrpcCall(request, this.client.tradeRewardCampaign.bind(this.client));
|
|
2387
|
+
return ChainGrpcExchangeTransformerV2.tradingRewardsCampaignResponseToTradingRewardsCampaign(response);
|
|
2388
|
+
}
|
|
2389
|
+
async fetchTradeRewardPoints(injectiveAddresses) {
|
|
2390
|
+
const request = InjectiveExchangeV2QueryPb.QueryTradeRewardPointsRequest.create();
|
|
2391
|
+
request.accounts = injectiveAddresses;
|
|
2392
|
+
const response = await this.executeGrpcCall(request, this.client.tradeRewardPoints.bind(this.client));
|
|
2393
|
+
return ChainGrpcExchangeTransformerV2.tradeRewardPointsResponseToTradeRewardPoints(response);
|
|
2394
|
+
}
|
|
2395
|
+
async fetchPendingTradeRewardPoints(injectiveAddresses, timestamp) {
|
|
2396
|
+
const request = InjectiveExchangeV2QueryPb.QueryTradeRewardPointsRequest.create();
|
|
2397
|
+
request.accounts = injectiveAddresses;
|
|
2398
|
+
if (timestamp !== void 0) request.pendingPoolTimestamp = BigInt(timestamp);
|
|
2399
|
+
const response = await this.executeGrpcCall(request, this.client.pendingTradeRewardPoints.bind(this.client));
|
|
2400
|
+
return ChainGrpcExchangeTransformerV2.tradeRewardPointsResponseToTradeRewardPoints(response);
|
|
2401
|
+
}
|
|
2402
|
+
async fetchPositions() {
|
|
2403
|
+
const request = InjectiveExchangeV2QueryPb.QueryPositionsRequest.create();
|
|
2404
|
+
const response = await this.executeGrpcCall(request, this.client.positions.bind(this.client));
|
|
2405
|
+
return ChainGrpcExchangeTransformerV2.positionsResponseToPositions(response);
|
|
2406
|
+
}
|
|
2407
|
+
async fetchSubaccountTradeNonce(subaccountId) {
|
|
2408
|
+
const request = InjectiveExchangeV2QueryPb.QuerySubaccountTradeNonceRequest.create();
|
|
2409
|
+
request.subaccountId = subaccountId;
|
|
2410
|
+
return { nonce: (await this.executeGrpcCall(request, this.client.subaccountTradeNonce.bind(this.client))).nonce };
|
|
2411
|
+
}
|
|
2412
|
+
async fetchIsOptedOutOfRewards(account) {
|
|
2413
|
+
const request = InjectiveExchangeV2QueryPb.QueryIsOptedOutOfRewardsRequest.create();
|
|
2414
|
+
request.account = account;
|
|
2415
|
+
const response = await this.executeGrpcCall(request, this.client.isOptedOutOfRewards.bind(this.client));
|
|
2416
|
+
return ChainGrpcExchangeTransformerV2.isOptedOutOfRewardsResponseToIsOptedOutOfRewards(response);
|
|
2417
|
+
}
|
|
2418
|
+
async fetchActiveStakeGrant(account) {
|
|
2419
|
+
const request = InjectiveExchangeV2QueryPb.QueryActiveStakeGrantRequest.create();
|
|
2420
|
+
request.grantee = account;
|
|
2421
|
+
const response = await this.executeGrpcCall(request, this.client.activeStakeGrant.bind(this.client));
|
|
2422
|
+
return ChainGrpcExchangeTransformerV2.activeStakeGrantResponseToActiveStakeGrant(response);
|
|
2423
|
+
}
|
|
2424
|
+
async fetchDenomDecimal(denom) {
|
|
2425
|
+
const request = InjectiveExchangeV2QueryPb.QueryAuctionExchangeTransferDenomDecimalRequest.create();
|
|
2426
|
+
request.denom = denom;
|
|
2427
|
+
return { decimal: (await this.executeGrpcCall(request, this.client.auctionExchangeTransferDenomDecimal.bind(this.client))).decimal };
|
|
2428
|
+
}
|
|
2429
|
+
async fetchDenomDecimals() {
|
|
2430
|
+
const request = InjectiveExchangeV2QueryPb.QueryAuctionExchangeTransferDenomDecimalsRequest.create();
|
|
2431
|
+
const response = await this.executeGrpcCall(request, this.client.auctionExchangeTransferDenomDecimals.bind(this.client));
|
|
2432
|
+
return ChainGrpcExchangeTransformerV2.denomDecimalsResponseToDenomDecimals(response);
|
|
2433
|
+
}
|
|
2434
|
+
async fetchDenomMinNotional(denom) {
|
|
2435
|
+
const request = InjectiveExchangeV2QueryPb.QueryDenomMinNotionalRequest.create();
|
|
2436
|
+
request.denom = denom;
|
|
2437
|
+
return { amount: (await this.executeGrpcCall(request, this.client.denomMinNotional.bind(this.client))).amount };
|
|
2438
|
+
}
|
|
2439
|
+
async fetchDenomMinNotionals() {
|
|
2440
|
+
const request = InjectiveExchangeV2QueryPb.QueryDenomMinNotionalsRequest.create();
|
|
2441
|
+
const response = await this.executeGrpcCall(request, this.client.denomMinNotionals.bind(this.client));
|
|
2442
|
+
return ChainGrpcExchangeTransformerV2.denomMinNotionalsResponseToDenomMinNotionals(response);
|
|
2443
|
+
}
|
|
2444
|
+
async fetchOpenInterest(marketId) {
|
|
2445
|
+
const request = InjectiveExchangeV2QueryPb.QueryOpenInterestRequest.create();
|
|
2446
|
+
request.marketId = marketId;
|
|
2447
|
+
const response = await this.executeGrpcCall(request, this.client.openInterest.bind(this.client));
|
|
2448
|
+
return ChainGrpcExchangeTransformerV2.openInterestResponseToOpenInterest(response);
|
|
2449
|
+
}
|
|
2450
|
+
async fetchDerivativeMarkets(status, marketIds) {
|
|
2451
|
+
const request = InjectiveExchangeV2QueryPb.QueryDerivativeMarketsRequest.create();
|
|
2452
|
+
if (status) request.status = status;
|
|
2453
|
+
if (marketIds) request.marketIds = marketIds;
|
|
2454
|
+
const response = await this.executeGrpcCall(request, this.client.derivativeMarkets.bind(this.client));
|
|
2455
|
+
return ChainGrpcExchangeTransformerV2.derivativeMarketsResponseToDerivativeMarkets(response);
|
|
2456
|
+
}
|
|
2457
|
+
async fetchSpotMarkets(status, marketIds) {
|
|
2458
|
+
const request = InjectiveExchangeV2QueryPb.QuerySpotMarketsRequest.create();
|
|
2459
|
+
if (status) request.status = status;
|
|
2460
|
+
if (marketIds) request.marketIds = marketIds;
|
|
2461
|
+
const response = await this.executeGrpcCall(request, this.client.spotMarkets.bind(this.client));
|
|
2462
|
+
return ChainGrpcExchangeTransformerV2.spotMarketsResponseToSpotMarkets(response);
|
|
2463
|
+
}
|
|
2464
|
+
async fetchFullSpotMarkets(status, marketIds) {
|
|
2465
|
+
const request = InjectiveExchangeV2QueryPb.QueryFullSpotMarketsRequest.create();
|
|
2466
|
+
if (status) request.status = status;
|
|
2467
|
+
if (marketIds) request.marketIds = marketIds;
|
|
2468
|
+
const response = await this.executeGrpcCall(request, this.client.fullSpotMarkets.bind(this.client));
|
|
2469
|
+
return ChainGrpcExchangeTransformerV2.fullSpotMarketsResponseToSpotMarkets(response);
|
|
2470
|
+
}
|
|
2471
|
+
async fetchL3DerivativeOrderbook(marketId) {
|
|
2472
|
+
const request = InjectiveExchangeV2QueryPb.QueryFullDerivativeOrderbookRequest.create();
|
|
2473
|
+
request.marketId = marketId;
|
|
2474
|
+
const response = await this.executeGrpcCall(request, this.client.l3DerivativeOrderBook.bind(this.client));
|
|
2475
|
+
return ChainGrpcExchangeTransformerV2.l3OrderbookResponseToOrderbook(response);
|
|
2476
|
+
}
|
|
2477
|
+
async fetchL3SpotOrderbook(marketId) {
|
|
2478
|
+
const request = InjectiveExchangeV2QueryPb.QueryFullSpotOrderbookRequest.create();
|
|
2479
|
+
request.marketId = marketId;
|
|
2480
|
+
const response = await this.executeGrpcCall(request, this.client.l3SpotOrderBook.bind(this.client));
|
|
2481
|
+
return ChainGrpcExchangeTransformerV2.l3OrderbookResponseToOrderbook(response);
|
|
2482
|
+
}
|
|
2483
|
+
async fetchSubaccountDeposits(subaccountId) {
|
|
2484
|
+
const request = InjectiveExchangeV2QueryPb.QuerySubaccountDepositsRequest.create();
|
|
2485
|
+
request.subaccountId = subaccountId;
|
|
2486
|
+
const response = await this.executeGrpcCall(request, this.client.subaccountDeposits.bind(this.client));
|
|
2487
|
+
return ChainGrpcExchangeTransformerV2.subaccountDepositsResponseToSubaccountDeposits(response);
|
|
2488
|
+
}
|
|
2489
|
+
async fetchSubaccountDeposit({ subaccountId, denom }) {
|
|
2490
|
+
const request = InjectiveExchangeV2QueryPb.QuerySubaccountDepositRequest.create();
|
|
2491
|
+
request.subaccountId = subaccountId;
|
|
2492
|
+
request.denom = denom;
|
|
2493
|
+
const response = await this.executeGrpcCall(request, this.client.subaccountDeposit.bind(this.client));
|
|
2494
|
+
return ChainGrpcExchangeTransformerV2.subaccountDepositResponseToSubaccountDeposit(response);
|
|
2495
|
+
}
|
|
2496
|
+
async fetchAggregateVolume(account) {
|
|
2497
|
+
const request = InjectiveExchangeV2QueryPb.QueryAggregateVolumeRequest.create();
|
|
2498
|
+
request.account = account;
|
|
2499
|
+
const response = await this.executeGrpcCall(request, this.client.aggregateVolume.bind(this.client));
|
|
2500
|
+
return ChainGrpcExchangeTransformerV2.aggregateVolumeResponseToAggregateVolume(response);
|
|
2501
|
+
}
|
|
2502
|
+
async fetchAggregateVolumes({ accounts, marketIds }) {
|
|
2503
|
+
const request = InjectiveExchangeV2QueryPb.QueryAggregateVolumesRequest.create();
|
|
2504
|
+
request.accounts = accounts;
|
|
2505
|
+
request.marketIds = marketIds;
|
|
2506
|
+
const response = await this.executeGrpcCall(request, this.client.aggregateVolumes.bind(this.client));
|
|
2507
|
+
return ChainGrpcExchangeTransformerV2.aggregateVolumesResponseToAggregateVolumes(response);
|
|
2508
|
+
}
|
|
2509
|
+
async fetchAggregateMarketVolume(marketId) {
|
|
2510
|
+
const request = InjectiveExchangeV2QueryPb.QueryAggregateMarketVolumeRequest.create();
|
|
2511
|
+
request.marketId = marketId;
|
|
2512
|
+
const response = await this.executeGrpcCall(request, this.client.aggregateMarketVolume.bind(this.client));
|
|
2513
|
+
return ChainGrpcExchangeTransformerV2.aggregateMarketVolumeResponseToAggregateMarketVolume(response);
|
|
2514
|
+
}
|
|
2515
|
+
async fetchAggregateMarketVolumes(marketIds) {
|
|
2516
|
+
const request = InjectiveExchangeV2QueryPb.QueryAggregateMarketVolumesRequest.create();
|
|
2517
|
+
request.marketIds = marketIds;
|
|
2518
|
+
const response = await this.executeGrpcCall(request, this.client.aggregateMarketVolumes.bind(this.client));
|
|
2519
|
+
return ChainGrpcExchangeTransformerV2.aggregateMarketVolumesResponseToAggregateMarketVolumes(response);
|
|
2520
|
+
}
|
|
2521
|
+
async fetchSpotMarket(marketId) {
|
|
2522
|
+
const request = InjectiveExchangeV2QueryPb.QuerySpotMarketRequest.create();
|
|
2523
|
+
request.marketId = marketId;
|
|
2524
|
+
const response = await this.executeGrpcCall(request, this.client.spotMarket.bind(this.client));
|
|
2525
|
+
return response.market ? ChainGrpcExchangeTransformerV2.grpcSpotMarketToSpotMarket(response.market) : void 0;
|
|
2526
|
+
}
|
|
2527
|
+
async fetchFullSpotMarket(marketId) {
|
|
2528
|
+
const request = InjectiveExchangeV2QueryPb.QueryFullSpotMarketRequest.create();
|
|
2529
|
+
request.marketId = marketId;
|
|
2530
|
+
const response = await this.executeGrpcCall(request, this.client.fullSpotMarket.bind(this.client));
|
|
2531
|
+
return response.market ? ChainGrpcExchangeTransformerV2.grpcFullSpotMarketToSpotMarket(response.market) : void 0;
|
|
2532
|
+
}
|
|
2533
|
+
async fetchSpotOrderbook({ marketId, limit, orderSide, limitCumulativeNotional, limitCumulativeQuantity }) {
|
|
2534
|
+
const request = InjectiveExchangeV2QueryPb.QuerySpotOrderbookRequest.create();
|
|
2535
|
+
request.marketId = marketId;
|
|
2536
|
+
if (limit !== void 0) request.limit = BigInt(limit);
|
|
2537
|
+
if (orderSide !== void 0) request.orderSide = orderSide;
|
|
2538
|
+
if (limitCumulativeNotional) request.limitCumulativeNotional = limitCumulativeNotional;
|
|
2539
|
+
if (limitCumulativeQuantity) request.limitCumulativeQuantity = limitCumulativeQuantity;
|
|
2540
|
+
const response = await this.executeGrpcCall(request, this.client.spotOrderbook.bind(this.client));
|
|
2541
|
+
return ChainGrpcExchangeTransformerV2.orderbookResponseToOrderbook(response);
|
|
2542
|
+
}
|
|
2543
|
+
async fetchTraderSpotOrders({ marketId, subaccountId }) {
|
|
2544
|
+
const request = InjectiveExchangeV2QueryPb.QueryTraderSpotOrdersRequest.create();
|
|
2545
|
+
request.marketId = marketId;
|
|
2546
|
+
request.subaccountId = subaccountId;
|
|
2547
|
+
const response = await this.executeGrpcCall(request, this.client.traderSpotOrders.bind(this.client));
|
|
2548
|
+
return ChainGrpcExchangeTransformerV2.spotOrdersResponseToOrders(response);
|
|
2549
|
+
}
|
|
2550
|
+
async fetchAccountAddressSpotOrders({ marketId, accountAddress }) {
|
|
2551
|
+
const request = InjectiveExchangeV2QueryPb.QueryAccountAddressSpotOrdersRequest.create();
|
|
2552
|
+
request.marketId = marketId;
|
|
2553
|
+
request.accountAddress = accountAddress;
|
|
2554
|
+
const response = await this.executeGrpcCall(request, this.client.accountAddressSpotOrders.bind(this.client));
|
|
2555
|
+
return ChainGrpcExchangeTransformerV2.spotOrdersResponseToOrders(response);
|
|
2556
|
+
}
|
|
2557
|
+
async fetchSpotOrdersByHashes({ marketId, subaccountId, orderHashes }) {
|
|
2558
|
+
const request = InjectiveExchangeV2QueryPb.QuerySpotOrdersByHashesRequest.create();
|
|
2559
|
+
request.marketId = marketId;
|
|
2560
|
+
request.subaccountId = subaccountId;
|
|
2561
|
+
request.orderHashes = orderHashes;
|
|
2562
|
+
const response = await this.executeGrpcCall(request, this.client.spotOrdersByHashes.bind(this.client));
|
|
2563
|
+
return ChainGrpcExchangeTransformerV2.spotOrdersResponseToOrders(response);
|
|
2564
|
+
}
|
|
2565
|
+
async fetchSubaccountOrders({ subaccountId, marketId }) {
|
|
2566
|
+
const request = InjectiveExchangeV2QueryPb.QuerySubaccountOrdersRequest.create();
|
|
2567
|
+
request.subaccountId = subaccountId;
|
|
2568
|
+
request.marketId = marketId;
|
|
2569
|
+
const response = await this.executeGrpcCall(request, this.client.subaccountOrders.bind(this.client));
|
|
2570
|
+
return ChainGrpcExchangeTransformerV2.subaccountOrdersResponseToOrders(response);
|
|
2571
|
+
}
|
|
2572
|
+
async fetchTraderSpotTransientOrders({ marketId, subaccountId }) {
|
|
2573
|
+
const request = InjectiveExchangeV2QueryPb.QueryTraderSpotOrdersRequest.create();
|
|
2574
|
+
request.marketId = marketId;
|
|
2575
|
+
request.subaccountId = subaccountId;
|
|
2576
|
+
const response = await this.executeGrpcCall(request, this.client.traderSpotTransientOrders.bind(this.client));
|
|
2577
|
+
return ChainGrpcExchangeTransformerV2.spotOrdersResponseToOrders(response);
|
|
2578
|
+
}
|
|
2579
|
+
async fetchSpotMidPriceAndTOB(marketId) {
|
|
2580
|
+
const request = InjectiveExchangeV2QueryPb.QuerySpotMidPriceAndTOBRequest.create();
|
|
2581
|
+
request.marketId = marketId;
|
|
2582
|
+
const response = await this.executeGrpcCall(request, this.client.spotMidPriceAndTOB.bind(this.client));
|
|
2583
|
+
return ChainGrpcExchangeTransformerV2.midPriceAndTobResponseToMidPriceAndTob(response);
|
|
2584
|
+
}
|
|
2585
|
+
async fetchDerivativeMidPriceAndTOB(marketId) {
|
|
2586
|
+
const request = InjectiveExchangeV2QueryPb.QueryDerivativeMidPriceAndTOBRequest.create();
|
|
2587
|
+
request.marketId = marketId;
|
|
2588
|
+
const response = await this.executeGrpcCall(request, this.client.derivativeMidPriceAndTOB.bind(this.client));
|
|
2589
|
+
return ChainGrpcExchangeTransformerV2.midPriceAndTobResponseToMidPriceAndTob(response);
|
|
2590
|
+
}
|
|
2591
|
+
async fetchDerivativeOrderbook({ marketId, limit, limitCumulativeNotional }) {
|
|
2592
|
+
const request = InjectiveExchangeV2QueryPb.QueryDerivativeOrderbookRequest.create();
|
|
2593
|
+
request.marketId = marketId;
|
|
2594
|
+
if (limit !== void 0) request.limit = BigInt(limit);
|
|
2595
|
+
if (limitCumulativeNotional) request.limitCumulativeNotional = limitCumulativeNotional;
|
|
2596
|
+
const response = await this.executeGrpcCall(request, this.client.derivativeOrderbook.bind(this.client));
|
|
2597
|
+
return ChainGrpcExchangeTransformerV2.orderbookResponseToOrderbook(response);
|
|
2598
|
+
}
|
|
2599
|
+
async fetchTraderDerivativeOrders({ marketId, subaccountId }) {
|
|
2600
|
+
const request = InjectiveExchangeV2QueryPb.QueryTraderDerivativeOrdersRequest.create();
|
|
2601
|
+
request.marketId = marketId;
|
|
2602
|
+
request.subaccountId = subaccountId;
|
|
2603
|
+
const response = await this.executeGrpcCall(request, this.client.traderDerivativeOrders.bind(this.client));
|
|
2604
|
+
return ChainGrpcExchangeTransformerV2.derivativeOrdersResponseToOrders(response);
|
|
2605
|
+
}
|
|
2606
|
+
async fetchAccountAddressDerivativeOrders({ marketId, accountAddress }) {
|
|
2607
|
+
const request = InjectiveExchangeV2QueryPb.QueryAccountAddressDerivativeOrdersRequest.create();
|
|
2608
|
+
request.marketId = marketId;
|
|
2609
|
+
request.accountAddress = accountAddress;
|
|
2610
|
+
const response = await this.executeGrpcCall(request, this.client.accountAddressDerivativeOrders.bind(this.client));
|
|
2611
|
+
return ChainGrpcExchangeTransformerV2.derivativeOrdersResponseToOrders(response);
|
|
2612
|
+
}
|
|
2613
|
+
async fetchDerivativeOrdersByHashes({ marketId, subaccountId, orderHashes }) {
|
|
2614
|
+
const request = InjectiveExchangeV2QueryPb.QueryDerivativeOrdersByHashesRequest.create();
|
|
2615
|
+
request.marketId = marketId;
|
|
2616
|
+
request.subaccountId = subaccountId;
|
|
2617
|
+
request.orderHashes = orderHashes;
|
|
2618
|
+
const response = await this.executeGrpcCall(request, this.client.derivativeOrdersByHashes.bind(this.client));
|
|
2619
|
+
return ChainGrpcExchangeTransformerV2.derivativeOrdersResponseToOrders(response);
|
|
2620
|
+
}
|
|
2621
|
+
async fetchTraderDerivativeTransientOrders({ marketId, subaccountId }) {
|
|
2622
|
+
const request = InjectiveExchangeV2QueryPb.QueryTraderDerivativeOrdersRequest.create();
|
|
2623
|
+
request.marketId = marketId;
|
|
2624
|
+
request.subaccountId = subaccountId;
|
|
2625
|
+
const response = await this.executeGrpcCall(request, this.client.traderDerivativeTransientOrders.bind(this.client));
|
|
2626
|
+
return ChainGrpcExchangeTransformerV2.derivativeOrdersResponseToOrders(response);
|
|
2627
|
+
}
|
|
2628
|
+
async fetchDerivativeMarket(marketId) {
|
|
2629
|
+
const request = InjectiveExchangeV2QueryPb.QueryDerivativeMarketRequest.create();
|
|
2630
|
+
request.marketId = marketId;
|
|
2631
|
+
const response = await this.executeGrpcCall(request, this.client.derivativeMarket.bind(this.client));
|
|
2632
|
+
return response.market ? ChainGrpcExchangeTransformerV2.grpcFullDerivativeMarketToDerivativeMarket(response.market) : void 0;
|
|
2633
|
+
}
|
|
2634
|
+
async fetchDerivativeMarketAddress(marketId) {
|
|
2635
|
+
const request = InjectiveExchangeV2QueryPb.QueryDerivativeMarketAddressRequest.create();
|
|
2636
|
+
request.marketId = marketId;
|
|
2637
|
+
const response = await this.executeGrpcCall(request, this.client.derivativeMarketAddress.bind(this.client));
|
|
2638
|
+
return ChainGrpcExchangeTransformerV2.derivativeMarketAddressResponseToDerivativeMarketAddress(response);
|
|
2639
|
+
}
|
|
2640
|
+
async fetchSubaccountRiskProfile(subaccountId) {
|
|
2641
|
+
const request = InjectiveExchangeV2QueryPb.QuerySubaccountRiskProfileRequest.create();
|
|
2642
|
+
request.subaccountId = subaccountId;
|
|
2643
|
+
const response = await this.executeGrpcCall(request, this.client.subaccountRiskProfile.bind(this.client));
|
|
2644
|
+
return ChainGrpcExchangeTransformerV2.subaccountRiskProfileResponseToSubaccountRiskProfile(response);
|
|
2645
|
+
}
|
|
2646
|
+
async fetchCrossMarginPoolSnapshot({ subaccountId, quoteDenom }) {
|
|
2647
|
+
const request = InjectiveExchangeV2QueryPb.QueryCrossMarginPoolSnapshotRequest.create();
|
|
2648
|
+
request.subaccountId = subaccountId;
|
|
2649
|
+
request.quoteDenom = quoteDenom;
|
|
2650
|
+
const response = await this.executeGrpcCall(request, this.client.crossMarginPoolSnapshot.bind(this.client));
|
|
2651
|
+
return ChainGrpcExchangeTransformerV2.crossMarginPoolSnapshotResponseToCrossMarginPoolSnapshot(response);
|
|
2652
|
+
}
|
|
2653
|
+
async fetchPositionsInMarket(marketId) {
|
|
2654
|
+
const request = InjectiveExchangeV2QueryPb.QueryPositionsInMarketRequest.create();
|
|
2655
|
+
request.marketId = marketId;
|
|
2656
|
+
const response = await this.executeGrpcCall(request, this.client.positionsInMarket.bind(this.client));
|
|
2657
|
+
return ChainGrpcExchangeTransformerV2.positionsInMarketResponseToPositions(response);
|
|
2658
|
+
}
|
|
2659
|
+
async fetchSubaccountPositions(subaccountId) {
|
|
2660
|
+
const request = InjectiveExchangeV2QueryPb.QuerySubaccountPositionsRequest.create();
|
|
2661
|
+
request.subaccountId = subaccountId;
|
|
2662
|
+
const response = await this.executeGrpcCall(request, this.client.subaccountPositions.bind(this.client));
|
|
2663
|
+
return ChainGrpcExchangeTransformerV2.positionsInMarketResponseToPositions(response);
|
|
2664
|
+
}
|
|
2665
|
+
async fetchSubaccountPositionInMarket({ subaccountId, marketId }) {
|
|
2666
|
+
const request = InjectiveExchangeV2QueryPb.QuerySubaccountPositionInMarketRequest.create();
|
|
2667
|
+
request.subaccountId = subaccountId;
|
|
2668
|
+
request.marketId = marketId;
|
|
2669
|
+
const response = await this.executeGrpcCall(request, this.client.subaccountPositionInMarket.bind(this.client));
|
|
2670
|
+
return ChainGrpcExchangeTransformerV2.positionInMarketResponseToPositionInMarket(response);
|
|
2671
|
+
}
|
|
2672
|
+
async fetchSubaccountEffectivePositionInMarket({ subaccountId, marketId }) {
|
|
2673
|
+
const request = InjectiveExchangeV2QueryPb.QuerySubaccountEffectivePositionInMarketRequest.create();
|
|
2674
|
+
request.subaccountId = subaccountId;
|
|
2675
|
+
request.marketId = marketId;
|
|
2676
|
+
const response = await this.executeGrpcCall(request, this.client.subaccountEffectivePositionInMarket.bind(this.client));
|
|
2677
|
+
return ChainGrpcExchangeTransformerV2.effectivePositionResponseToEffectivePosition(response);
|
|
2678
|
+
}
|
|
2679
|
+
async fetchPerpetualMarketInfo(marketId) {
|
|
2680
|
+
const request = InjectiveExchangeV2QueryPb.QueryPerpetualMarketInfoRequest.create();
|
|
2681
|
+
request.marketId = marketId;
|
|
2682
|
+
const response = await this.executeGrpcCall(request, this.client.perpetualMarketInfo.bind(this.client));
|
|
2683
|
+
return ChainGrpcExchangeTransformerV2.perpetualMarketInfoResponseToPerpetualMarketInfo(response);
|
|
2684
|
+
}
|
|
2685
|
+
async fetchExpiryFuturesMarketInfo(marketId) {
|
|
2686
|
+
const request = InjectiveExchangeV2QueryPb.QueryExpiryFuturesMarketInfoRequest.create();
|
|
2687
|
+
request.marketId = marketId;
|
|
2688
|
+
const response = await this.executeGrpcCall(request, this.client.expiryFuturesMarketInfo.bind(this.client));
|
|
2689
|
+
return ChainGrpcExchangeTransformerV2.expiryFuturesMarketInfoResponseToExpiryFuturesMarketInfo(response);
|
|
2690
|
+
}
|
|
2691
|
+
async fetchPerpetualMarketFunding(marketId) {
|
|
2692
|
+
const request = InjectiveExchangeV2QueryPb.QueryPerpetualMarketFundingRequest.create();
|
|
2693
|
+
request.marketId = marketId;
|
|
2694
|
+
const response = await this.executeGrpcCall(request, this.client.perpetualMarketFunding.bind(this.client));
|
|
2695
|
+
return ChainGrpcExchangeTransformerV2.perpetualMarketFundingResponseToPerpetualMarketFunding(response);
|
|
2696
|
+
}
|
|
2697
|
+
async fetchSubaccountOrderMetadata(subaccountId) {
|
|
2698
|
+
const request = InjectiveExchangeV2QueryPb.QuerySubaccountOrderMetadataRequest.create();
|
|
2699
|
+
request.subaccountId = subaccountId;
|
|
2700
|
+
const response = await this.executeGrpcCall(request, this.client.subaccountOrderMetadata.bind(this.client));
|
|
2701
|
+
return ChainGrpcExchangeTransformerV2.subaccountOrderMetadataResponseToSubaccountOrderMetadata(response);
|
|
2702
|
+
}
|
|
2703
|
+
async fetchFeeDiscountTierStatistics() {
|
|
2704
|
+
const request = InjectiveExchangeV2QueryPb.QueryFeeDiscountTierStatisticsRequest.create();
|
|
2705
|
+
const response = await this.executeGrpcCall(request, this.client.feeDiscountTierStatistics.bind(this.client));
|
|
2706
|
+
return ChainGrpcExchangeTransformerV2.feeDiscountTierStatisticsResponseToFeeDiscountTierStatistics(response);
|
|
2707
|
+
}
|
|
2708
|
+
async fetchMarketIdFromVault(vaultAddress) {
|
|
2709
|
+
const request = InjectiveExchangeV2QueryPb.QueryMarketIDFromVaultRequest.create();
|
|
2710
|
+
request.vaultAddress = vaultAddress;
|
|
2711
|
+
return { marketId: (await this.executeGrpcCall(request, this.client.queryMarketIDFromVault.bind(this.client))).marketId };
|
|
2712
|
+
}
|
|
2713
|
+
async fetchHistoricalTradeRecords(marketId) {
|
|
2714
|
+
const request = InjectiveExchangeV2QueryPb.QueryHistoricalTradeRecordsRequest.create();
|
|
2715
|
+
request.marketId = marketId;
|
|
2716
|
+
const response = await this.executeGrpcCall(request, this.client.historicalTradeRecords.bind(this.client));
|
|
2717
|
+
return ChainGrpcExchangeTransformerV2.historicalTradeRecordsResponseToHistoricalTradeRecords(response);
|
|
2718
|
+
}
|
|
2719
|
+
async fetchOptedOutOfRewardsAccounts() {
|
|
2720
|
+
const request = InjectiveExchangeV2QueryPb.QueryOptedOutOfRewardsAccountsRequest.create();
|
|
2721
|
+
return { accounts: (await this.executeGrpcCall(request, this.client.optedOutOfRewardsAccounts.bind(this.client))).accounts };
|
|
2722
|
+
}
|
|
2723
|
+
async fetchMarketVolatility({ marketId, tradeHistoryOptions }) {
|
|
2724
|
+
const request = InjectiveExchangeV2QueryPb.QueryMarketVolatilityRequest.create();
|
|
2725
|
+
request.marketId = marketId;
|
|
2726
|
+
if (tradeHistoryOptions) request.tradeHistoryOptions = tradeHistoryOptions;
|
|
2727
|
+
const response = await this.executeGrpcCall(request, this.client.marketVolatility.bind(this.client));
|
|
2728
|
+
return ChainGrpcExchangeTransformerV2.marketVolatilityResponseToMarketVolatility(response);
|
|
2729
|
+
}
|
|
2730
|
+
async fetchBinaryOptionsMarkets(status) {
|
|
2731
|
+
const request = InjectiveExchangeV2QueryPb.QueryBinaryMarketsRequest.create();
|
|
2732
|
+
if (status) request.status = status;
|
|
2733
|
+
const response = await this.executeGrpcCall(request, this.client.binaryOptionsMarkets.bind(this.client));
|
|
2734
|
+
return ChainGrpcExchangeTransformerV2.binaryOptionsMarketsResponseToBinaryOptionsMarkets(response);
|
|
2735
|
+
}
|
|
2736
|
+
async fetchTraderDerivativeConditionalOrders({ subaccountId, marketId }) {
|
|
2737
|
+
const request = InjectiveExchangeV2QueryPb.QueryTraderDerivativeConditionalOrdersRequest.create();
|
|
2738
|
+
request.subaccountId = subaccountId;
|
|
2739
|
+
request.marketId = marketId;
|
|
2740
|
+
const response = await this.executeGrpcCall(request, this.client.traderDerivativeConditionalOrders.bind(this.client));
|
|
2741
|
+
return ChainGrpcExchangeTransformerV2.derivativeConditionalOrdersResponseToDerivativeConditionalOrders(response);
|
|
2742
|
+
}
|
|
2743
|
+
async fetchMarketAtomicExecutionFeeMultiplier(marketId) {
|
|
2744
|
+
const request = InjectiveExchangeV2QueryPb.QueryMarketAtomicExecutionFeeMultiplierRequest.create();
|
|
2745
|
+
request.marketId = marketId;
|
|
2746
|
+
return { multiplier: (await this.executeGrpcCall(request, this.client.marketAtomicExecutionFeeMultiplier.bind(this.client))).multiplier };
|
|
2747
|
+
}
|
|
2748
|
+
async fetchGrantAuthorization({ granter, grantee }) {
|
|
2749
|
+
const request = InjectiveExchangeV2QueryPb.QueryGrantAuthorizationRequest.create();
|
|
2750
|
+
request.granter = granter;
|
|
2751
|
+
request.grantee = grantee;
|
|
2752
|
+
return { amount: (await this.executeGrpcCall(request, this.client.grantAuthorization.bind(this.client))).amount };
|
|
2753
|
+
}
|
|
2754
|
+
async fetchGrantAuthorizations(granter) {
|
|
2755
|
+
const request = InjectiveExchangeV2QueryPb.QueryGrantAuthorizationsRequest.create();
|
|
2756
|
+
request.granter = granter;
|
|
2757
|
+
const response = await this.executeGrpcCall(request, this.client.grantAuthorizations.bind(this.client));
|
|
2758
|
+
return ChainGrpcExchangeTransformerV2.grantAuthorizationsResponseToGrantAuthorizations(response);
|
|
2759
|
+
}
|
|
2760
|
+
async fetchMarketBalance(marketId) {
|
|
2761
|
+
const request = InjectiveExchangeV2QueryPb.QueryMarketBalanceRequest.create();
|
|
2762
|
+
request.marketId = marketId;
|
|
2763
|
+
const response = await this.executeGrpcCall(request, this.client.marketBalance.bind(this.client));
|
|
2764
|
+
return ChainGrpcExchangeTransformerV2.marketBalanceResponseToMarketBalance(response);
|
|
2765
|
+
}
|
|
2766
|
+
};
|
|
2767
|
+
|
|
1807
2768
|
//#endregion
|
|
1808
2769
|
//#region src/client/chain/grpc/ChainGrpcPermissionsApi.ts
|
|
1809
2770
|
/**
|
|
@@ -1815,7 +2776,7 @@ var ChainGrpcPermissionsApi = class extends BaseGrpcConsumer {
|
|
|
1815
2776
|
_defineProperty(this, "module", ChainModule.Permissions);
|
|
1816
2777
|
}
|
|
1817
2778
|
get client() {
|
|
1818
|
-
return this.initClient(QueryClient$
|
|
2779
|
+
return this.initClient(QueryClient$15);
|
|
1819
2780
|
}
|
|
1820
2781
|
async fetchModuleParams() {
|
|
1821
2782
|
const request = InjectivePermissionsV1Beta1QueryPb.QueryParamsRequest.create();
|
|
@@ -1906,7 +2867,7 @@ var ChainGrpcDistributionApi = class extends BaseGrpcConsumer {
|
|
|
1906
2867
|
_defineProperty(this, "module", ChainModule.Distribution);
|
|
1907
2868
|
}
|
|
1908
2869
|
get client() {
|
|
1909
|
-
return this.initClient(QueryClient$
|
|
2870
|
+
return this.initClient(QueryClient$16);
|
|
1910
2871
|
}
|
|
1911
2872
|
async fetchModuleParams() {
|
|
1912
2873
|
const request = CosmosDistributionV1Beta1QueryPb.QueryParamsRequest.create();
|
|
@@ -1962,7 +2923,7 @@ var ChainGrpcTokenFactoryApi = class extends BaseGrpcConsumer {
|
|
|
1962
2923
|
_defineProperty(this, "module", ChainModule.WasmX);
|
|
1963
2924
|
}
|
|
1964
2925
|
get client() {
|
|
1965
|
-
return this.initClient(QueryClient$
|
|
2926
|
+
return this.initClient(QueryClient$17);
|
|
1966
2927
|
}
|
|
1967
2928
|
async fetchDenomsFromCreator(creator) {
|
|
1968
2929
|
const request = InjectiveTokenFactoryV1Beta1QueryPb.QueryDenomsFromCreatorRequest.create();
|
|
@@ -2000,7 +2961,7 @@ var ChainGrpcInsuranceFundApi = class extends BaseGrpcConsumer {
|
|
|
2000
2961
|
_defineProperty(this, "module", ChainModule.InsuranceFund);
|
|
2001
2962
|
}
|
|
2002
2963
|
get client() {
|
|
2003
|
-
return this.initClient(QueryClient$
|
|
2964
|
+
return this.initClient(QueryClient$18);
|
|
2004
2965
|
}
|
|
2005
2966
|
async fetchModuleParams() {
|
|
2006
2967
|
const request = InjectiveInsuranceV1Beta1QueryPb.QueryInsuranceParamsRequest.create();
|
|
@@ -2120,4 +3081,4 @@ var ChainRestWasmApi = class extends BaseRestConsumer {
|
|
|
2120
3081
|
};
|
|
2121
3082
|
|
|
2122
3083
|
//#endregion
|
|
2123
|
-
export {
|
|
3084
|
+
export { ChainGrpcErc20Transformer as A, ChainGrpcTokenFactoryTransformer as C, ChainGrpcStakingTransformer as D, ChainGrpcExchangeTransformerV2 as E, ChainGrpcBankTransformer as F, ChainGrpcEvmTransformer as I, ChainGrpcGovTransformer as L, ChainGrpcAuthZTransformer as M, ChainGrpcWasmTransformer as N, ChainGrpcAuctionTransformer as O, ChainGrpcMintTransformer as P, ChainGrpcInsuranceFundTransformer as S, ChainGrpcPermissionsTransformer as T, ChainGrpcMintApi as _, ChainGrpcDistributionApi as a, ChainGrpcIbcApi as b, ChainGrpcStakingApi as c, ChainGrpcOracleApi as d, ChainGrpcErc20Api as f, ChainGrpcWasmApi as g, ChainGrpcAuthZApi as h, ChainGrpcTokenFactoryApi as i, ChainGrpcPeggyTransformer as j, ChainGrpcTxFeesTransformer as k, ChainGrpcAuctionApi as l, ChainGrpcPeggyApi as m, ChainRestBankApi as n, ChainGrpcPermissionsApi as o, ChainGrpcWasmXApi as p, ChainGrpcInsuranceFundApi as r, ChainGrpcExchangeApiV2 as s, ChainRestWasmApi as t, ChainGrpcTxFeesApi as u, ChainGrpcBankApi as v, ChainGrpcDistributionTransformer as w, ChainGrpcGovApi as x, ChainGrpcEvmApi as y };
|