@whetstone-research/doppler-sdk 0.0.24 → 1.0.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 (445) hide show
  1. package/README.md +69 -0
  2. package/dist/chunk-3LTCKCJC.js +319 -0
  3. package/dist/chunk-3LTCKCJC.js.map +1 -0
  4. package/dist/chunk-PZ5AY32C.js +9 -0
  5. package/dist/{chunk-4XN6DQBW.js.map → chunk-PZ5AY32C.js.map} +1 -1
  6. package/dist/chunk-RO6R66OM.js +974 -0
  7. package/dist/chunk-RO6R66OM.js.map +1 -0
  8. package/dist/evm/index.d.ts +8533 -0
  9. package/dist/evm/index.js +15055 -0
  10. package/dist/evm/index.js.map +1 -0
  11. package/dist/oracle-BSvZ6pxp.d.ts +820 -0
  12. package/dist/pda-RVIHNLRP.js +4 -0
  13. package/dist/pda-RVIHNLRP.js.map +1 -0
  14. package/dist/solana/index.d.ts +2495 -0
  15. package/dist/solana/index.js +2209 -0
  16. package/dist/solana/index.js.map +1 -0
  17. package/dist/solana/react/index.d.ts +1046 -0
  18. package/dist/solana/react/index.js +1436 -0
  19. package/dist/solana/react/index.js.map +1 -0
  20. package/package.json +36 -20
  21. package/dist/DopplerSDK.d.mts +0 -106
  22. package/dist/DopplerSDK.d.ts +0 -106
  23. package/dist/DopplerSDK.js +0 -53
  24. package/dist/DopplerSDK.js.map +0 -1
  25. package/dist/DopplerSDK.mjs +0 -44
  26. package/dist/DopplerSDK.mjs.map +0 -1
  27. package/dist/abis/bytecodes/derc20.d.mts +0 -3
  28. package/dist/abis/bytecodes/derc20.d.ts +0 -3
  29. package/dist/abis/bytecodes/derc20.js +0 -9
  30. package/dist/abis/bytecodes/derc20.js.map +0 -1
  31. package/dist/abis/bytecodes/derc20.mjs +0 -3
  32. package/dist/abis/bytecodes/derc20.mjs.map +0 -1
  33. package/dist/abis/bytecodes/derc2080.d.mts +0 -3
  34. package/dist/abis/bytecodes/derc2080.d.ts +0 -3
  35. package/dist/abis/bytecodes/derc2080.js +0 -9
  36. package/dist/abis/bytecodes/derc2080.js.map +0 -1
  37. package/dist/abis/bytecodes/derc2080.mjs +0 -3
  38. package/dist/abis/bytecodes/derc2080.mjs.map +0 -1
  39. package/dist/abis/bytecodes/doppler.d.mts +0 -3
  40. package/dist/abis/bytecodes/doppler.d.ts +0 -3
  41. package/dist/abis/bytecodes/doppler.js +0 -9
  42. package/dist/abis/bytecodes/doppler.js.map +0 -1
  43. package/dist/abis/bytecodes/doppler.mjs +0 -3
  44. package/dist/abis/bytecodes/doppler.mjs.map +0 -1
  45. package/dist/abis/bytecodes/dopplerDN404.d.mts +0 -3
  46. package/dist/abis/bytecodes/dopplerDN404.d.ts +0 -3
  47. package/dist/abis/bytecodes/dopplerDN404.js +0 -9
  48. package/dist/abis/bytecodes/dopplerDN404.js.map +0 -1
  49. package/dist/abis/bytecodes/dopplerDN404.mjs +0 -3
  50. package/dist/abis/bytecodes/dopplerDN404.mjs.map +0 -1
  51. package/dist/abis/bytecodes/stateView.d.mts +0 -3
  52. package/dist/abis/bytecodes/stateView.d.ts +0 -3
  53. package/dist/abis/bytecodes/stateView.js +0 -9
  54. package/dist/abis/bytecodes/stateView.js.map +0 -1
  55. package/dist/abis/bytecodes/stateView.mjs +0 -3
  56. package/dist/abis/bytecodes/stateView.mjs.map +0 -1
  57. package/dist/abis/bytecodes.d.mts +0 -5
  58. package/dist/abis/bytecodes.d.ts +0 -5
  59. package/dist/abis/bytecodes.js +0 -33
  60. package/dist/abis/bytecodes.js.map +0 -1
  61. package/dist/abis/bytecodes.mjs +0 -8
  62. package/dist/abis/bytecodes.mjs.map +0 -1
  63. package/dist/abis/index.d.mts +0 -3871
  64. package/dist/abis/index.d.ts +0 -3871
  65. package/dist/abis/index.js +0 -130
  66. package/dist/abis/index.js.map +0 -1
  67. package/dist/abis/index.mjs +0 -9
  68. package/dist/abis/index.mjs.map +0 -1
  69. package/dist/addresses.d.mts +0 -69
  70. package/dist/addresses.d.ts +0 -69
  71. package/dist/addresses.js +0 -29
  72. package/dist/addresses.js.map +0 -1
  73. package/dist/addresses.mjs +0 -4
  74. package/dist/addresses.mjs.map +0 -1
  75. package/dist/builders/DynamicAuctionBuilder.d.mts +0 -138
  76. package/dist/builders/DynamicAuctionBuilder.d.ts +0 -138
  77. package/dist/builders/DynamicAuctionBuilder.js +0 -35
  78. package/dist/builders/DynamicAuctionBuilder.js.map +0 -1
  79. package/dist/builders/DynamicAuctionBuilder.mjs +0 -26
  80. package/dist/builders/DynamicAuctionBuilder.mjs.map +0 -1
  81. package/dist/builders/MulticurveBuilder.d.mts +0 -196
  82. package/dist/builders/MulticurveBuilder.d.ts +0 -196
  83. package/dist/builders/MulticurveBuilder.js +0 -35
  84. package/dist/builders/MulticurveBuilder.js.map +0 -1
  85. package/dist/builders/MulticurveBuilder.mjs +0 -26
  86. package/dist/builders/MulticurveBuilder.mjs.map +0 -1
  87. package/dist/builders/StaticAuctionBuilder.d.mts +0 -131
  88. package/dist/builders/StaticAuctionBuilder.d.ts +0 -131
  89. package/dist/builders/StaticAuctionBuilder.js +0 -35
  90. package/dist/builders/StaticAuctionBuilder.js.map +0 -1
  91. package/dist/builders/StaticAuctionBuilder.mjs +0 -26
  92. package/dist/builders/StaticAuctionBuilder.mjs.map +0 -1
  93. package/dist/builders/index.d.mts +0 -8
  94. package/dist/builders/index.d.ts +0 -8
  95. package/dist/builders/index.js +0 -62
  96. package/dist/builders/index.js.map +0 -1
  97. package/dist/builders/index.mjs +0 -29
  98. package/dist/builders/index.mjs.map +0 -1
  99. package/dist/builders/shared.d.mts +0 -115
  100. package/dist/builders/shared.d.ts +0 -115
  101. package/dist/builders/shared.js +0 -46
  102. package/dist/builders/shared.js.map +0 -1
  103. package/dist/builders/shared.mjs +0 -25
  104. package/dist/builders/shared.mjs.map +0 -1
  105. package/dist/chunk-25GEBO3B.mjs +0 -219
  106. package/dist/chunk-25GEBO3B.mjs.map +0 -1
  107. package/dist/chunk-2A3B3NVB.js +0 -737
  108. package/dist/chunk-2A3B3NVB.js.map +0 -1
  109. package/dist/chunk-3NMGCQJ4.mjs +0 -6
  110. package/dist/chunk-3NMGCQJ4.mjs.map +0 -1
  111. package/dist/chunk-44CYUEPG.js +0 -377
  112. package/dist/chunk-44CYUEPG.js.map +0 -1
  113. package/dist/chunk-4VWQNNNW.js +0 -233
  114. package/dist/chunk-4VWQNNNW.js.map +0 -1
  115. package/dist/chunk-4XN6DQBW.js +0 -4
  116. package/dist/chunk-5GQJRNFL.mjs +0 -40
  117. package/dist/chunk-5GQJRNFL.mjs.map +0 -1
  118. package/dist/chunk-5JHXBDZD.js +0 -265
  119. package/dist/chunk-5JHXBDZD.js.map +0 -1
  120. package/dist/chunk-5TQOT6CW.js +0 -8
  121. package/dist/chunk-5TQOT6CW.js.map +0 -1
  122. package/dist/chunk-65CESA3J.js +0 -46
  123. package/dist/chunk-65CESA3J.js.map +0 -1
  124. package/dist/chunk-6BQY5EPB.js +0 -144
  125. package/dist/chunk-6BQY5EPB.js.map +0 -1
  126. package/dist/chunk-6H6X3VTZ.js +0 -18
  127. package/dist/chunk-6H6X3VTZ.js.map +0 -1
  128. package/dist/chunk-7A4DBBXA.js +0 -311
  129. package/dist/chunk-7A4DBBXA.js.map +0 -1
  130. package/dist/chunk-7M57PU6V.js +0 -28
  131. package/dist/chunk-7M57PU6V.js.map +0 -1
  132. package/dist/chunk-7ZUV6WPX.mjs +0 -3
  133. package/dist/chunk-7ZUV6WPX.mjs.map +0 -1
  134. package/dist/chunk-A2CJYRRQ.js +0 -330
  135. package/dist/chunk-A2CJYRRQ.js.map +0 -1
  136. package/dist/chunk-ABT6AT7C.mjs +0 -16
  137. package/dist/chunk-ABT6AT7C.mjs.map +0 -1
  138. package/dist/chunk-BK3S6SVR.js +0 -2707
  139. package/dist/chunk-BK3S6SVR.js.map +0 -1
  140. package/dist/chunk-BQZTELUX.js +0 -45
  141. package/dist/chunk-BQZTELUX.js.map +0 -1
  142. package/dist/chunk-CFAAYL5M.mjs +0 -26
  143. package/dist/chunk-CFAAYL5M.mjs.map +0 -1
  144. package/dist/chunk-CFXXUZJY.js +0 -275
  145. package/dist/chunk-CFXXUZJY.js.map +0 -1
  146. package/dist/chunk-CWTGQAOG.mjs +0 -72
  147. package/dist/chunk-CWTGQAOG.mjs.map +0 -1
  148. package/dist/chunk-DCWF3EMP.js +0 -171
  149. package/dist/chunk-DCWF3EMP.js.map +0 -1
  150. package/dist/chunk-DOUF6NON.mjs +0 -3
  151. package/dist/chunk-DOUF6NON.mjs.map +0 -1
  152. package/dist/chunk-DQJXCZU2.mjs +0 -318
  153. package/dist/chunk-DQJXCZU2.mjs.map +0 -1
  154. package/dist/chunk-DSYPZETD.js +0 -4
  155. package/dist/chunk-DSYPZETD.js.map +0 -1
  156. package/dist/chunk-F2BYG63D.mjs +0 -145
  157. package/dist/chunk-F2BYG63D.mjs.map +0 -1
  158. package/dist/chunk-FNUBKONK.js +0 -291
  159. package/dist/chunk-FNUBKONK.js.map +0 -1
  160. package/dist/chunk-FOESYJP3.mjs +0 -3
  161. package/dist/chunk-FOESYJP3.mjs.map +0 -1
  162. package/dist/chunk-FXTGIKQG.mjs +0 -3
  163. package/dist/chunk-FXTGIKQG.mjs.map +0 -1
  164. package/dist/chunk-GSBQIVME.mjs +0 -278
  165. package/dist/chunk-GSBQIVME.mjs.map +0 -1
  166. package/dist/chunk-H3B54PFV.mjs +0 -17
  167. package/dist/chunk-H3B54PFV.mjs.map +0 -1
  168. package/dist/chunk-HJFVRV47.js +0 -120
  169. package/dist/chunk-HJFVRV47.js.map +0 -1
  170. package/dist/chunk-IIM2CSDQ.js +0 -147
  171. package/dist/chunk-IIM2CSDQ.js.map +0 -1
  172. package/dist/chunk-IUTIHSLH.mjs +0 -295
  173. package/dist/chunk-IUTIHSLH.mjs.map +0 -1
  174. package/dist/chunk-IUZ3BBQP.mjs +0 -117
  175. package/dist/chunk-IUZ3BBQP.mjs.map +0 -1
  176. package/dist/chunk-IWJOPXYN.mjs +0 -96
  177. package/dist/chunk-IWJOPXYN.mjs.map +0 -1
  178. package/dist/chunk-IX4V4UGW.mjs +0 -141
  179. package/dist/chunk-IX4V4UGW.mjs.map +0 -1
  180. package/dist/chunk-J62YDWIK.js +0 -8
  181. package/dist/chunk-J62YDWIK.js.map +0 -1
  182. package/dist/chunk-JIKAD4YL.js +0 -4
  183. package/dist/chunk-JIKAD4YL.js.map +0 -1
  184. package/dist/chunk-JLUOFAE4.mjs +0 -2531
  185. package/dist/chunk-JLUOFAE4.mjs.map +0 -1
  186. package/dist/chunk-KAZQJ24E.mjs +0 -59
  187. package/dist/chunk-KAZQJ24E.mjs.map +0 -1
  188. package/dist/chunk-KHUE77HC.js +0 -81
  189. package/dist/chunk-KHUE77HC.js.map +0 -1
  190. package/dist/chunk-KOAC3BBP.mjs +0 -11
  191. package/dist/chunk-KOAC3BBP.mjs.map +0 -1
  192. package/dist/chunk-LW3CYA27.mjs +0 -2705
  193. package/dist/chunk-LW3CYA27.mjs.map +0 -1
  194. package/dist/chunk-MEA2C5YX.js +0 -143
  195. package/dist/chunk-MEA2C5YX.js.map +0 -1
  196. package/dist/chunk-MU56HCUI.js +0 -2556
  197. package/dist/chunk-MU56HCUI.js.map +0 -1
  198. package/dist/chunk-OCIY7QEJ.mjs +0 -169
  199. package/dist/chunk-OCIY7QEJ.mjs.map +0 -1
  200. package/dist/chunk-OHA5KJ2M.mjs +0 -6
  201. package/dist/chunk-OHA5KJ2M.mjs.map +0 -1
  202. package/dist/chunk-P25HBGP5.mjs +0 -3
  203. package/dist/chunk-P25HBGP5.mjs.map +0 -1
  204. package/dist/chunk-P563HTVU.js +0 -164
  205. package/dist/chunk-P563HTVU.js.map +0 -1
  206. package/dist/chunk-P7CHGWY7.js +0 -4
  207. package/dist/chunk-P7CHGWY7.js.map +0 -1
  208. package/dist/chunk-PGYTMRP3.js +0 -277
  209. package/dist/chunk-PGYTMRP3.js.map +0 -1
  210. package/dist/chunk-QAPQGDWK.js +0 -8
  211. package/dist/chunk-QAPQGDWK.js.map +0 -1
  212. package/dist/chunk-QHBKRUBY.mjs +0 -328
  213. package/dist/chunk-QHBKRUBY.mjs.map +0 -1
  214. package/dist/chunk-QOYI7WCH.js +0 -120
  215. package/dist/chunk-QOYI7WCH.js.map +0 -1
  216. package/dist/chunk-QRTABC4Z.js +0 -8
  217. package/dist/chunk-QRTABC4Z.js.map +0 -1
  218. package/dist/chunk-QSQGLWNY.mjs +0 -3
  219. package/dist/chunk-QSQGLWNY.mjs.map +0 -1
  220. package/dist/chunk-QUBD6HUZ.mjs +0 -735
  221. package/dist/chunk-QUBD6HUZ.mjs.map +0 -1
  222. package/dist/chunk-RDTIXP6S.mjs +0 -263
  223. package/dist/chunk-RDTIXP6S.mjs.map +0 -1
  224. package/dist/chunk-RLOZWHRR.js +0 -320
  225. package/dist/chunk-RLOZWHRR.js.map +0 -1
  226. package/dist/chunk-RV64M4Q6.mjs +0 -3
  227. package/dist/chunk-RV64M4Q6.mjs.map +0 -1
  228. package/dist/chunk-SWWLOD7Q.mjs +0 -6
  229. package/dist/chunk-SWWLOD7Q.mjs.map +0 -1
  230. package/dist/chunk-T3UA4MJL.js +0 -4
  231. package/dist/chunk-T3UA4MJL.js.map +0 -1
  232. package/dist/chunk-TEWAXP5C.mjs +0 -162
  233. package/dist/chunk-TEWAXP5C.mjs.map +0 -1
  234. package/dist/chunk-THEIRDGE.mjs +0 -273
  235. package/dist/chunk-THEIRDGE.mjs.map +0 -1
  236. package/dist/chunk-U3GOWK6J.mjs +0 -6
  237. package/dist/chunk-U3GOWK6J.mjs.map +0 -1
  238. package/dist/chunk-UPVKABAV.js +0 -19
  239. package/dist/chunk-UPVKABAV.js.map +0 -1
  240. package/dist/chunk-VEIVYUYF.js +0 -4
  241. package/dist/chunk-VEIVYUYF.js.map +0 -1
  242. package/dist/chunk-VKSD3KXF.mjs +0 -275
  243. package/dist/chunk-VKSD3KXF.mjs.map +0 -1
  244. package/dist/chunk-VYSOAGRU.mjs +0 -6
  245. package/dist/chunk-VYSOAGRU.mjs.map +0 -1
  246. package/dist/chunk-WDC53TM7.mjs +0 -305
  247. package/dist/chunk-WDC53TM7.mjs.map +0 -1
  248. package/dist/chunk-WKWP42TD.mjs +0 -39
  249. package/dist/chunk-WKWP42TD.mjs.map +0 -1
  250. package/dist/chunk-WNUB3UTT.js +0 -241
  251. package/dist/chunk-WNUB3UTT.js.map +0 -1
  252. package/dist/chunk-WNWK2QMU.mjs +0 -375
  253. package/dist/chunk-WNWK2QMU.mjs.map +0 -1
  254. package/dist/chunk-WQHTNL5L.js +0 -4
  255. package/dist/chunk-WQHTNL5L.js.map +0 -1
  256. package/dist/chunk-WZF5XNBC.js +0 -297
  257. package/dist/chunk-WZF5XNBC.js.map +0 -1
  258. package/dist/chunk-X3UMAHOJ.js +0 -4
  259. package/dist/chunk-X3UMAHOJ.js.map +0 -1
  260. package/dist/chunk-XMFOZYNI.js +0 -8
  261. package/dist/chunk-XMFOZYNI.js.map +0 -1
  262. package/dist/chunk-XNMXN5SZ.mjs +0 -3
  263. package/dist/chunk-XNMXN5SZ.mjs.map +0 -1
  264. package/dist/chunk-XSJTASPK.js +0 -13
  265. package/dist/chunk-XSJTASPK.js.map +0 -1
  266. package/dist/chunk-YBK6EBA5.mjs +0 -239
  267. package/dist/chunk-YBK6EBA5.mjs.map +0 -1
  268. package/dist/chunk-YYLD3AJ7.js +0 -61
  269. package/dist/chunk-YYLD3AJ7.js.map +0 -1
  270. package/dist/chunk-ZEDJUNC6.mjs +0 -115
  271. package/dist/chunk-ZEDJUNC6.mjs.map +0 -1
  272. package/dist/constants.d.mts +0 -91
  273. package/dist/constants.d.ts +0 -91
  274. package/dist/constants.js +0 -196
  275. package/dist/constants.js.map +0 -1
  276. package/dist/constants.mjs +0 -3
  277. package/dist/constants.mjs.map +0 -1
  278. package/dist/deployments.generated.d.mts +0 -275
  279. package/dist/deployments.generated.d.ts +0 -275
  280. package/dist/deployments.generated.js +0 -12
  281. package/dist/deployments.generated.js.map +0 -1
  282. package/dist/deployments.generated.mjs +0 -3
  283. package/dist/deployments.generated.mjs.map +0 -1
  284. package/dist/entities/DopplerFactory.d.mts +0 -272
  285. package/dist/entities/DopplerFactory.d.ts +0 -272
  286. package/dist/entities/DopplerFactory.js +0 -34
  287. package/dist/entities/DopplerFactory.js.map +0 -1
  288. package/dist/entities/DopplerFactory.mjs +0 -25
  289. package/dist/entities/DopplerFactory.mjs.map +0 -1
  290. package/dist/entities/auction/DynamicAuction.d.mts +0 -72
  291. package/dist/entities/auction/DynamicAuction.d.ts +0 -72
  292. package/dist/entities/auction/DynamicAuction.js +0 -21
  293. package/dist/entities/auction/DynamicAuction.js.map +0 -1
  294. package/dist/entities/auction/DynamicAuction.mjs +0 -12
  295. package/dist/entities/auction/DynamicAuction.mjs.map +0 -1
  296. package/dist/entities/auction/MulticurvePool.d.mts +0 -78
  297. package/dist/entities/auction/MulticurvePool.d.ts +0 -78
  298. package/dist/entities/auction/MulticurvePool.js +0 -24
  299. package/dist/entities/auction/MulticurvePool.js.map +0 -1
  300. package/dist/entities/auction/MulticurvePool.mjs +0 -15
  301. package/dist/entities/auction/MulticurvePool.mjs.map +0 -1
  302. package/dist/entities/auction/RehypeDopplerHook.d.mts +0 -57
  303. package/dist/entities/auction/RehypeDopplerHook.d.ts +0 -57
  304. package/dist/entities/auction/RehypeDopplerHook.js +0 -34
  305. package/dist/entities/auction/RehypeDopplerHook.js.map +0 -1
  306. package/dist/entities/auction/RehypeDopplerHook.mjs +0 -25
  307. package/dist/entities/auction/RehypeDopplerHook.mjs.map +0 -1
  308. package/dist/entities/auction/RehypeDopplerHookMigrator.d.mts +0 -48
  309. package/dist/entities/auction/RehypeDopplerHookMigrator.d.ts +0 -48
  310. package/dist/entities/auction/RehypeDopplerHookMigrator.js +0 -34
  311. package/dist/entities/auction/RehypeDopplerHookMigrator.js.map +0 -1
  312. package/dist/entities/auction/RehypeDopplerHookMigrator.mjs +0 -25
  313. package/dist/entities/auction/RehypeDopplerHookMigrator.mjs.map +0 -1
  314. package/dist/entities/auction/StaticAuction.d.mts +0 -44
  315. package/dist/entities/auction/StaticAuction.d.ts +0 -44
  316. package/dist/entities/auction/StaticAuction.js +0 -21
  317. package/dist/entities/auction/StaticAuction.js.map +0 -1
  318. package/dist/entities/auction/StaticAuction.mjs +0 -12
  319. package/dist/entities/auction/StaticAuction.mjs.map +0 -1
  320. package/dist/entities/auction/index.d.mts +0 -9
  321. package/dist/entities/auction/index.d.ts +0 -9
  322. package/dist/entities/auction/index.js +0 -55
  323. package/dist/entities/auction/index.js.map +0 -1
  324. package/dist/entities/auction/index.mjs +0 -30
  325. package/dist/entities/auction/index.mjs.map +0 -1
  326. package/dist/entities/quoter/Quoter.d.mts +0 -150
  327. package/dist/entities/quoter/Quoter.d.ts +0 -150
  328. package/dist/entities/quoter/Quoter.js +0 -21
  329. package/dist/entities/quoter/Quoter.js.map +0 -1
  330. package/dist/entities/quoter/Quoter.mjs +0 -12
  331. package/dist/entities/quoter/Quoter.mjs.map +0 -1
  332. package/dist/entities/quoter/index.d.mts +0 -5
  333. package/dist/entities/quoter/index.d.ts +0 -5
  334. package/dist/entities/quoter/index.js +0 -22
  335. package/dist/entities/quoter/index.js.map +0 -1
  336. package/dist/entities/quoter/index.mjs +0 -13
  337. package/dist/entities/quoter/index.mjs.map +0 -1
  338. package/dist/entities/token/derc20/Derc20.d.mts +0 -102
  339. package/dist/entities/token/derc20/Derc20.d.ts +0 -102
  340. package/dist/entities/token/derc20/Derc20.js +0 -19
  341. package/dist/entities/token/derc20/Derc20.js.map +0 -1
  342. package/dist/entities/token/derc20/Derc20.mjs +0 -10
  343. package/dist/entities/token/derc20/Derc20.mjs.map +0 -1
  344. package/dist/entities/token/derc20/index.d.mts +0 -5
  345. package/dist/entities/token/derc20/index.d.ts +0 -5
  346. package/dist/entities/token/derc20/index.js +0 -20
  347. package/dist/entities/token/derc20/index.js.map +0 -1
  348. package/dist/entities/token/derc20/index.mjs +0 -11
  349. package/dist/entities/token/derc20/index.mjs.map +0 -1
  350. package/dist/entities/token/eth/Eth.d.mts +0 -54
  351. package/dist/entities/token/eth/Eth.d.ts +0 -54
  352. package/dist/entities/token/eth/Eth.js +0 -12
  353. package/dist/entities/token/eth/Eth.js.map +0 -1
  354. package/dist/entities/token/eth/Eth.mjs +0 -3
  355. package/dist/entities/token/eth/Eth.mjs.map +0 -1
  356. package/dist/entities/token/eth/index.d.mts +0 -5
  357. package/dist/entities/token/eth/index.d.ts +0 -5
  358. package/dist/entities/token/eth/index.js +0 -13
  359. package/dist/entities/token/eth/index.js.map +0 -1
  360. package/dist/entities/token/eth/index.mjs +0 -4
  361. package/dist/entities/token/eth/index.mjs.map +0 -1
  362. package/dist/entities/token/index.d.mts +0 -6
  363. package/dist/entities/token/index.d.ts +0 -6
  364. package/dist/entities/token/index.js +0 -27
  365. package/dist/entities/token/index.js.map +0 -1
  366. package/dist/entities/token/index.mjs +0 -14
  367. package/dist/entities/token/index.mjs.map +0 -1
  368. package/dist/index.d.mts +0 -39
  369. package/dist/index.d.ts +0 -39
  370. package/dist/index.js +0 -587
  371. package/dist/index.js.map +0 -1
  372. package/dist/index.mjs +0 -49
  373. package/dist/index.mjs.map +0 -1
  374. package/dist/types.d.mts +0 -662
  375. package/dist/types.d.ts +0 -662
  376. package/dist/types.js +0 -34
  377. package/dist/types.js.map +0 -1
  378. package/dist/types.mjs +0 -5
  379. package/dist/types.mjs.map +0 -1
  380. package/dist/utils/airlock.d.mts +0 -11
  381. package/dist/utils/airlock.d.ts +0 -11
  382. package/dist/utils/airlock.js +0 -26
  383. package/dist/utils/airlock.js.map +0 -1
  384. package/dist/utils/airlock.mjs +0 -5
  385. package/dist/utils/airlock.mjs.map +0 -1
  386. package/dist/utils/balanceDelta.d.mts +0 -10
  387. package/dist/utils/balanceDelta.d.ts +0 -10
  388. package/dist/utils/balanceDelta.js +0 -12
  389. package/dist/utils/balanceDelta.js.map +0 -1
  390. package/dist/utils/balanceDelta.mjs +0 -3
  391. package/dist/utils/balanceDelta.mjs.map +0 -1
  392. package/dist/utils/computeOptimalGamma.d.mts +0 -7
  393. package/dist/utils/computeOptimalGamma.d.ts +0 -7
  394. package/dist/utils/computeOptimalGamma.js +0 -12
  395. package/dist/utils/computeOptimalGamma.js.map +0 -1
  396. package/dist/utils/computeOptimalGamma.mjs +0 -3
  397. package/dist/utils/computeOptimalGamma.mjs.map +0 -1
  398. package/dist/utils/dopplerHookMigrator.d.mts +0 -18
  399. package/dist/utils/dopplerHookMigrator.d.ts +0 -18
  400. package/dist/utils/dopplerHookMigrator.js +0 -20
  401. package/dist/utils/dopplerHookMigrator.js.map +0 -1
  402. package/dist/utils/dopplerHookMigrator.mjs +0 -7
  403. package/dist/utils/dopplerHookMigrator.mjs.map +0 -1
  404. package/dist/utils/index.d.mts +0 -14
  405. package/dist/utils/index.d.ts +0 -14
  406. package/dist/utils/index.js +0 -197
  407. package/dist/utils/index.js.map +0 -1
  408. package/dist/utils/index.mjs +0 -24
  409. package/dist/utils/index.mjs.map +0 -1
  410. package/dist/utils/isToken0Expected.d.mts +0 -13
  411. package/dist/utils/isToken0Expected.d.ts +0 -13
  412. package/dist/utils/isToken0Expected.js +0 -12
  413. package/dist/utils/isToken0Expected.js.map +0 -1
  414. package/dist/utils/isToken0Expected.mjs +0 -3
  415. package/dist/utils/isToken0Expected.mjs.map +0 -1
  416. package/dist/utils/marketCapHelpers.d.mts +0 -259
  417. package/dist/utils/marketCapHelpers.d.ts +0 -259
  418. package/dist/utils/marketCapHelpers.js +0 -58
  419. package/dist/utils/marketCapHelpers.js.map +0 -1
  420. package/dist/utils/marketCapHelpers.mjs +0 -5
  421. package/dist/utils/marketCapHelpers.mjs.map +0 -1
  422. package/dist/utils/poolKey.d.mts +0 -17
  423. package/dist/utils/poolKey.d.ts +0 -17
  424. package/dist/utils/poolKey.js +0 -12
  425. package/dist/utils/poolKey.js.map +0 -1
  426. package/dist/utils/poolKey.mjs +0 -3
  427. package/dist/utils/poolKey.mjs.map +0 -1
  428. package/dist/utils/priceHelpers.d.mts +0 -86
  429. package/dist/utils/priceHelpers.d.ts +0 -86
  430. package/dist/utils/priceHelpers.js +0 -41
  431. package/dist/utils/priceHelpers.js.map +0 -1
  432. package/dist/utils/priceHelpers.mjs +0 -4
  433. package/dist/utils/priceHelpers.mjs.map +0 -1
  434. package/dist/utils/tickMath.d.mts +0 -72
  435. package/dist/utils/tickMath.d.ts +0 -72
  436. package/dist/utils/tickMath.js +0 -60
  437. package/dist/utils/tickMath.js.map +0 -1
  438. package/dist/utils/tickMath.mjs +0 -3
  439. package/dist/utils/tickMath.mjs.map +0 -1
  440. package/dist/utils/tokenAddressMiner.d.mts +0 -37
  441. package/dist/utils/tokenAddressMiner.d.ts +0 -37
  442. package/dist/utils/tokenAddressMiner.js +0 -19
  443. package/dist/utils/tokenAddressMiner.js.map +0 -1
  444. package/dist/utils/tokenAddressMiner.mjs +0 -10
  445. package/dist/utils/tokenAddressMiner.mjs.map +0 -1
@@ -1,735 +0,0 @@
1
- import { buildCurvesFromPresets } from './chunk-ZEDJUNC6.mjs';
2
- import { validateMarketCapParameters, marketCapToTicksForMulticurve, marketCapToTickForMulticurve } from './chunk-GSBQIVME.mjs';
3
- import { DEFAULT_V3_YEARLY_MINT_RATE, WAD, V4_MAX_FEE, DECAY_MAX_START_FEE, ZERO_ADDRESS, FEE_TIERS, TICK_SPACINGS } from './chunk-IWJOPXYN.mjs';
4
- import { isNoOpEnabledChain, isLaunchpadEnabledChain } from './chunk-WKWP42TD.mjs';
5
-
6
- // src/builders/MulticurveBuilder.ts
7
- var MulticurveBuilder = class _MulticurveBuilder {
8
- constructor(chainId) {
9
- this.chainId = chainId;
10
- }
11
- static forChain(chainId) {
12
- return new _MulticurveBuilder(chainId);
13
- }
14
- tokenConfig(params) {
15
- if (params && "type" in params && params.type === "doppler404") {
16
- this.token = {
17
- type: "doppler404",
18
- name: params.name,
19
- symbol: params.symbol,
20
- baseURI: params.baseURI,
21
- unit: params.unit
22
- };
23
- } else {
24
- this.token = {
25
- type: "standard",
26
- name: params.name,
27
- symbol: params.symbol,
28
- tokenURI: params.tokenURI,
29
- yearlyMintRate: params.yearlyMintRate ?? DEFAULT_V3_YEARLY_MINT_RATE
30
- };
31
- }
32
- return this;
33
- }
34
- saleConfig(params) {
35
- this.sale = {
36
- initialSupply: params.initialSupply,
37
- numTokensToSell: params.numTokensToSell,
38
- numeraire: params.numeraire
39
- };
40
- return this;
41
- }
42
- poolConfig(params) {
43
- if (this.curvesConfig) {
44
- throw new Error(
45
- "Cannot use poolConfig() after withCurves(). Use withCurves() for market cap-based configuration, or poolConfig() for manual tick configuration."
46
- );
47
- }
48
- const sortedBeneficiaries = params.beneficiaries ? [...params.beneficiaries].sort((a, b) => {
49
- const aAddr = a.beneficiary.toLowerCase();
50
- const bAddr = b.beneficiary.toLowerCase();
51
- return aAddr < bAddr ? -1 : aAddr > bAddr ? 1 : 0;
52
- }) : void 0;
53
- this.pool = {
54
- fee: params.fee,
55
- tickSpacing: params.tickSpacing,
56
- curves: params.curves,
57
- beneficiaries: sortedBeneficiaries
58
- };
59
- return this;
60
- }
61
- withMarketCapPresets(params) {
62
- if (this.curvesConfig) {
63
- throw new Error(
64
- "Cannot use withMarketCapPresets() after withCurves(). Use withCurves() for market cap-based configuration, or withMarketCapPresets() for preset-based configuration."
65
- );
66
- }
67
- const { fee, tickSpacing, curves } = buildCurvesFromPresets({
68
- fee: params?.fee,
69
- tickSpacing: params?.tickSpacing,
70
- presets: params?.presets,
71
- overrides: params?.overrides
72
- });
73
- return this.poolConfig({
74
- fee,
75
- tickSpacing,
76
- curves,
77
- beneficiaries: params?.beneficiaries
78
- });
79
- }
80
- /**
81
- * Configure multicurve using market cap ranges (no tick math required).
82
- *
83
- * This is the recommended way to configure multicurve pools. Simply specify
84
- * market cap ranges in USD for each curve.
85
- *
86
- * Curves can be provided in any order - they will be automatically sorted
87
- * by market cap (ascending) before validation and processing. Curves must
88
- * be contiguous or overlapping (no gaps allowed).
89
- *
90
- * V4 pools support custom fees (0-100,000). Standard fee tiers auto-derive
91
- * tickSpacing; custom fees require explicit tickSpacing parameter.
92
- *
93
- * @param params - Market cap configuration with curves defined by market cap ranges
94
- * @returns Builder instance for chaining
95
- *
96
- * @example Standard fee tier
97
- * ```ts
98
- * builder
99
- * .saleConfig({ initialSupply, numTokensToSell, numeraire: WETH })
100
- * .withCurves({
101
- * numerairePrice: 3000,
102
- * curves: [...],
103
- * fee: 500, // Standard tier, tickSpacing auto-derived
104
- * })
105
- * ```
106
- *
107
- * @example Custom fee
108
- * ```ts
109
- * builder
110
- * .saleConfig({ initialSupply, numTokensToSell, numeraire: WETH })
111
- * .withCurves({
112
- * numerairePrice: 3000,
113
- * curves: [...],
114
- * fee: 2500, // Custom 0.25% fee
115
- * tickSpacing: 10, // Required for custom fees
116
- * })
117
- * ```
118
- */
119
- withCurves(params) {
120
- if (this.pool) {
121
- throw new Error(
122
- "Cannot use withCurves() after poolConfig()/withMarketCapPresets(). Use withCurves() for market cap-based configuration, or poolConfig() for manual tick configuration."
123
- );
124
- }
125
- if (params.numerairePrice <= 0) {
126
- throw new Error("numerairePrice must be greater than 0");
127
- }
128
- if (!params.curves || params.curves.length === 0) {
129
- throw new Error("curves array must contain at least one curve");
130
- }
131
- for (let i = 0; i < params.curves.length; i++) {
132
- const curve = params.curves[i];
133
- this.validateCurveRange(
134
- curve.marketCap.start,
135
- curve.marketCap.end,
136
- curve.numPositions,
137
- curve.shares,
138
- `curves[${i}]`
139
- );
140
- }
141
- const sortedCurves = this.sortCurvesByMarketCap(params.curves);
142
- this.validateCurveContiguity(sortedCurves);
143
- const totalShares = sortedCurves.reduce((sum, c) => sum + c.shares, 0n);
144
- if (totalShares !== WAD) {
145
- throw new Error(
146
- `Total curve shares must equal 100% (${WAD}). Got ${totalShares} (${Number(totalShares * 10000n / WAD) / 100}%)`
147
- );
148
- }
149
- if (params.fee !== void 0 && params.fee > V4_MAX_FEE) {
150
- throw new Error(
151
- `Fee ${params.fee} exceeds maximum allowed for V4 pools (${V4_MAX_FEE} = 10%). Use a fee between 0 and ${V4_MAX_FEE}.`
152
- );
153
- }
154
- this.numerairePrice = params.numerairePrice;
155
- this.tokenDecimals = params.tokenDecimals;
156
- this.numeraireDecimals = params.numeraireDecimals;
157
- this.curvesConfig = {
158
- numerairePrice: params.numerairePrice,
159
- curves: sortedCurves,
160
- tokenSupply: params.tokenSupply,
161
- tokenDecimals: params.tokenDecimals,
162
- numeraireDecimals: params.numeraireDecimals,
163
- fee: params.fee,
164
- tickSpacing: params.tickSpacing,
165
- beneficiaries: params.beneficiaries
166
- };
167
- return this;
168
- }
169
- /**
170
- * Sort curves by market cap (start, then end) for deterministic ordering
171
- */
172
- sortCurvesByMarketCap(curves) {
173
- return [...curves].sort((a, b) => {
174
- const startDiff = a.marketCap.start - b.marketCap.start;
175
- if (startDiff !== 0) return startDiff;
176
- const aEnd = a.marketCap.end === "max" ? Infinity : a.marketCap.end;
177
- const bEnd = b.marketCap.end === "max" ? Infinity : b.marketCap.end;
178
- return aEnd - bEnd;
179
- });
180
- }
181
- validateCurveRange(startMarketCap, endMarketCap, numPositions, shares, label) {
182
- if (startMarketCap <= 0) {
183
- throw new Error(`${label}: marketCap.start must be greater than 0`);
184
- }
185
- if (endMarketCap !== "max" && endMarketCap <= 0) {
186
- throw new Error(`${label}: marketCap.end must be greater than 0`);
187
- }
188
- if (endMarketCap !== "max" && startMarketCap >= endMarketCap) {
189
- throw new Error(
190
- `${label}: startMarketCap ($${startMarketCap.toLocaleString()}) must be less than endMarketCap ($${endMarketCap.toLocaleString()})`
191
- );
192
- }
193
- if (numPositions <= 0) {
194
- throw new Error(`${label}: numPositions must be greater than 0`);
195
- }
196
- if (shares <= 0n) {
197
- throw new Error(`${label}: shares must be greater than 0`);
198
- }
199
- }
200
- validateCurveContiguity(sortedCurves) {
201
- if (sortedCurves.length <= 1) {
202
- return;
203
- }
204
- for (let i = 1; i < sortedCurves.length; i++) {
205
- const prevCurve = sortedCurves[i - 1];
206
- const currCurve = sortedCurves[i];
207
- const prevEnd = prevCurve.marketCap.end === "max" ? Infinity : prevCurve.marketCap.end;
208
- const prevEndLabel = prevCurve.marketCap.end === "max" ? "max" : `$${prevCurve.marketCap.end.toLocaleString()}`;
209
- const currEndLabel = currCurve.marketCap.end === "max" ? "max" : `$${currCurve.marketCap.end.toLocaleString()}`;
210
- if (currCurve.marketCap.start > prevEnd) {
211
- throw new Error(
212
- `Gap detected between market cap ranges: $${prevCurve.marketCap.start.toLocaleString()}-${prevEndLabel} and $${currCurve.marketCap.start.toLocaleString()}-${currEndLabel}. Curves must be contiguous or overlapping.`
213
- );
214
- }
215
- }
216
- }
217
- /**
218
- * Configure a RehypeDopplerHook for the pool.
219
- *
220
- * When configured, the hook will be initialized with the pool and will handle:
221
- * - Custom swap fees
222
- * - Fee distribution to beneficiaries, LPs, and buyback destinations
223
- *
224
- * IMPORTANT:
225
- * - The hook address must be whitelisted in the DopplerHookInitializer
226
- * - Fee distribution percentages must sum to exactly WAD (1e18 = 100%)
227
- *
228
- * @example
229
- * ```typescript
230
- * builder.withRehypeDopplerHook({
231
- * hookAddress: '0x...',
232
- * buybackDestination: '0x...',
233
- * startFee: 3000, // 0.3%
234
- * endFee: 3000,
235
- * durationSeconds: 0,
236
- * feeDistributionInfo: {
237
- * assetFeesToAssetBuybackWad: parseEther('0.2'),
238
- * assetFeesToNumeraireBuybackWad: parseEther('0.2'),
239
- * assetFeesToBeneficiaryWad: parseEther('0.3'),
240
- * assetFeesToLpWad: parseEther('0.3'),
241
- * numeraireFeesToAssetBuybackWad: parseEther('0.2'),
242
- * numeraireFeesToNumeraireBuybackWad: parseEther('0.2'),
243
- * numeraireFeesToBeneficiaryWad: parseEther('0.3'),
244
- * numeraireFeesToLpWad: parseEther('0.3'),
245
- * },
246
- * })
247
- * ```
248
- */
249
- withRehypeDopplerHook(params) {
250
- this.assertCanSetInitializer("rehype");
251
- const feeDistributionInfo = this.resolveRehypeFeeDistributionInfo(params);
252
- this.validateRehypeDistribution(feeDistributionInfo);
253
- const {
254
- startFee,
255
- endFee,
256
- durationSeconds,
257
- startingTime,
258
- feeRoutingMode
259
- } = this.resolveRehypeFeeSchedule(params);
260
- if (params.graduationMarketCap !== void 0 && params.farTick !== void 0) {
261
- throw new Error(
262
- "Cannot specify both graduationMarketCap and farTick. Use one or the other."
263
- );
264
- }
265
- const normalizedParams = {
266
- ...params,
267
- startFee,
268
- endFee,
269
- durationSeconds,
270
- startingTime,
271
- feeRoutingMode,
272
- feeDistributionInfo
273
- };
274
- this.dopplerHook = normalizedParams;
275
- this.initializer = { type: "rehype", config: normalizedParams };
276
- return this;
277
- }
278
- parseUint32Value(value, label) {
279
- const normalized = typeof value === "bigint" ? Number(value) : Number(value);
280
- if (!Number.isFinite(normalized) || !Number.isInteger(normalized)) {
281
- throw new Error(`${label} must be an integer number of seconds`);
282
- }
283
- if (normalized < 0) {
284
- throw new Error(`${label} cannot be negative`);
285
- }
286
- const UINT32_MAX = 4294967295;
287
- if (normalized > UINT32_MAX) {
288
- throw new Error(`${label} must fit within uint32`);
289
- }
290
- return normalized;
291
- }
292
- normalizeRehypeFeeRoutingMode(mode) {
293
- if (mode === void 0 || mode === 0 /* DirectBuyback */) {
294
- return 0 /* DirectBuyback */;
295
- }
296
- if (mode === 1 /* RouteToBeneficiaryFees */) {
297
- return 1 /* RouteToBeneficiaryFees */;
298
- }
299
- if (mode === "directBuyback") {
300
- return 0 /* DirectBuyback */;
301
- }
302
- if (mode === "routeToBeneficiaryFees") {
303
- return 1 /* RouteToBeneficiaryFees */;
304
- }
305
- throw new Error(
306
- "Rehype feeRoutingMode must be DirectBuyback/directBuyback or RouteToBeneficiaryFees/routeToBeneficiaryFees"
307
- );
308
- }
309
- resolveRehypeFeeDistributionInfo(params) {
310
- if (params.feeDistributionInfo) {
311
- return params.feeDistributionInfo;
312
- }
313
- const assetBuyback = params.assetBuybackPercentWad;
314
- const numeraireBuyback = params.numeraireBuybackPercentWad;
315
- const beneficiary = params.beneficiaryPercentWad;
316
- const lp = params.lpPercentWad;
317
- if (assetBuyback === void 0 || numeraireBuyback === void 0 || beneficiary === void 0 || lp === void 0) {
318
- throw new Error(
319
- "Rehype feeDistributionInfo is required, or provide all deprecated legacy percentages."
320
- );
321
- }
322
- return {
323
- assetFeesToAssetBuybackWad: assetBuyback,
324
- assetFeesToNumeraireBuybackWad: numeraireBuyback,
325
- assetFeesToBeneficiaryWad: beneficiary,
326
- assetFeesToLpWad: lp,
327
- numeraireFeesToAssetBuybackWad: assetBuyback,
328
- numeraireFeesToNumeraireBuybackWad: numeraireBuyback,
329
- numeraireFeesToBeneficiaryWad: beneficiary,
330
- numeraireFeesToLpWad: lp
331
- };
332
- }
333
- validateRehypeDistribution(feeDistributionInfo) {
334
- const assetRowTotal = feeDistributionInfo.assetFeesToAssetBuybackWad + feeDistributionInfo.assetFeesToNumeraireBuybackWad + feeDistributionInfo.assetFeesToBeneficiaryWad + feeDistributionInfo.assetFeesToLpWad;
335
- if (assetRowTotal !== WAD) {
336
- throw new Error(
337
- `Rehype asset fee distribution must sum to ${WAD} (100%), but got ${assetRowTotal}`
338
- );
339
- }
340
- const numeraireRowTotal = feeDistributionInfo.numeraireFeesToAssetBuybackWad + feeDistributionInfo.numeraireFeesToNumeraireBuybackWad + feeDistributionInfo.numeraireFeesToBeneficiaryWad + feeDistributionInfo.numeraireFeesToLpWad;
341
- if (numeraireRowTotal !== WAD) {
342
- throw new Error(
343
- `Rehype numeraire fee distribution must sum to ${WAD} (100%), but got ${numeraireRowTotal}`
344
- );
345
- }
346
- }
347
- resolveRehypeFeeSchedule(params) {
348
- const MAX_REHYPE_FEE = 1e6;
349
- const startFeeRaw = params.startFee ?? params.customFee;
350
- if (startFeeRaw === void 0) {
351
- throw new Error(
352
- "Rehype startFee is required, or provide deprecated customFee."
353
- );
354
- }
355
- const endFeeRaw = params.endFee ?? startFeeRaw;
356
- const startFee = Number(startFeeRaw);
357
- const endFee = Number(endFeeRaw);
358
- if (!Number.isInteger(startFee) || startFee < 0 || startFee > MAX_REHYPE_FEE) {
359
- throw new Error(
360
- `Rehype startFee must be an integer between 0 and ${MAX_REHYPE_FEE}`
361
- );
362
- }
363
- if (!Number.isInteger(endFee) || endFee < 0 || endFee > MAX_REHYPE_FEE) {
364
- throw new Error(
365
- `Rehype endFee must be an integer between 0 and ${MAX_REHYPE_FEE}`
366
- );
367
- }
368
- if (startFee < endFee) {
369
- throw new Error(
370
- `Rehype startFee (${startFee}) must be greater than or equal to endFee (${endFee})`
371
- );
372
- }
373
- const durationRaw = params.durationSeconds ?? (startFee === endFee ? 0 : void 0);
374
- if (durationRaw === void 0) {
375
- throw new Error(
376
- "Rehype durationSeconds must be provided when startFee is greater than endFee."
377
- );
378
- }
379
- const durationSeconds = this.parseUint32Value(
380
- durationRaw,
381
- "Rehype durationSeconds"
382
- );
383
- if (startFee > endFee && durationSeconds <= 0) {
384
- throw new Error(
385
- "Rehype durationSeconds must be greater than 0 when startFee is greater than endFee."
386
- );
387
- }
388
- const startingTime = params.startingTime === void 0 ? 0 : this.parseStartTimeSeconds(
389
- params.startingTime,
390
- "Rehype startingTime"
391
- );
392
- const feeRoutingMode = this.normalizeRehypeFeeRoutingMode(
393
- params.feeRoutingMode
394
- );
395
- return {
396
- startFee,
397
- endFee,
398
- durationSeconds,
399
- startingTime,
400
- feeRoutingMode
401
- };
402
- }
403
- withVesting(params) {
404
- if (!params) {
405
- this.vesting = void 0;
406
- return this;
407
- }
408
- this.vesting = {
409
- duration: Number(params.duration ?? 0n),
410
- cliffDuration: params.cliffDuration ?? 0,
411
- recipients: params.recipients,
412
- amounts: params.amounts
413
- };
414
- return this;
415
- }
416
- parseStartTimeSeconds(value, label) {
417
- let startTimeSeconds;
418
- if (value instanceof Date) {
419
- startTimeSeconds = Math.floor(value.getTime() / 1e3);
420
- } else if (typeof value === "bigint") {
421
- startTimeSeconds = Number(value);
422
- } else {
423
- startTimeSeconds = Number(value);
424
- }
425
- if (!Number.isFinite(startTimeSeconds) || !Number.isInteger(startTimeSeconds)) {
426
- throw new Error(
427
- `${label} must be an integer number of seconds since Unix epoch`
428
- );
429
- }
430
- if (startTimeSeconds < 0) {
431
- throw new Error(`${label} cannot be negative`);
432
- }
433
- const UINT32_MAX = 4294967295;
434
- if (startTimeSeconds > UINT32_MAX) {
435
- throw new Error(
436
- `${label} must fit within uint32 (seconds since Unix epoch up to year 2106)`
437
- );
438
- }
439
- return startTimeSeconds;
440
- }
441
- assertCanSetInitializer(nextType) {
442
- const currentType = this.initializer?.type;
443
- if (currentType === void 0 || currentType === "standard" || currentType === nextType) {
444
- return;
445
- }
446
- throw new Error(
447
- `Cannot set multicurve initializer to '${nextType}' because it is already configured as '${currentType}'`
448
- );
449
- }
450
- /**
451
- * Configure decay multicurve initializer settings.
452
- *
453
- * The pool's terminal fee is always taken from `poolConfig().fee`.
454
- * `startFee` must be greater than or equal to that terminal fee.
455
- * `startTime` is optional and defaults to `0` when omitted.
456
- */
457
- withDecay(params) {
458
- if (!params) {
459
- if (this.initializer?.type === "decay") {
460
- this.initializer = { type: "standard" };
461
- }
462
- return this;
463
- }
464
- this.assertCanSetInitializer("decay");
465
- const startTime = params.startTime === void 0 ? 0 : this.parseStartTimeSeconds(params.startTime, "Decay startTime");
466
- const startFee = Number(params.startFee);
467
- const durationSeconds = Number(params.durationSeconds);
468
- if (!Number.isFinite(startFee) || !Number.isInteger(startFee)) {
469
- throw new Error("Decay startFee must be an integer");
470
- }
471
- if (startFee < 0 || startFee > DECAY_MAX_START_FEE) {
472
- throw new Error(
473
- `Decay startFee must be between 0 and ${DECAY_MAX_START_FEE} (80%)`
474
- );
475
- }
476
- if (!Number.isFinite(durationSeconds) || !Number.isInteger(durationSeconds)) {
477
- throw new Error("Decay durationSeconds must be an integer");
478
- }
479
- if (durationSeconds < 0) {
480
- throw new Error("Decay durationSeconds cannot be negative");
481
- }
482
- const UINT32_MAX = 4294967295;
483
- if (durationSeconds > UINT32_MAX) {
484
- throw new Error("Decay durationSeconds must fit within uint32");
485
- }
486
- this.schedule = void 0;
487
- this.initializer = {
488
- type: "decay",
489
- startTime,
490
- startFee,
491
- durationSeconds
492
- };
493
- return this;
494
- }
495
- withSchedule(params) {
496
- if (!params) {
497
- if (this.initializer?.type === "scheduled") {
498
- this.initializer = { type: "standard" };
499
- }
500
- this.schedule = void 0;
501
- return this;
502
- }
503
- this.assertCanSetInitializer("scheduled");
504
- const startTimeSeconds = this.parseStartTimeSeconds(
505
- params.startTime,
506
- "Schedule startTime"
507
- );
508
- this.schedule = { startTime: startTimeSeconds };
509
- this.initializer = { type: "scheduled", startTime: startTimeSeconds };
510
- return this;
511
- }
512
- withGovernance(params) {
513
- this.governance = params;
514
- return this;
515
- }
516
- withMigration(migration) {
517
- this.migration = migration;
518
- return this;
519
- }
520
- withUserAddress(address) {
521
- this.userAddress = address;
522
- return this;
523
- }
524
- withIntegrator(address) {
525
- this.integrator = address ?? ZERO_ADDRESS;
526
- return this;
527
- }
528
- withGasLimit(gas) {
529
- this.gasLimit = gas;
530
- return this;
531
- }
532
- overrideModule(key, address) {
533
- this.moduleAddresses = {
534
- ...this.moduleAddresses,
535
- [key]: address
536
- };
537
- return this;
538
- }
539
- withTokenFactory(address) {
540
- return this.overrideModule("tokenFactory", address);
541
- }
542
- withAirlock(address) {
543
- return this.overrideModule("airlock", address);
544
- }
545
- withV4MulticurveInitializer(address) {
546
- return this.overrideModule("v4MulticurveInitializer", address);
547
- }
548
- withV4ScheduledMulticurveInitializer(address) {
549
- return this.overrideModule("v4ScheduledMulticurveInitializer", address);
550
- }
551
- withV4DecayMulticurveInitializer(address) {
552
- return this.overrideModule("v4DecayMulticurveInitializer", address);
553
- }
554
- withGovernanceFactory(address) {
555
- return this.overrideModule("governanceFactory", address);
556
- }
557
- withV2Migrator(address) {
558
- return this.overrideModule("v2Migrator", address);
559
- }
560
- withV4Migrator(address) {
561
- return this.overrideModule("v4Migrator", address);
562
- }
563
- withNoOpMigrator(address) {
564
- return this.overrideModule("noOpMigrator", address);
565
- }
566
- withDopplerHookInitializer(address) {
567
- return this.overrideModule("dopplerHookInitializer", address);
568
- }
569
- build() {
570
- if (!this.token) throw new Error("tokenConfig is required");
571
- if (!this.sale) throw new Error("saleConfig is required");
572
- if (!this.migration) throw new Error("migration configuration is required");
573
- if (!this.userAddress) throw new Error("userAddress is required");
574
- if (this.curvesConfig && !this.pool) {
575
- const config = this.curvesConfig;
576
- const tokenSupply = config.tokenSupply ?? this.sale.initialSupply;
577
- if (!tokenSupply) {
578
- throw new Error(
579
- "tokenSupply must be provided (either via saleConfig() or withCurves() params)"
580
- );
581
- }
582
- const fee = config.fee ?? FEE_TIERS.MEDIUM;
583
- const tickSpacing = config.tickSpacing ?? TICK_SPACINGS[fee];
584
- if (tickSpacing === void 0) {
585
- throw new Error(
586
- `Custom fee ${fee} requires explicit tickSpacing. Standard fees (100, 500, 3000, 10000) auto-derive tickSpacing.`
587
- );
588
- }
589
- const firstCurve = config.curves[0];
590
- const startValidation = validateMarketCapParameters(
591
- firstCurve.marketCap.start,
592
- tokenSupply,
593
- config.tokenDecimals
594
- );
595
- const endValidation = firstCurve.marketCap.end === "max" ? { warnings: [] } : validateMarketCapParameters(
596
- firstCurve.marketCap.end,
597
- tokenSupply,
598
- config.tokenDecimals
599
- );
600
- const allWarnings = [
601
- ...startValidation.warnings,
602
- ...endValidation.warnings
603
- ];
604
- if (allWarnings.length > 0) {
605
- console.warn("First curve market cap validation warnings:");
606
- allWarnings.forEach((w) => console.warn(` - ${w}`));
607
- }
608
- const curves = [];
609
- for (const curve of config.curves) {
610
- const curveTicks = marketCapToTicksForMulticurve({
611
- marketCapLower: curve.marketCap.start,
612
- marketCapUpper: curve.marketCap.end,
613
- tokenSupply,
614
- numerairePriceUSD: config.numerairePrice,
615
- tickSpacing,
616
- tokenDecimals: config.tokenDecimals ?? 18,
617
- numeraireDecimals: config.numeraireDecimals ?? 18
618
- });
619
- curves.push({
620
- tickLower: curveTicks.tickLower,
621
- tickUpper: curveTicks.tickUpper,
622
- numPositions: curve.numPositions,
623
- shares: curve.shares
624
- });
625
- }
626
- const sortedBeneficiaries = config.beneficiaries ? [...config.beneficiaries].sort((a, b) => {
627
- const aAddr = a.beneficiary.toLowerCase();
628
- const bAddr = b.beneficiary.toLowerCase();
629
- return aAddr < bAddr ? -1 : aAddr > bAddr ? 1 : 0;
630
- }) : void 0;
631
- this.pool = {
632
- fee,
633
- tickSpacing,
634
- curves,
635
- beneficiaries: sortedBeneficiaries
636
- };
637
- }
638
- if (!this.pool) throw new Error("poolConfig is required");
639
- if (this.migration.type === "noOp") {
640
- const hasBeneficiaries = this.pool.beneficiaries && this.pool.beneficiaries.length > 0;
641
- if (!hasBeneficiaries) {
642
- throw new Error(
643
- "noOp migration requires beneficiaries. Without beneficiaries, the pool would be stuck after reaching graduation - exitLiquidity() succeeds but NoOpMigrator.migrate() always reverts, causing the entire transaction to fail. Either add beneficiaries or use a different migration type (uniswapV2, uniswapV4)."
644
- );
645
- }
646
- }
647
- let dopplerHook = this.dopplerHook;
648
- if (dopplerHook?.graduationMarketCap !== void 0) {
649
- const numerairePrice = dopplerHook.numerairePrice ?? this.numerairePrice;
650
- if (!numerairePrice) {
651
- throw new Error(
652
- "graduationMarketCap requires numerairePrice. Either use withCurves() (which provides numerairePrice), or pass numerairePrice explicitly in withRehypeDopplerHook()."
653
- );
654
- }
655
- if (dopplerHook.graduationMarketCap <= 0) {
656
- throw new Error("graduationMarketCap must be greater than 0");
657
- }
658
- const farTick = marketCapToTickForMulticurve({
659
- marketCapUSD: dopplerHook.graduationMarketCap,
660
- tokenSupply: this.sale.initialSupply,
661
- numerairePriceUSD: numerairePrice,
662
- tickSpacing: this.pool.tickSpacing,
663
- tokenDecimals: this.tokenDecimals ?? 18,
664
- numeraireDecimals: this.numeraireDecimals ?? 18
665
- });
666
- const allTickUppers = this.pool.curves.map((c) => c.tickUpper);
667
- const allTickLowers = this.pool.curves.map((c) => c.tickLower);
668
- const maxTickUpper = Math.max(...allTickUppers);
669
- const minTickLower = Math.min(...allTickLowers);
670
- if (farTick < minTickLower) {
671
- throw new Error(
672
- `graduationMarketCap converts to tick ${farTick}, which is below the lowest curve tick (${minTickLower})`
673
- );
674
- }
675
- if (farTick > maxTickUpper) {
676
- throw new Error(
677
- `graduationMarketCap converts to tick ${farTick}, which is above the highest curve tick (${maxTickUpper})`
678
- );
679
- }
680
- dopplerHook = { ...dopplerHook, farTick };
681
- }
682
- const initializer = this.initializer ?? (dopplerHook ? { type: "rehype", config: dopplerHook } : this.schedule ? { type: "scheduled", startTime: this.schedule.startTime } : { type: "standard" });
683
- if (initializer.type === "scheduled" && dopplerHook) {
684
- throw new Error(
685
- "Cannot combine scheduled multicurve with rehype initializer. Use exactly one initializer mode."
686
- );
687
- }
688
- if (initializer.type === "decay" && dopplerHook) {
689
- throw new Error(
690
- "Cannot combine decay multicurve with rehype initializer. Use exactly one initializer mode."
691
- );
692
- }
693
- if (initializer.type === "decay") {
694
- const startFee = Number(initializer.startFee);
695
- const terminalFee = Number(this.pool.fee);
696
- if (startFee < terminalFee) {
697
- throw new Error(
698
- `Decay startFee (${startFee}) must be greater than or equal to terminal pool fee (${terminalFee})`
699
- );
700
- }
701
- if (startFee > terminalFee && initializer.durationSeconds <= 0) {
702
- throw new Error(
703
- "Decay durationSeconds must be greater than 0 when startFee is greater than pool.fee"
704
- );
705
- }
706
- }
707
- const schedule = initializer.type === "scheduled" ? { startTime: initializer.startTime } : void 0;
708
- dopplerHook = initializer.type === "rehype" ? initializer.config : void 0;
709
- const governance = this.governance ?? (isNoOpEnabledChain(this.chainId) ? { type: "noOp" } : { type: "default" });
710
- if (governance.type === "launchpad" && !isLaunchpadEnabledChain(this.chainId)) {
711
- throw new Error(
712
- `Launchpad governance is not supported on chain ${this.chainId}. Use a supported chain or a different governance type.`
713
- );
714
- }
715
- return {
716
- token: this.token,
717
- sale: this.sale,
718
- pool: this.pool,
719
- initializer,
720
- schedule,
721
- dopplerHook,
722
- vesting: this.vesting,
723
- governance,
724
- migration: this.migration,
725
- integrator: this.integrator ?? ZERO_ADDRESS,
726
- userAddress: this.userAddress,
727
- modules: this.moduleAddresses,
728
- gas: this.gasLimit
729
- };
730
- }
731
- };
732
-
733
- export { MulticurveBuilder };
734
- //# sourceMappingURL=chunk-QUBD6HUZ.mjs.map
735
- //# sourceMappingURL=chunk-QUBD6HUZ.mjs.map