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