@nadohq/shared 0.1.0-alpha.8 → 0.1.0

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.
Files changed (290) hide show
  1. package/dist/abis/index.cjs +12 -12
  2. package/dist/abis/index.cjs.map +1 -1
  3. package/dist/abis/index.d.cts +6 -6
  4. package/dist/abis/index.d.ts +6 -6
  5. package/dist/abis/index.js +6 -6
  6. package/dist/abis/index.js.map +1 -1
  7. package/dist/{chunk-TUJ4HQKF.js → chunk-2GPIH63F.js} +3 -3
  8. package/dist/chunk-2GPIH63F.js.map +1 -0
  9. package/dist/consts/chainEnvToChain.cjs +2 -2
  10. package/dist/consts/chainEnvToChain.cjs.map +1 -1
  11. package/dist/consts/chainEnvToChain.d.cts +329 -39
  12. package/dist/consts/chainEnvToChain.d.ts +329 -39
  13. package/dist/consts/chainEnvToChain.js +3 -3
  14. package/dist/consts/chainEnvToChain.js.map +1 -1
  15. package/dist/consts/productIds.cjs +1 -1
  16. package/dist/consts/productIds.cjs.map +1 -1
  17. package/dist/consts/productIds.d.cts +1 -1
  18. package/dist/consts/productIds.d.ts +1 -1
  19. package/dist/consts/productIds.js +1 -1
  20. package/dist/consts/productIds.js.map +1 -1
  21. package/dist/deployments/core/deployment.inkMainnet.json +13 -0
  22. package/dist/deployments/core/deployment.inkSepolia.json +13 -0
  23. package/dist/deployments/index.cjs +6 -6
  24. package/dist/deployments/index.cjs.map +1 -1
  25. package/dist/deployments/index.js +5 -5
  26. package/dist/deployments/index.js.map +1 -1
  27. package/dist/eip712/eip712ValueTypes.cjs.map +1 -1
  28. package/dist/eip712/eip712ValueTypes.d.cts +3 -3
  29. package/dist/eip712/eip712ValueTypes.d.ts +3 -3
  30. package/dist/eip712/getNadoEIP712Domain.cjs.map +1 -1
  31. package/dist/eip712/getNadoEIP712Domain.js.map +1 -1
  32. package/dist/eip712/getNadoEIP712PrimaryType.d.cts +1 -1
  33. package/dist/eip712/getNadoEIP712PrimaryType.d.ts +1 -1
  34. package/dist/eip712/getNadoEIP712Types.d.cts +1 -1
  35. package/dist/eip712/getNadoEIP712Types.d.ts +1 -1
  36. package/dist/eip712/getNadoEIP712Values.d.cts +1 -1
  37. package/dist/eip712/getNadoEIP712Values.d.ts +1 -1
  38. package/dist/eip712/getSignedTransactionRequest.d.cts +1 -1
  39. package/dist/eip712/getSignedTransactionRequest.d.ts +1 -1
  40. package/dist/eip712/index.cjs +13 -13
  41. package/dist/eip712/index.cjs.map +1 -1
  42. package/dist/eip712/index.d.cts +9 -9
  43. package/dist/eip712/index.d.ts +9 -9
  44. package/dist/eip712/index.js +6 -6
  45. package/dist/eip712/index.js.map +1 -1
  46. package/dist/eip712/orderDigest.d.cts +1 -1
  47. package/dist/eip712/orderDigest.d.ts +1 -1
  48. package/dist/eip712/signableRequestType.d.cts +1 -1
  49. package/dist/eip712/signableRequestType.d.ts +1 -1
  50. package/dist/eip712/signatureParamTypes.cjs.map +1 -1
  51. package/dist/eip712/signatureParamTypes.d.cts +13 -13
  52. package/dist/eip712/signatureParamTypes.d.ts +13 -13
  53. package/dist/encoding/encoding.cjs +21 -0
  54. package/dist/encoding/encoding.cjs.map +1 -1
  55. package/dist/encoding/encoding.d.cts +28 -4
  56. package/dist/encoding/encoding.d.ts +28 -4
  57. package/dist/encoding/encoding.js +24 -1
  58. package/dist/encoding/encoding.js.map +1 -1
  59. package/dist/encoding/index.d.cts +3 -3
  60. package/dist/encoding/index.d.ts +3 -3
  61. package/dist/execute/approveDepositAllowance.cjs.map +1 -1
  62. package/dist/execute/approveDepositAllowance.d.cts +2 -2
  63. package/dist/execute/approveDepositAllowance.d.ts +2 -2
  64. package/dist/execute/approveDepositAllowance.js.map +1 -1
  65. package/dist/execute/depositCollateral.cjs.map +1 -1
  66. package/dist/execute/depositCollateral.d.cts +2 -2
  67. package/dist/execute/depositCollateral.d.ts +2 -2
  68. package/dist/execute/depositCollateral.js.map +1 -1
  69. package/dist/execute/index.d.cts +1 -1
  70. package/dist/execute/index.d.ts +1 -1
  71. package/dist/index.d.cts +35 -35
  72. package/dist/index.d.ts +35 -35
  73. package/dist/types/ChainEnv.cjs +1 -1
  74. package/dist/types/ChainEnv.cjs.map +1 -1
  75. package/dist/types/ChainEnv.d.cts +2 -2
  76. package/dist/types/ChainEnv.d.ts +2 -2
  77. package/dist/types/ChainEnv.js +1 -1
  78. package/dist/types/ChainEnv.js.map +1 -1
  79. package/dist/types/balanceTypes.cjs.map +1 -1
  80. package/dist/types/balanceTypes.d.cts +5 -5
  81. package/dist/types/balanceTypes.d.ts +5 -5
  82. package/dist/types/healthTypes.cjs.map +1 -1
  83. package/dist/types/healthTypes.d.cts +4 -4
  84. package/dist/types/healthTypes.d.ts +4 -4
  85. package/dist/types/index.cjs +7 -7
  86. package/dist/types/index.cjs.map +1 -1
  87. package/dist/types/index.d.cts +4 -4
  88. package/dist/types/index.d.ts +4 -4
  89. package/dist/types/index.js +3 -3
  90. package/dist/types/index.js.map +1 -1
  91. package/dist/types/marketTypes.cjs.map +1 -1
  92. package/dist/types/marketTypes.d.cts +4 -4
  93. package/dist/types/marketTypes.d.ts +4 -4
  94. package/dist/types/orderAppendixTypes.cjs.map +1 -1
  95. package/dist/types/orderAppendixTypes.d.cts +27 -3
  96. package/dist/types/orderAppendixTypes.d.ts +27 -3
  97. package/dist/types/productTypes.cjs.map +1 -1
  98. package/dist/types/productTypes.d.cts +16 -16
  99. package/dist/types/productTypes.d.ts +16 -16
  100. package/dist/types/productTypes.js.map +1 -1
  101. package/dist/types/viemTypes.d.cts +1 -1
  102. package/dist/types/viemTypes.d.ts +1 -1
  103. package/dist/utils/balanceValue.cjs.map +1 -1
  104. package/dist/utils/balanceValue.d.cts +5 -5
  105. package/dist/utils/balanceValue.d.ts +5 -5
  106. package/dist/utils/balanceValue.js.map +1 -1
  107. package/dist/utils/bytes32.d.cts +1 -1
  108. package/dist/utils/bytes32.d.ts +1 -1
  109. package/dist/utils/bytes32.test.cjs +2 -2
  110. package/dist/utils/bytes32.test.cjs.map +1 -1
  111. package/dist/utils/bytes32.test.js +1 -1
  112. package/dist/utils/createDeterministicLinkedSignerPrivateKey.cjs.map +1 -1
  113. package/dist/utils/createDeterministicLinkedSignerPrivateKey.js.map +1 -1
  114. package/dist/utils/index.cjs +12 -12
  115. package/dist/utils/index.cjs.map +1 -1
  116. package/dist/utils/index.d.cts +22 -22
  117. package/dist/utils/index.d.ts +22 -22
  118. package/dist/utils/index.js +6 -6
  119. package/dist/utils/index.js.map +1 -1
  120. package/dist/utils/interest.cjs +9 -9
  121. package/dist/utils/interest.cjs.map +1 -1
  122. package/dist/utils/interest.d.cts +8 -8
  123. package/dist/utils/interest.d.ts +8 -8
  124. package/dist/utils/interest.js +10 -14
  125. package/dist/utils/interest.js.map +1 -1
  126. package/dist/utils/math/{BigDecimals.cjs → BigNumbers.cjs} +13 -13
  127. package/dist/utils/math/BigNumbers.cjs.map +1 -0
  128. package/dist/utils/math/BigNumbers.d.cts +10 -0
  129. package/dist/utils/math/BigNumbers.d.ts +10 -0
  130. package/dist/utils/math/BigNumbers.js +14 -0
  131. package/dist/utils/math/BigNumbers.js.map +1 -0
  132. package/dist/utils/math/{bigDecimal.cjs → bigNumber.cjs} +12 -14
  133. package/dist/utils/math/bigNumber.cjs.map +1 -0
  134. package/dist/utils/math/bigNumber.d.cts +17 -0
  135. package/dist/utils/math/bigNumber.d.ts +17 -0
  136. package/dist/utils/math/bigNumber.js +22 -0
  137. package/dist/utils/math/bigNumber.js.map +1 -0
  138. package/dist/utils/math/clamp.cjs +3 -3
  139. package/dist/utils/math/clamp.cjs.map +1 -1
  140. package/dist/utils/math/clamp.d.cts +5 -5
  141. package/dist/utils/math/clamp.d.ts +5 -5
  142. package/dist/utils/math/clamp.js +2 -2
  143. package/dist/utils/math/clamp.js.map +1 -1
  144. package/dist/utils/math/decimalAdjustment.cjs +5 -5
  145. package/dist/utils/math/decimalAdjustment.cjs.map +1 -1
  146. package/dist/utils/math/decimalAdjustment.d.cts +6 -6
  147. package/dist/utils/math/decimalAdjustment.d.ts +6 -6
  148. package/dist/utils/math/decimalAdjustment.js +5 -5
  149. package/dist/utils/math/decimalAdjustment.js.map +1 -1
  150. package/dist/utils/math/index.cjs +10 -10
  151. package/dist/utils/math/index.cjs.map +1 -1
  152. package/dist/utils/math/index.d.cts +7 -7
  153. package/dist/utils/math/index.d.ts +7 -7
  154. package/dist/utils/math/index.js +5 -5
  155. package/dist/utils/math/index.js.map +1 -1
  156. package/dist/utils/math/{sumBigDecimalBy.cjs → sumBigNumberBy.cjs} +10 -10
  157. package/dist/utils/math/sumBigNumberBy.cjs.map +1 -0
  158. package/dist/utils/math/sumBigNumberBy.d.cts +10 -0
  159. package/dist/utils/math/sumBigNumberBy.d.ts +10 -0
  160. package/dist/utils/math/sumBigNumberBy.js +13 -0
  161. package/dist/utils/math/sumBigNumberBy.js.map +1 -0
  162. package/dist/utils/math/toBigInt.cjs.map +1 -1
  163. package/dist/utils/math/toBigInt.d.cts +3 -3
  164. package/dist/utils/math/toBigInt.d.ts +3 -3
  165. package/dist/utils/math/toBigInt.js.map +1 -1
  166. package/dist/utils/math/toIntegerString.cjs +2 -2
  167. package/dist/utils/math/toIntegerString.cjs.map +1 -1
  168. package/dist/utils/math/toIntegerString.d.cts +3 -3
  169. package/dist/utils/math/toIntegerString.d.ts +3 -3
  170. package/dist/utils/math/toIntegerString.js +2 -2
  171. package/dist/utils/math/toIntegerString.js.map +1 -1
  172. package/dist/utils/orders/appendix/appendixIsolatedValue.cjs +50 -0
  173. package/dist/utils/orders/appendix/appendixIsolatedValue.cjs.map +1 -0
  174. package/dist/utils/orders/appendix/appendixIsolatedValue.d.cts +26 -0
  175. package/dist/utils/orders/appendix/appendixIsolatedValue.d.ts +26 -0
  176. package/dist/utils/orders/appendix/appendixIsolatedValue.js +31 -0
  177. package/dist/utils/orders/appendix/appendixIsolatedValue.js.map +1 -0
  178. package/dist/utils/orders/appendix/appendixTwapValue.cjs +3 -4
  179. package/dist/utils/orders/appendix/appendixTwapValue.cjs.map +1 -1
  180. package/dist/utils/orders/appendix/appendixTwapValue.d.cts +12 -14
  181. package/dist/utils/orders/appendix/appendixTwapValue.d.ts +12 -14
  182. package/dist/utils/orders/appendix/appendixTwapValue.js +3 -4
  183. package/dist/utils/orders/appendix/appendixTwapValue.js.map +1 -1
  184. package/dist/utils/orders/appendix/index.cjs +4 -4
  185. package/dist/utils/orders/appendix/index.cjs.map +1 -1
  186. package/dist/utils/orders/appendix/index.d.cts +3 -3
  187. package/dist/utils/orders/appendix/index.d.ts +3 -3
  188. package/dist/utils/orders/appendix/index.js +2 -2
  189. package/dist/utils/orders/appendix/index.js.map +1 -1
  190. package/dist/utils/orders/appendix/orderAppendix.test.cjs +67 -14
  191. package/dist/utils/orders/appendix/orderAppendix.test.cjs.map +1 -1
  192. package/dist/utils/orders/appendix/orderAppendix.test.js +66 -13
  193. package/dist/utils/orders/appendix/orderAppendix.test.js.map +1 -1
  194. package/dist/utils/orders/appendix/packOrderAppendix.cjs +9 -5
  195. package/dist/utils/orders/appendix/packOrderAppendix.cjs.map +1 -1
  196. package/dist/utils/orders/appendix/packOrderAppendix.d.cts +1 -1
  197. package/dist/utils/orders/appendix/packOrderAppendix.d.ts +1 -1
  198. package/dist/utils/orders/appendix/packOrderAppendix.js +9 -5
  199. package/dist/utils/orders/appendix/packOrderAppendix.js.map +1 -1
  200. package/dist/utils/orders/appendix/types.cjs.map +1 -1
  201. package/dist/utils/orders/appendix/types.d.cts +6 -4
  202. package/dist/utils/orders/appendix/types.d.ts +6 -4
  203. package/dist/utils/orders/appendix/unpackOrderAppendix.cjs +22 -5
  204. package/dist/utils/orders/appendix/unpackOrderAppendix.cjs.map +1 -1
  205. package/dist/utils/orders/appendix/unpackOrderAppendix.d.cts +2 -2
  206. package/dist/utils/orders/appendix/unpackOrderAppendix.d.ts +2 -2
  207. package/dist/utils/orders/appendix/unpackOrderAppendix.js +22 -5
  208. package/dist/utils/orders/appendix/unpackOrderAppendix.js.map +1 -1
  209. package/dist/utils/orders/index.cjs +3 -3
  210. package/dist/utils/orders/index.cjs.map +1 -1
  211. package/dist/utils/orders/index.d.cts +5 -5
  212. package/dist/utils/orders/index.d.ts +5 -5
  213. package/dist/utils/orders/index.js +1 -1
  214. package/dist/utils/orders/index.js.map +1 -1
  215. package/dist/utils/productTypeFilter.cjs.map +1 -1
  216. package/dist/utils/productTypeFilter.d.cts +2 -2
  217. package/dist/utils/productTypeFilter.d.ts +2 -2
  218. package/dist/utils/productTypeFilter.js.map +1 -1
  219. package/dist/utils/toPrintableObject.cjs +29 -11
  220. package/dist/utils/toPrintableObject.cjs.map +1 -1
  221. package/dist/utils/toPrintableObject.d.cts +7 -2
  222. package/dist/utils/toPrintableObject.d.ts +7 -2
  223. package/dist/utils/toPrintableObject.js +19 -11
  224. package/dist/utils/toPrintableObject.js.map +1 -1
  225. package/package.json +14 -7
  226. package/src/abis/index.ts +6 -6
  227. package/src/consts/chainEnvToChain.ts +2 -2
  228. package/src/consts/productIds.ts +1 -1
  229. package/src/deployments/core/deployment.inkMainnet.json +13 -0
  230. package/src/deployments/core/deployment.inkSepolia.json +13 -0
  231. package/src/deployments/index.ts +5 -5
  232. package/src/eip712/eip712ValueTypes.ts +2 -2
  233. package/src/eip712/getNadoEIP712Domain.ts +1 -1
  234. package/src/eip712/index.ts +6 -6
  235. package/src/eip712/signatureParamTypes.ts +13 -13
  236. package/src/encoding/encoding.ts +43 -1
  237. package/src/execute/approveDepositAllowance.ts +2 -2
  238. package/src/execute/depositCollateral.ts +2 -2
  239. package/src/types/ChainEnv.ts +1 -1
  240. package/src/types/balanceTypes.ts +4 -4
  241. package/src/types/healthTypes.ts +4 -4
  242. package/src/types/index.ts +3 -3
  243. package/src/types/marketTypes.ts +4 -4
  244. package/src/types/orderAppendixTypes.ts +27 -2
  245. package/src/types/productTypes.ts +16 -16
  246. package/src/utils/balanceValue.ts +4 -4
  247. package/src/utils/createDeterministicLinkedSignerPrivateKey.ts +1 -1
  248. package/src/utils/index.ts +6 -6
  249. package/src/utils/interest.ts +26 -31
  250. package/src/utils/math/BigNumbers.ts +8 -0
  251. package/src/utils/math/bigNumber.ts +31 -0
  252. package/src/utils/math/clamp.ts +4 -7
  253. package/src/utils/math/decimalAdjustment.ts +11 -10
  254. package/src/utils/math/index.ts +5 -5
  255. package/src/utils/math/sumBigNumberBy.ts +18 -0
  256. package/src/utils/math/toBigInt.ts +3 -3
  257. package/src/utils/math/toIntegerString.ts +4 -4
  258. package/src/utils/orders/appendix/appendixIsolatedValue.ts +49 -0
  259. package/src/utils/orders/appendix/appendixTwapValue.ts +14 -19
  260. package/src/utils/orders/appendix/index.ts +2 -2
  261. package/src/utils/orders/appendix/orderAppendix.test.ts +68 -11
  262. package/src/utils/orders/appendix/packOrderAppendix.ts +10 -6
  263. package/src/utils/orders/appendix/types.ts +9 -7
  264. package/src/utils/orders/appendix/unpackOrderAppendix.ts +24 -7
  265. package/src/utils/orders/index.ts +1 -1
  266. package/src/utils/productTypeFilter.ts +2 -2
  267. package/src/utils/toPrintableObject.ts +32 -12
  268. package/dist/chunk-TUJ4HQKF.js.map +0 -1
  269. package/dist/deployments/core/deployment.InkSepolia.json +0 -13
  270. package/dist/deployments/core/deployment.arbitrumOne.json +0 -18
  271. package/dist/utils/math/BigDecimals.cjs.map +0 -1
  272. package/dist/utils/math/BigDecimals.d.cts +0 -8
  273. package/dist/utils/math/BigDecimals.d.ts +0 -8
  274. package/dist/utils/math/BigDecimals.js +0 -14
  275. package/dist/utils/math/BigDecimals.js.map +0 -1
  276. package/dist/utils/math/bigDecimal.cjs.map +0 -1
  277. package/dist/utils/math/bigDecimal.d.cts +0 -18
  278. package/dist/utils/math/bigDecimal.d.ts +0 -18
  279. package/dist/utils/math/bigDecimal.js +0 -23
  280. package/dist/utils/math/bigDecimal.js.map +0 -1
  281. package/dist/utils/math/sumBigDecimalBy.cjs.map +0 -1
  282. package/dist/utils/math/sumBigDecimalBy.d.cts +0 -10
  283. package/dist/utils/math/sumBigDecimalBy.d.ts +0 -10
  284. package/dist/utils/math/sumBigDecimalBy.js +0 -13
  285. package/dist/utils/math/sumBigDecimalBy.js.map +0 -1
  286. package/src/deployments/core/deployment.InkSepolia.json +0 -13
  287. package/src/deployments/core/deployment.arbitrumOne.json +0 -18
  288. package/src/utils/math/BigDecimals.ts +0 -8
  289. package/src/utils/math/bigDecimal.ts +0 -32
  290. package/src/utils/math/sumBigDecimalBy.ts +0 -18
@@ -0,0 +1,17 @@
1
+ import BigNumber__default from 'bignumber.js';
2
+
3
+ /**
4
+ * BigNumber is the type from `bignumber.js`.
5
+ * Includes valid values & instances for BigNumber.
6
+ *
7
+ * @see https://mikemcl.github.io/bignumber.js/
8
+ */
9
+ type BigNumberish = BigNumber__default | BigNumber__default.Value | bigint;
10
+ /**
11
+ * Converts a value to an instance of BigNumber
12
+ *
13
+ * @param val
14
+ */
15
+ declare function toBigNumber(val: BigNumberish): BigNumber__default;
16
+
17
+ export { type BigNumberish, toBigNumber };
@@ -0,0 +1,22 @@
1
+ import "../../chunk-5WRI5ZAA.js";
2
+
3
+ // src/utils/math/bigNumber.ts
4
+ import BigNumber from "bignumber.js";
5
+ function toBigNumber(val) {
6
+ if (BigNumber.isBigNumber(val)) {
7
+ return val;
8
+ }
9
+ const bnConstructorVal = (() => {
10
+ if (typeof val === "string" || typeof val === "number") {
11
+ return val;
12
+ } else if (typeof val === "bigint") {
13
+ return val.toString();
14
+ }
15
+ return JSON.stringify(val);
16
+ })();
17
+ return new BigNumber(bnConstructorVal);
18
+ }
19
+ export {
20
+ toBigNumber
21
+ };
22
+ //# sourceMappingURL=bigNumber.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../../../src/utils/math/bigNumber.ts"],"sourcesContent":["import BigNumber from 'bignumber.js';\n\n/**\n * BigNumber is the type from `bignumber.js`.\n * Includes valid values & instances for BigNumber.\n *\n * @see https://mikemcl.github.io/bignumber.js/\n */\nexport type BigNumberish = BigNumber | BigNumber.Value | bigint;\n\n/**\n * Converts a value to an instance of BigNumber\n *\n * @param val\n */\nexport function toBigNumber(val: BigNumberish): BigNumber {\n if (BigNumber.isBigNumber(val)) {\n return val;\n }\n\n const bnConstructorVal = (() => {\n if (typeof val === 'string' || typeof val === 'number') {\n return val;\n } else if (typeof val === 'bigint') {\n return val.toString();\n }\n // This is unlikely to occur, but it's here for completeness. Uses the suggestion here: https://typescript-eslint.io/rules/no-base-to-string/#alternatives\n return JSON.stringify(val);\n })();\n return new BigNumber(bnConstructorVal);\n}\n"],"mappings":";;;AAAA,OAAO,eAAe;AAef,SAAS,YAAY,KAA8B;AACxD,MAAI,UAAU,YAAY,GAAG,GAAG;AAC9B,WAAO;AAAA,EACT;AAEA,QAAM,oBAAoB,MAAM;AAC9B,QAAI,OAAO,QAAQ,YAAY,OAAO,QAAQ,UAAU;AACtD,aAAO;AAAA,IACT,WAAW,OAAO,QAAQ,UAAU;AAClC,aAAO,IAAI,SAAS;AAAA,IACtB;AAEA,WAAO,KAAK,UAAU,GAAG;AAAA,EAC3B,GAAG;AACH,SAAO,IAAI,UAAU,gBAAgB;AACvC;","names":[]}
@@ -20,10 +20,10 @@ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: tru
20
20
  // src/utils/math/clamp.ts
21
21
  var clamp_exports = {};
22
22
  __export(clamp_exports, {
23
- clampBigDecimal: () => clampBigDecimal
23
+ clampBigNumber: () => clampBigNumber
24
24
  });
25
25
  module.exports = __toCommonJS(clamp_exports);
26
- function clampBigDecimal(val, opts) {
26
+ function clampBigNumber(val, opts) {
27
27
  if (opts.min != null && val.lt(opts.min)) {
28
28
  return opts.min;
29
29
  } else if (opts.max != null && val.gt(opts.max)) {
@@ -33,6 +33,6 @@ function clampBigDecimal(val, opts) {
33
33
  }
34
34
  // Annotate the CommonJS export names for ESM import in node:
35
35
  0 && (module.exports = {
36
- clampBigDecimal
36
+ clampBigNumber
37
37
  });
38
38
  //# sourceMappingURL=clamp.cjs.map
@@ -1 +1 @@
1
- {"version":3,"sources":["../../../src/utils/math/clamp.ts"],"sourcesContent":["import { BigDecimal } from './bigDecimal';\n\ninterface ClampOptions {\n // Inclusive minimum value\n min?: BigDecimal;\n // Inclusive maximum value\n max?: BigDecimal;\n}\n\n/**\n * Clamps a value between optional minimum and maximum values.\n *\n * @param val\n * @param opts Clamp options\n */\nexport function clampBigDecimal(\n val: BigDecimal,\n opts: ClampOptions,\n): BigDecimal {\n if (opts.min != null && val.lt(opts.min)) {\n return opts.min;\n } else if (opts.max != null && val.gt(opts.max)) {\n return opts.max;\n }\n return val;\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAeO,SAAS,gBACd,KACA,MACY;AACZ,MAAI,KAAK,OAAO,QAAQ,IAAI,GAAG,KAAK,GAAG,GAAG;AACxC,WAAO,KAAK;AAAA,EACd,WAAW,KAAK,OAAO,QAAQ,IAAI,GAAG,KAAK,GAAG,GAAG;AAC/C,WAAO,KAAK;AAAA,EACd;AACA,SAAO;AACT;","names":[]}
1
+ {"version":3,"sources":["../../../src/utils/math/clamp.ts"],"sourcesContent":["import BigNumber from 'bignumber.js';\n\ninterface ClampOptions {\n // Inclusive minimum value\n min?: BigNumber;\n // Inclusive maximum value\n max?: BigNumber;\n}\n\n/**\n * Clamps a value between optional minimum and maximum values.\n *\n * @param val\n * @param opts Clamp options\n */\nexport function clampBigNumber(val: BigNumber, opts: ClampOptions): BigNumber {\n if (opts.min != null && val.lt(opts.min)) {\n return opts.min;\n } else if (opts.max != null && val.gt(opts.max)) {\n return opts.max;\n }\n return val;\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAeO,SAAS,eAAe,KAAgB,MAA+B;AAC5E,MAAI,KAAK,OAAO,QAAQ,IAAI,GAAG,KAAK,GAAG,GAAG;AACxC,WAAO,KAAK;AAAA,EACd,WAAW,KAAK,OAAO,QAAQ,IAAI,GAAG,KAAK,GAAG,GAAG;AAC/C,WAAO,KAAK;AAAA,EACd;AACA,SAAO;AACT;","names":[]}
@@ -1,8 +1,8 @@
1
- import BigDecimal from 'bignumber.js';
1
+ import BigNumber__default from 'bignumber.js';
2
2
 
3
3
  interface ClampOptions {
4
- min?: BigDecimal;
5
- max?: BigDecimal;
4
+ min?: BigNumber__default;
5
+ max?: BigNumber__default;
6
6
  }
7
7
  /**
8
8
  * Clamps a value between optional minimum and maximum values.
@@ -10,6 +10,6 @@ interface ClampOptions {
10
10
  * @param val
11
11
  * @param opts Clamp options
12
12
  */
13
- declare function clampBigDecimal(val: BigDecimal, opts: ClampOptions): BigDecimal;
13
+ declare function clampBigNumber(val: BigNumber__default, opts: ClampOptions): BigNumber__default;
14
14
 
15
- export { clampBigDecimal };
15
+ export { clampBigNumber };
@@ -1,8 +1,8 @@
1
- import BigDecimal from 'bignumber.js';
1
+ import BigNumber__default from 'bignumber.js';
2
2
 
3
3
  interface ClampOptions {
4
- min?: BigDecimal;
5
- max?: BigDecimal;
4
+ min?: BigNumber__default;
5
+ max?: BigNumber__default;
6
6
  }
7
7
  /**
8
8
  * Clamps a value between optional minimum and maximum values.
@@ -10,6 +10,6 @@ interface ClampOptions {
10
10
  * @param val
11
11
  * @param opts Clamp options
12
12
  */
13
- declare function clampBigDecimal(val: BigDecimal, opts: ClampOptions): BigDecimal;
13
+ declare function clampBigNumber(val: BigNumber__default, opts: ClampOptions): BigNumber__default;
14
14
 
15
- export { clampBigDecimal };
15
+ export { clampBigNumber };
@@ -1,7 +1,7 @@
1
1
  import "../../chunk-5WRI5ZAA.js";
2
2
 
3
3
  // src/utils/math/clamp.ts
4
- function clampBigDecimal(val, opts) {
4
+ function clampBigNumber(val, opts) {
5
5
  if (opts.min != null && val.lt(opts.min)) {
6
6
  return opts.min;
7
7
  } else if (opts.max != null && val.gt(opts.max)) {
@@ -10,6 +10,6 @@ function clampBigDecimal(val, opts) {
10
10
  return val;
11
11
  }
12
12
  export {
13
- clampBigDecimal
13
+ clampBigNumber
14
14
  };
15
15
  //# sourceMappingURL=clamp.js.map
@@ -1 +1 @@
1
- {"version":3,"sources":["../../../src/utils/math/clamp.ts"],"sourcesContent":["import { BigDecimal } from './bigDecimal';\n\ninterface ClampOptions {\n // Inclusive minimum value\n min?: BigDecimal;\n // Inclusive maximum value\n max?: BigDecimal;\n}\n\n/**\n * Clamps a value between optional minimum and maximum values.\n *\n * @param val\n * @param opts Clamp options\n */\nexport function clampBigDecimal(\n val: BigDecimal,\n opts: ClampOptions,\n): BigDecimal {\n if (opts.min != null && val.lt(opts.min)) {\n return opts.min;\n } else if (opts.max != null && val.gt(opts.max)) {\n return opts.max;\n }\n return val;\n}\n"],"mappings":";;;AAeO,SAAS,gBACd,KACA,MACY;AACZ,MAAI,KAAK,OAAO,QAAQ,IAAI,GAAG,KAAK,GAAG,GAAG;AACxC,WAAO,KAAK;AAAA,EACd,WAAW,KAAK,OAAO,QAAQ,IAAI,GAAG,KAAK,GAAG,GAAG;AAC/C,WAAO,KAAK;AAAA,EACd;AACA,SAAO;AACT;","names":[]}
1
+ {"version":3,"sources":["../../../src/utils/math/clamp.ts"],"sourcesContent":["import BigNumber from 'bignumber.js';\n\ninterface ClampOptions {\n // Inclusive minimum value\n min?: BigNumber;\n // Inclusive maximum value\n max?: BigNumber;\n}\n\n/**\n * Clamps a value between optional minimum and maximum values.\n *\n * @param val\n * @param opts Clamp options\n */\nexport function clampBigNumber(val: BigNumber, opts: ClampOptions): BigNumber {\n if (opts.min != null && val.lt(opts.min)) {\n return opts.min;\n } else if (opts.max != null && val.gt(opts.max)) {\n return opts.max;\n }\n return val;\n}\n"],"mappings":";;;AAeO,SAAS,eAAe,KAAgB,MAA+B;AAC5E,MAAI,KAAK,OAAO,QAAQ,IAAI,GAAG,KAAK,GAAG,GAAG;AACxC,WAAO,KAAK;AAAA,EACd,WAAW,KAAK,OAAO,QAAQ,IAAI,GAAG,KAAK,GAAG,GAAG;AAC/C,WAAO,KAAK;AAAA,EACd;AACA,SAAO;AACT;","names":[]}
@@ -25,15 +25,15 @@ __export(decimalAdjustment_exports, {
25
25
  removeDecimals: () => removeDecimals
26
26
  });
27
27
  module.exports = __toCommonJS(decimalAdjustment_exports);
28
- var import_bigDecimal = require("./bigDecimal.cjs");
28
+ var import_bigNumber = require("./bigNumber.cjs");
29
29
  var NADO_PRODUCT_DECIMALS = 18;
30
30
  function addDecimals(value, decimals = NADO_PRODUCT_DECIMALS) {
31
31
  const getResult = () => {
32
32
  if (value == null) {
33
33
  return void 0;
34
34
  }
35
- const adjustedValue = (0, import_bigDecimal.toBigDecimal)(value).multipliedBy(
36
- (0, import_bigDecimal.toBigDecimal)(10).pow(decimals)
35
+ const adjustedValue = (0, import_bigNumber.toBigNumber)(value).multipliedBy(
36
+ (0, import_bigNumber.toBigNumber)(10).pow(decimals)
37
37
  );
38
38
  return typeof value === "number" ? adjustedValue.toNumber() : adjustedValue;
39
39
  };
@@ -44,8 +44,8 @@ function removeDecimals(value, decimals = NADO_PRODUCT_DECIMALS) {
44
44
  if (value == null) {
45
45
  return void 0;
46
46
  }
47
- const adjustedValue = (0, import_bigDecimal.toBigDecimal)(value).dividedBy(
48
- (0, import_bigDecimal.toBigDecimal)(10).pow(decimals)
47
+ const adjustedValue = (0, import_bigNumber.toBigNumber)(value).dividedBy(
48
+ (0, import_bigNumber.toBigNumber)(10).pow(decimals)
49
49
  );
50
50
  return typeof value === "number" ? adjustedValue.toNumber() : adjustedValue;
51
51
  };
@@ -1 +1 @@
1
- {"version":3,"sources":["../../../src/utils/math/decimalAdjustment.ts"],"sourcesContent":["import { BigDecimal, BigDecimalish, toBigDecimal } from './bigDecimal';\n\n/**\n * All Nado balances have 18 decimals. Ex. 1e18 = 1.0\n */\nexport const NADO_PRODUCT_DECIMALS = 18;\n\n/**\n * Determines the result type after adjusting decimals based on the input type `T`.\n *\n * - If `T` is `undefined`, the result is `undefined`.\n * - If `T` is a `number`, the result is a `number`.\n * - Otherwise, the result is a `BigDecimal`.\n */\ntype AdjustDecimalsResult<T extends BigDecimalish | undefined> =\n T extends undefined ? undefined : T extends number ? number : BigDecimal;\n\n/**\n * Adds the specified # of decimals to the number. For example, value = 1, decimals = 2, returns 100.\n *\n * @param value can be undefined for better developer experience. If undefined, returns undefined.\n * @param decimals number of decimal places to add, defaults to 18, which is the standard within Nado\n */\n\nexport function addDecimals<T extends BigDecimalish | undefined>(\n value: T,\n decimals: number = NADO_PRODUCT_DECIMALS,\n): AdjustDecimalsResult<T> {\n const getResult = () => {\n if (value == null) {\n return undefined;\n }\n\n const adjustedValue = toBigDecimal(value).multipliedBy(\n toBigDecimal(10).pow(decimals),\n );\n return typeof value === 'number' ? adjustedValue.toNumber() : adjustedValue;\n };\n\n return getResult() as AdjustDecimalsResult<T>;\n}\n\n/**\n * Removes the specified # of decimals from the number. For example, value = 100, decimals = 2, returns 1.\n *\n * @param value can be undefined for better developer experience. If undefined, returns undefined.\n * @param decimals number of decimal places to remove, defaults to 18, which is the standard within Nado\n */\nexport function removeDecimals<T extends BigDecimalish | undefined>(\n value: T,\n decimals: number = NADO_PRODUCT_DECIMALS,\n): AdjustDecimalsResult<T> {\n const getResult = () => {\n if (value == null) {\n return undefined;\n }\n\n const adjustedValue = toBigDecimal(value).dividedBy(\n toBigDecimal(10).pow(decimals),\n );\n return typeof value === 'number' ? adjustedValue.toNumber() : adjustedValue;\n };\n\n return getResult() as AdjustDecimalsResult<T>;\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,wBAAwD;AAKjD,IAAM,wBAAwB;AAmB9B,SAAS,YACd,OACA,WAAmB,uBACM;AACzB,QAAM,YAAY,MAAM;AACtB,QAAI,SAAS,MAAM;AACjB,aAAO;AAAA,IACT;AAEA,UAAM,oBAAgB,gCAAa,KAAK,EAAE;AAAA,UACxC,gCAAa,EAAE,EAAE,IAAI,QAAQ;AAAA,IAC/B;AACA,WAAO,OAAO,UAAU,WAAW,cAAc,SAAS,IAAI;AAAA,EAChE;AAEA,SAAO,UAAU;AACnB;AAQO,SAAS,eACd,OACA,WAAmB,uBACM;AACzB,QAAM,YAAY,MAAM;AACtB,QAAI,SAAS,MAAM;AACjB,aAAO;AAAA,IACT;AAEA,UAAM,oBAAgB,gCAAa,KAAK,EAAE;AAAA,UACxC,gCAAa,EAAE,EAAE,IAAI,QAAQ;AAAA,IAC/B;AACA,WAAO,OAAO,UAAU,WAAW,cAAc,SAAS,IAAI;AAAA,EAChE;AAEA,SAAO,UAAU;AACnB;","names":[]}
1
+ {"version":3,"sources":["../../../src/utils/math/decimalAdjustment.ts"],"sourcesContent":["import BigNumber from 'bignumber.js';\nimport { BigNumberish, toBigNumber } from './bigNumber';\n\n/**\n * All Nado balances have 18 decimals. Ex. 1e18 = 1.0\n */\nexport const NADO_PRODUCT_DECIMALS = 18;\n\n/**\n * Determines the result type after adjusting decimals based on the input type `T`.\n *\n * - If `T` is `undefined`, the result is `undefined`.\n * - If `T` is a `number`, the result is a `number`.\n * - Otherwise, the result is a `BigNumber`.\n */\ntype AdjustDecimalsResult<T extends BigNumberish | undefined> =\n T extends undefined ? undefined : T extends number ? number : BigNumber;\n\n/**\n * Adds the specified # of decimals to the number. For example, value = 1, decimals = 2, returns 100.\n *\n * @param value can be undefined for better developer experience. If undefined, returns undefined.\n * @param decimals number of decimal places to add, defaults to 18, which is the standard within Nado\n */\n\nexport function addDecimals<T extends BigNumberish | undefined>(\n value: T,\n decimals: number = NADO_PRODUCT_DECIMALS,\n): AdjustDecimalsResult<T> {\n const getResult = () => {\n if (value == null) {\n return undefined;\n }\n\n const adjustedValue = toBigNumber(value).multipliedBy(\n toBigNumber(10).pow(decimals),\n );\n return typeof value === 'number' ? adjustedValue.toNumber() : adjustedValue;\n };\n\n return getResult() as AdjustDecimalsResult<T>;\n}\n\n/**\n * Removes the specified # of decimals from the number. For example, value = 100, decimals = 2, returns 1.\n *\n * @param value can be undefined for better developer experience. If undefined, returns undefined.\n * @param decimals number of decimal places to remove, defaults to 18, which is the standard within Nado\n */\nexport function removeDecimals<T extends BigNumberish | undefined>(\n value: T,\n decimals: number = NADO_PRODUCT_DECIMALS,\n): AdjustDecimalsResult<T> {\n const getResult = () => {\n if (value == null) {\n return undefined;\n }\n\n const adjustedValue = toBigNumber(value).dividedBy(\n toBigNumber(10).pow(decimals),\n );\n return typeof value === 'number' ? adjustedValue.toNumber() : adjustedValue;\n };\n\n return getResult() as AdjustDecimalsResult<T>;\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AACA,uBAA0C;AAKnC,IAAM,wBAAwB;AAmB9B,SAAS,YACd,OACA,WAAmB,uBACM;AACzB,QAAM,YAAY,MAAM;AACtB,QAAI,SAAS,MAAM;AACjB,aAAO;AAAA,IACT;AAEA,UAAM,oBAAgB,8BAAY,KAAK,EAAE;AAAA,UACvC,8BAAY,EAAE,EAAE,IAAI,QAAQ;AAAA,IAC9B;AACA,WAAO,OAAO,UAAU,WAAW,cAAc,SAAS,IAAI;AAAA,EAChE;AAEA,SAAO,UAAU;AACnB;AAQO,SAAS,eACd,OACA,WAAmB,uBACM;AACzB,QAAM,YAAY,MAAM;AACtB,QAAI,SAAS,MAAM;AACjB,aAAO;AAAA,IACT;AAEA,UAAM,oBAAgB,8BAAY,KAAK,EAAE;AAAA,UACvC,8BAAY,EAAE,EAAE,IAAI,QAAQ;AAAA,IAC9B;AACA,WAAO,OAAO,UAAU,WAAW,cAAc,SAAS,IAAI;AAAA,EAChE;AAEA,SAAO,UAAU;AACnB;","names":[]}
@@ -1,5 +1,5 @@
1
- import { BigDecimalish } from './bigDecimal.cjs';
2
- import BigDecimal from 'bignumber.js';
1
+ import BigNumber__default from 'bignumber.js';
2
+ import { BigNumberish } from './bigNumber.cjs';
3
3
 
4
4
  /**
5
5
  * All Nado balances have 18 decimals. Ex. 1e18 = 1.0
@@ -10,22 +10,22 @@ declare const NADO_PRODUCT_DECIMALS = 18;
10
10
  *
11
11
  * - If `T` is `undefined`, the result is `undefined`.
12
12
  * - If `T` is a `number`, the result is a `number`.
13
- * - Otherwise, the result is a `BigDecimal`.
13
+ * - Otherwise, the result is a `BigNumber`.
14
14
  */
15
- type AdjustDecimalsResult<T extends BigDecimalish | undefined> = T extends undefined ? undefined : T extends number ? number : BigDecimal;
15
+ type AdjustDecimalsResult<T extends BigNumberish | undefined> = T extends undefined ? undefined : T extends number ? number : BigNumber__default;
16
16
  /**
17
17
  * Adds the specified # of decimals to the number. For example, value = 1, decimals = 2, returns 100.
18
18
  *
19
19
  * @param value can be undefined for better developer experience. If undefined, returns undefined.
20
20
  * @param decimals number of decimal places to add, defaults to 18, which is the standard within Nado
21
21
  */
22
- declare function addDecimals<T extends BigDecimalish | undefined>(value: T, decimals?: number): AdjustDecimalsResult<T>;
22
+ declare function addDecimals<T extends BigNumberish | undefined>(value: T, decimals?: number): AdjustDecimalsResult<T>;
23
23
  /**
24
24
  * Removes the specified # of decimals from the number. For example, value = 100, decimals = 2, returns 1.
25
25
  *
26
26
  * @param value can be undefined for better developer experience. If undefined, returns undefined.
27
27
  * @param decimals number of decimal places to remove, defaults to 18, which is the standard within Nado
28
28
  */
29
- declare function removeDecimals<T extends BigDecimalish | undefined>(value: T, decimals?: number): AdjustDecimalsResult<T>;
29
+ declare function removeDecimals<T extends BigNumberish | undefined>(value: T, decimals?: number): AdjustDecimalsResult<T>;
30
30
 
31
31
  export { NADO_PRODUCT_DECIMALS, addDecimals, removeDecimals };
@@ -1,5 +1,5 @@
1
- import { BigDecimalish } from './bigDecimal.js';
2
- import BigDecimal from 'bignumber.js';
1
+ import BigNumber__default from 'bignumber.js';
2
+ import { BigNumberish } from './bigNumber.js';
3
3
 
4
4
  /**
5
5
  * All Nado balances have 18 decimals. Ex. 1e18 = 1.0
@@ -10,22 +10,22 @@ declare const NADO_PRODUCT_DECIMALS = 18;
10
10
  *
11
11
  * - If `T` is `undefined`, the result is `undefined`.
12
12
  * - If `T` is a `number`, the result is a `number`.
13
- * - Otherwise, the result is a `BigDecimal`.
13
+ * - Otherwise, the result is a `BigNumber`.
14
14
  */
15
- type AdjustDecimalsResult<T extends BigDecimalish | undefined> = T extends undefined ? undefined : T extends number ? number : BigDecimal;
15
+ type AdjustDecimalsResult<T extends BigNumberish | undefined> = T extends undefined ? undefined : T extends number ? number : BigNumber__default;
16
16
  /**
17
17
  * Adds the specified # of decimals to the number. For example, value = 1, decimals = 2, returns 100.
18
18
  *
19
19
  * @param value can be undefined for better developer experience. If undefined, returns undefined.
20
20
  * @param decimals number of decimal places to add, defaults to 18, which is the standard within Nado
21
21
  */
22
- declare function addDecimals<T extends BigDecimalish | undefined>(value: T, decimals?: number): AdjustDecimalsResult<T>;
22
+ declare function addDecimals<T extends BigNumberish | undefined>(value: T, decimals?: number): AdjustDecimalsResult<T>;
23
23
  /**
24
24
  * Removes the specified # of decimals from the number. For example, value = 100, decimals = 2, returns 1.
25
25
  *
26
26
  * @param value can be undefined for better developer experience. If undefined, returns undefined.
27
27
  * @param decimals number of decimal places to remove, defaults to 18, which is the standard within Nado
28
28
  */
29
- declare function removeDecimals<T extends BigDecimalish | undefined>(value: T, decimals?: number): AdjustDecimalsResult<T>;
29
+ declare function removeDecimals<T extends BigNumberish | undefined>(value: T, decimals?: number): AdjustDecimalsResult<T>;
30
30
 
31
31
  export { NADO_PRODUCT_DECIMALS, addDecimals, removeDecimals };
@@ -1,15 +1,15 @@
1
1
  import "../../chunk-5WRI5ZAA.js";
2
2
 
3
3
  // src/utils/math/decimalAdjustment.ts
4
- import { toBigDecimal } from "./bigDecimal.js";
4
+ import { toBigNumber } from "./bigNumber.js";
5
5
  var NADO_PRODUCT_DECIMALS = 18;
6
6
  function addDecimals(value, decimals = NADO_PRODUCT_DECIMALS) {
7
7
  const getResult = () => {
8
8
  if (value == null) {
9
9
  return void 0;
10
10
  }
11
- const adjustedValue = toBigDecimal(value).multipliedBy(
12
- toBigDecimal(10).pow(decimals)
11
+ const adjustedValue = toBigNumber(value).multipliedBy(
12
+ toBigNumber(10).pow(decimals)
13
13
  );
14
14
  return typeof value === "number" ? adjustedValue.toNumber() : adjustedValue;
15
15
  };
@@ -20,8 +20,8 @@ function removeDecimals(value, decimals = NADO_PRODUCT_DECIMALS) {
20
20
  if (value == null) {
21
21
  return void 0;
22
22
  }
23
- const adjustedValue = toBigDecimal(value).dividedBy(
24
- toBigDecimal(10).pow(decimals)
23
+ const adjustedValue = toBigNumber(value).dividedBy(
24
+ toBigNumber(10).pow(decimals)
25
25
  );
26
26
  return typeof value === "number" ? adjustedValue.toNumber() : adjustedValue;
27
27
  };
@@ -1 +1 @@
1
- {"version":3,"sources":["../../../src/utils/math/decimalAdjustment.ts"],"sourcesContent":["import { BigDecimal, BigDecimalish, toBigDecimal } from './bigDecimal';\n\n/**\n * All Nado balances have 18 decimals. Ex. 1e18 = 1.0\n */\nexport const NADO_PRODUCT_DECIMALS = 18;\n\n/**\n * Determines the result type after adjusting decimals based on the input type `T`.\n *\n * - If `T` is `undefined`, the result is `undefined`.\n * - If `T` is a `number`, the result is a `number`.\n * - Otherwise, the result is a `BigDecimal`.\n */\ntype AdjustDecimalsResult<T extends BigDecimalish | undefined> =\n T extends undefined ? undefined : T extends number ? number : BigDecimal;\n\n/**\n * Adds the specified # of decimals to the number. For example, value = 1, decimals = 2, returns 100.\n *\n * @param value can be undefined for better developer experience. If undefined, returns undefined.\n * @param decimals number of decimal places to add, defaults to 18, which is the standard within Nado\n */\n\nexport function addDecimals<T extends BigDecimalish | undefined>(\n value: T,\n decimals: number = NADO_PRODUCT_DECIMALS,\n): AdjustDecimalsResult<T> {\n const getResult = () => {\n if (value == null) {\n return undefined;\n }\n\n const adjustedValue = toBigDecimal(value).multipliedBy(\n toBigDecimal(10).pow(decimals),\n );\n return typeof value === 'number' ? adjustedValue.toNumber() : adjustedValue;\n };\n\n return getResult() as AdjustDecimalsResult<T>;\n}\n\n/**\n * Removes the specified # of decimals from the number. For example, value = 100, decimals = 2, returns 1.\n *\n * @param value can be undefined for better developer experience. If undefined, returns undefined.\n * @param decimals number of decimal places to remove, defaults to 18, which is the standard within Nado\n */\nexport function removeDecimals<T extends BigDecimalish | undefined>(\n value: T,\n decimals: number = NADO_PRODUCT_DECIMALS,\n): AdjustDecimalsResult<T> {\n const getResult = () => {\n if (value == null) {\n return undefined;\n }\n\n const adjustedValue = toBigDecimal(value).dividedBy(\n toBigDecimal(10).pow(decimals),\n );\n return typeof value === 'number' ? adjustedValue.toNumber() : adjustedValue;\n };\n\n return getResult() as AdjustDecimalsResult<T>;\n}\n"],"mappings":";;;AAAA,SAAoC,oBAAoB;AAKjD,IAAM,wBAAwB;AAmB9B,SAAS,YACd,OACA,WAAmB,uBACM;AACzB,QAAM,YAAY,MAAM;AACtB,QAAI,SAAS,MAAM;AACjB,aAAO;AAAA,IACT;AAEA,UAAM,gBAAgB,aAAa,KAAK,EAAE;AAAA,MACxC,aAAa,EAAE,EAAE,IAAI,QAAQ;AAAA,IAC/B;AACA,WAAO,OAAO,UAAU,WAAW,cAAc,SAAS,IAAI;AAAA,EAChE;AAEA,SAAO,UAAU;AACnB;AAQO,SAAS,eACd,OACA,WAAmB,uBACM;AACzB,QAAM,YAAY,MAAM;AACtB,QAAI,SAAS,MAAM;AACjB,aAAO;AAAA,IACT;AAEA,UAAM,gBAAgB,aAAa,KAAK,EAAE;AAAA,MACxC,aAAa,EAAE,EAAE,IAAI,QAAQ;AAAA,IAC/B;AACA,WAAO,OAAO,UAAU,WAAW,cAAc,SAAS,IAAI;AAAA,EAChE;AAEA,SAAO,UAAU;AACnB;","names":[]}
1
+ {"version":3,"sources":["../../../src/utils/math/decimalAdjustment.ts"],"sourcesContent":["import BigNumber from 'bignumber.js';\nimport { BigNumberish, toBigNumber } from './bigNumber';\n\n/**\n * All Nado balances have 18 decimals. Ex. 1e18 = 1.0\n */\nexport const NADO_PRODUCT_DECIMALS = 18;\n\n/**\n * Determines the result type after adjusting decimals based on the input type `T`.\n *\n * - If `T` is `undefined`, the result is `undefined`.\n * - If `T` is a `number`, the result is a `number`.\n * - Otherwise, the result is a `BigNumber`.\n */\ntype AdjustDecimalsResult<T extends BigNumberish | undefined> =\n T extends undefined ? undefined : T extends number ? number : BigNumber;\n\n/**\n * Adds the specified # of decimals to the number. For example, value = 1, decimals = 2, returns 100.\n *\n * @param value can be undefined for better developer experience. If undefined, returns undefined.\n * @param decimals number of decimal places to add, defaults to 18, which is the standard within Nado\n */\n\nexport function addDecimals<T extends BigNumberish | undefined>(\n value: T,\n decimals: number = NADO_PRODUCT_DECIMALS,\n): AdjustDecimalsResult<T> {\n const getResult = () => {\n if (value == null) {\n return undefined;\n }\n\n const adjustedValue = toBigNumber(value).multipliedBy(\n toBigNumber(10).pow(decimals),\n );\n return typeof value === 'number' ? adjustedValue.toNumber() : adjustedValue;\n };\n\n return getResult() as AdjustDecimalsResult<T>;\n}\n\n/**\n * Removes the specified # of decimals from the number. For example, value = 100, decimals = 2, returns 1.\n *\n * @param value can be undefined for better developer experience. If undefined, returns undefined.\n * @param decimals number of decimal places to remove, defaults to 18, which is the standard within Nado\n */\nexport function removeDecimals<T extends BigNumberish | undefined>(\n value: T,\n decimals: number = NADO_PRODUCT_DECIMALS,\n): AdjustDecimalsResult<T> {\n const getResult = () => {\n if (value == null) {\n return undefined;\n }\n\n const adjustedValue = toBigNumber(value).dividedBy(\n toBigNumber(10).pow(decimals),\n );\n return typeof value === 'number' ? adjustedValue.toNumber() : adjustedValue;\n };\n\n return getResult() as AdjustDecimalsResult<T>;\n}\n"],"mappings":";;;AACA,SAAuB,mBAAmB;AAKnC,IAAM,wBAAwB;AAmB9B,SAAS,YACd,OACA,WAAmB,uBACM;AACzB,QAAM,YAAY,MAAM;AACtB,QAAI,SAAS,MAAM;AACjB,aAAO;AAAA,IACT;AAEA,UAAM,gBAAgB,YAAY,KAAK,EAAE;AAAA,MACvC,YAAY,EAAE,EAAE,IAAI,QAAQ;AAAA,IAC9B;AACA,WAAO,OAAO,UAAU,WAAW,cAAc,SAAS,IAAI;AAAA,EAChE;AAEA,SAAO,UAAU;AACnB;AAQO,SAAS,eACd,OACA,WAAmB,uBACM;AACzB,QAAM,YAAY,MAAM;AACtB,QAAI,SAAS,MAAM;AACjB,aAAO;AAAA,IACT;AAEA,UAAM,gBAAgB,YAAY,KAAK,EAAE;AAAA,MACvC,YAAY,EAAE,EAAE,IAAI,QAAQ;AAAA,IAC9B;AACA,WAAO,OAAO,UAAU,WAAW,cAAc,SAAS,IAAI;AAAA,EAChE;AAEA,SAAO,UAAU;AACnB;","names":[]}
@@ -17,21 +17,21 @@ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: tru
17
17
  // src/utils/math/index.ts
18
18
  var math_exports = {};
19
19
  module.exports = __toCommonJS(math_exports);
20
- __reExport(math_exports, require("./bigDecimal.cjs"), module.exports);
21
- __reExport(math_exports, require("./toIntegerString.cjs"), module.exports);
22
- __reExport(math_exports, require("./toBigInt.cjs"), module.exports);
20
+ __reExport(math_exports, require("./bigNumber.cjs"), module.exports);
21
+ __reExport(math_exports, require("./BigNumbers.cjs"), module.exports);
23
22
  __reExport(math_exports, require("./clamp.cjs"), module.exports);
24
- __reExport(math_exports, require("./sumBigDecimalBy.cjs"), module.exports);
25
23
  __reExport(math_exports, require("./decimalAdjustment.cjs"), module.exports);
26
- __reExport(math_exports, require("./BigDecimals.cjs"), module.exports);
24
+ __reExport(math_exports, require("./sumBigNumberBy.cjs"), module.exports);
25
+ __reExport(math_exports, require("./toBigInt.cjs"), module.exports);
26
+ __reExport(math_exports, require("./toIntegerString.cjs"), module.exports);
27
27
  // Annotate the CommonJS export names for ESM import in node:
28
28
  0 && (module.exports = {
29
- ...require("./bigDecimal.cjs"),
30
- ...require("./toIntegerString.cjs"),
31
- ...require("./toBigInt.cjs"),
29
+ ...require("./bigNumber.cjs"),
30
+ ...require("./BigNumbers.cjs"),
32
31
  ...require("./clamp.cjs"),
33
- ...require("./sumBigDecimalBy.cjs"),
34
32
  ...require("./decimalAdjustment.cjs"),
35
- ...require("./BigDecimals.cjs")
33
+ ...require("./sumBigNumberBy.cjs"),
34
+ ...require("./toBigInt.cjs"),
35
+ ...require("./toIntegerString.cjs")
36
36
  });
37
37
  //# sourceMappingURL=index.cjs.map
@@ -1 +1 @@
1
- {"version":3,"sources":["../../../src/utils/math/index.ts"],"sourcesContent":["export * from './bigDecimal';\nexport * from './toIntegerString';\nexport * from './toBigInt';\nexport * from './clamp';\nexport * from './sumBigDecimalBy';\nexport * from './decimalAdjustment';\nexport * from './BigDecimals';\n"],"mappings":";;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA,yBAAc,6BAAd;AACA,yBAAc,kCADd;AAEA,yBAAc,2BAFd;AAGA,yBAAc,wBAHd;AAIA,yBAAc,kCAJd;AAKA,yBAAc,oCALd;AAMA,yBAAc,8BANd;","names":[]}
1
+ {"version":3,"sources":["../../../src/utils/math/index.ts"],"sourcesContent":["export * from './bigNumber';\nexport * from './BigNumbers';\nexport * from './clamp';\nexport * from './decimalAdjustment';\nexport * from './sumBigNumberBy';\nexport * from './toBigInt';\nexport * from './toIntegerString';\n"],"mappings":";;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA,yBAAc,4BAAd;AACA,yBAAc,6BADd;AAEA,yBAAc,wBAFd;AAGA,yBAAc,oCAHd;AAIA,yBAAc,iCAJd;AAKA,yBAAc,2BALd;AAMA,yBAAc,kCANd;","names":[]}
@@ -1,8 +1,8 @@
1
- export { BigDecimalish, toBigDecimal } from './bigDecimal.cjs';
2
- export { toIntegerString } from './toIntegerString.cjs';
3
- export { toBigInt } from './toBigInt.cjs';
4
- export { clampBigDecimal } from './clamp.cjs';
5
- export { sumBigDecimalBy } from './sumBigDecimalBy.cjs';
1
+ export { BigNumberish, toBigNumber } from './bigNumber.cjs';
2
+ export { BigNumbers } from './BigNumbers.cjs';
3
+ export { clampBigNumber } from './clamp.cjs';
6
4
  export { NADO_PRODUCT_DECIMALS, addDecimals, removeDecimals } from './decimalAdjustment.cjs';
7
- export { BigDecimals } from './BigDecimals.cjs';
8
- export { default as BigDecimal } from 'bignumber.js';
5
+ export { sumBigNumberBy } from './sumBigNumberBy.cjs';
6
+ export { toBigInt } from './toBigInt.cjs';
7
+ export { toIntegerString } from './toIntegerString.cjs';
8
+ import 'bignumber.js';
@@ -1,8 +1,8 @@
1
- export { BigDecimalish, toBigDecimal } from './bigDecimal.js';
2
- export { toIntegerString } from './toIntegerString.js';
3
- export { toBigInt } from './toBigInt.js';
4
- export { clampBigDecimal } from './clamp.js';
5
- export { sumBigDecimalBy } from './sumBigDecimalBy.js';
1
+ export { BigNumberish, toBigNumber } from './bigNumber.js';
2
+ export { BigNumbers } from './BigNumbers.js';
3
+ export { clampBigNumber } from './clamp.js';
6
4
  export { NADO_PRODUCT_DECIMALS, addDecimals, removeDecimals } from './decimalAdjustment.js';
7
- export { BigDecimals } from './BigDecimals.js';
8
- export { default as BigDecimal } from 'bignumber.js';
5
+ export { sumBigNumberBy } from './sumBigNumberBy.js';
6
+ export { toBigInt } from './toBigInt.js';
7
+ export { toIntegerString } from './toIntegerString.js';
8
+ import 'bignumber.js';
@@ -1,9 +1,9 @@
1
1
  // src/utils/math/index.ts
2
- export * from "./bigDecimal.js";
3
- export * from "./toIntegerString.js";
4
- export * from "./toBigInt.js";
2
+ export * from "./bigNumber.js";
3
+ export * from "./BigNumbers.js";
5
4
  export * from "./clamp.js";
6
- export * from "./sumBigDecimalBy.js";
7
5
  export * from "./decimalAdjustment.js";
8
- export * from "./BigDecimals.js";
6
+ export * from "./sumBigNumberBy.js";
7
+ export * from "./toBigInt.js";
8
+ export * from "./toIntegerString.js";
9
9
  //# sourceMappingURL=index.js.map
@@ -1 +1 @@
1
- {"version":3,"sources":["../../../src/utils/math/index.ts"],"sourcesContent":["export * from './bigDecimal';\nexport * from './toIntegerString';\nexport * from './toBigInt';\nexport * from './clamp';\nexport * from './sumBigDecimalBy';\nexport * from './decimalAdjustment';\nexport * from './BigDecimals';\n"],"mappings":";AAAA,cAAc;AACd,cAAc;AACd,cAAc;AACd,cAAc;AACd,cAAc;AACd,cAAc;AACd,cAAc;","names":[]}
1
+ {"version":3,"sources":["../../../src/utils/math/index.ts"],"sourcesContent":["export * from './bigNumber';\nexport * from './BigNumbers';\nexport * from './clamp';\nexport * from './decimalAdjustment';\nexport * from './sumBigNumberBy';\nexport * from './toBigInt';\nexport * from './toIntegerString';\n"],"mappings":";AAAA,cAAc;AACd,cAAc;AACd,cAAc;AACd,cAAc;AACd,cAAc;AACd,cAAc;AACd,cAAc;","names":[]}
@@ -17,20 +17,20 @@ var __copyProps = (to, from, except, desc) => {
17
17
  };
18
18
  var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
19
19
 
20
- // src/utils/math/sumBigDecimalBy.ts
21
- var sumBigDecimalBy_exports = {};
22
- __export(sumBigDecimalBy_exports, {
23
- sumBigDecimalBy: () => sumBigDecimalBy
20
+ // src/utils/math/sumBigNumberBy.ts
21
+ var sumBigNumberBy_exports = {};
22
+ __export(sumBigNumberBy_exports, {
23
+ sumBigNumberBy: () => sumBigNumberBy
24
24
  });
25
- module.exports = __toCommonJS(sumBigDecimalBy_exports);
26
- var import_BigDecimals = require("./BigDecimals.cjs");
27
- function sumBigDecimalBy(collection, iteratee) {
25
+ module.exports = __toCommonJS(sumBigNumberBy_exports);
26
+ var import_BigNumbers = require("./BigNumbers.cjs");
27
+ function sumBigNumberBy(collection, iteratee) {
28
28
  return collection?.reduce((total, item) => {
29
29
  return total.plus(iteratee(item));
30
- }, import_BigDecimals.BigDecimals.ZERO) ?? import_BigDecimals.BigDecimals.ZERO;
30
+ }, import_BigNumbers.BigNumbers.ZERO) ?? import_BigNumbers.BigNumbers.ZERO;
31
31
  }
32
32
  // Annotate the CommonJS export names for ESM import in node:
33
33
  0 && (module.exports = {
34
- sumBigDecimalBy
34
+ sumBigNumberBy
35
35
  });
36
- //# sourceMappingURL=sumBigDecimalBy.cjs.map
36
+ //# sourceMappingURL=sumBigNumberBy.cjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../../../src/utils/math/sumBigNumberBy.ts"],"sourcesContent":["import BigNumber from 'bignumber.js';\nimport { BigNumbers } from './BigNumbers';\n\n/**\n * Util function to sum BigNumber values, inspired by Lodash\n * @param collection\n * @param iteratee\n */\nexport function sumBigNumberBy<T>(\n collection: T[] | null | undefined,\n iteratee: (value: T) => BigNumber.Value,\n): BigNumber {\n return (\n collection?.reduce((total, item) => {\n return total.plus(iteratee(item));\n }, BigNumbers.ZERO) ?? BigNumbers.ZERO\n );\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AACA,wBAA2B;AAOpB,SAAS,eACd,YACA,UACW;AACX,SACE,YAAY,OAAO,CAAC,OAAO,SAAS;AAClC,WAAO,MAAM,KAAK,SAAS,IAAI,CAAC;AAAA,EAClC,GAAG,6BAAW,IAAI,KAAK,6BAAW;AAEtC;","names":[]}
@@ -0,0 +1,10 @@
1
+ import BigNumber__default from 'bignumber.js';
2
+
3
+ /**
4
+ * Util function to sum BigNumber values, inspired by Lodash
5
+ * @param collection
6
+ * @param iteratee
7
+ */
8
+ declare function sumBigNumberBy<T>(collection: T[] | null | undefined, iteratee: (value: T) => BigNumber__default.Value): BigNumber__default;
9
+
10
+ export { sumBigNumberBy };
@@ -0,0 +1,10 @@
1
+ import BigNumber__default from 'bignumber.js';
2
+
3
+ /**
4
+ * Util function to sum BigNumber values, inspired by Lodash
5
+ * @param collection
6
+ * @param iteratee
7
+ */
8
+ declare function sumBigNumberBy<T>(collection: T[] | null | undefined, iteratee: (value: T) => BigNumber__default.Value): BigNumber__default;
9
+
10
+ export { sumBigNumberBy };
@@ -0,0 +1,13 @@
1
+ import "../../chunk-5WRI5ZAA.js";
2
+
3
+ // src/utils/math/sumBigNumberBy.ts
4
+ import { BigNumbers } from "./BigNumbers.js";
5
+ function sumBigNumberBy(collection, iteratee) {
6
+ return collection?.reduce((total, item) => {
7
+ return total.plus(iteratee(item));
8
+ }, BigNumbers.ZERO) ?? BigNumbers.ZERO;
9
+ }
10
+ export {
11
+ sumBigNumberBy
12
+ };
13
+ //# sourceMappingURL=sumBigNumberBy.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../../../src/utils/math/sumBigNumberBy.ts"],"sourcesContent":["import BigNumber from 'bignumber.js';\nimport { BigNumbers } from './BigNumbers';\n\n/**\n * Util function to sum BigNumber values, inspired by Lodash\n * @param collection\n * @param iteratee\n */\nexport function sumBigNumberBy<T>(\n collection: T[] | null | undefined,\n iteratee: (value: T) => BigNumber.Value,\n): BigNumber {\n return (\n collection?.reduce((total, item) => {\n return total.plus(iteratee(item));\n }, BigNumbers.ZERO) ?? BigNumbers.ZERO\n );\n}\n"],"mappings":";;;AACA,SAAS,kBAAkB;AAOpB,SAAS,eACd,YACA,UACW;AACX,SACE,YAAY,OAAO,CAAC,OAAO,SAAS;AAClC,WAAO,MAAM,KAAK,SAAS,IAAI,CAAC;AAAA,EAClC,GAAG,WAAW,IAAI,KAAK,WAAW;AAEtC;","names":[]}
@@ -1 +1 @@
1
- {"version":3,"sources":["../../../src/utils/math/toBigInt.ts"],"sourcesContent":["import { BigDecimalish } from './bigDecimal';\nimport { toIntegerString } from './toIntegerString';\n\n/**\n * Converts a BigDecimalish value to bigint\n *\n * @param val\n */\nexport function toBigInt(val: BigDecimalish): bigint {\n return BigInt(toIntegerString(val));\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AACA,6BAAgC;AAOzB,SAAS,SAAS,KAA4B;AACnD,SAAO,WAAO,wCAAgB,GAAG,CAAC;AACpC;","names":[]}
1
+ {"version":3,"sources":["../../../src/utils/math/toBigInt.ts"],"sourcesContent":["import { BigNumberish } from './bigNumber';\nimport { toIntegerString } from './toIntegerString';\n\n/**\n * Converts a BigNumberish value to bigint\n *\n * @param val\n */\nexport function toBigInt(val: BigNumberish): bigint {\n return BigInt(toIntegerString(val));\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AACA,6BAAgC;AAOzB,SAAS,SAAS,KAA2B;AAClD,SAAO,WAAO,wCAAgB,GAAG,CAAC;AACpC;","names":[]}
@@ -1,11 +1,11 @@
1
- import { BigDecimalish } from './bigDecimal.cjs';
1
+ import { BigNumberish } from './bigNumber.cjs';
2
2
  import 'bignumber.js';
3
3
 
4
4
  /**
5
- * Converts a BigDecimalish value to bigint
5
+ * Converts a BigNumberish value to bigint
6
6
  *
7
7
  * @param val
8
8
  */
9
- declare function toBigInt(val: BigDecimalish): bigint;
9
+ declare function toBigInt(val: BigNumberish): bigint;
10
10
 
11
11
  export { toBigInt };
@@ -1,11 +1,11 @@
1
- import { BigDecimalish } from './bigDecimal.js';
1
+ import { BigNumberish } from './bigNumber.js';
2
2
  import 'bignumber.js';
3
3
 
4
4
  /**
5
- * Converts a BigDecimalish value to bigint
5
+ * Converts a BigNumberish value to bigint
6
6
  *
7
7
  * @param val
8
8
  */
9
- declare function toBigInt(val: BigDecimalish): bigint;
9
+ declare function toBigInt(val: BigNumberish): bigint;
10
10
 
11
11
  export { toBigInt };
@@ -1 +1 @@
1
- {"version":3,"sources":["../../../src/utils/math/toBigInt.ts"],"sourcesContent":["import { BigDecimalish } from './bigDecimal';\nimport { toIntegerString } from './toIntegerString';\n\n/**\n * Converts a BigDecimalish value to bigint\n *\n * @param val\n */\nexport function toBigInt(val: BigDecimalish): bigint {\n return BigInt(toIntegerString(val));\n}\n"],"mappings":";;;AACA,SAAS,uBAAuB;AAOzB,SAAS,SAAS,KAA4B;AACnD,SAAO,OAAO,gBAAgB,GAAG,CAAC;AACpC;","names":[]}
1
+ {"version":3,"sources":["../../../src/utils/math/toBigInt.ts"],"sourcesContent":["import { BigNumberish } from './bigNumber';\nimport { toIntegerString } from './toIntegerString';\n\n/**\n * Converts a BigNumberish value to bigint\n *\n * @param val\n */\nexport function toBigInt(val: BigNumberish): bigint {\n return BigInt(toIntegerString(val));\n}\n"],"mappings":";;;AACA,SAAS,uBAAuB;AAOzB,SAAS,SAAS,KAA2B;AAClD,SAAO,OAAO,gBAAgB,GAAG,CAAC;AACpC;","names":[]}
@@ -23,9 +23,9 @@ __export(toIntegerString_exports, {
23
23
  toIntegerString: () => toIntegerString
24
24
  });
25
25
  module.exports = __toCommonJS(toIntegerString_exports);
26
- var import_bigDecimal = require("./bigDecimal.cjs");
26
+ var import_bigNumber = require("./bigNumber.cjs");
27
27
  function toIntegerString(val) {
28
- return (0, import_bigDecimal.toBigDecimal)(val).toFixed(0);
28
+ return (0, import_bigNumber.toBigNumber)(val).toFixed(0);
29
29
  }
30
30
  // Annotate the CommonJS export names for ESM import in node:
31
31
  0 && (module.exports = {
@@ -1 +1 @@
1
- {"version":3,"sources":["../../../src/utils/math/toIntegerString.ts"],"sourcesContent":["import { BigDecimalish, toBigDecimal } from './bigDecimal';\n\n/**\n * Converts a BigDecimalish value to string\n *\n * @param val\n */\nexport function toIntegerString(val: BigDecimalish): string {\n // toFixed is required as toString gives values with `e`\n return toBigDecimal(val).toFixed(0);\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,wBAA4C;AAOrC,SAAS,gBAAgB,KAA4B;AAE1D,aAAO,gCAAa,GAAG,EAAE,QAAQ,CAAC;AACpC;","names":[]}
1
+ {"version":3,"sources":["../../../src/utils/math/toIntegerString.ts"],"sourcesContent":["import { BigNumberish, toBigNumber } from './bigNumber';\n\n/**\n * Converts a BigNumberish value to string\n *\n * @param val\n */\nexport function toIntegerString(val: BigNumberish): string {\n // toFixed is required as toString gives values with `e`\n return toBigNumber(val).toFixed(0);\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,uBAA0C;AAOnC,SAAS,gBAAgB,KAA2B;AAEzD,aAAO,8BAAY,GAAG,EAAE,QAAQ,CAAC;AACnC;","names":[]}
@@ -1,11 +1,11 @@
1
- import { BigDecimalish } from './bigDecimal.cjs';
1
+ import { BigNumberish } from './bigNumber.cjs';
2
2
  import 'bignumber.js';
3
3
 
4
4
  /**
5
- * Converts a BigDecimalish value to string
5
+ * Converts a BigNumberish value to string
6
6
  *
7
7
  * @param val
8
8
  */
9
- declare function toIntegerString(val: BigDecimalish): string;
9
+ declare function toIntegerString(val: BigNumberish): string;
10
10
 
11
11
  export { toIntegerString };
@@ -1,11 +1,11 @@
1
- import { BigDecimalish } from './bigDecimal.js';
1
+ import { BigNumberish } from './bigNumber.js';
2
2
  import 'bignumber.js';
3
3
 
4
4
  /**
5
- * Converts a BigDecimalish value to string
5
+ * Converts a BigNumberish value to string
6
6
  *
7
7
  * @param val
8
8
  */
9
- declare function toIntegerString(val: BigDecimalish): string;
9
+ declare function toIntegerString(val: BigNumberish): string;
10
10
 
11
11
  export { toIntegerString };
@@ -1,9 +1,9 @@
1
1
  import "../../chunk-5WRI5ZAA.js";
2
2
 
3
3
  // src/utils/math/toIntegerString.ts
4
- import { toBigDecimal } from "./bigDecimal.js";
4
+ import { toBigNumber } from "./bigNumber.js";
5
5
  function toIntegerString(val) {
6
- return toBigDecimal(val).toFixed(0);
6
+ return toBigNumber(val).toFixed(0);
7
7
  }
8
8
  export {
9
9
  toIntegerString
@@ -1 +1 @@
1
- {"version":3,"sources":["../../../src/utils/math/toIntegerString.ts"],"sourcesContent":["import { BigDecimalish, toBigDecimal } from './bigDecimal';\n\n/**\n * Converts a BigDecimalish value to string\n *\n * @param val\n */\nexport function toIntegerString(val: BigDecimalish): string {\n // toFixed is required as toString gives values with `e`\n return toBigDecimal(val).toFixed(0);\n}\n"],"mappings":";;;AAAA,SAAwB,oBAAoB;AAOrC,SAAS,gBAAgB,KAA4B;AAE1D,SAAO,aAAa,GAAG,EAAE,QAAQ,CAAC;AACpC;","names":[]}
1
+ {"version":3,"sources":["../../../src/utils/math/toIntegerString.ts"],"sourcesContent":["import { BigNumberish, toBigNumber } from './bigNumber';\n\n/**\n * Converts a BigNumberish value to string\n *\n * @param val\n */\nexport function toIntegerString(val: BigNumberish): string {\n // toFixed is required as toString gives values with `e`\n return toBigNumber(val).toFixed(0);\n}\n"],"mappings":";;;AAAA,SAAuB,mBAAmB;AAOnC,SAAS,gBAAgB,KAA2B;AAEzD,SAAO,YAAY,GAAG,EAAE,QAAQ,CAAC;AACnC;","names":[]}