@injectivelabs/sdk-ts 1.17.2-alpha.1 → 1.17.2-alpha.11
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/cjs/{ChainGrpcExchangeApi-BtyGj9nz.cjs → ChainGrpcExchangeApi-DLpkgEyg.cjs} +2 -2
- package/dist/cjs/{ChainRestTendermintApi-QfW64O3w.cjs → ChainRestTendermintApi-BiZOeKcG.cjs} +1 -1
- package/dist/cjs/{DirectEthSecp256k1Wallet-DoKnf40T.cjs → DirectEthSecp256k1Wallet-CU18lti3.cjs} +2 -2
- package/dist/cjs/{ExecArgNeptuneWithdraw-Bq-vm03i.cjs → ExecArgNeptuneWithdraw-DOHeo3AJ.cjs} +6 -6
- package/dist/cjs/{IndexerGrpcWeb3GwApi-DqzAO5JM.cjs → IndexerGrpcWeb3GwApi-BgWT2tWK.cjs} +6 -6
- package/dist/cjs/{MsgBase-BJ1-Qh5c.cjs → MsgBase-DqOmzCyS.cjs} +1 -0
- package/dist/cjs/{MsgSetDenomMetadata-DRNtJ4-D.cjs → MsgSetDenomMetadata-CUoGqV8P.cjs} +9 -9
- package/dist/cjs/{QueryTradingStrategyContractTotalStrategies-C9cHGYOE.cjs → QueryTradingStrategyContractTotalStrategies-Bh8AXm4k.cjs} +3 -3
- package/dist/cjs/{IndexerGrpcAccountPortfolioStream-DeTA0ie2.cjs → StreamManager-ikNObdr-.cjs} +1257 -278
- package/dist/cjs/{accounts-D7eN2BGD.cjs → accounts-CXaUasU5.cjs} +9 -8
- package/dist/cjs/{any_pb-CP-3DVyl.d.cts → any_pb-CutLnOUR.d.cts} +2 -2
- package/dist/cjs/{chain--FmH8auB.cjs → chain-Cs9sNuT1.cjs} +2 -2
- package/dist/cjs/client/chain.cjs +4 -4
- package/dist/cjs/client/chain.d.cts +7 -7
- package/dist/cjs/client/indexer.cjs +72 -58
- package/dist/cjs/client/indexer.d.cts +8 -8
- package/dist/cjs/client/olp.d.cts +1 -1
- package/dist/cjs/client/wasm.cjs +7 -7
- package/dist/cjs/client/wasm.d.cts +2 -2
- package/dist/cjs/core/accounts.cjs +3 -3
- package/dist/cjs/core/accounts.d.cts +7 -7
- package/dist/cjs/core/modules.cjs +9 -9
- package/dist/cjs/core/modules.d.cts +7 -7
- package/dist/cjs/core/tx.cjs +6 -6
- package/dist/cjs/core/tx.d.cts +7 -7
- package/dist/cjs/cosmjs.cjs +7 -7
- package/dist/cjs/cosmjs.d.cts +3 -3
- package/dist/cjs/exports.cjs +7 -7
- package/dist/cjs/exports.d.cts +3 -3
- package/dist/cjs/{index-Cqfc1ppG.d.cts → index-B1AYbshM.d.cts} +223 -19
- package/dist/cjs/{index-D4uWOVE5.d.cts → index-B8XmWgDc.d.cts} +5 -5
- package/dist/cjs/{index-Cc4mqAsR.d.cts → index-D6ubyMlR.d.cts} +1 -1
- package/dist/cjs/{index-9KV6P3U_.d.cts → index-DDQzXOux.d.cts} +933 -154
- package/dist/cjs/{index-CKBod1ba.d.cts → index-D__cYp7U.d.cts} +3 -2
- package/dist/cjs/{index-Cc5Q73-y.d.cts → index-FEXnDdOc.d.cts} +1 -1
- package/dist/cjs/index.cjs +89 -68
- package/dist/cjs/index.d.cts +8 -8
- package/dist/cjs/{service-BsjIvzFh.cjs → service-yA6fSem8.cjs} +2 -2
- package/dist/cjs/service.cjs +3 -3
- package/dist/cjs/service.d.cts +4 -4
- package/dist/cjs/{tx-BXz2UdNK.cjs → tx-Cn0j2SRh.cjs} +4 -4
- package/dist/{esm/tx_pb-TiSRD5ay.d.ts → cjs/tx_pb-D-cNmrlO.d.cts} +4 -3
- package/dist/cjs/{types-NFV4P_J_.cjs → types-DvoTS2v1.cjs} +104 -7
- package/dist/cjs/types.cjs +6 -1
- package/dist/cjs/types.d.cts +4 -4
- package/dist/cjs/{utils-WpVZ-fdd.cjs → utils-V1uXtT51.cjs} +120 -88
- package/dist/cjs/utils.cjs +3 -1
- package/dist/cjs/utils.d.cts +8 -8
- package/dist/esm/{ChainGrpcExchangeApi-C2PzFFLo.js → ChainGrpcExchangeApi-C-2XsVVs.js} +2 -2
- package/dist/esm/{ChainRestTendermintApi-iWnboboL.js → ChainRestTendermintApi-CMrAg0Zm.js} +1 -1
- package/dist/esm/{DirectEthSecp256k1Wallet-3qFMEHzf.js → DirectEthSecp256k1Wallet-a9KiF9fA.js} +2 -2
- package/dist/esm/{ExecArgNeptuneWithdraw-D_zdRFlV.js → ExecArgNeptuneWithdraw-DEljIeLd.js} +6 -6
- package/dist/esm/{IndexerGrpcWeb3GwApi-C82holuJ.js → IndexerGrpcWeb3GwApi-CtUYowus.js} +6 -6
- package/dist/esm/{MsgBase-aKq3ln6R.js → MsgBase-BkRgVbdY.js} +1 -0
- package/dist/esm/{MsgSetDenomMetadata-WwlO0X1r.js → MsgSetDenomMetadata-BhJMebO9.js} +9 -9
- package/dist/esm/{QueryTradingStrategyContractTotalStrategies-Bov-bhFt.js → QueryTradingStrategyContractTotalStrategies-7IjWZLsc.js} +3 -3
- package/dist/esm/{IndexerGrpcAccountPortfolioStream-CxK8ZbH1.js → StreamManager-Bz2mGjMt.js} +926 -31
- package/dist/esm/{accounts-B8PWTc1V.js → accounts-DFC9RYDH.js} +9 -8
- package/dist/esm/{any_pb-B1YYUSUf.d.ts → any_pb-DBt7qvTr.d.ts} +2 -2
- package/dist/esm/{chain-B93GTjUS.js → chain-phKWVf8c.js} +2 -2
- package/dist/esm/client/chain.d.ts +7 -7
- package/dist/esm/client/chain.js +4 -4
- package/dist/esm/client/indexer.d.ts +8 -8
- package/dist/esm/client/indexer.js +5 -5
- package/dist/esm/client/olp.d.ts +1 -1
- package/dist/esm/client/wasm.d.ts +2 -2
- package/dist/esm/client/wasm.js +7 -7
- package/dist/esm/core/accounts.d.ts +7 -7
- package/dist/esm/core/accounts.js +3 -3
- package/dist/esm/core/modules.d.ts +7 -7
- package/dist/esm/core/modules.js +9 -9
- package/dist/esm/core/tx.d.ts +7 -7
- package/dist/esm/core/tx.js +6 -6
- package/dist/esm/cosmjs.d.ts +3 -3
- package/dist/esm/cosmjs.js +7 -7
- package/dist/esm/exports.d.ts +3 -3
- package/dist/esm/exports.js +7 -7
- package/dist/esm/{index-BOKuUpVZ.d.ts → index--sg5xbEP.d.ts} +1 -1
- package/dist/esm/{index-aNMYd-s0.d.ts → index-BoEe6weX.d.ts} +3 -2
- package/dist/esm/{index-CIU3qLo9.d.ts → index-DSY58vw-.d.ts} +949 -170
- package/dist/esm/{index-DS6aJrL5.d.ts → index-DgYt7OQg.d.ts} +1 -1
- package/dist/esm/{index-DdGVE3_u.d.ts → index-GcFVWcCn.d.ts} +5 -5
- package/dist/esm/{index-B1R417vW.d.ts → index-mAmKmwGY.d.ts} +223 -19
- package/dist/esm/index.d.ts +8 -8
- package/dist/esm/index.js +15 -15
- package/dist/esm/{service-DsZ0vnDP.js → service-B_k552b0.js} +2 -2
- package/dist/esm/service.d.ts +4 -4
- package/dist/esm/service.js +3 -3
- package/dist/esm/{tx-C1AZz6w-.js → tx-CcaVBSym.js} +4 -4
- package/dist/{cjs/tx_pb-tECSPcSB.d.cts → esm/tx_pb-zz4o4hHG.d.ts} +4 -3
- package/dist/esm/types-Bu8IAJ0R.js +137 -0
- package/dist/esm/types.d.ts +4 -4
- package/dist/esm/types.js +2 -2
- package/dist/esm/{utils-BaRG9oyg.js → utils-DwGoPRTL.js} +111 -90
- package/dist/esm/utils.d.ts +8 -8
- package/dist/esm/utils.js +2 -2
- package/package.json +16 -16
- package/dist/esm/types-Cq0sRR6y.js +0 -70
|
@@ -1,9 +1,10 @@
|
|
|
1
|
-
import { n as Coin, t as Any } from "./any_pb-
|
|
1
|
+
import { n as Coin, t as Any } from "./any_pb-CutLnOUR.cjs";
|
|
2
2
|
|
|
3
3
|
//#region rolldown:runtime
|
|
4
4
|
|
|
5
5
|
//#endregion
|
|
6
|
-
//#region ../../node_modules/.pnpm/@injectivelabs+core-proto-ts-v2@1.17.
|
|
6
|
+
//#region ../../node_modules/.pnpm/@injectivelabs+core-proto-ts-v2@1.17.3/node_modules/@injectivelabs/core-proto-ts-v2/esm/generated/cosmos/crypto/multisig/v1beta1/multisig_pb.d.ts
|
|
7
|
+
|
|
7
8
|
/**
|
|
8
9
|
* CompactBitArray is an implementation of a space efficient bit array.
|
|
9
10
|
* This is used to ensure that the encoded data takes up a minimal amount of
|
|
@@ -27,7 +28,7 @@ interface CompactBitArray {
|
|
|
27
28
|
*/
|
|
28
29
|
declare const CompactBitArray = new CompactBitArray$Type();
|
|
29
30
|
//#endregion
|
|
30
|
-
//#region ../../node_modules/.pnpm/@injectivelabs+core-proto-ts-v2@1.17.
|
|
31
|
+
//#region ../../node_modules/.pnpm/@injectivelabs+core-proto-ts-v2@1.17.3/node_modules/@injectivelabs/core-proto-ts-v2/esm/generated/cosmos/tx/signing/v1beta1/signing_pb.d.ts
|
|
31
32
|
|
|
32
33
|
/**
|
|
33
34
|
* SignMode represents a signing mode with its own security guarantees.
|
|
@@ -39,17 +39,47 @@ const TokenSource = {
|
|
|
39
39
|
};
|
|
40
40
|
|
|
41
41
|
//#endregion
|
|
42
|
-
//#region src/types/
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
42
|
+
//#region src/types/stream.ts
|
|
43
|
+
/**
|
|
44
|
+
* Subscription interface for stream management with event-based lifecycle
|
|
45
|
+
*/
|
|
46
|
+
/**
|
|
47
|
+
* Enhanced disconnect reasons with gRPC error code mapping
|
|
48
|
+
*/
|
|
49
|
+
const StreamDisconnectReason = {
|
|
50
|
+
UserStopped: "user-stopped",
|
|
51
|
+
StreamError: "stream-error",
|
|
52
|
+
NetworkError: "network-error",
|
|
53
|
+
Timeout: "timeout",
|
|
54
|
+
AuthenticationError: "authentication-error",
|
|
55
|
+
MaxRetries: "max-retries",
|
|
56
|
+
StreamEnded: "stream-ended"
|
|
57
|
+
};
|
|
58
|
+
const StreamEvent = {
|
|
59
|
+
Data: "data",
|
|
60
|
+
Connect: "connect",
|
|
61
|
+
Disconnect: "disconnect",
|
|
62
|
+
Retry: "retry",
|
|
63
|
+
StateChange: "state:change",
|
|
64
|
+
Error: "error",
|
|
65
|
+
Warn: "warn"
|
|
66
|
+
};
|
|
67
|
+
/**
|
|
68
|
+
* StreamManager
|
|
69
|
+
*/
|
|
70
|
+
const StreamState = {
|
|
71
|
+
Idle: "idle",
|
|
72
|
+
Connecting: "connecting",
|
|
73
|
+
Connected: "connected",
|
|
74
|
+
Reconnecting: "reconnecting",
|
|
75
|
+
Stopped: "stopped"
|
|
49
76
|
};
|
|
50
77
|
|
|
51
78
|
//#endregion
|
|
52
79
|
//#region src/types/exchange.ts
|
|
80
|
+
/**
|
|
81
|
+
* Trade and Order types
|
|
82
|
+
*/
|
|
53
83
|
const TradeExecutionType = {
|
|
54
84
|
Market: "market",
|
|
55
85
|
LimitFill: "limitFill",
|
|
@@ -66,8 +96,45 @@ const TradeDirection = {
|
|
|
66
96
|
Long: "long",
|
|
67
97
|
Short: "short"
|
|
68
98
|
};
|
|
99
|
+
const OrderState = {
|
|
100
|
+
Unfilled: "unfilled",
|
|
101
|
+
Booked: "booked",
|
|
102
|
+
PartialFilled: "partial_filled",
|
|
103
|
+
PartiallyFilled: "partially_filled",
|
|
104
|
+
Filled: "filled",
|
|
105
|
+
Canceled: "canceled",
|
|
106
|
+
Triggered: "triggered"
|
|
107
|
+
};
|
|
108
|
+
const OrderSide = {
|
|
109
|
+
Unspecified: "unspecified",
|
|
110
|
+
Buy: "buy",
|
|
111
|
+
Sell: "sell",
|
|
112
|
+
StopBuy: "stop_buy",
|
|
113
|
+
StopSell: "stop_sell",
|
|
114
|
+
TakeBuy: "take_buy",
|
|
115
|
+
TakeSell: "take_sell",
|
|
116
|
+
BuyPO: "buy_po",
|
|
117
|
+
SellPO: "sell_po",
|
|
118
|
+
BuyAtomic: "buy_atomic",
|
|
119
|
+
SellAtomic: "sell_atomic",
|
|
120
|
+
Unrecognized: "unrecognized"
|
|
121
|
+
};
|
|
69
122
|
const OrderMaskMap = __injectivelabs_core_proto_ts_v2_generated_injective_exchange_v1beta1_exchange_pb.OrderMask;
|
|
70
123
|
|
|
124
|
+
//#endregion
|
|
125
|
+
//#region src/types/stream-legacy.ts
|
|
126
|
+
/**
|
|
127
|
+
* Legacy stream operation types
|
|
128
|
+
* Used by indexer stream transformers
|
|
129
|
+
*/
|
|
130
|
+
const StreamOperation = {
|
|
131
|
+
Insert: "insert",
|
|
132
|
+
Delete: "delete",
|
|
133
|
+
Replace: "replace",
|
|
134
|
+
Update: "update",
|
|
135
|
+
Invalidate: "invalidate"
|
|
136
|
+
};
|
|
137
|
+
|
|
71
138
|
//#endregion
|
|
72
139
|
Object.defineProperty(exports, 'OrderMaskMap', {
|
|
73
140
|
enumerable: true,
|
|
@@ -75,12 +142,42 @@ Object.defineProperty(exports, 'OrderMaskMap', {
|
|
|
75
142
|
return OrderMaskMap;
|
|
76
143
|
}
|
|
77
144
|
});
|
|
145
|
+
Object.defineProperty(exports, 'OrderSide', {
|
|
146
|
+
enumerable: true,
|
|
147
|
+
get: function () {
|
|
148
|
+
return OrderSide;
|
|
149
|
+
}
|
|
150
|
+
});
|
|
151
|
+
Object.defineProperty(exports, 'OrderState', {
|
|
152
|
+
enumerable: true,
|
|
153
|
+
get: function () {
|
|
154
|
+
return OrderState;
|
|
155
|
+
}
|
|
156
|
+
});
|
|
157
|
+
Object.defineProperty(exports, 'StreamDisconnectReason', {
|
|
158
|
+
enumerable: true,
|
|
159
|
+
get: function () {
|
|
160
|
+
return StreamDisconnectReason;
|
|
161
|
+
}
|
|
162
|
+
});
|
|
163
|
+
Object.defineProperty(exports, 'StreamEvent', {
|
|
164
|
+
enumerable: true,
|
|
165
|
+
get: function () {
|
|
166
|
+
return StreamEvent;
|
|
167
|
+
}
|
|
168
|
+
});
|
|
78
169
|
Object.defineProperty(exports, 'StreamOperation', {
|
|
79
170
|
enumerable: true,
|
|
80
171
|
get: function () {
|
|
81
172
|
return StreamOperation;
|
|
82
173
|
}
|
|
83
174
|
});
|
|
175
|
+
Object.defineProperty(exports, 'StreamState', {
|
|
176
|
+
enumerable: true,
|
|
177
|
+
get: function () {
|
|
178
|
+
return StreamState;
|
|
179
|
+
}
|
|
180
|
+
});
|
|
84
181
|
Object.defineProperty(exports, 'TokenSource', {
|
|
85
182
|
enumerable: true,
|
|
86
183
|
get: function () {
|
package/dist/cjs/types.cjs
CHANGED
|
@@ -1,7 +1,12 @@
|
|
|
1
|
-
const require_types = require('./types-
|
|
1
|
+
const require_types = require('./types-DvoTS2v1.cjs');
|
|
2
2
|
|
|
3
3
|
exports.OrderMaskMap = require_types.OrderMaskMap;
|
|
4
|
+
exports.OrderSide = require_types.OrderSide;
|
|
5
|
+
exports.OrderState = require_types.OrderState;
|
|
6
|
+
exports.StreamDisconnectReason = require_types.StreamDisconnectReason;
|
|
7
|
+
exports.StreamEvent = require_types.StreamEvent;
|
|
4
8
|
exports.StreamOperation = require_types.StreamOperation;
|
|
9
|
+
exports.StreamState = require_types.StreamState;
|
|
5
10
|
exports.TokenSource = require_types.TokenSource;
|
|
6
11
|
exports.TokenType = require_types.TokenType;
|
|
7
12
|
exports.TokenVerification = require_types.TokenVerification;
|
package/dist/cjs/types.d.cts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import "./tx_pb-
|
|
2
|
-
import "./any_pb-
|
|
3
|
-
import { _ as
|
|
4
|
-
export { AminoSignResponse, Coin, DirectSignResponse, ExchangePagination, GrpcCoin, OrderMask, OrderMaskMap, PagePagination, Pagination, PaginationOption, SignDoc, StreamOperation, TokenMeta, TokenSource, TokenStatic, TokenType, TokenVerification, TradeDirection, TradeExecutionSide, TradeExecutionType, TxRaw };
|
|
1
|
+
import "./tx_pb-D-cNmrlO.cjs";
|
|
2
|
+
import "./any_pb-CutLnOUR.cjs";
|
|
3
|
+
import { A as ExchangePagination, C as StreamStats, D as TokenStatic, E as TokenSource, M as Pagination, N as PaginationOption, O as TokenType, S as StreamState, T as TokenMeta, _ as StreamError, a as GrpcCoin, b as StreamManagerEvents, c as OrderMask, d as OrderState, f as TradeDirection, g as StreamDisconnectReason, h as ResolvedStreamManagerConfig, i as DirectSignResponse, j as PagePagination, k as TokenVerification, l as OrderMaskMap, m as TradeExecutionType, n as AminoSignResponse, o as SignDoc, p as TradeExecutionSide, r as Coin, s as TxRaw, t as StreamOperation, u as OrderSide, v as StreamEvent, w as StreamSubscription, x as StreamManagerRetryConfig, y as StreamManagerConfig } from "./index-B1AYbshM.cjs";
|
|
4
|
+
export { AminoSignResponse, Coin, DirectSignResponse, ExchangePagination, GrpcCoin, OrderMask, OrderMaskMap, OrderSide, OrderState, PagePagination, Pagination, PaginationOption, ResolvedStreamManagerConfig, SignDoc, StreamDisconnectReason, StreamError, StreamEvent, StreamManagerConfig, StreamManagerEvents, StreamManagerRetryConfig, StreamOperation, StreamState, StreamStats, StreamSubscription, TokenMeta, TokenSource, TokenStatic, TokenType, TokenVerification, TradeDirection, TradeExecutionSide, TradeExecutionType, TxRaw };
|
|
@@ -3,11 +3,113 @@ let viem = require("viem");
|
|
|
3
3
|
let __injectivelabs_utils = require("@injectivelabs/utils");
|
|
4
4
|
let __scure_base = require("@scure/base");
|
|
5
5
|
let __noble_curves_secp256k1 = require("@noble/curves/secp256k1");
|
|
6
|
-
let
|
|
7
|
-
|
|
6
|
+
let __noble_hashes_sha2 = require("@noble/hashes/sha2");
|
|
7
|
+
let __noble_hashes_legacy = require("@noble/hashes/legacy");
|
|
8
8
|
let __injectivelabs_core_proto_ts_v2_generated_cosmos_base_query_v1beta1_pagination_pb = require("@injectivelabs/core-proto-ts-v2/generated/cosmos/base/query/v1beta1/pagination_pb");
|
|
9
9
|
__injectivelabs_core_proto_ts_v2_generated_cosmos_base_query_v1beta1_pagination_pb = require_chunk.__toESM(__injectivelabs_core_proto_ts_v2_generated_cosmos_base_query_v1beta1_pagination_pb);
|
|
10
10
|
|
|
11
|
+
//#region src/utils/helpers.ts
|
|
12
|
+
const isServerSide = () => typeof window === "undefined";
|
|
13
|
+
const isReactNative = () => {
|
|
14
|
+
return typeof document === "undefined" && typeof navigator !== "undefined" && navigator.product === "ReactNative";
|
|
15
|
+
};
|
|
16
|
+
const isNode = () => {
|
|
17
|
+
if (typeof window === "undefined") return true;
|
|
18
|
+
return typeof process !== "undefined" && typeof process.versions !== "undefined" && typeof process.versions.node !== "undefined";
|
|
19
|
+
};
|
|
20
|
+
const isBrowser = () => {
|
|
21
|
+
if (isReactNative()) return false;
|
|
22
|
+
if (isNode()) return false;
|
|
23
|
+
return typeof window !== "undefined";
|
|
24
|
+
};
|
|
25
|
+
const objectToJson = (object, params) => {
|
|
26
|
+
const { replacer, indentation } = params || {
|
|
27
|
+
replacer: void 0,
|
|
28
|
+
indentation: 2
|
|
29
|
+
};
|
|
30
|
+
return safeBigIntStringify(object, replacer, indentation);
|
|
31
|
+
};
|
|
32
|
+
const protoObjectToJson = (object, params) => {
|
|
33
|
+
const { replacer, indentation } = params || {
|
|
34
|
+
replacer: void 0,
|
|
35
|
+
indentation: 2
|
|
36
|
+
};
|
|
37
|
+
if (object.toObject !== void 0) return safeBigIntStringify(object.toObject(), replacer, indentation);
|
|
38
|
+
return objectToJson(object, {
|
|
39
|
+
replacer,
|
|
40
|
+
indentation
|
|
41
|
+
});
|
|
42
|
+
};
|
|
43
|
+
const grpcCoinToUiCoin = (coin) => ({
|
|
44
|
+
amount: coin.amount,
|
|
45
|
+
denom: coin.denom
|
|
46
|
+
});
|
|
47
|
+
const sortObjectByKeysWithReduce = (obj) => {
|
|
48
|
+
if (typeof obj !== "object" || obj === null) return obj;
|
|
49
|
+
if (Array.isArray(obj)) return obj.map((e) => sortObjectByKeysWithReduce(e)).sort();
|
|
50
|
+
return Object.keys(obj).sort().reduce((sorted, k) => {
|
|
51
|
+
const key = k;
|
|
52
|
+
sorted[key] = sortObjectByKeysWithReduce(obj[key]);
|
|
53
|
+
return sorted;
|
|
54
|
+
}, {});
|
|
55
|
+
};
|
|
56
|
+
const sortObjectByKeys = (obj) => {
|
|
57
|
+
if (typeof obj !== "object" || obj === null) return obj;
|
|
58
|
+
if (Array.isArray(obj)) return obj.map(sortObjectByKeys);
|
|
59
|
+
const sortedKeys = Object.keys(obj).sort();
|
|
60
|
+
const result = {};
|
|
61
|
+
sortedKeys.forEach((key) => {
|
|
62
|
+
result[key] = sortObjectByKeys(obj[key]);
|
|
63
|
+
});
|
|
64
|
+
return result;
|
|
65
|
+
};
|
|
66
|
+
const getErrorMessage = (error, endpoint) => {
|
|
67
|
+
if (!error.response) return `The request to ${endpoint} has failed.`;
|
|
68
|
+
return error.response.data ? error.response.data.message || error.response.data : error.response.statusText;
|
|
69
|
+
};
|
|
70
|
+
/**
|
|
71
|
+
* Converts value to it's number representation
|
|
72
|
+
*/
|
|
73
|
+
const hexToNumber = (value) => {
|
|
74
|
+
const [negative, hexValue] = value.startsWith("-") ? [true, value.slice(1)] : [false, value];
|
|
75
|
+
const num = BigInt(hexValue);
|
|
76
|
+
if (num > Number.MAX_SAFE_INTEGER) return Number(negative ? -num : num);
|
|
77
|
+
if (num < Number.MIN_SAFE_INTEGER) return Number(num);
|
|
78
|
+
return negative ? -1 * Number(num) : Number(num);
|
|
79
|
+
};
|
|
80
|
+
function isJsonString(str) {
|
|
81
|
+
if (typeof str !== "string") return false;
|
|
82
|
+
try {
|
|
83
|
+
JSON.parse(str);
|
|
84
|
+
} catch (_unused) {
|
|
85
|
+
return false;
|
|
86
|
+
}
|
|
87
|
+
return true;
|
|
88
|
+
}
|
|
89
|
+
/**
|
|
90
|
+
* BigInt-safe JSON replacer function.
|
|
91
|
+
* Converts BigInt values to strings during JSON serialization.
|
|
92
|
+
*/
|
|
93
|
+
const bigIntReplacer = (_key, value) => typeof value === "bigint" ? value.toString() : value;
|
|
94
|
+
/**
|
|
95
|
+
* Stringify an object to JSON with BigInt support.
|
|
96
|
+
* Converts BigInt values to strings during serialization to prevent
|
|
97
|
+
* "Do not know how to serialize a BigInt" errors.
|
|
98
|
+
*
|
|
99
|
+
* @param value - The value to serialize
|
|
100
|
+
* @param replacer - Optional custom replacer function (BigInt handling is applied first)
|
|
101
|
+
* @param space - Optional indentation for pretty printing
|
|
102
|
+
* @returns JSON string
|
|
103
|
+
*/
|
|
104
|
+
const safeBigIntStringify = (value, replacer, space) => {
|
|
105
|
+
const combinedReplacer = (key, val) => {
|
|
106
|
+
const bigIntHandled = bigIntReplacer(key, val);
|
|
107
|
+
return replacer ? replacer(key, bigIntHandled) : bigIntHandled;
|
|
108
|
+
};
|
|
109
|
+
return JSON.stringify(value, combinedReplacer, space);
|
|
110
|
+
};
|
|
111
|
+
|
|
112
|
+
//#endregion
|
|
11
113
|
//#region src/utils/encoding.ts
|
|
12
114
|
/**
|
|
13
115
|
* Encoding/decoding utilities using industry-standard libraries
|
|
@@ -146,7 +248,7 @@ function binaryToBase64(data) {
|
|
|
146
248
|
* @returns Base64 encoded string
|
|
147
249
|
*/
|
|
148
250
|
function toBase64(data) {
|
|
149
|
-
return uint8ArrayToBase64(stringToUint8Array(
|
|
251
|
+
return uint8ArrayToBase64(stringToUint8Array(safeBigIntStringify(data)));
|
|
150
252
|
}
|
|
151
253
|
/**
|
|
152
254
|
* Convert a base64 string to JSON object
|
|
@@ -320,7 +422,7 @@ const parseCoins = (input) => {
|
|
|
320
422
|
* @returns Uppercase hex string
|
|
321
423
|
*/
|
|
322
424
|
const hashToHex = (data) => {
|
|
323
|
-
return
|
|
425
|
+
return uint8ArrayToHex((0, __noble_hashes_sha2.sha256)(base64ToUint8Array(data))).toUpperCase();
|
|
324
426
|
};
|
|
325
427
|
/**
|
|
326
428
|
* Compute SHA256 hash of Uint8Array data
|
|
@@ -328,8 +430,7 @@ const hashToHex = (data) => {
|
|
|
328
430
|
* @returns SHA256 hash as Uint8Array
|
|
329
431
|
*/
|
|
330
432
|
const sha256 = (data) => {
|
|
331
|
-
|
|
332
|
-
return hexToUint8Array(crypto_js.default.SHA256(wordArray).toString());
|
|
433
|
+
return (0, __noble_hashes_sha2.sha256)(data);
|
|
333
434
|
};
|
|
334
435
|
/**
|
|
335
436
|
* Compute RIPEMD160 hash of Uint8Array data
|
|
@@ -337,8 +438,7 @@ const sha256 = (data) => {
|
|
|
337
438
|
* @returns RIPEMD160 hash as Uint8Array
|
|
338
439
|
*/
|
|
339
440
|
const ripemd160 = (data) => {
|
|
340
|
-
|
|
341
|
-
return hexToUint8Array(crypto_js.default.RIPEMD160(wordArray).toString());
|
|
441
|
+
return (0, __noble_hashes_legacy.ripemd160)(data);
|
|
342
442
|
};
|
|
343
443
|
/**
|
|
344
444
|
* Derive public key from private key
|
|
@@ -465,86 +565,6 @@ const TypedDataUtilsSanitizeData = sanitizeTypedData;
|
|
|
465
565
|
const TypedDataUtilsHashStruct = hashStruct;
|
|
466
566
|
const SignTypedDataVersionV4 = "V4";
|
|
467
567
|
|
|
468
|
-
//#endregion
|
|
469
|
-
//#region src/utils/helpers.ts
|
|
470
|
-
const isServerSide = () => typeof window === "undefined";
|
|
471
|
-
const isReactNative = () => {
|
|
472
|
-
return typeof document === "undefined" && typeof navigator !== "undefined" && navigator.product === "ReactNative";
|
|
473
|
-
};
|
|
474
|
-
const isNode = () => {
|
|
475
|
-
if (typeof window === "undefined") return true;
|
|
476
|
-
return typeof process !== "undefined" && typeof process.versions !== "undefined" && typeof process.versions.node !== "undefined";
|
|
477
|
-
};
|
|
478
|
-
const isBrowser = () => {
|
|
479
|
-
if (isReactNative()) return false;
|
|
480
|
-
if (isNode()) return false;
|
|
481
|
-
return typeof window !== "undefined";
|
|
482
|
-
};
|
|
483
|
-
const objectToJson = (object, params) => {
|
|
484
|
-
const { replacer, indentation } = params || {
|
|
485
|
-
replacer: null,
|
|
486
|
-
indentation: 2
|
|
487
|
-
};
|
|
488
|
-
return JSON.stringify(object, replacer, indentation);
|
|
489
|
-
};
|
|
490
|
-
const protoObjectToJson = (object, params) => {
|
|
491
|
-
const { replacer, indentation } = params || {
|
|
492
|
-
replacer: null,
|
|
493
|
-
indentation: 2
|
|
494
|
-
};
|
|
495
|
-
if (object.toObject !== void 0) return JSON.stringify(object.toObject(), replacer, indentation);
|
|
496
|
-
return objectToJson(object, {
|
|
497
|
-
replacer,
|
|
498
|
-
indentation
|
|
499
|
-
});
|
|
500
|
-
};
|
|
501
|
-
const grpcCoinToUiCoin = (coin) => ({
|
|
502
|
-
amount: coin.amount,
|
|
503
|
-
denom: coin.denom
|
|
504
|
-
});
|
|
505
|
-
const sortObjectByKeysWithReduce = (obj) => {
|
|
506
|
-
if (typeof obj !== "object" || obj === null) return obj;
|
|
507
|
-
if (Array.isArray(obj)) return obj.map((e) => sortObjectByKeysWithReduce(e)).sort();
|
|
508
|
-
return Object.keys(obj).sort().reduce((sorted, k) => {
|
|
509
|
-
const key = k;
|
|
510
|
-
sorted[key] = sortObjectByKeysWithReduce(obj[key]);
|
|
511
|
-
return sorted;
|
|
512
|
-
}, {});
|
|
513
|
-
};
|
|
514
|
-
const sortObjectByKeys = (obj) => {
|
|
515
|
-
if (typeof obj !== "object" || obj === null) return obj;
|
|
516
|
-
if (Array.isArray(obj)) return obj.map(sortObjectByKeys);
|
|
517
|
-
const sortedKeys = Object.keys(obj).sort();
|
|
518
|
-
const result = {};
|
|
519
|
-
sortedKeys.forEach((key) => {
|
|
520
|
-
result[key] = sortObjectByKeys(obj[key]);
|
|
521
|
-
});
|
|
522
|
-
return result;
|
|
523
|
-
};
|
|
524
|
-
const getErrorMessage = (error, endpoint) => {
|
|
525
|
-
if (!error.response) return `The request to ${endpoint} has failed.`;
|
|
526
|
-
return error.response.data ? error.response.data.message || error.response.data : error.response.statusText;
|
|
527
|
-
};
|
|
528
|
-
/**
|
|
529
|
-
* Converts value to it's number representation
|
|
530
|
-
*/
|
|
531
|
-
const hexToNumber = (value) => {
|
|
532
|
-
const [negative, hexValue] = value.startsWith("-") ? [true, value.slice(1)] : [false, value];
|
|
533
|
-
const num = BigInt(hexValue);
|
|
534
|
-
if (num > Number.MAX_SAFE_INTEGER) return Number(negative ? -num : num);
|
|
535
|
-
if (num < Number.MIN_SAFE_INTEGER) return Number(num);
|
|
536
|
-
return negative ? -1 * Number(num) : Number(num);
|
|
537
|
-
};
|
|
538
|
-
function isJsonString(str) {
|
|
539
|
-
if (typeof str !== "string") return false;
|
|
540
|
-
try {
|
|
541
|
-
JSON.parse(str);
|
|
542
|
-
} catch (_unused) {
|
|
543
|
-
return false;
|
|
544
|
-
}
|
|
545
|
-
return true;
|
|
546
|
-
}
|
|
547
|
-
|
|
548
568
|
//#endregion
|
|
549
569
|
//#region src/utils/numbers.ts
|
|
550
570
|
const $BigNumber = __injectivelabs_utils.BigNumber.clone({ ROUNDING_MODE: __injectivelabs_utils.BigNumber.ROUND_DOWN });
|
|
@@ -1184,6 +1204,12 @@ Object.defineProperty(exports, 'base64ToUtf8', {
|
|
|
1184
1204
|
return base64ToUtf8;
|
|
1185
1205
|
}
|
|
1186
1206
|
});
|
|
1207
|
+
Object.defineProperty(exports, 'bigIntReplacer', {
|
|
1208
|
+
enumerable: true,
|
|
1209
|
+
get: function () {
|
|
1210
|
+
return bigIntReplacer;
|
|
1211
|
+
}
|
|
1212
|
+
});
|
|
1187
1213
|
Object.defineProperty(exports, 'binaryToBase64', {
|
|
1188
1214
|
enumerable: true,
|
|
1189
1215
|
get: function () {
|
|
@@ -1658,6 +1684,12 @@ Object.defineProperty(exports, 'ripemd160', {
|
|
|
1658
1684
|
return ripemd160;
|
|
1659
1685
|
}
|
|
1660
1686
|
});
|
|
1687
|
+
Object.defineProperty(exports, 'safeBigIntStringify', {
|
|
1688
|
+
enumerable: true,
|
|
1689
|
+
get: function () {
|
|
1690
|
+
return safeBigIntStringify;
|
|
1691
|
+
}
|
|
1692
|
+
});
|
|
1661
1693
|
Object.defineProperty(exports, 'sanitizeTypedData', {
|
|
1662
1694
|
enumerable: true,
|
|
1663
1695
|
get: function () {
|
package/dist/cjs/utils.cjs
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
const require_chunk = require('./chunk-CbDLau6x.cjs');
|
|
2
|
-
const require_utils = require('./utils-
|
|
2
|
+
const require_utils = require('./utils-V1uXtT51.cjs');
|
|
3
3
|
const require_time = require('./time-B4xLc27Y.cjs');
|
|
4
4
|
const require_grpc = require('./grpc-DQDVCGpY.cjs');
|
|
5
5
|
let __protobuf_ts_grpcweb_transport = require("@protobuf-ts/grpcweb-transport");
|
|
@@ -20,6 +20,7 @@ exports.addHexPrefix = require_utils.addHexPrefix;
|
|
|
20
20
|
exports.amountToCosmosSdkDecAmount = require_utils.amountToCosmosSdkDecAmount;
|
|
21
21
|
exports.base64ToUint8Array = require_utils.base64ToUint8Array;
|
|
22
22
|
exports.base64ToUtf8 = require_utils.base64ToUtf8;
|
|
23
|
+
exports.bigIntReplacer = require_utils.bigIntReplacer;
|
|
23
24
|
exports.binaryToBase64 = require_utils.binaryToBase64;
|
|
24
25
|
exports.concatUint8Arrays = require_utils.concatUint8Arrays;
|
|
25
26
|
exports.cosmosSdkDecToBigNumber = require_utils.cosmosSdkDecToBigNumber;
|
|
@@ -107,6 +108,7 @@ exports.publicKeyToAddress = require_utils.publicKeyToAddress;
|
|
|
107
108
|
exports.recoverTypedSignaturePubKey = require_utils.recoverTypedSignaturePubKey;
|
|
108
109
|
exports.removeHexPrefix = require_utils.removeHexPrefix;
|
|
109
110
|
exports.ripemd160 = require_utils.ripemd160;
|
|
111
|
+
exports.safeBigIntStringify = require_utils.safeBigIntStringify;
|
|
110
112
|
exports.sanitizeTypedData = require_utils.sanitizeTypedData;
|
|
111
113
|
exports.sha256 = require_utils.sha256;
|
|
112
114
|
exports.sortObjectByKeys = require_utils.sortObjectByKeys;
|
package/dist/cjs/utils.d.cts
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
import "./tx_pb-
|
|
1
|
+
import "./tx_pb-D-cNmrlO.cjs";
|
|
2
2
|
import "./BaseGrpcConsumer-PDufF0fz.cjs";
|
|
3
3
|
import "./index-B19YRG03.cjs";
|
|
4
|
-
import "./any_pb-
|
|
5
|
-
import { $c as
|
|
6
|
-
import "./index-
|
|
7
|
-
import "./index-
|
|
8
|
-
import "./index-
|
|
9
|
-
import "./index-
|
|
10
|
-
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, 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, sanitizeTypedData, sha256, sortObjectByKeys, sortObjectByKeysWithReduce, spotPriceFromChainPrice, spotPriceFromChainPriceToFixed, spotPriceToChainPrice, spotPriceToChainPriceToFixed, spotQuantityFromChainQuantity, spotQuantityFromChainQuantityToFixed, spotQuantityToChainQuantity, spotQuantityToChainQuantityToFixed, stringToUint8Array, toBase64, toUtf8, uint8ArrayToBase64, uint8ArrayToHex, uint8ArrayToString };
|
|
4
|
+
import "./any_pb-CutLnOUR.cjs";
|
|
5
|
+
import { $c as grpcPagingToPagingV2, $l as derivativePriceToChainPrice, $u as sha256, Al as getInjectiveAddress, Au as isNode, Bl as cosmosSdkDecToBigNumber, Bu as TypedDataUtilsSanitizeData, Cl as uint8ArrayToHex, Cu as spotQuantityToChainQuantityToFixed, Dl as getChecksumAddress, Du as hexToNumber, El as getAddressFromInjectiveAddress, Eu as grpcCoinToUiCoin, Fl as getDerivativeMarketDecimals, Fu as safeBigIntStringify, Gl as denomAmountToChainDenomAmountToFixed, Gu as messageHash, Hl as denomAmountFromChainDenomAmountToFixed, Hu as decompressPubKey, Il as getDerivativeMarketTensMultiplier, Iu as sortObjectByKeys, Jl as derivativeMarginFromChainMarginToFixed, Ju as privateKeyToPublicKey, Kl as denomAmountToGrpcChainDenomAmount, Ku as privateKeyHashToPublicKey, Ll as getSpotMarketDecimals, Lu as sortObjectByKeysWithReduce, Ml as getSubaccountId, Mu as isServerSide, Nl as isCw20ContractAddress, Nu as objectToJson, Ol as getDefaultSubaccountId, Ou as isBrowser, Pl as removeHexPrefix, Pu as protoObjectToJson, Qc as grpcPagingToPaging, Ql as derivativePriceFromChainPriceToFixed, Qu as sanitizeTypedData, Rl as getSpotMarketTensMultiplier, Ru as SignTypedDataVersionV4, Sl as uint8ArrayToBase64, Su as spotQuantityToChainQuantity, Tl as addHexPrefix, Tu as getErrorMessage, Ul as denomAmountFromGrpcChainDenomAmount, Uu as domainHash, Vl as denomAmountFromChainDenomAmount, Vu as TypedMessageV4, Wl as denomAmountToChainDenomAmount, Wu as hashToHex, Xc as fetchAllWithPagination, Xl as derivativeMarginToChainMarginToFixed, Xu as publicKeyToAddress, Yc as recoverTypedSignaturePubKey, Yl as derivativeMarginToChainMargin, Yu as privateKeyToPublicKeyBase64, Zc as grpcPaginationToPagination, Zl as derivativePriceFromChainPrice, Zu as ripemd160, _l as hexToBuff, _u as spotPriceFromChainPriceToFixed, ad as makeTimeoutTimestamp, al as BECH32_ADDR_VAL_PREFIX, au as formatAmountToAllowableAmount, bl as toBase64, bu as spotQuantityFromChainQuantity, cd as protobufTimestampToUnixMs, cl as BECH32_PUBKEY_VAL_PREFIX, cu as formatNumberToAllowableTensMultiplier, dl as base64ToUtf8, du as getExactDecimalsFromNumber, ed as parseCoins, 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 getGasPriceBasedOnMessage, il as BECH32_ADDR_CONS_PREFIX, iu as derivativeQuantityToChainQuantityToFixed, jl as getInjectiveAddressFromSubaccountId, ju as isReactNative, kl as getEthereumAddress, ku as isJsonString, ld as protobufTimestampToUnixSeconds, ll as DEFAULT_DERIVATION_PATH, lu as formatPriceToAllowableDecimals, ml as fromBase64, mu as isNumber, nd as getGrpcWebTransport, nl as paginationUint8ArrayToString, nu as derivativeQuantityFromChainQuantityToFixed, od as makeTimeoutTimestampInNs, ol as BECH32_PUBKEY_ACC_PREFIX, ou as formatAmountToAllowableDecimals, pl as concatUint8Arrays, pu as getTensMultiplier, ql as derivativeMarginFromChainMargin, qu as privateKeyHashToPublicKeyBase64, rd as GrpcWebFetchTransport, rl as BECH32_ADDR_ACC_PREFIX, ru as derivativeQuantityToChainQuantity, sd as protobufTimestampToDate, sl as BECH32_PUBKEY_CONS_PREFIX, su as formatNumberToAllowableDecimals, td as ofacList, tl as paginationRequestFromPagination, tu as derivativeQuantityFromChainQuantity, 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 TypedDataUtilsHashStruct } from "./index-DDQzXOux.cjs";
|
|
6
|
+
import "./index-B8XmWgDc.cjs";
|
|
7
|
+
import "./index-B1AYbshM.cjs";
|
|
8
|
+
import "./index-D__cYp7U.cjs";
|
|
9
|
+
import "./index-FEXnDdOc.cjs";
|
|
10
|
+
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, 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,6 +1,6 @@
|
|
|
1
|
-
import { O as denomAmountFromGrpcChainDenomAmount } from "./utils-
|
|
1
|
+
import { O as denomAmountFromGrpcChainDenomAmount } from "./utils-DwGoPRTL.js";
|
|
2
2
|
import { t as _defineProperty } from "./defineProperty-Bq6QU9Te.js";
|
|
3
|
-
import { o as ChainModule } from "./ChainRestTendermintApi-
|
|
3
|
+
import { o as ChainModule } from "./ChainRestTendermintApi-CMrAg0Zm.js";
|
|
4
4
|
import { t as BaseGrpcConsumer } from "./BaseGrpcConsumer-DptVGP0n.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";
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { Jt as uint8ArrayToString, Kt as uint8ArrayToBase64, l as ChainGrpcCommonTransformer } from "./utils-DwGoPRTL.js";
|
|
2
2
|
import { t as _defineProperty } from "./defineProperty-Bq6QU9Te.js";
|
|
3
3
|
import { t as BaseGrpcConsumer } from "./BaseGrpcConsumer-DptVGP0n.js";
|
|
4
4
|
import { t as BaseRestConsumer } from "./BaseRestConsumer-rK4eS4W8.js";
|
package/dist/esm/{DirectEthSecp256k1Wallet-3qFMEHzf.js → DirectEthSecp256k1Wallet-a9KiF9fA.js}
RENAMED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { Kt as
|
|
1
|
+
import { Kt as uint8ArrayToBase64, Pt as base64ToUint8Array, qt as uint8ArrayToHex } from "./utils-DwGoPRTL.js";
|
|
2
2
|
import { t as _defineProperty } from "./defineProperty-Bq6QU9Te.js";
|
|
3
|
-
import { O as getPublicKey, P as PublicKey, n as PrivateKey } from "./accounts-
|
|
3
|
+
import { O as getPublicKey, P as PublicKey, n as PrivateKey } from "./accounts-DFC9RYDH.js";
|
|
4
4
|
import * as CosmosBaseV1Beta1CoinPb from "@injectivelabs/core-proto-ts-v2/generated/cosmos/base/v1beta1/coin_pb";
|
|
5
5
|
import * as InjectiveTypesV1Beta1AccountPb from "@injectivelabs/core-proto-ts-v2/generated/injective/types/v1beta1/account_pb";
|
|
6
6
|
import * as IbcCoreClientV1ClientPb from "@injectivelabs/core-proto-ts-v2/generated/ibc/core/client/v1/client_pb";
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { Wt as toBase64, on as safeBigIntStringify, zt as fromUtf8 } from "./utils-DwGoPRTL.js";
|
|
2
2
|
import { t as _defineProperty } from "./defineProperty-Bq6QU9Te.js";
|
|
3
|
-
import { t as MsgBase } from "./MsgBase-
|
|
3
|
+
import { t as MsgBase } from "./MsgBase-BkRgVbdY.js";
|
|
4
4
|
import { GeneralException } from "@injectivelabs/exceptions";
|
|
5
5
|
import * as InjectiveWasmxV1TxPb from "@injectivelabs/core-proto-ts-v2/generated/injective/wasmx/v1/tx_pb";
|
|
6
6
|
|
|
@@ -14,10 +14,10 @@ var ExecArgBase = class {
|
|
|
14
14
|
this.params = params;
|
|
15
15
|
}
|
|
16
16
|
toJSON() {
|
|
17
|
-
return fromUtf8(
|
|
17
|
+
return fromUtf8(safeBigIntStringify(this.params));
|
|
18
18
|
}
|
|
19
19
|
toExecJSON() {
|
|
20
|
-
return fromUtf8(
|
|
20
|
+
return fromUtf8(safeBigIntStringify(this.toExecData()));
|
|
21
21
|
}
|
|
22
22
|
};
|
|
23
23
|
|
|
@@ -54,7 +54,7 @@ var MsgExecuteContractCompat = class MsgExecuteContractCompat extends MsgBase {
|
|
|
54
54
|
return InjectiveWasmxV1TxPb.MsgExecuteContractCompat.create({
|
|
55
55
|
sender: params.sender,
|
|
56
56
|
contract: params.contractAddress,
|
|
57
|
-
msg:
|
|
57
|
+
msg: safeBigIntStringify(msg),
|
|
58
58
|
funds
|
|
59
59
|
});
|
|
60
60
|
}
|
|
@@ -72,7 +72,7 @@ var MsgExecuteContractCompat = class MsgExecuteContractCompat extends MsgBase {
|
|
|
72
72
|
value: {
|
|
73
73
|
sender: proto.sender,
|
|
74
74
|
contract: proto.contract,
|
|
75
|
-
msg:
|
|
75
|
+
msg: safeBigIntStringify(this.getMsgObject()),
|
|
76
76
|
funds: proto.funds
|
|
77
77
|
}
|
|
78
78
|
};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { Pt as base64ToUint8Array, Ut as stringToUint8Array, on as safeBigIntStringify, qt as uint8ArrayToHex, t as recoverTypedSignaturePubKey } from "./utils-DwGoPRTL.js";
|
|
2
2
|
import { t as _defineProperty } from "./defineProperty-Bq6QU9Te.js";
|
|
3
3
|
import { t as BaseIndexerGrpcConsumer } from "./BaseIndexerGrpcConsumer-CjpUoGXy.js";
|
|
4
4
|
import * as CosmosTxV1Beta1TxPb from "@injectivelabs/core-proto-ts-v2/generated/cosmos/tx/v1beta1/tx_pb";
|
|
@@ -93,7 +93,7 @@ var IndexerGrpcTransactionApi = class extends BaseIndexerGrpcConsumer {
|
|
|
93
93
|
prepareTxRequest.chainId = BigInt(chainId);
|
|
94
94
|
prepareTxRequest.signerAddress = address;
|
|
95
95
|
prepareTxRequest.fee = cosmosTxFee;
|
|
96
|
-
prepareTxRequest.msgs = (Array.isArray(message) ? message : [message]).map((message$1) => stringToUint8Array(
|
|
96
|
+
prepareTxRequest.msgs = (Array.isArray(message) ? message : [message]).map((message$1) => stringToUint8Array(safeBigIntStringify(message$1)));
|
|
97
97
|
if (timeoutHeight !== void 0) prepareTxRequest.timeoutHeight = BigInt(timeoutHeight);
|
|
98
98
|
if (memo) prepareTxRequest.memo = typeof memo === "number" ? memo.toString() : memo;
|
|
99
99
|
return await this.executeGrpcCall(prepareTxRequest, this.client.prepareTx.bind(this.client));
|
|
@@ -114,7 +114,7 @@ var IndexerGrpcTransactionApi = class extends BaseIndexerGrpcConsumer {
|
|
|
114
114
|
const prepareTxRequest = InjectiveExchangeRpcPb.PrepareCosmosTxRequest.create();
|
|
115
115
|
prepareTxRequest.fee = cosmosTxFee;
|
|
116
116
|
prepareTxRequest.senderAddress = address;
|
|
117
|
-
prepareTxRequest.msgs = (Array.isArray(message) ? message : [message]).map((message$1) => stringToUint8Array(
|
|
117
|
+
prepareTxRequest.msgs = (Array.isArray(message) ? message : [message]).map((message$1) => stringToUint8Array(safeBigIntStringify(message$1)));
|
|
118
118
|
if (timeoutHeight !== void 0) prepareTxRequest.timeoutHeight = BigInt(timeoutHeight);
|
|
119
119
|
if (memo) prepareTxRequest.memo = typeof memo === "number" ? memo.toString() : memo;
|
|
120
120
|
return await this.executeGrpcCall(prepareTxRequest, this.client.prepareCosmosTx.bind(this.client));
|
|
@@ -146,10 +146,10 @@ var IndexerGrpcTransactionApi = class extends BaseIndexerGrpcConsumer {
|
|
|
146
146
|
broadcastTxRequest.chainId = BigInt(chainId);
|
|
147
147
|
broadcastTxRequest.pubKey = cosmosPubKey;
|
|
148
148
|
broadcastTxRequest.signature = signature;
|
|
149
|
-
broadcastTxRequest.tx = stringToUint8Array(
|
|
149
|
+
broadcastTxRequest.tx = stringToUint8Array(safeBigIntStringify(parsedTypedData.message));
|
|
150
150
|
broadcastTxRequest.feePayer = txResponse.feePayer;
|
|
151
151
|
broadcastTxRequest.feePayerSig = txResponse.feePayerSig;
|
|
152
|
-
broadcastTxRequest.msgs = (Array.isArray(message) ? message : [message]).map((message$1) => stringToUint8Array(
|
|
152
|
+
broadcastTxRequest.msgs = (Array.isArray(message) ? message : [message]).map((message$1) => stringToUint8Array(safeBigIntStringify(message$1)));
|
|
153
153
|
return await this.executeGrpcCall(broadcastTxRequest, this.client.broadcastTx.bind(this.client));
|
|
154
154
|
}
|
|
155
155
|
/**
|
|
@@ -200,7 +200,7 @@ var IndexerGrpcWeb3GwApi = class extends IndexerGrpcTransactionApi {
|
|
|
200
200
|
prepareTxRequest.chainId = BigInt(chainId);
|
|
201
201
|
prepareTxRequest.signerAddress = address;
|
|
202
202
|
prepareTxRequest.fee = cosmosTxFee;
|
|
203
|
-
prepareTxRequest.msgs = (Array.isArray(message) ? message : [message]).map((message$1) => stringToUint8Array(
|
|
203
|
+
prepareTxRequest.msgs = (Array.isArray(message) ? message : [message]).map((message$1) => stringToUint8Array(safeBigIntStringify(message$1)));
|
|
204
204
|
if (timeoutHeight !== void 0) prepareTxRequest.timeoutHeight = BigInt(timeoutHeight);
|
|
205
205
|
if (memo) prepareTxRequest.memo = typeof memo === "number" ? memo.toString() : memo;
|
|
206
206
|
if (eip712Version) prepareTxRequest.eip712Wrapper = eip712Version;
|
|
@@ -345,6 +345,7 @@ const protoTypeToAminoType = (type) => {
|
|
|
345
345
|
//#region src/core/modules/utils.ts
|
|
346
346
|
function prepareSignBytes(obj) {
|
|
347
347
|
if (Array.isArray(obj)) return obj.map(prepareSignBytes);
|
|
348
|
+
if (typeof obj === "bigint") return obj.toString();
|
|
348
349
|
if (typeof obj !== `object` || obj === null) return obj;
|
|
349
350
|
const sorted = {};
|
|
350
351
|
Object.keys(obj).sort().forEach((key) => {
|