@whetstone-research/doppler-sdk 1.0.6 → 1.0.8

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/dist/evm/index.js CHANGED
@@ -17,10 +17,10 @@ var GENERATED_DOPPLER_DEPLOYMENTS = {
17
17
  GovernanceFactory: "0x9F309D79BEe3E8b2f56FaCF74b7195Df176c8F61",
18
18
  NoOpGovernanceFactory: "0xddAE8B3eD08184682f7Bc32B74d943cEEfEab638",
19
19
  NoOpMigrator: "0x233A71A7bB928b1357A1Ebf454298320989Ca5B5",
20
- Quoter: "0xB524401A6655A6176ba8aBD8FA3d4a547e1D0424",
20
+ Quoter: "0xFD44B773B21AC485C95Db1Ff38554b7699f8C042",
21
21
  RehypeDopplerHook: "0x3Ec4798A9B11e8243A8Db99687f7A23597B96623",
22
- RehypeDopplerHookInitializer: "0x6AB5aE3191c914dE8437431091776Fc90f314bE4",
23
- RehypeDopplerHookMigrator: "0x82d5E22911fbbCB8d3e45812d74eE6203c5824e0",
22
+ RehypeDopplerHookInitializer: "0xBF4195ab0B03e1eB3345dd1e83BeD7650b1ed123",
23
+ RehypeDopplerHookMigrator: "0xea95DfdF69B90c65C827070852F7039D6aF6Dd7b",
24
24
  StreamableFeesLocker: "0xe24FC2F7191e850e2D4514aBb4d39305b1871eC6",
25
25
  StreamableFeesLockerV2: "0xcE3212e6536F33cD6fbFEE265224131353Ca3D47",
26
26
  TimelockFactory: "0x9fd40af2baAfAF03513f091444e821c0d5b06ea0",
@@ -136,12 +136,12 @@ var GENERATED_DOPPLER_DEPLOYMENTS = {
136
136
  GovernanceFactory: "0xa82c66b6ddEb92089015C3565E05B5c9750b2d4B",
137
137
  LaunchpadGovernanceFactory: "0x40Bcb4dDA3BcF7dba30C5d10c31EE2791ed9ddCa",
138
138
  LockableUniswapV3Initializer: "0xE0dC4012AC9C868F09c6e4b20d66ED46D6F258d0",
139
- NoOpGovernanceFactory: "0x3AD727ee0FBBb8Ee0920933FdB96F23fD56f1299",
139
+ NoOpGovernanceFactory: "0xe7dfbd5b0A2C3B4464653A9beCdc489229eF090E",
140
140
  NoOpMigrator: "0x6ddfED58D238Ca3195E49d8ac3d4cEa6386E5C33",
141
- Quoter: "0xB524401A6655A6176ba8aBD8FA3d4a547e1D0424",
141
+ Quoter: "0xFD44B773B21AC485C95Db1Ff38554b7699f8C042",
142
142
  RehypeDopplerHook: "0x3Ec4798A9B11e8243A8Db99687f7A23597B96623",
143
- RehypeDopplerHookInitializer: "0x6AB5aE3191c914dE8437431091776Fc90f314bE4",
144
- RehypeDopplerHookMigrator: "0x82d5E22911fbbCB8d3e45812d74eE6203c5824e0",
143
+ RehypeDopplerHookInitializer: "0xBF4195ab0B03e1eB3345dd1e83BeD7650b1ed123",
144
+ RehypeDopplerHookMigrator: "0xea95DfdF69B90c65C827070852F7039D6aF6Dd7b",
145
145
  StreamableFeesLocker: "0x0A00775D71a42cd33D62780003035e7F5b47bD3A",
146
146
  StreamableFeesLockerV2: "0xcE3212e6536F33cD6fbFEE265224131353Ca3D47",
147
147
  TokenFactory: "0x4225C632b62622Bd7B0A3eC9745C0a866Ff94F6F",
@@ -210,14 +210,15 @@ var GENERATED_DOPPLER_DEPLOYMENTS = {
210
210
  DopplerHookMigrator: "0x1E40b0875DDa35f41E15cFB475403859B8c860c4",
211
211
  DopplerLensQuoter: "0x4a8d81Db741248a36D9eb3bc6eF648Bf798B47a7",
212
212
  GovernanceFactory: "0x9dBFaaDC8c0cB2c34bA698DD9426555336992e20",
213
+ LaunchpadGovernanceFactory: "0x0902e7C7207df8ed6303Aef4382bcab181b5fBFA",
213
214
  LockableUniswapV3Initializer: "0x16AdA5Be50C3c2D94Af5fEae6b539C40A78Ad53c",
214
215
  MulticurveLibrary: "0x32238a39ba5aF060EFbfAda59979B639E0945fE0",
215
216
  NoOpGovernanceFactory: "0x7bD798fafC99A3b17E261F8308A8C11B56935ea1",
216
217
  NoOpMigrator: "0xF11066abbd329ac4bBA39455340539322C222eb0",
217
- Quoter: "0xB524401A6655A6176ba8aBD8FA3d4a547e1D0424",
218
+ Quoter: "0xFD44B773B21AC485C95Db1Ff38554b7699f8C042",
218
219
  RehypeDopplerHook: "0x3Ec4798A9B11e8243A8Db99687f7A23597B96623",
219
- RehypeDopplerHookInitializer: "0x6AB5aE3191c914dE8437431091776Fc90f314bE4",
220
- RehypeDopplerHookMigrator: "0x82d5E22911fbbCB8d3e45812d74eE6203c5824e0",
220
+ RehypeDopplerHookInitializer: "0xBF4195ab0B03e1eB3345dd1e83BeD7650b1ed123",
221
+ RehypeDopplerHookMigrator: "0xea95DfdF69B90c65C827070852F7039D6aF6Dd7b",
221
222
  StreamableFeesLocker: "0x3345E557c5C0b474bE1eb4693264008B8562Aa9c",
222
223
  TeamGovernanceFactory: "0x8aF3001ED75F86f4Dd910577ECa9C5dB7CEa765c",
223
224
  TokenFactory: "0x9D8fd79B2a59c5d91ccBd79c3AEb4de56451Bb02",
@@ -255,10 +256,10 @@ var GENERATED_DOPPLER_DEPLOYMENTS = {
255
256
  GovernanceFactory: "0x9F309D79BEe3E8b2f56FaCF74b7195Df176c8F61",
256
257
  NoOpGovernanceFactory: "0xddAE8B3eD08184682f7Bc32B74d943cEEfEab638",
257
258
  NoOpMigrator: "0x233A71A7bB928b1357A1Ebf454298320989Ca5B5",
258
- Quoter: "0xB524401A6655A6176ba8aBD8FA3d4a547e1D0424",
259
+ Quoter: "0xFD44B773B21AC485C95Db1Ff38554b7699f8C042",
259
260
  RehypeDopplerHook: "0x3Ec4798A9B11e8243A8Db99687f7A23597B96623",
260
- RehypeDopplerHookInitializer: "0x6AB5aE3191c914dE8437431091776Fc90f314bE4",
261
- RehypeDopplerHookMigrator: "0x82d5E22911fbbCB8d3e45812d74eE6203c5824e0",
261
+ RehypeDopplerHookInitializer: "0xBF4195ab0B03e1eB3345dd1e83BeD7650b1ed123",
262
+ RehypeDopplerHookMigrator: "0xea95DfdF69B90c65C827070852F7039D6aF6Dd7b",
262
263
  StreamableFeesLocker: "0xe24FC2F7191e850e2D4514aBb4d39305b1871eC6",
263
264
  StreamableFeesLockerV2: "0xcE3212e6536F33cD6fbFEE265224131353Ca3D47",
264
265
  TimelockFactory: "0x9fd40af2baAfAF03513f091444e821c0d5b06ea0",
@@ -408,7 +409,7 @@ var ADDRESSES = {
408
409
  rehypeDopplerHookMigrator: GENERATED_DOPPLER_DEPLOYMENTS[CHAIN_IDS.BASE].RehypeDopplerHookMigrator,
409
410
  noOpMigrator: GENERATED_DOPPLER_DEPLOYMENTS[CHAIN_IDS.BASE].NoOpMigrator,
410
411
  governanceFactory: "0xb4deE32EB70A5E55f3D2d861F49Fb3D79f7a14d9",
411
- noOpGovernanceFactory: "0xe7dfbd5b0a2c3b4464653a9becdc489229ef090e",
412
+ noOpGovernanceFactory: GENERATED_DOPPLER_DEPLOYMENTS[CHAIN_IDS.BASE].NoOpGovernanceFactory,
412
413
  launchpadGovernanceFactory: GENERATED_DOPPLER_DEPLOYMENTS[CHAIN_IDS.BASE].LaunchpadGovernanceFactory,
413
414
  streamableFeesLocker: GENERATED_DOPPLER_DEPLOYMENTS[CHAIN_IDS.BASE].StreamableFeesLocker,
414
415
  universalRouter: "0x6ff5693b99212da76ad316178a184ab56d299b43",
@@ -5293,7 +5294,7 @@ var DopplerFactory = class {
5293
5294
  this.chainId = chainId;
5294
5295
  }
5295
5296
  hasCustomV2Schedules(vesting) {
5296
- return (vesting?.schedules?.length ?? 0) > 0 || (vesting?.scheduleIds?.length ?? 0) > 0;
5297
+ return (vesting?.allocations?.length ?? 0) > 0;
5297
5298
  }
5298
5299
  usesDerc20V2Vesting(vesting) {
5299
5300
  if (!vesting) {
@@ -5305,6 +5306,16 @@ var DopplerFactory = class {
5305
5306
  if (!args.vesting) {
5306
5307
  return { recipients: [], amounts: [] };
5307
5308
  }
5309
+ if (args.vesting.allocations) {
5310
+ return {
5311
+ recipients: args.vesting.allocations.map(
5312
+ (allocation) => allocation.recipient
5313
+ ),
5314
+ amounts: args.vesting.allocations.map(
5315
+ (allocation) => allocation.amount
5316
+ )
5317
+ };
5318
+ }
5308
5319
  if (args.vesting.recipients && args.vesting.amounts) {
5309
5320
  return {
5310
5321
  recipients: args.vesting.recipients,
@@ -5316,18 +5327,6 @@ var DopplerFactory = class {
5316
5327
  amounts: [args.sale.initialSupply - args.sale.numTokensToSell]
5317
5328
  };
5318
5329
  }
5319
- normalizeV2ScheduleId(scheduleId, label) {
5320
- if (!Number.isFinite(scheduleId) || !Number.isInteger(scheduleId)) {
5321
- throw new Error(`${label} must be an integer`);
5322
- }
5323
- if (!Number.isSafeInteger(scheduleId)) {
5324
- throw new Error(`${label} must be a safe integer`);
5325
- }
5326
- if (scheduleId < 0) {
5327
- throw new Error(`${label} cannot be negative`);
5328
- }
5329
- return BigInt(scheduleId);
5330
- }
5331
5330
  validateUint64LikeNumber(value, fieldPath, options = {}) {
5332
5331
  const { allowZero = true } = options;
5333
5332
  if (!Number.isFinite(value) || !Number.isInteger(value)) {
@@ -5361,37 +5360,22 @@ var DopplerFactory = class {
5361
5360
  scheduleIds: Array.from({ length: args.recipientCount }, () => 0n)
5362
5361
  };
5363
5362
  }
5364
- const schedules = args.vesting.schedules?.map((schedule) => ({
5365
- cliff: BigInt(schedule.cliffDuration ?? 0),
5366
- duration: BigInt(schedule.duration ?? 0)
5367
- })) ?? [];
5368
- const explicitScheduleIds = args.vesting.scheduleIds;
5369
- if (explicitScheduleIds && explicitScheduleIds.length > 0) {
5370
- return {
5371
- schedules,
5372
- scheduleIds: explicitScheduleIds.map(
5373
- (scheduleId, index) => this.normalizeV2ScheduleId(
5374
- scheduleId,
5375
- `Vesting scheduleIds[${index}]`
5376
- )
5377
- )
5378
- };
5379
- }
5380
- if (schedules.length === 1) {
5381
- return {
5382
- schedules,
5383
- scheduleIds: Array.from({ length: args.recipientCount }, () => 0n)
5384
- };
5385
- }
5386
- if (schedules.length === args.recipientCount) {
5387
- return {
5388
- schedules,
5389
- scheduleIds: schedules.map((_, index) => BigInt(index))
5390
- };
5363
+ const schedules = [];
5364
+ const scheduleIds = [];
5365
+ const scheduleIdsByKey = /* @__PURE__ */ new Map();
5366
+ for (const allocation of args.vesting.allocations ?? []) {
5367
+ const cliff = BigInt(allocation.schedule.cliffDuration ?? 0);
5368
+ const duration = BigInt(allocation.schedule.duration ?? 0);
5369
+ const key = `${cliff}:${duration}`;
5370
+ let scheduleId = scheduleIdsByKey.get(key);
5371
+ if (scheduleId === void 0) {
5372
+ scheduleId = BigInt(schedules.length);
5373
+ schedules.push({ cliff, duration });
5374
+ scheduleIdsByKey.set(key, scheduleId);
5375
+ }
5376
+ scheduleIds.push(scheduleId);
5391
5377
  }
5392
- throw new Error(
5393
- "Vesting schedules must either contain exactly one shared schedule or one schedule per recipient when scheduleIds are omitted"
5394
- );
5378
+ return { schedules, scheduleIds };
5395
5379
  }
5396
5380
  resolveStandardTokenFactoryMode(args) {
5397
5381
  if (this.usesDerc20V2Vesting(args.vesting)) {
@@ -8235,87 +8219,70 @@ var DopplerFactory = class {
8235
8219
  const cliffDuration = vesting.cliffDuration ?? 0;
8236
8220
  const duration = vesting.duration ?? 0;
8237
8221
  const hasCustomSchedules = this.hasCustomV2Schedules(vesting);
8238
- if (hasCustomSchedules && (cliffDuration > 0 || duration > 0)) {
8222
+ if (hasCustomSchedules && (cliffDuration > 0 || duration > 0 || vesting.recipients !== void 0 || vesting.amounts !== void 0)) {
8239
8223
  throw new Error(
8240
- "Use vesting.schedules instead of top-level duration/cliffDuration when configuring multiple vesting schedules"
8224
+ "Use vesting.allocations instead of top-level duration/cliffDuration/recipients/amounts when configuring per-beneficiary vesting"
8241
8225
  );
8242
8226
  }
8243
- if (vesting.recipients && vesting.amounts) {
8244
- if (vesting.recipients.length !== vesting.amounts.length) {
8245
- throw new Error(
8246
- "Vesting recipients and amounts arrays must have the same length"
8247
- );
8227
+ const availableForVesting = sale.initialSupply - sale.numTokensToSell;
8228
+ if (vesting.allocations) {
8229
+ if (vesting.allocations.length === 0) {
8230
+ throw new Error("Vesting allocations array cannot be empty");
8248
8231
  }
8249
- if (vesting.recipients.length === 0) {
8250
- throw new Error("Vesting recipients array cannot be empty");
8251
- }
8252
- const totalVested = vesting.amounts.reduce((sum, amt) => sum + amt, 0n);
8253
- const availableForVesting = sale.initialSupply - sale.numTokensToSell;
8232
+ const totalVested = vesting.allocations.reduce(
8233
+ (sum, allocation) => sum + allocation.amount,
8234
+ 0n
8235
+ );
8254
8236
  if (totalVested > availableForVesting) {
8255
8237
  throw new Error(
8256
8238
  `Total vesting amount (${totalVested}) exceeds available tokens (${availableForVesting})`
8257
8239
  );
8258
8240
  }
8259
- } else {
8260
- const vestedAmount = sale.initialSupply - sale.numTokensToSell;
8261
- if (vestedAmount <= 0n) {
8262
- throw new Error("No tokens available for vesting");
8263
- }
8264
- }
8265
- if (hasCustomSchedules) {
8266
- const schedules = vesting.schedules;
8267
- if (!schedules || schedules.length === 0) {
8268
- throw new Error(
8269
- "Vesting schedules are required when using scheduleIds or multiple vesting schedules"
8270
- );
8271
- }
8272
- const recipientCount = vesting.recipients && vesting.amounts ? vesting.recipients.length : 1;
8273
- if (vesting.scheduleIds) {
8274
- if (vesting.scheduleIds.length !== recipientCount) {
8275
- throw new Error(
8276
- "Vesting scheduleIds array must have the same length as vesting recipients"
8277
- );
8278
- }
8279
- for (const [index, scheduleId] of vesting.scheduleIds.entries()) {
8280
- this.validateUint64LikeNumber(
8281
- scheduleId,
8282
- `Vesting scheduleIds[${index}]`
8283
- );
8284
- if (scheduleId >= schedules.length) {
8285
- throw new Error(
8286
- `Vesting scheduleIds[${index}] references missing schedule ${scheduleId}`
8287
- );
8288
- }
8289
- }
8290
- } else if (schedules.length !== 1 && schedules.length !== recipientCount) {
8291
- throw new Error(
8292
- "Vesting schedules must either contain exactly one shared schedule or one schedule per recipient when scheduleIds are omitted"
8293
- );
8294
- }
8295
- for (const [index, schedule] of schedules.entries()) {
8296
- const scheduleCliff = schedule.cliffDuration ?? 0;
8297
- const scheduleDuration = schedule.duration ?? 0;
8241
+ for (const [index, allocation] of vesting.allocations.entries()) {
8242
+ const scheduleCliff = allocation.schedule.cliffDuration ?? 0;
8243
+ const scheduleDuration = allocation.schedule.duration ?? 0;
8298
8244
  this.validateUint64LikeNumber(
8299
8245
  scheduleCliff,
8300
- `Vesting schedules[${index}].cliffDuration`
8246
+ `Vesting allocations[${index}].schedule.cliffDuration`
8301
8247
  );
8302
8248
  this.validateUint64LikeNumber(
8303
8249
  scheduleDuration,
8304
- `Vesting schedules[${index}].duration`
8250
+ `Vesting allocations[${index}].schedule.duration`
8305
8251
  );
8306
8252
  if (scheduleCliff > scheduleDuration) {
8307
8253
  throw new Error(
8308
- `Vesting schedules[${index}].cliffDuration cannot exceed duration`
8254
+ `Vesting allocations[${index}].schedule.cliffDuration cannot exceed duration`
8309
8255
  );
8310
8256
  }
8311
8257
  if (scheduleCliff > 0 && scheduleDuration > 0 && scheduleDuration < DERC20_V2_MIN_VESTING_DURATION) {
8312
8258
  throw new Error(
8313
- `Vesting schedules[${index}].duration must be 0 or at least ${DERC20_V2_MIN_VESTING_DURATION} seconds when using cliffs`
8259
+ `Vesting allocations[${index}].schedule.duration must be 0 or at least ${DERC20_V2_MIN_VESTING_DURATION} seconds when using cliffs`
8314
8260
  );
8315
8261
  }
8316
8262
  }
8317
8263
  return;
8318
8264
  }
8265
+ if (vesting.recipients && vesting.amounts) {
8266
+ if (vesting.recipients.length !== vesting.amounts.length) {
8267
+ throw new Error(
8268
+ "Vesting recipients and amounts arrays must have the same length"
8269
+ );
8270
+ }
8271
+ if (vesting.recipients.length === 0) {
8272
+ throw new Error("Vesting recipients array cannot be empty");
8273
+ }
8274
+ const totalVested = vesting.amounts.reduce((sum, amt) => sum + amt, 0n);
8275
+ if (totalVested > availableForVesting) {
8276
+ throw new Error(
8277
+ `Total vesting amount (${totalVested}) exceeds available tokens (${availableForVesting})`
8278
+ );
8279
+ }
8280
+ } else {
8281
+ const vestedAmount = sale.initialSupply - sale.numTokensToSell;
8282
+ if (vestedAmount <= 0n) {
8283
+ throw new Error("No tokens available for vesting");
8284
+ }
8285
+ }
8319
8286
  if (cliffDuration < 0) {
8320
8287
  throw new Error("Vesting cliff duration cannot be negative");
8321
8288
  }
@@ -13574,23 +13541,14 @@ function normalizeBuilderVestingScheduleDuration(value, fieldPath) {
13574
13541
  }
13575
13542
  return Number(duration);
13576
13543
  }
13577
- function normalizeBuilderScheduleId(scheduleId, fieldPath) {
13578
- if (typeof scheduleId === "bigint") {
13579
- if (scheduleId < 0n) {
13580
- throw new RangeError(`${fieldPath} cannot be negative`);
13581
- }
13582
- if (scheduleId > MAX_SAFE_INTEGER_BIGINT) {
13583
- throw new RangeError(`${fieldPath} must be a safe integer`);
13584
- }
13585
- return Number(scheduleId);
13586
- }
13587
- if (!Number.isSafeInteger(scheduleId)) {
13588
- throw new RangeError(`${fieldPath} must be a safe integer`);
13589
- }
13590
- if (scheduleId < 0) {
13591
- throw new RangeError(`${fieldPath} cannot be negative`);
13592
- }
13593
- return scheduleId;
13544
+ function normalizeBuilderVestingSchedule(schedule, fieldPath) {
13545
+ return {
13546
+ duration: normalizeBuilderVestingScheduleDuration(
13547
+ schedule.duration,
13548
+ `${fieldPath}.duration`
13549
+ ),
13550
+ cliffDuration: schedule.cliffDuration ?? 0
13551
+ };
13594
13552
  }
13595
13553
  function computeTicks(priceRange, tickSpacing) {
13596
13554
  const startTick = Math.floor(
@@ -13887,24 +13845,24 @@ var StaticAuctionBuilder = class _StaticAuctionBuilder {
13887
13845
  this.vesting = void 0;
13888
13846
  return this;
13889
13847
  }
13890
- const hasCustomSchedules = (params.schedules?.length ?? 0) > 0 || (params.scheduleIds?.length ?? 0) > 0;
13848
+ if (params.allocations) {
13849
+ this.vesting = {
13850
+ allocations: params.allocations.map((allocation, index) => ({
13851
+ recipient: allocation.recipient,
13852
+ amount: allocation.amount,
13853
+ schedule: normalizeBuilderVestingSchedule(
13854
+ allocation.schedule,
13855
+ `Vesting allocations[${index}].schedule`
13856
+ )
13857
+ }))
13858
+ };
13859
+ return this;
13860
+ }
13891
13861
  this.vesting = {
13892
- duration: Number(
13893
- params.duration ?? (hasCustomSchedules ? 0n : DEFAULT_V3_VESTING_DURATION)
13894
- ),
13862
+ duration: Number(params.duration ?? DEFAULT_V3_VESTING_DURATION),
13895
13863
  cliffDuration: params.cliffDuration ?? 0,
13896
13864
  recipients: params.recipients,
13897
- amounts: params.amounts,
13898
- schedules: params.schedules?.map((schedule) => ({
13899
- duration: normalizeBuilderVestingScheduleDuration(
13900
- schedule.duration,
13901
- "Vesting schedule duration"
13902
- ),
13903
- cliffDuration: schedule.cliffDuration ?? 0
13904
- })),
13905
- scheduleIds: params.scheduleIds?.map(
13906
- (scheduleId, index) => normalizeBuilderScheduleId(scheduleId, `Vesting scheduleIds[${index}]`)
13907
- )
13865
+ amounts: params.amounts
13908
13866
  };
13909
13867
  return this;
13910
13868
  }
@@ -14232,21 +14190,24 @@ var DynamicAuctionBuilder = class _DynamicAuctionBuilder {
14232
14190
  this.vesting = void 0;
14233
14191
  return this;
14234
14192
  }
14193
+ if (params.allocations) {
14194
+ this.vesting = {
14195
+ allocations: params.allocations.map((allocation, index) => ({
14196
+ recipient: allocation.recipient,
14197
+ amount: allocation.amount,
14198
+ schedule: normalizeBuilderVestingSchedule(
14199
+ allocation.schedule,
14200
+ `Vesting allocations[${index}].schedule`
14201
+ )
14202
+ }))
14203
+ };
14204
+ return this;
14205
+ }
14235
14206
  this.vesting = {
14236
14207
  duration: Number(params.duration ?? 0n),
14237
14208
  cliffDuration: params.cliffDuration ?? 0,
14238
14209
  recipients: params.recipients,
14239
- amounts: params.amounts,
14240
- schedules: params.schedules?.map((schedule) => ({
14241
- duration: normalizeBuilderVestingScheduleDuration(
14242
- schedule.duration,
14243
- "Vesting schedule duration"
14244
- ),
14245
- cliffDuration: schedule.cliffDuration ?? 0
14246
- })),
14247
- scheduleIds: params.scheduleIds?.map(
14248
- (scheduleId, index) => normalizeBuilderScheduleId(scheduleId, `Vesting scheduleIds[${index}]`)
14249
- )
14210
+ amounts: params.amounts
14250
14211
  };
14251
14212
  return this;
14252
14213
  }
@@ -14848,21 +14809,24 @@ var MulticurveBuilder = class _MulticurveBuilder {
14848
14809
  this.vesting = void 0;
14849
14810
  return this;
14850
14811
  }
14812
+ if (params.allocations) {
14813
+ this.vesting = {
14814
+ allocations: params.allocations.map((allocation, index) => ({
14815
+ recipient: allocation.recipient,
14816
+ amount: allocation.amount,
14817
+ schedule: normalizeBuilderVestingSchedule(
14818
+ allocation.schedule,
14819
+ `Vesting allocations[${index}].schedule`
14820
+ )
14821
+ }))
14822
+ };
14823
+ return this;
14824
+ }
14851
14825
  this.vesting = {
14852
14826
  duration: Number(params.duration ?? 0n),
14853
14827
  cliffDuration: params.cliffDuration ?? 0,
14854
14828
  recipients: params.recipients,
14855
- amounts: params.amounts,
14856
- schedules: params.schedules?.map((schedule) => ({
14857
- duration: normalizeBuilderVestingScheduleDuration(
14858
- schedule.duration,
14859
- "Vesting schedule duration"
14860
- ),
14861
- cliffDuration: schedule.cliffDuration ?? 0
14862
- })),
14863
- scheduleIds: params.scheduleIds?.map(
14864
- (scheduleId, index) => normalizeBuilderScheduleId(scheduleId, `Vesting scheduleIds[${index}]`)
14865
- )
14829
+ amounts: params.amounts
14866
14830
  };
14867
14831
  return this;
14868
14832
  }
@@ -15247,21 +15211,24 @@ var OpeningAuctionBuilder = class _OpeningAuctionBuilder {
15247
15211
  this.vesting = void 0;
15248
15212
  return this;
15249
15213
  }
15214
+ if (params.allocations) {
15215
+ this.vesting = {
15216
+ allocations: params.allocations.map((allocation, index) => ({
15217
+ recipient: allocation.recipient,
15218
+ amount: allocation.amount,
15219
+ schedule: normalizeBuilderVestingSchedule(
15220
+ allocation.schedule,
15221
+ `Vesting allocations[${index}].schedule`
15222
+ )
15223
+ }))
15224
+ };
15225
+ return this;
15226
+ }
15250
15227
  this.vesting = {
15251
15228
  duration: Number(params.duration ?? 0n),
15252
15229
  cliffDuration: params.cliffDuration ?? 0,
15253
15230
  recipients: params.recipients,
15254
- amounts: params.amounts,
15255
- schedules: params.schedules?.map((schedule) => ({
15256
- duration: normalizeBuilderVestingScheduleDuration(
15257
- schedule.duration,
15258
- "Vesting schedule duration"
15259
- ),
15260
- cliffDuration: schedule.cliffDuration ?? 0
15261
- })),
15262
- scheduleIds: params.scheduleIds?.map(
15263
- (scheduleId, index) => normalizeBuilderScheduleId(scheduleId, `Vesting scheduleIds[${index}]`)
15264
- )
15231
+ amounts: params.amounts
15265
15232
  };
15266
15233
  return this;
15267
15234
  }