@whetstone-research/doppler-sdk 0.0.22 → 0.0.24
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.
- package/README.md +553 -221
- package/dist/DopplerSDK.d.mts +12 -0
- package/dist/DopplerSDK.d.ts +12 -0
- package/dist/DopplerSDK.js +29 -26
- package/dist/DopplerSDK.mjs +28 -25
- package/dist/abis/bytecodes/derc20.js +2 -2
- package/dist/abis/bytecodes/derc20.mjs +1 -1
- package/dist/abis/bytecodes/derc2080.js +2 -2
- package/dist/abis/bytecodes/derc2080.mjs +1 -1
- package/dist/abis/bytecodes/doppler.js +2 -2
- package/dist/abis/bytecodes/doppler.mjs +1 -1
- package/dist/abis/bytecodes/dopplerDN404.js +2 -2
- package/dist/abis/bytecodes/dopplerDN404.mjs +1 -1
- package/dist/abis/bytecodes/stateView.js +2 -2
- package/dist/abis/bytecodes/stateView.mjs +1 -1
- package/dist/abis/bytecodes.js +10 -10
- package/dist/abis/bytecodes.mjs +5 -5
- package/dist/abis/index.d.mts +421 -10
- package/dist/abis/index.d.ts +421 -10
- package/dist/abis/index.js +41 -33
- package/dist/abis/index.mjs +6 -6
- package/dist/addresses.d.mts +6 -0
- package/dist/addresses.d.ts +6 -0
- package/dist/addresses.js +7 -7
- package/dist/addresses.mjs +2 -2
- package/dist/builders/DynamicAuctionBuilder.d.mts +2 -0
- package/dist/builders/DynamicAuctionBuilder.d.ts +2 -0
- package/dist/builders/DynamicAuctionBuilder.js +17 -16
- package/dist/builders/DynamicAuctionBuilder.mjs +16 -15
- package/dist/builders/MulticurveBuilder.d.mts +18 -5
- package/dist/builders/MulticurveBuilder.d.ts +18 -5
- package/dist/builders/MulticurveBuilder.js +17 -16
- package/dist/builders/MulticurveBuilder.mjs +16 -15
- package/dist/builders/StaticAuctionBuilder.js +17 -16
- package/dist/builders/StaticAuctionBuilder.mjs +16 -15
- package/dist/builders/index.js +25 -24
- package/dist/builders/index.mjs +18 -17
- package/dist/builders/shared.d.mts +1 -1
- package/dist/builders/shared.d.ts +1 -1
- package/dist/builders/shared.js +19 -17
- package/dist/builders/shared.mjs +15 -13
- package/dist/{chunk-3XYDN2XB.js → chunk-2A3B3NVB.js} +170 -25
- package/dist/chunk-2A3B3NVB.js.map +1 -0
- package/dist/{chunk-AZOBEWP3.mjs → chunk-3NMGCQJ4.mjs} +2 -2
- package/dist/chunk-3NMGCQJ4.mjs.map +1 -0
- package/dist/{chunk-CUB4F546.js → chunk-44CYUEPG.js} +25 -13
- package/dist/chunk-44CYUEPG.js.map +1 -0
- package/dist/{chunk-AZH2P4JK.mjs → chunk-5GQJRNFL.mjs} +3 -3
- package/dist/{chunk-AZH2P4JK.mjs.map → chunk-5GQJRNFL.mjs.map} +1 -1
- package/dist/{chunk-ZDTJ3BPS.js → chunk-5JHXBDZD.js} +20 -20
- package/dist/{chunk-ZDTJ3BPS.js.map → chunk-5JHXBDZD.js.map} +1 -1
- package/dist/{chunk-OGYWNJGI.js → chunk-5TQOT6CW.js} +2 -2
- package/dist/chunk-5TQOT6CW.js.map +1 -0
- package/dist/{chunk-COOVGAOE.js → chunk-65CESA3J.js} +19 -13
- package/dist/chunk-65CESA3J.js.map +1 -0
- package/dist/{chunk-5VV7STYK.js → chunk-7A4DBBXA.js} +141 -101
- package/dist/chunk-7A4DBBXA.js.map +1 -0
- package/dist/chunk-7ZUV6WPX.mjs +3 -0
- package/dist/{chunk-5TL5V6UX.mjs.map → chunk-7ZUV6WPX.mjs.map} +1 -1
- package/dist/{chunk-RXUJ4DUB.js → chunk-A2CJYRRQ.js} +28 -28
- package/dist/{chunk-RXUJ4DUB.js.map → chunk-A2CJYRRQ.js.map} +1 -1
- package/dist/{chunk-QQEOKYEX.js → chunk-BK3S6SVR.js} +383 -83
- package/dist/chunk-BK3S6SVR.js.map +1 -0
- package/dist/{chunk-S4IZ5ATO.js → chunk-BQZTELUX.js} +5 -5
- package/dist/{chunk-S4IZ5ATO.js.map → chunk-BQZTELUX.js.map} +1 -1
- package/dist/{chunk-WKKOBMXR.js → chunk-CFXXUZJY.js} +57 -22
- package/dist/chunk-CFXXUZJY.js.map +1 -0
- package/dist/chunk-DCWF3EMP.js +171 -0
- package/dist/chunk-DCWF3EMP.js.map +1 -0
- package/dist/{chunk-YWK6YH6M.mjs → chunk-DQJXCZU2.mjs} +5 -5
- package/dist/{chunk-YWK6YH6M.mjs.map → chunk-DQJXCZU2.mjs.map} +1 -1
- package/dist/chunk-DSYPZETD.js +4 -0
- package/dist/{chunk-3PNCB4W5.js.map → chunk-DSYPZETD.js.map} +1 -1
- package/dist/chunk-F2BYG63D.mjs +145 -0
- package/dist/chunk-F2BYG63D.mjs.map +1 -0
- package/dist/{chunk-N33R22A2.js → chunk-FNUBKONK.js} +2 -2
- package/dist/{chunk-N33R22A2.js.map → chunk-FNUBKONK.js.map} +1 -1
- package/dist/chunk-FXTGIKQG.mjs +3 -0
- package/dist/{chunk-SD7BHT2F.mjs.map → chunk-FXTGIKQG.mjs.map} +1 -1
- package/dist/{chunk-MQNSJCAW.mjs → chunk-GSBQIVME.mjs} +2 -2
- package/dist/{chunk-MQNSJCAW.mjs.map → chunk-GSBQIVME.mjs.map} +1 -1
- package/dist/{chunk-SAX7P3MH.js → chunk-HJFVRV47.js} +2 -2
- package/dist/{chunk-SAX7P3MH.js.map → chunk-HJFVRV47.js.map} +1 -1
- package/dist/chunk-IIM2CSDQ.js +147 -0
- package/dist/chunk-IIM2CSDQ.js.map +1 -0
- package/dist/{chunk-O3RH43H3.mjs → chunk-IUTIHSLH.mjs} +4 -4
- package/dist/{chunk-O3RH43H3.mjs.map → chunk-IUTIHSLH.mjs.map} +1 -1
- package/dist/chunk-IUZ3BBQP.mjs +117 -0
- package/dist/chunk-IUZ3BBQP.mjs.map +1 -0
- package/dist/{chunk-D7PCIMWU.mjs → chunk-IX4V4UGW.mjs} +4 -4
- package/dist/{chunk-D7PCIMWU.mjs.map → chunk-IX4V4UGW.mjs.map} +1 -1
- package/dist/{chunk-2ZM4JVFC.js → chunk-J62YDWIK.js} +2 -2
- package/dist/chunk-J62YDWIK.js.map +1 -0
- package/dist/{chunk-E2NF4AQB.mjs → chunk-JLUOFAE4.mjs} +272 -12
- package/dist/chunk-JLUOFAE4.mjs.map +1 -0
- package/dist/{chunk-KITPRKQ4.mjs → chunk-LW3CYA27.mjs} +351 -51
- package/dist/chunk-LW3CYA27.mjs.map +1 -0
- package/dist/{chunk-3L4DLMOK.js → chunk-MEA2C5YX.js} +16 -16
- package/dist/{chunk-3L4DLMOK.js.map → chunk-MEA2C5YX.js.map} +1 -1
- package/dist/{chunk-3MVW6UIW.js → chunk-MU56HCUI.js} +273 -11
- package/dist/chunk-MU56HCUI.js.map +1 -0
- package/dist/chunk-OCIY7QEJ.mjs +169 -0
- package/dist/chunk-OCIY7QEJ.mjs.map +1 -0
- package/dist/{chunk-WDSV4O6T.mjs → chunk-OHA5KJ2M.mjs} +2 -2
- package/dist/chunk-OHA5KJ2M.mjs.map +1 -0
- package/dist/{chunk-MT34O3YL.js → chunk-P563HTVU.js} +50 -26
- package/dist/chunk-P563HTVU.js.map +1 -0
- package/dist/{chunk-RLUMYHPI.js → chunk-PGYTMRP3.js} +46 -18
- package/dist/chunk-PGYTMRP3.js.map +1 -0
- package/dist/{chunk-VGOEXLQ2.js → chunk-QAPQGDWK.js} +2 -2
- package/dist/chunk-QAPQGDWK.js.map +1 -0
- package/dist/{chunk-QOGBOT2M.mjs → chunk-QHBKRUBY.mjs} +3 -3
- package/dist/{chunk-QOGBOT2M.mjs.map → chunk-QHBKRUBY.mjs.map} +1 -1
- package/dist/chunk-QOYI7WCH.js +120 -0
- package/dist/chunk-QOYI7WCH.js.map +1 -0
- package/dist/{chunk-OF7BIKXV.js → chunk-QRTABC4Z.js} +2 -2
- package/dist/chunk-QRTABC4Z.js.map +1 -0
- package/dist/{chunk-CS6FVODR.mjs → chunk-QUBD6HUZ.mjs} +163 -18
- package/dist/chunk-QUBD6HUZ.mjs.map +1 -0
- package/dist/{chunk-RWVNXU7Z.mjs → chunk-RDTIXP6S.mjs} +4 -4
- package/dist/{chunk-RWVNXU7Z.mjs.map → chunk-RDTIXP6S.mjs.map} +1 -1
- package/dist/{chunk-5WYXNWNH.js → chunk-RLOZWHRR.js} +11 -11
- package/dist/{chunk-5WYXNWNH.js.map → chunk-RLOZWHRR.js.map} +1 -1
- package/dist/{chunk-VK5HAWX6.mjs → chunk-SWWLOD7Q.mjs} +2 -2
- package/dist/chunk-SWWLOD7Q.mjs.map +1 -0
- package/dist/chunk-T3UA4MJL.js +4 -0
- package/dist/{chunk-WTS75RUC.js.map → chunk-T3UA4MJL.js.map} +1 -1
- package/dist/{chunk-HJ4AS5DZ.mjs → chunk-TEWAXP5C.mjs} +36 -12
- package/dist/chunk-TEWAXP5C.mjs.map +1 -0
- package/dist/{chunk-ZRNPHFP3.mjs → chunk-THEIRDGE.mjs} +50 -15
- package/dist/chunk-THEIRDGE.mjs.map +1 -0
- package/dist/{chunk-LPA32BIK.mjs → chunk-U3GOWK6J.mjs} +2 -2
- package/dist/chunk-U3GOWK6J.mjs.map +1 -0
- package/dist/{chunk-QFQXHDC7.mjs → chunk-VKSD3KXF.mjs} +46 -18
- package/dist/chunk-VKSD3KXF.mjs.map +1 -0
- package/dist/{chunk-64ZQRKG3.mjs → chunk-VYSOAGRU.mjs} +2 -2
- package/dist/chunk-VYSOAGRU.mjs.map +1 -0
- package/dist/{chunk-ADAAU4F5.mjs → chunk-WDC53TM7.mjs} +49 -9
- package/dist/chunk-WDC53TM7.mjs.map +1 -0
- package/dist/{chunk-M2EMKIP5.mjs → chunk-WKWP42TD.mjs} +9 -4
- package/dist/chunk-WKWP42TD.mjs.map +1 -0
- package/dist/{chunk-OROTK4OT.js → chunk-WNUB3UTT.js} +12 -12
- package/dist/chunk-WNUB3UTT.js.map +1 -0
- package/dist/{chunk-FVTTG72Z.mjs → chunk-WNWK2QMU.mjs} +19 -7
- package/dist/chunk-WNWK2QMU.mjs.map +1 -0
- package/dist/{chunk-INLXNN7P.js → chunk-WZF5XNBC.js} +26 -26
- package/dist/{chunk-INLXNN7P.js.map → chunk-WZF5XNBC.js.map} +1 -1
- package/dist/{chunk-SMTHFPBA.js → chunk-XMFOZYNI.js} +2 -2
- package/dist/chunk-XMFOZYNI.js.map +1 -0
- package/dist/{chunk-VGCXJRUV.mjs → chunk-YBK6EBA5.mjs} +10 -10
- package/dist/chunk-YBK6EBA5.mjs.map +1 -0
- package/dist/{chunk-HH7HQ4HC.mjs → chunk-ZEDJUNC6.mjs} +2 -2
- package/dist/{chunk-HH7HQ4HC.mjs.map → chunk-ZEDJUNC6.mjs.map} +1 -1
- package/dist/deployments.generated.d.mts +44 -16
- package/dist/deployments.generated.d.ts +44 -16
- package/dist/deployments.generated.js +2 -2
- package/dist/deployments.generated.mjs +1 -1
- package/dist/entities/DopplerFactory.d.mts +7 -1
- package/dist/entities/DopplerFactory.d.ts +7 -1
- package/dist/entities/DopplerFactory.js +16 -14
- package/dist/entities/DopplerFactory.mjs +15 -13
- package/dist/entities/auction/DynamicAuction.js +10 -10
- package/dist/entities/auction/DynamicAuction.mjs +9 -9
- package/dist/entities/auction/MulticurvePool.d.mts +6 -2
- package/dist/entities/auction/MulticurvePool.d.ts +6 -2
- package/dist/entities/auction/MulticurvePool.js +11 -11
- package/dist/entities/auction/MulticurvePool.mjs +10 -10
- package/dist/entities/auction/RehypeDopplerHook.d.mts +57 -0
- package/dist/entities/auction/RehypeDopplerHook.d.ts +57 -0
- package/dist/entities/auction/RehypeDopplerHook.js +34 -0
- package/dist/entities/auction/RehypeDopplerHook.js.map +1 -0
- package/dist/entities/auction/RehypeDopplerHook.mjs +25 -0
- package/dist/entities/auction/RehypeDopplerHook.mjs.map +1 -0
- package/dist/entities/auction/RehypeDopplerHookMigrator.d.mts +48 -0
- package/dist/entities/auction/RehypeDopplerHookMigrator.d.ts +48 -0
- package/dist/entities/auction/RehypeDopplerHookMigrator.js +34 -0
- package/dist/entities/auction/RehypeDopplerHookMigrator.js.map +1 -0
- package/dist/entities/auction/RehypeDopplerHookMigrator.mjs +25 -0
- package/dist/entities/auction/RehypeDopplerHookMigrator.mjs.map +1 -0
- package/dist/entities/auction/StaticAuction.js +10 -10
- package/dist/entities/auction/StaticAuction.mjs +9 -9
- package/dist/entities/auction/index.d.mts +2 -0
- package/dist/entities/auction/index.d.ts +2 -0
- package/dist/entities/auction/index.js +38 -18
- package/dist/entities/auction/index.mjs +25 -13
- package/dist/entities/quoter/Quoter.js +10 -10
- package/dist/entities/quoter/Quoter.mjs +9 -9
- package/dist/entities/quoter/index.js +10 -10
- package/dist/entities/quoter/index.mjs +9 -9
- package/dist/entities/token/derc20/Derc20.js +8 -8
- package/dist/entities/token/derc20/Derc20.mjs +7 -7
- package/dist/entities/token/derc20/index.js +8 -8
- package/dist/entities/token/derc20/index.mjs +7 -7
- package/dist/entities/token/index.js +11 -11
- package/dist/entities/token/index.mjs +7 -7
- package/dist/index.d.mts +5 -2
- package/dist/index.d.ts +5 -2
- package/dist/index.js +120 -93
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +28 -25
- package/dist/index.mjs.map +1 -1
- package/dist/types.d.mts +90 -7
- package/dist/types.d.ts +90 -7
- package/dist/types.js +12 -8
- package/dist/types.mjs +3 -3
- package/dist/utils/airlock.js +7 -7
- package/dist/utils/airlock.mjs +3 -3
- package/dist/utils/dopplerHookMigrator.d.mts +18 -0
- package/dist/utils/dopplerHookMigrator.d.ts +18 -0
- package/dist/utils/dopplerHookMigrator.js +20 -0
- package/dist/utils/dopplerHookMigrator.js.map +1 -0
- package/dist/utils/dopplerHookMigrator.mjs +7 -0
- package/dist/utils/dopplerHookMigrator.mjs.map +1 -0
- package/dist/utils/index.d.mts +1 -0
- package/dist/utils/index.d.ts +1 -0
- package/dist/utils/index.js +39 -32
- package/dist/utils/index.mjs +15 -12
- package/dist/utils/marketCapHelpers.js +13 -13
- package/dist/utils/marketCapHelpers.mjs +1 -1
- package/dist/utils/tokenAddressMiner.js +8 -8
- package/dist/utils/tokenAddressMiner.mjs +7 -7
- package/package.json +2 -2
- package/dist/chunk-2ZM4JVFC.js.map +0 -1
- package/dist/chunk-3MVW6UIW.js.map +0 -1
- package/dist/chunk-3PNCB4W5.js +0 -4
- package/dist/chunk-3XYDN2XB.js.map +0 -1
- package/dist/chunk-5TL5V6UX.mjs +0 -3
- package/dist/chunk-5VV7STYK.js.map +0 -1
- package/dist/chunk-64ZQRKG3.mjs.map +0 -1
- package/dist/chunk-ADAAU4F5.mjs.map +0 -1
- package/dist/chunk-AZOBEWP3.mjs.map +0 -1
- package/dist/chunk-COOVGAOE.js.map +0 -1
- package/dist/chunk-CS6FVODR.mjs.map +0 -1
- package/dist/chunk-CUB4F546.js.map +0 -1
- package/dist/chunk-E2NF4AQB.mjs.map +0 -1
- package/dist/chunk-FVTTG72Z.mjs.map +0 -1
- package/dist/chunk-HJ4AS5DZ.mjs.map +0 -1
- package/dist/chunk-KITPRKQ4.mjs.map +0 -1
- package/dist/chunk-LPA32BIK.mjs.map +0 -1
- package/dist/chunk-M2EMKIP5.mjs.map +0 -1
- package/dist/chunk-MT34O3YL.js.map +0 -1
- package/dist/chunk-OF7BIKXV.js.map +0 -1
- package/dist/chunk-OGYWNJGI.js.map +0 -1
- package/dist/chunk-OROTK4OT.js.map +0 -1
- package/dist/chunk-QFQXHDC7.mjs.map +0 -1
- package/dist/chunk-QQEOKYEX.js.map +0 -1
- package/dist/chunk-RLUMYHPI.js.map +0 -1
- package/dist/chunk-SD7BHT2F.mjs +0 -3
- package/dist/chunk-SMTHFPBA.js.map +0 -1
- package/dist/chunk-VGCXJRUV.mjs.map +0 -1
- package/dist/chunk-VGOEXLQ2.js.map +0 -1
- package/dist/chunk-VK5HAWX6.mjs.map +0 -1
- package/dist/chunk-WDSV4O6T.mjs.map +0 -1
- package/dist/chunk-WKKOBMXR.js.map +0 -1
- package/dist/chunk-WTS75RUC.js +0 -4
- package/dist/chunk-ZRNPHFP3.mjs.map +0 -1
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../src/builders/DynamicAuctionBuilder.ts"],"names":["DEFAULT_V4_YEARLY_MINT_RATE","ZERO_ADDRESS","DOPPLER_MAX_TICK_SPACING","DEFAULT_AUCTION_DURATION","DEFAULT_EPOCH_LENGTH","computeOptimalGamma","computeTicks","V4_MAX_FEE","FEE_TIERS","validateMarketCapParameters","marketCapToTicksForDynamicAuction","gamma","isNoOpEnabledChain","isLaunchpadEnabledChain"],"mappings":";;;;;;;;;AA8BO,IAAM,qBAAA,GAAN,MAAM,sBAAA,CAEsB;AAAA,EAgCjC,YAAY,OAAA,EAAY;AACtB,IAAA,IAAA,CAAK,OAAA,GAAU,OAAA;AAAA,EACjB;AAAA,EAEA,OAAO,SACL,OAAA,EAC0B;AAC1B,IAAA,OAAO,IAAI,uBAAsB,OAAO,CAAA;AAAA,EAC1C;AAAA,EAEA,YACE,MAAA,EAeM;AACN,IAAA,IAAI,MAAA,IAAU,MAAA,IAAU,MAAA,IAAU,MAAA,CAAO,SAAS,YAAA,EAAc;AAC9D,MAAA,IAAA,CAAK,KAAA,GAAQ;AAAA,QACX,IAAA,EAAM,YAAA;AAAA,QACN,MAAM,MAAA,CAAO,IAAA;AAAA,QACb,QAAQ,MAAA,CAAO,MAAA;AAAA,QACf,SAAS,MAAA,CAAO,OAAA;AAAA,QAChB,MAAM,MAAA,CAAO;AAAA,OACf;AAAA,IACF,CAAA,MAAO;AACL,MAAA,IAAA,CAAK,KAAA,GAAQ;AAAA,QACX,IAAA,EAAM,UAAA;AAAA,QACN,MAAM,MAAA,CAAO,IAAA;AAAA,QACb,QAAQ,MAAA,CAAO,MAAA;AAAA,QACf,UAAU,MAAA,CAAO,QAAA;AAAA,QACjB,cAAA,EAAgB,OAAO,cAAA,IAAkBA;AAAA,OAC3C;AAAA,IACF;AACA,IAAA,OAAO,IAAA;AAAA,EACT;AAAA,EAEA,WAAW,MAAA,EAIF;AACP,IAAA,IAAA,CAAK,IAAA,GAAO;AAAA,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,MAAM,OAAA,GAAU,EAAE,GAAG,IAAA,CAAK,SAAS,KAAA,EAAM;AAEzC,IAAA,OAAO;AAAA,MACL,OAAO,IAAA,CAAK,KAAA;AAAA,MACZ,MAAM,IAAA,CAAK,IAAA;AAAA,MACX,OAAA;AAAA,MACA,MAAM,IAAA,CAAK,IAAA;AAAA,MACX,SAAS,IAAA,CAAK,OAAA;AAAA,MACd,UAAA;AAAA,MACA,WAAW,IAAA,CAAK,SAAA;AAAA,MAChB,UAAA,EAAY,KAAK,UAAA,IAAcJ,6BAAA;AAAA,MAC/B,aAAa,IAAA,CAAK,WAAA;AAAA,MAClB,iBAAiB,IAAA,CAAK,eAAA;AAAA,MACtB,gBAAgB,IAAA,CAAK,cAAA;AAAA,MACrB,SAAS,IAAA,CAAK,eAAA;AAAA,MACd,KAAK,IAAA,CAAK;AAAA,KACZ;AAAA,EACF;AACF","file":"chunk-44CYUEPG.js","sourcesContent":["import type { Address } from 'viem';\nimport {\n DEFAULT_AUCTION_DURATION,\n DEFAULT_EPOCH_LENGTH,\n DEFAULT_V4_YEARLY_MINT_RATE,\n DOPPLER_MAX_TICK_SPACING,\n FEE_TIERS,\n V4_MAX_FEE,\n ZERO_ADDRESS,\n} from '../constants';\nimport {\n computeOptimalGamma,\n marketCapToTicksForDynamicAuction,\n validateMarketCapParameters,\n} from '../utils';\nimport {\n isNoOpEnabledChain,\n isLaunchpadEnabledChain,\n type CreateDynamicAuctionParams,\n type GovernanceOption,\n type MigrationConfig,\n type PriceRange,\n type VestingConfig,\n type TokenConfig,\n type DynamicAuctionMarketCapConfig,\n type ModuleAddressOverrides,\n} from '../types';\nimport { type SupportedChainId } from '../addresses';\nimport { computeTicks, type BaseAuctionBuilder } from './shared';\n\nexport class DynamicAuctionBuilder<\n C extends SupportedChainId,\n> implements BaseAuctionBuilder<C> {\n private token?: TokenConfig;\n private sale?: CreateDynamicAuctionParams<C>['sale'];\n private auction?: CreateDynamicAuctionParams<C>['auction'];\n private pool?: CreateDynamicAuctionParams<C>['pool'];\n private vesting?: VestingConfig;\n private governance?: GovernanceOption<C>;\n private migration?: MigrationConfig;\n private integrator?: Address;\n private userAddress?: Address;\n private startTimeOffset?: number;\n private blockTimestamp?: number;\n private moduleAddresses?: ModuleAddressOverrides;\n private gasLimit?: bigint;\n // Deferred market cap config - converted to pool and auction in build()\n private marketCapConfig?: {\n marketCap: { start: number; min: number };\n numerairePrice: number;\n tokenSupply?: bigint;\n tokenDecimals?: number;\n numeraireDecimals?: number;\n fee?: number;\n tickSpacing?: number;\n minProceeds: bigint;\n maxProceeds: bigint;\n duration?: number;\n epochLength?: number;\n gamma?: number;\n numPdSlugs?: number;\n };\n public chainId: C;\n\n constructor(chainId: C) {\n this.chainId = chainId;\n }\n\n static forChain<C extends SupportedChainId>(\n chainId: C,\n ): DynamicAuctionBuilder<C> {\n return new DynamicAuctionBuilder(chainId);\n }\n\n tokenConfig(\n params:\n | {\n type?: 'standard';\n name: string;\n symbol: string;\n tokenURI: string;\n yearlyMintRate?: bigint;\n }\n | {\n type: 'doppler404';\n name: string;\n symbol: string;\n baseURI: string;\n unit?: bigint;\n },\n ): this {\n if (params && 'type' in params && params.type === 'doppler404') {\n this.token = {\n type: 'doppler404',\n name: params.name,\n symbol: params.symbol,\n baseURI: params.baseURI,\n unit: params.unit,\n };\n } else {\n this.token = {\n type: 'standard',\n name: params.name,\n symbol: params.symbol,\n tokenURI: params.tokenURI,\n yearlyMintRate: params.yearlyMintRate ?? DEFAULT_V4_YEARLY_MINT_RATE,\n };\n }\n return this;\n }\n\n saleConfig(params: {\n initialSupply: bigint;\n numTokensToSell: bigint;\n numeraire?: Address;\n }): this {\n this.sale = {\n initialSupply: params.initialSupply,\n numTokensToSell: params.numTokensToSell,\n numeraire: params.numeraire ?? ZERO_ADDRESS,\n };\n return this;\n }\n\n poolConfig(params: { fee: number; tickSpacing: number }): this {\n // Mutual exclusion: cannot use poolConfig() after withMarketCapRange()\n if (this.marketCapConfig) {\n throw new Error(\n 'Cannot use poolConfig() after withMarketCapRange(). ' +\n 'Use withMarketCapRange() for market cap-based configuration, ' +\n 'or poolConfig() + auctionByTicks() for manual tick configuration.',\n );\n }\n\n // Validate tick spacing against Doppler contract constraint\n if (params.tickSpacing > DOPPLER_MAX_TICK_SPACING) {\n throw new Error(\n `Dynamic auctions require tickSpacing <= ${DOPPLER_MAX_TICK_SPACING} (Doppler.sol MAX_TICK_SPACING). ` +\n `Got tickSpacing=${params.tickSpacing}. ` +\n `Use a smaller tickSpacing, or use withMarketCapRange() which handles this automatically.`,\n );\n }\n\n this.pool = { fee: params.fee, tickSpacing: params.tickSpacing };\n return this;\n }\n\n // Provide ticks directly\n auctionByTicks(params: {\n startTick: number;\n endTick: number;\n minProceeds: bigint;\n maxProceeds: bigint;\n duration?: number;\n epochLength?: number;\n gamma?: number;\n numPdSlugs?: number;\n }): this {\n const duration = params.duration ?? DEFAULT_AUCTION_DURATION;\n const epochLength = params.epochLength ?? DEFAULT_EPOCH_LENGTH;\n const gamma =\n params.gamma ??\n (this.pool\n ? computeOptimalGamma(\n params.startTick,\n params.endTick,\n duration,\n epochLength,\n this.pool.tickSpacing,\n )\n : undefined);\n this.auction = {\n duration,\n epochLength,\n startTick: params.startTick,\n endTick: params.endTick,\n gamma,\n minProceeds: params.minProceeds,\n maxProceeds: params.maxProceeds,\n numPdSlugs: params.numPdSlugs,\n };\n return this;\n }\n\n /**\n * @deprecated Use withMarketCapRange() instead for more intuitive market cap configuration\n */\n auctionByPriceRange(params: {\n priceRange: PriceRange;\n minProceeds: bigint;\n maxProceeds: bigint;\n duration?: number;\n epochLength?: number;\n gamma?: number;\n tickSpacing?: number; // optional; will use pool.tickSpacing if not provided\n numPdSlugs?: number;\n }): this {\n const tickSpacing = params.tickSpacing ?? this.pool?.tickSpacing;\n if (!tickSpacing) {\n throw new Error(\n 'tickSpacing is required (set poolConfig first or pass tickSpacing)',\n );\n }\n const ticks = computeTicks(params.priceRange, tickSpacing);\n return this.auctionByTicks({\n startTick: ticks.startTick,\n endTick: ticks.endTick,\n minProceeds: params.minProceeds,\n maxProceeds: params.maxProceeds,\n duration: params.duration,\n epochLength: params.epochLength,\n gamma: params.gamma,\n numPdSlugs: params.numPdSlugs,\n });\n }\n\n /**\n * Configure auction using target market cap range.\n * Converts market cap values (in USD) to Uniswap ticks.\n *\n * V4 pools support custom fees (0-100,000). Standard fee tiers auto-derive\n * tickSpacing; custom fees require explicit tickSpacing (max: 30).\n *\n * @param params - Market cap configuration with auction parameters\n * @returns Builder instance for chaining\n *\n * @example Standard fee tier (auto tickSpacing)\n * ```ts\n * builder\n * .saleConfig({ initialSupply, numTokensToSell, numeraire: WETH })\n * .withMarketCapRange({\n * marketCap: { start: 500_000, min: 50_000 },\n * numerairePrice: 3000,\n * minProceeds: parseEther('10'),\n * maxProceeds: parseEther('1000'),\n * fee: 10000, // Standard tier, tickSpacing auto = 30\n * })\n * ```\n *\n * @example Custom fee (requires explicit tickSpacing)\n * ```ts\n * builder\n * .saleConfig({ initialSupply, numTokensToSell, numeraire: WETH })\n * .withMarketCapRange({\n * marketCap: { start: 500_000, min: 50_000 },\n * numerairePrice: 3000,\n * minProceeds: parseEther('10'),\n * maxProceeds: parseEther('1000'),\n * fee: 2500, // Custom 0.25% fee\n * tickSpacing: 10, // Required for custom fees\n * })\n * ```\n */\n withMarketCapRange(params: DynamicAuctionMarketCapConfig): this {\n // Mutual exclusion: cannot use withMarketCapRange() after poolConfig()\n if (this.pool) {\n throw new Error(\n 'Cannot use withMarketCapRange() after poolConfig(). ' +\n 'Use withMarketCapRange() for market cap-based configuration, ' +\n 'or poolConfig() + auctionByTicks() for manual tick configuration.',\n );\n }\n\n // Basic validation that doesn't require saleConfig\n if (params.numerairePrice <= 0) {\n throw new Error('numerairePrice must be greater than 0');\n }\n if (params.marketCap.start <= 0 || params.marketCap.min <= 0) {\n throw new Error('marketCap values must be greater than 0');\n }\n if (params.marketCap.min >= params.marketCap.start) {\n throw new Error('marketCap.min must be less than marketCap.start');\n }\n\n // Validate fee if provided\n if (params.fee !== undefined && params.fee > V4_MAX_FEE) {\n throw new Error(\n `Fee ${params.fee} exceeds maximum allowed for V4 pools (${V4_MAX_FEE} = 10%). ` +\n `Use a fee between 0 and ${V4_MAX_FEE}.`,\n );\n }\n\n // Validate tickSpacing if provided\n if (\n params.tickSpacing !== undefined &&\n params.tickSpacing > DOPPLER_MAX_TICK_SPACING\n ) {\n throw new Error(\n `tickSpacing ${params.tickSpacing} exceeds maximum allowed for Doppler pools (${DOPPLER_MAX_TICK_SPACING}). ` +\n `Use tickSpacing <= ${DOPPLER_MAX_TICK_SPACING}.`,\n );\n }\n\n // Store config for deferred conversion in build()\n this.marketCapConfig = {\n marketCap: params.marketCap,\n numerairePrice: params.numerairePrice,\n tokenSupply: params.tokenSupply,\n tokenDecimals: params.tokenDecimals,\n numeraireDecimals: params.numeraireDecimals,\n fee: params.fee,\n tickSpacing: params.tickSpacing,\n minProceeds: params.minProceeds,\n maxProceeds: params.maxProceeds,\n duration: params.duration,\n epochLength: params.epochLength,\n gamma: params.gamma,\n numPdSlugs: params.numPdSlugs,\n };\n\n return this;\n }\n\n withVesting(params?: {\n duration?: bigint;\n cliffDuration?: number;\n recipients?: Address[];\n amounts?: bigint[];\n }): this {\n if (!params) {\n this.vesting = undefined;\n return this;\n }\n this.vesting = {\n duration: Number(params.duration ?? 0n),\n cliffDuration: params.cliffDuration ?? 0,\n recipients: params.recipients,\n amounts: params.amounts,\n };\n return this;\n }\n\n withGovernance(params: GovernanceOption<C>): this {\n this.governance = params;\n return this;\n }\n\n withMigration(migration: MigrationConfig): this {\n this.migration = migration;\n return this;\n }\n\n withUserAddress(address: Address): this {\n this.userAddress = address;\n return this;\n }\n\n withIntegrator(address?: Address): this {\n this.integrator = address ?? ZERO_ADDRESS;\n return this;\n }\n\n withGasLimit(gas?: bigint): this {\n this.gasLimit = gas;\n return this;\n }\n\n withTime(params?: {\n startTimeOffset?: number;\n blockTimestamp?: number;\n }): this {\n if (!params) {\n this.startTimeOffset = undefined;\n this.blockTimestamp = undefined;\n return this;\n }\n this.startTimeOffset = params.startTimeOffset;\n this.blockTimestamp = params.blockTimestamp;\n return this;\n }\n\n // Address override helpers\n private overrideModule<K extends keyof ModuleAddressOverrides>(\n key: K,\n address: NonNullable<ModuleAddressOverrides[K]>,\n ): this {\n this.moduleAddresses = {\n ...this.moduleAddresses,\n [key]: address,\n } as ModuleAddressOverrides;\n return this;\n }\n\n withTokenFactory(address: Address): this {\n return this.overrideModule('tokenFactory', address);\n }\n\n withAirlock(address: Address): this {\n return this.overrideModule('airlock', address);\n }\n\n withV4Initializer(address: Address): this {\n return this.overrideModule('v4Initializer', address);\n }\n\n withPoolManager(address: Address): this {\n return this.overrideModule('poolManager', address);\n }\n\n withDopplerDeployer(address: Address): this {\n return this.overrideModule('dopplerDeployer', address);\n }\n\n withGovernanceFactory(address: Address): this {\n return this.overrideModule('governanceFactory', address);\n }\n\n withV2Migrator(address: Address): this {\n return this.overrideModule('v2Migrator', address);\n }\n\n withV4Migrator(address: Address): this {\n return this.overrideModule('v4Migrator', address);\n }\n\n withDopplerHookMigrator(address: Address): this {\n return this.overrideModule('dopplerHookMigrator', address);\n }\n\n withRehypeDopplerHookMigrator(address: Address): this {\n return this.overrideModule('rehypeDopplerHookMigrator', address);\n }\n\n withNoOpMigrator(address: Address): this {\n return this.overrideModule('noOpMigrator', address);\n }\n\n build(): CreateDynamicAuctionParams<C> {\n if (!this.token) throw new Error('tokenConfig is required');\n if (!this.sale) throw new Error('saleConfig is required');\n if (!this.migration) throw new Error('migration configuration is required');\n if (!this.userAddress) throw new Error('userAddress is required');\n\n // Convert deferred market cap config to pool and auction if set\n if (this.marketCapConfig && !this.pool) {\n const config = this.marketCapConfig;\n\n // Get token supply from config or saleConfig\n const tokenSupply = config.tokenSupply ?? this.sale.initialSupply;\n if (!tokenSupply) {\n throw new Error(\n 'tokenSupply must be provided (either via saleConfig() or withMarketCapRange() params)',\n );\n }\n\n // Derive fee and tickSpacing\n const fee = config.fee ?? FEE_TIERS.HIGH;\n const tickSpacing = config.tickSpacing ?? DOPPLER_MAX_TICK_SPACING;\n\n // Set pool config\n this.pool = { fee, tickSpacing };\n\n // Validate market cap parameters\n const startValidation = validateMarketCapParameters(\n config.marketCap.start,\n tokenSupply,\n config.tokenDecimals,\n );\n const minValidation = validateMarketCapParameters(\n config.marketCap.min,\n tokenSupply,\n config.tokenDecimals,\n );\n\n const allWarnings = [\n ...startValidation.warnings,\n ...minValidation.warnings,\n ];\n if (allWarnings.length > 0) {\n console.warn('Market cap validation warnings:');\n allWarnings.forEach((w) => console.warn(` - ${w}`));\n }\n\n // Convert market cap range to ticks for V4 Dynamic auction\n const { startTick, endTick } = marketCapToTicksForDynamicAuction({\n marketCapRange: {\n start: config.marketCap.min,\n end: config.marketCap.start,\n },\n tokenSupply,\n numerairePriceUSD: config.numerairePrice,\n numeraire: this.sale.numeraire,\n tickSpacing,\n tokenDecimals: config.tokenDecimals ?? 18,\n numeraireDecimals: config.numeraireDecimals ?? 18,\n });\n\n // Set auction config\n const duration = config.duration ?? DEFAULT_AUCTION_DURATION;\n const epochLength = config.epochLength ?? DEFAULT_EPOCH_LENGTH;\n const gamma =\n config.gamma ??\n computeOptimalGamma(\n startTick,\n endTick,\n duration,\n epochLength,\n tickSpacing,\n );\n\n this.auction = {\n duration,\n epochLength,\n startTick,\n endTick,\n gamma,\n minProceeds: config.minProceeds,\n maxProceeds: config.maxProceeds,\n numPdSlugs: config.numPdSlugs,\n };\n }\n\n if (!this.pool) throw new Error('poolConfig is required');\n if (!this.auction) throw new Error('auction configuration is required');\n\n // Validate noOp migration is not supported for dynamic auctions\n if (this.migration.type === 'noOp') {\n throw new Error(\n 'noOp migration is not supported for dynamic auctions. ' +\n 'Use uniswapV2, uniswapV4, or dopplerHook migration instead.',\n );\n }\n\n // Default governance: noOp on supported chains, default on others (e.g., Ink)\n const governance =\n this.governance ??\n (isNoOpEnabledChain(this.chainId)\n ? { type: 'noOp' as const }\n : { type: 'default' as const });\n\n if (\n governance.type === 'launchpad' &&\n !isLaunchpadEnabledChain(this.chainId)\n ) {\n throw new Error(\n `Launchpad governance is not supported on chain ${this.chainId}. Use a supported chain or a different governance type.`,\n );\n }\n\n // Ensure gamma is set and valid\n let { gamma } = this.auction;\n if (gamma === undefined) {\n gamma = computeOptimalGamma(\n this.auction.startTick,\n this.auction.endTick,\n this.auction.duration,\n this.auction.epochLength,\n this.pool.tickSpacing,\n );\n }\n\n const auction = { ...this.auction, gamma };\n\n return {\n token: this.token,\n sale: this.sale,\n auction,\n pool: this.pool,\n vesting: this.vesting,\n governance: governance as GovernanceOption<C>,\n migration: this.migration,\n integrator: this.integrator ?? ZERO_ADDRESS,\n userAddress: this.userAddress,\n startTimeOffset: this.startTimeOffset,\n blockTimestamp: this.blockTimestamp,\n modules: this.moduleAddresses,\n gas: this.gasLimit,\n };\n }\n}\n"]}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { ADDRESSES } from './chunk-
|
|
1
|
+
import { ADDRESSES } from './chunk-WDC53TM7.mjs';
|
|
2
2
|
|
|
3
3
|
// src/utils/airlock.ts
|
|
4
4
|
var airlockAbi = [
|
|
@@ -36,5 +36,5 @@ var getAirlockBeneficiary = async (publicClient, shares = DEFAULT_AIRLOCK_BENEFI
|
|
|
36
36
|
};
|
|
37
37
|
|
|
38
38
|
export { DEFAULT_AIRLOCK_BENEFICIARY_SHARES, createAirlockBeneficiary, getAirlockBeneficiary, getAirlockOwner };
|
|
39
|
-
//# sourceMappingURL=chunk-
|
|
40
|
-
//# sourceMappingURL=chunk-
|
|
39
|
+
//# sourceMappingURL=chunk-5GQJRNFL.mjs.map
|
|
40
|
+
//# sourceMappingURL=chunk-5GQJRNFL.mjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/utils/airlock.ts"],"names":[],"mappings":";;;AAIA,IAAM,UAAA,GAAa;AAAA,EACjB;AAAA,IACE,IAAA,EAAM,UAAA;AAAA,IACN,IA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ADDRESSES, type SupportedChainId } from '../addresses';\nimport type { BeneficiaryData } from '../types';\n\nconst airlockAbi = [\n {\n type: 'function',\n name: 'owner',\n inputs: [],\n outputs: [{ name: '', type: 'address', internalType: 'address' }],\n stateMutability: 'view',\n },\n] as const;\n\nexport const getAirlockOwner = async (\n publicClient: unknown,\n): Promise<Address> => {\n const client = publicClient as PublicClient;\n const chainId = client.chain?.id as SupportedChainId | undefined;\n if (!chainId || !ADDRESSES[chainId]) {\n throw new Error('Unsupported chain ID for airlock owner lookup');\n }\n\n const airlockAddress = ADDRESSES[chainId].airlock;\n\n const owner = await client.readContract({\n address: airlockAddress,\n abi: airlockAbi,\n functionName: 'owner',\n });\n\n if (!owner) throw new Error('Airlock owner not found');\n return owner as Address;\n};\n\n// Default airlock beneficiary shares (5% = 0.05e18 WAD)\nexport const DEFAULT_AIRLOCK_BENEFICIARY_SHARES = BigInt(5e16); // 5% in WAD\n\nexport const createAirlockBeneficiary = (\n owner: Address,\n shares: bigint = DEFAULT_AIRLOCK_BENEFICIARY_SHARES,\n): BeneficiaryData => ({\n beneficiary: owner,\n shares,\n});\n\nexport const getAirlockBeneficiary = async (\n publicClient: unknown,\n shares: bigint = DEFAULT_AIRLOCK_BENEFICIARY_SHARES,\n): Promise<BeneficiaryData> => {\n const owner = await getAirlockOwner(publicClient);\n return createAirlockBeneficiary(owner, shares);\n};\n"]}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
|
-
var
|
|
4
|
-
var
|
|
3
|
+
var chunk7A4DBBXA_js = require('./chunk-7A4DBBXA.js');
|
|
4
|
+
var chunkMU56HCUI_js = require('./chunk-MU56HCUI.js');
|
|
5
5
|
var viem = require('viem');
|
|
6
6
|
|
|
7
7
|
var Quoter = class {
|
|
@@ -18,11 +18,11 @@ var Quoter = class {
|
|
|
18
18
|
* @returns Quote result including output amount and price impact
|
|
19
19
|
*/
|
|
20
20
|
async quoteExactInputV3(params) {
|
|
21
|
-
const addresses =
|
|
21
|
+
const addresses = chunk7A4DBBXA_js.getAddresses(this.chainId);
|
|
22
22
|
try {
|
|
23
23
|
const { result } = await this.rpc.simulateContract({
|
|
24
24
|
address: addresses.v3Quoter,
|
|
25
|
-
abi:
|
|
25
|
+
abi: chunkMU56HCUI_js.quoterV2Abi,
|
|
26
26
|
functionName: "quoteExactInputSingle",
|
|
27
27
|
args: [
|
|
28
28
|
{
|
|
@@ -66,11 +66,11 @@ var Quoter = class {
|
|
|
66
66
|
* @returns Quote result including required input amount
|
|
67
67
|
*/
|
|
68
68
|
async quoteExactOutputV3(params) {
|
|
69
|
-
const addresses =
|
|
69
|
+
const addresses = chunk7A4DBBXA_js.getAddresses(this.chainId);
|
|
70
70
|
try {
|
|
71
71
|
const { result } = await this.rpc.simulateContract({
|
|
72
72
|
address: addresses.v3Quoter,
|
|
73
|
-
abi:
|
|
73
|
+
abi: chunkMU56HCUI_js.quoterV2Abi,
|
|
74
74
|
functionName: "quoteExactOutputSingle",
|
|
75
75
|
args: [
|
|
76
76
|
{
|
|
@@ -114,13 +114,13 @@ var Quoter = class {
|
|
|
114
114
|
* @returns Array of amounts for each step in the path
|
|
115
115
|
*/
|
|
116
116
|
async quoteExactInputV2(params) {
|
|
117
|
-
const addresses =
|
|
117
|
+
const addresses = chunk7A4DBBXA_js.getAddresses(this.chainId);
|
|
118
118
|
if (!addresses.univ2Router02) {
|
|
119
119
|
throw new Error("Uniswap V2 Router not available on this chain");
|
|
120
120
|
}
|
|
121
121
|
const result = await this.rpc.readContract({
|
|
122
122
|
address: addresses.univ2Router02,
|
|
123
|
-
abi:
|
|
123
|
+
abi: chunkMU56HCUI_js.uniswapV2Router02Abi,
|
|
124
124
|
functionName: "getAmountsOut",
|
|
125
125
|
args: [params.amountIn, params.path]
|
|
126
126
|
});
|
|
@@ -132,13 +132,13 @@ var Quoter = class {
|
|
|
132
132
|
* @returns Array of amounts for each step in the path
|
|
133
133
|
*/
|
|
134
134
|
async quoteExactOutputV2(params) {
|
|
135
|
-
const addresses =
|
|
135
|
+
const addresses = chunk7A4DBBXA_js.getAddresses(this.chainId);
|
|
136
136
|
if (!addresses.univ2Router02) {
|
|
137
137
|
throw new Error("Uniswap V2 Router not available on this chain");
|
|
138
138
|
}
|
|
139
139
|
const result = await this.rpc.readContract({
|
|
140
140
|
address: addresses.univ2Router02,
|
|
141
|
-
abi:
|
|
141
|
+
abi: chunkMU56HCUI_js.uniswapV2Router02Abi,
|
|
142
142
|
functionName: "getAmountsIn",
|
|
143
143
|
args: [params.amountOut, params.path]
|
|
144
144
|
});
|
|
@@ -150,14 +150,14 @@ var Quoter = class {
|
|
|
150
150
|
* @returns Quote result for V4 pools
|
|
151
151
|
*/
|
|
152
152
|
async quoteExactInputV4(params) {
|
|
153
|
-
const addresses =
|
|
153
|
+
const addresses = chunk7A4DBBXA_js.getAddresses(this.chainId);
|
|
154
154
|
const quoterAddress = addresses.uniswapV4Quoter;
|
|
155
155
|
if (!quoterAddress) {
|
|
156
156
|
throw new Error("No V4 quoter available on this chain");
|
|
157
157
|
}
|
|
158
158
|
const { result } = await this.rpc.simulateContract({
|
|
159
159
|
address: quoterAddress,
|
|
160
|
-
abi:
|
|
160
|
+
abi: chunkMU56HCUI_js.v4QuoterAbi,
|
|
161
161
|
functionName: "quoteExactInputSingle",
|
|
162
162
|
args: [
|
|
163
163
|
{
|
|
@@ -179,14 +179,14 @@ var Quoter = class {
|
|
|
179
179
|
* @returns Quote result for V4 pools
|
|
180
180
|
*/
|
|
181
181
|
async quoteExactOutputV4(params) {
|
|
182
|
-
const addresses =
|
|
182
|
+
const addresses = chunk7A4DBBXA_js.getAddresses(this.chainId);
|
|
183
183
|
const quoterAddress = addresses.uniswapV4Quoter;
|
|
184
184
|
if (!quoterAddress) {
|
|
185
185
|
throw new Error("Uniswap V4 Quoter address not available on this chain");
|
|
186
186
|
}
|
|
187
187
|
const { result } = await this.rpc.simulateContract({
|
|
188
188
|
address: quoterAddress,
|
|
189
|
-
abi:
|
|
189
|
+
abi: chunkMU56HCUI_js.v4QuoterAbi,
|
|
190
190
|
functionName: "quoteExactOutputSingle",
|
|
191
191
|
args: [
|
|
192
192
|
{
|
|
@@ -207,14 +207,14 @@ var Quoter = class {
|
|
|
207
207
|
* @param params Parameters for the quote
|
|
208
208
|
*/
|
|
209
209
|
async quoteExactInputV4Quoter(params) {
|
|
210
|
-
const addresses =
|
|
210
|
+
const addresses = chunk7A4DBBXA_js.getAddresses(this.chainId);
|
|
211
211
|
const quoterAddress = addresses.uniswapV4Quoter;
|
|
212
212
|
if (!quoterAddress) {
|
|
213
213
|
throw new Error("Uniswap V4 Quoter address not available on this chain");
|
|
214
214
|
}
|
|
215
215
|
const { result } = await this.rpc.simulateContract({
|
|
216
216
|
address: quoterAddress,
|
|
217
|
-
abi:
|
|
217
|
+
abi: chunkMU56HCUI_js.v4QuoterAbi,
|
|
218
218
|
functionName: "quoteExactInputSingle",
|
|
219
219
|
args: [
|
|
220
220
|
{
|
|
@@ -235,14 +235,14 @@ var Quoter = class {
|
|
|
235
235
|
* @param params Parameters for the quote
|
|
236
236
|
*/
|
|
237
237
|
async quoteExactOutputV4Quoter(params) {
|
|
238
|
-
const addresses =
|
|
238
|
+
const addresses = chunk7A4DBBXA_js.getAddresses(this.chainId);
|
|
239
239
|
const quoterAddress = addresses.uniswapV4Quoter;
|
|
240
240
|
if (!quoterAddress) {
|
|
241
241
|
throw new Error("Uniswap V4 Quoter address not available on this chain");
|
|
242
242
|
}
|
|
243
243
|
const { result } = await this.rpc.simulateContract({
|
|
244
244
|
address: quoterAddress,
|
|
245
|
-
abi:
|
|
245
|
+
abi: chunkMU56HCUI_js.v4QuoterAbi,
|
|
246
246
|
functionName: "quoteExactOutputSingle",
|
|
247
247
|
args: [
|
|
248
248
|
{
|
|
@@ -261,5 +261,5 @@ var Quoter = class {
|
|
|
261
261
|
};
|
|
262
262
|
|
|
263
263
|
exports.Quoter = Quoter;
|
|
264
|
-
//# sourceMappingURL=chunk-
|
|
265
|
-
//# sourceMappingURL=chunk-
|
|
264
|
+
//# sourceMappingURL=chunk-5JHXBDZD.js.map
|
|
265
|
+
//# sourceMappingURL=chunk-5JHXBDZD.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/entities/quoter/Quoter.ts"],"names":["getAddresses","quoterV2Abi","decodeAbiParameters","uniswapV2Router02Abi","v4QuoterAbi"],"mappings":";;;;;;AAiBO,IAAM,SAAN,MAAa;AAAA,EAGlB,IAAY,GAAA,GAAoB;AAC9B,IAAA,OAAO,IAAA,CAAK,YAAA;AAAA,EACd;AAAA,EAEA,WAAA,CAAY,cAAqC,OAAA,EAAiB;AAChE,IAAA,IAAA,CAAK,YAAA,GAAe,YAAA;AACpB,IAAA,IAAA,CAAK,OAAA,GAAU,OAAA;AAAA,EACjB;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EAOA,MAAM,kBAAkB,MAAA,EAWrB;AACD,IAAA,MAAM,SAAA,GAAYA,6BAAA,CAAa,IAAA,CAAK,OAAO,CAAA;AAE3C,IAAA,IAAI;AACF,MAAA,MAAM,EAAE,MAAA,EAAO,GAAI,MAAM,IAAA,CAAK,IAAI,gBAAA,CAAiB;AAAA,QACjD,SAAS,SAAA,CAAU,QAAA;AAAA,QACnB,GAAA,EAAKC,4BAAA;AAAA,QACL,YAAA,EAAc,uBAAA;AAAA,QACd,IAAA,EAAM;AAAA,UACJ;AAAA,YACE,SAAS,MAAA,CAAO,OAAA;AAAA,YAChB,UAAU,MAAA,CAAO,QAAA;AAAA,YACjB,UAAU,MAAA,CAAO,QAAA;AAAA,YACjB,KAAK,MAAA,CAAO,GAAA;AAAA,YACZ,iBAAA,EAAmB,MAAA,CAAO,iBAAA,IAAqB,MAAA,CAAO,CAAC;AAAA;AACzD;AACF,OACD,CAAA;AACD,MAAA,OAAO;AAAA,QACL,SAAA,EAAW,OAAO,CAAC,CAAA;AAAA,QACnB,iBAAA,EAAmB,OAAO,CAAC,CAAA;AAAA,QAC3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YAAY,MAAA,CAAO,UAAA;AAAA,UACnB,aAAa,MAAA,CAAO,WAAA;AAAA,UACpB,QAAA,EAAW,OAAO,QAAA,IAAY;AAAA;AAChC;AACF,KACD,CAAA;AAED,IAAA,OAAO;AAAA,MACL,QAAA,EAAU,OAAO,CAAC,CAAA;AAAA,MAClB,WAAA,EAAa,OAAO,CAAC;AAAA,KACvB;AAAA,EACF;AACF","file":"chunk-ZDTJ3BPS.js","sourcesContent":["import {\n type Address,\n decodeAbiParameters,\n type Hex,\n type PublicClient,\n} from 'viem';\nimport { quoterV2Abi, uniswapV2Router02Abi, v4QuoterAbi } from '../../abis';\nimport { getAddresses } from '../../addresses';\nimport type { SupportedPublicClient } from '../../types';\n\n/**\n * Unified Quoter for getting price quotes across Uniswap V2, V3, and V4\n *\n * This class provides a unified interface for price discovery across all\n * supported Uniswap versions, abstracting away the differences between\n * V2 router, V3 quoter, and V4 quoter contracts.\n */\nexport class Quoter {\n private publicClient: SupportedPublicClient;\n private chainId: number;\n private get rpc(): PublicClient {\n return this.publicClient as PublicClient;\n }\n\n constructor(publicClient: SupportedPublicClient, chainId: number) {\n this.publicClient = publicClient;\n this.chainId = chainId;\n }\n\n /**\n * Get a price quote for swapping an exact amount of input tokens on Uniswap V3\n * @param params Parameters for the quote\n * @returns Quote result including output amount and price impact\n */\n async quoteExactInputV3(params: {\n tokenIn: Address;\n tokenOut: Address;\n amountIn: bigint;\n fee: number;\n sqrtPriceLimitX96?: bigint;\n }): Promise<{\n amountOut: bigint;\n sqrtPriceX96After: bigint;\n initializedTicksCrossed: number;\n gasEstimate: bigint;\n }> {\n const addresses = getAddresses(this.chainId);\n\n try {\n const { result } = await this.rpc.simulateContract({\n address: addresses.v3Quoter,\n abi: quoterV2Abi,\n functionName: 'quoteExactInputSingle',\n args: [\n {\n tokenIn: params.tokenIn,\n tokenOut: params.tokenOut,\n amountIn: params.amountIn,\n fee: params.fee,\n sqrtPriceLimitX96: params.sqrtPriceLimitX96 ?? BigInt(0),\n },\n ],\n });\n return {\n amountOut: result[0],\n sqrtPriceX96After: result[1],\n initializedTicksCrossed: result[2],\n gasEstimate: result[3],\n };\n } catch (err: unknown) {\n const revertData: Hex | undefined =\n (err as { cause?: { data?: Hex }; data?: Hex })?.cause?.data ||\n (err as { data?: Hex }).data;\n if (\n revertData &&\n typeof revertData === 'string' &&\n revertData.startsWith('0x')\n ) {\n try {\n // Uniswap V3 QuoterV2 encodes (uint256 amount, uint160 sqrtPriceX96After, int24 tickAfter)\n const [amount, sqrtPriceX96After] = decodeAbiParameters(\n [{ type: 'uint256' }, { type: 'uint160' }, { type: 'int24' }],\n revertData as Hex,\n ) as unknown as [bigint, bigint, number];\n return {\n amountOut: amount,\n sqrtPriceX96After,\n initializedTicksCrossed: 0,\n gasEstimate: 0n,\n };\n } catch (_) {\n // fall through\n }\n }\n throw err;\n }\n }\n\n /**\n * Get a price quote for receiving an exact amount of output tokens on Uniswap V3\n * @param params Parameters for the quote\n * @returns Quote result including required input amount\n */\n async quoteExactOutputV3(params: {\n tokenIn: Address;\n tokenOut: Address;\n amountOut: bigint;\n fee: number;\n sqrtPriceLimitX96?: bigint;\n }): Promise<{\n amountIn: bigint;\n sqrtPriceX96After: bigint;\n initializedTicksCrossed: number;\n gasEstimate: bigint;\n }> {\n const addresses = getAddresses(this.chainId);\n\n try {\n const { result } = await this.rpc.simulateContract({\n address: addresses.v3Quoter,\n abi: quoterV2Abi,\n functionName: 'quoteExactOutputSingle',\n args: [\n {\n tokenIn: params.tokenIn,\n tokenOut: params.tokenOut,\n amount: params.amountOut,\n fee: params.fee,\n sqrtPriceLimitX96: params.sqrtPriceLimitX96 ?? BigInt(0),\n },\n ],\n });\n return {\n amountIn: result[0],\n sqrtPriceX96After: result[1],\n initializedTicksCrossed: result[2],\n gasEstimate: result[3],\n };\n } catch (err: unknown) {\n const revertData: Hex | undefined =\n (err as { cause?: { data?: Hex }; data?: Hex })?.cause?.data ||\n (err as { data?: Hex }).data;\n if (\n revertData &&\n typeof revertData === 'string' &&\n revertData.startsWith('0x')\n ) {\n try {\n // Uniswap V3 QuoterV2 encodes (uint256 amount, uint160 sqrtPriceX96After, int24 tickAfter)\n const [amount, sqrtPriceX96After] = decodeAbiParameters(\n [{ type: 'uint256' }, { type: 'uint160' }, { type: 'int24' }],\n revertData as Hex,\n ) as unknown as [bigint, bigint, number];\n return {\n amountIn: amount,\n sqrtPriceX96After,\n initializedTicksCrossed: 0,\n gasEstimate: 0n,\n };\n } catch (_) {\n // fall through\n }\n }\n throw err;\n }\n }\n\n /**\n * Get a price quote for swapping an exact amount of input tokens on Uniswap V2\n * @param params Parameters for the quote\n * @returns Array of amounts for each step in the path\n */\n async quoteExactInputV2(params: {\n amountIn: bigint;\n path: Address[];\n }): Promise<bigint[]> {\n const addresses = getAddresses(this.chainId);\n\n if (!addresses.univ2Router02) {\n throw new Error('Uniswap V2 Router not available on this chain');\n }\n\n const result = await this.rpc.readContract({\n address: addresses.univ2Router02,\n abi: uniswapV2Router02Abi,\n functionName: 'getAmountsOut',\n args: [params.amountIn, params.path],\n });\n\n return [...result]; // Convert readonly array to mutable array\n }\n\n /**\n * Get a price quote for receiving an exact amount of output tokens on Uniswap V2\n * @param params Parameters for the quote\n * @returns Array of amounts for each step in the path\n */\n async quoteExactOutputV2(params: {\n amountOut: bigint;\n path: Address[];\n }): Promise<bigint[]> {\n const addresses = getAddresses(this.chainId);\n\n if (!addresses.univ2Router02) {\n throw new Error('Uniswap V2 Router not available on this chain');\n }\n\n const result = await this.rpc.readContract({\n address: addresses.univ2Router02,\n abi: uniswapV2Router02Abi,\n functionName: 'getAmountsIn',\n args: [params.amountOut, params.path],\n });\n\n return [...result]; // Convert readonly array to mutable array\n }\n\n /**\n * Get a price quote for swapping an exact amount of input tokens on Uniswap V4\n * @param params Parameters for the quote\n * @returns Quote result for V4 pools\n */\n async quoteExactInputV4(params: {\n poolKey: {\n currency0: Address;\n currency1: Address;\n fee: number;\n tickSpacing: number;\n hooks: Address;\n };\n zeroForOne: boolean;\n exactAmount: bigint;\n hookData?: string;\n }): Promise<{\n amountOut: bigint;\n gasEstimate: bigint;\n }> {\n const addresses = getAddresses(this.chainId);\n\n const quoterAddress = addresses.uniswapV4Quoter;\n\n if (!quoterAddress) {\n throw new Error('No V4 quoter available on this chain');\n }\n\n const { result } = await this.rpc.simulateContract({\n address: quoterAddress,\n abi: v4QuoterAbi,\n functionName: 'quoteExactInputSingle',\n args: [\n {\n poolKey: params.poolKey,\n zeroForOne: params.zeroForOne,\n exactAmount: params.exactAmount,\n hookData: (params.hookData ?? '0x') as `0x${string}`,\n },\n ],\n });\n\n return {\n amountOut: result[0],\n gasEstimate: result[1],\n };\n }\n\n /**\n * Get a price quote for receiving an exact amount of output tokens on Uniswap V4\n * @param params Parameters for the quote\n * @returns Quote result for V4 pools\n */\n async quoteExactOutputV4(params: {\n poolKey: {\n currency0: Address;\n currency1: Address;\n fee: number;\n tickSpacing: number;\n hooks: Address;\n };\n zeroForOne: boolean;\n exactAmount: bigint;\n hookData?: string;\n }): Promise<{\n amountIn: bigint;\n gasEstimate: bigint;\n }> {\n const addresses = getAddresses(this.chainId);\n\n const quoterAddress = addresses.uniswapV4Quoter;\n\n if (!quoterAddress) {\n throw new Error('Uniswap V4 Quoter address not available on this chain');\n }\n\n const { result } = await this.rpc.simulateContract({\n address: quoterAddress,\n abi: v4QuoterAbi,\n functionName: 'quoteExactOutputSingle',\n args: [\n {\n poolKey: params.poolKey,\n zeroForOne: params.zeroForOne,\n exactAmount: params.exactAmount,\n hookData: (params.hookData ?? '0x') as `0x${string}`,\n },\n ],\n });\n\n return {\n amountIn: result[0],\n gasEstimate: result[1],\n };\n }\n\n /**\n * Quote a single exact-input trade using the Uniswap V4 Quoter (not Lens)\n * @param params Parameters for the quote\n */\n async quoteExactInputV4Quoter(params: {\n poolKey: {\n currency0: Address;\n currency1: Address;\n fee: number;\n tickSpacing: number;\n hooks: Address;\n };\n zeroForOne: boolean;\n exactAmount: bigint;\n hookData?: string;\n }): Promise<{\n amountOut: bigint;\n gasEstimate: bigint;\n }> {\n const addresses = getAddresses(this.chainId);\n const quoterAddress = addresses.uniswapV4Quoter;\n\n if (!quoterAddress) {\n throw new Error('Uniswap V4 Quoter address not available on this chain');\n }\n\n const { result } = await this.rpc.simulateContract({\n address: quoterAddress,\n abi: v4QuoterAbi,\n functionName: 'quoteExactInputSingle',\n args: [\n {\n poolKey: params.poolKey,\n zeroForOne: params.zeroForOne,\n exactAmount: params.exactAmount,\n hookData: (params.hookData ?? '0x') as `0x${string}`,\n },\n ],\n });\n\n return {\n amountOut: result[0],\n gasEstimate: result[1],\n };\n }\n\n /**\n * Quote a single exact-output trade using the Uniswap V4 Quoter (not Lens)\n * @param params Parameters for the quote\n */\n async quoteExactOutputV4Quoter(params: {\n poolKey: {\n currency0: Address;\n currency1: Address;\n fee: number;\n tickSpacing: number;\n hooks: Address;\n };\n zeroForOne: boolean;\n exactAmount: bigint;\n hookData?: string;\n }): Promise<{\n amountIn: bigint;\n gasEstimate: bigint;\n }> {\n const addresses = getAddresses(this.chainId);\n const quoterAddress = addresses.uniswapV4Quoter;\n\n if (!quoterAddress) {\n throw new Error('Uniswap V4 Quoter address not available on this chain');\n }\n\n const { result } = await this.rpc.simulateContract({\n address: quoterAddress,\n abi: v4QuoterAbi,\n functionName: 'quoteExactOutputSingle',\n args: [\n {\n poolKey: params.poolKey,\n zeroForOne: params.zeroForOne,\n exactAmount: params.exactAmount,\n hookData: (params.hookData ?? '0x') as `0x${string}`,\n },\n ],\n });\n\n return {\n amountIn: result[0],\n gasEstimate: result[1],\n };\n }\n}\n"]}
|
|
1
|
+
{"version":3,"sources":["../src/entities/quoter/Quoter.ts"],"names":["getAddresses","quoterV2Abi","decodeAbiParameters","uniswapV2Router02Abi","v4QuoterAbi"],"mappings":";;;;;;AAiBO,IAAM,SAAN,MAAa;AAAA,EAGlB,IAAY,GAAA,GAAoB;AAC9B,IAAA,OAAO,IAAA,CAAK,YAAA;AAAA,EACd;AAAA,EAEA,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AAA,MACd,IAAA,EAAM;AAAA,QACJ;AAAA,UACE,SAAS,MAAA,CAAO,OAAA;AAAA,UAChB,YAAY,MAAA,CAAO,UAAA;AAAA,UACnB,aAAa,MAAA,CAAO,WAAA;AAAA,UACpB,QAAA,EAAW,OAAO,QAAA,IAAY;AAAA;AAChC;AACF,KACD,CAAA;AAED,IAAA,OAAO;AAAA,MACL,SAAA,EAAW,OAAO,CAAC,CAAA;AAAA,MACnB,WAAA,EAAa,OAAO,CAAC;AAAA,KACvB;AAAA,EACF;AAAA;AAAA;AAAA;AAAA;AAAA,EAMA,MAAM,yBAAyB,MAAA,EAc5B;AACD,IAAA,MAAM,SAAA,GAAYJ,6BAAA,CAAa,IAAA,CAAK,OAAO,CAAA;AAC3C,IAAA,MAAM,gBAAgB,SAAA,CAAU,eAAA;AAEhC,IAAA,IAAI,CAAC,aAAA,EAAe;AAClB,MAAA,MAAM,IAAI,MAAM,uDAAuD,CAAA;AAAA,IACzE;AAEA,IAAA,MAAM,EAAE,MAAA,EAAO,GAAI,MAAM,IAAA,CAAK,IAAI,gBAAA,CAAiB;AAAA,MACjD,OAAA,EAAS,aAAA;AAAA,MACT,GAAA,EAAKI,4BAAA;AAAA,MACL,YAAA,EAAc,wBAAA;AAAA,MACd,IAAA,EAAM;AAAA,QACJ;AAAA,UACE,SAAS,MAAA,CAAO,OAAA;AAAA,UAChB,YAAY,MAAA,CAAO,UAAA;AAAA,UACnB,aAAa,MAAA,CAAO,WAAA;AAAA,UACpB,QAAA,EAAW,OAAO,QAAA,IAAY;AAAA;AAChC;AACF,KACD,CAAA;AAED,IAAA,OAAO;AAAA,MACL,QAAA,EAAU,OAAO,CAAC,CAAA;AAAA,MAClB,WAAA,EAAa,OAAO,CAAC;AAAA,KACvB;AAAA,EACF;AACF","file":"chunk-5JHXBDZD.js","sourcesContent":["import {\n type Address,\n decodeAbiParameters,\n type Hex,\n type PublicClient,\n} from 'viem';\nimport { quoterV2Abi, uniswapV2Router02Abi, v4QuoterAbi } from '../../abis';\nimport { getAddresses } from '../../addresses';\nimport type { SupportedPublicClient } from '../../types';\n\n/**\n * Unified Quoter for getting price quotes across Uniswap V2, V3, and V4\n *\n * This class provides a unified interface for price discovery across all\n * supported Uniswap versions, abstracting away the differences between\n * V2 router, V3 quoter, and V4 quoter contracts.\n */\nexport class Quoter {\n private publicClient: SupportedPublicClient;\n private chainId: number;\n private get rpc(): PublicClient {\n return this.publicClient as PublicClient;\n }\n\n constructor(publicClient: SupportedPublicClient, chainId: number) {\n this.publicClient = publicClient;\n this.chainId = chainId;\n }\n\n /**\n * Get a price quote for swapping an exact amount of input tokens on Uniswap V3\n * @param params Parameters for the quote\n * @returns Quote result including output amount and price impact\n */\n async quoteExactInputV3(params: {\n tokenIn: Address;\n tokenOut: Address;\n amountIn: bigint;\n fee: number;\n sqrtPriceLimitX96?: bigint;\n }): Promise<{\n amountOut: bigint;\n sqrtPriceX96After: bigint;\n initializedTicksCrossed: number;\n gasEstimate: bigint;\n }> {\n const addresses = getAddresses(this.chainId);\n\n try {\n const { result } = await this.rpc.simulateContract({\n address: addresses.v3Quoter,\n abi: quoterV2Abi,\n functionName: 'quoteExactInputSingle',\n args: [\n {\n tokenIn: params.tokenIn,\n tokenOut: params.tokenOut,\n amountIn: params.amountIn,\n fee: params.fee,\n sqrtPriceLimitX96: params.sqrtPriceLimitX96 ?? BigInt(0),\n },\n ],\n });\n return {\n amountOut: result[0],\n sqrtPriceX96After: result[1],\n initializedTicksCrossed: result[2],\n gasEstimate: result[3],\n };\n } catch (err: unknown) {\n const revertData: Hex | undefined =\n (err as { cause?: { data?: Hex }; data?: Hex })?.cause?.data ||\n (err as { data?: Hex }).data;\n if (\n revertData &&\n typeof revertData === 'string' &&\n revertData.startsWith('0x')\n ) {\n try {\n // Uniswap V3 QuoterV2 encodes (uint256 amount, uint160 sqrtPriceX96After, int24 tickAfter)\n const [amount, sqrtPriceX96After] = decodeAbiParameters(\n [{ type: 'uint256' }, { type: 'uint160' }, { type: 'int24' }],\n revertData as Hex,\n ) as unknown as [bigint, bigint, number];\n return {\n amountOut: amount,\n sqrtPriceX96After,\n initializedTicksCrossed: 0,\n gasEstimate: 0n,\n };\n } catch (_) {\n // fall through\n }\n }\n throw err;\n }\n }\n\n /**\n * Get a price quote for receiving an exact amount of output tokens on Uniswap V3\n * @param params Parameters for the quote\n * @returns Quote result including required input amount\n */\n async quoteExactOutputV3(params: {\n tokenIn: Address;\n tokenOut: Address;\n amountOut: bigint;\n fee: number;\n sqrtPriceLimitX96?: bigint;\n }): Promise<{\n amountIn: bigint;\n sqrtPriceX96After: bigint;\n initializedTicksCrossed: number;\n gasEstimate: bigint;\n }> {\n const addresses = getAddresses(this.chainId);\n\n try {\n const { result } = await this.rpc.simulateContract({\n address: addresses.v3Quoter,\n abi: quoterV2Abi,\n functionName: 'quoteExactOutputSingle',\n args: [\n {\n tokenIn: params.tokenIn,\n tokenOut: params.tokenOut,\n amount: params.amountOut,\n fee: params.fee,\n sqrtPriceLimitX96: params.sqrtPriceLimitX96 ?? BigInt(0),\n },\n ],\n });\n return {\n amountIn: result[0],\n sqrtPriceX96After: result[1],\n initializedTicksCrossed: result[2],\n gasEstimate: result[3],\n };\n } catch (err: unknown) {\n const revertData: Hex | undefined =\n (err as { cause?: { data?: Hex }; data?: Hex })?.cause?.data ||\n (err as { data?: Hex }).data;\n if (\n revertData &&\n typeof revertData === 'string' &&\n revertData.startsWith('0x')\n ) {\n try {\n // Uniswap V3 QuoterV2 encodes (uint256 amount, uint160 sqrtPriceX96After, int24 tickAfter)\n const [amount, sqrtPriceX96After] = decodeAbiParameters(\n [{ type: 'uint256' }, { type: 'uint160' }, { type: 'int24' }],\n revertData as Hex,\n ) as unknown as [bigint, bigint, number];\n return {\n amountIn: amount,\n sqrtPriceX96After,\n initializedTicksCrossed: 0,\n gasEstimate: 0n,\n };\n } catch (_) {\n // fall through\n }\n }\n throw err;\n }\n }\n\n /**\n * Get a price quote for swapping an exact amount of input tokens on Uniswap V2\n * @param params Parameters for the quote\n * @returns Array of amounts for each step in the path\n */\n async quoteExactInputV2(params: {\n amountIn: bigint;\n path: Address[];\n }): Promise<bigint[]> {\n const addresses = getAddresses(this.chainId);\n\n if (!addresses.univ2Router02) {\n throw new Error('Uniswap V2 Router not available on this chain');\n }\n\n const result = await this.rpc.readContract({\n address: addresses.univ2Router02,\n abi: uniswapV2Router02Abi,\n functionName: 'getAmountsOut',\n args: [params.amountIn, params.path],\n });\n\n return [...result]; // Convert readonly array to mutable array\n }\n\n /**\n * Get a price quote for receiving an exact amount of output tokens on Uniswap V2\n * @param params Parameters for the quote\n * @returns Array of amounts for each step in the path\n */\n async quoteExactOutputV2(params: {\n amountOut: bigint;\n path: Address[];\n }): Promise<bigint[]> {\n const addresses = getAddresses(this.chainId);\n\n if (!addresses.univ2Router02) {\n throw new Error('Uniswap V2 Router not available on this chain');\n }\n\n const result = await this.rpc.readContract({\n address: addresses.univ2Router02,\n abi: uniswapV2Router02Abi,\n functionName: 'getAmountsIn',\n args: [params.amountOut, params.path],\n });\n\n return [...result]; // Convert readonly array to mutable array\n }\n\n /**\n * Get a price quote for swapping an exact amount of input tokens on Uniswap V4\n * @param params Parameters for the quote\n * @returns Quote result for V4 pools\n */\n async quoteExactInputV4(params: {\n poolKey: {\n currency0: Address;\n currency1: Address;\n fee: number;\n tickSpacing: number;\n hooks: Address;\n };\n zeroForOne: boolean;\n exactAmount: bigint;\n hookData?: string;\n }): Promise<{\n amountOut: bigint;\n gasEstimate: bigint;\n }> {\n const addresses = getAddresses(this.chainId);\n\n const quoterAddress = addresses.uniswapV4Quoter;\n\n if (!quoterAddress) {\n throw new Error('No V4 quoter available on this chain');\n }\n\n const { result } = await this.rpc.simulateContract({\n address: quoterAddress,\n abi: v4QuoterAbi,\n functionName: 'quoteExactInputSingle',\n args: [\n {\n poolKey: params.poolKey,\n zeroForOne: params.zeroForOne,\n exactAmount: params.exactAmount,\n hookData: (params.hookData ?? '0x') as `0x${string}`,\n },\n ],\n });\n\n return {\n amountOut: result[0],\n gasEstimate: result[1],\n };\n }\n\n /**\n * Get a price quote for receiving an exact amount of output tokens on Uniswap V4\n * @param params Parameters for the quote\n * @returns Quote result for V4 pools\n */\n async quoteExactOutputV4(params: {\n poolKey: {\n currency0: Address;\n currency1: Address;\n fee: number;\n tickSpacing: number;\n hooks: Address;\n };\n zeroForOne: boolean;\n exactAmount: bigint;\n hookData?: string;\n }): Promise<{\n amountIn: bigint;\n gasEstimate: bigint;\n }> {\n const addresses = getAddresses(this.chainId);\n\n const quoterAddress = addresses.uniswapV4Quoter;\n\n if (!quoterAddress) {\n throw new Error('Uniswap V4 Quoter address not available on this chain');\n }\n\n const { result } = await this.rpc.simulateContract({\n address: quoterAddress,\n abi: v4QuoterAbi,\n functionName: 'quoteExactOutputSingle',\n args: [\n {\n poolKey: params.poolKey,\n zeroForOne: params.zeroForOne,\n exactAmount: params.exactAmount,\n hookData: (params.hookData ?? '0x') as `0x${string}`,\n },\n ],\n });\n\n return {\n amountIn: result[0],\n gasEstimate: result[1],\n };\n }\n\n /**\n * Quote a single exact-input trade using the Uniswap V4 Quoter (not Lens)\n * @param params Parameters for the quote\n */\n async quoteExactInputV4Quoter(params: {\n poolKey: {\n currency0: Address;\n currency1: Address;\n fee: number;\n tickSpacing: number;\n hooks: Address;\n };\n zeroForOne: boolean;\n exactAmount: bigint;\n hookData?: string;\n }): Promise<{\n amountOut: bigint;\n gasEstimate: bigint;\n }> {\n const addresses = getAddresses(this.chainId);\n const quoterAddress = addresses.uniswapV4Quoter;\n\n if (!quoterAddress) {\n throw new Error('Uniswap V4 Quoter address not available on this chain');\n }\n\n const { result } = await this.rpc.simulateContract({\n address: quoterAddress,\n abi: v4QuoterAbi,\n functionName: 'quoteExactInputSingle',\n args: [\n {\n poolKey: params.poolKey,\n zeroForOne: params.zeroForOne,\n exactAmount: params.exactAmount,\n hookData: (params.hookData ?? '0x') as `0x${string}`,\n },\n ],\n });\n\n return {\n amountOut: result[0],\n gasEstimate: result[1],\n };\n }\n\n /**\n * Quote a single exact-output trade using the Uniswap V4 Quoter (not Lens)\n * @param params Parameters for the quote\n */\n async quoteExactOutputV4Quoter(params: {\n poolKey: {\n currency0: Address;\n currency1: Address;\n fee: number;\n tickSpacing: number;\n hooks: Address;\n };\n zeroForOne: boolean;\n exactAmount: bigint;\n hookData?: string;\n }): Promise<{\n amountIn: bigint;\n gasEstimate: bigint;\n }> {\n const addresses = getAddresses(this.chainId);\n const quoterAddress = addresses.uniswapV4Quoter;\n\n if (!quoterAddress) {\n throw new Error('Uniswap V4 Quoter address not available on this chain');\n }\n\n const { result } = await this.rpc.simulateContract({\n address: quoterAddress,\n abi: v4QuoterAbi,\n functionName: 'quoteExactOutputSingle',\n args: [\n {\n poolKey: params.poolKey,\n zeroForOne: params.zeroForOne,\n exactAmount: params.exactAmount,\n hookData: (params.hookData ?? '0x') as `0x${string}`,\n },\n ],\n });\n\n return {\n amountIn: result[0],\n gasEstimate: result[1],\n };\n }\n}\n"]}
|
|
@@ -4,5 +4,5 @@
|
|
|
4
4
|
var stateView_default = "0x60a03460b257601f610b8338819003918201601f19168301916001600160401b0383118484101760b65780849260209460405283398101031260b257516001600160a01b038116810360b257608052604051610ab890816100cb823960805181818160e1015281816101b701528181610217015281816102ba0152818161034a015281816103f50152818161045b015281816104a2015281816104e90152818161054c0152818161060701526107170152f35b5f80fd5b634e487b7160e01b5f52604160045260245ffdfe60806040526004361015610011575f80fd5b5f3560e01c80631c7ccb4c146106a357806353e9c1fb146105de5780637c40f1fe1461050d5780638a2bb9e6146104c657806397fd7b421461048b5780639ec538c814610440578063c815641c146103d5578063caedab5414610309578063dacf1d2f14610246578063dc4c90d314610202578063f0928f29146101835763fa6793d51461009d575f80fd5b34610158576020366003190112610158576100b9600435610a1c565b6003810180911161016f57604051631e2eaeaf60e01b815260048101919091526020816024817f00000000000000000000000000000000000000000000000000000000000000006001600160a01b03165afa8015610164575f9061012d575b6040516001600160801b039091168152602090f35b506020813d60201161015c575b81610147602093836107c2565b810103126101585760209051610118565b5f80fd5b3d915061013a565b6040513d5f823e3d90fd5b634e487b7160e01b5f52601160045260245ffd5b346101585761019a610194366107ac565b90610a78565b604051631e2eaeaf60e01b815260048101919091526020816024817f00000000000000000000000000000000000000000000000000000000000000006001600160a01b03165afa8015610164575f9061012d576040516001600160801b039091168152602090f35b34610158575f366003190112610158576040517f00000000000000000000000000000000000000000000000000000000000000006001600160a01b03168152602090f35b346101585760a0366003190112610158576024356001600160a01b03811681036101585761027261079c565b6064358060020b810361015857610305926102de926040519260843560268501526006840152600383015281525f603a600c83012091816040820152816020820152526004357f00000000000000000000000000000000000000000000000000000000000000006108fb565b604080516001600160801b0390941684526020840192909252908201529081906060820190565b0390f35b346101585760403660031901126101585761032d61032561078c565b600435610a42565b604051631e2eaeaf60e01b815260048101919091526020816024817f00000000000000000000000000000000000000000000000000000000000000006001600160a01b03165afa8015610164575f906103a2575b604080516001600160801b038316815260809290921d600f0b602083015290f35b506020813d6020116103cd575b816103bc602093836107c2565b810103126101585760409051610381565b3d91506103af565b3461015857602036600319011261015857608062ffffff806104196004357f000000000000000000000000000000000000000000000000000000000000000061097d565b9294916040519560018060a01b0316865260020b6020860152166040840152166060820152f35b3461015857602036600319011261015857604061047f6004357f0000000000000000000000000000000000000000000000000000000000000000610972565b82519182526020820152f35b34610158576103056102de61049f366107ac565b907f00000000000000000000000000000000000000000000000000000000000000006108fb565b3461015857604036600319011261015857604061047f6104e461078c565b6004357f000000000000000000000000000000000000000000000000000000000000000061087c565b346101585760403660031901126101585761052961032561078c565b604051631afeb18d60e11b81526004810191909152600360248201525f816044817f00000000000000000000000000000000000000000000000000000000000000006001600160a01b03165afa8015610164576080915f916105bc575b50602081015190606060408201519101519060405192600180861b0381168452841d600f0b602084015260408301526060820152f35b6105d891503d805f833e6105d081836107c2565b8101906107f9565b82610586565b346101585760603660031901126101585760406004356105fc61078c565b9061060561079c565b7f0000000000000000000000000000000000000000000000000000000000000000906106318383610972565b9061063d86868661087c565b96909361065661064e82898961087c565b98909761097d565b5050905060020b9160020b82125f1461067c575050505003910382519182526020820152f35b95969593949360020b1361069457505003910361047f565b9493929094030392030361047f565b34610158576040366003190112610158576024358060010b809103610158576106cd600435610a1c565b6005810180911161016f5760405190602082019283526040820152604081526106f76060826107c2565b519020604051631e2eaeaf60e01b815260048101919091526020816024817f00000000000000000000000000000000000000000000000000000000000000006001600160a01b03165afa8015610164575f90610759575b602090604051908152f35b506020813d602011610784575b81610773602093836107c2565b81010312610158576020905161074e565b3d9150610766565b602435908160020b820361015857565b604435908160020b820361015857565b6040906003190112610158576004359060243590565b601f909101601f19168101906001600160401b038211908210176107e557604052565b634e487b7160e01b5f52604160045260245ffd5b602081830312610158578051906001600160401b03821161015857019080601f83011215610158578151916001600160401b0383116107e5578260051b906040519361084860208401866107c2565b845260208085019282010192831161015857602001905b82821061086c5750505090565b815181526020918201910161085f565b929161088791610a42565b6001810180911161016f57604051631afeb18d60e11b8152600481019190915260026024820152915f90839060449082906001600160a01b03165afa918215610164575f926108df575b506040602083015192015190565b6108f49192503d805f833e6105d081836107c2565b905f6108d1565b91610907905f92610a78565b604051631afeb18d60e11b815260048101919091526003602482015291829060449082906001600160a01b03165afa908115610164575f91610958575b506020810151916060604083015192015190565b61096c91503d805f833e6105d081836107c2565b5f610944565b919061088790610a1c565b919061098a602091610a1c565b604051631e2eaeaf60e01b8152600481019190915292839060249082906001600160a01b03165afa918215610164575f926109e8575b506001600160a01b0382169160a081901c60020b9162ffffff60b883901c81169260d01c1690565b9091506020813d602011610a14575b81610a04602093836107c2565b810103126101585751905f6109c0565b3d91506109f7565b604051602081019182526006604082015260408152610a3c6060826107c2565b51902090565b610a4b90610a1c565b6004810180911161016f5760405190602082019260020b8352604082015260408152610a3c6060826107c2565b610a8190610a1c565b6006810180911161016f576040519060208201928352604082015260408152610a3c6060826107c256fea164736f6c634300081a000a";
|
|
5
5
|
|
|
6
6
|
exports.stateView_default = stateView_default;
|
|
7
|
-
//# sourceMappingURL=chunk-
|
|
8
|
-
//# sourceMappingURL=chunk-
|
|
7
|
+
//# sourceMappingURL=chunk-5TQOT6CW.js.map
|
|
8
|
+
//# sourceMappingURL=chunk-5TQOT6CW.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../src/abis/bytecodes/stateView.ts"],"names":[],"mappings":";;;AAAA,IAAO,iBAAA,GAAQ","file":"chunk-5TQOT6CW.js","sourcesContent":["export default '0x60a03460b257601f610b8338819003918201601f19168301916001600160401b0383118484101760b65780849260209460405283398101031260b257516001600160a01b038116810360b257608052604051610ab890816100cb823960805181818160e1015281816101b701528181610217015281816102ba0152818161034a015281816103f50152818161045b015281816104a2015281816104e90152818161054c0152818161060701526107170152f35b5f80fd5b634e487b7160e01b5f52604160045260245ffdfe60806040526004361015610011575f80fd5b5f3560e01c80631c7ccb4c146106a357806353e9c1fb146105de5780637c40f1fe1461050d5780638a2bb9e6146104c657806397fd7b421461048b5780639ec538c814610440578063c815641c146103d5578063caedab5414610309578063dacf1d2f14610246578063dc4c90d314610202578063f0928f29146101835763fa6793d51461009d575f80fd5b34610158576020366003190112610158576100b9600435610a1c565b6003810180911161016f57604051631e2eaeaf60e01b815260048101919091526020816024817f00000000000000000000000000000000000000000000000000000000000000006001600160a01b03165afa8015610164575f9061012d575b6040516001600160801b039091168152602090f35b506020813d60201161015c575b81610147602093836107c2565b810103126101585760209051610118565b5f80fd5b3d915061013a565b6040513d5f823e3d90fd5b634e487b7160e01b5f52601160045260245ffd5b346101585761019a610194366107ac565b90610a78565b604051631e2eaeaf60e01b815260048101919091526020816024817f00000000000000000000000000000000000000000000000000000000000000006001600160a01b03165afa8015610164575f9061012d576040516001600160801b039091168152602090f35b34610158575f366003190112610158576040517f00000000000000000000000000000000000000000000000000000000000000006001600160a01b03168152602090f35b346101585760a0366003190112610158576024356001600160a01b03811681036101585761027261079c565b6064358060020b810361015857610305926102de926040519260843560268501526006840152600383015281525f603a600c83012091816040820152816020820152526004357f00000000000000000000000000000000000000000000000000000000000000006108fb565b604080516001600160801b0390941684526020840192909252908201529081906060820190565b0390f35b346101585760403660031901126101585761032d61032561078c565b600435610a42565b604051631e2eaeaf60e01b815260048101919091526020816024817f00000000000000000000000000000000000000000000000000000000000000006001600160a01b03165afa8015610164575f906103a2575b604080516001600160801b038316815260809290921d600f0b602083015290f35b506020813d6020116103cd575b816103bc602093836107c2565b810103126101585760409051610381565b3d91506103af565b3461015857602036600319011261015857608062ffffff806104196004357f000000000000000000000000000000000000000000000000000000000000000061097d565b9294916040519560018060a01b0316865260020b6020860152166040840152166060820152f35b3461015857602036600319011261015857604061047f6004357f0000000000000000000000000000000000000000000000000000000000000000610972565b82519182526020820152f35b34610158576103056102de61049f366107ac565b907f00000000000000000000000000000000000000000000000000000000000000006108fb565b3461015857604036600319011261015857604061047f6104e461078c565b6004357f000000000000000000000000000000000000000000000000000000000000000061087c565b346101585760403660031901126101585761052961032561078c565b604051631afeb18d60e11b81526004810191909152600360248201525f816044817f00000000000000000000000000000000000000000000000000000000000000006001600160a01b03165afa8015610164576080915f916105bc575b50602081015190606060408201519101519060405192600180861b0381168452841d600f0b602084015260408301526060820152f35b6105d891503d805f833e6105d081836107c2565b8101906107f9565b82610586565b346101585760603660031901126101585760406004356105fc61078c565b9061060561079c565b7f0000000000000000000000000000000000000000000000000000000000000000906106318383610972565b9061063d86868661087c565b96909361065661064e82898961087c565b98909761097d565b5050905060020b9160020b82125f1461067c575050505003910382519182526020820152f35b95969593949360020b1361069457505003910361047f565b9493929094030392030361047f565b34610158576040366003190112610158576024358060010b809103610158576106cd600435610a1c565b6005810180911161016f5760405190602082019283526040820152604081526106f76060826107c2565b519020604051631e2eaeaf60e01b815260048101919091526020816024817f00000000000000000000000000000000000000000000000000000000000000006001600160a01b03165afa8015610164575f90610759575b602090604051908152f35b506020813d602011610784575b81610773602093836107c2565b81010312610158576020905161074e565b3d9150610766565b602435908160020b820361015857565b604435908160020b820361015857565b6040906003190112610158576004359060243590565b601f909101601f19168101906001600160401b038211908210176107e557604052565b634e487b7160e01b5f52604160045260245ffd5b602081830312610158578051906001600160401b03821161015857019080601f83011215610158578151916001600160401b0383116107e5578260051b906040519361084860208401866107c2565b845260208085019282010192831161015857602001905b82821061086c5750505090565b815181526020918201910161085f565b929161088791610a42565b6001810180911161016f57604051631afeb18d60e11b8152600481019190915260026024820152915f90839060449082906001600160a01b03165afa918215610164575f926108df575b506040602083015192015190565b6108f49192503d805f833e6105d081836107c2565b905f6108d1565b91610907905f92610a78565b604051631afeb18d60e11b815260048101919091526003602482015291829060449082906001600160a01b03165afa908115610164575f91610958575b506020810151916060604083015192015190565b61096c91503d805f833e6105d081836107c2565b5f610944565b919061088790610a1c565b919061098a602091610a1c565b604051631e2eaeaf60e01b8152600481019190915292839060249082906001600160a01b03165afa918215610164575f926109e8575b506001600160a01b0382169160a081901c60020b9162ffffff60b883901c81169260d01c1690565b9091506020813d602011610a14575b81610a04602093836107c2565b810103126101585751905f6109c0565b3d91506109f7565b604051602081019182526006604082015260408152610a3c6060826107c2565b51902090565b610a4b90610a1c565b6004810180911161016f5760405190602082019260020b8352604082015260408152610a3c6060826107c2565b610a8190610a1c565b6006810180911161016f576040519060208201928352604082015260408152610a3c6060826107c256fea164736f6c634300081a000a' as const;\n"]}
|
|
@@ -1,24 +1,24 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
|
-
var
|
|
3
|
+
var chunk7A4DBBXA_js = require('./chunk-7A4DBBXA.js');
|
|
4
4
|
|
|
5
5
|
// src/types.ts
|
|
6
6
|
var NO_OP_ENABLED_CHAIN_IDS = [
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
7
|
+
chunk7A4DBBXA_js.CHAIN_IDS.MAINNET,
|
|
8
|
+
chunk7A4DBBXA_js.CHAIN_IDS.ETH_SEPOLIA,
|
|
9
|
+
chunk7A4DBBXA_js.CHAIN_IDS.BASE,
|
|
10
|
+
chunk7A4DBBXA_js.CHAIN_IDS.BASE_SEPOLIA,
|
|
11
|
+
chunk7A4DBBXA_js.CHAIN_IDS.UNICHAIN,
|
|
12
|
+
chunk7A4DBBXA_js.CHAIN_IDS.UNICHAIN_SEPOLIA,
|
|
13
|
+
chunk7A4DBBXA_js.CHAIN_IDS.MONAD_TESTNET,
|
|
14
|
+
chunk7A4DBBXA_js.CHAIN_IDS.MONAD_MAINNET
|
|
15
15
|
];
|
|
16
16
|
function isNoOpEnabledChain(chainId) {
|
|
17
17
|
return NO_OP_ENABLED_CHAIN_IDS.includes(chainId);
|
|
18
18
|
}
|
|
19
19
|
var LAUNCHPAD_ENABLED_CHAIN_IDS = [
|
|
20
|
-
|
|
21
|
-
|
|
20
|
+
chunk7A4DBBXA_js.CHAIN_IDS.BASE,
|
|
21
|
+
chunk7A4DBBXA_js.CHAIN_IDS.MONAD_MAINNET
|
|
22
22
|
];
|
|
23
23
|
function isLaunchpadEnabledChain(chainId) {
|
|
24
24
|
return LAUNCHPAD_ENABLED_CHAIN_IDS.includes(chainId);
|
|
@@ -30,11 +30,17 @@ var LockablePoolStatus = /* @__PURE__ */ ((LockablePoolStatus2) => {
|
|
|
30
30
|
LockablePoolStatus2[LockablePoolStatus2["Exited"] = 3] = "Exited";
|
|
31
31
|
return LockablePoolStatus2;
|
|
32
32
|
})(LockablePoolStatus || {});
|
|
33
|
+
var RehypeFeeRoutingMode = /* @__PURE__ */ ((RehypeFeeRoutingMode2) => {
|
|
34
|
+
RehypeFeeRoutingMode2[RehypeFeeRoutingMode2["DirectBuyback"] = 0] = "DirectBuyback";
|
|
35
|
+
RehypeFeeRoutingMode2[RehypeFeeRoutingMode2["RouteToBeneficiaryFees"] = 1] = "RouteToBeneficiaryFees";
|
|
36
|
+
return RehypeFeeRoutingMode2;
|
|
37
|
+
})(RehypeFeeRoutingMode || {});
|
|
33
38
|
|
|
34
39
|
exports.LAUNCHPAD_ENABLED_CHAIN_IDS = LAUNCHPAD_ENABLED_CHAIN_IDS;
|
|
35
40
|
exports.LockablePoolStatus = LockablePoolStatus;
|
|
36
41
|
exports.NO_OP_ENABLED_CHAIN_IDS = NO_OP_ENABLED_CHAIN_IDS;
|
|
42
|
+
exports.RehypeFeeRoutingMode = RehypeFeeRoutingMode;
|
|
37
43
|
exports.isLaunchpadEnabledChain = isLaunchpadEnabledChain;
|
|
38
44
|
exports.isNoOpEnabledChain = isNoOpEnabledChain;
|
|
39
|
-
//# sourceMappingURL=chunk-
|
|
40
|
-
//# sourceMappingURL=chunk-
|
|
45
|
+
//# sourceMappingURL=chunk-65CESA3J.js.map
|
|
46
|
+
//# sourceMappingURL=chunk-65CESA3J.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../src/types.ts"],"names":["CHAIN_IDS","LockablePoolStatus","RehypeFeeRoutingMode"],"mappings":";;;;;AAkFO,IAAM,uBAAA,GAA0B;AAAA,EACrCA,0BAAA,CAAU,OAAA;AAAA,EACVA,0BAAA,CAAU,WAAA;AAAA,EACVA,0BAAA,CAAU,IAAA;AAAA,EACVA,0BAAA,CAAU,YAAA;AAAA,EACVA,0BAAA,CAAU,QAAA;AAAA,EACVA,0BAAA,CAAU,gBAAA;AAAA,EACVA,0BAAA,CAAU,aAAA;AAAA,EACVA,0BAAA,CAAU;AACZ;AAOO,SAAS,mBACd,OAAA,EAC+B;AAC/B,EAAA,OAAQ,uBAAA,CAA8C,SAAS,OAAO,CAAA;AACxE;AAGO,IAAM,2BAAA,GAA8B;AAAA,EACzCA,0BAAA,CAAU,IAAA;AAAA,EACVA,0BAAA,CAAU;AACZ;AAQO,SAAS,wBACd,OAAA,EACoC;AACpC,EAAA,OAAQ,2BAAA,CAAkD,SAAS,OAAO,CAAA;AAC5E;AA8BO,IAAK,kBAAA,qBAAAC,mBAAAA,KAAL;AACL,EAAAA,mBAAAA,CAAAA,mBAAAA,CAAA,mBAAgB,CAAA,CAAA,GAAhB,eAAA;AACA,EAAAA,mBAAAA,CAAAA,mBAAAA,CAAA,iBAAc,CAAA,CAAA,GAAd,aAAA;AACA,EAAAA,mBAAAA,CAAAA,mBAAAA,CAAA,YAAS,CAAA,CAAA,GAAT,QAAA;AACA,EAAAA,mBAAAA,CAAAA,mBAAAA,CAAA,YAAS,CAAA,CAAA,GAAT,QAAA;AAJU,EAAA,OAAAA,mBAAAA;AAAA,CAAA,EAAA,kBAAA,IAAA,EAAA;AA2lBL,IAAK,oBAAA,qBAAAC,qBAAAA,KAAL;AACL,EAAAA,qBAAAA,CAAAA,qBAAAA,CAAA,mBAAgB,CAAA,CAAA,GAAhB,eAAA;AACA,EAAAA,qBAAAA,CAAAA,qBAAAA,CAAA,4BAAyB,CAAA,CAAA,GAAzB,wBAAA;AAFU,EAAA,OAAAA,qBAAAA;AAAA,CAAA,EAAA,oBAAA,IAAA,EAAA","file":"chunk-65CESA3J.js","sourcesContent":["import {\n base,\n baseSepolia,\n ink,\n mainnet,\n sepolia,\n unichain,\n} from 'viem/chains';\nimport { CHAIN_IDS, type SupportedChainId } from './addresses';\n// Re-export SupportedChainId so consumers can import from this module\nexport { type SupportedChainId } from './addresses';\nimport type { Address, WalletClient } from 'viem';\n\nexport type SupportedChain =\n | typeof mainnet\n | typeof sepolia\n | typeof base\n | typeof baseSepolia\n | typeof ink\n | typeof unichain;\n// Use a wide type to avoid cross-package viem type identity issues when linking packages locally.\nexport type SupportedPublicClient = unknown;\n\n// Core configuration types\n// Token configuration (discriminated union)\nexport interface StandardTokenConfig {\n type?: 'standard'; // default behavior (backwards compatible)\n name: string;\n symbol: string;\n tokenURI: string;\n yearlyMintRate?: bigint; // Optional yearly mint rate (in WAD, default: 2% = 0.02e18)\n}\n\nexport interface Doppler404TokenConfig {\n type: 'doppler404';\n name: string;\n symbol: string;\n baseURI: string;\n // Optional unit for DN404 factory (uint256). Defaults to 1000 when omitted.\n unit?: bigint;\n}\n\nexport type TokenConfig = StandardTokenConfig | Doppler404TokenConfig;\n\nexport interface SaleConfig {\n initialSupply: bigint;\n numTokensToSell: bigint;\n numeraire: Address; // e.g., WETH address\n}\n\n// Static Auction Pool configuration\nexport interface StaticPoolConfig {\n startTick: number;\n endTick: number;\n fee: number; // e.g., 3000 for 0.3%\n // Optional parameters for lockable initializer\n numPositions?: number; // Number of liquidity positions (default: based on tick range)\n maxShareToBeSold?: bigint; // Maximum share of tokens to sell (in WAD, default: 1e18 = 100%)\n beneficiaries?: BeneficiaryData[]; // Optional beneficiaries for fee streaming\n}\n\n// Dynamic Auction configuration\nexport interface DynamicAuctionConfig {\n duration: number; // in seconds\n epochLength: number; // in seconds\n startTick: number;\n endTick: number;\n gamma?: number; // Optional, can be auto-calculated\n minProceeds: bigint;\n maxProceeds: bigint;\n numPdSlugs?: number; // Price discovery slugs (optional)\n}\n\n// Vesting configuration\nexport interface VestingConfig {\n duration: number; // in seconds\n cliffDuration: number; // in seconds\n recipients?: Address[]; // Optional array of recipient addresses (defaults to [userAddress] if not specified)\n amounts?: bigint[]; // Optional array of vesting amounts per recipient (must match recipients length if provided)\n}\n\n// Chains where no-op governance is enabled\nexport const NO_OP_ENABLED_CHAIN_IDS = [\n CHAIN_IDS.MAINNET,\n CHAIN_IDS.ETH_SEPOLIA,\n CHAIN_IDS.BASE,\n CHAIN_IDS.BASE_SEPOLIA,\n CHAIN_IDS.UNICHAIN,\n CHAIN_IDS.UNICHAIN_SEPOLIA,\n CHAIN_IDS.MONAD_TESTNET,\n CHAIN_IDS.MONAD_MAINNET,\n] as const;\n\nexport type NoOpEnabledChainId = (typeof NO_OP_ENABLED_CHAIN_IDS)[number];\n\n/**\n * Check if a chain supports no-op governance\n */\nexport function isNoOpEnabledChain(\n chainId: number,\n): chainId is NoOpEnabledChainId {\n return (NO_OP_ENABLED_CHAIN_IDS as readonly number[]).includes(chainId);\n}\n\n// Chains where launchpad governance is enabled\nexport const LAUNCHPAD_ENABLED_CHAIN_IDS = [\n CHAIN_IDS.BASE,\n CHAIN_IDS.MONAD_MAINNET,\n] as const;\n\nexport type LaunchpadEnabledChainId =\n (typeof LAUNCHPAD_ENABLED_CHAIN_IDS)[number];\n\n/**\n * Check if a chain supports launchpad governance\n */\nexport function isLaunchpadEnabledChain(\n chainId: number,\n): chainId is LaunchpadEnabledChainId {\n return (LAUNCHPAD_ENABLED_CHAIN_IDS as readonly number[]).includes(chainId);\n}\n\n// Governance configuration (discriminated union)\nexport type GovernanceDefault = { type: 'default' };\nexport interface GovernanceCustom {\n type: 'custom';\n initialVotingDelay: number;\n initialVotingPeriod: number;\n initialProposalThreshold: bigint;\n}\nexport type GovernanceNoOp = { type: 'noOp' };\nexport interface GovernanceLaunchpad {\n type: 'launchpad';\n multisig: Address;\n}\n\nexport type GovernanceOption<C extends SupportedChainId> =\n | GovernanceDefault\n | GovernanceCustom\n | (C extends NoOpEnabledChainId ? GovernanceNoOp : never)\n | (C extends LaunchpadEnabledChainId ? GovernanceLaunchpad : never);\n\n// Unified beneficiary data used for fee streaming, lockable initializers, and migration configs\n// Uses shares in WAD format (1e18 = 100%) for consistency across all beneficiary configurations\nexport interface BeneficiaryData {\n beneficiary: Address;\n shares: bigint; // shares in WAD (1e18 = 100%)\n}\n\n// Pool status for lockable initializer\nexport enum LockablePoolStatus {\n Uninitialized = 0,\n Initialized = 1,\n Locked = 2,\n Exited = 3,\n}\n\n// Lockable pool state\nexport interface LockablePoolState {\n asset: Address;\n numeraire: Address;\n tickLower: number;\n tickUpper: number;\n maxShareToBeSold: bigint;\n totalTokensOnBondingCurve: bigint;\n status: LockablePoolStatus;\n}\n\n// Multicurve pool state (V4 initializer)\nexport interface MulticurvePoolState {\n asset: Address;\n numeraire: Address;\n fee: number;\n tickSpacing: number;\n status: LockablePoolStatus; // Reuses the same enum\n poolKey: V4PoolKey;\n farTick: number;\n}\n\n// Migration configuration (discriminated union)\nexport interface RehypeDopplerHookMigratorConfig {\n // Optional hook address override. Defaults to chain rehypeDopplerHookMigrator.\n hookAddress?: Address;\n // Destination address for buyback tokens / beneficiary fee claims.\n buybackDestination: Address;\n // Custom swap fee in hundredths of a bip (1e6 = 100%).\n customFee: number;\n // Routing mode for buyback-designated fees. Defaults to DirectBuyback.\n feeRoutingMode?:\n | RehypeFeeRoutingMode\n | 'directBuyback'\n | 'routeToBeneficiaryFees';\n // Current fee routing matrix API.\n feeDistributionInfo?: RehypeFeeDistributionInfo;\n\n /**\n * @deprecated Use feeDistributionInfo.* fields instead.\n * If feeDistributionInfo is omitted, legacy percentages are mirrored to both rows.\n */\n assetBuybackPercentWad?: bigint;\n /**\n * @deprecated Use feeDistributionInfo.* fields instead.\n */\n numeraireBuybackPercentWad?: bigint;\n /**\n * @deprecated Use feeDistributionInfo.* fields instead.\n */\n beneficiaryPercentWad?: bigint;\n /**\n * @deprecated Use feeDistributionInfo.* fields instead.\n */\n lpPercentWad?: bigint;\n}\n\nexport interface DopplerHookMigrationConfig {\n type: 'dopplerHook';\n // Fee for fixed-fee pools, or initial LP fee when useDynamicFee=true.\n fee: number;\n // Use dynamic LP fees on the migrated V4 pool.\n useDynamicFee?: boolean;\n // Tick spacing for the migrated V4 pool.\n tickSpacing: number;\n // Fee lock duration in seconds.\n lockDuration: number;\n // Fee streaming beneficiaries (must be sorted and sum to WAD onchain).\n beneficiaries: BeneficiaryData[];\n // Generic hook configuration (raw initialization calldata).\n hook?: {\n hookAddress: Address;\n onInitializationCalldata?: `0x${string}`;\n };\n // Ergonomic helper for RehypeDopplerHookMigrator initialization.\n rehype?: RehypeDopplerHookMigratorConfig;\n // Optional proceeds split paid out during migration.\n proceedsSplit?: {\n recipient: Address;\n share: bigint;\n };\n}\n\nexport type MigrationConfig =\n | { type: 'uniswapV2' } // Basic migration to a new Uniswap v2 pool\n | {\n type: 'uniswapV4';\n fee: number;\n tickSpacing: number;\n // Configuration for fee streaming via StreamableFeesLocker (optional)\n // When omitted, fees are not locked and beneficiaries are not configured\n // This is useful when using noOp governance where lock duration is not meaningful\n streamableFees?: {\n lockDuration: number; // in seconds\n beneficiaries: BeneficiaryData[]; // Uses shares in WAD (1e18 = 100%)\n };\n }\n | DopplerHookMigrationConfig // Dynamic-only: migration via DopplerHookMigrator\n | { type: 'noOp' }; // No migration - used with lockable beneficiaries\n\n// Create Static Auction parameters\nexport interface CreateStaticAuctionParams<\n C extends SupportedChainId = SupportedChainId,\n> {\n // Token configuration\n token: TokenConfig;\n\n // Sale configuration\n sale: SaleConfig;\n\n // Static Auction (Uniswap v3) Pool configuration\n pool: StaticPoolConfig;\n\n // Vesting configuration (optional)\n vesting?: VestingConfig;\n\n // Governance configuration (required). Use `{ type: 'noOp' }` where enabled,\n // `{ type: 'default' }` for standard defaults, or `{ type: 'custom', ... }` to customize.\n governance: GovernanceOption<C>;\n\n // Explicit Migration Configuration\n migration: MigrationConfig;\n\n // Integrator details\n integrator?: Address;\n userAddress: Address;\n\n // Optional address overrides for on-chain modules used during encoding/creation\n modules?: ModuleAddressOverrides;\n\n // Optional transaction gas limit override for the create() transaction\n // If omitted, SDK will default to 13,500,000 gas for create()\n gas?: bigint;\n}\n\n// Create Dynamic Auction parameters\nexport interface CreateDynamicAuctionParams<\n C extends SupportedChainId = SupportedChainId,\n> {\n // Token configuration\n token: TokenConfig;\n\n // Sale configuration\n sale: SaleConfig;\n\n // Dynamic Auction (Uniswap v4 Hook) configuration\n auction: DynamicAuctionConfig;\n\n // Pool configuration\n pool: {\n fee: number; // e.g., 3000 for 0.3%\n tickSpacing: number;\n };\n\n // Vesting configuration (optional)\n vesting?: VestingConfig;\n\n // Governance configuration (required). Use `{ type: 'noOp' }` where enabled,\n // `{ type: 'default' }` for standard defaults, or `{ type: 'custom', ... }` to customize.\n governance: GovernanceOption<C>;\n\n // Explicit Migration Configuration\n migration: MigrationConfig;\n\n // Integrator details\n integrator?: Address;\n userAddress: Address;\n\n // Time configuration (internal use)\n startTimeOffset?: number;\n blockTimestamp?: number; // Optional: use this block timestamp instead of fetching latest\n\n // Optional transaction gas limit override for the create() transaction\n // If omitted, SDK will default to 13,500,000 gas for create()\n gas?: bigint;\n\n // Optional address overrides for on-chain modules used during encoding/creation\n modules?: ModuleAddressOverrides;\n}\n\n// Price range configuration for automatic tick calculation\nexport interface PriceRange {\n startPrice: number;\n endPrice: number;\n}\n\n// Tick range configuration\nexport interface TickRange {\n startTick: number;\n endTick: number;\n}\n\n// ============================================================================\n// Market Cap Configuration Types\n// ============================================================================\n\n/**\n * Market cap range in USD for price configurations.\n * Used to define start and end market caps for bonding curves.\n */\nexport interface MarketCapRange {\n /** Starting market cap in USD (e.g., 100_000 for $100k) */\n start: number;\n /** Ending market cap in USD (e.g., 10_000_000 for $10M) */\n end: number;\n}\n\n/**\n * Base configuration for market cap-based tick calculations.\n * Used by builder methods to convert market caps to ticks.\n */\nexport interface MarketCapConfig {\n /** Target market cap range in USD */\n marketCap: MarketCapRange;\n /** Price of numeraire in USD (e.g., 3000 for ETH at $3000) */\n numerairePrice: number;\n /**\n * Token supply override. If not provided, inferred from saleConfig.initialSupply.\n * Must include decimals (e.g., parseEther('1000000000') for 1B tokens).\n */\n tokenSupply?: bigint;\n /** Token decimals (default: 18) */\n tokenDecimals?: number;\n /** Numeraire decimals (default: 18) */\n numeraireDecimals?: number;\n}\n\n/**\n * Market cap configuration for V3 Static Auctions.\n * Extends base config with V3-specific parameters.\n */\nexport interface StaticAuctionMarketCapConfig extends MarketCapConfig {\n /** Fee tier in basis points (e.g., 10000 for 1%). Default: 10000 */\n fee?: number;\n /** Number of liquidity positions. Default: 15 */\n numPositions?: number;\n /** Maximum share of tokens to sell per position (WAD). Default: 35% */\n maxShareToBeSold?: bigint;\n}\n\n/**\n * Market cap range for V4 Dynamic Auctions (Dutch auctions).\n * Uses start/min because price descends from start to minimum.\n */\nexport interface DynamicMarketCapRange {\n /** Starting market cap in USD - auction begins here (e.g., 500_000 for $500k) */\n start: number;\n /** Minimum market cap in USD - floor price the auction descends to (e.g., 50_000 for $50k) */\n min: number;\n}\n\n/**\n * Market cap configuration for V4 Dynamic Auctions.\n * Uses start/min (not start/end) because Dutch auctions descend from start to minimum.\n */\nexport interface DynamicAuctionMarketCapConfig {\n /** Target market cap range (start = launch price, min = floor price) */\n marketCap: DynamicMarketCapRange;\n /** Price of numeraire in USD (e.g., 3000 for ETH at $3000) */\n numerairePrice: number;\n /**\n * Token supply override. If not provided, inferred from saleConfig.initialSupply.\n * Must include decimals (e.g., parseEther('1000000000') for 1B tokens).\n */\n tokenSupply?: bigint;\n /** Token decimals (default: 18) */\n tokenDecimals?: number;\n /** Numeraire decimals (default: 18) */\n numeraireDecimals?: number;\n /**\n * Pool fee in basis points. Default: 10000 (1%)\n *\n * V4 pools support any fee from 0 to 100,000 (10%).\n * Standard tiers (100, 500, 3000, 10000) auto-derive tickSpacing.\n * Custom fees require explicit tickSpacing parameter.\n */\n fee?: number;\n /**\n * Tick spacing for the pool. Required for custom fees.\n *\n * Must be <= 30 for Doppler pools (MAX_TICK_SPACING constraint).\n * If not provided with a standard fee tier, defaults to 30.\n */\n tickSpacing?: number;\n /** Minimum proceeds required for successful auction */\n minProceeds: bigint;\n /** Maximum proceeds cap for the auction */\n maxProceeds: bigint;\n /** Auction duration in seconds. Default: 7 days */\n duration?: number;\n /** Epoch length in seconds. Default: 3600 (1 hour) */\n epochLength?: number;\n /** Gamma (tick decay per epoch). Auto-calculated if not provided */\n gamma?: number;\n /** Number of price discovery slugs. Default: 5 */\n numPdSlugs?: number;\n}\n\n/**\n * Result of market cap parameter validation.\n */\nexport interface MarketCapValidationResult {\n /** Whether all parameters are within normal bounds */\n valid: boolean;\n /** Warning messages for unusual but technically valid values */\n warnings: string[];\n}\n\n// ============================================================================\n// Market Cap Helper Function Parameter Types\n// ============================================================================\n\n/**\n * Parameters for converting market cap range to ticks for V3 Static Auctions.\n */\nexport interface StaticAuctionTickParams {\n marketCapRange: MarketCapRange;\n tokenSupply: bigint;\n numerairePriceUSD: number;\n tickSpacing: number;\n tokenDecimals?: number;\n numeraireDecimals?: number;\n}\n\n/**\n * Parameters for converting market cap range to ticks for V4 Dynamic Auctions.\n */\nexport interface DynamicAuctionTickParams {\n marketCapRange: MarketCapRange;\n tokenSupply: bigint;\n numerairePriceUSD: number;\n numeraire: Address;\n tickSpacing: number;\n tokenDecimals?: number;\n numeraireDecimals?: number;\n}\n\n/**\n * Parameters for converting market cap range to ticks for V4 Multicurve pools.\n */\nexport interface MulticurveTickRangeParams {\n marketCapLower: number;\n marketCapUpper: number | 'max';\n tokenSupply: bigint;\n numerairePriceUSD: number;\n tickSpacing: number;\n tokenDecimals?: number;\n numeraireDecimals?: number;\n}\n\n/**\n * Parameters for converting a single market cap to a tick for Multicurve.\n */\nexport interface MulticurveTickParams {\n marketCapUSD: number;\n tokenSupply: bigint;\n numerairePriceUSD: number;\n tickSpacing: number;\n tokenDecimals?: number;\n numeraireDecimals?: number;\n}\n\n/**\n * Parameters for converting a tick to market cap (reverse conversion).\n */\nexport interface TickToMarketCapParams {\n tick: number;\n tokenSupply: bigint;\n numerairePriceUSD: number;\n tokenDecimals?: number;\n numeraireDecimals?: number;\n}\n\n// ============================================================================\n// New Multicurve Market Cap API (no tick math required)\n// ============================================================================\n\n/**\n * Curve configuration for Multicurve pools using market cap ranges.\n * Each curve defines a market cap range and liquidity distribution.\n */\nexport interface MulticurveMarketCapRangeCurve {\n /** Market cap range for this curve */\n marketCap: {\n /** Start market cap in USD (for the first curve, this is the launch price) */\n start: number;\n /** End market cap in USD, or 'max' for MAX_TICK rounded to tick spacing */\n end: number | 'max';\n };\n /** Number of liquidity positions in this curve */\n numPositions: number;\n /** Share of total supply allocated to this curve (WAD, e.g., parseEther('0.3') = 30%) */\n shares: bigint;\n}\n\n/**\n * Market cap-based configuration for Multicurve pools.\n * No tick math required - just specify market caps in USD.\n */\nexport interface MulticurveMarketCapCurvesConfig {\n /** Price of numeraire in USD (e.g., 3000 for ETH at $3000) */\n numerairePrice: number;\n /**\n * Array of curves defining market cap ranges and liquidity distribution.\n * The first curve's marketCap.start is the launch price.\n * Curves must be contiguous (no gaps allowed).\n */\n curves: MulticurveMarketCapRangeCurve[];\n /** Token supply override */\n tokenSupply?: bigint;\n /** Token decimals (default: 18) */\n tokenDecimals?: number;\n /** Numeraire decimals (default: 18) */\n numeraireDecimals?: number;\n /** Fee tier (default: FEE_TIERS.LOW) */\n fee?: number;\n /** Tick spacing (derived from fee if not provided) */\n tickSpacing?: number;\n /** Optional beneficiaries for fee streaming */\n beneficiaries?: BeneficiaryData[];\n}\n\n// Build configuration for static auctions (V3-style)\nexport interface StaticAuctionBuildConfig {\n // Token details\n name: string;\n symbol: string;\n totalSupply?: bigint; // default: 1 billion\n numTokensToSell?: bigint; // default: 900 million\n tokenURI: string;\n\n // Time parameters\n startTimeOffset?: number; // Optional - seconds to add to current block timestamp (default: 30)\n\n // Price parameters - must provide either priceRange or tickRange\n numeraire: Address; // Required for V3\n tickRange?: TickRange;\n priceRange?: PriceRange;\n fee?: number; // default: 10000 (1%)\n\n // Pool parameters (V3 specific)\n numPositions?: number; // default: 15\n maxShareToBeSold?: bigint; // default: 35% in WAD\n\n // Vesting parameters\n yearlyMintRate?: bigint; // default: 2%\n vestingDuration?: bigint; // default: 1 year\n recipients?: Address[]; // defaults to [userAddress]\n amounts?: bigint[]; // defaults based on pre-mint calculation\n\n // Migration configuration\n migration: MigrationConfig;\n\n // Other parameters\n integrator?: Address;\n useGovernance?: boolean; // default: true\n}\n\n// Build configuration for dynamic auctions (V4-style)\nexport interface DynamicAuctionBuildConfig {\n // Token details\n name: string;\n symbol: string;\n totalSupply: bigint;\n numTokensToSell: bigint;\n tokenURI: string;\n\n // Time parameters\n startTimeOffset?: number; // Optional - seconds to add to block timestamp (default: 30)\n blockTimestamp?: number; // Optional - specific block timestamp to use (default: fetch latest)\n duration?: number; // in seconds (default: 604800 = 7 days)\n epochLength?: number; // in seconds (default: 3600)\n\n // Price parameters - must provide either priceRange or tickRange\n numeraire?: Address; // defaults to zero address\n tickRange?: TickRange;\n priceRange?: PriceRange;\n tickSpacing: number;\n gamma?: number; // auto-calculated if not provided\n fee: number; // In basis points\n\n // Sale parameters\n minProceeds: bigint;\n maxProceeds: bigint;\n numPdSlugs?: number; // default: 5\n\n // Vesting parameters\n yearlyMintRate?: bigint; // default: 2%\n vestingDuration: bigint;\n recipients: Address[];\n amounts: bigint[];\n\n // Migration configuration\n migration: MigrationConfig;\n\n // Other parameters\n integrator?: Address;\n useGovernance?: boolean; // default: true\n}\n\n// SDK initialization configuration\nexport interface DopplerSDKConfig {\n publicClient: SupportedPublicClient;\n walletClient?: WalletClient;\n chainId: number;\n}\n\n// Pool information types\nexport interface PoolInfo {\n address: Address;\n tokenAddress: Address;\n numeraireAddress: Address;\n fee: number;\n liquidity: bigint;\n sqrtPriceX96: bigint;\n}\n\nexport interface HookInfo {\n hookAddress: Address;\n tokenAddress: Address;\n numeraireAddress: Address;\n poolId: string;\n currentEpoch: number;\n totalProceeds: bigint;\n totalTokensSold: bigint;\n earlyExit: boolean;\n insufficientProceeds: boolean;\n startingTime: bigint;\n endingTime: bigint;\n epochLength: bigint;\n minimumProceeds: bigint;\n maximumProceeds: bigint;\n}\n\n// Quote result type\nexport interface QuoteResult {\n amountOut: bigint;\n priceImpact: number;\n fee: bigint;\n route: string[];\n}\n\n// Lockable Uniswap V3 Initializer encode params\nexport interface LockableV3InitializerParams {\n fee: number;\n tickLower: number;\n tickUpper: number;\n numPositions: number;\n maxShareToBeSold: bigint;\n beneficiaries: BeneficiaryData[];\n}\n\n// Multicurve curve configuration (mirrors solidity struct)\nexport interface MulticurveCurve {\n tickLower: number; // int24\n tickUpper: number; // int24\n numPositions: number; // uint16\n shares: bigint; // uint256 (WAD)\n}\n\nexport type MulticurveMarketCapPreset = 'low' | 'medium' | 'high';\n\nexport interface V4PoolKey {\n currency0: Address;\n currency1: Address;\n fee: number;\n tickSpacing: number;\n hooks: Address;\n}\n\nexport interface MulticurveBundleExactOutResult {\n asset: Address;\n poolKey: V4PoolKey;\n amountIn: bigint;\n gasEstimate: bigint;\n}\n\nexport interface MulticurveBundleExactInResult {\n asset: Address;\n poolKey: V4PoolKey;\n amountOut: bigint;\n gasEstimate: bigint;\n}\n\n// RehypeDopplerHook configuration for fee distribution and buyback\nexport interface RehypeFeeDistributionInfo {\n assetFeesToAssetBuybackWad: bigint;\n assetFeesToNumeraireBuybackWad: bigint;\n assetFeesToBeneficiaryWad: bigint;\n assetFeesToLpWad: bigint;\n numeraireFeesToAssetBuybackWad: bigint;\n numeraireFeesToNumeraireBuybackWad: bigint;\n numeraireFeesToBeneficiaryWad: bigint;\n numeraireFeesToLpWad: bigint;\n}\n\nexport enum RehypeFeeRoutingMode {\n DirectBuyback = 0,\n RouteToBeneficiaryFees = 1,\n}\n\n// Initializer-side RehypeDopplerHook configuration.\n// Supports both the current API and deprecated legacy fields for compatibility.\nexport interface RehypeDopplerHookConfig {\n // The hook contract address (must be whitelisted in the initializer)\n hookAddress: Address;\n // Destination address for buyback tokens / beneficiary fee claims\n buybackDestination: Address;\n\n // Current fee schedule API\n startFee?: number;\n endFee?: number;\n durationSeconds?: number | bigint;\n startingTime?: number | bigint | Date;\n feeRoutingMode?:\n | RehypeFeeRoutingMode\n | 'directBuyback'\n | 'routeToBeneficiaryFees';\n feeDistributionInfo?: RehypeFeeDistributionInfo;\n\n /**\n * @deprecated Use startFee/endFee instead. When provided alone, maps to startFee=endFee=customFee.\n */\n customFee?: number;\n /**\n * @deprecated Use feeDistributionInfo.* fields instead.\n * If feeDistributionInfo is omitted, legacy percentages are mirrored to both rows.\n */\n assetBuybackPercentWad?: bigint;\n /**\n * @deprecated Use feeDistributionInfo.* fields instead.\n */\n numeraireBuybackPercentWad?: bigint;\n /**\n * @deprecated Use feeDistributionInfo.* fields instead.\n */\n beneficiaryPercentWad?: bigint;\n /**\n * @deprecated Use feeDistributionInfo.* fields instead.\n */\n lpPercentWad?: bigint;\n\n // Optional graduation calldata (called when pool graduates)\n graduationCalldata?: `0x${string}`;\n\n // Graduation threshold configuration (rehype-only)\n // Market cap in USD at which pool can graduate. Requires numerairePrice (from withCurves() or explicit).\n graduationMarketCap?: number;\n // Price of numeraire in USD. Optional if using withCurves() (reuses that value). Required with poolConfig().\n numerairePrice?: number;\n // Direct tick value for graduation threshold. Use graduationMarketCap for USD-based config.\n farTick?: number;\n}\n\n// Decay fee schedule state for multicurve pools using a dynamic-fee hook\nexport interface MulticurveDecayFeeSchedule {\n startingTime: number;\n startFee: number;\n endFee: number;\n lastFee: number;\n durationSeconds: number;\n}\n\nexport type MulticurveInitializerConfig =\n | { type: 'standard' }\n | { type: 'scheduled'; startTime: number }\n | {\n type: 'decay';\n startTime: number;\n startFee: number;\n durationSeconds: number;\n }\n | { type: 'rehype'; config: RehypeDopplerHookConfig };\n\n// Create Multicurve initializer parameters\nexport interface CreateMulticurveParams<\n C extends SupportedChainId = SupportedChainId,\n> {\n // Token configuration\n token: TokenConfig;\n\n // Sale configuration\n sale: SaleConfig;\n\n // Pool configuration for multicurve initializer\n pool: {\n // For decay initializer mode, this is the terminal fee (endFee).\n fee: number;\n tickSpacing: number;\n curves: MulticurveCurve[];\n // Optional beneficiaries to lock the pool (fee collection only, no migration)\n beneficiaries?: BeneficiaryData[];\n };\n\n // Preferred initializer configuration. Defaults to { type: 'standard' }.\n initializer?: MulticurveInitializerConfig;\n\n /**\n * @deprecated Use initializer: { type: 'scheduled', startTime } instead.\n * Retained for backwards compatibility.\n */\n // Optional scheduled launch configuration\n schedule?: {\n startTime: number;\n };\n\n /**\n * @deprecated Use initializer: { type: 'rehype', config } instead.\n * Retained for backwards compatibility.\n */\n dopplerHook?: RehypeDopplerHookConfig;\n\n // Vesting configuration (optional)\n vesting?: VestingConfig;\n\n // Governance configuration\n governance: GovernanceOption<C>;\n\n // Migration configuration (can be any supported migrator: V2, V3, or V4)\n migration: MigrationConfig;\n\n // Integrator details\n integrator?: Address;\n userAddress: Address;\n\n // Optional address overrides for on-chain modules used during encoding/creation\n modules?: ModuleAddressOverrides;\n\n // Optional transaction gas limit override for the create() transaction\n gas?: bigint;\n}\n\n// Final Params object that gets passed as arg to create\nexport interface CreateParams {\n initialSupply: bigint;\n numTokensToSell: bigint;\n numeraire: Address;\n tokenFactory: Address;\n tokenFactoryData: `0x${string}`;\n governanceFactory: Address;\n governanceFactoryData: `0x${string}`;\n poolInitializer: Address;\n poolInitializerData: `0x${string}`;\n liquidityMigrator: Address;\n liquidityMigratorData: `0x${string}`;\n integrator: Address;\n salt: `0x${string}`;\n}\n\n// Optional per-call module address overrides. When provided, these take precedence\n// over chain defaults resolved via getAddresses(chainId).\nexport interface ModuleAddressOverrides {\n // Core deployment & routing\n airlock?: Address;\n tokenFactory?: Address;\n\n // Initializers\n v3Initializer?: Address;\n lockableV3Initializer?: Address;\n v4Initializer?: Address;\n v4MulticurveInitializer?: Address;\n v4ScheduledMulticurveInitializer?: Address;\n v4DecayMulticurveInitializer?: Address;\n dopplerHookInitializer?: Address;\n rehypeDopplerHookInitializer?: Address;\n\n // DopplerHooks\n /**\n * @deprecated Use rehypeDopplerHookInitializer instead.\n */\n rehypeDopplerHook?: Address;\n\n // Governance\n governanceFactory?: Address;\n\n // Dynamic auction infra\n poolManager?: Address;\n dopplerDeployer?: Address;\n\n // Migrators\n v2Migrator?: Address;\n v4Migrator?: Address;\n dopplerHookMigrator?: Address;\n rehypeDopplerHookMigrator?: Address;\n noOpMigrator?: Address;\n}\n"]}
|