@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,6 +1,6 @@
1
1
  import { Hex } from 'viem';
2
- import { BigDecimalish } from '../utils/math/bigDecimal.js';
3
- import { EIP712BurnNlpParams, EIP712CancelOrdersParams, EIP712CancelProductOrdersParams, EIP712LeaderboardAuthenticationParams, EIP712LinkSignerParams, EIP712LiquidateSubaccountParams, EIP712ListTriggerOrdersParams, EIP712MintNlpParams, EIP712OrderParams, EIP712TransferQuoteParams, EIP712WithdrawCollateralParams } from './signatureParamTypes.js';
2
+ import { BigNumberish } from '../utils/math/bigNumber.js';
3
+ import { EIP712BurnNlpParams, EIP712LeaderboardAuthenticationParams, EIP712LinkSignerParams, EIP712LiquidateSubaccountParams, EIP712ListTriggerOrdersParams, EIP712MintNlpParams, EIP712CancelOrdersParams, EIP712OrderParams, EIP712CancelProductOrdersParams, EIP712TransferQuoteParams, EIP712WithdrawCollateralParams } from './signatureParamTypes.js';
4
4
  import 'bignumber.js';
5
5
  import '../types/subaccountTypes.js';
6
6
  import '../types/bytes.js';
@@ -16,7 +16,7 @@ type EIP712LiquidateSubaccountValues = Omit<WithEIP712Sender<EIP712LiquidateSuba
16
16
  liquidatee: string;
17
17
  };
18
18
  type EIP712OrderValues = Omit<WithEIP712Sender<EIP712OrderParams>, 'price'> & {
19
- priceX18: BigDecimalish;
19
+ priceX18: BigNumberish;
20
20
  };
21
21
  type EIP712ListTriggerOrdersValues = WithEIP712Sender<EIP712ListTriggerOrdersParams>;
22
22
  type EIP712OrderCancellationValues = WithEIP712Sender<EIP712CancelOrdersParams>;
@@ -1 +1 @@
1
- {"version":3,"sources":["../../src/eip712/getNadoEIP712Domain.ts"],"sourcesContent":["import { getValidatedAddress } from '../utils/getValidatedAddress';\nimport { TypedDataDomain } from 'abitype';\n\n/**\n * Gives the EIP712 data domain for order signing\n *\n * @param contractAddress usually the address of the orderbook (for orders) or sequencer (for other operations)\n * @param chainId\n */\nexport function getNadoEIP712Domain(\n contractAddress: string,\n chainId: number,\n): TypedDataDomain {\n return {\n name: 'Nado',\n version: '0.0.1',\n chainId,\n verifyingContract: getValidatedAddress(contractAddress),\n };\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,iCAAoC;AAS7B,SAAS,oBACd,iBACA,SACiB;AACjB,SAAO;AAAA,IACL,MAAM;AAAA,IACN,SAAS;AAAA,IACT;AAAA,IACA,uBAAmB,gDAAoB,eAAe;AAAA,EACxD;AACF;","names":[]}
1
+ {"version":3,"sources":["../../src/eip712/getNadoEIP712Domain.ts"],"sourcesContent":["import { TypedDataDomain } from 'abitype';\nimport { getValidatedAddress } from '../utils/getValidatedAddress';\n\n/**\n * Gives the EIP712 data domain for order signing\n *\n * @param contractAddress usually the address of the orderbook (for orders) or sequencer (for other operations)\n * @param chainId\n */\nexport function getNadoEIP712Domain(\n contractAddress: string,\n chainId: number,\n): TypedDataDomain {\n return {\n name: 'Nado',\n version: '0.0.1',\n chainId,\n verifyingContract: getValidatedAddress(contractAddress),\n };\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AACA,iCAAoC;AAQ7B,SAAS,oBACd,iBACA,SACiB;AACjB,SAAO;AAAA,IACL,MAAM;AAAA,IACN,SAAS;AAAA,IACT;AAAA,IACA,uBAAmB,gDAAoB,eAAe;AAAA,EACxD;AACF;","names":[]}
@@ -1 +1 @@
1
- {"version":3,"sources":["../../src/eip712/getNadoEIP712Domain.ts"],"sourcesContent":["import { getValidatedAddress } from '../utils/getValidatedAddress';\nimport { TypedDataDomain } from 'abitype';\n\n/**\n * Gives the EIP712 data domain for order signing\n *\n * @param contractAddress usually the address of the orderbook (for orders) or sequencer (for other operations)\n * @param chainId\n */\nexport function getNadoEIP712Domain(\n contractAddress: string,\n chainId: number,\n): TypedDataDomain {\n return {\n name: 'Nado',\n version: '0.0.1',\n chainId,\n verifyingContract: getValidatedAddress(contractAddress),\n };\n}\n"],"mappings":";;;AAAA,SAAS,2BAA2B;AAS7B,SAAS,oBACd,iBACA,SACiB;AACjB,SAAO;AAAA,IACL,MAAM;AAAA,IACN,SAAS;AAAA,IACT;AAAA,IACA,mBAAmB,oBAAoB,eAAe;AAAA,EACxD;AACF;","names":[]}
1
+ {"version":3,"sources":["../../src/eip712/getNadoEIP712Domain.ts"],"sourcesContent":["import { TypedDataDomain } from 'abitype';\nimport { getValidatedAddress } from '../utils/getValidatedAddress';\n\n/**\n * Gives the EIP712 data domain for order signing\n *\n * @param contractAddress usually the address of the orderbook (for orders) or sequencer (for other operations)\n * @param chainId\n */\nexport function getNadoEIP712Domain(\n contractAddress: string,\n chainId: number,\n): TypedDataDomain {\n return {\n name: 'Nado',\n version: '0.0.1',\n chainId,\n verifyingContract: getValidatedAddress(contractAddress),\n };\n}\n"],"mappings":";;;AACA,SAAS,2BAA2B;AAQ7B,SAAS,oBACd,iBACA,SACiB;AACjB,SAAO;AAAA,IACL,MAAM;AAAA,IACN,SAAS;AAAA,IACT;AAAA,IACA,mBAAmB,oBAAoB,eAAe;AAAA,EACxD;AACF;","names":[]}
@@ -3,7 +3,7 @@ import './signatureParamTypes.cjs';
3
3
  import 'viem';
4
4
  import '../types/subaccountTypes.cjs';
5
5
  import '../types/bytes.cjs';
6
- import '../utils/math/bigDecimal.cjs';
6
+ import '../utils/math/bigNumber.cjs';
7
7
  import 'bignumber.js';
8
8
 
9
9
  /**
@@ -3,7 +3,7 @@ import './signatureParamTypes.js';
3
3
  import 'viem';
4
4
  import '../types/subaccountTypes.js';
5
5
  import '../types/bytes.js';
6
- import '../utils/math/bigDecimal.js';
6
+ import '../utils/math/bigNumber.js';
7
7
  import 'bignumber.js';
8
8
 
9
9
  /**
@@ -3,7 +3,7 @@ import './signatureParamTypes.cjs';
3
3
  import 'viem';
4
4
  import '../types/subaccountTypes.cjs';
5
5
  import '../types/bytes.cjs';
6
- import '../utils/math/bigDecimal.cjs';
6
+ import '../utils/math/bigNumber.cjs';
7
7
  import 'bignumber.js';
8
8
 
9
9
  interface TypedDataField {
@@ -3,7 +3,7 @@ import './signatureParamTypes.js';
3
3
  import 'viem';
4
4
  import '../types/subaccountTypes.js';
5
5
  import '../types/bytes.js';
6
- import '../utils/math/bigDecimal.js';
6
+ import '../utils/math/bigNumber.js';
7
7
  import 'bignumber.js';
8
8
 
9
9
  interface TypedDataField {
@@ -1,7 +1,7 @@
1
1
  import { SignableRequestTypeToEIP712Values } from './eip712ValueTypes.cjs';
2
2
  import { SignableRequestType, SignableRequestTypeToParams } from './signableRequestType.cjs';
3
3
  import 'viem';
4
- import '../utils/math/bigDecimal.cjs';
4
+ import '../utils/math/bigNumber.cjs';
5
5
  import 'bignumber.js';
6
6
  import './signatureParamTypes.cjs';
7
7
  import '../types/subaccountTypes.cjs';
@@ -1,7 +1,7 @@
1
1
  import { SignableRequestTypeToEIP712Values } from './eip712ValueTypes.js';
2
2
  import { SignableRequestType, SignableRequestTypeToParams } from './signableRequestType.js';
3
3
  import 'viem';
4
- import '../utils/math/bigDecimal.js';
4
+ import '../utils/math/bigNumber.js';
5
5
  import 'bignumber.js';
6
6
  import './signatureParamTypes.js';
7
7
  import '../types/subaccountTypes.js';
@@ -4,7 +4,7 @@ import 'viem';
4
4
  import './signatureParamTypes.cjs';
5
5
  import '../types/subaccountTypes.cjs';
6
6
  import '../types/bytes.cjs';
7
- import '../utils/math/bigDecimal.cjs';
7
+ import '../utils/math/bigNumber.cjs';
8
8
  import 'bignumber.js';
9
9
 
10
10
  interface Params<TReqType extends SignableRequestType> {
@@ -4,7 +4,7 @@ import 'viem';
4
4
  import './signatureParamTypes.js';
5
5
  import '../types/subaccountTypes.js';
6
6
  import '../types/bytes.js';
7
- import '../utils/math/bigDecimal.js';
7
+ import '../utils/math/bigNumber.js';
8
8
  import 'bignumber.js';
9
9
 
10
10
  interface Params<TReqType extends SignableRequestType> {
@@ -17,27 +17,27 @@ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: tru
17
17
  // src/eip712/index.ts
18
18
  var eip712_exports = {};
19
19
  module.exports = __toCommonJS(eip712_exports);
20
- __reExport(eip712_exports, require("./getSignedTransactionRequest.cjs"), module.exports);
21
- __reExport(eip712_exports, require("./getNadoEIP712Values.cjs"), module.exports);
22
- __reExport(eip712_exports, require("./getNadoEIP712Types.cjs"), module.exports);
23
- __reExport(eip712_exports, require("./getNadoEIP712PrimaryType.cjs"), module.exports);
20
+ __reExport(eip712_exports, require("./eip712ValueTypes.cjs"), module.exports);
24
21
  __reExport(eip712_exports, require("./getNadoEIP712Domain.cjs"), module.exports);
22
+ __reExport(eip712_exports, require("./getNadoEIP712PrimaryType.cjs"), module.exports);
23
+ __reExport(eip712_exports, require("./getNadoEIP712Types.cjs"), module.exports);
24
+ __reExport(eip712_exports, require("./getNadoEIP712Values.cjs"), module.exports);
25
+ __reExport(eip712_exports, require("./getOrderVerifyingAddress.cjs"), module.exports);
26
+ __reExport(eip712_exports, require("./getSignedTransactionRequest.cjs"), module.exports);
25
27
  __reExport(eip712_exports, require("./orderDigest.cjs"), module.exports);
26
28
  __reExport(eip712_exports, require("./signableRequestType.cjs"), module.exports);
27
29
  __reExport(eip712_exports, require("./signatureParamTypes.cjs"), module.exports);
28
- __reExport(eip712_exports, require("./eip712ValueTypes.cjs"), module.exports);
29
- __reExport(eip712_exports, require("./getOrderVerifyingAddress.cjs"), module.exports);
30
30
  // Annotate the CommonJS export names for ESM import in node:
31
31
  0 && (module.exports = {
32
- ...require("./getSignedTransactionRequest.cjs"),
33
- ...require("./getNadoEIP712Values.cjs"),
34
- ...require("./getNadoEIP712Types.cjs"),
35
- ...require("./getNadoEIP712PrimaryType.cjs"),
32
+ ...require("./eip712ValueTypes.cjs"),
36
33
  ...require("./getNadoEIP712Domain.cjs"),
34
+ ...require("./getNadoEIP712PrimaryType.cjs"),
35
+ ...require("./getNadoEIP712Types.cjs"),
36
+ ...require("./getNadoEIP712Values.cjs"),
37
+ ...require("./getOrderVerifyingAddress.cjs"),
38
+ ...require("./getSignedTransactionRequest.cjs"),
37
39
  ...require("./orderDigest.cjs"),
38
40
  ...require("./signableRequestType.cjs"),
39
- ...require("./signatureParamTypes.cjs"),
40
- ...require("./eip712ValueTypes.cjs"),
41
- ...require("./getOrderVerifyingAddress.cjs")
41
+ ...require("./signatureParamTypes.cjs")
42
42
  });
43
43
  //# sourceMappingURL=index.cjs.map
@@ -1 +1 @@
1
- {"version":3,"sources":["../../src/eip712/index.ts"],"sourcesContent":["export * from './getSignedTransactionRequest';\nexport * from './getNadoEIP712Values';\nexport * from './getNadoEIP712Types';\nexport * from './getNadoEIP712PrimaryType';\nexport * from './getNadoEIP712Domain';\nexport * from './orderDigest';\nexport * from './signableRequestType';\nexport * from './signatureParamTypes';\nexport * from './eip712ValueTypes';\nexport * from './getOrderVerifyingAddress';\n"],"mappings":";;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA,2BAAc,8CAAd;AACA,2BAAc,sCADd;AAEA,2BAAc,qCAFd;AAGA,2BAAc,2CAHd;AAIA,2BAAc,sCAJd;AAKA,2BAAc,8BALd;AAMA,2BAAc,sCANd;AAOA,2BAAc,sCAPd;AAQA,2BAAc,mCARd;AASA,2BAAc,2CATd;","names":[]}
1
+ {"version":3,"sources":["../../src/eip712/index.ts"],"sourcesContent":["export * from './eip712ValueTypes';\nexport * from './getNadoEIP712Domain';\nexport * from './getNadoEIP712PrimaryType';\nexport * from './getNadoEIP712Types';\nexport * from './getNadoEIP712Values';\nexport * from './getOrderVerifyingAddress';\nexport * from './getSignedTransactionRequest';\nexport * from './orderDigest';\nexport * from './signableRequestType';\nexport * from './signatureParamTypes';\n"],"mappings":";;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA,2BAAc,mCAAd;AACA,2BAAc,sCADd;AAEA,2BAAc,2CAFd;AAGA,2BAAc,qCAHd;AAIA,2BAAc,sCAJd;AAKA,2BAAc,2CALd;AAMA,2BAAc,8CANd;AAOA,2BAAc,8BAPd;AAQA,2BAAc,sCARd;AASA,2BAAc,sCATd;","names":[]}
@@ -1,17 +1,17 @@
1
- export { getSignedTransactionRequest } from './getSignedTransactionRequest.cjs';
2
- export { getNadoEIP712Values } from './getNadoEIP712Values.cjs';
3
- export { getNadoEIP712Types } from './getNadoEIP712Types.cjs';
4
- export { getNadoEIP712PrimaryType } from './getNadoEIP712PrimaryType.cjs';
1
+ export { EIP712BurnNlpValues, EIP712LeaderboardAuthenticationValues, EIP712LinkSignerValues, EIP712LiquidateSubaccountValues, EIP712ListTriggerOrdersValues, EIP712MintNlpValues, EIP712OrderCancellationValues, EIP712OrderValues, EIP712ProductOrdersCancellationValues, EIP712TransferQuoteValues, EIP712WithdrawCollateralValues, SignableRequestTypeToEIP712Values } from './eip712ValueTypes.cjs';
5
2
  export { getNadoEIP712Domain } from './getNadoEIP712Domain.cjs';
3
+ export { getNadoEIP712PrimaryType } from './getNadoEIP712PrimaryType.cjs';
4
+ export { getNadoEIP712Types } from './getNadoEIP712Types.cjs';
5
+ export { getNadoEIP712Values } from './getNadoEIP712Values.cjs';
6
+ export { getOrderVerifyingAddress } from './getOrderVerifyingAddress.cjs';
7
+ export { getSignedTransactionRequest } from './getSignedTransactionRequest.cjs';
6
8
  export { getOrderDigest } from './orderDigest.cjs';
7
9
  export { SignableRequestType, SignableRequestTypeToParams } from './signableRequestType.cjs';
8
10
  export { EIP712BurnNlpParams, EIP712CancelOrdersParams, EIP712CancelProductOrdersParams, EIP712LeaderboardAuthenticationParams, EIP712LinkSignerParams, EIP712LiquidateSubaccountParams, EIP712ListTriggerOrdersParams, EIP712MintNlpParams, EIP712OrderParams, EIP712TransferQuoteParams, EIP712WithdrawCollateralParams, SignedEIP712OrderParams, SignedTx } from './signatureParamTypes.cjs';
9
- export { EIP712BurnNlpValues, EIP712LeaderboardAuthenticationValues, EIP712LinkSignerValues, EIP712LiquidateSubaccountValues, EIP712ListTriggerOrdersValues, EIP712MintNlpValues, EIP712OrderCancellationValues, EIP712OrderValues, EIP712ProductOrdersCancellationValues, EIP712TransferQuoteValues, EIP712WithdrawCollateralValues, SignableRequestTypeToEIP712Values } from './eip712ValueTypes.cjs';
10
- export { getOrderVerifyingAddress } from './getOrderVerifyingAddress.cjs';
11
- import '../types/viemTypes.cjs';
12
11
  import 'viem';
12
+ import '../utils/math/bigNumber.cjs';
13
+ import 'bignumber.js';
13
14
  import 'abitype';
15
+ import '../types/viemTypes.cjs';
14
16
  import '../types/subaccountTypes.cjs';
15
17
  import '../types/bytes.cjs';
16
- import '../utils/math/bigDecimal.cjs';
17
- import 'bignumber.js';
@@ -1,17 +1,17 @@
1
- export { getSignedTransactionRequest } from './getSignedTransactionRequest.js';
2
- export { getNadoEIP712Values } from './getNadoEIP712Values.js';
3
- export { getNadoEIP712Types } from './getNadoEIP712Types.js';
4
- export { getNadoEIP712PrimaryType } from './getNadoEIP712PrimaryType.js';
1
+ export { EIP712BurnNlpValues, EIP712LeaderboardAuthenticationValues, EIP712LinkSignerValues, EIP712LiquidateSubaccountValues, EIP712ListTriggerOrdersValues, EIP712MintNlpValues, EIP712OrderCancellationValues, EIP712OrderValues, EIP712ProductOrdersCancellationValues, EIP712TransferQuoteValues, EIP712WithdrawCollateralValues, SignableRequestTypeToEIP712Values } from './eip712ValueTypes.js';
5
2
  export { getNadoEIP712Domain } from './getNadoEIP712Domain.js';
3
+ export { getNadoEIP712PrimaryType } from './getNadoEIP712PrimaryType.js';
4
+ export { getNadoEIP712Types } from './getNadoEIP712Types.js';
5
+ export { getNadoEIP712Values } from './getNadoEIP712Values.js';
6
+ export { getOrderVerifyingAddress } from './getOrderVerifyingAddress.js';
7
+ export { getSignedTransactionRequest } from './getSignedTransactionRequest.js';
6
8
  export { getOrderDigest } from './orderDigest.js';
7
9
  export { SignableRequestType, SignableRequestTypeToParams } from './signableRequestType.js';
8
10
  export { EIP712BurnNlpParams, EIP712CancelOrdersParams, EIP712CancelProductOrdersParams, EIP712LeaderboardAuthenticationParams, EIP712LinkSignerParams, EIP712LiquidateSubaccountParams, EIP712ListTriggerOrdersParams, EIP712MintNlpParams, EIP712OrderParams, EIP712TransferQuoteParams, EIP712WithdrawCollateralParams, SignedEIP712OrderParams, SignedTx } from './signatureParamTypes.js';
9
- export { EIP712BurnNlpValues, EIP712LeaderboardAuthenticationValues, EIP712LinkSignerValues, EIP712LiquidateSubaccountValues, EIP712ListTriggerOrdersValues, EIP712MintNlpValues, EIP712OrderCancellationValues, EIP712OrderValues, EIP712ProductOrdersCancellationValues, EIP712TransferQuoteValues, EIP712WithdrawCollateralValues, SignableRequestTypeToEIP712Values } from './eip712ValueTypes.js';
10
- export { getOrderVerifyingAddress } from './getOrderVerifyingAddress.js';
11
- import '../types/viemTypes.js';
12
11
  import 'viem';
12
+ import '../utils/math/bigNumber.js';
13
+ import 'bignumber.js';
13
14
  import 'abitype';
15
+ import '../types/viemTypes.js';
14
16
  import '../types/subaccountTypes.js';
15
17
  import '../types/bytes.js';
16
- import '../utils/math/bigDecimal.js';
17
- import 'bignumber.js';
@@ -1,12 +1,12 @@
1
1
  // src/eip712/index.ts
2
- export * from "./getSignedTransactionRequest.js";
3
- export * from "./getNadoEIP712Values.js";
4
- export * from "./getNadoEIP712Types.js";
5
- export * from "./getNadoEIP712PrimaryType.js";
2
+ export * from "./eip712ValueTypes.js";
6
3
  export * from "./getNadoEIP712Domain.js";
4
+ export * from "./getNadoEIP712PrimaryType.js";
5
+ export * from "./getNadoEIP712Types.js";
6
+ export * from "./getNadoEIP712Values.js";
7
+ export * from "./getOrderVerifyingAddress.js";
8
+ export * from "./getSignedTransactionRequest.js";
7
9
  export * from "./orderDigest.js";
8
10
  export * from "./signableRequestType.js";
9
11
  export * from "./signatureParamTypes.js";
10
- export * from "./eip712ValueTypes.js";
11
- export * from "./getOrderVerifyingAddress.js";
12
12
  //# sourceMappingURL=index.js.map
@@ -1 +1 @@
1
- {"version":3,"sources":["../../src/eip712/index.ts"],"sourcesContent":["export * from './getSignedTransactionRequest';\nexport * from './getNadoEIP712Values';\nexport * from './getNadoEIP712Types';\nexport * from './getNadoEIP712PrimaryType';\nexport * from './getNadoEIP712Domain';\nexport * from './orderDigest';\nexport * from './signableRequestType';\nexport * from './signatureParamTypes';\nexport * from './eip712ValueTypes';\nexport * from './getOrderVerifyingAddress';\n"],"mappings":";AAAA,cAAc;AACd,cAAc;AACd,cAAc;AACd,cAAc;AACd,cAAc;AACd,cAAc;AACd,cAAc;AACd,cAAc;AACd,cAAc;AACd,cAAc;","names":[]}
1
+ {"version":3,"sources":["../../src/eip712/index.ts"],"sourcesContent":["export * from './eip712ValueTypes';\nexport * from './getNadoEIP712Domain';\nexport * from './getNadoEIP712PrimaryType';\nexport * from './getNadoEIP712Types';\nexport * from './getNadoEIP712Values';\nexport * from './getOrderVerifyingAddress';\nexport * from './getSignedTransactionRequest';\nexport * from './orderDigest';\nexport * from './signableRequestType';\nexport * from './signatureParamTypes';\n"],"mappings":";AAAA,cAAc;AACd,cAAc;AACd,cAAc;AACd,cAAc;AACd,cAAc;AACd,cAAc;AACd,cAAc;AACd,cAAc;AACd,cAAc;AACd,cAAc;","names":[]}
@@ -2,7 +2,7 @@ import { EIP712OrderParams } from './signatureParamTypes.cjs';
2
2
  import 'viem';
3
3
  import '../types/subaccountTypes.cjs';
4
4
  import '../types/bytes.cjs';
5
- import '../utils/math/bigDecimal.cjs';
5
+ import '../utils/math/bigNumber.cjs';
6
6
  import 'bignumber.js';
7
7
 
8
8
  interface OrderDigestParams {
@@ -2,7 +2,7 @@ import { EIP712OrderParams } from './signatureParamTypes.js';
2
2
  import 'viem';
3
3
  import '../types/subaccountTypes.js';
4
4
  import '../types/bytes.js';
5
- import '../utils/math/bigDecimal.js';
5
+ import '../utils/math/bigNumber.js';
6
6
  import 'bignumber.js';
7
7
 
8
8
  interface OrderDigestParams {
@@ -2,7 +2,7 @@ import { EIP712BurnNlpParams, EIP712CancelOrdersParams, EIP712CancelProductOrder
2
2
  import 'viem';
3
3
  import '../types/subaccountTypes.cjs';
4
4
  import '../types/bytes.cjs';
5
- import '../utils/math/bigDecimal.cjs';
5
+ import '../utils/math/bigNumber.cjs';
6
6
  import 'bignumber.js';
7
7
 
8
8
  /**
@@ -2,7 +2,7 @@ import { EIP712BurnNlpParams, EIP712CancelOrdersParams, EIP712CancelProductOrder
2
2
  import 'viem';
3
3
  import '../types/subaccountTypes.js';
4
4
  import '../types/bytes.js';
5
- import '../utils/math/bigDecimal.js';
5
+ import '../utils/math/bigNumber.js';
6
6
  import 'bignumber.js';
7
7
 
8
8
  /**
@@ -1 +1 @@
1
- {"version":3,"sources":["../../src/eip712/signatureParamTypes.ts"],"sourcesContent":["import { Address } from 'viem';\nimport { Subaccount } from '../types/subaccountTypes';\nimport { BigDecimalish } from '../utils';\n\nexport interface SignedTx<TBaseTx> {\n tx: TBaseTx;\n signature: string;\n}\n\nexport interface SignedEIP712OrderParams {\n order: EIP712OrderParams;\n signature: string;\n}\n\nexport interface EIP712WithdrawCollateralParams extends Subaccount {\n productId: number;\n amount: BigDecimalish;\n nonce: string;\n}\n\nexport interface EIP712LiquidateSubaccountParams extends Subaccount {\n // Subaccount being liquidated\n liquidateeOwner: string;\n liquidateeName: string;\n // 0 = spread, 1 = long, 2 = short\n mode: number;\n // Spot & perp pair\n healthGroup: BigDecimalish;\n amount: BigDecimalish;\n nonce: string;\n}\n\nexport interface EIP712OrderParams extends Subaccount {\n // Expiration time in seconds, with order type encoded if relevant\n expiration: BigDecimalish;\n // Limit price\n price: BigDecimalish;\n // Positive for buy, negative for sell\n amount: BigDecimalish;\n // A unique nonce to identify the order\n nonce: string;\n // Packed order appendix (uint128) to encode order details such as order execution behavior, isolated, etc.\n appendix: BigDecimalish;\n}\n\nexport interface EIP712ListTriggerOrdersParams extends Subaccount {\n recvTime: BigDecimalish;\n}\n\nexport interface EIP712CancelOrdersParams extends Subaccount {\n productIds: number[];\n digests: string[];\n nonce: string;\n}\n\nexport interface EIP712CancelProductOrdersParams extends Subaccount {\n productIds: number[];\n nonce: string;\n}\n\nexport interface EIP712LinkSignerParams extends Subaccount {\n signer: Address;\n nonce: string;\n}\n\nexport interface EIP712TransferQuoteParams extends Subaccount {\n recipientSubaccountName: string;\n amount: BigDecimalish;\n nonce: string;\n}\n\nexport interface EIP712LeaderboardAuthenticationParams extends Subaccount {\n expiration: BigDecimalish;\n}\n\nexport interface EIP712MintNlpParams extends Subaccount {\n quoteAmount: BigDecimalish;\n nonce: string;\n}\n\nexport interface EIP712BurnNlpParams extends Subaccount {\n nlpAmount: BigDecimalish;\n nonce: string;\n}\n"],"mappings":";;;;;;;;;;;;;;;;AAAA;AAAA;","names":[]}
1
+ {"version":3,"sources":["../../src/eip712/signatureParamTypes.ts"],"sourcesContent":["import { Address } from 'viem';\nimport { Subaccount } from '../types/subaccountTypes';\nimport { BigNumberish } from '../utils';\n\nexport interface SignedTx<TBaseTx> {\n tx: TBaseTx;\n signature: string;\n}\n\nexport interface SignedEIP712OrderParams {\n order: EIP712OrderParams;\n signature: string;\n}\n\nexport interface EIP712WithdrawCollateralParams extends Subaccount {\n productId: number;\n amount: BigNumberish;\n nonce: string;\n}\n\nexport interface EIP712LiquidateSubaccountParams extends Subaccount {\n // Subaccount being liquidated\n liquidateeOwner: string;\n liquidateeName: string;\n // 0 = spread, 1 = long, 2 = short\n mode: number;\n // Spot & perp pair\n healthGroup: BigNumberish;\n amount: BigNumberish;\n nonce: string;\n}\n\nexport interface EIP712OrderParams extends Subaccount {\n // Expiration time in seconds, with order type encoded if relevant\n expiration: BigNumberish;\n // Limit price\n price: BigNumberish;\n // Positive for buy, negative for sell\n amount: BigNumberish;\n // A unique nonce to identify the order\n nonce: string;\n // Packed order appendix (uint128) to encode order details such as order execution behavior, isolated, etc.\n appendix: BigNumberish;\n}\n\nexport interface EIP712ListTriggerOrdersParams extends Subaccount {\n recvTime: BigNumberish;\n}\n\nexport interface EIP712CancelOrdersParams extends Subaccount {\n productIds: number[];\n digests: string[];\n nonce: string;\n}\n\nexport interface EIP712CancelProductOrdersParams extends Subaccount {\n productIds: number[];\n nonce: string;\n}\n\nexport interface EIP712LinkSignerParams extends Subaccount {\n signer: Address;\n nonce: string;\n}\n\nexport interface EIP712TransferQuoteParams extends Subaccount {\n recipientSubaccountName: string;\n amount: BigNumberish;\n nonce: string;\n}\n\nexport interface EIP712LeaderboardAuthenticationParams extends Subaccount {\n expiration: BigNumberish;\n}\n\nexport interface EIP712MintNlpParams extends Subaccount {\n quoteAmount: BigNumberish;\n nonce: string;\n}\n\nexport interface EIP712BurnNlpParams extends Subaccount {\n nlpAmount: BigNumberish;\n nonce: string;\n}\n"],"mappings":";;;;;;;;;;;;;;;;AAAA;AAAA;","names":[]}
@@ -1,6 +1,6 @@
1
1
  import { Address } from 'viem';
2
2
  import { Subaccount } from '../types/subaccountTypes.cjs';
3
- import { BigDecimalish } from '../utils/math/bigDecimal.cjs';
3
+ import { BigNumberish } from '../utils/math/bigNumber.cjs';
4
4
  import '../types/bytes.cjs';
5
5
  import 'bignumber.js';
6
6
 
@@ -14,26 +14,26 @@ interface SignedEIP712OrderParams {
14
14
  }
15
15
  interface EIP712WithdrawCollateralParams extends Subaccount {
16
16
  productId: number;
17
- amount: BigDecimalish;
17
+ amount: BigNumberish;
18
18
  nonce: string;
19
19
  }
20
20
  interface EIP712LiquidateSubaccountParams extends Subaccount {
21
21
  liquidateeOwner: string;
22
22
  liquidateeName: string;
23
23
  mode: number;
24
- healthGroup: BigDecimalish;
25
- amount: BigDecimalish;
24
+ healthGroup: BigNumberish;
25
+ amount: BigNumberish;
26
26
  nonce: string;
27
27
  }
28
28
  interface EIP712OrderParams extends Subaccount {
29
- expiration: BigDecimalish;
30
- price: BigDecimalish;
31
- amount: BigDecimalish;
29
+ expiration: BigNumberish;
30
+ price: BigNumberish;
31
+ amount: BigNumberish;
32
32
  nonce: string;
33
- appendix: BigDecimalish;
33
+ appendix: BigNumberish;
34
34
  }
35
35
  interface EIP712ListTriggerOrdersParams extends Subaccount {
36
- recvTime: BigDecimalish;
36
+ recvTime: BigNumberish;
37
37
  }
38
38
  interface EIP712CancelOrdersParams extends Subaccount {
39
39
  productIds: number[];
@@ -50,18 +50,18 @@ interface EIP712LinkSignerParams extends Subaccount {
50
50
  }
51
51
  interface EIP712TransferQuoteParams extends Subaccount {
52
52
  recipientSubaccountName: string;
53
- amount: BigDecimalish;
53
+ amount: BigNumberish;
54
54
  nonce: string;
55
55
  }
56
56
  interface EIP712LeaderboardAuthenticationParams extends Subaccount {
57
- expiration: BigDecimalish;
57
+ expiration: BigNumberish;
58
58
  }
59
59
  interface EIP712MintNlpParams extends Subaccount {
60
- quoteAmount: BigDecimalish;
60
+ quoteAmount: BigNumberish;
61
61
  nonce: string;
62
62
  }
63
63
  interface EIP712BurnNlpParams extends Subaccount {
64
- nlpAmount: BigDecimalish;
64
+ nlpAmount: BigNumberish;
65
65
  nonce: string;
66
66
  }
67
67
 
@@ -1,6 +1,6 @@
1
1
  import { Address } from 'viem';
2
2
  import { Subaccount } from '../types/subaccountTypes.js';
3
- import { BigDecimalish } from '../utils/math/bigDecimal.js';
3
+ import { BigNumberish } from '../utils/math/bigNumber.js';
4
4
  import '../types/bytes.js';
5
5
  import 'bignumber.js';
6
6
 
@@ -14,26 +14,26 @@ interface SignedEIP712OrderParams {
14
14
  }
15
15
  interface EIP712WithdrawCollateralParams extends Subaccount {
16
16
  productId: number;
17
- amount: BigDecimalish;
17
+ amount: BigNumberish;
18
18
  nonce: string;
19
19
  }
20
20
  interface EIP712LiquidateSubaccountParams extends Subaccount {
21
21
  liquidateeOwner: string;
22
22
  liquidateeName: string;
23
23
  mode: number;
24
- healthGroup: BigDecimalish;
25
- amount: BigDecimalish;
24
+ healthGroup: BigNumberish;
25
+ amount: BigNumberish;
26
26
  nonce: string;
27
27
  }
28
28
  interface EIP712OrderParams extends Subaccount {
29
- expiration: BigDecimalish;
30
- price: BigDecimalish;
31
- amount: BigDecimalish;
29
+ expiration: BigNumberish;
30
+ price: BigNumberish;
31
+ amount: BigNumberish;
32
32
  nonce: string;
33
- appendix: BigDecimalish;
33
+ appendix: BigNumberish;
34
34
  }
35
35
  interface EIP712ListTriggerOrdersParams extends Subaccount {
36
- recvTime: BigDecimalish;
36
+ recvTime: BigNumberish;
37
37
  }
38
38
  interface EIP712CancelOrdersParams extends Subaccount {
39
39
  productIds: number[];
@@ -50,18 +50,18 @@ interface EIP712LinkSignerParams extends Subaccount {
50
50
  }
51
51
  interface EIP712TransferQuoteParams extends Subaccount {
52
52
  recipientSubaccountName: string;
53
- amount: BigDecimalish;
53
+ amount: BigNumberish;
54
54
  nonce: string;
55
55
  }
56
56
  interface EIP712LeaderboardAuthenticationParams extends Subaccount {
57
- expiration: BigDecimalish;
57
+ expiration: BigNumberish;
58
58
  }
59
59
  interface EIP712MintNlpParams extends Subaccount {
60
- quoteAmount: BigDecimalish;
60
+ quoteAmount: BigNumberish;
61
61
  nonce: string;
62
62
  }
63
63
  interface EIP712BurnNlpParams extends Subaccount {
64
- nlpAmount: BigDecimalish;
64
+ nlpAmount: BigNumberish;
65
65
  nonce: string;
66
66
  }
67
67
 
@@ -20,12 +20,21 @@ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: tru
20
20
  // src/encoding/encoding.ts
21
21
  var encoding_exports = {};
22
22
  __export(encoding_exports, {
23
+ SlowModeTxType: () => SlowModeTxType,
24
+ encodeClaimBuilderFeeTx: () => encodeClaimBuilderFeeTx,
23
25
  encodeSignedOrder: () => encodeSignedOrder,
24
26
  encodeSignedWithdrawCollateralTx: () => encodeSignedWithdrawCollateralTx
25
27
  });
26
28
  module.exports = __toCommonJS(encoding_exports);
27
29
  var import_viem = require("viem");
28
30
  var import_utils = require("../utils/index.cjs");
31
+ var SlowModeTxType = /* @__PURE__ */ ((SlowModeTxType2) => {
32
+ SlowModeTxType2[SlowModeTxType2["DepositCollateral"] = 1] = "DepositCollateral";
33
+ SlowModeTxType2[SlowModeTxType2["WithdrawCollateral"] = 2] = "WithdrawCollateral";
34
+ SlowModeTxType2[SlowModeTxType2["LinkSigner"] = 13] = "LinkSigner";
35
+ SlowModeTxType2[SlowModeTxType2["ClaimBuilderFee"] = 31] = "ClaimBuilderFee";
36
+ return SlowModeTxType2;
37
+ })(SlowModeTxType || {});
29
38
  function encodeSignedWithdrawCollateralTx(signed) {
30
39
  return (0, import_viem.encodeAbiParameters)(
31
40
  (0, import_viem.parseAbiParameters)(
@@ -65,8 +74,20 @@ function encodeSignedOrder(signed) {
65
74
  ]
66
75
  );
67
76
  }
77
+ function encodeClaimBuilderFeeTx(params) {
78
+ const txBytes = (0, import_viem.encodeAbiParameters)(
79
+ (0, import_viem.parseAbiParameters)("bytes32 sender, uint32 builderId"),
80
+ [params.sender, params.builderId]
81
+ );
82
+ return (0, import_viem.encodePacked)(
83
+ ["uint8", "bytes"],
84
+ [31 /* ClaimBuilderFee */, txBytes]
85
+ );
86
+ }
68
87
  // Annotate the CommonJS export names for ESM import in node:
69
88
  0 && (module.exports = {
89
+ SlowModeTxType,
90
+ encodeClaimBuilderFeeTx,
70
91
  encodeSignedOrder,
71
92
  encodeSignedWithdrawCollateralTx
72
93
  });
@@ -1 +1 @@
1
- {"version":3,"sources":["../../src/encoding/encoding.ts"],"sourcesContent":["import { encodeAbiParameters, parseAbiParameters } from 'viem';\nimport {\n EIP712WithdrawCollateralParams,\n SignedEIP712OrderParams,\n SignedTx,\n} from '../eip712';\nimport { addDecimals, toBigInt } from '../utils';\n\nexport function encodeSignedWithdrawCollateralTx(\n signed: SignedTx<EIP712WithdrawCollateralParams>,\n) {\n return encodeAbiParameters(\n parseAbiParameters(\n '(tuple(address sender, string subaccountName, uint32 productId, uint128 amount, uint64 nonce), bytes signature)',\n ),\n [\n [\n [\n signed.tx.subaccountOwner,\n signed.tx.subaccountName,\n signed.tx.productId,\n signed.tx.amount,\n signed.tx.nonce,\n ],\n signed.signature,\n ],\n ],\n );\n}\n\nexport function encodeSignedOrder(signed: SignedEIP712OrderParams) {\n return encodeAbiParameters(\n parseAbiParameters(\n '(tuple(tuple(address sender, string subaccountName, int128 priceX18, int128 amount, uint64 expiration, uint64 nonce), bytes signature))',\n ),\n [\n [\n [\n signed.order.subaccountOwner,\n signed.order.subaccountName,\n toBigInt(addDecimals(signed.order.price)),\n signed.order.amount,\n signed.order.expiration,\n signed.order.nonce,\n ],\n signed.signature,\n ],\n ],\n );\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,kBAAwD;AAMxD,mBAAsC;AAE/B,SAAS,iCACd,QACA;AACA,aAAO;AAAA,QACL;AAAA,MACE;AAAA,IACF;AAAA,IACA;AAAA,MACE;AAAA,QACE;AAAA,UACE,OAAO,GAAG;AAAA,UACV,OAAO,GAAG;AAAA,UACV,OAAO,GAAG;AAAA,UACV,OAAO,GAAG;AAAA,UACV,OAAO,GAAG;AAAA,QACZ;AAAA,QACA,OAAO;AAAA,MACT;AAAA,IACF;AAAA,EACF;AACF;AAEO,SAAS,kBAAkB,QAAiC;AACjE,aAAO;AAAA,QACL;AAAA,MACE;AAAA,IACF;AAAA,IACA;AAAA,MACE;AAAA,QACE;AAAA,UACE,OAAO,MAAM;AAAA,UACb,OAAO,MAAM;AAAA,cACb,2BAAS,0BAAY,OAAO,MAAM,KAAK,CAAC;AAAA,UACxC,OAAO,MAAM;AAAA,UACb,OAAO,MAAM;AAAA,UACb,OAAO,MAAM;AAAA,QACf;AAAA,QACA,OAAO;AAAA,MACT;AAAA,IACF;AAAA,EACF;AACF;","names":[]}
1
+ {"version":3,"sources":["../../src/encoding/encoding.ts"],"sourcesContent":["import {\n encodeAbiParameters,\n encodePacked,\n parseAbiParameters,\n type Hex,\n} from 'viem';\nimport {\n EIP712WithdrawCollateralParams,\n SignedEIP712OrderParams,\n SignedTx,\n} from '../eip712';\nimport { addDecimals, toBigInt } from '../utils';\n\n/**\n * Transaction type identifiers for slow mode transactions.\n */\nexport enum SlowModeTxType {\n DepositCollateral = 1,\n WithdrawCollateral = 2,\n LinkSigner = 13,\n ClaimBuilderFee = 31,\n}\n\nexport function encodeSignedWithdrawCollateralTx(\n signed: SignedTx<EIP712WithdrawCollateralParams>,\n) {\n return encodeAbiParameters(\n parseAbiParameters(\n '(tuple(address sender, string subaccountName, uint32 productId, uint128 amount, uint64 nonce), bytes signature)',\n ),\n [\n [\n [\n signed.tx.subaccountOwner,\n signed.tx.subaccountName,\n signed.tx.productId,\n signed.tx.amount,\n signed.tx.nonce,\n ],\n signed.signature,\n ],\n ],\n );\n}\n\nexport function encodeSignedOrder(signed: SignedEIP712OrderParams) {\n return encodeAbiParameters(\n parseAbiParameters(\n '(tuple(tuple(address sender, string subaccountName, int128 priceX18, int128 amount, uint64 expiration, uint64 nonce), bytes signature))',\n ),\n [\n [\n [\n signed.order.subaccountOwner,\n signed.order.subaccountName,\n toBigInt(addDecimals(signed.order.price)),\n signed.order.amount,\n signed.order.expiration,\n signed.order.nonce,\n ],\n signed.signature,\n ],\n ],\n );\n}\n\nexport interface ClaimBuilderFeeParams {\n /** The sender subaccount as bytes32 */\n sender: Hex;\n /** The builder ID to claim fees for */\n builderId: number;\n}\n\n/**\n * Encodes a ClaimBuilderFee slow mode transaction.\n *\n * Format: [tx_type_byte] + [abi_encoded_params]\n *\n * @param params - The claim builder fee parameters\n * @returns The encoded transaction bytes ready to submit via endpoint.submitSlowModeTransaction\n */\nexport function encodeClaimBuilderFeeTx(params: ClaimBuilderFeeParams): Hex {\n const txBytes = encodeAbiParameters(\n parseAbiParameters('bytes32 sender, uint32 builderId'),\n [params.sender, params.builderId],\n );\n\n return encodePacked(\n ['uint8', 'bytes'],\n [SlowModeTxType.ClaimBuilderFee, txBytes],\n );\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,kBAKO;AAMP,mBAAsC;AAK/B,IAAK,iBAAL,kBAAKA,oBAAL;AACL,EAAAA,gCAAA,uBAAoB,KAApB;AACA,EAAAA,gCAAA,wBAAqB,KAArB;AACA,EAAAA,gCAAA,gBAAa,MAAb;AACA,EAAAA,gCAAA,qBAAkB,MAAlB;AAJU,SAAAA;AAAA,GAAA;AAOL,SAAS,iCACd,QACA;AACA,aAAO;AAAA,QACL;AAAA,MACE;AAAA,IACF;AAAA,IACA;AAAA,MACE;AAAA,QACE;AAAA,UACE,OAAO,GAAG;AAAA,UACV,OAAO,GAAG;AAAA,UACV,OAAO,GAAG;AAAA,UACV,OAAO,GAAG;AAAA,UACV,OAAO,GAAG;AAAA,QACZ;AAAA,QACA,OAAO;AAAA,MACT;AAAA,IACF;AAAA,EACF;AACF;AAEO,SAAS,kBAAkB,QAAiC;AACjE,aAAO;AAAA,QACL;AAAA,MACE;AAAA,IACF;AAAA,IACA;AAAA,MACE;AAAA,QACE;AAAA,UACE,OAAO,MAAM;AAAA,UACb,OAAO,MAAM;AAAA,cACb,2BAAS,0BAAY,OAAO,MAAM,KAAK,CAAC;AAAA,UACxC,OAAO,MAAM;AAAA,UACb,OAAO,MAAM;AAAA,UACb,OAAO,MAAM;AAAA,QACf;AAAA,QACA,OAAO;AAAA,MACT;AAAA,IACF;AAAA,EACF;AACF;AAiBO,SAAS,wBAAwB,QAAoC;AAC1E,QAAM,cAAU;AAAA,QACd,gCAAmB,kCAAkC;AAAA,IACrD,CAAC,OAAO,QAAQ,OAAO,SAAS;AAAA,EAClC;AAEA,aAAO;AAAA,IACL,CAAC,SAAS,OAAO;AAAA,IACjB,CAAC,0BAAgC,OAAO;AAAA,EAC1C;AACF;","names":["SlowModeTxType"]}
@@ -1,11 +1,35 @@
1
- import { SignedTx, EIP712WithdrawCollateralParams, SignedEIP712OrderParams } from '../eip712/signatureParamTypes.cjs';
2
- import 'viem';
1
+ import { Hex } from 'viem';
2
+ import { SignedEIP712OrderParams, SignedTx, EIP712WithdrawCollateralParams } from '../eip712/signatureParamTypes.cjs';
3
3
  import '../types/subaccountTypes.cjs';
4
4
  import '../types/bytes.cjs';
5
- import '../utils/math/bigDecimal.cjs';
5
+ import '../utils/math/bigNumber.cjs';
6
6
  import 'bignumber.js';
7
7
 
8
+ /**
9
+ * Transaction type identifiers for slow mode transactions.
10
+ */
11
+ declare enum SlowModeTxType {
12
+ DepositCollateral = 1,
13
+ WithdrawCollateral = 2,
14
+ LinkSigner = 13,
15
+ ClaimBuilderFee = 31
16
+ }
8
17
  declare function encodeSignedWithdrawCollateralTx(signed: SignedTx<EIP712WithdrawCollateralParams>): `0x${string}`;
9
18
  declare function encodeSignedOrder(signed: SignedEIP712OrderParams): `0x${string}`;
19
+ interface ClaimBuilderFeeParams {
20
+ /** The sender subaccount as bytes32 */
21
+ sender: Hex;
22
+ /** The builder ID to claim fees for */
23
+ builderId: number;
24
+ }
25
+ /**
26
+ * Encodes a ClaimBuilderFee slow mode transaction.
27
+ *
28
+ * Format: [tx_type_byte] + [abi_encoded_params]
29
+ *
30
+ * @param params - The claim builder fee parameters
31
+ * @returns The encoded transaction bytes ready to submit via endpoint.submitSlowModeTransaction
32
+ */
33
+ declare function encodeClaimBuilderFeeTx(params: ClaimBuilderFeeParams): Hex;
10
34
 
11
- export { encodeSignedOrder, encodeSignedWithdrawCollateralTx };
35
+ export { type ClaimBuilderFeeParams, SlowModeTxType, encodeClaimBuilderFeeTx, encodeSignedOrder, encodeSignedWithdrawCollateralTx };
@@ -1,11 +1,35 @@
1
- import { SignedTx, EIP712WithdrawCollateralParams, SignedEIP712OrderParams } from '../eip712/signatureParamTypes.js';
2
- import 'viem';
1
+ import { Hex } from 'viem';
2
+ import { SignedEIP712OrderParams, SignedTx, EIP712WithdrawCollateralParams } from '../eip712/signatureParamTypes.js';
3
3
  import '../types/subaccountTypes.js';
4
4
  import '../types/bytes.js';
5
- import '../utils/math/bigDecimal.js';
5
+ import '../utils/math/bigNumber.js';
6
6
  import 'bignumber.js';
7
7
 
8
+ /**
9
+ * Transaction type identifiers for slow mode transactions.
10
+ */
11
+ declare enum SlowModeTxType {
12
+ DepositCollateral = 1,
13
+ WithdrawCollateral = 2,
14
+ LinkSigner = 13,
15
+ ClaimBuilderFee = 31
16
+ }
8
17
  declare function encodeSignedWithdrawCollateralTx(signed: SignedTx<EIP712WithdrawCollateralParams>): `0x${string}`;
9
18
  declare function encodeSignedOrder(signed: SignedEIP712OrderParams): `0x${string}`;
19
+ interface ClaimBuilderFeeParams {
20
+ /** The sender subaccount as bytes32 */
21
+ sender: Hex;
22
+ /** The builder ID to claim fees for */
23
+ builderId: number;
24
+ }
25
+ /**
26
+ * Encodes a ClaimBuilderFee slow mode transaction.
27
+ *
28
+ * Format: [tx_type_byte] + [abi_encoded_params]
29
+ *
30
+ * @param params - The claim builder fee parameters
31
+ * @returns The encoded transaction bytes ready to submit via endpoint.submitSlowModeTransaction
32
+ */
33
+ declare function encodeClaimBuilderFeeTx(params: ClaimBuilderFeeParams): Hex;
10
34
 
11
- export { encodeSignedOrder, encodeSignedWithdrawCollateralTx };
35
+ export { type ClaimBuilderFeeParams, SlowModeTxType, encodeClaimBuilderFeeTx, encodeSignedOrder, encodeSignedWithdrawCollateralTx };
@@ -1,8 +1,19 @@
1
1
  import "../chunk-5WRI5ZAA.js";
2
2
 
3
3
  // src/encoding/encoding.ts
4
- import { encodeAbiParameters, parseAbiParameters } from "viem";
4
+ import {
5
+ encodeAbiParameters,
6
+ encodePacked,
7
+ parseAbiParameters
8
+ } from "viem";
5
9
  import { addDecimals, toBigInt } from "../utils/index.js";
10
+ var SlowModeTxType = /* @__PURE__ */ ((SlowModeTxType2) => {
11
+ SlowModeTxType2[SlowModeTxType2["DepositCollateral"] = 1] = "DepositCollateral";
12
+ SlowModeTxType2[SlowModeTxType2["WithdrawCollateral"] = 2] = "WithdrawCollateral";
13
+ SlowModeTxType2[SlowModeTxType2["LinkSigner"] = 13] = "LinkSigner";
14
+ SlowModeTxType2[SlowModeTxType2["ClaimBuilderFee"] = 31] = "ClaimBuilderFee";
15
+ return SlowModeTxType2;
16
+ })(SlowModeTxType || {});
6
17
  function encodeSignedWithdrawCollateralTx(signed) {
7
18
  return encodeAbiParameters(
8
19
  parseAbiParameters(
@@ -42,7 +53,19 @@ function encodeSignedOrder(signed) {
42
53
  ]
43
54
  );
44
55
  }
56
+ function encodeClaimBuilderFeeTx(params) {
57
+ const txBytes = encodeAbiParameters(
58
+ parseAbiParameters("bytes32 sender, uint32 builderId"),
59
+ [params.sender, params.builderId]
60
+ );
61
+ return encodePacked(
62
+ ["uint8", "bytes"],
63
+ [31 /* ClaimBuilderFee */, txBytes]
64
+ );
65
+ }
45
66
  export {
67
+ SlowModeTxType,
68
+ encodeClaimBuilderFeeTx,
46
69
  encodeSignedOrder,
47
70
  encodeSignedWithdrawCollateralTx
48
71
  };