@injectivelabs/sdk-ts 1.20.15 → 1.20.16
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-xrQAr-fH.cjs → AbacusGrpcApi-CIMZFwl6.cjs} +2 -2
- package/dist/cjs/{BaseGrpcConsumer-DHYpiqn5.cjs → BaseGrpcConsumer-BCGDaVy8.cjs} +24 -24
- package/dist/cjs/{BaseGrpcConsumer-CgIbwIvJ.d.cts → BaseGrpcConsumer-CrbGIyOg.d.cts} +1 -1
- package/dist/cjs/{BaseIndexerGrpcConsumer-GHyeUHdH.cjs → BaseIndexerGrpcConsumer-CoMGNooL.cjs} +1 -1
- package/dist/cjs/{ChainGrpcExchangeApi-MspF9deW.cjs → ChainGrpcExchangeApi-ChrfB9cv.cjs} +4 -4
- package/dist/cjs/{ChainRestTendermintApi-TZoqfN-E.cjs → ChainRestTendermintApi-utYZ9cZL.cjs} +7 -6
- package/dist/cjs/{DirectEthSecp256k1Wallet-D_rQWJR4.cjs → DirectEthSecp256k1Wallet-CbsATe2T.cjs} +14 -14
- package/dist/cjs/{ExecArgNeptuneWithdraw-ChJ7QUin.cjs → ExecArgNeptuneWithdraw-Sqk_zPQx.cjs} +7 -6
- package/dist/cjs/{IndexerGrpcWeb3GwApi-Cj9gotHt.cjs → IndexerGrpcWeb3GwApi-Di6ko7ub.cjs} +11 -10
- package/dist/cjs/{MsgBase-CAiwUyBz.cjs → MsgBase-BJmf0IHm.cjs} +1 -1
- package/dist/cjs/{MsgSetDenomMetadata-BDNtlSxx.cjs → MsgSetDenomMetadata-ycI5AKU4.cjs} +33 -31
- package/dist/cjs/{OLPGrpcApi-BqcMEdma.cjs → OLPGrpcApi-fdkKcWVJ.cjs} +2 -2
- package/dist/cjs/{QueryTradingStrategyContractTotalStrategies-CbfuOlxa.cjs → QueryTradingStrategyContractTotalStrategies-CIlJC3Cq.cjs} +29 -29
- package/dist/cjs/{StreamManagerV2-Bo7m_nUZ.cjs → StreamManagerV2-B3ar_Wxz.cjs} +72 -71
- package/dist/cjs/{TcAbacusGrpcApi-7a0vFnWK.cjs → TcAbacusGrpcApi-B7wlTqfE.cjs} +2 -2
- package/dist/cjs/{accounts-gu3aR3dJ.cjs → accounts-pXwUOxWb.cjs} +38 -35
- package/dist/cjs/address-light-B5-DYwES.d.cts +14 -0
- package/dist/cjs/address-light-C_a6b8yF.cjs +114 -0
- package/dist/cjs/{chain-lo3Cyc0M.cjs → chain-D--KOL1m.cjs} +36 -35
- package/dist/cjs/client/abacus.cjs +6 -5
- package/dist/cjs/client/abacus.d.cts +5 -4
- package/dist/cjs/client/chain.cjs +14 -9
- package/dist/cjs/client/chain.d.cts +14 -9
- package/dist/cjs/client/indexer.cjs +15 -10
- package/dist/cjs/client/indexer.d.cts +14 -9
- package/dist/cjs/client/olp.cjs +7 -6
- package/dist/cjs/client/olp.d.cts +5 -4
- package/dist/cjs/client/tcAbacus.cjs +6 -5
- package/dist/cjs/client/tcAbacus.d.cts +5 -4
- package/dist/cjs/client/wasm.cjs +17 -12
- package/dist/cjs/client/wasm.d.cts +4 -3
- package/dist/cjs/coins-DRrEtaSG.cjs +20 -0
- package/dist/cjs/coins-JbAREn6e.d.cts +7 -0
- package/dist/cjs/constants-DSzHAIp3.d.cts +10 -0
- package/dist/cjs/constants-tPGACRGC.cjs +53 -0
- package/dist/cjs/core/accounts.cjs +9 -5
- package/dist/cjs/core/accounts.d.cts +14 -9
- package/dist/cjs/core/modules.cjs +20 -15
- package/dist/cjs/core/modules.d.cts +14 -9
- package/dist/cjs/core/tx.cjs +17 -12
- package/dist/cjs/core/tx.d.cts +14 -9
- package/dist/cjs/cosmjs.cjs +18 -13
- package/dist/cjs/cosmjs.d.cts +2 -2
- package/dist/cjs/encoding-light-CrQ0cICT.d.cts +18 -0
- package/dist/cjs/encoding-light-D96nxVLW.cjs +176 -0
- package/dist/cjs/exports.cjs +18 -13
- package/dist/cjs/exports.d.cts +2 -2
- package/dist/cjs/{index-DiXeIFAS.d.cts → index-BINBkEIb.d.cts} +1 -1
- package/dist/cjs/{index-D3pv75E_.d.cts → index-BaPRB8bU.d.cts} +1 -1
- package/dist/cjs/{index-uJW9LUqV.d.cts → index-C4k2HkhI.d.cts} +1 -1
- package/dist/{esm/index-DCxzFRMk.d.ts → cjs/index-CBmgjh-q.d.cts} +3 -146
- package/dist/cjs/{index-DfNpbUN6.d.cts → index-DE9mGZGH.d.cts} +1 -1
- package/dist/{esm/index-Bw9qjGRX.d.ts → cjs/index-eG3KUAK0.d.cts} +2 -1
- package/dist/cjs/{index-Ckay0hId.d.cts → index-i4yKnGpI.d.cts} +2 -2
- package/dist/cjs/{index-BEK8esHW.d.cts → index-nXX5E77u.d.cts} +8 -189
- package/dist/cjs/index.cjs +74 -67
- package/dist/cjs/index.d.cts +15 -10
- package/dist/cjs/light-BhvqsgHj.d.cts +119 -0
- package/dist/cjs/{types-Cn54Lzf-.cjs → light-Qbh16DQE.cjs} +72 -58
- package/dist/cjs/proto/cosmos-tx.d.cts +1 -1
- package/dist/cjs/{service-2B8kFWdK.cjs → service-WTWXJzS1.cjs} +18 -18
- package/dist/cjs/service.cjs +11 -6
- package/dist/cjs/service.d.cts +4 -3
- package/dist/cjs/stream-CcqYpdwJ.cjs +20 -0
- package/dist/cjs/{tx-C2jfAA8Y.cjs → tx-eQttrX5b.cjs} +14 -13
- package/dist/cjs/types/light.cjs +13 -0
- package/dist/cjs/types/light.d.cts +2 -0
- package/dist/cjs/types-BJpWW-Rx.cjs +37 -0
- package/dist/cjs/types.cjs +14 -13
- package/dist/cjs/types.d.cts +3 -2
- package/dist/cjs/utils/address.cjs +13 -0
- package/dist/cjs/utils/address.d.cts +2 -0
- package/dist/cjs/utils/constants.cjs +9 -0
- package/dist/cjs/utils/constants.d.cts +2 -0
- package/dist/cjs/utils/encoding.cjs +17 -0
- package/dist/cjs/utils/encoding.d.cts +2 -0
- package/dist/cjs/utils/light.cjs +39 -0
- package/dist/cjs/utils/light.d.cts +5 -0
- package/dist/cjs/{utils-DbzXsOHS.cjs → utils-CH1Ojxun.cjs} +132 -592
- package/dist/cjs/utils.cjs +40 -34
- package/dist/cjs/utils.d.cts +15 -10
- package/dist/esm/{AbacusGrpcApi-CtwUxhbH.js → AbacusGrpcApi-DVniM62M.js} +2 -2
- package/dist/esm/{BaseGrpcConsumer-C8YhjVn6.d.ts → BaseGrpcConsumer-B9J3abKI.d.ts} +1 -1
- package/dist/esm/{BaseGrpcConsumer-C2_ejXG6.js → BaseGrpcConsumer-D-uEnIgH.js} +3 -3
- package/dist/esm/{BaseIndexerGrpcConsumer-B7ubNh4y.js → BaseIndexerGrpcConsumer-BUcOBQHD.js} +1 -1
- package/dist/esm/{ChainGrpcExchangeApi-46tg3Hzg.js → ChainGrpcExchangeApi-CT0WW59O.js} +4 -4
- package/dist/esm/{ChainRestTendermintApi-J6BTcNft.js → ChainRestTendermintApi-C5sizTTA.js} +5 -4
- package/dist/esm/{DirectEthSecp256k1Wallet-DOuSBBhp.js → DirectEthSecp256k1Wallet-Daky9CEn.js} +3 -3
- package/dist/esm/{ExecArgNeptuneWithdraw-DiiRJIyN.js → ExecArgNeptuneWithdraw-ljDnPI2p.js} +4 -3
- package/dist/esm/{IndexerGrpcWeb3GwApi-43sbzWOe.js → IndexerGrpcWeb3GwApi-D9GO0m1v.js} +4 -3
- package/dist/esm/{MsgBase-C7o5mYq2.js → MsgBase-CishJWMN.js} +1 -1
- package/dist/esm/{MsgSetDenomMetadata-k1Be2o9j.js → MsgSetDenomMetadata-DJaQwf94.js} +8 -6
- package/dist/esm/{OLPGrpcApi-DJHRAhPY.js → OLPGrpcApi-thWMIX2S.js} +2 -2
- package/dist/esm/{QueryTradingStrategyContractTotalStrategies-NvpGnD6O.js → QueryTradingStrategyContractTotalStrategies-NKplhQpi.js} +4 -4
- package/dist/esm/{StreamManagerV2-DiRDW-5W.js → StreamManagerV2-BdSq7ThE.js} +9 -8
- package/dist/esm/{TcAbacusGrpcApi-Dat50xET.js → TcAbacusGrpcApi-0zuZRiGi.js} +2 -2
- package/dist/esm/{accounts-Bu0DRjk4.js → accounts-3rypojw1.js} +6 -3
- package/dist/esm/address-light-BcZDS-ks.d.ts +14 -0
- package/dist/esm/address-light-C9skTx0P.js +48 -0
- package/dist/esm/{chain-DDGdMRsP.js → chain-CFXdQ_RS.js} +6 -5
- package/dist/esm/client/abacus.d.ts +5 -4
- package/dist/esm/client/abacus.js +6 -5
- package/dist/esm/client/chain.d.ts +14 -9
- package/dist/esm/client/chain.js +14 -9
- package/dist/esm/client/indexer.d.ts +14 -9
- package/dist/esm/client/indexer.js +15 -10
- package/dist/esm/client/olp.d.ts +5 -4
- package/dist/esm/client/olp.js +7 -6
- package/dist/esm/client/tcAbacus.d.ts +5 -4
- package/dist/esm/client/tcAbacus.js +6 -5
- package/dist/esm/client/wasm.d.ts +4 -3
- package/dist/esm/client/wasm.js +17 -12
- package/dist/esm/coins-D4vONigS.js +14 -0
- package/dist/esm/coins-ceq0Id0M.d.ts +7 -0
- package/dist/esm/constants-BZ28P_pH.d.ts +10 -0
- package/dist/esm/constants-CCVyqUU9.js +11 -0
- package/dist/esm/core/accounts.d.ts +14 -9
- package/dist/esm/core/accounts.js +9 -5
- package/dist/esm/core/modules.d.ts +14 -9
- package/dist/esm/core/modules.js +20 -15
- package/dist/esm/core/tx.d.ts +14 -9
- package/dist/esm/core/tx.js +17 -12
- package/dist/esm/cosmjs.d.ts +2 -2
- package/dist/esm/cosmjs.js +18 -13
- package/dist/esm/encoding-light-18k0e_8v.d.ts +18 -0
- package/dist/esm/encoding-light-DHtTGSg1.js +86 -0
- package/dist/esm/exports.d.ts +2 -2
- package/dist/esm/exports.js +18 -13
- package/dist/esm/{index-BrfNx2yV.d.ts → index-BAxR1qDR.d.ts} +1 -1
- package/dist/esm/{index-DA42BIjg.d.ts → index-CFTXl2dv.d.ts} +1 -1
- package/dist/esm/{index-CTAobhk3.d.ts → index-CnGE9D2Q.d.ts} +8 -189
- package/dist/esm/{index-B0mpSZSK.d.ts → index-DIP5sGCK.d.ts} +1 -1
- package/dist/{cjs/index-DpsYFbif.d.cts → esm/index-DPmNu-i9.d.ts} +2 -1
- package/dist/{cjs/index-DYAz6OYS.d.cts → esm/index-fqs5eTyD.d.ts} +3 -146
- package/dist/esm/{index-JlA-uSsc.d.ts → index-lki5l2NS.d.ts} +1 -1
- package/dist/esm/{index-CZhX_Ynf.d.ts → index-reHqEgGi.d.ts} +2 -2
- package/dist/esm/index.d.ts +15 -10
- package/dist/esm/index.js +29 -24
- package/dist/esm/{types-DQ7rwavH.js → light-ClZwkrDK.js} +61 -52
- package/dist/esm/light-CrlUMC8c.d.ts +119 -0
- package/dist/esm/proto/cosmos-tx.d.ts +1 -1
- package/dist/esm/{service-Uo4J-lwR.js → service-B2z6s85o.js} +3 -3
- package/dist/esm/service.d.ts +4 -3
- package/dist/esm/service.js +11 -6
- package/dist/esm/stream-BqkNM_6g.js +14 -0
- package/dist/esm/{tx-Ajrd7cHg.js → tx-Bh9bfmCB.js} +7 -6
- package/dist/esm/types/light.d.ts +2 -0
- package/dist/esm/types/light.js +3 -0
- package/dist/esm/types-BAV0654v.js +24 -0
- package/dist/esm/types.d.ts +3 -2
- package/dist/esm/types.js +3 -2
- package/dist/esm/utils/address.d.ts +2 -0
- package/dist/esm/utils/address.js +3 -0
- package/dist/esm/utils/constants.d.ts +2 -0
- package/dist/esm/utils/constants.js +3 -0
- package/dist/esm/utils/encoding.d.ts +2 -0
- package/dist/esm/utils/encoding.js +3 -0
- package/dist/esm/utils/light.d.ts +5 -0
- package/dist/esm/utils/light.js +6 -0
- package/dist/esm/{utils-bfl-Zimr.js → utils-B3t50ZnB.js} +125 -393
- package/dist/esm/utils.d.ts +15 -10
- package/dist/esm/utils.js +7 -3
- package/package.json +105 -5
- package/dist/cjs/stream-CfBvG3Ln.cjs +0 -87
- package/dist/esm/stream-Cdx47Nhx.js +0 -63
- /package/dist/cjs/{BaseRestConsumer-uSzCOit7.cjs → BaseRestConsumer-BcHgNcNh.cjs} +0 -0
- /package/dist/cjs/{defineProperty-DAtJs5JQ.cjs → defineProperty-C3FP2y9Y.cjs} +0 -0
- /package/dist/cjs/{grpc-FG2z-ICE.cjs → grpc-3Z8ffFdZ.cjs} +0 -0
- /package/dist/cjs/{tx_pb-7h617od9.d.cts → tx_pb-BmZhAoWC.d.cts} +0 -0
- /package/dist/esm/{BaseRestConsumer-DMS02DwS.js → BaseRestConsumer-L3j9-i4T.js} +0 -0
- /package/dist/esm/{defineProperty-CmydwPCD.js → defineProperty-C0TI9N8m.js} +0 -0
- /package/dist/esm/{grpc-lYZqzL0k.js → grpc-aI_RLGoG.js} +0 -0
- /package/dist/esm/{tx_pb-Bb9pvoP6.d.ts → tx_pb-DhFh6sWY.d.ts} +0 -0
|
@@ -1,322 +1,11 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { l as hexToUint8Array, m as uint8ArrayToHex, p as uint8ArrayToBase64, t as base64ToUint8Array } from "./encoding-light-DHtTGSg1.js";
|
|
2
|
+
import { hashTypedData, keccak256, recoverPublicKey } from "viem";
|
|
2
3
|
import { BigNumber, DEFAULT_EXCHANGE_LIMIT, DEFAULT_GAS_LIMIT, DEFAULT_IBC_GAS_LIMIT, DEFAULT_TIMESTAMP_TIMEOUT_MS, getExactDecimalsFromNumber, getSignificantDecimalsFromNumber, toBigNumber, toChainFormat, toHumanReadable } from "@injectivelabs/utils";
|
|
3
|
-
import { base64, bech32 } from "@scure/base";
|
|
4
4
|
import { secp256k1 } from "@noble/curves/secp256k1";
|
|
5
5
|
import { sha256 } from "@noble/hashes/sha2";
|
|
6
6
|
import { ripemd160 } from "@noble/hashes/legacy";
|
|
7
7
|
import * as CosmosBaseQueryV1Beta1PaginationPb from "@injectivelabs/core-proto-ts-v2/generated/cosmos/base/query/v1beta1/pagination_pb";
|
|
8
8
|
|
|
9
|
-
//#region src/utils/helpers.ts
|
|
10
|
-
const isServerSide = () => typeof window === "undefined";
|
|
11
|
-
const isReactNative = () => {
|
|
12
|
-
return typeof document === "undefined" && typeof navigator !== "undefined" && navigator.product === "ReactNative";
|
|
13
|
-
};
|
|
14
|
-
const isNode = () => {
|
|
15
|
-
if (typeof window === "undefined") return true;
|
|
16
|
-
return typeof process !== "undefined" && typeof process.versions !== "undefined" && typeof process.versions.node !== "undefined";
|
|
17
|
-
};
|
|
18
|
-
const isBrowser = () => {
|
|
19
|
-
if (isReactNative()) return false;
|
|
20
|
-
if (isNode()) return false;
|
|
21
|
-
return typeof window !== "undefined";
|
|
22
|
-
};
|
|
23
|
-
const objectToJson = (object, params) => {
|
|
24
|
-
const { replacer, indentation } = params || {
|
|
25
|
-
replacer: void 0,
|
|
26
|
-
indentation: 2
|
|
27
|
-
};
|
|
28
|
-
return safeBigIntStringify(object, replacer, indentation);
|
|
29
|
-
};
|
|
30
|
-
const protoObjectToJson = (object, params) => {
|
|
31
|
-
const { replacer, indentation } = params || {
|
|
32
|
-
replacer: void 0,
|
|
33
|
-
indentation: 2
|
|
34
|
-
};
|
|
35
|
-
if (object.toObject !== void 0) return safeBigIntStringify(object.toObject(), replacer, indentation);
|
|
36
|
-
return objectToJson(object, {
|
|
37
|
-
replacer,
|
|
38
|
-
indentation
|
|
39
|
-
});
|
|
40
|
-
};
|
|
41
|
-
const grpcCoinToUiCoin = (coin) => ({
|
|
42
|
-
amount: coin.amount,
|
|
43
|
-
denom: coin.denom
|
|
44
|
-
});
|
|
45
|
-
const sortObjectByKeysWithReduce = (obj) => {
|
|
46
|
-
if (typeof obj !== "object" || obj === null) return obj;
|
|
47
|
-
if (Array.isArray(obj)) return obj.map((e) => sortObjectByKeysWithReduce(e)).sort();
|
|
48
|
-
return Object.keys(obj).sort().reduce((sorted, k) => {
|
|
49
|
-
const key = k;
|
|
50
|
-
sorted[key] = sortObjectByKeysWithReduce(obj[key]);
|
|
51
|
-
return sorted;
|
|
52
|
-
}, {});
|
|
53
|
-
};
|
|
54
|
-
const sortObjectByKeys = (obj) => {
|
|
55
|
-
if (typeof obj !== "object" || obj === null) return obj;
|
|
56
|
-
if (Array.isArray(obj)) return obj.map(sortObjectByKeys);
|
|
57
|
-
const sortedKeys = Object.keys(obj).sort();
|
|
58
|
-
const result = {};
|
|
59
|
-
sortedKeys.forEach((key) => {
|
|
60
|
-
result[key] = sortObjectByKeys(obj[key]);
|
|
61
|
-
});
|
|
62
|
-
return result;
|
|
63
|
-
};
|
|
64
|
-
const getErrorMessage = (error, endpoint) => {
|
|
65
|
-
if (!error.response) return `The request to ${endpoint} has failed.`;
|
|
66
|
-
return error.response.data ? error.response.data.message || error.response.data : error.response.statusText;
|
|
67
|
-
};
|
|
68
|
-
/**
|
|
69
|
-
* Converts value to it's number representation
|
|
70
|
-
*/
|
|
71
|
-
const hexToNumber = (value) => {
|
|
72
|
-
const [negative, hexValue] = value.startsWith("-") ? [true, value.slice(1)] : [false, value];
|
|
73
|
-
const num = BigInt(hexValue);
|
|
74
|
-
if (num > Number.MAX_SAFE_INTEGER) return Number(negative ? -num : num);
|
|
75
|
-
if (num < Number.MIN_SAFE_INTEGER) return Number(num);
|
|
76
|
-
return negative ? -1 * Number(num) : Number(num);
|
|
77
|
-
};
|
|
78
|
-
function isJsonString(str) {
|
|
79
|
-
if (typeof str !== "string") return false;
|
|
80
|
-
try {
|
|
81
|
-
JSON.parse(str);
|
|
82
|
-
} catch (_unused) {
|
|
83
|
-
return false;
|
|
84
|
-
}
|
|
85
|
-
return true;
|
|
86
|
-
}
|
|
87
|
-
/**
|
|
88
|
-
* BigInt-safe JSON replacer function.
|
|
89
|
-
* Converts BigInt values to strings during JSON serialization.
|
|
90
|
-
*/
|
|
91
|
-
const bigIntReplacer = (_key, value) => typeof value === "bigint" ? bigIntToString(value) : value;
|
|
92
|
-
/**
|
|
93
|
-
* Converts a potentially bigint value to a number.
|
|
94
|
-
* Handles bigint, string, and other number-like types.
|
|
95
|
-
* Returns 0 for null/undefined values.
|
|
96
|
-
*/
|
|
97
|
-
const bigIntToNumber = (value) => {
|
|
98
|
-
if (value === null || value === void 0) return 0;
|
|
99
|
-
if (typeof value === "bigint") return Number(value);
|
|
100
|
-
if (typeof value === "string") return parseInt(value || "0", 10);
|
|
101
|
-
if (typeof value === "number") return value;
|
|
102
|
-
return parseInt(String(value || "0"), 10);
|
|
103
|
-
};
|
|
104
|
-
/**
|
|
105
|
-
* Converts a potentially bigint value to a string.
|
|
106
|
-
* Handles bigint, string, and other types that can be converted to string.
|
|
107
|
-
* Returns empty string for null/undefined values.
|
|
108
|
-
*/
|
|
109
|
-
const bigIntToString = (value) => {
|
|
110
|
-
if (value === null || value === void 0) return "";
|
|
111
|
-
if (typeof value === "bigint") return value.toString();
|
|
112
|
-
if (typeof value === "string") return value;
|
|
113
|
-
if (typeof value === "number") return value.toString();
|
|
114
|
-
return String(value || "");
|
|
115
|
-
};
|
|
116
|
-
/**
|
|
117
|
-
* Stringify an object to JSON with BigInt support.
|
|
118
|
-
* Converts BigInt values to strings during serialization to prevent
|
|
119
|
-
* "Do not know how to serialize a BigInt" errors.
|
|
120
|
-
*
|
|
121
|
-
* @param value - The value to serialize
|
|
122
|
-
* @param replacer - Optional custom replacer function (BigInt handling is applied first)
|
|
123
|
-
* @param space - Optional indentation for pretty printing
|
|
124
|
-
* @returns JSON string
|
|
125
|
-
*/
|
|
126
|
-
const safeBigIntStringify = (value, replacer, space) => {
|
|
127
|
-
const combinedReplacer = (key, val) => {
|
|
128
|
-
const bigIntHandled = bigIntReplacer(key, val);
|
|
129
|
-
return replacer ? replacer(key, bigIntHandled) : bigIntHandled;
|
|
130
|
-
};
|
|
131
|
-
return JSON.stringify(value, combinedReplacer, space);
|
|
132
|
-
};
|
|
133
|
-
|
|
134
|
-
//#endregion
|
|
135
|
-
//#region src/utils/encoding.ts
|
|
136
|
-
/**
|
|
137
|
-
* Encoding/decoding utilities using industry-standard libraries
|
|
138
|
-
*
|
|
139
|
-
* Uses viem for hex encoding and @scure/base for base64 encoding
|
|
140
|
-
* to ensure compatibility, better performance, and reduce bundle size.
|
|
141
|
-
*
|
|
142
|
-
* These libraries are already dependencies in the project and are
|
|
143
|
-
* battle-tested by millions of developers.
|
|
144
|
-
*/
|
|
145
|
-
/**
|
|
146
|
-
* Convert a hex string to Uint8Array
|
|
147
|
-
* @param hex - Hex string (with or without 0x prefix)
|
|
148
|
-
* @returns Uint8Array
|
|
149
|
-
* @throws Error if hex string is invalid
|
|
150
|
-
*/
|
|
151
|
-
function hexToUint8Array(hex) {
|
|
152
|
-
if (typeof hex !== "string") throw new Error("Hex string must be a string");
|
|
153
|
-
if (hex.trim() === "") throw new Error("Hex string cannot be empty");
|
|
154
|
-
const prefixedHex = hex.startsWith("0x") ? hex : `0x${hex}`;
|
|
155
|
-
try {
|
|
156
|
-
return hexToBytes(prefixedHex);
|
|
157
|
-
} catch (_unused) {
|
|
158
|
-
throw new Error(`Invalid hex string: ${hex}`);
|
|
159
|
-
}
|
|
160
|
-
}
|
|
161
|
-
/**
|
|
162
|
-
* Convert a Uint8Array to hex string
|
|
163
|
-
* @param arr - Uint8Array to convert
|
|
164
|
-
* @returns Hex string (without 0x prefix)
|
|
165
|
-
*/
|
|
166
|
-
function uint8ArrayToHex(arr) {
|
|
167
|
-
return bytesToHex(arr).slice(2);
|
|
168
|
-
}
|
|
169
|
-
/**
|
|
170
|
-
* Convert a base64 string to Uint8Array
|
|
171
|
-
* @param base64String - Base64 encoded string
|
|
172
|
-
* @returns Uint8Array
|
|
173
|
-
* @throws Error if base64 string is invalid
|
|
174
|
-
*/
|
|
175
|
-
function base64ToUint8Array(base64String) {
|
|
176
|
-
if (typeof base64String !== "string") throw new Error("Base64 string must be a string");
|
|
177
|
-
if (base64String.trim() === "") throw new Error("Base64 string cannot be empty");
|
|
178
|
-
try {
|
|
179
|
-
return base64.decode(base64String);
|
|
180
|
-
} catch (_unused2) {
|
|
181
|
-
throw new Error(`Invalid base64 string: ${base64String}`);
|
|
182
|
-
}
|
|
183
|
-
}
|
|
184
|
-
/**
|
|
185
|
-
* Convert a Uint8Array to base64 string
|
|
186
|
-
* @param arr - Uint8Array to convert
|
|
187
|
-
* @returns Base64 encoded string
|
|
188
|
-
*/
|
|
189
|
-
function uint8ArrayToBase64(arr) {
|
|
190
|
-
return base64.encode(arr);
|
|
191
|
-
}
|
|
192
|
-
/**
|
|
193
|
-
* Convert a string to Uint8Array using UTF-8 encoding
|
|
194
|
-
* @param str - String to encode
|
|
195
|
-
* @returns Uint8Array
|
|
196
|
-
*/
|
|
197
|
-
function stringToUint8Array(str) {
|
|
198
|
-
return new TextEncoder().encode(str);
|
|
199
|
-
}
|
|
200
|
-
/**
|
|
201
|
-
* Convert a hex string to Uint8Array (buffer-like)
|
|
202
|
-
* Handles hex strings with or without 0x prefix
|
|
203
|
-
* @param hex - Hex string (with or without 0x prefix)
|
|
204
|
-
* @returns Uint8Array
|
|
205
|
-
*/
|
|
206
|
-
function hexToBuff(hex) {
|
|
207
|
-
return hexToUint8Array(hex.startsWith("0x") ? hex.slice(2) : hex);
|
|
208
|
-
}
|
|
209
|
-
/**
|
|
210
|
-
* Convert a hex string to base64 string
|
|
211
|
-
* Handles hex strings with or without 0x prefix
|
|
212
|
-
* @param hex - Hex string (with or without 0x prefix)
|
|
213
|
-
* @returns Base64 encoded string
|
|
214
|
-
*/
|
|
215
|
-
function hexToBase64(hex) {
|
|
216
|
-
return uint8ArrayToBase64(hexToUint8Array(hex.startsWith("0x") ? hex.slice(2) : hex));
|
|
217
|
-
}
|
|
218
|
-
/**
|
|
219
|
-
* Convert a base64 string to UTF-8 string
|
|
220
|
-
* @param base64String - Base64 encoded string
|
|
221
|
-
* @returns Decoded UTF-8 string
|
|
222
|
-
* @throws Error if base64 string is invalid
|
|
223
|
-
*/
|
|
224
|
-
function base64ToUtf8(base64String) {
|
|
225
|
-
return toUtf8(base64ToUint8Array(base64String));
|
|
226
|
-
}
|
|
227
|
-
/**
|
|
228
|
-
* Convert a string or Uint8Array to Uint8Array using UTF-8 encoding
|
|
229
|
-
* If input is already Uint8Array, returns it as-is
|
|
230
|
-
* @param str - String or Uint8Array to encode
|
|
231
|
-
* @returns Uint8Array
|
|
232
|
-
*/
|
|
233
|
-
function fromUtf8(str) {
|
|
234
|
-
if (typeof str !== "string") return str;
|
|
235
|
-
return stringToUint8Array(str);
|
|
236
|
-
}
|
|
237
|
-
/**
|
|
238
|
-
* Convert a Uint8Array or string to string using UTF-8 decoding
|
|
239
|
-
* If input is already a string, returns it as-is
|
|
240
|
-
* @param data - Uint8Array or string to decode
|
|
241
|
-
* @returns Decoded string
|
|
242
|
-
*/
|
|
243
|
-
function toUtf8(data) {
|
|
244
|
-
if (typeof data === "string") return data;
|
|
245
|
-
return new TextDecoder().decode(data);
|
|
246
|
-
}
|
|
247
|
-
/**
|
|
248
|
-
* Convert a Uint8Array, string, null, or undefined to string using UTF-8 decoding
|
|
249
|
-
* More robust version that handles null/undefined gracefully
|
|
250
|
-
* @param string - Uint8Array, string, null, or undefined to decode
|
|
251
|
-
* @returns Decoded string (empty string if input is null/undefined)
|
|
252
|
-
*/
|
|
253
|
-
function uint8ArrayToString(string) {
|
|
254
|
-
if (!string) return "";
|
|
255
|
-
if (string.constructor !== Uint8Array) return string;
|
|
256
|
-
return new TextDecoder().decode(string);
|
|
257
|
-
}
|
|
258
|
-
/**
|
|
259
|
-
* Convert binary data (string or Uint8Array) to base64 string
|
|
260
|
-
* If input is already a string, returns it as-is
|
|
261
|
-
* @param data - String or Uint8Array to encode
|
|
262
|
-
* @returns Base64 encoded string
|
|
263
|
-
*/
|
|
264
|
-
function binaryToBase64(data) {
|
|
265
|
-
return typeof data === "string" ? data : uint8ArrayToBase64(data);
|
|
266
|
-
}
|
|
267
|
-
/**
|
|
268
|
-
* Convert a JSON object to base64 string
|
|
269
|
-
* @param data - JSON object to encode
|
|
270
|
-
* @returns Base64 encoded string
|
|
271
|
-
*/
|
|
272
|
-
function toBase64(data) {
|
|
273
|
-
return uint8ArrayToBase64(stringToUint8Array(safeBigIntStringify(data)));
|
|
274
|
-
}
|
|
275
|
-
/**
|
|
276
|
-
* Convert a base64 string to JSON object
|
|
277
|
-
* @param payload - Base64 encoded string
|
|
278
|
-
* @returns Decoded JSON object
|
|
279
|
-
* @throws Error if base64 string is invalid or contains invalid JSON
|
|
280
|
-
*/
|
|
281
|
-
function fromBase64(payload) {
|
|
282
|
-
if (typeof payload !== "string") throw new Error("Base64 payload must be a string");
|
|
283
|
-
if (payload.trim() === "") throw new Error("Base64 payload cannot be empty");
|
|
284
|
-
try {
|
|
285
|
-
const decoded = new TextDecoder().decode(base64ToUint8Array(payload));
|
|
286
|
-
return JSON.parse(decoded);
|
|
287
|
-
} catch (_unused3) {
|
|
288
|
-
throw new Error(`Failed to decode base64 JSON: ${payload}`);
|
|
289
|
-
}
|
|
290
|
-
}
|
|
291
|
-
/**
|
|
292
|
-
* Concatenate multiple Uint8Arrays into a single Uint8Array
|
|
293
|
-
* Replacement for Buffer.concat()
|
|
294
|
-
* @param arrays - Array of Uint8Arrays to concatenate
|
|
295
|
-
* @returns Concatenated Uint8Array
|
|
296
|
-
*/
|
|
297
|
-
function concatUint8Arrays(arrays) {
|
|
298
|
-
if (arrays.length === 0) return new Uint8Array(0);
|
|
299
|
-
const totalLength = arrays.reduce((sum, arr) => sum + arr.length, 0);
|
|
300
|
-
const result = new Uint8Array(totalLength);
|
|
301
|
-
let offset = 0;
|
|
302
|
-
for (const arr of arrays) {
|
|
303
|
-
result.set(arr, offset);
|
|
304
|
-
offset += arr.length;
|
|
305
|
-
}
|
|
306
|
-
return result;
|
|
307
|
-
}
|
|
308
|
-
|
|
309
|
-
//#endregion
|
|
310
|
-
//#region src/utils/constants.ts
|
|
311
|
-
const BECH32_PUBKEY_ACC_PREFIX = "injpub";
|
|
312
|
-
const BECH32_PUBKEY_VAL_PREFIX = "injvaloperpub";
|
|
313
|
-
const BECH32_PUBKEY_CONS_PREFIX = "injvalconspub";
|
|
314
|
-
const BECH32_ADDR_ACC_PREFIX = "inj";
|
|
315
|
-
const BECH32_ADDR_VAL_PREFIX = "injvaloper";
|
|
316
|
-
const BECH32_ADDR_CONS_PREFIX = "injvalcons";
|
|
317
|
-
const DEFAULT_DERIVATION_PATH = "m/44'/60'/0'/0/0";
|
|
318
|
-
|
|
319
|
-
//#endregion
|
|
320
9
|
//#region src/utils/time.ts
|
|
321
10
|
/**
|
|
322
11
|
* Returns a timeout timestamp in milliseconds so its compatible
|
|
@@ -483,16 +172,129 @@ const ofacList = [
|
|
|
483
172
|
];
|
|
484
173
|
|
|
485
174
|
//#endregion
|
|
486
|
-
//#region src/utils/
|
|
487
|
-
const
|
|
488
|
-
|
|
489
|
-
|
|
490
|
-
|
|
491
|
-
|
|
492
|
-
|
|
493
|
-
|
|
494
|
-
|
|
175
|
+
//#region src/utils/helpers.ts
|
|
176
|
+
const isServerSide = () => typeof window === "undefined";
|
|
177
|
+
const isReactNative = () => {
|
|
178
|
+
return typeof document === "undefined" && typeof navigator !== "undefined" && navigator.product === "ReactNative";
|
|
179
|
+
};
|
|
180
|
+
const isNode = () => {
|
|
181
|
+
if (typeof window === "undefined") return true;
|
|
182
|
+
return typeof process !== "undefined" && typeof process.versions !== "undefined" && typeof process.versions.node !== "undefined";
|
|
183
|
+
};
|
|
184
|
+
const isBrowser = () => {
|
|
185
|
+
if (isReactNative()) return false;
|
|
186
|
+
if (isNode()) return false;
|
|
187
|
+
return typeof window !== "undefined";
|
|
188
|
+
};
|
|
189
|
+
const objectToJson = (object, params) => {
|
|
190
|
+
const { replacer, indentation } = params || {
|
|
191
|
+
replacer: void 0,
|
|
192
|
+
indentation: 2
|
|
193
|
+
};
|
|
194
|
+
return safeBigIntStringify(object, replacer, indentation);
|
|
195
|
+
};
|
|
196
|
+
const protoObjectToJson = (object, params) => {
|
|
197
|
+
const { replacer, indentation } = params || {
|
|
198
|
+
replacer: void 0,
|
|
199
|
+
indentation: 2
|
|
200
|
+
};
|
|
201
|
+
if (object.toObject !== void 0) return safeBigIntStringify(object.toObject(), replacer, indentation);
|
|
202
|
+
return objectToJson(object, {
|
|
203
|
+
replacer,
|
|
204
|
+
indentation
|
|
205
|
+
});
|
|
206
|
+
};
|
|
207
|
+
const grpcCoinToUiCoin = (coin) => ({
|
|
208
|
+
amount: coin.amount,
|
|
209
|
+
denom: coin.denom
|
|
210
|
+
});
|
|
211
|
+
const sortObjectByKeysWithReduce = (obj) => {
|
|
212
|
+
if (typeof obj !== "object" || obj === null) return obj;
|
|
213
|
+
if (Array.isArray(obj)) return obj.map((e) => sortObjectByKeysWithReduce(e)).sort();
|
|
214
|
+
return Object.keys(obj).sort().reduce((sorted, k) => {
|
|
215
|
+
const key = k;
|
|
216
|
+
sorted[key] = sortObjectByKeysWithReduce(obj[key]);
|
|
217
|
+
return sorted;
|
|
218
|
+
}, {});
|
|
219
|
+
};
|
|
220
|
+
const sortObjectByKeys = (obj) => {
|
|
221
|
+
if (typeof obj !== "object" || obj === null) return obj;
|
|
222
|
+
if (Array.isArray(obj)) return obj.map(sortObjectByKeys);
|
|
223
|
+
const sortedKeys = Object.keys(obj).sort();
|
|
224
|
+
const result = {};
|
|
225
|
+
sortedKeys.forEach((key) => {
|
|
226
|
+
result[key] = sortObjectByKeys(obj[key]);
|
|
495
227
|
});
|
|
228
|
+
return result;
|
|
229
|
+
};
|
|
230
|
+
const getErrorMessage = (error, endpoint) => {
|
|
231
|
+
if (!error.response) return `The request to ${endpoint} has failed.`;
|
|
232
|
+
return error.response.data ? error.response.data.message || error.response.data : error.response.statusText;
|
|
233
|
+
};
|
|
234
|
+
/**
|
|
235
|
+
* Converts value to it's number representation
|
|
236
|
+
*/
|
|
237
|
+
const hexToNumber = (value) => {
|
|
238
|
+
const [negative, hexValue] = value.startsWith("-") ? [true, value.slice(1)] : [false, value];
|
|
239
|
+
const num = BigInt(hexValue);
|
|
240
|
+
if (num > Number.MAX_SAFE_INTEGER) return Number(negative ? -num : num);
|
|
241
|
+
if (num < Number.MIN_SAFE_INTEGER) return Number(num);
|
|
242
|
+
return negative ? -1 * Number(num) : Number(num);
|
|
243
|
+
};
|
|
244
|
+
function isJsonString(str) {
|
|
245
|
+
if (typeof str !== "string") return false;
|
|
246
|
+
try {
|
|
247
|
+
JSON.parse(str);
|
|
248
|
+
} catch (_unused) {
|
|
249
|
+
return false;
|
|
250
|
+
}
|
|
251
|
+
return true;
|
|
252
|
+
}
|
|
253
|
+
/**
|
|
254
|
+
* BigInt-safe JSON replacer function.
|
|
255
|
+
* Converts BigInt values to strings during JSON serialization.
|
|
256
|
+
*/
|
|
257
|
+
const bigIntReplacer = (_key, value) => typeof value === "bigint" ? bigIntToString(value) : value;
|
|
258
|
+
/**
|
|
259
|
+
* Converts a potentially bigint value to a number.
|
|
260
|
+
* Handles bigint, string, and other number-like types.
|
|
261
|
+
* Returns 0 for null/undefined values.
|
|
262
|
+
*/
|
|
263
|
+
const bigIntToNumber = (value) => {
|
|
264
|
+
if (value === null || value === void 0) return 0;
|
|
265
|
+
if (typeof value === "bigint") return Number(value);
|
|
266
|
+
if (typeof value === "string") return parseInt(value || "0", 10);
|
|
267
|
+
if (typeof value === "number") return value;
|
|
268
|
+
return parseInt(String(value || "0"), 10);
|
|
269
|
+
};
|
|
270
|
+
/**
|
|
271
|
+
* Converts a potentially bigint value to a string.
|
|
272
|
+
* Handles bigint, string, and other types that can be converted to string.
|
|
273
|
+
* Returns empty string for null/undefined values.
|
|
274
|
+
*/
|
|
275
|
+
const bigIntToString = (value) => {
|
|
276
|
+
if (value === null || value === void 0) return "";
|
|
277
|
+
if (typeof value === "bigint") return value.toString();
|
|
278
|
+
if (typeof value === "string") return value;
|
|
279
|
+
if (typeof value === "number") return value.toString();
|
|
280
|
+
return String(value || "");
|
|
281
|
+
};
|
|
282
|
+
/**
|
|
283
|
+
* Stringify an object to JSON with BigInt support.
|
|
284
|
+
* Converts BigInt values to strings during serialization to prevent
|
|
285
|
+
* "Do not know how to serialize a BigInt" errors.
|
|
286
|
+
*
|
|
287
|
+
* @param value - The value to serialize
|
|
288
|
+
* @param replacer - Optional custom replacer function (BigInt handling is applied first)
|
|
289
|
+
* @param space - Optional indentation for pretty printing
|
|
290
|
+
* @returns JSON string
|
|
291
|
+
*/
|
|
292
|
+
const safeBigIntStringify = (value, replacer, space) => {
|
|
293
|
+
const combinedReplacer = (key, val) => {
|
|
294
|
+
const bigIntHandled = bigIntReplacer(key, val);
|
|
295
|
+
return replacer ? replacer(key, bigIntHandled) : bigIntHandled;
|
|
296
|
+
};
|
|
297
|
+
return JSON.stringify(value, combinedReplacer, space);
|
|
496
298
|
};
|
|
497
299
|
|
|
498
300
|
//#endregion
|
|
@@ -979,58 +781,6 @@ const getSpotMarketDecimals = ({ minPriceTickSize, minQuantityTickSize, baseDeci
|
|
|
979
781
|
//#endregion
|
|
980
782
|
//#region src/utils/address.ts
|
|
981
783
|
/**
|
|
982
|
-
* Get injective address from Ethereum hex address
|
|
983
|
-
*
|
|
984
|
-
* @param ethAddress string
|
|
985
|
-
* @returns string
|
|
986
|
-
*/
|
|
987
|
-
const getInjectiveAddress = (ethAddress) => {
|
|
988
|
-
const addressBuffer = toBytes(ethAddress.toString());
|
|
989
|
-
return bech32.encode("inj", bech32.toWords(addressBuffer));
|
|
990
|
-
};
|
|
991
|
-
/**
|
|
992
|
-
* Get ethereum address from injective bech32 address
|
|
993
|
-
*
|
|
994
|
-
* @param injectiveAddress string
|
|
995
|
-
* @returns string
|
|
996
|
-
*/
|
|
997
|
-
const getEthereumAddress = (injectiveAddress) => {
|
|
998
|
-
if (injectiveAddress.startsWith("0x")) return injectiveAddress;
|
|
999
|
-
return `0x${uint8ArrayToHex(bech32.fromWords(bech32.decode(injectiveAddress).words))}`;
|
|
1000
|
-
};
|
|
1001
|
-
/**
|
|
1002
|
-
* Get ethereum address from injective bech32 address
|
|
1003
|
-
*
|
|
1004
|
-
* @param injectiveAddress string
|
|
1005
|
-
* @returns string
|
|
1006
|
-
*/
|
|
1007
|
-
const getInjectiveAddressFromSubaccountId = (subaccountId) => {
|
|
1008
|
-
return getInjectiveAddress(subaccountId.slice(0, 42));
|
|
1009
|
-
};
|
|
1010
|
-
/**
|
|
1011
|
-
* Get default subaccount id from injective bech32 address
|
|
1012
|
-
*
|
|
1013
|
-
* @param injectiveAddress string
|
|
1014
|
-
* @returns string
|
|
1015
|
-
*/
|
|
1016
|
-
const getDefaultSubaccountId = (injectiveAddress) => {
|
|
1017
|
-
return `0x${uint8ArrayToHex(bech32.fromWords(bech32.decode(injectiveAddress).words))}${"0".repeat(24)}`;
|
|
1018
|
-
};
|
|
1019
|
-
/**
|
|
1020
|
-
* Get subaccount id from injective bech32 address and an index (defaults to 0)
|
|
1021
|
-
* @param injectiveAddress string
|
|
1022
|
-
* @param nonce number
|
|
1023
|
-
* @returns string
|
|
1024
|
-
*/
|
|
1025
|
-
const getSubaccountId = (injectiveAddress, nonce = 0) => {
|
|
1026
|
-
return `0x${uint8ArrayToHex(bech32.fromWords(bech32.decode(injectiveAddress).words))}${"0".repeat(23)}${nonce}`;
|
|
1027
|
-
};
|
|
1028
|
-
/** @deprecated - use getEthereumAddress */
|
|
1029
|
-
const getAddressFromInjectiveAddress = (address) => {
|
|
1030
|
-
if (address.startsWith("0x")) return address;
|
|
1031
|
-
return `0x${uint8ArrayToHex(bech32.fromWords(bech32.decode(address).words))}`;
|
|
1032
|
-
};
|
|
1033
|
-
/**
|
|
1034
784
|
* Convert Ethereum address to checksummed format (EIP-55)
|
|
1035
785
|
* @param ethAddress - Ethereum address (with or without 0x prefix)
|
|
1036
786
|
* @returns Checksummed Ethereum address
|
|
@@ -1042,24 +792,6 @@ const getChecksumAddress = (ethAddress) => {
|
|
|
1042
792
|
return parseInt(addressHash[i], 16) > 7 ? char.toUpperCase() : char;
|
|
1043
793
|
}).join("");
|
|
1044
794
|
};
|
|
1045
|
-
/**
|
|
1046
|
-
* Check if address is a CW20 contract address
|
|
1047
|
-
* @param address - Address to check
|
|
1048
|
-
* @returns True if address is a CW20 contract address
|
|
1049
|
-
*/
|
|
1050
|
-
const isCw20ContractAddress = (address) => address.length === 42 && address.startsWith("inj");
|
|
1051
|
-
/**
|
|
1052
|
-
* Add 0x prefix to hex string if not present
|
|
1053
|
-
* @param hex - Hex string
|
|
1054
|
-
* @returns Hex string with 0x prefix
|
|
1055
|
-
*/
|
|
1056
|
-
const addHexPrefix = (hex) => hex.startsWith("0x") ? hex : `0x${hex}`;
|
|
1057
|
-
/**
|
|
1058
|
-
* Remove 0x prefix from hex string if present
|
|
1059
|
-
* @param hex - Hex string
|
|
1060
|
-
* @returns Hex string without 0x prefix
|
|
1061
|
-
*/
|
|
1062
|
-
const removeHexPrefix = (hex) => hex.startsWith("0x") ? hex.slice(2) : hex;
|
|
1063
795
|
|
|
1064
796
|
//#endregion
|
|
1065
797
|
//#region src/client/chain/transformers/ChainGrpcCommonTransformer.ts
|
|
@@ -1195,4 +927,4 @@ const recoverTypedSignaturePubKey = async (data, signature) => {
|
|
|
1195
927
|
};
|
|
1196
928
|
|
|
1197
929
|
//#endregion
|
|
1198
|
-
export {
|
|
930
|
+
export { spotQuantityToChainQuantityToFixed as $, derivativePriceToChainPriceToFixed as A, sortObjectByKeysWithReduce as At, formatPriceToAllowablePrice as B, derivativeMarginFromChainMargin as C, isNode as Ct, derivativePriceFromChainPrice as D, protoObjectToJson as Dt, derivativeMarginToChainMarginToFixed as E, objectToJson as Et, formatAmountToAllowableAmount as F, protobufTimestampToDate as Ft, numberToCosmosSdkDecString as G, getSignificantDecimalsFromNumber as H, formatAmountToAllowableDecimals as I, protobufTimestampToUnixMs as It, spotPriceToChainPrice as J, spotPriceFromChainPrice as K, formatNumberToAllowableDecimals as L, protobufTimestampToUnixSeconds as Lt, derivativeQuantityFromChainQuantityToFixed as M, getGasPriceBasedOnMessage as Mt, derivativeQuantityToChainQuantity as N, makeTimeoutTimestamp as Nt, derivativePriceFromChainPriceToFixed as O, safeBigIntStringify as Ot, derivativeQuantityToChainQuantityToFixed as P, makeTimeoutTimestampInNs as Pt, spotQuantityToChainQuantity as Q, formatNumberToAllowableTensMultiplier as R, denomAmountToGrpcChainDenomAmount as S, isJsonString as St, derivativeMarginToChainMargin as T, isServerSide as Tt, getTensMultiplier as U, getExactDecimalsFromNumber as V, isNumber as W, spotQuantityFromChainQuantity as X, spotPriceToChainPriceToFixed as Y, spotQuantityFromChainQuantityToFixed as Z, denomAmountFromChainDenomAmount as _, bigIntToString as _t, grpcPagingToPagingV2 as a, hashToHex as at, denomAmountToChainDenomAmount as b, hexToNumber as bt, paginationUint8ArrayToString as c, privateKeyHashToPublicKeyBase64 as ct, getDerivativeMarketDecimals as d, publicKeyToAddress as dt, SignTypedDataVersionV4 as et, getDerivativeMarketTensMultiplier as f, ripemd160$1 as ft, cosmosSdkDecToBigNumber as g, bigIntToNumber as gt, amountToCosmosSdkDecAmount as h, bigIntReplacer as ht, grpcPagingToPaging as i, domainHash as it, derivativeQuantityFromChainQuantity as j, ofacList as jt, derivativePriceToChainPrice as k, sortObjectByKeys as kt, ChainGrpcCommonTransformer as l, privateKeyToPublicKey as lt, getSpotMarketTensMultiplier as m, sha256$1 as mt, fetchAllWithPagination as n, TypedDataUtilsSanitizeData as nt, pageRequestToGrpcPageRequestV2 as o, messageHash as ot, getSpotMarketDecimals as p, sanitizeTypedData as pt, spotPriceFromChainPriceToFixed as q, grpcPaginationToPagination as r, decompressPubKey as rt, paginationRequestFromPagination as s, privateKeyHashToPublicKey as st, recoverTypedSignaturePubKey as t, TypedDataUtilsHashStruct as tt, getChecksumAddress as u, privateKeyToPublicKeyBase64 as ut, denomAmountFromChainDenomAmountToFixed as v, getErrorMessage as vt, derivativeMarginFromChainMarginToFixed as w, isReactNative as wt, denomAmountToChainDenomAmountToFixed as x, isBrowser as xt, denomAmountFromGrpcChainDenomAmount as y, grpcCoinToUiCoin as yt, formatPriceToAllowableDecimals as z };
|
package/dist/esm/utils.d.ts
CHANGED
|
@@ -1,10 +1,15 @@
|
|
|
1
|
-
import "./tx_pb-
|
|
2
|
-
import "./index-
|
|
3
|
-
import
|
|
4
|
-
import "./
|
|
5
|
-
import "./
|
|
6
|
-
import "./index-
|
|
7
|
-
import "./index-
|
|
8
|
-
import "./
|
|
9
|
-
import "./
|
|
10
|
-
|
|
1
|
+
import "./tx_pb-DhFh6sWY.js";
|
|
2
|
+
import "./index-fqs5eTyD.js";
|
|
3
|
+
import "./light-CrlUMC8c.js";
|
|
4
|
+
import { $d as derivativeQuantityFromChainQuantityToFixed, $f as ofacList, Ad as paginationUint8ArrayToString, Af as isReactNative, Ax as GrpcWebFetchTransport, Bd as denomAmountFromGrpcChainDenomAmount, Bf as TypedMessageV4, Cd as recoverTypedSignaturePubKey, Cf as bigIntToString, Dd as grpcPagingToPagingV2, Df as isBrowser, Ed as grpcPagingToPaging, Ef as hexToNumber, Fd as getSpotMarketTensMultiplier, Ff as sortObjectByKeys, Gd as derivativeMarginFromChainMarginToFixed, Gf as privateKeyHashToPublicKey, Hd as denomAmountToChainDenomAmountToFixed, Hf as domainHash, Id as amountToCosmosSdkDecAmount, If as sortObjectByKeysWithReduce, Jd as derivativePriceFromChainPrice, Jf as privateKeyToPublicKeyBase64, Kd as derivativeMarginToChainMargin, Kf as privateKeyHashToPublicKeyBase64, Ld as cosmosSdkDecToBigNumber, Lf as SignTypedDataVersionV4, Md as getDerivativeMarketDecimals, Mf as objectToJson, Nd as getDerivativeMarketTensMultiplier, Nf as protoObjectToJson, Od as pageRequestToGrpcPageRequestV2, Of as isJsonString, Pd as getSpotMarketDecimals, Pf as safeBigIntStringify, Qd as derivativeQuantityFromChainQuantity, Qf as sha256, Rd as denomAmountFromChainDenomAmount, Rf as TypedDataUtilsHashStruct, Sf as bigIntToNumber, Td as grpcPaginationToPagination, Tf as grpcCoinToUiCoin, Ud as denomAmountToGrpcChainDenomAmount, Uf as hashToHex, Vd as denomAmountToChainDenomAmount, Vf as decompressPubKey, Wd as derivativeMarginFromChainMargin, Wf as messageHash, Xd as derivativePriceToChainPrice, Xf as ripemd160, Yd as derivativePriceFromChainPriceToFixed, Yf as publicKeyToAddress, Zd as derivativePriceToChainPriceToFixed, Zf as sanitizeTypedData, _f as spotQuantityFromChainQuantity, af as formatNumberToAllowableTensMultiplier, ap as protobufTimestampToUnixMs, bf as spotQuantityToChainQuantityToFixed, cf as getExactDecimalsFromNumber, df as isNumber, ef as derivativeQuantityToChainQuantity, ep as getGrpcWebTransport, ff as numberToCosmosSdkDecString, gf as spotPriceToChainPriceToFixed, hf as spotPriceToChainPrice, if as formatNumberToAllowableDecimals, ip as protobufTimestampToDate, jd as getChecksumAddress, jf as isServerSide, kd as paginationRequestFromPagination, kf as isNode, lf as getSignificantDecimalsFromNumber, mf as spotPriceFromChainPriceToFixed, nf as formatAmountToAllowableAmount, np as makeTimeoutTimestamp, of as formatPriceToAllowableDecimals, op as protobufTimestampToUnixSeconds, pf as spotPriceFromChainPrice, qd as derivativeMarginToChainMarginToFixed, qf as privateKeyToPublicKey, rf as formatAmountToAllowableDecimals, rp as makeTimeoutTimestampInNs, sf as formatPriceToAllowablePrice, tf as derivativeQuantityToChainQuantityToFixed, tp as getGasPriceBasedOnMessage, uf as getTensMultiplier, vf as spotQuantityFromChainQuantityToFixed, wd as fetchAllWithPagination, wf as getErrorMessage, xf as bigIntReplacer, yf as spotQuantityToChainQuantity, zd as denomAmountFromChainDenomAmountToFixed, zf as TypedDataUtilsSanitizeData } from "./index-CnGE9D2Q.js";
|
|
5
|
+
import "./BaseGrpcConsumer-B9J3abKI.js";
|
|
6
|
+
import "./index-DIP5sGCK.js";
|
|
7
|
+
import "./index-reHqEgGi.js";
|
|
8
|
+
import { t as parseCoins } from "./coins-ceq0Id0M.js";
|
|
9
|
+
import { a as getEthereumAddress, c as getSubaccountId, d as removeHexPrefix, i as getDefaultSubaccountId, l as hexToBytes, n as bytesToHex, o as getInjectiveAddress, r as getAddressFromInjectiveAddress, s as getInjectiveAddressFromSubaccountId, t as addHexPrefix, u as isCw20ContractAddress } from "./address-light-BcZDS-ks.js";
|
|
10
|
+
import { a as fromBase64, c as hexToBuff, d as toBase64, f as toUtf8, h as uint8ArrayToString, i as concatUint8Arrays, l as hexToUint8Array, m as uint8ArrayToHex, n as base64ToUtf8, o as fromUtf8, p as uint8ArrayToBase64, r as binaryToBase64, s as hexToBase64, t as base64ToUint8Array, u as stringToUint8Array } from "./encoding-light-18k0e_8v.js";
|
|
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-BZ28P_pH.js";
|
|
12
|
+
import "./index-BAxR1qDR.js";
|
|
13
|
+
import "./index-lki5l2NS.js";
|
|
14
|
+
import "./index-DPmNu-i9.js";
|
|
15
|
+
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, 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 };
|
package/dist/esm/utils.js
CHANGED
|
@@ -1,4 +1,8 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { n as
|
|
1
|
+
import { a as fromBase64, c as hexToBuff, d as toBase64, f as toUtf8, h as uint8ArrayToString, i as concatUint8Arrays, l as hexToUint8Array, m as uint8ArrayToHex, n as base64ToUtf8, o as fromUtf8, p as uint8ArrayToBase64, r as binaryToBase64, s as hexToBase64, t as base64ToUint8Array, u as stringToUint8Array } from "./encoding-light-DHtTGSg1.js";
|
|
2
|
+
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-CCVyqUU9.js";
|
|
3
|
+
import { $ as spotQuantityToChainQuantityToFixed, A as derivativePriceToChainPriceToFixed, At as sortObjectByKeysWithReduce, B as formatPriceToAllowablePrice, C as derivativeMarginFromChainMargin, Ct as isNode, D as derivativePriceFromChainPrice, Dt as protoObjectToJson, E as derivativeMarginToChainMarginToFixed, Et as objectToJson, F as formatAmountToAllowableAmount, Ft as protobufTimestampToDate, G as numberToCosmosSdkDecString, H as getSignificantDecimalsFromNumber, I as formatAmountToAllowableDecimals, It as protobufTimestampToUnixMs, J as spotPriceToChainPrice, K as spotPriceFromChainPrice, L as formatNumberToAllowableDecimals, Lt as protobufTimestampToUnixSeconds, M as derivativeQuantityFromChainQuantityToFixed, Mt as getGasPriceBasedOnMessage, N as derivativeQuantityToChainQuantity, Nt as makeTimeoutTimestamp, O as derivativePriceFromChainPriceToFixed, Ot as safeBigIntStringify, P as derivativeQuantityToChainQuantityToFixed, Pt as makeTimeoutTimestampInNs, Q as spotQuantityToChainQuantity, R as formatNumberToAllowableTensMultiplier, S as denomAmountToGrpcChainDenomAmount, St as isJsonString, T as derivativeMarginToChainMargin, Tt as isServerSide, U as getTensMultiplier, V as getExactDecimalsFromNumber, W as isNumber, X as spotQuantityFromChainQuantity, Y as spotPriceToChainPriceToFixed, Z as spotQuantityFromChainQuantityToFixed, _ as denomAmountFromChainDenomAmount, _t as bigIntToString, a as grpcPagingToPagingV2, at as hashToHex, b as denomAmountToChainDenomAmount, bt as hexToNumber, c as paginationUint8ArrayToString, ct as privateKeyHashToPublicKeyBase64, d as getDerivativeMarketDecimals, dt as publicKeyToAddress, et as SignTypedDataVersionV4, f as getDerivativeMarketTensMultiplier, ft as ripemd160, g as cosmosSdkDecToBigNumber, gt as bigIntToNumber, h as amountToCosmosSdkDecAmount, ht as bigIntReplacer, i as grpcPagingToPaging, it as domainHash, j as derivativeQuantityFromChainQuantity, jt as ofacList, k as derivativePriceToChainPrice, kt as sortObjectByKeys, lt as privateKeyToPublicKey, m as getSpotMarketTensMultiplier, mt as sha256, n as fetchAllWithPagination, nt as TypedDataUtilsSanitizeData, o as pageRequestToGrpcPageRequestV2, ot as messageHash, p as getSpotMarketDecimals, pt as sanitizeTypedData, q as spotPriceFromChainPriceToFixed, r as grpcPaginationToPagination, rt as decompressPubKey, s as paginationRequestFromPagination, st as privateKeyHashToPublicKey, t as recoverTypedSignaturePubKey, tt as TypedDataUtilsHashStruct, u as getChecksumAddress, ut as privateKeyToPublicKeyBase64, v as denomAmountFromChainDenomAmountToFixed, vt as getErrorMessage, w as derivativeMarginFromChainMarginToFixed, wt as isReactNative, x as denomAmountToChainDenomAmountToFixed, xt as isBrowser, y as denomAmountFromGrpcChainDenomAmount, yt as grpcCoinToUiCoin, z as formatPriceToAllowableDecimals } from "./utils-B3t50ZnB.js";
|
|
4
|
+
import { n as getGrpcWebTransport, t as GrpcWebFetchTransport } from "./grpc-aI_RLGoG.js";
|
|
5
|
+
import { t as parseCoins } from "./coins-D4vONigS.js";
|
|
6
|
+
import { a as getEthereumAddress, c as getSubaccountId, d as removeHexPrefix, i as getDefaultSubaccountId, l as hexToBytes, n as bytesToHex, o as getInjectiveAddress, r as getAddressFromInjectiveAddress, s as getInjectiveAddressFromSubaccountId, t as addHexPrefix, u as isCw20ContractAddress } from "./address-light-C9skTx0P.js";
|
|
3
7
|
|
|
4
|
-
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, 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 };
|
|
8
|
+
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, 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, 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 };
|