@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
|
@@ -2,6 +2,7 @@ const require_chunk = require('./chunk-CbDLau6x.cjs');
|
|
|
2
2
|
const require_encoding_light = require('./encoding-light-D96nxVLW.cjs');
|
|
3
3
|
const require_defineProperty = require('./defineProperty-C3FP2y9Y.cjs');
|
|
4
4
|
const require_utils = require('./utils-CH1Ojxun.cjs');
|
|
5
|
+
const require_address_light = require('./address-light-C_a6b8yF.cjs');
|
|
5
6
|
const require_ChainRestTendermintApi = require('./ChainRestTendermintApi-CN5JQXcO.cjs');
|
|
6
7
|
const require_BaseGrpcConsumer = require('./BaseGrpcConsumer-Ppsh5NLZ.cjs');
|
|
7
8
|
const require_BaseRestConsumer = require('./BaseRestConsumer-BcHgNcNh.cjs');
|
|
@@ -51,6 +52,9 @@ let __injectivelabs_core_proto_ts_v2_generated_injective_auction_v1beta1_query_p
|
|
|
51
52
|
let __injectivelabs_core_proto_ts_v2_generated_cosmos_staking_v1beta1_query_pb = require("@injectivelabs/core-proto-ts-v2/generated/cosmos/staking/v1beta1/query_pb");
|
|
52
53
|
__injectivelabs_core_proto_ts_v2_generated_cosmos_staking_v1beta1_query_pb = require_chunk.__toESM(__injectivelabs_core_proto_ts_v2_generated_cosmos_staking_v1beta1_query_pb);
|
|
53
54
|
let __injectivelabs_core_proto_ts_v2_generated_cosmos_staking_v1beta1_query_pb_client = require("@injectivelabs/core-proto-ts-v2/generated/cosmos/staking/v1beta1/query_pb.client");
|
|
55
|
+
let __injectivelabs_core_proto_ts_v2_generated_injective_exchange_v2_query_pb = require("@injectivelabs/core-proto-ts-v2/generated/injective/exchange/v2/query_pb");
|
|
56
|
+
__injectivelabs_core_proto_ts_v2_generated_injective_exchange_v2_query_pb = require_chunk.__toESM(__injectivelabs_core_proto_ts_v2_generated_injective_exchange_v2_query_pb);
|
|
57
|
+
let __injectivelabs_core_proto_ts_v2_generated_injective_exchange_v2_query_pb_client = require("@injectivelabs/core-proto-ts-v2/generated/injective/exchange/v2/query_pb.client");
|
|
54
58
|
let __injectivelabs_core_proto_ts_v2_generated_injective_permissions_v1beta1_query_pb = require("@injectivelabs/core-proto-ts-v2/generated/injective/permissions/v1beta1/query_pb");
|
|
55
59
|
__injectivelabs_core_proto_ts_v2_generated_injective_permissions_v1beta1_query_pb = require_chunk.__toESM(__injectivelabs_core_proto_ts_v2_generated_injective_permissions_v1beta1_query_pb);
|
|
56
60
|
let __injectivelabs_core_proto_ts_v2_generated_injective_permissions_v1beta1_query_pb_client = require("@injectivelabs/core-proto-ts-v2/generated/injective/permissions/v1beta1/query_pb.client");
|
|
@@ -851,6 +855,546 @@ var ChainGrpcStakingTransformer = class ChainGrpcStakingTransformer {
|
|
|
851
855
|
}
|
|
852
856
|
};
|
|
853
857
|
|
|
858
|
+
//#endregion
|
|
859
|
+
//#region src/client/chain/transformers/ChainGrpcExchangeTransformerV2.ts
|
|
860
|
+
/**
|
|
861
|
+
* @category Chain Grpc Transformer
|
|
862
|
+
*/
|
|
863
|
+
var ChainGrpcExchangeTransformerV2 = class ChainGrpcExchangeTransformerV2 {
|
|
864
|
+
static moduleStateResponseToModuleState(response) {
|
|
865
|
+
if (!response.state) throw new Error("Exchange module state not found in response");
|
|
866
|
+
return response.state;
|
|
867
|
+
}
|
|
868
|
+
static moduleParamsResponseToParams(response) {
|
|
869
|
+
const params = response.params;
|
|
870
|
+
return {
|
|
871
|
+
spotMarketInstantListingFee: params.spotMarketInstantListingFee,
|
|
872
|
+
derivativeMarketInstantListingFee: params.derivativeMarketInstantListingFee,
|
|
873
|
+
defaultSpotMakerFeeRate: params.defaultSpotMakerFeeRate,
|
|
874
|
+
defaultSpotTakerFeeRate: params.defaultSpotTakerFeeRate,
|
|
875
|
+
defaultDerivativeMakerFeeRate: params.defaultDerivativeMakerFeeRate,
|
|
876
|
+
defaultDerivativeTakerFeeRate: params.defaultDerivativeTakerFeeRate,
|
|
877
|
+
defaultInitialMarginRatio: params.defaultInitialMarginRatio,
|
|
878
|
+
defaultMaintenanceMarginRatio: params.defaultMaintenanceMarginRatio,
|
|
879
|
+
defaultFundingInterval: Number(params.defaultFundingInterval),
|
|
880
|
+
fundingMultiple: Number(params.fundingMultiple),
|
|
881
|
+
relayerFeeShareRate: params.relayerFeeShareRate,
|
|
882
|
+
defaultHourlyFundingRateCap: params.defaultHourlyFundingRateCap,
|
|
883
|
+
defaultHourlyInterestRate: params.defaultHourlyInterestRate,
|
|
884
|
+
maxDerivativeOrderSideCount: params.maxDerivativeOrderSideCount,
|
|
885
|
+
injRewardStakedRequirementThreshold: params.injRewardStakedRequirementThreshold,
|
|
886
|
+
tradingRewardsVestingDuration: Number(params.tradingRewardsVestingDuration),
|
|
887
|
+
liquidatorRewardShareRate: params.liquidatorRewardShareRate,
|
|
888
|
+
binaryOptionsMarketInstantListingFee: params.binaryOptionsMarketInstantListingFee,
|
|
889
|
+
atomicMarketOrderAccessLevel: params.atomicMarketOrderAccessLevel.toString(),
|
|
890
|
+
spotAtomicMarketOrderFeeMultiplier: params.spotAtomicMarketOrderFeeMultiplier,
|
|
891
|
+
derivativeAtomicMarketOrderFeeMultiplier: params.derivativeAtomicMarketOrderFeeMultiplier,
|
|
892
|
+
binaryOptionsAtomicMarketOrderFeeMultiplier: params.binaryOptionsAtomicMarketOrderFeeMultiplier,
|
|
893
|
+
minimalProtocolFeeRate: params.minimalProtocolFeeRate,
|
|
894
|
+
isInstantDerivativeMarketLaunchEnabled: params.isInstantDerivativeMarketLaunchEnabled,
|
|
895
|
+
postOnlyModeHeightThreshold: params.postOnlyModeHeightThreshold.toString(),
|
|
896
|
+
marginDecreasePriceTimestampThresholdSeconds: params.marginDecreasePriceTimestampThresholdSeconds.toString(),
|
|
897
|
+
exchangeAdmins: params.exchangeAdmins
|
|
898
|
+
};
|
|
899
|
+
}
|
|
900
|
+
static feeDiscountScheduleResponseToFeeDiscountSchedule(response) {
|
|
901
|
+
const schedule = response.feeDiscountSchedule;
|
|
902
|
+
return {
|
|
903
|
+
bucketCount: Number(schedule.bucketCount),
|
|
904
|
+
bucketDuration: Number(schedule.bucketDuration),
|
|
905
|
+
quoteDenomsList: schedule.quoteDenoms,
|
|
906
|
+
tierInfosList: schedule.tierInfos.map(ChainGrpcExchangeTransformerV2.grpcFeeDiscountTierInfoToFeeDiscountTierInfo).filter((info) => info !== void 0),
|
|
907
|
+
disqualifiedMarketIdsList: schedule.disqualifiedMarketIds
|
|
908
|
+
};
|
|
909
|
+
}
|
|
910
|
+
static feeDiscountAccountInfoResponseToFeeDiscountAccountInfo(response) {
|
|
911
|
+
return {
|
|
912
|
+
tierLevel: Number(response.tierLevel),
|
|
913
|
+
accountInfo: ChainGrpcExchangeTransformerV2.grpcFeeDiscountTierInfoToFeeDiscountTierInfo(response.accountInfo),
|
|
914
|
+
accountTtl: ChainGrpcExchangeTransformerV2.grpcFeeDiscountTierTTLToFeeDiscountTierTTL(response.accountTtl)
|
|
915
|
+
};
|
|
916
|
+
}
|
|
917
|
+
static grpcFeeDiscountTierInfoToFeeDiscountTierInfo(info) {
|
|
918
|
+
var _info$volume;
|
|
919
|
+
return info ? {
|
|
920
|
+
makerDiscountRate: info.makerDiscountRate,
|
|
921
|
+
takerDiscountRate: info.takerDiscountRate,
|
|
922
|
+
stakedAmount: info.stakedAmount,
|
|
923
|
+
volume: (_info$volume = info.volume) !== null && _info$volume !== void 0 ? _info$volume : "0"
|
|
924
|
+
} : void 0;
|
|
925
|
+
}
|
|
926
|
+
static grpcFeeDiscountTierTTLToFeeDiscountTierTTL(info) {
|
|
927
|
+
return info ? {
|
|
928
|
+
tier: Number(info.tier),
|
|
929
|
+
ttlTimestamp: Number(info.ttlTimestamp)
|
|
930
|
+
} : void 0;
|
|
931
|
+
}
|
|
932
|
+
static grpcPointsMultiplierToPointsMultiplier(point) {
|
|
933
|
+
return {
|
|
934
|
+
makerPointsMultiplier: point.makerPointsMultiplier,
|
|
935
|
+
takerPointsMultiplier: point.takerPointsMultiplier
|
|
936
|
+
};
|
|
937
|
+
}
|
|
938
|
+
static grpcTradingRewardCampaignBoostInfoToTradingRewardCampaignBoostInfo(info) {
|
|
939
|
+
return info ? {
|
|
940
|
+
boostedSpotMarketIdsList: info.boostedSpotMarketIds,
|
|
941
|
+
spotMarketMultipliersList: info.spotMarketMultipliers.map(ChainGrpcExchangeTransformerV2.grpcPointsMultiplierToPointsMultiplier),
|
|
942
|
+
boostedDerivativeMarketIdsList: info.boostedDerivativeMarketIds,
|
|
943
|
+
derivativeMarketMultipliersList: info.derivativeMarketMultipliers.map(ChainGrpcExchangeTransformerV2.grpcPointsMultiplierToPointsMultiplier)
|
|
944
|
+
} : void 0;
|
|
945
|
+
}
|
|
946
|
+
static grpcTradingRewardCampaignInfoToTradingRewardCampaignInfo(info) {
|
|
947
|
+
return info ? {
|
|
948
|
+
campaignDurationSeconds: Number(info.campaignDurationSeconds),
|
|
949
|
+
quoteDenomsList: info.quoteDenoms,
|
|
950
|
+
tradingRewardBoostInfo: ChainGrpcExchangeTransformerV2.grpcTradingRewardCampaignBoostInfoToTradingRewardCampaignBoostInfo(info.tradingRewardBoostInfo),
|
|
951
|
+
disqualifiedMarketIdsList: info.disqualifiedMarketIds
|
|
952
|
+
} : void 0;
|
|
953
|
+
}
|
|
954
|
+
static grpcCampaignRewardPoolToCampaignRewardPool(pool) {
|
|
955
|
+
return {
|
|
956
|
+
startTimestamp: Number(pool.startTimestamp),
|
|
957
|
+
maxCampaignRewardsList: pool.maxCampaignRewards.map((coin) => ({
|
|
958
|
+
amount: coin.amount,
|
|
959
|
+
denom: coin.denom
|
|
960
|
+
}))
|
|
961
|
+
};
|
|
962
|
+
}
|
|
963
|
+
static tradingRewardsCampaignResponseToTradingRewardsCampaign(response) {
|
|
964
|
+
return {
|
|
965
|
+
tradingRewardCampaignInfo: ChainGrpcExchangeTransformerV2.grpcTradingRewardCampaignInfoToTradingRewardCampaignInfo(response.tradingRewardCampaignInfo),
|
|
966
|
+
tradingRewardPoolCampaignScheduleList: response.tradingRewardPoolCampaignSchedule.map(ChainGrpcExchangeTransformerV2.grpcCampaignRewardPoolToCampaignRewardPool),
|
|
967
|
+
pendingTradingRewardPoolCampaignScheduleList: response.pendingTradingRewardPoolCampaignSchedule.map(ChainGrpcExchangeTransformerV2.grpcCampaignRewardPoolToCampaignRewardPool),
|
|
968
|
+
totalTradeRewardPoints: response.totalTradeRewardPoints,
|
|
969
|
+
pendingTotalTradeRewardPointsList: response.pendingTotalTradeRewardPoints
|
|
970
|
+
};
|
|
971
|
+
}
|
|
972
|
+
static isOptedOutOfRewardsResponseToIsOptedOutOfRewards(response) {
|
|
973
|
+
return { isOptedOut: response.isOptedOut };
|
|
974
|
+
}
|
|
975
|
+
static activeStakeGrantResponseToActiveStakeGrant(response) {
|
|
976
|
+
if (!response.grant || !response.effectiveGrant) throw new Error("Active stake grant not found in response");
|
|
977
|
+
return {
|
|
978
|
+
grant: response.grant,
|
|
979
|
+
effectiveGrant: response.effectiveGrant
|
|
980
|
+
};
|
|
981
|
+
}
|
|
982
|
+
static denomDecimalsResponseToDenomDecimals(response) {
|
|
983
|
+
return response.denomDecimals.map((item) => ({
|
|
984
|
+
denom: item.denom,
|
|
985
|
+
decimals: item.decimals.toString()
|
|
986
|
+
}));
|
|
987
|
+
}
|
|
988
|
+
static denomMinNotionalsResponseToDenomMinNotionals(response) {
|
|
989
|
+
return response.denomMinNotionals.map((item) => ({
|
|
990
|
+
denom: item.denom,
|
|
991
|
+
minNotional: item.minNotional
|
|
992
|
+
}));
|
|
993
|
+
}
|
|
994
|
+
static l3OrderbookResponseToOrderbook(response) {
|
|
995
|
+
return {
|
|
996
|
+
bids: response.bids.map((order) => ({
|
|
997
|
+
price: order.price,
|
|
998
|
+
quantity: order.quantity,
|
|
999
|
+
orderHash: order.orderHash,
|
|
1000
|
+
subaccountId: order.subaccountId
|
|
1001
|
+
})),
|
|
1002
|
+
asks: response.asks.map((order) => ({
|
|
1003
|
+
price: order.price,
|
|
1004
|
+
quantity: order.quantity,
|
|
1005
|
+
orderHash: order.orderHash,
|
|
1006
|
+
subaccountId: order.subaccountId
|
|
1007
|
+
})),
|
|
1008
|
+
sequence: Number(response.seq)
|
|
1009
|
+
};
|
|
1010
|
+
}
|
|
1011
|
+
static orderbookResponseToOrderbook(response) {
|
|
1012
|
+
return {
|
|
1013
|
+
buys: response.buysPriceLevel.map(ChainGrpcExchangeTransformerV2.grpcLevelToOrderbookLevel),
|
|
1014
|
+
sells: response.sellsPriceLevel.map(ChainGrpcExchangeTransformerV2.grpcLevelToOrderbookLevel),
|
|
1015
|
+
sequence: Number(response.seq)
|
|
1016
|
+
};
|
|
1017
|
+
}
|
|
1018
|
+
static grpcLevelToOrderbookLevel(level) {
|
|
1019
|
+
return {
|
|
1020
|
+
price: level.p,
|
|
1021
|
+
quantity: level.q
|
|
1022
|
+
};
|
|
1023
|
+
}
|
|
1024
|
+
static grpcTrimmedSpotLimitOrderToOrder(order) {
|
|
1025
|
+
return {
|
|
1026
|
+
price: order.price,
|
|
1027
|
+
quantity: order.quantity,
|
|
1028
|
+
fillable: order.fillable,
|
|
1029
|
+
isBuy: order.isBuy,
|
|
1030
|
+
orderHash: order.orderHash,
|
|
1031
|
+
cid: order.cid
|
|
1032
|
+
};
|
|
1033
|
+
}
|
|
1034
|
+
static grpcTrimmedDerivativeLimitOrderToOrder(order) {
|
|
1035
|
+
return {
|
|
1036
|
+
...ChainGrpcExchangeTransformerV2.grpcTrimmedSpotLimitOrderToOrder(order),
|
|
1037
|
+
margin: order.margin
|
|
1038
|
+
};
|
|
1039
|
+
}
|
|
1040
|
+
static spotOrdersResponseToOrders(response) {
|
|
1041
|
+
return { orders: response.orders.map(ChainGrpcExchangeTransformerV2.grpcTrimmedSpotLimitOrderToOrder) };
|
|
1042
|
+
}
|
|
1043
|
+
static derivativeOrdersResponseToOrders(response) {
|
|
1044
|
+
return { orders: response.orders.map(ChainGrpcExchangeTransformerV2.grpcTrimmedDerivativeLimitOrderToOrder) };
|
|
1045
|
+
}
|
|
1046
|
+
static grpcSubaccountOrderDataToOrderData(data) {
|
|
1047
|
+
return {
|
|
1048
|
+
order: data.order ? {
|
|
1049
|
+
price: data.order.price,
|
|
1050
|
+
quantity: data.order.quantity,
|
|
1051
|
+
isReduceOnly: data.order.isReduceOnly,
|
|
1052
|
+
cid: data.order.cid
|
|
1053
|
+
} : void 0,
|
|
1054
|
+
orderHash: require_address_light.bytesToHex(data.orderHash)
|
|
1055
|
+
};
|
|
1056
|
+
}
|
|
1057
|
+
static subaccountOrdersResponseToOrders(response) {
|
|
1058
|
+
return {
|
|
1059
|
+
buyOrders: response.buyOrders.map(ChainGrpcExchangeTransformerV2.grpcSubaccountOrderDataToOrderData),
|
|
1060
|
+
sellOrders: response.sellOrders.map(ChainGrpcExchangeTransformerV2.grpcSubaccountOrderDataToOrderData)
|
|
1061
|
+
};
|
|
1062
|
+
}
|
|
1063
|
+
static crossMarginPoolSnapshotResponseToCrossMarginPoolSnapshot(response) {
|
|
1064
|
+
return {
|
|
1065
|
+
quoteDenom: response.quoteDenom,
|
|
1066
|
+
quoteBalance: response.quoteBalance,
|
|
1067
|
+
positionMarginTotal: response.positionMarginTotal,
|
|
1068
|
+
unrealizedPnl: response.unrealizedPnl,
|
|
1069
|
+
unrealizedPnlEffective: response.unrealizedPnlEffective,
|
|
1070
|
+
equityAdmission: response.equityAdmission,
|
|
1071
|
+
equityLiquidation: response.equityLiquidation,
|
|
1072
|
+
initialMarginTotal: response.initialMarginTotal,
|
|
1073
|
+
maintenanceMarginTotal: response.maintenanceMarginTotal,
|
|
1074
|
+
initialMarginWithOrdersTotal: response.initialMarginWithOrdersTotal,
|
|
1075
|
+
entryLossTotal: response.entryLossTotal,
|
|
1076
|
+
feeReserveTotal: response.feeReserveTotal,
|
|
1077
|
+
orderLockRequirement: response.orderLockRequirement,
|
|
1078
|
+
positiveUpnlHaircutRate: response.positiveUpnlHaircutRate,
|
|
1079
|
+
healthFactor: response.healthFactor
|
|
1080
|
+
};
|
|
1081
|
+
}
|
|
1082
|
+
static tradeRewardPointsResponseToTradeRewardPoints(response) {
|
|
1083
|
+
return { accountTradeRewardPoints: response.accountTradeRewardPoints };
|
|
1084
|
+
}
|
|
1085
|
+
static openInterestResponseToOpenInterest(response) {
|
|
1086
|
+
return { amount: response.amount ? {
|
|
1087
|
+
marketId: response.amount.marketId,
|
|
1088
|
+
balance: response.amount.balance
|
|
1089
|
+
} : void 0 };
|
|
1090
|
+
}
|
|
1091
|
+
static subaccountDepositsResponseToSubaccountDeposits(response) {
|
|
1092
|
+
return { deposits: Object.fromEntries(Object.entries(response.deposits).map(([denom, deposit]) => [denom, {
|
|
1093
|
+
availableBalance: deposit.availableBalance,
|
|
1094
|
+
totalBalance: deposit.totalBalance
|
|
1095
|
+
}])) };
|
|
1096
|
+
}
|
|
1097
|
+
static subaccountDepositResponseToSubaccountDeposit(response) {
|
|
1098
|
+
return { deposits: response.deposits ? {
|
|
1099
|
+
availableBalance: response.deposits.availableBalance,
|
|
1100
|
+
totalBalance: response.deposits.totalBalance
|
|
1101
|
+
} : void 0 };
|
|
1102
|
+
}
|
|
1103
|
+
static aggregateVolumeResponseToAggregateVolume(response) {
|
|
1104
|
+
return { aggregateVolumes: response.aggregateVolumes.map(ChainGrpcExchangeTransformerV2.grpcMarketVolumeToMarketVolume) };
|
|
1105
|
+
}
|
|
1106
|
+
static aggregateVolumesResponseToAggregateVolumes(response) {
|
|
1107
|
+
return {
|
|
1108
|
+
aggregateAccountVolumes: response.aggregateAccountVolumes.map((record) => ({
|
|
1109
|
+
account: record.account,
|
|
1110
|
+
marketVolumes: record.marketVolumes.map(ChainGrpcExchangeTransformerV2.grpcMarketVolumeToMarketVolume)
|
|
1111
|
+
})),
|
|
1112
|
+
aggregateMarketVolumes: response.aggregateMarketVolumes.map(ChainGrpcExchangeTransformerV2.grpcMarketVolumeToMarketVolume)
|
|
1113
|
+
};
|
|
1114
|
+
}
|
|
1115
|
+
static aggregateMarketVolumeResponseToAggregateMarketVolume(response) {
|
|
1116
|
+
return { volume: response.volume ? {
|
|
1117
|
+
makerVolume: response.volume.makerVolume,
|
|
1118
|
+
takerVolume: response.volume.takerVolume
|
|
1119
|
+
} : void 0 };
|
|
1120
|
+
}
|
|
1121
|
+
static aggregateMarketVolumesResponseToAggregateMarketVolumes(response) {
|
|
1122
|
+
return { volumes: response.volumes.map(ChainGrpcExchangeTransformerV2.grpcMarketVolumeToMarketVolume) };
|
|
1123
|
+
}
|
|
1124
|
+
static midPriceAndTobResponseToMidPriceAndTob(response) {
|
|
1125
|
+
return {
|
|
1126
|
+
midPrice: response.midPrice,
|
|
1127
|
+
bestBuyPrice: response.bestBuyPrice,
|
|
1128
|
+
bestSellPrice: response.bestSellPrice
|
|
1129
|
+
};
|
|
1130
|
+
}
|
|
1131
|
+
static derivativeMarketAddressResponseToDerivativeMarketAddress(response) {
|
|
1132
|
+
return {
|
|
1133
|
+
address: response.address,
|
|
1134
|
+
subaccountId: response.subaccountId
|
|
1135
|
+
};
|
|
1136
|
+
}
|
|
1137
|
+
static grpcMarketVolumeToMarketVolume(marketVolume) {
|
|
1138
|
+
return {
|
|
1139
|
+
marketId: marketVolume.marketId,
|
|
1140
|
+
volume: marketVolume.volume ? {
|
|
1141
|
+
makerVolume: marketVolume.volume.makerVolume,
|
|
1142
|
+
takerVolume: marketVolume.volume.takerVolume
|
|
1143
|
+
} : void 0
|
|
1144
|
+
};
|
|
1145
|
+
}
|
|
1146
|
+
static spotMarketsResponseToSpotMarkets(response) {
|
|
1147
|
+
return response.markets.map(ChainGrpcExchangeTransformerV2.grpcSpotMarketToSpotMarket);
|
|
1148
|
+
}
|
|
1149
|
+
static grpcSpotMarketToSpotMarket(market) {
|
|
1150
|
+
return {
|
|
1151
|
+
marketId: market.marketId,
|
|
1152
|
+
marketStatus: market.status.toString(),
|
|
1153
|
+
ticker: market.ticker,
|
|
1154
|
+
baseDenom: market.baseDenom,
|
|
1155
|
+
quoteDenom: market.quoteDenom,
|
|
1156
|
+
makerFeeRate: market.makerFeeRate,
|
|
1157
|
+
quoteToken: void 0,
|
|
1158
|
+
baseToken: void 0,
|
|
1159
|
+
takerFeeRate: market.takerFeeRate,
|
|
1160
|
+
serviceProviderFee: "",
|
|
1161
|
+
minPriceTickSize: Number(market.minPriceTickSize),
|
|
1162
|
+
minQuantityTickSize: Number(market.minQuantityTickSize),
|
|
1163
|
+
minNotional: Number(market.minNotional)
|
|
1164
|
+
};
|
|
1165
|
+
}
|
|
1166
|
+
static fullSpotMarketsResponseToSpotMarkets(response) {
|
|
1167
|
+
return response.markets.map(ChainGrpcExchangeTransformerV2.grpcFullSpotMarketToSpotMarket);
|
|
1168
|
+
}
|
|
1169
|
+
static grpcFullSpotMarketToSpotMarket(market) {
|
|
1170
|
+
return ChainGrpcExchangeTransformerV2.grpcSpotMarketToSpotMarket(market.market);
|
|
1171
|
+
}
|
|
1172
|
+
static derivativeMarketsResponseToDerivativeMarkets(response) {
|
|
1173
|
+
return response.markets.map(ChainGrpcExchangeTransformerV2.grpcFullDerivativeMarketToDerivativeMarket);
|
|
1174
|
+
}
|
|
1175
|
+
static grpcFullDerivativeMarketToDerivativeMarket(market) {
|
|
1176
|
+
var _market$info, _perpetualMarketInfo$, _perpetualMarketInfo$2, _perpetualMarketInfo$3, _perpetualMarketInfo$4;
|
|
1177
|
+
const marketInfo = market.market;
|
|
1178
|
+
const perpetualMarketInfo = ((_market$info = market.info) === null || _market$info === void 0 ? void 0 : _market$info.oneofKind) === "perpetualInfo" ? market.info.perpetualInfo.marketInfo : void 0;
|
|
1179
|
+
return {
|
|
1180
|
+
oracleType: marketInfo.oracleType.toString(),
|
|
1181
|
+
marketId: marketInfo.marketId,
|
|
1182
|
+
marketStatus: marketInfo.status.toString(),
|
|
1183
|
+
ticker: marketInfo.ticker,
|
|
1184
|
+
quoteDenom: marketInfo.quoteDenom,
|
|
1185
|
+
makerFeeRate: marketInfo.makerFeeRate,
|
|
1186
|
+
takerFeeRate: marketInfo.takerFeeRate,
|
|
1187
|
+
serviceProviderFee: "",
|
|
1188
|
+
quoteToken: void 0,
|
|
1189
|
+
minPriceTickSize: Number(marketInfo.minPriceTickSize),
|
|
1190
|
+
minQuantityTickSize: Number(marketInfo.minQuantityTickSize),
|
|
1191
|
+
minNotional: Number(marketInfo.minNotional),
|
|
1192
|
+
reduceMarginRatio: marketInfo.reduceMarginRatio,
|
|
1193
|
+
initialMarginRatio: marketInfo.initialMarginRatio,
|
|
1194
|
+
maintenanceMarginRatio: marketInfo.maintenanceMarginRatio,
|
|
1195
|
+
isPerpetual: marketInfo.isPerpetual,
|
|
1196
|
+
oracleBase: marketInfo.oracleBase,
|
|
1197
|
+
oracleQuote: marketInfo.oracleQuote,
|
|
1198
|
+
oracleScaleFactor: marketInfo.oracleScaleFactor,
|
|
1199
|
+
perpetualMarketInfo: {
|
|
1200
|
+
hourlyFundingRateCap: (_perpetualMarketInfo$ = perpetualMarketInfo === null || perpetualMarketInfo === void 0 ? void 0 : perpetualMarketInfo.hourlyFundingRateCap) !== null && _perpetualMarketInfo$ !== void 0 ? _perpetualMarketInfo$ : "0",
|
|
1201
|
+
hourlyInterestRate: (_perpetualMarketInfo$2 = perpetualMarketInfo === null || perpetualMarketInfo === void 0 ? void 0 : perpetualMarketInfo.hourlyInterestRate) !== null && _perpetualMarketInfo$2 !== void 0 ? _perpetualMarketInfo$2 : "0",
|
|
1202
|
+
nextFundingTimestamp: Number((_perpetualMarketInfo$3 = perpetualMarketInfo === null || perpetualMarketInfo === void 0 ? void 0 : perpetualMarketInfo.nextFundingTimestamp) !== null && _perpetualMarketInfo$3 !== void 0 ? _perpetualMarketInfo$3 : 0),
|
|
1203
|
+
fundingInterval: Number((_perpetualMarketInfo$4 = perpetualMarketInfo === null || perpetualMarketInfo === void 0 ? void 0 : perpetualMarketInfo.fundingInterval) !== null && _perpetualMarketInfo$4 !== void 0 ? _perpetualMarketInfo$4 : 0)
|
|
1204
|
+
}
|
|
1205
|
+
};
|
|
1206
|
+
}
|
|
1207
|
+
static subaccountRiskProfileResponseToSubaccountRiskProfile(response) {
|
|
1208
|
+
return {
|
|
1209
|
+
profile: response.profile ? {
|
|
1210
|
+
mode: response.profile.mode,
|
|
1211
|
+
reservationPolicy: response.profile.reservationPolicy,
|
|
1212
|
+
creditLineId: response.profile.creditLineId
|
|
1213
|
+
} : void 0,
|
|
1214
|
+
isDefault: response.isDefault
|
|
1215
|
+
};
|
|
1216
|
+
}
|
|
1217
|
+
static positionsResponseToPositions(response) {
|
|
1218
|
+
return response.state.map(ChainGrpcExchangeTransformerV2.grpcDerivativePositionToDerivativePosition);
|
|
1219
|
+
}
|
|
1220
|
+
static positionsInMarketResponseToPositions(response) {
|
|
1221
|
+
return { state: response.state.map(ChainGrpcExchangeTransformerV2.grpcDerivativePositionToDerivativePosition) };
|
|
1222
|
+
}
|
|
1223
|
+
static grpcDerivativePositionToDerivativePosition(position) {
|
|
1224
|
+
return {
|
|
1225
|
+
subaccountId: position.subaccountId,
|
|
1226
|
+
marketId: position.marketId,
|
|
1227
|
+
position: position.position ? {
|
|
1228
|
+
islong: position.position.isLong,
|
|
1229
|
+
quantity: position.position.quantity,
|
|
1230
|
+
entryPrice: position.position.entryPrice,
|
|
1231
|
+
margin: position.position.margin,
|
|
1232
|
+
cumulativeFundingEntry: position.position.cumulativeFundingEntry
|
|
1233
|
+
} : void 0
|
|
1234
|
+
};
|
|
1235
|
+
}
|
|
1236
|
+
static effectivePositionResponseToEffectivePosition(response) {
|
|
1237
|
+
return {
|
|
1238
|
+
state: response.state ? {
|
|
1239
|
+
isLong: response.state.isLong,
|
|
1240
|
+
quantity: response.state.quantity,
|
|
1241
|
+
entryPrice: response.state.entryPrice,
|
|
1242
|
+
effectiveMargin: response.state.effectiveMargin
|
|
1243
|
+
} : void 0,
|
|
1244
|
+
riskMode: response.riskMode
|
|
1245
|
+
};
|
|
1246
|
+
}
|
|
1247
|
+
static positionInMarketResponseToPositionInMarket(response) {
|
|
1248
|
+
return {
|
|
1249
|
+
state: response.state ? {
|
|
1250
|
+
islong: response.state.isLong,
|
|
1251
|
+
quantity: response.state.quantity,
|
|
1252
|
+
entryPrice: response.state.entryPrice,
|
|
1253
|
+
margin: response.state.margin,
|
|
1254
|
+
cumulativeFundingEntry: response.state.cumulativeFundingEntry
|
|
1255
|
+
} : void 0,
|
|
1256
|
+
riskMode: response.riskMode
|
|
1257
|
+
};
|
|
1258
|
+
}
|
|
1259
|
+
static perpetualMarketInfoResponseToPerpetualMarketInfo(response) {
|
|
1260
|
+
return { info: response.info ? {
|
|
1261
|
+
marketId: response.info.marketId,
|
|
1262
|
+
hourlyFundingRateCap: response.info.hourlyFundingRateCap,
|
|
1263
|
+
hourlyInterestRate: response.info.hourlyInterestRate,
|
|
1264
|
+
nextFundingTimestamp: Number(response.info.nextFundingTimestamp),
|
|
1265
|
+
fundingInterval: Number(response.info.fundingInterval)
|
|
1266
|
+
} : void 0 };
|
|
1267
|
+
}
|
|
1268
|
+
static expiryFuturesMarketInfoResponseToExpiryFuturesMarketInfo(response) {
|
|
1269
|
+
return { info: response.info ? {
|
|
1270
|
+
marketId: response.info.marketId,
|
|
1271
|
+
expirationTimestamp: Number(response.info.expirationTimestamp),
|
|
1272
|
+
twapStartTimestamp: Number(response.info.twapStartTimestamp),
|
|
1273
|
+
expirationTwapStartPriceCumulative: response.info.expirationTwapStartPriceCumulative,
|
|
1274
|
+
settlementPrice: response.info.settlementPrice,
|
|
1275
|
+
expirationTwapStartBaseCumulativePrice: response.info.expirationTwapStartBaseCumulativePrice,
|
|
1276
|
+
expirationTwapStartQuoteCumulativePrice: response.info.expirationTwapStartQuoteCumulativePrice
|
|
1277
|
+
} : void 0 };
|
|
1278
|
+
}
|
|
1279
|
+
static perpetualMarketFundingResponseToPerpetualMarketFunding(response) {
|
|
1280
|
+
return { state: response.state ? {
|
|
1281
|
+
cumulativeFunding: response.state.cumulativeFunding,
|
|
1282
|
+
cumulativePrice: response.state.cumulativePrice,
|
|
1283
|
+
lastTimestamp: Number(response.state.lastTimestamp)
|
|
1284
|
+
} : void 0 };
|
|
1285
|
+
}
|
|
1286
|
+
static feeDiscountTierStatisticsResponseToFeeDiscountTierStatistics(response) {
|
|
1287
|
+
return { statistics: response.statistics.map((statistic) => ({
|
|
1288
|
+
tier: Number(statistic.tier),
|
|
1289
|
+
count: Number(statistic.count)
|
|
1290
|
+
})) };
|
|
1291
|
+
}
|
|
1292
|
+
static historicalTradeRecordsResponseToHistoricalTradeRecords(response) {
|
|
1293
|
+
return { tradeRecords: response.tradeRecords.map((records) => ({
|
|
1294
|
+
marketId: records.marketId,
|
|
1295
|
+
latestTradeRecords: records.latestTradeRecords.map(ChainGrpcExchangeTransformerV2.grpcTradeRecordToTradeRecord)
|
|
1296
|
+
})) };
|
|
1297
|
+
}
|
|
1298
|
+
static grpcTradeRecordToTradeRecord(record) {
|
|
1299
|
+
return {
|
|
1300
|
+
timestamp: Number(record.timestamp),
|
|
1301
|
+
price: record.price,
|
|
1302
|
+
quantity: record.quantity
|
|
1303
|
+
};
|
|
1304
|
+
}
|
|
1305
|
+
static grantAuthorizationsResponseToGrantAuthorizations(response) {
|
|
1306
|
+
return {
|
|
1307
|
+
totalGrantAmount: response.totalGrantAmount,
|
|
1308
|
+
grants: response.grants.map((grant) => ({
|
|
1309
|
+
grantee: grant.grantee,
|
|
1310
|
+
amount: grant.amount
|
|
1311
|
+
}))
|
|
1312
|
+
};
|
|
1313
|
+
}
|
|
1314
|
+
static marketBalanceResponseToMarketBalance(response) {
|
|
1315
|
+
return { balance: response.balance ? {
|
|
1316
|
+
marketId: response.balance.marketId,
|
|
1317
|
+
balance: response.balance.balance
|
|
1318
|
+
} : void 0 };
|
|
1319
|
+
}
|
|
1320
|
+
static derivativeConditionalOrdersResponseToDerivativeConditionalOrders(response) {
|
|
1321
|
+
return { orders: response.orders.map((order) => ({
|
|
1322
|
+
price: order.price,
|
|
1323
|
+
quantity: order.quantity,
|
|
1324
|
+
margin: order.margin,
|
|
1325
|
+
triggerPrice: order.triggerPrice,
|
|
1326
|
+
isBuy: order.isBuy,
|
|
1327
|
+
isLimit: order.isLimit,
|
|
1328
|
+
orderHash: order.orderHash,
|
|
1329
|
+
cid: order.cid
|
|
1330
|
+
})) };
|
|
1331
|
+
}
|
|
1332
|
+
static subaccountOrderMetadataResponseToSubaccountOrderMetadata(response) {
|
|
1333
|
+
return { metadata: response.metadata.map((item) => ({
|
|
1334
|
+
marketId: item.marketId,
|
|
1335
|
+
isBuy: item.isBuy,
|
|
1336
|
+
metadata: item.metadata ? {
|
|
1337
|
+
vanillaLimitOrderCount: item.metadata.vanillaLimitOrderCount,
|
|
1338
|
+
reduceOnlyLimitOrderCount: item.metadata.reduceOnlyLimitOrderCount,
|
|
1339
|
+
aggregateReduceOnlyQuantity: item.metadata.aggregateReduceOnlyQuantity,
|
|
1340
|
+
aggregateVanillaQuantity: item.metadata.aggregateVanillaQuantity,
|
|
1341
|
+
vanillaConditionalOrderCount: item.metadata.vanillaConditionalOrderCount,
|
|
1342
|
+
reduceOnlyConditionalOrderCount: item.metadata.reduceOnlyConditionalOrderCount
|
|
1343
|
+
} : void 0
|
|
1344
|
+
})) };
|
|
1345
|
+
}
|
|
1346
|
+
static binaryOptionsMarketsResponseToBinaryOptionsMarkets(response) {
|
|
1347
|
+
return { markets: response.markets.map((market) => ({
|
|
1348
|
+
ticker: market.ticker,
|
|
1349
|
+
oracleSymbol: market.oracleSymbol,
|
|
1350
|
+
oracleProvider: market.oracleProvider,
|
|
1351
|
+
oracleType: market.oracleType,
|
|
1352
|
+
oracleScaleFactor: market.oracleScaleFactor,
|
|
1353
|
+
expirationTimestamp: Number(market.expirationTimestamp),
|
|
1354
|
+
settlementTimestamp: Number(market.settlementTimestamp),
|
|
1355
|
+
admin: market.admin,
|
|
1356
|
+
quoteDenom: market.quoteDenom,
|
|
1357
|
+
marketId: market.marketId,
|
|
1358
|
+
makerFeeRate: market.makerFeeRate,
|
|
1359
|
+
takerFeeRate: market.takerFeeRate,
|
|
1360
|
+
relayerFeeShareRate: market.relayerFeeShareRate,
|
|
1361
|
+
status: market.status,
|
|
1362
|
+
minPriceTickSize: market.minPriceTickSize,
|
|
1363
|
+
minQuantityTickSize: market.minQuantityTickSize,
|
|
1364
|
+
settlementPrice: market.settlementPrice,
|
|
1365
|
+
minNotional: market.minNotional,
|
|
1366
|
+
adminPermissions: market.adminPermissions,
|
|
1367
|
+
quoteDecimals: market.quoteDecimals,
|
|
1368
|
+
openNotionalCap: market.openNotionalCap && market.openNotionalCap.cap.oneofKind !== void 0 ? {
|
|
1369
|
+
type: market.openNotionalCap.cap.oneofKind === "capped" ? "capped" : "uncapped",
|
|
1370
|
+
value: market.openNotionalCap.cap.oneofKind === "capped" ? market.openNotionalCap.cap.capped.value : void 0
|
|
1371
|
+
} : void 0,
|
|
1372
|
+
hasDisabledMinimalProtocolFee: market.hasDisabledMinimalProtocolFee,
|
|
1373
|
+
forcePausedInfo: market.forcePausedInfo ? {
|
|
1374
|
+
reason: market.forcePausedInfo.reason,
|
|
1375
|
+
markPriceAtPausing: market.forcePausedInfo.markPriceAtPausing
|
|
1376
|
+
} : void 0
|
|
1377
|
+
})) };
|
|
1378
|
+
}
|
|
1379
|
+
static marketVolatilityResponseToMarketVolatility(response) {
|
|
1380
|
+
return {
|
|
1381
|
+
volatility: response.volatility,
|
|
1382
|
+
historyMetadata: response.historyMetadata ? {
|
|
1383
|
+
groupCount: response.historyMetadata.groupCount,
|
|
1384
|
+
recordsSampleSize: response.historyMetadata.recordsSampleSize,
|
|
1385
|
+
mean: response.historyMetadata.mean,
|
|
1386
|
+
twap: response.historyMetadata.twap,
|
|
1387
|
+
firstTimestamp: Number(response.historyMetadata.firstTimestamp),
|
|
1388
|
+
lastTimestamp: Number(response.historyMetadata.lastTimestamp),
|
|
1389
|
+
minPrice: response.historyMetadata.minPrice,
|
|
1390
|
+
maxPrice: response.historyMetadata.maxPrice,
|
|
1391
|
+
medianPrice: response.historyMetadata.medianPrice
|
|
1392
|
+
} : void 0,
|
|
1393
|
+
rawHistory: response.rawHistory.map(ChainGrpcExchangeTransformerV2.grpcTradeRecordToTradeRecord)
|
|
1394
|
+
};
|
|
1395
|
+
}
|
|
1396
|
+
};
|
|
1397
|
+
|
|
854
1398
|
//#endregion
|
|
855
1399
|
//#region src/client/chain/transformers/ChainGrpcPermissionsTransformer.ts
|
|
856
1400
|
/**
|
|
@@ -1824,6 +2368,424 @@ var ChainGrpcStakingApi = class extends require_BaseGrpcConsumer.BaseGrpcConsume
|
|
|
1824
2368
|
}
|
|
1825
2369
|
};
|
|
1826
2370
|
|
|
2371
|
+
//#endregion
|
|
2372
|
+
//#region src/client/chain/grpc/ChainGrpcExchangeApiV2.ts
|
|
2373
|
+
/**
|
|
2374
|
+
* @category Chain Grpc API
|
|
2375
|
+
*/
|
|
2376
|
+
var ChainGrpcExchangeApiV2 = class extends require_BaseGrpcConsumer.BaseGrpcConsumer {
|
|
2377
|
+
constructor(..._args) {
|
|
2378
|
+
super(..._args);
|
|
2379
|
+
require_defineProperty._defineProperty(this, "module", require_ChainRestTendermintApi.ChainModule.Exchange);
|
|
2380
|
+
}
|
|
2381
|
+
get client() {
|
|
2382
|
+
return this.initClient(__injectivelabs_core_proto_ts_v2_generated_injective_exchange_v2_query_pb_client.QueryClient);
|
|
2383
|
+
}
|
|
2384
|
+
async fetchModuleParams() {
|
|
2385
|
+
const request = __injectivelabs_core_proto_ts_v2_generated_injective_exchange_v2_query_pb.QueryExchangeParamsRequest.create();
|
|
2386
|
+
const response = await this.executeGrpcCall(request, this.client.queryExchangeParams.bind(this.client));
|
|
2387
|
+
return ChainGrpcExchangeTransformerV2.moduleParamsResponseToParams(response);
|
|
2388
|
+
}
|
|
2389
|
+
async fetchModuleState() {
|
|
2390
|
+
const request = __injectivelabs_core_proto_ts_v2_generated_injective_exchange_v2_query_pb.QueryModuleStateRequest.create();
|
|
2391
|
+
const response = await this.executeGrpcCall(request, this.client.exchangeModuleState.bind(this.client));
|
|
2392
|
+
return ChainGrpcExchangeTransformerV2.moduleStateResponseToModuleState(response);
|
|
2393
|
+
}
|
|
2394
|
+
async fetchFeeDiscountSchedule() {
|
|
2395
|
+
const request = __injectivelabs_core_proto_ts_v2_generated_injective_exchange_v2_query_pb.QueryFeeDiscountScheduleRequest.create();
|
|
2396
|
+
const response = await this.executeGrpcCall(request, this.client.feeDiscountSchedule.bind(this.client));
|
|
2397
|
+
return ChainGrpcExchangeTransformerV2.feeDiscountScheduleResponseToFeeDiscountSchedule(response);
|
|
2398
|
+
}
|
|
2399
|
+
async fetchFeeDiscountAccountInfo(injectiveAddress) {
|
|
2400
|
+
const request = __injectivelabs_core_proto_ts_v2_generated_injective_exchange_v2_query_pb.QueryFeeDiscountAccountInfoRequest.create();
|
|
2401
|
+
request.account = injectiveAddress;
|
|
2402
|
+
const response = await this.executeGrpcCall(request, this.client.feeDiscountAccountInfo.bind(this.client));
|
|
2403
|
+
return ChainGrpcExchangeTransformerV2.feeDiscountAccountInfoResponseToFeeDiscountAccountInfo(response);
|
|
2404
|
+
}
|
|
2405
|
+
async fetchTradingRewardsCampaign() {
|
|
2406
|
+
const request = __injectivelabs_core_proto_ts_v2_generated_injective_exchange_v2_query_pb.QueryTradeRewardCampaignRequest.create();
|
|
2407
|
+
const response = await this.executeGrpcCall(request, this.client.tradeRewardCampaign.bind(this.client));
|
|
2408
|
+
return ChainGrpcExchangeTransformerV2.tradingRewardsCampaignResponseToTradingRewardsCampaign(response);
|
|
2409
|
+
}
|
|
2410
|
+
async fetchTradeRewardPoints(injectiveAddresses) {
|
|
2411
|
+
const request = __injectivelabs_core_proto_ts_v2_generated_injective_exchange_v2_query_pb.QueryTradeRewardPointsRequest.create();
|
|
2412
|
+
request.accounts = injectiveAddresses;
|
|
2413
|
+
const response = await this.executeGrpcCall(request, this.client.tradeRewardPoints.bind(this.client));
|
|
2414
|
+
return ChainGrpcExchangeTransformerV2.tradeRewardPointsResponseToTradeRewardPoints(response);
|
|
2415
|
+
}
|
|
2416
|
+
async fetchPendingTradeRewardPoints(injectiveAddresses, timestamp) {
|
|
2417
|
+
const request = __injectivelabs_core_proto_ts_v2_generated_injective_exchange_v2_query_pb.QueryTradeRewardPointsRequest.create();
|
|
2418
|
+
request.accounts = injectiveAddresses;
|
|
2419
|
+
if (timestamp !== void 0) request.pendingPoolTimestamp = BigInt(timestamp);
|
|
2420
|
+
const response = await this.executeGrpcCall(request, this.client.pendingTradeRewardPoints.bind(this.client));
|
|
2421
|
+
return ChainGrpcExchangeTransformerV2.tradeRewardPointsResponseToTradeRewardPoints(response);
|
|
2422
|
+
}
|
|
2423
|
+
async fetchPositions() {
|
|
2424
|
+
const request = __injectivelabs_core_proto_ts_v2_generated_injective_exchange_v2_query_pb.QueryPositionsRequest.create();
|
|
2425
|
+
const response = await this.executeGrpcCall(request, this.client.positions.bind(this.client));
|
|
2426
|
+
return ChainGrpcExchangeTransformerV2.positionsResponseToPositions(response);
|
|
2427
|
+
}
|
|
2428
|
+
async fetchSubaccountTradeNonce(subaccountId) {
|
|
2429
|
+
const request = __injectivelabs_core_proto_ts_v2_generated_injective_exchange_v2_query_pb.QuerySubaccountTradeNonceRequest.create();
|
|
2430
|
+
request.subaccountId = subaccountId;
|
|
2431
|
+
return { nonce: (await this.executeGrpcCall(request, this.client.subaccountTradeNonce.bind(this.client))).nonce };
|
|
2432
|
+
}
|
|
2433
|
+
async fetchIsOptedOutOfRewards(account) {
|
|
2434
|
+
const request = __injectivelabs_core_proto_ts_v2_generated_injective_exchange_v2_query_pb.QueryIsOptedOutOfRewardsRequest.create();
|
|
2435
|
+
request.account = account;
|
|
2436
|
+
const response = await this.executeGrpcCall(request, this.client.isOptedOutOfRewards.bind(this.client));
|
|
2437
|
+
return ChainGrpcExchangeTransformerV2.isOptedOutOfRewardsResponseToIsOptedOutOfRewards(response);
|
|
2438
|
+
}
|
|
2439
|
+
async fetchActiveStakeGrant(account) {
|
|
2440
|
+
const request = __injectivelabs_core_proto_ts_v2_generated_injective_exchange_v2_query_pb.QueryActiveStakeGrantRequest.create();
|
|
2441
|
+
request.grantee = account;
|
|
2442
|
+
const response = await this.executeGrpcCall(request, this.client.activeStakeGrant.bind(this.client));
|
|
2443
|
+
return ChainGrpcExchangeTransformerV2.activeStakeGrantResponseToActiveStakeGrant(response);
|
|
2444
|
+
}
|
|
2445
|
+
async fetchDenomDecimal(denom) {
|
|
2446
|
+
const request = __injectivelabs_core_proto_ts_v2_generated_injective_exchange_v2_query_pb.QueryAuctionExchangeTransferDenomDecimalRequest.create();
|
|
2447
|
+
request.denom = denom;
|
|
2448
|
+
return { decimal: (await this.executeGrpcCall(request, this.client.auctionExchangeTransferDenomDecimal.bind(this.client))).decimal };
|
|
2449
|
+
}
|
|
2450
|
+
async fetchDenomDecimals() {
|
|
2451
|
+
const request = __injectivelabs_core_proto_ts_v2_generated_injective_exchange_v2_query_pb.QueryAuctionExchangeTransferDenomDecimalsRequest.create();
|
|
2452
|
+
const response = await this.executeGrpcCall(request, this.client.auctionExchangeTransferDenomDecimals.bind(this.client));
|
|
2453
|
+
return ChainGrpcExchangeTransformerV2.denomDecimalsResponseToDenomDecimals(response);
|
|
2454
|
+
}
|
|
2455
|
+
async fetchDenomMinNotional(denom) {
|
|
2456
|
+
const request = __injectivelabs_core_proto_ts_v2_generated_injective_exchange_v2_query_pb.QueryDenomMinNotionalRequest.create();
|
|
2457
|
+
request.denom = denom;
|
|
2458
|
+
return { amount: (await this.executeGrpcCall(request, this.client.denomMinNotional.bind(this.client))).amount };
|
|
2459
|
+
}
|
|
2460
|
+
async fetchDenomMinNotionals() {
|
|
2461
|
+
const request = __injectivelabs_core_proto_ts_v2_generated_injective_exchange_v2_query_pb.QueryDenomMinNotionalsRequest.create();
|
|
2462
|
+
const response = await this.executeGrpcCall(request, this.client.denomMinNotionals.bind(this.client));
|
|
2463
|
+
return ChainGrpcExchangeTransformerV2.denomMinNotionalsResponseToDenomMinNotionals(response);
|
|
2464
|
+
}
|
|
2465
|
+
async fetchOpenInterest(marketId) {
|
|
2466
|
+
const request = __injectivelabs_core_proto_ts_v2_generated_injective_exchange_v2_query_pb.QueryOpenInterestRequest.create();
|
|
2467
|
+
request.marketId = marketId;
|
|
2468
|
+
const response = await this.executeGrpcCall(request, this.client.openInterest.bind(this.client));
|
|
2469
|
+
return ChainGrpcExchangeTransformerV2.openInterestResponseToOpenInterest(response);
|
|
2470
|
+
}
|
|
2471
|
+
async fetchDerivativeMarkets(status, marketIds) {
|
|
2472
|
+
const request = __injectivelabs_core_proto_ts_v2_generated_injective_exchange_v2_query_pb.QueryDerivativeMarketsRequest.create();
|
|
2473
|
+
if (status) request.status = status;
|
|
2474
|
+
if (marketIds) request.marketIds = marketIds;
|
|
2475
|
+
const response = await this.executeGrpcCall(request, this.client.derivativeMarkets.bind(this.client));
|
|
2476
|
+
return ChainGrpcExchangeTransformerV2.derivativeMarketsResponseToDerivativeMarkets(response);
|
|
2477
|
+
}
|
|
2478
|
+
async fetchSpotMarkets(status, marketIds) {
|
|
2479
|
+
const request = __injectivelabs_core_proto_ts_v2_generated_injective_exchange_v2_query_pb.QuerySpotMarketsRequest.create();
|
|
2480
|
+
if (status) request.status = status;
|
|
2481
|
+
if (marketIds) request.marketIds = marketIds;
|
|
2482
|
+
const response = await this.executeGrpcCall(request, this.client.spotMarkets.bind(this.client));
|
|
2483
|
+
return ChainGrpcExchangeTransformerV2.spotMarketsResponseToSpotMarkets(response);
|
|
2484
|
+
}
|
|
2485
|
+
async fetchFullSpotMarkets(status, marketIds) {
|
|
2486
|
+
const request = __injectivelabs_core_proto_ts_v2_generated_injective_exchange_v2_query_pb.QueryFullSpotMarketsRequest.create();
|
|
2487
|
+
if (status) request.status = status;
|
|
2488
|
+
if (marketIds) request.marketIds = marketIds;
|
|
2489
|
+
const response = await this.executeGrpcCall(request, this.client.fullSpotMarkets.bind(this.client));
|
|
2490
|
+
return ChainGrpcExchangeTransformerV2.fullSpotMarketsResponseToSpotMarkets(response);
|
|
2491
|
+
}
|
|
2492
|
+
async fetchL3DerivativeOrderbook(marketId) {
|
|
2493
|
+
const request = __injectivelabs_core_proto_ts_v2_generated_injective_exchange_v2_query_pb.QueryFullDerivativeOrderbookRequest.create();
|
|
2494
|
+
request.marketId = marketId;
|
|
2495
|
+
const response = await this.executeGrpcCall(request, this.client.l3DerivativeOrderBook.bind(this.client));
|
|
2496
|
+
return ChainGrpcExchangeTransformerV2.l3OrderbookResponseToOrderbook(response);
|
|
2497
|
+
}
|
|
2498
|
+
async fetchL3SpotOrderbook(marketId) {
|
|
2499
|
+
const request = __injectivelabs_core_proto_ts_v2_generated_injective_exchange_v2_query_pb.QueryFullSpotOrderbookRequest.create();
|
|
2500
|
+
request.marketId = marketId;
|
|
2501
|
+
const response = await this.executeGrpcCall(request, this.client.l3SpotOrderBook.bind(this.client));
|
|
2502
|
+
return ChainGrpcExchangeTransformerV2.l3OrderbookResponseToOrderbook(response);
|
|
2503
|
+
}
|
|
2504
|
+
async fetchSubaccountDeposits(subaccountId) {
|
|
2505
|
+
const request = __injectivelabs_core_proto_ts_v2_generated_injective_exchange_v2_query_pb.QuerySubaccountDepositsRequest.create();
|
|
2506
|
+
request.subaccountId = subaccountId;
|
|
2507
|
+
const response = await this.executeGrpcCall(request, this.client.subaccountDeposits.bind(this.client));
|
|
2508
|
+
return ChainGrpcExchangeTransformerV2.subaccountDepositsResponseToSubaccountDeposits(response);
|
|
2509
|
+
}
|
|
2510
|
+
async fetchSubaccountDeposit({ subaccountId, denom }) {
|
|
2511
|
+
const request = __injectivelabs_core_proto_ts_v2_generated_injective_exchange_v2_query_pb.QuerySubaccountDepositRequest.create();
|
|
2512
|
+
request.subaccountId = subaccountId;
|
|
2513
|
+
request.denom = denom;
|
|
2514
|
+
const response = await this.executeGrpcCall(request, this.client.subaccountDeposit.bind(this.client));
|
|
2515
|
+
return ChainGrpcExchangeTransformerV2.subaccountDepositResponseToSubaccountDeposit(response);
|
|
2516
|
+
}
|
|
2517
|
+
async fetchAggregateVolume(account) {
|
|
2518
|
+
const request = __injectivelabs_core_proto_ts_v2_generated_injective_exchange_v2_query_pb.QueryAggregateVolumeRequest.create();
|
|
2519
|
+
request.account = account;
|
|
2520
|
+
const response = await this.executeGrpcCall(request, this.client.aggregateVolume.bind(this.client));
|
|
2521
|
+
return ChainGrpcExchangeTransformerV2.aggregateVolumeResponseToAggregateVolume(response);
|
|
2522
|
+
}
|
|
2523
|
+
async fetchAggregateVolumes({ accounts, marketIds }) {
|
|
2524
|
+
const request = __injectivelabs_core_proto_ts_v2_generated_injective_exchange_v2_query_pb.QueryAggregateVolumesRequest.create();
|
|
2525
|
+
request.accounts = accounts;
|
|
2526
|
+
request.marketIds = marketIds;
|
|
2527
|
+
const response = await this.executeGrpcCall(request, this.client.aggregateVolumes.bind(this.client));
|
|
2528
|
+
return ChainGrpcExchangeTransformerV2.aggregateVolumesResponseToAggregateVolumes(response);
|
|
2529
|
+
}
|
|
2530
|
+
async fetchAggregateMarketVolume(marketId) {
|
|
2531
|
+
const request = __injectivelabs_core_proto_ts_v2_generated_injective_exchange_v2_query_pb.QueryAggregateMarketVolumeRequest.create();
|
|
2532
|
+
request.marketId = marketId;
|
|
2533
|
+
const response = await this.executeGrpcCall(request, this.client.aggregateMarketVolume.bind(this.client));
|
|
2534
|
+
return ChainGrpcExchangeTransformerV2.aggregateMarketVolumeResponseToAggregateMarketVolume(response);
|
|
2535
|
+
}
|
|
2536
|
+
async fetchAggregateMarketVolumes(marketIds) {
|
|
2537
|
+
const request = __injectivelabs_core_proto_ts_v2_generated_injective_exchange_v2_query_pb.QueryAggregateMarketVolumesRequest.create();
|
|
2538
|
+
request.marketIds = marketIds;
|
|
2539
|
+
const response = await this.executeGrpcCall(request, this.client.aggregateMarketVolumes.bind(this.client));
|
|
2540
|
+
return ChainGrpcExchangeTransformerV2.aggregateMarketVolumesResponseToAggregateMarketVolumes(response);
|
|
2541
|
+
}
|
|
2542
|
+
async fetchSpotMarket(marketId) {
|
|
2543
|
+
const request = __injectivelabs_core_proto_ts_v2_generated_injective_exchange_v2_query_pb.QuerySpotMarketRequest.create();
|
|
2544
|
+
request.marketId = marketId;
|
|
2545
|
+
const response = await this.executeGrpcCall(request, this.client.spotMarket.bind(this.client));
|
|
2546
|
+
return response.market ? ChainGrpcExchangeTransformerV2.grpcSpotMarketToSpotMarket(response.market) : void 0;
|
|
2547
|
+
}
|
|
2548
|
+
async fetchFullSpotMarket(marketId) {
|
|
2549
|
+
const request = __injectivelabs_core_proto_ts_v2_generated_injective_exchange_v2_query_pb.QueryFullSpotMarketRequest.create();
|
|
2550
|
+
request.marketId = marketId;
|
|
2551
|
+
const response = await this.executeGrpcCall(request, this.client.fullSpotMarket.bind(this.client));
|
|
2552
|
+
return response.market ? ChainGrpcExchangeTransformerV2.grpcFullSpotMarketToSpotMarket(response.market) : void 0;
|
|
2553
|
+
}
|
|
2554
|
+
async fetchSpotOrderbook({ marketId, limit, orderSide, limitCumulativeNotional, limitCumulativeQuantity }) {
|
|
2555
|
+
const request = __injectivelabs_core_proto_ts_v2_generated_injective_exchange_v2_query_pb.QuerySpotOrderbookRequest.create();
|
|
2556
|
+
request.marketId = marketId;
|
|
2557
|
+
if (limit !== void 0) request.limit = BigInt(limit);
|
|
2558
|
+
if (orderSide !== void 0) request.orderSide = orderSide;
|
|
2559
|
+
if (limitCumulativeNotional) request.limitCumulativeNotional = limitCumulativeNotional;
|
|
2560
|
+
if (limitCumulativeQuantity) request.limitCumulativeQuantity = limitCumulativeQuantity;
|
|
2561
|
+
const response = await this.executeGrpcCall(request, this.client.spotOrderbook.bind(this.client));
|
|
2562
|
+
return ChainGrpcExchangeTransformerV2.orderbookResponseToOrderbook(response);
|
|
2563
|
+
}
|
|
2564
|
+
async fetchTraderSpotOrders({ marketId, subaccountId }) {
|
|
2565
|
+
const request = __injectivelabs_core_proto_ts_v2_generated_injective_exchange_v2_query_pb.QueryTraderSpotOrdersRequest.create();
|
|
2566
|
+
request.marketId = marketId;
|
|
2567
|
+
request.subaccountId = subaccountId;
|
|
2568
|
+
const response = await this.executeGrpcCall(request, this.client.traderSpotOrders.bind(this.client));
|
|
2569
|
+
return ChainGrpcExchangeTransformerV2.spotOrdersResponseToOrders(response);
|
|
2570
|
+
}
|
|
2571
|
+
async fetchAccountAddressSpotOrders({ marketId, accountAddress }) {
|
|
2572
|
+
const request = __injectivelabs_core_proto_ts_v2_generated_injective_exchange_v2_query_pb.QueryAccountAddressSpotOrdersRequest.create();
|
|
2573
|
+
request.marketId = marketId;
|
|
2574
|
+
request.accountAddress = accountAddress;
|
|
2575
|
+
const response = await this.executeGrpcCall(request, this.client.accountAddressSpotOrders.bind(this.client));
|
|
2576
|
+
return ChainGrpcExchangeTransformerV2.spotOrdersResponseToOrders(response);
|
|
2577
|
+
}
|
|
2578
|
+
async fetchSpotOrdersByHashes({ marketId, subaccountId, orderHashes }) {
|
|
2579
|
+
const request = __injectivelabs_core_proto_ts_v2_generated_injective_exchange_v2_query_pb.QuerySpotOrdersByHashesRequest.create();
|
|
2580
|
+
request.marketId = marketId;
|
|
2581
|
+
request.subaccountId = subaccountId;
|
|
2582
|
+
request.orderHashes = orderHashes;
|
|
2583
|
+
const response = await this.executeGrpcCall(request, this.client.spotOrdersByHashes.bind(this.client));
|
|
2584
|
+
return ChainGrpcExchangeTransformerV2.spotOrdersResponseToOrders(response);
|
|
2585
|
+
}
|
|
2586
|
+
async fetchSubaccountOrders({ subaccountId, marketId }) {
|
|
2587
|
+
const request = __injectivelabs_core_proto_ts_v2_generated_injective_exchange_v2_query_pb.QuerySubaccountOrdersRequest.create();
|
|
2588
|
+
request.subaccountId = subaccountId;
|
|
2589
|
+
request.marketId = marketId;
|
|
2590
|
+
const response = await this.executeGrpcCall(request, this.client.subaccountOrders.bind(this.client));
|
|
2591
|
+
return ChainGrpcExchangeTransformerV2.subaccountOrdersResponseToOrders(response);
|
|
2592
|
+
}
|
|
2593
|
+
async fetchTraderSpotTransientOrders({ marketId, subaccountId }) {
|
|
2594
|
+
const request = __injectivelabs_core_proto_ts_v2_generated_injective_exchange_v2_query_pb.QueryTraderSpotOrdersRequest.create();
|
|
2595
|
+
request.marketId = marketId;
|
|
2596
|
+
request.subaccountId = subaccountId;
|
|
2597
|
+
const response = await this.executeGrpcCall(request, this.client.traderSpotTransientOrders.bind(this.client));
|
|
2598
|
+
return ChainGrpcExchangeTransformerV2.spotOrdersResponseToOrders(response);
|
|
2599
|
+
}
|
|
2600
|
+
async fetchSpotMidPriceAndTOB(marketId) {
|
|
2601
|
+
const request = __injectivelabs_core_proto_ts_v2_generated_injective_exchange_v2_query_pb.QuerySpotMidPriceAndTOBRequest.create();
|
|
2602
|
+
request.marketId = marketId;
|
|
2603
|
+
const response = await this.executeGrpcCall(request, this.client.spotMidPriceAndTOB.bind(this.client));
|
|
2604
|
+
return ChainGrpcExchangeTransformerV2.midPriceAndTobResponseToMidPriceAndTob(response);
|
|
2605
|
+
}
|
|
2606
|
+
async fetchDerivativeMidPriceAndTOB(marketId) {
|
|
2607
|
+
const request = __injectivelabs_core_proto_ts_v2_generated_injective_exchange_v2_query_pb.QueryDerivativeMidPriceAndTOBRequest.create();
|
|
2608
|
+
request.marketId = marketId;
|
|
2609
|
+
const response = await this.executeGrpcCall(request, this.client.derivativeMidPriceAndTOB.bind(this.client));
|
|
2610
|
+
return ChainGrpcExchangeTransformerV2.midPriceAndTobResponseToMidPriceAndTob(response);
|
|
2611
|
+
}
|
|
2612
|
+
async fetchDerivativeOrderbook({ marketId, limit, limitCumulativeNotional }) {
|
|
2613
|
+
const request = __injectivelabs_core_proto_ts_v2_generated_injective_exchange_v2_query_pb.QueryDerivativeOrderbookRequest.create();
|
|
2614
|
+
request.marketId = marketId;
|
|
2615
|
+
if (limit !== void 0) request.limit = BigInt(limit);
|
|
2616
|
+
if (limitCumulativeNotional) request.limitCumulativeNotional = limitCumulativeNotional;
|
|
2617
|
+
const response = await this.executeGrpcCall(request, this.client.derivativeOrderbook.bind(this.client));
|
|
2618
|
+
return ChainGrpcExchangeTransformerV2.orderbookResponseToOrderbook(response);
|
|
2619
|
+
}
|
|
2620
|
+
async fetchTraderDerivativeOrders({ marketId, subaccountId }) {
|
|
2621
|
+
const request = __injectivelabs_core_proto_ts_v2_generated_injective_exchange_v2_query_pb.QueryTraderDerivativeOrdersRequest.create();
|
|
2622
|
+
request.marketId = marketId;
|
|
2623
|
+
request.subaccountId = subaccountId;
|
|
2624
|
+
const response = await this.executeGrpcCall(request, this.client.traderDerivativeOrders.bind(this.client));
|
|
2625
|
+
return ChainGrpcExchangeTransformerV2.derivativeOrdersResponseToOrders(response);
|
|
2626
|
+
}
|
|
2627
|
+
async fetchAccountAddressDerivativeOrders({ marketId, accountAddress }) {
|
|
2628
|
+
const request = __injectivelabs_core_proto_ts_v2_generated_injective_exchange_v2_query_pb.QueryAccountAddressDerivativeOrdersRequest.create();
|
|
2629
|
+
request.marketId = marketId;
|
|
2630
|
+
request.accountAddress = accountAddress;
|
|
2631
|
+
const response = await this.executeGrpcCall(request, this.client.accountAddressDerivativeOrders.bind(this.client));
|
|
2632
|
+
return ChainGrpcExchangeTransformerV2.derivativeOrdersResponseToOrders(response);
|
|
2633
|
+
}
|
|
2634
|
+
async fetchDerivativeOrdersByHashes({ marketId, subaccountId, orderHashes }) {
|
|
2635
|
+
const request = __injectivelabs_core_proto_ts_v2_generated_injective_exchange_v2_query_pb.QueryDerivativeOrdersByHashesRequest.create();
|
|
2636
|
+
request.marketId = marketId;
|
|
2637
|
+
request.subaccountId = subaccountId;
|
|
2638
|
+
request.orderHashes = orderHashes;
|
|
2639
|
+
const response = await this.executeGrpcCall(request, this.client.derivativeOrdersByHashes.bind(this.client));
|
|
2640
|
+
return ChainGrpcExchangeTransformerV2.derivativeOrdersResponseToOrders(response);
|
|
2641
|
+
}
|
|
2642
|
+
async fetchTraderDerivativeTransientOrders({ marketId, subaccountId }) {
|
|
2643
|
+
const request = __injectivelabs_core_proto_ts_v2_generated_injective_exchange_v2_query_pb.QueryTraderDerivativeOrdersRequest.create();
|
|
2644
|
+
request.marketId = marketId;
|
|
2645
|
+
request.subaccountId = subaccountId;
|
|
2646
|
+
const response = await this.executeGrpcCall(request, this.client.traderDerivativeTransientOrders.bind(this.client));
|
|
2647
|
+
return ChainGrpcExchangeTransformerV2.derivativeOrdersResponseToOrders(response);
|
|
2648
|
+
}
|
|
2649
|
+
async fetchDerivativeMarket(marketId) {
|
|
2650
|
+
const request = __injectivelabs_core_proto_ts_v2_generated_injective_exchange_v2_query_pb.QueryDerivativeMarketRequest.create();
|
|
2651
|
+
request.marketId = marketId;
|
|
2652
|
+
const response = await this.executeGrpcCall(request, this.client.derivativeMarket.bind(this.client));
|
|
2653
|
+
return response.market ? ChainGrpcExchangeTransformerV2.grpcFullDerivativeMarketToDerivativeMarket(response.market) : void 0;
|
|
2654
|
+
}
|
|
2655
|
+
async fetchDerivativeMarketAddress(marketId) {
|
|
2656
|
+
const request = __injectivelabs_core_proto_ts_v2_generated_injective_exchange_v2_query_pb.QueryDerivativeMarketAddressRequest.create();
|
|
2657
|
+
request.marketId = marketId;
|
|
2658
|
+
const response = await this.executeGrpcCall(request, this.client.derivativeMarketAddress.bind(this.client));
|
|
2659
|
+
return ChainGrpcExchangeTransformerV2.derivativeMarketAddressResponseToDerivativeMarketAddress(response);
|
|
2660
|
+
}
|
|
2661
|
+
async fetchSubaccountRiskProfile(subaccountId) {
|
|
2662
|
+
const request = __injectivelabs_core_proto_ts_v2_generated_injective_exchange_v2_query_pb.QuerySubaccountRiskProfileRequest.create();
|
|
2663
|
+
request.subaccountId = subaccountId;
|
|
2664
|
+
const response = await this.executeGrpcCall(request, this.client.subaccountRiskProfile.bind(this.client));
|
|
2665
|
+
return ChainGrpcExchangeTransformerV2.subaccountRiskProfileResponseToSubaccountRiskProfile(response);
|
|
2666
|
+
}
|
|
2667
|
+
async fetchCrossMarginPoolSnapshot({ subaccountId, quoteDenom }) {
|
|
2668
|
+
const request = __injectivelabs_core_proto_ts_v2_generated_injective_exchange_v2_query_pb.QueryCrossMarginPoolSnapshotRequest.create();
|
|
2669
|
+
request.subaccountId = subaccountId;
|
|
2670
|
+
request.quoteDenom = quoteDenom;
|
|
2671
|
+
const response = await this.executeGrpcCall(request, this.client.crossMarginPoolSnapshot.bind(this.client));
|
|
2672
|
+
return ChainGrpcExchangeTransformerV2.crossMarginPoolSnapshotResponseToCrossMarginPoolSnapshot(response);
|
|
2673
|
+
}
|
|
2674
|
+
async fetchPositionsInMarket(marketId) {
|
|
2675
|
+
const request = __injectivelabs_core_proto_ts_v2_generated_injective_exchange_v2_query_pb.QueryPositionsInMarketRequest.create();
|
|
2676
|
+
request.marketId = marketId;
|
|
2677
|
+
const response = await this.executeGrpcCall(request, this.client.positionsInMarket.bind(this.client));
|
|
2678
|
+
return ChainGrpcExchangeTransformerV2.positionsInMarketResponseToPositions(response);
|
|
2679
|
+
}
|
|
2680
|
+
async fetchSubaccountPositions(subaccountId) {
|
|
2681
|
+
const request = __injectivelabs_core_proto_ts_v2_generated_injective_exchange_v2_query_pb.QuerySubaccountPositionsRequest.create();
|
|
2682
|
+
request.subaccountId = subaccountId;
|
|
2683
|
+
const response = await this.executeGrpcCall(request, this.client.subaccountPositions.bind(this.client));
|
|
2684
|
+
return ChainGrpcExchangeTransformerV2.positionsInMarketResponseToPositions(response);
|
|
2685
|
+
}
|
|
2686
|
+
async fetchSubaccountPositionInMarket({ subaccountId, marketId }) {
|
|
2687
|
+
const request = __injectivelabs_core_proto_ts_v2_generated_injective_exchange_v2_query_pb.QuerySubaccountPositionInMarketRequest.create();
|
|
2688
|
+
request.subaccountId = subaccountId;
|
|
2689
|
+
request.marketId = marketId;
|
|
2690
|
+
const response = await this.executeGrpcCall(request, this.client.subaccountPositionInMarket.bind(this.client));
|
|
2691
|
+
return ChainGrpcExchangeTransformerV2.positionInMarketResponseToPositionInMarket(response);
|
|
2692
|
+
}
|
|
2693
|
+
async fetchSubaccountEffectivePositionInMarket({ subaccountId, marketId }) {
|
|
2694
|
+
const request = __injectivelabs_core_proto_ts_v2_generated_injective_exchange_v2_query_pb.QuerySubaccountEffectivePositionInMarketRequest.create();
|
|
2695
|
+
request.subaccountId = subaccountId;
|
|
2696
|
+
request.marketId = marketId;
|
|
2697
|
+
const response = await this.executeGrpcCall(request, this.client.subaccountEffectivePositionInMarket.bind(this.client));
|
|
2698
|
+
return ChainGrpcExchangeTransformerV2.effectivePositionResponseToEffectivePosition(response);
|
|
2699
|
+
}
|
|
2700
|
+
async fetchPerpetualMarketInfo(marketId) {
|
|
2701
|
+
const request = __injectivelabs_core_proto_ts_v2_generated_injective_exchange_v2_query_pb.QueryPerpetualMarketInfoRequest.create();
|
|
2702
|
+
request.marketId = marketId;
|
|
2703
|
+
const response = await this.executeGrpcCall(request, this.client.perpetualMarketInfo.bind(this.client));
|
|
2704
|
+
return ChainGrpcExchangeTransformerV2.perpetualMarketInfoResponseToPerpetualMarketInfo(response);
|
|
2705
|
+
}
|
|
2706
|
+
async fetchExpiryFuturesMarketInfo(marketId) {
|
|
2707
|
+
const request = __injectivelabs_core_proto_ts_v2_generated_injective_exchange_v2_query_pb.QueryExpiryFuturesMarketInfoRequest.create();
|
|
2708
|
+
request.marketId = marketId;
|
|
2709
|
+
const response = await this.executeGrpcCall(request, this.client.expiryFuturesMarketInfo.bind(this.client));
|
|
2710
|
+
return ChainGrpcExchangeTransformerV2.expiryFuturesMarketInfoResponseToExpiryFuturesMarketInfo(response);
|
|
2711
|
+
}
|
|
2712
|
+
async fetchPerpetualMarketFunding(marketId) {
|
|
2713
|
+
const request = __injectivelabs_core_proto_ts_v2_generated_injective_exchange_v2_query_pb.QueryPerpetualMarketFundingRequest.create();
|
|
2714
|
+
request.marketId = marketId;
|
|
2715
|
+
const response = await this.executeGrpcCall(request, this.client.perpetualMarketFunding.bind(this.client));
|
|
2716
|
+
return ChainGrpcExchangeTransformerV2.perpetualMarketFundingResponseToPerpetualMarketFunding(response);
|
|
2717
|
+
}
|
|
2718
|
+
async fetchSubaccountOrderMetadata(subaccountId) {
|
|
2719
|
+
const request = __injectivelabs_core_proto_ts_v2_generated_injective_exchange_v2_query_pb.QuerySubaccountOrderMetadataRequest.create();
|
|
2720
|
+
request.subaccountId = subaccountId;
|
|
2721
|
+
const response = await this.executeGrpcCall(request, this.client.subaccountOrderMetadata.bind(this.client));
|
|
2722
|
+
return ChainGrpcExchangeTransformerV2.subaccountOrderMetadataResponseToSubaccountOrderMetadata(response);
|
|
2723
|
+
}
|
|
2724
|
+
async fetchFeeDiscountTierStatistics() {
|
|
2725
|
+
const request = __injectivelabs_core_proto_ts_v2_generated_injective_exchange_v2_query_pb.QueryFeeDiscountTierStatisticsRequest.create();
|
|
2726
|
+
const response = await this.executeGrpcCall(request, this.client.feeDiscountTierStatistics.bind(this.client));
|
|
2727
|
+
return ChainGrpcExchangeTransformerV2.feeDiscountTierStatisticsResponseToFeeDiscountTierStatistics(response);
|
|
2728
|
+
}
|
|
2729
|
+
async fetchMarketIdFromVault(vaultAddress) {
|
|
2730
|
+
const request = __injectivelabs_core_proto_ts_v2_generated_injective_exchange_v2_query_pb.QueryMarketIDFromVaultRequest.create();
|
|
2731
|
+
request.vaultAddress = vaultAddress;
|
|
2732
|
+
return { marketId: (await this.executeGrpcCall(request, this.client.queryMarketIDFromVault.bind(this.client))).marketId };
|
|
2733
|
+
}
|
|
2734
|
+
async fetchHistoricalTradeRecords(marketId) {
|
|
2735
|
+
const request = __injectivelabs_core_proto_ts_v2_generated_injective_exchange_v2_query_pb.QueryHistoricalTradeRecordsRequest.create();
|
|
2736
|
+
request.marketId = marketId;
|
|
2737
|
+
const response = await this.executeGrpcCall(request, this.client.historicalTradeRecords.bind(this.client));
|
|
2738
|
+
return ChainGrpcExchangeTransformerV2.historicalTradeRecordsResponseToHistoricalTradeRecords(response);
|
|
2739
|
+
}
|
|
2740
|
+
async fetchOptedOutOfRewardsAccounts() {
|
|
2741
|
+
const request = __injectivelabs_core_proto_ts_v2_generated_injective_exchange_v2_query_pb.QueryOptedOutOfRewardsAccountsRequest.create();
|
|
2742
|
+
return { accounts: (await this.executeGrpcCall(request, this.client.optedOutOfRewardsAccounts.bind(this.client))).accounts };
|
|
2743
|
+
}
|
|
2744
|
+
async fetchMarketVolatility({ marketId, tradeHistoryOptions }) {
|
|
2745
|
+
const request = __injectivelabs_core_proto_ts_v2_generated_injective_exchange_v2_query_pb.QueryMarketVolatilityRequest.create();
|
|
2746
|
+
request.marketId = marketId;
|
|
2747
|
+
if (tradeHistoryOptions) request.tradeHistoryOptions = tradeHistoryOptions;
|
|
2748
|
+
const response = await this.executeGrpcCall(request, this.client.marketVolatility.bind(this.client));
|
|
2749
|
+
return ChainGrpcExchangeTransformerV2.marketVolatilityResponseToMarketVolatility(response);
|
|
2750
|
+
}
|
|
2751
|
+
async fetchBinaryOptionsMarkets(status) {
|
|
2752
|
+
const request = __injectivelabs_core_proto_ts_v2_generated_injective_exchange_v2_query_pb.QueryBinaryMarketsRequest.create();
|
|
2753
|
+
if (status) request.status = status;
|
|
2754
|
+
const response = await this.executeGrpcCall(request, this.client.binaryOptionsMarkets.bind(this.client));
|
|
2755
|
+
return ChainGrpcExchangeTransformerV2.binaryOptionsMarketsResponseToBinaryOptionsMarkets(response);
|
|
2756
|
+
}
|
|
2757
|
+
async fetchTraderDerivativeConditionalOrders({ subaccountId, marketId }) {
|
|
2758
|
+
const request = __injectivelabs_core_proto_ts_v2_generated_injective_exchange_v2_query_pb.QueryTraderDerivativeConditionalOrdersRequest.create();
|
|
2759
|
+
request.subaccountId = subaccountId;
|
|
2760
|
+
request.marketId = marketId;
|
|
2761
|
+
const response = await this.executeGrpcCall(request, this.client.traderDerivativeConditionalOrders.bind(this.client));
|
|
2762
|
+
return ChainGrpcExchangeTransformerV2.derivativeConditionalOrdersResponseToDerivativeConditionalOrders(response);
|
|
2763
|
+
}
|
|
2764
|
+
async fetchMarketAtomicExecutionFeeMultiplier(marketId) {
|
|
2765
|
+
const request = __injectivelabs_core_proto_ts_v2_generated_injective_exchange_v2_query_pb.QueryMarketAtomicExecutionFeeMultiplierRequest.create();
|
|
2766
|
+
request.marketId = marketId;
|
|
2767
|
+
return { multiplier: (await this.executeGrpcCall(request, this.client.marketAtomicExecutionFeeMultiplier.bind(this.client))).multiplier };
|
|
2768
|
+
}
|
|
2769
|
+
async fetchGrantAuthorization({ granter, grantee }) {
|
|
2770
|
+
const request = __injectivelabs_core_proto_ts_v2_generated_injective_exchange_v2_query_pb.QueryGrantAuthorizationRequest.create();
|
|
2771
|
+
request.granter = granter;
|
|
2772
|
+
request.grantee = grantee;
|
|
2773
|
+
return { amount: (await this.executeGrpcCall(request, this.client.grantAuthorization.bind(this.client))).amount };
|
|
2774
|
+
}
|
|
2775
|
+
async fetchGrantAuthorizations(granter) {
|
|
2776
|
+
const request = __injectivelabs_core_proto_ts_v2_generated_injective_exchange_v2_query_pb.QueryGrantAuthorizationsRequest.create();
|
|
2777
|
+
request.granter = granter;
|
|
2778
|
+
const response = await this.executeGrpcCall(request, this.client.grantAuthorizations.bind(this.client));
|
|
2779
|
+
return ChainGrpcExchangeTransformerV2.grantAuthorizationsResponseToGrantAuthorizations(response);
|
|
2780
|
+
}
|
|
2781
|
+
async fetchMarketBalance(marketId) {
|
|
2782
|
+
const request = __injectivelabs_core_proto_ts_v2_generated_injective_exchange_v2_query_pb.QueryMarketBalanceRequest.create();
|
|
2783
|
+
request.marketId = marketId;
|
|
2784
|
+
const response = await this.executeGrpcCall(request, this.client.marketBalance.bind(this.client));
|
|
2785
|
+
return ChainGrpcExchangeTransformerV2.marketBalanceResponseToMarketBalance(response);
|
|
2786
|
+
}
|
|
2787
|
+
};
|
|
2788
|
+
|
|
1827
2789
|
//#endregion
|
|
1828
2790
|
//#region src/client/chain/grpc/ChainGrpcPermissionsApi.ts
|
|
1829
2791
|
/**
|
|
@@ -2212,6 +3174,18 @@ Object.defineProperty(exports, 'ChainGrpcEvmTransformer', {
|
|
|
2212
3174
|
return ChainGrpcEvmTransformer;
|
|
2213
3175
|
}
|
|
2214
3176
|
});
|
|
3177
|
+
Object.defineProperty(exports, 'ChainGrpcExchangeApiV2', {
|
|
3178
|
+
enumerable: true,
|
|
3179
|
+
get: function () {
|
|
3180
|
+
return ChainGrpcExchangeApiV2;
|
|
3181
|
+
}
|
|
3182
|
+
});
|
|
3183
|
+
Object.defineProperty(exports, 'ChainGrpcExchangeTransformerV2', {
|
|
3184
|
+
enumerable: true,
|
|
3185
|
+
get: function () {
|
|
3186
|
+
return ChainGrpcExchangeTransformerV2;
|
|
3187
|
+
}
|
|
3188
|
+
});
|
|
2215
3189
|
Object.defineProperty(exports, 'ChainGrpcGovApi', {
|
|
2216
3190
|
enumerable: true,
|
|
2217
3191
|
get: function () {
|