@whetstone-research/doppler-sdk 1.0.0 → 1.0.1

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
@@ -2185,10 +2185,30 @@ var openingAuctionAbi = [
2185
2185
  type: "event",
2186
2186
  name: "BidPlaced",
2187
2187
  inputs: [
2188
- { name: "positionId", type: "uint256", indexed: true, internalType: "uint256" },
2189
- { name: "owner", type: "address", indexed: true, internalType: "address" },
2190
- { name: "tickLower", type: "int24", indexed: false, internalType: "int24" },
2191
- { name: "liquidity", type: "uint128", indexed: false, internalType: "uint128" }
2188
+ {
2189
+ name: "positionId",
2190
+ type: "uint256",
2191
+ indexed: true,
2192
+ internalType: "uint256"
2193
+ },
2194
+ {
2195
+ name: "owner",
2196
+ type: "address",
2197
+ indexed: true,
2198
+ internalType: "address"
2199
+ },
2200
+ {
2201
+ name: "tickLower",
2202
+ type: "int24",
2203
+ indexed: false,
2204
+ internalType: "int24"
2205
+ },
2206
+ {
2207
+ name: "liquidity",
2208
+ type: "uint128",
2209
+ indexed: false,
2210
+ internalType: "uint128"
2211
+ }
2192
2212
  ],
2193
2213
  anonymous: false
2194
2214
  },
@@ -2196,7 +2216,12 @@ var openingAuctionAbi = [
2196
2216
  type: "event",
2197
2217
  name: "BidWithdrawn",
2198
2218
  inputs: [
2199
- { name: "positionId", type: "uint256", indexed: true, internalType: "uint256" }
2219
+ {
2220
+ name: "positionId",
2221
+ type: "uint256",
2222
+ indexed: true,
2223
+ internalType: "uint256"
2224
+ }
2200
2225
  ],
2201
2226
  anonymous: false
2202
2227
  },
@@ -2204,9 +2229,24 @@ var openingAuctionAbi = [
2204
2229
  type: "event",
2205
2230
  name: "IncentivesClaimed",
2206
2231
  inputs: [
2207
- { name: "positionId", type: "uint256", indexed: true, internalType: "uint256" },
2208
- { name: "owner", type: "address", indexed: true, internalType: "address" },
2209
- { name: "amount", type: "uint256", indexed: false, internalType: "uint256" }
2232
+ {
2233
+ name: "positionId",
2234
+ type: "uint256",
2235
+ indexed: true,
2236
+ internalType: "uint256"
2237
+ },
2238
+ {
2239
+ name: "owner",
2240
+ type: "address",
2241
+ indexed: true,
2242
+ internalType: "address"
2243
+ },
2244
+ {
2245
+ name: "amount",
2246
+ type: "uint256",
2247
+ indexed: false,
2248
+ internalType: "uint256"
2249
+ }
2210
2250
  ],
2211
2251
  anonymous: false
2212
2252
  },
@@ -2214,7 +2254,12 @@ var openingAuctionAbi = [
2214
2254
  type: "event",
2215
2255
  name: "EstimatedClearingTickUpdated",
2216
2256
  inputs: [
2217
- { name: "newEstimatedClearingTick", type: "int24", indexed: false, internalType: "int24" }
2257
+ {
2258
+ name: "newEstimatedClearingTick",
2259
+ type: "int24",
2260
+ indexed: false,
2261
+ internalType: "int24"
2262
+ }
2218
2263
  ],
2219
2264
  anonymous: false
2220
2265
  },
@@ -2231,10 +2276,30 @@ var openingAuctionAbi = [
2231
2276
  type: "event",
2232
2277
  name: "AuctionStarted",
2233
2278
  inputs: [
2234
- { name: "auctionStartTime", type: "uint256", indexed: false, internalType: "uint256" },
2235
- { name: "auctionEndTime", type: "uint256", indexed: false, internalType: "uint256" },
2236
- { name: "totalAuctionTokens", type: "uint256", indexed: false, internalType: "uint256" },
2237
- { name: "incentiveTokensTotal", type: "uint256", indexed: false, internalType: "uint256" }
2279
+ {
2280
+ name: "auctionStartTime",
2281
+ type: "uint256",
2282
+ indexed: false,
2283
+ internalType: "uint256"
2284
+ },
2285
+ {
2286
+ name: "auctionEndTime",
2287
+ type: "uint256",
2288
+ indexed: false,
2289
+ internalType: "uint256"
2290
+ },
2291
+ {
2292
+ name: "totalAuctionTokens",
2293
+ type: "uint256",
2294
+ indexed: false,
2295
+ internalType: "uint256"
2296
+ },
2297
+ {
2298
+ name: "incentiveTokensTotal",
2299
+ type: "uint256",
2300
+ indexed: false,
2301
+ internalType: "uint256"
2302
+ }
2238
2303
  ],
2239
2304
  anonymous: false
2240
2305
  },
@@ -2243,7 +2308,12 @@ var openingAuctionAbi = [
2243
2308
  name: "TickEnteredRange",
2244
2309
  inputs: [
2245
2310
  { name: "tick", type: "int24", indexed: true, internalType: "int24" },
2246
- { name: "liquidity", type: "uint128", indexed: false, internalType: "uint128" }
2311
+ {
2312
+ name: "liquidity",
2313
+ type: "uint128",
2314
+ indexed: false,
2315
+ internalType: "uint128"
2316
+ }
2247
2317
  ],
2248
2318
  anonymous: false
2249
2319
  },
@@ -2252,7 +2322,12 @@ var openingAuctionAbi = [
2252
2322
  name: "TickExitedRange",
2253
2323
  inputs: [
2254
2324
  { name: "tick", type: "int24", indexed: true, internalType: "int24" },
2255
- { name: "liquidity", type: "uint128", indexed: false, internalType: "uint128" }
2325
+ {
2326
+ name: "liquidity",
2327
+ type: "uint128",
2328
+ indexed: false,
2329
+ internalType: "uint128"
2330
+ }
2256
2331
  ],
2257
2332
  anonymous: false
2258
2333
  },
@@ -2261,8 +2336,18 @@ var openingAuctionAbi = [
2261
2336
  name: "LiquidityAddedToTick",
2262
2337
  inputs: [
2263
2338
  { name: "tick", type: "int24", indexed: true, internalType: "int24" },
2264
- { name: "liquidityAdded", type: "uint128", indexed: false, internalType: "uint128" },
2265
- { name: "totalLiquidity", type: "uint128", indexed: false, internalType: "uint128" }
2339
+ {
2340
+ name: "liquidityAdded",
2341
+ type: "uint128",
2342
+ indexed: false,
2343
+ internalType: "uint128"
2344
+ },
2345
+ {
2346
+ name: "totalLiquidity",
2347
+ type: "uint128",
2348
+ indexed: false,
2349
+ internalType: "uint128"
2350
+ }
2266
2351
  ],
2267
2352
  anonymous: false
2268
2353
  },
@@ -2271,8 +2356,18 @@ var openingAuctionAbi = [
2271
2356
  name: "LiquidityRemovedFromTick",
2272
2357
  inputs: [
2273
2358
  { name: "tick", type: "int24", indexed: true, internalType: "int24" },
2274
- { name: "liquidityRemoved", type: "uint128", indexed: false, internalType: "uint128" },
2275
- { name: "remainingLiquidity", type: "uint128", indexed: false, internalType: "uint128" }
2359
+ {
2360
+ name: "liquidityRemoved",
2361
+ type: "uint128",
2362
+ indexed: false,
2363
+ internalType: "uint128"
2364
+ },
2365
+ {
2366
+ name: "remainingLiquidity",
2367
+ type: "uint128",
2368
+ indexed: false,
2369
+ internalType: "uint128"
2370
+ }
2276
2371
  ],
2277
2372
  anonymous: false
2278
2373
  },
@@ -2280,8 +2375,18 @@ var openingAuctionAbi = [
2280
2375
  type: "event",
2281
2376
  name: "TimeHarvested",
2282
2377
  inputs: [
2283
- { name: "positionId", type: "uint256", indexed: true, internalType: "uint256" },
2284
- { name: "harvestedTimeX128", type: "uint256", indexed: false, internalType: "uint256" }
2378
+ {
2379
+ name: "positionId",
2380
+ type: "uint256",
2381
+ indexed: true,
2382
+ internalType: "uint256"
2383
+ },
2384
+ {
2385
+ name: "harvestedTimeX128",
2386
+ type: "uint256",
2387
+ indexed: false,
2388
+ internalType: "uint256"
2389
+ }
2285
2390
  ],
2286
2391
  anonymous: false
2287
2392
  },
@@ -2289,8 +2394,18 @@ var openingAuctionAbi = [
2289
2394
  type: "event",
2290
2395
  name: "IncentivesRecovered",
2291
2396
  inputs: [
2292
- { name: "recipient", type: "address", indexed: true, internalType: "address" },
2293
- { name: "amount", type: "uint256", indexed: false, internalType: "uint256" }
2397
+ {
2398
+ name: "recipient",
2399
+ type: "address",
2400
+ indexed: true,
2401
+ internalType: "address"
2402
+ },
2403
+ {
2404
+ name: "amount",
2405
+ type: "uint256",
2406
+ indexed: false,
2407
+ internalType: "uint256"
2408
+ }
2294
2409
  ],
2295
2410
  anonymous: false
2296
2411
  }
@@ -5320,7 +5435,7 @@ var DopplerFactory = class {
5320
5435
  const timestampBytes = new Uint8Array(8);
5321
5436
  const bigTimestamp = BigInt(timestamp);
5322
5437
  for (let i = 0; i < 8; i++) {
5323
- timestampBytes[i] = Number(bigTimestamp >> BigInt(i * 8) & 0xFFn);
5438
+ timestampBytes[i] = Number(bigTimestamp >> BigInt(i * 8) & 0xffn);
5324
5439
  }
5325
5440
  for (let i = 0; i < 32; i++) {
5326
5441
  if (i < 8) {
@@ -5724,10 +5839,7 @@ var DopplerFactory = class {
5724
5839
  async encodeCreateOpeningAuctionParams(params) {
5725
5840
  this.validateOpeningAuctionParams(params);
5726
5841
  const addresses = getAddresses(this.chainId);
5727
- const openingAuctionInitializer = this.resolveOpeningAuctionInitializerAddress(
5728
- params.modules,
5729
- addresses
5730
- );
5842
+ const openingAuctionInitializer = this.resolveOpeningAuctionInitializerAddress(params.modules, addresses);
5731
5843
  const [poolManagerForAuction, auctionDeployer] = await Promise.all([
5732
5844
  this.publicClient.readContract({
5733
5845
  address: openingAuctionInitializer,
@@ -6108,15 +6220,13 @@ var DopplerFactory = class {
6108
6220
  startSalt
6109
6221
  });
6110
6222
  try {
6111
- const { request } = await this.publicClient.simulateContract(
6112
- {
6113
- address: initializerAddress,
6114
- abi: openingAuctionInitializerAbi,
6115
- functionName: "completeAuction",
6116
- args: [args.asset, completion.dopplerSalt],
6117
- account: this.walletClient?.account
6118
- }
6119
- );
6223
+ const { request } = await this.publicClient.simulateContract({
6224
+ address: initializerAddress,
6225
+ abi: openingAuctionInitializerAbi,
6226
+ functionName: "completeAuction",
6227
+ args: [args.asset, completion.dopplerSalt],
6228
+ account: this.walletClient?.account
6229
+ });
6120
6230
  const gasEstimate = request && typeof request === "object" && "gas" in request ? request.gas ?? void 0 : void 0;
6121
6231
  return {
6122
6232
  asset: args.asset,
@@ -6169,14 +6279,12 @@ var DopplerFactory = class {
6169
6279
  functionName: "phase"
6170
6280
  });
6171
6281
  if (autoSettle && Number(phase) !== OPENING_AUCTION_PHASE_SETTLED) {
6172
- const { request } = await this.publicClient.simulateContract(
6173
- {
6174
- address: state.openingAuctionHook,
6175
- abi: openingAuctionAbi,
6176
- functionName: "settleAuction",
6177
- account: this.walletClient.account
6178
- }
6179
- );
6282
+ const { request } = await this.publicClient.simulateContract({
6283
+ address: state.openingAuctionHook,
6284
+ abi: openingAuctionAbi,
6285
+ functionName: "settleAuction",
6286
+ account: this.walletClient.account
6287
+ });
6180
6288
  const settleTx = await this.walletClient.writeContract(request);
6181
6289
  await this.publicClient.waitForTransactionReceipt({
6182
6290
  hash: settleTx
@@ -6245,14 +6353,12 @@ var DopplerFactory = class {
6245
6353
  if (autoMined) startSalt = BigInt(completion.dopplerSalt) + 1n;
6246
6354
  continue;
6247
6355
  }
6248
- const dopplerHookAddress = await this.publicClient.readContract(
6249
- {
6250
- address: initializerAddress,
6251
- abi: openingAuctionInitializerAbi,
6252
- functionName: "getDopplerHook",
6253
- args: [args.asset]
6254
- }
6255
- );
6356
+ const dopplerHookAddress = await this.publicClient.readContract({
6357
+ address: initializerAddress,
6358
+ abi: openingAuctionInitializerAbi,
6359
+ functionName: "getDopplerHook",
6360
+ args: [args.asset]
6361
+ });
6256
6362
  const finalHookAddress = dopplerHookAddress === ZERO_ADDRESS2 ? completion.dopplerHookAddress : dopplerHookAddress;
6257
6363
  if (finalHookAddress === ZERO_ADDRESS2) {
6258
6364
  throw new Error(
@@ -6273,15 +6379,13 @@ var DopplerFactory = class {
6273
6379
  }
6274
6380
  async simulateRecoverOpeningAuctionIncentives(args) {
6275
6381
  const initializerAddress = args.initializerAddress ? args.initializerAddress : this.resolveOpeningAuctionInitializerAddress();
6276
- const { request } = await this.publicClient.simulateContract(
6277
- {
6278
- address: initializerAddress,
6279
- abi: openingAuctionInitializerAbi,
6280
- functionName: "recoverOpeningAuctionIncentives",
6281
- args: [args.asset],
6282
- account: args.account ?? this.walletClient?.account
6283
- }
6284
- );
6382
+ const { request } = await this.publicClient.simulateContract({
6383
+ address: initializerAddress,
6384
+ abi: openingAuctionInitializerAbi,
6385
+ functionName: "recoverOpeningAuctionIncentives",
6386
+ args: [args.asset],
6387
+ account: args.account ?? this.walletClient?.account
6388
+ });
6285
6389
  return { request };
6286
6390
  }
6287
6391
  async recoverOpeningAuctionIncentives(args) {
@@ -6296,15 +6400,13 @@ var DopplerFactory = class {
6296
6400
  }
6297
6401
  async simulateSweepOpeningAuctionIncentives(args) {
6298
6402
  const initializerAddress = args.initializerAddress ? args.initializerAddress : this.resolveOpeningAuctionInitializerAddress();
6299
- const { request } = await this.publicClient.simulateContract(
6300
- {
6301
- address: initializerAddress,
6302
- abi: openingAuctionInitializerAbi,
6303
- functionName: "sweepOpeningAuctionIncentives",
6304
- args: [args.asset],
6305
- account: args.account ?? this.walletClient?.account
6306
- }
6307
- );
6403
+ const { request } = await this.publicClient.simulateContract({
6404
+ address: initializerAddress,
6405
+ abi: openingAuctionInitializerAbi,
6406
+ functionName: "sweepOpeningAuctionIncentives",
6407
+ args: [args.asset],
6408
+ account: args.account ?? this.walletClient?.account
6409
+ });
6308
6410
  return { request };
6309
6411
  }
6310
6412
  async sweepOpeningAuctionIncentives(args) {
@@ -6366,9 +6468,7 @@ var DopplerFactory = class {
6366
6468
  status: Number(value.status),
6367
6469
  openingAuctionHook: value.openingAuctionHook,
6368
6470
  dopplerHook: value.dopplerHook,
6369
- openingAuctionPoolKey: this.normalizePoolKey(
6370
- value.openingAuctionPoolKey
6371
- ),
6471
+ openingAuctionPoolKey: this.normalizePoolKey(value.openingAuctionPoolKey),
6372
6472
  dopplerInitData: value.dopplerInitData,
6373
6473
  isToken0: Boolean(value.isToken0)
6374
6474
  };
@@ -6448,7 +6548,12 @@ var DopplerFactory = class {
6448
6548
  return tick < 0 ? Math.trunc(tick / tickSpacing) * tickSpacing : Math.trunc((tick + tickSpacing - 1) / tickSpacing) * tickSpacing;
6449
6549
  }
6450
6550
  async mineDopplerCompletionSalt(args) {
6451
- const [phaseRaw, clearingTickRaw, incentiveTokensTotal, totalIncentivesClaimed] = await Promise.all([
6551
+ const [
6552
+ phaseRaw,
6553
+ clearingTickRaw,
6554
+ incentiveTokensTotal,
6555
+ totalIncentivesClaimed
6556
+ ] = await Promise.all([
6452
6557
  this.publicClient.readContract({
6453
6558
  address: args.state.openingAuctionHook,
6454
6559
  abi: openingAuctionAbi,
@@ -6471,7 +6576,9 @@ var DopplerFactory = class {
6471
6576
  })
6472
6577
  ]);
6473
6578
  if (Number(phaseRaw) !== OPENING_AUCTION_PHASE_SETTLED) {
6474
- throw new Error("Opening auction must be settled before completion mining");
6579
+ throw new Error(
6580
+ "Opening auction must be settled before completion mining"
6581
+ );
6475
6582
  }
6476
6583
  const rawAssetBalance = await this.publicClient.readContract({
6477
6584
  address: args.asset,
@@ -6487,8 +6594,14 @@ var DopplerFactory = class {
6487
6594
  Number(clearingTickRaw),
6488
6595
  dopplerData.tickSpacing
6489
6596
  );
6490
- const minAligned = this.alignTickTowardZero(MIN_TICK, dopplerData.tickSpacing);
6491
- const maxAligned = this.alignTickTowardZero(MAX_TICK, dopplerData.tickSpacing);
6597
+ const minAligned = this.alignTickTowardZero(
6598
+ MIN_TICK,
6599
+ dopplerData.tickSpacing
6600
+ );
6601
+ const maxAligned = this.alignTickTowardZero(
6602
+ MAX_TICK,
6603
+ dopplerData.tickSpacing
6604
+ );
6492
6605
  if (alignedClearingTick < minAligned) alignedClearingTick = minAligned;
6493
6606
  if (alignedClearingTick > maxAligned) alignedClearingTick = maxAligned;
6494
6607
  let blockTimestamp;
@@ -6592,7 +6705,10 @@ var DopplerFactory = class {
6592
6705
  const initHash = keccak256(
6593
6706
  encodePacked(["bytes", "bytes"], [doppler_default, initHashData])
6594
6707
  );
6595
- const hookBuffer = this.prepareCreate2Buffer(args.dopplerDeployer, initHash);
6708
+ const hookBuffer = this.prepareCreate2Buffer(
6709
+ args.dopplerDeployer,
6710
+ initHash
6711
+ );
6596
6712
  for (let salt = args.startSalt ?? 0n; salt < ONE_MILLION; salt++) {
6597
6713
  this.updateSaltInBuffer(hookBuffer, salt);
6598
6714
  const hookRaw = this.computeCreate2AddressFast(hookBuffer);
@@ -6706,7 +6822,10 @@ var DopplerFactory = class {
6706
6822
  ]
6707
6823
  );
6708
6824
  tokenInitHash = keccak256(
6709
- encodePacked(["bytes", "bytes"], [dopplerDN404_default, initData])
6825
+ encodePacked(
6826
+ ["bytes", "bytes"],
6827
+ [dopplerDN404_default, initData]
6828
+ )
6710
6829
  );
6711
6830
  } else {
6712
6831
  const t = params.tokenFactoryData;
@@ -6753,7 +6872,10 @@ var DopplerFactory = class {
6753
6872
  params.auctionDeployer,
6754
6873
  hookInitHash
6755
6874
  );
6756
- const tokenBuffer = this.prepareCreate2Buffer(params.tokenFactory, tokenInitHash);
6875
+ const tokenBuffer = this.prepareCreate2Buffer(
6876
+ params.tokenFactory,
6877
+ tokenInitHash
6878
+ );
6757
6879
  for (let salt = 0n; salt < ONE_MILLION; salt++) {
6758
6880
  this.updateSaltInBuffer(hookBuffer, salt);
6759
6881
  const hookRaw = this.computeCreate2AddressFast(hookBuffer);
@@ -8013,7 +8135,9 @@ var DopplerFactory = class {
8013
8135
  throw new Error("openingAuction.incentiveShareBps cannot exceed 10_000");
8014
8136
  }
8015
8137
  if (params.openingAuction.incentiveShareBps + params.openingAuction.shareToAuctionBps > 1e4) {
8016
- throw new Error("openingAuction.incentiveShareBps + shareToAuctionBps cannot exceed 10_000");
8138
+ throw new Error(
8139
+ "openingAuction.incentiveShareBps + shareToAuctionBps cannot exceed 10_000"
8140
+ );
8017
8141
  }
8018
8142
  if (params.openingAuction.auctionDuration <= 0) {
8019
8143
  throw new Error("openingAuction.auctionDuration must be positive");
@@ -8025,10 +8149,14 @@ var DopplerFactory = class {
8025
8149
  throw new Error("openingAuction.minLiquidity must be positive");
8026
8150
  }
8027
8151
  if (params.doppler.duration <= 0 || params.doppler.epochLength <= 0) {
8028
- throw new Error("doppler.duration and doppler.epochLength must be positive");
8152
+ throw new Error(
8153
+ "doppler.duration and doppler.epochLength must be positive"
8154
+ );
8029
8155
  }
8030
8156
  if (params.doppler.duration % params.doppler.epochLength !== 0) {
8031
- throw new Error("doppler.epochLength must divide doppler.duration evenly");
8157
+ throw new Error(
8158
+ "doppler.epochLength must divide doppler.duration evenly"
8159
+ );
8032
8160
  }
8033
8161
  if (params.doppler.tickSpacing <= 0) {
8034
8162
  throw new Error("doppler.tickSpacing must be positive");
@@ -8044,16 +8172,24 @@ var DopplerFactory = class {
8044
8172
  );
8045
8173
  }
8046
8174
  if (params.openingAuction.minAcceptableTickToken0 < INT24_MIN || params.openingAuction.minAcceptableTickToken0 > INT24_MAX) {
8047
- throw new Error(`openingAuction.minAcceptableTickToken0 must be within int24 range (${INT24_MIN} to ${INT24_MAX})`);
8175
+ throw new Error(
8176
+ `openingAuction.minAcceptableTickToken0 must be within int24 range (${INT24_MIN} to ${INT24_MAX})`
8177
+ );
8048
8178
  }
8049
8179
  if (params.openingAuction.minAcceptableTickToken1 < INT24_MIN || params.openingAuction.minAcceptableTickToken1 > INT24_MAX) {
8050
- throw new Error(`openingAuction.minAcceptableTickToken1 must be within int24 range (${INT24_MIN} to ${INT24_MAX})`);
8180
+ throw new Error(
8181
+ `openingAuction.minAcceptableTickToken1 must be within int24 range (${INT24_MIN} to ${INT24_MAX})`
8182
+ );
8051
8183
  }
8052
8184
  if (params.doppler.startTick < INT24_MIN || params.doppler.startTick > INT24_MAX) {
8053
- throw new Error(`doppler.startTick must be within int24 range (${INT24_MIN} to ${INT24_MAX})`);
8185
+ throw new Error(
8186
+ `doppler.startTick must be within int24 range (${INT24_MIN} to ${INT24_MAX})`
8187
+ );
8054
8188
  }
8055
8189
  if (params.doppler.endTick < INT24_MIN || params.doppler.endTick > INT24_MAX) {
8056
- throw new Error(`doppler.endTick must be within int24 range (${INT24_MIN} to ${INT24_MAX})`);
8190
+ throw new Error(
8191
+ `doppler.endTick must be within int24 range (${INT24_MIN} to ${INT24_MAX})`
8192
+ );
8057
8193
  }
8058
8194
  const isToken0 = isToken0Expected(params.sale.numeraire);
8059
8195
  if (isToken0 && params.doppler.startTick < params.doppler.endTick) {
@@ -8070,7 +8206,9 @@ var DopplerFactory = class {
8070
8206
  throw new Error("doppler.gamma must be divisible by doppler.tickSpacing");
8071
8207
  }
8072
8208
  if (params.migration.type === "dopplerHook") {
8073
- throw new Error("dopplerHook migration type is not supported for opening auctions");
8209
+ throw new Error(
8210
+ "dopplerHook migration type is not supported for opening auctions"
8211
+ );
8074
8212
  }
8075
8213
  }
8076
8214
  /**
@@ -9831,12 +9969,10 @@ var OpeningAuctionPositionManager = class _OpeningAuctionPositionManager {
9831
9969
  );
9832
9970
  }
9833
9971
  static buildSingleTickParams(args) {
9834
- const { tickLower, tickUpper } = _OpeningAuctionPositionManager.validateSingleTick(
9835
- {
9836
- key: args.key,
9837
- tickLower: args.tickLower
9838
- }
9839
- );
9972
+ const { tickLower, tickUpper } = _OpeningAuctionPositionManager.validateSingleTick({
9973
+ key: args.key,
9974
+ tickLower: args.tickLower
9975
+ });
9840
9976
  return {
9841
9977
  tickLower,
9842
9978
  tickUpper,
@@ -10072,12 +10208,10 @@ var OpeningAuctionPositionManager = class _OpeningAuctionPositionManager {
10072
10208
  "owner (or account/walletClient) is required to resolve positionId"
10073
10209
  );
10074
10210
  }
10075
- const { tickLower, tickUpper } = _OpeningAuctionPositionManager.validateSingleTick(
10076
- {
10077
- key: args.key,
10078
- tickLower: args.tickLower
10079
- }
10080
- );
10211
+ const { tickLower, tickUpper } = _OpeningAuctionPositionManager.validateSingleTick({
10212
+ key: args.key,
10213
+ tickLower: args.tickLower
10214
+ });
10081
10215
  const salt = args.salt ?? zeroHash;
10082
10216
  const positionId = await opening.getPositionId({
10083
10217
  owner,
@@ -10118,12 +10252,10 @@ var OpeningAuctionPositionManager = class _OpeningAuctionPositionManager {
10118
10252
  args.openingAuctionHookAddress
10119
10253
  );
10120
10254
  const owner = args.owner ?? walletAddress;
10121
- const { tickLower, tickUpper } = _OpeningAuctionPositionManager.validateSingleTick(
10122
- {
10123
- key: args.key,
10124
- tickLower: args.tickLower
10125
- }
10126
- );
10255
+ const { tickLower, tickUpper } = _OpeningAuctionPositionManager.validateSingleTick({
10256
+ key: args.key,
10257
+ tickLower: args.tickLower
10258
+ });
10127
10259
  const salt = args.salt ?? zeroHash;
10128
10260
  const positionId = await opening.getPositionId({
10129
10261
  owner,
@@ -10410,9 +10542,7 @@ var openingAuctionEntityAbi = [
10410
10542
  {
10411
10543
  type: "event",
10412
10544
  name: "BidWithdrawn",
10413
- inputs: [
10414
- { name: "positionId", type: "uint256", indexed: true }
10415
- ],
10545
+ inputs: [{ name: "positionId", type: "uint256", indexed: true }],
10416
10546
  anonymous: false
10417
10547
  },
10418
10548
  {
@@ -10713,7 +10843,9 @@ var OpeningAuction = class {
10713
10843
  functionName: "nextPositionId"
10714
10844
  });
10715
10845
  if (result === 0n) {
10716
- throw new Error("nextPositionId returned 0, which indicates malformed contract state");
10846
+ throw new Error(
10847
+ "nextPositionId returned 0, which indicates malformed contract state"
10848
+ );
10717
10849
  }
10718
10850
  return result;
10719
10851
  }
@@ -10850,7 +10982,7 @@ var OpeningAuction = class {
10850
10982
  }
10851
10983
  } catch {
10852
10984
  }
10853
- const [position, phase, isToken0] = await Promise.all([
10985
+ const [position, phase, _isToken0] = await Promise.all([
10854
10986
  this.getPosition(positionId),
10855
10987
  this.getPhase(),
10856
10988
  this.getIsToken0()
@@ -10920,7 +11052,9 @@ var OpeningAuction = class {
10920
11052
  if (!this.walletClient) {
10921
11053
  throw new Error("Wallet client required for write operations");
10922
11054
  }
10923
- const { request } = await this.simulateSettleAuction(this.walletClient.account);
11055
+ const { request } = await this.simulateSettleAuction(
11056
+ this.walletClient.account
11057
+ );
10924
11058
  return await this.walletClient.writeContract(
10925
11059
  options?.gas ? { ...request, gas: options.gas } : request
10926
11060
  );
@@ -11163,9 +11297,7 @@ var bidManagerEventAbi = [
11163
11297
  {
11164
11298
  type: "event",
11165
11299
  name: "BidWithdrawn",
11166
- inputs: [
11167
- { name: "positionId", type: "uint256", indexed: true }
11168
- ],
11300
+ inputs: [{ name: "positionId", type: "uint256", indexed: true }],
11169
11301
  anonymous: false
11170
11302
  },
11171
11303
  {
@@ -11802,7 +11934,10 @@ var OpeningAuctionBidManager = class _OpeningAuctionBidManager {
11802
11934
  throw new Error("fromTickLower and toTickLower must be different");
11803
11935
  }
11804
11936
  const owner = this.resolveOwner(args.owner, args.account);
11805
- const { tickLower: fromTickLower, tickUpper: fromTickUpper } = this.resolveBidCoordinates({ tickLower: args.fromTickLower, salt: args.salt });
11937
+ const { tickLower: fromTickLower, tickUpper: fromTickUpper } = this.resolveBidCoordinates({
11938
+ tickLower: args.fromTickLower,
11939
+ salt: args.salt
11940
+ });
11806
11941
  const salt = args.salt ?? zeroHash;
11807
11942
  const positionId = await this.openingAuction.getPositionId({
11808
11943
  owner,
@@ -11811,7 +11946,9 @@ var OpeningAuctionBidManager = class _OpeningAuctionBidManager {
11811
11946
  salt
11812
11947
  });
11813
11948
  if (positionId === 0n) {
11814
- throw new Error("Source position not found for the given (owner,ticks,salt)");
11949
+ throw new Error(
11950
+ "Source position not found for the given (owner,ticks,salt)"
11951
+ );
11815
11952
  }
11816
11953
  const position = await this.openingAuction.getPosition(positionId);
11817
11954
  if (position.liquidity === 0n) {
@@ -11858,7 +11995,10 @@ var OpeningAuctionBidManager = class _OpeningAuctionBidManager {
11858
11995
  throw new Error("fromTickLower and toTickLower must be different");
11859
11996
  }
11860
11997
  const owner = this.resolveOwner(args.owner, this.walletClient.account);
11861
- const { tickLower: fromTickLower, tickUpper: fromTickUpper } = this.resolveBidCoordinates({ tickLower: args.fromTickLower, salt: args.salt });
11998
+ const { tickLower: fromTickLower, tickUpper: fromTickUpper } = this.resolveBidCoordinates({
11999
+ tickLower: args.fromTickLower,
12000
+ salt: args.salt
12001
+ });
11862
12002
  const salt = args.salt ?? zeroHash;
11863
12003
  const positionId = await this.openingAuction.getPositionId({
11864
12004
  owner,
@@ -11867,7 +12007,9 @@ var OpeningAuctionBidManager = class _OpeningAuctionBidManager {
11867
12007
  salt
11868
12008
  });
11869
12009
  if (positionId === 0n) {
11870
- throw new Error("Source position not found for the given (owner,ticks,salt)");
12010
+ throw new Error(
12011
+ "Source position not found for the given (owner,ticks,salt)"
12012
+ );
11871
12013
  }
11872
12014
  const position = await this.openingAuction.getPosition(positionId);
11873
12015
  if (position.liquidity === 0n) {
@@ -11882,13 +12024,23 @@ var OpeningAuctionBidManager = class _OpeningAuctionBidManager {
11882
12024
  account: this.walletClient.account
11883
12025
  });
11884
12026
  const withdrawTxHash = await this.withdrawBid(
11885
- { tickLower: args.fromTickLower, liquidity, salt: args.salt, owner: args.owner },
12027
+ {
12028
+ tickLower: args.fromTickLower,
12029
+ liquidity,
12030
+ salt: args.salt,
12031
+ owner: args.owner
12032
+ },
11886
12033
  options?.gasWithdraw ? { gas: options.gasWithdraw } : void 0
11887
12034
  );
11888
12035
  let placeTxHash;
11889
12036
  try {
11890
12037
  placeTxHash = await this.placeBid(
11891
- { tickLower: args.toTickLower, liquidity, salt: args.salt, owner: args.owner },
12038
+ {
12039
+ tickLower: args.toTickLower,
12040
+ liquidity,
12041
+ salt: args.salt,
12042
+ owner: args.owner
12043
+ },
11892
12044
  options?.gasPlace ? { gas: options.gasPlace } : void 0
11893
12045
  );
11894
12046
  } catch (err) {
@@ -11949,15 +12101,24 @@ var OpeningAuctionBidManager = class _OpeningAuctionBidManager {
11949
12101
  const skippedPositions = [];
11950
12102
  for (const bid of bids) {
11951
12103
  if (bid.hasClaimedIncentives) {
11952
- skippedPositions.push({ positionId: bid.positionId, reason: "already claimed" });
12104
+ skippedPositions.push({
12105
+ positionId: bid.positionId,
12106
+ reason: "already claimed"
12107
+ });
11953
12108
  continue;
11954
12109
  }
11955
12110
  if (bid.claimableIncentives === 0n) {
11956
- skippedPositions.push({ positionId: bid.positionId, reason: "zero claimable" });
12111
+ skippedPositions.push({
12112
+ positionId: bid.positionId,
12113
+ reason: "zero claimable"
12114
+ });
11957
12115
  continue;
11958
12116
  }
11959
12117
  if (!bid.isInRange) {
11960
- skippedPositions.push({ positionId: bid.positionId, reason: "not in range" });
12118
+ skippedPositions.push({
12119
+ positionId: bid.positionId,
12120
+ reason: "not in range"
12121
+ });
11961
12122
  continue;
11962
12123
  }
11963
12124
  claimablePositions.push({
@@ -11988,7 +12149,9 @@ var OpeningAuctionBidManager = class _OpeningAuctionBidManager {
11988
12149
  positionId,
11989
12150
  this.walletClient.account
11990
12151
  );
11991
- const transactionHash = await this.walletClient.writeContract(request);
12152
+ const transactionHash = await this.walletClient.writeContract(
12153
+ request
12154
+ );
11992
12155
  results.push({ positionId, transactionHash });
11993
12156
  totalClaimed++;
11994
12157
  } catch (error) {
@@ -12181,7 +12344,9 @@ var OpeningAuctionBidManager = class _OpeningAuctionBidManager {
12181
12344
  for (const log of logs) {
12182
12345
  const logArgs = log?.args ?? {};
12183
12346
  options.onEstimatedClearingTickUpdated({
12184
- newEstimatedClearingTick: Number(logArgs.newEstimatedClearingTick ?? 0),
12347
+ newEstimatedClearingTick: Number(
12348
+ logArgs.newEstimatedClearingTick ?? 0
12349
+ ),
12185
12350
  transactionHash: log.transactionHash ?? zeroHash,
12186
12351
  blockNumber: log.blockNumber ?? 0n,
12187
12352
  logIndex: Number(log.logIndex ?? 0)
@@ -12330,7 +12495,7 @@ var Quoter = class {
12330
12495
  initializedTicksCrossed: 0,
12331
12496
  gasEstimate: 0n
12332
12497
  };
12333
- } catch (_) {
12498
+ } catch {
12334
12499
  }
12335
12500
  }
12336
12501
  throw err;
@@ -12378,7 +12543,7 @@ var Quoter = class {
12378
12543
  initializedTicksCrossed: 0,
12379
12544
  gasEstimate: 0n
12380
12545
  };
12381
- } catch (_) {
12546
+ } catch {
12382
12547
  }
12383
12548
  }
12384
12549
  throw err;
@@ -14588,9 +14753,7 @@ var OpeningAuctionBuilder = class _OpeningAuctionBuilder {
14588
14753
  this.startTimeOffset = startTimeOffset;
14589
14754
  this.startingTime = void 0;
14590
14755
  } else if (hasStartingTime) {
14591
- const startingTimeSeconds = this.normalizeTimestamp(
14592
- params.startingTime
14593
- );
14756
+ const startingTimeSeconds = this.normalizeTimestamp(params.startingTime);
14594
14757
  this.startingTime = startingTimeSeconds;
14595
14758
  this.startTimeOffset = void 0;
14596
14759
  } else {
@@ -14725,10 +14888,14 @@ var OpeningAuctionBuilder = class _OpeningAuctionBuilder {
14725
14888
  throw new Error("openingAuction.minLiquidity must be positive");
14726
14889
  }
14727
14890
  if (this.openingAuction.minAcceptableTickToken0 < INT24_MIN || this.openingAuction.minAcceptableTickToken0 > INT24_MAX) {
14728
- throw new Error(`openingAuction.minAcceptableTickToken0 must be within int24 range (${INT24_MIN} to ${INT24_MAX})`);
14891
+ throw new Error(
14892
+ `openingAuction.minAcceptableTickToken0 must be within int24 range (${INT24_MIN} to ${INT24_MAX})`
14893
+ );
14729
14894
  }
14730
14895
  if (this.openingAuction.minAcceptableTickToken1 < INT24_MIN || this.openingAuction.minAcceptableTickToken1 > INT24_MAX) {
14731
- throw new Error(`openingAuction.minAcceptableTickToken1 must be within int24 range (${INT24_MIN} to ${INT24_MAX})`);
14896
+ throw new Error(
14897
+ `openingAuction.minAcceptableTickToken1 must be within int24 range (${INT24_MIN} to ${INT24_MAX})`
14898
+ );
14732
14899
  }
14733
14900
  const duration = this.doppler.duration ?? DEFAULT_AUCTION_DURATION;
14734
14901
  const epochLength = this.doppler.epochLength ?? DEFAULT_EPOCH_LENGTH;
@@ -14748,7 +14915,9 @@ var OpeningAuctionBuilder = class _OpeningAuctionBuilder {
14748
14915
  );
14749
14916
  }
14750
14917
  if (!Number.isInteger(fee) || fee < 0 || fee > V4_MAX_FEE) {
14751
- throw new Error(`doppler.fee must be an integer between 0 and ${V4_MAX_FEE}`);
14918
+ throw new Error(
14919
+ `doppler.fee must be an integer between 0 and ${V4_MAX_FEE}`
14920
+ );
14752
14921
  }
14753
14922
  if (this.doppler.minProceeds < 0n) {
14754
14923
  throw new Error("doppler.minProceeds must be non-negative");
@@ -14778,7 +14947,9 @@ var OpeningAuctionBuilder = class _OpeningAuctionBuilder {
14778
14947
  if (gamma !== void 0) {
14779
14948
  this.validatePositiveInteger(gamma, "doppler.gamma");
14780
14949
  if (gamma % tickSpacing !== 0) {
14781
- throw new Error("doppler.gamma must be divisible by doppler.tickSpacing");
14950
+ throw new Error(
14951
+ "doppler.gamma must be divisible by doppler.tickSpacing"
14952
+ );
14782
14953
  }
14783
14954
  } else {
14784
14955
  gamma = computeOptimalGamma(
@@ -14906,7 +15077,11 @@ var DopplerSDK = class {
14906
15077
  * @param hookAddress The address of the opening auction hook
14907
15078
  */
14908
15079
  async getOpeningAuction(hookAddress) {
14909
- return new OpeningAuction(this.publicClient, this.walletClient, hookAddress);
15080
+ return new OpeningAuction(
15081
+ this.publicClient,
15082
+ this.walletClient,
15083
+ hookAddress
15084
+ );
14910
15085
  }
14911
15086
  /**
14912
15087
  * Get an OpeningAuctionLifecycle instance for interacting with opening-auction completion flows.
@@ -14914,7 +15089,7 @@ var DopplerSDK = class {
14914
15089
  */
14915
15090
  async getOpeningAuctionLifecycle(initializerAddress) {
14916
15091
  const chainAddresses = getAddresses(this.chainId);
14917
- const resolvedInitializer = initializerAddress ?? (chainAddresses.openingAuctionInitializer ?? ZERO_ADDRESS2);
15092
+ const resolvedInitializer = initializerAddress ?? chainAddresses.openingAuctionInitializer ?? ZERO_ADDRESS2;
14918
15093
  if (resolvedInitializer === ZERO_ADDRESS2) {
14919
15094
  throw new Error(
14920
15095
  "OpeningAuctionInitializer address is not configured on this chain. Pass initializerAddress to getOpeningAuctionLifecycle(), or override it via builder.withOpeningAuctionInitializer()."
@@ -14932,7 +15107,7 @@ var DopplerSDK = class {
14932
15107
  */
14933
15108
  async getOpeningAuctionPositionManager(positionManagerAddress) {
14934
15109
  const chainAddresses = getAddresses(this.chainId);
14935
- const resolvedPositionManager = positionManagerAddress ?? (chainAddresses.openingAuctionPositionManager ?? ZERO_ADDRESS2);
15110
+ const resolvedPositionManager = positionManagerAddress ?? chainAddresses.openingAuctionPositionManager ?? ZERO_ADDRESS2;
14936
15111
  if (resolvedPositionManager === ZERO_ADDRESS2) {
14937
15112
  throw new Error(
14938
15113
  "OpeningAuctionPositionManager address is not configured on this chain. Pass positionManagerAddress to getOpeningAuctionPositionManager(), or resolve it from the initializer via OpeningAuctionLifecycle.getPositionManager()."