@whetstone-research/doppler-sdk 1.0.5 → 1.0.7
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 +16 -1
- package/dist/evm/index.cjs +204 -25
- package/dist/evm/index.cjs.map +1 -1
- package/dist/evm/index.d.cts +49 -33
- package/dist/evm/index.d.ts +49 -33
- package/dist/evm/index.js +204 -25
- package/dist/evm/index.js.map +1 -1
- package/package.json +1 -1
package/dist/evm/index.d.cts
CHANGED
|
@@ -135,12 +135,28 @@ interface OpeningAuctionDopplerConfig$1 {
|
|
|
135
135
|
startTimeOffset?: number;
|
|
136
136
|
startingTime?: number;
|
|
137
137
|
}
|
|
138
|
-
interface
|
|
138
|
+
interface VestingScheduleConfig {
|
|
139
|
+
duration: number;
|
|
140
|
+
cliffDuration: number;
|
|
141
|
+
}
|
|
142
|
+
interface VestingAllocationConfig {
|
|
143
|
+
recipient: Address;
|
|
144
|
+
amount: bigint;
|
|
145
|
+
schedule: VestingScheduleConfig;
|
|
146
|
+
}
|
|
147
|
+
type VestingConfig = {
|
|
139
148
|
duration: number;
|
|
140
149
|
cliffDuration: number;
|
|
141
150
|
recipients?: Address[];
|
|
142
151
|
amounts?: bigint[];
|
|
143
|
-
|
|
152
|
+
allocations?: never;
|
|
153
|
+
} | {
|
|
154
|
+
duration?: never;
|
|
155
|
+
cliffDuration?: never;
|
|
156
|
+
recipients?: never;
|
|
157
|
+
amounts?: never;
|
|
158
|
+
allocations: VestingAllocationConfig[];
|
|
159
|
+
};
|
|
144
160
|
declare const NO_OP_ENABLED_CHAIN_IDS: readonly [1, 11155111, 8453, 84532, 130, 1301, 10143, 143];
|
|
145
161
|
type NoOpEnabledChainId = (typeof NO_OP_ENABLED_CHAIN_IDS)[number];
|
|
146
162
|
/**
|
|
@@ -764,8 +780,11 @@ declare class DopplerFactory<C extends SupportedChainId = SupportedChainId> {
|
|
|
764
780
|
private customMigrationEncoder?;
|
|
765
781
|
private multicurveBundlerSupport;
|
|
766
782
|
constructor(publicClient: SupportedPublicClient, walletClient: WalletClient | undefined, chainId: C);
|
|
783
|
+
private hasCustomV2Schedules;
|
|
767
784
|
private usesDerc20V2Vesting;
|
|
768
785
|
private resolveVestingAllocations;
|
|
786
|
+
private validateUint64LikeNumber;
|
|
787
|
+
private resolveV2VestingSchedules;
|
|
769
788
|
private resolveStandardTokenFactoryMode;
|
|
770
789
|
private assertStandardTokenFactoryCompatibility;
|
|
771
790
|
private buildStandardTokenFactoryData;
|
|
@@ -2354,6 +2373,28 @@ declare class Eth {
|
|
|
2354
2373
|
getBalanceOf(account: Address): Promise<bigint>;
|
|
2355
2374
|
}
|
|
2356
2375
|
|
|
2376
|
+
type BuilderVestingScheduleInput = {
|
|
2377
|
+
duration?: bigint;
|
|
2378
|
+
cliffDuration?: number;
|
|
2379
|
+
};
|
|
2380
|
+
type BuilderVestingAllocationInput = {
|
|
2381
|
+
recipient: Address;
|
|
2382
|
+
amount: bigint;
|
|
2383
|
+
schedule: BuilderVestingScheduleInput;
|
|
2384
|
+
};
|
|
2385
|
+
type BuilderVestingInput = {
|
|
2386
|
+
duration?: bigint;
|
|
2387
|
+
cliffDuration?: number;
|
|
2388
|
+
recipients?: Address[];
|
|
2389
|
+
amounts?: bigint[];
|
|
2390
|
+
allocations?: never;
|
|
2391
|
+
} | {
|
|
2392
|
+
duration?: never;
|
|
2393
|
+
cliffDuration?: never;
|
|
2394
|
+
recipients?: never;
|
|
2395
|
+
amounts?: never;
|
|
2396
|
+
allocations: BuilderVestingAllocationInput[];
|
|
2397
|
+
};
|
|
2357
2398
|
/**
|
|
2358
2399
|
* Common interface shared by all auction builders.
|
|
2359
2400
|
*
|
|
@@ -2397,12 +2438,7 @@ interface BaseAuctionBuilder<C extends SupportedChainId> {
|
|
|
2397
2438
|
* Configure token vesting for team/investor allocations.
|
|
2398
2439
|
* Pass undefined or omit to disable vesting.
|
|
2399
2440
|
*/
|
|
2400
|
-
withVesting(params?:
|
|
2401
|
-
duration?: bigint;
|
|
2402
|
-
cliffDuration?: number;
|
|
2403
|
-
recipients?: Address[];
|
|
2404
|
-
amounts?: bigint[];
|
|
2405
|
-
}): this;
|
|
2441
|
+
withVesting(params?: BuilderVestingInput): this;
|
|
2406
2442
|
/**
|
|
2407
2443
|
* Configure governance for the token.
|
|
2408
2444
|
* @param params - Use { type: 'default' }, { type: 'noOp' }, { type: 'launchpad', multisig: '0x...' }, or { type: 'custom', ... }
|
|
@@ -2543,12 +2579,7 @@ declare class StaticAuctionBuilder<C extends SupportedChainId> implements BaseAu
|
|
|
2543
2579
|
beneficiary: Address;
|
|
2544
2580
|
shares: bigint;
|
|
2545
2581
|
}[]): this;
|
|
2546
|
-
withVesting(params?:
|
|
2547
|
-
duration?: bigint;
|
|
2548
|
-
cliffDuration?: number;
|
|
2549
|
-
recipients?: Address[];
|
|
2550
|
-
amounts?: bigint[];
|
|
2551
|
-
}): this;
|
|
2582
|
+
withVesting(params?: BuilderVestingInput): this;
|
|
2552
2583
|
withGovernance(params: GovernanceOption<C>): this;
|
|
2553
2584
|
withMigration(migration: MigrationConfig): this;
|
|
2554
2585
|
withUserAddress(address: Address): this;
|
|
@@ -2666,12 +2697,7 @@ declare class DynamicAuctionBuilder<C extends SupportedChainId> implements BaseA
|
|
|
2666
2697
|
* ```
|
|
2667
2698
|
*/
|
|
2668
2699
|
withMarketCapRange(params: DynamicAuctionMarketCapConfig): this;
|
|
2669
|
-
withVesting(params?:
|
|
2670
|
-
duration?: bigint;
|
|
2671
|
-
cliffDuration?: number;
|
|
2672
|
-
recipients?: Address[];
|
|
2673
|
-
amounts?: bigint[];
|
|
2674
|
-
}): this;
|
|
2700
|
+
withVesting(params?: BuilderVestingInput): this;
|
|
2675
2701
|
withGovernance(params: GovernanceOption<C>): this;
|
|
2676
2702
|
withMigration(migration: MigrationConfig): this;
|
|
2677
2703
|
withUserAddress(address: Address): this;
|
|
@@ -2843,12 +2869,7 @@ declare class MulticurveBuilder<C extends SupportedChainId> implements BaseAucti
|
|
|
2843
2869
|
private resolveRehypeFeeDistributionInfo;
|
|
2844
2870
|
private validateRehypeDistribution;
|
|
2845
2871
|
private resolveRehypeFeeSchedule;
|
|
2846
|
-
withVesting(params?:
|
|
2847
|
-
duration?: bigint;
|
|
2848
|
-
cliffDuration?: number;
|
|
2849
|
-
recipients?: Address[];
|
|
2850
|
-
amounts?: bigint[];
|
|
2851
|
-
}): this;
|
|
2872
|
+
withVesting(params?: BuilderVestingInput): this;
|
|
2852
2873
|
private parseStartTimeSeconds;
|
|
2853
2874
|
private assertCanSetInitializer;
|
|
2854
2875
|
/**
|
|
@@ -2981,12 +3002,7 @@ declare class OpeningAuctionBuilder<C extends SupportedChainId> implements BaseA
|
|
|
2981
3002
|
}): this;
|
|
2982
3003
|
openingAuctionConfig(params: OpeningAuctionConfig): this;
|
|
2983
3004
|
dopplerConfig(params: OpeningAuctionDopplerConfig): this;
|
|
2984
|
-
withVesting(params?:
|
|
2985
|
-
duration?: bigint;
|
|
2986
|
-
cliffDuration?: number;
|
|
2987
|
-
recipients?: Address[];
|
|
2988
|
-
amounts?: bigint[];
|
|
2989
|
-
}): this;
|
|
3005
|
+
withVesting(params?: BuilderVestingInput): this;
|
|
2990
3006
|
withGovernance(params: GovernanceOption<C>): this;
|
|
2991
3007
|
withMigration(migration: MigrationConfig): this;
|
|
2992
3008
|
withUserAddress(address: Address): this;
|
|
@@ -9161,4 +9177,4 @@ declare const rehypeDopplerHookMigratorAbi: readonly [{
|
|
|
9161
9177
|
|
|
9162
9178
|
declare const VERSION = "1.0.0";
|
|
9163
9179
|
|
|
9164
|
-
export { ADDRESSES, BASIS_POINTS, type BaseAuctionBuilder, type BeneficiaryData, CHAIN_IDS, type ChainAddresses, type CreateDynamicAuctionParams, type CreateMulticurveParams, type CreateOpeningAuctionParams, type CreateParams, type CreateStaticAuctionParams, DAY_SECONDS, DEAD_ADDRESS, DECAY_MAX_START_FEE, DEFAULT_AIRLOCK_BENEFICIARY_SHARES, DEFAULT_AUCTION_DURATION, DEFAULT_EPOCH_LENGTH, DEFAULT_LOCK_DURATION, DEFAULT_MULTICURVE_LOWER_TICKS, DEFAULT_MULTICURVE_MAX_SUPPLY_SHARES, DEFAULT_MULTICURVE_NUM_POSITIONS, DEFAULT_MULTICURVE_UPPER_TICKS, DEFAULT_OPENING_AUCTION_DURATION, DEFAULT_OPENING_AUCTION_FEE, DEFAULT_OPENING_AUCTION_INCENTIVE_SHARE_BPS, DEFAULT_OPENING_AUCTION_MIN_ACCEPTABLE_TICK_TOKEN0, DEFAULT_OPENING_AUCTION_MIN_ACCEPTABLE_TICK_TOKEN1, DEFAULT_OPENING_AUCTION_MIN_LIQUIDITY, DEFAULT_OPENING_AUCTION_SHARE_TO_AUCTION_BPS, DEFAULT_OPENING_DOPPLER_DURATION, DEFAULT_OPENING_DOPPLER_EPOCH_LENGTH, DEFAULT_OPENING_DOPPLER_FEE, DEFAULT_OPENING_DOPPLER_NUM_PD_SLUGS, DEFAULT_OPENING_DOPPLER_TICK_SPACING, DEFAULT_PD_SLUGS, DEFAULT_V3_END_TICK, DEFAULT_V3_FEE, DEFAULT_V3_INITIAL_PROPOSAL_THRESHOLD, DEFAULT_V3_INITIAL_SUPPLY, DEFAULT_V3_INITIAL_VOTING_DELAY, DEFAULT_V3_INITIAL_VOTING_PERIOD, DEFAULT_V3_MAX_SHARE_TO_BE_SOLD, DEFAULT_V3_NUM_POSITIONS, DEFAULT_V3_NUM_TOKENS_TO_SELL, DEFAULT_V3_PRE_MINT, DEFAULT_V3_START_TICK, DEFAULT_V3_VESTING_DURATION, DEFAULT_V3_YEARLY_MINT_RATE, DEFAULT_V4_INITIAL_PROPOSAL_THRESHOLD, DEFAULT_V4_INITIAL_VOTING_DELAY, DEFAULT_V4_INITIAL_VOTING_PERIOD, DEFAULT_V4_YEARLY_MINT_RATE, _default$1 as DERC2080Bytecode, _default$2 as DERC20Bytecode, DOPPLER_FLAGS, DOPPLER_MAX_TICK_SPACING, DYNAMIC_FEE_FLAG, Derc20, Derc20V2, _default$5 as DopplerBytecode, _default$4 as DopplerDN404Bytecode, DopplerFactory, type DopplerHookMigrationConfig, DopplerSDK, type DopplerSDKConfig, DynamicAuction, DynamicAuctionBuilder, type DynamicAuctionConfig, type DynamicAuctionMarketCapConfig, type DynamicMarketCapRange, Eth, FEE_AMOUNT_MASK, FEE_TIERS, FLAG_MASK, type FeeTier, type GovernanceLaunchpad, type GovernanceOption, type HookInfo, INT24_MAX, INT24_MIN, LAUNCHPAD_ENABLED_CHAIN_IDS, type LaunchpadEnabledChainId, type LockablePoolState, LockablePoolStatus, type LockableV3InitializerParams, MAX_SQRT_RATIO, MAX_TICK, MIN_SQRT_RATIO, MIN_TICK, type MarketCapConfig, type MarketCapRange, type MarketCapValidationResult, type MigrationConfig, type MigrationEncoder, type ModuleAddressOverrides, MulticurveBuilder, type MulticurveBundleExactInResult, type MulticurveBundleExactOutResult, type MulticurveDecayFeeSchedule, type MulticurveInitializerConfig, type MulticurveMarketCapCurvesConfig, type MulticurveMarketCapPreset, type MulticurveMarketCapRangeCurve, MulticurvePool, type MulticurvePoolState, NO_OP_ENABLED_CHAIN_IDS, type NoOpEnabledChainId, OPENING_AUCTION_FLAGS, OPENING_AUCTION_PHASE_ACTIVE, OPENING_AUCTION_PHASE_CLOSED, OPENING_AUCTION_PHASE_NOT_STARTED, OPENING_AUCTION_PHASE_SETTLED, OPENING_AUCTION_STATUS_ACTIVE, OPENING_AUCTION_STATUS_DOPPLER_ACTIVE, OPENING_AUCTION_STATUS_EXITED, OPENING_AUCTION_STATUS_UNINITIALIZED, OpeningAuction, type OpeningAuctionAuctionSettledEvent, type OpeningAuctionBidArgs, type OpeningAuctionBidConstraints, type OpeningAuctionBidLookupArgs, OpeningAuctionBidManager, type OpeningAuctionBidManagerConfig, type OpeningAuctionBidPlacedEvent, type OpeningAuctionBidPositionInfo, type OpeningAuctionBidQuote, type OpeningAuctionBidSimulationResult, type OpeningAuctionBidStatus, type OpeningAuctionBidValidationResult, type OpeningAuctionBidWithdrawnEvent, OpeningAuctionBuilder, _default$3 as OpeningAuctionBytecode, type OpeningAuctionClaimAllIncentivesPreview, type OpeningAuctionClaimAllIncentivesResult, type OpeningAuctionClaimIncentivesSimulationResult, type OpeningAuctionCompleteResult, type OpeningAuctionConfig, type OpeningAuctionCreateResult, type OpeningAuctionDopplerConfig, type OpeningAuctionEstimatedClearingTickUpdatedEvent, type OpeningAuctionIncentiveData, type OpeningAuctionIncentivesClaimedEvent, OpeningAuctionLifecycle, type OpeningAuctionModifyLiquidityParams, type OpeningAuctionModifyLiquiditySimulationResult, type OpeningAuctionModuleAddressOverrides, type OpeningAuctionMoveBidArgs, type OpeningAuctionMoveBidResult, type OpeningAuctionMoveBidSimulationResult, type OpeningAuctionOwnerBidInfo, type OpeningAuctionOwnerBidStatus, OpeningAuctionPhase, type OpeningAuctionPhaseChangedEvent, type OpeningAuctionPosition, OpeningAuctionPositionManager, type OpeningAuctionQuoteFromTokenAmountArgs, type OpeningAuctionQuoteFromTokenAmountResult, type OpeningAuctionSettlementData, type OpeningAuctionState, OpeningAuctionStatus, type OpeningAuctionWatchBidPlacedOptions, type OpeningAuctionWatchBidStatusOptions, type OpeningAuctionWatchBidWithdrawnOptions, type OpeningAuctionWatchEstimatedClearingTickOptions, type OpeningAuctionWatchIncentivesClaimedOptions, type OpeningAuctionWatchPhaseChangeOptions, type OpeningAuctionWatchSettlementOptions, type OpeningAuctionWithdrawFullBidArgs, type OpeningAuctionWithdrawFullBidResult, type OpeningAuctionWithdrawFullBidSimulationResult, type PoolInfo, Q96, type QuoteResult, Quoter, RehypeDopplerHook, type RehypeDopplerHookConfig, RehypeDopplerHookMigrator, type RehypeDopplerHookMigratorConfig, type RehypeFeeDistributionInfo, RehypeFeeRoutingMode, type ResolvedOpeningAuctionDopplerConfig, SECONDS_PER_DAY, SECONDS_PER_YEAR, SUPPORTED_CHAIN_IDS, type SaleConfig, _default as StateViewBytecode, StaticAuction, StaticAuctionBuilder, type StaticAuctionMarketCapConfig, type StaticPoolConfig, type SupportedChain, type SupportedChainId, type SupportedChainKey, type SupportedPublicClient, TICK_SPACINGS, type TokenAddressHookConfig, type TokenAddressMiningParams, type TokenAddressMiningResult, type TokenConfig, type TokenVariant, V3_FEE_TIERS, type V4PoolKey, V4_MAX_FEE, VALID_FEE_TIERS, VERSION, type VestingConfig, WAD, ZERO_ADDRESS, airlockAbi, applyTickOffsets, bundlerAbi, calculateFDV, calculateGamma, calculateMarketCap, calculateTickRange, calculateTokensToSell, computeOptimalGamma, computePoolId, createAirlockBeneficiary, decayMulticurveInitializerHookAbi, decodeBalanceDelta, derc20Abi, derc20V2Abi, dopplerHookAbi, dopplerHookInitializerAbi, dopplerLensAbi, encodeRehypeDopplerHookMigratorCalldata, estimatePriceAtEpoch, estimateSlippage, formatTickAsPrice, getAddresses, getAirlockBeneficiary, getAirlockOwner, getAmount0ForLiquidity, getAmount1ForLiquidity, getLiquidityForAmount0, getLiquidityForAmount1, getMaxTickRounded, getNearestUsableTick, getSqrtRatioAtTick, getTickAtSqrtRatio, isLaunchpadEnabledChain, isNoOpEnabledChain, isSupportedChainId, isToken0Expected, isToken1, lockableUniswapV3InitializerAbi, marketCapToTickForMulticurve, marketCapToTicksForDynamicAuction, marketCapToTicksForMulticurve, marketCapToTicksForStaticAuction, marketCapToTokenPrice, mineTokenAddress, normalizePoolKey, openingAuctionAbi, openingAuctionInitializerAbi, openingAuctionPositionManagerAbi, poolManagerAbi, priceToSqrtPriceX96, priceToTick, quoterV2Abi, ratioToTick, rehypeDopplerHookAbi, rehypeDopplerHookMigratorAbi, resolveGasEstimate, sqrtPriceX96ToPrice, streamableFeesLockerAbi, tickToMarketCap, tickToPrice, tokenPriceToRatio, uniswapV2Router02Abi, uniswapV3InitializerAbi, uniswapV3PoolAbi, uniswapV4InitializerAbi, v2MigratorAbi, v3MigratorAbi, v4MigratorAbi, v4MulticurveInitializerAbi, v4MulticurveMigratorAbi, v4QuoterAbi, validateMarketCapParameters, weth9Abi };
|
|
9180
|
+
export { ADDRESSES, BASIS_POINTS, type BaseAuctionBuilder, type BeneficiaryData, CHAIN_IDS, type ChainAddresses, type CreateDynamicAuctionParams, type CreateMulticurveParams, type CreateOpeningAuctionParams, type CreateParams, type CreateStaticAuctionParams, DAY_SECONDS, DEAD_ADDRESS, DECAY_MAX_START_FEE, DEFAULT_AIRLOCK_BENEFICIARY_SHARES, DEFAULT_AUCTION_DURATION, DEFAULT_EPOCH_LENGTH, DEFAULT_LOCK_DURATION, DEFAULT_MULTICURVE_LOWER_TICKS, DEFAULT_MULTICURVE_MAX_SUPPLY_SHARES, DEFAULT_MULTICURVE_NUM_POSITIONS, DEFAULT_MULTICURVE_UPPER_TICKS, DEFAULT_OPENING_AUCTION_DURATION, DEFAULT_OPENING_AUCTION_FEE, DEFAULT_OPENING_AUCTION_INCENTIVE_SHARE_BPS, DEFAULT_OPENING_AUCTION_MIN_ACCEPTABLE_TICK_TOKEN0, DEFAULT_OPENING_AUCTION_MIN_ACCEPTABLE_TICK_TOKEN1, DEFAULT_OPENING_AUCTION_MIN_LIQUIDITY, DEFAULT_OPENING_AUCTION_SHARE_TO_AUCTION_BPS, DEFAULT_OPENING_DOPPLER_DURATION, DEFAULT_OPENING_DOPPLER_EPOCH_LENGTH, DEFAULT_OPENING_DOPPLER_FEE, DEFAULT_OPENING_DOPPLER_NUM_PD_SLUGS, DEFAULT_OPENING_DOPPLER_TICK_SPACING, DEFAULT_PD_SLUGS, DEFAULT_V3_END_TICK, DEFAULT_V3_FEE, DEFAULT_V3_INITIAL_PROPOSAL_THRESHOLD, DEFAULT_V3_INITIAL_SUPPLY, DEFAULT_V3_INITIAL_VOTING_DELAY, DEFAULT_V3_INITIAL_VOTING_PERIOD, DEFAULT_V3_MAX_SHARE_TO_BE_SOLD, DEFAULT_V3_NUM_POSITIONS, DEFAULT_V3_NUM_TOKENS_TO_SELL, DEFAULT_V3_PRE_MINT, DEFAULT_V3_START_TICK, DEFAULT_V3_VESTING_DURATION, DEFAULT_V3_YEARLY_MINT_RATE, DEFAULT_V4_INITIAL_PROPOSAL_THRESHOLD, DEFAULT_V4_INITIAL_VOTING_DELAY, DEFAULT_V4_INITIAL_VOTING_PERIOD, DEFAULT_V4_YEARLY_MINT_RATE, _default$1 as DERC2080Bytecode, _default$2 as DERC20Bytecode, DOPPLER_FLAGS, DOPPLER_MAX_TICK_SPACING, DYNAMIC_FEE_FLAG, Derc20, Derc20V2, _default$5 as DopplerBytecode, _default$4 as DopplerDN404Bytecode, DopplerFactory, type DopplerHookMigrationConfig, DopplerSDK, type DopplerSDKConfig, DynamicAuction, DynamicAuctionBuilder, type DynamicAuctionConfig, type DynamicAuctionMarketCapConfig, type DynamicMarketCapRange, Eth, FEE_AMOUNT_MASK, FEE_TIERS, FLAG_MASK, type FeeTier, type GovernanceLaunchpad, type GovernanceOption, type HookInfo, INT24_MAX, INT24_MIN, LAUNCHPAD_ENABLED_CHAIN_IDS, type LaunchpadEnabledChainId, type LockablePoolState, LockablePoolStatus, type LockableV3InitializerParams, MAX_SQRT_RATIO, MAX_TICK, MIN_SQRT_RATIO, MIN_TICK, type MarketCapConfig, type MarketCapRange, type MarketCapValidationResult, type MigrationConfig, type MigrationEncoder, type ModuleAddressOverrides, MulticurveBuilder, type MulticurveBundleExactInResult, type MulticurveBundleExactOutResult, type MulticurveDecayFeeSchedule, type MulticurveInitializerConfig, type MulticurveMarketCapCurvesConfig, type MulticurveMarketCapPreset, type MulticurveMarketCapRangeCurve, MulticurvePool, type MulticurvePoolState, NO_OP_ENABLED_CHAIN_IDS, type NoOpEnabledChainId, OPENING_AUCTION_FLAGS, OPENING_AUCTION_PHASE_ACTIVE, OPENING_AUCTION_PHASE_CLOSED, OPENING_AUCTION_PHASE_NOT_STARTED, OPENING_AUCTION_PHASE_SETTLED, OPENING_AUCTION_STATUS_ACTIVE, OPENING_AUCTION_STATUS_DOPPLER_ACTIVE, OPENING_AUCTION_STATUS_EXITED, OPENING_AUCTION_STATUS_UNINITIALIZED, OpeningAuction, type OpeningAuctionAuctionSettledEvent, type OpeningAuctionBidArgs, type OpeningAuctionBidConstraints, type OpeningAuctionBidLookupArgs, OpeningAuctionBidManager, type OpeningAuctionBidManagerConfig, type OpeningAuctionBidPlacedEvent, type OpeningAuctionBidPositionInfo, type OpeningAuctionBidQuote, type OpeningAuctionBidSimulationResult, type OpeningAuctionBidStatus, type OpeningAuctionBidValidationResult, type OpeningAuctionBidWithdrawnEvent, OpeningAuctionBuilder, _default$3 as OpeningAuctionBytecode, type OpeningAuctionClaimAllIncentivesPreview, type OpeningAuctionClaimAllIncentivesResult, type OpeningAuctionClaimIncentivesSimulationResult, type OpeningAuctionCompleteResult, type OpeningAuctionConfig, type OpeningAuctionCreateResult, type OpeningAuctionDopplerConfig, type OpeningAuctionEstimatedClearingTickUpdatedEvent, type OpeningAuctionIncentiveData, type OpeningAuctionIncentivesClaimedEvent, OpeningAuctionLifecycle, type OpeningAuctionModifyLiquidityParams, type OpeningAuctionModifyLiquiditySimulationResult, type OpeningAuctionModuleAddressOverrides, type OpeningAuctionMoveBidArgs, type OpeningAuctionMoveBidResult, type OpeningAuctionMoveBidSimulationResult, type OpeningAuctionOwnerBidInfo, type OpeningAuctionOwnerBidStatus, OpeningAuctionPhase, type OpeningAuctionPhaseChangedEvent, type OpeningAuctionPosition, OpeningAuctionPositionManager, type OpeningAuctionQuoteFromTokenAmountArgs, type OpeningAuctionQuoteFromTokenAmountResult, type OpeningAuctionSettlementData, type OpeningAuctionState, OpeningAuctionStatus, type OpeningAuctionWatchBidPlacedOptions, type OpeningAuctionWatchBidStatusOptions, type OpeningAuctionWatchBidWithdrawnOptions, type OpeningAuctionWatchEstimatedClearingTickOptions, type OpeningAuctionWatchIncentivesClaimedOptions, type OpeningAuctionWatchPhaseChangeOptions, type OpeningAuctionWatchSettlementOptions, type OpeningAuctionWithdrawFullBidArgs, type OpeningAuctionWithdrawFullBidResult, type OpeningAuctionWithdrawFullBidSimulationResult, type PoolInfo, Q96, type QuoteResult, Quoter, RehypeDopplerHook, type RehypeDopplerHookConfig, RehypeDopplerHookMigrator, type RehypeDopplerHookMigratorConfig, type RehypeFeeDistributionInfo, RehypeFeeRoutingMode, type ResolvedOpeningAuctionDopplerConfig, SECONDS_PER_DAY, SECONDS_PER_YEAR, SUPPORTED_CHAIN_IDS, type SaleConfig, _default as StateViewBytecode, StaticAuction, StaticAuctionBuilder, type StaticAuctionMarketCapConfig, type StaticPoolConfig, type SupportedChain, type SupportedChainId, type SupportedChainKey, type SupportedPublicClient, TICK_SPACINGS, type TokenAddressHookConfig, type TokenAddressMiningParams, type TokenAddressMiningResult, type TokenConfig, type TokenVariant, V3_FEE_TIERS, type V4PoolKey, V4_MAX_FEE, VALID_FEE_TIERS, VERSION, type VestingAllocationConfig, type VestingConfig, type VestingScheduleConfig, WAD, ZERO_ADDRESS, airlockAbi, applyTickOffsets, bundlerAbi, calculateFDV, calculateGamma, calculateMarketCap, calculateTickRange, calculateTokensToSell, computeOptimalGamma, computePoolId, createAirlockBeneficiary, decayMulticurveInitializerHookAbi, decodeBalanceDelta, derc20Abi, derc20V2Abi, dopplerHookAbi, dopplerHookInitializerAbi, dopplerLensAbi, encodeRehypeDopplerHookMigratorCalldata, estimatePriceAtEpoch, estimateSlippage, formatTickAsPrice, getAddresses, getAirlockBeneficiary, getAirlockOwner, getAmount0ForLiquidity, getAmount1ForLiquidity, getLiquidityForAmount0, getLiquidityForAmount1, getMaxTickRounded, getNearestUsableTick, getSqrtRatioAtTick, getTickAtSqrtRatio, isLaunchpadEnabledChain, isNoOpEnabledChain, isSupportedChainId, isToken0Expected, isToken1, lockableUniswapV3InitializerAbi, marketCapToTickForMulticurve, marketCapToTicksForDynamicAuction, marketCapToTicksForMulticurve, marketCapToTicksForStaticAuction, marketCapToTokenPrice, mineTokenAddress, normalizePoolKey, openingAuctionAbi, openingAuctionInitializerAbi, openingAuctionPositionManagerAbi, poolManagerAbi, priceToSqrtPriceX96, priceToTick, quoterV2Abi, ratioToTick, rehypeDopplerHookAbi, rehypeDopplerHookMigratorAbi, resolveGasEstimate, sqrtPriceX96ToPrice, streamableFeesLockerAbi, tickToMarketCap, tickToPrice, tokenPriceToRatio, uniswapV2Router02Abi, uniswapV3InitializerAbi, uniswapV3PoolAbi, uniswapV4InitializerAbi, v2MigratorAbi, v3MigratorAbi, v4MigratorAbi, v4MulticurveInitializerAbi, v4MulticurveMigratorAbi, v4QuoterAbi, validateMarketCapParameters, weth9Abi };
|
package/dist/evm/index.d.ts
CHANGED
|
@@ -135,12 +135,28 @@ interface OpeningAuctionDopplerConfig$1 {
|
|
|
135
135
|
startTimeOffset?: number;
|
|
136
136
|
startingTime?: number;
|
|
137
137
|
}
|
|
138
|
-
interface
|
|
138
|
+
interface VestingScheduleConfig {
|
|
139
|
+
duration: number;
|
|
140
|
+
cliffDuration: number;
|
|
141
|
+
}
|
|
142
|
+
interface VestingAllocationConfig {
|
|
143
|
+
recipient: Address;
|
|
144
|
+
amount: bigint;
|
|
145
|
+
schedule: VestingScheduleConfig;
|
|
146
|
+
}
|
|
147
|
+
type VestingConfig = {
|
|
139
148
|
duration: number;
|
|
140
149
|
cliffDuration: number;
|
|
141
150
|
recipients?: Address[];
|
|
142
151
|
amounts?: bigint[];
|
|
143
|
-
|
|
152
|
+
allocations?: never;
|
|
153
|
+
} | {
|
|
154
|
+
duration?: never;
|
|
155
|
+
cliffDuration?: never;
|
|
156
|
+
recipients?: never;
|
|
157
|
+
amounts?: never;
|
|
158
|
+
allocations: VestingAllocationConfig[];
|
|
159
|
+
};
|
|
144
160
|
declare const NO_OP_ENABLED_CHAIN_IDS: readonly [1, 11155111, 8453, 84532, 130, 1301, 10143, 143];
|
|
145
161
|
type NoOpEnabledChainId = (typeof NO_OP_ENABLED_CHAIN_IDS)[number];
|
|
146
162
|
/**
|
|
@@ -764,8 +780,11 @@ declare class DopplerFactory<C extends SupportedChainId = SupportedChainId> {
|
|
|
764
780
|
private customMigrationEncoder?;
|
|
765
781
|
private multicurveBundlerSupport;
|
|
766
782
|
constructor(publicClient: SupportedPublicClient, walletClient: WalletClient | undefined, chainId: C);
|
|
783
|
+
private hasCustomV2Schedules;
|
|
767
784
|
private usesDerc20V2Vesting;
|
|
768
785
|
private resolveVestingAllocations;
|
|
786
|
+
private validateUint64LikeNumber;
|
|
787
|
+
private resolveV2VestingSchedules;
|
|
769
788
|
private resolveStandardTokenFactoryMode;
|
|
770
789
|
private assertStandardTokenFactoryCompatibility;
|
|
771
790
|
private buildStandardTokenFactoryData;
|
|
@@ -2354,6 +2373,28 @@ declare class Eth {
|
|
|
2354
2373
|
getBalanceOf(account: Address): Promise<bigint>;
|
|
2355
2374
|
}
|
|
2356
2375
|
|
|
2376
|
+
type BuilderVestingScheduleInput = {
|
|
2377
|
+
duration?: bigint;
|
|
2378
|
+
cliffDuration?: number;
|
|
2379
|
+
};
|
|
2380
|
+
type BuilderVestingAllocationInput = {
|
|
2381
|
+
recipient: Address;
|
|
2382
|
+
amount: bigint;
|
|
2383
|
+
schedule: BuilderVestingScheduleInput;
|
|
2384
|
+
};
|
|
2385
|
+
type BuilderVestingInput = {
|
|
2386
|
+
duration?: bigint;
|
|
2387
|
+
cliffDuration?: number;
|
|
2388
|
+
recipients?: Address[];
|
|
2389
|
+
amounts?: bigint[];
|
|
2390
|
+
allocations?: never;
|
|
2391
|
+
} | {
|
|
2392
|
+
duration?: never;
|
|
2393
|
+
cliffDuration?: never;
|
|
2394
|
+
recipients?: never;
|
|
2395
|
+
amounts?: never;
|
|
2396
|
+
allocations: BuilderVestingAllocationInput[];
|
|
2397
|
+
};
|
|
2357
2398
|
/**
|
|
2358
2399
|
* Common interface shared by all auction builders.
|
|
2359
2400
|
*
|
|
@@ -2397,12 +2438,7 @@ interface BaseAuctionBuilder<C extends SupportedChainId> {
|
|
|
2397
2438
|
* Configure token vesting for team/investor allocations.
|
|
2398
2439
|
* Pass undefined or omit to disable vesting.
|
|
2399
2440
|
*/
|
|
2400
|
-
withVesting(params?:
|
|
2401
|
-
duration?: bigint;
|
|
2402
|
-
cliffDuration?: number;
|
|
2403
|
-
recipients?: Address[];
|
|
2404
|
-
amounts?: bigint[];
|
|
2405
|
-
}): this;
|
|
2441
|
+
withVesting(params?: BuilderVestingInput): this;
|
|
2406
2442
|
/**
|
|
2407
2443
|
* Configure governance for the token.
|
|
2408
2444
|
* @param params - Use { type: 'default' }, { type: 'noOp' }, { type: 'launchpad', multisig: '0x...' }, or { type: 'custom', ... }
|
|
@@ -2543,12 +2579,7 @@ declare class StaticAuctionBuilder<C extends SupportedChainId> implements BaseAu
|
|
|
2543
2579
|
beneficiary: Address;
|
|
2544
2580
|
shares: bigint;
|
|
2545
2581
|
}[]): this;
|
|
2546
|
-
withVesting(params?:
|
|
2547
|
-
duration?: bigint;
|
|
2548
|
-
cliffDuration?: number;
|
|
2549
|
-
recipients?: Address[];
|
|
2550
|
-
amounts?: bigint[];
|
|
2551
|
-
}): this;
|
|
2582
|
+
withVesting(params?: BuilderVestingInput): this;
|
|
2552
2583
|
withGovernance(params: GovernanceOption<C>): this;
|
|
2553
2584
|
withMigration(migration: MigrationConfig): this;
|
|
2554
2585
|
withUserAddress(address: Address): this;
|
|
@@ -2666,12 +2697,7 @@ declare class DynamicAuctionBuilder<C extends SupportedChainId> implements BaseA
|
|
|
2666
2697
|
* ```
|
|
2667
2698
|
*/
|
|
2668
2699
|
withMarketCapRange(params: DynamicAuctionMarketCapConfig): this;
|
|
2669
|
-
withVesting(params?:
|
|
2670
|
-
duration?: bigint;
|
|
2671
|
-
cliffDuration?: number;
|
|
2672
|
-
recipients?: Address[];
|
|
2673
|
-
amounts?: bigint[];
|
|
2674
|
-
}): this;
|
|
2700
|
+
withVesting(params?: BuilderVestingInput): this;
|
|
2675
2701
|
withGovernance(params: GovernanceOption<C>): this;
|
|
2676
2702
|
withMigration(migration: MigrationConfig): this;
|
|
2677
2703
|
withUserAddress(address: Address): this;
|
|
@@ -2843,12 +2869,7 @@ declare class MulticurveBuilder<C extends SupportedChainId> implements BaseAucti
|
|
|
2843
2869
|
private resolveRehypeFeeDistributionInfo;
|
|
2844
2870
|
private validateRehypeDistribution;
|
|
2845
2871
|
private resolveRehypeFeeSchedule;
|
|
2846
|
-
withVesting(params?:
|
|
2847
|
-
duration?: bigint;
|
|
2848
|
-
cliffDuration?: number;
|
|
2849
|
-
recipients?: Address[];
|
|
2850
|
-
amounts?: bigint[];
|
|
2851
|
-
}): this;
|
|
2872
|
+
withVesting(params?: BuilderVestingInput): this;
|
|
2852
2873
|
private parseStartTimeSeconds;
|
|
2853
2874
|
private assertCanSetInitializer;
|
|
2854
2875
|
/**
|
|
@@ -2981,12 +3002,7 @@ declare class OpeningAuctionBuilder<C extends SupportedChainId> implements BaseA
|
|
|
2981
3002
|
}): this;
|
|
2982
3003
|
openingAuctionConfig(params: OpeningAuctionConfig): this;
|
|
2983
3004
|
dopplerConfig(params: OpeningAuctionDopplerConfig): this;
|
|
2984
|
-
withVesting(params?:
|
|
2985
|
-
duration?: bigint;
|
|
2986
|
-
cliffDuration?: number;
|
|
2987
|
-
recipients?: Address[];
|
|
2988
|
-
amounts?: bigint[];
|
|
2989
|
-
}): this;
|
|
3005
|
+
withVesting(params?: BuilderVestingInput): this;
|
|
2990
3006
|
withGovernance(params: GovernanceOption<C>): this;
|
|
2991
3007
|
withMigration(migration: MigrationConfig): this;
|
|
2992
3008
|
withUserAddress(address: Address): this;
|
|
@@ -9161,4 +9177,4 @@ declare const rehypeDopplerHookMigratorAbi: readonly [{
|
|
|
9161
9177
|
|
|
9162
9178
|
declare const VERSION = "1.0.0";
|
|
9163
9179
|
|
|
9164
|
-
export { ADDRESSES, BASIS_POINTS, type BaseAuctionBuilder, type BeneficiaryData, CHAIN_IDS, type ChainAddresses, type CreateDynamicAuctionParams, type CreateMulticurveParams, type CreateOpeningAuctionParams, type CreateParams, type CreateStaticAuctionParams, DAY_SECONDS, DEAD_ADDRESS, DECAY_MAX_START_FEE, DEFAULT_AIRLOCK_BENEFICIARY_SHARES, DEFAULT_AUCTION_DURATION, DEFAULT_EPOCH_LENGTH, DEFAULT_LOCK_DURATION, DEFAULT_MULTICURVE_LOWER_TICKS, DEFAULT_MULTICURVE_MAX_SUPPLY_SHARES, DEFAULT_MULTICURVE_NUM_POSITIONS, DEFAULT_MULTICURVE_UPPER_TICKS, DEFAULT_OPENING_AUCTION_DURATION, DEFAULT_OPENING_AUCTION_FEE, DEFAULT_OPENING_AUCTION_INCENTIVE_SHARE_BPS, DEFAULT_OPENING_AUCTION_MIN_ACCEPTABLE_TICK_TOKEN0, DEFAULT_OPENING_AUCTION_MIN_ACCEPTABLE_TICK_TOKEN1, DEFAULT_OPENING_AUCTION_MIN_LIQUIDITY, DEFAULT_OPENING_AUCTION_SHARE_TO_AUCTION_BPS, DEFAULT_OPENING_DOPPLER_DURATION, DEFAULT_OPENING_DOPPLER_EPOCH_LENGTH, DEFAULT_OPENING_DOPPLER_FEE, DEFAULT_OPENING_DOPPLER_NUM_PD_SLUGS, DEFAULT_OPENING_DOPPLER_TICK_SPACING, DEFAULT_PD_SLUGS, DEFAULT_V3_END_TICK, DEFAULT_V3_FEE, DEFAULT_V3_INITIAL_PROPOSAL_THRESHOLD, DEFAULT_V3_INITIAL_SUPPLY, DEFAULT_V3_INITIAL_VOTING_DELAY, DEFAULT_V3_INITIAL_VOTING_PERIOD, DEFAULT_V3_MAX_SHARE_TO_BE_SOLD, DEFAULT_V3_NUM_POSITIONS, DEFAULT_V3_NUM_TOKENS_TO_SELL, DEFAULT_V3_PRE_MINT, DEFAULT_V3_START_TICK, DEFAULT_V3_VESTING_DURATION, DEFAULT_V3_YEARLY_MINT_RATE, DEFAULT_V4_INITIAL_PROPOSAL_THRESHOLD, DEFAULT_V4_INITIAL_VOTING_DELAY, DEFAULT_V4_INITIAL_VOTING_PERIOD, DEFAULT_V4_YEARLY_MINT_RATE, _default$1 as DERC2080Bytecode, _default$2 as DERC20Bytecode, DOPPLER_FLAGS, DOPPLER_MAX_TICK_SPACING, DYNAMIC_FEE_FLAG, Derc20, Derc20V2, _default$5 as DopplerBytecode, _default$4 as DopplerDN404Bytecode, DopplerFactory, type DopplerHookMigrationConfig, DopplerSDK, type DopplerSDKConfig, DynamicAuction, DynamicAuctionBuilder, type DynamicAuctionConfig, type DynamicAuctionMarketCapConfig, type DynamicMarketCapRange, Eth, FEE_AMOUNT_MASK, FEE_TIERS, FLAG_MASK, type FeeTier, type GovernanceLaunchpad, type GovernanceOption, type HookInfo, INT24_MAX, INT24_MIN, LAUNCHPAD_ENABLED_CHAIN_IDS, type LaunchpadEnabledChainId, type LockablePoolState, LockablePoolStatus, type LockableV3InitializerParams, MAX_SQRT_RATIO, MAX_TICK, MIN_SQRT_RATIO, MIN_TICK, type MarketCapConfig, type MarketCapRange, type MarketCapValidationResult, type MigrationConfig, type MigrationEncoder, type ModuleAddressOverrides, MulticurveBuilder, type MulticurveBundleExactInResult, type MulticurveBundleExactOutResult, type MulticurveDecayFeeSchedule, type MulticurveInitializerConfig, type MulticurveMarketCapCurvesConfig, type MulticurveMarketCapPreset, type MulticurveMarketCapRangeCurve, MulticurvePool, type MulticurvePoolState, NO_OP_ENABLED_CHAIN_IDS, type NoOpEnabledChainId, OPENING_AUCTION_FLAGS, OPENING_AUCTION_PHASE_ACTIVE, OPENING_AUCTION_PHASE_CLOSED, OPENING_AUCTION_PHASE_NOT_STARTED, OPENING_AUCTION_PHASE_SETTLED, OPENING_AUCTION_STATUS_ACTIVE, OPENING_AUCTION_STATUS_DOPPLER_ACTIVE, OPENING_AUCTION_STATUS_EXITED, OPENING_AUCTION_STATUS_UNINITIALIZED, OpeningAuction, type OpeningAuctionAuctionSettledEvent, type OpeningAuctionBidArgs, type OpeningAuctionBidConstraints, type OpeningAuctionBidLookupArgs, OpeningAuctionBidManager, type OpeningAuctionBidManagerConfig, type OpeningAuctionBidPlacedEvent, type OpeningAuctionBidPositionInfo, type OpeningAuctionBidQuote, type OpeningAuctionBidSimulationResult, type OpeningAuctionBidStatus, type OpeningAuctionBidValidationResult, type OpeningAuctionBidWithdrawnEvent, OpeningAuctionBuilder, _default$3 as OpeningAuctionBytecode, type OpeningAuctionClaimAllIncentivesPreview, type OpeningAuctionClaimAllIncentivesResult, type OpeningAuctionClaimIncentivesSimulationResult, type OpeningAuctionCompleteResult, type OpeningAuctionConfig, type OpeningAuctionCreateResult, type OpeningAuctionDopplerConfig, type OpeningAuctionEstimatedClearingTickUpdatedEvent, type OpeningAuctionIncentiveData, type OpeningAuctionIncentivesClaimedEvent, OpeningAuctionLifecycle, type OpeningAuctionModifyLiquidityParams, type OpeningAuctionModifyLiquiditySimulationResult, type OpeningAuctionModuleAddressOverrides, type OpeningAuctionMoveBidArgs, type OpeningAuctionMoveBidResult, type OpeningAuctionMoveBidSimulationResult, type OpeningAuctionOwnerBidInfo, type OpeningAuctionOwnerBidStatus, OpeningAuctionPhase, type OpeningAuctionPhaseChangedEvent, type OpeningAuctionPosition, OpeningAuctionPositionManager, type OpeningAuctionQuoteFromTokenAmountArgs, type OpeningAuctionQuoteFromTokenAmountResult, type OpeningAuctionSettlementData, type OpeningAuctionState, OpeningAuctionStatus, type OpeningAuctionWatchBidPlacedOptions, type OpeningAuctionWatchBidStatusOptions, type OpeningAuctionWatchBidWithdrawnOptions, type OpeningAuctionWatchEstimatedClearingTickOptions, type OpeningAuctionWatchIncentivesClaimedOptions, type OpeningAuctionWatchPhaseChangeOptions, type OpeningAuctionWatchSettlementOptions, type OpeningAuctionWithdrawFullBidArgs, type OpeningAuctionWithdrawFullBidResult, type OpeningAuctionWithdrawFullBidSimulationResult, type PoolInfo, Q96, type QuoteResult, Quoter, RehypeDopplerHook, type RehypeDopplerHookConfig, RehypeDopplerHookMigrator, type RehypeDopplerHookMigratorConfig, type RehypeFeeDistributionInfo, RehypeFeeRoutingMode, type ResolvedOpeningAuctionDopplerConfig, SECONDS_PER_DAY, SECONDS_PER_YEAR, SUPPORTED_CHAIN_IDS, type SaleConfig, _default as StateViewBytecode, StaticAuction, StaticAuctionBuilder, type StaticAuctionMarketCapConfig, type StaticPoolConfig, type SupportedChain, type SupportedChainId, type SupportedChainKey, type SupportedPublicClient, TICK_SPACINGS, type TokenAddressHookConfig, type TokenAddressMiningParams, type TokenAddressMiningResult, type TokenConfig, type TokenVariant, V3_FEE_TIERS, type V4PoolKey, V4_MAX_FEE, VALID_FEE_TIERS, VERSION, type VestingConfig, WAD, ZERO_ADDRESS, airlockAbi, applyTickOffsets, bundlerAbi, calculateFDV, calculateGamma, calculateMarketCap, calculateTickRange, calculateTokensToSell, computeOptimalGamma, computePoolId, createAirlockBeneficiary, decayMulticurveInitializerHookAbi, decodeBalanceDelta, derc20Abi, derc20V2Abi, dopplerHookAbi, dopplerHookInitializerAbi, dopplerLensAbi, encodeRehypeDopplerHookMigratorCalldata, estimatePriceAtEpoch, estimateSlippage, formatTickAsPrice, getAddresses, getAirlockBeneficiary, getAirlockOwner, getAmount0ForLiquidity, getAmount1ForLiquidity, getLiquidityForAmount0, getLiquidityForAmount1, getMaxTickRounded, getNearestUsableTick, getSqrtRatioAtTick, getTickAtSqrtRatio, isLaunchpadEnabledChain, isNoOpEnabledChain, isSupportedChainId, isToken0Expected, isToken1, lockableUniswapV3InitializerAbi, marketCapToTickForMulticurve, marketCapToTicksForDynamicAuction, marketCapToTicksForMulticurve, marketCapToTicksForStaticAuction, marketCapToTokenPrice, mineTokenAddress, normalizePoolKey, openingAuctionAbi, openingAuctionInitializerAbi, openingAuctionPositionManagerAbi, poolManagerAbi, priceToSqrtPriceX96, priceToTick, quoterV2Abi, ratioToTick, rehypeDopplerHookAbi, rehypeDopplerHookMigratorAbi, resolveGasEstimate, sqrtPriceX96ToPrice, streamableFeesLockerAbi, tickToMarketCap, tickToPrice, tokenPriceToRatio, uniswapV2Router02Abi, uniswapV3InitializerAbi, uniswapV3PoolAbi, uniswapV4InitializerAbi, v2MigratorAbi, v3MigratorAbi, v4MigratorAbi, v4MulticurveInitializerAbi, v4MulticurveMigratorAbi, v4QuoterAbi, validateMarketCapParameters, weth9Abi };
|
|
9180
|
+
export { ADDRESSES, BASIS_POINTS, type BaseAuctionBuilder, type BeneficiaryData, CHAIN_IDS, type ChainAddresses, type CreateDynamicAuctionParams, type CreateMulticurveParams, type CreateOpeningAuctionParams, type CreateParams, type CreateStaticAuctionParams, DAY_SECONDS, DEAD_ADDRESS, DECAY_MAX_START_FEE, DEFAULT_AIRLOCK_BENEFICIARY_SHARES, DEFAULT_AUCTION_DURATION, DEFAULT_EPOCH_LENGTH, DEFAULT_LOCK_DURATION, DEFAULT_MULTICURVE_LOWER_TICKS, DEFAULT_MULTICURVE_MAX_SUPPLY_SHARES, DEFAULT_MULTICURVE_NUM_POSITIONS, DEFAULT_MULTICURVE_UPPER_TICKS, DEFAULT_OPENING_AUCTION_DURATION, DEFAULT_OPENING_AUCTION_FEE, DEFAULT_OPENING_AUCTION_INCENTIVE_SHARE_BPS, DEFAULT_OPENING_AUCTION_MIN_ACCEPTABLE_TICK_TOKEN0, DEFAULT_OPENING_AUCTION_MIN_ACCEPTABLE_TICK_TOKEN1, DEFAULT_OPENING_AUCTION_MIN_LIQUIDITY, DEFAULT_OPENING_AUCTION_SHARE_TO_AUCTION_BPS, DEFAULT_OPENING_DOPPLER_DURATION, DEFAULT_OPENING_DOPPLER_EPOCH_LENGTH, DEFAULT_OPENING_DOPPLER_FEE, DEFAULT_OPENING_DOPPLER_NUM_PD_SLUGS, DEFAULT_OPENING_DOPPLER_TICK_SPACING, DEFAULT_PD_SLUGS, DEFAULT_V3_END_TICK, DEFAULT_V3_FEE, DEFAULT_V3_INITIAL_PROPOSAL_THRESHOLD, DEFAULT_V3_INITIAL_SUPPLY, DEFAULT_V3_INITIAL_VOTING_DELAY, DEFAULT_V3_INITIAL_VOTING_PERIOD, DEFAULT_V3_MAX_SHARE_TO_BE_SOLD, DEFAULT_V3_NUM_POSITIONS, DEFAULT_V3_NUM_TOKENS_TO_SELL, DEFAULT_V3_PRE_MINT, DEFAULT_V3_START_TICK, DEFAULT_V3_VESTING_DURATION, DEFAULT_V3_YEARLY_MINT_RATE, DEFAULT_V4_INITIAL_PROPOSAL_THRESHOLD, DEFAULT_V4_INITIAL_VOTING_DELAY, DEFAULT_V4_INITIAL_VOTING_PERIOD, DEFAULT_V4_YEARLY_MINT_RATE, _default$1 as DERC2080Bytecode, _default$2 as DERC20Bytecode, DOPPLER_FLAGS, DOPPLER_MAX_TICK_SPACING, DYNAMIC_FEE_FLAG, Derc20, Derc20V2, _default$5 as DopplerBytecode, _default$4 as DopplerDN404Bytecode, DopplerFactory, type DopplerHookMigrationConfig, DopplerSDK, type DopplerSDKConfig, DynamicAuction, DynamicAuctionBuilder, type DynamicAuctionConfig, type DynamicAuctionMarketCapConfig, type DynamicMarketCapRange, Eth, FEE_AMOUNT_MASK, FEE_TIERS, FLAG_MASK, type FeeTier, type GovernanceLaunchpad, type GovernanceOption, type HookInfo, INT24_MAX, INT24_MIN, LAUNCHPAD_ENABLED_CHAIN_IDS, type LaunchpadEnabledChainId, type LockablePoolState, LockablePoolStatus, type LockableV3InitializerParams, MAX_SQRT_RATIO, MAX_TICK, MIN_SQRT_RATIO, MIN_TICK, type MarketCapConfig, type MarketCapRange, type MarketCapValidationResult, type MigrationConfig, type MigrationEncoder, type ModuleAddressOverrides, MulticurveBuilder, type MulticurveBundleExactInResult, type MulticurveBundleExactOutResult, type MulticurveDecayFeeSchedule, type MulticurveInitializerConfig, type MulticurveMarketCapCurvesConfig, type MulticurveMarketCapPreset, type MulticurveMarketCapRangeCurve, MulticurvePool, type MulticurvePoolState, NO_OP_ENABLED_CHAIN_IDS, type NoOpEnabledChainId, OPENING_AUCTION_FLAGS, OPENING_AUCTION_PHASE_ACTIVE, OPENING_AUCTION_PHASE_CLOSED, OPENING_AUCTION_PHASE_NOT_STARTED, OPENING_AUCTION_PHASE_SETTLED, OPENING_AUCTION_STATUS_ACTIVE, OPENING_AUCTION_STATUS_DOPPLER_ACTIVE, OPENING_AUCTION_STATUS_EXITED, OPENING_AUCTION_STATUS_UNINITIALIZED, OpeningAuction, type OpeningAuctionAuctionSettledEvent, type OpeningAuctionBidArgs, type OpeningAuctionBidConstraints, type OpeningAuctionBidLookupArgs, OpeningAuctionBidManager, type OpeningAuctionBidManagerConfig, type OpeningAuctionBidPlacedEvent, type OpeningAuctionBidPositionInfo, type OpeningAuctionBidQuote, type OpeningAuctionBidSimulationResult, type OpeningAuctionBidStatus, type OpeningAuctionBidValidationResult, type OpeningAuctionBidWithdrawnEvent, OpeningAuctionBuilder, _default$3 as OpeningAuctionBytecode, type OpeningAuctionClaimAllIncentivesPreview, type OpeningAuctionClaimAllIncentivesResult, type OpeningAuctionClaimIncentivesSimulationResult, type OpeningAuctionCompleteResult, type OpeningAuctionConfig, type OpeningAuctionCreateResult, type OpeningAuctionDopplerConfig, type OpeningAuctionEstimatedClearingTickUpdatedEvent, type OpeningAuctionIncentiveData, type OpeningAuctionIncentivesClaimedEvent, OpeningAuctionLifecycle, type OpeningAuctionModifyLiquidityParams, type OpeningAuctionModifyLiquiditySimulationResult, type OpeningAuctionModuleAddressOverrides, type OpeningAuctionMoveBidArgs, type OpeningAuctionMoveBidResult, type OpeningAuctionMoveBidSimulationResult, type OpeningAuctionOwnerBidInfo, type OpeningAuctionOwnerBidStatus, OpeningAuctionPhase, type OpeningAuctionPhaseChangedEvent, type OpeningAuctionPosition, OpeningAuctionPositionManager, type OpeningAuctionQuoteFromTokenAmountArgs, type OpeningAuctionQuoteFromTokenAmountResult, type OpeningAuctionSettlementData, type OpeningAuctionState, OpeningAuctionStatus, type OpeningAuctionWatchBidPlacedOptions, type OpeningAuctionWatchBidStatusOptions, type OpeningAuctionWatchBidWithdrawnOptions, type OpeningAuctionWatchEstimatedClearingTickOptions, type OpeningAuctionWatchIncentivesClaimedOptions, type OpeningAuctionWatchPhaseChangeOptions, type OpeningAuctionWatchSettlementOptions, type OpeningAuctionWithdrawFullBidArgs, type OpeningAuctionWithdrawFullBidResult, type OpeningAuctionWithdrawFullBidSimulationResult, type PoolInfo, Q96, type QuoteResult, Quoter, RehypeDopplerHook, type RehypeDopplerHookConfig, RehypeDopplerHookMigrator, type RehypeDopplerHookMigratorConfig, type RehypeFeeDistributionInfo, RehypeFeeRoutingMode, type ResolvedOpeningAuctionDopplerConfig, SECONDS_PER_DAY, SECONDS_PER_YEAR, SUPPORTED_CHAIN_IDS, type SaleConfig, _default as StateViewBytecode, StaticAuction, StaticAuctionBuilder, type StaticAuctionMarketCapConfig, type StaticPoolConfig, type SupportedChain, type SupportedChainId, type SupportedChainKey, type SupportedPublicClient, TICK_SPACINGS, type TokenAddressHookConfig, type TokenAddressMiningParams, type TokenAddressMiningResult, type TokenConfig, type TokenVariant, V3_FEE_TIERS, type V4PoolKey, V4_MAX_FEE, VALID_FEE_TIERS, VERSION, type VestingAllocationConfig, type VestingConfig, type VestingScheduleConfig, WAD, ZERO_ADDRESS, airlockAbi, applyTickOffsets, bundlerAbi, calculateFDV, calculateGamma, calculateMarketCap, calculateTickRange, calculateTokensToSell, computeOptimalGamma, computePoolId, createAirlockBeneficiary, decayMulticurveInitializerHookAbi, decodeBalanceDelta, derc20Abi, derc20V2Abi, dopplerHookAbi, dopplerHookInitializerAbi, dopplerLensAbi, encodeRehypeDopplerHookMigratorCalldata, estimatePriceAtEpoch, estimateSlippage, formatTickAsPrice, getAddresses, getAirlockBeneficiary, getAirlockOwner, getAmount0ForLiquidity, getAmount1ForLiquidity, getLiquidityForAmount0, getLiquidityForAmount1, getMaxTickRounded, getNearestUsableTick, getSqrtRatioAtTick, getTickAtSqrtRatio, isLaunchpadEnabledChain, isNoOpEnabledChain, isSupportedChainId, isToken0Expected, isToken1, lockableUniswapV3InitializerAbi, marketCapToTickForMulticurve, marketCapToTicksForDynamicAuction, marketCapToTicksForMulticurve, marketCapToTicksForStaticAuction, marketCapToTokenPrice, mineTokenAddress, normalizePoolKey, openingAuctionAbi, openingAuctionInitializerAbi, openingAuctionPositionManagerAbi, poolManagerAbi, priceToSqrtPriceX96, priceToTick, quoterV2Abi, ratioToTick, rehypeDopplerHookAbi, rehypeDopplerHookMigratorAbi, resolveGasEstimate, sqrtPriceX96ToPrice, streamableFeesLockerAbi, tickToMarketCap, tickToPrice, tokenPriceToRatio, uniswapV2Router02Abi, uniswapV3InitializerAbi, uniswapV3PoolAbi, uniswapV4InitializerAbi, v2MigratorAbi, v3MigratorAbi, v4MigratorAbi, v4MulticurveInitializerAbi, v4MulticurveMigratorAbi, v4QuoterAbi, validateMarketCapParameters, weth9Abi };
|
package/dist/evm/index.js
CHANGED
|
@@ -5280,6 +5280,7 @@ var erc20BalanceOfAbi = [
|
|
|
5280
5280
|
];
|
|
5281
5281
|
var TOKEN_FACTORY_80_ADDRESS2 = "0xf0b5141dd9096254b2ca624dff26024f46087229";
|
|
5282
5282
|
var DERC20_V2_MIN_VESTING_DURATION = 24 * 60 * 60;
|
|
5283
|
+
var MAX_UINT64 = (1n << 64n) - 1n;
|
|
5283
5284
|
var DopplerFactory = class {
|
|
5284
5285
|
publicClient;
|
|
5285
5286
|
walletClient;
|
|
@@ -5291,13 +5292,29 @@ var DopplerFactory = class {
|
|
|
5291
5292
|
this.walletClient = walletClient;
|
|
5292
5293
|
this.chainId = chainId;
|
|
5293
5294
|
}
|
|
5295
|
+
hasCustomV2Schedules(vesting) {
|
|
5296
|
+
return (vesting?.allocations?.length ?? 0) > 0;
|
|
5297
|
+
}
|
|
5294
5298
|
usesDerc20V2Vesting(vesting) {
|
|
5295
|
-
|
|
5299
|
+
if (!vesting) {
|
|
5300
|
+
return false;
|
|
5301
|
+
}
|
|
5302
|
+
return this.hasCustomV2Schedules(vesting) || (vesting.cliffDuration ?? 0) > 0;
|
|
5296
5303
|
}
|
|
5297
5304
|
resolveVestingAllocations(args) {
|
|
5298
5305
|
if (!args.vesting) {
|
|
5299
5306
|
return { recipients: [], amounts: [] };
|
|
5300
5307
|
}
|
|
5308
|
+
if (args.vesting.allocations) {
|
|
5309
|
+
return {
|
|
5310
|
+
recipients: args.vesting.allocations.map(
|
|
5311
|
+
(allocation) => allocation.recipient
|
|
5312
|
+
),
|
|
5313
|
+
amounts: args.vesting.allocations.map(
|
|
5314
|
+
(allocation) => allocation.amount
|
|
5315
|
+
)
|
|
5316
|
+
};
|
|
5317
|
+
}
|
|
5301
5318
|
if (args.vesting.recipients && args.vesting.amounts) {
|
|
5302
5319
|
return {
|
|
5303
5320
|
recipients: args.vesting.recipients,
|
|
@@ -5309,6 +5326,56 @@ var DopplerFactory = class {
|
|
|
5309
5326
|
amounts: [args.sale.initialSupply - args.sale.numTokensToSell]
|
|
5310
5327
|
};
|
|
5311
5328
|
}
|
|
5329
|
+
validateUint64LikeNumber(value, fieldPath, options = {}) {
|
|
5330
|
+
const { allowZero = true } = options;
|
|
5331
|
+
if (!Number.isFinite(value) || !Number.isInteger(value)) {
|
|
5332
|
+
throw new Error(`${fieldPath} must be a finite integer`);
|
|
5333
|
+
}
|
|
5334
|
+
if (!Number.isSafeInteger(value)) {
|
|
5335
|
+
throw new Error(`${fieldPath} must be a safe integer`);
|
|
5336
|
+
}
|
|
5337
|
+
if (value < 0) {
|
|
5338
|
+
throw new Error(`${fieldPath} cannot be negative`);
|
|
5339
|
+
}
|
|
5340
|
+
if (!allowZero && value === 0) {
|
|
5341
|
+
throw new Error(`${fieldPath} must be greater than zero`);
|
|
5342
|
+
}
|
|
5343
|
+
if (BigInt(value) > MAX_UINT64) {
|
|
5344
|
+
throw new Error(`${fieldPath} must fit in uint64`);
|
|
5345
|
+
}
|
|
5346
|
+
}
|
|
5347
|
+
resolveV2VestingSchedules(args) {
|
|
5348
|
+
if (!args.vesting) {
|
|
5349
|
+
return { schedules: [], scheduleIds: [] };
|
|
5350
|
+
}
|
|
5351
|
+
if (!this.hasCustomV2Schedules(args.vesting)) {
|
|
5352
|
+
return {
|
|
5353
|
+
schedules: [
|
|
5354
|
+
{
|
|
5355
|
+
cliff: BigInt(args.vesting.cliffDuration ?? 0),
|
|
5356
|
+
duration: BigInt(args.vesting.duration ?? 0)
|
|
5357
|
+
}
|
|
5358
|
+
],
|
|
5359
|
+
scheduleIds: Array.from({ length: args.recipientCount }, () => 0n)
|
|
5360
|
+
};
|
|
5361
|
+
}
|
|
5362
|
+
const schedules = [];
|
|
5363
|
+
const scheduleIds = [];
|
|
5364
|
+
const scheduleIdsByKey = /* @__PURE__ */ new Map();
|
|
5365
|
+
for (const allocation of args.vesting.allocations ?? []) {
|
|
5366
|
+
const cliff = BigInt(allocation.schedule.cliffDuration ?? 0);
|
|
5367
|
+
const duration = BigInt(allocation.schedule.duration ?? 0);
|
|
5368
|
+
const key = `${cliff}:${duration}`;
|
|
5369
|
+
let scheduleId = scheduleIdsByKey.get(key);
|
|
5370
|
+
if (scheduleId === void 0) {
|
|
5371
|
+
scheduleId = BigInt(schedules.length);
|
|
5372
|
+
schedules.push({ cliff, duration });
|
|
5373
|
+
scheduleIdsByKey.set(key, scheduleId);
|
|
5374
|
+
}
|
|
5375
|
+
scheduleIds.push(scheduleId);
|
|
5376
|
+
}
|
|
5377
|
+
return { schedules, scheduleIds };
|
|
5378
|
+
}
|
|
5312
5379
|
resolveStandardTokenFactoryMode(args) {
|
|
5313
5380
|
if (this.usesDerc20V2Vesting(args.vesting)) {
|
|
5314
5381
|
return "v2";
|
|
@@ -5350,12 +5417,10 @@ var DopplerFactory = class {
|
|
|
5350
5417
|
"DERC20 V2 implementation address not configured for this chain."
|
|
5351
5418
|
);
|
|
5352
5419
|
}
|
|
5353
|
-
const schedules =
|
|
5354
|
-
|
|
5355
|
-
|
|
5356
|
-
|
|
5357
|
-
}
|
|
5358
|
-
];
|
|
5420
|
+
const { schedules, scheduleIds } = this.resolveV2VestingSchedules({
|
|
5421
|
+
vesting: args.vesting,
|
|
5422
|
+
recipientCount: recipients.length
|
|
5423
|
+
});
|
|
5359
5424
|
return {
|
|
5360
5425
|
kind: "v2",
|
|
5361
5426
|
name: args.token.name,
|
|
@@ -5365,7 +5430,7 @@ var DopplerFactory = class {
|
|
|
5365
5430
|
yearlyMintRate,
|
|
5366
5431
|
schedules,
|
|
5367
5432
|
beneficiaries: recipients,
|
|
5368
|
-
scheduleIds
|
|
5433
|
+
scheduleIds,
|
|
5369
5434
|
amounts,
|
|
5370
5435
|
tokenURI: args.token.tokenURI,
|
|
5371
5436
|
implementation
|
|
@@ -8152,19 +8217,49 @@ var DopplerFactory = class {
|
|
|
8152
8217
|
}
|
|
8153
8218
|
const cliffDuration = vesting.cliffDuration ?? 0;
|
|
8154
8219
|
const duration = vesting.duration ?? 0;
|
|
8155
|
-
|
|
8156
|
-
|
|
8157
|
-
}
|
|
8158
|
-
if (duration < 0) {
|
|
8159
|
-
throw new Error("Vesting duration cannot be negative");
|
|
8160
|
-
}
|
|
8161
|
-
if (cliffDuration > duration) {
|
|
8162
|
-
throw new Error("Vesting cliff duration cannot exceed vesting duration");
|
|
8163
|
-
}
|
|
8164
|
-
if (cliffDuration > 0 && duration > 0 && duration < DERC20_V2_MIN_VESTING_DURATION) {
|
|
8220
|
+
const hasCustomSchedules = this.hasCustomV2Schedules(vesting);
|
|
8221
|
+
if (hasCustomSchedules && (cliffDuration > 0 || duration > 0 || vesting.recipients !== void 0 || vesting.amounts !== void 0)) {
|
|
8165
8222
|
throw new Error(
|
|
8166
|
-
|
|
8223
|
+
"Use vesting.allocations instead of top-level duration/cliffDuration/recipients/amounts when configuring per-beneficiary vesting"
|
|
8224
|
+
);
|
|
8225
|
+
}
|
|
8226
|
+
const availableForVesting = sale.initialSupply - sale.numTokensToSell;
|
|
8227
|
+
if (vesting.allocations) {
|
|
8228
|
+
if (vesting.allocations.length === 0) {
|
|
8229
|
+
throw new Error("Vesting allocations array cannot be empty");
|
|
8230
|
+
}
|
|
8231
|
+
const totalVested = vesting.allocations.reduce(
|
|
8232
|
+
(sum, allocation) => sum + allocation.amount,
|
|
8233
|
+
0n
|
|
8167
8234
|
);
|
|
8235
|
+
if (totalVested > availableForVesting) {
|
|
8236
|
+
throw new Error(
|
|
8237
|
+
`Total vesting amount (${totalVested}) exceeds available tokens (${availableForVesting})`
|
|
8238
|
+
);
|
|
8239
|
+
}
|
|
8240
|
+
for (const [index, allocation] of vesting.allocations.entries()) {
|
|
8241
|
+
const scheduleCliff = allocation.schedule.cliffDuration ?? 0;
|
|
8242
|
+
const scheduleDuration = allocation.schedule.duration ?? 0;
|
|
8243
|
+
this.validateUint64LikeNumber(
|
|
8244
|
+
scheduleCliff,
|
|
8245
|
+
`Vesting allocations[${index}].schedule.cliffDuration`
|
|
8246
|
+
);
|
|
8247
|
+
this.validateUint64LikeNumber(
|
|
8248
|
+
scheduleDuration,
|
|
8249
|
+
`Vesting allocations[${index}].schedule.duration`
|
|
8250
|
+
);
|
|
8251
|
+
if (scheduleCliff > scheduleDuration) {
|
|
8252
|
+
throw new Error(
|
|
8253
|
+
`Vesting allocations[${index}].schedule.cliffDuration cannot exceed duration`
|
|
8254
|
+
);
|
|
8255
|
+
}
|
|
8256
|
+
if (scheduleCliff > 0 && scheduleDuration > 0 && scheduleDuration < DERC20_V2_MIN_VESTING_DURATION) {
|
|
8257
|
+
throw new Error(
|
|
8258
|
+
`Vesting allocations[${index}].schedule.duration must be 0 or at least ${DERC20_V2_MIN_VESTING_DURATION} seconds when using cliffs`
|
|
8259
|
+
);
|
|
8260
|
+
}
|
|
8261
|
+
}
|
|
8262
|
+
return;
|
|
8168
8263
|
}
|
|
8169
8264
|
if (vesting.recipients && vesting.amounts) {
|
|
8170
8265
|
if (vesting.recipients.length !== vesting.amounts.length) {
|
|
@@ -8176,17 +8271,30 @@ var DopplerFactory = class {
|
|
|
8176
8271
|
throw new Error("Vesting recipients array cannot be empty");
|
|
8177
8272
|
}
|
|
8178
8273
|
const totalVested = vesting.amounts.reduce((sum, amt) => sum + amt, 0n);
|
|
8179
|
-
const availableForVesting = sale.initialSupply - sale.numTokensToSell;
|
|
8180
8274
|
if (totalVested > availableForVesting) {
|
|
8181
8275
|
throw new Error(
|
|
8182
8276
|
`Total vesting amount (${totalVested}) exceeds available tokens (${availableForVesting})`
|
|
8183
8277
|
);
|
|
8184
8278
|
}
|
|
8185
|
-
|
|
8279
|
+
} else {
|
|
8280
|
+
const vestedAmount = sale.initialSupply - sale.numTokensToSell;
|
|
8281
|
+
if (vestedAmount <= 0n) {
|
|
8282
|
+
throw new Error("No tokens available for vesting");
|
|
8283
|
+
}
|
|
8186
8284
|
}
|
|
8187
|
-
|
|
8188
|
-
|
|
8189
|
-
|
|
8285
|
+
if (cliffDuration < 0) {
|
|
8286
|
+
throw new Error("Vesting cliff duration cannot be negative");
|
|
8287
|
+
}
|
|
8288
|
+
if (duration < 0) {
|
|
8289
|
+
throw new Error("Vesting duration cannot be negative");
|
|
8290
|
+
}
|
|
8291
|
+
if (cliffDuration > duration) {
|
|
8292
|
+
throw new Error("Vesting cliff duration cannot exceed vesting duration");
|
|
8293
|
+
}
|
|
8294
|
+
if (cliffDuration > 0 && duration > 0 && duration < DERC20_V2_MIN_VESTING_DURATION) {
|
|
8295
|
+
throw new Error(
|
|
8296
|
+
`Vesting duration must be 0 or at least ${DERC20_V2_MIN_VESTING_DURATION} seconds when using cliffs`
|
|
8297
|
+
);
|
|
8190
8298
|
}
|
|
8191
8299
|
}
|
|
8192
8300
|
validateStaticAuctionParams(params) {
|
|
@@ -8227,7 +8335,6 @@ var DopplerFactory = class {
|
|
|
8227
8335
|
throw new Error("Cannot sell more tokens than initial supply");
|
|
8228
8336
|
}
|
|
8229
8337
|
this.validateVestingConfig(params.sale, params.vesting);
|
|
8230
|
-
this.validateVestingConfig(params.sale, params.vesting);
|
|
8231
8338
|
if (params.migration.type === "dopplerHook") {
|
|
8232
8339
|
throw new Error(
|
|
8233
8340
|
"dopplerHook migration is only supported for dynamic auctions"
|
|
@@ -13422,6 +13529,26 @@ var Eth = class {
|
|
|
13422
13529
|
};
|
|
13423
13530
|
|
|
13424
13531
|
// src/evm/builders/shared.ts
|
|
13532
|
+
var MAX_SAFE_INTEGER_BIGINT = BigInt(Number.MAX_SAFE_INTEGER);
|
|
13533
|
+
function normalizeBuilderVestingScheduleDuration(value, fieldPath) {
|
|
13534
|
+
const duration = value ?? 0n;
|
|
13535
|
+
if (duration < 0n) {
|
|
13536
|
+
throw new RangeError(`${fieldPath} cannot be negative`);
|
|
13537
|
+
}
|
|
13538
|
+
if (duration > MAX_SAFE_INTEGER_BIGINT) {
|
|
13539
|
+
throw new RangeError(`${fieldPath} must be a safe integer`);
|
|
13540
|
+
}
|
|
13541
|
+
return Number(duration);
|
|
13542
|
+
}
|
|
13543
|
+
function normalizeBuilderVestingSchedule(schedule, fieldPath) {
|
|
13544
|
+
return {
|
|
13545
|
+
duration: normalizeBuilderVestingScheduleDuration(
|
|
13546
|
+
schedule.duration,
|
|
13547
|
+
`${fieldPath}.duration`
|
|
13548
|
+
),
|
|
13549
|
+
cliffDuration: schedule.cliffDuration ?? 0
|
|
13550
|
+
};
|
|
13551
|
+
}
|
|
13425
13552
|
function computeTicks(priceRange, tickSpacing) {
|
|
13426
13553
|
const startTick = Math.floor(
|
|
13427
13554
|
Math.log(priceRange.startPrice) / Math.log(1.0001) / tickSpacing
|
|
@@ -13717,6 +13844,19 @@ var StaticAuctionBuilder = class _StaticAuctionBuilder {
|
|
|
13717
13844
|
this.vesting = void 0;
|
|
13718
13845
|
return this;
|
|
13719
13846
|
}
|
|
13847
|
+
if (params.allocations) {
|
|
13848
|
+
this.vesting = {
|
|
13849
|
+
allocations: params.allocations.map((allocation, index) => ({
|
|
13850
|
+
recipient: allocation.recipient,
|
|
13851
|
+
amount: allocation.amount,
|
|
13852
|
+
schedule: normalizeBuilderVestingSchedule(
|
|
13853
|
+
allocation.schedule,
|
|
13854
|
+
`Vesting allocations[${index}].schedule`
|
|
13855
|
+
)
|
|
13856
|
+
}))
|
|
13857
|
+
};
|
|
13858
|
+
return this;
|
|
13859
|
+
}
|
|
13720
13860
|
this.vesting = {
|
|
13721
13861
|
duration: Number(params.duration ?? DEFAULT_V3_VESTING_DURATION),
|
|
13722
13862
|
cliffDuration: params.cliffDuration ?? 0,
|
|
@@ -14049,6 +14189,19 @@ var DynamicAuctionBuilder = class _DynamicAuctionBuilder {
|
|
|
14049
14189
|
this.vesting = void 0;
|
|
14050
14190
|
return this;
|
|
14051
14191
|
}
|
|
14192
|
+
if (params.allocations) {
|
|
14193
|
+
this.vesting = {
|
|
14194
|
+
allocations: params.allocations.map((allocation, index) => ({
|
|
14195
|
+
recipient: allocation.recipient,
|
|
14196
|
+
amount: allocation.amount,
|
|
14197
|
+
schedule: normalizeBuilderVestingSchedule(
|
|
14198
|
+
allocation.schedule,
|
|
14199
|
+
`Vesting allocations[${index}].schedule`
|
|
14200
|
+
)
|
|
14201
|
+
}))
|
|
14202
|
+
};
|
|
14203
|
+
return this;
|
|
14204
|
+
}
|
|
14052
14205
|
this.vesting = {
|
|
14053
14206
|
duration: Number(params.duration ?? 0n),
|
|
14054
14207
|
cliffDuration: params.cliffDuration ?? 0,
|
|
@@ -14655,6 +14808,19 @@ var MulticurveBuilder = class _MulticurveBuilder {
|
|
|
14655
14808
|
this.vesting = void 0;
|
|
14656
14809
|
return this;
|
|
14657
14810
|
}
|
|
14811
|
+
if (params.allocations) {
|
|
14812
|
+
this.vesting = {
|
|
14813
|
+
allocations: params.allocations.map((allocation, index) => ({
|
|
14814
|
+
recipient: allocation.recipient,
|
|
14815
|
+
amount: allocation.amount,
|
|
14816
|
+
schedule: normalizeBuilderVestingSchedule(
|
|
14817
|
+
allocation.schedule,
|
|
14818
|
+
`Vesting allocations[${index}].schedule`
|
|
14819
|
+
)
|
|
14820
|
+
}))
|
|
14821
|
+
};
|
|
14822
|
+
return this;
|
|
14823
|
+
}
|
|
14658
14824
|
this.vesting = {
|
|
14659
14825
|
duration: Number(params.duration ?? 0n),
|
|
14660
14826
|
cliffDuration: params.cliffDuration ?? 0,
|
|
@@ -15044,6 +15210,19 @@ var OpeningAuctionBuilder = class _OpeningAuctionBuilder {
|
|
|
15044
15210
|
this.vesting = void 0;
|
|
15045
15211
|
return this;
|
|
15046
15212
|
}
|
|
15213
|
+
if (params.allocations) {
|
|
15214
|
+
this.vesting = {
|
|
15215
|
+
allocations: params.allocations.map((allocation, index) => ({
|
|
15216
|
+
recipient: allocation.recipient,
|
|
15217
|
+
amount: allocation.amount,
|
|
15218
|
+
schedule: normalizeBuilderVestingSchedule(
|
|
15219
|
+
allocation.schedule,
|
|
15220
|
+
`Vesting allocations[${index}].schedule`
|
|
15221
|
+
)
|
|
15222
|
+
}))
|
|
15223
|
+
};
|
|
15224
|
+
return this;
|
|
15225
|
+
}
|
|
15047
15226
|
this.vesting = {
|
|
15048
15227
|
duration: Number(params.duration ?? 0n),
|
|
15049
15228
|
cliffDuration: params.cliffDuration ?? 0,
|