@whetstone-research/doppler-sdk 0.0.24 → 1.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +69 -0
- package/dist/chunk-3LTCKCJC.js +319 -0
- package/dist/chunk-3LTCKCJC.js.map +1 -0
- package/dist/chunk-PZ5AY32C.js +9 -0
- package/dist/{chunk-4XN6DQBW.js.map → chunk-PZ5AY32C.js.map} +1 -1
- package/dist/chunk-RO6R66OM.js +974 -0
- package/dist/chunk-RO6R66OM.js.map +1 -0
- package/dist/evm/index.d.ts +8533 -0
- package/dist/evm/index.js +15055 -0
- package/dist/evm/index.js.map +1 -0
- package/dist/oracle-BSvZ6pxp.d.ts +820 -0
- package/dist/pda-RVIHNLRP.js +4 -0
- package/dist/pda-RVIHNLRP.js.map +1 -0
- package/dist/solana/index.d.ts +2495 -0
- package/dist/solana/index.js +2209 -0
- package/dist/solana/index.js.map +1 -0
- package/dist/solana/react/index.d.ts +1046 -0
- package/dist/solana/react/index.js +1436 -0
- package/dist/solana/react/index.js.map +1 -0
- package/package.json +36 -20
- package/dist/DopplerSDK.d.mts +0 -106
- package/dist/DopplerSDK.d.ts +0 -106
- package/dist/DopplerSDK.js +0 -53
- package/dist/DopplerSDK.js.map +0 -1
- package/dist/DopplerSDK.mjs +0 -44
- package/dist/DopplerSDK.mjs.map +0 -1
- package/dist/abis/bytecodes/derc20.d.mts +0 -3
- package/dist/abis/bytecodes/derc20.d.ts +0 -3
- package/dist/abis/bytecodes/derc20.js +0 -9
- package/dist/abis/bytecodes/derc20.js.map +0 -1
- package/dist/abis/bytecodes/derc20.mjs +0 -3
- package/dist/abis/bytecodes/derc20.mjs.map +0 -1
- package/dist/abis/bytecodes/derc2080.d.mts +0 -3
- package/dist/abis/bytecodes/derc2080.d.ts +0 -3
- package/dist/abis/bytecodes/derc2080.js +0 -9
- package/dist/abis/bytecodes/derc2080.js.map +0 -1
- package/dist/abis/bytecodes/derc2080.mjs +0 -3
- package/dist/abis/bytecodes/derc2080.mjs.map +0 -1
- package/dist/abis/bytecodes/doppler.d.mts +0 -3
- package/dist/abis/bytecodes/doppler.d.ts +0 -3
- package/dist/abis/bytecodes/doppler.js +0 -9
- package/dist/abis/bytecodes/doppler.js.map +0 -1
- package/dist/abis/bytecodes/doppler.mjs +0 -3
- package/dist/abis/bytecodes/doppler.mjs.map +0 -1
- package/dist/abis/bytecodes/dopplerDN404.d.mts +0 -3
- package/dist/abis/bytecodes/dopplerDN404.d.ts +0 -3
- package/dist/abis/bytecodes/dopplerDN404.js +0 -9
- package/dist/abis/bytecodes/dopplerDN404.js.map +0 -1
- package/dist/abis/bytecodes/dopplerDN404.mjs +0 -3
- package/dist/abis/bytecodes/dopplerDN404.mjs.map +0 -1
- package/dist/abis/bytecodes/stateView.d.mts +0 -3
- package/dist/abis/bytecodes/stateView.d.ts +0 -3
- package/dist/abis/bytecodes/stateView.js +0 -9
- package/dist/abis/bytecodes/stateView.js.map +0 -1
- package/dist/abis/bytecodes/stateView.mjs +0 -3
- package/dist/abis/bytecodes/stateView.mjs.map +0 -1
- package/dist/abis/bytecodes.d.mts +0 -5
- package/dist/abis/bytecodes.d.ts +0 -5
- package/dist/abis/bytecodes.js +0 -33
- package/dist/abis/bytecodes.js.map +0 -1
- package/dist/abis/bytecodes.mjs +0 -8
- package/dist/abis/bytecodes.mjs.map +0 -1
- package/dist/abis/index.d.mts +0 -3871
- package/dist/abis/index.d.ts +0 -3871
- package/dist/abis/index.js +0 -130
- package/dist/abis/index.js.map +0 -1
- package/dist/abis/index.mjs +0 -9
- package/dist/abis/index.mjs.map +0 -1
- package/dist/addresses.d.mts +0 -69
- package/dist/addresses.d.ts +0 -69
- package/dist/addresses.js +0 -29
- package/dist/addresses.js.map +0 -1
- package/dist/addresses.mjs +0 -4
- package/dist/addresses.mjs.map +0 -1
- package/dist/builders/DynamicAuctionBuilder.d.mts +0 -138
- package/dist/builders/DynamicAuctionBuilder.d.ts +0 -138
- package/dist/builders/DynamicAuctionBuilder.js +0 -35
- package/dist/builders/DynamicAuctionBuilder.js.map +0 -1
- package/dist/builders/DynamicAuctionBuilder.mjs +0 -26
- package/dist/builders/DynamicAuctionBuilder.mjs.map +0 -1
- package/dist/builders/MulticurveBuilder.d.mts +0 -196
- package/dist/builders/MulticurveBuilder.d.ts +0 -196
- package/dist/builders/MulticurveBuilder.js +0 -35
- package/dist/builders/MulticurveBuilder.js.map +0 -1
- package/dist/builders/MulticurveBuilder.mjs +0 -26
- package/dist/builders/MulticurveBuilder.mjs.map +0 -1
- package/dist/builders/StaticAuctionBuilder.d.mts +0 -131
- package/dist/builders/StaticAuctionBuilder.d.ts +0 -131
- package/dist/builders/StaticAuctionBuilder.js +0 -35
- package/dist/builders/StaticAuctionBuilder.js.map +0 -1
- package/dist/builders/StaticAuctionBuilder.mjs +0 -26
- package/dist/builders/StaticAuctionBuilder.mjs.map +0 -1
- package/dist/builders/index.d.mts +0 -8
- package/dist/builders/index.d.ts +0 -8
- package/dist/builders/index.js +0 -62
- package/dist/builders/index.js.map +0 -1
- package/dist/builders/index.mjs +0 -29
- package/dist/builders/index.mjs.map +0 -1
- package/dist/builders/shared.d.mts +0 -115
- package/dist/builders/shared.d.ts +0 -115
- package/dist/builders/shared.js +0 -46
- package/dist/builders/shared.js.map +0 -1
- package/dist/builders/shared.mjs +0 -25
- package/dist/builders/shared.mjs.map +0 -1
- package/dist/chunk-25GEBO3B.mjs +0 -219
- package/dist/chunk-25GEBO3B.mjs.map +0 -1
- package/dist/chunk-2A3B3NVB.js +0 -737
- package/dist/chunk-2A3B3NVB.js.map +0 -1
- package/dist/chunk-3NMGCQJ4.mjs +0 -6
- package/dist/chunk-3NMGCQJ4.mjs.map +0 -1
- package/dist/chunk-44CYUEPG.js +0 -377
- package/dist/chunk-44CYUEPG.js.map +0 -1
- package/dist/chunk-4VWQNNNW.js +0 -233
- package/dist/chunk-4VWQNNNW.js.map +0 -1
- package/dist/chunk-4XN6DQBW.js +0 -4
- package/dist/chunk-5GQJRNFL.mjs +0 -40
- package/dist/chunk-5GQJRNFL.mjs.map +0 -1
- package/dist/chunk-5JHXBDZD.js +0 -265
- package/dist/chunk-5JHXBDZD.js.map +0 -1
- package/dist/chunk-5TQOT6CW.js +0 -8
- package/dist/chunk-5TQOT6CW.js.map +0 -1
- package/dist/chunk-65CESA3J.js +0 -46
- package/dist/chunk-65CESA3J.js.map +0 -1
- package/dist/chunk-6BQY5EPB.js +0 -144
- package/dist/chunk-6BQY5EPB.js.map +0 -1
- package/dist/chunk-6H6X3VTZ.js +0 -18
- package/dist/chunk-6H6X3VTZ.js.map +0 -1
- package/dist/chunk-7A4DBBXA.js +0 -311
- package/dist/chunk-7A4DBBXA.js.map +0 -1
- package/dist/chunk-7M57PU6V.js +0 -28
- package/dist/chunk-7M57PU6V.js.map +0 -1
- package/dist/chunk-7ZUV6WPX.mjs +0 -3
- package/dist/chunk-7ZUV6WPX.mjs.map +0 -1
- package/dist/chunk-A2CJYRRQ.js +0 -330
- package/dist/chunk-A2CJYRRQ.js.map +0 -1
- package/dist/chunk-ABT6AT7C.mjs +0 -16
- package/dist/chunk-ABT6AT7C.mjs.map +0 -1
- package/dist/chunk-BK3S6SVR.js +0 -2707
- package/dist/chunk-BK3S6SVR.js.map +0 -1
- package/dist/chunk-BQZTELUX.js +0 -45
- package/dist/chunk-BQZTELUX.js.map +0 -1
- package/dist/chunk-CFAAYL5M.mjs +0 -26
- package/dist/chunk-CFAAYL5M.mjs.map +0 -1
- package/dist/chunk-CFXXUZJY.js +0 -275
- package/dist/chunk-CFXXUZJY.js.map +0 -1
- package/dist/chunk-CWTGQAOG.mjs +0 -72
- package/dist/chunk-CWTGQAOG.mjs.map +0 -1
- package/dist/chunk-DCWF3EMP.js +0 -171
- package/dist/chunk-DCWF3EMP.js.map +0 -1
- package/dist/chunk-DOUF6NON.mjs +0 -3
- package/dist/chunk-DOUF6NON.mjs.map +0 -1
- package/dist/chunk-DQJXCZU2.mjs +0 -318
- package/dist/chunk-DQJXCZU2.mjs.map +0 -1
- package/dist/chunk-DSYPZETD.js +0 -4
- package/dist/chunk-DSYPZETD.js.map +0 -1
- package/dist/chunk-F2BYG63D.mjs +0 -145
- package/dist/chunk-F2BYG63D.mjs.map +0 -1
- package/dist/chunk-FNUBKONK.js +0 -291
- package/dist/chunk-FNUBKONK.js.map +0 -1
- package/dist/chunk-FOESYJP3.mjs +0 -3
- package/dist/chunk-FOESYJP3.mjs.map +0 -1
- package/dist/chunk-FXTGIKQG.mjs +0 -3
- package/dist/chunk-FXTGIKQG.mjs.map +0 -1
- package/dist/chunk-GSBQIVME.mjs +0 -278
- package/dist/chunk-GSBQIVME.mjs.map +0 -1
- package/dist/chunk-H3B54PFV.mjs +0 -17
- package/dist/chunk-H3B54PFV.mjs.map +0 -1
- package/dist/chunk-HJFVRV47.js +0 -120
- package/dist/chunk-HJFVRV47.js.map +0 -1
- package/dist/chunk-IIM2CSDQ.js +0 -147
- package/dist/chunk-IIM2CSDQ.js.map +0 -1
- package/dist/chunk-IUTIHSLH.mjs +0 -295
- package/dist/chunk-IUTIHSLH.mjs.map +0 -1
- package/dist/chunk-IUZ3BBQP.mjs +0 -117
- package/dist/chunk-IUZ3BBQP.mjs.map +0 -1
- package/dist/chunk-IWJOPXYN.mjs +0 -96
- package/dist/chunk-IWJOPXYN.mjs.map +0 -1
- package/dist/chunk-IX4V4UGW.mjs +0 -141
- package/dist/chunk-IX4V4UGW.mjs.map +0 -1
- package/dist/chunk-J62YDWIK.js +0 -8
- package/dist/chunk-J62YDWIK.js.map +0 -1
- package/dist/chunk-JIKAD4YL.js +0 -4
- package/dist/chunk-JIKAD4YL.js.map +0 -1
- package/dist/chunk-JLUOFAE4.mjs +0 -2531
- package/dist/chunk-JLUOFAE4.mjs.map +0 -1
- package/dist/chunk-KAZQJ24E.mjs +0 -59
- package/dist/chunk-KAZQJ24E.mjs.map +0 -1
- package/dist/chunk-KHUE77HC.js +0 -81
- package/dist/chunk-KHUE77HC.js.map +0 -1
- package/dist/chunk-KOAC3BBP.mjs +0 -11
- package/dist/chunk-KOAC3BBP.mjs.map +0 -1
- package/dist/chunk-LW3CYA27.mjs +0 -2705
- package/dist/chunk-LW3CYA27.mjs.map +0 -1
- package/dist/chunk-MEA2C5YX.js +0 -143
- package/dist/chunk-MEA2C5YX.js.map +0 -1
- package/dist/chunk-MU56HCUI.js +0 -2556
- package/dist/chunk-MU56HCUI.js.map +0 -1
- package/dist/chunk-OCIY7QEJ.mjs +0 -169
- package/dist/chunk-OCIY7QEJ.mjs.map +0 -1
- package/dist/chunk-OHA5KJ2M.mjs +0 -6
- package/dist/chunk-OHA5KJ2M.mjs.map +0 -1
- package/dist/chunk-P25HBGP5.mjs +0 -3
- package/dist/chunk-P25HBGP5.mjs.map +0 -1
- package/dist/chunk-P563HTVU.js +0 -164
- package/dist/chunk-P563HTVU.js.map +0 -1
- package/dist/chunk-P7CHGWY7.js +0 -4
- package/dist/chunk-P7CHGWY7.js.map +0 -1
- package/dist/chunk-PGYTMRP3.js +0 -277
- package/dist/chunk-PGYTMRP3.js.map +0 -1
- package/dist/chunk-QAPQGDWK.js +0 -8
- package/dist/chunk-QAPQGDWK.js.map +0 -1
- package/dist/chunk-QHBKRUBY.mjs +0 -328
- package/dist/chunk-QHBKRUBY.mjs.map +0 -1
- package/dist/chunk-QOYI7WCH.js +0 -120
- package/dist/chunk-QOYI7WCH.js.map +0 -1
- package/dist/chunk-QRTABC4Z.js +0 -8
- package/dist/chunk-QRTABC4Z.js.map +0 -1
- package/dist/chunk-QSQGLWNY.mjs +0 -3
- package/dist/chunk-QSQGLWNY.mjs.map +0 -1
- package/dist/chunk-QUBD6HUZ.mjs +0 -735
- package/dist/chunk-QUBD6HUZ.mjs.map +0 -1
- package/dist/chunk-RDTIXP6S.mjs +0 -263
- package/dist/chunk-RDTIXP6S.mjs.map +0 -1
- package/dist/chunk-RLOZWHRR.js +0 -320
- package/dist/chunk-RLOZWHRR.js.map +0 -1
- package/dist/chunk-RV64M4Q6.mjs +0 -3
- package/dist/chunk-RV64M4Q6.mjs.map +0 -1
- package/dist/chunk-SWWLOD7Q.mjs +0 -6
- package/dist/chunk-SWWLOD7Q.mjs.map +0 -1
- package/dist/chunk-T3UA4MJL.js +0 -4
- package/dist/chunk-T3UA4MJL.js.map +0 -1
- package/dist/chunk-TEWAXP5C.mjs +0 -162
- package/dist/chunk-TEWAXP5C.mjs.map +0 -1
- package/dist/chunk-THEIRDGE.mjs +0 -273
- package/dist/chunk-THEIRDGE.mjs.map +0 -1
- package/dist/chunk-U3GOWK6J.mjs +0 -6
- package/dist/chunk-U3GOWK6J.mjs.map +0 -1
- package/dist/chunk-UPVKABAV.js +0 -19
- package/dist/chunk-UPVKABAV.js.map +0 -1
- package/dist/chunk-VEIVYUYF.js +0 -4
- package/dist/chunk-VEIVYUYF.js.map +0 -1
- package/dist/chunk-VKSD3KXF.mjs +0 -275
- package/dist/chunk-VKSD3KXF.mjs.map +0 -1
- package/dist/chunk-VYSOAGRU.mjs +0 -6
- package/dist/chunk-VYSOAGRU.mjs.map +0 -1
- package/dist/chunk-WDC53TM7.mjs +0 -305
- package/dist/chunk-WDC53TM7.mjs.map +0 -1
- package/dist/chunk-WKWP42TD.mjs +0 -39
- package/dist/chunk-WKWP42TD.mjs.map +0 -1
- package/dist/chunk-WNUB3UTT.js +0 -241
- package/dist/chunk-WNUB3UTT.js.map +0 -1
- package/dist/chunk-WNWK2QMU.mjs +0 -375
- package/dist/chunk-WNWK2QMU.mjs.map +0 -1
- package/dist/chunk-WQHTNL5L.js +0 -4
- package/dist/chunk-WQHTNL5L.js.map +0 -1
- package/dist/chunk-WZF5XNBC.js +0 -297
- package/dist/chunk-WZF5XNBC.js.map +0 -1
- package/dist/chunk-X3UMAHOJ.js +0 -4
- package/dist/chunk-X3UMAHOJ.js.map +0 -1
- package/dist/chunk-XMFOZYNI.js +0 -8
- package/dist/chunk-XMFOZYNI.js.map +0 -1
- package/dist/chunk-XNMXN5SZ.mjs +0 -3
- package/dist/chunk-XNMXN5SZ.mjs.map +0 -1
- package/dist/chunk-XSJTASPK.js +0 -13
- package/dist/chunk-XSJTASPK.js.map +0 -1
- package/dist/chunk-YBK6EBA5.mjs +0 -239
- package/dist/chunk-YBK6EBA5.mjs.map +0 -1
- package/dist/chunk-YYLD3AJ7.js +0 -61
- package/dist/chunk-YYLD3AJ7.js.map +0 -1
- package/dist/chunk-ZEDJUNC6.mjs +0 -115
- package/dist/chunk-ZEDJUNC6.mjs.map +0 -1
- package/dist/constants.d.mts +0 -91
- package/dist/constants.d.ts +0 -91
- package/dist/constants.js +0 -196
- package/dist/constants.js.map +0 -1
- package/dist/constants.mjs +0 -3
- package/dist/constants.mjs.map +0 -1
- package/dist/deployments.generated.d.mts +0 -275
- package/dist/deployments.generated.d.ts +0 -275
- package/dist/deployments.generated.js +0 -12
- package/dist/deployments.generated.js.map +0 -1
- package/dist/deployments.generated.mjs +0 -3
- package/dist/deployments.generated.mjs.map +0 -1
- package/dist/entities/DopplerFactory.d.mts +0 -272
- package/dist/entities/DopplerFactory.d.ts +0 -272
- package/dist/entities/DopplerFactory.js +0 -34
- package/dist/entities/DopplerFactory.js.map +0 -1
- package/dist/entities/DopplerFactory.mjs +0 -25
- package/dist/entities/DopplerFactory.mjs.map +0 -1
- package/dist/entities/auction/DynamicAuction.d.mts +0 -72
- package/dist/entities/auction/DynamicAuction.d.ts +0 -72
- package/dist/entities/auction/DynamicAuction.js +0 -21
- package/dist/entities/auction/DynamicAuction.js.map +0 -1
- package/dist/entities/auction/DynamicAuction.mjs +0 -12
- package/dist/entities/auction/DynamicAuction.mjs.map +0 -1
- package/dist/entities/auction/MulticurvePool.d.mts +0 -78
- package/dist/entities/auction/MulticurvePool.d.ts +0 -78
- package/dist/entities/auction/MulticurvePool.js +0 -24
- package/dist/entities/auction/MulticurvePool.js.map +0 -1
- package/dist/entities/auction/MulticurvePool.mjs +0 -15
- package/dist/entities/auction/MulticurvePool.mjs.map +0 -1
- package/dist/entities/auction/RehypeDopplerHook.d.mts +0 -57
- package/dist/entities/auction/RehypeDopplerHook.d.ts +0 -57
- package/dist/entities/auction/RehypeDopplerHook.js +0 -34
- package/dist/entities/auction/RehypeDopplerHook.js.map +0 -1
- package/dist/entities/auction/RehypeDopplerHook.mjs +0 -25
- package/dist/entities/auction/RehypeDopplerHook.mjs.map +0 -1
- package/dist/entities/auction/RehypeDopplerHookMigrator.d.mts +0 -48
- package/dist/entities/auction/RehypeDopplerHookMigrator.d.ts +0 -48
- package/dist/entities/auction/RehypeDopplerHookMigrator.js +0 -34
- package/dist/entities/auction/RehypeDopplerHookMigrator.js.map +0 -1
- package/dist/entities/auction/RehypeDopplerHookMigrator.mjs +0 -25
- package/dist/entities/auction/RehypeDopplerHookMigrator.mjs.map +0 -1
- package/dist/entities/auction/StaticAuction.d.mts +0 -44
- package/dist/entities/auction/StaticAuction.d.ts +0 -44
- package/dist/entities/auction/StaticAuction.js +0 -21
- package/dist/entities/auction/StaticAuction.js.map +0 -1
- package/dist/entities/auction/StaticAuction.mjs +0 -12
- package/dist/entities/auction/StaticAuction.mjs.map +0 -1
- package/dist/entities/auction/index.d.mts +0 -9
- package/dist/entities/auction/index.d.ts +0 -9
- package/dist/entities/auction/index.js +0 -55
- package/dist/entities/auction/index.js.map +0 -1
- package/dist/entities/auction/index.mjs +0 -30
- package/dist/entities/auction/index.mjs.map +0 -1
- package/dist/entities/quoter/Quoter.d.mts +0 -150
- package/dist/entities/quoter/Quoter.d.ts +0 -150
- package/dist/entities/quoter/Quoter.js +0 -21
- package/dist/entities/quoter/Quoter.js.map +0 -1
- package/dist/entities/quoter/Quoter.mjs +0 -12
- package/dist/entities/quoter/Quoter.mjs.map +0 -1
- package/dist/entities/quoter/index.d.mts +0 -5
- package/dist/entities/quoter/index.d.ts +0 -5
- package/dist/entities/quoter/index.js +0 -22
- package/dist/entities/quoter/index.js.map +0 -1
- package/dist/entities/quoter/index.mjs +0 -13
- package/dist/entities/quoter/index.mjs.map +0 -1
- package/dist/entities/token/derc20/Derc20.d.mts +0 -102
- package/dist/entities/token/derc20/Derc20.d.ts +0 -102
- package/dist/entities/token/derc20/Derc20.js +0 -19
- package/dist/entities/token/derc20/Derc20.js.map +0 -1
- package/dist/entities/token/derc20/Derc20.mjs +0 -10
- package/dist/entities/token/derc20/Derc20.mjs.map +0 -1
- package/dist/entities/token/derc20/index.d.mts +0 -5
- package/dist/entities/token/derc20/index.d.ts +0 -5
- package/dist/entities/token/derc20/index.js +0 -20
- package/dist/entities/token/derc20/index.js.map +0 -1
- package/dist/entities/token/derc20/index.mjs +0 -11
- package/dist/entities/token/derc20/index.mjs.map +0 -1
- package/dist/entities/token/eth/Eth.d.mts +0 -54
- package/dist/entities/token/eth/Eth.d.ts +0 -54
- package/dist/entities/token/eth/Eth.js +0 -12
- package/dist/entities/token/eth/Eth.js.map +0 -1
- package/dist/entities/token/eth/Eth.mjs +0 -3
- package/dist/entities/token/eth/Eth.mjs.map +0 -1
- package/dist/entities/token/eth/index.d.mts +0 -5
- package/dist/entities/token/eth/index.d.ts +0 -5
- package/dist/entities/token/eth/index.js +0 -13
- package/dist/entities/token/eth/index.js.map +0 -1
- package/dist/entities/token/eth/index.mjs +0 -4
- package/dist/entities/token/eth/index.mjs.map +0 -1
- package/dist/entities/token/index.d.mts +0 -6
- package/dist/entities/token/index.d.ts +0 -6
- package/dist/entities/token/index.js +0 -27
- package/dist/entities/token/index.js.map +0 -1
- package/dist/entities/token/index.mjs +0 -14
- package/dist/entities/token/index.mjs.map +0 -1
- package/dist/index.d.mts +0 -39
- package/dist/index.d.ts +0 -39
- package/dist/index.js +0 -587
- package/dist/index.js.map +0 -1
- package/dist/index.mjs +0 -49
- package/dist/index.mjs.map +0 -1
- package/dist/types.d.mts +0 -662
- package/dist/types.d.ts +0 -662
- package/dist/types.js +0 -34
- package/dist/types.js.map +0 -1
- package/dist/types.mjs +0 -5
- package/dist/types.mjs.map +0 -1
- package/dist/utils/airlock.d.mts +0 -11
- package/dist/utils/airlock.d.ts +0 -11
- package/dist/utils/airlock.js +0 -26
- package/dist/utils/airlock.js.map +0 -1
- package/dist/utils/airlock.mjs +0 -5
- package/dist/utils/airlock.mjs.map +0 -1
- package/dist/utils/balanceDelta.d.mts +0 -10
- package/dist/utils/balanceDelta.d.ts +0 -10
- package/dist/utils/balanceDelta.js +0 -12
- package/dist/utils/balanceDelta.js.map +0 -1
- package/dist/utils/balanceDelta.mjs +0 -3
- package/dist/utils/balanceDelta.mjs.map +0 -1
- package/dist/utils/computeOptimalGamma.d.mts +0 -7
- package/dist/utils/computeOptimalGamma.d.ts +0 -7
- package/dist/utils/computeOptimalGamma.js +0 -12
- package/dist/utils/computeOptimalGamma.js.map +0 -1
- package/dist/utils/computeOptimalGamma.mjs +0 -3
- package/dist/utils/computeOptimalGamma.mjs.map +0 -1
- package/dist/utils/dopplerHookMigrator.d.mts +0 -18
- package/dist/utils/dopplerHookMigrator.d.ts +0 -18
- package/dist/utils/dopplerHookMigrator.js +0 -20
- package/dist/utils/dopplerHookMigrator.js.map +0 -1
- package/dist/utils/dopplerHookMigrator.mjs +0 -7
- package/dist/utils/dopplerHookMigrator.mjs.map +0 -1
- package/dist/utils/index.d.mts +0 -14
- package/dist/utils/index.d.ts +0 -14
- package/dist/utils/index.js +0 -197
- package/dist/utils/index.js.map +0 -1
- package/dist/utils/index.mjs +0 -24
- package/dist/utils/index.mjs.map +0 -1
- package/dist/utils/isToken0Expected.d.mts +0 -13
- package/dist/utils/isToken0Expected.d.ts +0 -13
- package/dist/utils/isToken0Expected.js +0 -12
- package/dist/utils/isToken0Expected.js.map +0 -1
- package/dist/utils/isToken0Expected.mjs +0 -3
- package/dist/utils/isToken0Expected.mjs.map +0 -1
- package/dist/utils/marketCapHelpers.d.mts +0 -259
- package/dist/utils/marketCapHelpers.d.ts +0 -259
- package/dist/utils/marketCapHelpers.js +0 -58
- package/dist/utils/marketCapHelpers.js.map +0 -1
- package/dist/utils/marketCapHelpers.mjs +0 -5
- package/dist/utils/marketCapHelpers.mjs.map +0 -1
- package/dist/utils/poolKey.d.mts +0 -17
- package/dist/utils/poolKey.d.ts +0 -17
- package/dist/utils/poolKey.js +0 -12
- package/dist/utils/poolKey.js.map +0 -1
- package/dist/utils/poolKey.mjs +0 -3
- package/dist/utils/poolKey.mjs.map +0 -1
- package/dist/utils/priceHelpers.d.mts +0 -86
- package/dist/utils/priceHelpers.d.ts +0 -86
- package/dist/utils/priceHelpers.js +0 -41
- package/dist/utils/priceHelpers.js.map +0 -1
- package/dist/utils/priceHelpers.mjs +0 -4
- package/dist/utils/priceHelpers.mjs.map +0 -1
- package/dist/utils/tickMath.d.mts +0 -72
- package/dist/utils/tickMath.d.ts +0 -72
- package/dist/utils/tickMath.js +0 -60
- package/dist/utils/tickMath.js.map +0 -1
- package/dist/utils/tickMath.mjs +0 -3
- package/dist/utils/tickMath.mjs.map +0 -1
- package/dist/utils/tokenAddressMiner.d.mts +0 -37
- package/dist/utils/tokenAddressMiner.d.ts +0 -37
- package/dist/utils/tokenAddressMiner.js +0 -19
- package/dist/utils/tokenAddressMiner.js.map +0 -1
- package/dist/utils/tokenAddressMiner.mjs +0 -10
- package/dist/utils/tokenAddressMiner.mjs.map +0 -1
package/dist/chunk-WNUB3UTT.js
DELETED
|
@@ -1,241 +0,0 @@
|
|
|
1
|
-
'use strict';
|
|
2
|
-
|
|
3
|
-
var chunkQRTABC4Z_js = require('./chunk-QRTABC4Z.js');
|
|
4
|
-
var chunkJ62YDWIK_js = require('./chunk-J62YDWIK.js');
|
|
5
|
-
var chunkQAPQGDWK_js = require('./chunk-QAPQGDWK.js');
|
|
6
|
-
var viem = require('viem');
|
|
7
|
-
|
|
8
|
-
var DEFAULT_MAX_ITERATIONS = 1e6;
|
|
9
|
-
var TOKEN_FACTORY_80_ADDRESS = "0xf0B5141dD9096254B2ca624dff26024f46087229";
|
|
10
|
-
function isTokenFactory80(tokenFactory) {
|
|
11
|
-
return tokenFactory.toLowerCase() === TOKEN_FACTORY_80_ADDRESS.toLowerCase();
|
|
12
|
-
}
|
|
13
|
-
var STANDARD_TOKEN_DATA_ABI = [
|
|
14
|
-
{ type: "string" },
|
|
15
|
-
{ type: "string" },
|
|
16
|
-
{ type: "uint256" },
|
|
17
|
-
{ type: "uint256" },
|
|
18
|
-
{ type: "address[]" },
|
|
19
|
-
{ type: "uint256[]" },
|
|
20
|
-
{ type: "string" }
|
|
21
|
-
];
|
|
22
|
-
var DOPPLER404_TOKEN_DATA_ABI = [
|
|
23
|
-
{ type: "string" },
|
|
24
|
-
{ type: "string" },
|
|
25
|
-
{ type: "string" },
|
|
26
|
-
{ type: "uint256" }
|
|
27
|
-
];
|
|
28
|
-
function normalizeHexFragment(value, label) {
|
|
29
|
-
const normalized = value.trim().toLowerCase().replace(/^0x/, "");
|
|
30
|
-
if (normalized.length === 0) {
|
|
31
|
-
throw new Error(
|
|
32
|
-
`TokenAddressMiner: ${label} must contain at least one hex character`
|
|
33
|
-
);
|
|
34
|
-
}
|
|
35
|
-
if (normalized.length > 40) {
|
|
36
|
-
throw new Error(
|
|
37
|
-
`TokenAddressMiner: ${label} cannot exceed 40 hex characters`
|
|
38
|
-
);
|
|
39
|
-
}
|
|
40
|
-
if (!/^[0-9a-f]+$/i.test(normalized)) {
|
|
41
|
-
throw new Error(`TokenAddressMiner: ${label} must be a hexadecimal string`);
|
|
42
|
-
}
|
|
43
|
-
return normalized;
|
|
44
|
-
}
|
|
45
|
-
function hexToBytes(hex) {
|
|
46
|
-
const cleanHex = hex.startsWith("0x") ? hex.slice(2) : hex;
|
|
47
|
-
const bytes = new Uint8Array(cleanHex.length / 2);
|
|
48
|
-
for (let i = 0; i < bytes.length; i++) {
|
|
49
|
-
bytes[i] = parseInt(cleanHex.substr(i * 2, 2), 16);
|
|
50
|
-
}
|
|
51
|
-
return bytes;
|
|
52
|
-
}
|
|
53
|
-
function bytesToHex(bytes) {
|
|
54
|
-
return "0x" + Array.from(bytes).map((b) => b.toString(16).padStart(2, "0")).join("");
|
|
55
|
-
}
|
|
56
|
-
function prepareCreate2Buffer(deployer, initCodeHash) {
|
|
57
|
-
const buffer = new Uint8Array(85);
|
|
58
|
-
buffer[0] = 255;
|
|
59
|
-
const deployerBytes = hexToBytes(deployer);
|
|
60
|
-
buffer.set(deployerBytes, 1);
|
|
61
|
-
const initCodeHashBytes = hexToBytes(initCodeHash);
|
|
62
|
-
buffer.set(initCodeHashBytes, 53);
|
|
63
|
-
return buffer;
|
|
64
|
-
}
|
|
65
|
-
function updateSaltInBuffer(buffer, salt) {
|
|
66
|
-
for (let i = 21; i < 53; i++) {
|
|
67
|
-
buffer[i] = 0;
|
|
68
|
-
}
|
|
69
|
-
let remaining = salt;
|
|
70
|
-
for (let i = 52; remaining > 0n && i >= 21; i--) {
|
|
71
|
-
buffer[i] = Number(remaining & 0xffn);
|
|
72
|
-
remaining >>= 8n;
|
|
73
|
-
}
|
|
74
|
-
}
|
|
75
|
-
function computeCreate2AddressFast(buffer) {
|
|
76
|
-
const hash = viem.keccak256(bytesToHex(buffer));
|
|
77
|
-
return "0x" + hash.slice(-40).toLowerCase();
|
|
78
|
-
}
|
|
79
|
-
function buildTokenInitHash(params) {
|
|
80
|
-
const {
|
|
81
|
-
variant,
|
|
82
|
-
tokenFactory,
|
|
83
|
-
tokenData,
|
|
84
|
-
initialSupply,
|
|
85
|
-
recipient,
|
|
86
|
-
owner,
|
|
87
|
-
customBytecode
|
|
88
|
-
} = params;
|
|
89
|
-
if (variant === "doppler404") {
|
|
90
|
-
const [name2, symbol2, baseURI] = viem.decodeAbiParameters(
|
|
91
|
-
DOPPLER404_TOKEN_DATA_ABI,
|
|
92
|
-
tokenData
|
|
93
|
-
);
|
|
94
|
-
const initHashData2 = viem.encodeAbiParameters(
|
|
95
|
-
[
|
|
96
|
-
{ type: "string" },
|
|
97
|
-
{ type: "string" },
|
|
98
|
-
{ type: "uint256" },
|
|
99
|
-
{ type: "address" },
|
|
100
|
-
{ type: "address" },
|
|
101
|
-
{ type: "string" }
|
|
102
|
-
],
|
|
103
|
-
[name2, symbol2, initialSupply, recipient, owner, baseURI]
|
|
104
|
-
);
|
|
105
|
-
return viem.keccak256(
|
|
106
|
-
viem.encodePacked(
|
|
107
|
-
["bytes", "bytes"],
|
|
108
|
-
[customBytecode ?? chunkQAPQGDWK_js.dopplerDN404_default, initHashData2]
|
|
109
|
-
)
|
|
110
|
-
);
|
|
111
|
-
}
|
|
112
|
-
const [
|
|
113
|
-
name,
|
|
114
|
-
symbol,
|
|
115
|
-
yearlyMintRate,
|
|
116
|
-
vestingDuration,
|
|
117
|
-
vestingRecipients,
|
|
118
|
-
vestingAmounts,
|
|
119
|
-
tokenURI
|
|
120
|
-
] = viem.decodeAbiParameters(STANDARD_TOKEN_DATA_ABI, tokenData);
|
|
121
|
-
const initHashData = viem.encodeAbiParameters(
|
|
122
|
-
[
|
|
123
|
-
{ type: "string" },
|
|
124
|
-
{ type: "string" },
|
|
125
|
-
{ type: "uint256" },
|
|
126
|
-
{ type: "address" },
|
|
127
|
-
{ type: "address" },
|
|
128
|
-
{ type: "uint256" },
|
|
129
|
-
{ type: "uint256" },
|
|
130
|
-
{ type: "address[]" },
|
|
131
|
-
{ type: "uint256[]" },
|
|
132
|
-
{ type: "string" }
|
|
133
|
-
],
|
|
134
|
-
[
|
|
135
|
-
name,
|
|
136
|
-
symbol,
|
|
137
|
-
initialSupply,
|
|
138
|
-
recipient,
|
|
139
|
-
owner,
|
|
140
|
-
yearlyMintRate,
|
|
141
|
-
vestingDuration,
|
|
142
|
-
Array.from(vestingRecipients),
|
|
143
|
-
Array.from(vestingAmounts),
|
|
144
|
-
tokenURI
|
|
145
|
-
]
|
|
146
|
-
);
|
|
147
|
-
const defaultBytecode = isTokenFactory80(tokenFactory) ? chunkJ62YDWIK_js.derc2080_default : chunkQRTABC4Z_js.derc20_default;
|
|
148
|
-
return viem.keccak256(
|
|
149
|
-
viem.encodePacked(
|
|
150
|
-
["bytes", "bytes"],
|
|
151
|
-
[customBytecode ?? defaultBytecode, initHashData]
|
|
152
|
-
)
|
|
153
|
-
);
|
|
154
|
-
}
|
|
155
|
-
function mineTokenAddress(params) {
|
|
156
|
-
const {
|
|
157
|
-
prefix,
|
|
158
|
-
suffix,
|
|
159
|
-
tokenFactory,
|
|
160
|
-
initialSupply,
|
|
161
|
-
recipient,
|
|
162
|
-
owner,
|
|
163
|
-
tokenData,
|
|
164
|
-
tokenVariant = "standard",
|
|
165
|
-
customBytecode,
|
|
166
|
-
maxIterations = DEFAULT_MAX_ITERATIONS,
|
|
167
|
-
startSalt = 0n,
|
|
168
|
-
hook
|
|
169
|
-
} = params;
|
|
170
|
-
if (maxIterations <= 0 || !Number.isFinite(maxIterations)) {
|
|
171
|
-
throw new Error(
|
|
172
|
-
"TokenAddressMiner: maxIterations must be a positive finite number"
|
|
173
|
-
);
|
|
174
|
-
}
|
|
175
|
-
if (startSalt < 0n) {
|
|
176
|
-
throw new Error("TokenAddressMiner: startSalt cannot be negative");
|
|
177
|
-
}
|
|
178
|
-
const prefixTrimmed = prefix.trim();
|
|
179
|
-
const suffixTrimmed = suffix?.trim();
|
|
180
|
-
const normalizedPrefix = prefixTrimmed.length === 0 ? void 0 : normalizeHexFragment(prefixTrimmed, "prefix");
|
|
181
|
-
const normalizedSuffix = !suffixTrimmed || suffixTrimmed.length === 0 ? void 0 : normalizeHexFragment(suffixTrimmed, "suffix");
|
|
182
|
-
if (!normalizedPrefix && !normalizedSuffix) {
|
|
183
|
-
throw new Error("TokenAddressMiner: must provide prefix and/or suffix");
|
|
184
|
-
}
|
|
185
|
-
const tokenInitHash = buildTokenInitHash({
|
|
186
|
-
variant: tokenVariant,
|
|
187
|
-
tokenFactory,
|
|
188
|
-
tokenData,
|
|
189
|
-
initialSupply,
|
|
190
|
-
recipient,
|
|
191
|
-
owner,
|
|
192
|
-
customBytecode
|
|
193
|
-
});
|
|
194
|
-
const hookConfig = hook ? {
|
|
195
|
-
deployer: hook.deployer,
|
|
196
|
-
initCodeHash: hook.initCodeHash,
|
|
197
|
-
prefix: hook.prefix && hook.prefix.trim().length > 0 ? normalizeHexFragment(hook.prefix, "prefix") : void 0,
|
|
198
|
-
suffix: hook.suffix && hook.suffix.trim().length > 0 ? normalizeHexFragment(hook.suffix, "suffix") : void 0
|
|
199
|
-
} : void 0;
|
|
200
|
-
const maxSalt = startSalt + BigInt(maxIterations);
|
|
201
|
-
let iterations = 0;
|
|
202
|
-
const tokenBuffer = prepareCreate2Buffer(tokenFactory, tokenInitHash);
|
|
203
|
-
const hookBuffer = hookConfig ? prepareCreate2Buffer(hookConfig.deployer, hookConfig.initCodeHash) : null;
|
|
204
|
-
for (let salt = startSalt; salt < maxSalt; salt++) {
|
|
205
|
-
updateSaltInBuffer(tokenBuffer, salt);
|
|
206
|
-
const candidateRaw = computeCreate2AddressFast(tokenBuffer);
|
|
207
|
-
const candidateHex = candidateRaw.slice(2);
|
|
208
|
-
iterations++;
|
|
209
|
-
if (normalizedPrefix && !candidateHex.startsWith(normalizedPrefix))
|
|
210
|
-
continue;
|
|
211
|
-
if (normalizedSuffix && !candidateHex.endsWith(normalizedSuffix)) continue;
|
|
212
|
-
let hookAddressRaw;
|
|
213
|
-
if (hookBuffer) {
|
|
214
|
-
updateSaltInBuffer(hookBuffer, salt);
|
|
215
|
-
hookAddressRaw = computeCreate2AddressFast(hookBuffer);
|
|
216
|
-
const hookHex = hookAddressRaw.slice(2);
|
|
217
|
-
if (hookConfig?.prefix && !hookHex.startsWith(hookConfig.prefix))
|
|
218
|
-
continue;
|
|
219
|
-
if (hookConfig?.suffix && !hookHex.endsWith(hookConfig.suffix)) continue;
|
|
220
|
-
}
|
|
221
|
-
const saltHex = `0x${salt.toString(16).padStart(64, "0")}`;
|
|
222
|
-
return {
|
|
223
|
-
salt: saltHex,
|
|
224
|
-
tokenAddress: viem.getAddress(candidateRaw),
|
|
225
|
-
iterations,
|
|
226
|
-
hookAddress: hookAddressRaw ? viem.getAddress(hookAddressRaw) : void 0
|
|
227
|
-
};
|
|
228
|
-
}
|
|
229
|
-
const constraints = [];
|
|
230
|
-
if (normalizedPrefix) constraints.push(`prefix ${prefixTrimmed}`);
|
|
231
|
-
if (normalizedSuffix) constraints.push(`suffix ${suffixTrimmed}`);
|
|
232
|
-
throw new Error(
|
|
233
|
-
`TokenAddressMiner: could not find salt matching ${constraints.join(
|
|
234
|
-
" and "
|
|
235
|
-
)} within ${maxIterations} iterations`
|
|
236
|
-
);
|
|
237
|
-
}
|
|
238
|
-
|
|
239
|
-
exports.mineTokenAddress = mineTokenAddress;
|
|
240
|
-
//# sourceMappingURL=chunk-WNUB3UTT.js.map
|
|
241
|
-
//# sourceMappingURL=chunk-WNUB3UTT.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/utils/tokenAddressMiner.ts"],"names":["keccak256","name","symbol","decodeAbiParameters","initHashData","encodeAbiParameters","encodePacked","dopplerDN404_default","derc2080_default","derc20_default","getAddress"],"mappings":";;;;;;;AAgBA,IAAM,sBAAA,GAAyB,GAAA;AAK/B,IAAM,wBAAA,GACJ,4CAAA;AAEF,SAAS,iBAAiB,YAAA,EAAgC;AACxD,EAAA,OAAO,YAAA,CAAa,WAAA,EAAY,KAAM,wBAAA,CAAyB,WAAA,EAAY;AAC7E;AAoCA,IAAM,uBAAA,GAA0B;AAAA,EAC9B,EAAE,MAAM,QAAA,EAAS;AAAA,EACjB,EAAE,MAAM,QAAA,EAAS;AAAA,EACjB,EAAE,MAAM,SAAA,EAAU;AAAA,EAClB,EAAE,MAAM,SAAA,EAAU;AAAA,EAClB,EAAE,MAAM,WAAA,EAAY;AAAA,EACpB,EAAE,MAAM,WAAA,EAAY;AAAA,EACpB,EAAE,MAAM,QAAA;AACV,CAAA;AAEA,IAAM,yBAAA,GAA4B;AAAA,EAChC,EAAE,MAAM,QAAA,EAAS;AAAA,EACjB,EAAE,MAAM,QAAA,EAAS;AAAA,EACjB,EAAE,MAAM,QAAA,EAAS;AAAA,EACjB,EAAE,MAAM,SAAA;AACV,CAAA;AAEA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EAAa,cAAA,GACRA,eAAA,CAAW,cAAc,CAAA,GAC1B;AAAA,KACN;AAAA,EACF;AAEA,EAAA,MAAM,cAAwB,EAAC;AAC/B,EAAA,IAAI,gBAAA,EAAkB,WAAA,CAAY,IAAA,CAAK,CAAA,OAAA,EAAU,aAAa,CAAA,CAAE,CAAA;AAChE,EAAA,IAAI,gBAAA,EAAkB,WAAA,CAAY,IAAA,CAAK,CAAA,OAAA,EAAU,aAAa,CAAA,CAAE,CAAA;AAEhE,EAAA,MAAM,IAAI,KAAA;AAAA,IACR,mDAAmD,WAAA,CAAY,IAAA;AAAA,MAC7D;AAAA,KACD,WAAW,aAAa,CAAA,WAAA;AAAA,GAC3B;AACF","file":"chunk-WNUB3UTT.js","sourcesContent":["import {\n type Address,\n type Hash,\n type Hex,\n encodeAbiParameters,\n encodePacked,\n keccak256,\n getAddress,\n decodeAbiParameters,\n} from 'viem';\nimport {\n DERC20Bytecode,\n DERC2080Bytecode,\n DopplerDN404Bytecode,\n} from '../abis';\n\nconst DEFAULT_MAX_ITERATIONS = 1_000_000;\n\nexport type TokenVariant = 'standard' | 'doppler404';\n\n// TokenFactory80 has the same deterministic CREATE2 address across all chains where it is deployed.\nconst TOKEN_FACTORY_80_ADDRESS =\n '0xf0B5141dD9096254B2ca624dff26024f46087229' as const;\n\nfunction isTokenFactory80(tokenFactory: Address): boolean {\n return tokenFactory.toLowerCase() === TOKEN_FACTORY_80_ADDRESS.toLowerCase();\n}\n\nexport interface TokenAddressHookConfig {\n deployer: Address;\n initCodeHash: Hash;\n prefix?: string;\n suffix?: string;\n}\n\nexport interface TokenAddressMiningParams {\n /**\n * Vanity prefix (hex). Keep as `''` (empty string) if you only want to mine a suffix.\n * Note: this is required for backwards compatibility with older SDK versions.\n */\n prefix: string;\n /** Vanity suffix (hex), useful as an identifier at the end of the address. */\n suffix?: string;\n tokenFactory: Address;\n initialSupply: bigint;\n recipient: Address;\n owner: Address;\n tokenData: Hex;\n tokenVariant?: TokenVariant;\n customBytecode?: Hex;\n maxIterations?: number;\n startSalt?: bigint;\n hook?: TokenAddressHookConfig;\n}\n\nexport interface TokenAddressMiningResult {\n salt: Hash;\n tokenAddress: Address;\n iterations: number;\n hookAddress?: Address;\n}\n\nconst STANDARD_TOKEN_DATA_ABI = [\n { type: 'string' },\n { type: 'string' },\n { type: 'uint256' },\n { type: 'uint256' },\n { type: 'address[]' },\n { type: 'uint256[]' },\n { type: 'string' },\n] as const;\n\nconst DOPPLER404_TOKEN_DATA_ABI = [\n { type: 'string' },\n { type: 'string' },\n { type: 'string' },\n { type: 'uint256' },\n] as const;\n\nfunction normalizeHexFragment(\n value: string,\n label: 'prefix' | 'suffix',\n): string {\n const normalized = value.trim().toLowerCase().replace(/^0x/, '');\n if (normalized.length === 0) {\n throw new Error(\n `TokenAddressMiner: ${label} must contain at least one hex character`,\n );\n }\n if (normalized.length > 40) {\n throw new Error(\n `TokenAddressMiner: ${label} cannot exceed 40 hex characters`,\n );\n }\n if (!/^[0-9a-f]+$/i.test(normalized)) {\n throw new Error(`TokenAddressMiner: ${label} must be a hexadecimal string`);\n }\n return normalized;\n}\n\nfunction computeCreate2Address(\n salt: Hash,\n initCodeHash: Hash,\n deployer: Address,\n): Address {\n const encoded = encodePacked(\n ['bytes1', 'address', 'bytes32', 'bytes32'],\n ['0xff', deployer, salt, initCodeHash],\n );\n return getAddress(`0x${keccak256(encoded).slice(-40)}`);\n}\n\n/**\n * Helper to convert hex string to Uint8Array\n */\nfunction hexToBytes(hex: string): Uint8Array {\n const cleanHex = hex.startsWith('0x') ? hex.slice(2) : hex;\n const bytes = new Uint8Array(cleanHex.length / 2);\n for (let i = 0; i < bytes.length; i++) {\n bytes[i] = parseInt(cleanHex.substr(i * 2, 2), 16);\n }\n return bytes;\n}\n\n/**\n * Helper to convert Uint8Array to hex string\n */\nfunction bytesToHex(bytes: Uint8Array): string {\n return (\n '0x' +\n Array.from(bytes)\n .map((b) => b.toString(16).padStart(2, '0'))\n .join('')\n );\n}\n\n/**\n * Pre-compute CREATE2 buffer with constant prefix for fast mining\n * Buffer layout: 0xff (1 byte) + deployer (20 bytes) + salt (32 bytes) + initCodeHash (32 bytes) = 85 bytes\n */\nfunction prepareCreate2Buffer(\n deployer: Address,\n initCodeHash: Hash,\n): Uint8Array {\n const buffer = new Uint8Array(85);\n buffer[0] = 0xff;\n const deployerBytes = hexToBytes(deployer);\n buffer.set(deployerBytes, 1);\n const initCodeHashBytes = hexToBytes(initCodeHash);\n buffer.set(initCodeHashBytes, 53); // 1 + 20 + 32 = 53\n return buffer;\n}\n\n/**\n * Update salt in pre-computed CREATE2 buffer (bytes 21-52)\n * Uses direct byte manipulation instead of string conversion\n */\nfunction updateSaltInBuffer(buffer: Uint8Array, salt: bigint): void {\n // Salt is 32 bytes, positioned at offset 21 (after 0xff + 20-byte deployer)\n // Clear salt region first\n for (let i = 21; i < 53; i++) {\n buffer[i] = 0;\n }\n // Write salt bytes from right to left (big-endian)\n let remaining = salt;\n for (let i = 52; remaining > 0n && i >= 21; i--) {\n buffer[i] = Number(remaining & 0xffn);\n remaining >>= 8n;\n }\n}\n\n/**\n * Compute CREATE2 address from pre-computed buffer (fast version for mining)\n * Returns raw lowercase address without checksum for comparison\n */\nfunction computeCreate2AddressFast(buffer: Uint8Array): string {\n const hash = keccak256(bytesToHex(buffer) as Hex);\n // Return last 40 hex chars (20 bytes) as lowercase address\n return '0x' + hash.slice(-40).toLowerCase();\n}\n\nfunction buildTokenInitHash(params: {\n variant: TokenVariant;\n tokenFactory: Address;\n tokenData: Hex;\n initialSupply: bigint;\n recipient: Address;\n owner: Address;\n customBytecode?: Hex;\n}): Hash {\n const {\n variant,\n tokenFactory,\n tokenData,\n initialSupply,\n recipient,\n owner,\n customBytecode,\n } = params;\n\n if (variant === 'doppler404') {\n const [name, symbol, baseURI] = decodeAbiParameters(\n DOPPLER404_TOKEN_DATA_ABI,\n tokenData,\n ) as readonly [string, string, string, bigint | undefined];\n\n const initHashData = encodeAbiParameters(\n [\n { type: 'string' },\n { type: 'string' },\n { type: 'uint256' },\n { type: 'address' },\n { type: 'address' },\n { type: 'string' },\n ],\n [name, symbol, initialSupply, recipient, owner, baseURI],\n );\n\n return keccak256(\n encodePacked(\n ['bytes', 'bytes'],\n [customBytecode ?? (DopplerDN404Bytecode as Hex), initHashData],\n ),\n ) as Hash;\n }\n\n const [\n name,\n symbol,\n yearlyMintRate,\n vestingDuration,\n vestingRecipients,\n vestingAmounts,\n tokenURI,\n ] = decodeAbiParameters(STANDARD_TOKEN_DATA_ABI, tokenData) as readonly [\n string,\n string,\n bigint,\n bigint,\n readonly Address[],\n readonly bigint[],\n string,\n ];\n\n const initHashData = encodeAbiParameters(\n [\n { type: 'string' },\n { type: 'string' },\n { type: 'uint256' },\n { type: 'address' },\n { type: 'address' },\n { type: 'uint256' },\n { type: 'uint256' },\n { type: 'address[]' },\n { type: 'uint256[]' },\n { type: 'string' },\n ],\n [\n name,\n symbol,\n initialSupply,\n recipient,\n owner,\n yearlyMintRate,\n vestingDuration,\n Array.from(vestingRecipients),\n Array.from(vestingAmounts),\n tokenURI,\n ],\n );\n\n const defaultBytecode = isTokenFactory80(tokenFactory)\n ? (DERC2080Bytecode as Hex)\n : (DERC20Bytecode as Hex);\n\n return keccak256(\n encodePacked(\n ['bytes', 'bytes'],\n [customBytecode ?? defaultBytecode, initHashData],\n ),\n ) as Hash;\n}\n\nexport function mineTokenAddress(\n params: TokenAddressMiningParams,\n): TokenAddressMiningResult {\n const {\n prefix,\n suffix,\n tokenFactory,\n initialSupply,\n recipient,\n owner,\n tokenData,\n tokenVariant = 'standard',\n customBytecode,\n maxIterations = DEFAULT_MAX_ITERATIONS,\n startSalt = 0n,\n hook,\n } = params;\n\n if (maxIterations <= 0 || !Number.isFinite(maxIterations)) {\n throw new Error(\n 'TokenAddressMiner: maxIterations must be a positive finite number',\n );\n }\n if (startSalt < 0n) {\n throw new Error('TokenAddressMiner: startSalt cannot be negative');\n }\n\n const prefixTrimmed = prefix.trim();\n const suffixTrimmed = suffix?.trim();\n\n const normalizedPrefix =\n prefixTrimmed.length === 0\n ? undefined\n : normalizeHexFragment(prefixTrimmed, 'prefix');\n const normalizedSuffix =\n !suffixTrimmed || suffixTrimmed.length === 0\n ? undefined\n : normalizeHexFragment(suffixTrimmed, 'suffix');\n\n if (!normalizedPrefix && !normalizedSuffix) {\n throw new Error('TokenAddressMiner: must provide prefix and/or suffix');\n }\n\n const tokenInitHash = buildTokenInitHash({\n variant: tokenVariant,\n tokenFactory,\n tokenData,\n initialSupply,\n recipient,\n owner,\n customBytecode,\n });\n\n const hookConfig = hook\n ? {\n deployer: hook.deployer,\n initCodeHash: hook.initCodeHash,\n prefix:\n hook.prefix && hook.prefix.trim().length > 0\n ? normalizeHexFragment(hook.prefix, 'prefix')\n : undefined,\n suffix:\n hook.suffix && hook.suffix.trim().length > 0\n ? normalizeHexFragment(hook.suffix, 'suffix')\n : undefined,\n }\n : undefined;\n\n const maxSalt = startSalt + BigInt(maxIterations);\n let iterations = 0;\n\n // Pre-allocate CREATE2 buffer with constant parts (optimization)\n const tokenBuffer = prepareCreate2Buffer(tokenFactory, tokenInitHash);\n const hookBuffer = hookConfig\n ? prepareCreate2Buffer(hookConfig.deployer, hookConfig.initCodeHash)\n : null;\n\n for (let salt = startSalt; salt < maxSalt; salt++) {\n // Update salt in pre-computed buffer (avoids string formatting)\n updateSaltInBuffer(tokenBuffer, salt);\n\n // Compute token address using fast method (no checksum)\n const candidateRaw = computeCreate2AddressFast(tokenBuffer);\n const candidateHex = candidateRaw.slice(2);\n iterations++;\n\n if (normalizedPrefix && !candidateHex.startsWith(normalizedPrefix))\n continue;\n if (normalizedSuffix && !candidateHex.endsWith(normalizedSuffix)) continue;\n\n let hookAddressRaw: string | undefined;\n if (hookBuffer) {\n updateSaltInBuffer(hookBuffer, salt);\n hookAddressRaw = computeCreate2AddressFast(hookBuffer);\n const hookHex = hookAddressRaw.slice(2);\n if (hookConfig?.prefix && !hookHex.startsWith(hookConfig.prefix))\n continue;\n if (hookConfig?.suffix && !hookHex.endsWith(hookConfig.suffix)) continue;\n }\n\n // Found a match! Convert to proper format for return\n const saltHex = `0x${salt.toString(16).padStart(64, '0')}` as Hash;\n return {\n salt: saltHex,\n tokenAddress: getAddress(candidateRaw) as Address,\n iterations,\n hookAddress: hookAddressRaw\n ? (getAddress(hookAddressRaw) as Address)\n : undefined,\n };\n }\n\n const constraints: string[] = [];\n if (normalizedPrefix) constraints.push(`prefix ${prefixTrimmed}`);\n if (normalizedSuffix) constraints.push(`suffix ${suffixTrimmed}`);\n\n throw new Error(\n `TokenAddressMiner: could not find salt matching ${constraints.join(\n ' and ',\n )} within ${maxIterations} iterations`,\n );\n}\n"]}
|
package/dist/chunk-WNWK2QMU.mjs
DELETED
|
@@ -1,375 +0,0 @@
|
|
|
1
|
-
import { computeTicks } from './chunk-ZEDJUNC6.mjs';
|
|
2
|
-
import { computeOptimalGamma } from './chunk-H3B54PFV.mjs';
|
|
3
|
-
import { validateMarketCapParameters, marketCapToTicksForDynamicAuction } from './chunk-GSBQIVME.mjs';
|
|
4
|
-
import { DEFAULT_V4_YEARLY_MINT_RATE, ZERO_ADDRESS, DOPPLER_MAX_TICK_SPACING, DEFAULT_AUCTION_DURATION, DEFAULT_EPOCH_LENGTH, V4_MAX_FEE, FEE_TIERS } from './chunk-IWJOPXYN.mjs';
|
|
5
|
-
import { isNoOpEnabledChain, isLaunchpadEnabledChain } from './chunk-WKWP42TD.mjs';
|
|
6
|
-
|
|
7
|
-
// src/builders/DynamicAuctionBuilder.ts
|
|
8
|
-
var DynamicAuctionBuilder = class _DynamicAuctionBuilder {
|
|
9
|
-
constructor(chainId) {
|
|
10
|
-
this.chainId = chainId;
|
|
11
|
-
}
|
|
12
|
-
static forChain(chainId) {
|
|
13
|
-
return new _DynamicAuctionBuilder(chainId);
|
|
14
|
-
}
|
|
15
|
-
tokenConfig(params) {
|
|
16
|
-
if (params && "type" in params && params.type === "doppler404") {
|
|
17
|
-
this.token = {
|
|
18
|
-
type: "doppler404",
|
|
19
|
-
name: params.name,
|
|
20
|
-
symbol: params.symbol,
|
|
21
|
-
baseURI: params.baseURI,
|
|
22
|
-
unit: params.unit
|
|
23
|
-
};
|
|
24
|
-
} else {
|
|
25
|
-
this.token = {
|
|
26
|
-
type: "standard",
|
|
27
|
-
name: params.name,
|
|
28
|
-
symbol: params.symbol,
|
|
29
|
-
tokenURI: params.tokenURI,
|
|
30
|
-
yearlyMintRate: params.yearlyMintRate ?? DEFAULT_V4_YEARLY_MINT_RATE
|
|
31
|
-
};
|
|
32
|
-
}
|
|
33
|
-
return this;
|
|
34
|
-
}
|
|
35
|
-
saleConfig(params) {
|
|
36
|
-
this.sale = {
|
|
37
|
-
initialSupply: params.initialSupply,
|
|
38
|
-
numTokensToSell: params.numTokensToSell,
|
|
39
|
-
numeraire: params.numeraire ?? ZERO_ADDRESS
|
|
40
|
-
};
|
|
41
|
-
return this;
|
|
42
|
-
}
|
|
43
|
-
poolConfig(params) {
|
|
44
|
-
if (this.marketCapConfig) {
|
|
45
|
-
throw new Error(
|
|
46
|
-
"Cannot use poolConfig() after withMarketCapRange(). Use withMarketCapRange() for market cap-based configuration, or poolConfig() + auctionByTicks() for manual tick configuration."
|
|
47
|
-
);
|
|
48
|
-
}
|
|
49
|
-
if (params.tickSpacing > DOPPLER_MAX_TICK_SPACING) {
|
|
50
|
-
throw new Error(
|
|
51
|
-
`Dynamic auctions require tickSpacing <= ${DOPPLER_MAX_TICK_SPACING} (Doppler.sol MAX_TICK_SPACING). Got tickSpacing=${params.tickSpacing}. Use a smaller tickSpacing, or use withMarketCapRange() which handles this automatically.`
|
|
52
|
-
);
|
|
53
|
-
}
|
|
54
|
-
this.pool = { fee: params.fee, tickSpacing: params.tickSpacing };
|
|
55
|
-
return this;
|
|
56
|
-
}
|
|
57
|
-
// Provide ticks directly
|
|
58
|
-
auctionByTicks(params) {
|
|
59
|
-
const duration = params.duration ?? DEFAULT_AUCTION_DURATION;
|
|
60
|
-
const epochLength = params.epochLength ?? DEFAULT_EPOCH_LENGTH;
|
|
61
|
-
const gamma = params.gamma ?? (this.pool ? computeOptimalGamma(
|
|
62
|
-
params.startTick,
|
|
63
|
-
params.endTick,
|
|
64
|
-
duration,
|
|
65
|
-
epochLength,
|
|
66
|
-
this.pool.tickSpacing
|
|
67
|
-
) : void 0);
|
|
68
|
-
this.auction = {
|
|
69
|
-
duration,
|
|
70
|
-
epochLength,
|
|
71
|
-
startTick: params.startTick,
|
|
72
|
-
endTick: params.endTick,
|
|
73
|
-
gamma,
|
|
74
|
-
minProceeds: params.minProceeds,
|
|
75
|
-
maxProceeds: params.maxProceeds,
|
|
76
|
-
numPdSlugs: params.numPdSlugs
|
|
77
|
-
};
|
|
78
|
-
return this;
|
|
79
|
-
}
|
|
80
|
-
/**
|
|
81
|
-
* @deprecated Use withMarketCapRange() instead for more intuitive market cap configuration
|
|
82
|
-
*/
|
|
83
|
-
auctionByPriceRange(params) {
|
|
84
|
-
const tickSpacing = params.tickSpacing ?? this.pool?.tickSpacing;
|
|
85
|
-
if (!tickSpacing) {
|
|
86
|
-
throw new Error(
|
|
87
|
-
"tickSpacing is required (set poolConfig first or pass tickSpacing)"
|
|
88
|
-
);
|
|
89
|
-
}
|
|
90
|
-
const ticks = computeTicks(params.priceRange, tickSpacing);
|
|
91
|
-
return this.auctionByTicks({
|
|
92
|
-
startTick: ticks.startTick,
|
|
93
|
-
endTick: ticks.endTick,
|
|
94
|
-
minProceeds: params.minProceeds,
|
|
95
|
-
maxProceeds: params.maxProceeds,
|
|
96
|
-
duration: params.duration,
|
|
97
|
-
epochLength: params.epochLength,
|
|
98
|
-
gamma: params.gamma,
|
|
99
|
-
numPdSlugs: params.numPdSlugs
|
|
100
|
-
});
|
|
101
|
-
}
|
|
102
|
-
/**
|
|
103
|
-
* Configure auction using target market cap range.
|
|
104
|
-
* Converts market cap values (in USD) to Uniswap ticks.
|
|
105
|
-
*
|
|
106
|
-
* V4 pools support custom fees (0-100,000). Standard fee tiers auto-derive
|
|
107
|
-
* tickSpacing; custom fees require explicit tickSpacing (max: 30).
|
|
108
|
-
*
|
|
109
|
-
* @param params - Market cap configuration with auction parameters
|
|
110
|
-
* @returns Builder instance for chaining
|
|
111
|
-
*
|
|
112
|
-
* @example Standard fee tier (auto tickSpacing)
|
|
113
|
-
* ```ts
|
|
114
|
-
* builder
|
|
115
|
-
* .saleConfig({ initialSupply, numTokensToSell, numeraire: WETH })
|
|
116
|
-
* .withMarketCapRange({
|
|
117
|
-
* marketCap: { start: 500_000, min: 50_000 },
|
|
118
|
-
* numerairePrice: 3000,
|
|
119
|
-
* minProceeds: parseEther('10'),
|
|
120
|
-
* maxProceeds: parseEther('1000'),
|
|
121
|
-
* fee: 10000, // Standard tier, tickSpacing auto = 30
|
|
122
|
-
* })
|
|
123
|
-
* ```
|
|
124
|
-
*
|
|
125
|
-
* @example Custom fee (requires explicit tickSpacing)
|
|
126
|
-
* ```ts
|
|
127
|
-
* builder
|
|
128
|
-
* .saleConfig({ initialSupply, numTokensToSell, numeraire: WETH })
|
|
129
|
-
* .withMarketCapRange({
|
|
130
|
-
* marketCap: { start: 500_000, min: 50_000 },
|
|
131
|
-
* numerairePrice: 3000,
|
|
132
|
-
* minProceeds: parseEther('10'),
|
|
133
|
-
* maxProceeds: parseEther('1000'),
|
|
134
|
-
* fee: 2500, // Custom 0.25% fee
|
|
135
|
-
* tickSpacing: 10, // Required for custom fees
|
|
136
|
-
* })
|
|
137
|
-
* ```
|
|
138
|
-
*/
|
|
139
|
-
withMarketCapRange(params) {
|
|
140
|
-
if (this.pool) {
|
|
141
|
-
throw new Error(
|
|
142
|
-
"Cannot use withMarketCapRange() after poolConfig(). Use withMarketCapRange() for market cap-based configuration, or poolConfig() + auctionByTicks() for manual tick configuration."
|
|
143
|
-
);
|
|
144
|
-
}
|
|
145
|
-
if (params.numerairePrice <= 0) {
|
|
146
|
-
throw new Error("numerairePrice must be greater than 0");
|
|
147
|
-
}
|
|
148
|
-
if (params.marketCap.start <= 0 || params.marketCap.min <= 0) {
|
|
149
|
-
throw new Error("marketCap values must be greater than 0");
|
|
150
|
-
}
|
|
151
|
-
if (params.marketCap.min >= params.marketCap.start) {
|
|
152
|
-
throw new Error("marketCap.min must be less than marketCap.start");
|
|
153
|
-
}
|
|
154
|
-
if (params.fee !== void 0 && params.fee > V4_MAX_FEE) {
|
|
155
|
-
throw new Error(
|
|
156
|
-
`Fee ${params.fee} exceeds maximum allowed for V4 pools (${V4_MAX_FEE} = 10%). Use a fee between 0 and ${V4_MAX_FEE}.`
|
|
157
|
-
);
|
|
158
|
-
}
|
|
159
|
-
if (params.tickSpacing !== void 0 && params.tickSpacing > DOPPLER_MAX_TICK_SPACING) {
|
|
160
|
-
throw new Error(
|
|
161
|
-
`tickSpacing ${params.tickSpacing} exceeds maximum allowed for Doppler pools (${DOPPLER_MAX_TICK_SPACING}). Use tickSpacing <= ${DOPPLER_MAX_TICK_SPACING}.`
|
|
162
|
-
);
|
|
163
|
-
}
|
|
164
|
-
this.marketCapConfig = {
|
|
165
|
-
marketCap: params.marketCap,
|
|
166
|
-
numerairePrice: params.numerairePrice,
|
|
167
|
-
tokenSupply: params.tokenSupply,
|
|
168
|
-
tokenDecimals: params.tokenDecimals,
|
|
169
|
-
numeraireDecimals: params.numeraireDecimals,
|
|
170
|
-
fee: params.fee,
|
|
171
|
-
tickSpacing: params.tickSpacing,
|
|
172
|
-
minProceeds: params.minProceeds,
|
|
173
|
-
maxProceeds: params.maxProceeds,
|
|
174
|
-
duration: params.duration,
|
|
175
|
-
epochLength: params.epochLength,
|
|
176
|
-
gamma: params.gamma,
|
|
177
|
-
numPdSlugs: params.numPdSlugs
|
|
178
|
-
};
|
|
179
|
-
return this;
|
|
180
|
-
}
|
|
181
|
-
withVesting(params) {
|
|
182
|
-
if (!params) {
|
|
183
|
-
this.vesting = void 0;
|
|
184
|
-
return this;
|
|
185
|
-
}
|
|
186
|
-
this.vesting = {
|
|
187
|
-
duration: Number(params.duration ?? 0n),
|
|
188
|
-
cliffDuration: params.cliffDuration ?? 0,
|
|
189
|
-
recipients: params.recipients,
|
|
190
|
-
amounts: params.amounts
|
|
191
|
-
};
|
|
192
|
-
return this;
|
|
193
|
-
}
|
|
194
|
-
withGovernance(params) {
|
|
195
|
-
this.governance = params;
|
|
196
|
-
return this;
|
|
197
|
-
}
|
|
198
|
-
withMigration(migration) {
|
|
199
|
-
this.migration = migration;
|
|
200
|
-
return this;
|
|
201
|
-
}
|
|
202
|
-
withUserAddress(address) {
|
|
203
|
-
this.userAddress = address;
|
|
204
|
-
return this;
|
|
205
|
-
}
|
|
206
|
-
withIntegrator(address) {
|
|
207
|
-
this.integrator = address ?? ZERO_ADDRESS;
|
|
208
|
-
return this;
|
|
209
|
-
}
|
|
210
|
-
withGasLimit(gas) {
|
|
211
|
-
this.gasLimit = gas;
|
|
212
|
-
return this;
|
|
213
|
-
}
|
|
214
|
-
withTime(params) {
|
|
215
|
-
if (!params) {
|
|
216
|
-
this.startTimeOffset = void 0;
|
|
217
|
-
this.blockTimestamp = void 0;
|
|
218
|
-
return this;
|
|
219
|
-
}
|
|
220
|
-
this.startTimeOffset = params.startTimeOffset;
|
|
221
|
-
this.blockTimestamp = params.blockTimestamp;
|
|
222
|
-
return this;
|
|
223
|
-
}
|
|
224
|
-
// Address override helpers
|
|
225
|
-
overrideModule(key, address) {
|
|
226
|
-
this.moduleAddresses = {
|
|
227
|
-
...this.moduleAddresses,
|
|
228
|
-
[key]: address
|
|
229
|
-
};
|
|
230
|
-
return this;
|
|
231
|
-
}
|
|
232
|
-
withTokenFactory(address) {
|
|
233
|
-
return this.overrideModule("tokenFactory", address);
|
|
234
|
-
}
|
|
235
|
-
withAirlock(address) {
|
|
236
|
-
return this.overrideModule("airlock", address);
|
|
237
|
-
}
|
|
238
|
-
withV4Initializer(address) {
|
|
239
|
-
return this.overrideModule("v4Initializer", address);
|
|
240
|
-
}
|
|
241
|
-
withPoolManager(address) {
|
|
242
|
-
return this.overrideModule("poolManager", address);
|
|
243
|
-
}
|
|
244
|
-
withDopplerDeployer(address) {
|
|
245
|
-
return this.overrideModule("dopplerDeployer", address);
|
|
246
|
-
}
|
|
247
|
-
withGovernanceFactory(address) {
|
|
248
|
-
return this.overrideModule("governanceFactory", address);
|
|
249
|
-
}
|
|
250
|
-
withV2Migrator(address) {
|
|
251
|
-
return this.overrideModule("v2Migrator", address);
|
|
252
|
-
}
|
|
253
|
-
withV4Migrator(address) {
|
|
254
|
-
return this.overrideModule("v4Migrator", address);
|
|
255
|
-
}
|
|
256
|
-
withDopplerHookMigrator(address) {
|
|
257
|
-
return this.overrideModule("dopplerHookMigrator", address);
|
|
258
|
-
}
|
|
259
|
-
withRehypeDopplerHookMigrator(address) {
|
|
260
|
-
return this.overrideModule("rehypeDopplerHookMigrator", address);
|
|
261
|
-
}
|
|
262
|
-
withNoOpMigrator(address) {
|
|
263
|
-
return this.overrideModule("noOpMigrator", address);
|
|
264
|
-
}
|
|
265
|
-
build() {
|
|
266
|
-
if (!this.token) throw new Error("tokenConfig is required");
|
|
267
|
-
if (!this.sale) throw new Error("saleConfig is required");
|
|
268
|
-
if (!this.migration) throw new Error("migration configuration is required");
|
|
269
|
-
if (!this.userAddress) throw new Error("userAddress is required");
|
|
270
|
-
if (this.marketCapConfig && !this.pool) {
|
|
271
|
-
const config = this.marketCapConfig;
|
|
272
|
-
const tokenSupply = config.tokenSupply ?? this.sale.initialSupply;
|
|
273
|
-
if (!tokenSupply) {
|
|
274
|
-
throw new Error(
|
|
275
|
-
"tokenSupply must be provided (either via saleConfig() or withMarketCapRange() params)"
|
|
276
|
-
);
|
|
277
|
-
}
|
|
278
|
-
const fee = config.fee ?? FEE_TIERS.HIGH;
|
|
279
|
-
const tickSpacing = config.tickSpacing ?? DOPPLER_MAX_TICK_SPACING;
|
|
280
|
-
this.pool = { fee, tickSpacing };
|
|
281
|
-
const startValidation = validateMarketCapParameters(
|
|
282
|
-
config.marketCap.start,
|
|
283
|
-
tokenSupply,
|
|
284
|
-
config.tokenDecimals
|
|
285
|
-
);
|
|
286
|
-
const minValidation = validateMarketCapParameters(
|
|
287
|
-
config.marketCap.min,
|
|
288
|
-
tokenSupply,
|
|
289
|
-
config.tokenDecimals
|
|
290
|
-
);
|
|
291
|
-
const allWarnings = [
|
|
292
|
-
...startValidation.warnings,
|
|
293
|
-
...minValidation.warnings
|
|
294
|
-
];
|
|
295
|
-
if (allWarnings.length > 0) {
|
|
296
|
-
console.warn("Market cap validation warnings:");
|
|
297
|
-
allWarnings.forEach((w) => console.warn(` - ${w}`));
|
|
298
|
-
}
|
|
299
|
-
const { startTick, endTick } = marketCapToTicksForDynamicAuction({
|
|
300
|
-
marketCapRange: {
|
|
301
|
-
start: config.marketCap.min,
|
|
302
|
-
end: config.marketCap.start
|
|
303
|
-
},
|
|
304
|
-
tokenSupply,
|
|
305
|
-
numerairePriceUSD: config.numerairePrice,
|
|
306
|
-
numeraire: this.sale.numeraire,
|
|
307
|
-
tickSpacing,
|
|
308
|
-
tokenDecimals: config.tokenDecimals ?? 18,
|
|
309
|
-
numeraireDecimals: config.numeraireDecimals ?? 18
|
|
310
|
-
});
|
|
311
|
-
const duration = config.duration ?? DEFAULT_AUCTION_DURATION;
|
|
312
|
-
const epochLength = config.epochLength ?? DEFAULT_EPOCH_LENGTH;
|
|
313
|
-
const gamma2 = config.gamma ?? computeOptimalGamma(
|
|
314
|
-
startTick,
|
|
315
|
-
endTick,
|
|
316
|
-
duration,
|
|
317
|
-
epochLength,
|
|
318
|
-
tickSpacing
|
|
319
|
-
);
|
|
320
|
-
this.auction = {
|
|
321
|
-
duration,
|
|
322
|
-
epochLength,
|
|
323
|
-
startTick,
|
|
324
|
-
endTick,
|
|
325
|
-
gamma: gamma2,
|
|
326
|
-
minProceeds: config.minProceeds,
|
|
327
|
-
maxProceeds: config.maxProceeds,
|
|
328
|
-
numPdSlugs: config.numPdSlugs
|
|
329
|
-
};
|
|
330
|
-
}
|
|
331
|
-
if (!this.pool) throw new Error("poolConfig is required");
|
|
332
|
-
if (!this.auction) throw new Error("auction configuration is required");
|
|
333
|
-
if (this.migration.type === "noOp") {
|
|
334
|
-
throw new Error(
|
|
335
|
-
"noOp migration is not supported for dynamic auctions. Use uniswapV2, uniswapV4, or dopplerHook migration instead."
|
|
336
|
-
);
|
|
337
|
-
}
|
|
338
|
-
const governance = this.governance ?? (isNoOpEnabledChain(this.chainId) ? { type: "noOp" } : { type: "default" });
|
|
339
|
-
if (governance.type === "launchpad" && !isLaunchpadEnabledChain(this.chainId)) {
|
|
340
|
-
throw new Error(
|
|
341
|
-
`Launchpad governance is not supported on chain ${this.chainId}. Use a supported chain or a different governance type.`
|
|
342
|
-
);
|
|
343
|
-
}
|
|
344
|
-
let { gamma } = this.auction;
|
|
345
|
-
if (gamma === void 0) {
|
|
346
|
-
gamma = computeOptimalGamma(
|
|
347
|
-
this.auction.startTick,
|
|
348
|
-
this.auction.endTick,
|
|
349
|
-
this.auction.duration,
|
|
350
|
-
this.auction.epochLength,
|
|
351
|
-
this.pool.tickSpacing
|
|
352
|
-
);
|
|
353
|
-
}
|
|
354
|
-
const auction = { ...this.auction, gamma };
|
|
355
|
-
return {
|
|
356
|
-
token: this.token,
|
|
357
|
-
sale: this.sale,
|
|
358
|
-
auction,
|
|
359
|
-
pool: this.pool,
|
|
360
|
-
vesting: this.vesting,
|
|
361
|
-
governance,
|
|
362
|
-
migration: this.migration,
|
|
363
|
-
integrator: this.integrator ?? ZERO_ADDRESS,
|
|
364
|
-
userAddress: this.userAddress,
|
|
365
|
-
startTimeOffset: this.startTimeOffset,
|
|
366
|
-
blockTimestamp: this.blockTimestamp,
|
|
367
|
-
modules: this.moduleAddresses,
|
|
368
|
-
gas: this.gasLimit
|
|
369
|
-
};
|
|
370
|
-
}
|
|
371
|
-
};
|
|
372
|
-
|
|
373
|
-
export { DynamicAuctionBuilder };
|
|
374
|
-
//# sourceMappingURL=chunk-WNWK2QMU.mjs.map
|
|
375
|
-
//# sourceMappingURL=chunk-WNWK2QMU.mjs.map
|