@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
@@ -1,11 +1,11 @@
1
- export { getOrderNonce, getRecvTimeFromOrderNonce } from './orderNonce.js';
2
- export { getDefaultRecvTime } from './recvTime.js';
3
1
  export { packTwapOrderAppendixValue, unpackTwapOrderAppendixValue } from './appendix/appendixTwapValue.js';
4
- export { unpackOrderAppendix } from './appendix/unpackOrderAppendix.js';
2
+ export { bitMaskValue } from './appendix/bitMaskValue.js';
5
3
  export { packOrderAppendix } from './appendix/packOrderAppendix.js';
6
4
  export { PackedOrderAppendixBits } from './appendix/types.js';
7
- export { bitMaskValue } from './appendix/bitMaskValue.js';
5
+ export { unpackOrderAppendix } from './appendix/unpackOrderAppendix.js';
6
+ export { getOrderNonce, getRecvTimeFromOrderNonce } from './orderNonce.js';
7
+ export { getDefaultRecvTime } from './recvTime.js';
8
8
  import '../../types/orderAppendixTypes.js';
9
- import '../math/bigDecimal.js';
9
+ import '../math/bigNumber.js';
10
10
  import 'bignumber.js';
11
11
  import '../../types/OrderExecutionType.js';
@@ -1,5 +1,5 @@
1
1
  // src/utils/orders/index.ts
2
+ export * from "./appendix/index.js";
2
3
  export * from "./orderNonce.js";
3
4
  export * from "./recvTime.js";
4
- export * from "./appendix/index.js";
5
5
  //# sourceMappingURL=index.js.map
@@ -1 +1 @@
1
- {"version":3,"sources":["../../../src/utils/orders/index.ts"],"sourcesContent":["export * from './orderNonce';\nexport * from './recvTime';\nexport * from './appendix';\n"],"mappings":";AAAA,cAAc;AACd,cAAc;AACd,cAAc;","names":[]}
1
+ {"version":3,"sources":["../../../src/utils/orders/index.ts"],"sourcesContent":["export * from './appendix';\nexport * from './orderNonce';\nexport * from './recvTime';\n"],"mappings":";AAAA,cAAc;AACd,cAAc;AACd,cAAc;","names":[]}
@@ -1 +1 @@
1
- {"version":3,"sources":["../../src/utils/productTypeFilter.ts"],"sourcesContent":["import { Balance, PerpBalance, SpotBalance } from '../types/balanceTypes';\nimport {\n ProductEngineType,\n PerpProduct,\n SpotProduct,\n Product,\n} from '../types/productTypes';\n\nexport function isSpotProduct(product: Product): product is SpotProduct {\n return product.type === ProductEngineType.SPOT;\n}\n\nexport function isSpotBalance(balance: Balance): balance is SpotBalance {\n return balance.type === ProductEngineType.SPOT;\n}\n\nexport function isPerpProduct(product: Product): product is PerpProduct {\n return product.type === ProductEngineType.PERP;\n}\n\nexport function isPerpBalance(balance: Balance): balance is PerpBalance {\n return balance.type === ProductEngineType.PERP;\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AACA,0BAKO;AAEA,SAAS,cAAc,SAA0C;AACtE,SAAO,QAAQ,SAAS,sCAAkB;AAC5C;AAEO,SAAS,cAAc,SAA0C;AACtE,SAAO,QAAQ,SAAS,sCAAkB;AAC5C;AAEO,SAAS,cAAc,SAA0C;AACtE,SAAO,QAAQ,SAAS,sCAAkB;AAC5C;AAEO,SAAS,cAAc,SAA0C;AACtE,SAAO,QAAQ,SAAS,sCAAkB;AAC5C;","names":[]}
1
+ {"version":3,"sources":["../../src/utils/productTypeFilter.ts"],"sourcesContent":["import { Balance, PerpBalance, SpotBalance } from '../types/balanceTypes';\nimport {\n PerpProduct,\n Product,\n ProductEngineType,\n SpotProduct,\n} from '../types/productTypes';\n\nexport function isSpotProduct(product: Product): product is SpotProduct {\n return product.type === ProductEngineType.SPOT;\n}\n\nexport function isSpotBalance(balance: Balance): balance is SpotBalance {\n return balance.type === ProductEngineType.SPOT;\n}\n\nexport function isPerpProduct(product: Product): product is PerpProduct {\n return product.type === ProductEngineType.PERP;\n}\n\nexport function isPerpBalance(balance: Balance): balance is PerpBalance {\n return balance.type === ProductEngineType.PERP;\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AACA,0BAKO;AAEA,SAAS,cAAc,SAA0C;AACtE,SAAO,QAAQ,SAAS,sCAAkB;AAC5C;AAEO,SAAS,cAAc,SAA0C;AACtE,SAAO,QAAQ,SAAS,sCAAkB;AAC5C;AAEO,SAAS,cAAc,SAA0C;AACtE,SAAO,QAAQ,SAAS,sCAAkB;AAC5C;AAEO,SAAS,cAAc,SAA0C;AACtE,SAAO,QAAQ,SAAS,sCAAkB;AAC5C;","names":[]}
@@ -1,5 +1,5 @@
1
- import { Balance, SpotBalance, PerpBalance } from '../types/balanceTypes.cjs';
2
- import { Product, SpotProduct, PerpProduct } from '../types/productTypes.cjs';
1
+ import { Balance, PerpBalance, SpotBalance } from '../types/balanceTypes.cjs';
2
+ import { Product, PerpProduct, SpotProduct } from '../types/productTypes.cjs';
3
3
  import 'bignumber.js';
4
4
  import '../types/healthTypes.cjs';
5
5
 
@@ -1,5 +1,5 @@
1
- import { Balance, SpotBalance, PerpBalance } from '../types/balanceTypes.js';
2
- import { Product, SpotProduct, PerpProduct } from '../types/productTypes.js';
1
+ import { Balance, PerpBalance, SpotBalance } from '../types/balanceTypes.js';
2
+ import { Product, PerpProduct, SpotProduct } from '../types/productTypes.js';
3
3
  import 'bignumber.js';
4
4
  import '../types/healthTypes.js';
5
5
 
@@ -1 +1 @@
1
- {"version":3,"sources":["../../src/utils/productTypeFilter.ts"],"sourcesContent":["import { Balance, PerpBalance, SpotBalance } from '../types/balanceTypes';\nimport {\n ProductEngineType,\n PerpProduct,\n SpotProduct,\n Product,\n} from '../types/productTypes';\n\nexport function isSpotProduct(product: Product): product is SpotProduct {\n return product.type === ProductEngineType.SPOT;\n}\n\nexport function isSpotBalance(balance: Balance): balance is SpotBalance {\n return balance.type === ProductEngineType.SPOT;\n}\n\nexport function isPerpProduct(product: Product): product is PerpProduct {\n return product.type === ProductEngineType.PERP;\n}\n\nexport function isPerpBalance(balance: Balance): balance is PerpBalance {\n return balance.type === ProductEngineType.PERP;\n}\n"],"mappings":";;;AACA;AAAA,EACE;AAAA,OAIK;AAEA,SAAS,cAAc,SAA0C;AACtE,SAAO,QAAQ,SAAS,kBAAkB;AAC5C;AAEO,SAAS,cAAc,SAA0C;AACtE,SAAO,QAAQ,SAAS,kBAAkB;AAC5C;AAEO,SAAS,cAAc,SAA0C;AACtE,SAAO,QAAQ,SAAS,kBAAkB;AAC5C;AAEO,SAAS,cAAc,SAA0C;AACtE,SAAO,QAAQ,SAAS,kBAAkB;AAC5C;","names":[]}
1
+ {"version":3,"sources":["../../src/utils/productTypeFilter.ts"],"sourcesContent":["import { Balance, PerpBalance, SpotBalance } from '../types/balanceTypes';\nimport {\n PerpProduct,\n Product,\n ProductEngineType,\n SpotProduct,\n} from '../types/productTypes';\n\nexport function isSpotProduct(product: Product): product is SpotProduct {\n return product.type === ProductEngineType.SPOT;\n}\n\nexport function isSpotBalance(balance: Balance): balance is SpotBalance {\n return balance.type === ProductEngineType.SPOT;\n}\n\nexport function isPerpProduct(product: Product): product is PerpProduct {\n return product.type === ProductEngineType.PERP;\n}\n\nexport function isPerpBalance(balance: Balance): balance is PerpBalance {\n return balance.type === ProductEngineType.PERP;\n}\n"],"mappings":";;;AACA;AAAA,EAGE;AAAA,OAEK;AAEA,SAAS,cAAc,SAA0C;AACtE,SAAO,QAAQ,SAAS,kBAAkB;AAC5C;AAEO,SAAS,cAAc,SAA0C;AACtE,SAAO,QAAQ,SAAS,kBAAkB;AAC5C;AAEO,SAAS,cAAc,SAA0C;AACtE,SAAO,QAAQ,SAAS,kBAAkB;AAC5C;AAEO,SAAS,cAAc,SAA0C;AACtE,SAAO,QAAQ,SAAS,kBAAkB;AAC5C;","names":[]}
@@ -1,7 +1,9 @@
1
1
  "use strict";
2
+ var __create = Object.create;
2
3
  var __defProp = Object.defineProperty;
3
4
  var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
4
5
  var __getOwnPropNames = Object.getOwnPropertyNames;
6
+ var __getProtoOf = Object.getPrototypeOf;
5
7
  var __hasOwnProp = Object.prototype.hasOwnProperty;
6
8
  var __export = (target, all) => {
7
9
  for (var name in all)
@@ -15,6 +17,14 @@ var __copyProps = (to, from, except, desc) => {
15
17
  }
16
18
  return to;
17
19
  };
20
+ var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
21
+ // If the importer is in node compatibility mode or this is not an ESM
22
+ // file that has been converted to a CommonJS file using a Babel-
23
+ // compatible transform (i.e. "__esModule" has not been set), then set
24
+ // "default" to the CommonJS "module.exports" for node compatibility.
25
+ isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
26
+ mod
27
+ ));
18
28
  var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
19
29
 
20
30
  // src/utils/toPrintableObject.ts
@@ -23,24 +33,32 @@ __export(toPrintableObject_exports, {
23
33
  toPrintableObject: () => toPrintableObject
24
34
  });
25
35
  module.exports = __toCommonJS(toPrintableObject_exports);
26
- var import_bigDecimal = require("./math/bigDecimal.cjs");
27
- function toPrintableObject(obj) {
28
- if (obj == null) {
36
+ var import_bignumber = __toESM(require("bignumber.js"), 1);
37
+ function toPrintableObject(obj, seen = /* @__PURE__ */ new WeakSet()) {
38
+ if (obj === null || obj === void 0) {
29
39
  return null;
30
40
  }
31
- if (obj instanceof import_bigDecimal.BigDecimal || typeof obj === "bigint") {
41
+ if (obj instanceof import_bignumber.default || typeof obj === "bigint") {
32
42
  return obj.toString();
33
43
  }
34
44
  if (Array.isArray(obj)) {
35
- return obj.map(toPrintableObject);
45
+ return obj.map((item) => toPrintableObject(item, seen));
36
46
  }
37
47
  if (typeof obj === "object") {
38
- return Object.fromEntries(
39
- Object.entries(obj).map(([key, value]) => [
40
- key,
41
- toPrintableObject(value)
42
- ])
43
- );
48
+ if (seen.has(obj)) {
49
+ return "[Circular]";
50
+ }
51
+ seen.add(obj);
52
+ try {
53
+ return Object.fromEntries(
54
+ Object.entries(obj).map(([key, value]) => [
55
+ key,
56
+ toPrintableObject(value, seen)
57
+ ])
58
+ );
59
+ } catch {
60
+ return { error: "[Unserializable Object]" };
61
+ }
44
62
  }
45
63
  return obj;
46
64
  }
@@ -1 +1 @@
1
- {"version":3,"sources":["../../src/utils/toPrintableObject.ts"],"sourcesContent":["import { BigDecimal } from './math/bigDecimal';\n\n/**\n * Util for converting any BigDecimal types into a string so that it can be logged nicely\n */\nexport function toPrintableObject(obj: unknown): unknown {\n if (obj == null) {\n return null;\n }\n if (obj instanceof BigDecimal || typeof obj === 'bigint') {\n return obj.toString();\n }\n if (Array.isArray(obj)) {\n return obj.map(toPrintableObject);\n }\n if (typeof obj === 'object') {\n return Object.fromEntries(\n Object.entries(obj).map(([key, value]) => [\n key,\n toPrintableObject(value),\n ]),\n );\n }\n return obj;\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,wBAA2B;AAKpB,SAAS,kBAAkB,KAAuB;AACvD,MAAI,OAAO,MAAM;AACf,WAAO;AAAA,EACT;AACA,MAAI,eAAe,gCAAc,OAAO,QAAQ,UAAU;AACxD,WAAO,IAAI,SAAS;AAAA,EACtB;AACA,MAAI,MAAM,QAAQ,GAAG,GAAG;AACtB,WAAO,IAAI,IAAI,iBAAiB;AAAA,EAClC;AACA,MAAI,OAAO,QAAQ,UAAU;AAC3B,WAAO,OAAO;AAAA,MACZ,OAAO,QAAQ,GAAG,EAAE,IAAI,CAAC,CAAC,KAAK,KAAK,MAAM;AAAA,QACxC;AAAA,QACA,kBAAkB,KAAK;AAAA,MACzB,CAAC;AAAA,IACH;AAAA,EACF;AACA,SAAO;AACT;","names":[]}
1
+ {"version":3,"sources":["../../src/utils/toPrintableObject.ts"],"sourcesContent":["import BigNumber from 'bignumber.js';\n\n/**\n * Util for converting any BigNumber types into a string so that it can be logged nicely.\n * Handles cyclic references by returning '[Circular]' for already-visited objects.\n */\nexport function toPrintableObject(\n obj: null | undefined,\n seen?: WeakSet<object>,\n): null;\nexport function toPrintableObject(\n obj: BigNumber | bigint,\n seen?: WeakSet<object>,\n): string;\nexport function toPrintableObject(obj: unknown, seen?: WeakSet<object>): object;\nexport function toPrintableObject(obj: unknown, seen = new WeakSet()): unknown {\n if (obj === null || obj === undefined) {\n return null;\n }\n if (obj instanceof BigNumber || typeof obj === 'bigint') {\n return obj.toString();\n }\n if (Array.isArray(obj)) {\n return obj.map((item) => toPrintableObject(item, seen));\n }\n if (typeof obj === 'object') {\n // Detect cyclic references\n if (seen.has(obj)) {\n return '[Circular]';\n }\n seen.add(obj);\n\n try {\n return Object.fromEntries(\n Object.entries(obj).map(([key, value]) => [\n key,\n toPrintableObject(value, seen),\n ]),\n );\n } catch {\n return { error: '[Unserializable Object]' };\n }\n }\n return obj;\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,uBAAsB;AAef,SAAS,kBAAkB,KAAc,OAAO,oBAAI,QAAQ,GAAY;AAC7E,MAAI,QAAQ,QAAQ,QAAQ,QAAW;AACrC,WAAO;AAAA,EACT;AACA,MAAI,eAAe,iBAAAA,WAAa,OAAO,QAAQ,UAAU;AACvD,WAAO,IAAI,SAAS;AAAA,EACtB;AACA,MAAI,MAAM,QAAQ,GAAG,GAAG;AACtB,WAAO,IAAI,IAAI,CAAC,SAAS,kBAAkB,MAAM,IAAI,CAAC;AAAA,EACxD;AACA,MAAI,OAAO,QAAQ,UAAU;AAE3B,QAAI,KAAK,IAAI,GAAG,GAAG;AACjB,aAAO;AAAA,IACT;AACA,SAAK,IAAI,GAAG;AAEZ,QAAI;AACF,aAAO,OAAO;AAAA,QACZ,OAAO,QAAQ,GAAG,EAAE,IAAI,CAAC,CAAC,KAAK,KAAK,MAAM;AAAA,UACxC;AAAA,UACA,kBAAkB,OAAO,IAAI;AAAA,QAC/B,CAAC;AAAA,MACH;AAAA,IACF,QAAQ;AACN,aAAO,EAAE,OAAO,0BAA0B;AAAA,IAC5C;AAAA,EACF;AACA,SAAO;AACT;","names":["BigNumber"]}
@@ -1,6 +1,11 @@
1
+ import BigNumber__default from 'bignumber.js';
2
+
1
3
  /**
2
- * 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.
3
6
  */
4
- declare function toPrintableObject(obj: unknown): unknown;
7
+ declare function toPrintableObject(obj: null | undefined, seen?: WeakSet<object>): null;
8
+ declare function toPrintableObject(obj: BigNumber__default | bigint, seen?: WeakSet<object>): string;
9
+ declare function toPrintableObject(obj: unknown, seen?: WeakSet<object>): object;
5
10
 
6
11
  export { toPrintableObject };
@@ -1,6 +1,11 @@
1
+ import BigNumber__default from 'bignumber.js';
2
+
1
3
  /**
2
- * 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.
3
6
  */
4
- declare function toPrintableObject(obj: unknown): unknown;
7
+ declare function toPrintableObject(obj: null | undefined, seen?: WeakSet<object>): null;
8
+ declare function toPrintableObject(obj: BigNumber__default | bigint, seen?: WeakSet<object>): string;
9
+ declare function toPrintableObject(obj: unknown, seen?: WeakSet<object>): object;
5
10
 
6
11
  export { toPrintableObject };
@@ -1,24 +1,32 @@
1
1
  import "../chunk-5WRI5ZAA.js";
2
2
 
3
3
  // src/utils/toPrintableObject.ts
4
- import { BigDecimal } from "./math/bigDecimal.js";
5
- function toPrintableObject(obj) {
6
- if (obj == null) {
4
+ import BigNumber from "bignumber.js";
5
+ function toPrintableObject(obj, seen = /* @__PURE__ */ new WeakSet()) {
6
+ if (obj === null || obj === void 0) {
7
7
  return null;
8
8
  }
9
- if (obj instanceof BigDecimal || typeof obj === "bigint") {
9
+ if (obj instanceof BigNumber || typeof obj === "bigint") {
10
10
  return obj.toString();
11
11
  }
12
12
  if (Array.isArray(obj)) {
13
- return obj.map(toPrintableObject);
13
+ return obj.map((item) => toPrintableObject(item, seen));
14
14
  }
15
15
  if (typeof obj === "object") {
16
- return Object.fromEntries(
17
- Object.entries(obj).map(([key, value]) => [
18
- key,
19
- toPrintableObject(value)
20
- ])
21
- );
16
+ if (seen.has(obj)) {
17
+ return "[Circular]";
18
+ }
19
+ seen.add(obj);
20
+ try {
21
+ return Object.fromEntries(
22
+ Object.entries(obj).map(([key, value]) => [
23
+ key,
24
+ toPrintableObject(value, seen)
25
+ ])
26
+ );
27
+ } catch {
28
+ return { error: "[Unserializable Object]" };
29
+ }
22
30
  }
23
31
  return obj;
24
32
  }
@@ -1 +1 @@
1
- {"version":3,"sources":["../../src/utils/toPrintableObject.ts"],"sourcesContent":["import { BigDecimal } from './math/bigDecimal';\n\n/**\n * Util for converting any BigDecimal types into a string so that it can be logged nicely\n */\nexport function toPrintableObject(obj: unknown): unknown {\n if (obj == null) {\n return null;\n }\n if (obj instanceof BigDecimal || typeof obj === 'bigint') {\n return obj.toString();\n }\n if (Array.isArray(obj)) {\n return obj.map(toPrintableObject);\n }\n if (typeof obj === 'object') {\n return Object.fromEntries(\n Object.entries(obj).map(([key, value]) => [\n key,\n toPrintableObject(value),\n ]),\n );\n }\n return obj;\n}\n"],"mappings":";;;AAAA,SAAS,kBAAkB;AAKpB,SAAS,kBAAkB,KAAuB;AACvD,MAAI,OAAO,MAAM;AACf,WAAO;AAAA,EACT;AACA,MAAI,eAAe,cAAc,OAAO,QAAQ,UAAU;AACxD,WAAO,IAAI,SAAS;AAAA,EACtB;AACA,MAAI,MAAM,QAAQ,GAAG,GAAG;AACtB,WAAO,IAAI,IAAI,iBAAiB;AAAA,EAClC;AACA,MAAI,OAAO,QAAQ,UAAU;AAC3B,WAAO,OAAO;AAAA,MACZ,OAAO,QAAQ,GAAG,EAAE,IAAI,CAAC,CAAC,KAAK,KAAK,MAAM;AAAA,QACxC;AAAA,QACA,kBAAkB,KAAK;AAAA,MACzB,CAAC;AAAA,IACH;AAAA,EACF;AACA,SAAO;AACT;","names":[]}
1
+ {"version":3,"sources":["../../src/utils/toPrintableObject.ts"],"sourcesContent":["import BigNumber from 'bignumber.js';\n\n/**\n * Util for converting any BigNumber types into a string so that it can be logged nicely.\n * Handles cyclic references by returning '[Circular]' for already-visited objects.\n */\nexport function toPrintableObject(\n obj: null | undefined,\n seen?: WeakSet<object>,\n): null;\nexport function toPrintableObject(\n obj: BigNumber | bigint,\n seen?: WeakSet<object>,\n): string;\nexport function toPrintableObject(obj: unknown, seen?: WeakSet<object>): object;\nexport function toPrintableObject(obj: unknown, seen = new WeakSet()): unknown {\n if (obj === null || obj === undefined) {\n return null;\n }\n if (obj instanceof BigNumber || typeof obj === 'bigint') {\n return obj.toString();\n }\n if (Array.isArray(obj)) {\n return obj.map((item) => toPrintableObject(item, seen));\n }\n if (typeof obj === 'object') {\n // Detect cyclic references\n if (seen.has(obj)) {\n return '[Circular]';\n }\n seen.add(obj);\n\n try {\n return Object.fromEntries(\n Object.entries(obj).map(([key, value]) => [\n key,\n toPrintableObject(value, seen),\n ]),\n );\n } catch {\n return { error: '[Unserializable Object]' };\n }\n }\n return obj;\n}\n"],"mappings":";;;AAAA,OAAO,eAAe;AAef,SAAS,kBAAkB,KAAc,OAAO,oBAAI,QAAQ,GAAY;AAC7E,MAAI,QAAQ,QAAQ,QAAQ,QAAW;AACrC,WAAO;AAAA,EACT;AACA,MAAI,eAAe,aAAa,OAAO,QAAQ,UAAU;AACvD,WAAO,IAAI,SAAS;AAAA,EACtB;AACA,MAAI,MAAM,QAAQ,GAAG,GAAG;AACtB,WAAO,IAAI,IAAI,CAAC,SAAS,kBAAkB,MAAM,IAAI,CAAC;AAAA,EACxD;AACA,MAAI,OAAO,QAAQ,UAAU;AAE3B,QAAI,KAAK,IAAI,GAAG,GAAG;AACjB,aAAO;AAAA,IACT;AACA,SAAK,IAAI,GAAG;AAEZ,QAAI;AACF,aAAO,OAAO;AAAA,QACZ,OAAO,QAAQ,GAAG,EAAE,IAAI,CAAC,CAAC,KAAK,KAAK,MAAM;AAAA,UACxC;AAAA,UACA,kBAAkB,OAAO,IAAI;AAAA,QAC/B,CAAC;AAAA,MACH;AAAA,IACF,QAAQ;AACN,aAAO,EAAE,OAAO,0BAA0B;AAAA,IAC5C;AAAA,EACF;AACA,SAAO;AACT;","names":[]}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@nadohq/shared",
3
- "version": "0.1.0-alpha.8",
3
+ "version": "0.1.0",
4
4
  "type": "module",
5
5
  "sideEffects": false,
6
6
  "description": "Shared utilities, types, and contract helpers for Nado SDK",
@@ -36,14 +36,21 @@
36
36
  }
37
37
  }
38
38
  },
39
+ "react-native": "./dist/index.js",
40
+ "main": "./dist/index.cjs",
41
+ "module": "./dist/index.js",
42
+ "types": "./dist/index.d.ts",
43
+ "dependencies": {
44
+ "abitype": "^1.2.3"
45
+ },
39
46
  "peerDependencies": {
40
- "bignumber.js": "^9.3.0",
41
- "viem": "*"
47
+ "bignumber.js": "catalog:",
48
+ "viem": "catalog:"
42
49
  },
43
50
  "devDependencies": {
44
- "@jest/globals": "*",
45
- "bignumber.js": "^9.3.0",
46
- "viem": "*"
51
+ "@jest/globals": "catalog:",
52
+ "bignumber.js": "catalog:",
53
+ "viem": "catalog:"
47
54
  },
48
- "gitHead": "3488a83313ef5c199b2fc9a3cd70f477e80e74db"
55
+ "gitHead": "be24947f588c4fcc294607e985e572c81760f45a"
49
56
  }
package/src/abis/index.ts CHANGED
@@ -1,9 +1,9 @@
1
+ export * from './Clearinghouse';
2
+ export * from './Endpoint';
1
3
  export * from './ERC20';
2
4
  export * from './MockERC20';
3
- export * from './WithdrawPool';
4
- export * from './SpotEngine';
5
- export * from './Querier';
6
- export * from './PerpEngine';
7
- export * from './Endpoint';
8
- export * from './Clearinghouse';
9
5
  export * from './nadoAbis';
6
+ export * from './PerpEngine';
7
+ export * from './Querier';
8
+ export * from './SpotEngine';
9
+ export * from './WithdrawPool';
@@ -1,11 +1,11 @@
1
1
  import { Chain } from 'viem';
2
- import { arbitrum, inkSepolia, localhost } from 'viem/chains';
2
+ import { ink, inkSepolia, localhost } from 'viem/chains';
3
3
  import { ChainEnv } from '../types';
4
4
 
5
5
  export const CHAIN_ENV_TO_CHAIN = {
6
6
  local: localhost,
7
- arbitrum: arbitrum,
8
7
  inkTestnet: inkSepolia,
8
+ inkMainnet: ink,
9
9
  } as const satisfies Record<ChainEnv, Chain>;
10
10
 
11
11
  export const CHAIN_ID_TO_CHAIN_ENV = Object.fromEntries(
@@ -1,3 +1,3 @@
1
1
  export const QUOTE_PRODUCT_ID = 0;
2
2
 
3
- export const NLP_PRODUCT_ID = 153;
3
+ export const NLP_PRODUCT_ID = 11;
@@ -0,0 +1,13 @@
1
+ {
2
+ "nodeUrl": "https://ink.drpc.org",
3
+ "explorerUrl": "https://explorer.inkonchain.com",
4
+ "startBlock": 29851015,
5
+ "deployer": "0xC1cC56caB60e832665E6c3780BfEBe3C1C971603",
6
+ "quote": "0x0200C29006150606B650577BBE7B6248F58470c1",
7
+ "querier": "0x68798229F88251b31D534733D6C4098318c9dff8",
8
+ "clearinghouse": "0xD218103918C19D0A10cf35300E4CfAfbD444c5fE",
9
+ "endpoint": "0x05ec92D78ED421f3D3Ada77FFdE167106565974E",
10
+ "spotEngine": "0xFcD94770B95fd9Cc67143132BB172EB17A0907fE",
11
+ "perpEngine": "0xF8599D58d1137fC56EcDd9C16ee139C8BDf96da1",
12
+ "withdrawPool": "0x09fb495AA7859635f755E827d64c4C9A2e5b9651"
13
+ }
@@ -0,0 +1,13 @@
1
+ {
2
+ "nodeUrl": "https://rpc-gel-sepolia.inkonchain.com",
3
+ "explorerUrl": "https://explorer-sepolia.inkonchain.com",
4
+ "startBlock": 33809962,
5
+ "deployer": "0x59841b3761Ed1D089a783E4d7CB49E4534CD4F85",
6
+ "quote": "0x60F50F902b2E91aef7D6c700Eb22599e297fa86F",
7
+ "querier": "0x8E693BEa316bcC0F4f8be403081b954a0E3743C8",
8
+ "clearinghouse": "0x23a283B359D55A941bBeEC58801B6b17D955CC73",
9
+ "endpoint": "0x698D87105274292B5673367DEC81874Ce3633Ac2",
10
+ "spotEngine": "0x3352b2fF0fAc4ce38A6eA1C188cF4F924df54E5D",
11
+ "perpEngine": "0x4E859C47fea3666B5053B16C81AF64e77567702e",
12
+ "withdrawPool": "0xBD672Fe513acbA5c1ceE7b02F998A1B542852b3b"
13
+ }
@@ -3,8 +3,8 @@ import { NadoContractName } from '../abis/nadoAbis';
3
3
 
4
4
  import { ChainEnv } from '../types';
5
5
  import { getValidatedAddress } from '../utils/getValidatedAddress';
6
- import ArbitrumOneCoreDeployment from './core/deployment.arbitrumOne.json' with { type: 'json' };
7
- import InkSepoliaCoreDeployment from './core/deployment.InkSepolia.json' with { type: 'json' };
6
+ import InkMainnetCoreDeployment from './core/deployment.inkMainnet.json' with { type: 'json' };
7
+ import InkSepoliaCoreDeployment from './core/deployment.inkSepolia.json' with { type: 'json' };
8
8
  import LocalCoreDeployment from './core/deployment.localhost.json' with { type: 'json' };
9
9
 
10
10
  export type NadoDeploymentAddresses = {
@@ -15,12 +15,12 @@ export type NadoDeploymentAddresses = {
15
15
  * Known deployment addresses for the Nado contracts
16
16
  */
17
17
  export const NADO_DEPLOYMENTS: Record<ChainEnv, NadoDeploymentAddresses> = {
18
- arbitrum: validateDeployment({
19
- ...ArbitrumOneCoreDeployment,
20
- }),
21
18
  inkTestnet: validateDeployment({
22
19
  ...InkSepoliaCoreDeployment,
23
20
  }),
21
+ inkMainnet: validateDeployment({
22
+ ...InkMainnetCoreDeployment,
23
+ }),
24
24
  local: validateDeployment({
25
25
  ...LocalCoreDeployment,
26
26
  }),
@@ -1,5 +1,5 @@
1
1
  import { Hex } from 'viem';
2
- import { BigDecimalish } from '../utils/math';
2
+ import { BigNumberish } from '../utils/math';
3
3
  import {
4
4
  EIP712BurnNlpParams,
5
5
  EIP712CancelOrdersParams,
@@ -36,7 +36,7 @@ export type EIP712OrderValues = Omit<
36
36
  WithEIP712Sender<EIP712OrderParams>,
37
37
  'price'
38
38
  > & {
39
- priceX18: BigDecimalish;
39
+ priceX18: BigNumberish;
40
40
  };
41
41
 
42
42
  export type EIP712ListTriggerOrdersValues =
@@ -1,5 +1,5 @@
1
- import { getValidatedAddress } from '../utils/getValidatedAddress';
2
1
  import { TypedDataDomain } from 'abitype';
2
+ import { getValidatedAddress } from '../utils/getValidatedAddress';
3
3
 
4
4
  /**
5
5
  * Gives the EIP712 data domain for order signing
@@ -1,10 +1,10 @@
1
- export * from './getSignedTransactionRequest';
2
- export * from './getNadoEIP712Values';
3
- export * from './getNadoEIP712Types';
4
- export * from './getNadoEIP712PrimaryType';
1
+ export * from './eip712ValueTypes';
5
2
  export * from './getNadoEIP712Domain';
3
+ export * from './getNadoEIP712PrimaryType';
4
+ export * from './getNadoEIP712Types';
5
+ export * from './getNadoEIP712Values';
6
+ export * from './getOrderVerifyingAddress';
7
+ export * from './getSignedTransactionRequest';
6
8
  export * from './orderDigest';
7
9
  export * from './signableRequestType';
8
10
  export * from './signatureParamTypes';
9
- export * from './eip712ValueTypes';
10
- export * from './getOrderVerifyingAddress';
@@ -1,6 +1,6 @@
1
1
  import { Address } from 'viem';
2
2
  import { Subaccount } from '../types/subaccountTypes';
3
- import { BigDecimalish } from '../utils';
3
+ import { BigNumberish } from '../utils';
4
4
 
5
5
  export interface SignedTx<TBaseTx> {
6
6
  tx: TBaseTx;
@@ -14,7 +14,7 @@ export interface SignedEIP712OrderParams {
14
14
 
15
15
  export interface EIP712WithdrawCollateralParams extends Subaccount {
16
16
  productId: number;
17
- amount: BigDecimalish;
17
+ amount: BigNumberish;
18
18
  nonce: string;
19
19
  }
20
20
 
@@ -25,26 +25,26 @@ export interface EIP712LiquidateSubaccountParams extends Subaccount {
25
25
  // 0 = spread, 1 = long, 2 = short
26
26
  mode: number;
27
27
  // Spot & perp pair
28
- healthGroup: BigDecimalish;
29
- amount: BigDecimalish;
28
+ healthGroup: BigNumberish;
29
+ amount: BigNumberish;
30
30
  nonce: string;
31
31
  }
32
32
 
33
33
  export interface EIP712OrderParams extends Subaccount {
34
34
  // Expiration time in seconds, with order type encoded if relevant
35
- expiration: BigDecimalish;
35
+ expiration: BigNumberish;
36
36
  // Limit price
37
- price: BigDecimalish;
37
+ price: BigNumberish;
38
38
  // Positive for buy, negative for sell
39
- amount: BigDecimalish;
39
+ amount: BigNumberish;
40
40
  // A unique nonce to identify the order
41
41
  nonce: string;
42
42
  // Packed order appendix (uint128) to encode order details such as order execution behavior, isolated, etc.
43
- appendix: BigDecimalish;
43
+ appendix: BigNumberish;
44
44
  }
45
45
 
46
46
  export interface EIP712ListTriggerOrdersParams extends Subaccount {
47
- recvTime: BigDecimalish;
47
+ recvTime: BigNumberish;
48
48
  }
49
49
 
50
50
  export interface EIP712CancelOrdersParams extends Subaccount {
@@ -65,20 +65,20 @@ export interface EIP712LinkSignerParams extends Subaccount {
65
65
 
66
66
  export interface EIP712TransferQuoteParams extends Subaccount {
67
67
  recipientSubaccountName: string;
68
- amount: BigDecimalish;
68
+ amount: BigNumberish;
69
69
  nonce: string;
70
70
  }
71
71
 
72
72
  export interface EIP712LeaderboardAuthenticationParams extends Subaccount {
73
- expiration: BigDecimalish;
73
+ expiration: BigNumberish;
74
74
  }
75
75
 
76
76
  export interface EIP712MintNlpParams extends Subaccount {
77
- quoteAmount: BigDecimalish;
77
+ quoteAmount: BigNumberish;
78
78
  nonce: string;
79
79
  }
80
80
 
81
81
  export interface EIP712BurnNlpParams extends Subaccount {
82
- nlpAmount: BigDecimalish;
82
+ nlpAmount: BigNumberish;
83
83
  nonce: string;
84
84
  }
@@ -1,4 +1,9 @@
1
- import { encodeAbiParameters, parseAbiParameters } from 'viem';
1
+ import {
2
+ encodeAbiParameters,
3
+ encodePacked,
4
+ parseAbiParameters,
5
+ type Hex,
6
+ } from 'viem';
2
7
  import {
3
8
  EIP712WithdrawCollateralParams,
4
9
  SignedEIP712OrderParams,
@@ -6,6 +11,16 @@ import {
6
11
  } from '../eip712';
7
12
  import { addDecimals, toBigInt } from '../utils';
8
13
 
14
+ /**
15
+ * Transaction type identifiers for slow mode transactions.
16
+ */
17
+ export enum SlowModeTxType {
18
+ DepositCollateral = 1,
19
+ WithdrawCollateral = 2,
20
+ LinkSigner = 13,
21
+ ClaimBuilderFee = 31,
22
+ }
23
+
9
24
  export function encodeSignedWithdrawCollateralTx(
10
25
  signed: SignedTx<EIP712WithdrawCollateralParams>,
11
26
  ) {
@@ -48,3 +63,30 @@ export function encodeSignedOrder(signed: SignedEIP712OrderParams) {
48
63
  ],
49
64
  );
50
65
  }
66
+
67
+ export interface ClaimBuilderFeeParams {
68
+ /** The sender subaccount as bytes32 */
69
+ sender: Hex;
70
+ /** The builder ID to claim fees for */
71
+ builderId: number;
72
+ }
73
+
74
+ /**
75
+ * Encodes a ClaimBuilderFee slow mode transaction.
76
+ *
77
+ * Format: [tx_type_byte] + [abi_encoded_params]
78
+ *
79
+ * @param params - The claim builder fee parameters
80
+ * @returns The encoded transaction bytes ready to submit via endpoint.submitSlowModeTransaction
81
+ */
82
+ export function encodeClaimBuilderFeeTx(params: ClaimBuilderFeeParams): Hex {
83
+ const txBytes = encodeAbiParameters(
84
+ parseAbiParameters('bytes32 sender, uint32 builderId'),
85
+ [params.sender, params.builderId],
86
+ );
87
+
88
+ return encodePacked(
89
+ ['uint8', 'bytes'],
90
+ [SlowModeTxType.ClaimBuilderFee, txBytes],
91
+ );
92
+ }
@@ -1,10 +1,10 @@
1
1
  import { ERC20_ABI } from '../abis';
2
2
  import { WithContract } from '../types/nadoContractTypes';
3
3
  import { WriteableContractInstance } from '../types/viemTypes';
4
- import { BigDecimalish, toBigInt } from '../utils';
4
+ import { BigNumberish, toBigInt } from '../utils';
5
5
 
6
6
  export interface ApproveDepositAllowanceParams {
7
- amount: BigDecimalish;
7
+ amount: BigNumberish;
8
8
  tokenContract: WriteableContractInstance<typeof ERC20_ABI>;
9
9
  }
10
10
 
@@ -1,11 +1,11 @@
1
1
  import { toHex } from 'viem';
2
2
  import { WithContract } from '../types/nadoContractTypes';
3
- import { BigDecimalish, subaccountNameToBytes12, toBigInt } from '../utils';
3
+ import { BigNumberish, subaccountNameToBytes12, toBigInt } from '../utils';
4
4
 
5
5
  export interface DepositCollateralParams {
6
6
  subaccountName: string;
7
7
  productId: number;
8
- amount: BigDecimalish;
8
+ amount: BigNumberish;
9
9
  referralCode?: string;
10
10
  }
11
11
 
@@ -2,7 +2,7 @@ export const LOCAL_CHAIN_ENVS = ['local'] as const satisfies string[];
2
2
 
3
3
  export const TESTNET_CHAIN_ENVS = ['inkTestnet'] as const satisfies string[];
4
4
 
5
- export const MAINNET_CHAIN_ENVS = ['arbitrum'] as const satisfies string[];
5
+ export const MAINNET_CHAIN_ENVS = ['inkMainnet'] as const satisfies string[];
6
6
 
7
7
  export const ALL_CHAIN_ENVS = [
8
8
  ...LOCAL_CHAIN_ENVS,
@@ -1,10 +1,10 @@
1
- import { BigDecimal } from '../utils/math';
1
+ import BigNumber from 'bignumber.js';
2
2
  import { HealthType } from './healthTypes';
3
3
  import { PerpProduct, ProductEngineType, SpotProduct } from './productTypes';
4
4
 
5
5
  export type BalanceSide = 'long' | 'short';
6
6
 
7
- export type BalanceHealthContributions = Record<HealthType, BigDecimal>;
7
+ export type BalanceHealthContributions = Record<HealthType, BigNumber>;
8
8
 
9
9
  /**
10
10
  * Shared properties of a product balance
@@ -13,7 +13,7 @@ interface BaseBalance {
13
13
  type: ProductEngineType;
14
14
  productId: number;
15
15
  // Amount for the balance
16
- amount: BigDecimal;
16
+ amount: BigNumber;
17
17
  // Contributions to subaccount health
18
18
  healthContributions: BalanceHealthContributions;
19
19
  }
@@ -27,7 +27,7 @@ export interface PerpBalance extends BaseBalance {
27
27
  * As there is no "quote" product for the perp engine, this is a representation of the net quote balance
28
28
  * associated with the position. The entry cost and funding is rolled into this.
29
29
  */
30
- vQuoteBalance: BigDecimal;
30
+ vQuoteBalance: BigNumber;
31
31
  }
32
32
 
33
33
  export type PerpBalanceWithProduct = PerpBalance & PerpProduct;
@@ -1,11 +1,11 @@
1
- import { BigDecimal } from '../utils/math';
1
+ import BigNumber from 'bignumber.js';
2
2
 
3
3
  export type HealthType = 'maintenance' | 'initial' | 'unweighted';
4
4
 
5
5
  export interface HealthStatus {
6
- health: BigDecimal;
7
- assets: BigDecimal;
8
- liabilities: BigDecimal;
6
+ health: BigNumber;
7
+ assets: BigNumber;
8
+ liabilities: BigNumber;
9
9
  }
10
10
 
11
11
  export type HealthStatusByType = Record<HealthType, HealthStatus>;