@injectivelabs/sdk-ts 1.17.2 → 1.17.3
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-DXSuhb6R.cjs → AbacusGrpcApi-BSFhRFgK.cjs} +6 -5
- package/dist/cjs/{BaseGrpcConsumer-EtEQfhmo.cjs → BaseGrpcConsumer-B_mvIpmK.cjs} +34 -5
- package/dist/cjs/BaseGrpcConsumer-DjBlHZXf.d.cts +96 -0
- package/dist/cjs/{BaseIndexerGrpcConsumer-CW1kTn-_.cjs → BaseIndexerGrpcConsumer-DRpriWCr.cjs} +1 -1
- package/dist/cjs/{ChainGrpcExchangeApi-CF9ATYqN.cjs → ChainGrpcExchangeApi-6SEFLrhR.cjs} +7 -6
- package/dist/cjs/{ChainRestTendermintApi-vL0g-BF-.cjs → ChainRestTendermintApi-B2934YcX.cjs} +11 -9
- package/dist/cjs/{IndexerGrpcWeb3GwApi-C7kkr4Il.cjs → IndexerGrpcWeb3GwApi-DzqoC5Jw.cjs} +8 -7
- package/dist/cjs/{MsgSetDenomMetadata-CKvxIq_t.cjs → MsgSetDenomMetadata-CJFO-LDN.cjs} +1 -1
- package/dist/cjs/{OLPGrpcApi-BCCb6fBZ.cjs → OLPGrpcApi-REqBM4Dt.cjs} +6 -5
- package/dist/cjs/{QueryTradingStrategyContractTotalStrategies-Ayot_18R.cjs → QueryTradingStrategyContractTotalStrategies-BWV29f7F.cjs} +3 -3
- package/dist/cjs/{StreamManagerV2-igv0mn2I.cjs → StreamManagerV2-bxmrwMoi.cjs} +78 -63
- package/dist/cjs/{chain-CGHrf7gg.cjs → chain-CtjB0xod.cjs} +92 -74
- package/dist/cjs/client/abacus.cjs +2 -2
- package/dist/cjs/client/abacus.d.cts +4 -2
- package/dist/cjs/client/chain.cjs +4 -4
- package/dist/cjs/client/chain.d.cts +8 -9
- package/dist/cjs/client/indexer.cjs +4 -4
- package/dist/cjs/client/indexer.d.cts +8 -9
- package/dist/cjs/client/olp.cjs +3 -3
- package/dist/cjs/client/olp.d.cts +4 -2
- package/dist/cjs/client/wasm.cjs +5 -5
- package/dist/cjs/client/wasm.d.cts +3 -2
- package/dist/cjs/core/accounts.d.cts +8 -9
- package/dist/cjs/core/modules.cjs +7 -7
- package/dist/cjs/core/modules.d.cts +8 -9
- package/dist/cjs/core/tx.cjs +5 -5
- package/dist/cjs/core/tx.d.cts +8 -9
- package/dist/cjs/cosmjs.cjs +5 -5
- package/dist/cjs/cosmjs.d.cts +2 -3
- package/dist/cjs/exports.cjs +5 -5
- package/dist/cjs/exports.d.cts +2 -3
- package/dist/cjs/{index-D6ubyMlR.d.cts → index-B-ODtCMF.d.cts} +7 -7
- package/dist/{esm/index-DOyiZiUK.d.ts → cjs/index-B3Hd6YoY.d.cts} +2 -3
- package/dist/{esm/index-BJQt8IpY.d.ts → cjs/index-BdSf-iSf.d.cts} +2 -3
- package/dist/cjs/{index-DjRtDAy5.d.cts → index-Bp-AQIP3.d.cts} +2925 -1124
- package/dist/{esm/index-Dn4OxoMy.d.ts → cjs/index-CSWj2FPd.d.cts} +4 -3
- package/dist/cjs/{index-DemZnO3c.d.cts → index-C_ioefRg.d.cts} +81 -175
- package/dist/{esm/index-C_3bL-y4.d.ts → cjs/index-k83cbNQj.d.cts} +1 -1
- package/dist/cjs/index.cjs +12 -12
- package/dist/cjs/index.d.cts +9 -10
- package/dist/cjs/service.d.cts +3 -4
- package/dist/cjs/{tx-VwbP3UdI.cjs → tx-BXn3eqwi.cjs} +8 -7
- package/dist/{esm/tx_pb-zz4o4hHG.d.ts → cjs/tx_pb-Wr-aZfKH.d.cts} +186 -6
- package/dist/cjs/types.d.cts +3 -4
- package/dist/cjs/utils.d.cts +8 -9
- package/dist/esm/{AbacusGrpcApi-Ce1hRKuD.js → AbacusGrpcApi-Ccjmvton.js} +6 -5
- package/dist/esm/BaseGrpcConsumer-CBQRoq72.d.ts +96 -0
- package/dist/esm/{BaseGrpcConsumer-BTWyD665.js → BaseGrpcConsumer-D3CPxlPN.js} +34 -5
- package/dist/esm/{BaseIndexerGrpcConsumer-BTZzA_Eg.js → BaseIndexerGrpcConsumer-DQUmeane.js} +1 -1
- package/dist/esm/{ChainGrpcExchangeApi-DqdCst2Z.js → ChainGrpcExchangeApi-DQvLWB5R.js} +7 -6
- package/dist/esm/{ChainRestTendermintApi-BT_yOkAV.js → ChainRestTendermintApi-DUK7FvxW.js} +11 -9
- package/dist/esm/{IndexerGrpcWeb3GwApi-B2mgt9tE.js → IndexerGrpcWeb3GwApi-yHniiZ22.js} +8 -7
- package/dist/esm/{MsgSetDenomMetadata-CXgkQ3LF.js → MsgSetDenomMetadata-BNYIha2C.js} +1 -1
- package/dist/esm/{OLPGrpcApi-DUCfcca_.js → OLPGrpcApi-8NQqfKhT.js} +6 -5
- package/dist/esm/{QueryTradingStrategyContractTotalStrategies-CZWdw3BE.js → QueryTradingStrategyContractTotalStrategies-D_4tvQEy.js} +3 -3
- package/dist/esm/{StreamManagerV2-B9xiJYLj.js → StreamManagerV2-BGjxaWMK.js} +78 -63
- package/dist/esm/{chain-CHX5uSpc.js → chain-DKislBAW.js} +92 -74
- package/dist/esm/client/abacus.d.ts +4 -2
- package/dist/esm/client/abacus.js +2 -2
- package/dist/esm/client/chain.d.ts +8 -9
- package/dist/esm/client/chain.js +4 -4
- package/dist/esm/client/indexer.d.ts +8 -9
- package/dist/esm/client/indexer.js +4 -4
- package/dist/esm/client/olp.d.ts +4 -2
- package/dist/esm/client/olp.js +3 -3
- package/dist/esm/client/wasm.d.ts +3 -2
- package/dist/esm/client/wasm.js +5 -5
- package/dist/esm/core/accounts.d.ts +8 -9
- package/dist/esm/core/modules.d.ts +8 -9
- package/dist/esm/core/modules.js +7 -7
- package/dist/esm/core/tx.d.ts +8 -9
- package/dist/esm/core/tx.js +5 -5
- package/dist/esm/cosmjs.d.ts +2 -3
- package/dist/esm/cosmjs.js +5 -5
- package/dist/esm/exports.d.ts +2 -3
- package/dist/esm/exports.js +5 -5
- package/dist/esm/{index-B-SD0p02.d.ts → index-BVWIwmli.d.ts} +2925 -1124
- package/dist/{cjs/index-CO3Y9drx.d.cts → esm/index-BhVscuMR.d.ts} +2 -3
- package/dist/{cjs/index-lRWP4rKg.d.cts → esm/index-BhybypN9.d.ts} +2 -3
- package/dist/esm/{index-Ch477yfL.d.ts → index-Bn3JkjMQ.d.ts} +80 -174
- package/dist/esm/{index--sg5xbEP.d.ts → index-BqYLsIZe.d.ts} +1 -1
- package/dist/{cjs/index-DWbxb1AB.d.cts → esm/index-Dh15HnVF.d.ts} +4 -3
- package/dist/{cjs/index-CGvISJoE.d.cts → esm/index-DpjBqbbT.d.ts} +1 -1
- package/dist/esm/index.d.ts +9 -10
- package/dist/esm/index.js +12 -12
- package/dist/esm/service.d.ts +3 -4
- package/dist/esm/{tx-DsGG15fH.js → tx-D0NTtgOO.js} +8 -7
- package/dist/{cjs/tx_pb-D-cNmrlO.d.cts → esm/tx_pb-DiV92WM9.d.ts} +186 -6
- package/dist/esm/types.d.ts +3 -4
- package/dist/esm/utils.d.ts +8 -9
- package/package.json +5 -5
- package/dist/cjs/BaseGrpcConsumer-Vvj4lzyS.d.cts +0 -1841
- package/dist/cjs/any_pb-CutLnOUR.d.cts +0 -187
- package/dist/esm/BaseGrpcConsumer-6x4RlZ16.d.ts +0 -1841
- package/dist/esm/any_pb-DBt7qvTr.d.ts +0 -187
package/dist/cjs/utils.d.cts
CHANGED
|
@@ -1,10 +1,9 @@
|
|
|
1
|
-
import "./tx_pb-
|
|
2
|
-
import "./
|
|
3
|
-
import "./index-
|
|
4
|
-
import "./
|
|
5
|
-
import
|
|
6
|
-
import "./index-
|
|
7
|
-
import "./index-
|
|
8
|
-
import "./index-
|
|
9
|
-
import "./index-CGvISJoE.cjs";
|
|
1
|
+
import "./tx_pb-Wr-aZfKH.cjs";
|
|
2
|
+
import "./index-Bp-AQIP3.cjs";
|
|
3
|
+
import { $c as grpcPagingToPagingV2, $l as derivativePriceToChainPrice, $u as ripemd160, Al as getInjectiveAddress, Au as isBrowser, Bl as cosmosSdkDecToBigNumber, Bu as SignTypedDataVersionV4, Cl as uint8ArrayToHex, Cu as spotQuantityToChainQuantityToFixed, Dl as getChecksumAddress, Du as getErrorMessage, El as getAddressFromInjectiveAddress, Eu as bigIntToString, Fl as getDerivativeMarketDecimals, Fu as objectToJson, Gl as denomAmountToChainDenomAmountToFixed, Gu as domainHash, Hl as denomAmountFromChainDenomAmountToFixed, Hu as TypedDataUtilsSanitizeData, Hv as GrpcWebFetchTransport, Il as getDerivativeMarketTensMultiplier, Iu as protoObjectToJson, Jl as derivativeMarginFromChainMarginToFixed, Ju as privateKeyHashToPublicKey, Kl as denomAmountToGrpcChainDenomAmount, Ku as hashToHex, Ll as getSpotMarketDecimals, Lu as safeBigIntStringify, Ml as getSubaccountId, Mu as isNode, Nl as isCw20ContractAddress, Nu as isReactNative, Ol as getDefaultSubaccountId, Ou as grpcCoinToUiCoin, Pl as removeHexPrefix, Pu as isServerSide, Qc as grpcPagingToPaging, Ql as derivativePriceFromChainPriceToFixed, Qu as publicKeyToAddress, Rl as getSpotMarketTensMultiplier, Ru as sortObjectByKeys, Sl as uint8ArrayToBase64, Su as spotQuantityToChainQuantity, Tl as addHexPrefix, Tu as bigIntToNumber, Ul as denomAmountFromGrpcChainDenomAmount, Uu as TypedMessageV4, Vl as denomAmountFromChainDenomAmount, Vu as TypedDataUtilsHashStruct, Wl as denomAmountToChainDenomAmount, Wu as decompressPubKey, Xc as fetchAllWithPagination, Xl as derivativeMarginToChainMarginToFixed, Xu as privateKeyToPublicKey, Yc as recoverTypedSignaturePubKey, Yl as derivativeMarginToChainMargin, Yu as privateKeyHashToPublicKeyBase64, Zc as grpcPaginationToPagination, Zl as derivativePriceFromChainPrice, Zu as privateKeyToPublicKeyBase64, _l as hexToBuff, _u as spotPriceFromChainPriceToFixed, ad as getGasPriceBasedOnMessage, al as BECH32_ADDR_VAL_PREFIX, au as formatAmountToAllowableAmount, bl as toBase64, bu as spotQuantityFromChainQuantity, cd as protobufTimestampToDate, cl as BECH32_PUBKEY_VAL_PREFIX, cu as formatNumberToAllowableTensMultiplier, dl as base64ToUtf8, du as getExactDecimalsFromNumber, ed as sanitizeTypedData, el as pageRequestToGrpcPageRequestV2, eu as derivativePriceToChainPriceToFixed, fl as binaryToBase64, fu as getSignificantDecimalsFromNumber, gl as hexToBase64, gu as spotPriceFromChainPrice, hl as fromUtf8, hu as numberToCosmosSdkDecString, id as getGrpcWebTransport, il as BECH32_ADDR_CONS_PREFIX, iu as derivativeQuantityToChainQuantityToFixed, jl as getInjectiveAddressFromSubaccountId, ju as isJsonString, kl as getEthereumAddress, ku as hexToNumber, ld as protobufTimestampToUnixMs, ll as DEFAULT_DERIVATION_PATH, lu as formatPriceToAllowableDecimals, ml as fromBase64, mu as isNumber, nd as parseCoins, nl as paginationUint8ArrayToString, nu as derivativeQuantityFromChainQuantityToFixed, od as makeTimeoutTimestamp, ol as BECH32_PUBKEY_ACC_PREFIX, ou as formatAmountToAllowableDecimals, pl as concatUint8Arrays, pu as getTensMultiplier, ql as derivativeMarginFromChainMargin, qu as messageHash, rd as ofacList, rl as BECH32_ADDR_ACC_PREFIX, ru as derivativeQuantityToChainQuantity, sd as makeTimeoutTimestampInNs, sl as BECH32_PUBKEY_CONS_PREFIX, su as formatNumberToAllowableDecimals, td as sha256, tl as paginationRequestFromPagination, tu as derivativeQuantityFromChainQuantity, ud as protobufTimestampToUnixSeconds, ul as base64ToUint8Array, uu as formatPriceToAllowablePrice, vl as hexToUint8Array, vu as spotPriceToChainPrice, wl as uint8ArrayToString, wu as bigIntReplacer, xl as toUtf8, xu as spotQuantityFromChainQuantityToFixed, yl as stringToUint8Array, yu as spotPriceToChainPriceToFixed, zl as amountToCosmosSdkDecAmount, zu as sortObjectByKeysWithReduce } from "./index-C_ioefRg.cjs";
|
|
4
|
+
import "./BaseGrpcConsumer-DjBlHZXf.cjs";
|
|
5
|
+
import "./index-BdSf-iSf.cjs";
|
|
6
|
+
import "./index-CSWj2FPd.cjs";
|
|
7
|
+
import "./index-B3Hd6YoY.cjs";
|
|
8
|
+
import "./index-k83cbNQj.cjs";
|
|
10
9
|
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, concatUint8Arrays, cosmosSdkDecToBigNumber, decompressPubKey, denomAmountFromChainDenomAmount, denomAmountFromChainDenomAmountToFixed, denomAmountFromGrpcChainDenomAmount, denomAmountToChainDenomAmount, denomAmountToChainDenomAmountToFixed, denomAmountToGrpcChainDenomAmount, derivativeMarginFromChainMargin, derivativeMarginFromChainMarginToFixed, derivativeMarginToChainMargin, derivativeMarginToChainMarginToFixed, derivativePriceFromChainPrice, derivativePriceFromChainPriceToFixed, derivativePriceToChainPrice, derivativePriceToChainPriceToFixed, derivativeQuantityFromChainQuantity, derivativeQuantityFromChainQuantityToFixed, derivativeQuantityToChainQuantity, derivativeQuantityToChainQuantityToFixed, domainHash, fetchAllWithPagination, 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, 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-Bq6QU9Te.js";
|
|
2
|
-
import { t as BaseGrpcConsumer } from "./BaseGrpcConsumer-
|
|
2
|
+
import { t as BaseGrpcConsumer } from "./BaseGrpcConsumer-D3CPxlPN.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";
|
|
@@ -40,11 +40,12 @@ var AbacusGrpcTransformer = class {
|
|
|
40
40
|
//#endregion
|
|
41
41
|
//#region src/client/abacus/grpc/AbacusGrpcApi.ts
|
|
42
42
|
var AbacusGrpcApi = class extends BaseGrpcConsumer {
|
|
43
|
-
constructor(
|
|
44
|
-
super(
|
|
43
|
+
constructor(..._args) {
|
|
44
|
+
super(..._args);
|
|
45
45
|
_defineProperty(this, "module", IndexerErrorModule.Abacus);
|
|
46
|
-
|
|
47
|
-
|
|
46
|
+
}
|
|
47
|
+
get client() {
|
|
48
|
+
return this.initClient(PointsSvcClient);
|
|
48
49
|
}
|
|
49
50
|
async fetchAccountLatestPoints(address) {
|
|
50
51
|
const request = PointsSvcPb.PointsLatestForAccountRequest.create({ accountAddress: address });
|
|
@@ -0,0 +1,96 @@
|
|
|
1
|
+
import { At as MethodInfo, Dt as DuplexStreamingCall, Et as UnaryCall, Ot as ClientStreamingCall, Tt as RpcTransport, f as GrpcWebTransportAdditionalOptions, kt as ServerStreamingCall, wt as RpcOptions } from "./index-BVWIwmli.js";
|
|
2
|
+
|
|
3
|
+
//#region src/client/base/GrpcWebRpcTransport.d.ts
|
|
4
|
+
|
|
5
|
+
/**
|
|
6
|
+
* GrpcWebRpcTransport provides a simple wrapper around GrpcWebFetchTransport
|
|
7
|
+
* from @protobuf-ts/grpcweb-transport for use with protobuf-ts generated clients.
|
|
8
|
+
*
|
|
9
|
+
* This transport works in browser, Node.js, and React Native environments.
|
|
10
|
+
*/
|
|
11
|
+
declare class GrpcWebRpcTransport implements RpcTransport {
|
|
12
|
+
private transport;
|
|
13
|
+
constructor(baseUrl: string, options?: GrpcWebTransportAdditionalOptions);
|
|
14
|
+
mergeOptions(options?: Partial<RpcOptions>): RpcOptions;
|
|
15
|
+
unary<I extends object, O extends object>(method: MethodInfo<I, O>, input: I, options: RpcOptions): UnaryCall<I, O>;
|
|
16
|
+
serverStreaming<I extends object, O extends object>(method: MethodInfo<I, O>, input: I, options: RpcOptions): ServerStreamingCall<I, O>;
|
|
17
|
+
clientStreaming<I extends object, O extends object>(method: MethodInfo<I, O>, options: RpcOptions): ClientStreamingCall<I, O>;
|
|
18
|
+
duplex<I extends object, O extends object>(method: MethodInfo<I, O>, options: RpcOptions): DuplexStreamingCall<I, O>;
|
|
19
|
+
}
|
|
20
|
+
//#endregion
|
|
21
|
+
//#region src/client/base/BaseGrpcConsumer.d.ts
|
|
22
|
+
/**
|
|
23
|
+
* BaseGrpcConsumer provides base functionality for all gRPC consumers.
|
|
24
|
+
* It uses the GrpcWebRpcTransport with GrpcWebFetchTransport from @protobuf-ts/grpcweb-transport.
|
|
25
|
+
*/
|
|
26
|
+
declare class BaseGrpcConsumer {
|
|
27
|
+
private _client;
|
|
28
|
+
protected endpoint: string;
|
|
29
|
+
protected module: string;
|
|
30
|
+
protected transport: GrpcWebRpcTransport;
|
|
31
|
+
protected metadata?: Record<string, string>;
|
|
32
|
+
protected options?: GrpcWebTransportAdditionalOptions;
|
|
33
|
+
constructor(endpoint: string, options?: GrpcWebTransportAdditionalOptions);
|
|
34
|
+
/**
|
|
35
|
+
* @deprecated Pass options into the constructor instead
|
|
36
|
+
*/
|
|
37
|
+
setMetadata(map: Record<string, string>): this;
|
|
38
|
+
/**
|
|
39
|
+
* @deprecated Manage options within the constructor instead
|
|
40
|
+
*/
|
|
41
|
+
clearMetadata(): void;
|
|
42
|
+
getTransport(): GrpcWebRpcTransport;
|
|
43
|
+
/**
|
|
44
|
+
* Lazily initializes and returns the gRPC client.
|
|
45
|
+
* Call this from a getter in subclasses to avoid constructor boilerplate.
|
|
46
|
+
*
|
|
47
|
+
* @example
|
|
48
|
+
* private get client() {
|
|
49
|
+
* return this.initClient(MyGrpcClient)
|
|
50
|
+
* }
|
|
51
|
+
*/
|
|
52
|
+
protected initClient<TClient>(ClientClass: new (transport: GrpcWebRpcTransport) => TClient): TClient;
|
|
53
|
+
/**
|
|
54
|
+
* Builds RpcOptions with metadata
|
|
55
|
+
* @deprecated Options should be managed externally and passed into the constructor instead
|
|
56
|
+
*/
|
|
57
|
+
protected getRpcOptions(): RpcOptions;
|
|
58
|
+
/**
|
|
59
|
+
* Retry a gRPC call with exponential backoff
|
|
60
|
+
*/
|
|
61
|
+
protected retry<TResponse>(grpcCall: () => Promise<TResponse>, retries?: number, delay?: number): Promise<TResponse>;
|
|
62
|
+
/**
|
|
63
|
+
* Extracts the ABCI error code from a gRPC error message.
|
|
64
|
+
* Chain errors contain patterns like: {key:"ABCICode" value:"100"}
|
|
65
|
+
*/
|
|
66
|
+
private getABCICodeFromMessage;
|
|
67
|
+
/**
|
|
68
|
+
* Extracts the codespace/module from a gRPC error message.
|
|
69
|
+
* Chain errors contain patterns like: {key:"Codespace" value:"exchange"}
|
|
70
|
+
*/
|
|
71
|
+
private getCodespaceFromMessage;
|
|
72
|
+
/**
|
|
73
|
+
* Centralized error handler for gRPC calls.
|
|
74
|
+
* When the error contains chain error details (ABCI code and codespace),
|
|
75
|
+
* throws a TransactionException which will map the error to a user-friendly message.
|
|
76
|
+
* Otherwise throws a GrpcUnaryRequestException for generic gRPC errors.
|
|
77
|
+
*/
|
|
78
|
+
protected handleGrpcError(e: unknown, context: string): never;
|
|
79
|
+
/**
|
|
80
|
+
* Generic wrapper for gRPC calls with retry and error handling
|
|
81
|
+
* Simplifies the common pattern of: retry -> await response -> handle errors
|
|
82
|
+
*
|
|
83
|
+
* Usage with explicit type parameter:
|
|
84
|
+
* ```typescript
|
|
85
|
+
* const response = await this.executeGrpcCall<QueryParamsRequest, QueryParamsResponse>(
|
|
86
|
+
* request,
|
|
87
|
+
* this.client.params.bind(this.client),
|
|
88
|
+
* )
|
|
89
|
+
* ```
|
|
90
|
+
* @template TRequest - The request message type
|
|
91
|
+
* @template TResponse - The response message type
|
|
92
|
+
*/
|
|
93
|
+
protected executeGrpcCall<TRequest extends object = object, TResponse extends object = object>(request: TRequest, clientMethod: (req: TRequest, options?: RpcOptions) => UnaryCall<TRequest, TResponse>): Promise<TResponse>;
|
|
94
|
+
}
|
|
95
|
+
//#endregion
|
|
96
|
+
export { BaseGrpcConsumer as t };
|
|
@@ -39,27 +39,56 @@ var GrpcWebRpcTransport = class {
|
|
|
39
39
|
* It uses the GrpcWebRpcTransport with GrpcWebFetchTransport from @protobuf-ts/grpcweb-transport.
|
|
40
40
|
*/
|
|
41
41
|
var BaseGrpcConsumer = class {
|
|
42
|
-
constructor(endpoint) {
|
|
43
|
-
_defineProperty(this, "
|
|
42
|
+
constructor(endpoint, options) {
|
|
43
|
+
_defineProperty(this, "_client", void 0);
|
|
44
|
+
_defineProperty(this, "endpoint", void 0);
|
|
44
45
|
_defineProperty(this, "module", "");
|
|
46
|
+
_defineProperty(this, "transport", void 0);
|
|
45
47
|
_defineProperty(this, "metadata", void 0);
|
|
46
|
-
_defineProperty(this, "
|
|
48
|
+
_defineProperty(this, "options", void 0);
|
|
49
|
+
this.options = options;
|
|
47
50
|
this.endpoint = endpoint;
|
|
48
|
-
this.transport = new GrpcWebRpcTransport(endpoint,
|
|
51
|
+
this.transport = new GrpcWebRpcTransport(endpoint, options);
|
|
49
52
|
}
|
|
53
|
+
/**
|
|
54
|
+
* @deprecated Pass options into the constructor instead
|
|
55
|
+
*/
|
|
50
56
|
setMetadata(map) {
|
|
51
57
|
this.metadata = map;
|
|
52
|
-
this.transport = new GrpcWebRpcTransport(this.endpoint, {
|
|
58
|
+
this.transport = new GrpcWebRpcTransport(this.endpoint, {
|
|
59
|
+
...this.options,
|
|
60
|
+
meta: this.metadata
|
|
61
|
+
});
|
|
62
|
+
this._client = void 0;
|
|
53
63
|
return this;
|
|
54
64
|
}
|
|
65
|
+
/**
|
|
66
|
+
* @deprecated Manage options within the constructor instead
|
|
67
|
+
*/
|
|
55
68
|
clearMetadata() {
|
|
56
69
|
this.metadata = void 0;
|
|
70
|
+
this.transport = new GrpcWebRpcTransport(this.endpoint, this.options);
|
|
71
|
+
this._client = void 0;
|
|
57
72
|
}
|
|
58
73
|
getTransport() {
|
|
59
74
|
return this.transport;
|
|
60
75
|
}
|
|
61
76
|
/**
|
|
77
|
+
* Lazily initializes and returns the gRPC client.
|
|
78
|
+
* Call this from a getter in subclasses to avoid constructor boilerplate.
|
|
79
|
+
*
|
|
80
|
+
* @example
|
|
81
|
+
* private get client() {
|
|
82
|
+
* return this.initClient(MyGrpcClient)
|
|
83
|
+
* }
|
|
84
|
+
*/
|
|
85
|
+
initClient(ClientClass) {
|
|
86
|
+
if (!this._client) this._client = new ClientClass(this.transport);
|
|
87
|
+
return this._client;
|
|
88
|
+
}
|
|
89
|
+
/**
|
|
62
90
|
* Builds RpcOptions with metadata
|
|
91
|
+
* @deprecated Options should be managed externally and passed into the constructor instead
|
|
63
92
|
*/
|
|
64
93
|
getRpcOptions() {
|
|
65
94
|
return { meta: this.metadata || {} };
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { O as denomAmountFromGrpcChainDenomAmount } from "./utils-BFBu_LnJ.js";
|
|
2
2
|
import { t as _defineProperty } from "./defineProperty-Bq6QU9Te.js";
|
|
3
|
-
import { o as ChainModule } from "./ChainRestTendermintApi-
|
|
4
|
-
import { t as BaseGrpcConsumer } from "./BaseGrpcConsumer-
|
|
3
|
+
import { o as ChainModule } from "./ChainRestTendermintApi-DUK7FvxW.js";
|
|
4
|
+
import { t as BaseGrpcConsumer } from "./BaseGrpcConsumer-D3CPxlPN.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";
|
|
@@ -258,11 +258,12 @@ var ChainGrpcExchangeTransformer = class ChainGrpcExchangeTransformer {
|
|
|
258
258
|
* @category Chain Grpc API
|
|
259
259
|
*/
|
|
260
260
|
var ChainGrpcExchangeApi = class extends BaseGrpcConsumer {
|
|
261
|
-
constructor(
|
|
262
|
-
super(
|
|
261
|
+
constructor(..._args) {
|
|
262
|
+
super(..._args);
|
|
263
263
|
_defineProperty(this, "module", ChainModule.Exchange);
|
|
264
|
-
|
|
265
|
-
|
|
264
|
+
}
|
|
265
|
+
get client() {
|
|
266
|
+
return this.initClient(QueryClient);
|
|
266
267
|
}
|
|
267
268
|
async fetchModuleParams() {
|
|
268
269
|
const request = InjectiveExchangeV1Beta1QueryPb.QueryExchangeParamsRequest.create();
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { Jt as uint8ArrayToString, Kt as uint8ArrayToBase64, l as ChainGrpcCommonTransformer } from "./utils-BFBu_LnJ.js";
|
|
2
2
|
import { t as _defineProperty } from "./defineProperty-Bq6QU9Te.js";
|
|
3
|
-
import { t as BaseGrpcConsumer } from "./BaseGrpcConsumer-
|
|
3
|
+
import { t as BaseGrpcConsumer } from "./BaseGrpcConsumer-D3CPxlPN.js";
|
|
4
4
|
import { t as BaseRestConsumer } from "./BaseRestConsumer-rK4eS4W8.js";
|
|
5
5
|
import { ChainErrorModule, HttpRequestException, UnspecifiedErrorCode } from "@injectivelabs/exceptions";
|
|
6
6
|
import * as InjectiveCryptoV1Beta1Ethsecp256k1KeysPb from "@injectivelabs/core-proto-ts-v2/generated/injective/crypto/v1beta1/ethsecp256k1/keys_pb";
|
|
@@ -99,11 +99,12 @@ var ChainGrpcAuthTransformer = class ChainGrpcAuthTransformer {
|
|
|
99
99
|
* @category Chain Grpc API
|
|
100
100
|
*/
|
|
101
101
|
var ChainGrpcAuthApi = class extends BaseGrpcConsumer {
|
|
102
|
-
constructor(
|
|
103
|
-
super(
|
|
102
|
+
constructor(..._args) {
|
|
103
|
+
super(..._args);
|
|
104
104
|
_defineProperty(this, "module", ChainModule.Auth);
|
|
105
|
-
|
|
106
|
-
|
|
105
|
+
}
|
|
106
|
+
get client() {
|
|
107
|
+
return this.initClient(QueryClient);
|
|
107
108
|
}
|
|
108
109
|
async fetchModuleParams() {
|
|
109
110
|
const request = CosmosAuthV1Beta1QueryPb.QueryParamsRequest.create();
|
|
@@ -131,11 +132,12 @@ var ChainGrpcAuthApi = class extends BaseGrpcConsumer {
|
|
|
131
132
|
* @category Chain Grpc API
|
|
132
133
|
*/
|
|
133
134
|
var ChainGrpcTendermintApi = class extends BaseGrpcConsumer {
|
|
134
|
-
constructor(
|
|
135
|
-
super(
|
|
135
|
+
constructor(..._args) {
|
|
136
|
+
super(..._args);
|
|
136
137
|
_defineProperty(this, "module", ChainModule.Tendermint);
|
|
137
|
-
|
|
138
|
-
|
|
138
|
+
}
|
|
139
|
+
get client() {
|
|
140
|
+
return this.initClient(ServiceClient);
|
|
139
141
|
}
|
|
140
142
|
async fetchLatestBlock() {
|
|
141
143
|
const request = CosmosBaseTendermintV1Beta1QueryPb.GetLatestBlockRequest.create();
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { Pt as base64ToUint8Array, Ut as stringToUint8Array, cn as safeBigIntStringify, qt as uint8ArrayToHex, t as recoverTypedSignaturePubKey } from "./utils-BFBu_LnJ.js";
|
|
2
2
|
import { t as _defineProperty } from "./defineProperty-Bq6QU9Te.js";
|
|
3
|
-
import { t as BaseIndexerGrpcConsumer } from "./BaseIndexerGrpcConsumer-
|
|
3
|
+
import { t as BaseIndexerGrpcConsumer } from "./BaseIndexerGrpcConsumer-DQUmeane.js";
|
|
4
4
|
import * as CosmosTxV1Beta1TxPb from "@injectivelabs/core-proto-ts-v2/generated/cosmos/tx/v1beta1/tx_pb";
|
|
5
5
|
import { DEFAULT_BRIDGE_FEE_DENOM, DEFAULT_BRIDGE_FEE_PRICE, DEFAULT_EXCHANGE_LIMIT, DEFAULT_GAS_LIMIT } from "@injectivelabs/utils";
|
|
6
6
|
import { ErrorType, IndexerErrorModule, TransactionException, UnspecifiedErrorCode } from "@injectivelabs/exceptions";
|
|
@@ -75,11 +75,12 @@ const IndexerModule = { ...IndexerErrorModule };
|
|
|
75
75
|
* @deprecated use IndexerGrpcWeb3GwApi
|
|
76
76
|
*/
|
|
77
77
|
var IndexerGrpcTransactionApi = class extends BaseIndexerGrpcConsumer {
|
|
78
|
-
constructor(
|
|
79
|
-
super(
|
|
78
|
+
constructor(..._args) {
|
|
79
|
+
super(..._args);
|
|
80
80
|
_defineProperty(this, "module", IndexerModule.Transaction);
|
|
81
|
-
|
|
82
|
-
|
|
81
|
+
}
|
|
82
|
+
get client() {
|
|
83
|
+
return this.initClient(InjectiveExchangeRPCClient);
|
|
83
84
|
}
|
|
84
85
|
async prepareTxRequest(args) {
|
|
85
86
|
const { address, chainId, message, memo, estimateGas = true, gasLimit = DEFAULT_GAS_LIMIT, feeDenom = DEFAULT_BRIDGE_FEE_DENOM, feePrice = DEFAULT_BRIDGE_FEE_PRICE, timeoutHeight } = args;
|
|
@@ -184,8 +185,8 @@ var IndexerGrpcTransactionApi = class extends BaseIndexerGrpcConsumer {
|
|
|
184
185
|
* @category Indexer Grpc API
|
|
185
186
|
*/
|
|
186
187
|
var IndexerGrpcWeb3GwApi = class extends IndexerGrpcTransactionApi {
|
|
187
|
-
constructor(
|
|
188
|
-
super(
|
|
188
|
+
constructor(..._args) {
|
|
189
|
+
super(..._args);
|
|
189
190
|
_defineProperty(this, "module", IndexerModule.Web3Gw);
|
|
190
191
|
}
|
|
191
192
|
async prepareEip712Request({ address, chainId, message, memo, sequence, accountNumber, estimateGas = false, gasLimit = DEFAULT_GAS_LIMIT, feeDenom = DEFAULT_BRIDGE_FEE_DENOM, feePrice = DEFAULT_BRIDGE_FEE_PRICE, timeoutHeight, eip712Version = "v1" }) {
|
|
@@ -2,7 +2,7 @@ import { Ht as hexToUint8Array, It as binaryToBase64, Kt as uint8ArrayToBase64,
|
|
|
2
2
|
import { t as _defineProperty } from "./defineProperty-Bq6QU9Te.js";
|
|
3
3
|
import { A as createAny, F as Address } from "./accounts-C5HEaz0B.js";
|
|
4
4
|
import { n as prepareSignBytes, t as MsgBase } from "./MsgBase-BkRgVbdY.js";
|
|
5
|
-
import { t as ChainGrpcExchangeApi } from "./ChainGrpcExchangeApi-
|
|
5
|
+
import { t as ChainGrpcExchangeApi } from "./ChainGrpcExchangeApi-DQvLWB5R.js";
|
|
6
6
|
import { a as dataToExecData$1, i as ExecArgBase } from "./ExecArgNeptuneWithdraw-uLf3HttI.js";
|
|
7
7
|
import { keccak256 } from "viem";
|
|
8
8
|
import { BigNumber, DEFAULT_BRIDGE_FEE_AMOUNT, DEFAULT_BRIDGE_FEE_DENOM, toChainFormat, toPascalCase } from "@injectivelabs/utils";
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { t as _defineProperty } from "./defineProperty-Bq6QU9Te.js";
|
|
2
2
|
import { r as protobufTimestampToDate } from "./time-DYEqYFao.js";
|
|
3
|
-
import { t as BaseIndexerGrpcConsumer } from "./BaseIndexerGrpcConsumer-
|
|
3
|
+
import { t as BaseIndexerGrpcConsumer } from "./BaseIndexerGrpcConsumer-DQUmeane.js";
|
|
4
4
|
import { IndexerErrorModule } from "@injectivelabs/exceptions";
|
|
5
5
|
import * as DmmPb from "@injectivelabs/olp-proto-ts-v2/generated/dmm_pb";
|
|
6
6
|
import { InjectiveDmmV2RPCClient } from "@injectivelabs/olp-proto-ts-v2/generated/dmm_pb.client";
|
|
@@ -248,11 +248,12 @@ var DmmGrpcTransformer = class DmmGrpcTransformer {
|
|
|
248
248
|
//#endregion
|
|
249
249
|
//#region src/client/olp/grpc/OLPGrpcApi.ts
|
|
250
250
|
var OLPGrpcApi = class extends BaseIndexerGrpcConsumer {
|
|
251
|
-
constructor(
|
|
252
|
-
super(
|
|
251
|
+
constructor(..._args) {
|
|
252
|
+
super(..._args);
|
|
253
253
|
_defineProperty(this, "module", IndexerErrorModule.OLP);
|
|
254
|
-
|
|
255
|
-
|
|
254
|
+
}
|
|
255
|
+
get client() {
|
|
256
|
+
return this.initClient(InjectiveDmmV2RPCClient);
|
|
256
257
|
}
|
|
257
258
|
async fetchEpochs(status) {
|
|
258
259
|
const request = DmmPb.GetEpochsRequest.create();
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { Gt as toUtf8, It as binaryToBase64, Rt as fromBase64, Wt as toBase64 } from "./utils-BFBu_LnJ.js";
|
|
2
2
|
import { t as _defineProperty } from "./defineProperty-Bq6QU9Te.js";
|
|
3
|
-
import { h as ChainGrpcWasmApi } from "./chain-
|
|
3
|
+
import { h as ChainGrpcWasmApi } from "./chain-DKislBAW.js";
|
|
4
4
|
import { n as MsgExecuteContractCompat, r as ExecArgNeptuneDeposit, t as ExecArgNeptuneWithdraw } from "./ExecArgNeptuneWithdraw-uLf3HttI.js";
|
|
5
5
|
import { GeneralException } from "@injectivelabs/exceptions";
|
|
6
6
|
import { Network, getNetworkEndpoints, isMainnet } from "@injectivelabs/networks";
|
|
@@ -140,11 +140,11 @@ var NeptuneService = class {
|
|
|
140
140
|
* @param network The network to use (default: Mainnet).
|
|
141
141
|
* @param endpoints Optional custom network endpoints.
|
|
142
142
|
*/
|
|
143
|
-
constructor(network = Network.MainnetSentry, endpoints) {
|
|
143
|
+
constructor(network = Network.MainnetSentry, endpoints, options) {
|
|
144
144
|
_defineProperty(this, "client", void 0);
|
|
145
145
|
_defineProperty(this, "priceOracleContract", void 0);
|
|
146
146
|
if (!isMainnet(network)) throw new GeneralException(/* @__PURE__ */ new Error("Please switch to mainnet network"));
|
|
147
|
-
this.client = new ChainGrpcWasmApi((endpoints || getNetworkEndpoints(network)).grpc);
|
|
147
|
+
this.client = new ChainGrpcWasmApi((endpoints || getNetworkEndpoints(network)).grpc, options);
|
|
148
148
|
this.priceOracleContract = NEPTUNE_PRICE_CONTRACT;
|
|
149
149
|
}
|
|
150
150
|
/**
|