@nadohq/shared 0.1.0-alpha.9 → 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 (292) 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 +345 -56
  12. package/dist/consts/chainEnvToChain.d.ts +345 -56
  13. package/dist/consts/chainEnvToChain.js +3 -3
  14. package/dist/consts/chainEnvToChain.js.map +1 -1
  15. package/dist/consts/index.d.cts +0 -1
  16. package/dist/consts/index.d.ts +0 -1
  17. package/dist/consts/productIds.cjs +1 -1
  18. package/dist/consts/productIds.cjs.map +1 -1
  19. package/dist/consts/productIds.d.cts +1 -1
  20. package/dist/consts/productIds.d.ts +1 -1
  21. package/dist/consts/productIds.js +1 -1
  22. package/dist/consts/productIds.js.map +1 -1
  23. package/dist/deployments/core/deployment.inkMainnet.json +13 -0
  24. package/dist/deployments/core/deployment.inkSepolia.json +13 -0
  25. package/dist/deployments/index.cjs +6 -6
  26. package/dist/deployments/index.cjs.map +1 -1
  27. package/dist/deployments/index.js +5 -5
  28. package/dist/deployments/index.js.map +1 -1
  29. package/dist/eip712/eip712ValueTypes.cjs.map +1 -1
  30. package/dist/eip712/eip712ValueTypes.d.cts +3 -3
  31. package/dist/eip712/eip712ValueTypes.d.ts +3 -3
  32. package/dist/eip712/getNadoEIP712Domain.cjs.map +1 -1
  33. package/dist/eip712/getNadoEIP712Domain.js.map +1 -1
  34. package/dist/eip712/getNadoEIP712PrimaryType.d.cts +1 -1
  35. package/dist/eip712/getNadoEIP712PrimaryType.d.ts +1 -1
  36. package/dist/eip712/getNadoEIP712Types.d.cts +1 -1
  37. package/dist/eip712/getNadoEIP712Types.d.ts +1 -1
  38. package/dist/eip712/getNadoEIP712Values.d.cts +1 -1
  39. package/dist/eip712/getNadoEIP712Values.d.ts +1 -1
  40. package/dist/eip712/getSignedTransactionRequest.d.cts +1 -1
  41. package/dist/eip712/getSignedTransactionRequest.d.ts +1 -1
  42. package/dist/eip712/index.cjs +13 -13
  43. package/dist/eip712/index.cjs.map +1 -1
  44. package/dist/eip712/index.d.cts +9 -9
  45. package/dist/eip712/index.d.ts +9 -9
  46. package/dist/eip712/index.js +6 -6
  47. package/dist/eip712/index.js.map +1 -1
  48. package/dist/eip712/orderDigest.d.cts +1 -1
  49. package/dist/eip712/orderDigest.d.ts +1 -1
  50. package/dist/eip712/signableRequestType.d.cts +1 -1
  51. package/dist/eip712/signableRequestType.d.ts +1 -1
  52. package/dist/eip712/signatureParamTypes.cjs.map +1 -1
  53. package/dist/eip712/signatureParamTypes.d.cts +13 -13
  54. package/dist/eip712/signatureParamTypes.d.ts +13 -13
  55. package/dist/encoding/encoding.cjs +21 -0
  56. package/dist/encoding/encoding.cjs.map +1 -1
  57. package/dist/encoding/encoding.d.cts +28 -4
  58. package/dist/encoding/encoding.d.ts +28 -4
  59. package/dist/encoding/encoding.js +24 -1
  60. package/dist/encoding/encoding.js.map +1 -1
  61. package/dist/encoding/index.d.cts +3 -3
  62. package/dist/encoding/index.d.ts +3 -3
  63. package/dist/execute/approveDepositAllowance.cjs.map +1 -1
  64. package/dist/execute/approveDepositAllowance.d.cts +2 -2
  65. package/dist/execute/approveDepositAllowance.d.ts +2 -2
  66. package/dist/execute/approveDepositAllowance.js.map +1 -1
  67. package/dist/execute/depositCollateral.cjs.map +1 -1
  68. package/dist/execute/depositCollateral.d.cts +2 -2
  69. package/dist/execute/depositCollateral.d.ts +2 -2
  70. package/dist/execute/depositCollateral.js.map +1 -1
  71. package/dist/execute/index.d.cts +1 -1
  72. package/dist/execute/index.d.ts +1 -1
  73. package/dist/index.d.cts +36 -36
  74. package/dist/index.d.ts +36 -36
  75. package/dist/types/ChainEnv.cjs +1 -1
  76. package/dist/types/ChainEnv.cjs.map +1 -1
  77. package/dist/types/ChainEnv.d.cts +2 -2
  78. package/dist/types/ChainEnv.d.ts +2 -2
  79. package/dist/types/ChainEnv.js +1 -1
  80. package/dist/types/ChainEnv.js.map +1 -1
  81. package/dist/types/balanceTypes.cjs.map +1 -1
  82. package/dist/types/balanceTypes.d.cts +5 -5
  83. package/dist/types/balanceTypes.d.ts +5 -5
  84. package/dist/types/healthTypes.cjs.map +1 -1
  85. package/dist/types/healthTypes.d.cts +4 -4
  86. package/dist/types/healthTypes.d.ts +4 -4
  87. package/dist/types/index.cjs +7 -7
  88. package/dist/types/index.cjs.map +1 -1
  89. package/dist/types/index.d.cts +4 -4
  90. package/dist/types/index.d.ts +4 -4
  91. package/dist/types/index.js +3 -3
  92. package/dist/types/index.js.map +1 -1
  93. package/dist/types/marketTypes.cjs.map +1 -1
  94. package/dist/types/marketTypes.d.cts +4 -4
  95. package/dist/types/marketTypes.d.ts +4 -4
  96. package/dist/types/orderAppendixTypes.cjs.map +1 -1
  97. package/dist/types/orderAppendixTypes.d.cts +27 -3
  98. package/dist/types/orderAppendixTypes.d.ts +27 -3
  99. package/dist/types/productTypes.cjs.map +1 -1
  100. package/dist/types/productTypes.d.cts +16 -16
  101. package/dist/types/productTypes.d.ts +16 -16
  102. package/dist/types/productTypes.js.map +1 -1
  103. package/dist/types/viemTypes.d.cts +1 -1
  104. package/dist/types/viemTypes.d.ts +1 -1
  105. package/dist/utils/balanceValue.cjs.map +1 -1
  106. package/dist/utils/balanceValue.d.cts +5 -5
  107. package/dist/utils/balanceValue.d.ts +5 -5
  108. package/dist/utils/balanceValue.js.map +1 -1
  109. package/dist/utils/bytes32.d.cts +1 -1
  110. package/dist/utils/bytes32.d.ts +1 -1
  111. package/dist/utils/bytes32.test.cjs +2 -2
  112. package/dist/utils/bytes32.test.cjs.map +1 -1
  113. package/dist/utils/bytes32.test.js +1 -1
  114. package/dist/utils/createDeterministicLinkedSignerPrivateKey.cjs.map +1 -1
  115. package/dist/utils/createDeterministicLinkedSignerPrivateKey.js.map +1 -1
  116. package/dist/utils/index.cjs +12 -12
  117. package/dist/utils/index.cjs.map +1 -1
  118. package/dist/utils/index.d.cts +22 -22
  119. package/dist/utils/index.d.ts +22 -22
  120. package/dist/utils/index.js +6 -6
  121. package/dist/utils/index.js.map +1 -1
  122. package/dist/utils/interest.cjs +9 -9
  123. package/dist/utils/interest.cjs.map +1 -1
  124. package/dist/utils/interest.d.cts +8 -8
  125. package/dist/utils/interest.d.ts +8 -8
  126. package/dist/utils/interest.js +10 -14
  127. package/dist/utils/interest.js.map +1 -1
  128. package/dist/utils/math/{BigDecimals.cjs → BigNumbers.cjs} +13 -13
  129. package/dist/utils/math/BigNumbers.cjs.map +1 -0
  130. package/dist/utils/math/BigNumbers.d.cts +10 -0
  131. package/dist/utils/math/BigNumbers.d.ts +10 -0
  132. package/dist/utils/math/BigNumbers.js +14 -0
  133. package/dist/utils/math/BigNumbers.js.map +1 -0
  134. package/dist/utils/math/{bigDecimal.cjs → bigNumber.cjs} +12 -14
  135. package/dist/utils/math/bigNumber.cjs.map +1 -0
  136. package/dist/utils/math/bigNumber.d.cts +17 -0
  137. package/dist/utils/math/bigNumber.d.ts +17 -0
  138. package/dist/utils/math/bigNumber.js +22 -0
  139. package/dist/utils/math/bigNumber.js.map +1 -0
  140. package/dist/utils/math/clamp.cjs +3 -3
  141. package/dist/utils/math/clamp.cjs.map +1 -1
  142. package/dist/utils/math/clamp.d.cts +5 -5
  143. package/dist/utils/math/clamp.d.ts +5 -5
  144. package/dist/utils/math/clamp.js +2 -2
  145. package/dist/utils/math/clamp.js.map +1 -1
  146. package/dist/utils/math/decimalAdjustment.cjs +5 -5
  147. package/dist/utils/math/decimalAdjustment.cjs.map +1 -1
  148. package/dist/utils/math/decimalAdjustment.d.cts +6 -6
  149. package/dist/utils/math/decimalAdjustment.d.ts +6 -6
  150. package/dist/utils/math/decimalAdjustment.js +5 -5
  151. package/dist/utils/math/decimalAdjustment.js.map +1 -1
  152. package/dist/utils/math/index.cjs +10 -10
  153. package/dist/utils/math/index.cjs.map +1 -1
  154. package/dist/utils/math/index.d.cts +7 -7
  155. package/dist/utils/math/index.d.ts +7 -7
  156. package/dist/utils/math/index.js +5 -5
  157. package/dist/utils/math/index.js.map +1 -1
  158. package/dist/utils/math/{sumBigDecimalBy.cjs → sumBigNumberBy.cjs} +10 -10
  159. package/dist/utils/math/sumBigNumberBy.cjs.map +1 -0
  160. package/dist/utils/math/sumBigNumberBy.d.cts +10 -0
  161. package/dist/utils/math/sumBigNumberBy.d.ts +10 -0
  162. package/dist/utils/math/sumBigNumberBy.js +13 -0
  163. package/dist/utils/math/sumBigNumberBy.js.map +1 -0
  164. package/dist/utils/math/toBigInt.cjs.map +1 -1
  165. package/dist/utils/math/toBigInt.d.cts +3 -3
  166. package/dist/utils/math/toBigInt.d.ts +3 -3
  167. package/dist/utils/math/toBigInt.js.map +1 -1
  168. package/dist/utils/math/toIntegerString.cjs +2 -2
  169. package/dist/utils/math/toIntegerString.cjs.map +1 -1
  170. package/dist/utils/math/toIntegerString.d.cts +3 -3
  171. package/dist/utils/math/toIntegerString.d.ts +3 -3
  172. package/dist/utils/math/toIntegerString.js +2 -2
  173. package/dist/utils/math/toIntegerString.js.map +1 -1
  174. package/dist/utils/orders/appendix/appendixIsolatedValue.cjs +50 -0
  175. package/dist/utils/orders/appendix/appendixIsolatedValue.cjs.map +1 -0
  176. package/dist/utils/orders/appendix/appendixIsolatedValue.d.cts +26 -0
  177. package/dist/utils/orders/appendix/appendixIsolatedValue.d.ts +26 -0
  178. package/dist/utils/orders/appendix/appendixIsolatedValue.js +31 -0
  179. package/dist/utils/orders/appendix/appendixIsolatedValue.js.map +1 -0
  180. package/dist/utils/orders/appendix/appendixTwapValue.cjs +3 -4
  181. package/dist/utils/orders/appendix/appendixTwapValue.cjs.map +1 -1
  182. package/dist/utils/orders/appendix/appendixTwapValue.d.cts +12 -14
  183. package/dist/utils/orders/appendix/appendixTwapValue.d.ts +12 -14
  184. package/dist/utils/orders/appendix/appendixTwapValue.js +3 -4
  185. package/dist/utils/orders/appendix/appendixTwapValue.js.map +1 -1
  186. package/dist/utils/orders/appendix/index.cjs +4 -4
  187. package/dist/utils/orders/appendix/index.cjs.map +1 -1
  188. package/dist/utils/orders/appendix/index.d.cts +3 -3
  189. package/dist/utils/orders/appendix/index.d.ts +3 -3
  190. package/dist/utils/orders/appendix/index.js +2 -2
  191. package/dist/utils/orders/appendix/index.js.map +1 -1
  192. package/dist/utils/orders/appendix/orderAppendix.test.cjs +67 -14
  193. package/dist/utils/orders/appendix/orderAppendix.test.cjs.map +1 -1
  194. package/dist/utils/orders/appendix/orderAppendix.test.js +66 -13
  195. package/dist/utils/orders/appendix/orderAppendix.test.js.map +1 -1
  196. package/dist/utils/orders/appendix/packOrderAppendix.cjs +9 -5
  197. package/dist/utils/orders/appendix/packOrderAppendix.cjs.map +1 -1
  198. package/dist/utils/orders/appendix/packOrderAppendix.d.cts +1 -1
  199. package/dist/utils/orders/appendix/packOrderAppendix.d.ts +1 -1
  200. package/dist/utils/orders/appendix/packOrderAppendix.js +9 -5
  201. package/dist/utils/orders/appendix/packOrderAppendix.js.map +1 -1
  202. package/dist/utils/orders/appendix/types.cjs.map +1 -1
  203. package/dist/utils/orders/appendix/types.d.cts +6 -4
  204. package/dist/utils/orders/appendix/types.d.ts +6 -4
  205. package/dist/utils/orders/appendix/unpackOrderAppendix.cjs +22 -5
  206. package/dist/utils/orders/appendix/unpackOrderAppendix.cjs.map +1 -1
  207. package/dist/utils/orders/appendix/unpackOrderAppendix.d.cts +2 -2
  208. package/dist/utils/orders/appendix/unpackOrderAppendix.d.ts +2 -2
  209. package/dist/utils/orders/appendix/unpackOrderAppendix.js +22 -5
  210. package/dist/utils/orders/appendix/unpackOrderAppendix.js.map +1 -1
  211. package/dist/utils/orders/index.cjs +3 -3
  212. package/dist/utils/orders/index.cjs.map +1 -1
  213. package/dist/utils/orders/index.d.cts +5 -5
  214. package/dist/utils/orders/index.d.ts +5 -5
  215. package/dist/utils/orders/index.js +1 -1
  216. package/dist/utils/orders/index.js.map +1 -1
  217. package/dist/utils/productTypeFilter.cjs.map +1 -1
  218. package/dist/utils/productTypeFilter.d.cts +2 -2
  219. package/dist/utils/productTypeFilter.d.ts +2 -2
  220. package/dist/utils/productTypeFilter.js.map +1 -1
  221. package/dist/utils/toPrintableObject.cjs +29 -11
  222. package/dist/utils/toPrintableObject.cjs.map +1 -1
  223. package/dist/utils/toPrintableObject.d.cts +7 -2
  224. package/dist/utils/toPrintableObject.d.ts +7 -2
  225. package/dist/utils/toPrintableObject.js +19 -11
  226. package/dist/utils/toPrintableObject.js.map +1 -1
  227. package/package.json +14 -7
  228. package/src/abis/index.ts +6 -6
  229. package/src/consts/chainEnvToChain.ts +2 -2
  230. package/src/consts/productIds.ts +1 -1
  231. package/src/deployments/core/deployment.inkMainnet.json +13 -0
  232. package/src/deployments/core/deployment.inkSepolia.json +13 -0
  233. package/src/deployments/index.ts +5 -5
  234. package/src/eip712/eip712ValueTypes.ts +2 -2
  235. package/src/eip712/getNadoEIP712Domain.ts +1 -1
  236. package/src/eip712/index.ts +6 -6
  237. package/src/eip712/signatureParamTypes.ts +13 -13
  238. package/src/encoding/encoding.ts +43 -1
  239. package/src/execute/approveDepositAllowance.ts +2 -2
  240. package/src/execute/depositCollateral.ts +2 -2
  241. package/src/types/ChainEnv.ts +1 -1
  242. package/src/types/balanceTypes.ts +4 -4
  243. package/src/types/healthTypes.ts +4 -4
  244. package/src/types/index.ts +3 -3
  245. package/src/types/marketTypes.ts +4 -4
  246. package/src/types/orderAppendixTypes.ts +27 -2
  247. package/src/types/productTypes.ts +16 -16
  248. package/src/utils/balanceValue.ts +4 -4
  249. package/src/utils/createDeterministicLinkedSignerPrivateKey.ts +1 -1
  250. package/src/utils/index.ts +6 -6
  251. package/src/utils/interest.ts +26 -31
  252. package/src/utils/math/BigNumbers.ts +8 -0
  253. package/src/utils/math/bigNumber.ts +31 -0
  254. package/src/utils/math/clamp.ts +4 -7
  255. package/src/utils/math/decimalAdjustment.ts +11 -10
  256. package/src/utils/math/index.ts +5 -5
  257. package/src/utils/math/sumBigNumberBy.ts +18 -0
  258. package/src/utils/math/toBigInt.ts +3 -3
  259. package/src/utils/math/toIntegerString.ts +4 -4
  260. package/src/utils/orders/appendix/appendixIsolatedValue.ts +49 -0
  261. package/src/utils/orders/appendix/appendixTwapValue.ts +14 -19
  262. package/src/utils/orders/appendix/index.ts +2 -2
  263. package/src/utils/orders/appendix/orderAppendix.test.ts +68 -11
  264. package/src/utils/orders/appendix/packOrderAppendix.ts +10 -6
  265. package/src/utils/orders/appendix/types.ts +9 -7
  266. package/src/utils/orders/appendix/unpackOrderAppendix.ts +24 -7
  267. package/src/utils/orders/index.ts +1 -1
  268. package/src/utils/productTypeFilter.ts +2 -2
  269. package/src/utils/toPrintableObject.ts +32 -12
  270. package/dist/chunk-TUJ4HQKF.js.map +0 -1
  271. package/dist/deployments/core/deployment.InkSepolia.json +0 -13
  272. package/dist/deployments/core/deployment.arbitrumOne.json +0 -18
  273. package/dist/utils/math/BigDecimals.cjs.map +0 -1
  274. package/dist/utils/math/BigDecimals.d.cts +0 -8
  275. package/dist/utils/math/BigDecimals.d.ts +0 -8
  276. package/dist/utils/math/BigDecimals.js +0 -14
  277. package/dist/utils/math/BigDecimals.js.map +0 -1
  278. package/dist/utils/math/bigDecimal.cjs.map +0 -1
  279. package/dist/utils/math/bigDecimal.d.cts +0 -18
  280. package/dist/utils/math/bigDecimal.d.ts +0 -18
  281. package/dist/utils/math/bigDecimal.js +0 -23
  282. package/dist/utils/math/bigDecimal.js.map +0 -1
  283. package/dist/utils/math/sumBigDecimalBy.cjs.map +0 -1
  284. package/dist/utils/math/sumBigDecimalBy.d.cts +0 -10
  285. package/dist/utils/math/sumBigDecimalBy.d.ts +0 -10
  286. package/dist/utils/math/sumBigDecimalBy.js +0 -13
  287. package/dist/utils/math/sumBigDecimalBy.js.map +0 -1
  288. package/src/deployments/core/deployment.InkSepolia.json +0 -13
  289. package/src/deployments/core/deployment.arbitrumOne.json +0 -18
  290. package/src/utils/math/BigDecimals.ts +0 -8
  291. package/src/utils/math/bigDecimal.ts +0 -32
  292. package/src/utils/math/sumBigDecimalBy.ts +0 -18
@@ -1,4 +1,5 @@
1
- import { BigDecimal, BigDecimalish, toBigDecimal } from './bigDecimal';
1
+ import BigNumber from 'bignumber.js';
2
+ import { BigNumberish, toBigNumber } from './bigNumber';
2
3
 
3
4
  /**
4
5
  * All Nado balances have 18 decimals. Ex. 1e18 = 1.0
@@ -10,10 +11,10 @@ export const NADO_PRODUCT_DECIMALS = 18;
10
11
  *
11
12
  * - If `T` is `undefined`, the result is `undefined`.
12
13
  * - If `T` is a `number`, the result is a `number`.
13
- * - Otherwise, the result is a `BigDecimal`.
14
+ * - Otherwise, the result is a `BigNumber`.
14
15
  */
15
- type AdjustDecimalsResult<T extends BigDecimalish | undefined> =
16
- T extends undefined ? undefined : T extends number ? number : BigDecimal;
16
+ type AdjustDecimalsResult<T extends BigNumberish | undefined> =
17
+ T extends undefined ? undefined : T extends number ? number : BigNumber;
17
18
 
18
19
  /**
19
20
  * Adds the specified # of decimals to the number. For example, value = 1, decimals = 2, returns 100.
@@ -22,7 +23,7 @@ type AdjustDecimalsResult<T extends BigDecimalish | undefined> =
22
23
  * @param decimals number of decimal places to add, defaults to 18, which is the standard within Nado
23
24
  */
24
25
 
25
- export function addDecimals<T extends BigDecimalish | undefined>(
26
+ export function addDecimals<T extends BigNumberish | undefined>(
26
27
  value: T,
27
28
  decimals: number = NADO_PRODUCT_DECIMALS,
28
29
  ): AdjustDecimalsResult<T> {
@@ -31,8 +32,8 @@ export function addDecimals<T extends BigDecimalish | undefined>(
31
32
  return undefined;
32
33
  }
33
34
 
34
- const adjustedValue = toBigDecimal(value).multipliedBy(
35
- toBigDecimal(10).pow(decimals),
35
+ const adjustedValue = toBigNumber(value).multipliedBy(
36
+ toBigNumber(10).pow(decimals),
36
37
  );
37
38
  return typeof value === 'number' ? adjustedValue.toNumber() : adjustedValue;
38
39
  };
@@ -46,7 +47,7 @@ export function addDecimals<T extends BigDecimalish | undefined>(
46
47
  * @param value can be undefined for better developer experience. If undefined, returns undefined.
47
48
  * @param decimals number of decimal places to remove, defaults to 18, which is the standard within Nado
48
49
  */
49
- export function removeDecimals<T extends BigDecimalish | undefined>(
50
+ export function removeDecimals<T extends BigNumberish | undefined>(
50
51
  value: T,
51
52
  decimals: number = NADO_PRODUCT_DECIMALS,
52
53
  ): AdjustDecimalsResult<T> {
@@ -55,8 +56,8 @@ export function removeDecimals<T extends BigDecimalish | undefined>(
55
56
  return undefined;
56
57
  }
57
58
 
58
- const adjustedValue = toBigDecimal(value).dividedBy(
59
- toBigDecimal(10).pow(decimals),
59
+ const adjustedValue = toBigNumber(value).dividedBy(
60
+ toBigNumber(10).pow(decimals),
60
61
  );
61
62
  return typeof value === 'number' ? adjustedValue.toNumber() : adjustedValue;
62
63
  };
@@ -1,7 +1,7 @@
1
- export * from './bigDecimal';
2
- export * from './toIntegerString';
3
- export * from './toBigInt';
1
+ export * from './bigNumber';
2
+ export * from './BigNumbers';
4
3
  export * from './clamp';
5
- export * from './sumBigDecimalBy';
6
4
  export * from './decimalAdjustment';
7
- export * from './BigDecimals';
5
+ export * from './sumBigNumberBy';
6
+ export * from './toBigInt';
7
+ export * from './toIntegerString';
@@ -0,0 +1,18 @@
1
+ import BigNumber from 'bignumber.js';
2
+ import { BigNumbers } from './BigNumbers';
3
+
4
+ /**
5
+ * Util function to sum BigNumber values, inspired by Lodash
6
+ * @param collection
7
+ * @param iteratee
8
+ */
9
+ export function sumBigNumberBy<T>(
10
+ collection: T[] | null | undefined,
11
+ iteratee: (value: T) => BigNumber.Value,
12
+ ): BigNumber {
13
+ return (
14
+ collection?.reduce((total, item) => {
15
+ return total.plus(iteratee(item));
16
+ }, BigNumbers.ZERO) ?? BigNumbers.ZERO
17
+ );
18
+ }
@@ -1,11 +1,11 @@
1
- import { BigDecimalish } from './bigDecimal';
1
+ import { BigNumberish } from './bigNumber';
2
2
  import { toIntegerString } from './toIntegerString';
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
- export function toBigInt(val: BigDecimalish): bigint {
9
+ export function toBigInt(val: BigNumberish): bigint {
10
10
  return BigInt(toIntegerString(val));
11
11
  }
@@ -1,11 +1,11 @@
1
- import { BigDecimalish, toBigDecimal } from './bigDecimal';
1
+ import { BigNumberish, toBigNumber } from './bigNumber';
2
2
 
3
3
  /**
4
- * Converts a BigDecimalish value to string
4
+ * Converts a BigNumberish value to string
5
5
  *
6
6
  * @param val
7
7
  */
8
- export function toIntegerString(val: BigDecimalish): string {
8
+ export function toIntegerString(val: BigNumberish): string {
9
9
  // toFixed is required as toString gives values with `e`
10
- return toBigDecimal(val).toFixed(0);
10
+ return toBigNumber(val).toFixed(0);
11
11
  }
@@ -0,0 +1,49 @@
1
+ import { OrderAppendixIsolatedFields } from '../../../types';
2
+ import {
3
+ addDecimals,
4
+ NADO_PRODUCT_DECIMALS,
5
+ removeDecimals,
6
+ toBigInt,
7
+ } from '../../math';
8
+ import { bitMaskValue } from './bitMaskValue';
9
+
10
+ const APPENDIX_V1_ISO_MARGIN_DECIMALS = 6;
11
+
12
+ /* Appendix v1 uses x6 precision, so we need to adjust precision to/from SDK's usual precision */
13
+ const MARGIN_DECIMAL_ADJUSTMENT =
14
+ NADO_PRODUCT_DECIMALS - APPENDIX_V1_ISO_MARGIN_DECIMALS;
15
+
16
+ /**
17
+ * Packs the provided margin into a single 64-bit bigint.
18
+ *
19
+ * Bit layout (MSB → LSB):
20
+ * | margin_x6 |
21
+ * |-----------|
22
+ * | 63..0 |
23
+ * | 64 bits |
24
+ *
25
+ */
26
+ export function packIsolatedOrderAppendixValue({
27
+ margin,
28
+ }: OrderAppendixIsolatedFields): bigint {
29
+ return bitMaskValue(
30
+ toBigInt(removeDecimals(margin, MARGIN_DECIMAL_ADJUSTMENT)),
31
+ 64,
32
+ );
33
+ }
34
+
35
+ /**
36
+ * Unpacks a 64-bit bigint into its component fields for Isolated orders.
37
+ *
38
+ * @param value 64-bit bigint to unpack
39
+ * @returns Object with:
40
+ * - margin_x6: bigint, from bits 63..0
41
+ */
42
+ export function unpackIsolatedOrderAppendixValue(
43
+ value: bigint,
44
+ ): OrderAppendixIsolatedFields {
45
+ const margin = bitMaskValue(value, 64);
46
+ return {
47
+ margin: toBigInt(addDecimals(margin, MARGIN_DECIMAL_ADJUSTMENT)),
48
+ };
49
+ }
@@ -2,17 +2,16 @@ import { OrderAppendixTwapFields } from '../../../types/orderAppendixTypes';
2
2
  import { addDecimals, removeDecimals, toBigInt } from '../../math';
3
3
 
4
4
  /**
5
- * Packs the provided fields into a single 96-bit bigint.
5
+ * Packs the provided fields into a single 64-bit bigint.
6
6
  *
7
7
  * Bit layout (MSB → LSB):
8
- * | times | slippage_x6 | reserved |
9
- * |-----------|-------------|----------|
10
- * | 95..64 | 63..32 | 31..0 |
11
- * | 32 bits | 32 bits | 32 bits |
8
+ * | times | slippage_x6 |
9
+ * |-----------|-------------|
10
+ * | 63..32 | 31..0 |
11
+ * | 32 bits | 32 bits |
12
12
  *
13
- * - `times` occupies bits 95..64 (most significant 32 bits)
14
- * - `slippage_x6` occupies bits 63..32 (middle 32 bits)
15
- * - `reserved` occupies bits 31..0 (least significant 32 bits)
13
+ * - `times` occupies bits 63..32 (most significant 32 bits)
14
+ * - `slippage_x6` occupies bits 31..0 (least significant 32 bits)
16
15
  */
17
16
  export function packTwapOrderAppendixValue({
18
17
  numOrders,
@@ -22,27 +21,23 @@ export function packTwapOrderAppendixValue({
22
21
  const slippageX6BigInt = toBigInt(addDecimals(slippageFrac, 6));
23
22
 
24
23
  return (
25
- ((numOrdersBigInt & 0xffffffffn) << 64n) |
26
- ((slippageX6BigInt & 0xffffffffn) << 32n) |
27
- // The last reserved 32 bits are set to 0
28
- (0n & 0xffffffffn)
24
+ ((numOrdersBigInt & 0xffffffffn) << 32n) | (slippageX6BigInt & 0xffffffffn)
29
25
  );
30
26
  }
31
27
 
32
28
  /**
33
- * Unpacks a 96-bit bigint into its component fields for TWAP orders.
29
+ * Unpacks a 64-bit bigint into its component fields for TWAP orders.
34
30
  *
35
- * @param value 96-bit bigint to unpack
31
+ * @param value 64-bit bigint to unpack
36
32
  * @returns Object with:
37
- * - times: number, from bits 95..64
38
- * - slippage_x6: number, from bits 63..32
39
- * - reserved: number, from bits 31..0
33
+ * - times: number, from bits 63..32
34
+ * - slippage_x6: number, from bits 31..0
40
35
  */
41
36
  export function unpackTwapOrderAppendixValue(
42
37
  value: bigint,
43
38
  ): OrderAppendixTwapFields {
44
- const numOrders = (value >> 64n) & 0xffffffffn;
45
- const slippageX6 = (value >> 32n) & 0xffffffffn;
39
+ const numOrders = (value >> 32n) & 0xffffffffn;
40
+ const slippageX6 = value & 0xffffffffn;
46
41
 
47
42
  return {
48
43
  numOrders: Number(numOrders),
@@ -1,5 +1,5 @@
1
1
  export * from './appendixTwapValue';
2
- export * from './unpackOrderAppendix';
2
+ export * from './bitMaskValue';
3
3
  export * from './packOrderAppendix';
4
4
  export * from './types';
5
- export * from './bitMaskValue';
5
+ export * from './unpackOrderAppendix';
@@ -11,7 +11,7 @@ describe('OrderAppendix packing/unpacking', () => {
11
11
  };
12
12
  const packed = packOrderAppendix(appendix);
13
13
  const unpacked = unpackOrderAppendix(packed);
14
- expect(packed).toBe(4096n);
14
+ expect(packed).toBe(4097n);
15
15
  expect(unpacked.orderExecutionType).toBe(appendix.orderExecutionType);
16
16
  expect(unpacked.triggerType).toBe(appendix.triggerType);
17
17
  expect(unpacked.reduceOnly).toBeFalsy();
@@ -25,7 +25,7 @@ describe('OrderAppendix packing/unpacking', () => {
25
25
  };
26
26
  const packed = packOrderAppendix(appendix);
27
27
  const unpacked = unpackOrderAppendix(packed);
28
- expect(packed).toBe(6144n);
28
+ expect(packed).toBe(6145n);
29
29
  expect(unpacked.reduceOnly).toBe(true);
30
30
  });
31
31
 
@@ -60,12 +60,12 @@ describe('OrderAppendix packing/unpacking', () => {
60
60
  orderExecutionType: 'default',
61
61
  triggerType: 'price',
62
62
 
63
- isolated: { margin: 123456789012345678901234n },
63
+ isolated: { margin: 12345678901000000000000n },
64
64
  };
65
65
  const packed = packOrderAppendix(appendix);
66
66
  const unpacked = unpackOrderAppendix(packed);
67
- expect(packed).toBe(530242871277196831127717244047616n);
68
- expect(unpacked.isolated?.margin).toBe(123456789012345678901234n);
67
+ expect(packed).toBe(227737579102942800187821658369n);
68
+ expect(unpacked.isolated?.margin).toBe(appendix.isolated?.margin);
69
69
  });
70
70
 
71
71
  it('should handle TWAP fields', () => {
@@ -77,7 +77,7 @@ describe('OrderAppendix packing/unpacking', () => {
77
77
  };
78
78
  const packed = packOrderAppendix(appendix);
79
79
  const unpacked = unpackOrderAppendix(packed);
80
- expect(packed).toBe(792281717376363744483197591552n);
80
+ expect(packed).toBe(792281717376363744483197591553n);
81
81
  expect(unpacked.twap).toMatchObject({ numOrders: 10, slippageFrac: 0.005 });
82
82
  });
83
83
 
@@ -86,16 +86,16 @@ describe('OrderAppendix packing/unpacking', () => {
86
86
  orderExecutionType: 'post_only',
87
87
  triggerType: undefined,
88
88
  reduceOnly: true,
89
- isolated: { margin: 79228162514264337593543950335n }, // 2^96-1
89
+ isolated: { margin: 18446744073709551615n }, // 2^64-1
90
90
  };
91
91
  const packed = packOrderAppendix(appendix);
92
92
  const unpacked = unpackOrderAppendix(packed);
93
93
  expect(unpacked.orderExecutionType).toBe(appendix.orderExecutionType);
94
94
  expect(unpacked.triggerType).toBe(appendix.triggerType);
95
95
  expect(unpacked.reduceOnly).toBe(appendix.reduceOnly);
96
- expect(unpacked.isolated?.margin).toBe(79228162514264337593543950335n);
96
+ expect(unpacked.isolated?.margin).toBe(18446744000000000000n);
97
97
  expect(unpacked.twap).toBe(undefined);
98
- expect(packed).toBe(340282366920938463463374607427473248000n);
98
+ expect(packed).toBe(340282365561237229015142145n);
99
99
  });
100
100
 
101
101
  it('should handle max values for all fields for TWAP orders', () => {
@@ -104,7 +104,6 @@ describe('OrderAppendix packing/unpacking', () => {
104
104
  triggerType: 'twap_custom_amounts',
105
105
  reduceOnly: true,
106
106
  twap: {
107
- // max 32-bit unsigned int
108
107
  numOrders: 4294967295,
109
108
  slippageFrac: 0.000001,
110
109
  },
@@ -116,6 +115,64 @@ describe('OrderAppendix packing/unpacking', () => {
116
115
  expect(unpacked.reduceOnly).toBe(appendix.reduceOnly);
117
116
  expect(unpacked.twap?.slippageFrac).toBe(0.000001);
118
117
  expect(unpacked.twap?.numOrders).toBe(4294967295);
119
- expect(packed).toBe(340282366841710300967557013911933828608n);
118
+ expect(packed).toBe(340282366841710300967557013911933828609n);
119
+ });
120
+
121
+ it('should handle builder fields', () => {
122
+ const appendix: OrderAppendix = {
123
+ orderExecutionType: 'default',
124
+ builder: { builderId: 123, builderFeeRate: 500 },
125
+ };
126
+ const packed = packOrderAppendix(appendix);
127
+ const unpacked = unpackOrderAppendix(packed);
128
+ expect(unpacked.builder?.builderId).toBe(123);
129
+ expect(unpacked.builder?.builderFeeRate).toBe(500);
130
+ });
131
+
132
+ it('should handle builder with zero fee rate', () => {
133
+ const appendix: OrderAppendix = {
134
+ orderExecutionType: 'default',
135
+ builder: { builderId: 42, builderFeeRate: 0 },
136
+ };
137
+ const packed = packOrderAppendix(appendix);
138
+ const unpacked = unpackOrderAppendix(packed);
139
+ expect(unpacked.builder?.builderId).toBe(42);
140
+ expect(unpacked.builder?.builderFeeRate).toBe(0);
141
+ });
142
+
143
+ it('should handle builder with max values', () => {
144
+ const appendix: OrderAppendix = {
145
+ orderExecutionType: 'default',
146
+ builder: { builderId: 65535, builderFeeRate: 1023 }, // 16 bits, 10 bits max
147
+ };
148
+ const packed = packOrderAppendix(appendix);
149
+ const unpacked = unpackOrderAppendix(packed);
150
+ expect(unpacked.builder?.builderId).toBe(65535);
151
+ expect(unpacked.builder?.builderFeeRate).toBe(1023);
152
+ });
153
+
154
+ it('should handle builder combined with other flags', () => {
155
+ const appendix: OrderAppendix = {
156
+ orderExecutionType: 'ioc',
157
+ reduceOnly: true,
158
+ triggerType: 'price',
159
+ builder: { builderId: 5, builderFeeRate: 100 },
160
+ };
161
+ const packed = packOrderAppendix(appendix);
162
+ const unpacked = unpackOrderAppendix(packed);
163
+ expect(unpacked.orderExecutionType).toBe('ioc');
164
+ expect(unpacked.reduceOnly).toBe(true);
165
+ expect(unpacked.triggerType).toBe('price');
166
+ expect(unpacked.builder?.builderId).toBe(5);
167
+ expect(unpacked.builder?.builderFeeRate).toBe(100);
168
+ });
169
+
170
+ it('should not return builder fields when builderId is 0', () => {
171
+ const appendix: OrderAppendix = {
172
+ orderExecutionType: 'default',
173
+ };
174
+ const packed = packOrderAppendix(appendix);
175
+ const unpacked = unpackOrderAppendix(packed);
176
+ expect(unpacked.builder).toBeUndefined();
120
177
  });
121
178
  });
@@ -1,5 +1,5 @@
1
1
  import { OrderAppendix } from '../../../types/orderAppendixTypes';
2
- import { toBigInt } from '../../math/toBigInt';
2
+ import { packIsolatedOrderAppendixValue } from './appendixIsolatedValue';
3
3
  import { packTwapOrderAppendixValue } from './appendixTwapValue';
4
4
  import { bitMaskValue } from './bitMaskValue';
5
5
  import { PackedOrderAppendixBits } from './types';
@@ -12,7 +12,7 @@ function mapOrderAppendixToBitValues(
12
12
  return packTwapOrderAppendixValue(appendix.twap);
13
13
  }
14
14
  if (appendix.isolated) {
15
- return toBigInt(appendix.isolated.margin);
15
+ return packIsolatedOrderAppendixValue(appendix.isolated);
16
16
  }
17
17
  return 0n;
18
18
  })();
@@ -43,12 +43,14 @@ function mapOrderAppendixToBitValues(
43
43
 
44
44
  return {
45
45
  value,
46
+ builderId: appendix.builder?.builderId ?? 0,
47
+ builderFeeRate: appendix.builder?.builderFeeRate ?? 0,
46
48
  reserved: 0,
47
49
  trigger,
48
50
  reduceOnly: appendix.reduceOnly ? 1 : 0,
49
51
  orderType,
50
52
  isolated: appendix.isolated ? 1 : 0,
51
- version: 0,
53
+ version: 1,
52
54
  };
53
55
  }
54
56
 
@@ -59,9 +61,11 @@ function mapOrderAppendixToBitValues(
59
61
  export function packOrderAppendix(appendix: OrderAppendix): bigint {
60
62
  const bits = mapOrderAppendixToBitValues(appendix);
61
63
 
62
- // Ensure value is within 96 bits
63
- let packed = bitMaskValue(bits.value, 96);
64
- packed = (packed << 18n) | bitMaskValue(bits.reserved, 18);
64
+ // Ensure value is within 64 bits
65
+ let packed = bitMaskValue(bits.value, 64);
66
+ packed = (packed << 16n) | bitMaskValue(bits.builderId, 16);
67
+ packed = (packed << 10n) | bitMaskValue(bits.builderFeeRate, 10);
68
+ packed = (packed << 24n) | bitMaskValue(bits.reserved, 24);
65
69
  packed = (packed << 2n) | bitMaskValue(bits.trigger, 2);
66
70
  packed = (packed << 1n) | bitMaskValue(bits.reduceOnly, 1);
67
71
  packed = (packed << 2n) | bitMaskValue(bits.orderType, 2);
@@ -1,17 +1,19 @@
1
1
  /**
2
2
  * Bit layout for OrderAppendix packing (MSB → LSB):
3
3
  *
4
- * | value | reserved | trigger | reduceOnly | orderType | isolated | version |
5
- * |-----------|----------|---------|------------|-----------|----------|---------|
6
- * | 127..32 | 31..14 | 13..12 | 11 | 10..9 | 8 | 7..0 |
7
- * | 96 bits | 18 bits | 2 bits | 1 bit | 2 bits | 1 bit | 8 bits |
4
+ * | value | builderId | builderFeeRate | reserved | trigger | reduceOnly | orderType | isolated | version |
5
+ * |-----------|-----------|----------------|----------|---------|------------|-----------|----------|---------|
6
+ * | 127..64 | 63..48 | 47..38 | 37..14 | 13..12 | 11 | 10..9 | 8 | 7..0 |
7
+ * | 64 bits | 16 bits | 10 bits | 24 bits | 2 bits | 1 bit | 2 bits | 1 bit | 8 bits |
8
8
  */
9
9
  export interface PackedOrderAppendixBits {
10
- value: bigint; // 96 bits
11
- reserved: number; // 18 bits, set to 0
10
+ value: bigint; // 64 bits
11
+ builderId: number; // 16 bits
12
+ builderFeeRate: number; // 10 bits
13
+ reserved: number; // 24 bits, set to 0
12
14
  trigger: number; // 2 bits
13
15
  reduceOnly: number; // 1 bit
14
16
  orderType: number; // 2 bits
15
17
  isolated: number; // 1 bit
16
- version: number; // 8 bits, set to 0
18
+ version: number; // 8 bits, set to 1
17
19
  }
@@ -1,5 +1,6 @@
1
1
  import { OrderAppendix } from '../../../types/orderAppendixTypes';
2
- import { BigDecimalish, toBigInt } from '../../math';
2
+ import { BigNumberish, toBigInt } from '../../math';
3
+ import { unpackIsolatedOrderAppendixValue } from './appendixIsolatedValue';
3
4
  import { unpackTwapOrderAppendixValue } from './appendixTwapValue';
4
5
  import { bitMaskValue } from './bitMaskValue';
5
6
  import { PackedOrderAppendixBits } from './types';
@@ -35,7 +36,7 @@ function mapBitValuesToAppendix(bits: PackedOrderAppendixBits): OrderAppendix {
35
36
  })();
36
37
  const isolatedFields = (() => {
37
38
  if (bits.isolated) {
38
- return { margin: bits.value };
39
+ return unpackIsolatedOrderAppendixValue(bits.value);
39
40
  }
40
41
  return undefined;
41
42
  })();
@@ -44,6 +45,15 @@ function mapBitValuesToAppendix(bits: PackedOrderAppendixBits): OrderAppendix {
44
45
  return unpackTwapOrderAppendixValue(bits.value);
45
46
  }
46
47
  })();
48
+ const builderFields = (() => {
49
+ if (bits.builderId) {
50
+ return {
51
+ builderId: bits.builderId,
52
+ builderFeeRate: bits.builderFeeRate,
53
+ };
54
+ }
55
+ return undefined;
56
+ })();
47
57
 
48
58
  return {
49
59
  reduceOnly: !!bits.reduceOnly,
@@ -51,6 +61,7 @@ function mapBitValuesToAppendix(bits: PackedOrderAppendixBits): OrderAppendix {
51
61
  triggerType,
52
62
  isolated: isolatedFields,
53
63
  twap: twapFields,
64
+ builder: builderFields,
54
65
  };
55
66
  }
56
67
 
@@ -58,7 +69,7 @@ function mapBitValuesToAppendix(bits: PackedOrderAppendixBits): OrderAppendix {
58
69
  * Unpack the OrderAppendix fields from a packed bigint.
59
70
  * @param packed
60
71
  */
61
- export function unpackOrderAppendix(packed: BigDecimalish): OrderAppendix {
72
+ export function unpackOrderAppendix(packed: BigNumberish): OrderAppendix {
62
73
  let temp = toBigInt(packed);
63
74
  // Bitmasks lowest 8 bits for version
64
75
  const version = Number(bitMaskValue(temp, 8));
@@ -73,13 +84,19 @@ export function unpackOrderAppendix(packed: BigDecimalish): OrderAppendix {
73
84
  temp >>= 1n;
74
85
  const trigger = Number(bitMaskValue(temp, 2));
75
86
  temp >>= 2n;
76
- const reserved = Number(bitMaskValue(temp, 18));
77
- temp >>= 18n;
78
- // The remaining bits are the value, which should be 96 bits
79
- const value = bitMaskValue(temp, 96);
87
+ const reserved = Number(bitMaskValue(temp, 24));
88
+ temp >>= 24n;
89
+ const builderFeeRate = Number(bitMaskValue(temp, 10));
90
+ temp >>= 10n;
91
+ const builderId = Number(bitMaskValue(temp, 16));
92
+ temp >>= 16n;
93
+ // The remaining bits are the value, which should be 64 bits
94
+ const value = bitMaskValue(temp, 64);
80
95
 
81
96
  return mapBitValuesToAppendix({
82
97
  value,
98
+ builderId,
99
+ builderFeeRate,
83
100
  reserved,
84
101
  trigger,
85
102
  reduceOnly,
@@ -1,3 +1,3 @@
1
+ export * from './appendix';
1
2
  export * from './orderNonce';
2
3
  export * from './recvTime';
3
- export * from './appendix';
@@ -1,9 +1,9 @@
1
1
  import { Balance, PerpBalance, SpotBalance } from '../types/balanceTypes';
2
2
  import {
3
- ProductEngineType,
4
3
  PerpProduct,
5
- SpotProduct,
6
4
  Product,
5
+ ProductEngineType,
6
+ SpotProduct,
7
7
  } from '../types/productTypes';
8
8
 
9
9
  export function isSpotProduct(product: Product): product is SpotProduct {
@@ -1,25 +1,45 @@
1
- import { BigDecimal } from './math/bigDecimal';
1
+ import BigNumber from 'bignumber.js';
2
2
 
3
3
  /**
4
- * Util for converting any BigDecimal types into a string so that it can be logged nicely
4
+ * Util for converting any BigNumber types into a string so that it can be logged nicely.
5
+ * Handles cyclic references by returning '[Circular]' for already-visited objects.
5
6
  */
6
- export function toPrintableObject(obj: unknown): unknown {
7
- if (obj == null) {
7
+ export function toPrintableObject(
8
+ obj: null | undefined,
9
+ seen?: WeakSet<object>,
10
+ ): null;
11
+ export function toPrintableObject(
12
+ obj: BigNumber | bigint,
13
+ seen?: WeakSet<object>,
14
+ ): string;
15
+ export function toPrintableObject(obj: unknown, seen?: WeakSet<object>): object;
16
+ export function toPrintableObject(obj: unknown, seen = new WeakSet()): unknown {
17
+ if (obj === null || obj === undefined) {
8
18
  return null;
9
19
  }
10
- if (obj instanceof BigDecimal || typeof obj === 'bigint') {
20
+ if (obj instanceof BigNumber || typeof obj === 'bigint') {
11
21
  return obj.toString();
12
22
  }
13
23
  if (Array.isArray(obj)) {
14
- return obj.map(toPrintableObject);
24
+ return obj.map((item) => toPrintableObject(item, seen));
15
25
  }
16
26
  if (typeof obj === 'object') {
17
- return Object.fromEntries(
18
- Object.entries(obj).map(([key, value]) => [
19
- key,
20
- toPrintableObject(value),
21
- ]),
22
- );
27
+ // Detect cyclic references
28
+ if (seen.has(obj)) {
29
+ return '[Circular]';
30
+ }
31
+ seen.add(obj);
32
+
33
+ try {
34
+ return Object.fromEntries(
35
+ Object.entries(obj).map(([key, value]) => [
36
+ key,
37
+ toPrintableObject(value, seen),
38
+ ]),
39
+ );
40
+ } catch {
41
+ return { error: '[Unserializable Object]' };
42
+ }
23
43
  }
24
44
  return obj;
25
45
  }
@@ -1 +0,0 @@
1
- {"version":3,"sources":["../../../node_modules/@jest/globals/build/index.js"],"sourcesContent":["/*!\n * /**\n * * Copyright (c) Meta Platforms, Inc. and affiliates.\n * *\n * * This source code is licensed under the MIT license found in the\n * * LICENSE file in the root directory of this source tree.\n * * /\n */\n/******/ (() => { // webpackBootstrap\n/******/ \t\"use strict\";\nvar __webpack_exports__ = {};\n\n\n/**\n * Copyright (c) Meta Platforms, Inc. and affiliates.\n *\n * This source code is licensed under the MIT license found in the\n * LICENSE file in the root directory of this source tree.\n */\n\n// eslint-disable-next-line @typescript-eslint/no-namespace\n\nthrow new Error('Do not import `@jest/globals` outside of the Jest test environment');\nmodule.exports = __webpack_exports__;\n/******/ })()\n;"],"mappings":";;;;;AAAA;AAAA;AAAA;AAQS,KAAC,MAAM;AACN;AACV,UAAI,sBAAsB,CAAC;AAY3B,YAAM,IAAI,MAAM,oEAAoE;AACpF,aAAO,UAAU;AAAA,IACR,GAAG;AAAA;AAAA;","names":[]}
@@ -1,13 +0,0 @@
1
- {
2
- "nodeUrl": "https://rpc-gel-sepolia.inkonchain.com",
3
- "explorerUrl": "https://explorer-sepolia.inkonchain.com",
4
- "startBlock": 27233833,
5
- "deployer": "0x8177A1b5bFaAa10A4b1178c6D42aDaa4b75c8146",
6
- "quote": "0x5F65358d61A9a281ea3BB930d05889ACa21E3f4f",
7
- "querier": "0x5A62e748b2630560Ffe9E928780cF9Fe0e086A21",
8
- "clearinghouse": "0x5E9b4336104069467E57E843033e62c79C667F8F",
9
- "endpoint": "0xf8963f7860aF7DE9b94893EDb9A3b5c155e1Fc0c",
10
- "spotEngine": "0x61AA7A636df5e72eBe34c70a340eB76ABB3A15bE",
11
- "perpEngine": "0x3D6Ac7105cA399884739a8CC19cAdB4178844466",
12
- "withdrawPool": "0xa59613a3e4ce46E20d83b0632E3D857e3f116F66"
13
- }
@@ -1,18 +0,0 @@
1
- {
2
- "nodeUrl": "https://arb1.arbitrum.io/rpc",
3
- "explorerUrl": "https://explorer.arbitrum.io",
4
- "subgraphCoreUrl": "https://api.thegraph.com/subgraphs/name/nado-protocol/nado-prod-core",
5
- "subgraphMarketsUrl": "https://api.thegraph.com/subgraphs/name/nado-protocol/nado-prod-markets",
6
- "subgraphCandleSticksUrl": "https://api.thegraph.com/subgraphs/name/nado-protocol/nado-prod-candlesticks",
7
- "startBlock": 67108377,
8
- "deployer": "0xB746472C10f9F128FF9F5029f424cC91bb1D8C3a",
9
- "quote": "0xff970a61a04b1ca14834a43f5de4533ebddb5cc8",
10
- "querier": "0x1693273B443699bee277eCbc60e2C8027E91995d",
11
- "feeCalculator": "0x2259440579447D0625a5E28dfF3E743d207e8890",
12
- "clearinghouse": "0xAE1ec28d6225dCE2ff787dcb8CE11cF6D3AE064f",
13
- "clearinghouseLiq": "0xca007C51Fc14eEA88252Cc4FD71e91E44026F020",
14
- "endpoint": "0xbbEE07B3e8121227AfCFe1E2B82772246226128e",
15
- "spotEngine": "0x32d91Af2B17054D575A7bF1ACfa7615f41CCEfaB",
16
- "perpEngine": "0xb74C78cca0FADAFBeE52B2f48A67eE8c834b5fd1",
17
- "withdrawPool": "0x3567a1f8d79046A7e93Fd76d71104A978cDC6d05"
18
- }
@@ -1 +0,0 @@
1
- {"version":3,"sources":["../../../src/utils/math/BigDecimals.ts"],"sourcesContent":["import { toBigDecimal } from './bigDecimal';\n\nexport const BigDecimals = Object.freeze({\n ZERO: toBigDecimal(0),\n ONE: toBigDecimal(1),\n INF: toBigDecimal(Infinity),\n MAX_I128: toBigDecimal('170141183460469231731687303715884105727'),\n});\n"],"mappings":";;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,wBAA6B;AAEtB,IAAM,cAAc,OAAO,OAAO;AAAA,EACvC,UAAM,gCAAa,CAAC;AAAA,EACpB,SAAK,gCAAa,CAAC;AAAA,EACnB,SAAK,gCAAa,QAAQ;AAAA,EAC1B,cAAU,gCAAa,yCAAyC;AAClE,CAAC;","names":[]}
@@ -1,8 +0,0 @@
1
- declare const BigDecimals: Readonly<{
2
- ZERO: BigNumber;
3
- ONE: BigNumber;
4
- INF: BigNumber;
5
- MAX_I128: BigNumber;
6
- }>;
7
-
8
- export { BigDecimals };